diff -Nru wine1.7-1.7.14/ANNOUNCE wine1.7-1.7.18/ANNOUNCE --- wine1.7-1.7.14/ANNOUNCE 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/ANNOUNCE 2014-05-02 18:15:48.000000000 +0000 @@ -1,17 +1,17 @@ -The Wine development release 1.7.14 is now available. +The Wine development release 1.7.18 is now available. What's new in this release (see below for details): - - More Task Scheduler support. - - Improvements for AVI encoding support. - - More VisualBasic interfaces in MSXML. - - Support for deflate content encoding in Wininet. - - Some fixes for monochrome printers. + - Improved OLE Accessible Object support. + - Window sizing improvements in the Mac driver. + - Fixes for various memory issues found by Valgrind. + - A few more MSHTML functions. + - Some DirectDraw cleanups. - Various bug fixes. The source is available from the following locations: - http://prdownloads.sourceforge.net/wine/wine-1.7.14.tar.bz2 - http://mirrors.ibiblio.org/wine/source/1.7/wine-1.7.14.tar.bz2 + http://prdownloads.sourceforge.net/wine/wine-1.7.18.tar.bz2 + http://mirrors.ibiblio.org/wine/source/1.7/wine-1.7.18.tar.bz2 Binary packages for various distributions will be available from: @@ -27,374 +27,347 @@ ---------------------------------------------------------------- -Bugs fixed in 1.7.14 (total 56): +Bugs fixed in 1.7.18 (total 80): - 3901 Rayman 3 Hoodlum Havoc installer can't copy files - 5552 Need for Speed Porsche 2000 doesn't see DX as installed - 7602 MPLAB 7.52 starts with errors - 8391 EDWinXP 1.50 trial version aborts after splash screen (IPicture DISPID_PICT_RENDER support missing) - 8539 VMXBuider 0.8 (VB6 app) fails to create new VM, reporting "Run-time error '-2147417848 (80010108)': Automation error" - 9396 Solidworks 2006/2007/2012 fails to save files, reporting 'An unsupported operation was attempted.' (comdlg32 version resource outdated/inconsistent with default WinVer setting) - 12757 Europa Universalis Rome crashes on startup (D3DXLoadSurfaceFromFileInMemory must not unconditionally call CoUninitialize(), different COM threading model used) - 15286 Multiple applications need Windows Media Player ActiveX control: CLSID 6bf52a52-394a-11d3-b153-00c04f79faa6 (iMesh 7.x, Amazon mp3 downloader, ...) - 15480 Saving files in Microsoft Word/Excel 2000-2010 creates useless .lnk files (CSIDL_RECENT folder missing) - 16360 Help does not work in Office 2000 - 19513 Rise of Legends: CD2 is not recognized (wine eject/umount/remount doesn't work) - 20209 AverTV installer for AverMedia AverTV Hybrid Volar HX crashes - 22010 Europa Universalis: For the Glory; crashes on startup - 22089 Starcraft II license screen - moving the mouse makes installer think you've read entire license - 22171 BizAgi Process Modeler requires gdiplus.GdipWidenPath() implementation (Mono, MS .NET) - 22935 Double clicking a word file can't open it (opens fine from Word 2007 opens it) - 22986 can't read DivX 7.2 licence agreement - 23577 Kaspersky Internet Security 2010 installation problem: needs Win XP SP 2 (builtin 'fltlib.dll' needs version resource) - 24419 Nvidia hdr sample crashes without native d3dx9_36 - 25430 Internet Explorer 4 can't load the WineHQ forum without native urlmon - 25668 DAEMON Tools 3.47 installer crashes on unimplemented function setupapi.dll.SetupDiSetSelectedDevice - 26461 OmniPage 17 installer fails to complete (hangs, heap corruption) - 26517 The game Battleground Europe crashes - 26568 Siemens PLM NX 7.5: License Server installation hangs up on starting services - 26602 MS Excel 2007: Excel hangs-up after closing solver - 26654 MS Office 2000 programs crash when resizing windows - 26927 iTunes 10.2.2 store homepage is black - 27236 Lego Pirates of the Carribean demo: psychadelic rendering artifacts - 27504 Freejack downloader crashes before downloading files - 28067 In Battleground Europe mouse stuck in middle of screen - 28080 Radeon Bios Editor v1.28 (VB6 app) crashes when saving modified BIOS files - 28405 AVID/Pinnacle LE 6.10 crashes on unimplemented function setupapi.dll.SetupAddToSourceListA - 28972 Seagate Crystal Enterprise 8.0 installer fails when starting services - 29432 Mezzmo DLNA media server 3.4 crashes on startup - 29447 ZBrush 4R2 not launching - 29846 HTML-Kit 292 can't show any plugin previews except the default - 29856 Password Safe 3.26 initial default help page is blank (invalid MSITStore moniker constructed) - 29954 ERWIN r8.2 cannot install due to missing ERwinIScustomactions.dll - 29987 BlueKenue 3.x crashes on startup - 30097 Can't host server on Terraria 1.1 - 30099 Terraexplorer 6.1 not run - 30324 imgburn 2.5.7.0 crashes on startup - 30876 Diablo 1 demo crashes - 31111 wmp9 install fails with builtin pidgen - 33489 WinRAR 5.0 beta 1 help causes HH crash - 33947 Battle.net desktop app crashes after 15 seconds - 35107 Cannot display japanese vertical text correctly. - 35572 gdi32:font fails on Windows 2000 - 35624 3Dmark 2001 SE: Broken "Fill Rate (Multi-Texturing)" test - 35629 Zynaps: menu is rendered incorrectly - 35635 VMXBuider 0.8 (VB6 app) fails to create new VM, reporting "Run-time error '445'" - filesys_get_Drives - 35636 JobTabs Free Resume Builder 2013 (vb6 app) fails on startup (failure to parse app SxS manifest referencing registry free COM server) - 35668 HEDZ installer crashes - 35673 Gallium 0.4 on SVGA3D not recognized (running Call To Power 2 stops) - 35676 iMesh 7.x crashes on IWMPCore::get_settings method stub - 35691 IPLA 0.9 installer aborts with 'Windows Media Player version 9 or newer needed' (wmp.dll version resource missing) + 5944 IBM Lotus Notes 7.x/8.x: 'File > Preferences > User Preferences...' results in crash + 9667 Grim Fandango hangs if X in 24bpp mode + 13581 mouse corruption in lionheart + 14060 Magic: The Gathering Online 3.x fails to connect/login to server + 15784 Grim Fandango: altered colors + 16966 Powerslide segfaults + 17105 Magic: The Gathering Online 3.0 fails to log in with L0014 + 18119 SmartDraw 2009/2010/CI aborts after displaying trial window + 18433 Rosetta Stone Online Spanish (version 0.87594D 221) hangs at "5" during startup + 18614 Problem with starting of wine or winecfg + 19151 Spotify crashes in the mittle of a song and give me a pop-up fault message + 19896 GPS Utility 5.02 fails to connect to GPS device (USB serial) + 20336 GetDriveTypeW exposes partially uninitialized out parameter iosb in NtDeviceIoControlFile ? + 20853 Write buffer overflow in msi/tests/automation.c? + 22515 Gothic 2 1.3 Infogrames Edition installer crashes + 22781 ExpressPCB crashes when you try to upload a board + 23857 Half-Life (Steam) doesn't run + 23995 Football Manager 2010 fails to start + 24064 Many steam games crash because of GameOverlayRenderer.dll + 25241 Steam: Source based games will not start + 26043 advapi32/security tests shows some leaks in valgrind + 26066 use after free in X11DRV_GetKeyboardLayout? + 26639 Steam: crashes randomly while downloading L4D2 + 26895 Microsoft 3D Movie Maker: rendering is red mesh/black text on black background + 27102 VoipBuster 4.x crashes on startup + 27413 Segmentation fault in Kudos 2 Demo + 27441 El Matador crashes when starting a level(ASSERTION failed) + 28398 Might & Magic VI Heroes - fails to start game, crashes right after menu + 28621 Magic: The Gathering Online 3.x updater tool 'Kicker.exe' hangs + 28628 advapi32/security.ok: GetTokenInformation(Token, TokenGroups,...) returns partial garbage leading to uninitialized memory accesses? + 28695 Uninitialized variables in create_rebar + 28697 ieframe/tests/ie.ok: Use-after-free (after ImageList_ReplaceIcon) + 28708 gdiplus/tests/image.ok: test_fromhicon triggers reference of uninitialized variable from SetDIBits + 28712 winhttp/notification.ok: invalid read in check_notification + 28761 ddraw/tests: invalid writes in ddraw_surface7_Release and friends + 28767 shell32: uninitialized memory used during TRASH_EnumItems, triggered by "make recyclebin.ok" + 28797 comctl32/tests/listview.ok triggers uninitialized memory read of local variable in NC_DrawCaption() + 28815 kernel32/tests/fiber.ok shows longjmp-related uninitialised memory references + 28921 Battlefield 3 crashes on installation + 28943 Notepad2 v4.2.25 installation fails + 29882 Authorware Web Player 2004 Plugin - mouseClicks and keystroke are not recognized + 30352 builtin iexplore + selenium hangs on startup + 30518 Multiple 64-bit applications need KERNEL32.dll.RtlInstallFunctionTableCallback (Mono, Metatrader 5 Agent) + 30616 7.62 High Calibre configuration tool unusable (can't make changes) + 31918 Saints Row the Third (Steam) crashes on startup (needs support for PrimitiveMiscCaps 'D3DPMISCCAPS_PERSTAGECONSTANT') + 32108 Borderlands 2 (Steam) fails to start + 32138 Dishonored crashes on startup + 32348 Crysis 2 fails to launch + 33146 Path of Exile "Allocating Space" very slow, due to NtFlushVirtualMemory being synchronous + 33347 WISO (Steuer) Sparbuch 2012/2013 fails during online activation (needs HTMLElementCollection_get__newEnum) + 33606 Spin Tires: black menu with missing text (per-stage constants handling needed) + 33745 SimCity Societies launcher (.NET app) crashes on startup (incorrect canonicalization of URL containing trade mark sign character U+2122) + 33958 wine programs crash with joystick connected (OS X) + 34581 Shadow Era client v20120 (Mono game) reports 'Fatal error in gc - GetThreadContext failed' during update/patching + 34698 QQGame 2011 can't load (broken app uses LocalAlloc handle as direct buffer without prior locking) + 34823 Sybase PowerDesigner 16.5 'pdshell16.exe' (.NET 4.x app) fails on startup + 35321 Wolverine: game crash after Unreal technology logo + 35788 Planetside 2 crashes on launch (uninitialized/implausible MONITORINFOA.cbSize passed to GetMonitorInfoA, causing stack buffer overwrite) + 35835 Symantec Norton 360 installer crashes on unimplemented function advapi32.dll.GetTraceLoggerHandle + 36015 FIFA 2002 demo crashes because gethostbyaddr with magic loopback address return NULL + 36024 Adobe Reader 8.1.1 fails to install + 36026 Hawking control center driver install tool crashes during uninstallation (needs shlwapi.SHRegCreateUSKeyA implementation) + 36036 Does not run WorldOfTanks 0.9 in 1.7.17 + 36043 Battlefield 1942: Crashes after map loading + 36046 Absolute Blue demo launcher refuses to run + 36050 Dragon NaturallySpeaking 12.x crashes on unimplemented function msvcr100.dll._wcsupr_l + 36068 Symantec Norton 360 installer needs advapi32.dll GetTraceEnableLevel and GetTraceEnableFlags stubs + 36069 invalid free in oleaut32/tests/vartype test + 36070 Football Manager 2010 demo WMI query 'SELECT Manufacturer,CurrentClockSpeed FROM Win32_Processor' results in endless looping + 36078 .NET 3.0 installer encounters an error and rolls back the installation + 36080 Fifa 11 demo crashes on startup + 36099 Ankh 2: Heart of Osiris fails to start + 36106 Installshield Wizard: scrollbar appears where it shouldn't be + 36114 msi/action definite leak in is_process_limited + 36132 valgrind shows some leaks in gdiplus/tests/graphics.c + 36149 valgrind shows some an unintialized variable in jscript/tests/run.c + 36161 valgrind shows a leak in wmiutils/tests/path.c + 36177 Saints Row the Third (Steam) crashes on startup (expects 'PixelShader1xMaxValue' >= 32) + 36207 Steel Beasts v1.19 demo installer crashes on exit + 36210 Sybase PowerDesigner 16.5 'pdshell16.exe' (.NET 4.x WPF app) wants oleacc.CreateStdAccessibleObject ---------------------------------------------------------------- -Changes since 1.7.13: +Changes since 1.7.17: -Alexandre Julliard (3): - ntdll: Detect 16-bit modules and resolve imports for them. - configure: Avoid printing empty warning lines. - kernel32/tests: Add more Unicode digit ranges. - -Alistair Leslie-Hughes (1): - dpnet: Add pointer tests and checks in EnumServiceProvider. - -André Hentschel (3): - kernel32/tests: Remove unused assertion header. - ws2_32/tests: Test OOB data more sequential by sending bidirectional. - ws2_32/tests: Get rid of the do_oob_send helper function. - -Aric Stewart (4): - secur32: Return success on graceful close of SSL connection. - dmime: Do not try to query a NULL direct sound buffer. - shell32: Improve the FO_MOVE operation. - user32: Correct buffer calculation for GetMenuStringA. - -Bruno Jesus (3): - ws2_32/tests: Add W2K error values as valid. - po: Update Brazilian Portuguese translation. - po: Update Portuguese translation. - -Christoph von Wittich (2): - comctl32: Rename TBSTYLE_EX_UNDOC1 to TBSTYLE_EX_VERTICAL. - comctl32/tests: CCS_VERT should be set when TBSTYLE_EX_VERTICAL is set. - -Daniel Lehman (1): - ole32: Make some COM functions hot-patchable. - -Dmitry Timoshkov (18): - xmllite: Also clear the attr pointer in reader_clear_attrs. - include: Fix typedef for TASK_RUNLEVEL_TYPE. - taskschd: Add support for reading more TaskSettings fields to XML parser. - taskschd: Add support for reading RegistrationInfo to XML parser. - taskschd: Add support for reading Principals to XML parser. - taskschd: Add initial version of the task definition XML writer. - taskschd: Add support for RegistrationInfo to task definition XML writer. - taskschd: Add support for Principals to task definition XML writer. - taskschd: ITaskService::NewTask doesn't need a server connection. - taskschd/tests: Add more various tests. - taskschd: Add a check for the task namespace. - taskschd: Don't accept task XML with an invalid boolean value. - taskschd: Return appropriate error code for a malformed XML. - taskschd: Add more tests for RegisterTask, GetTask and DeleteTask. - taskschd/tests: Add more ITaskFolder::RegisterTask tests. - gdiplus/tests: Mark some GdipGetPropertyItem test results as broken under XP. - kernel32/tests: Add some tests for CreateFile called on a directory instead of a file. - kernel32/tests: Add a test for CreateFile called with TRUNCATE_EXISTING/FILE_WRITE_DATA parameters. - -Erich Hoover (2): - hhctrl.ocx: Support delimited filenames for HH_DISPLAY_TOPIC data. - hhctrl.ocx: Permit HTML start/end tags within quoted attributes. - -François Gouget (16): - d3d9/tests: Fix some test failures on Windows 2000. - oleaut32/tests: Skip the test_stub() tests if we have insufficient privileges. - winmm/tests: Change the current directory to a place that will be writable. - d3d10_1: Make debug_d3d10_{driver_type,feature_level}() static. - ddraw/tests: Fix some comma versus semi-colon mixups. - ddraw/tests: Simplify the 'NT4 testbot' special case a bit. - xcopy/tests: Fix the test in case stdin has been redirected. - oleaut32/tests: Fix compilation on systems that don't support nameless structs. - advapi32/tests: Fix the backup tests when run in a non-administrator pre-Vista account. - kernel32/tests: Skip some profile tests if not allowed to create files in the Windows directory. - msi/tests: Check that we have enough privileges to run the automation tests. - msi/tests: Avoid source test failures when running in an account with insufficient privileges. - msi/tests: Avoid msi test failures when running in an account with insufficient privileges. - msi/tests: Skip some package tests if in a non-administrator, non-power user account. - msi/tests: Update is_process_limited() to deal with non-administrator accounts. - faultrep/tests: Update is_process_limited() to deal with non-administrator, non-power user accounts. - -Frédéric Delanoy (12): - msvidc32: Use BOOL type where appropriate. - taskkill: Use BOOL type where appropriate. - atl/tests: Use BOOL type where appropriate. - d3dcompiler_43/tests: Use BOOL type where appropriate. - setupx.dll16: Use BOOL type where appropriate. - avifil32: Use BOOL type where appropriate. - comdlg32/tests: Use BOOL type where appropriate. - dplayx: Use BOOL type where appropriate. - shlwapi/tests: Use BOOL type where appropriate. - notepad: Use BOOL type where appropriate. - start: Use BOOL type where appropriate. - winemenubuilder: Use BOOL type where appropriate. - -Gediminas Jakutis (2): - d3dx9: Implement D3DXCreateBox(). - d3dx9/tests: Add a mesh test for D3DXCreateBox(). - -Grazvydas Ignotas (2): - include: Remove unneeded semicolons and fix a typo. - winegcc: Define __stdcall and similar attributes to nothing on ARM. - -Hans Leidekker (11): - msi: Don't install services without an image path. - msi: Use an INSTALLSTATE variable to track install state of classes and extensions. - msi: Get rid of the InstallMe field in MSIMIME. - msi: Correctly [un]register progids when associated class and extensions change state. - winspool: Add stub implementations of UploadPrinterDriverPackageA/W. - wbemprox: Implement Win32_DiskDrive.MediaType. - wbemprox: Implement Win32_PhysicalMedia.Tag. - wbemprox: Add support for negated expressions in WHERE clauses. - msi: Remove the product reference when a shared component is unregistered. - ws2_32/tests: Mark some test results on Windows 8 as broken. - advapi32/test: Fix test failures on filesystems where compression is enabled. - -Henri Verbeet (24): - d3d9/tests: Get rid of "skip_once" in yuv_layout_test(). - ddraw/tests: Try 24 bpp display modes if 32 bpp modes are unavailable. - ddraw/tests: Properly create offscreen plain surfaces. - ddraw/tests: Don't trust what EnumDevices() tells us about the supported Z buffer formats. - wined3d: Also trace "mem" and "pitch" in wined3d_surface_update_desc(). - wined3d: Filter redundant WINED3D_MAP_DISCARD buffer maps. - ddraw: User memory surfaces should be in the system memory pool. - ddraw: User memory surfaces should be created with an explicit pitch. - ddraw: Don't overwrite the caller specified pitch in ddraw_surface_init(). - ddraw: Validate the surface pitch for user memory surfaces in ddraw_surface_init(). - ddraw: Clear DDSD_LPSURFACE after surface creation. - ddraw: Disallow user memory surfaces before version 4. - ddraw/tests: Add a test for creating surfaces with an explicit pitch. - ddraw/tests: Avoid using EnumDevices() to get a supported Z buffer format. - wined3d: Recognize VMware SVGA3D. - wined3d: Get rid of GL_VENDOR_INTEL. - ddraw/tests: Verify that creating a ddraw object works before running any real tests. - d3d8/tests: Don't bother handling Direct3DCreate8() failures, we verified it works earlier. - d3d9/tests: Don't bother handling Direct3DCreate9() failures, we verified it works earlier. - d3d9/tests: Use create_device() in more tests. - d3d8/tests: Use create_device() in more tests. - d3d9/tests: Handle failure to create a device in the stateblock tests with skip(). - d3d8/tests: Handle failure to create a device in the stateblock tests with skip(). - d3dx9: Use a 1x1x1 unit box in D3DXCreateBox(). - -Huw D. M. Davies (2): - wineps: Use the correct colours when a monochrome bitmap without a colour table is the source. - wineps: Return 32 even for monochrome printers. - -Jacek Caban (29): - urlmon: Fixed some tests on IE11. - wmp: Return success in IPersistStreamInit::InitNew. - wmp: Added DoVerb(OLEIVERB_HIDE) implementation. - wmp: Added SetObjectRects implementation. - wmp: Added IOleControl stub implementation. - urlmon: Fixed protocol tests on IE11. - urlmon: Query bind info object for BINDSTRING_ROOTDOC_URL. - wmp: Added IWMPPlayer4::get_settings implementation. - urlmon: Fixed url.c tests on IE11. - wmp: Added version info resources. - secur32/tests: Fixed tests with new winehq.org setup. - wininet/tests: Fixed tests for the new winehq.org cert. - qcap: Added AVICompressorIn_Disconnect implementation. - crypt32: Moved chain engine handle handling to separated function and improved error handling. - crypt32: Added support for HCCE_LOCAL_MACHINE. - mshtml: Don't use fragment navigation for SuperNavigate calls. - wininet: Renamed read_mode_t to blocking_mode_t. - wininet: Use blocking_mode_t instead of flags in NETCON_recv. - wininet: Improved non-blocking mode in secure NETCON_recv. - wininet: Get rid of no longer needed size calculation in netconn_read. - wininet: Use non-blocking reads in netconn_drain_content. - wininet: Get rid of no longer needed hack in gzip_read that prevents consuming the whole input buffer until we're at the end of stream. - wininet: Added support for raw deflate content encoding. - atl/tests: Use HKCU instead of HKCR for registrar tests. - ws2_32: Improved WSAIoctl debug messages. - vbscipt: Added beginning support for arrays as class members. - vbscript: Directly access 'this' object properties in interpreter. - crypt32: Simplified getting context expiration. - urlmon/tests: Use asynchronous binding for invalid cert tests. - -Kai Tietz (2): - d3dx9core.h: Allow overriding D3DX_SDK_VERSION. - d3dx9shader.h: Added some missing declarations. - -Ken Thomases (8): - wined3d: Call context_enter() before context_update_window() so it records the proper restore state. - wined3d: Remove redundant call to context_set_pixel_format() from context_update_window(). - wined3d: Use a separate flag to track if the GL context needs to be made current. - wined3d: Make context_update_window() just mark the GL context as needing to be set rather than setting it. - wined3d: Restore the pixel format of the window whose pixel format was actually changed. - d3d9/tests: Test that Direct3D9 doesn't modify the pixel format of the window it targets. (try 4, resend). - d3d8/tests: Test that Direct3D8 doesn't modify the pixel format of the window it targets. - ddraw/tests: Test that DirectDraw doesn't modify the pixel format of the window it targets. - -Lauri Kenttä (2): - readme: Update Norwegian Bokmål translation. - readme: Update Swedish translation. - -Marcus Meissner (1): - include: Added missing FindExInfoBasic enum. - -Matteo Bruni (15): - d3dx9: Calling CommitChanges with no active pass silently returns. - d3dx9: Call D3DCompile() for ASCII effects. - d3dx9: Kill a noisy TRACE. - d3dx9: Remove Begin/End stub fixmes. - d3dx9: Don't call CoUninitialize if CoInitializeEx failed. - d3dx9: Turn D3DXCreateEffectEx FIXME into a TRACE, improve it a bit. - d3dx9: Always use type->Rows as D3DXPC_MATRIX_ROWS parameters size. - d3dx9: Improve a number of WARN messages. - d3dx9: Allow loading DDS volume textures into 2D textures. - d3dx9/tests: Replace a test giving inconsistent results on Windows. - d3dx9: Fix an error trace. - d3dx9: Introduce a handle table for parameters to make lookup faster. - d3dx9: Support skipping mip levels in D3DXCreateTextureFromFileInMemoryEx. - d3dx9: Free string data. - wined3d: Free CS data on CS destruction. - -Michael Stefaniuc (8): - qedit: Use the generic IEnumPin implementation for SampleGrabber. - avifil32: Basic COM cleanup for IAVIFile from WAVFile. - avifil32: Unconditionally support IAVIStream in WAVFile. - avifil32: Support COM aggregation in WAVFile. - avifil32/tests: Add WAVFile COM tests. - avifil32: Merge IPersistFile into the WAVFile object. - avifil32: Merge IAVIStream into the WAVFile object. - avifil32: Avoid forward declarations of COM methods. - -Nikolay Sivov (42): - oleaut32/tests: Test for VariantClear() on VT_RECORD variant. - oleaut32: Fix VariantCopy() for VT_RECORD variants. - oleaut32: Fix SafeArrayPutElement() for FADF_RECORD arrays. - oleaut32/tests: Test for internal safearray data layout. - oleaut32: Fix buffer increment step for VT_RECORD case doing SafeArrayCopyData(). - scrrun: Added a IDriveCollection stub. - scrrun: Added a IEnumVARIANT stub for IDriveCollection. - include: Use existing DISPID values instead of magic numbers. - oleaut32: Some tests for IFontEventsDisp change event. - ntdll: Use case-insensitive matching for typelib flags. - shell32/tests: Fix some test failures on Win8. - oleaut32: Propagate return codes properly. - oleaut32: Fix SafeArrayGetElement() for FADF_RECORD arrays. - oleaut32: Use better naming to clarify copy direction. - scrrun: Added IDrive stub and Next() for drive collection. - scrrun: Implement DriveType property of IDrive. - fntcache: Added stub Font Cache service. - programs: Added stub wevtutil tool. - dmime: COM cleanup of IDirectMusicSegmentState8 interface. - dmime: COM cleanup of IDirectMusicGraph interface. - kernel32: Partial implementation for GetCalendarInfoEx(). - oleaut32: Implement DISPID_PICT_RENDER dispid. - fontsub: Added dll stub. - msxml3: Unify Invoke()/InvokeEx() tracing format. - msxml3: Support VT_BSTR|VT_BYREF as reader input. - msxml3: Fix IVBSAXXMLReader interface definition. - msxml3: Support more variant types in putProperty(). - msxml3: Added IVBSAXDeclHandler interface for MXWriter. - msxml3: Added IVBSAXLexicalHandler interface for MXWriter. - msxml3: Added partial implementation of IVBSAXContentHandler for MXWriter. - msxml3: Added stub support for ISAXDTDHandler/IVBSAXDTDHandler for MXWriter. - msxml3: Added stubs for ISAXErrorHandler/IVBSAXErrorHandler for MXWriter. - msxml3: Fix return values for some methods needed by SAX reader. - msxml3: Fix IVBSAXAttributes handling of retval BSTRs. - msxml3: Fix retval BSTR handling for IVBSAXXMLReader. - msxml3: Fix BSTR retval handling for IVBSAXLocator. - msxml3: Implement startElement() for writer's IVBSAXContentHandler. - msxml3: Implement endElement() for writer's IVBSAXContentHandler. - oleaut32/tests: Some tests for propputref invocation. - msxml3: Make propputref methods invocable with DISPATCH_PROPERTYPUT. +Akihiro Sagawa (4): + gdi32/tests: Make bmi structure const. + msvfw32/tests: Add tests for drawdib. + msvfw32: Drawdib doesn't support inverted DIBs. + msvfw32: Fix uncompressed bitmap size handling in DrawDibDraw. + +Alex Henrie (1): + bcrypt: Add stub for BCryptOpenAlgorithmProvider. + +Alexandre Julliard (8): + msvcrt: Update comments for non-exported functions. + dxguid: Remove some symbols that aren't exported in native. + ntdll: Don't wait for writes to complete in NtFlushVirtualMemory. + gdi32/tests: Don't fetch the bits into the DIB itself. + msvcp90: Fix the mbstowcs_s macro return value. + winegcc: Only pass large-address-aware option for i386 builds. + user32: Don't bother returning a value from the SetWindowRgn driver entry point. + comctl32/imagelist: Correctly resize the alpha flags when clearing the image list. + +Alistair Leslie-Hughes (4): + include: Add dvoice.h. + dpnet/tests: Use dxguid for tests. + dpnet: Improve error checking in Get/Set SP. + dpnet: Cleanup IDirectPlay8Address. + +Andrew Eikum (2): + user32: Allow setting horizontal extent even without WS_HSCROLL. + user32: Only update listbox horizontal scroll info if WS_HSCROLL is set. + +Andrew Sheldon (1): + wined3d: Add NVIDIA Geforce GTX 780 to supported device list. + +André Hentschel (9): + advapi32: Add stub for GetTraceLoggerHandle. + winemenubuilder: Use boolean return values in boolean functions. + wined3d: Add NVIDIA Geforce GTX 780 Ti to supported device list. + advapi32: Add stubs for GetTraceEnableFlags and GetTraceEnableLevel. + shell32: Use boolean return value in boolean function. + dbghelp: Use boolean return value in boolean function. + dbghelp: Make pdb_load_stream_name_table a void function. + winemenubuilder: Return FALSE on error when processing links and URLs. + wscript: Fix function types. + +Austin English (1): + msxml3: Complain louder if libxslt was missing at compile time. + +Bruno Jesus (1): + dinput: Remove duplicated TRACE check. + +Dmitry Timoshkov (3): + user32/tests: Add AppendMenu/ModifyMenu MF_POPUP tests. + user32: When converting from MF_ flags to MENUITEMINFO ignore MF_POPUP if id is not a menu. + ole32: Add support for VT_DISPATCH/VT_UNKNOWN to PropVariantClear and PropVariantCopy. + +Erich Hoover (1): + user32: Reduce the minimum Set[System]Timer from 15 ms to 10 ms. + +François Gouget (3): + ddraw: Remove WINAPI on static functions where not needed. + ole32/tests: Add a trailing '\n' to an ok() call. + dpnet/tests: Add a trailing '\n' to an ok() call. + +Frédéric Delanoy (2): + po: Update French translation. + Assorted spelling/grammar fixes. + +Gerald Pfeifer (1): + readme: Raise the minimum version of FreeBSD to 8.0. + +Hans Leidekker (6): + wbemprox: Return selected properties only from IWbemClassObject::GetNames. + wbemprox: Return selected properties only from IWbemClassObject::Next. + wbemprox: Implement Win32_Processor.CurrentClockSpeed. + wmiutils: Fix a memory leak (valgrind). + msi/tests: Fix a couple of memory leaks (valgrind). + msi: Avoid a crash when MIME entries point to non-existing extensions. + +Henri Verbeet (30): + d3d8/tests: Use a separate device for offscreen_test(). + d3d8/tests: Use a separate device for z_range_test(). + d3d8/tests: Use a separate device for fog_test(). + d3d8/tests: Use a separate device for clear_test(). + d3d8/tests: Use a separate device for lighting_test(). + d3d8/tests: Use a separate device for depth_clamp_test(). + d3d8/tests: Use a separate device for test_sanity(). + d3d8/tests: Handle the Windows 8 testbot results in zenable_test(). + d3d8/tests: Handle the Windows 8 testbot results in cnd_test(). + wined3d: Ignore invalid PCI vendor/device overrides. + wined3d: Simplify the driver version info lookup in init_driver_info(). + wined3d: Introduce a separate function to calculate the pitch for a given format and width. + ddraw: Validate the pitch for user memory surfaces against the unaligned minimum pitch. + wined3d: Implement support for per-stage texture stage constants. + wined3d: Get rid of surface_set_texture_target(). + ddraw: Implement D3DOP_STATELIGHT on top of IDirect3DDevice3_SetLightState(). + ddraw: Implement D3DOP_STATERENDER on top of IDirect3DDevice3_SetRenderState(). + ddraw: Cleanup the D3DOP_PROCESSVERTICES implementation a bit. + ddraw: Cleanup d3d_execute_buffer_QueryInterface(). + ddraw: Don't return an error when setting a 0 material handle in d3d_device3_SetLightState(). + ddraw/tests: Handle the Windows 8 testbot in test_primary_palette(). + ddraw: Disable lighting when a 0 material handle is set. + ddraw: Reject setting a 0 material handle in d3d_viewport_SetBackground(). + ddraw: Only output a warning when clearing a viewport without background material. + ddraw/tests: Add some basic material tests. + wined3d: Bump ps_1x_max_value. + wined3d: Fix a couple of string declarations. + ddraw: Cleanup DDRAW_dump_pixelformat(). + d3dcompiler: Make some string arrays const. + d3d9/tests: Merge vertexdeclaration.c into device.c. + +Huw D. M. Davies (4): + include: Add a few missing out-precision and clip-precision defines. + shlwapi/tests: Fix win8 test failures. + ole32/tests: Fix win8 test failures. + kernel32/tests: Fix test for win8 heap layout. + +Jacek Caban (17): + mshtml: Added IHTMLElementCollection::get__newEnum implementation. + mshtml: Added IHTMLElementCollection::get__newEnum tests. + mshtml: Fixed HTMLElementCollectionEnum_Next implementation for NULL pCeltFetched. + mshtml: Added IHTMLDOMChildrenCollection::get__newEnum implementation. + mshtml: Added IHTMLDOMChildrenCollection::get__newEnum tests. + vbscript: Return proper error on invalid argument in Chr. + mshtml: Added IConnectionPoint::EnumConnections implementation. + ieframe: Improved debug traces. + mshtml: Introduce a new debugstr_mshtml_guid helper for printing GUIDs. + mshtml: Renamed nsIDOMHTMLSelectElement::Remove to select_Remove to avoid conflict with nsIDOMElement. + mshtml: Removed invalid nsAString_InitDepend from HTMLTable_put_bgColor and fixed error handling. + jscript: Fixed uninitialized variable access in interp_end_finally. + iexplore: Mark iexplore.exe as large address aware. + vbscript: Forward Invoke call to InvokeEx. + msctf: Added ITfInputProcessorProfileMgr interface stub implementation. + vbscript: Allow property getters to take arguments. + vbscript: Added InvokeEx(DISPATCH_PROPERTYGET) implementation. + +Jérôme Gardou (1): + msi: Expand REG_EXPAND_SZ keys when resolving AppSearch entries. + +Ken Thomases (5): + winex11: Remove dead store into win_gravity in get_window_attributes(). + winemac: For GetKeyNameText(), use the hard-coded table in preference to the Mac keyboard layout. + winemac: Send WM_SIZING messages during resizing to let app alter the proposed size. + winemac: Disable moving or resizing windows when cursor clipping is in effect. + configure: Use the discovered LCMS2_LIBS when testing linking against lcms2. + +Matteo Bruni (7): + d3dx9/tests: Release the device when skipping some tests. + d3dx9/tests: Don't fail a test if volume textures are not supported. + d3dx9/tests: Fix expected values when mipmaps on cube maps are not supported. + d3dx9/tests: Take MaxVolumeExtent into account in some tests. + d3dcompiler: Remove a couple of noisy traces. + d3dcompiler: Pre/post increment/decrement operators are unary. + d3dcompiler: add_func_parameter is only used in hlsl.y. + +Nikolay Sivov (23): + gdiplus: Properly delete a DC. + services: Remove loop that's not really used anymore (Coverity). + atl: Move IUnknown methods to IOleClientSite. po: Update Russian translation. - user32/tests: Properly maintain clipboard viewers chain. - -Piotr Caban (26): - qcap: Add Avi Mux input pin IMemInputPin::GetAllocatorRequirements implementation. - qcap: Don't define IMemInputPin_iface in AviMuxIn structure. - qcap: Add Avi Mux input pin IMemInputPin::GetAllocator. - qcap: Add Avi Mux input pin IMemInputPin::NotifyAllocator. - qcap: Add Avi Mux IConfigInterleaving::put_Mode implementation. - qcap: Add Avi Mux input pin IMemInputPin::ReceiveCanBlock implementation. - qcap: Fix Avi Mux IConfigInterleaving::put_Mode implementation. - qcap: Add Avi Mux IConfigInterleaving::put_Interleaving implementation. - qcap: Add support for FORMAT_VideoInfo pins in AviMuxIn::ReceiveConnection. - qcap: Add partial Avi Mux IBaseFilter::Run implementation. - qcap: Add Avi Mux Receive helper implementation. - qcap: Add Avi Mux IMemInputPin::Receive implementation. - qcap: Add Avi Mux IBaseFilter::Stop implementation. - qcap: Fix strf chunk size in AviMuxIn_ReceiveConnection. - qcap: Fix some memory leaks in Avi Mux. - qcap: Fix uninitialized variable access in Avi Mux. - qcap/tests: Add more Avi Mux tests. - qcap/tests: Add option to save generated avi file. - user32: Check WS_CHILD style in IsChild function. - ole32: Change DoDragDrop return value on IDropTarget::Drop call. - ole32: Merge OLEDD_TrackMouseMove and OLEDD_TrackStateChange functions. - ole32: Fix DROPEFFECT value in OLEDD_TrackStateChange. - ole32: Add more DoDragDrop tests. - ole32/tests: Fix DoDragDrop tests. - hlink: Improve file protocol handling in HlinkParseDisplayName. - dinput8: Create a window that will receive events generated by input tests. - -Stefan Dösinger (5): - wined3d: surface_load_ds_location can handle WINED3D_LOCATION_DISCARDED. - ole32: Make CoCreateInstance hookable for Steam. - user32: Make SetWindowTextA/W hookable. - d3d9: Make ResetEx and PresentEx hookable. - winmm: Make some joystick functions hookable. - -Stefan Leichter (3): - wtsapi32/tests: Add some tests for WTSEnumerateProcessesW. - fltlib: Add a version resource. - comdlg32: Update version resource to values reported from XP. - -Vincent Povirk (3): - msi/tests: Add tests for [un]registering progids. - ole32: Use pstgPriority if specified in StgOpenStorage. - kernel32: Cache locale info from the registry. + comctl32/treeview: Restore hdc before CDDS_ITEMPOSTPAINT. + mshtml/tests: Remove old system version check that doesn't work anymore. + netprofm/tests: Fix a test failure on Win7/Win2008 systems. + shlwapi: Implement SHRegCreateUSKeyA(). + oleaut32: Properly free record name (Valgrind). + uxtheme/tests: No need to check last error when error code is explicitly returned. + advapi32/tests: Fix some leaks in tests (Valgrind). + comctl32/tests: Initialize text buffer pointer (Valgrind). + crypt32/tests: Fix some leaks (Valgrind). + gdi32/dibdrv: Fix a clipped_rects leak (Valgrind). + dwrite/tests: Fix a font instance leak (Valgrind). + gdiplus/tests: Fix some leaks when running with Wine (Valgrind). + gdiplus: Simplify GdipResetImageAttributes(), fix remap table leak (Valgrind). + msxml3: Fix a leak when trying to add to readonly collection (Valgrind). + msxml3/tests: Fix enumerator instance leak (Valgrind). + msxml3: Fixed attribute value string leak (Valgrind). + msxml3: Fix XPath query result leak (Valgrind). + msxml3/tests: Fixed attributes map leak (Valgrind). + oleaut32: Always free TLIBATTR in LoadRegTypeLib() (Valgrind). + +Patrick Rudolph (4): + user32: Check for valid cbSize in GetMonitorInfoA. + user32/tests: Add tests for valid cbSize in GetMonitorInfoA. + user32: Check for valid cbSize in GetMonitorInfoW. + user32/tests: Add tests for valid cbSize in GetMonitorInfoW. + +Piotr Caban (28): + msvcrt: Don't raise exception in _invalid_parameter. + msvcrt: Remove _set_invalid_parameter_handler calls from msvcrt tests. + msvcrt: Remove no longer needed exports. + msvcrt: Use win_skip when function is not exported. + msvcrt/tests: Fix _popen test failures when path contains spaces. + msvcr80: Add type_info::name partial implementation. + msvcrt: Don't use default process heap. + include: Don't redefine LIBID_Accessibility in oleacc.idl. + oleacc: Add LresultFromObject implementation. + oleacc: Add ObjectFromLresult implementation. + oleacc: Add initial LresultFromObject tests. + oleacc: Add AccessibleObjectFromWindow implementation. + oleacc: Add AccessibleObjectFromWindow tests. + msvcrt: Add _wcsupr_l implementation. + msvcrt: Handle seh exception rethrowing in catch_function_nested_handler. + msvcrt: Handle seh exceptions rethrowing in cxx_frame_handler. + oleaut32: Handle VariantCopy errors in VariantChangeTypeEx. + oleacc: Add default client accessible object stub. + oleacc: Add Client_get_accChildCount implementation. + oleacc: Add Client_get_accName implementation. + oleacc: Add Client_get_accValue implementation. + oleacc: Add Client_get_accDescription implementation. + oleacc: Add Client_get_accRole implementation. + oleacc: Add Client_get_accHelp implementation. + oleacc: Add Client_get_accDefaultAction implementation. + oleacc: Add Client_get_accHelpTopic implementation. + oleacc: Add Client_get_accRole implementaiton. + oleacc: Add tests for default client accessible object. + +Qian Hong (2): + wscript: Don't fail silently for unsupported switches. + include: Added some ATL function prototypes. + +Stefan Dösinger (7): + ddraw: Only ddraw7 disallows SetPalette on sublevels. + ddraw/tests: Add a test for mipmap palettes. + ddraw/tests: Test P8 to RGB blits. + ddraw/tests: Skip the ddraw7 primary palette test if 8 bpp mode doesn't work. + ddraw/tests: Add a test for getdc palette handling. + ddraw/tests: Test mipmap GetDC behavior. + wined3d: Remove broken gdi palette code. + +Thomas Faber (2): + usp10: Do not write to last script item if buffer space is insufficient. + qmgr: Register WINE_REGISTRY resource in DllRegisterServer instead of a nonexistent inf file. + +Victor Martinez Calvo (2): + dbghelp: Fix invalid assignment in symt_fill_sym_info. + msvcrt: Avoid null dereference in TRACE in MSVCRT__wfreopen. + +Vincent Povirk (14): + user32/tests: Add test calling EndMenu from WM_ENTERMENULOOP. + user32/tests: Add a message test for popup menus on windows that have capture. + user32/tests: Our popup test window loses capture to itself. + shell32: Respect CMIC_MASK_NO_CONSOLE in ShellLink InvokeCommand. + shell32: Pass MASK_NO_CONSOLE through to context menu handlers. + shell32: Use CREATE_NEW_CONSOLE when SEE_MASK_NOCONSOLE is omitted. + shell32/tests: Use SEE_MASK_NO_CONSOLE with ShellExecuteExA. + start: Don't use SEE_MASK_NO_CONSOLE. + appwiz.cpl: Don't use SEE_MASK_NO_CONSOLE to run installers. + ole32/tests: Add tests for storage locking. + ole32/tests: Add tests for sharing storages in transacted mode. + ole32: Reserve the range lock sector. + ole32: Initial storage file locking implementation. + gdiplus/tests: Fix image leak in graphics test. + +Zhenbo Li (2): + mshtml: Added IHTMLElement3::contentEditable property implemention. + mshtml: Added IHTMLTable::width property implementation. -- Alexandre Julliard diff -Nru wine1.7-1.7.14/AUTHORS wine1.7-1.7.18/AUTHORS --- wine1.7-1.7.14/AUTHORS 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/AUTHORS 2014-05-02 18:15:48.000000000 +0000 @@ -106,6 +106,7 @@ Andrew Lewycky Andrew Nguyen Andrew Riedi +Andrew Sheldon Andrew Talbot Andrew Taylor Andrew Webb @@ -383,6 +384,7 @@ Erik de Castro Lopo Erik Hofman Erik Inge Bolsø +Eriks Dobelis Erik Svendsen Erwin Wolff Eryk Wieliczko @@ -515,6 +517,7 @@ Hongbo Ni Howard Abrams Howell Tam +Hugh McMaster Huw D. M. Davies Hwang YunSong (황윤성) Iain Arnell @@ -584,6 +587,7 @@ Jason McMullan Jason Phillips Jau-Horng Chen +Javier Cantero Jay Yang Jean-Bruno Luginbühl Jean-Claude Batista @@ -1162,6 +1166,7 @@ Robert Lunnon Robert McDonald Robert Millan +Robert Naumann Robert North Roberto Augusto Pungartnik Robert O'Callahan @@ -1201,6 +1206,7 @@ Rustam Chernotkach Ryan Cumming Ryan Schmidt +Ryan Turner Sagar Mittal Sam Dennis Sam Edwards @@ -1237,6 +1243,7 @@ Shaun Morris Sheri Steeves Shi Quan He +Shuai Meng Shunichi Fuji Simen Zamecnik Simeon Pilgrim diff -Nru wine1.7-1.7.14/configure wine1.7-1.7.18/configure --- wine1.7-1.7.14/configure 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/configure 2014-05-02 18:15:48.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.14. +# Generated by GNU Autoconf 2.69 for Wine 1.7.18. # # Report bugs to . # @@ -580,8 +580,8 @@ # Identity of this package. PACKAGE_NAME='Wine' PACKAGE_TARNAME='wine' -PACKAGE_VERSION='1.7.14' -PACKAGE_STRING='Wine 1.7.14' +PACKAGE_VERSION='1.7.18' +PACKAGE_STRING='Wine 1.7.18' PACKAGE_BUGREPORT='wine-devel@winehq.org' PACKAGE_URL='http://www.winehq.org' @@ -1024,6 +1024,7 @@ enable_dwrite enable_dxdiagn enable_dxgi +enable_dxva2 enable_explorerframe enable_ext_ms_win_gdi_devcaps_l1_1_0 enable_faultrep @@ -1142,6 +1143,7 @@ enable_nddeapi enable_netapi32 enable_netcfgx +enable_netprofm enable_newdev enable_normaliz enable_npmshtml @@ -1195,6 +1197,7 @@ enable_scarddlg enable_sccbase enable_schannel +enable_schedsvc enable_scrrun enable_scsiport_sys enable_secur32 @@ -1345,6 +1348,7 @@ enable_rundll32 enable_sc enable_schtasks +enable_sdbinst enable_secedit enable_servicemodelreg enable_services @@ -1969,7 +1973,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.14 to adapt to many kinds of systems. +\`configure' configures Wine 1.7.18 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -2038,7 +2042,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of Wine 1.7.14:";; + short | recursive ) echo "Configuration of Wine 1.7.18:";; esac cat <<\_ACEOF @@ -2233,7 +2237,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -Wine configure 1.7.14 +Wine configure 1.7.18 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2751,7 +2755,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.14, which was +It was created by Wine $as_me 1.7.18, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -4846,13 +4850,16 @@ fi fi if test -z "$wine_cv_toolsdir"; then + wine_makedep=tools/makedep wine_cv_toolsdir="\$(top_builddir)" elif test -d "$wine_cv_toolsdir/tools/winebuild"; then + wine_makedep=$wine_cv_toolsdir/tools/makedep case "$wine_cv_toolsdir" in /*) ;; *) wine_cv_toolsdir="\$(top_builddir)/$wine_cv_toolsdir" ;; esac enable_tools=${enable_tools:-no} + test -f "$wine_makedep" || as_fn_error $? "the Wine tools have not yet been built in $wine_cv_toolsdir" "$LINENO" 5 else as_fn_error $? "could not find Wine tools in $wine_cv_toolsdir" "$LINENO" 5 fi @@ -11748,7 +11755,7 @@ $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-llcms2 $LIBS" +LIBS="-llcms2 $LCMS2_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -13690,6 +13697,31 @@ if test "x$ac_cv_cflags__Wunused_but_set_parameter" = xyes; then : EXTRACFLAGS="$EXTRACFLAGS -Wunused-but-set-parameter" fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wvla" >&5 +$as_echo_n "checking whether the compiler supports -Wvla... " >&6; } +if ${ac_cv_cflags__Wvla+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_wine_try_cflags_saved=$CFLAGS +CFLAGS="$CFLAGS -Wvla" +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__Wvla=yes +else + ac_cv_cflags__Wvla=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__Wvla" >&5 +$as_echo "$ac_cv_cflags__Wvla" >&6; } +if test "x$ac_cv_cflags__Wvla" = xyes; then : + EXTRACFLAGS="$EXTRACFLAGS -Wvla" +fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports -Wwrite-strings" >&5 $as_echo_n "checking whether the compiler supports -Wwrite-strings... " >&6; } if ${ac_cv_cflags__Wwrite_strings+:} false; then : @@ -16578,7 +16610,7 @@ .MAKEFILEDEPS: all: Makefile Makefile: $srcdir/Makefile.in $srcdir/Make.vars.in config.status \$(MAKEDEP) - @./config.status Make.tmp Makefile && \$(MAKEDEP) ." + @./config.status Make.tmp Makefile" test "$srcdir" = . && wine_fn_append_rule "all: .gitignore .gitignore: config.status @@ -16836,6 +16868,7 @@ wine_fn_config_dll dssenh enable_dssenh wine_fn_config_test dlls/dssenh/tests dssenh_test wine_fn_config_dll dswave enable_dswave clean +wine_fn_config_test dlls/dswave/tests dswave_test wine_fn_config_dll dwmapi enable_dwmapi implib wine_fn_config_dll dwrite enable_dwrite implib wine_fn_config_test dlls/dwrite/tests dwrite_test @@ -16846,6 +16879,7 @@ wine_fn_config_dll dxgi enable_dxgi implib 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 explorerframe enable_explorerframe clean wine_fn_config_test dlls/explorerframe/tests explorerframe_test wine_fn_config_dll ext-ms-win-gdi-devcaps-l1-1-0 enable_ext_ms_win_gdi_devcaps_l1_1_0 @@ -17018,7 +17052,10 @@ wine_fn_config_dll nddeapi enable_nddeapi implib wine_fn_config_dll netapi32 enable_netapi32 implib wine_fn_config_test dlls/netapi32/tests netapi32_test -wine_fn_config_dll netcfgx enable_netcfgx +wine_fn_config_dll netcfgx enable_netcfgx clean +wine_fn_config_test dlls/netcfgx/tests netcfgx_test +wine_fn_config_dll netprofm enable_netprofm clean +wine_fn_config_test dlls/netprofm/tests netprofm_test wine_fn_config_dll newdev enable_newdev implib wine_fn_config_dll normaliz enable_normaliz implib wine_fn_config_dll npmshtml enable_npmshtml @@ -17103,6 +17140,8 @@ wine_fn_config_dll sccbase enable_sccbase wine_fn_config_dll schannel enable_schannel wine_fn_config_test dlls/schannel/tests schannel_test +wine_fn_config_dll schedsvc enable_schedsvc clean +wine_fn_config_test dlls/schedsvc/tests schedsvc_test clean wine_fn_config_dll scrrun enable_scrrun clean wine_fn_config_test dlls/scrrun/tests scrrun_test clean wine_fn_config_dll scsiport.sys enable_scsiport_sys @@ -17322,12 +17361,13 @@ wine_fn_config_program regedit enable_regedit install,installbin,manpage,po wine_fn_config_test programs/regedit/tests regedit.exe_test wine_fn_config_program regsvcs enable_regsvcs install -wine_fn_config_program regsvr32 enable_regsvr32 install,installbin,manpage +wine_fn_config_program regsvr32 enable_regsvr32 install,installbin,manpage,po wine_fn_config_program rpcss enable_rpcss clean,install wine_fn_config_program rundll.exe16 enable_win16 install wine_fn_config_program rundll32 enable_rundll32 install wine_fn_config_program sc enable_sc install wine_fn_config_program schtasks enable_schtasks install +wine_fn_config_program sdbinst enable_sdbinst install wine_fn_config_program secedit enable_secedit install wine_fn_config_program servicemodelreg enable_servicemodelreg install wine_fn_config_program services enable_services clean,install @@ -18042,7 +18082,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.14, which was +This file was extended by Wine $as_me 1.7.18, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -18113,7 +18153,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.14 +Wine config.status 1.7.18 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -18236,7 +18276,7 @@ } wine_fn_output_makefile () { - cat Make.tmp - <<\_WINE_EOF >\$tmp/makefile && mv -f \$tmp/makefile \$1 && rm -f Make.tmp && return + cat Make.tmp - <<\_WINE_EOF >\$tmp/makefile && mv -f \$tmp/makefile \$1 && rm -f Make.tmp && "$wine_makedep" . && return `cat $wine_rules_file` _WINE_EOF as_fn_error $? "could not create Makefile" "$LINENO" 5 diff -Nru wine1.7-1.7.14/configure.ac wine1.7-1.7.18/configure.ac --- wine1.7-1.7.14/configure.ac 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/configure.ac 2014-05-02 18:15:48.000000000 +0000 @@ -215,13 +215,16 @@ fi fi if test -z "$wine_cv_toolsdir"; then + wine_makedep=tools/makedep wine_cv_toolsdir="\$(top_builddir)" elif test -d "$wine_cv_toolsdir/tools/winebuild"; then + wine_makedep=$wine_cv_toolsdir/tools/makedep case "$wine_cv_toolsdir" in /*) ;; *) wine_cv_toolsdir="\$(top_builddir)/$wine_cv_toolsdir" ;; esac enable_tools=${enable_tools:-no} + test -f "$wine_makedep" || AC_MSG_ERROR([the Wine tools have not yet been built in $wine_cv_toolsdir]) else AC_MSG_ERROR([could not find Wine tools in $wine_cv_toolsdir]) fi]) @@ -1439,7 +1442,7 @@ if test "$ac_cv_header_lcms2_h" = "yes" then AC_CHECK_LIB(lcms2, cmsOpenProfileFromFile, - [AC_DEFINE(HAVE_LCMS2, 1, [Define if you have the LittleCMS development environment])],[LCMS2_LIBS=""]) + [AC_DEFINE(HAVE_LCMS2, 1, [Define if you have the LittleCMS development environment])],[LCMS2_LIBS=""],[$LCMS2_LIBS]) else LCMS2_CFLAGS="" LCMS2_LIBS="" @@ -1777,6 +1780,7 @@ WINE_TRY_CFLAGS([-Wstrict-prototypes]) WINE_TRY_CFLAGS([-Wtype-limits]) WINE_TRY_CFLAGS([-Wunused-but-set-parameter]) + WINE_TRY_CFLAGS([-Wvla]) WINE_TRY_CFLAGS([-Wwrite-strings]) dnl Check for noisy string.h @@ -2593,7 +2597,7 @@ .MAKEFILEDEPS: all: Makefile Makefile: $srcdir/Makefile.in $srcdir/Make.vars.in config.status \$(MAKEDEP) - @./config.status Make.tmp Makefile && \$(MAKEDEP) .]) + @./config.status Make.tmp Makefile]) test "$srcdir" = . && WINE_APPEND_RULE( [all: .gitignore @@ -2841,6 +2845,7 @@ WINE_CONFIG_DLL(dssenh) WINE_CONFIG_TEST(dlls/dssenh/tests) WINE_CONFIG_DLL(dswave,,[clean]) +WINE_CONFIG_TEST(dlls/dswave/tests) WINE_CONFIG_DLL(dwmapi,,[implib]) WINE_CONFIG_DLL(dwrite,,[implib]) WINE_CONFIG_TEST(dlls/dwrite/tests) @@ -2851,6 +2856,7 @@ WINE_CONFIG_DLL(dxgi,,[implib]) WINE_CONFIG_TEST(dlls/dxgi/tests) WINE_CONFIG_LIB(dxguid) +WINE_CONFIG_DLL(dxva2) WINE_CONFIG_DLL(explorerframe,,[clean]) WINE_CONFIG_TEST(dlls/explorerframe/tests) WINE_CONFIG_DLL(ext-ms-win-gdi-devcaps-l1-1-0) @@ -3023,7 +3029,10 @@ WINE_CONFIG_DLL(nddeapi,,[implib]) WINE_CONFIG_DLL(netapi32,,[implib]) WINE_CONFIG_TEST(dlls/netapi32/tests) -WINE_CONFIG_DLL(netcfgx) +WINE_CONFIG_DLL(netcfgx,,[clean]) +WINE_CONFIG_TEST(dlls/netcfgx/tests) +WINE_CONFIG_DLL(netprofm,,[clean]) +WINE_CONFIG_TEST(dlls/netprofm/tests) WINE_CONFIG_DLL(newdev,,[implib]) WINE_CONFIG_DLL(normaliz,,[implib]) WINE_CONFIG_DLL(npmshtml) @@ -3108,6 +3117,8 @@ WINE_CONFIG_DLL(sccbase) WINE_CONFIG_DLL(schannel) WINE_CONFIG_TEST(dlls/schannel/tests) +WINE_CONFIG_DLL(schedsvc,,[clean]) +WINE_CONFIG_TEST(dlls/schedsvc/tests,[clean]) WINE_CONFIG_DLL(scrrun,,[clean]) WINE_CONFIG_TEST(dlls/scrrun/tests,[clean]) WINE_CONFIG_DLL(scsiport.sys) @@ -3327,12 +3338,13 @@ WINE_CONFIG_PROGRAM(regedit,,[install,installbin,manpage,po]) WINE_CONFIG_TEST(programs/regedit/tests) WINE_CONFIG_PROGRAM(regsvcs,,[install]) -WINE_CONFIG_PROGRAM(regsvr32,,[install,installbin,manpage]) +WINE_CONFIG_PROGRAM(regsvr32,,[install,installbin,manpage,po]) WINE_CONFIG_PROGRAM(rpcss,,[clean,install]) WINE_CONFIG_PROGRAM(rundll.exe16,enable_win16,[install]) WINE_CONFIG_PROGRAM(rundll32,,[install]) WINE_CONFIG_PROGRAM(sc,,[install]) WINE_CONFIG_PROGRAM(schtasks,,[install]) +WINE_CONFIG_PROGRAM(sdbinst,,[install]) WINE_CONFIG_PROGRAM(secedit,,[install]) WINE_CONFIG_PROGRAM(servicemodelreg,,[install]) WINE_CONFIG_PROGRAM(services,,[clean,install]) @@ -3461,7 +3473,7 @@ AC_CONFIG_COMMANDS([Makefile], [wine_fn_output_makefile Makefile], [wine_fn_output_makefile () { - cat Make.tmp - <<\_WINE_EOF >\$tmp/makefile && mv -f \$tmp/makefile \$[]1 && rm -f Make.tmp && return + cat Make.tmp - <<\_WINE_EOF >\$tmp/makefile && mv -f \$tmp/makefile \$[]1 && rm -f Make.tmp && "$wine_makedep" . && return `cat $wine_rules_file` _WINE_EOF AS_ERROR([could not create Makefile]) diff -Nru wine1.7-1.7.14/debian/changelog wine1.7-1.7.18/debian/changelog --- wine1.7-1.7.14/debian/changelog 2014-03-10 10:41:06.000000000 +0000 +++ wine1.7-1.7.18/debian/changelog 2014-05-07 12:55:16.000000000 +0000 @@ -1,8 +1,52 @@ -wine1.7 (1:1.7.14-0ubuntu1~saucy1) saucy; urgency=low +wine1.7 (1:1.7.18-0ubuntu1~trusty1) trusty; urgency=low - * No-change backport to saucy + * No-change backport to trusty - -- Maarten Lankhorst Mon, 10 Mar 2014 11:41:06 +0100 + -- Maarten Lankhorst Wed, 07 May 2014 14:55:16 +0200 + +wine1.7 (1:1.7.18-0ubuntu1) precise; urgency=low + + * New upstream release + - Improved OLE Accessible Object support. + - Window sizing improvements in the Mac driver. + - Fixes for various memory issues found by Valgrind. + - A few more MSHTML functions. + - Some DirectDraw cleanups. + - Various bug fixes. + + -- Maarten Lankhorst Wed, 07 May 2014 14:52:43 +0200 + +wine1.7 (1:1.7.17-0ubuntu1) precise; urgency=low + + * New upstream release + - More implementations for the Task Scheduler. + - C runtime made more compatible by sharing source files. + - Fixes in the Mac OS X joystick support. + - Various bug fixes. + + -- Maarten Lankhorst Tue, 22 Apr 2014 09:34:38 +0200 + +wine1.7 (1:1.7.16-0ubuntu1) precise; urgency=low + + * New upstream release + - More regression test fixes. + - String arrays better supported in the IDL compiler. + - Initial stubs for DirectX Video Acceleration. + - Various bug fixes. + + -- Maarten Lankhorst Fri, 11 Apr 2014 20:14:57 +0200 + +wine1.7 (1:1.7.15-0ubuntu1) precise; urgency=low + + * New upstream release + - New Task Scheduler service. + - Many regression test fixes. + - Support for exception unwinding in VBScript. + - Various bug fixes. + * Add missing conflicts to wine1.6 in wine1.7. + * Add libgphoto-2-dev as a possible build-depends (trusty). + + -- Maarten Lankhorst Wed, 26 Mar 2014 09:46:14 +0100 wine1.7 (1:1.7.14-0ubuntu1) precise; urgency=low diff -Nru wine1.7-1.7.14/debian/control wine1.7-1.7.18/debian/control --- wine1.7-1.7.14/debian/control 2013-12-19 04:14:00.000000000 +0000 +++ wine1.7-1.7.18/debian/control 2014-03-26 08:49:18.000000000 +0000 @@ -22,7 +22,7 @@ libgl1-mesa-dev | libgl-dev, libglu1-mesa-dev | libglu-dev, libgnutls-dev, - libgphoto2-6-dev | libgphoto2-2-dev, + libgphoto2-dev | libgphoto2-6-dev | libgphoto2-2-dev, libgsm1-dev, libgstreamer-plugins-base0.10-dev, libgstreamer0.10-dev, @@ -182,7 +182,7 @@ winetricks, xdg-utils Suggests: dosbox:any -Conflicts: wine1.0, wine1.2, wine1.3, wine1.4 +Conflicts: wine1.0, wine1.2, wine1.3, wine1.4, wine1.5, wine1.6 Replaces: wine, wine1.0, wine1.2, wine1.3, wine1.4, wine1.5, wine1.6 Provides: wine Description: Microsoft Windows Compatibility Layer (Binary Emulator and Library) diff -Nru wine1.7-1.7.14/dlls/advapi32/advapi32.spec wine1.7-1.7.18/dlls/advapi32/advapi32.spec --- wine1.7-1.7.14/dlls/advapi32/advapi32.spec 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/advapi32/advapi32.spec 2014-05-02 18:15:48.000000000 +0000 @@ -351,9 +351,9 @@ @ stub GetSiteSidFromToken # @ stub GetThreadWaitChain @ stdcall GetTokenInformation(long long ptr long ptr) -@ stub GetTraceEnableFlags -@ stub GetTraceEnableLevel -@ stub GetTraceLoggerHandle +@ stdcall GetTraceEnableFlags(int64) +@ stdcall GetTraceEnableLevel(int64) +@ stdcall -ret64 GetTraceLoggerHandle(ptr) @ stdcall GetTrusteeFormA(ptr) @ stdcall GetTrusteeFormW(ptr) @ stdcall GetTrusteeNameA(ptr) diff -Nru wine1.7-1.7.14/dlls/advapi32/cred.c wine1.7-1.7.18/dlls/advapi32/cred.c --- wine1.7-1.7.14/dlls/advapi32/cred.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/advapi32/cred.c 2014-05-02 18:15:48.000000000 +0000 @@ -1952,18 +1952,13 @@ { case CertCredential: { - char hash[CERT_HASH_LENGTH + 2]; - - memcpy( hash, cert->rgbHashOfCert, sizeof(cert->rgbHashOfCert) ); - memset( hash + sizeof(cert->rgbHashOfCert), 0, sizeof(hash) - sizeof(cert->rgbHashOfCert) ); - - size = sizeof(hash) * 4 / 3; + size = (sizeof(cert->rgbHashOfCert) + 2) * 4 / 3; if (!(p = HeapAlloc( GetProcessHeap(), 0, (size + 4) * sizeof(WCHAR) ))) return FALSE; p[0] = '@'; p[1] = '@'; p[2] = 'A' + type; - len = cred_encode( (const char *)hash, sizeof(hash), p + 3 ); - p[len] = 0; + len = cred_encode( (const char *)cert->rgbHashOfCert, sizeof(cert->rgbHashOfCert), p + 3 ); + p[len + 3] = 0; break; } case UsernameTargetCredential: @@ -2049,7 +2044,6 @@ buf[i + 0] = (c1 << 6) | c0; buf[i + 1] = (c2 << 4) | (c1 >> 2); - buf[i + 2] = c2 >> 4; } else if (len == 2) { @@ -2057,16 +2051,10 @@ if ((c1 = char_decode( p[1] )) > 63) return FALSE; buf[i + 0] = (c1 << 6) | c0; - buf[i + 1] = c1 >> 2; - buf[i + 2] = 0; } else if (len == 1) { - if ((c0 = char_decode( p[0] )) > 63) return FALSE; - - buf[i + 0] = c0; - buf[i + 1] = 0; - buf[i + 2] = 0; + return FALSE; } return TRUE; } @@ -2080,17 +2068,19 @@ TRACE("%s, %p, %p\n", debugstr_w(cred), type, out); - if (!cred || cred[0] != '@' || cred[1] != '@' || !cred[2] || !cred[3]) + if (!cred || cred[0] != '@' || cred[1] != '@' || + char_decode( cred[2] ) > 63) { SetLastError( ERROR_INVALID_PARAMETER ); return FALSE; } len = strlenW( cred + 3 ); - switch (cred[2] - 'A') + *type = char_decode( cred[2] ); + switch (*type) { case CertCredential: { - char hash[CERT_HASH_LENGTH + 2]; + char hash[CERT_HASH_LENGTH]; CERT_CREDENTIAL_INFO *cert; if (len != 27 || !cred_decode( cred + 3, len, hash )) @@ -2101,17 +2091,16 @@ if (!(cert = HeapAlloc( GetProcessHeap(), 0, sizeof(*cert) ))) return FALSE; memcpy( cert->rgbHashOfCert, hash, sizeof(cert->rgbHashOfCert) ); cert->cbSize = sizeof(*cert); - *type = CertCredential; *out = cert; break; } case UsernameTargetCredential: { USERNAME_TARGET_CREDENTIAL_INFO *target; - ULONGLONG size = 0; + DWORD size; if (len < 9 || !cred_decode( cred + 3, 6, (char *)&size ) || - !size || size % sizeof(WCHAR) || size > INT_MAX) + size % sizeof(WCHAR) || len - 6 != (size * 4 + 2) / 3) { SetLastError( ERROR_INVALID_PARAMETER ); return FALSE; @@ -2125,7 +2114,6 @@ } target->UserName = (WCHAR *)(target + 1); target->UserName[size / sizeof(WCHAR)] = 0; - *type = UsernameTargetCredential; *out = target; break; } @@ -2133,7 +2121,8 @@ FIXME("BinaryBlobCredential not implemented\n"); return FALSE; default: - WARN("unhandled type %u\n", cred[2] - 'A'); + WARN("unhandled type %u\n", *type); + SetLastError( ERROR_INVALID_PARAMETER ); return FALSE; } return TRUE; @@ -2157,7 +2146,7 @@ if (name && name[0] == '@' && name[1] == '@' && name[2] > 'A' && name[3]) { - char hash[CERT_HASH_LENGTH + 2]; + char hash[CERT_HASH_LENGTH]; int len = strlenW(name + 3 ); DWORD size; diff -Nru wine1.7-1.7.14/dlls/advapi32/eventlog.c wine1.7-1.7.18/dlls/advapi32/eventlog.c --- wine1.7-1.7.14/dlls/advapi32/eventlog.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/advapi32/eventlog.c 2014-05-02 18:15:48.000000000 +0000 @@ -378,6 +378,34 @@ } /****************************************************************************** + * GetTraceEnableFlags [ADVAPI32.@] + */ +ULONG WINAPI GetTraceEnableFlags( TRACEHANDLE handle ) +{ + FIXME("(%s) stub\n", wine_dbgstr_longlong(handle)); + return 0; +} + +/****************************************************************************** + * GetTraceEnableLevel [ADVAPI32.@] + */ +UCHAR WINAPI GetTraceEnableLevel( TRACEHANDLE handle ) +{ + FIXME("(%s) stub\n", wine_dbgstr_longlong(handle)); + return TRACE_LEVEL_VERBOSE; +} + +/****************************************************************************** + * GetTraceLoggerHandle [ADVAPI32.@] + */ +TRACEHANDLE WINAPI GetTraceLoggerHandle( PVOID buf ) +{ + FIXME("(%p) stub\n", buf); + SetLastError(ERROR_ACCESS_DENIED); + return INVALID_PROCESSTRACE_HANDLE; +} + +/****************************************************************************** * NotifyChangeEventLog [ADVAPI32.@] * * Enables an application to receive notification when an event is written diff -Nru wine1.7-1.7.14/dlls/advapi32/tests/cred.c wine1.7-1.7.18/dlls/advapi32/tests/cred.c --- wine1.7-1.7.14/dlls/advapi32/tests/cred.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/advapi32/tests/cred.c 2014-05-02 18:15:48.000000000 +0000 @@ -563,14 +563,65 @@ static void test_CredUnmarshalCredentialA(void) { + static const UCHAR cert_empty[CERT_HASH_LENGTH] = {0}; + static const UCHAR cert_wine[CERT_HASH_LENGTH] = {'W','i','n','e',0}; static const WCHAR tW[] = {'t',0}; + static const WCHAR teW[] = {'t','e',0}; + static const WCHAR tesW[] = {'t','e','s',0}; static const WCHAR testW[] = {'t','e','s','t',0}; + void *p; CERT_CREDENTIAL_INFO *cert; + const UCHAR *hash; USERNAME_TARGET_CREDENTIAL_INFO *username; CRED_MARSHAL_TYPE type; - unsigned int i; + unsigned int i, j; DWORD error; BOOL ret; + const struct { + const char *cred; + CRED_MARSHAL_TYPE type; + const void *unmarshaled; + } tests[] = { + { "", 0, NULL }, + { "@", 0, NULL }, + { "@@", 0, NULL }, + { "@@@", 0, NULL }, + { "@@A", 0, NULL }, + { "@@E", 4, NULL }, + { "@@Z", 25, NULL }, + { "@@a", 26, NULL }, + { "@@0", 52, NULL }, + { "@@#", 62, NULL }, + { "@@-", 63, NULL }, + { "@@B", CertCredential, NULL }, + { "@@BA", CertCredential, NULL }, + { "@@BAAAAAAAAAAAAAAAAAAAAAAAAAA", CertCredential, NULL }, + { "@@BAAAAAAAAAAAAAAAAAAAAAAAAAAAA", CertCredential, NULL }, + { "@@BAAAAAAAAAAAAAAAAAAAAAAAAAAA", CertCredential, cert_empty }, + { "@@BXlmblBAAAAAAAAAAAAAAAAAAAAA", CertCredential, cert_wine }, + { "@@C", UsernameTargetCredential, NULL }, + { "@@CA", UsernameTargetCredential, NULL }, + { "@@CAAAAAA", UsernameTargetCredential, NULL }, + { "@@CAAAAAA0B", UsernameTargetCredential, NULL }, + { "@@CAAAAAA0BA", UsernameTargetCredential, NULL }, + { "@@CCAAAAA0BA", UsernameTargetCredential, tW }, + { "@@CEAAAAA0BA", UsernameTargetCredential, NULL }, + { "@@CEAAAAA0BAd", UsernameTargetCredential, NULL }, + { "@@CEAAAAA0BAdA", UsernameTargetCredential, NULL }, + { "@@CEAAAAA0BQZAA", UsernameTargetCredential, teW }, + { "@@CEAAAAA0BQZAQ", UsernameTargetCredential, teW }, + { "@@CEAAAAA0BQZAg", UsernameTargetCredential, teW }, + { "@@CEAAAAA0BQZAw", UsernameTargetCredential, teW }, + { "@@CEAAAAA0BQZAAA", UsernameTargetCredential, NULL }, + { "@@CGAAAAA0BQZAMH", UsernameTargetCredential, NULL }, + { "@@CGAAAAA0BQZAMHA", UsernameTargetCredential, tesW }, + { "@@CGAAAAA0BQZAMHAA", UsernameTargetCredential, NULL }, + { "@@CCAAAAA0BAA", UsernameTargetCredential, NULL }, + { "@@CBAAAAA0BAA", UsernameTargetCredential, NULL }, + { "@@CAgAAAA0BAA", UsernameTargetCredential, NULL }, + { "@@CIAAAAA0BQZAMHA0BA", UsernameTargetCredential, testW }, + { "@@CA-----0BQZAMHA0BA", UsernameTargetCredential, NULL }, + }; SetLastError( 0xdeadbeef ); ret = pCredUnmarshalCredentialA( NULL, NULL, NULL ); @@ -593,14 +644,6 @@ ok( !ret, "unexpected success\n" ); ok( error == ERROR_INVALID_PARAMETER, "got %u\n", error ); - type = 0; - cert = NULL; - SetLastError( 0xdeadbeef ); - ret = pCredUnmarshalCredentialA( "", &type, (void **)&cert ); - error = GetLastError(); - ok( !ret, "unexpected success\n" ); - ok( error == ERROR_INVALID_PARAMETER, "got %u\n", error ); - if (0) { /* crash */ SetLastError( 0xdeadbeef ); ret = pCredUnmarshalCredentialA( "@@BAAAAAAAAAAAAAAAAAAAAAAAAAAA", &type, NULL ); @@ -615,69 +658,46 @@ ok( error == ERROR_INVALID_PARAMETER, "got %u\n", error ); } - type = 0; - cert = NULL; - ret = pCredUnmarshalCredentialA( "@@BAAAAAAAAAAAAAAAAAAAAAAAAAAA", &type, (void **)&cert ); - ok( ret, "unexpected failure %u\n", GetLastError() ); - ok( type == CertCredential, "got %u\n", type ); - ok( cert != NULL, "cert is NULL\n" ); - ok( cert->cbSize == sizeof(*cert), "wrong size %u\n", cert->cbSize ); - for (i = 0; i < sizeof(cert->rgbHashOfCert); i++) ok( !cert->rgbHashOfCert[i], "wrong data\n" ); - pCredFree( cert ); - - type = 0; - cert = NULL; - ret = pCredUnmarshalCredentialA( "@@BXlmblBAAAAAAAAAAAAAAAAAAAAA", &type, (void **)&cert ); - ok( ret, "unexpected failure %u\n", GetLastError() ); - ok( type == CertCredential, "got %u\n", type ); - ok( cert != NULL, "cert is NULL\n" ); - ok( cert->cbSize == sizeof(*cert), "wrong size %u\n", cert->cbSize ); - ok( cert->rgbHashOfCert[0] == 'W', "wrong data)\n" ); - ok( cert->rgbHashOfCert[1] == 'i', "wrong data\n" ); - ok( cert->rgbHashOfCert[2] == 'n', "wrong data\n" ); - ok( cert->rgbHashOfCert[3] == 'e', "wrong data\n" ); - for (i = 4; i < sizeof(cert->rgbHashOfCert); i++) ok( !cert->rgbHashOfCert[i], "wrong data\n" ); - pCredFree( cert ); - - SetLastError( 0xdeadbeef ); - ret = pCredUnmarshalCredentialA( "@@CAAAAAA", &type, (void **)&username ); - error = GetLastError(); - ok( !ret, "unexpected success\n" ); - ok( error == ERROR_INVALID_PARAMETER, "got %u\n", error ); - - SetLastError( 0xdeadbeef ); - ret = pCredUnmarshalCredentialA( "@@CAAAAAA0BA", &type, (void **)&username ); - error = GetLastError(); - ok( !ret, "unexpected success\n" ); - ok( error == ERROR_INVALID_PARAMETER, "got %u\n", error ); - - type = 0; - username = NULL; - ret = pCredUnmarshalCredentialA( "@@CCAAAAA0BA", &type, (void **)&username ); - ok( ret, "unexpected failure %u\n", GetLastError() ); - ok( type == UsernameTargetCredential, "got %u\n", type ); - ok( username != NULL, "username is NULL\n" ); - ok( username->UserName != NULL, "UserName is NULL\n" ); - ok( !lstrcmpW( username->UserName, tW ), "got %s\n", wine_dbgstr_w(username->UserName) ); - pCredFree( username ); - - type = 0; - username = NULL; - ret = pCredUnmarshalCredentialA( "@@CIAAAAA0BQZAMHA0BA", &type, (void **)&username ); - ok( ret, "unexpected failure %u\n", GetLastError() ); - ok( type == UsernameTargetCredential, "got %u\n", type ); - ok( username != NULL, "username is NULL\n" ); - ok( username->UserName != NULL, "UserName is NULL\n" ); - ok( !lstrcmpW( username->UserName, testW ), "got %s\n", wine_dbgstr_w(username->UserName) ); - pCredFree( username ); + for (i = 0; i < sizeof(tests) / sizeof(tests[0]); i++) + { + SetLastError(0xdeadbeef); + type = 0; + p = NULL; + ret = pCredUnmarshalCredentialA(tests[i].cred, &type, &p); + error = GetLastError(); + if (tests[i].unmarshaled) + { + ok(ret, "[%u] unexpected failure %u\n", i, error); + ok(type == tests[i].type, "[%u] got %u\n", i, type); + ok(p != NULL, "[%u] returned pointer is NULL\n", i); + if (tests[i].type == CertCredential) + { + cert = p; + hash = tests[i].unmarshaled; + ok(cert->cbSize == sizeof(*cert), + "[%u] wrong size %u\n", i, cert->cbSize); + for (j = 0; j < sizeof(cert->rgbHashOfCert); j++) + ok(cert->rgbHashOfCert[j] == hash[j], "[%u] wrong data\n", i); + } + else if (tests[i].type == UsernameTargetCredential) + { + username = p; + ok(username->UserName != NULL, "[%u] UserName is NULL\n", i); + ok(!lstrcmpW(username->UserName, tests[i].unmarshaled), + "[%u] got %s\n", i, wine_dbgstr_w(username->UserName)); + } + } + else + { + ok(!ret, "[%u] unexpected success\n", i); + ok(error == ERROR_INVALID_PARAMETER, "[%u] got %u\n", i, error); + ok(type == tests[i].type, "[%u] got %u\n", i, type); + ok(p == NULL, "[%u] returned pointer is not NULL\n", i); + } - type = 0; - username = NULL; - SetLastError( 0xdeadbeef ); - ret = pCredUnmarshalCredentialA( "@@CA-----0BQZAMHA0BA", &type, (void **)&username ); - error = GetLastError(); - ok( !ret, "unexpected success\n" ); - ok( error == ERROR_INVALID_PARAMETER, "got %u\n", error ); + if (ret) + pCredFree(p); + } } static void test_CredIsMarshaledCredentialA(void) diff -Nru wine1.7-1.7.14/dlls/advapi32/tests/security.c wine1.7-1.7.18/dlls/advapi32/tests/security.c --- wine1.7-1.7.14/dlls/advapi32/tests/security.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/advapi32/tests/security.c 2014-05-02 18:15:48.000000000 +0000 @@ -3124,6 +3124,7 @@ ok(ace->Mask == 0x1f01ff, "Administators Group ACE has unexpected mask (0x%x != 0x1f01ff)\n", ace->Mask); } + LocalFree(pSD); done: HeapFree(GetProcessHeap(), 0, user); @@ -3231,10 +3232,12 @@ NULL, NULL, NULL, NULL, NULL); ok(error==ERROR_INVALID_PARAMETER, "GetNamedSecurityInfo failed with error %d\n", error); + pDacl = NULL; error = pGetNamedSecurityInfoA(windows_dir, SE_FILE_OBJECT,DACL_SECURITY_INFORMATION, - NULL, NULL, &pDacl, NULL, NULL); + NULL, NULL, &pDacl, NULL, &pSD); ok(!error, "GetNamedSecurityInfo failed with error %d\n", error); ok(pDacl != NULL, "DACL should not be NULL\n"); + LocalFree(pSD); error = pGetNamedSecurityInfoA(windows_dir, SE_FILE_OBJECT,OWNER_SECURITY_INFORMATION, NULL, NULL, &pDacl, NULL, NULL); @@ -3950,7 +3953,7 @@ NULL, NULL, pDacl, NULL); ok(ret == ERROR_SUCCESS, "SetSecurityInfo returned %d\n", ret); ret = pGetSecurityInfo(obj, SE_FILE_OBJECT, DACL_SECURITY_INFORMATION, - NULL, NULL, &pDacl, NULL, NULL); + NULL, NULL, &pDacl, NULL, &pSD); ok(ret == ERROR_SUCCESS, "GetSecurityInfo returned %d\n", ret); ok(pDacl && IsValidAcl(pDacl), "GetSecurityInfo returned invalid DACL.\n"); bret = pGetAclInformation(pDacl, &acl_size, sizeof(acl_size), AclSizeInformation); @@ -3977,6 +3980,7 @@ ok(ace->Mask == 0x1f01ff, "Administators Group ACE has unexpected mask (0x%x != 0x1f01ff)\n", ace->Mask); } + LocalFree(pSD); CloseHandle(obj); } diff -Nru wine1.7-1.7.14/dlls/advapi32/tests/service.c wine1.7-1.7.18/dlls/advapi32/tests/service.c --- wine1.7-1.7.14/dlls/advapi32/tests/service.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/advapi32/tests/service.c 2014-05-02 18:15:48.000000000 +0000 @@ -136,6 +136,7 @@ ok(GetLastError() == ERROR_INVALID_ADDRESS /* W2K, XP, W2K3, Vista */ || GetLastError() == ERROR_INVALID_PARAMETER /* NT4 */, "Expected ERROR_INVALID_ADDRESS or ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + CloseServiceHandle(scm_handle); /* Nonexistent service */ scm_handle = OpenSCManagerA(NULL, NULL, SC_MANAGER_CONNECT); @@ -1840,8 +1841,9 @@ if (!is_nt4) { retval = pGetSecurityInfo(svc_handle, SE_SERVICE, DACL_SECURITY_INFORMATION, NULL, - NULL, &dacl, NULL, NULL); + NULL, &dacl, NULL, &pSD); ok(retval == ERROR_SUCCESS, "Expected GetSecurityInfo to succeed: result %d\n", retval); + LocalFree(pSD); SetLastError(0xdeadbeef); retval = pGetSecurityInfo(svc_handle, SE_SERVICE, DACL_SECURITY_INFORMATION, NULL, NULL, NULL, NULL, NULL); diff -Nru wine1.7-1.7.14/dlls/api-ms-win-core-synch-l1-2-0/api-ms-win-core-synch-l1-2-0.spec wine1.7-1.7.18/dlls/api-ms-win-core-synch-l1-2-0/api-ms-win-core-synch-l1-2-0.spec --- wine1.7-1.7.14/dlls/api-ms-win-core-synch-l1-2-0/api-ms-win-core-synch-l1-2-0.spec 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/api-ms-win-core-synch-l1-2-0/api-ms-win-core-synch-l1-2-0.spec 2014-05-02 18:15:48.000000000 +0000 @@ -39,7 +39,7 @@ @ stdcall SetCriticalSectionSpinCount(ptr long) kernel32.SetCriticalSectionSpinCount @ stdcall SetEvent(long) kernel32.SetEvent @ stdcall SetWaitableTimer(long ptr long ptr ptr long) kernel32.SetWaitableTimer -@ stub SetWaitableTimerEx +@ stdcall SetWaitableTimerEx(long ptr long ptr ptr ptr long) kernel32.SetWaitableTimerEx @ stdcall SignalObjectAndWait(long long long long) kernel32.SignalObjectAndWait @ stdcall Sleep(long) kernel32.Sleep @ stdcall SleepConditionVariableCS(ptr ptr long) kernel32.SleepConditionVariableCS diff -Nru wine1.7-1.7.14/dlls/api-ms-win-downlevel-advapi32-l1-1-0/api-ms-win-downlevel-advapi32-l1-1-0.spec wine1.7-1.7.18/dlls/api-ms-win-downlevel-advapi32-l1-1-0/api-ms-win-downlevel-advapi32-l1-1-0.spec --- wine1.7-1.7.14/dlls/api-ms-win-downlevel-advapi32-l1-1-0/api-ms-win-downlevel-advapi32-l1-1-0.spec 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/api-ms-win-downlevel-advapi32-l1-1-0/api-ms-win-downlevel-advapi32-l1-1-0.spec 2014-05-02 18:15:48.000000000 +0000 @@ -66,9 +66,9 @@ @ stdcall GetSidSubAuthority(ptr long) advapi32.GetSidSubAuthority @ stdcall GetSidSubAuthorityCount(ptr) advapi32.GetSidSubAuthorityCount @ stdcall GetTokenInformation(long long ptr long ptr) advapi32.GetTokenInformation -@ stub GetTraceEnableFlags -@ stub GetTraceEnableLevel -@ stub GetTraceLoggerHandle +@ stdcall GetTraceEnableFlags(int64) advapi32.GetTraceEnableFlags +@ stdcall GetTraceEnableLevel(int64) advapi32.GetTraceEnableLevel +@ stdcall -ret64 GetTraceLoggerHandle(ptr) advapi32.GetTraceLoggerHandle @ stdcall InitializeAcl(ptr long long) advapi32.InitializeAcl @ stdcall InitializeSecurityDescriptor(ptr long) advapi32.InitializeSecurityDescriptor @ stdcall InitializeSid(ptr ptr long) advapi32.InitializeSid diff -Nru wine1.7-1.7.14/dlls/apphelp/apphelp.c wine1.7-1.7.18/dlls/apphelp/apphelp.c --- wine1.7-1.7.14/dlls/apphelp/apphelp.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/apphelp/apphelp.c 2014-05-02 18:15:48.000000000 +0000 @@ -33,6 +33,7 @@ /* FIXME: don't know where to place that typedef */ typedef HANDLE PDB; +typedef HANDLE HSDB; BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved ) { @@ -81,3 +82,11 @@ SetLastError(ERROR_CALL_NOT_IMPLEMENTED); return TRUE; } + + +HSDB WINAPI SdbInitDatabase(DWORD flags, LPCWSTR path) +{ + FIXME("stub: %08x %s\n", flags, debugstr_w(path)); + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return NULL; +} diff -Nru wine1.7-1.7.14/dlls/apphelp/apphelp.spec wine1.7-1.7.18/dlls/apphelp/apphelp.spec --- wine1.7-1.7.14/dlls/apphelp/apphelp.spec 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/apphelp/apphelp.spec 2014-05-02 18:15:48.000000000 +0000 @@ -83,7 +83,7 @@ @ stub SdbGrabMatchingInfoEx @ stub SdbGUIDFromString @ stub SdbGUIDToString -@ stub SdbInitDatabase +@ stdcall SdbInitDatabase(long wstr) @ stub SdbInitDatabaseEx @ stub SdbIsNullGUID @ stub SdbIsStandardDatabase diff -Nru wine1.7-1.7.14/dlls/appwiz.cpl/appwiz.c wine1.7-1.7.18/dlls/appwiz.cpl/appwiz.c --- wine1.7-1.7.14/dlls/appwiz.cpl/appwiz.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/appwiz.cpl/appwiz.c 2014-05-02 18:15:48.000000000 +0000 @@ -477,7 +477,7 @@ sei.cbSize = sizeof(sei); sei.lpVerb = openW; sei.nShow = SW_SHOWDEFAULT; - sei.fMask = SEE_MASK_NO_CONSOLE; + sei.fMask = 0; sei.lpFile = ofn.lpstrFile; ShellExecuteExW(&sei); diff -Nru wine1.7-1.7.14/dlls/atl/atl_ax.c wine1.7-1.7.18/dlls/atl/atl_ax.c --- wine1.7-1.7.14/dlls/atl/atl_ax.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/atl/atl_ax.c 2014-05-02 18:15:48.000000000 +0000 @@ -139,55 +139,88 @@ * Atl container component implementation */ - -static ULONG IOCS_AddRef(IOCS *This) +/****** IOleClientSite *****/ +static inline IOCS *impl_from_IOleClientSite(IOleClientSite *iface) { - ULONG ref = InterlockedIncrement(&This->ref); + return CONTAINING_RECORD(iface, IOCS, IOleClientSite_iface); +} - TRACE( "(%p) : AddRef from %d\n", This, ref - 1 ); +static HRESULT IOCS_Detach( IOCS *This ) /* remove subclassing */ +{ + if ( This->hWnd ) + { + SetWindowLongPtrW( This->hWnd, GWLP_WNDPROC, (ULONG_PTR) This->OrigWndProc ); + SetWindowLongPtrW( This->hWnd, GWLP_USERDATA, 0 ); + This->hWnd = NULL; + } + if ( This->control ) + { + IOleObject *control = This->control; - return ref; + This->control = NULL; + IOleObject_Close( control, OLECLOSE_NOSAVE ); + IOleObject_SetClientSite( control, NULL ); + IOleObject_Release( control ); + } + return S_OK; } -static HRESULT IOCS_QueryInterface(IOCS *This, REFIID riid, void **ppv) +static HRESULT WINAPI OleClientSite_QueryInterface(IOleClientSite *iface, REFIID riid, void **ppv) { + IOCS *This = impl_from_IOleClientSite(iface); + + TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv); + *ppv = NULL; - if ( IsEqualIID( &IID_IUnknown, riid ) - || IsEqualIID( &IID_IOleClientSite, riid ) ) + if (IsEqualIID(&IID_IUnknown, riid) || + IsEqualIID(&IID_IOleClientSite, riid)) { - *ppv = &This->IOleClientSite_iface; - } else if ( IsEqualIID( &IID_IOleContainer, riid ) ) + *ppv = iface; + } + else if (IsEqualIID(&IID_IOleContainer, riid)) { *ppv = &This->IOleContainer_iface; - } else if ( IsEqualIID( &IID_IOleInPlaceSite, riid ) || IsEqualIID( &IID_IOleInPlaceSiteEx, riid ) || IsEqualIID( &IID_IOleInPlaceSiteWindowless, riid ) ) + } + else if (IsEqualIID(&IID_IOleInPlaceSite, riid) || + IsEqualIID(&IID_IOleInPlaceSiteEx, riid) || + IsEqualIID(&IID_IOleInPlaceSiteWindowless, riid)) { *ppv = &This->IOleInPlaceSiteWindowless_iface; - } else if ( IsEqualIID( &IID_IOleInPlaceFrame, riid ) ) + } + else if (IsEqualIID(&IID_IOleInPlaceFrame, riid)) { *ppv = &This->IOleInPlaceFrame_iface; - } else if ( IsEqualIID( &IID_IOleControlSite, riid ) ) + } + else if (IsEqualIID(&IID_IOleControlSite, riid)) { *ppv = &This->IOleControlSite_iface; } if (*ppv) { - IOCS_AddRef( This ); + IOleClientSite_AddRef(iface); return S_OK; } - WARN("unsupported interface %s\n", debugstr_guid( riid ) ); - *ppv = NULL; + WARN("unsupported interface %s\n", debugstr_guid(riid)); return E_NOINTERFACE; } -static HRESULT IOCS_Detach( IOCS *This ); -static ULONG IOCS_Release(IOCS *This) +static ULONG WINAPI OleClientSite_AddRef(IOleClientSite *iface) { + IOCS *This = impl_from_IOleClientSite(iface); + ULONG ref = InterlockedIncrement(&This->ref); + TRACE("(%p)->(%d)\n", This, ref); + return ref; +} + +static ULONG WINAPI OleClientSite_Release(IOleClientSite *iface) +{ + IOCS *This = impl_from_IOleClientSite(iface); ULONG ref = InterlockedDecrement(&This->ref); - TRACE( "(%p) : ReleaseRef to %d\n", This, ref ); + TRACE("(%p)->(%d)\n", This, ref); if (!ref) { @@ -198,30 +231,6 @@ return ref; } -/****** IOleClientSite *****/ -static inline IOCS *impl_from_IOleClientSite(IOleClientSite *iface) -{ - return CONTAINING_RECORD(iface, IOCS, IOleClientSite_iface); -} - -static HRESULT WINAPI OleClientSite_QueryInterface(IOleClientSite *iface, REFIID riid, void **ppv) -{ - IOCS *This = impl_from_IOleClientSite(iface); - return IOCS_QueryInterface(This, riid, ppv); -} - -static ULONG WINAPI OleClientSite_AddRef(IOleClientSite *iface) -{ - IOCS *This = impl_from_IOleClientSite(iface); - return IOCS_AddRef(This); -} - -static ULONG WINAPI OleClientSite_Release(IOleClientSite *iface) -{ - IOCS *This = impl_from_IOleClientSite(iface); - return IOCS_Release(This); -} - static HRESULT WINAPI OleClientSite_SaveObject(IOleClientSite *iface) { IOCS *This = impl_from_IOleClientSite(iface); @@ -237,11 +246,11 @@ return E_NOTIMPL; } -static HRESULT WINAPI OleClientSite_GetContainer(IOleClientSite *iface, IOleContainer **ppContainer) +static HRESULT WINAPI OleClientSite_GetContainer(IOleClientSite *iface, IOleContainer **container) { IOCS *This = impl_from_IOleClientSite(iface); - TRACE( "(%p, %p)\n", This, ppContainer ); - return OleClientSite_QueryInterface( iface, &IID_IOleContainer, (void**)ppContainer ); + TRACE("(%p, %p)\n", This, container); + return IOleClientSite_QueryInterface(iface, &IID_IOleContainer, (void**)container); } static HRESULT WINAPI OleClientSite_ShowObject(IOleClientSite *iface) @@ -275,19 +284,19 @@ static HRESULT WINAPI OleContainer_QueryInterface( IOleContainer* iface, REFIID riid, void** ppv) { IOCS *This = impl_from_IOleContainer(iface); - return IOCS_QueryInterface( This, riid, ppv ); + return IOleClientSite_QueryInterface(&This->IOleClientSite_iface, riid, ppv); } static ULONG WINAPI OleContainer_AddRef(IOleContainer* iface) { IOCS *This = impl_from_IOleContainer(iface); - return IOCS_AddRef(This); + return IOleClientSite_AddRef(&This->IOleClientSite_iface); } static ULONG WINAPI OleContainer_Release(IOleContainer* iface) { IOCS *This = impl_from_IOleContainer(iface); - return IOCS_Release(This); + return IOleClientSite_Release(&This->IOleClientSite_iface); } static HRESULT WINAPI OleContainer_ParseDisplayName(IOleContainer* iface, IBindCtx* pbc, @@ -322,19 +331,19 @@ static HRESULT WINAPI OleInPlaceSiteWindowless_QueryInterface(IOleInPlaceSiteWindowless *iface, REFIID riid, void **ppv) { IOCS *This = impl_from_IOleInPlaceSiteWindowless(iface); - return IOCS_QueryInterface(This, riid, ppv); + return IOleClientSite_QueryInterface(&This->IOleClientSite_iface, riid, ppv); } static ULONG WINAPI OleInPlaceSiteWindowless_AddRef(IOleInPlaceSiteWindowless *iface) { IOCS *This = impl_from_IOleInPlaceSiteWindowless(iface); - return IOCS_AddRef(This); + return IOleClientSite_AddRef(&This->IOleClientSite_iface); } static ULONG WINAPI OleInPlaceSiteWindowless_Release(IOleInPlaceSiteWindowless *iface) { IOCS *This = impl_from_IOleInPlaceSiteWindowless(iface); - return IOCS_Release(This); + return IOleClientSite_Release(&This->IOleClientSite_iface); } static HRESULT WINAPI OleInPlaceSiteWindowless_GetWindow(IOleInPlaceSiteWindowless* iface, HWND* phwnd) @@ -379,21 +388,22 @@ return S_OK; } static HRESULT WINAPI OleInPlaceSiteWindowless_GetWindowContext(IOleInPlaceSiteWindowless *iface, - IOleInPlaceFrame **ppFrame, IOleInPlaceUIWindow **ppDoc, LPRECT lprcPosRect, + IOleInPlaceFrame **frame, IOleInPlaceUIWindow **ppDoc, LPRECT lprcPosRect, LPRECT lprcClipRect, LPOLEINPLACEFRAMEINFO lpFrameInfo) { IOCS *This = impl_from_IOleInPlaceSiteWindowless(iface); - TRACE("(%p,%p,%p,%p,%p,%p)\n", This, ppFrame, ppDoc, lprcPosRect, lprcClipRect, lpFrameInfo); + TRACE("(%p,%p,%p,%p,%p,%p)\n", This, frame, ppDoc, lprcPosRect, lprcClipRect, lpFrameInfo); if ( lprcClipRect ) *lprcClipRect = This->size; if ( lprcPosRect ) *lprcPosRect = This->size; - if ( ppFrame ) + if ( frame ) { - IOCS_QueryInterface( This, &IID_IOleInPlaceFrame, (void**) ppFrame ); + *frame = &This->IOleInPlaceFrame_iface; + IOleInPlaceFrame_AddRef(*frame); } if ( ppDoc ) @@ -552,19 +562,19 @@ static HRESULT WINAPI OleInPlaceFrame_QueryInterface(IOleInPlaceFrame *iface, REFIID riid, void **ppv) { IOCS *This = impl_from_IOleInPlaceFrame(iface); - return IOCS_QueryInterface(This, riid, ppv); + return IOleClientSite_QueryInterface(&This->IOleClientSite_iface, riid, ppv); } static ULONG WINAPI OleInPlaceFrame_AddRef(IOleInPlaceFrame *iface) { IOCS *This = impl_from_IOleInPlaceFrame(iface); - return IOCS_AddRef(This); + return IOleClientSite_AddRef(&This->IOleClientSite_iface); } static ULONG WINAPI OleInPlaceFrame_Release(IOleInPlaceFrame *iface) { IOCS *This = impl_from_IOleInPlaceFrame(iface); - return IOCS_Release(This); + return IOleClientSite_Release(&This->IOleClientSite_iface); } static HRESULT WINAPI OleInPlaceFrame_GetWindow(IOleInPlaceFrame *iface, HWND *phWnd) @@ -675,19 +685,19 @@ static HRESULT WINAPI OleControlSite_QueryInterface(IOleControlSite *iface, REFIID riid, void **ppv) { IOCS *This = impl_from_IOleControlSite(iface); - return IOCS_QueryInterface(This, riid, ppv); + return IOleClientSite_QueryInterface(&This->IOleClientSite_iface, riid, ppv); } static ULONG WINAPI OleControlSite_AddRef(IOleControlSite *iface) { IOCS *This = impl_from_IOleControlSite(iface); - return IOCS_AddRef(This); + return IOleClientSite_AddRef(&This->IOleClientSite_iface); } static ULONG WINAPI OleControlSite_Release(IOleControlSite *iface) { IOCS *This = impl_from_IOleControlSite(iface); - return IOCS_Release(This); + return IOleClientSite_Release(&This->IOleClientSite_iface); } static HRESULT WINAPI OleControlSite_OnControlInfoChanged( IOleControlSite* This) @@ -810,26 +820,6 @@ OleControlSite_ShowPropertyFrame }; -static HRESULT IOCS_Detach( IOCS *This ) /* remove subclassing */ -{ - if ( This->hWnd ) - { - SetWindowLongPtrW( This->hWnd, GWLP_WNDPROC, (ULONG_PTR) This->OrigWndProc ); - SetWindowLongPtrW( This->hWnd, GWLP_USERDATA, 0 ); - This->hWnd = NULL; - } - if ( This->control ) - { - IOleObject *control = This->control; - - This->control = NULL; - IOleObject_Close( control, OLECLOSE_NOSAVE ); - IOleObject_SetClientSite( control, NULL ); - IOleObject_Release( control ); - } - return S_OK; -} - static void IOCS_OnSize( IOCS* This, LPCRECT rect ) { SIZEL inPix, inHi; @@ -949,12 +939,15 @@ /********************************************************************** * Create new instance of Atl host component and attach it to window * */ -static HRESULT IOCS_Create( HWND hWnd, IUnknown *pUnkControl, IOCS **ppSite ) +static HRESULT IOCS_Create( HWND hWnd, IUnknown *pUnkControl, IUnknown **container ) { HRESULT hr; IOCS *This; - *ppSite = NULL; + if (!container) + return S_OK; + + *container = NULL; This = HeapAlloc(GetProcessHeap(), 0, sizeof(IOCS)); if (!This) @@ -975,9 +968,12 @@ if ( SUCCEEDED( hr ) ) hr = IOCS_Init( This ); if ( SUCCEEDED( hr ) ) - *ppSite = This; + *container = (IUnknown*)&This->IOleClientSite_iface; else - IOCS_Release( This ); + { + IOCS_Detach( This ); + HeapFree(GetProcessHeap(), 0, This); + } return hr; } @@ -1102,26 +1098,17 @@ /*********************************************************************** * AtlAxAttachControl [atl100.@] */ -HRESULT WINAPI AtlAxAttachControl(IUnknown* pControl, HWND hWnd, IUnknown** ppUnkContainer) +HRESULT WINAPI AtlAxAttachControl(IUnknown *control, HWND hWnd, IUnknown **container) { - IOCS *pUnkContainer; HRESULT hr; - TRACE( "%p %p %p\n", pControl, hWnd, ppUnkContainer ); + TRACE("(%p %p %p)\n", control, hWnd, container); - if (!pControl) + if (!control) return E_INVALIDARG; - hr = IOCS_Create( hWnd, pControl, &pUnkContainer ); - if ( SUCCEEDED( hr ) && ppUnkContainer) - { - *ppUnkContainer = (IUnknown*) pUnkContainer; - } - - if(!hWnd) - return S_FALSE; - - return hr; + hr = IOCS_Create( hWnd, control, container ); + return hWnd ? hr : S_FALSE; } /********************************************************************** @@ -1334,13 +1321,13 @@ * AtlAxGetHost [atl100.@] * */ -HRESULT WINAPI AtlAxGetHost(HWND hWnd, IUnknown **pUnk) +HRESULT WINAPI AtlAxGetHost(HWND hWnd, IUnknown **host) { IOCS *This; - TRACE( "(%p, %p)\n", hWnd, pUnk ); + TRACE("(%p, %p)\n", hWnd, host); - *pUnk = NULL; + *host = NULL; This = (IOCS*) GetWindowLongPtrW( hWnd, GWLP_USERDATA ); if ( !This ) @@ -1349,7 +1336,7 @@ return E_FAIL; } - return IOCS_QueryInterface( This, &IID_IUnknown, (void**) pUnk ); + return IOleClientSite_QueryInterface(&This->IOleClientSite_iface, &IID_IUnknown, (void**)host); } /*********************************************************************** diff -Nru wine1.7-1.7.14/dlls/atl/tests/atl_ax.c wine1.7-1.7.18/dlls/atl/tests/atl_ax.c --- wine1.7-1.7.14/dlls/atl/tests/atl_ax.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/atl/tests/atl_ax.c 2014-05-02 18:15:48.000000000 +0000 @@ -97,15 +97,11 @@ hr = pAtlAxAttachControl(pObj, NULL, NULL); ok(hr == S_FALSE, "Expected AtlAxAttachControl to return S_FALSE, got 0x%08x\n", hr); - pContainer = (IUnknown *)0xdeadbeef; + pContainer = NULL; hr = pAtlAxAttachControl(pObj, NULL, &pContainer); ok(hr == S_FALSE, "Expected AtlAxAttachControl to return S_FALSE, got 0x%08x\n", hr); - ok(pContainer != (IUnknown *)0xdeadbeef && - pContainer != NULL, - "Expected the output container pointer to be initialized to non-NULL, got %p\n", pContainer); - - if (pContainer != (IUnknown *)0xdeadbeef && pContainer != NULL) - IUnknown_Release(pContainer); + ok(pContainer != NULL, "got %p\n", pContainer); + IUnknown_Release(pContainer); hr = pAtlAxAttachControl(pObj, hwnd, NULL); ok(hr == S_OK, "Expected AtlAxAttachControl to return S_OK, got 0x%08x\n", hr); diff -Nru wine1.7-1.7.14/dlls/avifil32/wavfile.c wine1.7-1.7.18/dlls/avifil32/wavfile.c --- wine1.7-1.7.14/dlls/avifil32/wavfile.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/avifil32/wavfile.c 2014-05-02 18:15:48.000000000 +0000 @@ -274,7 +274,7 @@ return AVIERR_NODATA; *avis = &This->IAVIStream_iface; - IAVIFile_AddRef(*avis); + IAVIStream_AddRef(*avis); return AVIERR_OK; } @@ -325,7 +325,7 @@ This->ckData.cksize = 0; *avis = &This->IAVIStream_iface; - IAVIFile_AddRef(*avis); + IAVIStream_AddRef(*avis); return AVIERR_OK; } diff -Nru wine1.7-1.7.14/dlls/bcrypt/bcrypt_main.c wine1.7-1.7.18/dlls/bcrypt/bcrypt_main.c --- wine1.7-1.7.14/dlls/bcrypt/bcrypt_main.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/bcrypt/bcrypt_main.c 2014-05-02 18:15:48.000000000 +0000 @@ -91,3 +91,16 @@ FIXME("called with unsupported parameters, returning error\n"); return STATUS_NOT_IMPLEMENTED; } + +NTSTATUS WINAPI BCryptOpenAlgorithmProvider(BCRYPT_ALG_HANDLE *algorithm, LPCWSTR algorithmId, + LPCWSTR implementation, DWORD flags) +{ + FIXME("%p, %s, %s, %08x - stub\n", algorithm, wine_dbgstr_w(algorithmId), wine_dbgstr_w(implementation), flags); + + if (!algorithm) + return STATUS_INVALID_PARAMETER; + + *algorithm = NULL; + + return STATUS_NOT_IMPLEMENTED; +} diff -Nru wine1.7-1.7.14/dlls/bcrypt/bcrypt.spec wine1.7-1.7.18/dlls/bcrypt/bcrypt.spec --- wine1.7-1.7.14/dlls/bcrypt/bcrypt.spec 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/bcrypt/bcrypt.spec 2014-05-02 18:15:48.000000000 +0000 @@ -32,7 +32,7 @@ @ stub BCryptHashData @ stub BCryptImportKey @ stub BCryptImportKeyPair -@ stub BCryptOpenAlgorithmProvider +@ stdcall BCryptOpenAlgorithmProvider(ptr wstr wstr long) @ stub BCryptQueryContextConfiguration @ stub BCryptQueryContextFunctionConfiguration @ stub BCryptQueryContextFunctionProperty diff -Nru wine1.7-1.7.14/dlls/comctl32/comctl32.spec wine1.7-1.7.18/dlls/comctl32/comctl32.spec --- wine1.7-1.7.14/dlls/comctl32/comctl32.spec 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/comctl32/comctl32.spec 2014-05-02 18:15:48.000000000 +0000 @@ -62,32 +62,32 @@ 341 stdcall -noname SendNotify(long long long ptr) 342 stdcall -noname SendNotifyEx(long long long ptr long) 345 stdcall -ordinal TaskDialogIndirect(ptr ptr ptr ptr) -350 stdcall -noname StrChrA(str str) -351 stdcall -noname StrRChrA(str str long) -352 stdcall -noname StrCmpNA(str str long) -353 stdcall -noname StrCmpNIA(str str long) -354 stdcall -noname StrStrA(str str) -355 stdcall -noname StrStrIA(str str) -356 stdcall -noname StrCSpnA(str str) -357 stdcall -noname StrToIntA(str) -358 stdcall -noname StrChrW(wstr long) -359 stdcall -noname StrRChrW(wstr wstr long) -360 stdcall -noname StrCmpNW(wstr wstr long) -361 stdcall -noname StrCmpNIW(wstr wstr long) -362 stdcall -noname StrStrW(wstr wstr) -363 stdcall -noname StrStrIW(wstr wstr) -364 stdcall -noname StrCSpnW(wstr wstr) -365 stdcall -noname StrToIntW(wstr) -366 stdcall -noname StrChrIA(str long) -367 stdcall -noname StrChrIW(wstr long) -368 stdcall -noname StrRChrIA(str str long) -369 stdcall -noname StrRChrIW(wstr wstr long) -372 stdcall -noname StrRStrIA(str str str) -373 stdcall -noname StrRStrIW(wstr wstr wstr) -374 stdcall -noname StrCSpnIA(str str) -375 stdcall -noname StrCSpnIW(wstr wstr) -376 stdcall -noname IntlStrEqWorkerA(long str str long) -377 stdcall -noname IntlStrEqWorkerW(long wstr wstr long) +350 stdcall -noname -private StrChrA(str str) +351 stdcall -noname -private StrRChrA(str str long) +352 stdcall -noname -private StrCmpNA(str str long) +353 stdcall -noname -private StrCmpNIA(str str long) +354 stdcall -noname -private StrStrA(str str) +355 stdcall -noname -private StrStrIA(str str) +356 stdcall -noname -private StrCSpnA(str str) +357 stdcall -noname -private StrToIntA(str) +358 stdcall -noname -private StrChrW(wstr long) +359 stdcall -noname -private StrRChrW(wstr wstr long) +360 stdcall -noname -private StrCmpNW(wstr wstr long) +361 stdcall -noname -private StrCmpNIW(wstr wstr long) +362 stdcall -noname -private StrStrW(wstr wstr) +363 stdcall -noname -private StrStrIW(wstr wstr) +364 stdcall -noname -private StrCSpnW(wstr wstr) +365 stdcall -noname -private StrToIntW(wstr) +366 stdcall -noname -private StrChrIA(str long) +367 stdcall -noname -private StrChrIW(wstr long) +368 stdcall -noname -private StrRChrIA(str str long) +369 stdcall -noname -private StrRChrIW(wstr wstr long) +372 stdcall -noname -private StrRStrIA(str str str) +373 stdcall -noname -private StrRStrIW(wstr wstr wstr) +374 stdcall -noname -private StrCSpnIA(str str) +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) 382 stdcall -noname SmoothScrollWindow(ptr) 383 stub -noname DoReaderMode 384 stdcall -noname SetPathWordBreakProc(ptr long) diff -Nru wine1.7-1.7.14/dlls/comctl32/datetime.c wine1.7-1.7.18/dlls/comctl32/datetime.c --- wine1.7-1.7.14/dlls/comctl32/datetime.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/comctl32/datetime.c 2014-05-02 18:15:48.000000000 +0000 @@ -217,7 +217,7 @@ return FALSE; /* Windows returns true if the date is valid but outside the limits set */ - if (DATETIME_IsDateInValidRange(infoPtr, systime) == FALSE) + if (!DATETIME_IsDateInValidRange(infoPtr, systime)) return TRUE; infoPtr->dateValid = TRUE; @@ -846,7 +846,8 @@ DATETIME_ApplySelectedField (DATETIME_INFO *infoPtr) { int fieldNum = infoPtr->select & DTHT_DATEFIELD; - int i, val=0, clamp_day=0; + int i, val = 0; + BOOL clamp_day = FALSE; SYSTEMTIME date = infoPtr->date; int oldyear; @@ -870,7 +871,7 @@ date.wYear = date.wYear - (date.wYear%100) + val; if (DATETIME_IsDateInValidRange(infoPtr, &date)) - clamp_day = 1; + clamp_day = TRUE; else date.wYear = oldyear; @@ -881,7 +882,7 @@ date.wYear = val; if (DATETIME_IsDateInValidRange(infoPtr, &date)) - clamp_day = 1; + clamp_day = TRUE; else date.wYear = oldyear; @@ -889,7 +890,7 @@ case ONEDIGITMONTH: case TWODIGITMONTH: date.wMonth = val; - clamp_day = 1; + clamp_day = TRUE; break; case ONEDIGITDAY: case TWODIGITDAY: diff -Nru wine1.7-1.7.14/dlls/comctl32/dpa.c wine1.7-1.7.18/dlls/comctl32/dpa.c --- wine1.7-1.7.14/dlls/comctl32/dpa.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/comctl32/dpa.c 2014-05-02 18:15:48.000000000 +0000 @@ -129,8 +129,10 @@ if (!hDpa) return E_OUTOFMEMORY; - if (!DPA_Grow (hDpa, streamData.dwItems)) + if (!DPA_Grow (hDpa, streamData.dwItems)) { + DPA_Destroy (hDpa); return E_OUTOFMEMORY; + } /* load data from the stream into the dpa */ ptr = hDpa->ptrs; diff -Nru wine1.7-1.7.14/dlls/comctl32/imagelist.c wine1.7-1.7.18/dlls/comctl32/imagelist.c --- wine1.7-1.7.14/dlls/comctl32/imagelist.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/comctl32/imagelist.c 2014-05-02 18:15:48.000000000 +0000 @@ -2066,13 +2066,13 @@ * RETURNS * Success: The newly created image list. It contains a single image * consisting of the second image merged with the first. - * Failure: NULL, if either himl1 or himl2 are invalid. + * Failure: NULL, if either himl1 or himl2 is invalid. * * NOTES * - The returned image list should be deleted by the caller using * ImageList_Destroy() when it is no longer required. - * - If either i1 or i2 are not valid image indices they will be treated - * as a blank image. + * - If either i1 or i2 is not a valid image index, they will be treated + * as blank images. */ HIMAGELIST WINAPI ImageList_Merge (HIMAGELIST himl1, INT i1, HIMAGELIST himl2, INT i2, @@ -2376,6 +2376,12 @@ for (nCount = 0; nCount < MAX_OVERLAYIMAGE; nCount++) himl->nOvlIdx[nCount] = -1; + if (himl->has_alpha) + { + HeapFree( GetProcessHeap(), 0, himl->has_alpha ); + himl->has_alpha = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, himl->cMaxImage ); + } + hbmNewImage = ImageList_CreateImage(himl->hdcImage, himl, himl->cMaxImage); SelectObject (himl->hdcImage, hbmNewImage); DeleteObject (himl->hbmImage); diff -Nru wine1.7-1.7.14/dlls/comctl32/listview.c wine1.7-1.7.18/dlls/comctl32/listview.c --- wine1.7-1.7.14/dlls/comctl32/listview.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/comctl32/listview.c 2014-05-02 18:15:48.000000000 +0000 @@ -3677,8 +3677,8 @@ static BOOL LISTVIEW_KeySelection(LISTVIEW_INFO *infoPtr, INT nItem, BOOL space) { /* FIXME: pass in the state */ - WORD wShift = HIWORD(GetKeyState(VK_SHIFT)); - WORD wCtrl = HIWORD(GetKeyState(VK_CONTROL)); + WORD wShift = GetKeyState(VK_SHIFT) & 0x8000; + WORD wCtrl = GetKeyState(VK_CONTROL) & 0x8000; BOOL bResult = FALSE; TRACE("nItem=%d, wShift=%d, wCtrl=%d\n", nItem, wShift, wCtrl); @@ -5383,9 +5383,8 @@ */ static BOOL LISTVIEW_DeleteAllItems(LISTVIEW_INFO *infoPtr, BOOL destroy) { - NMLISTVIEW nmlv; HDPA hdpaSubItems = NULL; - BOOL bSuppress; + BOOL suppress = FALSE; ITEMHDR *hdrItem; ITEM_INFO *lpItem; ITEM_ID *lpID; @@ -5400,11 +5399,15 @@ SetRectEmpty(&infoPtr->rcFocus); /* But we are supposed to leave nHotItem as is! */ - /* send LVN_DELETEALLITEMS notification */ - ZeroMemory(&nmlv, sizeof(NMLISTVIEW)); - nmlv.iItem = -1; - bSuppress = notify_listview(infoPtr, LVN_DELETEALLITEMS, &nmlv); + if (!(infoPtr->dwStyle & LVS_OWNERDATA) || !destroy) + { + NMLISTVIEW nmlv; + + memset(&nmlv, 0, sizeof(NMLISTVIEW)); + nmlv.iItem = -1; + suppress = notify_listview(infoPtr, LVN_DELETEALLITEMS, &nmlv); + } for (i = infoPtr->nItemCount - 1; i >= 0; i--) { @@ -5412,7 +5415,7 @@ { /* send LVN_DELETEITEM notification, if not suppressed and if it is not a virtual listview */ - if (!bSuppress) notify_deleteitem(infoPtr, i); + if (!suppress) notify_deleteitem(infoPtr, i); hdpaSubItems = DPA_GetPtr(infoPtr->hdpaItems, i); lpItem = DPA_GetPtr(hdpaSubItems, 0); /* free id struct */ diff -Nru wine1.7-1.7.14/dlls/comctl32/tests/header.c wine1.7-1.7.18/dlls/comctl32/tests/header.c --- wine1.7-1.7.14/dlls/comctl32/tests/header.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/comctl32/tests/header.c 2014-05-02 18:15:48.000000000 +0000 @@ -442,6 +442,7 @@ if (defwndproc_counter) msg.flags |= defwinproc; msg.wParam = wParam; msg.lParam = lParam; + msg.id = 0; add_message(sequences, PARENT_SEQ_INDEX, &msg); } diff -Nru wine1.7-1.7.14/dlls/comctl32/tests/listview.c wine1.7-1.7.18/dlls/comctl32/tests/listview.c --- wine1.7-1.7.14/dlls/comctl32/tests/listview.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/comctl32/tests/listview.c 2014-05-02 18:15:48.000000000 +0000 @@ -330,6 +330,23 @@ { 0 } }; +static const struct message listview_ownerdata_destroy[] = { + { 0x0090, sent|optional }, /* Vista */ + { WM_PARENTNOTIFY, sent }, + { WM_SHOWWINDOW, sent }, + { WM_WINDOWPOSCHANGING, sent }, + { WM_WINDOWPOSCHANGED, sent|optional }, + { WM_DESTROY, sent }, + { WM_NCDESTROY, sent }, + { 0 } +}; + +static const struct message listview_ownerdata_deleteall[] = { + { LVM_DELETEALLITEMS, sent }, + { WM_NOTIFY, sent|id, 0, 0, LVN_DELETEALLITEMS }, + { 0 } +}; + static const struct message listview_header_changed_seq[] = { { LVM_SETCOLUMNA, sent }, { WM_NOTIFY, sent|id|defwinproc, 0, 0, LISTVIEW_ID }, @@ -5059,6 +5076,7 @@ static void test_destroynotify(void) { HWND hwnd; + BOOL ret; hwnd = create_listview_control(LVS_REPORT); ok(hwnd != NULL, "failed to create listview window\n"); @@ -5066,6 +5084,23 @@ flush_sequences(sequences, NUM_MSG_SEQUENCES); DestroyWindow(hwnd); ok_sequence(sequences, COMBINED_SEQ_INDEX, listview_destroy, "check destroy order", FALSE); + + /* same for ownerdata list */ + hwnd = create_listview_control(LVS_REPORT|LVS_OWNERDATA); + ok(hwnd != NULL, "failed to create listview window\n"); + + flush_sequences(sequences, NUM_MSG_SEQUENCES); + DestroyWindow(hwnd); + ok_sequence(sequences, COMBINED_SEQ_INDEX, listview_ownerdata_destroy, "check destroy order, ownerdata", FALSE); + + hwnd = create_listview_control(LVS_REPORT|LVS_OWNERDATA); + ok(hwnd != NULL, "failed to create listview window\n"); + + flush_sequences(sequences, NUM_MSG_SEQUENCES); + ret = SendMessageA(hwnd, LVM_DELETEALLITEMS, 0, 0); + ok(ret == TRUE, "got %d\n", ret); + ok_sequence(sequences, COMBINED_SEQ_INDEX, listview_ownerdata_deleteall, "deleteall ownerdata", FALSE); + DestroyWindow(hwnd); } static void test_header_notification(void) diff -Nru wine1.7-1.7.14/dlls/comctl32/tests/msg.h wine1.7-1.7.18/dlls/comctl32/tests/msg.h --- wine1.7-1.7.14/dlls/comctl32/tests/msg.h 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/comctl32/tests/msg.h 2014-05-02 18:15:48.000000000 +0000 @@ -38,7 +38,8 @@ optional = 0x80, hook = 0x100, winevent_hook =0x200, - id = 0x400 + id = 0x400, + custdraw = 0x800 } msg_flags_t; struct message @@ -49,6 +50,7 @@ LPARAM lParam; /* expected value of lParam */ UINT id; /* extra message data: id of the window, notify code etc. */ + DWORD stage; /* custom draw stage */ }; struct msg_sequence @@ -80,12 +82,7 @@ assert(msg_seq->sequence); - msg_seq->sequence[msg_seq->count].message = msg->message; - msg_seq->sequence[msg_seq->count].flags = msg->flags; - msg_seq->sequence[msg_seq->count].wParam = msg->wParam; - msg_seq->sequence[msg_seq->count].lParam = msg->lParam; - msg_seq->sequence[msg_seq->count].id = msg->id; - + msg_seq->sequence[msg_seq->count] = *msg; msg_seq->count++; } @@ -165,6 +162,26 @@ } } + if (expected->flags & custdraw) + { + if (expected->stage != actual->stage && todo) + { + todo_wine + { + failcount++; + ok_(file, line) (FALSE, + "%s: in msg 0x%04x expecting cd stage 0x%08x got 0x%08x\n", + context, expected->message, expected->stage, actual->stage); + } + } + else + { + ok_(file, line) (expected->stage == actual->stage, + "%s: in msg 0x%04x expecting cd stage 0x%08x got 0x%08x\n", + context, expected->message, expected->stage, actual->stage); + } + } + if (expected->flags & id) { if (expected->id != actual->id && expected->flags & optional) diff -Nru wine1.7-1.7.14/dlls/comctl32/tests/tooltips.c wine1.7-1.7.18/dlls/comctl32/tests/tooltips.c --- wine1.7-1.7.14/dlls/comctl32/tests/tooltips.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/comctl32/tests/tooltips.c 2014-05-02 18:15:48.000000000 +0000 @@ -466,6 +466,7 @@ tiW.hwnd = NULL; tiW.uId = 0x1234ABCD; tiW.lParam = 0xaaaaaaaa; + tiW.lpszText = NULL; r = SendMessageA(hwnd, TTM_GETTOOLINFOW, 0, (LPARAM)&tiW); ok(r, "Getting tooltip info failed\n"); ok(0x1abe11ed == tiW.lParam || diff -Nru wine1.7-1.7.14/dlls/comctl32/tests/treeview.c wine1.7-1.7.18/dlls/comctl32/tests/treeview.c --- wine1.7-1.7.14/dlls/comctl32/tests/treeview.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/comctl32/tests/treeview.c 2014-05-02 18:15:48.000000000 +0000 @@ -40,10 +40,12 @@ static BOOL g_disp_A_to_W; static BOOL g_disp_set_stateimage; static BOOL g_beginedit_alter_text; +static HFONT g_customdraw_font; -#define NUM_MSG_SEQUENCES 2 +#define NUM_MSG_SEQUENCES 3 #define TREEVIEW_SEQ_INDEX 0 #define PARENT_SEQ_INDEX 1 +#define PARENT_CD_SEQ_INDEX 2 #define expect(expected, got) ok(got == expected, "Expected %d, got %d\n", expected, got) @@ -242,6 +244,14 @@ { 0 } }; +static const struct message parent_cd_seq[] = { + { WM_NOTIFY, sent|id|custdraw, 0, 0, NM_CUSTOMDRAW, CDDS_PREPAINT }, + { WM_NOTIFY, sent|id|custdraw, 0, 0, NM_CUSTOMDRAW, CDDS_ITEMPREPAINT }, + { WM_NOTIFY, sent|id|custdraw, 0, 0, NM_CUSTOMDRAW, CDDS_ITEMPOSTPAINT }, + { WM_NOTIFY, sent|id|custdraw, 0, 0, NM_CUSTOMDRAW, CDDS_POSTPAINT }, + { 0 } +}; + static HWND hMainWnd; static HTREEITEM hRoot, hChild; @@ -1149,6 +1159,38 @@ break; } + case NM_CUSTOMDRAW: + { + NMTVCUSTOMDRAW *nmcd = (NMTVCUSTOMDRAW*)lParam; + COLORREF c0ffee = RGB(0xc0,0xff,0xee), cafe = RGB(0xca,0xfe,0x00); + + msg.flags |= custdraw; + msg.stage = nmcd->nmcd.dwDrawStage; + add_message(sequences, PARENT_CD_SEQ_INDEX, &msg); + + switch (msg.stage) + { + case CDDS_PREPAINT: + return CDRF_NOTIFYITEMDRAW|CDRF_NOTIFYITEMERASE|CDRF_NOTIFYPOSTPAINT; + case CDDS_ITEMPREPAINT: + nmcd->clrTextBk = c0ffee; + nmcd->clrText = cafe; + if (g_customdraw_font) + SelectObject(nmcd->nmcd.hdc, g_customdraw_font); + return CDRF_NOTIFYPOSTPAINT|CDRF_NEWFONT; + case CDDS_ITEMPOSTPAINT: + /* at the point of post paint notification colors are already restored */ + ok(GetTextColor(nmcd->nmcd.hdc) != cafe, "got 0%x\n", GetTextColor(nmcd->nmcd.hdc)); + ok(GetBkColor(nmcd->nmcd.hdc) != c0ffee, "got 0%x\n", GetBkColor(nmcd->nmcd.hdc)); + if (g_customdraw_font) + ok(GetCurrentObject(nmcd->nmcd.hdc, OBJ_FONT) != g_customdraw_font, "got %p\n", + GetCurrentObject(nmcd->nmcd.hdc, OBJ_FONT)); + break; + default: + ; + } + break; + } } } break; @@ -2053,6 +2095,37 @@ DestroyWindow(hTree); } +static void test_customdraw(void) +{ + static const char *rootA = "root"; + TVINSERTSTRUCTA ins; + HTREEITEM hRoot; + LOGFONTA lf; + HWND hwnd; + + hwnd = create_treeview_control(0); + + ins.hParent = TVI_ROOT; + ins.hInsertAfter = TVI_ROOT; + U(ins).item.mask = TVIF_TEXT; + U(ins).item.pszText = (char*)rootA; + hRoot = TreeView_InsertItemA(hwnd, &ins); + ok(hRoot != NULL, "got %p\n", hRoot); + + /* create additional font, custom draw handler will select it */ + SystemParametersInfoA(SPI_GETICONTITLELOGFONT, sizeof(lf), &lf, 0); + lf.lfHeight *= 2; + g_customdraw_font = CreateFontIndirectA(&lf); + flush_sequences(sequences, NUM_MSG_SEQUENCES); + InvalidateRect(hwnd, NULL, TRUE); + UpdateWindow(hwnd); + ok_sequence(sequences, PARENT_CD_SEQ_INDEX, parent_cd_seq, "custom draw notifications", FALSE); + DeleteObject(g_customdraw_font); + g_customdraw_font = NULL; + + DestroyWindow(hwnd); +} + START_TEST(treeview) { HMODULE hComctl32; @@ -2126,6 +2199,7 @@ test_TVM_GETNEXTITEM(); test_TVM_HITTEST(); test_WM_GETDLGCODE(); + test_customdraw(); if (!load_v6_module(&ctx_cookie, &hCtx)) { diff -Nru wine1.7-1.7.14/dlls/comctl32/toolbar.c wine1.7-1.7.18/dlls/comctl32/toolbar.c --- wine1.7-1.7.14/dlls/comctl32/toolbar.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/comctl32/toolbar.c 2014-05-02 18:15:48.000000000 +0000 @@ -857,8 +857,11 @@ /* empirical tests show that iBitmap can/will be non-zero */ /* when drawing the vertical bar... */ if ((dwStyle & TBSTYLE_FLAT) /* && (btnPtr->iBitmap == 0) */) { - if (dwStyle & CCS_VERT) - TOOLBAR_DrawFlatHorizontalSeparator (&rc, hdc, infoPtr); + if (dwStyle & CCS_VERT) { + RECT rcsep = rc; + InflateRect(&rcsep, -infoPtr->szPadding.cx, -infoPtr->szPadding.cy); + TOOLBAR_DrawFlatHorizontalSeparator (&rcsep, hdc, infoPtr); + } else TOOLBAR_DrawFlatSeparator (&rc, hdc, infoPtr); } @@ -1676,7 +1679,7 @@ if (btnPtr->fsStyle & BTNS_SEP) { if (infoPtr->dwStyle & CCS_VERT) { cy = (btnPtr->iBitmap > 0) ? btnPtr->iBitmap : SEPARATOR_WIDTH; - cx = (btnPtr->cx > 0) ? btnPtr->cx : infoPtr->nWidth; + cx = (btnPtr->cx > 0) ? btnPtr->cx : infoPtr->nButtonWidth; } else cx = (btnPtr->cx > 0) ? btnPtr->cx : diff -Nru wine1.7-1.7.14/dlls/comctl32/treeview.c wine1.7-1.7.18/dlls/comctl32/treeview.c --- wine1.7-1.7.14/dlls/comctl32/treeview.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/comctl32/treeview.c 2014-05-02 18:15:48.000000000 +0000 @@ -2714,17 +2714,17 @@ DeleteObject(hNewPen); } + /* Restore the hdc state */ + SetTextColor(hdc, oldTextColor); + SetBkColor(hdc, oldTextBkColor); + SelectObject(hdc, hOldFont); + if (cditem & CDRF_NOTIFYPOSTPAINT) { cditem = TREEVIEW_SendCustomDrawItemNotify (infoPtr, hdc, item, CDDS_ITEMPOSTPAINT, &nmcdhdr); TRACE("postpaint:cditem-app returns 0x%x\n", cditem); } - - /* Restore the hdc state */ - SetTextColor(hdc, oldTextColor); - SetBkColor(hdc, oldTextBkColor); - SelectObject(hdc, hOldFont); } /* Computes treeHeight and treeWidth and updates the scroll bars. diff -Nru wine1.7-1.7.14/dlls/comdlg32/filedlg.c wine1.7-1.7.18/dlls/comdlg32/filedlg.c --- wine1.7-1.7.14/dlls/comdlg32/filedlg.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/comdlg32/filedlg.c 2014-05-02 18:15:48.000000000 +0000 @@ -1806,7 +1806,7 @@ } else { - /* Resize the height, if open as read only checkbox ad help button are + /* Resize the height; if opened as read-only, checkbox and help button are * hidden and we are not using a custom template nor a customDialog */ if ( (fodInfos->ofnInfos->Flags & OFN_HIDEREADONLY) && diff -Nru wine1.7-1.7.14/dlls/crypt32/chain.c wine1.7-1.7.18/dlls/crypt32/chain.c --- wine1.7-1.7.14/dlls/crypt32/chain.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/crypt32/chain.c 2014-05-02 18:15:48.000000000 +0000 @@ -185,14 +185,14 @@ if(!allow_default) return NULL; - if(!default_cu_engine) { + if(!default_lm_engine) { handle = CRYPT_CreateChainEngine(NULL, CERT_SYSTEM_STORE_LOCAL_MACHINE, &config); InterlockedCompareExchangePointer((void**)&default_lm_engine, handle, NULL); if(default_lm_engine != handle) CertFreeCertificateChainEngine(handle); } - return default_cu_engine; + return default_lm_engine; } return (CertificateChainEngine*)handle; diff -Nru wine1.7-1.7.14/dlls/crypt32/proplist.c wine1.7-1.7.18/dlls/crypt32/proplist.c --- wine1.7-1.7.14/dlls/crypt32/proplist.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/crypt32/proplist.c 2014-05-02 18:15:48.000000000 +0000 @@ -175,12 +175,15 @@ EnterCriticalSection(&list->cs); if (id) { - CONTEXT_PROPERTY *cursor = NULL; + CONTEXT_PROPERTY *cursor = NULL, *prop; - LIST_FOR_EACH_ENTRY(cursor, &list->properties, CONTEXT_PROPERTY, entry) + LIST_FOR_EACH_ENTRY(prop, &list->properties, CONTEXT_PROPERTY, entry) { - if (cursor->propID == id) + if (prop->propID == id) + { + cursor = prop; break; + } } if (cursor) { diff -Nru wine1.7-1.7.14/dlls/crypt32/tests/cert.c wine1.7-1.7.18/dlls/crypt32/tests/cert.c --- wine1.7-1.7.14/dlls/crypt32/tests/cert.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/crypt32/tests/cert.c 2014-05-02 18:15:48.000000000 +0000 @@ -797,7 +797,7 @@ ok(link->pCertInfo == context->pCertInfo, "unexpected pCertInfo\n"); CertFreeCertificateContext(link); - + CertFreeCertificateContext(context); CertCloseStore(store, 0); } @@ -2343,6 +2343,7 @@ "Expected NTE_NO_KEY, got %08x\n", GetLastError()); ret = CryptGenKey(csp, AT_KEYEXCHANGE, 0, &key); ok(ret, "CryptGenKey failed: %08x\n", GetLastError()); + CryptDestroyKey(key); memset(&info,0,sizeof(info)); info.dwProvType = PROV_RSA_FULL; diff -Nru wine1.7-1.7.14/dlls/crypt32/tests/chain.c wine1.7-1.7.18/dlls/crypt32/tests/chain.c --- wine1.7-1.7.14/dlls/crypt32/tests/chain.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/crypt32/tests/chain.c 2014-05-02 18:15:48.000000000 +0000 @@ -3880,9 +3880,8 @@ ok(ret, "CertGetCertificateChain failed: %08x\n", GetLastError()); if (ret) { - ok(!(chain->TrustStatus.dwErrorStatus & - CERT_TRUST_IS_NOT_VALID_FOR_USAGE), - "didn't expect CERT_TRUST_IS_NOT_VALID_FOR_USAGE\n"); + ok(!(chain->TrustStatus.dwErrorStatus & CERT_TRUST_IS_NOT_VALID_FOR_USAGE), + "didn't expect CERT_TRUST_IS_NOT_VALID_FOR_USAGE, got %x\n", chain->TrustStatus.dwErrorStatus); pCertFreeCertificateChain(chain); } oids[1] = one_two_three; diff -Nru wine1.7-1.7.14/dlls/d3d8/buffer.c wine1.7-1.7.18/dlls/d3d8/buffer.c --- wine1.7-1.7.14/dlls/d3d8/buffer.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/d3d8/buffer.c 2014-05-02 18:15:48.000000000 +0000 @@ -48,7 +48,7 @@ static ULONG WINAPI d3d8_vertexbuffer_AddRef(IDirect3DVertexBuffer8 *iface) { struct d3d8_vertexbuffer *buffer = impl_from_IDirect3DVertexBuffer8(iface); - ULONG refcount = InterlockedIncrement(&buffer->refcount); + ULONG refcount = InterlockedIncrement(&buffer->resource.refcount); TRACE("%p increasing refcount to %u.\n", iface, refcount); @@ -66,7 +66,7 @@ static ULONG WINAPI d3d8_vertexbuffer_Release(IDirect3DVertexBuffer8 *iface) { struct d3d8_vertexbuffer *buffer = impl_from_IDirect3DVertexBuffer8(iface); - ULONG refcount = InterlockedDecrement(&buffer->refcount); + ULONG refcount = InterlockedDecrement(&buffer->resource.refcount); TRACE("%p decreasing refcount to %u.\n", iface, refcount); @@ -104,52 +104,28 @@ REFGUID guid, const void *data, DWORD data_size, DWORD flags) { struct d3d8_vertexbuffer *buffer = impl_from_IDirect3DVertexBuffer8(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s, data %p, data_size %u, flags %#x.\n", iface, debugstr_guid(guid), data, data_size, flags); - wined3d_mutex_lock(); - resource = wined3d_buffer_get_resource(buffer->wined3d_buffer); - hr = wined3d_resource_set_private_data(resource, guid, data, data_size, flags); - wined3d_mutex_unlock(); - - return hr; + return d3d8_resource_set_private_data(&buffer->resource, guid, data, data_size, flags); } static HRESULT WINAPI d3d8_vertexbuffer_GetPrivateData(IDirect3DVertexBuffer8 *iface, REFGUID guid, void *data, DWORD *data_size) { struct d3d8_vertexbuffer *buffer = impl_from_IDirect3DVertexBuffer8(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s, data %p, data_size %p.\n", iface, debugstr_guid(guid), data, data_size); - wined3d_mutex_lock(); - resource = wined3d_buffer_get_resource(buffer->wined3d_buffer); - hr = wined3d_resource_get_private_data(resource, guid, data, data_size); - wined3d_mutex_unlock(); - - return hr; + return d3d8_resource_get_private_data(&buffer->resource, guid, data, data_size); } static HRESULT WINAPI d3d8_vertexbuffer_FreePrivateData(IDirect3DVertexBuffer8 *iface, REFGUID guid) { struct d3d8_vertexbuffer *buffer = impl_from_IDirect3DVertexBuffer8(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s.\n", iface, debugstr_guid(guid)); - wined3d_mutex_lock(); - resource = wined3d_buffer_get_resource(buffer->wined3d_buffer); - hr = wined3d_resource_free_private_data(resource, guid); - wined3d_mutex_unlock(); - - return hr; + return d3d8_resource_free_private_data(&buffer->resource, guid); } static DWORD WINAPI d3d8_vertexbuffer_SetPriority(IDirect3DVertexBuffer8 *iface, DWORD priority) @@ -274,7 +250,9 @@ static void STDMETHODCALLTYPE d3d8_vertexbuffer_wined3d_object_destroyed(void *parent) { - HeapFree(GetProcessHeap(), 0, parent); + struct d3d8_vertexbuffer *buffer = parent; + d3d8_resource_cleanup(&buffer->resource); + HeapFree(GetProcessHeap(), 0, buffer); } static const struct wined3d_parent_ops d3d8_vertexbuffer_wined3d_parent_ops = @@ -288,7 +266,7 @@ HRESULT hr; buffer->IDirect3DVertexBuffer8_iface.lpVtbl = &Direct3DVertexBuffer8_Vtbl; - buffer->refcount = 1; + d3d8_resource_init(&buffer->resource); buffer->fvf = fvf; wined3d_mutex_lock(); @@ -343,7 +321,7 @@ static ULONG WINAPI d3d8_indexbuffer_AddRef(IDirect3DIndexBuffer8 *iface) { struct d3d8_indexbuffer *buffer = impl_from_IDirect3DIndexBuffer8(iface); - ULONG refcount = InterlockedIncrement(&buffer->refcount); + ULONG refcount = InterlockedIncrement(&buffer->resource.refcount); TRACE("%p increasing refcount to %u.\n", iface, refcount); @@ -361,7 +339,7 @@ static ULONG WINAPI d3d8_indexbuffer_Release(IDirect3DIndexBuffer8 *iface) { struct d3d8_indexbuffer *buffer = impl_from_IDirect3DIndexBuffer8(iface); - ULONG refcount = InterlockedDecrement(&buffer->refcount); + ULONG refcount = InterlockedDecrement(&buffer->resource.refcount); TRACE("%p decreasing refcount to %u.\n", iface, refcount); @@ -399,52 +377,28 @@ REFGUID guid, const void *data, DWORD data_size, DWORD flags) { struct d3d8_indexbuffer *buffer = impl_from_IDirect3DIndexBuffer8(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s, data %p, data_size %u, flags %#x.\n", iface, debugstr_guid(guid), data, data_size, flags); - wined3d_mutex_lock(); - resource = wined3d_buffer_get_resource(buffer->wined3d_buffer); - hr = wined3d_resource_set_private_data(resource, guid, data, data_size, flags); - wined3d_mutex_unlock(); - - return hr; + return d3d8_resource_set_private_data(&buffer->resource, guid, data, data_size, flags); } static HRESULT WINAPI d3d8_indexbuffer_GetPrivateData(IDirect3DIndexBuffer8 *iface, REFGUID guid, void *data, DWORD *data_size) { struct d3d8_indexbuffer *buffer = impl_from_IDirect3DIndexBuffer8(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s, data %p, data_size %p.\n", iface, debugstr_guid(guid), data, data_size); - wined3d_mutex_lock(); - resource = wined3d_buffer_get_resource(buffer->wined3d_buffer); - hr = wined3d_resource_get_private_data(resource, guid, data, data_size); - wined3d_mutex_unlock(); - - return hr; + return d3d8_resource_get_private_data(&buffer->resource, guid, data, data_size); } static HRESULT WINAPI d3d8_indexbuffer_FreePrivateData(IDirect3DIndexBuffer8 *iface, REFGUID guid) { struct d3d8_indexbuffer *buffer = impl_from_IDirect3DIndexBuffer8(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s.\n", iface, debugstr_guid(guid)); - wined3d_mutex_lock(); - resource = wined3d_buffer_get_resource(buffer->wined3d_buffer); - hr = wined3d_resource_free_private_data(resource, guid); - wined3d_mutex_unlock(); - - return hr; + return d3d8_resource_free_private_data(&buffer->resource, guid); } static DWORD WINAPI d3d8_indexbuffer_SetPriority(IDirect3DIndexBuffer8 *iface, DWORD priority) @@ -568,7 +522,9 @@ static void STDMETHODCALLTYPE d3d8_indexbuffer_wined3d_object_destroyed(void *parent) { - HeapFree(GetProcessHeap(), 0, parent); + struct d3d8_indexbuffer *buffer = parent; + d3d8_resource_cleanup(&buffer->resource); + HeapFree(GetProcessHeap(), 0, buffer); } static const struct wined3d_parent_ops d3d8_indexbuffer_wined3d_parent_ops = @@ -582,7 +538,7 @@ HRESULT hr; buffer->IDirect3DIndexBuffer8_iface.lpVtbl = &d3d8_indexbuffer_vtbl; - buffer->refcount = 1; + d3d8_resource_init(&buffer->resource); buffer->format = wined3dformat_from_d3dformat(format); wined3d_mutex_lock(); diff -Nru wine1.7-1.7.14/dlls/d3d8/d3d8_main.c wine1.7-1.7.18/dlls/d3d8/d3d8_main.c --- wine1.7-1.7.14/dlls/d3d8/d3d8_main.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/d3d8/d3d8_main.c 2014-05-02 18:15:48.000000000 +0000 @@ -137,3 +137,81 @@ } return ret; } + +void d3d8_resource_cleanup(struct d3d8_resource *resource) +{ + wined3d_private_store_cleanup(&resource->private_store); +} + +HRESULT d3d8_resource_free_private_data(struct d3d8_resource *resource, const GUID *guid) +{ + struct wined3d_private_data *entry; + + wined3d_mutex_lock(); + entry = wined3d_private_store_get_private_data(&resource->private_store, guid); + if (!entry) + { + wined3d_mutex_unlock(); + return D3DERR_NOTFOUND; + } + + wined3d_private_store_free_private_data(&resource->private_store, entry); + wined3d_mutex_unlock(); + + return D3D_OK; +} + +HRESULT d3d8_resource_get_private_data(struct d3d8_resource *resource, const GUID *guid, + void *data, DWORD *data_size) +{ + const struct wined3d_private_data *stored_data; + DWORD size_in; + HRESULT hr; + + wined3d_mutex_lock(); + stored_data = wined3d_private_store_get_private_data(&resource->private_store, guid); + if (!stored_data) + { + hr = D3DERR_NOTFOUND; + goto done; + } + + size_in = *data_size; + *data_size = stored_data->size; + if (!data) + { + hr = D3D_OK; + goto done; + } + if (size_in < stored_data->size) + { + hr = D3DERR_MOREDATA; + goto done; + } + + if (stored_data->flags & WINED3DSPD_IUNKNOWN) + IUnknown_AddRef(stored_data->content.object); + memcpy(data, stored_data->content.data, stored_data->size); + hr = D3D_OK; + +done: + wined3d_mutex_unlock(); + return hr; +} + +void d3d8_resource_init(struct d3d8_resource *resource) +{ + resource->refcount = 1; + wined3d_private_store_init(&resource->private_store); +} + +HRESULT d3d8_resource_set_private_data(struct d3d8_resource *resource, const GUID *guid, + const void *data, DWORD data_size, DWORD flags) +{ + HRESULT hr; + + wined3d_mutex_lock(); + hr = wined3d_private_store_set_private_data(&resource->private_store, guid, data, data_size, flags); + wined3d_mutex_unlock(); + return hr; +} diff -Nru wine1.7-1.7.14/dlls/d3d8/d3d8_private.h wine1.7-1.7.18/dlls/d3d8/d3d8_private.h --- wine1.7-1.7.14/dlls/d3d8/d3d8_private.h 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/d3d8/d3d8_private.h 2014-05-02 18:15:48.000000000 +0000 @@ -174,10 +174,24 @@ HRESULT device_init(struct d3d8_device *device, struct d3d8 *parent, struct wined3d *wined3d, UINT adapter, D3DDEVTYPE device_type, HWND focus_window, DWORD flags, D3DPRESENT_PARAMETERS *parameters) DECLSPEC_HIDDEN; +struct d3d8_resource +{ + LONG refcount; + struct wined3d_private_store private_store; +}; + +void d3d8_resource_cleanup(struct d3d8_resource *resource) DECLSPEC_HIDDEN; +HRESULT d3d8_resource_free_private_data(struct d3d8_resource *resource, const GUID *guid) DECLSPEC_HIDDEN; +HRESULT d3d8_resource_get_private_data(struct d3d8_resource *resource, const GUID *guid, + void *data, DWORD *data_size) DECLSPEC_HIDDEN; +void d3d8_resource_init(struct d3d8_resource *resource) DECLSPEC_HIDDEN; +HRESULT d3d8_resource_set_private_data(struct d3d8_resource *resource, const GUID *guid, + const void *data, DWORD data_size, DWORD flags) DECLSPEC_HIDDEN; + struct d3d8_volume { IDirect3DVolume8 IDirect3DVolume8_iface; - LONG refcount; + struct d3d8_resource resource; struct wined3d_volume *wined3d_volume; IUnknown *container; IUnknown *forwardReference; @@ -200,7 +214,7 @@ struct d3d8_surface { IDirect3DSurface8 IDirect3DSurface8_iface; - LONG refcount; + struct d3d8_resource resource; struct wined3d_surface *wined3d_surface; IDirect3DDevice8 *parent_device; @@ -218,7 +232,7 @@ struct d3d8_vertexbuffer { IDirect3DVertexBuffer8 IDirect3DVertexBuffer8_iface; - LONG refcount; + struct d3d8_resource resource; struct wined3d_buffer *wined3d_buffer; IDirect3DDevice8 *parent_device; DWORD fvf; @@ -231,7 +245,7 @@ struct d3d8_indexbuffer { IDirect3DIndexBuffer8 IDirect3DIndexBuffer8_iface; - LONG refcount; + struct d3d8_resource resource; struct wined3d_buffer *wined3d_buffer; IDirect3DDevice8 *parent_device; enum wined3d_format_id format; @@ -244,7 +258,7 @@ struct d3d8_texture { IDirect3DBaseTexture8 IDirect3DBaseTexture8_iface; - LONG refcount; + struct d3d8_resource resource; struct wined3d_texture *wined3d_texture; IDirect3DDevice8 *parent_device; }; diff -Nru wine1.7-1.7.14/dlls/d3d8/device.c wine1.7-1.7.18/dlls/d3d8/device.c --- wine1.7-1.7.14/dlls/d3d8/device.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/d3d8/device.c 2014-05-02 18:15:48.000000000 +0000 @@ -600,7 +600,7 @@ } surface = wined3d_resource_get_parent(resource); - if (surface->refcount) + if (surface->resource.refcount) { WARN("Surface %p (resource %p) in pool D3DPOOL_DEFAULT blocks the Reset call.\n", surface, resource); return D3DERR_DEVICELOST; diff -Nru wine1.7-1.7.14/dlls/d3d8/directx.c wine1.7-1.7.18/dlls/d3d8/directx.c --- wine1.7-1.7.14/dlls/d3d8/directx.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/d3d8/directx.c 2014-05-02 18:15:48.000000000 +0000 @@ -410,7 +410,7 @@ d3d8->refcount = 1; wined3d_mutex_lock(); - d3d8->wined3d = wined3d_create(8, flags); + d3d8->wined3d = wined3d_create(flags); wined3d_mutex_unlock(); if (!d3d8->wined3d) return FALSE; diff -Nru wine1.7-1.7.14/dlls/d3d8/surface.c wine1.7-1.7.18/dlls/d3d8/surface.c --- wine1.7-1.7.14/dlls/d3d8/surface.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/d3d8/surface.c 2014-05-02 18:15:48.000000000 +0000 @@ -62,7 +62,7 @@ else { /* No container, handle our own refcounting */ - ULONG ref = InterlockedIncrement(&surface->refcount); + ULONG ref = InterlockedIncrement(&surface->resource.refcount); TRACE("%p increasing refcount to %u.\n", iface, ref); @@ -94,7 +94,7 @@ else { /* No container, handle our own refcounting */ - ULONG ref = InterlockedDecrement(&surface->refcount); + ULONG ref = InterlockedDecrement(&surface->resource.refcount); TRACE("%p decreasing refcount to %u.\n", iface, ref); @@ -150,52 +150,28 @@ const void *data, DWORD data_size, DWORD flags) { struct d3d8_surface *surface = impl_from_IDirect3DSurface8(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s, data %p, data_size %u, flags %#x.\n", iface, debugstr_guid(guid), data, data_size, flags); - wined3d_mutex_lock(); - resource = wined3d_surface_get_resource(surface->wined3d_surface); - hr = wined3d_resource_set_private_data(resource, guid, data, data_size, flags); - wined3d_mutex_unlock(); - - return hr; + return d3d8_resource_set_private_data(&surface->resource, guid, data, data_size, flags); } static HRESULT WINAPI d3d8_surface_GetPrivateData(IDirect3DSurface8 *iface, REFGUID guid, void *data, DWORD *data_size) { struct d3d8_surface *surface = impl_from_IDirect3DSurface8(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s, data %p, data_size %p.\n", iface, debugstr_guid(guid), data, data_size); - wined3d_mutex_lock(); - resource = wined3d_surface_get_resource(surface->wined3d_surface); - hr = wined3d_resource_get_private_data(resource, guid, data, data_size); - wined3d_mutex_unlock(); - - return hr; + return d3d8_resource_get_private_data(&surface->resource, guid, data, data_size); } static HRESULT WINAPI d3d8_surface_FreePrivateData(IDirect3DSurface8 *iface, REFGUID guid) { struct d3d8_surface *surface = impl_from_IDirect3DSurface8(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s.\n", iface, debugstr_guid(guid)); - wined3d_mutex_lock(); - resource = wined3d_surface_get_resource(surface->wined3d_surface); - hr = wined3d_resource_free_private_data(resource, guid); - wined3d_mutex_unlock(); - - return hr; + return d3d8_resource_free_private_data(&surface->resource, guid); } static HRESULT WINAPI d3d8_surface_GetContainer(IDirect3DSurface8 *iface, REFIID riid, void **container) @@ -325,7 +301,9 @@ static void STDMETHODCALLTYPE surface_wined3d_object_destroyed(void *parent) { - HeapFree(GetProcessHeap(), 0, parent); + struct d3d8_surface *surface = parent; + d3d8_resource_cleanup(&surface->resource); + HeapFree(GetProcessHeap(), 0, surface); } static const struct wined3d_parent_ops d3d8_surface_wined3d_parent_ops = @@ -337,7 +315,7 @@ struct d3d8_device *device, const struct wined3d_parent_ops **parent_ops) { surface->IDirect3DSurface8_iface.lpVtbl = &d3d8_surface_vtbl; - surface->refcount = 1; + d3d8_resource_init(&surface->resource); wined3d_surface_incref(wined3d_surface); surface->wined3d_surface = wined3d_surface; surface->parent_device = &device->IDirect3DDevice8_iface; diff -Nru wine1.7-1.7.14/dlls/d3d8/tests/device.c wine1.7-1.7.18/dlls/d3d8/tests/device.c --- wine1.7-1.7.14/dlls/d3d8/tests/device.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/d3d8/tests/device.c 2014-05-02 18:15:48.000000000 +0000 @@ -1942,16 +1942,12 @@ ok(hr == D3D_OK, "IDirect3DDevice8_SetVertexShader returned %#08x\n", hr); hr = IDirect3DDevice8_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice8_BeginScene failed with %#08x\n", hr); - if(hr == D3D_OK) - { - hr = IDirect3DDevice8_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 0 /* NumVerts */, - 0 /*PrimCount */, NULL, D3DFMT_INDEX16, quad, sizeof(quad[0])); - ok(hr == D3D_OK, "IDirect3DDevice8_DrawIndexedPrimitiveUP failed with %#08x\n", hr); - - hr = IDirect3DDevice8_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice8_EndScene failed with %#08x\n", hr); - } + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice8_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 0 /* NumVerts */, + 0 /* PrimCount */, NULL, D3DFMT_INDEX16, 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); IDirect3DDevice8_Present(device, NULL, NULL, NULL, NULL); @@ -3889,6 +3885,20 @@ HRESULT hr; DWORD size; DWORD data[4] = {1, 2, 3, 4}; + static const GUID d3d8_private_data_test_guid = + { + 0xfdb37466, + 0x428f, + 0x4edf, + {0xa3,0x7f,0x9b,0x1d,0xf4,0x88,0xc5,0xfc} + }; + static const GUID d3d8_private_data_test_guid2 = + { + 0x2e5afac2, + 0x87b5, + 0x4c10, + {0x9b,0x4b,0x89,0xd7,0xd1,0x12,0xe7,0x2b} + }; window = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_OVERLAPPEDWINDOW, 0, 0, 640, 480, 0, 0, 0, 0); @@ -3905,53 +3915,95 @@ hr = IDirect3DDevice8_CreateImageSurface(device, 4, 4, D3DFMT_A8R8G8B8, &surface); ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); - hr = IDirect3DSurface8_SetPrivateData(surface, &IID_IDirect3DSurface8 /* Abuse this tag */, + hr = IDirect3DSurface8_SetPrivateData(surface, &d3d8_private_data_test_guid, device, 0, D3DSPD_IUNKNOWN); ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); - hr = IDirect3DSurface8_SetPrivateData(surface, &IID_IDirect3DSurface8 /* Abuse this tag */, + hr = IDirect3DSurface8_SetPrivateData(surface, &d3d8_private_data_test_guid, device, 5, D3DSPD_IUNKNOWN); ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); - hr = IDirect3DSurface8_SetPrivateData(surface, &IID_IDirect3DSurface8 /* Abuse this tag */, + hr = IDirect3DSurface8_SetPrivateData(surface, &d3d8_private_data_test_guid, device, sizeof(IUnknown *) * 2, D3DSPD_IUNKNOWN); ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + /* A failing SetPrivateData call does not clear the old data with the same tag. */ + hr = IDirect3DSurface8_SetPrivateData(surface, &d3d8_private_data_test_guid, device, + sizeof(device), D3DSPD_IUNKNOWN); + ok(SUCCEEDED(hr), "Failed to set private data, hr %#x.\n", hr); + hr = IDirect3DSurface8_SetPrivateData(surface, &d3d8_private_data_test_guid, device, + sizeof(device) * 2, D3DSPD_IUNKNOWN); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + size = sizeof(ptr); + hr = IDirect3DSurface8_GetPrivateData(surface, &d3d8_private_data_test_guid, &ptr, &size); + ok(SUCCEEDED(hr), "Failed to get private data, hr %#x.\n", hr); + IUnknown_Release(ptr); + hr = IDirect3DSurface8_FreePrivateData(surface, &d3d8_private_data_test_guid); + ok(SUCCEEDED(hr), "Failed to free private data, hr %#x.\n", hr); + refcount = get_refcount((IUnknown *)device); - hr = IDirect3DSurface8_SetPrivateData(surface, &IID_IDirect3DSurface8 /* Abuse this tag */, + hr = IDirect3DSurface8_SetPrivateData(surface, &d3d8_private_data_test_guid, device, sizeof(IUnknown *), D3DSPD_IUNKNOWN); ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); expected_refcount = refcount + 1; refcount = get_refcount((IUnknown *)device); ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount); - hr = IDirect3DSurface8_FreePrivateData(surface, &IID_IDirect3DSurface8); + hr = IDirect3DSurface8_FreePrivateData(surface, &d3d8_private_data_test_guid); ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); expected_refcount = refcount - 1; refcount = get_refcount((IUnknown *)device); ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount); - hr = IDirect3DSurface8_SetPrivateData(surface, &IID_IDirect3DSurface8, + hr = IDirect3DSurface8_SetPrivateData(surface, &d3d8_private_data_test_guid, device, sizeof(IUnknown *), D3DSPD_IUNKNOWN); ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); - hr = IDirect3DSurface8_SetPrivateData(surface, &IID_IDirect3DSurface8, + hr = IDirect3DSurface8_SetPrivateData(surface, &d3d8_private_data_test_guid, surface, sizeof(IUnknown *), D3DSPD_IUNKNOWN); ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); refcount = get_refcount((IUnknown *)device); ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount); - hr = IDirect3DSurface8_SetPrivateData(surface, &IID_IDirect3DSurface8, + hr = IDirect3DSurface8_SetPrivateData(surface, &d3d8_private_data_test_guid, device, sizeof(IUnknown *), D3DSPD_IUNKNOWN); ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); - size = sizeof(ptr); - hr = IDirect3DSurface8_GetPrivateData(surface, &IID_IDirect3DSurface8, &ptr, &size); + size = 2 * sizeof(ptr); + hr = IDirect3DSurface8_GetPrivateData(surface, &d3d8_private_data_test_guid, &ptr, &size); ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(size == sizeof(device), "Got unexpected size %u.\n", size); expected_refcount = refcount + 2; refcount = get_refcount((IUnknown *)device); ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount); ok(ptr == (IUnknown *)device, "Got unexpected ptr %p, expected %p.\n", ptr, device); IUnknown_Release(ptr); + expected_refcount--; + + ptr = (IUnknown *)0xdeadbeef; + size = 1; + hr = IDirect3DSurface8_GetPrivateData(surface, &d3d8_private_data_test_guid, NULL, &size); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(size == sizeof(device), "Got unexpected size %u.\n", size); + size = 2 * sizeof(ptr); + hr = IDirect3DSurface8_GetPrivateData(surface, &d3d8_private_data_test_guid, NULL, &size); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(size == sizeof(device), "Got unexpected size %u.\n", size); + refcount = get_refcount((IUnknown *)device); + ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount); + size = 1; + hr = IDirect3DSurface8_GetPrivateData(surface, &d3d8_private_data_test_guid, &ptr, &size); + ok(hr == D3DERR_MOREDATA, "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 = IDirect3DSurface8_GetPrivateData(surface, &d3d8_private_data_test_guid2, NULL, NULL); + ok(hr == D3DERR_NOTFOUND, "Got unexpected hr %#x.\n", hr); + size = 0xdeadbabe; + hr = IDirect3DSurface8_GetPrivateData(surface, &d3d8_private_data_test_guid2, &ptr, &size); + ok(hr == D3DERR_NOTFOUND, "Got unexpected hr %#x.\n", hr); + ok(ptr == (IUnknown *)0xdeadbeef, "Got unexpected pointer %p.\n", ptr); + ok(size == 0xdeadbabe, "Got unexpected size %u.\n", size); + /* GetPrivateData with size = NULL causes an access violation on Windows if the + * requested data exists. */ /* Destroying the surface frees the held reference. */ IDirect3DSurface8_Release(surface); - expected_refcount = refcount - 3; + expected_refcount = refcount - 2; refcount = get_refcount((IUnknown *)device); ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount); @@ -3962,26 +4014,26 @@ hr = IDirect3DTexture8_GetSurfaceLevel(texture, 1, &surface2); ok(SUCCEEDED(hr), "Failed to get texture level 1, hr %#x.\n", hr); - hr = IDirect3DTexture8_SetPrivateData(texture, &IID_IDirect3DVertexBuffer8, data, sizeof(data), 0); + hr = IDirect3DTexture8_SetPrivateData(texture, &d3d8_private_data_test_guid, data, sizeof(data), 0); ok(SUCCEEDED(hr), "Failed to set private data, hr %#x.\n", hr); memset(data, 0, sizeof(data)); size = sizeof(data); - hr = IDirect3DSurface8_GetPrivateData(surface, &IID_IDirect3DVertexBuffer8, data, &size); + hr = IDirect3DSurface8_GetPrivateData(surface, &d3d8_private_data_test_guid, data, &size); ok(hr == D3DERR_NOTFOUND, "Got unexpected hr %#x.\n", hr); - hr = IDirect3DTexture8_GetPrivateData(texture, &IID_IDirect3DVertexBuffer8, data, &size); + hr = IDirect3DTexture8_GetPrivateData(texture, &d3d8_private_data_test_guid, data, &size); ok(SUCCEEDED(hr), "Failed to get private data, hr %#x.\n", hr); ok(data[0] == 1 && data[1] == 2 && data[2] == 3 && data[3] == 4, "Got unexpected private data: %u, %u, %u, %u.\n", data[0], data[1], data[2], data[3]); - hr = IDirect3DTexture8_FreePrivateData(texture, &IID_IDirect3DVertexBuffer8); + hr = IDirect3DTexture8_FreePrivateData(texture, &d3d8_private_data_test_guid); ok(SUCCEEDED(hr), "Failed to free private data, hr %#x.\n", hr); - hr = IDirect3DSurface8_SetPrivateData(surface, &IID_IDirect3DVertexBuffer8, data, sizeof(data), 0); + hr = IDirect3DSurface8_SetPrivateData(surface, &d3d8_private_data_test_guid, data, sizeof(data), 0); ok(SUCCEEDED(hr), "Failed to set private data, hr %#x.\n", hr); - hr = IDirect3DSurface8_GetPrivateData(surface2, &IID_IDirect3DVertexBuffer8, data, &size); + hr = IDirect3DSurface8_GetPrivateData(surface2, &d3d8_private_data_test_guid, data, &size); ok(hr == D3DERR_NOTFOUND, "Got unexpected hr %#x.\n", hr); - hr = IDirect3DSurface8_FreePrivateData(surface, &IID_IDirect3DVertexBuffer8); + hr = IDirect3DSurface8_FreePrivateData(surface, &d3d8_private_data_test_guid); ok(SUCCEEDED(hr), "Failed to free private data, hr %#x.\n", hr); IDirect3DSurface8_Release(surface2); @@ -5693,6 +5745,429 @@ if (hwnd2) DestroyWindow(hwnd2); } +static void test_begin_end_state_block(void) +{ + IDirect3DDevice8 *device; + DWORD stateblock; + IDirect3D8 *d3d; + ULONG refcount; + HWND window; + HRESULT hr; + + window = CreateWindowA("static", "d3d8_test", WS_OVERLAPPEDWINDOW, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + d3d = Direct3DCreate8(D3D_SDK_VERSION); + ok(!!d3d, "Failed to create a D3D object.\n"); + if (!(device = create_device(d3d, window, window, TRUE))) + { + skip("Failed to create a D3D device, skipping tests.\n"); + IDirect3D8_Release(d3d); + DestroyWindow(window); + return; + } + + /* Should succeed. */ + hr = IDirect3DDevice8_BeginStateBlock(device); + ok(SUCCEEDED(hr), "Failed to begin stateblock, hr %#x.\n", hr); + + /* Calling BeginStateBlock() while recording should return + * D3DERR_INVALIDCALL. */ + hr = IDirect3DDevice8_BeginStateBlock(device); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + + /* Should succeed. */ + stateblock = 0xdeadbeef; + hr = IDirect3DDevice8_EndStateBlock(device, &stateblock); + ok(SUCCEEDED(hr), "Failed to end stateblock, hr %#x.\n", hr); + ok(!!stateblock && stateblock != 0xdeadbeef, "Got unexpected stateblock %#x.\n", stateblock); + IDirect3DDevice8_DeleteStateBlock(device, stateblock); + + /* Calling EndStateBlock() while not recording should return + * D3DERR_INVALIDCALL. stateblock should not be touched. */ + stateblock = 0xdeadbeef; + hr = IDirect3DDevice8_EndStateBlock(device, &stateblock); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + ok(stateblock == 0xdeadbeef, "Got unexpected stateblock %#x.\n", stateblock); + + refcount = IDirect3DDevice8_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + IDirect3D8_Release(d3d); + DestroyWindow(window); +} + +static void test_shader_constant_apply(void) +{ + static const float vs_const[] = {1.0f, 2.0f, 3.0f, 4.0f}; + static const float ps_const[] = {5.0f, 6.0f, 7.0f, 8.0f}; + static const float initial[] = {0.0f, 0.0f, 0.0f, 0.0f}; + DWORD vs_version, ps_version; + IDirect3DDevice8 *device; + DWORD stateblock; + IDirect3D8 *d3d; + ULONG refcount; + D3DCAPS8 caps; + float ret[4]; + HWND window; + HRESULT hr; + + window = CreateWindowA("static", "d3d8_test", WS_OVERLAPPEDWINDOW, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + d3d = Direct3DCreate8(D3D_SDK_VERSION); + ok(!!d3d, "Failed to create a D3D object.\n"); + if (!(device = create_device(d3d, window, window, TRUE))) + { + skip("Failed to create a D3D device, skipping tests.\n"); + IDirect3D8_Release(d3d); + DestroyWindow(window); + return; + } + + hr = IDirect3DDevice8_GetDeviceCaps(device, &caps); + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); + vs_version = caps.VertexShaderVersion & 0xffff; + ps_version = caps.PixelShaderVersion & 0xffff; + + if (vs_version) + { + hr = IDirect3DDevice8_SetVertexShaderConstant(device, 0, initial, 1); + ok(SUCCEEDED(hr), "Failed to set vertex shader constant, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetVertexShaderConstant(device, 1, initial, 1); + ok(SUCCEEDED(hr), "Failed to set vertex shader constant, hr %#x.\n", hr); + + hr = IDirect3DDevice8_GetVertexShaderConstant(device, 0, ret, 1); + ok(SUCCEEDED(hr), "Failed to get vertex shader constant, hr %#x.\n", hr); + ok(!memcmp(ret, initial, sizeof(initial)), + "Got unexpected vertex shader constant {%.8e, %.8e, %.8e, %.8e}, expected {%.8e, %.8e, %.8e, %.8e}.\n", + ret[0], ret[1], ret[2], ret[3], initial[0], initial[1], initial[2], initial[3]); + hr = IDirect3DDevice8_GetVertexShaderConstant(device, 1, ret, 1); + ok(SUCCEEDED(hr), "Failed to get vertex shader constant, hr %#x.\n", hr); + ok(!memcmp(ret, initial, sizeof(initial)), + "Got unexpected vertex shader constant {%.8e, %.8e, %.8e, %.8e}, expected {%.8e, %.8e, %.8e, %.8e}.\n", + ret[0], ret[1], ret[2], ret[3], initial[0], initial[1], initial[2], initial[3]); + + hr = IDirect3DDevice8_SetVertexShaderConstant(device, 0, vs_const, 1); + ok(SUCCEEDED(hr), "Failed to set vertex shader constant, hr %#x.\n", hr); + } + if (ps_version) + { + hr = IDirect3DDevice8_SetPixelShaderConstant(device, 0, initial, 1); + ok(SUCCEEDED(hr), "Failed to set pixel shader constant, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetPixelShaderConstant(device, 1, initial, 1); + ok(SUCCEEDED(hr), "Failed to set pixel shader constant, hr %#x.\n", hr); + + hr = IDirect3DDevice8_GetPixelShaderConstant(device, 0, ret, 1); + ok(SUCCEEDED(hr), "Failed to get pixel shader constant, hr %#x.\n", hr); + ok(!memcmp(ret, initial, sizeof(initial)), + "Got unexpected pixel shader constant {%.8e, %.8e, %.8e, %.8e}, expected {%.8e, %.8e, %.8e, %.8e}.\n", + ret[0], ret[1], ret[2], ret[3], initial[0], initial[1], initial[2], initial[3]); + hr = IDirect3DDevice8_GetPixelShaderConstant(device, 1, ret, 1); + ok(SUCCEEDED(hr), "Failed to get pixel shader constant, hr %#x.\n", hr); + ok(!memcmp(ret, initial, sizeof(initial)), + "Got unexpected pixel shader constant {%.8e, %.8e, %.8e, %.8e}, expected {%.8e, %.8e, %.8e, %.8e}.\n", + ret[0], ret[1], ret[2], ret[3], initial[0], initial[1], initial[2], initial[3]); + + hr = IDirect3DDevice8_SetPixelShaderConstant(device, 0, ps_const, 1); + ok(SUCCEEDED(hr), "Failed to set pixel shader constant, hr %#x.\n", hr); + } + + hr = IDirect3DDevice8_BeginStateBlock(device); + ok(SUCCEEDED(hr), "Failed to begin stateblock, hr %#x.\n", hr); + + if (vs_version) + { + hr = IDirect3DDevice8_SetVertexShaderConstant(device, 1, vs_const, 1); + ok(SUCCEEDED(hr), "Failed to set vertex shader constant, hr %#x.\n", hr); + } + if (ps_version) + { + hr = IDirect3DDevice8_SetPixelShaderConstant(device, 1, ps_const, 1); + ok(SUCCEEDED(hr), "Failed to set pixel shader constant, hr %#x.\n", hr); + } + + hr = IDirect3DDevice8_EndStateBlock(device, &stateblock); + ok(SUCCEEDED(hr), "Failed to end stateblock, hr %#x.\n", hr); + + if (vs_version) + { + hr = IDirect3DDevice8_GetVertexShaderConstant(device, 0, ret, 1); + ok(SUCCEEDED(hr), "Failed to get vertex shader constant, hr %#x.\n", hr); + ok(!memcmp(ret, vs_const, sizeof(vs_const)), + "Got unexpected vertex shader constant {%.8e, %.8e, %.8e, %.8e}, expected {%.8e, %.8e, %.8e, %.8e}.\n", + ret[0], ret[1], ret[2], ret[3], vs_const[0], vs_const[1], vs_const[2], vs_const[3]); + hr = IDirect3DDevice8_GetVertexShaderConstant(device, 1, ret, 1); + ok(SUCCEEDED(hr), "Failed to get vertex shader constant, hr %#x.\n", hr); + ok(!memcmp(ret, initial, sizeof(initial)), + "Got unexpected vertex shader constant {%.8e, %.8e, %.8e, %.8e}, expected {%.8e, %.8e, %.8e, %.8e}.\n", + ret[0], ret[1], ret[2], ret[3], initial[0], initial[1], initial[2], initial[3]); + } + if (ps_version) + { + hr = IDirect3DDevice8_GetPixelShaderConstant(device, 0, ret, 1); + ok(SUCCEEDED(hr), "Failed to get pixel shader constant, hr %#x.\n", hr); + ok(!memcmp(ret, ps_const, sizeof(ps_const)), + "Got unexpected pixel shader constant {%.8e, %.8e, %.8e, %.8e}, expected {%.8e, %.8e, %.8e, %.8e}.\n", + ret[0], ret[1], ret[2], ret[3], ps_const[0], ps_const[1], ps_const[2], ps_const[3]); + hr = IDirect3DDevice8_GetPixelShaderConstant(device, 1, ret, 1); + ok(SUCCEEDED(hr), "Failed to get pixel shader constant, hr %#x.\n", hr); + ok(!memcmp(ret, initial, sizeof(initial)), + "Got unexpected pixel shader constant {%.8e, %.8e, %.8e, %.8e}, expected {%.8e, %.8e, %.8e, %.8e}.\n", + ret[0], ret[1], ret[2], ret[3], initial[0], initial[1], initial[2], initial[3]); + } + + /* Apply doesn't overwrite constants that aren't explicitly set on the + * source stateblock. */ + hr = IDirect3DDevice8_ApplyStateBlock(device, stateblock); + ok(SUCCEEDED(hr), "Failed to apply stateblock, hr %#x.\n", hr); + + if (vs_version) + { + hr = IDirect3DDevice8_GetVertexShaderConstant(device, 0, ret, 1); + ok(SUCCEEDED(hr), "Failed to get vertex shader constant, hr %#x.\n", hr); + ok(!memcmp(ret, vs_const, sizeof(vs_const)), + "Got unexpected vertex shader constant {%.8e, %.8e, %.8e, %.8e}, expected {%.8e, %.8e, %.8e, %.8e}.\n", + ret[0], ret[1], ret[2], ret[3], vs_const[0], vs_const[1], vs_const[2], vs_const[3]); + hr = IDirect3DDevice8_GetVertexShaderConstant(device, 1, ret, 1); + ok(SUCCEEDED(hr), "Failed to get vertex shader constant, hr %#x.\n", hr); + ok(!memcmp(ret, vs_const, sizeof(vs_const)), + "Got unexpected vertex shader constant {%.8e, %.8e, %.8e, %.8e}, expected {%.8e, %.8e, %.8e, %.8e}.\n", + ret[0], ret[1], ret[2], ret[3], vs_const[0], vs_const[1], vs_const[2], vs_const[3]); + } + if (ps_version) + { + hr = IDirect3DDevice8_GetPixelShaderConstant(device, 0, ret, 1); + ok(SUCCEEDED(hr), "Failed to get pixel shader constant, hr %#x.\n", hr); + ok(!memcmp(ret, ps_const, sizeof(ps_const)), + "Got unexpected pixel shader constant {%.8e, %.8e, %.8e, %.8e}, expected {%.8e, %.8e, %.8e, %.8e}.\n", + ret[0], ret[1], ret[2], ret[3], ps_const[0], ps_const[1], ps_const[2], ps_const[3]); + hr = IDirect3DDevice8_GetPixelShaderConstant(device, 1, ret, 1); + ok(SUCCEEDED(hr), "Failed to get pixel shader constant, hr %#x.\n", hr); + ok(!memcmp(ret, ps_const, sizeof(ps_const)), + "Got unexpected pixel shader constant {%.8e, %.8e, %.8e, %.8e}, expected {%.8e, %.8e, %.8e, %.8e}.\n", + ret[0], ret[1], ret[2], ret[3], ps_const[0], ps_const[1], ps_const[2], ps_const[3]); + } + + IDirect3DDevice8_DeleteStateBlock(device, stateblock); + refcount = IDirect3DDevice8_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + IDirect3D8_Release(d3d); + DestroyWindow(window); +} + +static void test_resource_type(void) +{ + IDirect3DDevice8 *device; + IDirect3DSurface8 *surface; + IDirect3DTexture8 *texture; + IDirect3DCubeTexture8 *cube_texture; + IDirect3DVolume8 *volume; + IDirect3DVolumeTexture8 *volume_texture; + D3DSURFACE_DESC surface_desc; + D3DVOLUME_DESC volume_desc; + D3DRESOURCETYPE type; + IDirect3D8 *d3d; + ULONG refcount; + HWND window; + HRESULT hr; + + window = CreateWindowA("static", "d3d8_test", WS_OVERLAPPEDWINDOW, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + d3d = Direct3DCreate8(D3D_SDK_VERSION); + ok(!!d3d, "Failed to create a D3D object.\n"); + if (!(device = create_device(d3d, window, window, TRUE))) + { + skip("Failed to create a D3D device, skipping tests.\n"); + IDirect3D8_Release(d3d); + DestroyWindow(window); + return; + } + + hr = IDirect3DDevice8_CreateImageSurface(device, 4, 4, D3DFMT_X8R8G8B8, &surface); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + hr = IDirect3DSurface8_GetDesc(surface, &surface_desc); + ok(SUCCEEDED(hr), "Failed to get surface description, hr %#x.\n", hr); + ok(surface_desc.Type == D3DRTYPE_SURFACE, "Expected type D3DRTYPE_SURFACE, got %u.\n", + surface_desc.Type); + IDirect3DSurface8_Release(surface); + + hr = IDirect3DDevice8_CreateTexture(device, 2, 8, 4, 0, D3DFMT_X8R8G8B8, + D3DPOOL_SYSTEMMEM, &texture); + ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr); + type = IDirect3DTexture8_GetType(texture); + ok(type == D3DRTYPE_TEXTURE, "Expected type D3DRTYPE_TEXTURE, got %u.\n", type); + + hr = IDirect3DTexture8_GetSurfaceLevel(texture, 0, &surface); + ok(SUCCEEDED(hr), "Failed to get surface level, hr %#x.\n", hr); + hr = IDirect3DSurface8_GetDesc(surface, &surface_desc); + ok(SUCCEEDED(hr), "Failed to get surface description, hr %#x.\n", hr); + ok(surface_desc.Type == D3DRTYPE_SURFACE, "Expected type D3DRTYPE_SURFACE, got %u.\n", + surface_desc.Type); + ok(surface_desc.Width == 2, "Expected width 2, got %u.\n", surface_desc.Width); + ok(surface_desc.Height == 8, "Expected height 8, got %u.\n", surface_desc.Height); + hr = IDirect3DTexture8_GetLevelDesc(texture, 0, &surface_desc); + ok(SUCCEEDED(hr), "Failed to get level description, hr %#x.\n", hr); + ok(surface_desc.Type == D3DRTYPE_SURFACE, "Expected type D3DRTYPE_SURFACE, got %u.\n", + surface_desc.Type); + ok(surface_desc.Width == 2, "Expected width 2, got %u.\n", surface_desc.Width); + ok(surface_desc.Height == 8, "Expected height 8, got %u.\n", surface_desc.Height); + IDirect3DSurface8_Release(surface); + + hr = IDirect3DTexture8_GetSurfaceLevel(texture, 2, &surface); + ok(SUCCEEDED(hr), "Failed to get surface level, hr %#x.\n", hr); + hr = IDirect3DSurface8_GetDesc(surface, &surface_desc); + ok(SUCCEEDED(hr), "Failed to get surface description, hr %#x.\n", hr); + ok(surface_desc.Type == D3DRTYPE_SURFACE, "Expected type D3DRTYPE_SURFACE, got %u.\n", + surface_desc.Type); + ok(surface_desc.Width == 1, "Expected width 1, got %u.\n", surface_desc.Width); + ok(surface_desc.Height == 2, "Expected height 2, got %u.\n", surface_desc.Height); + hr = IDirect3DTexture8_GetLevelDesc(texture, 2, &surface_desc); + ok(SUCCEEDED(hr), "Failed to get level description, hr %#x.\n", hr); + ok(surface_desc.Type == D3DRTYPE_SURFACE, "Expected type D3DRTYPE_SURFACE, got %u.\n", + surface_desc.Type); + ok(surface_desc.Width == 1, "Expected width 1, got %u.\n", surface_desc.Width); + ok(surface_desc.Height == 2, "Expected height 2, got %u.\n", surface_desc.Height); + IDirect3DSurface8_Release(surface); + IDirect3DTexture8_Release(texture); + + hr = IDirect3DDevice8_CreateCubeTexture(device, 1, 1, 0, D3DFMT_X8R8G8B8, + D3DPOOL_SYSTEMMEM, &cube_texture); + ok(SUCCEEDED(hr), "Failed to create cube texture, hr %#x.\n", hr); + type = IDirect3DCubeTexture8_GetType(cube_texture); + ok(type == D3DRTYPE_CUBETEXTURE, "Expected type D3DRTYPE_CUBETEXTURE, got %u.\n", type); + + hr = IDirect3DCubeTexture8_GetCubeMapSurface(cube_texture, + D3DCUBEMAP_FACE_NEGATIVE_X, 0, &surface); + ok(SUCCEEDED(hr), "Failed to get cube map surface, hr %#x.\n", hr); + hr = IDirect3DSurface8_GetDesc(surface, &surface_desc); + ok(SUCCEEDED(hr), "Failed to get surface description, hr %#x.\n", hr); + ok(surface_desc.Type == D3DRTYPE_SURFACE, "Expected type D3DRTYPE_SURFACE, got %u.\n", + surface_desc.Type); + hr = IDirect3DCubeTexture8_GetLevelDesc(cube_texture, 0, &surface_desc); + ok(SUCCEEDED(hr), "Failed to get level description, hr %#x.\n", hr); + ok(surface_desc.Type == D3DRTYPE_SURFACE, "Expected type D3DRTYPE_SURFACE, got %u.\n", + surface_desc.Type); + IDirect3DSurface8_Release(surface); + IDirect3DCubeTexture8_Release(cube_texture); + + hr = IDirect3DDevice8_CreateVolumeTexture(device, 2, 4, 8, 4, 0, D3DFMT_X8R8G8B8, + D3DPOOL_SYSTEMMEM, &volume_texture); + type = IDirect3DVolumeTexture8_GetType(volume_texture); + ok(type == D3DRTYPE_VOLUMETEXTURE, "Expected type D3DRTYPE_VOLUMETEXTURE, got %u.\n", type); + + hr = IDirect3DVolumeTexture8_GetVolumeLevel(volume_texture, 0, &volume); + ok(SUCCEEDED(hr), "Failed to get volume level, hr %#x.\n", hr); + /* IDirect3DVolume8 is not an IDirect3DResource8 and has no GetType method. */ + hr = IDirect3DVolume8_GetDesc(volume, &volume_desc); + ok(SUCCEEDED(hr), "Failed to get volume description, hr %#x.\n", hr); + ok(volume_desc.Type == D3DRTYPE_VOLUME, "Expected type D3DRTYPE_VOLUME, got %u.\n", + volume_desc.Type); + ok(volume_desc.Width == 2, "Expected width 2, got %u.\n", volume_desc.Width); + ok(volume_desc.Height == 4, "Expected height 4, got %u.\n", volume_desc.Height); + ok(volume_desc.Depth == 8, "Expected depth 8, got %u.\n", volume_desc.Depth); + hr = IDirect3DVolumeTexture8_GetLevelDesc(volume_texture, 0, &volume_desc); + ok(SUCCEEDED(hr), "Failed to get level description, hr %#x.\n", hr); + ok(volume_desc.Type == D3DRTYPE_VOLUME, "Expected type D3DRTYPE_VOLUME, got %u.\n", + volume_desc.Type); + ok(volume_desc.Width == 2, "Expected width 2, got %u.\n", volume_desc.Width); + ok(volume_desc.Height == 4, "Expected height 4, got %u.\n", volume_desc.Height); + ok(volume_desc.Depth == 8, "Expected depth 8, got %u.\n", volume_desc.Depth); + IDirect3DVolume8_Release(volume); + + hr = IDirect3DVolumeTexture8_GetVolumeLevel(volume_texture, 2, &volume); + ok(SUCCEEDED(hr), "Failed to get volume level, hr %#x.\n", hr); + hr = IDirect3DVolume8_GetDesc(volume, &volume_desc); + ok(SUCCEEDED(hr), "Failed to get volume description, hr %#x.\n", hr); + ok(volume_desc.Type == D3DRTYPE_VOLUME, "Expected type D3DRTYPE_VOLUME, got %u.\n", + volume_desc.Type); + ok(volume_desc.Width == 1, "Expected width 1, got %u.\n", volume_desc.Width); + ok(volume_desc.Height == 1, "Expected height 1, got %u.\n", volume_desc.Height); + ok(volume_desc.Depth == 2, "Expected depth 2, got %u.\n", volume_desc.Depth); + hr = IDirect3DVolumeTexture8_GetLevelDesc(volume_texture, 2, &volume_desc); + ok(SUCCEEDED(hr), "Failed to get level description, hr %#x.\n", hr); + ok(volume_desc.Type == D3DRTYPE_VOLUME, "Expected type D3DRTYPE_VOLUME, got %u.\n", + volume_desc.Type); + ok(volume_desc.Width == 1, "Expected width 1, got %u.\n", volume_desc.Width); + ok(volume_desc.Height == 1, "Expected height 1, got %u.\n", volume_desc.Height); + ok(volume_desc.Depth == 2, "Expected depth 2, got %u.\n", volume_desc.Depth); + IDirect3DVolume8_Release(volume); + IDirect3DVolumeTexture8_Release(volume_texture); + + refcount = IDirect3DDevice8_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + IDirect3D8_Release(d3d); + DestroyWindow(window); +} + +static void test_mipmap_lock(void) +{ + IDirect3DDevice8 *device; + IDirect3DSurface8 *surface, *surface2, *surface_dst, *surface_dst2; + IDirect3DTexture8 *texture, *texture_dst; + IDirect3D8 *d3d; + ULONG refcount; + HWND window; + HRESULT hr; + D3DLOCKED_RECT locked_rect; + + window = CreateWindowA("static", "d3d8_test", WS_OVERLAPPEDWINDOW, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + d3d = Direct3DCreate8(D3D_SDK_VERSION); + ok(!!d3d, "Failed to create a D3D object.\n"); + if (!(device = create_device(d3d, window, window, TRUE))) + { + skip("Failed to create a D3D device, skipping tests.\n"); + IDirect3D8_Release(d3d); + DestroyWindow(window); + return; + } + + hr = IDirect3DDevice8_CreateTexture(device, 4, 4, 2, 0, D3DFMT_X8R8G8B8, + D3DPOOL_DEFAULT, &texture_dst); + ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr); + hr = IDirect3DTexture8_GetSurfaceLevel(texture_dst, 0, &surface_dst); + ok(SUCCEEDED(hr), "Failed to get surface level, hr %#x.\n", hr); + hr = IDirect3DTexture8_GetSurfaceLevel(texture_dst, 1, &surface_dst2); + ok(SUCCEEDED(hr), "Failed to get surface level, hr %#x.\n", hr); + + hr = IDirect3DDevice8_CreateTexture(device, 4, 4, 2, 0, D3DFMT_X8R8G8B8, + D3DPOOL_SYSTEMMEM, &texture); + ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr); + hr = IDirect3DTexture8_GetSurfaceLevel(texture, 0, &surface); + ok(SUCCEEDED(hr), "Failed to get surface level, hr %#x.\n", hr); + hr = IDirect3DTexture8_GetSurfaceLevel(texture, 1, &surface2); + ok(SUCCEEDED(hr), "Failed to get surface level, hr %#x.\n", hr); + + hr = IDirect3DSurface8_LockRect(surface, &locked_rect, NULL, 0); + ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x.\n", hr); + hr = IDirect3DSurface8_LockRect(surface2, &locked_rect, NULL, 0); + ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x.\n", hr); + hr = IDirect3DSurface8_UnlockRect(surface); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr); + + hr = IDirect3DDevice8_CopyRects(device, surface, NULL, 0, surface_dst, NULL); + ok(SUCCEEDED(hr), "Failed to update surface, hr %#x.\n", hr); + hr = IDirect3DDevice8_CopyRects(device, surface2, NULL, 0, surface_dst2, NULL); + todo_wine ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + + /* Apparently there's no validation on the container. */ + hr = IDirect3DDevice8_UpdateTexture(device, (IDirect3DBaseTexture8 *)texture, + (IDirect3DBaseTexture8 *)texture_dst); + ok(SUCCEEDED(hr), "Failed to update texture, hr %#x.\n", hr); + + hr = IDirect3DSurface8_UnlockRect(surface2); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr); + + IDirect3DSurface8_Release(surface_dst2); + IDirect3DSurface8_Release(surface_dst); + IDirect3DSurface8_Release(surface2); + IDirect3DSurface8_Release(surface); + IDirect3DTexture8_Release(texture_dst); + IDirect3DTexture8_Release(texture); + + refcount = IDirect3DDevice8_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + IDirect3D8_Release(d3d); + DestroyWindow(window); +} START_TEST(device) { HMODULE d3d8_handle = LoadLibraryA( "d3d8.dll" ); @@ -5773,6 +6248,10 @@ test_volume_blocks(); test_lockbox_invalid(); test_pixel_format(); + test_begin_end_state_block(); + test_shader_constant_apply(); + test_resource_type(); + test_mipmap_lock(); UnregisterClassA("d3d8_test_wc", GetModuleHandleA(NULL)); } diff -Nru wine1.7-1.7.14/dlls/d3d8/tests/stateblock.c wine1.7-1.7.18/dlls/d3d8/tests/stateblock.c --- wine1.7-1.7.14/dlls/d3d8/tests/stateblock.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/d3d8/tests/stateblock.c 2014-05-02 18:15:48.000000000 +0000 @@ -23,76 +23,6 @@ static DWORD texture_stages; -static HWND create_window(void) -{ - WNDCLASSA wc = {0}; - wc.lpfnWndProc = DefWindowProcA; - wc.lpszClassName = "d3d8_test_wc"; - RegisterClassA(&wc); - - return CreateWindowA("d3d8_test_wc", "d3d8_test", 0, 0, 0, 0, 0, 0, 0, 0, 0); -} - -static IDirect3DDevice8 *create_device(D3DPRESENT_PARAMETERS *present_parameters) -{ - IDirect3DDevice8 *device; - D3DDISPLAYMODE d3ddm; - IDirect3D8 *d3d8; - HWND window; - - if (!(d3d8 = Direct3DCreate8(D3D_SDK_VERSION))) - { - skip("Failed to create D3D8 object.\n"); - return NULL; - } - - window = create_window(); - - IDirect3D8_GetAdapterDisplayMode(d3d8, D3DADAPTER_DEFAULT, &d3ddm); - memset(present_parameters, 0, sizeof(*present_parameters)); - present_parameters->Windowed = TRUE; - present_parameters->SwapEffect = D3DSWAPEFFECT_DISCARD; - present_parameters->BackBufferFormat = d3ddm.Format; - - if (SUCCEEDED(IDirect3D8_CreateDevice(d3d8, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, window, - D3DCREATE_SOFTWARE_VERTEXPROCESSING, present_parameters, &device))) - return device; - - return NULL; -} - -static void test_begin_end_state_block(IDirect3DDevice8 *device) -{ - DWORD state_block; - HRESULT hr; - - /* Should succeed */ - hr = IDirect3DDevice8_BeginStateBlock(device); - ok(SUCCEEDED(hr), "BeginStateBlock failed, hr %#x.\n", hr); - if (FAILED(hr)) return; - - /* Calling BeginStateBlock while recording should return D3DERR_INVALIDCALL */ - hr = IDirect3DDevice8_BeginStateBlock(device); - ok(hr == D3DERR_INVALIDCALL, "BeginStateBlock returned %#x, expected %#x.\n", hr, D3DERR_INVALIDCALL); - if (hr != D3DERR_INVALIDCALL) return; - - /* Should succeed */ - state_block = 0xdeadbeef; - hr = IDirect3DDevice8_EndStateBlock(device, &state_block); - ok(SUCCEEDED(hr) && state_block && state_block != 0xdeadbeef, - "EndStateBlock returned: hr %#x, state_block %#x. " - "Expected hr %#x, state_block != 0, state_block != 0xdeadbeef.\n", hr, state_block, D3D_OK); - IDirect3DDevice8_DeleteStateBlock(device, state_block); - - /* Calling EndStateBlock while not recording should return D3DERR_INVALIDCALL. - * state_block should not be touched. */ - state_block = 0xdeadbeef; - hr = IDirect3DDevice8_EndStateBlock(device, &state_block); - ok(hr == D3DERR_INVALIDCALL && state_block == 0xdeadbeef, - "EndStateBlock returned: hr %#x, state_block %#x. " - "Expected hr %#x, state_block 0xdeadbeef.\n", hr, state_block, D3DERR_INVALIDCALL); -} - /* ============================ State Testing Framework ========================== */ struct state_test @@ -1842,9 +1772,19 @@ /* =================== Main state tests function =============================== */ -static void test_state_management(IDirect3DDevice8 *device, D3DPRESENT_PARAMETERS *device_pparams) +static void test_state_management(void) { + struct shader_constant_arg pshader_constant_arg; + struct shader_constant_arg vshader_constant_arg; + struct resource_test_arg resource_test_arg; + struct render_state_arg render_state_arg; + D3DPRESENT_PARAMETERS present_parameters; + struct light_arg light_arg; + IDirect3DDevice8 *device; + IDirect3D8 *d3d; + ULONG refcount; D3DCAPS8 caps; + HWND window; HRESULT hr; /* Test count: 2 for shader constants @@ -1856,15 +1796,30 @@ struct state_test tests[6]; unsigned int tcount = 0; - struct shader_constant_arg pshader_constant_arg; - struct shader_constant_arg vshader_constant_arg; - struct resource_test_arg resource_test_arg; - struct render_state_arg render_state_arg; - struct light_arg light_arg; + window = CreateWindowA("static", "d3d8_test", WS_OVERLAPPEDWINDOW, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + if (!(d3d = Direct3DCreate8(D3D_SDK_VERSION))) + { + skip("Failed to create a D3D object, skipping tests.\n"); + DestroyWindow(window); + return; + } + memset(&present_parameters, 0, sizeof(present_parameters)); + present_parameters.Windowed = TRUE; + present_parameters.hDeviceWindow = window; + present_parameters.SwapEffect = D3DSWAPEFFECT_DISCARD; + present_parameters.BackBufferFormat = D3DFMT_A8R8G8B8; + if (FAILED(IDirect3D8_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, window, + D3DCREATE_SOFTWARE_VERTEXPROCESSING, &present_parameters, &device))) + { + skip("Failed to create a 3D device, skipping test.\n"); + IDirect3D8_Release(d3d); + DestroyWindow(window); + return; + } hr = IDirect3DDevice8_GetDeviceCaps(device, &caps); - ok(SUCCEEDED(hr), "GetDeviceCaps returned %#x.\n", hr); - if (FAILED(hr)) return; + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); texture_stages = caps.MaxTextureBlendStages; @@ -1890,7 +1845,7 @@ transform_queue_test(&tests[tcount++]); - render_state_arg.device_pparams = device_pparams; + render_state_arg.device_pparams = &present_parameters; render_state_arg.pointsize_max = caps.MaxPointSize; render_states_queue_test(&tests[tcount++], &render_state_arg); @@ -1901,161 +1856,14 @@ resource_test_queue(&tests[tcount++], &resource_test_arg); execute_test_chain_all(device, tests, tcount); -} - -static void test_shader_constant_apply(IDirect3DDevice8 *device) -{ - static const float initial[] = {0.0f, 0.0f, 0.0f, 0.0f}; - static const float vs_const[] = {1.0f, 2.0f, 3.0f, 4.0f}; - static const float ps_const[] = {5.0f, 6.0f, 7.0f, 8.0f}; - DWORD vs_version, ps_version; - DWORD stateblock; - D3DCAPS8 caps; - float ret[4]; - HRESULT hr; - - hr = IDirect3DDevice8_GetDeviceCaps(device, &caps); - ok(SUCCEEDED(hr), "GetDeviceCaps returned %#x.\n", hr); - vs_version = caps.VertexShaderVersion & 0xffff; - ps_version = caps.PixelShaderVersion & 0xffff; - - if (vs_version) - { - hr = IDirect3DDevice8_SetVertexShaderConstant(device, 0, initial, 1); - ok(SUCCEEDED(hr), "SetVertexShaderConstant returned %#x.\n", hr); - hr = IDirect3DDevice8_SetVertexShaderConstant(device, 1, initial, 1); - ok(SUCCEEDED(hr), "SetVertexShaderConstant returned %#x.\n", hr); - - hr = IDirect3DDevice8_GetVertexShaderConstant(device, 0, ret, 1); - ok(SUCCEEDED(hr), "GetVertexShaderConstant returned %#x.\n", hr); - ok(!memcmp(ret, initial, sizeof(initial)), - "GetVertexShaderConstant got {%f, %f, %f, %f}, expected {%f, %f, %f, %f}\n", - ret[0], ret[1], ret[2], ret[3], initial[0], initial[1], initial[2], initial[3]); - hr = IDirect3DDevice8_GetVertexShaderConstant(device, 1, ret, 1); - ok(SUCCEEDED(hr), "GetVertexShaderConstant returned %#x\n", hr); - ok(!memcmp(ret, initial, sizeof(initial)), - "GetVertexShaderConstant got {%f, %f, %f, %f}, expected {%f, %f, %f, %f}\n", - ret[0], ret[1], ret[2], ret[3], initial[0], initial[1], initial[2], initial[3]); - - hr = IDirect3DDevice8_SetVertexShaderConstant(device, 0, vs_const, 1); - ok(SUCCEEDED(hr), "SetVertexShaderConstant returned %#x.\n", hr); - } - if (ps_version) - { - hr = IDirect3DDevice8_SetPixelShaderConstant(device, 0, initial, 1); - ok(SUCCEEDED(hr), "SetPixelShaderConstant returned %#x.\n", hr); - hr = IDirect3DDevice8_SetPixelShaderConstant(device, 1, initial, 1); - ok(SUCCEEDED(hr), "SetPixelShaderConstant returned %#x.\n", hr); - - hr = IDirect3DDevice8_GetPixelShaderConstant(device, 0, ret, 1); - ok(SUCCEEDED(hr), "GetPixelShaderConstant returned %#x.\n", hr); - ok(!memcmp(ret, initial, sizeof(initial)), - "GetpixelShaderConstant got {%f, %f, %f, %f}, expected {%f, %f, %f, %f}\n", - ret[0], ret[1], ret[2], ret[3], initial[0], initial[1], initial[2], initial[3]); - hr = IDirect3DDevice8_GetPixelShaderConstant(device, 1, ret, 1); - ok(SUCCEEDED(hr), "GetPixelShaderConstant returned %#x.\n", hr); - ok(!memcmp(ret, initial, sizeof(initial)), - "GetPixelShaderConstant got {%f, %f, %f, %f}, expected {%f, %f, %f, %f}\n", - ret[0], ret[1], ret[2], ret[3], initial[0], initial[1], initial[2], initial[3]); - - hr = IDirect3DDevice8_SetPixelShaderConstant(device, 0, ps_const, 1); - ok(SUCCEEDED(hr), "SetPixelShaderConstant returned %#x.\n", hr); - } - - hr = IDirect3DDevice8_BeginStateBlock(device); - ok(SUCCEEDED(hr), "BeginStateBlock returned %#x\n", hr); - if (vs_version) - { - hr = IDirect3DDevice8_SetVertexShaderConstant(device, 1, vs_const, 1); - ok(SUCCEEDED(hr), "SetVertexShaderConstant returned %#x.\n", hr); - } - if (ps_version) - { - hr = IDirect3DDevice8_SetPixelShaderConstant(device, 1, ps_const, 1); - ok(SUCCEEDED(hr), "SetPixelShaderConstant returned %#x.\n", hr); - } - - hr = IDirect3DDevice8_EndStateBlock(device, &stateblock); - ok(SUCCEEDED(hr), "EndStateBlock returned %#x\n", hr); - - if (vs_version) - { - hr = IDirect3DDevice8_GetVertexShaderConstant(device, 0, ret, 1); - ok(SUCCEEDED(hr), "GetVertexShaderConstant returned %#x.\n", hr); - ok(!memcmp(ret, vs_const, sizeof(vs_const)), - "GetVertexShaderConstant got {%f, %f, %f, %f}, expected {%f, %f, %f, %f}\n", - ret[0], ret[1], ret[2], ret[3], vs_const[0], vs_const[1], vs_const[2], vs_const[3]); - hr = IDirect3DDevice8_GetVertexShaderConstant(device, 1, ret, 1); - ok(SUCCEEDED(hr), "GetVertexShaderConstant returned %#x.\n", hr); - ok(!memcmp(ret, initial, sizeof(initial)), - "GetVertexShaderConstant got {%f, %f, %f, %f}, expected {%f, %f, %f, %f}\n", - ret[0], ret[1], ret[2], ret[3], initial[0], initial[1], initial[2], initial[3]); - } - if (ps_version) - { - hr = IDirect3DDevice8_GetPixelShaderConstant(device, 0, ret, 1); - ok(SUCCEEDED(hr), "GetPixelShaderConstant returned %#x.\n", hr); - ok(!memcmp(ret, ps_const, sizeof(ps_const)), - "GetPixelShaderConstant got {%f, %f, %f, %f}, expected {%f, %f, %f, %f}\n", - ret[0], ret[1], ret[2], ret[3], ps_const[0], ps_const[1], ps_const[2], ps_const[3]); - hr = IDirect3DDevice8_GetPixelShaderConstant(device, 1, ret, 1); - ok(SUCCEEDED(hr), "GetPixelShaderConstant returned %#x.\n", hr); - ok(!memcmp(ret, initial, sizeof(initial)), - "GetPixelShaderConstant got {%f, %f, %f, %f}, expected {%f, %f, %f, %f}\n", - ret[0], ret[1], ret[2], ret[3], initial[0], initial[1], initial[2], initial[3]); - } - - /* Apply doesn't overwrite constants that aren't explicitly set on the source stateblock. */ - hr = IDirect3DDevice8_ApplyStateBlock(device, stateblock); - ok(SUCCEEDED(hr), "Apply returned %#x\n", hr); - - if (vs_version) - { - hr = IDirect3DDevice8_GetVertexShaderConstant(device, 0, ret, 1); - ok(SUCCEEDED(hr), "GetVertexShaderConstant returned %#x.\n", hr); - ok(!memcmp(ret, vs_const, sizeof(vs_const)), - "GetVertexShaderConstant got {%f, %f, %f, %f}, expected {%f, %f, %f, %f}\n", - ret[0], ret[1], ret[2], ret[3], vs_const[0], vs_const[1], vs_const[2], vs_const[3]); - hr = IDirect3DDevice8_GetVertexShaderConstant(device, 1, ret, 1); - ok(SUCCEEDED(hr), "GetVertexShaderConstant returned %#x.\n", hr); - ok(!memcmp(ret, vs_const, sizeof(vs_const)), - "GetVertexShaderConstant got {%f, %f, %f, %f}, expected {%f, %f, %f, %f}\n", - ret[0], ret[1], ret[2], ret[3], vs_const[0], vs_const[1], vs_const[2], vs_const[3]); - } - if (ps_version) - { - hr = IDirect3DDevice8_GetPixelShaderConstant(device, 0, ret, 1); - ok(SUCCEEDED(hr), "GetPixelShaderConstant returned %#x.\n", hr); - ok(!memcmp(ret, ps_const, sizeof(ps_const)), - "GetPixelShaderConstant got {%f, %f, %f, %f}, expected {%f, %f, %f, %f}\n", - ret[0], ret[1], ret[2], ret[3], ps_const[0], ps_const[1], ps_const[2], ps_const[3]); - hr = IDirect3DDevice8_GetPixelShaderConstant(device, 1, ret, 1); - ok(SUCCEEDED(hr), "GetPixelShaderConstant returned %#x.\n", hr); - ok(!memcmp(ret, ps_const, sizeof(ps_const)), - "GetPixelShaderConstant got {%f, %f, %f, %f}, expected {%f, %f, %f, %f}\n", - ret[0], ret[1], ret[2], ret[3], ps_const[0], ps_const[1], ps_const[2], ps_const[3]); - } - - IDirect3DDevice8_DeleteStateBlock(device, stateblock); + refcount = IDirect3DDevice8_Release(device); + ok(!refcount, "Device has %u references left\n", refcount); + IDirect3D8_Release(d3d); + DestroyWindow(window); } START_TEST(stateblock) { - D3DPRESENT_PARAMETERS device_pparams; - IDirect3DDevice8 *device; - ULONG refcount; - - if (!(device = create_device(&device_pparams))) - { - skip("Failed to create a 3D device, skipping test.\n"); - return; - } - - test_begin_end_state_block(device); - test_state_management(device, &device_pparams); - test_shader_constant_apply(device); - - refcount = IDirect3DDevice8_Release(device); - ok(!refcount, "Device has %u references left\n", refcount); + test_state_management(); } diff -Nru wine1.7-1.7.14/dlls/d3d8/tests/visual.c wine1.7-1.7.18/dlls/d3d8/tests/visual.c --- wine1.7-1.7.14/dlls/d3d8/tests/visual.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/d3d8/tests/visual.c 2014-05-02 18:15:48.000000000 +0000 @@ -38,20 +38,6 @@ float x, y, z, w; }; -static HWND create_window(void) -{ - WNDCLASSA wc = {0}; - HWND ret; - wc.lpfnWndProc = DefWindowProcA; - wc.lpszClassName = "d3d8_test_wc"; - RegisterClassA(&wc); - - ret = CreateWindowA("d3d8_test_wc", "d3d8_test", WS_POPUP | WS_SYSMENU, - 20, 20, 640, 480, 0, 0, 0, 0); - ShowWindow(ret, SW_SHOW); - return ret; -} - static BOOL color_match(D3DCOLOR c1, D3DCOLOR c2, BYTE max_diff) { if (abs((c1 & 0xff) - (c2 & 0xff)) > max_diff) return FALSE; @@ -126,22 +112,13 @@ return ret; } -static IDirect3DDevice8 *init_d3d8(void) +static IDirect3DDevice8 *create_device(IDirect3D8 *d3d, HWND device_window, HWND focus_window, BOOL windowed) { - D3DPRESENT_PARAMETERS present_parameters; - IDirect3DDevice8 *device = NULL; - IDirect3D8 *d3d8; - HRESULT hr; - - if (!(d3d8 = Direct3DCreate8(D3D_SDK_VERSION))) - { - skip("could not create D3D8\n"); - return NULL; - } + D3DPRESENT_PARAMETERS present_parameters = {0}; + IDirect3DDevice8 *device; - ZeroMemory(&present_parameters, sizeof(present_parameters)); - present_parameters.Windowed = TRUE; - present_parameters.hDeviceWindow = create_window(); + present_parameters.Windowed = windowed; + present_parameters.hDeviceWindow = device_window; present_parameters.SwapEffect = D3DSWAPEFFECT_DISCARD; present_parameters.BackBufferWidth = 640; present_parameters.BackBufferHeight = 480; @@ -149,12 +126,11 @@ present_parameters.EnableAutoDepthStencil = TRUE; present_parameters.AutoDepthStencilFormat = D3DFMT_D24S8; - hr = IDirect3D8_CreateDevice(d3d8, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, - present_parameters.hDeviceWindow, D3DCREATE_HARDWARE_VERTEXPROCESSING, &present_parameters, &device); - ok(hr == D3D_OK || hr == D3DERR_INVALIDCALL || broken(hr == D3DERR_NOTAVAILABLE), - "IDirect3D_CreateDevice returned: %#08x\n", hr); + if (SUCCEEDED(IDirect3D8_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, focus_window, + D3DCREATE_HARDWARE_VERTEXPROCESSING, &present_parameters, &device))) + return device; - return device; + return NULL; } struct vertex @@ -176,57 +152,115 @@ DWORD diffuse; }; -static void lighting_test(IDirect3DDevice8 *device) +static void test_sanity(void) { + IDirect3DDevice8 *device; + IDirect3D8 *d3d; + D3DCOLOR color; + ULONG refcount; + HWND window; HRESULT hr; - DWORD fvf = D3DFVF_XYZ | D3DFVF_DIFFUSE; - DWORD nfvf = D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_NORMAL; - DWORD color; - float mat[16] = { 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 }; + 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"); + goto done; + } + + hr = IDirect3DDevice8_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffff0000, 1.0f, 0); + ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + color = getPixelColor(device, 1, 1); + ok(color == 0x00ff0000, "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); + + hr = IDirect3DDevice8_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff00ddee, 1.0f, 0); + ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + color = getPixelColor(device, 639, 479); + ok(color == 0x0000ddee, "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); + + refcount = IDirect3DDevice8_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D8_Release(d3d); + DestroyWindow(window); +} + +static void lighting_test(void) +{ + DWORD nfvf = D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_NORMAL; + DWORD fvf = D3DFVF_XYZ | D3DFVF_DIFFUSE; + IDirect3DDevice8 *device; + IDirect3D8 *d3d; + D3DCOLOR color; + ULONG refcount; + HWND window; + HRESULT hr; - struct vertex unlitquad[] = + static const struct vertex unlitquad[] = { - {-1.0f, -1.0f, 0.1f, 0xffff0000}, - {-1.0f, 0.0f, 0.1f, 0xffff0000}, - { 0.0f, 0.0f, 0.1f, 0xffff0000}, - { 0.0f, -1.0f, 0.1f, 0xffff0000}, + {-1.0f, -1.0f, 0.1f, 0xffff0000}, + {-1.0f, 0.0f, 0.1f, 0xffff0000}, + { 0.0f, 0.0f, 0.1f, 0xffff0000}, + { 0.0f, -1.0f, 0.1f, 0xffff0000}, }; - struct vertex litquad[] = + static const struct vertex litquad[] = { - {-1.0f, 0.0f, 0.1f, 0xff00ff00}, - {-1.0f, 1.0f, 0.1f, 0xff00ff00}, - { 0.0f, 1.0f, 0.1f, 0xff00ff00}, - { 0.0f, 0.0f, 0.1f, 0xff00ff00}, + {-1.0f, 0.0f, 0.1f, 0xff00ff00}, + {-1.0f, 1.0f, 0.1f, 0xff00ff00}, + { 0.0f, 1.0f, 0.1f, 0xff00ff00}, + { 0.0f, 0.0f, 0.1f, 0xff00ff00}, }; - struct nvertex unlitnquad[] = + static const struct nvertex unlitnquad[] = { - { 0.0f, -1.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xff0000ff}, - { 0.0f, 0.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xff0000ff}, - { 1.0f, 0.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xff0000ff}, - { 1.0f, -1.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xff0000ff}, + { 0.0f, -1.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xff0000ff}, + { 0.0f, 0.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xff0000ff}, + { 1.0f, 0.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xff0000ff}, + { 1.0f, -1.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xff0000ff}, }; - struct nvertex litnquad[] = + static const struct nvertex litnquad[] = { - { 0.0f, 0.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xffffff00}, - { 0.0f, 1.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xffffff00}, - { 1.0f, 1.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xffffff00}, - { 1.0f, 0.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xffffff00}, + { 0.0f, 0.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xffffff00}, + { 0.0f, 1.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xffffff00}, + { 1.0f, 1.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xffffff00}, + { 1.0f, 0.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xffffff00}, }; - WORD Indices[] = {0, 1, 2, 2, 3, 0}; + static const WORD Indices[] = {0, 1, 2, 2, 3, 0}; + 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, + }}}; + + 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"); + goto done; + } hr = IDirect3DDevice8_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffffff, 0.0, 0); ok(hr == D3D_OK, "IDirect3DDevice8_Clear failed with %#08x\n", hr); /* Setup some states that may cause issues */ - hr = IDirect3DDevice8_SetTransform(device, D3DTS_WORLDMATRIX(0), (D3DMATRIX *) mat); + hr = IDirect3DDevice8_SetTransform(device, D3DTS_WORLDMATRIX(0), &mat); ok(hr == D3D_OK, "IDirect3DDevice8_SetTransform returned %#08x\n", hr); - hr = IDirect3DDevice8_SetTransform(device, D3DTS_VIEW, (D3DMATRIX *)mat); + hr = IDirect3DDevice8_SetTransform(device, D3DTS_VIEW, &mat); ok(hr == D3D_OK, "IDirect3DDevice8_SetTransform returned %#08x\n", hr); - hr = IDirect3DDevice8_SetTransform(device, D3DTS_PROJECTION, (D3DMATRIX *) mat); + hr = IDirect3DDevice8_SetTransform(device, D3DTS_PROJECTION, &mat); ok(hr == D3D_OK, "IDirect3DDevice8_SetTransform returned %#08x\n", hr); hr = IDirect3DDevice8_SetRenderState(device, D3DRS_CLIPPING, FALSE); ok(hr == D3D_OK, "IDirect3DDevice8_SetRenderState returned %#08x\n", hr); @@ -249,40 +283,38 @@ ok(hr == D3D_OK, "IDirect3DDevice8_SetVertexShader returned %#08x\n", hr); hr = IDirect3DDevice8_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice8_BeginScene failed with %#08x\n", hr); - if(hr == D3D_OK) - { - /* No lights are defined... That means, lit vertices should be entirely black */ - hr = IDirect3DDevice8_SetRenderState(device, D3DRS_LIGHTING, FALSE); - ok(hr == D3D_OK, "IDirect3DDevice8_SetRenderState returned %#08x\n", hr); - hr = IDirect3DDevice8_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */, - 2 /*PrimCount */, Indices, D3DFMT_INDEX16, unlitquad, sizeof(unlitquad[0])); - ok(hr == D3D_OK, "IDirect3DDevice8_DrawIndexedPrimitiveUP failed with %#08x\n", hr); - - hr = IDirect3DDevice8_SetRenderState(device, D3DRS_LIGHTING, TRUE); - ok(hr == D3D_OK, "IDirect3DDevice8_SetRenderState returned %#08x\n", hr); - hr = IDirect3DDevice8_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */, - 2 /*PrimCount */, Indices, D3DFMT_INDEX16, litquad, sizeof(litquad[0])); - ok(hr == D3D_OK, "IDirect3DDevice8_DrawIndexedPrimitiveUP failed with %#08x\n", hr); - - hr = IDirect3DDevice8_SetVertexShader(device, nfvf); - ok(hr == D3D_OK, "IDirect3DDevice8_SetVertexShader failed with %#08x\n", hr); - - hr = IDirect3DDevice8_SetRenderState(device, D3DRS_LIGHTING, FALSE); - ok(hr == D3D_OK, "IDirect3DDevice8_SetRenderState returned %#08x\n", hr); - hr = IDirect3DDevice8_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */, - 2 /*PrimCount */, Indices, D3DFMT_INDEX16, unlitnquad, sizeof(unlitnquad[0])); - ok(hr == D3D_OK, "IDirect3DDevice8_DrawIndexedPrimitiveUP failed with %#08x\n", hr); - - hr = IDirect3DDevice8_SetRenderState(device, D3DRS_LIGHTING, TRUE); - ok(hr == D3D_OK, "IDirect3DDevice8_SetRenderState returned %#08x\n", hr); - hr = IDirect3DDevice8_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */, - 2 /*PrimCount */, Indices, D3DFMT_INDEX16, litnquad, sizeof(litnquad[0])); - ok(hr == D3D_OK, "IDirect3DDevice8_DrawIndexedPrimitiveUP failed with %#08x\n", hr); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); - hr = IDirect3DDevice8_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice8_EndScene failed with %#08x\n", hr); - } + /* No lights are defined... That means, lit vertices should be entirely black. */ + hr = IDirect3DDevice8_SetRenderState(device, D3DRS_LIGHTING, FALSE); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + hr = IDirect3DDevice8_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */, + 2 /* PrimCount */, Indices, D3DFMT_INDEX16, unlitquad, sizeof(unlitquad[0])); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + + hr = IDirect3DDevice8_SetRenderState(device, D3DRS_LIGHTING, TRUE); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + hr = IDirect3DDevice8_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */, + 2 /* PrimCount */, Indices, D3DFMT_INDEX16, litquad, sizeof(litquad[0])); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + + hr = IDirect3DDevice8_SetVertexShader(device, nfvf); + ok(SUCCEEDED(hr), "Failed to set vertex shader, hr %#x.\n", hr); + + hr = IDirect3DDevice8_SetRenderState(device, D3DRS_LIGHTING, FALSE); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + hr = IDirect3DDevice8_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */, + 2 /* PrimCount */, Indices, D3DFMT_INDEX16, unlitnquad, sizeof(unlitnquad[0])); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + + hr = IDirect3DDevice8_SetRenderState(device, D3DRS_LIGHTING, TRUE); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + hr = IDirect3DDevice8_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */, + 2 /* PrimCount */, Indices, D3DFMT_INDEX16, litnquad, sizeof(litnquad[0])); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + + hr = IDirect3DDevice8_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); color = getPixelColor(device, 160, 360); /* Lower left quad - unlit without normals */ ok(color == 0x00ff0000, "Unlit quad without normals has color 0x%08x, expected 0x00ff0000.\n", color); @@ -295,17 +327,33 @@ IDirect3DDevice8_Present(device, NULL, NULL, NULL, NULL); - hr = IDirect3DDevice8_SetRenderState(device, D3DRS_LIGHTING, FALSE); - ok(hr == D3D_OK, "IDirect3DDevice8_SetRenderState returned %#08x\n", hr); + refcount = IDirect3DDevice8_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D8_Release(d3d); + DestroyWindow(window); } -static void clear_test(IDirect3DDevice8 *device) +static void clear_test(void) { /* Tests the correctness of clearing parameters */ + D3DRECT rect_negneg, rect[2]; + IDirect3DDevice8 *device; + IDirect3D8 *d3d; + D3DCOLOR color; + ULONG refcount; + HWND window; HRESULT hr; - D3DRECT rect[2]; - D3DRECT rect_negneg; - DWORD color; + + 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"); + goto done; + } hr = IDirect3DDevice8_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffffff, 0.0, 0); ok(hr == D3D_OK, "IDirect3DDevice8_Clear failed with %#08x\n", hr); @@ -372,116 +420,145 @@ "Clear with count = 1, rect = NULL has color %#08x\n", color); IDirect3DDevice8_Present(device, NULL, NULL, NULL, NULL); -} - -struct sVertex { - float x, y, z; - DWORD diffuse; - DWORD specular; -}; -struct sVertexT { - float x, y, z, rhw; - DWORD diffuse; - DWORD specular; -}; + refcount = IDirect3DDevice8_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D8_Release(d3d); + DestroyWindow(window); +} -static void fog_test(IDirect3DDevice8 *device) +static void fog_test(void) { + float start = 0.0f, end = 1.0f; + IDirect3DDevice8 *device; + IDirect3D8 *d3d; + D3DCOLOR color; + ULONG refcount; + D3DCAPS8 caps; + HWND window; HRESULT hr; - DWORD color; - float start = 0.0, end = 1.0; - /* Gets full z based fog with linear fog, no fog with specular color */ - struct sVertex untransformed_1[] = { - {-1, -1, 0.1f, 0xFFFF0000, 0xFF000000 }, - {-1, 0, 0.1f, 0xFFFF0000, 0xFF000000 }, - { 0, 0, 0.1f, 0xFFFF0000, 0xFF000000 }, - { 0, -1, 0.1f, 0xFFFF0000, 0xFF000000 }, - }; - /* Ok, I am too lazy to deal with transform matrices */ - struct sVertex untransformed_2[] = { - {-1, 0, 1.0f, 0xFFFF0000, 0xFF000000 }, - {-1, 1, 1.0f, 0xFFFF0000, 0xFF000000 }, - { 0, 1, 1.0f, 0xFFFF0000, 0xFF000000 }, - { 0, 0, 1.0f, 0xFFFF0000, 0xFF000000 }, - }; - /* Untransformed ones. Give them a different diffuse color to make the test look - * nicer. It also makes making sure that they are drawn correctly easier. - */ - struct sVertexT transformed_1[] = { - {320, 0, 1.0f, 1.0f, 0xFFFFFF00, 0xFF000000 }, - {640, 0, 1.0f, 1.0f, 0xFFFFFF00, 0xFF000000 }, - {640, 240, 1.0f, 1.0f, 0xFFFFFF00, 0xFF000000 }, - {320, 240, 1.0f, 1.0f, 0xFFFFFF00, 0xFF000000 }, - }; - struct sVertexT transformed_2[] = { - {320, 240, 1.0f, 1.0f, 0xFFFFFF00, 0xFF000000 }, - {640, 240, 1.0f, 1.0f, 0xFFFFFF00, 0xFF000000 }, - {640, 480, 1.0f, 1.0f, 0xFFFFFF00, 0xFF000000 }, - {320, 480, 1.0f, 1.0f, 0xFFFFFF00, 0xFF000000 }, + /* Gets full z based fog with linear fog, no fog with specular color. */ + static const struct + { + float x, y, z; + D3DCOLOR diffuse; + D3DCOLOR specular; + } + untransformed_1[] = + { + {-1.0f, -1.0f, 0.1f, 0xffff0000, 0xff000000}, + {-1.0f, 0.0f, 0.1f, 0xffff0000, 0xff000000}, + { 0.0f, 0.0f, 0.1f, 0xffff0000, 0xff000000}, + { 0.0f, -1.0f, 0.1f, 0xffff0000, 0xff000000}, + }, + /* Ok, I am too lazy to deal with transform matrices. */ + untransformed_2[] = + { + {-1.0f, 0.0f, 1.0f, 0xffff0000, 0xff000000}, + {-1.0f, 1.0f, 1.0f, 0xffff0000, 0xff000000}, + { 0.0f, 1.0f, 1.0f, 0xffff0000, 0xff000000}, + { 0.0f, 0.0f, 1.0f, 0xffff0000, 0xff000000}, + }, + far_quad1[] = + { + {-1.0f, -1.0f, 0.5f, 0xffff0000, 0xff000000}, + {-1.0f, 0.0f, 0.5f, 0xffff0000, 0xff000000}, + { 0.0f, 0.0f, 0.5f, 0xffff0000, 0xff000000}, + { 0.0f, -1.0f, 0.5f, 0xffff0000, 0xff000000}, + }, + far_quad2[] = + { + {-1.0f, 0.0f, 1.5f, 0xffff0000, 0xff000000}, + {-1.0f, 1.0f, 1.5f, 0xffff0000, 0xff000000}, + { 0.0f, 1.0f, 1.5f, 0xffff0000, 0xff000000}, + { 0.0f, 0.0f, 1.5f, 0xffff0000, 0xff000000}, }; - WORD Indices[] = {0, 1, 2, 2, 3, 0}; - D3DCAPS8 caps; - float ident_mat[16] = + /* Untransformed ones. Give them a different diffuse color to make the + * test look nicer. It also makes making sure that they are drawn + * correctly easier. */ + static const struct + { + float x, y, z, rhw; + D3DCOLOR diffuse; + D3DCOLOR specular; + } + transformed_1[] = + { + {320.0f, 0.0f, 1.0f, 1.0f, 0xffffff00, 0xff000000}, + {640.0f, 0.0f, 1.0f, 1.0f, 0xffffff00, 0xff000000}, + {640.0f, 240.0f, 1.0f, 1.0f, 0xffffff00, 0xff000000}, + {320.0f, 240.0f, 1.0f, 1.0f, 0xffffff00, 0xff000000}, + }, + transformed_2[] = { + {320.0f, 240.0f, 1.0f, 1.0f, 0xffffff00, 0xff000000}, + {640.0f, 240.0f, 1.0f, 1.0f, 0xffffff00, 0xff000000}, + {640.0f, 480.0f, 1.0f, 1.0f, 0xffffff00, 0xff000000}, + {320.0f, 480.0f, 1.0f, 1.0f, 0xffffff00, 0xff000000}, + }; + static const D3DMATRIX ident_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 - }; - float world_mat1[16] = - { + 0.0f, 0.0f, 0.0f, 1.0f, + }}}; + static const D3DMATRIX world_mat1 = + {{{ 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.5f, 1.0f - }; - float world_mat2[16] = - { + 0.0f, 0.0f, -0.5f, 1.0f, + }}}; + static const D3DMATRIX world_mat2 = + {{{ 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, 1.0f, 1.0f - }; - float proj_mat[16] = - { + 0.0f, 0.0f, 1.0f, 1.0f, + }}}; + static const D3DMATRIX proj_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, -1.0f, 1.0f - }; - - struct sVertex far_quad1[] = + 0.0f, 0.0f, -1.0f, 1.0f, + }}}; + static const WORD Indices[] = {0, 1, 2, 2, 3, 0}; + + 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))) { - {-1.0f, -1.0f, 0.5f, 0xffff0000, 0xff000000}, - {-1.0f, 0.0f, 0.5f, 0xffff0000, 0xff000000}, - { 0.0f, 0.0f, 0.5f, 0xffff0000, 0xff000000}, - { 0.0f, -1.0f, 0.5f, 0xffff0000, 0xff000000}, - }; - struct sVertex far_quad2[] = - { - {-1.0f, 0.0f, 1.5f, 0xffff0000, 0xff000000}, - {-1.0f, 1.0f, 1.5f, 0xffff0000, 0xff000000}, - { 0.0f, 1.0f, 1.5f, 0xffff0000, 0xff000000}, - { 0.0f, 0.0f, 1.5f, 0xffff0000, 0xff000000}, - }; + skip("Failed to create a D3D device, skipping tests.\n"); + goto done; + } memset(&caps, 0, sizeof(caps)); hr = IDirect3DDevice8_GetDeviceCaps(device, &caps); ok(hr == D3D_OK, "IDirect3DDevice8_GetDeviceCaps returned %08x\n", hr); - hr = IDirect3DDevice8_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffff00ff, 0.0, 0); ok(hr == D3D_OK, "IDirect3DDevice8_Clear returned %#08x\n", hr); /* Setup initial states: No lighting, fog on, fog color */ + hr = IDirect3DDevice8_SetRenderState(device, D3DRS_ZENABLE, FALSE); + ok(SUCCEEDED(hr), "Failed to disable D3DRS_ZENABLE, hr %#x.\n", hr); hr = IDirect3DDevice8_SetRenderState(device, D3DRS_LIGHTING, FALSE); ok(hr == D3D_OK, "Turning off lighting returned %#08x\n", hr); hr = IDirect3DDevice8_SetRenderState(device, D3DRS_FOGENABLE, TRUE); ok(hr == D3D_OK, "Turning on fog calculations returned %#08x\n", hr); hr = IDirect3DDevice8_SetRenderState(device, D3DRS_FOGCOLOR, 0xFF00FF00 /* A nice green */); ok(hr == D3D_OK, "Setting fog color returned %#08x\n", hr); + /* Some of the tests seem to depend on the projection matrix explicitly + * being set to an identity matrix, even though that's the default. + * (AMD Radeon HD 6310, Windows 7) */ + hr = IDirect3DDevice8_SetTransform(device, D3DTS_PROJECTION, &ident_mat); + ok(SUCCEEDED(hr), "Failed to set projection transform, hr %#x.\n", hr); /* First test: Both table fog and vertex fog off */ hr = IDirect3DDevice8_SetRenderState(device, D3DRS_FOGTABLEMODE, D3DFOG_NONE); @@ -495,53 +572,45 @@ hr = IDirect3DDevice8_SetRenderState(device, D3DRS_FOGEND, *((DWORD *) &end)); ok(hr == D3D_OK, "Setting fog start returned %#08x\n", hr); - if(IDirect3DDevice8_BeginScene(device) == D3D_OK) - { - hr = IDirect3DDevice8_SetVertexShader(device, D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_SPECULAR); - ok( hr == D3D_OK, "SetVertexShader returned %#08x\n", hr); - /* Untransformed, vertex fog = NONE, table fog = NONE: Read the fog weighting from the specular color */ - hr = IDirect3DDevice8_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */, - 2 /*PrimCount */, Indices, D3DFMT_INDEX16, untransformed_1, - sizeof(untransformed_1[0])); - ok(hr == D3D_OK, "DrawIndexedPrimitiveUP returned %#08x\n", hr); - - /* That makes it use the Z value */ - hr = IDirect3DDevice8_SetRenderState(device, D3DRS_FOGVERTEXMODE, D3DFOG_LINEAR); - ok(hr == D3D_OK, "Setting fog vertex mode to D3DFOG_LINEAR returned %#08x\n", hr); - /* Untransformed, vertex fog != none (or table fog != none): - * Use the Z value as input into the equation - */ - hr = IDirect3DDevice8_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */, - 2 /*PrimCount */, Indices, D3DFMT_INDEX16, untransformed_2, - sizeof(untransformed_2[0])); - ok(hr == D3D_OK, "DrawIndexedPrimitiveUP returned %#08x\n", hr); - - /* transformed verts */ - hr = IDirect3DDevice8_SetVertexShader(device, D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR); - ok( hr == D3D_OK, "SetVertexShader returned %#08x\n", hr); - /* Transformed, vertex fog != NONE, pixel fog == NONE: Use specular color alpha component */ - hr = IDirect3DDevice8_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */, - 2 /*PrimCount */, Indices, D3DFMT_INDEX16, transformed_1, - sizeof(transformed_1[0])); - ok(hr == D3D_OK, "DrawIndexedPrimitiveUP returned %#08x\n", hr); + hr = IDirect3DDevice8_BeginScene(device); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); - hr = IDirect3DDevice8_SetRenderState(device, D3DRS_FOGTABLEMODE, D3DFOG_LINEAR); - ok( hr == D3D_OK, "Setting fog table mode to D3DFOG_LINEAR returned %#08x\n", hr); - /* Transformed, table fog != none, vertex anything: Use Z value as input to the fog - * equation - */ - hr = IDirect3DDevice8_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */, - 2 /*PrimCount */, Indices, D3DFMT_INDEX16, transformed_2, - sizeof(transformed_2[0])); - ok(SUCCEEDED(hr), "IDirect3DDevice8_DrawIndexedPrimitiveUP returned %#x.\n", hr); + hr = IDirect3DDevice8_SetVertexShader(device, D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_SPECULAR); + ok(SUCCEEDED(hr), "Failed to set vertex shader, hr %#x.\n", hr); + /* Untransformed, vertex fog = NONE, table fog = NONE: + * Read the fog weighting from the specular color. */ + hr = IDirect3DDevice8_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */, + 2 /* PrimCount */, Indices, D3DFMT_INDEX16, untransformed_1, sizeof(untransformed_1[0])); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - hr = IDirect3DDevice8_EndScene(device); - ok(hr == D3D_OK, "EndScene returned %#08x\n", hr); - } - else - { - ok(FALSE, "BeginScene failed\n"); - } + /* This makes it use the Z value. */ + hr = IDirect3DDevice8_SetRenderState(device, D3DRS_FOGVERTEXMODE, D3DFOG_LINEAR); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + /* Untransformed, vertex fog != none (or table fog != none): + * Use the Z value as input into the equation. */ + hr = IDirect3DDevice8_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */, + 2 /* PrimCount */, Indices, D3DFMT_INDEX16, untransformed_2, sizeof(untransformed_2[0])); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + + /* Transformed vertices. */ + hr = IDirect3DDevice8_SetVertexShader(device, D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR); + ok(SUCCEEDED(hr), "Failed to set vertex shader, hr %#x.\n", hr); + /* Transformed, vertex fog != NONE, pixel fog == NONE: + * Use specular color alpha component. */ + hr = IDirect3DDevice8_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */, + 2 /* PrimCount */, Indices, D3DFMT_INDEX16, transformed_1, sizeof(transformed_1[0])); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + + hr = IDirect3DDevice8_SetRenderState(device, D3DRS_FOGTABLEMODE, D3DFOG_LINEAR); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + /* Transformed, table fog != none, vertex anything: + * Use Z value as input to the fog equation. */ + hr = IDirect3DDevice8_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */, + 2 /* PrimCount */, Indices, D3DFMT_INDEX16, transformed_2, sizeof(transformed_2[0])); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + + hr = IDirect3DDevice8_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); color = getPixelColor(device, 160, 360); ok(color_match(color, D3DCOLOR_ARGB(0x00, 0xFF, 0x00, 0x00), 1), @@ -561,7 +630,7 @@ if (caps.RasterCaps & D3DPRASTERCAPS_FOGTABLE) { /* A simple fog + non-identity world matrix test */ - hr = IDirect3DDevice8_SetTransform(device, D3DTS_WORLDMATRIX(0), (D3DMATRIX *) world_mat1); + hr = IDirect3DDevice8_SetTransform(device, D3DTS_WORLDMATRIX(0), &world_mat1); ok(hr == D3D_OK, "IDirect3DDevice8_SetTransform returned %#08x\n", hr); hr = IDirect3DDevice8_SetRenderState(device, D3DRS_FOGTABLEMODE, D3DFOG_LINEAR); @@ -572,26 +641,18 @@ hr = IDirect3DDevice8_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffff00ff, 0.0, 0); ok(hr == D3D_OK, "IDirect3DDevice8_Clear returned %#08x\n", hr); - if (IDirect3DDevice8_BeginScene(device) == D3D_OK) - { - hr = IDirect3DDevice8_SetVertexShader(device, D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_SPECULAR); - ok(hr == D3D_OK, "SetVertexShader returned %#08x\n", hr); - - hr = IDirect3DDevice8_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0, 4, - 2, Indices, D3DFMT_INDEX16, far_quad1, sizeof(far_quad1[0])); - ok(hr == D3D_OK, "DrawIndexedPrimitiveUP returned %#08x\n", hr); - - hr = IDirect3DDevice8_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0, 4, - 2, Indices, D3DFMT_INDEX16, far_quad2, sizeof(far_quad2[0])); - ok(hr == D3D_OK, "DrawIndexedPrimitiveUP returned %#08x\n", hr); - - hr = IDirect3DDevice8_EndScene(device); - ok(hr == D3D_OK, "EndScene returned %#08x\n", hr); - } - else - { - ok(FALSE, "BeginScene failed\n"); - } + hr = IDirect3DDevice8_BeginScene(device); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetVertexShader(device, D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_SPECULAR); + ok(SUCCEEDED(hr), "Failed to set vertex shader, hr %#x.\n", hr); + hr = IDirect3DDevice8_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0, 4, + 2, Indices, D3DFMT_INDEX16, far_quad1, sizeof(far_quad1[0])); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice8_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0, 4, + 2, Indices, D3DFMT_INDEX16, far_quad2, sizeof(far_quad2[0])); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice8_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); color = getPixelColor(device, 160, 360); ok(color_match(color, 0x00ff0000, 4), "Unfogged quad has color %08x\n", color); @@ -602,34 +663,26 @@ IDirect3DDevice8_Present(device, NULL, NULL, NULL, NULL); /* Test fog behavior with an orthogonal (but not identity) projection matrix */ - hr = IDirect3DDevice8_SetTransform(device, D3DTS_WORLDMATRIX(0), (D3DMATRIX *) world_mat2); + hr = IDirect3DDevice8_SetTransform(device, D3DTS_WORLDMATRIX(0), &world_mat2); ok(hr == D3D_OK, "SetTransform returned %#08x\n", hr); - hr = IDirect3DDevice8_SetTransform(device, D3DTS_PROJECTION, (D3DMATRIX *) proj_mat); + hr = IDirect3DDevice8_SetTransform(device, D3DTS_PROJECTION, &proj_mat); ok(hr == D3D_OK, "SetTransform returned %#08x\n", hr); hr = IDirect3DDevice8_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffff00ff, 0.0, 0); ok(hr == D3D_OK, "Clear returned %#08x\n", hr); - if (IDirect3DDevice8_BeginScene(device) == D3D_OK) - { - hr = IDirect3DDevice8_SetVertexShader(device, D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_SPECULAR); - ok(hr == D3D_OK, "SetVertexShader returned %#08x\n", hr); - - hr = IDirect3DDevice8_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0, 4, - 2, Indices, D3DFMT_INDEX16, untransformed_1, sizeof(untransformed_1[0])); - ok(hr == D3D_OK, "DrawIndexedPrimitiveUP returned %#08x\n", hr); - - hr = IDirect3DDevice8_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0, 4, - 2, Indices, D3DFMT_INDEX16, untransformed_2, sizeof(untransformed_2[0])); - ok(hr == D3D_OK, "DrawIndexedPrimitiveUP returned %#08x\n", hr); - - hr = IDirect3DDevice8_EndScene(device); - ok(hr == D3D_OK, "EndScene returned %#08x\n", hr); - } - else - { - ok(FALSE, "BeginScene failed\n"); - } + hr = IDirect3DDevice8_BeginScene(device); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetVertexShader(device, D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_SPECULAR); + ok(SUCCEEDED(hr), "Failed to set vertex shader, hr %#x.\n", hr); + hr = IDirect3DDevice8_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0, 4, + 2, Indices, D3DFMT_INDEX16, untransformed_1, sizeof(untransformed_1[0])); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice8_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0, 4, + 2, Indices, D3DFMT_INDEX16, untransformed_2, sizeof(untransformed_2[0])); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice8_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); color = getPixelColor(device, 160, 360); ok(color_match(color, 0x00e51900, 4), "Partially fogged quad has color %08x\n", color); @@ -638,20 +691,17 @@ "Fogged out quad has color %08x\n", color); IDirect3DDevice8_Present(device, NULL, NULL, NULL, NULL); - - hr = IDirect3DDevice8_SetTransform(device, D3DTS_WORLDMATRIX(0), (D3DMATRIX *) ident_mat); - ok(hr == D3D_OK, "SetTransform returned %#08x\n", hr); - hr = IDirect3DDevice8_SetTransform(device, D3DTS_PROJECTION, (D3DMATRIX *) ident_mat); - ok(hr == D3D_OK, "SetTransform returned %#08x\n", hr); } else { skip("D3DPRASTERCAPS_FOGTABLE not supported, skipping some fog tests\n"); } - /* Turn off the fog master switch to avoid confusing other tests */ - hr = IDirect3DDevice8_SetRenderState(device, D3DRS_FOGENABLE, FALSE); - ok(hr == D3D_OK, "Turning off fog calculations returned %#08x\n", hr); + refcount = IDirect3DDevice8_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D8_Release(d3d); + DestroyWindow(window); } /* This tests fog in combination with shaders. @@ -660,16 +710,24 @@ * vertex fog with foggy vertex shader, non-linear * fog with shader, non-linear fog with foggy shader, * linear table fog with foggy shader */ -static void fog_with_shader_test(IDirect3DDevice8 *device) +static void fog_with_shader_test(void) { + /* Fill the null-shader entry with the FVF (SetVertexShader is "overloaded" on d3d8...) */ + DWORD vertex_shader[3] = {D3DFVF_XYZ | D3DFVF_DIFFUSE, 0, 0}; + DWORD pixel_shader[2] = {0, 0}; + IDirect3DDevice8 *device; + unsigned int i, j; + IDirect3D8 *d3d; + D3DCOLOR color; + ULONG refcount; + D3DCAPS8 caps; + HWND window; HRESULT hr; - DWORD color; union { float f; DWORD i; } start, end; - unsigned int i, j; /* Basic vertex shader without fog computation ("non foggy") */ static const DWORD vertex_shader_code1[] = @@ -711,10 +769,6 @@ D3DVSD_END() }; static const float vs_constant[4] = {-1.25f, 0.0f, -0.9f, 0.0f}; - /* Fill the null-shader entry with the FVF (SetVertexShader is "overloaded" on d3d8...) */ - DWORD vertex_shader[3] = {D3DFVF_XYZ | D3DFVF_DIFFUSE, 0, 0}; - DWORD pixel_shader[2] = {0, 0}; - /* This reference data was collected on a nVidia GeForce 7600GS * driver version 84.19 DirectX version 9.0c on Windows XP */ static const struct test_data_t @@ -842,12 +896,44 @@ {0x00ff0000, 0x00ff0000, 0x00df2000, 0x00bf4000, 0x009f6000, 0x007f8000, 0x005fa000, 0x0040bf00, 0x0020df00, 0x0000ff00, 0x0000ff00}}, }; + static const D3DMATRIX identity = + {{{ + 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, + }}}; + + 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"); + goto done; + } + + hr = IDirect3DDevice8_GetDeviceCaps(device, &caps); + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); + if (caps.VertexShaderVersion < D3DVS_VERSION(1, 1) || caps.PixelShaderVersion < D3DPS_VERSION(1, 1)) + { + skip("No vs_1_1 / ps_1_1 support, skipping tests.\n"); + IDirect3DDevice8_Release(device); + goto done; + } - /* NOTE: changing these values will not affect the tests with foggy vertex shader, - * as the values are hardcoded in the shader constant */ + /* NOTE: changing these values will not affect the tests with foggy vertex + * shader, as the values are hardcoded in the shader constant. */ start.f = 0.1f; end.f = 0.9f; + /* Some of the tests seem to depend on the projection matrix explicitly + * being set to an identity matrix, even though that's the default. + * (AMD Radeon HD 6310, Windows 7) */ + hr = IDirect3DDevice8_SetTransform(device, D3DTS_PROJECTION, &identity); + ok(SUCCEEDED(hr), "Failed to set projection transform, hr %#x.\n", hr); + hr = IDirect3DDevice8_CreateVertexShader(device, decl, vertex_shader_code1, &vertex_shader[1], 0); ok(SUCCEEDED(hr), "CreateVertexShader failed (%08x)\n", hr); hr = IDirect3DDevice8_CreateVertexShader(device, decl, vertex_shader_code2, &vertex_shader[2], 0); @@ -899,7 +985,7 @@ quad[2].z = 0.001f + j / 10.02f; quad[3].z = 0.001f + j / 10.02f; - hr = IDirect3DDevice8_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffff00ff, 0.0f, 0); + hr = IDirect3DDevice8_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xffff00ff, 1.0f, 0); ok(hr == D3D_OK, "IDirect3DDevice9_Clear failed (%08x)\n", hr); hr = IDirect3DDevice8_BeginScene(device); @@ -922,26 +1008,29 @@ } } - /* Reset states */ - hr = IDirect3DDevice8_SetVertexShader(device, 0); - ok(SUCCEEDED(hr), "SetVertexShader failed (%08x)\n", hr); - hr = IDirect3DDevice8_SetPixelShader(device, 0); - ok(SUCCEEDED(hr), "SetPixelShader failed (%08x)\n", hr); - hr = IDirect3DDevice8_SetRenderState(device, D3DRS_FOGENABLE, FALSE); - ok(hr == D3D_OK, "Turning off fog calculations failed (%08x)\n", hr); - IDirect3DDevice8_DeleteVertexShader(device, vertex_shader[1]); IDirect3DDevice8_DeleteVertexShader(device, vertex_shader[2]); IDirect3DDevice8_DeleteVertexShader(device, pixel_shader[1]); + refcount = IDirect3DDevice8_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D8_Release(d3d); + DestroyWindow(window); } -static void cnd_test(IDirect3DDevice8 *device) +static void cnd_test(void) { - DWORD shader_11, shader_12, shader_13, shader_14; - DWORD shader_11_coissue, shader_12_coissue, shader_13_coissue, shader_14_coissue; DWORD shader_11_coissue_2, shader_12_coissue_2, shader_13_coissue_2, shader_14_coissue_2; - HRESULT hr; + DWORD shader_11_coissue, shader_12_coissue, shader_13_coissue, shader_14_coissue; + DWORD shader_11, shader_12, shader_13, shader_14; + IDirect3DDevice8 *device; + IDirect3D8 *d3d; + ULONG refcount; + D3DCAPS8 caps; DWORD color; + HWND window; + HRESULT hr; + /* ps 1.x shaders are rather picky with writemasks and source swizzles. * The dp3 is used to copy r0.r to all components of r1, then copy r1.a to * r0.a. Essentially it does a mov r0.a, r0.r, which isn't allowed as-is @@ -1117,29 +1206,29 @@ static const float quad1[] = { -1.0f, -1.0f, 0.1f, 0.0f, 0.0f, 1.0f, - 0.0f, -1.0f, 0.1f, 1.0f, 0.0f, 1.0f, -1.0f, 0.0f, 0.1f, 0.0f, 1.0f, 0.0f, + 0.0f, -1.0f, 0.1f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.1f, 1.0f, 1.0f, 0.0f }; static const float quad2[] = { 0.0f, -1.0f, 0.1f, 0.0f, 0.0f, 1.0f, - 1.0f, -1.0f, 0.1f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.1f, 0.0f, 1.0f, 0.0f, + 1.0f, -1.0f, 0.1f, 1.0f, 0.0f, 1.0f, 1.0f, 0.0f, 0.1f, 1.0f, 1.0f, 0.0f }; static const float quad3[] = { 0.0f, 0.0f, 0.1f, 0.0f, 0.0f, 1.0f, - 1.0f, 0.0f, 0.1f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.1f, 0.0f, 1.0f, 0.0f, + 1.0f, 0.0f, 0.1f, 1.0f, 0.0f, 1.0f, 1.0f, 1.0f, 0.1f, 1.0f, 1.0f, 0.0f }; static const float quad4[] = { -1.0f, 0.0f, 0.1f, 0.0f, 0.0f, 1.0f, - 0.0f, 0.0f, 0.1f, 1.0f, 0.0f, 1.0f, -1.0f, 1.0f, 0.1f, 0.0f, 1.0f, 0.0f, + 0.0f, 0.0f, 0.1f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.1f, 1.0f, 1.0f, 0.0f }; static const float test_data_c1[4] = {0.0f, 0.0f, 0.0f, 0.0f}; @@ -1147,7 +1236,26 @@ static const float test_data_c1_coi[4] = {0.0f, 1.0f, 0.0f, 0.0f}; static const float test_data_c2_coi[4] = {1.0f, 0.0f, 1.0f, 1.0f}; - hr = IDirect3DDevice8_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff00ffff, 0.0f, 0); + 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"); + goto done; + } + + hr = IDirect3DDevice8_GetDeviceCaps(device, &caps); + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); + if (caps.PixelShaderVersion < D3DPS_VERSION(1, 4)) + { + skip("No ps_1_4 support, skipping tests.\n"); + IDirect3DDevice8_Release(device); + goto done; + } + + hr = IDirect3DDevice8_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff00ffff, 1.0f, 0); ok(hr == D3D_OK, "IDirect3DDevice8_Clear returned %08x\n", hr); hr = IDirect3DDevice8_CreatePixelShader(device, shader_code_11, &shader_11); @@ -1355,7 +1463,9 @@ hr = IDirect3DDevice8_Present(device, NULL, NULL, NULL, NULL); ok(hr == D3D_OK, "IDirect3DDevice8_Present failed with %08x\n", hr); - /* Retest with the coissue flag on the alpha instruction instead. This works "as expected". */ + /* Retest with the coissue flag on the alpha instruction instead. This + * works "as expected". The Windows 8 testbot (WARP) seems to handle this + * the same as coissue on .rgb. */ hr = IDirect3DDevice8_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff00ffff, 0.0f, 0); ok(hr == D3D_OK, "IDirect3DDevice8_Clear returned %08x\n", hr); @@ -1385,9 +1495,6 @@ hr = IDirect3DDevice8_EndScene(device); ok(hr == D3D_OK, "IDirect3DDevice8_EndScene returned %08x\n", hr); - hr = IDirect3DDevice8_SetPixelShader(device, 0); - ok(hr == D3D_OK, "IDirect3DDevice8_SetPixelShader returned %08x\n", hr); - /* 1.4 shader */ color = getPixelColor(device, 158, 118); ok(color == 0x00ffffff, "pixel 158, 118 has color %08x, expected 0x00ffffff\n", color); @@ -1400,13 +1507,13 @@ /* 1.1 shader */ color = getPixelColor(device, 238, 358); - ok(color_match(color, 0x00ffffff, 1), + ok(color_match(color, 0x00ffffff, 1) || broken(color_match(color, 0x00000000, 1)), "pixel 238, 358 has color %08x, expected 0x00ffffff\n", color); color = getPixelColor(device, 242, 358); ok(color_match(color, 0x00000000, 1), "pixel 242, 358 has color %08x, expected 0x00000000\n", color); color = getPixelColor(device, 238, 362); - ok(color_match(color, 0x00ffffff, 1), + ok(color_match(color, 0x00ffffff, 1) || broken(color_match(color, 0x00000000, 1)), "pixel 238, 362 has color %08x, expected 0x00ffffff\n", color); color = getPixelColor(device, 242, 362); ok(color_match(color, 0x00000000, 1), @@ -1414,13 +1521,13 @@ /* 1.2 shader */ color = getPixelColor(device, 558, 358); - ok(color_match(color, 0x00ffffff, 1), + ok(color_match(color, 0x00ffffff, 1) || broken(color_match(color, 0x00000000, 1)), "pixel 558, 358 has color %08x, expected 0x00ffffff\n", color); color = getPixelColor(device, 562, 358); ok(color_match(color, 0x00000000, 1), "pixel 562, 358 has color %08x, expected 0x00000000\n", color); color = getPixelColor(device, 558, 362); - ok(color_match(color, 0x00ffffff, 1), + ok(color_match(color, 0x00ffffff, 1) || broken(color_match(color, 0x00000000, 1)), "pixel 558, 362 has color %08x, expected 0x00ffffff\n", color); color = getPixelColor(device, 562, 362); ok(color_match(color, 0x00000000, 1), @@ -1428,13 +1535,13 @@ /* 1.3 shader */ color = getPixelColor(device, 558, 118); - ok(color_match(color, 0x00ffffff, 1), + ok(color_match(color, 0x00ffffff, 1) || broken(color_match(color, 0x00000000, 1)), "pixel 558, 118 has color %08x, expected 0x00ffffff\n", color); color = getPixelColor(device, 562, 118); ok(color_match(color, 0x00000000, 1), "pixel 562, 118 has color %08x, expected 0x00000000\n", color); color = getPixelColor(device, 558, 122); - ok(color_match(color, 0x00ffffff, 1), + ok(color_match(color, 0x00ffffff, 1) || broken(color_match(color, 0x00000000, 1)), "pixel 558, 122 has color %08x, expected 0x00ffffff\n", color); color = getPixelColor(device, 562, 122); ok(color_match(color, 0x00000000, 1), @@ -1455,10 +1562,24 @@ IDirect3DDevice8_DeletePixelShader(device, shader_13); IDirect3DDevice8_DeletePixelShader(device, shader_12); IDirect3DDevice8_DeletePixelShader(device, shader_11); + refcount = IDirect3DDevice8_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D8_Release(d3d); + DestroyWindow(window); } -static void z_range_test(IDirect3DDevice8 *device) +static void z_range_test(void) { + IDirect3DDevice8 *device; + IDirect3D8 *d3d; + D3DCOLOR color; + ULONG refcount; + D3DCAPS8 caps; + DWORD shader; + HWND window; + HRESULT hr; + static const struct vertex quad[] = { {-1.0f, 0.0f, 1.1f, 0xffff0000}, @@ -1475,22 +1596,18 @@ }; static const struct tvertex quad3[] = { - { 0.0f, 240.0f, 1.1f, 1.0f, 0xffffff00}, - { 0.0f, 480.0f, 1.1f, 1.0f, 0xffffff00}, {640.0f, 240.0f, -1.1f, 1.0f, 0xffffff00}, {640.0f, 480.0f, -1.1f, 1.0f, 0xffffff00}, + { 0.0f, 240.0f, 1.1f, 1.0f, 0xffffff00}, + { 0.0f, 480.0f, 1.1f, 1.0f, 0xffffff00}, }; static const struct tvertex quad4[] = { - { 0.0f, 240.0f, 1.1f, 1.0f, 0xff00ff00}, - { 0.0f, 480.0f, 1.1f, 1.0f, 0xff00ff00}, {640.0f, 240.0f, -1.1f, 1.0f, 0xff00ff00}, {640.0f, 480.0f, -1.1f, 1.0f, 0xff00ff00}, + { 0.0f, 240.0f, 1.1f, 1.0f, 0xff00ff00}, + { 0.0f, 480.0f, 1.1f, 1.0f, 0xff00ff00}, }; - HRESULT hr; - DWORD color; - DWORD shader; - D3DCAPS8 caps; static const DWORD shader_code[] = { 0xfffe0101, /* vs_1_1 */ @@ -1507,6 +1624,16 @@ D3DVSD_END() }; + 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"); + goto done; + } + hr = IDirect3DDevice8_GetDeviceCaps(device, &caps); ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); @@ -1521,6 +1648,8 @@ hr = IDirect3DDevice8_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffffff, 0.0f, 0); ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetRenderState(device, D3DRS_LIGHTING, FALSE); + ok(SUCCEEDED(hr), "Failed to disabled lighting, hr %#x.\n", hr); hr = IDirect3DDevice8_SetRenderState(device, D3DRS_CLIPPING, TRUE); ok(SUCCEEDED(hr), "Failed to enable clipping, hr %#x.\n", hr); hr = IDirect3DDevice8_SetRenderState(device, D3DRS_ZENABLE, D3DZB_TRUE); @@ -1610,7 +1739,8 @@ if (caps.VertexShaderVersion < D3DVS_VERSION(1, 1)) { skip("Vertex shaders not supported\n"); - goto out; + IDirect3DDevice8_Release(device); + goto done; } hr = IDirect3DDevice8_CreateVertexShader(device, vertex_declaration, shader_code, &shader, 0); ok(SUCCEEDED(hr), "Failed to create vertex shader, hr %#x.\n", hr); @@ -1669,17 +1799,25 @@ hr = IDirect3DDevice8_Present(device, NULL, NULL, NULL, NULL); ok(SUCCEEDED(hr), "Failed to present, hr %#x.\n", hr); -out: - hr = IDirect3DDevice8_SetRenderState(device, D3DRS_ZENABLE, D3DZB_FALSE); - ok(SUCCEEDED(hr), "Failed to disable z test, 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_ZWRITEENABLE, TRUE); - ok(SUCCEEDED(hr), "Failed to enable z writes, hr %#x.\n", hr); + refcount = IDirect3DDevice8_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D8_Release(d3d); + DestroyWindow(window); } -static void test_scalar_instructions(IDirect3DDevice8 *device) +static void test_scalar_instructions(void) { + IDirect3DDevice8 *device; + IDirect3D8 *d3d; + unsigned int i; + D3DCOLOR color; + ULONG refcount; + D3DCAPS8 caps; + DWORD shader; + HWND window; + HRESULT hr; + static const struct vec3 quad[] = { {-1.0f, -1.0f, 0.0f}, @@ -1780,10 +1918,25 @@ {"log_test", log_test, D3DCOLOR_ARGB(0x00, 0xff, 0xff, 0xff), D3DCOLOR_ARGB(0x00, 0x00, 0x00, 0x00)}, {"logp_test", logp_test, D3DCOLOR_ARGB(0x00, 0xff, 0xff, 0xff), D3DCOLOR_ARGB(0x00, 0x00, 0xff, 0x00)}, }; - unsigned int i; - DWORD shader; - DWORD color; - HRESULT hr; + + window = CreateWindowA("static", "d3d8_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + d3d = Direct3DCreate8(D3D_SDK_VERSION); + ok(!!d3d, "Failed to create a D3D object.\n"); + if (!(device = create_device(d3d, window, window, TRUE))) + { + skip("Failed to create a D3D device, skipping tests.\n"); + goto done; + } + + hr = IDirect3DDevice8_GetDeviceCaps(device, &caps); + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); + if (caps.VertexShaderVersion < D3DVS_VERSION(1, 1)) + { + skip("No vs_1_1 support, skipping tests.\n"); + IDirect3DDevice8_Release(device); + goto done; + } for (i = 0; i < sizeof(test_data) / sizeof(*test_data); ++i) { @@ -1815,51 +1968,71 @@ hr = IDirect3DDevice8_DeleteVertexShader(device, shader); ok(SUCCEEDED(hr), "%s: Failed to delete vertex shader, hr %#x.\n", test_data[i].name, hr); } + + refcount = IDirect3DDevice8_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D8_Release(d3d); + DestroyWindow(window); } -static void offscreen_test(IDirect3DDevice8 *device) +static void offscreen_test(void) { + IDirect3DSurface8 *backbuffer, *offscreen, *depthstencil; + IDirect3DTexture8 *offscreenTexture; + IDirect3DDevice8 *device; + IDirect3D8 *d3d; + D3DCOLOR color; + ULONG refcount; + HWND window; HRESULT hr; - IDirect3DTexture8 *offscreenTexture = NULL; - IDirect3DSurface8 *backbuffer = NULL, *offscreen = NULL, *depthstencil = NULL; - DWORD color; - static const float quad[][5] = { + static const float quad[][5] = + { {-0.5f, -0.5f, 0.1f, 0.0f, 0.0f}, {-0.5f, 0.5f, 0.1f, 0.0f, 1.0f}, { 0.5f, -0.5f, 0.1f, 1.0f, 0.0f}, { 0.5f, 0.5f, 0.1f, 1.0f, 1.0f}, }; - hr = IDirect3DDevice8_GetDepthStencilSurface(device, &depthstencil); - ok(hr == D3D_OK, "IDirect3DDevice8_GetDepthStencilSurface failed, hr = %#08x\n", hr); + window = CreateWindowA("static", "d3d8_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + d3d = Direct3DCreate8(D3D_SDK_VERSION); + ok(!!d3d, "Failed to create a D3D object.\n"); + if (!(device = create_device(d3d, window, window, TRUE))) + { + skip("Failed to create a D3D device, skipping tests.\n"); + goto done; + } - hr = IDirect3DDevice8_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffff0000, 0.0, 0); + hr = IDirect3DDevice8_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xffff0000, 1.0f, 0); ok(hr == D3D_OK, "Clear failed, hr = %#08x\n", hr); - hr = IDirect3DDevice8_CreateTexture(device, 128, 128, 1, D3DUSAGE_RENDERTARGET, D3DFMT_X8R8G8B8, D3DPOOL_DEFAULT, &offscreenTexture); + hr = IDirect3DDevice8_CreateTexture(device, 128, 128, 1, D3DUSAGE_RENDERTARGET, + D3DFMT_X8R8G8B8, D3DPOOL_DEFAULT, &offscreenTexture); ok(hr == D3D_OK || hr == D3DERR_INVALIDCALL, "Creating the offscreen render target failed, hr = %#08x\n", hr); - if(!offscreenTexture) { + if (!offscreenTexture) + { trace("Failed to create an X8R8G8B8 offscreen texture, trying R5G6B5\n"); - hr = IDirect3DDevice8_CreateTexture(device, 128, 128, 1, D3DUSAGE_RENDERTARGET, D3DFMT_R5G6B5, D3DPOOL_DEFAULT, &offscreenTexture); + hr = IDirect3DDevice8_CreateTexture(device, 128, 128, 1, D3DUSAGE_RENDERTARGET, + D3DFMT_R5G6B5, D3DPOOL_DEFAULT, &offscreenTexture); ok(hr == D3D_OK || hr == D3DERR_INVALIDCALL, "Creating the offscreen render target failed, hr = %#08x\n", hr); - if(!offscreenTexture) { - skip("Cannot create an offscreen render target\n"); - goto out; + if (!offscreenTexture) + { + skip("Cannot create an offscreen render target.\n"); + IDirect3DDevice8_Release(device); + goto done; } } + hr = IDirect3DDevice8_GetDepthStencilSurface(device, &depthstencil); + ok(hr == D3D_OK, "IDirect3DDevice8_GetDepthStencilSurface failed, hr = %#08x\n", hr); + hr = IDirect3DDevice8_GetBackBuffer(device, 0, D3DBACKBUFFER_TYPE_MONO, &backbuffer); ok(hr == D3D_OK, "Can't get back buffer, hr = %#08x\n", hr); - if(!backbuffer) { - goto out; - } hr = IDirect3DTexture8_GetSurfaceLevel(offscreenTexture, 0, &offscreen); ok(hr == D3D_OK, "Can't get offscreen surface, hr = %#08x\n", hr); - if(!offscreen) { - goto out; - } hr = IDirect3DDevice8_SetVertexShader(device, D3DFVF_XYZ | D3DFVF_TEX1); ok(hr == D3D_OK, "SetVertexShader failed, hr = %#08x\n", hr); @@ -1875,27 +2048,29 @@ hr = IDirect3DDevice8_SetRenderState(device, D3DRS_LIGHTING, FALSE); ok(hr == D3D_OK, "IDirect3DDevice8_SetRenderState returned %08x\n", hr); - if(IDirect3DDevice8_BeginScene(device) == D3D_OK) { - hr = IDirect3DDevice8_SetRenderTarget(device, offscreen, depthstencil); - ok(hr == D3D_OK, "SetRenderTarget failed, hr = %#08x\n", hr); - hr = IDirect3DDevice8_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffff00ff, 0.0, 0); - ok(hr == D3D_OK, "Clear failed, hr = %#08x\n", hr); + hr = IDirect3DDevice8_BeginScene(device); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); - /* Draw without textures - Should result in a white quad */ - hr = IDirect3DDevice8_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(quad[0])); - ok(hr == D3D_OK, "DrawPrimitiveUP failed, hr = %#08x\n", hr); - - hr = IDirect3DDevice8_SetRenderTarget(device, backbuffer, depthstencil); - ok(hr == D3D_OK, "SetRenderTarget failed, hr = %#08x\n", hr); - hr = IDirect3DDevice8_SetTexture(device, 0, (IDirect3DBaseTexture8 *) offscreenTexture); - ok(hr == D3D_OK, "SetTexture failed, %08x\n", hr); - - /* This time with the texture */ - hr = IDirect3DDevice8_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(quad[0])); - ok(hr == D3D_OK, "DrawPrimitiveUP failed, hr = %#08x\n", hr); + hr = IDirect3DDevice8_SetRenderTarget(device, offscreen, depthstencil); + ok(SUCCEEDED(hr), "Failed to set render target, hr %#x.\n", hr); + hr = IDirect3DDevice8_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffff00ff, 1.0f, 0); + ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); - IDirect3DDevice8_EndScene(device); - } + /* Draw without textures - Should result in a white quad. */ + hr = IDirect3DDevice8_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(quad[0])); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + + hr = IDirect3DDevice8_SetRenderTarget(device, backbuffer, depthstencil); + ok(SUCCEEDED(hr), "Failed to set render target, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetTexture(device, 0, (IDirect3DBaseTexture8 *)offscreenTexture); + ok(SUCCEEDED(hr), "Failed to set texture, hr %#x.\n", hr); + + /* This time with the texture .*/ + 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); /* Center quad - should be white */ color = getPixelColor(device, 320, 240); @@ -1906,86 +2081,80 @@ /* Part of the originally cleared back buffer */ color = getPixelColor(device, 10, 10); ok(color == 0x00ff0000, "Offscreen failed: Got color 0x%08x, expected 0x00ff0000.\n", color); - if(0) { - /* Lower left corner of the screen, where back buffer offscreen rendering draws the offscreen texture. - * It should be red, but the offscreen texture may leave some junk there. Not tested yet. Depending on - * the offscreen rendering mode this test would succeed or fail - */ - color = getPixelColor(device, 10, 470); - ok(color == 0x00ff0000, "Offscreen failed: Got color 0x%08x, expected 0x00ff0000.\n", color); - } + color = getPixelColor(device, 10, 470); + ok(color == 0x00ff0000, "Offscreen failed: Got color 0x%08x, expected 0x00ff0000.\n", color); IDirect3DDevice8_Present(device, NULL, NULL, NULL, NULL); -out: - hr = IDirect3DDevice8_SetTexture(device, 0, NULL); - ok(SUCCEEDED(hr), "IDirect3DDevice8_SetTexture returned %#x.\n", hr); - - /* restore things */ - if(backbuffer) { - hr = IDirect3DDevice8_SetRenderTarget(device, backbuffer, depthstencil); - ok(SUCCEEDED(hr), "IDirect3DDevice8_SetRenderTarget returned %#x.\n", hr); - IDirect3DSurface8_Release(backbuffer); - } - if(offscreenTexture) { - IDirect3DTexture8_Release(offscreenTexture); - } - if(offscreen) { - IDirect3DSurface8_Release(offscreen); - } - if(depthstencil) { - IDirect3DSurface8_Release(depthstencil); - } + IDirect3DSurface8_Release(backbuffer); + IDirect3DTexture8_Release(offscreenTexture); + IDirect3DSurface8_Release(offscreen); + IDirect3DSurface8_Release(depthstencil); + refcount = IDirect3DDevice8_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D8_Release(d3d); + DestroyWindow(window); } -static void alpha_test(IDirect3DDevice8 *device) +static void alpha_test(void) { - HRESULT hr; + IDirect3DSurface8 *backbuffer, *offscreen, *depthstencil; IDirect3DTexture8 *offscreenTexture; - IDirect3DSurface8 *backbuffer = NULL, *offscreen = NULL, *depthstencil = NULL; - DWORD color; + IDirect3DDevice8 *device; + IDirect3D8 *d3d; + D3DCOLOR color; + ULONG refcount; + HWND window; + HRESULT hr; - struct vertex quad1[] = + static const struct vertex 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}, + {-1.0f, -1.0f, 0.1f, 0x4000ff00}, + {-1.0f, 0.0f, 0.1f, 0x4000ff00}, + { 1.0f, -1.0f, 0.1f, 0x4000ff00}, + { 1.0f, 0.0f, 0.1f, 0x4000ff00}, }; - struct vertex quad2[] = + static const struct vertex quad2[] = { - {-1.0f, 0.0f, 0.1f, 0xc00000ff}, - {-1.0f, 1.0f, 0.1f, 0xc00000ff}, - { 1.0f, 0.0f, 0.1f, 0xc00000ff}, - { 1.0f, 1.0f, 0.1f, 0xc00000ff}, + {-1.0f, 0.0f, 0.1f, 0xc00000ff}, + {-1.0f, 1.0f, 0.1f, 0xc00000ff}, + { 1.0f, 0.0f, 0.1f, 0xc00000ff}, + { 1.0f, 1.0f, 0.1f, 0xc00000ff}, }; - static const float composite_quad[][5] = { + static const float composite_quad[][5] = + { { 0.0f, -1.0f, 0.1f, 0.0f, 1.0f}, { 0.0f, 1.0f, 0.1f, 0.0f, 0.0f}, { 1.0f, -1.0f, 0.1f, 1.0f, 1.0f}, { 1.0f, 1.0f, 0.1f, 1.0f, 0.0f}, }; + 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"); + goto done; + } + /* Clear the render target with alpha = 0.5 */ - hr = IDirect3DDevice8_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0x80ff0000, 0.0, 0); + hr = IDirect3DDevice8_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0x80ff0000, 1.0f, 0); ok(hr == D3D_OK, "Clear failed, hr = %08x\n", hr); - hr = IDirect3DDevice8_CreateTexture(device, 128, 128, 1, D3DUSAGE_RENDERTARGET, D3DFMT_X8R8G8B8, D3DPOOL_DEFAULT, &offscreenTexture); - ok(hr == D3D_OK || hr == D3DERR_INVALIDCALL, "Creating the offscreen render target failed, hr = %#08x\n", hr); + hr = IDirect3DDevice8_CreateTexture(device, 128, 128, 1, D3DUSAGE_RENDERTARGET, + D3DFMT_X8R8G8B8, D3DPOOL_DEFAULT, &offscreenTexture); + ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr); hr = IDirect3DDevice8_GetDepthStencilSurface(device, &depthstencil); - ok(hr == D3D_OK, "IDirect3DDevice8_GetDepthStencilSurface failed, hr = %#08x\n", hr); - + ok(SUCCEEDED(hr), "Failed to get depth/stencil buffer, hr %#x.\n", hr); hr = IDirect3DDevice8_GetBackBuffer(device, 0, D3DBACKBUFFER_TYPE_MONO, &backbuffer); - ok(hr == D3D_OK, "Can't get back buffer, hr = %#08x\n", hr); - if(!backbuffer) { - goto out; - } + ok(SUCCEEDED(hr), "Failed to get back buffer, hr %#x.\n", hr); + hr = IDirect3DTexture8_GetSurfaceLevel(offscreenTexture, 0, &offscreen); ok(hr == D3D_OK, "Can't get offscreen surface, hr = %#08x\n", hr); - if(!offscreen) { - goto out; - } hr = IDirect3DDevice8_SetVertexShader(device, D3DFVF_XYZ | D3DFVF_DIFFUSE); ok(hr == D3D_OK, "SetVertexShader failed, hr = %#08x\n", hr); @@ -2003,66 +2172,65 @@ hr = IDirect3DDevice8_SetRenderState(device, D3DRS_ALPHABLENDENABLE, TRUE); ok(hr == D3D_OK, "IDirect3DDevice8_SetRenderState failed, hr = %08x\n", hr); - if(IDirect3DDevice8_BeginScene(device) == D3D_OK) { + hr = IDirect3DDevice8_BeginScene(device); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); - /* Draw two quads, one with src alpha blending, one with dest alpha blending. */ - hr = IDirect3DDevice8_SetRenderState(device, D3DRS_SRCBLEND, D3DBLEND_SRCALPHA); - ok(hr == D3D_OK, "IDirect3DDevice8_SetRenderState failed, hr = %08x\n", hr); - hr = IDirect3DDevice8_SetRenderState(device, D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA); - ok(hr == D3D_OK, "IDirect3DDevice8_SetRenderState failed, hr = %08x\n", hr); - hr = IDirect3DDevice8_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad1, sizeof(quad1[0])); - ok(hr == D3D_OK, "DrawPrimitiveUP failed, hr = %#08x\n", hr); + /* Draw two quads, one with src alpha blending, one with dest alpha blending. */ + hr = IDirect3DDevice8_SetRenderState(device, D3DRS_SRCBLEND, D3DBLEND_SRCALPHA); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetRenderState(device, D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + hr = IDirect3DDevice8_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad1, sizeof(quad1[0])); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - hr = IDirect3DDevice8_SetRenderState(device, D3DRS_SRCBLEND, D3DBLEND_DESTALPHA); - ok(hr == D3D_OK, "IDirect3DDevice8_SetRenderState failed, hr = %08x\n", hr); - hr = IDirect3DDevice8_SetRenderState(device, D3DRS_DESTBLEND, D3DBLEND_INVDESTALPHA); - ok(hr == D3D_OK, "IDirect3DDevice8_SetRenderState failed, hr = %08x\n", hr); - hr = IDirect3DDevice8_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad2, sizeof(quad2[0])); - ok(hr == D3D_OK, "DrawPrimitiveUP failed, hr = %#08x\n", hr); + hr = IDirect3DDevice8_SetRenderState(device, D3DRS_SRCBLEND, D3DBLEND_DESTALPHA); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetRenderState(device, D3DRS_DESTBLEND, D3DBLEND_INVDESTALPHA); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + hr = IDirect3DDevice8_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad2, sizeof(quad2[0])); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - /* Switch to the offscreen buffer, and redo the testing. The offscreen render target - * doesn't have an alpha channel. DESTALPHA and INVDESTALPHA "don't work" on render - * targets without alpha channel, they give essentially ZERO and ONE blend factors. */ - hr = IDirect3DDevice8_SetRenderTarget(device, offscreen, 0); - ok(hr == D3D_OK, "Can't get back buffer, hr = %08x\n", hr); - hr = IDirect3DDevice8_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0x80ff0000, 0.0, 0); - ok(hr == D3D_OK, "Clear failed, hr = %08x\n", hr); + /* Switch to the offscreen buffer, and redo the testing. The offscreen + * render target doesn't have an alpha channel. DESTALPHA and INVDESTALPHA + * "don't work" on render targets without alpha channel, they give + * essentially ZERO and ONE blend factors. */ + hr = IDirect3DDevice8_SetRenderTarget(device, offscreen, 0); + ok(SUCCEEDED(hr), "Failed to set render target, hr %#x.\n", hr); + hr = IDirect3DDevice8_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0x80ff0000, 0.0, 0); + ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); - hr = IDirect3DDevice8_SetRenderState(device, D3DRS_SRCBLEND, D3DBLEND_SRCALPHA); - ok(hr == D3D_OK, "IDirect3DDevice8_SetRenderState failed, hr = %08x\n", hr); - hr = IDirect3DDevice8_SetRenderState(device, D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA); - ok(hr == D3D_OK, "IDirect3DDevice8_SetRenderState failed, hr = %08x\n", hr); - hr = IDirect3DDevice8_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad1, sizeof(quad1[0])); - ok(hr == D3D_OK, "DrawPrimitiveUP failed, hr = %#08x\n", hr); + hr = IDirect3DDevice8_SetRenderState(device, D3DRS_SRCBLEND, D3DBLEND_SRCALPHA); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetRenderState(device, D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + hr = IDirect3DDevice8_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad1, sizeof(quad1[0])); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - hr = IDirect3DDevice8_SetRenderState(device, D3DRS_SRCBLEND, D3DBLEND_DESTALPHA); - ok(hr == D3D_OK, "IDirect3DDevice8_SetRenderState failed, hr = %08x\n", hr); - hr = IDirect3DDevice8_SetRenderState(device, D3DRS_DESTBLEND, D3DBLEND_INVDESTALPHA); - ok(hr == D3D_OK, "IDirect3DDevice8_SetRenderState failed, hr = %08x\n", hr); - hr = IDirect3DDevice8_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad2, sizeof(quad2[0])); - ok(hr == D3D_OK, "DrawPrimitiveUP failed, hr = %#08x\n", hr); + hr = IDirect3DDevice8_SetRenderState(device, D3DRS_SRCBLEND, D3DBLEND_DESTALPHA); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetRenderState(device, D3DRS_DESTBLEND, D3DBLEND_INVDESTALPHA); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + hr = IDirect3DDevice8_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad2, sizeof(quad2[0])); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - hr = IDirect3DDevice8_SetRenderTarget(device, backbuffer, depthstencil); - ok(hr == D3D_OK, "Can't get back buffer, hr = %08x\n", hr); + hr = IDirect3DDevice8_SetRenderTarget(device, backbuffer, depthstencil); + ok(SUCCEEDED(hr), "Failed to set render target, hr %#x.\n", hr); - /* Render the offscreen texture onto the frame buffer to be able to compare it regularly. - * Disable alpha blending for the final composition - */ - hr = IDirect3DDevice8_SetRenderState(device, D3DRS_ALPHABLENDENABLE, FALSE); - ok(hr == D3D_OK, "IDirect3DDevice8_SetRenderState failed, hr = %08x\n", hr); - hr = IDirect3DDevice8_SetVertexShader(device, D3DFVF_XYZ | D3DFVF_TEX1); - ok(hr == D3D_OK, "SetVertexShader failed, hr = %#08x\n", hr); + /* Render the offscreen texture onto the frame buffer to be able to + * compare it regularly. Disable alpha blending for the final + * composition. */ + hr = IDirect3DDevice8_SetRenderState(device, D3DRS_ALPHABLENDENABLE, FALSE); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetVertexShader(device, D3DFVF_XYZ | D3DFVF_TEX1); + ok(SUCCEEDED(hr), "Failed to set vertex shader, hr %#x.\n", hr); - hr = IDirect3DDevice8_SetTexture(device, 0, (IDirect3DBaseTexture8 *) offscreenTexture); - ok(hr == D3D_OK, "IDirect3DDevice8_SetTexture failed, hr = %08x\n", hr); - hr = IDirect3DDevice8_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, composite_quad, sizeof(float) * 5); - ok(hr == D3D_OK, "DrawPrimitiveUP failed, hr = %#08x\n", hr); - hr = IDirect3DDevice8_SetTexture(device, 0, NULL); - ok(hr == D3D_OK, "IDirect3DDevice8_SetTexture failed, hr = %08x\n", hr); + hr = IDirect3DDevice8_SetTexture(device, 0, (IDirect3DBaseTexture8 *) offscreenTexture); + ok(SUCCEEDED(hr), "Failed to set texture, hr %#x.\n", hr); + hr = IDirect3DDevice8_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, composite_quad, sizeof(float) * 5); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - hr = IDirect3DDevice8_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice7_EndScene failed, hr = %08x\n", hr); - } + hr = IDirect3DDevice8_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); color = getPixelColor(device, 160, 360); ok(color_match(color, D3DCOLOR_ARGB(0x00, 0xbf, 0x40, 0x00), 1), @@ -2082,91 +2250,90 @@ IDirect3DDevice8_Present(device, NULL, NULL, NULL, NULL); - out: - /* restore things */ - if(backbuffer) { - IDirect3DSurface8_Release(backbuffer); - } - if(offscreenTexture) { - IDirect3DTexture8_Release(offscreenTexture); - } - if(offscreen) { - IDirect3DSurface8_Release(offscreen); - } - if(depthstencil) { - IDirect3DSurface8_Release(depthstencil); - } + IDirect3DSurface8_Release(backbuffer); + IDirect3DTexture8_Release(offscreenTexture); + IDirect3DSurface8_Release(offscreen); + IDirect3DSurface8_Release(depthstencil); + refcount = IDirect3DDevice8_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D8_Release(d3d); + DestroyWindow(window); } -static void p8_texture_test(IDirect3DDevice8 *device) +static void p8_texture_test(void) { - IDirect3D8 *d3d = NULL; - HRESULT hr; - IDirect3DTexture8 *texture = NULL, *texture2 = NULL; - D3DLOCKED_RECT lr; - unsigned char *data; + IDirect3DTexture8 *texture, *texture2; + IDirect3DDevice8 *device; PALETTEENTRY table[256]; + unsigned char *data; + D3DLOCKED_RECT lr; + IDirect3D8 *d3d; D3DCOLOR color; + ULONG refcount; D3DCAPS8 caps; + HWND window; + HRESULT hr; UINT i; - float quad[] = { - -1.0f, 0.0f, 0.1f, 0.0f, 0.0f, - -1.0f, 1.0f, 0.1f, 0.0f, 1.0f, - 1.0f, 0.0f, 0.1f, 1.0f, 0.0f, - 1.0f, 1.0f, 0.1f, 1.0f, 1.0f, - }; - float quad2[] = { - -1.0f, -1.0f, 0.1f, 0.0f, 0.0f, - -1.0f, 0.0f, 0.1f, 0.0f, 1.0f, - 1.0f, -1.0f, 0.1f, 1.0f, 0.0f, - 1.0f, 0.0f, 0.1f, 1.0f, 1.0f, - }; - - IDirect3DDevice8_GetDirect3D(device, &d3d); - - if(IDirect3D8_CheckDeviceFormat(d3d, 0, D3DDEVTYPE_HAL, D3DFMT_X8R8G8B8, 0, - D3DRTYPE_TEXTURE, D3DFMT_P8) != D3D_OK) { - skip("D3DFMT_P8 textures not supported\n"); - goto out; - } - - hr = IDirect3DDevice8_CreateTexture(device, 1, 1, 1, 0, D3DFMT_P8, - D3DPOOL_MANAGED, &texture2); - ok(hr == D3D_OK, "IDirect3DDevice8_CreateTexture failed, hr = %08x\n", hr); - if(!texture2) { - skip("Failed to create D3DFMT_P8 texture\n"); - goto out; + + static const float quad[] = + { + -1.0f, 0.0f, 0.1f, 0.0f, 0.0f, + -1.0f, 1.0f, 0.1f, 0.0f, 1.0f, + 1.0f, 0.0f, 0.1f, 1.0f, 0.0f, + 1.0f, 1.0f, 0.1f, 1.0f, 1.0f, + }; + static const float quad2[] = + { + -1.0f, -1.0f, 0.1f, 0.0f, 0.0f, + -1.0f, 0.0f, 0.1f, 0.0f, 1.0f, + 1.0f, -1.0f, 0.1f, 1.0f, 0.0f, + 1.0f, 0.0f, 0.1f, 1.0f, 1.0f, + }; + + 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"); + goto done; } + if (IDirect3D8_CheckDeviceFormat(d3d, 0, D3DDEVTYPE_HAL, + D3DFMT_X8R8G8B8, 0, D3DRTYPE_TEXTURE, D3DFMT_P8) != D3D_OK) + { + skip("D3DFMT_P8 textures not supported.\n"); + IDirect3DDevice8_Release(device); + goto done; + } + + hr = IDirect3DDevice8_CreateTexture(device, 1, 1, 1, 0, D3DFMT_P8, D3DPOOL_MANAGED, &texture2); + ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr); memset(&lr, 0, sizeof(lr)); hr = IDirect3DTexture8_LockRect(texture2, 0, &lr, NULL, 0); ok(hr == D3D_OK, "IDirect3DTexture8_LockRect failed, hr = %08x\n", hr); data = lr.pBits; *data = 1; - hr = IDirect3DTexture8_UnlockRect(texture2, 0); ok(hr == D3D_OK, "IDirect3DTexture8_UnlockRect failed, hr = %08x\n", hr); - hr = IDirect3DDevice8_CreateTexture(device, 1, 1, 1, 0, D3DFMT_P8, - D3DPOOL_MANAGED, &texture); - ok(hr == D3D_OK, "IDirect3DDevice8_CreateTexture failed, hr = %08x\n", hr); - if(!texture) { - skip("Failed to create D3DFMT_P8 texture\n"); - goto out; - } - + hr = IDirect3DDevice8_CreateTexture(device, 1, 1, 1, 0, D3DFMT_P8, D3DPOOL_MANAGED, &texture); + ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr); memset(&lr, 0, sizeof(lr)); hr = IDirect3DTexture8_LockRect(texture, 0, &lr, NULL, 0); ok(hr == D3D_OK, "IDirect3DTexture8_LockRect failed, hr = %08x\n", hr); data = lr.pBits; *data = 1; - hr = IDirect3DTexture8_UnlockRect(texture, 0); ok(hr == D3D_OK, "IDirect3DTexture8_UnlockRect failed, hr = %08x\n", hr); - hr = IDirect3DDevice8_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff000000, 0.0, 0); + hr = IDirect3DDevice8_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff000000, 1.0f, 0); ok(hr == D3D_OK, "IDirect3DDevice8_Clear failed, hr = %08x\n", hr); + hr = IDirect3DDevice8_SetRenderState(device, D3DRS_LIGHTING, FALSE); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); hr = IDirect3DDevice8_SetRenderState(device, D3DRS_ALPHABLENDENABLE, TRUE); ok(hr == D3D_OK, "IDirect3DDevice8_SetRenderState failed, hr = %08x\n", hr); @@ -2187,37 +2354,33 @@ ok(hr == D3D_OK, "IDirect3DDevice8_SetPaletteEntries failed, hr = %08x\n", hr); hr = IDirect3DDevice8_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice8_BeginScene failed, hr = %08x\n", hr); - if(SUCCEEDED(hr)) { - hr = IDirect3DDevice8_SetRenderState(device, D3DRS_SRCBLEND, D3DBLEND_SRCALPHA); - ok(hr == D3D_OK, "IDirect3DDevice8_SetRenderState failed, hr = %08x\n", hr); - hr = IDirect3DDevice8_SetRenderState(device, D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA); - ok(hr == D3D_OK, "IDirect3DDevice8_SetRenderState failed, hr = %08x\n", hr); - - hr = IDirect3DDevice8_SetVertexShader(device, D3DFVF_XYZ | D3DFVF_TEX1); - ok(hr == D3D_OK, "SetVertexShader failed, hr = %#08x\n", hr); - - hr = IDirect3DDevice8_SetCurrentTexturePalette(device, 0); - ok(hr == D3D_OK, "IDirect3DDevice8_SetCurrentTexturePalette failed, hr = %08x\n", hr); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); - hr = IDirect3DDevice8_SetTexture(device, 0, (IDirect3DBaseTexture8 *) texture2); - ok(hr == D3D_OK, "IDirect3DDevice8_SetTexture failed, hr = %08x\n", hr); - hr = IDirect3DDevice8_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float)); - ok(hr == D3D_OK, "IDirect3DDevice8_DrawPrimitiveUP failed, hr = %08x\n", hr); + hr = IDirect3DDevice8_SetRenderState(device, D3DRS_SRCBLEND, D3DBLEND_SRCALPHA); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetRenderState(device, D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetVertexShader(device, D3DFVF_XYZ | D3DFVF_TEX1); + ok(SUCCEEDED(hr), "Failed to set vertex shader, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetCurrentTexturePalette(device, 0); + ok(SUCCEEDED(hr), "Failed to set texture palette, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetTexture(device, 0, (IDirect3DBaseTexture8 *)texture2); + ok(SUCCEEDED(hr), "Failed to set texture, hr %#x.\n", hr); + hr = IDirect3DDevice8_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - hr = IDirect3DDevice8_SetTexture(device, 0, (IDirect3DBaseTexture8 *) texture); - ok(hr == D3D_OK, "IDirect3DDevice8_SetTexture failed, hr = %08x\n", hr); - hr = IDirect3DDevice8_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float)); - ok(hr == D3D_OK, "IDirect3DDevice8_DrawPrimitiveUP failed, hr = %08x\n", hr); + hr = IDirect3DDevice8_SetTexture(device, 0, (IDirect3DBaseTexture8 *)texture); + ok(SUCCEEDED(hr), "Failed to set texture, hr %#x.\n", hr); + hr = IDirect3DDevice8_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - hr = IDirect3DDevice8_SetCurrentTexturePalette(device, 1); - ok(hr == D3D_OK, "IDirect3DDevice8_SetCurrentTexturePalette failed, hr = %08x\n", hr); - hr = IDirect3DDevice8_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad2, 5 * sizeof(float)); - ok(hr == D3D_OK, "IDirect3DDevice8_DrawPrimitiveUP failed, hr = %08x\n", hr); + hr = IDirect3DDevice8_SetCurrentTexturePalette(device, 1); + ok(SUCCEEDED(hr), "Failed to set texture palette, hr %#x.\n", hr); + hr = IDirect3DDevice8_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad2, 5 * sizeof(float)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - hr = IDirect3DDevice8_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice8_EndScene failed, hr = %08x\n", hr); - } + hr = IDirect3DDevice8_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); color = getPixelColor(device, 32, 32); ok(color_match(color, 0x00ff0000, 0), "Got unexpected color 0x%08x.\n", color); @@ -2231,18 +2394,13 @@ ok(hr == D3D_OK, "IDirect3DDevice8_Clear failed, hr = %08x\n", hr); hr = IDirect3DDevice8_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice8_BeginScene failed, hr = %08x\n", hr); - if(SUCCEEDED(hr)) { - hr = IDirect3DDevice8_SetTexture(device, 0, (IDirect3DBaseTexture8 *) texture2); - ok(hr == D3D_OK, "IDirect3DDevice8_SetTexture failed, hr = %08x\n", hr); - - hr = IDirect3DDevice8_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float)); - ok(hr == D3D_OK, "IDirect3DDevice8_DrawPrimitiveUP failed, hr = %08x\n", hr); - - hr = IDirect3DDevice8_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice8_EndScene failed, hr = %08x\n", hr); - } - + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetTexture(device, 0, (IDirect3DBaseTexture8 *)texture2); + ok(SUCCEEDED(hr), "Failed to set texture, hr %#x.\n", hr); + hr = IDirect3DDevice8_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice8_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); color = getPixelColor(device, 32, 32); ok(color_match(color, 0x000000ff, 0), "Got unexpected color 0x%08x.\n", color); @@ -2277,31 +2435,27 @@ ok(hr == D3D_OK, "IDirect3DDevice8_SetPaletteEntries failed, hr = %08x\n", hr); hr = IDirect3DDevice8_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice8_BeginScene failed, hr = %08x\n", hr); - if(SUCCEEDED(hr)) { - hr = IDirect3DDevice8_SetRenderState(device, D3DRS_SRCBLEND, D3DBLEND_SRCALPHA); - ok(hr == D3D_OK, "IDirect3DDevice8_SetRenderState failed, hr = %08x\n", hr); - hr = IDirect3DDevice8_SetRenderState(device, D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA); - ok(hr == D3D_OK, "IDirect3DDevice8_SetRenderState failed, hr = %08x\n", hr); - - hr = IDirect3DDevice8_SetVertexShader(device, D3DFVF_XYZ | D3DFVF_TEX1); - ok(hr == D3D_OK, "SetVertexShader failed, hr = %#08x\n", hr); - - hr = IDirect3DDevice8_SetCurrentTexturePalette(device, 0); - ok(hr == D3D_OK, "IDirect3DDevice8_SetCurrentTexturePalette failed, hr = %08x\n", hr); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); - hr = IDirect3DDevice8_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float)); - ok(hr == D3D_OK, "IDirect3DDevice8_DrawPrimitiveUP failed, hr = %08x\n", hr); + hr = IDirect3DDevice8_SetRenderState(device, D3DRS_SRCBLEND, D3DBLEND_SRCALPHA); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetRenderState(device, D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetVertexShader(device, D3DFVF_XYZ | D3DFVF_TEX1); + ok(SUCCEEDED(hr), "Failed to set vertex shader, hr %#x.\n", hr); - hr = IDirect3DDevice8_SetCurrentTexturePalette(device, 1); - ok(hr == D3D_OK, "IDirect3DDevice8_SetCurrentTexturePalette failed, hr = %08x\n", hr); + hr = IDirect3DDevice8_SetCurrentTexturePalette(device, 0); + ok(SUCCEEDED(hr), "Failed to set texture palette, hr %#x.\n", hr); + hr = IDirect3DDevice8_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - hr = IDirect3DDevice8_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad2, 5 * sizeof(float)); - ok(hr == D3D_OK, "IDirect3DDevice8_DrawPrimitiveUP failed, hr = %08x\n", hr); + hr = IDirect3DDevice8_SetCurrentTexturePalette(device, 1); + ok(SUCCEEDED(hr), "Failed to set texture palette, hr %#x.\n", hr); + hr = IDirect3DDevice8_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad2, 5 * sizeof(float)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - hr = IDirect3DDevice8_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice8_EndScene failed, hr = %08x\n", hr); - } + hr = IDirect3DDevice8_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); color = getPixelColor(device, 32, 32); ok(color_match(color, 0x00800000, 1), "Got unexpected color 0x%08x.\n", color); @@ -2312,25 +2466,27 @@ ok(hr == D3D_OK, "IDirect3DDevice8_Present failed, hr = %08x\n", hr); } - hr = IDirect3DDevice8_SetTexture(device, 0, NULL); - ok(hr == D3D_OK, "IDirect3DDevice8_SetTexture failed, hr = %08x\n", hr); - hr = IDirect3DDevice8_SetRenderState(device, D3DRS_ALPHABLENDENABLE, FALSE); - ok(hr == D3D_OK, "IDirect3DDevice8_SetRenderState failed, hr = %08x\n", hr); - -out: - if(texture) IDirect3DTexture8_Release(texture); - if(texture2) IDirect3DTexture8_Release(texture2); + IDirect3DTexture8_Release(texture); + IDirect3DTexture8_Release(texture2); + refcount = IDirect3DDevice8_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: IDirect3D8_Release(d3d); + DestroyWindow(window); } -static void texop_test(IDirect3DDevice8 *device) +static void texop_test(void) { - IDirect3DTexture8 *texture = NULL; + IDirect3DTexture8 *texture; D3DLOCKED_RECT locked_rect; + IDirect3DDevice8 *device; + IDirect3D8 *d3d; + unsigned int i; D3DCOLOR color; + ULONG refcount; D3DCAPS8 caps; + HWND window; HRESULT hr; - unsigned int i; static const struct { float x, y, z; @@ -2376,6 +2532,16 @@ {D3DTOP_LERP, "LERP", D3DTEXOPCAPS_LERP, D3DCOLOR_ARGB(0x00, 0x00, 0x33, 0x33)}, }; + 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"); + goto done; + } + memset(&caps, 0, sizeof(caps)); hr = IDirect3DDevice8_GetDeviceCaps(device, &caps); ok(SUCCEEDED(hr), "GetDeviceCaps failed with 0x%08x\n", hr); @@ -2444,9 +2610,12 @@ ok(SUCCEEDED(hr), "IDirect3DDevice9_Clear failed with 0x%08x\n", hr); } - hr = IDirect3DDevice8_SetTexture(device, 0, NULL); - ok(SUCCEEDED(hr), "SetTexture failed with 0x%08x\n", hr); - if (texture) IDirect3DTexture8_Release(texture); + IDirect3DTexture8_Release(texture); + refcount = IDirect3DDevice8_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D8_Release(d3d); + DestroyWindow(window); } /* This test tests depth clamping / clipping behaviour: @@ -2459,44 +2628,53 @@ * clipped when D3DPMISCCAPS_CLIPTLVERTS is set, clamped when it isn't. * - The viewport's MinZ/MaxZ is irrelevant for this. */ -static void depth_clamp_test(IDirect3DDevice8 *device) +static void depth_clamp_test(void) { - const struct tvertex quad1[] = + IDirect3DDevice8 *device; + D3DVIEWPORT8 vp; + IDirect3D8 *d3d; + D3DCOLOR color; + ULONG refcount; + D3DCAPS8 caps; + HWND window; + HRESULT hr; + + static const struct tvertex quad1[] = { { 0.0f, 0.0f, 5.0f, 1.0f, 0xff002b7f}, {640.0f, 0.0f, 5.0f, 1.0f, 0xff002b7f}, { 0.0f, 480.0f, 5.0f, 1.0f, 0xff002b7f}, {640.0f, 480.0f, 5.0f, 1.0f, 0xff002b7f}, }; - const struct tvertex quad2[] = + static const struct tvertex quad2[] = { { 0.0f, 300.0f, 10.0f, 1.0f, 0xfff9e814}, {640.0f, 300.0f, 10.0f, 1.0f, 0xfff9e814}, { 0.0f, 360.0f, 10.0f, 1.0f, 0xfff9e814}, {640.0f, 360.0f, 10.0f, 1.0f, 0xfff9e814}, }; - const struct tvertex quad3[] = + static const struct tvertex quad3[] = { {112.0f, 108.0f, 5.0f, 1.0f, 0xffffffff}, {208.0f, 108.0f, 5.0f, 1.0f, 0xffffffff}, {112.0f, 204.0f, 5.0f, 1.0f, 0xffffffff}, {208.0f, 204.0f, 5.0f, 1.0f, 0xffffffff}, }; - const struct tvertex quad4[] = + static const struct tvertex quad4[] = { { 42.0f, 41.0f, 10.0f, 1.0f, 0xffffffff}, {112.0f, 41.0f, 10.0f, 1.0f, 0xffffffff}, { 42.0f, 108.0f, 10.0f, 1.0f, 0xffffffff}, {112.0f, 108.0f, 10.0f, 1.0f, 0xffffffff}, }; - const struct vertex quad5[] = + static const struct vertex quad5[] = { { -0.5f, 0.5f, 10.0f, 0xff14f914}, { 0.5f, 0.5f, 10.0f, 0xff14f914}, { -0.5f, -0.5f, 10.0f, 0xff14f914}, { 0.5f, -0.5f, 10.0f, 0xff14f914}, }; - const struct vertex quad6[] = + static const struct vertex quad6[] = { { -1.0f, 0.5f, 10.0f, 0xfff91414}, { 1.0f, 0.5f, 10.0f, 0xfff91414}, @@ -2504,10 +2682,18 @@ { 1.0f, 0.25f, 10.0f, 0xfff91414}, }; - D3DVIEWPORT8 vp; - D3DCOLOR color; - D3DCAPS8 caps; - HRESULT hr; + window = CreateWindowA("static", "d3d8_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + d3d = Direct3DCreate8(D3D_SDK_VERSION); + ok(!!d3d, "Failed to create a D3D object.\n"); + if (!(device = create_device(d3d, window, window, TRUE))) + { + skip("Failed to create a D3D device, skipping tests.\n"); + goto done; + } + + hr = IDirect3DDevice8_GetDeviceCaps(device, &caps); + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); vp.X = 0; vp.Y = 0; @@ -2516,9 +2702,6 @@ vp.MinZ = 0.0; vp.MaxZ = 7.5; - hr = IDirect3DDevice8_GetDeviceCaps(device, &caps); - ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); - hr = IDirect3DDevice8_SetViewport(device, &vp); ok(SUCCEEDED(hr), "SetViewport failed, hr %#x.\n", hr); @@ -2600,14 +2783,26 @@ hr = IDirect3DDevice8_Present(device, NULL, NULL, NULL, NULL); ok(SUCCEEDED(hr), "Present failed (0x%08x)\n", hr); - vp.MinZ = 0.0; - vp.MaxZ = 1.0; - hr = IDirect3DDevice8_SetViewport(device, &vp); - ok(SUCCEEDED(hr), "SetViewport failed, hr %#x.\n", hr); + refcount = IDirect3DDevice8_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D8_Release(d3d); + DestroyWindow(window); } -static void depth_buffer_test(IDirect3DDevice8 *device) +static void depth_buffer_test(void) { + IDirect3DSurface8 *backbuffer, *rt1, *rt2, *rt3; + IDirect3DSurface8 *depth_stencil; + IDirect3DDevice8 *device; + unsigned int i, j; + D3DVIEWPORT8 vp; + IDirect3D8 *d3d; + D3DCOLOR color; + ULONG refcount; + HWND window; + HRESULT hr; + static const struct vertex quad1[] = { { -1.0, 1.0, 0.33f, 0xff00ff00}, @@ -2637,12 +2832,15 @@ {0x00ff0000, 0x00ff0000, 0x00ff0000, 0x00ff0000}, }; - IDirect3DSurface8 *backbuffer, *rt1, *rt2, *rt3; - IDirect3DSurface8 *depth_stencil; - unsigned int i, j; - D3DVIEWPORT8 vp; - D3DCOLOR color; - HRESULT hr; + window = CreateWindowA("static", "d3d8_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + d3d = Direct3DCreate8(D3D_SDK_VERSION); + ok(!!d3d, "Failed to create a D3D object.\n"); + if (!(device = create_device(d3d, window, window, TRUE))) + { + skip("Failed to create a D3D device, skipping tests.\n"); + goto done; + } vp.X = 0; vp.Y = 0; @@ -2738,13 +2936,29 @@ IDirect3DSurface8_Release(rt3); IDirect3DSurface8_Release(rt2); IDirect3DSurface8_Release(rt1); + refcount = IDirect3DDevice8_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D8_Release(d3d); + DestroyWindow(window); } -/* Test that partial depth copies work the way they're supposed to. The clear - * on rt2 only needs a partial copy of the onscreen depth/stencil buffer, and - * the following draw should only copy back the part that was modified. */ -static void depth_buffer2_test(IDirect3DDevice8 *device) -{ +/* Test that partial depth copies work the way they're supposed to. The clear + * on rt2 only needs a partial copy of the onscreen depth/stencil buffer, and + * the following draw should only copy back the part that was modified. */ +static void depth_buffer2_test(void) +{ + IDirect3DSurface8 *backbuffer, *rt1, *rt2; + IDirect3DSurface8 *depth_stencil; + IDirect3DDevice8 *device; + unsigned int i, j; + D3DVIEWPORT8 vp; + IDirect3D8 *d3d; + D3DCOLOR color; + ULONG refcount; + HWND window; + HRESULT hr; + static const struct vertex quad[] = { { -1.0, 1.0, 0.66f, 0xffff0000}, @@ -2753,12 +2967,15 @@ { 1.0, -1.0, 0.66f, 0xffff0000}, }; - IDirect3DSurface8 *backbuffer, *rt1, *rt2; - IDirect3DSurface8 *depth_stencil; - unsigned int i, j; - D3DVIEWPORT8 vp; - D3DCOLOR color; - HRESULT hr; + window = CreateWindowA("static", "d3d8_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + d3d = Direct3DCreate8(D3D_SDK_VERSION); + ok(!!d3d, "Failed to create a D3D object.\n"); + if (!(device = create_device(d3d, window, window, TRUE))) + { + skip("Failed to create a D3D device, skipping tests.\n"); + goto done; + } vp.X = 0; vp.Y = 0; @@ -2839,10 +3056,27 @@ IDirect3DSurface8_Release(backbuffer); IDirect3DSurface8_Release(rt2); IDirect3DSurface8_Release(rt1); + refcount = IDirect3DDevice8_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D8_Release(d3d); + DestroyWindow(window); } -static void intz_test(IDirect3DDevice8 *device) +static void intz_test(void) { + IDirect3DSurface8 *original_rt, *rt; + IDirect3DTexture8 *texture; + IDirect3DDevice8 *device; + IDirect3DSurface8 *ds; + IDirect3D8 *d3d; + ULONG refcount; + D3DCAPS8 caps; + HWND window; + HRESULT hr; + DWORD ps; + UINT i; + static const DWORD ps_code[] = { 0xffff0101, /* ps_1_1 */ @@ -2857,7 +3091,7 @@ 0x40000001, 0x80080000, 0xa0aa0002, /* +mov r0.w, c2.z */ 0x0000ffff, /* end */ }; - struct + static const struct { float x, y, z; float s0, t0, p0; @@ -2884,7 +3118,7 @@ { -1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.5f}, { 1.0f, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.5f}, }; - struct + static const struct { UINT x, y; D3DCOLOR color; @@ -2901,45 +3135,41 @@ {560, 450, D3DCOLOR_ARGB(0x00, 0xdf, 0xbf, 0x00)}, }; - IDirect3DSurface8 *original_ds, *original_rt, *rt; - IDirect3DTexture8 *texture; - IDirect3DSurface8 *ds; - IDirect3D8 *d3d8; - D3DCAPS8 caps; - HRESULT hr; - DWORD ps; - UINT i; + 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"); + goto done; + } hr = IDirect3DDevice8_GetDeviceCaps(device, &caps); ok(SUCCEEDED(hr), "GetDeviceCaps failed, hr %#x.\n", hr); if (caps.PixelShaderVersion < D3DPS_VERSION(1, 1)) { skip("No pixel shader 1.1 support, skipping INTZ test.\n"); - return; + IDirect3DDevice8_Release(device); + goto done; } if (caps.TextureCaps & D3DPTEXTURECAPS_POW2) { skip("No unconditional NP2 texture support, skipping INTZ test.\n"); - return; + IDirect3DDevice8_Release(device); + goto done; } - hr = IDirect3DDevice8_GetDirect3D(device, &d3d8); - ok(SUCCEEDED(hr), "GetDirect3D failed, hr %#x.\n", hr); - - hr = IDirect3D8_CheckDeviceFormat(d3d8, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, D3DFMT_X8R8G8B8, - D3DUSAGE_DEPTHSTENCIL, D3DRTYPE_TEXTURE, MAKEFOURCC('I','N','T','Z')); - if (FAILED(hr)) + if (FAILED(hr = IDirect3D8_CheckDeviceFormat(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, + D3DFMT_X8R8G8B8, D3DUSAGE_DEPTHSTENCIL, D3DRTYPE_TEXTURE, MAKEFOURCC('I','N','T','Z')))) { skip("No INTZ support, skipping INTZ test.\n"); - return; + IDirect3DDevice8_Release(device); + goto done; } - IDirect3D8_Release(d3d8); - hr = IDirect3DDevice8_GetRenderTarget(device, &original_rt); ok(SUCCEEDED(hr), "GetRenderTarget failed, hr %#x.\n", hr); - hr = IDirect3DDevice8_GetDepthStencilSurface(device, &original_ds); - ok(SUCCEEDED(hr), "GetDepthStencilSurface failed, hr %#x.\n", hr); hr = IDirect3DDevice8_CreateTexture(device, 640, 480, 1, D3DUSAGE_DEPTHSTENCIL, MAKEFOURCC('I','N','T','Z'), D3DPOOL_DEFAULT, &texture); @@ -3156,25 +3386,30 @@ hr = IDirect3DDevice8_Present(device, NULL, NULL, NULL, NULL); ok(SUCCEEDED(hr), "Present failed, hr %#x.\n", hr); - hr = IDirect3DDevice8_SetRenderTarget(device, original_rt, original_ds); - ok(SUCCEEDED(hr), "SetRenderTarget failed, hr %#x.\n", hr); - IDirect3DSurface8_Release(original_ds); - hr = IDirect3DDevice8_SetTexture(device, 0, NULL); - ok(SUCCEEDED(hr), "SetTexture failed, hr %#x.\n", hr); - hr = IDirect3DDevice8_SetTexture(device, 1, NULL); - ok(SUCCEEDED(hr), "SetTexture failed, hr %#x.\n", hr); IDirect3DTexture8_Release(texture); - hr = IDirect3DDevice8_SetPixelShader(device, 0); - ok(SUCCEEDED(hr), "SetPixelShader failed, hr %#x.\n", hr); hr = IDirect3DDevice8_DeletePixelShader(device, ps); ok(SUCCEEDED(hr), "DeletePixelShader failed, hr %#x.\n", hr); - IDirect3DSurface8_Release(original_rt); IDirect3DSurface8_Release(rt); + refcount = IDirect3DDevice8_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D8_Release(d3d); + DestroyWindow(window); } -static void shadow_test(IDirect3DDevice8 *device) +static void shadow_test(void) { + IDirect3DSurface8 *original_rt, *rt; + IDirect3DDevice8 *device; + IDirect3D8 *d3d; + ULONG refcount; + D3DCAPS8 caps; + HWND window; + HRESULT hr; + DWORD ps; + UINT i; + static const DWORD ps_code[] = { 0xffff0101, /* ps_1_1 */ @@ -3189,7 +3424,7 @@ 0x40000001, 0x80080000, 0xa0aa0002, /* +mov r0.w, c2.z */ 0x0000ffff, /* end */ }; - struct + static const struct { D3DFORMAT format; const char *name; @@ -3204,7 +3439,7 @@ {D3DFMT_D24X4S4, "D3DFMT_D24X4S4"}, {D3DFMT_D16, "D3DFMT_D16"}, }; - struct + static const struct { float x, y, z; float s0, t0, p0; @@ -3217,7 +3452,7 @@ { -1.0f, -1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f}, { 1.0f, -1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f}, }; - struct + static const struct { UINT x, y; D3DCOLOR color; @@ -3234,27 +3469,27 @@ {240, 60, D3DCOLOR_ARGB(0x00, 0x00, 0x00, 0x00)}, }; - IDirect3DSurface8 *original_ds, *original_rt, *rt; - IDirect3D8 *d3d8; - D3DCAPS8 caps; - HRESULT hr; - DWORD ps; - UINT i; + 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"); + goto done; + } hr = IDirect3DDevice8_GetDeviceCaps(device, &caps); ok(SUCCEEDED(hr), "GetDeviceCaps failed, hr %#x.\n", hr); if (caps.PixelShaderVersion < D3DPS_VERSION(1, 1)) { skip("No pixel shader 1.1 support, skipping shadow test.\n"); - return; + IDirect3DDevice8_Release(device); + goto done; } - hr = IDirect3DDevice8_GetDirect3D(device, &d3d8); - ok(SUCCEEDED(hr), "GetDirect3D failed, hr %#x.\n", hr); hr = IDirect3DDevice8_GetRenderTarget(device, &original_rt); ok(SUCCEEDED(hr), "GetRenderTarget failed, hr %#x.\n", hr); - hr = IDirect3DDevice8_GetDepthStencilSurface(device, &original_ds); - ok(SUCCEEDED(hr), "GetDepthStencilSurface failed, hr %#x.\n", hr); hr = IDirect3DDevice8_CreateRenderTarget(device, 1024, 1024, D3DFMT_A8R8G8B8, D3DMULTISAMPLE_NONE, FALSE, &rt); @@ -3304,9 +3539,9 @@ IDirect3DSurface8 *ds; unsigned int j; - hr = IDirect3D8_CheckDeviceFormat(d3d8, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, D3DFMT_X8R8G8B8, - D3DUSAGE_DEPTHSTENCIL, D3DRTYPE_TEXTURE, format); - if (FAILED(hr)) continue; + if (FAILED(IDirect3D8_CheckDeviceFormat(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, + D3DFMT_X8R8G8B8, D3DUSAGE_DEPTHSTENCIL, D3DRTYPE_TEXTURE, format))) + continue; hr = IDirect3DDevice8_CreateTexture(device, 1024, 1024, 1, D3DUSAGE_DEPTHSTENCIL, format, D3DPOOL_DEFAULT, &texture); @@ -3371,40 +3606,46 @@ ok(SUCCEEDED(hr), "Present failed, hr %#x.\n", hr); } - hr = IDirect3DDevice8_SetPixelShader(device, 0); - ok(SUCCEEDED(hr), "SetPixelShader failed, hr %#x.\n", hr); hr = IDirect3DDevice8_DeletePixelShader(device, ps); ok(SUCCEEDED(hr), "DeletePixelShader failed, hr %#x.\n", hr); - - hr = IDirect3DDevice8_SetRenderTarget(device, original_rt, original_ds); - ok(SUCCEEDED(hr), "SetRenderTarget failed, hr %#x.\n", hr); - IDirect3DSurface8_Release(original_ds); - IDirect3DSurface8_Release(original_rt); IDirect3DSurface8_Release(rt); - - IDirect3D8_Release(d3d8); + refcount = IDirect3DDevice8_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D8_Release(d3d); + DestroyWindow(window); } -static void multisample_copy_rects_test(IDirect3DDevice8 *device) +static void multisample_copy_rects_test(void) { - IDirect3DSurface8 *original_ds, *original_rt, *ds, *ds_plain, *rt, *readback; + IDirect3DSurface8 *ds, *ds_plain, *rt, *readback; RECT src_rect = {64, 64, 128, 128}; POINT dst_point = {96, 96}; D3DLOCKED_RECT locked_rect; - IDirect3D8 *d3d8; + IDirect3DDevice8 *device; + IDirect3D8 *d3d; D3DCOLOR color; + ULONG refcount; + HWND window; HRESULT hr; - hr = IDirect3DDevice8_GetDirect3D(device, &d3d8); - ok(SUCCEEDED(hr), "Failed to get d3d8 interface, hr %#x.\n", hr); - hr = IDirect3D8_CheckDeviceMultiSampleType(d3d8, D3DADAPTER_DEFAULT, - D3DDEVTYPE_HAL, D3DFMT_A8R8G8B8, TRUE, D3DMULTISAMPLE_2_SAMPLES); - IDirect3D8_Release(d3d8); - if (FAILED(hr)) + window = CreateWindowA("static", "d3d8_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + d3d = Direct3DCreate8(D3D_SDK_VERSION); + ok(!!d3d, "Failed to create a D3D object.\n"); + if (!(device = create_device(d3d, window, window, TRUE))) + { + skip("Failed to create a D3D device, skipping tests.\n"); + goto done; + } + + if (FAILED(IDirect3D8_CheckDeviceMultiSampleType(d3d, D3DADAPTER_DEFAULT, + D3DDEVTYPE_HAL, D3DFMT_A8R8G8B8, TRUE, D3DMULTISAMPLE_2_SAMPLES))) { skip("Multisampling not supported for D3DFMT_A8R8G8B8, skipping multisampled CopyRects test.\n"); - return; + IDirect3DDevice8_Release(device); + goto done; } hr = IDirect3DDevice8_CreateRenderTarget(device, 256, 256, D3DFMT_A8R8G8B8, @@ -3419,11 +3660,6 @@ hr = IDirect3DDevice8_CreateImageSurface(device, 256, 256, D3DFMT_A8R8G8B8, &readback); ok(SUCCEEDED(hr), "Failed to create readback surface, hr %#x.\n", hr); - hr = IDirect3DDevice8_GetRenderTarget(device, &original_rt); - ok(SUCCEEDED(hr), "Failed to get render target, hr %#x.\n", hr); - hr = IDirect3DDevice8_GetDepthStencilSurface(device, &original_ds); - ok(SUCCEEDED(hr), "Failed to get depth/stencil, hr %#x.\n", hr); - hr = IDirect3DDevice8_SetRenderTarget(device, rt, ds); ok(SUCCEEDED(hr), "Failed to set render target, hr %#x.\n", hr); @@ -3454,24 +3690,30 @@ hr = IDirect3DSurface8_UnlockRect(readback); ok(SUCCEEDED(hr), "Failed to unlock readback surface, hr %#x.\n", hr); - hr = IDirect3DDevice8_SetRenderTarget(device, original_rt, original_ds); - ok(SUCCEEDED(hr), "Failed to restore original render target, hr %#x.\n", hr); - - IDirect3DSurface8_Release(original_ds); - IDirect3DSurface8_Release(original_rt); IDirect3DSurface8_Release(readback); IDirect3DSurface8_Release(ds_plain); IDirect3DSurface8_Release(ds); IDirect3DSurface8_Release(rt); + refcount = IDirect3DDevice8_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D8_Release(d3d); + DestroyWindow(window); } -static void resz_test(IDirect3DDevice8 *device) +static void resz_test(void) { IDirect3DSurface8 *rt, *original_rt, *ds, *original_ds, *intz_ds; - IDirect3D8 *d3d8; + IDirect3DTexture8 *texture; + IDirect3DDevice8 *device; + IDirect3D8 *d3d; + DWORD ps, value; + unsigned int i; + ULONG refcount; D3DCAPS8 caps; + HWND window; HRESULT hr; - unsigned int i; + static const DWORD ps_code[] = { 0xffff0101, /* ps_1_1 */ @@ -3486,7 +3728,7 @@ 0x40000001, 0x80080000, 0xa0aa0002, /* +mov r0.w, c2.z */ 0x0000ffff, /* end */ }; - struct + static const struct { float x, y, z; float s0, t0, p0; @@ -3499,7 +3741,7 @@ { -1.0f, -1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.5f}, { 1.0f, -1.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.5f}, }; - struct + static const struct { UINT x, y; D3DCOLOR color; @@ -3515,47 +3757,53 @@ {400, 450, D3DCOLOR_ARGB(0x00, 0x9f, 0x40, 0x00)}, {560, 450, D3DCOLOR_ARGB(0x00, 0xdf, 0xbf, 0x00)}, }; - IDirect3DTexture8 *texture; - DWORD ps, value; - hr = IDirect3DDevice8_GetDirect3D(device, &d3d8); - ok(SUCCEEDED(hr), "Failed to get d3d8 interface, hr %#x.\n", hr); - hr = IDirect3D8_CheckDeviceMultiSampleType(d3d8, D3DADAPTER_DEFAULT, - D3DDEVTYPE_HAL, D3DFMT_A8R8G8B8, TRUE, D3DMULTISAMPLE_2_SAMPLES); - if (FAILED(hr)) + window = CreateWindowA("static", "d3d8_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + d3d = Direct3DCreate8(D3D_SDK_VERSION); + ok(!!d3d, "Failed to create a D3D object.\n"); + if (!(device = create_device(d3d, window, window, TRUE))) + { + skip("Failed to create a D3D device, skipping tests.\n"); + goto done; + } + + if (FAILED(IDirect3D8_CheckDeviceMultiSampleType(d3d, D3DADAPTER_DEFAULT, + D3DDEVTYPE_HAL, D3DFMT_A8R8G8B8, TRUE, D3DMULTISAMPLE_2_SAMPLES))) { skip("Multisampling not supported for D3DFMT_A8R8G8B8, skipping RESZ test.\n"); - return; + IDirect3DDevice8_Release(device); + goto done; } - hr = IDirect3D8_CheckDeviceMultiSampleType(d3d8, D3DADAPTER_DEFAULT, - D3DDEVTYPE_HAL, D3DFMT_D24S8, TRUE, D3DMULTISAMPLE_2_SAMPLES); - if (FAILED(hr)) + if (FAILED(IDirect3D8_CheckDeviceMultiSampleType(d3d, D3DADAPTER_DEFAULT, + D3DDEVTYPE_HAL, D3DFMT_D24S8, TRUE, D3DMULTISAMPLE_2_SAMPLES))) { skip("Multisampling not supported for D3DFMT_D24S8, skipping RESZ test.\n"); - return; + IDirect3DDevice8_Release(device); + goto done; } - hr = IDirect3D8_CheckDeviceFormat(d3d8, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, D3DFMT_X8R8G8B8, - D3DUSAGE_DEPTHSTENCIL, D3DRTYPE_TEXTURE, MAKEFOURCC('I','N','T','Z')); - if (FAILED(hr)) + if (FAILED(IDirect3D8_CheckDeviceFormat(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, + D3DFMT_X8R8G8B8, D3DUSAGE_DEPTHSTENCIL, D3DRTYPE_TEXTURE, MAKEFOURCC('I','N','T','Z')))) { skip("No INTZ support, skipping RESZ test.\n"); - return; + IDirect3DDevice8_Release(device); + goto done; } - hr = IDirect3D8_CheckDeviceFormat(d3d8, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, D3DFMT_X8R8G8B8, - D3DUSAGE_RENDERTARGET, D3DRTYPE_SURFACE, MAKEFOURCC('R','E','S','Z')); - if (FAILED(hr)) + if (FAILED(IDirect3D8_CheckDeviceFormat(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, + D3DFMT_X8R8G8B8, D3DUSAGE_RENDERTARGET, D3DRTYPE_SURFACE, MAKEFOURCC('R','E','S','Z')))) { skip("No RESZ support, skipping RESZ test.\n"); - return; + IDirect3DDevice8_Release(device); + goto done; } - IDirect3D8_Release(d3d8); hr = IDirect3DDevice8_GetDeviceCaps(device, &caps); ok(SUCCEEDED(hr), "GetDeviceCaps failed, hr %#x.\n", hr); if (caps.TextureCaps & D3DPTEXTURECAPS_POW2) { skip("No unconditional NP2 texture support, skipping INTZ test.\n"); - return; + IDirect3DDevice8_Release(device); + goto done; } hr = IDirect3DDevice8_GetRenderTarget(device, &original_rt); @@ -3765,24 +4013,32 @@ hr = IDirect3DDevice8_Present(device, NULL, NULL, NULL, NULL); ok(SUCCEEDED(hr), "Present failed (0x%08x)\n", hr); - hr = IDirect3DDevice8_SetRenderTarget(device, original_rt, original_ds); - ok(SUCCEEDED(hr), "Failed to set render target, hr %#x.\n", hr); IDirect3DSurface8_Release(ds); - hr = IDirect3DDevice8_SetTexture(device, 0, NULL); - ok(SUCCEEDED(hr), "SetTexture failed, hr %#x.\n", hr); - hr = IDirect3DDevice8_SetTexture(device, 1, NULL); - ok(SUCCEEDED(hr), "SetTexture failed, hr %#x.\n", hr); IDirect3DTexture8_Release(texture); - hr = IDirect3DDevice8_SetPixelShader(device, 0); - ok(SUCCEEDED(hr), "SetPixelShader failed, hr %#x.\n", hr); hr = IDirect3DDevice8_DeletePixelShader(device, ps); ok(SUCCEEDED(hr), "DeletePixelShader failed, hr %#x.\n", hr); IDirect3DSurface8_Release(original_ds); IDirect3DSurface8_Release(original_rt); + + refcount = IDirect3DDevice8_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D8_Release(d3d); + DestroyWindow(window); } -static void zenable_test(IDirect3DDevice8 *device) +static void zenable_test(void) { + IDirect3DDevice8 *device; + IDirect3D8 *d3d; + D3DCOLOR color; + ULONG refcount; + D3DCAPS8 caps; + HWND window; + HRESULT hr; + UINT x, y; + UINT i, j; + static const struct { struct vec4 position; @@ -3795,11 +4051,16 @@ {{640.0f, 480.0f, 1.5f, 1.0f}, 0xff00ff00}, {{640.0f, 0.0f, 1.5f, 1.0f}, 0xff00ff00}, }; - D3DCOLOR color; - D3DCAPS8 caps; - HRESULT hr; - UINT x, y; - UINT i, j; + + 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"); + goto done; + } hr = IDirect3DDevice8_SetRenderState(device, D3DRS_ZENABLE, D3DZB_FALSE); ok(SUCCEEDED(hr), "Failed to disable z-buffering, hr %#x.\n", hr); @@ -3863,6 +4124,15 @@ 0x00ff0000, 0x00606060, 0x009f609f, 0x00ff0000, 0x00ff0000, 0x00602060, 0x009f209f, 0x00ff0000, }; + /* The Windows 8 testbot (WARP) appears to not clip z for regular + * vertices either. */ + static const D3DCOLOR expected_broken[] = + { + 0x0020df20, 0x0060df60, 0x009fdf9f, 0x00dfdfdf, + 0x00209f20, 0x00609f60, 0x009f9f9f, 0x00df9fdf, + 0x00206020, 0x00606060, 0x009f609f, 0x00df60df, + 0x00202020, 0x00602060, 0x009f209f, 0x00df20df, + }; static const DWORD decl[] = { D3DVSD_STREAM(0), @@ -3896,7 +4166,8 @@ x = 80 * ((2 * j) + 1); y = 60 * ((2 * i) + 1); color = getPixelColor(device, x, y); - ok(color_match(color, expected[i * 4 + j], 1), + ok(color_match(color, expected[i * 4 + j], 1) + || broken(color_match(color, expected_broken[i * 4 + j], 1)), "Expected color 0x%08x at %u, %u, got 0x%08x.\n", expected[i * 4 + j], x, y, color); } } @@ -3904,19 +4175,36 @@ hr = IDirect3DDevice8_Present(device, NULL, NULL, NULL, NULL); ok(SUCCEEDED(hr), "Failed to present backbuffer, hr %#x.\n", hr); - hr = IDirect3DDevice8_SetPixelShader(device, 0); - ok(SUCCEEDED(hr), "Failed to set pixel shader, hr %#x.\n", hr); - hr = IDirect3DDevice8_SetVertexShader(device, 0); - ok(SUCCEEDED(hr), "Failed to set vertex shader, hr %#x.\n", hr); hr = IDirect3DDevice8_DeletePixelShader(device, ps); ok(SUCCEEDED(hr), "Failed to delete pixel shader, hr %#x.\n", hr); hr = IDirect3DDevice8_DeleteVertexShader(device, vs); ok(SUCCEEDED(hr), "Failed to delete vertex shader, hr %#x.\n", hr); } + + refcount = IDirect3DDevice8_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D8_Release(d3d); + DestroyWindow(window); } -static void fog_special_test(IDirect3DDevice8 *device) +static void fog_special_test(void) { + IDirect3DDevice8 *device; + IDirect3D8 *d3d; + unsigned int i; + D3DCOLOR color; + ULONG refcount; + D3DCAPS8 caps; + DWORD ps, vs; + HWND window; + HRESULT hr; + union + { + float f; + DWORD d; + } conv; + static const struct { struct vec3 position; @@ -3925,8 +4213,8 @@ quad[] = { {{ -1.0f, -1.0f, 0.0f}, 0xff00ff00}, - {{ 1.0f, -1.0f, 1.0f}, 0xff00ff00}, {{ -1.0f, 1.0f, 0.0f}, 0xff00ff00}, + {{ 1.0f, -1.0f, 1.0f}, 0xff00ff00}, {{ 1.0f, 1.0f, 1.0f}, 0xff00ff00} }; static const struct @@ -3967,16 +4255,23 @@ 0x00000001, 0xd00f0000, 0x90e40001, /* mov oD0, v1 */ 0x0000ffff }; - union + static const D3DMATRIX identity = + {{{ + 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, + }}}; + + 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))) { - float f; - DWORD d; - } conv; - DWORD color; - HRESULT hr; - unsigned int i; - DWORD ps, vs; - D3DCAPS8 caps; + skip("Failed to create a D3D device, skipping tests.\n"); + goto done; + } hr = IDirect3DDevice8_GetDeviceCaps(device, &caps); ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); @@ -4001,6 +4296,14 @@ ps = 0; } + /* The table fog tests seem to depend on the projection matrix explicitly + * being set to an identity matrix, even though that's the default. + * (AMD Radeon HD 6310, Windows 7) */ + hr = IDirect3DDevice8_SetTransform(device, D3DTS_PROJECTION, &identity); + ok(SUCCEEDED(hr), "Failed to set projection transform, hr %#x.\n", hr); + + hr = IDirect3DDevice8_SetRenderState(device, D3DRS_LIGHTING, FALSE); + ok(SUCCEEDED(hr), "Failed to disable lighting, hr %#x.\n", hr); hr = IDirect3DDevice8_SetRenderState(device, D3DRS_FOGENABLE, TRUE); ok(SUCCEEDED(hr), "Failed to enable fog, hr %#x.\n", hr); hr = IDirect3DDevice8_SetRenderState(device, D3DRS_FOGCOLOR, 0xffff0000); @@ -4014,7 +4317,7 @@ for (i = 0; i < sizeof(tests) / sizeof(*tests); i++) { - hr = IDirect3DDevice8_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff0000ff, 0.0f, 0); + hr = IDirect3DDevice8_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff0000ff, 1.0f, 0); ok(SUCCEEDED(hr), "Failed to clear render target, hr %#x.\n", hr); if (!tests[i].vs) @@ -4070,26 +4373,29 @@ ok(SUCCEEDED(hr), "Failed to present backbuffer, hr %#x.\n", hr); } - hr = IDirect3DDevice8_SetRenderState(device, D3DRS_FOGENABLE, FALSE); - ok(SUCCEEDED(hr), "Failed to disable fog, hr %#x.\n", hr); - hr = IDirect3DDevice8_SetPixelShader(device, 0); - ok(SUCCEEDED(hr), "Failed to set pixel shader, hr %#x.\n", hr); - hr = IDirect3DDevice8_SetVertexShader(device, 0); - ok(SUCCEEDED(hr), "Failed to set vertex shader, hr %#x.\n", hr); if (vs) IDirect3DDevice8_DeleteVertexShader(device, vs); if (ps) IDirect3DDevice8_DeletePixelShader(device, ps); + refcount = IDirect3DDevice8_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D8_Release(d3d); + DestroyWindow(window); } -static void volume_dxt5_test(IDirect3DDevice8 *device) +static void volume_dxt5_test(void) { - HRESULT hr; - IDirect3D8 *d3d8; IDirect3DVolumeTexture8 *texture; + IDirect3DDevice8 *device; D3DLOCKED_BOX box; + IDirect3D8 *d3d; unsigned int i; - DWORD color; + D3DCOLOR color; + ULONG refcount; + HWND window; + HRESULT hr; + static const char texture_data[] = { /* A 8x4x2 texture consisting of 4 4x4 blocks. The colors of the blocks are red, green, blue and white. */ @@ -4106,26 +4412,33 @@ quads[] = { {{ -1.0f, -1.0f, 0.0f}, { 0.0f, 0.0f, 0.25f}}, - {{ 0.0f, -1.0f, 1.0f}, { 1.0f, 0.0f, 0.25f}}, {{ -1.0f, 1.0f, 0.0f}, { 0.0f, 1.0f, 0.25f}}, + {{ 0.0f, -1.0f, 1.0f}, { 1.0f, 0.0f, 0.25f}}, {{ 0.0f, 1.0f, 1.0f}, { 1.0f, 1.0f, 0.25f}}, {{ 0.0f, -1.0f, 0.0f}, { 0.0f, 0.0f, 0.75f}}, - {{ 1.0f, -1.0f, 1.0f}, { 1.0f, 0.0f, 0.75f}}, {{ 0.0f, 1.0f, 0.0f}, { 0.0f, 1.0f, 0.75f}}, + {{ 1.0f, -1.0f, 1.0f}, { 1.0f, 0.0f, 0.75f}}, {{ 1.0f, 1.0f, 1.0f}, { 1.0f, 1.0f, 0.75f}}, }; static const DWORD expected_colors[] = {0x00ff0000, 0x0000ff00, 0x000000ff, 0x00ffffff}; - hr = IDirect3DDevice8_GetDirect3D(device, &d3d8); - ok(SUCCEEDED(hr), "Failed to get d3d8 interface, hr %#x.\n", hr); - hr = IDirect3D8_CheckDeviceFormat(d3d8, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, - D3DFMT_X8R8G8B8, 0, D3DRTYPE_VOLUMETEXTURE, D3DFMT_DXT5); - IDirect3D8_Release(d3d8); - if (FAILED(hr)) - { - skip("Volume dxt5 textures are not supported, skipping test.\n"); - return; + 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"); + goto done; + } + + if (FAILED(IDirect3D8_CheckDeviceFormat(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, + D3DFMT_X8R8G8B8, 0, D3DRTYPE_VOLUMETEXTURE, D3DFMT_DXT5))) + { + skip("Volume DXT5 textures are not supported, skipping test.\n"); + IDirect3DDevice8_Release(device); + goto done; } hr = IDirect3DDevice8_CreateVolumeTexture(device, 8, 4, 2, 1, 0, D3DFMT_DXT5, @@ -4151,7 +4464,7 @@ hr = IDirect3DDevice8_SetTextureStageState(device, 0, D3DTSS_MAGFILTER, D3DTEXF_POINT); ok(SUCCEEDED(hr), "Failed to set mag filter, hr %#x.\n", hr); - hr = IDirect3DDevice8_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0x00ff00ff, 0.0f, 0); + hr = IDirect3DDevice8_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0x00ff00ff, 1.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); @@ -4171,24 +4484,29 @@ "Expected color 0x%08x, got 0x%08x, case %u.\n", expected_colors[i], color, i); } - hr = IDirect3DDevice8_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_DISABLE); - ok(SUCCEEDED(hr), "Failed to set color op, hr %#x.\n", hr); - hr = IDirect3DDevice8_SetTexture(device, 0, NULL); - ok(SUCCEEDED(hr), "Failed to set texture, hr %#x.\n", hr); IDirect3DVolumeTexture8_Release(texture); + refcount = IDirect3DDevice8_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D8_Release(d3d); + DestroyWindow(window); } -static void volume_v16u16_test(IDirect3DDevice8 *device) +static void volume_v16u16_test(void) { - HRESULT hr; - IDirect3D8 *d3d8; IDirect3DVolumeTexture8 *texture; - DWORD shader; + IDirect3DDevice8 *device; D3DLOCKED_BOX box; + IDirect3D8 *d3d; unsigned int i; - DWORD color; - SHORT *texel; + D3DCOLOR color; + ULONG refcount; D3DCAPS8 caps; + DWORD shader; + SHORT *texel; + HWND window; + HRESULT hr; + static const struct { struct vec3 position; @@ -4197,13 +4515,13 @@ quads[] = { {{ -1.0f, -1.0f, 0.0f}, { 0.0f, 0.0f, 0.25f}}, - {{ 0.0f, -1.0f, 1.0f}, { 1.0f, 0.0f, 0.25f}}, {{ -1.0f, 1.0f, 0.0f}, { 0.0f, 1.0f, 0.25f}}, + {{ 0.0f, -1.0f, 1.0f}, { 1.0f, 0.0f, 0.25f}}, {{ 0.0f, 1.0f, 1.0f}, { 1.0f, 1.0f, 0.25f}}, {{ 0.0f, -1.0f, 0.0f}, { 0.0f, 0.0f, 0.75f}}, - {{ 1.0f, -1.0f, 1.0f}, { 1.0f, 0.0f, 0.75f}}, {{ 0.0f, 1.0f, 0.0f}, { 0.0f, 1.0f, 0.75f}}, + {{ 1.0f, -1.0f, 1.0f}, { 1.0f, 0.0f, 0.75f}}, {{ 1.0f, 1.0f, 1.0f}, { 1.0f, 1.0f, 0.75f}}, }; static const DWORD shader_code[] = @@ -4216,22 +4534,30 @@ 0x0000ffff /* end */ }; - hr = IDirect3DDevice8_GetDirect3D(device, &d3d8); - ok(SUCCEEDED(hr), "Failed to get d3d8 interface, hr %#x.\n", hr); - hr = IDirect3D8_CheckDeviceFormat(d3d8, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, - D3DFMT_X8R8G8B8, 0, D3DRTYPE_VOLUMETEXTURE, D3DFMT_V16U16); - IDirect3D8_Release(d3d8); - if (FAILED(hr)) + window = CreateWindowA("static", "d3d8_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + d3d = Direct3DCreate8(D3D_SDK_VERSION); + ok(!!d3d, "Failed to create a D3D object.\n"); + if (!(device = create_device(d3d, window, window, TRUE))) + { + skip("Failed to create a D3D device, skipping tests.\n"); + goto done; + } + + if (FAILED(IDirect3D8_CheckDeviceFormat(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, + D3DFMT_X8R8G8B8, 0, D3DRTYPE_VOLUMETEXTURE, D3DFMT_V16U16))) { skip("Volume V16U16 textures are not supported, skipping test.\n"); - return; + IDirect3DDevice8_Release(device); + goto done; } hr = IDirect3DDevice8_GetDeviceCaps(device, &caps); ok(SUCCEEDED(hr), "Failed to get caps, hr %#x.\n", hr); if (caps.PixelShaderVersion < D3DPS_VERSION(1, 1)) { skip("No pixel shader 1.1 support, skipping test.\n"); - return; + IDirect3DDevice8_Release(device); + goto done; } hr = IDirect3DDevice8_SetVertexShader(device, D3DFVF_XYZ | D3DFVF_TEX1 | D3DFVF_TEXCOORDSIZE3(0)); @@ -4294,7 +4620,7 @@ hr = IDirect3DDevice8_SetTexture(device, 0, (IDirect3DBaseTexture8 *) texture); ok(SUCCEEDED(hr), "Failed to set texture, hr %#x.\n", hr); - hr = IDirect3DDevice8_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0x00ff00ff, 0.0f, 0); + hr = IDirect3DDevice8_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0x00ff00ff, 1.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); @@ -4324,12 +4650,13 @@ IDirect3DVolumeTexture8_Release(texture); } - hr = IDirect3DDevice8_SetPixelShader(device, 0); - ok(SUCCEEDED(hr), "Failed to set pixel shader, hr %#x.\n", hr); hr = IDirect3DDevice8_DeletePixelShader(device, shader); ok(SUCCEEDED(hr), "Failed delete pixel shader, hr %#x.\n", hr); - hr = IDirect3DDevice8_SetTexture(device, 0, NULL); - ok(SUCCEEDED(hr), "Failed to set texture, hr %#x.\n", hr); + refcount = IDirect3DDevice8_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D8_Release(d3d); + DestroyWindow(window); } static void fill_surface(IDirect3DSurface8 *surface, DWORD color, DWORD flags) @@ -4369,10 +4696,10 @@ } quad[] = { - {{-1.0, -1.0, 0.0}, {0.0, 0.0}}, - {{ 1.0, -1.0, 0.0}, {1.0, 0.0}}, - {{-1.0, 1.0, 0.0}, {0.0, 1.0}}, - {{ 1.0, 1.0, 0.0}, {1.0, 1.0}}, + {{-1.0f, -1.0f, 0.0f}, {0.0f, 0.0f}}, + {{-1.0f, 1.0f, 0.0f}, {0.0f, 1.0f}}, + {{ 1.0f, -1.0f, 0.0f}, {1.0f, 0.0f}}, + {{ 1.0f, 1.0f, 0.0f}, {1.0f, 1.0f}}, }; hr = IDirect3DDevice8_BeginScene(device); @@ -4383,16 +4710,31 @@ ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); } -static void add_dirty_rect_test(IDirect3DDevice8 *device) +static void add_dirty_rect_test(void) { - HRESULT hr; - IDirect3DTexture8 *tex_dst1, *tex_dst2, *tex_src_red, *tex_src_green, *tex_managed; IDirect3DSurface8 *surface_dst2, *surface_src_green, *surface_src_red, *surface_managed; + IDirect3DTexture8 *tex_dst1, *tex_dst2, *tex_src_red, *tex_src_green, *tex_managed; + D3DLOCKED_RECT locked_rect; + IDirect3DDevice8 *device; + IDirect3D8 *d3d; unsigned int i; + D3DCOLOR color; + ULONG refcount; DWORD *texel; - D3DLOCKED_RECT locked_rect; + HWND window; + HRESULT hr; + static const RECT part_rect = {96, 96, 160, 160}; - DWORD color; + + 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"); + goto done; + } hr = IDirect3DDevice8_CreateTexture(device, 256, 256, 1, 0, D3DFMT_X8R8G8B8, D3DPOOL_DEFAULT, &tex_dst1); @@ -4668,10 +5010,6 @@ hr = IDirect3DTexture8_AddDirtyRect(tex_managed, NULL); ok(SUCCEEDED(hr), "Failed to add dirty rect, hr %#x.\n", hr); - hr = IDirect3DDevice8_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_DISABLE); - ok(SUCCEEDED(hr), "Failed to set color op, hr %#x.\n", hr); - hr = IDirect3DDevice8_SetTexture(device, 0, NULL); - ok(SUCCEEDED(hr), "Failed to set texture, hr %#x.\n", hr); IDirect3DSurface8_Release(surface_dst2); IDirect3DSurface8_Release(surface_managed); IDirect3DSurface8_Release(surface_src_red); @@ -4681,100 +5019,60 @@ IDirect3DTexture8_Release(tex_dst1); IDirect3DTexture8_Release(tex_dst2); IDirect3DTexture8_Release(tex_managed); + refcount = IDirect3DDevice8_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D8_Release(d3d); + DestroyWindow(window); } START_TEST(visual) { - IDirect3DDevice8 *device_ptr; + D3DADAPTER_IDENTIFIER8 identifier; + IDirect3D8 *d3d; HRESULT hr; - DWORD color; - D3DCAPS8 caps; - if (!(device_ptr = init_d3d8())) + if (!(d3d = Direct3DCreate8(D3D_SDK_VERSION))) { - win_skip("Could not initialize direct3d\n"); + skip("Failed to create D3D8 object.\n"); return; } - IDirect3DDevice8_GetDeviceCaps(device_ptr, &caps); - - /* Check for the reliability of the returned data */ - hr = IDirect3DDevice8_Clear(device_ptr, 0, NULL, D3DCLEAR_TARGET, 0xffff0000, 0.0, 0); - if(FAILED(hr)) - { - skip("Clear failed, can't assure correctness of the test results\n"); - goto cleanup; - } - - color = getPixelColor(device_ptr, 1, 1); - if(color !=0x00ff0000) - { - skip("Sanity check returned an incorrect color(%08x), can't assure the correctness of the tests\n", color); - goto cleanup; - } - IDirect3DDevice8_Present(device_ptr, NULL, NULL, NULL, NULL); - - hr = IDirect3DDevice8_Clear(device_ptr, 0, NULL, D3DCLEAR_TARGET, 0xff00ddee, 0.0, 0); - if(FAILED(hr)) - { - skip("Clear failed, can't assure correctness of the test results\n"); - goto cleanup; - } - - color = getPixelColor(device_ptr, 639, 479); - if(color != 0x0000ddee) - { - skip("Sanity check returned an incorrect color(%08x), can't assure the correctness of the tests\n", color); - goto cleanup; - } - IDirect3DDevice8_Present(device_ptr, NULL, NULL, NULL, NULL); - - /* Now run the real test */ - depth_clamp_test(device_ptr); - lighting_test(device_ptr); - clear_test(device_ptr); - fog_test(device_ptr); - z_range_test(device_ptr); - offscreen_test(device_ptr); - alpha_test(device_ptr); + memset(&identifier, 0, sizeof(identifier)); + hr = IDirect3D8_GetAdapterIdentifier(d3d, D3DADAPTER_DEFAULT, 0, &identifier); + ok(SUCCEEDED(hr), "Failed to get adapter identifier, hr %#x.\n", hr); + trace("Driver string: \"%s\"\n", identifier.Driver); + trace("Description string: \"%s\"\n", identifier.Description); + /* Only Windows XP's default VGA driver should have an empty description */ + ok(identifier.Description[0] || broken(!strcmp(identifier.Driver, "vga.dll")), "Empty driver description.\n"); + trace("Driver version %d.%d.%d.%d\n", + HIWORD(U(identifier.DriverVersion).HighPart), LOWORD(U(identifier.DriverVersion).HighPart), + HIWORD(U(identifier.DriverVersion).LowPart), LOWORD(U(identifier.DriverVersion).LowPart)); - if (caps.VertexShaderVersion >= D3DVS_VERSION(1, 1)) - { - test_scalar_instructions(device_ptr); - if (caps.PixelShaderVersion >= D3DPS_VERSION(1, 1)) - { - fog_with_shader_test(device_ptr); - if (caps.PixelShaderVersion >= D3DPS_VERSION(1, 4)) - cnd_test(device_ptr); - } - } - else - { - skip("No vs.1.1 support\n"); - } + IDirect3D8_Release(d3d); - p8_texture_test(device_ptr); - texop_test(device_ptr); - depth_buffer_test(device_ptr); - depth_buffer2_test(device_ptr); - intz_test(device_ptr); - shadow_test(device_ptr); - multisample_copy_rects_test(device_ptr); - zenable_test(device_ptr); - resz_test(device_ptr); - fog_special_test(device_ptr); - volume_dxt5_test(device_ptr); - volume_v16u16_test(device_ptr); - add_dirty_rect_test(device_ptr); - -cleanup: - if(device_ptr) { - D3DDEVICE_CREATION_PARAMETERS creation_parameters; - ULONG refcount; - - IDirect3DDevice8_GetCreationParameters(device_ptr, &creation_parameters); - DestroyWindow(creation_parameters.hFocusWindow); - refcount = IDirect3DDevice8_Release(device_ptr); - ok(!refcount, "Device has %u references left\n", refcount); - } + test_sanity(); + depth_clamp_test(); + lighting_test(); + clear_test(); + fog_test(); + z_range_test(); + offscreen_test(); + alpha_test(); + test_scalar_instructions(); + fog_with_shader_test(); + cnd_test(); + p8_texture_test(); + texop_test(); + depth_buffer_test(); + depth_buffer2_test(); + intz_test(); + shadow_test(); + multisample_copy_rects_test(); + zenable_test(); + resz_test(); + fog_special_test(); + volume_dxt5_test(); + volume_v16u16_test(); + add_dirty_rect_test(); } diff -Nru wine1.7-1.7.14/dlls/d3d8/texture.c wine1.7-1.7.18/dlls/d3d8/texture.c --- wine1.7-1.7.14/dlls/d3d8/texture.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/d3d8/texture.c 2014-05-02 18:15:48.000000000 +0000 @@ -59,7 +59,7 @@ static ULONG WINAPI d3d8_texture_2d_AddRef(IDirect3DTexture8 *iface) { struct d3d8_texture *texture = impl_from_IDirect3DTexture8(iface); - ULONG ref = InterlockedIncrement(&texture->refcount); + ULONG ref = InterlockedIncrement(&texture->resource.refcount); TRACE("%p increasing refcount to %u.\n", iface, ref); @@ -77,7 +77,7 @@ static ULONG WINAPI d3d8_texture_2d_Release(IDirect3DTexture8 *iface) { struct d3d8_texture *texture = impl_from_IDirect3DTexture8(iface); - ULONG ref = InterlockedDecrement(&texture->refcount); + ULONG ref = InterlockedDecrement(&texture->resource.refcount); TRACE("%p decreasing refcount to %u.\n", iface, ref); @@ -113,52 +113,28 @@ REFGUID guid, const void *data, DWORD data_size, DWORD flags) { struct d3d8_texture *texture = impl_from_IDirect3DTexture8(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s, data %p, data_size %u, flags %#x.\n", iface, debugstr_guid(guid), data, data_size, flags); - wined3d_mutex_lock(); - resource = wined3d_texture_get_resource(texture->wined3d_texture); - hr = wined3d_resource_set_private_data(resource, guid, data, data_size, flags); - wined3d_mutex_unlock(); - - return hr; + return d3d8_resource_set_private_data(&texture->resource, guid, data, data_size, flags); } static HRESULT WINAPI d3d8_texture_2d_GetPrivateData(IDirect3DTexture8 *iface, REFGUID guid, void *data, DWORD *data_size) { struct d3d8_texture *texture = impl_from_IDirect3DTexture8(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s, data %p, data_size %p.\n", iface, debugstr_guid(guid), data, data_size); - wined3d_mutex_lock(); - resource = wined3d_texture_get_resource(texture->wined3d_texture); - hr = wined3d_resource_get_private_data(resource, guid, data, data_size); - wined3d_mutex_unlock(); - - return hr; + return d3d8_resource_get_private_data(&texture->resource, guid, data, data_size); } static HRESULT WINAPI d3d8_texture_2d_FreePrivateData(IDirect3DTexture8 *iface, REFGUID guid) { struct d3d8_texture *texture = impl_from_IDirect3DTexture8(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s.\n", iface, debugstr_guid(guid)); - wined3d_mutex_lock(); - resource = wined3d_texture_get_resource(texture->wined3d_texture); - hr = wined3d_resource_free_private_data(resource, guid); - wined3d_mutex_unlock(); - - return hr; + return d3d8_resource_free_private_data(&texture->resource, guid); } static DWORD WINAPI d3d8_texture_2d_SetPriority(IDirect3DTexture8 *iface, DWORD priority) @@ -427,7 +403,7 @@ static ULONG WINAPI d3d8_texture_cube_AddRef(IDirect3DCubeTexture8 *iface) { struct d3d8_texture *texture = impl_from_IDirect3DCubeTexture8(iface); - ULONG ref = InterlockedIncrement(&texture->refcount); + ULONG ref = InterlockedIncrement(&texture->resource.refcount); TRACE("%p increasing refcount to %u.\n", iface, ref); @@ -445,7 +421,7 @@ static ULONG WINAPI d3d8_texture_cube_Release(IDirect3DCubeTexture8 *iface) { struct d3d8_texture *texture = impl_from_IDirect3DCubeTexture8(iface); - ULONG ref = InterlockedDecrement(&texture->refcount); + ULONG ref = InterlockedDecrement(&texture->resource.refcount); TRACE("%p decreasing refcount to %u.\n", iface, ref); @@ -483,52 +459,28 @@ REFGUID guid, const void *data, DWORD data_size, DWORD flags) { struct d3d8_texture *texture = impl_from_IDirect3DCubeTexture8(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s, data %p, data_size %u, flags %#x.\n", iface, debugstr_guid(guid), data, data_size, flags); - wined3d_mutex_lock(); - resource = wined3d_texture_get_resource(texture->wined3d_texture); - hr = wined3d_resource_set_private_data(resource, guid, data, data_size, flags); - wined3d_mutex_unlock(); - - return hr; + return d3d8_resource_set_private_data(&texture->resource, guid, data, data_size, flags); } static HRESULT WINAPI d3d8_texture_cube_GetPrivateData(IDirect3DCubeTexture8 *iface, REFGUID guid, void *data, DWORD *data_size) { struct d3d8_texture *texture = impl_from_IDirect3DCubeTexture8(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s, data %p, data_size %p.\n", iface, debugstr_guid(guid), data, data_size); - wined3d_mutex_lock(); - resource = wined3d_texture_get_resource(texture->wined3d_texture); - hr = wined3d_resource_get_private_data(resource, guid, data, data_size); - wined3d_mutex_unlock(); - - return hr; + return d3d8_resource_get_private_data(&texture->resource, guid, data, data_size); } static HRESULT WINAPI d3d8_texture_cube_FreePrivateData(IDirect3DCubeTexture8 *iface, REFGUID guid) { struct d3d8_texture *texture = impl_from_IDirect3DCubeTexture8(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s.\n", iface, debugstr_guid(guid)); - wined3d_mutex_lock(); - resource = wined3d_texture_get_resource(texture->wined3d_texture); - hr = wined3d_resource_free_private_data(resource, guid); - wined3d_mutex_unlock(); - - return hr; + return d3d8_resource_free_private_data(&texture->resource, guid); } static DWORD WINAPI d3d8_texture_cube_SetPriority(IDirect3DCubeTexture8 *iface, DWORD priority) @@ -820,7 +772,7 @@ static ULONG WINAPI d3d8_texture_3d_AddRef(IDirect3DVolumeTexture8 *iface) { struct d3d8_texture *texture = impl_from_IDirect3DVolumeTexture8(iface); - ULONG ref = InterlockedIncrement(&texture->refcount); + ULONG ref = InterlockedIncrement(&texture->resource.refcount); TRACE("%p increasing refcount to %u.\n", iface, ref); @@ -838,7 +790,7 @@ static ULONG WINAPI d3d8_texture_3d_Release(IDirect3DVolumeTexture8 *iface) { struct d3d8_texture *texture = impl_from_IDirect3DVolumeTexture8(iface); - ULONG ref = InterlockedDecrement(&texture->refcount); + ULONG ref = InterlockedDecrement(&texture->resource.refcount); TRACE("%p decreasing refcount to %u.\n", iface, ref); @@ -874,52 +826,28 @@ REFGUID guid, const void *data, DWORD data_size, DWORD flags) { struct d3d8_texture *texture = impl_from_IDirect3DVolumeTexture8(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s, data %p, data_size %u, flags %#x.\n", iface, debugstr_guid(guid), data, data_size, flags); - wined3d_mutex_lock(); - resource = wined3d_texture_get_resource(texture->wined3d_texture); - hr = wined3d_resource_set_private_data(resource, guid, data, data_size, flags); - wined3d_mutex_unlock(); - - return hr; + return d3d8_resource_set_private_data(&texture->resource, guid, data, data_size, flags); } static HRESULT WINAPI d3d8_texture_3d_GetPrivateData(IDirect3DVolumeTexture8 *iface, REFGUID guid, void *data, DWORD *data_size) { struct d3d8_texture *texture = impl_from_IDirect3DVolumeTexture8(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s, data %p, data_size %p.\n", iface, debugstr_guid(guid), data, data_size); - wined3d_mutex_lock(); - resource = wined3d_texture_get_resource(texture->wined3d_texture); - hr = wined3d_resource_get_private_data(resource, guid, data, data_size); - wined3d_mutex_unlock(); - - return hr; + return d3d8_resource_get_private_data(&texture->resource, guid, data, data_size); } static HRESULT WINAPI d3d8_texture_3d_FreePrivateData(IDirect3DVolumeTexture8 *iface, REFGUID guid) { struct d3d8_texture *texture = impl_from_IDirect3DVolumeTexture8(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s.\n", iface, debugstr_guid(guid)); - wined3d_mutex_lock(); - resource = wined3d_texture_get_resource(texture->wined3d_texture); - hr = wined3d_resource_free_private_data(resource, guid); - wined3d_mutex_unlock(); - - return hr; + return d3d8_resource_free_private_data(&texture->resource, guid); } static DWORD WINAPI d3d8_texture_3d_SetPriority(IDirect3DVolumeTexture8 *iface, DWORD priority) @@ -1174,7 +1102,9 @@ static void STDMETHODCALLTYPE d3d8_texture_wined3d_object_destroyed(void *parent) { - HeapFree(GetProcessHeap(), 0, parent); + struct d3d8_texture *texture = parent; + d3d8_resource_cleanup(&texture->resource); + HeapFree(GetProcessHeap(), 0, texture); } static const struct wined3d_parent_ops d3d8_texture_wined3d_parent_ops = @@ -1190,7 +1120,7 @@ HRESULT hr; texture->IDirect3DBaseTexture8_iface.lpVtbl = (const IDirect3DBaseTexture8Vtbl *)&Direct3DTexture8_Vtbl; - texture->refcount = 1; + d3d8_resource_init(&texture->resource); desc.resource_type = WINED3D_RTYPE_TEXTURE; desc.format = wined3dformat_from_d3dformat(format); @@ -1231,7 +1161,7 @@ HRESULT hr; texture->IDirect3DBaseTexture8_iface.lpVtbl = (const IDirect3DBaseTexture8Vtbl *)&Direct3DCubeTexture8_Vtbl; - texture->refcount = 1; + d3d8_resource_init(&texture->resource); desc.resource_type = WINED3D_RTYPE_CUBE_TEXTURE; desc.format = wined3dformat_from_d3dformat(format); @@ -1271,7 +1201,7 @@ HRESULT hr; texture->IDirect3DBaseTexture8_iface.lpVtbl = (const IDirect3DBaseTexture8Vtbl *)&Direct3DVolumeTexture8_Vtbl; - texture->refcount = 1; + d3d8_resource_init(&texture->resource); desc.resource_type = WINED3D_RTYPE_VOLUME_TEXTURE; desc.format = wined3dformat_from_d3dformat(format); diff -Nru wine1.7-1.7.14/dlls/d3d8/volume.c wine1.7-1.7.18/dlls/d3d8/volume.c --- wine1.7-1.7.14/dlls/d3d8/volume.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/d3d8/volume.c 2014-05-02 18:15:48.000000000 +0000 @@ -61,7 +61,7 @@ else { /* No container, handle our own refcounting */ - ULONG ref = InterlockedIncrement(&volume->refcount); + ULONG ref = InterlockedIncrement(&volume->resource.refcount); TRACE("%p increasing refcount to %u.\n", iface, ref); @@ -91,7 +91,7 @@ else { /* No container, handle our own refcounting */ - ULONG ref = InterlockedDecrement(&volume->refcount); + ULONG ref = InterlockedDecrement(&volume->resource.refcount); TRACE("%p decreasing refcount to %u.\n", iface, ref); @@ -130,52 +130,28 @@ const void *data, DWORD data_size, DWORD flags) { struct d3d8_volume *volume = impl_from_IDirect3DVolume8(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s, data %p, data_size %u, flags %#x.\n", iface, debugstr_guid(guid), data, data_size, flags); - wined3d_mutex_lock(); - resource = wined3d_volume_get_resource(volume->wined3d_volume); - hr = wined3d_resource_set_private_data(resource, guid, data, data_size, flags); - wined3d_mutex_unlock(); - - return hr; + return d3d8_resource_set_private_data(&volume->resource, guid, data, data_size, flags); } -static HRESULT WINAPI d3d8_volume_GetPrivateData(IDirect3DVolume8 *iface, REFGUID guid, +static HRESULT WINAPI d3d8_volume_GetPrivateData(IDirect3DVolume8 *iface, REFGUID guid, void *data, DWORD *data_size) { struct d3d8_volume *volume = impl_from_IDirect3DVolume8(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s, data %p, data_size %p.\n", iface, debugstr_guid(guid), data, data_size); - wined3d_mutex_lock(); - resource = wined3d_volume_get_resource(volume->wined3d_volume); - hr = wined3d_resource_get_private_data(resource, guid, data, data_size); - wined3d_mutex_unlock(); - - return hr; + return d3d8_resource_get_private_data(&volume->resource, guid, data, data_size); } static HRESULT WINAPI d3d8_volume_FreePrivateData(IDirect3DVolume8 *iface, REFGUID guid) { struct d3d8_volume *volume = impl_from_IDirect3DVolume8(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s.\n", iface, debugstr_guid(guid)); - wined3d_mutex_lock(); - resource = wined3d_volume_get_resource(volume->wined3d_volume); - hr = wined3d_resource_free_private_data(resource, guid); - wined3d_mutex_unlock(); - - return hr; + return d3d8_resource_free_private_data(&volume->resource, guid); } static HRESULT WINAPI d3d8_volume_GetContainer(IDirect3DVolume8 *iface, REFIID riid, void **container) @@ -275,7 +251,9 @@ static void STDMETHODCALLTYPE volume_wined3d_object_destroyed(void *parent) { - HeapFree(GetProcessHeap(), 0, parent); + struct d3d8_volume *volume = parent; + d3d8_resource_cleanup(&volume->resource); + HeapFree(GetProcessHeap(), 0, volume); } static const struct wined3d_parent_ops d3d8_volume_wined3d_parent_ops = @@ -287,7 +265,7 @@ const struct wined3d_parent_ops **parent_ops) { volume->IDirect3DVolume8_iface.lpVtbl = &d3d8_volume_vtbl; - volume->refcount = 1; + d3d8_resource_init(&volume->resource); wined3d_volume_incref(wined3d_volume); volume->wined3d_volume = wined3d_volume; diff -Nru wine1.7-1.7.14/dlls/d3d9/buffer.c wine1.7-1.7.18/dlls/d3d9/buffer.c --- wine1.7-1.7.14/dlls/d3d9/buffer.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/d3d9/buffer.c 2014-05-02 18:15:48.000000000 +0000 @@ -50,7 +50,7 @@ static ULONG WINAPI d3d9_vertexbuffer_AddRef(IDirect3DVertexBuffer9 *iface) { struct d3d9_vertexbuffer *buffer = impl_from_IDirect3DVertexBuffer9(iface); - ULONG refcount = InterlockedIncrement(&buffer->refcount); + ULONG refcount = InterlockedIncrement(&buffer->resource.refcount); TRACE("%p increasing refcount to %u.\n", iface, refcount); @@ -68,7 +68,7 @@ static ULONG WINAPI d3d9_vertexbuffer_Release(IDirect3DVertexBuffer9 *iface) { struct d3d9_vertexbuffer *buffer = impl_from_IDirect3DVertexBuffer9(iface); - ULONG refcount = InterlockedDecrement(&buffer->refcount); + ULONG refcount = InterlockedDecrement(&buffer->resource.refcount); TRACE("%p decreasing refcount to %u.\n", iface, refcount); @@ -105,52 +105,28 @@ REFGUID guid, const void *data, DWORD data_size, DWORD flags) { struct d3d9_vertexbuffer *buffer = impl_from_IDirect3DVertexBuffer9(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s, data %p, data_size %u, flags %#x.\n", iface, debugstr_guid(guid), data, data_size, flags); - wined3d_mutex_lock(); - resource = wined3d_buffer_get_resource(buffer->wined3d_buffer); - hr = wined3d_resource_set_private_data(resource, guid, data, data_size, flags); - wined3d_mutex_unlock(); - - return hr; + return d3d9_resource_set_private_data(&buffer->resource, guid, data, data_size, flags); } static HRESULT WINAPI d3d9_vertexbuffer_GetPrivateData(IDirect3DVertexBuffer9 *iface, REFGUID guid, void *data, DWORD *data_size) { struct d3d9_vertexbuffer *buffer = impl_from_IDirect3DVertexBuffer9(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s, data %p, data_size %p.\n", iface, debugstr_guid(guid), data, data_size); - wined3d_mutex_lock(); - resource = wined3d_buffer_get_resource(buffer->wined3d_buffer); - hr = wined3d_resource_get_private_data(resource, guid, data, data_size); - wined3d_mutex_unlock(); - - return hr; + return d3d9_resource_get_private_data(&buffer->resource, guid, data, data_size); } static HRESULT WINAPI d3d9_vertexbuffer_FreePrivateData(IDirect3DVertexBuffer9 *iface, REFGUID guid) { struct d3d9_vertexbuffer *buffer = impl_from_IDirect3DVertexBuffer9(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s.\n", iface, debugstr_guid(guid)); - wined3d_mutex_lock(); - resource = wined3d_buffer_get_resource(buffer->wined3d_buffer); - hr = wined3d_resource_free_private_data(resource, guid); - wined3d_mutex_unlock(); - - return hr; + return d3d9_resource_free_private_data(&buffer->resource, guid); } static DWORD WINAPI d3d9_vertexbuffer_SetPriority(IDirect3DVertexBuffer9 *iface, DWORD priority) @@ -275,7 +251,9 @@ static void STDMETHODCALLTYPE d3d9_vertexbuffer_wined3d_object_destroyed(void *parent) { - HeapFree(GetProcessHeap(), 0, parent); + struct d3d9_vertexbuffer *buffer = parent; + d3d9_resource_cleanup(&buffer->resource); + HeapFree(GetProcessHeap(), 0, buffer); } static const struct wined3d_parent_ops d3d9_vertexbuffer_wined3d_parent_ops = @@ -289,8 +267,8 @@ HRESULT hr; buffer->IDirect3DVertexBuffer9_iface.lpVtbl = &d3d9_vertexbuffer_vtbl; - buffer->refcount = 1; buffer->fvf = fvf; + d3d9_resource_init(&buffer->resource); wined3d_mutex_lock(); hr = wined3d_buffer_create_vb(device->wined3d_device, size, usage & WINED3DUSAGE_MASK, @@ -344,7 +322,7 @@ static ULONG WINAPI d3d9_indexbuffer_AddRef(IDirect3DIndexBuffer9 *iface) { struct d3d9_indexbuffer *buffer = impl_from_IDirect3DIndexBuffer9(iface); - ULONG refcount = InterlockedIncrement(&buffer->refcount); + ULONG refcount = InterlockedIncrement(&buffer->resource.refcount); TRACE("%p increasing refcount to %u.\n", iface, refcount); @@ -362,7 +340,7 @@ static ULONG WINAPI d3d9_indexbuffer_Release(IDirect3DIndexBuffer9 *iface) { struct d3d9_indexbuffer *buffer = impl_from_IDirect3DIndexBuffer9(iface); - ULONG refcount = InterlockedDecrement(&buffer->refcount); + ULONG refcount = InterlockedDecrement(&buffer->resource.refcount); TRACE("%p decreasing refcount to %u.\n", iface, refcount); @@ -399,52 +377,28 @@ REFGUID guid, const void *data, DWORD data_size, DWORD flags) { struct d3d9_indexbuffer *buffer = impl_from_IDirect3DIndexBuffer9(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s, data %p, data_size %u, flags %#x.\n", iface, debugstr_guid(guid), data, data_size, flags); - wined3d_mutex_lock(); - resource = wined3d_buffer_get_resource(buffer->wined3d_buffer); - hr = wined3d_resource_set_private_data(resource, guid, data, data_size, flags); - wined3d_mutex_unlock(); - - return hr; + return d3d9_resource_set_private_data(&buffer->resource, guid, data, data_size, flags); } static HRESULT WINAPI d3d9_indexbuffer_GetPrivateData(IDirect3DIndexBuffer9 *iface, REFGUID guid, void *data, DWORD *data_size) { struct d3d9_indexbuffer *buffer = impl_from_IDirect3DIndexBuffer9(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s, data %p, data_size %p.\n", iface, debugstr_guid(guid), data, data_size); - wined3d_mutex_lock(); - resource = wined3d_buffer_get_resource(buffer->wined3d_buffer); - hr = wined3d_resource_get_private_data(resource, guid, data, data_size); - wined3d_mutex_unlock(); - - return hr; + return d3d9_resource_get_private_data(&buffer->resource, guid, data, data_size); } static HRESULT WINAPI d3d9_indexbuffer_FreePrivateData(IDirect3DIndexBuffer9 *iface, REFGUID guid) { struct d3d9_indexbuffer *buffer = impl_from_IDirect3DIndexBuffer9(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s.\n", iface, debugstr_guid(guid)); - wined3d_mutex_lock(); - resource = wined3d_buffer_get_resource(buffer->wined3d_buffer); - hr = wined3d_resource_free_private_data(resource, guid); - wined3d_mutex_unlock(); - - return hr; + return d3d9_resource_free_private_data(&buffer->resource, guid); } static DWORD WINAPI d3d9_indexbuffer_SetPriority(IDirect3DIndexBuffer9 *iface, DWORD priority) @@ -567,7 +521,9 @@ static void STDMETHODCALLTYPE d3d9_indexbuffer_wined3d_object_destroyed(void *parent) { - HeapFree(GetProcessHeap(), 0, parent); + struct d3d9_indexbuffer *buffer = parent; + d3d9_resource_cleanup(&buffer->resource); + HeapFree(GetProcessHeap(), 0, buffer); } static const struct wined3d_parent_ops d3d9_indexbuffer_wined3d_parent_ops = @@ -581,8 +537,8 @@ HRESULT hr; buffer->IDirect3DIndexBuffer9_iface.lpVtbl = &d3d9_indexbuffer_vtbl; - buffer->refcount = 1; buffer->format = wined3dformat_from_d3dformat(format); + d3d9_resource_init(&buffer->resource); wined3d_mutex_lock(); hr = wined3d_buffer_create_ib(device->wined3d_device, size, usage & WINED3DUSAGE_MASK, diff -Nru wine1.7-1.7.14/dlls/d3d9/d3d9_main.c wine1.7-1.7.18/dlls/d3d9/d3d9_main.c --- wine1.7-1.7.14/dlls/d3d9/d3d9_main.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/d3d9/d3d9_main.c 2014-05-02 18:15:48.000000000 +0000 @@ -162,3 +162,81 @@ { FIXME("color 0x%08x, name %s stub!\n", color, debugstr_w(name)); } + +void d3d9_resource_cleanup(struct d3d9_resource *resource) +{ + wined3d_private_store_cleanup(&resource->private_store); +} + +HRESULT d3d9_resource_free_private_data(struct d3d9_resource *resource, const GUID *guid) +{ + struct wined3d_private_data *entry; + + wined3d_mutex_lock(); + entry = wined3d_private_store_get_private_data(&resource->private_store, guid); + if (!entry) + { + wined3d_mutex_unlock(); + return D3DERR_NOTFOUND; + } + + wined3d_private_store_free_private_data(&resource->private_store, entry); + wined3d_mutex_unlock(); + + return D3D_OK; +} + +HRESULT d3d9_resource_get_private_data(struct d3d9_resource *resource, const GUID *guid, + void *data, DWORD *data_size) +{ + const struct wined3d_private_data *stored_data; + DWORD size_in; + HRESULT hr; + + wined3d_mutex_lock(); + stored_data = wined3d_private_store_get_private_data(&resource->private_store, guid); + if (!stored_data) + { + hr = D3DERR_NOTFOUND; + goto done; + } + + size_in = *data_size; + *data_size = stored_data->size; + if (!data) + { + hr = D3D_OK; + goto done; + } + if (size_in < stored_data->size) + { + hr = D3DERR_MOREDATA; + goto done; + } + + if (stored_data->flags & WINED3DSPD_IUNKNOWN) + IUnknown_AddRef(stored_data->content.object); + memcpy(data, stored_data->content.data, stored_data->size); + hr = D3D_OK; + +done: + wined3d_mutex_unlock(); + return hr; +} + +void d3d9_resource_init(struct d3d9_resource *resource) +{ + resource->refcount = 1; + wined3d_private_store_init(&resource->private_store); +} + +HRESULT d3d9_resource_set_private_data(struct d3d9_resource *resource, const GUID *guid, + const void *data, DWORD data_size, DWORD flags) +{ + HRESULT hr; + + wined3d_mutex_lock(); + hr = wined3d_private_store_set_private_data(&resource->private_store, guid, data, data_size, flags); + wined3d_mutex_unlock(); + return hr; +} diff -Nru wine1.7-1.7.14/dlls/d3d9/d3d9_private.h wine1.7-1.7.18/dlls/d3d9/d3d9_private.h --- wine1.7-1.7.14/dlls/d3d9/d3d9_private.h 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/d3d9/d3d9_private.h 2014-05-02 18:15:48.000000000 +0000 @@ -166,10 +166,24 @@ UINT adapter, D3DDEVTYPE device_type, HWND focus_window, DWORD flags, D3DPRESENT_PARAMETERS *parameters, D3DDISPLAYMODEEX *mode) DECLSPEC_HIDDEN; +struct d3d9_resource +{ + LONG refcount; + struct wined3d_private_store private_store; +}; + +void d3d9_resource_cleanup(struct d3d9_resource *resource) DECLSPEC_HIDDEN; +HRESULT d3d9_resource_free_private_data(struct d3d9_resource *resource, const GUID *guid) DECLSPEC_HIDDEN; +HRESULT d3d9_resource_get_private_data(struct d3d9_resource *resource, const GUID *guid, + void *data, DWORD *data_size) DECLSPEC_HIDDEN; +void d3d9_resource_init(struct d3d9_resource *resource) DECLSPEC_HIDDEN; +HRESULT d3d9_resource_set_private_data(struct d3d9_resource *resource, const GUID *guid, + const void *data, DWORD data_size, DWORD flags) DECLSPEC_HIDDEN; + struct d3d9_volume { IDirect3DVolume9 IDirect3DVolume9_iface; - LONG refcount; + struct d3d9_resource resource; struct wined3d_volume *wined3d_volume; IUnknown *container; IUnknown *forwardReference; @@ -192,7 +206,7 @@ struct d3d9_surface { IDirect3DSurface9 IDirect3DSurface9_iface; - LONG refcount; + struct d3d9_resource resource; struct wined3d_surface *wined3d_surface; IDirect3DDevice9Ex *parent_device; IUnknown *container; @@ -207,7 +221,7 @@ struct d3d9_vertexbuffer { IDirect3DVertexBuffer9 IDirect3DVertexBuffer9_iface; - LONG refcount; + struct d3d9_resource resource; struct wined3d_buffer *wined3d_buffer; IDirect3DDevice9Ex *parent_device; DWORD fvf; @@ -220,7 +234,7 @@ struct d3d9_indexbuffer { IDirect3DIndexBuffer9 IDirect3DIndexBuffer9_iface; - LONG refcount; + struct d3d9_resource resource; struct wined3d_buffer *wined3d_buffer; IDirect3DDevice9Ex *parent_device; enum wined3d_format_id format; @@ -233,7 +247,7 @@ struct d3d9_texture { IDirect3DBaseTexture9 IDirect3DBaseTexture9_iface; - LONG refcount; + struct d3d9_resource resource; struct wined3d_texture *wined3d_texture; IDirect3DDevice9Ex *parent_device; }; diff -Nru wine1.7-1.7.14/dlls/d3d9/device.c wine1.7-1.7.18/dlls/d3d9/device.c --- wine1.7-1.7.14/dlls/d3d9/device.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/d3d9/device.c 2014-05-02 18:15:48.000000000 +0000 @@ -581,7 +581,7 @@ } surface = wined3d_resource_get_parent(resource); - if (surface->refcount) + if (surface->resource.refcount) { WARN("Surface %p (resource %p) in pool D3DPOOL_DEFAULT blocks the Reset call.\n", surface, resource); return D3DERR_INVALIDCALL; diff -Nru wine1.7-1.7.14/dlls/d3d9/directx.c wine1.7-1.7.18/dlls/d3d9/directx.c --- wine1.7-1.7.14/dlls/d3d9/directx.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/d3d9/directx.c 2014-05-02 18:15:48.000000000 +0000 @@ -644,7 +644,7 @@ d3d9->refcount = 1; wined3d_mutex_lock(); - d3d9->wined3d = wined3d_create(9, flags); + d3d9->wined3d = wined3d_create(flags); wined3d_mutex_unlock(); if (!d3d9->wined3d) return FALSE; diff -Nru wine1.7-1.7.14/dlls/d3d9/query.c wine1.7-1.7.18/dlls/d3d9/query.c --- wine1.7-1.7.14/dlls/d3d9/query.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/d3d9/query.c 2014-05-02 18:15:48.000000000 +0000 @@ -108,12 +108,17 @@ static DWORD WINAPI d3d9_query_GetDataSize(IDirect3DQuery9 *iface) { struct d3d9_query *query = impl_from_IDirect3DQuery9(iface); + enum wined3d_query_type type; DWORD ret; TRACE("iface %p.\n", iface); wined3d_mutex_lock(); - ret = wined3d_query_get_data_size(query->wined3d_query); + type = wined3d_query_get_type(query->wined3d_query); + if (type == WINED3D_QUERY_TYPE_TIMESTAMP_DISJOINT) + ret = sizeof(BOOL); + else + ret = wined3d_query_get_data_size(query->wined3d_query); wined3d_mutex_unlock(); return ret; @@ -136,13 +141,25 @@ static HRESULT WINAPI d3d9_query_GetData(IDirect3DQuery9 *iface, void *data, DWORD size, DWORD flags) { struct d3d9_query *query = impl_from_IDirect3DQuery9(iface); + enum wined3d_query_type type; HRESULT hr; TRACE("iface %p, data %p, size %u, flags %#x.\n", iface, data, size, flags); wined3d_mutex_lock(); - hr = wined3d_query_get_data(query->wined3d_query, data, size, flags); + type = wined3d_query_get_type(query->wined3d_query); + if (type == WINED3D_QUERY_TYPE_TIMESTAMP_DISJOINT && data) + { + struct wined3d_query_data_timestamp_disjoint data_disjoint; + + hr = wined3d_query_get_data(query->wined3d_query, &data_disjoint, sizeof(data_disjoint), flags); + *(BOOL *)data = data_disjoint.disjoint; + } + else + { + hr = wined3d_query_get_data(query->wined3d_query, data, size, flags); + } wined3d_mutex_unlock(); return hr; diff -Nru wine1.7-1.7.14/dlls/d3d9/surface.c wine1.7-1.7.18/dlls/d3d9/surface.c --- wine1.7-1.7.14/dlls/d3d9/surface.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/d3d9/surface.c 2014-05-02 18:15:48.000000000 +0000 @@ -61,7 +61,7 @@ return IUnknown_AddRef(surface->forwardReference); } - refcount = InterlockedIncrement(&surface->refcount); + refcount = InterlockedIncrement(&surface->resource.refcount); TRACE("%p increasing refcount to %u.\n", iface, refcount); if (refcount == 1) @@ -89,7 +89,7 @@ return IUnknown_Release(surface->forwardReference); } - refcount = InterlockedDecrement(&surface->refcount); + refcount = InterlockedDecrement(&surface->resource.refcount); TRACE("%p decreasing refcount to %u.\n", iface, refcount); if (!refcount) @@ -143,52 +143,28 @@ const void *data, DWORD data_size, DWORD flags) { struct d3d9_surface *surface = impl_from_IDirect3DSurface9(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s, data %p, data_size %u, flags %#x.\n", iface, debugstr_guid(guid), data, data_size, flags); - wined3d_mutex_lock(); - resource = wined3d_surface_get_resource(surface->wined3d_surface); - hr = wined3d_resource_set_private_data(resource, guid, data, data_size, flags); - wined3d_mutex_unlock(); - - return hr; + return d3d9_resource_set_private_data(&surface->resource, guid, data, data_size, flags); } static HRESULT WINAPI d3d9_surface_GetPrivateData(IDirect3DSurface9 *iface, REFGUID guid, void *data, DWORD *data_size) { struct d3d9_surface *surface = impl_from_IDirect3DSurface9(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s, data %p, data_size %p.\n", iface, debugstr_guid(guid), data, data_size); - wined3d_mutex_lock(); - resource = wined3d_surface_get_resource(surface->wined3d_surface); - hr = wined3d_resource_get_private_data(resource, guid, data, data_size); - wined3d_mutex_unlock(); - - return hr; + return d3d9_resource_get_private_data(&surface->resource, guid, data, data_size); } static HRESULT WINAPI d3d9_surface_FreePrivateData(IDirect3DSurface9 *iface, REFGUID guid) { struct d3d9_surface *surface = impl_from_IDirect3DSurface9(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s.\n", iface, debugstr_guid(guid)); - wined3d_mutex_lock(); - resource = wined3d_surface_get_resource(surface->wined3d_surface); - hr = wined3d_resource_free_private_data(resource, guid); - wined3d_mutex_unlock(); - - return hr; + return d3d9_resource_free_private_data(&surface->resource, guid); } static DWORD WINAPI d3d9_surface_SetPriority(IDirect3DSurface9 *iface, DWORD priority) @@ -385,7 +361,9 @@ static void STDMETHODCALLTYPE surface_wined3d_object_destroyed(void *parent) { - HeapFree(GetProcessHeap(), 0, parent); + struct d3d9_surface *surface = parent; + d3d9_resource_cleanup(&surface->resource); + HeapFree(GetProcessHeap(), 0, surface); } static const struct wined3d_parent_ops d3d9_surface_wined3d_parent_ops = @@ -399,7 +377,7 @@ struct wined3d_resource_desc desc; surface->IDirect3DSurface9_iface.lpVtbl = &d3d9_surface_vtbl; - surface->refcount = 1; + d3d9_resource_init(&surface->resource); wined3d_resource_get_desc(wined3d_surface_get_resource(wined3d_surface), &desc); switch (d3dformat_from_wined3dformat(desc.format)) diff -Nru wine1.7-1.7.14/dlls/d3d9/tests/device.c wine1.7-1.7.18/dlls/d3d9/tests/device.c --- wine1.7-1.7.14/dlls/d3d9/tests/device.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/d3d9/tests/device.c 2014-05-02 18:15:48.000000000 +0000 @@ -1,9 +1,10 @@ /* + * Copyright (C) 2006 Ivan Gyurdiev * Copyright (C) 2006 Vitaliy Margolen * Copyright (C) 2006 Chris Robinson * Copyright 2006-2008, 2010-2011, 2013 Stefan Dösinger for CodeWeavers * Copyright 2005, 2006, 2007 Henri Verbeet - * Copyright 2013 Henri Verbeet for CodeWeavers + * Copyright 2013-2014 Henri Verbeet for CodeWeavers * Copyright (C) 2008 Rico Schüller * * This library is free software; you can redistribute it and/or @@ -59,6 +60,42 @@ return IUnknown_Release( object ); } +static BOOL compare_elements(IDirect3DVertexDeclaration9 *declaration, const D3DVERTEXELEMENT9 *expected_elements) +{ + unsigned int element_count, i; + D3DVERTEXELEMENT9 *elements; + BOOL equal = TRUE; + HRESULT hr; + + hr = IDirect3DVertexDeclaration9_GetDeclaration(declaration, NULL, &element_count); + ok(SUCCEEDED(hr), "Failed to get declaration, hr %#x.\n", hr); + elements = HeapAlloc(GetProcessHeap(), 0, element_count * sizeof(*elements)); + hr = IDirect3DVertexDeclaration9_GetDeclaration(declaration, elements, &element_count); + ok(SUCCEEDED(hr), "Failed to get declaration, hr %#x.\n", hr); + + for (i = 0; i < element_count; ++i) + { + if (memcmp(&elements[i], &expected_elements[i], sizeof(*elements))) + { + equal = FALSE; + break; + } + } + + if (!equal) + { + for (i = 0; i < element_count; ++i) + { + trace("[Element %u] stream %u, offset %u, type %#x, method %#x, usage %#x, usage index %u.\n", + i, elements[i].Stream, elements[i].Offset, elements[i].Type, + elements[i].Method, elements[i].Usage, elements[i].UsageIndex); + } + } + + HeapFree(GetProcessHeap(), 0, elements); + return equal; +} + /* try to make sure pending X events have been processed before continuing */ static void flush_events(void) { @@ -165,6 +202,712 @@ if (container_ptr && container_ptr != (void *)0x1337c0d3) IUnknown_Release((IUnknown *)container_ptr); \ } +static void test_get_set_vertex_declaration(void) +{ + IDirect3DVertexDeclaration9 *declaration, *tmp; + ULONG refcount, expected_refcount; + IDirect3DDevice9 *device; + IDirect3D9 *d3d; + HWND window; + HRESULT hr; + + static const D3DVERTEXELEMENT9 simple_decl[] = + { + {0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, + D3DDECL_END() + }; + + window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + d3d = Direct3DCreate9(D3D_SDK_VERSION); + ok(!!d3d, "Failed to create a D3D object.\n"); + if (!(device = create_device(d3d, window, window, TRUE))) + { + skip("Failed to create a D3D device, skipping tests.\n"); + goto done; + } + + hr = IDirect3DDevice9_CreateVertexDeclaration(device, simple_decl, &declaration); + ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + + /* SetVertexDeclaration() should not touch the declaration's refcount. */ + expected_refcount = get_refcount((IUnknown *)declaration); + hr = IDirect3DDevice9_SetVertexDeclaration(device, declaration); + ok(SUCCEEDED(hr), "Failed to set vertex declaration, hr %#x.\n", hr); + refcount = get_refcount((IUnknown *)declaration); + ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount); + + /* GetVertexDeclaration() should increase the declaration's refcount by one. */ + tmp = NULL; + expected_refcount = refcount + 1; + hr = IDirect3DDevice9_GetVertexDeclaration(device, &tmp); + ok(SUCCEEDED(hr), "Failed to get vertex declaration, hr %#x.\n", hr); + ok(tmp == declaration, "Got unexpected declaration %p, expected %p.\n", tmp, declaration); + refcount = get_refcount((IUnknown *)declaration); + ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount); + IDirect3DVertexDeclaration9_Release(tmp); + + IDirect3DVertexDeclaration9_Release(declaration); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); +} + +static void test_get_declaration(void) +{ + unsigned int element_count, expected_element_count; + IDirect3DVertexDeclaration9 *declaration; + D3DVERTEXELEMENT9 *elements; + IDirect3DDevice9 *device; + IDirect3D9 *d3d; + ULONG refcount; + HWND window; + HRESULT hr; + + static const D3DVERTEXELEMENT9 simple_decl[] = + { + {0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, + D3DDECL_END() + }; + + window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + d3d = Direct3DCreate9(D3D_SDK_VERSION); + ok(!!d3d, "Failed to create a D3D object.\n"); + if (!(device = create_device(d3d, window, window, TRUE))) + { + skip("Failed to create a D3D device, skipping tests.\n"); + goto done; + } + + hr = IDirect3DDevice9_CreateVertexDeclaration(device, simple_decl, &declaration); + ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + + /* First test only getting the number of elements. */ + element_count = 0x1337c0de; + expected_element_count = sizeof(simple_decl) / sizeof(*simple_decl); + hr = IDirect3DVertexDeclaration9_GetDeclaration(declaration, NULL, &element_count); + ok(SUCCEEDED(hr), "Failed to get declaration, hr %#x.\n", hr); + ok(element_count == expected_element_count, "Got unexpected element count %u, expected %u.\n", + element_count, expected_element_count); + + element_count = 0; + hr = IDirect3DVertexDeclaration9_GetDeclaration(declaration, NULL, &element_count); + ok(SUCCEEDED(hr), "Failed to get declaration, hr %#x.\n", hr); + ok(element_count == expected_element_count, "Got unexpected element count %u, expected %u.\n", + element_count, expected_element_count); + + /* Also test the returned data. */ + elements = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(simple_decl)); + + element_count = 0x1337c0de; + hr = IDirect3DVertexDeclaration9_GetDeclaration(declaration, elements, &element_count); + ok(SUCCEEDED(hr), "Failed to get declaration, hr %#x.\n", hr); + ok(element_count == expected_element_count, "Got unexpected element count %u, expected %u.\n", + element_count, expected_element_count); + ok(!memcmp(elements, simple_decl, element_count * sizeof(*elements)), + "Original and returned vertexdeclarations are not the same.\n"); + + memset(elements, 0, sizeof(simple_decl)); + + element_count = 0; + hr = IDirect3DVertexDeclaration9_GetDeclaration(declaration, elements, &element_count); + ok(SUCCEEDED(hr), "Failed to get declaration, hr %#x.\n", hr); + ok(element_count == expected_element_count, "Got unexpected element count %u, expected %u.\n", + element_count, expected_element_count); + ok(!memcmp(elements, simple_decl, element_count * sizeof(*elements)), + "Original and returned vertexdeclarations are not the same.\n"); + + HeapFree(GetProcessHeap(), 0, elements); + IDirect3DVertexDeclaration9_Release(declaration); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); +} + +static void test_fvf_decl_conversion(void) +{ + IDirect3DVertexDeclaration9 *default_decl; + IDirect3DVertexDeclaration9 *declaration; + IDirect3DDevice9 *device; + IDirect3D9 *d3d; + ULONG refcount; + unsigned int i; + HWND window; + HRESULT hr; + + static const D3DVERTEXELEMENT9 default_elements[] = + { + {0, 0, D3DDECLTYPE_D3DCOLOR, 0, D3DDECLUSAGE_COLOR, 0}, + {0, 4, D3DDECLTYPE_D3DCOLOR, 0, D3DDECLUSAGE_COLOR, 1}, + D3DDECL_END() + }; + /* Test conversions from vertex declaration to an FVF. For some reason + * those seem to occur only for POSITION/POSITIONT, otherwise the FVF is + * forced to 0 - maybe this is configuration specific. */ + static const struct + { + D3DVERTEXELEMENT9 elements[7]; + DWORD fvf; + BOOL todo; + } + decl_to_fvf_tests[] = + { + {{{0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0}, D3DDECL_END()}, D3DFVF_XYZ, TRUE }, + {{{0, 0, D3DDECLTYPE_FLOAT4, 0, D3DDECLUSAGE_POSITIONT, 0}, D3DDECL_END()}, D3DFVF_XYZRHW, TRUE }, + {{{0, 0, D3DDECLTYPE_FLOAT1, 0, D3DDECLUSAGE_BLENDWEIGHT, 0}, D3DDECL_END()}, 0, FALSE}, + {{{0, 0, D3DDECLTYPE_FLOAT2, 0, D3DDECLUSAGE_BLENDWEIGHT, 0}, D3DDECL_END()}, 0, FALSE}, + {{{0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_BLENDWEIGHT, 0}, D3DDECL_END()}, 0, FALSE}, + {{{0, 0, D3DDECLTYPE_FLOAT4, 0, D3DDECLUSAGE_BLENDWEIGHT, 0}, D3DDECL_END()}, 0, FALSE}, + {{{0, 0, D3DDECLTYPE_UBYTE4, 0, D3DDECLUSAGE_BLENDINDICES, 0}, D3DDECL_END()}, 0, FALSE}, + {{{0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_NORMAL, 0}, D3DDECL_END()}, 0, FALSE}, + {{{0, 0, D3DDECLTYPE_FLOAT1, 0, D3DDECLUSAGE_PSIZE, 0}, D3DDECL_END()}, 0, FALSE}, + {{{0, 0, D3DDECLTYPE_D3DCOLOR, 0, D3DDECLUSAGE_COLOR, 0}, D3DDECL_END()}, 0, FALSE}, + {{{0, 0, D3DDECLTYPE_D3DCOLOR, 0, D3DDECLUSAGE_COLOR, 1}, D3DDECL_END()}, 0, FALSE}, + /* No FVF mapping available. */ + {{{0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 1}, D3DDECL_END()}, 0, FALSE}, + {{{0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_NORMAL, 1}, D3DDECL_END()}, 0, FALSE}, + /* Try empty declaration. */ + {{ D3DDECL_END()}, 0, FALSE}, + /* Make sure textures of different sizes work. */ + {{{0, 0, D3DDECLTYPE_FLOAT1, 0, D3DDECLUSAGE_TEXCOORD, 0}, D3DDECL_END()}, 0, FALSE}, + {{{0, 0, D3DDECLTYPE_FLOAT2, 0, D3DDECLUSAGE_TEXCOORD, 0}, D3DDECL_END()}, 0, FALSE}, + {{{0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_TEXCOORD, 0}, D3DDECL_END()}, 0, FALSE}, + {{{0, 0, D3DDECLTYPE_FLOAT4, 0, D3DDECLUSAGE_TEXCOORD, 0}, D3DDECL_END()}, 0, FALSE}, + /* Make sure the TEXCOORD index works correctly - try several textures. */ + { + { + {0, 0, D3DDECLTYPE_FLOAT1, 0, D3DDECLUSAGE_TEXCOORD, 0}, + {0, 4, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_TEXCOORD, 1}, + {0, 16, D3DDECLTYPE_FLOAT2, 0, D3DDECLUSAGE_TEXCOORD, 2}, + {0, 24, D3DDECLTYPE_FLOAT4, 0, D3DDECLUSAGE_TEXCOORD, 3}, + D3DDECL_END(), + }, 0, FALSE, + }, + /* Now try a combination test. */ + { + { + {0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITIONT, 0}, + {0, 12, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_NORMAL, 0}, + {0, 24, D3DDECLTYPE_FLOAT1, 0, D3DDECLUSAGE_PSIZE, 0}, + {0, 28, D3DDECLTYPE_D3DCOLOR, 0, D3DDECLUSAGE_COLOR, 1}, + {0, 32, D3DDECLTYPE_FLOAT1, 0, D3DDECLUSAGE_TEXCOORD, 0}, + {0, 44, D3DDECLTYPE_FLOAT4, 0, D3DDECLUSAGE_TEXCOORD, 1}, + D3DDECL_END(), + }, 0, FALSE, + }, + }; + /* Test conversions from FVF to a vertex declaration. These seem to always + * occur internally. A new declaration object is created if necessary. */ + static const struct + { + DWORD fvf; + D3DVERTEXELEMENT9 elements[7]; + } + fvf_to_decl_tests[] = + { + {D3DFVF_XYZ, {{0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0}, D3DDECL_END()}}, + {D3DFVF_XYZW, {{0, 0, D3DDECLTYPE_FLOAT4, 0, D3DDECLUSAGE_POSITION, 0}, D3DDECL_END()}}, + {D3DFVF_XYZRHW, {{0, 0, D3DDECLTYPE_FLOAT4, 0, D3DDECLUSAGE_POSITIONT, 0}, D3DDECL_END()}}, + { + D3DFVF_XYZB5, + { + {0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0}, + {0, 12, D3DDECLTYPE_FLOAT4, 0, D3DDECLUSAGE_BLENDWEIGHT, 0}, + {0, 28, D3DDECLTYPE_FLOAT1, 0, D3DDECLUSAGE_BLENDINDICES, 0}, + D3DDECL_END(), + }, + }, + { + D3DFVF_XYZB5 | D3DFVF_LASTBETA_UBYTE4, + { + {0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0}, + {0, 12, D3DDECLTYPE_FLOAT4, 0, D3DDECLUSAGE_BLENDWEIGHT, 0}, + {0, 28, D3DDECLTYPE_UBYTE4, 0, D3DDECLUSAGE_BLENDINDICES, 0}, + D3DDECL_END(), + }, + }, + { + D3DFVF_XYZB5 | D3DFVF_LASTBETA_D3DCOLOR, + { + {0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0}, + {0, 12, D3DDECLTYPE_FLOAT4, 0, D3DDECLUSAGE_BLENDWEIGHT, 0}, + {0, 28, D3DDECLTYPE_D3DCOLOR, 0, D3DDECLUSAGE_BLENDINDICES, 0}, + D3DDECL_END(), + }, + }, + { + D3DFVF_XYZB1, + { + {0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0}, + {0, 12, D3DDECLTYPE_FLOAT1, 0, D3DDECLUSAGE_BLENDWEIGHT, 0}, + D3DDECL_END(), + }, + }, + { + D3DFVF_XYZB1 | D3DFVF_LASTBETA_UBYTE4, + { + {0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0}, + {0, 12, D3DDECLTYPE_UBYTE4, 0, D3DDECLUSAGE_BLENDINDICES, 0}, + D3DDECL_END(), + }, + }, + { + D3DFVF_XYZB1 | D3DFVF_LASTBETA_D3DCOLOR, + { + {0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0}, + {0, 12, D3DDECLTYPE_D3DCOLOR, 0, D3DDECLUSAGE_BLENDINDICES, 0}, + D3DDECL_END(), + }, + }, + { + D3DFVF_XYZB2, + { + {0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0}, + {0, 12, D3DDECLTYPE_FLOAT2, 0, D3DDECLUSAGE_BLENDWEIGHT, 0}, + D3DDECL_END(), + }, + }, + { + D3DFVF_XYZB2 | D3DFVF_LASTBETA_UBYTE4, + { + {0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0}, + {0, 12, D3DDECLTYPE_FLOAT1, 0, D3DDECLUSAGE_BLENDWEIGHT, 0}, + {0, 16, D3DDECLTYPE_UBYTE4, 0, D3DDECLUSAGE_BLENDINDICES, 0}, + D3DDECL_END(), + }, + }, + { + D3DFVF_XYZB2 | D3DFVF_LASTBETA_D3DCOLOR, + { + {0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0}, + {0, 12, D3DDECLTYPE_D3DCOLOR, 0, D3DDECLUSAGE_BLENDWEIGHT, 0}, + {0, 16, D3DDECLTYPE_UBYTE4, 0, D3DDECLUSAGE_BLENDINDICES, 0}, + D3DDECL_END(), + }, + }, + { + D3DFVF_XYZB3, + { + {0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0}, + {0, 12, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_BLENDWEIGHT, 0}, + D3DDECL_END(), + }, + }, + { + D3DFVF_XYZB3 | D3DFVF_LASTBETA_UBYTE4, + { + {0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0}, + {0, 12, D3DDECLTYPE_FLOAT2, 0, D3DDECLUSAGE_BLENDWEIGHT, 0}, + {0, 20, D3DDECLTYPE_UBYTE4, 0, D3DDECLUSAGE_BLENDINDICES, 0}, + D3DDECL_END(), + }, + }, + { + D3DFVF_XYZB3 | D3DFVF_LASTBETA_D3DCOLOR, + { + {0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0}, + {0, 12, D3DDECLTYPE_FLOAT2, 0, D3DDECLUSAGE_BLENDWEIGHT, 0}, + {0, 20, D3DDECLTYPE_D3DCOLOR, 0, D3DDECLUSAGE_BLENDINDICES, 0}, + D3DDECL_END(), + }, + }, + { + D3DFVF_XYZB4, + { + {0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0}, + {0, 12, D3DDECLTYPE_FLOAT4, 0, D3DDECLUSAGE_BLENDWEIGHT, 0}, + D3DDECL_END(), + }, + }, + { + D3DFVF_XYZB4 | D3DFVF_LASTBETA_UBYTE4, + { + {0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0}, + {0, 12, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_BLENDWEIGHT, 0}, + {0, 24, D3DDECLTYPE_UBYTE4, 0, D3DDECLUSAGE_BLENDINDICES, 0}, + D3DDECL_END(), + }, + }, + { + D3DFVF_XYZB4 | D3DFVF_LASTBETA_D3DCOLOR, + { + {0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0}, + {0, 12, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_BLENDWEIGHT, 0}, + {0, 24, D3DDECLTYPE_D3DCOLOR, 0, D3DDECLUSAGE_BLENDINDICES, 0}, + D3DDECL_END(), + }, + }, + {D3DFVF_NORMAL, {{0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_NORMAL, 0}, D3DDECL_END()}}, + {D3DFVF_PSIZE, {{0, 0, D3DDECLTYPE_FLOAT1, 0, D3DDECLUSAGE_PSIZE, 0}, D3DDECL_END()}}, + {D3DFVF_DIFFUSE, {{0, 0, D3DDECLTYPE_D3DCOLOR, 0, D3DDECLUSAGE_COLOR, 0}, D3DDECL_END()}}, + {D3DFVF_SPECULAR, {{0, 0, D3DDECLTYPE_D3DCOLOR, 0, D3DDECLUSAGE_COLOR, 1}, D3DDECL_END()}}, + /* Make sure textures of different sizes work. */ + { + D3DFVF_TEXCOORDSIZE1(0) | D3DFVF_TEX1, + {{0, 0, D3DDECLTYPE_FLOAT1, 0, D3DDECLUSAGE_TEXCOORD, 0}, D3DDECL_END()}, + }, + { + D3DFVF_TEXCOORDSIZE2(0) | D3DFVF_TEX1, + {{0, 0, D3DDECLTYPE_FLOAT2, 0, D3DDECLUSAGE_TEXCOORD, 0}, D3DDECL_END()}, + }, + { + D3DFVF_TEXCOORDSIZE3(0) | D3DFVF_TEX1, + {{0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_TEXCOORD, 0}, D3DDECL_END()}, + }, + { + D3DFVF_TEXCOORDSIZE4(0) | D3DFVF_TEX1, + {{0, 0, D3DDECLTYPE_FLOAT4, 0, D3DDECLUSAGE_TEXCOORD, 0}, D3DDECL_END()}, + }, + /* Make sure the TEXCOORD index works correctly - try several textures. */ + { + D3DFVF_TEXCOORDSIZE1(0) | D3DFVF_TEXCOORDSIZE3(1) | D3DFVF_TEXCOORDSIZE2(2) + | D3DFVF_TEXCOORDSIZE4(3) | D3DFVF_TEX4, + { + {0, 0, D3DDECLTYPE_FLOAT1, 0, D3DDECLUSAGE_TEXCOORD, 0}, + {0, 4, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_TEXCOORD, 1}, + {0, 16, D3DDECLTYPE_FLOAT2, 0, D3DDECLUSAGE_TEXCOORD, 2}, + {0, 24, D3DDECLTYPE_FLOAT4, 0, D3DDECLUSAGE_TEXCOORD, 3}, + D3DDECL_END(), + }, + }, + /* Now try a combination test. */ + { + D3DFVF_XYZB4 | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | D3DFVF_TEXCOORDSIZE2(0) + | D3DFVF_TEXCOORDSIZE3(1) | D3DFVF_TEX2, + { + {0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0}, + {0, 12, D3DDECLTYPE_FLOAT4, 0, D3DDECLUSAGE_BLENDWEIGHT, 0}, + {0, 28, D3DDECLTYPE_D3DCOLOR, 0, D3DDECLUSAGE_COLOR, 0}, + {0, 32, D3DDECLTYPE_D3DCOLOR, 0, D3DDECLUSAGE_COLOR, 1}, + {0, 36, D3DDECLTYPE_FLOAT2, 0, D3DDECLUSAGE_TEXCOORD, 0}, + {0, 44, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_TEXCOORD, 1}, + D3DDECL_END(), + }, + }, + }; + + window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + d3d = Direct3DCreate9(D3D_SDK_VERSION); + ok(!!d3d, "Failed to create a D3D object.\n"); + if (!(device = create_device(d3d, window, window, TRUE))) + { + skip("Failed to create a D3D device, skipping tests.\n"); + goto done; + } + + for (i = 0; i < sizeof(decl_to_fvf_tests) / sizeof(*decl_to_fvf_tests); ++i) + { + DWORD fvf = 0xdeadbeef; + HRESULT hr; + + /* Set a default FVF of SPECULAR and DIFFUSE to make sure it is changed + * back to 0. */ + hr = IDirect3DDevice9_SetFVF(device, D3DFVF_DIFFUSE | D3DFVF_SPECULAR); + ok(SUCCEEDED(hr), "Test %u: Failed to set FVF, hr %#x.\n", i, hr); + + hr = IDirect3DDevice9_CreateVertexDeclaration(device, decl_to_fvf_tests[i].elements, &declaration); + ok(SUCCEEDED(hr), "Test %u: Failed to create vertex declaration, hr %#x.\n", i, hr); + hr = IDirect3DDevice9_SetVertexDeclaration(device, declaration); + ok(SUCCEEDED(hr), "Test %u: Failed to set vertex declaration, hr %#x.\n", i, hr); + + /* Check the FVF. */ + hr = IDirect3DDevice9_GetFVF(device, &fvf); + ok(SUCCEEDED(hr), "Test %u: Failed to get FVF, hr %#x.\n", i, hr); + + if (decl_to_fvf_tests[i].todo) + todo_wine ok(fvf == decl_to_fvf_tests[i].fvf, + "Test %u: Got unexpected FVF %#x, expected %#x.\n", + i, fvf, decl_to_fvf_tests[i].fvf); + else + ok(fvf == decl_to_fvf_tests[i].fvf, + "Test %u: Got unexpected FVF %#x, expected %#x.\n", + i, fvf, decl_to_fvf_tests[i].fvf); + + IDirect3DDevice9_SetVertexDeclaration(device, NULL); + IDirect3DVertexDeclaration9_Release(declaration); + } + + /* Create a default declaration and FVF that does not match any of the + * tests. */ + hr = IDirect3DDevice9_CreateVertexDeclaration(device, default_elements, &default_decl); + ok(SUCCEEDED(hr), "Failed to create vertex declaration, hr %#x.\n", hr); + + for (i = 0; i < sizeof(fvf_to_decl_tests) / sizeof(*fvf_to_decl_tests); ++i) + { + /* Set a default declaration to make sure it is changed. */ + hr = IDirect3DDevice9_SetVertexDeclaration(device, default_decl); + ok(SUCCEEDED(hr), "Test %u: Failed to set vertex declaration, hr %#x.\n", i, hr); + + hr = IDirect3DDevice9_SetFVF(device, fvf_to_decl_tests[i].fvf); + ok(SUCCEEDED(hr), "Test %u: Failed to set FVF, hr %#x.\n", i, hr); + + hr = IDirect3DDevice9_GetVertexDeclaration(device, &declaration); + ok(SUCCEEDED(hr), "Test %u: Failed to get vertex declaration, hr %#x.\n", i, hr); + ok(!!declaration && declaration != default_decl, + "Test %u: Got unexpected declaration %p.\n", i, declaration); + ok(compare_elements(declaration, fvf_to_decl_tests[i].elements), + "Test %u: Declaration does not match.\n", i); + IDirect3DVertexDeclaration9_Release(declaration); + } + + /* Setting the FVF to 0 should result in no change to the default decl. */ + hr = IDirect3DDevice9_SetVertexDeclaration(device, default_decl); + ok(SUCCEEDED(hr), "Failed to set vertex declaration, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetFVF(device, 0); + ok(SUCCEEDED(hr), "Failed to set FVF, hr %#x.\n", hr); + hr = IDirect3DDevice9_GetVertexDeclaration(device, &declaration); + ok(SUCCEEDED(hr), "Failed to get vertex declaration, hr %#x.\n", hr); + ok(declaration == default_decl, "Got unexpected declaration %p, expected %p.\n", declaration, default_decl); + IDirect3DVertexDeclaration9_Release(declaration); + + IDirect3DVertexDeclaration9_Release(default_decl); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); +} + +/* Check whether a declaration converted from FVF is shared. + * Check whether refcounts behave as expected. */ +static void test_fvf_decl_management(void) +{ + IDirect3DVertexDeclaration9 *declaration1; + IDirect3DVertexDeclaration9 *declaration2; + IDirect3DVertexDeclaration9 *declaration3; + IDirect3DVertexDeclaration9 *declaration4; + IDirect3DDevice9 *device; + IDirect3D9 *d3d; + ULONG refcount; + HWND window; + HRESULT hr; + + static const D3DVERTEXELEMENT9 test_elements1[] = + {{0, 0, D3DDECLTYPE_FLOAT4, 0, D3DDECLUSAGE_POSITIONT, 0}, D3DDECL_END()}; + static const D3DVERTEXELEMENT9 test_elements2[] = + {{0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_NORMAL, 0}, D3DDECL_END()}; + + window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + d3d = Direct3DCreate9(D3D_SDK_VERSION); + ok(!!d3d, "Failed to create a D3D object.\n"); + if (!(device = create_device(d3d, window, window, TRUE))) + { + skip("Failed to create a D3D device, skipping tests.\n"); + goto done; + } + + /* Clear down any current vertex declaration. */ + hr = IDirect3DDevice9_SetVertexDeclaration(device, NULL); + ok(SUCCEEDED(hr), "Failed to set vertex declaration, hr %#x.\n", hr); + /* Conversion. */ + hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZRHW); + ok(SUCCEEDED(hr), "Failed to set FVF, hr %#x.\n", hr); + /* Get converted decl (#1). */ + hr = IDirect3DDevice9_GetVertexDeclaration(device, &declaration1); + ok(SUCCEEDED(hr), "Failed to get vertex declaration, hr %#x.\n", hr); + ok(compare_elements(declaration1, test_elements1), "Declaration does not match.\n"); + /* Get converted decl again (#2). */ + hr = IDirect3DDevice9_GetVertexDeclaration(device, &declaration2); + ok(SUCCEEDED(hr), "Failed to get vertex declaration, hr %#x.\n", hr); + ok(declaration2 == declaration1, "Got unexpected declaration2 %p, expected %p.\n", declaration2, declaration1); + + /* Conversion. */ + hr = IDirect3DDevice9_SetFVF(device, D3DFVF_NORMAL); + ok(SUCCEEDED(hr), "Failed to set FVF, hr %#x.\n", hr); + /* Get converted decl (#3). */ + hr = IDirect3DDevice9_GetVertexDeclaration(device, &declaration3); + ok(SUCCEEDED(hr), "Failed to get vertex declaration, hr %#x.\n", hr); + ok(declaration3 != declaration2, "Got unexpected declaration3 %p.\n", declaration3); + /* The contents should correspond to the second conversion. */ + ok(compare_elements(declaration3, test_elements2), "Declaration does not match.\n"); + /* Re-Check if the first decl was overwritten by the new Get(). */ + ok(compare_elements(declaration1, test_elements1), "Declaration does not match.\n"); + + hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZRHW); + ok(SUCCEEDED(hr), "Failed to set FVF, hr %#x.\n", hr); + hr = IDirect3DDevice9_GetVertexDeclaration(device, &declaration4); + ok(SUCCEEDED(hr), "Failed to get vertex declaration, hr %#x.\n", hr); + ok(declaration4 == declaration1, "Got unexpected declaration4 %p, expected %p.\n", declaration4, declaration1); + + refcount = get_refcount((IUnknown*)declaration1); + ok(refcount == 3, "Got unexpected refcount %u.\n", refcount); + refcount = get_refcount((IUnknown*)declaration2); + ok(refcount == 3, "Got unexpected refcount %u.\n", refcount); + refcount = get_refcount((IUnknown*)declaration3); + ok(refcount == 1, "Got unexpected refcount %u.\n", refcount); + refcount = get_refcount((IUnknown*)declaration4); + ok(refcount == 3, "Got unexpected refcount %u.\n", refcount); + + IDirect3DVertexDeclaration9_Release(declaration4); + IDirect3DVertexDeclaration9_Release(declaration3); + IDirect3DVertexDeclaration9_Release(declaration2); + IDirect3DVertexDeclaration9_Release(declaration1); + + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); +} + +static void test_vertex_declaration_alignment(void) +{ + IDirect3DVertexDeclaration9 *declaration; + IDirect3DDevice9 *device; + IDirect3D9 *d3d; + unsigned int i; + ULONG refcount; + HWND window; + HRESULT hr; + + static const struct + { + D3DVERTEXELEMENT9 elements[3]; + HRESULT hr; + } + test_data[] = + { + { + { + {0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0}, + {0, 16, D3DDECLTYPE_D3DCOLOR, 0, D3DDECLUSAGE_COLOR, 0}, + D3DDECL_END(), + }, D3D_OK, + }, + { + { + {0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0}, + {0, 17, D3DDECLTYPE_D3DCOLOR, 0, D3DDECLUSAGE_COLOR, 0}, + D3DDECL_END(), + }, E_FAIL, + }, + { + { + {0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0}, + {0, 18, D3DDECLTYPE_D3DCOLOR, 0, D3DDECLUSAGE_COLOR, 0}, + D3DDECL_END(), + }, E_FAIL, + }, + { + { + {0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0}, + {0, 19, D3DDECLTYPE_D3DCOLOR, 0, D3DDECLUSAGE_COLOR, 0}, + D3DDECL_END(), + }, E_FAIL, + }, + { + { + {0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0}, + {0, 20, D3DDECLTYPE_D3DCOLOR, 0, D3DDECLUSAGE_COLOR, 0}, + D3DDECL_END(), + }, D3D_OK, + }, + }; + + window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + d3d = Direct3DCreate9(D3D_SDK_VERSION); + ok(!!d3d, "Failed to create a D3D object.\n"); + if (!(device = create_device(d3d, window, window, TRUE))) + { + skip("Failed to create a D3D device, skipping tests.\n"); + goto done; + } + + for (i = 0; i < sizeof(test_data) / sizeof(*test_data); ++i) + { + hr = IDirect3DDevice9_CreateVertexDeclaration(device, test_data[i].elements, &declaration); + ok(hr == test_data[i].hr, "Test %u: Got unexpected hr %#x, expected %#x.\n", i, hr, test_data[i].hr); + if (SUCCEEDED(hr)) + IDirect3DVertexDeclaration9_Release(declaration); + } + + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); +} + +static void test_unused_declaration_type(void) +{ + IDirect3DVertexDeclaration9 *declaration; + IDirect3DDevice9 *device; + IDirect3D9 *d3d; + unsigned int i; + ULONG refcount; + HWND window; + HRESULT hr; + + static const D3DVERTEXELEMENT9 test_elements[][3] = + { + { + {0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0 }, + {0, 16, D3DDECLTYPE_UNUSED, 0, D3DDECLUSAGE_COLOR , 0 }, + D3DDECL_END(), + }, + { + {0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0 }, + {0, 16, D3DDECLTYPE_UNUSED, 0, D3DDECLUSAGE_TEXCOORD, 0 }, + D3DDECL_END(), + }, + { + {0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0 }, + {0, 16, D3DDECLTYPE_UNUSED, 0, D3DDECLUSAGE_TEXCOORD, 1 }, + D3DDECL_END(), + }, + { + {0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0 }, + {0, 16, D3DDECLTYPE_UNUSED, 0, D3DDECLUSAGE_TEXCOORD, 12}, + D3DDECL_END(), + }, + { + {0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0 }, + {1, 16, D3DDECLTYPE_UNUSED, 0, D3DDECLUSAGE_TEXCOORD, 12}, + D3DDECL_END(), + }, + { + {0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0 }, + {0, 16, D3DDECLTYPE_UNUSED, 0, D3DDECLUSAGE_NORMAL, 0 }, + D3DDECL_END(), + }, + { + {0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0 }, + {1, 16, D3DDECLTYPE_UNUSED, 0, D3DDECLUSAGE_NORMAL, 0 }, + D3DDECL_END(), + }, + }; + + window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + d3d = Direct3DCreate9(D3D_SDK_VERSION); + ok(!!d3d, "Failed to create a D3D object.\n"); + if (!(device = create_device(d3d, window, window, TRUE))) + { + skip("Failed to create a D3D device, skipping tests.\n"); + goto done; + } + + for (i = 0; i < sizeof(test_elements) / sizeof(*test_elements); ++i) + { + hr = IDirect3DDevice9_CreateVertexDeclaration(device, test_elements[i], &declaration); + ok(hr == E_FAIL, "Test %u: Got unexpected hr %#x.\n", i, hr); + } + + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); +} + static void check_mipmap_levels(IDirect3DDevice9 *device, UINT width, UINT height, UINT count) { IDirect3DBaseTexture9* texture = NULL; @@ -1948,14 +2691,11 @@ ok(SUCCEEDED(hr), "IDirect3DDevice9_SetVertexDeclaration failed (0x%08x)\n", hr); hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene failed (0x%08x)\n", hr); - if(SUCCEEDED(hr)) { - hr = IDirect3DDevice9_DrawPrimitive(device, D3DPT_POINTLIST, 0, 1); - ok(SUCCEEDED(hr), "IDirect3DDevice9_DrawPrimitive failed (0x%08x)\n", hr); - - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_EndScene failed (0x%08x)\n", hr); - } + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitive(device, D3DPT_POINTLIST, 0, 1); + 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); IDirect3DDevice9_SetStreamSource(device, 0, NULL, 0, 0); IDirect3DDevice9_SetVertexShader(device, NULL); @@ -3872,6 +4612,154 @@ DestroyWindow(window); } +static void test_timestamp_query(void) +{ + static const float point[3] = {0.0, 0.0, 0.0}; + IDirect3DQuery9 *query, *disjoint_query, *freq_query; + unsigned int data_size, i; + IDirect3DDevice9 *device; + IDirect3D9 *d3d9; + ULONG refcount; + HWND window; + HRESULT hr; + UINT64 timestamp, freq; + BOOL disjoint; + + window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW, + 0, 0, 640, 480, 0, 0, 0, 0); + d3d9 = Direct3DCreate9(D3D_SDK_VERSION); + ok(!!d3d9, "Failed to create a D3D object.\n"); + if (!(device = create_device(d3d9, window, window, TRUE))) + { + skip("Failed to create a D3D device, skipping tests.\n"); + IDirect3D9_Release(d3d9); + DestroyWindow(window); + return; + } + + hr = IDirect3DDevice9_CreateQuery(device, D3DQUERYTYPE_TIMESTAMPFREQ, &freq_query); + ok(hr == D3D_OK || hr == D3DERR_NOTAVAILABLE, "Got unexpected hr %#x.\n", hr); + if (FAILED(hr)) + { + skip("Timestamp queries are not supported, skipping tests.\n"); + IDirect3DDevice9_Release(device); + IDirect3D9_Release(d3d9); + DestroyWindow(window); + return; + } + data_size = IDirect3DQuery9_GetDataSize(freq_query); + ok(data_size == sizeof(UINT64), "Query data size is %u, 8 expected.\n", data_size); + + hr = IDirect3DDevice9_CreateQuery(device, D3DQUERYTYPE_TIMESTAMPDISJOINT, &disjoint_query); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + data_size = IDirect3DQuery9_GetDataSize(disjoint_query); + ok(data_size == sizeof(BOOL), "Query data size is %u, 4 expected.\n", data_size); + + hr = IDirect3DDevice9_CreateQuery(device, D3DQUERYTYPE_TIMESTAMP, &query); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + data_size = IDirect3DQuery9_GetDataSize(query); + ok(data_size == sizeof(UINT64), "Query data size is %u, 8 expected.\n", data_size); + + hr = IDirect3DQuery9_Issue(freq_query, D3DISSUE_END); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + for (i = 0; i < 500; ++i) + { + if ((hr = IDirect3DQuery9_GetData(freq_query, NULL, 0, D3DGETDATA_FLUSH)) != S_FALSE) + break; + Sleep(10); + } + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DQuery9_GetData(freq_query, &freq, sizeof(freq), D3DGETDATA_FLUSH); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DQuery9_GetData(query, NULL, 0, D3DGETDATA_FLUSH); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DQuery9_GetData(query, ×tamp, sizeof(timestamp), D3DGETDATA_FLUSH); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DQuery9_Issue(disjoint_query, D3DISSUE_END); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DQuery9_Issue(disjoint_query, D3DISSUE_BEGIN); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DQuery9_Issue(disjoint_query, D3DISSUE_BEGIN); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DQuery9_GetData(query, ×tamp, sizeof(timestamp), D3DGETDATA_FLUSH); + ok(hr == S_FALSE || hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ); + ok(SUCCEEDED(hr), "Failed to set FVF, hr %#x.\n", hr); + hr = IDirect3DDevice9_BeginScene(device); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_POINTLIST, 1, point, 3 * sizeof(float)); + 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 = IDirect3DQuery9_Issue(query, D3DISSUE_END); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + for (i = 0; i < 500; ++i) + { + if ((hr = IDirect3DQuery9_GetData(query, NULL, 0, D3DGETDATA_FLUSH)) != S_FALSE) + break; + Sleep(10); + } + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DQuery9_GetData(query, ×tamp, sizeof(timestamp), D3DGETDATA_FLUSH); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DQuery9_GetData(query, ×tamp, sizeof(timestamp), D3DGETDATA_FLUSH); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DQuery9_Issue(query, D3DISSUE_BEGIN); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DQuery9_Issue(query, D3DISSUE_END); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DQuery9_Issue(query, D3DISSUE_END); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DQuery9_Issue(disjoint_query, D3DISSUE_END); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + for (i = 0; i < 500; ++i) + { + if ((hr = IDirect3DQuery9_GetData(disjoint_query, NULL, 0, D3DGETDATA_FLUSH)) != S_FALSE) + break; + Sleep(10); + } + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DQuery9_GetData(disjoint_query, &disjoint, sizeof(disjoint), D3DGETDATA_FLUSH); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + + /* It's not strictly necessary for the TIMESTAMP query to be inside + * a TIMESTAMP_DISJOINT query. */ + hr = IDirect3DDevice9_BeginScene(device); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_POINTLIST, 1, point, 3 * sizeof(float)); + 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 = IDirect3DQuery9_Issue(query, D3DISSUE_END); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + for (i = 0; i < 500; ++i) + { + if ((hr = IDirect3DQuery9_GetData(query, NULL, 0, D3DGETDATA_FLUSH)) != S_FALSE) + break; + Sleep(10); + } + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DQuery9_GetData(query, ×tamp, sizeof(timestamp), D3DGETDATA_FLUSH); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + + IDirect3DQuery9_Release(query); + IDirect3DQuery9_Release(disjoint_query); + IDirect3DQuery9_Release(freq_query); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + IDirect3D9_Release(d3d9); + DestroyWindow(window); +} + static void test_get_set_vertex_shader(void) { IDirect3DVertexShader9 *current_shader = NULL; @@ -5082,6 +5970,20 @@ HRESULT hr; DWORD size; DWORD data[4] = {1, 2, 3, 4}; + static const GUID d3d9_private_data_test_guid = + { + 0xfdb37466, + 0x428f, + 0x4edf, + {0xa3,0x7f,0x9b,0x1d,0xf4,0x88,0xc5,0xfc} + }; + static const GUID d3d9_private_data_test_guid2 = + { + 0x2e5afac2, + 0x87b5, + 0x4c10, + {0x9b,0x4b,0x89,0xd7,0xd1,0x12,0xe7,0x2b} + }; window = CreateWindowA("d3d9_test_wc", "d3d9_test", WS_OVERLAPPEDWINDOW, 0, 0, 640, 480, 0, 0, 0, 0); @@ -5099,53 +6001,95 @@ D3DFMT_A8R8G8B8, D3DPOOL_SCRATCH, &surface, NULL); ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); - hr = IDirect3DSurface9_SetPrivateData(surface, &IID_IDirect3DSurface9 /* Abuse this tag */, + hr = IDirect3DSurface9_SetPrivateData(surface, &d3d9_private_data_test_guid, device, 0, D3DSPD_IUNKNOWN); ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); - hr = IDirect3DSurface9_SetPrivateData(surface, &IID_IDirect3DSurface9 /* Abuse this tag */, + hr = IDirect3DSurface9_SetPrivateData(surface, &d3d9_private_data_test_guid, device, 5, D3DSPD_IUNKNOWN); ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); - hr = IDirect3DSurface9_SetPrivateData(surface, &IID_IDirect3DSurface9 /* Abuse this tag */, + hr = IDirect3DSurface9_SetPrivateData(surface, &d3d9_private_data_test_guid, device, sizeof(IUnknown *) * 2, D3DSPD_IUNKNOWN); ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + /* A failing SetPrivateData call does not clear the old data with the same tag. */ + hr = IDirect3DSurface9_SetPrivateData(surface, &d3d9_private_data_test_guid, device, + sizeof(device), D3DSPD_IUNKNOWN); + ok(SUCCEEDED(hr), "Failed to set private data, hr %#x.\n", hr); + hr = IDirect3DSurface9_SetPrivateData(surface, &d3d9_private_data_test_guid, device, + sizeof(device) * 2, D3DSPD_IUNKNOWN); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + size = sizeof(ptr); + hr = IDirect3DSurface9_GetPrivateData(surface, &d3d9_private_data_test_guid, &ptr, &size); + ok(SUCCEEDED(hr), "Failed to get private data, hr %#x.\n", hr); + IUnknown_Release(ptr); + hr = IDirect3DSurface9_FreePrivateData(surface, &d3d9_private_data_test_guid); + ok(SUCCEEDED(hr), "Failed to free private data, hr %#x.\n", hr); + refcount = get_refcount((IUnknown *)device); - hr = IDirect3DSurface9_SetPrivateData(surface, &IID_IDirect3DSurface9 /* Abuse this tag */, + hr = IDirect3DSurface9_SetPrivateData(surface, &d3d9_private_data_test_guid, device, sizeof(IUnknown *), D3DSPD_IUNKNOWN); ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); expected_refcount = refcount + 1; refcount = get_refcount((IUnknown *)device); ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount); - hr = IDirect3DSurface9_FreePrivateData(surface, &IID_IDirect3DSurface9); + hr = IDirect3DSurface9_FreePrivateData(surface, &d3d9_private_data_test_guid); ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); expected_refcount = refcount - 1; refcount = get_refcount((IUnknown *)device); ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount); - hr = IDirect3DSurface9_SetPrivateData(surface, &IID_IDirect3DSurface9, + hr = IDirect3DSurface9_SetPrivateData(surface, &d3d9_private_data_test_guid, device, sizeof(IUnknown *), D3DSPD_IUNKNOWN); ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); - hr = IDirect3DSurface9_SetPrivateData(surface, &IID_IDirect3DSurface9, + hr = IDirect3DSurface9_SetPrivateData(surface, &d3d9_private_data_test_guid, surface, sizeof(IUnknown *), D3DSPD_IUNKNOWN); ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); refcount = get_refcount((IUnknown *)device); ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount); - hr = IDirect3DSurface9_SetPrivateData(surface, &IID_IDirect3DSurface9, + hr = IDirect3DSurface9_SetPrivateData(surface, &d3d9_private_data_test_guid, device, sizeof(IUnknown *), D3DSPD_IUNKNOWN); ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); - size = sizeof(ptr); - hr = IDirect3DSurface9_GetPrivateData(surface, &IID_IDirect3DSurface9, &ptr, &size); + size = 2 * sizeof(ptr); + hr = IDirect3DSurface9_GetPrivateData(surface, &d3d9_private_data_test_guid, &ptr, &size); ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(size == sizeof(device), "Got unexpected size %u.\n", size); expected_refcount = refcount + 2; refcount = get_refcount((IUnknown *)device); ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount); ok(ptr == (IUnknown *)device, "Got unexpected ptr %p, expected %p.\n", ptr, device); IUnknown_Release(ptr); + expected_refcount--; + + ptr = (IUnknown *)0xdeadbeef; + size = 1; + hr = IDirect3DSurface9_GetPrivateData(surface, &d3d9_private_data_test_guid, NULL, &size); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(size == sizeof(device), "Got unexpected size %u.\n", size); + size = 2 * sizeof(ptr); + hr = IDirect3DSurface9_GetPrivateData(surface, &d3d9_private_data_test_guid, NULL, &size); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + ok(size == sizeof(device), "Got unexpected size %u.\n", size); + refcount = get_refcount((IUnknown *)device); + ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount); + size = 1; + hr = IDirect3DSurface9_GetPrivateData(surface, &d3d9_private_data_test_guid, &ptr, &size); + ok(hr == D3DERR_MOREDATA, "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 = IDirect3DSurface9_GetPrivateData(surface, &d3d9_private_data_test_guid2, NULL, NULL); + ok(hr == D3DERR_NOTFOUND, "Got unexpected hr %#x.\n", hr); + size = 0xdeadbabe; + hr = IDirect3DSurface9_GetPrivateData(surface, &d3d9_private_data_test_guid2, &ptr, &size); + ok(hr == D3DERR_NOTFOUND, "Got unexpected hr %#x.\n", hr); + ok(ptr == (IUnknown *)0xdeadbeef, "Got unexpected pointer %p.\n", ptr); + ok(size == 0xdeadbabe, "Got unexpected size %u.\n", size); + /* GetPrivateData with size = NULL causes an access violation on Windows if the + * requested data exists. */ /* Destroying the surface frees the held reference. */ IDirect3DSurface9_Release(surface); - expected_refcount = refcount - 3; + expected_refcount = refcount - 2; refcount = get_refcount((IUnknown *)device); ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount); @@ -5157,26 +6101,27 @@ hr = IDirect3DTexture9_GetSurfaceLevel(texture, 1, &surface2); ok(SUCCEEDED(hr), "Failed to get texture level 1, hr %#x.\n", hr); - hr = IDirect3DTexture9_SetPrivateData(texture, &IID_IDirect3DVertexBuffer9, data, sizeof(data), 0); + hr = IDirect3DTexture9_SetPrivateData(texture, &d3d9_private_data_test_guid, data, sizeof(data), 0); ok(SUCCEEDED(hr), "Failed to set private data, hr %#x.\n", hr); memset(data, 0, sizeof(data)); size = sizeof(data); - hr = IDirect3DSurface9_GetPrivateData(surface, &IID_IDirect3DVertexBuffer9, data, &size); + hr = IDirect3DSurface9_GetPrivateData(surface, &d3d9_private_data_test_guid, data, &size); ok(hr == D3DERR_NOTFOUND, "Got unexpected hr %#x.\n", hr); - hr = IDirect3DTexture9_GetPrivateData(texture, &IID_IDirect3DVertexBuffer9, data, &size); + hr = IDirect3DTexture9_GetPrivateData(texture, &d3d9_private_data_test_guid, data, &size); ok(SUCCEEDED(hr), "Failed to get private data, hr %#x.\n", hr); ok(data[0] == 1 && data[1] == 2 && data[2] == 3 && data[3] == 4, "Got unexpected private data: %u, %u, %u, %u.\n", data[0], data[1], data[2], data[3]); - hr = IDirect3DTexture9_FreePrivateData(texture, &IID_IDirect3DVertexBuffer9); + hr = IDirect3DTexture9_FreePrivateData(texture, &d3d9_private_data_test_guid); ok(SUCCEEDED(hr), "Failed to free private data, hr %#x.\n", hr); - hr = IDirect3DSurface9_SetPrivateData(surface, &IID_IDirect3DVertexBuffer9, data, sizeof(data), 0); + hr = IDirect3DSurface9_SetPrivateData(surface, &d3d9_private_data_test_guid, data, sizeof(data), 0); ok(SUCCEEDED(hr), "Failed to set private data, hr %#x.\n", hr); - hr = IDirect3DSurface9_GetPrivateData(surface2, &IID_IDirect3DVertexBuffer9, data, &size); + hr = IDirect3DSurface9_GetPrivateData(surface2, &d3d9_private_data_test_guid, data, &size); ok(hr == D3DERR_NOTFOUND, "Got unexpected hr %#x.\n", hr); - hr = IDirect3DSurface9_FreePrivateData(surface, &IID_IDirect3DVertexBuffer9); + + hr = IDirect3DSurface9_FreePrivateData(surface, &d3d9_private_data_test_guid); ok(SUCCEEDED(hr), "Failed to free private data, hr %#x.\n", hr); IDirect3DSurface9_Release(surface2); @@ -7167,6 +8112,635 @@ if (hwnd2) DestroyWindow(hwnd2); } +static void test_begin_end_state_block(void) +{ + IDirect3DStateBlock9 *stateblock; + IDirect3DDevice9 *device; + IDirect3D9 *d3d; + ULONG refcount; + HWND window; + HRESULT hr; + + window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + d3d = Direct3DCreate9(D3D_SDK_VERSION); + ok(!!d3d, "Failed to create a D3D object.\n"); + if (!(device = create_device(d3d, window, window, TRUE))) + { + skip("Failed to create a D3D device, skipping tests.\n"); + IDirect3D9_Release(d3d); + DestroyWindow(window); + return; + } + + /* Should succeed. */ + hr = IDirect3DDevice9_BeginStateBlock(device); + ok(SUCCEEDED(hr), "Failed to begin stateblock, hr %#x.\n", hr); + + /* Calling BeginStateBlock() while recording should return + * D3DERR_INVALIDCALL. */ + hr = IDirect3DDevice9_BeginStateBlock(device); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + + /* Should succeed. */ + stateblock = (IDirect3DStateBlock9 *)0xdeadbeef; + hr = IDirect3DDevice9_EndStateBlock(device, &stateblock); + ok(SUCCEEDED(hr), "Failed to end stateblock, hr %#x.\n", hr); + ok(!!stateblock && stateblock != (IDirect3DStateBlock9 *)0xdeadbeef, + "Got unexpected stateblock %p.\n", stateblock); + IDirect3DStateBlock9_Release(stateblock); + + /* Calling EndStateBlock() while not recording should return + * D3DERR_INVALIDCALL. stateblock should not be touched. */ + stateblock = (IDirect3DStateBlock9 *)0xdeadbeef; + hr = IDirect3DDevice9_EndStateBlock(device, &stateblock); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + ok(stateblock == (IDirect3DStateBlock9 *)0xdeadbeef, + "Got unexpected stateblock %p.\n", stateblock); + + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + IDirect3D9_Release(d3d); + DestroyWindow(window); +} + +static void test_shader_constant_apply(void) +{ + static const float vs_const[] = {1.0f, 2.0f, 3.0f, 4.0f}; + static const float ps_const[] = {5.0f, 6.0f, 7.0f, 8.0f}; + static const float initial[] = {0.0f, 0.0f, 0.0f, 0.0f}; + IDirect3DStateBlock9 *stateblock; + DWORD vs_version, ps_version; + IDirect3DDevice9 *device; + IDirect3D9 *d3d; + ULONG refcount; + D3DCAPS9 caps; + float ret[4]; + HWND window; + HRESULT hr; + + window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + d3d = Direct3DCreate9(D3D_SDK_VERSION); + ok(!!d3d, "Failed to create a D3D object.\n"); + if (!(device = create_device(d3d, window, window, TRUE))) + { + skip("Failed to create a D3D device, skipping tests.\n"); + IDirect3D9_Release(d3d); + DestroyWindow(window); + return; + } + + hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); + vs_version = caps.VertexShaderVersion & 0xffff; + ps_version = caps.PixelShaderVersion & 0xffff; + + if (vs_version) + { + hr = IDirect3DDevice9_SetVertexShaderConstantF(device, 0, initial, 1); + ok(SUCCEEDED(hr), "Failed to set vertex shader constant, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetVertexShaderConstantF(device, 1, initial, 1); + ok(SUCCEEDED(hr), "Failed to set vertex shader constant, hr %#x.\n", hr); + + hr = IDirect3DDevice9_GetVertexShaderConstantF(device, 0, ret, 1); + ok(SUCCEEDED(hr), "Failed to get vertex shader constant, hr %#x.\n", hr); + ok(!memcmp(ret, initial, sizeof(initial)), + "Got unexpected vertex shader constant {%.8e, %.8e, %.8e, %.8e}, expected {%.8e, %.8e, %.8e, %.8e}.\n", + ret[0], ret[1], ret[2], ret[3], initial[0], initial[1], initial[2], initial[3]); + hr = IDirect3DDevice9_GetVertexShaderConstantF(device, 1, ret, 1); + ok(SUCCEEDED(hr), "Failed to get vertex shader constant, hr %#x.\n", hr); + ok(!memcmp(ret, initial, sizeof(initial)), + "Got unexpected vertex shader constant {%.8e, %.8e, %.8e, %.8e}, expected {%.8e, %.8e, %.8e, %.8e}.\n", + ret[0], ret[1], ret[2], ret[3], initial[0], initial[1], initial[2], initial[3]); + + hr = IDirect3DDevice9_SetVertexShaderConstantF(device, 0, vs_const, 1); + ok(SUCCEEDED(hr), "Failed to set vertex shader constant, hr %#x.\n", hr); + } + if (ps_version) + { + hr = IDirect3DDevice9_SetPixelShaderConstantF(device, 0, initial, 1); + ok(SUCCEEDED(hr), "Failed to set pixel shader constant, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetPixelShaderConstantF(device, 1, initial, 1); + ok(SUCCEEDED(hr), "Failed to set pixel shader constant, hr %#x.\n", hr); + + hr = IDirect3DDevice9_GetPixelShaderConstantF(device, 0, ret, 1); + ok(SUCCEEDED(hr), "Failed to get pixel shader constant, hr %#x.\n", hr); + ok(!memcmp(ret, initial, sizeof(initial)), + "Got unexpected pixel shader constant {%.8e, %.8e, %.8e, %.8e}, expected {%.8e, %.8e, %.8e, %.8e}.\n", + ret[0], ret[1], ret[2], ret[3], initial[0], initial[1], initial[2], initial[3]); + hr = IDirect3DDevice9_GetPixelShaderConstantF(device, 1, ret, 1); + ok(SUCCEEDED(hr), "Failed to get pixel shader constant, hr %#x.\n", hr); + ok(!memcmp(ret, initial, sizeof(initial)), + "Got unexpected pixel shader constant {%.8e, %.8e, %.8e, %.8e}, expected {%.8e, %.8e, %.8e, %.8e}.\n", + ret[0], ret[1], ret[2], ret[3], initial[0], initial[1], initial[2], initial[3]); + + hr = IDirect3DDevice9_SetPixelShaderConstantF(device, 0, ps_const, 1); + ok(SUCCEEDED(hr), "Failed to set pixel shader constant, hr %#x.\n", hr); + } + + hr = IDirect3DDevice9_BeginStateBlock(device); + ok(SUCCEEDED(hr), "Failed to begin stateblock, hr %#x.\n", hr); + + if (vs_version) + { + hr = IDirect3DDevice9_SetVertexShaderConstantF(device, 1, vs_const, 1); + ok(SUCCEEDED(hr), "Failed to set vertex shader constant, hr %#x.\n", hr); + } + if (ps_version) + { + hr = IDirect3DDevice9_SetPixelShaderConstantF(device, 1, ps_const, 1); + ok(SUCCEEDED(hr), "Failed to set pixel shader constant, hr %#x.\n", hr); + } + + hr = IDirect3DDevice9_EndStateBlock(device, &stateblock); + ok(SUCCEEDED(hr), "Failed to end stateblock, hr %#x.\n", hr); + + if (vs_version) + { + hr = IDirect3DDevice9_GetVertexShaderConstantF(device, 0, ret, 1); + ok(SUCCEEDED(hr), "Failed to get vertex shader constant, hr %#x.\n", hr); + ok(!memcmp(ret, vs_const, sizeof(vs_const)), + "Got unexpected vertex shader constant {%.8e, %.8e, %.8e, %.8e}, expected {%.8e, %.8e, %.8e, %.8e}.\n", + ret[0], ret[1], ret[2], ret[3], vs_const[0], vs_const[1], vs_const[2], vs_const[3]); + hr = IDirect3DDevice9_GetVertexShaderConstantF(device, 1, ret, 1); + ok(SUCCEEDED(hr), "Failed to get vertex shader constant, hr %#x.\n", hr); + ok(!memcmp(ret, initial, sizeof(initial)), + "Got unexpected vertex shader constant {%.8e, %.8e, %.8e, %.8e}, expected {%.8e, %.8e, %.8e, %.8e}.\n", + ret[0], ret[1], ret[2], ret[3], initial[0], initial[1], initial[2], initial[3]); + } + if (ps_version) + { + hr = IDirect3DDevice9_GetPixelShaderConstantF(device, 0, ret, 1); + ok(SUCCEEDED(hr), "Failed to get pixel shader constant, hr %#x.\n", hr); + ok(!memcmp(ret, ps_const, sizeof(ps_const)), + "Got unexpected pixel shader constant {%.8e, %.8e, %.8e, %.8e}, expected {%.8e, %.8e, %.8e, %.8e}.\n", + ret[0], ret[1], ret[2], ret[3], ps_const[0], ps_const[1], ps_const[2], ps_const[3]); + hr = IDirect3DDevice9_GetPixelShaderConstantF(device, 1, ret, 1); + ok(SUCCEEDED(hr), "Failed to get pixel shader constant, hr %#x.\n", hr); + ok(!memcmp(ret, initial, sizeof(initial)), + "Got unexpected pixel shader constant {%.8e, %.8e, %.8e, %.8e}, expected {%.8e, %.8e, %.8e, %.8e}.\n", + ret[0], ret[1], ret[2], ret[3], initial[0], initial[1], initial[2], initial[3]); + } + + /* Apply doesn't overwrite constants that aren't explicitly set on the + * source stateblock. */ + hr = IDirect3DStateBlock9_Apply(stateblock); + ok(SUCCEEDED(hr), "Failed to apply stateblock, hr %#x.\n", hr); + + if (vs_version) + { + hr = IDirect3DDevice9_GetVertexShaderConstantF(device, 0, ret, 1); + ok(SUCCEEDED(hr), "Failed to get vertex shader constant, hr %#x.\n", hr); + ok(!memcmp(ret, vs_const, sizeof(vs_const)), + "Got unexpected vertex shader constant {%.8e, %.8e, %.8e, %.8e}, expected {%.8e, %.8e, %.8e, %.8e}.\n", + ret[0], ret[1], ret[2], ret[3], vs_const[0], vs_const[1], vs_const[2], vs_const[3]); + hr = IDirect3DDevice9_GetVertexShaderConstantF(device, 1, ret, 1); + ok(SUCCEEDED(hr), "Failed to get vertex shader constant, hr %#x.\n", hr); + ok(!memcmp(ret, vs_const, sizeof(vs_const)), + "Got unexpected vertex shader constant {%.8e, %.8e, %.8e, %.8e}, expected {%.8e, %.8e, %.8e, %.8e}.\n", + ret[0], ret[1], ret[2], ret[3], vs_const[0], vs_const[1], vs_const[2], vs_const[3]); + } + if (ps_version) + { + hr = IDirect3DDevice9_GetPixelShaderConstantF(device, 0, ret, 1); + ok(SUCCEEDED(hr), "Failed to get pixel shader constant, hr %#x.\n", hr); + ok(!memcmp(ret, ps_const, sizeof(ps_const)), + "Got unexpected pixel shader constant {%.8e, %.8e, %.8e, %.8e}, expected {%.8e, %.8e, %.8e, %.8e}.\n", + ret[0], ret[1], ret[2], ret[3], ps_const[0], ps_const[1], ps_const[2], ps_const[3]); + hr = IDirect3DDevice9_GetPixelShaderConstantF(device, 1, ret, 1); + ok(SUCCEEDED(hr), "Failed to get pixel shader constant, hr %#x.\n", hr); + ok(!memcmp(ret, ps_const, sizeof(ps_const)), + "Got unexpected pixel shader constant {%.8e, %.8e, %.8e, %.8e}, expected {%.8e, %.8e, %.8e, %.8e}.\n", + ret[0], ret[1], ret[2], ret[3], ps_const[0], ps_const[1], ps_const[2], ps_const[3]); + } + + IDirect3DStateBlock9_Release(stateblock); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + IDirect3D9_Release(d3d); + DestroyWindow(window); +} + +static void test_vdecl_apply(void) +{ + IDirect3DVertexDeclaration9 *declaration, *declaration1, *declaration2; + IDirect3DStateBlock9 *stateblock; + IDirect3DDevice9 *device; + IDirect3D9 *d3d; + ULONG refcount; + HWND window; + HRESULT hr; + + static const D3DVERTEXELEMENT9 decl1[] = + { + {0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, + {0, 12, D3DDECLTYPE_D3DCOLOR, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 0}, + D3DDECL_END(), + }; + + static const D3DVERTEXELEMENT9 decl2[] = + { + {0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, + {0, 12, D3DDECLTYPE_D3DCOLOR, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 0}, + {0, 16, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_NORMAL, 0}, + D3DDECL_END(), + }; + + window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + d3d = Direct3DCreate9(D3D_SDK_VERSION); + ok(!!d3d, "Failed to create a D3D object.\n"); + if (!(device = create_device(d3d, window, window, TRUE))) + { + skip("Failed to create a D3D device, skipping tests.\n"); + IDirect3D9_Release(d3d); + DestroyWindow(window); + return; + } + + hr = IDirect3DDevice9_CreateVertexDeclaration(device, decl1, &declaration1); + ok(SUCCEEDED(hr), "CreateVertexDeclaration failed, hr %#x.\n", hr); + + hr = IDirect3DDevice9_CreateVertexDeclaration(device, decl2, &declaration2); + ok(SUCCEEDED(hr), "CreateVertexDeclaration failed, hr %#x.\n", hr); + + hr = IDirect3DDevice9_SetVertexDeclaration(device, NULL); + ok(SUCCEEDED(hr), "SetVertexDeclaration failed, hr %#x.\n", hr); + hr = IDirect3DDevice9_BeginStateBlock(device); + ok(SUCCEEDED(hr), "BeginStateBlock failed, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetVertexDeclaration(device, declaration1); + ok(SUCCEEDED(hr), "SetVertexDeclaration failed, hr %#x.\n", hr); + hr = IDirect3DDevice9_EndStateBlock(device, &stateblock); + ok(SUCCEEDED(hr), "EndStateBlock failed, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetVertexDeclaration(device, NULL); + ok(SUCCEEDED(hr), "SetVertexDeclaration failed, hr %#x.\n", hr); + hr = IDirect3DStateBlock9_Apply(stateblock); + ok(SUCCEEDED(hr), "Apply failed, hr %#x.\n", hr); + hr = IDirect3DDevice9_GetVertexDeclaration(device, &declaration); + ok(SUCCEEDED(hr), "GetVertexDeclaration failed, hr %#x.\n", hr); + ok(declaration == declaration1, "Got unexpected vertex declaration %p, expected %p.\n", + declaration, declaration1); + IDirect3DVertexDeclaration9_Release(declaration); + + hr = IDirect3DDevice9_SetVertexDeclaration(device, NULL); + ok(SUCCEEDED(hr), "SetVertexDeclaration failed, hr %#x.\n", hr); + hr = IDirect3DStateBlock9_Capture(stateblock); + ok(SUCCEEDED(hr), "Capture failed, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetVertexDeclaration(device, declaration2); + ok(SUCCEEDED(hr), "SetVertexDeclaration failed, hr %#x.\n", hr); + hr = IDirect3DStateBlock9_Apply(stateblock); + ok(SUCCEEDED(hr), "Apply failed, hr %#x.\n", hr); + hr = IDirect3DDevice9_GetVertexDeclaration(device, &declaration); + ok(SUCCEEDED(hr), "GetVertexDeclaration failed, hr %#x.\n", hr); + ok(declaration == declaration2, "Got unexpected vertex declaration %p, expected %p.\n", + declaration, declaration2); + IDirect3DVertexDeclaration9_Release(declaration); + + hr = IDirect3DDevice9_SetVertexDeclaration(device, declaration2); + ok(SUCCEEDED(hr), "SetVertexDeclaration failed, hr %#x.\n", hr); + hr = IDirect3DStateBlock9_Capture(stateblock); + ok(SUCCEEDED(hr), "Capture failed, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetVertexDeclaration(device, NULL); + ok(SUCCEEDED(hr), "SetVertexDeclaration failed, hr %#x.\n", hr); + hr = IDirect3DStateBlock9_Apply(stateblock); + ok(SUCCEEDED(hr), "Apply failed, hr %#x.\n", hr); + hr = IDirect3DDevice9_GetVertexDeclaration(device, &declaration); + ok(SUCCEEDED(hr), "GetVertexDeclaration failed, hr %#x.\n", hr); + ok(declaration == declaration2, "Got unexpected vertex declaration %p, expected %p.\n", + declaration, declaration2); + IDirect3DVertexDeclaration9_Release(declaration); + + hr = IDirect3DDevice9_SetVertexDeclaration(device, NULL); + ok(SUCCEEDED(hr), "SetVertexDeclaration failed, hr %#x.\n", hr); + hr = IDirect3DStateBlock9_Capture(stateblock); + ok(SUCCEEDED(hr), "Capture failed, hr %#x.\n", hr); + hr = IDirect3DStateBlock9_Apply(stateblock); + ok(SUCCEEDED(hr), "Apply failed, hr %#x.\n", hr); + hr = IDirect3DDevice9_GetVertexDeclaration(device, &declaration); + ok(SUCCEEDED(hr), "GetVertexDeclaration failed, hr %#x.\n", hr); + ok(!declaration, "Got unexpected vertex declaration %p.\n", declaration); + + hr = IDirect3DDevice9_SetVertexDeclaration(device, declaration2); + ok(SUCCEEDED(hr), "SetVertexDeclaration failed, hr %#x.\n", hr); + hr = IDirect3DStateBlock9_Capture(stateblock); + ok(SUCCEEDED(hr), "Capture failed, hr %#x.\n", hr); + hr = IDirect3DStateBlock9_Apply(stateblock); + ok(SUCCEEDED(hr), "Apply failed, hr %#x.\n", hr); + hr = IDirect3DDevice9_GetVertexDeclaration(device, &declaration); + ok(SUCCEEDED(hr), "GetVertexDeclaration failed, hr %#x.\n", hr); + ok(declaration == declaration2, "Got unexpected vertex declaration %p, expected %p.\n", + declaration, declaration2); + IDirect3DVertexDeclaration9_Release(declaration); + + IDirect3DStateBlock9_Release(stateblock); + hr = IDirect3DDevice9_SetVertexDeclaration(device, declaration1); + ok(SUCCEEDED(hr), "SetVertexDeclaration failed, hr %#x.\n", hr); + hr = IDirect3DDevice9_CreateStateBlock(device, D3DSBT_VERTEXSTATE, &stateblock); + ok(SUCCEEDED(hr), "CreateStateBlock failed, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetVertexDeclaration(device, NULL); + ok(SUCCEEDED(hr), "SetVertexDeclaration failed, hr %#x.\n", hr); + hr = IDirect3DStateBlock9_Apply(stateblock); + ok(SUCCEEDED(hr), "Apply failed, hr %#x.\n", hr); + hr = IDirect3DDevice9_GetVertexDeclaration(device, &declaration); + ok(SUCCEEDED(hr), "GetVertexDeclaration failed, hr %#x.\n", hr); + ok(declaration == declaration1, "Got unexpected vertex declaration %p, expected %p.\n", + declaration, declaration1); + IDirect3DVertexDeclaration9_Release(declaration); + + hr = IDirect3DDevice9_SetVertexDeclaration(device, NULL); + ok(SUCCEEDED(hr), "SetVertexDeclaration failed, hr %#x.\n", hr); + hr = IDirect3DStateBlock9_Capture(stateblock); + ok(SUCCEEDED(hr), "Capture failed, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetVertexDeclaration(device, declaration2); + ok(SUCCEEDED(hr), "SetVertexDeclaration failed, hr %#x.\n", hr); + hr = IDirect3DStateBlock9_Apply(stateblock); + ok(SUCCEEDED(hr), "Apply failed, hr %#x.\n", hr); + hr = IDirect3DDevice9_GetVertexDeclaration(device, &declaration); + ok(SUCCEEDED(hr), "GetVertexDeclaration failed, hr %#x.\n", hr); + ok(declaration == declaration2, "Got unexpected vertex declaration %p, expected %p.\n", + declaration, declaration2); + IDirect3DVertexDeclaration9_Release(declaration); + + hr = IDirect3DDevice9_SetVertexDeclaration(device, declaration2); + ok(SUCCEEDED(hr), "SetVertexDeclaration failed, hr %#x.\n", hr); + hr = IDirect3DStateBlock9_Capture(stateblock); + ok(SUCCEEDED(hr), "Capture failed, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetVertexDeclaration(device, NULL); + ok(SUCCEEDED(hr), "SetVertexDeclaration failed, hr %#x.\n", hr); + hr = IDirect3DStateBlock9_Apply(stateblock); + ok(SUCCEEDED(hr), "Apply failed, hr %#x.\n", hr); + hr = IDirect3DDevice9_GetVertexDeclaration(device, &declaration); + ok(SUCCEEDED(hr), "GetVertexDeclaration failed, hr %#x.\n", hr); + ok(declaration == declaration2, "Got unexpected vertex declaration %p, expected %p.\n", + declaration, declaration2); + IDirect3DVertexDeclaration9_Release(declaration); + + hr = IDirect3DDevice9_SetVertexDeclaration(device, NULL); + ok(SUCCEEDED(hr), "SetVertexDeclaration failed, hr %#x.\n", hr); + hr = IDirect3DStateBlock9_Capture(stateblock); + ok(SUCCEEDED(hr), "Capture failed, hr %#x.\n", hr); + hr = IDirect3DStateBlock9_Apply(stateblock); + ok(SUCCEEDED(hr), "Apply failed, hr %#x.\n", hr); + hr = IDirect3DDevice9_GetVertexDeclaration(device, &declaration); + ok(SUCCEEDED(hr), "GetVertexDeclaration failed, hr %#x.\n", hr); + ok(!declaration, "Got unexpected vertex declaration %p.\n", declaration); + + hr = IDirect3DDevice9_SetVertexDeclaration(device, declaration2); + ok(SUCCEEDED(hr), "SetVertexDeclaration failed, hr %#x.\n", hr); + hr = IDirect3DStateBlock9_Capture(stateblock); + ok(SUCCEEDED(hr), "Capture failed, hr %#x.\n", hr); + hr = IDirect3DStateBlock9_Apply(stateblock); + ok(SUCCEEDED(hr), "Apply failed, hr %#x.\n", hr); + hr = IDirect3DDevice9_GetVertexDeclaration(device, &declaration); + ok(SUCCEEDED(hr), "GetVertexDeclaration failed, hr %#x.\n", hr); + ok(declaration == declaration2, "Got unexpected vertex declaration %p, expected %p.\n", + declaration, declaration2); + IDirect3DVertexDeclaration9_Release(declaration); + + hr = IDirect3DDevice9_SetVertexDeclaration(device, NULL); + ok(SUCCEEDED(hr), "SetVertexDeclaration failed, hr %#x.\n", hr); + IDirect3DVertexDeclaration9_Release(declaration1); + IDirect3DVertexDeclaration9_Release(declaration2); + IDirect3DStateBlock9_Release(stateblock); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + IDirect3D9_Release(d3d); + DestroyWindow(window); +} + +static void test_resource_type(void) +{ + IDirect3DDevice9 *device; + IDirect3DSurface9 *surface; + IDirect3DTexture9 *texture; + IDirect3DCubeTexture9 *cube_texture; + IDirect3DVolume9 *volume; + IDirect3DVolumeTexture9 *volume_texture; + D3DSURFACE_DESC surface_desc; + D3DVOLUME_DESC volume_desc; + D3DRESOURCETYPE type; + IDirect3D9 *d3d; + ULONG refcount; + HWND window; + HRESULT hr; + + window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + d3d = Direct3DCreate9(D3D_SDK_VERSION); + ok(!!d3d, "Failed to create a D3D object.\n"); + if (!(device = create_device(d3d, window, window, TRUE))) + { + skip("Failed to create a D3D device, skipping tests.\n"); + IDirect3D9_Release(d3d); + DestroyWindow(window); + return; + } + + hr = IDirect3DDevice9_CreateOffscreenPlainSurface(device, 4, 4, D3DFMT_X8R8G8B8, + D3DPOOL_SYSTEMMEM, &surface, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + type = IDirect3DSurface9_GetType(surface); + ok(type == D3DRTYPE_SURFACE, "Expected type D3DRTYPE_SURFACE, got %u.\n", type); + hr = IDirect3DSurface9_GetDesc(surface, &surface_desc); + ok(SUCCEEDED(hr), "Failed to get surface description, hr %#x.\n", hr); + ok(surface_desc.Type == D3DRTYPE_SURFACE, "Expected type D3DRTYPE_SURFACE, got %u.\n", + surface_desc.Type); + IDirect3DSurface9_Release(surface); + + hr = IDirect3DDevice9_CreateTexture(device, 2, 8, 4, 0, D3DFMT_X8R8G8B8, + D3DPOOL_SYSTEMMEM, &texture, NULL); + ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr); + type = IDirect3DTexture9_GetType(texture); + ok(type == D3DRTYPE_TEXTURE, "Expected type D3DRTYPE_TEXTURE, got %u.\n", type); + + hr = IDirect3DTexture9_GetSurfaceLevel(texture, 0, &surface); + ok(SUCCEEDED(hr), "Failed to get surface level, hr %#x.\n", hr); + /* The following code crashes, for the sake of completeness: + * type = texture->lpVtbl->GetType((IDirect3DTexture9 *)surface); + * ok(type == D3DRTYPE_PONIES, "Expected type D3DRTYPE_PONIES, got %u.\n", type); + * + * So applications will not depend on getting the "right" resource type - whatever it + * may be - from the "wrong" vtable. */ + type = IDirect3DSurface9_GetType(surface); + ok(type == D3DRTYPE_SURFACE, "Expected type D3DRTYPE_SURFACE, got %u.\n", type); + hr = IDirect3DSurface9_GetDesc(surface, &surface_desc); + ok(SUCCEEDED(hr), "Failed to get surface description, hr %#x.\n", hr); + ok(surface_desc.Type == D3DRTYPE_SURFACE, "Expected type D3DRTYPE_SURFACE, got %u.\n", + surface_desc.Type); + ok(surface_desc.Width == 2, "Expected width 2, got %u.\n", surface_desc.Width); + ok(surface_desc.Height == 8, "Expected height 8, got %u.\n", surface_desc.Height); + hr = IDirect3DTexture9_GetLevelDesc(texture, 0, &surface_desc); + ok(SUCCEEDED(hr), "Failed to get level description, hr %#x.\n", hr); + ok(surface_desc.Type == D3DRTYPE_SURFACE, "Expected type D3DRTYPE_SURFACE, got %u.\n", + surface_desc.Type); + ok(surface_desc.Width == 2, "Expected width 2, got %u.\n", surface_desc.Width); + ok(surface_desc.Height == 8, "Expected height 8, got %u.\n", surface_desc.Height); + IDirect3DSurface9_Release(surface); + + hr = IDirect3DTexture9_GetSurfaceLevel(texture, 2, &surface); + ok(SUCCEEDED(hr), "Failed to get surface level, hr %#x.\n", hr); + type = IDirect3DSurface9_GetType(surface); + ok(type == D3DRTYPE_SURFACE, "Expected type D3DRTYPE_SURFACE, got %u.\n", type); + hr = IDirect3DSurface9_GetDesc(surface, &surface_desc); + ok(SUCCEEDED(hr), "Failed to get surface description, hr %#x.\n", hr); + ok(surface_desc.Type == D3DRTYPE_SURFACE, "Expected type D3DRTYPE_SURFACE, got %u.\n", + surface_desc.Type); + ok(surface_desc.Width == 1, "Expected width 1, got %u.\n", surface_desc.Width); + ok(surface_desc.Height == 2, "Expected height 2, got %u.\n", surface_desc.Height); + hr = IDirect3DTexture9_GetLevelDesc(texture, 2, &surface_desc); + ok(SUCCEEDED(hr), "Failed to get level description, hr %#x.\n", hr); + ok(surface_desc.Type == D3DRTYPE_SURFACE, "Expected type D3DRTYPE_SURFACE, got %u.\n", + surface_desc.Type); + ok(surface_desc.Width == 1, "Expected width 1, got %u.\n", surface_desc.Width); + ok(surface_desc.Height == 2, "Expected height 2, got %u.\n", surface_desc.Height); + IDirect3DSurface9_Release(surface); + IDirect3DTexture9_Release(texture); + + hr = IDirect3DDevice9_CreateCubeTexture(device, 1, 1, 0, D3DFMT_X8R8G8B8, + D3DPOOL_SYSTEMMEM, &cube_texture, NULL); + ok(SUCCEEDED(hr), "Failed to create cube texture, hr %#x.\n", hr); + type = IDirect3DCubeTexture9_GetType(cube_texture); + ok(type == D3DRTYPE_CUBETEXTURE, "Expected type D3DRTYPE_CUBETEXTURE, got %u.\n", type); + + hr = IDirect3DCubeTexture9_GetCubeMapSurface(cube_texture, + D3DCUBEMAP_FACE_NEGATIVE_X, 0, &surface); + ok(SUCCEEDED(hr), "Failed to get cube map surface, hr %#x.\n", hr); + type = IDirect3DSurface9_GetType(surface); + ok(type == D3DRTYPE_SURFACE, "Expected type D3DRTYPE_SURFACE, got %u.\n", type); + hr = IDirect3DSurface9_GetDesc(surface, &surface_desc); + ok(SUCCEEDED(hr), "Failed to get surface description, hr %#x.\n", hr); + ok(surface_desc.Type == D3DRTYPE_SURFACE, "Expected type D3DRTYPE_SURFACE, got %u.\n", + surface_desc.Type); + hr = IDirect3DCubeTexture9_GetLevelDesc(cube_texture, 0, &surface_desc); + ok(SUCCEEDED(hr), "Failed to get level description, hr %#x.\n", hr); + ok(surface_desc.Type == D3DRTYPE_SURFACE, "Expected type D3DRTYPE_SURFACE, got %u.\n", + surface_desc.Type); + IDirect3DSurface9_Release(surface); + IDirect3DCubeTexture9_Release(cube_texture); + + hr = IDirect3DDevice9_CreateVolumeTexture(device, 2, 4, 8, 4, 0, D3DFMT_X8R8G8B8, + D3DPOOL_SYSTEMMEM, &volume_texture, NULL); + type = IDirect3DVolumeTexture9_GetType(volume_texture); + ok(type == D3DRTYPE_VOLUMETEXTURE, "Expected type D3DRTYPE_VOLUMETEXTURE, got %u.\n", type); + + hr = IDirect3DVolumeTexture9_GetVolumeLevel(volume_texture, 0, &volume); + ok(SUCCEEDED(hr), "Failed to get volume level, hr %#x.\n", hr); + /* IDirect3DVolume9 is not an IDirect3DResource9 and has no GetType method. */ + hr = IDirect3DVolume9_GetDesc(volume, &volume_desc); + ok(SUCCEEDED(hr), "Failed to get volume description, hr %#x.\n", hr); + ok(volume_desc.Type == D3DRTYPE_VOLUME, "Expected type D3DRTYPE_VOLUME, got %u.\n", + volume_desc.Type); + ok(volume_desc.Width == 2, "Expected width 2, got %u.\n", volume_desc.Width); + ok(volume_desc.Height == 4, "Expected height 4, got %u.\n", volume_desc.Height); + ok(volume_desc.Depth == 8, "Expected depth 8, got %u.\n", volume_desc.Depth); + hr = IDirect3DVolumeTexture9_GetLevelDesc(volume_texture, 0, &volume_desc); + ok(SUCCEEDED(hr), "Failed to get level description, hr %#x.\n", hr); + ok(volume_desc.Type == D3DRTYPE_VOLUME, "Expected type D3DRTYPE_VOLUME, got %u.\n", + volume_desc.Type); + ok(volume_desc.Width == 2, "Expected width 2, got %u.\n", volume_desc.Width); + ok(volume_desc.Height == 4, "Expected height 4, got %u.\n", volume_desc.Height); + ok(volume_desc.Depth == 8, "Expected depth 8, got %u.\n", volume_desc.Depth); + IDirect3DVolume9_Release(volume); + + hr = IDirect3DVolumeTexture9_GetVolumeLevel(volume_texture, 2, &volume); + ok(SUCCEEDED(hr), "Failed to get volume level, hr %#x.\n", hr); + /* IDirect3DVolume9 is not an IDirect3DResource9 and has no GetType method. */ + hr = IDirect3DVolume9_GetDesc(volume, &volume_desc); + ok(SUCCEEDED(hr), "Failed to get volume description, hr %#x.\n", hr); + ok(volume_desc.Type == D3DRTYPE_VOLUME, "Expected type D3DRTYPE_VOLUME, got %u.\n", + volume_desc.Type); + ok(volume_desc.Width == 1, "Expected width 1, got %u.\n", volume_desc.Width); + ok(volume_desc.Height == 1, "Expected height 1, got %u.\n", volume_desc.Height); + ok(volume_desc.Depth == 2, "Expected depth 2, got %u.\n", volume_desc.Depth); + hr = IDirect3DVolumeTexture9_GetLevelDesc(volume_texture, 2, &volume_desc); + ok(SUCCEEDED(hr), "Failed to get level description, hr %#x.\n", hr); + ok(volume_desc.Type == D3DRTYPE_VOLUME, "Expected type D3DRTYPE_VOLUME, got %u.\n", + volume_desc.Type); + ok(volume_desc.Width == 1, "Expected width 1, got %u.\n", volume_desc.Width); + ok(volume_desc.Height == 1, "Expected height 1, got %u.\n", volume_desc.Height); + ok(volume_desc.Depth == 2, "Expected depth 2, got %u.\n", volume_desc.Depth); + IDirect3DVolume9_Release(volume); + IDirect3DVolumeTexture9_Release(volume_texture); + + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + IDirect3D9_Release(d3d); + DestroyWindow(window); +} + +static void test_mipmap_lock(void) +{ + IDirect3DDevice9 *device; + IDirect3DSurface9 *surface, *surface2, *surface_dst, *surface_dst2; + IDirect3DTexture9 *texture, *texture_dst; + IDirect3D9 *d3d; + ULONG refcount; + HWND window; + HRESULT hr; + D3DLOCKED_RECT locked_rect; + + window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + d3d = Direct3DCreate9(D3D_SDK_VERSION); + ok(!!d3d, "Failed to create a D3D object.\n"); + if (!(device = create_device(d3d, window, window, TRUE))) + { + skip("Failed to create a D3D device, skipping tests.\n"); + IDirect3D9_Release(d3d); + DestroyWindow(window); + return; + } + + hr = IDirect3DDevice9_CreateTexture(device, 4, 4, 2, 0, D3DFMT_X8R8G8B8, + D3DPOOL_DEFAULT, &texture_dst, NULL); + ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr); + hr = IDirect3DTexture9_GetSurfaceLevel(texture_dst, 0, &surface_dst); + ok(SUCCEEDED(hr), "Failed to get surface level, hr %#x.\n", hr); + hr = IDirect3DTexture9_GetSurfaceLevel(texture_dst, 1, &surface_dst2); + ok(SUCCEEDED(hr), "Failed to get surface level, hr %#x.\n", hr); + + hr = IDirect3DDevice9_CreateTexture(device, 4, 4, 2, 0, D3DFMT_X8R8G8B8, + D3DPOOL_SYSTEMMEM, &texture, NULL); + ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr); + hr = IDirect3DTexture9_GetSurfaceLevel(texture, 0, &surface); + ok(SUCCEEDED(hr), "Failed to get surface level, hr %#x.\n", hr); + hr = IDirect3DTexture9_GetSurfaceLevel(texture, 1, &surface2); + ok(SUCCEEDED(hr), "Failed to get surface level, hr %#x.\n", hr); + + hr = IDirect3DSurface9_LockRect(surface, &locked_rect, NULL, 0); + ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x.\n", hr); + hr = IDirect3DSurface9_LockRect(surface2, &locked_rect, NULL, 0); + ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x.\n", hr); + hr = IDirect3DSurface9_UnlockRect(surface); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr); + + hr = IDirect3DDevice9_UpdateSurface(device, surface, NULL, surface_dst, NULL); + ok(SUCCEEDED(hr), "Failed to update surface, hr %#x.\n", hr); + hr = IDirect3DDevice9_UpdateSurface(device, surface2, NULL, surface_dst2, NULL); + todo_wine ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + + /* Apparently there's no validation on the container. */ + hr = IDirect3DDevice9_UpdateTexture(device, (IDirect3DBaseTexture9 *)texture, + (IDirect3DBaseTexture9 *)texture_dst); + ok(SUCCEEDED(hr), "Failed to update texture, hr %#x.\n", hr); + + hr = IDirect3DSurface9_UnlockRect(surface2); + ok(SUCCEEDED(hr), "Failed to unlock surface, hr %#x.\n", hr); + + IDirect3DSurface9_Release(surface_dst2); + IDirect3DSurface9_Release(surface_dst); + IDirect3DSurface9_Release(surface2); + IDirect3DSurface9_Release(surface); + IDirect3DTexture9_Release(texture_dst); + IDirect3DTexture9_Release(texture); + + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + IDirect3D9_Release(d3d); + DestroyWindow(window); +} + START_TEST(device) { WNDCLASSA wc = {0}; @@ -7186,6 +8760,12 @@ screen_width = GetSystemMetrics(SM_CXSCREEN); screen_height = GetSystemMetrics(SM_CYSCREEN); + test_get_set_vertex_declaration(); + test_get_declaration(); + test_fvf_decl_conversion(); + test_fvf_decl_management(); + test_vertex_declaration_alignment(); + test_unused_declaration_type(); test_fpu_setup(); test_multi_device(); test_display_formats(); @@ -7220,6 +8800,7 @@ test_vertex_buffer_alignment(); test_query_support(); test_occlusion_query_states(); + test_timestamp_query(); test_get_set_vertex_shader(); test_vertex_shader_constant(); test_get_set_pixel_shader(); @@ -7252,6 +8833,11 @@ test_lockbox_invalid(); test_shared_handle(); test_pixel_format(); + test_begin_end_state_block(); + test_shader_constant_apply(); + test_vdecl_apply(); + test_resource_type(); + test_mipmap_lock(); UnregisterClassA("d3d9_test_wc", GetModuleHandleA(NULL)); } diff -Nru wine1.7-1.7.14/dlls/d3d9/tests/Makefile.in wine1.7-1.7.18/dlls/d3d9/tests/Makefile.in --- wine1.7-1.7.14/dlls/d3d9/tests/Makefile.in 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/d3d9/tests/Makefile.in 2014-05-02 18:15:48.000000000 +0000 @@ -5,5 +5,4 @@ d3d9ex.c \ device.c \ stateblock.c \ - vertexdeclaration.c \ visual.c diff -Nru wine1.7-1.7.14/dlls/d3d9/tests/stateblock.c wine1.7-1.7.18/dlls/d3d9/tests/stateblock.c --- wine1.7-1.7.14/dlls/d3d9/tests/stateblock.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/d3d9/tests/stateblock.c 2014-05-02 18:15:48.000000000 +0000 @@ -23,74 +23,6 @@ static DWORD texture_stages; -static HWND create_window(void) -{ - WNDCLASSA wc = {0}; - wc.lpfnWndProc = DefWindowProcA; - wc.lpszClassName = "d3d9_test_wc"; - RegisterClassA(&wc); - - return CreateWindowA("d3d9_test_wc", "d3d9_test", 0, - 0, 0, 0, 0, 0, 0, 0, 0); -} - -static IDirect3DDevice9 *create_device(D3DPRESENT_PARAMETERS *present_parameters) -{ - IDirect3DDevice9 *device; - IDirect3D9 *d3d9; - HWND window; - - if (!(d3d9 = Direct3DCreate9(D3D_SDK_VERSION))) - { - skip("could not create D3D9\n"); - return NULL; - } - - window = create_window(); - - memset(present_parameters, 0, sizeof(*present_parameters)); - present_parameters->Windowed = TRUE; - present_parameters->hDeviceWindow = window; - present_parameters->SwapEffect = D3DSWAPEFFECT_DISCARD; - - if (SUCCEEDED(IDirect3D9_CreateDevice(d3d9, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, window, - D3DCREATE_SOFTWARE_VERTEXPROCESSING, present_parameters, &device))) - return device; - - return NULL; -} - -static void test_begin_end_state_block(IDirect3DDevice9 *device_ptr) -{ - HRESULT hret = 0; - IDirect3DStateBlock9 *state_block_ptr = 0; - - /* Should succeed */ - hret = IDirect3DDevice9_BeginStateBlock(device_ptr); - ok(hret == D3D_OK, "BeginStateBlock returned: hret 0x%x. Expected hret 0x%x. Aborting.\n", hret, D3D_OK); - if (hret != D3D_OK) return; - - /* Calling BeginStateBlock while recording should return D3DERR_INVALIDCALL */ - hret = IDirect3DDevice9_BeginStateBlock(device_ptr); - ok(hret == D3DERR_INVALIDCALL, "BeginStateBlock returned: hret 0x%x. Expected hret 0x%x. Aborting.\n", hret, D3DERR_INVALIDCALL); - if (hret != D3DERR_INVALIDCALL) return; - - /* Should succeed */ - state_block_ptr = (IDirect3DStateBlock9 *)0xdeadbeef; - hret = IDirect3DDevice9_EndStateBlock(device_ptr, &state_block_ptr); - ok(hret == D3D_OK && state_block_ptr != 0 && state_block_ptr != (IDirect3DStateBlock9 *)0xdeadbeef, - "EndStateBlock returned: hret 0x%x, state_block_ptr %p. " - "Expected hret 0x%x, state_block_ptr != %p, state_block_ptr != 0xdeadbeef.\n", hret, state_block_ptr, D3D_OK, NULL); - IDirect3DStateBlock9_Release(state_block_ptr); - - /* Calling EndStateBlock while not recording should return D3DERR_INVALIDCALL. state_block_ptr should not be touched. */ - state_block_ptr = (IDirect3DStateBlock9 *)0xdeadbeef; - hret = IDirect3DDevice9_EndStateBlock(device_ptr, &state_block_ptr); - ok(hret == D3DERR_INVALIDCALL && state_block_ptr == (IDirect3DStateBlock9 *)0xdeadbeef, - "EndStateBlock returned: hret 0x%x, state_block_ptr %p. " - "Expected hret 0x%x, state_block_ptr 0xdeadbeef.\n", hret, state_block_ptr, D3DERR_INVALIDCALL); -} - /* ============================ State Testing Framework ========================== */ struct state_test @@ -2059,15 +1991,20 @@ /* =================== Main state tests function =============================== */ -static void test_state_management(IDirect3DDevice9 *device, D3DPRESENT_PARAMETERS *device_pparams) +static void test_state_management(void) { struct shader_constant_arg pshader_constant_arg; struct shader_constant_arg vshader_constant_arg; struct resource_test_arg resource_test_arg; struct render_state_arg render_state_arg; + D3DPRESENT_PARAMETERS present_parameters; struct light_arg light_arg; - HRESULT hret; + IDirect3DDevice9 *device; + IDirect3D9 *d3d; + ULONG refcount; D3DCAPS9 caps; + HWND window; + HRESULT hr; /* Test count: 2 for shader constants 1 for lights @@ -2078,9 +2015,29 @@ struct state_test tests[6]; unsigned int tcount = 0; - hret = IDirect3DDevice9_GetDeviceCaps(device, &caps); - ok(hret == D3D_OK, "GetDeviceCaps returned %#x.\n", hret); - if (hret != D3D_OK) return; + window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + if (!(d3d = Direct3DCreate9(D3D_SDK_VERSION))) + { + skip("Failed to create a D3D object, skipping tests.\n"); + DestroyWindow(window); + return; + } + memset(&present_parameters, 0, sizeof(present_parameters)); + present_parameters.Windowed = TRUE; + present_parameters.hDeviceWindow = window; + present_parameters.SwapEffect = D3DSWAPEFFECT_DISCARD; + if (FAILED(IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, window, + D3DCREATE_SOFTWARE_VERTEXPROCESSING, &present_parameters, &device))) + { + skip("Failed to create a 3D device, skipping test.\n"); + IDirect3D9_Release(d3d); + DestroyWindow(window); + return; + } + + hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); texture_stages = caps.MaxTextureBlendStages; @@ -2108,7 +2065,7 @@ transform_queue_test(&tests[tcount]); tcount++; - render_state_arg.device_pparams = device_pparams; + render_state_arg.device_pparams = &present_parameters; render_state_arg.pointsize_max = caps.MaxPointSize; render_states_queue_test(&tests[tcount], &render_state_arg); tcount++; @@ -2121,331 +2078,14 @@ tcount++; execute_test_chain_all(device, tests, tcount); -} -static void test_shader_constant_apply(IDirect3DDevice9 *device) -{ - static const float initial[] = {0.0f, 0.0f, 0.0f, 0.0f}; - static const float vs_const[] = {1.0f, 2.0f, 3.0f, 4.0f}; - static const float ps_const[] = {5.0f, 6.0f, 7.0f, 8.0f}; - IDirect3DStateBlock9 *stateblock; - DWORD vs_version, ps_version; - D3DCAPS9 caps; - float ret[4]; - HRESULT hr; - - hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); - ok(SUCCEEDED(hr), "GetDeviceCaps returned %#x.\n", hr); - vs_version = caps.VertexShaderVersion & 0xffff; - ps_version = caps.PixelShaderVersion & 0xffff; - - if (vs_version) - { - hr = IDirect3DDevice9_SetVertexShaderConstantF(device, 0, initial, 1); - ok(SUCCEEDED(hr), "SetVertexShaderConstantF returned %#x\n", hr); - hr = IDirect3DDevice9_SetVertexShaderConstantF(device, 1, initial, 1); - ok(SUCCEEDED(hr), "SetVertexShaderConstantF returned %#x\n", hr); - - hr = IDirect3DDevice9_GetVertexShaderConstantF(device, 0, ret, 1); - ok(SUCCEEDED(hr), "GetVertexShaderConstantF returned %#x\n", hr); - ok(!memcmp(ret, initial, sizeof(initial)), - "GetVertexShaderConstantF got {%f, %f, %f, %f}, expected {%f, %f, %f, %f}\n", - ret[0], ret[1], ret[2], ret[3], initial[0], initial[1], initial[2], initial[3]); - hr = IDirect3DDevice9_GetVertexShaderConstantF(device, 1, ret, 1); - ok(SUCCEEDED(hr), "GetVertexShaderConstantF returned %#x\n", hr); - ok(!memcmp(ret, initial, sizeof(initial)), - "GetVertexShaderConstantF got {%f, %f, %f, %f}, expected {%f, %f, %f, %f}\n", - ret[0], ret[1], ret[2], ret[3], initial[0], initial[1], initial[2], initial[3]); - - hr = IDirect3DDevice9_SetVertexShaderConstantF(device, 0, vs_const, 1); - ok(SUCCEEDED(hr), "SetVertexShaderConstantF returned %#x\n", hr); - } - if (ps_version) - { - hr = IDirect3DDevice9_SetPixelShaderConstantF(device, 0, initial, 1); - ok(SUCCEEDED(hr), "SetPixelShaderConstantF returned %#x\n", hr); - hr = IDirect3DDevice9_SetPixelShaderConstantF(device, 1, initial, 1); - ok(SUCCEEDED(hr), "SetPixelShaderConstantF returned %#x\n", hr); - - hr = IDirect3DDevice9_GetPixelShaderConstantF(device, 0, ret, 1); - ok(SUCCEEDED(hr), "GetPixelShaderConstantF returned %#x\n", hr); - ok(!memcmp(ret, initial, sizeof(initial)), - "GetpixelShaderConstantF got {%f, %f, %f, %f}, expected {%f, %f, %f, %f}\n", - ret[0], ret[1], ret[2], ret[3], initial[0], initial[1], initial[2], initial[3]); - hr = IDirect3DDevice9_GetPixelShaderConstantF(device, 1, ret, 1); - ok(SUCCEEDED(hr), "GetPixelShaderConstantF returned %#x\n", hr); - ok(!memcmp(ret, initial, sizeof(initial)), - "GetPixelShaderConstantF got {%f, %f, %f, %f}, expected {%f, %f, %f, %f}\n", - ret[0], ret[1], ret[2], ret[3], initial[0], initial[1], initial[2], initial[3]); - - hr = IDirect3DDevice9_SetPixelShaderConstantF(device, 0, ps_const, 1); - ok(SUCCEEDED(hr), "SetPixelShaderConstantF returned %#x\n", hr); - } - - hr = IDirect3DDevice9_BeginStateBlock(device); - ok(SUCCEEDED(hr), "BeginStateBlock returned %#x\n", hr); - - if (vs_version) - { - hr = IDirect3DDevice9_SetVertexShaderConstantF(device, 1, vs_const, 1); - ok(SUCCEEDED(hr), "SetVertexShaderConstantF returned %#x\n", hr); - } - if (ps_version) - { - hr = IDirect3DDevice9_SetPixelShaderConstantF(device, 1, ps_const, 1); - ok(SUCCEEDED(hr), "SetPixelShaderConstantF returned %#x\n", hr); - } - - hr = IDirect3DDevice9_EndStateBlock(device, &stateblock); - ok(SUCCEEDED(hr), "EndStateBlock returned %#x\n", hr); - - if (vs_version) - { - hr = IDirect3DDevice9_GetVertexShaderConstantF(device, 0, ret, 1); - ok(SUCCEEDED(hr), "GetVertexShaderConstantF returned %#x\n", hr); - ok(!memcmp(ret, vs_const, sizeof(vs_const)), - "GetVertexShaderConstantF got {%f, %f, %f, %f}, expected {%f, %f, %f, %f}\n", - ret[0], ret[1], ret[2], ret[3], vs_const[0], vs_const[1], vs_const[2], vs_const[3]); - hr = IDirect3DDevice9_GetVertexShaderConstantF(device, 1, ret, 1); - ok(SUCCEEDED(hr), "GetVertexShaderConstantF returned %#x\n", hr); - ok(!memcmp(ret, initial, sizeof(initial)), - "GetVertexShaderConstantF got {%f, %f, %f, %f}, expected {%f, %f, %f, %f}\n", - ret[0], ret[1], ret[2], ret[3], initial[0], initial[1], initial[2], initial[3]); - } - if (ps_version) - { - hr = IDirect3DDevice9_GetPixelShaderConstantF(device, 0, ret, 1); - ok(SUCCEEDED(hr), "GetPixelShaderConstantF returned %#x\n", hr); - ok(!memcmp(ret, ps_const, sizeof(ps_const)), - "GetPixelShaderConstantF got {%f, %f, %f, %f}, expected {%f, %f, %f, %f}\n", - ret[0], ret[1], ret[2], ret[3], ps_const[0], ps_const[1], ps_const[2], ps_const[3]); - hr = IDirect3DDevice9_GetPixelShaderConstantF(device, 1, ret, 1); - ok(SUCCEEDED(hr), "GetPixelShaderConstantF returned %#x\n", hr); - ok(!memcmp(ret, initial, sizeof(initial)), - "GetPixelShaderConstantF got {%f, %f, %f, %f}, expected {%f, %f, %f, %f}\n", - ret[0], ret[1], ret[2], ret[3], initial[0], initial[1], initial[2], initial[3]); - } - - /* Apply doesn't overwrite constants that aren't explicitly set on the source stateblock. */ - hr = IDirect3DStateBlock9_Apply(stateblock); - ok(SUCCEEDED(hr), "Apply returned %#x\n", hr); - - if (vs_version) - { - hr = IDirect3DDevice9_GetVertexShaderConstantF(device, 0, ret, 1); - ok(SUCCEEDED(hr), "GetVertexShaderConstantF returned %#x\n", hr); - ok(!memcmp(ret, vs_const, sizeof(vs_const)), - "GetVertexShaderConstantF got {%f, %f, %f, %f}, expected {%f, %f, %f, %f}\n", - ret[0], ret[1], ret[2], ret[3], vs_const[0], vs_const[1], vs_const[2], vs_const[3]); - hr = IDirect3DDevice9_GetVertexShaderConstantF(device, 1, ret, 1); - ok(SUCCEEDED(hr), "GetVertexShaderConstantF returned %#x\n", hr); - ok(!memcmp(ret, vs_const, sizeof(vs_const)), - "GetVertexShaderConstantF got {%f, %f, %f, %f}, expected {%f, %f, %f, %f}\n", - ret[0], ret[1], ret[2], ret[3], vs_const[0], vs_const[1], vs_const[2], vs_const[3]); - } - if (ps_version) - { - hr = IDirect3DDevice9_GetPixelShaderConstantF(device, 0, ret, 1); - ok(SUCCEEDED(hr), "GetPixelShaderConstantF returned %#x\n", hr); - ok(!memcmp(ret, ps_const, sizeof(ps_const)), - "GetPixelShaderConstantF got {%f, %f, %f, %f}, expected {%f, %f, %f, %f}\n", - ret[0], ret[1], ret[2], ret[3], ps_const[0], ps_const[1], ps_const[2], ps_const[3]); - hr = IDirect3DDevice9_GetPixelShaderConstantF(device, 1, ret, 1); - ok(SUCCEEDED(hr), "GetPixelShaderConstantF returned %#x\n", hr); - ok(!memcmp(ret, ps_const, sizeof(ps_const)), - "GetPixelShaderConstantF got {%f, %f, %f, %f}, expected {%f, %f, %f, %f}\n", - ret[0], ret[1], ret[2], ret[3], ps_const[0], ps_const[1], ps_const[2], ps_const[3]); - } - - IDirect3DStateBlock9_Release(stateblock); -} - -static void test_vdecl_apply(IDirect3DDevice9 *device) -{ - static const D3DVERTEXELEMENT9 decl1[] = - { - {0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, - {0, 12, D3DDECLTYPE_D3DCOLOR, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 0}, - D3DDECL_END(), - }; - - static const D3DVERTEXELEMENT9 decl2[] = - { - {0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, - {0, 12, D3DDECLTYPE_D3DCOLOR, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 0}, - {0, 16, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_NORMAL, 0}, - D3DDECL_END(), - }; - - IDirect3DVertexDeclaration9 *declaration, *declaration1, *declaration2; - IDirect3DStateBlock9 *stateblock; - HRESULT hr; - - hr = IDirect3DDevice9_CreateVertexDeclaration(device, decl1, &declaration1); - ok(SUCCEEDED(hr), "CreateVertexDeclaration failed, hr %#x.\n", hr); - - hr = IDirect3DDevice9_CreateVertexDeclaration(device, decl2, &declaration2); - ok(SUCCEEDED(hr), "CreateVertexDeclaration failed, hr %#x.\n", hr); - - hr = IDirect3DDevice9_SetVertexDeclaration(device, NULL); - ok(SUCCEEDED(hr), "SetVertexDeclaration failed, hr %#x.\n", hr); - hr = IDirect3DDevice9_BeginStateBlock(device); - ok(SUCCEEDED(hr), "BeginStateBlock failed, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetVertexDeclaration(device, declaration1); - ok(SUCCEEDED(hr), "SetVertexDeclaration failed, hr %#x.\n", hr); - hr = IDirect3DDevice9_EndStateBlock(device, &stateblock); - ok(SUCCEEDED(hr), "EndStateBlock failed, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetVertexDeclaration(device, NULL); - ok(SUCCEEDED(hr), "SetVertexDeclaration failed, hr %#x.\n", hr); - hr = IDirect3DStateBlock9_Apply(stateblock); - ok(SUCCEEDED(hr), "Apply failed, hr %#x.\n", hr); - hr = IDirect3DDevice9_GetVertexDeclaration(device, &declaration); - ok(SUCCEEDED(hr), "GetVertexDeclaration failed, hr %#x.\n", hr); - ok(declaration == declaration1, "Expected vertex declaration %p, received %p.\n", - declaration1, declaration); - IDirect3DVertexDeclaration9_Release(declaration); - - hr = IDirect3DDevice9_SetVertexDeclaration(device, NULL); - ok(SUCCEEDED(hr), "SetVertexDeclaration failed, hr %#x.\n", hr); - hr = IDirect3DStateBlock9_Capture(stateblock); - ok(SUCCEEDED(hr), "Capture failed, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetVertexDeclaration(device, declaration2); - ok(SUCCEEDED(hr), "SetVertexDeclaration failed, hr %#x.\n", hr); - hr = IDirect3DStateBlock9_Apply(stateblock); - ok(SUCCEEDED(hr), "Apply failed, hr %#x.\n", hr); - hr = IDirect3DDevice9_GetVertexDeclaration(device, &declaration); - ok(SUCCEEDED(hr), "GetVertexDeclaration failed, hr %#x.\n", hr); - ok(declaration == declaration2, "Expected vertex declaration %p, received %p.\n", - declaration2, declaration); - IDirect3DVertexDeclaration9_Release(declaration); - - hr = IDirect3DDevice9_SetVertexDeclaration(device, declaration2); - ok(SUCCEEDED(hr), "SetVertexDeclaration failed, hr %#x.\n", hr); - hr = IDirect3DStateBlock9_Capture(stateblock); - ok(SUCCEEDED(hr), "Capture failed, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetVertexDeclaration(device, NULL); - ok(SUCCEEDED(hr), "SetVertexDeclaration failed, hr %#x.\n", hr); - hr = IDirect3DStateBlock9_Apply(stateblock); - ok(SUCCEEDED(hr), "Apply failed, hr %#x.\n", hr); - hr = IDirect3DDevice9_GetVertexDeclaration(device, &declaration); - ok(SUCCEEDED(hr), "GetVertexDeclaration failed, hr %#x.\n", hr); - ok(declaration == declaration2, "Expected vertex declaration %p, received %p.\n", - declaration2, declaration); - IDirect3DVertexDeclaration9_Release(declaration); - - hr = IDirect3DDevice9_SetVertexDeclaration(device, NULL); - ok(SUCCEEDED(hr), "SetVertexDeclaration failed, hr %#x.\n", hr); - hr = IDirect3DStateBlock9_Capture(stateblock); - ok(SUCCEEDED(hr), "Capture failed, hr %#x.\n", hr); - hr = IDirect3DStateBlock9_Apply(stateblock); - ok(SUCCEEDED(hr), "Apply failed, hr %#x.\n", hr); - hr = IDirect3DDevice9_GetVertexDeclaration(device, &declaration); - ok(SUCCEEDED(hr), "GetVertexDeclaration failed, hr %#x.\n", hr); - ok(declaration == NULL, "Expected vertex declaration %p, received %p.\n", - NULL, declaration); - - hr = IDirect3DDevice9_SetVertexDeclaration(device, declaration2); - ok(SUCCEEDED(hr), "SetVertexDeclaration failed, hr %#x.\n", hr); - hr = IDirect3DStateBlock9_Capture(stateblock); - ok(SUCCEEDED(hr), "Capture failed, hr %#x.\n", hr); - hr = IDirect3DStateBlock9_Apply(stateblock); - ok(SUCCEEDED(hr), "Apply failed, hr %#x.\n", hr); - hr = IDirect3DDevice9_GetVertexDeclaration(device, &declaration); - ok(SUCCEEDED(hr), "GetVertexDeclaration failed, hr %#x.\n", hr); - ok(declaration == declaration2, "Expected vertex declaration %p, received %p.\n", - declaration2, declaration); - IDirect3DVertexDeclaration9_Release(declaration); - - IDirect3DStateBlock9_Release(stateblock); - hr = IDirect3DDevice9_SetVertexDeclaration(device, declaration1); - ok(SUCCEEDED(hr), "SetVertexDeclaration failed, hr %#x.\n", hr); - hr = IDirect3DDevice9_CreateStateBlock(device, D3DSBT_VERTEXSTATE, &stateblock); - ok(SUCCEEDED(hr), "CreateStateBlock failed, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetVertexDeclaration(device, NULL); - ok(SUCCEEDED(hr), "SetVertexDeclaration failed, hr %#x.\n", hr); - hr = IDirect3DStateBlock9_Apply(stateblock); - ok(SUCCEEDED(hr), "Apply failed, hr %#x.\n", hr); - hr = IDirect3DDevice9_GetVertexDeclaration(device, &declaration); - ok(SUCCEEDED(hr), "GetVertexDeclaration failed, hr %#x.\n", hr); - ok(declaration == declaration1, "Expected vertex declaration %p, received %p.\n", - declaration1, declaration); - IDirect3DVertexDeclaration9_Release(declaration); - - hr = IDirect3DDevice9_SetVertexDeclaration(device, NULL); - ok(SUCCEEDED(hr), "SetVertexDeclaration failed, hr %#x.\n", hr); - hr = IDirect3DStateBlock9_Capture(stateblock); - ok(SUCCEEDED(hr), "Capture failed, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetVertexDeclaration(device, declaration2); - ok(SUCCEEDED(hr), "SetVertexDeclaration failed, hr %#x.\n", hr); - hr = IDirect3DStateBlock9_Apply(stateblock); - ok(SUCCEEDED(hr), "Apply failed, hr %#x.\n", hr); - hr = IDirect3DDevice9_GetVertexDeclaration(device, &declaration); - ok(SUCCEEDED(hr), "GetVertexDeclaration failed, hr %#x.\n", hr); - ok(declaration == declaration2, "Expected vertex declaration %p, received %p.\n", - declaration2, declaration); - IDirect3DVertexDeclaration9_Release(declaration); - - hr = IDirect3DDevice9_SetVertexDeclaration(device, declaration2); - ok(SUCCEEDED(hr), "SetVertexDeclaration failed, hr %#x.\n", hr); - hr = IDirect3DStateBlock9_Capture(stateblock); - ok(SUCCEEDED(hr), "Capture failed, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetVertexDeclaration(device, NULL); - ok(SUCCEEDED(hr), "SetVertexDeclaration failed, hr %#x.\n", hr); - hr = IDirect3DStateBlock9_Apply(stateblock); - ok(SUCCEEDED(hr), "Apply failed, hr %#x.\n", hr); - hr = IDirect3DDevice9_GetVertexDeclaration(device, &declaration); - ok(SUCCEEDED(hr), "GetVertexDeclaration failed, hr %#x.\n", hr); - ok(declaration == declaration2, "Expected vertex declaration %p, received %p.\n", - declaration2, declaration); - IDirect3DVertexDeclaration9_Release(declaration); - - hr = IDirect3DDevice9_SetVertexDeclaration(device, NULL); - ok(SUCCEEDED(hr), "SetVertexDeclaration failed, hr %#x.\n", hr); - hr = IDirect3DStateBlock9_Capture(stateblock); - ok(SUCCEEDED(hr), "Capture failed, hr %#x.\n", hr); - hr = IDirect3DStateBlock9_Apply(stateblock); - ok(SUCCEEDED(hr), "Apply failed, hr %#x.\n", hr); - hr = IDirect3DDevice9_GetVertexDeclaration(device, &declaration); - ok(SUCCEEDED(hr), "GetVertexDeclaration failed, hr %#x.\n", hr); - ok(declaration == NULL, "Expected vertex declaration %p, received %p.\n", - NULL, declaration); - - hr = IDirect3DDevice9_SetVertexDeclaration(device, declaration2); - ok(SUCCEEDED(hr), "SetVertexDeclaration failed, hr %#x.\n", hr); - hr = IDirect3DStateBlock9_Capture(stateblock); - ok(SUCCEEDED(hr), "Capture failed, hr %#x.\n", hr); - hr = IDirect3DStateBlock9_Apply(stateblock); - ok(SUCCEEDED(hr), "Apply failed, hr %#x.\n", hr); - hr = IDirect3DDevice9_GetVertexDeclaration(device, &declaration); - ok(SUCCEEDED(hr), "GetVertexDeclaration failed, hr %#x.\n", hr); - ok(declaration == declaration2, "Expected vertex declaration %p, received %p.\n", - declaration2, declaration); - IDirect3DVertexDeclaration9_Release(declaration); - - hr = IDirect3DDevice9_SetVertexDeclaration(device, NULL); - ok(SUCCEEDED(hr), "SetVertexDeclaration failed, hr %#x.\n", hr); - IDirect3DVertexDeclaration9_Release(declaration1); - IDirect3DVertexDeclaration9_Release(declaration2); - IDirect3DStateBlock9_Release(stateblock); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left\n", refcount); + IDirect3D9_Release(d3d); + DestroyWindow(window); } START_TEST(stateblock) { - D3DPRESENT_PARAMETERS device_pparams; - IDirect3DDevice9 *device; - ULONG refcount; - - if (!(device = create_device(&device_pparams))) - { - skip("Failed to create a 3D device, skipping test.\n"); - return; - } - - test_begin_end_state_block(device); - test_state_management(device, &device_pparams); - test_shader_constant_apply(device); - test_vdecl_apply(device); - - refcount = IDirect3DDevice9_Release(device); - ok(!refcount, "Device has %u references left\n", refcount); + test_state_management(); } diff -Nru wine1.7-1.7.14/dlls/d3d9/tests/vertexdeclaration.c wine1.7-1.7.18/dlls/d3d9/tests/vertexdeclaration.c --- wine1.7-1.7.14/dlls/d3d9/tests/vertexdeclaration.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/d3d9/tests/vertexdeclaration.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,866 +0,0 @@ -/* - * Copyright (C) 2005 Henri Verbeet - * Copyright (C) 2006 Ivan Gyurdiev - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#define COBJMACROS -#include -#include "wine/test.h" - -#define VDECL_CHECK(fcall) \ - if(fcall != S_OK) \ - trace(" Test failed on line #%d\n", __LINE__); - -static HWND create_window(void) -{ - WNDCLASSA wc = {0}; - wc.lpfnWndProc = DefWindowProcA; - wc.lpszClassName = "d3d9_test_wc"; - RegisterClassA(&wc); - - return CreateWindowA("d3d9_test_wc", "d3d9_test", 0, - 0, 0, 0, 0, 0, 0, 0, 0); -} - -static IDirect3DDevice9 *init_d3d9(void) -{ - D3DPRESENT_PARAMETERS present_parameters; - IDirect3DDevice9 *device = NULL; - IDirect3D9 *d3d9; - HRESULT hr; - - if (!(d3d9 = Direct3DCreate9(D3D_SDK_VERSION))) - { - skip("could not create D3D9\n"); - return NULL; - } - - memset(&present_parameters, 0, sizeof(present_parameters)); - present_parameters.Windowed = TRUE; - present_parameters.hDeviceWindow = create_window(); - present_parameters.SwapEffect = D3DSWAPEFFECT_DISCARD; - - if (SUCCEEDED(IDirect3D9_CreateDevice(d3d9, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, NULL, - D3DCREATE_SOFTWARE_VERTEXPROCESSING, &present_parameters, &device))) - return device; - if (SUCCEEDED(hr = IDirect3D9_CreateDevice(d3d9, D3DADAPTER_DEFAULT, D3DDEVTYPE_REF, NULL, - D3DCREATE_SOFTWARE_VERTEXPROCESSING, &present_parameters, &device))) - return device; - - trace("Failed to create device, hr %#x.\n", hr); - return NULL; -} - -static int get_refcount(IUnknown *object) -{ - IUnknown_AddRef(object); - return IUnknown_Release(object); -} - -static inline void print_elements( - D3DVERTEXELEMENT9 *elements) { - - D3DVERTEXELEMENT9 last = D3DDECL_END(); - D3DVERTEXELEMENT9 *ptr = elements; - int count = 0; - - while (memcmp(ptr, &last, sizeof(D3DVERTEXELEMENT9))) { - - trace( - "[Element %d] Stream = %d, Offset = %d, Type = %d, Method = %d, Usage = %d, UsageIndex = %d\n", - count, ptr->Stream, ptr->Offset, ptr->Type, ptr->Method, ptr->Usage, ptr->UsageIndex); - - ptr++; - count++; - } -} - -static int compare_elements( - IDirect3DVertexDeclaration9 *decl, - const D3DVERTEXELEMENT9 *expected_elements) { - - HRESULT hr; - unsigned int i, size; - D3DVERTEXELEMENT9 last = D3DDECL_END(); - D3DVERTEXELEMENT9 *elements = NULL; - - /* How many elements are there? */ - hr = IDirect3DVertexDeclaration9_GetDeclaration( decl, NULL, &size ); - ok(SUCCEEDED(hr), "GetDeclaration returned %#x, expected %#x\n", hr, D3D_OK); - if (FAILED(hr)) goto fail; - - /* Allocate buffer */ - elements = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(D3DVERTEXELEMENT9) * size); - ok (elements != NULL, "Out of memory, aborting test\n"); - if (elements == NULL) goto fail; - - /* Get the elements */ - hr = IDirect3DVertexDeclaration9_GetDeclaration( decl, elements, &size); - ok(SUCCEEDED(hr), "GetDeclaration returned %#x, expected %#x\n", hr, D3D_OK); - if (FAILED(hr)) goto fail; - - /* Compare one by one */ - for (i = 0; i < size; i++) { - - int status; - - int end1 = memcmp(&elements[i], &last, sizeof(D3DVERTEXELEMENT9)); - int end2 = memcmp(&expected_elements[i], &last, sizeof(D3DVERTEXELEMENT9)); - status = ((end1 && !end2) || (!end1 && end2)); - ok (!status, "Mismatch in size, test declaration is %s than expected\n", - (end1 && !end2) ? "shorter" : "longer"); - if (status) { print_elements(elements); goto fail; } - - status = memcmp(&elements[i], &expected_elements[i], sizeof(D3DVERTEXELEMENT9)); - ok (!status, "Mismatch in element %d\n", i); - if (status) { print_elements(elements); goto fail; } - } - - HeapFree(GetProcessHeap(), 0, elements); - return S_OK; - - fail: - HeapFree(GetProcessHeap(), 0, elements); - return E_FAIL; -} - -static IDirect3DVertexDeclaration9 *test_create_vertex_declaration(IDirect3DDevice9 *device_ptr, D3DVERTEXELEMENT9 *vertex_decl) -{ - IDirect3DVertexDeclaration9 *decl_ptr = 0; - HRESULT hret = 0; - - hret = IDirect3DDevice9_CreateVertexDeclaration(device_ptr, vertex_decl, &decl_ptr); - ok(hret == D3D_OK && decl_ptr != NULL, "CreateVertexDeclaration returned: hret 0x%x, decl_ptr %p. " - "Expected hret 0x%x, decl_ptr != %p. Aborting.\n", hret, decl_ptr, D3D_OK, NULL); - - return decl_ptr; -} - -static void test_get_set_vertex_declaration(IDirect3DDevice9 *device_ptr, IDirect3DVertexDeclaration9 *decl_ptr) -{ - IDirect3DVertexDeclaration9 *current_decl_ptr = 0; - HRESULT hret = 0; - int decl_refcount = 0; - int i = 0; - - /* SetVertexDeclaration should not touch the declaration's refcount. */ - i = get_refcount((IUnknown *)decl_ptr); - hret = IDirect3DDevice9_SetVertexDeclaration(device_ptr, decl_ptr); - decl_refcount = get_refcount((IUnknown *)decl_ptr); - ok(hret == D3D_OK && decl_refcount == i, "SetVertexDeclaration returned: hret 0x%x, refcount %d. " - "Expected hret 0x%x, refcount %d.\n", hret, decl_refcount, D3D_OK, i); - - /* GetVertexDeclaration should increase the declaration's refcount by one. */ - i = decl_refcount+1; - hret = IDirect3DDevice9_GetVertexDeclaration(device_ptr, ¤t_decl_ptr); - decl_refcount = get_refcount((IUnknown *)decl_ptr); - ok(hret == D3D_OK && decl_refcount == i && current_decl_ptr == decl_ptr, - "GetVertexDeclaration returned: hret 0x%x, current_decl_ptr %p refcount %d. " - "Expected hret 0x%x, current_decl_ptr %p, refcount %d.\n", hret, current_decl_ptr, decl_refcount, D3D_OK, decl_ptr, i); - IDirect3DVertexDeclaration9_Release(current_decl_ptr); -} - -static void test_get_declaration(IDirect3DVertexDeclaration9 *decl_ptr, D3DVERTEXELEMENT9 *vertex_decl, UINT expected_num_elements) -{ - int i; - UINT num_elements = 0; - D3DVERTEXELEMENT9 *decl = 0; - HRESULT hret = 0; - - /* First test only getting the number of elements */ - num_elements = 0x1337c0de; - hret = IDirect3DVertexDeclaration9_GetDeclaration(decl_ptr, NULL, &num_elements); - ok(hret == D3D_OK && num_elements == expected_num_elements, - "GetDeclaration returned: hret 0x%x, num_elements %d. " - "Expected hret 0x%x, num_elements %d.\n", hret, num_elements, D3D_OK, expected_num_elements); - - num_elements = 0; - hret = IDirect3DVertexDeclaration9_GetDeclaration(decl_ptr, NULL, &num_elements); - ok(hret == D3D_OK && num_elements == expected_num_elements, - "GetDeclaration returned: hret 0x%x, num_elements %d. " - "Expected hret 0x%x, num_elements %d.\n", hret, num_elements, D3D_OK, expected_num_elements); - - /* Also test the returned data */ - decl = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(D3DVERTEXELEMENT9) * expected_num_elements); - - num_elements = 0x1337c0de; - hret = IDirect3DVertexDeclaration9_GetDeclaration(decl_ptr, decl, &num_elements); - ok(hret == D3D_OK && num_elements == expected_num_elements, - "GetDeclaration returned: hret 0x%x, num_elements %d. " - "Expected hret 0x%x, num_elements %d.\n", hret, num_elements, D3D_OK, expected_num_elements); - i = memcmp(decl, vertex_decl, num_elements * sizeof(*vertex_decl)); - ok (!i, "Original and returned vertexdeclarations are not the same\n"); - ZeroMemory(decl, sizeof(D3DVERTEXELEMENT9) * expected_num_elements); - - num_elements = 0; - hret = IDirect3DVertexDeclaration9_GetDeclaration(decl_ptr, decl, &num_elements); - ok(hret == D3D_OK && num_elements == expected_num_elements, - "GetDeclaration returned: hret 0x%x, num_elements %d. " - "Expected hret 0x%x, num_elements %d.\n", hret, num_elements, D3D_OK, expected_num_elements); - i = memcmp(decl, vertex_decl, num_elements * sizeof(*vertex_decl)); - ok (!i, "Original and returned vertexdeclarations are not the same\n"); - - HeapFree(GetProcessHeap(), 0, decl); -} - -/* FIXME: also write a test, which shows that attempting to set - * an invalid vertex declaration returns E_FAIL */ -static HRESULT test_fvf_to_decl(IDirect3DDevice9 *device, IDirect3DVertexDeclaration9 *default_decl, - DWORD test_fvf, const D3DVERTEXELEMENT9 expected_elements[], char object_should_change) -{ - - HRESULT hr; - IDirect3DVertexDeclaration9 *result_decl = NULL; - - /* Set a default declaration to make sure it is changed */ - hr = IDirect3DDevice9_SetVertexDeclaration ( device, default_decl ); - ok (SUCCEEDED(hr), "SetVertexDeclaration returned %#x, expected %#x\n", hr, D3D_OK); - if (FAILED(hr)) goto fail; - - /* Set an FVF */ - hr = IDirect3DDevice9_SetFVF( device, test_fvf); - ok(SUCCEEDED(hr), "SetFVF returned %#x, expected %#x\n", hr, D3D_OK); - if (FAILED(hr)) goto fail; - - /* Check if the declaration object changed underneath */ - hr = IDirect3DDevice9_GetVertexDeclaration ( device, &result_decl); - ok(SUCCEEDED(hr), "GetVertexDeclaration returned %#x, expected %#x\n", hr, D3D_OK); - if (FAILED(hr)) goto fail; - if (object_should_change) { - ok(result_decl != default_decl, "result declaration matches original\n"); - if (result_decl == default_decl) goto fail; - } else { - ok(result_decl == default_decl, "result declaration does not match original\n"); - if (result_decl != default_decl) goto fail; - } - - /* Declaration content/size test */ - ok(result_decl != NULL, "result declaration was null\n"); - if (result_decl == NULL) - goto fail; - else if (compare_elements(result_decl, expected_elements) != S_OK) - goto fail; - - if (result_decl) IDirect3DVertexDeclaration9_Release( result_decl ); - return S_OK; - - fail: - if (result_decl) IDirect3DVertexDeclaration9_Release( result_decl ); - return E_FAIL; -} - -static HRESULT test_decl_to_fvf(IDirect3DDevice9* device, DWORD default_fvf, - const D3DVERTEXELEMENT9 test_decl[], DWORD test_fvf, BOOL todo) -{ - - HRESULT hr; - IDirect3DVertexDeclaration9 *vdecl = NULL; - - DWORD result_fvf = 0xdeadbeef; - - /* Set a default FVF of SPECULAR and DIFFUSE to make sure it is changed back to 0 */ - hr = IDirect3DDevice9_SetFVF( device, default_fvf); - ok(SUCCEEDED(hr), "SetFVF returned %#x, expected %#x\n", hr, D3D_OK); - if (FAILED(hr)) goto fail; - - /* Create a testing declaration */ - hr = IDirect3DDevice9_CreateVertexDeclaration( device, test_decl, &vdecl ); - ok(SUCCEEDED(hr), "CreateVertexDeclaration returned %#x, expected %#x\n", hr, D3D_OK); - if (FAILED(hr)) goto fail; - - /* Set the declaration */ - hr = IDirect3DDevice9_SetVertexDeclaration ( device, vdecl ); - ok (SUCCEEDED(hr), "SetVertexDeclaration returned %#x, expected %#x\n", hr, D3D_OK); - if (FAILED(hr)) goto fail; - - /* Check the FVF */ - hr = IDirect3DDevice9_GetFVF( device, &result_fvf); - ok(SUCCEEDED(hr), "GetFVF returned %#x, expected %#x\n", hr, D3D_OK); - if (FAILED(hr)) goto fail; - if (todo) todo_wine ok(test_fvf == result_fvf, "result FVF was: %#x, expected: %#x\n", result_fvf, test_fvf); - else ok(test_fvf == result_fvf, "result FVF was: %#x, expected: %#x\n", result_fvf, test_fvf); - if (test_fvf != result_fvf) goto fail; - - IDirect3DDevice9_SetVertexDeclaration ( device, NULL ); - if (vdecl) IDirect3DVertexDeclaration9_Release( vdecl ); - return S_OK; - - fail: - IDirect3DDevice9_SetVertexDeclaration ( device, NULL ); - if (vdecl) IDirect3DVertexDeclaration9_Release( vdecl ); - return E_FAIL; -} - -static void test_fvf_decl_conversion(IDirect3DDevice9 *pDevice) -{ - - HRESULT hr; - unsigned int i; - - IDirect3DVertexDeclaration9* default_decl = NULL; - DWORD default_fvf = D3DFVF_SPECULAR | D3DFVF_DIFFUSE; - static const D3DVERTEXELEMENT9 default_elements[] = - { { 0, 0, D3DDECLTYPE_D3DCOLOR, 0, D3DDECLUSAGE_COLOR, 0 }, - { 0, 4, D3DDECLTYPE_D3DCOLOR, 0, D3DDECLUSAGE_COLOR, 1 }, D3DDECL_END() }; - - /* Create a default declaration and FVF that does not match any of the tests */ - hr = IDirect3DDevice9_CreateVertexDeclaration( pDevice, default_elements, &default_decl ); - ok(SUCCEEDED(hr), "CreateVertexDeclaration returned %#x, expected %#x\n", hr, D3D_OK); - if (FAILED(hr)) goto cleanup; - - /* Test conversions from vertex declaration to an FVF. - * For some reason those seem to occur only for POSITION/POSITIONT, - * Otherwise the FVF is forced to 0 - maybe this is configuration specific */ - { - static const D3DVERTEXELEMENT9 test_buffer[] = - { { 0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0 }, D3DDECL_END() }; - VDECL_CHECK(test_decl_to_fvf(pDevice, default_fvf, test_buffer, D3DFVF_XYZ, TRUE)); - } - { - static const D3DVERTEXELEMENT9 test_buffer[] = - { { 0, 0, D3DDECLTYPE_FLOAT4, 0, D3DDECLUSAGE_POSITIONT, 0 }, D3DDECL_END() }; - VDECL_CHECK(test_decl_to_fvf(pDevice, default_fvf, test_buffer, D3DFVF_XYZRHW, TRUE)); - } - for (i = 0; i < 4; ++i) - { - const D3DVERTEXELEMENT9 test_buffer[] = - { { 0, 0, D3DDECLTYPE_FLOAT1 + i, 0, D3DDECLUSAGE_BLENDWEIGHT, 0}, D3DDECL_END() }; - VDECL_CHECK(test_decl_to_fvf(pDevice, default_fvf, test_buffer, 0, FALSE)); - } - { - static const D3DVERTEXELEMENT9 test_buffer[] = - { { 0, 0, D3DDECLTYPE_UBYTE4, 0, D3DDECLUSAGE_BLENDINDICES, 0}, D3DDECL_END() }; - VDECL_CHECK(test_decl_to_fvf(pDevice, default_fvf, test_buffer, 0, FALSE)); - } - { - static const D3DVERTEXELEMENT9 test_buffer[] = - { { 0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_NORMAL, 0 }, D3DDECL_END() }; - VDECL_CHECK(test_decl_to_fvf(pDevice, default_fvf, test_buffer, 0, FALSE)); - } - { - static const D3DVERTEXELEMENT9 test_buffer[] = - { { 0, 0, D3DDECLTYPE_FLOAT1, 0, D3DDECLUSAGE_PSIZE, 0 }, D3DDECL_END() }; - VDECL_CHECK(test_decl_to_fvf(pDevice, default_fvf, test_buffer, 0, FALSE)); - } - { - static const D3DVERTEXELEMENT9 test_buffer[] = - { { 0, 0, D3DDECLTYPE_D3DCOLOR, 0, D3DDECLUSAGE_COLOR, 0 }, D3DDECL_END() }; - VDECL_CHECK(test_decl_to_fvf(pDevice, default_fvf, test_buffer, 0, FALSE)); - } - { - static const D3DVERTEXELEMENT9 test_buffer[] = - { { 0, 0, D3DDECLTYPE_D3DCOLOR, 0, D3DDECLUSAGE_COLOR, 1 }, D3DDECL_END() }; - VDECL_CHECK(test_decl_to_fvf(pDevice, default_fvf, test_buffer, 0, FALSE)); - } - - /* Make sure textures of different sizes work */ - { - static const D3DVERTEXELEMENT9 test_buffer[] = - { { 0, 0, D3DDECLTYPE_FLOAT1, 0, D3DDECLUSAGE_TEXCOORD, 0 }, D3DDECL_END() }; - VDECL_CHECK(test_decl_to_fvf(pDevice, default_fvf, test_buffer, 0, FALSE)); - } - { - static const D3DVERTEXELEMENT9 test_buffer[] = - { { 0, 0, D3DDECLTYPE_FLOAT2, 0, D3DDECLUSAGE_TEXCOORD, 0 }, D3DDECL_END() }; - VDECL_CHECK(test_decl_to_fvf(pDevice, default_fvf, test_buffer, 0, FALSE)); - } - { - static const D3DVERTEXELEMENT9 test_buffer[] = - { { 0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_TEXCOORD, 0 }, D3DDECL_END() }; - VDECL_CHECK(test_decl_to_fvf(pDevice, default_fvf, test_buffer, 0, FALSE)); - } - { - static const D3DVERTEXELEMENT9 test_buffer[] = - { { 0, 0, D3DDECLTYPE_FLOAT4, 0, D3DDECLUSAGE_TEXCOORD, 0 }, D3DDECL_END() }; - VDECL_CHECK(test_decl_to_fvf(pDevice, default_fvf, test_buffer, 0, FALSE)); - } - - /* Make sure the TEXCOORD index works correctly - try several textures */ - { - static const D3DVERTEXELEMENT9 test_buffer[] = - { { 0, 0, D3DDECLTYPE_FLOAT1, 0, D3DDECLUSAGE_TEXCOORD, 0 }, - { 0, 4, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_TEXCOORD, 1 }, - { 0, 16, D3DDECLTYPE_FLOAT2, 0, D3DDECLUSAGE_TEXCOORD, 2 }, - { 0, 24, D3DDECLTYPE_FLOAT4, 0, D3DDECLUSAGE_TEXCOORD, 3 }, D3DDECL_END() }; - VDECL_CHECK(test_decl_to_fvf(pDevice, default_fvf, test_buffer, 0, FALSE)); - } - - /* No FVF mapping available */ - { - static const D3DVERTEXELEMENT9 test_buffer[] = - { { 0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 1 }, D3DDECL_END() }; - VDECL_CHECK(test_decl_to_fvf(pDevice, default_fvf, test_buffer, 0, FALSE)); - } - { - static const D3DVERTEXELEMENT9 test_buffer[] = - { { 0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_NORMAL, 1 }, D3DDECL_END() }; - VDECL_CHECK(test_decl_to_fvf(pDevice, default_fvf, test_buffer, 0, FALSE)); - } - - /* Try empty declaration */ - { - static const D3DVERTEXELEMENT9 test_buffer[] = { D3DDECL_END() }; - VDECL_CHECK(test_decl_to_fvf(pDevice, default_fvf, test_buffer, 0, FALSE)); - } - - /* Now try a combination test */ - { - static const D3DVERTEXELEMENT9 test_buffer[] = - { { 0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITIONT, 0 }, - { 0, 12, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_NORMAL, 0 }, - { 0, 24, D3DDECLTYPE_FLOAT1, 0, D3DDECLUSAGE_PSIZE, 0 }, - { 0, 28, D3DDECLTYPE_D3DCOLOR, 0, D3DDECLUSAGE_COLOR, 1 }, - { 0, 32, D3DDECLTYPE_FLOAT1, 0, D3DDECLUSAGE_TEXCOORD, 0 }, - { 0, 44, D3DDECLTYPE_FLOAT4, 0, D3DDECLUSAGE_TEXCOORD, 1 }, D3DDECL_END() }; - VDECL_CHECK(test_decl_to_fvf(pDevice, default_fvf, test_buffer, 0, FALSE)); - } - - /* Test conversions from FVF to a vertex declaration - * These seem to always occur internally. A new declaration object is created if necessary */ - - { - static const D3DVERTEXELEMENT9 test_buffer[] = - { { 0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0 }, D3DDECL_END() }; - VDECL_CHECK(test_fvf_to_decl(pDevice, default_decl, D3DFVF_XYZ, test_buffer, 1)); - } - { - static const D3DVERTEXELEMENT9 test_buffer[] = - { { 0, 0, D3DDECLTYPE_FLOAT4, 0, D3DDECLUSAGE_POSITION, 0 }, D3DDECL_END() }; - VDECL_CHECK(test_fvf_to_decl(pDevice, default_decl, D3DFVF_XYZW, test_buffer, 1)); - } - { - static const D3DVERTEXELEMENT9 test_buffer[] = - { { 0, 0, D3DDECLTYPE_FLOAT4, 0, D3DDECLUSAGE_POSITIONT, 0 }, D3DDECL_END() }; - VDECL_CHECK(test_fvf_to_decl(pDevice, default_decl, D3DFVF_XYZRHW, test_buffer, 1)); - } - { - static const D3DVERTEXELEMENT9 test_buffer[] = - { { 0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0 }, - { 0, 12, D3DDECLTYPE_FLOAT4, 0, D3DDECLUSAGE_BLENDWEIGHT, 0 }, - { 0, 28, D3DDECLTYPE_UBYTE4, 0, D3DDECLUSAGE_BLENDINDICES, 0 }, D3DDECL_END() }; - VDECL_CHECK(test_fvf_to_decl(pDevice, default_decl, - D3DFVF_XYZB5 | D3DFVF_LASTBETA_UBYTE4, test_buffer, 1)); - } - { - static const D3DVERTEXELEMENT9 test_buffer[] = - { { 0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0 }, - { 0, 12, D3DDECLTYPE_FLOAT4, 0, D3DDECLUSAGE_BLENDWEIGHT, 0 }, - { 0, 28, D3DDECLTYPE_D3DCOLOR, 0, D3DDECLUSAGE_BLENDINDICES, 0 }, D3DDECL_END() }; - VDECL_CHECK(test_fvf_to_decl(pDevice, default_decl, - D3DFVF_XYZB5 | D3DFVF_LASTBETA_D3DCOLOR, test_buffer, 1)); - } - { - static const D3DVERTEXELEMENT9 test_buffer[] = - { { 0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0 }, - { 0, 12, D3DDECLTYPE_FLOAT4, 0, D3DDECLUSAGE_BLENDWEIGHT, 0 }, - { 0, 28, D3DDECLTYPE_FLOAT1, 0, D3DDECLUSAGE_BLENDINDICES, 0 }, D3DDECL_END() }; - VDECL_CHECK(test_fvf_to_decl(pDevice, default_decl, D3DFVF_XYZB5, test_buffer, 1)); - } - { - static const D3DVERTEXELEMENT9 test_buffer[] = - { { 0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0 }, - { 0, 12, D3DDECLTYPE_FLOAT1, 0, D3DDECLUSAGE_BLENDWEIGHT, 0 }, D3DDECL_END() }; - VDECL_CHECK(test_fvf_to_decl(pDevice, default_decl, D3DFVF_XYZB1, test_buffer, 1)); - } - { - static const D3DVERTEXELEMENT9 test_buffer[] = - { { 0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0 }, - { 0, 12, D3DDECLTYPE_UBYTE4, 0, D3DDECLUSAGE_BLENDINDICES, 0 }, D3DDECL_END() }; - VDECL_CHECK(test_fvf_to_decl(pDevice, default_decl, - D3DFVF_XYZB1 | D3DFVF_LASTBETA_UBYTE4, test_buffer, 1)); - } - { - static const D3DVERTEXELEMENT9 test_buffer[] = - { { 0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0 }, - { 0, 12, D3DDECLTYPE_D3DCOLOR, 0, D3DDECLUSAGE_BLENDINDICES, 0 }, D3DDECL_END() }; - VDECL_CHECK(test_fvf_to_decl(pDevice, default_decl, - D3DFVF_XYZB1 | D3DFVF_LASTBETA_D3DCOLOR, test_buffer, 1)); - } - { - static const D3DVERTEXELEMENT9 test_buffer[] = - { { 0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0 }, - { 0, 12, D3DDECLTYPE_FLOAT2, 0, D3DDECLUSAGE_BLENDWEIGHT, 0 }, D3DDECL_END() }; - VDECL_CHECK(test_fvf_to_decl(pDevice, default_decl, D3DFVF_XYZB2, test_buffer, 1)); - } - { - static const D3DVERTEXELEMENT9 test_buffer[] = - { { 0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0 }, - { 0, 12, D3DDECLTYPE_FLOAT1, 0, D3DDECLUSAGE_BLENDWEIGHT, 0 }, - { 0, 16, D3DDECLTYPE_UBYTE4, 0, D3DDECLUSAGE_BLENDINDICES, 0 }, D3DDECL_END() }; - VDECL_CHECK(test_fvf_to_decl(pDevice, default_decl, - D3DFVF_XYZB2 | D3DFVF_LASTBETA_UBYTE4, test_buffer, 1)); - } - { - static const D3DVERTEXELEMENT9 test_buffer[] = - { { 0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0 }, - { 0, 12, D3DDECLTYPE_D3DCOLOR, 0, D3DDECLUSAGE_BLENDWEIGHT, 0 }, - { 0, 16, D3DDECLTYPE_UBYTE4, 0, D3DDECLUSAGE_BLENDINDICES, 0 }, D3DDECL_END() }; - VDECL_CHECK(test_fvf_to_decl(pDevice, default_decl, - D3DFVF_XYZB2 | D3DFVF_LASTBETA_D3DCOLOR, test_buffer, 1)); - } - { - static const D3DVERTEXELEMENT9 test_buffer[] = - { { 0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0 }, - { 0, 12, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_BLENDWEIGHT, 0 }, D3DDECL_END() }; - VDECL_CHECK(test_fvf_to_decl(pDevice, default_decl, D3DFVF_XYZB3, test_buffer, 1)); - } - { - static const D3DVERTEXELEMENT9 test_buffer[] = - { { 0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0 }, - { 0, 12, D3DDECLTYPE_FLOAT2, 0, D3DDECLUSAGE_BLENDWEIGHT, 0 }, - { 0, 20, D3DDECLTYPE_UBYTE4, 0, D3DDECLUSAGE_BLENDINDICES, 0 }, D3DDECL_END() }; - VDECL_CHECK(test_fvf_to_decl(pDevice, default_decl, - D3DFVF_XYZB3 | D3DFVF_LASTBETA_UBYTE4, test_buffer, 1)); - } - { - static const D3DVERTEXELEMENT9 test_buffer[] = - { { 0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0 }, - { 0, 12, D3DDECLTYPE_FLOAT2, 0, D3DDECLUSAGE_BLENDWEIGHT, 0 }, - { 0, 20, D3DDECLTYPE_D3DCOLOR, 0, D3DDECLUSAGE_BLENDINDICES, 0 }, D3DDECL_END() }; - VDECL_CHECK(test_fvf_to_decl(pDevice, default_decl, - D3DFVF_XYZB3 | D3DFVF_LASTBETA_D3DCOLOR, test_buffer, 1)); - } - { - static const D3DVERTEXELEMENT9 test_buffer[] = - { { 0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0 }, - { 0, 12, D3DDECLTYPE_FLOAT4, 0, D3DDECLUSAGE_BLENDWEIGHT, 0 }, D3DDECL_END() }; - VDECL_CHECK(test_fvf_to_decl(pDevice, default_decl, D3DFVF_XYZB4, test_buffer, 1)); - } - { - static const D3DVERTEXELEMENT9 test_buffer[] = - { { 0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0 }, - { 0, 12, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_BLENDWEIGHT, 0 }, - { 0, 24, D3DDECLTYPE_UBYTE4, 0, D3DDECLUSAGE_BLENDINDICES, 0 }, D3DDECL_END() }; - VDECL_CHECK(test_fvf_to_decl(pDevice, default_decl, - D3DFVF_XYZB4 | D3DFVF_LASTBETA_UBYTE4, test_buffer, 1)); - } - { - static const D3DVERTEXELEMENT9 test_buffer[] = - { { 0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0 }, - { 0, 12, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_BLENDWEIGHT, 0 }, - { 0, 24, D3DDECLTYPE_D3DCOLOR, 0, D3DDECLUSAGE_BLENDINDICES, 0 }, D3DDECL_END() }; - VDECL_CHECK(test_fvf_to_decl(pDevice, default_decl, - D3DFVF_XYZB4 | D3DFVF_LASTBETA_D3DCOLOR, test_buffer, 1)); - } - { - static const D3DVERTEXELEMENT9 test_buffer[] = - { { 0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_NORMAL, 0 }, D3DDECL_END() }; - VDECL_CHECK(test_fvf_to_decl(pDevice, default_decl, D3DFVF_NORMAL, test_buffer, 1)); - } - { - static const D3DVERTEXELEMENT9 test_buffer[] = - { { 0, 0, D3DDECLTYPE_FLOAT1, 0, D3DDECLUSAGE_PSIZE, 0 }, D3DDECL_END() }; - VDECL_CHECK(test_fvf_to_decl(pDevice, default_decl, D3DFVF_PSIZE, test_buffer, 1)); - } - { - static const D3DVERTEXELEMENT9 test_buffer[] = - { { 0, 0, D3DDECLTYPE_D3DCOLOR, 0, D3DDECLUSAGE_COLOR, 0 }, D3DDECL_END() }; - VDECL_CHECK(test_fvf_to_decl(pDevice, default_decl, D3DFVF_DIFFUSE, test_buffer, 1)); - } - { - static const D3DVERTEXELEMENT9 test_buffer[] = - { { 0, 0, D3DDECLTYPE_D3DCOLOR, 0, D3DDECLUSAGE_COLOR, 1 }, D3DDECL_END() }; - VDECL_CHECK(test_fvf_to_decl(pDevice, default_decl, D3DFVF_SPECULAR, test_buffer, 1)); - } - - /* Make sure textures of different sizes work */ - { - static const D3DVERTEXELEMENT9 test_buffer[] = - { { 0, 0, D3DDECLTYPE_FLOAT1, 0, D3DDECLUSAGE_TEXCOORD, 0 }, D3DDECL_END() }; - VDECL_CHECK(test_fvf_to_decl(pDevice, default_decl, - D3DFVF_TEXCOORDSIZE1(0) | D3DFVF_TEX1, test_buffer, 1)); - } - { - static const D3DVERTEXELEMENT9 test_buffer[] = - { { 0, 0, D3DDECLTYPE_FLOAT2, 0, D3DDECLUSAGE_TEXCOORD, 0 }, D3DDECL_END() }; - VDECL_CHECK(test_fvf_to_decl(pDevice, default_decl, - D3DFVF_TEXCOORDSIZE2(0) | D3DFVF_TEX1, test_buffer, 1)); - } - { - static const D3DVERTEXELEMENT9 test_buffer[] = - { { 0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_TEXCOORD, 0 }, D3DDECL_END() }; - VDECL_CHECK(test_fvf_to_decl(pDevice, default_decl, - D3DFVF_TEXCOORDSIZE3(0) | D3DFVF_TEX1, test_buffer, 1)); - } - { - static const D3DVERTEXELEMENT9 test_buffer[] = - { { 0, 0, D3DDECLTYPE_FLOAT4, 0, D3DDECLUSAGE_TEXCOORD, 0 }, D3DDECL_END() }; - VDECL_CHECK(test_fvf_to_decl(pDevice, default_decl, - D3DFVF_TEXCOORDSIZE4(0) | D3DFVF_TEX1, test_buffer, 1)); - } - - /* Make sure the TEXCOORD index works correctly - try several textures */ - { - static const D3DVERTEXELEMENT9 test_buffer[] = - { { 0, 0, D3DDECLTYPE_FLOAT1, 0, D3DDECLUSAGE_TEXCOORD, 0 }, - { 0, 4, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_TEXCOORD, 1 }, - { 0, 16, D3DDECLTYPE_FLOAT2, 0, D3DDECLUSAGE_TEXCOORD, 2 }, - { 0, 24, D3DDECLTYPE_FLOAT4, 0, D3DDECLUSAGE_TEXCOORD, 3 }, D3DDECL_END() }; - VDECL_CHECK(test_fvf_to_decl(pDevice, default_decl, - D3DFVF_TEXCOORDSIZE1(0) | D3DFVF_TEXCOORDSIZE3(1) | D3DFVF_TEXCOORDSIZE2(2) | - D3DFVF_TEXCOORDSIZE4(3) | D3DFVF_TEX4, test_buffer, 1)); - } - - /* Now try a combination test */ - { - static const D3DVERTEXELEMENT9 test_buffer[] = - { { 0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0 }, - { 0, 12, D3DDECLTYPE_FLOAT4, 0, D3DDECLUSAGE_BLENDWEIGHT, 0 }, - { 0, 28, D3DDECLTYPE_D3DCOLOR, 0, D3DDECLUSAGE_COLOR, 0 }, - { 0, 32, D3DDECLTYPE_D3DCOLOR, 0, D3DDECLUSAGE_COLOR, 1 }, - { 0, 36, D3DDECLTYPE_FLOAT2, 0, D3DDECLUSAGE_TEXCOORD, 0 }, - { 0, 44, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_TEXCOORD, 1 }, D3DDECL_END() }; - VDECL_CHECK(test_fvf_to_decl(pDevice, default_decl, D3DFVF_XYZB4 | D3DFVF_SPECULAR | D3DFVF_DIFFUSE | - D3DFVF_TEXCOORDSIZE2(0) | D3DFVF_TEXCOORDSIZE3(1) | D3DFVF_TEX2, test_buffer, 1)); - } - - /* Setting the FVF to 0 should result in no change to the default decl */ - VDECL_CHECK(test_fvf_to_decl(pDevice, default_decl, 0, default_elements, 0)); - - cleanup: - IDirect3DDevice9_SetVertexDeclaration ( pDevice, NULL ); - if ( default_decl ) IDirect3DVertexDeclaration9_Release (default_decl); -} - -/* Check whether a declaration converted from FVF is shared. - * Check whether refcounts behave as expected */ -static void test_fvf_decl_management( - IDirect3DDevice9* device) { - - HRESULT hr; - IDirect3DVertexDeclaration9* result_decl1 = NULL; - IDirect3DVertexDeclaration9* result_decl2 = NULL; - IDirect3DVertexDeclaration9* result_decl3 = NULL; - IDirect3DVertexDeclaration9* result_decl4 = NULL; - int ref1, ref2, ref3, ref4; - - DWORD test_fvf1 = D3DFVF_XYZRHW; - DWORD test_fvf2 = D3DFVF_NORMAL; - static const D3DVERTEXELEMENT9 test_elements1[] = - { { 0, 0, D3DDECLTYPE_FLOAT4, 0, D3DDECLUSAGE_POSITIONT, 0 }, D3DDECL_END() }; - static const D3DVERTEXELEMENT9 test_elements2[] = - { { 0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_NORMAL, 0 }, D3DDECL_END() }; - - /* Clear down any current vertex declaration */ - hr = IDirect3DDevice9_SetVertexDeclaration ( device, NULL ); - ok (SUCCEEDED(hr), "SetVertexDeclaration returned %#x, expected %#x\n", hr, D3D_OK); - if (FAILED(hr)) return; - - /* Conversion */ - hr = IDirect3DDevice9_SetFVF( device, test_fvf1); - ok(SUCCEEDED(hr), "SetFVF returned %#x, expected %#x\n", hr, D3D_OK); - if (FAILED(hr)) return; - - /* Get converted decl (#1) */ - hr = IDirect3DDevice9_GetVertexDeclaration ( device, &result_decl1); - ok(SUCCEEDED(hr), "GetVertexDeclaration returned %#x, expected %#x\n", hr, D3D_OK); - if (FAILED(hr)) return; - - /* Get converted decl again (#2) */ - hr = IDirect3DDevice9_GetVertexDeclaration ( device, &result_decl2); - ok(SUCCEEDED(hr), "GetVertexDeclaration returned %#x, expected %#x\n", hr, D3D_OK); - if (FAILED(hr)) return; - - /* Conversion */ - hr = IDirect3DDevice9_SetFVF( device, test_fvf2); - ok(SUCCEEDED(hr), "SetFVF returned %#x, expected %#x\n", hr, D3D_OK); - if (FAILED(hr)) return; - - /* The contents should correspond to the first conversion */ - VDECL_CHECK(compare_elements(result_decl1, test_elements1)); - - /* Get converted decl (#3) */ - hr = IDirect3DDevice9_GetVertexDeclaration ( device, &result_decl3); - ok(SUCCEEDED(hr), "GetVertexDeclaration returned %#x, expected %#x\n", hr, D3D_OK); - if (FAILED(hr)) return; - - /* The object should be the same */ - ok (result_decl1 == result_decl2, "Declaration object changes on the second Get() call\n"); - ok (result_decl2 != result_decl3, "Declaration object did not change during conversion\n"); - - /* The contents should correspond to the second conversion */ - VDECL_CHECK(compare_elements(result_decl3, test_elements2)); - /* Re-Check if the first decl was overwritten by the new Get() */ - VDECL_CHECK(compare_elements(result_decl1, test_elements1)); - - hr = IDirect3DDevice9_SetFVF( device, test_fvf1); - ok(SUCCEEDED(hr), "SetFVF returned %#x, expected %#x\n", hr, D3D_OK); - if (FAILED(hr)) return; - - hr = IDirect3DDevice9_GetVertexDeclaration ( device, &result_decl4); - ok(SUCCEEDED(hr), "GetVertexDeclaration returned %#x, expected %#x\n", hr, D3D_OK); - if (FAILED(hr)) return; - - ok(result_decl4 == result_decl1, "Setting an already used FVF over results in a different vertexdeclaration\n"); - - ref1 = get_refcount((IUnknown*) result_decl1); - ref2 = get_refcount((IUnknown*) result_decl2); - ref3 = get_refcount((IUnknown*) result_decl3); - ref4 = get_refcount((IUnknown*) result_decl4); - ok (ref1 == 3, "Refcount #1 is %d, expected 3\n", ref1); - ok (ref2 == 3, "Refcount #2 is %d, expected 3\n", ref2); - ok (ref3 == 1, "Refcount #3 is %d, expected 1\n", ref3); - ok (ref4 == 3, "Refcount #4 is %d, expected 3\n", ref4); - - /* Clear down any current vertex declaration */ - hr = IDirect3DDevice9_SetVertexDeclaration ( device, NULL ); - ok (SUCCEEDED(hr), "SetVertexDeclaration returned %#x, expected %#x\n", hr, D3D_OK); - if (FAILED(hr)) return; - - IDirect3DVertexDeclaration9_Release(result_decl1); - IDirect3DVertexDeclaration9_Release(result_decl2); - IDirect3DVertexDeclaration9_Release(result_decl3); - IDirect3DVertexDeclaration9_Release(result_decl4); - - return; -} - -static void test_vertex_declaration_alignment( - IDirect3DDevice9* device) { - - HRESULT hr; - IDirect3DVertexDeclaration9* result_decl = NULL; - unsigned int i; - - static const D3DVERTEXELEMENT9 test_elements[5][3] = - { - { - { 0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0 }, - { 0, 16, D3DDECLTYPE_D3DCOLOR, 0, D3DDECLUSAGE_COLOR , 0 }, - D3DDECL_END() - }, - { - { 0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0 }, - { 0, 17, D3DDECLTYPE_D3DCOLOR, 0, D3DDECLUSAGE_COLOR , 0 }, - D3DDECL_END() - }, - { - { 0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0 }, - { 0, 18, D3DDECLTYPE_D3DCOLOR, 0, D3DDECLUSAGE_COLOR , 0 }, - D3DDECL_END() - }, - { - { 0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0 }, - { 0, 19, D3DDECLTYPE_D3DCOLOR, 0, D3DDECLUSAGE_COLOR , 0 }, - D3DDECL_END() - }, - { - { 0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0 }, - { 0, 20, D3DDECLTYPE_D3DCOLOR, 0, D3DDECLUSAGE_COLOR , 0 }, - D3DDECL_END() - } - }; - HRESULT results[5] = {D3D_OK, E_FAIL, E_FAIL, E_FAIL, D3D_OK}; - - for(i = 0; i < sizeof(test_elements) / sizeof(test_elements[0]); i++) { - result_decl = NULL; - hr = IDirect3DDevice9_CreateVertexDeclaration(device, test_elements[i], &result_decl); - ok(hr == results[i], "CreateVertexDeclaration for declaration %d returned %#x, expected %#x\n", - i, hr, results[i]); - if(result_decl) IDirect3DVertexDeclaration9_Release(result_decl); - } -} - -static void test_unused_type( - IDirect3DDevice9* device) { - - HRESULT hr; - IDirect3DVertexDeclaration9* result_decl = NULL; - unsigned int i; - - static const D3DVERTEXELEMENT9 test_elements[][3] = - { - { - { 0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0 }, - { 0, 16, D3DDECLTYPE_UNUSED, 0, D3DDECLUSAGE_COLOR , 0 }, - D3DDECL_END() - }, - { - { 0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0 }, - { 0, 16, D3DDECLTYPE_UNUSED, 0, D3DDECLUSAGE_TEXCOORD, 0 }, - D3DDECL_END() - }, - { - { 0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0 }, - { 0, 16, D3DDECLTYPE_UNUSED, 0, D3DDECLUSAGE_TEXCOORD, 1 }, - D3DDECL_END() - }, - { - { 0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0 }, - { 0, 16, D3DDECLTYPE_UNUSED, 0, D3DDECLUSAGE_TEXCOORD, 12}, - D3DDECL_END() - }, - { - { 0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0 }, - { 1, 16, D3DDECLTYPE_UNUSED, 0, D3DDECLUSAGE_TEXCOORD, 12}, - D3DDECL_END() - }, - { - { 0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0 }, - { 0, 16, D3DDECLTYPE_UNUSED, 0, D3DDECLUSAGE_NORMAL, 0 }, - D3DDECL_END() - }, - { - { 0, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0 }, - { 1, 16, D3DDECLTYPE_UNUSED, 0, D3DDECLUSAGE_NORMAL, 0 }, - D3DDECL_END() - }, - }; - - for(i = 0; i < sizeof(test_elements) / sizeof(test_elements[0]); i++) { - result_decl = NULL; - hr = IDirect3DDevice9_CreateVertexDeclaration(device, test_elements[i], &result_decl); - ok(hr == E_FAIL, "CreateVertexDeclaration for declaration %d returned %#x, expected E_FAIL(%#x)\n", - i, hr, E_FAIL); - if(result_decl) IDirect3DVertexDeclaration9_Release(result_decl); - } -} -START_TEST(vertexdeclaration) -{ - static D3DVERTEXELEMENT9 simple_decl[] = { - { 0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0 }, - D3DDECL_END()}; - UINT simple_decl_num_elements = sizeof(simple_decl) / sizeof(*simple_decl); - IDirect3DDevice9 *device_ptr = 0; - IDirect3DVertexDeclaration9 *decl_ptr = 0; - ULONG refcount; - - if (!(device_ptr = init_d3d9())) - { - skip("Failed to initialise d3d9\n"); - return; - } - - decl_ptr = test_create_vertex_declaration(device_ptr, simple_decl); - if (!decl_ptr) - { - skip("Failed to create a vertex declaration\n"); - return; - } - - test_get_set_vertex_declaration(device_ptr, decl_ptr); - test_get_declaration(decl_ptr, simple_decl, simple_decl_num_elements); - test_fvf_decl_conversion(device_ptr); - test_fvf_decl_management(device_ptr); - test_vertex_declaration_alignment(device_ptr); - test_unused_type(device_ptr); - - IDirect3DVertexDeclaration9_Release(decl_ptr); - - refcount = IDirect3DDevice9_Release(device_ptr); - ok(!refcount, "Device has %u references left\n", refcount); -} diff -Nru wine1.7-1.7.14/dlls/d3d9/tests/visual.c wine1.7-1.7.18/dlls/d3d9/tests/visual.c --- wine1.7-1.7.14/dlls/d3d9/tests/visual.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/d3d9/tests/visual.c 2014-05-02 18:15:48.000000000 +0000 @@ -171,13 +171,13 @@ return ret; } -static IDirect3DDevice9 *create_device(IDirect3D9 *d3d9) +static IDirect3DDevice9 *create_device(IDirect3D9 *d3d, HWND device_window, HWND focus_window, BOOL windowed) { D3DPRESENT_PARAMETERS present_parameters = {0}; IDirect3DDevice9 *device; - present_parameters.Windowed = TRUE; - present_parameters.hDeviceWindow = create_window(); + present_parameters.Windowed = windowed; + present_parameters.hDeviceWindow = device_window; present_parameters.SwapEffect = D3DSWAPEFFECT_DISCARD; present_parameters.BackBufferWidth = 640; present_parameters.BackBufferHeight = 480; @@ -185,44 +185,13 @@ present_parameters.EnableAutoDepthStencil = TRUE; present_parameters.AutoDepthStencilFormat = D3DFMT_D24S8; - if (SUCCEEDED(IDirect3D9_CreateDevice(d3d9, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, - present_parameters.hDeviceWindow, D3DCREATE_HARDWARE_VERTEXPROCESSING, &present_parameters, &device))) + if (SUCCEEDED(IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, focus_window, + D3DCREATE_HARDWARE_VERTEXPROCESSING, &present_parameters, &device))) return device; - DestroyWindow(present_parameters.hDeviceWindow); return NULL; } -static IDirect3DDevice9 *init_d3d9(void) -{ - D3DADAPTER_IDENTIFIER9 identifier; - IDirect3D9 *d3d9; - HRESULT hr; - - if (!(d3d9 = Direct3DCreate9(D3D_SDK_VERSION))) - { - win_skip("could not create D3D9\n"); - return NULL; - } - - memset(&identifier, 0, sizeof(identifier)); - hr = IDirect3D9_GetAdapterIdentifier(d3d9, 0, 0, &identifier); - ok(hr == D3D_OK, "Failed to get adapter identifier description\n"); - trace("Driver string: \"%s\"\n", identifier.Driver); - trace("Description string: \"%s\"\n", identifier.Description); - /* Only Windows XP's default VGA driver should have an empty description */ - ok(identifier.Description[0] != '\0' || - broken(strcmp(identifier.Driver, "vga.dll") == 0), - "Empty driver description\n"); - trace("Device name string: \"%s\"\n", identifier.DeviceName); - ok(identifier.DeviceName[0] != '\0', "Empty device name\n"); - trace("Driver version %d.%d.%d.%d\n", - HIWORD(U(identifier.DriverVersion).HighPart), LOWORD(U(identifier.DriverVersion).HighPart), - HIWORD(U(identifier.DriverVersion).LowPart), LOWORD(U(identifier.DriverVersion).LowPart)); - - return create_device(d3d9); -} - static void cleanup_device(IDirect3DDevice9 *device) { if (device) @@ -259,60 +228,123 @@ DWORD diffuse; }; -static void lighting_test(IDirect3DDevice9 *device) +static void test_sanity(void) { + IDirect3DDevice9 *device; + IDirect3D9 *d3d; + D3DCOLOR color; + ULONG refcount; + HWND window; HRESULT hr; - DWORD fvf = D3DFVF_XYZ | D3DFVF_DIFFUSE; - DWORD nfvf = D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_NORMAL; - DWORD color; - D3DMATERIAL9 material, old_material; - DWORD cop, carg; - DWORD old_colorwrite; - float mat[16] = { 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 }; + 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"); + goto done; + } + + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffff0000, 1.0f, 0); + ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + color = getPixelColor(device, 1, 1); + ok(color == 0x00ff0000, "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); + + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff00ddee, 0.0, 0); + ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + color = getPixelColor(device, 639, 479); + ok(color == 0x0000ddee, "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); + + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); +} + +static void lighting_test(void) +{ + DWORD nfvf = D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_NORMAL; + DWORD fvf = D3DFVF_XYZ | D3DFVF_DIFFUSE; + IDirect3DDevice9 *device; + D3DMATERIAL9 material; + IDirect3D9 *d3d; + D3DCOLOR color; + ULONG refcount; + HWND window; + HRESULT hr; - struct vertex unlitquad[] = + 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 vertex unlitquad[] = { - {-1.0f, -1.0f, 0.1f, 0xffff0000}, - {-1.0f, 0.0f, 0.1f, 0xffff0000}, - { 0.0f, 0.0f, 0.1f, 0xffff0000}, - { 0.0f, -1.0f, 0.1f, 0xffff0000}, + {-1.0f, -1.0f, 0.1f, 0xffff0000}, + {-1.0f, 0.0f, 0.1f, 0xffff0000}, + { 0.0f, 0.0f, 0.1f, 0xffff0000}, + { 0.0f, -1.0f, 0.1f, 0xffff0000}, }; - struct vertex litquad[] = + static const struct vertex litquad[] = { - {-1.0f, 0.0f, 0.1f, 0xff00ff00}, - {-1.0f, 1.0f, 0.1f, 0xff00ff00}, - { 0.0f, 1.0f, 0.1f, 0xff00ff00}, - { 0.0f, 0.0f, 0.1f, 0xff00ff00}, + {-1.0f, 0.0f, 0.1f, 0xff00ff00}, + {-1.0f, 1.0f, 0.1f, 0xff00ff00}, + { 0.0f, 1.0f, 0.1f, 0xff00ff00}, + { 0.0f, 0.0f, 0.1f, 0xff00ff00}, }; - struct nvertex unlitnquad[] = + static const struct vertex lighting_test[] = { - { 0.0f, -1.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xff0000ff}, - { 0.0f, 0.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xff0000ff}, - { 1.0f, 0.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xff0000ff}, - { 1.0f, -1.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xff0000ff}, + {-1.0f, -1.0f, 0.1f, 0x8000ff00}, + { 1.0f, -1.0f, 0.1f, 0x80000000}, + {-1.0f, 1.0f, 0.1f, 0x8000ff00}, + { 1.0f, 1.0f, 0.1f, 0x80000000}, }; - struct nvertex litnquad[] = + static const struct nvertex unlitnquad[] = { - { 0.0f, 0.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xffffff00}, - { 0.0f, 1.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xffffff00}, - { 1.0f, 1.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xffffff00}, - { 1.0f, 0.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xffffff00}, + { 0.0f, -1.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xff0000ff}, + { 0.0f, 0.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xff0000ff}, + { 1.0f, 0.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xff0000ff}, + { 1.0f, -1.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xff0000ff}, }; - WORD Indices[] = {0, 1, 2, 2, 3, 0}; + static const struct nvertex litnquad[] = + { + { 0.0f, 0.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xffffff00}, + { 0.0f, 1.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xffffff00}, + { 1.0f, 1.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xffffff00}, + { 1.0f, 0.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xffffff00}, + }; + static const WORD Indices[] = {0, 1, 2, 2, 3, 0}; + + 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"); + goto done; + } hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffffff, 0.0, 0); ok(hr == D3D_OK, "IDirect3DDevice9_Clear failed with %08x\n", hr); /* Setup some states that may cause issues */ - hr = IDirect3DDevice9_SetTransform(device, D3DTS_WORLDMATRIX(0), (D3DMATRIX *) mat); + hr = IDirect3DDevice9_SetTransform(device, D3DTS_WORLDMATRIX(0), &mat); ok(hr == D3D_OK, "IDirect3DDevice9_SetTransform returned %08x\n", hr); - hr = IDirect3DDevice9_SetTransform(device, D3DTS_VIEW, (D3DMATRIX *)mat); + hr = IDirect3DDevice9_SetTransform(device, D3DTS_VIEW, &mat); ok(hr == D3D_OK, "IDirect3DDevice9_SetTransform returned %08x\n", hr); - hr = IDirect3DDevice9_SetTransform(device, D3DTS_PROJECTION, (D3DMATRIX *) mat); + hr = IDirect3DDevice9_SetTransform(device, D3DTS_PROJECTION, &mat); ok(hr == D3D_OK, "IDirect3DDevice9_SetTransform returned %08x\n", hr); hr = IDirect3DDevice9_SetRenderState(device, D3DRS_CLIPPING, FALSE); ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState returned %08x\n", hr); @@ -330,8 +362,6 @@ ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState returned %08x\n", hr); hr = IDirect3DDevice9_SetRenderState(device, D3DRS_CULLMODE, D3DCULL_NONE); ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState failed with %08x\n", hr); - hr = IDirect3DDevice9_GetRenderState(device, D3DRS_COLORWRITEENABLE, &old_colorwrite); - ok(hr == D3D_OK, "IDirect3DDevice9_GetRenderState failed with %08x\n", hr); hr = IDirect3DDevice9_SetRenderState(device, D3DRS_COLORWRITEENABLE, D3DCOLORWRITEENABLE_RED | D3DCOLORWRITEENABLE_GREEN | D3DCOLORWRITEENABLE_BLUE); ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState failed with %08x\n", hr); @@ -342,40 +372,38 @@ ok(hr == D3D_OK, "IDirect3DDevice9_SetFVF returned %08x\n", hr); hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene failed with %08x\n", hr); - if(hr == D3D_OK) - { - /* No lights are defined... That means, lit vertices should be entirely black */ - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_LIGHTING, FALSE); - ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState returned %08x\n", hr); - hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */, - 2 /*PrimCount */, Indices, D3DFMT_INDEX16, unlitquad, sizeof(unlitquad[0])); - ok(hr == D3D_OK, "IDirect3DDevice9_DrawIndexedPrimitiveUP failed with %08x\n", hr); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_LIGHTING, TRUE); - ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState returned %08x\n", hr); - hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */, - 2 /*PrimCount */, Indices, D3DFMT_INDEX16, litquad, sizeof(litquad[0])); - ok(hr == D3D_OK, "IDirect3DDevice9_DrawIndexedPrimitiveUP failed with %08x\n", hr); + /* No lights are defined... That means, lit vertices should be entirely black */ + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_LIGHTING, FALSE); + ok(SUCCEEDED(hr), "Failed to disable lighting, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */, + 2 /* PrimCount */, Indices, D3DFMT_INDEX16, unlitquad, sizeof(unlitquad[0])); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetFVF(device, nfvf); - ok(hr == D3D_OK, "IDirect3DDevice9_SetFVF failed with %08x\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_LIGHTING, TRUE); + ok(SUCCEEDED(hr), "Failed to enable lighting, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */, + 2 /* PrimCount */, Indices, D3DFMT_INDEX16, litquad, sizeof(litquad[0])); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_LIGHTING, FALSE); - ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState returned %08x\n", hr); - hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */, - 2 /*PrimCount */, Indices, D3DFMT_INDEX16, unlitnquad, sizeof(unlitnquad[0])); - ok(hr == D3D_OK, "IDirect3DDevice9_DrawIndexedPrimitiveUP failed with %08x\n", hr); + hr = IDirect3DDevice9_SetFVF(device, nfvf); + ok(SUCCEEDED(hr), "Failed to set FVF, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_LIGHTING, TRUE); - ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState returned %08x\n", hr); - hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */, - 2 /*PrimCount */, Indices, D3DFMT_INDEX16, litnquad, sizeof(litnquad[0])); - ok(hr == D3D_OK, "IDirect3DDevice9_DrawIndexedPrimitiveUP failed with %08x\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_LIGHTING, FALSE); + ok(SUCCEEDED(hr), "Failed to disable lighting, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */, + 2 /* PrimCount */, Indices, D3DFMT_INDEX16, unlitnquad, sizeof(unlitnquad[0])); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_EndScene failed with %08x\n", hr); - } + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_LIGHTING, TRUE); + ok(SUCCEEDED(hr), "Failed to enable lighting, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */, + 2 /* PrimCount */, Indices, D3DFMT_INDEX16, litnquad, sizeof(litnquad[0])); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); color = getPixelColor(device, 160, 360); /* Lower left quad - unlit without normals */ ok(color == 0x00ff0000, "Unlit quad without normals has color 0x%08x, expected 0x00ff0000.\n", color); @@ -388,8 +416,6 @@ IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); - hr = IDirect3DDevice9_GetMaterial(device, &old_material); - ok(hr == D3D_OK, "IDirect3DDevice9_GetMaterial returned %08x\n", hr); memset(&material, 0, sizeof(material)); material.Diffuse.r = 0.0; material.Diffuse.g = 0.0; @@ -416,54 +442,34 @@ hr = IDirect3DDevice9_SetRenderState(device, D3DRS_SPECULARMATERIALSOURCE, D3DMCS_MATERIAL); ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState returned %08x\n", hr); - hr = IDirect3DDevice9_GetTextureStageState(device, 0, D3DTSS_COLOROP, &cop); - ok(hr == D3D_OK, "IDirect3DDevice9_GetTextureStageState returned %08x\n", hr); - hr = IDirect3DDevice9_GetTextureStageState(device, 0, D3DTSS_COLORARG1, &carg); - ok(hr == D3D_OK, "IDirect3DDevice9_GetTextureStageState returned %08x\n", hr); hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1); ok(hr == D3D_OK, "IDirect3DDevice9_SetTextureStageState returned %08x\n", hr); hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLORARG1, D3DTA_DIFFUSE | D3DTA_ALPHAREPLICATE); ok(hr == D3D_OK, "IDirect3DDevice9_SetTextureStageState returned %08x\n", hr); hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene returned %08x\n", hr); - if(SUCCEEDED(hr)) { - struct vertex lighting_test[] = { - {-1.0, -1.0, 0.1, 0x8000ff00}, - { 1.0, -1.0, 0.1, 0x80000000}, - {-1.0, 1.0, 0.1, 0x8000ff00}, - { 1.0, 1.0, 0.1, 0x80000000} - }; - hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_DIFFUSE); - ok(hr == D3D_OK, "IDirect3DDevice9_SetFVF failed, hr=%08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, lighting_test, sizeof(lighting_test[0])); - ok(hr == D3D_OK, "IDirect3DDevice9_DrawPrimitiveUP failed, hr=%08x\n", hr); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_EndScene returned %08x\n", hr); - } + hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_DIFFUSE); + ok(SUCCEEDED(hr), "Failed to set FVF, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, lighting_test, sizeof(lighting_test[0])); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); color = getPixelColor(device, 320, 240); ok(color == 0x00ffffff, "Lit vertex alpha test returned color %08x, expected 0x00ffffff\n", color); IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); - hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLOROP, cop); - ok(hr == D3D_OK, "IDirect3DDevice9_SetTextureStageState returned %08x\n", hr); - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_DIFFUSEMATERIALSOURCE, D3DMCS_COLOR1); - ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState returned %08x\n", hr); - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_SPECULARMATERIALSOURCE, D3DMCS_COLOR2); - ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState returned %08x\n", hr); - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_LIGHTING, FALSE); - ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState returned %08x\n", hr); - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_COLORWRITEENABLE, old_colorwrite); - ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState failed with %08x\n", hr); - hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLORARG1, carg); - ok(hr == D3D_OK, "IDirect3DDevice9_SetTextureStageState returned %08x\n", hr); - hr = IDirect3DDevice9_SetMaterial(device, &old_material); - ok(hr == D3D_OK, "IDirect3DDevice9_SetMaterial returned %08x\n", hr); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } -static void clear_test(IDirect3DDevice9 *device) +static void clear_test(void) { /* Tests the correctness of clearing parameters */ HRESULT hr; @@ -474,6 +480,20 @@ RECT scissor; DWORD oldColorWrite; BOOL invalid_clear_failed = FALSE; + IDirect3DDevice9 *device; + IDirect3D9 *d3d; + ULONG refcount; + HWND window; + + 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"); + goto done; + } hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffffff, 0.0, 0); ok(hr == D3D_OK, "IDirect3DDevice9_Clear failed with %08x\n", hr); @@ -710,80 +730,93 @@ "Clear with count = 1, rect = NULL has color %08x\n", color); IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); + + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } -static void color_fill_test(IDirect3DDevice9 *device) +static void color_fill_test(void) { + IDirect3DSurface9 *offscreen_surface; + IDirect3DSurface9 *backbuffer; + IDirect3DSurface9 *rt_surface; + D3DCOLOR fill_color, color; + IDirect3DDevice9 *device; + IDirect3D9 *d3d; + ULONG refcount; + HWND window; HRESULT hr; - IDirect3DSurface9 *backbuffer = NULL; - IDirect3DSurface9 *rt_surface = NULL; - IDirect3DSurface9 *offscreen_surface = NULL; - DWORD fill_color, color; + + 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"); + goto done; + } /* Test ColorFill on a the backbuffer (should pass) */ hr = IDirect3DDevice9_GetBackBuffer(device, 0, 0, D3DBACKBUFFER_TYPE_MONO, &backbuffer); ok(hr == D3D_OK, "Can't get back buffer, hr = %08x\n", hr); - if(backbuffer) - { - fill_color = 0x112233; - hr = IDirect3DDevice9_ColorFill(device, backbuffer, NULL, fill_color); - ok(SUCCEEDED(hr), "Color fill failed, hr %#x.\n", hr); - color = getPixelColor(device, 0, 0); - ok(color == fill_color, "Expected color %08x, got %08x\n", fill_color, color); + fill_color = 0x112233; + hr = IDirect3DDevice9_ColorFill(device, backbuffer, NULL, fill_color); + ok(SUCCEEDED(hr), "Color fill failed, hr %#x.\n", hr); - IDirect3DSurface9_Release(backbuffer); - } + color = getPixelColor(device, 0, 0); + ok(color == fill_color, "Expected color %08x, got %08x\n", fill_color, color); + + IDirect3DSurface9_Release(backbuffer); /* Test ColorFill on a render target surface (should pass) */ - hr = IDirect3DDevice9_CreateRenderTarget(device, 32, 32, D3DFMT_A8R8G8B8, D3DMULTISAMPLE_NONE, 0, TRUE, &rt_surface, NULL ); + hr = IDirect3DDevice9_CreateRenderTarget(device, 32, 32, D3DFMT_A8R8G8B8, + D3DMULTISAMPLE_NONE, 0, TRUE, &rt_surface, NULL ); ok(hr == D3D_OK, "Unable to create render target surface, hr = %08x\n", hr); - if(rt_surface) - { - fill_color = 0x445566; - hr = IDirect3DDevice9_ColorFill(device, rt_surface, NULL, fill_color); - ok(SUCCEEDED(hr), "Color fill failed, hr %#x.\n", hr); - color = getPixelColorFromSurface(rt_surface, 0, 0); - ok(color == fill_color, "Expected color %08x, got %08x\n", fill_color, color); + fill_color = 0x445566; + hr = IDirect3DDevice9_ColorFill(device, rt_surface, NULL, fill_color); + ok(SUCCEEDED(hr), "Color fill failed, hr %#x.\n", hr); - IDirect3DSurface9_Release(rt_surface); - } + color = getPixelColorFromSurface(rt_surface, 0, 0); + ok(color == fill_color, "Expected color %08x, got %08x\n", fill_color, color); + + IDirect3DSurface9_Release(rt_surface); /* Test ColorFill on an offscreen plain surface in D3DPOOL_DEFAULT (should pass) */ hr = IDirect3DDevice9_CreateOffscreenPlainSurface(device, 32, 32, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &offscreen_surface, NULL); ok(hr == D3D_OK, "Unable to create offscreen plain surface, hr = %08x\n", hr); - if(offscreen_surface) - { - fill_color = 0x778899; - hr = IDirect3DDevice9_ColorFill(device, offscreen_surface, NULL, fill_color); - ok(SUCCEEDED(hr), "Color fill failed, hr %#x.\n", hr); - color = getPixelColorFromSurface(offscreen_surface, 0, 0); - ok(color == fill_color, "Expected color %08x, got %08x\n", fill_color, color); + fill_color = 0x778899; + hr = IDirect3DDevice9_ColorFill(device, offscreen_surface, NULL, fill_color); + ok(SUCCEEDED(hr), "Color fill failed, hr %#x.\n", hr); - IDirect3DSurface9_Release(offscreen_surface); - } + color = getPixelColorFromSurface(offscreen_surface, 0, 0); + ok(color == fill_color, "Expected color %08x, got %08x\n", fill_color, color); + + IDirect3DSurface9_Release(offscreen_surface); /* Try ColorFill on an offscreen surface in sysmem (should fail) */ - offscreen_surface = NULL; hr = IDirect3DDevice9_CreateOffscreenPlainSurface(device, 32, 32, D3DFMT_A8R8G8B8, D3DPOOL_SYSTEMMEM, &offscreen_surface, NULL); ok(hr == D3D_OK, "Unable to create offscreen plain surface, hr = %08x\n", hr); - if(offscreen_surface) - { - hr = IDirect3DDevice9_ColorFill(device, offscreen_surface, NULL, 0); - ok(hr == D3DERR_INVALIDCALL, "ColorFill on offscreen sysmem surface failed with hr = %08x\n", hr); - IDirect3DSurface9_Release(offscreen_surface); - } -} + hr = IDirect3DDevice9_ColorFill(device, offscreen_surface, NULL, 0); + ok(hr == D3DERR_INVALIDCALL, "ColorFill on offscreen sysmem surface failed with hr = %08x\n", hr); -typedef struct { - float in[4]; - DWORD out; -} test_data_t; + IDirect3DSurface9_Release(offscreen_surface); + + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); +} /* * c7 mova ARGB mov ARGB @@ -794,9 +827,21 @@ * 1.6 2 0x00ff00ff 1 0x000000ff * 2.4 2 0x00ff00ff 2 0x00ff00ff */ -static void test_mova(IDirect3DDevice9 *device) +static void test_mova(void) { - static const DWORD mova_test[] = { + IDirect3DVertexDeclaration9 *vertex_declaration; + IDirect3DVertexShader9 *mova_shader; + IDirect3DVertexShader9 *mov_shader; + IDirect3DDevice9 *device; + unsigned int i, j; + IDirect3D9 *d3d; + ULONG refcount; + D3DCAPS9 caps; + HWND window; + HRESULT hr; + + static const DWORD mova_test[] = + { 0xfffe0200, /* vs_2_0 */ 0x0200001f, 0x80000000, 0x900f0000, /* dcl_position v0 */ 0x05000051, 0xa00f0000, 0x3f800000, 0x00000000, 0x00000000, 0x3f800000, /* def c0, 1.0, 0.0, 0.0, 1.0 */ @@ -811,7 +856,8 @@ 0x02000001, 0xc00f0000, 0x90e40000, /* mov oPos, v0 */ 0x0000ffff /* END */ }; - static const DWORD mov_test[] = { + static const DWORD mov_test[] = + { 0xfffe0101, /* vs_1_1 */ 0x0000001f, 0x80000000, 0x900f0000, /* dcl_position v0 */ 0x00000051, 0xa00f0000, 0x3f800000, 0x00000000, 0x00000000, 0x3f800000, /* def c0, 1.0, 0.0, 0.0, 1.0 */ @@ -826,8 +872,13 @@ 0x00000001, 0xc00f0000, 0x90e40000, /* mov oPos, v0 */ 0x0000ffff /* END */ }; - - static const test_data_t test_data[2][6] = { + static const struct + { + float in[4]; + DWORD out; + } + test_data[2][6] = + { { {{-2.4f, 0.0f, 0.0f, 0.0f}, 0x00ff0000}, {{-1.6f, 0.0f, 0.0f, 0.0f}, 0x00ffff00}, @@ -845,24 +896,37 @@ {{ 2.4f, 0.0f, 0.0f, 0.0f}, 0x00ff00ff} } }; - - static const float quad[][3] = { + static const struct vec3 quad[] = + { {-1.0f, -1.0f, 0.0f}, {-1.0f, 1.0f, 0.0f}, { 1.0f, -1.0f, 0.0f}, { 1.0f, 1.0f, 0.0f}, }; - - static const D3DVERTEXELEMENT9 decl_elements[] = { + static const D3DVERTEXELEMENT9 decl_elements[] = + { {0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, D3DDECL_END() }; - IDirect3DVertexDeclaration9 *vertex_declaration = NULL; - IDirect3DVertexShader9 *mova_shader = NULL; - IDirect3DVertexShader9 *mov_shader = NULL; - HRESULT hr; - UINT i, j; + 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"); + goto done; + } + + hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); + if (caps.VertexShaderVersion < D3DVS_VERSION(2, 0)) + { + skip("No vs_2_0 support, skipping tests.\n"); + IDirect3DDevice9_Release(device); + goto done; + } hr = IDirect3DDevice9_CreateVertexShader(device, mova_test, &mova_shader); ok(SUCCEEDED(hr), "CreateVertexShader failed (%08x)\n", hr); @@ -875,9 +939,9 @@ hr = IDirect3DDevice9_SetVertexShader(device, mov_shader); ok(SUCCEEDED(hr), "SetVertexShader failed (%08x)\n", hr); - for(j = 0; j < 2; ++j) + for (j = 0; j < sizeof(test_data) / sizeof(*test_data); ++j) { - for (i = 0; i < (sizeof(test_data[0]) / sizeof(test_data_t)); ++i) + for (i = 0; i < sizeof(*test_data) / sizeof(**test_data); ++i) { DWORD color; @@ -887,7 +951,7 @@ hr = IDirect3DDevice9_BeginScene(device); ok(SUCCEEDED(hr), "BeginScene failed (%08x)\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, &quad[0], 3 * sizeof(float)); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(*quad)); ok(SUCCEEDED(hr), "DrawPrimitiveUP failed (%08x)\n", hr); hr = IDirect3DDevice9_EndScene(device); @@ -907,129 +971,162 @@ ok(SUCCEEDED(hr), "SetVertexShader failed (%08x)\n", hr); } - hr = IDirect3DDevice9_SetVertexShader(device, NULL); - ok(SUCCEEDED(hr), "SetVertexShader failed (%08x)\n", hr); - IDirect3DVertexDeclaration9_Release(vertex_declaration); IDirect3DVertexShader9_Release(mova_shader); IDirect3DVertexShader9_Release(mov_shader); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } -struct sVertex { - float x, y, z; - DWORD diffuse; - DWORD specular; -}; - -struct sVertexT { - float x, y, z, rhw; - DWORD diffuse; - DWORD specular; -}; - -static void fog_test(IDirect3DDevice9 *device) +static void fog_test(void) { - HRESULT hr; - D3DCOLOR color; float start = 0.0f, end = 1.0f; + IDirect3DDevice9 *device; + IDirect3D9 *d3d; + D3DCOLOR color; + ULONG refcount; D3DCAPS9 caps; + HWND window; + HRESULT hr; int i; - /* Gets full z based fog with linear fog, no fog with specular color */ - struct sVertex untransformed_1[] = { - {-1, -1, 0.1f, 0xffff0000, 0xff000000 }, - {-1, 0, 0.1f, 0xffff0000, 0xff000000 }, - { 0, 0, 0.1f, 0xffff0000, 0xff000000 }, - { 0, -1, 0.1f, 0xffff0000, 0xff000000 }, - }; - /* Ok, I am too lazy to deal with transform matrices */ - struct sVertex untransformed_2[] = { - {-1, 0, 1.0f, 0xffff0000, 0xff000000 }, - {-1, 1, 1.0f, 0xffff0000, 0xff000000 }, - { 0, 1, 1.0f, 0xffff0000, 0xff000000 }, - { 0, 0, 1.0f, 0xffff0000, 0xff000000 }, - }; - /* Untransformed ones. Give them a different diffuse color to make the test look - * nicer. It also makes making sure that they are drawn correctly easier. - */ - struct sVertexT transformed_1[] = { - {320, 0, 1.0f, 1.0f, 0xffffff00, 0xff000000 }, - {640, 0, 1.0f, 1.0f, 0xffffff00, 0xff000000 }, - {640, 240, 1.0f, 1.0f, 0xffffff00, 0xff000000 }, - {320, 240, 1.0f, 1.0f, 0xffffff00, 0xff000000 }, - }; - struct sVertexT transformed_2[] = { - {320, 240, 1.0f, 1.0f, 0xffffff00, 0xff000000 }, - {640, 240, 1.0f, 1.0f, 0xffffff00, 0xff000000 }, - {640, 480, 1.0f, 1.0f, 0xffffff00, 0xff000000 }, - {320, 480, 1.0f, 1.0f, 0xffffff00, 0xff000000 }, - }; - struct vertex rev_fog_quads[] = { - {-1.0, -1.0, 0.1, 0x000000ff}, - {-1.0, 0.0, 0.1, 0x000000ff}, - { 0.0, 0.0, 0.1, 0x000000ff}, - { 0.0, -1.0, 0.1, 0x000000ff}, - - { 0.0, -1.0, 0.9, 0x000000ff}, - { 0.0, 0.0, 0.9, 0x000000ff}, - { 1.0, 0.0, 0.9, 0x000000ff}, - { 1.0, -1.0, 0.9, 0x000000ff}, - - { 0.0, 0.0, 0.4, 0x000000ff}, - { 0.0, 1.0, 0.4, 0x000000ff}, - { 1.0, 1.0, 0.4, 0x000000ff}, - { 1.0, 0.0, 0.4, 0x000000ff}, - - {-1.0, 0.0, 0.7, 0x000000ff}, - {-1.0, 1.0, 0.7, 0x000000ff}, - { 0.0, 1.0, 0.7, 0x000000ff}, - { 0.0, 0.0, 0.7, 0x000000ff}, - }; - WORD Indices[] = {0, 1, 2, 2, 3, 0}; - - const float ident_mat[16] = + /* Gets full z based fog with linear fog, no fog with specular color. */ + static const struct { - 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 - }; - const float world_mat1[16] = + float x, y, z; + D3DCOLOR diffuse; + D3DCOLOR specular; + } + untransformed_1[] = { + {-1.0f, -1.0f, 0.1f, 0xffff0000, 0xff000000}, + {-1.0f, 0.0f, 0.1f, 0xffff0000, 0xff000000}, + { 0.0f, 0.0f, 0.1f, 0xffff0000, 0xff000000}, + { 0.0f, -1.0f, 0.1f, 0xffff0000, 0xff000000}, + }, + /* Ok, I am too lazy to deal with transform matrices. */ + untransformed_2[] = + { + {-1.0f, 0.0f, 1.0f, 0xffff0000, 0xff000000}, + {-1.0f, 1.0f, 1.0f, 0xffff0000, 0xff000000}, + { 0.0f, 1.0f, 1.0f, 0xffff0000, 0xff000000}, + { 0.0f, 0.0f, 1.0f, 0xffff0000, 0xff000000}, + }, + untransformed_3[] = + { + {-1.0f, -1.0f, 0.4999f, 0xffff0000, 0xff000000}, + {-1.0f, 1.0f, 0.4999f, 0xffff0000, 0xff000000}, + { 1.0f, -1.0f, 0.4999f, 0xffff0000, 0xff000000}, + { 1.0f, 1.0f, 0.4999f, 0xffff0000, 0xff000000}, + }, + far_quad1[] = + { + {-1.0f, -1.0f, 0.5f, 0xffff0000, 0xff000000}, + {-1.0f, 0.0f, 0.5f, 0xffff0000, 0xff000000}, + { 0.0f, 0.0f, 0.5f, 0xffff0000, 0xff000000}, + { 0.0f, -1.0f, 0.5f, 0xffff0000, 0xff000000}, + }, + far_quad2[] = + { + {-1.0f, 0.0f, 1.5f, 0xffff0000, 0xff000000}, + {-1.0f, 1.0f, 1.5f, 0xffff0000, 0xff000000}, + { 0.0f, 1.0f, 1.5f, 0xffff0000, 0xff000000}, + { 0.0f, 0.0f, 1.5f, 0xffff0000, 0xff000000}, + }; + /* Untransformed ones. Give them a different diffuse color to make the + * test look nicer. It also makes making sure that they are drawn + * correctly easier. */ + static const struct + { + float x, y, z, rhw; + D3DCOLOR diffuse; + D3DCOLOR specular; + } + transformed_1[] = + { + {320.0f, 0.0f, 1.0f, 1.0f, 0xffffff00, 0xff000000}, + {640.0f, 0.0f, 1.0f, 1.0f, 0xffffff00, 0xff000000}, + {640.0f, 240.0f, 1.0f, 1.0f, 0xffffff00, 0xff000000}, + {320.0f, 240.0f, 1.0f, 1.0f, 0xffffff00, 0xff000000}, + }, + transformed_2[] = + { + {320.0f, 240.0f, 1.0f, 1.0f, 0xffffff00, 0xff000000}, + {640.0f, 240.0f, 1.0f, 1.0f, 0xffffff00, 0xff000000}, + {640.0f, 480.0f, 1.0f, 1.0f, 0xffffff00, 0xff000000}, + {320.0f, 480.0f, 1.0f, 1.0f, 0xffffff00, 0xff000000}, + }; + static const struct vertex rev_fog_quads[] = + { + {-1.0f, -1.0f, 0.1f, 0x000000ff}, + {-1.0f, 0.0f, 0.1f, 0x000000ff}, + { 0.0f, 0.0f, 0.1f, 0x000000ff}, + { 0.0f, -1.0f, 0.1f, 0x000000ff}, + + { 0.0f, -1.0f, 0.9f, 0x000000ff}, + { 0.0f, 0.0f, 0.9f, 0x000000ff}, + { 1.0f, 0.0f, 0.9f, 0x000000ff}, + { 1.0f, -1.0f, 0.9f, 0x000000ff}, + + { 0.0f, 0.0f, 0.4f, 0x000000ff}, + { 0.0f, 1.0f, 0.4f, 0x000000ff}, + { 1.0f, 1.0f, 0.4f, 0x000000ff}, + { 1.0f, 0.0f, 0.4f, 0x000000ff}, + + {-1.0f, 0.0f, 0.7f, 0x000000ff}, + {-1.0f, 1.0f, 0.7f, 0x000000ff}, + { 0.0f, 1.0f, 0.7f, 0x000000ff}, + { 0.0f, 0.0f, 0.7f, 0x000000ff}, + }; + static const D3DMATRIX ident_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 D3DMATRIX world_mat1 = + {{{ 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.5f, 1.0f - }; - const float world_mat2[16] = - { - 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, 1.0f, 1.0f - }; - const float proj_mat[16] = - { + }}}; + static const D3DMATRIX world_mat2 = + {{{ + 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, 1.0f, 1.0f + }}}; + static const D3DMATRIX proj_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, -1.0f, 1.0f - }; - - const struct sVertex far_quad1[] = + }}}; + static const WORD Indices[] = {0, 1, 2, 2, 3, 0}; + static const WORD Indices2[] = + { + 0, 1, 2, 2, 3, 0, + 4, 5, 6, 6, 7, 4, + 8, 9, 10, 10, 11, 8, + 12, 13, 14, 14, 15, 12, + }; + + 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))) { - {-1.0f, -1.0f, 0.5f, 0xffff0000, 0xff000000}, - {-1.0f, 0.0f, 0.5f, 0xffff0000, 0xff000000}, - { 0.0f, 0.0f, 0.5f, 0xffff0000, 0xff000000}, - { 0.0f, -1.0f, 0.5f, 0xffff0000, 0xff000000}, - }; - const struct sVertex far_quad2[] = - { - {-1.0f, 0.0f, 1.5f, 0xffff0000, 0xff000000}, - {-1.0f, 1.0f, 1.5f, 0xffff0000, 0xff000000}, - { 0.0f, 1.0f, 1.5f, 0xffff0000, 0xff000000}, - { 0.0f, 0.0f, 1.5f, 0xffff0000, 0xff000000}, - }; + skip("Failed to create a D3D device, skipping tests.\n"); + goto done; + } memset(&caps, 0, sizeof(caps)); hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); @@ -1038,12 +1135,19 @@ ok(hr == D3D_OK, "IDirect3DDevice9_Clear returned %08x\n", hr); /* Setup initial states: No lighting, fog on, fog color */ + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ZENABLE, FALSE); + ok(SUCCEEDED(hr), "Failed to disable D3DRS_ZENABLE, hr %#x.\n", hr); hr = IDirect3DDevice9_SetRenderState(device, D3DRS_LIGHTING, FALSE); ok(hr == D3D_OK, "Turning off lighting returned %08x\n", hr); hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGENABLE, TRUE); ok(hr == D3D_OK, "Turning on fog calculations returned %08x\n", hr); hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGCOLOR, 0xff00ff00 /* A nice green */); ok(hr == D3D_OK, "Setting fog color returned %#08x\n", hr); + /* Some of the tests seem to depend on the projection matrix explicitly + * being set to an identity matrix, even though that's the default. + * (AMD Radeon HD 6310, Windows 7) */ + hr = IDirect3DDevice9_SetTransform(device, D3DTS_PROJECTION, &ident_mat); + ok(SUCCEEDED(hr), "Failed to set projection transform, hr %#x.\n", hr); /* First test: Both table fog and vertex fog off */ hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGTABLEMODE, D3DFOG_NONE); @@ -1057,53 +1161,46 @@ hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGEND, *((DWORD *) &end)); ok(hr == D3D_OK, "Setting fog end returned %08x\n", hr); - if(IDirect3DDevice9_BeginScene(device) == D3D_OK) - { - hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_SPECULAR); - ok( hr == D3D_OK, "SetFVF returned %08x\n", hr); - /* Untransformed, vertex fog = NONE, table fog = NONE: Read the fog weighting from the specular color */ - hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */, - 2 /*PrimCount */, Indices, D3DFMT_INDEX16, untransformed_1, - sizeof(untransformed_1[0])); - ok(hr == D3D_OK, "DrawIndexedPrimitiveUP returned %08x\n", hr); + hr = IDirect3DDevice9_BeginScene(device); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); - /* That makes it use the Z value */ - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGVERTEXMODE, D3DFOG_LINEAR); - ok(hr == D3D_OK, "Setting fog vertex mode to D3DFOG_LINEAR returned %#08x\n", hr); - /* Untransformed, vertex fog != none (or table fog != none): - * Use the Z value as input into the equation - */ - hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */, - 2 /*PrimCount */, Indices, D3DFMT_INDEX16, untransformed_2, - sizeof(untransformed_2[0])); - ok(hr == D3D_OK, "DrawIndexedPrimitiveUP returned %08x\n", hr); - - /* transformed verts */ - hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR); - ok( hr == D3D_OK, "SetFVF returned %08x\n", hr); - /* Transformed, vertex fog != NONE, pixel fog == NONE: Use specular color alpha component */ - hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */, - 2 /*PrimCount */, Indices, D3DFMT_INDEX16, transformed_1, - sizeof(transformed_1[0])); - ok(hr == D3D_OK, "DrawIndexedPrimitiveUP returned %08x\n", hr); + hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_SPECULAR); + ok(SUCCEEDED(hr), "Failed to set FVF, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGTABLEMODE, D3DFOG_LINEAR); - ok( hr == D3D_OK, "Setting fog table mode to D3DFOG_LINEAR returned %08x\n", hr); - /* Transformed, table fog != none, vertex anything: Use Z value as input to the fog - * equation - */ - hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */, - 2 /*PrimCount */, Indices, D3DFMT_INDEX16, transformed_2, - sizeof(transformed_2[0])); - ok(SUCCEEDED(hr), "IDirect3DDevice9_DrawIndexedPrimitiveUP returned %#x.\n", hr); + /* Untransformed, vertex fog = NONE, table fog = NONE: + * Read the fog weighting from the specular color. */ + hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */, + 2 /* PrimCount */, Indices, D3DFMT_INDEX16, untransformed_1, sizeof(untransformed_1[0])); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "EndScene returned %08x\n", hr); - } - else - { - ok(FALSE, "BeginScene failed\n"); - } + /* That makes it use the Z value */ + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGVERTEXMODE, D3DFOG_LINEAR); + ok(SUCCEEDED(hr), "Failed to set D3DFOG_LINEAR fog vertex mode, hr %#x.\n", hr); + /* Untransformed, vertex fog != none (or table fog != none): + * Use the Z value as input into the equation. */ + hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */, + 2 /* PrimCount */, Indices, D3DFMT_INDEX16, untransformed_2, sizeof(untransformed_2[0])); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + + /* transformed verts */ + hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR); + ok(SUCCEEDED(hr), "Failed to set FVF, hr %#x.\n", hr); + /* Transformed, vertex fog != NONE, pixel fog == NONE: + * Use specular color alpha component. */ + hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */, + 2 /* PrimCount */, Indices, D3DFMT_INDEX16, transformed_1, sizeof(transformed_1[0])); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGTABLEMODE, D3DFOG_LINEAR); + ok(SUCCEEDED(hr), "Failed to set D3DFOG_LINEAR fog table mode, hr %#x.\n", hr); + /* Transformed, table fog != none, vertex anything: + * Use Z value as input to the fog equation. */ + hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */, + 2 /* PrimCount */, Indices, D3DFMT_INDEX16, transformed_2, sizeof(transformed_2[0])); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + + hr = IDirect3DDevice9_EndScene(device); + ok(hr == D3D_OK, "EndScene returned %08x\n", hr); color = getPixelColor(device, 160, 360); ok(color == 0x00ff0000, "Untransformed vertex with no table or vertex fog has color %08x\n", color); @@ -1131,52 +1228,47 @@ hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff0000ff, 0.0, 0); ok(hr == D3D_OK, "IDirect3DDevice9_Clear returned %08x\n", hr); - if(IDirect3DDevice9_BeginScene(device) == D3D_OK) - { - start = 512; - end = 512; - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGSTART, *((DWORD *) &start)); - ok(hr == D3D_OK, "Setting fog start returned %08x\n", hr); - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGEND, *((DWORD *) &end)); - ok(hr == D3D_OK, "Setting fog end returned %08x\n", hr); + hr = IDirect3DDevice9_BeginScene(device); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_SPECULAR); - ok( hr == D3D_OK, "SetFVF returned %08x\n", hr); - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGVERTEXMODE, D3DFOG_LINEAR); - ok( hr == D3D_OK, "Setting fog vertex mode to D3DFOG_LINEAR returned %08x\n", hr); - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGTABLEMODE, D3DFOG_NONE); - ok( hr == D3D_OK, "Setting fog table mode to D3DFOG_LINEAR returned %08x\n", hr); + start = 512; + end = 512; + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGSTART, *((DWORD *)&start)); + ok(SUCCEEDED(hr), "Failed to set fog start, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGEND, *((DWORD *)&end)); + ok(SUCCEEDED(hr), "Failed to set fog end, hr %#x.\n", hr); - /* Untransformed vertex, z coord = 0.1, fogstart = 512, fogend = 512. Would result in - * a completely fog-free primitive because start > zcoord, but because start == end, the primitive - * is fully covered by fog. The same happens to the 2nd untransformed quad with z = 1.0. - * The third transformed quad remains unfogged because the fogcoords are read from the specular - * color and has fixed fogstart and fogend. - */ - hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */, - 2 /*PrimCount */, Indices, D3DFMT_INDEX16, untransformed_1, - sizeof(untransformed_1[0])); - ok(hr == D3D_OK, "DrawIndexedPrimitiveUP returned %08x\n", hr); - hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */, - 2 /*PrimCount */, Indices, D3DFMT_INDEX16, untransformed_2, - sizeof(untransformed_2[0])); - ok(hr == D3D_OK, "DrawIndexedPrimitiveUP returned %08x\n", hr); - - hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR); - ok( hr == D3D_OK, "SetFVF returned %08x\n", hr); - /* Transformed, vertex fog != NONE, pixel fog == NONE: Use specular color alpha component */ - hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */, - 2 /*PrimCount */, Indices, D3DFMT_INDEX16, transformed_1, - sizeof(transformed_1[0])); - ok(hr == D3D_OK, "DrawIndexedPrimitiveUP returned %08x\n", hr); + hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_SPECULAR); + ok(SUCCEEDED(hr), "Failed to set FVF, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGVERTEXMODE, D3DFOG_LINEAR); + ok(SUCCEEDED(hr), "Failed to set D3DFOG_LINEAR fog vertex mode, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGTABLEMODE, D3DFOG_NONE); + ok(SUCCEEDED(hr), "Failed to set D3DFOG_NONE fog table mode, hr %#x.\n", hr); + + /* Untransformed vertex, z coord = 0.1, fogstart = 512, fogend = 512. + * Would result in a completely fog-free primitive because start > zcoord, + * but because start == end, the primitive is fully covered by fog. The + * same happens to the 2nd untransformed quad with z = 1.0. The third + * transformed quad remains unfogged because the fogcoords are read from + * the specular color and has fixed fogstart and fogend. */ + hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */, + 2 /* PrimCount */, Indices, D3DFMT_INDEX16, untransformed_1, sizeof(untransformed_1[0])); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */, + 2 /* PrimCount */, Indices, D3DFMT_INDEX16, untransformed_2, sizeof(untransformed_2[0])); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + + hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR); + ok(SUCCEEDED(hr), "Failed to set FVF, hr %#x.\n", hr); + /* Transformed, vertex fog != NONE, pixel fog == NONE: + * Use specular color alpha component. */ + hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */, + 2 /* PrimCount */, Indices, D3DFMT_INDEX16, transformed_1, sizeof(transformed_1[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); - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "EndScene returned %08x\n", hr); - } - else - { - ok(FALSE, "BeginScene failed\n"); - } color = getPixelColor(device, 160, 360); ok(color_match(color, 0x0000ff00, 1), "Untransformed vertex with vertex fog and z = 0.1 has color %08x\n", color); color = getPixelColor(device, 160, 120); @@ -1210,21 +1302,13 @@ hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGTABLEMODE, i == 0 ? D3DFOG_NONE : D3DFOG_LINEAR); ok( hr == D3D_OK, "IDirect3DDevice9_SetRenderState returned %08x\n", hr); hr = IDirect3DDevice9_BeginScene(device); - ok( hr == D3D_OK, "IDirect3DDDevice9_BeginScene returned %08x\n", hr); - if(SUCCEEDED(hr)) { - WORD Indices2[] = { 0, 1, 2, 2, 3, 0, - 4, 5, 6, 6, 7, 4, - 8, 9, 10, 10, 11, 8, - 12, 13, 14, 14, 15, 12}; - - hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, - 16 /* NumVerts */, 8 /*PrimCount */, Indices2, D3DFMT_INDEX16, rev_fog_quads, - sizeof(rev_fog_quads[0])); - ok(SUCCEEDED(hr), "IDirect3DDevice9_DrawIndexedPrimitiveUP returned %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 16 /* NumVerts */, + 8 /* PrimCount */, Indices2, D3DFMT_INDEX16, rev_fog_quads, sizeof(rev_fog_quads[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); - hr = IDirect3DDevice9_EndScene(device); - ok( hr == D3D_OK, "IDirect3DDDevice9_EndScene returned %08x\n", hr); - } color = getPixelColor(device, 160, 360); ok(color_match(color, 0x0000ff00, 1), "Reversed %s fog: z=0.1 has color 0x%08x, expected 0x0000ff00 or 0x0000fe00\n", mode, color); @@ -1251,7 +1335,7 @@ if (caps.RasterCaps & D3DPRASTERCAPS_FOGTABLE) { /* A simple fog + non-identity world matrix test */ - hr = IDirect3DDevice9_SetTransform(device, D3DTS_WORLDMATRIX(0), (const D3DMATRIX *)world_mat1); + hr = IDirect3DDevice9_SetTransform(device, D3DTS_WORLDMATRIX(0), &world_mat1); ok(hr == D3D_OK, "IDirect3DDevice9_SetTransform returned %#08x\n", hr); start = 0.0; @@ -1268,26 +1352,21 @@ hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffff00ff, 0.0, 0); ok(hr == D3D_OK, "IDirect3DDevice9_Clear returned %#08x\n", hr); - if (IDirect3DDevice9_BeginScene(device) == D3D_OK) - { - hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_SPECULAR); - ok(hr == D3D_OK, "SetVertexShader returned %#08x\n", hr); + hr = IDirect3DDevice9_BeginScene(device); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); - hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0, 4, - 2, Indices, D3DFMT_INDEX16, far_quad1, sizeof(far_quad1[0])); - ok(hr == D3D_OK, "DrawIndexedPrimitiveUP returned %#08x\n", hr); - - hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0, 4, - 2, Indices, D3DFMT_INDEX16, far_quad2, sizeof(far_quad2[0])); - ok(hr == D3D_OK, "DrawIndexedPrimitiveUP returned %#08x\n", hr); + hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_SPECULAR); + ok(SUCCEEDED(hr), "Failed to set FVF, hr %#x.\n", hr); - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "EndScene returned %#08x\n", hr); - } - else - { - ok(FALSE, "BeginScene failed\n"); - } + hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0, 4, + 2, Indices, D3DFMT_INDEX16, far_quad1, sizeof(far_quad1[0])); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0, 4, + 2, Indices, D3DFMT_INDEX16, far_quad2, sizeof(far_quad2[0])); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); color = getPixelColor(device, 160, 360); ok(color_match(color, D3DCOLOR_ARGB(0x00, 0xff, 0x00, 0x00), 4), @@ -1299,34 +1378,29 @@ IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); /* Test fog behavior with an orthogonal (but non-identity) projection matrix */ - hr = IDirect3DDevice9_SetTransform(device, D3DTS_WORLDMATRIX(0), (const D3DMATRIX *)world_mat2); + hr = IDirect3DDevice9_SetTransform(device, D3DTS_WORLDMATRIX(0), &world_mat2); ok(hr == D3D_OK, "SetTransform returned %#08x\n", hr); - hr = IDirect3DDevice9_SetTransform(device, D3DTS_PROJECTION, (const D3DMATRIX *)proj_mat); + hr = IDirect3DDevice9_SetTransform(device, D3DTS_PROJECTION, &proj_mat); ok(hr == D3D_OK, "SetTransform returned %#08x\n", hr); hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffff00ff, 0.0, 0); ok(hr == D3D_OK, "Clear returned %#08x\n", hr); - if (IDirect3DDevice9_BeginScene(device) == D3D_OK) - { - hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_SPECULAR); - ok(hr == D3D_OK, "SetVertexShader returned %#08x\n", hr); + hr = IDirect3DDevice9_BeginScene(device); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); - hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0, 4, - 2, Indices, D3DFMT_INDEX16, untransformed_1, sizeof(untransformed_1[0])); - ok(hr == D3D_OK, "DrawIndexedPrimitiveUP returned %#08x\n", hr); - - hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0, 4, - 2, Indices, D3DFMT_INDEX16, untransformed_2, sizeof(untransformed_2[0])); - ok(hr == D3D_OK, "DrawIndexedPrimitiveUP returned %#08x\n", hr); + hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_SPECULAR); + ok(SUCCEEDED(hr), "Failed to set FVF, hr %#x.\n", hr); - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "EndScene returned %#08x\n", hr); - } - else - { - ok(FALSE, "BeginScene failed\n"); - } + hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0, 4, + 2, Indices, D3DFMT_INDEX16, untransformed_1, sizeof(untransformed_1[0])); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0, 4, + 2, Indices, D3DFMT_INDEX16, untransformed_2, sizeof(untransformed_2[0])); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); color = getPixelColor(device, 160, 360); ok(color_match(color, 0x00e51900, 4), "Partially fogged quad has color %08x\n", color); @@ -1336,9 +1410,9 @@ IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); - hr = IDirect3DDevice9_SetTransform(device, D3DTS_WORLDMATRIX(0), (const D3DMATRIX *)ident_mat); + hr = IDirect3DDevice9_SetTransform(device, D3DTS_WORLDMATRIX(0), &ident_mat); ok(hr == D3D_OK, "SetTransform returned %#08x\n", hr); - hr = IDirect3DDevice9_SetTransform(device, D3DTS_PROJECTION, (const D3DMATRIX *)ident_mat); + hr = IDirect3DDevice9_SetTransform(device, D3DTS_PROJECTION, &ident_mat); ok(hr == D3D_OK, "SetTransform returned %#08x\n", hr); } else @@ -1350,14 +1424,6 @@ if ((caps.RasterCaps & (D3DPRASTERCAPS_FOGTABLE | D3DPRASTERCAPS_FOGRANGE)) == (D3DPRASTERCAPS_FOGTABLE | D3DPRASTERCAPS_FOGRANGE)) { - struct sVertex untransformed_3[] = - { - {-1.0,-1.0, 0.4999f, 0xffff0000, 0xff000000 }, - {-1.0, 1.0, 0.4999f, 0xffff0000, 0xff000000 }, - { 1.0,-1.0, 0.4999f, 0xffff0000, 0xff000000 }, - { 1.0, 1.0, 0.4999f, 0xffff0000, 0xff000000 }, - }; - hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffff00ff, 0.0, 0); ok(SUCCEEDED(hr), "IDirect3DDevice9_Clear failed, hr %#x.\n", hr); hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_SPECULAR); @@ -1382,16 +1448,17 @@ /* Table fog: Range fog is not used */ hr = IDirect3DDevice9_BeginScene(device); - ok(SUCCEEDED(hr), "IDirect3DDevice9_BeginScene failed, hr %#x.\n", hr); - if (SUCCEEDED(hr)) - { - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGTABLEMODE, D3DFOG_LINEAR); - ok(SUCCEEDED(hr), "IDirect3DDevice9_SetRenderState failed, hr %#x.\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, untransformed_3, sizeof(*untransformed_3)); - ok(SUCCEEDED(hr), "IDirect3DDevice9_DrawPrimitiveUP failed, hr %#x.\n", hr); - hr = IDirect3DDevice9_EndScene(device); - ok(SUCCEEDED(hr), "IDirect3DDevice9_EndScene failed, hr %#x.\n", hr); - } + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGTABLEMODE, D3DFOG_LINEAR); + ok(SUCCEEDED(hr), "Failed to set D3DFOG_LINEAR fog table mode, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, + untransformed_3, sizeof(*untransformed_3)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + color = getPixelColor(device, 10, 10); ok(color == 0x00ff0000, "Rangefog with table fog returned color 0x%08x\n", color); color = getPixelColor(device, 630, 10); @@ -1406,18 +1473,19 @@ /* Vertex fog: Rangefog is used */ hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_DrawPrimitiveUP returned %#08x\n", hr); - if (SUCCEEDED(hr)) - { - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGTABLEMODE, D3DFOG_NONE); - ok(SUCCEEDED(hr), "IDirect3DDevice9_SetRenderState failed, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGVERTEXMODE, D3DFOG_LINEAR); - ok(SUCCEEDED(hr), "IDirect3DDevice9_SetRenderState failed, hr %#x.\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, untransformed_3, sizeof(*untransformed_3)); - ok(SUCCEEDED(hr), "IDirect3DDevice9_DrawPrimitiveUP failed, hr %#x.\n", hr); - hr = IDirect3DDevice9_EndScene(device); - ok(SUCCEEDED(hr), "IDirect3DDevice9_EndScene failed, hr %#x.\n", hr); - } + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGTABLEMODE, D3DFOG_NONE); + ok(SUCCEEDED(hr), "Failed to set D3DFOG_NONE fog table mode, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGVERTEXMODE, D3DFOG_LINEAR); + ok(SUCCEEDED(hr), "Failed to set D3DFOG_LINEAR fog vertex mode, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, + untransformed_3, sizeof(*untransformed_3)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + color = getPixelColor(device, 10, 10); ok(color_match(color, D3DCOLOR_ARGB(0x00, 0x00, 0xff, 0x00), 1), "Rangefog with vertex fog returned color 0x%08x\n", color); @@ -1442,13 +1510,11 @@ skip("Range fog or table fog not supported, skipping range fog tests\n"); } - /* Turn off the fog master switch to avoid confusing other tests */ - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGENABLE, FALSE); - ok(hr == D3D_OK, "Turning off fog calculations returned %08x\n", hr); - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGVERTEXMODE, D3DFOG_LINEAR); - ok( hr == D3D_OK, "Setting fog vertex mode to D3DFOG_LINEAR returned %08x\n", hr); - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGTABLEMODE, D3DFOG_LINEAR); - ok( hr == D3D_OK, "Setting fog table mode to D3DFOG_LINEAR returned %08x\n", hr); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } /* This test verifies the behaviour of cube maps wrt. texture wrapping. @@ -1461,40 +1527,65 @@ * interpolate between the edge texels of the three involved faces. It should * never involve the border color or the other side (texcoord wrapping) of a * face in the interpolation. */ -static void test_cube_wrap(IDirect3DDevice9 *device) +static void test_cube_wrap(void) { - static const float quad[][6] = { + IDirect3DVertexDeclaration9 *vertex_declaration; + IDirect3DSurface9 *face_surface, *surface; + IDirect3DCubeTexture9 *texture; + D3DLOCKED_RECT locked_rect; + IDirect3DDevice9 *device; + unsigned int x, y, face; + IDirect3D9 *d3d; + ULONG refcount; + D3DCAPS9 caps; + HWND window; + HRESULT hr; + + static const float quad[][6] = + { {-1.0f, -1.0f, 0.0f, 1.0f, 1.0f, 1.0f}, {-1.0f, 1.0f, 0.0f, 1.0f, 1.0f, 1.0f}, { 1.0f, -1.0f, 0.0f, 1.0f, 1.0f, 1.0f}, { 1.0f, 1.0f, 0.0f, 1.0f, 1.0f, 1.0f}, }; - - static const D3DVERTEXELEMENT9 decl_elements[] = { + static const D3DVERTEXELEMENT9 decl_elements[] = + { {0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, {0, 12, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0}, D3DDECL_END() }; - - static const struct { + static const struct + { D3DTEXTUREADDRESS mode; const char *name; - } address_modes[] = { - {D3DTADDRESS_WRAP, "D3DTADDRESS_WRAP"}, - {D3DTADDRESS_MIRROR, "D3DTADDRESS_MIRROR"}, - {D3DTADDRESS_CLAMP, "D3DTADDRESS_CLAMP"}, - {D3DTADDRESS_BORDER, "D3DTADDRESS_BORDER"}, + } + address_modes[] = + { + {D3DTADDRESS_WRAP, "D3DTADDRESS_WRAP"}, + {D3DTADDRESS_MIRROR, "D3DTADDRESS_MIRROR"}, + {D3DTADDRESS_CLAMP, "D3DTADDRESS_CLAMP"}, + {D3DTADDRESS_BORDER, "D3DTADDRESS_BORDER"}, {D3DTADDRESS_MIRRORONCE, "D3DTADDRESS_MIRRORONCE"}, }; - IDirect3DVertexDeclaration9 *vertex_declaration = NULL; - IDirect3DCubeTexture9 *texture = NULL; - IDirect3DSurface9 *surface = NULL; - IDirect3DSurface9 *face_surface; - D3DLOCKED_RECT locked_rect; - HRESULT hr; - UINT x; - INT y, face; + 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"); + goto done; + } + + hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); + if (!(caps.TextureCaps & D3DPTEXTURECAPS_CUBEMAP)) + { + skip("No cube texture support, skipping tests.\n"); + IDirect3DDevice9_Release(device); + goto done; + } hr = IDirect3DDevice9_CreateVertexDeclaration(device, decl_elements, &vertex_declaration); ok(SUCCEEDED(hr), "CreateVertexDeclaration failed (0x%08x)\n", hr); @@ -1610,54 +1701,70 @@ ok(SUCCEEDED(hr), "Clear failed (0x%08x)\n", hr); } - hr = IDirect3DDevice9_SetTexture(device, 0, NULL); - ok(SUCCEEDED(hr), "SetTexture failed (0x%08x)\n", hr); - IDirect3DVertexDeclaration9_Release(vertex_declaration); IDirect3DCubeTexture9_Release(texture); IDirect3DSurface9_Release(surface); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } -static void offscreen_test(IDirect3DDevice9 *device) +static void offscreen_test(void) { + IDirect3DSurface9 *backbuffer, *offscreen; + IDirect3DTexture9 *offscreenTexture; + IDirect3DDevice9 *device; + IDirect3D9 *d3d; + D3DCOLOR color; + ULONG refcount; + HWND window; HRESULT hr; - IDirect3DTexture9 *offscreenTexture = NULL; - IDirect3DSurface9 *backbuffer = NULL, *offscreen = NULL; - DWORD color; - static const float quad[][5] = { + static const float quad[][5] = + { {-0.5f, -0.5f, 0.1f, 0.0f, 0.0f}, {-0.5f, 0.5f, 0.1f, 0.0f, 1.0f}, { 0.5f, -0.5f, 0.1f, 1.0f, 0.0f}, { 0.5f, 0.5f, 0.1f, 1.0f, 1.0f}, }; - hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffff0000, 0.0, 0); + 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"); + goto done; + } + + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xffff0000, 1.0f, 0); ok(hr == D3D_OK, "Clear failed, hr = %08x\n", hr); - hr = IDirect3DDevice9_CreateTexture(device, 128, 128, 1, D3DUSAGE_RENDERTARGET, D3DFMT_X8R8G8B8, D3DPOOL_DEFAULT, &offscreenTexture, NULL); + hr = IDirect3DDevice9_CreateTexture(device, 128, 128, 1, D3DUSAGE_RENDERTARGET, + D3DFMT_X8R8G8B8, D3DPOOL_DEFAULT, &offscreenTexture, NULL); ok(hr == D3D_OK || hr == D3DERR_INVALIDCALL, "Creating the offscreen render target failed, hr = %08x\n", hr); - if(!offscreenTexture) { - trace("Failed to create an X8R8G8B8 offscreen texture, trying R5G6B5\n"); - hr = IDirect3DDevice9_CreateTexture(device, 128, 128, 1, D3DUSAGE_RENDERTARGET, D3DFMT_R5G6B5, D3DPOOL_DEFAULT, &offscreenTexture, NULL); + if (!offscreenTexture) + { + trace("Failed to create an X8R8G8B8 offscreen texture, trying R5G6B5.\n"); + hr = IDirect3DDevice9_CreateTexture(device, 128, 128, 1, D3DUSAGE_RENDERTARGET, + D3DFMT_R5G6B5, D3DPOOL_DEFAULT, &offscreenTexture, NULL); ok(hr == D3D_OK || hr == D3DERR_INVALIDCALL, "Creating the offscreen render target failed, hr = %08x\n", hr); - if(!offscreenTexture) { - skip("Cannot create an offscreen render target\n"); - goto out; + if (!offscreenTexture) + { + skip("Cannot create an offscreen render target.\n"); + IDirect3DDevice9_Release(device); + goto done; } } hr = IDirect3DDevice9_GetBackBuffer(device, 0, 0, D3DBACKBUFFER_TYPE_MONO, &backbuffer); ok(hr == D3D_OK, "Can't get back buffer, hr = %08x\n", hr); - if(!backbuffer) { - goto out; - } hr = IDirect3DTexture9_GetSurfaceLevel(offscreenTexture, 0, &offscreen); ok(hr == D3D_OK, "Can't get offscreen surface, hr = %08x\n", hr); - if(!offscreen) { - goto out; - } hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_TEX1); ok(hr == D3D_OK, "SetFVF failed, hr = %08x\n", hr); @@ -1673,27 +1780,29 @@ hr = IDirect3DDevice9_SetRenderState(device, D3DRS_LIGHTING, FALSE); ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState returned %08x\n", hr); - if(IDirect3DDevice9_BeginScene(device) == D3D_OK) { - hr = IDirect3DDevice9_SetRenderTarget(device, 0, offscreen); - ok(hr == D3D_OK, "SetRenderTarget failed, hr = %08x\n", hr); - hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffff00ff, 0.0, 0); - ok(hr == D3D_OK, "Clear failed, hr = %08x\n", hr); + hr = IDirect3DDevice9_BeginScene(device); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); - /* Draw without textures - Should result in a white quad */ - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(quad[0])); - ok(hr == D3D_OK, "DrawPrimitiveUP failed, hr = %08x\n", hr); + hr = IDirect3DDevice9_SetRenderTarget(device, 0, offscreen); + ok(SUCCEEDED(hr), "Failed to set render target, hr %#x.\n", hr); + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffff00ff, 1.0f, 0); + ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetRenderTarget(device, 0, backbuffer); - ok(hr == D3D_OK, "SetRenderTarget failed, hr = %08x\n", hr); - hr = IDirect3DDevice9_SetTexture(device, 0, (IDirect3DBaseTexture9 *) offscreenTexture); - ok(hr == D3D_OK, "SetTexture failed, %08x\n", hr); + /* Draw without textures - Should result in a white quad. */ + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(quad[0])); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - /* This time with the texture */ - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(quad[0])); - ok(hr == D3D_OK, "DrawPrimitiveUP failed, hr = %08x\n", hr); + hr = IDirect3DDevice9_SetRenderTarget(device, 0, backbuffer); + ok(SUCCEEDED(hr), "Failed to set render target, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetTexture(device, 0, (IDirect3DBaseTexture9 *)offscreenTexture); + ok(SUCCEEDED(hr), "Failed to set texture, hr %#x.\n", hr); - IDirect3DDevice9_EndScene(device); - } + /* This time with the texture. */ + 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); /* Center quad - should be white */ color = getPixelColor(device, 320, 240); @@ -1704,34 +1813,19 @@ /* Part of the originally cleared back buffer */ color = getPixelColor(device, 10, 10); ok(color == 0x00ff0000, "Offscreen failed: Got color 0x%08x, expected 0x00ff0000.\n", color); - if(0) { - /* Lower left corner of the screen, where back buffer offscreen rendering draws the offscreen texture. - * It should be red, but the offscreen texture may leave some junk there. Not tested yet. Depending on - * the offscreen rendering mode this test would succeed or fail - */ - color = getPixelColor(device, 10, 470); - ok(color == 0x00ff0000, "Offscreen failed: Got color 0x%08x, expected 0x00ff0000.\n", color); - } + color = getPixelColor(device, 10, 470); + ok(color == 0x00ff0000, "Offscreen failed: Got color 0x%08x, expected 0x00ff0000.\n", color); IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); -out: - hr = IDirect3DDevice9_SetTexture(device, 0, NULL); - ok(SUCCEEDED(hr), "IDirect3DDevice9_SetTexture returned %#x.\n", hr); - - /* restore things */ - if (backbuffer) - { - hr = IDirect3DDevice9_SetRenderTarget(device, 0, backbuffer); - ok(SUCCEEDED(hr), "IDirect3DDevice9_SetRenderTarget returned %#x.\n", hr); - IDirect3DSurface9_Release(backbuffer); - } - if(offscreenTexture) { - IDirect3DTexture9_Release(offscreenTexture); - } - if(offscreen) { - IDirect3DSurface9_Release(offscreen); - } + IDirect3DSurface9_Release(backbuffer); + IDirect3DTexture9_Release(offscreenTexture); + IDirect3DSurface9_Release(offscreen); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } /* This test tests fog in combination with shaders. @@ -1739,17 +1833,25 @@ * linear table fog with non foggy vertex shader * vertex fog with foggy vertex shader, non-linear * fog with shader, non-linear fog with foggy shader, - * linear table fog with foggy shader - */ -static void fog_with_shader_test(IDirect3DDevice9 *device) + * linear table fog with foggy shader */ +static void fog_with_shader_test(void) { - HRESULT hr; + IDirect3DVertexShader9 *vertex_shader[4] = {NULL, NULL, NULL, NULL}; + IDirect3DPixelShader9 *pixel_shader[3] = {NULL, NULL, NULL}; + IDirect3DVertexDeclaration9 *vertex_declaration = NULL; + IDirect3DDevice9 *device; + unsigned int i, j; + IDirect3D9 *d3d; + ULONG refcount; + D3DCAPS9 caps; DWORD color; - union { + HWND window; + HRESULT hr; + union + { float f; DWORD i; } start, end; - unsigned int i, j; /* basic vertex shader without fog computation ("non foggy") */ static const DWORD vertex_shader_code1[] = @@ -1801,32 +1903,31 @@ 0x02000001, 0x800f0800, 0x90e40000, /* mov oC0, v0 */ 0x0000ffff }; - - static struct vertex quad[] = { + static struct vertex quad[] = + { {-1.0f, -1.0f, 0.0f, 0xffff0000 }, {-1.0f, 1.0f, 0.0f, 0xffff0000 }, { 1.0f, -1.0f, 0.0f, 0xffff0000 }, { 1.0f, 1.0f, 0.0f, 0xffff0000 }, }; - - static const D3DVERTEXELEMENT9 decl_elements[] = { + static const D3DVERTEXELEMENT9 decl_elements[] = + { {0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, {0, 12, D3DDECLTYPE_D3DCOLOR, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 0}, D3DDECL_END() }; - - IDirect3DVertexDeclaration9 *vertex_declaration = NULL; - IDirect3DVertexShader9 *vertex_shader[4] = {NULL, NULL, NULL, NULL}; - IDirect3DPixelShader9 *pixel_shader[3] = {NULL, NULL, NULL}; - - /* This reference data was collected on a nVidia GeForce 7600GS driver version 84.19 DirectX version 9.0c on Windows XP */ - static const struct test_data_t { + /* This reference data was collected on a nVidia GeForce 7600GS driver + * version 84.19 DirectX version 9.0c on Windows XP. */ + static const struct test_data_t + { int vshader; int pshader; D3DFOGMODE vfog; D3DFOGMODE tfog; unsigned int color[11]; - } test_data[] = { + } + test_data[] = + { /* only pixel shader: */ {0, 1, D3DFOG_NONE, D3DFOG_LINEAR, {0x00ff0000, 0x00ff0000, 0x00df2000, 0x00bf4000, 0x009f6000, 0x007f8000, @@ -2003,10 +2104,43 @@ {0x00ff0000, 0x00ff0000, 0x00df2000, 0x00bf4000, 0x009f6000, 0x007f8000, 0x005fa000, 0x0040bf00, 0x0020df00, 0x0000ff00, 0x0000ff00}}, }; + static const D3DMATRIX identity = + {{{ + 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, + }}}; + + 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"); + goto done; + } + + hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); + if (caps.VertexShaderVersion < D3DVS_VERSION(2, 0) || caps.PixelShaderVersion < D3DPS_VERSION(2, 0)) + { + skip("No shader model 2 support, skipping tests.\n"); + IDirect3DDevice9_Release(device); + goto done; + } - /* NOTE: changing these values will not affect the tests with foggy vertex shader, as the values are hardcoded in the shader*/ - start.f=0.1f; - end.f=0.9f; + /* NOTE: Changing these values will not affect the tests with foggy vertex + * shader, as the values are hardcoded in the shader. */ + start.f = 0.1f; + end.f = 0.9f; + + /* Some of the tests seem to depend on the projection matrix explicitly + * being set to an identity matrix, even though that's the default. + * (AMD Radeon HD 6310, Windows 7) */ + hr = IDirect3DDevice9_SetTransform(device, D3DTS_PROJECTION, &identity); + ok(SUCCEEDED(hr), "Failed to set projection transform, hr %#x.\n", hr); hr = IDirect3DDevice9_CreateVertexShader(device, vertex_shader_code1, &vertex_shader[1]); ok(SUCCEEDED(hr), "CreateVertexShader failed (%08x)\n", hr); @@ -2061,7 +2195,7 @@ quad[2].z = 0.001f + (float)j / 10.02f; quad[3].z = 0.001f + (float)j / 10.02f; - hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffff00ff, 0.0, 0); + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xffff00ff, 1.0f, 0); ok(hr == D3D_OK, "IDirect3DDevice9_Clear failed (%08x)\n", hr); hr = IDirect3DDevice9_BeginScene(device); @@ -2083,22 +2217,17 @@ } } - /* reset states */ - hr = IDirect3DDevice9_SetVertexShader(device, NULL); - ok(SUCCEEDED(hr), "SetVertexShader failed (%08x)\n", hr); - hr = IDirect3DDevice9_SetPixelShader(device, NULL); - ok(SUCCEEDED(hr), "SetPixelShader failed (%08x)\n", hr); - hr = IDirect3DDevice9_SetVertexDeclaration(device, NULL); - ok(SUCCEEDED(hr), "SetVertexDeclaration failed (%08x)\n", hr); - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGENABLE, FALSE); - ok(hr == D3D_OK, "Turning off fog calculations failed (%08x)\n", hr); - IDirect3DVertexShader9_Release(vertex_shader[1]); IDirect3DVertexShader9_Release(vertex_shader[2]); IDirect3DVertexShader9_Release(vertex_shader[3]); IDirect3DPixelShader9_Release(pixel_shader[1]); IDirect3DPixelShader9_Release(pixel_shader[2]); IDirect3DVertexDeclaration9_Release(vertex_declaration); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } static void generate_bumpmap_textures(IDirect3DDevice9 *device) { @@ -2123,10 +2252,7 @@ DWORD *ptr = (DWORD *)(((BYTE *)locked_rect.pBits) + (y * locked_rect.Pitch)); for (x = 0; x < 128; ++x) { - if(y>62 && y<66 && x>62 && x<66) - *ptr++ = 0xffffffff; - else - *ptr++ = 0xff000000; + *ptr++ = D3DCOLOR_ARGB(0xff, x * 2, y * 2, 0); } } else @@ -2172,23 +2298,36 @@ } } -/* test the behavior of the texbem instruction - * with normal 2D and projective 2D textures - */ -static void texbem_test(IDirect3DDevice9 *device) +/* Test the behavior of the texbem instruction with normal 2D and projective + * 2D textures. */ +static void texbem_test(void) { - HRESULT hr; + IDirect3DVertexDeclaration9 *vertex_declaration = NULL; + /* Use asymmetric matrix to test loading. */ + float bumpenvmat[4] = {0.0f, 0.5f, -0.5f, 0.0f}; + IDirect3DPixelShader9 *pixel_shader = NULL; + IDirect3DTexture9 *texture1, *texture2; + IDirect3DTexture9 *texture = NULL; + D3DLOCKED_RECT locked_rect; + IDirect3DDevice9 *device; + IDirect3D9 *d3d; + ULONG refcount; + D3DCAPS9 caps; DWORD color; + HWND window; + HRESULT hr; int i; - static const DWORD pixel_shader_code[] = { + static const DWORD pixel_shader_code[] = + { 0xffff0101, /* ps_1_1*/ 0x00000042, 0xb00f0000, /* tex t0*/ 0x00000043, 0xb00f0001, 0xb0e40000, /* texbem t1, t0*/ 0x00000001, 0x800f0000, 0xb0e40001, /* mov r0, t1*/ 0x0000ffff }; - static const DWORD double_texbem_code[] = { + static const DWORD double_texbem_code[] = + { 0xffff0103, /* ps_1_3 */ 0x00000042, 0xb00f0000, /* tex t0 */ 0x00000043, 0xb00f0001, 0xb0e40000, /* texbem t1, t0 */ @@ -2197,40 +2336,61 @@ 0x00000002, 0x800f0000, 0xb0e40001, 0xb0e40003, /* add r0, t1, t3 */ 0x0000ffff /* end */ }; + static const float quad[][7] = + { + {-1.0f, -1.0f, 0.1f, 0.0f, 0.0f, 0.0f, 0.0f}, + {-1.0f, 1.0f, 0.1f, 0.0f, 1.0f, 0.0f, 1.0f}, + { 1.0f, -1.0f, 0.1f, 1.0f, 0.0f, 1.0f, 0.0f}, + { 1.0f, 1.0f, 0.1f, 1.0f, 1.0f, 1.0f, 1.0f}, + }; + static const float quad_proj[][9] = + { + {-1.0f, -1.0f, 0.1f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 128.0f}, + {-1.0f, 1.0f, 0.1f, 0.0f, 1.0f, 0.0f, 128.0f, 0.0f, 128.0f}, + { 1.0f, -1.0f, 0.1f, 1.0f, 0.0f, 128.0f, 0.0f, 0.0f, 128.0f}, + { 1.0f, 1.0f, 0.1f, 1.0f, 1.0f, 128.0f, 128.0f, 0.0f, 128.0f}, + }; + static const float double_quad[] = + { + -1.0f, -1.0f, 0.0f, 0.0f, 0.0f, 0.5f, 0.5f, 0.0f, 0.0f, 0.5f, 0.5f, + -1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.5f, 0.5f, 0.0f, 0.0f, 0.5f, 0.5f, + 1.0f, -1.0f, 0.0f, 0.0f, 0.0f, 0.5f, 0.5f, 0.0f, 0.0f, 0.5f, 0.5f, + 1.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.5f, 0.5f, 0.0f, 0.0f, 0.5f, 0.5f, + }; + static const D3DVERTEXELEMENT9 decl_elements[][4] = + { + { + {0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, + {0, 12, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0}, + {0, 20, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 1}, + D3DDECL_END() + }, + { + {0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, + {0, 12, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0}, + {0, 20, D3DDECLTYPE_FLOAT4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 1}, + D3DDECL_END() + }, + }; + 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"); + goto done; + } - static const float quad[][7] = { - {-128.0f/640.0f, -128.0f/480.0f, 0.1f, 0.0f, 0.0f, 0.0f, 0.0f}, - {-128.0f/640.0f, 128.0f/480.0f, 0.1f, 0.0f, 1.0f, 0.0f, 1.0f}, - { 128.0f/640.0f, -128.0f/480.0f, 0.1f, 1.0f, 0.0f, 1.0f, 0.0f}, - { 128.0f/640.0f, 128.0f/480.0f, 0.1f, 1.0f, 1.0f, 1.0f, 1.0f}, - }; - static const float quad_proj[][9] = { - {-128.0f/640.0f, -128.0f/480.0f, 0.1f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 128.0f}, - {-128.0f/640.0f, 128.0f/480.0f, 0.1f, 0.0f, 1.0f, 0.0f, 128.0f, 0.0f, 128.0f}, - { 128.0f/640.0f, -128.0f/480.0f, 0.1f, 1.0f, 0.0f, 128.0f, 0.0f, 0.0f, 128.0f}, - { 128.0f/640.0f, 128.0f/480.0f, 0.1f, 1.0f, 1.0f, 128.0f, 128.0f, 0.0f, 128.0f}, - }; - - static const D3DVERTEXELEMENT9 decl_elements[][4] = { { - {0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, - {0, 12, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0}, - {0, 20, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 1}, - D3DDECL_END() - },{ - {0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, - {0, 12, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0}, - {0, 20, D3DDECLTYPE_FLOAT4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 1}, - D3DDECL_END() - } }; - - /* use asymmetric matrix to test loading */ - float bumpenvmat[4] = {0.0,0.5,-0.5,0.0}; - - IDirect3DVertexDeclaration9 *vertex_declaration = NULL; - IDirect3DPixelShader9 *pixel_shader = NULL; - IDirect3DTexture9 *texture = NULL, *texture1, *texture2; - D3DLOCKED_RECT locked_rect; + hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); + if (caps.PixelShaderVersion < D3DPS_VERSION(1, 1)) + { + skip("No ps_1_1 support, skipping tests.\n"); + IDirect3DDevice9_Release(device); + goto done; + } generate_bumpmap_textures(device); @@ -2243,11 +2403,11 @@ hr = IDirect3DDevice9_SetVertexShader(device, NULL); ok(SUCCEEDED(hr), "SetVertexShader failed (%08x)\n", hr); - hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffff00ff, 0.0, 0); - ok(hr == D3D_OK, "IDirect3DDevice9_Clear failed (%08x)\n", hr); - for(i=0; i<2; i++) { + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff0000ff, 1.0f, 0); + ok(hr == D3D_OK, "IDirect3DDevice9_Clear failed (%08x)\n", hr); + if(i) { hr = IDirect3DDevice9_SetTextureStageState(device, 1, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_COUNT4|D3DTTFF_PROJECTED); @@ -2276,14 +2436,20 @@ hr = IDirect3DDevice9_EndScene(device); ok(SUCCEEDED(hr), "EndScene failed (0x%08x)\n", hr); - color = getPixelColor(device, 320-32, 240); - ok(color_match(color, 0x00ffffff, 4), "texbem failed: Got color 0x%08x, expected 0x00ffffff.\n", color); - color = getPixelColor(device, 320+32, 240); - ok(color_match(color, 0x00ffffff, 4), "texbem failed: Got color 0x%08x, expected 0x00ffffff.\n", color); - color = getPixelColor(device, 320, 240-32); - ok(color_match(color, 0x00ffffff, 4), "texbem failed: Got color 0x%08x, expected 0x00ffffff.\n", color); - color = getPixelColor(device, 320, 240+32); - ok(color_match(color, 0x00ffffff, 4), "texbem failed: Got color 0x%08x, expected 0x00ffffff.\n", color); + /* The Window 8 testbot (WARP) seems to use the transposed + * D3DTSS_BUMPENVMAT matrix. */ + color = getPixelColor(device, 160, 240); + ok(color_match(color, 0x007e8000, 4) || broken(color_match(color, 0x00007e00, 4)), + "Got unexpected color 0x%08x.\n", color); + color = getPixelColor(device, 480, 240); + ok(color_match(color, 0x007e8000, 4) || broken(color_match(color, 0x00fe7e00, 4)), + "Got unexpected color 0x%08x.\n", color); + color = getPixelColor(device, 320, 120); + ok(color_match(color, 0x007e8000, 4) || broken(color_match(color, 0x0080fe00, 4)), + "Got unexpected color 0x%08x.\n", color); + color = getPixelColor(device, 320, 360); + ok(color_match(color, 0x007e8000, 4) || broken(color_match(color, 0x00800000, 4)), + "Got unexpected color 0x%08x.\n", color); hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); ok(SUCCEEDED(hr), "Present failed (0x%08x)\n", hr); @@ -2420,33 +2586,16 @@ ok(SUCCEEDED(hr), "IDirect3DDevice9_SetSamplerState returned %#x.\n", hr); hr = IDirect3DDevice9_BeginScene(device); - ok(SUCCEEDED(hr), "BeginScene failed (0x%08x)\n", hr); - if(SUCCEEDED(hr)) { - static const float double_quad[] = { - -1.0, -1.0, 0.0, 0.0, 0.0, 0.5, 0.5, 0.0, 0.0, 0.5, 0.5, - 1.0, -1.0, 0.0, 0.0, 0.0, 0.5, 0.5, 0.0, 0.0, 0.5, 0.5, - -1.0, 1.0, 0.0, 0.0, 0.0, 0.5, 0.5, 0.0, 0.0, 0.5, 0.5, - 1.0, 1.0, 0.0, 0.0, 0.0, 0.5, 0.5, 0.0, 0.0, 0.5, 0.5, - }; - - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, double_quad, sizeof(float) * 11); - ok(SUCCEEDED(hr), "DrawPrimitiveUP failed (0x%08x)\n", hr); - hr = IDirect3DDevice9_EndScene(device); - ok(SUCCEEDED(hr), "EndScene failed (0x%08x)\n", hr); - } + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, double_quad, sizeof(float) * 11); + ok(SUCCEEDED(hr), "Failed to draw primitive, hr %#x.\n", hr); + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + /* The Window 8 testbot (WARP) seems to use the transposed + * D3DTSS_BUMPENVMAT matrix. */ color = getPixelColor(device, 320, 240); - ok(color == 0x00ffff00, "double texbem failed: Got color 0x%08x, expected 0x00ffff00.\n", color); - - hr = IDirect3DDevice9_SetTexture(device, 0, NULL); - ok(SUCCEEDED(hr), "IDirect3DDevice9_SetTexture failed (0x%08x)\n", hr); - hr = IDirect3DDevice9_SetTexture(device, 1, NULL); - ok(SUCCEEDED(hr), "IDirect3DDevice9_SetTexture failed (0x%08x)\n", hr); - hr = IDirect3DDevice9_SetTexture(device, 2, NULL); - ok(SUCCEEDED(hr), "IDirect3DDevice9_SetTexture failed (0x%08x)\n", hr); - hr = IDirect3DDevice9_SetTexture(device, 3, NULL); - ok(SUCCEEDED(hr), "IDirect3DDevice9_SetTexture failed (0x%08x)\n", hr); - hr = IDirect3DDevice9_SetPixelShader(device, NULL); - ok(SUCCEEDED(hr), "Direct3DDevice9_SetPixelShader failed (0x%08x)\n", hr); + ok(color_match(color, 0x00ffff00, 1) || broken(color_match(color, 0x0000ffff, 1)), + "Got unexpected color 0x%08x.\n", color); hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); ok(SUCCEEDED(hr), "Present failed (0x%08x)\n", hr); @@ -2455,10 +2604,24 @@ IDirect3DTexture9_Release(texture); IDirect3DTexture9_Release(texture1); IDirect3DTexture9_Release(texture2); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } -static void z_range_test(IDirect3DDevice9 *device) +static void z_range_test(void) { + IDirect3DVertexShader9 *shader; + IDirect3DDevice9 *device; + IDirect3D9 *d3d; + ULONG refcount; + D3DCAPS9 caps; + DWORD color; + HWND window; + HRESULT hr; + static const struct vertex quad[] = { {-1.0f, 0.0f, 1.1f, 0xffff0000}, @@ -2475,22 +2638,18 @@ }; static const struct tvertex quad3[] = { - { 0.0f, 240.0f, 1.1f, 1.0f, 0xffffff00}, - { 0.0f, 480.0f, 1.1f, 1.0f, 0xffffff00}, {640.0f, 240.0f, -1.1f, 1.0f, 0xffffff00}, {640.0f, 480.0f, -1.1f, 1.0f, 0xffffff00}, + { 0.0f, 240.0f, 1.1f, 1.0f, 0xffffff00}, + { 0.0f, 480.0f, 1.1f, 1.0f, 0xffffff00}, }; static const struct tvertex quad4[] = { - { 0.0f, 240.0f, 1.1f, 1.0f, 0xff00ff00}, - { 0.0f, 480.0f, 1.1f, 1.0f, 0xff00ff00}, {640.0f, 240.0f, -1.1f, 1.0f, 0xff00ff00}, {640.0f, 480.0f, -1.1f, 1.0f, 0xff00ff00}, + { 0.0f, 240.0f, 1.1f, 1.0f, 0xff00ff00}, + { 0.0f, 480.0f, 1.1f, 1.0f, 0xff00ff00}, }; - HRESULT hr; - DWORD color; - IDirect3DVertexShader9 *shader; - D3DCAPS9 caps; static const DWORD shader_code[] = { 0xfffe0101, /* vs_1_1 */ @@ -2502,6 +2661,16 @@ static const float color_const_1[] = {1.0f, 0.0f, 0.0f, 1.0f}; static const float color_const_2[] = {0.0f, 0.0f, 1.0f, 1.0f}; + 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"); + goto done; + } + hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); @@ -2516,6 +2685,8 @@ hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffffff, 0.0f, 0); ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_LIGHTING, FALSE); + ok(SUCCEEDED(hr), "Failed to disable lighting, hr %#x.\n", hr); hr = IDirect3DDevice9_SetRenderState(device, D3DRS_CLIPPING, TRUE); ok(SUCCEEDED(hr), "Failed to enable clipping, hr %#x.\n", hr); hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ZENABLE, D3DZB_TRUE); @@ -2604,8 +2775,9 @@ /* Test the shader path */ if (caps.VertexShaderVersion < D3DVS_VERSION(1, 1)) { - skip("Vertex shaders not supported\n"); - goto out; + skip("Vertex shaders not supported, skipping tests.\n"); + IDirect3DDevice9_Release(device); + goto done; } hr = IDirect3DDevice9_CreateVertexShader(device, shader_code, &shader); ok(SUCCEEDED(hr), "Failed to create vertex shader, hr %#x.\n", hr); @@ -2636,9 +2808,6 @@ hr = IDirect3DDevice9_EndScene(device); ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetVertexShader(device, NULL); - ok(SUCCEEDED(hr), "Failed to set vertex shader, hr %#x.\n", hr); - IDirect3DVertexShader9_Release(shader); /* Z < 1.0 */ @@ -2665,13 +2834,11 @@ hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); ok(SUCCEEDED(hr), "Failed to present, hr %#x.\n", hr); -out: - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ZENABLE, D3DZB_FALSE); - ok(SUCCEEDED(hr), "Failed to disable z test, 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_ZWRITEENABLE, TRUE); - ok(SUCCEEDED(hr), "Failed to enable z writes, hr %#x.\n", hr); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } static void fill_surface(IDirect3DSurface9 *surface, DWORD color, DWORD flags) @@ -2702,827 +2869,673 @@ ok(hr == D3D_OK, "IDirect3DSurface9_UnlockRect failed with %08x\n", hr); } -/* This tests a variety of possible StretchRect() situations */ -static void stretchrect_test(IDirect3DDevice9 *device) +static void stretchrect_test(void) { + IDirect3DSurface9 *surf_tex_rt32, *surf_tex_rt64, *surf_tex_rt_dest64, *surf_tex_rt_dest640_480; + IDirect3DSurface9 *surf_offscreen32, *surf_offscreen64, *surf_offscreen_dest64; + IDirect3DTexture9 *tex_rt32, *tex_rt64, *tex_rt_dest64, *tex_rt_dest640_480; + IDirect3DSurface9 *surf_tex32, *surf_tex64, *surf_tex_dest64; + IDirect3DSurface9 *surf_rt32, *surf_rt64, *surf_rt_dest64; + IDirect3DTexture9 *tex32, *tex64, *tex_dest64; + IDirect3DSurface9 *surf_temp32, *surf_temp64; + IDirect3DSurface9 *backbuffer; + IDirect3DDevice9 *device; + IDirect3D9 *d3d; + D3DCOLOR color; + ULONG refcount; + HWND window; HRESULT hr; - IDirect3DTexture9 *tex_rt32 = NULL, *tex_rt64 = NULL, *tex_rt_dest64 = NULL, *tex_rt_dest640_480 = NULL; - IDirect3DSurface9 *surf_tex_rt32 = NULL, *surf_tex_rt64 = NULL, *surf_tex_rt_dest64 = NULL, *surf_tex_rt_dest640_480 = NULL; - IDirect3DTexture9 *tex32 = NULL, *tex64 = NULL, *tex_dest64 = NULL; - IDirect3DSurface9 *surf_tex32 = NULL, *surf_tex64 = NULL, *surf_tex_dest64 = NULL; - IDirect3DSurface9 *surf_rt32 = NULL, *surf_rt64 = NULL, *surf_rt_dest64 = NULL; - IDirect3DSurface9 *surf_offscreen32 = NULL, *surf_offscreen64 = NULL, *surf_offscreen_dest64 = NULL; - IDirect3DSurface9 *surf_temp32 = NULL, *surf_temp64 = NULL; - IDirect3DSurface9 *orig_rt = NULL; - IDirect3DSurface9 *backbuffer = NULL; - DWORD color; - RECT src_rect64 = {0, 0, 64, 64}; - RECT src_rect64_flipy = {0, 64, 64, 0}; - RECT dst_rect64 = {0, 0, 64, 64}; - RECT dst_rect64_flipy = {0, 64, 64, 0}; - - hr = IDirect3DDevice9_GetRenderTarget(device, 0, &orig_rt); - ok(hr == D3D_OK, "Can't get render target, hr = %08x\n", hr); - if(!orig_rt) { - goto out; + static const RECT src_rect = {0, 0, 640, 480}; + static const RECT src_rect_flipy = {0, 480, 640, 0}; + static const RECT dst_rect = {0, 0, 640, 480}; + static const RECT dst_rect_flipy = {0, 480, 640, 0}; + static const RECT src_rect64 = {0, 0, 64, 64}; + static const RECT src_rect64_flipy = {0, 64, 64, 0}; + static const RECT dst_rect64 = {0, 0, 64, 64}; + static const RECT dst_rect64_flipy = {0, 64, 64, 0}; + + 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"); + goto done; } - /* Create our temporary surfaces in system memory */ - hr = IDirect3DDevice9_CreateOffscreenPlainSurface(device, 32, 32, D3DFMT_A8R8G8B8, D3DPOOL_SYSTEMMEM, &surf_temp32, NULL); - ok(hr == D3D_OK, "IDirect3DDevice9_CreateOffscreenPlainSurface failed with %08x\n", hr); - hr = IDirect3DDevice9_CreateOffscreenPlainSurface(device, 64, 64, D3DFMT_A8R8G8B8, D3DPOOL_SYSTEMMEM, &surf_temp64, NULL); - ok(hr == D3D_OK, "IDirect3DDevice9_CreateOffscreenPlainSurface failed with %08x\n", hr); - - /* Create offscreen plain surfaces in D3DPOOL_DEFAULT */ - hr = IDirect3DDevice9_CreateOffscreenPlainSurface(device, 32, 32, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &surf_offscreen32, NULL); - ok(hr == D3D_OK, "IDirect3DDevice9_CreateOffscreenPlainSurface failed with %08x\n", hr); - hr = IDirect3DDevice9_CreateOffscreenPlainSurface(device, 64, 64, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &surf_offscreen64, NULL); - ok(hr == D3D_OK, "IDirect3DDevice9_CreateOffscreenPlainSurface failed with %08x\n", hr); - hr = IDirect3DDevice9_CreateOffscreenPlainSurface(device, 64, 64, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &surf_offscreen_dest64, NULL); - ok(hr == D3D_OK, "IDirect3DDevice9_CreateOffscreenPlainSurface failed with %08x\n", hr); - - /* Create render target surfaces */ - hr = IDirect3DDevice9_CreateRenderTarget(device, 32, 32, D3DFMT_A8R8G8B8, D3DMULTISAMPLE_NONE, 0, TRUE, &surf_rt32, NULL ); - ok(hr == D3D_OK, "Creating the render target surface failed with %08x\n", hr); - hr = IDirect3DDevice9_CreateRenderTarget(device, 64, 64, D3DFMT_A8R8G8B8, D3DMULTISAMPLE_NONE, 0, TRUE, &surf_rt64, NULL ); - ok(hr == D3D_OK, "Creating the render target surface failed with %08x\n", hr); - hr = IDirect3DDevice9_CreateRenderTarget(device, 64, 64, D3DFMT_A8R8G8B8, D3DMULTISAMPLE_NONE, 0, TRUE, &surf_rt_dest64, NULL ); - ok(hr == D3D_OK, "Creating the render target surface failed with %08x\n", hr); + /* Create our temporary surfaces in system memory. */ + hr = IDirect3DDevice9_CreateOffscreenPlainSurface(device, 32, 32, + D3DFMT_A8R8G8B8, D3DPOOL_SYSTEMMEM, &surf_temp32, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + hr = IDirect3DDevice9_CreateOffscreenPlainSurface(device, 64, 64, + D3DFMT_A8R8G8B8, D3DPOOL_SYSTEMMEM, &surf_temp64, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + + /* Create offscreen plain surfaces in D3DPOOL_DEFAULT. */ + hr = IDirect3DDevice9_CreateOffscreenPlainSurface(device, 32, 32, + D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &surf_offscreen32, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + hr = IDirect3DDevice9_CreateOffscreenPlainSurface(device, 64, 64, + D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &surf_offscreen64, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + hr = IDirect3DDevice9_CreateOffscreenPlainSurface(device, 64, 64, + D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &surf_offscreen_dest64, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + + /* Create render target surfaces. */ + hr = IDirect3DDevice9_CreateRenderTarget(device, 32, 32, + D3DFMT_A8R8G8B8, D3DMULTISAMPLE_NONE, 0, TRUE, &surf_rt32, NULL ); + ok(SUCCEEDED(hr), "Failed to create render target, hr %#x.\n", hr); + hr = IDirect3DDevice9_CreateRenderTarget(device, 64, 64, + D3DFMT_A8R8G8B8, D3DMULTISAMPLE_NONE, 0, TRUE, &surf_rt64, NULL ); + ok(SUCCEEDED(hr), "Failed to create render target, hr %#x.\n", hr); + hr = IDirect3DDevice9_CreateRenderTarget(device, 64, 64, + D3DFMT_A8R8G8B8, D3DMULTISAMPLE_NONE, 0, TRUE, &surf_rt_dest64, NULL ); + ok(SUCCEEDED(hr), "Failed to create render target, hr %#x.\n", hr); hr = IDirect3DDevice9_GetBackBuffer(device, 0, 0, D3DBACKBUFFER_TYPE_MONO, &backbuffer); - ok(hr == D3D_OK, "Can't get back buffer, hr = %08x\n", hr); + ok(SUCCEEDED(hr), "Failed to get back buffer, hr %#x.\n", hr); - /* Create render target textures */ - hr = IDirect3DDevice9_CreateTexture(device, 32, 32, 1, D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &tex_rt32, NULL); - ok(hr == D3D_OK, "Creating the render target texture failed with %08x\n", hr); - hr = IDirect3DDevice9_CreateTexture(device, 64, 64, 1, D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &tex_rt64, NULL); - ok(hr == D3D_OK, "Creating the render target texture failed with %08x\n", hr); - hr = IDirect3DDevice9_CreateTexture(device, 64, 64, 1, D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &tex_rt_dest64, NULL); - ok(hr == D3D_OK, "Creating the render target texture failed with %08x\n", hr); - hr = IDirect3DDevice9_CreateTexture(device, 640, 480, 1, D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &tex_rt_dest640_480, NULL); - ok(hr == D3D_OK, "Creating the render target texture failed with %08x\n", hr); - if (tex_rt32) { - hr = IDirect3DTexture9_GetSurfaceLevel(tex_rt32, 0, &surf_tex_rt32); - ok(hr == D3D_OK, "IDirect3DTexture9_GetSurfaceLevel failed with %08x\n", hr); - } - if (tex_rt64) { - hr = IDirect3DTexture9_GetSurfaceLevel(tex_rt64, 0, &surf_tex_rt64); - ok(hr == D3D_OK, "IDirect3DTexture9_GetSurfaceLevel failed with %08x\n", hr); - } - if (tex_rt_dest64) { - hr = IDirect3DTexture9_GetSurfaceLevel(tex_rt_dest64, 0, &surf_tex_rt_dest64); - ok(hr == D3D_OK, "IDirect3DTexture9_GetSurfaceLevel failed with %08x\n", hr); - } - if (tex_rt_dest640_480) { - hr = IDirect3DTexture9_GetSurfaceLevel(tex_rt_dest640_480, 0, &surf_tex_rt_dest640_480); - ok(hr == D3D_OK, "IDirect3DTexture9_GetSurfaceLevel failed with %08x\n", hr); - } + /* Create render target textures. */ + hr = IDirect3DDevice9_CreateTexture(device, 32, 32, 1, D3DUSAGE_RENDERTARGET, + D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &tex_rt32, NULL); + ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr); + hr = IDirect3DDevice9_CreateTexture(device, 64, 64, 1, D3DUSAGE_RENDERTARGET, + D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &tex_rt64, NULL); + ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr); + hr = IDirect3DDevice9_CreateTexture(device, 64, 64, 1, D3DUSAGE_RENDERTARGET, + D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &tex_rt_dest64, NULL); + ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr); + hr = IDirect3DDevice9_CreateTexture(device, 640, 480, 1, D3DUSAGE_RENDERTARGET, + D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &tex_rt_dest640_480, NULL); + ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr); + hr = IDirect3DTexture9_GetSurfaceLevel(tex_rt32, 0, &surf_tex_rt32); + ok(SUCCEEDED(hr), "Failed to get surface level, hr %#x.\n", hr); + hr = IDirect3DTexture9_GetSurfaceLevel(tex_rt64, 0, &surf_tex_rt64); + ok(SUCCEEDED(hr), "Failed to get surface level, hr %#x.\n", hr); + hr = IDirect3DTexture9_GetSurfaceLevel(tex_rt_dest64, 0, &surf_tex_rt_dest64); + ok(SUCCEEDED(hr), "Failed to get surface level, hr %#x.\n", hr); + hr = IDirect3DTexture9_GetSurfaceLevel(tex_rt_dest640_480, 0, &surf_tex_rt_dest640_480); + ok(SUCCEEDED(hr), "Failed to get surface level, hr %#x.\n", hr); - /* Create regular textures in D3DPOOL_DEFAULT */ + /* Create regular textures in D3DPOOL_DEFAULT. */ hr = IDirect3DDevice9_CreateTexture(device, 32, 32, 1, 0, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &tex32, NULL); - ok(hr == D3D_OK, "Creating the regular texture failed with %08x\n", hr); + ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr); hr = IDirect3DDevice9_CreateTexture(device, 64, 64, 1, 0, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &tex64, NULL); - ok(hr == D3D_OK, "Creating the regular texture failed with %08x\n", hr); + ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr); hr = IDirect3DDevice9_CreateTexture(device, 64, 64, 1, 0, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &tex_dest64, NULL); - ok(hr == D3D_OK, "Creating the regular texture failed with %08x\n", hr); - if (tex32) { - hr = IDirect3DTexture9_GetSurfaceLevel(tex32, 0, &surf_tex32); - ok(hr == D3D_OK, "IDirect3DTexture9_GetSurfaceLevel failed with %08x\n", hr); - } - if (tex64) { - hr = IDirect3DTexture9_GetSurfaceLevel(tex64, 0, &surf_tex64); - ok(hr == D3D_OK, "IDirect3DTexture9_GetSurfaceLevel failed with %08x\n", hr); - } - if (tex_dest64) { - hr = IDirect3DTexture9_GetSurfaceLevel(tex_dest64, 0, &surf_tex_dest64); - ok(hr == D3D_OK, "IDirect3DTexture9_GetSurfaceLevel failed with %08x\n", hr); - } - - /********************************************************************* - * Tests for when the source parameter is an offscreen plain surface * - *********************************************************************/ - - /* Fill the offscreen 64x64 surface with green */ - if (surf_offscreen64) - fill_surface(surf_offscreen64, 0xff00ff00, 0); - - /* offscreenplain ==> offscreenplain, same size */ - if(surf_offscreen64 && surf_offscreen_dest64) { - hr = IDirect3DDevice9_StretchRect(device, surf_offscreen64, NULL, surf_offscreen_dest64, NULL, 0); - ok( hr == D3D_OK, "IDirect3DDevice9_StretchRect failed with %08x\n", hr); - - if (hr == D3D_OK) { - color = getPixelColorFromSurface(surf_offscreen_dest64, 32, 32); - ok(color == 0xff00ff00, "StretchRect offscreen ==> offscreen same size failed: Got color 0x%08x, expected 0xff00ff00.\n", color); - } + ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr); + hr = IDirect3DTexture9_GetSurfaceLevel(tex32, 0, &surf_tex32); + ok(SUCCEEDED(hr), "Failed to get surface level, hr %#x.\n", hr); + hr = IDirect3DTexture9_GetSurfaceLevel(tex64, 0, &surf_tex64); + ok(SUCCEEDED(hr), "Failed to get surface level, hr %#x.\n", hr); + hr = IDirect3DTexture9_GetSurfaceLevel(tex_dest64, 0, &surf_tex_dest64); + ok(SUCCEEDED(hr), "Failed to get surface level, hr %#x.\n", hr); - /* Blit without scaling */ - hr = IDirect3DDevice9_StretchRect(device, surf_offscreen64, &src_rect64, surf_offscreen_dest64, &dst_rect64, 0); - ok( hr == D3D_OK, "IDirect3DDevice9_StretchRect failed with %08x\n", hr); + /********************************************************************** + * Tests for when the source parameter is an offscreen plain surface. * + **********************************************************************/ + + /* Fill the offscreen 64x64 surface with green. */ + fill_surface(surf_offscreen64, 0xff00ff00, 0); + + /* offscreenplain ==> offscreenplain, same size. */ + hr = IDirect3DDevice9_StretchRect(device, surf_offscreen64, NULL, surf_offscreen_dest64, NULL, D3DTEXF_NONE); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + color = getPixelColorFromSurface(surf_offscreen_dest64, 32, 32); + ok(color == 0xff00ff00, "Got unexpected color 0x%08x.\n", color); + /* Blit without scaling. */ + hr = IDirect3DDevice9_StretchRect(device, surf_offscreen64, &src_rect64, + surf_offscreen_dest64, &dst_rect64, D3DTEXF_NONE); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + /* Flipping in y-direction through src_rect, no scaling (not allowed). */ + hr = IDirect3DDevice9_StretchRect(device, surf_offscreen64, &src_rect64_flipy, + surf_offscreen_dest64, &dst_rect64, D3DTEXF_NONE); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + /* Flipping in y-direction through dst_rect, no scaling (not allowed). */ + hr = IDirect3DDevice9_StretchRect(device, surf_offscreen64, &src_rect64, + surf_offscreen_dest64, &dst_rect64_flipy, D3DTEXF_NONE); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); - /* Flipping in y-direction through src_rect, no scaling (not allowed) */ - hr = IDirect3DDevice9_StretchRect(device, surf_offscreen64, &src_rect64_flipy, surf_offscreen_dest64, &dst_rect64, 0); - ok( hr == D3DERR_INVALIDCALL, "IDirect3DDevice9_StretchRect failed with %08x\n", hr); + /* offscreenplain ==> rendertarget texture, same size. */ + hr = IDirect3DDevice9_StretchRect(device, surf_offscreen64, NULL, surf_tex_rt_dest64, NULL, D3DTEXF_NONE); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + /* We can't lock rendertarget textures, so copy to our temp surface first. */ + hr = IDirect3DDevice9_GetRenderTargetData(device, surf_tex_rt_dest64, surf_temp64); + ok(SUCCEEDED(hr), "Failed to get render target data, hr %#x.\n", hr); + color = getPixelColorFromSurface(surf_temp64, 32, 32); + ok(color == 0xff00ff00, "Got unexpected color 0x%08x.\n", color); + /* Blit without scaling. */ + hr = IDirect3DDevice9_StretchRect(device, surf_offscreen64, &src_rect64, + surf_tex_rt_dest64, &dst_rect64, D3DTEXF_NONE); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + /* Flipping in y-direction through src_rect, no scaling (not allowed). */ + hr = IDirect3DDevice9_StretchRect(device, surf_offscreen64, &src_rect64_flipy, + surf_tex_rt_dest64, &dst_rect64, D3DTEXF_NONE); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + /* Flipping in y-direction through dst_rect, no scaling (not allowed). */ + hr = IDirect3DDevice9_StretchRect(device, surf_offscreen64, &src_rect64, + surf_tex_rt_dest64, &dst_rect64_flipy, D3DTEXF_NONE); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); - /* Flipping in y-direction through dst_rect, no scaling (not allowed) */ - hr = IDirect3DDevice9_StretchRect(device, surf_offscreen64, &src_rect64, surf_offscreen_dest64, &dst_rect64_flipy, 0); - ok( hr == D3DERR_INVALIDCALL, "IDirect3DDevice9_StretchRect failed with %08x\n", hr); - } + /* offscreenplain ==> rendertarget surface, same size. */ + hr = IDirect3DDevice9_StretchRect(device, surf_offscreen64, NULL, surf_rt_dest64, NULL, D3DTEXF_NONE); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + color = getPixelColorFromSurface(surf_rt_dest64, 32, 32); + ok(color == 0xff00ff00, "Got unexpected color 0x%08x.\n", color); + /* Blit without scaling. */ + hr = IDirect3DDevice9_StretchRect(device, surf_offscreen64, &src_rect64, + surf_rt_dest64, &dst_rect64, D3DTEXF_NONE); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + /* Flipping in y-direction through src_rect, no scaling (not allowed). */ + hr = IDirect3DDevice9_StretchRect(device, surf_offscreen64, &src_rect64_flipy, + surf_rt_dest64, &dst_rect64, D3DTEXF_NONE); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + /* Flipping in y-direction through dst_rect, no scaling (not allowed). */ + hr = IDirect3DDevice9_StretchRect(device, surf_offscreen64, &src_rect64, + surf_rt_dest64, &dst_rect64_flipy, D3DTEXF_NONE); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); - /* offscreenplain ==> rendertarget texture, same size */ - if(surf_offscreen64 && surf_tex_rt_dest64 && surf_temp64) { - hr = IDirect3DDevice9_StretchRect(device, surf_offscreen64, NULL, surf_tex_rt_dest64, NULL, 0); - ok( hr == D3D_OK, "IDirect3DDevice9_StretchRect failed with %08x\n", hr); + /* offscreenplain ==> texture, same size (should fail). */ + hr = IDirect3DDevice9_StretchRect(device, surf_offscreen64, NULL, surf_tex_dest64, NULL, D3DTEXF_NONE); + todo_wine ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); - /* We can't lock rendertarget textures, so copy to our temp surface first */ - if (hr == D3D_OK) { - hr = IDirect3DDevice9_GetRenderTargetData(device, surf_tex_rt_dest64, surf_temp64); - ok( hr == D3D_OK, "IDirect3DDevice9_GetRenderTargetData failed with %08x\n", hr); - } + /* Fill the smaller offscreen surface with red. */ + fill_surface(surf_offscreen32, 0xffff0000, 0); - if (hr == D3D_OK) { - color = getPixelColorFromSurface(surf_temp64, 32, 32); - ok(color == 0xff00ff00, "StretchRect offscreen ==> rendertarget texture same size failed: Got color 0x%08x, expected 0xff00ff00.\n", color); - } + /* offscreenplain ==> offscreenplain, scaling (should fail). */ + hr = IDirect3DDevice9_StretchRect(device, surf_offscreen32, NULL, surf_offscreen64, NULL, D3DTEXF_NONE); + todo_wine ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + + /* offscreenplain ==> rendertarget texture, scaling. */ + hr = IDirect3DDevice9_StretchRect(device, surf_offscreen32, NULL, surf_tex_rt_dest64, NULL, D3DTEXF_NONE); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + /* We can't lock rendertarget textures, so copy to our temp surface first. */ + hr = IDirect3DDevice9_GetRenderTargetData(device, surf_tex_rt_dest64, surf_temp64); + ok(SUCCEEDED(hr), "Failed to get render target data, hr %#x.\n", hr); + color = getPixelColorFromSurface(surf_temp64, 48, 48); + ok(color == 0xffff0000, "Got unexpected color 0x%08x.\n", color); + + /* offscreenplain ==> rendertarget surface, scaling. */ + hr = IDirect3DDevice9_StretchRect(device, surf_offscreen32, NULL, surf_rt_dest64, NULL, D3DTEXF_NONE); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + color = getPixelColorFromSurface(surf_rt_dest64, 48, 48); + ok(color == 0xffff0000, "Got unexpected color 0x%08x.\n", color); + + /* offscreenplain ==> texture, scaling (should fail). */ + hr = IDirect3DDevice9_StretchRect(device, surf_offscreen32, NULL, surf_tex_dest64, NULL, D3DTEXF_NONE); + todo_wine ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + + /************************************************************* + * Tests for when the source parameter is a regular texture. * + *************************************************************/ + + /* Fill the surface of the regular texture with blue. */ + /* Can't fill the surf_tex directly because it's created in D3DPOOL_DEFAULT. */ + fill_surface(surf_temp64, 0xff0000ff, 0); + hr = IDirect3DDevice9_UpdateSurface(device, surf_temp64, NULL, surf_tex64, NULL); + ok(SUCCEEDED(hr), "Failed to update surface, hr %#x.\n", hr); - /* Blit without scaling */ - hr = IDirect3DDevice9_StretchRect(device, surf_offscreen64, &src_rect64, surf_tex_rt_dest64, &dst_rect64, 0); - ok( hr == D3D_OK, "IDirect3DDevice9_StretchRect failed with %08x\n", hr); + /* texture ==> offscreenplain, same size. */ + hr = IDirect3DDevice9_StretchRect(device, surf_tex64, NULL, surf_offscreen64, NULL, D3DTEXF_NONE); + todo_wine ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + + /* texture ==> rendertarget texture, same size. */ + hr = IDirect3DDevice9_StretchRect(device, surf_tex64, NULL, surf_tex_rt_dest64, NULL, D3DTEXF_NONE); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + /* We can't lock rendertarget textures, so copy to our temp surface first. */ + hr = IDirect3DDevice9_GetRenderTargetData(device, surf_tex_rt_dest64, surf_temp64); + ok(SUCCEEDED(hr), "Failed to get render target data, hr %#x.\n", hr); + color = getPixelColorFromSurface(surf_temp64, 32, 32); + ok(color == 0xff0000ff, "Got unexpected color 0x%08x.\n", color); + /* Blit without scaling. */ + hr = IDirect3DDevice9_StretchRect(device, surf_tex64, &src_rect64, + surf_tex_rt_dest64, &dst_rect64, D3DTEXF_NONE); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + /* Flipping in y-direction through src_rect, no scaling (not allowed). */ + hr = IDirect3DDevice9_StretchRect(device, surf_tex64, &src_rect64_flipy, + surf_tex_rt_dest64, &dst_rect64, D3DTEXF_NONE); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + /* Flipping in y-direction through dst_rect, no scaling (not allowed). */ + hr = IDirect3DDevice9_StretchRect(device, surf_tex64, &src_rect64, + surf_tex_rt_dest64, &dst_rect64_flipy, D3DTEXF_NONE); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); - /* Flipping in y-direction through src_rect, no scaling (not allowed) */ - hr = IDirect3DDevice9_StretchRect(device, surf_offscreen64, &src_rect64_flipy, surf_tex_rt_dest64, &dst_rect64, 0); - ok( hr == D3DERR_INVALIDCALL, "IDirect3DDevice9_StretchRect failed with %08x\n", hr); + /* texture ==> rendertarget surface, same size. */ + hr = IDirect3DDevice9_StretchRect(device, surf_tex64, NULL, surf_rt_dest64, NULL, D3DTEXF_NONE); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + color = getPixelColorFromSurface(surf_rt_dest64, 32, 32); + ok(color == 0xff0000ff, "Got unexpected color 0x%08x.\n", color); + /* Blit without scaling. */ + hr = IDirect3DDevice9_StretchRect(device, surf_tex64, &src_rect64, + surf_rt_dest64, &dst_rect64, D3DTEXF_NONE); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + /* Flipping in y-direction through src_rect, no scaling (not allowed). */ + hr = IDirect3DDevice9_StretchRect(device, surf_tex64, &src_rect64_flipy, + surf_rt_dest64, &dst_rect64, D3DTEXF_NONE); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + /* Flipping in y-direction through dst_rect, no scaling (not allowed). */ + hr = IDirect3DDevice9_StretchRect(device, surf_tex64, &src_rect64, + surf_rt_dest64, &dst_rect64_flipy, D3DTEXF_NONE); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); - /* Flipping in y-direction through dst_rect, no scaling (not allowed) */ - hr = IDirect3DDevice9_StretchRect(device, surf_offscreen64, &src_rect64, surf_tex_rt_dest64, &dst_rect64_flipy, 0); - ok( hr == D3DERR_INVALIDCALL, "IDirect3DDevice9_StretchRect failed with %08x\n", hr); - } + /* texture ==> texture, same size (should fail). */ + hr = IDirect3DDevice9_StretchRect(device, surf_tex64, NULL, surf_tex_dest64, NULL, D3DTEXF_NONE); + todo_wine ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + + /* Fill the surface of the smaller regular texture with red. */ + /* Can't fill the surf_tex directly because it's created in D3DPOOL_DEFAULT. */ + fill_surface(surf_temp32, 0xffff0000, 0); + hr = IDirect3DDevice9_UpdateSurface(device, surf_temp32, NULL, surf_tex32, NULL); + ok(SUCCEEDED(hr), "Failed to update surface, hr %#x.\n", hr); - /* offscreenplain ==> rendertarget surface, same size */ - if(surf_offscreen64 && surf_rt_dest64) { - hr = IDirect3DDevice9_StretchRect(device, surf_offscreen64, NULL, surf_rt_dest64, NULL, 0); - ok( hr == D3D_OK, "IDirect3DDevice9_StretchRect failed with %08x\n", hr); + /* texture ==> offscreenplain, scaling (should fail). */ + hr = IDirect3DDevice9_StretchRect(device, surf_tex32, NULL, surf_offscreen64, NULL, D3DTEXF_NONE); + todo_wine ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + + /* texture ==> rendertarget texture, scaling. */ + hr = IDirect3DDevice9_StretchRect(device, surf_tex32, NULL, surf_tex_rt_dest64, NULL, D3DTEXF_NONE); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + /* We can't lock rendertarget textures, so copy to our temp surface first. */ + hr = IDirect3DDevice9_GetRenderTargetData(device, surf_tex_rt_dest64, surf_temp64); + ok(SUCCEEDED(hr), "Failed to get render target data, hr %#x.\n", hr); + color = getPixelColorFromSurface(surf_temp64, 48, 48); + ok(color == 0xffff0000, "Got unexpected color 0x%08x.\n", color); + + /* texture ==> rendertarget surface, scaling. */ + hr = IDirect3DDevice9_StretchRect(device, surf_tex32, NULL, surf_rt_dest64, NULL, D3DTEXF_NONE); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + color = getPixelColorFromSurface(surf_rt_dest64, 48, 48); + ok(color == 0xffff0000, "Got unexpected color 0x%08x.\n", color); + + /* texture ==> texture, scaling (should fail). */ + hr = IDirect3DDevice9_StretchRect(device, surf_tex32, NULL, surf_tex_dest64, NULL, D3DTEXF_NONE); + todo_wine ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + + /****************************************************************** + * Tests for when the source parameter is a rendertarget texture. * + ******************************************************************/ + + /* Fill the surface of the rendertarget texture with white. */ + /* Can't fill the surf_tex_rt directly because it's created in D3DPOOL_DEFAULT. */ + fill_surface(surf_temp64, 0xffffffff, 0); + hr = IDirect3DDevice9_UpdateSurface(device, surf_temp64, NULL, surf_tex_rt64, NULL); + ok(SUCCEEDED(hr), "Failed to update surface, hr %#x.\n", hr); - if (hr == D3D_OK) { - color = getPixelColorFromSurface(surf_rt_dest64, 32, 32); - ok(color == 0xff00ff00, "StretchRect offscreen ==> rendertarget surface same size failed: Got color 0x%08x, expected 0xff00ff00.\n", color); - } + /* rendertarget texture ==> offscreenplain, same size. */ + hr = IDirect3DDevice9_StretchRect(device, surf_tex_rt64, NULL, surf_offscreen64, NULL, D3DTEXF_NONE); + todo_wine ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + + /* rendertarget texture ==> rendertarget texture, same size. */ + hr = IDirect3DDevice9_StretchRect(device, surf_tex_rt64, NULL, surf_tex_rt_dest64, NULL, D3DTEXF_NONE); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + /* We can't lock rendertarget textures, so copy to our temp surface first. */ + hr = IDirect3DDevice9_GetRenderTargetData(device, surf_tex_rt_dest64, surf_temp64); + ok(SUCCEEDED(hr), "Failed to get render target data, hr %#x.\n", hr); + color = getPixelColorFromSurface(surf_temp64, 32, 32); + ok(color == 0xffffffff, "Got unexpected color 0x%08x.\n", color); + /* Blit without scaling. */ + hr = IDirect3DDevice9_StretchRect(device, surf_tex_rt64, &src_rect64, + surf_tex_rt_dest64, &dst_rect64, D3DTEXF_NONE); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + /* Flipping in y-direction through src_rect, no scaling (not allowed). */ + hr = IDirect3DDevice9_StretchRect(device, surf_tex_rt64, &src_rect64_flipy, + surf_tex_rt_dest64, &dst_rect64, D3DTEXF_NONE); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + /* Flipping in y-direction through dst_rect, no scaling (not allowed). */ + hr = IDirect3DDevice9_StretchRect(device, surf_tex_rt64, &src_rect64, + surf_tex_rt_dest64, &dst_rect64_flipy, D3DTEXF_NONE); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); - /* Blit without scaling */ - hr = IDirect3DDevice9_StretchRect(device, surf_offscreen64, &src_rect64, surf_rt_dest64, &dst_rect64, 0); - ok( hr == D3D_OK, "IDirect3DDevice9_StretchRect failed with %08x\n", hr); + /* rendertarget texture ==> rendertarget surface, same size. */ + hr = IDirect3DDevice9_StretchRect(device, surf_tex_rt64, NULL, surf_rt_dest64, NULL, D3DTEXF_NONE); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + color = getPixelColorFromSurface(surf_rt_dest64, 32, 32); + ok(color == 0xffffffff, "Got unexpected color 0x%08x.\n", color); + /* Blit without scaling. */ + hr = IDirect3DDevice9_StretchRect(device, surf_tex_rt64, &src_rect64, + surf_rt_dest64, &dst_rect64, D3DTEXF_NONE); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + /* Flipping in y-direction through src_rect, no scaling (not allowed). */ + hr = IDirect3DDevice9_StretchRect(device, surf_tex_rt64, &src_rect64_flipy, + surf_rt_dest64, &dst_rect64, D3DTEXF_NONE); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + /* Flipping in y-direction through dst_rect, no scaling (not allowed). */ + hr = IDirect3DDevice9_StretchRect(device, surf_tex_rt64, &src_rect64, + surf_rt_dest64, &dst_rect64_flipy, D3DTEXF_NONE); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); - /* Flipping in y-direction through src_rect, no scaling (not allowed) */ - hr = IDirect3DDevice9_StretchRect(device, surf_offscreen64, &src_rect64_flipy, surf_rt_dest64, &dst_rect64, 0); - ok( hr == D3DERR_INVALIDCALL, "IDirect3DDevice9_StretchRect failed with %08x\n", hr); + /* rendertarget texture ==> texture, same size (should fail). */ + hr = IDirect3DDevice9_StretchRect(device, surf_tex_rt64, NULL, surf_tex_dest64, NULL, D3DTEXF_NONE); + todo_wine ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + + /* Fill the surface of the smaller rendertarget texture with red. */ + /* Can't fill the surf_tex_rt directly because it's created in D3DPOOL_DEFAULT. */ + fill_surface(surf_temp32, 0xffff0000, 0); + hr = IDirect3DDevice9_UpdateSurface(device, surf_temp32, NULL, surf_tex_rt32, NULL); + ok(SUCCEEDED(hr), "Failed to update surface, hr %#x.\n", hr); - /* Flipping in y-direction through dst_rect, no scaling (not allowed) */ - hr = IDirect3DDevice9_StretchRect(device, surf_offscreen64, &src_rect64, surf_rt_dest64, &dst_rect64_flipy, 0); - ok( hr == D3DERR_INVALIDCALL, "IDirect3DDevice9_StretchRect failed with %08x\n", hr); - } + /* rendertarget texture ==> offscreenplain, scaling (should fail). */ + hr = IDirect3DDevice9_StretchRect(device, surf_tex_rt32, NULL, surf_offscreen64, NULL, D3DTEXF_NONE); + todo_wine ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + + /* rendertarget texture ==> rendertarget texture, scaling. */ + hr = IDirect3DDevice9_StretchRect(device, surf_tex_rt32, NULL, surf_tex_rt_dest64, NULL, D3DTEXF_NONE); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + /* We can't lock rendertarget textures, so copy to our temp surface first. */ + hr = IDirect3DDevice9_GetRenderTargetData(device, surf_tex_rt_dest64, surf_temp64); + ok(SUCCEEDED(hr), "Failed to get render target data, hr %#x.\n", hr); + color = getPixelColorFromSurface(surf_temp64, 48, 48); + ok(color == 0xffff0000, "Got unexpected color 0x%08x.\n", color); + + /* rendertarget texture ==> rendertarget surface, scaling. */ + hr = IDirect3DDevice9_StretchRect(device, surf_tex_rt32, NULL, surf_rt_dest64, NULL, D3DTEXF_NONE); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + color = getPixelColorFromSurface(surf_rt_dest64, 48, 48); + ok(color == 0xffff0000, "Got unexpected color 0x%08x.\n", color); + + /* rendertarget texture ==> texture, scaling (should fail). */ + hr = IDirect3DDevice9_StretchRect(device, surf_tex_rt32, NULL, surf_tex_dest64, NULL, D3DTEXF_NONE); + todo_wine ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + + /****************************************************************** + * Tests for when the source parameter is a rendertarget surface. * + ******************************************************************/ + + /* Fill the surface of the rendertarget surface with black. */ + fill_surface(surf_rt64, 0xff000000, 0); + + /* rendertarget texture ==> offscreenplain, same size. */ + hr = IDirect3DDevice9_StretchRect(device, surf_rt64, NULL, surf_offscreen64, NULL, D3DTEXF_NONE); + todo_wine ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + + /* rendertarget surface ==> rendertarget texture, same size. */ + hr = IDirect3DDevice9_StretchRect(device, surf_rt64, NULL, surf_tex_rt_dest64, NULL, D3DTEXF_NONE); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + /* We can't lock rendertarget textures, so copy to our temp surface first. */ + hr = IDirect3DDevice9_GetRenderTargetData(device, surf_tex_rt_dest64, surf_temp64); + ok(SUCCEEDED(hr), "Failed to get render target data, hr %#x.\n", hr); + color = getPixelColorFromSurface(surf_temp64, 32, 32); + ok(color == 0xff000000, "Got unexpected color 0x%08x.\n", color); + /* Blit without scaling. */ + hr = IDirect3DDevice9_StretchRect(device, surf_rt64, &src_rect64, + surf_tex_rt_dest64, &dst_rect64, D3DTEXF_NONE); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + /* Flipping in y-direction through src_rect, no scaling (not allowed). */ + hr = IDirect3DDevice9_StretchRect(device, surf_rt64, &src_rect64_flipy, + surf_tex_rt_dest64, &dst_rect64, D3DTEXF_NONE); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + /* Flipping in y-direction through dst_rect, no scaling (not allowed). */ + hr = IDirect3DDevice9_StretchRect(device, surf_rt64, &src_rect64, + surf_tex_rt_dest64, &dst_rect64_flipy, D3DTEXF_NONE); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); - /* offscreenplain ==> texture, same size (should fail) */ - if(surf_offscreen64 && surf_tex_dest64) { - hr = IDirect3DDevice9_StretchRect(device, surf_offscreen64, NULL, surf_tex_dest64, NULL, 0); - todo_wine ok( hr == D3DERR_INVALIDCALL, "IDirect3DDevice9_StretchRect succeeded, shouldn't happen (todo)\n"); - } + /* rendertarget surface ==> rendertarget surface, same size. */ + hr = IDirect3DDevice9_StretchRect(device, surf_rt64, NULL, surf_rt_dest64, NULL, D3DTEXF_NONE); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + color = getPixelColorFromSurface(surf_rt_dest64, 32, 32); + ok(color == 0xff000000, "Got unexpected color 0x%08x.\n", color); + /* Blit without scaling. */ + hr = IDirect3DDevice9_StretchRect(device, surf_rt64, &src_rect64, + surf_rt_dest64, &dst_rect64, D3DTEXF_NONE); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + /* Flipping in y-direction through src_rect, no scaling (not allowed). */ + hr = IDirect3DDevice9_StretchRect(device, surf_rt64, &src_rect64_flipy, + surf_rt_dest64, &dst_rect64_flipy, D3DTEXF_NONE); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + /* Flipping in y-direction through dst_rect, no scaling (not allowed). */ + hr = IDirect3DDevice9_StretchRect(device, surf_rt64, &src_rect64, + surf_rt_dest64, &dst_rect64_flipy, D3DTEXF_NONE); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); - /* Fill the smaller offscreen surface with red */ - fill_surface(surf_offscreen32, 0xffff0000, 0); + /* rendertarget surface ==> texture, same size (should fail). */ + hr = IDirect3DDevice9_StretchRect(device, surf_rt64, NULL, surf_tex_dest64, NULL, D3DTEXF_NONE); + todo_wine ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + + /* Fill the surface of the smaller rendertarget texture with red. */ + fill_surface(surf_rt32, 0xffff0000, 0); + + /* rendertarget surface ==> offscreenplain, scaling (should fail). */ + hr = IDirect3DDevice9_StretchRect(device, surf_rt32, NULL, surf_offscreen64, NULL, D3DTEXF_NONE); + todo_wine ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + + /* rendertarget surface ==> rendertarget texture, scaling. */ + hr = IDirect3DDevice9_StretchRect(device, surf_rt32, NULL, surf_tex_rt_dest64, NULL, D3DTEXF_NONE); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + /* We can't lock rendertarget textures, so copy to our temp surface first. */ + hr = IDirect3DDevice9_GetRenderTargetData(device, surf_tex_rt_dest64, surf_temp64); + ok(SUCCEEDED(hr), "Failed to get render target data, hr %#x.\n", hr); + color = getPixelColorFromSurface(surf_temp64, 48, 48); + ok(color == 0xffff0000, "Got unexpected color 0x%08x.\n", color); + + /* rendertarget surface ==> rendertarget surface, scaling. */ + hr = IDirect3DDevice9_StretchRect(device, surf_rt32, NULL, surf_rt_dest64, NULL, D3DTEXF_NONE); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + color = getPixelColorFromSurface(surf_rt_dest64, 48, 48); + ok(color == 0xffff0000, "Got unexpected color 0x%08x.\n", color); + + /* rendertarget surface ==> texture, scaling (should fail). */ + hr = IDirect3DDevice9_StretchRect(device, surf_rt32, NULL, surf_tex_dest64, NULL, D3DTEXF_NONE); + todo_wine ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + + /* backbuffer ==> surface tests (no scaling). */ + /* Blit with NULL rectangles. */ + hr = IDirect3DDevice9_StretchRect(device, backbuffer, NULL, surf_tex_rt_dest640_480, NULL, D3DTEXF_NONE); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + /* Blit without scaling. */ + hr = IDirect3DDevice9_StretchRect(device, backbuffer, &src_rect, + surf_tex_rt_dest640_480, &dst_rect, D3DTEXF_NONE); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + /* Flipping in y-direction through src_rect, no scaling (not allowed). */ + hr = IDirect3DDevice9_StretchRect(device, backbuffer, &src_rect_flipy, + surf_tex_rt_dest640_480, &dst_rect, D3DTEXF_NONE); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + /* Flipping in y-direction through dst_rect, no scaling (not allowed). */ + hr = IDirect3DDevice9_StretchRect(device, backbuffer, &src_rect, + surf_tex_rt_dest640_480, &dst_rect_flipy, D3DTEXF_NONE); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); - /* offscreenplain ==> offscreenplain, scaling (should fail) */ - if(surf_offscreen32 && surf_offscreen64) { - hr = IDirect3DDevice9_StretchRect(device, surf_offscreen32, NULL, surf_offscreen64, NULL, 0); - todo_wine ok( hr == D3DERR_INVALIDCALL, "IDirect3DDevice9_StretchRect succeeded, shouldn't happen (todo)\n"); - } + /* TODO: Test format conversions. */ - /* offscreenplain ==> rendertarget texture, scaling */ - if(surf_offscreen32 && surf_tex_rt_dest64 && surf_temp64) { - hr = IDirect3DDevice9_StretchRect(device, surf_offscreen32, NULL, surf_tex_rt_dest64, NULL, 0); - ok( hr == D3D_OK, "IDirect3DDevice9_StretchRect failed with %08x\n", hr); + IDirect3DSurface9_Release(backbuffer); + IDirect3DSurface9_Release(surf_rt32); + IDirect3DSurface9_Release(surf_rt64); + IDirect3DSurface9_Release(surf_rt_dest64); + IDirect3DSurface9_Release(surf_temp32); + IDirect3DSurface9_Release(surf_temp64); + IDirect3DSurface9_Release(surf_offscreen32); + IDirect3DSurface9_Release(surf_offscreen64); + IDirect3DSurface9_Release(surf_offscreen_dest64); + IDirect3DSurface9_Release(surf_tex_rt32); + IDirect3DTexture9_Release(tex_rt32); + IDirect3DSurface9_Release(surf_tex_rt64); + IDirect3DTexture9_Release(tex_rt64); + IDirect3DSurface9_Release(surf_tex_rt_dest64); + IDirect3DTexture9_Release(tex_rt_dest64); + IDirect3DSurface9_Release(surf_tex_rt_dest640_480); + IDirect3DTexture9_Release(tex_rt_dest640_480); + IDirect3DSurface9_Release(surf_tex32); + IDirect3DTexture9_Release(tex32); + IDirect3DSurface9_Release(surf_tex64); + IDirect3DTexture9_Release(tex64); + IDirect3DSurface9_Release(surf_tex_dest64); + IDirect3DTexture9_Release(tex_dest64); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); +} - /* We can't lock rendertarget textures, so copy to our temp surface first */ - if (hr == D3D_OK) { - hr = IDirect3DDevice9_GetRenderTargetData(device, surf_tex_rt_dest64, surf_temp64); - ok( hr == D3D_OK, "IDirect3DDevice9_GetRenderTargetData failed with %08x\n", hr); - } +static void maxmip_test(void) +{ + IDirect3DTexture9 *texture; + IDirect3DSurface9 *surface; + IDirect3DDevice9 *device; + IDirect3D9 *d3d; + D3DCOLOR color; + ULONG refcount; + D3DCAPS9 caps; + HWND window; + HRESULT hr; + DWORD ret; - if (hr == D3D_OK) { - color = getPixelColorFromSurface(surf_temp64, 48, 48); - ok(color == 0xffff0000, "StretchRect offscreen ==> rendertarget texture same size failed: Got color 0x%08x, expected 0xffff0000.\n", color); + static const struct + { + struct + { + float x, y, z; + float s, t; } + v[4]; } + quads[] = + { + {{ + {-1.0, -1.0, 0.0, 0.0, 0.0}, + {-1.0, 0.0, 0.0, 0.0, 1.0}, + { 0.0, -1.0, 0.0, 1.0, 0.0}, + { 0.0, 0.0, 0.0, 1.0, 1.0}, + }}, + {{ + { 0.0, -1.0, 0.0, 0.0, 0.0}, + { 0.0, 0.0, 0.0, 0.0, 1.0}, + { 1.0, -1.0, 0.0, 1.0, 0.0}, + { 1.0, 0.0, 0.0, 1.0, 1.0}, + }}, + {{ + { 0.0, 0.0, 0.0, 0.0, 0.0}, + { 0.0, 1.0, 0.0, 0.0, 1.0}, + { 1.0, 0.0, 0.0, 1.0, 0.0}, + { 1.0, 1.0, 0.0, 1.0, 1.0}, + }}, + {{ + {-1.0, 0.0, 0.0, 0.0, 0.0}, + {-1.0, 1.0, 0.0, 0.0, 1.0}, + { 0.0, 0.0, 0.0, 1.0, 0.0}, + { 0.0, 1.0, 0.0, 1.0, 1.0}, + }}, + }; - /* offscreenplain ==> rendertarget surface, scaling */ - if(surf_offscreen32 && surf_rt_dest64) { - hr = IDirect3DDevice9_StretchRect(device, surf_offscreen32, NULL, surf_rt_dest64, NULL, 0); - ok( hr == D3D_OK, "IDirect3DDevice9_StretchRect failed with %08x\n", hr); - - color = getPixelColorFromSurface(surf_rt_dest64, 48, 48); - ok(color == 0xffff0000, "StretchRect offscreen ==> rendertarget surface scaling failed: Got color 0x%08x, expected 0xffff0000.\n", color); + 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"); + goto done; } - /* offscreenplain ==> texture, scaling (should fail) */ - if(surf_offscreen32 && surf_tex_dest64) { - hr = IDirect3DDevice9_StretchRect(device, surf_offscreen32, NULL, surf_tex_dest64, NULL, 0); - todo_wine ok( hr == D3DERR_INVALIDCALL, "IDirect3DDevice9_StretchRect succeeded, shouldn't happen (todo)\n"); + hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); + if (!(caps.TextureCaps & D3DPTEXTURECAPS_MIPMAP)) + { + skip("No mipmap support, skipping tests.\n"); + IDirect3DDevice9_Release(device); + goto done; } - /************************************************************ - * Tests for when the source parameter is a regular texture * - ************************************************************/ - - /* Fill the surface of the regular texture with blue */ - if (surf_tex64 && surf_temp64) { - /* Can't fill the surf_tex directly because it's created in D3DPOOL_DEFAULT */ - fill_surface(surf_temp64, 0xff0000ff, 0); - hr = IDirect3DDevice9_UpdateSurface(device, surf_temp64, NULL, surf_tex64, NULL); - ok( hr == D3D_OK, "IDirect3DDevice9_UpdateSurface failed with %08x\n", hr); - } + hr = IDirect3DDevice9_CreateTexture(device, 128, 128, 3, 0, + D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, &texture, NULL); + ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr); - /* texture ==> offscreenplain, same size */ - if(surf_tex64 && surf_offscreen64) { - hr = IDirect3DDevice9_StretchRect(device, surf_tex64, NULL, surf_offscreen64, NULL, 0); - todo_wine ok( hr == D3DERR_INVALIDCALL, "IDirect3DDevice9_StretchRect succeeded, shouldn't happen (todo)\n"); - } + hr = IDirect3DTexture9_GetSurfaceLevel(texture, 0, &surface); + ok(SUCCEEDED(hr), "IDirect3DTexture9_GetSurfaceLevel returned %#x.\n", hr); + fill_surface(surface, 0xffff0000, 0); + IDirect3DSurface9_Release(surface); + hr = IDirect3DTexture9_GetSurfaceLevel(texture, 1, &surface); + ok(SUCCEEDED(hr), "IDirect3DTexture9_GetSurfaceLevel returned %#x.\n", hr); + fill_surface(surface, 0xff00ff00, 0); + IDirect3DSurface9_Release(surface); + hr = IDirect3DTexture9_GetSurfaceLevel(texture, 2, &surface); + ok(SUCCEEDED(hr), "IDirect3DTexture9_GetSurfaceLevel returned %#x.\n", hr); + fill_surface(surface, 0xff0000ff, 0); + IDirect3DSurface9_Release(surface); - /* texture ==> rendertarget texture, same size */ - if(surf_tex64 && surf_tex_rt_dest64 && surf_temp64) { - hr = IDirect3DDevice9_StretchRect(device, surf_tex64, NULL, surf_tex_rt_dest64, NULL, 0); - ok( hr == D3D_OK, "IDirect3DDevice9_StretchRect failed with %08x\n", hr); + hr = IDirect3DDevice9_SetTexture(device, 0, (IDirect3DBaseTexture9 *) texture); + ok(hr == D3D_OK, "IDirect3DDevice9_SetTexture failed with %08x\n", hr); + hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_TEX1); + ok(hr == D3D_OK, "IDirect3DDevice9_SetFVF failed with %08x\n", hr); - /* We can't lock rendertarget textures, so copy to our temp surface first */ - if (hr == D3D_OK) { - hr = IDirect3DDevice9_GetRenderTargetData(device, surf_tex_rt_dest64, surf_temp64); - ok( hr == D3D_OK, "IDirect3DDevice9_GetRenderTargetData failed with %08x\n", hr); - } + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_LIGHTING, FALSE); + ok(SUCCEEDED(hr), "Failed to disable lighting, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MIPFILTER, D3DTEXF_NONE); + ok(hr == D3D_OK, "IDirect3DDevice9_SetSamplerState failed with %08x\n", hr); - if (hr == D3D_OK) { - color = getPixelColorFromSurface(surf_temp64, 32, 32); - ok(color == 0xff0000ff, "StretchRect texture ==> rendertarget texture same size failed: Got color 0x%08x, expected 0xff0000ff.\n", color); - } + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xffffffff, 0.0, 0); + ok(hr == D3D_OK, "IDirect3DDevice9_Clear returned %08x\n", hr); - /* Blit without scaling */ - hr = IDirect3DDevice9_StretchRect(device, surf_tex64, &src_rect64, surf_tex_rt_dest64, &dst_rect64, 0); - ok( hr == D3D_OK, "IDirect3DDevice9_StretchRect failed with %08x\n", hr); + hr = IDirect3DDevice9_BeginScene(device); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); - /* Flipping in y-direction through src_rect, no scaling (not allowed) */ - hr = IDirect3DDevice9_StretchRect(device, surf_tex64, &src_rect64_flipy, surf_tex_rt_dest64, &dst_rect64, 0); - ok( hr == D3DERR_INVALIDCALL, "IDirect3DDevice9_StretchRect failed with %08x\n", hr); + hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MAXMIPLEVEL, 0); + ok(SUCCEEDED(hr), "Failed to set sampler state, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, &quads[0], sizeof(*quads->v)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - /* Flipping in y-direction through dst_rect, no scaling (not allowed) */ - hr = IDirect3DDevice9_StretchRect(device, surf_tex64, &src_rect64, surf_tex_rt_dest64, &dst_rect64_flipy, 0); - ok( hr == D3DERR_INVALIDCALL, "IDirect3DDevice9_StretchRect failed with %08x\n", hr); - } + hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MAXMIPLEVEL, 1); + ok(SUCCEEDED(hr), "Failed to set sampler state, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, &quads[1], sizeof(*quads->v)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - /* texture ==> rendertarget surface, same size */ - if(surf_tex64 && surf_rt_dest64) { - hr = IDirect3DDevice9_StretchRect(device, surf_tex64, NULL, surf_rt_dest64, NULL, 0); - ok( hr == D3D_OK, "IDirect3DDevice9_StretchRect failed with %08x\n", hr); + hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MAXMIPLEVEL, 2); + ok(SUCCEEDED(hr), "Failed to set sampler state, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, &quads[2], sizeof(*quads->v)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - if (hr == D3D_OK) { - color = getPixelColorFromSurface(surf_rt_dest64, 32, 32); - ok(color == 0xff0000ff, "StretchRect texture ==> rendertarget surface same size failed: Got color 0x%08x, expected 0xff0000ff.\n", color); - } + hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MAXMIPLEVEL, 3); + ok(SUCCEEDED(hr), "Failed to set sampler state, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, &quads[3], sizeof(*quads->v)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - /* Blit without scaling */ - hr = IDirect3DDevice9_StretchRect(device, surf_tex64, &src_rect64, surf_rt_dest64, &dst_rect64, 0); - ok( hr == D3D_OK, "IDirect3DDevice9_StretchRect failed with %08x\n", hr); + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); - /* Flipping in y-direction through src_rect, no scaling (not allowed) */ - hr = IDirect3DDevice9_StretchRect(device, surf_tex64, &src_rect64_flipy, surf_rt_dest64, &dst_rect64, 0); - ok( hr == D3DERR_INVALIDCALL, "IDirect3DDevice9_StretchRect failed with %08x\n", hr); + /* With mipmapping disabled, the max mip level is ignored, only level 0 is used */ + color = getPixelColor(device, 160, 360); + ok(color == 0x00ff0000, "MaxMip 0, no mipfilter has color 0x%08x.\n", color); + color = getPixelColor(device, 480, 360); + ok(color == 0x00ff0000, "MaxMip 1, no mipfilter has color 0x%08x.\n", color); + color = getPixelColor(device, 480, 120); + ok(color == 0x00ff0000, "MaxMip 2, no mipfilter has color 0x%08x.\n", color); + color = getPixelColor(device, 160, 120); + ok(color == 0x00ff0000, "MaxMip 3, no mipfilter has color 0x%08x.\n", color); + hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); + ok(SUCCEEDED(hr), "Present failed (0x%08x)\n", hr); - /* Flipping in y-direction through dst_rect, no scaling (not allowed) */ - hr = IDirect3DDevice9_StretchRect(device, surf_tex64, &src_rect64, surf_rt_dest64, &dst_rect64_flipy, 0); - ok( hr == D3DERR_INVALIDCALL, "IDirect3DDevice9_StretchRect failed with %08x\n", hr); - } + hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MIPFILTER, D3DTEXF_POINT); + ok(hr == D3D_OK, "IDirect3DDevice9_SetSamplerState failed with %08x\n", hr); - /* texture ==> texture, same size (should fail) */ - if(surf_tex64 && surf_tex_dest64) { - hr = IDirect3DDevice9_StretchRect(device, surf_tex64, NULL, surf_tex_dest64, NULL, 0); - todo_wine ok( hr == D3DERR_INVALIDCALL, "IDirect3DDevice9_StretchRect succeeded, shouldn't happen (todo)\n"); - } + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xffffffff, 0.0, 0); + ok(hr == D3D_OK, "IDirect3DDevice9_Clear returned %08x\n", hr); - /* Fill the surface of the smaller regular texture with red */ - if (surf_tex32 && surf_temp32) { - /* Can't fill the surf_tex directly because it's created in D3DPOOL_DEFAULT */ - fill_surface(surf_temp32, 0xffff0000, 0); - hr = IDirect3DDevice9_UpdateSurface(device, surf_temp32, NULL, surf_tex32, NULL); - ok( hr == D3D_OK, "IDirect3DDevice9_UpdateSurface failed with %08x\n", hr); - } + hr = IDirect3DDevice9_BeginScene(device); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); - /* texture ==> offscreenplain, scaling (should fail) */ - if(surf_tex32 && surf_offscreen64) { - hr = IDirect3DDevice9_StretchRect(device, surf_tex32, NULL, surf_offscreen64, NULL, 0); - todo_wine ok( hr == D3DERR_INVALIDCALL, "IDirect3DDevice9_StretchRect succeeded, shouldn't happen (todo)\n"); - } + hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MAXMIPLEVEL, 0); + ok(SUCCEEDED(hr), "Failed to set sampler state, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, &quads[0], sizeof(*quads->v)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - /* texture ==> rendertarget texture, scaling */ - if(surf_tex32 && surf_tex_rt_dest64 && surf_temp64) { - hr = IDirect3DDevice9_StretchRect(device, surf_tex32, NULL, surf_tex_rt_dest64, NULL, 0); - ok( hr == D3D_OK, "IDirect3DDevice9_StretchRect failed with %08x\n", hr); + hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MAXMIPLEVEL, 1); + ok(SUCCEEDED(hr), "Failed to set sampler state, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, &quads[1], sizeof(*quads->v)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - /* We can't lock rendertarget textures, so copy to our temp surface first */ - if (hr == D3D_OK) { - hr = IDirect3DDevice9_GetRenderTargetData(device, surf_tex_rt_dest64, surf_temp64); - ok( hr == D3D_OK, "IDirect3DDevice9_GetRenderTargetData failed with %08x\n", hr); - } + hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MAXMIPLEVEL, 2); + ok(SUCCEEDED(hr), "Failed to set sampler state, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, &quads[2], sizeof(*quads->v)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - if (hr == D3D_OK) { - color = getPixelColorFromSurface(surf_temp64, 48, 48); - ok(color == 0xffff0000, "StretchRect texture ==> rendertarget texture scaling failed: Got color 0x%08x, expected 0xffff0000.\n", color); - } - } + hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MAXMIPLEVEL, 3); + ok(SUCCEEDED(hr), "Failed to set sampler state, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, &quads[3], sizeof(*quads->v)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - /* texture ==> rendertarget surface, scaling */ - if(surf_tex32 && surf_rt_dest64) { - hr = IDirect3DDevice9_StretchRect(device, surf_tex32, NULL, surf_rt_dest64, NULL, 0); - ok( hr == D3D_OK, "IDirect3DDevice9_StretchRect failed with %08x\n", hr); - - color = getPixelColorFromSurface(surf_rt_dest64, 48, 48); - ok(color == 0xffff0000, "StretchRect texture ==> rendertarget surface scaling failed: Got color 0x%08x, expected 0xffff0000.\n", color); - } - - /* texture ==> texture, scaling (should fail) */ - if(surf_tex32 && surf_tex_dest64) { - hr = IDirect3DDevice9_StretchRect(device, surf_tex32, NULL, surf_tex_dest64, NULL, 0); - todo_wine ok( hr == D3DERR_INVALIDCALL, "IDirect3DDevice9_StretchRect succeeded, shouldn't happen (todo)\n"); - } - - /***************************************************************** - * Tests for when the source parameter is a rendertarget texture * - *****************************************************************/ - - /* Fill the surface of the rendertarget texture with white */ - if (surf_tex_rt64 && surf_temp64) { - /* Can't fill the surf_tex_rt directly because it's created in D3DPOOL_DEFAULT */ - fill_surface(surf_temp64, 0xffffffff, 0); - hr = IDirect3DDevice9_UpdateSurface(device, surf_temp64, NULL, surf_tex_rt64, NULL); - ok( hr == D3D_OK, "IDirect3DDevice9_UpdateSurface failed with %08x\n", hr); - } - - /* rendertarget texture ==> offscreenplain, same size */ - if(surf_tex_rt64 && surf_offscreen64) { - hr = IDirect3DDevice9_StretchRect(device, surf_tex_rt64, NULL, surf_offscreen64, NULL, 0); - todo_wine ok( hr == D3DERR_INVALIDCALL, "IDirect3DDevice9_StretchRect succeeded, shouldn't happen (todo)\n"); - } - - /* rendertarget texture ==> rendertarget texture, same size */ - if(surf_tex_rt64 && surf_tex_rt_dest64 && surf_temp64) { - hr = IDirect3DDevice9_StretchRect(device, surf_tex_rt64, NULL, surf_tex_rt_dest64, NULL, 0); - ok( hr == D3D_OK, "IDirect3DDevice9_StretchRect failed with %08x\n", hr); - - /* We can't lock rendertarget textures, so copy to our temp surface first */ - if (hr == D3D_OK) { - hr = IDirect3DDevice9_GetRenderTargetData(device, surf_tex_rt_dest64, surf_temp64); - ok( hr == D3D_OK, "IDirect3DDevice9_GetRenderTargetData failed with %08x\n", hr); - } - - if (hr == D3D_OK) { - color = getPixelColorFromSurface(surf_temp64, 32, 32); - ok(color == 0xffffffff, "StretchRect rendertarget texture ==> rendertarget texture same size failed: Got color 0x%08x, expected 0xffffffff.\n", color); - } - - /* Blit without scaling */ - hr = IDirect3DDevice9_StretchRect(device, surf_tex_rt64, &src_rect64, surf_tex_rt_dest64, &dst_rect64, 0); - ok( hr == D3D_OK, "IDirect3DDevice9_StretchRect failed with %08x\n", hr); - - /* Flipping in y-direction through src_rect, no scaling (not allowed) */ - hr = IDirect3DDevice9_StretchRect(device, surf_tex_rt64, &src_rect64_flipy, surf_tex_rt_dest64, &dst_rect64, 0); - ok( hr == D3DERR_INVALIDCALL, "IDirect3DDevice9_StretchRect failed with %08x\n", hr); - - /* Flipping in y-direction through dst_rect, no scaling (not allowed) */ - hr = IDirect3DDevice9_StretchRect(device, surf_tex_rt64, &src_rect64, surf_tex_rt_dest64, &dst_rect64_flipy, 0); - ok( hr == D3DERR_INVALIDCALL, "IDirect3DDevice9_StretchRect failed with %08x\n", hr); - } - - /* rendertarget texture ==> rendertarget surface, same size */ - if(surf_tex_rt64 && surf_rt_dest64) { - hr = IDirect3DDevice9_StretchRect(device, surf_tex_rt64, NULL, surf_rt_dest64, NULL, 0); - ok( hr == D3D_OK, "IDirect3DDevice9_StretchRect failed with %08x\n", hr); - - if (hr == D3D_OK) { - color = getPixelColorFromSurface(surf_rt_dest64, 32, 32); - ok(color == 0xffffffff, "StretchRect rendertarget texture ==> rendertarget surface same size failed: Got color 0x%08x, expected 0xffffffff.\n", color); - } - - /* Blit without scaling */ - hr = IDirect3DDevice9_StretchRect(device, surf_tex_rt64, &src_rect64, surf_rt_dest64, &dst_rect64, 0); - ok( hr == D3D_OK, "IDirect3DDevice9_StretchRect failed with %08x\n", hr); - - /* Flipping in y-direction through src_rect, no scaling (not allowed) */ - hr = IDirect3DDevice9_StretchRect(device, surf_tex_rt64, &src_rect64_flipy, surf_rt_dest64, &dst_rect64, 0); - ok( hr == D3DERR_INVALIDCALL, "IDirect3DDevice9_StretchRect failed with %08x\n", hr); - - /* Flipping in y-direction through dst_rect, no scaling (not allowed) */ - hr = IDirect3DDevice9_StretchRect(device, surf_tex_rt64, &src_rect64, surf_rt_dest64, &dst_rect64_flipy, 0); - ok( hr == D3DERR_INVALIDCALL, "IDirect3DDevice9_StretchRect failed with %08x\n", hr); - } - - /* rendertarget texture ==> texture, same size (should fail) */ - if(surf_tex_rt64 && surf_tex_dest64) { - hr = IDirect3DDevice9_StretchRect(device, surf_tex_rt64, NULL, surf_tex_dest64, NULL, 0); - todo_wine ok( hr == D3DERR_INVALIDCALL, "IDirect3DDevice9_StretchRect succeeded, shouldn't happen (todo)\n"); - } - - /* Fill the surface of the smaller rendertarget texture with red */ - if (surf_tex_rt32 && surf_temp32) { - /* Can't fill the surf_tex_rt directly because it's created in D3DPOOL_DEFAULT */ - fill_surface(surf_temp32, 0xffff0000, 0); - hr = IDirect3DDevice9_UpdateSurface(device, surf_temp32, NULL, surf_tex_rt32, NULL); - ok( hr == D3D_OK, "IDirect3DDevice9_UpdateSurface failed with %08x\n", hr); - } - - /* rendertarget texture ==> offscreenplain, scaling (should fail) */ - if(surf_tex_rt32 && surf_offscreen64) { - hr = IDirect3DDevice9_StretchRect(device, surf_tex_rt32, NULL, surf_offscreen64, NULL, 0); - todo_wine ok( hr == D3DERR_INVALIDCALL, "IDirect3DDevice9_StretchRect succeeded, shouldn't happen (todo)\n"); - } - - /* rendertarget texture ==> rendertarget texture, scaling */ - if(surf_tex_rt32 && surf_tex_rt_dest64 && surf_temp64) { - hr = IDirect3DDevice9_StretchRect(device, surf_tex_rt32, NULL, surf_tex_rt_dest64, NULL, 0); - ok( hr == D3D_OK, "IDirect3DDevice9_StretchRect failed with %08x\n", hr); - - /* We can't lock rendertarget textures, so copy to our temp surface first */ - if (hr == D3D_OK) { - hr = IDirect3DDevice9_GetRenderTargetData(device, surf_tex_rt_dest64, surf_temp64); - ok( hr == D3D_OK, "IDirect3DDevice9_GetRenderTargetData failed with %08x\n", hr); - } - - if (hr == D3D_OK) { - color = getPixelColorFromSurface(surf_temp64, 48, 48); - ok(color == 0xffff0000, "StretchRect rendertarget texture ==> rendertarget texture scaling failed: Got color 0x%08x, expected 0xffff0000.\n", color); - } - } - - /* rendertarget texture ==> rendertarget surface, scaling */ - if(surf_tex_rt32 && surf_rt_dest64) { - hr = IDirect3DDevice9_StretchRect(device, surf_tex_rt32, NULL, surf_rt_dest64, NULL, 0); - ok( hr == D3D_OK, "IDirect3DDevice9_StretchRect failed with %08x\n", hr); - - color = getPixelColorFromSurface(surf_rt_dest64, 48, 48); - ok(color == 0xffff0000, "StretchRect rendertarget texture ==> rendertarget surface scaling failed: Got color 0x%08x, expected 0xffff0000.\n", color); - } - - /* rendertarget texture ==> texture, scaling (should fail) */ - if(surf_tex_rt32 && surf_tex_dest64) { - hr = IDirect3DDevice9_StretchRect(device, surf_tex_rt32, NULL, surf_tex_dest64, NULL, 0); - todo_wine ok( hr == D3DERR_INVALIDCALL, "IDirect3DDevice9_StretchRect succeeded, shouldn't happen (todo)\n"); - } - - /***************************************************************** - * Tests for when the source parameter is a rendertarget surface * - *****************************************************************/ - - /* Fill the surface of the rendertarget surface with black */ - if (surf_rt64) - fill_surface(surf_rt64, 0xff000000, 0); - - /* rendertarget texture ==> offscreenplain, same size */ - if(surf_rt64 && surf_offscreen64) { - hr = IDirect3DDevice9_StretchRect(device, surf_rt64, NULL, surf_offscreen64, NULL, 0); - todo_wine ok( hr == D3DERR_INVALIDCALL, "IDirect3DDevice9_StretchRect succeeded, shouldn't happen (todo)\n"); - } - - /* rendertarget surface ==> rendertarget texture, same size */ - if(surf_rt64 && surf_tex_rt_dest64 && surf_temp64) { - hr = IDirect3DDevice9_StretchRect(device, surf_rt64, NULL, surf_tex_rt_dest64, NULL, 0); - ok( hr == D3D_OK, "IDirect3DDevice9_StretchRect failed with %08x\n", hr); - - /* We can't lock rendertarget textures, so copy to our temp surface first */ - if (hr == D3D_OK) { - hr = IDirect3DDevice9_GetRenderTargetData(device, surf_tex_rt_dest64, surf_temp64); - ok( hr == D3D_OK, "IDirect3DDevice9_GetRenderTargetData failed with %08x\n", hr); - } - - if (hr == D3D_OK) { - color = getPixelColorFromSurface(surf_temp64, 32, 32); - ok(color == 0xff000000, "StretchRect rendertarget surface ==> rendertarget texture same size failed: Got color 0x%08x, expected 0xff000000.\n", color); - } - - /* Blit without scaling */ - hr = IDirect3DDevice9_StretchRect(device, surf_rt64, &src_rect64, surf_tex_rt_dest64, &dst_rect64, 0); - ok( hr == D3D_OK, "IDirect3DDevice9_StretchRect failed with %08x\n", hr); - - /* Flipping in y-direction through src_rect, no scaling (not allowed) */ - hr = IDirect3DDevice9_StretchRect(device, surf_rt64, &src_rect64_flipy, surf_tex_rt_dest64, &dst_rect64, 0); - ok( hr == D3DERR_INVALIDCALL, "IDirect3DDevice9_StretchRect failed with %08x\n", hr); - - /* Flipping in y-direction through dst_rect, no scaling (not allowed) */ - hr = IDirect3DDevice9_StretchRect(device, surf_rt64, &src_rect64, surf_tex_rt_dest64, &dst_rect64_flipy, 0); - ok( hr == D3DERR_INVALIDCALL, "IDirect3DDevice9_StretchRect failed with %08x\n", hr); - } - - /* rendertarget surface ==> rendertarget surface, same size */ - if(surf_rt64 && surf_rt_dest64) { - hr = IDirect3DDevice9_StretchRect(device, surf_rt64, NULL, surf_rt_dest64, NULL, 0); - ok( hr == D3D_OK, "IDirect3DDevice9_StretchRect failed with %08x\n", hr); - - if (hr == D3D_OK) { - color = getPixelColorFromSurface(surf_rt_dest64, 32, 32); - ok(color == 0xff000000, "StretchRect rendertarget surface ==> rendertarget surface same size failed: Got color 0x%08x, expected 0xff000000.\n", color); - } - - /* Blit without scaling */ - hr = IDirect3DDevice9_StretchRect(device, surf_rt64, &src_rect64, surf_rt_dest64, &dst_rect64, 0); - ok( hr == D3D_OK, "IDirect3DDevice9_StretchRect failed with %08x\n", hr); - - /* Flipping in y-direction through src_rect, no scaling (not allowed) */ - hr = IDirect3DDevice9_StretchRect(device, surf_rt64, &src_rect64_flipy, surf_rt_dest64, &dst_rect64_flipy, 0); - ok( hr == D3DERR_INVALIDCALL, "IDirect3DDevice9_StretchRect failed with %08x\n", hr); - - /* Flipping in y-direction through dst_rect, no scaling (not allowed) */ - hr = IDirect3DDevice9_StretchRect(device, surf_rt64, &src_rect64, surf_rt_dest64, &dst_rect64_flipy, 0); - ok( hr == D3DERR_INVALIDCALL, "IDirect3DDevice9_StretchRect failed with %08x\n", hr); - } - - /* rendertarget surface ==> texture, same size (should fail) */ - if(surf_rt64 && surf_tex_dest64) { - hr = IDirect3DDevice9_StretchRect(device, surf_rt64, NULL, surf_tex_dest64, NULL, 0); - todo_wine ok( hr == D3DERR_INVALIDCALL, "IDirect3DDevice9_StretchRect succeeded, shouldn't happen (todo)\n"); - } - - /* Fill the surface of the smaller rendertarget texture with red */ - if (surf_rt32) - fill_surface(surf_rt32, 0xffff0000, 0); - - /* rendertarget surface ==> offscreenplain, scaling (should fail) */ - if(surf_rt32 && surf_offscreen64) { - hr = IDirect3DDevice9_StretchRect(device, surf_rt32, NULL, surf_offscreen64, NULL, 0); - todo_wine ok( hr == D3DERR_INVALIDCALL, "IDirect3DDevice9_StretchRect succeeded, shouldn't happen (todo)\n"); - } - - /* rendertarget surface ==> rendertarget texture, scaling */ - if(surf_rt32 && surf_tex_rt_dest64 && surf_temp64) { - hr = IDirect3DDevice9_StretchRect(device, surf_rt32, NULL, surf_tex_rt_dest64, NULL, 0); - ok( hr == D3D_OK, "IDirect3DDevice9_StretchRect failed with %08x\n", hr); - - /* We can't lock rendertarget textures, so copy to our temp surface first */ - if (hr == D3D_OK) { - hr = IDirect3DDevice9_GetRenderTargetData(device, surf_tex_rt_dest64, surf_temp64); - ok( hr == D3D_OK, "IDirect3DDevice9_GetRenderTargetData failed with %08x\n", hr); - } - - if (hr == D3D_OK) { - color = getPixelColorFromSurface(surf_temp64, 48, 48); - ok(color == 0xffff0000, "StretchRect rendertarget surface ==> rendertarget texture scaling failed: Got color 0x%08x, expected 0xffff0000.\n", color); - } - } - - /* rendertarget surface ==> rendertarget surface, scaling */ - if(surf_rt32 && surf_rt_dest64) { - hr = IDirect3DDevice9_StretchRect(device, surf_rt32, NULL, surf_rt_dest64, NULL, 0); - ok( hr == D3D_OK, "IDirect3DDevice9_StretchRect failed with %08x\n", hr); - - color = getPixelColorFromSurface(surf_rt_dest64, 48, 48); - ok(color == 0xffff0000, "StretchRect rendertarget surface ==> rendertarget surface scaling failed: Got color 0x%08x, expected 0xffff0000.\n", color); - } - - /* rendertarget surface ==> texture, scaling (should fail) */ - if(surf_rt32 && surf_tex_dest64) { - hr = IDirect3DDevice9_StretchRect(device, surf_rt32, NULL, surf_tex_dest64, NULL, 0); - todo_wine ok( hr == D3DERR_INVALIDCALL, "IDirect3DDevice9_StretchRect succeeded, shouldn't happen (todo)\n"); - } - - /* backbuffer ==> surface tests (no scaling) */ - if(backbuffer && surf_tex_rt_dest640_480) - { - RECT src_rect = {0, 0, 640, 480}; - RECT src_rect_flipy = {0, 480, 640, 0}; - RECT dst_rect = {0, 0, 640, 480}; - RECT dst_rect_flipy = {0, 480, 640, 0}; - - /* Blit with NULL rectangles */ - hr = IDirect3DDevice9_StretchRect(device, backbuffer, NULL, surf_tex_rt_dest640_480, NULL, 0); - ok( hr == D3D_OK, "StretchRect backbuffer ==> texture same size failed:\n"); - - /* Blit without scaling */ - hr = IDirect3DDevice9_StretchRect(device, backbuffer, &src_rect, surf_tex_rt_dest640_480, &dst_rect, 0); - ok( hr == D3D_OK, "IDirect3DDevice9_StretchRect succeeded, shouldn't happen (todo)\n"); - - /* Flipping in y-direction through src_rect, no scaling (not allowed) */ - hr = IDirect3DDevice9_StretchRect(device, backbuffer, &src_rect_flipy, surf_tex_rt_dest640_480, &dst_rect, 0); - ok( hr == D3DERR_INVALIDCALL, "IDirect3DDevice9_StretchRect failed with %08x\n", hr); - - /* Flipping in y-direction through dst_rect, no scaling (not allowed) */ - hr = IDirect3DDevice9_StretchRect(device, backbuffer, &src_rect, surf_tex_rt_dest640_480, &dst_rect_flipy, 0); - ok( hr == D3DERR_INVALIDCALL, "IDirect3DDevice9_StretchRect failed with %08x\n", hr); - } - - /* TODO: Test format conversions */ - - -out: - /* Clean up */ - if (backbuffer) - IDirect3DSurface9_Release(backbuffer); - if (surf_rt32) - IDirect3DSurface9_Release(surf_rt32); - if (surf_rt64) - IDirect3DSurface9_Release(surf_rt64); - if (surf_rt_dest64) - IDirect3DSurface9_Release(surf_rt_dest64); - if (surf_temp32) - IDirect3DSurface9_Release(surf_temp32); - if (surf_temp64) - IDirect3DSurface9_Release(surf_temp64); - if (surf_offscreen32) - IDirect3DSurface9_Release(surf_offscreen32); - if (surf_offscreen64) - IDirect3DSurface9_Release(surf_offscreen64); - if (surf_offscreen_dest64) - IDirect3DSurface9_Release(surf_offscreen_dest64); - - if (tex_rt32) { - if (surf_tex_rt32) - IDirect3DSurface9_Release(surf_tex_rt32); - IDirect3DTexture9_Release(tex_rt32); - } - if (tex_rt64) { - if (surf_tex_rt64) - IDirect3DSurface9_Release(surf_tex_rt64); - IDirect3DTexture9_Release(tex_rt64); - } - if (tex_rt_dest64) { - if (surf_tex_rt_dest64) - IDirect3DSurface9_Release(surf_tex_rt_dest64); - IDirect3DTexture9_Release(tex_rt_dest64); - } - if (tex_rt_dest640_480) { - if (surf_tex_rt_dest640_480) - IDirect3DSurface9_Release(surf_tex_rt_dest640_480); - IDirect3DTexture9_Release(tex_rt_dest640_480); - } - if (tex32) { - if (surf_tex32) - IDirect3DSurface9_Release(surf_tex32); - IDirect3DTexture9_Release(tex32); - } - if (tex64) { - if (surf_tex64) - IDirect3DSurface9_Release(surf_tex64); - IDirect3DTexture9_Release(tex64); - } - if (tex_dest64) { - if (surf_tex_dest64) - IDirect3DSurface9_Release(surf_tex_dest64); - IDirect3DTexture9_Release(tex_dest64); - } - - if (orig_rt) { - hr = IDirect3DDevice9_SetRenderTarget(device, 0, orig_rt); - ok(hr == D3D_OK, "IDirect3DSetRenderTarget failed with %08x\n", hr); - IDirect3DSurface9_Release(orig_rt); - } -} - -static void maxmip_test(IDirect3DDevice9 *device) -{ - IDirect3DTexture9 *texture = NULL; - IDirect3DSurface9 *surface = NULL; - HRESULT hr; - DWORD color; - static const struct - { - struct - { - float x, y, z; - float s, t; - } - v[4]; - } - quads[] = - { - {{ - {-1.0, -1.0, 0.0, 0.0, 0.0}, - {-1.0, 0.0, 0.0, 0.0, 1.0}, - { 0.0, -1.0, 0.0, 1.0, 0.0}, - { 0.0, 0.0, 0.0, 1.0, 1.0}, - }}, - {{ - { 0.0, -1.0, 0.0, 0.0, 0.0}, - { 0.0, 0.0, 0.0, 0.0, 1.0}, - { 1.0, -1.0, 0.0, 1.0, 0.0}, - { 1.0, 0.0, 0.0, 1.0, 1.0}, - }}, - {{ - { 0.0, 0.0, 0.0, 0.0, 0.0}, - { 0.0, 1.0, 0.0, 0.0, 1.0}, - { 1.0, 0.0, 0.0, 1.0, 0.0}, - { 1.0, 1.0, 0.0, 1.0, 1.0}, - }}, - {{ - {-1.0, 0.0, 0.0, 0.0, 0.0}, - {-1.0, 1.0, 0.0, 0.0, 1.0}, - { 0.0, 0.0, 0.0, 1.0, 0.0}, - { 0.0, 1.0, 0.0, 1.0, 1.0}, - }}, - }; - - hr = IDirect3DDevice9_CreateTexture(device, 128, 128, 3, 0, D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, - &texture, NULL); - ok(hr == D3D_OK, "IDirect3DDevice9_CreateTexture failed with %08x\n", hr); - if(!texture) - { - skip("Failed to create test texture\n"); - return; - } - - hr = IDirect3DTexture9_GetSurfaceLevel(texture, 0, &surface); - ok(SUCCEEDED(hr), "IDirect3DTexture9_GetSurfaceLevel returned %#x.\n", hr); - fill_surface(surface, 0xffff0000, 0); - IDirect3DSurface9_Release(surface); - hr = IDirect3DTexture9_GetSurfaceLevel(texture, 1, &surface); - ok(SUCCEEDED(hr), "IDirect3DTexture9_GetSurfaceLevel returned %#x.\n", hr); - fill_surface(surface, 0xff00ff00, 0); - IDirect3DSurface9_Release(surface); - hr = IDirect3DTexture9_GetSurfaceLevel(texture, 2, &surface); - ok(SUCCEEDED(hr), "IDirect3DTexture9_GetSurfaceLevel returned %#x.\n", hr); - fill_surface(surface, 0xff0000ff, 0); - IDirect3DSurface9_Release(surface); - - hr = IDirect3DDevice9_SetTexture(device, 0, (IDirect3DBaseTexture9 *) texture); - ok(hr == D3D_OK, "IDirect3DDevice9_SetTexture failed with %08x\n", hr); - hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_TEX1); - ok(hr == D3D_OK, "IDirect3DDevice9_SetFVF failed with %08x\n", hr); - - hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MIPFILTER, D3DTEXF_NONE); - ok(hr == D3D_OK, "IDirect3DDevice9_SetSamplerState failed with %08x\n", hr); - - hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xffffffff, 0.0, 0); - ok(hr == D3D_OK, "IDirect3DDevice9_Clear returned %08x\n", hr); - - hr = IDirect3DDevice9_BeginScene(device); - if(SUCCEEDED(hr)) - { - hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MAXMIPLEVEL, 0); - ok(hr == D3D_OK, "IDirect3DDevice9_SetSamplerState failed with %08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, &quads[0], sizeof(*quads->v)); - ok(SUCCEEDED(hr), "DrawPrimitiveUP failed (%08x)\n", hr); - - hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MAXMIPLEVEL, 1); - ok(hr == D3D_OK, "IDirect3DDevice9_SetSamplerState failed with %08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, &quads[1], sizeof(*quads->v)); - ok(SUCCEEDED(hr), "DrawPrimitiveUP failed (%08x)\n", hr); - - hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MAXMIPLEVEL, 2); - ok(hr == D3D_OK, "IDirect3DDevice9_SetSamplerState failed with %08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, &quads[2], sizeof(*quads->v)); - ok(SUCCEEDED(hr), "DrawPrimitiveUP failed (%08x)\n", hr); - - hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MAXMIPLEVEL, 3); - ok(hr == D3D_OK, "IDirect3DDevice9_SetSamplerState failed with %08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, &quads[3], sizeof(*quads->v)); - ok(SUCCEEDED(hr), "DrawPrimitiveUP failed (%08x)\n", hr); - hr = IDirect3DDevice9_EndScene(device); - ok(SUCCEEDED(hr), "EndScene failed (%08x)\n", hr); - } - - /* With mipmapping disabled, the max mip level is ignored, only level 0 is used */ - color = getPixelColor(device, 160, 360); - ok(color == 0x00ff0000, "MaxMip 0, no mipfilter has color 0x%08x.\n", color); - color = getPixelColor(device, 480, 360); - ok(color == 0x00ff0000, "MaxMip 1, no mipfilter has color 0x%08x.\n", color); - color = getPixelColor(device, 480, 120); - ok(color == 0x00ff0000, "MaxMip 2, no mipfilter has color 0x%08x.\n", color); - color = getPixelColor(device, 160, 120); - ok(color == 0x00ff0000, "MaxMip 3, no mipfilter has color 0x%08x.\n", color); - hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); - ok(SUCCEEDED(hr), "Present failed (0x%08x)\n", hr); - - hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MIPFILTER, D3DTEXF_POINT); - ok(hr == D3D_OK, "IDirect3DDevice9_SetSamplerState failed with %08x\n", hr); - - hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xffffffff, 0.0, 0); - ok(hr == D3D_OK, "IDirect3DDevice9_Clear returned %08x\n", hr); - - hr = IDirect3DDevice9_BeginScene(device); - if(SUCCEEDED(hr)) - { - hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MAXMIPLEVEL, 0); - ok(hr == D3D_OK, "IDirect3DDevice9_SetSamplerState failed with %08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, &quads[0], sizeof(*quads->v)); - ok(SUCCEEDED(hr), "DrawPrimitiveUP failed (%08x)\n", hr); - - hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MAXMIPLEVEL, 1); - ok(hr == D3D_OK, "IDirect3DDevice9_SetSamplerState failed with %08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, &quads[1], sizeof(*quads->v)); - ok(SUCCEEDED(hr), "DrawPrimitiveUP failed (%08x)\n", hr); - - hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MAXMIPLEVEL, 2); - ok(hr == D3D_OK, "IDirect3DDevice9_SetSamplerState failed with %08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, &quads[2], sizeof(*quads->v)); - ok(SUCCEEDED(hr), "DrawPrimitiveUP failed (%08x)\n", hr); - - hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MAXMIPLEVEL, 3); - ok(hr == D3D_OK, "IDirect3DDevice9_SetSamplerState failed with %08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, &quads[3], sizeof(*quads->v)); - ok(SUCCEEDED(hr), "DrawPrimitiveUP failed (%08x)\n", hr); - hr = IDirect3DDevice9_EndScene(device); - ok(SUCCEEDED(hr), "IDirect3DDevice9_EndScene returned %#x.\n", hr); - } + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); /* Max Mip level 0-2 sample from the specified texture level, Max Mip * level 3 (> levels in texture) samples from the highest level in the @@ -3542,50 +3555,48 @@ ok(hr == D3D_OK, "IDirect3DDevice9_Clear returned %08x\n", hr); hr = IDirect3DDevice9_BeginScene(device); - if(SUCCEEDED(hr)) - { - DWORD ret; + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); - /* Mipmapping OFF, LOD level smaller than MAXMIPLEVEL. LOD level limits */ - hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MIPFILTER, D3DTEXF_NONE); - ok(hr == D3D_OK, "IDirect3DDevice9_SetSamplerState failed with %08x\n", hr); - hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MAXMIPLEVEL, 0); - ok(hr == D3D_OK, "IDirect3DDevice9_SetSamplerState failed with %08x\n", hr); - ret = IDirect3DTexture9_SetLOD(texture, 1); - ok(ret == 0, "IDirect3DTexture9_SetLOD returned %u, expected 0\n", ret); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, &quads[0], sizeof(*quads->v)); - ok(SUCCEEDED(hr), "DrawPrimitiveUP failed (%08x)\n", hr); + /* Mipmapping OFF, LOD level smaller than MAXMIPLEVEL. LOD level limits */ + hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MIPFILTER, D3DTEXF_NONE); + ok(SUCCEEDED(hr), "Failed to set sampler state, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MAXMIPLEVEL, 0); + ok(SUCCEEDED(hr), "Failed to set sampler state, hr %#x.\n", hr); + ret = IDirect3DTexture9_SetLOD(texture, 1); + ok(ret == 0, "Got unexpected LOD %u.\n", ret); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, &quads[0], sizeof(*quads->v)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - /* Mipmapping ON, LOD level smaller than max mip level. LOD level limits */ - hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MIPFILTER, D3DTEXF_POINT); - ok(hr == D3D_OK, "IDirect3DDevice9_SetSamplerState failed with %08x\n", hr); - hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MAXMIPLEVEL, 1); - ok(hr == D3D_OK, "IDirect3DDevice9_SetSamplerState failed with %08x\n", hr); - ret = IDirect3DTexture9_SetLOD(texture, 2); - ok(ret == 1, "IDirect3DTexture9_SetLOD returned %u, expected 1\n", ret); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, &quads[1], sizeof(*quads->v)); - ok(SUCCEEDED(hr), "DrawPrimitiveUP failed (%08x)\n", hr); + /* Mipmapping ON, LOD level smaller than max mip level. LOD level limits */ + hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MIPFILTER, D3DTEXF_POINT); + ok(SUCCEEDED(hr), "Failed to set sampler state, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MAXMIPLEVEL, 1); + ok(SUCCEEDED(hr), "Failed to set sampler state, hr %#x.\n", hr); + ret = IDirect3DTexture9_SetLOD(texture, 2); + ok(ret == 1, "Got unexpected LOD %u.\n", ret); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, &quads[1], sizeof(*quads->v)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - /* Mipmapping ON, LOD level bigger than max mip level. MAXMIPLEVEL limits */ - hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MAXMIPLEVEL, 2); - ok(hr == D3D_OK, "IDirect3DDevice9_SetSamplerState failed with %08x\n", hr); - ret = IDirect3DTexture9_SetLOD(texture, 1); - ok(ret == 2, "IDirect3DTexture9_SetLOD returned %u, expected 2\n", ret); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, &quads[2], sizeof(*quads->v)); - ok(SUCCEEDED(hr), "DrawPrimitiveUP failed (%08x)\n", hr); + /* Mipmapping ON, LOD level bigger than max mip level. MAXMIPLEVEL limits */ + hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MAXMIPLEVEL, 2); + ok(SUCCEEDED(hr), "Failed to set sampler state, hr %#x.\n", hr); + ret = IDirect3DTexture9_SetLOD(texture, 1); + ok(ret == 2, "Got unexpected LOD %u.\n", ret); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, &quads[2], sizeof(*quads->v)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - /* Mipmapping OFF, LOD level bigger than max mip level. LOD level limits */ - hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MIPFILTER, D3DTEXF_NONE); - ok(hr == D3D_OK, "IDirect3DDevice9_SetSamplerState failed with %08x\n", hr); - hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MAXMIPLEVEL, 2); - ok(hr == D3D_OK, "IDirect3DDevice9_SetSamplerState failed with %08x\n", hr); - ret = IDirect3DTexture9_SetLOD(texture, 1); - ok(ret == 1, "IDirect3DTexture9_SetLOD returned %u, expected 1\n", ret); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, &quads[3], sizeof(*quads->v)); - ok(SUCCEEDED(hr), "DrawPrimitiveUP failed (%08x)\n", hr); - hr = IDirect3DDevice9_EndScene(device); - ok(SUCCEEDED(hr), "EndScene failed, hr %#x.\n", hr); - } + /* Mipmapping OFF, LOD level bigger than max mip level. LOD level limits */ + hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MIPFILTER, D3DTEXF_NONE); + ok(SUCCEEDED(hr), "Failed to set sampler state, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MAXMIPLEVEL, 2); + ok(SUCCEEDED(hr), "Failed to set sampler state, hr %#x.\n", hr); + ret = IDirect3DTexture9_SetLOD(texture, 1); + ok(ret == 1, "Got unexpected LOD %u.\n", ret); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, &quads[3], sizeof(*quads->v)); + 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); /* Max Mip level 0-2 sample from the specified texture level, Max Mip * level 3 (> levels in texture) samples from the highest level in the @@ -3602,55 +3613,62 @@ hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); ok(SUCCEEDED(hr), "Present failed (0x%08x)\n", hr); - hr = IDirect3DDevice9_SetTexture(device, 0, NULL); - ok(hr == D3D_OK, "IDirect3DDevice9_SetTexture failed with %08x\n", hr); - hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MIPFILTER, D3DTEXF_NONE); - ok(hr == D3D_OK, "IDirect3DDevice9_SetSamplerState failed with %08x\n", hr); - hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MAXMIPLEVEL, 0); - ok(hr == D3D_OK, "IDirect3DDevice9_SetSamplerState failed with %08x\n", hr); IDirect3DTexture9_Release(texture); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } -static void release_buffer_test(IDirect3DDevice9 *device) +static void release_buffer_test(void) { - IDirect3DVertexBuffer9 *vb = NULL; - IDirect3DIndexBuffer9 *ib = NULL; + IDirect3DVertexBuffer9 *vb; + IDirect3DIndexBuffer9 *ib; + IDirect3DDevice9 *device; + IDirect3D9 *d3d; + D3DCOLOR color; + ULONG refcount; + HWND window; HRESULT hr; BYTE *data; LONG ref; - static const struct vertex quad[] = { - {-1.0, -1.0, 0.1, 0xffff0000}, - {-1.0, 1.0, 0.1, 0xffff0000}, - { 1.0, 1.0, 0.1, 0xffff0000}, - - {-1.0, -1.0, 0.1, 0xff00ff00}, - {-1.0, 1.0, 0.1, 0xff00ff00}, - { 1.0, 1.0, 0.1, 0xff00ff00} - }; - short indices[] = {3, 4, 5}; - - /* Index and vertex buffers should always be creatable */ - hr = IDirect3DDevice9_CreateVertexBuffer(device, sizeof(quad), 0, D3DFVF_XYZ | D3DFVF_DIFFUSE, - D3DPOOL_MANAGED, &vb, NULL); - ok(hr == D3D_OK, "CreateVertexBuffer failed with %08x\n", hr); - if(!vb) { - skip("Failed to create a vertex buffer\n"); - return; - } - hr = IDirect3DDevice9_CreateIndexBuffer(device, sizeof(indices), 0, D3DFMT_INDEX16, D3DPOOL_DEFAULT, &ib, NULL); - ok(hr == D3D_OK, "IDirect3DDevice9_CreateIndexBuffer failed with %08x\n", hr); - if(!ib) { - skip("Failed to create an index buffer\n"); - return; + static const short indices[] = {3, 4, 5}; + static const struct vertex quad[] = + { + {-1.0f, -1.0f, 0.1f, 0xffff0000}, + {-1.0f, 1.0f, 0.1f, 0xffff0000}, + { 1.0f, 1.0f, 0.1f, 0xffff0000}, + + {-1.0f, -1.0f, 0.1f, 0xff00ff00}, + {-1.0f, 1.0f, 0.1f, 0xff00ff00}, + { 1.0f, 1.0f, 0.1f, 0xff00ff00}, + }; + + window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, + 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"); + goto done; } + /* Index and vertex buffers should always be creatable */ + hr = IDirect3DDevice9_CreateVertexBuffer(device, sizeof(quad), 0, + D3DFVF_XYZ | D3DFVF_DIFFUSE, D3DPOOL_MANAGED, &vb, NULL); + ok(SUCCEEDED(hr), "Failed to create vertex buffer, hr %#x.\n", hr); hr = IDirect3DVertexBuffer9_Lock(vb, 0, sizeof(quad), (void **) &data, 0); ok(hr == D3D_OK, "IDirect3DVertexBuffer9_Lock failed with %08x\n", hr); memcpy(data, quad, sizeof(quad)); hr = IDirect3DVertexBuffer9_Unlock(vb); ok(hr == D3D_OK, "IDirect3DVertexBuffer9_Unlock failed with %08x\n", hr); + hr = IDirect3DDevice9_CreateIndexBuffer(device, sizeof(indices), 0, + D3DFMT_INDEX16, D3DPOOL_DEFAULT, &ib, NULL); + ok(SUCCEEDED(hr), "Failed to create index buffer, hr %#x.\n", hr); hr = IDirect3DIndexBuffer9_Lock(ib, 0, sizeof(indices), (void **) &data, 0); ok(hr == D3D_OK, "IDirect3DIndexBuffer9_Lock failed with %08x\n", hr); memcpy(data, indices, sizeof(indices)); @@ -3663,70 +3681,84 @@ ok(hr == D3D_OK, "IDirect3DDevice9_SetStreamSource failed with %08x\n", hr); hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_DIFFUSE); ok(hr == D3D_OK, "IDirect3DDevice9_SetFVF failed with %08x\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_LIGHTING, FALSE); + ok(SUCCEEDED(hr), "Failed to disable lighting, hr %#x.\n", hr); /* Now destroy the bound index buffer and draw again */ ref = IDirect3DIndexBuffer9_Release(ib); ok(ref == 0, "Index Buffer reference count is %08d\n", ref); - hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff0000ff, 0.0, 0); + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff0000ff, 1.0f, 0); ok(hr == D3D_OK, "IDirect3DDevice9_Clear failed with %08x\n", hr); hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene failed with %08x\n", hr); - if(SUCCEEDED(hr)) - { - /* Deliberately using minvertexindex = 0 and numVertices = 6 to prevent d3d from - * making assumptions about the indices or vertices - */ - hr = IDirect3DDevice9_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, 0, 3, 3, 0, 1); - ok(hr == D3D_OK, "IDirect3DDevice9_DrawIndexedPrimitive failed with %08x\n", hr); - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_EndScene failed with %08x\n", hr); - } + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + /* Deliberately using minvertexindex = 0 and numVertices = 6 to prevent + * D3D from making assumptions about the indices or vertices. */ + hr = IDirect3DDevice9_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, 0, 3, 3, 0, 1); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + + color = getPixelColor(device, 160, 120); + ok(color_match(color, D3DCOLOR_ARGB(0x00, 0x00, 0xff, 0x00), 1), "Got unexpected color 0x%08x.\n", color); + color = getPixelColor(device, 480, 360); + ok(color_match(color, D3DCOLOR_ARGB(0x00, 0x00, 0x00, 0xff), 1), "Got unexpected color 0x%08x.\n", color); hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); ok(hr == D3D_OK, "IDirect3DDevice9_Present failed with %08x\n", hr); - hr = IDirect3DDevice9_SetIndices(device, NULL); - ok(hr == D3D_OK, "IDirect3DIndexBuffer9_Unlock failed with %08x\n", hr); - hr = IDirect3DDevice9_SetStreamSource(device, 0, NULL, 0, 0); - ok(hr == D3D_OK, "IDirect3DIndexBuffer9_Unlock failed with %08x\n", hr); - /* Index buffer was already destroyed as part of the test */ IDirect3DVertexBuffer9_Release(vb); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } -static void float_texture_test(IDirect3DDevice9 *device) +static void float_texture_test(void) { - IDirect3D9 *d3d = NULL; - HRESULT hr; - IDirect3DTexture9 *texture = NULL; + IDirect3DTexture9 *texture; + IDirect3DDevice9 *device; D3DLOCKED_RECT lr; + IDirect3D9 *d3d; + ULONG refcount; float *data; DWORD color; - float quad[] = { - -1.0, -1.0, 0.1, 0.0, 0.0, - -1.0, 1.0, 0.1, 0.0, 1.0, - 1.0, -1.0, 0.1, 1.0, 0.0, - 1.0, 1.0, 0.1, 1.0, 1.0, + HWND window; + HRESULT hr; + + static const float quad[] = + { + -1.0f, -1.0f, 0.1f, 0.0f, 0.0f, + -1.0f, 1.0f, 0.1f, 0.0f, 1.0f, + 1.0f, -1.0f, 0.1f, 1.0f, 0.0f, + 1.0f, 1.0f, 0.1f, 1.0f, 1.0f, }; - memset(&lr, 0, sizeof(lr)); - IDirect3DDevice9_GetDirect3D(device, &d3d); - if(IDirect3D9_CheckDeviceFormat(d3d, 0, D3DDEVTYPE_HAL, D3DFMT_X8R8G8B8, 0, - D3DRTYPE_TEXTURE, D3DFMT_R32F) != D3D_OK) { - skip("D3DFMT_R32F textures not supported\n"); - goto out; + 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"); + goto done; } - hr = IDirect3DDevice9_CreateTexture(device, 1, 1, 1, 0, D3DFMT_R32F, - D3DPOOL_MANAGED, &texture, NULL); - ok(hr == D3D_OK, "IDirect3DDevice9_CreateTexture failed with %08x\n", hr); - if(!texture) { - skip("Failed to create R32F texture\n"); - goto out; + if (IDirect3D9_CheckDeviceFormat(d3d, 0, D3DDEVTYPE_HAL, + D3DFMT_X8R8G8B8, 0, D3DRTYPE_TEXTURE, D3DFMT_R32F) != D3D_OK) + { + skip("D3DFMT_R32F textures not supported\n"); + IDirect3DDevice9_Release(device); + goto done; } + hr = IDirect3DDevice9_CreateTexture(device, 1, 1, 1, 0, D3DFMT_R32F, D3DPOOL_MANAGED, &texture, NULL); + ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr); + + memset(&lr, 0, sizeof(lr)); hr = IDirect3DTexture9_LockRect(texture, 0, &lr, NULL, 0); ok(hr == D3D_OK, "IDirect3DTexture9_LockRect failed with %08x\n", hr); data = lr.pBits; @@ -3734,24 +3766,22 @@ hr = IDirect3DTexture9_UnlockRect(texture, 0); ok(hr == D3D_OK, "IDirect3DTexture9_UnlockRect failed with %08x\n", hr); - hr = IDirect3DDevice9_SetTexture(device, 0, (IDirect3DBaseTexture9 *) texture); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_LIGHTING, FALSE); + ok(SUCCEEDED(hr), "Failed to disable lighting, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetTexture(device, 0, (IDirect3DBaseTexture9 *)texture); ok(hr == D3D_OK, "IDirect3DDevice9_SetTexture failed with %08x\n", hr); - hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene failed with %08x\n", hr); - if(SUCCEEDED(hr)) - { - hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_TEX1); - ok(hr == D3D_OK, "IDirect3DDevice9_SetFVF failed with %08x\n", hr); - - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float)); - ok(SUCCEEDED(hr), "DrawPrimitiveUP failed (%08x)\n", hr); + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff0000ff, 1.0f, 0); + ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_EndScene failed with %08x\n", hr); - } - hr = IDirect3DDevice9_SetTexture(device, 0, NULL); - ok(hr == D3D_OK, "IDirect3DDevice9_SetTexture failed with %08x\n", hr); + hr = IDirect3DDevice9_BeginScene(device); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_TEX1); + ok(SUCCEEDED(hr), "Failed to set FVF, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); color = getPixelColor(device, 240, 320); ok(color == 0x0000ffff, "R32F with value 0.0 has color %08x, expected 0x0000ffff\n", color); @@ -3759,42 +3789,56 @@ hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); ok(hr == D3D_OK, "IDirect3DDevice9_Present failed with %08x\n", hr); -out: - if(texture) IDirect3DTexture9_Release(texture); + IDirect3DTexture9_Release(texture); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: IDirect3D9_Release(d3d); + DestroyWindow(window); } -static void g16r16_texture_test(IDirect3DDevice9 *device) +static void g16r16_texture_test(void) { - IDirect3D9 *d3d = NULL; - HRESULT hr; - IDirect3DTexture9 *texture = NULL; + IDirect3DTexture9 *texture; + IDirect3DDevice9 *device; D3DLOCKED_RECT lr; + IDirect3D9 *d3d; + ULONG refcount; DWORD *data; DWORD color; - float quad[] = { - -1.0, -1.0, 0.1, 0.0, 0.0, - -1.0, 1.0, 0.1, 0.0, 1.0, - 1.0, -1.0, 0.1, 1.0, 0.0, - 1.0, 1.0, 0.1, 1.0, 1.0, + HWND window; + HRESULT hr; + + static const float quad[] = + { + -1.0f, -1.0f, 0.1f, 0.0f, 0.0f, + -1.0f, 1.0f, 0.1f, 0.0f, 1.0f, + 1.0f, -1.0f, 0.1f, 1.0f, 0.0f, + 1.0f, 1.0f, 0.1f, 1.0f, 1.0f, }; - memset(&lr, 0, sizeof(lr)); - IDirect3DDevice9_GetDirect3D(device, &d3d); - if(IDirect3D9_CheckDeviceFormat(d3d, 0, D3DDEVTYPE_HAL, D3DFMT_X8R8G8B8, 0, - D3DRTYPE_TEXTURE, D3DFMT_G16R16) != D3D_OK) { - skip("D3DFMT_G16R16 textures not supported\n"); - goto out; + 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"); + goto done; } - hr = IDirect3DDevice9_CreateTexture(device, 1, 1, 1, 0, D3DFMT_G16R16, - D3DPOOL_MANAGED, &texture, NULL); - ok(hr == D3D_OK, "IDirect3DDevice9_CreateTexture failed with %08x\n", hr); - if(!texture) { - skip("Failed to create D3DFMT_G16R16 texture\n"); - goto out; + if (IDirect3D9_CheckDeviceFormat(d3d, 0, D3DDEVTYPE_HAL, + D3DFMT_X8R8G8B8, 0, D3DRTYPE_TEXTURE, D3DFMT_G16R16) != D3D_OK) + { + skip("D3DFMT_G16R16 textures not supported\n"); + IDirect3DDevice9_Release(device); + goto done; } + hr = IDirect3DDevice9_CreateTexture(device, 1, 1, 1, 0, D3DFMT_G16R16, D3DPOOL_MANAGED, &texture, NULL); + ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr); + + memset(&lr, 0, sizeof(lr)); hr = IDirect3DTexture9_LockRect(texture, 0, &lr, NULL, 0); ok(hr == D3D_OK, "IDirect3DTexture9_LockRect failed with %08x\n", hr); data = lr.pBits; @@ -3802,24 +3846,22 @@ hr = IDirect3DTexture9_UnlockRect(texture, 0); ok(hr == D3D_OK, "IDirect3DTexture9_UnlockRect failed with %08x\n", hr); - hr = IDirect3DDevice9_SetTexture(device, 0, (IDirect3DBaseTexture9 *) texture); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_LIGHTING, FALSE); + ok(SUCCEEDED(hr), "Failed to disable lighting, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetTexture(device, 0, (IDirect3DBaseTexture9 *)texture); ok(hr == D3D_OK, "IDirect3DDevice9_SetTexture failed with %08x\n", hr); - hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene failed with %08x\n", hr); - if(SUCCEEDED(hr)) - { - hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_TEX1); - ok(hr == D3D_OK, "IDirect3DDevice9_SetFVF failed with %08x\n", hr); - - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float)); - ok(SUCCEEDED(hr), "DrawPrimitiveUP failed (%08x)\n", hr); + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff0000ff, 1.0f, 0); + ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_EndScene failed with %08x\n", hr); - } - hr = IDirect3DDevice9_SetTexture(device, 0, NULL); - ok(hr == D3D_OK, "IDirect3DDevice9_SetTexture failed with %08x\n", hr); + hr = IDirect3DDevice9_BeginScene(device); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_TEX1); + ok(SUCCEEDED(hr), "Failed to set FVF, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); color = getPixelColor(device, 240, 320); ok(color_match(color, D3DCOLOR_ARGB(0x00, 0xf0, 0x0f, 0xff), 1), @@ -3828,9 +3870,12 @@ hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); ok(hr == D3D_OK, "IDirect3DDevice9_Present failed with %08x\n", hr); -out: - if(texture) IDirect3DTexture9_Release(texture); + IDirect3DTexture9_Release(texture); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: IDirect3D9_Release(d3d); + DestroyWindow(window); } static void check_rect(IDirect3DDevice9 *device, RECT r, const char *message) @@ -3924,34 +3969,32 @@ ok(hr == D3D_OK, "IDirect3DDevice9_Clear returned %08x\n", hr); hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene failed with %08x\n", hr); - if (FAILED(hr)) - return; + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); for (i = 0; i < 4; ++i) { DWORD value = 0xdeadbeef; static const float proj_quads[] = { - -1.0, -1.0, 0.1, 0.0, 0.0, 4.0, 6.0, - 0.0, -1.0, 0.1, 4.0, 0.0, 4.0, 6.0, - -1.0, 0.0, 0.1, 0.0, 4.0, 4.0, 6.0, - 0.0, 0.0, 0.1, 4.0, 4.0, 4.0, 6.0, - - 0.0, -1.0, 0.1, 0.0, 0.0, 4.0, 6.0, - 1.0, -1.0, 0.1, 4.0, 0.0, 4.0, 6.0, - 0.0, 0.0, 0.1, 0.0, 4.0, 4.0, 6.0, - 1.0, 0.0, 0.1, 4.0, 4.0, 4.0, 6.0, - - -1.0, 0.0, 0.1, 0.0, 0.0, 4.0, 6.0, - 0.0, 0.0, 0.1, 4.0, 0.0, 4.0, 6.0, - -1.0, 1.0, 0.1, 0.0, 4.0, 4.0, 6.0, - 0.0, 1.0, 0.1, 4.0, 4.0, 4.0, 6.0, - - 0.0, 0.0, 0.1, 0.0, 0.0, 4.0, 6.0, - 1.0, 0.0, 0.1, 4.0, 0.0, 4.0, 6.0, - 0.0, 1.0, 0.1, 0.0, 4.0, 4.0, 6.0, - 1.0, 1.0, 0.1, 4.0, 4.0, 4.0, 6.0, + -1.0f, -1.0f, 0.1f, 0.0f, 0.0f, 4.0f, 6.0f, + -1.0f, 0.0f, 0.1f, 0.0f, 4.0f, 4.0f, 6.0f, + 0.0f, -1.0f, 0.1f, 4.0f, 0.0f, 4.0f, 6.0f, + 0.0f, 0.0f, 0.1f, 4.0f, 4.0f, 4.0f, 6.0f, + + 0.0f, -1.0f, 0.1f, 0.0f, 0.0f, 4.0f, 6.0f, + 0.0f, 0.0f, 0.1f, 0.0f, 4.0f, 4.0f, 6.0f, + 1.0f, -1.0f, 0.1f, 4.0f, 0.0f, 4.0f, 6.0f, + 1.0f, 0.0f, 0.1f, 4.0f, 4.0f, 4.0f, 6.0f, + + -1.0f, 0.0f, 0.1f, 0.0f, 0.0f, 4.0f, 6.0f, + -1.0f, 1.0f, 0.1f, 0.0f, 4.0f, 4.0f, 6.0f, + 0.0f, 0.0f, 0.1f, 4.0f, 0.0f, 4.0f, 6.0f, + 0.0f, 1.0f, 0.1f, 4.0f, 4.0f, 4.0f, 6.0f, + + 0.0f, 0.0f, 0.1f, 0.0f, 0.0f, 4.0f, 6.0f, + 0.0f, 1.0f, 0.1f, 0.0f, 4.0f, 4.0f, 6.0f, + 1.0f, 0.0f, 0.1f, 4.0f, 0.0f, 4.0f, 6.0f, + 1.0f, 1.0f, 0.1f, 4.0f, 4.0f, 4.0f, 6.0f, }; if (tests[i].vs) @@ -4011,7 +4054,7 @@ ok(hr == D3D_OK, "IDirect3DDevice9_Present failed with %08x\n", hr); } -static void texture_transform_flags_test(IDirect3DDevice9 *device) +static void texture_transform_flags_test(void) { HRESULT hr; IDirect3D9 *d3d; @@ -4019,16 +4062,16 @@ D3DCAPS9 caps; IDirect3DTexture9 *texture = NULL; IDirect3DVolumeTexture9 *volume = NULL; + IDirect3DDevice9 *device; unsigned int x, y, z; D3DLOCKED_RECT lr; D3DLOCKED_BOX lb; - DWORD color; + D3DCOLOR color; + ULONG refcount; + HWND window; UINT w, h; IDirect3DVertexDeclaration9 *decl, *decl2, *decl3, *decl4; - float identity[16] = {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}; + static const D3DVERTEXELEMENT9 decl_elements[] = { {0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, {0, 12, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0}, @@ -4053,15 +4096,29 @@ 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; + static const D3DMATRIX identity = + {{{ + 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, + }}}; + + 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"); + goto done; + } memset(&lr, 0, sizeof(lr)); memset(&lb, 0, sizeof(lb)); - IDirect3DDevice9_GetDirect3D(device, &d3d); - if(IDirect3D9_CheckDeviceFormat(d3d, 0, D3DDEVTYPE_HAL, D3DFMT_X8R8G8B8, 0, - D3DRTYPE_TEXTURE, D3DFMT_A16B16G16R16) == D3D_OK) { + if (IDirect3D9_CheckDeviceFormat(d3d, 0, D3DDEVTYPE_HAL, + D3DFMT_X8R8G8B8, 0, D3DRTYPE_TEXTURE, D3DFMT_A16B16G16R16) == D3D_OK) fmt = D3DFMT_A16B16G16R16; - } - IDirect3D9_Release(d3d); hr = IDirect3DDevice9_CreateVertexDeclaration(device, decl_elements, &decl); ok(hr == D3D_OK, "IDirect3DDevice9_CreateVertexDeclaration returned %08x\n", hr); @@ -4091,7 +4148,7 @@ ok(hr == D3D_OK, "IDirect3DDevice9_SetTextureStageState(D3DTSS_COLORARG1) returned %08x\n", hr); hr = IDirect3DDevice9_SetRenderState(device, D3DRS_LIGHTING, FALSE); ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState(D3DRS_LIGHTING) returned %08x\n", hr); - hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff0000ff, 0.0, 0); + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff0000ff, 1.0f, 0); ok(hr == D3D_OK, "IDirect3DDevice9_Clear returned %08x\n", hr); hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); @@ -4101,9 +4158,11 @@ hr = IDirect3DDevice9_CreateTexture(device, w, h, 1, 0, fmt, D3DPOOL_MANAGED, &texture, NULL); ok(hr == D3D_OK, "IDirect3DDevice9_CreateTexture returned %08x\n", hr); - if(!texture) { - skip("Failed to create the test texture\n"); - return; + if (!texture) + { + skip("Failed to create the test texture.\n"); + IDirect3DDevice9_Release(device); + goto done; } /* Unfortunately there is no easy way to set up a texture coordinate passthrough @@ -4147,37 +4206,44 @@ ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene failed with %08x\n", hr); if(SUCCEEDED(hr)) { - float quad1[] = { - -1.0, -1.0, 0.1, 1.0, 1.0, - -1.0, 0.0, 0.1, 1.0, 1.0, - 0.0, -1.0, 0.1, 1.0, 1.0, - 0.0, 0.0, 0.1, 1.0, 1.0, + static const float quad1[] = + { + -1.0f, -1.0f, 0.1f, 1.0f, 1.0f, + -1.0f, 0.0f, 0.1f, 1.0f, 1.0f, + 0.0f, -1.0f, 0.1f, 1.0f, 1.0f, + 0.0f, 0.0f, 0.1f, 1.0f, 1.0f, }; - float quad2[] = { - -1.0, 0.0, 0.1, 1.0, 1.0, - -1.0, 1.0, 0.1, 1.0, 1.0, - 0.0, 0.0, 0.1, 1.0, 1.0, - 0.0, 1.0, 0.1, 1.0, 1.0, + static const float quad2[] = + { + -1.0f, 0.0f, 0.1f, 1.0f, 1.0f, + -1.0f, 1.0f, 0.1f, 1.0f, 1.0f, + 0.0f, 0.0f, 0.1f, 1.0f, 1.0f, + 0.0f, 1.0f, 0.1f, 1.0f, 1.0f, }; - float quad3[] = { - 0.0, 0.0, 0.1, 0.5, 0.5, - 0.0, 1.0, 0.1, 0.5, 0.5, - 1.0, 0.0, 0.1, 0.5, 0.5, - 1.0, 1.0, 0.1, 0.5, 0.5, + static const float quad3[] = + { + 0.0f, 0.0f, 0.1f, 0.5f, 0.5f, + 0.0f, 1.0f, 0.1f, 0.5f, 0.5f, + 1.0f, 0.0f, 0.1f, 0.5f, 0.5f, + 1.0f, 1.0f, 0.1f, 0.5f, 0.5f, }; - float quad4[] = { - 320, 480, 0.1, 1.0, 0.0, 1.0, - 320, 240, 0.1, 1.0, 0.0, 1.0, - 640, 480, 0.1, 1.0, 0.0, 1.0, - 640, 240, 0.1, 1.0, 0.0, 1.0, + static const float quad4[] = + { + 320.0f, 480.0f, 0.1f, 1.0f, 0.0f, 1.0f, + 320.0f, 240.0f, 0.1f, 1.0f, 0.0f, 1.0f, + 640.0f, 480.0f, 0.1f, 1.0f, 0.0f, 1.0f, + 640.0f, 240.0f, 0.1f, 1.0f, 0.0f, 1.0f, }; - float mat[16] = {0.0, 0.0, 0.0, 0.0, - 0.0, 0.0, 0.0, 0.0, - 0.0, 0.0, 0.0, 0.0, - 0.0, 0.0, 0.0, 0.0}; + D3DMATRIX mat = + {{{ + 0.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 0.0f, + }}}; /* What happens with the texture matrix if D3DTSS_TEXTURETRANSFORMFLAGS is disabled? */ - hr = IDirect3DDevice9_SetTransform(device, D3DTS_TEXTURE0, (D3DMATRIX *) &mat); + hr = IDirect3DDevice9_SetTransform(device, D3DTS_TEXTURE0, &mat); ok(hr == D3D_OK, "IDirect3DDevice9_SetTransform failed with %08x\n", hr); hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad1, 5 * sizeof(float)); ok(SUCCEEDED(hr), "DrawPrimitiveUP failed (%08x)\n", hr); @@ -4189,9 +4255,9 @@ ok(SUCCEEDED(hr), "DrawPrimitiveUP failed (%08x)\n", hr); /* What happens if 4 coords are used, but only 2 given ?*/ - mat[8] = 1.0; - mat[13] = 1.0; - hr = IDirect3DDevice9_SetTransform(device, D3DTS_TEXTURE0, (D3DMATRIX *) &mat); + U(mat).m[2][0] = 1.0f; + U(mat).m[3][1] = 1.0f; + hr = IDirect3DDevice9_SetTransform(device, D3DTS_TEXTURE0, &mat); ok(hr == D3D_OK, "IDirect3DDevice9_SetTransform failed with %08x\n", hr); hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_COUNT4); ok(SUCCEEDED(hr), "IDirect3DDevice9_SetTextureStageState failed (%08x)\n", hr); @@ -4202,8 +4268,8 @@ * geometry. If the same applies to transformed vertices, the quad will be black, otherwise red, * due to the coords in the vertices. (turns out red, indeed) */ - memset(mat, 0, sizeof(mat)); - hr = IDirect3DDevice9_SetTransform(device, D3DTS_TEXTURE0, (D3DMATRIX *) &mat); + memset(&mat, 0, sizeof(mat)); + hr = IDirect3DDevice9_SetTransform(device, D3DTS_TEXTURE0, &mat); ok(hr == D3D_OK, "IDirect3DDevice9_SetTransform failed with %08x\n", hr); hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZRHW | D3DFVF_TEX1); ok(SUCCEEDED(hr), "IDirect3DDevice9_SetFVF failed with %08x\n", hr); @@ -4235,37 +4301,44 @@ ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene failed with %08x\n", hr); if(SUCCEEDED(hr)) { - float quad1[] = { - -1.0, -1.0, 0.1, 0.8, 0.2, - -1.0, 0.0, 0.1, 0.8, 0.2, - 0.0, -1.0, 0.1, 0.8, 0.2, - 0.0, 0.0, 0.1, 0.8, 0.2, + static const float quad1[] = + { + -1.0f, -1.0f, 0.1f, 0.8f, 0.2f, + -1.0f, 0.0f, 0.1f, 0.8f, 0.2f, + 0.0f, -1.0f, 0.1f, 0.8f, 0.2f, + 0.0f, 0.0f, 0.1f, 0.8f, 0.2f, }; - float quad2[] = { - -1.0, 0.0, 0.1, 0.5, 1.0, - -1.0, 1.0, 0.1, 0.5, 1.0, - 0.0, 0.0, 0.1, 0.5, 1.0, - 0.0, 1.0, 0.1, 0.5, 1.0, + static const float quad2[] = + { + -1.0f, 0.0f, 0.1f, 0.5f, 1.0f, + -1.0f, 1.0f, 0.1f, 0.5f, 1.0f, + 0.0f, 0.0f, 0.1f, 0.5f, 1.0f, + 0.0f, 1.0f, 0.1f, 0.5f, 1.0f, }; - float quad3[] = { - 0.0, 0.0, 0.1, 0.5, 1.0, - 0.0, 1.0, 0.1, 0.5, 1.0, - 1.0, 0.0, 0.1, 0.5, 1.0, - 1.0, 1.0, 0.1, 0.5, 1.0, + static const float quad3[] = + { + 0.0f, 0.0f, 0.1f, 0.5f, 1.0f, + 0.0f, 1.0f, 0.1f, 0.5f, 1.0f, + 1.0f, 0.0f, 0.1f, 0.5f, 1.0f, + 1.0f, 1.0f, 0.1f, 0.5f, 1.0f, }; - float quad4[] = { - 0.0, -1.0, 0.1, 0.8, 0.2, - 0.0, 0.0, 0.1, 0.8, 0.2, - 1.0, -1.0, 0.1, 0.8, 0.2, - 1.0, 0.0, 0.1, 0.8, 0.2, + static const float quad4[] = + { + 0.0f, -1.0f, 0.1f, 0.8f, 0.2f, + 0.0f, 0.0f, 0.1f, 0.8f, 0.2f, + 1.0f, -1.0f, 0.1f, 0.8f, 0.2f, + 1.0f, 0.0f, 0.1f, 0.8f, 0.2f, }; - float mat[16] = {0.0, 0.0, 0.0, 0.0, - 0.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 0.0, 0.0}; + D3DMATRIX mat = + {{{ + 0.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 0.0f, + }}}; /* What happens to the default 1 in the 3rd coordinate if it is disabled? */ - hr = IDirect3DDevice9_SetTransform(device, D3DTS_TEXTURE0, (D3DMATRIX *) &mat); + hr = IDirect3DDevice9_SetTransform(device, D3DTS_TEXTURE0, &mat); ok(hr == D3D_OK, "IDirect3DDevice9_SetTransform failed with %08x\n", hr); hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_COUNT2); ok(SUCCEEDED(hr), "IDirect3DDevice9_SetTextureStageState failed (%08x)\n", hr); @@ -4281,8 +4354,8 @@ ok(SUCCEEDED(hr), "DrawPrimitiveUP failed (%08x)\n", hr); /* Just to be sure, the same as quad2 above */ - memset(mat, 0, sizeof(mat)); - hr = IDirect3DDevice9_SetTransform(device, D3DTS_TEXTURE0, (D3DMATRIX *) &mat); + memset(&mat, 0, sizeof(mat)); + hr = IDirect3DDevice9_SetTransform(device, D3DTS_TEXTURE0, &mat); ok(hr == D3D_OK, "IDirect3DDevice9_SetTransform failed with %08x\n", hr); hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_COUNT2); ok(SUCCEEDED(hr), "IDirect3DDevice9_SetTextureStageState failed (%08x)\n", hr); @@ -4414,7 +4487,7 @@ }, }; - hr = IDirect3DDevice9_SetTransform(device, D3DTS_TEXTURE0, (D3DMATRIX *) &identity); + hr = IDirect3DDevice9_SetTransform(device, D3DTS_TEXTURE0, &identity); ok(hr == D3D_OK, "IDirect3DDevice9_SetTransform failed with %08x\n", hr); hr = IDirect3DTexture9_LockRect(texture, 0, &lr, NULL, 0); @@ -4486,41 +4559,48 @@ ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene failed with %08x\n", hr); if(SUCCEEDED(hr)) { - float quad1[] = { - -1.0, -1.0, 0.1, 1.0, 1.0, 1.0, - -1.0, 0.0, 0.1, 1.0, 1.0, 1.0, - 0.0, -1.0, 0.1, 1.0, 1.0, 1.0, - 0.0, 0.0, 0.1, 1.0, 1.0, 1.0 + static const float quad1[] = + { + -1.0f, -1.0f, 0.1f, 1.0f, 1.0f, 1.0f, + -1.0f, 0.0f, 0.1f, 1.0f, 1.0f, 1.0f, + 0.0f, -1.0f, 0.1f, 1.0f, 1.0f, 1.0f, + 0.0f, 0.0f, 0.1f, 1.0f, 1.0f, 1.0f, }; - float quad2[] = { - -1.0, 0.0, 0.1, 1.0, 1.0, 1.0, - -1.0, 1.0, 0.1, 1.0, 1.0, 1.0, - 0.0, 0.0, 0.1, 1.0, 1.0, 1.0, - 0.0, 1.0, 0.1, 1.0, 1.0, 1.0 + static const float quad2[] = + { + -1.0f, 0.0f, 0.1f, 1.0f, 1.0f, 1.0f, + -1.0f, 1.0f, 0.1f, 1.0f, 1.0f, 1.0f, + 0.0f, 0.0f, 0.1f, 1.0f, 1.0f, 1.0f, + 0.0f, 1.0f, 0.1f, 1.0f, 1.0f, 1.0f, }; - float quad3[] = { - 0.0, 0.0, 0.1, 0.0, 0.0, - 0.0, 1.0, 0.1, 0.0, 0.0, - 1.0, 0.0, 0.1, 0.0, 0.0, - 1.0, 1.0, 0.1, 0.0, 0.0 + static const float quad3[] = + { + 0.0f, 0.0f, 0.1f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.1f, 0.0f, 0.0f, + 1.0f, 0.0f, 0.1f, 0.0f, 0.0f, + 1.0f, 1.0f, 0.1f, 0.0f, 0.0f, }; - float quad4[] = { - 0.0, -1.0, 0.1, 1.0, 1.0, 1.0, - 0.0, 0.0, 0.1, 1.0, 1.0, 1.0, - 1.0, -1.0, 0.1, 1.0, 1.0, 1.0, - 1.0, 0.0, 0.1, 1.0, 1.0, 1.0 + static const float quad4[] = + { + 0.0f, -1.0f, 0.1f, 1.0f, 1.0f, 1.0f, + 0.0f, 0.0f, 0.1f, 1.0f, 1.0f, 1.0f, + 1.0f, -1.0f, 0.1f, 1.0f, 1.0f, 1.0f, + 1.0f, 0.0f, 0.1f, 1.0f, 1.0f, 1.0f, }; - float mat[16] = {1.0, 0.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 0.0, 1.0}; + D3DMATRIX mat = + {{{ + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f, + }}}; hr = IDirect3DDevice9_SetVertexDeclaration(device, decl); ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexDeclaration failed with %08x\n", hr); /* Draw a quad with all 3 coords enabled. Nothing fancy. v and w are swapped, but have the same * values */ - hr = IDirect3DDevice9_SetTransform(device, D3DTS_TEXTURE0, (D3DMATRIX *) mat); + hr = IDirect3DDevice9_SetTransform(device, D3DTS_TEXTURE0, &mat); ok(hr == D3D_OK, "IDirect3DDevice9_SetTransform failed with %08x\n", hr); hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_COUNT3); ok(hr == D3D_OK, "IDirect3DDevice9_SetTextureStageState failed (%08x)\n", hr); @@ -4538,7 +4618,7 @@ ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr); /* default values? Set up the identity matrix, pass in 2 vertex coords, and enable 3 */ - hr = IDirect3DDevice9_SetTransform(device, D3DTS_TEXTURE0, (D3DMATRIX *) identity); + hr = IDirect3DDevice9_SetTransform(device, D3DTS_TEXTURE0, &identity); ok(hr == D3D_OK, "IDirect3DDevice9_SetTransform failed with %08x\n", hr); hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_COUNT3); ok(hr == D3D_OK, "IDirect3DDevice9_SetTextureStageState failed (%08x)\n", hr); @@ -4550,8 +4630,8 @@ /* D3DTTFF_COUNT1. Set a NULL matrix, and count1, pass in all values as 1.0. Nvidia has count1 == * disable. ATI extends it up to the amount of values needed for the volume texture */ - memset(mat, 0, sizeof(mat)); - hr = IDirect3DDevice9_SetTransform(device, D3DTS_TEXTURE0, (D3DMATRIX *) mat); + memset(&mat, 0, sizeof(mat)); + hr = IDirect3DDevice9_SetTransform(device, D3DTS_TEXTURE0, &mat); ok(hr == D3D_OK, "IDirect3DDevice9_SetTransform failed with %08x\n", hr); hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_COUNT1); ok(hr == D3D_OK, "IDirect3DDevice9_SetTextureStageState failed (%08x)\n", hr); @@ -4583,32 +4663,41 @@ ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene failed with %08x\n", hr); if(SUCCEEDED(hr)) { - float quad1[] = { - -1.0, -1.0, 0.1, 1.0, 1.0, 1.0, - -1.0, 0.0, 0.1, 1.0, 1.0, 1.0, - 0.0, -1.0, 0.1, 1.0, 1.0, 1.0, - 0.0, 0.0, 0.1, 1.0, 1.0, 1.0 + static const float quad1[] = + { + -1.0f, -1.0f, 0.1f, 1.0f, 1.0f, 1.0f, + -1.0f, 0.0f, 0.1f, 1.0f, 1.0f, 1.0f, + 0.0f, -1.0f, 0.1f, 1.0f, 1.0f, 1.0f, + 0.0f, 0.0f, 0.1f, 1.0f, 1.0f, 1.0f, }; - float quad2[] = { - -1.0, 0.0, 0.1, - -1.0, 1.0, 0.1, - 0.0, 0.0, 0.1, - 0.0, 1.0, 0.1, + static const float quad2[] = + { + -1.0f, 0.0f, 0.1f, + -1.0f, 1.0f, 0.1f, + 0.0f, 0.0f, 0.1f, + 0.0f, 1.0f, 0.1f, }; - float quad3[] = { - 0.0, 0.0, 0.1, 1.0, - 0.0, 1.0, 0.1, 1.0, - 1.0, 0.0, 0.1, 1.0, - 1.0, 1.0, 0.1, 1.0 + static const float quad3[] = + { + 0.0f, 0.0f, 0.1f, 1.0f, + 0.0f, 1.0f, 0.1f, 1.0f, + 1.0f, 0.0f, 0.1f, 1.0f, + 1.0f, 1.0f, 0.1f, 1.0f, }; - float mat[16] = {0.0, 0.0, 0.0, 0.0, - 0.0, 0.0, 0.0, 0.0, - 0.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0}; - float mat2[16] = {0.0, 0.0, 0.0, 1.0, - 1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 1.0, 0.0}; + static const D3DMATRIX mat = + {{{ + 0.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + }}}; + static const D3DMATRIX mat2 = + {{{ + 0.0f, 0.0f, 0.0f, 1.0f, + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + }}}; hr = IDirect3DDevice9_SetVertexDeclaration(device, decl); ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexDeclaration failed with %08x\n", hr); @@ -4618,7 +4707,7 @@ * affects the post-transformation output, so COUNT3 plus the matrix above is OK for testing the * 4th *input* coordinate. */ - hr = IDirect3DDevice9_SetTransform(device, D3DTS_TEXTURE0, (D3DMATRIX *) mat); + hr = IDirect3DDevice9_SetTransform(device, D3DTS_TEXTURE0, &mat); ok(hr == D3D_OK, "IDirect3DDevice9_SetTransform failed with %08x\n", hr); hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_COUNT3); ok(hr == D3D_OK, "IDirect3DDevice9_SetTextureStageState failed (%08x)\n", hr); @@ -4626,7 +4715,7 @@ ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr); /* None passed */ - hr = IDirect3DDevice9_SetTransform(device, D3DTS_TEXTURE0, (D3DMATRIX *) identity); + hr = IDirect3DDevice9_SetTransform(device, D3DTS_TEXTURE0, &identity); ok(hr == D3D_OK, "IDirect3DDevice9_SetTransform failed with %08x\n", hr); hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ); ok(hr == D3D_OK, "IDirect3DDevice9_SetFVF failed with %08x\n", hr); @@ -4636,7 +4725,7 @@ /* 4 used, 1 passed */ hr = IDirect3DDevice9_SetVertexDeclaration(device, decl2); ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexDeclaration failed with %08x\n", hr); - hr = IDirect3DDevice9_SetTransform(device, D3DTS_TEXTURE0, (D3DMATRIX *) mat2); + hr = IDirect3DDevice9_SetTransform(device, D3DTS_TEXTURE0, &mat2); ok(hr == D3D_OK, "IDirect3DDevice9_SetTransform failed with %08x\n", hr); hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad3, 4 * sizeof(float)); ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr); @@ -4657,32 +4746,36 @@ IDirect3DVolumeTexture9_Release(volume); - out: - hr = IDirect3DDevice9_SetVertexDeclaration(device, NULL); - ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexDeclaration failed with %08x\n", hr); - hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_TEXTURETRANSFORMFLAGS, D3DTTFF_DISABLE); - ok(SUCCEEDED(hr), "IDirect3DDevice9_SetTextureStageState failed (%08x)\n", hr); - hr = IDirect3DDevice9_SetTransform(device, D3DTS_TEXTURE0, (D3DMATRIX *) &identity); - ok(hr == D3D_OK, "IDirect3DDevice9_SetTransform failed with %08x\n", hr); - hr = IDirect3DDevice9_SetTexture(device, 0, NULL); - ok(hr == D3D_OK, "IDirect3DDevice9_SetTexture returned %08x\n", hr); +out: IDirect3DVertexDeclaration9_Release(decl); IDirect3DVertexDeclaration9_Release(decl2); IDirect3DVertexDeclaration9_Release(decl3); IDirect3DVertexDeclaration9_Release(decl4); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } -static void texdepth_test(IDirect3DDevice9 *device) +static void texdepth_test(void) { IDirect3DPixelShader9 *shader; + IDirect3DDevice9 *device; + IDirect3D9 *d3d; + ULONG refcount; + D3DCAPS9 caps; + DWORD color; + HWND window; HRESULT hr; - const float texdepth_test_data1[] = { 0.25, 2.0, 0.0, 0.0}; - const float texdepth_test_data2[] = { 0.25, 0.5, 0.0, 0.0}; - const float texdepth_test_data3[] = {-1.00, 0.1, 0.0, 0.0}; - const float texdepth_test_data4[] = {-0.25, -0.5, 0.0, 0.0}; - const float texdepth_test_data5[] = { 1.00, -0.1, 0.0, 0.0}; - const float texdepth_test_data6[] = { 1.00, 0.5, 0.0, 0.0}; - const float texdepth_test_data7[] = { 0.50, 0.0, 0.0, 0.0}; + + static const float texdepth_test_data1[] = { 0.25f, 2.0f, 0.0f, 0.0f}; + static const float texdepth_test_data2[] = { 0.25f, 0.5f, 0.0f, 0.0f}; + static const float texdepth_test_data3[] = {-1.00f, 0.1f, 0.0f, 0.0f}; + static const float texdepth_test_data4[] = {-0.25f, -0.5f, 0.0f, 0.0f}; + static const float texdepth_test_data5[] = { 1.00f, -0.1f, 0.0f, 0.0f}; + static const float texdepth_test_data6[] = { 1.00f, 0.5f, 0.0f, 0.0f}; + static const float texdepth_test_data7[] = { 0.50f, 0.0f, 0.0f, 0.0f}; static const DWORD shader_code[] = { 0xffff0104, /* ps_1_4 */ @@ -4693,19 +4786,40 @@ 0x00000001, 0x800f0000, 0xa0e40001, /* mov r0, c1 */ 0x0000ffff /* end */ }; - DWORD color; - float vertex[] = { - -1.0, -1.0, 0.0, - 1.0, -1.0, 1.0, - -1.0, 1.0, 0.0, - 1.0, 1.0, 1.0 - }; + static const float vertex[] = + { + -1.0f, -1.0f, 0.0f, + -1.0f, 1.0f, 0.0f, + 1.0f, -1.0f, 1.0f, + 1.0f, 1.0f, 1.0f, + }; + + 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"); + goto done; + } + + hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); + if (caps.PixelShaderVersion < D3DPS_VERSION(1, 1)) + { + skip("No ps_1_1 support, skipping tests.\n"); + IDirect3DDevice9_Release(device); + goto done; + } hr = IDirect3DDevice9_CreatePixelShader(device, shader_code, &shader); ok(hr == D3D_OK, "IDirect3DDevice9_CreatePixelShader returned %08x\n", hr); hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xffffff00, 0.0, 0); ok(hr == D3D_OK, "IDirect3DDevice9_Clear returned %08x\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_LIGHTING, FALSE); + ok(SUCCEEDED(hr), "Failed to disable lighting, hr %#x.\n", hr); hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ZENABLE, D3DZB_TRUE); ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState returned %08x\n", hr); hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ZWRITEENABLE, TRUE); @@ -4717,14 +4831,11 @@ /* Fill the depth buffer with a gradient */ hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene returned %08x\n", hr); - if(SUCCEEDED(hr)) - { - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, vertex, 3 * sizeof(float)); - ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr); - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_EndScene returned %08x\n", hr); - } + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, vertex, 3 * sizeof(float)); + 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); /* Now perform the actual tests. Same geometry, but with the shader */ hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ZFUNC, D3DCMP_GREATER); @@ -4737,15 +4848,11 @@ hr = IDirect3DDevice9_SetPixelShaderConstantF(device, 0, texdepth_test_data1, 1); ok(hr == D3D_OK, "IDirect3DDevice9_SetPixelShaderConstantF returned %08x\n", hr); hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene returned %08x\n", hr); - if(SUCCEEDED(hr)) - { - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, vertex, 3 * sizeof(float)); - ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr); - - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_EndScene returned %08x\n", hr); - } + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, vertex, 3 * sizeof(float)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); color = getPixelColor(device, 158, 240); ok(color == 0x000000ff, "Pixel 158(25%% - 2 pixel) has color %08x, expected 0x000000ff\n", color); @@ -4761,15 +4868,11 @@ hr = IDirect3DDevice9_SetPixelShaderConstantF(device, 0, texdepth_test_data2, 1); ok(hr == D3D_OK, "IDirect3DDevice9_SetPixelShaderConstantF returned %08x\n", hr); hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene returned %08x\n", hr); - if(SUCCEEDED(hr)) - { - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, vertex, 3 * sizeof(float)); - ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr); - - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_EndScene returned %08x\n", hr); - } + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, vertex, 3 * sizeof(float)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); color = getPixelColor(device, 318, 240); ok(color == 0x000000ff, "Pixel 318(50%% - 2 pixel) has color %08x, expected 0x000000ff\n", color); @@ -4785,15 +4888,11 @@ hr = IDirect3DDevice9_SetPixelShaderConstantF(device, 0, texdepth_test_data3, 1); ok(hr == D3D_OK, "IDirect3DDevice9_SetPixelShaderConstantF returned %08x\n", hr); hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene returned %08x\n", hr); - if(SUCCEEDED(hr)) - { - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, vertex, 3 * sizeof(float)); - ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr); - - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_EndScene returned %08x\n", hr); - } + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, vertex, 3 * sizeof(float)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); color = getPixelColor(device, 1, 240); ok(color == 0x00ff0000, "Pixel 1(0%% + 2 pixel) has color %08x, expected 0x00ff0000\n", color); @@ -4807,15 +4906,12 @@ hr = IDirect3DDevice9_SetPixelShaderConstantF(device, 0, texdepth_test_data4, 1); ok(hr == D3D_OK, "IDirect3DDevice9_SetPixelShaderConstantF returned %08x\n", hr); hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene returned %08x\n", hr); - if(SUCCEEDED(hr)) - { - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, vertex, 3 * sizeof(float)); - ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, vertex, 3 * sizeof(float)); + 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_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_EndScene returned %08x\n", hr); - } color = getPixelColor(device, 318, 240); ok(color == 0x000000ff, "Pixel 318(50%% - 2 pixel) has color %08x, expected 0x000000ff\n", color); color = getPixelColor(device, 322, 240); @@ -4830,15 +4926,11 @@ hr = IDirect3DDevice9_SetPixelShaderConstantF(device, 0, texdepth_test_data5, 1); ok(hr == D3D_OK, "IDirect3DDevice9_SetPixelShaderConstantF returned %08x\n", hr); hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene returned %08x\n", hr); - if(SUCCEEDED(hr)) - { - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, vertex, 3 * sizeof(float)); - ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr); - - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_EndScene returned %08x\n", hr); - } + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, vertex, 3 * sizeof(float)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); color = getPixelColor(device, 1, 240); ok(color == 0x00ffff00, "Pixel 1(0%% + 2 pixel) has color %08x, expected 0x00ffff00\n", color); @@ -4852,15 +4944,11 @@ hr = IDirect3DDevice9_SetPixelShaderConstantF(device, 0, texdepth_test_data6, 1); ok(hr == D3D_OK, "IDirect3DDevice9_SetPixelShaderConstantF returned %08x\n", hr); hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene returned %08x\n", hr); - if(SUCCEEDED(hr)) - { - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, vertex, 3 * sizeof(float)); - ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr); - - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_EndScene returned %08x\n", hr); - } + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, vertex, 3 * sizeof(float)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); color = getPixelColor(device, 638, 240); ok(color == 0x000000ff, "Pixel 638(100%% + 2 pixel) has color %08x, expected 0x000000ff\n", color); @@ -4874,15 +4962,11 @@ hr = IDirect3DDevice9_SetPixelShaderConstantF(device, 0, texdepth_test_data7, 1); ok(hr == D3D_OK, "IDirect3DDevice9_SetPixelShaderConstantF returned %08x\n", hr); hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene returned %08x\n", hr); - if(SUCCEEDED(hr)) - { - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, vertex, 3 * sizeof(float)); - ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr); - - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_EndScene returned %08x\n", hr); - } + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, vertex, 3 * sizeof(float)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); color = getPixelColor(device, 638, 240); ok(color == 0x000000ff, "Pixel 638(100%% + 2 pixel) has color %08x, expected 0x000000ff\n", color); @@ -4890,31 +4974,33 @@ hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); ok(hr == D3D_OK, "IDirect3DDevice9_Present failed with %08x\n", hr); - /* Cleanup */ - hr = IDirect3DDevice9_SetPixelShader(device, NULL); - ok(hr == D3D_OK, "IDirect3DDevice9_SetPixelShader failed (%08x)\n", hr); IDirect3DPixelShader9_Release(shader); - - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ZENABLE, D3DZB_FALSE); - ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState returned %08x\n", hr); - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ZWRITEENABLE, TRUE); - ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState returned %08x\n", hr); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } -static void texkill_test(IDirect3DDevice9 *device) +static void texkill_test(void) { IDirect3DPixelShader9 *shader; - HRESULT hr; + IDirect3DDevice9 *device; + IDirect3D9 *d3d; + ULONG refcount; + D3DCAPS9 caps; DWORD color; + HWND window; + HRESULT hr; - const float vertex[] = { - /* bottom top right left */ - -1.0, -1.0, 1.0, -0.1, 0.9, 0.9, -0.1, - 1.0, -1.0, 0.0, 0.9, -0.1, 0.9, -0.1, - -1.0, 1.0, 1.0, -0.1, 0.9, -0.1, 0.9, - 1.0, 1.0, 0.0, 0.9, -0.1, -0.1, 0.9, + static const float vertex[] = + { + /* bottom top right left */ + -1.0f, -1.0f, 1.0f, -0.1f, 0.9f, 0.9f, -0.1f, + -1.0f, 1.0f, 1.0f, -0.1f, 0.9f, -0.1f, 0.9f, + 1.0f, -1.0f, 0.0f, 0.9f, -0.1f, 0.9f, -0.1f, + 1.0f, 1.0f, 0.0f, 0.9f, -0.1f, -0.1f, 0.9f, }; - static const DWORD shader_code_11[] = { 0xffff0101, /* ps_1_1 */ @@ -4933,7 +5019,26 @@ 0x0000ffff /* end */ }; - hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff00ff00, 0.0, 0); + 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"); + goto done; + } + + hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); + if (caps.PixelShaderVersion < D3DPS_VERSION(1, 1)) + { + skip("No ps_1_1 support, skipping tests.\n"); + IDirect3DDevice9_Release(device); + goto done; + } + + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff00ff00, 1.0f, 0); ok(hr == D3D_OK, "IDirect3DDevice9_CreatePixelShader returned %08x\n", hr); hr = IDirect3DDevice9_CreatePixelShader(device, shader_code_11, &shader); ok(hr == D3D_OK, "IDirect3DDevice9_CreatePixelShader returned %08x\n", hr); @@ -4941,16 +5046,14 @@ hr = IDirect3DDevice9_SetPixelShader(device, shader); ok(hr == D3D_OK, "IDirect3DDevice9_SetPixelShader returned %08x\n", hr); hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene returned %08x\n", hr); - if(SUCCEEDED(hr)) - { - hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_TEXCOORDSIZE4(0) | D3DFVF_TEX1); - ok(hr == D3D_OK, "IDirect3DDevice9_SetFVF returned %08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, vertex, 7 * sizeof(float)); - ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr); - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_EndScene returned %08x\n", hr); - } + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_TEXCOORDSIZE4(0) | D3DFVF_TEX1); + ok(SUCCEEDED(hr), "Failed to set FVF, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, vertex, 7 * sizeof(float)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + color = getPixelColor(device, 63, 46); ok(color == 0x0000ff00, "Pixel 63/46 has color %08x, expected 0x0000ff00\n", color); color = getPixelColor(device, 66, 46); @@ -4996,23 +5099,21 @@ hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffff00, 0.0, 0); ok(hr == D3D_OK, "IDirect3DDevice9_CreatePixelShader returned %08x\n", hr); - hr = IDirect3DDevice9_CreatePixelShader(device, shader_code_20, &shader); - if(FAILED(hr)) { - skip("Failed to create 2.0 test shader, most likely not supported\n"); - return; + if (FAILED(IDirect3DDevice9_CreatePixelShader(device, shader_code_20, &shader))) + { + skip("Failed to create 2.0 test shader, most likely not supported.\n"); + IDirect3DDevice9_Release(device); + goto done; } hr = IDirect3DDevice9_SetPixelShader(device, shader); ok(hr == D3D_OK, "IDirect3DDevice9_SetPixelShader returned %08x\n", hr); hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene returned %08x\n", hr); - if(SUCCEEDED(hr)) - { - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, vertex, 7 * sizeof(float)); - ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr); - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_EndScene returned %08x\n", hr); - } + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, vertex, 7 * sizeof(float)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); color = getPixelColor(device, 63, 46); ok(color == 0x00ffff00, "Pixel 63/46 has color %08x, expected 0x00ffff00\n", color); @@ -5053,21 +5154,28 @@ hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); ok(hr == D3D_OK, "IDirect3DDevice9_Present failed with %08x\n", hr); - /* Cleanup */ - hr = IDirect3DDevice9_SetPixelShader(device, NULL); - ok(SUCCEEDED(hr), "SetPixelShader failed (%08x)\n", hr); IDirect3DPixelShader9_Release(shader); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } -static void x8l8v8u8_test(IDirect3DDevice9 *device) +static void x8l8v8u8_test(void) { - IDirect3D9 *d3d9; - HRESULT hr; - IDirect3DTexture9 *texture; - IDirect3DPixelShader9 *shader; IDirect3DPixelShader9 *shader2; + IDirect3DPixelShader9 *shader; + IDirect3DTexture9 *texture; + IDirect3DDevice9 *device; D3DLOCKED_RECT lr; + IDirect3D9 *d3d; + ULONG refcount; + D3DCAPS9 caps; DWORD color; + HWND window; + HRESULT hr; + static const DWORD shader_code[] = { 0xffff0101, /* ps_1_1 */ @@ -5082,29 +5190,46 @@ 0x00000001, 0x800f0000, 0xb0ff0000, /* mov r0, t0.w */ 0x0000ffff /* end */ }; + static const float quad[] = + { + -1.0f, -1.0f, 0.1f, 0.5f, 0.5f, + -1.0f, 1.0f, 0.1f, 0.5f, 0.5f, + 1.0f, -1.0f, 0.1f, 0.5f, 0.5f, + 1.0f, 1.0f, 0.1f, 0.5f, 0.5f, + }; + + 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"); + goto done; + } - float quad[] = { - -1.0, -1.0, 0.1, 0.5, 0.5, - 1.0, -1.0, 0.1, 0.5, 0.5, - -1.0, 1.0, 0.1, 0.5, 0.5, - 1.0, 1.0, 0.1, 0.5, 0.5, - }; - - memset(&lr, 0, sizeof(lr)); - IDirect3DDevice9_GetDirect3D(device, &d3d9); - hr = IDirect3D9_CheckDeviceFormat(d3d9, 0, D3DDEVTYPE_HAL, D3DFMT_X8R8G8B8, - 0, D3DRTYPE_TEXTURE, D3DFMT_X8L8V8U8); - IDirect3D9_Release(d3d9); - if(FAILED(hr)) { - skip("No D3DFMT_X8L8V8U8 support\n"); - return; - }; + hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); + if (caps.PixelShaderVersion < D3DPS_VERSION(1, 1)) + { + skip("No ps_1_1 support, skipping tests.\n"); + IDirect3DDevice9_Release(device); + goto done; + } + if (FAILED(IDirect3D9_CheckDeviceFormat(d3d, 0, D3DDEVTYPE_HAL, + D3DFMT_X8R8G8B8, 0, D3DRTYPE_TEXTURE, D3DFMT_X8L8V8U8))) + { + skip("No D3DFMT_X8L8V8U8 support, skipping tests.\n"); + IDirect3DDevice9_Release(device); + goto done; + } - hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffff0000, 0.0, 0); + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xffff0000, 1.0f, 0); ok(hr == D3D_OK, "IDirect3DDevice9_Clear returned %08x\n", hr); hr = IDirect3DDevice9_CreateTexture(device, 1, 1, 1, 0, D3DFMT_X8L8V8U8, D3DPOOL_MANAGED, &texture, NULL); ok(hr == D3D_OK, "IDirect3DDevice9_CreateTexture failed (%08x)\n", hr); + memset(&lr, 0, sizeof(lr)); hr = IDirect3DTexture9_LockRect(texture, 0, &lr, NULL, 0); ok(hr == D3D_OK, "IDirect3DTexture9_LockRect failed (%08x)\n", hr); *((DWORD *) lr.pBits) = 0x11ca3141; @@ -5124,15 +5249,12 @@ ok(hr == D3D_OK, "IDirect3DDevice9_SetTexture failed (%08x)\n", hr); hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene failed (%08x)\n", hr); - if(SUCCEEDED(hr)) - { - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float)); - ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float)); + 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_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene failed (%08x)\n", hr); - } color = getPixelColor(device, 578, 430); ok(color_match(color, D3DCOLOR_ARGB(0x00, 0x82, 0x62, 0xca), 1), "D3DFMT_X8L8V8U8 = 0x112131ca returns color %08x, expected 0x008262ca\n", color); @@ -5142,54 +5264,71 @@ hr = IDirect3DDevice9_SetPixelShader(device, shader2); ok(hr == D3D_OK, "IDirect3DDevice9_SetPixelShader failed (%08x)\n", hr); hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene failed (%08x)\n", hr); - if(SUCCEEDED(hr)) - { - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float)); - ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float)); + 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_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene failed (%08x)\n", hr); - } color = getPixelColor(device, 578, 430); ok(color == 0x00ffffff, "w component of D3DFMT_X8L8V8U8 = 0x11ca3141 returns color %08x\n", color); hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); ok(hr == D3D_OK, "IDirect3DDevice9_Present failed with %08x\n", hr); - hr = IDirect3DDevice9_SetPixelShader(device, NULL); - ok(hr == D3D_OK, "IDirect3DDevice9_SetPixelShader failed (%08x)\n", hr); - hr = IDirect3DDevice9_SetTexture(device, 0, NULL); - ok(hr == D3D_OK, "IDirect3DDevice9_SetTexture failed (%08x)\n", hr); IDirect3DPixelShader9_Release(shader); IDirect3DPixelShader9_Release(shader2); IDirect3DTexture9_Release(texture); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } -static void autogen_mipmap_test(IDirect3DDevice9 *device) +static void autogen_mipmap_test(void) { - HRESULT hr; - IDirect3D9 *d3d; IDirect3DTexture9 *texture = NULL; IDirect3DSurface9 *surface; - DWORD color; - const RECT r1 = {256, 256, 512, 512}; - const RECT r2 = {512, 256, 768, 512}; - const RECT r3 = {256, 512, 512, 768}; - const RECT r4 = {512, 512, 768, 768}; + IDirect3DDevice9 *device; unsigned int x, y; D3DLOCKED_RECT lr; - memset(&lr, 0, sizeof(lr)); + IDirect3D9 *d3d; + D3DCOLOR color; + ULONG refcount; + HWND window; + HRESULT hr; - IDirect3DDevice9_GetDirect3D(device, &d3d); - if(IDirect3D9_CheckDeviceFormat(d3d, 0, D3DDEVTYPE_HAL, D3DFMT_X8R8G8B8, - D3DUSAGE_AUTOGENMIPMAP, D3DRTYPE_TEXTURE, D3DFMT_X8R8G8B8) != D3D_OK) { - skip("No autogenmipmap support\n"); - IDirect3D9_Release(d3d); - return; + static const RECT r1 = {256, 256, 512, 512}; + static const RECT r2 = {512, 256, 768, 512}; + static const RECT r3 = {256, 512, 512, 768}; + static const RECT r4 = {512, 512, 768, 768}; + static const float quad[] = + { + -0.5f, -0.5f, 0.1f, 0.0f, 0.0f, + -0.5f, 0.5f, 0.1f, 0.0f, 1.0f, + 0.5f, -0.5f, 0.1f, 1.0f, 0.0f, + 0.5f, 0.5f, 0.1f, 1.0f, 1.0f, + }; + + 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"); + goto done; } - IDirect3D9_Release(d3d); - hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffff00, 0.0, 0); + if (IDirect3D9_CheckDeviceFormat(d3d, 0, D3DDEVTYPE_HAL, + D3DFMT_X8R8G8B8, D3DUSAGE_AUTOGENMIPMAP, D3DRTYPE_TEXTURE, D3DFMT_X8R8G8B8) != D3D_OK) + { + skip("No autogenmipmap support.\n"); + IDirect3DDevice9_Release(device); + goto done; + } + + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xffffff00, 1.0f, 0); ok(hr == D3D_OK, "IDirect3DDevice9_Clear returned %08x\n", hr); /* Make the mipmap big, so that a smaller mipmap is used @@ -5200,6 +5339,7 @@ hr = IDirect3DTexture9_GetSurfaceLevel(texture, 0, &surface); ok(hr == D3D_OK, "IDirect3DTexture9_GetSurfaceLevel returned %08x\n", hr); + memset(&lr, 0, sizeof(lr)); hr = IDirect3DSurface9_LockRect(surface, &lr, NULL, 0); ok(hr == D3D_OK, "IDirect3DSurface9_LockRect returned %08x\n", hr); for(y = 0; y < 1024; y++) { @@ -5230,28 +5370,17 @@ ok(hr == D3D_OK, "IDirect3DDevice9_SetTexture returned %08x\n", hr); hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MIPFILTER, D3DTEXF_POINT); ok(hr == D3D_OK, "IDirect3DDevice9_SetSamplerState failed with %08x\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_LIGHTING, FALSE); + ok(SUCCEEDED(hr), "Failed to disable lighting, hr %#x.\n", hr); hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene returned %08x\n", hr); - if(SUCCEEDED(hr)) { - const float quad[] = { - -0.5, -0.5, 0.1, 0.0, 0.0, - -0.5, 0.5, 0.1, 0.0, 1.0, - 0.5, -0.5, 0.1, 1.0, 0.0, - 0.5, 0.5, 0.1, 1.0, 1.0 - }; - - hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_TEX1); - ok(hr == D3D_OK, "IDirect3DDevice9_SetFVF returned %08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float)); - ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr); - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_EndScene returned %08x\n", hr); - } - hr = IDirect3DDevice9_SetTexture(device, 0, NULL); - ok(hr == D3D_OK, "IDirect3DDevice9_SetTexture returned %08x\n", hr); - hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MIPFILTER, D3DTEXF_NONE); - ok(hr == D3D_OK, "IDirect3DDevice9_SetSamplerState failed with %08x\n", hr); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_TEX1); + ok(SUCCEEDED(hr), "Failed to set FVF, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float)); + 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); IDirect3DTexture9_Release(texture); color = getPixelColor(device, 200, 200); @@ -5272,14 +5401,26 @@ ok(color == 0x00ffffff, "pixel 440/200 has color %08x, expected 0x00ffffff\n", color); hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); ok(hr == D3D_OK, "IDirect3DDevice9_Present failed with %08x\n", hr); + + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } -static void test_constant_clamp_vs(IDirect3DDevice9 *device) +static void test_constant_clamp_vs(void) { IDirect3DVertexShader9 *shader_11, *shader_11_2, *shader_20, *shader_20_2; IDirect3DVertexDeclaration9 *decl; + IDirect3DDevice9 *device; + IDirect3D9 *d3d; + D3DCOLOR color; + ULONG refcount; + D3DCAPS9 caps; + HWND window; HRESULT hr; - DWORD color; + static const DWORD shader_code_11[] = { 0xfffe0101, /* vs_1_1 */ @@ -5320,38 +5461,62 @@ 0x02000001, 0xc00f0000, 0x90e40000, /* mov oPos, v0 */ 0x0000ffff /* end */ }; - static const D3DVERTEXELEMENT9 decl_elements[] = { + static const D3DVERTEXELEMENT9 decl_elements[] = + { {0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, D3DDECL_END() }; - float quad1[] = { - -1.0, -1.0, 0.1, - 0.0, -1.0, 0.1, - -1.0, 0.0, 0.1, - 0.0, 0.0, 0.1 - }; - float quad2[] = { - 0.0, -1.0, 0.1, - 1.0, -1.0, 0.1, - 0.0, 0.0, 0.1, - 1.0, 0.0, 0.1 + static const float quad1[] = + { + -1.0f, -1.0f, 0.1f, + -1.0f, 0.0f, 0.1f, + 0.0f, -1.0f, 0.1f, + 0.0f, 0.0f, 0.1f, }; - float quad3[] = { - 0.0, 0.0, 0.1, - 1.0, 0.0, 0.1, - 0.0, 1.0, 0.1, - 1.0, 1.0, 0.1 + static const float quad2[] = + { + 0.0f, -1.0f, 0.1f, + 0.0f, 0.0f, 0.1f, + 1.0f, -1.0f, 0.1f, + 1.0f, 0.0f, 0.1f, }; - float quad4[] = { - -1.0, 0.0, 0.1, - 0.0, 0.0, 0.1, - -1.0, 1.0, 0.1, - 0.0, 1.0, 0.1 + static const float quad3[] = + { + 0.0f, 0.0f, 0.1f, + 0.0f, 1.0f, 0.1f, + 1.0f, 0.0f, 0.1f, + 1.0f, 1.0f, 0.1f, }; - float test_data_c1[4] = { 1.25, -0.50, -1.50, 1.0}; - float test_data_c2[4] = { -0.50, 1.25, 2.00, 1.0}; + static const float quad4[] = + { + -1.0f, 0.0f, 0.1f, + -1.0f, 1.0f, 0.1f, + 0.0f, 0.0f, 0.1f, + 0.0f, 1.0f, 0.1f, + }; + static const float test_data_c1[4] = { 1.25f, -0.50f, -1.50f, 1.0f}; + static const float test_data_c2[4] = {-0.50f, 1.25f, 2.00f, 1.0f}; + + 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"); + goto done; + } - hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff00ffff, 0.0, 0); + hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); + if (caps.VertexShaderVersion < D3DVS_VERSION(1, 1)) + { + skip("No vs_1_1 support, skipping tests.\n"); + IDirect3DDevice9_Release(device); + goto done; + } + + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff00ffff, 1.0f, 0); ok(hr == D3D_OK, "IDirect3DDevice9_Clear returned %08x\n", hr); hr = IDirect3DDevice9_CreateVertexShader(device, shader_code_11, &shader_11); @@ -5373,41 +5538,36 @@ ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexDeclaration returned %08x\n", hr); hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene returned %08x\n", hr); - if(SUCCEEDED(hr)) - { - hr = IDirect3DDevice9_SetVertexShader(device, shader_11); - ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexShader returned %08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad1, 3 * sizeof(float)); - ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetVertexShader(device, shader_11_2); - ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexShader returned %08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad2, 3 * sizeof(float)); - ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr); + hr = IDirect3DDevice9_SetVertexShader(device, shader_11); + ok(SUCCEEDED(hr), "Failed to set vertex shader, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad1, 3 * sizeof(float)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - if(shader_20) { - hr = IDirect3DDevice9_SetVertexShader(device, shader_20); - ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexShader returned %08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad3, 3 * sizeof(float)); - ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr); - } + hr = IDirect3DDevice9_SetVertexShader(device, shader_11_2); + ok(SUCCEEDED(hr), "Failed to set vertex shader, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad2, 3 * sizeof(float)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - if(shader_20_2) { - hr = IDirect3DDevice9_SetVertexShader(device, shader_20_2); - ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexShader returned %08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad4, 3 * sizeof(float)); - ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr); - } + if (shader_20) + { + hr = IDirect3DDevice9_SetVertexShader(device, shader_20); + ok(SUCCEEDED(hr), "Failed to set vertex shader, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad3, 3 * sizeof(float)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + } - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_EndScene returned %08x\n", hr); + if (shader_20_2) + { + hr = IDirect3DDevice9_SetVertexShader(device, shader_20_2); + ok(SUCCEEDED(hr), "Failed to set vertex shader, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad4, 3 * sizeof(float)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); } - hr = IDirect3DDevice9_SetVertexShader(device, NULL); - ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexShader returned %08x\n", hr); - hr = IDirect3DDevice9_SetVertexDeclaration(device, NULL); - ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexDeclaration returned %08x\n", hr); + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); color = getPixelColor(device, 160, 360); ok(color_match(color, D3DCOLOR_ARGB(0x00, 0xbf, 0xbf, 0x80), 1), @@ -5433,13 +5593,24 @@ if(shader_20) IDirect3DVertexShader9_Release(shader_20); IDirect3DVertexShader9_Release(shader_11_2); IDirect3DVertexShader9_Release(shader_11); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } -static void constant_clamp_ps_test(IDirect3DDevice9 *device) +static void constant_clamp_ps_test(void) { IDirect3DPixelShader9 *shader_11, *shader_12, *shader_14, *shader_20; - HRESULT hr; + IDirect3DDevice9 *device; + IDirect3D9 *d3d; + ULONG refcount; + D3DCAPS9 caps; DWORD color; + HWND window; + HRESULT hr; + static const DWORD shader_code_11[] = { 0xffff0101, /* ps_1_1 */ @@ -5476,34 +5647,57 @@ 0x02000001, 0x800f0800, 0x80e40000, /* mov oC0, r0 */ 0x0000ffff /* end */ }; - float quad1[] = { - -1.0, -1.0, 0.1, - 0.0, -1.0, 0.1, - -1.0, 0.0, 0.1, - 0.0, 0.0, 0.1 - }; - float quad2[] = { - 0.0, -1.0, 0.1, - 1.0, -1.0, 0.1, - 0.0, 0.0, 0.1, - 1.0, 0.0, 0.1 + static const float quad1[] = + { + -1.0f, -1.0f, 0.1f, + -1.0f, 0.0f, 0.1f, + 0.0f, -1.0f, 0.1f, + 0.0f, 0.0f, 0.1f, }; - float quad3[] = { - 0.0, 0.0, 0.1, - 1.0, 0.0, 0.1, - 0.0, 1.0, 0.1, - 1.0, 1.0, 0.1 + static const float quad2[] = + { + 0.0f, -1.0f, 0.1f, + 0.0f, 0.0f, 0.1f, + 1.0f, -1.0f, 0.1f, + 1.0f, 0.0f, 0.1f, }; - float quad4[] = { - -1.0, 0.0, 0.1, - 0.0, 0.0, 0.1, - -1.0, 1.0, 0.1, - 0.0, 1.0, 0.1 + static const float quad3[] = + { + 0.0f, 0.0f, 0.1f, + 0.0f, 1.0f, 0.1f, + 1.0f, 0.0f, 0.1f, + 1.0f, 1.0f, 0.1f, }; - float test_data_c1[4] = { 1.25, -0.50, -1.50, 1.0}; - float test_data_c2[4] = { -0.50, 1.25, 2.00, 1.0}; + static const float quad4[] = + { + -1.0f, 0.0f, 0.1f, + -1.0f, 1.0f, 0.1f, + 0.0f, 0.0f, 0.1f, + 0.0f, 1.0f, 0.1f, + }; + static const float test_data_c1[4] = { 1.25f, -0.50f, -1.50f, 1.0f}; + static const float test_data_c2[4] = {-0.50f, 1.25f, 2.00f, 1.0f}; + + 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"); + goto done; + } - hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff00ffff, 0.0, 0); + hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); + if (caps.PixelShaderVersion < D3DPS_VERSION(1, 4)) + { + skip("No ps_1_4 support, skipping tests.\n"); + IDirect3DDevice9_Release(device); + goto done; + } + + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff00ffff, 1.0f, 0); ok(hr == D3D_OK, "IDirect3DDevice9_Clear returned %08x\n", hr); hr = IDirect3DDevice9_CreatePixelShader(device, shader_code_11, &shader_11); @@ -5523,36 +5717,33 @@ ok(hr == D3D_OK, "IDirect3DDevice9_SetFVF returned %08x\n", hr); hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene returned %08x\n", hr); - if(SUCCEEDED(hr)) - { - hr = IDirect3DDevice9_SetPixelShader(device, shader_11); - ok(hr == D3D_OK, "IDirect3DDevice9_SetPixelShader returned %08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad1, 3 * sizeof(float)); - ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetPixelShader(device, shader_12); - ok(hr == D3D_OK, "IDirect3DDevice9_SetPixelShader returned %08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad2, 3 * sizeof(float)); - ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr); + hr = IDirect3DDevice9_SetPixelShader(device, shader_11); + ok(SUCCEEDED(hr), "Failed to set pixel shader, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad1, 3 * sizeof(float)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetPixelShader(device, shader_14); - ok(hr == D3D_OK, "IDirect3DDevice9_SetPixelShader returned %08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad3, 3 * sizeof(float)); - ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr); + hr = IDirect3DDevice9_SetPixelShader(device, shader_12); + ok(SUCCEEDED(hr), "Failed to set pixel shader, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad2, 3 * sizeof(float)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - if(shader_20) { - hr = IDirect3DDevice9_SetPixelShader(device, shader_20); - ok(hr == D3D_OK, "IDirect3DDevice9_SetPixelShader returned %08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad4, 3 * sizeof(float)); - ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr); - } + hr = IDirect3DDevice9_SetPixelShader(device, shader_14); + ok(SUCCEEDED(hr), "Failed to set pixel shader, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad3, 3 * sizeof(float)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_EndScene returned %08x\n", hr); + if (shader_20) + { + hr = IDirect3DDevice9_SetPixelShader(device, shader_20); + ok(SUCCEEDED(hr), "Failed to set pixel shader, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad4, 3 * sizeof(float)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); } - hr = IDirect3DDevice9_SetPixelShader(device, NULL); - ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexShader returned %08x\n", hr); + + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); color = getPixelColor(device, 160, 360); ok(color_match(color, D3DCOLOR_ARGB(0x00, 0x80, 0x80, 0x00), 1), @@ -5575,14 +5766,24 @@ IDirect3DPixelShader9_Release(shader_14); IDirect3DPixelShader9_Release(shader_12); IDirect3DPixelShader9_Release(shader_11); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } -static void dp2add_ps_test(IDirect3DDevice9 *device) +static void dp2add_ps_test(void) { - IDirect3DPixelShader9 *shader_dp2add = NULL; - IDirect3DPixelShader9 *shader_dp2add_sat = NULL; - HRESULT hr; + IDirect3DPixelShader9 *shader_dp2add_sat; + IDirect3DPixelShader9 *shader_dp2add; + IDirect3DDevice9 *device; + IDirect3D9 *d3d; + ULONG refcount; + D3DCAPS9 caps; DWORD color; + HWND window; + HRESULT hr; /* DP2ADD is defined as: (src0.r * src1.r) + (src0.g * src1.g) + src2. * One D3D restriction of all shader instructions except SINCOS is that no more than 2 @@ -5619,94 +5820,97 @@ 0x02000001, 0x800f0800, 0x80e40000, /* mov oC0, r0 */ 0x0000ffff /* end */ }; + static const float 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, + }; + + 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"); + goto done; + } - const float quad[] = { - -1.0, -1.0, 0.1, - 1.0, -1.0, 0.1, - -1.0, 1.0, 0.1, - 1.0, 1.0, 0.1 - }; - + hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); + if (caps.PixelShaderVersion < D3DPS_VERSION(2, 0)) + { + skip("No ps_2_0 support, skipping tests.\n"); + IDirect3DDevice9_Release(device); + goto done; + } - hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff000000, 0.0, 0); + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff000000, 1.0f, 0); ok(hr == D3D_OK, "IDirect3DDevice9_Clear returned %08x\n", hr); hr = IDirect3DDevice9_CreatePixelShader(device, shader_code_dp2add, &shader_dp2add); ok(hr == D3D_OK, "IDirect3DDevice9_CreatePixelShader returned %08x\n", hr); - hr = IDirect3DDevice9_CreatePixelShader(device, shader_code_dp2add_sat, &shader_dp2add_sat); - ok(hr == D3D_OK, "IDirect3DDevice9_CreatePixelShader returned %08x\n", hr); - - hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ); - ok(hr == D3D_OK, "IDirect3DDevice9_SetFVF returned %08x\n", hr); - - if (shader_dp2add) { - - hr = IDirect3DDevice9_SetPixelShader(device, shader_dp2add); - ok(hr == D3D_OK, "IDirect3DDevice9_SetPixelShader returned %08x\n", hr); - - hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene returned %08x\n", hr); - if(SUCCEEDED(hr)) - { - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 3 * sizeof(float)); - ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr); - - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_EndScene returned %08x\n", hr); - } - - color = getPixelColor(device, 360, 240); - ok(color_match(color, D3DCOLOR_ARGB(0x00, 0x7f, 0x7f, 0x7f), 1), - "dp2add pixel has color %08x, expected ~0x007f7f7f\n", color); - - hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); - ok(hr == D3D_OK, "IDirect3DDevice9_Present failed with %08x\n", hr); - - IDirect3DPixelShader9_Release(shader_dp2add); - } else { - skip("dp2add shader creation failed\n"); - } + hr = IDirect3DDevice9_CreatePixelShader(device, shader_code_dp2add_sat, &shader_dp2add_sat); + ok(hr == D3D_OK, "IDirect3DDevice9_CreatePixelShader returned %08x\n", hr); - if (shader_dp2add_sat) { + hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ); + ok(hr == D3D_OK, "IDirect3DDevice9_SetFVF returned %08x\n", hr); - hr = IDirect3DDevice9_SetPixelShader(device, shader_dp2add_sat); - ok(hr == D3D_OK, "IDirect3DDevice9_SetPixelShader returned %08x\n", hr); + hr = IDirect3DDevice9_SetPixelShader(device, shader_dp2add); + ok(SUCCEEDED(hr), "Failed to create pixel shader, 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, 3 * sizeof(float)); + ok(SUCCEEDED(hr), "Failed to draw primitive, hr %#x.\n", hr); + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); - hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene returned %08x\n", hr); - if(SUCCEEDED(hr)) - { - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 3 * sizeof(float)); - ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr); + color = getPixelColor(device, 360, 240); + ok(color_match(color, D3DCOLOR_ARGB(0x00, 0x7f, 0x7f, 0x7f), 1), "Got unexpected color 0x%08x.\n", color); - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_EndScene returned %08x\n", hr); - } + hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); + ok(SUCCEEDED(hr), "Failed to present frame, hr %#x.\n", hr); + IDirect3DPixelShader9_Release(shader_dp2add); - color = getPixelColor(device, 360, 240); - ok(color_match(color, D3DCOLOR_ARGB(0x00, 0x7f, 0x7f, 0x7f), 1), - "dp2add pixel has color %08x, expected ~0x007f7f7f\n", color); + hr = IDirect3DDevice9_SetPixelShader(device, shader_dp2add_sat); + ok(SUCCEEDED(hr), "Failed to create pixel shader, 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, 3 * sizeof(float)); + ok(SUCCEEDED(hr), "Failed to draw primitive, hr %#x.\n", hr); + 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); + color = getPixelColor(device, 360, 240); + ok(color_match(color, D3DCOLOR_ARGB(0x00, 0x7f, 0x7f, 0x7f), 1), "Got unexpected color 0x%08x.\n", color); - IDirect3DPixelShader9_Release(shader_dp2add_sat); - } else { - skip("dp2add shader creation failed\n"); - } + hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); + ok(SUCCEEDED(hr), "Failed to present frame, hr %#x.\n", hr); + IDirect3DPixelShader9_Release(shader_dp2add_sat); - hr = IDirect3DDevice9_SetPixelShader(device, NULL); - ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexShader returned %08x\n", hr); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } -static void cnd_test(IDirect3DDevice9 *device) +static void cnd_test(void) { - IDirect3DPixelShader9 *shader_11, *shader_12, *shader_13, *shader_14; - IDirect3DPixelShader9 *shader_11_coissue, *shader_12_coissue, *shader_13_coissue, *shader_14_coissue; IDirect3DPixelShader9 *shader_11_coissue_2, *shader_12_coissue_2, *shader_13_coissue_2, *shader_14_coissue_2; - HRESULT hr; + IDirect3DPixelShader9 *shader_11_coissue, *shader_12_coissue, *shader_13_coissue, *shader_14_coissue; + IDirect3DPixelShader9 *shader_11, *shader_12, *shader_13, *shader_14; + IDirect3DDevice9 *device; + IDirect3D9 *d3d; + ULONG refcount; + D3DCAPS9 caps; + HWND window; DWORD color; + HRESULT hr; + /* ps 1.x shaders are rather picky with writemasks and source swizzles. * The dp3 is used to copy r0.r to all components of r1, then copy r1.a to * r0.a. Essentially it does a mov r0.a, r0.r, which isn't allowed as-is @@ -5879,36 +6083,59 @@ 0x00000001, 0x80080000, 0xa0ff0000, /* mov r0.a, c0.a */ 0x0000ffff /* end */ }; - float quad1[] = { - -1.0, -1.0, 0.1, 0.0, 0.0, 1.0, - 0.0, -1.0, 0.1, 1.0, 0.0, 1.0, - -1.0, 0.0, 0.1, 0.0, 1.0, 0.0, - 0.0, 0.0, 0.1, 1.0, 1.0, 0.0 - }; - float quad2[] = { - 0.0, -1.0, 0.1, 0.0, 0.0, 1.0, - 1.0, -1.0, 0.1, 1.0, 0.0, 1.0, - 0.0, 0.0, 0.1, 0.0, 1.0, 0.0, - 1.0, 0.0, 0.1, 1.0, 1.0, 0.0 - }; - float quad3[] = { - 0.0, 0.0, 0.1, 0.0, 0.0, 1.0, - 1.0, 0.0, 0.1, 1.0, 0.0, 1.0, - 0.0, 1.0, 0.1, 0.0, 1.0, 0.0, - 1.0, 1.0, 0.1, 1.0, 1.0, 0.0 - }; - float quad4[] = { - -1.0, 0.0, 0.1, 0.0, 0.0, 1.0, - 0.0, 0.0, 0.1, 1.0, 0.0, 1.0, - -1.0, 1.0, 0.1, 0.0, 1.0, 0.0, - 0.0, 1.0, 0.1, 1.0, 1.0, 0.0 - }; - float test_data_c1[4] = { 0.0, 0.0, 0.0, 0.0}; - float test_data_c2[4] = { 1.0, 1.0, 1.0, 1.0}; - float test_data_c1_coi[4] = { 0.0, 1.0, 0.0, 0.0}; - float test_data_c2_coi[4] = { 1.0, 0.0, 1.0, 1.0}; + static const float quad1[] = + { + -1.0f, -1.0f, 0.1f, 0.0f, 0.0f, 1.0f, + -1.0f, 0.0f, 0.1f, 0.0f, 1.0f, 0.0f, + 0.0f, -1.0f, 0.1f, 1.0f, 0.0f, 1.0f, + 0.0f, 0.0f, 0.1f, 1.0f, 1.0f, 0.0f, + }; + static const float quad2[] = + { + 0.0f, -1.0f, 0.1f, 0.0f, 0.0f, 1.0f, + 0.0f, 0.0f, 0.1f, 0.0f, 1.0f, 0.0f, + 1.0f, -1.0f, 0.1f, 1.0f, 0.0f, 1.0f, + 1.0f, 0.0f, 0.1f, 1.0f, 1.0f, 0.0f, + }; + static const float quad3[] = + { + 0.0f, 0.0f, 0.1f, 0.0f, 0.0f, 1.0f, + 0.0f, 1.0f, 0.1f, 0.0f, 1.0f, 0.0f, + 1.0f, 0.0f, 0.1f, 1.0f, 0.0f, 1.0f, + 1.0f, 1.0f, 0.1f, 1.0f, 1.0f, 0.0f, + }; + static const float quad4[] = + { + -1.0f, 0.0f, 0.1f, 0.0f, 0.0f, 1.0f, + -1.0f, 1.0f, 0.1f, 0.0f, 1.0f, 0.0f, + 0.0f, 0.0f, 0.1f, 1.0f, 0.0f, 1.0f, + 0.0f, 1.0f, 0.1f, 1.0f, 1.0f, 0.0f, + }; + static const float test_data_c1[4] = {0.0f, 0.0f, 0.0f, 0.0f}; + static const float test_data_c2[4] = {1.0f, 1.0f, 1.0f, 1.0f}; + static const float test_data_c1_coi[4] = {0.0f, 1.0f, 0.0f, 0.0f}; + static const float test_data_c2_coi[4] = {1.0f, 0.0f, 1.0f, 1.0f}; + + 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"); + goto done; + } - hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff00ffff, 0.0, 0); + hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); + if (caps.PixelShaderVersion < D3DPS_VERSION(1, 4)) + { + skip("No ps_1_4 support, skipping tests.\n"); + IDirect3DDevice9_Release(device); + goto done; + } + + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff00ffff, 1.0f, 0); ok(hr == D3D_OK, "IDirect3DDevice9_Clear returned %08x\n", hr); hr = IDirect3DDevice9_CreatePixelShader(device, shader_code_11, &shader_11); @@ -5944,32 +6171,30 @@ ok(hr == D3D_OK, "IDirect3DDevice9_SetFVF returned %08x\n", hr); hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene returned %08x\n", hr); - if(SUCCEEDED(hr)) - { - hr = IDirect3DDevice9_SetPixelShader(device, shader_11); - ok(hr == D3D_OK, "IDirect3DDevice9_SetPixelShader returned %08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad1, 6 * sizeof(float)); - ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetPixelShader(device, shader_12); - ok(hr == D3D_OK, "IDirect3DDevice9_SetPixelShader returned %08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad2, 6 * sizeof(float)); - ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr); + hr = IDirect3DDevice9_SetPixelShader(device, shader_11); + ok(SUCCEEDED(hr), "Failed to set pixel shader, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad1, 6 * sizeof(float)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetPixelShader(device, shader_13); - ok(hr == D3D_OK, "IDirect3DDevice9_SetPixelShader returned %08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad3, 6 * sizeof(float)); - ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr); + hr = IDirect3DDevice9_SetPixelShader(device, shader_12); + ok(SUCCEEDED(hr), "Failed to set pixel shader, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad2, 6 * sizeof(float)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetPixelShader(device, shader_14); - ok(hr == D3D_OK, "IDirect3DDevice9_SetPixelShader returned %08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad4, 6 * sizeof(float)); - ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr); + hr = IDirect3DDevice9_SetPixelShader(device, shader_13); + ok(SUCCEEDED(hr), "Failed to set pixel shader, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad3, 6 * sizeof(float)); + ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr); - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_EndScene returned %08x\n", hr); - } + hr = IDirect3DDevice9_SetPixelShader(device, shader_14); + ok(SUCCEEDED(hr), "Failed to set pixel shader, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad4, 6 * sizeof(float)); + 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_SetPixelShader(device, NULL); ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexShader returned %08x\n", hr); @@ -6025,32 +6250,30 @@ ok(hr == D3D_OK, "IDirect3DDevice9_SetPixelShaderConstantF returned %08x\n", hr); hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene returned %08x\n", hr); - if(SUCCEEDED(hr)) - { - hr = IDirect3DDevice9_SetPixelShader(device, shader_11_coissue); - ok(hr == D3D_OK, "IDirect3DDevice9_SetPixelShader returned %08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad1, 6 * sizeof(float)); - ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetPixelShader(device, shader_12_coissue); - ok(hr == D3D_OK, "IDirect3DDevice9_SetPixelShader returned %08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad2, 6 * sizeof(float)); - ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr); + hr = IDirect3DDevice9_SetPixelShader(device, shader_11_coissue); + ok(SUCCEEDED(hr), "Failed to set pixel shader, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad1, 6 * sizeof(float)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetPixelShader(device, shader_13_coissue); - ok(hr == D3D_OK, "IDirect3DDevice9_SetPixelShader returned %08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad3, 6 * sizeof(float)); - ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr); + hr = IDirect3DDevice9_SetPixelShader(device, shader_12_coissue); + ok(SUCCEEDED(hr), "Failed to set pixel shader, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad2, 6 * sizeof(float)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetPixelShader(device, shader_14_coissue); - ok(hr == D3D_OK, "IDirect3DDevice9_SetPixelShader returned %08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad4, 6 * sizeof(float)); - ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr); + hr = IDirect3DDevice9_SetPixelShader(device, shader_13_coissue); + ok(SUCCEEDED(hr), "Failed to set pixel shader, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad3, 6 * sizeof(float)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_EndScene returned %08x\n", hr); - } + hr = IDirect3DDevice9_SetPixelShader(device, shader_14_coissue); + ok(SUCCEEDED(hr), "Failed to set pixel shader, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad4, 6 * sizeof(float)); + 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_SetPixelShader(device, NULL); ok(hr == D3D_OK, "IDirect3DDevice9_SetPixelShader returned %08x\n", hr); @@ -6114,40 +6337,37 @@ hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); ok(hr == D3D_OK, "IDirect3DDevice9_Present failed with %08x\n", hr); - /* Retest with the coissue flag on the alpha instruction instead. This works "as expected". */ + /* Retest with the coissue flag on the alpha instruction instead. This + * works "as expected". The Windows 8 testbot (WARP) seems to handle this + * the same as coissue on .rgb. */ hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff00ffff, 0.0, 0); ok(hr == D3D_OK, "IDirect3DDevice9_Clear returned %08x\n", hr); hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene returned %08x\n", hr); - if(SUCCEEDED(hr)) - { - hr = IDirect3DDevice9_SetPixelShader(device, shader_11_coissue_2); - ok(hr == D3D_OK, "IDirect3DDevice9_SetPixelShader returned %08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad1, 6 * sizeof(float)); - ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetPixelShader(device, shader_12_coissue_2); - ok(hr == D3D_OK, "IDirect3DDevice9_SetPixelShader returned %08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad2, 6 * sizeof(float)); - ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr); + hr = IDirect3DDevice9_SetPixelShader(device, shader_11_coissue_2); + ok(SUCCEEDED(hr), "Failed to set pixel shader, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad1, 6 * sizeof(float)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetPixelShader(device, shader_13_coissue_2); - ok(hr == D3D_OK, "IDirect3DDevice9_SetPixelShader returned %08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad3, 6 * sizeof(float)); - ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr); + hr = IDirect3DDevice9_SetPixelShader(device, shader_12_coissue_2); + ok(SUCCEEDED(hr), "Failed to set pixel shader, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad2, 6 * sizeof(float)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetPixelShader(device, shader_14_coissue_2); - ok(hr == D3D_OK, "IDirect3DDevice9_SetPixelShader returned %08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad4, 6 * sizeof(float)); - ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr); + hr = IDirect3DDevice9_SetPixelShader(device, shader_13_coissue_2); + ok(SUCCEEDED(hr), "Failed to set pixel shader, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad3, 6 * sizeof(float)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_EndScene returned %08x\n", hr); - } + hr = IDirect3DDevice9_SetPixelShader(device, shader_14_coissue_2); + ok(SUCCEEDED(hr), "Failed to set pixel shader, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad4, 6 * sizeof(float)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetPixelShader(device, NULL); - ok(hr == D3D_OK, "IDirect3DDevice9_SetPixelShader returned %08x\n", hr); + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); /* 1.4 shader */ color = getPixelColor(device, 158, 118); @@ -6161,13 +6381,13 @@ /* 1.1 shader */ color = getPixelColor(device, 238, 358); - ok(color_match(color, 0x00ffffff, 1), + ok(color_match(color, 0x00ffffff, 1) || broken(color_match(color, 0x00000000, 1)), "pixel 238, 358 has color %08x, expected 0x00ffffff\n", color); color = getPixelColor(device, 242, 358); ok(color_match(color, 0x00000000, 1), "pixel 242, 358 has color %08x, expected 0x00000000\n", color); color = getPixelColor(device, 238, 362); - ok(color_match(color, 0x00ffffff, 1), + ok(color_match(color, 0x00ffffff, 1) || broken(color_match(color, 0x00000000, 1)), "pixel 238, 362 has color %08x, expected 0x00ffffff\n", color); color = getPixelColor(device, 242, 362); ok(color_match(color, 0x00000000, 1), @@ -6175,13 +6395,13 @@ /* 1.2 shader */ color = getPixelColor(device, 558, 358); - ok(color_match(color, 0x00ffffff, 1), + ok(color_match(color, 0x00ffffff, 1) || broken(color_match(color, 0x00000000, 1)), "pixel 558, 358 has color %08x, expected 0x00ffffff\n", color); color = getPixelColor(device, 562, 358); ok(color_match(color, 0x00000000, 1), "pixel 562, 358 has color %08x, expected 0x00000000\n", color); color = getPixelColor(device, 558, 362); - ok(color_match(color, 0x00ffffff, 1), + ok(color_match(color, 0x00ffffff, 1) || broken(color_match(color, 0x00000000, 1)), "pixel 558, 362 has color %08x, expected 0x00ffffff\n", color); color = getPixelColor(device, 562, 362); ok(color_match(color, 0x00000000, 1), @@ -6189,13 +6409,13 @@ /* 1.3 shader */ color = getPixelColor(device, 558, 118); - ok(color_match(color, 0x00ffffff, 1), + ok(color_match(color, 0x00ffffff, 1) || broken(color_match(color, 0x00000000, 1)), "pixel 558, 118 has color %08x, expected 0x00ffffff\n", color); color = getPixelColor(device, 562, 118); ok(color_match(color, 0x00000000, 1), "pixel 562, 118 has color %08x, expected 0x00000000\n", color); color = getPixelColor(device, 558, 122); - ok(color_match(color, 0x00ffffff, 1), + ok(color_match(color, 0x00ffffff, 1) || broken(color_match(color, 0x00000000, 1)), "pixel 558, 122 has color %08x, expected 0x00ffffff\n", color); color = getPixelColor(device, 562, 122); ok(color_match(color, 0x00000000, 1), @@ -6216,10 +6436,25 @@ IDirect3DPixelShader9_Release(shader_13); IDirect3DPixelShader9_Release(shader_12); IDirect3DPixelShader9_Release(shader_11); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } -static void nested_loop_test(IDirect3DDevice9 *device) +static void nested_loop_test(void) { + IDirect3DVertexShader9 *vshader; + IDirect3DPixelShader9 *shader; + IDirect3DDevice9 *device; + IDirect3D9 *d3d; + ULONG refcount; + D3DCAPS9 caps; + DWORD color; + HWND window; + HRESULT hr; + static const DWORD shader_code[] = { 0xffff0300, /* ps_3_0 */ @@ -6243,16 +6478,32 @@ 0x02000001, 0xe00f0000, 0x90e40000, /* mov o0, v0 */ 0x0000ffff /* end */ }; - IDirect3DPixelShader9 *shader; - IDirect3DVertexShader9 *vshader; - HRESULT hr; - DWORD color; - const float quad[] = { - -1.0, -1.0, 0.1, - 1.0, -1.0, 0.1, - -1.0, 1.0, 0.1, - 1.0, 1.0, 0.1 - }; + static const float 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, + }; + + 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"); + goto done; + } + + hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); + if (caps.PixelShaderVersion < D3DPS_VERSION(3, 0) || caps.VertexShaderVersion < D3DVS_VERSION(3, 0)) + { + skip("No shader model 3 support, skipping tests.\n"); + IDirect3DDevice9_Release(device); + goto done; + } hr = IDirect3DDevice9_CreatePixelShader(device, shader_code, &shader); ok(hr == D3D_OK, "IDirect3DDevice9_CreatePixelShader failed with %08x\n", hr); @@ -6264,18 +6515,15 @@ ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexShader failed with %08x\n", hr); hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ); ok(hr == D3D_OK, "IDirect3DDevice9_SetFVF failed with %08x\n", hr); - hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0x0000ff00, 0.0, 0); + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0x0000ff00, 1.0f, 0); ok(hr == D3D_OK, "IDirect3DDevice9_Clear returned %08x\n", hr); hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene returned %08x\n", hr); - if(SUCCEEDED(hr)) - { - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 3 * sizeof(float)); - ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr); - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_EndScene returned %08x\n", hr); - } + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 3 * sizeof(float)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); color = getPixelColor(device, 360, 240); ok(color_match(color, 0x00800000, 1), @@ -6284,15 +6532,16 @@ hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); ok(hr == D3D_OK, "IDirect3DDevice9_Present failed with %08x\n", hr); - hr = IDirect3DDevice9_SetPixelShader(device, NULL); - ok(hr == D3D_OK, "IDirect3DDevice9_SetPixelShader failed with %08x\n", hr); - hr = IDirect3DDevice9_SetVertexShader(device, NULL); - ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexShader failed with %08x\n", hr); IDirect3DPixelShader9_Release(shader); IDirect3DVertexShader9_Release(vshader); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } -static void pretransformed_varying_test(IDirect3DDevice9 *device) +static void pretransformed_varying_test(void) { /* dcl_position: fails to compile */ static const DWORD blendweight_code[] = @@ -6476,9 +6725,33 @@ }, }; IDirect3DVertexDeclaration9 *decl; - HRESULT hr; + IDirect3DDevice9 *device; + IDirect3D9 *d3d; unsigned int i; + ULONG refcount; + D3DCAPS9 caps; DWORD color; + HWND window; + HRESULT hr; + + 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"); + goto done; + } + + hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); + if (caps.PixelShaderVersion < D3DPS_VERSION(3, 0) || caps.VertexShaderVersion < D3DVS_VERSION(3, 0)) + { + skip("No shader model 3 support, skipping tests.\n"); + IDirect3DDevice9_Release(device); + goto done; + } hr = IDirect3DDevice9_CreateVertexDeclaration(device, decl_elements, &decl); ok(hr == D3D_OK, "IDirect3DDevice9_CreateVertexDeclaration returned %08x\n", hr); @@ -6491,7 +6764,7 @@ { IDirect3DPixelShader9 *shader; - hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffffff, 0.0, 0); + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xffffffff, 1.0f, 0); ok(hr == D3D_OK, "IDirect3DDevice9_Clear returned %08x\n", hr); hr = IDirect3DDevice9_CreatePixelShader(device, tests[i].shader_code, &shader); @@ -6501,14 +6774,11 @@ ok(hr == D3D_OK, "IDirect3DDevice9_SetPixelShader returned %08x\n", hr); hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene returned %08x\n", hr); - if(SUCCEEDED(hr)) - { - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, data, sizeof(*data)); - ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr); - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_EndScene returned %08x\n", hr); - } + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, data, sizeof(*data)); + 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); /* This isn't a weekend's job to fix, ignore the problem for now. * Needs a replacement pipeline. */ @@ -6533,10 +6803,27 @@ } IDirect3DVertexDeclaration9_Release(decl); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } -static void test_compare_instructions(IDirect3DDevice9 *device) +static void test_compare_instructions(void) { + IDirect3DVertexShader9 *shader_slt_scalar; + IDirect3DVertexShader9 *shader_sge_scalar; + IDirect3DVertexShader9 *shader_slt_vec; + IDirect3DVertexShader9 *shader_sge_vec; + IDirect3DDevice9 *device; + IDirect3D9 *d3d; + D3DCOLOR color; + ULONG refcount; + D3DCAPS9 caps; + HWND window; + HRESULT hr; + static const DWORD shader_sge_vec_code[] = { 0xfffe0101, /* vs_1_1 */ @@ -6577,39 +6864,57 @@ 0x0000000c, 0xd0040000, 0x80aa0000, 0xa0550001, /* slt oD0.b, r0.b, c1.g */ 0x0000ffff /* end */ }; - IDirect3DVertexShader9 *shader_sge_vec; - IDirect3DVertexShader9 *shader_slt_vec; - IDirect3DVertexShader9 *shader_sge_scalar; - IDirect3DVertexShader9 *shader_slt_scalar; - HRESULT hr, color; - float quad1[] = { - -1.0, -1.0, 0.1, - 0.0, -1.0, 0.1, - -1.0, 0.0, 0.1, - 0.0, 0.0, 0.1 - }; - float quad2[] = { - 0.0, -1.0, 0.1, - 1.0, -1.0, 0.1, - 0.0, 0.0, 0.1, - 1.0, 0.0, 0.1 + static const float quad1[] = + { + -1.0f, -1.0f, 0.1f, + -1.0f, 0.0f, 0.1f, + 0.0f, -1.0f, 0.1f, + 0.0f, 0.0f, 0.1f, }; - float quad3[] = { - -1.0, 0.0, 0.1, - 0.0, 0.0, 0.1, - -1.0, 1.0, 0.1, - 0.0, 1.0, 0.1 + static const float quad2[] = + { + 0.0f, -1.0f, 0.1f, + 0.0f, 0.0f, 0.1f, + 1.0f, -1.0f, 0.1f, + 1.0f, 0.0f, 0.1f, }; - float quad4[] = { - 0.0, 0.0, 0.1, - 1.0, 0.0, 0.1, - 0.0, 1.0, 0.1, - 1.0, 1.0, 0.1 + static const float quad3[] = + { + -1.0f, 0.0f, 0.1f, + -1.0f, 1.0f, 0.1f, + 0.0f, 0.0f, 0.1f, + 0.0f, 1.0f, 0.1f, }; - const float const0[4] = {0.8, 0.2, 0.2, 0.2}; - const float const1[4] = {0.2, 0.8, 0.2, 0.2}; + static const float quad4[] = + { + 0.0f, 0.0f, 0.1f, + 0.0f, 1.0f, 0.1f, + 1.0f, 0.0f, 0.1f, + 1.0f, 1.0f, 0.1f, + }; + static const float const0[4] = {0.8f, 0.2f, 0.2f, 0.2f}; + static const float const1[4] = {0.2f, 0.8f, 0.2f, 0.2f}; + + 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"); + goto done; + } - hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffffff, 0.0, 0); + hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); + if (caps.VertexShaderVersion < D3DVS_VERSION(1, 1)) + { + skip("No vs_1_1 support, skipping tests.\n"); + IDirect3DDevice9_Release(device); + goto done; + } + + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xffffffff, 1.0f, 0); ok(SUCCEEDED(hr), "IDirect3DDevice9_Clear returned %#x.\n", hr); hr = IDirect3DDevice9_CreateVertexShader(device, shader_sge_vec_code, &shader_sge_vec); @@ -6628,38 +6933,33 @@ ok(SUCCEEDED(hr), "IDirect3DDevice9_SetFVF failed (%08x)\n", hr); hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene returned %08x\n", hr); - if(SUCCEEDED(hr)) - { - hr = IDirect3DDevice9_SetVertexShader(device, shader_sge_vec); - ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexShader returned %08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad1, sizeof(float) * 3); - ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetVertexShader(device, shader_slt_vec); - ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexShader returned %08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad2, sizeof(float) * 3); - ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr); + hr = IDirect3DDevice9_SetVertexShader(device, shader_sge_vec); + ok(SUCCEEDED(hr), "Failed to set vertex shader, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad1, sizeof(float) * 3); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetVertexShader(device, shader_sge_scalar); - ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexShader returned %08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad3, sizeof(float) * 3); - ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr); + hr = IDirect3DDevice9_SetVertexShader(device, shader_slt_vec); + ok(SUCCEEDED(hr), "Failed to set vertex shader, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad2, sizeof(float) * 3); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetVertexShaderConstantF(device, 0, const0, 1); - ok(SUCCEEDED(hr), "SetVertexShaderConstantF failed (%08x)\n", hr); + hr = IDirect3DDevice9_SetVertexShader(device, shader_sge_scalar); + ok(SUCCEEDED(hr), "Failed to set vertex shader, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad3, sizeof(float) * 3); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetVertexShader(device, shader_slt_scalar); - ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexShader returned %08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad4, sizeof(float) * 3); - ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr); + hr = IDirect3DDevice9_SetVertexShaderConstantF(device, 0, const0, 1); + ok(SUCCEEDED(hr), "Failed to set vertex shader constant, hr %#x.\n", hr); - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_EndScene returned %08x\n", hr); - } + hr = IDirect3DDevice9_SetVertexShader(device, shader_slt_scalar); + ok(SUCCEEDED(hr), "Failed to set vertex shader, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad4, sizeof(float) * 3); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetVertexShader(device, NULL); - ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexShader returned %08x\n", hr); + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); color = getPixelColor(device, 160, 360); ok(color == 0x00ff00ff, "Compare test: Quad 1(sge vec) returned color 0x%08x, expected 0x00ff00ff\n", color); @@ -6677,10 +6977,30 @@ IDirect3DVertexShader9_Release(shader_slt_vec); IDirect3DVertexShader9_Release(shader_sge_scalar); IDirect3DVertexShader9_Release(shader_slt_scalar); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } -static void test_vshader_input(IDirect3DDevice9 *device) +static void test_vshader_input(void) { + IDirect3DVertexDeclaration9 *decl_twotexcrd, *decl_onetexcrd, *decl_twotex_wrongidx, *decl_twotexcrd_rightorder; + IDirect3DVertexDeclaration9 *decl_texcoord_color, *decl_color_color, *decl_color_ubyte, *decl_color_float; + IDirect3DVertexShader9 *swapped_shader, *texcoord_color_shader, *color_color_shader; + D3DADAPTER_IDENTIFIER9 identifier; + IDirect3DPixelShader9 *ps; + IDirect3DDevice9 *device; + IDirect3D9 *d3d; + ULONG refcount; + unsigned int i; + D3DCAPS9 caps; + DWORD color; + HWND window; + HRESULT hr; + BOOL warp; + static const DWORD swapped_shader_code_3[] = { 0xfffe0300, /* vs_3_0 */ @@ -6781,107 +7101,152 @@ 0x02000001, 0x800f0800, 0x90e40000, /* mov oC0, v0 */ 0x0000ffff /* end */ }; - IDirect3DVertexShader9 *swapped_shader, *texcoord_color_shader, *color_color_shader; - IDirect3DPixelShader9 *ps; - HRESULT hr; - DWORD color; - float quad1[] = { - -1.0, -1.0, 0.1, 1.0, 0.0, 1.0, 0.0, 0.0, -1.0, 0.5, 0.0, - 0.0, -1.0, 0.1, 1.0, 0.0, 1.0, 0.0, 0.0, -1.0, 0.5, 0.0, - -1.0, 0.0, 0.1, 1.0, 0.0, 1.0, 0.0, 0.0, -1.0, 0.5, 0.0, - 0.0, 0.0, 0.1, 1.0, 0.0, 1.0, 0.0, 0.0, -1.0, 0.5, 0.0, - }; - float quad2[] = { - 0.0, -1.0, 0.1, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, - 1.0, -1.0, 0.1, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, - 0.0, 0.0, 0.1, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, - 1.0, 0.0, 0.1, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, - }; - float quad3[] = { - -1.0, 0.0, 0.1, -1.0, 0.0, 0.0, 0.0, 1.0, -1.0, 0.0, 0.0, - 0.0, 0.0, 0.1, -1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, - -1.0, 1.0, 0.1, -1.0, 0.0, 0.0, 0.0, 0.0, -1.0, 1.0, 0.0, - 0.0, 1.0, 0.1, -1.0, 0.0, 0.0, 0.0, -1.0, 0.0, 0.0, 0.0, - }; - float quad4[] = { - 0.0, 0.0, 0.1, 1.0, 0.0, 1.0, 0.0, 0.0, -1.0, 0.5, 0.0, - 1.0, 0.0, 0.1, 1.0, 0.0, 1.0, 0.0, 0.0, -1.0, 0.5, 0.0, - 0.0, 1.0, 0.1, 1.0, 0.0, 1.0, 0.0, 0.0, -1.0, 0.5, 0.0, - 1.0, 1.0, 0.1, 1.0, 0.0, 1.0, 0.0, 0.0, -1.0, 0.5, 0.0, + static const float quad1[] = + { + -1.0f, -1.0f, 0.1f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f, -1.0f, 0.5f, 0.0f, + -1.0f, 0.0f, 0.1f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f, -1.0f, 0.5f, 0.0f, + 0.0f, -1.0f, 0.1f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f, -1.0f, 0.5f, 0.0f, + 0.0f, 0.0f, 0.1f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f, -1.0f, 0.5f, 0.0f, + }; + static const float quad2[] = + { + 0.0f, -1.0f, 0.1f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 0.1f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, + 1.0f, -1.0f, 0.1f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, + 1.0f, 0.0f, 0.1f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, + }; + static const float quad3[] = + { + -1.0f, 0.0f, 0.1f, -1.0f, 0.0f, 0.0f, 0.0f, 1.0f, -1.0f, 0.0f, 0.0f, + -1.0f, 1.0f, 0.1f, -1.0f, 0.0f, 0.0f, 0.0f, 0.0f, -1.0f, 1.0f, 0.0f, + 0.0f, 0.0f, 0.1f, -1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.1f, -1.0f, 0.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, 0.0f, + }; + static const float quad4[] = + { + 0.0f, 0.0f, 0.1f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f, -1.0f, 0.5f, 0.0f, + 0.0f, 1.0f, 0.1f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f, -1.0f, 0.5f, 0.0f, + 1.0f, 0.0f, 0.1f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f, -1.0f, 0.5f, 0.0f, + 1.0f, 1.0f, 0.1f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f, -1.0f, 0.5f, 0.0f, + }; + static const float quad1_modified[] = + { + -1.0f, -1.0f, 0.1f, 1.0f, 0.0f, 1.0f, 0.0f, -1.0f, 0.0f, 0.0f, 0.0f, + -1.0f, 0.0f, 0.1f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, -1.0f, 0.0f, + 0.0f, -1.0f, 0.1f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 0.1f, 1.0f, 0.0f, 1.0f, 0.0f, -1.0f, -1.0f, -1.0f, 0.0f, + }; + static const float quad2_modified[] = + { + 0.0f, -1.0f, 0.1f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 0.1f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, + 1.0f, -1.0f, 0.1f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, + 1.0f, 0.0f, 0.1f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, + }; + static const struct vertex quad1_color[] = + { + {-1.0f, -1.0f, 0.1f, 0x00ff8040}, + {-1.0f, 0.0f, 0.1f, 0x00ff8040}, + { 0.0f, -1.0f, 0.1f, 0x00ff8040}, + { 0.0f, 0.0f, 0.1f, 0x00ff8040}, }; - static const D3DVERTEXELEMENT9 decl_elements_twotexcrd[] = { + static const struct vertex quad2_color[] = + { + { 0.0f, -1.0f, 0.1f, 0x00ff8040}, + { 0.0f, 0.0f, 0.1f, 0x00ff8040}, + { 1.0f, -1.0f, 0.1f, 0x00ff8040}, + { 1.0f, 0.0f, 0.1f, 0x00ff8040}, + }; + static const struct vertex quad3_color[] = + { + {-1.0f, 0.0f, 0.1f, 0x00ff8040}, + {-1.0f, 1.0f, 0.1f, 0x00ff8040}, + { 0.0f, 0.0f, 0.1f, 0x00ff8040}, + { 0.0f, 1.0f, 0.1f, 0x00ff8040}, + }; + static const float quad4_color[] = + { + 0.0f, 0.0f, 0.1f, 1.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.1f, 1.0f, 1.0f, 0.0f, 0.0f, + 1.0f, 0.0f, 0.1f, 1.0f, 1.0f, 0.0f, 1.0f, + 1.0f, 1.0f, 0.1f, 1.0f, 1.0f, 0.0f, 1.0f, + }; + static const D3DVERTEXELEMENT9 decl_elements_twotexcrd[] = + { {0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, {0, 12, D3DDECLTYPE_FLOAT4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0}, {0, 28, D3DDECLTYPE_FLOAT4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 1}, D3DDECL_END() }; - static const D3DVERTEXELEMENT9 decl_elements_twotexcrd_rightorder[] = { + static const D3DVERTEXELEMENT9 decl_elements_twotexcrd_rightorder[] = + { {0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, {0, 12, D3DDECLTYPE_FLOAT4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 1}, {0, 28, D3DDECLTYPE_FLOAT4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0}, D3DDECL_END() }; - static const D3DVERTEXELEMENT9 decl_elements_onetexcrd[] = { + static const D3DVERTEXELEMENT9 decl_elements_onetexcrd[] = + { {0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, {0, 12, D3DDECLTYPE_FLOAT4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0}, D3DDECL_END() }; - static const D3DVERTEXELEMENT9 decl_elements_twotexcrd_wrongidx[] = { + static const D3DVERTEXELEMENT9 decl_elements_twotexcrd_wrongidx[] = + { {0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, {0, 12, D3DDECLTYPE_FLOAT4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 1}, {0, 28, D3DDECLTYPE_FLOAT4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 2}, D3DDECL_END() }; - static const D3DVERTEXELEMENT9 decl_elements_texcoord_color[] = { + static const D3DVERTEXELEMENT9 decl_elements_texcoord_color[] = + { {0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, {0, 12, D3DDECLTYPE_D3DCOLOR, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0}, D3DDECL_END() }; - static const D3DVERTEXELEMENT9 decl_elements_color_color[] = { + static const D3DVERTEXELEMENT9 decl_elements_color_color[] = + { {0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, {0, 12, D3DDECLTYPE_D3DCOLOR, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 0}, D3DDECL_END() }; - static const D3DVERTEXELEMENT9 decl_elements_color_ubyte[] = { + static const D3DVERTEXELEMENT9 decl_elements_color_ubyte[] = + { {0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, {0, 12, D3DDECLTYPE_UBYTE4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 0}, D3DDECL_END() }; - static const D3DVERTEXELEMENT9 decl_elements_color_float[] = { + static const D3DVERTEXELEMENT9 decl_elements_color_float[] = + { {0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, {0, 12, D3DDECLTYPE_FLOAT4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 0}, D3DDECL_END() }; - IDirect3DVertexDeclaration9 *decl_twotexcrd, *decl_onetexcrd, *decl_twotex_wrongidx, *decl_twotexcrd_rightorder; - IDirect3DVertexDeclaration9 *decl_texcoord_color, *decl_color_color, *decl_color_ubyte, *decl_color_float; - unsigned int i; - float normalize[4] = {1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0}; - float no_normalize[4] = {1.0, 1.0, 1.0, 1.0}; + static const float normalize[4] = {1.0f / 256.0f, 1.0f / 256.0f, 1.0f / 256.0f, 1.0f / 256.0f}; + static const float no_normalize[4] = {1.0f, 1.0f, 1.0f, 1.0f}; - struct vertex quad1_color[] = { - {-1.0, -1.0, 0.1, 0x00ff8040}, - { 0.0, -1.0, 0.1, 0x00ff8040}, - {-1.0, 0.0, 0.1, 0x00ff8040}, - { 0.0, 0.0, 0.1, 0x00ff8040} - }; - struct vertex quad2_color[] = { - { 0.0, -1.0, 0.1, 0x00ff8040}, - { 1.0, -1.0, 0.1, 0x00ff8040}, - { 0.0, 0.0, 0.1, 0x00ff8040}, - { 1.0, 0.0, 0.1, 0x00ff8040} - }; - struct vertex quad3_color[] = { - {-1.0, 0.0, 0.1, 0x00ff8040}, - { 0.0, 0.0, 0.1, 0x00ff8040}, - {-1.0, 1.0, 0.1, 0x00ff8040}, - { 0.0, 1.0, 0.1, 0x00ff8040} - }; - float quad4_color[] = { - 0.0, 0.0, 0.1, 1.0, 1.0, 0.0, 0.0, - 1.0, 0.0, 0.1, 1.0, 1.0, 0.0, 1.0, - 0.0, 1.0, 0.1, 1.0, 1.0, 0.0, 0.0, - 1.0, 1.0, 0.1, 1.0, 1.0, 0.0, 1.0, - }; + 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"); + goto done; + } + + hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); + if (caps.VertexShaderVersion < D3DVS_VERSION(3, 0)) + { + skip("No vs_3_0 support, skipping tests.\n"); + IDirect3DDevice9_Release(device); + goto done; + } + + 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"); hr = IDirect3DDevice9_CreateVertexDeclaration(device, decl_elements_twotexcrd, &decl_twotexcrd); ok(hr == D3D_OK, "IDirect3DDevice9_CreateVertexDeclaration returned %08x\n", hr); @@ -6904,8 +7269,9 @@ hr = IDirect3DDevice9_CreatePixelShader(device, ps3_code, &ps); ok(hr == D3D_OK, "IDirect3DDevice9_CreatePixelShader returned %08x\n", hr); - for(i = 1; i <= 3; i++) { - hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffff0000, 0.0, 0); + for (i = 1; i <= 3; ++i) + { + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xffff0000, 1.0f, 0); ok(SUCCEEDED(hr), "IDirect3DDevice9_Clear returned %#x.\n", hr); if(i == 3) { hr = IDirect3DDevice9_CreateVertexShader(device, swapped_shader_code_3, &swapped_shader); @@ -6921,44 +7287,40 @@ } hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene returned %08x\n", hr); - if(SUCCEEDED(hr)) - { - hr = IDirect3DDevice9_SetVertexShader(device, swapped_shader); - ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexShader returned %08x\n", hr); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetVertexDeclaration(device, decl_twotexcrd); - ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexDeclaration returned %08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad1, sizeof(float) * 11); - ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr); - - hr = IDirect3DDevice9_SetVertexDeclaration(device, decl_onetexcrd); - ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexDeclaration returned %08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad2, sizeof(float) * 11); - if(i == 3 || i == 2) { - ok(hr == D3D_OK, "DrawPrimitiveUP returned (%08x) i = %d\n", hr, i); - } else if(i == 1) { - /* Succeeds or fails, depending on SW or HW vertex processing */ - ok(hr == D3DERR_INVALIDCALL || hr == D3D_OK, "DrawPrimitiveUP returned (%08x), i = 1\n", hr); - } + hr = IDirect3DDevice9_SetVertexShader(device, swapped_shader); + ok(SUCCEEDED(hr), "Failed to set vertex shader, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetVertexDeclaration(device, decl_twotexcrd_rightorder); - ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexDeclaration returned %08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad4, sizeof(float) * 11); - ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr); - - hr = IDirect3DDevice9_SetVertexDeclaration(device, decl_twotex_wrongidx); - ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexDeclaration returned %08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad3, sizeof(float) * 11); - if(i == 3 || i == 2) { - ok(hr == D3D_OK, "DrawPrimitiveUP returned (%08x) i = %d\n", hr, i); - } else if(i == 1) { - ok(hr == D3DERR_INVALIDCALL || hr == D3D_OK, "DrawPrimitiveUP returned (%08x) i = 1\n", hr); - } + hr = IDirect3DDevice9_SetVertexDeclaration(device, decl_twotexcrd); + ok(SUCCEEDED(hr), "Failed to set vertex declaration, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad1, sizeof(float) * 11); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_EndScene returned %08x\n", hr); - } + hr = IDirect3DDevice9_SetVertexDeclaration(device, decl_onetexcrd); + ok(SUCCEEDED(hr), "Failed to set vertex declaration, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad2, sizeof(float) * 11); + if (i == 3 || i == 2) + ok(SUCCEEDED(hr), "Failed to draw, i %u, hr %#x.\n", i, hr); + else if (i == 1) + /* Succeeds or fails, depending on SW or HW vertex processing. */ + ok(hr == D3DERR_INVALIDCALL || hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DDevice9_SetVertexDeclaration(device, decl_twotexcrd_rightorder); + ok(SUCCEEDED(hr), "Failed to set vertex declaration, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad4, sizeof(float) * 11); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + + hr = IDirect3DDevice9_SetVertexDeclaration(device, decl_twotex_wrongidx); + ok(SUCCEEDED(hr), "Failed to set vertex declaration, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad3, sizeof(float) * 11); + if (i == 3 || i == 2) + ok(SUCCEEDED(hr), "Failed to draw, i %u, hr %#x.\n", i, hr); + else if (i == 1) + ok(hr == D3DERR_INVALIDCALL || hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); if(i == 3 || i == 2) { color = getPixelColor(device, 160, 360); @@ -6967,8 +7329,10 @@ /* The last value of the read but undefined stream is used, it is 0x00. The defined input is vec4(1, 0, 0, 0) */ color = getPixelColor(device, 480, 360); - ok(color == 0x00ffff00 || color ==0x00ff0000, - "Input test: Quad 2(1crd) returned color 0x%08x, expected 0x00ffff00\n", color); + /* On the Windows 8 testbot (WARP) the draw succeeds, but uses + * mostly random data as input. */ + ok(color == 0x00ffff00 || color == 0x00ff0000 || broken(warp), + "Got unexpected color 0x%08x for quad 2 (1crd).\n", color); color = getPixelColor(device, 160, 120); /* Same as above, accept both the last used value and 0.0 for the undefined streams */ ok(color_match(color, D3DCOLOR_ARGB(0x00, 0xff, 0x00, 0x80), 1) || color == D3DCOLOR_ARGB(0x00, 0xff, 0x00, 0x00), @@ -6981,8 +7345,11 @@ ok(color_match(color, D3DCOLOR_ARGB(0x00, 0xff, 0xff, 0x80), 1), "Input test: Quad 1(2crd) returned color 0x%08x, expected 0x00ffff80\n", color); color = getPixelColor(device, 480, 360); - /* Accept the clear color as well in this case, since SW VP returns an error */ - ok(color == 0x00ffff00 || color == 0x00ff0000, "Input test: Quad 2(1crd) returned color 0x%08x, expected 0x00ffff00\n", color); + /* Accept the clear color as well in this case, since SW VP + * returns an error. On the Windows 8 testbot (WARP) the draw + * succeeds, but uses mostly random data as input. */ + ok(color == 0x00ffff00 || color == 0x00ff0000 || broken(warp), + "Got unexpected color 0x%08x for quad 2 (1crd).\n", color); color = getPixelColor(device, 160, 120); ok(color_match(color, D3DCOLOR_ARGB(0x00, 0xff, 0x00, 0x80), 1) || color == D3DCOLOR_ARGB(0x00, 0xff, 0x00, 0x00), "Input test: Quad 3(2crd-wrongidx) returned color 0x%08x, expected 0x00ff0080\n", color); @@ -6996,47 +7363,30 @@ hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff808080, 0.0, 0); ok(hr == D3D_OK, "IDirect3DDevice9_Clear returned %08x\n", hr); - /* Now find out if the whole streams are re-read, or just the last active value for the - * vertices is used. - */ + /* Now find out if the whole streams are re-read, or just the last + * active value for the vertices is used. */ hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene returned %08x\n", hr); - if(SUCCEEDED(hr)) - { - float quad1_modified[] = { - -1.0, -1.0, 0.1, 1.0, 0.0, 1.0, 0.0, -1.0, 0.0, 0.0, 0.0, - 0.0, -1.0, 0.1, 1.0, 0.0, 1.0, 0.0, 0.0, -1.0, 0.0, 0.0, - -1.0, 0.0, 0.1, 1.0, 0.0, 1.0, 0.0, 0.0, 0.0, -1.0, 0.0, - 0.0, 0.0, 0.1, 1.0, 0.0, 1.0, 0.0, -1.0, -1.0, -1.0, 0.0, - }; - float quad2_modified[] = { - 0.0, -1.0, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, - 1.0, -1.0, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, - 0.0, 0.0, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, - 1.0, 0.0, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, - }; + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetVertexShader(device, swapped_shader); - ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexShader returned %08x\n", hr); + hr = IDirect3DDevice9_SetVertexShader(device, swapped_shader); + ok(SUCCEEDED(hr), "Failed to set vertex shader, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetVertexDeclaration(device, decl_twotexcrd); - ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexDeclaration returned %08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_POINTLIST, 3, quad1_modified, sizeof(float) * 11); - ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr); - - hr = IDirect3DDevice9_SetVertexDeclaration(device, decl_onetexcrd); - ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexDeclaration returned %08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad2_modified, sizeof(float) * 11); - if(i == 3 || i == 2) { - ok(hr == D3D_OK, "DrawPrimitiveUP returned (%08x) i = %d\n", hr, i); - } else if(i == 1) { - /* Succeeds or fails, depending on SW or HW vertex processing */ - ok(hr == D3DERR_INVALIDCALL || hr == D3D_OK, "DrawPrimitiveUP returned (%08x), i = 1\n", hr); - } + hr = IDirect3DDevice9_SetVertexDeclaration(device, decl_twotexcrd); + ok(SUCCEEDED(hr), "Failed to set vertex declaration, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_POINTLIST, 3, quad1_modified, sizeof(float) * 11); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_EndScene returned %08x\n", hr); - } + hr = IDirect3DDevice9_SetVertexDeclaration(device, decl_onetexcrd); + ok(SUCCEEDED(hr), "Failed to set vertex declaration, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad2_modified, sizeof(float) * 11); + if (i == 3 || i == 2) + ok(SUCCEEDED(hr), "Failed to draw, i %u, hr %#x.\n", i, hr); + else if (i == 1) + /* Succeeds or fails, depending on SW or HW vertex processing. */ + ok(hr == D3DERR_INVALIDCALL || hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); color = getPixelColor(device, 480, 350); /* vs_1_1 may fail, accept the clear color. Some drivers also set the undefined streams to 0, accept that @@ -7049,8 +7399,9 @@ * * A test app for this behavior is Half Life 2 Episode 2 in dxlevel 95, and related games(Portal, TF2). */ - ok(color == 0x000000ff || color == 0x00808080 || color == 0x00000000, - "Input test: Quad 2(different colors) returned color 0x%08x, expected 0x000000ff, 0x00808080 or 0x00000000\n", color); + ok(color == 0x000000ff || color == 0x00808080 || color == 0x00000000 + || broken(color_match(color, D3DCOLOR_ARGB(0x00, 0x0b, 0x75, 0x80), 1)), + "Got unexpected color 0x%08x for quad 2 (different colors).\n", color); hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); ok(hr == D3D_OK, "IDirect3DDevice9_Present failed with %08x\n", hr); @@ -7062,8 +7413,9 @@ IDirect3DVertexShader9_Release(swapped_shader); } - for(i = 1; i <= 3; i++) { - hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff0000ff, 0.0, 0); + for (i = 1; i <= 3; ++i) + { + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff0000ff, 1.0f, 0); ok(SUCCEEDED(hr), "IDirect3DDevice9_Clear returned %#x.\n", hr); if(i == 3) { hr = IDirect3DDevice9_CreateVertexShader(device, texcoord_color_shader_code_3, &texcoord_color_shader); @@ -7085,41 +7437,40 @@ } hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene returned %08x\n", hr); - if(SUCCEEDED(hr)) - { - hr = IDirect3DDevice9_SetVertexShader(device, texcoord_color_shader); - ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexShader returned %08x\n", hr); - hr = IDirect3DDevice9_SetVertexDeclaration(device, decl_texcoord_color); - ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexDeclaration returned %08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad1_color, sizeof(quad1_color[0])); - ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr); - - hr = IDirect3DDevice9_SetVertexShader(device, color_color_shader); - ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexShader returned %08x\n", hr); - - hr = IDirect3DDevice9_SetVertexShaderConstantF(device, 0, normalize, 1); - ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexShader returned %08x\n", hr); - hr = IDirect3DDevice9_SetVertexDeclaration(device, decl_color_ubyte); - ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexDeclaration returned %08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad2_color, sizeof(quad2_color[0])); - ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr); - - hr = IDirect3DDevice9_SetVertexShaderConstantF(device, 0, no_normalize, 1); - ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexShader returned %08x\n", hr); - hr = IDirect3DDevice9_SetVertexDeclaration(device, decl_color_color); - ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexDeclaration returned %08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad3_color, sizeof(quad3_color[0])); - ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr); - - hr = IDirect3DDevice9_SetVertexDeclaration(device, decl_color_float); - ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexDeclaration returned %08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad4_color, sizeof(float) * 7); - ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + + hr = IDirect3DDevice9_SetVertexShader(device, texcoord_color_shader); + ok(SUCCEEDED(hr), "Failed to set vertex shader, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetVertexDeclaration(device, decl_texcoord_color); + ok(SUCCEEDED(hr), "Failed to set vertex declaration, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad1_color, sizeof(quad1_color[0])); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + + hr = IDirect3DDevice9_SetVertexShader(device, color_color_shader); + ok(SUCCEEDED(hr), "Failed to set vertex shader, hr %#x.\n", hr); + + hr = IDirect3DDevice9_SetVertexShaderConstantF(device, 0, normalize, 1); + ok(SUCCEEDED(hr), "Failed to set vertex shader constant, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetVertexDeclaration(device, decl_color_ubyte); + ok(SUCCEEDED(hr), "Failed to set vertex declaration, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad2_color, sizeof(quad2_color[0])); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + + hr = IDirect3DDevice9_SetVertexShaderConstantF(device, 0, no_normalize, 1); + ok(SUCCEEDED(hr), "Failed to set vertex shader constant, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetVertexDeclaration(device, decl_color_color); + ok(SUCCEEDED(hr), "Failed to set vertex declaration, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad3_color, sizeof(quad3_color[0])); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + + hr = IDirect3DDevice9_SetVertexDeclaration(device, decl_color_float); + ok(SUCCEEDED(hr), "Failed to set vertex declaration, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad4_color, sizeof(float) * 7); + 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_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_EndScene returned %08x\n", hr); - } IDirect3DDevice9_SetVertexShader(device, NULL); IDirect3DDevice9_SetVertexDeclaration(device, NULL); IDirect3DDevice9_SetPixelShader(device, NULL); @@ -7155,46 +7506,57 @@ IDirect3DVertexDeclaration9_Release(decl_color_float); IDirect3DPixelShader9_Release(ps); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } -static void srgbtexture_test(IDirect3DDevice9 *device) +static void srgbtexture_test(void) { /* Fill a texture with 0x7f (~ .5), and then turn on the D3DSAMP_SRGBTEXTURE * texture stage state to render a quad using that texture. The resulting * color components should be 0x36 (~ 0.21), per this formula: * linear_color = ((srgb_color + 0.055) / 1.055) ^ 2.4 * This is true where srgb_color > 0.04045. */ - struct IDirect3DTexture9 *texture = NULL; - struct IDirect3DSurface9 *surface = NULL; - IDirect3D9 *d3d = NULL; + struct IDirect3DTexture9 *texture; + struct IDirect3DSurface9 *surface; + IDirect3DDevice9 *device; + IDirect3D9 *d3d; + D3DCOLOR color; + ULONG refcount; + HWND window; HRESULT hr; - D3DLOCKED_RECT lr; - DWORD color; - float quad[] = { - -1.0, 1.0, 0.0, 0.0, 0.0, - 1.0, 1.0, 0.0, 1.0, 0.0, - -1.0, -1.0, 0.0, 0.0, 1.0, - 1.0, -1.0, 0.0, 1.0, 1.0, - }; + static const float 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, + }; - memset(&lr, 0, sizeof(lr)); - IDirect3DDevice9_GetDirect3D(device, &d3d); - if(IDirect3D9_CheckDeviceFormat(d3d, 0, D3DDEVTYPE_HAL, D3DFMT_X8R8G8B8, - D3DUSAGE_QUERY_SRGBREAD, D3DRTYPE_TEXTURE, - D3DFMT_A8R8G8B8) != D3D_OK) { - skip("D3DFMT_A8R8G8B8 textures with SRGBREAD not supported\n"); - goto out; + 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"); + goto done; } - hr = IDirect3DDevice9_CreateTexture(device, 16, 16, 1, 0, - D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, - &texture, NULL); - ok(hr == D3D_OK, "IDirect3DDevice9_CreateTexture failed with %08x\n", hr); - if(!texture) { - skip("Failed to create A8R8G8B8 texture with SRGBREAD\n"); - goto out; + if (IDirect3D9_CheckDeviceFormat(d3d, 0, D3DDEVTYPE_HAL, + D3DFMT_X8R8G8B8, D3DUSAGE_QUERY_SRGBREAD, D3DRTYPE_TEXTURE, D3DFMT_A8R8G8B8) != D3D_OK) + { + skip("D3DFMT_A8R8G8B8 textures with SRGBREAD not supported.\n"); + IDirect3DDevice9_Release(device); + goto done; } + + hr = IDirect3DDevice9_CreateTexture(device, 16, 16, 1, 0, D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, &texture, NULL); + ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr); hr = IDirect3DTexture9_GetSurfaceLevel(texture, 0, &surface); ok(hr == D3D_OK, "IDirect3DTexture9_GetSurfaceLevel failed with %08x\n", hr); @@ -7207,27 +7569,17 @@ ok(hr == D3D_OK, "IDirect3DDevice9_SetTexture failed with %08x\n", hr); hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene failed with %08x\n", hr); - if(SUCCEEDED(hr)) - { - hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, TRUE); - ok(hr == D3D_OK, "IDirect3DDevice9_SetSamplerState failed with %08x\n", hr); - - hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_TEX1); - ok(hr == D3D_OK, "IDirect3DDevice9_SetFVF failed with %08x\n", hr); - - - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float)); - ok(SUCCEEDED(hr), "DrawPrimitiveUP failed with %08x\n", hr); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_EndScene failed with %08x\n", hr); - } + hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, TRUE); + ok(SUCCEEDED(hr), "Failed to set sampler state, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_TEX1); + ok(SUCCEEDED(hr), "Failed to set FVF, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 5 * sizeof(float)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetTexture(device, 0, NULL); - ok(hr == D3D_OK, "IDirect3DDevice9_SetTexture failed with %08x\n", hr); - hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, FALSE); - ok(hr == D3D_OK, "IDirect3DDevice9_SetSamplerState failed with %08x\n", hr); + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); color = getPixelColor(device, 320, 240); ok(color_match(color, 0x00363636, 1), "sRGB quad has color 0x%08x, expected 0x00363636.\n", color); @@ -7235,50 +7587,58 @@ hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); ok(hr == D3D_OK, "IDirect3DDevice9_Present failed with %08x\n", hr); -out: - if(texture) IDirect3DTexture9_Release(texture); + IDirect3DTexture9_Release(texture); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: IDirect3D9_Release(d3d); + DestroyWindow(window); } -static void shademode_test(IDirect3DDevice9 *device) +static void shademode_test(void) { /* Render a quad and try all of the different fixed function shading models. */ - struct IDirect3DVertexBuffer9 *vb_strip = NULL; - struct IDirect3DVertexBuffer9 *vb_list = NULL; - HRESULT hr; - DWORD color0, color1; DWORD color0_gouraud = 0, color1_gouraud = 0; - DWORD shademode = D3DSHADE_FLAT; DWORD primtype = D3DPT_TRIANGLESTRIP; + IDirect3DVertexBuffer9 *vb_strip; + IDirect3DVertexBuffer9 *vb_list; + DWORD shademode = D3DSHADE_FLAT; + IDirect3DDevice9 *device; + DWORD color0, color1; void *data = NULL; + IDirect3D9 *d3d; + ULONG refcount; + HWND window; + HRESULT hr; UINT i, j; - struct vertex quad_strip[] = + + static const struct vertex 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 } + {-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}, }; - struct vertex quad_list[] = + static const struct vertex quad_list[] = { - {-1.0f, -1.0f, 0.0f, 0xffff0000 }, - {-1.0f, 1.0f, 0.0f, 0xff00ff00 }, - { 1.0f, -1.0f, 0.0f, 0xff0000ff }, + {-1.0f, -1.0f, 0.0f, 0xffff0000}, + {-1.0f, 1.0f, 0.0f, 0xff00ff00}, + { 1.0f, -1.0f, 0.0f, 0xff0000ff}, - {-1.0f, 1.0f, 0.0f, 0xff00ff00 }, - { 1.0f, -1.0f, 0.0f, 0xff0000ff }, - { 1.0f, 1.0f, 0.0f, 0xffffffff } + { 1.0f, -1.0f, 0.0f, 0xff0000ff}, + {-1.0f, 1.0f, 0.0f, 0xff00ff00}, + { 1.0f, 1.0f, 0.0f, 0xffffffff}, }; - hr = IDirect3DDevice9_CreateVertexBuffer(device, sizeof(quad_strip), - 0, 0, D3DPOOL_MANAGED, &vb_strip, NULL); - ok(hr == D3D_OK, "CreateVertexBuffer failed with %08x\n", hr); - if (FAILED(hr)) goto bail; - - hr = IDirect3DDevice9_CreateVertexBuffer(device, sizeof(quad_list), - 0, 0, D3DPOOL_MANAGED, &vb_list, NULL); - ok(hr == D3D_OK, "CreateVertexBuffer failed with %08x\n", hr); - if (FAILED(hr)) goto bail; + 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"); + goto done; + } hr = IDirect3DDevice9_SetRenderState(device, D3DRS_LIGHTING, FALSE); ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState returned %08x\n", hr); @@ -7286,12 +7646,16 @@ hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_DIFFUSE); ok(hr == D3D_OK, "IDirect3DDevice9_SetFVF failed with %08x\n", hr); + hr = IDirect3DDevice9_CreateVertexBuffer(device, sizeof(quad_strip), 0, 0, D3DPOOL_MANAGED, &vb_strip, NULL); + ok(hr == D3D_OK, "CreateVertexBuffer failed with %08x\n", hr); hr = IDirect3DVertexBuffer9_Lock(vb_strip, 0, sizeof(quad_strip), &data, 0); ok(hr == D3D_OK, "IDirect3DVertexBuffer9_Lock failed with %08x\n", hr); memcpy(data, quad_strip, sizeof(quad_strip)); hr = IDirect3DVertexBuffer9_Unlock(vb_strip); ok(hr == D3D_OK, "IDirect3DVertexBuffer9_Unlock failed with %08x\n", hr); + hr = IDirect3DDevice9_CreateVertexBuffer(device, sizeof(quad_list), 0, 0, D3DPOOL_MANAGED, &vb_list, NULL); + ok(hr == D3D_OK, "CreateVertexBuffer failed with %08x\n", hr); hr = IDirect3DVertexBuffer9_Lock(vb_list, 0, sizeof(quad_list), &data, 0); ok(hr == D3D_OK, "IDirect3DVertexBuffer9_Lock failed with %08x\n", hr); memcpy(data, quad_list, sizeof(quad_list)); @@ -7315,15 +7679,11 @@ ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState returned %08x\n", hr); hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene failed with %08x\n", hr); - if(SUCCEEDED(hr)) - { - hr = IDirect3DDevice9_DrawPrimitive(device, primtype, 0, 2); - ok(hr == D3D_OK, "IDirect3DDevice9_DrawPrimitive failed with %08x\n", hr); - - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_EndScene failed with %08x\n", hr); - } + 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); /* Sample two spots from the output */ color0 = getPixelColor(device, 100, 100); /* Inside first triangle */ @@ -7380,64 +7740,71 @@ shademode = D3DSHADE_FLAT; } -bail: - hr = IDirect3DDevice9_SetStreamSource(device, 0, NULL, 0, 0); - ok(hr == D3D_OK, "IDirect3DDevice9_SetStreamSource failed with %08x\n", hr); - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_SHADEMODE, D3DSHADE_GOURAUD); - ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState returned %08x\n", hr); - - if (vb_strip) - IDirect3DVertexBuffer9_Release(vb_strip); - if (vb_list) - IDirect3DVertexBuffer9_Release(vb_list); + IDirect3DVertexBuffer9_Release(vb_strip); + IDirect3DVertexBuffer9_Release(vb_list); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } -static void alpha_test(IDirect3DDevice9 *device) +static void alpha_test(void) { - HRESULT hr; + IDirect3DSurface9 *backbuffer, *offscreen; IDirect3DTexture9 *offscreenTexture; - IDirect3DSurface9 *backbuffer = NULL, *offscreen = NULL; - DWORD color; + IDirect3DDevice9 *device; + IDirect3D9 *d3d; + D3DCOLOR color; + ULONG refcount; + HWND window; + HRESULT hr; - struct vertex quad1[] = + static const struct vertex 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}, + {-1.0f, -1.0f, 0.1f, 0x4000ff00}, + {-1.0f, 0.0f, 0.1f, 0x4000ff00}, + { 1.0f, -1.0f, 0.1f, 0x4000ff00}, + { 1.0f, 0.0f, 0.1f, 0x4000ff00}, }; - struct vertex quad2[] = + static const struct vertex quad2[] = { - {-1.0f, 0.0f, 0.1f, 0xc00000ff}, - {-1.0f, 1.0f, 0.1f, 0xc00000ff}, - { 1.0f, 0.0f, 0.1f, 0xc00000ff}, - { 1.0f, 1.0f, 0.1f, 0xc00000ff}, + {-1.0f, 0.0f, 0.1f, 0xc00000ff}, + {-1.0f, 1.0f, 0.1f, 0xc00000ff}, + { 1.0f, 0.0f, 0.1f, 0xc00000ff}, + { 1.0f, 1.0f, 0.1f, 0xc00000ff}, }; - static const float composite_quad[][5] = { + static const float composite_quad[][5] = + { { 0.0f, -1.0f, 0.1f, 0.0f, 1.0f}, { 0.0f, 1.0f, 0.1f, 0.0f, 0.0f}, { 1.0f, -1.0f, 0.1f, 1.0f, 1.0f}, { 1.0f, 1.0f, 0.1f, 1.0f, 0.0f}, }; + 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"); + goto done; + } + /* Clear the render target with alpha = 0.5 */ - hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0x80ff0000, 0.0, 0); + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0x80ff0000, 1.0f, 0); ok(hr == D3D_OK, "Clear failed, hr = %08x\n", hr); - hr = IDirect3DDevice9_CreateTexture(device, 128, 128, 1, D3DUSAGE_RENDERTARGET, D3DFMT_X8R8G8B8, D3DPOOL_DEFAULT, &offscreenTexture, NULL); - ok(hr == D3D_OK || hr == D3DERR_INVALIDCALL, "Creating the offscreen render target failed, hr = %#08x\n", hr); + hr = IDirect3DDevice9_CreateTexture(device, 128, 128, 1, D3DUSAGE_RENDERTARGET, + D3DFMT_X8R8G8B8, D3DPOOL_DEFAULT, &offscreenTexture, NULL); + ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr); hr = IDirect3DDevice9_GetBackBuffer(device, 0, 0, D3DBACKBUFFER_TYPE_MONO, &backbuffer); ok(hr == D3D_OK, "Can't get back buffer, hr = %08x\n", hr); - if(!backbuffer) { - goto out; - } hr = IDirect3DTexture9_GetSurfaceLevel(offscreenTexture, 0, &offscreen); ok(hr == D3D_OK, "Can't get offscreen surface, hr = %08x\n", hr); - if(!offscreen) { - goto out; - } hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_DIFFUSE); ok(hr == D3D_OK, "IDirect3DDevice9_SetFVF failed, hr = %#08x\n", hr); @@ -7455,66 +7822,66 @@ hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ALPHABLENDENABLE, TRUE); ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState failed, hr = %08x\n", hr); - if(IDirect3DDevice9_BeginScene(device) == D3D_OK) { + hr = IDirect3DDevice9_BeginScene(device); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); - /* Draw two quads, one with src alpha blending, one with dest alpha blending. */ - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_SRCBLEND, D3DBLEND_SRCALPHA); - ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState failed, hr = %08x\n", hr); - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA); - ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState failed, hr = %08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad1, sizeof(quad1[0])); - ok(hr == D3D_OK, "DrawPrimitiveUP failed, hr = %#08x\n", hr); + /* Draw two quads, one with src alpha blending, one with dest alpha + * blending. */ + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_SRCBLEND, D3DBLEND_SRCALPHA); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad1, sizeof(quad1[0])); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_SRCBLEND, D3DBLEND_DESTALPHA); - ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState failed, hr = %08x\n", hr); - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_DESTBLEND, D3DBLEND_INVDESTALPHA); - ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState failed, hr = %08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad2, sizeof(quad2[0])); - ok(hr == D3D_OK, "DrawPrimitiveUP failed, hr = %#08x\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_SRCBLEND, D3DBLEND_DESTALPHA); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_DESTBLEND, D3DBLEND_INVDESTALPHA); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad2, sizeof(quad2[0])); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - /* Switch to the offscreen buffer, and redo the testing. The offscreen render target - * doesn't have an alpha channel. DESTALPHA and INVDESTALPHA "don't work" on render - * targets without alpha channel, they give essentially ZERO and ONE blend factors. */ - hr = IDirect3DDevice9_SetRenderTarget(device, 0, offscreen); - ok(hr == D3D_OK, "Can't get back buffer, hr = %08x\n", hr); - hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0x80ff0000, 0.0, 0); - ok(hr == D3D_OK, "Clear failed, hr = %08x\n", hr); + /* Switch to the offscreen buffer, and redo the testing. The offscreen + * render target doesn't have an alpha channel. DESTALPHA and INVDESTALPHA + * "don't work" on render targets without alpha channel, they give + * essentially ZERO and ONE blend factors. */ + hr = IDirect3DDevice9_SetRenderTarget(device, 0, offscreen); + ok(SUCCEEDED(hr), "Failed to set render target, hr %#x.\n", hr); + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0x80ff0000, 1.0f, 0); + ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_SRCBLEND, D3DBLEND_SRCALPHA); - ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState failed, hr = %08x\n", hr); - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA); - ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState failed, hr = %08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad1, sizeof(quad1[0])); - ok(hr == D3D_OK, "DrawPrimitiveUP failed, hr = %#08x\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_SRCBLEND, D3DBLEND_SRCALPHA); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad1, sizeof(quad1[0])); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_SRCBLEND, D3DBLEND_DESTALPHA); - ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState failed, hr = %08x\n", hr); - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_DESTBLEND, D3DBLEND_INVDESTALPHA); - ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState failed, hr = %08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad2, sizeof(quad2[0])); - ok(hr == D3D_OK, "DrawPrimitiveUP failed, hr = %#08x\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_SRCBLEND, D3DBLEND_DESTALPHA); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_DESTBLEND, D3DBLEND_INVDESTALPHA); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad2, sizeof(quad2[0])); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetRenderTarget(device, 0, backbuffer); - ok(hr == D3D_OK, "Can't get back buffer, hr = %08x\n", hr); + hr = IDirect3DDevice9_SetRenderTarget(device, 0, backbuffer); + ok(SUCCEEDED(hr), "Failed to set render target, hr %#x.\n", hr); - /* Render the offscreen texture onto the frame buffer to be able to compare it regularly. - * Disable alpha blending for the final composition - */ - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ALPHABLENDENABLE, FALSE); - ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState failed, hr = %08x\n", hr); - hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_TEX1); - ok(hr == D3D_OK, "IDirect3DDevice9_SetFVF failed, hr = %#08x\n", hr); + /* Render the offscreen texture onto the frame buffer to be able to + * compare it regularly. Disable alpha blending for the final + * composition. */ + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ALPHABLENDENABLE, FALSE); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_TEX1); + ok(SUCCEEDED(hr), "Failed to set FVF, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetTexture(device, 0, (IDirect3DBaseTexture9 *) offscreenTexture); - ok(hr == D3D_OK, "IDirect3DDevice9_SetTexture failed, hr = %08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, composite_quad, sizeof(float) * 5); - ok(hr == D3D_OK, "DrawPrimitiveUP failed, hr = %#08x\n", hr); - hr = IDirect3DDevice9_SetTexture(device, 0, NULL); - ok(hr == D3D_OK, "IDirect3DDevice9_SetTexture failed, hr = %08x\n", hr); + hr = IDirect3DDevice9_SetTexture(device, 0, (IDirect3DBaseTexture9 *) offscreenTexture); + ok(SUCCEEDED(hr), "Failed to set texture, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, composite_quad, sizeof(float) * 5); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice7_EndScene failed, hr = %08x\n", hr); - } + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); color = getPixelColor(device, 160, 360); ok(color_match(color, D3DCOLOR_ARGB(0x00, 0xbf, 0x40, 0x00), 1), @@ -7532,19 +7899,16 @@ ok(color_match(color, D3DCOLOR_ARGB(0x00, 0x00, 0x00, 0xff), 1), "DSTALPHA on texture returned color %08x, expected 0x000000ff\n", color); - IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); - - out: - /* restore things */ - if(backbuffer) { - IDirect3DSurface9_Release(backbuffer); - } - if(offscreenTexture) { - IDirect3DTexture9_Release(offscreenTexture); - } - if(offscreen) { - IDirect3DSurface9_Release(offscreen); - } + IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); + + IDirect3DSurface9_Release(backbuffer); + IDirect3DTexture9_Release(offscreenTexture); + IDirect3DSurface9_Release(offscreen); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } struct vertex_shortcolor { @@ -7556,12 +7920,21 @@ float r, g, b, a; }; -static void fixed_function_decl_test(IDirect3DDevice9 *device) +static void fixed_function_decl_test(void) { - HRESULT hr; + IDirect3DVertexDeclaration9 *dcl_float = NULL, *dcl_short = NULL, *dcl_ubyte = NULL, *dcl_color = NULL; + IDirect3DVertexDeclaration9 *dcl_color_2 = NULL, *dcl_ubyte_2 = NULL, *dcl_positiont; + IDirect3DVertexBuffer9 *vb, *vb2; + IDirect3DDevice9 *device; BOOL s_ok, ub_ok, f_ok; DWORD color, size, i; + IDirect3D9 *d3d; + ULONG refcount; + D3DCAPS9 caps; + HWND window; void *data; + HRESULT hr; + static const D3DVERTEXELEMENT9 decl_elements_d3dcolor[] = { {0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, {0, 12, D3DDECLTYPE_D3DCOLOR, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 0}, @@ -7597,38 +7970,36 @@ {0, 16, D3DDECLTYPE_D3DCOLOR, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 0}, D3DDECL_END() }; - IDirect3DVertexDeclaration9 *dcl_float = NULL, *dcl_short = NULL, *dcl_ubyte = NULL, *dcl_color = NULL; - IDirect3DVertexDeclaration9 *dcl_color_2 = NULL, *dcl_ubyte_2 = NULL, *dcl_positiont; - IDirect3DVertexBuffer9 *vb, *vb2; - struct vertex quad1[] = /* D3DCOLOR */ + static const struct vertex quad1[] = /* D3DCOLOR */ { {-1.0f, -1.0f, 0.1f, 0x00ffff00}, {-1.0f, 0.0f, 0.1f, 0x00ffff00}, { 0.0f, -1.0f, 0.1f, 0x00ffff00}, { 0.0f, 0.0f, 0.1f, 0x00ffff00}, }; - struct vertex quad2[] = /* UBYTE4N */ + static const struct vertex quad2[] = /* UBYTE4N */ { {-1.0f, 0.0f, 0.1f, 0x00ffff00}, {-1.0f, 1.0f, 0.1f, 0x00ffff00}, { 0.0f, 0.0f, 0.1f, 0x00ffff00}, { 0.0f, 1.0f, 0.1f, 0x00ffff00}, }; - struct vertex_shortcolor quad3[] = /* short */ + static const struct vertex_shortcolor quad3[] = /* short */ { { 0.0f, -1.0f, 0.1f, 0x0000, 0x0000, 0xffff, 0xffff}, { 0.0f, 0.0f, 0.1f, 0x0000, 0x0000, 0xffff, 0xffff}, { 1.0f, -1.0f, 0.1f, 0x0000, 0x0000, 0xffff, 0xffff}, { 1.0f, 0.0f, 0.1f, 0x0000, 0x0000, 0xffff, 0xffff}, }; - struct vertex_floatcolor quad4[] = + static const struct vertex_floatcolor quad4[] = { { 0.0f, 0.0f, 0.1f, 1.0, 0.0, 0.0, 0.0}, { 0.0f, 1.0f, 0.1f, 1.0, 0.0, 0.0, 0.0}, { 1.0f, 0.0f, 0.1f, 1.0, 0.0, 0.0, 0.0}, { 1.0f, 1.0f, 0.1f, 1.0, 0.0, 0.0, 0.0}, }; - DWORD colors[] = { + static const DWORD colors[] = + { 0x00ff0000, 0x0000ff00, 0x000000ff, 0x00ffffff, 0x00ff0000, 0x0000ff00, 0x000000ff, 0x00ffffff, 0x00ff0000, 0x0000ff00, 0x000000ff, 0x00ffffff, @@ -7646,40 +8017,51 @@ 0x00ff0000, 0x0000ff00, 0x000000ff, 0x00ffffff, 0x00ff0000, 0x0000ff00, 0x000000ff, 0x00ffffff, }; - float quads[] = { - -1.0, -1.0, 0.1, - -1.0, 0.0, 0.1, - 0.0, -1.0, 0.1, - 0.0, 0.0, 0.1, - - 0.0, -1.0, 0.1, - 0.0, 0.0, 0.1, - 1.0, -1.0, 0.1, - 1.0, 0.0, 0.1, - - 0.0, 0.0, 0.1, - 0.0, 1.0, 0.1, - 1.0, 0.0, 0.1, - 1.0, 1.0, 0.1, - - -1.0, 0.0, 0.1, - -1.0, 1.0, 0.1, - 0.0, 0.0, 0.1, - 0.0, 1.0, 0.1 + static const float quads[] = + { + -1.0f, -1.0f, 0.1f, + -1.0f, 0.0f, 0.1f, + 0.0f, -1.0f, 0.1f, + 0.0f, 0.0f, 0.1f, + + 0.0f, -1.0f, 0.1f, + 0.0f, 0.0f, 0.1f, + 1.0f, -1.0f, 0.1f, + 1.0f, 0.0f, 0.1f, + + 0.0f, 0.0f, 0.1f, + 0.0f, 1.0f, 0.1f, + 1.0f, 0.0f, 0.1f, + 1.0f, 1.0f, 0.1f, + + -1.0f, 0.0f, 0.1f, + -1.0f, 1.0f, 0.1f, + 0.0f, 0.0f, 0.1f, + 0.0f, 1.0f, 0.1f, }; - struct tvertex quad_transformed[] = { + static const struct tvertex quad_transformed[] = + { { 90, 110, 0.1, 2.0, 0x00ffff00}, { 570, 110, 0.1, 2.0, 0x00ffff00}, { 90, 300, 0.1, 2.0, 0x00ffff00}, { 570, 300, 0.1, 2.0, 0x00ffff00} }; - D3DCAPS9 caps; + + 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"); + goto done; + } memset(&caps, 0, sizeof(caps)); hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); ok(hr == D3D_OK, "GetDeviceCaps failed, hr = %08x\n", hr); - hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffffff, 0.0, 0); + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xffffffff, 1.0f, 0); ok(hr == D3D_OK, "Clear failed, hr = %08x\n", hr); hr = IDirect3DDevice9_CreateVertexDeclaration(device, decl_elements_d3dcolor, &dcl_color); @@ -7708,49 +8090,55 @@ 0, 0, D3DPOOL_MANAGED, &vb, NULL); ok(hr == D3D_OK, "CreateVertexBuffer failed with %08x\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_LIGHTING, FALSE); + ok(SUCCEEDED(hr), "Failed to disable lighting, hr %#x.\n", hr); + hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene failed (%08x)\n", hr); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + f_ok = FALSE; s_ok = FALSE; ub_ok = FALSE; - if(SUCCEEDED(hr)) { - if(dcl_color) { - hr = IDirect3DDevice9_SetVertexDeclaration(device, dcl_color); - ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexDeclaration failed (%08x)\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad1, sizeof(quad1[0])); - ok(hr == D3D_OK, "DrawPrimitiveUP failed, hr = %#08x\n", hr); - } + if (dcl_color) + { + hr = IDirect3DDevice9_SetVertexDeclaration(device, dcl_color); + ok(SUCCEEDED(hr), "Failed to set vertex declaration, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad1, sizeof(quad1[0])); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + } - /* Tests with non-standard fixed function types fail on the refrast. The ATI driver partially - * accepts them, the nvidia driver accepts them all. All those differences even though we're - * using software vertex processing. Doh! - */ - if(dcl_ubyte) { - hr = IDirect3DDevice9_SetVertexDeclaration(device, dcl_ubyte); - ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexDeclaration failed (%08x)\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad2, sizeof(quad2[0])); - ok(hr == D3D_OK || hr == D3DERR_INVALIDCALL, "DrawPrimitiveUP failed, hr = %#08x\n", hr); - ub_ok = SUCCEEDED(hr); - } - - if(dcl_short) { - hr = IDirect3DDevice9_SetVertexDeclaration(device, dcl_short); - ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexDeclaration failed (%08x)\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad3, sizeof(quad3[0])); - ok(hr == D3D_OK || hr == D3DERR_INVALIDCALL, "DrawPrimitiveUP failed, hr = %#08x\n", hr); - s_ok = SUCCEEDED(hr); - } - - if(dcl_float) { - hr = IDirect3DDevice9_SetVertexDeclaration(device, dcl_float); - ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexDeclaration failed (%08x)\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad4, sizeof(quad4[0])); - ok(hr == D3D_OK || hr == D3DERR_INVALIDCALL, "DrawPrimitiveUP failed, hr = %#08x\n", hr); - f_ok = SUCCEEDED(hr); - } + /* Tests with non-standard fixed function types fail on the refrast. The + * ATI driver partially accepts them, the NVIDIA driver accepts them all. + * All those differences even though we're using software vertex + * processing. Doh! */ + if (dcl_ubyte) + { + hr = IDirect3DDevice9_SetVertexDeclaration(device, dcl_ubyte); + ok(SUCCEEDED(hr), "Failed to set vertex declaration, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad2, sizeof(quad2[0])); + ok(hr == D3D_OK || hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + ub_ok = SUCCEEDED(hr); + } - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_EndScene failed, hr = %#08x\n", hr); + if (dcl_short) + { + hr = IDirect3DDevice9_SetVertexDeclaration(device, dcl_short); + ok(SUCCEEDED(hr), "Failed to set vertex declaration, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad3, sizeof(quad3[0])); + ok(hr == D3D_OK || hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + s_ok = SUCCEEDED(hr); } + if (dcl_float) + { + hr = IDirect3DDevice9_SetVertexDeclaration(device, dcl_float); + ok(SUCCEEDED(hr), "Failed to set vertex declaration, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad4, sizeof(quad4[0])); + ok(hr == D3D_OK || hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + f_ok = SUCCEEDED(hr); + } + + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + if(dcl_short) { color = getPixelColor(device, 480, 360); ok(color == 0x000000ff || !s_ok, @@ -7773,81 +8161,81 @@ } IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); - /* The following test with vertex buffers doesn't serve to find out new information from windows. - * It is a plain regression test because wined3d uses different codepaths for attribute conversion - * with vertex buffers. It makes sure that the vertex buffer one works, while the above tests - * whether the immediate mode code works - */ + /* The following test with vertex buffers doesn't serve to find out new + * information from windows. It is a plain regression test because wined3d + * uses different codepaths for attribute conversion with vertex buffers. + * It makes sure that the vertex buffer one works, while the above tests + * whether the immediate mode code works. */ f_ok = FALSE; s_ok = FALSE; ub_ok = FALSE; hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene failed (%08x)\n", hr); - if(SUCCEEDED(hr)) { - if(dcl_color) { - hr = IDirect3DVertexBuffer9_Lock(vb, 0, sizeof(quad1), &data, 0); - ok(hr == D3D_OK, "IDirect3DVertexBuffer9_Lock failed with %08x\n", hr); - memcpy(data, quad1, sizeof(quad1)); - hr = IDirect3DVertexBuffer9_Unlock(vb); - ok(hr == D3D_OK, "IDirect3DVertexBuffer9_Unlock failed (%08x)\n", hr); - hr = IDirect3DDevice9_SetVertexDeclaration(device, dcl_color); - ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexDeclaration failed (%08x)\n", hr); - hr = IDirect3DDevice9_SetStreamSource(device, 0, vb, 0, sizeof(quad1[0])); - ok(hr == D3D_OK, "IDirect3DDevice9_SetStreamSource failed with %08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, 0, 2); - ok(hr == D3D_OK, "IDirect3DDevice9_DrawPrimitive failed, hr = %#08x\n", hr); - } - - if(dcl_ubyte) { - hr = IDirect3DVertexBuffer9_Lock(vb, 0, sizeof(quad2), &data, 0); - ok(hr == D3D_OK, "IDirect3DVertexBuffer9_Lock failed with %08x\n", hr); - memcpy(data, quad2, sizeof(quad2)); - hr = IDirect3DVertexBuffer9_Unlock(vb); - ok(hr == D3D_OK, "IDirect3DVertexBuffer9_Unlock failed (%08x)\n", hr); - hr = IDirect3DDevice9_SetVertexDeclaration(device, dcl_ubyte); - ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexDeclaration failed (%08x)\n", hr); - hr = IDirect3DDevice9_SetStreamSource(device, 0, vb, 0, sizeof(quad2[0])); - ok(hr == D3D_OK, "IDirect3DDevice9_SetStreamSource failed with %08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, 0, 2); - ok(hr == D3D_OK || hr == D3DERR_INVALIDCALL, - "IDirect3DDevice9_DrawPrimitive failed, hr = %#08x\n", hr); - ub_ok = SUCCEEDED(hr); - } - - if(dcl_short) { - hr = IDirect3DVertexBuffer9_Lock(vb, 0, sizeof(quad3), &data, 0); - ok(hr == D3D_OK, "IDirect3DVertexBuffer9_Lock failed with %08x\n", hr); - memcpy(data, quad3, sizeof(quad3)); - hr = IDirect3DVertexBuffer9_Unlock(vb); - ok(hr == D3D_OK, "IDirect3DVertexBuffer9_Unlock failed (%08x)\n", hr); - hr = IDirect3DDevice9_SetVertexDeclaration(device, dcl_short); - ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexDeclaration failed (%08x)\n", hr); - hr = IDirect3DDevice9_SetStreamSource(device, 0, vb, 0, sizeof(quad3[0])); - ok(hr == D3D_OK, "IDirect3DDevice9_SetStreamSource failed with %08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, 0, 2); - ok(hr == D3D_OK || hr == D3DERR_INVALIDCALL, - "IDirect3DDevice9_DrawPrimitive failed, hr = %#08x\n", hr); - s_ok = SUCCEEDED(hr); - } - - if(dcl_float) { - hr = IDirect3DVertexBuffer9_Lock(vb, 0, sizeof(quad4), &data, 0); - ok(hr == D3D_OK, "IDirect3DVertexBuffer9_Lock failed with %08x\n", hr); - memcpy(data, quad4, sizeof(quad4)); - hr = IDirect3DVertexBuffer9_Unlock(vb); - ok(hr == D3D_OK, "IDirect3DVertexBuffer9_Unlock failed (%08x)\n", hr); - hr = IDirect3DDevice9_SetVertexDeclaration(device, dcl_float); - ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexDeclaration failed (%08x)\n", hr); - hr = IDirect3DDevice9_SetStreamSource(device, 0, vb, 0, sizeof(quad4[0])); - ok(hr == D3D_OK, "IDirect3DDevice9_SetStreamSource failed with %08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, 0, 2); - ok(hr == D3D_OK || hr == D3DERR_INVALIDCALL, - "IDirect3DDevice9_DrawPrimitive failed, hr = %#08x\n", hr); - f_ok = SUCCEEDED(hr); - } + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_EndScene failed, hr = %#08x\n", hr); + if (dcl_color) + { + hr = IDirect3DVertexBuffer9_Lock(vb, 0, sizeof(quad1), &data, 0); + ok(SUCCEEDED(hr), "Failed to lock vertex buffer, hr %#x.\n", hr); + memcpy(data, quad1, sizeof(quad1)); + hr = IDirect3DVertexBuffer9_Unlock(vb); + ok(SUCCEEDED(hr), "Failed to unlock vertex buffer, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetVertexDeclaration(device, dcl_color); + ok(SUCCEEDED(hr), "Failed to set vertex declaration, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetStreamSource(device, 0, vb, 0, sizeof(quad1[0])); + ok(SUCCEEDED(hr), "Failed to set stream source, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, 0, 2); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + } + + if (dcl_ubyte) + { + hr = IDirect3DVertexBuffer9_Lock(vb, 0, sizeof(quad2), &data, 0); + ok(SUCCEEDED(hr), "Failed to lock vertex buffer, hr %#x.\n", hr); + memcpy(data, quad2, sizeof(quad2)); + hr = IDirect3DVertexBuffer9_Unlock(vb); + ok(SUCCEEDED(hr), "Failed to unlock vertex buffer, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetVertexDeclaration(device, dcl_ubyte); + ok(SUCCEEDED(hr), "Failed to set vertex declaration, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetStreamSource(device, 0, vb, 0, sizeof(quad2[0])); + ok(SUCCEEDED(hr), "Failed to set stream source, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, 0, 2); + ok(hr == D3D_OK || hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + ub_ok = SUCCEEDED(hr); + } + + if (dcl_short) + { + hr = IDirect3DVertexBuffer9_Lock(vb, 0, sizeof(quad3), &data, 0); + ok(SUCCEEDED(hr), "Failed to lock vertex buffer, hr %#x.\n", hr); + memcpy(data, quad3, sizeof(quad3)); + hr = IDirect3DVertexBuffer9_Unlock(vb); + ok(SUCCEEDED(hr), "Failed to unlock vertex buffer, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetVertexDeclaration(device, dcl_short); + ok(SUCCEEDED(hr), "Failed to set vertex declaration, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetStreamSource(device, 0, vb, 0, sizeof(quad3[0])); + ok(SUCCEEDED(hr), "Failed to set stream source, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, 0, 2); + ok(hr == D3D_OK || hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + s_ok = SUCCEEDED(hr); + } + + if (dcl_float) + { + hr = IDirect3DVertexBuffer9_Lock(vb, 0, sizeof(quad4), &data, 0); + ok(SUCCEEDED(hr), "Failed to lock vertex buffer, hr %#x.\n", hr); + memcpy(data, quad4, sizeof(quad4)); + hr = IDirect3DVertexBuffer9_Unlock(vb); + ok(SUCCEEDED(hr), "Failed to unlock vertex buffer, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetVertexDeclaration(device, dcl_float); + ok(SUCCEEDED(hr), "Failed to set vertex declaration, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetStreamSource(device, 0, vb, 0, sizeof(quad4[0])); + ok(SUCCEEDED(hr), "Failed to set stream source, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, 0, 2); + ok(hr == D3D_OK || hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + f_ok = SUCCEEDED(hr); } + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetStreamSource(device, 0, NULL, 0, 0); ok(hr == D3D_OK, "IDirect3DDevice9_SetStreamSource failed with %08x\n", hr); hr = IDirect3DDevice9_SetVertexDeclaration(device, NULL); @@ -7888,16 +8276,13 @@ ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexDeclaration failed with %08x\n", hr); hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexDeclaration failed with %08x\n", hr); - if(SUCCEEDED(hr)) { - hr = IDirect3DDevice9_SetStreamSource(device, 0, vb, 0, sizeof(quad_transformed[0])); - ok(hr == D3D_OK, "IDirect3DDevice9_SetStreamSource failed with %08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, 0, 2); - ok(hr == D3D_OK, "IDirect3DDevice9_DrawPrimitive failed, hr = %#08x\n", hr); - - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexDeclaration failed with %08x\n", hr); - } + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetStreamSource(device, 0, vb, 0, sizeof(quad_transformed[0])); + ok(SUCCEEDED(hr), "Failed to set stream source, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, 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); color = getPixelColor(device, 88, 108); ok(color == 0x000000ff, @@ -7987,31 +8372,27 @@ ok(hr == D3D_OK, "IDirect3DDevice9_SetStreamSource failed with %08x\n", hr); hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene failed with %08x\n", hr); - ub_ok = FALSE; - if(SUCCEEDED(hr)) { - hr = IDirect3DDevice9_SetVertexDeclaration(device, dcl_ubyte_2); - ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexDeclaration failed with %08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, 0, 2); - ok(hr == D3D_OK || hr == D3DERR_INVALIDCALL, - "IDirect3DDevice9_DrawPrimitive failed, hr = %#08x\n", hr); - ub_ok = SUCCEEDED(hr); - - hr = IDirect3DDevice9_SetVertexDeclaration(device, dcl_color_2); - ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexDeclaration failed with %08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, 4, 2); - ok(hr == D3D_OK, "IDirect3DDevice9_DrawPrimitive failed, hr = %#08x\n", hr); - - hr = IDirect3DDevice9_SetVertexDeclaration(device, dcl_ubyte_2); - ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexDeclaration failed with %08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, 8, 2); - ok(hr == D3D_OK || hr == D3DERR_INVALIDCALL, - "IDirect3DDevice9_DrawPrimitive failed, hr = %#08x\n", hr); - ub_ok = (SUCCEEDED(hr) && ub_ok); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_EndScene failed with %08x\n", hr); - } + hr = IDirect3DDevice9_SetVertexDeclaration(device, dcl_ubyte_2); + ok(SUCCEEDED(hr), "Failed to set vertex declaration, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, 0, 2); + ok(hr == D3D_OK || hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + ub_ok = SUCCEEDED(hr); + + hr = IDirect3DDevice9_SetVertexDeclaration(device, dcl_color_2); + ok(SUCCEEDED(hr), "Failed to set vertex declaration, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, 4, 2); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + + hr = IDirect3DDevice9_SetVertexDeclaration(device, dcl_ubyte_2); + ok(SUCCEEDED(hr), "Failed to set vertex declaration, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, 8, 2); + ok(hr == D3D_OK || hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + ub_ok = (SUCCEEDED(hr) && ub_ok); + + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); if(i == 0) { color = getPixelColor(device, 480, 360); @@ -8043,13 +8424,8 @@ IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); } - hr = IDirect3DDevice9_SetStreamSource(device, 0, NULL, 0, 0); - ok(hr == D3D_OK, "IDirect3DDevice9_SetStreamSource failed with %08x\n", hr); - hr = IDirect3DDevice9_SetStreamSource(device, 1, NULL, 0, 0); - ok(hr == D3D_OK, "IDirect3DDevice9_SetStreamSource failed with %08x\n", hr); IDirect3DVertexBuffer9_Release(vb2); - - out: +out: IDirect3DVertexBuffer9_Release(vb); if(dcl_float) IDirect3DVertexDeclaration9_Release(dcl_float); if(dcl_short) IDirect3DVertexDeclaration9_Release(dcl_short); @@ -8058,26 +8434,33 @@ if(dcl_color_2) IDirect3DVertexDeclaration9_Release(dcl_color_2); if(dcl_ubyte_2) IDirect3DVertexDeclaration9_Release(dcl_ubyte_2); if(dcl_positiont) IDirect3DVertexDeclaration9_Release(dcl_positiont); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } -struct vertex_float16color { - float x, y, z; - DWORD c1, c2; -}; - -static void test_vshader_float16(IDirect3DDevice9 *device) +static void test_vshader_float16(void) { - HRESULT hr; + IDirect3DVertexDeclaration9 *vdecl = NULL; + IDirect3DVertexBuffer9 *buffer = NULL; + IDirect3DVertexShader9 *shader; + IDirect3DDevice9 *device; + IDirect3D9 *d3d; + ULONG refcount; + D3DCAPS9 caps; DWORD color; + HWND window; void *data; - static const D3DVERTEXELEMENT9 decl_elements[] = { + HRESULT hr; + + static const D3DVERTEXELEMENT9 decl_elements[] = + { {0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, {0, 12, D3DDECLTYPE_FLOAT16_4,D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 0}, D3DDECL_END() }; - IDirect3DVertexDeclaration9 *vdecl = NULL; - IDirect3DVertexBuffer9 *buffer = NULL; - IDirect3DVertexShader9 *shader; static const DWORD shader_code[] = { 0xfffe0101, /* vs_1_1 */ @@ -8087,7 +8470,13 @@ 0x00000001, 0xd00f0000, 0x90e40001, /* mov oD0, v1 */ 0x0000ffff, }; - struct vertex_float16color quad[] = { + static const struct vertex_float16color + { + float x, y, z; + DWORD c1, c2; + } + quad[] = + { { -1.0, -1.0, 0.1, 0x3c000000, 0x00000000 }, /* green */ { -1.0, 0.0, 0.1, 0x3c000000, 0x00000000 }, { 0.0, -1.0, 0.1, 0x3c000000, 0x00000000 }, @@ -8109,7 +8498,26 @@ { 0.0, 1.0, 0.1, 0x00000000, 0x3c000000 }, }; - hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff102030, 0.0, 0); + 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"); + goto done; + } + + hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); + if (caps.VertexShaderVersion < D3DVS_VERSION(3, 0)) + { + skip("No vs_3_0 support, skipping tests.\n"); + IDirect3DDevice9_Release(device); + goto done; + } + + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff102030, 1.0f, 0); ok(hr == D3D_OK, "IDirect3DDevice9_Clear failed, hr=%08x\n", hr); hr = IDirect3DDevice9_CreateVertexDeclaration(device, decl_elements, &vdecl); @@ -8120,22 +8528,20 @@ ok(SUCCEEDED(hr), "IDirect3DDevice9_SetVertexShader failed hr=%08x\n", hr); hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene failed hr=%08x\n", hr); - if(SUCCEEDED(hr)) { - hr = IDirect3DDevice9_SetVertexDeclaration(device, vdecl); - ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexDeclaration failed, hr=%08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad + 0, sizeof(quad[0])); - ok(hr == D3D_OK, "IDirect3DDevice9_DrawPrimitiveUP failed, hr=%08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad + 4, sizeof(quad[0])); - ok(hr == D3D_OK, "IDirect3DDevice9_DrawPrimitiveUP failed, hr=%08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad + 8, sizeof(quad[0])); - ok(hr == D3D_OK, "IDirect3DDevice9_DrawPrimitiveUP failed, hr=%08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad + 12, sizeof(quad[0])); - ok(hr == D3D_OK, "IDirect3DDevice9_DrawPrimitiveUP failed, hr=%08x\n", hr); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetVertexDeclaration(device, vdecl); + ok(SUCCEEDED(hr), "Failed to set vertex declaration, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad + 0, sizeof(quad[0])); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad + 4, sizeof(quad[0])); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad + 8, sizeof(quad[0])); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad + 12, 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); - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_EndScene failed, hr=%08x\n", hr); - } color = getPixelColor(device, 480, 360); ok(color == 0x00ff0000, "Input 0x00003c00, 0x00000000 returned color %08x, expected 0x00ff0000\n", color); @@ -8165,20 +8571,17 @@ ok(hr == D3D_OK, "IDirect3DDevice9_SetStreamSource failed, hr=%08x\n", hr); hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene failed (%08x)\n", hr); - if(SUCCEEDED(hr)) { - hr = IDirect3DDevice9_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, 0, 2); - ok(hr == D3D_OK, "IDirect3DDevice9_DrawPrimitive failed, hr = %#08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, 4, 2); - ok(hr == D3D_OK, "IDirect3DDevice9_DrawPrimitive failed, hr = %#08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, 8, 2); - ok(hr == D3D_OK, "IDirect3DDevice9_DrawPrimitive failed, hr = %#08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, 12, 2); - ok(hr == D3D_OK, "IDirect3DDevice9_DrawPrimitive failed, hr = %#08x\n", hr); - - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_EndScene failed, hr=%08x\n", hr); - } + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, 0, 2); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, 4, 2); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, 8, 2); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, 12, 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); color = getPixelColor(device, 480, 360); ok(color == 0x00ff0000, @@ -8194,34 +8597,48 @@ "Input 0x00000000, 0x00003c00 returned color %08x, expected 0x000000ff\n", color); IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); - hr = IDirect3DDevice9_SetStreamSource(device, 0, NULL, 0, 0); - ok(hr == D3D_OK, "IDirect3DDevice9_SetStreamSource failed, hr=%08x\n", hr); - hr = IDirect3DDevice9_SetVertexDeclaration(device, NULL); - ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexDeclaration failed, hr=%08x\n", hr); - hr = IDirect3DDevice9_SetVertexShader(device, NULL); - ok(SUCCEEDED(hr), "IDirect3DDevice9_SetVertexShader failed hr=%08x\n", hr); - IDirect3DVertexDeclaration9_Release(vdecl); IDirect3DVertexShader9_Release(shader); IDirect3DVertexBuffer9_Release(buffer); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } -static void conditional_np2_repeat_test(IDirect3DDevice9 *device) +static void conditional_np2_repeat_test(void) { - D3DCAPS9 caps; IDirect3DTexture9 *texture; - HRESULT hr; + IDirect3DDevice9 *device; D3DLOCKED_RECT rect; unsigned int x, y; DWORD *dst, color; - const float quad[] = { - -1.0, -1.0, 0.1, -0.2, -0.2, - 1.0, -1.0, 0.1, 1.2, -0.2, - -1.0, 1.0, 0.1, -0.2, 1.2, - 1.0, 1.0, 0.1, 1.2, 1.2 + IDirect3D9 *d3d; + ULONG refcount; + D3DCAPS9 caps; + HWND window; + HRESULT hr; + + static const float quad[] = + { + -1.0f, -1.0f, 0.1f, -0.2f, -0.2f, + -1.0f, 1.0f, 0.1f, -0.2f, 1.2f, + 1.0f, -1.0f, 0.1f, 1.2f, -0.2f, + 1.0f, 1.0f, 0.1f, 1.2f, 1.2f, }; - memset(&caps, 0, sizeof(caps)); + 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"); + goto done; + } + + memset(&caps, 0, sizeof(caps)); hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); ok(hr == D3D_OK, "IDirect3DDevice9_GetDeviceCaps failed hr=%08x\n", hr); if (caps.TextureCaps & D3DPTEXTURECAPS_NONPOW2CONDITIONAL) @@ -8233,15 +8650,17 @@ else if (caps.TextureCaps & D3DPTEXTURECAPS_POW2) { skip("No conditional NP2 support, skipping conditional NP2 tests\n"); - return; + IDirect3DDevice9_Release(device); + goto done; } else { skip("Card has unconditional NP2 support, skipping conditional NP2 tests\n"); - return; + IDirect3DDevice9_Release(device); + goto done; } - hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff000000, 0.0, 0); + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff000000, 1.0f, 0); ok(hr == D3D_OK, "IDirect3DDevice9_Clear failed, hr=%08x\n", hr); hr = IDirect3DDevice9_CreateTexture(device, 10, 10, 1, 0, D3DFMT_X8R8G8B8, D3DPOOL_MANAGED, &texture, NULL); @@ -8265,6 +8684,8 @@ hr = IDirect3DDevice9_SetTexture(device, 0, (IDirect3DBaseTexture9 *) texture); ok(hr == D3D_OK, "IDirect3DDevice9_SetTexture failed hr=%08x\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_LIGHTING, FALSE); + ok(SUCCEEDED(hr), "Failed to disable lighting, hr %#x.\n", hr); hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_ADDRESSU, D3DTADDRESS_WRAP); ok(hr == D3D_OK, "IDirect3DDevice9_SetSamplerState failed hr=%08x\n", hr); hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_ADDRESSV, D3DTADDRESS_WRAP); @@ -8273,14 +8694,11 @@ ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexDeclaration failed, hr=%08x\n", hr); hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene failed hr=%08x\n", hr); - if(SUCCEEDED(hr)) { - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(float) * 5); - ok(hr == D3D_OK, "IDirect3DDevice9_DrawPrimitiveUP failed, hr=%08x\n", hr); - - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_EndScene failed hr=%08x\n", hr); - } + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(float) * 5); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); color = getPixelColor(device, 1, 1); ok(color == 0x00ff0000, "NP2: Pixel 1, 1 has color %08x, expected 0x00ff0000\n", color); @@ -8325,15 +8743,28 @@ IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); - hr = IDirect3DDevice9_SetTexture(device, 0, NULL); - ok(hr == D3D_OK, "IDirect3DDevice9_SetTexture failed hr=%08x\n", hr); IDirect3DTexture9_Release(texture); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } -static void vFace_register_test(IDirect3DDevice9 *device) +static void vface_register_test(void) { - HRESULT hr; + IDirect3DSurface9 *surface, *backbuffer; + IDirect3DVertexShader9 *vshader; + IDirect3DPixelShader9 *shader; + IDirect3DTexture9 *texture; + IDirect3DDevice9 *device; + IDirect3D9 *d3d; + ULONG refcount; + D3DCAPS9 caps; DWORD color; + HWND window; + HRESULT hr; + static const DWORD shader_code[] = { 0xffff0300, /* ps_3_0 */ @@ -8353,34 +8784,51 @@ 0x02000001, 0xe00f0000, 0x90e40000, /* mov o0, v0 */ 0x0000ffff /* end */ }; - IDirect3DPixelShader9 *shader; - IDirect3DVertexShader9 *vshader; - IDirect3DTexture9 *texture; - IDirect3DSurface9 *surface, *backbuffer; - const float quad[] = { - -1.0, -1.0, 0.1, - 1.0, -1.0, 0.1, - -1.0, 0.0, 0.1, + static const float quad[] = + { + -1.0f, -1.0f, 0.1f, + 1.0f, -1.0f, 0.1f, + -1.0f, 0.0f, 0.1f, - 1.0, -1.0, 0.1, - 1.0, 0.0, 0.1, - -1.0, 0.0, 0.1, + 1.0f, -1.0f, 0.1f, + 1.0f, 0.0f, 0.1f, + -1.0f, 0.0f, 0.1f, - -1.0, 0.0, 0.1, - -1.0, 1.0, 0.1, - 1.0, 0.0, 0.1, + -1.0f, 0.0f, 0.1f, + -1.0f, 1.0f, 0.1f, + 1.0f, 0.0f, 0.1f, - 1.0, 0.0, 0.1, - -1.0, 1.0, 0.1, - 1.0, 1.0, 0.1, + 1.0f, 0.0f, 0.1f, + -1.0f, 1.0f, 0.1f, + 1.0f, 1.0f, 0.1f, }; - const float blit[] = { - 0.0, -1.0, 0.1, 0.0, 0.0, - 1.0, -1.0, 0.1, 1.0, 0.0, - 0.0, 1.0, 0.1, 0.0, 1.0, - 1.0, 1.0, 0.1, 1.0, 1.0, + static const float blit[] = + { + 0.0f, -1.0f, 0.1f, 0.0f, 0.0f, + 1.0f, -1.0f, 0.1f, 1.0f, 0.0f, + 0.0f, 1.0f, 0.1f, 0.0f, 1.0f, + 1.0f, 1.0f, 0.1f, 1.0f, 1.0f, }; + 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"); + goto done; + } + + hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); + if (caps.PixelShaderVersion < D3DPS_VERSION(3, 0) || caps.VertexShaderVersion < D3DVS_VERSION(3, 0)) + { + skip("No shader model 3 support, skipping tests.\n"); + IDirect3DDevice9_Release(device); + goto done; + } + hr = IDirect3DDevice9_CreateVertexShader(device, vshader_code, &vshader); ok(hr == D3D_OK, "IDirect3DDevice9_CreateVertexShader failed hr=%08x\n", hr); hr = IDirect3DDevice9_CreatePixelShader(device, shader_code, &shader); @@ -8389,6 +8837,8 @@ ok(hr == D3D_OK, "IDirect3DDevice9_CreateTexture failed hr=%08x\n", hr); hr = IDirect3DTexture9_GetSurfaceLevel(texture, 0, &surface); ok(hr == D3D_OK, "IDirect3DTexture9_GetSurfaceLevel failed hr=%08x\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_CULLMODE, D3DCULL_NONE); + ok(SUCCEEDED(hr), "Failed to set cull mode, hr %#x.\n", hr); hr = IDirect3DDevice9_SetPixelShader(device, shader); ok(hr == D3D_OK, "IDirect3DDevice9_SetPixelShader failed hr=%08x\n", hr); hr = IDirect3DDevice9_SetVertexShader(device, vshader); @@ -8398,44 +8848,42 @@ hr = IDirect3DDevice9_GetBackBuffer(device, 0, 0, D3DBACKBUFFER_TYPE_MONO, &backbuffer); ok(hr == D3D_OK, "IDirect3DDevice9_GetBackBuffer failed hr=%08x\n", hr); - hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff0000ff, 0.0, 0); + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff0000ff, 1.0f, 0); ok(hr == D3D_OK, "IDirect3DDevice9_Clear failed, hr=%08x\n", hr); hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene failed hr=%08x\n", hr); - if(SUCCEEDED(hr)) { - /* First, draw to the texture and the back buffer to test both offscreen and onscreen cases */ - hr = IDirect3DDevice9_SetRenderTarget(device, 0, surface); - ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderTarget failed, hr=%08x\n", hr); - hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff0000ff, 0.0, 0); - ok(hr == D3D_OK, "IDirect3DDevice9_Clear failed, hr=%08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLELIST, 4, quad, sizeof(float) * 3); - ok(hr == D3D_OK, "IDirect3DDevice9_DrawPrimitiveUP failed, hr=%08x\n", hr); - hr = IDirect3DDevice9_SetRenderTarget(device, 0, backbuffer); - ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderTarget failed, hr=%08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLELIST, 4, quad, sizeof(float) * 3); - ok(hr == D3D_OK, "IDirect3DDevice9_DrawPrimitiveUP failed, hr=%08x\n", hr); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); - /* Blit the texture onto the back buffer to make it visible */ - hr = IDirect3DDevice9_SetVertexShader(device, NULL); - ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexShader failed, hr=%08x\n", hr); - hr = IDirect3DDevice9_SetPixelShader(device, NULL); - ok(hr == D3D_OK, "IDirect3DDevice9_SetPixelShader failed, hr=%08x\n", hr); - hr = IDirect3DDevice9_SetTexture(device, 0, (IDirect3DBaseTexture9 *) texture); - ok(hr == D3D_OK, "IDirect3DDevice9_SetTexture failed, hr=%08x\n", hr); - hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1); - ok(hr == D3D_OK, "IDirect3DDevice9_SetTextureStageState failed, hr=%08x\n", hr); - hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLORARG1, D3DTA_TEXTURE); - ok(hr == D3D_OK, "IDirect3DDevice9_SetTextureStageState failed, hr=%08x\n", hr); - hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_TEX1); - ok(hr == D3D_OK, "IDirect3DDevice9_SetFVF failed hr=%08x\n", hr); + /* First, draw to the texture and the back buffer to test both offscreen and onscreen cases */ + hr = IDirect3DDevice9_SetRenderTarget(device, 0, surface); + ok(SUCCEEDED(hr), "Failed to set render target, hr %#x.\n", hr); + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff0000ff, 0.0, 0); + ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLELIST, 4, quad, sizeof(float) * 3); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderTarget(device, 0, backbuffer); + ok(SUCCEEDED(hr), "Failed to set render target, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLELIST, 4, quad, sizeof(float) * 3); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, blit, sizeof(float) * 5); - ok(hr == D3D_OK, "IDirect3DDevice9_DrawPrimitiveUP failed, hr=%08x\n", hr); + /* Blit the texture onto the back buffer to make it visible */ + hr = IDirect3DDevice9_SetVertexShader(device, NULL); + ok(SUCCEEDED(hr), "Failed to set vertex shader, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetPixelShader(device, NULL); + ok(SUCCEEDED(hr), "Failed to set pixel shader, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetTexture(device, 0, (IDirect3DBaseTexture9 *) texture); + ok(SUCCEEDED(hr), "Failed to set texture, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1); + ok(SUCCEEDED(hr), "Failed to set texture stage state, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLORARG1, D3DTA_TEXTURE); + ok(SUCCEEDED(hr), "Failed to set texture stage state, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_TEX1); + ok(SUCCEEDED(hr), "Failed to set FVF, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, blit, sizeof(float) * 5); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_EndScene failed hr=%08x\n", hr); - } + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); color = getPixelColor(device, 160, 360); ok(color == 0x00ff0000, "vFace: Onscreen rendered front facing quad has color 0x%08x, expected 0x00ff0000\n", color); @@ -8448,69 +8896,83 @@ hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); ok(SUCCEEDED(hr), "Present failed, hr %#x.\n", hr); - IDirect3DDevice9_SetTexture(device, 0, NULL); IDirect3DPixelShader9_Release(shader); IDirect3DVertexShader9_Release(vshader); IDirect3DSurface9_Release(surface); IDirect3DSurface9_Release(backbuffer); IDirect3DTexture9_Release(texture); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } -static void fixed_function_bumpmap_test(IDirect3DDevice9 *device) +static void fixed_function_bumpmap_test(void) { - HRESULT hr; - DWORD color; - int i; + IDirect3DVertexDeclaration9 *vertex_declaration; + IDirect3DTexture9 *texture, *tex1, *tex2; + D3DLOCKED_RECT locked_rect; + IDirect3DDevice9 *device; + BOOL L6V5U5_supported; + float scale, offset; + IDirect3D9 *d3d; + unsigned int i; + D3DCOLOR color; + ULONG refcount; D3DCAPS9 caps; - BOOL L6V5U5_supported = FALSE; - IDirect3DTexture9 *tex1, *tex2; - D3DLOCKED_RECT locked_rect; + HWND window; + HRESULT hr; - static const float quad[][7] = { - {-128.0f/640.0f, -128.0f/480.0f, 0.1f, 0.0f, 0.0f, 0.0f, 0.0f}, - {-128.0f/640.0f, 128.0f/480.0f, 0.1f, 0.0f, 1.0f, 0.0f, 1.0f}, - { 128.0f/640.0f, -128.0f/480.0f, 0.1f, 1.0f, 0.0f, 1.0f, 0.0f}, - { 128.0f/640.0f, 128.0f/480.0f, 0.1f, 1.0f, 1.0f, 1.0f, 1.0f}, + static const float quad[][7] = + { + {-1.0f, -1.0f, 0.1f, 0.0f, 0.0f, 0.0f, 0.0f}, + {-1.0f, 1.0f, 0.1f, 0.0f, 1.0f, 0.0f, 1.0f}, + { 1.0f, -1.0f, 0.1f, 1.0f, 0.0f, 1.0f, 0.0f}, + { 1.0f, 1.0f, 0.1f, 1.0f, 1.0f, 1.0f, 1.0f}, }; - - static const D3DVERTEXELEMENT9 decl_elements[] = { + static const D3DVERTEXELEMENT9 decl_elements[] = + { {0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, {0, 12, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0}, {0, 20, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 1}, D3DDECL_END() }; - /* use asymmetric matrix to test loading */ - float bumpenvmat[4] = {0.0,0.5,-0.5,0.0}; - float scale, offset; + static const float bumpenvmat[4] = {0.0f, 0.5f, -0.5f, 0.0f}; - IDirect3DVertexDeclaration9 *vertex_declaration = NULL; - IDirect3DTexture9 *texture = NULL; + 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"); + goto done; + } memset(&caps, 0, sizeof(caps)); hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); ok(hr == D3D_OK, "IDirect3DDevice9_GetDeviceCaps failed hr=%08x\n", hr); - if(!(caps.TextureOpCaps & D3DTEXOPCAPS_BUMPENVMAP)) { + if (!(caps.TextureOpCaps & D3DTEXOPCAPS_BUMPENVMAP)) + { skip("D3DTEXOPCAPS_BUMPENVMAP not set, skipping bumpmap tests\n"); - return; - } else { - /* This check is disabled, some Windows drivers do not handle D3DUSAGE_QUERY_LEGACYBUMPMAP properly. - * They report that it is not supported, but after that bump mapping works properly. So just test - * if the format is generally supported, and check the BUMPENVMAP flag - */ - IDirect3D9 *d3d9; + IDirect3DDevice9_Release(device); + goto done; + } - IDirect3DDevice9_GetDirect3D(device, &d3d9); - hr = IDirect3D9_CheckDeviceFormat(d3d9, 0, D3DDEVTYPE_HAL, D3DFMT_X8R8G8B8, 0, - D3DRTYPE_TEXTURE, D3DFMT_L6V5U5); - L6V5U5_supported = SUCCEEDED(hr); - hr = IDirect3D9_CheckDeviceFormat(d3d9, 0, D3DDEVTYPE_HAL, D3DFMT_X8R8G8B8, 0, - D3DRTYPE_TEXTURE, D3DFMT_V8U8); - IDirect3D9_Release(d3d9); - if(FAILED(hr)) { - skip("D3DFMT_V8U8 not supported for legacy bump mapping\n"); - return; - } + /* This check is disabled, some Windows drivers do not handle + * D3DUSAGE_QUERY_LEGACYBUMPMAP properly. They report that it is not + * supported, but after that bump mapping works properly. So just test if + * the format is generally supported, and check the BUMPENVMAP flag. */ + L6V5U5_supported = SUCCEEDED(IDirect3D9_CheckDeviceFormat(d3d, 0, D3DDEVTYPE_HAL, + D3DFMT_X8R8G8B8, 0, D3DRTYPE_TEXTURE, D3DFMT_L6V5U5)); + if (FAILED(IDirect3D9_CheckDeviceFormat(d3d, 0, D3DDEVTYPE_HAL, + D3DFMT_X8R8G8B8, 0, D3DRTYPE_TEXTURE, D3DFMT_V8U8))) + { + skip("D3DFMT_V8U8 not supported for legacy bump mapping\n"); + IDirect3DDevice9_Release(device); + return; } /* Generate the textures */ @@ -8545,10 +9007,9 @@ hr = IDirect3DDevice9_SetVertexShader(device, NULL); ok(SUCCEEDED(hr), "SetVertexShader failed (%08x)\n", hr); - hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffff00ff, 0.0, 0); + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xffff00ff, 1.0f, 0); ok(hr == D3D_OK, "IDirect3DDevice9_Clear failed (%08x)\n", hr); - hr = IDirect3DDevice9_CreateVertexDeclaration(device, decl_elements, &vertex_declaration); ok(SUCCEEDED(hr), "CreateVertexDeclaration failed (0x%08x)\n", hr); hr = IDirect3DDevice9_SetVertexDeclaration(device, vertex_declaration); @@ -8563,28 +9024,22 @@ hr = IDirect3DDevice9_EndScene(device); ok(SUCCEEDED(hr), "EndScene failed (0x%08x)\n", hr); - /* on MacOS(10.5.4, radeon X1600), the white dots are have color 0x00fbfbfb rather than 0x00ffffff. This is - * kinda strange since no calculations are done on the sampled colors, only on the texture coordinates. - * But since testing the color match is not the purpose of the test don't be too picky - */ - color = getPixelColor(device, 320-32, 240); - ok(color_match(color, 0x00ffffff, 4), "bumpmap failed: Got color 0x%08x, expected 0x00ffffff.\n", color); - color = getPixelColor(device, 320+32, 240); - ok(color_match(color, 0x00ffffff, 4), "bumpmap failed: Got color 0x%08x, expected 0x00ffffff.\n", color); - color = getPixelColor(device, 320, 240-32); - ok(color_match(color, 0x00ffffff, 4), "bumpmap failed: Got color 0x%08x, expected 0x00ffffff.\n", color); - color = getPixelColor(device, 320, 240+32); - ok(color_match(color, 0x00ffffff, 4), "bumpmap failed: Got color 0x%08x, expected 0x00ffffff.\n", color); - color = getPixelColor(device, 320, 240); - ok(color_match(color, 0x00000000, 4), "bumpmap failed: Got color 0x%08x, expected 0x00000000.\n", color); - color = getPixelColor(device, 320+32, 240+32); - ok(color_match(color, 0x00000000, 4), "bumpmap failed: Got color 0x%08x, expected 0x00000000.\n", color); - color = getPixelColor(device, 320-32, 240+32); - ok(color_match(color, 0x00000000, 4), "bumpmap failed: Got color 0x%08x, expected 0x00000000.\n", color); - color = getPixelColor(device, 320+32, 240-32); - ok(color_match(color, 0x00000000, 4), "bumpmap failed: Got color 0x%08x, expected 0x00000000.\n", color); - color = getPixelColor(device, 320-32, 240-32); - ok(color_match(color, 0x00000000, 4), "bumpmap failed: Got color 0x%08x, expected 0x00000000.\n", color); + color = getPixelColor(device, 240, 60); + ok(color_match(color, 0x005ea000, 4), "Got unexpected color 0x%08x.\n", color); + color = getPixelColor(device, 400, 60); + ok(color_match(color, 0x009ea000, 4), "Got unexpected color 0x%08x.\n", color); + color = getPixelColor(device, 80, 180); + ok(color_match(color, 0x005ea000, 4), "Got unexpected color 0x%08x.\n", color); + color = getPixelColor(device, 560, 180); + ok(color_match(color, 0x009ea000, 4), "Got unexpected color 0x%08x.\n", color); + color = getPixelColor(device, 80, 300); + ok(color_match(color, 0x005e6000, 4), "Got unexpected color 0x%08x.\n", color); + color = getPixelColor(device, 560, 300); + ok(color_match(color, 0x009e6000, 4), "Got unexpected color 0x%08x.\n", color); + color = getPixelColor(device, 240, 420); + ok(color_match(color, 0x005e6000, 4), "Got unexpected color 0x%08x.\n", color); + color = getPixelColor(device, 400, 420); + ok(color_match(color, 0x009e6000, 4), "Got unexpected color 0x%08x.\n", color); hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); ok(SUCCEEDED(hr), "Present failed (0x%08x)\n", hr); @@ -8597,16 +9052,15 @@ IDirect3DTexture9_Release(texture); /* To destroy it */ } - if(!(caps.TextureOpCaps & D3DTEXOPCAPS_BUMPENVMAPLUMINANCE)) { - skip("D3DTOP_BUMPENVMAPLUMINANCE not supported, skipping\n"); - goto cleanup; - } - if(L6V5U5_supported == FALSE) { - skip("L6V5U5_supported not supported, skipping D3DTOP_BUMPENVMAPLUMINANCE test\n"); - goto cleanup; + if (!L6V5U5_supported || !(caps.TextureOpCaps & D3DTEXOPCAPS_BUMPENVMAPLUMINANCE)) + { + skip("L6V5U5 / D3DTOP_BUMPENVMAPLUMINANCE not supported, skipping tests.\n"); + IDirect3DVertexDeclaration9_Release(vertex_declaration); + IDirect3DDevice9_Release(device); + goto done; } - hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0x00000000, 0.0, 0x8); + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0x00000000, 1.0f, 0); ok(hr == D3D_OK, "IDirect3DDevice9_Clear returned %08x\n", hr); /* This test only tests the luminance part. The bumpmapping part was already tested above and * would only make this test more complicated @@ -8645,13 +9099,11 @@ ok(SUCCEEDED(hr), "SetTextureStageState failed (%08x)\n", hr); hr = IDirect3DDevice9_BeginScene(device); - ok(SUCCEEDED(hr), "BeginScene failed (0x%08x)\n", hr); - if(SUCCEEDED(hr)) { - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, &quad[0], sizeof(quad[0])); - ok(SUCCEEDED(hr), "DrawPrimitiveUP failed (0x%08x)\n", hr); - hr = IDirect3DDevice9_EndScene(device); - ok(SUCCEEDED(hr), "EndScene failed (0x%08x)\n", hr); - } + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, &quad[0], sizeof(quad[0])); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); color = getPixelColor(device, 320, 240); /* red: 1.0 * (0.25 * 2.0 + 0.1) = 1.0 * 0.6 = 0.6 = 0x99 @@ -8671,13 +9123,12 @@ ok(SUCCEEDED(hr), "SetTextureStageState failed (%08x)\n", hr); hr = IDirect3DDevice9_BeginScene(device); - ok(SUCCEEDED(hr), "BeginScene failed (0x%08x)\n", hr); - if(SUCCEEDED(hr)) { - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, &quad[0], sizeof(quad[0])); - ok(SUCCEEDED(hr), "DrawPrimitiveUP failed (0x%08x)\n", hr); - hr = IDirect3DDevice9_EndScene(device); - ok(SUCCEEDED(hr), "EndScene failed (0x%08x)\n", hr); - } + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, &quad[0], sizeof(quad[0])); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + color = getPixelColor(device, 320, 240); ok(color_match(color, 0x00ff80c0, 1), "bumpmap failed: Got color 0x%08x, expected 0x00ff80c0.\n", color); hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); @@ -8692,41 +9143,34 @@ ok(SUCCEEDED(hr), "SetTextureStageState failed (%08x)\n", hr); hr = IDirect3DDevice9_BeginScene(device); - ok(SUCCEEDED(hr), "BeginScene failed (0x%08x)\n", hr); - if(SUCCEEDED(hr)) { - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, &quad[0], sizeof(quad[0])); - ok(SUCCEEDED(hr), "DrawPrimitiveUP failed (0x%08x)\n", hr); - hr = IDirect3DDevice9_EndScene(device); - ok(SUCCEEDED(hr), "EndScene failed (0x%08x)\n", hr); - } + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, &quad[0], sizeof(quad[0])); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + color = getPixelColor(device, 320, 240); ok(color_match(color, 0x00ff80c0, 1), "bumpmap failed: Got color 0x%08x, expected 0x00ff80c0.\n", color); hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); ok(SUCCEEDED(hr), "Present failed (0x%08x)\n", hr); - hr = IDirect3DDevice9_SetTexture(device, 0, NULL); - ok(SUCCEEDED(hr), "IDirect3DDevice9_SetTexture failed (%08x)\n", hr); - hr = IDirect3DDevice9_SetTexture(device, 1, NULL); - ok(SUCCEEDED(hr), "IDirect3DDevice9_SetTexture failed (%08x)\n", hr); - IDirect3DTexture9_Release(tex1); IDirect3DTexture9_Release(tex2); - -cleanup: - hr = IDirect3DDevice9_SetTextureStageState(device, 1, D3DTSS_COLOROP, D3DTOP_DISABLE); - ok(SUCCEEDED(hr), "SetTextureStageState failed (%08x)\n", hr); - hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_MODULATE); - ok(SUCCEEDED(hr), "SetTextureStageState failed (%08x)\n", hr); - - hr = IDirect3DDevice9_SetVertexDeclaration(device, NULL); - ok(SUCCEEDED(hr), "SetVertexDeclaration failed (%08x)\n", hr); IDirect3DVertexDeclaration9_Release(vertex_declaration); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } -static void stencil_cull_test(IDirect3D9 *d3d9) +static void stencil_cull_test(void) { IDirect3DDevice9 *device; + IDirect3D9 *d3d; + ULONG refcount; D3DCAPS9 caps; + HWND window; HRESULT hr; static const float quad1[] = { @@ -8768,10 +9212,15 @@ unsigned int i; DWORD color; - device = create_device(d3d9); - if (!device) + 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("Cannot create a device with a D24S8 stencil buffer.\n"); + DestroyWindow(window); + IDirect3D9_Release(d3d); return; } hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); @@ -8814,50 +9263,48 @@ /* First pass: Fill the stencil buffer with some values... */ hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene returned %08x\n", hr); - if(SUCCEEDED(hr)) - { - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_CULLMODE, D3DCULL_CW); - ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState returned %08x\n", hr); - hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */, - 1 /*PrimCount */, indices_cw, D3DFMT_INDEX16, quad1, sizeof(float) * 3); - ok(SUCCEEDED(hr), "IDirect3DDevice9_DrawIndexedPrimitiveUP returned %#x.\n", hr); - hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */, - 1 /*PrimCount */, indices_ccw, D3DFMT_INDEX16, quad1, sizeof(float) * 3); - ok(SUCCEEDED(hr), "IDirect3DDevice9_DrawIndexedPrimitiveUP returned %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_TWOSIDEDSTENCILMODE, TRUE); - ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState returned %08x\n", hr); - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_CULLMODE, D3DCULL_NONE); - ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState returned %08x\n", hr); - hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */, - 1 /*PrimCount */, indices_cw, D3DFMT_INDEX16, quad2, sizeof(float) * 3); - ok(SUCCEEDED(hr), "IDirect3DDevice9_DrawIndexedPrimitiveUP returned %#x.\n", hr); - hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */, - 1 /*PrimCount */, indices_ccw, D3DFMT_INDEX16, quad2, sizeof(float) * 3); - ok(SUCCEEDED(hr), "IDirect3DDevice9_DrawIndexedPrimitiveUP returned %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_CULLMODE, D3DCULL_CW); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */, + 1 /* PrimCount */, indices_cw, D3DFMT_INDEX16, quad1, sizeof(float) * 3); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */, + 1 /* PrimCount */, indices_ccw, D3DFMT_INDEX16, quad1, sizeof(float) * 3); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_CULLMODE, D3DCULL_CW); - ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState returned %08x\n", hr); - hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */, - 1 /*PrimCount */, indices_cw, D3DFMT_INDEX16, quad3, sizeof(float) * 3); - ok(SUCCEEDED(hr), "IDirect3DDevice9_DrawIndexedPrimitiveUP returned %#x.\n", hr); - hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */, - 1 /*PrimCount */, indices_ccw, D3DFMT_INDEX16, quad3, sizeof(float) * 3); - ok(SUCCEEDED(hr), "IDirect3DDevice9_DrawIndexedPrimitiveUP returned %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_TWOSIDEDSTENCILMODE, TRUE); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_CULLMODE, D3DCULL_NONE); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */, + 1 /* PrimCount */, indices_cw, D3DFMT_INDEX16, quad2, sizeof(float) * 3); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */, + 1 /* PrimCount */, indices_ccw, D3DFMT_INDEX16, quad2, sizeof(float) * 3); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_CULLMODE, D3DCULL_CCW); - ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState returned %08x\n", hr); - hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */, - 1 /*PrimCount */, indices_cw, D3DFMT_INDEX16, quad4, sizeof(float) * 3); - ok(SUCCEEDED(hr), "IDirect3DDevice9_DrawIndexedPrimitiveUP returned %#x.\n", hr); - hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */, - 1 /*PrimCount */, indices_ccw, D3DFMT_INDEX16, quad4, sizeof(float) * 3); - ok(SUCCEEDED(hr), "IDirect3DDevice9_DrawIndexedPrimitiveUP returned %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_CULLMODE, D3DCULL_CW); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */, + 1 /* PrimCount */, indices_cw, D3DFMT_INDEX16, quad3, sizeof(float) * 3); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */, + 1 /* PrimCount */, indices_ccw, D3DFMT_INDEX16, quad3, sizeof(float) * 3); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_EndScene returned %08x\n", hr); - } + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_CULLMODE, D3DCULL_CCW); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */, + 1 /* PrimCount */, indices_cw, D3DFMT_INDEX16, quad4, sizeof(float) * 3); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawIndexedPrimitiveUP(device, D3DPT_TRIANGLELIST, 0 /* MinIndex */, 4 /* NumVerts */, + 1 /* PrimCount */, indices_ccw, D3DFMT_INDEX16, quad4, sizeof(float) * 3); + 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_SetRenderState(device, D3DRS_STENCILZFAIL, D3DSTENCILOP_KEEP); ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState returned %08x\n", hr); @@ -8874,26 +9321,23 @@ /* 2nd pass: Make the stencil values visible */ hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene returned %08x\n", hr); - if(SUCCEEDED(hr)) + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_DIFFUSE); + ok(SUCCEEDED(hr), "Failed to set FVF, hr %#x.\n", hr); + for (i = 0; i < 16; ++i) { - hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_DIFFUSE); - ok(SUCCEEDED(hr), "Failed to set FVF, hr %#x.\n", hr); - for (i = 0; i < 16; ++i) - { - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_STENCILREF, i); - ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState returned %08x\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_STENCILREF, i); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); - painter[0].diffuse = (i * 16); /* Creates shades of blue */ - painter[1].diffuse = (i * 16); - painter[2].diffuse = (i * 16); - painter[3].diffuse = (i * 16); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, painter, sizeof(painter[0])); - ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr); - } - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_EndScene returned %08x\n", hr); + painter[0].diffuse = (i * 16); /* Creates shades of blue */ + painter[1].diffuse = (i * 16); + painter[2].diffuse = (i * 16); + painter[3].diffuse = (i * 16); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, painter, sizeof(painter[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); hr = IDirect3DDevice9_SetRenderState(device, D3DRS_STENCILENABLE, FALSE); ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState returned %08x\n", hr); @@ -8922,13 +9366,27 @@ ok(hr == D3D_OK, "IDirect3DDevice9_Present failed with %08x\n", hr); cleanup: - cleanup_device(device); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + IDirect3D9_Release(d3d); + DestroyWindow(window); } -static void vpos_register_test(IDirect3DDevice9 *device) +static void vpos_register_test(void) { - HRESULT hr; + IDirect3DSurface9 *surface = NULL, *backbuffer; + IDirect3DPixelShader9 *shader, *shader_frac; + IDirect3DVertexShader9 *vshader; + IDirect3DDevice9 *device; + D3DLOCKED_RECT lr; + IDirect3D9 *d3d; + ULONG refcount; + D3DCAPS9 caps; DWORD color; + HWND window; + HRESULT hr; + DWORD *pos; + static const DWORD shader_code[] = { 0xffff0300, /* ps_3_0 */ @@ -8960,20 +9418,35 @@ 0x02000001, 0xe00f0000, 0x90e40000, /* mov o0, v0 */ 0x0000ffff /* end */ }; - IDirect3DVertexShader9 *vshader; - IDirect3DPixelShader9 *shader, *shader_frac; - IDirect3DSurface9 *surface = NULL, *backbuffer; - const float quad[] = { - -1.0, -1.0, 0.1, 0.0, 0.0, - 1.0, -1.0, 0.1, 1.0, 0.0, - -1.0, 1.0, 0.1, 0.0, 1.0, - 1.0, 1.0, 0.1, 1.0, 1.0, + static const float quad[] = + { + -1.0f, -1.0f, 0.1f, 0.0f, 0.0f, + -1.0f, 1.0f, 0.1f, 0.0f, 1.0f, + 1.0f, -1.0f, 0.1f, 1.0f, 0.0f, + 1.0f, 1.0f, 0.1f, 1.0f, 1.0f, }; - D3DLOCKED_RECT lr; float constant[4] = {1.0, 0.0, 320, 240}; - DWORD *pos; - hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff0000ff, 0.0, 0); + 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"); + goto done; + } + + hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); + if (caps.PixelShaderVersion < D3DPS_VERSION(3, 0) || caps.VertexShaderVersion < D3DVS_VERSION(3, 0)) + { + skip("No shader model 3 support, skipping tests.\n"); + IDirect3DDevice9_Release(device); + goto done; + } + + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff0000ff, 1.0f, 0); ok(hr == D3D_OK, "IDirect3DDevice9_Clear failed, hr=%08x\n", hr); hr = IDirect3DDevice9_CreateVertexShader(device, vshader_code, &vshader); ok(hr == D3D_OK, "IDirect3DDevice9_CreateVertexShader failed hr=%08x\n", hr); @@ -8991,15 +9464,13 @@ ok(hr == D3D_OK, "IDirect3DDevice9_GetBackBuffer failed hr=%08x\n", hr); hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene failed hr=%08x\n", hr); - if(SUCCEEDED(hr)) { - hr = IDirect3DDevice9_SetPixelShaderConstantF(device, 0, constant, 1); - ok(hr == D3D_OK, "IDirect3DDevice9_SetPixelShaderConstantF failed hr=%08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(float) * 5); - ok(hr == D3D_OK, "IDirect3DDevice9_DrawPrimitiveUP failed, hr=%08x\n", hr); - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_EndScene failed hr=%08x\n", hr); - } + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetPixelShaderConstantF(device, 0, constant, 1); + ok(SUCCEEDED(hr), "Failed to set pixel shader constant, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(float) * 5); + 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); /* This has to be pixel exact */ color = getPixelColor(device, 319, 239); @@ -9016,18 +9487,17 @@ &surface, NULL); ok(hr == D3D_OK, "IDirect3DDevice9_CreateRenderTarget failed hr=%08x\n", hr); hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene failed hr=%08x\n", hr); - if(SUCCEEDED(hr)) { - constant[2] = 16; constant[3] = 16; - hr = IDirect3DDevice9_SetPixelShaderConstantF(device, 0, constant, 1); - ok(hr == D3D_OK, "IDirect3DDevice9_SetPixelShaderConstantF failed hr=%08x\n", hr); - hr = IDirect3DDevice9_SetRenderTarget(device, 0, surface); - ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderTarget failed, hr=%08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(float) * 5); - ok(hr == D3D_OK, "IDirect3DDevice9_DrawPrimitiveUP failed, hr=%08x\n", hr); - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_EndScene failed hr=%08x\n", hr); - } + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + constant[2] = 16; constant[3] = 16; + hr = IDirect3DDevice9_SetPixelShaderConstantF(device, 0, constant, 1); + ok(SUCCEEDED(hr), "Failed to set pixel shader constant, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderTarget(device, 0, surface); + ok(SUCCEEDED(hr), "Failed to set render target, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(float) * 5); + 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 = IDirect3DSurface9_LockRect(surface, &lr, NULL, D3DLOCK_READONLY); ok(hr == D3D_OK, "IDirect3DSurface9_LockRect failed, hr=%08x\n", hr); @@ -9053,15 +9523,14 @@ hr = IDirect3DDevice9_SetPixelShader(device, shader_frac); ok(hr == D3D_OK, "IDirect3DDevice9_SetPixelShader failed hr=%08x\n", hr); hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene failed hr=%08x\n", hr); - if(SUCCEEDED(hr)) { - hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff0000ff, 0.0, 0); - ok(hr == D3D_OK, "IDirect3DDevice9_Clear failed, hr=%08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(float) * 5); - ok(hr == D3D_OK, "IDirect3DDevice9_DrawPrimitiveUP failed, hr=%08x\n", hr); - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_EndScene failed hr=%08x\n", hr); - } + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff0000ff, 0.0, 0); + ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(float) * 5); + 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_SetRenderTarget(device, 0, backbuffer); ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderTarget failed, hr=%08x\n", hr); @@ -9084,6 +9553,11 @@ IDirect3DVertexShader9_Release(vshader); if(surface) IDirect3DSurface9_Release(surface); IDirect3DSurface9_Release(backbuffer); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } static BOOL point_match(IDirect3DDevice9 *device, UINT x, UINT y, UINT r) @@ -9106,141 +9580,149 @@ return TRUE; } -static void pointsize_test(IDirect3DDevice9 *device) +static void pointsize_test(void) { - HRESULT hr; - D3DCAPS9 caps; - D3DMATRIX matrix; - D3DMATRIX identity; - float ptsize, ptsize_orig, ptsizemax_orig, ptsizemin_orig; - DWORD color; + float ptsize, ptsizemax_orig, ptsizemin_orig; IDirect3DSurface9 *rt, *backbuffer; IDirect3DTexture9 *tex1, *tex2; - RECT rect = {0, 0, 128, 128}; + IDirect3DDevice9 *device; D3DLOCKED_RECT lr; - const DWORD tex1_data[4] = {0x00ff0000, 0x00ff0000, - 0x00000000, 0x00000000}; - const DWORD tex2_data[4] = {0x00000000, 0x0000ff00, - 0x00000000, 0x0000ff00}; - - const float vertices[] = { - 64, 64, 0.1, - 128, 64, 0.1, - 192, 64, 0.1, - 256, 64, 0.1, - 320, 64, 0.1, - 384, 64, 0.1, - 448, 64, 0.1, - 512, 64, 0.1, - }; - - /* Transforms the coordinate system [-1.0;1.0]x[-1.0;1.0] to [0.0;0.0]x[640.0;480.0]. Z is untouched */ - U(matrix).m[0][0] = 2.0/640.0; U(matrix).m[1][0] = 0.0; U(matrix).m[2][0] = 0.0; U(matrix).m[3][0] =-1.0; - U(matrix).m[0][1] = 0.0; U(matrix).m[1][1] =-2.0/480.0; U(matrix).m[2][1] = 0.0; U(matrix).m[3][1] = 1.0; - U(matrix).m[0][2] = 0.0; U(matrix).m[1][2] = 0.0; U(matrix).m[2][2] = 1.0; U(matrix).m[3][2] = 0.0; - U(matrix).m[0][3] = 0.0; U(matrix).m[1][3] = 0.0; U(matrix).m[2][3] = 0.0; U(matrix).m[3][3] = 1.0; - - U(identity).m[0][0] = 1.0; U(identity).m[1][0] = 0.0; U(identity).m[2][0] = 0.0; U(identity).m[3][0] = 0.0; - U(identity).m[0][1] = 0.0; U(identity).m[1][1] = 1.0; U(identity).m[2][1] = 0.0; U(identity).m[3][1] = 0.0; - U(identity).m[0][2] = 0.0; U(identity).m[1][2] = 0.0; U(identity).m[2][2] = 1.0; U(identity).m[3][2] = 0.0; - U(identity).m[0][3] = 0.0; U(identity).m[1][3] = 0.0; U(identity).m[2][3] = 0.0; U(identity).m[3][3] = 1.0; + IDirect3D9 *d3d; + D3DCOLOR color; + ULONG refcount; + D3DCAPS9 caps; + HWND window; + HRESULT hr; + + static const RECT rect = {0, 0, 128, 128}; + static const DWORD tex1_data[4] = {0x00ff0000, 0x00ff0000, 0x00000000, 0x00000000}; + static const DWORD tex2_data[4] = {0x00000000, 0x0000ff00, 0x00000000, 0x0000ff00}; + static const float vertices[] = + { + 64.0f, 64.0f, 0.1f, + 128.0f, 64.0f, 0.1f, + 192.0f, 64.0f, 0.1f, + 256.0f, 64.0f, 0.1f, + 320.0f, 64.0f, 0.1f, + 384.0f, 64.0f, 0.1f, + 448.0f, 64.0f, 0.1f, + 512.0f, 64.0f, 0.1f, + }; + /* Transforms the coordinate system [-1.0;1.0]x[-1.0;1.0] to + * [0.0;0.0]x[640.0;480.0]. Z is untouched. */ + D3DMATRIX matrix = + {{{ + 2.0f / 640.0f, 0.0f, 0.0f, 0.0f, + 0.0f, -2.0 / 480.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + -1.0f, 1.0f, 0.0f, 1.0f, + }}}; + + 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"); + goto done; + } memset(&caps, 0, sizeof(caps)); hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); ok(hr == D3D_OK, "IDirect3DDevice9_GetDeviceCaps failed hr=%08x\n", hr); if(caps.MaxPointSize < 32.0) { skip("MaxPointSize < 32.0, skipping(MaxPointsize = %f)\n", caps.MaxPointSize); - return; + IDirect3DDevice9_Release(device); + goto done; } - hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff0000ff, 0.0, 0); + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff0000ff, 1.0f, 0); ok(hr == D3D_OK, "IDirect3DDevice9_Clear failed, hr=%08x\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_LIGHTING, FALSE); + ok(SUCCEEDED(hr), "Failed to disable lighting, hr %#x.\n", hr); hr = IDirect3DDevice9_SetTransform(device, D3DTS_PROJECTION, &matrix); ok(hr == D3D_OK, "IDirect3DDevice9_SetTransform failed, hr=%08x\n", hr); hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ); ok(hr == D3D_OK, "IDirect3DDevice9_SetFVF failed hr=%08x\n", hr); - hr = IDirect3DDevice9_GetRenderState(device, D3DRS_POINTSIZE, (DWORD *) &ptsize_orig); - ok(hr == D3D_OK, "IDirect3DDevice9_GetRenderState failed hr=%08x\n", hr); hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene failed hr=%08x\n", hr); - if (SUCCEEDED(hr)) - { - ptsize = 15.0; - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSIZE, *((DWORD *) (&ptsize))); - ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState failed, hr=%08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_POINTLIST, 1, &vertices[0], sizeof(float) * 3); - ok(hr == D3D_OK, "IDirect3DDevice9_DrawPrimitiveUP failed, hr=%08x\n", hr); - - ptsize = 31.0; - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSIZE, *((DWORD *) (&ptsize))); - ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState failed, hr=%08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_POINTLIST, 1, &vertices[3], sizeof(float) * 3); - ok(hr == D3D_OK, "IDirect3DDevice9_DrawPrimitiveUP failed, hr=%08x\n", hr); - - ptsize = 30.75; - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSIZE, *((DWORD *) (&ptsize))); - ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState failed, hr=%08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_POINTLIST, 1, &vertices[6], sizeof(float) * 3); - ok(hr == D3D_OK, "IDirect3DDevice9_DrawPrimitiveUP failed, hr=%08x\n", hr); - - if (caps.MaxPointSize >= 63.0) - { - ptsize = 63.0; - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSIZE, *((DWORD *) (&ptsize))); - ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState failed, hr=%08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_POINTLIST, 1, &vertices[9], sizeof(float) * 3); - ok(hr == D3D_OK, "IDirect3DDevice9_DrawPrimitiveUP failed, hr=%08x\n", hr); - - ptsize = 62.75; - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSIZE, *((DWORD *) (&ptsize))); - ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState failed, hr=%08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_POINTLIST, 1, &vertices[15], sizeof(float) * 3); - ok(hr == D3D_OK, "IDirect3DDevice9_DrawPrimitiveUP failed, hr=%08x\n", hr); - } - - ptsize = 1.0; - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSIZE, *((DWORD *) (&ptsize))); - ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState failed, hr=%08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_POINTLIST, 1, &vertices[12], sizeof(float) * 3); - ok(hr == D3D_OK, "IDirect3DDevice9_DrawPrimitiveUP failed, hr=%08x\n", hr); - - hr = IDirect3DDevice9_GetRenderState(device, D3DRS_POINTSIZE_MAX, (DWORD *) (&ptsizemax_orig)); - ok(hr == D3D_OK, "IDirect3DDevice9_GetRenderState failed, hr=%08x\n", hr); - hr = IDirect3DDevice9_GetRenderState(device, D3DRS_POINTSIZE_MIN, (DWORD *) (&ptsizemin_orig)); - ok(hr == D3D_OK, "IDirect3DDevice9_GetRenderState failed, hr=%08x\n", hr); - - /* What happens if point scaling is disabled, and POINTSIZE_MAX < POINTSIZE? */ - ptsize = 15.0; - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSIZE, *((DWORD *) (&ptsize))); - ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState failed, hr=%08x\n", hr); - ptsize = 1.0; - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSIZE_MAX, *((DWORD *) (&ptsize))); - ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState failed, hr=%08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_POINTLIST, 1, &vertices[18], sizeof(float) * 3); - ok(hr == D3D_OK, "IDirect3DDevice9_DrawPrimitiveUP failed, hr=%08x\n", hr); - - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSIZE_MAX, *((DWORD *) (&ptsizemax_orig))); - ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState failed, hr=%08x\n", hr); - - /* pointsize < pointsize_min < pointsize_max? - * pointsize = 1.0, pointsize_min = 15.0, pointsize_max = default(usually 64.0) */ - ptsize = 1.0; - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSIZE, *((DWORD *) (&ptsize))); - ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState failed, hr=%08x\n", hr); - ptsize = 15.0; - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSIZE_MIN, *((DWORD *) (&ptsize))); - ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState failed, hr=%08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_POINTLIST, 1, &vertices[21], sizeof(float) * 3); - ok(hr == D3D_OK, "IDirect3DDevice9_DrawPrimitiveUP failed, hr=%08x\n", hr); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + + ptsize = 15.0f; + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSIZE, *(DWORD *)&ptsize); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_POINTLIST, 1, &vertices[0], sizeof(float) * 3); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSIZE_MIN, *((DWORD *) (&ptsizemin_orig))); - ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState failed, hr=%08x\n", hr); + ptsize = 31.0f; + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSIZE, *(DWORD *)&ptsize); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_POINTLIST, 1, &vertices[3], sizeof(float) * 3); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_EndScene failed hr=%08x\n", hr); + ptsize = 30.75f; + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSIZE, *(DWORD *)&ptsize); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_POINTLIST, 1, &vertices[6], sizeof(float) * 3); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + + if (caps.MaxPointSize >= 63.0f) + { + ptsize = 63.0f; + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSIZE, *(DWORD *)&ptsize); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_POINTLIST, 1, &vertices[9], sizeof(float) * 3); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + + ptsize = 62.75f; + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSIZE, *(DWORD *)&ptsize); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_POINTLIST, 1, &vertices[15], sizeof(float) * 3); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); } + ptsize = 1.0f; + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSIZE, *(DWORD *)&ptsize); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_POINTLIST, 1, &vertices[12], sizeof(float) * 3); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + + hr = IDirect3DDevice9_GetRenderState(device, D3DRS_POINTSIZE_MAX, (DWORD *)&ptsizemax_orig); + ok(SUCCEEDED(hr), "Failed to get render state, hr %#x.\n", hr); + hr = IDirect3DDevice9_GetRenderState(device, D3DRS_POINTSIZE_MIN, (DWORD *)&ptsizemin_orig); + ok(SUCCEEDED(hr), "Failed to get render state, hr %#x.\n", hr); + + /* What happens if point scaling is disabled, and POINTSIZE_MAX < POINTSIZE? */ + ptsize = 15.0f; + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSIZE, *(DWORD *)&ptsize); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + ptsize = 1.0f; + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSIZE_MAX, *(DWORD *)&ptsize); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_POINTLIST, 1, &vertices[18], sizeof(float) * 3); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSIZE_MAX, *(DWORD *)&ptsizemax_orig); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + + /* pointsize < pointsize_min < pointsize_max? + * pointsize = 1.0, pointsize_min = 15.0, pointsize_max = default(usually 64.0) */ + ptsize = 1.0f; + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSIZE, *(DWORD *)&ptsize); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + ptsize = 15.0f; + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSIZE_MIN, *(DWORD *)&ptsize); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_POINTLIST, 1, &vertices[21], sizeof(float) * 3); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSIZE_MIN, *(DWORD *)&ptsizemin_orig); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + ok(point_match(device, 64, 64, 7), "point_match(64, 64, 7) failed, expected point size 15.\n"); ok(point_match(device, 128, 64, 15), "point_match(128, 64, 15) failed, expected point size 31.\n"); ok(point_match(device, 192, 64, 15), "point_match(192, 64, 15) failed, expected point size 31.\n"); @@ -9266,7 +9748,7 @@ * is no point sprite cap bit in d3d because native d3d software emulates point sprites. Until the * SW emulation is implemented in wined3d, this test will fail on GL drivers that does not support them. */ - hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff0000ff, 0.0, 0); + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff0000ff, 1.0f, 0); ok(hr == D3D_OK, "IDirect3DDevice9_Clear failed, hr=%08x\n", hr); hr = IDirect3DDevice9_CreateTexture(device, 2, 2, 1, 0, D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, &tex1, NULL); @@ -9307,14 +9789,11 @@ ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState failed, hr=%08x\n", hr); hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene failed, hr=%08x\n", hr); - if(SUCCEEDED(hr)) - { - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_POINTLIST, 1, &vertices[0], sizeof(float) * 3); - ok(hr == D3D_OK, "IDirect3DDevice9_DrawPrimitiveUP failed, hr=%08x\n", hr); - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_EndScene failed, hr=%08x\n", hr); - } + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_POINTLIST, 1, &vertices[0], sizeof(float) * 3); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); color = getPixelColor(device, 64-4, 64-4); ok(color == 0x00ff0000, "pSprite: Pixel (64-4),(64-4) has color 0x%08x, expected 0x00ff0000\n", color); @@ -9340,7 +9819,7 @@ hr = IDirect3DDevice9_SetRenderTarget(device, 0, rt); ok(SUCCEEDED(hr), "SetRenderTarget failed, hr %#x.\n", hr); - hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff00ffff, 0.0f, 0); + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff00ffff, 1.0f, 0); ok(SUCCEEDED(hr), "Clear failed, hr %#x.\n", hr); hr = IDirect3DDevice9_BeginScene(device); @@ -9373,27 +9852,30 @@ hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); ok(SUCCEEDED(hr), "Present failed, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_DISABLE); - ok(hr == D3D_OK, "IDirect3DDevice9_SetTextureStageState failed hr=%08x\n", hr); - hr = IDirect3DDevice9_SetTextureStageState(device, 1, D3DTSS_COLOROP, D3DTOP_DISABLE); - ok(hr == D3D_OK, "IDirect3DDevice9_SetTextureStageState failed hr=%08x\n", hr); - hr = IDirect3DDevice9_SetTexture(device, 0, NULL); - ok(hr == D3D_OK, "IDirect3DDevice9_SetTexture failed hr=%08x\n", hr); - hr = IDirect3DDevice9_SetTexture(device, 1, NULL); - ok(hr == D3D_OK, "IDirect3DDevice9_SetTexture failed hr=%08x\n", hr); IDirect3DTexture9_Release(tex1); IDirect3DTexture9_Release(tex2); - - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSPRITEENABLE, FALSE); - ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState failed hr=%08x\n", hr); - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSIZE, *((DWORD *) (&ptsize_orig))); - ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState failed hr=%08x\n", hr); - hr = IDirect3DDevice9_SetTransform(device, D3DTS_PROJECTION, &identity); - ok(hr == D3D_OK, "IDirect3DDevice9_SetTransform failed, hr=%08x\n", hr); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } -static void multiple_rendertargets_test(IDirect3DDevice9 *device) +static void multiple_rendertargets_test(void) { + IDirect3DSurface9 *surf1, *surf2, *backbuf, *readback; + IDirect3DPixelShader9 *ps1, *ps2; + IDirect3DTexture9 *tex1, *tex2; + IDirect3DVertexShader9 *vs; + IDirect3DDevice9 *device; + IDirect3D9 *d3d; + ULONG refcount; + D3DCAPS9 caps; + DWORD color; + HWND window; + HRESULT hr; + UINT i, j; + static const DWORD vshader_code[] = { 0xfffe0300, /* vs_3_0 */ @@ -9418,42 +9900,52 @@ 0x02000001, 0x800f0801, 0xa0e40001, /* mov oC1, c1 */ 0x0000ffff /* end */ }; + static const float 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 float texquad[] = + { + -1.0f, -1.0f, 0.1f, 0.0f, 0.0f, + -1.0f, 1.0f, 0.1f, 0.0f, 1.0f, + 0.0f, -1.0f, 0.1f, 1.0f, 0.0f, + 0.0f, 1.0f, 0.1f, 1.0f, 1.0f, + + 0.0f, -1.0f, 0.1f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.1f, 0.0f, 1.0f, + 1.0f, -1.0f, 0.1f, 1.0f, 0.0f, + 1.0f, 1.0f, 0.1f, 1.0f, 1.0f, + }; + + 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"); + goto done; + } - HRESULT hr; - IDirect3DVertexShader9 *vs; - IDirect3DPixelShader9 *ps1, *ps2; - IDirect3DTexture9 *tex1, *tex2; - IDirect3DSurface9 *surf1, *surf2, *backbuf, *readback; - D3DCAPS9 caps; - DWORD color; - UINT i, j; - float quad[] = { - -1.0, -1.0, 0.1, - 1.0, -1.0, 0.1, - -1.0, 1.0, 0.1, - 1.0, 1.0, 0.1, - }; - float texquad[] = { - -1.0, -1.0, 0.1, 0.0, 0.0, - 0.0, -1.0, 0.1, 1.0, 0.0, - -1.0, 1.0, 0.1, 0.0, 1.0, - 0.0, 1.0, 0.1, 1.0, 1.0, - - 0.0, -1.0, 0.1, 0.0, 0.0, - 1.0, -1.0, 0.1, 1.0, 0.0, - 0.0, 1.0, 0.1, 0.0, 1.0, - 1.0, 1.0, 0.1, 1.0, 1.0, - }; - - memset(&caps, 0, sizeof(caps)); hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); - ok(hr == D3D_OK, "IDirect3DDevice9_GetCaps failed, hr=%08x\n", hr); - if(caps.NumSimultaneousRTs < 2) { - skip("Only 1 simultaneous render target supported, skipping MRT test\n"); - return; + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); + if (caps.NumSimultaneousRTs < 2) + { + skip("Only 1 simultaneous render target supported, skipping MRT test.\n"); + IDirect3DDevice9_Release(device); + goto done; + } + if (caps.PixelShaderVersion < D3DPS_VERSION(3, 0) || caps.VertexShaderVersion < D3DVS_VERSION(3, 0)) + { + skip("No shader model 3 support, skipping tests.\n"); + IDirect3DDevice9_Release(device); + goto done; } - hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xffff0000, 0.0, 0); + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xffff0000, 1.0f, 0); ok(hr == D3D_OK, "IDirect3DDevice9_Clear failed, hr=%08x\n", hr); hr = IDirect3DDevice9_CreateOffscreenPlainSurface(device, 16, 16, @@ -9545,38 +10037,36 @@ ok(SUCCEEDED(hr), "Failed to set pixel shader, hr %#x.\n", hr); hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene failed, hr=%08x\n", hr); - if(SUCCEEDED(hr)) { - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 3 * sizeof(float)); - ok(hr == D3D_OK, "IDirect3DDevice9_DrawPrimitiveUP failed, hr=%08x\n", hr); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetVertexShader(device, NULL); - ok(SUCCEEDED(hr), "SetVertexShader failed, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetPixelShader(device, NULL); - ok(hr == D3D_OK, "IDirect3DDevice9_SetPixelShader failed, hr=%08x\n", hr); - hr = IDirect3DDevice9_SetRenderTarget(device, 0, backbuf); - ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderTarget failed, hr=%08x\n", hr); - hr = IDirect3DDevice9_SetRenderTarget(device, 1, NULL); - ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderTarget failed, hr=%08x\n", hr); - hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_TEX1); - ok(hr == D3D_OK, "IDirect3DDevice9_SetFVF failed, hr=%08x\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 3 * sizeof(float)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_LIGHTING, FALSE); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetVertexShader(device, NULL); + ok(SUCCEEDED(hr), "Failed to set vertex shader, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetPixelShader(device, NULL); + ok(SUCCEEDED(hr), "Failed to set pixel shader, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderTarget(device, 0, backbuf); + ok(SUCCEEDED(hr), "Failed to set render target, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderTarget(device, 1, NULL); + ok(SUCCEEDED(hr), "Failed to set render target, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_TEX1); + ok(SUCCEEDED(hr), "Failed to set FVF, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetTexture(device, 0, (IDirect3DBaseTexture9 *) tex1); - ok(hr == D3D_OK, "IDirect3DDevice9_SetTexture failed, hr=%08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, &texquad[0], 5 * sizeof(float)); - ok(hr == D3D_OK, "IDirect3DDevice9_DrawPrimitiveUP failed, hr=%08x\n", hr); - - hr = IDirect3DDevice9_SetTexture(device, 0, (IDirect3DBaseTexture9 *) tex2); - ok(hr == D3D_OK, "IDirect3DDevice9_SetTexture failed, hr=%08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, &texquad[20], 5 * sizeof(float)); - ok(hr == D3D_OK, "IDirect3DDevice9_DrawPrimitiveUP failed, hr=%08x\n", hr); + hr = IDirect3DDevice9_SetTexture(device, 0, (IDirect3DBaseTexture9 *) tex1); + ok(SUCCEEDED(hr), "Failed to set texture, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, &texquad[0], 5 * sizeof(float)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetTexture(device, 0, NULL); - ok(hr == D3D_OK, "IDirect3DDevice9_SetTexture failed, hr=%08x\n", hr); + hr = IDirect3DDevice9_SetTexture(device, 0, (IDirect3DBaseTexture9 *) tex2); + ok(SUCCEEDED(hr), "Failed to set texture, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, &texquad[20], 5 * sizeof(float)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_EndScene failed, hr=%08x\n", hr); - } + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); color = getPixelColor(device, 160, 240); ok(color == 0x0000ff00, "Texture 1(output color 1) has color 0x%08x, expected 0x0000ff00\n", color); @@ -9593,67 +10083,80 @@ IDirect3DSurface9_Release(surf2); IDirect3DSurface9_Release(backbuf); IDirect3DSurface9_Release(readback); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } -struct formats { - const char *fmtName; - D3DFORMAT textureFormat; - DWORD resultColorBlending; - DWORD resultColorNoBlending; -}; - -static const struct formats test_formats[] = { - { "D3DFMT_G16R16", D3DFMT_G16R16, 0x001818ff, 0x002010ff}, - { "D3DFMT_R16F", D3DFMT_R16F, 0x0018ffff, 0x0020ffff }, - { "D3DFMT_G16R16F", D3DFMT_G16R16F, 0x001818ff, 0x002010ff }, - { "D3DFMT_A16B16G16R16F", D3DFMT_A16B16G16R16F, 0x00181800, 0x00201000 }, - { "D3DFMT_R32F", D3DFMT_R32F, 0x0018ffff, 0x0020ffff }, - { "D3DFMT_G32R32F", D3DFMT_G32R32F, 0x001818ff, 0x002010ff }, - { "D3DFMT_A32B32G32R32F", D3DFMT_A32B32G32R32F, 0x00181800, 0x00201000 }, - { NULL, 0 } -}; - -static void pixelshader_blending_test(IDirect3DDevice9 *device) +static void pixelshader_blending_test(void) { - HRESULT hr; - IDirect3DTexture9 *offscreenTexture = NULL; IDirect3DSurface9 *backbuffer = NULL, *offscreen = NULL; - IDirect3D9 *d3d = NULL; - DWORD color; + IDirect3DTexture9 *offscreenTexture = NULL; + IDirect3DDevice9 *device; + IDirect3D9 *d3d; + ULONG refcount; int fmt_index; + DWORD color; + HWND window; + HRESULT hr; - static const float quad[][5] = { + static const struct + { + const char *fmtName; + D3DFORMAT textureFormat; + D3DCOLOR resultColorBlending; + D3DCOLOR resultColorNoBlending; + } + test_formats[] = + { + {"D3DFMT_G16R16", D3DFMT_G16R16, 0x001818ff, 0x002010ff}, + {"D3DFMT_R16F", D3DFMT_R16F, 0x0018ffff, 0x0020ffff}, + {"D3DFMT_G16R16F", D3DFMT_G16R16F, 0x001818ff, 0x002010ff}, + {"D3DFMT_A16B16G16R16F", D3DFMT_A16B16G16R16F, 0x00181800, 0x00201000}, + {"D3DFMT_R32F", D3DFMT_R32F, 0x0018ffff, 0x0020ffff}, + {"D3DFMT_G32R32F", D3DFMT_G32R32F, 0x001818ff, 0x002010ff}, + {"D3DFMT_A32B32G32R32F", D3DFMT_A32B32G32R32F, 0x00181800, 0x00201000}, + }; + static const float quad[][5] = + { {-0.5f, -0.5f, 0.1f, 0.0f, 0.0f}, {-0.5f, 0.5f, 0.1f, 0.0f, 1.0f}, { 0.5f, -0.5f, 0.1f, 1.0f, 0.0f}, { 0.5f, 0.5f, 0.1f, 1.0f, 1.0f}, }; - /* Quad with R=0x10, G=0x20 */ - static const struct vertex quad1[] = { + static const struct vertex quad1[] = + { {-1.0f, -1.0f, 0.1f, 0x80102000}, {-1.0f, 1.0f, 0.1f, 0x80102000}, { 1.0f, -1.0f, 0.1f, 0x80102000}, { 1.0f, 1.0f, 0.1f, 0x80102000}, }; - /* Quad with R=0x20, G=0x10 */ - static const struct vertex quad2[] = { + static const struct vertex quad2[] = + { {-1.0f, -1.0f, 0.1f, 0x80201000}, {-1.0f, 1.0f, 0.1f, 0x80201000}, { 1.0f, -1.0f, 0.1f, 0x80201000}, { 1.0f, 1.0f, 0.1f, 0x80201000}, }; - IDirect3DDevice9_GetDirect3D(device, &d3d); + 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"); + goto done; + } hr = IDirect3DDevice9_GetBackBuffer(device, 0, 0, D3DBACKBUFFER_TYPE_MONO, &backbuffer); ok(hr == D3D_OK, "Can't get back buffer, hr = %08x\n", hr); - if(!backbuffer) { - goto out; - } - for(fmt_index=0; test_formats[fmt_index].textureFormat != 0; fmt_index++) + for (fmt_index = 0; fmt_index < sizeof(test_formats) / sizeof(*test_formats); ++fmt_index) { D3DFORMAT fmt = test_formats[fmt_index].textureFormat; @@ -9664,7 +10167,7 @@ continue; } - hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffffff, 0.0, 0); + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xffffffff, 1.0f, 0); ok(hr == D3D_OK, "Clear failed, hr = %08x\n", hr); hr = IDirect3DDevice9_CreateTexture(device, 128, 128, 1, D3DUSAGE_RENDERTARGET, fmt, D3DPOOL_DEFAULT, &offscreenTexture, NULL); @@ -9693,53 +10196,55 @@ hr = IDirect3DDevice9_SetRenderState(device, D3DRS_LIGHTING, FALSE); ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState returned %08x\n", hr); - /* Below we will draw two quads with different colors and try to blend them together. - * The result color is compared with the expected outcome. - */ - if(IDirect3DDevice9_BeginScene(device) == D3D_OK) { - hr = IDirect3DDevice9_SetRenderTarget(device, 0, offscreen); - ok(hr == D3D_OK, "SetRenderTarget failed, hr = %08x\n", hr); - hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0x00ffffff, 0.0, 0); - ok(hr == D3D_OK, "Clear failed, hr = %08x\n", hr); - - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ALPHABLENDENABLE, TRUE); - ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState failed, hr = %08x\n", hr); - - /* Draw a quad using color 0x0010200 */ - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_SRCBLEND, D3DBLEND_ONE); - ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState failed, hr = %08x\n", hr); - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_DESTBLEND, D3DBLEND_ZERO); - ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState failed, hr = %08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad1, sizeof(quad1[0])); - ok(hr == D3D_OK, "DrawPrimitiveUP failed, hr = %#08x\n", hr); - - /* Draw a quad using color 0x0020100 */ - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_SRCBLEND, D3DBLEND_SRCALPHA); - ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState failed, hr = %08x\n", hr); - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA); - ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState failed, hr = %08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad2, sizeof(quad2[0])); - ok(hr == D3D_OK, "DrawPrimitiveUP failed, hr = %#08x\n", hr); - - /* We don't want to blend the result on the backbuffer */ - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ALPHABLENDENABLE, FALSE); - ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState failed, hr = %08x\n", hr); - - /* Prepare rendering the 'blended' texture quad to the backbuffer */ - hr = IDirect3DDevice9_SetRenderTarget(device, 0, backbuffer); - ok(hr == D3D_OK, "SetRenderTarget failed, hr = %08x\n", hr); - hr = IDirect3DDevice9_SetTexture(device, 0, (IDirect3DBaseTexture9 *) offscreenTexture); - ok(hr == D3D_OK, "SetTexture failed, %08x\n", hr); - - hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_TEX1); - ok(hr == D3D_OK, "SetFVF failed, hr = %08x\n", hr); - - /* This time with the texture */ - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(quad[0])); - ok(hr == D3D_OK, "DrawPrimitiveUP failed, hr = %08x\n", hr); + /* Below we will draw two quads with different colors and try to blend + * them together. The result color is compared with the expected + * outcome. */ + hr = IDirect3DDevice9_BeginScene(device); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); - IDirect3DDevice9_EndScene(device); - } + hr = IDirect3DDevice9_SetRenderTarget(device, 0, offscreen); + ok(SUCCEEDED(hr), "Failed to set render target, hr %#x.\n", hr); + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0x00ffffff, 1.0f, 0); + ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ALPHABLENDENABLE, TRUE); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + + /* Draw a quad using color 0x0010200. */ + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_SRCBLEND, D3DBLEND_ONE); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_DESTBLEND, D3DBLEND_ZERO); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad1, sizeof(quad1[0])); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + + /* Draw a quad using color 0x0020100. */ + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_SRCBLEND, D3DBLEND_SRCALPHA); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad2, sizeof(quad2[0])); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + + /* We don't want to blend the result on the backbuffer. */ + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ALPHABLENDENABLE, FALSE); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + + /* Prepare rendering the 'blended' texture quad to the backbuffer. */ + hr = IDirect3DDevice9_SetRenderTarget(device, 0, backbuffer); + ok(SUCCEEDED(hr), "Failed to set render target, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetTexture(device, 0, (IDirect3DBaseTexture9 *)offscreenTexture); + ok(SUCCEEDED(hr), "Failed to set texture, hr %#x.\n", hr); + + hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_TEX1); + ok(SUCCEEDED(hr), "Failed to set FVF, hr %#x.\n", hr); + + /* This time with the texture. */ + 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); if (IDirect3D9_CheckDeviceFormat(d3d, 0, D3DDEVTYPE_HAL, D3DFMT_X8R8G8B8, D3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING, D3DRTYPE_TEXTURE, fmt) == D3D_OK) @@ -9773,35 +10278,52 @@ } } -out: - /* restore things */ - if(backbuffer) { - IDirect3DDevice9_SetRenderTarget(device, 0, backbuffer); - IDirect3DSurface9_Release(backbuffer); - } + IDirect3DSurface9_Release(backbuffer); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } -static void tssargtemp_test(IDirect3DDevice9 *device) +static void tssargtemp_test(void) { + IDirect3DDevice9 *device; + IDirect3D9 *d3d; + D3DCOLOR color; + ULONG refcount; + D3DCAPS9 caps; + HWND window; HRESULT hr; - DWORD color; - static const struct vertex quad[] = { - {-1.0, -1.0, 0.1, 0x00ff0000}, - { 1.0, -1.0, 0.1, 0x00ff0000}, - {-1.0, 1.0, 0.1, 0x00ff0000}, - { 1.0, 1.0, 0.1, 0x00ff0000} + + static const struct vertex quad[] = + { + {-1.0f, -1.0f, 0.1f, 0x00ff0000}, + {-1.0f, 1.0f, 0.1f, 0x00ff0000}, + { 1.0f, -1.0f, 0.1f, 0x00ff0000}, + { 1.0f, 1.0f, 0.1f, 0x00ff0000}, }; - D3DCAPS9 caps; + + 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"); + goto done; + } memset(&caps, 0, sizeof(caps)); hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); ok(hr == D3D_OK, "IDirect3DDevice9_GetDeviceCaps failed with %08x\n", hr); if(!(caps.PrimitiveMiscCaps & D3DPMISCCAPS_TSSARGTEMP)) { skip("D3DPMISCCAPS_TSSARGTEMP not supported\n"); - return; + IDirect3DDevice9_Release(device); + goto done; } - hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff000000, 0.0, 0); + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff000000, 1.0f, 0); ok(hr == D3D_OK, "IDirect3DDevice9_Clear failed with %08x\n", hr); hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1); @@ -9828,89 +10350,87 @@ hr = IDirect3DDevice9_SetRenderState(device, D3DRS_TEXTUREFACTOR, 0x0000ff00); ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState failed, hr = %08x\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_LIGHTING, FALSE); + ok(SUCCEEDED(hr), "Failed to disable lighting, hr %#x.\n", hr); hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_DIFFUSE); ok(hr == D3D_OK, "IDirect3DDevice9_SetFVF failed, hr = %08x\n", hr); hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene failed, hr = %08x\n", hr); - if(SUCCEEDED(hr)) { - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(quad[0])); - ok(hr == D3D_OK, "IDirect3DDevice9_DrawPrimitiveUP failed with %08x\n", hr); - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_EndScene failed, hr = %08x\n", hr); - } + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(quad[0])); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + color = getPixelColor(device, 320, 240); ok(color == 0x00ffff00, "TSSARGTEMP test returned color 0x%08x, expected 0x00ffff00\n", color); IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); - /* Set stage 1 back to default */ - hr = IDirect3DDevice9_SetTextureStageState(device, 1, D3DTSS_RESULTARG, D3DTA_CURRENT); - ok(hr == D3D_OK, "SetTextureStageState failed, hr = %08x\n", hr); - hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_DISABLE); - ok(hr == D3D_OK, "SetTextureStageState failed, hr = %08x\n", hr); - hr = IDirect3DDevice9_SetTextureStageState(device, 1, D3DTSS_COLOROP, D3DTOP_DISABLE); - ok(hr == D3D_OK, "SetTextureStageState failed, hr = %08x\n", hr); - hr = IDirect3DDevice9_SetTextureStageState(device, 2, D3DTSS_COLOROP, D3DTOP_DISABLE); - ok(hr == D3D_OK, "SetTextureStageState failed, hr = %08x\n", hr); - hr = IDirect3DDevice9_SetTextureStageState(device, 3, D3DTSS_COLOROP, D3DTOP_DISABLE); - ok(hr == D3D_OK, "SetTextureStageState failed, hr = %08x\n", hr); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } -struct testdata -{ - DWORD idxVertex; /* number of instances in the first stream */ - DWORD idxColor; /* number of instances in the second stream */ - DWORD idxInstance; /* should be 1 ?? */ - DWORD color1; /* color 1 instance */ - DWORD color2; /* color 2 instance */ - DWORD color3; /* color 3 instance */ - DWORD color4; /* color 4 instance */ - WORD strVertex; /* specify which stream to use 0-2*/ - WORD strColor; - WORD strInstance; -}; - -static const struct testdata testcases[]= -{ - {4, 4, 1, 0x00ff0000, 0x00ff0000, 0x00ff0000, 0x00ff0000, 0, 1, 2}, /* 0 */ - {3, 4, 1, 0x00ff0000, 0x00ff0000, 0x00ff0000, 0x00ffffff, 0, 1, 2}, /* 1 */ - {2, 4, 1, 0x00ff0000, 0x00ff0000, 0x00ffffff, 0x00ffffff, 0, 1, 2}, /* 2 */ - {1, 4, 1, 0x00ff0000, 0x00ffffff, 0x00ffffff, 0x00ffffff, 0, 1, 2}, /* 3 */ - {4, 3, 1, 0x00ff0000, 0x00ff0000, 0x00ff0000, 0x00ff0000, 0, 1, 2}, /* 4 */ - {4, 2, 1, 0x00ff0000, 0x00ff0000, 0x00ff0000, 0x00ff0000, 0, 1, 2}, /* 5 */ - {4, 1, 1, 0x00ff0000, 0x00ff0000, 0x00ff0000, 0x00ff0000, 0, 1, 2}, /* 6 */ - {4, 0, 1, 0x00ff0000, 0x00ff0000, 0x00ff0000, 0x00ff0000, 0, 1, 2}, /* 7 */ - {3, 3, 1, 0x00ff0000, 0x00ff0000, 0x00ff0000, 0x00ffffff, 0, 1, 2}, /* 8 */ - {4, 4, 1, 0x00ff0000, 0x00ff0000, 0x00ff0000, 0x00ff0000, 1, 0, 2}, /* 9 */ - {4, 4, 1, 0x00ff0000, 0x00ff0000, 0x00ff0000, 0x00ff0000, 0, 2, 1}, /* 10 */ - {4, 4, 1, 0x00ff0000, 0x00ffffff, 0x00ffffff, 0x00ffffff, 2, 3, 1}, /* 11 */ - {4, 4, 1, 0x00ff0000, 0x00ff0000, 0x00ff0000, 0x00ff0000, 2, 0, 1}, /* 12 */ - {4, 4, 1, 0x00ff0000, 0x00ff0000, 0x00ff0000, 0x00ff0000, 1, 2, 3}, /* 13 */ -/* - This draws one instance on some machines, no instance on others - {0, 4, 1, 0x00ff0000, 0x00ffffff, 0x00ffffff, 0x00ffffff, 0, 1, 2}, -*/ -/* - This case is handled in a stand alone test, SetStreamSourceFreq(0,(D3DSTREAMSOURCE_INSTANCEDATA | 1)) has to return D3DERR_INVALIDCALL! - {4, 4, 1, 0x00ffffff, 0x00ffffff, 0x00ffffff, 0x00ffffff, 2, 1, 0, D3DERR_INVALIDCALL}, -*/ -}; - /* Drawing Indexed Geometry with instances*/ -static void stream_test(IDirect3DDevice9 *device) +static void stream_test(void) { - IDirect3DVertexBuffer9 *vb = NULL; - IDirect3DVertexBuffer9 *vb2 = NULL; - IDirect3DVertexBuffer9 *vb3 = NULL; - IDirect3DIndexBuffer9 *ib = NULL; IDirect3DVertexDeclaration9 *pDecl = NULL; IDirect3DVertexShader9 *shader = NULL; + IDirect3DVertexBuffer9 *vb3 = NULL; + IDirect3DVertexBuffer9 *vb2 = NULL; + IDirect3DVertexBuffer9 *vb = NULL; + IDirect3DIndexBuffer9 *ib = NULL; + IDirect3DDevice9 *device; + IDirect3D9 *d3d; + ULONG refcount; + D3DCAPS9 caps; + DWORD color; + HWND window; + unsigned i; HRESULT hr; BYTE *data; - DWORD color; DWORD ind; - unsigned i; + static const struct testdata + { + DWORD idxVertex; /* number of instances in the first stream */ + DWORD idxColor; /* number of instances in the second stream */ + DWORD idxInstance; /* should be 1 ?? */ + DWORD color1; /* color 1 instance */ + DWORD color2; /* color 2 instance */ + DWORD color3; /* color 3 instance */ + DWORD color4; /* color 4 instance */ + WORD strVertex; /* specify which stream to use 0-2*/ + WORD strColor; + WORD strInstance; + } + testcases[]= + { + {4, 4, 1, 0x00ff0000, 0x00ff0000, 0x00ff0000, 0x00ff0000, 0, 1, 2}, /* 0 */ + {3, 4, 1, 0x00ff0000, 0x00ff0000, 0x00ff0000, 0x00ffffff, 0, 1, 2}, /* 1 */ + {2, 4, 1, 0x00ff0000, 0x00ff0000, 0x00ffffff, 0x00ffffff, 0, 1, 2}, /* 2 */ + {1, 4, 1, 0x00ff0000, 0x00ffffff, 0x00ffffff, 0x00ffffff, 0, 1, 2}, /* 3 */ + {4, 3, 1, 0x00ff0000, 0x00ff0000, 0x00ff0000, 0x00ff0000, 0, 1, 2}, /* 4 */ + {4, 2, 1, 0x00ff0000, 0x00ff0000, 0x00ff0000, 0x00ff0000, 0, 1, 2}, /* 5 */ + {4, 1, 1, 0x00ff0000, 0x00ff0000, 0x00ff0000, 0x00ff0000, 0, 1, 2}, /* 6 */ + {4, 0, 1, 0x00ff0000, 0x00ff0000, 0x00ff0000, 0x00ff0000, 0, 1, 2}, /* 7 */ + {3, 3, 1, 0x00ff0000, 0x00ff0000, 0x00ff0000, 0x00ffffff, 0, 1, 2}, /* 8 */ + {4, 4, 1, 0x00ff0000, 0x00ff0000, 0x00ff0000, 0x00ff0000, 1, 0, 2}, /* 9 */ + {4, 4, 1, 0x00ff0000, 0x00ff0000, 0x00ff0000, 0x00ff0000, 0, 2, 1}, /* 10 */ + {4, 4, 1, 0x00ff0000, 0x00ffffff, 0x00ffffff, 0x00ffffff, 2, 3, 1}, /* 11 */ + {4, 4, 1, 0x00ff0000, 0x00ff0000, 0x00ff0000, 0x00ff0000, 2, 0, 1}, /* 12 */ + {4, 4, 1, 0x00ff0000, 0x00ff0000, 0x00ff0000, 0x00ff0000, 1, 2, 3}, /* 13 */ +#if 0 + /* This draws one instance on some machines, no instance on others. */ + {0, 4, 1, 0x00ff0000, 0x00ffffff, 0x00ffffff, 0x00ffffff, 0, 1, 2}, /* 14 */ + /* This case is handled in a stand alone test, + * SetStreamSourceFreq(0, (D3DSTREAMSOURCE_INSTANCEDATA | 1)) has to + * return D3DERR_INVALIDCALL. */ + {4, 4, 1, 0x00ffffff, 0x00ffffff, 0x00ffffff, 0x00ffffff, 2, 1, 0}, /* 15 */ +#endif + }; static const DWORD shader_code[] = { 0xfffe0101, /* vs_1_1 */ @@ -9922,34 +10442,29 @@ 0x00000001, 0xd00f0000, 0x90e40001, /* mov oD0, v1 */ 0x0000ffff }; - - const float quad[][3] = + static const float quad[][3] = { {-0.5f, -0.5f, 1.1f}, /*0 */ {-0.5f, 0.5f, 1.1f}, /*1 */ { 0.5f, -0.5f, 1.1f}, /*2 */ { 0.5f, 0.5f, 1.1f}, /*3 */ }; - - const float vertcolor[][4] = + static const float vertcolor[][4] = { {1.0f, 0.0f, 0.0f, 1.0f}, /*0 */ {1.0f, 0.0f, 0.0f, 1.0f}, /*1 */ {1.0f, 0.0f, 0.0f, 1.0f}, /*2 */ {1.0f, 0.0f, 0.0f, 1.0f}, /*3 */ }; - /* 4 position for 4 instances */ - const float instancepos[][3] = + static const float instancepos[][3] = { {-0.6f,-0.6f, 0.0f}, { 0.6f,-0.6f, 0.0f}, { 0.6f, 0.6f, 0.0f}, {-0.6f, 0.6f, 0.0f}, }; - - short indices[] = {0, 1, 2, 1, 2, 3}; - + static const short indices[] = {0, 1, 2, 2, 1, 3}; D3DVERTEXELEMENT9 decl[] = { {0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0}, @@ -9958,6 +10473,25 @@ D3DDECL_END() }; + 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"); + goto done; + } + + hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); + if (caps.VertexShaderVersion < D3DVS_VERSION(3, 0)) + { + skip("No vs_3_0 support, skipping tests.\n"); + IDirect3DDevice9_Release(device); + goto done; + } + /* set the default value because it isn't done in wine? */ hr = IDirect3DDevice9_SetStreamSourceFreq(device, 1, 1); ok(hr == D3D_OK, "IDirect3DDevice9_SetStreamSourceFreq failed with %08x\n", hr); @@ -9997,7 +10531,8 @@ ok(hr == D3D_OK, "CreateVertexBuffer failed with %08x\n", hr); if(!vb) { skip("Failed to create a vertex buffer\n"); - return; + IDirect3DDevice9_Release(device); + goto done; } hr = IDirect3DDevice9_CreateVertexBuffer(device, sizeof(vertcolor), 0, 0, D3DPOOL_MANAGED, &vb2, NULL); ok(hr == D3D_OK, "CreateVertexBuffer failed with %08x\n", hr); @@ -10067,50 +10602,51 @@ hr = IDirect3DDevice9_CreateVertexDeclaration(device, decl, &pDecl); ok(SUCCEEDED(hr), "IDirect3DDevice9_CreateVertexDeclaration failed hr=%08x (case %i)\n", hr, i); - hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffffff, 0.0, 0); + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xffffffff, 1.0f, 0); ok(hr == D3D_OK, "IDirect3DDevice9_Clear failed with %08x (case %i)\n", hr, i); hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene failed with %08x (case %i)\n", hr, i); - if(SUCCEEDED(hr)) - { - hr = IDirect3DDevice9_SetVertexDeclaration(device, pDecl); - ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexDeclaration failed with %08x (case %i)\n", hr, i); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetStreamSourceFreq(device, act.strVertex, (D3DSTREAMSOURCE_INDEXEDDATA | act.idxVertex)); - ok(hr == D3D_OK, "IDirect3DDevice9_SetStreamSourceFreq failed with %08x (case %i)\n", hr, i); - hr = IDirect3DDevice9_SetStreamSource(device, act.strVertex, vb, 0, sizeof(quad[0])); - ok(hr == D3D_OK, "IDirect3DDevice9_SetStreamSource failed with %08x (case %i)\n", hr, i); - - hr = IDirect3DDevice9_SetStreamSourceFreq(device, act.strColor, (D3DSTREAMSOURCE_INDEXEDDATA | act.idxColor)); - ok(hr == D3D_OK, "IDirect3DDevice9_SetStreamSourceFreq failed with %08x (case %i)\n", hr, i); - hr = IDirect3DDevice9_SetStreamSource(device, act.strColor, vb2, 0, sizeof(vertcolor[0])); - ok(hr == D3D_OK, "IDirect3DDevice9_SetStreamSource failed with %08x (case %i)\n", hr, i); - - hr = IDirect3DDevice9_SetStreamSourceFreq(device, act.strInstance, (D3DSTREAMSOURCE_INSTANCEDATA | act.idxInstance)); - ok(hr == D3D_OK, "IDirect3DDevice9_SetStreamSourceFreq failed with %08x (case %i)\n", hr, i); - hr = IDirect3DDevice9_SetStreamSource(device, act.strInstance, vb3, 0, sizeof(instancepos[0])); - ok(hr == D3D_OK, "IDirect3DDevice9_SetStreamSource failed with %08x (case %i)\n", hr, i); + hr = IDirect3DDevice9_SetVertexDeclaration(device, pDecl); + ok(SUCCEEDED(hr), "Failed to set vertex declaration, hr %#x.\n", hr); - hr = IDirect3DDevice9_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, 0, 0, 4, 0, 2); - ok(hr == D3D_OK, "IDirect3DDevice9_DrawIndexedPrimitive failed with %08x (case %i)\n", hr, i); - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_EndScene failed with %08x (case %i)\n", hr, i); + hr = IDirect3DDevice9_SetStreamSourceFreq(device, act.strVertex, + (D3DSTREAMSOURCE_INDEXEDDATA | act.idxVertex)); + ok(SUCCEEDED(hr), "Failed to set stream source frequency, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetStreamSource(device, act.strVertex, vb, 0, sizeof(quad[0])); + ok(SUCCEEDED(hr), "Failed to set stream source, hr %#x.\n", hr); + + hr = IDirect3DDevice9_SetStreamSourceFreq(device, act.strColor, + (D3DSTREAMSOURCE_INDEXEDDATA | act.idxColor)); + ok(SUCCEEDED(hr), "Failed to set stream source frequency, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetStreamSource(device, act.strColor, vb2, 0, sizeof(vertcolor[0])); + ok(SUCCEEDED(hr), "Failed to set stream source, hr %#x.\n", hr); + + hr = IDirect3DDevice9_SetStreamSourceFreq(device, act.strInstance, + (D3DSTREAMSOURCE_INSTANCEDATA | act.idxInstance)); + ok(SUCCEEDED(hr), "Failed to set stream source frequency, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetStreamSource(device, act.strInstance, vb3, 0, sizeof(instancepos[0])); + ok(SUCCEEDED(hr), "Failed to set stream source, hr %#x.\n", hr); - /* set all StreamSource && StreamSourceFreq back to default */ - hr = IDirect3DDevice9_SetStreamSourceFreq(device, act.strVertex, 1); - ok(hr == D3D_OK, "IDirect3DDevice9_SetStreamSourceFreq failed with %08x (case %i)\n", hr, i); - hr = IDirect3DDevice9_SetStreamSource(device, act.strVertex, NULL, 0, 0); - ok(hr == D3D_OK, "IDirect3DDevice9_SetStreamSource failed with %08x (case %i)\n", hr, i); - hr = IDirect3DDevice9_SetStreamSourceFreq(device, act.idxColor, 1); - ok(hr == D3D_OK, "IDirect3DDevice9_SetStreamSourceFreq failed with %08x (case %i)\n", hr, i); - hr = IDirect3DDevice9_SetStreamSource(device, act.idxColor, NULL, 0, 0); - ok(hr == D3D_OK, "IDirect3DDevice9_SetStreamSource failed with %08x (case %i)\n", hr, i); - hr = IDirect3DDevice9_SetStreamSourceFreq(device, act.idxInstance, 1); - ok(hr == D3D_OK, "IDirect3DDevice9_SetStreamSourceFreq failed with %08x (case %i)\n", hr, i); - hr = IDirect3DDevice9_SetStreamSource(device, act.idxInstance, NULL, 0, 0); - ok(hr == D3D_OK, "IDirect3DDevice9_SetStreamSource failed with %08x (case %i)\n", hr, i); - } + hr = IDirect3DDevice9_DrawIndexedPrimitive(device, D3DPT_TRIANGLELIST, 0, 0, 4, 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); + + /* set all StreamSource && StreamSourceFreq back to default */ + hr = IDirect3DDevice9_SetStreamSourceFreq(device, act.strVertex, 1); + ok(SUCCEEDED(hr), "Failed to set stream source frequency, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetStreamSource(device, act.strVertex, NULL, 0, 0); + ok(SUCCEEDED(hr), "Failed to set stream source, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetStreamSourceFreq(device, act.idxColor, 1); + ok(SUCCEEDED(hr), "Failed to set stream source frequency, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetStreamSource(device, act.idxColor, NULL, 0, 0); + ok(SUCCEEDED(hr), "Failed to set stream source, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetStreamSourceFreq(device, act.idxInstance, 1); + ok(SUCCEEDED(hr), "Failed to set stream source frequency, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetStreamSource(device, act.idxInstance, NULL, 0, 0); + ok(SUCCEEDED(hr), "Failed to set stream source, hr %#x.\n", hr); hr = IDirect3DVertexDeclaration9_Release(pDecl); ok(hr == D3D_OK, "IDirect3DVertexDeclaration9_Release failed with %08x (case %i)\n", hr, i); @@ -10128,32 +10664,51 @@ ok(hr == D3D_OK, "IDirect3DDevice9_Present failed with %08x (case %i)\n", hr, i); } - hr = IDirect3DDevice9_SetIndices(device, NULL); - ok(hr == D3D_OK, "IDirect3DDevice9_SetIndices failed with %08x\n", hr); - out: if(vb) IDirect3DVertexBuffer9_Release(vb); if(vb2)IDirect3DVertexBuffer9_Release(vb2); if(vb3)IDirect3DVertexBuffer9_Release(vb3); if(ib)IDirect3DIndexBuffer9_Release(ib); if(shader)IDirect3DVertexShader9_Release(shader); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } -static void np2_stretch_rect_test(IDirect3DDevice9 *device) { +static void np2_stretch_rect_test(void) +{ IDirect3DSurface9 *src = NULL, *dst = NULL, *backbuffer = NULL; IDirect3DTexture9 *dsttex = NULL; + IDirect3DDevice9 *device; + IDirect3D9 *d3d; + D3DCOLOR color; + ULONG refcount; + HWND window; HRESULT hr; - DWORD color; - D3DRECT r1 = {0, 0, 50, 50 }; - D3DRECT r2 = {50, 0, 100, 50 }; - D3DRECT r3 = {50, 50, 100, 100}; - D3DRECT r4 = {0, 50, 50, 100}; - const float quad[] = { - -1.0, -1.0, 0.1, 0.0, 0.0, - 1.0, -1.0, 0.1, 1.0, 0.0, - -1.0, 1.0, 0.1, 0.0, 1.0, - 1.0, 1.0, 0.1, 1.0, 1.0, - }; + + static const D3DRECT r1 = {0, 0, 50, 50 }; + static const D3DRECT r2 = {50, 0, 100, 50 }; + static const D3DRECT r3 = {50, 50, 100, 100}; + static const D3DRECT r4 = {0, 50, 50, 100}; + static const float quad[] = + { + -1.0f, -1.0f, 0.1f, 0.0f, 0.0f, + -1.0f, 1.0f, 0.1f, 0.0f, 1.0f, + 1.0f, -1.0f, 0.1f, 1.0f, 0.0f, + 1.0f, 1.0f, 0.1f, 1.0f, 1.0f, + }; + + 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"); + goto done; + } hr = IDirect3DDevice9_GetBackBuffer(device, 0, 0, D3DBACKBUFFER_TYPE_MONO, &backbuffer); ok(hr == D3D_OK, "IDirect3DDevice9_GetBackBuffer failed with %08x\n", hr); @@ -10171,7 +10726,7 @@ hr = IDirect3DTexture9_GetSurfaceLevel(dsttex, 0, &dst); ok(hr == D3D_OK, "IDirect3DTexture9_GetSurfaceLevel failed with %08x\n", hr); - hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff00ffff, 0.0, 0); + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff00ffff, 1.0f, 0); ok(hr == D3D_OK, "IDirect3DDevice9_Clear failed with %08x\n", hr); /* Clear the StretchRect destination for debugging */ @@ -10212,13 +10767,11 @@ ok(hr == D3D_OK, "IDirect3DDevice9_SetTextureStageState failed with %08x\n", hr); hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene failed with %08x\n", hr); - if(SUCCEEDED(hr)) { - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(float) * 5); - ok(SUCCEEDED(hr), "DrawPrimitiveUP failed (%08x)\n", hr); - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_EndScene failed with %08x\n", hr); - } + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(float) * 5); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); color = getPixelColor(device, 160, 360); ok(color == 0x00ff0000, "stretchrect: Pixel 160,360 has color 0x%08x, expected 0x00ff0000\n", color); @@ -10231,24 +10784,28 @@ hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); ok(hr == D3D_OK, "IDirect3DDevice9_Present failed with %08x\n", hr); - hr = IDirect3DDevice9_SetTexture(device, 0, NULL); - ok(hr == D3D_OK, "IDirect3DDevice9_SetTexture failed with %08x\n", hr); - hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_DISABLE); - ok(hr == D3D_OK, "IDirect3DDevice9_SetTexture failed with %08x\n", hr); - cleanup: if(src) IDirect3DSurface9_Release(src); if(backbuffer) IDirect3DSurface9_Release(backbuffer); if(dsttex) IDirect3DTexture9_Release(dsttex); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } -static void texop_test(IDirect3DDevice9 *device) +static void texop_test(void) { IDirect3DVertexDeclaration9 *vertex_declaration = NULL; IDirect3DTexture9 *texture = NULL; D3DLOCKED_RECT locked_rect; + IDirect3DDevice9 *device; + IDirect3D9 *d3d; D3DCOLOR color; + ULONG refcount; D3DCAPS9 caps; + HWND window; HRESULT hr; unsigned i; @@ -10301,6 +10858,16 @@ {D3DTOP_LERP, "LERP", D3DTEXOPCAPS_LERP, D3DCOLOR_ARGB(0x00, 0x00, 0x33, 0x33)}, }; + 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"); + goto done; + } + memset(&caps, 0, sizeof(caps)); hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); ok(SUCCEEDED(hr), "GetDeviceCaps failed with 0x%08x\n", hr); @@ -10368,12 +10935,16 @@ ok(SUCCEEDED(hr), "Present failed with 0x%08x\n", hr); } - hr = IDirect3DDevice9_SetTexture(device, 0, NULL); IDirect3DTexture9_Release(texture); IDirect3DVertexDeclaration9_Release(vertex_declaration); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } -static void yuv_color_test(IDirect3DDevice9 *device) +static void yuv_color_test(void) { HRESULT hr; IDirect3DSurface9 *surface, *target; @@ -10382,7 +10953,10 @@ IDirect3D9 *d3d; D3DCOLOR color; D3DFORMAT skip_once = D3DFMT_UNKNOWN; + IDirect3DDevice9 *device; D3DSURFACE_DESC desc; + ULONG refcount; + HWND window; static const struct { @@ -10432,8 +11006,16 @@ {0x1c6b1cff, D3DFMT_YUY2, "D3DFMT_YUY2", 0x006dff45, 0x0000d500}, }; - hr = IDirect3DDevice9_GetDirect3D(device, &d3d); - ok(SUCCEEDED(hr), "Failed to get d3d9 interface, hr %#x.\n", hr); + 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"); + goto done; + } + hr = IDirect3DDevice9_GetRenderTarget(device, 0, &target); ok(SUCCEEDED(hr), "Failed to get render target, hr %#x.\n", hr); hr = IDirect3DSurface9_GetDesc(target, &desc); @@ -10505,10 +11087,14 @@ } IDirect3DSurface9_Release(target); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: IDirect3D9_Release(d3d); + DestroyWindow(window); } -static void yuv_layout_test(IDirect3DDevice9 *device) +static void yuv_layout_test(void) { HRESULT hr; IDirect3DSurface9 *surface, *target; @@ -10521,8 +11107,11 @@ DWORD ref_color; BYTE *buf, *chroma_buf, *u_buf, *v_buf; UINT width = 20, height = 16; + IDirect3DDevice9 *device; + ULONG refcount; D3DCAPS9 caps; D3DSURFACE_DESC desc; + HWND window; static const struct { @@ -10554,17 +11143,26 @@ { MAKEFOURCC('N','V','1','2'), "D3DFMT_NV12", }, }; + 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"); + goto done; + } + hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); ok(SUCCEEDED(hr), "GetDeviceCaps failed, hr %#x.\n", hr); if (caps.TextureCaps & D3DPTEXTURECAPS_POW2 && !(caps.TextureCaps & D3DPTEXTURECAPS_NONPOW2CONDITIONAL)) { skip("No NP2 texture support, skipping YUV texture layout test.\n"); - return; + IDirect3DDevice9_Release(device); + goto done; } - hr = IDirect3DDevice9_GetDirect3D(device, &d3d); - ok(hr == D3D_OK, "IDirect3DDevice9_GetDirect3D failed, hr = %#x.\n", hr); hr = IDirect3DDevice9_GetRenderTarget(device, 0, &target); ok(hr == D3D_OK, "IDirect3DDevice9_GetRenderTarget failed, hr = %#x.\n", hr); hr = IDirect3DSurface9_GetDesc(target, &desc); @@ -10679,40 +11277,68 @@ } IDirect3DSurface9_Release(target); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: IDirect3D9_Release(d3d); + DestroyWindow(window); } -static void texop_range_test(IDirect3DDevice9 *device) +static void texop_range_test(void) { - static const struct { + IDirect3DTexture9 *texture; + D3DLOCKED_RECT locked_rect; + IDirect3DDevice9 *device; + IDirect3D9 *d3d; + ULONG refcount; + D3DCAPS9 caps; + DWORD color; + HWND window; + HRESULT hr; + + static const struct + { float x, y, z; D3DCOLOR diffuse; - } quad[] = { + } + quad[] = + { {-1.0f, -1.0f, 0.1f, D3DCOLOR_ARGB(0xff, 0xff, 0xff, 0xff)}, {-1.0f, 1.0f, 0.1f, D3DCOLOR_ARGB(0xff, 0xff, 0xff, 0xff)}, { 1.0f, -1.0f, 0.1f, D3DCOLOR_ARGB(0xff, 0xff, 0xff, 0xff)}, { 1.0f, 1.0f, 0.1f, D3DCOLOR_ARGB(0xff, 0xff, 0xff, 0xff)} }; - HRESULT hr; - IDirect3DTexture9 *texture; - D3DLOCKED_RECT locked_rect; - D3DCAPS9 caps; - DWORD color; + + 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"); + goto done; + } /* We need ADD and SUBTRACT operations */ hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); ok(SUCCEEDED(hr), "GetDeviceCaps failed with 0x%08x\n", hr); - if (!(caps.TextureOpCaps & D3DTEXOPCAPS_ADD)) { - skip("D3DTOP_ADD is not supported, skipping value range test\n"); - return; + if (!(caps.TextureOpCaps & D3DTEXOPCAPS_ADD)) + { + skip("D3DTOP_ADD is not supported, skipping value range test.\n"); + IDirect3DDevice9_Release(device); + goto done; } - if (!(caps.TextureOpCaps & D3DTEXOPCAPS_SUBTRACT)) { - skip("D3DTEXOPCAPS_SUBTRACT is not supported, skipping value range test\n"); - return; + if (!(caps.TextureOpCaps & D3DTEXOPCAPS_SUBTRACT)) + { + skip("D3DTEXOPCAPS_SUBTRACT is not supported, skipping value range test.\n"); + IDirect3DDevice9_Release(device); + goto done; } hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_DIFFUSE); ok(SUCCEEDED(hr), "SetFVF failed with 0x%08x\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_LIGHTING, FALSE); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); /* Stage 1: result = diffuse(=1.0) + diffuse * stage 2: result = result - tfactor(= 0.5) */ @@ -10731,6 +11357,8 @@ hr = IDirect3DDevice9_SetTextureStageState(device, 1, D3DTSS_COLOROP, D3DTOP_SUBTRACT); ok(SUCCEEDED(hr), "SetTextureStageState failed with 0x%08x\n", hr); + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0x00000000, 1.0f, 0); + ok(SUCCEEDED(hr), "Failed to clear device, hr %#x.\n\n", hr); hr = IDirect3DDevice9_BeginScene(device); ok(SUCCEEDED(hr), "BeginScene failed with 0x%08x\n", hr); hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(*quad)); @@ -10785,24 +11413,40 @@ hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); ok(SUCCEEDED(hr), "Present failed with 0x%08x\n", hr); - hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_DISABLE); - ok(SUCCEEDED(hr), "SetTextureStageState failed with 0x%08x\n", hr); - hr = IDirect3DDevice9_SetTextureStageState(device, 1, D3DTSS_COLOROP, D3DTOP_DISABLE); - ok(SUCCEEDED(hr), "SetTextureStageState failed with 0x%08x\n", hr); - hr = IDirect3DDevice9_SetTexture(device, 0, NULL); - ok(SUCCEEDED(hr), "SetTexture failed with 0x%08x\n", hr); IDirect3DTexture9_Release(texture); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } -static void alphareplicate_test(IDirect3DDevice9 *device) { - struct vertex quad[] = { - { -1.0, -1.0, 0.1, 0x80ff00ff }, - { 1.0, -1.0, 0.1, 0x80ff00ff }, - { -1.0, 1.0, 0.1, 0x80ff00ff }, - { 1.0, 1.0, 0.1, 0x80ff00ff }, - }; - HRESULT hr; +static void alphareplicate_test(void) +{ + IDirect3DDevice9 *device; + IDirect3D9 *d3d; + ULONG refcount; DWORD color; + HWND window; + HRESULT hr; + + static const struct vertex quad[] = + { + {-1.0f, -1.0f, 0.1f, 0x80ff00ff}, + {-1.0f, 1.0f, 0.1f, 0x80ff00ff}, + { 1.0f, -1.0f, 0.1f, 0x80ff00ff}, + { 1.0f, 1.0f, 0.1f, 0x80ff00ff}, + }; + + window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, + 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"); + goto done; + } hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0x00000000, 1.0f, 0); ok(hr == D3D_OK, "IDirect3DDevice9_Clear failed with 0x%08x\n", hr); @@ -10816,13 +11460,11 @@ ok(hr == D3D_OK, "IDirect3DDevice9_SetTextureStageState failed with 0x%08x\n", hr); hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene failed with 0x%08x\n", hr); - if(SUCCEEDED(hr)) { - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(*quad)); - ok(SUCCEEDED(hr), "DrawPrimitiveUP failed with 0x%08x\n", hr); - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_EndScene failed with 0x%08x\n", hr); - } + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(*quad)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); color = getPixelColor(device, 320, 240); ok(color_match(color, 0x00808080, 1), "alphareplicate test 0x%08x, expected 0x00808080\n", @@ -10830,28 +11472,49 @@ hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); ok(SUCCEEDED(hr), "Present failed with 0x%08x\n", hr); - hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_DISABLE); - ok(hr == D3D_OK, "IDirect3DDevice9_SetTextureStageState failed with 0x%08x\n", hr); - + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } -static void dp3_alpha_test(IDirect3DDevice9 *device) { - HRESULT hr; +static void dp3_alpha_test(void) +{ + IDirect3DDevice9 *device; + IDirect3D9 *d3d; + ULONG refcount; D3DCAPS9 caps; DWORD color; - struct vertex quad[] = { - { -1.0, -1.0, 0.1, 0x408080c0 }, - { 1.0, -1.0, 0.1, 0x408080c0 }, - { -1.0, 1.0, 0.1, 0x408080c0 }, - { 1.0, 1.0, 0.1, 0x408080c0 }, + HWND window; + HRESULT hr; + + static const struct vertex quad[] = + { + {-1.0f, -1.0f, 0.1f, 0x408080c0}, + {-1.0f, 1.0f, 0.1f, 0x408080c0}, + { 1.0f, -1.0f, 0.1f, 0x408080c0}, + { 1.0f, 1.0f, 0.1f, 0x408080c0}, }; + window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, + 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"); + goto done; + } + memset(&caps, 0, sizeof(caps)); hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); - ok(SUCCEEDED(hr), "GetDeviceCaps failed with 0x%08x\n", hr); - if (!(caps.TextureOpCaps & D3DTEXOPCAPS_DOTPRODUCT3)) { + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); + if (!(caps.TextureOpCaps & D3DTEXOPCAPS_DOTPRODUCT3)) + { skip("D3DTOP_DOTPRODUCT3 not supported\n"); - return; + IDirect3DDevice9_Release(device); + goto done; } hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0x00000000, 1.0f, 0); @@ -10886,15 +11549,15 @@ ok(hr == D3D_OK, "IDirect3DDevice9_SetTextureStageState failed with 0x%08x\n", hr); hr = IDirect3DDevice9_SetRenderState(device, D3DRS_TEXTUREFACTOR, 0xffffffff); ok(SUCCEEDED(hr), "IDirect3DDevice9_SetRenderState failed with 0x%08x\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_LIGHTING, FALSE); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene failed with 0x%08x\n", hr); - if(SUCCEEDED(hr)) { - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(*quad)); - ok(SUCCEEDED(hr), "DrawPrimitiveUP failed with 0x%08x\n", hr); - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_EndScene failed with 0x%08x\n", hr); - } + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(*quad)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); color = getPixelColor(device, 320, 240); ok(color_match(color, 0x00808080, 4), "dp3 alpha test 0x%08x, expected 0x00808080\n", @@ -10902,30 +11565,47 @@ hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); ok(SUCCEEDED(hr), "IDirect3DDevice9_Present failed with 0x%08x\n", hr); - hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_DISABLE); - ok(hr == D3D_OK, "IDirect3DDevice9_SetTextureStageState failed with 0x%08x\n", hr); - hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_ALPHAOP, D3DTOP_DISABLE); - ok(hr == D3D_OK, "IDirect3DDevice9_SetTextureStageState failed with 0x%08x\n", hr); - hr = IDirect3DDevice9_SetTextureStageState(device, 1, D3DTSS_COLOROP, D3DTOP_DISABLE); - ok(hr == D3D_OK, "IDirect3DDevice9_SetTextureStageState failed with 0x%08x\n", hr); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } -static void zwriteenable_test(IDirect3DDevice9 *device) { +static void zwriteenable_test(void) +{ + IDirect3DDevice9 *device; + IDirect3D9 *d3d; + D3DCOLOR color; + ULONG refcount; + HWND window; HRESULT hr; - DWORD color; - struct vertex quad1[] = { - { -1.0, -1.0, 0.1, 0x00ff0000}, - { -1.0, 1.0, 0.1, 0x00ff0000}, - { 1.0, -1.0, 0.1, 0x00ff0000}, - { 1.0, 1.0, 0.1, 0x00ff0000}, - }; - struct vertex quad2[] = { - { -1.0, -1.0, 0.9, 0x0000ff00}, - { -1.0, 1.0, 0.9, 0x0000ff00}, - { 1.0, -1.0, 0.9, 0x0000ff00}, - { 1.0, 1.0, 0.9, 0x0000ff00}, + + static const struct vertex quad1[] = + { + {-1.0f, -1.0f, 0.1f, 0x00ff0000}, + {-1.0f, 1.0f, 0.1f, 0x00ff0000}, + { 1.0f, -1.0f, 0.1f, 0x00ff0000}, + { 1.0f, 1.0f, 0.1f, 0x00ff0000}, + }; + static const struct vertex quad2[] = + { + {-1.0f, -1.0f, 0.9f, 0x0000ff00}, + {-1.0f, 1.0f, 0.9f, 0x0000ff00}, + { 1.0f, -1.0f, 0.9f, 0x0000ff00}, + { 1.0f, 1.0f, 0.9f, 0x0000ff00}, }; + 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"); + goto done; + } + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0x000000ff, 1.0f, 0); ok(hr == D3D_OK, "IDirect3DDevice9_Clear failed with 0x%08x\n", hr); @@ -10937,27 +11617,29 @@ ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState failed with 0x%08x\n", hr); hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ZFUNC, D3DCMP_LESSEQUAL); ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState failed with 0x%08x\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_LIGHTING, FALSE); + ok(SUCCEEDED(hr), "Failed to disable lighting, hr %#x.\n", hr); hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene failed with 0x%08x\n", hr); - if(SUCCEEDED(hr)) { - /* The Z buffer is filled with 1.0. Draw a red quad with z = 0.1, zenable = D3DZB_FALSE, zwriteenable = TRUE. - * The red color is written because the z test is disabled. The question is whether the z = 0.1 values - * are written into the Z buffer. After the draw, set zenable = TRUE and draw a green quad at z = 0.9. - * If the values are written, the z test will fail(0.9 > 0.1) and the red color remains. If the values - * are not written, the z test succeeds(0.9 < 1.0) and the green color is written. It turns out that - * the screen is green, so zenable = D3DZB_FALSE and zwriteenable = TRUE does NOT write to the z buffer. - */ - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad1, sizeof(*quad1)); - ok(SUCCEEDED(hr), "DrawPrimitiveUP failed with 0x%08x\n", hr); - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ZENABLE, D3DZB_TRUE); - ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState failed with 0x%08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad2, sizeof(*quad2)); - ok(SUCCEEDED(hr), "DrawPrimitiveUP failed with 0x%08x\n", hr); - - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene failed with 0x%08x\n", hr); - } + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + /* The Z buffer is filled with 1.0. Draw a red quad with z = 0.1, + * zenable = D3DZB_FALSE, zwriteenable = TRUE. The red color is written + * because the z test is disabled. The question is whether the z = 0.1 + * values are written into the Z buffer. After the draw, set + * zenable = TRUE and draw a green quad at z = 0.9. If the values are + * written, the z test will fail(0.9 > 0.1) and the red color remains. If + * the values are not written, the z test succeeds(0.9 < 1.0) and the + * green color is written. It turns out that the screen is green, so + * zenable = D3DZB_FALSE and zwriteenable = TRUE does NOT write to the z + * buffer. */ + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad1, sizeof(*quad1)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ZENABLE, D3DZB_TRUE); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad2, sizeof(*quad2)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); color = getPixelColor(device, 320, 240); ok(color_match(color, 0x0000ff00, 1), "zwriteenable test returned 0x%08x, expected 0x0000ff00\n", @@ -10965,39 +11647,67 @@ hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); ok(SUCCEEDED(hr), "IDirect3DDevice9_Present failed with 0x%08x\n", hr); - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ZENABLE, D3DZB_FALSE); - ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState failed with 0x%08x\n", hr); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } -static void alphatest_test(IDirect3DDevice9 *device) { +static void alphatest_test(void) +{ #define ALPHATEST_PASSED 0x0000ff00 #define ALPHATEST_FAILED 0x00ff0000 - struct { - D3DCMPFUNC func; - DWORD color_less; - DWORD color_equal; - DWORD color_greater; - } testdata[] = { - { D3DCMP_NEVER, ALPHATEST_FAILED, ALPHATEST_FAILED, ALPHATEST_FAILED }, - { D3DCMP_LESS, ALPHATEST_PASSED, ALPHATEST_FAILED, ALPHATEST_FAILED }, - { D3DCMP_EQUAL, ALPHATEST_FAILED, ALPHATEST_PASSED, ALPHATEST_FAILED }, - { D3DCMP_LESSEQUAL, ALPHATEST_PASSED, ALPHATEST_PASSED, ALPHATEST_FAILED }, - { D3DCMP_GREATER, ALPHATEST_FAILED, ALPHATEST_FAILED, ALPHATEST_PASSED }, - { D3DCMP_NOTEQUAL, ALPHATEST_PASSED, ALPHATEST_FAILED, ALPHATEST_PASSED }, - { D3DCMP_GREATEREQUAL, ALPHATEST_FAILED, ALPHATEST_PASSED, ALPHATEST_PASSED }, - { D3DCMP_ALWAYS, ALPHATEST_PASSED, ALPHATEST_PASSED, ALPHATEST_PASSED }, - }; + IDirect3DDevice9 *device; unsigned int i, j; + IDirect3D9 *d3d; + D3DCOLOR color; + ULONG refcount; + D3DCAPS9 caps; + HWND window; HRESULT hr; - DWORD color; - struct vertex quad[] = { - { -1.0, -1.0, 0.1, ALPHATEST_PASSED | 0x80000000 }, - { 1.0, -1.0, 0.1, ALPHATEST_PASSED | 0x80000000 }, - { -1.0, 1.0, 0.1, ALPHATEST_PASSED | 0x80000000 }, - { 1.0, 1.0, 0.1, ALPHATEST_PASSED | 0x80000000 }, + + static const struct + { + D3DCMPFUNC func; + D3DCOLOR color_less; + D3DCOLOR color_equal; + D3DCOLOR color_greater; + } + testdata[] = + { + {D3DCMP_NEVER, ALPHATEST_FAILED, ALPHATEST_FAILED, ALPHATEST_FAILED}, + {D3DCMP_LESS, ALPHATEST_PASSED, ALPHATEST_FAILED, ALPHATEST_FAILED}, + {D3DCMP_EQUAL, ALPHATEST_FAILED, ALPHATEST_PASSED, ALPHATEST_FAILED}, + {D3DCMP_LESSEQUAL, ALPHATEST_PASSED, ALPHATEST_PASSED, ALPHATEST_FAILED}, + {D3DCMP_GREATER, ALPHATEST_FAILED, ALPHATEST_FAILED, ALPHATEST_PASSED}, + {D3DCMP_NOTEQUAL, ALPHATEST_PASSED, ALPHATEST_FAILED, ALPHATEST_PASSED}, + {D3DCMP_GREATEREQUAL, ALPHATEST_FAILED, ALPHATEST_PASSED, ALPHATEST_PASSED}, + {D3DCMP_ALWAYS, ALPHATEST_PASSED, ALPHATEST_PASSED, ALPHATEST_PASSED}, + }; + static const struct vertex quad[] = + { + {-1.0f, -1.0f, 0.1f, ALPHATEST_PASSED | 0x80000000}, + {-1.0f, 1.0f, 0.1f, ALPHATEST_PASSED | 0x80000000}, + { 1.0f, -1.0f, 0.1f, ALPHATEST_PASSED | 0x80000000}, + { 1.0f, 1.0f, 0.1f, ALPHATEST_PASSED | 0x80000000}, }; - D3DCAPS9 caps; + 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"); + goto done; + } + + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff0000ff, 1.0f, 0); + ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_LIGHTING, FALSE); + ok(SUCCEEDED(hr), "Failed to disable lighting, hr %#x.\n", hr); hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ALPHATESTENABLE, TRUE); ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState failed with 0x%08x\n", hr); hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_DIFFUSE); @@ -11042,13 +11752,11 @@ hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ALPHAREF, 0x90); ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState failed with 0x%08x\n", hr); hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene failed with 0x%08x\n", hr); - if(SUCCEEDED(hr)) { - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(*quad)); - ok(SUCCEEDED(hr), "DrawPrimitiveUP failed with 0x%08x\n", hr); - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_EndScene failed with 0x%08x\n", hr); - } + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(*quad)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); color = getPixelColor(device, 320, 240); ok(color_match(color, testdata[i].color_less, 1), "Alphatest failed. Got color 0x%08x, expected 0x%08x. alpha < ref, func %u\n", color, testdata[i].color_less, testdata[i].func); @@ -11060,13 +11768,11 @@ hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ALPHAREF, 0x80); ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState failed with 0x%08x\n", hr); hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene failed with 0x%08x\n", hr); - if(SUCCEEDED(hr)) { - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(*quad)); - ok(SUCCEEDED(hr), "DrawPrimitiveUP failed with 0x%08x\n", hr); - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_EndScene failed with 0x%08x\n", hr); - } + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(*quad)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); color = getPixelColor(device, 320, 240); ok(color_match(color, testdata[i].color_equal, 1), "Alphatest failed. Got color 0x%08x, expected 0x%08x. alpha == ref, func %u\n", color, testdata[i].color_equal, testdata[i].func); @@ -11078,13 +11784,11 @@ hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ALPHAREF, 0x70); ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState failed with 0x%08x\n", hr); hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene failed with 0x%08x\n", hr); - if(SUCCEEDED(hr)) { - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(*quad)); - ok(SUCCEEDED(hr), "DrawPrimitiveUP failed with 0x%08x\n", hr); - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_EndScene failed with 0x%08x\n", hr); - } + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(*quad)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); color = getPixelColor(device, 320, 240); ok(color_match(color, testdata[i].color_greater, 1), "Alphatest failed. Got color 0x%08x, expected 0x%08x. alpha > ref, func %u\n", color, testdata[i].color_greater, testdata[i].func); @@ -11093,14 +11797,25 @@ } } - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ALPHATESTENABLE, FALSE); - ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState failed with 0x%08x\n", hr); - hr = IDirect3DDevice9_SetPixelShader(device, NULL); - ok(hr == D3D_OK, "IDirect3DDevice9_SetPixelShader failed with 0x%08x\n", hr); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } -static void sincos_test(IDirect3DDevice9 *device) +static void sincos_test(void) { + IDirect3DVertexShader9 *sin_shader, *cos_shader; + IDirect3DDevice9 *device; + struct vec3 data[1280]; + IDirect3D9 *d3d; + unsigned int i; + ULONG refcount; + D3DCAPS9 caps; + HWND window; + HRESULT hr; + static const DWORD sin_shader_code[] = { 0xfffe0200, /* vs_2_0 */ @@ -11125,14 +11840,27 @@ 0x02000001, 0xd00f0000, 0xa0a90002, /* mov oD0, c2.yzzz */ 0x0000ffff /* end */ }; - IDirect3DVertexShader9 *sin_shader, *cos_shader; - HRESULT hr; - struct { - float x, y, z; - } data[1280]; - unsigned int i; - float sincosc1[4] = {D3DSINCOSCONST1}; - float sincosc2[4] = {D3DSINCOSCONST2}; + static const float sincosc1[4] = {D3DSINCOSCONST1}; + static const float sincosc2[4] = {D3DSINCOSCONST2}; + + 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"); + goto done; + } + + hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); + if (caps.VertexShaderVersion < D3DVS_VERSION(2, 0)) + { + skip("No vs_2_0 support, skipping tests.\n"); + IDirect3DDevice9_Release(device); + goto done; + } hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0x00000000, 1.0f, 0); ok(hr == D3D_OK, "IDirect3DDevice9_Clear failed with 0x%08x\n", hr); @@ -11156,31 +11884,46 @@ } hr = IDirect3DDevice9_BeginScene(device); - if(SUCCEEDED(hr)) { - hr = IDirect3DDevice9_SetVertexShader(device, sin_shader); - ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexShader failed with 0x%08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_POINTLIST, 1280, data, sizeof(*data)); - ok(hr == D3D_OK, "IDirect3DDevice9_DrawPrimitiveUP failed with 0x%08x\n", hr); - - hr = IDirect3DDevice9_SetVertexShader(device, cos_shader); - ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexShader failed with 0x%08x\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_POINTLIST, 1280, data, sizeof(*data)); - ok(hr == D3D_OK, "IDirect3DDevice9_DrawPrimitiveUP failed with 0x%08x\n", hr); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + + hr = IDirect3DDevice9_SetVertexShader(device, sin_shader); + ok(SUCCEEDED(hr), "Failed to set vertex shader, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_POINTLIST, 1280, data, sizeof(*data)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + + hr = IDirect3DDevice9_SetVertexShader(device, cos_shader); + ok(SUCCEEDED(hr), "Failed to set vertex shader, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_POINTLIST, 1280, data, sizeof(*data)); + 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_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_EndScene failed with 0x%08x\n", hr); - } hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); ok(SUCCEEDED(hr), "IDirect3DDevice9_Present returned %#x.\n", hr); /* TODO: Find a way to properly validate the lines. Precicion issues make this a kinda nasty task */ - IDirect3DDevice9_SetVertexShader(device, NULL); IDirect3DVertexShader9_Release(sin_shader); IDirect3DVertexShader9_Release(cos_shader); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } -static void loop_index_test(IDirect3DDevice9 *device) +static void loop_index_test(void) { + IDirect3DVertexShader9 *shader; + IDirect3DDevice9 *device; + IDirect3D9 *d3d; + float values[4]; + ULONG refcount; + D3DCAPS9 caps; + DWORD color; + HWND window; + HRESULT hr; + static const DWORD shader_code[] = { 0xfffe0200, /* vs_2_0 */ @@ -11193,19 +11936,35 @@ 0x02000001, 0xd00f0000, 0x80e40000, /* mov oD0, r0 */ 0x0000ffff /* END */ }; - IDirect3DVertexShader9 *shader; - HRESULT hr; - DWORD color; - const float quad[] = { - -1.0, -1.0, 0.1, - 1.0, -1.0, 0.1, - -1.0, 1.0, 0.1, - 1.0, 1.0, 0.1 - }; - const float zero[4] = {0, 0, 0, 0}; - const float one[4] = {1, 1, 1, 1}; - int i0[4] = {2, 10, -3, 0}; - float values[4]; + static const float 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 float zero[4] = {0.0f, 0.0f, 0.0f, 0.0f}; + static const float one[4] = {1.0f, 1.0f, 1.0f, 1.0f}; + static const int i0[4] = {2, 10, -3, 0}; + + 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"); + goto done; + } + + hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); + if (caps.VertexShaderVersion < D3DVS_VERSION(2, 0)) + { + skip("No vs_2_0 support, skipping tests.\n"); + IDirect3DDevice9_Release(device); + goto done; + } hr = IDirect3DDevice9_CreateVertexShader(device, shader_code, &shader); ok(hr == D3D_OK, "IDirect3DDevice9_CreateVertexShader failed with %08x\n", hr); @@ -11213,7 +11972,7 @@ ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexShader failed with %08x\n", hr); hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ); ok(hr == D3D_OK, "IDirect3DDevice9_SetFVF failed with %08x\n", hr); - hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0x00ff0000, 0.0, 0); + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0x00ff0000, 1.0f, 0); ok(hr == D3D_OK, "IDirect3DDevice9_Clear returned %08x\n", hr); hr = IDirect3DDevice9_SetVertexShaderConstantF(device, 0, zero, 1); @@ -11261,27 +12020,35 @@ ok(SUCCEEDED(hr), "IDirect3DDevice9_SetVertexShaderConstantI returned %#x.\n", hr); hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene returned %08x\n", hr); - if(SUCCEEDED(hr)) - { - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 3 * sizeof(float)); - ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr); - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_EndScene returned %08x\n", hr); - } + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 3 * sizeof(float)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); color = getPixelColor(device, 320, 240); ok(color_match(color, 0x0000ff00, 1), "aL indexing test returned color 0x%08x, expected 0x0000ff00\n", color); hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); ok(hr == D3D_OK, "IDirect3DDevice9_Present failed with %08x\n", hr); - hr = IDirect3DDevice9_SetVertexShader(device, NULL); - ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexShader failed with %08x\n", hr); IDirect3DVertexShader9_Release(shader); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } -static void sgn_test(IDirect3DDevice9 *device) +static void sgn_test(void) { + IDirect3DVertexShader9 *shader; + IDirect3DDevice9 *device; + IDirect3D9 *d3d; + ULONG refcount; + D3DCAPS9 caps; + DWORD color; + HWND window; + HRESULT hr; + static const DWORD shader_code[] = { 0xfffe0200, /* vs_2_0 */ @@ -11293,15 +12060,32 @@ 0x03000002, 0xd00f0000, 0x80e40000, 0xa0e40001, /* add oD0, r0, c1 */ 0x0000ffff /* end */ }; - IDirect3DVertexShader9 *shader; - HRESULT hr; - DWORD color; - const float quad[] = { - -1.0, -1.0, 0.1, - 1.0, -1.0, 0.1, - -1.0, 1.0, 0.1, - 1.0, 1.0, 0.1 - }; + static const float 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, + }; + + 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"); + goto done; + } + + hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); + if (caps.VertexShaderVersion < D3DVS_VERSION(2, 0)) + { + skip("No vs_2_0 support, skipping tests.\n"); + IDirect3DDevice9_Release(device); + goto done; + } hr = IDirect3DDevice9_CreateVertexShader(device, shader_code, &shader); ok(hr == D3D_OK, "IDirect3DDevice9_CreateVertexShader failed with %08x\n", hr); @@ -11309,47 +12093,59 @@ ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexShader failed with %08x\n", hr); hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ); ok(hr == D3D_OK, "IDirect3DDevice9_SetFVF failed with %08x\n", hr); - hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0x00ff0000, 0.0, 0); + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0x00ff0000, 1.0f, 0); ok(hr == D3D_OK, "IDirect3DDevice9_Clear returned %08x\n", hr); hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene returned %08x\n", hr); - if(SUCCEEDED(hr)) - { - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 3 * sizeof(float)); - ok(hr == D3D_OK, "DrawPrimitiveUP failed (%08x)\n", hr); - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_EndScene returned %08x\n", hr); - } + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 3 * sizeof(float)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); color = getPixelColor(device, 320, 240); ok(color_match(color, 0x008000ff, 1), "sgn test returned color 0x%08x, expected 0x008000ff\n", color); hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); ok(hr == D3D_OK, "IDirect3DDevice9_Present failed with %08x\n", hr); - hr = IDirect3DDevice9_SetVertexShader(device, NULL); - ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexShader failed with %08x\n", hr); IDirect3DVertexShader9_Release(shader); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } -static void viewport_test(IDirect3DDevice9 *device) { - HRESULT hr; - DWORD color; - D3DVIEWPORT9 vp, old_vp; +static void viewport_test(void) +{ + IDirect3DDevice9 *device; BOOL draw_failed = TRUE; - const float quad[] = + D3DVIEWPORT9 vp; + IDirect3D9 *d3d; + ULONG refcount; + DWORD color; + HWND window; + HRESULT hr; + + static const float quad[] = { - -0.5, -0.5, 0.1, - 0.5, -0.5, 0.1, - -0.5, 0.5, 0.1, - 0.5, 0.5, 0.1 + -0.5f, -0.5f, 0.1f, + -0.5f, 0.5f, 0.1f, + 0.5f, -0.5f, 0.1f, + 0.5f, 0.5f, 0.1f, }; - memset(&old_vp, 0, sizeof(old_vp)); - hr = IDirect3DDevice9_GetViewport(device, &old_vp); - ok(hr == D3D_OK, "IDirect3DDevice9_GetViewport failed with %08x\n", hr); + 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"); + goto done; + } - hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0x00ff0000, 0.0, 0); + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0x00ff0000, 1.0f, 0); ok(hr == D3D_OK, "IDirect3DDevice9_Clear returned %08x\n", hr); /* Test a viewport with Width and Height bigger than the surface dimensions @@ -11377,18 +12173,18 @@ hr = IDirect3DDevice9_SetViewport(device, &vp); ok(hr == D3D_OK, "IDirect3DDevice9_SetViewport failed with %08x\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_LIGHTING, FALSE); + ok(SUCCEEDED(hr), "Failed to disable lighting, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ); ok(hr == D3D_OK, "IDirect3DDevice9_SetFVF returned %08x\n", hr); hr = IDirect3DDevice9_BeginScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_BeginScene returned %08x\n", hr); - if(SUCCEEDED(hr)) - { - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 3 * sizeof(float)); - ok(hr == D3D_OK || broken(hr == D3DERR_INVALIDCALL), "DrawPrimitiveUP failed (%08x)\n", hr); - draw_failed = FAILED(hr); - hr = IDirect3DDevice9_EndScene(device); - ok(hr == D3D_OK, "IDirect3DDevice9_EndScene returned %08x\n", hr); - } + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, 3 * sizeof(float)); + ok(hr == D3D_OK || broken(hr == D3DERR_INVALIDCALL), "Got unexpected hr %#x.\n", hr); + draw_failed = FAILED(hr); + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); if(!draw_failed) { @@ -11414,8 +12210,11 @@ hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); ok(hr == D3D_OK, "IDirect3DDevice9_Present failed with %08x\n", hr); - hr = IDirect3DDevice9_SetViewport(device, &old_vp); - ok(hr == D3D_OK, "IDirect3DDevice9_SetViewport failed with %08x\n", hr); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } /* This test tests depth clamping / clipping behaviour: @@ -11428,55 +12227,72 @@ * clipped when D3DPMISCCAPS_CLIPTLVERTS is set, clamped when it isn't. * - The viewport's MinZ/MaxZ is irrelevant for this. */ -static void depth_clamp_test(IDirect3DDevice9 *device) +static void depth_clamp_test(void) { - const struct tvertex quad1[] = + IDirect3DDevice9 *device; + D3DVIEWPORT9 vp; + IDirect3D9 *d3d; + D3DCOLOR color; + ULONG refcount; + D3DCAPS9 caps; + HWND window; + HRESULT hr; + + static const struct tvertex quad1[] = { { 0.0f, 0.0f, 5.0f, 1.0f, 0xff002b7f}, {640.0f, 0.0f, 5.0f, 1.0f, 0xff002b7f}, { 0.0f, 480.0f, 5.0f, 1.0f, 0xff002b7f}, {640.0f, 480.0f, 5.0f, 1.0f, 0xff002b7f}, }; - const struct tvertex quad2[] = + static const struct tvertex quad2[] = { { 0.0f, 300.0f, 10.0f, 1.0f, 0xfff9e814}, {640.0f, 300.0f, 10.0f, 1.0f, 0xfff9e814}, { 0.0f, 360.0f, 10.0f, 1.0f, 0xfff9e814}, {640.0f, 360.0f, 10.0f, 1.0f, 0xfff9e814}, }; - const struct tvertex quad3[] = + static const struct tvertex quad3[] = { {112.0f, 108.0f, 5.0f, 1.0f, 0xffffffff}, {208.0f, 108.0f, 5.0f, 1.0f, 0xffffffff}, {112.0f, 204.0f, 5.0f, 1.0f, 0xffffffff}, {208.0f, 204.0f, 5.0f, 1.0f, 0xffffffff}, }; - const struct tvertex quad4[] = + static const struct tvertex quad4[] = { { 42.0f, 41.0f, 10.0f, 1.0f, 0xffffffff}, {112.0f, 41.0f, 10.0f, 1.0f, 0xffffffff}, { 42.0f, 108.0f, 10.0f, 1.0f, 0xffffffff}, {112.0f, 108.0f, 10.0f, 1.0f, 0xffffffff}, }; - const struct vertex quad5[] = + static const struct vertex quad5[] = { { -0.5f, 0.5f, 10.0f, 0xff14f914}, { 0.5f, 0.5f, 10.0f, 0xff14f914}, { -0.5f, -0.5f, 10.0f, 0xff14f914}, { 0.5f, -0.5f, 10.0f, 0xff14f914}, }; - const struct vertex quad6[] = + static const struct vertex quad6[] = { - { -1.0f, 0.5f, 10.0f, 0xfff91414}, - { 1.0f, 0.5f, 10.0f, 0xfff91414}, - { -1.0f, 0.25f, 10.0f, 0xfff91414}, - { 1.0f, 0.25f, 10.0f, 0xfff91414}, - }; + { -1.0f, 0.5f, 10.0f, 0xfff91414}, + { 1.0f, 0.5f, 10.0f, 0xfff91414}, + { -1.0f, 0.25f, 10.0f, 0xfff91414}, + { 1.0f, 0.25f, 10.0f, 0xfff91414}, + }; + + window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, + 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"); + goto done; + } - D3DVIEWPORT9 vp; - D3DCOLOR color; - D3DCAPS9 caps; - HRESULT hr; + hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); vp.X = 0; vp.Y = 0; @@ -11485,9 +12301,6 @@ vp.MinZ = 0.0; vp.MaxZ = 7.5; - hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); - ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetViewport(device, &vp); if(FAILED(hr)) { @@ -11581,13 +12394,14 @@ hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); ok(SUCCEEDED(hr), "Present failed (0x%08x)\n", hr); - vp.MinZ = 0.0; - vp.MaxZ = 1.0; - hr = IDirect3DDevice9_SetViewport(device, &vp); - ok(SUCCEEDED(hr), "SetViewport failed, hr %#x.\n", hr); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } -static void depth_bounds_test(IDirect3DDevice9 *device) +static void depth_bounds_test(void) { const struct tvertex quad1[] = { @@ -11616,19 +12430,29 @@ float f; } tmpvalue; - IDirect3D9 *d3d = NULL; IDirect3DSurface9 *offscreen_surface = NULL; + IDirect3DDevice9 *device; + IDirect3D9 *d3d; D3DCOLOR color; + ULONG refcount; + HWND window; HRESULT hr; - IDirect3DDevice9_GetDirect3D(device, &d3d); - if(IDirect3D9_CheckDeviceFormat(d3d, 0, D3DDEVTYPE_HAL, D3DFMT_X8R8G8B8, - 0, D3DRTYPE_SURFACE, MAKEFOURCC('N','V','D','B')) != D3D_OK) { - skip("No NVDB (depth bounds test) support\n"); - IDirect3D9_Release(d3d); - return; + 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 (IDirect3D9_CheckDeviceFormat(d3d, 0, D3DDEVTYPE_HAL, + D3DFMT_X8R8G8B8, 0, D3DRTYPE_SURFACE, MAKEFOURCC('N','V','D','B')) != D3D_OK) + { + skip("No NVDB (depth bounds test) support, skipping tests.\n"); + goto done; + } + if (!(device = create_device(d3d, window, window, TRUE))) + { + skip("Failed to create a D3D device, skipping tests.\n"); + goto done; } - IDirect3D9_Release(d3d); hr = IDirect3DDevice9_CreateOffscreenPlainSurface(device, 32, 32, MAKEFOURCC('N','V','D','B'), D3DPOOL_DEFAULT, &offscreen_surface, NULL); @@ -11701,9 +12525,14 @@ hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); ok(SUCCEEDED(hr), "Present failed (0x%08x)\n", hr); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } -static void depth_buffer_test(IDirect3DDevice9 *device) +static void depth_buffer_test(void) { static const struct vertex quad1[] = { @@ -11735,11 +12564,25 @@ }; IDirect3DSurface9 *backbuffer, *rt1, *rt2, *rt3; + IDirect3DDevice9 *device; unsigned int i, j; D3DVIEWPORT9 vp; + IDirect3D9 *d3d; D3DCOLOR color; + ULONG refcount; + HWND window; HRESULT hr; + 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"); + goto done; + } + vp.X = 0; vp.Y = 0; vp.Width = 640; @@ -11831,12 +12674,17 @@ IDirect3DSurface9_Release(rt3); IDirect3DSurface9_Release(rt2); IDirect3DSurface9_Release(rt1); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } /* Test that partial depth copies work the way they're supposed to. The clear * on rt2 only needs a partial copy of the onscreen depth/stencil buffer, and * the following draw should only copy back the part that was modified. */ -static void depth_buffer2_test(IDirect3DDevice9 *device) +static void depth_buffer2_test(void) { static const struct vertex quad[] = { @@ -11847,11 +12695,25 @@ }; IDirect3DSurface9 *backbuffer, *rt1, *rt2; + IDirect3DDevice9 *device; unsigned int i, j; D3DVIEWPORT9 vp; + IDirect3D9 *d3d; D3DCOLOR color; + ULONG refcount; + HWND window; HRESULT hr; + 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"); + goto done; + } + vp.X = 0; vp.Y = 0; vp.Width = 640; @@ -11928,9 +12790,14 @@ IDirect3DSurface9_Release(backbuffer); IDirect3DSurface9_Release(rt2); IDirect3DSurface9_Release(rt1); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } -static void depth_blit_test(IDirect3DDevice9 *device) +static void depth_blit_test(void) { static const struct vertex quad1[] = { @@ -11955,12 +12822,26 @@ }; IDirect3DSurface9 *backbuffer, *ds1, *ds2, *ds3; + IDirect3DDevice9 *device; RECT src_rect, dst_rect; unsigned int i, j; D3DVIEWPORT9 vp; + IDirect3D9 *d3d; D3DCOLOR color; + ULONG refcount; + HWND window; HRESULT hr; + 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"); + goto done; + } + vp.X = 0; vp.Y = 0; vp.Width = 640; @@ -12064,9 +12945,14 @@ IDirect3DSurface9_Release(ds3); IDirect3DSurface9_Release(ds2); IDirect3DSurface9_Release(ds1); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } -static void intz_test(IDirect3DDevice9 *device) +static void intz_test(void) { static const DWORD ps_code[] = { @@ -12125,45 +13011,51 @@ {560, 450, D3DCOLOR_ARGB(0x00, 0xdf, 0xbf, 0x00)}, }; - IDirect3DSurface9 *original_ds, *original_rt, *rt; + IDirect3DSurface9 *original_rt, *rt; IDirect3DTexture9 *texture; IDirect3DPixelShader9 *ps; + IDirect3DDevice9 *device; IDirect3DSurface9 *ds; - IDirect3D9 *d3d9; + IDirect3D9 *d3d; + ULONG refcount; D3DCAPS9 caps; + HWND window; HRESULT hr; UINT i; + 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 (FAILED(IDirect3D9_CheckDeviceFormat(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, + D3DFMT_X8R8G8B8, D3DUSAGE_DEPTHSTENCIL, D3DRTYPE_TEXTURE, MAKEFOURCC('I','N','T','Z')))) + { + skip("No INTZ support, skipping INTZ test.\n"); + goto done; + } + if (!(device = create_device(d3d, window, window, TRUE))) + { + skip("Failed to create a D3D device, skipping tests.\n"); + goto done; + } + hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); ok(SUCCEEDED(hr), "GetDeviceCaps failed, hr %#x.\n", hr); if (caps.PixelShaderVersion < D3DPS_VERSION(2, 0)) { skip("No pixel shader 2.0 support, skipping INTZ test.\n"); - return; + IDirect3DDevice9_Release(device); + goto done; } if (caps.TextureCaps & D3DPTEXTURECAPS_POW2) { skip("No unconditional NP2 texture support, skipping INTZ test.\n"); - return; - } - - hr = IDirect3DDevice9_GetDirect3D(device, &d3d9); - ok(SUCCEEDED(hr), "GetDirect3D failed, hr %#x.\n", hr); - - hr = IDirect3D9_CheckDeviceFormat(d3d9, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, D3DFMT_X8R8G8B8, - D3DUSAGE_DEPTHSTENCIL, D3DRTYPE_TEXTURE, MAKEFOURCC('I','N','T','Z')); - if (FAILED(hr)) - { - skip("No INTZ support, skipping INTZ test.\n"); - return; + IDirect3DDevice9_Release(device); + goto done; } - IDirect3D9_Release(d3d9); - hr = IDirect3DDevice9_GetRenderTarget(device, 0, &original_rt); ok(SUCCEEDED(hr), "GetRenderTarget failed, hr %#x.\n", hr); - hr = IDirect3DDevice9_GetDepthStencilSurface(device, &original_ds); - ok(SUCCEEDED(hr), "GetDepthStencilSurface failed, hr %#x.\n", hr); hr = IDirect3DDevice9_CreateTexture(device, 640, 480, 1, D3DUSAGE_DEPTHSTENCIL, MAKEFOURCC('I','N','T','Z'), D3DPOOL_DEFAULT, &texture, NULL); @@ -12363,21 +13255,18 @@ hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); ok(SUCCEEDED(hr), "Present failed, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetDepthStencilSurface(device, original_ds); - ok(SUCCEEDED(hr), "SetDepthStencilSurface failed, hr %#x.\n", hr); - IDirect3DSurface9_Release(original_ds); - hr = IDirect3DDevice9_SetTexture(device, 0, NULL); - ok(SUCCEEDED(hr), "SetTexture failed, hr %#x.\n", hr); IDirect3DTexture9_Release(texture); - hr = IDirect3DDevice9_SetPixelShader(device, NULL); - ok(SUCCEEDED(hr), "SetPixelShader failed, hr %#x.\n", hr); IDirect3DPixelShader9_Release(ps); - IDirect3DSurface9_Release(original_rt); IDirect3DSurface9_Release(rt); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } -static void shadow_test(IDirect3DDevice9 *device) +static void shadow_test(void) { static const DWORD ps_code[] = { @@ -12441,21 +13330,33 @@ IDirect3DSurface9 *original_ds, *original_rt, *rt; IDirect3DPixelShader9 *ps; - IDirect3D9 *d3d9; + IDirect3DDevice9 *device; + IDirect3D9 *d3d; + ULONG refcount; D3DCAPS9 caps; + HWND window; HRESULT hr; UINT i; + 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"); + goto done; + } + hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); ok(SUCCEEDED(hr), "GetDeviceCaps failed, hr %#x.\n", hr); if (caps.PixelShaderVersion < D3DPS_VERSION(2, 0)) { skip("No pixel shader 2.0 support, skipping shadow test.\n"); - return; + IDirect3DDevice9_Release(device); + goto done; } - hr = IDirect3DDevice9_GetDirect3D(device, &d3d9); - ok(SUCCEEDED(hr), "GetDirect3D failed, hr %#x.\n", hr); hr = IDirect3DDevice9_GetRenderTarget(device, 0, &original_rt); ok(SUCCEEDED(hr), "GetRenderTarget failed, hr %#x.\n", hr); hr = IDirect3DDevice9_GetDepthStencilSurface(device, &original_ds); @@ -12496,9 +13397,9 @@ IDirect3DSurface9 *ds; unsigned int j; - hr = IDirect3D9_CheckDeviceFormat(d3d9, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, D3DFMT_X8R8G8B8, - D3DUSAGE_DEPTHSTENCIL, D3DRTYPE_TEXTURE, format); - if (FAILED(hr)) continue; + if (FAILED(IDirect3D9_CheckDeviceFormat(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, + D3DFMT_X8R8G8B8, D3DUSAGE_DEPTHSTENCIL, D3DRTYPE_TEXTURE, format))) + continue; hr = IDirect3DDevice9_CreateTexture(device, 1024, 1024, 1, D3DUSAGE_DEPTHSTENCIL, format, D3DPOOL_DEFAULT, &texture, NULL); @@ -12565,34 +13466,31 @@ ok(SUCCEEDED(hr), "Present failed, hr %#x.\n", hr); } - hr = IDirect3DDevice9_SetPixelShader(device, NULL); - ok(SUCCEEDED(hr), "SetPixelShader failed, hr %#x.\n", hr); IDirect3DPixelShader9_Release(ps); - - hr = IDirect3DDevice9_SetDepthStencilSurface(device, original_ds); - ok(SUCCEEDED(hr), "SetDepthStencilSurface failed, hr %#x.\n", hr); IDirect3DSurface9_Release(original_ds); - IDirect3DSurface9_Release(original_rt); IDirect3DSurface9_Release(rt); - - IDirect3D9_Release(d3d9); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } static void clip_planes(IDirect3DDevice9 *device, const char *test_name) { - const struct vertex quad1[] = + static const struct vertex quad1[] = { {-1.0f, -1.0f, 0.0f, 0xfff9e814}, - { 1.0f, -1.0f, 0.0f, 0xfff9e814}, {-1.0f, 1.0f, 0.0f, 0xfff9e814}, + { 1.0f, -1.0f, 0.0f, 0xfff9e814}, { 1.0f, 1.0f, 0.0f, 0xfff9e814}, }; - const struct vertex quad2[] = + static const struct vertex quad2[] = { {-1.0f, -1.0f, 0.0f, 0xff002b7f}, - { 1.0f, -1.0f, 0.0f, 0xff002b7f}, {-1.0f, 1.0f, 0.0f, 0xff002b7f}, + { 1.0f, -1.0f, 0.0f, 0xff002b7f}, { 1.0f, 1.0f, 0.0f, 0xff002b7f}, }; D3DCOLOR color; @@ -12631,10 +13529,19 @@ ok(color_match(color, 0x00f9e814, 1), "%s test: color 0x%08x.\n", test_name, color); } -static void clip_planes_test(IDirect3DDevice9 *device) +static void clip_planes_test(void) { - const float plane0[4] = {0.0f, 1.0f, 0.0f, 0.5f / 480.0f}; /* a quarter-pixel offset */ + IDirect3DSurface9 *offscreen_surface, *original_rt; + IDirect3DTexture9 *offscreen = NULL; + IDirect3DVertexShader9 *shader; + IDirect3DDevice9 *device; + IDirect3D9 *d3d; + ULONG refcount; + D3DCAPS9 caps; + HWND window; + HRESULT hr; + static const float plane0[4] = {0.0f, 1.0f, 0.0f, 0.5f / 480.0f}; /* a quarter-pixel offset */ static const DWORD shader_code[] = { 0xfffe0200, /* vs_2_0 */ @@ -12644,11 +13551,25 @@ 0x02000001, 0xd00f0000, 0x90e40001, /* mov oD0, v1 */ 0x0000ffff /* end */ }; - IDirect3DVertexShader9 *shader; - IDirect3DTexture9 *offscreen = NULL; - IDirect3DSurface9 *offscreen_surface, *original_rt; - HRESULT hr; + 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"); + goto done; + } + + hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); + if (caps.VertexShaderVersion < D3DVS_VERSION(2, 0)) + { + skip("No vs_2_0 support, skipping tests.\n"); + IDirect3DDevice9_Release(device); + goto done; + } hr = IDirect3DDevice9_GetRenderTarget(device, 0, &original_rt); ok(SUCCEEDED(hr), "GetRenderTarget failed, hr %#x.\n", hr); @@ -12701,18 +13622,18 @@ hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); ok(SUCCEEDED(hr), "Present failed (0x%08x)\n", hr); - IDirect3DDevice9_SetRenderState(device, D3DRS_CLIPPLANEENABLE, 0); - hr = IDirect3DDevice9_SetVertexShader(device, NULL); - ok(hr == D3D_OK, "IDirect3DDevice9_SetVertexShader failed, hr=%08x\n", hr); IDirect3DVertexShader9_Release(shader); - hr = IDirect3DDevice9_SetRenderTarget(device, 0, original_rt); - ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderTarget failed, hr=%08x\n", hr); IDirect3DSurface9_Release(original_rt); IDirect3DSurface9_Release(offscreen_surface); IDirect3DTexture9_Release(offscreen); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } -static void fp_special_test(IDirect3DDevice9 *device) +static void fp_special_test(void) { /* Microsoft's assembler generates nan and inf with "1.#QNAN" and "1.#INF." respectively */ static const DWORD vs_header[] = @@ -12767,6 +13688,7 @@ D3DCOLOR r600; D3DCOLOR nv40; D3DCOLOR nv50; + D3DCOLOR warp; } vs_body[] = { @@ -12781,18 +13703,19 @@ * written to the blue component. * * There are considerable differences between graphics cards in how - * these are handled, but pow and nrm never generate INF or NAN. */ - {"log", vs_log, sizeof(vs_log), 0x00000000, 0x00000000, 0x00ff0000, 0x00ff7f00}, - {"pow", vs_pow, sizeof(vs_pow), 0x000000ff, 0x000000ff, 0x0000ff00, 0x000000ff}, - {"nrm", vs_nrm, sizeof(vs_nrm), 0x00ff0000, 0x00ff0000, 0x0000ff00, 0x00ff0000}, - {"rcp1", vs_rcp1, sizeof(vs_rcp1), 0x000000ff, 0x000000ff, 0x00ff00ff, 0x00ff7f00}, - {"rcp2", vs_rcp2, sizeof(vs_rcp2), 0x000000ff, 0x00000000, 0x00ff0000, 0x00ff7f00}, - {"rsq1", vs_rsq1, sizeof(vs_rsq1), 0x000000ff, 0x000000ff, 0x00ff00ff, 0x00ff7f00}, - {"rsq2", vs_rsq2, sizeof(vs_rsq2), 0x000000ff, 0x000000ff, 0x00ff00ff, 0x00ff7f00}, - {"lit", vs_lit, sizeof(vs_lit), 0x00ff0000, 0x00ff0000, 0x00ff0000, 0x00ff0000}, - {"def1", vs_def1, sizeof(vs_def1), 0x000000ff, 0x00007f00, 0x0000ff00, 0x00007f00}, - {"def2", vs_def2, sizeof(vs_def2), 0x00ff0000, 0x00ff7f00, 0x00ff0000, 0x00ff7f00}, - {"def3", vs_def3, sizeof(vs_def3), 0x00ff00ff, 0x00ff7f00, 0x00ff00ff, 0x00ff7f00}, + * these are handled, but pow and nrm never generate INF or NAN on + * real hardware. */ + {"log", vs_log, sizeof(vs_log), 0x00000000, 0x00000000, 0x00ff0000, 0x00ff7f00, 0x00ff8000}, + {"pow", vs_pow, sizeof(vs_pow), 0x000000ff, 0x000000ff, 0x0000ff00, 0x000000ff, 0x00008000}, + {"nrm", vs_nrm, sizeof(vs_nrm), 0x00ff0000, 0x00ff0000, 0x0000ff00, 0x00ff0000, 0x00008000}, + {"rcp1", vs_rcp1, sizeof(vs_rcp1), 0x000000ff, 0x000000ff, 0x00ff00ff, 0x00ff7f00, 0x00ff8000}, + {"rcp2", vs_rcp2, sizeof(vs_rcp2), 0x000000ff, 0x00000000, 0x00ff0000, 0x00ff7f00, 0x00ff8000}, + {"rsq1", vs_rsq1, sizeof(vs_rsq1), 0x000000ff, 0x000000ff, 0x00ff00ff, 0x00ff7f00, 0x00ff8000}, + {"rsq2", vs_rsq2, sizeof(vs_rsq2), 0x000000ff, 0x000000ff, 0x00ff00ff, 0x00ff7f00, 0x00ff8000}, + {"lit", vs_lit, sizeof(vs_lit), 0x00ff0000, 0x00ff0000, 0x00ff0000, 0x00ff0000, 0x00ff0000}, + {"def1", vs_def1, sizeof(vs_def1), 0x000000ff, 0x00007f00, 0x0000ff00, 0x00007f00, 0x00008000}, + {"def2", vs_def2, sizeof(vs_def2), 0x00ff0000, 0x00ff7f00, 0x00ff0000, 0x00ff7f00, 0x00ff8000}, + {"def3", vs_def3, sizeof(vs_def3), 0x00ff00ff, 0x00ff7f00, 0x00ff00ff, 0x00ff7f00, 0x00ff8000}, }; static const DWORD ps_code[] = @@ -12837,18 +13760,33 @@ }; IDirect3DPixelShader9 *ps; + IDirect3DDevice9 *device; UINT body_size = 0; + IDirect3D9 *d3d; DWORD *vs_code; + ULONG refcount; D3DCAPS9 caps; + HWND window; HRESULT hr; UINT i; + 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"); + goto done; + } + hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); ok(SUCCEEDED(hr), "GetDeviceCaps failed, hr %#x.\n", hr); if (caps.PixelShaderVersion < D3DPS_VERSION(2, 0) || caps.VertexShaderVersion < D3DVS_VERSION(2, 0)) { skip("No shader model 2.0 support, skipping floating point specials test.\n"); - return; + IDirect3DDevice9_Release(device); + goto done; } hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_TEX1 | D3DFVF_TEXCOORDSIZE1(0)); @@ -12899,7 +13837,8 @@ ok(color_match(color, vs_body[i].r500, 1) || color_match(color, vs_body[i].r600, 1) || color_match(color, vs_body[i].nv40, 1) - || color_match(color, vs_body[i].nv50, 1), + || color_match(color, vs_body[i].nv50, 1) + || broken(color_match(color, vs_body[i].warp, 1)), "Expected color 0x%08x, 0x%08x, 0x%08x or 0x%08x for instruction \"%s\", got 0x%08x.\n", vs_body[i].r500, vs_body[i].r600, vs_body[i].nv40, vs_body[i].nv50, vs_body[i].name, color); @@ -12916,13 +13855,21 @@ hr = IDirect3DDevice9_SetPixelShader(device, NULL); ok(SUCCEEDED(hr), "SetPixelShader failed, hr %#x.\n", hr); IDirect3DPixelShader9_Release(ps); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } -static void srgbwrite_format_test(IDirect3DDevice9 *device) +static void srgbwrite_format_test(void) { IDirect3D9 *d3d; IDirect3DSurface9 *rt, *backbuffer; IDirect3DTexture9 *texture; + IDirect3DDevice9 *device; + ULONG refcount; + HWND window; HRESULT hr; int i; DWORD color_rgb = 0x00808080, color_srgb = 0x00bcbcbc, color; @@ -12952,8 +13899,16 @@ { 1.0f, 1.0f, 0.1f, 1.0f, 1.0f} }; - hr = IDirect3DDevice9_GetDirect3D(device, &d3d); - ok(SUCCEEDED(hr), "GetDirect3D failed, hr %#x.\n", hr); + 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"); + goto done; + } + hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_TEX1); ok(SUCCEEDED(hr), "SetFVF failed, hr %#x.\n", hr); hr = IDirect3DDevice9_GetBackBuffer(device, 0, 0, D3DBACKBUFFER_TYPE_MONO, &backbuffer); @@ -12973,10 +13928,10 @@ continue; } - hr = IDirect3DDevice9_CreateTexture(device, 8, 8, 1, D3DUSAGE_RENDERTARGET, formats[i].fmt, - D3DPOOL_DEFAULT, &texture, NULL); + hr = IDirect3DDevice9_CreateTexture(device, 8, 8, 1, D3DUSAGE_RENDERTARGET, + formats[i].fmt, D3DPOOL_DEFAULT, &texture, NULL); ok(SUCCEEDED(hr), "CreateTexture failed, hr %#x.\n", hr); - hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0x00ff0000, 0.0f, 0); + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0x00ff0000, 1.0f, 0); ok(SUCCEEDED(hr), "Clear failed, hr %#x.\n", hr); hr = IDirect3DTexture9_GetSurfaceLevel(texture, 0, &rt); @@ -12987,32 +13942,30 @@ ok(SUCCEEDED(hr), "Clear failed, hr %#x.\n", hr); hr = IDirect3DDevice9_BeginScene(device); - ok(SUCCEEDED(hr), "BeginScene failed, hr %#x.\n", hr); - if(SUCCEEDED(hr)) - { - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_SRGBWRITEENABLE, TRUE); - ok(SUCCEEDED(hr), "SetRenderState failed, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLORARG1, D3DTA_TFACTOR); - ok(SUCCEEDED(hr), "SetTextureStageState failed, hr %#x.\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(*quad)); - ok(SUCCEEDED(hr), "DrawPrimitive failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_SRGBWRITEENABLE, FALSE); - ok(SUCCEEDED(hr), "SetRenderState failed, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetRenderTarget(device, 0, backbuffer); - ok(SUCCEEDED(hr), "SetRenderTarget failed, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetTexture(device, 0, (IDirect3DBaseTexture9 *) texture); - ok(SUCCEEDED(hr), "SetTexture failed, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLORARG1, D3DTA_TEXTURE); - ok(SUCCEEDED(hr), "SetTextureStageState failed, hr %#x.\n", hr); - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(*quad)); - ok(SUCCEEDED(hr), "DrawPrimitive failed, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetTexture(device, 0, NULL); - ok(SUCCEEDED(hr), "SetTexture failed, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_SRGBWRITEENABLE, TRUE); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLORARG1, D3DTA_TFACTOR); + ok(SUCCEEDED(hr), "Failed to set texture stage state, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(*quad)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); - hr = IDirect3DDevice9_EndScene(device); - ok(SUCCEEDED(hr), "EndScene failed, hr %#x.\n", hr); - } + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_SRGBWRITEENABLE, FALSE); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderTarget(device, 0, backbuffer); + ok(SUCCEEDED(hr), "Failed to set render target, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetTexture(device, 0, (IDirect3DBaseTexture9 *) texture); + ok(SUCCEEDED(hr), "Failed to set texture, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLORARG1, D3DTA_TEXTURE); + ok(SUCCEEDED(hr), "Failed to set texture stage state, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(*quad)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetTexture(device, 0, NULL); + ok(SUCCEEDED(hr), "Failed to set texture, hr %#x.\n", hr); + + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); IDirect3DSurface9_Release(rt); IDirect3DTexture9_Release(texture); @@ -13037,30 +13990,46 @@ ok(SUCCEEDED(hr), "Present failed, hr %#x.\n", hr); } - hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_DISABLE); - ok(SUCCEEDED(hr), "SetTextureStageState failed, hr %#x.\n", hr); - - IDirect3D9_Release(d3d); IDirect3DSurface9_Release(backbuffer); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } -static void ds_size_test(IDirect3DDevice9 *device) +static void ds_size_test(void) { IDirect3DSurface9 *ds, *rt, *old_rt, *old_ds, *readback; - HRESULT hr; + IDirect3DDevice9 *device; DWORD num_passes; - struct + IDirect3D9 *d3d; + ULONG refcount; + HWND window; + HRESULT hr; + + static const struct { float x, y, z; } quad[] = { - {-1.0, -1.0, 0.0 }, - {-1.0, 1.0, 0.0 }, - { 1.0, -1.0, 0.0 }, - { 1.0, 1.0, 0.0 } + {-1.0f, -1.0f, 0.0f}, + {-1.0f, 1.0f, 0.0f}, + { 1.0f, -1.0f, 0.0f}, + { 1.0f, 1.0f, 0.0f}, }; + 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"); + goto done; + } + hr = IDirect3DDevice9_CreateRenderTarget(device, 64, 64, D3DFMT_A8R8G8B8, D3DMULTISAMPLE_NONE, 0, FALSE, &rt, NULL); ok(SUCCEEDED(hr), "IDirect3DDevice9_CreateRenderTarget failed, hr %#x.\n", hr); hr = IDirect3DDevice9_CreateDepthStencilSurface(device, 32, 32, D3DFMT_D24X8, D3DMULTISAMPLE_NONE, 0, TRUE, &ds, NULL); @@ -13068,6 +14037,9 @@ hr = IDirect3DDevice9_CreateOffscreenPlainSurface(device, 64, 64, D3DFMT_A8R8G8B8, D3DPOOL_SYSTEMMEM, &readback, NULL); ok(SUCCEEDED(hr), "IDirect3DDevice9_CreateOffscreenPlainSurface failed, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ); + ok(SUCCEEDED(hr), "Failed to set FVF, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ZENABLE, FALSE); ok(SUCCEEDED(hr), "IDirect3DDevice9_SetRenderState failed, hr %#x.\n", hr); hr = IDirect3DDevice9_SetRenderState(device, D3DRS_STENCILENABLE, FALSE); @@ -13112,22 +14084,18 @@ ok(hr == D3DERR_CONFLICTINGRENDERSTATE || hr == D3D_OK, "IDirect3DDevice9_ValidateDevice returned %#x, expected " "D3DERR_CONFLICTINGRENDERSTATE.\n", hr); - /* Try to draw with the device in an invalid state */ - hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ); - ok(SUCCEEDED(hr), "IDirect3DDevice9_SetFVF failed, hr %#x.\n", hr); + /* Try to draw with the device in an invalid state. */ hr = IDirect3DDevice9_BeginScene(device); - ok(SUCCEEDED(hr), "IDirect3DDevice9_BeginScene failed, hr %#x.\n", hr); - if(SUCCEEDED(hr)) - { - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(*quad)); - ok(SUCCEEDED(hr), "IDirect3DDevice9_DrawPrimitiveUP failed, hr %#x.\n", hr); - hr = IDirect3DDevice9_EndScene(device); - ok(SUCCEEDED(hr), "IDirect3DDevice9_EndScene failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(*quad)); + 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); - /* Don't check the resulting draw unless we find an app that needs it. On nvidia ValidateDevice - * returns CONFLICTINGRENDERSTATE, so the result is undefined. On AMD d3d seems to assume the - * stored Z buffer value is 0.0 for all pixels, even those that are covered by the depth buffer */ - } + /* Don't check the resulting draw unless we find an app that needs it. On + * NVIDIA ValidateDevice() returns CONFLICTINGRENDERSTATE, so the result + * is undefined. On AMD D3D seems to assume the stored Z buffer value is + * 0.0 for all pixels, even those that are covered by the depth buffer. */ hr = IDirect3DDevice9_SetRenderTarget(device, 0, old_rt); ok(SUCCEEDED(hr), "IDirect3DDevice9_SetRenderTarget failed, hr %#x.\n", hr); @@ -13141,15 +14109,24 @@ IDirect3DSurface9_Release(rt); IDirect3DSurface9_Release(old_rt); IDirect3DSurface9_Release(old_ds); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } -static void unbound_sampler_test(IDirect3DDevice9 *device) +static void unbound_sampler_test(void) { - HRESULT hr; IDirect3DPixelShader9 *ps, *ps_cube, *ps_volume; IDirect3DSurface9 *rt, *old_rt; - DWORD color; + IDirect3DDevice9 *device; + IDirect3D9 *d3d; + ULONG refcount; D3DCAPS9 caps; + DWORD color; + HWND window; + HRESULT hr; static const DWORD ps_code[] = { @@ -13192,12 +14169,29 @@ { 1.0f, 1.0f, 0.1f, 1.0f, 1.0f} }; + 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"); + goto done; + } + hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); - ok(SUCCEEDED(hr), "GetDeviceCaps failed, hr %#x.\n", hr); + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); + if (caps.PixelShaderVersion < D3DPS_VERSION(2, 0)) + { + skip("No ps_2_0 support, skipping tests.\n"); + IDirect3DDevice9_Release(device); + goto done; + } if (!(caps.TextureCaps & D3DPTEXTURECAPS_CUBEMAP) || !(caps.TextureCaps & D3DPTEXTURECAPS_VOLUMEMAP)) { - skip("No cube / volume textures support, skipping the unbound sampler test.\n"); - return; + skip("No cube / volume texture support, skipping tests.\n"); + IDirect3DDevice9_Release(device); + goto done; } hr = IDirect3DDevice9_SetTexture(device, 0, NULL); @@ -13222,22 +14216,18 @@ hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_TEX1 ); ok(SUCCEEDED(hr), "IDirect3DDevice9_SetFVF failed, hr %#x.\n", hr); - hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0x56ffffff, 0, 0); + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0x56ffffff, 1.0f, 0); ok(SUCCEEDED(hr), "IDirect3DDevice9_Clear failed, hr %#x.\n", hr); hr = IDirect3DDevice9_SetPixelShader(device, ps); ok(SUCCEEDED(hr), "IDirect3DDevice9_SetPixelShader failed, hr %#x.\n", hr); hr = IDirect3DDevice9_BeginScene(device); - ok(SUCCEEDED(hr), "IDirect3DDevice9_BeginScene failed, hr %#x.\n", hr); - if(SUCCEEDED(hr)) - { - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(*quad)); - ok(SUCCEEDED(hr), "IDirect3DDevice9_DrawPrimitiveUP failed, hr %#x.\n", hr); - - hr = IDirect3DDevice9_EndScene(device); - ok(SUCCEEDED(hr), "IDirect3DDevice9_EndScene failed, hr %#x.\n", hr); - } + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(*quad)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); color = getPixelColorFromSurface(rt, 32, 32); ok(color == 0xff000000, "Unbound sampler color is %#x.\n", color); @@ -13247,15 +14237,11 @@ ok(SUCCEEDED(hr), "IDirect3DDevice9_SetPixelShader failed, hr %#x.\n", hr); hr = IDirect3DDevice9_BeginScene(device); - ok(SUCCEEDED(hr), "IDirect3DDevice9_BeginScene failed, hr %#x.\n", hr); - if (SUCCEEDED(hr)) - { - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(*quad)); - ok(SUCCEEDED(hr), "IDirect3DDevice9_DrawPrimitiveUP failed, hr %#x.\n", hr); - - hr = IDirect3DDevice9_EndScene(device); - ok(SUCCEEDED(hr), "IDirect3DDevice9_EndScene failed, hr %#x.\n", hr); - } + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(*quad)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); color = getPixelColorFromSurface(rt, 32, 32); ok(color == 0xff000000, "Unbound sampler color is %#x.\n", color); @@ -13265,33 +14251,28 @@ ok(SUCCEEDED(hr), "IDirect3DDevice9_SetPixelShader failed, hr %#x.\n", hr); hr = IDirect3DDevice9_BeginScene(device); - ok(SUCCEEDED(hr), "IDirect3DDevice9_BeginScene failed, hr %#x.\n", hr); - if (SUCCEEDED(hr)) - { - hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(*quad)); - ok(SUCCEEDED(hr), "IDirect3DDevice9_DrawPrimitiveUP failed, hr %#x.\n", hr); - - hr = IDirect3DDevice9_EndScene(device); - ok(SUCCEEDED(hr), "IDirect3DDevice9_EndScene failed, hr %#x.\n", hr); - } + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(*quad)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); color = getPixelColorFromSurface(rt, 32, 32); ok(color == 0xff000000, "Unbound sampler color is %#x.\n", color); - hr = IDirect3DDevice9_SetRenderTarget(device, 0, old_rt); - ok(SUCCEEDED(hr), "IDirect3DDevice9_SetRenderTarget failed, hr %#x.\n", hr); - - hr = IDirect3DDevice9_SetPixelShader(device, NULL); - ok(SUCCEEDED(hr), "IDirect3DDevice9_SetPixelShader failed, hr %#x.\n", hr); - IDirect3DSurface9_Release(rt); IDirect3DSurface9_Release(old_rt); IDirect3DPixelShader9_Release(ps); IDirect3DPixelShader9_Release(ps_cube); IDirect3DPixelShader9_Release(ps_volume); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } -static void update_surface_test(IDirect3DDevice9 *device) +static void update_surface_test(void) { static const BYTE blocks[][8] = { @@ -13349,23 +14330,28 @@ IDirect3DSurface9 *src_surface, *dst_surface; IDirect3DTexture9 *src_tex, *dst_tex; + IDirect3DDevice9 *device; IDirect3D9 *d3d; + ULONG refcount; UINT count, i; + HWND window; HRESULT hr; - hr = IDirect3DDevice9_GetDirect3D(device, &d3d); - ok(SUCCEEDED(hr), "GetDirect3D failed, hr %#x.\n", hr); - - hr = IDirect3D9_CheckDeviceFormat(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, - D3DFMT_X8R8G8B8, 0, D3DRTYPE_TEXTURE, D3DFMT_DXT1); - IDirect3D9_Release(d3d); - if (FAILED(hr)) + 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 (FAILED(IDirect3D9_CheckDeviceFormat(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, + D3DFMT_X8R8G8B8, 0, D3DRTYPE_TEXTURE, D3DFMT_DXT1))) { - skip("DXT1 not supported, skipping test.\n"); - return; + skip("DXT1 not supported, skipping tests.\n"); + goto done; + } + if (!(device = create_device(d3d, window, window, TRUE))) + { + skip("Failed to create a D3D device, skipping tests.\n"); + goto done; } - - IDirect3D9_Release(d3d); hr = IDirect3DDevice9_CreateTexture(device, 64, 64, 0, 0, D3DFMT_DXT1, D3DPOOL_SYSTEMMEM, &src_tex, NULL); ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr); @@ -13470,29 +14456,38 @@ hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); ok(SUCCEEDED(hr), "Present failed, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetTexture(device, 0, NULL); - ok(SUCCEEDED(hr), "SetTexture failed, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_DISABLE); - ok(SUCCEEDED(hr), "SetTextureStageState failed, hr %#x.\n", hr); IDirect3DTexture9_Release(dst_tex); IDirect3DTexture9_Release(src_tex); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } -static void multisample_get_rtdata_test(IDirect3DDevice9 *device) +static void multisample_get_rtdata_test(void) { IDirect3DSurface9 *original_ds, *original_rt, *rt, *readback; - IDirect3D9 *d3d9; + IDirect3DDevice9 *device; + IDirect3D9 *d3d; + ULONG refcount; + HWND window; HRESULT hr; - hr = IDirect3DDevice9_GetDirect3D(device, &d3d9); - ok(SUCCEEDED(hr), "Failed to get d3d9 interface, hr %#x.\n", hr); - hr = IDirect3D9_CheckDeviceMultiSampleType(d3d9, D3DADAPTER_DEFAULT, - D3DDEVTYPE_HAL, D3DFMT_A8R8G8B8, TRUE, D3DMULTISAMPLE_2_SAMPLES, NULL); - IDirect3D9_Release(d3d9); - if (FAILED(hr)) + 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 (FAILED(IDirect3D9_CheckDeviceMultiSampleType(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, + D3DFMT_A8R8G8B8, TRUE, D3DMULTISAMPLE_2_SAMPLES, NULL))) { - skip("Multisampling not supported for D3DFMT_A8R8G8B8, skipping multisampled CopyRects test.\n"); - return; + skip("Multisampling not supported for D3DFMT_A8R8G8B8, skipping tests.\n"); + goto done; + } + if (!(device = create_device(d3d, window, window, TRUE))) + { + skip("Failed to create a D3D device, skipping tests.\n"); + goto done; } hr = IDirect3DDevice9_CreateRenderTarget(device, 256, 256, D3DFMT_A8R8G8B8, @@ -13526,12 +14521,18 @@ IDirect3DSurface9_Release(original_rt); IDirect3DSurface9_Release(readback); IDirect3DSurface9_Release(rt); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } -static void multisampled_depth_buffer_test(IDirect3D9 *d3d9) +static void multisampled_depth_buffer_test(void) { IDirect3DDevice9 *device = 0; IDirect3DSurface9 *original_rt, *rt, *readback, *ds, *original_ds; + IDirect3D9 *d3d; D3DCAPS9 caps; HRESULT hr; D3DPRESENT_PARAMETERS present_parameters; @@ -13572,18 +14573,21 @@ {560, 450, D3DCOLOR_ARGB(0xff, 0x00, 0x00, 0xff)}, }; - hr = IDirect3D9_CheckDeviceMultiSampleType(d3d9, D3DADAPTER_DEFAULT, - D3DDEVTYPE_HAL, D3DFMT_A8R8G8B8, TRUE, D3DMULTISAMPLE_2_SAMPLES, NULL); - if (FAILED(hr)) + d3d = Direct3DCreate9(D3D_SDK_VERSION); + ok(!!d3d, "Failed to create a D3D object.\n"); + + if (FAILED(IDirect3D9_CheckDeviceMultiSampleType(d3d, D3DADAPTER_DEFAULT, + D3DDEVTYPE_HAL, D3DFMT_A8R8G8B8, TRUE, D3DMULTISAMPLE_2_SAMPLES, NULL))) { skip("Multisampling not supported for D3DFMT_A8R8G8B8, skipping multisampled depth buffer test.\n"); + IDirect3D9_Release(d3d); return; } - hr = IDirect3D9_CheckDeviceMultiSampleType(d3d9, D3DADAPTER_DEFAULT, - D3DDEVTYPE_HAL, D3DFMT_D24S8, TRUE, D3DMULTISAMPLE_2_SAMPLES, NULL); - if (FAILED(hr)) + if (FAILED(IDirect3D9_CheckDeviceMultiSampleType(d3d, D3DADAPTER_DEFAULT, + D3DDEVTYPE_HAL, D3DFMT_D24S8, TRUE, D3DMULTISAMPLE_2_SAMPLES, NULL))) { skip("Multisampling not supported for D3DFMT_D24S8, skipping multisampled depth buffer test.\n"); + IDirect3D9_Release(d3d); return; } @@ -13598,7 +14602,7 @@ present_parameters.AutoDepthStencilFormat = D3DFMT_D24S8; present_parameters.MultiSampleType = D3DMULTISAMPLE_2_SAMPLES; - hr = IDirect3D9_CreateDevice(d3d9, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, + hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, present_parameters.hDeviceWindow, D3DCREATE_HARDWARE_VERTEXPROCESSING, &present_parameters, &device); ok(hr == D3D_OK, "Failed to create a device, hr %#x.\n", hr); @@ -13735,7 +14739,7 @@ present_parameters.AutoDepthStencilFormat = D3DFMT_D24S8; present_parameters.MultiSampleType = D3DMULTISAMPLE_NONE; - hr = IDirect3D9_CreateDevice(d3d9, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, + hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, present_parameters.hDeviceWindow, D3DCREATE_HARDWARE_VERTEXPROCESSING, &present_parameters, &device); ok(hr == D3D_OK, "Failed to create a device, hr %#x.\n", hr); @@ -13828,9 +14832,10 @@ IDirect3DSurface9_Release(rt); cleanup: cleanup_device(device); + IDirect3D9_Release(d3d); } -static void resz_test(IDirect3D9 *d3d9) +static void resz_test(void) { IDirect3DDevice9 *device = 0; IDirect3DSurface9 *rt, *original_rt, *ds, *readback, *intz_ds; @@ -13882,36 +14887,40 @@ }; IDirect3DTexture9 *texture; IDirect3DPixelShader9 *ps; + IDirect3D9 *d3d; DWORD value; - hr = IDirect3D9_CheckDeviceMultiSampleType(d3d9, D3DADAPTER_DEFAULT, - D3DDEVTYPE_HAL, D3DFMT_A8R8G8B8, TRUE, D3DMULTISAMPLE_2_SAMPLES, NULL); - if (FAILED(hr)) + d3d = Direct3DCreate9(D3D_SDK_VERSION); + ok(!!d3d, "Failed to create a D3D object.\n"); + + if (FAILED(IDirect3D9_CheckDeviceMultiSampleType(d3d, D3DADAPTER_DEFAULT, + D3DDEVTYPE_HAL, D3DFMT_A8R8G8B8, TRUE, D3DMULTISAMPLE_2_SAMPLES, NULL))) { skip("Multisampling not supported for D3DFMT_A8R8G8B8, skipping RESZ test.\n"); + IDirect3D9_Release(d3d); return; } - hr = IDirect3D9_CheckDeviceMultiSampleType(d3d9, D3DADAPTER_DEFAULT, - D3DDEVTYPE_HAL, D3DFMT_D24S8, TRUE, D3DMULTISAMPLE_2_SAMPLES, NULL); - if (FAILED(hr)) + if (FAILED(IDirect3D9_CheckDeviceMultiSampleType(d3d, D3DADAPTER_DEFAULT, + D3DDEVTYPE_HAL, D3DFMT_D24S8, TRUE, D3DMULTISAMPLE_2_SAMPLES, NULL))) { skip("Multisampling not supported for D3DFMT_D24S8, skipping RESZ test.\n"); + IDirect3D9_Release(d3d); return; } - hr = IDirect3D9_CheckDeviceFormat(d3d9, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, D3DFMT_X8R8G8B8, - D3DUSAGE_DEPTHSTENCIL, D3DRTYPE_TEXTURE, MAKEFOURCC('I','N','T','Z')); - if (FAILED(hr)) + if (FAILED(IDirect3D9_CheckDeviceFormat(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, D3DFMT_X8R8G8B8, + D3DUSAGE_DEPTHSTENCIL, D3DRTYPE_TEXTURE, MAKEFOURCC('I','N','T','Z')))) { skip("No INTZ support, skipping RESZ test.\n"); + IDirect3D9_Release(d3d); return; } - hr = IDirect3D9_CheckDeviceFormat(d3d9, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, D3DFMT_X8R8G8B8, - D3DUSAGE_RENDERTARGET, D3DRTYPE_SURFACE, MAKEFOURCC('R','E','S','Z')); - if (FAILED(hr)) + if (FAILED(IDirect3D9_CheckDeviceFormat(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, D3DFMT_X8R8G8B8, + D3DUSAGE_RENDERTARGET, D3DRTYPE_SURFACE, MAKEFOURCC('R','E','S','Z')))) { skip("No RESZ support, skipping RESZ test.\n"); + IDirect3D9_Release(d3d); return; } @@ -13926,7 +14935,7 @@ present_parameters.AutoDepthStencilFormat = D3DFMT_D24S8; present_parameters.MultiSampleType = D3DMULTISAMPLE_NONE; - hr = IDirect3D9_CreateDevice(d3d9, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, + hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, present_parameters.hDeviceWindow, D3DCREATE_HARDWARE_VERTEXPROCESSING, &present_parameters, &device); ok(hr == D3D_OK, "Failed to create a device, hr %#x.\n", hr); @@ -13936,12 +14945,14 @@ { skip("No pixel shader 2.0 support, skipping INTZ test.\n"); cleanup_device(device); + IDirect3D9_Release(d3d); return; } if (caps.TextureCaps & D3DPTEXTURECAPS_POW2) { skip("No unconditional NP2 texture support, skipping INTZ test.\n"); cleanup_device(device); + IDirect3D9_Release(d3d); return; } @@ -14082,7 +15093,7 @@ present_parameters.AutoDepthStencilFormat = D3DFMT_D24S8; present_parameters.MultiSampleType = D3DMULTISAMPLE_2_SAMPLES; - hr = IDirect3D9_CreateDevice(d3d9, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, + hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, present_parameters.hDeviceWindow, D3DCREATE_HARDWARE_VERTEXPROCESSING, &present_parameters, &device); ok(hr == D3D_OK, "Failed to create a device, hr %#x.\n", hr); @@ -14301,9 +15312,10 @@ IDirect3DSurface9_Release(readback); IDirect3DSurface9_Release(original_rt); cleanup_device(device); + IDirect3D9_Release(d3d); } -static void zenable_test(IDirect3DDevice9 *device) +static void zenable_test(void) { static const struct { @@ -14317,12 +15329,26 @@ {{640.0f, 480.0f, 1.5f, 1.0f}, 0xff00ff00}, {{640.0f, 0.0f, 1.5f, 1.0f}, 0xff00ff00}, }; + IDirect3DDevice9 *device; + IDirect3D9 *d3d; D3DCOLOR color; + ULONG refcount; D3DCAPS9 caps; + HWND window; HRESULT hr; UINT x, y; UINT i, j; + 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"); + goto done; + } + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ZENABLE, D3DZB_FALSE); ok(SUCCEEDED(hr), "Failed to disable z-buffering, hr %#x.\n", hr); hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZRHW | D3DFVF_DIFFUSE); @@ -14386,6 +15412,15 @@ 0x00ff0000, 0x00606060, 0x009f609f, 0x00ff0000, 0x00ff0000, 0x00602060, 0x009f209f, 0x00ff0000, }; + /* The Windows 8 testbot (WARP) appears to not clip z for regular + * vertices either. */ + static const D3DCOLOR expected_broken[] = + { + 0x0020df20, 0x0060df60, 0x009fdf9f, 0x00dfdfdf, + 0x00209f20, 0x00609f60, 0x009f9f9f, 0x00df9fdf, + 0x00206020, 0x00606060, 0x009f609f, 0x00df60df, + 0x00202020, 0x00602060, 0x009f209f, 0x00df20df, + }; IDirect3DVertexShader9 *vs; IDirect3DPixelShader9 *ps; @@ -14417,7 +15452,8 @@ x = 80 * ((2 * j) + 1); y = 60 * ((2 * i) + 1); color = getPixelColor(device, x, y); - ok(color_match(color, expected[i * 4 + j], 1), + ok(color_match(color, expected[i * 4 + j], 1) + || broken(color_match(color, expected_broken[i * 4 + j], 1)), "Expected color 0x%08x at %u, %u, got 0x%08x.\n", expected[i * 4 + j], x, y, color); } } @@ -14425,16 +15461,18 @@ hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); ok(SUCCEEDED(hr), "Failed to present backbuffer, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetPixelShader(device, NULL); - ok(SUCCEEDED(hr), "Failed to set pixel shader, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetVertexShader(device, NULL); - ok(SUCCEEDED(hr), "Failed to set vertex shader, hr %#x.\n", hr); IDirect3DPixelShader9_Release(ps); IDirect3DVertexShader9_Release(vs); } + + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } -static void fog_special_test(IDirect3DDevice9 *device) +static void fog_special_test(void) { static const struct { @@ -14444,8 +15482,8 @@ quad[] = { {{ -1.0f, -1.0f, 0.0f}, 0xff00ff00}, - {{ 1.0f, -1.0f, 1.0f}, 0xff00ff00}, {{ -1.0f, 1.0f, 0.0f}, 0xff00ff00}, + {{ 1.0f, -1.0f, 1.0f}, 0xff00ff00}, {{ 1.0f, 1.0f, 1.0f}, 0xff00ff00} }; static const struct @@ -14481,6 +15519,13 @@ 0x00000001, 0xd00f0000, 0x90e40001, /* mov oD0, v1 */ 0x0000ffff }; + static const D3DMATRIX identity = + {{{ + 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, + }}}; union { float f; @@ -14491,7 +15536,21 @@ unsigned int i; IDirect3DPixelShader9 *ps; IDirect3DVertexShader9 *vs; + IDirect3DDevice9 *device; + IDirect3D9 *d3d; + ULONG refcount; D3DCAPS9 caps; + HWND window; + + 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"); + goto done; + } hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); @@ -14516,8 +15575,16 @@ ps = NULL; } + /* The table fog tests seem to depend on the projection matrix explicitly + * being set to an identity matrix, even though that's the default. + * (AMD Radeon HD 6310, Windows 7) */ + hr = IDirect3DDevice9_SetTransform(device, D3DTS_PROJECTION, &identity); + ok(SUCCEEDED(hr), "Failed to set projection transform, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_DIFFUSE); ok(SUCCEEDED(hr), "Failed to set FVF, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_LIGHTING, FALSE); + ok(SUCCEEDED(hr), "Failed to disable lighting, hr %#x.\n", hr); hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGENABLE, TRUE); ok(SUCCEEDED(hr), "Failed to enable fog, hr %#x.\n", hr); hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGCOLOR, 0xffff0000); @@ -14531,7 +15598,7 @@ for (i = 0; i < sizeof(tests) / sizeof(*tests); i++) { - hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff0000ff, 0.0f, 0); + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff0000ff, 1.0f, 0); ok(SUCCEEDED(hr), "Failed to clear render target, hr %#x.\n", hr); if (!tests[i].vs) @@ -14587,27 +15654,30 @@ ok(SUCCEEDED(hr), "Failed to present backbuffer, hr %#x.\n", hr); } - hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGENABLE, FALSE); - ok(SUCCEEDED(hr), "Failed to disable fog, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetPixelShader(device, NULL); - ok(SUCCEEDED(hr), "Failed to set pixel shader, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetVertexShader(device, NULL); - ok(SUCCEEDED(hr), "Failed to set vertex shader, hr %#x.\n", hr); if (vs) IDirect3DVertexShader9_Release(vs); if (ps) IDirect3DPixelShader9_Release(ps); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } -static void volume_srgb_test(IDirect3DDevice9 *device) +static void volume_srgb_test(void) { HRESULT hr; - IDirect3D9 *d3d9; unsigned int i, j; IDirect3DVolumeTexture9 *tex1, *tex2; D3DPOOL pool; D3DLOCKED_BOX locked_box; + IDirect3DDevice9 *device; + IDirect3D9 *d3d; D3DCOLOR color; + ULONG refcount; + HWND window; + static const struct { BOOL srgb; @@ -14627,22 +15697,26 @@ } quad[] = { - { {-1.0, -1.0, 0.0}, {0.0, 0.0, 0.0} }, - { { 1.0, -1.0, 0.0}, {0.0, 0.0, 0.0} }, - { {-1.0, 1.0, 0.0}, {0.0, 0.0, 0.0} }, - { { 1.0, 1.0, 0.0}, {0.0, 0.0, 0.0} }, + {{-1.0f, -1.0f, 0.0f}, {0.0f, 0.0f, 0.0f}}, + {{-1.0f, 1.0f, 0.0f}, {0.0f, 0.0f, 0.0f}}, + {{ 1.0f, -1.0f, 0.0f}, {0.0f, 0.0f, 0.0f}}, + {{ 1.0f, 1.0f, 0.0f}, {0.0f, 0.0f, 0.0f}}, }; - hr = IDirect3DDevice9_GetDirect3D(device, &d3d9); - ok(SUCCEEDED(hr), "Failed to get d3d9 interface, hr %#x.\n", hr); - - hr = IDirect3D9_CheckDeviceFormat(d3d9, 0, D3DDEVTYPE_HAL, D3DFMT_X8R8G8B8, - D3DUSAGE_QUERY_SRGBREAD, D3DRTYPE_VOLUMETEXTURE, D3DFMT_A8R8G8B8); - if (hr != D3D_OK) + 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 (IDirect3D9_CheckDeviceFormat(d3d, 0, D3DDEVTYPE_HAL, D3DFMT_X8R8G8B8, + D3DUSAGE_QUERY_SRGBREAD, D3DRTYPE_VOLUMETEXTURE, D3DFMT_A8R8G8B8) != D3D_OK) { skip("D3DFMT_A8R8G8B8 volume textures with SRGBREAD not supported.\n"); - IDirect3D9_Release(d3d9); - return; + goto done; + } + if (!(device = create_device(d3d, window, window, TRUE))) + { + skip("Failed to create a D3D device, skipping tests.\n"); + goto done; } hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1); @@ -14710,22 +15784,25 @@ } } - hr = IDirect3DDevice9_SetTexture(device, 0, NULL); - ok(SUCCEEDED(hr), "Failed to set texture, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_DISABLE); - ok(SUCCEEDED(hr), "Failed to set color op 0, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_SRGBTEXTURE, FALSE); - ok(SUCCEEDED(hr), "Failed to set srgb state, hr %#x.\n", hr); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } -static void volume_dxt5_test(IDirect3DDevice9 *device) +static void volume_dxt5_test(void) { - HRESULT hr; - IDirect3D9 *d3d9; IDirect3DVolumeTexture9 *texture; + IDirect3DDevice9 *device; D3DLOCKED_BOX box; + IDirect3D9 *d3d; unsigned int i; + ULONG refcount; DWORD color; + HWND window; + HRESULT hr; + static const char texture_data[] = { /* A 8x4x2 texture consisting of 4 4x4 blocks. The colors of the blocks are red, green, blue and white. */ @@ -14742,26 +15819,31 @@ quads[] = { {{ -1.0f, -1.0f, 0.0f}, { 0.0f, 0.0f, 0.25f}}, - {{ 0.0f, -1.0f, 1.0f}, { 1.0f, 0.0f, 0.25f}}, {{ -1.0f, 1.0f, 0.0f}, { 0.0f, 1.0f, 0.25f}}, + {{ 0.0f, -1.0f, 1.0f}, { 1.0f, 0.0f, 0.25f}}, {{ 0.0f, 1.0f, 1.0f}, { 1.0f, 1.0f, 0.25f}}, {{ 0.0f, -1.0f, 0.0f}, { 0.0f, 0.0f, 0.75f}}, - {{ 1.0f, -1.0f, 1.0f}, { 1.0f, 0.0f, 0.75f}}, {{ 0.0f, 1.0f, 0.0f}, { 0.0f, 1.0f, 0.75f}}, + {{ 1.0f, -1.0f, 1.0f}, { 1.0f, 0.0f, 0.75f}}, {{ 1.0f, 1.0f, 1.0f}, { 1.0f, 1.0f, 0.75f}}, }; static const DWORD expected_colors[] = {0x00ff0000, 0x0000ff00, 0x000000ff, 0x00ffffff}; - hr = IDirect3DDevice9_GetDirect3D(device, &d3d9); - ok(SUCCEEDED(hr), "Failed to get d3d9 interface, hr %#x.\n", hr); - hr = IDirect3D9_CheckDeviceFormat(d3d9, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, - D3DFMT_X8R8G8B8, 0, D3DRTYPE_VOLUMETEXTURE, D3DFMT_DXT5); - IDirect3D9_Release(d3d9); - if (FAILED(hr)) + 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 (FAILED(IDirect3D9_CheckDeviceFormat(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, + D3DFMT_X8R8G8B8, 0, D3DRTYPE_VOLUMETEXTURE, D3DFMT_DXT5))) { - skip("Volume dxt5 textures are not supported, skipping test.\n"); - return; + skip("DXT5 volume textures are not supported, skipping test.\n"); + goto done; + } + if (!(device = create_device(d3d, window, window, TRUE))) + { + skip("Failed to create a D3D device, skipping tests.\n"); + goto done; } hr = IDirect3DDevice9_CreateVolumeTexture(device, 8, 4, 2, 1, 0, D3DFMT_DXT5, @@ -14787,7 +15869,7 @@ hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MAGFILTER, D3DTEXF_POINT); ok(SUCCEEDED(hr), "Failed to set mag filter, hr %#x.\n", hr); - hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0x00ff00ff, 0.0f, 0); + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0x00ff00ff, 1.0f, 0); ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); hr = IDirect3DDevice9_BeginScene(device); ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); @@ -14807,23 +15889,29 @@ "Expected color 0x%08x, got 0x%08x, case %u.\n", expected_colors[i], color, i); } - hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_DISABLE); - ok(SUCCEEDED(hr), "Failed to set color op, hr %#x.\n", hr); - hr = IDirect3DDevice9_SetTexture(device, 0, NULL); - ok(SUCCEEDED(hr), "Failed to set texture, hr %#x.\n", hr); IDirect3DVolumeTexture9_Release(texture); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } -static void volume_v16u16_test(IDirect3DDevice9 *device) +static void volume_v16u16_test(void) { - HRESULT hr; - IDirect3D9 *d3d9; IDirect3DVolumeTexture9 *texture; IDirect3DPixelShader9 *shader; + IDirect3DDevice9 *device; D3DLOCKED_BOX box; + IDirect3D9 *d3d; unsigned int i; - DWORD color; + ULONG refcount; + D3DCAPS9 caps; SHORT *texel; + DWORD color; + HWND window; + HRESULT hr; + static const struct { struct vec3 position; @@ -14832,13 +15920,13 @@ quads[] = { {{ -1.0f, -1.0f, 0.0f}, { 0.0f, 0.0f, 0.25f}}, - {{ 0.0f, -1.0f, 1.0f}, { 1.0f, 0.0f, 0.25f}}, {{ -1.0f, 1.0f, 0.0f}, { 0.0f, 1.0f, 0.25f}}, + {{ 0.0f, -1.0f, 1.0f}, { 1.0f, 0.0f, 0.25f}}, {{ 0.0f, 1.0f, 1.0f}, { 1.0f, 1.0f, 0.25f}}, {{ 0.0f, -1.0f, 0.0f}, { 0.0f, 0.0f, 0.75f}}, - {{ 1.0f, -1.0f, 1.0f}, { 1.0f, 0.0f, 0.75f}}, {{ 0.0f, 1.0f, 0.0f}, { 0.0f, 1.0f, 0.75f}}, + {{ 1.0f, -1.0f, 1.0f}, { 1.0f, 0.0f, 0.75f}}, {{ 1.0f, 1.0f, 1.0f}, { 1.0f, 1.0f, 0.75f}}, }; static const DWORD shader_code[] = @@ -14851,15 +15939,30 @@ 0x0000ffff /* end */ }; - hr = IDirect3DDevice9_GetDirect3D(device, &d3d9); - ok(SUCCEEDED(hr), "Failed to get d3d9 interface, hr %#x.\n", hr); - hr = IDirect3D9_CheckDeviceFormat(d3d9, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, - D3DFMT_X8R8G8B8, 0, D3DRTYPE_VOLUMETEXTURE, D3DFMT_V16U16); - IDirect3D9_Release(d3d9); - if (FAILED(hr)) + 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"); + goto done; + } + + hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); + if (caps.PixelShaderVersion < D3DPS_VERSION(1, 1)) + { + skip("No ps_1_1 support, skipping tests.\n"); + IDirect3DDevice9_Release(device); + goto done; + } + if (FAILED(IDirect3D9_CheckDeviceFormat(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, + D3DFMT_X8R8G8B8, 0, D3DRTYPE_VOLUMETEXTURE, D3DFMT_V16U16))) { skip("Volume V16U16 textures are not supported, skipping test.\n"); - return; + IDirect3DDevice9_Release(device); + goto done; } hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_TEX1 | D3DFVF_TEXCOORDSIZE3(0)); @@ -14922,7 +16025,7 @@ hr = IDirect3DDevice9_SetTexture(device, 0, (IDirect3DBaseTexture9 *) texture); ok(SUCCEEDED(hr), "Failed to set texture, hr %#x.\n", hr); - hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0x00ff00ff, 0.0f, 0); + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0x00ff00ff, 1.0f, 0); ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); hr = IDirect3DDevice9_BeginScene(device); ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); @@ -14952,11 +16055,12 @@ IDirect3DVolumeTexture9_Release(texture); } - hr = IDirect3DDevice9_SetPixelShader(device, NULL); - ok(SUCCEEDED(hr), "Failed to set pixel shader, hr %#x.\n", hr); IDirect3DPixelShader9_Release(shader); - hr = IDirect3DDevice9_SetTexture(device, 0, NULL); - ok(SUCCEEDED(hr), "Failed to set texture, hr %#x.\n", hr); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); } static void add_dirty_rect_test_draw(IDirect3DDevice9 *device) @@ -14970,8 +16074,8 @@ quad[] = { {{-1.0, -1.0, 0.0}, {0.0, 0.0}}, - {{ 1.0, -1.0, 0.0}, {1.0, 0.0}}, {{-1.0, 1.0, 0.0}, {0.0, 1.0}}, + {{ 1.0, -1.0, 0.0}, {1.0, 0.0}}, {{ 1.0, 1.0, 0.0}, {1.0, 1.0}}, }; @@ -14983,17 +16087,33 @@ ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); } -static void add_dirty_rect_test(IDirect3DDevice9 *device) +static void add_dirty_rect_test(void) { HRESULT hr; IDirect3DTexture9 *tex_dst1, *tex_dst2, *tex_src_red, *tex_src_green, *tex_managed; IDirect3DSurface9 *surface_dst2, *surface_src_green, *surface_src_red, *surface_managed; + IDirect3DDevice9 *device; + IDirect3D9 *d3d; unsigned int i; + ULONG refcount; DWORD *texel; + HWND window; D3DLOCKED_RECT locked_rect; static const RECT part_rect = {96, 96, 160, 160}; DWORD color; + 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 = IDirect3DDevice9_CreateTexture(device, 256, 256, 1, 0, D3DFMT_X8R8G8B8, D3DPOOL_DEFAULT, &tex_dst1, NULL); ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr); @@ -15281,191 +16401,257 @@ IDirect3DTexture9_Release(tex_dst1); IDirect3DTexture9_Release(tex_dst2); IDirect3DTexture9_Release(tex_managed); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + IDirect3D9_Release(d3d); + DestroyWindow(window); } -START_TEST(visual) +static void test_per_stage_constant(void) { - IDirect3D9 *d3d9; - IDirect3DDevice9 *device_ptr; + IDirect3DDevice9 *device; + IDirect3D9 *d3d; + D3DCOLOR color; + ULONG refcount; D3DCAPS9 caps; + HWND window; HRESULT hr; - DWORD color; - if (!(device_ptr = init_d3d9())) + static const struct { - skip("Creating the device failed\n"); - return; + struct vec3 position; + D3DCOLOR diffuse; } - - IDirect3DDevice9_GetDeviceCaps(device_ptr, &caps); - - /* Check for the reliability of the returned data */ - hr = IDirect3DDevice9_Clear(device_ptr, 0, NULL, D3DCLEAR_TARGET, 0xffff0000, 0.0, 0); - if(FAILED(hr)) + quad[] = { - skip("Clear failed, can't assure correctness of the test results, skipping\n"); - goto cleanup; - } + {{-1.0f, -1.0f, 0.1f}, 0xffff0000}, + {{-1.0f, 1.0f, 0.1f}, 0xffff0000}, + {{ 1.0f, -1.0f, 0.1f}, 0xffff0000}, + {{ 1.0f, 1.0f, 0.1f}, 0xffff0000}, + }; - color = getPixelColor(device_ptr, 1, 1); - if(color !=0x00ff0000) + 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("Sanity check returned an incorrect color(%08x), can't assure the correctness of the tests, skipping\n", color); - goto cleanup; + skip("Failed to create a D3D device, skipping tests.\n"); + goto done; } - IDirect3DDevice9_Present(device_ptr, NULL, NULL, NULL, NULL); - hr = IDirect3DDevice9_Clear(device_ptr, 0, NULL, D3DCLEAR_TARGET, 0xff00ddee, 0.0, 0); - if(FAILED(hr)) + hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); + if (!(caps.PrimitiveMiscCaps & D3DPMISCCAPS_PERSTAGECONSTANT)) { - skip("Clear failed, can't assure correctness of the test results, skipping\n"); - goto cleanup; + skip("Per-stage constants not supported, skipping tests.\n"); + IDirect3DDevice9_Release(device); + goto done; } - color = getPixelColor(device_ptr, 639, 479); - if(color != 0x0000ddee) - { - skip("Sanity check returned an incorrect color(%08x), can't assure the correctness of the tests, skipping\n", color); - goto cleanup; - } - IDirect3DDevice9_Present(device_ptr, NULL, NULL, NULL, NULL); + hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_DIFFUSE); + ok(SUCCEEDED(hr), "Failed to set FVF, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_ALPHABLENDENABLE, TRUE); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_SRCBLEND, D3DBLEND_SRCALPHA); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_LIGHTING, FALSE); + ok(SUCCEEDED(hr), "Failed to set render state, hr %#x.\n", hr); - /* Now execute the real tests */ - depth_clamp_test(device_ptr); - stretchrect_test(device_ptr); - lighting_test(device_ptr); - clear_test(device_ptr); - color_fill_test(device_ptr); - fog_test(device_ptr); - if(caps.TextureCaps & D3DPTEXTURECAPS_CUBEMAP) - { - test_cube_wrap(device_ptr); - } else { - skip("No cube texture support\n"); - } - z_range_test(device_ptr); - if(caps.TextureCaps & D3DPTEXTURECAPS_MIPMAP) - { - maxmip_test(device_ptr); - } - else - { - skip("No mipmap support\n"); - } + hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_CONSTANT, 0x80a1b2c3); + ok(SUCCEEDED(hr), "Failed to set texture stage state, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLORARG1, D3DTA_CONSTANT); + ok(SUCCEEDED(hr), "Failed to set texture stage state, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1); + ok(SUCCEEDED(hr), "Failed to set texture stage state, hr %#x.\n", hr); - offscreen_test(device_ptr); - ds_size_test(device_ptr); - alpha_test(device_ptr); - shademode_test(device_ptr); - srgbtexture_test(device_ptr); - release_buffer_test(device_ptr); - float_texture_test(device_ptr); - g16r16_texture_test(device_ptr); - pixelshader_blending_test(device_ptr); - texture_transform_flags_test(device_ptr); - autogen_mipmap_test(device_ptr); - fixed_function_decl_test(device_ptr); - conditional_np2_repeat_test(device_ptr); - fixed_function_bumpmap_test(device_ptr); - pointsize_test(device_ptr); - tssargtemp_test(device_ptr); - np2_stretch_rect_test(device_ptr); - yuv_color_test(device_ptr); - yuv_layout_test(device_ptr); - zwriteenable_test(device_ptr); - alphatest_test(device_ptr); - viewport_test(device_ptr); + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0x000000ff, 1.0f, 0); + ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); - if (caps.VertexShaderVersion >= D3DVS_VERSION(1, 1)) - { - test_constant_clamp_vs(device_ptr); - test_compare_instructions(device_ptr); - } - else skip("No vs_1_1 support\n"); + 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)); + 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); - if (caps.VertexShaderVersion >= D3DVS_VERSION(2, 0)) - { - test_mova(device_ptr); - loop_index_test(device_ptr); - sincos_test(device_ptr); - sgn_test(device_ptr); - clip_planes_test(device_ptr); - if (caps.VertexShaderVersion >= D3DVS_VERSION(3, 0)) { - test_vshader_input(device_ptr); - test_vshader_float16(device_ptr); - stream_test(device_ptr); - } else { - skip("No vs_3_0 support\n"); - } - } - else skip("No vs_2_0 support\n"); + color = getPixelColor(device, 320, 240); + ok(color_match(color, 0x00a1b2c3, 1), "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); - if (caps.VertexShaderVersion >= D3DVS_VERSION(2, 0) && caps.PixelShaderVersion >= D3DPS_VERSION(2, 0)) - { - fog_with_shader_test(device_ptr); - } - else skip("No vs_2_0 and ps_2_0 support\n"); + hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLORARG1, D3DTA_CONSTANT | D3DTA_COMPLEMENT); + ok(SUCCEEDED(hr), "Failed to set texture stage state, hr %#x.\n", hr); - if (caps.PixelShaderVersion >= D3DPS_VERSION(1, 1)) + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0x000000ff, 1.0f, 0); + ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + + hr = IDirect3DDevice9_BeginScene(device); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(*quad)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + + color = getPixelColor(device, 320, 240); + ok(color_match(color, 0x005e4d3c, 1), "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); + + hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLORARG1, D3DTA_CONSTANT | D3DTA_ALPHAREPLICATE); + ok(SUCCEEDED(hr), "Failed to set texture stage state, hr %#x.\n", hr); + + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0x000000ff, 1.0f, 0); + ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + + hr = IDirect3DDevice9_BeginScene(device); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(*quad)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + + color = getPixelColor(device, 320, 240); + ok(color_match(color, 0x00808080, 1), "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); + + hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_ALPHAARG1, D3DTA_CONSTANT); + ok(SUCCEEDED(hr), "Failed to set texture stage state, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1); + ok(SUCCEEDED(hr), "Failed to set texture stage state, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLORARG1, D3DTA_CURRENT); + ok(SUCCEEDED(hr), "Failed to set texture stage state, hr %#x.\n", hr); + + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0x000000ff, 1.0f, 0); + ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + + hr = IDirect3DDevice9_BeginScene(device); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad, sizeof(*quad)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + + color = getPixelColor(device, 320, 240); + ok(color_match(color, 0x0080007f, 1), "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); + + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); +} + +START_TEST(visual) +{ + D3DADAPTER_IDENTIFIER9 identifier; + IDirect3D9 *d3d; + HRESULT hr; + + if (!(d3d = Direct3DCreate9(D3D_SDK_VERSION))) { - texbem_test(device_ptr); - texdepth_test(device_ptr); - texkill_test(device_ptr); - x8l8v8u8_test(device_ptr); - volume_v16u16_test(device_ptr); - if (caps.PixelShaderVersion >= D3DPS_VERSION(1, 4)) { - constant_clamp_ps_test(device_ptr); - cnd_test(device_ptr); - if (caps.PixelShaderVersion >= D3DPS_VERSION(2, 0)) { - dp2add_ps_test(device_ptr); - unbound_sampler_test(device_ptr); - if (caps.PixelShaderVersion >= D3DPS_VERSION(3, 0) && caps.VertexShaderVersion >= D3DVS_VERSION(3, 0)) { - nested_loop_test(device_ptr); - pretransformed_varying_test(device_ptr); - vFace_register_test(device_ptr); - vpos_register_test(device_ptr); - multiple_rendertargets_test(device_ptr); - } else { - skip("No ps_3_0 or vs_3_0 support\n"); - } - } else { - skip("No ps_2_0 support\n"); - } - } + skip("could not create D3D9 object\n"); + return; } - else skip("No ps_1_1 support\n"); - texop_test(device_ptr); - texop_range_test(device_ptr); - alphareplicate_test(device_ptr); - dp3_alpha_test(device_ptr); - depth_buffer_test(device_ptr); - depth_buffer2_test(device_ptr); - depth_blit_test(device_ptr); - intz_test(device_ptr); - shadow_test(device_ptr); - fp_special_test(device_ptr); - depth_bounds_test(device_ptr); - srgbwrite_format_test(device_ptr); - update_surface_test(device_ptr); - multisample_get_rtdata_test(device_ptr); - zenable_test(device_ptr); - fog_special_test(device_ptr); - volume_srgb_test(device_ptr); - volume_dxt5_test(device_ptr); - add_dirty_rect_test(device_ptr); - - hr = IDirect3DDevice9_GetDirect3D(device_ptr, &d3d9); - ok(SUCCEEDED(hr), "Failed to get d3d9 interface, hr %#x.\n", hr); - cleanup_device(device_ptr); - device_ptr = NULL; - - multisampled_depth_buffer_test(d3d9); - resz_test(d3d9); - stencil_cull_test(d3d9); + memset(&identifier, 0, sizeof(identifier)); + hr = IDirect3D9_GetAdapterIdentifier(d3d, 0, 0, &identifier); + ok(SUCCEEDED(hr), "Failed to get adapter identifier, hr %#x.\n", hr); + trace("Driver string: \"%s\"\n", identifier.Driver); + trace("Description string: \"%s\"\n", identifier.Description); + /* Only Windows XP's default VGA driver should have an empty description */ + ok(identifier.Description[0] || broken(!strcmp(identifier.Driver, "vga.dll")), "Empty driver description.\n"); + trace("Device name string: \"%s\"\n", identifier.DeviceName); + ok(identifier.DeviceName[0], "Empty device name.\n"); + trace("Driver version %d.%d.%d.%d\n", + HIWORD(U(identifier.DriverVersion).HighPart), LOWORD(U(identifier.DriverVersion).HighPart), + HIWORD(U(identifier.DriverVersion).LowPart), LOWORD(U(identifier.DriverVersion).LowPart)); - IDirect3D9_Release(d3d9); + IDirect3D9_Release(d3d); -cleanup: - cleanup_device(device_ptr); + test_sanity(); + depth_clamp_test(); + stretchrect_test(); + lighting_test(); + clear_test(); + color_fill_test(); + fog_test(); + test_cube_wrap(); + z_range_test(); + maxmip_test(); + offscreen_test(); + ds_size_test(); + alpha_test(); + shademode_test(); + srgbtexture_test(); + release_buffer_test(); + float_texture_test(); + g16r16_texture_test(); + pixelshader_blending_test(); + texture_transform_flags_test(); + autogen_mipmap_test(); + fixed_function_decl_test(); + conditional_np2_repeat_test(); + fixed_function_bumpmap_test(); + pointsize_test(); + tssargtemp_test(); + np2_stretch_rect_test(); + yuv_color_test(); + yuv_layout_test(); + zwriteenable_test(); + alphatest_test(); + viewport_test(); + test_constant_clamp_vs(); + test_compare_instructions(); + test_mova(); + loop_index_test(); + sincos_test(); + sgn_test(); + clip_planes_test(); + test_vshader_input(); + test_vshader_float16(); + stream_test(); + fog_with_shader_test(); + texbem_test(); + texdepth_test(); + texkill_test(); + x8l8v8u8_test(); + volume_v16u16_test(); + constant_clamp_ps_test(); + cnd_test(); + dp2add_ps_test(); + unbound_sampler_test(); + nested_loop_test(); + pretransformed_varying_test(); + vface_register_test(); + vpos_register_test(); + multiple_rendertargets_test(); + texop_test(); + texop_range_test(); + alphareplicate_test(); + dp3_alpha_test(); + depth_buffer_test(); + depth_buffer2_test(); + depth_blit_test(); + intz_test(); + shadow_test(); + fp_special_test(); + depth_bounds_test(); + srgbwrite_format_test(); + update_surface_test(); + multisample_get_rtdata_test(); + zenable_test(); + fog_special_test(); + volume_srgb_test(); + volume_dxt5_test(); + add_dirty_rect_test(); + multisampled_depth_buffer_test(); + resz_test(); + stencil_cull_test(); + test_per_stage_constant(); } diff -Nru wine1.7-1.7.14/dlls/d3d9/texture.c wine1.7-1.7.18/dlls/d3d9/texture.c --- wine1.7-1.7.14/dlls/d3d9/texture.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/d3d9/texture.c 2014-05-02 18:15:48.000000000 +0000 @@ -61,7 +61,7 @@ static ULONG WINAPI d3d9_texture_2d_AddRef(IDirect3DTexture9 *iface) { struct d3d9_texture *texture = impl_from_IDirect3DTexture9(iface); - ULONG ref = InterlockedIncrement(&texture->refcount); + ULONG ref = InterlockedIncrement(&texture->resource.refcount); TRACE("%p increasing refcount to %u.\n", iface, ref); @@ -79,7 +79,7 @@ static ULONG WINAPI d3d9_texture_2d_Release(IDirect3DTexture9 *iface) { struct d3d9_texture *texture = impl_from_IDirect3DTexture9(iface); - ULONG ref = InterlockedDecrement(&texture->refcount); + ULONG ref = InterlockedDecrement(&texture->resource.refcount); TRACE("%p decreasing refcount to %u.\n", iface, ref); @@ -115,52 +115,28 @@ REFGUID guid, const void *data, DWORD data_size, DWORD flags) { struct d3d9_texture *texture = impl_from_IDirect3DTexture9(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s, data %p, data_size %u, flags %#x.\n", iface, debugstr_guid(guid), data, data_size, flags); - wined3d_mutex_lock(); - resource = wined3d_texture_get_resource(texture->wined3d_texture); - hr = wined3d_resource_set_private_data(resource, guid, data, data_size, flags); - wined3d_mutex_unlock(); - - return hr; + return d3d9_resource_set_private_data(&texture->resource, guid, data, data_size, flags); } static HRESULT WINAPI d3d9_texture_2d_GetPrivateData(IDirect3DTexture9 *iface, REFGUID guid, void *data, DWORD *data_size) { struct d3d9_texture *texture = impl_from_IDirect3DTexture9(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s, data %p, data_size %p.\n", iface, debugstr_guid(guid), data, data_size); - wined3d_mutex_lock(); - resource = wined3d_texture_get_resource(texture->wined3d_texture); - hr = wined3d_resource_get_private_data(resource, guid, data, data_size); - wined3d_mutex_unlock(); - - return hr; + return d3d9_resource_get_private_data(&texture->resource, guid, data, data_size); } static HRESULT WINAPI d3d9_texture_2d_FreePrivateData(IDirect3DTexture9 *iface, REFGUID guid) { struct d3d9_texture *texture = impl_from_IDirect3DTexture9(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s.\n", iface, debugstr_guid(guid)); - wined3d_mutex_lock(); - resource = wined3d_texture_get_resource(texture->wined3d_texture); - hr = wined3d_resource_free_private_data(resource, guid); - wined3d_mutex_unlock(); - - return hr; + return d3d9_resource_free_private_data(&texture->resource, guid); } static DWORD WINAPI d3d9_texture_2d_SetPriority(IDirect3DTexture9 *iface, DWORD priority) @@ -472,7 +448,7 @@ static ULONG WINAPI d3d9_texture_cube_AddRef(IDirect3DCubeTexture9 *iface) { struct d3d9_texture *texture = impl_from_IDirect3DCubeTexture9(iface); - ULONG ref = InterlockedIncrement(&texture->refcount); + ULONG ref = InterlockedIncrement(&texture->resource.refcount); TRACE("%p increasing refcount to %u.\n", iface, ref); @@ -490,7 +466,7 @@ static ULONG WINAPI d3d9_texture_cube_Release(IDirect3DCubeTexture9 *iface) { struct d3d9_texture *texture = impl_from_IDirect3DCubeTexture9(iface); - ULONG ref = InterlockedDecrement(&texture->refcount); + ULONG ref = InterlockedDecrement(&texture->resource.refcount); TRACE("%p decreasing refcount to %u.\n", iface, ref); @@ -528,52 +504,28 @@ REFGUID guid, const void *data, DWORD data_size, DWORD flags) { struct d3d9_texture *texture = impl_from_IDirect3DCubeTexture9(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s, data %p, data_size %u, flags %#x.\n", iface, debugstr_guid(guid), data, data_size, flags); - wined3d_mutex_lock(); - resource = wined3d_texture_get_resource(texture->wined3d_texture); - hr = wined3d_resource_set_private_data(resource, guid, data, data_size, flags); - wined3d_mutex_unlock(); - - return hr; + return d3d9_resource_set_private_data(&texture->resource, guid, data, data_size, flags); } static HRESULT WINAPI d3d9_texture_cube_GetPrivateData(IDirect3DCubeTexture9 *iface, REFGUID guid, void *data, DWORD *data_size) { struct d3d9_texture *texture = impl_from_IDirect3DCubeTexture9(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s, data %p, data_size %p.\n", iface, debugstr_guid(guid), data, data_size); - wined3d_mutex_lock(); - resource = wined3d_texture_get_resource(texture->wined3d_texture); - hr = wined3d_resource_get_private_data(resource, guid, data, data_size); - wined3d_mutex_unlock(); - - return hr; + return d3d9_resource_get_private_data(&texture->resource, guid, data, data_size); } static HRESULT WINAPI d3d9_texture_cube_FreePrivateData(IDirect3DCubeTexture9 *iface, REFGUID guid) { struct d3d9_texture *texture = impl_from_IDirect3DCubeTexture9(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s.\n", iface, debugstr_guid(guid)); - wined3d_mutex_lock(); - resource = wined3d_texture_get_resource(texture->wined3d_texture); - hr = wined3d_resource_free_private_data(resource, guid); - wined3d_mutex_unlock(); - - return hr; + return d3d9_resource_free_private_data(&texture->resource, guid); } static DWORD WINAPI d3d9_texture_cube_SetPriority(IDirect3DCubeTexture9 *iface, DWORD priority) @@ -911,7 +863,7 @@ static ULONG WINAPI d3d9_texture_3d_AddRef(IDirect3DVolumeTexture9 *iface) { struct d3d9_texture *texture = impl_from_IDirect3DVolumeTexture9(iface); - ULONG ref = InterlockedIncrement(&texture->refcount); + ULONG ref = InterlockedIncrement(&texture->resource.refcount); TRACE("%p increasing refcount to %u.\n", iface, ref); @@ -929,7 +881,7 @@ static ULONG WINAPI d3d9_texture_3d_Release(IDirect3DVolumeTexture9 *iface) { struct d3d9_texture *texture = impl_from_IDirect3DVolumeTexture9(iface); - ULONG ref = InterlockedDecrement(&texture->refcount); + ULONG ref = InterlockedDecrement(&texture->resource.refcount); TRACE("%p decreasing refcount to %u.\n", iface, ref); @@ -965,52 +917,28 @@ REFGUID guid, const void *data, DWORD data_size, DWORD flags) { struct d3d9_texture *texture = impl_from_IDirect3DVolumeTexture9(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s, data %p, data_size %u, flags %#x.\n", iface, debugstr_guid(guid), data, data_size, flags); - wined3d_mutex_lock(); - resource = wined3d_texture_get_resource(texture->wined3d_texture); - hr = wined3d_resource_set_private_data(resource, guid, data, data_size, flags); - wined3d_mutex_unlock(); - - return hr; + return d3d9_resource_set_private_data(&texture->resource, guid, data, data_size, flags); } static HRESULT WINAPI d3d9_texture_3d_GetPrivateData(IDirect3DVolumeTexture9 *iface, REFGUID guid, void *data, DWORD *data_size) { struct d3d9_texture *texture = impl_from_IDirect3DVolumeTexture9(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s, data %p, data_size %p.\n", iface, debugstr_guid(guid), data, data_size); - wined3d_mutex_lock(); - resource = wined3d_texture_get_resource(texture->wined3d_texture); - hr = wined3d_resource_get_private_data(resource, guid, data, data_size); - wined3d_mutex_unlock(); - - return hr; + return d3d9_resource_get_private_data(&texture->resource, guid, data, data_size); } static HRESULT WINAPI d3d9_texture_3d_FreePrivateData(IDirect3DVolumeTexture9 *iface, REFGUID guid) { struct d3d9_texture *texture = impl_from_IDirect3DVolumeTexture9(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s.\n", iface, debugstr_guid(guid)); - wined3d_mutex_lock(); - resource = wined3d_texture_get_resource(texture->wined3d_texture); - hr = wined3d_resource_free_private_data(resource, guid); - wined3d_mutex_unlock(); - - return hr; + return d3d9_resource_free_private_data(&texture->resource, guid); } static DWORD WINAPI d3d9_texture_3d_SetPriority(IDirect3DVolumeTexture9 *iface, DWORD priority) @@ -1298,7 +1226,9 @@ static void STDMETHODCALLTYPE d3d9_texture_wined3d_object_destroyed(void *parent) { - HeapFree(GetProcessHeap(), 0, parent); + struct d3d9_texture *texture = parent; + d3d9_resource_cleanup(&texture->resource); + HeapFree(GetProcessHeap(), 0, texture); } static const struct wined3d_parent_ops d3d9_texture_wined3d_parent_ops = @@ -1314,7 +1244,7 @@ HRESULT hr; texture->IDirect3DBaseTexture9_iface.lpVtbl = (const IDirect3DBaseTexture9Vtbl *)&d3d9_texture_2d_vtbl; - texture->refcount = 1; + d3d9_resource_init(&texture->resource); desc.resource_type = WINED3D_RTYPE_TEXTURE; desc.format = wined3dformat_from_d3dformat(format); @@ -1355,7 +1285,7 @@ HRESULT hr; texture->IDirect3DBaseTexture9_iface.lpVtbl = (const IDirect3DBaseTexture9Vtbl *)&d3d9_texture_cube_vtbl; - texture->refcount = 1; + d3d9_resource_init(&texture->resource); desc.resource_type = WINED3D_RTYPE_CUBE_TEXTURE; desc.format = wined3dformat_from_d3dformat(format); @@ -1395,7 +1325,7 @@ HRESULT hr; texture->IDirect3DBaseTexture9_iface.lpVtbl = (const IDirect3DBaseTexture9Vtbl *)&d3d9_texture_3d_vtbl; - texture->refcount = 1; + d3d9_resource_init(&texture->resource); desc.resource_type = WINED3D_RTYPE_VOLUME_TEXTURE; desc.format = wined3dformat_from_d3dformat(format); diff -Nru wine1.7-1.7.14/dlls/d3d9/volume.c wine1.7-1.7.18/dlls/d3d9/volume.c --- wine1.7-1.7.14/dlls/d3d9/volume.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/d3d9/volume.c 2014-05-02 18:15:48.000000000 +0000 @@ -60,7 +60,7 @@ return IUnknown_AddRef(volume->forwardReference); } - refcount = InterlockedIncrement(&volume->refcount); + refcount = InterlockedIncrement(&volume->resource.refcount); TRACE("%p increasing refcount to %u.\n", iface, refcount); if (refcount == 1) @@ -86,7 +86,7 @@ return IUnknown_Release(volume->forwardReference); } - refcount = InterlockedDecrement(&volume->refcount); + refcount = InterlockedDecrement(&volume->resource.refcount); TRACE("%p decreasing refcount to %u.\n", iface, refcount); if (!refcount) @@ -123,52 +123,28 @@ const void *data, DWORD data_size, DWORD flags) { struct d3d9_volume *volume = impl_from_IDirect3DVolume9(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s, data %p, data_size %u, flags %#x.\n", iface, debugstr_guid(guid), data, data_size, flags); - wined3d_mutex_lock(); - resource = wined3d_volume_get_resource(volume->wined3d_volume); - hr = wined3d_resource_set_private_data(resource, guid, data, data_size, flags); - wined3d_mutex_unlock(); - - return hr; + return d3d9_resource_set_private_data(&volume->resource, guid, data, data_size, flags); } static HRESULT WINAPI d3d9_volume_GetPrivateData(IDirect3DVolume9 *iface, REFGUID guid, void *data, DWORD *data_size) { struct d3d9_volume *volume = impl_from_IDirect3DVolume9(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s, data %p, data_size %p.\n", iface, debugstr_guid(guid), data, data_size); - wined3d_mutex_lock(); - resource = wined3d_volume_get_resource(volume->wined3d_volume); - hr = wined3d_resource_get_private_data(resource, guid, data, data_size); - wined3d_mutex_unlock(); - - return hr; + return d3d9_resource_get_private_data(&volume->resource, guid, data, data_size); } static HRESULT WINAPI d3d9_volume_FreePrivateData(IDirect3DVolume9 *iface, REFGUID guid) { struct d3d9_volume *volume = impl_from_IDirect3DVolume9(iface); - struct wined3d_resource *resource; - HRESULT hr; - TRACE("iface %p, guid %s.\n", iface, debugstr_guid(guid)); - wined3d_mutex_lock(); - resource = wined3d_volume_get_resource(volume->wined3d_volume); - hr = wined3d_resource_free_private_data(resource, guid); - wined3d_mutex_unlock(); - - return hr; + return d3d9_resource_free_private_data(&volume->resource, guid); } static HRESULT WINAPI d3d9_volume_GetContainer(IDirect3DVolume9 *iface, REFIID riid, void **container) @@ -266,7 +242,9 @@ static void STDMETHODCALLTYPE volume_wined3d_object_destroyed(void *parent) { - HeapFree(GetProcessHeap(), 0, parent); + struct d3d9_volume *volume = parent; + d3d9_resource_cleanup(&volume->resource); + HeapFree(GetProcessHeap(), 0, volume); } static const struct wined3d_parent_ops d3d9_volume_wined3d_parent_ops = @@ -278,7 +256,7 @@ const struct wined3d_parent_ops **parent_ops) { volume->IDirect3DVolume9_iface.lpVtbl = &d3d9_volume_vtbl; - volume->refcount = 1; + d3d9_resource_init(&volume->resource); wined3d_volume_incref(wined3d_volume); volume->wined3d_volume = wined3d_volume; diff -Nru wine1.7-1.7.14/dlls/d3dcompiler_43/d3dcompiler_private.h wine1.7-1.7.18/dlls/d3dcompiler_43/d3dcompiler_private.h --- wine1.7-1.7.14/dlls/d3dcompiler_43/d3dcompiler_private.h 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/d3dcompiler_43/d3dcompiler_private.h 2014-05-02 18:15:48.000000000 +0000 @@ -826,6 +826,11 @@ HLSL_IR_UNOP_SAT, + HLSL_IR_UNOP_PREINC, + HLSL_IR_UNOP_PREDEC, + HLSL_IR_UNOP_POSTINC, + HLSL_IR_UNOP_POSTDEC, + HLSL_IR_BINOP_ADD, HLSL_IR_BINOP_SUB, HLSL_IR_BINOP_MUL, @@ -856,11 +861,6 @@ HLSL_IR_BINOP_POW, - HLSL_IR_BINOP_PREINC, - HLSL_IR_BINOP_PREDEC, - HLSL_IR_BINOP_POSTINC, - HLSL_IR_BINOP_POSTDEC, - HLSL_IR_TEROP_LERP, HLSL_IR_SEQUENCE, @@ -1106,8 +1106,6 @@ BOOL add_declaration(struct hlsl_scope *scope, struct hlsl_ir_var *decl, BOOL local_var) DECLSPEC_HIDDEN; struct hlsl_ir_var *get_variable(struct hlsl_scope *scope, const char *name) DECLSPEC_HIDDEN; void free_declaration(struct hlsl_ir_var *decl) DECLSPEC_HIDDEN; -BOOL add_func_parameter(struct list *list, struct parse_parameter *param, - const struct source_location *loc) DECLSPEC_HIDDEN; struct hlsl_type *new_hlsl_type(const char *name, enum hlsl_type_class type_class, enum hlsl_base_type base_type, unsigned dimx, unsigned dimy) DECLSPEC_HIDDEN; struct hlsl_type *new_array_type(struct hlsl_type *basic_type, unsigned int array_size) DECLSPEC_HIDDEN; diff -Nru wine1.7-1.7.14/dlls/d3dcompiler_43/hlsl.y wine1.7-1.7.18/dlls/d3dcompiler_43/hlsl.y --- wine1.7-1.7.14/dlls/d3dcompiler_43/hlsl.y 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/d3dcompiler_43/hlsl.y 2014-05-02 18:15:48.000000000 +0000 @@ -46,7 +46,7 @@ static const char *hlsl_get_error_level_name(enum hlsl_error_level level) { - const char *names[] = + static const char * const names[] = { "error", "warning", @@ -199,7 +199,7 @@ { struct hlsl_type *type; unsigned int x, y, bt; - static const char *names[] = + static const char * const names[] = { "float", "half", @@ -808,6 +808,31 @@ return TRUE; } +static BOOL add_func_parameter(struct list *list, struct parse_parameter *param, const struct source_location *loc) +{ + struct hlsl_ir_var *decl = d3dcompiler_alloc(sizeof(*decl)); + + if (!decl) + { + ERR("Out of memory.\n"); + return FALSE; + } + decl->node.type = HLSL_IR_VAR; + decl->node.data_type = param->type; + decl->node.loc = *loc; + decl->name = param->name; + decl->semantic = param->semantic; + decl->modifiers = param->modifiers; + + if (!add_declaration(hlsl_ctx.cur_scope, decl, FALSE)) + { + free_declaration(decl); + return FALSE; + } + list_add_tail(list, &decl->node.entry); + return TRUE; +} + static const struct hlsl_ir_function_decl *get_overloaded_func(struct wine_rb_tree *funcs, char *name, struct list *params, BOOL exact_signature) { @@ -1400,7 +1425,6 @@ { struct hlsl_type *type; - TRACE("Type %s.\n", $1); type = get_type(hlsl_ctx.cur_scope, $1, TRUE); $$ = type; d3dcompiler_free($1); @@ -1409,7 +1433,6 @@ { struct hlsl_type *type; - TRACE("Struct type %s.\n", $2); type = get_type(hlsl_ctx.cur_scope, $2, TRUE); if (type->type != HLSL_CLASS_STRUCT) { @@ -1850,7 +1873,7 @@ } operands[0] = $1; operands[1] = operands[2] = NULL; - $$ = &new_expr(HLSL_IR_BINOP_POSTINC, operands, &loc)->node; + $$ = &new_expr(HLSL_IR_UNOP_POSTINC, operands, &loc)->node; /* Post increment/decrement expressions are considered const */ $$->data_type = clone_hlsl_type($$->data_type); $$->data_type->modifiers |= HLSL_MODIFIER_CONST; @@ -1869,7 +1892,7 @@ } operands[0] = $1; operands[1] = operands[2] = NULL; - $$ = &new_expr(HLSL_IR_BINOP_POSTDEC, operands, &loc)->node; + $$ = &new_expr(HLSL_IR_UNOP_POSTDEC, operands, &loc)->node; /* Post increment/decrement expressions are considered const */ $$->data_type = clone_hlsl_type($$->data_type); $$->data_type->modifiers |= HLSL_MODIFIER_CONST; @@ -2042,7 +2065,7 @@ } operands[0] = $2; operands[1] = operands[2] = NULL; - $$ = &new_expr(HLSL_IR_BINOP_PREINC, operands, &loc)->node; + $$ = &new_expr(HLSL_IR_UNOP_PREINC, operands, &loc)->node; } | OP_DEC unary_expr { @@ -2058,7 +2081,7 @@ } operands[0] = $2; operands[1] = operands[2] = NULL; - $$ = &new_expr(HLSL_IR_BINOP_PREDEC, operands, &loc)->node; + $$ = &new_expr(HLSL_IR_UNOP_PREDEC, operands, &loc)->node; } | unary_op unary_expr { diff -Nru wine1.7-1.7.14/dlls/d3dcompiler_43/utils.c wine1.7-1.7.18/dlls/d3dcompiler_43/utils.c --- wine1.7-1.7.14/dlls/d3dcompiler_43/utils.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/d3dcompiler_43/utils.c 2014-05-02 18:15:48.000000000 +0000 @@ -805,31 +805,6 @@ d3dcompiler_free(decl); } -BOOL add_func_parameter(struct list *list, struct parse_parameter *param, const struct source_location *loc) -{ - struct hlsl_ir_var *decl = d3dcompiler_alloc(sizeof(*decl)); - - if (!decl) - { - ERR("Out of memory.\n"); - return FALSE; - } - decl->node.type = HLSL_IR_VAR; - decl->node.data_type = param->type; - decl->node.loc = *loc; - decl->name = param->name; - decl->semantic = param->semantic; - decl->modifiers = param->modifiers; - - if (!add_declaration(hlsl_ctx.cur_scope, decl, FALSE)) - { - free_declaration(decl); - return FALSE; - } - list_add_tail(list, &decl->node.entry); - return TRUE; -} - struct hlsl_type *new_hlsl_type(const char *name, enum hlsl_type_class type_class, enum hlsl_base_type base_type, unsigned dimx, unsigned dimy) { @@ -1974,7 +1949,7 @@ static const char *debug_node_type(enum hlsl_ir_node_type type) { - const char *names[] = + static const char * const names[] = { "HLSL_IR_VAR", "HLSL_IR_ASSIGNMENT", @@ -2080,7 +2055,7 @@ static const char *debug_expr_op(const struct hlsl_ir_expr *expr) { - static const char *op_names[] = + static const char * const op_names[] = { "~", "!", diff -Nru wine1.7-1.7.14/dlls/d3drm/d3drm_main.c wine1.7-1.7.18/dlls/d3drm/d3drm_main.c --- wine1.7-1.7.14/dlls/d3drm/d3drm_main.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/d3drm/d3drm_main.c 2014-05-02 18:15:48.000000000 +0000 @@ -21,8 +21,9 @@ #include "windef.h" #include "winbase.h" #include "wingdi.h" +#include "d3d.h" +#include "initguid.h" #include "d3drm.h" -#include "d3drm_private.h" /*********************************************************************** diff -Nru wine1.7-1.7.14/dlls/d3drm/tests/d3drm.c wine1.7-1.7.18/dlls/d3drm/tests/d3drm.c --- wine1.7-1.7.14/dlls/d3drm/tests/d3drm.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/d3drm/tests/d3drm.c 2014-05-02 18:15:48.000000000 +0000 @@ -18,8 +18,9 @@ */ #define COBJMACROS -#include +#include #include +#include #include #include "wine/test.h" diff -Nru wine1.7-1.7.14/dlls/d3dx9_36/effect.c wine1.7-1.7.18/dlls/d3dx9_36/effect.c --- wine1.7-1.7.14/dlls/d3dx9_36/effect.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/d3dx9_36/effect.c 2014-05-02 18:15:48.000000000 +0000 @@ -96,6 +96,7 @@ ST_CONSTANT, ST_PARAMETER, ST_FXLC, + ST_ARRAY_SELECTOR, }; struct d3dx_parameter @@ -118,6 +119,8 @@ struct d3dx_parameter *annotations; struct d3dx_parameter *members; + + struct d3dx_parameter *referenced_param; }; struct d3dx_object @@ -761,16 +764,40 @@ } } -static void set_matrix(struct d3dx_parameter *param, const D3DXMATRIX *matrix, BOOL transpose) +static void set_matrix(struct d3dx_parameter *param, const D3DXMATRIX *matrix) { UINT i, k; + if (param->type == D3DXPT_FLOAT) + { + if (param->columns == 4) + memcpy(param->data, matrix->u.m, param->rows * 4 * sizeof(float)); + else + for (i = 0; i < param->rows; ++i) + memcpy((float *)param->data + i * param->columns, matrix->u.m + i, param->columns * sizeof(float)); + return; + } + for (i = 0; i < param->rows; ++i) { for (k = 0; k < param->columns; ++k) { set_number((FLOAT *)param->data + i * param->columns + k, param->type, - transpose ? &matrix->u.m[k][i] : &matrix->u.m[i][k], D3DXPT_FLOAT); + &matrix->u.m[i][k], D3DXPT_FLOAT); + } + } +} + +static void set_matrix_transpose(struct d3dx_parameter *param, const D3DXMATRIX *matrix) +{ + UINT i, k; + + for (i = 0; i < param->rows; ++i) + { + for (k = 0; k < param->columns; ++k) + { + set_number((FLOAT *)param->data + i * param->columns + k, param->type, + &matrix->u.m[k][i], D3DXPT_FLOAT); } } } @@ -1765,6 +1792,12 @@ *(INT *)param->data = tmp; return D3D_OK; } + if (param->type == D3DXPT_FLOAT) + { + memcpy(param->data, vector, param->columns * sizeof(float)); + return D3D_OK; + } + set_vector(param, vector); return D3D_OK; @@ -1839,6 +1872,17 @@ switch (param->class) { case D3DXPC_VECTOR: + if (param->type == D3DXPT_FLOAT) + { + if (param->columns == 4) + memcpy(param->data, vector, count * 4 * sizeof(float)); + else + for (i = 0; i < count; ++i) + memcpy((float *)param->data + param->columns * i, vector + i, + param->columns * sizeof(float)); + return D3D_OK; + } + for (i = 0; i < count; ++i) { set_vector(¶m->members[i], &vector[i]); @@ -1913,7 +1957,7 @@ switch (param->class) { case D3DXPC_MATRIX_ROWS: - set_matrix(param, matrix, FALSE); + set_matrix(param, matrix); return D3D_OK; case D3DXPC_SCALAR: @@ -1981,7 +2025,7 @@ case D3DXPC_MATRIX_ROWS: for (i = 0; i < count; ++i) { - set_matrix(¶m->members[i], &matrix[i], FALSE); + set_matrix(¶m->members[i], &matrix[i]); } return D3D_OK; @@ -2055,7 +2099,7 @@ case D3DXPC_MATRIX_ROWS: for (i = 0; i < count; ++i) { - set_matrix(¶m->members[i], matrix[i], FALSE); + set_matrix(¶m->members[i], matrix[i]); } return D3D_OK; @@ -2125,7 +2169,7 @@ switch (param->class) { case D3DXPC_MATRIX_ROWS: - set_matrix(param, matrix, TRUE); + set_matrix_transpose(param, matrix); return D3D_OK; case D3DXPC_SCALAR: @@ -2196,7 +2240,7 @@ case D3DXPC_MATRIX_ROWS: for (i = 0; i < count; ++i) { - set_matrix(¶m->members[i], &matrix[i], TRUE); + set_matrix_transpose(¶m->members[i], &matrix[i]); } return D3D_OK; @@ -2270,7 +2314,7 @@ case D3DXPC_MATRIX_ROWS: for (i = 0; i < count; ++i) { - set_matrix(¶m->members[i], matrix[i], TRUE); + set_matrix_transpose(¶m->members[i], matrix[i]); } return D3D_OK; @@ -2365,6 +2409,9 @@ { struct IDirect3DBaseTexture9 *oltexture = *(struct IDirect3DBaseTexture9 **)param->data; + if (texture == oltexture) + return D3D_OK; + if (texture) IDirect3DBaseTexture9_AddRef(texture); if (oltexture) IDirect3DBaseTexture9_Release(oltexture); @@ -4332,6 +4379,9 @@ read_dword(ptr, &object->size); TRACE("Data size: %#x\n", object->size); + if (!object->size) + return D3D_OK; + object->data = HeapAlloc(GetProcessHeap(), 0, object->size); if (!object->data) { @@ -4936,12 +4986,81 @@ return hr; } +static HRESULT d3dx9_create_object(struct d3dx9_base_effect *base, struct d3dx_object *object) +{ + struct d3dx_parameter *param = object->param; + struct IDirect3DDevice9 *device = base->effect->device; + HRESULT hr; + + if (*(char **)param->data) + ERR("Parameter data already allocated.\n"); + + switch (param->type) + { + case D3DXPT_STRING: + *(char **)param->data = HeapAlloc(GetProcessHeap(), 0, object->size); + if (!*(char **)param->data) + { + ERR("Out of memory.\n"); + return E_OUTOFMEMORY; + } + memcpy(*(char **)param->data, object->data, object->size); + break; + case D3DXPT_VERTEXSHADER: + if (FAILED(hr = IDirect3DDevice9_CreateVertexShader(device, object->data, + (IDirect3DVertexShader9 **)param->data))) + { + WARN("Failed to create vertex shader.\n"); + return hr; + } + break; + case D3DXPT_PIXELSHADER: + if (FAILED(hr = IDirect3DDevice9_CreatePixelShader(device, object->data, + (IDirect3DPixelShader9 **)param->data))) + { + WARN("Failed to create pixel shader.\n"); + return hr; + } + break; + default: + break; + } + return D3D_OK; +} + +static HRESULT d3dx9_parse_array_selector(struct d3dx9_base_effect *base, struct d3dx_parameter *param) +{ + DWORD string_size; + struct d3dx_object *object = &base->objects[param->object_id]; + char *ptr = object->data; + + TRACE("Parsing array entry selection state for parameter %p.\n", param); + + string_size = *(DWORD *)ptr; + param->referenced_param = get_parameter_by_name(base, NULL, ptr + 4); + if (param->referenced_param) + { + TRACE("Mapping to parameter %s.\n", debugstr_a(param->referenced_param->name)); + } + else + { + FIXME("Referenced parameter %s not found.\n", ptr + 4); + return D3DXERR_INVALIDDATA; + } + TRACE("Unknown DWORD: 0x%.8x.\n", *(DWORD *)(ptr + string_size)); + + FIXME("Parse preshader.\n"); + + return D3D_OK; +} + static HRESULT d3dx9_parse_resource(struct d3dx9_base_effect *base, const char *data, const char **ptr) { DWORD technique_index; DWORD index, state_index, usage, element_index; struct d3dx_state *state; struct d3dx_parameter *param; + struct d3dx_object *object; HRESULT hr = E_FAIL; read_dword(ptr, &technique_index); @@ -5019,21 +5138,26 @@ state = &pass->states[state_index]; } + TRACE("State operation %#x (%s).\n", state->operation, state_table[state->operation].name); param = &state->parameter; + TRACE("Using object id %u.\n", param->object_id); + object = &base->objects[param->object_id]; - /* - * TODO: Do we need to create the shader/string here or later when we access them? - */ + TRACE("Usage %u: class %s, type %s.\n", usage, debug_d3dxparameter_class(param->class), + debug_d3dxparameter_type(param->type)); switch (usage) { case 0: - TRACE("usage 0: type %s\n", debug_d3dxparameter_type(param->type)); switch (param->type) { case D3DXPT_VERTEXSHADER: case D3DXPT_PIXELSHADER: state->type = ST_CONSTANT; - hr = d3dx9_copy_data(&base->objects[param->object_id], ptr); + if (FAILED(hr = d3dx9_copy_data(&base->objects[param->object_id], ptr))) + return hr; + + if (object->data) + hr = d3dx9_create_object(base, object); break; case D3DXPT_BOOL: @@ -5052,7 +5176,27 @@ case 1: state->type = ST_PARAMETER; - hr = d3dx9_copy_data(&base->objects[param->object_id], ptr); + if (FAILED(hr = d3dx9_copy_data(&base->objects[param->object_id], ptr))) + return hr; + + TRACE("Looking for parameter %s.\n", debugstr_a(object->data)); + param->referenced_param = get_parameter_by_name(base, NULL, object->data); + if (param->referenced_param) + { + TRACE("Mapping to parameter %p.\n", param->referenced_param); + } + else + { + FIXME("Referenced parameter %s not found.\n", (char *)object->data); + return D3DXERR_INVALIDDATA; + } + break; + + case 2: + state->type = ST_ARRAY_SELECTOR; + if (FAILED(hr = d3dx9_copy_data(object, ptr))) + return hr; + hr = d3dx9_parse_array_selector(base, param); break; default: @@ -5150,11 +5294,13 @@ read_dword(&ptr, &id); TRACE("Id: %u\n", id); - hr = d3dx9_copy_data(&base->objects[id], &ptr); - if (hr != D3D_OK) - { - WARN("Failed to parse data %u\n", i); + if (FAILED(hr = d3dx9_copy_data(&base->objects[id], &ptr))) goto err_out; + + if (base->objects[id].data) + { + if (FAILED(hr = d3dx9_create_object(base, &base->objects[id]))) + goto err_out; } } @@ -5340,7 +5486,7 @@ (ID3DInclude *)include, flags, (ID3DBlob **)compilation_errors, pool); if (FAILED(hr)) { - WARN("Failed to initialize shader reflection\n"); + WARN("Failed to create effect object.\n"); HeapFree(GetProcessHeap(), 0, object); return hr; } diff -Nru wine1.7-1.7.14/dlls/d3dx9_36/tests/effect.c wine1.7-1.7.18/dlls/d3dx9_36/tests/effect.c --- wine1.7-1.7.14/dlls/d3dx9_36/tests/effect.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/d3dx9_36/tests/effect.c 2014-05-02 18:15:48.000000000 +0000 @@ -1683,9 +1683,9 @@ UINT res_value_offset = res[k].value_offset; D3DXHANDLE parameter; D3DXPARAMETER_DESC pdesc; - BOOL bvalue; - INT ivalue; - FLOAT fvalue; + BOOL bvalue = TRUE; + INT ivalue = 42; + FLOAT fvalue = 2.71828f; DWORD input_value[EFFECT_PARAMETER_VALUE_ARRAY_SIZE]; DWORD expected_value[EFFECT_PARAMETER_VALUE_ARRAY_SIZE]; UINT l, n, m, element; diff -Nru wine1.7-1.7.14/dlls/d3dx9_36/tests/math.c wine1.7-1.7.18/dlls/d3dx9_36/tests/math.c --- wine1.7-1.7.14/dlls/d3dx9_36/tests/math.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/d3dx9_36/tests/math.c 2014-05-02 18:15:48.000000000 +0000 @@ -2443,7 +2443,7 @@ /* * Order is not limited by D3DXSH_MINORDER and D3DXSH_MAXORDER! * All values will work, test from 0-7 [D3DXSH_MINORDER = 2, D3DXSH_MAXORDER = 6] - * Exceptions will show up when out, in1 or in2 are NULL + * Exceptions will show up when out, in1 or in2 is NULL */ for (k = 0; k <= D3DXSH_MAXORDER + 1; k++) { diff -Nru wine1.7-1.7.14/dlls/d3dx9_36/tests/shader.c wine1.7-1.7.18/dlls/d3dx9_36/tests/shader.c --- wine1.7-1.7.14/dlls/d3dx9_36/tests/shader.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/d3dx9_36/tests/shader.c 2014-05-02 18:15:48.000000000 +0000 @@ -6131,6 +6131,7 @@ || caps.PixelShaderVersion < D3DPS_VERSION(3, 0)) { skip("Skipping: Test requires VS >= 3 and PS >= 3.\n"); + IDirect3DDevice9_Release(device); IDirect3D9_Release(d3d); DestroyWindow(wnd); return; @@ -6435,6 +6436,7 @@ || caps.PixelShaderVersion < D3DPS_VERSION(3, 0)) { skip("Skipping: Test requires VS >= 3 and PS >= 3.\n"); + IDirect3DDevice9_Release(device); IDirect3D9_Release(d3d); DestroyWindow(wnd); return; diff -Nru wine1.7-1.7.14/dlls/d3dx9_36/tests/texture.c wine1.7-1.7.18/dlls/d3dx9_36/tests/texture.c --- wine1.7-1.7.14/dlls/d3dx9_36/tests/texture.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/d3dx9_36/tests/texture.c 2014-05-02 18:15:48.000000000 +0000 @@ -304,14 +304,14 @@ if (SUCCEEDED(IDirect3D9_CheckDeviceFormat(d3d, params.AdapterOrdinal, params.DeviceType, mode.Format, 0, D3DRTYPE_TEXTURE, D3DFMT_R3G3B2))) expected = D3DFMT_R3G3B2; + else if (SUCCEEDED(IDirect3D9_CheckDeviceFormat(d3d, params.AdapterOrdinal, params.DeviceType, + mode.Format, 0, D3DRTYPE_TEXTURE, D3DFMT_X4R4G4B4))) + expected = D3DFMT_X4R4G4B4; + else if (SUCCEEDED(IDirect3D9_CheckDeviceFormat(d3d, params.AdapterOrdinal, params.DeviceType, + mode.Format, 0, D3DRTYPE_TEXTURE, D3DFMT_X1R5G5B5))) + expected = D3DFMT_X1R5G5B5; else - { - if (SUCCEEDED(IDirect3D9_CheckDeviceFormat(d3d, params.AdapterOrdinal, params.DeviceType, - mode.Format, 0, D3DRTYPE_TEXTURE, D3DFMT_X4R4G4B4))) - expected = D3DFMT_X4R4G4B4; - else - expected = D3DFMT_X1R5G5B5; - } + expected = D3DFMT_R5G6B5; format = D3DFMT_R3G3B2; hr = D3DXCheckTextureRequirements(device, NULL, NULL, NULL, 0, &format, D3DPOOL_DEFAULT); @@ -341,15 +341,22 @@ ok(format == expected, "Returned format %u, expected %u\n", format, expected); /* Block-based texture formats and size < block size. */ - format = D3DFMT_DXT1; - width = 2; height = 2; - mipmaps = 1; - hr = D3DXCheckTextureRequirements(device, &width, &height, &mipmaps, 0, &format, D3DPOOL_DEFAULT); - ok(hr == D3D_OK, "D3DXCheckTextureRequirements returned %#x, expected %#x\n", hr, D3D_OK); - ok(width == 4, "Returned width %d, expected %d\n", width, 4); - ok(height == 4, "Returned height %d, expected %d\n", height, 4); - ok(mipmaps == 1, "Returned mipmaps %d, expected %d\n", mipmaps, 1); - ok(format == D3DFMT_DXT1, "Returned format %u, expected %u\n", format, D3DFMT_DXT1); + if (has_2d_dxt5) + { + format = D3DFMT_DXT5; + width = 2; height = 2; + mipmaps = 1; + hr = D3DXCheckTextureRequirements(device, &width, &height, &mipmaps, 0, &format, D3DPOOL_DEFAULT); + ok(hr == D3D_OK, "D3DXCheckTextureRequirements returned %#x, expected %#x\n", hr, D3D_OK); + ok(width == 4, "Returned width %d, expected %d\n", width, 4); + ok(height == 4, "Returned height %d, expected %d\n", height, 4); + ok(mipmaps == 1, "Returned mipmaps %d, expected %d\n", mipmaps, 1); + ok(format == D3DFMT_DXT5, "Returned format %u, expected %u\n", format, D3DFMT_DXT5); + } + else + { + skip("D3DFMT_DXT5 textures are not supported, skipping a test.\n"); + } IDirect3D9_Release(d3d); } @@ -395,6 +402,7 @@ size = 284; mipmaps = 20; expected = caps.TextureCaps & D3DPTEXTURECAPS_CUBEMAP_POW2 ? 10 : 9; + expected = caps.TextureCaps & D3DPTEXTURECAPS_MIPCUBEMAP ? expected : 1; hr = D3DXCheckCubeTextureRequirements(device, &size, &mipmaps, 0, NULL, D3DPOOL_DEFAULT); ok(hr == D3D_OK, "D3DXCheckCubeTextureRequirements returned %#x, expected %#x\n", hr, D3D_OK); ok(mipmaps == expected, "Returned mipmaps %d, expected %d\n", mipmaps, expected); @@ -402,6 +410,7 @@ size = 63; mipmaps = 9; expected = caps.TextureCaps & D3DPTEXTURECAPS_CUBEMAP_POW2 ? 7 : 6; + expected = caps.TextureCaps & D3DPTEXTURECAPS_MIPCUBEMAP ? expected : 1; hr = D3DXCheckCubeTextureRequirements(device, &size, &mipmaps, 0, NULL, D3DPOOL_DEFAULT); ok(hr == D3D_OK, "D3DXCheckCubeTextureRequirements returned %#x, expected %#x\n", hr, D3D_OK); ok(mipmaps == expected, "Returned mipmaps %d, expected %d\n", mipmaps, expected); @@ -462,9 +471,9 @@ IDirect3DDevice9_GetDeviceCaps(device, &caps); - if (!(caps.TextureCaps & D3DPTEXTURECAPS_VOLUMEMAP)) + if (!(caps.TextureCaps & D3DPTEXTURECAPS_VOLUMEMAP) || (caps.MaxVolumeExtent < 256)) { - skip("No volume textures support\n"); + skip("Limited or no volume textures support.\n"); return; } @@ -551,7 +560,7 @@ height = 143; depth = 55; mipmaps = 20; - expected = caps.TextureCaps & D3DPTEXTURECAPS_VOLUMEMAP_POW2 ? 10 : 9; + expected = (caps.TextureCaps & D3DPTEXTURECAPS_VOLUMEMAP_POW2 && caps.MaxVolumeExtent >= 512) ? 10 : 9; hr = D3DXCheckVolumeTextureRequirements(device, &width, &height, &depth, &mipmaps, 0, NULL, D3DPOOL_DEFAULT); ok(hr == D3D_OK, "D3DXCheckVolumeTextureRequirements returned %#x, expected %#x\n", hr, D3D_OK); ok(mipmaps == expected, "Returned mipmaps %d, expected %d\n", mipmaps, expected); @@ -1630,7 +1639,10 @@ ok(hr == D3DERR_INVALIDCALL, "D3DXCreateVolumeTextureFromFileInMemory returned %#x, expected %#x\n", hr, D3DERR_INVALIDCALL); hr = D3DXCreateVolumeTextureFromFileInMemory(device, dds_volume_map, sizeof(dds_volume_map), &volume_texture); - ok(hr == D3D_OK, "D3DXCreateVolumeTextureFromFileInMemory returned %#x, expected %#x\n", hr, D3D_OK); + if (has_2d_dxt3) + ok(hr == D3D_OK, "D3DXCreateVolumeTextureFromFileInMemory returned %#x, expected %#x\n", hr, D3D_OK); + else + todo_wine ok(hr == D3D_OK, "D3DXCreateVolumeTextureFromFileInMemory returned %#x, expected %#x\n", hr, D3D_OK); if (SUCCEEDED(hr)) { levelcount = IDirect3DVolumeTexture9_GetLevelCount(volume_texture); diff -Nru wine1.7-1.7.14/dlls/d3dx9_36/tests/volume.c wine1.7-1.7.18/dlls/d3dx9_36/tests/volume.c --- wine1.7-1.7.14/dlls/d3dx9_36/tests/volume.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/d3dx9_36/tests/volume.c 2014-05-02 18:15:48.000000000 +0000 @@ -73,7 +73,7 @@ &volume_texture, NULL); if (FAILED(hr)) { - skip("Failed to create volume texture\n"); + skip("Failed to create volume texture.\n"); return; } @@ -83,7 +83,11 @@ set_box(&dst_box, 0, 0, 4, 1, 0, 4); hr = D3DXLoadVolumeFromMemory(volume, NULL, &dst_box, pixels, D3DFMT_A8R8G8B8, 16, 16, NULL, &src_box, D3DX_DEFAULT, 0); - ok(hr == D3D_OK, "D3DXLoadVolumeFromMemory returned %#x, expected %#x\n", hr, D3D_OK); + if (FAILED(hr)) + { + win_skip("D3DXLoadVolumeFromMemory failed with error %#x, skipping some tests.\n", hr); + return; + } IDirect3DVolume9_LockBox(volume, &locked_box, &dst_box, D3DLOCK_READONLY); for (i = 0; i < 16; i++) check_pixel_4bpp(&locked_box, i % 4, 0, i / 4, pixels[i]); diff -Nru wine1.7-1.7.14/dlls/d3dxof/parsing.c wine1.7-1.7.18/dlls/d3dxof/parsing.c --- wine1.7-1.7.14/dlls/d3dxof/parsing.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/d3dxof/parsing.c 2014-05-02 18:15:48.000000000 +0000 @@ -19,6 +19,7 @@ */ #include "config.h" +#include "wine/port.h" #include "wine/debug.h" #define COBJMACROS @@ -90,7 +91,7 @@ (char)(fourcc >> 16), (char)(fourcc >> 24)); } -static const char* get_primitive_string(WORD token) +static const char* get_primitive_string(DWORD token) { switch(token) { diff -Nru wine1.7-1.7.14/dlls/dbghelp/dwarf.c wine1.7-1.7.18/dlls/dbghelp/dwarf.c --- wine1.7-1.7.14/dlls/dbghelp/dwarf.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/dbghelp/dwarf.c 2014-05-02 18:15:48.000000000 +0000 @@ -1440,6 +1440,9 @@ switch (child->abbrev->tag) { + case DW_TAG_array_type: + dwarf2_parse_array_type(ctx, di); + break; case DW_TAG_member: /* FIXME: should I follow the sibling stuff ?? */ dwarf2_parse_udt_member(ctx, child, (struct symt_udt*)di->symt); @@ -1710,7 +1713,10 @@ static void dwarf2_parse_subprogram_block(dwarf2_subprogram_t* subpgm, struct symt_block* parent_block, - dwarf2_debug_info_t* di); + dwarf2_debug_info_t* di); + +static struct symt* dwarf2_parse_subroutine_type(dwarf2_parse_context_t* ctx, + dwarf2_debug_info_t* di); static void dwarf2_parse_inlined_subroutine(dwarf2_subprogram_t* subpgm, struct symt_block* parent_block, @@ -1801,6 +1807,12 @@ case DW_TAG_variable: dwarf2_parse_variable(subpgm, block, child); break; + case DW_TAG_pointer_type: + dwarf2_parse_pointer_type(subpgm->ctx, di); + break; + case DW_TAG_subroutine_type: + dwarf2_parse_subroutine_type(subpgm->ctx, di); + break; case DW_TAG_lexical_block: dwarf2_parse_subprogram_block(subpgm, block, child); break; @@ -1930,6 +1942,9 @@ case DW_TAG_inlined_subroutine: dwarf2_parse_inlined_subroutine(&subpgm, NULL, child); break; + case DW_TAG_pointer_type: + dwarf2_parse_pointer_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.14/dlls/dbghelp/msc.c wine1.7-1.7.18/dlls/dbghelp/msc.c --- wine1.7-1.7.14/dlls/dbghelp/msc.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/dbghelp/msc.c 2014-05-02 18:15:48.000000000 +0000 @@ -2239,7 +2239,7 @@ HeapFree(GetProcessHeap(), 0, pdb_file->stream_dict); } -static BOOL pdb_load_stream_name_table(struct pdb_file_info* pdb_file, const char* str, unsigned cb) +static void pdb_load_stream_name_table(struct pdb_file_info* pdb_file, const char* str, unsigned cb) { DWORD* pdw; DWORD* ok_bits; @@ -2252,7 +2252,7 @@ count = *pdw++; pdb_file->stream_dict = HeapAlloc(GetProcessHeap(), 0, (numok + 1) * sizeof(struct pdb_stream_name) + cb); - if (!pdb_file->stream_dict) return FALSE; + if (!pdb_file->stream_dict) return; cpstr = (char*)(pdb_file->stream_dict + numok + 1); memcpy(cpstr, str, cb); @@ -2262,7 +2262,7 @@ if (*pdw++ != 0) { FIXME("unexpected value\n"); - return -1; + return; } for (i = j = 0; i < count; i++) @@ -2278,7 +2278,6 @@ /* add sentinel */ pdb_file->stream_dict[numok].name = NULL; pdb_file->fpoext_stream = -1; - return j == numok && i == count; } static unsigned pdb_get_stream_by_name(const struct pdb_file_info* pdb_file, const char* name) diff -Nru wine1.7-1.7.14/dlls/dbghelp/symbol.c wine1.7-1.7.18/dlls/dbghelp/symbol.c --- wine1.7-1.7.14/dlls/dbghelp/symbol.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/dbghelp/symbol.c 2014-05-02 18:15:48.000000000 +0000 @@ -696,8 +696,8 @@ if (sym_info->MaxNameLen) { if (sym->tag != SymTagPublicSymbol || !(dbghelp_options & SYMOPT_UNDNAME) || - (sym_info->NameLen = UnDecorateSymbolName(name, sym_info->Name, - sym_info->MaxNameLen, UNDNAME_NAME_ONLY) == 0)) + ((sym_info->NameLen = UnDecorateSymbolName(name, sym_info->Name, + sym_info->MaxNameLen, UNDNAME_NAME_ONLY)) == 0)) { sym_info->NameLen = min(strlen(name), sym_info->MaxNameLen - 1); memcpy(sym_info->Name, name, sym_info->NameLen); diff -Nru wine1.7-1.7.14/dlls/dbghelp/type.c wine1.7-1.7.18/dlls/dbghelp/type.c --- wine1.7-1.7.14/dlls/dbghelp/type.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/dbghelp/type.c 2014-05-02 18:15:48.000000000 +0000 @@ -693,7 +693,7 @@ symt_get_tag_str(type->tag)); /* fall through */ case SymTagFunctionType: - return 0; + return FALSE; } break; diff -Nru wine1.7-1.7.14/dlls/ddraw/ddraw.c wine1.7-1.7.18/dlls/ddraw/ddraw.c --- wine1.7-1.7.14/dlls/ddraw/ddraw.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/ddraw/ddraw.c 2014-05-02 18:15:48.000000000 +0000 @@ -4871,9 +4871,9 @@ ddraw->ref7 = 1; flags = WINED3D_LEGACY_DEPTH_BIAS | WINED3D_VIDMEM_ACCOUNTING; - if (!(ddraw->wined3d = wined3d_create(7, flags))) + if (!(ddraw->wined3d = wined3d_create(flags))) { - if (!(ddraw->wined3d = wined3d_create(7, flags | WINED3D_NO3D))) + if (!(ddraw->wined3d = wined3d_create(flags | WINED3D_NO3D))) { WARN("Failed to create a wined3d object.\n"); return E_FAIL; diff -Nru wine1.7-1.7.14/dlls/ddraw/ddraw_private.h wine1.7-1.7.18/dlls/ddraw/ddraw_private.h --- wine1.7-1.7.14/dlls/ddraw/ddraw_private.h 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/ddraw/ddraw_private.h 2014-05-02 18:15:48.000000000 +0000 @@ -150,6 +150,7 @@ struct ddraw *ddraw; struct wined3d_surface *wined3d_surface; struct wined3d_texture *wined3d_texture; + struct wined3d_private_store private_store; struct d3d_device *device1; /* This implementation handles attaching surfaces to other surfaces */ diff -Nru wine1.7-1.7.14/dlls/ddraw/device.c wine1.7-1.7.18/dlls/ddraw/device.c --- wine1.7-1.7.14/dlls/ddraw/device.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/ddraw/device.c 2014-05-02 18:15:48.000000000 +0000 @@ -2945,16 +2945,19 @@ wined3d_mutex_lock(); if (state == D3DLIGHTSTATE_MATERIAL) { - struct d3d_material *m = ddraw_get_object(&device->handle_table, value - 1, DDRAW_HANDLE_MATERIAL); - if (!m) + if (value) { - WARN("Invalid material handle.\n"); - wined3d_mutex_unlock(); - return DDERR_INVALIDPARAMS; - } + struct d3d_material *m; - TRACE(" activating material %p.\n", m); - material_activate(m); + if (!(m = ddraw_get_object(&device->handle_table, value - 1, DDRAW_HANDLE_MATERIAL))) + { + WARN("Invalid material handle.\n"); + wined3d_mutex_unlock(); + return DDERR_INVALIDPARAMS; + } + + material_activate(m); + } device->material = value; } @@ -3568,15 +3571,11 @@ static void setup_lighting(const struct d3d_device *device, DWORD fvf, DWORD flags) { - BOOL enable; + BOOL enable = TRUE; /* Ignore the D3DFVF_XYZRHW case here, wined3d takes care of that */ - if (flags & D3DDP_DONOTLIGHT) + if (!device->material || !(fvf & D3DFVF_NORMAL) || (flags & D3DDP_DONOTLIGHT)) enable = FALSE; - else if (!(fvf & D3DFVF_NORMAL)) - enable = FALSE; - else - enable = TRUE; wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_LIGHTING, enable); } @@ -4444,8 +4443,8 @@ * are passed in the Centers and Radii arrays, the results are passed back * in the ReturnValues array. Return values are either completely visible, * partially visible or completely invisible. - * The return value consist of a combination of D3DCLIP_* flags, or it's - * 0 if the sphere is completely visible(according to the SDK, not checked) + * The return value consists of a combination of D3DCLIP_* flags, or is + * 0 if the sphere is completely visible (according to the SDK, not checked) * * Version 3 and 7 * @@ -4736,7 +4735,7 @@ } } - /* Arg 1/2 are already set to WINED3DTA_TEXTURE/WINED3DTA_CURRENT in case of D3DTBLEND_MODULATE */ + /* Args 1 and 2 are already set to WINED3DTA_TEXTURE/WINED3DTA_CURRENT in case of D3DTBLEND_MODULATE */ if (tex_alpha) wined3d_device_set_texture_stage_state(device->wined3d_device, 0, WINED3D_TSS_ALPHA_OP, WINED3D_TOP_SELECT_ARG1); @@ -6050,7 +6049,7 @@ * * Returns: * D3D_OK on success - * DDERR_INVALIDPARAMS if DestTex or SrcTex are NULL, broken coordinates or anything unexpected. + * DDERR_INVALIDPARAMS if dst_texture or src_texture is NULL, broken coordinates or anything unexpected. * * *****************************************************************************/ diff -Nru wine1.7-1.7.14/dlls/ddraw/executebuffer.c wine1.7-1.7.18/dlls/ddraw/executebuffer.c --- wine1.7-1.7.14/dlls/ddraw/executebuffer.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/ddraw/executebuffer.c 2014-05-02 18:15:48.000000000 +0000 @@ -50,12 +50,27 @@ TRACE("lpData : %p\n", lpDesc->lpData); } +static void transform_vertex(D3DTLVERTEX *dst, const D3DMATRIX *mat, + const D3DVIEWPORT *vp, float x, float y, float z) +{ + dst->u1.sx = (x * mat->_11) + (y * mat->_21) + (z * mat->_31) + mat->_41; + dst->u2.sy = (x * mat->_12) + (y * mat->_22) + (z * mat->_32) + mat->_42; + dst->u3.sz = (x * mat->_13) + (y * mat->_23) + (z * mat->_33) + mat->_43; + dst->u4.rhw = (x * mat->_14) + (y * mat->_24) + (z * mat->_34) + mat->_44; + + dst->u1.sx = dst->u1.sx / dst->u4.rhw * vp->dvScaleX + vp->dwX + vp->dwWidth / 2; + dst->u2.sy = -dst->u2.sy / dst->u4.rhw * vp->dvScaleY + vp->dwY + vp->dwHeight / 2; + dst->u3.sz /= dst->u4.rhw; + dst->u4.rhw = 1.0f / dst->u4.rhw; +} + HRESULT d3d_execute_buffer_execute(struct d3d_execute_buffer *buffer, struct d3d_device *device, struct d3d_viewport *viewport) { DWORD vs = buffer->data.dwVertexOffset; DWORD is = buffer->data.dwInstructionOffset; char *instr = (char *)buffer->desc.lpData + is; + unsigned int i; if (viewport->active_device != device) { @@ -92,8 +107,8 @@ instr += count * size; } break; - case D3DOP_TRIANGLE: { - DWORD i; + case D3DOP_TRIANGLE: + { D3DTLVERTEX *tl_vx = buffer->vertex_data; TRACE("TRIANGLE (%d)\n", count); @@ -144,10 +159,8 @@ instr += count * size; break; - case D3DOP_MATRIXMULTIPLY: { - DWORD i; - TRACE("MATRIXMULTIPLY (%d)\n", count); - + case D3DOP_MATRIXMULTIPLY: + TRACE("MATRIXMULTIPLY (%d)\n", count); for (i = 0; i < count; ++i) { D3DMATRIXMULTIPLY *ci = (D3DMATRIXMULTIPLY *)instr; @@ -169,13 +182,11 @@ } instr += size; - } - } break; + } + break; - case D3DOP_STATETRANSFORM: { - DWORD i; - TRACE("STATETRANSFORM (%d)\n", count); - + case D3DOP_STATETRANSFORM: + TRACE("STATETRANSFORM (%d)\n", count); for (i = 0; i < count; ++i) { D3DSTATE *ci = (D3DSTATE *)instr; @@ -200,97 +211,42 @@ instr += size; } - } break; - - case D3DOP_STATELIGHT: { - DWORD i; - TRACE("STATELIGHT (%d)\n", count); + break; + case D3DOP_STATELIGHT: + TRACE("STATELIGHT (%d)\n", count); for (i = 0; i < count; ++i) { D3DSTATE *ci = (D3DSTATE *)instr; - TRACE("(%08x,%08x)\n", ci->u1.dlstLightStateType, ci->u2.dwArg[0]); - - if (!ci->u1.dlstLightStateType || (ci->u1.dlstLightStateType > D3DLIGHTSTATE_COLORVERTEX)) - ERR("Unexpected Light State Type %d\n", ci->u1.dlstLightStateType); - else if (ci->u1.dlstLightStateType == D3DLIGHTSTATE_MATERIAL /* 1 */) - { - struct d3d_material *m; - - m = ddraw_get_object(&device->handle_table, ci->u2.dwArg[0] - 1, DDRAW_HANDLE_MATERIAL); - if (!m) - ERR("Invalid material handle %#x.\n", ci->u2.dwArg[0]); - else - material_activate(m); - } - else if (ci->u1.dlstLightStateType == D3DLIGHTSTATE_COLORMODEL /* 3 */) - { - switch (ci->u2.dwArg[0]) { - case D3DCOLOR_MONO: - ERR("DDCOLOR_MONO should not happen!\n"); - break; - case D3DCOLOR_RGB: - /* We are already in this mode */ - break; - default: - ERR("Unknown color model!\n"); - } - } else { - D3DRENDERSTATETYPE rs = 0; - switch (ci->u1.dlstLightStateType) { - - case D3DLIGHTSTATE_AMBIENT: /* 2 */ - rs = D3DRENDERSTATE_AMBIENT; - break; - case D3DLIGHTSTATE_FOGMODE: /* 4 */ - rs = D3DRENDERSTATE_FOGVERTEXMODE; - break; - case D3DLIGHTSTATE_FOGSTART: /* 5 */ - rs = D3DRENDERSTATE_FOGSTART; - break; - case D3DLIGHTSTATE_FOGEND: /* 6 */ - rs = D3DRENDERSTATE_FOGEND; - break; - case D3DLIGHTSTATE_FOGDENSITY: /* 7 */ - rs = D3DRENDERSTATE_FOGDENSITY; - break; - case D3DLIGHTSTATE_COLORVERTEX: /* 8 */ - rs = D3DRENDERSTATE_COLORVERTEX; - break; - default: - break; - } - - IDirect3DDevice7_SetRenderState(&device->IDirect3DDevice7_iface, rs, ci->u2.dwArg[0]); - } + if (FAILED(IDirect3DDevice3_SetLightState(&device->IDirect3DDevice3_iface, + ci->u1.dlstLightStateType, ci->u2.dwArg[0]))) + WARN("Failed to set light state.\n"); - instr += size; - } - } break; - - case D3DOP_STATERENDER: { - DWORD i; - IDirect3DDevice2 *d3d_device2 = &device->IDirect3DDevice2_iface; - TRACE("STATERENDER (%d)\n", count); + instr += size; + } + break; + case D3DOP_STATERENDER: + TRACE("STATERENDER (%d)\n", count); for (i = 0; i < count; ++i) { D3DSTATE *ci = (D3DSTATE *)instr; - IDirect3DDevice2_SetRenderState(d3d_device2, ci->u1.drstRenderStateType, ci->u2.dwArg[0]); + if (FAILED(IDirect3DDevice3_SetRenderState(&device->IDirect3DDevice3_iface, + ci->u1.drstRenderStateType, ci->u2.dwArg[0]))) + WARN("Failed to set render state.\n"); - instr += size; - } - } break; + instr += size; + } + break; case D3DOP_PROCESSVERTICES: { - /* TODO: Share code with IDirect3DVertexBuffer::ProcessVertices and / or - * IWineD3DDevice::ProcessVertices - */ - DWORD i; - D3DMATRIX view_mat, world_mat, proj_mat; + /* TODO: Share code with d3d_vertex_buffer7_ProcessVertices() + * and / or wined3d_device_process_vertices(). */ + D3DMATRIX view_mat, world_mat, proj_mat, mat; + TRACE("PROCESSVERTICES (%d)\n", count); /* Get the transform and world matrix */ @@ -302,157 +258,91 @@ wined3d_device_get_transform(device->wined3d_device, WINED3D_TS_WORLD_MATRIX(0), (struct wined3d_matrix *)&world_mat); - for (i = 0; i < count; ++i) + if (TRACE_ON(ddraw)) { - D3DPROCESSVERTICES *ci = (D3DPROCESSVERTICES *)instr; - - TRACE(" Start : %d Dest : %d Count : %d\n", - ci->wStart, ci->wDest, ci->dwCount); - TRACE(" Flags : "); - if (TRACE_ON(ddraw)) - { - if (ci->dwFlags & D3DPROCESSVERTICES_COPY) - TRACE("COPY "); - if (ci->dwFlags & D3DPROCESSVERTICES_NOCOLOR) - TRACE("NOCOLOR "); - if (ci->dwFlags == D3DPROCESSVERTICES_OPMASK) - TRACE("OPMASK "); - if (ci->dwFlags & D3DPROCESSVERTICES_TRANSFORM) - TRACE("TRANSFORM "); - if (ci->dwFlags == D3DPROCESSVERTICES_TRANSFORMLIGHT) - TRACE("TRANSFORMLIGHT "); - if (ci->dwFlags & D3DPROCESSVERTICES_UPDATEEXTENTS) - TRACE("UPDATEEXTENTS "); - TRACE("\n"); - } + TRACE(" Projection Matrix:\n"); + dump_D3DMATRIX(&proj_mat); + TRACE(" View Matrix:\n"); + dump_D3DMATRIX(&view_mat); + TRACE(" World Matrix:\n"); + dump_D3DMATRIX(&world_mat); + } - /* This is where doing Direct3D on top on OpenGL is quite difficult. - This method transforms a set of vertices using the CURRENT state - (lighting, projection, ...) but does not rasterize them. - They will only be put on screen later (with the POINT / LINE and - TRIANGLE op-codes). The problem is that you can have a triangle - with each point having been transformed using another state... - - In this implementation, I will emulate only ONE thing : each - vertex can have its own "WORLD" transformation (this is used in the - TWIST.EXE demo of the 5.2 SDK). I suppose that all vertices of the - execute buffer use the same state. - - If I find applications that change other states, I will try to do a - more 'fine-tuned' state emulation (but I may become quite tricky if - it changes a light position in the middle of a triangle). - - In this case, a 'direct' approach (i.e. without using OpenGL, but - writing our own 3D rasterizer) would be easier. */ - - /* The current method (with the hypothesis that only the WORLD matrix - will change between two points) is like this : - - I transform 'manually' all the vertices with the current WORLD - matrix and store them in the vertex buffer - - during the rasterization phase, the WORLD matrix will be set to - the Identity matrix */ - - /* Enough for the moment */ - if (ci->dwFlags == D3DPROCESSVERTICES_TRANSFORMLIGHT) { - unsigned int nb; - D3DVERTEX *src = ((D3DVERTEX *)((char *)buffer->desc.lpData + vs)) + ci->wStart; - D3DTLVERTEX *dst = ((D3DTLVERTEX *)buffer->vertex_data) + ci->wDest; - D3DVIEWPORT *Viewport = &viewport->viewports.vp1; - D3DMATRIX mat; - - if (TRACE_ON(ddraw)) - { - TRACE(" Projection Matrix : (%p)\n", &proj_mat); - dump_D3DMATRIX(&proj_mat); - TRACE(" View Matrix : (%p)\n", &view_mat); - dump_D3DMATRIX(&view_mat); - TRACE(" World Matrix : (%p)\n", &world_mat); - dump_D3DMATRIX(&world_mat); - } + multiply_matrix(&mat, &view_mat, &world_mat); + multiply_matrix(&mat, &proj_mat, &mat); - multiply_matrix(&mat,&view_mat,&world_mat); - multiply_matrix(&mat,&proj_mat,&mat); + for (i = 0; i < count; ++i) + { + D3DPROCESSVERTICES *ci = (D3DPROCESSVERTICES *)instr; + D3DTLVERTEX *dst = (D3DTLVERTEX *)buffer->vertex_data + ci->wDest; + DWORD op = ci->dwFlags & D3DPROCESSVERTICES_OPMASK; - for (nb = 0; nb < ci->dwCount; nb++) { - /* No lighting yet */ - dst->u5.color = 0xFFFFFFFF; /* Opaque white */ - dst->u6.specular = 0xFF000000; /* No specular and no fog factor */ - - dst->u7.tu = src->u7.tu; - dst->u8.tv = src->u8.tv; - - dst->u1.sx = (src->u1.x * mat._11) + (src->u2.y * mat._21) + (src->u3.z * mat._31) + mat._41; - dst->u2.sy = (src->u1.x * mat._12) + (src->u2.y * mat._22) + (src->u3.z * mat._32) + mat._42; - dst->u3.sz = (src->u1.x * mat._13) + (src->u2.y * mat._23) + (src->u3.z * mat._33) + mat._43; - dst->u4.rhw = (src->u1.x * mat._14) + (src->u2.y * mat._24) + (src->u3.z * mat._34) + mat._44; - - dst->u1.sx = dst->u1.sx / dst->u4.rhw * Viewport->dvScaleX - + Viewport->dwX + Viewport->dwWidth / 2; - dst->u2.sy = (-dst->u2.sy) / dst->u4.rhw * Viewport->dvScaleY - + Viewport->dwY + Viewport->dwHeight / 2; - dst->u3.sz /= dst->u4.rhw; - dst->u4.rhw = 1 / dst->u4.rhw; + TRACE(" start %u, dest %u, count %u, flags %#x.\n", + ci->wStart, ci->wDest, ci->dwCount, ci->dwFlags); - src++; - dst++; + if (ci->dwFlags & D3DPROCESSVERTICES_UPDATEEXTENTS) + FIXME("D3DPROCESSVERTICES_UPDATEEXTENTS not implemented.\n"); + if (ci->dwFlags & D3DPROCESSVERTICES_NOCOLOR) + FIXME("D3DPROCESSVERTICES_NOCOLOR not implemented.\n"); - } - } else if (ci->dwFlags == D3DPROCESSVERTICES_TRANSFORM) { - unsigned int nb; - D3DLVERTEX *src = ((D3DLVERTEX *)((char *)buffer->desc.lpData + vs)) + ci->wStart; - D3DTLVERTEX *dst = ((D3DTLVERTEX *)buffer->vertex_data) + ci->wDest; - D3DVIEWPORT *Viewport = &viewport->viewports.vp1; - D3DMATRIX mat; - - if (TRACE_ON(ddraw)) + switch (op) + { + case D3DPROCESSVERTICES_TRANSFORMLIGHT: { - TRACE(" Projection Matrix : (%p)\n", &proj_mat); - dump_D3DMATRIX(&proj_mat); - TRACE(" View Matrix : (%p)\n",&view_mat); - dump_D3DMATRIX(&view_mat); - TRACE(" World Matrix : (%p)\n", &world_mat); - dump_D3DMATRIX(&world_mat); - } + const D3DVERTEX *src = (D3DVERTEX *)((char *)buffer->desc.lpData + vs) + ci->wStart; + unsigned int vtx_idx; + static unsigned int once; + + if (!once++) + FIXME("Lighting not implemented.\n"); + + for (vtx_idx = 0; vtx_idx < ci->dwCount; ++vtx_idx) + { + transform_vertex(&dst[vtx_idx], &mat, &viewport->viewports.vp1, + src[vtx_idx].u1.x, src[vtx_idx].u2.y, src[vtx_idx].u3.z); + /* No lighting yet */ + dst[vtx_idx].u5.color = 0xffffffff; /* Opaque white */ + dst[vtx_idx].u6.specular = 0xff000000; /* No specular and no fog factor */ + dst[vtx_idx].u7.tu = src[vtx_idx].u7.tu; + dst[vtx_idx].u8.tv = src[vtx_idx].u8.tv; + } + break; + } - multiply_matrix(&mat,&view_mat,&world_mat); - multiply_matrix(&mat,&proj_mat,&mat); + case D3DPROCESSVERTICES_TRANSFORM: + { + const D3DLVERTEX *src = (D3DLVERTEX *)((char *)buffer->desc.lpData + vs) + ci->wStart; + unsigned int vtx_idx; - for (nb = 0; nb < ci->dwCount; nb++) { - dst->u5.color = src->u4.color; - dst->u6.specular = src->u5.specular; - dst->u7.tu = src->u6.tu; - dst->u8.tv = src->u7.tv; - - dst->u1.sx = (src->u1.x * mat._11) + (src->u2.y * mat._21) + (src->u3.z * mat._31) + mat._41; - dst->u2.sy = (src->u1.x * mat._12) + (src->u2.y * mat._22) + (src->u3.z * mat._32) + mat._42; - dst->u3.sz = (src->u1.x * mat._13) + (src->u2.y * mat._23) + (src->u3.z * mat._33) + mat._43; - dst->u4.rhw = (src->u1.x * mat._14) + (src->u2.y * mat._24) + (src->u3.z * mat._34) + mat._44; - - dst->u1.sx = dst->u1.sx / dst->u4.rhw * Viewport->dvScaleX - + Viewport->dwX + Viewport->dwWidth / 2; - dst->u2.sy = (-dst->u2.sy) / dst->u4.rhw * Viewport->dvScaleY - + Viewport->dwY + Viewport->dwHeight / 2; + for (vtx_idx = 0; vtx_idx < ci->dwCount; ++vtx_idx) + { + transform_vertex(&dst[vtx_idx], &mat, &viewport->viewports.vp1, + src[vtx_idx].u1.x, src[vtx_idx].u2.y, src[vtx_idx].u3.z); + dst[vtx_idx].u5.color = src[vtx_idx].u4.color; + dst[vtx_idx].u6.specular = src[vtx_idx].u5.specular; + dst[vtx_idx].u7.tu = src[vtx_idx].u6.tu; + dst[vtx_idx].u8.tv = src[vtx_idx].u7.tv; + } + break; + } - dst->u3.sz /= dst->u4.rhw; - dst->u4.rhw = 1 / dst->u4.rhw; + case D3DPROCESSVERTICES_COPY: + { + const D3DTLVERTEX *src = (D3DTLVERTEX *)((char *)buffer->desc.lpData + vs) + ci->wStart; - src++; - dst++; - } + memcpy(dst, src, ci->dwCount * sizeof(*dst)); + break; + } + + default: + FIXME("Unhandled vertex processing op %#x.\n", op); + break; } - else if (ci->dwFlags == D3DPROCESSVERTICES_COPY) - { - D3DTLVERTEX *src = ((D3DTLVERTEX *)((char *)buffer->desc.lpData + vs)) + ci->wStart; - D3DTLVERTEX *dst = ((D3DTLVERTEX *)buffer->vertex_data) + ci->wDest; - - memcpy(dst, src, ci->dwCount * sizeof(D3DTLVERTEX)); - } else { - ERR("Unhandled vertex processing flag %#x.\n", ci->dwFlags); - } - instr += size; - } - } break; + instr += size; + } + break; + } case D3DOP_TEXTURELOAD: { WARN("TEXTURELOAD-s (%d)\n", count); @@ -468,10 +358,8 @@ goto end_of_buffer; } break; - case D3DOP_BRANCHFORWARD: { - DWORD i; - TRACE("BRANCHFORWARD (%d)\n", count); - + case D3DOP_BRANCHFORWARD: + TRACE("BRANCHFORWARD (%d)\n", count); for (i = 0; i < count; ++i) { D3DBRANCH *ci = (D3DBRANCH *)instr; @@ -497,8 +385,8 @@ } instr += size; - } - } break; + } + break; case D3DOP_SPAN: { WARN("SPAN-s (%d)\n", count); @@ -506,16 +394,14 @@ instr += count * size; } break; - case D3DOP_SETSTATUS: { - DWORD i; - TRACE("SETSTATUS (%d)\n", count); - + case D3DOP_SETSTATUS: + TRACE("SETSTATUS (%d)\n", count); for (i = 0; i < count; ++i) { buffer->data.dsStatus = *(D3DSTATUS *)instr; instr += size; } - } break; + break; default: ERR("Unhandled OpCode %d !!!\n",current->bOpcode); @@ -534,45 +420,24 @@ return CONTAINING_RECORD(iface, struct d3d_execute_buffer, IDirect3DExecuteBuffer_iface); } -/***************************************************************************** - * IDirect3DExecuteBuffer::QueryInterface - * - * Well, a usual QueryInterface function. Don't know fur sure which - * interfaces it can Query. - * - * Params: - * riid: The interface ID queried for - * obj: Address to return the interface pointer at - * - * Returns: - * D3D_OK in case of a success (S_OK? Think it's the same) - * OLE_E_ENUM_NOMORE if the interface wasn't found. - * (E_NOINTERFACE?? Don't know what I really need) - * - *****************************************************************************/ -static HRESULT WINAPI d3d_execute_buffer_QueryInterface(IDirect3DExecuteBuffer *iface, REFIID riid, void **obj) +static HRESULT WINAPI d3d_execute_buffer_QueryInterface(IDirect3DExecuteBuffer *iface, REFIID iid, void **out) { - TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), obj); - - *obj = NULL; + TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out); - if ( IsEqualGUID( &IID_IUnknown, riid ) ) { - IDirect3DExecuteBuffer_AddRef(iface); - *obj = iface; - TRACE(" Creating IUnknown interface at %p.\n", *obj); - return S_OK; - } - if ( IsEqualGUID( &IID_IDirect3DExecuteBuffer, riid ) ) { + if (IsEqualGUID(&IID_IDirect3DExecuteBuffer, iid) + || IsEqualGUID(&IID_IUnknown, iid)) + { IDirect3DExecuteBuffer_AddRef(iface); - *obj = iface; - TRACE(" Creating IDirect3DExecuteBuffer interface %p\n", *obj); - return S_OK; + *out = iface; + return S_OK; } - FIXME("(%p): interface for IID %s NOT found!\n", iface, debugstr_guid(riid)); + + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid)); + + *out = NULL; return E_NOINTERFACE; } - /***************************************************************************** * IDirect3DExecuteBuffer::AddRef * diff -Nru wine1.7-1.7.14/dlls/ddraw/main.c wine1.7-1.7.18/dlls/ddraw/main.c --- wine1.7-1.7.14/dlls/ddraw/main.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/ddraw/main.c 2014-05-02 18:15:48.000000000 +0000 @@ -408,9 +408,9 @@ FIXME("flags 0x%08x not handled\n", flags & ~DDENUM_ATTACHEDSECONDARYDEVICES); TRACE("Enumerating ddraw interfaces\n"); - if (!(wined3d = wined3d_create(7, WINED3D_LEGACY_DEPTH_BIAS))) + if (!(wined3d = wined3d_create(WINED3D_LEGACY_DEPTH_BIAS))) { - if (!(wined3d = wined3d_create(7, WINED3D_LEGACY_DEPTH_BIAS | WINED3D_NO3D))) + if (!(wined3d = wined3d_create(WINED3D_LEGACY_DEPTH_BIAS | WINED3D_NO3D))) { WARN("Failed to create a wined3d object.\n"); return E_FAIL; diff -Nru wine1.7-1.7.14/dlls/ddraw/surface.c wine1.7-1.7.18/dlls/ddraw/surface.c --- wine1.7-1.7.14/dlls/ddraw/surface.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/ddraw/surface.c 2014-05-02 18:15:48.000000000 +0000 @@ -447,6 +447,43 @@ return IUnknown_AddRef(surface->texture_outer); } +static HRESULT ddraw_surface_set_palette(struct ddraw_surface *surface, IDirectDrawPalette *palette) +{ + struct ddraw_palette *palette_impl = unsafe_impl_from_IDirectDrawPalette(palette); + struct ddraw_palette *prev; + + TRACE("iface %p, palette %p.\n", surface, palette); + + if (!(surface->surface_desc.u4.ddpfPixelFormat.dwFlags & (DDPF_PALETTEINDEXED1 | DDPF_PALETTEINDEXED2 + | DDPF_PALETTEINDEXED4 | DDPF_PALETTEINDEXED8 | DDPF_PALETTEINDEXEDTO8))) + return DDERR_INVALIDPIXELFORMAT; + + wined3d_mutex_lock(); + + prev = surface->palette; + if (surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) + { + if (prev) + prev->flags &= ~DDPCAPS_PRIMARYSURFACE; + if (palette_impl) + palette_impl->flags |= DDPCAPS_PRIMARYSURFACE; + /* Update the wined3d frontbuffer if this is the primary. */ + if (surface->ddraw->wined3d_frontbuffer) + wined3d_surface_set_palette(surface->ddraw->wined3d_frontbuffer, + palette_impl ? palette_impl->wineD3DPalette : NULL); + } + if (palette_impl) + IDirectDrawPalette_AddRef(&palette_impl->IDirectDrawPalette_iface); + if (prev) + IDirectDrawPalette_Release(&prev->IDirectDrawPalette_iface); + surface->palette = palette_impl; + wined3d_surface_set_palette(surface->wined3d_surface, palette_impl ? palette_impl->wineD3DPalette : NULL); + + wined3d_mutex_unlock(); + + return DD_OK; +} + static void ddraw_surface_cleanup(struct ddraw_surface *surface) { struct ddraw_surface *surf; @@ -456,7 +493,7 @@ /* The refcount test shows that the palette is detached when the surface * is destroyed. */ - IDirectDrawSurface7_SetPalette(&surface->IDirectDrawSurface7_iface, NULL); + ddraw_surface_set_palette(surface, NULL); /* Loop through all complex attached surfaces and destroy them. * @@ -2246,25 +2283,24 @@ * *****************************************************************************/ static HRESULT WINAPI ddraw_surface7_SetPrivateData(IDirectDrawSurface7 *iface, - REFGUID tag, void *Data, DWORD Size, DWORD Flags) + REFGUID tag, void *data, DWORD size, DWORD flags) { struct ddraw_surface *surface = impl_from_IDirectDrawSurface7(iface); - struct wined3d_resource *resource; HRESULT hr; TRACE("iface %p, tag %s, data %p, data_size %u, flags %#x.\n", - iface, debugstr_guid(tag), Data, Size, Flags); + iface, debugstr_guid(tag), data, size, flags); - wined3d_mutex_lock(); - resource = wined3d_surface_get_resource(surface->wined3d_surface); - hr = wined3d_resource_set_private_data(resource, tag, Data, Size, Flags); - wined3d_mutex_unlock(); - - switch(hr) + if (!data) { - case WINED3DERR_INVALIDCALL: return DDERR_INVALIDPARAMS; - default: return hr; + WARN("data is NULL, returning DDERR_INVALIDPARAMS.\n"); + return DDERR_INVALIDPARAMS; } + + wined3d_mutex_lock(); + hr = wined3d_private_store_set_private_data(&surface->private_store, tag, data, size, flags); + wined3d_mutex_unlock(); + return hr_ddraw_from_wined3d(hr); } static HRESULT WINAPI ddraw_surface4_SetPrivateData(IDirectDrawSurface4 *iface, @@ -2294,23 +2330,45 @@ * For more details, see IWineD3DSurface::GetPrivateData * *****************************************************************************/ -static HRESULT WINAPI ddraw_surface7_GetPrivateData(IDirectDrawSurface7 *iface, REFGUID tag, void *Data, DWORD *Size) +static HRESULT WINAPI ddraw_surface7_GetPrivateData(IDirectDrawSurface7 *iface, REFGUID tag, void *data, DWORD *size) { struct ddraw_surface *surface = impl_from_IDirectDrawSurface7(iface); - struct wined3d_resource *resource; + const struct wined3d_private_data *stored_data; HRESULT hr; TRACE("iface %p, tag %s, data %p, data_size %p.\n", - iface, debugstr_guid(tag), Data, Size); - - if(!Data) - return DDERR_INVALIDPARAMS; + iface, debugstr_guid(tag), data, size); wined3d_mutex_lock(); - resource = wined3d_surface_get_resource(surface->wined3d_surface); - hr = wined3d_resource_get_private_data(resource, tag, Data, Size); - wined3d_mutex_unlock(); + stored_data = wined3d_private_store_get_private_data(&surface->private_store, tag); + if (!stored_data) + { + hr = DDERR_NOTFOUND; + goto done; + } + if (!size) + { + hr = DDERR_INVALIDPARAMS; + goto done; + } + if (*size < stored_data->size) + { + *size = stored_data->size; + hr = DDERR_MOREDATA; + goto done; + } + if (!data) + { + hr = DDERR_INVALIDPARAMS; + goto done; + } + + *size = stored_data->size; + memcpy(data, stored_data->content.data, stored_data->size); + hr = DD_OK; +done: + wined3d_mutex_unlock(); return hr; } @@ -2340,17 +2398,22 @@ static HRESULT WINAPI ddraw_surface7_FreePrivateData(IDirectDrawSurface7 *iface, REFGUID tag) { struct ddraw_surface *surface = impl_from_IDirectDrawSurface7(iface); - struct wined3d_resource *resource; - HRESULT hr; + struct wined3d_private_data *entry; TRACE("iface %p, tag %s.\n", iface, debugstr_guid(tag)); wined3d_mutex_lock(); - resource = wined3d_surface_get_resource(surface->wined3d_surface); - hr = wined3d_resource_free_private_data(resource, tag); + entry = wined3d_private_store_get_private_data(&surface->private_store, tag); + if (!entry) + { + wined3d_mutex_unlock(); + return DDERR_NOTFOUND; + } + + wined3d_private_store_free_private_data(&surface->private_store, entry); wined3d_mutex_unlock(); - return hr; + return DD_OK; } static HRESULT WINAPI ddraw_surface4_FreePrivateData(IDirectDrawSurface4 *iface, REFGUID tag) @@ -4614,42 +4677,13 @@ static HRESULT WINAPI ddraw_surface7_SetPalette(IDirectDrawSurface7 *iface, IDirectDrawPalette *palette) { struct ddraw_surface *surface = impl_from_IDirectDrawSurface7(iface); - struct ddraw_palette *palette_impl = unsafe_impl_from_IDirectDrawPalette(palette); - struct ddraw_palette *prev; TRACE("iface %p, palette %p.\n", iface, palette); - if (!(surface->surface_desc.u4.ddpfPixelFormat.dwFlags & (DDPF_PALETTEINDEXED1 | DDPF_PALETTEINDEXED2 - | DDPF_PALETTEINDEXED4 | DDPF_PALETTEINDEXED8 | DDPF_PALETTEINDEXEDTO8))) - return DDERR_INVALIDPIXELFORMAT; - if (surface->surface_desc.ddsCaps.dwCaps2 & DDSCAPS2_MIPMAPSUBLEVEL) return DDERR_NOTONMIPMAPSUBLEVEL; - wined3d_mutex_lock(); - - prev = surface->palette; - if (surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) - { - if (prev) - prev->flags &= ~DDPCAPS_PRIMARYSURFACE; - if (palette_impl) - palette_impl->flags |= DDPCAPS_PRIMARYSURFACE; - /* Update the wined3d frontbuffer if this is the primary. */ - if (surface->ddraw->wined3d_frontbuffer) - wined3d_surface_set_palette(surface->ddraw->wined3d_frontbuffer, - palette_impl ? palette_impl->wineD3DPalette : NULL); - } - if (palette_impl) - IDirectDrawPalette_AddRef(&palette_impl->IDirectDrawPalette_iface); - if (prev) - IDirectDrawPalette_Release(&prev->IDirectDrawPalette_iface); - surface->palette = palette_impl; - wined3d_surface_set_palette(surface->wined3d_surface, palette_impl ? palette_impl->wineD3DPalette : NULL); - - wined3d_mutex_unlock(); - - return DD_OK; + return ddraw_surface_set_palette(surface, palette); } static HRESULT WINAPI ddraw_surface4_SetPalette(IDirectDrawSurface4 *iface, IDirectDrawPalette *palette) @@ -4658,7 +4692,7 @@ TRACE("iface %p, palette %p.\n", iface, palette); - return ddraw_surface7_SetPalette(&surface->IDirectDrawSurface7_iface, palette); + return ddraw_surface_set_palette(surface, palette); } static HRESULT WINAPI ddraw_surface3_SetPalette(IDirectDrawSurface3 *iface, IDirectDrawPalette *palette) @@ -4667,7 +4701,7 @@ TRACE("iface %p, palette %p.\n", iface, palette); - return ddraw_surface7_SetPalette(&surface->IDirectDrawSurface7_iface, palette); + return ddraw_surface_set_palette(surface, palette); } static HRESULT WINAPI ddraw_surface2_SetPalette(IDirectDrawSurface2 *iface, IDirectDrawPalette *palette) @@ -4676,7 +4710,7 @@ TRACE("iface %p, palette %p.\n", iface, palette); - return ddraw_surface7_SetPalette(&surface->IDirectDrawSurface7_iface, palette); + return ddraw_surface_set_palette(surface, palette); } static HRESULT WINAPI ddraw_surface1_SetPalette(IDirectDrawSurface *iface, IDirectDrawPalette *palette) @@ -4685,7 +4719,7 @@ TRACE("iface %p, palette %p.\n", iface, palette); - return ddraw_surface7_SetPalette(&surface->IDirectDrawSurface7_iface, palette); + return ddraw_surface_set_palette(surface, palette); } /********************************************************** @@ -5469,6 +5503,8 @@ if (surface == surface->ddraw->primary) surface->ddraw->primary = NULL; + wined3d_private_store_cleanup(&surface->private_store); + HeapFree(GetProcessHeap(), 0, surface); } @@ -6074,7 +6110,8 @@ if (desc->dwFlags & DDSD_LPSURFACE) { - if (desc->u1.lPitch < wined3d_surface_get_pitch(wined3d_surface) || desc->u1.lPitch & 3) + if (desc->u1.lPitch < wined3d_calculate_format_pitch(ddraw->wined3d, WINED3DADAPTER_DEFAULT, + wined3d_desc.format, wined3d_desc.width) || desc->u1.lPitch & 3) { WARN("Invalid pitch %u specified.\n", desc->u1.lPitch); return DDERR_INVALIDPARAMS; @@ -6095,5 +6132,7 @@ surface->wined3d_surface = wined3d_surface; *parent_ops = &ddraw_surface_wined3d_parent_ops; + wined3d_private_store_init(&surface->private_store); + return DD_OK; } diff -Nru wine1.7-1.7.14/dlls/ddraw/tests/ddraw1.c wine1.7-1.7.18/dlls/ddraw/tests/ddraw1.c --- wine1.7-1.7.14/dlls/ddraw/tests/ddraw1.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/ddraw/tests/ddraw1.c 2014-05-02 18:15:48.000000000 +0000 @@ -126,7 +126,7 @@ return color; } -static void emit_process_vertices(void **ptr, WORD base_idx, DWORD vertex_count) +static void emit_process_vertices(void **ptr, DWORD flags, WORD base_idx, DWORD vertex_count) { D3DINSTRUCTION *inst = *ptr; D3DPROCESSVERTICES *pv = (D3DPROCESSVERTICES *)(inst + 1); @@ -135,7 +135,7 @@ inst->bSize = sizeof(*pv); inst->wCount = 1; - pv->dwFlags = D3DPROCESSVERTICES_COPY; + pv->dwFlags = flags; pv->wStart = base_idx; pv->wDest = 0; pv->dwCount = vertex_count; @@ -144,6 +144,21 @@ *ptr = pv + 1; } +static void emit_set_ls(void **ptr, D3DLIGHTSTATETYPE state, DWORD value) +{ + D3DINSTRUCTION *inst = *ptr; + D3DSTATE *ls = (D3DSTATE *)(inst + 1); + + inst->bOpcode = D3DOP_STATELIGHT; + inst->bSize = sizeof(*ls); + inst->wCount = 1; + + U1(*ls).dlstLightStateType = state; + U2(*ls).dwArg[0] = value; + + *ptr = ls + 1; +} + static void emit_set_rs(void **ptr, D3DRENDERSTATETYPE state, DWORD value) { D3DINSTRUCTION *inst = *ptr; @@ -361,10 +376,9 @@ IDirect3DViewport_Release(viewport); } -static IDirect3DMaterial *create_diffuse_material(IDirect3DDevice *device, float r, float g, float b, float a) +static IDirect3DMaterial *create_material(IDirect3DDevice *device, D3DMATERIAL *mat) { IDirect3DMaterial *material; - D3DMATERIAL mat; IDirect3D *d3d; HRESULT hr; @@ -372,17 +386,39 @@ ok(SUCCEEDED(hr), "Failed to get d3d interface, hr %#x.\n", hr); hr = IDirect3D_CreateMaterial(d3d, &material, NULL); ok(SUCCEEDED(hr), "Failed to create material, hr %#x.\n", hr); + hr = IDirect3DMaterial_SetMaterial(material, mat); + ok(SUCCEEDED(hr), "Failed to set material data, hr %#x.\n", hr); + IDirect3D_Release(d3d); + + return material; +} + +static IDirect3DMaterial *create_diffuse_material(IDirect3DDevice *device, float r, float g, float b, float a) +{ + D3DMATERIAL mat; + memset(&mat, 0, sizeof(mat)); mat.dwSize = sizeof(mat); U1(U(mat).diffuse).r = r; U2(U(mat).diffuse).g = g; U3(U(mat).diffuse).b = b; U4(U(mat).diffuse).a = a; - hr = IDirect3DMaterial_SetMaterial(material, &mat); - ok(SUCCEEDED(hr), "Failed to set material data, hr %#x.\n", hr); - IDirect3D_Release(d3d); - return material; + return create_material(device, &mat); +} + +static IDirect3DMaterial *create_emissive_material(IDirect3DDevice *device, float r, float g, float b, float a) +{ + D3DMATERIAL mat; + + memset(&mat, 0, sizeof(mat)); + mat.dwSize = sizeof(mat); + U1(U3(mat).emissive).r = r; + U2(U3(mat).emissive).g = g; + U3(U3(mat).emissive).b = b; + U4(U3(mat).emissive).a = a; + + return create_material(device, &mat); } static void destroy_material(IDirect3DMaterial *material) @@ -556,6 +592,21 @@ 0x00000000, 0x00000000, 0x00ff0000, 0x00ffffff, 0x00000000, 0x00000000, 0x00ff0000, 0x00ffffff, }; + /* Nvidia on Windows seems to have an off-by-one error + * when processing source rectangles. Our left = 1 and + * right = 5 input reads from x = {1, 2, 3}. x = 4 is + * read as well, but only for the edge pixels on the + * output image. The bug happens on the y axis as well, + * but we only read one row there, and all source rows + * contain the same data. This bug is not dependent on + * the presence of a clipper. */ + static const D3DCOLOR expected1_broken[] = + { + 0x000000ff, 0x000000ff, 0x00000000, 0x00000000, + 0x000000ff, 0x000000ff, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00ff0000, 0x00ff0000, + 0x00000000, 0x00000000, 0x0000ff00, 0x00ff0000, + }; static const D3DCOLOR expected2[] = { 0x000000ff, 0x000000ff, 0x00000000, 0x00000000, @@ -669,7 +720,8 @@ x = 80 * ((2 * j) + 1); y = 60 * ((2 * i) + 1); color = get_surface_color(dst_surface, x, y); - ok(compare_color(color, expected1[i * 4 + j], 1), + ok(compare_color(color, expected1[i * 4 + j], 1) + || broken(compare_color(color, expected1_broken[i * 4 + j], 1)), "Expected color 0x%08x at %u,%u, got 0x%08x.\n", expected1[i * 4 + j], x, y, color); } } @@ -1073,7 +1125,7 @@ ok(SUCCEEDED(hr), "Failed to lock execute buffer, hr %#x.\n", hr); memcpy(exec_desc.lpData, tquad, sizeof(tquad)); ptr = ((BYTE *)exec_desc.lpData) + sizeof(tquad); - emit_process_vertices(&ptr, 0, 4); + emit_process_vertices(&ptr, D3DPROCESSVERTICES_COPY, 0, 4); emit_set_rs(&ptr, D3DRENDERSTATE_ZENABLE, D3DZB_FALSE); emit_tquad(&ptr, 0); emit_end(&ptr); @@ -1225,7 +1277,7 @@ ok(SUCCEEDED(hr), "Failed to lock execute buffer, hr %#x.\n", hr); memcpy(exec_desc.lpData, tquad, sizeof(tquad)); ptr = ((BYTE *)exec_desc.lpData) + sizeof(tquad); - emit_process_vertices(&ptr, 0, 4); + emit_process_vertices(&ptr, D3DPROCESSVERTICES_COPY, 0, 4); emit_set_rs(&ptr, D3DRENDERSTATE_TEXTUREHANDLE, texture_handle); emit_set_rs(&ptr, D3DRENDERSTATE_SRCBLEND, D3DBLEND_SRCALPHA); emit_set_rs(&ptr, D3DRENDERSTATE_DESTBLEND, D3DBLEND_INVSRCALPHA); @@ -1234,7 +1286,7 @@ emit_tquad(&ptr, 0); emit_end(&ptr); draw1_len = (BYTE *)ptr - (BYTE *)exec_desc.lpData - sizeof(tquad); - emit_process_vertices(&ptr, 4, 4); + emit_process_vertices(&ptr, D3DPROCESSVERTICES_COPY, 4, 4); emit_tquad(&ptr, 0); emit_set_rs(&ptr, D3DRENDERSTATE_TEXTUREHANDLE, 0); emit_end(&ptr); @@ -1388,24 +1440,24 @@ ok(SUCCEEDED(hr), "Failed to lock execute buffer, hr %#x.\n", hr); memcpy(exec_desc.lpData, tquad, sizeof(tquad)); ptr = (BYTE *)exec_desc.lpData + sizeof(tquad); - emit_process_vertices(&ptr, 0, 4); + emit_process_vertices(&ptr, D3DPROCESSVERTICES_COPY, 0, 4); emit_set_rs(&ptr, D3DRENDERSTATE_TEXTUREHANDLE, texture_handle); emit_tquad(&ptr, 0); emit_end(&ptr); draw1_offset = sizeof(tquad); draw1_len = (BYTE *)ptr - (BYTE *)exec_desc.lpData - draw1_offset; - emit_process_vertices(&ptr, 0, 4); + emit_process_vertices(&ptr, D3DPROCESSVERTICES_COPY, 0, 4); emit_set_rs(&ptr, D3DRENDERSTATE_COLORKEYENABLE, FALSE); emit_tquad(&ptr, 0); emit_end(&ptr); draw2_offset = draw1_offset + draw1_len; draw2_len = (BYTE *)ptr - (BYTE *)exec_desc.lpData - draw2_offset; - emit_process_vertices(&ptr, 0, 4); + emit_process_vertices(&ptr, D3DPROCESSVERTICES_COPY, 0, 4); emit_tquad(&ptr, 0); emit_end(&ptr); draw3_offset = draw2_offset + draw2_len; draw3_len = (BYTE *)ptr - (BYTE *)exec_desc.lpData - draw3_offset; - emit_process_vertices(&ptr, 0, 4); + emit_process_vertices(&ptr, D3DPROCESSVERTICES_COPY, 0, 4); emit_set_rs(&ptr, D3DRENDERSTATE_COLORKEYENABLE, TRUE); emit_tquad(&ptr, 0); emit_set_rs(&ptr, D3DRENDERSTATE_TEXTUREHANDLE, 0); @@ -2058,6 +2110,7 @@ HWND window; HRESULT hr; ULONG ref; + MSG msg; static const UINT exclusive_messages[] = { @@ -2114,6 +2167,7 @@ fullscreen_rect.left, fullscreen_rect.top, fullscreen_rect.right, fullscreen_rect.bottom, r.left, r.top, r.right, r.bottom); + PeekMessageA(&msg, 0, 0, 0, PM_NOREMOVE); expect_messages = exclusive_messages; screen_size.cx = 0; screen_size.cy = 0; @@ -2159,6 +2213,7 @@ s.left, s.top, s.right, s.bottom, r.left, r.top, r.right, r.bottom); + PeekMessageA(&msg, 0, 0, 0, PM_NOREMOVE); expect_messages = exclusive_messages; screen_size.cx = 0; screen_size.cy = 0; @@ -2239,6 +2294,7 @@ fullscreen_rect.left, fullscreen_rect.top, fullscreen_rect.right, fullscreen_rect.bottom, r.left, r.top, r.right, r.bottom); + PeekMessageA(&msg, 0, 0, 0, PM_NOREMOVE); expect_messages = normal_messages; screen_size.cx = 0; screen_size.cy = 0; @@ -2289,6 +2345,7 @@ fullscreen_rect.left, fullscreen_rect.top, fullscreen_rect.right, fullscreen_rect.bottom, r.left, r.top, r.right, r.bottom); + PeekMessageA(&msg, 0, 0, 0, PM_NOREMOVE); expect_messages = normal_messages; screen_size.cx = 0; screen_size.cy = 0; @@ -2370,6 +2427,7 @@ fullscreen_rect.left, fullscreen_rect.top, fullscreen_rect.right, fullscreen_rect.bottom, r.left, r.top, r.right, r.bottom); + PeekMessageA(&msg, 0, 0, 0, PM_NOREMOVE); expect_messages = normal_messages; screen_size.cx = 0; screen_size.cy = 0; @@ -2413,6 +2471,7 @@ fullscreen_rect.left, fullscreen_rect.top, fullscreen_rect.right, fullscreen_rect.bottom, r.left, r.top, r.right, r.bottom); + PeekMessageA(&msg, 0, 0, 0, PM_NOREMOVE); expect_messages = normal_messages; screen_size.cx = 0; screen_size.cy = 0; @@ -3964,6 +4023,22 @@ hr = IDirectDrawSurface_SetPalette(primary, palette); ok(SUCCEEDED(hr), "Failed to set palette, hr %#x.\n", hr); + + /* The Windows 8 testbot attaches the palette to the backbuffer as well, + * and is generally somewhat broken with respect to 8 bpp / palette + * handling. */ + if (SUCCEEDED(IDirectDrawSurface_GetPalette(backbuffer, &tmp))) + { + win_skip("Broken palette handling detected, skipping tests.\n"); + IDirectDrawPalette_Release(tmp); + IDirectDrawPalette_Release(palette); + /* The Windows 8 testbot keeps extra references to the primary and + * backbuffer while in 8 bpp mode. */ + hr = IDirectDraw_RestoreDisplayMode(ddraw); + ok(SUCCEEDED(hr), "Failed to restore display mode, hr %#x.\n", hr); + goto done; + } + refcount = get_refcount((IUnknown *)palette); ok(refcount == 2, "Got unexpected refcount %u.\n", refcount); @@ -4004,6 +4079,7 @@ hr = IDirectDrawSurface_GetPalette(primary, &tmp); ok(hr == DDERR_NOPALETTEATTACHED, "Got unexpected hr %#x.\n", hr); +done: refcount = IDirectDrawSurface_Release(backbuffer); ok(refcount == 1, "Got unexpected refcount %u.\n", refcount); refcount = IDirectDrawSurface_Release(primary); @@ -4435,7 +4511,7 @@ DDSD_PITCH, 0x100}, {DDSCAPS_VIDEOMEMORY, DDSD_PITCH, 0x104, DD_OK, DDSD_PITCH, 0x100}, - {DDSCAPS_VIDEOMEMORY, DDSD_PITCH, 0x0fc, DD_OK, + {DDSCAPS_VIDEOMEMORY, DDSD_PITCH, 0x0f8, DD_OK, DDSD_PITCH, 0x100}, {DDSCAPS_VIDEOMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x100, DDERR_INVALIDCAPS, 0, 0 }, @@ -4443,7 +4519,7 @@ DDSD_PITCH, 0x100}, {DDSCAPS_SYSTEMMEMORY, DDSD_PITCH, 0x104, DD_OK, DDSD_PITCH, 0x100}, - {DDSCAPS_SYSTEMMEMORY, DDSD_PITCH, 0x0fc, DD_OK, + {DDSCAPS_SYSTEMMEMORY, DDSD_PITCH, 0x0f8, DD_OK, DDSD_PITCH, 0x100}, {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE, 0, DDERR_INVALIDPARAMS, 0, 0 }, @@ -4459,7 +4535,7 @@ hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); - mem = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, ((64 * 4) + 4) * 64); + mem = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, ((63 * 4) + 8) * 63); for (i = 0; i < sizeof(test_data) / sizeof(*test_data); ++i) { @@ -4467,8 +4543,8 @@ surface_desc.dwSize = sizeof(surface_desc); surface_desc.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT | test_data[i].flags_in; surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | test_data[i].placement; - surface_desc.dwWidth = 64; - surface_desc.dwHeight = 64; + surface_desc.dwWidth = 63; + surface_desc.dwHeight = 63; U1(surface_desc).lPitch = test_data[i].pitch_in; surface_desc.lpSurface = mem; surface_desc.ddpfPixelFormat.dwSize = sizeof(surface_desc.ddpfPixelFormat); @@ -4503,6 +4579,742 @@ DestroyWindow(window); } +static void test_mipmap_lock(void) +{ + IDirectDrawSurface *surface, *surface2; + DDSURFACEDESC surface_desc; + IDirectDraw *ddraw; + ULONG refcount; + HWND window; + HRESULT hr; + DDSCAPS caps = {DDSCAPS_COMPLEX}; + DDCAPS hal_caps; + + window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW, + 0, 0, 640, 480, 0, 0, 0, 0); + ddraw = create_ddraw(); + ok(!!ddraw, "Failed to create a ddraw object.\n"); + hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + + memset(&hal_caps, 0, sizeof(hal_caps)); + hal_caps.dwSize = sizeof(hal_caps); + hr = IDirectDraw_GetCaps(ddraw, &hal_caps, NULL); + ok(SUCCEEDED(hr), "Failed to get caps, hr %#x.\n", hr); + if ((hal_caps.ddsCaps.dwCaps & (DDSCAPS_TEXTURE | DDSCAPS_MIPMAP)) != (DDSCAPS_TEXTURE | DDSCAPS_MIPMAP)) + { + skip("Mipmapped textures not supported, skipping mipmap lock test.\n"); + IDirectDraw_Release(ddraw); + DestroyWindow(window); + return; + } + + memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + surface_desc.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_MIPMAPCOUNT; + surface_desc.dwWidth = 4; + surface_desc.dwHeight = 4; + U2(surface_desc).dwMipMapCount = 2; + surface_desc.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_COMPLEX | DDSCAPS_MIPMAP + | DDSCAPS_SYSTEMMEMORY; + hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &surface, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + hr = IDirectDrawSurface_GetAttachedSurface(surface, &caps, &surface2); + ok(SUCCEEDED(hr), "Failed to get attached surface, hr %#x.\n", hr); + + memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + hr = IDirectDrawSurface_Lock(surface, NULL, &surface_desc, 0, NULL); + ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x.\n", hr); + memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + hr = IDirectDrawSurface_Lock(surface2, NULL, &surface_desc, 0, NULL); + ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x.\n", hr); + IDirectDrawSurface_Unlock(surface2, NULL); + IDirectDrawSurface_Unlock(surface, NULL); + + IDirectDrawSurface_Release(surface2); + IDirectDrawSurface_Release(surface); + refcount = IDirectDraw_Release(ddraw); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + DestroyWindow(window); +} + +static void test_palette_complex(void) +{ + IDirectDrawSurface *surface, *mipmap, *tmp; + DDSURFACEDESC surface_desc; + IDirectDraw *ddraw; + IDirectDrawPalette *palette, *palette2, *palette_mipmap; + ULONG refcount; + HWND window; + HRESULT hr; + DDSCAPS caps = {DDSCAPS_COMPLEX}; + DDCAPS hal_caps; + PALETTEENTRY palette_entries[256]; + unsigned int i; + HDC dc; + RGBQUAD rgbquad; + UINT count; + + window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW, + 0, 0, 640, 480, 0, 0, 0, 0); + ddraw = create_ddraw(); + ok(!!ddraw, "Failed to create a ddraw object.\n"); + hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + + memset(&hal_caps, 0, sizeof(hal_caps)); + hal_caps.dwSize = sizeof(hal_caps); + hr = IDirectDraw_GetCaps(ddraw, &hal_caps, NULL); + ok(SUCCEEDED(hr), "Failed to get caps, hr %#x.\n", hr); + if ((hal_caps.ddsCaps.dwCaps & (DDSCAPS_TEXTURE | DDSCAPS_MIPMAP)) != (DDSCAPS_TEXTURE | DDSCAPS_MIPMAP)) + { + skip("Mipmapped textures not supported, skipping mipmap palette test.\n"); + IDirectDraw_Release(ddraw); + DestroyWindow(window); + return; + } + + 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.dwWidth = 128; + surface_desc.dwHeight = 128; + surface_desc.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_COMPLEX | DDSCAPS_MIPMAP; + surface_desc.ddpfPixelFormat.dwSize = sizeof(surface_desc.ddpfPixelFormat); + surface_desc.ddpfPixelFormat.dwFlags = DDPF_PALETTEINDEXED8 | DDPF_RGB; + U1(surface_desc.ddpfPixelFormat).dwRGBBitCount = 8; + hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &surface, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + + memset(palette_entries, 0, sizeof(palette_entries)); + hr = IDirectDraw_CreatePalette(ddraw, DDPCAPS_8BIT | DDPCAPS_ALLOW256, + palette_entries, &palette, NULL); + ok(SUCCEEDED(hr), "Failed to create palette, hr %#x.\n", hr); + + memset(palette_entries, 0, sizeof(palette_entries)); + palette_entries[1].peRed = 0xff; + palette_entries[1].peGreen = 0x80; + hr = IDirectDraw_CreatePalette(ddraw, DDPCAPS_8BIT | DDPCAPS_ALLOW256, + palette_entries, &palette_mipmap, NULL); + ok(SUCCEEDED(hr), "Failed to create palette, hr %#x.\n", hr); + + palette2 = (void *)0xdeadbeef; + hr = IDirectDrawSurface_GetPalette(surface, &palette2); + ok(hr == DDERR_NOPALETTEATTACHED, "Got unexpected hr %#x.\n", hr); + ok(!palette2, "Got unexpected palette %p.\n", palette2); + hr = IDirectDrawSurface_SetPalette(surface, palette); + ok(SUCCEEDED(hr), "Failed to set palette, hr %#x.\n", hr); + hr = IDirectDrawSurface_GetPalette(surface, &palette2); + ok(SUCCEEDED(hr), "Failed to get palette, hr %#x.\n", hr); + ok(palette == palette2, "Got unexpected palette %p.\n", palette2); + IDirectDrawPalette_Release(palette2); + + mipmap = surface; + IDirectDrawSurface_AddRef(mipmap); + for (i = 0; i < 7; ++i) + { + hr = IDirectDrawSurface_GetAttachedSurface(mipmap, &caps, &tmp); + ok(SUCCEEDED(hr), "Failed to get attached surface, i %u, hr %#x.\n", i, hr); + palette2 = (void *)0xdeadbeef; + hr = IDirectDrawSurface_GetPalette(tmp, &palette2); + ok(hr == DDERR_NOPALETTEATTACHED, "Got unexpected hr %#x, i %u.\n", hr, i); + ok(!palette2, "Got unexpected palette %p, i %u.\n", palette2, i); + + hr = IDirectDrawSurface_SetPalette(tmp, palette_mipmap); + ok(SUCCEEDED(hr), "Failed to set palette, i %u, hr %#x.\n", i, hr); + + hr = IDirectDrawSurface_GetPalette(tmp, &palette2); + ok(SUCCEEDED(hr), "Failed to get palette, i %u, hr %#x.\n", i, hr); + ok(palette_mipmap == palette2, "Got unexpected palette %p.\n", palette2); + IDirectDrawPalette_Release(palette2); + + hr = IDirectDrawSurface_GetDC(tmp, &dc); + ok(SUCCEEDED(hr), "Failed to get DC, i %u, hr %#x.\n", i, hr); + count = GetDIBColorTable(dc, 1, 1, &rgbquad); + ok(count == 1, "Expected count 1, got %u.\n", count); + ok(rgbquad.rgbRed == 0xff, "Expected rgbRed = 0xff, got %#x.\n", rgbquad.rgbRed); + ok(rgbquad.rgbGreen == 0x80, "Expected rgbGreen = 0x80, got %#x.\n", rgbquad.rgbGreen); + ok(rgbquad.rgbBlue == 0x0, "Expected rgbBlue = 0x0, got %#x.\n", rgbquad.rgbBlue); + hr = IDirectDrawSurface_ReleaseDC(tmp, dc); + ok(SUCCEEDED(hr), "Failed to release DC, i %u, hr %#x.\n", i, hr); + + IDirectDrawSurface_Release(mipmap); + mipmap = tmp; + } + + hr = IDirectDrawSurface_GetAttachedSurface(mipmap, &caps, &tmp); + ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#x.\n", hr); + IDirectDrawSurface_Release(mipmap); + refcount = IDirectDrawSurface_Release(surface); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + refcount = IDirectDrawPalette_Release(palette_mipmap); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + refcount = IDirectDrawPalette_Release(palette); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + + refcount = IDirectDraw_Release(ddraw); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + DestroyWindow(window); +} + +static void test_p8_rgb_blit(void) +{ + IDirectDrawSurface *src, *dst; + DDSURFACEDESC surface_desc; + IDirectDraw *ddraw; + IDirectDrawPalette *palette; + ULONG refcount; + HWND window; + HRESULT hr; + PALETTEENTRY palette_entries[256]; + unsigned int x; + static const BYTE src_data[] = {0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0xff, 0x80}; + static const D3DCOLOR expected[] = + { + 0x00000000, 0x00010101, 0x00020202, 0x00030303, + 0x00040404, 0x00050505, 0x00ffffff, 0x00808080, + }; + D3DCOLOR color; + + 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(palette_entries, 0, sizeof(palette_entries)); + palette_entries[0].peRed = 0xff; + palette_entries[1].peGreen = 0xff; + palette_entries[2].peBlue = 0xff; + palette_entries[3].peFlags = 0xff; + hr = IDirectDraw_CreatePalette(ddraw, DDPCAPS_8BIT | DDPCAPS_ALLOW256, + palette_entries, &palette, NULL); + ok(SUCCEEDED(hr), "Failed to create palette, 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; + surface_desc.dwWidth = 8; + surface_desc.dwHeight = 1; + surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; + surface_desc.ddpfPixelFormat.dwSize = sizeof(surface_desc.ddpfPixelFormat); + surface_desc.ddpfPixelFormat.dwFlags = DDPF_PALETTEINDEXED8 | DDPF_RGB; + U1(surface_desc.ddpfPixelFormat).dwRGBBitCount = 8; + hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &src, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, 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; + surface_desc.dwWidth = 8; + surface_desc.dwHeight = 1; + surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; + surface_desc.ddpfPixelFormat.dwSize = sizeof(surface_desc.ddpfPixelFormat); + surface_desc.ddpfPixelFormat.dwFlags = DDPF_RGB | DDPF_ALPHAPIXELS; + 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 = 0xff000000; + hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &dst, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + + memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + hr = IDirectDrawSurface_Lock(src, NULL, &surface_desc, 0, NULL); + ok(SUCCEEDED(hr), "Failed to lock source surface, hr %#x.\n", hr); + memcpy(surface_desc.lpSurface, src_data, sizeof(src_data)); + hr = IDirectDrawSurface_Unlock(src, NULL); + ok(SUCCEEDED(hr), "Failed to unlock source surface, hr %#x.\n", hr); + + hr = IDirectDrawSurface_SetPalette(src, palette); + ok(SUCCEEDED(hr), "Failed to set palette, hr %#x.\n", hr); + hr = IDirectDrawSurface_Blt(dst, NULL, src, NULL, DDBLT_WAIT, NULL); + /* The r500 Windows 7 driver returns E_NOTIMPL. r200 on Windows XP works. + * The Geforce 7 driver on Windows Vista returns E_FAIL. Newer Nvidia GPUs work. */ + ok(SUCCEEDED(hr) || broken(hr == E_NOTIMPL) || broken(hr == E_FAIL), + "Failed to blit, hr %#x.\n", hr); + + if (SUCCEEDED(hr)) + { + for (x = 0; x < sizeof(expected) / sizeof(*expected); x++) + { + color = get_surface_color(dst, x, 0); + todo_wine ok(compare_color(color, expected[x], 0), + "Pixel %u: Got color %#x, expected %#x.\n", + x, color, expected[x]); + } + } + + IDirectDrawSurface_Release(src); + IDirectDrawSurface_Release(dst); + IDirectDrawPalette_Release(palette); + + refcount = IDirectDraw_Release(ddraw); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + DestroyWindow(window); +} + +static void test_material(void) +{ + IDirect3DExecuteBuffer *execute_buffer; + D3DMATERIALHANDLE mat_handle, tmp; + D3DEXECUTEBUFFERDESC exec_desc; + IDirect3DMaterial *material; + IDirect3DViewport *viewport; + IDirect3DDevice *device; + IDirectDrawSurface *rt; + IDirectDraw *ddraw; + UINT inst_length; + D3DCOLOR color; + ULONG refcount; + unsigned int i; + HWND window; + HRESULT hr; + BOOL valid; + void *ptr; + + static D3DVERTEX quad[] = + { + {{-1.0f}, {-1.0f}, {0.0f}, {1.0f}, {0.0f}, {0.0f}}, + {{-1.0f}, { 1.0f}, {0.0f}, {1.0f}, {0.0f}, {0.0f}}, + {{ 1.0f}, {-1.0f}, {0.0f}, {1.0f}, {0.0f}, {0.0f}}, + {{ 1.0f}, { 1.0f}, {0.0f}, {1.0f}, {0.0f}, {0.0f}}, + }; + static const struct + { + BOOL material; + D3DCOLOR expected_color; + } + test_data[] = + { + {TRUE, 0x0000ff00}, + {FALSE, 0x00ffffff}, + }; + static D3DRECT clear_rect = {{0}, {0}, {640}, {480}}; + + 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); + return; + } + + hr = IDirect3DDevice_QueryInterface(device, &IID_IDirectDrawSurface, (void **)&rt); + ok(SUCCEEDED(hr), "Failed to get render target, hr %#x.\n", hr); + + material = create_diffuse_material(device, 0.0f, 0.0f, 1.0f, 1.0f); + viewport = create_viewport(device, 0, 0, 640, 480); + viewport_set_background(device, viewport, material); + + destroy_material(material); + material = create_emissive_material(device, 0.0f, 1.0f, 0.0f, 0.0f); + hr = IDirect3DMaterial_GetHandle(material, device, &mat_handle); + ok(SUCCEEDED(hr), "Failed to get material handle, hr %#x.\n", hr); + + 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); + + for (i = 0; i < sizeof(test_data) / sizeof(*test_data); ++i) + { + 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_set_ls(&ptr, D3DLIGHTSTATE_MATERIAL, test_data[i].material ? mat_handle : 0); + emit_process_vertices(&ptr, D3DPROCESSVERTICES_TRANSFORMLIGHT, 0, 4); + emit_tquad(&ptr, 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); + + hr = IDirect3DViewport_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER); + ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#x.\n", hr); + + hr = IDirect3DDevice_BeginScene(device); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + set_execute_data(execute_buffer, 4, sizeof(quad), inst_length); + hr = IDirect3DDevice_Execute(device, execute_buffer, viewport, D3DEXECUTE_CLIPPED); + ok(SUCCEEDED(hr), "Failed to execute exec buffer, hr %#x.\n", hr); + hr = IDirect3DDevice_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + color = get_surface_color(rt, 320, 240); + if (test_data[i].material) + todo_wine ok(compare_color(color, test_data[i].expected_color, 1) + /* The Windows 8 testbot appears to return undefined results. */ + || broken(TRUE), + "Got unexpected color 0x%08x, test %u.\n", color, i); + else + ok(compare_color(color, test_data[i].expected_color, 1), + "Got unexpected color 0x%08x, test %u.\n", color, i); + } + + destroy_material(material); + material = create_diffuse_material(device, 1.0f, 0.0f, 0.0f, 1.0f); + hr = IDirect3DMaterial_GetHandle(material, device, &mat_handle); + ok(SUCCEEDED(hr), "Failed to get material handle, hr %#x.\n", hr); + + hr = IDirect3DViewport_SetBackground(viewport, mat_handle); + ok(SUCCEEDED(hr), "Failed to set viewport background, hr %#x.\n", hr); + hr = IDirect3DViewport_GetBackground(viewport, &tmp, &valid); + ok(SUCCEEDED(hr), "Failed to get viewport background, hr %#x.\n", hr); + ok(tmp == mat_handle, "Got unexpected material handle %#x, expected %#x.\n", tmp, mat_handle); + ok(valid, "Got unexpected valid %#x.\n", valid); + hr = IDirect3DViewport_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET); + ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#x.\n", hr); + color = get_surface_color(rt, 320, 240); + ok(compare_color(color, 0x00ff0000, 1), "Got unexpected color 0x%08x.\n", color); + + hr = IDirect3DViewport_SetBackground(viewport, 0); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DViewport_GetBackground(viewport, &tmp, &valid); + ok(SUCCEEDED(hr), "Failed to get viewport background, hr %#x.\n", hr); + ok(tmp == mat_handle, "Got unexpected material handle %#x, expected %#x.\n", tmp, mat_handle); + ok(valid, "Got unexpected valid %#x.\n", valid); + hr = IDirect3DViewport_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET); + ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#x.\n", hr); + color = get_surface_color(rt, 320, 240); + ok(compare_color(color, 0x00ff0000, 1), "Got unexpected color 0x%08x.\n", color); + + destroy_viewport(device, viewport); + viewport = create_viewport(device, 0, 0, 640, 480); + + hr = IDirect3DViewport_GetBackground(viewport, &tmp, &valid); + ok(SUCCEEDED(hr), "Failed to get viewport background, hr %#x.\n", hr); + ok(!tmp, "Got unexpected material handle %#x.\n", tmp); + ok(!valid, "Got unexpected valid %#x.\n", valid); + hr = IDirect3DViewport_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET); + ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#x.\n", hr); + color = get_surface_color(rt, 320, 240); + ok(compare_color(color, 0x00000000, 1), "Got unexpected color 0x%08x.\n", color); + + IDirect3DExecuteBuffer_Release(execute_buffer); + destroy_viewport(device, viewport); + destroy_material(material); + IDirectDrawSurface_Release(rt); + refcount = IDirect3DDevice_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + refcount = IDirectDraw_Release(ddraw); + ok(!refcount, "Ddraw object has %u references left.\n", refcount); + DestroyWindow(window); +} + +static void test_palette_gdi(void) +{ + IDirectDrawSurface *surface, *primary; + DDSURFACEDESC surface_desc; + IDirectDraw *ddraw; + IDirectDrawPalette *palette, *palette2; + ULONG refcount; + HWND window; + HRESULT hr; + PALETTEENTRY palette_entries[256]; + UINT i; + HDC dc; + /* On the Windows 8 testbot palette index 0 of the onscreen palette is forced to + * r = 0, g = 0, b = 0. Do not attempt to set it to something else as this is + * not the point of this test. */ + static const RGBQUAD expected1[] = + { + {0x00, 0x00, 0x00, 0x00}, {0x00, 0x00, 0x01, 0x00}, {0x00, 0x02, 0x00, 0x00}, + {0x03, 0x00, 0x00, 0x00}, {0x15, 0x14, 0x13, 0x00}, + }; + static const RGBQUAD expected2[] = + { + {0x00, 0x00, 0x00, 0x00}, {0x00, 0x00, 0x01, 0x00}, {0x00, 0x02, 0x00, 0x00}, + {0x03, 0x00, 0x00, 0x00}, {0x25, 0x24, 0x23, 0x00}, + }; + static const RGBQUAD expected3[] = + { + {0x00, 0x00, 0x00, 0x00}, {0x40, 0x00, 0x00, 0x00}, {0x00, 0x00, 0x40, 0x00}, + {0x00, 0x40, 0x00, 0x00}, {0x56, 0x34, 0x12, 0x00}, + }; + HPALETTE ddraw_palette_handle; + /* Similar to index 0, index 255 is r = 0xff, g = 0xff, b = 0xff on the Win8 VMs. */ + RGBQUAD rgbquad[255]; + static const RGBQUAD rgb_zero = {0, 0, 0, 0}; + + 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; + surface_desc.dwWidth = 16; + surface_desc.dwHeight = 16; + surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; + surface_desc.ddpfPixelFormat.dwSize = sizeof(surface_desc.ddpfPixelFormat); + surface_desc.ddpfPixelFormat.dwFlags = DDPF_PALETTEINDEXED8 | DDPF_RGB; + U1(surface_desc.ddpfPixelFormat).dwRGBBitCount = 8; + hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &surface, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + + /* Avoid colors from the Windows default palette. */ + memset(palette_entries, 0, sizeof(palette_entries)); + palette_entries[1].peRed = 0x01; + palette_entries[2].peGreen = 0x02; + palette_entries[3].peBlue = 0x03; + palette_entries[4].peRed = 0x13; + palette_entries[4].peGreen = 0x14; + palette_entries[4].peBlue = 0x15; + hr = IDirectDraw_CreatePalette(ddraw, DDPCAPS_8BIT | DDPCAPS_ALLOW256, + palette_entries, &palette, NULL); + ok(SUCCEEDED(hr), "Failed to create palette, hr %#x.\n", hr); + + /* If there is no palette assigned and the display mode is not 8 bpp, some + * drivers refuse to create a DC while others allow it. If a DC is created, + * the DIB color table is uninitialized and contains random colors. No error + * is generated when trying to read pixels and random garbage is returned. + * + * The most likely explanation is that if the driver creates a DC, it (or + * the higher-level runtime) uses GetSystemPaletteEntries to find the + * palette, but GetSystemPaletteEntries fails when bpp > 8 and the palette + * contains uninitialized garbage. See comments below for the P8 case. */ + + hr = IDirectDrawSurface_SetPalette(surface, palette); + ok(SUCCEEDED(hr), "Failed to set palette, hr %#x.\n", hr); + hr = IDirectDrawSurface_GetDC(surface, &dc); + ok(SUCCEEDED(hr), "Failed to get DC, hr %#x.\n", hr); + ddraw_palette_handle = SelectPalette(dc, GetStockObject(DEFAULT_PALETTE), FALSE); + ok(ddraw_palette_handle == GetStockObject(DEFAULT_PALETTE), + "Got unexpected palette %p, expected %p.\n", + ddraw_palette_handle, GetStockObject(DEFAULT_PALETTE)); + + i = GetDIBColorTable(dc, 0, sizeof(rgbquad) / sizeof(*rgbquad), rgbquad); + ok(i == sizeof(rgbquad) / sizeof(*rgbquad), "Expected count 255, got %u.\n", i); + for (i = 0; i < sizeof(expected1) / sizeof(*expected1); i++) + { + ok(!memcmp(&rgbquad[i], &expected1[i], sizeof(rgbquad[i])), + "Got color table entry %u r=%#x g=%#x b=%#x, expected r=%#x g=%#x b=%#x.\n", + i, rgbquad[i].rgbRed, rgbquad[i].rgbGreen, rgbquad[i].rgbBlue, + expected1[i].rgbRed, expected1[i].rgbGreen, expected1[i].rgbBlue); + } + for (; i < sizeof(rgbquad) / sizeof(*rgbquad); i++) + { + ok(!memcmp(&rgbquad[i], &rgb_zero, sizeof(rgbquad[i])), + "Got color table entry %u r=%#x g=%#x b=%#x, expected r=0 g=0 b=0.\n", + i, rgbquad[i].rgbRed, rgbquad[i].rgbGreen, rgbquad[i].rgbBlue); + } + + /* Update the palette while the DC is in use. This does not modify the DC. */ + palette_entries[4].peRed = 0x23; + palette_entries[4].peGreen = 0x24; + palette_entries[4].peBlue = 0x25; + hr = IDirectDrawPalette_SetEntries(palette, 0, 4, 1, &palette_entries[4]); + ok(SUCCEEDED(hr), "Failed to set palette entries, hr %#x.\n", hr); + + i = GetDIBColorTable(dc, 4, 1, &rgbquad[4]); + ok(i == 1, "Expected count 1, got %u.\n", i); + todo_wine ok(!memcmp(&rgbquad[4], &expected1[4], sizeof(rgbquad[4])), + "Got color table entry %u r=%#x g=%#x b=%#x, expected r=%#x g=%#x b=%#x.\n", + i, rgbquad[4].rgbRed, rgbquad[4].rgbGreen, rgbquad[4].rgbBlue, + expected1[4].rgbRed, expected1[4].rgbGreen, expected1[4].rgbBlue); + + /* Neither does re-setting the palette. */ + hr = IDirectDrawSurface_SetPalette(surface, NULL); + ok(SUCCEEDED(hr), "Failed to set palette, hr %#x.\n", hr); + hr = IDirectDrawSurface_SetPalette(surface, palette); + ok(SUCCEEDED(hr), "Failed to set palette, hr %#x.\n", hr); + + i = GetDIBColorTable(dc, 4, 1, &rgbquad[4]); + ok(i == 1, "Expected count 1, got %u.\n", i); + todo_wine ok(!memcmp(&rgbquad[4], &expected1[4], sizeof(rgbquad[4])), + "Got color table entry %u r=%#x g=%#x b=%#x, expected r=%#x g=%#x b=%#x.\n", + i, rgbquad[4].rgbRed, rgbquad[4].rgbGreen, rgbquad[4].rgbBlue, + expected1[4].rgbRed, expected1[4].rgbGreen, expected1[4].rgbBlue); + + hr = IDirectDrawSurface_ReleaseDC(surface, dc); + ok(SUCCEEDED(hr), "Failed to release DC, hr %#x.\n", hr); + + /* Refresh the DC. This updates the palette. */ + hr = IDirectDrawSurface_GetDC(surface, &dc); + ok(SUCCEEDED(hr), "Failed to get DC, hr %#x.\n", hr); + i = GetDIBColorTable(dc, 0, sizeof(rgbquad) / sizeof(*rgbquad), rgbquad); + ok(i == sizeof(rgbquad) / sizeof(*rgbquad), "Expected count 255, got %u.\n", i); + for (i = 0; i < sizeof(expected2) / sizeof(*expected2); i++) + { + ok(!memcmp(&rgbquad[i], &expected2[i], sizeof(rgbquad[i])), + "Got color table entry %u r=%#x g=%#x b=%#x, expected r=%#x g=%#x b=%#x.\n", + i, rgbquad[i].rgbRed, rgbquad[i].rgbGreen, rgbquad[i].rgbBlue, + expected2[i].rgbRed, expected2[i].rgbGreen, expected2[i].rgbBlue); + } + for (; i < sizeof(rgbquad) / sizeof(*rgbquad); i++) + { + ok(!memcmp(&rgbquad[i], &rgb_zero, sizeof(rgbquad[i])), + "Got color table entry %u r=%#x g=%#x b=%#x, expected r=0 g=0 b=0.\n", + i, rgbquad[i].rgbRed, rgbquad[i].rgbGreen, rgbquad[i].rgbBlue); + } + hr = IDirectDrawSurface_ReleaseDC(surface, dc); + ok(SUCCEEDED(hr), "Failed to release DC, hr %#x.\n", hr); + + refcount = IDirectDrawSurface_Release(surface); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + + if (FAILED(hr = IDirectDraw_SetDisplayMode(ddraw, 640, 480, 8))) + { + win_skip("Failed to set 8 bpp display mode, skipping test.\n"); + IDirectDrawPalette_Release(palette); + IDirectDraw_Release(ddraw); + DestroyWindow(window); + return; + } + ok(SUCCEEDED(hr), "Failed to set display mode, hr %#x.\n", hr); + hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_FULLSCREEN | DDSCL_EXCLUSIVE); + 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; + surface_desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; + hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &primary, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + + hr = IDirectDrawSurface_SetPalette(primary, palette); + ok(SUCCEEDED(hr), "Failed to set palette, hr %#x.\n", hr); + hr = IDirectDrawSurface_GetDC(primary, &dc); + ok(SUCCEEDED(hr), "Failed to get DC, hr %#x.\n", hr); + ddraw_palette_handle = SelectPalette(dc, GetStockObject(DEFAULT_PALETTE), FALSE); + /* Windows 2000 on the testbot assigns a different palette to the primary. Refrast? */ + ok(ddraw_palette_handle == GetStockObject(DEFAULT_PALETTE) || broken(TRUE), + "Got unexpected palette %p, expected %p.\n", + ddraw_palette_handle, GetStockObject(DEFAULT_PALETTE)); + SelectPalette(dc, ddraw_palette_handle, FALSE); + + /* The primary uses the system palette. In exclusive mode, the system palette matches + * the ddraw palette attached to the primary, so the result is what you would expect + * from a regular surface. Tests for the interaction between the ddraw palette and + * the system palette are not included pending an application that depends on this. + * The relation between those causes problems on Windows Vista and newer for games + * like Age of Empires or Starcraft. Don't emulate it without a real need. */ + i = GetDIBColorTable(dc, 0, sizeof(rgbquad) / sizeof(*rgbquad), rgbquad); + ok(i == sizeof(rgbquad) / sizeof(*rgbquad), "Expected count 255, got %u.\n", i); + for (i = 0; i < sizeof(expected2) / sizeof(*expected2); i++) + { + ok(!memcmp(&rgbquad[i], &expected2[i], sizeof(rgbquad[i])), + "Got color table entry %u r=%#x g=%#x b=%#x, expected r=%#x g=%#x b=%#x.\n", + i, rgbquad[i].rgbRed, rgbquad[i].rgbGreen, rgbquad[i].rgbBlue, + expected2[i].rgbRed, expected2[i].rgbGreen, expected2[i].rgbBlue); + } + for (; i < sizeof(rgbquad) / sizeof(*rgbquad); i++) + { + ok(!memcmp(&rgbquad[i], &rgb_zero, sizeof(rgbquad[i])), + "Got color table entry %u r=%#x g=%#x b=%#x, expected r=0 g=0 b=0.\n", + i, rgbquad[i].rgbRed, rgbquad[i].rgbGreen, rgbquad[i].rgbBlue); + } + hr = IDirectDrawSurface_ReleaseDC(primary, dc); + ok(SUCCEEDED(hr), "Failed to release DC, 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; + surface_desc.dwWidth = 16; + surface_desc.dwHeight = 16; + surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; + hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &surface, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + + /* Here the offscreen surface appears to use the primary's palette, + * but in all likelyhood it is actually the system palette. */ + hr = IDirectDrawSurface_GetDC(surface, &dc); + ok(SUCCEEDED(hr), "Failed to get DC, hr %#x.\n", hr); + i = GetDIBColorTable(dc, 0, sizeof(rgbquad) / sizeof(*rgbquad), rgbquad); + ok(i == sizeof(rgbquad) / sizeof(*rgbquad), "Expected count 255, got %u.\n", i); + for (i = 0; i < sizeof(expected2) / sizeof(*expected2); i++) + { + ok(!memcmp(&rgbquad[i], &expected2[i], sizeof(rgbquad[i])), + "Got color table entry %u r=%#x g=%#x b=%#x, expected r=%#x g=%#x b=%#x.\n", + i, rgbquad[i].rgbRed, rgbquad[i].rgbGreen, rgbquad[i].rgbBlue, + expected2[i].rgbRed, expected2[i].rgbGreen, expected2[i].rgbBlue); + } + for (; i < sizeof(rgbquad) / sizeof(*rgbquad); i++) + { + ok(!memcmp(&rgbquad[i], &rgb_zero, sizeof(rgbquad[i])), + "Got color table entry %u r=%#x g=%#x b=%#x, expected r=0 g=0 b=0.\n", + i, rgbquad[i].rgbRed, rgbquad[i].rgbGreen, rgbquad[i].rgbBlue); + } + hr = IDirectDrawSurface_ReleaseDC(surface, dc); + ok(SUCCEEDED(hr), "Failed to release DC, hr %#x.\n", hr); + + /* On real hardware a change to the primary surface's palette applies immediately, + * even on device contexts from offscreen surfaces that do not have their own + * palette. On the testbot VMs this is not the case. Don't test this until we + * know of an application that depends on this. */ + + memset(palette_entries, 0, sizeof(palette_entries)); + palette_entries[1].peBlue = 0x40; + palette_entries[2].peRed = 0x40; + palette_entries[3].peGreen = 0x40; + palette_entries[4].peRed = 0x12; + palette_entries[4].peGreen = 0x34; + palette_entries[4].peBlue = 0x56; + hr = IDirectDraw_CreatePalette(ddraw, DDPCAPS_8BIT | DDPCAPS_ALLOW256, + palette_entries, &palette2, NULL); + ok(SUCCEEDED(hr), "Failed to create palette, hr %#x.\n", hr); + hr = IDirectDrawSurface_SetPalette(surface, palette2); + ok(SUCCEEDED(hr), "Failed to set palette, hr %#x.\n", hr); + + /* A palette assigned to the offscreen surface overrides the primary / system + * palette. */ + hr = IDirectDrawSurface_GetDC(surface, &dc); + ok(SUCCEEDED(hr), "Failed to get DC, hr %#x.\n", hr); + i = GetDIBColorTable(dc, 0, sizeof(rgbquad) / sizeof(*rgbquad), rgbquad); + ok(i == sizeof(rgbquad) / sizeof(*rgbquad), "Expected count 255, got %u.\n", i); + for (i = 0; i < sizeof(expected3) / sizeof(*expected3); i++) + { + ok(!memcmp(&rgbquad[i], &expected3[i], sizeof(rgbquad[i])), + "Got color table entry %u r=%#x g=%#x b=%#x, expected r=%#x g=%#x b=%#x.\n", + i, rgbquad[i].rgbRed, rgbquad[i].rgbGreen, rgbquad[i].rgbBlue, + expected3[i].rgbRed, expected3[i].rgbGreen, expected3[i].rgbBlue); + } + for (; i < sizeof(rgbquad) / sizeof(*rgbquad); i++) + { + ok(!memcmp(&rgbquad[i], &rgb_zero, sizeof(rgbquad[i])), + "Got color table entry %u r=%#x g=%#x b=%#x, expected r=0 g=0 b=0.\n", + i, rgbquad[i].rgbRed, rgbquad[i].rgbGreen, rgbquad[i].rgbBlue); + } + hr = IDirectDrawSurface_ReleaseDC(surface, dc); + ok(SUCCEEDED(hr), "Failed to release DC, hr %#x.\n", hr); + + refcount = IDirectDrawSurface_Release(surface); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + + /* The Windows 8 testbot keeps extra references to the primary and + * backbuffer while in 8 bpp mode. */ + hr = IDirectDraw_RestoreDisplayMode(ddraw); + ok(SUCCEEDED(hr), "Failed to restore display mode, hr %#x.\n", hr); + + refcount = IDirectDrawSurface_Release(primary); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + refcount = IDirectDrawPalette_Release(palette2); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + refcount = IDirectDrawPalette_Release(palette); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + refcount = IDirectDraw_Release(ddraw); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + DestroyWindow(window); +} + START_TEST(ddraw1) { IDirectDraw *ddraw; @@ -4547,4 +5359,9 @@ test_surface_attachment(); test_pixel_format(); test_create_surface_pitch(); + test_mipmap_lock(); + test_palette_complex(); + test_p8_rgb_blit(); + test_material(); + test_palette_gdi(); } diff -Nru wine1.7-1.7.14/dlls/ddraw/tests/ddraw2.c wine1.7-1.7.18/dlls/ddraw/tests/ddraw2.c --- wine1.7-1.7.14/dlls/ddraw/tests/ddraw2.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/ddraw/tests/ddraw2.c 2014-05-02 18:15:48.000000000 +0000 @@ -309,10 +309,9 @@ IDirect3DViewport2_Release(viewport); } -static IDirect3DMaterial2 *create_diffuse_material(IDirect3DDevice2 *device, float r, float g, float b, float a) +static IDirect3DMaterial2 *create_material(IDirect3DDevice2 *device, D3DMATERIAL *mat) { IDirect3DMaterial2 *material; - D3DMATERIAL mat; IDirect3D2 *d3d; HRESULT hr; @@ -320,17 +319,39 @@ ok(SUCCEEDED(hr), "Failed to get d3d interface, hr %#x.\n", hr); hr = IDirect3D2_CreateMaterial(d3d, &material, NULL); ok(SUCCEEDED(hr), "Failed to create material, hr %#x.\n", hr); + hr = IDirect3DMaterial2_SetMaterial(material, mat); + ok(SUCCEEDED(hr), "Failed to set material data, hr %#x.\n", hr); + IDirect3D2_Release(d3d); + + return material; +} + +static IDirect3DMaterial2 *create_diffuse_material(IDirect3DDevice2 *device, float r, float g, float b, float a) +{ + D3DMATERIAL mat; + memset(&mat, 0, sizeof(mat)); mat.dwSize = sizeof(mat); U1(U(mat).diffuse).r = r; U2(U(mat).diffuse).g = g; U3(U(mat).diffuse).b = b; U4(U(mat).diffuse).a = a; - hr = IDirect3DMaterial2_SetMaterial(material, &mat); - ok(SUCCEEDED(hr), "Failed to set material data, hr %#x.\n", hr); - IDirect3D2_Release(d3d); - return material; + return create_material(device, &mat); +} + +static IDirect3DMaterial2 *create_emissive_material(IDirect3DDevice2 *device, float r, float g, float b, float a) +{ + D3DMATERIAL mat; + + memset(&mat, 0, sizeof(mat)); + mat.dwSize = sizeof(mat); + U1(U3(mat).emissive).r = r; + U2(U3(mat).emissive).g = g; + U3(U3(mat).emissive).b = b; + U4(U3(mat).emissive).a = a; + + return create_material(device, &mat); } static void destroy_material(IDirect3DMaterial2 *material) @@ -504,6 +525,21 @@ 0x00000000, 0x00000000, 0x00ff0000, 0x00ffffff, 0x00000000, 0x00000000, 0x00ff0000, 0x00ffffff, }; + /* Nvidia on Windows seems to have an off-by-one error + * when processing source rectangles. Our left = 1 and + * right = 5 input reads from x = {1, 2, 3}. x = 4 is + * read as well, but only for the edge pixels on the + * output image. The bug happens on the y axis as well, + * but we only read one row there, and all source rows + * contain the same data. This bug is not dependent on + * the presence of a clipper. */ + static const D3DCOLOR expected1_broken[] = + { + 0x000000ff, 0x000000ff, 0x00000000, 0x00000000, + 0x000000ff, 0x000000ff, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00ff0000, 0x00ff0000, + 0x00000000, 0x00000000, 0x0000ff00, 0x00ff0000, + }; static const D3DCOLOR expected2[] = { 0x000000ff, 0x000000ff, 0x00000000, 0x00000000, @@ -617,7 +653,8 @@ x = 80 * ((2 * j) + 1); y = 60 * ((2 * i) + 1); color = get_surface_color(dst_surface, x, y); - ok(compare_color(color, expected1[i * 4 + j], 1), + ok(compare_color(color, expected1[i * 4 + j], 1) + || broken(compare_color(color, expected1_broken[i * 4 + j], 1)), "Expected color 0x%08x at %u,%u, got 0x%08x.\n", expected1[i * 4 + j], x, y, color); } } @@ -2272,6 +2309,7 @@ HWND window, window2; HRESULT hr; ULONG ref; + MSG msg; static const UINT exclusive_messages[] = { @@ -2333,6 +2371,7 @@ fullscreen_rect.left, fullscreen_rect.top, fullscreen_rect.right, fullscreen_rect.bottom, r.left, r.top, r.right, r.bottom); + PeekMessageA(&msg, 0, 0, 0, PM_NOREMOVE); expect_messages = exclusive_messages; screen_size.cx = 0; screen_size.cy = 0; @@ -2378,6 +2417,7 @@ s.left, s.top, s.right, s.bottom, r.left, r.top, r.right, r.bottom); + PeekMessageA(&msg, 0, 0, 0, PM_NOREMOVE); expect_messages = exclusive_messages; screen_size.cx = 0; screen_size.cy = 0; @@ -2458,6 +2498,7 @@ fullscreen_rect.left, fullscreen_rect.top, fullscreen_rect.right, fullscreen_rect.bottom, r.left, r.top, r.right, r.bottom); + PeekMessageA(&msg, 0, 0, 0, PM_NOREMOVE); expect_messages = normal_messages; screen_size.cx = 0; screen_size.cy = 0; @@ -2508,6 +2549,7 @@ fullscreen_rect.left, fullscreen_rect.top, fullscreen_rect.right, fullscreen_rect.bottom, r.left, r.top, r.right, r.bottom); + PeekMessageA(&msg, 0, 0, 0, PM_NOREMOVE); expect_messages = normal_messages; screen_size.cx = 0; screen_size.cy = 0; @@ -2589,6 +2631,7 @@ fullscreen_rect.left, fullscreen_rect.top, fullscreen_rect.right, fullscreen_rect.bottom, r.left, r.top, r.right, r.bottom); + PeekMessageA(&msg, 0, 0, 0, PM_NOREMOVE); expect_messages = normal_messages; screen_size.cx = 0; screen_size.cy = 0; @@ -2632,6 +2675,7 @@ fullscreen_rect.left, fullscreen_rect.top, fullscreen_rect.right, fullscreen_rect.bottom, r.left, r.top, r.right, r.bottom); + PeekMessageA(&msg, 0, 0, 0, PM_NOREMOVE); expect_messages = normal_messages; screen_size.cx = 0; screen_size.cy = 0; @@ -2682,6 +2726,7 @@ hr = set_display_mode(ddraw, 640, 480); ok(SUCCEEDED(hr), "Failed to set display mode, hr %#x.\n", hr); + PeekMessageA(&msg, 0, 0, 0, PM_NOREMOVE); expect_messages = exclusive_messages; screen_size.cx = 0; screen_size.cy = 0; @@ -2748,6 +2793,7 @@ hr = set_display_mode(ddraw, 640, 480); ok(SUCCEEDED(hr), "Failed to set display mode, hr %#x.\n", hr); + PeekMessageA(&msg, 0, 0, 0, PM_NOREMOVE); expect_messages = exclusive_messages; screen_size.cx = 0; screen_size.cy = 0; @@ -3274,12 +3320,10 @@ IDirect3DDevice2 *device; IDirectDrawSurface *rt; IDirectDraw2 *ddraw; - IDirect3D2 *d3d; D3DCOLOR color; HWND window; HRESULT hr; D3DMATERIALHANDLE mat_handle; - D3DMATERIAL mat_desc; DWORD rs; unsigned int i; ULONG ref; @@ -3356,8 +3400,6 @@ DestroyWindow(window); return; } - hr = IDirectDraw2_QueryInterface(ddraw, &IID_IDirect3D2, (void **)&d3d); - ok(SUCCEEDED(hr), "Failed to get IDirect3D2 interface, hr %#x.\n", hr); hr = IDirect3DDevice2_GetRenderTarget(device, &rt); ok(SUCCEEDED(hr), "Failed to get render target, hr %#x.\n", hr); @@ -3366,13 +3408,7 @@ hr = IDirect3DDevice2_SetCurrentViewport(device, viewport); ok(SUCCEEDED(hr), "Failed to set current viewport, hr %#x.\n", hr); - memset(&mat_desc, 0, sizeof(mat_desc)); - mat_desc.dwSize = sizeof(mat_desc); - U2(U3(mat_desc).dcvEmissive).g = 1.0f; - hr = IDirect3D2_CreateMaterial(d3d, &emissive, NULL); - ok(SUCCEEDED(hr), "Failed to create material, hr %#x.\n", hr); - hr = IDirect3DMaterial2_SetMaterial(emissive, &mat_desc); - ok(SUCCEEDED(hr), "Failed to set material, hr %#x.\n", hr); + emissive = create_emissive_material(device, 0.0f, 1.0f, 0.0f, 0.0f); hr = IDirect3DMaterial2_GetHandle(emissive, device, &mat_handle); ok(SUCCEEDED(hr), "Failed to get material handle, hr %#x.\n", hr); hr = IDirect3DDevice2_SetLightState(device, D3DLIGHTSTATE_MATERIAL, mat_handle); @@ -3381,10 +3417,7 @@ ok(SUCCEEDED(hr), "Failed to disable z test, hr %#x.\n", hr); background = create_diffuse_material(device, 0.1f, 0.1f, 0.1f, 0.1f); - hr = IDirect3DMaterial2_GetHandle(background, device, &mat_handle); - ok(SUCCEEDED(hr), "Failed to get material handle, hr %#x.\n", hr); - hr = IDirect3DViewport2_SetBackground(viewport, mat_handle); - ok(SUCCEEDED(hr), "Failed to set background material, hr %#x.\n", hr); + viewport_set_background(device, viewport, background); hr = IDirect3DDevice2_GetRenderState(device, D3DRENDERSTATE_SPECULARENABLE, &rs); ok(SUCCEEDED(hr), "Failed to get specularenable render state, hr %#x.\n", hr); @@ -3414,11 +3447,10 @@ color, tests[i].color, i); } - IDirect3DMaterial2_Release(background); - IDirect3DMaterial2_Release(emissive); + destroy_material(background); + destroy_material(emissive); IDirectDrawSurface_Release(rt); IDirect3DDevice2_Release(device); - IDirect3D2_Release(d3d); ref = IDirectDraw2_Release(ddraw); ok(ref == 0, "Ddraw object not properly released, refcount %u.\n", ref); DestroyWindow(window); @@ -5067,6 +5099,22 @@ hr = IDirectDrawSurface_SetPalette(primary, palette); ok(SUCCEEDED(hr), "Failed to set palette, hr %#x.\n", hr); + + /* The Windows 8 testbot attaches the palette to the backbuffer as well, + * and is generally somewhat broken with respect to 8 bpp / palette + * handling. */ + if (SUCCEEDED(IDirectDrawSurface_GetPalette(backbuffer, &tmp))) + { + win_skip("Broken palette handling detected, skipping tests.\n"); + IDirectDrawPalette_Release(tmp); + IDirectDrawPalette_Release(palette); + /* The Windows 8 testbot keeps extra references to the primary and + * backbuffer while in 8 bpp mode. */ + hr = IDirectDraw2_RestoreDisplayMode(ddraw); + ok(SUCCEEDED(hr), "Failed to restore display mode, hr %#x.\n", hr); + goto done; + } + refcount = get_refcount((IUnknown *)palette); ok(refcount == 2, "Got unexpected refcount %u.\n", refcount); @@ -5107,6 +5155,7 @@ hr = IDirectDrawSurface_GetPalette(primary, &tmp); ok(hr == DDERR_NOPALETTEATTACHED, "Got unexpected hr %#x.\n", hr); +done: refcount = IDirectDrawSurface_Release(backbuffer); ok(refcount == 1, "Got unexpected refcount %u.\n", refcount); refcount = IDirectDrawSurface_Release(primary); @@ -5538,7 +5587,7 @@ DDSD_PITCH, 0x100}, {DDSCAPS_VIDEOMEMORY, DDSD_PITCH, 0x104, DD_OK, DDSD_PITCH, 0x100}, - {DDSCAPS_VIDEOMEMORY, DDSD_PITCH, 0x0fc, DD_OK, + {DDSCAPS_VIDEOMEMORY, DDSD_PITCH, 0x0f8, DD_OK, DDSD_PITCH, 0x100}, {DDSCAPS_VIDEOMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x100, DDERR_INVALIDCAPS, 0, 0 }, @@ -5546,7 +5595,7 @@ DDSD_PITCH, 0x100}, {DDSCAPS_SYSTEMMEMORY, DDSD_PITCH, 0x104, DD_OK, DDSD_PITCH, 0x100}, - {DDSCAPS_SYSTEMMEMORY, DDSD_PITCH, 0x0fc, DD_OK, + {DDSCAPS_SYSTEMMEMORY, DDSD_PITCH, 0x0f8, DD_OK, DDSD_PITCH, 0x100}, {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE, 0, DDERR_INVALIDPARAMS, 0, 0 }, @@ -5562,7 +5611,7 @@ hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); - mem = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, ((64 * 4) + 4) * 64); + mem = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, ((63 * 4) + 8) * 63); for (i = 0; i < sizeof(test_data) / sizeof(*test_data); ++i) { @@ -5570,8 +5619,8 @@ surface_desc.dwSize = sizeof(surface_desc); surface_desc.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT | test_data[i].flags_in; surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | test_data[i].placement; - surface_desc.dwWidth = 64; - surface_desc.dwHeight = 64; + surface_desc.dwWidth = 63; + surface_desc.dwHeight = 63; U1(surface_desc).lPitch = test_data[i].pitch_in; surface_desc.lpSurface = mem; surface_desc.ddpfPixelFormat.dwSize = sizeof(surface_desc.ddpfPixelFormat); @@ -5606,6 +5655,734 @@ DestroyWindow(window); } +static void test_mipmap_lock(void) +{ + IDirectDrawSurface *surface1; + IDirectDrawSurface2 *surface, *surface2; + DDSURFACEDESC surface_desc; + IDirectDraw2 *ddraw; + ULONG refcount; + HWND window; + HRESULT hr; + DDSCAPS caps = {DDSCAPS_COMPLEX}; + DDCAPS hal_caps; + + window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW, + 0, 0, 640, 480, 0, 0, 0, 0); + ddraw = create_ddraw(); + ok(!!ddraw, "Failed to create a ddraw object.\n"); + hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + + memset(&hal_caps, 0, sizeof(hal_caps)); + hal_caps.dwSize = sizeof(hal_caps); + hr = IDirectDraw2_GetCaps(ddraw, &hal_caps, NULL); + ok(SUCCEEDED(hr), "Failed to get caps, hr %#x.\n", hr); + if ((hal_caps.ddsCaps.dwCaps & (DDSCAPS_TEXTURE | DDSCAPS_MIPMAP)) != (DDSCAPS_TEXTURE | DDSCAPS_MIPMAP)) + { + skip("Mipmapped textures not supported, skipping mipmap lock test.\n"); + IDirectDraw2_Release(ddraw); + DestroyWindow(window); + return; + } + + memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + surface_desc.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_MIPMAPCOUNT; + surface_desc.dwWidth = 4; + surface_desc.dwHeight = 4; + U2(surface_desc).dwMipMapCount = 2; + surface_desc.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_COMPLEX | DDSCAPS_MIPMAP + | DDSCAPS_SYSTEMMEMORY; + hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface1, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + + hr = IDirectDrawSurface_QueryInterface(surface1, &IID_IDirectDrawSurface2, (void **)&surface); + ok(SUCCEEDED(hr), "Failed to get IDirectDrawSurface2 interface, hr %#x.\n", hr); + IDirectDrawSurface_Release(surface1); + hr = IDirectDrawSurface2_GetAttachedSurface(surface, &caps, &surface2); + ok(SUCCEEDED(hr), "Failed to get attached surface, hr %#x.\n", hr); + + memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + hr = IDirectDrawSurface2_Lock(surface, NULL, &surface_desc, 0, NULL); + ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x.\n", hr); + memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + hr = IDirectDrawSurface2_Lock(surface2, NULL, &surface_desc, 0, NULL); + ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x.\n", hr); + IDirectDrawSurface2_Unlock(surface2, NULL); + IDirectDrawSurface2_Unlock(surface, NULL); + + IDirectDrawSurface2_Release(surface2); + IDirectDrawSurface2_Release(surface); + refcount = IDirectDraw2_Release(ddraw); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + DestroyWindow(window); +} + +static void test_palette_complex(void) +{ + IDirectDrawSurface *surface1; + IDirectDrawSurface2 *surface, *mipmap, *tmp; + DDSURFACEDESC surface_desc; + IDirectDraw2 *ddraw; + IDirectDrawPalette *palette, *palette2, *palette_mipmap; + ULONG refcount; + HWND window; + HRESULT hr; + DDSCAPS caps = {DDSCAPS_COMPLEX}; + DDCAPS hal_caps; + PALETTEENTRY palette_entries[256]; + unsigned int i; + HDC dc; + RGBQUAD rgbquad; + UINT count; + + window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW, + 0, 0, 640, 480, 0, 0, 0, 0); + ddraw = create_ddraw(); + ok(!!ddraw, "Failed to create a ddraw object.\n"); + hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + + memset(&hal_caps, 0, sizeof(hal_caps)); + hal_caps.dwSize = sizeof(hal_caps); + hr = IDirectDraw2_GetCaps(ddraw, &hal_caps, NULL); + ok(SUCCEEDED(hr), "Failed to get caps, hr %#x.\n", hr); + if ((hal_caps.ddsCaps.dwCaps & (DDSCAPS_TEXTURE | DDSCAPS_MIPMAP)) != (DDSCAPS_TEXTURE | DDSCAPS_MIPMAP)) + { + skip("Mipmapped textures not supported, skipping mipmap palette test.\n"); + IDirectDraw2_Release(ddraw); + DestroyWindow(window); + return; + } + + 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.dwWidth = 128; + surface_desc.dwHeight = 128; + surface_desc.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_COMPLEX | DDSCAPS_MIPMAP; + surface_desc.ddpfPixelFormat.dwSize = sizeof(surface_desc.ddpfPixelFormat); + surface_desc.ddpfPixelFormat.dwFlags = DDPF_PALETTEINDEXED8 | DDPF_RGB; + U1(surface_desc.ddpfPixelFormat).dwRGBBitCount = 8; + hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface1, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + hr = IDirectDrawSurface_QueryInterface(surface1, &IID_IDirectDrawSurface2, (void **)&surface); + ok(SUCCEEDED(hr), "Failed to get IDirectDrawSurface2 interface, hr %#x.\n", hr); + IDirectDrawSurface_Release(surface1); + + memset(palette_entries, 0, sizeof(palette_entries)); + hr = IDirectDraw2_CreatePalette(ddraw, DDPCAPS_8BIT | DDPCAPS_ALLOW256, + palette_entries, &palette, NULL); + ok(SUCCEEDED(hr), "Failed to create palette, hr %#x.\n", hr); + + memset(palette_entries, 0, sizeof(palette_entries)); + palette_entries[1].peRed = 0xff; + palette_entries[1].peGreen = 0x80; + hr = IDirectDraw2_CreatePalette(ddraw, DDPCAPS_8BIT | DDPCAPS_ALLOW256, + palette_entries, &palette_mipmap, NULL); + ok(SUCCEEDED(hr), "Failed to create palette, hr %#x.\n", hr); + + palette2 = (void *)0xdeadbeef; + hr = IDirectDrawSurface2_GetPalette(surface, &palette2); + ok(hr == DDERR_NOPALETTEATTACHED, "Got unexpected hr %#x.\n", hr); + ok(!palette2, "Got unexpected palette %p.\n", palette2); + hr = IDirectDrawSurface2_SetPalette(surface, palette); + ok(SUCCEEDED(hr), "Failed to set palette, hr %#x.\n", hr); + hr = IDirectDrawSurface2_GetPalette(surface, &palette2); + ok(SUCCEEDED(hr), "Failed to get palette, hr %#x.\n", hr); + ok(palette == palette2, "Got unexpected palette %p.\n", palette2); + IDirectDrawPalette_Release(palette2); + + mipmap = surface; + IDirectDrawSurface2_AddRef(mipmap); + for (i = 0; i < 7; ++i) + { + hr = IDirectDrawSurface2_GetAttachedSurface(mipmap, &caps, &tmp); + ok(SUCCEEDED(hr), "Failed to get attached surface, i %u, hr %#x.\n", i, hr); + palette2 = (void *)0xdeadbeef; + hr = IDirectDrawSurface2_GetPalette(tmp, &palette2); + ok(hr == DDERR_NOPALETTEATTACHED, "Got unexpected hr %#x, i %u.\n", hr, i); + ok(!palette2, "Got unexpected palette %p, i %u.\n", palette2, i); + + hr = IDirectDrawSurface2_SetPalette(tmp, palette_mipmap); + ok(SUCCEEDED(hr), "Failed to set palette, i %u, hr %#x.\n", i, hr); + + hr = IDirectDrawSurface2_GetPalette(tmp, &palette2); + ok(SUCCEEDED(hr), "Failed to get palette, i %u, hr %#x.\n", i, hr); + ok(palette_mipmap == palette2, "Got unexpected palette %p.\n", palette2); + IDirectDrawPalette_Release(palette2); + + hr = IDirectDrawSurface2_GetDC(tmp, &dc); + ok(SUCCEEDED(hr), "Failed to get DC, i %u, hr %#x.\n", i, hr); + count = GetDIBColorTable(dc, 1, 1, &rgbquad); + ok(count == 1, "Expected count 1, got %u.\n", count); + ok(rgbquad.rgbRed == 0xff, "Expected rgbRed = 0xff, got %#x.\n", rgbquad.rgbRed); + ok(rgbquad.rgbGreen == 0x80, "Expected rgbGreen = 0x80, got %#x.\n", rgbquad.rgbGreen); + ok(rgbquad.rgbBlue == 0x0, "Expected rgbBlue = 0x0, got %#x.\n", rgbquad.rgbBlue); + hr = IDirectDrawSurface2_ReleaseDC(tmp, dc); + ok(SUCCEEDED(hr), "Failed to release DC, i %u, hr %#x.\n", i, hr); + + IDirectDrawSurface2_Release(mipmap); + mipmap = tmp; + } + + hr = IDirectDrawSurface2_GetAttachedSurface(mipmap, &caps, &tmp); + ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#x.\n", hr); + IDirectDrawSurface2_Release(mipmap); + refcount = IDirectDrawSurface2_Release(surface); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + refcount = IDirectDrawPalette_Release(palette_mipmap); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + refcount = IDirectDrawPalette_Release(palette); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + + refcount = IDirectDraw2_Release(ddraw); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + DestroyWindow(window); +} + +static void test_p8_rgb_blit(void) +{ + IDirectDrawSurface *src, *dst; + DDSURFACEDESC surface_desc; + IDirectDraw2 *ddraw; + IDirectDrawPalette *palette; + ULONG refcount; + HWND window; + HRESULT hr; + PALETTEENTRY palette_entries[256]; + unsigned int x; + static const BYTE src_data[] = {0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0xff, 0x80}; + static const D3DCOLOR expected[] = + { + 0x00000000, 0x00010101, 0x00020202, 0x00030303, + 0x00040404, 0x00050505, 0x00ffffff, 0x00808080, + }; + D3DCOLOR color; + + 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(palette_entries, 0, sizeof(palette_entries)); + palette_entries[0].peRed = 0xff; + palette_entries[1].peGreen = 0xff; + palette_entries[2].peBlue = 0xff; + palette_entries[3].peFlags = 0xff; + hr = IDirectDraw2_CreatePalette(ddraw, DDPCAPS_8BIT | DDPCAPS_ALLOW256, + palette_entries, &palette, NULL); + ok(SUCCEEDED(hr), "Failed to create palette, 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; + surface_desc.dwWidth = 8; + surface_desc.dwHeight = 1; + surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; + surface_desc.ddpfPixelFormat.dwSize = sizeof(surface_desc.ddpfPixelFormat); + surface_desc.ddpfPixelFormat.dwFlags = DDPF_PALETTEINDEXED8 | DDPF_RGB; + U1(surface_desc.ddpfPixelFormat).dwRGBBitCount = 8; + hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &src, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, 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; + surface_desc.dwWidth = 8; + surface_desc.dwHeight = 1; + surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; + surface_desc.ddpfPixelFormat.dwSize = sizeof(surface_desc.ddpfPixelFormat); + surface_desc.ddpfPixelFormat.dwFlags = DDPF_RGB | DDPF_ALPHAPIXELS; + 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 = 0xff000000; + hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &dst, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + + memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + hr = IDirectDrawSurface_Lock(src, NULL, &surface_desc, 0, NULL); + ok(SUCCEEDED(hr), "Failed to lock source surface, hr %#x.\n", hr); + memcpy(surface_desc.lpSurface, src_data, sizeof(src_data)); + hr = IDirectDrawSurface_Unlock(src, NULL); + ok(SUCCEEDED(hr), "Failed to unlock source surface, hr %#x.\n", hr); + + hr = IDirectDrawSurface_SetPalette(src, palette); + ok(SUCCEEDED(hr), "Failed to set palette, hr %#x.\n", hr); + hr = IDirectDrawSurface_Blt(dst, NULL, src, NULL, DDBLT_WAIT, NULL); + /* The r500 Windows 7 driver returns E_NOTIMPL. r200 on Windows XP works. + * The Geforce 7 driver on Windows Vista returns E_FAIL. Newer Nvidia GPUs work. */ + ok(SUCCEEDED(hr) || broken(hr == E_NOTIMPL) || broken(hr == E_FAIL), + "Failed to blit, hr %#x.\n", hr); + + if (SUCCEEDED(hr)) + { + for (x = 0; x < sizeof(expected) / sizeof(*expected); x++) + { + color = get_surface_color(dst, x, 0); + todo_wine ok(compare_color(color, expected[x], 0), + "Pixel %u: Got color %#x, expected %#x.\n", + x, color, expected[x]); + } + } + + IDirectDrawSurface_Release(src); + IDirectDrawSurface_Release(dst); + IDirectDrawPalette_Release(palette); + + refcount = IDirectDraw2_Release(ddraw); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + DestroyWindow(window); +} + +static void test_material(void) +{ + D3DMATERIALHANDLE mat_handle, tmp; + IDirect3DMaterial2 *material; + IDirect3DViewport2 *viewport; + IDirect3DDevice2 *device; + IDirectDrawSurface *rt; + IDirectDraw2 *ddraw; + D3DCOLOR color; + ULONG refcount; + unsigned int i; + HWND window; + HRESULT hr; + BOOL valid; + + static D3DVERTEX quad[] = + { + {{-1.0f}, {-1.0f}, {0.0f}, {1.0f}, {0.0f}, {0.0f}}, + {{-1.0f}, { 1.0f}, {0.0f}, {1.0f}, {0.0f}, {0.0f}}, + {{ 1.0f}, {-1.0f}, {0.0f}, {1.0f}, {0.0f}, {0.0f}}, + {{ 1.0f}, { 1.0f}, {0.0f}, {1.0f}, {0.0f}, {0.0f}}, + }; + static const struct + { + BOOL material; + D3DCOLOR expected_color; + } + test_data[] = + { + {TRUE, 0x0000ff00}, + {FALSE, 0x00ffffff}, + }; + static D3DRECT clear_rect = {{0}, {0}, {640}, {480}}; + + 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); + return; + } + + hr = IDirect3DDevice2_GetRenderTarget(device, &rt); + ok(SUCCEEDED(hr), "Failed to get render target, hr %#x.\n", hr); + + material = create_diffuse_material(device, 0.0f, 0.0f, 1.0f, 1.0f); + viewport = create_viewport(device, 0, 0, 640, 480); + viewport_set_background(device, viewport, material); + hr = IDirect3DDevice2_SetCurrentViewport(device, viewport); + ok(SUCCEEDED(hr), "Failed to set current viewport, hr %#x.\n", hr); + + destroy_material(material); + material = create_emissive_material(device, 0.0f, 1.0f, 0.0f, 0.0f); + hr = IDirect3DMaterial2_GetHandle(material, device, &mat_handle); + ok(SUCCEEDED(hr), "Failed to get material handle, hr %#x.\n", hr); + + hr = IDirect3DDevice2_GetLightState(device, D3DLIGHTSTATE_MATERIAL, &tmp); + ok(SUCCEEDED(hr), "Failed to get light state, hr %#x.\n", hr); + ok(!tmp, "Got unexpected material handle %#x.\n", tmp); + hr = IDirect3DDevice2_SetLightState(device, D3DLIGHTSTATE_MATERIAL, mat_handle); + ok(SUCCEEDED(hr), "Failed to set material state, hr %#x.\n", hr); + hr = IDirect3DDevice2_GetLightState(device, D3DLIGHTSTATE_MATERIAL, &tmp); + ok(SUCCEEDED(hr), "Failed to get light state, hr %#x.\n", hr); + ok(tmp == mat_handle, "Got unexpected material handle %#x, expected %#x.\n", tmp, mat_handle); + hr = IDirect3DDevice2_SetLightState(device, D3DLIGHTSTATE_MATERIAL, 0); + ok(SUCCEEDED(hr), "Failed to set material state, hr %#x.\n", hr); + hr = IDirect3DDevice2_GetLightState(device, D3DLIGHTSTATE_MATERIAL, &tmp); + ok(SUCCEEDED(hr), "Failed to get light state, hr %#x.\n", hr); + ok(!tmp, "Got unexpected material handle %#x.\n", tmp); + + for (i = 0; i < sizeof(test_data) / sizeof(*test_data); ++i) + { + hr = IDirect3DViewport2_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER); + ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#x.\n", hr); + + hr = IDirect3DDevice2_SetLightState(device, D3DLIGHTSTATE_MATERIAL, test_data[i].material ? mat_handle : 0); + ok(SUCCEEDED(hr), "Failed to set material state, 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_VERTEX, 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, 320, 240); + ok(compare_color(color, test_data[i].expected_color, 1), + "Got unexpected color 0x%08x, test %u.\n", color, i); + } + + destroy_material(material); + material = create_diffuse_material(device, 1.0f, 0.0f, 0.0f, 1.0f); + hr = IDirect3DMaterial2_GetHandle(material, device, &mat_handle); + ok(SUCCEEDED(hr), "Failed to get material handle, hr %#x.\n", hr); + + hr = IDirect3DViewport2_SetBackground(viewport, mat_handle); + ok(SUCCEEDED(hr), "Failed to set viewport background, hr %#x.\n", hr); + hr = IDirect3DViewport2_GetBackground(viewport, &tmp, &valid); + ok(SUCCEEDED(hr), "Failed to get viewport background, hr %#x.\n", hr); + ok(tmp == mat_handle, "Got unexpected material handle %#x, expected %#x.\n", tmp, mat_handle); + ok(valid, "Got unexpected valid %#x.\n", valid); + hr = IDirect3DViewport2_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET); + ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#x.\n", hr); + color = get_surface_color(rt, 320, 240); + ok(compare_color(color, 0x00ff0000, 1), "Got unexpected color 0x%08x.\n", color); + + hr = IDirect3DViewport2_SetBackground(viewport, 0); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DViewport2_GetBackground(viewport, &tmp, &valid); + ok(SUCCEEDED(hr), "Failed to get viewport background, hr %#x.\n", hr); + ok(tmp == mat_handle, "Got unexpected material handle %#x, expected %#x.\n", tmp, mat_handle); + ok(valid, "Got unexpected valid %#x.\n", valid); + hr = IDirect3DViewport2_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET); + ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#x.\n", hr); + color = get_surface_color(rt, 320, 240); + ok(compare_color(color, 0x00ff0000, 1), "Got unexpected color 0x%08x.\n", color); + + destroy_viewport(device, viewport); + viewport = create_viewport(device, 0, 0, 640, 480); + + hr = IDirect3DViewport2_GetBackground(viewport, &tmp, &valid); + ok(SUCCEEDED(hr), "Failed to get viewport background, hr %#x.\n", hr); + ok(!tmp, "Got unexpected material handle %#x.\n", tmp); + ok(!valid, "Got unexpected valid %#x.\n", valid); + hr = IDirect3DViewport2_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET); + ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#x.\n", hr); + color = get_surface_color(rt, 320, 240); + ok(compare_color(color, 0x00000000, 1), "Got unexpected color 0x%08x.\n", color); + + destroy_viewport(device, viewport); + destroy_material(material); + IDirectDrawSurface_Release(rt); + refcount = IDirect3DDevice2_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + refcount = IDirectDraw2_Release(ddraw); + ok(!refcount, "Ddraw object has %u references left.\n", refcount); + DestroyWindow(window); +} + +static void test_palette_gdi(void) +{ + IDirectDrawSurface *surface, *primary; + DDSURFACEDESC surface_desc; + IDirectDraw2 *ddraw; + IDirectDrawPalette *palette, *palette2; + ULONG refcount; + HWND window; + HRESULT hr; + PALETTEENTRY palette_entries[256]; + UINT i; + HDC dc; + /* On the Windows 8 testbot palette index 0 of the onscreen palette is forced to + * r = 0, g = 0, b = 0. Do not attempt to set it to something else as this is + * not the point of this test. */ + static const RGBQUAD expected1[] = + { + {0x00, 0x00, 0x00, 0x00}, {0x00, 0x00, 0x01, 0x00}, {0x00, 0x02, 0x00, 0x00}, + {0x03, 0x00, 0x00, 0x00}, {0x15, 0x14, 0x13, 0x00}, + }; + static const RGBQUAD expected2[] = + { + {0x00, 0x00, 0x00, 0x00}, {0x00, 0x00, 0x01, 0x00}, {0x00, 0x02, 0x00, 0x00}, + {0x03, 0x00, 0x00, 0x00}, {0x25, 0x24, 0x23, 0x00}, + }; + static const RGBQUAD expected3[] = + { + {0x00, 0x00, 0x00, 0x00}, {0x40, 0x00, 0x00, 0x00}, {0x00, 0x00, 0x40, 0x00}, + {0x00, 0x40, 0x00, 0x00}, {0x56, 0x34, 0x12, 0x00}, + }; + HPALETTE ddraw_palette_handle; + /* Similar to index 0, index 255 is r = 0xff, g = 0xff, b = 0xff on the Win8 VMs. */ + RGBQUAD rgbquad[255]; + static const RGBQUAD rgb_zero = {0, 0, 0, 0}; + + 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; + surface_desc.dwWidth = 16; + surface_desc.dwHeight = 16; + surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; + surface_desc.ddpfPixelFormat.dwSize = sizeof(surface_desc.ddpfPixelFormat); + surface_desc.ddpfPixelFormat.dwFlags = DDPF_PALETTEINDEXED8 | DDPF_RGB; + U1(surface_desc.ddpfPixelFormat).dwRGBBitCount = 8; + hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &surface, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + + /* Avoid colors from the Windows default palette. */ + memset(palette_entries, 0, sizeof(palette_entries)); + palette_entries[1].peRed = 0x01; + palette_entries[2].peGreen = 0x02; + palette_entries[3].peBlue = 0x03; + palette_entries[4].peRed = 0x13; + palette_entries[4].peGreen = 0x14; + palette_entries[4].peBlue = 0x15; + hr = IDirectDraw2_CreatePalette(ddraw, DDPCAPS_8BIT | DDPCAPS_ALLOW256, + palette_entries, &palette, NULL); + ok(SUCCEEDED(hr), "Failed to create palette, hr %#x.\n", hr); + + /* If there is no palette assigned and the display mode is not 8 bpp, some + * drivers refuse to create a DC while others allow it. If a DC is created, + * the DIB color table is uninitialized and contains random colors. No error + * is generated when trying to read pixels and random garbage is returned. + * + * The most likely explanation is that if the driver creates a DC, it (or + * the higher-level runtime) uses GetSystemPaletteEntries to find the + * palette, but GetSystemPaletteEntries fails when bpp > 8 and the palette + * contains uninitialized garbage. See comments below for the P8 case. */ + + hr = IDirectDrawSurface_SetPalette(surface, palette); + ok(SUCCEEDED(hr), "Failed to set palette, hr %#x.\n", hr); + hr = IDirectDrawSurface_GetDC(surface, &dc); + ok(SUCCEEDED(hr), "Failed to get DC, hr %#x.\n", hr); + ddraw_palette_handle = SelectPalette(dc, GetStockObject(DEFAULT_PALETTE), FALSE); + ok(ddraw_palette_handle == GetStockObject(DEFAULT_PALETTE), + "Got unexpected palette %p, expected %p.\n", + ddraw_palette_handle, GetStockObject(DEFAULT_PALETTE)); + + i = GetDIBColorTable(dc, 0, sizeof(rgbquad) / sizeof(*rgbquad), rgbquad); + ok(i == sizeof(rgbquad) / sizeof(*rgbquad), "Expected count 255, got %u.\n", i); + for (i = 0; i < sizeof(expected1) / sizeof(*expected1); i++) + { + ok(!memcmp(&rgbquad[i], &expected1[i], sizeof(rgbquad[i])), + "Got color table entry %u r=%#x g=%#x b=%#x, expected r=%#x g=%#x b=%#x.\n", + i, rgbquad[i].rgbRed, rgbquad[i].rgbGreen, rgbquad[i].rgbBlue, + expected1[i].rgbRed, expected1[i].rgbGreen, expected1[i].rgbBlue); + } + for (; i < sizeof(rgbquad) / sizeof(*rgbquad); i++) + { + ok(!memcmp(&rgbquad[i], &rgb_zero, sizeof(rgbquad[i])), + "Got color table entry %u r=%#x g=%#x b=%#x, expected r=0 g=0 b=0.\n", + i, rgbquad[i].rgbRed, rgbquad[i].rgbGreen, rgbquad[i].rgbBlue); + } + + /* Update the palette while the DC is in use. This does not modify the DC. */ + palette_entries[4].peRed = 0x23; + palette_entries[4].peGreen = 0x24; + palette_entries[4].peBlue = 0x25; + hr = IDirectDrawPalette_SetEntries(palette, 0, 4, 1, &palette_entries[4]); + ok(SUCCEEDED(hr), "Failed to set palette entries, hr %#x.\n", hr); + + i = GetDIBColorTable(dc, 4, 1, &rgbquad[4]); + ok(i == 1, "Expected count 1, got %u.\n", i); + todo_wine ok(!memcmp(&rgbquad[4], &expected1[4], sizeof(rgbquad[4])), + "Got color table entry %u r=%#x g=%#x b=%#x, expected r=%#x g=%#x b=%#x.\n", + i, rgbquad[4].rgbRed, rgbquad[4].rgbGreen, rgbquad[4].rgbBlue, + expected1[4].rgbRed, expected1[4].rgbGreen, expected1[4].rgbBlue); + + /* Neither does re-setting the palette. */ + hr = IDirectDrawSurface_SetPalette(surface, NULL); + ok(SUCCEEDED(hr), "Failed to set palette, hr %#x.\n", hr); + hr = IDirectDrawSurface_SetPalette(surface, palette); + ok(SUCCEEDED(hr), "Failed to set palette, hr %#x.\n", hr); + + i = GetDIBColorTable(dc, 4, 1, &rgbquad[4]); + ok(i == 1, "Expected count 1, got %u.\n", i); + todo_wine ok(!memcmp(&rgbquad[4], &expected1[4], sizeof(rgbquad[4])), + "Got color table entry %u r=%#x g=%#x b=%#x, expected r=%#x g=%#x b=%#x.\n", + i, rgbquad[4].rgbRed, rgbquad[4].rgbGreen, rgbquad[4].rgbBlue, + expected1[4].rgbRed, expected1[4].rgbGreen, expected1[4].rgbBlue); + + hr = IDirectDrawSurface_ReleaseDC(surface, dc); + ok(SUCCEEDED(hr), "Failed to release DC, hr %#x.\n", hr); + + /* Refresh the DC. This updates the palette. */ + hr = IDirectDrawSurface_GetDC(surface, &dc); + ok(SUCCEEDED(hr), "Failed to get DC, hr %#x.\n", hr); + i = GetDIBColorTable(dc, 0, sizeof(rgbquad) / sizeof(*rgbquad), rgbquad); + ok(i == sizeof(rgbquad) / sizeof(*rgbquad), "Expected count 255, got %u.\n", i); + for (i = 0; i < sizeof(expected2) / sizeof(*expected2); i++) + { + ok(!memcmp(&rgbquad[i], &expected2[i], sizeof(rgbquad[i])), + "Got color table entry %u r=%#x g=%#x b=%#x, expected r=%#x g=%#x b=%#x.\n", + i, rgbquad[i].rgbRed, rgbquad[i].rgbGreen, rgbquad[i].rgbBlue, + expected2[i].rgbRed, expected2[i].rgbGreen, expected2[i].rgbBlue); + } + for (; i < sizeof(rgbquad) / sizeof(*rgbquad); i++) + { + ok(!memcmp(&rgbquad[i], &rgb_zero, sizeof(rgbquad[i])), + "Got color table entry %u r=%#x g=%#x b=%#x, expected r=0 g=0 b=0.\n", + i, rgbquad[i].rgbRed, rgbquad[i].rgbGreen, rgbquad[i].rgbBlue); + } + hr = IDirectDrawSurface_ReleaseDC(surface, dc); + ok(SUCCEEDED(hr), "Failed to release DC, hr %#x.\n", hr); + + refcount = IDirectDrawSurface_Release(surface); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + + if (FAILED(hr = IDirectDraw2_SetDisplayMode(ddraw, 640, 480, 8, 0, 0))) + { + win_skip("Failed to set 8 bpp display mode, skipping test.\n"); + IDirectDrawPalette_Release(palette); + IDirectDraw2_Release(ddraw); + DestroyWindow(window); + return; + } + ok(SUCCEEDED(hr), "Failed to set display mode, hr %#x.\n", hr); + hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_FULLSCREEN | DDSCL_EXCLUSIVE); + 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; + surface_desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; + hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &primary, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + + hr = IDirectDrawSurface_SetPalette(primary, palette); + ok(SUCCEEDED(hr), "Failed to set palette, hr %#x.\n", hr); + hr = IDirectDrawSurface_GetDC(primary, &dc); + ok(SUCCEEDED(hr), "Failed to get DC, hr %#x.\n", hr); + ddraw_palette_handle = SelectPalette(dc, GetStockObject(DEFAULT_PALETTE), FALSE); + /* Windows 2000 on the testbot assigns a different palette to the primary. Refrast? */ + ok(ddraw_palette_handle == GetStockObject(DEFAULT_PALETTE) || broken(TRUE), + "Got unexpected palette %p, expected %p.\n", + ddraw_palette_handle, GetStockObject(DEFAULT_PALETTE)); + SelectPalette(dc, ddraw_palette_handle, FALSE); + + /* The primary uses the system palette. In exclusive mode, the system palette matches + * the ddraw palette attached to the primary, so the result is what you would expect + * from a regular surface. Tests for the interaction between the ddraw palette and + * the system palette are not included pending an application that depends on this. + * The relation between those causes problems on Windows Vista and newer for games + * like Age of Empires or Starcraft. Don't emulate it without a real need. */ + i = GetDIBColorTable(dc, 0, sizeof(rgbquad) / sizeof(*rgbquad), rgbquad); + ok(i == sizeof(rgbquad) / sizeof(*rgbquad), "Expected count 255, got %u.\n", i); + for (i = 0; i < sizeof(expected2) / sizeof(*expected2); i++) + { + ok(!memcmp(&rgbquad[i], &expected2[i], sizeof(rgbquad[i])), + "Got color table entry %u r=%#x g=%#x b=%#x, expected r=%#x g=%#x b=%#x.\n", + i, rgbquad[i].rgbRed, rgbquad[i].rgbGreen, rgbquad[i].rgbBlue, + expected2[i].rgbRed, expected2[i].rgbGreen, expected2[i].rgbBlue); + } + for (; i < sizeof(rgbquad) / sizeof(*rgbquad); i++) + { + ok(!memcmp(&rgbquad[i], &rgb_zero, sizeof(rgbquad[i])), + "Got color table entry %u r=%#x g=%#x b=%#x, expected r=0 g=0 b=0.\n", + i, rgbquad[i].rgbRed, rgbquad[i].rgbGreen, rgbquad[i].rgbBlue); + } + hr = IDirectDrawSurface_ReleaseDC(primary, dc); + ok(SUCCEEDED(hr), "Failed to release DC, 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; + surface_desc.dwWidth = 16; + surface_desc.dwHeight = 16; + surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; + hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + + /* Here the offscreen surface appears to use the primary's palette, + * but in all likelyhood it is actually the system palette. */ + hr = IDirectDrawSurface_GetDC(surface, &dc); + ok(SUCCEEDED(hr), "Failed to get DC, hr %#x.\n", hr); + i = GetDIBColorTable(dc, 0, sizeof(rgbquad) / sizeof(*rgbquad), rgbquad); + ok(i == sizeof(rgbquad) / sizeof(*rgbquad), "Expected count 255, got %u.\n", i); + for (i = 0; i < sizeof(expected2) / sizeof(*expected2); i++) + { + ok(!memcmp(&rgbquad[i], &expected2[i], sizeof(rgbquad[i])), + "Got color table entry %u r=%#x g=%#x b=%#x, expected r=%#x g=%#x b=%#x.\n", + i, rgbquad[i].rgbRed, rgbquad[i].rgbGreen, rgbquad[i].rgbBlue, + expected2[i].rgbRed, expected2[i].rgbGreen, expected2[i].rgbBlue); + } + for (; i < sizeof(rgbquad) / sizeof(*rgbquad); i++) + { + ok(!memcmp(&rgbquad[i], &rgb_zero, sizeof(rgbquad[i])), + "Got color table entry %u r=%#x g=%#x b=%#x, expected r=0 g=0 b=0.\n", + i, rgbquad[i].rgbRed, rgbquad[i].rgbGreen, rgbquad[i].rgbBlue); + } + hr = IDirectDrawSurface_ReleaseDC(surface, dc); + ok(SUCCEEDED(hr), "Failed to release DC, hr %#x.\n", hr); + + /* On real hardware a change to the primary surface's palette applies immediately, + * even on device contexts from offscreen surfaces that do not have their own + * palette. On the testbot VMs this is not the case. Don't test this until we + * know of an application that depends on this. */ + + memset(palette_entries, 0, sizeof(palette_entries)); + palette_entries[1].peBlue = 0x40; + palette_entries[2].peRed = 0x40; + palette_entries[3].peGreen = 0x40; + palette_entries[4].peRed = 0x12; + palette_entries[4].peGreen = 0x34; + palette_entries[4].peBlue = 0x56; + hr = IDirectDraw2_CreatePalette(ddraw, DDPCAPS_8BIT | DDPCAPS_ALLOW256, + palette_entries, &palette2, NULL); + ok(SUCCEEDED(hr), "Failed to create palette, hr %#x.\n", hr); + hr = IDirectDrawSurface_SetPalette(surface, palette2); + ok(SUCCEEDED(hr), "Failed to set palette, hr %#x.\n", hr); + + /* A palette assigned to the offscreen surface overrides the primary / system + * palette. */ + hr = IDirectDrawSurface_GetDC(surface, &dc); + ok(SUCCEEDED(hr), "Failed to get DC, hr %#x.\n", hr); + i = GetDIBColorTable(dc, 0, sizeof(rgbquad) / sizeof(*rgbquad), rgbquad); + ok(i == sizeof(rgbquad) / sizeof(*rgbquad), "Expected count 255, got %u.\n", i); + for (i = 0; i < sizeof(expected3) / sizeof(*expected3); i++) + { + ok(!memcmp(&rgbquad[i], &expected3[i], sizeof(rgbquad[i])), + "Got color table entry %u r=%#x g=%#x b=%#x, expected r=%#x g=%#x b=%#x.\n", + i, rgbquad[i].rgbRed, rgbquad[i].rgbGreen, rgbquad[i].rgbBlue, + expected3[i].rgbRed, expected3[i].rgbGreen, expected3[i].rgbBlue); + } + for (; i < sizeof(rgbquad) / sizeof(*rgbquad); i++) + { + ok(!memcmp(&rgbquad[i], &rgb_zero, sizeof(rgbquad[i])), + "Got color table entry %u r=%#x g=%#x b=%#x, expected r=0 g=0 b=0.\n", + i, rgbquad[i].rgbRed, rgbquad[i].rgbGreen, rgbquad[i].rgbBlue); + } + hr = IDirectDrawSurface_ReleaseDC(surface, dc); + ok(SUCCEEDED(hr), "Failed to release DC, hr %#x.\n", hr); + + refcount = IDirectDrawSurface_Release(surface); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + + /* The Windows 8 testbot keeps extra references to the primary and + * backbuffer while in 8 bpp mode. */ + hr = IDirectDraw2_RestoreDisplayMode(ddraw); + ok(SUCCEEDED(hr), "Failed to restore display mode, hr %#x.\n", hr); + + refcount = IDirectDrawSurface_Release(primary); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + refcount = IDirectDrawPalette_Release(palette2); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + refcount = IDirectDrawPalette_Release(palette); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + refcount = IDirectDraw2_Release(ddraw); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + DestroyWindow(window); +} + START_TEST(ddraw2) { IDirectDraw2 *ddraw; @@ -5656,4 +6433,9 @@ test_surface_attachment(); test_pixel_format(); test_create_surface_pitch(); + test_mipmap_lock(); + test_palette_complex(); + test_p8_rgb_blit(); + test_material(); + test_palette_gdi(); } diff -Nru wine1.7-1.7.14/dlls/ddraw/tests/ddraw4.c wine1.7-1.7.18/dlls/ddraw/tests/ddraw4.c --- wine1.7-1.7.14/dlls/ddraw/tests/ddraw4.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/ddraw/tests/ddraw4.c 2014-05-02 18:15:48.000000000 +0000 @@ -339,6 +339,56 @@ IDirect3DViewport3_Release(viewport); } +static IDirect3DMaterial3 *create_material(IDirect3DDevice3 *device, D3DMATERIAL *mat) +{ + IDirect3DMaterial3 *material; + IDirect3D3 *d3d; + HRESULT hr; + + hr = IDirect3DDevice3_GetDirect3D(device, &d3d); + ok(SUCCEEDED(hr), "Failed to get d3d interface, hr %#x.\n", hr); + hr = IDirect3D3_CreateMaterial(d3d, &material, NULL); + ok(SUCCEEDED(hr), "Failed to create material, hr %#x.\n", hr); + hr = IDirect3DMaterial3_SetMaterial(material, mat); + ok(SUCCEEDED(hr), "Failed to set material data, hr %#x.\n", hr); + IDirect3D3_Release(d3d); + + return material; +} + +static IDirect3DMaterial3 *create_diffuse_material(IDirect3DDevice3 *device, float r, float g, float b, float a) +{ + D3DMATERIAL mat; + + memset(&mat, 0, sizeof(mat)); + mat.dwSize = sizeof(mat); + U1(U(mat).diffuse).r = r; + U2(U(mat).diffuse).g = g; + U3(U(mat).diffuse).b = b; + U4(U(mat).diffuse).a = a; + + return create_material(device, &mat); +} + +static IDirect3DMaterial3 *create_emissive_material(IDirect3DDevice3 *device, float r, float g, float b, float a) +{ + D3DMATERIAL mat; + + memset(&mat, 0, sizeof(mat)); + mat.dwSize = sizeof(mat); + U1(U3(mat).emissive).r = r; + U2(U3(mat).emissive).g = g; + U3(U3(mat).emissive).b = b; + U4(U3(mat).emissive).a = a; + + return create_material(device, &mat); +} + +static void destroy_material(IDirect3DMaterial3 *material) +{ + IDirect3DMaterial3_Release(material); +} + static const UINT *expect_messages; static LRESULT CALLBACK test_proc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam) @@ -696,6 +746,21 @@ 0x00000000, 0x00000000, 0x00ff0000, 0x00ffffff, 0x00000000, 0x00000000, 0x00ff0000, 0x00ffffff, }; + /* Nvidia on Windows seems to have an off-by-one error + * when processing source rectangles. Our left = 1 and + * right = 5 input reads from x = {1, 2, 3}. x = 4 is + * read as well, but only for the edge pixels on the + * output image. The bug happens on the y axis as well, + * but we only read one row there, and all source rows + * contain the same data. This bug is not dependent on + * the presence of a clipper. */ + static const D3DCOLOR expected1_broken[] = + { + 0x000000ff, 0x000000ff, 0x00000000, 0x00000000, + 0x000000ff, 0x000000ff, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00ff0000, 0x00ff0000, + 0x00000000, 0x00000000, 0x0000ff00, 0x00ff0000, + }; static const D3DCOLOR expected2[] = { 0x000000ff, 0x000000ff, 0x00000000, 0x00000000, @@ -809,7 +874,8 @@ x = 80 * ((2 * j) + 1); y = 60 * ((2 * i) + 1); color = get_surface_color(dst_surface, x, y); - ok(compare_color(color, expected1[i * 4 + j], 1), + ok(compare_color(color, expected1[i * 4 + j], 1) + || broken(compare_color(color, expected1_broken[i * 4 + j], 1)), "Expected color 0x%08x at %u,%u, got 0x%08x.\n", expected1[i * 4 + j], x, y, color); } } @@ -2430,6 +2496,7 @@ HWND window, window2; HRESULT hr; ULONG ref; + MSG msg; static const UINT exclusive_messages[] = { @@ -2491,6 +2558,7 @@ fullscreen_rect.left, fullscreen_rect.top, fullscreen_rect.right, fullscreen_rect.bottom, r.left, r.top, r.right, r.bottom); + PeekMessageA(&msg, 0, 0, 0, PM_NOREMOVE); expect_messages = exclusive_messages; screen_size.cx = 0; screen_size.cy = 0; @@ -2536,6 +2604,7 @@ s.left, s.top, s.right, s.bottom, r.left, r.top, r.right, r.bottom); + PeekMessageA(&msg, 0, 0, 0, PM_NOREMOVE); expect_messages = exclusive_messages; screen_size.cx = 0; screen_size.cy = 0; @@ -2616,6 +2685,7 @@ fullscreen_rect.left, fullscreen_rect.top, fullscreen_rect.right, fullscreen_rect.bottom, r.left, r.top, r.right, r.bottom); + PeekMessageA(&msg, 0, 0, 0, PM_NOREMOVE); expect_messages = normal_messages; screen_size.cx = 0; screen_size.cy = 0; @@ -2659,6 +2729,7 @@ fullscreen_rect.left, fullscreen_rect.top, fullscreen_rect.right, fullscreen_rect.bottom, r.left, r.top, r.right, r.bottom); + PeekMessageA(&msg, 0, 0, 0, PM_NOREMOVE); expect_messages = normal_messages; screen_size.cx = 0; screen_size.cy = 0; @@ -2740,6 +2811,7 @@ fullscreen_rect.left, fullscreen_rect.top, fullscreen_rect.right, fullscreen_rect.bottom, r.left, r.top, r.right, r.bottom); + PeekMessageA(&msg, 0, 0, 0, PM_NOREMOVE); expect_messages = normal_messages; screen_size.cx = 0; screen_size.cy = 0; @@ -2783,6 +2855,7 @@ fullscreen_rect.left, fullscreen_rect.top, fullscreen_rect.right, fullscreen_rect.bottom, r.left, r.top, r.right, r.bottom); + PeekMessageA(&msg, 0, 0, 0, PM_NOREMOVE); expect_messages = normal_messages; screen_size.cx = 0; screen_size.cy = 0; @@ -2833,6 +2906,7 @@ hr = set_display_mode(ddraw, 640, 480); ok(SUCCEEDED(hr), "Failed to set display mode, hr %#x.\n", hr); + PeekMessageA(&msg, 0, 0, 0, PM_NOREMOVE); expect_messages = exclusive_messages; screen_size.cx = 0; screen_size.cy = 0; @@ -2899,6 +2973,7 @@ hr = set_display_mode(ddraw, 640, 480); ok(SUCCEEDED(hr), "Failed to set display mode, hr %#x.\n", hr); + PeekMessageA(&msg, 0, 0, 0, PM_NOREMOVE); expect_messages = exclusive_messages; screen_size.cx = 0; screen_size.cy = 0; @@ -3544,12 +3619,10 @@ IDirect3DViewport3 *viewport; IDirect3DDevice3 *device; IDirectDrawSurface4 *rt; - IDirect3D3 *d3d; D3DCOLOR color; HWND window; HRESULT hr; D3DMATERIALHANDLE mat_handle; - D3DMATERIAL mat_desc; DWORD rs; unsigned int i; ULONG ref; @@ -3687,8 +3760,6 @@ DestroyWindow(window); return; } - hr = IDirect3DDevice3_GetDirect3D(device, &d3d); - ok(SUCCEEDED(hr), "Failed to get IDirect3D3 interface, hr %#x.\n", hr); hr = IDirect3DDevice3_GetRenderTarget(device, &rt); ok(SUCCEEDED(hr), "Failed to get render target, hr %#x.\n", hr); @@ -3697,13 +3768,7 @@ hr = IDirect3DDevice3_SetCurrentViewport(device, viewport); ok(SUCCEEDED(hr), "Failed to set current viewport, hr %#x.\n", hr); - memset(&mat_desc, 0, sizeof(mat_desc)); - mat_desc.dwSize = sizeof(mat_desc); - U2(U3(mat_desc).dcvEmissive).g = 1.0f; - hr = IDirect3D3_CreateMaterial(d3d, &emissive, NULL); - ok(SUCCEEDED(hr), "Failed to create material, hr %#x.\n", hr); - hr = IDirect3DMaterial3_SetMaterial(emissive, &mat_desc); - ok(SUCCEEDED(hr), "Failed to set material, hr %#x.\n", hr); + emissive = create_emissive_material(device, 0.0f, 1.0f, 0.0f, 0.0f); hr = IDirect3DMaterial3_GetHandle(emissive, device, &mat_handle); ok(SUCCEEDED(hr), "Failed to get material handle, hr %#x.\n", hr); hr = IDirect3DDevice3_SetLightState(device, D3DLIGHTSTATE_MATERIAL, mat_handle); @@ -3739,12 +3804,10 @@ color, tests[i].color, i); } - IDirect3DMaterial3_Release(emissive); + destroy_material(emissive); IDirectDrawSurface4_Release(rt); ref = IDirect3DDevice3_Release(device); ok(ref == 0, "Device not properly released, refcount %u.\n", ref); - ref = IDirect3D3_Release(d3d); - ok(ref == 0, "D3d not properly released, refcount %u.\n", ref); DestroyWindow(window); } @@ -4043,6 +4106,8 @@ DWORD supported_fmts = 0, supported_overlay_fmts = 0; DWORD num_fourcc_codes = 0, *fourcc_codes; DDSURFACEDESC2 ddsd; + DDCAPS hal_caps; + static const struct { DWORD fourcc; @@ -4132,12 +4197,19 @@ } HeapFree(GetProcessHeap(), 0, fourcc_codes); + memset(&hal_caps, 0, sizeof(hal_caps)); + hal_caps.dwSize = sizeof(hal_caps); + hr = IDirectDraw4_GetCaps(ddraw, &hal_caps, NULL); + ok(SUCCEEDED(hr), "Failed to get caps, hr %#x.\n", hr); + for (i = 0; i < sizeof(formats) / sizeof(*formats); i++) { for (j = 0; j < sizeof(types) / sizeof(*types); j++) { BOOL support; - if (formats[i].overlay != types[j].overlay) + + if (formats[i].overlay != types[j].overlay + || (types[j].overlay && !(hal_caps.dwCaps & DDCAPS_OVERLAY))) continue; if (formats[i].overlay) @@ -5718,6 +5790,22 @@ hr = IDirectDrawSurface4_SetPalette(primary, palette); ok(SUCCEEDED(hr), "Failed to set palette, hr %#x.\n", hr); + + /* The Windows 8 testbot attaches the palette to the backbuffer as well, + * and is generally somewhat broken with respect to 8 bpp / palette + * handling. */ + if (SUCCEEDED(IDirectDrawSurface4_GetPalette(backbuffer, &tmp))) + { + win_skip("Broken palette handling detected, skipping tests.\n"); + IDirectDrawPalette_Release(tmp); + IDirectDrawPalette_Release(palette); + /* The Windows 8 testbot keeps extra references to the primary and + * backbuffer while in 8 bpp mode. */ + hr = IDirectDraw4_RestoreDisplayMode(ddraw); + ok(SUCCEEDED(hr), "Failed to restore display mode, hr %#x.\n", hr); + goto done; + } + refcount = get_refcount((IUnknown *)palette); ok(refcount == 2, "Got unexpected refcount %u.\n", refcount); @@ -5758,6 +5846,7 @@ hr = IDirectDrawSurface4_GetPalette(primary, &tmp); ok(hr == DDERR_NOPALETTEATTACHED, "Got unexpected hr %#x.\n", hr); +done: refcount = IDirectDrawSurface4_Release(backbuffer); ok(refcount == 1, "Got unexpected refcount %u.\n", refcount); refcount = IDirectDrawSurface4_Release(primary); @@ -6038,13 +6127,30 @@ static void test_private_data(void) { IDirectDraw4 *ddraw; - IDirectDrawSurface4 *surface; + IDirectDrawSurface4 *surface, *surface2; DDSURFACEDESC2 surface_desc; ULONG refcount, refcount2, refcount3; IUnknown *ptr; DWORD size = sizeof(ptr); HRESULT hr; HWND window; + DDSCAPS2 caps = {DDSCAPS_COMPLEX, 0, 0, 0}; + DWORD data[] = {1, 2, 3, 4}; + DDCAPS hal_caps; + static const GUID ddraw_private_data_test_guid = + { + 0xfdb37466, + 0x428f, + 0x4edf, + {0xa3,0x7f,0x9b,0x1d,0xf4,0x88,0xc5,0xfc} + }; + static const GUID ddraw_private_data_test_guid2 = + { + 0x2e5afac2, + 0x87b5, + 0x4c10, + {0x9b,0x4b,0x89,0xd7,0xd1,0x12,0xe7,0x2b} + }; window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW, 0, 0, 640, 480, 0, 0, 0, 0); @@ -6061,48 +6167,100 @@ hr = IDirectDraw4_CreateSurface(ddraw, &surface_desc, &surface, NULL); ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + /* NULL pointers are not valid, but don't cause a crash. */ + hr = IDirectDrawSurface7_SetPrivateData(surface, &ddraw_private_data_test_guid, NULL, + sizeof(IUnknown *), DDSPD_IUNKNOWNPOINTER); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + hr = IDirectDrawSurface7_SetPrivateData(surface, &ddraw_private_data_test_guid, NULL, 0, 0); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + hr = IDirectDrawSurface7_SetPrivateData(surface, &ddraw_private_data_test_guid, NULL, 1, 0); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + /* DDSPD_IUNKNOWNPOINTER needs sizeof(IUnknown *) bytes of data. */ - hr = IDirectDrawSurface4_SetPrivateData(surface, &IID_IDirect3D, ddraw, + hr = IDirectDrawSurface4_SetPrivateData(surface, &ddraw_private_data_test_guid, ddraw, 0, DDSPD_IUNKNOWNPOINTER); ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); - hr = IDirectDrawSurface4_SetPrivateData(surface, &IID_IDirect3D, ddraw, + hr = IDirectDrawSurface4_SetPrivateData(surface, &ddraw_private_data_test_guid, ddraw, 5, DDSPD_IUNKNOWNPOINTER); ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); - hr = IDirectDrawSurface4_SetPrivateData(surface, &IID_IDirect3D, ddraw, + hr = IDirectDrawSurface4_SetPrivateData(surface, &ddraw_private_data_test_guid, ddraw, sizeof(ddraw) * 2, DDSPD_IUNKNOWNPOINTER); ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + /* Note that with a size != 0 and size != sizeof(IUnknown *) and + * DDSPD_IUNKNOWNPOINTER set SetPrivateData in ddraw4 and ddraw7 + * erases the old content and returns an error. This behavior has + * been fixed in d3d8 and d3d9. Unless an application is found + * that depends on this we don't care about this behavior. */ + hr = IDirectDrawSurface4_SetPrivateData(surface, &ddraw_private_data_test_guid, ddraw, + sizeof(ddraw), DDSPD_IUNKNOWNPOINTER); + ok(SUCCEEDED(hr), "Failed to set private data, hr %#x.\n", hr); + hr = IDirectDrawSurface4_SetPrivateData(surface, &ddraw_private_data_test_guid, ddraw, + 0, DDSPD_IUNKNOWNPOINTER); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + size = sizeof(ptr); + hr = IDirectDrawSurface4_GetPrivateData(surface, &ddraw_private_data_test_guid, &ptr, &size); + ok(SUCCEEDED(hr), "Failed to get private data, hr %#x.\n", hr); + hr = IDirectDrawSurface4_FreePrivateData(surface, &ddraw_private_data_test_guid); + ok(SUCCEEDED(hr), "Failed to free private data, hr %#x.\n", hr); + refcount = get_refcount((IUnknown *)ddraw); - hr = IDirectDrawSurface4_SetPrivateData(surface, &IID_IDirect3D, ddraw, + hr = IDirectDrawSurface4_SetPrivateData(surface, &ddraw_private_data_test_guid, ddraw, sizeof(ddraw), DDSPD_IUNKNOWNPOINTER); ok(SUCCEEDED(hr), "Failed to set private data, hr %#x.\n", hr); refcount2 = get_refcount((IUnknown *)ddraw); ok(refcount2 == refcount + 1, "Got unexpected refcount %u.\n", refcount2); - hr = IDirectDrawSurface4_FreePrivateData(surface, &IID_IDirect3D); + hr = IDirectDrawSurface4_FreePrivateData(surface, &ddraw_private_data_test_guid); ok(SUCCEEDED(hr), "Failed to free private data, hr %#x.\n", hr); refcount2 = get_refcount((IUnknown *)ddraw); ok(refcount2 == refcount, "Got unexpected refcount %u.\n", refcount2); - hr = IDirectDrawSurface4_SetPrivateData(surface, &IID_IDirect3D, ddraw, + hr = IDirectDrawSurface4_SetPrivateData(surface, &ddraw_private_data_test_guid, ddraw, sizeof(ddraw), DDSPD_IUNKNOWNPOINTER); ok(SUCCEEDED(hr), "Failed to set private data, hr %#x.\n", hr); - hr = IDirectDrawSurface4_SetPrivateData(surface, &IID_IDirect3D, surface, + hr = IDirectDrawSurface4_SetPrivateData(surface, &ddraw_private_data_test_guid, surface, sizeof(surface), DDSPD_IUNKNOWNPOINTER); ok(SUCCEEDED(hr), "Failed to set private data, hr %#x.\n", hr); refcount2 = get_refcount((IUnknown *)ddraw); ok(refcount2 == refcount, "Got unexpected refcount %u.\n", refcount2); - hr = IDirectDrawSurface4_SetPrivateData(surface, &IID_IDirect3D, ddraw, + hr = IDirectDrawSurface4_SetPrivateData(surface, &ddraw_private_data_test_guid, ddraw, sizeof(ddraw), DDSPD_IUNKNOWNPOINTER); ok(SUCCEEDED(hr), "Failed to set private data, hr %#x.\n", hr); - hr = IDirectDrawSurface4_GetPrivateData(surface, &IID_IDirect3D, &ptr, &size); + size = 2 * sizeof(ptr); + hr = IDirectDrawSurface4_GetPrivateData(surface, &ddraw_private_data_test_guid, &ptr, &size); ok(SUCCEEDED(hr), "Failed to get private data, hr %#x.\n", hr); + ok(size == sizeof(ddraw), "Got unexpected size %u.\n", size); refcount2 = get_refcount(ptr); /* Object is NOT addref'ed by the getter. */ ok(ptr == (IUnknown *)ddraw, "Returned interface pointer is %p, expected %p.\n", ptr, ddraw); ok(refcount2 == refcount + 1, "Got unexpected refcount %u.\n", refcount2); + ptr = (IUnknown *)0xdeadbeef; + size = 1; + hr = IDirectDrawSurface4_GetPrivateData(surface, &ddraw_private_data_test_guid, NULL, &size); + ok(hr == DDERR_MOREDATA, "Got unexpected hr %#x.\n", hr); + ok(size == sizeof(ddraw), "Got unexpected size %u.\n", size); + size = 2 * sizeof(ptr); + hr = IDirectDrawSurface4_GetPrivateData(surface, &ddraw_private_data_test_guid, NULL, &size); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(size == 2 * sizeof(ptr), "Got unexpected size %u.\n", size); + size = 1; + hr = IDirectDrawSurface4_GetPrivateData(surface, &ddraw_private_data_test_guid, &ptr, &size); + ok(hr == DDERR_MOREDATA, "Got unexpected hr %#x.\n", hr); + ok(size == sizeof(ddraw), "Got unexpected size %u.\n", size); + ok(ptr == (IUnknown *)0xdeadbeef, "Got unexpected pointer %p.\n", ptr); + hr = IDirectDrawSurface4_GetPrivateData(surface, &ddraw_private_data_test_guid2, NULL, NULL); + ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#x.\n", hr); + size = 0xdeadbabe; + hr = IDirectDrawSurface4_GetPrivateData(surface, &ddraw_private_data_test_guid2, &ptr, &size); + ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#x.\n", hr); + ok(ptr == (IUnknown *)0xdeadbeef, "Got unexpected pointer %p.\n", ptr); + ok(size == 0xdeadbabe, "Got unexpected size %u.\n", size); + hr = IDirectDrawSurface4_GetPrivateData(surface, &ddraw_private_data_test_guid, NULL, NULL); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + refcount3 = IDirectDrawSurface4_Release(surface); ok(!refcount3, "Got unexpected refcount %u.\n", refcount3); @@ -6111,6 +6269,34 @@ refcount2 = get_refcount((IUnknown *)ddraw); ok(refcount2 == refcount - 1, "Got unexpected refcount %u.\n", refcount2); + memset(&hal_caps, 0, sizeof(hal_caps)); + hal_caps.dwSize = sizeof(hal_caps); + hr = IDirectDraw7_GetCaps(ddraw, &hal_caps, NULL); + ok(SUCCEEDED(hr), "Failed to get caps, hr %#x.\n", hr); + if ((hal_caps.ddsCaps.dwCaps & (DDSCAPS_TEXTURE | DDSCAPS_MIPMAP)) == (DDSCAPS_TEXTURE | DDSCAPS_MIPMAP)) + { + reset_ddsd(&surface_desc); + surface_desc.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_MIPMAPCOUNT; + surface_desc.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY | DDSCAPS_COMPLEX | DDSCAPS_MIPMAP; + surface_desc.dwHeight = 4; + surface_desc.dwWidth = 4; + U2(surface_desc).dwMipMapCount = 2; + hr = IDirectDraw4_CreateSurface(ddraw, &surface_desc, &surface, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + hr = IDirectDrawSurface4_GetAttachedSurface(surface, &caps, &surface2); + ok(SUCCEEDED(hr), "Failed to get attached surface, hr %#x.\n", hr); + + hr = IDirectDrawSurface4_SetPrivateData(surface, &ddraw_private_data_test_guid, data, sizeof(data), 0); + ok(SUCCEEDED(hr), "Failed to set private data, hr %#x.\n", hr); + hr = IDirectDrawSurface4_GetPrivateData(surface2, &ddraw_private_data_test_guid, NULL, NULL); + ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#x.\n", hr); + + IDirectDrawSurface4_Release(surface2); + IDirectDrawSurface4_Release(surface); + } + else + skip("Mipmapped textures not supported, skipping mipmap private data test.\n"); + refcount = IDirectDraw4_Release(ddraw); ok(!refcount, "Got unexpected refcount %u.\n", refcount); DestroyWindow(window); @@ -6296,7 +6482,7 @@ DDSD_PITCH, 0x100}, {DDSCAPS_VIDEOMEMORY, DDSD_PITCH, 0x104, DD_OK, DDSD_PITCH, 0x100}, - {DDSCAPS_VIDEOMEMORY, DDSD_PITCH, 0x0fc, DD_OK, + {DDSCAPS_VIDEOMEMORY, DDSD_PITCH, 0x0f8, DD_OK, DDSD_PITCH, 0x100}, {DDSCAPS_VIDEOMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x100, DDERR_INVALIDCAPS, 0, 0 }, @@ -6304,15 +6490,17 @@ DDSD_PITCH, 0x100}, {DDSCAPS_SYSTEMMEMORY, DDSD_PITCH, 0x104, DD_OK, DDSD_PITCH, 0x100}, - {DDSCAPS_SYSTEMMEMORY, DDSD_PITCH, 0x0fc, DD_OK, + {DDSCAPS_SYSTEMMEMORY, DDSD_PITCH, 0x0f8, DD_OK, DDSD_PITCH, 0x100}, {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE, 0, DDERR_INVALIDPARAMS, 0, 0 }, - {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x104, DD_OK, - DDSD_PITCH, 0x104}, - {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x102, DDERR_INVALIDPARAMS, + {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x100, DD_OK, + DDSD_PITCH, 0x100}, + {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x0fe, DDERR_INVALIDPARAMS, 0, 0 }, - {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x0fc, DDERR_INVALIDPARAMS, + {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x0fc, DD_OK, + DDSD_PITCH, 0x0fc}, + {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x0f8, DDERR_INVALIDPARAMS, 0, 0 }, }; DWORD flags_mask = DDSD_PITCH | DDSD_LPSURFACE; @@ -6324,7 +6512,7 @@ hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); - mem = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, ((64 * 4) + 4) * 64); + mem = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, ((63 * 4) + 8) * 63); for (i = 0; i < sizeof(test_data) / sizeof(*test_data); ++i) { @@ -6332,8 +6520,8 @@ surface_desc.dwSize = sizeof(surface_desc); surface_desc.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT | test_data[i].flags_in; surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | test_data[i].placement; - surface_desc.dwWidth = 64; - surface_desc.dwHeight = 64; + surface_desc.dwWidth = 63; + surface_desc.dwHeight = 63; U1(surface_desc).lPitch = test_data[i].pitch_in; surface_desc.lpSurface = mem; U4(surface_desc).ddpfPixelFormat.dwSize = sizeof(U4(surface_desc).ddpfPixelFormat); @@ -6368,6 +6556,735 @@ DestroyWindow(window); } +static void test_mipmap_lock(void) +{ + IDirectDrawSurface4 *surface, *surface2; + DDSURFACEDESC2 surface_desc; + IDirectDraw4 *ddraw; + ULONG refcount; + HWND window; + HRESULT hr; + DDSCAPS2 caps = {DDSCAPS_COMPLEX, 0, 0, 0}; + DDCAPS hal_caps; + + window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW, + 0, 0, 640, 480, 0, 0, 0, 0); + ddraw = create_ddraw(); + ok(!!ddraw, "Failed to create a ddraw object.\n"); + hr = IDirectDraw4_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + + memset(&hal_caps, 0, sizeof(hal_caps)); + hal_caps.dwSize = sizeof(hal_caps); + hr = IDirectDraw4_GetCaps(ddraw, &hal_caps, NULL); + ok(SUCCEEDED(hr), "Failed to get caps, hr %#x.\n", hr); + if ((hal_caps.ddsCaps.dwCaps & (DDSCAPS_TEXTURE | DDSCAPS_MIPMAP)) != (DDSCAPS_TEXTURE | DDSCAPS_MIPMAP)) + { + skip("Mipmapped textures not supported, skipping mipmap lock test.\n"); + IDirectDraw4_Release(ddraw); + DestroyWindow(window); + return; + } + + memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + surface_desc.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_MIPMAPCOUNT; + surface_desc.dwWidth = 4; + surface_desc.dwHeight = 4; + U2(surface_desc).dwMipMapCount = 2; + surface_desc.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_COMPLEX | DDSCAPS_MIPMAP + | DDSCAPS_SYSTEMMEMORY; + hr = IDirectDraw4_CreateSurface(ddraw, &surface_desc, &surface, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + hr = IDirectDrawSurface4_GetAttachedSurface(surface, &caps, &surface2); + ok(SUCCEEDED(hr), "Failed to get attached surface, hr %#x.\n", hr); + + memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + hr = IDirectDrawSurface4_Lock(surface, NULL, &surface_desc, 0, NULL); + ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x.\n", hr); + memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + hr = IDirectDrawSurface4_Lock(surface2, NULL, &surface_desc, 0, NULL); + ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x.\n", hr); + IDirectDrawSurface4_Unlock(surface2, NULL); + IDirectDrawSurface4_Unlock(surface, NULL); + + IDirectDrawSurface4_Release(surface2); + IDirectDrawSurface4_Release(surface); + refcount = IDirectDraw4_Release(ddraw); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + DestroyWindow(window); +} + +static void test_palette_complex(void) +{ + IDirectDrawSurface4 *surface, *mipmap, *tmp; + DDSURFACEDESC2 surface_desc; + IDirectDraw4 *ddraw; + IDirectDrawPalette *palette, *palette2, *palette_mipmap; + ULONG refcount; + HWND window; + HRESULT hr; + DDSCAPS2 caps = {DDSCAPS_COMPLEX, 0, 0, 0}; + DDCAPS hal_caps; + PALETTEENTRY palette_entries[256]; + unsigned int i; + HDC dc; + RGBQUAD rgbquad; + UINT count; + + window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW, + 0, 0, 640, 480, 0, 0, 0, 0); + ddraw = create_ddraw(); + ok(!!ddraw, "Failed to create a ddraw object.\n"); + hr = IDirectDraw4_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + + memset(&hal_caps, 0, sizeof(hal_caps)); + hal_caps.dwSize = sizeof(hal_caps); + hr = IDirectDraw4_GetCaps(ddraw, &hal_caps, NULL); + ok(SUCCEEDED(hr), "Failed to get caps, hr %#x.\n", hr); + if ((hal_caps.ddsCaps.dwCaps & (DDSCAPS_TEXTURE | DDSCAPS_MIPMAP)) != (DDSCAPS_TEXTURE | DDSCAPS_MIPMAP)) + { + skip("Mipmapped textures not supported, skipping mipmap palette test.\n"); + IDirectDraw4_Release(ddraw); + DestroyWindow(window); + return; + } + + 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.dwWidth = 128; + surface_desc.dwHeight = 128; + surface_desc.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_COMPLEX | DDSCAPS_MIPMAP; + U4(surface_desc).ddpfPixelFormat.dwSize = sizeof(U4(surface_desc).ddpfPixelFormat); + U4(surface_desc).ddpfPixelFormat.dwFlags = DDPF_PALETTEINDEXED8 | DDPF_RGB; + U1(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount = 8; + hr = IDirectDraw4_CreateSurface(ddraw, &surface_desc, &surface, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + + memset(palette_entries, 0, sizeof(palette_entries)); + hr = IDirectDraw4_CreatePalette(ddraw, DDPCAPS_8BIT | DDPCAPS_ALLOW256, + palette_entries, &palette, NULL); + ok(SUCCEEDED(hr), "Failed to create palette, hr %#x.\n", hr); + + memset(palette_entries, 0, sizeof(palette_entries)); + palette_entries[1].peRed = 0xff; + palette_entries[1].peGreen = 0x80; + hr = IDirectDraw4_CreatePalette(ddraw, DDPCAPS_8BIT | DDPCAPS_ALLOW256, + palette_entries, &palette_mipmap, NULL); + ok(SUCCEEDED(hr), "Failed to create palette, hr %#x.\n", hr); + + palette2 = (void *)0xdeadbeef; + hr = IDirectDrawSurface4_GetPalette(surface, &palette2); + ok(hr == DDERR_NOPALETTEATTACHED, "Got unexpected hr %#x.\n", hr); + ok(!palette2, "Got unexpected palette %p.\n", palette2); + hr = IDirectDrawSurface4_SetPalette(surface, palette); + ok(SUCCEEDED(hr), "Failed to set palette, hr %#x.\n", hr); + hr = IDirectDrawSurface4_GetPalette(surface, &palette2); + ok(SUCCEEDED(hr), "Failed to get palette, hr %#x.\n", hr); + ok(palette == palette2, "Got unexpected palette %p.\n", palette2); + IDirectDrawPalette_Release(palette2); + + mipmap = surface; + IDirectDrawSurface4_AddRef(mipmap); + for (i = 0; i < 7; ++i) + { + hr = IDirectDrawSurface4_GetAttachedSurface(mipmap, &caps, &tmp); + ok(SUCCEEDED(hr), "Failed to get attached surface, i %u, hr %#x.\n", i, hr); + palette2 = (void *)0xdeadbeef; + hr = IDirectDrawSurface4_GetPalette(tmp, &palette2); + ok(hr == DDERR_NOPALETTEATTACHED, "Got unexpected hr %#x, i %u.\n", hr, i); + ok(!palette2, "Got unexpected palette %p, i %u.\n", palette2, i); + + hr = IDirectDrawSurface4_SetPalette(tmp, palette_mipmap); + ok(SUCCEEDED(hr), "Failed to set palette, i %u, hr %#x.\n", i, hr); + + hr = IDirectDrawSurface4_GetPalette(tmp, &palette2); + ok(SUCCEEDED(hr), "Failed to get palette, i %u, hr %#x.\n", i, hr); + ok(palette_mipmap == palette2, "Got unexpected palette %p.\n", palette2); + IDirectDrawPalette_Release(palette2); + + hr = IDirectDrawSurface4_GetDC(tmp, &dc); + ok(SUCCEEDED(hr), "Failed to get DC, i %u, hr %#x.\n", i, hr); + count = GetDIBColorTable(dc, 1, 1, &rgbquad); + ok(count == 1, "Expected count 1, got %u.\n", count); + ok(rgbquad.rgbRed == 0xff, "Expected rgbRed = 0xff, got %#x.\n", rgbquad.rgbRed); + ok(rgbquad.rgbGreen == 0x80, "Expected rgbGreen = 0x80, got %#x.\n", rgbquad.rgbGreen); + ok(rgbquad.rgbBlue == 0x0, "Expected rgbBlue = 0x0, got %#x.\n", rgbquad.rgbBlue); + hr = IDirectDrawSurface4_ReleaseDC(tmp, dc); + ok(SUCCEEDED(hr), "Failed to release DC, i %u, hr %#x.\n", i, hr); + + IDirectDrawSurface4_Release(mipmap); + mipmap = tmp; + } + + hr = IDirectDrawSurface4_GetAttachedSurface(mipmap, &caps, &tmp); + ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#x.\n", hr); + IDirectDrawSurface4_Release(mipmap); + refcount = IDirectDrawSurface4_Release(surface); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + refcount = IDirectDrawPalette_Release(palette_mipmap); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + refcount = IDirectDrawPalette_Release(palette); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + + refcount = IDirectDraw4_Release(ddraw); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + DestroyWindow(window); +} + +static void test_p8_rgb_blit(void) +{ + IDirectDrawSurface4 *src, *dst; + DDSURFACEDESC2 surface_desc; + IDirectDraw4 *ddraw; + IDirectDrawPalette *palette; + ULONG refcount; + HWND window; + HRESULT hr; + PALETTEENTRY palette_entries[256]; + unsigned int x; + static const BYTE src_data[] = {0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0xff, 0x80}; + static const D3DCOLOR expected[] = + { + 0x00000000, 0x00010101, 0x00020202, 0x00030303, + 0x00040404, 0x00050505, 0x00ffffff, 0x00808080, + }; + D3DCOLOR color; + + 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(palette_entries, 0, sizeof(palette_entries)); + palette_entries[0].peRed = 0xff; + palette_entries[1].peGreen = 0xff; + palette_entries[2].peBlue = 0xff; + palette_entries[3].peFlags = 0xff; + hr = IDirectDraw4_CreatePalette(ddraw, DDPCAPS_8BIT | DDPCAPS_ALLOW256, + palette_entries, &palette, NULL); + ok(SUCCEEDED(hr), "Failed to create palette, 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; + surface_desc.dwWidth = 8; + surface_desc.dwHeight = 1; + surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; + U4(surface_desc).ddpfPixelFormat.dwSize = sizeof(U4(surface_desc).ddpfPixelFormat); + U4(surface_desc).ddpfPixelFormat.dwFlags = DDPF_PALETTEINDEXED8 | DDPF_RGB; + U1(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount = 8; + hr = IDirectDraw4_CreateSurface(ddraw, &surface_desc, &src, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, 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; + surface_desc.dwWidth = 8; + surface_desc.dwHeight = 1; + surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; + U4(surface_desc).ddpfPixelFormat.dwSize = sizeof(U4(surface_desc).ddpfPixelFormat); + U4(surface_desc).ddpfPixelFormat.dwFlags = DDPF_RGB | DDPF_ALPHAPIXELS; + 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 = 0xff000000; + hr = IDirectDraw4_CreateSurface(ddraw, &surface_desc, &dst, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + + memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + hr = IDirectDrawSurface4_Lock(src, NULL, &surface_desc, 0, NULL); + ok(SUCCEEDED(hr), "Failed to lock source surface, hr %#x.\n", hr); + memcpy(surface_desc.lpSurface, src_data, sizeof(src_data)); + hr = IDirectDrawSurface4_Unlock(src, NULL); + ok(SUCCEEDED(hr), "Failed to unlock source surface, hr %#x.\n", hr); + + hr = IDirectDrawSurface4_SetPalette(src, palette); + ok(SUCCEEDED(hr), "Failed to set palette, hr %#x.\n", hr); + hr = IDirectDrawSurface4_Blt(dst, NULL, src, NULL, DDBLT_WAIT, NULL); + /* The r500 Windows 7 driver returns E_NOTIMPL. r200 on Windows XP works. + * The Geforce 7 driver on Windows Vista returns E_FAIL. Newer Nvidia GPUs work. */ + ok(SUCCEEDED(hr) || broken(hr == E_NOTIMPL) || broken(hr == E_FAIL), + "Failed to blit, hr %#x.\n", hr); + + if (SUCCEEDED(hr)) + { + for (x = 0; x < sizeof(expected) / sizeof(*expected); x++) + { + color = get_surface_color(dst, x, 0); + todo_wine ok(compare_color(color, expected[x], 0), + "Pixel %u: Got color %#x, expected %#x.\n", + x, color, expected[x]); + } + } + + IDirectDrawSurface4_Release(src); + IDirectDrawSurface4_Release(dst); + IDirectDrawPalette_Release(palette); + + refcount = IDirectDraw4_Release(ddraw); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + DestroyWindow(window); +} + +static void test_material(void) +{ + D3DMATERIALHANDLE mat_handle, tmp; + IDirect3DMaterial3 *material; + IDirect3DViewport3 *viewport; + IDirect3DDevice3 *device; + IDirectDrawSurface4 *rt; + D3DCOLOR color; + ULONG refcount; + unsigned int i; + HWND window; + HRESULT hr; + BOOL valid; + + static struct + { + struct vec3 position; + struct vec3 normal; + D3DCOLOR diffuse; + } + quad1[] = + { + {{-1.0f, -1.0f, 0.0f}, {1.0f, 0.0f, 0.0f}, 0xffffffff}, + {{-1.0f, 1.0f, 0.0f}, {1.0f, 0.0f, 0.0f}, 0xffffffff}, + {{ 1.0f, -1.0f, 0.0f}, {1.0f, 0.0f, 0.0f}, 0xffffffff}, + {{ 1.0f, 1.0f, 0.0f}, {1.0f, 0.0f, 0.0f}, 0xffffffff}, + }, + quad2[] = + { + {{-1.0f, -1.0f, 0.0f}, {1.0f, 0.0f, 0.0f}, 0xffff0000}, + {{-1.0f, 1.0f, 0.0f}, {1.0f, 0.0f, 0.0f}, 0xffff0000}, + {{ 1.0f, -1.0f, 0.0f}, {1.0f, 0.0f, 0.0f}, 0xffff0000}, + {{ 1.0f, 1.0f, 0.0f}, {1.0f, 0.0f, 0.0f}, 0xffff0000}, + }; + static const struct + { + void *data; + BOOL material; + D3DCOLOR expected_color; + } + test_data[] = + { + {quad1, TRUE, 0x0000ff00}, + {quad2, TRUE, 0x0000ff00}, + {quad1, FALSE, 0x00ffffff}, + {quad2, FALSE, 0x00ff0000}, + }; + static D3DRECT clear_rect = {{0}, {0}, {640}, {480}}; + + 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_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); + + material = create_emissive_material(device, 0.0f, 1.0f, 0.0f, 0.0f); + hr = IDirect3DMaterial3_GetHandle(material, device, &mat_handle); + ok(SUCCEEDED(hr), "Failed to get material handle, hr %#x.\n", hr); + + hr = IDirect3DDevice3_GetLightState(device, D3DLIGHTSTATE_MATERIAL, &tmp); + ok(SUCCEEDED(hr), "Failed to get light state, hr %#x.\n", hr); + ok(!tmp, "Got unexpected material handle %#x.\n", tmp); + hr = IDirect3DDevice3_SetLightState(device, D3DLIGHTSTATE_MATERIAL, mat_handle); + ok(SUCCEEDED(hr), "Failed to set material state, hr %#x.\n", hr); + hr = IDirect3DDevice3_GetLightState(device, D3DLIGHTSTATE_MATERIAL, &tmp); + ok(SUCCEEDED(hr), "Failed to get light state, hr %#x.\n", hr); + ok(tmp == mat_handle, "Got unexpected material handle %#x, expected %#x.\n", tmp, mat_handle); + hr = IDirect3DDevice3_SetLightState(device, D3DLIGHTSTATE_MATERIAL, 0); + ok(SUCCEEDED(hr), "Failed to set material state, hr %#x.\n", hr); + hr = IDirect3DDevice3_GetLightState(device, D3DLIGHTSTATE_MATERIAL, &tmp); + ok(SUCCEEDED(hr), "Failed to get light state, hr %#x.\n", hr); + ok(!tmp, "Got unexpected material handle %#x.\n", tmp); + + for (i = 0; i < sizeof(test_data) / sizeof(*test_data); ++i) + { + hr = IDirect3DViewport3_Clear2(viewport, 1, &clear_rect, + D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0xff0000ff, 1.0f, 0); + ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#x.\n", hr); + + hr = IDirect3DDevice3_SetLightState(device, D3DLIGHTSTATE_MATERIAL, test_data[i].material ? mat_handle : 0); + ok(SUCCEEDED(hr), "Failed to set material state, hr %#x.\n", hr); + + hr = IDirect3DDevice3_BeginScene(device); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice2_DrawPrimitive(device, D3DPT_TRIANGLESTRIP, + D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_DIFFUSE, test_data[i].data, 4, 0); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice3_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + color = get_surface_color(rt, 320, 240); + ok(compare_color(color, test_data[i].expected_color, 1), + "Got unexpected color 0x%08x, test %u.\n", color, i); + } + + destroy_material(material); + material = create_diffuse_material(device, 1.0f, 0.0f, 0.0f, 1.0f); + hr = IDirect3DMaterial3_GetHandle(material, device, &mat_handle); + ok(SUCCEEDED(hr), "Failed to get material handle, hr %#x.\n", hr); + + hr = IDirect3DViewport3_SetBackground(viewport, mat_handle); + ok(SUCCEEDED(hr), "Failed to set viewport background, hr %#x.\n", hr); + hr = IDirect3DViewport3_GetBackground(viewport, &tmp, &valid); + ok(SUCCEEDED(hr), "Failed to get viewport background, hr %#x.\n", hr); + ok(tmp == mat_handle, "Got unexpected material handle %#x, expected %#x.\n", tmp, mat_handle); + ok(valid, "Got unexpected valid %#x.\n", valid); + hr = IDirect3DViewport3_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET); + ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#x.\n", hr); + color = get_surface_color(rt, 320, 240); + ok(compare_color(color, 0x00ff0000, 1), "Got unexpected color 0x%08x.\n", color); + + hr = IDirect3DViewport3_SetBackground(viewport, 0); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DViewport3_GetBackground(viewport, &tmp, &valid); + ok(SUCCEEDED(hr), "Failed to get viewport background, hr %#x.\n", hr); + ok(tmp == mat_handle, "Got unexpected material handle %#x, expected %#x.\n", tmp, mat_handle); + ok(valid, "Got unexpected valid %#x.\n", valid); + hr = IDirect3DViewport3_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET); + ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#x.\n", hr); + color = get_surface_color(rt, 320, 240); + ok(compare_color(color, 0x00ff0000, 1), "Got unexpected color 0x%08x.\n", color); + + destroy_viewport(device, viewport); + viewport = create_viewport(device, 0, 0, 640, 480); + + hr = IDirect3DViewport3_GetBackground(viewport, &tmp, &valid); + ok(SUCCEEDED(hr), "Failed to get viewport background, hr %#x.\n", hr); + ok(!tmp, "Got unexpected material handle %#x.\n", tmp); + ok(!valid, "Got unexpected valid %#x.\n", valid); + hr = IDirect3DViewport3_Clear(viewport, 1, &clear_rect, D3DCLEAR_TARGET); + ok(SUCCEEDED(hr), "Failed to clear viewport, hr %#x.\n", hr); + color = get_surface_color(rt, 320, 240); + ok(compare_color(color, 0x00000000, 1), "Got unexpected color 0x%08x.\n", color); + + destroy_viewport(device, viewport); + destroy_material(material); + IDirectDrawSurface4_Release(rt); + refcount = IDirect3DDevice3_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + DestroyWindow(window); +} + +static void test_palette_gdi(void) +{ + IDirectDrawSurface4 *surface, *primary; + DDSURFACEDESC2 surface_desc; + IDirectDraw4 *ddraw; + IDirectDrawPalette *palette, *palette2; + ULONG refcount; + HWND window; + HRESULT hr; + PALETTEENTRY palette_entries[256]; + UINT i; + HDC dc; + /* On the Windows 8 testbot palette index 0 of the onscreen palette is forced to + * r = 0, g = 0, b = 0. Do not attempt to set it to something else as this is + * not the point of this test. */ + static const RGBQUAD expected1[] = + { + {0x00, 0x00, 0x00, 0x00}, {0x00, 0x00, 0x01, 0x00}, {0x00, 0x02, 0x00, 0x00}, + {0x03, 0x00, 0x00, 0x00}, {0x15, 0x14, 0x13, 0x00}, + }; + static const RGBQUAD expected2[] = + { + {0x00, 0x00, 0x00, 0x00}, {0x00, 0x00, 0x01, 0x00}, {0x00, 0x02, 0x00, 0x00}, + {0x03, 0x00, 0x00, 0x00}, {0x25, 0x24, 0x23, 0x00}, + }; + static const RGBQUAD expected3[] = + { + {0x00, 0x00, 0x00, 0x00}, {0x40, 0x00, 0x00, 0x00}, {0x00, 0x00, 0x40, 0x00}, + {0x00, 0x40, 0x00, 0x00}, {0x56, 0x34, 0x12, 0x00}, + }; + HPALETTE ddraw_palette_handle; + /* Similar to index 0, index 255 is r = 0xff, g = 0xff, b = 0xff on the Win8 VMs. */ + RGBQUAD rgbquad[255]; + static const RGBQUAD rgb_zero = {0, 0, 0, 0}; + + 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; + surface_desc.dwWidth = 16; + surface_desc.dwHeight = 16; + surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; + U4(surface_desc).ddpfPixelFormat.dwSize = sizeof(U4(surface_desc).ddpfPixelFormat); + U4(surface_desc).ddpfPixelFormat.dwFlags = DDPF_PALETTEINDEXED8 | DDPF_RGB; + U1(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount = 8; + hr = IDirectDraw4_CreateSurface(ddraw, &surface_desc, &surface, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + + /* Avoid colors from the Windows default palette. */ + memset(palette_entries, 0, sizeof(palette_entries)); + palette_entries[1].peRed = 0x01; + palette_entries[2].peGreen = 0x02; + palette_entries[3].peBlue = 0x03; + palette_entries[4].peRed = 0x13; + palette_entries[4].peGreen = 0x14; + palette_entries[4].peBlue = 0x15; + hr = IDirectDraw4_CreatePalette(ddraw, DDPCAPS_8BIT | DDPCAPS_ALLOW256, + palette_entries, &palette, NULL); + ok(SUCCEEDED(hr), "Failed to create palette, hr %#x.\n", hr); + + /* If there is no palette assigned and the display mode is not 8 bpp, some + * drivers refuse to create a DC while others allow it. If a DC is created, + * the DIB color table is uninitialized and contains random colors. No error + * is generated when trying to read pixels and random garbage is returned. + * + * The most likely explanation is that if the driver creates a DC, it (or + * the higher-level runtime) uses GetSystemPaletteEntries to find the + * palette, but GetSystemPaletteEntries fails when bpp > 8 and the palette + * contains uninitialized garbage. See comments below for the P8 case. */ + + hr = IDirectDrawSurface4_SetPalette(surface, palette); + ok(SUCCEEDED(hr), "Failed to set palette, hr %#x.\n", hr); + hr = IDirectDrawSurface4_GetDC(surface, &dc); + ok(SUCCEEDED(hr), "Failed to get DC, hr %#x.\n", hr); + ddraw_palette_handle = SelectPalette(dc, GetStockObject(DEFAULT_PALETTE), FALSE); + ok(ddraw_palette_handle == GetStockObject(DEFAULT_PALETTE), + "Got unexpected palette %p, expected %p.\n", + ddraw_palette_handle, GetStockObject(DEFAULT_PALETTE)); + + i = GetDIBColorTable(dc, 0, sizeof(rgbquad) / sizeof(*rgbquad), rgbquad); + ok(i == sizeof(rgbquad) / sizeof(*rgbquad), "Expected count 255, got %u.\n", i); + for (i = 0; i < sizeof(expected1) / sizeof(*expected1); i++) + { + ok(!memcmp(&rgbquad[i], &expected1[i], sizeof(rgbquad[i])), + "Got color table entry %u r=%#x g=%#x b=%#x, expected r=%#x g=%#x b=%#x.\n", + i, rgbquad[i].rgbRed, rgbquad[i].rgbGreen, rgbquad[i].rgbBlue, + expected1[i].rgbRed, expected1[i].rgbGreen, expected1[i].rgbBlue); + } + for (; i < sizeof(rgbquad) / sizeof(*rgbquad); i++) + { + ok(!memcmp(&rgbquad[i], &rgb_zero, sizeof(rgbquad[i])), + "Got color table entry %u r=%#x g=%#x b=%#x, expected r=0 g=0 b=0.\n", + i, rgbquad[i].rgbRed, rgbquad[i].rgbGreen, rgbquad[i].rgbBlue); + } + + /* Update the palette while the DC is in use. This does not modify the DC. */ + palette_entries[4].peRed = 0x23; + palette_entries[4].peGreen = 0x24; + palette_entries[4].peBlue = 0x25; + hr = IDirectDrawPalette_SetEntries(palette, 0, 4, 1, &palette_entries[4]); + ok(SUCCEEDED(hr), "Failed to set palette entries, hr %#x.\n", hr); + + i = GetDIBColorTable(dc, 4, 1, &rgbquad[4]); + ok(i == 1, "Expected count 1, got %u.\n", i); + todo_wine ok(!memcmp(&rgbquad[4], &expected1[4], sizeof(rgbquad[4])), + "Got color table entry %u r=%#x g=%#x b=%#x, expected r=%#x g=%#x b=%#x.\n", + i, rgbquad[4].rgbRed, rgbquad[4].rgbGreen, rgbquad[4].rgbBlue, + expected1[4].rgbRed, expected1[4].rgbGreen, expected1[4].rgbBlue); + + /* Neither does re-setting the palette. */ + hr = IDirectDrawSurface4_SetPalette(surface, NULL); + ok(SUCCEEDED(hr), "Failed to set palette, hr %#x.\n", hr); + hr = IDirectDrawSurface4_SetPalette(surface, palette); + ok(SUCCEEDED(hr), "Failed to set palette, hr %#x.\n", hr); + + i = GetDIBColorTable(dc, 4, 1, &rgbquad[4]); + ok(i == 1, "Expected count 1, got %u.\n", i); + todo_wine ok(!memcmp(&rgbquad[4], &expected1[4], sizeof(rgbquad[4])), + "Got color table entry %u r=%#x g=%#x b=%#x, expected r=%#x g=%#x b=%#x.\n", + i, rgbquad[4].rgbRed, rgbquad[4].rgbGreen, rgbquad[4].rgbBlue, + expected1[4].rgbRed, expected1[4].rgbGreen, expected1[4].rgbBlue); + + hr = IDirectDrawSurface4_ReleaseDC(surface, dc); + ok(SUCCEEDED(hr), "Failed to release DC, hr %#x.\n", hr); + + /* Refresh the DC. This updates the palette. */ + hr = IDirectDrawSurface4_GetDC(surface, &dc); + ok(SUCCEEDED(hr), "Failed to get DC, hr %#x.\n", hr); + i = GetDIBColorTable(dc, 0, sizeof(rgbquad) / sizeof(*rgbquad), rgbquad); + ok(i == sizeof(rgbquad) / sizeof(*rgbquad), "Expected count 255, got %u.\n", i); + for (i = 0; i < sizeof(expected2) / sizeof(*expected2); i++) + { + ok(!memcmp(&rgbquad[i], &expected2[i], sizeof(rgbquad[i])), + "Got color table entry %u r=%#x g=%#x b=%#x, expected r=%#x g=%#x b=%#x.\n", + i, rgbquad[i].rgbRed, rgbquad[i].rgbGreen, rgbquad[i].rgbBlue, + expected2[i].rgbRed, expected2[i].rgbGreen, expected2[i].rgbBlue); + } + for (; i < sizeof(rgbquad) / sizeof(*rgbquad); i++) + { + ok(!memcmp(&rgbquad[i], &rgb_zero, sizeof(rgbquad[i])), + "Got color table entry %u r=%#x g=%#x b=%#x, expected r=0 g=0 b=0.\n", + i, rgbquad[i].rgbRed, rgbquad[i].rgbGreen, rgbquad[i].rgbBlue); + } + hr = IDirectDrawSurface4_ReleaseDC(surface, dc); + ok(SUCCEEDED(hr), "Failed to release DC, hr %#x.\n", hr); + + refcount = IDirectDrawSurface4_Release(surface); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + + if (FAILED(hr = IDirectDraw4_SetDisplayMode(ddraw, 640, 480, 8, 0, 0))) + { + win_skip("Failed to set 8 bpp display mode, skipping test.\n"); + IDirectDrawPalette_Release(palette); + IDirectDraw4_Release(ddraw); + DestroyWindow(window); + return; + } + ok(SUCCEEDED(hr), "Failed to set display mode, hr %#x.\n", hr); + hr = IDirectDraw4_SetCooperativeLevel(ddraw, window, DDSCL_FULLSCREEN | DDSCL_EXCLUSIVE); + 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; + surface_desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; + hr = IDirectDraw4_CreateSurface(ddraw, &surface_desc, &primary, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + + hr = IDirectDrawSurface4_SetPalette(primary, palette); + ok(SUCCEEDED(hr), "Failed to set palette, hr %#x.\n", hr); + hr = IDirectDrawSurface4_GetDC(primary, &dc); + ok(SUCCEEDED(hr), "Failed to get DC, hr %#x.\n", hr); + ddraw_palette_handle = SelectPalette(dc, GetStockObject(DEFAULT_PALETTE), FALSE); + /* Windows 2000 on the testbot assigns a different palette to the primary. Refrast? */ + ok(ddraw_palette_handle == GetStockObject(DEFAULT_PALETTE) || broken(TRUE), + "Got unexpected palette %p, expected %p.\n", + ddraw_palette_handle, GetStockObject(DEFAULT_PALETTE)); + SelectPalette(dc, ddraw_palette_handle, FALSE); + + /* The primary uses the system palette. In exclusive mode, the system palette matches + * the ddraw palette attached to the primary, so the result is what you would expect + * from a regular surface. Tests for the interaction between the ddraw palette and + * the system palette are not included pending an application that depends on this. + * The relation between those causes problems on Windows Vista and newer for games + * like Age of Empires or Starcraft. Don't emulate it without a real need. */ + i = GetDIBColorTable(dc, 0, sizeof(rgbquad) / sizeof(*rgbquad), rgbquad); + ok(i == sizeof(rgbquad) / sizeof(*rgbquad), "Expected count 255, got %u.\n", i); + for (i = 0; i < sizeof(expected2) / sizeof(*expected2); i++) + { + ok(!memcmp(&rgbquad[i], &expected2[i], sizeof(rgbquad[i])), + "Got color table entry %u r=%#x g=%#x b=%#x, expected r=%#x g=%#x b=%#x.\n", + i, rgbquad[i].rgbRed, rgbquad[i].rgbGreen, rgbquad[i].rgbBlue, + expected2[i].rgbRed, expected2[i].rgbGreen, expected2[i].rgbBlue); + } + for (; i < sizeof(rgbquad) / sizeof(*rgbquad); i++) + { + ok(!memcmp(&rgbquad[i], &rgb_zero, sizeof(rgbquad[i])), + "Got color table entry %u r=%#x g=%#x b=%#x, expected r=0 g=0 b=0.\n", + i, rgbquad[i].rgbRed, rgbquad[i].rgbGreen, rgbquad[i].rgbBlue); + } + hr = IDirectDrawSurface4_ReleaseDC(primary, dc); + ok(SUCCEEDED(hr), "Failed to release DC, 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; + surface_desc.dwWidth = 16; + surface_desc.dwHeight = 16; + surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; + hr = IDirectDraw4_CreateSurface(ddraw, &surface_desc, &surface, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + + /* Here the offscreen surface appears to use the primary's palette, + * but in all likelyhood it is actually the system palette. */ + hr = IDirectDrawSurface4_GetDC(surface, &dc); + ok(SUCCEEDED(hr), "Failed to get DC, hr %#x.\n", hr); + i = GetDIBColorTable(dc, 0, sizeof(rgbquad) / sizeof(*rgbquad), rgbquad); + ok(i == sizeof(rgbquad) / sizeof(*rgbquad), "Expected count 255, got %u.\n", i); + for (i = 0; i < sizeof(expected2) / sizeof(*expected2); i++) + { + ok(!memcmp(&rgbquad[i], &expected2[i], sizeof(rgbquad[i])), + "Got color table entry %u r=%#x g=%#x b=%#x, expected r=%#x g=%#x b=%#x.\n", + i, rgbquad[i].rgbRed, rgbquad[i].rgbGreen, rgbquad[i].rgbBlue, + expected2[i].rgbRed, expected2[i].rgbGreen, expected2[i].rgbBlue); + } + for (; i < sizeof(rgbquad) / sizeof(*rgbquad); i++) + { + ok(!memcmp(&rgbquad[i], &rgb_zero, sizeof(rgbquad[i])), + "Got color table entry %u r=%#x g=%#x b=%#x, expected r=0 g=0 b=0.\n", + i, rgbquad[i].rgbRed, rgbquad[i].rgbGreen, rgbquad[i].rgbBlue); + } + hr = IDirectDrawSurface4_ReleaseDC(surface, dc); + ok(SUCCEEDED(hr), "Failed to release DC, hr %#x.\n", hr); + + /* On real hardware a change to the primary surface's palette applies immediately, + * even on device contexts from offscreen surfaces that do not have their own + * palette. On the testbot VMs this is not the case. Don't test this until we + * know of an application that depends on this. */ + + memset(palette_entries, 0, sizeof(palette_entries)); + palette_entries[1].peBlue = 0x40; + palette_entries[2].peRed = 0x40; + palette_entries[3].peGreen = 0x40; + palette_entries[4].peRed = 0x12; + palette_entries[4].peGreen = 0x34; + palette_entries[4].peBlue = 0x56; + hr = IDirectDraw4_CreatePalette(ddraw, DDPCAPS_8BIT | DDPCAPS_ALLOW256, + palette_entries, &palette2, NULL); + ok(SUCCEEDED(hr), "Failed to create palette, hr %#x.\n", hr); + hr = IDirectDrawSurface4_SetPalette(surface, palette2); + ok(SUCCEEDED(hr), "Failed to set palette, hr %#x.\n", hr); + + /* A palette assigned to the offscreen surface overrides the primary / system + * palette. */ + hr = IDirectDrawSurface4_GetDC(surface, &dc); + ok(SUCCEEDED(hr), "Failed to get DC, hr %#x.\n", hr); + i = GetDIBColorTable(dc, 0, sizeof(rgbquad) / sizeof(*rgbquad), rgbquad); + ok(i == sizeof(rgbquad) / sizeof(*rgbquad), "Expected count 255, got %u.\n", i); + for (i = 0; i < sizeof(expected3) / sizeof(*expected3); i++) + { + ok(!memcmp(&rgbquad[i], &expected3[i], sizeof(rgbquad[i])), + "Got color table entry %u r=%#x g=%#x b=%#x, expected r=%#x g=%#x b=%#x.\n", + i, rgbquad[i].rgbRed, rgbquad[i].rgbGreen, rgbquad[i].rgbBlue, + expected3[i].rgbRed, expected3[i].rgbGreen, expected3[i].rgbBlue); + } + for (; i < sizeof(rgbquad) / sizeof(*rgbquad); i++) + { + ok(!memcmp(&rgbquad[i], &rgb_zero, sizeof(rgbquad[i])), + "Got color table entry %u r=%#x g=%#x b=%#x, expected r=0 g=0 b=0.\n", + i, rgbquad[i].rgbRed, rgbquad[i].rgbGreen, rgbquad[i].rgbBlue); + } + hr = IDirectDrawSurface4_ReleaseDC(surface, dc); + ok(SUCCEEDED(hr), "Failed to release DC, hr %#x.\n", hr); + + refcount = IDirectDrawSurface4_Release(surface); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + + /* The Windows 8 testbot keeps extra references to the primary and + * backbuffer while in 8 bpp mode. */ + hr = IDirectDraw4_RestoreDisplayMode(ddraw); + ok(SUCCEEDED(hr), "Failed to restore display mode, hr %#x.\n", hr); + + refcount = IDirectDrawSurface4_Release(primary); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + refcount = IDirectDrawPalette_Release(palette2); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + refcount = IDirectDrawPalette_Release(palette); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + refcount = IDirectDraw4_Release(ddraw); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + DestroyWindow(window); +} + START_TEST(ddraw4) { IDirectDraw4 *ddraw; @@ -6424,4 +7341,9 @@ test_private_data(); test_pixel_format(); test_create_surface_pitch(); + test_mipmap_lock(); + test_palette_complex(); + test_p8_rgb_blit(); + test_material(); + test_palette_gdi(); } diff -Nru wine1.7-1.7.14/dlls/ddraw/tests/ddraw7.c wine1.7-1.7.18/dlls/ddraw/tests/ddraw7.c --- wine1.7-1.7.14/dlls/ddraw/tests/ddraw7.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/ddraw/tests/ddraw7.c 2014-05-02 18:15:48.000000000 +0000 @@ -670,6 +670,21 @@ 0x00000000, 0x00000000, 0x00ff0000, 0x00ffffff, 0x00000000, 0x00000000, 0x00ff0000, 0x00ffffff, }; + /* Nvidia on Windows seems to have an off-by-one error + * when processing source rectangles. Our left = 1 and + * right = 5 input reads from x = {1, 2, 3}. x = 4 is + * read as well, but only for the edge pixels on the + * output image. The bug happens on the y axis as well, + * but we only read one row there, and all source rows + * contain the same data. This bug is not dependent on + * the presence of a clipper. */ + static const D3DCOLOR expected1_broken[] = + { + 0x000000ff, 0x000000ff, 0x00000000, 0x00000000, + 0x000000ff, 0x000000ff, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00ff0000, 0x00ff0000, + 0x00000000, 0x00000000, 0x0000ff00, 0x00ff0000, + }; static const D3DCOLOR expected2[] = { 0x000000ff, 0x000000ff, 0x00000000, 0x00000000, @@ -783,7 +798,8 @@ x = 80 * ((2 * j) + 1); y = 60 * ((2 * i) + 1); color = get_surface_color(dst_surface, x, y); - ok(compare_color(color, expected1[i * 4 + j], 1), + ok(compare_color(color, expected1[i * 4 + j], 1) + || broken(compare_color(color, expected1_broken[i * 4 + j], 1)), "Expected color 0x%08x at %u,%u, got 0x%08x.\n", expected1[i * 4 + j], x, y, color); } } @@ -2158,6 +2174,7 @@ HWND window, window2; HRESULT hr; ULONG ref; + MSG msg; static const UINT exclusive_messages[] = { @@ -2219,6 +2236,7 @@ fullscreen_rect.left, fullscreen_rect.top, fullscreen_rect.right, fullscreen_rect.bottom, r.left, r.top, r.right, r.bottom); + PeekMessageA(&msg, 0, 0, 0, PM_NOREMOVE); expect_messages = exclusive_messages; screen_size.cx = 0; screen_size.cy = 0; @@ -2264,6 +2282,7 @@ s.left, s.top, s.right, s.bottom, r.left, r.top, r.right, r.bottom); + PeekMessageA(&msg, 0, 0, 0, PM_NOREMOVE); expect_messages = exclusive_messages; screen_size.cx = 0; screen_size.cy = 0; @@ -2344,6 +2363,7 @@ fullscreen_rect.left, fullscreen_rect.top, fullscreen_rect.right, fullscreen_rect.bottom, r.left, r.top, r.right, r.bottom); + PeekMessageA(&msg, 0, 0, 0, PM_NOREMOVE); expect_messages = normal_messages; screen_size.cx = 0; screen_size.cy = 0; @@ -2387,6 +2407,7 @@ fullscreen_rect.left, fullscreen_rect.top, fullscreen_rect.right, fullscreen_rect.bottom, r.left, r.top, r.right, r.bottom); + PeekMessageA(&msg, 0, 0, 0, PM_NOREMOVE); expect_messages = normal_messages; screen_size.cx = 0; screen_size.cy = 0; @@ -2468,6 +2489,7 @@ fullscreen_rect.left, fullscreen_rect.top, fullscreen_rect.right, fullscreen_rect.bottom, r.left, r.top, r.right, r.bottom); + PeekMessageA(&msg, 0, 0, 0, PM_NOREMOVE); expect_messages = normal_messages; screen_size.cx = 0; screen_size.cy = 0; @@ -2511,6 +2533,7 @@ fullscreen_rect.left, fullscreen_rect.top, fullscreen_rect.right, fullscreen_rect.bottom, r.left, r.top, r.right, r.bottom); + PeekMessageA(&msg, 0, 0, 0, PM_NOREMOVE); expect_messages = normal_messages; screen_size.cx = 0; screen_size.cy = 0; @@ -2561,6 +2584,7 @@ hr = set_display_mode(ddraw, 640, 480); ok(SUCCEEDED(hr), "Failed to set display mode, hr %#x.\n", hr); + PeekMessageA(&msg, 0, 0, 0, PM_NOREMOVE); expect_messages = exclusive_messages; screen_size.cx = 0; screen_size.cy = 0; @@ -2627,6 +2651,7 @@ hr = set_display_mode(ddraw, 640, 480); ok(SUCCEEDED(hr), "Failed to set display mode, hr %#x.\n", hr); + PeekMessageA(&msg, 0, 0, 0, PM_NOREMOVE); expect_messages = exclusive_messages; screen_size.cx = 0; screen_size.cy = 0; @@ -3850,6 +3875,8 @@ DWORD supported_fmts = 0, supported_overlay_fmts = 0; DWORD num_fourcc_codes = 0, *fourcc_codes; DDSURFACEDESC2 ddsd; + DDCAPS hal_caps; + static const struct { DWORD fourcc; @@ -3939,12 +3966,19 @@ } HeapFree(GetProcessHeap(), 0, fourcc_codes); + memset(&hal_caps, 0, sizeof(hal_caps)); + hal_caps.dwSize = sizeof(hal_caps); + hr = IDirectDraw7_GetCaps(ddraw, &hal_caps, NULL); + ok(SUCCEEDED(hr), "Failed to get caps, hr %#x.\n", hr); + for (i = 0; i < sizeof(formats) / sizeof(*formats); i++) { for (j = 0; j < sizeof(types) / sizeof(*types); j++) { BOOL support; - if (formats[i].overlay != types[j].overlay) + + if (formats[i].overlay != types[j].overlay + || (types[j].overlay && !(hal_caps.dwCaps & DDCAPS_OVERLAY))) continue; if (formats[i].overlay) @@ -5564,7 +5598,13 @@ 0, 0, 640, 480, 0, 0, 0, 0); ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); - hr = IDirectDraw7_SetDisplayMode(ddraw, 640, 480, 8, 0, 0); + if (FAILED(hr = IDirectDraw7_SetDisplayMode(ddraw, 640, 480, 8, 0, 0))) + { + win_skip("Failed to set 8 bpp display mode, skipping test.\n"); + IDirectDraw7_Release(ddraw); + DestroyWindow(window); + return; + } ok(SUCCEEDED(hr), "Failed to set display mode, hr %#x.\n", hr); hr = IDirectDraw7_SetCooperativeLevel(ddraw, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); @@ -5591,6 +5631,22 @@ hr = IDirectDrawSurface7_SetPalette(primary, palette); ok(SUCCEEDED(hr), "Failed to set palette, hr %#x.\n", hr); + + /* The Windows 8 testbot attaches the palette to the backbuffer as well, + * and is generally somewhat broken with respect to 8 bpp / palette + * handling. */ + if (SUCCEEDED(IDirectDrawSurface7_GetPalette(backbuffer, &tmp))) + { + win_skip("Broken palette handling detected, skipping tests.\n"); + IDirectDrawPalette_Release(tmp); + IDirectDrawPalette_Release(palette); + /* The Windows 8 testbot keeps extra references to the primary and + * backbuffer while in 8 bpp mode. */ + hr = IDirectDraw7_RestoreDisplayMode(ddraw); + ok(SUCCEEDED(hr), "Failed to restore display mode, hr %#x.\n", hr); + goto done; + } + refcount = get_refcount((IUnknown *)palette); ok(refcount == 2, "Got unexpected refcount %u.\n", refcount); @@ -5631,6 +5687,7 @@ hr = IDirectDrawSurface7_GetPalette(primary, &tmp); ok(hr == DDERR_NOPALETTEATTACHED, "Got unexpected hr %#x.\n", hr); +done: refcount = IDirectDrawSurface7_Release(backbuffer); ok(refcount == 1, "Got unexpected refcount %u.\n", refcount); refcount = IDirectDrawSurface7_Release(primary); @@ -5893,13 +5950,30 @@ static void test_private_data(void) { IDirectDraw7 *ddraw; - IDirectDrawSurface7 *surface; + IDirectDrawSurface7 *surface, *surface2; DDSURFACEDESC2 surface_desc; ULONG refcount, refcount2, refcount3; IUnknown *ptr; DWORD size = sizeof(ptr); HRESULT hr; HWND window; + DDSCAPS2 caps = {DDSCAPS_COMPLEX, 0, 0, 0}; + DWORD data[] = {1, 2, 3, 4}; + DDCAPS hal_caps; + static const GUID ddraw_private_data_test_guid = + { + 0xfdb37466, + 0x428f, + 0x4edf, + {0xa3,0x7f,0x9b,0x1d,0xf4,0x88,0xc5,0xfc} + }; + static const GUID ddraw_private_data_test_guid2 = + { + 0x2e5afac2, + 0x87b5, + 0x4c10, + {0x9b,0x4b,0x89,0xd7,0xd1,0x12,0xe7,0x2b} + }; window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW, 0, 0, 640, 480, 0, 0, 0, 0); @@ -5916,48 +5990,100 @@ hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &surface, NULL); ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + /* NULL pointers are not valid, but don't cause a crash. */ + hr = IDirectDrawSurface7_SetPrivateData(surface, &ddraw_private_data_test_guid, NULL, + sizeof(IUnknown *), DDSPD_IUNKNOWNPOINTER); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + hr = IDirectDrawSurface7_SetPrivateData(surface, &ddraw_private_data_test_guid, NULL, 0, 0); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + hr = IDirectDrawSurface7_SetPrivateData(surface, &ddraw_private_data_test_guid, NULL, 1, 0); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + /* DDSPD_IUNKNOWNPOINTER needs sizeof(IUnknown *) bytes of data. */ - hr = IDirectDrawSurface7_SetPrivateData(surface, &IID_IDirect3D, ddraw, + hr = IDirectDrawSurface7_SetPrivateData(surface, &ddraw_private_data_test_guid, ddraw, 0, DDSPD_IUNKNOWNPOINTER); ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); - hr = IDirectDrawSurface7_SetPrivateData(surface, &IID_IDirect3D, ddraw, + hr = IDirectDrawSurface7_SetPrivateData(surface, &ddraw_private_data_test_guid, ddraw, 5, DDSPD_IUNKNOWNPOINTER); ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); - hr = IDirectDrawSurface7_SetPrivateData(surface, &IID_IDirect3D, ddraw, + hr = IDirectDrawSurface7_SetPrivateData(surface, &ddraw_private_data_test_guid, ddraw, sizeof(ddraw) * 2, DDSPD_IUNKNOWNPOINTER); ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + /* Note that with a size != 0 and size != sizeof(IUnknown *) and + * DDSPD_IUNKNOWNPOINTER set SetPrivateData in ddraw4 and ddraw7 + * erases the old content and returns an error. This behavior has + * been fixed in d3d8 and d3d9. Unless an application is found + * that depends on this we don't care about this behavior. */ + hr = IDirectDrawSurface7_SetPrivateData(surface, &ddraw_private_data_test_guid, ddraw, + sizeof(ddraw), DDSPD_IUNKNOWNPOINTER); + ok(SUCCEEDED(hr), "Failed to set private data, hr %#x.\n", hr); + hr = IDirectDrawSurface7_SetPrivateData(surface, &ddraw_private_data_test_guid, ddraw, + 0, DDSPD_IUNKNOWNPOINTER); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + size = sizeof(ptr); + hr = IDirectDrawSurface7_GetPrivateData(surface, &ddraw_private_data_test_guid, &ptr, &size); + ok(SUCCEEDED(hr), "Failed to get private data, hr %#x.\n", hr); + hr = IDirectDrawSurface7_FreePrivateData(surface, &ddraw_private_data_test_guid); + ok(SUCCEEDED(hr), "Failed to free private data, hr %#x.\n", hr); + refcount = get_refcount((IUnknown *)ddraw); - hr = IDirectDrawSurface7_SetPrivateData(surface, &IID_IDirect3D, ddraw, + hr = IDirectDrawSurface7_SetPrivateData(surface, &ddraw_private_data_test_guid, ddraw, sizeof(ddraw), DDSPD_IUNKNOWNPOINTER); ok(SUCCEEDED(hr), "Failed to set private data, hr %#x.\n", hr); refcount2 = get_refcount((IUnknown *)ddraw); ok(refcount2 == refcount + 1, "Got unexpected refcount %u.\n", refcount2); - hr = IDirectDrawSurface7_FreePrivateData(surface, &IID_IDirect3D); + hr = IDirectDrawSurface7_FreePrivateData(surface, &ddraw_private_data_test_guid); ok(SUCCEEDED(hr), "Failed to free private data, hr %#x.\n", hr); refcount2 = get_refcount((IUnknown *)ddraw); ok(refcount2 == refcount, "Got unexpected refcount %u.\n", refcount2); - hr = IDirectDrawSurface7_SetPrivateData(surface, &IID_IDirect3D, ddraw, + hr = IDirectDrawSurface7_SetPrivateData(surface, &ddraw_private_data_test_guid, ddraw, sizeof(ddraw), DDSPD_IUNKNOWNPOINTER); ok(SUCCEEDED(hr), "Failed to set private data, hr %#x.\n", hr); - hr = IDirectDrawSurface7_SetPrivateData(surface, &IID_IDirect3D, surface, + hr = IDirectDrawSurface7_SetPrivateData(surface, &ddraw_private_data_test_guid, surface, sizeof(surface), DDSPD_IUNKNOWNPOINTER); ok(SUCCEEDED(hr), "Failed to set private data, hr %#x.\n", hr); refcount2 = get_refcount((IUnknown *)ddraw); ok(refcount2 == refcount, "Got unexpected refcount %u.\n", refcount2); - hr = IDirectDrawSurface7_SetPrivateData(surface, &IID_IDirect3D, ddraw, + hr = IDirectDrawSurface7_SetPrivateData(surface, &ddraw_private_data_test_guid, ddraw, sizeof(ddraw), DDSPD_IUNKNOWNPOINTER); ok(SUCCEEDED(hr), "Failed to set private data, hr %#x.\n", hr); - hr = IDirectDrawSurface7_GetPrivateData(surface, &IID_IDirect3D, &ptr, &size); + size = 2 * sizeof(ptr); + hr = IDirectDrawSurface7_GetPrivateData(surface, &ddraw_private_data_test_guid, &ptr, &size); ok(SUCCEEDED(hr), "Failed to get private data, hr %#x.\n", hr); + ok(size == sizeof(ddraw), "Got unexpected size %u.\n", size); refcount2 = get_refcount(ptr); /* Object is NOT addref'ed by the getter. */ ok(ptr == (IUnknown *)ddraw, "Returned interface pointer is %p, expected %p.\n", ptr, ddraw); ok(refcount2 == refcount + 1, "Got unexpected refcount %u.\n", refcount2); + ptr = (IUnknown *)0xdeadbeef; + size = 1; + hr = IDirectDrawSurface7_GetPrivateData(surface, &ddraw_private_data_test_guid, NULL, &size); + ok(hr == DDERR_MOREDATA, "Got unexpected hr %#x.\n", hr); + ok(size == sizeof(ddraw), "Got unexpected size %u.\n", size); + size = 2 * sizeof(ptr); + hr = IDirectDrawSurface7_GetPrivateData(surface, &ddraw_private_data_test_guid, NULL, &size); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + ok(size == 2 * sizeof(ptr), "Got unexpected size %u.\n", size); + size = 1; + hr = IDirectDrawSurface7_GetPrivateData(surface, &ddraw_private_data_test_guid, &ptr, &size); + ok(hr == DDERR_MOREDATA, "Got unexpected hr %#x.\n", hr); + ok(size == sizeof(ddraw), "Got unexpected size %u.\n", size); + ok(ptr == (IUnknown *)0xdeadbeef, "Got unexpected pointer %p.\n", ptr); + hr = IDirectDrawSurface7_GetPrivateData(surface, &ddraw_private_data_test_guid2, NULL, NULL); + ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#x.\n", hr); + size = 0xdeadbabe; + hr = IDirectDrawSurface7_GetPrivateData(surface, &ddraw_private_data_test_guid2, &ptr, &size); + ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#x.\n", hr); + ok(ptr == (IUnknown *)0xdeadbeef, "Got unexpected pointer %p.\n", ptr); + ok(size == 0xdeadbabe, "Got unexpected size %u.\n", size); + hr = IDirectDrawSurface7_GetPrivateData(surface, &ddraw_private_data_test_guid, NULL, NULL); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + refcount3 = IDirectDrawSurface7_Release(surface); ok(!refcount3, "Got unexpected refcount %u.\n", refcount3); @@ -5966,6 +6092,34 @@ refcount2 = get_refcount((IUnknown *)ddraw); ok(refcount2 == refcount - 1, "Got unexpected refcount %u.\n", refcount2); + memset(&hal_caps, 0, sizeof(hal_caps)); + hal_caps.dwSize = sizeof(hal_caps); + hr = IDirectDraw7_GetCaps(ddraw, &hal_caps, NULL); + ok(SUCCEEDED(hr), "Failed to get caps, hr %#x.\n", hr); + if ((hal_caps.ddsCaps.dwCaps & (DDSCAPS_TEXTURE | DDSCAPS_MIPMAP)) == (DDSCAPS_TEXTURE | DDSCAPS_MIPMAP)) + { + reset_ddsd(&surface_desc); + surface_desc.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_MIPMAPCOUNT; + surface_desc.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY | DDSCAPS_COMPLEX | DDSCAPS_MIPMAP; + surface_desc.dwHeight = 4; + surface_desc.dwWidth = 4; + U2(surface_desc).dwMipMapCount = 2; + hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &surface, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + hr = IDirectDrawSurface7_GetAttachedSurface(surface, &caps, &surface2); + ok(SUCCEEDED(hr), "Failed to get attached surface, hr %#x.\n", hr); + + hr = IDirectDrawSurface7_SetPrivateData(surface, &ddraw_private_data_test_guid, data, sizeof(data), 0); + ok(SUCCEEDED(hr), "Failed to set private data, hr %#x.\n", hr); + hr = IDirectDrawSurface7_GetPrivateData(surface2, &ddraw_private_data_test_guid, NULL, NULL); + ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#x.\n", hr); + + IDirectDrawSurface7_Release(surface2); + IDirectDrawSurface7_Release(surface); + } + else + skip("Mipmapped textures not supported, skipping mipmap private data test.\n"); + refcount = IDirectDraw7_Release(ddraw); ok(!refcount, "Got unexpected refcount %u.\n", refcount); DestroyWindow(window); @@ -6151,7 +6305,7 @@ DDSD_PITCH, 0x100}, {DDSCAPS_VIDEOMEMORY, DDSD_PITCH, 0x104, DD_OK, DDSD_PITCH, 0x100}, - {DDSCAPS_VIDEOMEMORY, DDSD_PITCH, 0x0fc, DD_OK, + {DDSCAPS_VIDEOMEMORY, DDSD_PITCH, 0x0f8, DD_OK, DDSD_PITCH, 0x100}, {DDSCAPS_VIDEOMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x100, DDERR_INVALIDCAPS, 0, 0 }, @@ -6159,15 +6313,17 @@ DDSD_PITCH, 0x100}, {DDSCAPS_SYSTEMMEMORY, DDSD_PITCH, 0x104, DD_OK, DDSD_PITCH, 0x100}, - {DDSCAPS_SYSTEMMEMORY, DDSD_PITCH, 0x0fc, DD_OK, + {DDSCAPS_SYSTEMMEMORY, DDSD_PITCH, 0x0f8, DD_OK, DDSD_PITCH, 0x100}, {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE, 0, DDERR_INVALIDPARAMS, 0, 0 }, - {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x104, DD_OK, - DDSD_PITCH, 0x104}, - {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x102, DDERR_INVALIDPARAMS, + {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x100, DD_OK, + DDSD_PITCH, 0x100}, + {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x0fe, DDERR_INVALIDPARAMS, 0, 0 }, - {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x0fc, DDERR_INVALIDPARAMS, + {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x0fc, DD_OK, + DDSD_PITCH, 0x0fc}, + {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x0f8, DDERR_INVALIDPARAMS, 0, 0 }, }; DWORD flags_mask = DDSD_PITCH | DDSD_LPSURFACE; @@ -6179,7 +6335,7 @@ hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); - mem = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, ((64 * 4) + 4) * 64); + mem = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, ((63 * 4) + 8) * 63); for (i = 0; i < sizeof(test_data) / sizeof(*test_data); ++i) { @@ -6187,8 +6343,8 @@ surface_desc.dwSize = sizeof(surface_desc); surface_desc.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_PIXELFORMAT | test_data[i].flags_in; surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | test_data[i].placement; - surface_desc.dwWidth = 64; - surface_desc.dwHeight = 64; + surface_desc.dwWidth = 63; + surface_desc.dwHeight = 63; U1(surface_desc).lPitch = test_data[i].pitch_in; surface_desc.lpSurface = mem; U4(surface_desc).ddpfPixelFormat.dwSize = sizeof(U4(surface_desc).ddpfPixelFormat); @@ -6223,6 +6379,634 @@ DestroyWindow(window); } +static void test_mipmap_lock(void) +{ + IDirectDrawSurface7 *surface, *surface2; + DDSURFACEDESC2 surface_desc; + IDirectDraw7 *ddraw; + ULONG refcount; + HWND window; + HRESULT hr; + DDSCAPS2 caps = {DDSCAPS_COMPLEX, 0, 0, 0}; + DDCAPS hal_caps; + + window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW, + 0, 0, 640, 480, 0, 0, 0, 0); + ddraw = create_ddraw(); + ok(!!ddraw, "Failed to create a ddraw object.\n"); + hr = IDirectDraw7_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + + memset(&hal_caps, 0, sizeof(hal_caps)); + hal_caps.dwSize = sizeof(hal_caps); + hr = IDirectDraw7_GetCaps(ddraw, &hal_caps, NULL); + ok(SUCCEEDED(hr), "Failed to get caps, hr %#x.\n", hr); + if ((hal_caps.ddsCaps.dwCaps & (DDSCAPS_TEXTURE | DDSCAPS_MIPMAP)) != (DDSCAPS_TEXTURE | DDSCAPS_MIPMAP)) + { + skip("Mipmapped textures not supported, skipping mipmap lock test.\n"); + IDirectDraw7_Release(ddraw); + DestroyWindow(window); + return; + } + + memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + surface_desc.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT | DDSD_MIPMAPCOUNT; + surface_desc.dwWidth = 4; + surface_desc.dwHeight = 4; + U2(surface_desc).dwMipMapCount = 2; + surface_desc.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_COMPLEX | DDSCAPS_MIPMAP + | DDSCAPS_SYSTEMMEMORY; + hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &surface, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + hr = IDirectDrawSurface7_GetAttachedSurface(surface, &caps, &surface2); + ok(SUCCEEDED(hr), "Failed to get attached surface, hr %#x.\n", hr); + + memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + hr = IDirectDrawSurface7_Lock(surface, NULL, &surface_desc, 0, NULL); + ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x.\n", hr); + memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + hr = IDirectDrawSurface7_Lock(surface2, NULL, &surface_desc, 0, NULL); + ok(SUCCEEDED(hr), "Failed to lock surface, hr %#x.\n", hr); + IDirectDrawSurface7_Unlock(surface2, NULL); + IDirectDrawSurface7_Unlock(surface, NULL); + + IDirectDrawSurface7_Release(surface2); + IDirectDrawSurface7_Release(surface); + refcount = IDirectDraw7_Release(ddraw); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + DestroyWindow(window); +} + +static void test_palette_complex(void) +{ + IDirectDrawSurface7 *surface, *mipmap, *tmp; + DDSURFACEDESC2 surface_desc; + IDirectDraw7 *ddraw; + IDirectDrawPalette *palette, *palette2; + ULONG refcount; + HWND window; + HRESULT hr; + DDSCAPS2 caps = {DDSCAPS_COMPLEX, 0, 0, 0}; + DDCAPS hal_caps; + PALETTEENTRY palette_entries[256]; + unsigned int i; + + window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW, + 0, 0, 640, 480, 0, 0, 0, 0); + ddraw = create_ddraw(); + ok(!!ddraw, "Failed to create a ddraw object.\n"); + hr = IDirectDraw7_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); + ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); + + memset(&hal_caps, 0, sizeof(hal_caps)); + hal_caps.dwSize = sizeof(hal_caps); + hr = IDirectDraw7_GetCaps(ddraw, &hal_caps, NULL); + ok(SUCCEEDED(hr), "Failed to get caps, hr %#x.\n", hr); + if ((hal_caps.ddsCaps.dwCaps & (DDSCAPS_TEXTURE | DDSCAPS_MIPMAP)) != (DDSCAPS_TEXTURE | DDSCAPS_MIPMAP)) + { + skip("Mipmapped textures not supported, skipping mipmap palette test.\n"); + IDirectDraw7_Release(ddraw); + DestroyWindow(window); + return; + } + + 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.dwWidth = 128; + surface_desc.dwHeight = 128; + surface_desc.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_COMPLEX | DDSCAPS_MIPMAP; + U4(surface_desc).ddpfPixelFormat.dwSize = sizeof(U4(surface_desc).ddpfPixelFormat); + U4(surface_desc).ddpfPixelFormat.dwFlags = DDPF_PALETTEINDEXED8 | DDPF_RGB; + U1(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount = 8; + hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &surface, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + + memset(palette_entries, 0, sizeof(palette_entries)); + hr = IDirectDraw7_CreatePalette(ddraw, DDPCAPS_8BIT | DDPCAPS_ALLOW256, + palette_entries, &palette, NULL); + ok(SUCCEEDED(hr), "Failed to create palette, hr %#x.\n", hr); + + palette2 = (void *)0xdeadbeef; + hr = IDirectDrawSurface7_GetPalette(surface, &palette2); + ok(hr == DDERR_NOPALETTEATTACHED, "Got unexpected hr %#x.\n", hr); + ok(!palette2, "Got unexpected palette %p.\n", palette2); + hr = IDirectDrawSurface7_SetPalette(surface, palette); + ok(SUCCEEDED(hr), "Failed to set palette, hr %#x.\n", hr); + hr = IDirectDrawSurface7_GetPalette(surface, &palette2); + ok(SUCCEEDED(hr), "Failed to get palette, hr %#x.\n", hr); + ok(palette == palette2, "Got unexpected palette %p.\n", palette2); + IDirectDrawPalette_Release(palette2); + + mipmap = surface; + IDirectDrawSurface7_AddRef(mipmap); + for (i = 0; i < 7; ++i) + { + hr = IDirectDrawSurface7_GetAttachedSurface(mipmap, &caps, &tmp); + ok(SUCCEEDED(hr), "Failed to get attached surface, i %u, hr %#x.\n", i, hr); + palette2 = (void *)0xdeadbeef; + hr = IDirectDrawSurface7_GetPalette(tmp, &palette2); + ok(hr == DDERR_NOPALETTEATTACHED, "Got unexpected hr %#x, i %u.\n", hr, i); + ok(!palette2, "Got unexpected palette %p, i %u.\n", palette2, i); + + hr = IDirectDrawSurface7_SetPalette(tmp, palette); + ok(hr == DDERR_NOTONMIPMAPSUBLEVEL, "Got unexpected hr %#x, i %u.\n", hr, i); + + hr = IDirectDrawSurface7_GetPalette(tmp, &palette2); + ok(hr == DDERR_NOPALETTEATTACHED, "Got unexpected hr %#x, i %u.\n", hr, i); + ok(!palette2, "Got unexpected palette %p, i %u.\n", palette2, i); + + /* Ddraw7 uses the palette of the mipmap for GetDC, just like previous + * ddraw versions. Combined with the test results above this means no + * palette is available. So depending on the driver either GetDC fails + * or the DIB color table contains random data. */ + + IDirectDrawSurface7_Release(mipmap); + mipmap = tmp; + } + + hr = IDirectDrawSurface7_GetAttachedSurface(mipmap, &caps, &tmp); + ok(hr == DDERR_NOTFOUND, "Got unexpected hr %#x.\n", hr); + IDirectDrawSurface7_Release(mipmap); + refcount = IDirectDrawSurface7_Release(surface); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + + /* Test DDERR_INVALIDPIXELFORMAT vs DDERR_NOTONMIPMAPSUBLEVEL. */ + 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.dwWidth = 128; + surface_desc.dwHeight = 128; + surface_desc.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_COMPLEX | DDSCAPS_MIPMAP; + U4(surface_desc).ddpfPixelFormat.dwSize = sizeof(U4(surface_desc).ddpfPixelFormat); + U4(surface_desc).ddpfPixelFormat.dwFlags = DDPF_RGB; + U1(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount = 32; + U2(U4(surface_desc).ddpfPixelFormat).dwRBitMask = 0x00ff0000; + U3(U4(surface_desc).ddpfPixelFormat).dwGBitMask = 0x0000ff00; + U4(U4(surface_desc).ddpfPixelFormat).dwBBitMask = 0x000000ff; + hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &surface, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + + hr = IDirectDrawSurface7_GetAttachedSurface(surface, &caps, &mipmap); + ok(SUCCEEDED(hr), "Failed to get attached surface, hr %#x.\n", hr); + hr = IDirectDrawSurface7_SetPalette(mipmap, palette); + ok(hr == DDERR_NOTONMIPMAPSUBLEVEL, "Got unexpected hr %#x.\n", hr); + + IDirectDrawSurface7_Release(mipmap); + refcount = IDirectDrawSurface7_Release(surface); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + refcount = IDirectDrawPalette_Release(palette); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + + refcount = IDirectDraw7_Release(ddraw); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + DestroyWindow(window); +} + +static void test_p8_rgb_blit(void) +{ + IDirectDrawSurface7 *src, *dst; + DDSURFACEDESC2 surface_desc; + IDirectDraw7 *ddraw; + IDirectDrawPalette *palette; + ULONG refcount; + HWND window; + HRESULT hr; + PALETTEENTRY palette_entries[256]; + unsigned int x; + static const BYTE src_data[] = {0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0xff, 0x80}; + static const D3DCOLOR expected[] = + { + 0x00000000, 0x00010101, 0x00020202, 0x00030303, + 0x00040404, 0x00050505, 0x00ffffff, 0x00808080, + }; + D3DCOLOR color; + + 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(palette_entries, 0, sizeof(palette_entries)); + palette_entries[0].peRed = 0xff; + palette_entries[1].peGreen = 0xff; + palette_entries[2].peBlue = 0xff; + palette_entries[3].peFlags = 0xff; + hr = IDirectDraw7_CreatePalette(ddraw, DDPCAPS_8BIT | DDPCAPS_ALLOW256, + palette_entries, &palette, NULL); + ok(SUCCEEDED(hr), "Failed to create palette, 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; + surface_desc.dwWidth = 8; + surface_desc.dwHeight = 1; + surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; + U4(surface_desc).ddpfPixelFormat.dwSize = sizeof(U4(surface_desc).ddpfPixelFormat); + U4(surface_desc).ddpfPixelFormat.dwFlags = DDPF_PALETTEINDEXED8 | DDPF_RGB; + U1(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount = 8; + hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &src, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, 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; + surface_desc.dwWidth = 8; + surface_desc.dwHeight = 1; + surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; + U4(surface_desc).ddpfPixelFormat.dwSize = sizeof(U4(surface_desc).ddpfPixelFormat); + U4(surface_desc).ddpfPixelFormat.dwFlags = DDPF_RGB | DDPF_ALPHAPIXELS; + 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 = 0xff000000; + hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &dst, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + + memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + hr = IDirectDrawSurface7_Lock(src, NULL, &surface_desc, 0, NULL); + ok(SUCCEEDED(hr), "Failed to lock source surface, hr %#x.\n", hr); + memcpy(surface_desc.lpSurface, src_data, sizeof(src_data)); + hr = IDirectDrawSurface7_Unlock(src, NULL); + ok(SUCCEEDED(hr), "Failed to unlock source surface, hr %#x.\n", hr); + + hr = IDirectDrawSurface7_SetPalette(src, palette); + ok(SUCCEEDED(hr), "Failed to set palette, hr %#x.\n", hr); + hr = IDirectDrawSurface7_Blt(dst, NULL, src, NULL, DDBLT_WAIT, NULL); + /* The r500 Windows 7 driver returns E_NOTIMPL. r200 on Windows XP works. + * The Geforce 7 driver on Windows Vista returns E_FAIL. Newer Nvidia GPUs work. */ + ok(SUCCEEDED(hr) || broken(hr == E_NOTIMPL) || broken(hr == E_FAIL), + "Failed to blit, hr %#x.\n", hr); + + if (SUCCEEDED(hr)) + { + for (x = 0; x < sizeof(expected) / sizeof(*expected); x++) + { + color = get_surface_color(dst, x, 0); + todo_wine ok(compare_color(color, expected[x], 0), + "Pixel %u: Got color %#x, expected %#x.\n", + x, color, expected[x]); + } + } + + IDirectDrawSurface7_Release(src); + IDirectDrawSurface7_Release(dst); + IDirectDrawPalette_Release(palette); + + refcount = IDirectDraw7_Release(ddraw); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + DestroyWindow(window); +} + +static void test_material(void) +{ + static const D3DCOLORVALUE null_color; + IDirect3DDevice7 *device; + D3DMATERIAL7 material; + ULONG refcount; + HWND window; + HRESULT hr; + + 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_GetMaterial(device, &material); + ok(SUCCEEDED(hr), "Failed to get material, hr %#x.\n", hr); + ok(!memcmp(&U(material).diffuse, &null_color, sizeof(null_color)), + "Got unexpected diffuse color {%.8e, %.8e, %.8e, %.8e}.\n", + U1(U(material).diffuse).r, U2(U(material).diffuse).g, + U3(U(material).diffuse).b, U3(U(material).diffuse).a); + ok(!memcmp(&U1(material).ambient, &null_color, sizeof(null_color)), + "Got unexpected ambient color {%.8e, %.8e, %.8e, %.8e}.\n", + U1(U1(material).ambient).r, U2(U1(material).ambient).g, + U3(U1(material).ambient).b, U3(U1(material).ambient).a); + ok(!memcmp(&U2(material).specular, &null_color, sizeof(null_color)), + "Got unexpected specular color {%.8e, %.8e, %.8e, %.8e}.\n", + U1(U2(material).specular).r, U2(U2(material).specular).g, + U3(U2(material).specular).b, U3(U2(material).specular).a); + ok(!memcmp(&U3(material).emissive, &null_color, sizeof(null_color)), + "Got unexpected emissive color {%.8e, %.8e, %.8e, %.8e}.\n", + U1(U3(material).emissive).r, U2(U3(material).emissive).g, + U3(U3(material).emissive).b, U3(U3(material).emissive).a); + ok(U4(material).power == 0.0f, "Got unexpected power %.8e.\n", U4(material).power); + + refcount = IDirect3DDevice7_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + DestroyWindow(window); +} + +static void test_palette_gdi(void) +{ + IDirectDrawSurface7 *surface, *primary; + DDSURFACEDESC2 surface_desc; + IDirectDraw7 *ddraw; + IDirectDrawPalette *palette, *palette2; + ULONG refcount; + HWND window; + HRESULT hr; + PALETTEENTRY palette_entries[256]; + UINT i; + HDC dc; + /* On the Windows 8 testbot palette index 0 of the onscreen palette is forced to + * r = 0, g = 0, b = 0. Do not attempt to set it to something else as this is + * not the point of this test. */ + static const RGBQUAD expected1[] = + { + {0x00, 0x00, 0x00, 0x00}, {0x00, 0x00, 0x01, 0x00}, {0x00, 0x02, 0x00, 0x00}, + {0x03, 0x00, 0x00, 0x00}, {0x15, 0x14, 0x13, 0x00}, + }; + static const RGBQUAD expected2[] = + { + {0x00, 0x00, 0x00, 0x00}, {0x00, 0x00, 0x01, 0x00}, {0x00, 0x02, 0x00, 0x00}, + {0x03, 0x00, 0x00, 0x00}, {0x25, 0x24, 0x23, 0x00}, + }; + static const RGBQUAD expected3[] = + { + {0x00, 0x00, 0x00, 0x00}, {0x40, 0x00, 0x00, 0x00}, {0x00, 0x00, 0x40, 0x00}, + {0x00, 0x40, 0x00, 0x00}, {0x56, 0x34, 0x12, 0x00}, + }; + HPALETTE ddraw_palette_handle; + /* Similar to index 0, index 255 is r = 0xff, g = 0xff, b = 0xff on the Win8 VMs. */ + RGBQUAD rgbquad[255]; + static const RGBQUAD rgb_zero = {0, 0, 0, 0}; + + 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; + surface_desc.dwWidth = 16; + surface_desc.dwHeight = 16; + surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; + U4(surface_desc).ddpfPixelFormat.dwSize = sizeof(U4(surface_desc).ddpfPixelFormat); + U4(surface_desc).ddpfPixelFormat.dwFlags = DDPF_PALETTEINDEXED8 | DDPF_RGB; + U1(U4(surface_desc).ddpfPixelFormat).dwRGBBitCount = 8; + hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &surface, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + + /* Avoid colors from the Windows default palette. */ + memset(palette_entries, 0, sizeof(palette_entries)); + palette_entries[1].peRed = 0x01; + palette_entries[2].peGreen = 0x02; + palette_entries[3].peBlue = 0x03; + palette_entries[4].peRed = 0x13; + palette_entries[4].peGreen = 0x14; + palette_entries[4].peBlue = 0x15; + hr = IDirectDraw7_CreatePalette(ddraw, DDPCAPS_8BIT | DDPCAPS_ALLOW256, + palette_entries, &palette, NULL); + ok(SUCCEEDED(hr), "Failed to create palette, hr %#x.\n", hr); + + /* If there is no palette assigned and the display mode is not 8 bpp, some + * drivers refuse to create a DC while others allow it. If a DC is created, + * the DIB color table is uninitialized and contains random colors. No error + * is generated when trying to read pixels and random garbage is returned. + * + * The most likely explanation is that if the driver creates a DC, it (or + * the higher-level runtime) uses GetSystemPaletteEntries to find the + * palette, but GetSystemPaletteEntries fails when bpp > 8 and the palette + * contains uninitialized garbage. See comments below for the P8 case. */ + + hr = IDirectDrawSurface7_SetPalette(surface, palette); + ok(SUCCEEDED(hr), "Failed to set palette, hr %#x.\n", hr); + hr = IDirectDrawSurface7_GetDC(surface, &dc); + ok(SUCCEEDED(hr), "Failed to get DC, hr %#x.\n", hr); + ddraw_palette_handle = SelectPalette(dc, GetStockObject(DEFAULT_PALETTE), FALSE); + ok(ddraw_palette_handle == GetStockObject(DEFAULT_PALETTE), + "Got unexpected palette %p, expected %p.\n", + ddraw_palette_handle, GetStockObject(DEFAULT_PALETTE)); + + i = GetDIBColorTable(dc, 0, sizeof(rgbquad) / sizeof(*rgbquad), rgbquad); + ok(i == sizeof(rgbquad) / sizeof(*rgbquad), "Expected count 255, got %u.\n", i); + for (i = 0; i < sizeof(expected1) / sizeof(*expected1); i++) + { + ok(!memcmp(&rgbquad[i], &expected1[i], sizeof(rgbquad[i])), + "Got color table entry %u r=%#x g=%#x b=%#x, expected r=%#x g=%#x b=%#x.\n", + i, rgbquad[i].rgbRed, rgbquad[i].rgbGreen, rgbquad[i].rgbBlue, + expected1[i].rgbRed, expected1[i].rgbGreen, expected1[i].rgbBlue); + } + for (; i < sizeof(rgbquad) / sizeof(*rgbquad); i++) + { + ok(!memcmp(&rgbquad[i], &rgb_zero, sizeof(rgbquad[i])), + "Got color table entry %u r=%#x g=%#x b=%#x, expected r=0 g=0 b=0.\n", + i, rgbquad[i].rgbRed, rgbquad[i].rgbGreen, rgbquad[i].rgbBlue); + } + + /* Update the palette while the DC is in use. This does not modify the DC. */ + palette_entries[4].peRed = 0x23; + palette_entries[4].peGreen = 0x24; + palette_entries[4].peBlue = 0x25; + hr = IDirectDrawPalette_SetEntries(palette, 0, 4, 1, &palette_entries[4]); + ok(SUCCEEDED(hr), "Failed to set palette entries, hr %#x.\n", hr); + + i = GetDIBColorTable(dc, 4, 1, &rgbquad[4]); + ok(i == 1, "Expected count 1, got %u.\n", i); + todo_wine ok(!memcmp(&rgbquad[4], &expected1[4], sizeof(rgbquad[4])), + "Got color table entry %u r=%#x g=%#x b=%#x, expected r=%#x g=%#x b=%#x.\n", + i, rgbquad[4].rgbRed, rgbquad[4].rgbGreen, rgbquad[4].rgbBlue, + expected1[4].rgbRed, expected1[4].rgbGreen, expected1[4].rgbBlue); + + /* Neither does re-setting the palette. */ + hr = IDirectDrawSurface7_SetPalette(surface, NULL); + ok(SUCCEEDED(hr), "Failed to set palette, hr %#x.\n", hr); + hr = IDirectDrawSurface7_SetPalette(surface, palette); + ok(SUCCEEDED(hr), "Failed to set palette, hr %#x.\n", hr); + + i = GetDIBColorTable(dc, 4, 1, &rgbquad[4]); + ok(i == 1, "Expected count 1, got %u.\n", i); + todo_wine ok(!memcmp(&rgbquad[4], &expected1[4], sizeof(rgbquad[4])), + "Got color table entry %u r=%#x g=%#x b=%#x, expected r=%#x g=%#x b=%#x.\n", + i, rgbquad[4].rgbRed, rgbquad[4].rgbGreen, rgbquad[4].rgbBlue, + expected1[4].rgbRed, expected1[4].rgbGreen, expected1[4].rgbBlue); + + hr = IDirectDrawSurface7_ReleaseDC(surface, dc); + ok(SUCCEEDED(hr), "Failed to release DC, hr %#x.\n", hr); + + /* Refresh the DC. This updates the palette. */ + hr = IDirectDrawSurface7_GetDC(surface, &dc); + ok(SUCCEEDED(hr), "Failed to get DC, hr %#x.\n", hr); + i = GetDIBColorTable(dc, 0, sizeof(rgbquad) / sizeof(*rgbquad), rgbquad); + ok(i == sizeof(rgbquad) / sizeof(*rgbquad), "Expected count 255, got %u.\n", i); + for (i = 0; i < sizeof(expected2) / sizeof(*expected2); i++) + { + ok(!memcmp(&rgbquad[i], &expected2[i], sizeof(rgbquad[i])), + "Got color table entry %u r=%#x g=%#x b=%#x, expected r=%#x g=%#x b=%#x.\n", + i, rgbquad[i].rgbRed, rgbquad[i].rgbGreen, rgbquad[i].rgbBlue, + expected2[i].rgbRed, expected2[i].rgbGreen, expected2[i].rgbBlue); + } + for (; i < sizeof(rgbquad) / sizeof(*rgbquad); i++) + { + ok(!memcmp(&rgbquad[i], &rgb_zero, sizeof(rgbquad[i])), + "Got color table entry %u r=%#x g=%#x b=%#x, expected r=0 g=0 b=0.\n", + i, rgbquad[i].rgbRed, rgbquad[i].rgbGreen, rgbquad[i].rgbBlue); + } + hr = IDirectDrawSurface7_ReleaseDC(surface, dc); + ok(SUCCEEDED(hr), "Failed to release DC, hr %#x.\n", hr); + + refcount = IDirectDrawSurface7_Release(surface); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + + if (FAILED(hr = IDirectDraw7_SetDisplayMode(ddraw, 640, 480, 8, 0, 0))) + { + win_skip("Failed to set 8 bpp display mode, skipping test.\n"); + IDirectDrawPalette_Release(palette); + IDirectDraw7_Release(ddraw); + DestroyWindow(window); + return; + } + ok(SUCCEEDED(hr), "Failed to set display mode, hr %#x.\n", hr); + hr = IDirectDraw7_SetCooperativeLevel(ddraw, window, DDSCL_FULLSCREEN | DDSCL_EXCLUSIVE); + 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; + surface_desc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; + hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &primary, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + + hr = IDirectDrawSurface7_SetPalette(primary, palette); + ok(SUCCEEDED(hr), "Failed to set palette, hr %#x.\n", hr); + hr = IDirectDrawSurface7_GetDC(primary, &dc); + ok(SUCCEEDED(hr), "Failed to get DC, hr %#x.\n", hr); + ddraw_palette_handle = SelectPalette(dc, GetStockObject(DEFAULT_PALETTE), FALSE); + /* Windows 2000 on the testbot assigns a different palette to the primary. Refrast? */ + ok(ddraw_palette_handle == GetStockObject(DEFAULT_PALETTE) || broken(TRUE), + "Got unexpected palette %p, expected %p.\n", + ddraw_palette_handle, GetStockObject(DEFAULT_PALETTE)); + SelectPalette(dc, ddraw_palette_handle, FALSE); + + /* The primary uses the system palette. In exclusive mode, the system palette matches + * the ddraw palette attached to the primary, so the result is what you would expect + * from a regular surface. Tests for the interaction between the ddraw palette and + * the system palette are not included pending an application that depends on this. + * The relation between those causes problems on Windows Vista and newer for games + * like Age of Empires or Starcraft. Don't emulate it without a real need. */ + i = GetDIBColorTable(dc, 0, sizeof(rgbquad) / sizeof(*rgbquad), rgbquad); + ok(i == sizeof(rgbquad) / sizeof(*rgbquad), "Expected count 255, got %u.\n", i); + for (i = 0; i < sizeof(expected2) / sizeof(*expected2); i++) + { + ok(!memcmp(&rgbquad[i], &expected2[i], sizeof(rgbquad[i])), + "Got color table entry %u r=%#x g=%#x b=%#x, expected r=%#x g=%#x b=%#x.\n", + i, rgbquad[i].rgbRed, rgbquad[i].rgbGreen, rgbquad[i].rgbBlue, + expected2[i].rgbRed, expected2[i].rgbGreen, expected2[i].rgbBlue); + } + for (; i < sizeof(rgbquad) / sizeof(*rgbquad); i++) + { + ok(!memcmp(&rgbquad[i], &rgb_zero, sizeof(rgbquad[i])), + "Got color table entry %u r=%#x g=%#x b=%#x, expected r=0 g=0 b=0.\n", + i, rgbquad[i].rgbRed, rgbquad[i].rgbGreen, rgbquad[i].rgbBlue); + } + hr = IDirectDrawSurface7_ReleaseDC(primary, dc); + ok(SUCCEEDED(hr), "Failed to release DC, 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; + surface_desc.dwWidth = 16; + surface_desc.dwHeight = 16; + surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; + hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &surface, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n", hr); + + /* Here the offscreen surface appears to use the primary's palette, + * but in all likelyhood it is actually the system palette. */ + hr = IDirectDrawSurface7_GetDC(surface, &dc); + ok(SUCCEEDED(hr), "Failed to get DC, hr %#x.\n", hr); + i = GetDIBColorTable(dc, 0, sizeof(rgbquad) / sizeof(*rgbquad), rgbquad); + ok(i == sizeof(rgbquad) / sizeof(*rgbquad), "Expected count 255, got %u.\n", i); + for (i = 0; i < sizeof(expected2) / sizeof(*expected2); i++) + { + ok(!memcmp(&rgbquad[i], &expected2[i], sizeof(rgbquad[i])), + "Got color table entry %u r=%#x g=%#x b=%#x, expected r=%#x g=%#x b=%#x.\n", + i, rgbquad[i].rgbRed, rgbquad[i].rgbGreen, rgbquad[i].rgbBlue, + expected2[i].rgbRed, expected2[i].rgbGreen, expected2[i].rgbBlue); + } + for (; i < sizeof(rgbquad) / sizeof(*rgbquad); i++) + { + ok(!memcmp(&rgbquad[i], &rgb_zero, sizeof(rgbquad[i])), + "Got color table entry %u r=%#x g=%#x b=%#x, expected r=0 g=0 b=0.\n", + i, rgbquad[i].rgbRed, rgbquad[i].rgbGreen, rgbquad[i].rgbBlue); + } + hr = IDirectDrawSurface7_ReleaseDC(surface, dc); + ok(SUCCEEDED(hr), "Failed to release DC, hr %#x.\n", hr); + + /* On real hardware a change to the primary surface's palette applies immediately, + * even on device contexts from offscreen surfaces that do not have their own + * palette. On the testbot VMs this is not the case. Don't test this until we + * know of an application that depends on this. */ + + memset(palette_entries, 0, sizeof(palette_entries)); + palette_entries[1].peBlue = 0x40; + palette_entries[2].peRed = 0x40; + palette_entries[3].peGreen = 0x40; + palette_entries[4].peRed = 0x12; + palette_entries[4].peGreen = 0x34; + palette_entries[4].peBlue = 0x56; + hr = IDirectDraw7_CreatePalette(ddraw, DDPCAPS_8BIT | DDPCAPS_ALLOW256, + palette_entries, &palette2, NULL); + ok(SUCCEEDED(hr), "Failed to create palette, hr %#x.\n", hr); + hr = IDirectDrawSurface7_SetPalette(surface, palette2); + ok(SUCCEEDED(hr), "Failed to set palette, hr %#x.\n", hr); + + /* A palette assigned to the offscreen surface overrides the primary / system + * palette. */ + hr = IDirectDrawSurface7_GetDC(surface, &dc); + ok(SUCCEEDED(hr), "Failed to get DC, hr %#x.\n", hr); + i = GetDIBColorTable(dc, 0, sizeof(rgbquad) / sizeof(*rgbquad), rgbquad); + ok(i == sizeof(rgbquad) / sizeof(*rgbquad), "Expected count 255, got %u.\n", i); + for (i = 0; i < sizeof(expected3) / sizeof(*expected3); i++) + { + ok(!memcmp(&rgbquad[i], &expected3[i], sizeof(rgbquad[i])), + "Got color table entry %u r=%#x g=%#x b=%#x, expected r=%#x g=%#x b=%#x.\n", + i, rgbquad[i].rgbRed, rgbquad[i].rgbGreen, rgbquad[i].rgbBlue, + expected3[i].rgbRed, expected3[i].rgbGreen, expected3[i].rgbBlue); + } + for (; i < sizeof(rgbquad) / sizeof(*rgbquad); i++) + { + ok(!memcmp(&rgbquad[i], &rgb_zero, sizeof(rgbquad[i])), + "Got color table entry %u r=%#x g=%#x b=%#x, expected r=0 g=0 b=0.\n", + i, rgbquad[i].rgbRed, rgbquad[i].rgbGreen, rgbquad[i].rgbBlue); + } + hr = IDirectDrawSurface7_ReleaseDC(surface, dc); + ok(SUCCEEDED(hr), "Failed to release DC, hr %#x.\n", hr); + + refcount = IDirectDrawSurface7_Release(surface); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + + /* The Windows 8 testbot keeps extra references to the primary and + * backbuffer while in 8 bpp mode. */ + hr = IDirectDraw7_RestoreDisplayMode(ddraw); + ok(SUCCEEDED(hr), "Failed to restore display mode, hr %#x.\n", hr); + + refcount = IDirectDrawSurface7_Release(primary); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + refcount = IDirectDrawPalette_Release(palette2); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + refcount = IDirectDrawPalette_Release(palette); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + refcount = IDirectDraw7_Release(ddraw); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + DestroyWindow(window); +} + START_TEST(ddraw7) { HMODULE module = GetModuleHandleA("ddraw.dll"); @@ -6286,4 +7070,9 @@ test_private_data(); test_pixel_format(); test_create_surface_pitch(); + test_mipmap_lock(); + test_palette_complex(); + test_p8_rgb_blit(); + test_material(); + test_palette_gdi(); } diff -Nru wine1.7-1.7.14/dlls/ddraw/utils.c wine1.7-1.7.18/dlls/ddraw/utils.c --- wine1.7-1.7.14/dlls/ddraw/utils.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/ddraw/utils.c 2014-05-02 18:15:48.000000000 +0000 @@ -735,57 +735,35 @@ TRACE("( "); DDRAW_dump_pixelformat_flag(pf->dwFlags); if (pf->dwFlags & DDPF_FOURCC) - { - TRACE(", dwFourCC code '%c%c%c%c' (0x%08x) - %d bits per pixel", + TRACE(", dwFourCC code '%c%c%c%c' (0x%08x) - %u bits per pixel", (unsigned char)( pf->dwFourCC &0xff), (unsigned char)((pf->dwFourCC>> 8)&0xff), (unsigned char)((pf->dwFourCC>>16)&0xff), (unsigned char)((pf->dwFourCC>>24)&0xff), pf->dwFourCC, - pf->u1.dwYUVBitCount - ); - } + pf->u1.dwYUVBitCount); if (pf->dwFlags & DDPF_RGB) { - const char *cmd; - TRACE(", RGB bits: %d, ", pf->u1.dwRGBBitCount); - switch (pf->u1.dwRGBBitCount) - { - case 4: cmd = "%1lx"; break; - case 8: cmd = "%02lx"; break; - case 16: cmd = "%04lx"; break; - case 24: cmd = "%06lx"; break; - case 32: cmd = "%08lx"; break; - default: ERR("Unexpected bit depth!\n"); cmd = "%d"; break; - } - TRACE(" R "); TRACE(cmd, pf->u2.dwRBitMask); - TRACE(" G "); TRACE(cmd, pf->u3.dwGBitMask); - TRACE(" B "); TRACE(cmd, pf->u4.dwBBitMask); + TRACE(", RGB bits: %u, R 0x%08x G 0x%08x B 0x%08x", + pf->u1.dwRGBBitCount, + pf->u2.dwRBitMask, + pf->u3.dwGBitMask, + pf->u4.dwBBitMask); if (pf->dwFlags & DDPF_ALPHAPIXELS) - { - TRACE(" A "); TRACE(cmd, pf->u5.dwRGBAlphaBitMask); - } + TRACE(" A 0x%08x", pf->u5.dwRGBAlphaBitMask); if (pf->dwFlags & DDPF_ZPIXELS) - { - TRACE(" Z "); TRACE(cmd, pf->u5.dwRGBZBitMask); - } + TRACE(" Z 0x%08x", pf->u5.dwRGBZBitMask); } if (pf->dwFlags & DDPF_ZBUFFER) - { - TRACE(", Z bits : %d", pf->u1.dwZBufferBitDepth); - } + TRACE(", Z bits: %u", pf->u1.dwZBufferBitDepth); if (pf->dwFlags & DDPF_ALPHA) - { - TRACE(", Alpha bits : %d", pf->u1.dwAlphaBitDepth); - } + TRACE(", Alpha bits: %u", pf->u1.dwAlphaBitDepth); if (pf->dwFlags & DDPF_BUMPDUDV) - { - const char *cmd = "%08lx"; - TRACE(", Bump bits: %d, ", pf->u1.dwBumpBitCount); - TRACE(" U "); TRACE(cmd, pf->u2.dwBumpDuBitMask); - TRACE(" V "); TRACE(cmd, pf->u3.dwBumpDvBitMask); - TRACE(" L "); TRACE(cmd, pf->u4.dwBumpLuminanceBitMask); - } + TRACE(", Bump bits: %u, U 0x%08x V 0x%08x L 0x%08x", + pf->u1.dwBumpBitCount, + pf->u2.dwBumpDuBitMask, + pf->u3.dwBumpDvBitMask, + pf->u4.dwBumpLuminanceBitMask); TRACE(")\n"); } diff -Nru wine1.7-1.7.14/dlls/ddraw/viewport.c wine1.7-1.7.18/dlls/ddraw/viewport.c --- wine1.7-1.7.14/dlls/ddraw/viewport.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/ddraw/viewport.c 2014-05-02 18:15:48.000000000 +0000 @@ -524,39 +524,18 @@ return DDERR_UNSUPPORTED; } -/***************************************************************************** - * IDirect3DViewport3::SetBackground - * - * Sets the background material - * - * Params: - * hMat: Handle from a IDirect3DMaterial interface - * - * Returns: - * D3D_OK on success - * - *****************************************************************************/ -static HRESULT WINAPI d3d_viewport_SetBackground(IDirect3DViewport3 *iface, D3DMATERIALHANDLE hMat) +static HRESULT WINAPI d3d_viewport_SetBackground(IDirect3DViewport3 *iface, D3DMATERIALHANDLE material) { struct d3d_viewport *viewport = impl_from_IDirect3DViewport3(iface); struct d3d_material *m; - TRACE("iface %p, material %#x.\n", iface, hMat); + TRACE("iface %p, material %#x.\n", iface, material); wined3d_mutex_lock(); - if (!hMat) - { - viewport->background = NULL; - TRACE("Setting background to NULL\n"); - wined3d_mutex_unlock(); - return D3D_OK; - } - - m = ddraw_get_object(&viewport->ddraw->d3ddevice->handle_table, hMat - 1, DDRAW_HANDLE_MATERIAL); - if (!m) + if (!(m = ddraw_get_object(&viewport->ddraw->d3ddevice->handle_table, material - 1, DDRAW_HANDLE_MATERIAL))) { - WARN("Invalid material handle.\n"); + WARN("Invalid material handle %#x.\n", material); wined3d_mutex_unlock(); return DDERR_INVALIDPARAMS; } @@ -686,16 +665,13 @@ if (flags & D3DCLEAR_TARGET) { - if (This->background == NULL) { - ERR(" Trying to clear the color buffer without background material!\n"); - } + if (!This->background) + WARN("No background material set.\n"); else - { - color = ((int)((This->background->mat.u.diffuse.u1.r) * 255) << 16) - | ((int) ((This->background->mat.u.diffuse.u2.g) * 255) << 8) - | ((int) ((This->background->mat.u.diffuse.u3.b) * 255) << 0) - | ((int) ((This->background->mat.u.diffuse.u4.a) * 255) << 24); - } + color = D3DRGBA(This->background->mat.u.diffuse.u1.r, + This->background->mat.u.diffuse.u2.g, + This->background->mat.u.diffuse.u3.b, + This->background->mat.u.diffuse.u4.a); } /* Need to temporarily activate viewport to clear it. Previously active one will be restored diff -Nru wine1.7-1.7.14/dlls/dinput/joystick.c wine1.7-1.7.18/dlls/dinput/joystick.c --- wine1.7-1.7.14/dlls/dinput/joystick.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/dinput/joystick.c 2014-05-02 18:15:48.000000000 +0000 @@ -406,7 +406,6 @@ TRACE("dwFlags: %08x\n", lpDIDevCaps->dwFlags); TRACE("dwDevType: %08x %s\n", lpDIDevCaps->dwDevType, lpDIDevCaps->dwDevType == DIDEVTYPE_DEVICE ? "DIDEVTYPE_DEVICE" : - lpDIDevCaps->dwDevType == DIDEVTYPE_DEVICE ? "DIDEVTYPE_DEVICE" : lpDIDevCaps->dwDevType == DIDEVTYPE_MOUSE ? "DIDEVTYPE_MOUSE" : lpDIDevCaps->dwDevType == DIDEVTYPE_KEYBOARD ? "DIDEVTYPE_KEYBOARD" : lpDIDevCaps->dwDevType == DIDEVTYPE_JOYSTICK ? "DIDEVTYPE_JOYSTICK" : diff -Nru wine1.7-1.7.14/dlls/dinput/joystick_osx.c wine1.7-1.7.18/dlls/dinput/joystick_osx.c --- wine1.7-1.7.14/dlls/dinput/joystick_osx.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/dinput/joystick_osx.c 2014-05-02 18:15:48.000000000 +0000 @@ -95,8 +95,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(dinput); -static IOHIDManagerRef gIOHIDManagerRef = NULL; -static CFArrayRef gCollections = NULL; +static CFMutableArrayRef device_main_elements = NULL; typedef struct JoystickImpl JoystickImpl; static const IDirectInputDevice8AVtbl JoystickAvt; @@ -108,7 +107,7 @@ /* osx private */ int id; - CFMutableArrayRef elementCFArrayRef; + CFArrayRef elements; ObjProps **propmap; FFDeviceObjectReference ff; struct list effects; @@ -181,36 +180,85 @@ CFArrayAppendValue( ( CFMutableArrayRef ) context, value ); } +static const char* debugstr_cf(CFTypeRef t) +{ + CFStringRef s; + const char* ret; + + if (!t) return "(null)"; + + if (CFGetTypeID(t) == CFStringGetTypeID()) + s = t; + else + s = CFCopyDescription(t); + ret = CFStringGetCStringPtr(s, kCFStringEncodingUTF8); + if (ret) ret = debugstr_a(ret); + if (!ret) + { + const UniChar* u = CFStringGetCharactersPtr(s); + if (u) + ret = debugstr_wn((const WCHAR*)u, CFStringGetLength(s)); + } + if (!ret) + { + UniChar buf[200]; + int len = min(CFStringGetLength(s), sizeof(buf)/sizeof(buf[0])); + CFStringGetCharacters(s, CFRangeMake(0, len), buf); + ret = debugstr_wn(buf, len); + } + if (s != t) CFRelease(s); + return ret; +} + +static const char* debugstr_device(IOHIDDeviceRef device) +{ + return wine_dbg_sprintf("", device, + debugstr_cf(IOHIDDeviceGetProperty(device, CFSTR(kIOHIDProductKey)))); +} + +static const char* debugstr_element(IOHIDElementRef element) +{ + return wine_dbg_sprintf("", element, + IOHIDElementGetType(element), IOHIDElementGetUsagePage(element), + IOHIDElementGetUsage(element), IOHIDElementGetDevice(element)); +} + static IOHIDDeviceRef get_device_ref(int id) { - IOHIDElementRef tIOHIDElementRef; - IOHIDDeviceRef tIOHIDDeviceRef; + IOHIDElementRef device_main_element; + IOHIDDeviceRef hid_device; - if (!gCollections) + TRACE("id %d\n", id); + + if (!device_main_elements || id >= CFArrayGetCount(device_main_elements)) return 0; - tIOHIDElementRef = (IOHIDElementRef)CFArrayGetValueAtIndex(gCollections, id); - if (!tIOHIDElementRef) + device_main_element = (IOHIDElementRef)CFArrayGetValueAtIndex(device_main_elements, id); + if (!device_main_element) { ERR("Invalid Element requested %i\n",id); return 0; } - tIOHIDDeviceRef = IOHIDElementGetDevice(tIOHIDElementRef); - if (!tIOHIDDeviceRef) + hid_device = IOHIDElementGetDevice(device_main_element); + if (!hid_device) { ERR("Invalid Device requested %i\n",id); return 0; } - return tIOHIDDeviceRef; + TRACE("-> %s\n", debugstr_device(hid_device)); + return hid_device; } static HRESULT get_ff(IOHIDDeviceRef device, FFDeviceObjectReference *ret) { io_service_t service; CFMutableDictionaryRef matching; - CFTypeRef type; + CFTypeRef location_id; + HRESULT hr; + + TRACE("device %s\n", debugstr_device(device)); matching = IOServiceMatching(kIOHIDDeviceKey); if(!matching){ @@ -218,61 +266,67 @@ return DIERR_DEVICENOTREG; } - type = IOHIDDeviceGetProperty(device, CFSTR(kIOHIDLocationIDKey)); - if(!matching){ + location_id = IOHIDDeviceGetProperty(device, CFSTR(kIOHIDLocationIDKey)); + if(!location_id){ CFRelease(matching); WARN("IOHIDDeviceGetProperty failed, force feedback disabled\n"); return DIERR_DEVICENOTREG; } - CFDictionaryAddValue(matching, CFSTR(kIOHIDLocationIDKey), type); + CFDictionaryAddValue(matching, CFSTR(kIOHIDLocationIDKey), location_id); service = IOServiceGetMatchingService(kIOMasterPortDefault, matching); - if(!ret) - return FFIsForceFeedback(service) == FF_OK ? S_OK : S_FALSE; + if (ret) + hr = osx_to_win32_hresult(FFCreateDevice(service, ret)); + else + hr = FFIsForceFeedback(service) == FF_OK ? S_OK : S_FALSE; - return osx_to_win32_hresult(FFCreateDevice(service, ret)); + IOObjectRelease(service); + TRACE("-> hr 0x%08x *ret %p\n", hr, ret ? *ret : NULL); + return hr; } -static CFMutableDictionaryRef creates_osx_device_match(int usage) +static CFMutableDictionaryRef create_osx_device_match(int usage) { CFMutableDictionaryRef result; + TRACE("usage %d\n", usage); + result = CFDictionaryCreateMutable( kCFAllocatorDefault, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks ); if ( result ) { int number = kHIDPage_GenericDesktop; - CFNumberRef pageCFNumberRef = CFNumberCreate( kCFAllocatorDefault, + CFNumberRef page = CFNumberCreate( kCFAllocatorDefault, kCFNumberIntType, &number); - if ( pageCFNumberRef ) + if (page) { - CFNumberRef usageCFNumberRef; + CFNumberRef cf_usage; - CFDictionarySetValue( result, CFSTR( kIOHIDDeviceUsagePageKey ), - pageCFNumberRef ); - CFRelease( pageCFNumberRef ); + CFDictionarySetValue( result, CFSTR( kIOHIDDeviceUsagePageKey ), page ); + CFRelease( page ); - usageCFNumberRef = CFNumberCreate( kCFAllocatorDefault, + cf_usage = CFNumberCreate( kCFAllocatorDefault, kCFNumberIntType, &usage); - if ( usageCFNumberRef ) + if (cf_usage) { - CFDictionarySetValue( result, CFSTR( kIOHIDDeviceUsageKey ), - usageCFNumberRef ); - CFRelease( usageCFNumberRef ); + CFDictionarySetValue( result, CFSTR( kIOHIDDeviceUsageKey ), cf_usage ); + CFRelease( cf_usage ); } else { ERR("CFNumberCreate() failed.\n"); + CFRelease(result); return NULL; } } else { ERR("CFNumberCreate failed.\n"); + CFRelease(result); return NULL; } } @@ -285,76 +339,86 @@ return result; } -static CFIndex find_top_level(IOHIDDeviceRef tIOHIDDeviceRef, CFArrayRef topLevels) +static CFIndex find_top_level(IOHIDDeviceRef hid_device, CFMutableArrayRef main_elements) { - CFArrayRef gElementCFArrayRef; - CFIndex numTops = 0; + CFArrayRef elements; + CFIndex total = 0; + + TRACE("hid_device %s\n", debugstr_device(hid_device)); - if (!tIOHIDDeviceRef) + if (!hid_device) return 0; - gElementCFArrayRef = IOHIDDeviceCopyMatchingElements(tIOHIDDeviceRef, NULL, 0); + elements = IOHIDDeviceCopyMatchingElements(hid_device, NULL, 0); - if (gElementCFArrayRef) + if (elements) { - CFIndex idx, cnt = CFArrayGetCount(gElementCFArrayRef); + CFIndex idx, cnt = CFArrayGetCount(elements); for (idx=0; idx total %d\n", (int)total); + return total; } -static void get_element_children(IOHIDElementRef tElement, CFArrayRef childElements) +static void get_element_children(IOHIDElementRef element, CFMutableArrayRef all_children) { CFIndex idx, cnt; - CFArrayRef tElementChildrenArray = IOHIDElementGetChildren(tElement); + CFArrayRef element_children = IOHIDElementGetChildren(element); - cnt = CFArrayGetCount(tElementChildrenArray); - if (cnt < 1) - return; + TRACE("element %s\n", debugstr_element(element)); + + cnt = CFArrayGetCount(element_children); /* Either add the element to the array or grab its children */ for (idx=0; idx usage2) + return kCFCompareGreaterThan; + return kCFCompareEqualTo; } static void get_osx_device_elements(JoystickImpl *device, int axis_map[8]) { - IOHIDElementRef tIOHIDElementRef; - CFArrayRef gElementCFArrayRef; - DWORD axes = 0; + IOHIDElementRef device_main_element; + CFMutableArrayRef elements; DWORD sliders = 0; - DWORD buttons = 0; - DWORD povs = 0; - device->elementCFArrayRef = NULL; + TRACE("device %p device->id %d\n", device, device->id); - if (!gCollections) - return; + device->elements = NULL; - tIOHIDElementRef = (IOHIDElementRef)CFArrayGetValueAtIndex(gCollections, device->id); + if (!device_main_elements || device->id >= CFArrayGetCount(device_main_elements)) + return; - if (!tIOHIDElementRef) + device_main_element = (IOHIDElementRef)CFArrayGetValueAtIndex(device_main_elements, device->id); + TRACE("device_main_element %s\n", debugstr_element(device_main_element)); + if (!device_main_element) return; - gElementCFArrayRef = CFArrayCreateMutable(kCFAllocatorDefault, 0, &kCFTypeArrayCallBacks); - get_element_children(tIOHIDElementRef, gElementCFArrayRef); + elements = CFArrayCreateMutable(kCFAllocatorDefault, 0, &kCFTypeArrayCallBacks); + get_element_children(device_main_element, elements); - if (gElementCFArrayRef) + if (elements) { - CFIndex idx, cnt = CFArrayGetCount( gElementCFArrayRef ); - /* build our element array in the order that dinput expects */ - device->elementCFArrayRef = CFArrayCreateMutable(NULL,0,NULL); + CFIndex idx, cnt = CFArrayGetCount( elements ); + CFMutableArrayRef axes = CFArrayCreateMutable(kCFAllocatorDefault, 0, &kCFTypeArrayCallBacks); + CFMutableArrayRef buttons = CFArrayCreateMutable(kCFAllocatorDefault, 0, &kCFTypeArrayCallBacks); + CFMutableArrayRef povs = CFArrayCreateMutable(kCFAllocatorDefault, 0, &kCFTypeArrayCallBacks); for ( idx = 0; idx < cnt; idx++ ) { - IOHIDElementRef tIOHIDElementRef = ( IOHIDElementRef ) CFArrayGetValueAtIndex( gElementCFArrayRef, idx ); - int eleType = IOHIDElementGetType( tIOHIDElementRef ); - switch(eleType) + IOHIDElementRef element = ( IOHIDElementRef ) CFArrayGetValueAtIndex( elements, idx ); + int type = IOHIDElementGetType( element ); + + TRACE("element %s\n", debugstr_element(element)); + + switch(type) { case kIOHIDElementTypeInput_Button: { - int usagePage = IOHIDElementGetUsagePage( tIOHIDElementRef ); - if (usagePage != kHIDPage_Button) + int usage_page = IOHIDElementGetUsagePage( element ); + TRACE("kIOHIDElementTypeInput_Button usage_page %d\n", usage_page); + if (usage_page != kHIDPage_Button) { /* avoid strange elements found on the 360 controller */ continue; } - if (buttons < 128) - { - CFArrayInsertValueAtIndex(device->elementCFArrayRef, (axes+povs+buttons), tIOHIDElementRef); - buttons++; - } + if (CFArrayGetCount(buttons) < 128) + CFArrayAppendValue(buttons, element); break; } case kIOHIDElementTypeInput_Axis: { - CFArrayInsertValueAtIndex(device->elementCFArrayRef, axes, tIOHIDElementRef); - axes++; + TRACE("kIOHIDElementTypeInput_Axis\n"); + CFArrayAppendValue(axes, element); break; } case kIOHIDElementTypeInput_Misc: { - uint32_t usage = IOHIDElementGetUsage( tIOHIDElementRef ); + uint32_t usage = IOHIDElementGetUsage( element ); switch(usage) { case kHIDUsage_GD_Hatswitch: { - CFArrayInsertValueAtIndex(device->elementCFArrayRef, (axes+povs), tIOHIDElementRef); - povs++; + TRACE("kIOHIDElementTypeInput_Misc / kHIDUsage_GD_Hatswitch\n"); + CFArrayAppendValue(povs, element); break; } case kHIDUsage_GD_Slider: @@ -538,53 +607,65 @@ case kHIDUsage_GD_Ry: case kHIDUsage_GD_Rz: { - CFArrayInsertValueAtIndex(device->elementCFArrayRef, axes, tIOHIDElementRef); - axis_map[axes]=usage; - axes++; + TRACE("kIOHIDElementTypeInput_Misc / kHIDUsage_GD_* (%d)\n", usage); + axis_map[CFArrayGetCount(axes)]=usage; + CFArrayAppendValue(axes, element); break; } default: - FIXME("Unhandled usage %i\n",usage); + FIXME("kIOHIDElementTypeInput_Misc / Unhandled usage %i\n", usage); } break; } default: - FIXME("Unhandled type %i\n",eleType); + FIXME("Unhandled type %i\n",type); } } - } - device->generic.devcaps.dwAxes = axes; - device->generic.devcaps.dwButtons = buttons; - device->generic.devcaps.dwPOVs = povs; - - /* Sort buttons into correct order */ - for (buttons = 0; buttons < device->generic.devcaps.dwButtons; buttons++) - { - IOHIDElementRef tIOHIDElementRef = ( IOHIDElementRef ) CFArrayGetValueAtIndex( device->elementCFArrayRef, axes+povs+buttons); - uint32_t usage = IOHIDElementGetUsage( tIOHIDElementRef ); - usage --; /* usage is 1 indexed we need 0 indexed */ - if (usage == buttons) - continue; + /* Sort buttons into correct order */ + CFArraySortValues(buttons, CFRangeMake(0, CFArrayGetCount(buttons)), button_usage_comparator, NULL); + + device->generic.devcaps.dwAxes = CFArrayGetCount(axes); + device->generic.devcaps.dwButtons = CFArrayGetCount(buttons); + device->generic.devcaps.dwPOVs = CFArrayGetCount(povs); + + TRACE("axes %u povs %u buttons %u\n", device->generic.devcaps.dwAxes, device->generic.devcaps.dwPOVs, + device->generic.devcaps.dwButtons); - insert_sort_button(axes+povs, tIOHIDElementRef, device->elementCFArrayRef,buttons,usage); + /* build our element array in the order that dinput expects */ + CFArrayAppendArray(axes, povs, CFRangeMake(0, device->generic.devcaps.dwPOVs)); + CFArrayAppendArray(axes, buttons, CFRangeMake(0, device->generic.devcaps.dwButtons)); + device->elements = axes; + axes = NULL; + + CFRelease(povs); + CFRelease(buttons); + CFRelease(elements); + } + else + { + device->generic.devcaps.dwAxes = 0; + device->generic.devcaps.dwButtons = 0; + device->generic.devcaps.dwPOVs = 0; } } static void get_osx_device_elements_props(JoystickImpl *device) { - CFArrayRef gElementCFArrayRef = device->elementCFArrayRef; + TRACE("device %p\n", device); - if (gElementCFArrayRef) + if (device->elements) { - CFIndex idx, cnt = CFArrayGetCount( gElementCFArrayRef ); + CFIndex idx, cnt = CFArrayGetCount( device->elements ); for ( idx = 0; idx < cnt; idx++ ) { - IOHIDElementRef tIOHIDElementRef = ( IOHIDElementRef ) CFArrayGetValueAtIndex( gElementCFArrayRef, idx ); + IOHIDElementRef element = ( IOHIDElementRef ) CFArrayGetValueAtIndex( device->elements, idx ); + + TRACE("element %s\n", debugstr_element(element)); - device->generic.props[idx].lDevMin = IOHIDElementGetLogicalMin(tIOHIDElementRef); - device->generic.props[idx].lDevMax = IOHIDElementGetLogicalMax(tIOHIDElementRef); + device->generic.props[idx].lDevMin = IOHIDElementGetLogicalMin(element); + device->generic.props[idx].lDevMax = IOHIDElementGetLogicalMax(element); device->generic.props[idx].lMin = 0; device->generic.props[idx].lMax = 0xffff; device->generic.props[idx].lDeadZone = 0; @@ -596,46 +677,49 @@ static void poll_osx_device_state(LPDIRECTINPUTDEVICE8A iface) { JoystickImpl *device = impl_from_IDirectInputDevice8A(iface); - IOHIDElementRef tIOHIDTopElementRef; - IOHIDDeviceRef tIOHIDDeviceRef; - CFArrayRef gElementCFArrayRef = device->elementCFArrayRef; + IOHIDElementRef device_main_element; + IOHIDDeviceRef hid_device; - TRACE("polling device %i\n",device->id); + TRACE("device %p device->id %i\n", device, device->id); - if (!gCollections) + if (!device_main_elements || device->id >= CFArrayGetCount(device_main_elements)) return; - tIOHIDTopElementRef = (IOHIDElementRef) CFArrayGetValueAtIndex(gCollections, device->id); - tIOHIDDeviceRef = IOHIDElementGetDevice(tIOHIDTopElementRef); - - if (!tIOHIDDeviceRef) + device_main_element = (IOHIDElementRef) CFArrayGetValueAtIndex(device_main_elements, device->id); + hid_device = IOHIDElementGetDevice(device_main_element); + TRACE("main element %s hid_device %s\n", debugstr_element(device_main_element), debugstr_device(hid_device)); + if (!hid_device) return; - if (gElementCFArrayRef) + if (device->elements) { int button_idx = 0; int pov_idx = 0; int slider_idx = 0; int inst_id; - CFIndex idx, cnt = CFArrayGetCount( gElementCFArrayRef ); + CFIndex idx, cnt = CFArrayGetCount( device->elements ); for ( idx = 0; idx < cnt; idx++ ) { IOHIDValueRef valueRef; int val, oldVal, newVal; - IOHIDElementRef tIOHIDElementRef = ( IOHIDElementRef ) CFArrayGetValueAtIndex( gElementCFArrayRef, idx ); - int eleType = IOHIDElementGetType( tIOHIDElementRef ); + IOHIDElementRef element = ( IOHIDElementRef ) CFArrayGetValueAtIndex( device->elements, idx ); + int type = IOHIDElementGetType( element ); - switch(eleType) + TRACE("element %s\n", debugstr_element(element)); + + switch(type) { case kIOHIDElementTypeInput_Button: + TRACE("kIOHIDElementTypeInput_Button\n"); if(button_idx < 128) { - IOHIDDeviceGetValue(tIOHIDDeviceRef, tIOHIDElementRef, &valueRef); + IOHIDDeviceGetValue(hid_device, element, &valueRef); val = IOHIDValueGetIntegerValue(valueRef); newVal = val ? 0x80 : 0x0; oldVal = device->generic.js.rgbButtons[button_idx]; device->generic.js.rgbButtons[button_idx] = newVal; + TRACE("valueRef %s val %d oldVal %d newVal %d\n", debugstr_cf(valueRef), val, oldVal, newVal); if (oldVal != newVal) { inst_id = DIDFT_MAKEINSTANCE(button_idx) | DIDFT_PSHBUTTON; @@ -646,12 +730,13 @@ break; case kIOHIDElementTypeInput_Misc: { - uint32_t usage = IOHIDElementGetUsage( tIOHIDElementRef ); + uint32_t usage = IOHIDElementGetUsage( element ); switch(usage) { case kHIDUsage_GD_Hatswitch: { - IOHIDDeviceGetValue(tIOHIDDeviceRef, tIOHIDElementRef, &valueRef); + TRACE("kIOHIDElementTypeInput_Misc / kHIDUsage_GD_Hatswitch\n"); + IOHIDDeviceGetValue(hid_device, element, &valueRef); val = IOHIDValueGetIntegerValue(valueRef); oldVal = device->generic.js.rgdwPOV[pov_idx]; if (val >= 8) @@ -659,6 +744,7 @@ else newVal = val * 4500; device->generic.js.rgdwPOV[pov_idx] = newVal; + TRACE("valueRef %s val %d oldVal %d newVal %d\n", debugstr_cf(valueRef), val, oldVal, newVal); if (oldVal != newVal) { inst_id = DIDFT_MAKEINSTANCE(pov_idx) | DIDFT_POV; @@ -677,48 +763,56 @@ { int wine_obj = -1; - IOHIDDeviceGetValue(tIOHIDDeviceRef, tIOHIDElementRef, &valueRef); + IOHIDDeviceGetValue(hid_device, element, &valueRef); val = IOHIDValueGetIntegerValue(valueRef); newVal = joystick_map_axis(&device->generic.props[idx], val); switch (usage) { case kHIDUsage_GD_X: + TRACE("kIOHIDElementTypeInput_Misc / kHIDUsage_GD_X\n"); wine_obj = 0; oldVal = device->generic.js.lX; device->generic.js.lX = newVal; break; case kHIDUsage_GD_Y: + TRACE("kIOHIDElementTypeInput_Misc / kHIDUsage_GD_Y\n"); wine_obj = 1; oldVal = device->generic.js.lY; device->generic.js.lY = newVal; break; case kHIDUsage_GD_Z: + TRACE("kIOHIDElementTypeInput_Misc / kHIDUsage_GD_Z\n"); wine_obj = 2; oldVal = device->generic.js.lZ; device->generic.js.lZ = newVal; break; case kHIDUsage_GD_Rx: + TRACE("kIOHIDElementTypeInput_Misc / kHIDUsage_GD_Rx\n"); wine_obj = 3; oldVal = device->generic.js.lRx; device->generic.js.lRx = newVal; break; case kHIDUsage_GD_Ry: + TRACE("kIOHIDElementTypeInput_Misc / kHIDUsage_GD_Ry\n"); wine_obj = 4; oldVal = device->generic.js.lRy; device->generic.js.lRy = newVal; break; case kHIDUsage_GD_Rz: + TRACE("kIOHIDElementTypeInput_Misc / kHIDUsage_GD_Rz\n"); wine_obj = 5; oldVal = device->generic.js.lRz; device->generic.js.lRz = newVal; break; case kHIDUsage_GD_Slider: + TRACE("kIOHIDElementTypeInput_Misc / kHIDUsage_GD_Slider\n"); wine_obj = 6 + slider_idx; oldVal = device->generic.js.rglSlider[slider_idx]; device->generic.js.rglSlider[slider_idx] = newVal; slider_idx ++; break; } + TRACE("valueRef %s val %d oldVal %d newVal %d\n", debugstr_cf(valueRef), val, oldVal, newVal); if ((wine_obj != -1) && (oldVal != newVal)) { @@ -729,12 +823,12 @@ break; } default: - FIXME("unhandled usage %i\n",usage); + FIXME("kIOHIDElementTypeInput_Misc / unhandled usage %i\n", usage); } break; } default: - FIXME("Unhandled type %i\n",eleType); + FIXME("Unhandled type %i\n",type); } } } @@ -753,6 +847,8 @@ static HRESULT joydev_enum_deviceA(DWORD dwDevType, DWORD dwFlags, LPDIDEVICEINSTANCEA lpddi, DWORD version, int id) { + TRACE("dwDevType %u dwFlags 0x%08x version 0x%04x id %d\n", dwDevType, dwFlags, version, id); + if (id >= find_joystick_devices()) return E_FAIL; if ((dwDevType == 0) || @@ -792,6 +888,8 @@ char name[MAX_PATH]; char friendly[32]; + TRACE("dwDevType %u dwFlags 0x%08x version 0x%04x id %d\n", dwDevType, dwFlags, version, id); + if (id >= find_joystick_devices()) return E_FAIL; if ((dwDevType == 0) || @@ -1027,6 +1125,7 @@ newDevice->generic.devcaps.dwFFDriverVersion = 0; if (TRACE_ON(dinput)) { + TRACE("allocated device %p\n", newDevice); _dump_DIDATAFORMAT(newDevice->generic.base.data_format.wine_df); _dump_DIDEVCAPS(&newDevice->generic.devcaps); } @@ -1037,6 +1136,8 @@ FAILED: hr = DIERR_OUTOFMEMORY; + if (newDevice->ff) FFReleaseDevice(newDevice->ff); + if (newDevice->elements) CFRelease(newDevice->elements); if (df) HeapFree(GetProcessHeap(), 0, df->rgodf); HeapFree(GetProcessHeap(), 0, df); release_DataFormat(&newDevice->generic.base.data_format); diff -Nru wine1.7-1.7.14/dlls/dmband/dmutils.c wine1.7-1.7.18/dlls/dmband/dmutils.c --- wine1.7-1.7.14/dlls/dmband/dmutils.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/dmband/dmutils.c 2014-05-02 18:15:48.000000000 +0000 @@ -37,6 +37,7 @@ #include "wine/unicode.h" #include "objbase.h" +#include "initguid.h" #include "dmusici.h" #include "dmusicf.h" #include "dmusics.h" diff -Nru wine1.7-1.7.14/dlls/dmcompos/chordmap.c wine1.7-1.7.18/dlls/dmcompos/chordmap.c --- wine1.7-1.7.14/dlls/dmcompos/chordmap.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/dmcompos/chordmap.c 2014-05-02 18:15:48.000000000 +0000 @@ -22,116 +22,95 @@ WINE_DEFAULT_DEBUG_CHANNEL(dmcompos); WINE_DECLARE_DEBUG_CHANNEL(dmfile); -static ULONG WINAPI IDirectMusicChordMapImpl_IUnknown_AddRef (LPUNKNOWN iface); -static ULONG WINAPI IDirectMusicChordMapImpl_IDirectMusicChordMap_AddRef (LPDIRECTMUSICCHORDMAP iface); -static ULONG WINAPI IDirectMusicChordMapImpl_IDirectMusicObject_AddRef (LPDIRECTMUSICOBJECT iface); -static ULONG WINAPI IDirectMusicChordMapImpl_IPersistStream_AddRef (LPPERSISTSTREAM iface); - /***************************************************************************** * IDirectMusicChordMapImpl implementation */ -/* IDirectMusicChordMapImpl IUnknown part: */ -static HRESULT WINAPI IDirectMusicChordMapImpl_IUnknown_QueryInterface (LPUNKNOWN iface, REFIID riid, LPVOID *ppobj) { - ICOM_THIS_MULTI(IDirectMusicChordMapImpl, UnknownVtbl, iface); - TRACE("(%p, %s, %p)\n", This, debugstr_dmguid(riid), ppobj); - - if (IsEqualIID (riid, &IID_IUnknown)) { - *ppobj = &This->UnknownVtbl; - IDirectMusicChordMapImpl_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl); - return S_OK; - } else if (IsEqualIID (riid, &IID_IDirectMusicChordMap)) { - *ppobj = &This->ChordMapVtbl; - IDirectMusicChordMapImpl_IDirectMusicChordMap_AddRef ((LPDIRECTMUSICCHORDMAP)&This->ChordMapVtbl); - return S_OK; - } else if (IsEqualIID (riid, &IID_IDirectMusicObject)) { - *ppobj = &This->ObjectVtbl; - IDirectMusicChordMapImpl_IDirectMusicObject_AddRef ((LPDIRECTMUSICOBJECT)&This->ObjectVtbl); - return S_OK; - } else if (IsEqualIID (riid, &IID_IPersistStream)) { - *ppobj = &This->PersistStreamVtbl; - IDirectMusicChordMapImpl_IPersistStream_AddRef ((LPPERSISTSTREAM)&This->PersistStreamVtbl); - return S_OK; - } - - WARN("(%p, %s, %p): not found\n", This, debugstr_dmguid(riid), ppobj); - return E_NOINTERFACE; + +/* IDirectMusicChordMapImpl IDirectMusicChordMap part: */ +static inline IDirectMusicChordMapImpl *impl_from_IDirectMusicChordMap(IDirectMusicChordMap *iface) +{ + return CONTAINING_RECORD(iface, IDirectMusicChordMapImpl, IDirectMusicChordMap_iface); } -static ULONG WINAPI IDirectMusicChordMapImpl_IUnknown_AddRef (LPUNKNOWN iface) { - ICOM_THIS_MULTI(IDirectMusicChordMapImpl, UnknownVtbl, iface); - ULONG ref = InterlockedIncrement(&This->ref); +static HRESULT WINAPI IDirectMusicChordMapImpl_QueryInterface(IDirectMusicChordMap *iface, + REFIID riid, void **ret_iface) +{ + IDirectMusicChordMapImpl *This = impl_from_IDirectMusicChordMap(iface); - TRACE("(%p): AddRef from %d\n", This, ref - 1); - - DMCOMPOS_LockModule(); - - return ref; -} + TRACE("(%p, %s, %p)\n", This, debugstr_dmguid(riid), ret_iface); -static ULONG WINAPI IDirectMusicChordMapImpl_IUnknown_Release (LPUNKNOWN iface) { - ICOM_THIS_MULTI(IDirectMusicChordMapImpl, UnknownVtbl, iface); - ULONG ref = InterlockedDecrement(&This->ref); + *ret_iface = NULL; - TRACE("(%p): ReleaseRef to %d\n", This, ref); - - if (ref == 0) { - HeapFree(GetProcessHeap(), 0, This); - } - - DMCOMPOS_UnlockModule(); - - return ref; + if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IDirectMusicChordMap)) + *ret_iface = iface; + else if (IsEqualIID(riid, &IID_IDirectMusicObject)) + *ret_iface = &This->ObjectVtbl; + else if (IsEqualIID(riid, &IID_IPersistStream)) + *ret_iface = &This->PersistStreamVtbl; + else { + WARN("(%p, %s, %p): not found\n", This, debugstr_dmguid(riid), ret_iface); + return E_NOINTERFACE; + } + + IUnknown_AddRef((IUnknown*)*ret_iface); + return S_OK; } -static const IUnknownVtbl DirectMusicChordMap_Unknown_Vtbl = { - IDirectMusicChordMapImpl_IUnknown_QueryInterface, - IDirectMusicChordMapImpl_IUnknown_AddRef, - IDirectMusicChordMapImpl_IUnknown_Release -}; +static ULONG WINAPI IDirectMusicChordMapImpl_AddRef(IDirectMusicChordMap *iface) +{ + IDirectMusicChordMapImpl *This = impl_from_IDirectMusicChordMap(iface); + LONG ref = InterlockedIncrement(&This->ref); -/* IDirectMusicChordMapImpl IDirectMusicChordMap part: */ -static HRESULT WINAPI IDirectMusicChordMapImpl_IDirectMusicChordMap_QueryInterface (LPDIRECTMUSICCHORDMAP iface, REFIID riid, LPVOID *ppobj) { - ICOM_THIS_MULTI(IDirectMusicChordMapImpl, ChordMapVtbl, iface); - return IDirectMusicChordMapImpl_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj); -} + TRACE("(%p) ref=%d\n", This, ref); -static ULONG WINAPI IDirectMusicChordMapImpl_IDirectMusicChordMap_AddRef (LPDIRECTMUSICCHORDMAP iface) { - ICOM_THIS_MULTI(IDirectMusicChordMapImpl, ChordMapVtbl, iface); - return IDirectMusicChordMapImpl_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl); + return ref; } -static ULONG WINAPI IDirectMusicChordMapImpl_IDirectMusicChordMap_Release (LPDIRECTMUSICCHORDMAP iface) { - ICOM_THIS_MULTI(IDirectMusicChordMapImpl, ChordMapVtbl, iface); - return IDirectMusicChordMapImpl_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl); +static ULONG WINAPI IDirectMusicChordMapImpl_Release(IDirectMusicChordMap *iface) +{ + IDirectMusicChordMapImpl *This = impl_from_IDirectMusicChordMap(iface); + LONG ref = InterlockedDecrement(&This->ref); + + TRACE("(%p) ref=%d\n", This, ref); + + if (!ref) { + HeapFree(GetProcessHeap(), 0, This->pDesc); + HeapFree(GetProcessHeap(), 0, This); + DMCOMPOS_UnlockModule(); + } + + return ref; } -static HRESULT WINAPI IDirectMusicChordMapImpl_IDirectMusicChordMap_GetScale (LPDIRECTMUSICCHORDMAP iface, DWORD* pdwScale) { - ICOM_THIS_MULTI(IDirectMusicChordMapImpl, ChordMapVtbl, iface); - FIXME("(%p, %p): stub\n", This, pdwScale); - return S_OK; +static HRESULT WINAPI IDirectMusicChordMapImpl_GetScale(IDirectMusicChordMap *iface, + DWORD *pdwScale) +{ + IDirectMusicChordMapImpl *This = impl_from_IDirectMusicChordMap(iface); + FIXME("(%p, %p): stub\n", This, pdwScale); + return S_OK; } -static const IDirectMusicChordMapVtbl DirectMusicChordMap_ChordMap_Vtbl = { - IDirectMusicChordMapImpl_IDirectMusicChordMap_QueryInterface, - IDirectMusicChordMapImpl_IDirectMusicChordMap_AddRef, - IDirectMusicChordMapImpl_IDirectMusicChordMap_Release, - IDirectMusicChordMapImpl_IDirectMusicChordMap_GetScale +static const IDirectMusicChordMapVtbl dmchordmap_vtbl = { + IDirectMusicChordMapImpl_QueryInterface, + IDirectMusicChordMapImpl_AddRef, + IDirectMusicChordMapImpl_Release, + IDirectMusicChordMapImpl_GetScale }; /* IDirectMusicChordMapImpl IDirectMusicObject part: */ static HRESULT WINAPI IDirectMusicChordMapImpl_IDirectMusicObject_QueryInterface (LPDIRECTMUSICOBJECT iface, REFIID riid, LPVOID *ppobj) { ICOM_THIS_MULTI(IDirectMusicChordMapImpl, ObjectVtbl, iface); - return IDirectMusicChordMapImpl_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj); + return IDirectMusicChordMap_QueryInterface(&This->IDirectMusicChordMap_iface, riid, ppobj); } static ULONG WINAPI IDirectMusicChordMapImpl_IDirectMusicObject_AddRef (LPDIRECTMUSICOBJECT iface) { ICOM_THIS_MULTI(IDirectMusicChordMapImpl, ObjectVtbl, iface); - return IDirectMusicChordMapImpl_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl); + return IDirectMusicChordMap_AddRef(&This->IDirectMusicChordMap_iface); } static ULONG WINAPI IDirectMusicChordMapImpl_IDirectMusicObject_Release (LPDIRECTMUSICOBJECT iface) { ICOM_THIS_MULTI(IDirectMusicChordMapImpl, ObjectVtbl, iface); - return IDirectMusicChordMapImpl_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl); + return IDirectMusicChordMap_Release(&This->IDirectMusicChordMap_iface); } static HRESULT WINAPI IDirectMusicChordMapImpl_IDirectMusicObject_GetDescriptor (LPDIRECTMUSICOBJECT iface, LPDMUS_OBJECTDESC pDesc) { @@ -336,17 +315,17 @@ /* IDirectMusicChordMapImpl IPersistStream part: */ static HRESULT WINAPI IDirectMusicChordMapImpl_IPersistStream_QueryInterface (LPPERSISTSTREAM iface, REFIID riid, LPVOID *ppobj) { ICOM_THIS_MULTI(IDirectMusicChordMapImpl, PersistStreamVtbl, iface); - return IDirectMusicChordMapImpl_IUnknown_QueryInterface ((LPUNKNOWN)&This->UnknownVtbl, riid, ppobj); + return IDirectMusicChordMap_QueryInterface(&This->IDirectMusicChordMap_iface, riid, ppobj); } static ULONG WINAPI IDirectMusicChordMapImpl_IPersistStream_AddRef (LPPERSISTSTREAM iface) { ICOM_THIS_MULTI(IDirectMusicChordMapImpl, PersistStreamVtbl, iface); - return IDirectMusicChordMapImpl_IUnknown_AddRef ((LPUNKNOWN)&This->UnknownVtbl); + return IDirectMusicChordMap_AddRef(&This->IDirectMusicChordMap_iface); } static ULONG WINAPI IDirectMusicChordMapImpl_IPersistStream_Release (LPPERSISTSTREAM iface) { ICOM_THIS_MULTI(IDirectMusicChordMapImpl, PersistStreamVtbl, iface); - return IDirectMusicChordMapImpl_IUnknown_Release ((LPUNKNOWN)&This->UnknownVtbl); + return IDirectMusicChordMap_Release(&This->IDirectMusicChordMap_iface); } static HRESULT WINAPI IDirectMusicChordMapImpl_IPersistStream_GetClassID (LPPERSISTSTREAM iface, CLSID* pClassID) { @@ -527,21 +506,25 @@ HRESULT WINAPI create_dmchordmap(REFIID lpcGUID, void **ppobj) { IDirectMusicChordMapImpl* obj; - + HRESULT hr; + obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicChordMapImpl)); if (NULL == obj) { *ppobj = NULL; return E_OUTOFMEMORY; } - obj->UnknownVtbl = &DirectMusicChordMap_Unknown_Vtbl; - obj->ChordMapVtbl = &DirectMusicChordMap_ChordMap_Vtbl; + obj->IDirectMusicChordMap_iface.lpVtbl = &dmchordmap_vtbl; obj->ObjectVtbl = &DirectMusicChordMap_Object_Vtbl; obj->PersistStreamVtbl = &DirectMusicChordMap_PersistStream_Vtbl; obj->pDesc = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(DMUS_OBJECTDESC)); DM_STRUCT_INIT(obj->pDesc); obj->pDesc->dwValidData |= DMUS_OBJ_CLASS; obj->pDesc->guidClass = CLSID_DirectMusicChordMap; - obj->ref = 0; /* will be inited by QueryInterface */ + obj->ref = 1; + + DMCOMPOS_LockModule(); + hr = IDirectMusicChordMap_QueryInterface(&obj->IDirectMusicChordMap_iface, lpcGUID, ppobj); + IDirectMusicChordMap_Release(&obj->IDirectMusicChordMap_iface); - return IDirectMusicChordMapImpl_IUnknown_QueryInterface ((LPUNKNOWN)&obj->UnknownVtbl, lpcGUID, ppobj); + return hr; } diff -Nru wine1.7-1.7.14/dlls/dmcompos/dmcompos_main.c wine1.7-1.7.18/dlls/dmcompos/dmcompos_main.c --- wine1.7-1.7.14/dlls/dmcompos/dmcompos_main.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/dmcompos/dmcompos_main.c 2014-05-02 18:15:48.000000000 +0000 @@ -20,6 +20,20 @@ #include "config.h" #include "wine/port.h" +#include + +#define COBJMACROS + +#include "windef.h" +#include "winbase.h" +#include "winnt.h" +#include "wingdi.h" +#include "winuser.h" +#include "winreg.h" +#include "objbase.h" +#include "initguid.h" +#include "dmusici.h" + #include "dmcompos_private.h" #include "rpcproxy.h" diff -Nru wine1.7-1.7.14/dlls/dmcompos/dmcompos_private.h wine1.7-1.7.18/dlls/dmcompos/dmcompos_private.h --- wine1.7-1.7.14/dlls/dmcompos/dmcompos_private.h 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/dmcompos/dmcompos_private.h 2014-05-02 18:15:48.000000000 +0000 @@ -61,9 +61,7 @@ * IDirectMusicChordMapImpl implementation structure */ struct IDirectMusicChordMapImpl { - /* IUnknown fields */ - const IUnknownVtbl *UnknownVtbl; - const IDirectMusicChordMapVtbl *ChordMapVtbl; + IDirectMusicChordMap IDirectMusicChordMap_iface; const IDirectMusicObjectVtbl *ObjectVtbl; const IPersistStreamVtbl *PersistStreamVtbl; LONG ref; diff -Nru wine1.7-1.7.14/dlls/dmime/dmime_main.c wine1.7-1.7.18/dlls/dmime/dmime_main.c --- wine1.7-1.7.14/dlls/dmime/dmime_main.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/dmime/dmime_main.c 2014-05-02 18:15:48.000000000 +0000 @@ -18,8 +18,22 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "dmime_private.h" +#include + +#define COBJMACROS + +#include "windef.h" +#include "winbase.h" +#include "winnt.h" +#include "wingdi.h" +#include "winuser.h" +#include "winreg.h" +#include "objbase.h" #include "rpcproxy.h" +#include "initguid.h" +#include "dmusici.h" + +#include "dmime_private.h" WINE_DEFAULT_DEBUG_CHANNEL(dmime); diff -Nru wine1.7-1.7.14/dlls/dmime/segment.c wine1.7-1.7.18/dlls/dmime/segment.c --- wine1.7-1.7.14/dlls/dmime/segment.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/dmime/segment.c 2014-05-02 18:15:48.000000000 +0000 @@ -171,7 +171,7 @@ if (0xFFFFFFFF != dwGroupBits && 0 == (pIt->dwGroupBits & dwGroupBits)) continue ; if (FALSE == IsEqualGUID(&GUID_NULL, rguidType)) { /** - * it rguidType is not null we must check if CLSID are equals + * it rguidType is not null we must check if CLSIDs are equal * and the unique way to get it is using IPersistStream Interface */ hr = IDirectMusicTrack_QueryInterface(pIt->pTrack, &IID_IPersistStream, (void**) &pCLSIDStream); diff -Nru wine1.7-1.7.14/dlls/dmloader/container.c wine1.7-1.7.18/dlls/dmloader/container.c --- wine1.7-1.7.14/dlls/dmloader/container.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/dmloader/container.c 2014-05-02 18:15:48.000000000 +0000 @@ -36,8 +36,8 @@ */ /* IUnknown/IDirectMusicContainer part: */ -static HRESULT DMUSIC_DestroyDirectMusicContainerImpl (LPDIRECTMUSICCONTAINER iface) { - ICOM_THIS_MULTI(IDirectMusicContainerImpl, ContainerVtbl, iface); +static HRESULT destroy_dmcontainer(IDirectMusicContainerImpl *This) +{ LPDIRECTMUSICLOADER pLoader; LPDIRECTMUSICGETLOADER pGetLoader; struct list *pEntry; @@ -68,7 +68,6 @@ IStream_Release (This->pStream); /* FIXME: release allocated entries */ - unlock_module(); return S_OK; } @@ -108,8 +107,10 @@ DWORD dwRef = InterlockedDecrement (&This->dwRef); TRACE("(%p): ReleaseRef to %d\n", This, dwRef); if (dwRef == 0) { - DMUSIC_DestroyDirectMusicContainerImpl (iface); + if (This->pStream) + destroy_dmcontainer(This); HeapFree(GetProcessHeap(), 0, This); + unlock_module(); } return dwRef; @@ -909,7 +910,8 @@ }; /* for ClassFactory */ -HRESULT WINAPI DMUSIC_CreateDirectMusicContainerImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter) { +HRESULT WINAPI create_dmcontainer(REFIID lpcGUID, void **ppobj) +{ IDirectMusicContainerImpl* obj; obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicContainerImpl)); diff -Nru wine1.7-1.7.14/dlls/dmloader/dmloader_main.c wine1.7-1.7.18/dlls/dmloader/dmloader_main.c --- wine1.7-1.7.14/dlls/dmloader/dmloader_main.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/dmloader/dmloader_main.c 2014-05-02 18:15:48.000000000 +0000 @@ -17,8 +17,22 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "dmloader_private.h" +#include + +#define COBJMACROS + +#include "windef.h" +#include "winbase.h" +#include "winnt.h" +#include "wingdi.h" +#include "winuser.h" +#include "winreg.h" +#include "objbase.h" #include "rpcproxy.h" +#include "initguid.h" +#include "dmusici.h" + +#include "dmloader_private.h" WINE_DEFAULT_DEBUG_CHANNEL(dmloader); @@ -27,7 +41,7 @@ typedef struct { IClassFactory IClassFactory_iface; - HRESULT WINAPI (*fnCreateInstance)(REFIID riid, void **ppv, IUnknown *pUnkOuter); + HRESULT WINAPI (*fnCreateInstance)(REFIID riid, void **ppv); } IClassFactoryImpl; /****************************************************************** @@ -73,13 +87,18 @@ } static HRESULT WINAPI ClassFactory_CreateInstance(IClassFactory *iface, IUnknown *pUnkOuter, - REFIID riid, void **ppv) + REFIID riid, void **ret_iface) { IClassFactoryImpl *This = impl_from_IClassFactory(iface); - TRACE ("(%p, %s, %p)\n", pUnkOuter, debugstr_dmguid(riid), ppv); + TRACE ("(%s, %p)\n", debugstr_dmguid(riid), ret_iface); + + if (pUnkOuter) { + *ret_iface = NULL; + return CLASS_E_NOAGGREGATION; + } - return This->fnCreateInstance(riid, ppv, pUnkOuter); + return This->fnCreateInstance(riid, ret_iface); } static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL dolock) @@ -102,9 +121,8 @@ ClassFactory_LockServer }; -static IClassFactoryImpl dm_loader_CF = {{&classfactory_vtbl}, DMUSIC_CreateDirectMusicLoaderImpl}; -static IClassFactoryImpl dm_container_CF = {{&classfactory_vtbl}, - DMUSIC_CreateDirectMusicContainerImpl}; +static IClassFactoryImpl dm_loader_CF = {{&classfactory_vtbl}, create_dmloader}; +static IClassFactoryImpl dm_container_CF = {{&classfactory_vtbl}, create_dmcontainer}; /****************************************************************** * DllMain diff -Nru wine1.7-1.7.14/dlls/dmloader/dmloader_private.h wine1.7-1.7.18/dlls/dmloader/dmloader_private.h --- wine1.7-1.7.14/dlls/dmloader/dmloader_private.h 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/dmloader/dmloader_private.h 2014-05-02 18:15:48.000000000 +0000 @@ -65,8 +65,8 @@ /***************************************************************************** * Creation helpers */ -extern HRESULT WINAPI DMUSIC_CreateDirectMusicLoaderImpl (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN; -extern HRESULT WINAPI DMUSIC_CreateDirectMusicContainerImpl (LPCGUID lpcGUID, LPVOID *ppobj, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN; +extern HRESULT WINAPI create_dmloader(REFIID riid, void **ret_iface) DECLSPEC_HIDDEN; +extern HRESULT WINAPI create_dmcontainer(REFIID riid, void **ret_iface) DECLSPEC_HIDDEN; extern HRESULT WINAPI DMUSIC_CreateDirectMusicLoaderFileStream (LPVOID *ppobj) DECLSPEC_HIDDEN; extern HRESULT WINAPI DMUSIC_CreateDirectMusicLoaderResourceStream (LPVOID *ppobj) DECLSPEC_HIDDEN; extern HRESULT WINAPI DMUSIC_CreateDirectMusicLoaderGenericStream (LPVOID *ppobj) DECLSPEC_HIDDEN; diff -Nru wine1.7-1.7.14/dlls/dmloader/loader.c wine1.7-1.7.18/dlls/dmloader/loader.c --- wine1.7-1.7.14/dlls/dmloader/loader.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/dmloader/loader.c 2014-05-02 18:15:48.000000000 +0000 @@ -888,14 +888,14 @@ } /* for ClassFactory */ -HRESULT WINAPI DMUSIC_CreateDirectMusicLoaderImpl(const GUID *lpcGUID, void **ppobj, IUnknown *pUnkOuter) +HRESULT WINAPI create_dmloader(REFIID lpcGUID, void **ppobj) { IDirectMusicLoaderImpl *obj; DMUS_OBJECTDESC Desc; LPWINE_LOADER_ENTRY pDefaultDLSEntry; struct list *pEntry; - TRACE("(%s, %p, %p)\n", debugstr_dmguid(lpcGUID), ppobj, pUnkOuter); + TRACE("(%s, %p)\n", debugstr_dmguid(lpcGUID), ppobj); obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicLoaderImpl)); if (NULL == obj) { *ppobj = NULL; diff -Nru wine1.7-1.7.14/dlls/dmloader/tests/loader.c wine1.7-1.7.18/dlls/dmloader/tests/loader.c --- wine1.7-1.7.14/dlls/dmloader/tests/loader.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/dmloader/tests/loader.c 2014-05-02 18:15:48.000000000 +0000 @@ -27,17 +27,26 @@ "fmt \x10\x00\x00\x00\x01\x00\x20\x00\xAC\x44\x00\x00\x10\xB1\x02\x00\x04\x00\x10\x00" /* format segment: PCM, 2 chan, 44100 Hz, 16 bits */ "data\x00\x01\x00\x00"; /* 256 byte data segment (silence) */ +static BOOL missing_dmloader(void) +{ + IDirectMusicLoader8 *dml; + HRESULT hr = CoCreateInstance(&CLSID_DirectMusicLoader, NULL, CLSCTX_INPROC_SERVER, + &IID_IDirectMusicLoader8, (void**)&dml); + + if (hr == S_OK && dml) + { + IDirectMusicLoader8_Release(dml); + return FALSE; + } + return TRUE; +} + static void test_release_object(void) { HRESULT hr; IDirectMusicLoader8* loader = NULL; hr = CoCreateInstance(&CLSID_DirectMusicLoader, NULL, CLSCTX_INPROC, &IID_IDirectMusicLoader8, (void**)&loader); - if ( FAILED(hr) ) - { - skip("CoCreateInstance failed.\n"); - return; - } hr = IDirectMusicLoader_ReleaseObject(loader, NULL); ok(hr == E_POINTER, "Expected E_POINTER, received %#x\n", hr); @@ -125,10 +134,103 @@ IDirectMusicLoader8_Release(loader); } +static void test_COM(void) +{ + IDirectMusicLoader8 *dml8 = (IDirectMusicLoader8*)0xdeadbeef; + IUnknown *unk; + ULONG refcount; + HRESULT hr; + + /* COM aggregation */ + hr = CoCreateInstance(&CLSID_DirectMusicLoader, (IUnknown*)&dml8, CLSCTX_INPROC_SERVER, + &IID_IUnknown, (void**)&dml8); + ok(hr == CLASS_E_NOAGGREGATION, + "DirectMusicLoader create failed: %08x, expected CLASS_E_NOAGGREGATION\n", hr); + ok(!dml8, "dml8 = %p\n", dml8); + + /* Invalid RIID */ + hr = CoCreateInstance(&CLSID_DirectMusicLoader, NULL, CLSCTX_INPROC_SERVER, + &IID_IDirectMusicObject, (void**)&dml8); + ok(hr == E_NOINTERFACE, "DirectMusicLoader create failed: %08x, expected E_NOINTERFACE\n", hr); + + /* Same refcount for all DirectMusicLoader interfaces */ + hr = CoCreateInstance(&CLSID_DirectMusicLoader, NULL, CLSCTX_INPROC_SERVER, + &IID_IDirectMusicLoader8, (void**)&dml8); + ok(hr == S_OK, "DirectMusicLoader create failed: %08x, expected S_OK\n", hr); + refcount = IDirectMusicLoader8_AddRef(dml8); + ok(refcount == 2, "refcount == %u, expected 2\n", refcount); + + hr = IDirectMusicLoader8_QueryInterface(dml8, &IID_IUnknown, (void**)&unk); + ok(hr == S_OK, "QueryInterface for IID_IUnknown failed: %08x\n", hr); + refcount = IUnknown_AddRef(unk); + ok(refcount == 4, "refcount == %u, expected 4\n", refcount); + refcount = IUnknown_Release(unk); + + while (IDirectMusicLoader8_Release(dml8)); +} + +static void test_COM_container(void) +{ + IDirectMusicContainer *dmc = (IDirectMusicContainer*)0xdeadbeef; + IDirectMusicObject *dmo; + IPersistStream *ps; + IUnknown *unk; + ULONG refcount; + HRESULT hr; + + /* COM aggregation */ + hr = CoCreateInstance(&CLSID_DirectMusicContainer, (IUnknown*)&dmc, CLSCTX_INPROC_SERVER, + &IID_IUnknown, (void**)&dmc); + ok(hr == CLASS_E_NOAGGREGATION, + "DirectMusicContainer create failed: %08x, expected CLASS_E_NOAGGREGATION\n", hr); + ok(!dmc, "dmc = %p\n", dmc); + + /* Invalid RIID */ + hr = CoCreateInstance(&CLSID_DirectMusicContainer, NULL, CLSCTX_INPROC_SERVER, + &IID_IClassFactory, (void**)&dmc); + ok(hr == E_NOINTERFACE, "DirectMusicContainer create failed: %08x, expected E_NOINTERFACE\n", hr); + + /* Same refcount for all DirectMusicContainer interfaces */ + hr = CoCreateInstance(&CLSID_DirectMusicContainer, NULL, CLSCTX_INPROC_SERVER, + &IID_IDirectMusicContainer, (void**)&dmc); + ok(hr == S_OK, "DirectMusicContainer create failed: %08x, expected S_OK\n", hr); + refcount = IDirectMusicContainer_AddRef(dmc); + ok(refcount == 2, "refcount == %u, expected 2\n", refcount); + + hr = IDirectMusicContainer_QueryInterface(dmc, &IID_IDirectMusicObject, (void**)&dmo); + ok(hr == S_OK, "QueryInterface for IID_IDirectMusicObject failed: %08x\n", hr); + refcount = IDirectMusicObject_AddRef(dmo); + ok(refcount == 4, "refcount == %u, expected 4\n", refcount); + refcount = IDirectMusicObject_Release(dmo); + + hr = IDirectMusicContainer_QueryInterface(dmc, &IID_IPersistStream, (void**)&ps); + ok(hr == S_OK, "QueryInterface for IID_IPersistStream failed: %08x\n", hr); + refcount = IPersistStream_AddRef(ps); + ok(refcount == 5, "refcount == %u, expected 5\n", refcount); + refcount = IPersistStream_Release(ps); + + hr = IDirectMusicContainer_QueryInterface(dmc, &IID_IUnknown, (void**)&unk); + ok(hr == S_OK, "QueryInterface for IID_IUnknown failed: %08x\n", hr); + refcount = IUnknown_AddRef(unk); + ok(refcount == 6, "refcount == %u, expected 6\n", refcount); + refcount = IUnknown_Release(unk); + + while (IDirectMusicContainer_Release(dmc)); +} + START_TEST(loader) { CoInitialize(NULL); + + if (missing_dmloader()) + { + skip("dmloader not available\n"); + CoUninitialize(); + return; + } test_release_object(); test_simple_playing(); + test_COM(); + test_COM_container(); CoUninitialize(); } diff -Nru wine1.7-1.7.14/dlls/dmscript/dmscript_main.c wine1.7-1.7.18/dlls/dmscript/dmscript_main.c --- wine1.7-1.7.14/dlls/dmscript/dmscript_main.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/dmscript/dmscript_main.c 2014-05-02 18:15:48.000000000 +0000 @@ -20,8 +20,22 @@ #include "config.h" #include "wine/port.h" -#include "dmscript_private.h" +#include + +#define COBJMACROS + +#include "windef.h" +#include "winbase.h" +#include "winnt.h" +#include "wingdi.h" +#include "winuser.h" +#include "winreg.h" +#include "objbase.h" #include "rpcproxy.h" +#include "initguid.h" +#include "dmusici.h" + +#include "dmscript_private.h" WINE_DEFAULT_DEBUG_CHANNEL(dmscript); diff -Nru wine1.7-1.7.14/dlls/dmstyle/dmstyle_main.c wine1.7-1.7.18/dlls/dmstyle/dmstyle_main.c --- wine1.7-1.7.14/dlls/dmstyle/dmstyle_main.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/dmstyle/dmstyle_main.c 2014-05-02 18:15:48.000000000 +0000 @@ -17,8 +17,22 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "dmstyle_private.h" +#include + +#define COBJMACROS + +#include "windef.h" +#include "winbase.h" +#include "winnt.h" +#include "wingdi.h" +#include "winuser.h" +#include "winreg.h" +#include "objbase.h" #include "rpcproxy.h" +#include "initguid.h" +#include "dmusici.h" + +#include "dmstyle_private.h" WINE_DEFAULT_DEBUG_CHANNEL(dmstyle); diff -Nru wine1.7-1.7.14/dlls/dmusic/dmusic_main.c wine1.7-1.7.18/dlls/dmusic/dmusic_main.c --- wine1.7-1.7.14/dlls/dmusic/dmusic_main.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/dmusic/dmusic_main.c 2014-05-02 18:15:48.000000000 +0000 @@ -21,9 +21,22 @@ #include "wine/port.h" #include +#include -#include "dmusic_private.h" +#define COBJMACROS + +#include "windef.h" +#include "winbase.h" +#include "winnt.h" +#include "wingdi.h" +#include "winuser.h" +#include "winreg.h" +#include "objbase.h" #include "rpcproxy.h" +#include "initguid.h" +#include "dmusici.h" + +#include "dmusic_private.h" WINE_DEFAULT_DEBUG_CHANNEL(dmusic); diff -Nru wine1.7-1.7.14/dlls/dplayx/dplayx_global.c wine1.7-1.7.18/dlls/dplayx/dplayx_global.c --- wine1.7-1.7.14/dlls/dplayx/dplayx_global.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/dplayx/dplayx_global.c 2014-05-02 18:15:48.000000000 +0000 @@ -84,8 +84,9 @@ typedef struct { BOOL used; - DWORD data[dwBlockSize-sizeof(DWORD)]; + BYTE data[dwBlockSize - sizeof(BOOL)]; } DPLAYX_MEM_SLICE; +C_ASSERT(sizeof(DPLAYX_MEM_SLICE) == dwBlockSize); static DPLAYX_MEM_SLICE* lpMemArea; @@ -100,7 +101,7 @@ return; } - lpAddrStart = (char*)addr - sizeof(DWORD); /* Find block header */ + lpAddrStart = CONTAINING_RECORD(addr, DPLAYX_MEM_SLICE, data); /* Find block header */ dwBlockUsed = ((BYTE*)lpAddrStart - (BYTE*)lpMemArea)/dwBlockSize; lpMemArea[ dwBlockUsed ].used = FALSE; @@ -111,10 +112,10 @@ LPVOID lpvArea = NULL; UINT uBlockUsed; - if( size > (dwBlockSize - sizeof(DWORD)) ) + if( size > (dwBlockSize - sizeof(BOOL)) ) { FIXME( "Size exceeded. Request of 0x%08x\n", size ); - size = dwBlockSize - sizeof(DWORD); + size = dwBlockSize - sizeof(BOOL); } /* Find blank area */ diff -Nru wine1.7-1.7.14/dlls/dpnet/address.c wine1.7-1.7.18/dlls/dpnet/address.c --- wine1.7-1.7.14/dlls/dpnet/address.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/dpnet/address.c 2014-05-02 18:15:48.000000000 +0000 @@ -58,24 +58,24 @@ static ULONG WINAPI IDirectPlay8AddressImpl_AddRef(IDirectPlay8Address *iface) { IDirectPlay8AddressImpl *This = impl_from_IDirectPlay8Address(iface); - ULONG refCount = InterlockedIncrement(&This->ref); + ULONG ref = InterlockedIncrement(&This->ref); - TRACE("(%p)->(ref before=%u)\n", This, refCount - 1); + TRACE("(%p) ref=%u\n", This, ref); - return refCount; + return ref; } static ULONG WINAPI IDirectPlay8AddressImpl_Release(IDirectPlay8Address *iface) { IDirectPlay8AddressImpl *This = impl_from_IDirectPlay8Address(iface); - ULONG refCount = InterlockedDecrement(&This->ref); + ULONG ref = InterlockedDecrement(&This->ref); - TRACE("(%p)->(ref before=%u)\n", This, refCount + 1); + TRACE("(%p) ref=%u\n", This, ref); - if (!refCount) { + if (!ref) { HeapFree(GetProcessHeap(), 0, This); } - return refCount; + return ref; } /* returns name of given GUID */ @@ -166,12 +166,18 @@ static HRESULT WINAPI IDirectPlay8AddressImpl_GetSP(IDirectPlay8Address *iface, GUID *pguidSP) { - IDirectPlay8AddressImpl *This = impl_from_IDirectPlay8Address(iface); + IDirectPlay8AddressImpl *This = impl_from_IDirectPlay8Address(iface); - TRACE("(%p, %p)\n", iface, pguidSP); + TRACE("(%p, %p)\n", iface, pguidSP); - *pguidSP = This->SP_guid; - return DPN_OK; + if(!pguidSP) + return DPNERR_INVALIDPOINTER; + + if(!This->init) + return DPNERR_DOESNOTEXIST; + + *pguidSP = This->SP_guid; + return DPN_OK; } static HRESULT WINAPI IDirectPlay8AddressImpl_GetUserData(IDirectPlay8Address *iface, @@ -185,12 +191,16 @@ static HRESULT WINAPI IDirectPlay8AddressImpl_SetSP(IDirectPlay8Address *iface, const GUID *const pguidSP) { - IDirectPlay8AddressImpl *This = impl_from_IDirectPlay8Address(iface); + IDirectPlay8AddressImpl *This = impl_from_IDirectPlay8Address(iface); - TRACE("(%p, %s)\n", iface, debugstr_SP(pguidSP)); + TRACE("(%p, %s)\n", iface, debugstr_SP(pguidSP)); - This->SP_guid = *pguidSP; - return DPN_OK; + if(!pguidSP) + return DPNERR_INVALIDPOINTER; + + This->init = TRUE; + This->SP_guid = *pguidSP; + return DPN_OK; } static HRESULT WINAPI IDirectPlay8AddressImpl_SetUserData(IDirectPlay8Address *iface, @@ -302,17 +312,24 @@ IDirectPlay8AddressImpl_BuildFromDirectPlay4Address }; -HRESULT DPNET_CreateDirectPlay8Address(LPCLASSFACTORY iface, LPUNKNOWN punkOuter, REFIID riid, LPVOID *ppobj) { - IDirectPlay8AddressImpl* client; +HRESULT DPNET_CreateDirectPlay8Address(IClassFactory *iface, IUnknown *pUnkOuter, REFIID riid, LPVOID *ppobj) +{ + IDirectPlay8AddressImpl* client; + HRESULT ret; - TRACE("(%p, %s, %p)\n", punkOuter, debugstr_guid(riid), ppobj); - - client = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectPlay8AddressImpl)); - if (NULL == client) { - *ppobj = NULL; - return E_OUTOFMEMORY; - } - client->IDirectPlay8Address_iface.lpVtbl = &DirectPlay8Address_Vtbl; - client->ref = 0; /* will be inited with QueryInterface */ - return IDirectPlay8AddressImpl_QueryInterface (&client->IDirectPlay8Address_iface, riid, ppobj); + TRACE("(%p, %s, %p)\n", pUnkOuter, debugstr_guid(riid), ppobj); + + *ppobj = NULL; + + client = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectPlay8AddressImpl)); + if (!client) + return E_OUTOFMEMORY; + + client->IDirectPlay8Address_iface.lpVtbl = &DirectPlay8Address_Vtbl; + client->ref = 1; + + ret = IDirectPlay8AddressImpl_QueryInterface(&client->IDirectPlay8Address_iface, riid, ppobj); + IDirectPlay8AddressImpl_Release(&client->IDirectPlay8Address_iface); + + return ret; } diff -Nru wine1.7-1.7.14/dlls/dpnet/dpnet_private.h wine1.7-1.7.18/dlls/dpnet/dpnet_private.h --- wine1.7-1.7.14/dlls/dpnet/dpnet_private.h 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/dpnet/dpnet_private.h 2014-05-02 18:15:48.000000000 +0000 @@ -64,7 +64,7 @@ LONG ref; /* IDirectPlay8Address fields */ GUID SP_guid; - const WCHAR *url; + BOOL init; }; /***************************************************************************** diff -Nru wine1.7-1.7.14/dlls/dpnet/tests/address.c wine1.7-1.7.18/dlls/dpnet/tests/address.c --- wine1.7-1.7.14/dlls/dpnet/tests/address.c 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.18/dlls/dpnet/tests/address.c 2014-05-02 18:15:48.000000000 +0000 @@ -0,0 +1,82 @@ +/* + * Copyright 2014 Alistair Leslie-Hughes + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define WIN32_LEAN_AND_MEAN +#include + +#include +#include "wine/test.h" + +/* {6733C6E8-A0D6-450E-8C18-CEACF331DC27} */ +static const GUID IID_Random = {0x6733c6e8, 0xa0d6, 0x450e, { 0x8c, 0x18, 0xce, 0xac, 0xf3, 0x31, 0xdc, 0x27 } }; + +static void create_directplay_address(void) +{ + HRESULT hr; + IDirectPlay8Address *localaddr = NULL; + + hr = CoCreateInstance( &CLSID_DirectPlay8Address, NULL, CLSCTX_ALL, &IID_IDirectPlay8Address, (LPVOID*)&localaddr); + ok(hr == S_OK, "Failed to create IDirectPlay8Address object\n"); + if(SUCCEEDED(hr)) + { + GUID guidsp; + + hr = IDirectPlay8Address_GetSP(localaddr, NULL); + ok(hr == DPNERR_INVALIDPOINTER, "GetSP failed 0x%08x\n", hr); + + hr = IDirectPlay8Address_GetSP(localaddr, &guidsp); + ok(hr == DPNERR_DOESNOTEXIST, "got 0x%08x\n", hr); + + hr = IDirectPlay8Address_SetSP(localaddr, &GUID_NULL); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IDirectPlay8Address_GetSP(localaddr, &guidsp); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(IsEqualGUID(&guidsp, &GUID_NULL), "wrong guid: %s\n", wine_dbgstr_guid(&guidsp)); + + hr = IDirectPlay8Address_SetSP(localaddr, &IID_Random); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IDirectPlay8Address_GetSP(localaddr, &guidsp); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(IsEqualGUID(&guidsp, &IID_Random), "wrong guid: %s\n", wine_dbgstr_guid(&guidsp)); + + hr = IDirectPlay8Address_SetSP(localaddr, &CLSID_DP8SP_TCPIP); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IDirectPlay8Address_GetSP(localaddr, &guidsp); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(IsEqualGUID(&guidsp, &CLSID_DP8SP_TCPIP), "wrong guid: %s\n", wine_dbgstr_guid(&guidsp)); + + IDirectPlay8Address_Release(localaddr); + } +} + +START_TEST(address) +{ + HRESULT hr; + + hr = CoInitialize(0); + ok(hr == S_OK, "failed to init com\n"); + if(hr != S_OK) + return; + + create_directplay_address(); + + CoUninitialize(); +} diff -Nru wine1.7-1.7.14/dlls/dpnet/tests/Makefile.in wine1.7-1.7.18/dlls/dpnet/tests/Makefile.in --- wine1.7-1.7.14/dlls/dpnet/tests/Makefile.in 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/dpnet/tests/Makefile.in 2014-05-02 18:15:48.000000000 +0000 @@ -1,6 +1,7 @@ TESTDLL = dpnet.dll -IMPORTS = dpnet ole32 +IMPORTS = dxguid uuid dpnet ole32 C_SRCS = \ + address.c \ peer.c \ server.c diff -Nru wine1.7-1.7.14/dlls/dpnet/tests/peer.c wine1.7-1.7.18/dlls/dpnet/tests/peer.c --- wine1.7-1.7.14/dlls/dpnet/tests/peer.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/dpnet/tests/peer.c 2014-05-02 18:15:48.000000000 +0000 @@ -16,7 +16,6 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#define INITGUID #define WIN32_LEAN_AND_MEAN #include diff -Nru wine1.7-1.7.14/dlls/dsound/capture.c wine1.7-1.7.18/dlls/dsound/capture.c --- wine1.7-1.7.14/dlls/dsound/capture.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/dsound/capture.c 2014-05-02 18:15:48.000000000 +0000 @@ -1223,11 +1223,6 @@ return DSERR_INVALIDPARAM; } - if (pUnk != NULL) { - WARN("invalid parameter: pUnk != NULL\n"); - return DSERR_INVALIDPARAM; - } - /* FIXME: We can only have one buffer so what do we do here? */ if (This->device->capture_buffer) { WARN("invalid parameter: already has buffer\n"); diff -Nru wine1.7-1.7.14/dlls/dswave/dswave.c wine1.7-1.7.18/dlls/dswave/dswave.c --- wine1.7-1.7.14/dlls/dswave/dswave.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/dswave/dswave.c 2014-05-02 18:15:48.000000000 +0000 @@ -723,7 +723,8 @@ /* for ClassFactory */ -HRESULT WINAPI DMUSIC_CreateDirectMusicWaveImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter) { +HRESULT WINAPI create_dswave(REFIID lpcGUID, void **ppobj) +{ IDirectMusicWaveImpl* obj; obj = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectMusicWaveImpl)); diff -Nru wine1.7-1.7.14/dlls/dswave/dswave_main.c wine1.7-1.7.18/dlls/dswave/dswave_main.c --- wine1.7-1.7.14/dlls/dswave/dswave_main.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/dswave/dswave_main.c 2014-05-02 18:15:48.000000000 +0000 @@ -21,9 +21,22 @@ #include "wine/port.h" #include +#include -#include "dswave_private.h" +#define COBJMACROS + +#include "windef.h" +#include "winbase.h" +#include "winnt.h" +#include "wingdi.h" +#include "winuser.h" +#include "winreg.h" +#include "objbase.h" #include "rpcproxy.h" +#include "initguid.h" +#include "dmusici.h" + +#include "dswave_private.h" WINE_DEFAULT_DEBUG_CHANNEL(dswave); @@ -71,12 +84,17 @@ return 1; /* non-heap based object */ } -static HRESULT WINAPI WaveCF_CreateInstance(IClassFactory * iface, IUnknown *pOuter, REFIID riid, - void **ppobj) +static HRESULT WINAPI WaveCF_CreateInstance(IClassFactory * iface, IUnknown *outer_unk, REFIID riid, + void **ret_iface) { - TRACE ("(%p, %s, %p)\n", pOuter, debugstr_dmguid(riid), ppobj); + TRACE ("(%p, %s, %p)\n", outer_unk, debugstr_dmguid(riid), ret_iface); + + if (outer_unk) { + *ret_iface = NULL; + return CLASS_E_NOAGGREGATION; + } - return DMUSIC_CreateDirectMusicWaveImpl (riid, ppobj, pOuter); + return create_dswave(riid, ret_iface); } static HRESULT WINAPI WaveCF_LockServer(IClassFactory * iface, BOOL dolock) diff -Nru wine1.7-1.7.14/dlls/dswave/dswave_private.h wine1.7-1.7.18/dlls/dswave/dswave_private.h --- wine1.7-1.7.14/dlls/dswave/dswave_private.h 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/dswave/dswave_private.h 2014-05-02 18:15:48.000000000 +0000 @@ -48,7 +48,7 @@ /***************************************************************************** * ClassFactory */ -extern HRESULT WINAPI DMUSIC_CreateDirectMusicWaveImpl (LPCGUID lpcGUID, LPVOID* ppobj, LPUNKNOWN pUnkOuter) DECLSPEC_HIDDEN; +extern HRESULT WINAPI create_dswave(REFIID lpcGUID, void **ret_iface) DECLSPEC_HIDDEN; /***************************************************************************** diff -Nru wine1.7-1.7.14/dlls/dswave/tests/dswave.c wine1.7-1.7.18/dlls/dswave/tests/dswave.c --- wine1.7-1.7.14/dlls/dswave/tests/dswave.c 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.18/dlls/dswave/tests/dswave.c 2014-05-02 18:15:48.000000000 +0000 @@ -0,0 +1,102 @@ +/* + * Copyright 2014 Michael Stefaniuc + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define COBJMACROS + +#include +#include +#include +#include +#include + +static BOOL missing_dswave(void) +{ + IDirectMusicObject *dmo; + HRESULT hr = CoCreateInstance(&CLSID_DirectSoundWave, NULL, CLSCTX_INPROC_SERVER, + &IID_IDirectMusicObject, (void**)&dmo); + + if (hr == S_OK && dmo) + { + IDirectMusicObject_Release(dmo); + return FALSE; + } + return TRUE; +} + +static void test_COM(void) +{ + IDirectMusicObject *dmo = (IDirectMusicObject*)0xdeadbeef; + IPersistStream *ps; + IUnknown *unk; + ULONG refcount; + HRESULT hr; + + /* COM aggregation */ + hr = CoCreateInstance(&CLSID_DirectSoundWave, (IUnknown*)&dmo, CLSCTX_INPROC_SERVER, + &IID_IUnknown, (void**)&dmo); + ok(hr == CLASS_E_NOAGGREGATION, + "DirectSoundWave create failed: %08x, expected CLASS_E_NOAGGREGATION\n", hr); + ok(!dmo, "dmo = %p\n", dmo); + + /* Invalid RIID */ + hr = CoCreateInstance(&CLSID_DirectSoundWave, NULL, CLSCTX_INPROC_SERVER, + &IID_IDirectMusicSegment8, (void**)&dmo); + todo_wine ok(hr == E_NOINTERFACE, "DirectSoundWave create failed: %08x, expected E_NOINTERFACE\n", hr); + + /* Same refcount for all DirectSoundWave interfaces */ + hr = CoCreateInstance(&CLSID_DirectSoundWave, NULL, CLSCTX_INPROC_SERVER, + &IID_IDirectMusicObject, (void**)&dmo); + ok(hr == S_OK, "DirectSoundWave create failed: %08x, expected S_OK\n", hr); + refcount = IDirectMusicObject_AddRef(dmo); + ok(refcount == 2, "refcount == %u, expected 2\n", refcount); + + hr = IDirectMusicObject_QueryInterface(dmo, &IID_IPersistStream, (void**)&ps); + ok(hr == S_OK, "QueryInterface for IID_IPersistStream failed: %08x\n", hr); + refcount = IPersistStream_AddRef(ps); + ok(refcount == 4, "refcount == %u, expected 4\n", refcount); + refcount = IPersistStream_Release(ps); + + hr = IDirectMusicObject_QueryInterface(dmo, &IID_IUnknown, (void**)&unk); + ok(hr == S_OK, "QueryInterface for IID_IUnknown failed: %08x\n", hr); + refcount = IUnknown_AddRef(unk); + ok(refcount == 5, "refcount == %u, expected 5\n", refcount); + refcount = IUnknown_Release(unk); + + /* Interfaces that native does not support */ + hr = IDirectMusicObject_QueryInterface(dmo, &IID_IDirectMusicSegment, (void**)&unk); + todo_wine ok(hr == E_NOINTERFACE, "QueryInterface for IID_IDirectMusicSegment failed: %08x\n", hr); + hr = IDirectMusicObject_QueryInterface(dmo, &IID_IDirectMusicSegment8, (void**)&unk); + todo_wine ok(hr == E_NOINTERFACE, "QueryInterface for IID_IDirectMusicSegment8 failed: %08x\n", hr); + + while (IDirectMusicObject_Release(dmo)); +} + +START_TEST(dswave) +{ + CoInitialize(NULL); + + if (missing_dswave()) + { + skip("dswave not available\n"); + CoUninitialize(); + return; + } + test_COM(); + + CoUninitialize(); +} diff -Nru wine1.7-1.7.14/dlls/dswave/tests/Makefile.in wine1.7-1.7.18/dlls/dswave/tests/Makefile.in --- wine1.7-1.7.14/dlls/dswave/tests/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.18/dlls/dswave/tests/Makefile.in 2014-05-02 18:15:48.000000000 +0000 @@ -0,0 +1,5 @@ +TESTDLL = dswave.dll +IMPORTS = ole32 + +C_SRCS = \ + dswave.c diff -Nru wine1.7-1.7.14/dlls/dwrite/dwrite_private.h wine1.7-1.7.18/dlls/dwrite/dwrite_private.h --- wine1.7-1.7.14/dlls/dwrite/dwrite_private.h 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/dwrite/dwrite_private.h 2014-05-02 18:15:48.000000000 +0000 @@ -76,6 +76,7 @@ extern HRESULT create_textformat(const WCHAR*,IDWriteFontCollection*,DWRITE_FONT_WEIGHT,DWRITE_FONT_STYLE,DWRITE_FONT_STRETCH, FLOAT,const WCHAR*,IDWriteTextFormat**) DECLSPEC_HIDDEN; extern HRESULT create_textlayout(const WCHAR*,UINT32,IDWriteTextFormat*,IDWriteTextLayout**) DECLSPEC_HIDDEN; +extern HRESULT create_trimmingsign(IDWriteInlineObject**) DECLSPEC_HIDDEN; extern HRESULT get_gdiinterop(IDWriteGdiInterop**) DECLSPEC_HIDDEN; extern HRESULT create_localizedstrings(IDWriteLocalizedStrings**) DECLSPEC_HIDDEN; extern HRESULT add_localizedstring(IDWriteLocalizedStrings*,const WCHAR*,const WCHAR*) DECLSPEC_HIDDEN; diff -Nru wine1.7-1.7.14/dlls/dwrite/layout.c wine1.7-1.7.18/dlls/dwrite/layout.c --- wine1.7-1.7.14/dlls/dwrite/layout.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/dwrite/layout.c 2014-05-02 18:15:48.000000000 +0000 @@ -42,8 +42,20 @@ DWRITE_FONT_STYLE style; DWRITE_FONT_STRETCH stretch; + DWRITE_PARAGRAPH_ALIGNMENT paralign; + DWRITE_READING_DIRECTION readingdir; + DWRITE_WORD_WRAPPING wrapping; + DWRITE_TEXT_ALIGNMENT textalignment; + DWRITE_FLOW_DIRECTION flow; + DWRITE_LINE_SPACING_METHOD spacingmethod; + + FLOAT spacing; + FLOAT baseline; FLOAT size; + DWRITE_TRIMMING trimming; + IDWriteInlineObject *trimmingsign; + IDWriteFontCollection *collection; }; @@ -62,11 +74,17 @@ struct dwrite_textformat_data format; }; +struct dwrite_trimmingsign { + IDWriteInlineObject IDWriteInlineObject_iface; + LONG ref; +}; + static const IDWriteTextFormatVtbl dwritetextformatvtbl; static void release_format_data(struct dwrite_textformat_data *data) { if (data->collection) IDWriteFontCollection_Release(data->collection); + if (data->trimmingsign) IDWriteInlineObject_Release(data->trimmingsign); heap_free(data->family_name); heap_free(data->locale); } @@ -86,6 +104,11 @@ return iface->lpVtbl == &dwritetextformatvtbl ? impl_from_IDWriteTextFormat(iface) : NULL; } +static inline struct dwrite_trimmingsign *impl_from_IDWriteInlineObject(IDWriteInlineObject *iface) +{ + return CONTAINING_RECORD(iface, struct dwrite_trimmingsign, IDWriteInlineObject_iface); +} + static HRESULT WINAPI dwritetextlayout_QueryInterface(IDWriteTextLayout *iface, REFIID riid, void **obj) { struct dwrite_textlayout *This = impl_from_IDWriteTextLayout(iface); @@ -690,6 +713,8 @@ layout->format = f->format; layout->format.locale = heap_strdupW(f->format.locale); layout->format.family_name = heap_strdupW(f->format.family_name); + if (layout->format.trimmingsign) + IDWriteInlineObject_AddRef(layout->format.trimmingsign); } else { @@ -699,6 +724,17 @@ layout->format.style = IDWriteTextFormat_GetFontStyle(format); layout->format.stretch = IDWriteTextFormat_GetFontStretch(format); layout->format.size = IDWriteTextFormat_GetFontSize(format); + layout->format.textalignment = IDWriteTextFormat_GetTextAlignment(format); + layout->format.paralign = IDWriteTextFormat_GetParagraphAlignment(format); + layout->format.wrapping = IDWriteTextFormat_GetWordWrapping(format); + layout->format.readingdir = IDWriteTextFormat_GetReadingDirection(format); + layout->format.flow = IDWriteTextFormat_GetFlowDirection(format); + IDWriteTextFormat_GetLineSpacing(format, + &layout->format.spacingmethod, + &layout->format.spacing, + &layout->format.baseline + ); + IDWriteTextFormat_GetTrimming(format, &layout->format.trimming, &layout->format.trimmingsign); /* locale name and length */ locale_len = IDWriteTextFormat_GetLocaleNameLength(format); @@ -736,6 +772,104 @@ return S_OK; } +static HRESULT WINAPI dwritetrimmingsign_QueryInterface(IDWriteInlineObject *iface, REFIID riid, void **obj) +{ + struct dwrite_trimmingsign *This = impl_from_IDWriteInlineObject(iface); + + TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), obj); + + if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IDWriteInlineObject)) { + *obj = iface; + IDWriteInlineObject_AddRef(iface); + return S_OK; + } + + *obj = NULL; + return E_NOINTERFACE; + +} + +static ULONG WINAPI dwritetrimmingsign_AddRef(IDWriteInlineObject *iface) +{ + struct dwrite_trimmingsign *This = impl_from_IDWriteInlineObject(iface); + ULONG ref = InterlockedIncrement(&This->ref); + TRACE("(%p)->(%d)\n", This, ref); + return ref; +} + +static ULONG WINAPI dwritetrimmingsign_Release(IDWriteInlineObject *iface) +{ + struct dwrite_trimmingsign *This = impl_from_IDWriteInlineObject(iface); + ULONG ref = InterlockedDecrement(&This->ref); + + TRACE("(%p)->(%d)\n", This, ref); + + if (!ref) + heap_free(This); + + return ref; +} + +static HRESULT WINAPI dwritetrimmingsign_Draw(IDWriteInlineObject *iface, void *context, IDWriteTextRenderer *renderer, + FLOAT originX, FLOAT originY, BOOL is_sideways, BOOL is_rtl, IUnknown *drawing_effect) +{ + struct dwrite_trimmingsign *This = impl_from_IDWriteInlineObject(iface); + FIXME("(%p)->(%p %p %f %f %d %d %p): stub\n", This, context, renderer, originX, originY, is_sideways, is_rtl, drawing_effect); + return E_NOTIMPL; +} + +static HRESULT WINAPI dwritetrimmingsign_GetMetrics(IDWriteInlineObject *iface, DWRITE_INLINE_OBJECT_METRICS *metrics) +{ + struct dwrite_trimmingsign *This = impl_from_IDWriteInlineObject(iface); + FIXME("(%p)->(%p): stub\n", This, metrics); + return E_NOTIMPL; +} + +static HRESULT WINAPI dwritetrimmingsign_GetOverhangMetrics(IDWriteInlineObject *iface, DWRITE_OVERHANG_METRICS *overhangs) +{ + struct dwrite_trimmingsign *This = impl_from_IDWriteInlineObject(iface); + FIXME("(%p)->(%p): stub\n", This, overhangs); + return E_NOTIMPL; +} + +static HRESULT WINAPI dwritetrimmingsign_GetBreakConditions(IDWriteInlineObject *iface, DWRITE_BREAK_CONDITION *before, + DWRITE_BREAK_CONDITION *after) +{ + struct dwrite_trimmingsign *This = impl_from_IDWriteInlineObject(iface); + + TRACE("(%p)->(%p %p)\n", This, before, after); + + *before = *after = DWRITE_BREAK_CONDITION_NEUTRAL; + return S_OK; +} + +static const IDWriteInlineObjectVtbl dwritetrimmingsignvtbl = { + dwritetrimmingsign_QueryInterface, + dwritetrimmingsign_AddRef, + dwritetrimmingsign_Release, + dwritetrimmingsign_Draw, + dwritetrimmingsign_GetMetrics, + dwritetrimmingsign_GetOverhangMetrics, + dwritetrimmingsign_GetBreakConditions +}; + +HRESULT create_trimmingsign(IDWriteInlineObject **sign) +{ + struct dwrite_trimmingsign *This; + + *sign = NULL; + + This = heap_alloc(sizeof(struct dwrite_trimmingsign)); + if (!This) return E_OUTOFMEMORY; + + This->IDWriteInlineObject_iface.lpVtbl = &dwritetrimmingsignvtbl; + This->ref = 1; + + *sign = &This->IDWriteInlineObject_iface; + + return S_OK; +} + static HRESULT WINAPI dwritetextformat_QueryInterface(IDWriteTextFormat *iface, REFIID riid, void **obj) { struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface); @@ -782,36 +916,41 @@ static HRESULT WINAPI dwritetextformat_SetTextAlignment(IDWriteTextFormat *iface, DWRITE_TEXT_ALIGNMENT alignment) { struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface); - FIXME("(%p)->(%d): stub\n", This, alignment); - return E_NOTIMPL; + TRACE("(%p)->(%d)\n", This, alignment); + This->format.textalignment = alignment; + return S_OK; } static HRESULT WINAPI dwritetextformat_SetParagraphAlignment(IDWriteTextFormat *iface, DWRITE_PARAGRAPH_ALIGNMENT alignment) { struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface); - FIXME("(%p)->(%d): stub\n", This, alignment); - return E_NOTIMPL; + TRACE("(%p)->(%d)\n", This, alignment); + This->format.paralign = alignment; + return S_OK; } static HRESULT WINAPI dwritetextformat_SetWordWrapping(IDWriteTextFormat *iface, DWRITE_WORD_WRAPPING wrapping) { struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface); - FIXME("(%p)->(%d): stub\n", This, wrapping); - return E_NOTIMPL; + TRACE("(%p)->(%d)\n", This, wrapping); + This->format.wrapping = wrapping; + return S_OK; } static HRESULT WINAPI dwritetextformat_SetReadingDirection(IDWriteTextFormat *iface, DWRITE_READING_DIRECTION direction) { struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface); - FIXME("(%p)->(%d): stub\n", This, direction); - return E_NOTIMPL; + TRACE("(%p)->(%d)\n", This, direction); + This->format.readingdir = direction; + return S_OK; } static HRESULT WINAPI dwritetextformat_SetFlowDirection(IDWriteTextFormat *iface, DWRITE_FLOW_DIRECTION direction) { struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface); - FIXME("(%p)->(%d): stub\n", This, direction); - return E_NOTIMPL; + TRACE("(%p)->(%d)\n", This, direction); + This->format.flow = direction; + return S_OK; } static HRESULT WINAPI dwritetextformat_SetIncrementalTabStop(IDWriteTextFormat *iface, FLOAT tabstop) @@ -825,51 +964,61 @@ IDWriteInlineObject *trimming_sign) { struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface); - FIXME("(%p)->(%p %p): stub\n", This, trimming, trimming_sign); - return E_NOTIMPL; + TRACE("(%p)->(%p %p)\n", This, trimming, trimming_sign); + + This->format.trimming = *trimming; + if (This->format.trimmingsign) + IDWriteInlineObject_Release(This->format.trimmingsign); + This->format.trimmingsign = trimming_sign; + if (This->format.trimmingsign) + IDWriteInlineObject_AddRef(This->format.trimmingsign); + return S_OK; } -static HRESULT WINAPI dwritetextformat_SetLineSpacing(IDWriteTextFormat *iface, DWRITE_LINE_SPACING_METHOD spacing, - FLOAT line_spacing, FLOAT baseline) +static HRESULT WINAPI dwritetextformat_SetLineSpacing(IDWriteTextFormat *iface, DWRITE_LINE_SPACING_METHOD method, + FLOAT spacing, FLOAT baseline) { struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface); - FIXME("(%p)->(%d %f %f): stub\n", This, spacing, line_spacing, baseline); - return E_NOTIMPL; + TRACE("(%p)->(%d %f %f)\n", This, method, spacing, baseline); + This->format.spacingmethod = method; + This->format.spacing = spacing; + This->format.baseline = baseline; + return S_OK; } static DWRITE_TEXT_ALIGNMENT WINAPI dwritetextformat_GetTextAlignment(IDWriteTextFormat *iface) { struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface); - FIXME("(%p): stub\n", This); - return DWRITE_TEXT_ALIGNMENT_LEADING; + TRACE("(%p)\n", This); + return This->format.textalignment; } static DWRITE_PARAGRAPH_ALIGNMENT WINAPI dwritetextformat_GetParagraphAlignment(IDWriteTextFormat *iface) { struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface); - FIXME("(%p): stub\n", This); - return DWRITE_PARAGRAPH_ALIGNMENT_NEAR; + TRACE("(%p)\n", This); + return This->format.paralign; } static DWRITE_WORD_WRAPPING WINAPI dwritetextformat_GetWordWrapping(IDWriteTextFormat *iface) { struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface); - FIXME("(%p): stub\n", This); - return DWRITE_WORD_WRAPPING_NO_WRAP; + TRACE("(%p)\n", This); + return This->format.wrapping; } static DWRITE_READING_DIRECTION WINAPI dwritetextformat_GetReadingDirection(IDWriteTextFormat *iface) { struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface); - FIXME("(%p): stub\n", This); - return DWRITE_READING_DIRECTION_LEFT_TO_RIGHT; + TRACE("(%p)\n", This); + return This->format.readingdir; } static DWRITE_FLOW_DIRECTION WINAPI dwritetextformat_GetFlowDirection(IDWriteTextFormat *iface) { struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface); - FIXME("(%p): stub\n", This); - return DWRITE_FLOW_DIRECTION_TOP_TO_BOTTOM; + TRACE("(%p)\n", This); + return This->format.flow; } static FLOAT WINAPI dwritetextformat_GetIncrementalTabStop(IDWriteTextFormat *iface) @@ -883,16 +1032,25 @@ IDWriteInlineObject **trimming_sign) { struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface); - FIXME("(%p)->(%p %p): stub\n", This, options, trimming_sign); - return E_NOTIMPL; + TRACE("(%p)->(%p %p)\n", This, options, trimming_sign); + + *options = This->format.trimming; + if ((*trimming_sign = This->format.trimmingsign)) + IDWriteInlineObject_AddRef(*trimming_sign); + + return S_OK; } static HRESULT WINAPI dwritetextformat_GetLineSpacing(IDWriteTextFormat *iface, DWRITE_LINE_SPACING_METHOD *method, FLOAT *spacing, FLOAT *baseline) { struct dwrite_textformat *This = impl_from_IDWriteTextFormat(iface); - FIXME("(%p)->(%p %p %p): stub\n", This, method, spacing, baseline); - return E_NOTIMPL; + TRACE("(%p)->(%p %p %p)\n", This, method, spacing, baseline); + + *method = This->format.spacingmethod; + *spacing = This->format.spacing; + *baseline = This->format.baseline; + return S_OK; } static HRESULT WINAPI dwritetextformat_GetFontCollection(IDWriteTextFormat *iface, IDWriteFontCollection **collection) @@ -1022,6 +1180,18 @@ This->format.style = style; This->format.size = size; This->format.stretch = stretch; + This->format.textalignment = DWRITE_TEXT_ALIGNMENT_LEADING; + This->format.paralign = DWRITE_PARAGRAPH_ALIGNMENT_NEAR; + This->format.wrapping = DWRITE_WORD_WRAPPING_WRAP; + This->format.readingdir = DWRITE_READING_DIRECTION_LEFT_TO_RIGHT; + This->format.flow = DWRITE_FLOW_DIRECTION_TOP_TO_BOTTOM; + This->format.spacingmethod = DWRITE_LINE_SPACING_METHOD_DEFAULT; + This->format.spacing = 0.0; + This->format.baseline = 0.0; + This->format.trimming.granularity = DWRITE_TRIMMING_GRANULARITY_NONE; + This->format.trimming.delimiter = 0; + This->format.trimming.delimiterCount = 0; + This->format.trimmingsign = NULL; if (collection) { diff -Nru wine1.7-1.7.14/dlls/dwrite/main.c wine1.7-1.7.18/dlls/dwrite/main.c --- wine1.7-1.7.14/dlls/dwrite/main.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/dwrite/main.c 2014-05-02 18:15:48.000000000 +0000 @@ -527,8 +527,8 @@ static HRESULT WINAPI dwritefactory_CreateEllipsisTrimmingSign(IDWriteFactory *iface, IDWriteTextFormat *format, IDWriteInlineObject **trimming_sign) { - FIXME("(%p %p): stub\n", format, trimming_sign); - return E_NOTIMPL; + FIXME("(%p %p): semi-stub\n", format, trimming_sign); + return create_trimmingsign(trimming_sign); } static HRESULT WINAPI dwritefactory_CreateTextAnalyzer(IDWriteFactory *iface, IDWriteTextAnalyzer **analyzer) diff -Nru wine1.7-1.7.14/dlls/dwrite/tests/font.c wine1.7-1.7.18/dlls/dwrite/tests/font.c --- wine1.7-1.7.14/dlls/dwrite/tests/font.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/dwrite/tests/font.c 2014-05-02 18:15:48.000000000 +0000 @@ -588,6 +588,7 @@ hr = IDWriteFont_CreateFontFace(font, &fontface); ok(hr == S_OK, "got 0x%08x\n", hr); + IDWriteFont_Release(font); if (0) /* crashes on native */ { diff -Nru wine1.7-1.7.14/dlls/dwrite/tests/layout.c wine1.7-1.7.18/dlls/dwrite/tests/layout.c --- wine1.7-1.7.14/dlls/dwrite/tests/layout.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/dwrite/tests/layout.c 2014-05-02 18:15:48.000000000 +0000 @@ -110,7 +110,16 @@ static void test_CreateTextFormat(void) { IDWriteFontCollection *collection, *syscoll; + DWRITE_PARAGRAPH_ALIGNMENT paralign; + DWRITE_READING_DIRECTION readdir; + DWRITE_WORD_WRAPPING wrapping; + DWRITE_TEXT_ALIGNMENT align; + DWRITE_FLOW_DIRECTION flow; + DWRITE_LINE_SPACING_METHOD method; + DWRITE_TRIMMING trimming; IDWriteTextFormat *format; + FLOAT spacing, baseline; + IDWriteInlineObject *trimmingsign; HRESULT hr; hr = IDWriteFactory_CreateTextFormat(factory, tahomaW, NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, @@ -131,6 +140,61 @@ IDWriteFontCollection_Release(syscoll); IDWriteFontCollection_Release(collection); + /* default format properties */ + align = IDWriteTextFormat_GetTextAlignment(format); + ok(align == DWRITE_TEXT_ALIGNMENT_LEADING, "got %d\n", align); + + paralign = IDWriteTextFormat_GetParagraphAlignment(format); + ok(paralign == DWRITE_PARAGRAPH_ALIGNMENT_NEAR, "got %d\n", paralign); + + wrapping = IDWriteTextFormat_GetWordWrapping(format); + ok(wrapping == DWRITE_WORD_WRAPPING_WRAP, "got %d\n", wrapping); + + readdir = IDWriteTextFormat_GetReadingDirection(format); + ok(readdir == DWRITE_READING_DIRECTION_LEFT_TO_RIGHT, "got %d\n", readdir); + + flow = IDWriteTextFormat_GetFlowDirection(format); + ok(flow == DWRITE_FLOW_DIRECTION_TOP_TO_BOTTOM, "got %d\n", flow); + + hr = IDWriteTextFormat_GetLineSpacing(format, &method, &spacing, &baseline); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(spacing == 0.0, "got %f\n", spacing); + ok(baseline == 0.0, "got %f\n", baseline); + ok(method == DWRITE_LINE_SPACING_METHOD_DEFAULT, "got %d\n", method); + + trimming.granularity = DWRITE_TRIMMING_GRANULARITY_WORD; + trimming.delimiter = 10; + trimming.delimiterCount = 10; + trimmingsign = (void*)0xdeadbeef; + hr = IDWriteTextFormat_GetTrimming(format, &trimming, &trimmingsign); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(trimming.granularity == DWRITE_TRIMMING_GRANULARITY_NONE, "got %d\n", trimming.granularity); + ok(trimming.delimiter == 0, "got %d\n", trimming.delimiter); + ok(trimming.delimiterCount == 0, "got %d\n", trimming.delimiterCount); + ok(trimmingsign == NULL, "got %p\n", trimmingsign); + + /* setters */ + hr = IDWriteTextFormat_SetTextAlignment(format, DWRITE_TEXT_ALIGNMENT_LEADING); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IDWriteTextFormat_SetParagraphAlignment(format, DWRITE_PARAGRAPH_ALIGNMENT_NEAR); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IDWriteTextFormat_SetWordWrapping(format, DWRITE_WORD_WRAPPING_WRAP); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IDWriteTextFormat_SetReadingDirection(format, DWRITE_READING_DIRECTION_LEFT_TO_RIGHT); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IDWriteTextFormat_SetFlowDirection(format, DWRITE_FLOW_DIRECTION_TOP_TO_BOTTOM); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IDWriteTextFormat_SetLineSpacing(format, DWRITE_LINE_SPACING_METHOD_DEFAULT, 0.0, 0.0); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IDWriteTextFormat_SetTrimming(format, &trimming, NULL); + ok(hr == S_OK, "got 0x%08x\n", hr); + IDWriteTextFormat_Release(format); } @@ -169,6 +233,35 @@ IDWriteTextFormat_Release(format); } +static void test_CreateEllipsisTrimmingSign(void) +{ + DWRITE_BREAK_CONDITION before, after; + IDWriteTextFormat *format; + IDWriteInlineObject *sign; + HRESULT hr; + + hr = IDWriteFactory_CreateTextFormat(factory, tahomaW, NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, + DWRITE_FONT_STRETCH_NORMAL, 10.0, enusW, &format); + ok(hr == S_OK, "got 0x%08x\n", hr); + + EXPECT_REF(format, 1); + hr = IDWriteFactory_CreateEllipsisTrimmingSign(factory, format, &sign); + ok(hr == S_OK, "got 0x%08x\n", hr); + EXPECT_REF(format, 1); + +if (0) /* crashes on native */ + hr = IDWriteInlineObject_GetBreakConditions(sign, NULL, NULL); + + before = after = DWRITE_BREAK_CONDITION_CAN_BREAK; + hr = IDWriteInlineObject_GetBreakConditions(sign, &before, &after); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(before == DWRITE_BREAK_CONDITION_NEUTRAL, "got %d\n", before); + ok(after == DWRITE_BREAK_CONDITION_NEUTRAL, "got %d\n", after); + + IDWriteInlineObject_Release(sign); + IDWriteTextFormat_Release(format); +} + START_TEST(layout) { HRESULT hr; @@ -185,6 +278,7 @@ test_CreateGdiCompatibleTextLayout(); test_CreateTextFormat(); test_GetLocaleName(); + test_CreateEllipsisTrimmingSign(); IDWriteFactory_Release(factory); } diff -Nru wine1.7-1.7.14/dlls/dxdiagn/provider.c wine1.7-1.7.18/dlls/dxdiagn/provider.c --- wine1.7-1.7.14/dlls/dxdiagn/provider.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/dxdiagn/provider.c 2014-05-02 18:15:48.000000000 +0000 @@ -915,10 +915,15 @@ static const WCHAR id_fmtW[] = {'0','x','%','0','4','x',0}; static const WCHAR subsysid_fmtW[] = {'0','x','%','0','8','x',0}; static const WCHAR mem_fmt[] = {'%','.','1','f',' ','M','B',0}; + static const WCHAR b3DAccelerationExists[] = {'b','3','D','A','c','c','e','l','e','r','a','t','i','o','n','E','x','i','s','t','s',0}; + static const WCHAR b3DAccelerationEnabled[] = {'b','3','D','A','c','c','e','l','e','r','a','t','i','o','n','E','n','a','b','l','e','d',0}; + static const WCHAR bDDAccelerationEnabled[] = {'b','D','D','A','c','c','e','l','e','r','a','t','i','o','n','E','n','a','b','l','e','d',0}; D3DADAPTER_IDENTIFIER9 adapter_info; D3DDISPLAYMODE adapter_mode; + D3DCAPS9 device_caps; DWORD available_mem = 0; + BOOL hardware_accel; snprintfW(buffer, sizeof(buffer)/sizeof(WCHAR), adapterid_fmtW, index); display_adapter = allocate_information_node(buffer); @@ -1043,6 +1048,21 @@ hr = add_bstr_property(display_adapter, szDisplayMemoryEnglish, buffer); if (FAILED(hr)) goto cleanup; + + hr = IDirect3D9_GetDeviceCaps(pDirect3D9, index, D3DDEVTYPE_HAL, &device_caps); + hardware_accel = SUCCEEDED(hr); + + hr = add_bool_property(display_adapter, b3DAccelerationEnabled, hardware_accel); + if (FAILED(hr)) + goto cleanup; + + hr = add_bool_property(display_adapter, b3DAccelerationExists, hardware_accel); + if (FAILED(hr)) + goto cleanup; + + hr = add_bool_property(display_adapter, bDDAccelerationEnabled, hardware_accel); + if (FAILED(hr)) + goto cleanup; } hr = S_OK; diff -Nru wine1.7-1.7.14/dlls/dxdiagn/tests/container.c wine1.7-1.7.18/dlls/dxdiagn/tests/container.c --- wine1.7-1.7.14/dlls/dxdiagn/tests/container.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/dxdiagn/tests/container.c 2014-05-02 18:15:48.000000000 +0000 @@ -938,6 +938,9 @@ static const WCHAR szRevisionId[] = {'s','z','R','e','v','i','s','i','o','n','I','d',0}; static const WCHAR dwRefreshRate[] = {'d','w','R','e','f','r','e','s','h','R','a','t','e',0}; static const WCHAR szManufacturer[] = {'s','z','M','a','n','u','f','a','c','t','u','r','e','r',0}; + static const WCHAR b3DAccelerationExists[] = {'b','3','D','A','c','c','e','l','e','r','a','t','i','o','n','E','x','i','s','t','s',0}; + static const WCHAR b3DAccelerationEnabled[] = {'b','3','D','A','c','c','e','l','e','r','a','t','i','o','n','E','n','a','b','l','e','d',0}; + static const WCHAR bDDAccelerationEnabled[] = {'b','D','D','A','c','c','e','l','e','r','a','t','i','o','n','E','n','a','b','l','e','d',0}; static const struct property_test property_tests[] = { @@ -959,6 +962,9 @@ {szRevisionId, VT_BSTR}, {dwRefreshRate, VT_UI4}, {szManufacturer, VT_BSTR}, + {b3DAccelerationExists, VT_BOOL}, + {b3DAccelerationEnabled, VT_BOOL}, + {bDDAccelerationEnabled, VT_BOOL}, }; IDxDiagContainer *display_cont = NULL; diff -Nru wine1.7-1.7.14/dlls/dxgi/factory.c wine1.7-1.7.18/dlls/dxgi/factory.c --- wine1.7-1.7.14/dlls/dxgi/factory.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/dxgi/factory.c 2014-05-02 18:15:48.000000000 +0000 @@ -329,7 +329,7 @@ factory->refcount = 1; EnterCriticalSection(&dxgi_cs); - factory->wined3d = wined3d_create(10, 0); + factory->wined3d = wined3d_create(0); if (!factory->wined3d) { LeaveCriticalSection(&dxgi_cs); diff -Nru wine1.7-1.7.14/dlls/dxgi/tests/device.c wine1.7-1.7.18/dlls/dxgi/tests/device.c --- wine1.7-1.7.14/dlls/dxgi/tests/device.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/dxgi/tests/device.c 2014-05-02 18:15:48.000000000 +0000 @@ -23,6 +23,12 @@ static HRESULT (WINAPI *pCreateDXGIFactory1)(REFIID iid, void **factory); +static ULONG get_refcount(IUnknown *iface) +{ + IUnknown_AddRef(iface); + return IUnknown_Release(iface); +} + static IDXGIDevice *create_device(void) { IDXGIDevice *dxgi_device; @@ -578,6 +584,142 @@ IUnknown_Release(iface); } +static void test_private_data(void) +{ + ULONG refcount, expected_refcount; + IDXGIDevice *device; + HRESULT hr; + IDXGIDevice *test_object; + IUnknown *ptr; + static const DWORD data[] = {1, 2, 3, 4}; + UINT size; + static const GUID dxgi_private_data_test_guid = + { + 0xfdb37466, + 0x428f, + 0x4edf, + {0xa3, 0x7f, 0x9b, 0x1d, 0xf4, 0x88, 0xc5, 0xfc} + }; + static const GUID dxgi_private_data_test_guid2 = + { + 0x2e5afac2, + 0x87b5, + 0x4c10, + {0x9b, 0x4b, 0x89, 0xd7, 0xd1, 0x12, 0xe7, 0x2b} + }; + + if (!(device = create_device())) + { + skip("Failed to create device, skipping tests.\n"); + return; + } + + test_object = create_device(); + + /* SetPrivateData with a pointer of NULL has the purpose of FreePrivateData in previous + * d3d versions. A successful clear returns S_OK. A redundant clear S_FALSE. Setting a + * NULL interface is not considered a clear but as setting an interface pointer that + * happens to be NULL. */ + hr = IDXGIDevice_SetPrivateData(device, &dxgi_private_data_test_guid, 0, NULL); + todo_wine ok(hr == S_FALSE, "Got unexpected hr %#x.\n", hr); + hr = IDXGIDevice_SetPrivateDataInterface(device, &dxgi_private_data_test_guid, NULL); + todo_wine ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + hr = IDXGIDevice_SetPrivateData(device, &dxgi_private_data_test_guid, ~0U, NULL); + todo_wine ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + hr = IDXGIDevice_SetPrivateData(device, &dxgi_private_data_test_guid, ~0U, NULL); + todo_wine ok(hr == S_FALSE, "Got unexpected hr %#x.\n", hr); + + hr = IDXGIDevice_SetPrivateDataInterface(device, &dxgi_private_data_test_guid, NULL); + todo_wine ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + size = sizeof(ptr) * 2; + ptr = (IUnknown *)0xdeadbeef; + hr = IDXGIDevice_GetPrivateData(device, &dxgi_private_data_test_guid, &size, &ptr); + todo_wine ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + todo_wine ok(!ptr, "Got unexpected pointer %p.\n", ptr); + todo_wine ok(size == sizeof(IUnknown *), "Got unexpected size %u.\n", size); + + refcount = get_refcount((IUnknown *)test_object); + hr = IDXGIDevice_SetPrivateDataInterface(device, &dxgi_private_data_test_guid, + (IUnknown *)test_object); + todo_wine ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + expected_refcount = refcount + 1; + refcount = get_refcount((IUnknown *)test_object); + todo_wine ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount); + hr = IDXGIDevice_SetPrivateDataInterface(device, &dxgi_private_data_test_guid, + (IUnknown *)test_object); + todo_wine ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + refcount = get_refcount((IUnknown *)test_object); + todo_wine ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount); + + hr = IDXGIDevice_SetPrivateDataInterface(device, &dxgi_private_data_test_guid, NULL); + todo_wine 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 = IDXGIDevice_SetPrivateDataInterface(device, &dxgi_private_data_test_guid, + (IUnknown *)test_object); + todo_wine ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + size = sizeof(data); + hr = IDXGIDevice_SetPrivateData(device, &dxgi_private_data_test_guid, size, data); + todo_wine 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 = IDXGIDevice_SetPrivateData(device, &dxgi_private_data_test_guid, 42, NULL); + todo_wine ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + hr = IDXGIDevice_SetPrivateData(device, &dxgi_private_data_test_guid, 42, NULL); + todo_wine ok(hr == S_FALSE, "Got unexpected hr %#x.\n", hr); + + hr = IDXGIDevice_SetPrivateDataInterface(device, &dxgi_private_data_test_guid, + (IUnknown *)test_object); + todo_wine ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + expected_refcount++; + size = 2 * sizeof(ptr); + ptr = NULL; + hr = IDXGIDevice_GetPrivateData(device, &dxgi_private_data_test_guid, &size, &ptr); + todo_wine ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + todo_wine ok(size == sizeof(test_object), "Got unexpected size %u.\n", size); + expected_refcount++; + refcount = get_refcount((IUnknown *)test_object); + todo_wine ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount); + if (ptr) + IUnknown_Release(ptr); + expected_refcount--; + + ptr = (IUnknown *)0xdeadbeef; + size = 1; + hr = IDXGIDevice_GetPrivateData(device, &dxgi_private_data_test_guid, &size, NULL); + todo_wine ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + todo_wine ok(size == sizeof(device), "Got unexpected size %u.\n", size); + size = 2 * sizeof(ptr); + hr = IDXGIDevice_GetPrivateData(device, &dxgi_private_data_test_guid, &size, NULL); + todo_wine ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + todo_wine ok(size == sizeof(device), "Got unexpected size %u.\n", size); + refcount = get_refcount((IUnknown *)test_object); + todo_wine ok(refcount == expected_refcount, "Got unexpected refcount %u, expected %u.\n", refcount, expected_refcount); + + size = 1; + hr = IDXGIDevice_GetPrivateData(device, &dxgi_private_data_test_guid, &size, &ptr); + todo_wine ok(hr == DXGI_ERROR_MORE_DATA, "Got unexpected hr %#x.\n", hr); + todo_wine ok(size == sizeof(device), "Got unexpected size %u.\n", size); + ok(ptr == (IUnknown *)0xdeadbeef, "Got unexpected pointer %p.\n", ptr); + hr = IDXGIDevice_GetPrivateData(device, &dxgi_private_data_test_guid2, NULL, NULL); + todo_wine ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + size = 0xdeadbabe; + hr = IDXGIDevice_GetPrivateData(device, &dxgi_private_data_test_guid2, &size, &ptr); + todo_wine ok(hr == DXGI_ERROR_NOT_FOUND, "Got unexpected hr %#x.\n", hr); + todo_wine ok(size == 0, "Got unexpected size %u.\n", size); + ok(ptr == (IUnknown *)0xdeadbeef, "Got unexpected pointer %p.\n", ptr); + hr = IDXGIDevice_GetPrivateData(device, &dxgi_private_data_test_guid, NULL, &ptr); + todo_wine ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + ok(ptr == (IUnknown *)0xdeadbeef, "Got unexpected pointer %p.\n", ptr); + + refcount = IDXGIDevice_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + refcount = IDXGIDevice_Release(test_object); + ok(!refcount, "Test object has %u references left.\n", refcount); +} + START_TEST(device) { pCreateDXGIFactory1 = (void *)GetProcAddress(GetModuleHandleA("dxgi.dll"), "CreateDXGIFactory1"); @@ -589,4 +731,5 @@ test_output(); test_createswapchain(); test_create_factory(); + test_private_data(); } diff -Nru wine1.7-1.7.14/dlls/dxguid/dxguid.c wine1.7-1.7.18/dlls/dxguid/dxguid.c --- wine1.7-1.7.14/dlls/dxguid/dxguid.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/dxguid/dxguid.c 2014-05-02 18:15:48.000000000 +0000 @@ -36,7 +36,6 @@ #include "mmsystem.h" #include "dsound.h" #include "dsconf.h" -#include "dmusici.h" #include "dmusics.h" #include "dplay.h" #include "dplay8.h" @@ -45,5 +44,4 @@ #include "ddrawi.h" #include "dxdiag.h" #include "dxfile.h" -#include "d3drm.h" #include "rmxfguid.h" diff -Nru wine1.7-1.7.14/dlls/dxva2/dxva2.spec wine1.7-1.7.18/dlls/dxva2/dxva2.spec --- wine1.7-1.7.14/dlls/dxva2/dxva2.spec 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.18/dlls/dxva2/dxva2.spec 2014-05-02 18:15:48.000000000 +0000 @@ -0,0 +1,37 @@ +@ stdcall CapabilitiesRequestAndCapabilitiesReply(ptr ptr long) +@ stdcall DXVA2CreateDirect3DDeviceManager9(ptr ptr) +@ stdcall DXVA2CreateVideoService(ptr ptr ptr) +@ stdcall DegaussMonitor(ptr) +@ stdcall DestroyPhysicalMonitor(ptr) +@ stdcall DestroyPhysicalMonitors(long ptr) +@ stdcall GetCapabilitiesStringLength(ptr ptr) +@ stdcall GetMonitorBrightness(ptr ptr ptr ptr) +@ stdcall GetMonitorCapabilities(ptr ptr ptr) +@ stdcall GetMonitorColorTemperature(ptr ptr) +@ stdcall GetMonitorContrast(ptr ptr ptr ptr) +@ stdcall GetMonitorDisplayAreaPosition(ptr long ptr ptr ptr) +@ stdcall GetMonitorDisplayAreaSize(ptr long ptr ptr ptr) +@ stdcall GetMonitorRedGreenOrBlueDrive(ptr long ptr ptr ptr) +@ stdcall GetMonitorRedGreenOrBlueGain(ptr long ptr ptr ptr) +@ stdcall GetMonitorTechnologyType(ptr ptr) +@ stdcall GetNumberOfPhysicalMonitorsFromHMONITOR(ptr ptr) +@ stdcall GetNumberOfPhysicalMonitorsFromIDirect3DDevice9(ptr ptr) +@ stdcall GetPhysicalMonitorsFromHMONITOR(ptr long ptr) +@ stdcall GetPhysicalMonitorsFromIDirect3DDevice9(ptr long ptr) +@ stdcall GetTimingReport(ptr ptr) +@ stdcall GetVCPFeatureAndVCPFeatureReply(ptr long ptr ptr ptr) +@ stdcall OPMGetVideoOutputsFromHMONITOR(ptr long ptr ptr) +@ stdcall OPMGetVideoOutputsFromIDirect3DDevice9Object(ptr long ptr ptr) +@ stdcall RestoreMonitorFactoryColorDefaults(ptr) +@ stdcall RestoreMonitorFactoryDefaults(ptr) +@ stdcall SaveCurrentMonitorSettings(ptr) +@ stdcall SaveCurrentSettings(ptr) +@ stdcall SetMonitorBrightness(ptr long) +@ stdcall SetMonitorColorTemperature(ptr long) +@ stdcall SetMonitorContrast(ptr long) +@ stdcall SetMonitorDisplayAreaPosition(ptr long long) +@ stdcall SetMonitorDisplayAreaSize(ptr long long) +@ stdcall SetMonitorRedGreenOrBlueDrive(ptr long long) +@ stdcall SetMonitorRedGreenOrBlueGain(ptr long long) +@ stdcall SetVCPFeature(ptr long long) +@ stub UABGetCertificate diff -Nru wine1.7-1.7.14/dlls/dxva2/main.c wine1.7-1.7.18/dlls/dxva2/main.c --- wine1.7-1.7.14/dlls/dxva2/main.c 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.18/dlls/dxva2/main.c 2014-05-02 18:15:48.000000000 +0000 @@ -0,0 +1,336 @@ +/* + * Copyright 2014 Michael Müller for Pipelight + * + * 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 "d3d9.h" +#include "dxva2api.h" +#include "physicalmonitorenumerationapi.h" +#include "lowlevelmonitorconfigurationapi.h" +#include "highlevelmonitorconfigurationapi.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(dxva2); + +BOOL WINAPI CapabilitiesRequestAndCapabilitiesReply( HMONITOR monitor, LPSTR buffer, DWORD length ) +{ + FIXME("(%p, %p, %d): stub\n", monitor, buffer, length); + + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + +HRESULT WINAPI DXVA2CreateDirect3DDeviceManager9( UINT *resetToken, IDirect3DDeviceManager9 **dxvManager ) +{ + FIXME("(%p, %p): stub\n", resetToken, dxvManager); + + return E_NOTIMPL; +} + +HRESULT WINAPI DXVA2CreateVideoService( IDirect3DDevice9 *device, REFIID riid, void **ppv ) +{ + FIXME("(%p, %s, %p): stub\n", device, debugstr_guid(riid), ppv); + + return E_NOTIMPL; +} + +BOOL WINAPI DegaussMonitor( HMONITOR monitor ) +{ + FIXME("(%p): stub\n", monitor); + + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + +BOOL WINAPI DestroyPhysicalMonitor( HMONITOR monitor ) +{ + FIXME("(%p): stub\n", monitor); + + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + +BOOL WINAPI DestroyPhysicalMonitors( DWORD arraySize, LPPHYSICAL_MONITOR array ) +{ + FIXME("(0x%x, %p): stub\n", arraySize, array); + + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + +BOOL WINAPI GetCapabilitiesStringLength( HMONITOR monitor, LPDWORD length ) +{ + FIXME("(%p, %p): stub\n", monitor, length); + + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + +BOOL WINAPI GetMonitorBrightness( HMONITOR monitor, LPDWORD minimum, LPDWORD current, LPDWORD maximum ) +{ + FIXME("(%p, %p, %p, %p): stub\n", monitor, minimum, current, maximum); + + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + +BOOL WINAPI GetMonitorCapabilities( HMONITOR monitor, LPDWORD capabilities, LPDWORD temperatures ) +{ + FIXME("(%p, %p, %p): stub\n", monitor, capabilities, temperatures); + + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + + +BOOL WINAPI GetMonitorColorTemperature( HMONITOR monitor, LPMC_COLOR_TEMPERATURE temperature ) +{ + FIXME("(%p, %p): stub\n", monitor, temperature); + + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + +BOOL WINAPI GetMonitorContrast( HMONITOR monitor, LPDWORD minimum, LPDWORD current, LPDWORD maximum ) +{ + FIXME("(%p, %p, %p, %p): stub\n", monitor, minimum, current, maximum); + + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + +BOOL WINAPI GetMonitorDisplayAreaPosition( HMONITOR monitor, MC_POSITION_TYPE type, LPDWORD minimum, + LPDWORD current, LPDWORD maximum ) +{ + FIXME("(%p, 0x%x, %p, %p, %p): stub\n", monitor, type, minimum, current, maximum); + + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + +BOOL WINAPI GetMonitorDisplayAreaSize( HMONITOR monitor, MC_SIZE_TYPE type, LPDWORD minimum, + LPDWORD current, LPDWORD maximum ) +{ + FIXME("(%p, 0x%x, %p, %p, %p): stub\n", monitor, type, minimum, current, maximum); + + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + +BOOL WINAPI GetMonitorRedGreenOrBlueDrive( HMONITOR monitor, MC_DRIVE_TYPE type, LPDWORD minimum, + LPDWORD current, LPDWORD maximum ) +{ + FIXME("(%p, 0x%x, %p, %p, %p): stub\n", monitor, type, minimum, current, maximum); + + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + +BOOL WINAPI GetMonitorRedGreenOrBlueGain( HMONITOR monitor, MC_GAIN_TYPE type, LPDWORD minimum, + LPDWORD current, LPDWORD maximum ) +{ + FIXME("(%p, 0x%x, %p, %p, %p): stub\n", monitor, type, minimum, current, maximum); + + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + +BOOL WINAPI GetMonitorTechnologyType( HMONITOR monitor, LPMC_DISPLAY_TECHNOLOGY_TYPE type ) +{ + FIXME("(%p, %p): stub\n", monitor, type); + + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + +BOOL WINAPI GetNumberOfPhysicalMonitorsFromHMONITOR( HMONITOR monitor, LPDWORD number ) +{ + FIXME("(%p, %p): stub\n", monitor, number); + + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + +HRESULT WINAPI GetNumberOfPhysicalMonitorsFromIDirect3DDevice9( IDirect3DDevice9 *device, LPDWORD number ) +{ + FIXME("(%p, %p): stub\n", device, number); + + return E_NOTIMPL; +} + +BOOL WINAPI GetPhysicalMonitorsFromHMONITOR( HMONITOR monitor, DWORD arraySize, LPPHYSICAL_MONITOR array ) +{ + FIXME("(%p, 0x%x, %p): stub\n", monitor, arraySize, array); + + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + +HRESULT WINAPI GetPhysicalMonitorsFromIDirect3DDevice9( IDirect3DDevice9 *device, DWORD arraySize, LPPHYSICAL_MONITOR array ) +{ + FIXME("(%p, 0x%x, %p): stub\n", device, arraySize, array); + + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + +BOOL WINAPI GetTimingReport( HMONITOR monitor, LPMC_TIMING_REPORT timingReport ) +{ + FIXME("(%p, %p): stub\n", monitor, timingReport); + + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + +BOOL WINAPI GetVCPFeatureAndVCPFeatureReply( HMONITOR monitor, BYTE vcpCode, LPMC_VCP_CODE_TYPE pvct, + LPDWORD current, LPDWORD maximum ) +{ + FIXME("(%p, 0x%02x, %p, %p, %p): stub\n", monitor, vcpCode, pvct, current, maximum); + + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + +HRESULT WINAPI OPMGetVideoOutputsFromHMONITOR( HMONITOR monitor, /* OPM_VIDEO_OUTPUT_SEMANTICS */ int vos, + ULONG *numVideoOutputs, /* IOPMVideoOutput */ void ***videoOutputs ) +{ + FIXME("(%p, 0x%x, %p, %p): stub\n", monitor, vos, numVideoOutputs, videoOutputs); + + return E_NOTIMPL; +} + +HRESULT WINAPI OPMGetVideoOutputsFromIDirect3DDevice9Object( IDirect3DDevice9 *device, /* OPM_VIDEO_OUTPUT_SEMANTICS */ int vos, + ULONG *numVideoOutputs, /* IOPMVideoOutput */ void ***videoOutputs ) +{ + FIXME("(%p, 0x%x, %p, %p): stub\n", device, vos, numVideoOutputs, videoOutputs); + + return E_NOTIMPL; +} + +BOOL WINAPI RestoreMonitorFactoryColorDefaults( HMONITOR monitor ) +{ + FIXME("(%p): stub\n", monitor); + + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + +BOOL WINAPI RestoreMonitorFactoryDefaults( HMONITOR monitor ) +{ + FIXME("(%p): stub\n", monitor); + + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + +BOOL WINAPI SaveCurrentMonitorSettings( HMONITOR monitor ) +{ + FIXME("(%p): stub\n", monitor); + + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + +BOOL WINAPI SaveCurrentSettings( HMONITOR monitor ) +{ + FIXME("(%p): stub\n", monitor); + + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + +BOOL WINAPI SetMonitorBrightness( HMONITOR monitor, DWORD brightness ) +{ + FIXME("(%p, 0x%x): stub\n", monitor, brightness); + + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + +BOOL WINAPI SetMonitorColorTemperature( HMONITOR monitor, MC_COLOR_TEMPERATURE temperature ) +{ + FIXME("(%p, 0x%x): stub\n", monitor, temperature); + + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + +BOOL WINAPI SetMonitorContrast( HMONITOR monitor, DWORD contrast ) +{ + FIXME("(%p, 0x%x): stub\n", monitor, contrast); + + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + +BOOL WINAPI SetMonitorDisplayAreaPosition( HMONITOR monitor, MC_POSITION_TYPE type, DWORD position ) +{ + FIXME("(%p, 0x%x, 0x%x): stub\n", monitor, type, position); + + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + +BOOL WINAPI SetMonitorDisplayAreaSize( HMONITOR monitor, MC_SIZE_TYPE type, DWORD size ) +{ + FIXME("(%p, 0x%x, 0x%x): stub\n", monitor, type, size); + + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + +BOOL WINAPI SetMonitorRedGreenOrBlueDrive( HMONITOR monitor, MC_DRIVE_TYPE type, DWORD drive ) +{ + FIXME("(%p, 0x%x, 0x%x): stub\n", monitor, type, drive); + + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + +BOOL WINAPI SetMonitorRedGreenOrBlueGain( HMONITOR monitor, MC_GAIN_TYPE type, DWORD gain ) +{ + FIXME("(%p, 0x%x, 0x%x): stub\n", monitor, type, gain); + + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + +BOOL WINAPI SetVCPFeature( HMONITOR monitor, BYTE vcpCode, DWORD value ) +{ + FIXME("(%p, 0x%02x, 0x%x): stub\n", monitor, vcpCode, value); + + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return FALSE; +} + +BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) +{ + TRACE("%p,%x,%p\n", hinstDLL, fdwReason, lpvReserved); + + switch (fdwReason) { + case DLL_WINE_PREATTACH: + return FALSE; /* prefer native version */ + case DLL_PROCESS_ATTACH: + DisableThreadLibraryCalls(hinstDLL); + break; + } + + return TRUE; +} diff -Nru wine1.7-1.7.14/dlls/dxva2/Makefile.in wine1.7-1.7.18/dlls/dxva2/Makefile.in --- wine1.7-1.7.14/dlls/dxva2/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.18/dlls/dxva2/Makefile.in 2014-05-02 18:15:48.000000000 +0000 @@ -0,0 +1,4 @@ +MODULE = dxva2.dll + +C_SRCS = \ + main.c diff -Nru wine1.7-1.7.14/dlls/gameux/tests/gamestatistics.c wine1.7-1.7.18/dlls/gameux/tests/gamestatistics.c --- wine1.7-1.7.14/dlls/gameux/tests/gamestatistics.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/gameux/tests/gamestatistics.c 2014-05-02 18:15:48.000000000 +0000 @@ -130,15 +130,13 @@ 'l','o','r','e','r','\\','G','a','m','e','S','t','a','t','i','s', 't','i','c','s','\\',0}; static const WCHAR sDotGamestats[] = {'.','g','a','m','e','s','t','a','t','s',0}; - static const DWORD dwGuidLength = 49; - HRESULT hr; - WCHAR sGuid[dwGuidLength], sPath[MAX_PATH] = {0}; + WCHAR sGuid[49], sPath[MAX_PATH]; hr = pSHGetFolderPathW(NULL, CSIDL_LOCAL_APPDATA, NULL, SHGFP_TYPE_CURRENT, sPath); if(SUCCEEDED(hr)) - hr = (StringFromGUID2(guidApplicationId, sGuid, dwGuidLength)!=0 ? S_OK : E_FAIL); + hr = (StringFromGUID2(guidApplicationId, sGuid, sizeof(sGuid) / sizeof(sGuid[0])) != 0 ? S_OK : E_FAIL); if(SUCCEEDED(hr)) { diff -Nru wine1.7-1.7.14/dlls/gdi32/bidi.c wine1.7-1.7.18/dlls/gdi32/bidi.c --- wine1.7-1.7.14/dlls/gdi32/bidi.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/gdi32/bidi.c 2014-05-02 18:15:48.000000000 +0000 @@ -596,10 +596,25 @@ if (lpGlyphs && doGlyphs) { - BYTE runOrder[maxItems]; - int visOrder[maxItems]; + BYTE *runOrder; + int *visOrder; SCRIPT_ITEM *curItem; + runOrder = HeapAlloc(GetProcessHeap(), 0, maxItems * sizeof(*runOrder)); + visOrder = HeapAlloc(GetProcessHeap(), 0, maxItems * sizeof(*visOrder)); + if (!runOrder || !visOrder) + { + WARN("Out of memory\n"); + HeapFree(GetProcessHeap(), 0, runOrder); + HeapFree(GetProcessHeap(), 0, visOrder); + HeapFree(GetProcessHeap(), 0, chartype); + HeapFree(GetProcessHeap(), 0, levels); + HeapFree(GetProcessHeap(), 0, pItems); + HeapFree(GetProcessHeap(), 0, psva); + HeapFree(GetProcessHeap(), 0, pwLogClust); + return FALSE; + } + for (j = 0; j < nItems; j++) runOrder[j] = pItems[j].a.s.uBidiLevel; @@ -621,6 +636,8 @@ if (!run_glyphs) { WARN("Out of memory\n"); + HeapFree(GetProcessHeap(), 0, runOrder); + HeapFree(GetProcessHeap(), 0, visOrder); HeapFree(GetProcessHeap(), 0, chartype); HeapFree(GetProcessHeap(), 0, levels); HeapFree(GetProcessHeap(), 0, pItems); @@ -655,6 +672,8 @@ glyph_i += cOutGlyphs; } } + HeapFree(GetProcessHeap(), 0, runOrder); + HeapFree(GetProcessHeap(), 0, visOrder); } done += i; diff -Nru wine1.7-1.7.14/dlls/gdi32/bitmap.c wine1.7-1.7.18/dlls/gdi32/bitmap.c --- wine1.7-1.7.14/dlls/gdi32/bitmap.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/gdi32/bitmap.c 2014-05-02 18:15:48.000000000 +0000 @@ -138,7 +138,7 @@ * Failure: NULL. Use GetLastError() to determine the cause. * * NOTES - * If a width or height of 0 are given, a 1x1 monochrome bitmap is returned. + * If a width or height of 0 is given, a 1x1 monochrome bitmap is returned. */ HBITMAP WINAPI CreateBitmapIndirect( const BITMAP *bmp ) { diff -Nru wine1.7-1.7.14/dlls/gdi32/dc.c wine1.7-1.7.18/dlls/gdi32/dc.c --- wine1.7-1.7.14/dlls/gdi32/dc.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/gdi32/dc.c 2014-05-02 18:15:48.000000000 +0000 @@ -807,7 +807,7 @@ } /* Call hook procedure to check whether is it OK to delete this DC */ - if (dc->hookProc && !dc->hookProc( hdc, DCHC_DELETEDC, dc->dwHookData, 0 )) + if (dc->hookProc && !dc->hookProc( dc->hSelf, DCHC_DELETEDC, dc->dwHookData, 0 )) { release_dc_ptr( dc ); return TRUE; diff -Nru wine1.7-1.7.14/dlls/gdi32/dibdrv/bitblt.c wine1.7-1.7.18/dlls/gdi32/dibdrv/bitblt.c --- wine1.7-1.7.14/dlls/gdi32/dibdrv/bitblt.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/gdi32/dibdrv/bitblt.c 2014-05-02 18:15:48.000000000 +0000 @@ -925,7 +925,10 @@ src_dib.bits.is_copy = bits->is_copy; if (get_clipped_rects( &dib, &dst->visrect, clip, &clipped_rects )) + { copy_rect( &dib, &dst->visrect, &src_dib, &src->visrect, &clipped_rects, R2_COPYPEN ); + free_clipped_rects( &clipped_rects ); + } return ERROR_SUCCESS; @@ -981,6 +984,7 @@ } else ret = execute_rop( pdev, &dst->visrect, &src_dib, &src->visrect, &clipped_rects, rop ); + free_clipped_rects( &clipped_rects ); } if (tmp_rgn) DeleteObject( tmp_rgn ); return ret; diff -Nru wine1.7-1.7.14/dlls/gdi32/freetype.c wine1.7-1.7.18/dlls/gdi32/freetype.c --- wine1.7-1.7.14/dlls/gdi32/freetype.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/gdi32/freetype.c 2014-05-02 18:15:48.000000000 +0000 @@ -5527,12 +5527,20 @@ return i; } +static inline BOOL is_complex_script_ansi_cp(UINT ansi_cp) +{ + return (ansi_cp == 874 /* Thai */ + || ansi_cp == 1255 /* Hebrew */ + || ansi_cp == 1256 /* Arabic */ + ); +} /*************************************************** * create_enum_charset_list * * This function creates charset enumeration list because in DEFAULT_CHARSET * case, the ANSI codepage's charset takes precedence over other charsets. + * Above rule doesn't apply if the ANSI codepage uses complex script (e.g. Thai). * This function works as a filter other than DEFAULT_CHARSET case. */ static DWORD create_enum_charset_list(DWORD charset, struct enum_charset_list *list) @@ -5553,7 +5561,8 @@ /* Set the current codepage's charset as the first element. */ acp = GetACP(); - if (TranslateCharsetInfo((DWORD*)(INT_PTR)acp, &csi, TCI_SRCCODEPAGE) && + if (!is_complex_script_ansi_cp(acp) && + TranslateCharsetInfo((DWORD*)(INT_PTR)acp, &csi, TCI_SRCCODEPAGE) && csi.fs.fsCsb[0] != 0) { list->element[n].mask = csi.fs.fsCsb[0]; list->element[n].charset = csi.ciCharset; diff -Nru wine1.7-1.7.14/dlls/gdi32/tests/bitmap.c wine1.7-1.7.18/dlls/gdi32/tests/bitmap.c --- wine1.7-1.7.14/dlls/gdi32/tests/bitmap.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/gdi32/tests/bitmap.c 2014-05-02 18:15:48.000000000 +0000 @@ -838,7 +838,7 @@ } pbmi->bmiHeader.biClrUsed = 173; memset( pbmi->bmiColors, 0xcc, 256 * sizeof(RGBQUAD) ); - GetDIBits( hdc, hdib, 0, 1, bits, pbmi, DIB_RGB_COLORS ); + GetDIBits( hdc, hdib, 0, 1, NULL, pbmi, DIB_RGB_COLORS ); ok( pbmi->bmiHeader.biClrUsed == 0, "wrong colors %u\n", pbmi->bmiHeader.biClrUsed ); for (i = 0; i < 256; i++) { diff -Nru wine1.7-1.7.14/dlls/gdi32/tests/clipping.c wine1.7-1.7.18/dlls/gdi32/tests/clipping.c --- wine1.7-1.7.14/dlls/gdi32/tests/clipping.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/gdi32/tests/clipping.c 2014-05-02 18:15:48.000000000 +0000 @@ -438,7 +438,7 @@ HDC hdc; HRGN hrgn, hrgn_empty; HWND hwnd; - RECT rc; + RECT rc, virtual_rect; int ret, screen_width, screen_height; /* Windows versions earlier than Win2k do not support the virtual screen metrics, @@ -447,6 +447,8 @@ if(!screen_width) screen_width = GetSystemMetrics(SM_CXSCREEN); screen_height = GetSystemMetrics(SM_CYVIRTUALSCREEN); if(!screen_height) screen_height = GetSystemMetrics(SM_CYSCREEN); + SetRect(&virtual_rect, GetSystemMetrics(SM_XVIRTUALSCREEN), GetSystemMetrics(SM_YVIRTUALSCREEN), + GetSystemMetrics(SM_XVIRTUALSCREEN) + screen_width, GetSystemMetrics(SM_YVIRTUALSCREEN) + screen_height); trace("screen resolution %d x %d\n", screen_width, screen_height); @@ -474,9 +476,9 @@ ret = GetRgnBox(hrgn, &rc); ok(ret == SIMPLEREGION, "expected SIMPLEREGION, got %d\n", ret); - ok(rc.left == 0 && rc.top == 0 && rc.right == screen_width && rc.bottom == screen_height, - "expected 0,0-%d,%d, got %d,%d-%d,%d\n", screen_width, screen_height, - rc.left, rc.top, rc.right, rc.bottom); + ok(EqualRect(&rc, &virtual_rect), "expected %d,%d-%d,%d, got %d,%d-%d,%d\n", + virtual_rect.left, virtual_rect.top, virtual_rect.right, virtual_rect.bottom, + rc.left, rc.top, rc.right, rc.bottom); SetRect( &rc, 10, 10, 20, 20 ); ret = RectVisible( hdc, &rc ); @@ -494,9 +496,9 @@ ret = GetRgnBox(hrgn, &rc); ok(ret == SIMPLEREGION, "expected SIMPLEREGION, got %d\n", ret); - ok(rc.left == 0 && rc.top == 0 && rc.right == screen_width && rc.bottom == screen_height, - "expected 0,0-%d,%d, got %d,%d-%d,%d\n", screen_width, screen_height, - rc.left, rc.top, rc.right, rc.bottom); + ok(EqualRect(&rc, &virtual_rect), "expected %d,%d-%d,%d, got %d,%d-%d,%d\n", + virtual_rect.left, virtual_rect.top, virtual_rect.right, virtual_rect.bottom, + rc.left, rc.top, rc.right, rc.bottom); ret = ExtSelectClipRgn(hdc, 0, RGN_COPY); ok(ret == SIMPLEREGION || (ret == COMPLEXREGION && GetSystemMetrics(SM_CMONITORS) > 1), diff -Nru wine1.7-1.7.14/dlls/gdi32/tests/dc.c wine1.7-1.7.18/dlls/gdi32/tests/dc.c --- wine1.7-1.7.14/dlls/gdi32/tests/dc.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/gdi32/tests/dc.c 2014-05-02 18:15:48.000000000 +0000 @@ -457,12 +457,46 @@ type = GetClipBox( ref_dc, &rect ); if (type != COMPLEXREGION && type != ERROR) /* region can be complex on multi-monitor setups */ { + RECT ref_rect; + ok( type == SIMPLEREGION, "GetClipBox returned %d on %s\n", type, descr ); - ok( rect.left == 0 && rect.top == 0 && - rect.right == GetDeviceCaps( ref_dc, DESKTOPHORZRES ) && - rect.bottom == GetDeviceCaps( ref_dc, DESKTOPVERTRES ), - "GetClipBox returned %d,%d,%d,%d on %s\n", - rect.left, rect.top, rect.right, rect.bottom, descr ); + if (GetDeviceCaps( ref_dc, TECHNOLOGY ) == DT_RASDISPLAY) + { + if (GetSystemMetrics( SM_CXSCREEN ) != GetSystemMetrics( SM_CXVIRTUALSCREEN )) + todo_wine ok( GetDeviceCaps( ref_dc, DESKTOPHORZRES ) == GetSystemMetrics( SM_CXSCREEN ), + "Got DESKTOPHORZRES %d on %s, expected %d\n", + GetDeviceCaps( ref_dc, DESKTOPHORZRES ), descr, GetSystemMetrics( SM_CXSCREEN ) ); + else + ok( GetDeviceCaps( ref_dc, DESKTOPHORZRES ) == GetSystemMetrics( SM_CXSCREEN ), + "Got DESKTOPHORZRES %d on %s, expected %d\n", + GetDeviceCaps( ref_dc, DESKTOPHORZRES ), descr, GetSystemMetrics( SM_CXSCREEN ) ); + + if (GetSystemMetrics( SM_CYSCREEN ) != GetSystemMetrics( SM_CYVIRTUALSCREEN )) + todo_wine ok( GetDeviceCaps( ref_dc, DESKTOPVERTRES ) == GetSystemMetrics( SM_CYSCREEN ), + "Got DESKTOPVERTRES %d on %s, expected %d\n", + GetDeviceCaps( ref_dc, DESKTOPVERTRES ), descr, GetSystemMetrics( SM_CYSCREEN ) ); + else + ok( GetDeviceCaps( ref_dc, DESKTOPVERTRES ) == GetSystemMetrics( SM_CYSCREEN ), + "Got DESKTOPVERTRES %d on %s, expected %d\n", + GetDeviceCaps( ref_dc, DESKTOPVERTRES ), descr, GetSystemMetrics( SM_CYSCREEN ) ); + + SetRect( &ref_rect, GetSystemMetrics( SM_XVIRTUALSCREEN ), GetSystemMetrics( SM_YVIRTUALSCREEN ), + GetSystemMetrics( SM_XVIRTUALSCREEN ) + GetSystemMetrics( SM_CXVIRTUALSCREEN ), + GetSystemMetrics( SM_YVIRTUALSCREEN ) + GetSystemMetrics( SM_CYVIRTUALSCREEN ) ); + } + else + { + SetRect( &ref_rect, 0, 0, GetDeviceCaps( ref_dc, DESKTOPHORZRES ), + GetDeviceCaps( ref_dc, DESKTOPVERTRES ) ); + } + + if (GetDeviceCaps( ref_dc, TECHNOLOGY ) == DT_RASDISPLAY && GetObjectType( hdc ) != OBJ_ENHMETADC && + (GetSystemMetrics( SM_XVIRTUALSCREEN ) || GetSystemMetrics( SM_YVIRTUALSCREEN ))) + todo_wine ok( EqualRect( &rect, &ref_rect ), "GetClipBox returned %d,%d,%d,%d on %s\n", + rect.left, rect.top, rect.right, rect.bottom, descr ); + else + ok( EqualRect( &rect, &ref_rect ), "GetClipBox returned %d,%d,%d,%d on %s\n", + rect.left, rect.top, rect.right, rect.bottom, descr ); } SetBoundsRect( ref_dc, NULL, DCB_RESET | DCB_ACCUMULATE ); diff -Nru wine1.7-1.7.14/dlls/gdi32/tests/dib.c wine1.7-1.7.18/dlls/gdi32/tests/dib.c --- wine1.7-1.7.14/dlls/gdi32/tests/dib.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/gdi32/tests/dib.c 2014-05-02 18:15:48.000000000 +0000 @@ -1210,17 +1210,17 @@ static const RECT *current_bounds; static const char *dst_format; -static inline DWORD get_stride(BITMAPINFO *bmi) +static inline DWORD get_stride(const BITMAPINFO *bmi) { return ((bmi->bmiHeader.biBitCount * bmi->bmiHeader.biWidth + 31) >> 3) & ~3; } -static inline DWORD get_dib_size(BITMAPINFO *bmi) +static inline DWORD get_dib_size(const BITMAPINFO *bmi) { return get_stride(bmi) * abs(bmi->bmiHeader.biHeight); } -static char *hash_dib(BITMAPINFO *bmi, void *bits) +static char *hash_dib(const BITMAPINFO *bmi, const void *bits) { DWORD dib_size = get_dib_size(bmi); HCRYPTHASH hash; @@ -1288,7 +1288,7 @@ current_bounds++; } -static void compare_hash_broken_todo(HDC hdc, BITMAPINFO *bmi, BYTE *bits, const char *info, int num_broken, BOOL todo) +static void compare_hash_broken_todo(HDC hdc, const BITMAPINFO *bmi, BYTE *bits, const char *info, int num_broken, BOOL todo) { char *hash = hash_dib(bmi, bits); BOOL ok_cond; @@ -1332,7 +1332,7 @@ compare_bounds( hdc, info ); } -static void compare_hash(HDC hdc, BITMAPINFO *bmi, BYTE *bits, const char *info) +static void compare_hash(HDC hdc, const BITMAPINFO *bmi, BYTE *bits, const char *info) { compare_hash_broken_todo(hdc, bmi, bits, info, 0, FALSE); } @@ -1615,7 +1615,7 @@ DeleteObject( SelectObject( hdc, brush ) ); } -static void draw_graphics(HDC hdc, BITMAPINFO *bmi, BYTE *bits) +static void draw_graphics(HDC hdc, const BITMAPINFO *bmi, BYTE *bits) { char pal_buffer[sizeof(LOGPALETTE) + 255 * sizeof(PALETTEENTRY)]; LOGPALETTE *pal = (LOGPALETTE *)pal_buffer; @@ -2840,7 +2840,7 @@ static const BYTE masks[8] = {0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01}; -static void draw_text_2( HDC hdc, BITMAPINFO *bmi, BYTE *bits, BOOL aa ) +static void draw_text_2( HDC hdc, const BITMAPINFO *bmi, BYTE *bits, BOOL aa ) { DWORD dib_size = get_dib_size(bmi), ret; LOGFONTA lf; @@ -2956,7 +2956,7 @@ DeleteObject( font ); } -static void draw_text( HDC hdc, BITMAPINFO *bmi, BYTE *bits ) +static void draw_text( HDC hdc, const BITMAPINFO *bmi, BYTE *bits ) { draw_text_2( hdc, bmi, bits, FALSE ); diff -Nru wine1.7-1.7.14/dlls/gdi32/tests/font.c wine1.7-1.7.18/dlls/gdi32/tests/font.c --- wine1.7-1.7.14/dlls/gdi32/tests/font.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/gdi32/tests/font.c 2014-05-02 18:15:48.000000000 +0000 @@ -1190,8 +1190,6 @@ {TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE}}, {HANGEUL_CHARSET, 0x8141, 0xac02, {TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE}}, - {JOHAB_CHARSET, 0x8446, 0x3135, - {TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE}}, {GB2312_CHARSET, 0x8141, 0x4e04, {TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE}}, {CHINESEBIG5_CHARSET, 0xa142, 0x3001, @@ -2256,6 +2254,12 @@ GetClientRect( hwnd, &clientArea ); hdc = GetDC( hwnd ); + if (!is_font_installed("Times New Roman")) + { + skip("Times New Roman is not installed\n"); + return; + } + memset(&lf, 0, sizeof lf); lf.lfCharSet = ANSI_CHARSET; lf.lfClipPrecision = CLIP_DEFAULT_PRECIS; @@ -2957,7 +2961,7 @@ if (TranslateCharsetInfo(ULongToPtr(target->lfCharSet), &csi, TCI_SRCCHARSET)) { fs = ntm->ntmFontSig.fsCsb[0] & valid_bits; - if ((fs & csi.fs.fsCsb[0]) && (fs & ~csi.fs.fsCsb[0])) { + if ((fs & csi.fs.fsCsb[0]) && (fs & ~csi.fs.fsCsb[0]) && (fs & FS_LATIN1)) { *target = *lf; return FALSE; } @@ -2998,13 +3002,13 @@ { struct enum_font_data efd; LOGFONTA target, enum_font; - DWORD ret; + UINT acp; HDC hdc; CHARSETINFO csi; - ret = GetACP(); - if (!TranslateCharsetInfo(ULongToPtr(ret), &csi, TCI_SRCCODEPAGE)) { - skip("TranslateCharsetInfo failed for code page %d.\n", ret); + acp = GetACP(); + if (!TranslateCharsetInfo(ULongToPtr(acp), &csi, TCI_SRCCODEPAGE)) { + skip("TranslateCharsetInfo failed for code page %u.\n", acp); return; } @@ -3018,6 +3022,10 @@ skip("suitable font isn't found for charset %d.\n", enum_font.lfCharSet); return; } + if (acp == 874 || acp == 1255 || acp == 1256) { + /* these codepage use complex script, expecting ANSI_CHARSET here. */ + target.lfCharSet = ANSI_CHARSET; + } efd.total = 0; memset(&enum_font, 0, sizeof(enum_font)); @@ -4127,7 +4135,6 @@ {ANSI_CHARSET, 0x30, 0x30}, {SHIFTJIS_CHARSET, 0x82a0, 0x3042}, {HANGEUL_CHARSET, 0x8141, 0xac02}, - {JOHAB_CHARSET, 0x8446, 0x3135}, {GB2312_CHARSET, 0x8141, 0x4e04}, {CHINESEBIG5_CHARSET, 0xa142, 0x3001} }; diff -Nru wine1.7-1.7.14/dlls/gdiplus/brush.c wine1.7-1.7.18/dlls/gdiplus/brush.c --- wine1.7-1.7.14/dlls/gdiplus/brush.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/gdiplus/brush.c 2014-05-02 18:15:48.000000000 +0000 @@ -745,8 +745,6 @@ /****************************************************************************** * GdipCreateTextureIA [GDIPLUS.@] - * - * FIXME: imageattr ignored */ GpStatus WINGDIPAPI GdipCreateTextureIA(GpImage *image, GDIPCONST GpImageAttributes *imageattr, REAL x, REAL y, REAL width, @@ -844,6 +842,7 @@ imageattr->wrap = wrapmode; stat = GdipCreateTextureIA(image, imageattr, x, y, width, height, texture); + GdipDisposeImageAttributes(imageattr); } return stat; diff -Nru wine1.7-1.7.14/dlls/gdiplus/font.c wine1.7-1.7.18/dlls/gdiplus/font.c --- wine1.7-1.7.14/dlls/gdiplus/font.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/gdiplus/font.c 2014-05-02 18:15:48.000000000 +0000 @@ -1521,7 +1521,7 @@ if (!EnumFontFamiliesExW(hdc, &lfw, add_font_proc, (LPARAM)fontCollection, 0)) { - ReleaseDC(0, hdc); + DeleteDC(hdc); return OutOfMemory; } @@ -1649,7 +1649,7 @@ if (!EnumFontFamiliesExW(hdc, &lfw, add_font_proc, (LPARAM)&installedFontCollection, 0)) { free_installed_fonts(); - ReleaseDC(0, hdc); + DeleteDC(hdc); return OutOfMemory; } diff -Nru wine1.7-1.7.14/dlls/gdiplus/graphics.c wine1.7-1.7.18/dlls/gdiplus/graphics.c --- wine1.7-1.7.14/dlls/gdiplus/graphics.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/gdiplus/graphics.c 2014-05-02 18:15:48.000000000 +0000 @@ -1243,7 +1243,7 @@ INT min_y, max_y, min_x, max_x; INT x, y; ARGB outer_color; - static int transform_fixme_once; + static BOOL transform_fixme_once; if (fill->focus.X != 0.0 || fill->focus.Y != 0.0) { @@ -1280,7 +1280,7 @@ if (!is_identity) { FIXME("path gradient transform not implemented\n"); - transform_fixme_once = 1; + transform_fixme_once = TRUE; } } @@ -1314,7 +1314,7 @@ for (i=0; ipathdata.Count; i++) { int start_center_line=0, end_center_line=0; - int seen_start=0, seen_end=0, seen_center=0; + BOOL seen_start = FALSE, seen_end = FALSE, seen_center = FALSE; REAL center_distance; ARGB start_color, end_color; REAL dy, dx; @@ -1374,17 +1374,17 @@ if (!seen_start && yf >= start_point.Y) { - seen_start = 1; + seen_start = TRUE; start_center_line ^= 1; } if (!seen_end && yf >= end_point.Y) { - seen_end = 1; + seen_end = TRUE; end_center_line ^= 1; } if (!seen_center && yf >= center_point.Y) { - seen_center = 1; + seen_center = TRUE; start_center_line ^= 1; end_center_line ^= 1; } @@ -2781,9 +2781,33 @@ debugstr_pointf(&points[2])); memcpy(ptf, points, 3 * sizeof(GpPointF)); + + /* Ensure source width/height is positive */ + if (srcwidth < 0) + { + GpPointF tmp = ptf[1]; + srcx = srcx + srcwidth; + srcwidth = -srcwidth; + ptf[2].X = ptf[2].X + ptf[1].X - ptf[0].X; + ptf[2].Y = ptf[2].Y + ptf[1].Y - ptf[0].Y; + ptf[1] = ptf[0]; + ptf[0] = tmp; + } + + if (srcheight < 0) + { + GpPointF tmp = ptf[2]; + srcy = srcy + srcheight; + srcheight = -srcheight; + ptf[1].X = ptf[1].X + ptf[2].X - ptf[0].X; + ptf[1].Y = ptf[1].Y + ptf[2].Y - ptf[0].Y; + ptf[2] = ptf[0]; + ptf[0] = tmp; + } + ptf[3].X = ptf[2].X + ptf[1].X - ptf[0].X; ptf[3].Y = ptf[2].Y + ptf[1].Y - ptf[0].Y; - if (!srcwidth || !srcheight || ptf[3].X == ptf[0].X || ptf[3].Y == ptf[0].Y) + if (!srcwidth || !srcheight || (ptf[3].X == ptf[0].X && ptf[3].Y == ptf[0].Y)) return Ok; transform_and_round_points(graphics, pti, ptf, 4); @@ -2815,7 +2839,7 @@ else if (image->type == ImageTypeBitmap) { GpBitmap* bitmap = (GpBitmap*)image; - int use_software=0; + BOOL use_software = FALSE; TRACE("graphics: %.2fx%.2f dpi, fmt %#x, scale %f, image: %.2fx%.2f dpi, fmt %#x, color %08x\n", graphics->xres, graphics->yres, @@ -2829,11 +2853,12 @@ ptf[1].X - ptf[0].X != srcwidth || ptf[2].Y - ptf[0].Y != srcheight || srcx < 0 || srcy < 0 || srcx + srcwidth > bitmap->width || srcy + srcheight > bitmap->height) - use_software = 1; + use_software = TRUE; if (use_software) { RECT dst_area; + GpRectF graphics_bounds; GpRect src_area; int i, x, y, src_stride, dst_stride; GpMatrix dst_to_src; @@ -2859,8 +2884,18 @@ if (dst_area.bottom < pti[i].y) dst_area.bottom = pti[i].y; } + stat = get_graphics_bounds(graphics, &graphics_bounds); + if (stat != Ok) return stat; + + if (graphics_bounds.X > dst_area.left) dst_area.left = floorf(graphics_bounds.X); + if (graphics_bounds.Y > dst_area.top) dst_area.top = floorf(graphics_bounds.Y); + if (graphics_bounds.X + graphics_bounds.Width < dst_area.right) dst_area.right = ceilf(graphics_bounds.X + graphics_bounds.Width); + if (graphics_bounds.Y + graphics_bounds.Height < dst_area.bottom) dst_area.bottom = ceilf(graphics_bounds.Y + graphics_bounds.Height); + TRACE("dst_area: %s\n", wine_dbgstr_rect(&dst_area)); + if (IsRectEmpty(&dst_area)) return Ok; + m11 = (ptf[1].X - ptf[0].X) / srcwidth; m21 = (ptf[2].X - ptf[0].X) / srcheight; mdx = ptf[0].X - m11 * srcx - m21 * srcy; @@ -2906,8 +2941,7 @@ if (stat != Ok) { - if (src_data != dst_data) - GdipFree(src_data); + GdipFree(src_data); GdipFree(dst_data); return stat; } @@ -2956,7 +2990,7 @@ else { HDC hdc; - int temp_hdc=0, temp_bitmap=0; + BOOL temp_hdc = FALSE, temp_bitmap = FALSE; HBITMAP hbitmap, old_hbm=NULL; if (!(bitmap->format == PixelFormat16bppRGB555 || @@ -2970,8 +3004,8 @@ /* we can't draw a bitmap of this format directly */ hdc = CreateCompatibleDC(0); - temp_hdc = 1; - temp_bitmap = 1; + temp_hdc = TRUE; + temp_bitmap = TRUE; bih.biSize = sizeof(BITMAPINFOHEADER); bih.biWidth = bitmap->width; @@ -3005,7 +3039,7 @@ else { GdipCreateHBITMAPFromBitmap(bitmap, &hbitmap, 0); - temp_bitmap = 1; + temp_bitmap = TRUE; } hdc = bitmap->hdc; @@ -4357,13 +4391,25 @@ INT *hotkeyprefix_offsets=NULL; INT hotkeyprefix_count=0; INT hotkeyprefix_pos=0, hotkeyprefix_end_pos=0; - int seen_prefix=0; + BOOL seen_prefix = FALSE; + GpStringFormat *dyn_format=NULL; if(length == -1) length = lstrlenW(string); stringdup = GdipAlloc((length + 1) * sizeof(WCHAR)); if(!stringdup) return OutOfMemory; + if (!format) + { + stat = GdipStringFormatGetGenericDefault(&dyn_format); + if (stat != Ok) + { + GdipFree(stringdup); + return stat; + } + format = dyn_format; + } + nwidth = rect->Width; nheight = rect->Height; if (ignore_empty_clip) @@ -4372,10 +4418,7 @@ if (!nheight) nheight = INT_MAX; } - if (format) - hkprefix = format->hkprefix; - else - hkprefix = HotkeyPrefixNone; + hkprefix = format->hkprefix; if (hkprefix == HotkeyPrefixShow) { @@ -4404,11 +4447,11 @@ hotkeyprefix_offsets[hotkeyprefix_count++] = j; else if (!seen_prefix && hkprefix != HotkeyPrefixNone && string[i] == '&') { - seen_prefix = 1; + seen_prefix = TRUE; continue; } - seen_prefix = 0; + seen_prefix = FALSE; stringdup[j] = string[i]; j++; @@ -4416,8 +4459,7 @@ length = j; - if (format) halign = format->align; - else halign = StringAlignmentNear; + halign = format->align; while(sum < length){ GetTextExtentExPointW(hdc, stringdup + sum, length - sum, @@ -4510,13 +4552,13 @@ break; /* Stop if this was a linewrap (but not if it was a linebreak). */ - if ((lret == fitcpy) && format && - (format->attr & StringFormatFlagsNoWrap)) + if ((lret == fitcpy) && (format->attr & StringFormatFlagsNoWrap)) break; } GdipFree(stringdup); GdipFree(hotkeyprefix_offsets); + GdipDeleteStringFormat(dyn_format); return stat; } diff -Nru wine1.7-1.7.14/dlls/gdiplus/imageattributes.c wine1.7-1.7.18/dlls/gdiplus/imageattributes.c --- wine1.7-1.7.14/dlls/gdiplus/imageattributes.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/gdiplus/imageattributes.c 2014-05-02 18:15:48.000000000 +0000 @@ -279,11 +279,10 @@ if(!imageAttr || type >= ColorAdjustTypeCount) return InvalidParameter; - memset(&imageAttr->colorkeys[type], 0, sizeof(imageAttr->colorkeys[type])); memset(&imageAttr->colormatrices[type], 0, sizeof(imageAttr->colormatrices[type])); - memset(&imageAttr->colorremaptables[type], 0, sizeof(imageAttr->colorremaptables[type])); - memset(&imageAttr->gamma_enabled[type], 0, sizeof(imageAttr->gamma_enabled[type])); - memset(&imageAttr->gamma[type], 0, sizeof(imageAttr->gamma[type])); + GdipSetImageAttributesColorKeys(imageAttr, type, FALSE, 0, 0); + GdipSetImageAttributesRemapTable(imageAttr, type, FALSE, 0, NULL); + GdipSetImageAttributesGamma(imageAttr, type, FALSE, 0.0); return Ok; } diff -Nru wine1.7-1.7.14/dlls/gdiplus/image.c wine1.7-1.7.18/dlls/gdiplus/image.c --- wine1.7-1.7.14/dlls/gdiplus/image.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/gdiplus/image.c 2014-05-02 18:15:48.000000000 +0000 @@ -1252,6 +1252,28 @@ srcBitmap->stride, srcBitmap->bits + srcBitmap->stride * area.Y + PIXELFORMATBPP(srcBitmap->format) * area.X / 8, srcBitmap->format, srcBitmap->image.palette); + + if (stat == Ok && srcBitmap->image.palette) + { + ColorPalette *src_palette, *dst_palette; + + src_palette = srcBitmap->image.palette; + + dst_palette = GdipAlloc(sizeof(UINT) * 2 + sizeof(ARGB) * src_palette->Count); + + if (dst_palette) + { + dst_palette->Flags = src_palette->Flags; + dst_palette->Count = src_palette->Count; + memcpy(dst_palette->Entries, src_palette->Entries, sizeof(ARGB) * src_palette->Count); + + GdipFree((*dstBitmap)->image.palette); + (*dstBitmap)->image.palette = dst_palette; + } + else + stat = OutOfMemory; + } + if (stat != Ok) GdipDisposeImage((GpImage*)*dstBitmap); } @@ -4714,7 +4736,7 @@ GpBitmap *new_bitmap; GpBitmap *bitmap; int bpp, bytesperpixel; - int rotate_90, flip_x, flip_y; + BOOL rotate_90, flip_x, flip_y; int src_x_offset, src_y_offset; LPBYTE src_origin; UINT x, y, width, height; diff -Nru wine1.7-1.7.14/dlls/gdiplus/metafile.c wine1.7-1.7.18/dlls/gdiplus/metafile.c --- wine1.7-1.7.14/dlls/gdiplus/metafile.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/gdiplus/metafile.c 2014-05-02 18:15:48.000000000 +0000 @@ -363,7 +363,7 @@ { EmfPlusFillRects *record; GpStatus stat; - BOOL integer_rects=1; + BOOL integer_rects = TRUE; int i; DWORD brushid; int flags = 0; @@ -383,7 +383,7 @@ { if (!is_integer_rect(&rects[i])) { - integer_rects = 0; + integer_rects = FALSE; break; } } diff -Nru wine1.7-1.7.14/dlls/gdiplus/pathiterator.c wine1.7-1.7.18/dlls/gdiplus/pathiterator.c --- wine1.7-1.7.14/dlls/gdiplus/pathiterator.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/gdiplus/pathiterator.c 2014-05-02 18:15:48.000000000 +0000 @@ -217,7 +217,7 @@ if(iterator->subpath_pos == count){ *startIndex = *endIndex = *resultCount = 0; - *isClosed = 1; + *isClosed = TRUE; return Ok; } diff -Nru wine1.7-1.7.14/dlls/gdiplus/tests/font.c wine1.7-1.7.18/dlls/gdiplus/tests/font.c --- wine1.7-1.7.14/dlls/gdiplus/tests/font.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/gdiplus/tests/font.c 2014-05-02 18:15:48.000000000 +0000 @@ -798,17 +798,23 @@ lf.lfWeight = 0; lf.lfCharSet = 0; lstrcpyA(lf.lfFaceName, "ThisFontShouldNotExist"); + font = NULL; status = GdipCreateFontFromLogfontA(hdc, &lf, &font); todo_wine ok(status == NotTrueTypeFont || broken(status == FileNotFound), /* before XP */ "expected NotTrueTypeFont, got %d\n", status); + /* FIXME: remove when wine is fixed */ + if (font) GdipDeleteFont(font); /* empty FaceName */ lf.lfFaceName[0] = 0; + font = NULL; status = GdipCreateFontFromLogfontA(hdc, &lf, &font); todo_wine ok(status == NotTrueTypeFont || broken(status == FileNotFound), /* before XP */ "expected NotTrueTypeFont, got %d\n", status); + /* FIXME: remove when wine is fixed */ + if (font) GdipDeleteFont(font); GdipDeleteGraphics(graphics); DeleteDC(hdc); diff -Nru wine1.7-1.7.14/dlls/gdiplus/tests/graphics.c wine1.7-1.7.18/dlls/gdiplus/tests/graphics.c --- wine1.7-1.7.14/dlls/gdiplus/tests/graphics.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/gdiplus/tests/graphics.c 2014-05-02 18:15:48.000000000 +0000 @@ -92,7 +92,7 @@ return pixels_to_units(pixels, to, dpi); } -static GpGraphics *create_graphics(REAL res_x, REAL res_y, GpUnit unit, REAL scale) +static GpGraphics *create_graphics(REAL res_x, REAL res_y, GpUnit unit, REAL scale, GpImage **image) { GpStatus status; union @@ -117,11 +117,8 @@ status = GdipGetImageGraphicsContext(u.image, &graphics); expect(Ok, status); - /* image is intentionally leaked to make sure that there is no - side effects after its destruction. - status = GdipDisposeImage(u.image); - expect(Ok, status); - */ + + *image = u.image; status = GdipGetDpiX(graphics, &res); expect(Ok, status); @@ -3519,7 +3516,9 @@ for (i = 0; i < sizeof(td)/sizeof(td[0]); i++) { - graphics = create_graphics(td[i].res_x, td[i].res_y, td[i].unit, td[i].page_scale); + GpImage *image; + + graphics = create_graphics(td[i].res_x, td[i].res_y, td[i].unit, td[i].page_scale, &image); lf.lfHeight = 0xdeadbeef; status = GdipGetLogFontW(font, graphics, &lf); @@ -3570,6 +3569,9 @@ status = GdipDeleteGraphics(graphics); expect(Ok, status); + + status = GdipDisposeImage(image); + expect(Ok, status); } GdipDeleteFont(font); @@ -3593,8 +3595,9 @@ for (i = 0; i < sizeof(td)/sizeof(td[0]); i++) { REAL unit_scale; + GpImage *image; - graphics = create_graphics(td[i].res_x, td[i].res_y, td[i].unit, td[i].page_scale); + graphics = create_graphics(td[i].res_x, td[i].res_y, td[i].unit, td[i].page_scale, &image); lf.lfHeight = 0xdeadbeef; status = GdipGetLogFontW(font, graphics, &lf); @@ -3664,6 +3667,9 @@ status = GdipDeleteGraphics(graphics); expect(Ok, status); + + status = GdipDisposeImage(image); + expect(Ok, status); } GdipDeleteFont(font); @@ -3701,12 +3707,13 @@ }; GpStatus status; GpGraphics *graphics; + GpImage *image; GpPointF ptf[2]; UINT i; for (i = 0; i < sizeof(td)/sizeof(td[0]); i++) { - graphics = create_graphics(td[i].res_x, td[i].res_y, td[i].unit, td[i].scale); + graphics = create_graphics(td[i].res_x, td[i].res_y, td[i].unit, td[i].scale, &image); ptf[0].X = td[i].in[0].X; ptf[0].Y = td[i].in[0].Y; ptf[1].X = td[i].in[1].X; @@ -3725,6 +3732,8 @@ expectf(td[i].in[1].Y, ptf[1].Y); status = GdipDeleteGraphics(graphics); expect(Ok, status); + status = GdipDisposeImage(image); + expect(Ok, status); } } diff -Nru wine1.7-1.7.14/dlls/gphoto2.ds/gphoto2_main.c wine1.7-1.7.18/dlls/gphoto2.ds/gphoto2_main.c --- wine1.7-1.7.14/dlls/gphoto2.ds/gphoto2_main.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/gphoto2.ds/gphoto2_main.c 2014-05-02 18:15:48.000000000 +0000 @@ -643,7 +643,7 @@ break; default: twRC = TWRC_FAILURE; - FIXME("unrecognized opertion triplet\n"); + FIXME("unrecognized operation triplet\n"); } break; diff -Nru wine1.7-1.7.14/dlls/hhctrl.ocx/stream.c wine1.7-1.7.18/dlls/hhctrl.ocx/stream.c --- wine1.7-1.7.14/dlls/hhctrl.ocx/stream.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/hhctrl.ocx/stream.c 2014-05-02 18:15:48.000000000 +0000 @@ -145,7 +145,7 @@ strbuf_init(&tmpbuf); if(!find_node_end(stream, &tmpbuf)) { - strbuf_free(buf); + strbuf_free(&tmpbuf); return FALSE; } strbuf_free(&tmpbuf); diff -Nru wine1.7-1.7.14/dlls/hnetcfg/hnetcfg.idl wine1.7-1.7.18/dlls/hnetcfg/hnetcfg.idl --- wine1.7-1.7.14/dlls/hnetcfg/hnetcfg.idl 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/hnetcfg/hnetcfg.idl 2014-05-02 18:15:48.000000000 +0000 @@ -35,3 +35,11 @@ uuid(ec9846b3-2762-4a6b-a214-6acb603462d2) ] coclass NetFwAuthorizedApplication { interface INetFwAuthorizedApplications; } + +[ + helpstring("HNetCfg.FwOpenPort"), + progid("HNetCfg.FwOpenPort"), + threading(both), + uuid(0ca545c6-37ad-4a6c-bf92-9f7610067ef5) +] +coclass NetFwOpenPort { interface INetFwOpenPort; } diff -Nru wine1.7-1.7.14/dlls/ieframe/ieframe.h wine1.7-1.7.18/dlls/ieframe/ieframe.h --- wine1.7-1.7.14/dlls/ieframe/ieframe.h 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/ieframe/ieframe.h 2014-05-02 18:15:48.000000000 +0000 @@ -58,7 +58,7 @@ IHlinkFrame IHlinkFrame_iface; ITargetFrame2 ITargetFrame2_iface; ITargetFramePriv2 ITargetFramePriv2_iface; - IWebBrowserPriv2IE8 IWebBrowserPriv2IE8_iface; + IWebBrowserPriv2IE9 IWebBrowserPriv2IE9_iface; IUnknown *outer; DocHost *doc_host; diff -Nru wine1.7-1.7.14/dlls/ieframe/ieframe_main.c wine1.7-1.7.18/dlls/ieframe/ieframe_main.c --- wine1.7-1.7.14/dlls/ieframe/ieframe_main.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/ieframe/ieframe_main.c 2014-05-02 18:15:48.000000000 +0000 @@ -49,6 +49,8 @@ return wine_dbg_sprintf("{VT_DISPATCH: %p}", V_DISPATCH(v)); case VT_BOOL: return wine_dbg_sprintf("{VT_BOOL: %x}", V_BOOL(v)); + case VT_ERROR: + return wine_dbg_sprintf("{VT_ERROR: %08x}", V_ERROR(v)); default: return wine_dbg_sprintf("{vt %d}", V_VT(v)); } diff -Nru wine1.7-1.7.14/dlls/ieframe/navigate.c wine1.7-1.7.18/dlls/ieframe/navigate.c --- wine1.7-1.7.14/dlls/ieframe/navigate.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/ieframe/navigate.c 2014-05-02 18:15:48.000000000 +0000 @@ -928,11 +928,9 @@ TRACE("navigating to %s\n", debugstr_w(url)); - if((Flags && V_VT(Flags) != VT_EMPTY) - || (TargetFrameName && V_VT(TargetFrameName) != VT_EMPTY)) - FIXME("Unsupported args (Flags %p:%d; TargetFrameName %p:%d)\n", - Flags, Flags ? V_VT(Flags) : -1, TargetFrameName, - TargetFrameName ? V_VT(TargetFrameName) : -1); + if((Flags && V_VT(Flags) != VT_EMPTY && V_VT(Flags) != VT_ERROR) + || (TargetFrameName && V_VT(TargetFrameName) != VT_EMPTY && V_VT(TargetFrameName) != VT_ERROR)) + FIXME("Unsupported args (Flags %s; TargetFrameName %s)\n", debugstr_variant(Flags), debugstr_variant(TargetFrameName)); if(PostData && V_VT(PostData) == (VT_ARRAY | VT_UI1) && V_ARRAY(PostData)) { SafeArrayAccessData(V_ARRAY(PostData), (void**)&post_data); @@ -1451,107 +1449,43 @@ TargetFramePriv2_AggregatedNavigation2 }; -static inline HlinkFrame *impl_from_IWebBrowserPriv2IE8(IWebBrowserPriv2IE8 *iface) +static inline HlinkFrame *impl_from_IWebBrowserPriv2IE9(IWebBrowserPriv2IE9 *iface) { - return CONTAINING_RECORD(iface, HlinkFrame, IWebBrowserPriv2IE8_iface); + return CONTAINING_RECORD(iface, HlinkFrame, IWebBrowserPriv2IE9_iface); } -static HRESULT WINAPI WebBrowserPriv2IE8_QueryInterface(IWebBrowserPriv2IE8 *iface, REFIID riid, void **ppv) +static HRESULT WINAPI WebBrowserPriv2IE9_QueryInterface(IWebBrowserPriv2IE9 *iface, REFIID riid, void **ppv) { - HlinkFrame *This = impl_from_IWebBrowserPriv2IE8(iface); + HlinkFrame *This = impl_from_IWebBrowserPriv2IE9(iface); return IUnknown_QueryInterface(This->outer, riid, ppv); } -static ULONG WINAPI WebBrowserPriv2IE8_AddRef(IWebBrowserPriv2IE8 *iface) +static ULONG WINAPI WebBrowserPriv2IE9_AddRef(IWebBrowserPriv2IE9 *iface) { - HlinkFrame *This = impl_from_IWebBrowserPriv2IE8(iface); + HlinkFrame *This = impl_from_IWebBrowserPriv2IE9(iface); return IUnknown_AddRef(This->outer); } -static ULONG WINAPI WebBrowserPriv2IE8_Release(IWebBrowserPriv2IE8 *iface) +static ULONG WINAPI WebBrowserPriv2IE9_Release(IWebBrowserPriv2IE9 *iface) { - HlinkFrame *This = impl_from_IWebBrowserPriv2IE8(iface); + HlinkFrame *This = impl_from_IWebBrowserPriv2IE9(iface); return IUnknown_Release(This->outer); } -static HRESULT WINAPI WebBrowserPriv2IE8_NavigateWithBindCtx2(IWebBrowserPriv2IE8 *iface, IUri *uri, VARIANT *flags, - VARIANT *target_frame, VARIANT *post_data, VARIANT *headers, IBindCtx *bind_ctx, LPOLESTR url_fragment) +static HRESULT WINAPI WebBrowserPriv2IE9_NavigateWithBindCtx2(IWebBrowserPriv2IE9 *iface, IUri *uri, VARIANT *flags, + VARIANT *target_frame, VARIANT *post_data, VARIANT *headers, IBindCtx *bind_ctx, LPOLESTR url_fragment, DWORD unused) { - HlinkFrame *This = impl_from_IWebBrowserPriv2IE8(iface); + HlinkFrame *This = impl_from_IWebBrowserPriv2IE9(iface); FIXME("(%p)->(%p %s %s %s %s %p %s)\n", This, uri, debugstr_variant(flags), debugstr_variant(target_frame), debugstr_variant(post_data), debugstr_variant(headers), bind_ctx, debugstr_w(url_fragment)); return E_NOTIMPL; } -static HRESULT WINAPI WebBrowserPriv2IE8_SetBrowserFrameOptions(IWebBrowserPriv2IE8 *iface, DWORD opt1, DWORD opt2) -{ - HlinkFrame *This = impl_from_IWebBrowserPriv2IE8(iface); - FIXME("(%p)->(%x %x)\n", This, opt1, opt2); - return E_NOTIMPL; -} - -static HRESULT WINAPI WebBrowserPriv2IE8_DetachConnectionPoints(IWebBrowserPriv2IE8 *iface) -{ - HlinkFrame *This = impl_from_IWebBrowserPriv2IE8(iface); - FIXME("(%p)->()\n", This); - return E_NOTIMPL; -} - -static HRESULT WINAPI WebBrowserPriv2IE8_GetProcessId(IWebBrowserPriv2IE8 *iface, DWORD *pid) -{ - HlinkFrame *This = impl_from_IWebBrowserPriv2IE8(iface); - FIXME("(%p)->(%p)\n", This, pid); - return E_NOTIMPL; -} - -static HRESULT WINAPI WebBrowserPriv2IE8_CompatAttachEditEvents(IWebBrowserPriv2IE8 *iface) -{ - HlinkFrame *This = impl_from_IWebBrowserPriv2IE8(iface); - FIXME("(%p)->()\n", This); - return E_NOTIMPL; -} - -static HRESULT WINAPI WebBrowserPriv2IE8_HandleOpenOptions(IWebBrowserPriv2IE8 *iface, IUnknown *obj, BSTR bstr, int options) -{ - HlinkFrame *This = impl_from_IWebBrowserPriv2IE8(iface); - FIXME("(%p)->(%p %s %x)\n", This, obj, debugstr_w(bstr), options); - return E_NOTIMPL; -} - -static HRESULT WINAPI WebBrowserPriv2IE8_SetSearchTerm(IWebBrowserPriv2IE8 *iface, BSTR term) -{ - HlinkFrame *This = impl_from_IWebBrowserPriv2IE8(iface); - FIXME("(%p)->(%s)\n", This, debugstr_w(term)); - return E_NOTIMPL; -} - -static HRESULT WINAPI WebBrowserPriv2IE8_GetSearchTerm(IWebBrowserPriv2IE8 *iface, BSTR *term) -{ - HlinkFrame *This = impl_from_IWebBrowserPriv2IE8(iface); - FIXME("(%p)->(%p)\n", This, term); - return E_NOTIMPL; -} - -static HRESULT WINAPI WebBrowserPriv2IE8_GetCurrentDocument(IWebBrowserPriv2IE8 *iface, IDispatch **doc) -{ - HlinkFrame *This = impl_from_IWebBrowserPriv2IE8(iface); - FIXME("(%p)->(%p)\n", This, doc); - return E_NOTIMPL; -} - -static const IWebBrowserPriv2IE8Vtbl WebBrowserPriv2IE8Vtbl = { - WebBrowserPriv2IE8_QueryInterface, - WebBrowserPriv2IE8_AddRef, - WebBrowserPriv2IE8_Release, - WebBrowserPriv2IE8_NavigateWithBindCtx2, - WebBrowserPriv2IE8_SetBrowserFrameOptions, - WebBrowserPriv2IE8_DetachConnectionPoints, - WebBrowserPriv2IE8_GetProcessId, - WebBrowserPriv2IE8_CompatAttachEditEvents, - WebBrowserPriv2IE8_HandleOpenOptions, - WebBrowserPriv2IE8_SetSearchTerm, - WebBrowserPriv2IE8_GetSearchTerm, - WebBrowserPriv2IE8_GetCurrentDocument +static const IWebBrowserPriv2IE9Vtbl WebBrowserPriv2IE9Vtbl = { + WebBrowserPriv2IE9_QueryInterface, + WebBrowserPriv2IE9_AddRef, + WebBrowserPriv2IE9_Release, + WebBrowserPriv2IE9_NavigateWithBindCtx2 }; BOOL HlinkFrame_QI(HlinkFrame *This, REFIID riid, void **ppv) @@ -1568,9 +1502,9 @@ }else if(IsEqualGUID(&IID_ITargetFramePriv2, riid)) { TRACE("(%p)->(IID_ITargetFramePriv2 %p)\n", This, ppv); *ppv = &This->ITargetFramePriv2_iface; - }else if(IsEqualGUID(&IID_IWebBrowserPriv2IE8, riid)) { - TRACE("(%p)->(IID_IWebBrowserPriv2IE8 %p)\n", This, ppv); - *ppv = &This->IWebBrowserPriv2IE8_iface; + }else if(IsEqualGUID(&IID_IWebBrowserPriv2IE9, riid)) { + TRACE("(%p)->(IID_IWebBrowserPriv2IE9 %p)\n", This, ppv); + *ppv = &This->IWebBrowserPriv2IE9_iface; }else { return FALSE; } @@ -1584,7 +1518,7 @@ This->IHlinkFrame_iface.lpVtbl = &HlinkFrameVtbl; This->ITargetFrame2_iface.lpVtbl = &TargetFrame2Vtbl; This->ITargetFramePriv2_iface.lpVtbl = &TargetFramePriv2Vtbl; - This->IWebBrowserPriv2IE8_iface.lpVtbl = &WebBrowserPriv2IE8Vtbl; + This->IWebBrowserPriv2IE9_iface.lpVtbl = &WebBrowserPriv2IE9Vtbl; This->outer = outer; This->doc_host = doc_host; diff -Nru wine1.7-1.7.14/dlls/ieframe/tests/webbrowser.c wine1.7-1.7.18/dlls/ieframe/tests/webbrowser.c --- wine1.7-1.7.14/dlls/ieframe/tests/webbrowser.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/ieframe/tests/webbrowser.c 2014-05-02 18:15:48.000000000 +0000 @@ -419,10 +419,12 @@ CHECK_EXPECT(Exec_IDM_STOP); return OLECMDERR_E_NOTSUPPORTED; case OLECMDID_UPDATETRAVELENTRY_DATARECOVERY: + case OLECMDID_PAGEAVAILABLE: /* TODO (IE11) */ + return E_NOTIMPL; case 6058: /* TODO */ return E_NOTIMPL; default: - ok(0, "unexpected nsCmdID %d\n", nCmdID); + ok(0, "unexpected nCmdID %d\n", nCmdID); } }else if(IsEqualGUID(&CGID_Explorer, pguidCmdGroup)) { switch(nCmdID) { @@ -437,6 +439,7 @@ case 101: /* TODO (IE8) */ case 109: /* TODO (IE9) */ case 113: /* TODO (IE10) */ + case 119: /* IE11 */ return E_FAIL; default: ok(0, "unexpected nCmdID %d\n", nCmdID); @@ -444,11 +447,14 @@ }else if(IsEqualGUID(&CGID_ShellDocView, pguidCmdGroup)) { switch(nCmdID) { case 105: /* TODO */ + case 133: /* IE11 */ case 134: /* TODO (IE10) */ + case 135: /* IE11 */ case 136: /* TODO (IE10) */ case 138: /* TODO */ case 140: /* TODO (Win7) */ case 144: /* TODO */ + case 178: /* IE11 */ return E_FAIL; default: ok(0, "unexpected nCmdID %d\n", nCmdID); diff -Nru wine1.7-1.7.14/dlls/imm32/imm.c wine1.7-1.7.18/dlls/imm32/imm.c --- wine1.7-1.7.14/dlls/imm32/imm.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/imm32/imm.c 2014-05-02 18:15:48.000000000 +0000 @@ -696,6 +696,9 @@ /* Initialize the IME Private */ new_context->IMC.hPrivate = ImmCreateIMCC(new_context->immKbd->imeInfo.dwPrivateDataSize); + new_context->IMC.fdwConversion = new_context->immKbd->imeInfo.fdwConversionCaps; + new_context->IMC.fdwSentence = new_context->immKbd->imeInfo.fdwSentenceCaps; + if (!new_context->immKbd->pImeSelect(new_context, TRUE)) { TRACE("Selection of IME failed\n"); diff -Nru wine1.7-1.7.14/dlls/imm32/tests/imm32.c wine1.7-1.7.18/dlls/imm32/tests/imm32.c --- wine1.7-1.7.14/dlls/imm32/tests/imm32.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/imm32/tests/imm32.c 2014-05-02 18:15:48.000000000 +0000 @@ -753,7 +753,7 @@ count = ImmGetIMCLockCount(0x00000000); ok(count == 0, "NULL IMC should return 0\n"); ret = GetLastError(); - ok(ret == 0xdeadbeef, "Last Error should remain unchangedi %08x\n",ret); + ok(ret == 0xdeadbeef, "Last Error should remain unchanged: %08x\n",ret); count = ImmGetIMCLockCount(imc); ok(count == 0, "Destroyed IMC should return 0\n"); ret = GetLastError(); diff -Nru wine1.7-1.7.14/dlls/inetmib1/tests/main.c wine1.7-1.7.18/dlls/inetmib1/tests/main.c --- wine1.7-1.7.14/dlls/inetmib1/tests/main.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/inetmib1/tests/main.c 2014-05-02 18:15:48.000000000 +0000 @@ -73,7 +73,7 @@ if (0) { /* Fails when called on win8, documentation suggests that - extension itself is resposible of freeing this oid */ + extension itself is responsible for freeing this oid */ SnmpUtilOidFree(&oid); } } diff -Nru wine1.7-1.7.14/dlls/jscript/engine.c wine1.7-1.7.18/dlls/jscript/engine.c --- wine1.7-1.7.14/dlls/jscript/engine.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/jscript/engine.c 2014-05-02 18:15:48.000000000 +0000 @@ -795,18 +795,17 @@ TRACE("\n"); - assert(is_bool(stack_top(ctx))); - if(!get_bool(stack_top(ctx))) { - TRACE("passing exception\n"); + v = stack_pop(ctx); + assert(is_bool(v)); - jsval_release(v); - stack_popn(ctx, 1); + if(!get_bool(v)) { + TRACE("passing exception\n"); ctx->script->ei.val = stack_pop(ctx); return DISP_E_EXCEPTION; } - stack_popn(ctx, 2); + stack_pop(ctx); return S_OK; } diff -Nru wine1.7-1.7.14/dlls/jscript/jsutils.c wine1.7-1.7.18/dlls/jscript/jsutils.c --- wine1.7-1.7.14/dlls/jscript/jsutils.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/jscript/jsutils.c 2014-05-02 18:15:48.000000000 +0000 @@ -327,6 +327,9 @@ *r = jsval_disp(disp); return S_OK; } + }else { + *r = jsval_disp(NULL); + return S_OK; } /* fall through */ default: diff -Nru wine1.7-1.7.14/dlls/jscript/tests/run.c wine1.7-1.7.18/dlls/jscript/tests/run.c --- wine1.7-1.7.14/dlls/jscript/tests/run.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/jscript/tests/run.c 2014-05-02 18:15:48.000000000 +0000 @@ -1156,7 +1156,7 @@ return S_OK; case DISPID_GLOBAL_TESTARGTYPES: { - VARIANT args[3]; + VARIANT args[4]; DISPPARAMS dp = {args, NULL, sizeof(args)/sizeof(*args), 0}; HRESULT hres; @@ -1190,6 +1190,8 @@ V_INT(args+1) = 22; V_VT(args+2) = VT_UNKNOWN; V_UNKNOWN(args+2) = (IUnknown*)&testObj; + V_VT(args+3) = VT_UNKNOWN; + V_UNKNOWN(args+3) = NULL; hres = IDispatch_Invoke(V_DISPATCH(pdp->rgvarg), DISPID_VALUE, &IID_NULL, 0, DISPATCH_METHOD, &dp, NULL, NULL, NULL); ok(hres == S_OK, "Invoke failed: %08x\n", hres); @@ -2140,10 +2142,12 @@ CHECK_CALLED(global_propargput_i); SET_EXPECT(global_testargtypes_i); - parse_script_a("testArgTypes(dispUnk, intProp(), intProp, getShort(), shortProp, function(d,i,s) {" + parse_script_a("testArgTypes(dispUnk, intProp(), intProp, getShort(), shortProp, function(nullunk,d,i,s) {" " ok(getVT(i) === 'VT_I4', 'getVT(i) = ' + getVT(i));" " ok(getVT(s) === 'VT_I4', 'getVT(s) = ' + getVT(s));" " ok(getVT(d) === 'VT_DISPATCH', 'getVT(d) = ' + getVT(d));" + " ok(getVT(nullunk) === 'VT_DISPATCH', 'getVT(nullunk) = ' + getVT(nullunk));" + " ok(nullunk === null, 'nullunk !== null');" "});"); CHECK_CALLED(global_testargtypes_i); diff -Nru wine1.7-1.7.14/dlls/kernel32/console.c wine1.7-1.7.18/dlls/kernel32/console.c --- wine1.7-1.7.14/dlls/kernel32/console.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/kernel32/console.c 2014-05-02 18:15:48.000000000 +0000 @@ -34,6 +34,7 @@ #include #include #include +#include #ifdef HAVE_UNISTD_H # include #endif @@ -1607,10 +1608,17 @@ DWORD ncr = 0; BOOL ret; + if (!ptr) + { + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return FALSE; + } + if ((ret = ReadConsoleW(hConsoleInput, ptr, nNumberOfCharsToRead, &ncr, NULL))) + { ncr = WideCharToMultiByte(GetConsoleCP(), 0, ptr, ncr, lpBuffer, nNumberOfCharsToRead, NULL, NULL); - - if (lpNumberOfCharsRead) *lpNumberOfCharsRead = ncr; + if (lpNumberOfCharsRead) *lpNumberOfCharsRead = ncr; + } HeapFree(GetProcessHeap(), 0, ptr); return ret; @@ -1631,6 +1639,12 @@ TRACE("(%p,%p,%d,%p,%p)\n", hConsoleInput, lpBuffer, nNumberOfCharsToRead, lpNumberOfCharsRead, lpReserved); + if (nNumberOfCharsToRead > INT_MAX) + { + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + return FALSE; + } + if (!GetConsoleMode(hConsoleInput, &mode)) return FALSE; if ((fd = get_console_bare_fd(hConsoleInput)) != -1) diff -Nru wine1.7-1.7.14/dlls/kernel32/fiber.c wine1.7-1.7.18/dlls/kernel32/fiber.c --- wine1.7-1.7.14/dlls/kernel32/fiber.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/kernel32/fiber.c 2014-05-02 18:15:48.000000000 +0000 @@ -230,7 +230,7 @@ } else { - index = RtlFindClearBitsAndSet( peb->FlsBitmap, 1, 0 ); + index = RtlFindClearBitsAndSet( peb->FlsBitmap, 1, 1 ); if (index != ~0U) { if (!NtCurrentTeb()->FlsSlots && @@ -279,7 +279,7 @@ */ PVOID WINAPI FlsGetValue( DWORD index ) { - if (index >= 8 * sizeof(NtCurrentTeb()->Peb->FlsBitmapBits) || !NtCurrentTeb()->FlsSlots) + if (!index || index >= 8 * sizeof(NtCurrentTeb()->Peb->FlsBitmapBits) || !NtCurrentTeb()->FlsSlots) { SetLastError( ERROR_INVALID_PARAMETER ); return NULL; @@ -293,7 +293,7 @@ */ BOOL WINAPI FlsSetValue( DWORD index, PVOID data ) { - if (index >= 8 * sizeof(NtCurrentTeb()->Peb->FlsBitmapBits)) + if (!index || index >= 8 * sizeof(NtCurrentTeb()->Peb->FlsBitmapBits)) { SetLastError( ERROR_INVALID_PARAMETER ); return FALSE; diff -Nru wine1.7-1.7.14/dlls/kernel32/file.c wine1.7-1.7.18/dlls/kernel32/file.c --- wine1.7-1.7.14/dlls/kernel32/file.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/kernel32/file.c 2014-05-02 18:15:48.000000000 +0000 @@ -983,6 +983,12 @@ IO_STATUS_BLOCK io; NTSTATUS status; + if (is_console_handle( hFile )) + { + SetLastError( ERROR_INVALID_HANDLE ); + return FALSE; + } + status = NtQueryInformationFile( hFile, &io, &info, sizeof(info), FileStandardInformation ); if (status == STATUS_SUCCESS) { diff -Nru wine1.7-1.7.14/dlls/kernel32/kernel32.spec wine1.7-1.7.18/dlls/kernel32/kernel32.spec --- wine1.7-1.7.14/dlls/kernel32/kernel32.spec 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/kernel32/kernel32.spec 2014-05-02 18:15:48.000000000 +0000 @@ -940,6 +940,7 @@ @ stub QueryOldestEventLogRecord @ stdcall QueryPerformanceCounter(ptr) @ stdcall QueryPerformanceFrequency(ptr) +@ stdcall QueryUnbiasedInterruptTime(ptr) @ stub QueryWin31IniFilesMappedToRegistry @ stdcall QueueUserAPC(ptr long long) @ stdcall QueueUserWorkItem(ptr ptr long) @@ -1041,6 +1042,7 @@ @ stdcall -arch=x86_64 RtlCompareMemory(ptr ptr long) ntdll.RtlCompareMemory @ cdecl -arch=arm,x86_64 RtlDeleteFunctionTable(ptr) ntdll.RtlDeleteFunctionTable @ stdcall RtlFillMemory(ptr long long) ntdll.RtlFillMemory +@ cdecl -arch=x86_64 RtlInstallFunctionTableCallback(long long long ptr ptr ptr) ntdll.RtlInstallFunctionTableCallback @ stdcall -arch=arm,x86_64 RtlLookupFunctionEntry(long ptr ptr) ntdll.RtlLookupFunctionEntry @ stdcall RtlMoveMemory(ptr ptr long) ntdll.RtlMoveMemory @ stdcall -arch=x86_64,arm RtlPcToFileHeader(ptr ptr) ntdll.RtlPcToFileHeader @@ -1191,6 +1193,7 @@ @ stub SetVolumeMountPointA @ stub SetVolumeMountPointW @ stdcall SetWaitableTimer(long ptr long ptr ptr long) +@ stdcall SetWaitableTimerEx(long ptr long ptr ptr ptr long) @ stdcall SetupComm(long long long) @ stub ShowConsoleCursor @ stdcall SignalObjectAndWait(long long long long) @@ -1275,6 +1278,7 @@ @ stdcall WerRegisterMemoryBlock(ptr long) @ stdcall WerRegisterRuntimeExceptionModule(wstr ptr) @ stdcall WerSetFlags(long) +@ stdcall WerUnregisterMemoryBlock(ptr) @ stdcall WideCharToMultiByte(long long wstr long ptr long ptr ptr) @ stdcall WinExec(str long) @ stdcall Wow64EnableWow64FsRedirection(long) diff -Nru wine1.7-1.7.14/dlls/kernel32/locale.c wine1.7-1.7.18/dlls/kernel32/locale.c --- wine1.7-1.7.14/dlls/kernel32/locale.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/kernel32/locale.c 2014-05-02 18:15:48.000000000 +0000 @@ -2985,6 +2985,10 @@ INT WINAPI CompareStringEx(LPCWSTR locale, DWORD flags, LPCWSTR str1, INT len1, LPCWSTR str2, INT len2, LPNLSVERSIONINFO version, LPVOID reserved, LPARAM lParam) { + DWORD supported_flags = NORM_IGNORECASE|NORM_IGNORENONSPACE|NORM_IGNORESYMBOLS|SORT_STRINGSORT + |NORM_IGNOREKANATYPE|NORM_IGNOREWIDTH|LOCALE_USE_CP_ACP; + DWORD semistub_flags = NORM_LINGUISTIC_CASING|LINGUISTIC_IGNORECASE|0x10000000; + /* 0x10000000 is related to diacritics in Arabic, Japanese, and Hebrew */ INT ret; if (version) FIXME("unexpected version parameter\n"); @@ -2997,16 +3001,14 @@ return 0; } - if( flags & ~(NORM_IGNORECASE|NORM_IGNORENONSPACE|NORM_IGNORESYMBOLS| - SORT_STRINGSORT|NORM_IGNOREKANATYPE|NORM_IGNOREWIDTH|LOCALE_USE_CP_ACP|0x10000000) ) + if (flags & ~(supported_flags|semistub_flags)) { SetLastError(ERROR_INVALID_FLAGS); return 0; } - /* this style is related to diacritics in Arabic, Japanese, and Hebrew */ - if (flags & 0x10000000) - WARN("Ignoring unknown flags 0x10000000\n"); + if (flags & semistub_flags) + FIXME("semi-stub behavor for flag(s) 0x%x\n", flags & semistub_flags); if (len1 < 0) len1 = strlenW(str1); if (len2 < 0) len2 = strlenW(str2); diff -Nru wine1.7-1.7.14/dlls/kernel32/process.c wine1.7-1.7.18/dlls/kernel32/process.c --- wine1.7-1.7.14/dlls/kernel32/process.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/kernel32/process.c 2014-05-02 18:15:48.000000000 +0000 @@ -2768,7 +2768,7 @@ PEB * const peb = NtCurrentTeb()->Peb; RtlAcquirePebLock(); - index = RtlFindClearBitsAndSet( peb->TlsBitmap, 1, 0 ); + index = RtlFindClearBitsAndSet( peb->TlsBitmap, 1, 1 ); if (index != ~0U) NtCurrentTeb()->TlsSlots[index] = 0; /* clear the value */ else { @@ -3911,9 +3911,9 @@ */ BOOL WINAPI GetNumaHighestNodeNumber(PULONG highestnode) { - FIXME("(%p): stub\n", highestnode); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + *highestnode = 0; + FIXME("(%p): semi-stub\n", highestnode); + return TRUE; } /********************************************************************** diff -Nru wine1.7-1.7.14/dlls/kernel32/sync.c wine1.7-1.7.18/dlls/kernel32/sync.c --- wine1.7-1.7.14/dlls/kernel32/sync.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/kernel32/sync.c 2014-05-02 18:15:48.000000000 +0000 @@ -1177,6 +1177,20 @@ return TRUE; } +/*********************************************************************** + * SetWaitableTimerEx (KERNEL32.@) + */ +BOOL WINAPI SetWaitableTimerEx( HANDLE handle, const LARGE_INTEGER *when, LONG period, + PTIMERAPCROUTINE callback, LPVOID arg, REASON_CONTEXT *context, ULONG tolerabledelay ) +{ + static int once; + if (!once++) + { + FIXME("(%p, %p, %d, %p, %p, %p, %d) semi-stub\n", + handle, when, period, callback, arg, context, tolerabledelay); + } + return SetWaitableTimer(handle, when, period, callback, arg, FALSE); +} /*********************************************************************** * CancelWaitableTimer (KERNEL32.@) diff -Nru wine1.7-1.7.14/dlls/kernel32/tests/alloc.c wine1.7-1.7.18/dlls/kernel32/tests/alloc.c --- wine1.7-1.7.14/dlls/kernel32/tests/alloc.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/kernel32/tests/alloc.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,403 +0,0 @@ -/* - * Unit test suite for memory allocation functions. - * - * Copyright 2002 Geoffrey Hausheer - * - * 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 "wine/test.h" -#include "windef.h" -#include "winbase.h" -#include "winerror.h" - - - /* The following functions don't have tests, because either I don't know how - to test them, or they are WinNT only, or require multiple threads. - Since the last two issues shouldn't really stop the tests from being - written, assume for now that it is all due to the first case - HeapCompact - HeapLock - HeapQueryInformation - HeapSetInformation - HeapUnlock - HeapValidate - HeapWalk -*/ -/* In addition, these features aren't being tested - HEAP_NO_SERIALIZE - HEAP_GENERATE_EXCEPTIONS - STATUS_ACCESS_VIOLATION (error code from HeapAlloc) -*/ - -static void test_Heap(void) -{ - SYSTEM_INFO sysInfo; - ULONG memchunk; - HANDLE heap; - LPVOID mem1,mem1a,mem3; - UCHAR *mem2,*mem2a; - UINT i; - BOOL error; - DWORD dwSize; - -/* Retrieve the page size for this system */ - sysInfo.dwPageSize=0; - GetSystemInfo(&sysInfo); - ok(sysInfo.dwPageSize>0,"GetSystemInfo should return a valid page size\n"); - -/* Create a Heap with a minimum and maximum size */ -/* Note that Windows and Wine seem to behave a bit differently with respect - to memory allocation. In Windows, you can't access all the memory - specified in the heap (due to overhead), so choosing a reasonable maximum - size for the heap was done mostly by trial-and-error on Win2k. It may need - more tweaking for otherWindows variants. -*/ - memchunk=10*sysInfo.dwPageSize; - heap=HeapCreate(0,2*memchunk,5*memchunk); - -/* Check that HeapCreate allocated the right amount of ram */ - mem1=HeapAlloc(heap,0,5*memchunk+1); - ok(mem1==NULL,"HeapCreate allocated more Ram than it should have\n"); - HeapFree(heap,0,mem1); - -/* Check that a normal alloc works */ - mem1=HeapAlloc(heap,0,memchunk); - ok(mem1!=NULL,"HeapAlloc failed\n"); - if(mem1) { - ok(HeapSize(heap,0,mem1)>=memchunk, "HeapAlloc should return a big enough memory block\n"); - } - -/* Check that a 'zeroing' alloc works */ - mem2=HeapAlloc(heap,HEAP_ZERO_MEMORY,memchunk); - ok(mem2!=NULL,"HeapAlloc failed\n"); - if(mem2) { - ok(HeapSize(heap,0,mem2)>=memchunk,"HeapAlloc should return a big enough memory block\n"); - error=FALSE; - for(i=0;i=memchunk+5*sysInfo.dwPageSize,"HeapReAlloc failed\n"); - error=FALSE; - for(i=0;i<5*sysInfo.dwPageSize;i++) { - if(mem2a[memchunk+i]!=0) { - error=TRUE; - } - } - ok(!error,"HeapReAlloc should have zeroed out its allocated memory\n"); - } - -/* Check that HeapRealloc honours HEAP_REALLOC_IN_PLACE_ONLY */ - error=FALSE; - mem1a=HeapReAlloc(heap,HEAP_REALLOC_IN_PLACE_ONLY,mem1,memchunk+sysInfo.dwPageSize); - if(mem1a!=NULL) { - if(mem1a!=mem1) { - error=TRUE; - } - } - ok(mem1a==NULL || !error,"HeapReAlloc didn't honour HEAP_REALLOC_IN_PLACE_ONLY\n"); - -/* Check that HeapFree works correctly */ - if(mem1a) { - ok(HeapFree(heap,0,mem1a),"HeapFree failed\n"); - } else { - ok(HeapFree(heap,0,mem1),"HeapFree failed\n"); - } - if(mem2a) { - ok(HeapFree(heap,0,mem2a),"HeapFree failed\n"); - } else { - ok(HeapFree(heap,0,mem2),"HeapFree failed\n"); - } - - /* 0-length buffer */ - mem1 = HeapAlloc(heap, 0, 0); - ok(mem1 != NULL, "Reserved memory\n"); - - dwSize = HeapSize(heap, 0, mem1); - /* should work with 0-length buffer */ - ok(dwSize < 0xFFFFFFFF, "The size of the 0-length buffer\n"); - ok(HeapFree(heap, 0, mem1), "Freed the 0-length buffer\n"); - -/* Check that HeapDestry works */ - ok(HeapDestroy(heap),"HeapDestroy failed\n"); -} - -/* The following functions don't have tests, because either I don't know how - to test them, or they are WinNT only, or require multiple threads. - Since the last two issues shouldn't really stop the tests from being - written, assume for now that it is all due to the first case - GlobalFlags - GlobalMemoryStatus - GlobalMemoryStatusEx -*/ -/* In addition, these features aren't being tested - GMEM_DISCARDABLE - GMEM_NOCOMPACT -*/ -static void test_Global(void) -{ - ULONG memchunk; - HGLOBAL mem1,mem2,mem2a,mem2b; - UCHAR *mem2ptr; - UINT i; - BOOL error; - memchunk=100000; - - SetLastError(NO_ERROR); -/* Check that a normal alloc works */ - mem1=GlobalAlloc(0,memchunk); - ok(mem1!=NULL,"GlobalAlloc failed\n"); - if(mem1) { - ok(GlobalSize(mem1)>=memchunk, "GlobalAlloc should return a big enough memory block\n"); - } - -/* Check that a 'zeroing' alloc works */ - mem2=GlobalAlloc(GMEM_ZEROINIT,memchunk); - ok(mem2!=NULL,"GlobalAlloc failed: error=%d\n",GetLastError()); - if(mem2) { - ok(GlobalSize(mem2)>=memchunk,"GlobalAlloc should return a big enough memory block\n"); - mem2ptr=GlobalLock(mem2); - ok(mem2ptr==mem2,"GlobalLock should have returned the same memory as was allocated\n"); - if(mem2ptr) { - error=FALSE; - for(i=0;i=2*memchunk,"GlobalReAlloc failed\n"); - mem2ptr=GlobalLock(mem2a); - ok(mem2ptr!=NULL,"GlobalLock Failed\n"); - if(mem2ptr) { - error=FALSE; - for(i=0;i=memchunk, "LocalAlloc should return a big enough memory block\n"); - } - -/* Check that a 'zeroing' and lock alloc works */ - mem2=LocalAlloc(LMEM_ZEROINIT|LMEM_MOVEABLE,memchunk); - ok(mem2!=NULL,"LocalAlloc failed: error=%d\n",GetLastError()); - if(mem2) { - ok(LocalSize(mem2)>=memchunk,"LocalAlloc should return a big enough memory block\n"); - mem2ptr=LocalLock(mem2); - ok(mem2ptr!=NULL,"LocalLock: error=%d\n",GetLastError()); - if(mem2ptr) { - error=FALSE; - for(i=0;i=2*memchunk,"LocalReAlloc failed\n"); - mem2ptr=LocalLock(mem2a); - ok(mem2ptr!=NULL,"LocalLock Failed\n"); - if(mem2ptr) { - error=FALSE; - for(i=0;i0,"GetSystemInfo should return a valid page size\n"); - -/* Choose a reasonable allocation size */ - memchunk=10*sysInfo.dwPageSize; - -/* Check that a normal alloc works */ - mem1=VirtualAlloc(NULL,memchunk,MEM_COMMIT,PAGE_READWRITE); - ok(mem1!=NULL,"VirtualAlloc failed\n"); - if(mem1) { -/* check that memory is initialized to 0 */ - error=FALSE; - for(i=0;i0,"GetSystemInfo should return a valid page size\n"); + + /* Create a Heap with a minimum and maximum size */ + /* Note that Windows and Wine seem to behave a bit differently with respect + to memory allocation. In Windows, you can't access all the memory + specified in the heap (due to overhead), so choosing a reasonable maximum + size for the heap was done mostly by trial-and-error on Win2k. It may need + more tweaking for otherWindows variants. + */ + memchunk=10*sysInfo.dwPageSize; + heap=HeapCreate(0,2*memchunk,5*memchunk); + ok( !((ULONG_PTR)heap & 0xffff), "heap %p not 64K aligned\n", heap ); + + /* Check that HeapCreate allocated the right amount of ram */ + mem1=HeapAlloc(heap,0,5*memchunk+1); + ok(mem1==NULL,"HeapCreate allocated more Ram than it should have\n"); + HeapFree(heap,0,mem1); + + /* Check that a normal alloc works */ + mem1=HeapAlloc(heap,0,memchunk); + ok(mem1!=NULL,"HeapAlloc failed\n"); + if(mem1) { + ok(HeapSize(heap,0,mem1)>=memchunk, "HeapAlloc should return a big enough memory block\n"); + } + + /* Check that a 'zeroing' alloc works */ + mem2=HeapAlloc(heap,HEAP_ZERO_MEMORY,memchunk); + ok(mem2!=NULL,"HeapAlloc failed\n"); + if(mem2) { + ok(HeapSize(heap,0,mem2)>=memchunk,"HeapAlloc should return a big enough memory block\n"); + error=FALSE; + for(i=0;i=memchunk+5*sysInfo.dwPageSize,"HeapReAlloc failed\n"); + error=FALSE; + for(i=0;i<5*sysInfo.dwPageSize;i++) { + if(mem2a[memchunk+i]!=0) { + error=TRUE; + } + } + ok(!error,"HeapReAlloc should have zeroed out its allocated memory\n"); + } + + /* Check that HeapRealloc honours HEAP_REALLOC_IN_PLACE_ONLY */ + error=FALSE; + mem1a=HeapReAlloc(heap,HEAP_REALLOC_IN_PLACE_ONLY,mem1,memchunk+sysInfo.dwPageSize); + if(mem1a!=NULL) { + if(mem1a!=mem1) { + error=TRUE; + } + } + ok(mem1a==NULL || !error,"HeapReAlloc didn't honour HEAP_REALLOC_IN_PLACE_ONLY\n"); + + /* Check that HeapFree works correctly */ + if(mem1a) { + ok(HeapFree(heap,0,mem1a),"HeapFree failed\n"); + } else { + ok(HeapFree(heap,0,mem1),"HeapFree failed\n"); + } + if(mem2a) { + ok(HeapFree(heap,0,mem2a),"HeapFree failed\n"); + } else { + ok(HeapFree(heap,0,mem2),"HeapFree failed\n"); + } + + /* 0-length buffer */ + mem1 = HeapAlloc(heap, 0, 0); + ok(mem1 != NULL, "Reserved memory\n"); + + dwSize = HeapSize(heap, 0, mem1); + /* should work with 0-length buffer */ + ok(dwSize < 0xFFFFFFFF, "The size of the 0-length buffer\n"); + ok(HeapFree(heap, 0, mem1), "Freed the 0-length buffer\n"); + + /* Check that HeapDestroy works */ + ok(HeapDestroy(heap),"HeapDestroy failed\n"); +} + + +static void test_GlobalAlloc(void) +{ + ULONG memchunk; + HGLOBAL mem1,mem2,mem2a,mem2b; + UCHAR *mem2ptr; + UINT i; + BOOL error; + memchunk=100000; + + SetLastError(NO_ERROR); + /* Check that a normal alloc works */ + mem1=GlobalAlloc(0,memchunk); + ok(mem1!=NULL,"GlobalAlloc failed\n"); + if(mem1) { + ok(GlobalSize(mem1)>=memchunk, "GlobalAlloc should return a big enough memory block\n"); + } + + /* Check that a 'zeroing' alloc works */ + mem2=GlobalAlloc(GMEM_ZEROINIT,memchunk); + ok(mem2!=NULL,"GlobalAlloc failed: error=%d\n",GetLastError()); + if(mem2) { + ok(GlobalSize(mem2)>=memchunk,"GlobalAlloc should return a big enough memory block\n"); + mem2ptr=GlobalLock(mem2); + ok(mem2ptr==mem2,"GlobalLock should have returned the same memory as was allocated\n"); + if(mem2ptr) { + error=FALSE; + for(i=0;i=2*memchunk,"GlobalReAlloc failed\n"); + mem2ptr=GlobalLock(mem2a); + ok(mem2ptr!=NULL,"GlobalLock Failed\n"); + if(mem2ptr) { + error=FALSE; + for(i=0;i=memchunk, "LocalAlloc should return a big enough memory block\n"); + } + + /* Check that a 'zeroing' and lock alloc works */ + mem2=LocalAlloc(LMEM_ZEROINIT|LMEM_MOVEABLE,memchunk); + ok(mem2!=NULL,"LocalAlloc failed: error=%d\n",GetLastError()); + if(mem2) { + ok(LocalSize(mem2)>=memchunk,"LocalAlloc should return a big enough memory block\n"); + mem2ptr=LocalLock(mem2); + ok(mem2ptr!=NULL,"LocalLock: error=%d\n",GetLastError()); + if(mem2ptr) { + error=FALSE; + for(i=0;i=2*memchunk,"LocalReAlloc failed\n"); + mem2ptr=LocalLock(mem2a); + ok(mem2ptr!=NULL,"LocalLock Failed\n"); + if(mem2ptr) { + error=FALSE; + for(i=0;iflags & HEAP_GROWABLE) || heap->pattern == 0xffeeffee) /* vista layout */ { - ok( heap->flags == 0, "%s: got heap flags %08x expected 0\n", arg, heap->flags ); + ok( (heap->flags & ~HEAP_GROWABLE) == 0, "%s: got heap flags %08x\n", arg, heap->flags ); } else if (heap->pattern == 0xeeeeeeee && heap->flags == 0xeeeeeeee) { @@ -888,6 +1161,9 @@ test_heap(); test_obsolete_flags(); + test_HeapCreate(); + test_GlobalAlloc(); + test_LocalAlloc(); /* Test both short and very long blocks */ test_sized_HeapAlloc(1); diff -Nru wine1.7-1.7.14/dlls/kernel32/tests/locale.c wine1.7-1.7.18/dlls/kernel32/tests/locale.c --- wine1.7-1.7.14/dlls/kernel32/tests/locale.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/kernel32/tests/locale.c 2014-05-02 18:15:48.000000000 +0000 @@ -88,6 +88,8 @@ static INT (WINAPI *pGetLocaleInfoEx)(LPCWSTR, LCTYPE, LPWSTR, INT); static BOOL (WINAPI *pIsValidLocaleName)(LPCWSTR); static INT (WINAPI *pCompareStringOrdinal)(const WCHAR *, INT, const WCHAR *, INT, BOOL); +static INT (WINAPI *pCompareStringEx)(LPCWSTR, DWORD, LPCWSTR, INT, LPCWSTR, INT, + LPNLSVERSIONINFO, LPVOID, LPARAM); static void InitFunctionPointers(void) { @@ -108,6 +110,7 @@ pGetLocaleInfoEx = (void*)GetProcAddress(hKernel32, "GetLocaleInfoEx"); pIsValidLocaleName = (void*)GetProcAddress(hKernel32, "IsValidLocaleName"); pCompareStringOrdinal = (void*)GetProcAddress(hKernel32, "CompareStringOrdinal"); + pCompareStringEx = (void*)GetProcAddress(hKernel32, "CompareStringEx"); } #define eq(received, expected, label, type) \ @@ -1472,6 +1475,202 @@ "ret %d, error %d, expected value %d\n", ret, GetLastError(), CSTR_EQUAL); } +struct comparestringex_test { + const char *locale; + DWORD flags; + const WCHAR first[2]; + const WCHAR second[2]; + INT ret; + INT broken; + BOOL todo; +}; + +static const struct comparestringex_test comparestringex_tests[] = { + /* default behavior */ + { /* 0 */ + "tr-TR", 0, + {'i',0}, {'I',0}, CSTR_LESS_THAN, -1, FALSE + }, + { /* 1 */ + "tr-TR", 0, + {'i',0}, {0x130,0}, CSTR_LESS_THAN, -1, FALSE + }, + { /* 2 */ + "tr-TR", 0, + {'i',0}, {0x131,0}, CSTR_LESS_THAN, -1, FALSE + }, + { /* 3 */ + "tr-TR", 0, + {'I',0}, {0x130,0}, CSTR_LESS_THAN, -1, TRUE + }, + { /* 4 */ + "tr-TR", 0, + {'I',0}, {0x131,0}, CSTR_LESS_THAN, -1, FALSE + }, + { /* 5 */ + "tr-TR", 0, + {0x130,0}, {0x131,0}, CSTR_GREATER_THAN, -1, TRUE + }, + /* with NORM_IGNORECASE */ + { /* 6 */ + "tr-TR", NORM_IGNORECASE, + {'i',0}, {'I',0}, CSTR_EQUAL, -1, FALSE + }, + { /* 7 */ + "tr-TR", NORM_IGNORECASE, + {'i',0}, {0x130,0}, CSTR_LESS_THAN, -1, TRUE + }, + { /* 8 */ + "tr-TR", NORM_IGNORECASE, + {'i',0}, {0x131,0}, CSTR_LESS_THAN, -1, FALSE + }, + { /* 9 */ + "tr-TR", NORM_IGNORECASE, + {'I',0}, {0x130,0}, CSTR_LESS_THAN, -1, TRUE + }, + { /* 10 */ + "tr-TR", NORM_IGNORECASE, + {'I',0}, {0x131,0}, CSTR_LESS_THAN, -1, FALSE + }, + { /* 11 */ + "tr-TR", NORM_IGNORECASE, + {0x130,0}, {0x131,0}, CSTR_GREATER_THAN, -1, TRUE + }, + /* with NORM_LINGUISTIC_CASING */ + { /* 12 */ + "tr-TR", NORM_LINGUISTIC_CASING, + {'i',0}, {'I',0}, CSTR_GREATER_THAN, CSTR_LESS_THAN, TRUE + }, + { /* 13 */ + "tr-TR", NORM_LINGUISTIC_CASING, + {'i',0}, {0x130,0}, CSTR_LESS_THAN, -1, FALSE + }, + { /* 14 */ + "tr-TR", NORM_LINGUISTIC_CASING, + {'i',0}, {0x131,0}, CSTR_GREATER_THAN, CSTR_LESS_THAN, TRUE + }, + { /* 15 */ + "tr-TR", NORM_LINGUISTIC_CASING, + {'I',0}, {0x130,0}, CSTR_LESS_THAN, -1, TRUE + }, + { /* 16 */ + "tr-TR", NORM_LINGUISTIC_CASING, + {'I',0}, {0x131,0}, CSTR_GREATER_THAN, CSTR_LESS_THAN, TRUE + }, + { /* 17 */ + "tr-TR", NORM_LINGUISTIC_CASING, + {0x130,0}, {0x131,0}, CSTR_GREATER_THAN, -1, TRUE + }, + /* with LINGUISTIC_IGNORECASE */ + { /* 18 */ + "tr-TR", LINGUISTIC_IGNORECASE, + {'i',0}, {'I',0}, CSTR_EQUAL, -1, TRUE + }, + { /* 19 */ + "tr-TR", LINGUISTIC_IGNORECASE, + {'i',0}, {0x130,0}, CSTR_LESS_THAN, -1, FALSE + }, + { /* 20 */ + "tr-TR", LINGUISTIC_IGNORECASE, + {'i',0}, {0x131,0}, CSTR_LESS_THAN, -1, FALSE + }, + { /* 21 */ + "tr-TR", LINGUISTIC_IGNORECASE, + {'I',0}, {0x130,0}, CSTR_LESS_THAN, -1, TRUE + }, + { /* 22 */ + "tr-TR", LINGUISTIC_IGNORECASE, + {'I',0}, {0x131,0}, CSTR_LESS_THAN, -1, FALSE + }, + { /* 23 */ + "tr-TR", LINGUISTIC_IGNORECASE, + {0x130,0}, {0x131,0}, CSTR_GREATER_THAN, -1, TRUE + }, + /* with NORM_LINGUISTIC_CASING | NORM_IGNORECASE */ + { /* 24 */ + "tr-TR", NORM_LINGUISTIC_CASING | NORM_IGNORECASE, + {'i',0}, {'I',0}, CSTR_GREATER_THAN, CSTR_EQUAL, TRUE + }, + { /* 25 */ + "tr-TR", NORM_LINGUISTIC_CASING | NORM_IGNORECASE, + {'i',0}, {0x130,0}, CSTR_EQUAL, CSTR_LESS_THAN, FALSE + }, + { /* 26 */ + "tr-TR", NORM_LINGUISTIC_CASING | NORM_IGNORECASE, + {'i',0}, {0x131,0}, CSTR_GREATER_THAN, CSTR_LESS_THAN, TRUE + }, + { /* 27 */ + "tr-TR", NORM_LINGUISTIC_CASING | NORM_IGNORECASE, + {'I',0}, {0x130,0}, CSTR_LESS_THAN, -1, TRUE + }, + { /* 28 */ + "tr-TR", NORM_LINGUISTIC_CASING | NORM_IGNORECASE, + {'I',0}, {0x131,0}, CSTR_EQUAL, CSTR_LESS_THAN, TRUE + }, + { /* 29 */ + "tr-TR", NORM_LINGUISTIC_CASING | NORM_IGNORECASE, + {0x130,0}, {0x131,0}, CSTR_GREATER_THAN, -1, TRUE + }, + /* with NORM_LINGUISTIC_CASING | LINGUISTIC_IGNORECASE */ + { /* 30 */ + "tr-TR", NORM_LINGUISTIC_CASING | LINGUISTIC_IGNORECASE, + {'i',0}, {'I',0}, CSTR_GREATER_THAN, CSTR_EQUAL, TRUE + }, + { /* 31 */ + "tr-TR", NORM_LINGUISTIC_CASING | LINGUISTIC_IGNORECASE, + {'i',0}, {0x130,0}, CSTR_EQUAL, CSTR_LESS_THAN, TRUE + }, + { /* 32 */ + "tr-TR", NORM_LINGUISTIC_CASING | LINGUISTIC_IGNORECASE, + {'i',0}, {0x131,0}, CSTR_GREATER_THAN, CSTR_LESS_THAN, TRUE + }, + { /* 33 */ + "tr-TR", NORM_LINGUISTIC_CASING | LINGUISTIC_IGNORECASE, + {'I',0}, {0x130,0}, CSTR_LESS_THAN, -1, TRUE + }, + { /* 34 */ + "tr-TR", NORM_LINGUISTIC_CASING | LINGUISTIC_IGNORECASE, + {'I',0}, {0x131,0}, CSTR_EQUAL, CSTR_LESS_THAN, TRUE + }, + { /* 35 */ + "tr-TR", NORM_LINGUISTIC_CASING | LINGUISTIC_IGNORECASE, + {0x130,0}, {0x131,0}, CSTR_GREATER_THAN, CSTR_LESS_THAN, TRUE + } +}; + +static void test_CompareStringEx(void) +{ + const char *op[] = {"ERROR", "CSTR_LESS_THAN", "CSTR_EQUAL", "CSTR_GREATER_THAN"}; + WCHAR locale[6]; + INT ret, i; + + /* CompareStringEx is only available on Vista+ */ + if (!pCompareStringEx) + { + win_skip("CompareStringEx not supported\n"); + return; + } + + for (i = 0; i < sizeof(comparestringex_tests)/sizeof(comparestringex_tests[0]); i++) + { + const struct comparestringex_test *e = &comparestringex_tests[i]; + + MultiByteToWideChar(CP_ACP, 0, e->locale, -1, locale, sizeof(locale)/sizeof(WCHAR)); + ret = pCompareStringEx(locale, e->flags, e->first, -1, e->second, -1, NULL, NULL, 0); + if (e->todo) + { + todo_wine ok(ret == e->ret || broken(ret == e->broken), + "%d: got %s, expected %s\n", i, op[ret], op[e->ret]); + } + else + { + ok(ret == e->ret || broken(ret == e->broken), + "%d: got %s, expected %s\n", i, op[ret], op[e->ret]); + } + } + +} + static void test_LCMapStringA(void) { int ret, ret2; @@ -3642,6 +3841,7 @@ test_GetCurrencyFormatA(); /* Also tests the W version */ test_GetNumberFormatA(); /* Also tests the W version */ test_CompareStringA(); + test_CompareStringEx(); test_LCMapStringA(); test_LCMapStringW(); test_LCMapStringEx(); diff -Nru wine1.7-1.7.14/dlls/kernel32/tests/Makefile.in wine1.7-1.7.18/dlls/kernel32/tests/Makefile.in --- wine1.7-1.7.14/dlls/kernel32/tests/Makefile.in 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/kernel32/tests/Makefile.in 2014-05-02 18:15:48.000000000 +0000 @@ -3,7 +3,6 @@ C_SRCS = \ actctx.c \ - alloc.c \ atom.c \ change.c \ codepage.c \ diff -Nru wine1.7-1.7.14/dlls/kernel32/tests/sync.c wine1.7-1.7.18/dlls/kernel32/tests/sync.c --- wine1.7-1.7.14/dlls/kernel32/tests/sync.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/kernel32/tests/sync.c 2014-05-02 18:15:48.000000000 +0000 @@ -2117,7 +2117,7 @@ { /* seq 15 */ while (srwlock_seq < 15) Sleep(1); - Sleep(50); /* some delay, such that thread2 can try to acquire a second exclusive lock */ + Sleep(50); /* some delay, so that thread2 can try to acquire a second exclusive lock */ if (InterlockedIncrement(&srwlock_seq) != 16) InterlockedIncrement(&srwlock_base_errors.wrong_execution_order); diff -Nru wine1.7-1.7.14/dlls/kernel32/tests/thread.c wine1.7-1.7.18/dlls/kernel32/tests/thread.c --- wine1.7-1.7.14/dlls/kernel32/tests/thread.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/kernel32/tests/thread.c 2014-05-02 18:15:48.000000000 +0000 @@ -1638,6 +1638,43 @@ todo_wine ok (pool != NULL, "CreateThreadpool failed\n"); } +static void test_reserved_tls(void) +{ + void *val; + DWORD tls; + BOOL ret; + + /* This seems to be a WinXP SP2+ feature. */ + if(!pIsWow64Process) { + win_skip("Skipping reserved TLS slot on too old Windows.\n"); + return; + } + + val = TlsGetValue(0); + ok(!val, "TlsGetValue(0) = %p\n", val); + + /* Also make sure that there is a TLS allocated. */ + tls = TlsAlloc(); + ok(tls && tls != TLS_OUT_OF_INDEXES, "tls = %x\n", tls); + TlsSetValue(tls, (void*)1); + + val = TlsGetValue(0); + ok(!val, "TlsGetValue(0) = %p\n", val); + + TlsFree(tls); + + /* The following is too ugly to be run by default */ + if(0) { + /* Set TLS index 0 value and see that this works and doesn't cause problems + * for remaining tests. */ + ret = TlsSetValue(0, (void*)1); + ok(ret, "TlsSetValue(0, 1) failed: %u\n", GetLastError()); + + val = TlsGetValue(0); + ok(val == (void*)1, "TlsGetValue(0) = %p\n", val); + } +} + static void init_funcs(void) { HMODULE hKernel32 = GetModuleHandleA("kernel32.dll"); @@ -1711,6 +1748,7 @@ return; } + test_reserved_tls(); test_CreateRemoteThread(); test_CreateThread_basic(); test_CreateThread_suspended(); diff -Nru wine1.7-1.7.14/dlls/kernel32/tests/toolhelp.c wine1.7-1.7.18/dlls/kernel32/tests/toolhelp.c --- wine1.7-1.7.14/dlls/kernel32/tests/toolhelp.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/kernel32/tests/toolhelp.c 2014-05-02 18:15:48.000000000 +0000 @@ -204,17 +204,19 @@ static const char* curr_expected_modules[] = { - "kernel32_test.exe" + "kernel32_test.exe", "kernel32.dll", - "ntdll.dll", + "ntdll.dll" }; + static const char* sub_expected_modules[] = { "kernel32_test.exe", "kernel32.dll", "shell32.dll", - "ntdll.dll", + "ntdll.dll" }; + #define NUM_OF(x) (sizeof(x) / sizeof(x[0])) static void test_module(DWORD pid, const char* expected[], unsigned num_expected) diff -Nru wine1.7-1.7.14/dlls/kernel32/time.c wine1.7-1.7.18/dlls/kernel32/time.c --- wine1.7-1.7.14/dlls/kernel32/time.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/kernel32/time.c 2014-05-02 18:15:48.000000000 +0000 @@ -1103,3 +1103,14 @@ SetLastError(ERROR_CALL_NOT_IMPLEMENTED); return TIME_ZONE_ID_INVALID; } + +/*********************************************************************** + * QueryUnbiasedInterruptTime (KERNEL32.@) + */ +BOOL WINAPI QueryUnbiasedInterruptTime(ULONGLONG *time) +{ + TRACE("(%p)\n", time); + if (!time) return FALSE; + RtlQueryUnbiasedInterruptTime(time); + return TRUE; +} diff -Nru wine1.7-1.7.14/dlls/kernel32/wer.c wine1.7-1.7.18/dlls/kernel32/wer.c --- wine1.7-1.7.14/dlls/kernel32/wer.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/kernel32/wer.c 2014-05-02 18:15:48.000000000 +0000 @@ -64,8 +64,20 @@ return E_NOTIMPL; } +/*********************************************************************** + * WerRegisterMemoryBlock (KERNEL32.@) + */ HRESULT WINAPI WerRegisterMemoryBlock(void *block, DWORD size) { FIXME("(%p %d) stub\n", block, size); return E_NOTIMPL; } + +/*********************************************************************** + * WerUnregisterMemoryBlock (KERNEL32.@) + */ +HRESULT WINAPI WerUnregisterMemoryBlock(void *block) +{ + FIXME("(%p) stub\n", block); + return E_NOTIMPL; +} diff -Nru wine1.7-1.7.14/dlls/krnl386.exe16/int21.c wine1.7-1.7.18/dlls/krnl386.exe16/int21.c --- wine1.7-1.7.14/dlls/krnl386.exe16/int21.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/krnl386.exe16/int21.c 2014-05-02 18:15:48.000000000 +0000 @@ -2737,7 +2737,7 @@ static void INT21_Ioctl_Char( CONTEXT *context ) { int status; - int IsConsoleIOHandle = 0; + BOOL IsConsoleIOHandle = FALSE; IO_STATUS_BLOCK io; FILE_INTERNAL_INFORMATION info; HANDLE handle = DosFileHandleToWin32Handle(BX_reg(context)); @@ -2746,7 +2746,7 @@ if (status) { if( VerifyConsoleIoHandle( handle)) - IsConsoleIOHandle = 1; + IsConsoleIOHandle = TRUE; else { SET_AX( context, RtlNtStatusToDosError(status) ); SET_CFLAG( context ); diff -Nru wine1.7-1.7.14/dlls/krnl386.exe16/int31.c wine1.7-1.7.18/dlls/krnl386.exe16/int31.c --- wine1.7-1.7.14/dlls/krnl386.exe16/int31.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/krnl386.exe16/int31.c 2014-05-02 18:15:48.000000000 +0000 @@ -439,7 +439,7 @@ LPWORD stack16; LPVOID addr = NULL; /* avoid gcc warning */ RMCB *CurrRMCB; - int alloc = 0, already = 0; + BOOL alloc = FALSE, already = FALSE; BYTE *code; TRACE("EAX=%08x EBX=%08x ECX=%08x EDX=%08x\n", @@ -490,7 +490,7 @@ } if (!already) { if (!context->SegSs) { - alloc = 1; /* allocate default stack */ + alloc = TRUE; /* allocate default stack */ stack16 = addr = DOSMEM_AllocBlock( 64, (UINT16 *)&(context->SegSs) ); context->Esp = 64-2; stack16 += 32-1; @@ -514,7 +514,7 @@ *(--stack16) = 0; /* adjust stack */ context->Esp -= 2*sizeof(WORD); - already = 1; + already = TRUE; } if (CurrRMCB) { diff -Nru wine1.7-1.7.14/dlls/krnl386.exe16/soundblaster.c wine1.7-1.7.18/dlls/krnl386.exe16/soundblaster.c --- wine1.7-1.7.14/dlls/krnl386.exe16/soundblaster.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/krnl386.exe16/soundblaster.c 2014-05-02 18:15:48.000000000 +0000 @@ -48,8 +48,8 @@ static BYTE DSP_OutBuffer[10]; /* Store DSP information bytes to host */ static int OutSize; /* Nb of bytes in InBuffer */ static int command; /* Current command */ -static int end_sound_loop = 0; -static int dma_enable = 0; +static BOOL end_sound_loop = FALSE; +static BOOL dma_enable = FALSE; /* The maximum size of a dma transfer can be 65536 */ #define DMATRFSIZE 1024 @@ -112,7 +112,7 @@ SamplesCount -= size; if (!SamplesCount) { DOSVM_QueueEvent(SB_IRQ,SB_IRQ_PRI,NULL,NULL); - dma_enable = 0; + dma_enable = FALSE; } } return 0; @@ -166,7 +166,7 @@ } buf_off = 0; - end_sound_loop = 0; + end_sound_loop = FALSE; SB_Thread = CreateThread(NULL, 0, SB_Poll, NULL, 0, NULL); TRACE("thread\n"); if (!SB_Thread) { @@ -254,7 +254,7 @@ case 0x14: /* SB */ SamplesCount = DSP_InBuffer[1]+(val<<8)+1; TRACE("DMA DAC (8-bit) for %x samples\n",SamplesCount); - dma_enable = 1; + dma_enable = TRUE; break; case 0x20: FIXME("Direct ADC (8-bit) - Not Implemented\n"); @@ -274,7 +274,7 @@ /* case 0xBX/0xCX -> See below */ case 0xD0: /* SB */ TRACE("Halt DMA operation (8-bit)\n"); - dma_enable = 0; + dma_enable = FALSE; break; case 0xD1: /* SB */ FIXME("Enable Speaker - Not Implemented\n"); @@ -331,7 +331,7 @@ FIXME("Generic DAC/ADC stereo mode not supported\n"); SamplesCount = DSP_InBuffer[2]+(val<<8)+1; TRACE("Generic DMA for %x samples\n",SamplesCount); - dma_enable = 1; + dma_enable = TRUE; } else FIXME("DSP command %x not supported\n",val); diff -Nru wine1.7-1.7.14/dlls/mgmtapi/mgmtapi.spec wine1.7-1.7.18/dlls/mgmtapi/mgmtapi.spec --- wine1.7-1.7.14/dlls/mgmtapi/mgmtapi.spec 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/mgmtapi/mgmtapi.spec 2014-05-02 18:15:48.000000000 +0000 @@ -4,6 +4,6 @@ @ stub SnmpMgrGetTrapEx @ stub SnmpMgrOidToStr @ stub SnmpMgrOpen -@ stub SnmpMgrrequest +@ stub SnmpMgrRequest @ stub SnmpMgrStrToOid @ stub SnmpMgrTrapListen diff -Nru wine1.7-1.7.14/dlls/mscms/tests/profile.c wine1.7-1.7.18/dlls/mscms/tests/profile.c --- wine1.7-1.7.14/dlls/mscms/tests/profile.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/mscms/tests/profile.c 2014-05-02 18:15:48.000000000 +0000 @@ -122,6 +122,8 @@ 'c','o','l','o','r','\\','s','r','g','b',' ','c','o','l','o','r',' ', 's','p','a','c','e',' ','p','r','o','f','i','l','e','.','i','c','m',0 }; +static BOOL have_color_profile; + static const unsigned char rgbheader[] = { 0x48, 0x0c, 0x00, 0x00, 0x6f, 0x6e, 0x69, 0x4c, 0x00, 0x00, 0x10, 0x02, 0x72, 0x74, 0x6e, 0x6d, 0x20, 0x42, 0x47, 0x52, 0x20, 0x5a, 0x59, 0x58, @@ -669,7 +671,7 @@ ok( !ret, "EnumColorProfilesA() succeeded (%d)\n", GetLastError() ); ret = pEnumColorProfilesA( NULL, &record, buffer, &size, &number ); - if (standardprofile) + if (have_color_profile) ok( ret, "EnumColorProfilesA() failed (%d)\n", GetLastError() ); else todo_wine ok( ret, "EnumColorProfilesA() failed (%d)\n", GetLastError() ); @@ -683,7 +685,7 @@ size = total; ret = pEnumColorProfilesA( NULL, &record, buffer, &size, &number ); - if (standardprofile) + if (have_color_profile) ok( ret, "EnumColorProfilesA() failed (%d)\n", GetLastError() ); else todo_wine ok( ret, "EnumColorProfilesA() failed (%d)\n", GetLastError() ); @@ -723,7 +725,7 @@ ok( !ret, "EnumColorProfilesW() succeeded (%d)\n", GetLastError() ); ret = pEnumColorProfilesW( NULL, &record, buffer, &size, &number ); - if (standardprofileW) + if (have_color_profile) ok( ret, "EnumColorProfilesW() failed (%d)\n", GetLastError() ); else todo_wine ok( ret, "EnumColorProfilesW() failed (%d)\n", GetLastError() ); @@ -736,7 +738,7 @@ size = total; ret = pEnumColorProfilesW( NULL, &record, buffer, &size, &number ); - if (standardprofileW) + if (have_color_profile) ok( ret, "EnumColorProfilesW() failed (%d)\n", GetLastError() ); else todo_wine ok( ret, "EnumColorProfilesW() failed (%d)\n", GetLastError() ); @@ -1317,6 +1319,21 @@ } } +static BOOL have_profile(void) +{ + char glob[MAX_PATH + sizeof("\\*.icm")]; + DWORD size = MAX_PATH; + HANDLE handle; + WIN32_FIND_DATAA data; + + if (!pGetColorDirectoryA( NULL, glob, &size )) return FALSE; + lstrcatA( glob, "\\*.icm" ); + handle = FindFirstFileA( glob, &data ); + if (handle == INVALID_HANDLE_VALUE) return FALSE; + FindClose( handle ); + return TRUE; +} + START_TEST(profile) { UINT len; @@ -1392,6 +1409,8 @@ } } + have_color_profile = have_profile(); + test_GetColorDirectoryA(); test_GetColorDirectoryW(); diff -Nru wine1.7-1.7.14/dlls/msctf/inputprocessor.c wine1.7-1.7.18/dlls/msctf/inputprocessor.c --- wine1.7-1.7.14/dlls/msctf/inputprocessor.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msctf/inputprocessor.c 2014-05-02 18:15:48.000000000 +0000 @@ -64,7 +64,7 @@ typedef struct tagInputProcessorProfiles { ITfInputProcessorProfiles ITfInputProcessorProfiles_iface; ITfSource ITfSource_iface; - /* const ITfInputProcessorProfileMgrVtbl *InputProcessorProfileMgrVtbl; */ + ITfInputProcessorProfileMgr ITfInputProcessorProfileMgr_iface; /* const ITfInputProcessorProfilesExVtbl *InputProcessorProfilesExVtbl; */ /* const ITfInputProcessorProfileSubstituteLayoutVtbl *InputProcessorProfileSubstituteLayoutVtbl; */ LONG refCount; @@ -171,28 +171,31 @@ RegCloseKey(key); } -static HRESULT WINAPI InputProcessorProfiles_QueryInterface(ITfInputProcessorProfiles *iface, REFIID iid, LPVOID *ppvOut) +static HRESULT WINAPI InputProcessorProfiles_QueryInterface(ITfInputProcessorProfiles *iface, REFIID iid, void **ppv) { InputProcessorProfiles *This = impl_from_ITfInputProcessorProfiles(iface); - *ppvOut = NULL; if (IsEqualIID(iid, &IID_IUnknown) || IsEqualIID(iid, &IID_ITfInputProcessorProfiles)) { - *ppvOut = &This->ITfInputProcessorProfiles_iface; + *ppv = &This->ITfInputProcessorProfiles_iface; + } + else if (IsEqualIID(iid, &IID_ITfInputProcessorProfileMgr)) + { + *ppv = &This->ITfInputProcessorProfileMgr_iface; } else if (IsEqualIID(iid, &IID_ITfSource)) { - *ppvOut = &This->ITfSource_iface; + *ppv = &This->ITfSource_iface; } - - if (*ppvOut) + else { - ITfInputProcessorProfiles_AddRef(iface); - return S_OK; + *ppv = NULL; + WARN("unsupported interface: %s\n", debugstr_guid(iid)); + return E_NOINTERFACE; } - WARN("unsupported interface: %s\n", debugstr_guid(iid)); - return E_NOINTERFACE; + ITfInputProcessorProfiles_AddRef(iface); + return S_OK; } static ULONG WINAPI InputProcessorProfiles_AddRef(ITfInputProcessorProfiles *iface) @@ -685,6 +688,114 @@ InputProcessorProfiles_SubstituteKeyboardLayout }; +static inline InputProcessorProfiles *impl_from_ITfInputProcessorProfileMgr(ITfInputProcessorProfileMgr *iface) +{ + return CONTAINING_RECORD(iface, InputProcessorProfiles, ITfInputProcessorProfileMgr_iface); +} + +static HRESULT WINAPI InputProcessorProfileMgr_QueryInterface(ITfInputProcessorProfileMgr *iface, REFIID riid, void **ppv) +{ + InputProcessorProfiles *This = impl_from_ITfInputProcessorProfileMgr(iface); + return ITfInputProcessorProfiles_QueryInterface(&This->ITfInputProcessorProfiles_iface, riid, ppv); +} + +static ULONG WINAPI InputProcessorProfileMgr_AddRef(ITfInputProcessorProfileMgr *iface) +{ + InputProcessorProfiles *This = impl_from_ITfInputProcessorProfileMgr(iface); + return ITfInputProcessorProfiles_AddRef(&This->ITfInputProcessorProfiles_iface); +} + +static ULONG WINAPI InputProcessorProfileMgr_Release(ITfInputProcessorProfileMgr *iface) +{ + InputProcessorProfiles *This = impl_from_ITfInputProcessorProfileMgr(iface); + return ITfInputProcessorProfiles_Release(&This->ITfInputProcessorProfiles_iface); +} + +static HRESULT WINAPI InputProcessorProfileMgr_ActivateProfile(ITfInputProcessorProfileMgr *iface, DWORD dwProfileType, + LANGID langid, REFCLSID clsid, REFGUID guidProfile, HKL hkl, DWORD dwFlags) +{ + InputProcessorProfiles *This = impl_from_ITfInputProcessorProfileMgr(iface); + FIXME("(%p)->(%d %x %s %s %p %x)\n", This, dwProfileType, langid, debugstr_guid(clsid), + debugstr_guid(guidProfile), hkl, dwFlags); + return E_NOTIMPL; +} + +static HRESULT WINAPI InputProcessorProfileMgr_DeactivateProfile(ITfInputProcessorProfileMgr *iface, DWORD dwProfileType, + LANGID langid, REFCLSID clsid, REFGUID guidProfile, HKL hkl, DWORD dwFlags) +{ + InputProcessorProfiles *This = impl_from_ITfInputProcessorProfileMgr(iface); + FIXME("(%p)->(%d %x %s %s %p %x)\n", This, dwProfileType, langid, debugstr_guid(clsid), + debugstr_guid(guidProfile), hkl, dwFlags); + return E_NOTIMPL; +} + +static HRESULT WINAPI InputProcessorProfileMgr_GetProfile(ITfInputProcessorProfileMgr *iface, DWORD dwProfileType, + LANGID langid, REFCLSID clsid, REFGUID guidProfile, HKL hkl, TF_INPUTPROCESSORPROFILE *pProfile) +{ + InputProcessorProfiles *This = impl_from_ITfInputProcessorProfileMgr(iface); + FIXME("(%p)->(%d %x %s %s %p %p)\n", This, dwProfileType, langid, debugstr_guid(clsid), + debugstr_guid(guidProfile), hkl, pProfile); + return E_NOTIMPL; +} + +static HRESULT WINAPI InputProcessorProfileMgr_EnumProfiles(ITfInputProcessorProfileMgr *iface, LANGID langid, + IEnumTfInputProcessorProfiles **ppEnum) +{ + InputProcessorProfiles *This = impl_from_ITfInputProcessorProfileMgr(iface); + FIXME("(%p)->(%x %p)\n", This, langid, ppEnum); + return E_NOTIMPL; +} + +static HRESULT WINAPI InputProcessorProfileMgr_ReleaseInputProcessor(ITfInputProcessorProfileMgr *iface, REFCLSID rclsid, + DWORD dwFlags) +{ + InputProcessorProfiles *This = impl_from_ITfInputProcessorProfileMgr(iface); + FIXME("(%p)->(%s %x)\n", This, debugstr_guid(rclsid), dwFlags); + return E_NOTIMPL; +} + +static HRESULT WINAPI InputProcessorProfileMgr_RegisterProfile(ITfInputProcessorProfileMgr *iface, REFCLSID rclsid, + LANGID langid, REFGUID guidProfile, const WCHAR *pchDesc, ULONG cchDesc, const WCHAR *pchIconFile, + ULONG cchFile, ULONG uIconIndex, HKL hklsubstitute, DWORD dwPreferredLayout, BOOL bEnabledByDefault, + DWORD dwFlags) +{ + InputProcessorProfiles *This = impl_from_ITfInputProcessorProfileMgr(iface); + FIXME("(%p)->(%s %x %s %s %d %s %u %u %p %x %x %x)\n", This, debugstr_guid(rclsid), langid, debugstr_guid(guidProfile), + debugstr_w(pchDesc), cchDesc, debugstr_w(pchIconFile), cchFile, uIconIndex, hklsubstitute, dwPreferredLayout, + bEnabledByDefault, dwFlags); + return E_NOTIMPL; +} + +static HRESULT WINAPI InputProcessorProfileMgr_UnregisterProfile(ITfInputProcessorProfileMgr *iface, REFCLSID rclsid, + LANGID langid, REFGUID guidProfile, DWORD dwFlags) +{ + InputProcessorProfiles *This = impl_from_ITfInputProcessorProfileMgr(iface); + FIXME("(%p)->(%s %x %s %x)\n", This, debugstr_guid(rclsid), langid, debugstr_guid(guidProfile), dwFlags); + return E_NOTIMPL; +} + +static HRESULT WINAPI InputProcessorProfileMgr_GetActiveProfile(ITfInputProcessorProfileMgr *iface, REFGUID catid, + TF_INPUTPROCESSORPROFILE *pProfile) +{ + InputProcessorProfiles *This = impl_from_ITfInputProcessorProfileMgr(iface); + FIXME("(%p)->(%s %p)\n", This, debugstr_guid(catid), pProfile); + return E_NOTIMPL; +} + +static const ITfInputProcessorProfileMgrVtbl InputProcessorProfileMgrVtbl = { + InputProcessorProfileMgr_QueryInterface, + InputProcessorProfileMgr_AddRef, + InputProcessorProfileMgr_Release, + InputProcessorProfileMgr_ActivateProfile, + InputProcessorProfileMgr_DeactivateProfile, + InputProcessorProfileMgr_GetProfile, + InputProcessorProfileMgr_EnumProfiles, + InputProcessorProfileMgr_ReleaseInputProcessor, + InputProcessorProfileMgr_RegisterProfile, + InputProcessorProfileMgr_UnregisterProfile, + InputProcessorProfileMgr_GetActiveProfile +}; + /***************************************************** * ITfSource functions *****************************************************/ @@ -782,6 +893,7 @@ This->ITfInputProcessorProfiles_iface.lpVtbl= &InputProcessorProfilesVtbl; This->ITfSource_iface.lpVtbl = &InputProcessorProfilesSourceVtbl; + This->ITfInputProcessorProfileMgr_iface.lpVtbl = &InputProcessorProfileMgrVtbl; This->refCount = 1; This->currentLanguage = GetUserDefaultLCID(); diff -Nru wine1.7-1.7.14/dlls/msctf/tests/inputprocessor.c wine1.7-1.7.18/dlls/msctf/tests/inputprocessor.c --- wine1.7-1.7.14/dlls/msctf/tests/inputprocessor.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msctf/tests/inputprocessor.c 2014-05-02 18:15:48.000000000 +0000 @@ -2186,6 +2186,18 @@ sink_check_ok(&test_OnPopContext,"OnPopContext"); } +static void test_QI(void) +{ + ITfInputProcessorProfileMgr *ipp_mgr; + HRESULT hres; + + /* A trivial test, probably worth moving once more will be added. */ + hres = ITfInputProcessorProfiles_QueryInterface(g_ipp, &IID_ITfInputProcessorProfileMgr, (void**)&ipp_mgr); + ok(hres == S_OK, "Could not get ITfInputProcessorProfileMgr iface: %08x\n", hres); + + ITfInputProcessorProfileMgr_Release(ipp_mgr); +} + START_TEST(inputprocessor) { if (SUCCEEDED(initialize())) @@ -2212,6 +2224,7 @@ test_ThreadMgrUnadviseSinks(); test_UnregisterCategory(); test_Unregister(); + test_QI(); } else skip("Unable to create InputProcessor\n"); diff -Nru wine1.7-1.7.14/dlls/mshtml/conpoint.c wine1.7-1.7.18/dlls/mshtml/conpoint.c --- wine1.7-1.7.14/dlls/mshtml/conpoint.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/mshtml/conpoint.c 2014-05-02 18:15:48.000000000 +0000 @@ -48,6 +48,120 @@ return debugstr_guid(riid); } +typedef struct { + IEnumConnections IEnumConnections_iface; + + LONG ref; + + unsigned iter; + ConnectionPoint *cp; +} EnumConnections; + +static inline EnumConnections *impl_from_IEnumConnections(IEnumConnections *iface) +{ + return CONTAINING_RECORD(iface, EnumConnections, IEnumConnections_iface); +} + +static HRESULT WINAPI EnumConnections_QueryInterface(IEnumConnections *iface, REFIID riid, void **ppv) +{ + EnumConnections *This = impl_from_IEnumConnections(iface); + + if(IsEqualGUID(riid, &IID_IUnknown)) { + TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv); + *ppv = &This->IEnumConnections_iface; + }else if(IsEqualGUID(riid, &IID_IEnumConnections)) { + TRACE("(%p)->(IID_IEnumConnections %p)\n", This, ppv); + *ppv = &This->IEnumConnections_iface; + }else { + WARN("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv); + *ppv = NULL; + return E_NOINTERFACE; + } + + IUnknown_AddRef((IUnknown*)*ppv); + return S_OK; +} + +static ULONG WINAPI EnumConnections_AddRef(IEnumConnections *iface) +{ + EnumConnections *This = impl_from_IEnumConnections(iface); + ULONG ref = InterlockedIncrement(&This->ref); + + TRACE("(%p) ref=%d\n", This, ref); + + return ref; +} + +static ULONG WINAPI EnumConnections_Release(IEnumConnections *iface) +{ + EnumConnections *This = impl_from_IEnumConnections(iface); + ULONG ref = InterlockedDecrement(&This->ref); + + TRACE("(%p) ref=%d\n", This, ref); + + if(!ref) { + IConnectionPoint_Release(&This->cp->IConnectionPoint_iface); + heap_free(This); + } + + return ref; +} + +static HRESULT WINAPI EnumConnections_Next(IEnumConnections *iface, ULONG cConnections, CONNECTDATA *rgcd, ULONG *pcFetched) +{ + EnumConnections *This = impl_from_IEnumConnections(iface); + ULONG fetched = 0; + + TRACE("(%p)->(%d %p %p)\n", This, cConnections, rgcd, pcFetched); + + while(fetched < cConnections && This->iter < This->cp->sinks_size) { + if(!This->cp->sinks[This->iter].unk) { + This->iter++; + continue; + } + + rgcd[fetched].pUnk = This->cp->sinks[This->iter].unk; + rgcd[fetched].dwCookie = ++This->iter; + IUnknown_AddRef(rgcd[fetched].pUnk); + fetched++; + } + + if(pcFetched) + *pcFetched = fetched; + return fetched == cConnections ? S_OK : S_FALSE; +} + +static HRESULT WINAPI EnumConnections_Skip(IEnumConnections *iface, ULONG cConnections) +{ + EnumConnections *This = impl_from_IEnumConnections(iface); + FIXME("(%p)->(%d)\n", This, cConnections); + return E_NOTIMPL; +} + +static HRESULT WINAPI EnumConnections_Reset(IEnumConnections *iface) +{ + EnumConnections *This = impl_from_IEnumConnections(iface); + FIXME("(%p)\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI EnumConnections_Clone(IEnumConnections *iface, IEnumConnections **ppEnum) +{ + EnumConnections *This = impl_from_IEnumConnections(iface); + FIXME("(%p)->(%p)\n", This, ppEnum); + return E_NOTIMPL; +} + +static const IEnumConnectionsVtbl EnumConnectionsVtbl = { + EnumConnections_QueryInterface, + EnumConnections_AddRef, + EnumConnections_Release, + EnumConnections_Next, + EnumConnections_Skip, + EnumConnections_Reset, + EnumConnections_Clone +}; + static inline ConnectionPoint *impl_from_IConnectionPoint(IConnectionPoint *iface) { return CONTAINING_RECORD(iface, ConnectionPoint, IConnectionPoint_iface); @@ -175,8 +289,23 @@ IEnumConnections **ppEnum) { ConnectionPoint *This = impl_from_IConnectionPoint(iface); - FIXME("(%p)->(%p)\n", This, ppEnum); - return E_NOTIMPL; + EnumConnections *ret; + + TRACE("(%p)->(%p)\n", This, ppEnum); + + ret = heap_alloc(sizeof(*ret)); + if(!ret) + return E_OUTOFMEMORY; + + ret->IEnumConnections_iface.lpVtbl = &EnumConnectionsVtbl; + ret->ref = 1; + ret->iter = 0; + + IConnectionPoint_AddRef(&This->IConnectionPoint_iface); + ret->cp = This; + + *ppEnum = &ret->IEnumConnections_iface; + return S_OK; } static const IConnectionPointVtbl ConnectionPointVtbl = diff -Nru wine1.7-1.7.14/dlls/mshtml/htmlanchor.c wine1.7-1.7.18/dlls/mshtml/htmlanchor.c --- wine1.7-1.7.14/dlls/mshtml/htmlanchor.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/mshtml/htmlanchor.c 2014-05-02 18:15:48.000000000 +0000 @@ -70,47 +70,81 @@ return hres; } +HTMLOuterWindow *get_target_window(HTMLOuterWindow *window, nsAString *target_str, BOOL *use_new_window) +{ + HTMLOuterWindow *top_window, *ret_window; + const PRUnichar *target; + HRESULT hres; + + static const WCHAR _parentW[] = {'_','p','a','r','e','n','t',0}; + static const WCHAR _selfW[] = {'_','s','e','l','f',0}; + static const WCHAR _topW[] = {'_','t','o','p',0}; + + *use_new_window = FALSE; + + nsAString_GetData(target_str, &target); + TRACE("%s\n", debugstr_w(target)); + + if(!*target || !strcmpiW(target, _selfW)) { + IHTMLWindow2_AddRef(&window->base.IHTMLWindow2_iface); + return window; + } + + if(!strcmpiW(target, _topW)) { + get_top_window(window, &top_window); + IHTMLWindow2_AddRef(&top_window->base.IHTMLWindow2_iface); + return top_window; + } + + if(!strcmpiW(target, _parentW)) { + if(!window->parent) { + WARN("Window has no parent\n"); + return NULL; + } + + IHTMLWindow2_AddRef(&window->parent->base.IHTMLWindow2_iface); + return window->parent; + } + + get_top_window(window, &top_window); + + hres = get_frame_by_name(top_window, target, TRUE, &ret_window); + if(FAILED(hres) || !ret_window) { + *use_new_window = TRUE; + return NULL; + } + + IHTMLWindow2_AddRef(&ret_window->base.IHTMLWindow2_iface); + return ret_window; +} + static HRESULT navigate_anchor(HTMLAnchorElement *This) { nsAString href_str, target_str; - HTMLOuterWindow *window = NULL; + HTMLOuterWindow *window; + BOOL use_new_window; nsresult nsres; HRESULT hres = E_FAIL; - static const WCHAR _parentW[] = {'p','a','r','e','n','t',0}; - static const WCHAR _selfW[] = {'_','s','e','l','f',0}; - static const WCHAR _topW[] = {'_','t','o','p',0}; nsAString_Init(&target_str, NULL); nsres = nsIDOMHTMLAnchorElement_GetTarget(This->nsanchor, &target_str); - if(NS_SUCCEEDED(nsres)) { + if(NS_FAILED(nsres)) + return E_FAIL; + + window = get_target_window(This->element.node.doc->basedoc.window, &target_str, &use_new_window); + if(!window && use_new_window) { const PRUnichar *target; nsAString_GetData(&target_str, &target); - TRACE("target %s\n", debugstr_w(target)); - if(*target && strcmpiW(target, _selfW)) { - if(!strcmpiW(target, _topW)) { - TRACE("target _top\n"); - get_top_window(This->element.node.doc->basedoc.window, &window); - }else if(!strcmpiW(target, _parentW)) { - FIXME("Navigating to target _parent is not implemented\n"); - nsAString_Finish(&target_str); - return S_OK; - }else { - HTMLOuterWindow *top_window; - - get_top_window(This->element.node.doc->basedoc.window, &top_window); - - hres = get_frame_by_name(top_window, target, TRUE, &window); - if(FAILED(hres) || !window) { - hres = navigate_anchor_window(This, target); - nsAString_Finish(&target_str); - return hres; - } - } - } + hres = navigate_anchor_window(This, target); + nsAString_Finish(&target_str); + return hres; } + nsAString_Finish(&target_str); + if(!window) + return S_OK; nsAString_Init(&href_str, NULL); nsres = nsIDOMHTMLAnchorElement_GetHref(This->nsanchor, &href_str); @@ -119,8 +153,6 @@ nsAString_GetData(&href_str, &href); if(*href) { - if(!window) - window = This->element.node.doc->basedoc.window; hres = navigate_url(window, href, window->uri_nofrag, BINDING_NAVIGATED); }else { TRACE("empty href\n"); @@ -128,6 +160,7 @@ } } nsAString_Finish(&href_str); + IHTMLWindow2_Release(&window->base.IHTMLWindow2_iface); return hres; } diff -Nru wine1.7-1.7.14/dlls/mshtml/htmlbody.c wine1.7-1.7.18/dlls/mshtml/htmlbody.c --- wine1.7-1.7.14/dlls/mshtml/htmlbody.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/mshtml/htmlbody.c 2014-05-02 18:15:48.000000000 +0000 @@ -124,7 +124,7 @@ | comp_value(hex+2*dpc, dpc); } -static HRESULT nscolor_to_str(LPCWSTR color, BSTR *ret) +HRESULT nscolor_to_str(LPCWSTR color, BSTR *ret) { unsigned int i; int rgb = -1; @@ -155,7 +155,7 @@ return S_OK; } -static BOOL variant_to_nscolor(const VARIANT *v, nsAString *nsstr) +BOOL variant_to_nscolor(const VARIANT *v, nsAString *nsstr) { switch(V_VT(v)) { case VT_BSTR: diff -Nru wine1.7-1.7.14/dlls/mshtml/htmldoc3.c wine1.7-1.7.18/dlls/mshtml/htmldoc3.c --- wine1.7-1.7.14/dlls/mshtml/htmldoc3.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/mshtml/htmldoc3.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,890 +0,0 @@ -/* - * Copyright 2005 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 "config.h" - -#include -#include -#include - -#define COBJMACROS - -#include "windef.h" -#include "winbase.h" -#include "winuser.h" -#include "ole2.h" - -#include "wine/debug.h" - -#include "mshtml_private.h" -#include "htmlevent.h" - -WINE_DEFAULT_DEBUG_CHANNEL(mshtml); - -HRESULT get_doc_elem_by_id(HTMLDocumentNode *doc, const WCHAR *id, HTMLElement **ret) -{ - nsIDOMNodeList *nsnode_list; - nsIDOMElement *nselem; - nsIDOMNode *nsnode; - nsAString id_str; - nsresult nsres; - HRESULT hres; - - if(!doc->nsdoc) { - WARN("NULL nsdoc\n"); - return E_UNEXPECTED; - } - - nsAString_InitDepend(&id_str, id); - /* get element by id attribute */ - nsres = nsIDOMHTMLDocument_GetElementById(doc->nsdoc, &id_str, &nselem); - if(FAILED(nsres)) { - ERR("GetElementById failed: %08x\n", nsres); - nsAString_Finish(&id_str); - return E_FAIL; - } - - /* get first element by name attribute */ - nsres = nsIDOMHTMLDocument_GetElementsByName(doc->nsdoc, &id_str, &nsnode_list); - nsAString_Finish(&id_str); - if(FAILED(nsres)) { - ERR("getElementsByName failed: %08x\n", nsres); - if(nselem) - nsIDOMElement_Release(nselem); - return E_FAIL; - } - - nsres = nsIDOMNodeList_Item(nsnode_list, 0, &nsnode); - nsIDOMNodeList_Release(nsnode_list); - assert(nsres == NS_OK); - - if(nsnode && nselem) { - UINT16 pos; - - nsres = nsIDOMNode_CompareDocumentPosition(nsnode, (nsIDOMNode*)nselem, &pos); - if(NS_FAILED(nsres)) { - FIXME("CompareDocumentPosition failed: 0x%08x\n", nsres); - nsIDOMNode_Release(nsnode); - nsIDOMElement_Release(nselem); - return E_FAIL; - } - - TRACE("CompareDocumentPosition gave: 0x%x\n", pos); - if(!(pos & (DOCUMENT_POSITION_PRECEDING | DOCUMENT_POSITION_CONTAINS))) { - nsIDOMElement_Release(nselem); - nselem = NULL; - } - } - - if(nsnode) { - if(!nselem) { - nsres = nsIDOMNode_QueryInterface(nsnode, &IID_nsIDOMElement, (void**)&nselem); - assert(nsres == NS_OK); - } - nsIDOMNode_Release(nsnode); - } - - if(!nselem) { - *ret = NULL; - return S_OK; - } - - hres = get_elem(doc, nselem, ret); - nsIDOMElement_Release(nselem); - return hres; -} - -static inline HTMLDocument *impl_from_IHTMLDocument3(IHTMLDocument3 *iface) -{ - return CONTAINING_RECORD(iface, HTMLDocument, IHTMLDocument3_iface); -} - -static HRESULT WINAPI HTMLDocument3_QueryInterface(IHTMLDocument3 *iface, - REFIID riid, void **ppv) -{ - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - return htmldoc_query_interface(This, riid, ppv); -} - -static ULONG WINAPI HTMLDocument3_AddRef(IHTMLDocument3 *iface) -{ - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - return htmldoc_addref(This); -} - -static ULONG WINAPI HTMLDocument3_Release(IHTMLDocument3 *iface) -{ - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - return htmldoc_release(This); -} - -static HRESULT WINAPI HTMLDocument3_GetTypeInfoCount(IHTMLDocument3 *iface, UINT *pctinfo) -{ - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo); -} - -static HRESULT WINAPI HTMLDocument3_GetTypeInfo(IHTMLDocument3 *iface, UINT iTInfo, - LCID lcid, ITypeInfo **ppTInfo) -{ - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo); -} - -static HRESULT WINAPI HTMLDocument3_GetIDsOfNames(IHTMLDocument3 *iface, REFIID riid, - LPOLESTR *rgszNames, UINT cNames, - LCID lcid, DISPID *rgDispId) -{ - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid, - rgDispId); -} - -static HRESULT WINAPI HTMLDocument3_Invoke(IHTMLDocument3 *iface, DISPID dispIdMember, - REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, - VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) -{ - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, - pDispParams, pVarResult, pExcepInfo, puArgErr); -} - -static HRESULT WINAPI HTMLDocument3_releaseCapture(IHTMLDocument3 *iface) -{ - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - FIXME("(%p)\n", This); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument3_recalc(IHTMLDocument3 *iface, VARIANT_BOOL fForce) -{ - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - FIXME("(%p)->(%x)\n", This, fForce); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument3_createTextNode(IHTMLDocument3 *iface, BSTR text, - IHTMLDOMNode **newTextNode) -{ - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - nsIDOMText *nstext; - HTMLDOMNode *node; - nsAString text_str; - nsresult nsres; - HRESULT hres; - - TRACE("(%p)->(%s %p)\n", This, debugstr_w(text), newTextNode); - - if(!This->doc_node->nsdoc) { - WARN("NULL nsdoc\n"); - return E_UNEXPECTED; - } - - nsAString_InitDepend(&text_str, text); - nsres = nsIDOMHTMLDocument_CreateTextNode(This->doc_node->nsdoc, &text_str, &nstext); - nsAString_Finish(&text_str); - if(NS_FAILED(nsres)) { - ERR("CreateTextNode failed: %08x\n", nsres); - return E_FAIL; - } - - hres = HTMLDOMTextNode_Create(This->doc_node, (nsIDOMNode*)nstext, &node); - nsIDOMText_Release(nstext); - if(FAILED(hres)) - return hres; - - *newTextNode = &node->IHTMLDOMNode_iface; - return S_OK; -} - -static HRESULT WINAPI HTMLDocument3_get_documentElement(IHTMLDocument3 *iface, IHTMLElement **p) -{ - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - nsIDOMElement *nselem = NULL; - HTMLDOMNode *node; - nsresult nsres; - HRESULT hres; - - TRACE("(%p)->(%p)\n", This, p); - - if(This->window->readystate == READYSTATE_UNINITIALIZED) { - *p = NULL; - return S_OK; - } - - if(!This->doc_node->nsdoc) { - WARN("NULL nsdoc\n"); - return E_UNEXPECTED; - } - - nsres = nsIDOMHTMLDocument_GetDocumentElement(This->doc_node->nsdoc, &nselem); - if(NS_FAILED(nsres)) { - ERR("GetDocumentElement failed: %08x\n", nsres); - return E_FAIL; - } - - if(!nselem) { - *p = NULL; - return S_OK; - } - - hres = get_node(This->doc_node, (nsIDOMNode *)nselem, TRUE, &node); - nsIDOMElement_Release(nselem); - if(FAILED(hres)) - return hres; - - hres = IHTMLDOMNode_QueryInterface(&node->IHTMLDOMNode_iface, &IID_IHTMLElement, (void**)p); - node_release(node); - return hres; -} - -static HRESULT WINAPI HTMLDocument3_uniqueID(IHTMLDocument3 *iface, BSTR *p) -{ - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument3_attachEvent(IHTMLDocument3 *iface, BSTR event, - IDispatch* pDisp, VARIANT_BOOL *pfResult) -{ - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - - TRACE("(%p)->(%s %p %p)\n", This, debugstr_w(event), pDisp, pfResult); - - return attach_event(&This->doc_node->node.event_target, This->doc_node->node.nsnode, This, event, pDisp, pfResult); -} - -static HRESULT WINAPI HTMLDocument3_detachEvent(IHTMLDocument3 *iface, BSTR event, - IDispatch *pDisp) -{ - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - - TRACE("(%p)->(%s %p)\n", This, debugstr_w(event), pDisp); - - return detach_event(This->doc_node->node.event_target, This, event, pDisp); -} - -static HRESULT WINAPI HTMLDocument3_put_onrowsdelete(IHTMLDocument3 *iface, VARIANT v) -{ - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - FIXME("(%p)->()\n", This); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument3_get_onrowsdelete(IHTMLDocument3 *iface, VARIANT *p) -{ - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument3_put_onrowsinserted(IHTMLDocument3 *iface, VARIANT v) -{ - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - FIXME("(%p)->()\n", This); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument3_get_onrowsinserted(IHTMLDocument3 *iface, VARIANT *p) -{ - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument3_put_oncellchange(IHTMLDocument3 *iface, VARIANT v) -{ - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - FIXME("(%p)->()\n", This); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument3_get_oncellchange(IHTMLDocument3 *iface, VARIANT *p) -{ - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument3_put_ondatasetchanged(IHTMLDocument3 *iface, VARIANT v) -{ - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - FIXME("(%p)->()\n", This); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument3_get_ondatasetchanged(IHTMLDocument3 *iface, VARIANT *p) -{ - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument3_put_ondataavailable(IHTMLDocument3 *iface, VARIANT v) -{ - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - FIXME("(%p)->()\n", This); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument3_get_ondataavailable(IHTMLDocument3 *iface, VARIANT *p) -{ - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument3_put_ondatasetcomplete(IHTMLDocument3 *iface, VARIANT v) -{ - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - FIXME("(%p)->()\n", This); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument3_get_ondatasetcomplete(IHTMLDocument3 *iface, VARIANT *p) -{ - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument3_put_onpropertychange(IHTMLDocument3 *iface, VARIANT v) -{ - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - FIXME("(%p)->()\n", This); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument3_get_onpropertychange(IHTMLDocument3 *iface, VARIANT *p) -{ - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument3_put_dir(IHTMLDocument3 *iface, BSTR v) -{ - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - FIXME("(%p)->(%s)\n", This, debugstr_w(v)); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument3_get_dir(IHTMLDocument3 *iface, BSTR *p) -{ - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument3_put_oncontextmenu(IHTMLDocument3 *iface, VARIANT v) -{ - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - - TRACE("(%p)->()\n", This); - - return set_doc_event(This, EVENTID_CONTEXTMENU, &v); -} - -static HRESULT WINAPI HTMLDocument3_get_oncontextmenu(IHTMLDocument3 *iface, VARIANT *p) -{ - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - - TRACE("(%p)->(%p)\n", This, p); - - return get_doc_event(This, EVENTID_CONTEXTMENU, p); -} - -static HRESULT WINAPI HTMLDocument3_put_onstop(IHTMLDocument3 *iface, VARIANT v) -{ - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - FIXME("(%p)->()\n", This); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument3_get_onstop(IHTMLDocument3 *iface, VARIANT *p) -{ - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument3_createDocumentFragment(IHTMLDocument3 *iface, - IHTMLDocument2 **ppNewDoc) -{ - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - nsIDOMDocumentFragment *doc_frag; - HTMLDocumentNode *docnode; - nsresult nsres; - HRESULT hres; - - TRACE("(%p)->(%p)\n", This, ppNewDoc); - - if(!This->doc_node->nsdoc) { - FIXME("NULL nsdoc\n"); - return E_NOTIMPL; - } - - nsres = nsIDOMHTMLDocument_CreateDocumentFragment(This->doc_node->nsdoc, &doc_frag); - if(NS_FAILED(nsres)) { - ERR("CreateDocumentFragment failed: %08x\n", nsres); - return E_FAIL; - } - - hres = create_document_fragment((nsIDOMNode*)doc_frag, This->doc_node, &docnode); - nsIDOMDocumentFragment_Release(doc_frag); - if(FAILED(hres)) - return hres; - - *ppNewDoc = &docnode->basedoc.IHTMLDocument2_iface; - return S_OK; -} - -static HRESULT WINAPI HTMLDocument3_get_parentDocument(IHTMLDocument3 *iface, - IHTMLDocument2 **p) -{ - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument3_put_enableDownload(IHTMLDocument3 *iface, - VARIANT_BOOL v) -{ - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - FIXME("(%p)->(%x)\n", This, v); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument3_get_enableDownload(IHTMLDocument3 *iface, - VARIANT_BOOL *p) -{ - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument3_put_baseUrl(IHTMLDocument3 *iface, BSTR v) -{ - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - FIXME("(%p)->(%s)\n", This, debugstr_w(v)); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument3_get_baseUrl(IHTMLDocument3 *iface, BSTR *p) -{ - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument3_get_childNodes(IHTMLDocument3 *iface, IDispatch **p) -{ - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - - TRACE("(%p)->(%p)\n", This, p); - - return IHTMLDOMNode_get_childNodes(&This->doc_node->node.IHTMLDOMNode_iface, p); -} - -static HRESULT WINAPI HTMLDocument3_put_inheritStyleSheets(IHTMLDocument3 *iface, - VARIANT_BOOL v) -{ - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - FIXME("(%p)->()\n", This); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument3_get_inheritStyleSheets(IHTMLDocument3 *iface, - VARIANT_BOOL *p) -{ - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument3_put_onbeforeeditfocus(IHTMLDocument3 *iface, VARIANT v) -{ - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - FIXME("(%p)->()\n", This); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument3_get_onbeforeeditfocus(IHTMLDocument3 *iface, VARIANT *p) -{ - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument3_getElementsByName(IHTMLDocument3 *iface, BSTR v, - IHTMLElementCollection **ppelColl) -{ - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - nsIDOMNodeList *node_list; - nsAString selector_str; - WCHAR *selector; - nsresult nsres; - - static const WCHAR formatW[] = {'*','[','i','d','=','%','s',']',',','*','[','n','a','m','e','=','%','s',']',0}; - - TRACE("(%p)->(%s %p)\n", This, debugstr_w(v), ppelColl); - - if(!This->doc_node || !This->doc_node->nsdoc) { - /* We should probably return an empty collection. */ - FIXME("No nsdoc\n"); - return E_NOTIMPL; - } - - selector = heap_alloc(2*SysStringLen(v)*sizeof(WCHAR) + sizeof(formatW)); - if(!selector) - return E_OUTOFMEMORY; - sprintfW(selector, formatW, v, v); - - /* - * NOTE: IE getElementsByName implementation differs from Gecko. It searches both name and id attributes. - * That's why we use CSS selector instead. We should also use name only when it applies to given element - * types and search should be case insensitive. Those are currently not supported properly. - */ - nsAString_InitDepend(&selector_str, selector); - nsres = nsIDOMNodeSelector_QuerySelectorAll(This->doc_node->nsnode_selector, &selector_str, &node_list); - nsAString_Finish(&selector_str); - heap_free(selector); - if(NS_FAILED(nsres)) { - ERR("QuerySelectorAll failed: %08x\n", nsres); - return E_FAIL; - } - - *ppelColl = create_collection_from_nodelist(This->doc_node, node_list); - nsIDOMNodeList_Release(node_list); - return S_OK; -} - - -static HRESULT WINAPI HTMLDocument3_getElementById(IHTMLDocument3 *iface, BSTR v, - IHTMLElement **pel) -{ - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - HTMLElement *elem; - HRESULT hres; - - TRACE("(%p)->(%s %p)\n", This, debugstr_w(v), pel); - - hres = get_doc_elem_by_id(This->doc_node, v, &elem); - if(FAILED(hres) || !elem) { - *pel = NULL; - return hres; - } - - *pel = &elem->IHTMLElement_iface; - return S_OK; -} - - -static HRESULT WINAPI HTMLDocument3_getElementsByTagName(IHTMLDocument3 *iface, BSTR v, - IHTMLElementCollection **pelColl) -{ - HTMLDocument *This = impl_from_IHTMLDocument3(iface); - nsIDOMNodeList *nslist; - nsAString id_str; - nsresult nsres; - - TRACE("(%p)->(%s %p)\n", This, debugstr_w(v), pelColl); - - if(!This->doc_node->nsdoc) { - WARN("NULL nsdoc\n"); - return E_UNEXPECTED; - } - - nsAString_InitDepend(&id_str, v); - nsres = nsIDOMHTMLDocument_GetElementsByTagName(This->doc_node->nsdoc, &id_str, &nslist); - nsAString_Finish(&id_str); - if(FAILED(nsres)) { - ERR("GetElementByName failed: %08x\n", nsres); - return E_FAIL; - } - - *pelColl = create_collection_from_nodelist(This->doc_node, nslist); - nsIDOMNodeList_Release(nslist); - - return S_OK; -} - -static const IHTMLDocument3Vtbl HTMLDocument3Vtbl = { - HTMLDocument3_QueryInterface, - HTMLDocument3_AddRef, - HTMLDocument3_Release, - HTMLDocument3_GetTypeInfoCount, - HTMLDocument3_GetTypeInfo, - HTMLDocument3_GetIDsOfNames, - HTMLDocument3_Invoke, - HTMLDocument3_releaseCapture, - HTMLDocument3_recalc, - HTMLDocument3_createTextNode, - HTMLDocument3_get_documentElement, - HTMLDocument3_uniqueID, - HTMLDocument3_attachEvent, - HTMLDocument3_detachEvent, - HTMLDocument3_put_onrowsdelete, - HTMLDocument3_get_onrowsdelete, - HTMLDocument3_put_onrowsinserted, - HTMLDocument3_get_onrowsinserted, - HTMLDocument3_put_oncellchange, - HTMLDocument3_get_oncellchange, - HTMLDocument3_put_ondatasetchanged, - HTMLDocument3_get_ondatasetchanged, - HTMLDocument3_put_ondataavailable, - HTMLDocument3_get_ondataavailable, - HTMLDocument3_put_ondatasetcomplete, - HTMLDocument3_get_ondatasetcomplete, - HTMLDocument3_put_onpropertychange, - HTMLDocument3_get_onpropertychange, - HTMLDocument3_put_dir, - HTMLDocument3_get_dir, - HTMLDocument3_put_oncontextmenu, - HTMLDocument3_get_oncontextmenu, - HTMLDocument3_put_onstop, - HTMLDocument3_get_onstop, - HTMLDocument3_createDocumentFragment, - HTMLDocument3_get_parentDocument, - HTMLDocument3_put_enableDownload, - HTMLDocument3_get_enableDownload, - HTMLDocument3_put_baseUrl, - HTMLDocument3_get_baseUrl, - HTMLDocument3_get_childNodes, - HTMLDocument3_put_inheritStyleSheets, - HTMLDocument3_get_inheritStyleSheets, - HTMLDocument3_put_onbeforeeditfocus, - HTMLDocument3_get_onbeforeeditfocus, - HTMLDocument3_getElementsByName, - HTMLDocument3_getElementById, - HTMLDocument3_getElementsByTagName -}; - -static inline HTMLDocument *impl_from_IHTMLDocument4(IHTMLDocument4 *iface) -{ - return CONTAINING_RECORD(iface, HTMLDocument, IHTMLDocument4_iface); -} - -static HRESULT WINAPI HTMLDocument4_QueryInterface(IHTMLDocument4 *iface, - REFIID riid, void **ppv) -{ - HTMLDocument *This = impl_from_IHTMLDocument4(iface); - return htmldoc_query_interface(This, riid, ppv); -} - -static ULONG WINAPI HTMLDocument4_AddRef(IHTMLDocument4 *iface) -{ - HTMLDocument *This = impl_from_IHTMLDocument4(iface); - return htmldoc_addref(This); -} - -static ULONG WINAPI HTMLDocument4_Release(IHTMLDocument4 *iface) -{ - HTMLDocument *This = impl_from_IHTMLDocument4(iface); - return htmldoc_release(This); -} - -static HRESULT WINAPI HTMLDocument4_GetTypeInfoCount(IHTMLDocument4 *iface, UINT *pctinfo) -{ - HTMLDocument *This = impl_from_IHTMLDocument4(iface); - return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo); -} - -static HRESULT WINAPI HTMLDocument4_GetTypeInfo(IHTMLDocument4 *iface, UINT iTInfo, - LCID lcid, ITypeInfo **ppTInfo) -{ - HTMLDocument *This = impl_from_IHTMLDocument4(iface); - return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo); -} - -static HRESULT WINAPI HTMLDocument4_GetIDsOfNames(IHTMLDocument4 *iface, REFIID riid, - LPOLESTR *rgszNames, UINT cNames, - LCID lcid, DISPID *rgDispId) -{ - HTMLDocument *This = impl_from_IHTMLDocument4(iface); - return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid, - rgDispId); -} - -static HRESULT WINAPI HTMLDocument4_Invoke(IHTMLDocument4 *iface, DISPID dispIdMember, - REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, - VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) -{ - HTMLDocument *This = impl_from_IHTMLDocument4(iface); - return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, - pDispParams, pVarResult, pExcepInfo, puArgErr); -} - -static HRESULT WINAPI HTMLDocument4_focus(IHTMLDocument4 *iface) -{ - HTMLDocument *This = impl_from_IHTMLDocument4(iface); - nsIDOMHTMLElement *nsbody; - nsresult nsres; - - TRACE("(%p)->()\n", This); - - nsres = nsIDOMHTMLDocument_GetBody(This->doc_node->nsdoc, &nsbody); - if(NS_FAILED(nsres) || !nsbody) { - ERR("GetBody failed: %08x\n", nsres); - return E_FAIL; - } - - nsres = nsIDOMHTMLElement_Focus(nsbody); - nsIDOMHTMLElement_Release(nsbody); - if(NS_FAILED(nsres)) { - ERR("Focus failed: %08x\n", nsres); - return E_FAIL; - } - - return S_OK; -} - -static HRESULT WINAPI HTMLDocument4_hasFocus(IHTMLDocument4 *iface, VARIANT_BOOL *pfFocus) -{ - HTMLDocument *This = impl_from_IHTMLDocument4(iface); - FIXME("(%p)->(%p)\n", This, pfFocus); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument4_put_onselectionchange(IHTMLDocument4 *iface, VARIANT v) -{ - HTMLDocument *This = impl_from_IHTMLDocument4(iface); - FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument4_get_onselectionchange(IHTMLDocument4 *iface, VARIANT *p) -{ - HTMLDocument *This = impl_from_IHTMLDocument4(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument4_get_namespace(IHTMLDocument4 *iface, IDispatch **p) -{ - HTMLDocument *This = impl_from_IHTMLDocument4(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument4_createDocumentFromUrl(IHTMLDocument4 *iface, BSTR bstrUrl, - BSTR bstrOptions, IHTMLDocument2 **newDoc) -{ - HTMLDocument *This = impl_from_IHTMLDocument4(iface); - FIXME("(%p)->(%s %s %p)\n", This, debugstr_w(bstrUrl), debugstr_w(bstrOptions), newDoc); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument4_put_media(IHTMLDocument4 *iface, BSTR v) -{ - HTMLDocument *This = impl_from_IHTMLDocument4(iface); - FIXME("(%p)->(%s)\n", This, debugstr_w(v)); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument4_get_media(IHTMLDocument4 *iface, BSTR *p) -{ - HTMLDocument *This = impl_from_IHTMLDocument4(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument4_createEventObject(IHTMLDocument4 *iface, - VARIANT *pvarEventObject, IHTMLEventObj **ppEventObj) -{ - HTMLDocument *This = impl_from_IHTMLDocument4(iface); - - TRACE("(%p)->(%s %p)\n", This, debugstr_variant(pvarEventObject), ppEventObj); - - if(pvarEventObject && V_VT(pvarEventObject) != VT_ERROR && V_VT(pvarEventObject) != VT_EMPTY) { - FIXME("unsupported pvarEventObject %s\n", debugstr_variant(pvarEventObject)); - return E_NOTIMPL; - } - - return create_event_obj(ppEventObj); -} - -static HRESULT WINAPI HTMLDocument4_fireEvent(IHTMLDocument4 *iface, BSTR bstrEventName, - VARIANT *pvarEventObject, VARIANT_BOOL *pfCanceled) -{ - HTMLDocument *This = impl_from_IHTMLDocument4(iface); - - TRACE("(%p)->(%s %p %p)\n", This, debugstr_w(bstrEventName), pvarEventObject, pfCanceled); - - return dispatch_event(&This->doc_node->node, bstrEventName, pvarEventObject, pfCanceled); -} - -static HRESULT WINAPI HTMLDocument4_createRenderStyle(IHTMLDocument4 *iface, BSTR v, - IHTMLRenderStyle **ppIHTMLRenderStyle) -{ - HTMLDocument *This = impl_from_IHTMLDocument4(iface); - FIXME("(%p)->(%s %p)\n", This, debugstr_w(v), ppIHTMLRenderStyle); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument4_put_oncontrolselect(IHTMLDocument4 *iface, VARIANT v) -{ - HTMLDocument *This = impl_from_IHTMLDocument4(iface); - FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument4_get_oncontrolselect(IHTMLDocument4 *iface, VARIANT *p) -{ - HTMLDocument *This = impl_from_IHTMLDocument4(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument4_get_URLEncoded(IHTMLDocument4 *iface, BSTR *p) -{ - HTMLDocument *This = impl_from_IHTMLDocument4(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; -} - -static const IHTMLDocument4Vtbl HTMLDocument4Vtbl = { - HTMLDocument4_QueryInterface, - HTMLDocument4_AddRef, - HTMLDocument4_Release, - HTMLDocument4_GetTypeInfoCount, - HTMLDocument4_GetTypeInfo, - HTMLDocument4_GetIDsOfNames, - HTMLDocument4_Invoke, - HTMLDocument4_focus, - HTMLDocument4_hasFocus, - HTMLDocument4_put_onselectionchange, - HTMLDocument4_get_onselectionchange, - HTMLDocument4_get_namespace, - HTMLDocument4_createDocumentFromUrl, - HTMLDocument4_put_media, - HTMLDocument4_get_media, - HTMLDocument4_createEventObject, - HTMLDocument4_fireEvent, - HTMLDocument4_createRenderStyle, - HTMLDocument4_put_oncontrolselect, - HTMLDocument4_get_oncontrolselect, - HTMLDocument4_get_URLEncoded -}; - -void HTMLDocument_HTMLDocument3_Init(HTMLDocument *This) -{ - This->IHTMLDocument3_iface.lpVtbl = &HTMLDocument3Vtbl; - This->IHTMLDocument4_iface.lpVtbl = &HTMLDocument4Vtbl; -} diff -Nru wine1.7-1.7.14/dlls/mshtml/htmldoc5.c wine1.7-1.7.18/dlls/mshtml/htmldoc5.c --- wine1.7-1.7.14/dlls/mshtml/htmldoc5.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/mshtml/htmldoc5.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,443 +0,0 @@ -/* - * Copyright 2007 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 "config.h" - -#include -#include - -#define COBJMACROS - -#include "windef.h" -#include "winbase.h" -#include "winuser.h" -#include "ole2.h" - -#include "wine/debug.h" - -#include "mshtml_private.h" - -WINE_DEFAULT_DEBUG_CHANNEL(mshtml); - -static inline HTMLDocument *impl_from_IHTMLDocument5(IHTMLDocument5 *iface) -{ - return CONTAINING_RECORD(iface, HTMLDocument, IHTMLDocument5_iface); -} - -static HRESULT WINAPI HTMLDocument5_QueryInterface(IHTMLDocument5 *iface, - REFIID riid, void **ppv) -{ - HTMLDocument *This = impl_from_IHTMLDocument5(iface); - return htmldoc_query_interface(This, riid, ppv); -} - -static ULONG WINAPI HTMLDocument5_AddRef(IHTMLDocument5 *iface) -{ - HTMLDocument *This = impl_from_IHTMLDocument5(iface); - return htmldoc_addref(This); -} - -static ULONG WINAPI HTMLDocument5_Release(IHTMLDocument5 *iface) -{ - HTMLDocument *This = impl_from_IHTMLDocument5(iface); - return htmldoc_release(This); -} - -static HRESULT WINAPI HTMLDocument5_GetTypeInfoCount(IHTMLDocument5 *iface, UINT *pctinfo) -{ - HTMLDocument *This = impl_from_IHTMLDocument5(iface); - return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo); -} - -static HRESULT WINAPI HTMLDocument5_GetTypeInfo(IHTMLDocument5 *iface, UINT iTInfo, - LCID lcid, ITypeInfo **ppTInfo) -{ - HTMLDocument *This = impl_from_IHTMLDocument5(iface); - return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo); -} - -static HRESULT WINAPI HTMLDocument5_GetIDsOfNames(IHTMLDocument5 *iface, REFIID riid, - LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) -{ - HTMLDocument *This = impl_from_IHTMLDocument5(iface); - return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid, - rgDispId); -} - -static HRESULT WINAPI HTMLDocument5_Invoke(IHTMLDocument5 *iface, DISPID dispIdMember, - REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, - VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) -{ - HTMLDocument *This = impl_from_IHTMLDocument5(iface); - return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, - pDispParams, pVarResult, pExcepInfo, puArgErr); -} - -static HRESULT WINAPI HTMLDocument5_put_onmousewheel(IHTMLDocument5 *iface, VARIANT v) -{ - HTMLDocument *This = impl_from_IHTMLDocument5(iface); - FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument5_get_onmousewheel(IHTMLDocument5 *iface, VARIANT *p) -{ - HTMLDocument *This = impl_from_IHTMLDocument5(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument5_get_doctype(IHTMLDocument5 *iface, IHTMLDOMNode **p) -{ - HTMLDocument *This = impl_from_IHTMLDocument5(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument5_get_implementation(IHTMLDocument5 *iface, IHTMLDOMImplementation **p) -{ - HTMLDocument *This = impl_from_IHTMLDocument5(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument5_createAttribute(IHTMLDocument5 *iface, BSTR bstrattrName, - IHTMLDOMAttribute **ppattribute) -{ - HTMLDocument *This = impl_from_IHTMLDocument5(iface); - HTMLDOMAttribute *attr; - HRESULT hres; - - TRACE("(%p)->(%s %p)\n", This, debugstr_w(bstrattrName), ppattribute); - - hres = HTMLDOMAttribute_Create(bstrattrName, NULL, 0, &attr); - if(FAILED(hres)) - return hres; - - *ppattribute = &attr->IHTMLDOMAttribute_iface; - return S_OK; -} - -static HRESULT WINAPI HTMLDocument5_createComment(IHTMLDocument5 *iface, BSTR bstrdata, - IHTMLDOMNode **ppRetNode) -{ - HTMLDocument *This = impl_from_IHTMLDocument5(iface); - nsIDOMComment *nscomment; - HTMLElement *elem; - nsAString str; - nsresult nsres; - HRESULT hres; - - TRACE("(%p)->(%s %p)\n", This, debugstr_w(bstrdata), ppRetNode); - - if(!This->doc_node->nsdoc) { - WARN("NULL nsdoc\n"); - return E_UNEXPECTED; - } - - nsAString_InitDepend(&str, bstrdata); - nsres = nsIDOMHTMLDocument_CreateComment(This->doc_node->nsdoc, &str, &nscomment); - nsAString_Finish(&str); - if(NS_FAILED(nsres)) { - ERR("CreateTextNode failed: %08x\n", nsres); - return E_FAIL; - } - - hres = HTMLCommentElement_Create(This->doc_node, (nsIDOMNode*)nscomment, &elem); - nsIDOMComment_Release(nscomment); - if(FAILED(hres)) - return hres; - - *ppRetNode = &elem->node.IHTMLDOMNode_iface; - return S_OK; -} - -static HRESULT WINAPI HTMLDocument5_put_onfocusin(IHTMLDocument5 *iface, VARIANT v) -{ - HTMLDocument *This = impl_from_IHTMLDocument5(iface); - FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument5_get_onfocusin(IHTMLDocument5 *iface, VARIANT *p) -{ - HTMLDocument *This = impl_from_IHTMLDocument5(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument5_put_onfocusout(IHTMLDocument5 *iface, VARIANT v) -{ - HTMLDocument *This = impl_from_IHTMLDocument5(iface); - FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument5_get_onfocusout(IHTMLDocument5 *iface, VARIANT *p) -{ - HTMLDocument *This = impl_from_IHTMLDocument5(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument5_put_onactivate(IHTMLDocument5 *iface, VARIANT v) -{ - HTMLDocument *This = impl_from_IHTMLDocument5(iface); - FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument5_get_onactivate(IHTMLDocument5 *iface, VARIANT *p) -{ - HTMLDocument *This = impl_from_IHTMLDocument5(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument5_put_ondeactivate(IHTMLDocument5 *iface, VARIANT v) -{ - HTMLDocument *This = impl_from_IHTMLDocument5(iface); - FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument5_get_ondeactivate(IHTMLDocument5 *iface, VARIANT *p) -{ - HTMLDocument *This = impl_from_IHTMLDocument5(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument5_put_onbeforeactivate(IHTMLDocument5 *iface, VARIANT v) -{ - HTMLDocument *This = impl_from_IHTMLDocument5(iface); - FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument5_get_onbeforeactivate(IHTMLDocument5 *iface, VARIANT *p) -{ - HTMLDocument *This = impl_from_IHTMLDocument5(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument5_put_onbeforedeactivate(IHTMLDocument5 *iface, VARIANT v) -{ - HTMLDocument *This = impl_from_IHTMLDocument5(iface); - FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument5_get_onbeforedeactivate(IHTMLDocument5 *iface, VARIANT *p) -{ - HTMLDocument *This = impl_from_IHTMLDocument5(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument5_get_compatMode(IHTMLDocument5 *iface, BSTR *p) -{ - HTMLDocument *This = impl_from_IHTMLDocument5(iface); - nsAString mode_str; - const PRUnichar *mode; - - TRACE("(%p)->(%p)\n", This, p); - - if(!This->doc_node->nsdoc) { - WARN("NULL nsdoc\n"); - return E_UNEXPECTED; - } - - nsAString_Init(&mode_str, NULL); - nsIDOMHTMLDocument_GetCompatMode(This->doc_node->nsdoc, &mode_str); - - nsAString_GetData(&mode_str, &mode); - *p = SysAllocString(mode); - nsAString_Finish(&mode_str); - - return S_OK; -} - -static const IHTMLDocument5Vtbl HTMLDocument5Vtbl = { - HTMLDocument5_QueryInterface, - HTMLDocument5_AddRef, - HTMLDocument5_Release, - HTMLDocument5_GetTypeInfoCount, - HTMLDocument5_GetTypeInfo, - HTMLDocument5_GetIDsOfNames, - HTMLDocument5_Invoke, - HTMLDocument5_put_onmousewheel, - HTMLDocument5_get_onmousewheel, - HTMLDocument5_get_doctype, - HTMLDocument5_get_implementation, - HTMLDocument5_createAttribute, - HTMLDocument5_createComment, - HTMLDocument5_put_onfocusin, - HTMLDocument5_get_onfocusin, - HTMLDocument5_put_onfocusout, - HTMLDocument5_get_onfocusout, - HTMLDocument5_put_onactivate, - HTMLDocument5_get_onactivate, - HTMLDocument5_put_ondeactivate, - HTMLDocument5_get_ondeactivate, - HTMLDocument5_put_onbeforeactivate, - HTMLDocument5_get_onbeforeactivate, - HTMLDocument5_put_onbeforedeactivate, - HTMLDocument5_get_onbeforedeactivate, - HTMLDocument5_get_compatMode -}; - -static inline HTMLDocument *impl_from_IHTMLDocument6(IHTMLDocument6 *iface) -{ - return CONTAINING_RECORD(iface, HTMLDocument, IHTMLDocument6_iface); -} - -static HRESULT WINAPI HTMLDocument6_QueryInterface(IHTMLDocument6 *iface, - REFIID riid, void **ppv) -{ - HTMLDocument *This = impl_from_IHTMLDocument6(iface); - return htmldoc_query_interface(This, riid, ppv); -} - -static ULONG WINAPI HTMLDocument6_AddRef(IHTMLDocument6 *iface) -{ - HTMLDocument *This = impl_from_IHTMLDocument6(iface); - return htmldoc_addref(This); -} - -static ULONG WINAPI HTMLDocument6_Release(IHTMLDocument6 *iface) -{ - HTMLDocument *This = impl_from_IHTMLDocument6(iface); - return htmldoc_release(This); -} - -static HRESULT WINAPI HTMLDocument6_GetTypeInfoCount(IHTMLDocument6 *iface, UINT *pctinfo) -{ - HTMLDocument *This = impl_from_IHTMLDocument6(iface); - return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo); -} - -static HRESULT WINAPI HTMLDocument6_GetTypeInfo(IHTMLDocument6 *iface, UINT iTInfo, - LCID lcid, ITypeInfo **ppTInfo) -{ - HTMLDocument *This = impl_from_IHTMLDocument6(iface); - return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo); -} - -static HRESULT WINAPI HTMLDocument6_GetIDsOfNames(IHTMLDocument6 *iface, REFIID riid, - LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) -{ - HTMLDocument *This = impl_from_IHTMLDocument6(iface); - return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid, - rgDispId); -} - -static HRESULT WINAPI HTMLDocument6_Invoke(IHTMLDocument6 *iface, DISPID dispIdMember, - REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, - VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) -{ - HTMLDocument *This = impl_from_IHTMLDocument6(iface); - return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, - pDispParams, pVarResult, pExcepInfo, puArgErr); -} - -static HRESULT WINAPI HTMLDocument6_get_compatible(IHTMLDocument6 *iface, - IHTMLDocumentCompatibleInfoCollection **p) -{ - HTMLDocument *This = impl_from_IHTMLDocument6(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument6_get_documentMode(IHTMLDocument6 *iface, - VARIANT *p) -{ - HTMLDocument *This = impl_from_IHTMLDocument6(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument6_get_onstorage(IHTMLDocument6 *iface, - VARIANT *p) -{ - HTMLDocument *This = impl_from_IHTMLDocument6(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument6_put_onstorage(IHTMLDocument6 *iface, VARIANT v) -{ - HTMLDocument *This = impl_from_IHTMLDocument6(iface); - FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument6_get_onstoragecommit(IHTMLDocument6 *iface, - VARIANT *p) -{ - HTMLDocument *This = impl_from_IHTMLDocument6(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument6_put_onstoragecommit(IHTMLDocument6 *iface, VARIANT v) -{ - HTMLDocument *This = impl_from_IHTMLDocument6(iface); - FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument6_getElementById(IHTMLDocument6 *iface, - BSTR bstrId, IHTMLElement2 **p) -{ - HTMLDocument *This = impl_from_IHTMLDocument6(iface); - FIXME("(%p)->(%s %p)\n", This, debugstr_w(bstrId), p); - return E_NOTIMPL; -} - -static HRESULT WINAPI HTMLDocument6_updateSettings(IHTMLDocument6 *iface) -{ - HTMLDocument *This = impl_from_IHTMLDocument6(iface); - FIXME("(%p)->()\n", This); - return E_NOTIMPL; -} - -static const IHTMLDocument6Vtbl HTMLDocument6Vtbl = { - HTMLDocument6_QueryInterface, - HTMLDocument6_AddRef, - HTMLDocument6_Release, - HTMLDocument6_GetTypeInfoCount, - HTMLDocument6_GetTypeInfo, - HTMLDocument6_GetIDsOfNames, - HTMLDocument6_Invoke, - HTMLDocument6_get_compatible, - HTMLDocument6_get_documentMode, - HTMLDocument6_put_onstorage, - HTMLDocument6_get_onstorage, - HTMLDocument6_put_onstoragecommit, - HTMLDocument6_get_onstoragecommit, - HTMLDocument6_getElementById, - HTMLDocument6_updateSettings -}; - -void HTMLDocument_HTMLDocument5_Init(HTMLDocument *This) -{ - This->IHTMLDocument5_iface.lpVtbl = &HTMLDocument5Vtbl; - This->IHTMLDocument6_iface.lpVtbl = &HTMLDocument6Vtbl; -} diff -Nru wine1.7-1.7.14/dlls/mshtml/htmldoc.c wine1.7-1.7.18/dlls/mshtml/htmldoc.c --- wine1.7-1.7.14/dlls/mshtml/htmldoc.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/mshtml/htmldoc.c 2014-05-02 18:15:48.000000000 +0000 @@ -41,6 +41,79 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml); +HRESULT get_doc_elem_by_id(HTMLDocumentNode *doc, const WCHAR *id, HTMLElement **ret) +{ + nsIDOMNodeList *nsnode_list; + nsIDOMElement *nselem; + nsIDOMNode *nsnode; + nsAString id_str; + nsresult nsres; + HRESULT hres; + + if(!doc->nsdoc) { + WARN("NULL nsdoc\n"); + return E_UNEXPECTED; + } + + nsAString_InitDepend(&id_str, id); + /* get element by id attribute */ + nsres = nsIDOMHTMLDocument_GetElementById(doc->nsdoc, &id_str, &nselem); + if(FAILED(nsres)) { + ERR("GetElementById failed: %08x\n", nsres); + nsAString_Finish(&id_str); + return E_FAIL; + } + + /* get first element by name attribute */ + nsres = nsIDOMHTMLDocument_GetElementsByName(doc->nsdoc, &id_str, &nsnode_list); + nsAString_Finish(&id_str); + if(FAILED(nsres)) { + ERR("getElementsByName failed: %08x\n", nsres); + if(nselem) + nsIDOMElement_Release(nselem); + return E_FAIL; + } + + nsres = nsIDOMNodeList_Item(nsnode_list, 0, &nsnode); + nsIDOMNodeList_Release(nsnode_list); + assert(nsres == NS_OK); + + if(nsnode && nselem) { + UINT16 pos; + + nsres = nsIDOMNode_CompareDocumentPosition(nsnode, (nsIDOMNode*)nselem, &pos); + if(NS_FAILED(nsres)) { + FIXME("CompareDocumentPosition failed: 0x%08x\n", nsres); + nsIDOMNode_Release(nsnode); + nsIDOMElement_Release(nselem); + return E_FAIL; + } + + TRACE("CompareDocumentPosition gave: 0x%x\n", pos); + if(!(pos & (DOCUMENT_POSITION_PRECEDING | DOCUMENT_POSITION_CONTAINS))) { + nsIDOMElement_Release(nselem); + nselem = NULL; + } + } + + if(nsnode) { + if(!nselem) { + nsres = nsIDOMNode_QueryInterface(nsnode, &IID_nsIDOMElement, (void**)&nselem); + assert(nsres == NS_OK); + } + nsIDOMNode_Release(nsnode); + } + + if(!nselem) { + *ret = NULL; + return S_OK; + } + + hres = get_elem(doc, nselem, ret); + nsIDOMElement_Release(nselem); + return hres; +} + static inline HTMLDocument *impl_from_IHTMLDocument2(IHTMLDocument2 *iface) { return CONTAINING_RECORD(iface, HTMLDocument, IHTMLDocument2_iface); @@ -1683,220 +1756,2295 @@ HTMLDocument_createStyleSheet }; -static void HTMLDocument_on_advise(IUnknown *iface, cp_static_data_t *cp) +static inline HTMLDocument *impl_from_IHTMLDocument3(IHTMLDocument3 *iface) { - HTMLDocument *This = impl_from_IHTMLDocument2((IHTMLDocument2*)iface); + return CONTAINING_RECORD(iface, HTMLDocument, IHTMLDocument3_iface); +} - if(This->window) - update_cp_events(This->window->base.inner_window, &This->doc_node->node.event_target, cp, This->doc_node->node.nsnode); +static HRESULT WINAPI HTMLDocument3_QueryInterface(IHTMLDocument3 *iface, + REFIID riid, void **ppv) +{ + HTMLDocument *This = impl_from_IHTMLDocument3(iface); + return htmldoc_query_interface(This, riid, ppv); } -static inline HTMLDocument *impl_from_ISupportErrorInfo(ISupportErrorInfo *iface) +static ULONG WINAPI HTMLDocument3_AddRef(IHTMLDocument3 *iface) { - return CONTAINING_RECORD(iface, HTMLDocument, ISupportErrorInfo_iface); + HTMLDocument *This = impl_from_IHTMLDocument3(iface); + return htmldoc_addref(This); } -static HRESULT WINAPI SupportErrorInfo_QueryInterface(ISupportErrorInfo *iface, REFIID riid, void **ppv) +static ULONG WINAPI HTMLDocument3_Release(IHTMLDocument3 *iface) { - HTMLDocument *This = impl_from_ISupportErrorInfo(iface); - return htmldoc_query_interface(This, riid, ppv); + HTMLDocument *This = impl_from_IHTMLDocument3(iface); + return htmldoc_release(This); } -static ULONG WINAPI SupportErrorInfo_AddRef(ISupportErrorInfo *iface) +static HRESULT WINAPI HTMLDocument3_GetTypeInfoCount(IHTMLDocument3 *iface, UINT *pctinfo) { - HTMLDocument *This = impl_from_ISupportErrorInfo(iface); - return htmldoc_addref(This); + HTMLDocument *This = impl_from_IHTMLDocument3(iface); + return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo); } -static ULONG WINAPI SupportErrorInfo_Release(ISupportErrorInfo *iface) +static HRESULT WINAPI HTMLDocument3_GetTypeInfo(IHTMLDocument3 *iface, UINT iTInfo, + LCID lcid, ITypeInfo **ppTInfo) { - HTMLDocument *This = impl_from_ISupportErrorInfo(iface); - return htmldoc_release(This); + HTMLDocument *This = impl_from_IHTMLDocument3(iface); + return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo); } -static HRESULT WINAPI SupportErrorInfo_InterfaceSupportsErrorInfo(ISupportErrorInfo *iface, REFIID riid) +static HRESULT WINAPI HTMLDocument3_GetIDsOfNames(IHTMLDocument3 *iface, REFIID riid, + LPOLESTR *rgszNames, UINT cNames, + LCID lcid, DISPID *rgDispId) { - FIXME("(%p)->(%s)\n", iface, debugstr_guid(riid)); - return S_FALSE; + HTMLDocument *This = impl_from_IHTMLDocument3(iface); + return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid, + rgDispId); } -static const ISupportErrorInfoVtbl SupportErrorInfoVtbl = { - SupportErrorInfo_QueryInterface, - SupportErrorInfo_AddRef, - SupportErrorInfo_Release, - SupportErrorInfo_InterfaceSupportsErrorInfo -}; +static HRESULT WINAPI HTMLDocument3_Invoke(IHTMLDocument3 *iface, DISPID dispIdMember, + REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, + VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) +{ + HTMLDocument *This = impl_from_IHTMLDocument3(iface); + return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, + pDispParams, pVarResult, pExcepInfo, puArgErr); +} -static inline HTMLDocument *impl_from_IDispatchEx(IDispatchEx *iface) +static HRESULT WINAPI HTMLDocument3_releaseCapture(IHTMLDocument3 *iface) { - return CONTAINING_RECORD(iface, HTMLDocument, IDispatchEx_iface); + HTMLDocument *This = impl_from_IHTMLDocument3(iface); + FIXME("(%p)\n", This); + return E_NOTIMPL; } -static HRESULT dispid_from_elem_name(HTMLDocumentNode *This, BSTR name, DISPID *dispid) +static HRESULT WINAPI HTMLDocument3_recalc(IHTMLDocument3 *iface, VARIANT_BOOL fForce) { - nsIDOMNodeList *node_list; - nsAString name_str; - UINT32 len; - unsigned i; + HTMLDocument *This = impl_from_IHTMLDocument3(iface); + FIXME("(%p)->(%x)\n", This, fForce); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument3_createTextNode(IHTMLDocument3 *iface, BSTR text, + IHTMLDOMNode **newTextNode) +{ + HTMLDocument *This = impl_from_IHTMLDocument3(iface); + nsIDOMText *nstext; + HTMLDOMNode *node; + nsAString text_str; nsresult nsres; + HRESULT hres; - if(!This->nsdoc) - return DISP_E_UNKNOWNNAME; + TRACE("(%p)->(%s %p)\n", This, debugstr_w(text), newTextNode); - nsAString_InitDepend(&name_str, name); - nsres = nsIDOMHTMLDocument_GetElementsByName(This->nsdoc, &name_str, &node_list); - nsAString_Finish(&name_str); - if(NS_FAILED(nsres)) - return E_FAIL; + if(!This->doc_node->nsdoc) { + WARN("NULL nsdoc\n"); + return E_UNEXPECTED; + } - nsres = nsIDOMNodeList_GetLength(node_list, &len); - nsIDOMNodeList_Release(node_list); - if(NS_FAILED(nsres)) + nsAString_InitDepend(&text_str, text); + nsres = nsIDOMHTMLDocument_CreateTextNode(This->doc_node->nsdoc, &text_str, &nstext); + nsAString_Finish(&text_str); + if(NS_FAILED(nsres)) { + ERR("CreateTextNode failed: %08x\n", nsres); return E_FAIL; + } - if(!len) - return DISP_E_UNKNOWNNAME; + hres = HTMLDOMTextNode_Create(This->doc_node, (nsIDOMNode*)nstext, &node); + nsIDOMText_Release(nstext); + if(FAILED(hres)) + return hres; - for(i=0; i < This->elem_vars_cnt; i++) { - if(!strcmpW(name, This->elem_vars[i])) { - *dispid = MSHTML_DISPID_CUSTOM_MIN+i; - return S_OK; - } + *newTextNode = &node->IHTMLDOMNode_iface; + return S_OK; +} + +static HRESULT WINAPI HTMLDocument3_get_documentElement(IHTMLDocument3 *iface, IHTMLElement **p) +{ + HTMLDocument *This = impl_from_IHTMLDocument3(iface); + nsIDOMElement *nselem = NULL; + HTMLDOMNode *node; + nsresult nsres; + HRESULT hres; + + TRACE("(%p)->(%p)\n", This, p); + + if(This->window->readystate == READYSTATE_UNINITIALIZED) { + *p = NULL; + return S_OK; } - if(This->elem_vars_cnt == This->elem_vars_size) { - WCHAR **new_vars; + if(!This->doc_node->nsdoc) { + WARN("NULL nsdoc\n"); + return E_UNEXPECTED; + } - if(This->elem_vars_size) { - new_vars = heap_realloc(This->elem_vars, This->elem_vars_size*2*sizeof(WCHAR*)); - if(!new_vars) - return E_OUTOFMEMORY; - This->elem_vars_size *= 2; - }else { - new_vars = heap_alloc(16*sizeof(WCHAR*)); - if(!new_vars) - return E_OUTOFMEMORY; - This->elem_vars_size = 16; - } + nsres = nsIDOMHTMLDocument_GetDocumentElement(This->doc_node->nsdoc, &nselem); + if(NS_FAILED(nsres)) { + ERR("GetDocumentElement failed: %08x\n", nsres); + return E_FAIL; + } - This->elem_vars = new_vars; + if(!nselem) { + *p = NULL; + return S_OK; } - This->elem_vars[This->elem_vars_cnt] = heap_strdupW(name); - if(!This->elem_vars[This->elem_vars_cnt]) - return E_OUTOFMEMORY; + hres = get_node(This->doc_node, (nsIDOMNode *)nselem, TRUE, &node); + nsIDOMElement_Release(nselem); + if(FAILED(hres)) + return hres; - *dispid = MSHTML_DISPID_CUSTOM_MIN+This->elem_vars_cnt++; - return S_OK; + hres = IHTMLDOMNode_QueryInterface(&node->IHTMLDOMNode_iface, &IID_IHTMLElement, (void**)p); + node_release(node); + return hres; } -static HRESULT WINAPI DocDispatchEx_QueryInterface(IDispatchEx *iface, REFIID riid, void **ppv) +static HRESULT WINAPI HTMLDocument3_uniqueID(IHTMLDocument3 *iface, BSTR *p) { - HTMLDocument *This = impl_from_IDispatchEx(iface); - - return htmldoc_query_interface(This, riid, ppv); + HTMLDocument *This = impl_from_IHTMLDocument3(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; } -static ULONG WINAPI DocDispatchEx_AddRef(IDispatchEx *iface) +static HRESULT WINAPI HTMLDocument3_attachEvent(IHTMLDocument3 *iface, BSTR event, + IDispatch* pDisp, VARIANT_BOOL *pfResult) { - HTMLDocument *This = impl_from_IDispatchEx(iface); + HTMLDocument *This = impl_from_IHTMLDocument3(iface); - return htmldoc_addref(This); + TRACE("(%p)->(%s %p %p)\n", This, debugstr_w(event), pDisp, pfResult); + + return attach_event(&This->doc_node->node.event_target, This, event, pDisp, pfResult); } -static ULONG WINAPI DocDispatchEx_Release(IDispatchEx *iface) +static HRESULT WINAPI HTMLDocument3_detachEvent(IHTMLDocument3 *iface, BSTR event, + IDispatch *pDisp) { - HTMLDocument *This = impl_from_IDispatchEx(iface); + HTMLDocument *This = impl_from_IHTMLDocument3(iface); - return htmldoc_release(This); + TRACE("(%p)->(%s %p)\n", This, debugstr_w(event), pDisp); + + return detach_event(This->doc_node->node.event_target, This, event, pDisp); } -static HRESULT WINAPI DocDispatchEx_GetTypeInfoCount(IDispatchEx *iface, UINT *pctinfo) +static HRESULT WINAPI HTMLDocument3_put_onrowsdelete(IHTMLDocument3 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IDispatchEx(iface); - - return IDispatchEx_GetTypeInfoCount(This->dispex, pctinfo); + HTMLDocument *This = impl_from_IHTMLDocument3(iface); + FIXME("(%p)->()\n", This); + return E_NOTIMPL; } -static HRESULT WINAPI DocDispatchEx_GetTypeInfo(IDispatchEx *iface, UINT iTInfo, - LCID lcid, ITypeInfo **ppTInfo) +static HRESULT WINAPI HTMLDocument3_get_onrowsdelete(IHTMLDocument3 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IDispatchEx(iface); - - return IDispatchEx_GetTypeInfo(This->dispex, iTInfo, lcid, ppTInfo); + HTMLDocument *This = impl_from_IHTMLDocument3(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; } -static HRESULT WINAPI DocDispatchEx_GetIDsOfNames(IDispatchEx *iface, REFIID riid, - LPOLESTR *rgszNames, UINT cNames, - LCID lcid, DISPID *rgDispId) +static HRESULT WINAPI HTMLDocument3_put_onrowsinserted(IHTMLDocument3 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IDispatchEx(iface); - - return IDispatchEx_GetIDsOfNames(This->dispex, riid, rgszNames, cNames, lcid, rgDispId); + HTMLDocument *This = impl_from_IHTMLDocument3(iface); + FIXME("(%p)->()\n", This); + return E_NOTIMPL; } -static HRESULT WINAPI DocDispatchEx_Invoke(IDispatchEx *iface, DISPID dispIdMember, - REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, - VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) +static HRESULT WINAPI HTMLDocument3_get_onrowsinserted(IHTMLDocument3 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IDispatchEx(iface); - - TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid), - lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); - - switch(dispIdMember) { - case DISPID_READYSTATE: - TRACE("DISPID_READYSTATE\n"); - - if(!(wFlags & DISPATCH_PROPERTYGET)) - return E_INVALIDARG; - - V_VT(pVarResult) = VT_I4; - V_I4(pVarResult) = This->window->readystate; - return S_OK; - } - - return IDispatchEx_Invoke(This->dispex, dispIdMember, riid, lcid, wFlags, pDispParams, - pVarResult, pExcepInfo, puArgErr); + HTMLDocument *This = impl_from_IHTMLDocument3(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; } -static HRESULT WINAPI DocDispatchEx_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid) +static HRESULT WINAPI HTMLDocument3_put_oncellchange(IHTMLDocument3 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IDispatchEx(iface); - HRESULT hres; - - hres = IDispatchEx_GetDispID(This->dispex, bstrName, grfdex, pid); - if(hres != DISP_E_UNKNOWNNAME) - return hres; - - return dispid_from_elem_name(This->doc_node, bstrName, pid); + HTMLDocument *This = impl_from_IHTMLDocument3(iface); + FIXME("(%p)->()\n", This); + return E_NOTIMPL; } -static HRESULT WINAPI DocDispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, - VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller) +static HRESULT WINAPI HTMLDocument3_get_oncellchange(IHTMLDocument3 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IDispatchEx(iface); - - if(This->window && id == DISPID_IHTMLDOCUMENT2_LOCATION && (wFlags & DISPATCH_PROPERTYPUT)) - return IDispatchEx_InvokeEx(&This->window->base.IDispatchEx_iface, DISPID_IHTMLWINDOW2_LOCATION, - lcid, wFlags, pdp, pvarRes, pei, pspCaller); - - - return IDispatchEx_InvokeEx(This->dispex, id, lcid, wFlags, pdp, pvarRes, pei, pspCaller); + HTMLDocument *This = impl_from_IHTMLDocument3(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; } -static HRESULT WINAPI DocDispatchEx_DeleteMemberByName(IDispatchEx *iface, BSTR bstrName, DWORD grfdex) +static HRESULT WINAPI HTMLDocument3_put_ondatasetchanged(IHTMLDocument3 *iface, VARIANT v) { - HTMLDocument *This = impl_from_IDispatchEx(iface); - - return IDispatchEx_DeleteMemberByName(This->dispex, bstrName, grfdex); + HTMLDocument *This = impl_from_IHTMLDocument3(iface); + FIXME("(%p)->()\n", This); + return E_NOTIMPL; } -static HRESULT WINAPI DocDispatchEx_DeleteMemberByDispID(IDispatchEx *iface, DISPID id) +static HRESULT WINAPI HTMLDocument3_get_ondatasetchanged(IHTMLDocument3 *iface, VARIANT *p) { - HTMLDocument *This = impl_from_IDispatchEx(iface); - - return IDispatchEx_DeleteMemberByDispID(This->dispex, id); + HTMLDocument *This = impl_from_IHTMLDocument3(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument3_put_ondataavailable(IHTMLDocument3 *iface, VARIANT v) +{ + HTMLDocument *This = impl_from_IHTMLDocument3(iface); + FIXME("(%p)->()\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument3_get_ondataavailable(IHTMLDocument3 *iface, VARIANT *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument3(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument3_put_ondatasetcomplete(IHTMLDocument3 *iface, VARIANT v) +{ + HTMLDocument *This = impl_from_IHTMLDocument3(iface); + FIXME("(%p)->()\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument3_get_ondatasetcomplete(IHTMLDocument3 *iface, VARIANT *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument3(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument3_put_onpropertychange(IHTMLDocument3 *iface, VARIANT v) +{ + HTMLDocument *This = impl_from_IHTMLDocument3(iface); + FIXME("(%p)->()\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument3_get_onpropertychange(IHTMLDocument3 *iface, VARIANT *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument3(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument3_put_dir(IHTMLDocument3 *iface, BSTR v) +{ + HTMLDocument *This = impl_from_IHTMLDocument3(iface); + FIXME("(%p)->(%s)\n", This, debugstr_w(v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument3_get_dir(IHTMLDocument3 *iface, BSTR *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument3(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument3_put_oncontextmenu(IHTMLDocument3 *iface, VARIANT v) +{ + HTMLDocument *This = impl_from_IHTMLDocument3(iface); + + TRACE("(%p)->()\n", This); + + return set_doc_event(This, EVENTID_CONTEXTMENU, &v); +} + +static HRESULT WINAPI HTMLDocument3_get_oncontextmenu(IHTMLDocument3 *iface, VARIANT *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument3(iface); + + TRACE("(%p)->(%p)\n", This, p); + + return get_doc_event(This, EVENTID_CONTEXTMENU, p); +} + +static HRESULT WINAPI HTMLDocument3_put_onstop(IHTMLDocument3 *iface, VARIANT v) +{ + HTMLDocument *This = impl_from_IHTMLDocument3(iface); + FIXME("(%p)->()\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument3_get_onstop(IHTMLDocument3 *iface, VARIANT *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument3(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument3_createDocumentFragment(IHTMLDocument3 *iface, + IHTMLDocument2 **ppNewDoc) +{ + HTMLDocument *This = impl_from_IHTMLDocument3(iface); + nsIDOMDocumentFragment *doc_frag; + HTMLDocumentNode *docnode; + nsresult nsres; + HRESULT hres; + + TRACE("(%p)->(%p)\n", This, ppNewDoc); + + if(!This->doc_node->nsdoc) { + FIXME("NULL nsdoc\n"); + return E_NOTIMPL; + } + + nsres = nsIDOMHTMLDocument_CreateDocumentFragment(This->doc_node->nsdoc, &doc_frag); + if(NS_FAILED(nsres)) { + ERR("CreateDocumentFragment failed: %08x\n", nsres); + return E_FAIL; + } + + hres = create_document_fragment((nsIDOMNode*)doc_frag, This->doc_node, &docnode); + nsIDOMDocumentFragment_Release(doc_frag); + if(FAILED(hres)) + return hres; + + *ppNewDoc = &docnode->basedoc.IHTMLDocument2_iface; + return S_OK; +} + +static HRESULT WINAPI HTMLDocument3_get_parentDocument(IHTMLDocument3 *iface, + IHTMLDocument2 **p) +{ + HTMLDocument *This = impl_from_IHTMLDocument3(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument3_put_enableDownload(IHTMLDocument3 *iface, + VARIANT_BOOL v) +{ + HTMLDocument *This = impl_from_IHTMLDocument3(iface); + FIXME("(%p)->(%x)\n", This, v); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument3_get_enableDownload(IHTMLDocument3 *iface, + VARIANT_BOOL *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument3(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument3_put_baseUrl(IHTMLDocument3 *iface, BSTR v) +{ + HTMLDocument *This = impl_from_IHTMLDocument3(iface); + FIXME("(%p)->(%s)\n", This, debugstr_w(v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument3_get_baseUrl(IHTMLDocument3 *iface, BSTR *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument3(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument3_get_childNodes(IHTMLDocument3 *iface, IDispatch **p) +{ + HTMLDocument *This = impl_from_IHTMLDocument3(iface); + + TRACE("(%p)->(%p)\n", This, p); + + return IHTMLDOMNode_get_childNodes(&This->doc_node->node.IHTMLDOMNode_iface, p); +} + +static HRESULT WINAPI HTMLDocument3_put_inheritStyleSheets(IHTMLDocument3 *iface, + VARIANT_BOOL v) +{ + HTMLDocument *This = impl_from_IHTMLDocument3(iface); + FIXME("(%p)->()\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument3_get_inheritStyleSheets(IHTMLDocument3 *iface, + VARIANT_BOOL *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument3(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument3_put_onbeforeeditfocus(IHTMLDocument3 *iface, VARIANT v) +{ + HTMLDocument *This = impl_from_IHTMLDocument3(iface); + FIXME("(%p)->()\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument3_get_onbeforeeditfocus(IHTMLDocument3 *iface, VARIANT *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument3(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument3_getElementsByName(IHTMLDocument3 *iface, BSTR v, + IHTMLElementCollection **ppelColl) +{ + HTMLDocument *This = impl_from_IHTMLDocument3(iface); + nsIDOMNodeList *node_list; + nsAString selector_str; + WCHAR *selector; + nsresult nsres; + + static const WCHAR formatW[] = {'*','[','i','d','=','%','s',']',',','*','[','n','a','m','e','=','%','s',']',0}; + + TRACE("(%p)->(%s %p)\n", This, debugstr_w(v), ppelColl); + + if(!This->doc_node || !This->doc_node->nsdoc) { + /* We should probably return an empty collection. */ + FIXME("No nsdoc\n"); + return E_NOTIMPL; + } + + selector = heap_alloc(2*SysStringLen(v)*sizeof(WCHAR) + sizeof(formatW)); + if(!selector) + return E_OUTOFMEMORY; + sprintfW(selector, formatW, v, v); + + /* + * NOTE: IE getElementsByName implementation differs from Gecko. It searches both name and id attributes. + * That's why we use CSS selector instead. We should also use name only when it applies to given element + * types and search should be case insensitive. Those are currently not supported properly. + */ + nsAString_InitDepend(&selector_str, selector); + nsres = nsIDOMNodeSelector_QuerySelectorAll(This->doc_node->nsnode_selector, &selector_str, &node_list); + nsAString_Finish(&selector_str); + heap_free(selector); + if(NS_FAILED(nsres)) { + ERR("QuerySelectorAll failed: %08x\n", nsres); + return E_FAIL; + } + + *ppelColl = create_collection_from_nodelist(This->doc_node, node_list); + nsIDOMNodeList_Release(node_list); + return S_OK; +} + + +static HRESULT WINAPI HTMLDocument3_getElementById(IHTMLDocument3 *iface, BSTR v, + IHTMLElement **pel) +{ + HTMLDocument *This = impl_from_IHTMLDocument3(iface); + HTMLElement *elem; + HRESULT hres; + + TRACE("(%p)->(%s %p)\n", This, debugstr_w(v), pel); + + hres = get_doc_elem_by_id(This->doc_node, v, &elem); + if(FAILED(hres) || !elem) { + *pel = NULL; + return hres; + } + + *pel = &elem->IHTMLElement_iface; + return S_OK; +} + + +static HRESULT WINAPI HTMLDocument3_getElementsByTagName(IHTMLDocument3 *iface, BSTR v, + IHTMLElementCollection **pelColl) +{ + HTMLDocument *This = impl_from_IHTMLDocument3(iface); + nsIDOMNodeList *nslist; + nsAString id_str; + nsresult nsres; + + TRACE("(%p)->(%s %p)\n", This, debugstr_w(v), pelColl); + + if(!This->doc_node->nsdoc) { + WARN("NULL nsdoc\n"); + return E_UNEXPECTED; + } + + nsAString_InitDepend(&id_str, v); + nsres = nsIDOMHTMLDocument_GetElementsByTagName(This->doc_node->nsdoc, &id_str, &nslist); + nsAString_Finish(&id_str); + if(FAILED(nsres)) { + ERR("GetElementByName failed: %08x\n", nsres); + return E_FAIL; + } + + *pelColl = create_collection_from_nodelist(This->doc_node, nslist); + nsIDOMNodeList_Release(nslist); + + return S_OK; +} + +static const IHTMLDocument3Vtbl HTMLDocument3Vtbl = { + HTMLDocument3_QueryInterface, + HTMLDocument3_AddRef, + HTMLDocument3_Release, + HTMLDocument3_GetTypeInfoCount, + HTMLDocument3_GetTypeInfo, + HTMLDocument3_GetIDsOfNames, + HTMLDocument3_Invoke, + HTMLDocument3_releaseCapture, + HTMLDocument3_recalc, + HTMLDocument3_createTextNode, + HTMLDocument3_get_documentElement, + HTMLDocument3_uniqueID, + HTMLDocument3_attachEvent, + HTMLDocument3_detachEvent, + HTMLDocument3_put_onrowsdelete, + HTMLDocument3_get_onrowsdelete, + HTMLDocument3_put_onrowsinserted, + HTMLDocument3_get_onrowsinserted, + HTMLDocument3_put_oncellchange, + HTMLDocument3_get_oncellchange, + HTMLDocument3_put_ondatasetchanged, + HTMLDocument3_get_ondatasetchanged, + HTMLDocument3_put_ondataavailable, + HTMLDocument3_get_ondataavailable, + HTMLDocument3_put_ondatasetcomplete, + HTMLDocument3_get_ondatasetcomplete, + HTMLDocument3_put_onpropertychange, + HTMLDocument3_get_onpropertychange, + HTMLDocument3_put_dir, + HTMLDocument3_get_dir, + HTMLDocument3_put_oncontextmenu, + HTMLDocument3_get_oncontextmenu, + HTMLDocument3_put_onstop, + HTMLDocument3_get_onstop, + HTMLDocument3_createDocumentFragment, + HTMLDocument3_get_parentDocument, + HTMLDocument3_put_enableDownload, + HTMLDocument3_get_enableDownload, + HTMLDocument3_put_baseUrl, + HTMLDocument3_get_baseUrl, + HTMLDocument3_get_childNodes, + HTMLDocument3_put_inheritStyleSheets, + HTMLDocument3_get_inheritStyleSheets, + HTMLDocument3_put_onbeforeeditfocus, + HTMLDocument3_get_onbeforeeditfocus, + HTMLDocument3_getElementsByName, + HTMLDocument3_getElementById, + HTMLDocument3_getElementsByTagName +}; + +static inline HTMLDocument *impl_from_IHTMLDocument4(IHTMLDocument4 *iface) +{ + return CONTAINING_RECORD(iface, HTMLDocument, IHTMLDocument4_iface); +} + +static HRESULT WINAPI HTMLDocument4_QueryInterface(IHTMLDocument4 *iface, + REFIID riid, void **ppv) +{ + HTMLDocument *This = impl_from_IHTMLDocument4(iface); + return htmldoc_query_interface(This, riid, ppv); +} + +static ULONG WINAPI HTMLDocument4_AddRef(IHTMLDocument4 *iface) +{ + HTMLDocument *This = impl_from_IHTMLDocument4(iface); + return htmldoc_addref(This); +} + +static ULONG WINAPI HTMLDocument4_Release(IHTMLDocument4 *iface) +{ + HTMLDocument *This = impl_from_IHTMLDocument4(iface); + return htmldoc_release(This); +} + +static HRESULT WINAPI HTMLDocument4_GetTypeInfoCount(IHTMLDocument4 *iface, UINT *pctinfo) +{ + HTMLDocument *This = impl_from_IHTMLDocument4(iface); + return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo); +} + +static HRESULT WINAPI HTMLDocument4_GetTypeInfo(IHTMLDocument4 *iface, UINT iTInfo, + LCID lcid, ITypeInfo **ppTInfo) +{ + HTMLDocument *This = impl_from_IHTMLDocument4(iface); + return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo); +} + +static HRESULT WINAPI HTMLDocument4_GetIDsOfNames(IHTMLDocument4 *iface, REFIID riid, + LPOLESTR *rgszNames, UINT cNames, + LCID lcid, DISPID *rgDispId) +{ + HTMLDocument *This = impl_from_IHTMLDocument4(iface); + return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid, + rgDispId); +} + +static HRESULT WINAPI HTMLDocument4_Invoke(IHTMLDocument4 *iface, DISPID dispIdMember, + REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, + VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) +{ + HTMLDocument *This = impl_from_IHTMLDocument4(iface); + return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, + pDispParams, pVarResult, pExcepInfo, puArgErr); +} + +static HRESULT WINAPI HTMLDocument4_focus(IHTMLDocument4 *iface) +{ + HTMLDocument *This = impl_from_IHTMLDocument4(iface); + nsIDOMHTMLElement *nsbody; + nsresult nsres; + + TRACE("(%p)->()\n", This); + + nsres = nsIDOMHTMLDocument_GetBody(This->doc_node->nsdoc, &nsbody); + if(NS_FAILED(nsres) || !nsbody) { + ERR("GetBody failed: %08x\n", nsres); + return E_FAIL; + } + + nsres = nsIDOMHTMLElement_Focus(nsbody); + nsIDOMHTMLElement_Release(nsbody); + if(NS_FAILED(nsres)) { + ERR("Focus failed: %08x\n", nsres); + return E_FAIL; + } + + return S_OK; +} + +static HRESULT WINAPI HTMLDocument4_hasFocus(IHTMLDocument4 *iface, VARIANT_BOOL *pfFocus) +{ + HTMLDocument *This = impl_from_IHTMLDocument4(iface); + FIXME("(%p)->(%p)\n", This, pfFocus); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument4_put_onselectionchange(IHTMLDocument4 *iface, VARIANT v) +{ + HTMLDocument *This = impl_from_IHTMLDocument4(iface); + FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument4_get_onselectionchange(IHTMLDocument4 *iface, VARIANT *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument4(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument4_get_namespace(IHTMLDocument4 *iface, IDispatch **p) +{ + HTMLDocument *This = impl_from_IHTMLDocument4(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument4_createDocumentFromUrl(IHTMLDocument4 *iface, BSTR bstrUrl, + BSTR bstrOptions, IHTMLDocument2 **newDoc) +{ + HTMLDocument *This = impl_from_IHTMLDocument4(iface); + FIXME("(%p)->(%s %s %p)\n", This, debugstr_w(bstrUrl), debugstr_w(bstrOptions), newDoc); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument4_put_media(IHTMLDocument4 *iface, BSTR v) +{ + HTMLDocument *This = impl_from_IHTMLDocument4(iface); + FIXME("(%p)->(%s)\n", This, debugstr_w(v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument4_get_media(IHTMLDocument4 *iface, BSTR *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument4(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument4_createEventObject(IHTMLDocument4 *iface, + VARIANT *pvarEventObject, IHTMLEventObj **ppEventObj) +{ + HTMLDocument *This = impl_from_IHTMLDocument4(iface); + + TRACE("(%p)->(%s %p)\n", This, debugstr_variant(pvarEventObject), ppEventObj); + + if(pvarEventObject && V_VT(pvarEventObject) != VT_ERROR && V_VT(pvarEventObject) != VT_EMPTY) { + FIXME("unsupported pvarEventObject %s\n", debugstr_variant(pvarEventObject)); + return E_NOTIMPL; + } + + return create_event_obj(ppEventObj); +} + +static HRESULT WINAPI HTMLDocument4_fireEvent(IHTMLDocument4 *iface, BSTR bstrEventName, + VARIANT *pvarEventObject, VARIANT_BOOL *pfCanceled) +{ + HTMLDocument *This = impl_from_IHTMLDocument4(iface); + + TRACE("(%p)->(%s %p %p)\n", This, debugstr_w(bstrEventName), pvarEventObject, pfCanceled); + + return dispatch_event(&This->doc_node->node, bstrEventName, pvarEventObject, pfCanceled); +} + +static HRESULT WINAPI HTMLDocument4_createRenderStyle(IHTMLDocument4 *iface, BSTR v, + IHTMLRenderStyle **ppIHTMLRenderStyle) +{ + HTMLDocument *This = impl_from_IHTMLDocument4(iface); + FIXME("(%p)->(%s %p)\n", This, debugstr_w(v), ppIHTMLRenderStyle); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument4_put_oncontrolselect(IHTMLDocument4 *iface, VARIANT v) +{ + HTMLDocument *This = impl_from_IHTMLDocument4(iface); + FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument4_get_oncontrolselect(IHTMLDocument4 *iface, VARIANT *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument4(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument4_get_URLEncoded(IHTMLDocument4 *iface, BSTR *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument4(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static const IHTMLDocument4Vtbl HTMLDocument4Vtbl = { + HTMLDocument4_QueryInterface, + HTMLDocument4_AddRef, + HTMLDocument4_Release, + HTMLDocument4_GetTypeInfoCount, + HTMLDocument4_GetTypeInfo, + HTMLDocument4_GetIDsOfNames, + HTMLDocument4_Invoke, + HTMLDocument4_focus, + HTMLDocument4_hasFocus, + HTMLDocument4_put_onselectionchange, + HTMLDocument4_get_onselectionchange, + HTMLDocument4_get_namespace, + HTMLDocument4_createDocumentFromUrl, + HTMLDocument4_put_media, + HTMLDocument4_get_media, + HTMLDocument4_createEventObject, + HTMLDocument4_fireEvent, + HTMLDocument4_createRenderStyle, + HTMLDocument4_put_oncontrolselect, + HTMLDocument4_get_oncontrolselect, + HTMLDocument4_get_URLEncoded +}; + +static inline HTMLDocument *impl_from_IHTMLDocument5(IHTMLDocument5 *iface) +{ + return CONTAINING_RECORD(iface, HTMLDocument, IHTMLDocument5_iface); +} + +static HRESULT WINAPI HTMLDocument5_QueryInterface(IHTMLDocument5 *iface, + REFIID riid, void **ppv) +{ + HTMLDocument *This = impl_from_IHTMLDocument5(iface); + return htmldoc_query_interface(This, riid, ppv); +} + +static ULONG WINAPI HTMLDocument5_AddRef(IHTMLDocument5 *iface) +{ + HTMLDocument *This = impl_from_IHTMLDocument5(iface); + return htmldoc_addref(This); +} + +static ULONG WINAPI HTMLDocument5_Release(IHTMLDocument5 *iface) +{ + HTMLDocument *This = impl_from_IHTMLDocument5(iface); + return htmldoc_release(This); +} + +static HRESULT WINAPI HTMLDocument5_GetTypeInfoCount(IHTMLDocument5 *iface, UINT *pctinfo) +{ + HTMLDocument *This = impl_from_IHTMLDocument5(iface); + return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo); +} + +static HRESULT WINAPI HTMLDocument5_GetTypeInfo(IHTMLDocument5 *iface, UINT iTInfo, + LCID lcid, ITypeInfo **ppTInfo) +{ + HTMLDocument *This = impl_from_IHTMLDocument5(iface); + return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo); +} + +static HRESULT WINAPI HTMLDocument5_GetIDsOfNames(IHTMLDocument5 *iface, REFIID riid, + LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) +{ + HTMLDocument *This = impl_from_IHTMLDocument5(iface); + return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid, + rgDispId); +} + +static HRESULT WINAPI HTMLDocument5_Invoke(IHTMLDocument5 *iface, DISPID dispIdMember, + REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, + VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) +{ + HTMLDocument *This = impl_from_IHTMLDocument5(iface); + return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, + pDispParams, pVarResult, pExcepInfo, puArgErr); +} + +static HRESULT WINAPI HTMLDocument5_put_onmousewheel(IHTMLDocument5 *iface, VARIANT v) +{ + HTMLDocument *This = impl_from_IHTMLDocument5(iface); + FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument5_get_onmousewheel(IHTMLDocument5 *iface, VARIANT *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument5(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument5_get_doctype(IHTMLDocument5 *iface, IHTMLDOMNode **p) +{ + HTMLDocument *This = impl_from_IHTMLDocument5(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument5_get_implementation(IHTMLDocument5 *iface, IHTMLDOMImplementation **p) +{ + HTMLDocument *This = impl_from_IHTMLDocument5(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument5_createAttribute(IHTMLDocument5 *iface, BSTR bstrattrName, + IHTMLDOMAttribute **ppattribute) +{ + HTMLDocument *This = impl_from_IHTMLDocument5(iface); + HTMLDOMAttribute *attr; + HRESULT hres; + + TRACE("(%p)->(%s %p)\n", This, debugstr_w(bstrattrName), ppattribute); + + hres = HTMLDOMAttribute_Create(bstrattrName, NULL, 0, &attr); + if(FAILED(hres)) + return hres; + + *ppattribute = &attr->IHTMLDOMAttribute_iface; + return S_OK; +} + +static HRESULT WINAPI HTMLDocument5_createComment(IHTMLDocument5 *iface, BSTR bstrdata, + IHTMLDOMNode **ppRetNode) +{ + HTMLDocument *This = impl_from_IHTMLDocument5(iface); + nsIDOMComment *nscomment; + HTMLElement *elem; + nsAString str; + nsresult nsres; + HRESULT hres; + + TRACE("(%p)->(%s %p)\n", This, debugstr_w(bstrdata), ppRetNode); + + if(!This->doc_node->nsdoc) { + WARN("NULL nsdoc\n"); + return E_UNEXPECTED; + } + + nsAString_InitDepend(&str, bstrdata); + nsres = nsIDOMHTMLDocument_CreateComment(This->doc_node->nsdoc, &str, &nscomment); + nsAString_Finish(&str); + if(NS_FAILED(nsres)) { + ERR("CreateTextNode failed: %08x\n", nsres); + return E_FAIL; + } + + hres = HTMLCommentElement_Create(This->doc_node, (nsIDOMNode*)nscomment, &elem); + nsIDOMComment_Release(nscomment); + if(FAILED(hres)) + return hres; + + *ppRetNode = &elem->node.IHTMLDOMNode_iface; + return S_OK; +} + +static HRESULT WINAPI HTMLDocument5_put_onfocusin(IHTMLDocument5 *iface, VARIANT v) +{ + HTMLDocument *This = impl_from_IHTMLDocument5(iface); + FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument5_get_onfocusin(IHTMLDocument5 *iface, VARIANT *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument5(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument5_put_onfocusout(IHTMLDocument5 *iface, VARIANT v) +{ + HTMLDocument *This = impl_from_IHTMLDocument5(iface); + FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument5_get_onfocusout(IHTMLDocument5 *iface, VARIANT *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument5(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument5_put_onactivate(IHTMLDocument5 *iface, VARIANT v) +{ + HTMLDocument *This = impl_from_IHTMLDocument5(iface); + FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument5_get_onactivate(IHTMLDocument5 *iface, VARIANT *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument5(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument5_put_ondeactivate(IHTMLDocument5 *iface, VARIANT v) +{ + HTMLDocument *This = impl_from_IHTMLDocument5(iface); + FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument5_get_ondeactivate(IHTMLDocument5 *iface, VARIANT *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument5(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument5_put_onbeforeactivate(IHTMLDocument5 *iface, VARIANT v) +{ + HTMLDocument *This = impl_from_IHTMLDocument5(iface); + FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument5_get_onbeforeactivate(IHTMLDocument5 *iface, VARIANT *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument5(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument5_put_onbeforedeactivate(IHTMLDocument5 *iface, VARIANT v) +{ + HTMLDocument *This = impl_from_IHTMLDocument5(iface); + FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument5_get_onbeforedeactivate(IHTMLDocument5 *iface, VARIANT *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument5(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument5_get_compatMode(IHTMLDocument5 *iface, BSTR *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument5(iface); + nsAString mode_str; + const PRUnichar *mode; + + TRACE("(%p)->(%p)\n", This, p); + + if(!This->doc_node->nsdoc) { + WARN("NULL nsdoc\n"); + return E_UNEXPECTED; + } + + nsAString_Init(&mode_str, NULL); + nsIDOMHTMLDocument_GetCompatMode(This->doc_node->nsdoc, &mode_str); + + nsAString_GetData(&mode_str, &mode); + *p = SysAllocString(mode); + nsAString_Finish(&mode_str); + + return S_OK; +} + +static const IHTMLDocument5Vtbl HTMLDocument5Vtbl = { + HTMLDocument5_QueryInterface, + HTMLDocument5_AddRef, + HTMLDocument5_Release, + HTMLDocument5_GetTypeInfoCount, + HTMLDocument5_GetTypeInfo, + HTMLDocument5_GetIDsOfNames, + HTMLDocument5_Invoke, + HTMLDocument5_put_onmousewheel, + HTMLDocument5_get_onmousewheel, + HTMLDocument5_get_doctype, + HTMLDocument5_get_implementation, + HTMLDocument5_createAttribute, + HTMLDocument5_createComment, + HTMLDocument5_put_onfocusin, + HTMLDocument5_get_onfocusin, + HTMLDocument5_put_onfocusout, + HTMLDocument5_get_onfocusout, + HTMLDocument5_put_onactivate, + HTMLDocument5_get_onactivate, + HTMLDocument5_put_ondeactivate, + HTMLDocument5_get_ondeactivate, + HTMLDocument5_put_onbeforeactivate, + HTMLDocument5_get_onbeforeactivate, + HTMLDocument5_put_onbeforedeactivate, + HTMLDocument5_get_onbeforedeactivate, + HTMLDocument5_get_compatMode +}; + +static inline HTMLDocument *impl_from_IHTMLDocument6(IHTMLDocument6 *iface) +{ + return CONTAINING_RECORD(iface, HTMLDocument, IHTMLDocument6_iface); +} + +static HRESULT WINAPI HTMLDocument6_QueryInterface(IHTMLDocument6 *iface, + REFIID riid, void **ppv) +{ + HTMLDocument *This = impl_from_IHTMLDocument6(iface); + return htmldoc_query_interface(This, riid, ppv); +} + +static ULONG WINAPI HTMLDocument6_AddRef(IHTMLDocument6 *iface) +{ + HTMLDocument *This = impl_from_IHTMLDocument6(iface); + return htmldoc_addref(This); +} + +static ULONG WINAPI HTMLDocument6_Release(IHTMLDocument6 *iface) +{ + HTMLDocument *This = impl_from_IHTMLDocument6(iface); + return htmldoc_release(This); +} + +static HRESULT WINAPI HTMLDocument6_GetTypeInfoCount(IHTMLDocument6 *iface, UINT *pctinfo) +{ + HTMLDocument *This = impl_from_IHTMLDocument6(iface); + return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo); +} + +static HRESULT WINAPI HTMLDocument6_GetTypeInfo(IHTMLDocument6 *iface, UINT iTInfo, + LCID lcid, ITypeInfo **ppTInfo) +{ + HTMLDocument *This = impl_from_IHTMLDocument6(iface); + return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo); +} + +static HRESULT WINAPI HTMLDocument6_GetIDsOfNames(IHTMLDocument6 *iface, REFIID riid, + LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) +{ + HTMLDocument *This = impl_from_IHTMLDocument6(iface); + return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid, + rgDispId); +} + +static HRESULT WINAPI HTMLDocument6_Invoke(IHTMLDocument6 *iface, DISPID dispIdMember, + REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, + VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) +{ + HTMLDocument *This = impl_from_IHTMLDocument6(iface); + return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, + pDispParams, pVarResult, pExcepInfo, puArgErr); +} + +static HRESULT WINAPI HTMLDocument6_get_compatible(IHTMLDocument6 *iface, + IHTMLDocumentCompatibleInfoCollection **p) +{ + HTMLDocument *This = impl_from_IHTMLDocument6(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument6_get_documentMode(IHTMLDocument6 *iface, + VARIANT *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument6(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument6_get_onstorage(IHTMLDocument6 *iface, + VARIANT *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument6(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument6_put_onstorage(IHTMLDocument6 *iface, VARIANT v) +{ + HTMLDocument *This = impl_from_IHTMLDocument6(iface); + FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument6_get_onstoragecommit(IHTMLDocument6 *iface, + VARIANT *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument6(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument6_put_onstoragecommit(IHTMLDocument6 *iface, VARIANT v) +{ + HTMLDocument *This = impl_from_IHTMLDocument6(iface); + FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument6_getElementById(IHTMLDocument6 *iface, + BSTR bstrId, IHTMLElement2 **p) +{ + HTMLDocument *This = impl_from_IHTMLDocument6(iface); + FIXME("(%p)->(%s %p)\n", This, debugstr_w(bstrId), p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument6_updateSettings(IHTMLDocument6 *iface) +{ + HTMLDocument *This = impl_from_IHTMLDocument6(iface); + FIXME("(%p)->()\n", This); + return E_NOTIMPL; +} + +static const IHTMLDocument6Vtbl HTMLDocument6Vtbl = { + HTMLDocument6_QueryInterface, + HTMLDocument6_AddRef, + HTMLDocument6_Release, + HTMLDocument6_GetTypeInfoCount, + HTMLDocument6_GetTypeInfo, + HTMLDocument6_GetIDsOfNames, + HTMLDocument6_Invoke, + HTMLDocument6_get_compatible, + HTMLDocument6_get_documentMode, + HTMLDocument6_put_onstorage, + HTMLDocument6_get_onstorage, + HTMLDocument6_put_onstoragecommit, + HTMLDocument6_get_onstoragecommit, + HTMLDocument6_getElementById, + HTMLDocument6_updateSettings +}; + +static inline HTMLDocument *impl_from_IHTMLDocument7(IHTMLDocument7 *iface) +{ + return CONTAINING_RECORD(iface, HTMLDocument, IHTMLDocument7_iface); +} + +static HRESULT WINAPI HTMLDocument7_QueryInterface(IHTMLDocument7 *iface, REFIID riid, void **ppv) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + return htmldoc_query_interface(This, riid, ppv); +} + +static ULONG WINAPI HTMLDocument7_AddRef(IHTMLDocument7 *iface) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + return htmldoc_addref(This); +} + +static ULONG WINAPI HTMLDocument7_Release(IHTMLDocument7 *iface) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + return htmldoc_release(This); +} + +static HRESULT WINAPI HTMLDocument7_GetTypeInfoCount(IHTMLDocument7 *iface, UINT *pctinfo) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + return IDispatchEx_GetTypeInfoCount(&This->IDispatchEx_iface, pctinfo); +} + +static HRESULT WINAPI HTMLDocument7_GetTypeInfo(IHTMLDocument7 *iface, UINT iTInfo, + LCID lcid, ITypeInfo **ppTInfo) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + return IDispatchEx_GetTypeInfo(&This->IDispatchEx_iface, iTInfo, lcid, ppTInfo); +} + +static HRESULT WINAPI HTMLDocument7_GetIDsOfNames(IHTMLDocument7 *iface, REFIID riid, + LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + return IDispatchEx_GetIDsOfNames(&This->IDispatchEx_iface, riid, rgszNames, cNames, lcid, + rgDispId); +} + +static HRESULT WINAPI HTMLDocument7_Invoke(IHTMLDocument7 *iface, DISPID dispIdMember, + REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, + VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + return IDispatchEx_Invoke(&This->IDispatchEx_iface, dispIdMember, riid, lcid, wFlags, + pDispParams, pVarResult, pExcepInfo, puArgErr); +} + +static HRESULT WINAPI HTMLDocument7_get_defaultView(IHTMLDocument7 *iface, IHTMLWindow2 **p) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_createCDATASection(IHTMLDocument7 *iface, BSTR text, IHTMLDOMNode **newCDATASectionNode) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%p)\n", This, newCDATASectionNode); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_getSelection(IHTMLDocument7 *iface, IHTMLSelection **ppIHTMLSelection) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%p)\n", This, ppIHTMLSelection); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_getElementsByTagNameNS(IHTMLDocument7 *iface, VARIANT *pvarNS, + BSTR bstrLocalName, IHTMLElementCollection **pelColl) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%s %s %p)\n", This, debugstr_variant(pvarNS), debugstr_w(bstrLocalName), pelColl); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_createElementNS(IHTMLDocument7 *iface, VARIANT *pvarNS, BSTR bstrTag, IHTMLElement **newElem) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%s %s %p)\n", This, debugstr_variant(pvarNS), debugstr_w(bstrTag), newElem); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_createAttributeNS(IHTMLDocument7 *iface, VARIANT *pvarNS, + BSTR bstrAttrName, IHTMLDOMAttribute **ppAttribute) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%s %s %p)\n", This, debugstr_variant(pvarNS), debugstr_w(bstrAttrName), ppAttribute); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_put_onmsthumbnailclick(IHTMLDocument7 *iface, VARIANT v) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_get_onmsthumbnailclick(IHTMLDocument7 *iface, VARIANT *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_get_characterSet(IHTMLDocument7 *iface, BSTR *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_createElement(IHTMLDocument7 *iface, BSTR bstrTag, IHTMLElement **newElem) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%s %p)\n", This, debugstr_w(bstrTag), newElem); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_createAttribute(IHTMLDocument7 *iface, BSTR bstrAttrName, IHTMLDOMAttribute **ppAttribute) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%s %p)\n", This, debugstr_w(bstrAttrName), ppAttribute); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_getElementByClassName(IHTMLDocument7 *iface, BSTR v, IHTMLElementCollection **pel) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%s %p)\n", This, debugstr_w(v), pel); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_createProcessingInstruction(IHTMLDocument7 *iface, BSTR target, + BSTR data, IDOMProcessingInstruction **newProcessingInstruction) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%s %s %p)\n", This, debugstr_w(target), debugstr_w(data), newProcessingInstruction); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_adoptNode(IHTMLDocument7 *iface, IHTMLDOMNode *pNodeSource, IHTMLDOMNode3 **ppNodeDest) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%p %p)\n", This, pNodeSource, ppNodeDest); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_put_onmssitemodejumplistitemremoved(IHTMLDocument7 *iface, VARIANT v) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_get_onmssitemodejumplistitemremoved(IHTMLDocument7 *iface, VARIANT *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_get_all(IHTMLDocument7 *iface, IHTMLElementCollection **p) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_get_inputEncoding(IHTMLDocument7 *iface, BSTR *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_get_xmlEncoding(IHTMLDocument7 *iface, BSTR *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_put_xmlStandalone(IHTMLDocument7 *iface, VARIANT_BOOL v) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%x)\n", This, v); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_get_xmlStandalone(IHTMLDocument7 *iface, VARIANT_BOOL *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_put_xmlVersion(IHTMLDocument7 *iface, BSTR v) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%s)\n", This, debugstr_w(v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_get_xmlVersion(IHTMLDocument7 *iface, BSTR *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_hasAttributes(IHTMLDocument7 *iface, VARIANT_BOOL *pfHasAttributes) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%p)\n", This, pfHasAttributes); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_put_onabort(IHTMLDocument7 *iface, VARIANT v) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_get_onabort(IHTMLDocument7 *iface, VARIANT *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_put_onblur(IHTMLDocument7 *iface, VARIANT v) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_get_onblur(IHTMLDocument7 *iface, VARIANT *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_put_oncanplay(IHTMLDocument7 *iface, VARIANT v) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_get_oncanplay(IHTMLDocument7 *iface, VARIANT *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_put_oncanplaythrough(IHTMLDocument7 *iface, VARIANT v) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_get_oncanplaythrough(IHTMLDocument7 *iface, VARIANT *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_put_onchange(IHTMLDocument7 *iface, VARIANT v) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_get_onchange(IHTMLDocument7 *iface, VARIANT *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_put_ondrag(IHTMLDocument7 *iface, VARIANT v) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_get_ondrag(IHTMLDocument7 *iface, VARIANT *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_put_ondragend(IHTMLDocument7 *iface, VARIANT v) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_get_ondragend(IHTMLDocument7 *iface, VARIANT *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_put_ondragenter(IHTMLDocument7 *iface, VARIANT v) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_get_ondragenter(IHTMLDocument7 *iface, VARIANT *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_put_ondragleave(IHTMLDocument7 *iface, VARIANT v) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_get_ondragleave(IHTMLDocument7 *iface, VARIANT *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_put_ondragover(IHTMLDocument7 *iface, VARIANT v) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_get_ondragover(IHTMLDocument7 *iface, VARIANT *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_put_ondrop(IHTMLDocument7 *iface, VARIANT v) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_get_ondrop(IHTMLDocument7 *iface, VARIANT *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_put_ondurationchange(IHTMLDocument7 *iface, VARIANT v) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_get_ondurationchange(IHTMLDocument7 *iface, VARIANT *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_put_onemptied(IHTMLDocument7 *iface, VARIANT v) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_get_onemptied(IHTMLDocument7 *iface, VARIANT *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_put_onended(IHTMLDocument7 *iface, VARIANT v) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_get_onended(IHTMLDocument7 *iface, VARIANT *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_put_onerror(IHTMLDocument7 *iface, VARIANT v) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_get_onerror(IHTMLDocument7 *iface, VARIANT *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_put_onfocus(IHTMLDocument7 *iface, VARIANT v) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_get_onfocus(IHTMLDocument7 *iface, VARIANT *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_put_oninput(IHTMLDocument7 *iface, VARIANT v) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_get_oninput(IHTMLDocument7 *iface, VARIANT *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_put_onload(IHTMLDocument7 *iface, VARIANT v) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_get_onload(IHTMLDocument7 *iface, VARIANT *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_put_onloadeddata(IHTMLDocument7 *iface, VARIANT v) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_get_onloadeddata(IHTMLDocument7 *iface, VARIANT *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_put_onloadedmetadata(IHTMLDocument7 *iface, VARIANT v) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_get_onloadedmetadata(IHTMLDocument7 *iface, VARIANT *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_put_onloadstart(IHTMLDocument7 *iface, VARIANT v) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_get_onloadstart(IHTMLDocument7 *iface, VARIANT *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_put_onpause(IHTMLDocument7 *iface, VARIANT v) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_get_onpause(IHTMLDocument7 *iface, VARIANT *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_put_onplay(IHTMLDocument7 *iface, VARIANT v) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_get_onplay(IHTMLDocument7 *iface, VARIANT *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_put_onplaying(IHTMLDocument7 *iface, VARIANT v) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_get_onplaying(IHTMLDocument7 *iface, VARIANT *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_put_onprogress(IHTMLDocument7 *iface, VARIANT v) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_get_onprogress(IHTMLDocument7 *iface, VARIANT *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_put_onratechange(IHTMLDocument7 *iface, VARIANT v) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_get_onratechange(IHTMLDocument7 *iface, VARIANT *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_put_onreset(IHTMLDocument7 *iface, VARIANT v) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_get_onreset(IHTMLDocument7 *iface, VARIANT *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_put_onscroll(IHTMLDocument7 *iface, VARIANT v) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_get_onscroll(IHTMLDocument7 *iface, VARIANT *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_put_onseekend(IHTMLDocument7 *iface, VARIANT v) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_get_onseekend(IHTMLDocument7 *iface, VARIANT *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_put_onseeking(IHTMLDocument7 *iface, VARIANT v) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_get_onseeking(IHTMLDocument7 *iface, VARIANT *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_put_onselect(IHTMLDocument7 *iface, VARIANT v) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_get_onselect(IHTMLDocument7 *iface, VARIANT *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_put_onstalled(IHTMLDocument7 *iface, VARIANT v) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_get_onstalled(IHTMLDocument7 *iface, VARIANT *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_put_onsubmit(IHTMLDocument7 *iface, VARIANT v) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_get_onsubmit(IHTMLDocument7 *iface, VARIANT *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_put_onsuspend(IHTMLDocument7 *iface, VARIANT v) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_get_onsuspend(IHTMLDocument7 *iface, VARIANT *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_put_ontimeupdate(IHTMLDocument7 *iface, VARIANT v) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_get_ontimeupdate(IHTMLDocument7 *iface, VARIANT *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_put_onvolumechange(IHTMLDocument7 *iface, VARIANT v) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_get_onvolumechange(IHTMLDocument7 *iface, VARIANT *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_put_onwaiting(IHTMLDocument7 *iface, VARIANT v) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_get_onwaiting(IHTMLDocument7 *iface, VARIANT *p) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_normalize(IHTMLDocument7 *iface) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_importNode(IHTMLDocument7 *iface, IHTMLDOMNode *pNodeSource, + VARIANT_BOOL fDeep, IHTMLDOMNode3 **ppNodeDest) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%p %x %p)\n", This, pNodeSource, fDeep, ppNodeDest); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_get_parentWindow(IHTMLDocument7 *iface, IHTMLWindow2 **p) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_put_body(IHTMLDocument7 *iface, IHTMLElement *v) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%p)\n", This, v); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_get_body(IHTMLDocument7 *iface, IHTMLElement **p) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static HRESULT WINAPI HTMLDocument7_get_head(IHTMLDocument7 *iface, IHTMLElement **p) +{ + HTMLDocument *This = impl_from_IHTMLDocument7(iface); + FIXME("(%p)->(%p)\n", This, p); + return E_NOTIMPL; +} + +static const IHTMLDocument7Vtbl HTMLDocument7Vtbl = { + HTMLDocument7_QueryInterface, + HTMLDocument7_AddRef, + HTMLDocument7_Release, + HTMLDocument7_GetTypeInfoCount, + HTMLDocument7_GetTypeInfo, + HTMLDocument7_GetIDsOfNames, + HTMLDocument7_Invoke, + HTMLDocument7_get_defaultView, + HTMLDocument7_createCDATASection, + HTMLDocument7_getSelection, + HTMLDocument7_getElementsByTagNameNS, + HTMLDocument7_createElementNS, + HTMLDocument7_createAttributeNS, + HTMLDocument7_put_onmsthumbnailclick, + HTMLDocument7_get_onmsthumbnailclick, + HTMLDocument7_get_characterSet, + HTMLDocument7_createElement, + HTMLDocument7_createAttribute, + HTMLDocument7_getElementByClassName, + HTMLDocument7_createProcessingInstruction, + HTMLDocument7_adoptNode, + HTMLDocument7_put_onmssitemodejumplistitemremoved, + HTMLDocument7_get_onmssitemodejumplistitemremoved, + HTMLDocument7_get_all, + HTMLDocument7_get_inputEncoding, + HTMLDocument7_get_xmlEncoding, + HTMLDocument7_put_xmlStandalone, + HTMLDocument7_get_xmlStandalone, + HTMLDocument7_put_xmlVersion, + HTMLDocument7_get_xmlVersion, + HTMLDocument7_hasAttributes, + HTMLDocument7_put_onabort, + HTMLDocument7_get_onabort, + HTMLDocument7_put_onblur, + HTMLDocument7_get_onblur, + HTMLDocument7_put_oncanplay, + HTMLDocument7_get_oncanplay, + HTMLDocument7_put_oncanplaythrough, + HTMLDocument7_get_oncanplaythrough, + HTMLDocument7_put_onchange, + HTMLDocument7_get_onchange, + HTMLDocument7_put_ondrag, + HTMLDocument7_get_ondrag, + HTMLDocument7_put_ondragend, + HTMLDocument7_get_ondragend, + HTMLDocument7_put_ondragenter, + HTMLDocument7_get_ondragenter, + HTMLDocument7_put_ondragleave, + HTMLDocument7_get_ondragleave, + HTMLDocument7_put_ondragover, + HTMLDocument7_get_ondragover, + HTMLDocument7_put_ondrop, + HTMLDocument7_get_ondrop, + HTMLDocument7_put_ondurationchange, + HTMLDocument7_get_ondurationchange, + HTMLDocument7_put_onemptied, + HTMLDocument7_get_onemptied, + HTMLDocument7_put_onended, + HTMLDocument7_get_onended, + HTMLDocument7_put_onerror, + HTMLDocument7_get_onerror, + HTMLDocument7_put_onfocus, + HTMLDocument7_get_onfocus, + HTMLDocument7_put_oninput, + HTMLDocument7_get_oninput, + HTMLDocument7_put_onload, + HTMLDocument7_get_onload, + HTMLDocument7_put_onloadeddata, + HTMLDocument7_get_onloadeddata, + HTMLDocument7_put_onloadedmetadata, + HTMLDocument7_get_onloadedmetadata, + HTMLDocument7_put_onloadstart, + HTMLDocument7_get_onloadstart, + HTMLDocument7_put_onpause, + HTMLDocument7_get_onpause, + HTMLDocument7_put_onplay, + HTMLDocument7_get_onplay, + HTMLDocument7_put_onplaying, + HTMLDocument7_get_onplaying, + HTMLDocument7_put_onprogress, + HTMLDocument7_get_onprogress, + HTMLDocument7_put_onratechange, + HTMLDocument7_get_onratechange, + HTMLDocument7_put_onreset, + HTMLDocument7_get_onreset, + HTMLDocument7_put_onscroll, + HTMLDocument7_get_onscroll, + HTMLDocument7_put_onseekend, + HTMLDocument7_get_onseekend, + HTMLDocument7_put_onseeking, + HTMLDocument7_get_onseeking, + HTMLDocument7_put_onselect, + HTMLDocument7_get_onselect, + HTMLDocument7_put_onstalled, + HTMLDocument7_get_onstalled, + HTMLDocument7_put_onsubmit, + HTMLDocument7_get_onsubmit, + HTMLDocument7_put_onsuspend, + HTMLDocument7_get_onsuspend, + HTMLDocument7_put_ontimeupdate, + HTMLDocument7_get_ontimeupdate, + HTMLDocument7_put_onvolumechange, + HTMLDocument7_get_onvolumechange, + HTMLDocument7_put_onwaiting, + HTMLDocument7_get_onwaiting, + HTMLDocument7_normalize, + HTMLDocument7_importNode, + HTMLDocument7_get_parentWindow, + HTMLDocument7_put_body, + HTMLDocument7_get_body, + HTMLDocument7_get_head +}; + +static void HTMLDocument_on_advise(IUnknown *iface, cp_static_data_t *cp) +{ + HTMLDocument *This = impl_from_IHTMLDocument2((IHTMLDocument2*)iface); + + if(This->window) + update_cp_events(This->window->base.inner_window, &This->doc_node->node.event_target, cp); +} + +static inline HTMLDocument *impl_from_ISupportErrorInfo(ISupportErrorInfo *iface) +{ + return CONTAINING_RECORD(iface, HTMLDocument, ISupportErrorInfo_iface); +} + +static HRESULT WINAPI SupportErrorInfo_QueryInterface(ISupportErrorInfo *iface, REFIID riid, void **ppv) +{ + HTMLDocument *This = impl_from_ISupportErrorInfo(iface); + return htmldoc_query_interface(This, riid, ppv); +} + +static ULONG WINAPI SupportErrorInfo_AddRef(ISupportErrorInfo *iface) +{ + HTMLDocument *This = impl_from_ISupportErrorInfo(iface); + return htmldoc_addref(This); +} + +static ULONG WINAPI SupportErrorInfo_Release(ISupportErrorInfo *iface) +{ + HTMLDocument *This = impl_from_ISupportErrorInfo(iface); + return htmldoc_release(This); +} + +static HRESULT WINAPI SupportErrorInfo_InterfaceSupportsErrorInfo(ISupportErrorInfo *iface, REFIID riid) +{ + FIXME("(%p)->(%s)\n", iface, debugstr_guid(riid)); + return S_FALSE; +} + +static const ISupportErrorInfoVtbl SupportErrorInfoVtbl = { + SupportErrorInfo_QueryInterface, + SupportErrorInfo_AddRef, + SupportErrorInfo_Release, + SupportErrorInfo_InterfaceSupportsErrorInfo +}; + +static inline HTMLDocument *impl_from_IDispatchEx(IDispatchEx *iface) +{ + return CONTAINING_RECORD(iface, HTMLDocument, IDispatchEx_iface); +} + +static HRESULT dispid_from_elem_name(HTMLDocumentNode *This, BSTR name, DISPID *dispid) +{ + nsIDOMNodeList *node_list; + nsAString name_str; + UINT32 len; + unsigned i; + nsresult nsres; + + if(!This->nsdoc) + return DISP_E_UNKNOWNNAME; + + nsAString_InitDepend(&name_str, name); + nsres = nsIDOMHTMLDocument_GetElementsByName(This->nsdoc, &name_str, &node_list); + nsAString_Finish(&name_str); + if(NS_FAILED(nsres)) + return E_FAIL; + + nsres = nsIDOMNodeList_GetLength(node_list, &len); + nsIDOMNodeList_Release(node_list); + if(NS_FAILED(nsres)) + return E_FAIL; + + if(!len) + return DISP_E_UNKNOWNNAME; + + for(i=0; i < This->elem_vars_cnt; i++) { + if(!strcmpW(name, This->elem_vars[i])) { + *dispid = MSHTML_DISPID_CUSTOM_MIN+i; + return S_OK; + } + } + + if(This->elem_vars_cnt == This->elem_vars_size) { + WCHAR **new_vars; + + if(This->elem_vars_size) { + new_vars = heap_realloc(This->elem_vars, This->elem_vars_size*2*sizeof(WCHAR*)); + if(!new_vars) + return E_OUTOFMEMORY; + This->elem_vars_size *= 2; + }else { + new_vars = heap_alloc(16*sizeof(WCHAR*)); + if(!new_vars) + return E_OUTOFMEMORY; + This->elem_vars_size = 16; + } + + This->elem_vars = new_vars; + } + + This->elem_vars[This->elem_vars_cnt] = heap_strdupW(name); + if(!This->elem_vars[This->elem_vars_cnt]) + return E_OUTOFMEMORY; + + *dispid = MSHTML_DISPID_CUSTOM_MIN+This->elem_vars_cnt++; + return S_OK; +} + +static HRESULT WINAPI DocDispatchEx_QueryInterface(IDispatchEx *iface, REFIID riid, void **ppv) +{ + HTMLDocument *This = impl_from_IDispatchEx(iface); + + return htmldoc_query_interface(This, riid, ppv); +} + +static ULONG WINAPI DocDispatchEx_AddRef(IDispatchEx *iface) +{ + HTMLDocument *This = impl_from_IDispatchEx(iface); + + return htmldoc_addref(This); +} + +static ULONG WINAPI DocDispatchEx_Release(IDispatchEx *iface) +{ + HTMLDocument *This = impl_from_IDispatchEx(iface); + + return htmldoc_release(This); +} + +static HRESULT WINAPI DocDispatchEx_GetTypeInfoCount(IDispatchEx *iface, UINT *pctinfo) +{ + HTMLDocument *This = impl_from_IDispatchEx(iface); + + return IDispatchEx_GetTypeInfoCount(This->dispex, pctinfo); +} + +static HRESULT WINAPI DocDispatchEx_GetTypeInfo(IDispatchEx *iface, UINT iTInfo, + LCID lcid, ITypeInfo **ppTInfo) +{ + HTMLDocument *This = impl_from_IDispatchEx(iface); + + return IDispatchEx_GetTypeInfo(This->dispex, iTInfo, lcid, ppTInfo); +} + +static HRESULT WINAPI DocDispatchEx_GetIDsOfNames(IDispatchEx *iface, REFIID riid, + LPOLESTR *rgszNames, UINT cNames, + LCID lcid, DISPID *rgDispId) +{ + HTMLDocument *This = impl_from_IDispatchEx(iface); + + return IDispatchEx_GetIDsOfNames(This->dispex, riid, rgszNames, cNames, lcid, rgDispId); +} + +static HRESULT WINAPI DocDispatchEx_Invoke(IDispatchEx *iface, DISPID dispIdMember, + REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, + VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) +{ + HTMLDocument *This = impl_from_IDispatchEx(iface); + + TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid), + lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); + + switch(dispIdMember) { + case DISPID_READYSTATE: + TRACE("DISPID_READYSTATE\n"); + + if(!(wFlags & DISPATCH_PROPERTYGET)) + return E_INVALIDARG; + + V_VT(pVarResult) = VT_I4; + V_I4(pVarResult) = This->window->readystate; + return S_OK; + } + + return IDispatchEx_Invoke(This->dispex, dispIdMember, riid, lcid, wFlags, pDispParams, + pVarResult, pExcepInfo, puArgErr); +} + +static HRESULT WINAPI DocDispatchEx_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid) +{ + HTMLDocument *This = impl_from_IDispatchEx(iface); + HRESULT hres; + + hres = IDispatchEx_GetDispID(This->dispex, bstrName, grfdex, pid); + if(hres != DISP_E_UNKNOWNNAME) + return hres; + + return dispid_from_elem_name(This->doc_node, bstrName, pid); +} + +static HRESULT WINAPI DocDispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, + VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller) +{ + HTMLDocument *This = impl_from_IDispatchEx(iface); + + if(This->window && id == DISPID_IHTMLDOCUMENT2_LOCATION && (wFlags & DISPATCH_PROPERTYPUT)) + return IDispatchEx_InvokeEx(&This->window->base.IDispatchEx_iface, DISPID_IHTMLWINDOW2_LOCATION, + lcid, wFlags, pdp, pvarRes, pei, pspCaller); + + + return IDispatchEx_InvokeEx(This->dispex, id, lcid, wFlags, pdp, pvarRes, pei, pspCaller); +} + +static HRESULT WINAPI DocDispatchEx_DeleteMemberByName(IDispatchEx *iface, BSTR bstrName, DWORD grfdex) +{ + HTMLDocument *This = impl_from_IDispatchEx(iface); + + return IDispatchEx_DeleteMemberByName(This->dispex, bstrName, grfdex); +} + +static HRESULT WINAPI DocDispatchEx_DeleteMemberByDispID(IDispatchEx *iface, DISPID id) +{ + HTMLDocument *This = impl_from_IDispatchEx(iface); + + return IDispatchEx_DeleteMemberByDispID(This->dispex, id); } static HRESULT WINAPI DocDispatchEx_GetMemberProperties(IDispatchEx *iface, DISPID id, DWORD grfdexFetch, DWORD *pgrfdex) @@ -1988,103 +4136,81 @@ { *ppv = NULL; - if(IsEqualGUID(&IID_IUnknown, riid)) { - TRACE("(%p)->(IID_IUnknown, %p)\n", This, ppv); + if(IsEqualGUID(&IID_IUnknown, riid)) *ppv = &This->IHTMLDocument2_iface; - }else if(IsEqualGUID(&IID_IDispatch, riid)) { - TRACE("(%p)->(IID_IDispatch, %p)\n", This, ppv); + else if(IsEqualGUID(&IID_IDispatch, riid)) *ppv = &This->IDispatchEx_iface; - }else if(IsEqualGUID(&IID_IDispatchEx, riid)) { - TRACE("(%p)->(IID_IDispatchEx, %p)\n", This, ppv); + else if(IsEqualGUID(&IID_IDispatchEx, riid)) *ppv = &This->IDispatchEx_iface; - }else if(IsEqualGUID(&IID_IHTMLDocument, riid)) { - TRACE("(%p)->(IID_IHTMLDocument, %p)\n", This, ppv); + else if(IsEqualGUID(&IID_IHTMLDocument, riid)) *ppv = &This->IHTMLDocument2_iface; - }else if(IsEqualGUID(&IID_IHTMLDocument2, riid)) { - TRACE("(%p)->(IID_IHTMLDocument2, %p)\n", This, ppv); + else if(IsEqualGUID(&IID_IHTMLDocument2, riid)) *ppv = &This->IHTMLDocument2_iface; - }else if(IsEqualGUID(&IID_IHTMLDocument3, riid)) { - TRACE("(%p)->(IID_IHTMLDocument3, %p)\n", This, ppv); + else if(IsEqualGUID(&IID_IHTMLDocument3, riid)) *ppv = &This->IHTMLDocument3_iface; - }else if(IsEqualGUID(&IID_IHTMLDocument4, riid)) { - TRACE("(%p)->(IID_IHTMLDocument4, %p)\n", This, ppv); + else if(IsEqualGUID(&IID_IHTMLDocument4, riid)) *ppv = &This->IHTMLDocument4_iface; - }else if(IsEqualGUID(&IID_IHTMLDocument5, riid)) { - TRACE("(%p)->(IID_IHTMLDocument5, %p)\n", This, ppv); + else if(IsEqualGUID(&IID_IHTMLDocument5, riid)) *ppv = &This->IHTMLDocument5_iface; - }else if(IsEqualGUID(&IID_IHTMLDocument6, riid)) { - TRACE("(%p)->(IID_IHTMLDocument6, %p)\n", This, ppv); + else if(IsEqualGUID(&IID_IHTMLDocument6, riid)) *ppv = &This->IHTMLDocument6_iface; - }else if(IsEqualGUID(&IID_IPersist, riid)) { - TRACE("(%p)->(IID_IPersist, %p)\n", This, ppv); + else if(IsEqualGUID(&IID_IHTMLDocument7, riid)) + *ppv = &This->IHTMLDocument7_iface; + else if(IsEqualGUID(&IID_IPersist, riid)) *ppv = &This->IPersistFile_iface; - }else if(IsEqualGUID(&IID_IPersistMoniker, riid)) { - TRACE("(%p)->(IID_IPersistMoniker, %p)\n", This, ppv); + else if(IsEqualGUID(&IID_IPersistMoniker, riid)) *ppv = &This->IPersistMoniker_iface; - }else if(IsEqualGUID(&IID_IPersistFile, riid)) { - TRACE("(%p)->(IID_IPersistFile, %p)\n", This, ppv); + else if(IsEqualGUID(&IID_IPersistFile, riid)) *ppv = &This->IPersistFile_iface; - }else if(IsEqualGUID(&IID_IMonikerProp, riid)) { - TRACE("(%p)->(IID_IMonikerProp, %p)\n", This, ppv); + else if(IsEqualGUID(&IID_IMonikerProp, riid)) *ppv = &This->IMonikerProp_iface; - }else if(IsEqualGUID(&IID_IOleObject, riid)) { - TRACE("(%p)->(IID_IOleObject, %p)\n", This, ppv); + else if(IsEqualGUID(&IID_IOleObject, riid)) *ppv = &This->IOleObject_iface; - }else if(IsEqualGUID(&IID_IOleDocument, riid)) { - TRACE("(%p)->(IID_IOleDocument, %p)\n", This, ppv); + else if(IsEqualGUID(&IID_IOleDocument, riid)) *ppv = &This->IOleDocument_iface; - }else if(IsEqualGUID(&IID_IOleDocumentView, riid)) { - TRACE("(%p)->(IID_IOleDocumentView, %p)\n", This, ppv); + else if(IsEqualGUID(&IID_IOleDocumentView, riid)) *ppv = &This->IOleDocumentView_iface; - }else if(IsEqualGUID(&IID_IOleInPlaceActiveObject, riid)) { - TRACE("(%p)->(IID_IOleInPlaceActiveObject, %p)\n", This, ppv); + else if(IsEqualGUID(&IID_IOleInPlaceActiveObject, riid)) *ppv = &This->IOleInPlaceActiveObject_iface; - }else if(IsEqualGUID(&IID_IViewObject, riid)) { - TRACE("(%p)->(IID_IViewObject, %p)\n", This, ppv); + else if(IsEqualGUID(&IID_IViewObject, riid)) *ppv = &This->IViewObjectEx_iface; - }else if(IsEqualGUID(&IID_IViewObject2, riid)) { - TRACE("(%p)->(IID_IViewObject2, %p)\n", This, ppv); + else if(IsEqualGUID(&IID_IViewObject2, riid)) *ppv = &This->IViewObjectEx_iface; - }else if(IsEqualGUID(&IID_IViewObjectEx, riid)) { - TRACE("(%p)->(IID_IViewObjectEx, %p)\n", This, ppv); + else if(IsEqualGUID(&IID_IViewObjectEx, riid)) *ppv = &This->IViewObjectEx_iface; - }else if(IsEqualGUID(&IID_IOleWindow, riid)) { - TRACE("(%p)->(IID_IOleWindow, %p)\n", This, ppv); + else if(IsEqualGUID(&IID_IOleWindow, riid)) *ppv = &This->IOleInPlaceActiveObject_iface; - }else if(IsEqualGUID(&IID_IOleInPlaceObject, riid)) { - TRACE("(%p)->(IID_IOleInPlaceObject, %p)\n", This, ppv); + else if(IsEqualGUID(&IID_IOleInPlaceObject, riid)) *ppv = &This->IOleInPlaceObjectWindowless_iface; - }else if(IsEqualGUID(&IID_IOleInPlaceObjectWindowless, riid)) { - TRACE("(%p)->(IID_IOleInPlaceObjectWindowless, %p)\n", This, ppv); + else if(IsEqualGUID(&IID_IOleInPlaceObjectWindowless, riid)) *ppv = &This->IOleInPlaceObjectWindowless_iface; - }else if(IsEqualGUID(&IID_IServiceProvider, riid)) { - TRACE("(%p)->(IID_IServiceProvider, %p)\n", This, ppv); + else if(IsEqualGUID(&IID_IServiceProvider, riid)) *ppv = &This->IServiceProvider_iface; - }else if(IsEqualGUID(&IID_IOleCommandTarget, riid)) { - TRACE("(%p)->(IID_IOleCommandTarget, %p)\n", This, ppv); + else if(IsEqualGUID(&IID_IOleCommandTarget, riid)) *ppv = &This->IOleCommandTarget_iface; - }else if(IsEqualGUID(&IID_IOleControl, riid)) { - TRACE("(%p)->(IID_IOleControl, %p)\n", This, ppv); + else if(IsEqualGUID(&IID_IOleControl, riid)) *ppv = &This->IOleControl_iface; - }else if(IsEqualGUID(&IID_IHlinkTarget, riid)) { - TRACE("(%p)->(IID_IHlinkTarget, %p)\n", This, ppv); + else if(IsEqualGUID(&IID_IHlinkTarget, riid)) *ppv = &This->IHlinkTarget_iface; - }else if(IsEqualGUID(&IID_IConnectionPointContainer, riid)) { - TRACE("(%p)->(IID_IConnectionPointContainer %p)\n", This, ppv); + else if(IsEqualGUID(&IID_IConnectionPointContainer, riid)) *ppv = &This->cp_container.IConnectionPointContainer_iface; - }else if(IsEqualGUID(&IID_IPersistStreamInit, riid)) { - TRACE("(%p)->(IID_IPersistStreamInit %p)\n", This, ppv); + else if(IsEqualGUID(&IID_IPersistStreamInit, riid)) *ppv = &This->IPersistStreamInit_iface; - }else if(IsEqualGUID(&DIID_DispHTMLDocument, riid)) { - TRACE("(%p)->(DIID_DispHTMLDocument %p)\n", This, ppv); + else if(IsEqualGUID(&DIID_DispHTMLDocument, riid)) *ppv = &This->IHTMLDocument2_iface; - }else if(IsEqualGUID(&IID_ISupportErrorInfo, riid)) { - TRACE("(%p)->(IID_ISupportErrorInfo %p)\n", This, ppv); + else if(IsEqualGUID(&IID_ISupportErrorInfo, riid)) *ppv = &This->ISupportErrorInfo_iface; - }else if(IsEqualGUID(&IID_IPersistHistory, riid)) { - TRACE("(%p)->(IID_IPersistHistory %p)\n", This, ppv); + else if(IsEqualGUID(&IID_IPersistHistory, riid)) *ppv = &This->IPersistHistory_iface; - }else if(IsEqualGUID(&CLSID_CMarkup, riid)) { + else if(IsEqualGUID(&IID_IObjectWithSite, riid)) + *ppv = &This->IObjectWithSite_iface; + else if(IsEqualGUID(&IID_IOleContainer, riid)) + *ppv = &This->IOleContainer_iface; + else if(IsEqualGUID(&IID_IObjectSafety, riid)) + *ppv = &This->IObjectSafety_iface; + else if(IsEqualGUID(&IID_IProvideClassInfo, riid)) + *ppv = &This->IProvideClassInfo_iface; + else if(IsEqualGUID(&CLSID_CMarkup, riid)) { FIXME("(%p)->(CLSID_CMarkup %p)\n", This, ppv); *ppv = NULL; }else if(IsEqualGUID(&IID_IRunnableObject, riid)) { @@ -2102,18 +4228,6 @@ }else if(IsEqualGUID(&IID_IStdMarshalInfo, riid)) { TRACE("(%p)->(IID_IStdMarshalInfo %p) returning NULL\n", This, ppv); *ppv = NULL; - }else if(IsEqualGUID(&IID_IObjectWithSite, riid)) { - TRACE("(%p)->(IID_IObjectWithSite %p)\n", This, ppv); - *ppv = &This->IObjectWithSite_iface; - }else if(IsEqualGUID(&IID_IOleContainer, riid)) { - TRACE("(%p)->(IID_IOleContainer %p)\n", This, ppv); - *ppv = &This->IOleContainer_iface; - }else if(IsEqualGUID(&IID_IObjectSafety, riid)) { - TRACE("(%p)->(IID_IObjectSafety %p)\n", This, ppv); - *ppv = &This->IObjectSafety_iface; - }else if(IsEqualGUID(&IID_IProvideClassInfo, riid)) { - TRACE("(%p)->(IID_IProvideClassInfo, %p)\n", This, ppv); - *ppv = &This->IProvideClassInfo_iface; }else { return FALSE; } @@ -2136,6 +4250,11 @@ static void init_doc(HTMLDocument *doc, IUnknown *unk_impl, IDispatchEx *dispex) { doc->IHTMLDocument2_iface.lpVtbl = &HTMLDocumentVtbl; + doc->IHTMLDocument3_iface.lpVtbl = &HTMLDocument3Vtbl; + doc->IHTMLDocument4_iface.lpVtbl = &HTMLDocument4Vtbl; + doc->IHTMLDocument5_iface.lpVtbl = &HTMLDocument5Vtbl; + doc->IHTMLDocument6_iface.lpVtbl = &HTMLDocument6Vtbl; + doc->IHTMLDocument7_iface.lpVtbl = &HTMLDocument7Vtbl; doc->IDispatchEx_iface.lpVtbl = &DocDispatchExVtbl; doc->ISupportErrorInfo_iface.lpVtbl = &SupportErrorInfoVtbl; doc->IProvideClassInfo_iface.lpVtbl = &ProvideClassInfoVtbl; @@ -2144,8 +4263,6 @@ doc->dispex = dispex; doc->task_magic = get_task_target_magic(); - HTMLDocument_HTMLDocument3_Init(doc); - HTMLDocument_HTMLDocument5_Init(doc); HTMLDocument_Persist_Init(doc); HTMLDocument_OleCmd_Init(doc); HTMLDocument_OleObj_Init(doc); @@ -2173,15 +4290,15 @@ { HTMLDocumentNode *This = impl_from_HTMLDOMNode(iface); + TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv); + if(htmldoc_qi(&This->basedoc, riid, ppv)) return *ppv ? S_OK : E_NOINTERFACE; - if(IsEqualGUID(&IID_IInternetHostSecurityManager, riid)) { - TRACE("(%p)->(IID_IInternetHostSecurityManager %p)\n", This, ppv); + if(IsEqualGUID(&IID_IInternetHostSecurityManager, riid)) *ppv = &This->IInternetHostSecurityManager_iface; - }else { + else return HTMLDOMNode_QI(&This->node, riid, ppv); - } IUnknown_AddRef((IUnknown*)*ppv); return S_OK; @@ -2464,19 +4581,19 @@ { HTMLDocumentObj *This = impl_from_ICustomDoc(iface); + TRACE("(%p)->(%s %p)\n", This, debugstr_mshtml_guid(riid), ppv); + if(htmldoc_qi(&This->basedoc, riid, ppv)) return *ppv ? S_OK : E_NOINTERFACE; if(IsEqualGUID(&IID_ICustomDoc, riid)) { - TRACE("(%p)->(IID_ICustomDoc %p)\n", This, ppv); *ppv = &This->ICustomDoc_iface; }else if(IsEqualGUID(&IID_ITargetContainer, riid)) { - TRACE("(%p)->(IID_ITargetContainer %p)\n", This, ppv); *ppv = &This->ITargetContainer_iface; }else if(dispex_query_interface(&This->dispex, riid, ppv)) { return *ppv ? S_OK : E_NOINTERFACE; }else { - FIXME("Unimplemented interface %s\n", debugstr_guid(riid)); + FIXME("Unimplemented interface %s\n", debugstr_mshtml_guid(riid)); *ppv = NULL; return E_NOINTERFACE; } diff -Nru wine1.7-1.7.14/dlls/mshtml/htmlelem2.c wine1.7-1.7.18/dlls/mshtml/htmlelem2.c --- wine1.7-1.7.14/dlls/mshtml/htmlelem2.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/mshtml/htmlelem2.c 2014-05-02 18:15:48.000000000 +0000 @@ -864,7 +864,7 @@ TRACE("(%p)->(%s %p %p)\n", This, debugstr_w(event), pDisp, pfResult); - return attach_event(get_node_event_target(&This->node), This->node.nsnode, &This->node.doc->basedoc, event, pDisp, pfResult); + return attach_event(get_node_event_target(&This->node), &This->node.doc->basedoc, event, pDisp, pfResult); } static HRESULT WINAPI HTMLElement2_detachEvent(IHTMLElement2 *iface, BSTR event, IDispatch *pDisp) diff -Nru wine1.7-1.7.14/dlls/mshtml/htmlelem3.c wine1.7-1.7.18/dlls/mshtml/htmlelem3.c --- wine1.7-1.7.14/dlls/mshtml/htmlelem3.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/mshtml/htmlelem3.c 2014-05-02 18:15:48.000000000 +0000 @@ -174,15 +174,34 @@ static HRESULT WINAPI HTMLElement3_put_contentEditable(IHTMLElement3 *iface, BSTR v) { HTMLElement *This = impl_from_IHTMLElement3(iface); - FIXME("(%p)->(%s)\n", This, debugstr_w(v)); - return E_NOTIMPL; + nsresult nsres; + nsAString str; + + TRACE("(%p)->(%s)\n", This, debugstr_w(v)); + + nsAString_InitDepend(&str, v); + nsres = nsIDOMHTMLElement_SetContentEditable(This->nselem, &str); + nsAString_Finish(&str); + + if (NS_FAILED(nsres)){ + ERR("SetContentEditable(%s) failed!\n", debugstr_w(v)); + return E_FAIL; + } + + return S_OK; } static HRESULT WINAPI HTMLElement3_get_contentEditable(IHTMLElement3 *iface, BSTR *p) { HTMLElement *This = impl_from_IHTMLElement3(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + nsresult nsres; + nsAString str; + + TRACE("(%p)->(%p)\n", This, p); + + nsAString_Init(&str, NULL); + nsres = nsIDOMHTMLElement_GetContentEditable(This->nselem, &str); + return return_nsstr(nsres, &str, p); } static HRESULT WINAPI HTMLElement3_get_isContentEditable(IHTMLElement3 *iface, VARIANT_BOOL *p) diff -Nru wine1.7-1.7.14/dlls/mshtml/htmlelemcol.c wine1.7-1.7.18/dlls/mshtml/htmlelemcol.c --- wine1.7-1.7.14/dlls/mshtml/htmlelemcol.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/mshtml/htmlelemcol.c 2014-05-02 18:15:48.000000000 +0000 @@ -42,6 +42,15 @@ } HTMLElementCollection; typedef struct { + IEnumVARIANT IEnumVARIANT_iface; + + LONG ref; + + ULONG iter; + HTMLElementCollection *col; +} HTMLElementCollectionEnum; + +typedef struct { HTMLElement **buf; DWORD len; DWORD size; @@ -86,6 +95,118 @@ return type == ELEMENT_NODE || type == COMMENT_NODE; } +static inline HTMLElementCollectionEnum *impl_from_IEnumVARIANT(IEnumVARIANT *iface) +{ + return CONTAINING_RECORD(iface, HTMLElementCollectionEnum, IEnumVARIANT_iface); +} + +static HRESULT WINAPI HTMLElementCollectionEnum_QueryInterface(IEnumVARIANT *iface, REFIID riid, void **ppv) +{ + HTMLElementCollectionEnum *This = impl_from_IEnumVARIANT(iface); + + if(IsEqualGUID(riid, &IID_IUnknown)) { + TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv); + *ppv = &This->IEnumVARIANT_iface; + }else if(IsEqualGUID(riid, &IID_IEnumVARIANT)) { + TRACE("(%p)->(IID_IEnumVARIANT %p)\n", This, ppv); + *ppv = &This->IEnumVARIANT_iface; + }else { + FIXME("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv); + *ppv = NULL; + return E_NOINTERFACE; + } + + IUnknown_AddRef((IUnknown*)*ppv); + return S_OK; +} + +static ULONG WINAPI HTMLElementCollectionEnum_AddRef(IEnumVARIANT *iface) +{ + HTMLElementCollectionEnum *This = impl_from_IEnumVARIANT(iface); + LONG ref = InterlockedIncrement(&This->ref); + + TRACE("(%p) ref=%d\n", This, ref); + + return ref; +} + +static ULONG WINAPI HTMLElementCollectionEnum_Release(IEnumVARIANT *iface) +{ + HTMLElementCollectionEnum *This = impl_from_IEnumVARIANT(iface); + LONG ref = InterlockedDecrement(&This->ref); + + TRACE("(%p) ref=%d\n", This, ref); + + if(!ref) { + IHTMLElementCollection_Release(&This->col->IHTMLElementCollection_iface); + heap_free(This); + } + + return ref; +} + +static HRESULT WINAPI HTMLElementCollectionEnum_Next(IEnumVARIANT *iface, ULONG celt, VARIANT *rgVar, ULONG *pCeltFetched) +{ + HTMLElementCollectionEnum *This = impl_from_IEnumVARIANT(iface); + ULONG fetched = 0; + + TRACE("(%p)->(%d %p %p)\n", This, celt, rgVar, pCeltFetched); + + while(This->iter+fetched < This->col->len && fetched < celt) { + V_VT(rgVar+fetched) = VT_DISPATCH; + V_DISPATCH(rgVar+fetched) = (IDispatch*)&This->col->elems[This->iter+fetched]->IHTMLElement_iface; + IDispatch_AddRef(V_DISPATCH(rgVar+fetched)); + fetched++; + } + + This->iter += fetched; + if(pCeltFetched) + *pCeltFetched = fetched; + return fetched == celt ? S_OK : S_FALSE; +} + +static HRESULT WINAPI HTMLElementCollectionEnum_Skip(IEnumVARIANT *iface, ULONG celt) +{ + HTMLElementCollectionEnum *This = impl_from_IEnumVARIANT(iface); + + TRACE("(%p)->(%d)\n", This, celt); + + if(This->iter + celt > This->col->len) { + This->iter = This->col->len; + return S_FALSE; + } + + This->iter += celt; + return S_OK; +} + +static HRESULT WINAPI HTMLElementCollectionEnum_Reset(IEnumVARIANT *iface) +{ + HTMLElementCollectionEnum *This = impl_from_IEnumVARIANT(iface); + + TRACE("(%p)->()\n", This); + + This->iter = 0; + return S_OK; +} + +static HRESULT WINAPI HTMLElementCollectionEnum_Clone(IEnumVARIANT *iface, IEnumVARIANT **ppEnum) +{ + HTMLElementCollectionEnum *This = impl_from_IEnumVARIANT(iface); + FIXME("(%p)->(%p)\n", This, ppEnum); + return E_NOTIMPL; +} + +static const IEnumVARIANTVtbl HTMLElementCollectionEnumVtbl = { + HTMLElementCollectionEnum_QueryInterface, + HTMLElementCollectionEnum_AddRef, + HTMLElementCollectionEnum_Release, + HTMLElementCollectionEnum_Next, + HTMLElementCollectionEnum_Skip, + HTMLElementCollectionEnum_Reset, + HTMLElementCollectionEnum_Clone +}; + static inline HTMLElementCollection *impl_from_IHTMLElementCollection(IHTMLElementCollection *iface) { return CONTAINING_RECORD(iface, HTMLElementCollection, IHTMLElementCollection_iface); @@ -210,8 +331,23 @@ IUnknown **p) { HTMLElementCollection *This = impl_from_IHTMLElementCollection(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + HTMLElementCollectionEnum *ret; + + TRACE("(%p)->(%p)\n", This, p); + + ret = heap_alloc(sizeof(*ret)); + if(!ret) + return E_OUTOFMEMORY; + + ret->IEnumVARIANT_iface.lpVtbl = &HTMLElementCollectionEnumVtbl; + ret->ref = 1; + ret->iter = 0; + + IHTMLElementCollection_AddRef(&This->IHTMLElementCollection_iface); + ret->col = This; + + *p = (IUnknown*)&ret->IEnumVARIANT_iface; + return S_OK; } static BOOL is_elem_id(HTMLElement *elem, LPCWSTR name) diff -Nru wine1.7-1.7.14/dlls/mshtml/htmlevent.c wine1.7-1.7.18/dlls/mshtml/htmlevent.c --- wine1.7-1.7.14/dlls/mshtml/htmlevent.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/mshtml/htmlevent.c 2014-05-02 18:15:48.000000000 +0000 @@ -42,7 +42,6 @@ } handler_vector_t; struct event_target_t { - DWORD node_handlers_mask; handler_vector_t *event_table[EVENTID_LAST]; }; @@ -159,13 +158,13 @@ #define EVENT_DEFAULTLISTENER 0x0001 #define EVENT_BUBBLE 0x0002 #define EVENT_FORWARDBODY 0x0004 -#define EVENT_NODEHANDLER 0x0008 +#define EVENT_BIND_TO_BODY 0x0008 #define EVENT_CANCELABLE 0x0010 #define EVENT_HASDEFAULTHANDLERS 0x0020 static const event_info_t event_info[] = { {abortW, onabortW, EVENTT_NONE, DISPID_EVMETH_ONABORT, - EVENT_NODEHANDLER}, + EVENT_BIND_TO_BODY}, {beforeunloadW, onbeforeunloadW, EVENTT_NONE, DISPID_EVMETH_ONBEFOREUNLOAD, EVENT_DEFAULTLISTENER|EVENT_FORWARDBODY}, {blurW, onblurW, EVENTT_HTML, DISPID_EVMETH_ONBLUR, @@ -185,7 +184,7 @@ {dragstartW, ondragstartW, EVENTT_MOUSE, DISPID_EVMETH_ONDRAGSTART, EVENT_CANCELABLE}, {errorW, onerrorW, EVENTT_NONE, DISPID_EVMETH_ONERROR, - EVENT_NODEHANDLER}, + EVENT_BIND_TO_BODY}, {focusW, onfocusW, EVENTT_HTML, DISPID_EVMETH_ONFOCUS, EVENT_DEFAULTLISTENER}, {helpW, onhelpW, EVENTT_KEY, DISPID_EVMETH_ONHELP, @@ -197,7 +196,7 @@ {keyupW, onkeyupW, EVENTT_KEY, DISPID_EVMETH_ONKEYUP, EVENT_DEFAULTLISTENER|EVENT_BUBBLE}, {loadW, onloadW, EVENTT_HTML, DISPID_EVMETH_ONLOAD, - EVENT_NODEHANDLER}, + EVENT_BIND_TO_BODY}, {mousedownW, onmousedownW, EVENTT_MOUSE, DISPID_EVMETH_ONMOUSEDOWN, EVENT_DEFAULTLISTENER|EVENT_BUBBLE}, {mousemoveW, onmousemoveW, EVENTT_MOUSE, DISPID_EVMETH_ONMOUSEMOVE, @@ -222,8 +221,6 @@ EVENT_DEFAULTLISTENER|EVENT_BUBBLE|EVENT_CANCELABLE} }; -static const eventid_t node_handled_list[] = { EVENTID_ABORT, EVENTID_ERROR, EVENTID_LOAD }; - eventid_t str_to_eid(LPCWSTR str) { int i; @@ -249,19 +246,6 @@ return EVENTID_LAST; } -static DWORD get_node_handler_mask(eventid_t eid) -{ - DWORD i; - - for(i=0; insdoc) - return S_OK; - - if(event_info[eid].flags & EVENT_NODEHANDLER) { - DWORD mask; + nsIDOMNode *nsnode = NULL; - mask = get_node_handler_mask(eid); - if(event_target->node_handlers_mask & mask) - return S_OK; + TRACE("%s\n", debugstr_w(event_info[eid].name)); - add_nsevent_listener(doc, nsnode, event_info[eid].name); - event_target->node_handlers_mask |= mask; + if(!doc->nsdoc || doc->event_vector[eid] || !(event_info[eid].flags & (EVENT_DEFAULTLISTENER|EVENT_BIND_TO_BODY))) return S_OK; - } - if(!(event_info[eid].flags & EVENT_DEFAULTLISTENER)) - return S_OK; + if(event_info[eid].flags & EVENT_BIND_TO_BODY) { + nsIDOMHTMLElement *nsbody; + nsresult nsres; - if(!doc->event_vector[eid]) { - doc->event_vector[eid] = TRUE; - add_nsevent_listener(doc, NULL, event_info[eid].name); + nsres = nsIDOMHTMLDocument_GetBody(doc->nsdoc, &nsbody); + if(NS_SUCCEEDED(nsres) && nsbody) { + nsnode = (nsIDOMNode*)nsbody; + }else { + ERR("GetBody failed: %08x\n", nsres); + return E_UNEXPECTED; + } } + doc->event_vector[eid] = TRUE; + add_nsevent_listener(doc, nsnode, event_info[eid].name); + + if(nsnode) + nsIDOMNode_Release(nsnode); return S_OK; } @@ -1392,7 +1378,7 @@ return S_OK; } -static HRESULT set_event_handler_disp(event_target_t **event_target_ptr, nsIDOMNode *nsnode, HTMLDocumentNode *doc, +static HRESULT set_event_handler_disp(event_target_t **event_target_ptr, HTMLDocumentNode *doc, eventid_t eid, IDispatch *disp) { event_target_t *event_target; @@ -1413,17 +1399,17 @@ event_target->event_table[eid]->handler_prop = disp; IDispatch_AddRef(disp); - return ensure_nsevent_handler(doc, event_target, nsnode, eid); + return ensure_nsevent_handler(doc, event_target, eid); } -HRESULT set_event_handler(event_target_t **event_target, nsIDOMNode *nsnode, HTMLDocumentNode *doc, eventid_t eid, VARIANT *var) +HRESULT set_event_handler(event_target_t **event_target, HTMLDocumentNode *doc, eventid_t eid, VARIANT *var) { switch(V_VT(var)) { case VT_NULL: return remove_event_handler(event_target, eid); case VT_DISPATCH: - return set_event_handler_disp(event_target, nsnode, doc, eid, V_DISPATCH(var)); + return set_event_handler_disp(event_target, doc, eid, V_DISPATCH(var)); default: FIXME("not handler %s\n", debugstr_variant(var)); @@ -1448,7 +1434,7 @@ return S_OK; } -HRESULT attach_event(event_target_t **event_target_ptr, nsIDOMNode *nsnode, HTMLDocument *doc, BSTR name, +HRESULT attach_event(event_target_t **event_target_ptr, HTMLDocument *doc, BSTR name, IDispatch *disp, VARIANT_BOOL *res) { event_target_t *event_target; @@ -1479,7 +1465,7 @@ event_target->event_table[eid]->handlers[i] = disp; *res = VARIANT_TRUE; - return ensure_nsevent_handler(doc->doc_node, event_target, nsnode, eid); + return ensure_nsevent_handler(doc->doc_node, event_target, eid); } HRESULT detach_event(event_target_t *event_target, HTMLDocument *doc, BSTR name, IDispatch *disp) @@ -1522,10 +1508,10 @@ return; } - set_event_handler_disp(event_target, node ? node->nsnode : NULL, doc, eid, disp); + set_event_handler_disp(event_target, doc, eid, disp); } -void update_cp_events(HTMLInnerWindow *window, event_target_t **event_target_ptr, cp_static_data_t *cp, nsIDOMNode *nsnode) +void update_cp_events(HTMLInnerWindow *window, event_target_t **event_target_ptr, cp_static_data_t *cp) { event_target_t *event_target; int i; @@ -1536,7 +1522,7 @@ for(i=0; i < EVENTID_LAST; i++) { if((event_info[i].flags & EVENT_DEFAULTLISTENER) && is_cp_event(cp, event_info[i].dispid)) - ensure_nsevent_handler(window->doc, event_target, nsnode, i); + ensure_nsevent_handler(window->doc, event_target, i); } } @@ -1567,7 +1553,7 @@ if(disp) { hres = get_node(doc, (nsIDOMNode*)nselem, TRUE, &node); if(SUCCEEDED(hres)) { - set_event_handler_disp(get_node_event_target(node), node->nsnode, node->doc, i, disp); + set_event_handler_disp(get_node_event_target(node), node->doc, i, disp); node_release(node); } IDispatch_Release(disp); @@ -1592,7 +1578,7 @@ for(i=0; i < EVENTID_LAST; i++) { if(event_info[i].flags & EVENT_HASDEFAULTHANDLERS) { - hres = ensure_nsevent_handler(doc, NULL, NULL, i); + hres = ensure_nsevent_handler(doc, NULL, i); if(FAILED(hres)) return hres; } diff -Nru wine1.7-1.7.14/dlls/mshtml/htmlevent.h wine1.7-1.7.18/dlls/mshtml/htmlevent.h --- wine1.7-1.7.14/dlls/mshtml/htmlevent.h 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/mshtml/htmlevent.h 2014-05-02 18:15:48.000000000 +0000 @@ -51,14 +51,14 @@ eventid_t str_to_eid(LPCWSTR) DECLSPEC_HIDDEN; void check_event_attr(HTMLDocumentNode*,nsIDOMElement*) DECLSPEC_HIDDEN; void release_event_target(event_target_t*) DECLSPEC_HIDDEN; - void fire_event(HTMLDocumentNode*,eventid_t,BOOL,nsIDOMNode*,nsIDOMEvent*,IDispatch*) DECLSPEC_HIDDEN; -HRESULT set_event_handler(event_target_t**,nsIDOMNode*,HTMLDocumentNode*,eventid_t,VARIANT*) DECLSPEC_HIDDEN; +void fire_event(HTMLDocumentNode*,eventid_t,BOOL,nsIDOMNode*,nsIDOMEvent*,IDispatch*) DECLSPEC_HIDDEN; +HRESULT set_event_handler(event_target_t**,HTMLDocumentNode*,eventid_t,VARIANT*) DECLSPEC_HIDDEN; HRESULT get_event_handler(event_target_t**,eventid_t,VARIANT*) DECLSPEC_HIDDEN; -HRESULT attach_event(event_target_t**,nsIDOMNode*,HTMLDocument*,BSTR,IDispatch*,VARIANT_BOOL*) DECLSPEC_HIDDEN; +HRESULT attach_event(event_target_t**,HTMLDocument*,BSTR,IDispatch*,VARIANT_BOOL*) DECLSPEC_HIDDEN; HRESULT detach_event(event_target_t*,HTMLDocument*,BSTR,IDispatch*) DECLSPEC_HIDDEN; HRESULT dispatch_event(HTMLDOMNode*,const WCHAR*,VARIANT*,VARIANT_BOOL*) DECLSPEC_HIDDEN; HRESULT call_fire_event(HTMLDOMNode*,eventid_t) DECLSPEC_HIDDEN; -void update_cp_events(HTMLInnerWindow*,event_target_t**,cp_static_data_t*,nsIDOMNode*) DECLSPEC_HIDDEN; +void update_cp_events(HTMLInnerWindow*,event_target_t**,cp_static_data_t*) DECLSPEC_HIDDEN; HRESULT doc_init_events(HTMLDocumentNode*) DECLSPEC_HIDDEN; void detach_events(HTMLDocumentNode *doc) DECLSPEC_HIDDEN; HRESULT create_event_obj(IHTMLEventObj**) DECLSPEC_HIDDEN; @@ -76,7 +76,7 @@ static inline HRESULT set_node_event(HTMLDOMNode *node, eventid_t eid, VARIANT *var) { - return set_event_handler(get_node_event_target(node), node->nsnode, node->doc, eid, var); + return set_event_handler(get_node_event_target(node), node->doc, eid, var); } static inline HRESULT get_node_event(HTMLDOMNode *node, eventid_t eid, VARIANT *var) diff -Nru wine1.7-1.7.14/dlls/mshtml/htmlform.c wine1.7-1.7.18/dlls/mshtml/htmlform.c --- wine1.7-1.7.14/dlls/mshtml/htmlform.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/mshtml/htmlform.c 2014-05-02 18:15:48.000000000 +0000 @@ -362,9 +362,9 @@ static HRESULT WINAPI HTMLFormElement_submit(IHTMLFormElement *iface) { HTMLFormElement *This = impl_from_IHTMLFormElement(iface); - HTMLOuterWindow *window = NULL; + HTMLOuterWindow *window = NULL, *this_window = NULL; nsIInputStream *post_stream; - nsAString action_uri_str; + nsAString action_uri_str, target_str; IUri *uri; nsresult nsres; HRESULT hres; @@ -374,19 +374,32 @@ if(This->element.node.doc) { HTMLDocumentNode *doc = This->element.node.doc; if(doc->window && doc->window->base.outer_window) - window = doc->window->base.outer_window; + this_window = doc->window->base.outer_window; } - if(!window) { + if(!this_window) { TRACE("No outer window\n"); return S_OK; } + nsAString_Init(&target_str, NULL); + nsres = nsIDOMHTMLFormElement_GetTarget(This->nsform, &target_str); + if(NS_SUCCEEDED(nsres)) { + BOOL use_new_window; + window = get_target_window(this_window, &target_str, &use_new_window); + if(use_new_window) + FIXME("submit to new window is not supported\n"); + } + nsAString_Finish(&target_str); + if(!window) + return S_OK; + /* * FIXME: We currently don't use our submit implementation for sub-windows because * load_nsuri can't support post data. We should fix it. */ if(!window->doc_obj || window->doc_obj->basedoc.window != window) { nsres = nsIDOMHTMLFormElement_Submit(This->nsform); + IHTMLWindow2_Release(&window->base.IHTMLWindow2_iface); if(NS_FAILED(nsres)) { ERR("Submit failed: %08x\n", nsres); return E_FAIL; @@ -414,6 +427,7 @@ IUri_Release(uri); } + IHTMLWindow2_Release(&window->base.IHTMLWindow2_iface); if(post_stream) nsIInputStream_Release(post_stream); return hres; diff -Nru wine1.7-1.7.14/dlls/mshtml/htmlframebase.c wine1.7-1.7.18/dlls/mshtml/htmlframebase.c --- wine1.7-1.7.14/dlls/mshtml/htmlframebase.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/mshtml/htmlframebase.c 2014-05-02 18:15:48.000000000 +0000 @@ -28,6 +28,7 @@ #include "mshtml_private.h" #include "binding.h" +#include "htmlevent.h" #include "wine/debug.h" @@ -593,15 +594,19 @@ static HRESULT WINAPI HTMLFrameBase2_put_onload(IHTMLFrameBase2 *iface, VARIANT v) { HTMLFrameBase *This = impl_from_IHTMLFrameBase2(iface); - FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); - return E_NOTIMPL; + + TRACE("(%p)->(%s)\n", This, debugstr_variant(&v)); + + return set_node_event(&This->element.node, EVENTID_LOAD, &v); } static HRESULT WINAPI HTMLFrameBase2_get_onload(IHTMLFrameBase2 *iface, VARIANT *p) { HTMLFrameBase *This = impl_from_IHTMLFrameBase2(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + + TRACE("(%p)->(%p)\n", This, p); + + return get_node_event(&This->element.node, EVENTID_LOAD, p); } static HRESULT WINAPI HTMLFrameBase2_put_onreadystatechange(IHTMLFrameBase2 *iface, VARIANT v) diff -Nru wine1.7-1.7.14/dlls/mshtml/htmlnode.c wine1.7-1.7.18/dlls/mshtml/htmlnode.c --- wine1.7-1.7.14/dlls/mshtml/htmlnode.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/mshtml/htmlnode.c 2014-05-02 18:15:48.000000000 +0000 @@ -48,6 +48,155 @@ nsIDOMNodeList *nslist; } HTMLDOMChildrenCollection; +typedef struct { + IEnumVARIANT IEnumVARIANT_iface; + + LONG ref; + + ULONG iter; + HTMLDOMChildrenCollection *col; +} HTMLDOMChildrenCollectionEnum; + +static inline HTMLDOMChildrenCollectionEnum *impl_from_IEnumVARIANT(IEnumVARIANT *iface) +{ + return CONTAINING_RECORD(iface, HTMLDOMChildrenCollectionEnum, IEnumVARIANT_iface); +} + +static HRESULT WINAPI HTMLDOMChildrenCollectionEnum_QueryInterface(IEnumVARIANT *iface, REFIID riid, void **ppv) +{ + HTMLDOMChildrenCollectionEnum *This = impl_from_IEnumVARIANT(iface); + + if(IsEqualGUID(riid, &IID_IUnknown)) { + TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv); + *ppv = &This->IEnumVARIANT_iface; + }else if(IsEqualGUID(riid, &IID_IEnumVARIANT)) { + TRACE("(%p)->(IID_IEnumVARIANT %p)\n", This, ppv); + *ppv = &This->IEnumVARIANT_iface; + }else { + FIXME("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv); + *ppv = NULL; + return E_NOINTERFACE; + } + + IUnknown_AddRef((IUnknown*)*ppv); + return S_OK; +} + +static ULONG WINAPI HTMLDOMChildrenCollectionEnum_AddRef(IEnumVARIANT *iface) +{ + HTMLDOMChildrenCollectionEnum *This = impl_from_IEnumVARIANT(iface); + LONG ref = InterlockedIncrement(&This->ref); + + TRACE("(%p) ref=%d\n", This, ref); + + return ref; +} + +static ULONG WINAPI HTMLDOMChildrenCollectionEnum_Release(IEnumVARIANT *iface) +{ + HTMLDOMChildrenCollectionEnum *This = impl_from_IEnumVARIANT(iface); + LONG ref = InterlockedDecrement(&This->ref); + + TRACE("(%p) ref=%d\n", This, ref); + + if(!ref) { + IHTMLDOMChildrenCollection_Release(&This->col->IHTMLDOMChildrenCollection_iface); + heap_free(This); + } + + return ref; +} + +static ULONG get_enum_len(HTMLDOMChildrenCollectionEnum *This) +{ + ULONG len; + nsresult nsres; + + nsres = nsIDOMNodeList_GetLength(This->col->nslist, &len); + assert(nsres == NS_OK); + return len; +} + +static HRESULT WINAPI HTMLDOMChildrenCollectionEnum_Next(IEnumVARIANT *iface, ULONG celt, VARIANT *rgVar, ULONG *pCeltFetched) +{ + HTMLDOMChildrenCollectionEnum *This = impl_from_IEnumVARIANT(iface); + ULONG fetched = 0, len; + nsIDOMNode *nsnode; + HTMLDOMNode *node; + nsresult nsres; + HRESULT hres; + + TRACE("(%p)->(%d %p %p)\n", This, celt, rgVar, pCeltFetched); + + len = get_enum_len(This); + + while(This->iter+fetched < len && fetched < celt) { + nsres = nsIDOMNodeList_Item(This->col->nslist, This->iter+fetched, &nsnode); + assert(nsres == NS_OK); + + hres = get_node(This->col->doc, nsnode, TRUE, &node); + nsIDOMNode_Release(nsnode); + if(FAILED(hres)) { + ERR("get_node failed: %08x\n", hres); + break; + } + + V_VT(rgVar+fetched) = VT_DISPATCH; + IHTMLDOMNode_AddRef(&node->IHTMLDOMNode_iface); + V_DISPATCH(rgVar+fetched) = (IDispatch*)&node->IHTMLDOMNode_iface; + fetched++; + } + + This->iter += fetched; + if(pCeltFetched) + *pCeltFetched = fetched; + return fetched == celt ? S_OK : S_FALSE; +} + +static HRESULT WINAPI HTMLDOMChildrenCollectionEnum_Skip(IEnumVARIANT *iface, ULONG celt) +{ + HTMLDOMChildrenCollectionEnum *This = impl_from_IEnumVARIANT(iface); + ULONG len; + + TRACE("(%p)->(%d)\n", This, celt); + + len = get_enum_len(This); + if(This->iter + celt > len) { + This->iter = len; + return S_FALSE; + } + + This->iter += celt; + return S_OK; +} + +static HRESULT WINAPI HTMLDOMChildrenCollectionEnum_Reset(IEnumVARIANT *iface) +{ + HTMLDOMChildrenCollectionEnum *This = impl_from_IEnumVARIANT(iface); + + TRACE("(%p)->()\n", This); + + This->iter = 0; + return S_OK; +} + +static HRESULT WINAPI HTMLDOMChildrenCollectionEnum_Clone(IEnumVARIANT *iface, IEnumVARIANT **ppEnum) +{ + HTMLDOMChildrenCollectionEnum *This = impl_from_IEnumVARIANT(iface); + FIXME("(%p)->(%p)\n", This, ppEnum); + return E_NOTIMPL; +} + +static const IEnumVARIANTVtbl HTMLDOMChildrenCollectionEnumVtbl = { + HTMLDOMChildrenCollectionEnum_QueryInterface, + HTMLDOMChildrenCollectionEnum_AddRef, + HTMLDOMChildrenCollectionEnum_Release, + HTMLDOMChildrenCollectionEnum_Next, + HTMLDOMChildrenCollectionEnum_Skip, + HTMLDOMChildrenCollectionEnum_Reset, + HTMLDOMChildrenCollectionEnum_Clone +}; + static inline HTMLDOMChildrenCollection *impl_from_IHTMLDOMChildrenCollection(IHTMLDOMChildrenCollection *iface) { return CONTAINING_RECORD(iface, HTMLDOMChildrenCollection, IHTMLDOMChildrenCollection_iface); @@ -146,11 +295,26 @@ return S_OK; } -static HRESULT WINAPI HTMLDOMChildrenCollection__newEnum(IHTMLDOMChildrenCollection *iface, IUnknown **p) +static HRESULT WINAPI HTMLDOMChildrenCollection_get__newEnum(IHTMLDOMChildrenCollection *iface, IUnknown **p) { HTMLDOMChildrenCollection *This = impl_from_IHTMLDOMChildrenCollection(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + HTMLDOMChildrenCollectionEnum *ret; + + TRACE("(%p)->(%p)\n", This, p); + + ret = heap_alloc(sizeof(*ret)); + if(!ret) + return E_OUTOFMEMORY; + + ret->IEnumVARIANT_iface.lpVtbl = &HTMLDOMChildrenCollectionEnumVtbl; + ret->ref = 1; + ret->iter = 0; + + IHTMLDOMChildrenCollection_AddRef(&This->IHTMLDOMChildrenCollection_iface); + ret->col = This; + + *p = (IUnknown*)&ret->IEnumVARIANT_iface; + return S_OK; } static HRESULT WINAPI HTMLDOMChildrenCollection_item(IHTMLDOMChildrenCollection *iface, LONG index, IDispatch **ppItem) @@ -196,7 +360,7 @@ HTMLDOMChildrenCollection_GetIDsOfNames, HTMLDOMChildrenCollection_Invoke, HTMLDOMChildrenCollection_get_length, - HTMLDOMChildrenCollection__newEnum, + HTMLDOMChildrenCollection_get__newEnum, HTMLDOMChildrenCollection_item }; diff -Nru wine1.7-1.7.14/dlls/mshtml/htmlstyle.c wine1.7-1.7.18/dlls/mshtml/htmlstyle.c --- wine1.7-1.7.14/dlls/mshtml/htmlstyle.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/mshtml/htmlstyle.c 2014-05-02 18:15:48.000000000 +0000 @@ -126,6 +126,8 @@ {'l','e','t','t','e','r','-','s','p','a','c','i','n','g',0}; static const WCHAR attrLineHeight[] = {'l','i','n','e','-','h','e','i','g','h','t',0}; +static const WCHAR attrListStyleType[] = + {'l','i','s','t','-','s','t','y','l','e','-','t','y','p','e',0}; static const WCHAR attrMargin[] = {'m','a','r','g','i','n',0}; static const WCHAR attrMarginBottom[] = @@ -241,6 +243,7 @@ {attrLeft, DISPID_IHTMLSTYLE_LEFT}, {attrLetterSpacing, DISPID_IHTMLSTYLE_LETTERSPACING}, {attrLineHeight, DISPID_IHTMLSTYLE_LINEHEIGHT}, + {attrListStyleType, DISPID_IHTMLSTYLE_LISTSTYLETYPE}, {attrMargin, DISPID_IHTMLSTYLE_MARGIN}, {attrMarginBottom, DISPID_IHTMLSTYLE_MARGINBOTTOM}, {attrMarginLeft, DISPID_IHTMLSTYLE_MARGINLEFT}, @@ -2168,15 +2171,19 @@ static HRESULT WINAPI HTMLStyle_put_listStyleType(IHTMLStyle *iface, BSTR v) { HTMLStyle *This = impl_from_IHTMLStyle(iface); - FIXME("(%p)->(%s)\n", This, debugstr_w(v)); - return E_NOTIMPL; + + TRACE("(%p)->(%s)\n", This, debugstr_w(v)); + + return set_style_attr(This, STYLEID_LISTSTYLETYPE, v, 0); } static HRESULT WINAPI HTMLStyle_get_listStyleType(IHTMLStyle *iface, BSTR *p) { HTMLStyle *This = impl_from_IHTMLStyle(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + + TRACE("(%p)->(%p)\n", This, p); + + return get_style_attr(This, STYLEID_LISTSTYLETYPE, p); } static HRESULT WINAPI HTMLStyle_put_listStylePosition(IHTMLStyle *iface, BSTR v) diff -Nru wine1.7-1.7.14/dlls/mshtml/htmlstyle.h wine1.7-1.7.18/dlls/mshtml/htmlstyle.h --- wine1.7-1.7.14/dlls/mshtml/htmlstyle.h 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/mshtml/htmlstyle.h 2014-05-02 18:15:48.000000000 +0000 @@ -78,6 +78,7 @@ STYLEID_LEFT, STYLEID_LETTER_SPACING, STYLEID_LINE_HEIGHT, + STYLEID_LISTSTYLETYPE, STYLEID_MARGIN, STYLEID_MARGIN_BOTTOM, STYLEID_MARGIN_LEFT, diff -Nru wine1.7-1.7.14/dlls/mshtml/htmltable.c wine1.7-1.7.18/dlls/mshtml/htmltable.c --- wine1.7-1.7.14/dlls/mshtml/htmltable.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/mshtml/htmltable.c 2014-05-02 18:15:48.000000000 +0000 @@ -57,6 +57,57 @@ return CONTAINING_RECORD(iface, HTMLTable, IHTMLTable3_iface); } +static HRESULT var2str(const VARIANT *p, nsAString *nsstr) +{ + BSTR str; + BOOL ret; + HRESULT hres; + + switch(V_VT(p)) { + case VT_BSTR: + return nsAString_Init(nsstr, V_BSTR(p))? + S_OK : E_OUTOFMEMORY; + case VT_R8: + hres = VarBstrFromR8(V_R8(p), 0, 0, &str); + break; + case VT_R4: + hres = VarBstrFromR4(V_R4(p), 0, 0, &str); + break; + case VT_I4: + hres = VarBstrFromI4(V_I4(p), 0, 0, &str); + break; + default: + FIXME("unsupported arg %s\n", debugstr_variant(p)); + return E_NOTIMPL; + } + if (FAILED(hres)) + return hres; + + ret = nsAString_Init(nsstr, str); + SysFreeString(str); + return ret ? S_OK : E_OUTOFMEMORY; +} + +static HRESULT nsstr_to_truncated_bstr(const nsAString *nsstr, BSTR *ret_ptr) +{ + const PRUnichar *str, *ptr, *end = NULL; + BSTR ret; + + nsAString_GetData(nsstr, &str); + + for(ptr = str; isdigitW(*ptr); ptr++); + if(*ptr == '.') { + for(end = ptr++; isdigitW(*ptr); ptr++); + if(*ptr) + end = NULL; + } + + ret = end ? SysAllocStringLen(str, end-str) : SysAllocString(str); + + *ret_ptr = ret; + return ret ? S_OK : E_OUTOFMEMORY; +} + static HRESULT WINAPI HTMLTable_QueryInterface(IHTMLTable *iface, REFIID riid, void **ppv) { @@ -246,15 +297,48 @@ static HRESULT WINAPI HTMLTable_put_bgColor(IHTMLTable *iface, VARIANT v) { HTMLTable *This = impl_from_IHTMLTable(iface); - FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); - return E_NOTIMPL; + nsAString val; + nsresult nsres; + + TRACE("(%p)->(%s)\n", This, debugstr_variant(&v)); + + if(!variant_to_nscolor(&v, &val)) + return S_OK; + + nsres = nsIDOMHTMLTableElement_SetBgColor(This->nstable, &val); + nsAString_Finish(&val); + if (NS_FAILED(nsres)){ + ERR("Set BgColor(%s) failed!\n", debugstr_variant(&v)); + return E_FAIL; + } + + return S_OK; } static HRESULT WINAPI HTMLTable_get_bgColor(IHTMLTable *iface, VARIANT *p) { HTMLTable *This = impl_from_IHTMLTable(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + nsAString strColor; + nsresult nsres; + HRESULT hres; + const PRUnichar *color; + + TRACE("(%p)->(%p)\n", This, p); + + nsAString_Init(&strColor, NULL); + nsres = nsIDOMHTMLTableElement_GetBgColor(This->nstable, &strColor); + + if(NS_SUCCEEDED(nsres)) { + nsAString_GetData(&strColor, &color); + V_VT(p) = VT_BSTR; + hres = nscolor_to_str(color, &V_BSTR(p)); + }else { + ERR("SetBgColor failed: %08x\n", nsres); + hres = E_FAIL; + } + + nsAString_Finish(&strColor); + return hres; } static HRESULT WINAPI HTMLTable_put_borderColor(IHTMLTable *iface, VARIANT v) @@ -302,15 +386,34 @@ static HRESULT WINAPI HTMLTable_put_align(IHTMLTable *iface, BSTR v) { HTMLTable *This = impl_from_IHTMLTable(iface); - FIXME("(%p)->(%s)\n", This, debugstr_w(v)); - return E_NOTIMPL; + nsAString val; + nsresult nsres; + + TRACE("(%p)->(%s)\n", This, debugstr_w(v)); + + nsAString_InitDepend(&val, v); + + nsres = nsIDOMHTMLTableElement_SetAlign(This->nstable, &val); + nsAString_Finish(&val); + if (NS_FAILED(nsres)){ + ERR("Set Align(%s) failed!\n", debugstr_w(v)); + return E_FAIL; + } + return S_OK; } static HRESULT WINAPI HTMLTable_get_align(IHTMLTable *iface, BSTR *p) { HTMLTable *This = impl_from_IHTMLTable(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + nsAString val; + nsresult nsres; + + TRACE("(%p)->(%p)\n", This, p); + + nsAString_Init(&val, NULL); + nsres = nsIDOMHTMLTableElement_GetAlign(This->nstable, &val); + + return return_nsstr(nsres, &val, p); } static HRESULT WINAPI HTMLTable_refresh(IHTMLTable *iface) @@ -343,15 +446,52 @@ static HRESULT WINAPI HTMLTable_put_width(IHTMLTable *iface, VARIANT v) { HTMLTable *This = impl_from_IHTMLTable(iface); - FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); - return E_NOTIMPL; + nsAString val; + HRESULT hres; + nsresult nsres; + + TRACE("(%p)->(%s)\n", This, debugstr_variant(&v)); + hres = var2str(&v, &val); + + if (FAILED(hres)){ + ERR("Set Width(%s) failed when initializing a nsAString, err = %08x\n", + debugstr_variant(&v), hres); + return hres; + } + + nsres = nsIDOMHTMLTableElement_SetWidth(This->nstable, &val); + nsAString_Finish(&val); + + if (NS_FAILED(nsres)){ + ERR("Set Width(%s) failed, err = %08x\n", debugstr_variant(&v), nsres); + return E_FAIL; + } + return S_OK; } static HRESULT WINAPI HTMLTable_get_width(IHTMLTable *iface, VARIANT *p) { HTMLTable *This = impl_from_IHTMLTable(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + nsAString val; + BSTR bstr; + nsresult nsres; + HRESULT hres; + + TRACE("(%p)->(%p)\n", This, p); + nsAString_Init(&val, NULL); + nsres = nsIDOMHTMLTableElement_GetWidth(This->nstable, &val); + if (NS_FAILED(nsres)){ + ERR("Get Width failed!\n"); + nsAString_Finish(&val); + return E_FAIL; + } + + hres = nsstr_to_truncated_bstr(&val, &bstr); + nsAString_Finish(&val); + + V_VT(p) = VT_BSTR; + V_BSTR(p) = bstr; + return hres; } static HRESULT WINAPI HTMLTable_put_height(IHTMLTable *iface, VARIANT v) diff -Nru wine1.7-1.7.14/dlls/mshtml/htmltablerow.c wine1.7-1.7.18/dlls/mshtml/htmltablerow.c --- wine1.7-1.7.14/dlls/mshtml/htmltablerow.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/mshtml/htmltablerow.c 2014-05-02 18:15:48.000000000 +0000 @@ -102,43 +102,116 @@ static HRESULT WINAPI HTMLTableRow_put_align(IHTMLTableRow *iface, BSTR v) { HTMLTableRow *This = impl_from_IHTMLTableRow(iface); - FIXME("(%p)->(%s)\n", This, debugstr_w(v)); - return E_NOTIMPL; + nsAString val; + nsresult nsres; + + TRACE("(%p)->(%s)\n", This, debugstr_w(v)); + + nsAString_InitDepend(&val, v); + + nsres = nsIDOMHTMLTableRowElement_SetAlign(This->nsrow, &val); + nsAString_Finish(&val); + if (NS_FAILED(nsres)){ + ERR("Set Align(%s) failed!\n", debugstr_w(v)); + return E_FAIL; + } + return S_OK; } static HRESULT WINAPI HTMLTableRow_get_align(IHTMLTableRow *iface, BSTR *p) { HTMLTableRow *This = impl_from_IHTMLTableRow(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + nsAString val; + nsresult nsres; + + TRACE("(%p)->(%p)\n", This, p); + + nsAString_Init(&val, NULL); + nsres = nsIDOMHTMLTableRowElement_GetAlign(This->nsrow, &val); + + return return_nsstr(nsres, &val, p); } static HRESULT WINAPI HTMLTableRow_put_vAlign(IHTMLTableRow *iface, BSTR v) { HTMLTableRow *This = impl_from_IHTMLTableRow(iface); - FIXME("(%p)->(%s)\n", This, debugstr_w(v)); - return E_NOTIMPL; + nsAString val; + nsresult nsres; + + TRACE("(%p)->(%s)\n", This, debugstr_w(v)); + + nsAString_InitDepend(&val, v); + + nsres = nsIDOMHTMLTableRowElement_SetVAlign(This->nsrow, &val); + nsAString_Finish(&val); + + if (NS_FAILED(nsres)){ + ERR("Set VAlign(%s) failed!\n", debugstr_w(v)); + return E_FAIL; + } + + return S_OK; } static HRESULT WINAPI HTMLTableRow_get_vAlign(IHTMLTableRow *iface, BSTR *p) { HTMLTableRow *This = impl_from_IHTMLTableRow(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + nsAString val; + nsresult nsres; + + TRACE("(%p)->(%p)\n", This, p); + + nsAString_Init(&val, NULL); + nsres = nsIDOMHTMLTableRowElement_GetVAlign(This->nsrow, &val); + + return return_nsstr(nsres, &val, p); } static HRESULT WINAPI HTMLTableRow_put_bgColor(IHTMLTableRow *iface, VARIANT v) { HTMLTableRow *This = impl_from_IHTMLTableRow(iface); - FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); - return E_NOTIMPL; + nsAString val; + nsresult nsres; + + TRACE("(%p)->(%s)\n", This, debugstr_variant(&v)); + + nsAString_InitDepend(&val, V_BSTR(&v)); + variant_to_nscolor(&v, &val); + nsres = nsIDOMHTMLTableRowElement_SetBgColor(This->nsrow, &val); + nsAString_Finish(&val); + + if (NS_FAILED(nsres)){ + ERR("Set BgColor(%s) failed!\n", debugstr_variant(&v)); + return E_FAIL; + } + + return S_OK; } static HRESULT WINAPI HTMLTableRow_get_bgColor(IHTMLTableRow *iface, VARIANT *p) { HTMLTableRow *This = impl_from_IHTMLTableRow(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + nsAString strColor; + nsresult nsres; + HRESULT hres; + const PRUnichar *color; + + TRACE("(%p)->(%p)\n", This, p); + + nsAString_Init(&strColor, NULL); + nsres = nsIDOMHTMLTableRowElement_GetBgColor(This->nsrow, &strColor); + + if(NS_SUCCEEDED(nsres)) { + nsAString_GetData(&strColor, &color); + V_VT(p) = VT_BSTR; + hres = nscolor_to_str(color, &V_BSTR(p)); + }else { + ERR("SetBgColor failed: %08x\n", nsres); + hres = E_FAIL; + } + + nsAString_Finish(&strColor); + return hres; } static HRESULT WINAPI HTMLTableRow_put_borderColor(IHTMLTableRow *iface, VARIANT v) @@ -186,15 +259,29 @@ static HRESULT WINAPI HTMLTableRow_get_rowIndex(IHTMLTableRow *iface, LONG *p) { HTMLTableRow *This = impl_from_IHTMLTableRow(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + nsresult nsres; + + TRACE("(%p)->(%p)\n", This, p); + nsres = nsIDOMHTMLTableRowElement_GetRowIndex(This->nsrow, p); + if(NS_FAILED(nsres)) { + ERR("Get rowIndex failed: %08x\n", nsres); + return E_FAIL; + } + return S_OK; } -static HRESULT WINAPI HTMLTableRow_get_selectionRowIndex(IHTMLTableRow *iface, LONG *p) +static HRESULT WINAPI HTMLTableRow_get_sectionRowIndex(IHTMLTableRow *iface, LONG *p) { HTMLTableRow *This = impl_from_IHTMLTableRow(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + nsresult nsres; + + TRACE("(%p)->(%p)\n", This, p); + nsres = nsIDOMHTMLTableRowElement_GetSectionRowIndex(This->nsrow, p); + if(NS_FAILED(nsres)) { + ERR("Get selectionRowIndex failed: %08x\n", nsres); + return E_FAIL; + } + return S_OK; } static HRESULT WINAPI HTMLTableRow_get_cells(IHTMLTableRow *iface, IHTMLElementCollection **p) @@ -252,7 +339,7 @@ HTMLTableRow_put_borderColorDark, HTMLTableRow_get_borderColorDark, HTMLTableRow_get_rowIndex, - HTMLTableRow_get_selectionRowIndex, + HTMLTableRow_get_sectionRowIndex, HTMLTableRow_get_cells, HTMLTableRow_insertCell, HTMLTableRow_deleteCell diff -Nru wine1.7-1.7.14/dlls/mshtml/htmlwindow.c wine1.7-1.7.18/dlls/mshtml/htmlwindow.c --- wine1.7-1.7.14/dlls/mshtml/htmlwindow.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/mshtml/htmlwindow.c 2014-05-02 18:15:48.000000000 +0000 @@ -95,7 +95,7 @@ return E_FAIL; } - return set_event_handler(&window->inner_window->doc->body_event_target, NULL, window->inner_window->doc, eid, var); + return set_event_handler(&window->inner_window->doc->body_event_target, window->inner_window->doc, eid, var); } static inline HRESULT get_window_event(HTMLWindow *window, eventid_t eid, VARIANT *var) @@ -1617,7 +1617,7 @@ return E_FAIL; } - return attach_event(&window->doc->body_event_target, NULL, &window->doc->basedoc, event, pDisp, pfResult); + return attach_event(&window->doc->body_event_target, &window->doc->basedoc, event, pDisp, pfResult); } static HRESULT WINAPI HTMLWindow3_detachEvent(IHTMLWindow3 *iface, BSTR event, IDispatch *pDisp) diff -Nru wine1.7-1.7.14/dlls/mshtml/main.c wine1.7-1.7.18/dlls/mshtml/main.c --- wine1.7-1.7.14/dlls/mshtml/main.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/mshtml/main.c 2014-05-02 18:15:48.000000000 +0000 @@ -531,3 +531,51 @@ return wine_dbg_sprintf("{vt %d}", V_VT(v)); } } + +const char *debugstr_mshtml_guid(const GUID *iid) +{ +#define X(x) if(IsEqualGUID(iid, &x)) return #x + X(DIID_DispHTMLDocument); + X(IID_IConnectionPointContainer); + X(IID_ICustomDoc); + X(IID_IDispatch); + X(IID_IDispatchEx); + X(IID_IHlinkTarget); + X(IID_IHTMLDocument); + X(IID_IHTMLDocument2); + X(IID_IHTMLDocument3); + X(IID_IHTMLDocument4); + X(IID_IHTMLDocument5); + X(IID_IHTMLDocument6); + X(IID_IHTMLDocument7); + X(IID_IInternetHostSecurityManager); + X(IID_IMonikerProp); + X(IID_IObjectSafety); + X(IID_IObjectWithSite); + X(IID_IOleContainer); + X(IID_IOleCommandTarget); + X(IID_IOleControl); + X(IID_IOleDocument); + X(IID_IOleDocumentView); + X(IID_IOleInPlaceActiveObject); + X(IID_IOleInPlaceObject); + X(IID_IOleInPlaceObjectWindowless); + X(IID_IOleObject); + X(IID_IOleWindow); + X(IID_IPersist); + X(IID_IPersistFile); + X(IID_IPersistHistory); + X(IID_IPersistMoniker); + X(IID_IPersistStreamInit); + X(IID_IProvideClassInfo); + X(IID_IServiceProvider); + X(IID_ISupportErrorInfo); + X(IID_ITargetContainer); + X(IID_IUnknown); + X(IID_IViewObject); + X(IID_IViewObject2); + X(IID_IViewObjectEx); +#undef X + + return debugstr_guid(iid); +} diff -Nru wine1.7-1.7.14/dlls/mshtml/Makefile.in wine1.7-1.7.18/dlls/mshtml/Makefile.in --- wine1.7-1.7.14/dlls/mshtml/Makefile.in 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/mshtml/Makefile.in 2014-05-02 18:15:48.000000000 +0000 @@ -14,8 +14,6 @@ htmlcomment.c \ htmlcurstyle.c \ htmldoc.c \ - htmldoc3.c \ - htmldoc5.c \ htmlelem.c \ htmlelem2.c \ htmlelem3.c \ diff -Nru wine1.7-1.7.14/dlls/mshtml/mshtml_private.h wine1.7-1.7.18/dlls/mshtml/mshtml_private.h --- wine1.7-1.7.14/dlls/mshtml/mshtml_private.h 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/mshtml/mshtml_private.h 2014-05-02 18:15:48.000000000 +0000 @@ -488,6 +488,7 @@ IHTMLDocument4 IHTMLDocument4_iface; IHTMLDocument5 IHTMLDocument5_iface; IHTMLDocument6 IHTMLDocument6_iface; + IHTMLDocument7 IHTMLDocument7_iface; IPersistMoniker IPersistMoniker_iface; IPersistFile IPersistFile_iface; IPersistHistory IPersistHistory_iface; @@ -760,8 +761,6 @@ HRESULT create_storage(IHTMLStorage**) DECLSPEC_HIDDEN; -void HTMLDocument_HTMLDocument3_Init(HTMLDocument*) DECLSPEC_HIDDEN; -void HTMLDocument_HTMLDocument5_Init(HTMLDocument*) DECLSPEC_HIDDEN; void HTMLDocument_Persist_Init(HTMLDocument*) DECLSPEC_HIDDEN; void HTMLDocument_OleCmd_Init(HTMLDocument*) DECLSPEC_HIDDEN; void HTMLDocument_OleObj_Init(HTMLDocument*) DECLSPEC_HIDDEN; @@ -863,6 +862,10 @@ HRESULT HTMLDOMTextNode_Create(HTMLDocumentNode*,nsIDOMNode*,HTMLDOMNode**) DECLSPEC_HIDDEN; +BOOL variant_to_nscolor(const VARIANT *v, nsAString *nsstr) DECLSPEC_HIDDEN; +HRESULT nscolor_to_str(LPCWSTR color, BSTR *ret) DECLSPEC_HIDDEN; + + struct HTMLAttributeCollection { DispatchEx dispex; IHTMLAttributeCollection IHTMLAttributeCollection_iface; @@ -944,6 +947,7 @@ HRESULT search_window_props(HTMLInnerWindow*,BSTR,DWORD,DISPID*) DECLSPEC_HIDDEN; HRESULT get_frame_by_name(HTMLOuterWindow*,const WCHAR*,BOOL,HTMLOuterWindow**) DECLSPEC_HIDDEN; HRESULT get_doc_elem_by_id(HTMLDocumentNode*,const WCHAR*,HTMLElement**) DECLSPEC_HIDDEN; +HTMLOuterWindow *get_target_window(HTMLOuterWindow*,nsAString*,BOOL*) DECLSPEC_HIDDEN; HRESULT wrap_iface(IUnknown*,IUnknown*,IUnknown**) DECLSPEC_HIDDEN; @@ -1018,6 +1022,7 @@ HRESULT clear_task_timer(HTMLInnerWindow*,BOOL,DWORD) DECLSPEC_HIDDEN; const char *debugstr_variant(const VARIANT*) DECLSPEC_HIDDEN; +const char *debugstr_mshtml_guid(const GUID*) DECLSPEC_HIDDEN; DEFINE_GUID(CLSID_AboutProtocol, 0x3050F406, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B); DEFINE_GUID(CLSID_JSProtocol, 0x3050F3B2, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B); diff -Nru wine1.7-1.7.14/dlls/mshtml/navigate.c wine1.7-1.7.18/dlls/mshtml/navigate.c --- wine1.7-1.7.14/dlls/mshtml/navigate.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/mshtml/navigate.c 2014-05-02 18:15:48.000000000 +0000 @@ -1657,7 +1657,7 @@ static void handle_extern_mime_navigation(nsChannelBSC *This) { - IWebBrowserPriv2IE8 *webbrowser_priv; + IWebBrowserPriv2IE9 *webbrowser_priv; IOleCommandTarget *cmdtrg; HTMLDocumentObj *doc_obj; IBindCtx *bind_ctx; @@ -1698,8 +1698,8 @@ hres = IUnknown_QueryInterface(doc_obj->webbrowser, &IID_IWebBrowserPriv2IE8, (void**)&webbrowser_priv); if(SUCCEEDED(hres)) { - hres = IWebBrowserPriv2IE8_NavigateWithBindCtx2(webbrowser_priv, uri, &flags, NULL, NULL, NULL, bind_ctx, NULL); - IWebBrowserPriv2IE8_Release(webbrowser_priv); + hres = IWebBrowserPriv2IE9_NavigateWithBindCtx2(webbrowser_priv, uri, &flags, NULL, NULL, NULL, bind_ctx, NULL, 0); + IWebBrowserPriv2IE9_Release(webbrowser_priv); }else { IWebBrowserPriv *webbrowser_priv_old; VARIANT uriv; diff -Nru wine1.7-1.7.14/dlls/mshtml/nsiface.idl wine1.7-1.7.18/dlls/mshtml/nsiface.idl --- wine1.7-1.7.14/dlls/mshtml/nsiface.idl 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/mshtml/nsiface.idl 2014-05-02 18:15:48.000000000 +0000 @@ -1791,7 +1791,7 @@ nsresult Item(uint32_t index, nsIDOMNode **_retval); nsresult NamedItem(const nsAString *name, nsIDOMNode **_retval); nsresult Add(nsIDOMHTMLElement *element, nsIVariant *before); - nsresult Remove(int32_t index); + nsresult select_Remove(int32_t index); nsresult GetSelectedIndex(int32_t *aSelectedIndex); nsresult SetSelectedIndex(int32_t aSelectedIndex); nsresult GetValue(nsAString *aValue); diff -Nru wine1.7-1.7.14/dlls/mshtml/script.c wine1.7-1.7.18/dlls/mshtml/script.c --- wine1.7-1.7.14/dlls/mshtml/script.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/mshtml/script.c 2014-05-02 18:15:48.000000000 +0000 @@ -816,11 +816,13 @@ { const WCHAR text_javascriptW[] = {'t','e','x','t','/','j','a','v','a','s','c','r','i','p','t',0}; + const WCHAR text_jscriptW[] = + {'t','e','x','t','/','j','s','c','r','i','p','t',0}; const WCHAR text_vbscriptW[] = {'t','e','x','t','/','v','b','s','c','r','i','p','t',0}; /* FIXME: Handle more types */ - if(!strcmpiW(type, text_javascriptW)) { + if(!strcmpiW(type, text_javascriptW) || !strcmpiW(type, text_jscriptW)) { *guid = CLSID_JScript; }else if(!strcmpiW(type, text_vbscriptW)) { *guid = CLSID_VBScript; diff -Nru wine1.7-1.7.14/dlls/mshtml/tests/activex.c wine1.7-1.7.18/dlls/mshtml/tests/activex.c --- wine1.7-1.7.14/dlls/mshtml/tests/activex.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/mshtml/tests/activex.c 2014-05-02 18:15:48.000000000 +0000 @@ -977,7 +977,7 @@ static HRESULT WINAPI ViewObjectEx_QueryHitPoint(IViewObjectEx *iface, DWORD dwAspect, LPCRECT pRectBounds, POINT ptlLoc, LONG lCloseHint, DWORD *pHitResult) { - ok(0, "unexpected call\n"); + trace("QueryHitPoint call ignored\n"); return E_NOTIMPL; } @@ -2691,12 +2691,6 @@ IHTMLDocument5 *doc; HRESULT hres; - static const WCHAR xW[] = {'x',0}; - static const WCHAR yW[] = {'y',0}; - - if(!lstrcmpW(xW, yW)) - return FALSE; - hres = CoCreateInstance(&CLSID_HTMLDocument, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER, &IID_IHTMLDocument5, (void**)&doc); if(FAILED(hres)) diff -Nru wine1.7-1.7.14/dlls/mshtml/tests/blank.html wine1.7-1.7.18/dlls/mshtml/tests/blank.html --- wine1.7-1.7.14/dlls/mshtml/tests/blank.html 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.18/dlls/mshtml/tests/blank.html 2014-05-02 18:15:48.000000000 +0000 @@ -0,0 +1 @@ + diff -Nru wine1.7-1.7.14/dlls/mshtml/tests/dom.c wine1.7-1.7.18/dlls/mshtml/tests/dom.c --- wine1.7-1.7.14/dlls/mshtml/tests/dom.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/mshtml/tests/dom.c 2014-05-02 18:15:48.000000000 +0000 @@ -2108,9 +2108,12 @@ const elem_type_t *elem_types, LONG exlen) { IHTMLElementCollection *col; + IEnumVARIANT *enum_var; + IUnknown *enum_unk; + ULONG fetched; LONG len; DWORD i; - VARIANT name, index; + VARIANT name, index, v, vs[5]; IDispatch *disp, *disp2; HRESULT hres; @@ -2128,6 +2131,13 @@ V_VT(&index) = VT_EMPTY; + hres = IHTMLElementCollection_get__newEnum(col, &enum_unk); + ok_(__FILE__,line)(hres == S_OK, "_newEnum failed: %08x\n", hres); + + hres = IUnknown_QueryInterface(enum_unk, &IID_IEnumVARIANT, (void**)&enum_var); + IUnknown_Release(enum_unk); + ok_(__FILE__,line)(hres == S_OK, "Could not get IEnumVARIANT iface: %08x\n", hres); + for(i=0; i 2 ? len-2 : 0); + ok_(__FILE__,line)(hres == S_OK, "Skip failed: %08x\n", hres); + + memset(vs, 0, sizeof(vs)); + fetched = 0; + hres = IEnumVARIANT_Next(enum_var, sizeof(vs)/sizeof(*vs), vs, &fetched); + ok_(__FILE__,line)(hres == S_FALSE, "Next failed: %08x\n", hres); + ok_(__FILE__,line)(fetched == (len > 2 ? 2 : len), "fetched = %d\n", fetched); + if(len) { + ok_(__FILE__,line)(V_VT(vs) == VT_DISPATCH && V_DISPATCH(vs), "V_VT(vs[0]) = %d\n", V_VT(vs)); + IDispatch_Release(V_DISPATCH(vs)); + } + if(len > 1) { + ok_(__FILE__,line)(V_VT(vs+1) == VT_DISPATCH && V_DISPATCH(vs+1), "V_VT(vs[1]) = %d\n", V_VT(vs+1)); + IDispatch_Release(V_DISPATCH(vs+1)); + } + + hres = IEnumVARIANT_Reset(enum_var); + ok_(__FILE__,line)(hres == S_OK, "Reset failed: %08x\n", hres); + + hres = IEnumVARIANT_Skip(enum_var, len+1); + ok_(__FILE__,line)(hres == S_FALSE, "Skip failed: %08x\n", hres); + + IEnumVARIANT_Release(enum_var); + V_VT(&name) = VT_I4; V_I4(&name) = len; disp = (void*)0xdeadbeef; @@ -2950,6 +3012,31 @@ ok_(__FILE__,line)(specified == expected, "specified = %x, expected %x\n", specified, expected); } +static void test_contenteditable(IUnknown *unk) +{ + IHTMLElement3 *elem3 = get_elem3_iface(unk); + HRESULT hres; + BSTR str, strDefault; + + hres = IHTMLElement3_get_contentEditable(elem3, &strDefault); + ok(hres == S_OK, "get_contentEditable failed: 0x%08x\n", hres); + + str = a2bstr("true"); + hres = IHTMLElement3_put_contentEditable(elem3, str); + ok(hres == S_OK, "put_contentEditable(%s) failed: 0x%08x\n", wine_dbgstr_w(str), hres); + SysFreeString(str); + hres = IHTMLElement3_get_contentEditable(elem3, &str); + ok(hres == S_OK, "get_contentEditable failed: 0x%08x\n", hres); + ok(!strcmp_wa(str, "true"), "Got %s, expected %s\n", wine_dbgstr_w(str), "true"); + + /* Restore origin contentEditable */ + hres = IHTMLElement3_put_contentEditable(elem3, strDefault); + ok(hres == S_OK, "put_contentEditable(%s) failed: 0x%08x\n", wine_dbgstr_w(strDefault), hres); + SysFreeString(strDefault); + + IHTMLElement3_Release(elem3); +} + #define test_input_type(i,t) _test_input_type(__LINE__,i,t) static void _test_input_type(unsigned line, IHTMLInputElement *input, const char *extype) { @@ -5576,6 +5663,9 @@ IHTMLElementCollection *col; IHTMLTableRow *row; HRESULT hres; + BSTR bstr; + LONG lval; + VARIANT vbg, vDefaultbg; static const elem_type_t cell_types[] = {ET_TD,ET_TD}; @@ -5592,6 +5682,74 @@ test_elem_collection((IUnknown*)col, cell_types, sizeof(cell_types)/sizeof(*cell_types)); IHTMLElementCollection_Release(col); + bstr = a2bstr("left"); + hres = IHTMLTableRow_put_align(row, bstr); + ok(hres == S_OK, "set_align failed: %08x\n", hres); + SysFreeString(bstr); + + bstr = NULL; + hres = IHTMLTableRow_get_align(row, &bstr); + ok(hres == S_OK, "get_align failed: %08x\n", hres); + ok(bstr != NULL, "get_align returned NULL\n"); + ok(!strcmp_wa(bstr, "left"), "get_align returned %s\n", wine_dbgstr_w(bstr)); + SysFreeString(bstr); + + bstr = a2bstr("top"); + hres = IHTMLTableRow_put_vAlign(row, bstr); + ok(hres == S_OK, "set_valign failed: %08x\n", hres); + SysFreeString(bstr); + + bstr = NULL; + hres = IHTMLTableRow_get_vAlign(row, &bstr); + ok(hres == S_OK, "get_valign failed: %08x\n", hres); + ok(bstr != NULL, "get_valign returned NULL\n"); + ok(!strcmp_wa(bstr, "top"), "get_valign returned %s\n", wine_dbgstr_w(bstr)); + SysFreeString(bstr); + + lval = 0xdeadbeef; + hres = IHTMLTableRow_get_rowIndex(row, &lval); + ok(hres == S_OK, "get_rowIndex failed: %08x\n", hres); + ok(lval == 1, "get_rowIndex returned %d\n", lval); + + lval = 0xdeadbeef; + hres = IHTMLTableRow_get_sectionRowIndex(row, &lval); + ok(hres == S_OK, "get_sectionRowIndex failed: %08x\n", hres); + ok(lval == 1, "get_sectionRowIndex returned %d\n", lval); + + hres = IHTMLTableRow_get_bgColor(row, &vDefaultbg); + ok(hres == S_OK, "get_bgColor failed: %08x\n", hres); + ok(V_VT(&vDefaultbg) == VT_BSTR, "bstr != NULL\n"); + ok(!V_BSTR(&vDefaultbg), "V_BSTR(bgColor) = %s\n", wine_dbgstr_w(V_BSTR(&vDefaultbg))); + + V_VT(&vbg) = VT_BSTR; + V_BSTR(&vbg) = a2bstr("red"); + hres = IHTMLTableRow_put_bgColor(row, vbg); + ok(hres == S_OK, "put_bgColor failed: %08x\n", hres); + VariantClear(&vbg); + + hres = IHTMLTableRow_get_bgColor(row, &vbg); + ok(hres == S_OK, "get_bgColor failed: %08x\n", hres); + ok(V_VT(&vDefaultbg) == VT_BSTR, "V_VT(&vDefaultbg) != VT_BSTR\n"); + ok(!strcmp_wa(V_BSTR(&vbg), "#ff0000"), "Unexpected bgcolor %s\n", wine_dbgstr_w(V_BSTR(&vbg))); + VariantClear(&vbg); + + V_VT(&vbg) = VT_I4; + V_I4(&vbg) = 0xff0000; + hres = IHTMLTableRow_put_bgColor(row, vbg); + ok(hres == S_OK, "put_bgColor failed: %08x\n", hres); + VariantClear(&vbg); + + hres = IHTMLTableRow_get_bgColor(row, &vbg); + ok(hres == S_OK, "get_bgColor failed: %08x\n", hres); + ok(V_VT(&vDefaultbg) == VT_BSTR, "V_VT(&vDefaultbg) != VT_BSTR\n"); + ok(!strcmp_wa(V_BSTR(&vbg), "#ff0000"), "Unexpected bgcolor %s\n", wine_dbgstr_w(V_BSTR(&vbg))); + VariantClear(&vbg); + + /* Restore Originial */ + hres = IHTMLTableRow_put_bgColor(row, vDefaultbg); + ok(hres == S_OK, "put_bgColor failed: %08x\n", hres); + VariantClear(&vDefaultbg); + IHTMLTableRow_Release(row); } @@ -5657,6 +5815,8 @@ IHTMLDOMNode *node; VARIANT v; HRESULT hres; + BSTR bstr; + VARIANT vbg, vDefaultbg; static const elem_type_t row_types[] = {ET_TR,ET_TR}; static const elem_type_t all_types[] = {ET_TBODY,ET_TR,ET_TR,ET_TD,ET_TD}; @@ -5710,6 +5870,100 @@ test_table_cell_spacing(table, "11"); VariantClear(&v); + bstr = a2bstr("left"); + hres = IHTMLTable_put_align(table, bstr); + ok(hres == S_OK, "set_align failed: %08x\n", hres); + SysFreeString(bstr); + + bstr = NULL; + hres = IHTMLTable_get_align(table, &bstr); + ok(hres == S_OK, "get_align failed: %08x\n", hres); + ok(bstr != NULL, "get_align returned NULL\n"); + ok(!strcmp_wa(bstr, "left"), "get_align returned %s\n", wine_dbgstr_w(bstr)); + SysFreeString(bstr); + + hres = IHTMLTable_get_bgColor(table, &vDefaultbg); + ok(hres == S_OK, "get_bgColor failed: %08x\n", hres); + ok(V_VT(&vDefaultbg) == VT_BSTR, "bstr != NULL\n"); + ok(!V_BSTR(&vDefaultbg), "V_BSTR(bgColor) = %s\n", wine_dbgstr_w(V_BSTR(&vDefaultbg))); + + V_VT(&vbg) = VT_BSTR; + V_BSTR(&vbg) = a2bstr("red"); + hres = IHTMLTable_put_bgColor(table, vbg); + ok(hres == S_OK, "put_bgColor failed: %08x\n", hres); + VariantClear(&vbg); + + hres = IHTMLTable_get_bgColor(table, &vbg); + ok(hres == S_OK, "get_bgColor failed: %08x\n", hres); + ok(V_VT(&vDefaultbg) == VT_BSTR, "V_VT(&vDefaultbg) != VT_BSTR\n"); + ok(!strcmp_wa(V_BSTR(&vbg), "#ff0000"), "Unexpected bgcolor %s\n", wine_dbgstr_w(V_BSTR(&vbg))); + VariantClear(&vbg); + + V_VT(&vbg) = VT_I4; + V_I4(&vbg) = 0xff0000; + hres = IHTMLTable_put_bgColor(table, vbg); + ok(hres == S_OK, "put_bgColor failed: %08x\n", hres); + VariantClear(&vbg); + + hres = IHTMLTable_get_bgColor(table, &vbg); + ok(hres == S_OK, "get_bgColor failed: %08x\n", hres); + ok(V_VT(&vDefaultbg) == VT_BSTR, "V_VT(&vDefaultbg) != VT_BSTR\n"); + ok(!strcmp_wa(V_BSTR(&vbg), "#ff0000"), "Unexpected bgcolor %s\n", wine_dbgstr_w(V_BSTR(&vbg))); + VariantClear(&vbg); + + /* Restore Originial */ + hres = IHTMLTable_put_bgColor(table, vDefaultbg); + ok(hres == S_OK, "put_bgColor failed: %08x\n", hres); + VariantClear(&vDefaultbg); + + V_VT(&v) = VT_BSTR; + V_BSTR(&v) = a2bstr("11"); + hres = IHTMLTable_put_width(table, v); + ok(hres == S_OK, "put_width = %08x\n", hres); + VariantClear(&v); + IHTMLTable_get_width(table, &v); + ok(hres == S_OK, "get_width = %08x\n", hres); + ok(!strcmp_wa(V_BSTR(&v), "11"), "Expected 11, got %s\n", wine_dbgstr_w(V_BSTR(&v))); + VariantClear(&v); + + V_VT(&v) = VT_BSTR; + V_BSTR(&v) = a2bstr("11.9"); + hres = IHTMLTable_put_width(table, v); + ok(hres == S_OK, "put_width = %08x\n", hres); + VariantClear(&v); + IHTMLTable_get_width(table, &v); + ok(hres == S_OK, "get_width = %08x\n", hres); + ok(!strcmp_wa(V_BSTR(&v), "11"), "Expected 11, got %s\n", wine_dbgstr_w(V_BSTR(&v))); + VariantClear(&v); + + V_VT(&v) = VT_BSTR; + V_BSTR(&v) = a2bstr("40.2%"); + hres = IHTMLTable_put_width(table, v); + ok(hres == S_OK, "put_width = %08x\n", hres); + VariantClear(&v); + IHTMLTable_get_width(table, &v); + ok(hres == S_OK, "get_width = %08x\n", hres); + ok(!strcmp_wa(V_BSTR(&v), "40.2%"), "Expected 40.2%%, got %s\n", wine_dbgstr_w(V_BSTR(&v))); + VariantClear(&v); + + V_VT(&v) = VT_I4; + V_I4(&v) = 11; + hres = IHTMLTable_put_width(table, v); + ok(hres == S_OK, "put_width = %08x\n", hres); + IHTMLTable_get_width(table, &v); + ok(hres == S_OK, "get_width = %08x\n", hres); + ok(!strcmp_wa(V_BSTR(&v), "11"), "Expected 11, got %s\n", wine_dbgstr_w(V_BSTR(&v))); + VariantClear(&v); + + V_VT(&v) = VT_R8; + V_R8(&v) = 11.9; + hres = IHTMLTable_put_width(table, v); + ok(hres == S_OK, "put_width = %08x\n", hres); + IHTMLTable_get_width(table, &v); + ok(hres == S_OK, "get_width = %08x\n", hres); + ok(!strcmp_wa(V_BSTR(&v), "11"), "Expected 11, got %s\n", wine_dbgstr_w(V_BSTR(&v))); + VariantClear(&v); + IHTMLTable_Release(table); } @@ -6014,7 +6268,6 @@ hres = IHTMLStyleSheetsCollection_item(col, &idx, &res); ok(hres == E_INVALIDARG, "item failed: %08x, expected E_INVALIDARG\n", hres); ok(V_VT(&res) == VT_EMPTY, "V_VT(res) = %d\n", V_VT(&res)); - ok(V_DISPATCH(&res) != NULL, "V_DISPATCH(&res) == NULL\n"); VariantClear(&res); IHTMLStyleSheetsCollection_Release(col); @@ -6062,7 +6315,55 @@ IDispatchEx_Release(dispex); } +static void test_enum_children(IUnknown *unk, unsigned len) +{ + IEnumVARIANT *enum_var; + ULONG i, fetched; + VARIANT v; + HRESULT hres; + + hres = IUnknown_QueryInterface(unk, &IID_IEnumVARIANT, (void**)&enum_var); + ok(hres == S_OK, "Could not get IEnumVARIANT iface: %08x\n", hres); + for(i=0; i 2 ? len-2 : 0); + ok(hres == S_OK, "Skip failed: %08x\n", hres); + + hres = IEnumVARIANT_Reset(enum_var); + ok(hres == S_OK, "Reset failed: %08x\n", hres); + + hres = IEnumVARIANT_Skip(enum_var, len+1); + ok(hres == S_FALSE, "Skip failed: %08x\n", hres); + + IEnumVARIANT_Release(enum_var); +} static void test_elems(IHTMLDocument2 *doc) { @@ -6384,6 +6685,7 @@ if(elem) { test_dynamic_properties(elem); test_attr_collection(elem); + test_contenteditable((IUnknown*)elem); IHTMLElement_Release(elem); } @@ -6522,6 +6824,7 @@ child_col = get_child_nodes((IUnknown*)elem); ok(child_col != NULL, "child_coll == NULL\n"); if(child_col) { + IUnknown *enum_unk; LONG length = 0; test_disp((IUnknown*)child_col, &DIID_DispDOMChildrenCollection, "[object]"); @@ -6573,6 +6876,13 @@ test_child_col_disp(child_col); + hres = IHTMLDOMChildrenCollection_get__newEnum(child_col, &enum_unk); + ok(hres == S_OK, "get__newEnum failed: %08x\n", hres); + + test_enum_children(enum_unk, length); + + IUnknown_Release(enum_unk); + IHTMLDOMChildrenCollection_Release(child_col); } diff -Nru wine1.7-1.7.14/dlls/mshtml/tests/events.c wine1.7-1.7.18/dlls/mshtml/tests/events.c --- wine1.7-1.7.14/dlls/mshtml/tests/events.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/mshtml/tests/events.c 2014-05-02 18:15:48.000000000 +0000 @@ -83,11 +83,13 @@ DEFINE_EXPECT(submit_onclick_attached_check_cancel); DEFINE_EXPECT(submit_onclick_setret); DEFINE_EXPECT(elem2_cp_onclick); +DEFINE_EXPECT(iframe_onload); static HWND container_hwnd = NULL; static IHTMLWindow2 *window; static IOleDocumentView *view; static BOOL xy_todo; +static BOOL is_ie9plus; typedef struct { LONG x; @@ -243,6 +245,18 @@ return elem3; } +#define get_iframe_iface(u) _get_iframe_iface(__LINE__,u) +static IHTMLIFrameElement *_get_iframe_iface(unsigned line, IUnknown *unk) +{ + IHTMLIFrameElement *iframe; + HRESULT hres; + + hres = IUnknown_QueryInterface(unk, &IID_IHTMLIFrameElement, (void**)&iframe); + ok_(__FILE__,line)(hres == S_OK, "QueryInterface(IID_IHTMLIFrameElement) failed: %08x\n", hres); + + return iframe; +} + #define doc_get_body(d) _doc_get_body(__LINE__,d) static IHTMLElement *_doc_get_body(unsigned line, IHTMLDocument2 *doc) { @@ -993,6 +1007,17 @@ EVENT_HANDLER_FUNC_OBJ(submit_onclick); +static HRESULT WINAPI iframe_onload(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, + VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller) +{ + CHECK_EXPECT(iframe_onload); + test_event_args(&DIID_DispHTMLIFrame, id, wFlags, pdp, pvarRes, pei, pspCaller); + test_event_src("IFRAME"); + return S_OK; +} + +EVENT_HANDLER_FUNC_OBJ(iframe_onload); + static HRESULT WINAPI submit_onclick_attached(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller) { @@ -2058,6 +2083,8 @@ CHECK_CALLED(submit_onclick_attached_check_cancel); CHECK_CALLED(submit_onclick_attached); + if(1)pump_msgs(NULL); + IHTMLElement_Release(submit); } @@ -2144,16 +2171,19 @@ static void test_iframe_connections(IHTMLDocument2 *doc) { - HRESULT hres; IHTMLIFrameElement *iframe; IHTMLDocument2 *iframes_doc; DWORD cookie; IConnectionPoint *cp; - IHTMLElement *element = find_element_by_id(doc, "ifr"); + IHTMLElement *element; + BSTR str; + HRESULT hres; + + trace("iframe tests...\n"); - hres = IHTMLElement_QueryInterface(element, &IID_IHTMLIFrameElement, (void**)&iframe); + element = find_element_by_id(doc, "ifr"); + iframe = get_iframe_iface((IUnknown*)element); IHTMLElement_Release(element); - ok(hres == S_OK, "QueryInterface(IID_IHTMLIFrameElement) failed: %08x\n", hres); iframes_doc = get_iframe_doc(iframe); IHTMLIFrameElement_Release(iframe); @@ -2165,6 +2195,43 @@ IConnectionPoint_Release(cp); ok(hres == CONNECT_E_NOCONNECTION, "Unadvise returned %08x, expected CONNECT_E_NOCONNECTION\n", hres); + unregister_cp((IUnknown*)iframes_doc, &IID_IDispatch, cookie); + + if(is_ie9plus) { + IHTMLFrameBase2 *frame_base2; + VARIANT v; + + hres = IHTMLIFrameElement_QueryInterface(iframe, &IID_IHTMLFrameBase2, (void**)&frame_base2); + ok(hres == S_OK, "Could not get IHTMLFrameBase2 iface: %08x\n", hres); + + V_VT(&v) = VT_DISPATCH; + V_DISPATCH(&v) = (IDispatch*)&iframe_onload_obj; + hres = IHTMLFrameBase2_put_onload(frame_base2, v); + ok(hres == S_OK, "put_onload failed: %08x\n", hres); + + IHTMLFrameBase2_Release(frame_base2); + + str = a2bstr("about:blank"); + hres = IHTMLDocument2_put_URL(iframes_doc, str); + ok(hres == S_OK, "put_URL failed: %08x\n", hres); + SysFreeString(str); + + SET_EXPECT(iframe_onload); + pump_msgs(&called_iframe_onload); + CHECK_CALLED(iframe_onload); + + str = a2bstr("about:test"); + hres = IHTMLDocument2_put_URL(iframes_doc, str); + ok(hres == S_OK, "put_URL failed: %08x\n", hres); + SysFreeString(str); + + SET_EXPECT(iframe_onload); + pump_msgs(&called_iframe_onload); + CHECK_CALLED(iframe_onload); + }else { + win_skip("Skipping iframe onload tests on IE older than 9.\n"); + } + IHTMLDocument2_Release(iframes_doc); } @@ -2672,24 +2739,12 @@ static IHTMLDocument2 *create_document(void) { IHTMLDocument2 *doc; - IHTMLDocument5 *doc5; HRESULT hres; hres = CoCreateInstance(&CLSID_HTMLDocument, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER, &IID_IHTMLDocument2, (void**)&doc); ok(hres == S_OK, "CoCreateInstance failed: %08x\n", hres); - if (FAILED(hres)) - return NULL; - - hres = IHTMLDocument2_QueryInterface(doc, &IID_IHTMLDocument5, (void**)&doc5); - if(FAILED(hres)) { - win_skip("Could not get IHTMLDocument5 interface, probably too old IE\n"); - IHTMLDocument2_Release(doc); - return NULL; - } - - IHTMLDocument5_Release(doc5); - return doc; + return SUCCEEDED(hres) ? doc : NULL; } @@ -2790,24 +2845,57 @@ IHTMLDocument2_Release(doc); } +static BOOL check_ie(void) +{ + IHTMLDocument2 *doc; + IHTMLDocument5 *doc5; + IHTMLDocument7 *doc7; + HRESULT hres; + + doc = create_document(); + if(!doc) + return FALSE; + + hres = IHTMLDocument2_QueryInterface(doc, &IID_IHTMLDocument7, (void**)&doc7); + if(SUCCEEDED(hres)) { + is_ie9plus = TRUE; + IHTMLDocument7_Release(doc7); + } + + trace("is_ie9plus %x\n", is_ie9plus); + + hres = IHTMLDocument2_QueryInterface(doc, &IID_IHTMLDocument5, (void**)&doc5); + if(SUCCEEDED(hres)) + IHTMLDocument5_Release(doc5); + + IHTMLDocument2_Release(doc); + return SUCCEEDED(hres); +} + START_TEST(events) { CoInitialize(NULL); - container_hwnd = create_container_window(); - if(winetest_interactive) - ShowWindow(container_hwnd, SW_SHOW); + if(check_ie()) { + container_hwnd = create_container_window(); + + if(winetest_interactive) + ShowWindow(container_hwnd, SW_SHOW); - run_test(empty_doc_str, test_timeout); - run_test(click_doc_str, test_onclick); - run_test(readystate_doc_str, test_onreadystatechange); - run_test(img_doc_str, test_imgload); - run_test(input_doc_str, test_focus); - run_test(form_doc_str, test_submit); - run_test(iframe_doc_str, test_iframe_connections); + run_test(empty_doc_str, test_timeout); + run_test(click_doc_str, test_onclick); + run_test(readystate_doc_str, test_onreadystatechange); + run_test(img_doc_str, test_imgload); + run_test(input_doc_str, test_focus); + run_test(form_doc_str, test_submit); + run_test(iframe_doc_str, test_iframe_connections); - test_empty_document(); + test_empty_document(); + + DestroyWindow(container_hwnd); + }else { + win_skip("Too old IE\n"); + } - DestroyWindow(container_hwnd); CoUninitialize(); } diff -Nru wine1.7-1.7.14/dlls/mshtml/tests/htmldoc.c wine1.7-1.7.18/dlls/mshtml/tests/htmldoc.c --- wine1.7-1.7.14/dlls/mshtml/tests/htmldoc.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/mshtml/tests/htmldoc.c 2014-05-02 18:15:48.000000000 +0000 @@ -1211,7 +1211,8 @@ return E_NOINTERFACE; } - ok(0, "unexpected call %s\n", wine_dbgstr_guid(riid)); + trace("Binding::QI(%s)\n", wine_dbgstr_guid(riid)); + *ppv = NULL; return E_NOINTERFACE; } @@ -2666,13 +2667,15 @@ return S_OK; } + *ppv = NULL; + if(IsEqualGUID(&IID_IOleCommandTarget, riid)) return E_NOINTERFACE; - else if(IsEqualGUID(&IID_IDocHostShowUI, riid)) + if(IsEqualGUID(&IID_IDocHostShowUI, riid)) return E_NOINTERFACE; /* TODO */ - ok(0, "unexpected call %s\n", wine_dbgstr_guid(riid)); + trace("CustomDocHostUIHandler::QI(%s)\n", wine_dbgstr_guid(riid)); return E_NOINTERFACE; } @@ -2971,11 +2974,15 @@ return E_NOTIMPL; + case 83: + case 102: case 134: /* TODO */ + case 135: case 136: /* TODO */ case 139: /* TODO */ case 143: /* TODO */ case 144: /* TODO */ + case 178: return E_NOTIMPL; default: @@ -3036,7 +3043,7 @@ ok(ind == 0, "Lower bound = %d\n", ind); hres = SafeArrayGetUBound(sa, 1, &ind); ok(hres == S_OK, "SafeArrayGetUBound failed: %x\n", hres); - ok(ind == 7 || broken(ind == 5), "Upper bound = %d\n", ind); + ok(ind == 7 || ind == 8 /* IE11 */ ||broken(ind == 5), "Upper bound = %d\n", ind); ind = 0; SafeArrayGetElement(sa, &ind, &var); @@ -4869,7 +4876,7 @@ static HRESULT WINAPI WebBrowser_get_AddressBar(IWebBrowser2 *iface, VARIANT_BOOL *Value) { - ok(0, "unexpected call\n"); + trace("get_AddressBar: ignoring\n"); /* Some old IEs call it */ return E_NOTIMPL; } @@ -4970,6 +4977,7 @@ static HRESULT wb_qi(REFIID riid, void **ppv) { + static const IID IID_IWebBrowserPriv2IE7 = {0x1af32b6c, 0xa3ba,0x48b9,{0xb2,0x4e,0x8a,0xa9,0xc4,0x1f,0x6e,0xcd}}; static const IID IID_IWebBrowserPriv2IE8XP = {0x486f6159,0x9f3f,0x4827,{0x82,0xd4,0x28,0x3c,0xef,0x39,0x77,0x33}}; *ppv = NULL; @@ -4999,6 +5007,11 @@ return S_OK; } + if(IsEqualGUID(riid, &IID_IWebBrowserPriv2IE7)) { + trace("QI(IID_IWebBrowserPriv2IE7)\n"); + return E_NOINTERFACE; + } + if(IsEqualGUID(riid, &IID_IWebBrowserPriv2IE8XP)) { trace("QI(IID_IWebBrowserPriv2IE8XP)\n"); return E_NOINTERFACE; @@ -5242,7 +5255,7 @@ else if(IsEqualGUID(&IID_IDocHostUIHandlerPriv, riid)) return E_NOINTERFACE; /* ? */ else - ok(0, "unexpected riid %s\n", wine_dbgstr_guid(riid)); + trace("QI(%s)\n", wine_dbgstr_guid(riid)); if(*ppv) return S_OK; @@ -5440,8 +5453,29 @@ hres = IConnectionPoint_Advise(cp, (IUnknown*)&PropertyNotifySink, NULL); ok(hres == S_OK, "Advise failed: %08x\n", hres); } else if(IsEqualGUID(&IID_IDispatch, riid)) { + IEnumConnections *enum_conn; + CONNECTDATA conn_data; + ULONG fetched; + hres = IConnectionPoint_Advise(cp, (IUnknown*)&EventDispatch, &cookie); ok(hres == S_OK, "Advise failed: %08x\n", hres); + + hres = IConnectionPoint_EnumConnections(cp, &enum_conn); + ok(hres == S_OK, "EnumConnections failed: %08x\n", hres); + + fetched = 0; + hres = IEnumConnections_Next(enum_conn, 1, &conn_data, &fetched); + ok(hres == S_OK, "Next failed: %08x\n", hres); + ok(conn_data.pUnk == (IUnknown*)&EventDispatch, "conn_data.pUnk == EventDispatch\n"); + ok(conn_data.dwCookie == cookie, "conn_data.dwCookie != cookie\n"); + IUnknown_Release(conn_data.pUnk); + + fetched = 0xdeadbeef; + hres = IEnumConnections_Next(enum_conn, 1, &conn_data, &fetched); + ok(hres == S_FALSE, "Next failed: %08x\n", hres); + ok(!fetched, "fetched = %d\n", fetched); + + IEnumConnections_Release(enum_conn); } IConnectionPoint_Release(cp); @@ -5804,8 +5838,12 @@ CLEAR_CALLED(UpdateUI); CLEAR_CALLED(Exec_UPDATECOMMANDS); CLEAR_CALLED(Exec_SETTITLE); - if(flags & DWL_EXPECT_HISTUPDATE) - CHECK_CALLED(Exec_Explorer_38); + if(flags & DWL_EXPECT_HISTUPDATE) { + if(flags & DWL_FROM_HISTORY) + CHECK_CALLED_BROKEN(Exec_Explorer_38); /* Some old IEs don't call it. */ + else + CHECK_CALLED(Exec_Explorer_38); + } todo_wine CHECK_CALLED_BROKEN(UpdateBackForwardState); } if(!is_js && !is_extern) { diff -Nru wine1.7-1.7.14/dlls/mshtml/tests/nav_test.html wine1.7-1.7.18/dlls/mshtml/tests/nav_test.html --- wine1.7-1.7.14/dlls/mshtml/tests/nav_test.html 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.18/dlls/mshtml/tests/nav_test.html 2014-05-02 18:15:48.000000000 +0000 @@ -0,0 +1,42 @@ + + + + + + + diff -Nru wine1.7-1.7.14/dlls/mshtml/tests/rsrc.rc wine1.7-1.7.18/dlls/mshtml/tests/rsrc.rc --- wine1.7-1.7.14/dlls/mshtml/tests/rsrc.rc 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/mshtml/tests/rsrc.rc 2014-05-02 18:15:48.000000000 +0000 @@ -31,6 +31,15 @@ /* @makedep: externscr.js */ externscr.js HTML "externscr.js" +/* @makedep: nav_test.html */ +nav_test.html HTML "nav_test.html" + +/* @makedep: blank.html */ +blank.html HTML "blank.html" + +/* @makedep: blank.html */ +blank2.html HTML "blank.html" + /* @makedep: test_tlb.tlb */ 1 TYPELIB test_tlb.tlb diff -Nru wine1.7-1.7.14/dlls/mshtml/tests/script.c wine1.7-1.7.18/dlls/mshtml/tests/script.c --- wine1.7-1.7.14/dlls/mshtml/tests/script.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/mshtml/tests/script.c 2014-05-02 18:15:48.000000000 +0000 @@ -150,6 +150,7 @@ static const GUID CLSID_TestActiveX = {0x178fc163,0xf585,0x4e24,{0x9c,0x13,0x4b,0xb7,0xfa,0xf8,0x06,0x46}}; +static BOOL is_ie9plus; static IHTMLDocument2 *notif_doc; static IOleDocumentView *view; static IDispatchEx *window_dispex; @@ -1165,23 +1166,12 @@ static IHTMLDocument2 *create_document(void) { IHTMLDocument2 *doc; - IHTMLDocument5 *doc5; HRESULT hres; hres = CoCreateInstance(&CLSID_HTMLDocument, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER, &IID_IHTMLDocument2, (void**)&doc); ok(hres == S_OK, "CoCreateInstance failed: %08x\n", hres); - if (hres != S_OK) return NULL; - - hres = IHTMLDocument2_QueryInterface(doc, &IID_IHTMLDocument5, (void**)&doc5); - if(FAILED(hres)) { - win_skip("Could not get IHTMLDocument5, probably too old IE\n"); - IHTMLDocument2_Release(doc); - return NULL; - } - - IHTMLDocument5_Release(doc5); - return doc; + return SUCCEEDED(hres) ? doc : NULL; } static void load_string(IHTMLDocument2 *doc, const char *str) @@ -2831,6 +2821,10 @@ run_js_script("exectest.html"); run_js_script("vbtest.html"); run_js_script("events.html"); + if(is_ie9plus) + run_js_script("nav_test.html"); + else + win_skip("Skipping nav_test.html on IE older than 9 (for broken ieframe onload).\n"); } static BOOL init_registry(BOOL init) @@ -2882,21 +2876,52 @@ 300, 300, NULL, NULL, NULL, NULL); } +static BOOL check_ie(void) +{ + IHTMLDocument2 *doc; + IHTMLDocument5 *doc5; + IHTMLDocument7 *doc7; + HRESULT hres; + + doc = create_document(); + if(!doc) + return FALSE; + + hres = IHTMLDocument2_QueryInterface(doc, &IID_IHTMLDocument7, (void**)&doc7); + if(SUCCEEDED(hres)) { + is_ie9plus = TRUE; + IHTMLDocument7_Release(doc7); + } + + trace("is_ie9plus %x\n", is_ie9plus); + + hres = IHTMLDocument2_QueryInterface(doc, &IID_IHTMLDocument5, (void**)&doc5); + if(SUCCEEDED(hres)) + IHTMLDocument5_Release(doc5); + + IHTMLDocument2_Release(doc); + return SUCCEEDED(hres); +} + START_TEST(script) { CoInitialize(NULL); container_hwnd = create_container_window(); - if(winetest_interactive || ! is_ie_hardened()) { - if(register_script_engine()) { - test_simple_script(); - init_registry(FALSE); + if(check_ie()) { + if(winetest_interactive || ! is_ie_hardened()) { + if(register_script_engine()) { + test_simple_script(); + init_registry(FALSE); + }else { + skip("Could not register TestScript engine\n"); + } + run_js_tests(); }else { - skip("Could not register TestScript engine\n"); + skip("IE running in Enhanced Security Configuration\n"); } - run_js_tests(); }else { - skip("IE running in Enhanced Security Configuration\n"); + win_skip("Too old IE.\n"); } DestroyWindow(container_hwnd); diff -Nru wine1.7-1.7.14/dlls/mshtml/tests/style.c wine1.7-1.7.18/dlls/mshtml/tests/style.c --- wine1.7-1.7.14/dlls/mshtml/tests/style.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/mshtml/tests/style.c 2014-05-02 18:15:48.000000000 +0000 @@ -2092,6 +2092,22 @@ ok(!strcmp_wa(str, "nowrap"), "whiteSpace = %s\n", wine_dbgstr_w(str)); SysFreeString(str); + /* listStyleType */ + hres = IHTMLStyle_get_listStyleType(style, &str); + ok(hres == S_OK, "get_listStyleType failed: %08x\n", hres); + ok(!str, "listStyleType = %s\n", wine_dbgstr_w(str)); + + str = a2bstr("square"); + hres = IHTMLStyle_put_listStyleType(style, str); + ok(hres == S_OK, "put_listStyleType failed: %08x\n", hres); + SysFreeString(str); + + str = NULL; + hres = IHTMLStyle_get_listStyleType(style, &str); + ok(hres == S_OK, "get_listStyleType failed: %08x\n", hres); + ok(!strcmp_wa(str, "square"), "listStyleType = %s\n", wine_dbgstr_w(str)); + SysFreeString(str); + hres = IHTMLStyle_QueryInterface(style, &IID_IHTMLStyle2, (void**)&style2); ok(hres == S_OK, "Could not get IHTMLStyle2 iface: %08x\n", hres); if(SUCCEEDED(hres)) { diff -Nru wine1.7-1.7.14/dlls/msi/action.c wine1.7-1.7.18/dlls/msi/action.c --- wine1.7-1.7.14/dlls/msi/action.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msi/action.c 2014-05-02 18:15:48.000000000 +0000 @@ -5813,7 +5813,11 @@ ERR("Query failed\n"); goto done; } - if (!(key = MSI_RecordGetString(row, 6))) goto done; + if (!(key = MSI_RecordGetString(row, 6))) + { + msiobj_release(&row->hdr); + goto done; + } file = msi_get_loaded_file(package, key); msiobj_release(&row->hdr); if (!file) diff -Nru wine1.7-1.7.14/dlls/msi/appsearch.c wine1.7-1.7.18/dlls/msi/appsearch.c --- wine1.7-1.7.14/dlls/msi/appsearch.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msi/appsearch.c 2014-05-02 18:15:48.000000000 +0000 @@ -451,6 +451,19 @@ if (sz == 0) goto end; + /* expand if needed */ + if (regType == REG_EXPAND_SZ) + { + sz = ExpandEnvironmentStringsW((LPCWSTR)value, NULL, 0); + if (sz) + { + LPWSTR buf = msi_alloc(sz * sizeof(WCHAR)); + ExpandEnvironmentStringsW((LPCWSTR)value, buf, sz); + msi_free(value); + value = (LPBYTE)buf; + } + } + if ((regType == REG_SZ || regType == REG_EXPAND_SZ) && (ptr = strchrW((LPWSTR)value, '"')) && (end = strchrW(++ptr, '"'))) *end = '\0'; diff -Nru wine1.7-1.7.14/dlls/msi/classes.c wine1.7-1.7.18/dlls/msi/classes.c --- wine1.7-1.7.14/dlls/msi/classes.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msi/classes.c 2014-05-02 18:15:48.000000000 +0000 @@ -1054,7 +1054,7 @@ { if (progid->Parent) progid = progid->Parent; if (progid->Class) return progid->Class; - if (!progid->Parent) break; + if (!progid->Parent || progid->Parent == progid) break; } return NULL; } @@ -1452,14 +1452,14 @@ LIST_FOR_EACH_ENTRY( mt, &package->mimes, MSIMIME, entry ) { - LPWSTR extension, key; + LPWSTR extension = NULL, key; /* * check if the MIME is to be installed. Either as requested by an * extension or Class */ if ((!mt->Class || mt->Class->action != INSTALLSTATE_LOCAL) && - mt->Extension->action != INSTALLSTATE_LOCAL) + (!mt->Extension || mt->Extension->action != INSTALLSTATE_LOCAL)) { TRACE("MIME %s not scheduled to be installed\n", debugstr_w(mt->ContentType)); continue; @@ -1467,7 +1467,7 @@ TRACE("Registering MIME type %s\n", debugstr_w(mt->ContentType)); - extension = msi_alloc( (strlenW( mt->Extension->Extension ) + 2) * sizeof(WCHAR) ); + if (mt->Extension) extension = msi_alloc( (strlenW( mt->Extension->Extension ) + 2) * sizeof(WCHAR) ); key = msi_alloc( (strlenW( mt->ContentType ) + strlenW( szMIMEDatabase ) + 1) * sizeof(WCHAR) ); if (extension && key) @@ -1510,7 +1510,7 @@ LPWSTR mime_key; if ((!mime->Class || mime->Class->action != INSTALLSTATE_ABSENT) && - mime->Extension->action != INSTALLSTATE_ABSENT) + (!mime->Extension || mime->Extension->action != INSTALLSTATE_ABSENT)) { TRACE("MIME %s not scheduled to be removed\n", debugstr_w(mime->ContentType)); continue; diff -Nru wine1.7-1.7.14/dlls/msi/custom.c wine1.7-1.7.18/dlls/msi/custom.c --- wine1.7-1.7.14/dlls/msi/custom.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msi/custom.c 2014-05-02 18:15:48.000000000 +0000 @@ -1003,7 +1003,7 @@ 'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ', '`','B','i' ,'n','a','r','y','`',' ','W','H','E','R','E',' ', '`','N','a','m','e','`',' ','=',' ','\'','%','s','\'',0}; - MSIRECORD *row = 0; + MSIRECORD *row = NULL; msi_custom_action_info *info; CHAR *buffer = NULL; WCHAR *bufferw = NULL; @@ -1017,10 +1017,14 @@ return ERROR_FUNCTION_FAILED; r = MSI_RecordReadStream(row, 2, NULL, &sz); - if (r != ERROR_SUCCESS) return r; + if (r != ERROR_SUCCESS) goto done; buffer = msi_alloc( sz + 1 ); - if (!buffer) return ERROR_FUNCTION_FAILED; + if (!buffer) + { + r = ERROR_FUNCTION_FAILED; + goto done; + } r = MSI_RecordReadStream(row, 2, buffer, &sz); if (r != ERROR_SUCCESS) @@ -1040,6 +1044,7 @@ done: msi_free(bufferw); msi_free(buffer); + msiobj_release(&row->hdr); return r; } diff -Nru wine1.7-1.7.14/dlls/msi/format.c wine1.7-1.7.18/dlls/msi/format.c --- wine1.7-1.7.14/dlls/msi/format.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msi/format.c 2014-05-02 18:15:48.000000000 +0000 @@ -370,7 +370,11 @@ { max_len = len; buf = msi_realloc(buf, (max_len + 1) * sizeof(WCHAR)); - if (!buf) return NULL; + if (!buf) + { + msi_free(rc); + return NULL; + } } if (str) @@ -731,10 +735,10 @@ format->n = n; beg = format_replace( format, propfound, nonprop, oldsize, type, replaced, len ); + msi_free(replaced); if (!beg) return ERROR_SUCCESS; - msi_free(replaced); format->n = beg->n + beg->len; top = stack_peek(stack); Binary files /tmp/3nsIA_MmjG/wine1.7-1.7.14/dlls/msi/instabsent.bmp and /tmp/wgLXlygwsm/wine1.7-1.7.18/dlls/msi/instabsent.bmp differ Binary files /tmp/3nsIA_MmjG/wine1.7-1.7.14/dlls/msi/instadvert.bmp and /tmp/wgLXlygwsm/wine1.7-1.7.18/dlls/msi/instadvert.bmp differ Binary files /tmp/3nsIA_MmjG/wine1.7-1.7.14/dlls/msi/instlocal.bmp and /tmp/wgLXlygwsm/wine1.7-1.7.18/dlls/msi/instlocal.bmp differ diff -Nru wine1.7-1.7.14/dlls/msi/msiserver.idl wine1.7-1.7.18/dlls/msi/msiserver.idl --- wine1.7-1.7.14/dlls/msi/msiserver.idl 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msi/msiserver.idl 2014-05-02 18:15:48.000000000 +0000 @@ -153,6 +153,14 @@ coclass PSFactoryBuffer { interface IPSFactoryBuffer; } [ + helpstring("Microsoft Windows Installer"), + threading(apartment), + progid("WindowsInstaller.Installer"), + uuid(000c1090-0000-0000-c000-000000000046) +] +coclass MsiInstaller { interface Installer; } + +[ uuid(000c1082-0000-0000-c000-000000000046) ] coclass MsiTransform { } @@ -184,7 +192,6 @@ ] coclass WineMsiRemotePackage { interface WineMsiRemotePackage; } - [ uuid(000C1092-0000-0000-C000-000000000046), version(1.0) ] library WindowsInstaller { @@ -251,14 +258,14 @@ [id(DISPID_INSTALLER_OPENPACKAGE)] Session* OpenPackage( [in] VARIANT PackagePath, - [in, optional, defaultvalue(0)] long Options); + [in, defaultvalue(0)] long Options); [id(DISPID_INSTALLER_OPENPRODUCT)] Session* OpenProduct( [in] BSTR ProductCode); [id(DISPID_INSTALLER_SUMMARYINFORMATION)] SummaryInfo* SummaryInformation( [in] BSTR PackagePath, - [in, optional, defaultvalue(0)] long UpdateCount); + [in, defaultvalue(0)] long UpdateCount); [id(DISPID_INSTALLER_OPENDATABASE)] Database *OpenDatabase( [in] BSTR DatabasePath, @@ -270,7 +277,7 @@ [id(DISPID_INSTALLER_INSTALLPRODUCT)] void InstallProduct( [in] BSTR PackagePath, - [in, optional, defaultvalue("0")] BSTR PropertyValues); + [in, defaultvalue("0")] BSTR PropertyValues); [id(DISPID_INSTALLER_VERSION)] BSTR Version(); [id(DISPID_INSTALLER_LASTERRORRECORD)] @@ -393,7 +400,7 @@ properties: methods: [id(DISPID_VIEW_EXECUTE)] - void Execute([in, optional, defaultvalue(0)] Record *Params); + void Execute([in, defaultvalue(0)] Record *Params); [id(DISPID_VIEW_FETCH)] Record* Fetch(); [id(DISPID_VIEW_MODIFY)] @@ -412,7 +419,7 @@ [id(DISPID_DATABASE_OPENVIEW)] View* OpenView([in] BSTR Sql); [id(DISPID_DATABASE_SUMMARYINFORMATION), propget] - SummaryInfo *SummaryInformation([in, optional, defaultvalue(0)] long UpdateCount); + SummaryInfo *SummaryInformation([in, defaultvalue(0)] long UpdateCount); } typedef enum { @@ -551,12 +558,4 @@ properties: methods: } - - [ - helpstring("Microsoft Windows Installer"), - threading(apartment), - progid("WindowsInstaller.Installer"), - uuid(000c1090-0000-0000-c000-000000000046) - ] - coclass MsiInstaller { interface Installer; } } diff -Nru wine1.7-1.7.14/dlls/msi/msiserver.rgs wine1.7-1.7.18/dlls/msi/msiserver.rgs --- wine1.7-1.7.14/dlls/msi/msiserver.rgs 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msi/msiserver.rgs 2014-05-02 18:15:48.000000000 +0000 @@ -2,7 +2,12 @@ { NoRemove CLSID { - '{000C101D-0000-0000-C000-000000000046}' { DllVersion = s '3.1.4000' } - '{000C1090-0000-0000-C000-000000000046}' { InProcHandler32 = s 'ole32.dll' } + '{000C101D-0000-0000-C000-000000000046}' { DllVersion = s '4.5.6001' } + '{000C1090-0000-0000-C000-000000000046}' + { + TypeLib = s '{000C1092-0000-0000-C000-000000000046}' + Version = s '1.0' + InProcHandler32 = s 'ole32.dll' + } } } diff -Nru wine1.7-1.7.14/dlls/msi/source.c wine1.7-1.7.18/dlls/msi/source.c --- wine1.7-1.7.14/dlls/msi/source.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msi/source.c 2014-05-02 18:15:48.000000000 +0000 @@ -1153,7 +1153,7 @@ list_init(&sourcelist); rc = fill_source_list(&sourcelist, typekey, &count); if (rc != ERROR_NO_MORE_ITEMS) - return rc; + goto done; size = (lstrlenW(source) + 1) * sizeof(WCHAR); diff -Nru wine1.7-1.7.14/dlls/msi/table.c wine1.7-1.7.18/dlls/msi/table.c --- wine1.7-1.7.14/dlls/msi/table.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msi/table.c 2014-05-02 18:15:48.000000000 +0000 @@ -1970,7 +1970,10 @@ r = TABLE_CreateView(tv->db, szColumns, &columns); if (r != ERROR_SUCCESS) + { + msiobj_release(&rec->hdr); return r; + } r = msi_table_find_row((MSITABLEVIEW *)columns, rec, &row, NULL); if (r != ERROR_SUCCESS) @@ -2092,7 +2095,10 @@ r = TABLE_CreateView(tv->db, szTables, &tables); if (r != ERROR_SUCCESS) + { + msiobj_release(&rec->hdr); return r; + } r = msi_table_find_row((MSITABLEVIEW *)tables, rec, &row, NULL); if (r != ERROR_SUCCESS) diff -Nru wine1.7-1.7.14/dlls/msi/tests/action.c wine1.7-1.7.18/dlls/msi/tests/action.c --- wine1.7-1.7.14/dlls/msi/tests/action.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msi/tests/action.c 2014-05-02 18:15:48.000000000 +0000 @@ -2255,20 +2255,22 @@ static BOOL is_process_limited(void) { SID_IDENTIFIER_AUTHORITY NtAuthority = {SECURITY_NT_AUTHORITY}; - PSID Group; + PSID Group = NULL; BOOL IsInGroup; HANDLE token; if (!pCheckTokenMembership || !pOpenProcessToken) return FALSE; if (!AllocateAndInitializeSid(&NtAuthority, 2, SECURITY_BUILTIN_DOMAIN_RID, - DOMAIN_ALIAS_RID_ADMINS, - 0, 0, 0, 0, 0, 0, &Group) || + DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &Group) || !pCheckTokenMembership(NULL, Group, &IsInGroup)) { trace("Could not check if the current user is an administrator\n"); + FreeSid(Group); return FALSE; } + FreeSid(Group); + if (!IsInGroup) { /* Only administrators have enough privileges for these tests */ diff -Nru wine1.7-1.7.14/dlls/msi/tests/automation.c wine1.7-1.7.18/dlls/msi/tests/automation.c --- wine1.7-1.7.14/dlls/msi/tests/automation.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msi/tests/automation.c 2014-05-02 18:15:48.000000000 +0000 @@ -230,20 +230,22 @@ static BOOL is_process_limited(void) { SID_IDENTIFIER_AUTHORITY NtAuthority = {SECURITY_NT_AUTHORITY}; - PSID Group; + PSID Group = NULL; BOOL IsInGroup; HANDLE token; if (!pCheckTokenMembership || !pOpenProcessToken) return FALSE; if (!AllocateAndInitializeSid(&NtAuthority, 2, SECURITY_BUILTIN_DOMAIN_RID, - DOMAIN_ALIAS_RID_ADMINS, - 0, 0, 0, 0, 0, 0, &Group) || + DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &Group) || !pCheckTokenMembership(NULL, Group, &IsInGroup)) { trace("Could not check if the current user is an administrator\n"); + FreeSid(Group); return FALSE; } + FreeSid(Group); + if (!IsInGroup) { /* Only administrators have enough privileges for these tests */ diff -Nru wine1.7-1.7.14/dlls/msi/tests/install.c wine1.7-1.7.18/dlls/msi/tests/install.c --- wine1.7-1.7.14/dlls/msi/tests/install.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msi/tests/install.c 2014-05-02 18:15:48.000000000 +0000 @@ -2043,20 +2043,22 @@ static BOOL is_process_limited(void) { SID_IDENTIFIER_AUTHORITY NtAuthority = {SECURITY_NT_AUTHORITY}; - PSID Group; + PSID Group = NULL; BOOL IsInGroup; HANDLE token; if (!pCheckTokenMembership || !pOpenProcessToken) return FALSE; if (!AllocateAndInitializeSid(&NtAuthority, 2, SECURITY_BUILTIN_DOMAIN_RID, - DOMAIN_ALIAS_RID_ADMINS, - 0, 0, 0, 0, 0, 0, &Group) || + DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &Group) || !pCheckTokenMembership(NULL, Group, &IsInGroup)) { trace("Could not check if the current user is an administrator\n"); + FreeSid(Group); return FALSE; } + FreeSid(Group); + if (!IsInGroup) { /* Only administrators have enough privileges for these tests */ diff -Nru wine1.7-1.7.14/dlls/msi/tests/msi.c wine1.7-1.7.18/dlls/msi/tests/msi.c --- wine1.7-1.7.14/dlls/msi/tests/msi.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msi/tests/msi.c 2014-05-02 18:15:48.000000000 +0000 @@ -175,20 +175,22 @@ static BOOL is_process_limited(void) { SID_IDENTIFIER_AUTHORITY NtAuthority = {SECURITY_NT_AUTHORITY}; - PSID Group; + PSID Group = NULL; BOOL IsInGroup; HANDLE token; if (!pCheckTokenMembership || !pOpenProcessToken) return FALSE; if (!AllocateAndInitializeSid(&NtAuthority, 2, SECURITY_BUILTIN_DOMAIN_RID, - DOMAIN_ALIAS_RID_ADMINS, - 0, 0, 0, 0, 0, 0, &Group) || + DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &Group) || !pCheckTokenMembership(NULL, Group, &IsInGroup)) { trace("Could not check if the current user is an administrator\n"); + FreeSid(Group); return FALSE; } + FreeSid(Group); + if (!IsInGroup) { /* Only administrators have enough privileges for these tests */ diff -Nru wine1.7-1.7.14/dlls/msi/tests/package.c wine1.7-1.7.18/dlls/msi/tests/package.c --- wine1.7-1.7.14/dlls/msi/tests/package.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msi/tests/package.c 2014-05-02 18:15:48.000000000 +0000 @@ -88,20 +88,22 @@ static BOOL is_process_limited(void) { SID_IDENTIFIER_AUTHORITY NtAuthority = {SECURITY_NT_AUTHORITY}; - PSID Group; + PSID Group = NULL; BOOL IsInGroup; HANDLE token; if (!pCheckTokenMembership || !pOpenProcessToken) return FALSE; if (!AllocateAndInitializeSid(&NtAuthority, 2, SECURITY_BUILTIN_DOMAIN_RID, - DOMAIN_ALIAS_RID_ADMINS, - 0, 0, 0, 0, 0, 0, &Group) || + DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &Group) || !pCheckTokenMembership(NULL, Group, &IsInGroup)) { trace("Could not check if the current user is an administrator\n"); + FreeSid(Group); return FALSE; } + FreeSid(Group); + if (!IsInGroup) { if (!AllocateAndInitializeSid(&NtAuthority, 2, @@ -3687,6 +3689,8 @@ MSIHANDLE hdb; CHAR prop[MAX_PATH]; DWORD size; + HKEY hkey; + const char reg_expand_value[] = "%systemroot%\\system32\\notepad.exe"; hdb = create_package_db(); ok ( hdb, "failed to create package database\n" ); @@ -3700,12 +3704,23 @@ r = add_appsearch_entry( hdb, "'NOTEPAD', 'NewSignature2'" ); ok( r == ERROR_SUCCESS, "cannot add entry: %d\n", r ); + r = add_appsearch_entry( hdb, "'REGEXPANDVAL', 'NewSignature3'" ); + ok( r == ERROR_SUCCESS, "cannot add entry: %d\n", r ); + r = create_reglocator_table( hdb ); ok( r == ERROR_SUCCESS, "cannot create RegLocator table: %d\n", r ); r = add_reglocator_entry( hdb, "NewSignature1", 0, "htmlfile\\shell\\open\\command", "", 1 ); ok( r == ERROR_SUCCESS, "cannot create RegLocator table: %d\n", r ); + r = RegCreateKeyExA(HKEY_CURRENT_USER, "Software\\Winetest_msi", 0, NULL, 0, KEY_ALL_ACCESS, NULL, &hkey, NULL); + ok( r == ERROR_SUCCESS, "Could not create key: %d.\n", r ); + r = RegSetValueExA(hkey, NULL, 0, REG_EXPAND_SZ, (const BYTE*)reg_expand_value, strlen(reg_expand_value) + 1); + ok( r == ERROR_SUCCESS, "Could not set key value: %d.\n", r); + RegCloseKey(hkey); + r = add_reglocator_entry( hdb, "NewSignature3", 1, "Software\\Winetest_msi", "", 1 ); + ok( r == ERROR_SUCCESS, "cannot create RegLocator table: %d\n", r ); + r = create_drlocator_table( hdb ); ok( r == ERROR_SUCCESS, "cannot create DrLocator table: %d\n", r ); @@ -3721,6 +3736,9 @@ r = add_signature_entry( hdb, "'NewSignature2', 'NOTEPAD.EXE|notepad.exe', '', '', '', '', '', '', ''" ); ok( r == ERROR_SUCCESS, "cannot add signature: %d\n", r ); + r = add_signature_entry( hdb, "'NewSignature3', 'NOTEPAD.EXE|notepad.exe', '', '', '', '', '', '', ''" ); + ok( r == ERROR_SUCCESS, "cannot add signature: %d\n", r ); + r = package_from_db( hdb, &hpkg ); if (r == ERROR_INSTALL_PACKAGE_REJECTED) { @@ -3747,9 +3765,15 @@ r = MsiGetPropertyA( hpkg, "NOTEPAD", prop, &size ); ok( r == ERROR_SUCCESS, "get property failed: %d\n", r); + size = sizeof(prop); + r = MsiGetPropertyA( hpkg, "REGEXPANDVAL", prop, &size ); + ok( r == ERROR_SUCCESS, "get property failed: %d\n", r); + ok( lstrlenA(prop) != 0, "Expected non-zero length\n"); + done: MsiCloseHandle( hpkg ); DeleteFileA(msifile); + RegDeleteKeyA(HKEY_CURRENT_USER, "Software\\Winetest_msi"); } static void test_appsearch_complocator(void) diff -Nru wine1.7-1.7.14/dlls/mstask/tests/task_scheduler.c wine1.7-1.7.18/dlls/mstask/tests/task_scheduler.c --- wine1.7-1.7.14/dlls/mstask/tests/task_scheduler.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/mstask/tests/task_scheduler.c 2014-05-02 18:15:48.000000000 +0000 @@ -182,7 +182,7 @@ hres, wine_dbgstr_w(name), wine_dbgstr_w(buffer)); CoTaskMemFree(name); - /* the two backslash are optional */ + /* the two backslashes are optional */ hres = ITaskScheduler_SetTargetComputer(test_task_scheduler, oldname + 2); ok(hres == S_OK, "got 0x%x (expected S_OK)\n", hres); diff -Nru wine1.7-1.7.14/dlls/msvcp100/msvcp100.spec wine1.7-1.7.18/dlls/msvcp100/msvcp100.spec --- wine1.7-1.7.14/dlls/msvcp100/msvcp100.spec 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msvcp100/msvcp100.spec 2014-05-02 18:15:48.000000000 +0000 @@ -1214,7 +1214,7 @@ @ cdecl -arch=win64 ?_Putgrouped@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@AEBA?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@PEBD_K_W@Z(ptr ptr ptr str long long) num_put_wchar__Putgrouped @ stub -arch=win32 ?_Raise_handler@std@@3P6AXABVexception@stdext@@@ZA @ stub -arch=win64 ?_Raise_handler@std@@3P6AXAEBVexception@stdext@@@ZEA -@ stub ?_Random_device@tr1@std@@YAIXZ +@ cdecl ?_Random_device@tr1@std@@YAIXZ() _Random_device @ cdecl -arch=win32 ?_Rep@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@ABA?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@DI@Z(ptr ptr long ptr long long) num_put_char__Rep @ cdecl -arch=win64 ?_Rep@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@AEBA?AV?$ostreambuf_iterator@DU?$char_traits@D@std@@@2@V32@D_K@Z(ptr ptr ptr long long) num_put_char__Rep @ cdecl -arch=win32 ?_Rep@?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@ABA?AV?$ostreambuf_iterator@GU?$char_traits@G@std@@@2@V32@GI@Z(ptr ptr long ptr long long) num_put_wchar__Rep diff -Nru wine1.7-1.7.14/dlls/msvcp110/msvcp110.spec wine1.7-1.7.18/dlls/msvcp110/msvcp110.spec --- wine1.7-1.7.14/dlls/msvcp110/msvcp110.spec 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msvcp110/msvcp110.spec 2014-05-02 18:15:48.000000000 +0000 @@ -1710,7 +1710,7 @@ @ cdecl -arch=win64 ?_Put@?$num_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@AEBA?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@PEB_W_K@Z(ptr ptr ptr wstr long) num_put_wchar__Put @ stub -arch=win32 ?_Raise_handler@std@@3P6AXABVexception@stdext@@@ZA @ stub -arch=win64 ?_Raise_handler@std@@3P6AXAEBVexception@stdext@@@ZEA -@ stub ?_Random_device@std@@YAIXZ +@ cdecl ?_Random_device@std@@YAIXZ() _Random_device @ stub -arch=win32 ?_Read_dir@sys@tr2@std@@YAPADPADPAXAAW4file_type@123@@Z @ stub -arch=win64 ?_Read_dir@sys@tr2@std@@YAPEADPEADPEAXAEAW4file_type@123@@Z @ stub -arch=win32 ?_Read_dir@sys@tr2@std@@YAPA_WPA_WPAXAAW4file_type@123@@Z @@ -3891,7 +3891,7 @@ @ stub _Xp_subx @ stub _Xtime_diff_to_millis @ stub _Xtime_diff_to_millis2 -@ stub _Xtime_get_ticks +@ cdecl _Xtime_get_ticks() @ stub __Wcrtomb_lk # extern _Zero @ cdecl towctrans(long long) diff -Nru wine1.7-1.7.14/dlls/msvcp90/misc.c wine1.7-1.7.18/dlls/msvcp90/misc.c --- wine1.7-1.7.14/dlls/msvcp90/misc.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msvcp90/misc.c 2014-05-02 18:15:48.000000000 +0000 @@ -28,6 +28,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) + struct __Container_proxy; typedef struct { @@ -343,3 +349,28 @@ if(that->proxy) that->proxy->cont = that; } + +/* _Xtime_get_ticks */ +LONGLONG __cdecl _Xtime_get_ticks(void) +{ + FILETIME ft; + + TRACE("\n"); + + GetSystemTimeAsFileTime(&ft); + return ((LONGLONG)ft.dwHighDateTime<<32) + ft.dwLowDateTime - TICKS_1601_TO_1970; +} + +#if _MSVCP_VER >= 90 +unsigned int __cdecl _Random_device(void) +{ + unsigned int ret; + + TRACE("\n"); + + /* TODO: throw correct exception in case of failure */ + if(rand_s(&ret)) + throw_exception(EXCEPTION, "random number generator failed\n"); + return ret; +} +#endif diff -Nru wine1.7-1.7.14/dlls/msvcp90/msvcp90.h wine1.7-1.7.18/dlls/msvcp90/msvcp90.h --- wine1.7-1.7.14/dlls/msvcp90/msvcp90.h 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msvcp90/msvcp90.h 2014-05-02 18:15:48.000000000 +0000 @@ -528,6 +528,6 @@ #if _MSVCP_VER < 80 #define memcpy_s( dst, size, src, count ) (memcpy( (dst), (src), (count) ), 0) #define memmove_s( dst, size, src, count ) (memmove( (dst), (src), (count) ), 0) -#define mbstowcs_s( ret, wcs, size, mbs, count ) (mbstowcs( (wcs), (mbs), (count) )) +#define mbstowcs_s( ret, wcs, size, mbs, count ) (mbstowcs( (wcs), (mbs), (count) ), 0) #define hypotf( x, y ) ((float)hypot( (double)(x), (double)(y) )) #endif diff -Nru wine1.7-1.7.14/dlls/msvcp90/msvcp90.spec wine1.7-1.7.18/dlls/msvcp90/msvcp90.spec --- wine1.7-1.7.14/dlls/msvcp90/msvcp90.spec 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msvcp90/msvcp90.spec 2014-05-02 18:15:48.000000000 +0000 @@ -3062,7 +3062,7 @@ @ stub -arch=win64 ?_Putmfld@?$money_put@_WV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@std@@@std@@AEBA?AV?$ostreambuf_iterator@_WU?$char_traits@_W@std@@@2@V32@_NAEAVios_base@2@_W1V?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@2@@Z @ stub -arch=win32 ?_Raise_handler@std@@3P6AXABVexception@stdext@@@ZA @ stub -arch=win64 ?_Raise_handler@std@@3P6AXAEBVexception@stdext@@@ZEA -@ stub ?_Random_device@tr1@std@@YAIXZ +@ cdecl ?_Random_device@tr1@std@@YAIXZ() _Random_device @ thiscall -arch=win32 ?_Read_s@?$basic_istream@DU?$char_traits@D@std@@@std@@QAEAAV12@PADIH@Z(ptr ptr long long) basic_istream_char__Read_s @ cdecl -arch=win64 ?_Read_s@?$basic_istream@DU?$char_traits@D@std@@@std@@QEAAAEAV12@PEAD_K_J@Z(ptr ptr long long) basic_istream_char__Read_s @ thiscall -arch=win32 ?_Read_s@?$basic_istream@GU?$char_traits@G@std@@@std@@QAEAAV12@PAGIH@Z(ptr ptr long long) basic_istream_wchar__Read_s diff -Nru wine1.7-1.7.14/dlls/msvcr100/Makefile.in wine1.7-1.7.18/dlls/msvcr100/Makefile.in --- wine1.7-1.7.14/dlls/msvcr100/Makefile.in 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msvcr100/Makefile.in 2014-05-02 18:15:48.000000000 +0000 @@ -1,8 +1,36 @@ +EXTRADEFS = -D_MT -D_MSVCR_VER=100 MODULE = msvcr100.dll IMPORTLIB = msvcr100 -IMPORTS = msvcrt +DELAYIMPORTS = advapi32 user32 +PARENTSRC = ../msvcrt C_SRCS = \ - msvcr100.c + 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 RC_SRCS = rsrc.rc diff -Nru wine1.7-1.7.14/dlls/msvcr100/msvcr100.c wine1.7-1.7.18/dlls/msvcr100/msvcr100.c --- wine1.7-1.7.14/dlls/msvcr100/msvcr100.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msvcr100/msvcr100.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,513 +0,0 @@ -/* - * msvcr100 specific functions - * - * Copyright 2010 Detlef Riekenberg - * - * 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 "stdio.h" -#include "stdlib.h" -#include "errno.h" -#include "malloc.h" -#include "mbstring.h" -#include "limits.h" -#include "sys/stat.h" -#include "windef.h" -#include "winbase.h" -#include "wine/debug.h" - -WINE_DEFAULT_DEBUG_CHANNEL(msvcrt); - -#define INVALID_PMT(x,err) (*_errno() = (err), _invalid_parameter(NULL, NULL, NULL, 0, 0)) -#define CHECK_PMT_ERR(x,err) ((x) || (INVALID_PMT( 0, (err) ), FALSE)) -#define CHECK_PMT(x) CHECK_PMT_ERR((x), EINVAL) - -#ifdef __i386__ /* thiscall functions are i386-specific */ - -#define THISCALL(func) __thiscall_ ## func -#define THISCALL_NAME(func) __ASM_NAME("__thiscall_" #func) -#define __thiscall __stdcall -#define DEFINE_THISCALL_WRAPPER(func,args) \ - extern void THISCALL(func)(void); \ - __ASM_GLOBAL_FUNC(__thiscall_ ## func, \ - "popl %eax\n\t" \ - "pushl %ecx\n\t" \ - "pushl %eax\n\t" \ - "jmp " __ASM_NAME(#func) __ASM_STDCALL(args) ) - -#else /* __i386__ */ - -#define THISCALL(func) func -#define THISCALL_NAME(func) __ASM_NAME(#func) -#define __thiscall __cdecl -#define DEFINE_THISCALL_WRAPPER(func,args) /* nothing */ - -#endif /* __i386__ */ - -struct __type_info_node -{ - void *memPtr; - struct __type_info_node* next; -}; - -typedef struct __type_info -{ - const void *vtable; - char *name; /* Unmangled name, allocated lazily */ - char mangled[32]; /* Variable length, but we declare it large enough for static RTTI */ -} type_info; - -typedef void* (__cdecl *malloc_func_t)(size_t); -typedef void (__cdecl *free_func_t)(void*); - -extern char* __cdecl __unDName(char *,const char*,int,malloc_func_t,free_func_t,unsigned short int); - -/********************************************************************* - * stat64_to_stat32 [internal] - */ -static void stat64_to_stat32(const struct _stat64 *buf64, struct _stat32 *buf) -{ - buf->st_dev = buf64->st_dev; - buf->st_ino = buf64->st_ino; - buf->st_mode = buf64->st_mode; - buf->st_nlink = buf64->st_nlink; - buf->st_uid = buf64->st_uid; - buf->st_gid = buf64->st_gid; - buf->st_rdev = buf64->st_rdev; - buf->st_size = buf64->st_size; - buf->st_atime = buf64->st_atime; - buf->st_mtime = buf64->st_mtime; - buf->st_ctime = buf64->st_ctime; -} - - /********************************************************************* - * wmemcpy_s (MSVCR100.@) - */ -int CDECL wmemcpy_s(wchar_t *dest, size_t numberOfElements, const wchar_t *src, size_t count) -{ - TRACE("(%p %lu %p %lu)\n", dest, (unsigned long)numberOfElements, src, (unsigned long)count); - - if (!count) - return 0; - - if (!CHECK_PMT(dest != NULL)) return EINVAL; - - if (!CHECK_PMT(src != NULL)) { - memset(dest, 0, numberOfElements*sizeof(wchar_t)); - return EINVAL; - } - if (!CHECK_PMT_ERR(count <= numberOfElements, ERANGE)) { - memset(dest, 0, numberOfElements*sizeof(wchar_t)); - return ERANGE; - } - - memcpy(dest, src, sizeof(wchar_t)*count); - return 0; -} - - /********************************************************************* - * wmemmove_s (MSVCR100.@) - */ -int CDECL wmemmove_s(wchar_t *dest, size_t numberOfElements, const wchar_t *src, size_t count) -{ - TRACE("(%p %lu %p %lu)\n", dest, (unsigned long)numberOfElements, src, (unsigned long)count); - - if (!count) - return 0; - - /* Native does not seem to conform to 6.7.1.2.3 in - * http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1225.pdf - * in that it does not zero the output buffer on constraint violation. - */ - if (!CHECK_PMT(dest != NULL)) return EINVAL; - if (!CHECK_PMT(src != NULL)) return EINVAL; - if (!CHECK_PMT_ERR(count <= numberOfElements, ERANGE)) return ERANGE; - - memmove(dest, src, sizeof(wchar_t)*count); - return 0; -} - -/********************************************************************* - * _encoded_null (MSVCR100.@) - */ -void * CDECL _encoded_null(void) -{ - TRACE("\n"); - - return EncodePointer(NULL); -} - -/********************************************************************* - * _invalid_parameter_noinfo (MSVCR100.@) - */ -void CDECL _invalid_parameter_noinfo(void) -{ - _invalid_parameter( NULL, NULL, NULL, 0, 0 ); -} - -/********************************************************************* - * __sys_nerr (MSVCR100.@) - */ -int* CDECL __sys_nerr(void) -{ - return (int*)GetProcAddress(GetModuleHandleA("msvcrt.dll"), "_sys_nerr"); -} - -/********************************************************************* - * __sys_errlist (MSVCR100.@) - */ -char** CDECL __sys_errlist(void) -{ - return (char**)GetProcAddress(GetModuleHandleA("msvcrt.dll"), "_sys_errlist"); -} - -/********************************************************************* - * __clean_type_info_names_internal (MSVCR100.@) - */ -void CDECL __clean_type_info_names_internal(void *p) -{ - FIXME("(%p) stub\n", p); -} - -/********************************************************************* - * _recalloc (MSVCR100.@) - */ -void* CDECL _recalloc(void* mem, size_t num, size_t size) -{ - size_t old_size; - void *ret; - - if(!mem) - return calloc(num, size); - - size = num*size; - old_size = _msize(mem); - - ret = realloc(mem, size); - if(!ret) { - *_errno() = ENOMEM; - return NULL; - } - - if(size>old_size) - memset((BYTE*)ret+old_size, 0, size-old_size); - return ret; -} - -/********************************************************************* - * _stat32 (MSVCR100.@) - */ -int CDECL _stat32(const char *path, struct _stat32* buf) -{ - int ret; - struct _stat64 buf64; - - ret = _stat64(path, &buf64); - if (!ret) - stat64_to_stat32(&buf64, buf); - return ret; -} - -/********************************************************************* - * _wstat32 (MSVCR100.@) - */ -int CDECL _wstat32(const wchar_t *path, struct _stat32* buf) -{ - int ret; - struct _stat64 buf64; - - ret = _wstat64(path, &buf64); - if (!ret) - stat64_to_stat32(&buf64, buf); - return ret; -} - -static void stat64_to_stat32i64(const struct _stat64 *buf64, struct _stat32i64 *buf) -{ - buf->st_dev = buf64->st_dev; - buf->st_ino = buf64->st_ino; - buf->st_mode = buf64->st_mode; - buf->st_nlink = buf64->st_nlink; - buf->st_uid = buf64->st_uid; - buf->st_gid = buf64->st_gid; - buf->st_rdev = buf64->st_rdev; - buf->st_size = buf64->st_size; - buf->st_atime = buf64->st_atime; - buf->st_mtime = buf64->st_mtime; - buf->st_ctime = buf64->st_ctime; -} - -/********************************************************************* - * _stat32i64 (MSVCR100.@) - */ -int CDECL _stat32i64(const char *path, struct _stat32i64* buf) -{ - int ret; - struct _stat64 buf64; - - ret = _stat64(path, &buf64); - if (!ret) - stat64_to_stat32i64(&buf64, buf); - return ret; -} - -/********************************************************************* - * _wstat32i64 (MSVCR100.@) - */ -int CDECL _wstat32i64(const wchar_t *path, struct _stat32i64* buf) -{ - int ret; - struct _stat64 buf64; - - ret = _wstat64(path, &buf64); - if (!ret) - stat64_to_stat32i64(&buf64, buf); - return ret; -} - -static void stat64_to_stat64i32(const struct _stat64 *buf64, struct _stat64i32 *buf) -{ - buf->st_dev = buf64->st_dev; - buf->st_ino = buf64->st_ino; - buf->st_mode = buf64->st_mode; - buf->st_nlink = buf64->st_nlink; - buf->st_uid = buf64->st_uid; - buf->st_gid = buf64->st_gid; - buf->st_rdev = buf64->st_rdev; - buf->st_size = buf64->st_size; - buf->st_atime = buf64->st_atime; - buf->st_mtime = buf64->st_mtime; - buf->st_ctime = buf64->st_ctime; -} - -/********************************************************************* - * _stat64i32 (MSVCR100.@) - */ -int CDECL _stat64i32(const char* path, struct _stat64i32 * buf) -{ - int ret; - struct _stat64 buf64; - - ret = _stat64(path, &buf64); - if (!ret) - stat64_to_stat64i32(&buf64, buf); - return ret; -} - -/********************************************************************* - * _wstat64i32 (MSVCR100.@) - */ -int CDECL _wstat64i32(const wchar_t *path, struct _stat64i32 *buf) -{ - int ret; - struct _stat64 buf64; - - ret = _wstat64(path, &buf64); - if (!ret) - stat64_to_stat64i32(&buf64, buf); - return ret; -} - -/********************************************************************* - * _atoflt (MSVCR100.@) - */ -int CDECL _atoflt( _CRT_FLOAT *value, char *str ) -{ - return _atoflt_l( value, str, NULL ); -} - -/********************************************************************* - * ?_name_internal_method@type_info@@QBEPBDPAU__type_info_node@@@Z (MSVCR100.@) - */ -DEFINE_THISCALL_WRAPPER(type_info_name_internal_method,8) -const char * __thiscall type_info_name_internal_method(type_info * _this, struct __type_info_node *node) -{ - static int once; - - if (node && !once++) FIXME("type_info_node parameter ignored\n"); - - if (!_this->name) - { - /* Create and set the demangled name */ - /* Note: mangled name in type_info struct always starts with a '.', while - * it isn't valid for mangled name. - * Is this '.' really part of the mangled name, or has it some other meaning ? - */ - char* name = __unDName(0, _this->mangled + 1, 0, malloc, free, 0x2800); - if (name) - { - unsigned int len = strlen(name); - - /* It seems _unDName may leave blanks at the end of the demangled name */ - while (len && name[--len] == ' ') - name[len] = '\0'; - - if (InterlockedCompareExchangePointer((void**)&_this->name, name, NULL)) - { - /* Another thread set this member since we checked above - use it */ - free(name); - } - } - } - TRACE("(%p) returning %s\n", _this, _this->name); - return _this->name; -} - -/********************************************************************* - * _CRT_RTC_INIT (MSVCR100.@) - */ -void* CDECL _CRT_RTC_INIT(void *unk1, void *unk2, int unk3, int unk4, int unk5) -{ - TRACE("%p %p %x %x %x\n", unk1, unk2, unk3, unk4, unk5); - return NULL; -} - -/********************************************************************* - * _CRT_RTC_INITW (MSVCR100.@) - */ -void* CDECL _CRT_RTC_INITW(void *unk1, void *unk2, int unk3, int unk4, int unk5) -{ - TRACE("%p %p %x %x %x\n", unk1, unk2, unk3, unk4, unk5); - return NULL; -} - -/********************************************************************* - * _vswprintf_p (MSVCR100.@) - */ -int CDECL _vswprintf_p(wchar_t *buffer, size_t length, const wchar_t *format, __ms_va_list args) -{ - return _vswprintf_p_l(buffer, length, format, NULL, args); -} - -/********************************************************************* - * _vscwprintf_p (MSVCR100.@) - */ -int CDECL _vscwprintf_p(const wchar_t *format, __ms_va_list args) -{ - return _vscwprintf_p_l(format, NULL, args); -} - -/********************************************************************* - * _byteswap_ushort (MSVCR100.@) - */ -unsigned short CDECL _byteswap_ushort(unsigned short s) -{ - return (s<<8) + (s>>8); -} - -/********************************************************************* - * _byteswap_ulong (MSVCR100.@) - */ -ULONG CDECL _byteswap_ulong(ULONG l) -{ - return (l<<24) + ((l<<8)&0xFF0000) + ((l>>8)&0xFF00) + (l>>24); -} - -/********************************************************************* - * _byteswap_uint64 (MSVCR100.@) - */ -unsigned __int64 CDECL _byteswap_uint64(unsigned __int64 i) -{ - return (i<<56) + ((i&0xFF00)<<40) + ((i&0xFF0000)<<24) + ((i&0xFF000000)<<8) + - ((i>>8)&0xFF000000) + ((i>>24)&0xFF0000) + ((i>>40)&0xFF00) + (i>>56); -} - -/********************************************************************* - * _sprintf_p (MSVCR100.@) - */ -int CDECL _sprintf_p(char *buffer, size_t length, const char *format, ...) -{ - __ms_va_list valist; - int r; - - __ms_va_start(valist, format); - r = _vsprintf_p_l(buffer, length, format, NULL, valist); - __ms_va_end(valist); - - return r; -} - -/********************************************************************* - * _get_timezone (MSVCR100.@) - */ -int CDECL _get_timezone(LONG *timezone) -{ - if(!CHECK_PMT(timezone != NULL)) return EINVAL; - - *timezone = *(LONG*)GetProcAddress(GetModuleHandleA("msvcrt.dll"), "_timezone"); - return 0; -} - -/********************************************************************* - * _get_daylight (MSVCR100.@) - */ -int CDECL _get_daylight(int *hours) -{ - if(!CHECK_PMT(hours != NULL)) return EINVAL; - - *hours = *(int*)GetProcAddress(GetModuleHandleA("msvcrt.dll"), "_daylight"); - return 0; -} - -/* copied from dlls/msvcrt/heap.c */ -#define SAVED_PTR(x) ((void *)((DWORD_PTR)((char *)x - sizeof(void *)) & \ - ~(sizeof(void *) - 1))) - -/********************************************************************* - * _aligned_msize (MSVCR100.@) - */ -size_t CDECL _aligned_msize(void *p, size_t alignment, size_t offset) -{ - void **alloc_ptr; - - if(!CHECK_PMT(p)) return -1; - - if(alignment < sizeof(void*)) - alignment = sizeof(void*); - - alloc_ptr = SAVED_PTR(p); - return _msize(*alloc_ptr)-alignment-sizeof(void*); -} - -int CDECL MSVCR100_atoi(const char *str) -{ - return _atoi_l(str, NULL); -} - -unsigned char* CDECL MSVCR100__mbstok(unsigned char *str, const unsigned char *delim) -{ - return _mbstok_l(str, delim, NULL); -} - -/********************************************************************* - * DllMain (MSVCR100.@) - */ -BOOL WINAPI DllMain(HINSTANCE hdll, DWORD reason, LPVOID reserved) -{ - switch (reason) - { - case DLL_WINE_PREATTACH: - return FALSE; /* prefer native version */ - - case DLL_PROCESS_ATTACH: - DisableThreadLibraryCalls(hdll); - _set_printf_count_output(0); - } - return TRUE; -} diff -Nru wine1.7-1.7.14/dlls/msvcr100/msvcr100.spec wine1.7-1.7.18/dlls/msvcr100/msvcr100.spec --- wine1.7-1.7.14/dlls/msvcr100/msvcr100.spec 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msvcr100/msvcr100.spec 2014-05-02 18:15:48.000000000 +0000 @@ -32,24 +32,24 @@ @ stub -arch=win64 ??0_TaskCollection@details@Concurrency@@QEAA@XZ @ stub -arch=win32 ??0_Timer@details@Concurrency@@IAE@I_N@Z @ stub -arch=win64 ??0_Timer@details@Concurrency@@IEAA@I_N@Z -@ thiscall -arch=i386 ??0__non_rtti_object@std@@QAE@ABV01@@Z(ptr ptr) msvcrt.??0__non_rtti_object@@QAE@ABV0@@Z -@ cdecl -arch=win64 ??0__non_rtti_object@std@@QEAA@AEBV01@@Z(ptr ptr) msvcrt.??0__non_rtti_object@@QEAA@AEBV0@@Z -@ thiscall -arch=i386 ??0__non_rtti_object@std@@QAE@PBD@Z(ptr ptr) msvcrt.??0__non_rtti_object@@QAE@PBD@Z -@ cdecl -arch=win64 ??0__non_rtti_object@std@@QEAA@PEBD@Z(ptr ptr) msvcrt.??0__non_rtti_object@@QEAA@PEBD@Z -@ thiscall -arch=i386 ??0bad_cast@std@@AAE@PBQBD@Z(ptr ptr) msvcrt.??0bad_cast@@AAE@PBQBD@Z -@ cdecl -arch=win64 ??0bad_cast@std@@AEAA@PEBQEBD@Z(ptr ptr) msvcrt.??0bad_cast@@AEAA@PEBQEBD@Z -@ thiscall -arch=i386 ??0bad_cast@std@@QAE@ABV01@@Z(ptr ptr) msvcrt.??0bad_cast@@QAE@ABV0@@Z -@ cdecl -arch=win64 ??0bad_cast@std@@QEAA@AEBV01@@Z(ptr ptr) msvcrt.??0bad_cast@@QEAA@AEBV0@@Z -@ thiscall -arch=i386 ??0bad_cast@std@@QAE@PBD@Z(ptr str) msvcrt.??0bad_cast@@QAE@PBD@Z -@ cdecl -arch=win64 ??0bad_cast@std@@QEAA@PEBD@Z(ptr str) msvcrt.??0bad_cast@@QEAA@PEBD@Z +@ thiscall -arch=i386 ??0__non_rtti_object@std@@QAE@ABV01@@Z(ptr ptr) MSVCRT___non_rtti_object_copy_ctor +@ cdecl -arch=win64 ??0__non_rtti_object@std@@QEAA@AEBV01@@Z(ptr ptr) MSVCRT___non_rtti_object_copy_ctor +@ thiscall -arch=i386 ??0__non_rtti_object@std@@QAE@PBD@Z(ptr ptr) MSVCRT___non_rtti_object_ctor +@ cdecl -arch=win64 ??0__non_rtti_object@std@@QEAA@PEBD@Z(ptr ptr) MSVCRT___non_rtti_object_ctor +@ thiscall -arch=i386 ??0bad_cast@std@@AAE@PBQBD@Z(ptr ptr) MSVCRT_bad_cast_ctor +@ cdecl -arch=win64 ??0bad_cast@std@@AEAA@PEBQEBD@Z(ptr ptr) MSVCRT_bad_cast_ctor +@ thiscall -arch=i386 ??0bad_cast@std@@QAE@ABV01@@Z(ptr ptr) MSVCRT_bad_cast_copy_ctor +@ cdecl -arch=win64 ??0bad_cast@std@@QEAA@AEBV01@@Z(ptr ptr) MSVCRT_bad_cast_copy_ctor +@ thiscall -arch=i386 ??0bad_cast@std@@QAE@PBD@Z(ptr str) MSVCRT_bad_cast_ctor_charptr +@ cdecl -arch=win64 ??0bad_cast@std@@QEAA@PEBD@Z(ptr str) MSVCRT_bad_cast_ctor_charptr @ stub -arch=win32 ??0bad_target@Concurrency@@QAE@PBD@Z @ stub -arch=win64 ??0bad_target@Concurrency@@QEAA@PEBD@Z @ stub -arch=win32 ??0bad_target@Concurrency@@QAE@XZ @ stub -arch=win64 ??0bad_target@Concurrency@@QEAA@XZ -@ thiscall -arch=i386 ??0bad_typeid@std@@QAE@ABV01@@Z(ptr ptr) msvcrt.??0bad_typeid@@QAE@ABV0@@Z -@ cdecl -arch=win64 ??0bad_typeid@std@@QEAA@AEBV01@@Z(ptr ptr) msvcrt.??0bad_typeid@@QEAA@AEBV0@@Z -@ thiscall -arch=i386 ??0bad_typeid@std@@QAE@PBD@Z(ptr str) msvcrt.??0bad_typeid@@QAE@PBD@Z -@ cdecl -arch=win64 ??0bad_typeid@std@@QEAA@PEBD@Z(ptr str) msvcrt.??0bad_typeid@@QEAA@PEBD@Z +@ thiscall -arch=i386 ??0bad_typeid@std@@QAE@ABV01@@Z(ptr ptr) MSVCRT_bad_typeid_copy_ctor +@ cdecl -arch=win64 ??0bad_typeid@std@@QEAA@AEBV01@@Z(ptr ptr) MSVCRT_bad_typeid_copy_ctor +@ thiscall -arch=i386 ??0bad_typeid@std@@QAE@PBD@Z(ptr str) MSVCRT_bad_typeid_ctor +@ cdecl -arch=win64 ??0bad_typeid@std@@QEAA@PEBD@Z(ptr str) MSVCRT_bad_typeid_ctor @ stub -arch=win32 ??0context_self_unblock@Concurrency@@QAE@PBD@Z @ stub -arch=win64 ??0context_self_unblock@Concurrency@@QEAA@PEBD@Z @ stub -arch=win32 ??0context_self_unblock@Concurrency@@QAE@XZ @@ -66,14 +66,14 @@ @ stub -arch=win64 ??0default_scheduler_exists@Concurrency@@QEAA@XZ @ stub -arch=win32 ??0event@Concurrency@@QAE@XZ @ stub -arch=win64 ??0event@Concurrency@@QEAA@XZ -@ thiscall -arch=i386 ??0exception@std@@QAE@ABQBD@Z(ptr ptr) msvcrt.??0exception@@QAE@ABQBD@Z -@ cdecl -arch=win64 ??0exception@std@@QEAA@AEBQEBD@Z(ptr ptr) msvcrt.??0exception@@QEAA@AEBQEBD@Z -@ thiscall -arch=i386 ??0exception@std@@QAE@ABQBDH@Z(ptr ptr long) msvcrt.??0exception@@QAE@ABQBDH@Z -@ cdecl -arch=win64 ??0exception@std@@QEAA@AEBQEBDH@Z(ptr ptr long) msvcrt.??0exception@@QEAA@AEBQEBDH@Z -@ thiscall -arch=i386 ??0exception@std@@QAE@ABV01@@Z(ptr ptr) msvcrt.??0exception@@QAE@ABV0@@Z -@ cdecl -arch=win64 ??0exception@std@@QEAA@AEBV01@@Z(ptr ptr) msvcrt.??0exception@@QEAA@AEBV0@@Z -@ thiscall -arch=i386 ??0exception@std@@QAE@XZ(ptr) msvcrt.??0exception@@QAE@XZ -@ cdecl -arch=win64 ??0exception@std@@QEAA@XZ(ptr) msvcrt.??0exception@@QEAA@XZ +@ thiscall -arch=i386 ??0exception@std@@QAE@ABQBD@Z(ptr ptr) MSVCRT_exception_ctor +@ cdecl -arch=win64 ??0exception@std@@QEAA@AEBQEBD@Z(ptr ptr) MSVCRT_exception_ctor +@ thiscall -arch=i386 ??0exception@std@@QAE@ABQBDH@Z(ptr ptr long) MSVCRT_exception_ctor_noalloc +@ cdecl -arch=win64 ??0exception@std@@QEAA@AEBQEBDH@Z(ptr ptr long) MSVCRT_exception_ctor_noalloc +@ thiscall -arch=i386 ??0exception@std@@QAE@ABV01@@Z(ptr ptr) MSVCRT_exception_copy_ctor +@ cdecl -arch=win64 ??0exception@std@@QEAA@AEBV01@@Z(ptr ptr) MSVCRT_exception_copy_ctor +@ thiscall -arch=i386 ??0exception@std@@QAE@XZ(ptr) MSVCRT_exception_default_ctor +@ cdecl -arch=win64 ??0exception@std@@QEAA@XZ(ptr) MSVCRT_exception_default_ctor @ stub -arch=win32 ??0improper_lock@Concurrency@@QAE@PBD@Z @ stub -arch=win64 ??0improper_lock@Concurrency@@QEAA@PEBD@Z @ stub -arch=win32 ??0improper_lock@Concurrency@@QAE@XZ @@ -174,18 +174,18 @@ @ stub -arch=win64 ??1_TaskCollection@details@Concurrency@@QEAA@XZ @ stub -arch=win32 ??1_Timer@details@Concurrency@@IAE@XZ @ stub -arch=win64 ??1_Timer@details@Concurrency@@IEAA@XZ -@ thiscall -arch=i386 ??1__non_rtti_object@std@@UAE@XZ(ptr) msvcrt.??1__non_rtti_object@@UAE@XZ -@ cdecl -arch=win64 ??1__non_rtti_object@std@@UEAA@XZ(ptr) msvcrt.??1__non_rtti_object@@UEAA@XZ -@ thiscall -arch=i386 ??1bad_cast@std@@UAE@XZ(ptr) msvcrt.??1bad_cast@@UAE@XZ -@ cdecl -arch=win64 ??1bad_cast@std@@UEAA@XZ(ptr) msvcrt.??1bad_cast@@UEAA@XZ -@ thiscall -arch=i386 ??1bad_typeid@std@@UAE@XZ(ptr) msvcrt.??1bad_typeid@@UAE@XZ -@ cdecl -arch=win64 ??1bad_typeid@std@@UEAA@XZ(ptr) msvcrt.??1bad_typeid@@UEAA@XZ +@ thiscall -arch=i386 ??1__non_rtti_object@std@@UAE@XZ(ptr) MSVCRT___non_rtti_object_dtor +@ cdecl -arch=win64 ??1__non_rtti_object@std@@UEAA@XZ(ptr) MSVCRT___non_rtti_object_dtor +@ thiscall -arch=i386 ??1bad_cast@std@@UAE@XZ(ptr) MSVCRT_bad_cast_dtor +@ cdecl -arch=win64 ??1bad_cast@std@@UEAA@XZ(ptr) MSVCRT_bad_cast_dtor +@ thiscall -arch=i386 ??1bad_typeid@std@@UAE@XZ(ptr) MSVCRT_bad_typeid_dtor +@ cdecl -arch=win64 ??1bad_typeid@std@@UEAA@XZ(ptr) MSVCRT_bad_typeid_dtor @ stub -arch=win32 ??1critical_section@Concurrency@@QAE@XZ @ stub -arch=win64 ??1critical_section@Concurrency@@QEAA@XZ @ stub -arch=win32 ??1event@Concurrency@@QAE@XZ @ stub -arch=win64 ??1event@Concurrency@@QEAA@XZ -@ thiscall -arch=i386 ??1exception@std@@UAE@XZ(ptr) msvcrt.??1exception@@UAE@XZ -@ cdecl -arch=win64 ??1exception@std@@UEAA@XZ(ptr) msvcrt.??1exception@@UEAA@XZ +@ thiscall -arch=i386 ??1exception@std@@UAE@XZ(ptr) MSVCRT_exception_dtor +@ cdecl -arch=win64 ??1exception@std@@UEAA@XZ(ptr) MSVCRT_exception_dtor @ stub -arch=win32 ??1reader_writer_lock@Concurrency@@QAE@XZ @ stub -arch=win64 ??1reader_writer_lock@Concurrency@@QEAA@XZ @ stub -arch=win32 ??1scoped_lock@critical_section@Concurrency@@QAE@XZ @@ -194,54 +194,54 @@ @ stub -arch=win64 ??1scoped_lock@reader_writer_lock@Concurrency@@QEAA@XZ @ stub -arch=win32 ??1scoped_lock_read@reader_writer_lock@Concurrency@@QAE@XZ @ stub -arch=win64 ??1scoped_lock_read@reader_writer_lock@Concurrency@@QEAA@XZ -@ cdecl -arch=arm ??1type_info@@UAA@XZ(ptr) msvcrt.??1type_info@@UAA@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 -@ cdecl -arch=win64 ??2@YAPEAX_K@Z(long) msvcrt.??2@YAPEAX_K@Z -@ cdecl -arch=win32 ??2@YAPAXIHPBDH@Z(long long str long) msvcrt.??2@YAPAXIHPBDH@Z -@ cdecl -arch=win64 ??2@YAPEAX_KHPEBDH@Z(long long str long) msvcrt.??2@YAPEAX_KHPEBDH@Z -@ cdecl -arch=win32 ??3@YAXPAX@Z(ptr) msvcrt.??3@YAXPAX@Z -@ cdecl -arch=win64 ??3@YAXPEAX@Z(ptr) msvcrt.??3@YAXPEAX@Z +@ cdecl -arch=arm ??1type_info@@UAA@XZ(ptr) MSVCRT_type_info_dtor +@ thiscall -arch=i386 ??1type_info@@UAE@XZ(ptr) MSVCRT_type_info_dtor +@ cdecl -arch=win64 ??1type_info@@UEAA@XZ(ptr) MSVCRT_type_info_dtor +@ cdecl -arch=win32 ??2@YAPAXI@Z(long) MSVCRT_operator_new +@ cdecl -arch=win64 ??2@YAPEAX_K@Z(long) MSVCRT_operator_new +@ cdecl -arch=win32 ??2@YAPAXIHPBDH@Z(long long str long) MSVCRT_operator_new_dbg +@ cdecl -arch=win64 ??2@YAPEAX_KHPEBDH@Z(long long str long) MSVCRT_operator_new_dbg +@ cdecl -arch=win32 ??3@YAXPAX@Z(ptr) MSVCRT_operator_delete +@ cdecl -arch=win64 ??3@YAXPEAX@Z(ptr) MSVCRT_operator_delete @ stub -arch=win32 ??4?$_SpinWait@$00@details@Concurrency@@QAEAAV012@ABV012@@Z @ stub -arch=win64 ??4?$_SpinWait@$00@details@Concurrency@@QEAAAEAV012@AEBV012@@Z @ stub -arch=win32 ??4?$_SpinWait@$0A@@details@Concurrency@@QAEAAV012@ABV012@@Z @ stub -arch=win64 ??4?$_SpinWait@$0A@@details@Concurrency@@QEAAAEAV012@AEBV012@@Z @ stub -arch=win32 ??4SchedulerPolicy@Concurrency@@QAEAAV01@ABV01@@Z @ stub -arch=win64 ??4SchedulerPolicy@Concurrency@@QEAAAEAV01@AEBV01@@Z -@ thiscall -arch=i386 ??4__non_rtti_object@std@@QAEAAV01@ABV01@@Z(ptr ptr) msvcrt.??4__non_rtti_object@@QAEAAV0@ABV0@@Z -@ cdecl -arch=win64 ??4__non_rtti_object@std@@QEAAAEAV01@AEBV01@@Z(ptr ptr) msvcrt.??4__non_rtti_object@@QEAAAEAV0@AEBV0@@Z -@ thiscall -arch=i386 ??4bad_cast@std@@QAEAAV01@ABV01@@Z(ptr ptr) msvcrt.??4bad_cast@@QAEAAV0@ABV0@@Z -@ cdecl -arch=win64 ??4bad_cast@std@@QEAAAEAV01@AEBV01@@Z(ptr ptr) msvcrt.??4bad_cast@@QEAAAEAV0@AEBV0@@Z -@ thiscall -arch=i386 ??4bad_typeid@std@@QAEAAV01@ABV01@@Z(ptr ptr) msvcrt.??4bad_typeid@@QAEAAV0@ABV0@@Z -@ cdecl -arch=win64 ??4bad_typeid@std@@QEAAAEAV01@AEBV01@@Z(ptr ptr) msvcrt.??4bad_typeid@@QEAAAEAV0@AEBV0@@Z -@ thiscall -arch=i386 ??4exception@std@@QAEAAV01@ABV01@@Z(ptr ptr) msvcrt.??4exception@@QAEAAV0@ABV0@@Z -@ cdecl -arch=win64 ??4exception@std@@QEAAAEAV01@AEBV01@@Z(ptr ptr) msvcrt.??4exception@@QEAAAEAV0@AEBV0@@Z -@ cdecl -arch=arm ??8type_info@@QBA_NABV0@@Z(ptr ptr) msvcrt.??8type_info@@QBA_NABV0@@Z -@ thiscall -arch=i386 ??8type_info@@QBE_NABV0@@Z(ptr ptr) msvcrt.??8type_info@@QBEHABV0@@Z -@ cdecl -arch=win64 ??8type_info@@QEBA_NAEBV0@@Z(ptr ptr) msvcrt.??8type_info@@QEBAHAEBV0@@Z -@ cdecl -arch=arm ??9type_info@@QBA_NABV0@@Z(ptr ptr) msvcrt.??9type_info@@QBA_NABV0@@Z -@ thiscall -arch=i386 ??9type_info@@QBE_NABV0@@Z(ptr ptr) msvcrt.??9type_info@@QBEHABV0@@Z -@ cdecl -arch=win64 ??9type_info@@QEBA_NAEBV0@@Z(ptr ptr) msvcrt.??9type_info@@QEBAHAEBV0@@Z -@ extern ??_7__non_rtti_object@std@@6B@ msvcrt.??_7__non_rtti_object@@6B@ -@ extern ??_7bad_cast@std@@6B@ msvcrt.??_7bad_cast@@6B@ -@ extern ??_7bad_typeid@std@@6B@ msvcrt.??_7bad_typeid@@6B@ -@ extern ??_7exception@@6B@ msvcrt.??_7exception@@6B@ -@ extern ??_7exception@std@@6B@ msvcrt.??_7exception@@6B@ +@ thiscall -arch=i386 ??4__non_rtti_object@std@@QAEAAV01@ABV01@@Z(ptr ptr) MSVCRT___non_rtti_object_opequals +@ cdecl -arch=win64 ??4__non_rtti_object@std@@QEAAAEAV01@AEBV01@@Z(ptr ptr) MSVCRT___non_rtti_object_opequals +@ thiscall -arch=i386 ??4bad_cast@std@@QAEAAV01@ABV01@@Z(ptr ptr) MSVCRT_bad_cast_opequals +@ cdecl -arch=win64 ??4bad_cast@std@@QEAAAEAV01@AEBV01@@Z(ptr ptr) MSVCRT_bad_cast_opequals +@ thiscall -arch=i386 ??4bad_typeid@std@@QAEAAV01@ABV01@@Z(ptr ptr) MSVCRT_bad_typeid_opequals +@ cdecl -arch=win64 ??4bad_typeid@std@@QEAAAEAV01@AEBV01@@Z(ptr ptr) MSVCRT_bad_typeid_opequals +@ thiscall -arch=i386 ??4exception@std@@QAEAAV01@ABV01@@Z(ptr ptr) MSVCRT_exception_opequals +@ cdecl -arch=win64 ??4exception@std@@QEAAAEAV01@AEBV01@@Z(ptr ptr) MSVCRT_exception_opequals +@ cdecl -arch=arm ??8type_info@@QBA_NABV0@@Z(ptr ptr) MSVCRT_type_info_opequals_equals +@ thiscall -arch=i386 ??8type_info@@QBE_NABV0@@Z(ptr ptr) MSVCRT_type_info_opequals_equals +@ cdecl -arch=win64 ??8type_info@@QEBA_NAEBV0@@Z(ptr ptr) MSVCRT_type_info_opequals_equals +@ cdecl -arch=arm ??9type_info@@QBA_NABV0@@Z(ptr ptr) MSVCRT_type_info_opnot_equals +@ thiscall -arch=i386 ??9type_info@@QBE_NABV0@@Z(ptr ptr) MSVCRT_type_info_opnot_equals +@ cdecl -arch=win64 ??9type_info@@QEBA_NAEBV0@@Z(ptr ptr) MSVCRT_type_info_opnot_equals +@ extern ??_7__non_rtti_object@std@@6B@ MSVCRT___non_rtti_object_vtable +@ extern ??_7bad_cast@std@@6B@ MSVCRT_bad_cast_vtable +@ extern ??_7bad_typeid@std@@6B@ MSVCRT_bad_typeid_vtable +@ extern ??_7exception@@6B@ MSVCRT_exception_vtable +@ extern ??_7exception@std@@6B@ MSVCRT_exception_vtable @ stub -arch=win32 ??_F?$_SpinWait@$00@details@Concurrency@@QAEXXZ @ stub -arch=win64 ??_F?$_SpinWait@$00@details@Concurrency@@QEAAXXZ @ stub -arch=win32 ??_F?$_SpinWait@$0A@@details@Concurrency@@QAEXXZ @ stub -arch=win64 ??_F?$_SpinWait@$0A@@details@Concurrency@@QEAAXXZ -@ thiscall -arch=i386 ??_Fbad_cast@std@@QAEXXZ(ptr) msvcrt.??_Fbad_cast@@QAEXXZ -@ cdecl -arch=win64 ??_Fbad_cast@std@@QEAAXXZ(ptr) msvcrt.??_Fbad_cast@@QEAAXXZ -@ thiscall -arch=i386 ??_Fbad_typeid@std@@QAEXXZ(ptr) msvcrt.??_Fbad_typeid@@QAEXXZ -@ cdecl -arch=win64 ??_Fbad_typeid@std@@QEAAXXZ(ptr) msvcrt.??_Fbad_typeid@@QEAAXXZ -@ cdecl -arch=win32 ??_U@YAPAXI@Z(long) msvcrt.??_U@YAPAXI@Z -@ cdecl -arch=win64 ??_U@YAPEAX_K@Z(long) msvcrt.??_U@YAPEAX_K@Z -@ cdecl -arch=win32 ??_U@YAPAXIHPBDH@Z(long long str long) msvcrt.??_U@YAPAXIHPBDH@Z -@ cdecl -arch=win64 ??_U@YAPEAX_KHPEBDH@Z(long long str long) msvcrt.??_U@YAPEAX_KHPEBDH@Z -@ cdecl -arch=win32 ??_V@YAXPAX@Z(ptr) msvcrt.??_V@YAXPAX@Z -@ cdecl -arch=win64 ??_V@YAXPEAX@Z(ptr) msvcrt.??_V@YAXPEAX@Z +@ thiscall -arch=i386 ??_Fbad_cast@std@@QAEXXZ(ptr) MSVCRT_bad_cast_default_ctor +@ cdecl -arch=win64 ??_Fbad_cast@std@@QEAAXXZ(ptr) MSVCRT_bad_cast_default_ctor +@ thiscall -arch=i386 ??_Fbad_typeid@std@@QAEXXZ(ptr) MSVCRT_bad_typeid_default_ctor +@ cdecl -arch=win64 ??_Fbad_typeid@std@@QEAAXXZ(ptr) MSVCRT_bad_typeid_default_ctor +@ cdecl -arch=win32 ??_U@YAPAXI@Z(long) MSVCRT_operator_new +@ cdecl -arch=win64 ??_U@YAPEAX_K@Z(long) MSVCRT_operator_new +@ cdecl -arch=win32 ??_U@YAPAXIHPBDH@Z(long long str long) MSVCRT_operator_new_dbg +@ cdecl -arch=win64 ??_U@YAPEAX_KHPEBDH@Z(long long str long) MSVCRT_operator_new_dbg +@ cdecl -arch=win32 ??_V@YAXPAX@Z(ptr) MSVCRT_operator_delete +@ cdecl -arch=win64 ??_V@YAXPEAX@Z(ptr) MSVCRT_operator_delete @ stub -arch=win32 ?Alloc@Concurrency@@YAPAXI@Z @ stub -arch=win64 ?Alloc@Concurrency@@YAPEAX_K@Z @ stub ?Block@Context@Concurrency@@SAXXZ @@ -424,39 +424,39 @@ @ stub -arch=win64 ?__ExceptionPtrDestroy@@YAXPEAX@Z @ stub -arch=win32 ?__ExceptionPtrRethrow@@YAXPBX@Z @ stub -arch=win64 ?__ExceptionPtrRethrow@@YAXPEBX@Z -@ cdecl __uncaught_exception() msvcrt.__uncaught_exception +@ cdecl __uncaught_exception() MSVCRT___uncaught_exception @ stub ?_inconsistency@@YAXXZ -@ cdecl -arch=win32 ?_invalid_parameter@@YAXPBG00II@Z(wstr wstr wstr long long) msvcrt._invalid_parameter -@ cdecl -arch=win64 ?_invalid_parameter@@YAXPEBG00I_K@Z(wstr wstr wstr long long) msvcrt._invalid_parameter -@ cdecl -arch=win32 ?_is_exception_typeof@@YAHABVtype_info@@PAU_EXCEPTION_POINTERS@@@Z(ptr ptr) msvcrt._is_exception_typeof -@ cdecl -arch=win64 ?_is_exception_typeof@@YAHAEBVtype_info@@PEAU_EXCEPTION_POINTERS@@@Z(ptr ptr) msvcrt._is_exception_typeof +@ cdecl -arch=win32 ?_invalid_parameter@@YAXPBG00II@Z(wstr wstr wstr long long) MSVCRT__invalid_parameter +@ cdecl -arch=win64 ?_invalid_parameter@@YAXPEBG00I_K@Z(wstr wstr wstr long long) MSVCRT__invalid_parameter +@ cdecl -arch=win32 ?_is_exception_typeof@@YAHABVtype_info@@PAU_EXCEPTION_POINTERS@@@Z(ptr ptr) _is_exception_typeof +@ cdecl -arch=win64 ?_is_exception_typeof@@YAHAEBVtype_info@@PEAU_EXCEPTION_POINTERS@@@Z(ptr ptr) _is_exception_typeof @ cdecl -arch=arm ?_name_internal_method@type_info@@QBAPBDPAU__type_info_node@@@Z(ptr ptr) type_info_name_internal_method @ thiscall -arch=i386 ?_name_internal_method@type_info@@QBEPBDPAU__type_info_node@@@Z(ptr ptr) type_info_name_internal_method @ cdecl -arch=win64 ?_name_internal_method@type_info@@QEBAPEBDPEAU__type_info_node@@@Z(ptr ptr) type_info_name_internal_method -@ varargs -arch=win32 ?_open@@YAHPBDHH@Z(str long) msvcrt._open -@ varargs -arch=win64 ?_open@@YAHPEBDHH@Z(str long) msvcrt._open -@ 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 +@ varargs -arch=win32 ?_open@@YAHPBDHH@Z(str long) MSVCRT__open +@ varargs -arch=win64 ?_open@@YAHPEBDHH@Z(str long) MSVCRT__open +@ cdecl -arch=win32 ?_query_new_handler@@YAP6AHI@ZXZ() MSVCRT__query_new_handler +@ cdecl -arch=win64 ?_query_new_handler@@YAP6AH_K@ZXZ() MSVCRT__query_new_handler +@ cdecl ?_query_new_mode@@YAHXZ() MSVCRT__query_new_mode @ stub -arch=win32 ?_set_new_handler@@YAP6AHI@ZH@Z # int (__cdecl*__cdecl _set_new_handler(int))(unsigned int) @ stub -arch=win64 ?_set_new_handler@@YAP6AH_K@ZH@Z # int (__cdecl*__cdecl _set_new_handler(int))(unsigned __int64) -@ cdecl -arch=win32 ?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z(ptr) msvcrt.?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z -@ cdecl -arch=win64 ?_set_new_handler@@YAP6AH_K@ZP6AH0@Z@Z(ptr) msvcrt.?_set_new_handler@@YAP6AH_K@ZP6AH0@Z@Z -@ cdecl ?_set_new_mode@@YAHH@Z(long) msvcrt.?_set_new_mode@@YAHH@Z +@ cdecl -arch=win32 ?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z(ptr) MSVCRT__set_new_handler +@ cdecl -arch=win64 ?_set_new_handler@@YAP6AH_K@ZP6AH0@Z@Z(ptr) MSVCRT__set_new_handler +@ cdecl ?_set_new_mode@@YAHH@Z(long) MSVCRT__set_new_mode @ stub -arch=win32 ?_set_se_translator@@YAP6AXIPAU_EXCEPTION_POINTERS@@@ZH@Z # void (__cdecl*__cdecl _set_se_translator(int))(unsigned int,struct _EXCEPTION_POINTERS *) @ stub -arch=win64 ?_set_se_translator@@YAP6AXIPEAU_EXCEPTION_POINTERS@@@ZH@Z # void (__cdecl*__cdecl _set_se_translator(int))(unsigned int,struct _EXCEPTION_POINTERS * __ptr64) -@ cdecl -arch=win32 ?_set_se_translator@@YAP6AXIPAU_EXCEPTION_POINTERS@@@ZP6AXI0@Z@Z(ptr) msvcrt.?_set_se_translator@@YAP6AXIPAU_EXCEPTION_POINTERS@@@ZP6AXI0@Z@Z -@ cdecl -arch=win64 ?_set_se_translator@@YAP6AXIPEAU_EXCEPTION_POINTERS@@@ZP6AXI0@Z@Z(ptr) msvcrt.?_set_se_translator@@YAP6AXIPEAU_EXCEPTION_POINTERS@@@ZP6AXI0@Z@Z -@ cdecl -arch=win32 ?_sopen@@YAHPBDHHH@Z(str long long long) msvcrt._sopen -@ cdecl -arch=win64 ?_sopen@@YAHPEBDHHH@Z(str long long long) msvcrt._sopen +@ cdecl -arch=win32 ?_set_se_translator@@YAP6AXIPAU_EXCEPTION_POINTERS@@@ZP6AXI0@Z@Z(ptr) MSVCRT__set_se_translator +@ cdecl -arch=win64 ?_set_se_translator@@YAP6AXIPEAU_EXCEPTION_POINTERS@@@ZP6AXI0@Z@Z(ptr) MSVCRT__set_se_translator +@ cdecl -arch=win32 ?_sopen@@YAHPBDHHH@Z(str long long long) MSVCRT__sopen +@ cdecl -arch=win64 ?_sopen@@YAHPEBDHHH@Z(str long long long) MSVCRT__sopen @ stub -arch=win32 ?_type_info_dtor_internal_method@type_info@@QAEXXZ # public: void __thiscall type_info::_type_info_dtor_internal_method(void) @ stub -arch=win64 ?_type_info_dtor_internal_method@type_info@@QEAAXXZ # public: void __cdecl type_info::_type_info_dtor_internal_method(void) __ptr64 -@ cdecl -arch=win32 ?_wopen@@YAHPB_WHH@Z(wstr long long) msvcrt._wopen -@ cdecl -arch=win64 ?_wopen@@YAHPEB_WHH@Z(wstr long long) msvcrt._wopen -@ cdecl -arch=win32 ?_wsopen@@YAHPB_WHHH@Z(wstr long long long) msvcrt._wsopen -@ cdecl -arch=win64 ?_wsopen@@YAHPEB_WHHH@Z(wstr long long long) msvcrt._wsopen -@ thiscall -arch=i386 ?before@type_info@@QBEHABV1@@Z(ptr ptr) msvcrt.?before@type_info@@QBEHABV1@@Z -@ cdecl -arch=win64 ?before@type_info@@QEBAHAEBV1@@Z(ptr ptr) msvcrt.?before@type_info@@QEBAHAEBV1@@Z +@ cdecl -arch=win32 ?_wopen@@YAHPB_WHH@Z(wstr long long) MSVCRT__wopen +@ cdecl -arch=win64 ?_wopen@@YAHPEB_WHH@Z(wstr long long) MSVCRT__wopen +@ cdecl -arch=win32 ?_wsopen@@YAHPB_WHHH@Z(wstr long long long) MSVCRT__wsopen +@ cdecl -arch=win64 ?_wsopen@@YAHPEB_WHHH@Z(wstr long long long) MSVCRT__wsopen +@ thiscall -arch=i386 ?before@type_info@@QBEHABV1@@Z(ptr ptr) MSVCRT_type_info_before +@ cdecl -arch=win64 ?before@type_info@@QEBAHAEBV1@@Z(ptr ptr) MSVCRT_type_info_before @ stub -arch=win32 ?get_error_code@scheduler_resource_allocation_error@Concurrency@@QBEJXZ @ stub -arch=win64 ?get_error_code@scheduler_resource_allocation_error@Concurrency@@QEBAJXZ @ stub -arch=win32 ?lock@critical_section@Concurrency@@QAEXXZ @@ -465,561 +465,561 @@ @ stub -arch=win64 ?lock@reader_writer_lock@Concurrency@@QEAAXXZ @ stub -arch=win32 ?lock_read@reader_writer_lock@Concurrency@@QAEXXZ @ stub -arch=win64 ?lock_read@reader_writer_lock@Concurrency@@QEAAXXZ -@ stub -arch=win32 ?name@type_info@@QBEPBDPAU__type_info_node@@@Z # public: char const * __thiscall type_info::name(struct __type_info_node *)const -@ stub -arch=win64 ?name@type_info@@QEBAPEBDPEAU__type_info_node@@@Z # public: char const * __ptr64 __cdecl type_info::name(struct __type_info_node * __ptr64)const __ptr64 +@ thiscall -arch=win32 ?name@type_info@@QBEPBDPAU__type_info_node@@@Z(ptr ptr) type_info_name_internal_method +@ cdecl -arch=win64 ?name@type_info@@QEBAPEBDPEAU__type_info_node@@@Z(ptr ptr) type_info_name_internal_method @ stub -arch=win32 ?native_handle@critical_section@Concurrency@@QAEAAV12@XZ @ stub -arch=win64 ?native_handle@critical_section@Concurrency@@QEAAAEAV12@XZ -@ cdecl -arch=arm ?raw_name@type_info@@QBAPBDXZ(ptr) msvcrt.?raw_name@type_info@@QBAPBDXZ -@ thiscall -arch=i386 ?raw_name@type_info@@QBEPBDXZ(ptr) msvcrt.?raw_name@type_info@@QBEPBDXZ -@ cdecl -arch=win64 ?raw_name@type_info@@QEBAPEBDXZ(ptr) msvcrt.?raw_name@type_info@@QEBAPEBDXZ +@ cdecl -arch=arm ?raw_name@type_info@@QBAPBDXZ(ptr) MSVCRT_type_info_raw_name +@ thiscall -arch=i386 ?raw_name@type_info@@QBEPBDXZ(ptr) MSVCRT_type_info_raw_name +@ cdecl -arch=win64 ?raw_name@type_info@@QEBAPEBDXZ(ptr) MSVCRT_type_info_raw_name @ stub -arch=win32 ?reset@event@Concurrency@@QAEXXZ @ stub -arch=win64 ?reset@event@Concurrency@@QEAAXXZ @ stub -arch=win32 ?set@event@Concurrency@@QAEXXZ @ stub -arch=win64 ?set@event@Concurrency@@QEAAXXZ -@ cdecl ?set_new_handler@@YAP6AXXZP6AXXZ@Z(ptr) msvcrt.?set_new_handler@@YAP6AXXZP6AXXZ@Z +@ cdecl ?set_new_handler@@YAP6AXXZP6AXXZ@Z(ptr) MSVCRT_set_new_handler @ stub ?set_terminate@@YAP6AXXZH@Z -@ cdecl ?set_terminate@@YAP6AXXZP6AXXZ@Z(ptr) msvcrt.?set_terminate@@YAP6AXXZP6AXXZ@Z +@ cdecl ?set_terminate@@YAP6AXXZP6AXXZ@Z(ptr) MSVCRT_set_terminate @ stub ?set_unexpected@@YAP6AXXZH@Z -@ cdecl ?set_unexpected@@YAP6AXXZP6AXXZ@Z(ptr) msvcrt.?set_unexpected@@YAP6AXXZP6AXXZ@Z -@ varargs ?swprintf@@YAHPAGIPBGZZ(ptr long wstr) msvcrt._snwprintf -@ varargs ?swprintf@@YAHPA_WIPB_WZZ(ptr long wstr) msvcrt._snwprintf -@ cdecl ?terminate@@YAXXZ() msvcrt.?terminate@@YAXXZ +@ cdecl ?set_unexpected@@YAP6AXXZP6AXXZ@Z(ptr) MSVCRT_set_unexpected +@ varargs ?swprintf@@YAHPAGIPBGZZ(ptr long wstr) MSVCRT__snwprintf +@ varargs ?swprintf@@YAHPA_WIPB_WZZ(ptr long wstr) MSVCRT__snwprintf +@ cdecl ?terminate@@YAXXZ() MSVCRT_terminate @ stub -arch=win32 ?try_lock@critical_section@Concurrency@@QAE_NXZ @ stub -arch=win64 ?try_lock@critical_section@Concurrency@@QEAA_NXZ @ stub -arch=win32 ?try_lock@reader_writer_lock@Concurrency@@QAE_NXZ @ stub -arch=win64 ?try_lock@reader_writer_lock@Concurrency@@QEAA_NXZ @ stub -arch=win32 ?try_lock_read@reader_writer_lock@Concurrency@@QAE_NXZ @ stub -arch=win64 ?try_lock_read@reader_writer_lock@Concurrency@@QEAA_NXZ -@ cdecl ?unexpected@@YAXXZ() msvcrt.?unexpected@@YAXXZ +@ cdecl ?unexpected@@YAXXZ() MSVCRT_unexpected @ stub -arch=win32 ?unlock@critical_section@Concurrency@@QAEXXZ @ stub -arch=win64 ?unlock@critical_section@Concurrency@@QEAAXXZ @ stub -arch=win32 ?unlock@reader_writer_lock@Concurrency@@QAEXXZ @ stub -arch=win64 ?unlock@reader_writer_lock@Concurrency@@QEAAXXZ -@ cdecl ?vswprintf@@YAHPA_WIPB_WPAD@Z(ptr long wstr ptr) msvcrt._vsnwprintf +@ cdecl ?vswprintf@@YAHPA_WIPB_WPAD@Z(ptr long wstr ptr) MSVCRT_vsnwprintf @ stub ?wait@Concurrency@@YAXI@Z @ stub -arch=win32 ?wait@event@Concurrency@@QAEII@Z @ stub -arch=win64 ?wait@event@Concurrency@@QEAA_KI@Z @ stub -arch=win32 ?wait_for_multiple@event@Concurrency@@SAIPAPAV12@I_NI@Z @ stub -arch=win64 ?wait_for_multiple@event@Concurrency@@SA_KPEAPEAV12@_K_NI@Z -@ thiscall -arch=i386 ?what@exception@std@@UBEPBDXZ(ptr) msvcrt.?what@exception@@UBEPBDXZ -@ cdecl -arch=win64 ?what@exception@std@@UEBAPEBDXZ(ptr) msvcrt.?what@exception@@UEBAPEBDXZ -@ cdecl -norelay $I10_OUTPUT(double long long long ptr) msvcrt.$I10_OUTPUT -@ cdecl -arch=i386 _CIacos() msvcrt._CIacos -@ cdecl -arch=i386 _CIasin() msvcrt._CIasin -@ cdecl -arch=i386 _CIatan() msvcrt._CIatan -@ cdecl -arch=i386 _CIatan2() msvcrt._CIatan2 -@ cdecl -arch=i386 _CIcos() msvcrt._CIcos -@ cdecl -arch=i386 _CIcosh() msvcrt._CIcosh -@ cdecl -arch=i386 _CIexp() msvcrt._CIexp -@ cdecl -arch=i386 _CIfmod() msvcrt._CIfmod -@ cdecl -arch=i386 _CIlog() msvcrt._CIlog -@ cdecl -arch=i386 _CIlog10() msvcrt._CIlog10 -@ cdecl -arch=i386 _CIpow() msvcrt._CIpow -@ cdecl -arch=i386 _CIsin() msvcrt._CIsin -@ cdecl -arch=i386 _CIsinh() msvcrt._CIsinh -@ cdecl -arch=i386 _CIsqrt() msvcrt._CIsqrt -@ cdecl -arch=i386 _CItan() msvcrt._CItan -@ cdecl -arch=i386 _CItanh() msvcrt._CItanh +@ thiscall -arch=i386 ?what@exception@std@@UBEPBDXZ(ptr) MSVCRT_what_exception +@ cdecl -arch=win64 ?what@exception@std@@UEBAPEBDXZ(ptr) MSVCRT_what_exception +@ cdecl -norelay $I10_OUTPUT(double long long long ptr) MSVCRT_I10_OUTPUT +@ 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() @ cdecl _CRT_RTC_INIT(ptr ptr long long long) @ cdecl _CRT_RTC_INITW(ptr ptr long long long) @ stub _CreateFrameInfo -@ stdcall _CxxThrowException(long long) msvcrt._CxxThrowException -@ cdecl -arch=i386 -norelay _EH_prolog() msvcrt._EH_prolog +@ stdcall _CxxThrowException(long long) +@ cdecl -arch=i386 -norelay _EH_prolog() @ stub _FindAndUnlinkFrame -@ cdecl _Getdays() msvcrt._Getdays -@ cdecl _Getmonths() msvcrt._Getmonths -@ cdecl _Gettnames() msvcrt._Gettnames -@ extern _HUGE msvcrt._HUGE +@ cdecl _Getdays() +@ cdecl _Getmonths() +@ cdecl _Gettnames() +@ extern _HUGE MSVCRT__HUGE @ stub _IsExceptionObjectToBeDestroyed @ stub _NLG_Dispatch2 @ stub _NLG_Return @ stub _NLG_Return2 @ stub -arch=win64 _SetImageBase @ stub -arch=win64 _SetThrowImageBase -@ cdecl _Strftime(str long str ptr ptr) msvcrt._Strftime -@ cdecl _XcptFilter(long ptr) msvcrt._XcptFilter +@ cdecl _Strftime(str long str ptr ptr) +@ cdecl _XcptFilter(long ptr) @ stub __AdjustPointer @ stub __BuildCatchObject @ stub __BuildCatchObjectHelper -@ stdcall -arch=x86_64 __C_specific_handler(ptr long ptr ptr) msvcrt.__C_specific_handler -@ cdecl -arch=i386,x86_64,arm __CppXcptFilter(long ptr) msvcrt.__CppXcptFilter +@ stdcall -arch=x86_64 __C_specific_handler(ptr long ptr ptr) ntdll.__C_specific_handler +@ cdecl -arch=i386,x86_64,arm __CppXcptFilter(long ptr) @ stub __CxxCallUnwindDelDtor @ stub __CxxCallUnwindDtor @ stub __CxxCallUnwindStdDelDtor @ stub __CxxCallUnwindVecDtor -@ cdecl -arch=i386,x86_64,arm __CxxDetectRethrow(ptr) msvcrt.__CxxDetectRethrow +@ cdecl -arch=i386,x86_64,arm __CxxDetectRethrow(ptr) @ stub __CxxExceptionFilter -@ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler(ptr ptr ptr ptr) msvcrt.__CxxFrameHandler -@ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler2(ptr ptr ptr ptr) msvcrt.__CxxFrameHandler2 -@ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler3(ptr ptr ptr ptr) msvcrt.__CxxFrameHandler3 -@ stdcall -arch=i386 __CxxLongjmpUnwind(ptr) msvcrt.__CxxLongjmpUnwind -@ cdecl -arch=i386,x86_64,arm __CxxQueryExceptionSize() msvcrt.__CxxQueryExceptionSize +@ 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 -@ cdecl __RTCastToVoid(ptr) msvcrt.__RTCastToVoid -@ cdecl __RTDynamicCast(ptr long ptr ptr long) msvcrt.__RTDynamicCast -@ cdecl __RTtypeid(ptr) msvcrt.__RTtypeid -@ cdecl __STRINGTOLD(ptr ptr str long) msvcrt.__STRINGTOLD +@ cdecl __RTCastToVoid(ptr) MSVCRT___RTCastToVoid +@ cdecl __RTDynamicCast(ptr long ptr ptr long) MSVCRT___RTDynamicCast +@ cdecl __RTtypeid(ptr) MSVCRT___RTtypeid +@ cdecl __STRINGTOLD(ptr ptr str long) @ stub __STRINGTOLD_L @ stub __TypeMatch -@ cdecl ___lc_codepage_func() msvcrt.___lc_codepage_func -@ cdecl ___lc_collate_cp_func() msvcrt.___lc_collate_cp_func -@ cdecl ___lc_handle_func() msvcrt.___lc_handle_func -@ cdecl ___mb_cur_max_func() msvcrt.___mb_cur_max_func -@ cdecl ___mb_cur_max_l_func(ptr) msvcrt.___mb_cur_max_l_func -@ cdecl ___setlc_active_func() msvcrt.___setlc_active_func -@ cdecl ___unguarded_readlc_active_add_func() msvcrt.___unguarded_readlc_active_add_func -@ extern __argc msvcrt.__argc -@ extern __argv msvcrt.__argv +@ cdecl ___lc_codepage_func() +@ cdecl ___lc_collate_cp_func() +@ cdecl ___lc_handle_func() +@ cdecl ___mb_cur_max_func() MSVCRT____mb_cur_max_func +@ cdecl ___mb_cur_max_l_func(ptr) +@ cdecl ___setlc_active_func() MSVCRT____setlc_active_func +@ cdecl ___unguarded_readlc_active_add_func() MSVCRT____unguarded_readlc_active_add_func +@ extern __argc MSVCRT___argc +@ extern __argv MSVCRT___argv ### extern __badioinfo #don't forward to msvcrt.__badioinfo, it has different size @ cdecl __clean_type_info_names_internal(ptr) -@ cdecl -arch=i386 __control87_2(long long ptr ptr) msvcrt.__control87_2 +@ cdecl -arch=i386 __control87_2(long long ptr ptr) @ stub __create_locale -@ cdecl __crtCompareStringA(long long str long str long) msvcrt.__crtCompareStringA -@ cdecl __crtCompareStringW(long long wstr long wstr long) msvcrt.__crtCompareStringW -@ cdecl __crtLCMapStringA(long long str long ptr long long long) msvcrt.__crtLCMapStringA -@ cdecl __crtLCMapStringW(long long wstr long ptr long long long) msvcrt.__crtLCMapStringW -@ cdecl __daylight() msvcrt.__daylight -@ cdecl __dllonexit(ptr ptr ptr) msvcrt.__dllonexit -@ cdecl __doserrno() msvcrt.__doserrno +@ cdecl __crtCompareStringA(long long str long str long) +@ cdecl __crtCompareStringW(long long wstr long wstr long) +@ cdecl __crtLCMapStringA(long long str long ptr long long long) +@ cdecl __crtLCMapStringW(long long wstr long ptr long long long) +@ cdecl __daylight() MSVCRT___p__daylight +@ cdecl __dllonexit(ptr ptr ptr) +@ cdecl __doserrno() MSVCRT___doserrno @ stub __dstbias @ stub ___fls_getvalue@4 @ stub ___fls_setvalue@8 -@ cdecl __fpecode() msvcrt.__fpecode +@ cdecl __fpecode() @ stub __free_locale @ stub __get_current_locale @ stub __get_flsindex @ stub __get_tlsindex -@ cdecl __getmainargs(ptr ptr ptr long ptr) msvcrt.__getmainargs -@ extern __initenv msvcrt.__initenv -@ cdecl __iob_func() msvcrt.__iob_func -@ cdecl __isascii(long) msvcrt.__isascii -@ cdecl __iscsym(long) msvcrt.__iscsym -@ cdecl __iscsymf(long) msvcrt.__iscsymf +@ cdecl __getmainargs(ptr ptr ptr long ptr) +@ extern __initenv MSVCRT___initenv +@ cdecl __iob_func() MSVCRT___iob_func +@ cdecl __isascii(long) MSVCRT___isascii +@ cdecl __iscsym(long) MSVCRT___iscsym +@ cdecl __iscsymf(long) MSVCRT___iscsymf @ stub __iswcsym @ stub __iswcsymf # extern __lconv -@ cdecl __lconv_init() msvcrt.__lconv_init -@ cdecl -arch=i386 __libm_sse2_acos() msvcrt.__libm_sse2_acos -@ cdecl -arch=i386 __libm_sse2_acosf() msvcrt.__libm_sse2_acosf -@ cdecl -arch=i386 __libm_sse2_asin() msvcrt.__libm_sse2_asin -@ cdecl -arch=i386 __libm_sse2_asinf() msvcrt.__libm_sse2_asinf -@ cdecl -arch=i386 __libm_sse2_atan() msvcrt.__libm_sse2_atan -@ cdecl -arch=i386 __libm_sse2_atan2() msvcrt.__libm_sse2_atan2 -@ cdecl -arch=i386 __libm_sse2_atanf() msvcrt.__libm_sse2_atanf -@ cdecl -arch=i386 __libm_sse2_cos() msvcrt.__libm_sse2_cos -@ cdecl -arch=i386 __libm_sse2_cosf() msvcrt.__libm_sse2_cosf -@ cdecl -arch=i386 __libm_sse2_exp() msvcrt.__libm_sse2_exp -@ cdecl -arch=i386 __libm_sse2_expf() msvcrt.__libm_sse2_expf -@ cdecl -arch=i386 __libm_sse2_log() msvcrt.__libm_sse2_log -@ cdecl -arch=i386 __libm_sse2_log10() msvcrt.__libm_sse2_log10 -@ cdecl -arch=i386 __libm_sse2_log10f() msvcrt.__libm_sse2_log10f -@ cdecl -arch=i386 __libm_sse2_logf() msvcrt.__libm_sse2_logf -@ cdecl -arch=i386 __libm_sse2_pow() msvcrt.__libm_sse2_pow -@ cdecl -arch=i386 __libm_sse2_powf() msvcrt.__libm_sse2_powf -@ cdecl -arch=i386 __libm_sse2_sin() msvcrt.__libm_sse2_sin -@ cdecl -arch=i386 __libm_sse2_sinf() msvcrt.__libm_sse2_sinf -@ cdecl -arch=i386 __libm_sse2_tan() msvcrt.__libm_sse2_tan -@ cdecl -arch=i386 __libm_sse2_tanf() msvcrt.__libm_sse2_tanf -@ extern __mb_cur_max msvcrt.__mb_cur_max -@ cdecl __p___argc() msvcrt.__p___argc -@ cdecl __p___argv() msvcrt.__p___argv -@ cdecl __p___initenv() msvcrt.__p___initenv -@ cdecl __p___mb_cur_max() msvcrt.__p___mb_cur_max -@ cdecl __p___wargv() msvcrt.__p___wargv -@ cdecl __p___winitenv() msvcrt.__p___winitenv -@ cdecl __p__acmdln() msvcrt.__p__acmdln -@ cdecl __p__commode() msvcrt.__p__commode -@ cdecl __p__daylight() msvcrt.__p__daylight -@ cdecl __p__dstbias() msvcrt.__p__dstbias -@ cdecl __p__environ() msvcrt.__p__environ -@ cdecl __p__fmode() msvcrt.__p__fmode -@ cdecl __p__iob() msvcrt.__p__iob -@ cdecl __p__mbcasemap() msvcrt.__p__mbcasemap -@ cdecl __p__mbctype() msvcrt.__p__mbctype -@ cdecl __p__pctype() msvcrt.__p__pctype -@ cdecl __p__pgmptr() msvcrt.__p__pgmptr -@ cdecl __p__pwctype() msvcrt.__p__pwctype -@ cdecl __p__timezone() msvcrt.__p__timezone -@ cdecl __p__tzname() msvcrt.__p__tzname -@ cdecl __p__wcmdln() msvcrt.__p__wcmdln -@ cdecl __p__wenviron() msvcrt.__p__wenviron -@ cdecl __p__wpgmptr() msvcrt.__p__wpgmptr -@ cdecl __pctype_func() msvcrt.__pctype_func +@ cdecl __lconv_init() +@ 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() +@ extern __mb_cur_max MSVCRT___mb_cur_max +@ cdecl __p___argc() MSVCRT___p___argc +@ cdecl __p___argv() MSVCRT___p___argv +@ cdecl __p___initenv() +@ cdecl __p___mb_cur_max() +@ cdecl __p___wargv() MSVCRT___p___wargv +@ cdecl __p___winitenv() +@ cdecl __p__acmdln() +@ cdecl __p__commode() +@ cdecl __p__daylight() MSVCRT___p__daylight +@ cdecl __p__dstbias() +@ cdecl __p__environ() MSVCRT___p__environ +@ cdecl __p__fmode() +@ cdecl __p__iob() MSVCRT___iob_func +@ stub __p__mbcasemap() +@ cdecl __p__mbctype() +@ cdecl __p__pctype() MSVCRT___p__pctype +@ cdecl __p__pgmptr() MSVCRT___p__pgmptr +@ stub __p__pwctype() +@ cdecl __p__timezone() MSVCRT___p__timezone +@ cdecl __p__tzname() +@ cdecl __p__wcmdln() +@ cdecl __p__wenviron() MSVCRT___p__wenviron +@ cdecl __p__wpgmptr() MSVCRT___p__wpgmptr +@ cdecl __pctype_func() MSVCRT___pctype_func #FIXME: add correct __pioinfo implementation -@ extern __pioinfo msvcrt.__pioinfo +@ extern __pioinfo MSVCRT___pioinfo @ stub __pwctype_func -@ cdecl __pxcptinfoptrs() msvcrt.__pxcptinfoptrs +@ cdecl __pxcptinfoptrs() MSVCRT___pxcptinfoptrs @ stub __report_gsfailure -@ cdecl __set_app_type(long) msvcrt.__set_app_type +@ cdecl __set_app_type(long) MSVCRT___set_app_type @ stub __set_flsgetvalue -@ extern __setlc_active msvcrt.__setlc_active -@ cdecl __setusermatherr(ptr) msvcrt.__setusermatherr +@ extern __setlc_active MSVCRT___setlc_active +@ cdecl __setusermatherr(ptr) MSVCRT___setusermatherr @ stub __strncnt @ stub __swprintf_l @ cdecl __sys_errlist() @ cdecl __sys_nerr() -@ cdecl __threadhandle() msvcrt.__threadhandle -@ cdecl __threadid() msvcrt.__threadid -@ cdecl __timezone() msvcrt.__p__timezone -@ cdecl __toascii(long) msvcrt.__toascii -@ cdecl __tzname() msvcrt.__p__tzname -@ cdecl __unDName(ptr str long ptr ptr long) msvcrt.__unDName -@ cdecl __unDNameEx(ptr str long ptr ptr ptr long) msvcrt.__unDNameEx +@ 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) @ stub __unDNameHelper -@ extern __unguarded_readlc_active msvcrt.__unguarded_readlc_active -@ cdecl __vswprintf_l(ptr wstr ptr ptr) msvcrt._vswprintf_l -@ extern __wargv msvcrt.__wargv -@ cdecl __wcserror(wstr) msvcrt.__wcserror -@ cdecl __wcserror_s(ptr long wstr) msvcrt.__wcserror_s +@ extern __unguarded_readlc_active MSVCRT___unguarded_readlc_active +@ cdecl __vswprintf_l(ptr wstr ptr ptr) MSVCRT_vswprintf_l +@ extern __wargv MSVCRT___wargv +@ cdecl __wcserror(wstr) MSVCRT___wcserror +@ cdecl __wcserror_s(ptr long wstr) MSVCRT___wcserror_s @ stub __wcsncnt -@ cdecl __wgetmainargs(ptr ptr ptr long ptr) msvcrt.__wgetmainargs -@ extern __winitenv msvcrt.__winitenv -@ cdecl _abnormal_termination() msvcrt._abnormal_termination -@ cdecl -ret64 _abs64(int64) msvcrt._abs64 -@ cdecl _access(str long) msvcrt._access -@ cdecl _access_s(str long) msvcrt._access_s -@ extern _acmdln msvcrt._acmdln -@ cdecl _aligned_free(ptr) msvcrt._aligned_free -@ cdecl _aligned_malloc(long long) msvcrt._aligned_malloc +@ cdecl __wgetmainargs(ptr ptr ptr long ptr) +@ extern __winitenv MSVCRT___winitenv +@ cdecl _abnormal_termination() +@ cdecl -ret64 _abs64(int64) +@ cdecl _access(str long) MSVCRT__access +@ cdecl _access_s(str long) MSVCRT__access_s +@ extern _acmdln MSVCRT__acmdln +@ cdecl _aligned_free(ptr) +@ cdecl _aligned_malloc(long long) @ cdecl _aligned_msize(ptr long long) -@ cdecl _aligned_offset_malloc(long long long) msvcrt._aligned_offset_malloc -@ cdecl _aligned_offset_realloc(ptr long long long) msvcrt._aligned_offset_realloc +@ 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) msvcrt._aligned_realloc +@ cdecl _aligned_realloc(ptr long long) @ stub _aligned_recalloc -@ cdecl _amsg_exit(long) msvcrt._amsg_exit -@ 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) -@ cdecl _atoflt_l(ptr str ptr) msvcrt._atoflt_l -@ cdecl -ret64 _atoi64(str) msvcrt._atoi64 +@ cdecl _amsg_exit(long) +@ 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 +@ cdecl _atoi_l(str ptr) MSVCRT__atoi_l @ stub _atol_l -@ cdecl _atoldbl(ptr str) msvcrt._atoldbl +@ cdecl _atoldbl(ptr str) MSVCRT__atoldbl @ stub _atoldbl_l -@ cdecl _beep(long long) msvcrt._beep -@ cdecl _beginthread(ptr long ptr) msvcrt._beginthread -@ cdecl _beginthreadex(ptr long ptr ptr long ptr) msvcrt._beginthreadex +@ 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) +@ 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) msvcrt._callnewh -@ cdecl _calloc_crt(long long) msvcrt.calloc -@ cdecl _cexit() msvcrt._cexit -@ cdecl _cgets(ptr) msvcrt._cgets +@ cdecl _c_exit() MSVCRT__c_exit +@ cdecl _cabs(long) MSVCRT__cabs +@ cdecl _callnewh(long) +@ cdecl _calloc_crt(long long) MSVCRT_calloc +@ 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 -arch=arm,x86_64 _chgsignf(float) msvcrt._chgsignf -@ cdecl -arch=i386 -norelay _chkesp() msvcrt._chkesp -@ cdecl _chmod(str long) msvcrt._chmod -@ cdecl _chsize(long long) msvcrt._chsize -@ cdecl _chsize_s(long int64) msvcrt._chsize_s -@ cdecl _clearfp() msvcrt._clearfp -@ cdecl _close(long) msvcrt._close -@ cdecl _commit(long) msvcrt._commit -@ extern _commode msvcrt._commode -@ cdecl _configthreadlocale(long) msvcrt._configthreadlocale -@ cdecl _control87(long long) msvcrt._control87 -@ cdecl _controlfp(long long) msvcrt._controlfp -@ cdecl _controlfp_s(ptr long long) msvcrt._controlfp_s -@ cdecl _copysign(double double) msvcrt._copysign -@ cdecl -arch=arm,x86_64 _copysignf(float float) msvcrt._copysignf -@ varargs _cprintf(str) msvcrt._cprintf +@ cdecl _chdir(str) MSVCRT__chdir +@ cdecl _chdrive(long) MSVCRT__chdrive +@ cdecl _chgsign(double) MSVCRT__chgsign +@ cdecl -arch=arm,x86_64 _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 +@ extern _commode MSVCRT__commode +@ cdecl _configthreadlocale(long) +@ cdecl _control87(long long) +@ cdecl _controlfp(long long) +@ cdecl _controlfp_s(ptr long long) +@ cdecl _copysign(double double) MSVCRT__copysign +@ cdecl -arch=arm,x86_64 _copysignf(float float) MSVCRT__copysignf +@ varargs _cprintf(str) @ stub _cprintf_l @ stub _cprintf_p @ stub _cprintf_p_l @ stub _cprintf_s @ stub _cprintf_s_l -@ cdecl _cputs(str) msvcrt._cputs -@ cdecl _cputws(wstr) msvcrt._cputws -@ cdecl _creat(str long) msvcrt._creat -@ cdecl _create_locale(long str) msvcrt._create_locale +@ cdecl _cputs(str) +@ cdecl _cputws(wstr) +@ cdecl _creat(str long) MSVCRT__creat +@ cdecl _create_locale(long str) MSVCRT__create_locale @ stub _crt_debugger_hook -@ varargs _cscanf(str) msvcrt._cscanf -@ varargs _cscanf_l(str ptr) msvcrt._cscanf_l -@ varargs _cscanf_s(str) msvcrt._cscanf_s -@ varargs _cscanf_s_l(str ptr) msvcrt._cscanf_s_l -@ 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) msvcrt._cwait -@ varargs _cwprintf(wstr) msvcrt._cwprintf +@ varargs _cscanf(str) +@ varargs _cscanf_l(str ptr) +@ varargs _cscanf_s(str) +@ varargs _cscanf_s_l(str ptr) +@ 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) +@ varargs _cwprintf(wstr) @ stub _cwprintf_l @ stub _cwprintf_p @ stub _cwprintf_p_l @ stub _cwprintf_s @ stub _cwprintf_s_l -@ varargs _cwscanf(wstr) msvcrt._cwscanf -@ varargs _cwscanf_l(wstr ptr) msvcrt._cwscanf_l -@ varargs _cwscanf_s(wstr) msvcrt._cwscanf_s -@ varargs _cwscanf_s_l(wstr ptr) msvcrt._cwscanf_s_l -@ extern _daylight msvcrt._daylight -@ cdecl _difftime32(long long) msvcrt._difftime32 -@ cdecl _difftime64(long long) msvcrt._difftime64 +@ varargs _cwscanf(wstr) +@ varargs _cwscanf_l(wstr ptr) +@ varargs _cwscanf_s(wstr) +@ varargs _cwscanf_s_l(wstr ptr) +@ extern _daylight MSVCRT___daylight +@ cdecl _difftime32(long long) MSVCRT__difftime32 +@ cdecl _difftime64(long long) MSVCRT__difftime64 @ stub _dosmaperr -@ extern _dstbias msvcrt._dstbias -@ cdecl _dup(long) msvcrt._dup -@ cdecl _dup2(long long) msvcrt._dup2 -@ cdecl _dupenv_s(ptr ptr str) msvcrt._dupenv_s -@ cdecl _ecvt(double long ptr ptr) msvcrt._ecvt -@ cdecl _ecvt_s(str long double long ptr ptr) msvcrt._ecvt_s +@ extern _dstbias MSVCRT__dstbias +@ 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 _encoded_null() -@ cdecl _endthread() msvcrt._endthread -@ cdecl _endthreadex(long) msvcrt._endthreadex -@ extern _environ msvcrt._environ -@ cdecl _eof(long) msvcrt._eof -@ cdecl _errno() msvcrt._errno -@ cdecl -arch=i386 _except_handler2(ptr ptr ptr ptr) msvcrt._except_handler2 -@ cdecl -arch=i386 _except_handler3(ptr ptr ptr ptr) msvcrt._except_handler3 -@ cdecl -arch=i386 _except_handler4_common(ptr ptr ptr ptr ptr ptr) msvcrt._except_handler4_common -@ varargs _execl(str str) msvcrt._execl -@ varargs _execle(str str) msvcrt._execle -@ varargs _execlp(str str) msvcrt._execlp -@ varargs _execlpe(str str) msvcrt._execlpe -@ cdecl _execv(str ptr) msvcrt._execv -@ cdecl _execve(str ptr ptr) msvcrt._execve -@ cdecl _execvp(str ptr) msvcrt._execvp -@ cdecl _execvpe(str ptr ptr) msvcrt._execvpe -@ cdecl _exit(long) msvcrt._exit -@ cdecl _expand(ptr long) msvcrt._expand +@ cdecl _endthread() +@ cdecl _endthreadex(long) +@ extern _environ MSVCRT__environ +@ cdecl _eof(long) MSVCRT__eof +@ cdecl _errno() MSVCRT__errno +@ 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) +@ 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) @ stub _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 -@ cdecl _fdopen(long str) msvcrt._fdopen +@ cdecl _fcloseall() MSVCRT__fcloseall +@ cdecl _fcvt(double long ptr ptr) MSVCRT__fcvt +@ cdecl _fcvt_s(ptr long double long ptr ptr) MSVCRT__fcvt_s +@ cdecl _fdopen(long str) MSVCRT__fdopen @ stub _fflush_nolock -@ cdecl _fgetchar() msvcrt._fgetchar +@ cdecl _fgetchar() MSVCRT__fgetchar @ stub _fgetwc_nolock -@ cdecl _fgetwchar() msvcrt._fgetwchar -@ cdecl _filbuf(ptr) msvcrt._filbuf -@ 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 +@ cdecl _fgetwchar() MSVCRT__fgetwchar +@ cdecl _filbuf(ptr) MSVCRT__filbuf +@ 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 +@ 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 _flsbuf(long ptr) msvcrt._flsbuf -@ cdecl _flushall() msvcrt._flushall -@ extern _fmode msvcrt._fmode -@ cdecl _fpclass(double) msvcrt._fpclass +@ 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 _flsbuf(long ptr) MSVCRT__flsbuf +@ cdecl _flushall() MSVCRT__flushall +@ extern _fmode MSVCRT__fmode +@ cdecl _fpclass(double) MSVCRT__fpclass # stub -arch=x86_64 _fpclassf -@ cdecl _fpieee_flt(long ptr ptr) msvcrt._fpieee_flt -@ cdecl _fpreset() msvcrt._fpreset +@ stub _fpieee_flt(long ptr ptr) +@ cdecl _fpreset() @ stub _fprintf_l @ stub _fprintf_p @ stub _fprintf_p_l @ stub _fprintf_s_l -@ cdecl _fputchar(long) msvcrt._fputchar +@ cdecl _fputchar(long) MSVCRT__fputchar @ stub _fputwc_nolock -@ cdecl _fputwchar(long) msvcrt._fputwchar +@ cdecl _fputwchar(long) MSVCRT__fputwchar @ stub _fread_nolock @ stub _fread_nolock_s -@ cdecl _free_locale(ptr) msvcrt._free_locale +@ cdecl _free_locale(ptr) MSVCRT__free_locale @ stub _freea @ stub _freea_s @ stub _freefls -@ varargs _fscanf_l(ptr str ptr) msvcrt._fscanf_l -@ varargs _fscanf_s_l(ptr str ptr) msvcrt._fscanf_s_l +@ varargs _fscanf_l(ptr str ptr) MSVCRT__fscanf_l +@ varargs _fscanf_s_l(ptr str ptr) MSVCRT__fscanf_s_l @ stub _fseek_nolock -@ cdecl _fseeki64(ptr int64 long) msvcrt._fseeki64 +@ cdecl _fseeki64(ptr int64 long) MSVCRT__fseeki64 @ stub _fseeki64_nolock -@ cdecl _fsopen(str str long) msvcrt._fsopen -@ cdecl _fstat32(long ptr) msvcrt._fstat32 +@ 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 _fstat64(long ptr) MSVCRT__fstat64 +@ cdecl _fstat64i32(long ptr) MSVCRT__fstat64i32 @ stub _ftell_nolock -@ cdecl -ret64 _ftelli64(ptr) msvcrt._ftelli64 +@ cdecl -ret64 _ftelli64(ptr) MSVCRT__ftelli64 @ stub _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) msvcrt._futime32 -@ cdecl _futime64(long ptr) msvcrt._futime64 -@ varargs _fwprintf_l(ptr wstr ptr) msvcrt._fwprintf_l +@ 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) +@ varargs _fwprintf_l(ptr wstr ptr) MSVCRT__fwprintf_l @ stub _fwprintf_p @ stub _fwprintf_p_l @ stub _fwprintf_s_l @ stub _fwrite_nolock -@ varargs _fwscanf_l(ptr wstr ptr) msvcrt._fwscanf_l -@ varargs _fwscanf_s_l(ptr wstr ptr) msvcrt._fwscanf_s_l -@ cdecl _gcvt(double long str) msvcrt._gcvt -@ cdecl _gcvt_s(ptr long double long) msvcrt._gcvt_s -@ cdecl _get_current_locale() msvcrt._get_current_locale +@ varargs _fwscanf_l(ptr wstr ptr) MSVCRT__fwscanf_l +@ varargs _fwscanf_s_l(ptr wstr ptr) MSVCRT__fwscanf_s_l +@ cdecl _gcvt(double long str) MSVCRT__gcvt +@ cdecl _gcvt_s(ptr long double long) MSVCRT__gcvt_s +@ cdecl _get_current_locale() MSVCRT__get_current_locale @ cdecl _get_daylight(ptr) -@ cdecl _get_doserrno(ptr) msvcrt._get_doserrno +@ cdecl _get_doserrno(ptr) @ stub _get_dstbias -@ cdecl _get_errno(ptr) msvcrt._get_errno -@ cdecl _get_fmode(ptr) msvcrt._get_fmode -@ cdecl _get_heap_handle() msvcrt._get_heap_handle -@ cdecl _get_invalid_parameter_handler() msvcrt._get_invalid_parameter_handler -@ cdecl _get_osfhandle(long) msvcrt._get_osfhandle -@ cdecl _get_output_format() msvcrt._get_output_format -@ cdecl _get_pgmptr(ptr) msvcrt._get_pgmptr -@ cdecl _get_printf_count_output() msvcrt._get_printf_count_output +@ cdecl _get_errno(ptr) +@ cdecl _get_fmode(ptr) MSVCRT__get_fmode +@ cdecl _get_heap_handle() +@ cdecl _get_invalid_parameter_handler() +@ cdecl _get_osfhandle(long) MSVCRT__get_osfhandle +@ cdecl _get_output_format() MSVCRT__get_output_format +@ cdecl _get_pgmptr(ptr) +@ cdecl _get_printf_count_output() MSVCRT__get_printf_count_output @ stub _get_purecall_handler -@ cdecl _get_terminate() msvcrt._get_terminate +@ cdecl _get_terminate() MSVCRT__get_terminate @ cdecl _get_timezone(ptr) -@ cdecl _get_tzname(ptr str long long) msvcrt._get_tzname -@ cdecl _get_unexpected() msvcrt._get_unexpected -@ cdecl _get_wpgmptr(ptr) msvcrt._get_wpgmptr +@ cdecl _get_tzname(ptr str long long) MSVCRT__get_tzname +@ cdecl _get_unexpected() MSVCRT__get_unexpected +@ cdecl _get_wpgmptr(ptr) @ stub _getc_nolock -@ cdecl _getch() msvcrt._getch +@ cdecl _getch() @ stub _getch_nolock -@ cdecl _getche() msvcrt._getche +@ cdecl _getche() @ stub _getche_nolock -@ cdecl _getcwd(str long) msvcrt._getcwd -@ cdecl _getdcwd(long str long) msvcrt._getdcwd +@ cdecl _getcwd(str long) MSVCRT__getcwd +@ cdecl _getdcwd(long str long) MSVCRT__getdcwd @ stub _getdcwd_nolock -@ cdecl _getdiskfree(long ptr) msvcrt._getdiskfree -@ cdecl _getdllprocaddr(long str long) msvcrt._getdllprocaddr -@ cdecl _getdrive() msvcrt._getdrive -@ cdecl _getdrives() msvcrt._getdrives -@ cdecl _getmaxstdio() msvcrt._getmaxstdio -@ cdecl _getmbcp() msvcrt._getmbcp -@ cdecl _getpid() msvcrt._getpid -@ cdecl _getptd() msvcrt._getptd -@ cdecl _getsystime(ptr) msvcrt._getsystime -@ cdecl _getw(ptr) msvcrt._getw +@ 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 +@ cdecl _getptd() +@ stub _getsystime(ptr) +@ cdecl _getw(ptr) MSVCRT__getw @ stub _getwch @ stub _getwch_nolock @ stub _getwche @ stub _getwche_nolock -@ cdecl _getws(ptr) msvcrt._getws +@ cdecl _getws(ptr) MSVCRT__getws @ stub _getws_s -@ cdecl -arch=i386 _global_unwind2(ptr) msvcrt._global_unwind2 -@ 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 _heapadd(ptr long) msvcrt._heapadd -@ cdecl _heapchk() msvcrt._heapchk -@ cdecl _heapmin() msvcrt._heapmin -@ cdecl _heapset(long) msvcrt._heapset -@ cdecl _heapused(ptr ptr) msvcrt._heapused -@ cdecl _heapwalk(ptr) msvcrt._heapwalk -@ cdecl _hypot(double double) msvcrt._hypot -@ cdecl _hypotf(float float) msvcrt._hypotf -@ cdecl _i64toa(int64 ptr long) msvcrt._i64toa -@ cdecl _i64toa_s(int64 ptr long long) msvcrt._i64toa_s -@ cdecl _i64tow(int64 ptr long) msvcrt._i64tow -@ cdecl _i64tow_s(int64 ptr long long) msvcrt._i64tow_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 _heapadd(ptr long) +@ cdecl _heapchk() +@ cdecl _heapmin() +@ cdecl _heapset(long) +@ stub _heapused(ptr ptr) +@ 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 @ stub _initptd -@ cdecl _initterm(ptr ptr) msvcrt._initterm -@ cdecl _initterm_e(ptr ptr) msvcrt._initterm_e -@ cdecl -arch=i386 _inp(long) msvcrt._inp -@ cdecl -arch=i386 _inpd(long) msvcrt._inpd -@ cdecl -arch=i386 _inpw(long) msvcrt._inpw -@ cdecl _invalid_parameter(wstr wstr wstr long long) msvcrt._invalid_parameter +@ cdecl _initterm(ptr ptr) +@ cdecl _initterm_e(ptr ptr) +@ stub -arch=i386 _inp(long) +@ stub -arch=i386 _inpd(long) +@ stub -arch=i386 _inpw(long) +@ cdecl _invalid_parameter(wstr wstr wstr long long) MSVCRT__invalid_parameter @ cdecl _invalid_parameter_noinfo() @ stub _invalid_parameter_noinfo_noreturn @ stub _invoke_watson -@ extern _iob msvcrt._iob -@ cdecl _isalnum_l(long ptr) msvcrt._isalnum_l -@ cdecl _isalpha_l(long ptr) msvcrt._isalpha_l -@ cdecl _isatty(long) msvcrt._isatty -@ 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 -@ cdecl _ismbbalnum(long) msvcrt._ismbbalnum +@ extern _iob MSVCRT__iob +@ cdecl _isalnum_l(long ptr) MSVCRT__isalnum_l +@ cdecl _isalpha_l(long ptr) MSVCRT__isalpha_l +@ cdecl _isatty(long) MSVCRT__isatty +@ 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 -@ cdecl _ismbbalpha(long) msvcrt._ismbbalpha +@ stub _ismbbalpha(long) @ stub _ismbbalpha_l -@ cdecl _ismbbgraph(long) msvcrt._ismbbgraph +@ stub _ismbbgraph(long) @ stub _ismbbgraph_l -@ cdecl _ismbbkalnum(long) msvcrt._ismbbkalnum +@ stub _ismbbkalnum(long) @ stub _ismbbkalnum_l -@ cdecl _ismbbkana(long) msvcrt._ismbbkana +@ cdecl _ismbbkana(long) @ stub _ismbbkana_l -@ cdecl _ismbbkprint(long) msvcrt._ismbbkprint +@ stub _ismbbkprint(long) @ stub _ismbbkprint_l -@ cdecl _ismbbkpunct(long) msvcrt._ismbbkpunct +@ stub _ismbbkpunct(long) @ stub _ismbbkpunct_l -@ cdecl _ismbblead(long) msvcrt._ismbblead +@ cdecl _ismbblead(long) @ stub _ismbblead_l -@ cdecl _ismbbprint(long) msvcrt._ismbbprint +@ stub _ismbbprint(long) @ stub _ismbbprint_l -@ cdecl _ismbbpunct(long) msvcrt._ismbbpunct +@ stub _ismbbpunct(long) @ stub _ismbbpunct_l -@ cdecl _ismbbtrail(long) msvcrt._ismbbtrail +@ cdecl _ismbbtrail(long) @ stub _ismbbtrail_l -@ cdecl _ismbcalnum(long) msvcrt._ismbcalnum +@ cdecl _ismbcalnum(long) @ stub _ismbcalnum_l -@ cdecl _ismbcalpha(long) msvcrt._ismbcalpha +@ cdecl _ismbcalpha(long) @ stub _ismbcalpha_l -@ cdecl _ismbcdigit(long) msvcrt._ismbcdigit +@ cdecl _ismbcdigit(long) @ stub _ismbcdigit_l -@ cdecl _ismbcgraph(long) msvcrt._ismbcgraph +@ cdecl _ismbcgraph(long) @ stub _ismbcgraph_l -@ cdecl _ismbchira(long) msvcrt._ismbchira +@ cdecl _ismbchira(long) @ stub _ismbchira_l -@ cdecl _ismbckata(long) msvcrt._ismbckata +@ cdecl _ismbckata(long) @ stub _ismbckata_l -@ cdecl _ismbcl0(long) msvcrt._ismbcl0 +@ stub _ismbcl0(long) @ stub _ismbcl0_l -@ cdecl _ismbcl1(long) msvcrt._ismbcl1 +@ stub _ismbcl1(long) @ stub _ismbcl1_l -@ cdecl _ismbcl2(long) msvcrt._ismbcl2 +@ stub _ismbcl2(long) @ stub _ismbcl2_l -@ cdecl _ismbclegal(long) msvcrt._ismbclegal +@ cdecl _ismbclegal(long) @ stub _ismbclegal_l -@ cdecl _ismbclower(long) msvcrt._ismbclower +@ cdecl _ismbclower(long) @ stub _ismbclower_l -@ cdecl _ismbcprint(long) msvcrt._ismbcprint +@ cdecl _ismbcprint(long) @ stub _ismbcprint_l -@ cdecl _ismbcpunct(long) msvcrt._ismbcpunct +@ cdecl _ismbcpunct(long) @ stub _ismbcpunct_l -@ cdecl _ismbcspace(long) msvcrt._ismbcspace +@ cdecl _ismbcspace(long) @ stub _ismbcspace_l -@ cdecl _ismbcsymbol(long) msvcrt._ismbcsymbol +@ cdecl _ismbcsymbol(long) @ stub _ismbcsymbol_l -@ cdecl _ismbcupper(long) msvcrt._ismbcupper +@ cdecl _ismbcupper(long) @ stub _ismbcupper_l -@ cdecl _ismbslead(ptr ptr) msvcrt._ismbslead +@ cdecl _ismbslead(ptr ptr) @ stub _ismbslead_l -@ cdecl _ismbstrail(ptr ptr) msvcrt._ismbstrail +@ 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 +@ 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 +@ 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 +@ cdecl _iswalpha_l(long ptr) MSVCRT__iswalpha_l @ stub _iswcntrl_l @ stub _iswcsym_l @ stub _iswcsymf_l @ stub _iswctype_l -@ cdecl _iswdigit_l(long ptr) msvcrt._iswdigit_l +@ cdecl _iswdigit_l(long ptr) MSVCRT__iswdigit_l @ stub _iswgraph_l @ stub _iswlower_l @ stub _iswprint_l @@ -1027,402 +1027,402 @@ @ stub _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) msvcrt._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() msvcrt._kbhit -@ cdecl _lfind(ptr ptr ptr long ptr) msvcrt._lfind +@ 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() +@ cdecl _lfind(ptr ptr ptr long ptr) @ stub _lfind_s -@ cdecl _loaddll(str) msvcrt._loaddll -@ cdecl -arch=x86_64 _local_unwind(ptr ptr) msvcrt._local_unwind -@ cdecl -arch=i386 _local_unwind2(ptr long) msvcrt._local_unwind2 -@ cdecl -arch=i386 _local_unwind4(ptr ptr long) msvcrt._local_unwind4 -@ cdecl _localtime32(ptr) msvcrt._localtime32 -@ cdecl _localtime32_s(ptr ptr) msvcrt._localtime32_s -@ cdecl _localtime64(ptr) msvcrt._localtime64 -@ cdecl _localtime64_s(ptr ptr) msvcrt._localtime64_s -@ cdecl _lock(long) msvcrt._lock -@ cdecl _lock_file(ptr) msvcrt._lock_file -@ 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._longjmpex -@ cdecl _lrotl(long long) msvcrt._lrotl -@ cdecl _lrotr(long long) msvcrt._lrotr -@ cdecl _lsearch(ptr ptr ptr long ptr) msvcrt._lsearch +@ 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(long) +@ cdecl _lock_file(ptr) MSVCRT__lock_file +@ 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) msvcrt._ltoa -@ cdecl _ltoa_s(long ptr long long) msvcrt._ltoa_s -@ cdecl _ltow(long ptr long) msvcrt._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 -@ cdecl _malloc_crt(long) msvcrt.malloc -@ cdecl _mbbtombc(long) msvcrt._mbbtombc +@ 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 +@ cdecl _malloc_crt(long) MSVCRT_malloc +@ cdecl _mbbtombc(long) @ stub _mbbtombc_l -@ cdecl _mbbtype(long long) msvcrt._mbbtype +@ cdecl _mbbtype(long long) @ stub _mbbtype_l # extern _mbcasemap -@ cdecl _mbccpy(ptr str) msvcrt._mbccpy +@ cdecl _mbccpy(ptr str) @ stub _mbccpy_l @ stub _mbccpy_s @ stub _mbccpy_s_l -@ cdecl _mbcjistojms(long) msvcrt._mbcjistojms +@ cdecl _mbcjistojms(long) @ stub _mbcjistojms_l -@ cdecl _mbcjmstojis(long) msvcrt._mbcjmstojis +@ cdecl _mbcjmstojis(long) @ stub _mbcjmstojis_l -@ cdecl _mbclen(ptr) msvcrt._mbclen +@ cdecl _mbclen(ptr) @ stub _mbclen_l -@ cdecl _mbctohira(long) msvcrt._mbctohira +@ stub _mbctohira(long) @ stub _mbctohira_l -@ cdecl _mbctokata(long) msvcrt._mbctokata +@ stub _mbctokata(long) @ stub _mbctokata_l -@ cdecl _mbctolower(long) msvcrt._mbctolower +@ cdecl _mbctolower(long) @ stub _mbctolower_l -@ cdecl _mbctombb(long) msvcrt._mbctombb +@ cdecl _mbctombb(long) @ stub _mbctombb_l -@ cdecl _mbctoupper(long) msvcrt._mbctoupper +@ cdecl _mbctoupper(long) @ stub _mbctoupper_l -@ extern _mbctype msvcrt._mbctype +@ extern _mbctype MSVCRT_mbctype @ stub _mblen_l -@ cdecl _mbsbtype(str long) msvcrt._mbsbtype +@ cdecl _mbsbtype(str long) @ stub _mbsbtype_l @ stub _mbscat_s @ stub _mbscat_s_l -@ cdecl _mbschr(str long) msvcrt._mbschr +@ cdecl _mbschr(str long) @ stub _mbschr_l -@ cdecl _mbscmp(str str) msvcrt._mbscmp +@ cdecl _mbscmp(str str) @ stub _mbscmp_l -@ cdecl _mbscoll(str str) msvcrt._mbscoll -@ cdecl _mbscoll_l(str str ptr) msvcrt._mbscoll_l +@ cdecl _mbscoll(str str) +@ cdecl _mbscoll_l(str str ptr) @ stub _mbscpy_s @ stub _mbscpy_s_l -@ cdecl _mbscspn(str str) msvcrt._mbscspn +@ cdecl _mbscspn(str str) @ stub _mbscspn_l -@ cdecl _mbsdec(ptr ptr) msvcrt._mbsdec +@ cdecl _mbsdec(ptr ptr) @ stub _mbsdec_l -@ cdecl _mbsicmp(str str) msvcrt._mbsicmp +@ cdecl _mbsicmp(str str) @ stub _mbsicmp_l -@ cdecl _mbsicoll(str str) msvcrt._mbsicoll -@ cdecl _mbsicoll_l(str str ptr) msvcrt._mbsicoll_l -@ cdecl _mbsinc(str) msvcrt._mbsinc +@ cdecl _mbsicoll(str str) +@ cdecl _mbsicoll_l(str str ptr) +@ cdecl _mbsinc(str) @ stub _mbsinc_l -@ cdecl _mbslen(str) msvcrt._mbslen +@ cdecl _mbslen(str) @ stub _mbslen_l -@ cdecl _mbslwr(str) msvcrt._mbslwr +@ cdecl _mbslwr(str) @ stub _mbslwr_l -@ cdecl _mbslwr_s(str long) msvcrt._mbslwr_s +@ cdecl _mbslwr_s(str long) @ stub _mbslwr_s_l -@ cdecl _mbsnbcat(str str long) msvcrt._mbsnbcat +@ cdecl _mbsnbcat(str str long) @ stub _mbsnbcat_l -@ cdecl _mbsnbcat_s(str long ptr long) msvcrt._mbsnbcat_s +@ cdecl _mbsnbcat_s(str long ptr long) @ stub _mbsnbcat_s_l -@ cdecl _mbsnbcmp(str str long) msvcrt._mbsnbcmp +@ cdecl _mbsnbcmp(str str long) @ stub _mbsnbcmp_l -@ cdecl _mbsnbcnt(ptr long) msvcrt._mbsnbcnt +@ cdecl _mbsnbcnt(ptr long) @ stub _mbsnbcnt_l -@ cdecl _mbsnbcoll(str str long) msvcrt._mbsnbcoll -@ cdecl _mbsnbcoll_l(str str long ptr) msvcrt._mbsnbcoll_l -@ cdecl _mbsnbcpy(ptr str long) msvcrt._mbsnbcpy +@ 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) msvcrt._mbsnbcpy_s +@ cdecl _mbsnbcpy_s(ptr long str long) @ stub _mbsnbcpy_s_l -@ cdecl _mbsnbicmp(str str long) msvcrt._mbsnbicmp +@ cdecl _mbsnbicmp(str str long) @ stub _mbsnbicmp_l -@ cdecl _mbsnbicoll(str str long) msvcrt._mbsnbicoll -@ cdecl _mbsnbicoll_l(str str long ptr) msvcrt._mbsnbicoll_l -@ cdecl _mbsnbset(ptr long long) msvcrt._mbsnbset +@ 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) msvcrt._mbsncat +@ cdecl _mbsncat(str str long) @ stub _mbsncat_l @ stub _mbsncat_s @ stub _mbsncat_s_l -@ cdecl _mbsnccnt(str long) msvcrt._mbsnccnt +@ cdecl _mbsnccnt(str long) @ stub _mbsnccnt_l -@ cdecl _mbsncmp(str str long) msvcrt._mbsncmp +@ cdecl _mbsncmp(str str long) @ stub _mbsncmp_l -@ cdecl _mbsncoll(str str long) msvcrt._mbsncoll +@ stub _mbsncoll(str str long) @ stub _mbsncoll_l -@ cdecl _mbsncpy(ptr str long) msvcrt._mbsncpy +@ cdecl _mbsncpy(ptr str long) @ stub _mbsncpy_l @ stub _mbsncpy_s @ stub _mbsncpy_s_l -@ cdecl _mbsnextc(str) msvcrt._mbsnextc +@ cdecl _mbsnextc(str) @ stub _mbsnextc_l -@ cdecl _mbsnicmp(str str long) msvcrt._mbsnicmp +@ cdecl _mbsnicmp(str str long) @ stub _mbsnicmp_l -@ cdecl _mbsnicoll(str str long) msvcrt._mbsnicoll +@ stub _mbsnicoll(str str long) @ stub _mbsnicoll_l -@ cdecl _mbsninc(str long) msvcrt._mbsninc +@ cdecl _mbsninc(str long) @ stub _mbsninc_l @ stub _mbsnlen @ stub _mbsnlen_l -@ cdecl _mbsnset(ptr long long) msvcrt._mbsnset +@ cdecl _mbsnset(ptr long long) @ stub _mbsnset_l @ stub _mbsnset_s @ stub _mbsnset_s_l -@ cdecl _mbspbrk(str str) msvcrt._mbspbrk +@ cdecl _mbspbrk(str str) @ stub _mbspbrk_l -@ cdecl _mbsrchr(str long) msvcrt._mbsrchr +@ cdecl _mbsrchr(str long) @ stub _mbsrchr_l -@ cdecl _mbsrev(str) msvcrt._mbsrev +@ cdecl _mbsrev(str) @ stub _mbsrev_l -@ cdecl _mbsset(ptr long) msvcrt._mbsset +@ cdecl _mbsset(ptr long) @ stub _mbsset_l @ stub _mbsset_s @ stub _mbsset_s_l -@ cdecl _mbsspn(str str) msvcrt._mbsspn +@ cdecl _mbsspn(str str) @ stub _mbsspn_l -@ cdecl _mbsspnp(str str) msvcrt._mbsspnp +@ cdecl _mbsspnp(str str) @ stub _mbsspnp_l -@ cdecl _mbsstr(str str) msvcrt._mbsstr +@ cdecl _mbsstr(str str) @ stub _mbsstr_l -@ cdecl _mbstok(str str) MSVCR100__mbstok -@ cdecl _mbstok_l(str str ptr) msvcrt._mbstok_l -@ cdecl _mbstok_s(str str ptr) msvcrt._mbstok_s -@ cdecl _mbstok_s_l(str str ptr ptr) msvcrt._mbstok_s_l -@ 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) msvcrt._mbstrlen -@ cdecl _mbstrlen_l(str ptr) msvcrt._mbstrlen_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) msvcrt._mbsupr +@ cdecl _mbsupr(str) @ stub _mbsupr_l -@ cdecl _mbsupr_s(str long) msvcrt._mbsupr_s +@ 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) msvcrt._memccpy -@ cdecl _memicmp(str str long) msvcrt._memicmp +@ 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) msvcrt._msize -@ cdecl _nextafter(double double) msvcrt._nextafter -@ cdecl -arch=arm,x86_64 _nextafterf(float float) msvcrt._nextafterf -@ cdecl _onexit(ptr) msvcrt._onexit -@ varargs _open(str long) msvcrt._open -@ cdecl _open_osfhandle(long long) msvcrt._open_osfhandle -@ cdecl -arch=i386 _outp(long long) msvcrt._outp -@ cdecl -arch=i386 _outpd(long long) msvcrt._outpd -@ cdecl -arch=i386 _outpw(long long) msvcrt._outpw -@ cdecl _pclose(ptr) msvcrt._pclose -@ extern _pctype msvcrt._pctype -@ extern _pgmptr msvcrt._pgmptr -@ cdecl _pipe(ptr long long) msvcrt._pipe -@ cdecl _popen(str str) msvcrt._popen +@ 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 +@ cdecl _onexit(ptr) MSVCRT__onexit +@ varargs _open(str long) MSVCRT__open +@ cdecl _open_osfhandle(long long) MSVCRT__open_osfhandle +@ stub -arch=i386 _outp(long long) +@ stub -arch=i386 _outpd(long long) +@ stub -arch=i386 _outpw(long long) +@ cdecl _pclose(ptr) MSVCRT__pclose +@ extern _pctype MSVCRT__pctype +@ extern _pgmptr MSVCRT__pgmptr +@ cdecl _pipe(ptr long long) MSVCRT__pipe +@ cdecl _popen(str str) MSVCRT__popen @ stub _printf_l @ stub _printf_p @ stub _printf_p_l @ stub _printf_s_l -@ cdecl _purecall() msvcrt._purecall -@ cdecl _putch(long) msvcrt._putch +@ cdecl _purecall() +@ cdecl _putch(long) @ stub _putch_nolock -@ cdecl _putenv(str) msvcrt._putenv -@ cdecl _putenv_s(str str) msvcrt._putenv_s -@ cdecl _putw(long ptr) msvcrt._putw -@ cdecl _putwch(long) msvcrt._putwch +@ cdecl _putenv(str) +@ cdecl _putenv_s(str str) +@ cdecl _putw(long ptr) MSVCRT__putw +@ cdecl _putwch(long) MSVCRT__putwch @ stub _putwch_nolock -@ cdecl _putws(wstr) msvcrt._putws +@ cdecl _putws(wstr) MSVCRT__putws # extern _pwctype -@ cdecl _read(long ptr long) msvcrt._read -@ cdecl _realloc_crt(ptr long) msvcrt.realloc +@ cdecl _read(long ptr long) MSVCRT__read +@ cdecl _realloc_crt(ptr long) MSVCRT_realloc @ cdecl _recalloc(ptr long long) @ stub _recalloc_crt -@ cdecl _resetstkoflw() msvcrt._resetstkoflw -@ cdecl _rmdir(str) msvcrt._rmdir -@ cdecl _rmtmp() msvcrt._rmtmp -@ cdecl _rotl(long long) msvcrt._rotl -@ cdecl -ret64 _rotl64(int64 long) msvcrt._rotl64 -@ cdecl _rotr(long long) msvcrt._rotr -@ cdecl -ret64 _rotr64(int64 long) msvcrt._rotr64 -@ cdecl _scalb(double long) msvcrt._scalb -@ cdecl -arch=arm,x86_64 _scalbf(float long) msvcrt._scalbf -@ varargs _scanf_l(str ptr) msvcrt._scanf_l -@ varargs _scanf_s_l(str ptr) msvcrt._scanf_s_l -@ varargs _scprintf(str) msvcrt._scprintf +@ 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 +@ varargs _scanf_l(str ptr) MSVCRT__scanf_l +@ varargs _scanf_s_l(str ptr) MSVCRT__scanf_s_l +@ varargs _scprintf(str) MSVCRT__scprintf @ stub _scprintf_l @ stub _scprintf_p @ stub _scprintf_p_l -@ varargs _scwprintf(wstr) msvcrt._scwprintf +@ varargs _scwprintf(wstr) MSVCRT__scwprintf @ stub _scwprintf_l @ stub _scwprintf_p @ stub _scwprintf_p_l -@ cdecl _searchenv(str str ptr) msvcrt._searchenv -@ cdecl _searchenv_s(str str ptr long) msvcrt._searchenv_s -@ stdcall -arch=i386 _seh_longjmp_unwind4(ptr) msvcrt._seh_longjmp_unwind4 -@ stdcall -arch=i386 _seh_longjmp_unwind(ptr) msvcrt._seh_longjmp_unwind -@ cdecl _set_SSE2_enable(long) msvcrt._set_SSE2_enable -@ cdecl _set_abort_behavior(long long) msvcrt._set_abort_behavior -@ cdecl _set_controlfp(long long) msvcrt._set_controlfp -@ cdecl _set_doserrno(long) msvcrt._set_doserrno -@ cdecl _set_errno(long) msvcrt._set_errno -@ cdecl _set_error_mode(long) msvcrt._set_error_mode -@ cdecl _set_fmode(long) msvcrt._set_fmode -@ cdecl _set_invalid_parameter_handler(ptr) msvcrt._set_invalid_parameter_handler +@ cdecl _searchenv(str str ptr) MSVCRT__searchenv +@ cdecl _searchenv_s(str str ptr long) MSVCRT__searchenv_s +@ stdcall -arch=i386 _seh_longjmp_unwind4(ptr) +@ stdcall -arch=i386 _seh_longjmp_unwind(ptr) +@ cdecl _set_SSE2_enable(long) MSVCRT__set_SSE2_enable +@ cdecl _set_abort_behavior(long long) MSVCRT__set_abort_behavior +@ 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) @ stub _set_malloc_crt_max_wait -@ cdecl _set_output_format(long) msvcrt._set_output_format -@ cdecl _set_printf_count_output(long) msvcrt._set_printf_count_output -@ cdecl _set_purecall_handler(ptr) msvcrt._set_purecall_handler -@ cdecl _seterrormode(long) msvcrt._seterrormode -@ cdecl -arch=i386,x86_64,arm -norelay _setjmp(ptr) msvcrt._setjmp -@ cdecl -arch=i386 -norelay _setjmp3(ptr long) msvcrt._setjmp3 -@ cdecl -arch=x86_64,arm -norelay _setjmpex(ptr ptr) msvcrt._setjmpex -@ cdecl _setmaxstdio(long) msvcrt._setmaxstdio -@ cdecl _setmbcp(long) msvcrt._setmbcp -@ cdecl _setmode(long long) msvcrt._setmode -@ cdecl _setsystime(ptr long) msvcrt._setsystime -@ cdecl _sleep(long) msvcrt._sleep -@ varargs _snprintf(ptr long str) msvcrt._snprintf +@ cdecl _set_output_format(long) +@ cdecl _set_printf_count_output(long) MSVCRT__set_printf_count_output +@ cdecl _set_purecall_handler(ptr) +@ cdecl _seterrormode(long) +@ cdecl -arch=i386,x86_64,arm -norelay _setjmp(ptr) MSVCRT__setjmp +@ cdecl -arch=i386 -norelay _setjmp3(ptr long) MSVCRT__setjmp3 +@ cdecl -arch=x86_64,arm -norelay _setjmpex(ptr ptr) MSVCRT__setjmpex +@ cdecl _setmaxstdio(long) MSVCRT__setmaxstdio +@ cdecl _setmbcp(long) +@ cdecl _setmode(long long) MSVCRT__setmode +@ stub _setsystime(ptr long) +@ cdecl _sleep(long) MSVCRT__sleep +@ varargs _snprintf(ptr long str) MSVCRT__snprintf @ stub _snprintf_c @ stub _snprintf_c_l @ stub _snprintf_l -@ varargs _snprintf_s(ptr long long str) msvcrt._snprintf_s +@ varargs _snprintf_s(ptr long long str) MSVCRT__snprintf_s @ stub _snprintf_s_l -@ varargs _snscanf(str long str) msvcrt._snscanf -@ varargs _snscanf_l(str long str ptr) msvcrt._snscanf_l -@ varargs _snscanf_s(str long str) msvcrt._snscanf_s -@ varargs _snscanf_s_l(str long str ptr) msvcrt._snscanf_s_l -@ varargs _snwprintf(ptr long wstr) msvcrt._snwprintf -@ varargs _snwprintf_l(ptr long wstr ptr) msvcrt._snwprintf_l -@ varargs _snwprintf_s(ptr long long wstr) msvcrt._snwprintf_s -@ varargs _snwprintf_s_l(ptr long long wstr ptr) msvcrt._snwprintf_s_l -@ varargs _snwscanf(wstr long wstr) msvcrt._snwscanf -@ varargs _snwscanf_l(wstr long wstr ptr) msvcrt._snwscanf_l -@ varargs _snwscanf_s(wstr long wstr) msvcrt._snwscanf_s -@ varargs _snwscanf_s_l(wstr long wstr ptr) msvcrt._snwscanf_s_l -@ varargs _sopen(str long long) msvcrt._sopen -@ cdecl _sopen_s(ptr str long long long) msvcrt._sopen_s -@ varargs _spawnl(long str str) msvcrt._spawnl -@ varargs _spawnle(long str str) msvcrt._spawnle -@ varargs _spawnlp(long str str) msvcrt._spawnlp -@ varargs _spawnlpe(long str str) msvcrt._spawnlpe -@ cdecl _spawnv(long str ptr) msvcrt._spawnv -@ cdecl _spawnve(long str ptr ptr) msvcrt._spawnve -@ cdecl _spawnvp(long str ptr) msvcrt._spawnvp -@ 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 -@ varargs _sprintf_l(ptr str ptr) msvcrt._sprintf_l -@ varargs _sprintf_p(ptr long str) -@ varargs _sprintf_p_l(ptr long str ptr) msvcrt._sprintf_p_l -@ varargs _sprintf_s_l(ptr long str ptr) msvcrt._sprintf_s_l -@ varargs _sscanf_l(str str ptr) msvcrt._sscanf_l -@ varargs _sscanf_s_l(str str ptr) msvcrt._sscanf_s_l -@ cdecl _stat32(str ptr) -@ cdecl _stat32i64(str ptr) -@ cdecl _stat64(str ptr) msvcrt._stat64 -@ cdecl _stat64i32(str ptr) -@ cdecl _statusfp() msvcrt._statusfp -@ cdecl -arch=i386 _statusfp2(ptr ptr) msvcrt._statusfp2 -@ cdecl _strcoll_l(str str ptr) msvcrt._strcoll_l -@ cdecl _strdate(ptr) msvcrt._strdate -@ cdecl _strdate_s(ptr long) msvcrt._strdate_s -@ cdecl _strdup(str) msvcrt._strdup -@ cdecl _strerror(long) msvcrt._strerror +@ varargs _snscanf(str long str) MSVCRT__snscanf +@ varargs _snscanf_l(str long str ptr) MSVCRT__snscanf_l +@ varargs _snscanf_s(str long str) MSVCRT__snscanf_s +@ varargs _snscanf_s_l(str long str ptr) MSVCRT__snscanf_s_l +@ varargs _snwprintf(ptr long wstr) MSVCRT__snwprintf +@ varargs _snwprintf_l(ptr long wstr ptr) MSVCRT__snwprintf_l +@ varargs _snwprintf_s(ptr long long wstr) MSVCRT__snwprintf_s +@ varargs _snwprintf_s_l(ptr long long wstr ptr) MSVCRT__snwprintf_s_l +@ varargs _snwscanf(wstr long wstr) MSVCRT__snwscanf +@ varargs _snwscanf_l(wstr long wstr ptr) MSVCRT__snwscanf_l +@ varargs _snwscanf_s(wstr long wstr) MSVCRT__snwscanf_s +@ varargs _snwscanf_s_l(wstr long wstr ptr) MSVCRT__snwscanf_s_l +@ varargs _sopen(str long long) MSVCRT__sopen +@ 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 +@ varargs _sprintf_l(ptr str ptr) MSVCRT_sprintf_l +@ varargs _sprintf_p(ptr long str) MSVCRT__sprintf_p +@ varargs _sprintf_p_l(ptr long str ptr) MSVCRT_sprintf_p_l +@ varargs _sprintf_s_l(ptr long str ptr) MSVCRT_sprintf_s_l +@ varargs _sscanf_l(str str ptr) MSVCRT__sscanf_l +@ varargs _sscanf_s_l(str str ptr) MSVCRT__sscanf_s_l +@ 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) msvcrt._strlwr_l -@ 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 _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 @ stub _strnset_s -@ cdecl _strrev(str) msvcrt._strrev -@ cdecl _strset(str long) msvcrt._strset +@ cdecl _strrev(str) MSVCRT__strrev +@ cdecl _strset(str long) @ stub _strset_s -@ cdecl _strtime(ptr) msvcrt._strtime -@ cdecl _strtime_s(ptr long) msvcrt._strtime_s -@ cdecl _strtod_l(str ptr ptr) msvcrt._strtod_l -@ cdecl -ret64 _strtoi64(str ptr long) msvcrt._strtoi64 -@ cdecl -ret64 _strtoi64_l(str ptr long ptr) msvcrt._strtoi64_l +@ cdecl _strtime(ptr) MSVCRT__strtime +@ cdecl _strtime_s(ptr long) +@ cdecl _strtod_l(str ptr ptr) MSVCRT_strtod_l +@ cdecl -ret64 _strtoi64(str ptr long) MSVCRT_strtoi64 +@ cdecl -ret64 _strtoi64_l(str ptr long ptr) MSVCRT_strtoi64_l @ stub _strtol_l -@ cdecl -ret64 _strtoui64(str ptr long) msvcrt._strtoui64 -@ cdecl -ret64 _strtoui64_l(str ptr long ptr) msvcrt._strtoui64_l +@ cdecl -ret64 _strtoui64(str ptr long) MSVCRT_strtoui64 +@ cdecl -ret64 _strtoui64_l(str ptr long ptr) MSVCRT_strtoui64_l @ stub _strtoul_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 _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 @ stub _strxfrm_l -@ cdecl _swab(str str long) msvcrt._swab -@ varargs _swprintf(ptr wstr) msvcrt._swprintf +@ cdecl _swab(str str long) MSVCRT__swab +@ varargs _swprintf(ptr wstr) MSVCRT_swprintf @ stub _swprintf_c @ stub _swprintf_c_l @ stub _swprintf_p -@ varargs _swprintf_p_l(ptr long wstr ptr) msvcrt._swprintf_p_l -@ varargs _swprintf_s_l(ptr long wstr ptr) msvcrt._swprintf_s_l -@ varargs _swscanf_l(wstr wstr ptr) msvcrt._swscanf_l -@ varargs _swscanf_s_l(wstr wstr ptr) msvcrt._swscanf_s_l -@ extern _sys_errlist msvcrt._sys_errlist -@ extern _sys_nerr msvcrt._sys_nerr -@ cdecl _tell(long) msvcrt._tell -@ cdecl -ret64 _telli64(long) msvcrt._telli64 -@ cdecl _tempnam(str str) msvcrt._tempnam -@ cdecl _time32(ptr) msvcrt._time32 -@ cdecl _time64(ptr) msvcrt._time64 -@ extern _timezone msvcrt._timezone -@ 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 -@ extern _tzname msvcrt._tzname -@ cdecl _tzset() msvcrt._tzset -@ cdecl _ui64toa(int64 ptr long) msvcrt._ui64toa -@ cdecl _ui64toa_s(int64 ptr long long) msvcrt._ui64toa_s -@ cdecl _ui64tow(int64 ptr long) msvcrt._ui64tow -@ cdecl _ui64tow_s(int64 ptr long long) msvcrt._ui64tow_s -@ cdecl _ultoa(long ptr long) msvcrt._ultoa -@ cdecl _ultoa_s(long ptr long long) msvcrt._ultoa_s -@ cdecl _ultow(long ptr long) msvcrt._ultow -@ cdecl _ultow_s(long ptr long long) msvcrt._ultow_s -@ cdecl _umask(long) msvcrt._umask +@ varargs _swprintf_p_l(ptr long wstr ptr) MSVCRT_swprintf_p_l +@ varargs _swprintf_s_l(ptr long wstr ptr) MSVCRT__swprintf_s_l +@ varargs _swscanf_l(wstr wstr ptr) MSVCRT__swscanf_l +@ varargs _swscanf_s_l(wstr wstr ptr) MSVCRT__swscanf_s_l +@ extern _sys_errlist MSVCRT__sys_errlist +@ extern _sys_nerr MSVCRT__sys_nerr +@ 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 +@ extern _timezone MSVCRT___timezone +@ 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 +@ extern _tzname MSVCRT__tzname +@ 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 @ stub _ungetc_nolock -@ cdecl _ungetch(long) msvcrt._ungetch +@ cdecl _ungetch(long) @ stub _ungetch_nolock @ stub _ungetwc_nolock @ stub _ungetwch @ stub _ungetwch_nolock -@ cdecl _unlink(str) msvcrt._unlink -@ cdecl _unloaddll(long) msvcrt._unloaddll -@ cdecl _unlock(long) msvcrt._unlock -@ cdecl _unlock_file(ptr) msvcrt._unlock_file -@ cdecl _utime32(str ptr) msvcrt._utime32 -@ cdecl _utime64(str ptr) msvcrt._utime64 -@ cdecl _vcprintf(str ptr) msvcrt._vcprintf +@ cdecl _unlink(str) MSVCRT__unlink +@ cdecl _unloaddll(long) +@ cdecl _unlock(long) +@ cdecl _unlock_file(ptr) MSVCRT__unlock_file +@ cdecl _utime32(str ptr) +@ cdecl _utime64(str ptr) +@ cdecl _vcprintf(str ptr) @ stub _vcprintf_l @ stub _vcprintf_p @ stub _vcprintf_p_l @ stub _vcprintf_s @ stub _vcprintf_s_l -@ cdecl _vcwprintf(wstr ptr) msvcrt._vcwprintf +@ cdecl _vcwprintf(wstr ptr) @ stub _vcwprintf_l @ stub _vcwprintf_p @ stub _vcwprintf_p_l @@ -1432,7 +1432,7 @@ @ stub _vfprintf_p @ stub _vfprintf_p_l @ stub _vfprintf_s_l -@ cdecl _vfwprintf_l(ptr wstr ptr ptr) msvcrt._vfwprintf_l +@ cdecl _vfwprintf_l(ptr wstr ptr ptr) MSVCRT__vfwprintf_l @ stub _vfwprintf_p @ stub _vfwprintf_p_l @ stub _vfwprintf_s_l @@ -1440,451 +1440,451 @@ @ stub _vprintf_p @ stub _vprintf_p_l @ stub _vprintf_s_l -@ cdecl _vscprintf(str ptr) msvcrt._vscprintf +@ cdecl _vscprintf(str ptr) MSVCRT__vscprintf @ stub _vscprintf_l @ stub _vscprintf_p @ stub _vscprintf_p_l -@ cdecl _vscwprintf(wstr ptr) msvcrt._vscwprintf -@ cdecl _vscwprintf_l(wstr ptr ptr) msvcrt._vscwprintf_l -@ cdecl _vscwprintf_p(wstr ptr) -@ cdecl _vscwprintf_p_l(wstr ptr ptr) msvcrt._vscwprintf_p_l -@ cdecl _vsnprintf(ptr long str ptr) msvcrt._vsnprintf -@ cdecl _vsnprintf_c(ptr long str ptr) msvcrt._vsnprintf_c -@ cdecl _vsnprintf_c_l(ptr long str ptr ptr) msvcrt._vsnprintf_c_l -@ cdecl _vsnprintf_l(ptr long str ptr ptr) msvcrt._vsnprintf_l -@ cdecl _vsnprintf_s(ptr long long str ptr) msvcrt._vsnprintf_s -@ cdecl _vsnprintf_s_l(ptr long long str ptr ptr) msvcrt._vsnprintf_s_l -@ cdecl _vsnwprintf(ptr long wstr ptr) msvcrt._vsnwprintf -@ cdecl _vsnwprintf_l(ptr long wstr ptr ptr) msvcrt._vsnwprintf_l -@ cdecl _vsnwprintf_s(ptr long long wstr ptr) msvcrt._vsnwprintf_s -@ cdecl _vsnwprintf_s_l(ptr long long wstr ptr ptr) msvcrt._vsnwprintf_s_l -@ cdecl _vsprintf_l(ptr str ptr ptr) msvcrt._vsprintf_l -@ cdecl _vsprintf_p(ptr long str ptr) msvcrt._vsprintf_p -@ cdecl _vsprintf_p_l(ptr long str ptr ptr) msvcrt._vsprintf_p_l -@ cdecl _vsprintf_s_l(ptr long str ptr ptr) msvcrt._vsprintf_s_l -@ cdecl _vswprintf(ptr wstr ptr) msvcrt._vswprintf -@ cdecl _vswprintf_c(ptr long wstr ptr) msvcrt._vswprintf_c -@ cdecl _vswprintf_c_l(ptr long wstr ptr ptr) msvcrt._vswprintf_c_l -@ cdecl _vswprintf_l(ptr wstr ptr ptr) msvcrt._vswprintf_l -@ cdecl _vswprintf_p(ptr long wstr ptr) -@ cdecl _vswprintf_p_l(ptr long wstr ptr ptr) msvcrt._vswprintf_p_l -@ cdecl _vswprintf_s_l(ptr long wstr ptr ptr) msvcrt._vswprintf_s_l +@ cdecl _vscwprintf(wstr ptr) MSVCRT__vscwprintf +@ cdecl _vscwprintf_l(wstr ptr ptr) MSVCRT__vscwprintf_l +@ cdecl _vscwprintf_p(wstr ptr) MSVCRT__vscwprintf_p +@ cdecl _vscwprintf_p_l(wstr ptr ptr) MSVCRT__vscwprintf_p_l +@ cdecl _vsnprintf(ptr long str ptr) MSVCRT_vsnprintf +@ cdecl _vsnprintf_c(ptr long str ptr) MSVCRT_vsnprintf +@ cdecl _vsnprintf_c_l(ptr long str ptr ptr) MSVCRT_vsnprintf_l +@ cdecl _vsnprintf_l(ptr long str ptr ptr) MSVCRT_vsnprintf_l +@ cdecl _vsnprintf_s(ptr long long str ptr) MSVCRT_vsnprintf_s +@ cdecl _vsnprintf_s_l(ptr long long str ptr ptr) MSVCRT_vsnprintf_s_l +@ cdecl _vsnwprintf(ptr long wstr ptr) MSVCRT_vsnwprintf +@ cdecl _vsnwprintf_l(ptr long wstr ptr ptr) MSVCRT_vsnwprintf_l +@ cdecl _vsnwprintf_s(ptr long long wstr ptr) MSVCRT_vsnwprintf_s +@ cdecl _vsnwprintf_s_l(ptr long long wstr ptr ptr) MSVCRT_vsnwprintf_s_l +@ cdecl _vsprintf_l(ptr str ptr ptr) MSVCRT_vsprintf_l +@ cdecl _vsprintf_p(ptr long str ptr) MSVCRT_vsprintf_p +@ cdecl _vsprintf_p_l(ptr long str ptr ptr) MSVCRT_vsprintf_p_l +@ cdecl _vsprintf_s_l(ptr long str ptr ptr) MSVCRT_vsprintf_s_l +@ cdecl _vswprintf(ptr wstr ptr) MSVCRT_vswprintf +@ cdecl _vswprintf_c(ptr long wstr ptr) MSVCRT_vsnwprintf +@ cdecl _vswprintf_c_l(ptr long wstr ptr ptr) MSVCRT_vsnwprintf_l +@ cdecl _vswprintf_l(ptr wstr ptr ptr) MSVCRT_vswprintf_l +@ cdecl _vswprintf_p(ptr long wstr ptr) MSVCRT__vswprintf_p +@ cdecl _vswprintf_p_l(ptr long wstr ptr ptr) MSVCRT_vswprintf_p_l +@ cdecl _vswprintf_s_l(ptr long wstr ptr ptr) MSVCRT_vswprintf_s_l @ stub _vwprintf_l @ stub _vwprintf_p @ stub _vwprintf_p_l @ stub _vwprintf_s_l -@ 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 -@ extern _wcmdln msvcrt._wcmdln -@ cdecl _wcreat(wstr long) msvcrt._wcreat -@ 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 +@ 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 +@ extern _wcmdln MSVCRT__wcmdln +@ cdecl _wcreat(wstr long) MSVCRT__wcreat +@ 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 _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) ntdll._wcslwr @ stub _wcslwr_l -@ cdecl _wcslwr_s(wstr long) msvcrt._wcslwr_s +@ cdecl _wcslwr_s(wstr long) MSVCRT__wcslwr_s @ stub _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 _wcsncoll(wstr wstr long) MSVCRT__wcsncoll +@ cdecl _wcsncoll_l(wstr wstr long ptr) MSVCRT__wcsncoll_l +@ cdecl _wcsnicmp(wstr wstr long) MSVCRT__wcsnicmp @ stub _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 +@ 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 _wcsrev(wstr) MSVCRT__wcsrev +@ cdecl _wcsset(wstr long) MSVCRT__wcsset @ stub _wcsset_s -@ cdecl _wcstod_l(wstr ptr) msvcrt._wcstod_l -@ cdecl -ret64 _wcstoi64(wstr ptr long) msvcrt._wcstoi64 -@ cdecl -ret64 _wcstoi64_l(wstr ptr long ptr) msvcrt._wcstoi64_l -@ cdecl _wcstol_l(wstr ptr long ptr) msvcrt._wcstol_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 -@ cdecl _wcsupr(wstr) msvcrt._wcsupr -@ stub _wcsupr_l -@ cdecl _wcsupr_s(wstr long) msvcrt._wcsupr_s -@ cdecl _wcsupr_s_l(wstr long ptr) msvcrt._wcsupr_s_l +@ cdecl _wcstod_l(wstr ptr) MSVCRT__wcstod_l +@ cdecl -ret64 _wcstoi64(wstr ptr long) MSVCRT__wcstoi64 +@ cdecl -ret64 _wcstoi64_l(wstr ptr long ptr) MSVCRT__wcstoi64_l +@ cdecl _wcstol_l(wstr ptr long ptr) MSVCRT__wcstol_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 +@ 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 @ stub _wcsxfrm_l -@ cdecl _wctime32(ptr) msvcrt._wctime32 +@ cdecl _wctime32(ptr) MSVCRT__wctime32 @ stub _wctime32_s -@ cdecl _wctime64(ptr) msvcrt._wctime64 +@ 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 +@ cdecl _wctomb_l(ptr long ptr) MSVCRT__wctomb_l +@ cdecl _wctomb_s_l(ptr ptr long long ptr) MSVCRT__wctomb_s_l # extern _wctype -@ cdecl _wdupenv_s(ptr ptr wstr) msvcrt._wdupenv_s -@ extern _wenviron msvcrt._wenviron -@ varargs _wexecl(wstr wstr) msvcrt._wexecl -@ varargs _wexecle(wstr wstr) msvcrt._wexecle -@ varargs _wexeclp(wstr wstr) msvcrt._wexeclp -@ varargs _wexeclpe(wstr wstr) msvcrt._wexeclpe -@ cdecl _wexecv(wstr ptr) msvcrt._wexecv -@ cdecl _wexecve(wstr ptr ptr) msvcrt._wexecve -@ cdecl _wexecvp(wstr ptr) msvcrt._wexecvp -@ cdecl _wexecvpe(wstr ptr ptr) msvcrt._wexecvpe -@ cdecl _wfdopen(long wstr) msvcrt._wfdopen -@ cdecl _wfindfirst32(wstr ptr) msvcrt._wfindfirst32 +@ cdecl _wdupenv_s(ptr ptr wstr) +@ extern _wenviron MSVCRT__wenviron +@ 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 +@ 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 _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 @ stub _wgetdcwd_nolock -@ cdecl _wgetenv(wstr) msvcrt._wgetenv -@ cdecl _wgetenv_s(ptr ptr long wstr) msvcrt._wgetenv_s -@ 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 -@ cdecl _wperror(wstr) msvcrt._wperror -@ extern _wpgmptr msvcrt._wpgmptr -@ cdecl _wpopen(wstr wstr) msvcrt._wpopen +@ 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) +@ extern _wpgmptr MSVCRT__wpgmptr +@ cdecl _wpopen(wstr wstr) MSVCRT__wpopen @ stub _wprintf_l @ stub _wprintf_p @ stub _wprintf_p_l @ stub _wprintf_s_l -@ cdecl _wputenv(wstr) msvcrt._wputenv -@ cdecl _wputenv_s(wstr wstr) msvcrt._wputenv_s -@ cdecl _wremove(wstr) msvcrt._wremove -@ cdecl _wrename(wstr wstr) msvcrt._wrename -@ cdecl _write(long ptr long) msvcrt._write -@ cdecl _wrmdir(wstr) msvcrt._wrmdir -@ varargs _wscanf_l(wstr ptr) msvcrt._wscanf_l -@ varargs _wscanf_s_l(wstr ptr) msvcrt._wscanf_s_l -@ 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 -@ cdecl _wsopen_s(ptr wstr long long long) msvcrt._wsopen_s -@ varargs _wspawnl(long wstr wstr) msvcrt._wspawnl -@ varargs _wspawnle(long wstr wstr) msvcrt._wspawnle -@ varargs _wspawnlp(long wstr wstr) msvcrt._wspawnlp -@ varargs _wspawnlpe(long wstr wstr) msvcrt._wspawnlpe -@ cdecl _wspawnv(long wstr ptr) msvcrt._wspawnv -@ cdecl _wspawnve(long wstr ptr ptr) msvcrt._wspawnve -@ cdecl _wspawnvp(long wstr ptr) msvcrt._wspawnvp -@ 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) -@ cdecl _wstat32i64(wstr ptr) -@ cdecl _wstat64(wstr ptr) msvcrt._wstat64 -@ cdecl _wstat64i32(wstr ptr) -@ cdecl _wstrdate(ptr) msvcrt._wstrdate -@ cdecl _wstrdate_s(ptr long) msvcrt._wstrdate_s -@ cdecl _wstrtime(ptr) msvcrt._wstrtime -@ cdecl _wstrtime_s(ptr long) msvcrt._wstrtime_s -@ cdecl _wsystem(wstr) msvcrt._wsystem -@ cdecl _wtempnam(wstr wstr) msvcrt._wtempnam -@ cdecl _wtmpnam(ptr) msvcrt._wtmpnam +@ 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 +@ varargs _wscanf_l(wstr ptr) MSVCRT__wscanf_l +@ varargs _wscanf_s_l(wstr ptr) MSVCRT__wscanf_s_l +@ 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 +@ 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 -@ cdecl _wunlink(wstr) msvcrt._wunlink -@ cdecl _wutime32(wstr ptr) msvcrt._wutime32 -@ cdecl _wutime64(wstr ptr) msvcrt._wutime64 -@ 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 -@ 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 -@ cdecl atan(double) msvcrt.atan -@ cdecl -arch=arm,x86_64 atanf(float) msvcrt.atanf -@ cdecl atan2(double double) msvcrt.atan2 -@ cdecl -arch=arm,x86_64 atan2f(float float) msvcrt.atan2f -@ cdecl atexit(ptr) msvcrt.atexit -@ cdecl atof(str) msvcrt.atof -@ cdecl atoi(str) MSVCR100_atoi -@ cdecl atol(str) msvcrt.atol -@ 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 -@ cdecl calloc(long long) msvcrt.calloc -@ cdecl ceil(double) msvcrt.ceil -@ cdecl -arch=arm,x86_64 ceilf(float) msvcrt.ceilf -@ cdecl clearerr(ptr) msvcrt.clearerr +@ 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 +@ 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 +@ 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 +@ cdecl atan(double) MSVCRT_atan +@ cdecl -arch=arm,x86_64 atanf(float) MSVCRT_atanf +@ cdecl atan2(double double) MSVCRT_atan2 +@ cdecl -arch=arm,x86_64 atan2f(float float) MSVCRT_atan2f +@ cdecl atexit(ptr) MSVCRT_atexit +@ cdecl atof(str) MSVCRT_atof +@ cdecl atoi(str) MSVCRT_atoi +@ cdecl atol(str) ntdll.atol +@ 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 +@ cdecl calloc(long long) MSVCRT_calloc +@ cdecl ceil(double) MSVCRT_ceil +@ cdecl -arch=arm,x86_64 ceilf(float) MSVCRT_ceilf +@ cdecl clearerr(ptr) MSVCRT_clearerr @ stub clearerr_s -@ cdecl clock() msvcrt.clock -@ 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 -@ cdecl -ret64 div(long long) msvcrt.div -@ cdecl exit(long) msvcrt.exit -@ cdecl exp(double) msvcrt.exp -@ cdecl -arch=arm,x86_64 expf(float) msvcrt.expf -@ cdecl fabs(double) msvcrt.fabs -@ cdecl fclose(ptr) msvcrt.fclose -@ cdecl feof(ptr) msvcrt.feof -@ cdecl ferror(ptr) msvcrt.ferror -@ 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 -@ 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 -@ varargs fprintf(ptr str) msvcrt.fprintf -@ varargs fprintf_s(ptr str) msvcrt.fprintf_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 -@ varargs fscanf(ptr str) msvcrt.fscanf -@ varargs fscanf_s(ptr str) msvcrt.fscanf_s -@ cdecl fseek(ptr long long) msvcrt.fseek -@ cdecl fsetpos(ptr ptr) msvcrt.fsetpos -@ cdecl ftell(ptr) msvcrt.ftell -@ varargs fwprintf(ptr wstr) msvcrt.fwprintf -@ varargs fwprintf_s(ptr wstr) msvcrt.fwprintf_s -@ cdecl fwrite(ptr long long ptr) msvcrt.fwrite -@ varargs fwscanf(ptr wstr) msvcrt.fwscanf -@ varargs fwscanf_s(ptr wstr) msvcrt.fwscanf_s -@ cdecl getc(ptr) msvcrt.getc -@ cdecl getchar() msvcrt.getchar -@ cdecl getenv(str) msvcrt.getenv -@ cdecl getenv_s(ptr ptr long str) msvcrt.getenv_s -@ cdecl gets(str) msvcrt.gets +@ cdecl clock() MSVCRT_clock +@ 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 +@ cdecl -ret64 div(long long) MSVCRT_div +@ cdecl exit(long) MSVCRT_exit +@ cdecl exp(double) MSVCRT_exp +@ cdecl -arch=arm,x86_64 expf(float) MSVCRT_expf +@ cdecl fabs(double) MSVCRT_fabs +@ cdecl fclose(ptr) MSVCRT_fclose +@ cdecl feof(ptr) MSVCRT_feof +@ cdecl ferror(ptr) MSVCRT_ferror +@ 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 +@ 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 +@ varargs fprintf(ptr str) MSVCRT_fprintf +@ varargs fprintf_s(ptr str) MSVCRT_fprintf_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 +@ varargs fscanf(ptr str) MSVCRT_fscanf +@ varargs fscanf_s(ptr str) MSVCRT_fscanf_s +@ cdecl fseek(ptr long long) MSVCRT_fseek +@ cdecl fsetpos(ptr ptr) MSVCRT_fsetpos +@ cdecl ftell(ptr) MSVCRT_ftell +@ varargs fwprintf(ptr wstr) MSVCRT_fwprintf +@ varargs fwprintf_s(ptr wstr) MSVCRT_fwprintf_s +@ cdecl fwrite(ptr long long ptr) MSVCRT_fwrite +@ varargs fwscanf(ptr wstr) MSVCRT_fwscanf +@ varargs fwscanf_s(ptr wstr) MSVCRT_fwscanf_s +@ 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 -@ cdecl is_wctype(long long) msvcrt.is_wctype -@ cdecl isalnum(long) msvcrt.isalnum -@ cdecl isalpha(long) msvcrt.isalpha -@ 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) msvcrt.iswalpha -@ cdecl iswascii(long) msvcrt.iswascii -@ cdecl iswcntrl(long) msvcrt.iswcntrl -@ cdecl iswctype(long long) msvcrt.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 +@ cdecl getwc(ptr) MSVCRT_getwc +@ cdecl getwchar() MSVCRT_getwchar +@ cdecl is_wctype(long long) ntdll.iswctype +@ cdecl isalnum(long) MSVCRT_isalnum +@ cdecl isalpha(long) MSVCRT_isalpha +@ 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 +@ 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 llabs @ stub lldiv -@ cdecl localeconv() msvcrt.localeconv -@ cdecl log(double) msvcrt.log -@ cdecl -arch=arm,x86_64 logf(float) msvcrt.logf -@ cdecl log10(double) msvcrt.log10 -@ cdecl -arch=arm,x86_64 log10f(float) msvcrt.log10f -@ cdecl -arch=i386,x86_64,arm longjmp(ptr long) msvcrt.longjmp -@ cdecl malloc(long) msvcrt.malloc -@ cdecl mblen(ptr long) msvcrt.mblen -@ cdecl mbrlen(ptr long ptr) msvcrt.mbrlen -@ cdecl mbrtowc(ptr str long ptr) msvcrt.mbrtowc -@ cdecl mbsrtowcs(ptr ptr long ptr) msvcrt.mbsrtowcs +@ cdecl localeconv() MSVCRT_localeconv +@ cdecl log(double) MSVCRT_log +@ cdecl -arch=arm,x86_64 logf(float) MSVCRT_logf +@ cdecl log10(double) MSVCRT_log10 +@ cdecl -arch=arm,x86_64 log10f(float) MSVCRT_log10f +@ cdecl -arch=i386,x86_64,arm longjmp(ptr long) MSVCRT_longjmp +@ cdecl malloc(long) MSVCRT_malloc +@ cdecl mblen(ptr long) MSVCRT_mblen +@ cdecl mbrlen(ptr long ptr) MSVCRT_mbrlen +@ 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 -@ cdecl perror(str) msvcrt.perror -@ cdecl pow(double double) msvcrt.pow -@ cdecl -arch=arm,x86_64 powf(float float) msvcrt.powf -@ varargs printf(str) msvcrt.printf -@ varargs printf_s(str) msvcrt.printf_s -@ cdecl putc(long ptr) msvcrt.putc -@ cdecl putchar(long) msvcrt.putchar -@ cdecl puts(str) msvcrt.puts -@ cdecl putwc(long ptr) msvcrt.putwc -@ cdecl putwchar(long) msvcrt.putwchar -@ cdecl qsort(ptr long long ptr) msvcrt.qsort -@ cdecl qsort_s(ptr long long ptr ptr) msvcrt.qsort_s -@ cdecl raise(long) msvcrt.raise -@ cdecl rand() msvcrt.rand -@ cdecl rand_s(ptr) msvcrt.rand_s -@ cdecl realloc(ptr long) msvcrt.realloc -@ cdecl remove(str) msvcrt.remove -@ cdecl rename(str str) msvcrt.rename -@ cdecl rewind(ptr) msvcrt.rewind -@ varargs scanf(str) msvcrt.scanf -@ varargs scanf_s(str) msvcrt.scanf_s -@ 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 -@ varargs sprintf(ptr str) msvcrt.sprintf -@ varargs sprintf_s(ptr long str) msvcrt.sprintf_s -@ cdecl sqrt(double) msvcrt.sqrt -@ cdecl -arch=arm,x86_64 sqrtf(float) msvcrt.sqrtf -@ cdecl srand(long) msvcrt.srand -@ varargs sscanf(str str) msvcrt.sscanf -@ varargs sscanf_s(str str) msvcrt.sscanf_s -@ cdecl strcat(str str) msvcrt.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) msvcrt.strcpy -@ cdecl strcpy_s(ptr long str) msvcrt.strcpy_s -@ cdecl strcspn(str str) msvcrt.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) msvcrt.strpbrk -@ cdecl strrchr(str long) msvcrt.strrchr -@ cdecl strspn(str str) msvcrt.strspn -@ cdecl strstr(str str) msvcrt.strstr -@ cdecl strtod(str ptr) msvcrt.strtod -@ cdecl strtok(str str) msvcrt.strtok -@ cdecl strtok_s(ptr str ptr) msvcrt.strtok_s -@ cdecl strtol(str ptr long) msvcrt.strtol -@ cdecl strtoul(str ptr long) msvcrt.strtoul -@ cdecl strxfrm(ptr str long) msvcrt.strxfrm -@ varargs swprintf_s(ptr long wstr) msvcrt.swprintf_s -@ varargs swscanf(wstr wstr) msvcrt.swscanf -@ varargs swscanf_s(wstr wstr) msvcrt.swscanf_s -@ 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 tmpfile() msvcrt.tmpfile -@ cdecl tmpfile_s(ptr) msvcrt.tmpfile_s -@ cdecl tmpnam(ptr) msvcrt.tmpnam +@ 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 +@ cdecl perror(str) MSVCRT_perror +@ cdecl pow(double double) MSVCRT_pow +@ cdecl -arch=arm,x86_64 powf(float float) MSVCRT_powf +@ varargs printf(str) MSVCRT_printf +@ varargs printf_s(str) MSVCRT_printf_s +@ 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 +@ cdecl raise(long) MSVCRT_raise +@ cdecl rand() MSVCRT_rand +@ cdecl rand_s(ptr) MSVCRT_rand_s +@ cdecl realloc(ptr long) MSVCRT_realloc +@ cdecl remove(str) MSVCRT_remove +@ cdecl rename(str str) MSVCRT_rename +@ cdecl rewind(ptr) MSVCRT_rewind +@ varargs scanf(str) MSVCRT_scanf +@ varargs scanf_s(str) MSVCRT_scanf_s +@ 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 +@ varargs sprintf(ptr str) MSVCRT_sprintf +@ varargs sprintf_s(ptr long str) MSVCRT_sprintf_s +@ cdecl sqrt(double) MSVCRT_sqrt +@ cdecl -arch=arm,x86_64 sqrtf(float) MSVCRT_sqrtf +@ cdecl srand(long) MSVCRT_srand +@ varargs sscanf(str str) MSVCRT_sscanf +@ varargs sscanf_s(str str) MSVCRT_sscanf_s +@ 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 +@ cdecl strtok(str str) MSVCRT_strtok +@ cdecl strtok_s(ptr str ptr) MSVCRT_strtok_s +@ cdecl strtol(str ptr long) MSVCRT_strtol +@ cdecl strtoul(str ptr long) MSVCRT_strtoul +@ cdecl strxfrm(ptr str long) MSVCRT_strxfrm +@ varargs swprintf_s(ptr long wstr) MSVCRT_swprintf_s +@ varargs swscanf(wstr wstr) MSVCRT_swscanf +@ varargs swscanf_s(wstr wstr) MSVCRT_swscanf_s +@ 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 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 -@ cdecl towlower(long) msvcrt.towlower -@ cdecl towupper(long) msvcrt.towupper -@ cdecl ungetc(long ptr) msvcrt.ungetc -@ cdecl ungetwc(long ptr) msvcrt.ungetwc -@ cdecl vfprintf(ptr str ptr) msvcrt.vfprintf -@ cdecl vfprintf_s(ptr str ptr) msvcrt.vfprintf_s -@ cdecl vfwprintf(ptr wstr ptr) msvcrt.vfwprintf -@ cdecl vfwprintf_s(ptr wstr ptr) msvcrt.vfwprintf_s -@ cdecl vprintf(str ptr) msvcrt.vprintf -@ cdecl vprintf_s(str ptr) msvcrt.vprintf_s -@ cdecl vsprintf(ptr str ptr) msvcrt.vsprintf -@ cdecl vsprintf_s(ptr long str ptr) msvcrt.vsprintf_s -@ cdecl vswprintf_s(ptr long wstr ptr) msvcrt.vswprintf_s -@ cdecl vwprintf(wstr ptr) msvcrt.vwprintf -@ cdecl vwprintf_s(wstr ptr) msvcrt.vwprintf_s -@ cdecl wcrtomb(ptr long ptr) msvcrt.wcrtomb +@ cdecl tolower(long) MSVCRT_tolower +@ cdecl toupper(long) MSVCRT_toupper +@ cdecl towlower(long) MSVCRT_towlower +@ cdecl towupper(long) MSVCRT_towupper +@ cdecl ungetc(long ptr) MSVCRT_ungetc +@ cdecl ungetwc(long ptr) MSVCRT_ungetwc +@ cdecl vfprintf(ptr str ptr) MSVCRT_vfprintf +@ cdecl vfprintf_s(ptr str ptr) MSVCRT_vfprintf_s +@ cdecl vfwprintf(ptr wstr ptr) MSVCRT_vfwprintf +@ cdecl vfwprintf_s(ptr wstr ptr) MSVCRT_vfwprintf_s +@ cdecl vprintf(str ptr) MSVCRT_vprintf +@ cdecl vprintf_s(str ptr) MSVCRT_vprintf_s +@ cdecl vsprintf(ptr str ptr) MSVCRT_vsprintf +@ cdecl vsprintf_s(ptr long str ptr) MSVCRT_vsprintf_s +@ cdecl vswprintf_s(ptr long wstr ptr) MSVCRT_vswprintf_s +@ cdecl vwprintf(wstr ptr) MSVCRT_vwprintf +@ cdecl vwprintf_s(wstr ptr) MSVCRT_vwprintf_s +@ cdecl wcrtomb(ptr long ptr) MSVCRT_wcrtomb @ stub wcrtomb_s -@ cdecl wcscat(wstr wstr) msvcrt.wcscat -@ cdecl wcscat_s(wstr long wstr) msvcrt.wcscat_s -@ cdecl wcschr(wstr long) msvcrt.wcschr -@ cdecl wcscmp(wstr wstr) msvcrt.wcscmp -@ cdecl wcscoll(wstr wstr) msvcrt.wcscoll -@ cdecl wcscpy(ptr wstr) msvcrt.wcscpy -@ cdecl wcscpy_s(ptr long wstr) msvcrt.wcscpy_s -@ cdecl wcscspn(wstr wstr) msvcrt.wcscspn -@ cdecl wcsftime(ptr long wstr ptr) msvcrt.wcsftime -@ cdecl wcslen(wstr) msvcrt.wcslen -@ cdecl wcsncat(wstr wstr long) msvcrt.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) msvcrt.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) msvcrt.wcsspn -@ cdecl wcsstr(wstr wstr) msvcrt.wcsstr -@ cdecl wcstod(wstr ptr) msvcrt.wcstod -@ cdecl wcstok(wstr wstr) msvcrt.wcstok -@ cdecl wcstok_s(ptr wstr ptr) msvcrt.wcstok_s -@ cdecl wcstol(wstr ptr long) msvcrt.wcstol -@ 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 -@ 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 +@ 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 +@ cdecl wcstok(wstr wstr) MSVCRT_wcstok +@ cdecl wcstok_s(ptr wstr ptr) MSVCRT_wcstok_s +@ cdecl wcstol(wstr ptr long) ntdll.wcstol +@ 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 wcsxfrm(ptr wstr long) +@ cdecl wctob(long) MSVCRT_wctob +@ cdecl wctomb(ptr long) MSVCRT_wctomb +@ cdecl wctomb_s(ptr ptr long long) MSVCRT_wctomb_s @ cdecl wmemcpy_s(ptr long ptr long) @ cdecl wmemmove_s(ptr long ptr long) -@ varargs wprintf(wstr) msvcrt.wprintf -@ varargs wprintf_s(wstr) msvcrt.wprintf_s -@ varargs wscanf(wstr) msvcrt.wscanf -@ varargs wscanf_s(wstr) msvcrt.wscanf_s +@ varargs wprintf(wstr) MSVCRT_wprintf +@ varargs wprintf_s(wstr) MSVCRT_wprintf_s +@ varargs wscanf(wstr) MSVCRT_wscanf +@ varargs wscanf_s(wstr) MSVCRT_wscanf_s diff -Nru wine1.7-1.7.14/dlls/msvcr110/Makefile.in wine1.7-1.7.18/dlls/msvcr110/Makefile.in --- wine1.7-1.7.14/dlls/msvcr110/Makefile.in 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msvcr110/Makefile.in 2014-05-02 18:15:48.000000000 +0000 @@ -1,6 +1,34 @@ +EXTRADEFS = -D_MT -D_MSVCR_VER=110 MODULE = msvcr110.dll IMPORTLIB = msvcr110 -IMPORTS = msvcrt +DELAYIMPORTS = advapi32 user32 +PARENTSRC = ../msvcrt C_SRCS = \ - msvcr110.c + 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.14/dlls/msvcr110/msvcr110.c wine1.7-1.7.18/dlls/msvcr110/msvcr110.c --- wine1.7-1.7.14/dlls/msvcr110/msvcr110.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msvcr110/msvcr110.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,72 +0,0 @@ -/* - * msvcr110 specific functions - * - * Copyright 2013 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 - -#include "stdlib.h" -#include "windef.h" -#include "winbase.h" -#include "wine/debug.h" - -WINE_DEFAULT_DEBUG_CHANNEL(msvcrt); - -/********************************************************************* - * DllMain (MSVCR110.@) - */ -BOOL WINAPI DllMain(HINSTANCE hdll, DWORD reason, LPVOID reserved) -{ - switch (reason) - { - case DLL_WINE_PREATTACH: - return FALSE; /* prefer native version */ - - case DLL_PROCESS_ATTACH: - DisableThreadLibraryCalls(hdll); - } - return TRUE; -} - -/********************************************************************* - * __crtSetUnhandledExceptionFilter (MSVCR110.@) - */ -LPTOP_LEVEL_EXCEPTION_FILTER CDECL MSVCR110__crtSetUnhandledExceptionFilter(LPTOP_LEVEL_EXCEPTION_FILTER filter) -{ - return SetUnhandledExceptionFilter(filter); -} - -/********************************************************************* - * __crtGetShowWindowMode (MSVCR110.@) - */ -int CDECL MSVCR110__crtGetShowWindowMode(void) -{ - STARTUPINFOW si; - - GetStartupInfoW(&si); - TRACE("window=%d\n", si.wShowWindow); - return si.wShowWindow; -} - -/********************************************************************* - * __crtTerminateProcess (MSVCR110.@) - */ -int CDECL MSVCR110__crtTerminateProcess(UINT exit_code) -{ - return TerminateProcess(GetCurrentProcess(), exit_code); -} diff -Nru wine1.7-1.7.14/dlls/msvcr110/msvcr110.spec wine1.7-1.7.18/dlls/msvcr110/msvcr110.spec --- wine1.7-1.7.14/dlls/msvcr110/msvcr110.spec 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msvcr110/msvcr110.spec 2014-05-02 18:15:48.000000000 +0000 @@ -74,33 +74,33 @@ @ stub -arch=arm ??0_Timer@details@Concurrency@@IAA@I_N@Z @ stub -arch=i386 ??0_Timer@details@Concurrency@@IAE@I_N@Z @ stub -arch=win64 ??0_Timer@details@Concurrency@@IEAA@I_N@Z -@ cdecl -arch=arm ??0__non_rtti_object@std@@QAA@ABV01@@Z(ptr ptr) msvcrt.??0__non_rtti_object@std@@QAA@ABV01@@Z -@ thiscall -arch=i386 ??0__non_rtti_object@std@@QAE@ABV01@@Z(ptr ptr) msvcrt.??0__non_rtti_object@@QAE@ABV0@@Z -@ cdecl -arch=win64 ??0__non_rtti_object@std@@QEAA@AEBV01@@Z(ptr ptr) msvcrt.??0__non_rtti_object@@QEAA@AEBV0@@Z -@ cdecl -arch=arm ??0__non_rtti_object@std@@QAA@PBD@Z(ptr ptr) msvcrt.??0__non_rtti_object@std@@QAA@PBD@Z -@ thiscall -arch=i386 ??0__non_rtti_object@std@@QAE@PBD@Z(ptr ptr) msvcrt.??0__non_rtti_object@@QAE@PBD@Z -@ cdecl -arch=win64 ??0__non_rtti_object@std@@QEAA@PEBD@Z(ptr ptr) msvcrt.??0__non_rtti_object@@QEAA@PEBD@Z -@ cdecl -arch=arm ??0bad_cast@std@@AAA@PBQBD@Z(ptr ptr) msvcrt.??0bad_cast@std@@AAA@PBQBD@Z -@ thiscall -arch=i386 ??0bad_cast@std@@AAE@PBQBD@Z(ptr ptr) msvcrt.??0bad_cast@@AAE@PBQBD@Z -@ cdecl -arch=win64 ??0bad_cast@std@@AEAA@PEBQEBD@Z(ptr ptr) msvcrt.??0bad_cast@@AEAA@PEBQEBD@Z -@ cdecl -arch=arm ??0bad_cast@std@@QAA@ABV01@@Z(ptr ptr) msvcrt.??0bad_cast@std@@QAA@ABV01@@Z -@ thiscall -arch=i386 ??0bad_cast@std@@QAE@ABV01@@Z(ptr ptr) msvcrt.??0bad_cast@@QAE@ABV0@@Z -@ cdecl -arch=win64 ??0bad_cast@std@@QEAA@AEBV01@@Z(ptr ptr) msvcrt.??0bad_cast@@QEAA@AEBV0@@Z -@ cdecl -arch=arm ??0bad_cast@std@@QAA@PBD@Z(ptr str) msvcrt.??0bad_cast@std@@QAA@PBD@Z -@ thiscall -arch=i386 ??0bad_cast@std@@QAE@PBD@Z(ptr str) msvcrt.??0bad_cast@@QAE@PBD@Z -@ cdecl -arch=win64 ??0bad_cast@std@@QEAA@PEBD@Z(ptr str) msvcrt.??0bad_cast@@QEAA@PEBD@Z +@ cdecl -arch=arm ??0__non_rtti_object@std@@QAA@ABV01@@Z(ptr ptr) MSVCRT___non_rtti_object_copy_ctor +@ thiscall -arch=i386 ??0__non_rtti_object@std@@QAE@ABV01@@Z(ptr ptr) MSVCRT___non_rtti_object_copy_ctor +@ cdecl -arch=win64 ??0__non_rtti_object@std@@QEAA@AEBV01@@Z(ptr ptr) MSVCRT___non_rtti_object_copy_ctor +@ cdecl -arch=arm ??0__non_rtti_object@std@@QAA@PBD@Z(ptr ptr) MSVCRT___non_rtti_object_ctor +@ thiscall -arch=i386 ??0__non_rtti_object@std@@QAE@PBD@Z(ptr ptr) MSVCRT___non_rtti_object_ctor +@ cdecl -arch=win64 ??0__non_rtti_object@std@@QEAA@PEBD@Z(ptr ptr) MSVCRT___non_rtti_object_ctor +@ cdecl -arch=arm ??0bad_cast@std@@AAA@PBQBD@Z(ptr ptr) MSVCRT_bad_cast_ctor +@ thiscall -arch=i386 ??0bad_cast@std@@AAE@PBQBD@Z(ptr ptr) MSVCRT_bad_cast_ctor +@ cdecl -arch=win64 ??0bad_cast@std@@AEAA@PEBQEBD@Z(ptr ptr) MSVCRT_bad_cast_ctor +@ cdecl -arch=arm ??0bad_cast@std@@QAA@ABV01@@Z(ptr ptr) MSVCRT_bad_cast_ctor +@ thiscall -arch=i386 ??0bad_cast@std@@QAE@ABV01@@Z(ptr ptr) MSVCRT_bad_cast_copy_ctor +@ cdecl -arch=win64 ??0bad_cast@std@@QEAA@AEBV01@@Z(ptr ptr) MSVCRT_bad_cast_copy_ctor +@ cdecl -arch=arm ??0bad_cast@std@@QAA@PBD@Z(ptr str) MSVCRT_bad_cast_ctor_charptr +@ thiscall -arch=i386 ??0bad_cast@std@@QAE@PBD@Z(ptr str) MSVCRT_bad_cast_ctor_charptr +@ cdecl -arch=win64 ??0bad_cast@std@@QEAA@PEBD@Z(ptr str) MSVCRT_bad_cast_ctor_charptr @ stub -arch=arm ??0bad_target@Concurrency@@QAA@PBD@Z @ stub -arch=i386 ??0bad_target@Concurrency@@QAE@PBD@Z @ stub -arch=win64 ??0bad_target@Concurrency@@QEAA@PEBD@Z @ stub -arch=arm ??0bad_target@Concurrency@@QAA@XZ @ stub -arch=i386 ??0bad_target@Concurrency@@QAE@XZ @ stub -arch=win64 ??0bad_target@Concurrency@@QEAA@XZ -@ cdecl -arch=arm ??0bad_typeid@std@@QAA@ABV01@@Z(ptr ptr) msvcrt.??0bad_typeid@std@@QAA@ABV01@@Z -@ thiscall -arch=i386 ??0bad_typeid@std@@QAE@ABV01@@Z(ptr ptr) msvcrt.??0bad_typeid@@QAE@ABV0@@Z -@ cdecl -arch=win64 ??0bad_typeid@std@@QEAA@AEBV01@@Z(ptr ptr) msvcrt.??0bad_typeid@@QEAA@AEBV0@@Z -@ cdecl -arch=arm ??0bad_typeid@std@@QAA@PBD@Z(ptr str) msvcrt.??0bad_typeid@std@@QAA@PBD@Z -@ thiscall -arch=i386 ??0bad_typeid@std@@QAE@PBD@Z(ptr str) msvcrt.??0bad_typeid@@QAE@PBD@Z -@ cdecl -arch=win64 ??0bad_typeid@std@@QEAA@PEBD@Z(ptr str) msvcrt.??0bad_typeid@@QEAA@PEBD@Z +@ cdecl -arch=arm ??0bad_typeid@std@@QAA@ABV01@@Z(ptr ptr) MSVCRT_bad_typeid_copy_ctor +@ thiscall -arch=i386 ??0bad_typeid@std@@QAE@ABV01@@Z(ptr ptr) MSVCRT_bad_typeid_copy_ctor +@ cdecl -arch=win64 ??0bad_typeid@std@@QEAA@AEBV01@@Z(ptr ptr) MSVCRT_bad_typeid_copy_ctor +@ cdecl -arch=arm ??0bad_typeid@std@@QAA@PBD@Z(ptr str) MSVCRT_bad_typeid_ctor +@ thiscall -arch=i386 ??0bad_typeid@std@@QAE@PBD@Z(ptr str) MSVCRT_bad_typeid_ctor +@ cdecl -arch=win64 ??0bad_typeid@std@@QEAA@PEBD@Z(ptr str) MSVCRT_bad_typeid_ctor @ stub -arch=arm ??0context_self_unblock@Concurrency@@QAA@PBD@Z @ stub -arch=i386 ??0context_self_unblock@Concurrency@@QAE@PBD@Z @ stub -arch=win64 ??0context_self_unblock@Concurrency@@QEAA@PEBD@Z @@ -125,18 +125,18 @@ @ stub -arch=arm ??0event@Concurrency@@QAA@XZ @ stub -arch=i386 ??0event@Concurrency@@QAE@XZ @ stub -arch=win64 ??0event@Concurrency@@QEAA@XZ -@ cdecl -arch=arm ??0exception@std@@QAA@ABQBD@Z(ptr ptr) msvcrt.??0exception@std@@QAA@ABQBD@Z -@ thiscall -arch=i386 ??0exception@std@@QAE@ABQBD@Z(ptr ptr) msvcrt.??0exception@@QAE@ABQBD@Z -@ cdecl -arch=win64 ??0exception@std@@QEAA@AEBQEBD@Z(ptr ptr) msvcrt.??0exception@@QEAA@AEBQEBD@Z -@ cdecl -arch=arm ??0exception@std@@QAA@ABQBDH@Z(ptr ptr long) msvcrt.??0exception@std@@QAA@ABQBDH@Z -@ thiscall -arch=i386 ??0exception@std@@QAE@ABQBDH@Z(ptr ptr long) msvcrt.??0exception@@QAE@ABQBDH@Z -@ cdecl -arch=win64 ??0exception@std@@QEAA@AEBQEBDH@Z(ptr ptr long) msvcrt.??0exception@@QEAA@AEBQEBDH@Z -@ cdecl -arch=arm ??0exception@std@@QAA@ABV01@@Z(ptr ptr) msvcrt.??0exception@std@@QAA@ABV01@@Z -@ thiscall -arch=i386 ??0exception@std@@QAE@ABV01@@Z(ptr ptr) msvcrt.??0exception@@QAE@ABV0@@Z -@ cdecl -arch=win64 ??0exception@std@@QEAA@AEBV01@@Z(ptr ptr) msvcrt.??0exception@@QEAA@AEBV0@@Z -@ cdecl -arch=arm ??0exception@std@@QAA@XZ(ptr) msvcrt.??0exception@std@@QAA@XZ -@ thiscall -arch=i386 ??0exception@std@@QAE@XZ(ptr) msvcrt.??0exception@@QAE@XZ -@ cdecl -arch=win64 ??0exception@std@@QEAA@XZ(ptr) msvcrt.??0exception@@QEAA@XZ +@ cdecl -arch=arm ??0exception@std@@QAA@ABQBD@Z(ptr ptr) MSVCRT_exception_ctor +@ thiscall -arch=i386 ??0exception@std@@QAE@ABQBD@Z(ptr ptr) MSVCRT_exception_ctor +@ cdecl -arch=win64 ??0exception@std@@QEAA@AEBQEBD@Z(ptr ptr) MSVCRT_exception_ctor +@ cdecl -arch=arm ??0exception@std@@QAA@ABQBDH@Z(ptr ptr long) MSVCRT_exception_ctor_noalloc +@ thiscall -arch=i386 ??0exception@std@@QAE@ABQBDH@Z(ptr ptr long) MSVCRT_exception_ctor_noalloc +@ cdecl -arch=win64 ??0exception@std@@QEAA@AEBQEBDH@Z(ptr ptr long) MSVCRT_exception_ctor_noalloc +@ cdecl -arch=arm ??0exception@std@@QAA@ABV01@@Z(ptr ptr) MSVCRT_exception_copy_ctor +@ thiscall -arch=i386 ??0exception@std@@QAE@ABV01@@Z(ptr ptr) MSVCRT_exception_copy_ctor +@ cdecl -arch=win64 ??0exception@std@@QEAA@AEBV01@@Z(ptr ptr) MSVCRT_exception_copy_ctor +@ cdecl -arch=arm ??0exception@std@@QAA@XZ(ptr) MSVCRT_exception_default_ctor +@ thiscall -arch=i386 ??0exception@std@@QAE@XZ(ptr) MSVCRT_exception_default_ctor +@ cdecl -arch=win64 ??0exception@std@@QEAA@XZ(ptr) MSVCRT_exception_default_ctor @ stub -arch=arm ??0improper_lock@Concurrency@@QAA@PBD@Z @ stub -arch=i386 ??0improper_lock@Concurrency@@QAE@PBD@Z @ stub -arch=win64 ??0improper_lock@Concurrency@@QEAA@PEBD@Z @@ -302,24 +302,24 @@ @ stub -arch=arm ??1_Timer@details@Concurrency@@MAA@XZ @ stub -arch=i386 ??1_Timer@details@Concurrency@@MAE@XZ @ stub -arch=win64 ??1_Timer@details@Concurrency@@MEAA@XZ -@ cdecl -arch=arm ??1__non_rtti_object@std@@UAA@XZ(ptr) msvcrt.??1__non_rtti_object@std@@UAA@XZ -@ thiscall -arch=i386 ??1__non_rtti_object@std@@UAE@XZ(ptr) msvcrt.??1__non_rtti_object@@UAE@XZ -@ cdecl -arch=win64 ??1__non_rtti_object@std@@UEAA@XZ(ptr) msvcrt.??1__non_rtti_object@@UEAA@XZ -@ cdecl -arch=arm ??1bad_cast@std@@UAA@XZ(ptr) msvcrt.??1bad_cast@std@@UAA@XZ -@ thiscall -arch=i386 ??1bad_cast@std@@UAE@XZ(ptr) msvcrt.??1bad_cast@@UAE@XZ -@ cdecl -arch=win64 ??1bad_cast@std@@UEAA@XZ(ptr) msvcrt.??1bad_cast@@UEAA@XZ -@ cdecl -arch=arm ??1bad_typeid@std@@UAA@XZ(ptr) msvcrt.??1bad_typeid@std@@UAA@XZ -@ thiscall -arch=i386 ??1bad_typeid@std@@UAE@XZ(ptr) msvcrt.??1bad_typeid@@UAE@XZ -@ cdecl -arch=win64 ??1bad_typeid@std@@UEAA@XZ(ptr) msvcrt.??1bad_typeid@@UEAA@XZ +@ cdecl -arch=arm ??1__non_rtti_object@std@@UAA@XZ(ptr) MSVCRT___non_rtti_object_dtor +@ thiscall -arch=i386 ??1__non_rtti_object@std@@UAE@XZ(ptr) MSVCRT___non_rtti_object_dtor +@ cdecl -arch=win64 ??1__non_rtti_object@std@@UEAA@XZ(ptr) MSVCRT___non_rtti_object_dtor +@ cdecl -arch=arm ??1bad_cast@std@@UAA@XZ(ptr) MSVCRT_bad_cast_dtor +@ thiscall -arch=i386 ??1bad_cast@std@@UAE@XZ(ptr) MSVCRT_bad_cast_dtor +@ cdecl -arch=win64 ??1bad_cast@std@@UEAA@XZ(ptr) MSVCRT_bad_cast_dtor +@ cdecl -arch=arm ??1bad_typeid@std@@UAA@XZ(ptr) MSVCRT_bad_typeid_dtor +@ thiscall -arch=i386 ??1bad_typeid@std@@UAE@XZ(ptr) MSVCRT_bad_typeid_dtor +@ cdecl -arch=win64 ??1bad_typeid@std@@UEAA@XZ(ptr) MSVCRT_bad_typeid_dtor @ stub -arch=arm ??1critical_section@Concurrency@@QAA@XZ @ stub -arch=i386 ??1critical_section@Concurrency@@QAE@XZ @ stub -arch=win64 ??1critical_section@Concurrency@@QEAA@XZ @ stub -arch=arm ??1event@Concurrency@@QAA@XZ @ stub -arch=i386 ??1event@Concurrency@@QAE@XZ @ stub -arch=win64 ??1event@Concurrency@@QEAA@XZ -@ cdecl -arch=arm ??1exception@std@@UAA@XZ(ptr) msvcrt.??1exception@std@@UAA@XZ -@ thiscall -arch=i386 ??1exception@std@@UAE@XZ(ptr) msvcrt.??1exception@@UAE@XZ -@ cdecl -arch=win64 ??1exception@std@@UEAA@XZ(ptr) msvcrt.??1exception@@UEAA@XZ +@ cdecl -arch=arm ??1exception@std@@UAA@XZ(ptr) MSVCRT_exception_dtor +@ thiscall -arch=i386 ??1exception@std@@UAE@XZ(ptr) MSVCRT_exception_dtor +@ cdecl -arch=win64 ??1exception@std@@UEAA@XZ(ptr) MSVCRT_exception_dtor @ stub -arch=arm ??1reader_writer_lock@Concurrency@@QAA@XZ @ stub -arch=i386 ??1reader_writer_lock@Concurrency@@QAE@XZ @ stub -arch=win64 ??1reader_writer_lock@Concurrency@@QEAA@XZ @@ -332,15 +332,15 @@ @ stub -arch=arm ??1scoped_lock_read@reader_writer_lock@Concurrency@@QAA@XZ @ stub -arch=i386 ??1scoped_lock_read@reader_writer_lock@Concurrency@@QAE@XZ @ stub -arch=win64 ??1scoped_lock_read@reader_writer_lock@Concurrency@@QEAA@XZ -@ cdecl -arch=arm ??1type_info@@UAA@XZ(ptr) msvcrt.??1type_info@@UAA@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 -@ cdecl -arch=win64 ??2@YAPEAX_K@Z(long) msvcrt.??2@YAPEAX_K@Z -@ cdecl -arch=win32 ??2@YAPAXIHPBDH@Z(long long str long) msvcrt.??2@YAPAXIHPBDH@Z -@ cdecl -arch=win64 ??2@YAPEAX_KHPEBDH@Z(long long str long) msvcrt.??2@YAPEAX_KHPEBDH@Z -@ cdecl -arch=win32 ??3@YAXPAX@Z(ptr) msvcrt.??3@YAXPAX@Z -@ cdecl -arch=win64 ??3@YAXPEAX@Z(ptr) msvcrt.??3@YAXPEAX@Z +@ cdecl -arch=arm ??1type_info@@UAA@XZ(ptr) MSVCRT_type_info_dtor +@ thiscall -arch=i386 ??1type_info@@UAE@XZ(ptr) MSVCRT_type_info_dtor +@ cdecl -arch=win64 ??1type_info@@UEAA@XZ(ptr) MSVCRT_type_info_dtor +@ cdecl -arch=win32 ??2@YAPAXI@Z(long) MSVCRT_operator_new +@ cdecl -arch=win64 ??2@YAPEAX_K@Z(long) MSVCRT_operator_new +@ cdecl -arch=win32 ??2@YAPAXIHPBDH@Z(long long str long) MSVCRT_operator_new_dbg +@ cdecl -arch=win64 ??2@YAPEAX_KHPEBDH@Z(long long str long) MSVCRT_operator_new_dbg +@ cdecl -arch=win32 ??3@YAXPAX@Z(ptr) MSVCRT_operator_delete +@ cdecl -arch=win64 ??3@YAXPEAX@Z(ptr) MSVCRT_operator_delete @ stub -arch=win32 ??3@YAXPAXHPBDH@Z @ stub -arch=win64 ??3@YAXPEAXHPEBDH@Z @ stub -arch=arm ??4?$_SpinWait@$00@details@Concurrency@@QAAAAV012@ABV012@@Z @@ -352,28 +352,28 @@ @ stub -arch=arm ??4SchedulerPolicy@Concurrency@@QAAAAV01@ABV01@@Z @ stub -arch=i386 ??4SchedulerPolicy@Concurrency@@QAEAAV01@ABV01@@Z @ stub -arch=win64 ??4SchedulerPolicy@Concurrency@@QEAAAEAV01@AEBV01@@Z -@ cdecl -arch=arm ??4__non_rtti_object@std@@QAAAAV01@ABV01@@Z(ptr ptr) msvcrt.??4__non_rtti_object@std@@QAAAAV01@ABV01@@Z -@ thiscall -arch=i386 ??4__non_rtti_object@std@@QAEAAV01@ABV01@@Z(ptr ptr) msvcrt.??4__non_rtti_object@@QAEAAV0@ABV0@@Z -@ cdecl -arch=win64 ??4__non_rtti_object@std@@QEAAAEAV01@AEBV01@@Z(ptr ptr) msvcrt.??4__non_rtti_object@@QEAAAEAV0@AEBV0@@Z -@ cdecl -arch=arm ??4bad_cast@std@@QAAAAV01@ABV01@@Z(ptr ptr) msvcrt.??4bad_cast@std@@QAAAAV01@ABV01@@Z -@ thiscall -arch=i386 ??4bad_cast@std@@QAEAAV01@ABV01@@Z(ptr ptr) msvcrt.??4bad_cast@@QAEAAV0@ABV0@@Z -@ cdecl -arch=win64 ??4bad_cast@std@@QEAAAEAV01@AEBV01@@Z(ptr ptr) msvcrt.??4bad_cast@@QEAAAEAV0@AEBV0@@Z -@ cdecl -arch=arm ??4bad_typeid@std@@QAAAAV01@ABV01@@Z(ptr ptr) msvcrt.??4bad_typeid@std@@QAAAAV01@ABV01@@Z -@ thiscall -arch=i386 ??4bad_typeid@std@@QAEAAV01@ABV01@@Z(ptr ptr) msvcrt.??4bad_typeid@@QAEAAV0@ABV0@@Z -@ cdecl -arch=win64 ??4bad_typeid@std@@QEAAAEAV01@AEBV01@@Z(ptr ptr) msvcrt.??4bad_typeid@@QEAAAEAV0@AEBV0@@Z -@ cdecl -arch=arm ??4exception@std@@QAAAAV01@ABV01@@Z(ptr ptr) msvcrt.??4exception@std@@QAAAAV01@ABV01@@Z -@ thiscall -arch=i386 ??4exception@std@@QAEAAV01@ABV01@@Z(ptr ptr) msvcrt.??4exception@@QAEAAV0@ABV0@@Z -@ cdecl -arch=win64 ??4exception@std@@QEAAAEAV01@AEBV01@@Z(ptr ptr) msvcrt.??4exception@@QEAAAEAV0@AEBV0@@Z -@ cdecl -arch=arm ??8type_info@@QBA_NABV0@@Z(ptr ptr) msvcrt.??8type_info@@QBA_NABV0@@Z -@ thiscall -arch=i386 ??8type_info@@QBE_NABV0@@Z(ptr ptr) msvcrt.??8type_info@@QBEHABV0@@Z -@ cdecl -arch=win64 ??8type_info@@QEBA_NAEBV0@@Z(ptr ptr) msvcrt.??8type_info@@QEBAHAEBV0@@Z -@ cdecl -arch=arm ??9type_info@@QBA_NABV0@@Z(ptr ptr) msvcrt.??9type_info@@QBA_NABV0@@Z -@ thiscall -arch=i386 ??9type_info@@QBE_NABV0@@Z(ptr ptr) msvcrt.??9type_info@@QBEHABV0@@Z -@ cdecl -arch=win64 ??9type_info@@QEBA_NAEBV0@@Z(ptr ptr) msvcrt.??9type_info@@QEBAHAEBV0@@Z -@ extern ??_7__non_rtti_object@std@@6B@ msvcrt.??_7__non_rtti_object@@6B@ -@ extern ??_7bad_cast@std@@6B@ msvcrt.??_7bad_cast@@6B@ -@ extern ??_7bad_typeid@std@@6B@ msvcrt.??_7bad_typeid@@6B@ -@ extern ??_7exception@std@@6B@ msvcrt.??_7exception@@6B@ +@ cdecl -arch=arm ??4__non_rtti_object@std@@QAAAAV01@ABV01@@Z(ptr ptr) MSVCRT___non_rtti_object_opequals +@ thiscall -arch=i386 ??4__non_rtti_object@std@@QAEAAV01@ABV01@@Z(ptr ptr) MSVCRT___non_rtti_object_opequals +@ cdecl -arch=win64 ??4__non_rtti_object@std@@QEAAAEAV01@AEBV01@@Z(ptr ptr) MSVCRT___non_rtti_object_opequals +@ cdecl -arch=arm ??4bad_cast@std@@QAAAAV01@ABV01@@Z(ptr ptr) MSVCRT_bad_cast_opequals +@ thiscall -arch=i386 ??4bad_cast@std@@QAEAAV01@ABV01@@Z(ptr ptr) MSVCRT_bad_cast_opequals +@ cdecl -arch=win64 ??4bad_cast@std@@QEAAAEAV01@AEBV01@@Z(ptr ptr) MSVCRT_bad_cast_opequals +@ cdecl -arch=arm ??4bad_typeid@std@@QAAAAV01@ABV01@@Z(ptr ptr) MSVCRT_bad_typeid_opequals +@ thiscall -arch=i386 ??4bad_typeid@std@@QAEAAV01@ABV01@@Z(ptr ptr) MSVCRT_bad_typeid_opequals +@ cdecl -arch=win64 ??4bad_typeid@std@@QEAAAEAV01@AEBV01@@Z(ptr ptr) MSVCRT_bad_typeid_opequals +@ cdecl -arch=arm ??4exception@std@@QAAAAV01@ABV01@@Z(ptr ptr) MSVCRT_exception_opequals +@ thiscall -arch=i386 ??4exception@std@@QAEAAV01@ABV01@@Z(ptr ptr) MSVCRT_exception_opequals +@ cdecl -arch=win64 ??4exception@std@@QEAAAEAV01@AEBV01@@Z(ptr ptr) MSVCRT_exception_opequals +@ cdecl -arch=arm ??8type_info@@QBA_NABV0@@Z(ptr ptr) MSVCRT_type_info_opequals_equals +@ thiscall -arch=i386 ??8type_info@@QBE_NABV0@@Z(ptr ptr) MSVCRT_type_info_opequals_equals +@ cdecl -arch=win64 ??8type_info@@QEBA_NAEBV0@@Z(ptr ptr) MSVCRT_type_info_opequals_equals +@ cdecl -arch=arm ??9type_info@@QBA_NABV0@@Z(ptr ptr) MSVCRT_type_info_opnot_equals +@ thiscall -arch=i386 ??9type_info@@QBE_NABV0@@Z(ptr ptr) MSVCRT_type_info_opnot_equals +@ cdecl -arch=win64 ??9type_info@@QEBA_NAEBV0@@Z(ptr ptr) MSVCRT_type_info_opnot_equals +@ extern ??_7__non_rtti_object@std@@6B@ MSVCRT___non_rtti_object_vtable +@ extern ??_7bad_cast@std@@6B@ MSVCRT_bad_cast_vtable +@ extern ??_7bad_typeid@std@@6B@ MSVCRT_bad_typeid_vtable +@ extern ??_7exception@std@@6B@ MSVCRT_exception_vtable @ stub -arch=arm ??_F?$_SpinWait@$00@details@Concurrency@@QAAXXZ @ stub -arch=i386 ??_F?$_SpinWait@$00@details@Concurrency@@QAEXXZ @ stub -arch=win64 ??_F?$_SpinWait@$00@details@Concurrency@@QEAAXXZ @@ -386,18 +386,18 @@ @ stub -arch=arm ??_F_Scheduler@details@Concurrency@@QAAXXZ @ stub -arch=i386 ??_F_Scheduler@details@Concurrency@@QAEXXZ @ stub -arch=win64 ??_F_Scheduler@details@Concurrency@@QEAAXXZ -@ cdecl -arch=arm ??_Fbad_cast@std@@QAAXXZ(ptr) msvcrt.??_Fbad_cast@std@@QAAXXZ -@ thiscall -arch=i386 ??_Fbad_cast@std@@QAEXXZ(ptr) msvcrt.??_Fbad_cast@@QAEXXZ -@ cdecl -arch=win64 ??_Fbad_cast@std@@QEAAXXZ(ptr) msvcrt.??_Fbad_cast@@QEAAXXZ -@ cdecl -arch=arm ??_Fbad_typeid@std@@QAAXXZ(ptr) msvcrt.??_Fbad_typeid@std@@QAAXXZ -@ thiscall -arch=i386 ??_Fbad_typeid@std@@QAEXXZ(ptr) msvcrt.??_Fbad_typeid@@QAEXXZ -@ cdecl -arch=win64 ??_Fbad_typeid@std@@QEAAXXZ(ptr) msvcrt.??_Fbad_typeid@@QEAAXXZ -@ cdecl -arch=win32 ??_U@YAPAXI@Z(long) msvcrt.??_U@YAPAXI@Z -@ cdecl -arch=win64 ??_U@YAPEAX_K@Z(long) msvcrt.??_U@YAPEAX_K@Z -@ cdecl -arch=win32 ??_U@YAPAXIHPBDH@Z(long long str long) msvcrt.??_U@YAPAXIHPBDH@Z -@ cdecl -arch=win64 ??_U@YAPEAX_KHPEBDH@Z(long long str long) msvcrt.??_U@YAPEAX_KHPEBDH@Z -@ cdecl -arch=win32 ??_V@YAXPAX@Z(ptr) msvcrt.??_V@YAXPAX@Z -@ cdecl -arch=win64 ??_V@YAXPEAX@Z(ptr) msvcrt.??_V@YAXPEAX@Z +@ cdecl -arch=arm ??_Fbad_cast@std@@QAAXXZ(ptr) MSVCRT_bad_cast_default_ctor +@ thiscall -arch=i386 ??_Fbad_cast@std@@QAEXXZ(ptr) MSVCRT_bad_cast_default_ctor +@ cdecl -arch=win64 ??_Fbad_cast@std@@QEAAXXZ(ptr) MSVCRT_bad_cast_default_ctor +@ cdecl -arch=arm ??_Fbad_typeid@std@@QAAXXZ(ptr) MSVCRT_bad_typeid_default_ctor +@ thiscall -arch=i386 ??_Fbad_typeid@std@@QAEXXZ(ptr) MSVCRT_bad_typeid_default_ctor +@ cdecl -arch=win64 ??_Fbad_typeid@std@@QEAAXXZ(ptr) MSVCRT_bad_typeid_default_ctor +@ cdecl -arch=win32 ??_U@YAPAXI@Z(long) MSVCRT_operator_new +@ cdecl -arch=win64 ??_U@YAPEAX_K@Z(long) MSVCRT_operator_new +@ cdecl -arch=win32 ??_U@YAPAXIHPBDH@Z(long long str long) MSVCRT_operator_new_dbg +@ cdecl -arch=win64 ??_U@YAPEAX_KHPEBDH@Z(long long str long) MSVCRT_operator_new_dbg +@ cdecl -arch=win32 ??_V@YAXPAX@Z(ptr) MSVCRT_operator_delete +@ cdecl -arch=win64 ??_V@YAXPEAX@Z(ptr) MSVCRT_operator_delete @ stub -arch=win32 ??_V@YAXPAXHPBDH@Z @ stub -arch=win64 ??_V@YAXPEAXHPEBDH@Z @ stub -arch=win32 ?Alloc@Concurrency@@YAPAXI@Z @@ -706,41 +706,41 @@ @ stub -arch=win64 ?__ExceptionPtrSwap@@YAXPEAX0@Z @ stub -arch=win32 ?__ExceptionPtrToBool@@YA_NPBX@Z @ stub -arch=win64 ?__ExceptionPtrToBool@@YA_NPEBX@Z -@ cdecl __uncaught_exception() msvcrt.__uncaught_exception +@ cdecl __uncaught_exception() MSVCRT___uncaught_exception @ stub ?_inconsistency@@YAXXZ -@ cdecl -arch=win32 ?_invalid_parameter@@YAXPBG00II@Z(wstr wstr wstr long long) msvcrt._invalid_parameter -@ cdecl -arch=win64 ?_invalid_parameter@@YAXPEBG00I_K@Z(wstr wstr wstr long long) msvcrt._invalid_parameter -@ cdecl -arch=win32 ?_is_exception_typeof@@YAHABVtype_info@@PAU_EXCEPTION_POINTERS@@@Z(ptr ptr) msvcrt._is_exception_typeof -@ cdecl -arch=win64 ?_is_exception_typeof@@YAHAEBVtype_info@@PEAU_EXCEPTION_POINTERS@@@Z(ptr ptr) msvcrt._is_exception_typeof -@ cdecl -arch=arm ?_name_internal_method@type_info@@QBAPBDPAU__type_info_node@@@Z(ptr ptr) msvcr100.?_name_internal_method@type_info@@QBAPBDPAU__type_info_node@@@Z -@ thiscall -arch=i386 ?_name_internal_method@type_info@@QBEPBDPAU__type_info_node@@@Z(ptr ptr) msvcr100.?_name_internal_method@type_info@@QBEPBDPAU__type_info_node@@@Z -@ cdecl -arch=win64 ?_name_internal_method@type_info@@QEBAPEBDPEAU__type_info_node@@@Z(ptr ptr) msvcr100.?_name_internal_method@type_info@@QEBAPEBDPEAU__type_info_node@@@Z -@ varargs -arch=win32 ?_open@@YAHPBDHH@Z(str long) msvcrt._open -@ varargs -arch=win64 ?_open@@YAHPEBDHH@Z(str long) msvcrt._open -@ 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 +@ cdecl -arch=win32 ?_invalid_parameter@@YAXPBG00II@Z(wstr wstr wstr long long) MSVCRT__invalid_parameter +@ cdecl -arch=win64 ?_invalid_parameter@@YAXPEBG00I_K@Z(wstr wstr wstr long long) MSVCRT__invalid_parameter +@ cdecl -arch=win32 ?_is_exception_typeof@@YAHABVtype_info@@PAU_EXCEPTION_POINTERS@@@Z(ptr ptr) _is_exception_typeof +@ cdecl -arch=win64 ?_is_exception_typeof@@YAHAEBVtype_info@@PEAU_EXCEPTION_POINTERS@@@Z(ptr ptr) _is_exception_typeof +@ cdecl -arch=arm ?_name_internal_method@type_info@@QBAPBDPAU__type_info_node@@@Z(ptr ptr) type_info_name_internal_method +@ thiscall -arch=i386 ?_name_internal_method@type_info@@QBEPBDPAU__type_info_node@@@Z(ptr ptr) type_info_name_internal_method +@ cdecl -arch=win64 ?_name_internal_method@type_info@@QEBAPEBDPEAU__type_info_node@@@Z(ptr ptr) type_info_name_internal_method +@ varargs -arch=win32 ?_open@@YAHPBDHH@Z(str long) MSVCRT__open +@ varargs -arch=win64 ?_open@@YAHPEBDHH@Z(str long) MSVCRT__open +@ cdecl -arch=win32 ?_query_new_handler@@YAP6AHI@ZXZ() MSVCRT__query_new_handler +@ cdecl -arch=win64 ?_query_new_handler@@YAP6AH_K@ZXZ() MSVCRT__query_new_handler +@ cdecl ?_query_new_mode@@YAHXZ() MSVCRT__query_new_mode @ stub -arch=win32 ?_set_new_handler@@YAP6AHI@ZH@Z # int (__cdecl*__cdecl _set_new_handler(int))(unsigned int) @ stub -arch=win64 ?_set_new_handler@@YAP6AH_K@ZH@Z # int (__cdecl*__cdecl _set_new_handler(int))(unsigned __int64) -@ cdecl -arch=win32 ?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z(ptr) msvcrt.?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z -@ cdecl -arch=win64 ?_set_new_handler@@YAP6AH_K@ZP6AH0@Z@Z(ptr) msvcrt.?_set_new_handler@@YAP6AH_K@ZP6AH0@Z@Z -@ cdecl ?_set_new_mode@@YAHH@Z(long) msvcrt.?_set_new_mode@@YAHH@Z +@ cdecl -arch=win32 ?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z(ptr) MSVCRT__set_new_handler +@ cdecl -arch=win64 ?_set_new_handler@@YAP6AH_K@ZP6AH0@Z@Z(ptr) MSVCRT__set_new_handler +@ cdecl ?_set_new_mode@@YAHH@Z(long) MSVCRT__set_new_mode @ stub -arch=win32 ?_set_se_translator@@YAP6AXIPAU_EXCEPTION_POINTERS@@@ZH@Z # void (__cdecl*__cdecl _set_se_translator(int))(unsigned int,struct _EXCEPTION_POINTERS *) @ stub -arch=win64 ?_set_se_translator@@YAP6AXIPEAU_EXCEPTION_POINTERS@@@ZH@Z # void (__cdecl*__cdecl _set_se_translator(int))(unsigned int,struct _EXCEPTION_POINTERS * __ptr64) -@ cdecl -arch=win32 ?_set_se_translator@@YAP6AXIPAU_EXCEPTION_POINTERS@@@ZP6AXI0@Z@Z(ptr) msvcrt.?_set_se_translator@@YAP6AXIPAU_EXCEPTION_POINTERS@@@ZP6AXI0@Z@Z -@ cdecl -arch=win64 ?_set_se_translator@@YAP6AXIPEAU_EXCEPTION_POINTERS@@@ZP6AXI0@Z@Z(ptr) msvcrt.?_set_se_translator@@YAP6AXIPEAU_EXCEPTION_POINTERS@@@ZP6AXI0@Z@Z -@ cdecl -arch=win32 ?_sopen@@YAHPBDHHH@Z(str long long long) msvcrt._sopen -@ cdecl -arch=win64 ?_sopen@@YAHPEBDHHH@Z(str long long long) msvcrt._sopen +@ cdecl -arch=win32 ?_set_se_translator@@YAP6AXIPAU_EXCEPTION_POINTERS@@@ZP6AXI0@Z@Z(ptr) MSVCRT__set_se_translator +@ cdecl -arch=win64 ?_set_se_translator@@YAP6AXIPEAU_EXCEPTION_POINTERS@@@ZP6AXI0@Z@Z(ptr) MSVCRT__set_se_translator +@ cdecl -arch=win32 ?_sopen@@YAHPBDHHH@Z(str long long long) MSVCRT__sopen +@ cdecl -arch=win64 ?_sopen@@YAHPEBDHHH@Z(str long long long) MSVCRT__sopen @ stub -arch=arm ?_type_info_dtor_internal_method@type_info@@QAAXXZ @ stub -arch=i386 ?_type_info_dtor_internal_method@type_info@@QAEXXZ # public: void __thiscall type_info::_type_info_dtor_internal_method(void) @ stub -arch=win64 ?_type_info_dtor_internal_method@type_info@@QEAAXXZ # public: void __cdecl type_info::_type_info_dtor_internal_method(void) __ptr64 -@ cdecl -arch=win32 ?_wopen@@YAHPB_WHH@Z(wstr long long) msvcrt._wopen -@ cdecl -arch=win64 ?_wopen@@YAHPEB_WHH@Z(wstr long long) msvcrt._wopen -@ cdecl -arch=win32 ?_wsopen@@YAHPB_WHHH@Z(wstr long long long) msvcrt._wsopen -@ cdecl -arch=win64 ?_wsopen@@YAHPEB_WHHH@Z(wstr long long long) msvcrt._wsopen -@ cdecl -arch=arm ?before@type_info@@QBA_NABV1@@Z(ptr ptr) msvcrt.?before@type_info@@QBA_NABV1@@Z -@ thiscall -arch=i386 ?before@type_info@@QBE_NABV1@@Z(ptr ptr) msvcrt.?before@type_info@@QBEHABV1@@Z -@ cdecl -arch=win64 ?before@type_info@@QEBA_NAEBV1@@Z(ptr ptr) msvcrt.?before@type_info@@QEBAHAEBV1@@Z +@ cdecl -arch=win32 ?_wopen@@YAHPB_WHH@Z(wstr long long) MSVCRT__wopen +@ cdecl -arch=win64 ?_wopen@@YAHPEB_WHH@Z(wstr long long) MSVCRT__wopen +@ cdecl -arch=win32 ?_wsopen@@YAHPB_WHHH@Z(wstr long long long) MSVCRT__wsopen +@ cdecl -arch=win64 ?_wsopen@@YAHPEB_WHHH@Z(wstr long long long) MSVCRT__wsopen +@ cdecl -arch=arm ?before@type_info@@QBA_NABV1@@Z(ptr ptr) MSVCRT_type_info_before +@ thiscall -arch=i386 ?before@type_info@@QBE_NABV1@@Z(ptr ptr) MSVCRT_type_info_before +@ cdecl -arch=win64 ?before@type_info@@QEBA_NAEBV1@@Z(ptr ptr) MSVCRT_type_info_before @ stub ?current@location@Concurrency@@SA?AV12@XZ @ stub ?from_numa_node@location@Concurrency@@SA?AV12@G@Z @ stub -arch=arm ?get_error_code@scheduler_resource_allocation_error@Concurrency@@QBAJXZ @@ -755,9 +755,9 @@ @ stub -arch=arm ?lock_read@reader_writer_lock@Concurrency@@QAAXXZ @ stub -arch=i386 ?lock_read@reader_writer_lock@Concurrency@@QAEXXZ @ stub -arch=win64 ?lock_read@reader_writer_lock@Concurrency@@QEAAXXZ -@ stub -arch=arm ?name@type_info@@QBAPBDPAU__type_info_node@@@Z -@ stub -arch=i386 ?name@type_info@@QBEPBDPAU__type_info_node@@@Z # public: char const * __thiscall type_info::name(struct __type_info_node *)const -@ stub -arch=win64 ?name@type_info@@QEBAPEBDPEAU__type_info_node@@@Z # public: char const * __ptr64 __cdecl type_info::name(struct __type_info_node * __ptr64)const __ptr64 +@ cdecl -arch=arm ?name@type_info@@QBAPBDPAU__type_info_node@@@Z(ptr ptr) type_info_name_internal_method +@ thiscall -arch=i386 ?name@type_info@@QBEPBDPAU__type_info_node@@@Z(ptr ptr) type_info_name_internal_method +@ cdecl -arch=win64 ?name@type_info@@QEBAPEBDPEAU__type_info_node@@@Z(ptr ptr) type_info_name_internal_method @ stub -arch=arm ?native_handle@critical_section@Concurrency@@QAAAAV12@XZ @ stub -arch=i386 ?native_handle@critical_section@Concurrency@@QAEAAV12@XZ @ stub -arch=win64 ?native_handle@critical_section@Concurrency@@QEAAAEAV12@XZ @@ -767,27 +767,27 @@ @ stub -arch=arm ?notify_one@_Condition_variable@details@Concurrency@@QAAXXZ @ stub -arch=i386 ?notify_one@_Condition_variable@details@Concurrency@@QAEXXZ @ stub -arch=win64 ?notify_one@_Condition_variable@details@Concurrency@@QEAAXXZ -@ cdecl -arch=arm ?raw_name@type_info@@QBAPBDXZ(ptr) msvcrt.?raw_name@type_info@@QBAPBDXZ -@ thiscall -arch=i386 ?raw_name@type_info@@QBEPBDXZ(ptr) msvcrt.?raw_name@type_info@@QBEPBDXZ -@ cdecl -arch=win64 ?raw_name@type_info@@QEBAPEBDXZ(ptr) msvcrt.?raw_name@type_info@@QEBAPEBDXZ +@ cdecl -arch=arm ?raw_name@type_info@@QBAPBDXZ(ptr) MSVCRT_type_info_raw_name +@ thiscall -arch=i386 ?raw_name@type_info@@QBEPBDXZ(ptr) MSVCRT_type_info_raw_name +@ cdecl -arch=win64 ?raw_name@type_info@@QEBAPEBDXZ(ptr) MSVCRT_type_info_raw_name @ stub -arch=arm ?reset@event@Concurrency@@QAAXXZ @ stub -arch=i386 ?reset@event@Concurrency@@QAEXXZ @ stub -arch=win64 ?reset@event@Concurrency@@QEAAXXZ @ stub -arch=arm ?set@event@Concurrency@@QAAXXZ @ stub -arch=i386 ?set@event@Concurrency@@QAEXXZ @ stub -arch=win64 ?set@event@Concurrency@@QEAAXXZ -@ cdecl ?set_new_handler@@YAP6AXXZP6AXXZ@Z(ptr) msvcrt.?set_new_handler@@YAP6AXXZP6AXXZ@Z +@ cdecl ?set_new_handler@@YAP6AXXZP6AXXZ@Z(ptr) MSVCRT_set_new_handler @ stub -arch=win32 ?set_task_execution_resources@Concurrency@@YAXGPAU_GROUP_AFFINITY@@@Z @ stub -arch=win64 ?set_task_execution_resources@Concurrency@@YAXGPEAU_GROUP_AFFINITY@@@Z @ stub -arch=win32 ?set_task_execution_resources@Concurrency@@YAXK@Z @ stub -arch=win64 ?set_task_execution_resources@Concurrency@@YAX_K@Z @ stub ?set_terminate@@YAP6AXXZH@Z -@ cdecl ?set_terminate@@YAP6AXXZP6AXXZ@Z(ptr) msvcrt.?set_terminate@@YAP6AXXZP6AXXZ@Z +@ cdecl ?set_terminate@@YAP6AXXZP6AXXZ@Z(ptr) MSVCRT_set_terminate @ stub ?set_unexpected@@YAP6AXXZH@Z -@ cdecl ?set_unexpected@@YAP6AXXZP6AXXZ@Z(ptr) msvcrt.?set_unexpected@@YAP6AXXZP6AXXZ@Z -@ varargs ?swprintf@@YAHPAGIPBGZZ(ptr long wstr) msvcrt._snwprintf -@ varargs ?swprintf@@YAHPA_WIPB_WZZ(ptr long wstr) msvcrt._snwprintf -@ cdecl ?terminate@@YAXXZ() msvcrt.?terminate@@YAXXZ +@ cdecl ?set_unexpected@@YAP6AXXZP6AXXZ@Z(ptr) MSVCRT_set_unexpected +@ varargs ?swprintf@@YAHPAGIPBGZZ(ptr long wstr) MSVCRT__snwprintf +@ varargs ?swprintf@@YAHPA_WIPB_WZZ(ptr long wstr) MSVCRT__snwprintf +@ cdecl ?terminate@@YAXXZ() MSVCRT_terminate @ stub -arch=arm ?try_lock@critical_section@Concurrency@@QAA_NXZ @ stub -arch=i386 ?try_lock@critical_section@Concurrency@@QAE_NXZ @ stub -arch=win64 ?try_lock@critical_section@Concurrency@@QEAA_NXZ @@ -800,14 +800,14 @@ @ stub -arch=arm ?try_lock_read@reader_writer_lock@Concurrency@@QAA_NXZ @ stub -arch=i386 ?try_lock_read@reader_writer_lock@Concurrency@@QAE_NXZ @ stub -arch=win64 ?try_lock_read@reader_writer_lock@Concurrency@@QEAA_NXZ -@ cdecl ?unexpected@@YAXXZ() msvcrt.?unexpected@@YAXXZ +@ cdecl ?unexpected@@YAXXZ() MSVCRT_unexpected @ stub -arch=arm ?unlock@critical_section@Concurrency@@QAAXXZ @ stub -arch=i386 ?unlock@critical_section@Concurrency@@QAEXXZ @ stub -arch=win64 ?unlock@critical_section@Concurrency@@QEAAXXZ @ stub -arch=arm ?unlock@reader_writer_lock@Concurrency@@QAAXXZ @ stub -arch=i386 ?unlock@reader_writer_lock@Concurrency@@QAEXXZ @ stub -arch=win64 ?unlock@reader_writer_lock@Concurrency@@QEAAXXZ -@ cdecl ?vswprintf@@YAHPA_WIPB_WPAD@Z(ptr long wstr ptr) msvcrt._vsnwprintf +@ cdecl ?vswprintf@@YAHPA_WIPB_WPAD@Z(ptr long wstr ptr) MSVCRT_vsnwprintf @ stub ?wait@Concurrency@@YAXI@Z @ stub -arch=arm ?wait@_Condition_variable@details@Concurrency@@QAAXAAVcritical_section@3@@Z @ stub -arch=i386 ?wait@_Condition_variable@details@Concurrency@@QAEXAAVcritical_section@3@@Z @@ -820,39 +820,39 @@ @ stub -arch=win64 ?wait_for@_Condition_variable@details@Concurrency@@QEAA_NAEAVcritical_section@3@I@Z @ stub -arch=win32 ?wait_for_multiple@event@Concurrency@@SAIPAPAV12@I_NI@Z @ stub -arch=win64 ?wait_for_multiple@event@Concurrency@@SA_KPEAPEAV12@_K_NI@Z -@ cdecl -arch=arm ?what@exception@std@@UBAPBDXZ(ptr) msvcrt.?what@exception@std@@UBAPBDXZ -@ thiscall -arch=i386 ?what@exception@std@@UBEPBDXZ(ptr) msvcrt.?what@exception@@UBEPBDXZ -@ cdecl -arch=win64 ?what@exception@std@@UEBAPEBDXZ(ptr) msvcrt.?what@exception@@UEBAPEBDXZ -@ cdecl -norelay $I10_OUTPUT(double long long long ptr) msvcrt.$I10_OUTPUT -@ cdecl -arch=i386 _CIacos() msvcrt._CIacos -@ cdecl -arch=i386 _CIasin() msvcrt._CIasin -@ cdecl -arch=i386 _CIatan() msvcrt._CIatan -@ cdecl -arch=i386 _CIatan2() msvcrt._CIatan2 -@ cdecl -arch=i386 _CIcos() msvcrt._CIcos -@ cdecl -arch=i386 _CIcosh() msvcrt._CIcosh -@ cdecl -arch=i386 _CIexp() msvcrt._CIexp -@ cdecl -arch=i386 _CIfmod() msvcrt._CIfmod -@ cdecl -arch=i386 _CIlog() msvcrt._CIlog -@ cdecl -arch=i386 _CIlog10() msvcrt._CIlog10 -@ cdecl -arch=i386 _CIpow() msvcrt._CIpow -@ cdecl -arch=i386 _CIsin() msvcrt._CIsin -@ cdecl -arch=i386 _CIsinh() msvcrt._CIsinh -@ cdecl -arch=i386 _CIsqrt() msvcrt._CIsqrt -@ cdecl -arch=i386 _CItan() msvcrt._CItan -@ cdecl -arch=i386 _CItanh() msvcrt._CItanh -@ cdecl _CRT_RTC_INIT(ptr ptr long long long) msvcr100._CRT_RTC_INIT -@ cdecl _CRT_RTC_INITW(ptr ptr long long long) msvcr100._CRT_RTC_INITW +@ cdecl -arch=arm ?what@exception@std@@UBAPBDXZ(ptr) MSVCRT_what_exception +@ thiscall -arch=i386 ?what@exception@std@@UBEPBDXZ(ptr) MSVCRT_what_exception +@ cdecl -arch=win64 ?what@exception@std@@UEBAPEBDXZ(ptr) MSVCRT_what_exception +@ cdecl -norelay $I10_OUTPUT(double long long long ptr) MSVCRT_I10_OUTPUT +@ 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() +@ cdecl _CRT_RTC_INIT(ptr ptr long long long) +@ cdecl _CRT_RTC_INITW(ptr ptr long long long) @ stub _CreateFrameInfo -@ stdcall _CxxThrowException(long long) msvcrt._CxxThrowException -@ cdecl -arch=i386 -norelay _EH_prolog() msvcrt._EH_prolog +@ stdcall _CxxThrowException(long long) +@ cdecl -arch=i386 -norelay _EH_prolog() @ stub -arch=arm _FPE_Raise @ stub _FindAndUnlinkFrame @ stub -arch=win64 _GetImageBase @ stub -arch=win64 _GetThrowImageBase -@ cdecl _Getdays() msvcrt._Getdays -@ cdecl _Getmonths() msvcrt._Getmonths -@ cdecl _Gettnames() msvcrt._Gettnames -@ extern _HUGE msvcrt._HUGE +@ cdecl _Getdays() +@ cdecl _Getmonths() +@ cdecl _Gettnames() +@ extern _HUGE MSVCRT__HUGE @ stub _IsExceptionObjectToBeDestroyed @ stub _Lock_shared_ptr_spin_lock @ stub -arch=i386 _NLG_Dispatch2 @@ -862,53 +862,53 @@ @ stub -arch=arm,win64 __NLG_Return2 @ stub -arch=win64 _SetImageBase @ stub -arch=win64 _SetThrowImageBase -@ cdecl _Strftime(str long str ptr ptr) msvcrt._Strftime +@ cdecl _Strftime(str long str ptr ptr) @ stub _Unlock_shared_ptr_spin_lock @ stub _W_Getdays @ stub _W_Getmonths @ stub _W_Gettnames @ stub _Wcsftime -@ cdecl _XcptFilter(long ptr) msvcrt._XcptFilter +@ cdecl _XcptFilter(long ptr) @ stub __AdjustPointer @ stub __BuildCatchObject @ stub __BuildCatchObjectHelper -@ stdcall -arch=x86_64 __C_specific_handler(ptr long ptr ptr) msvcrt.__C_specific_handler -@ cdecl -arch=i386,x86_64,arm __CppXcptFilter(long ptr) msvcrt.__CppXcptFilter -@ cdecl -arch=i386,x86_64,arm __CxxDetectRethrow(ptr) msvcrt.__CxxDetectRethrow +@ 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 -norelay __CxxFrameHandler(ptr ptr ptr ptr) msvcrt.__CxxFrameHandler -@ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler2(ptr ptr ptr ptr) msvcrt.__CxxFrameHandler2 -@ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler3(ptr ptr ptr ptr) msvcrt.__CxxFrameHandler3 -@ stdcall -arch=i386 __CxxLongjmpUnwind(ptr) msvcrt.__CxxLongjmpUnwind -@ cdecl -arch=i386,x86_64,arm __CxxQueryExceptionSize() msvcrt.__CxxQueryExceptionSize +@ 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 -@ cdecl __RTCastToVoid(ptr) msvcrt.__RTCastToVoid -@ cdecl __RTDynamicCast(ptr long ptr ptr long) msvcrt.__RTDynamicCast -@ cdecl __RTtypeid(ptr) msvcrt.__RTtypeid -@ cdecl __STRINGTOLD(ptr ptr str long) msvcrt.__STRINGTOLD +@ cdecl __RTCastToVoid(ptr) MSVCRT___RTCastToVoid +@ cdecl __RTDynamicCast(ptr long ptr ptr long) MSVCRT___RTDynamicCast +@ cdecl __RTtypeid(ptr) MSVCRT___RTtypeid +@ cdecl __STRINGTOLD(ptr ptr str long) @ stub __STRINGTOLD_L @ stub __TypeMatch -@ cdecl ___lc_codepage_func() msvcrt.___lc_codepage_func -@ cdecl ___lc_collate_cp_func() msvcrt.___lc_collate_cp_func +@ cdecl ___lc_codepage_func() +@ cdecl ___lc_collate_cp_func() @ stub ___lc_locale_name_func -@ cdecl ___mb_cur_max_func() msvcrt.___mb_cur_max_func -@ cdecl ___mb_cur_max_l_func(ptr) msvcrt.___mb_cur_max_l_func -@ cdecl ___setlc_active_func() msvcrt.___setlc_active_func -@ cdecl ___unguarded_readlc_active_add_func() msvcrt.___unguarded_readlc_active_add_func -@ extern __argc msvcrt.__argc -@ extern __argv msvcrt.__argv +@ cdecl ___mb_cur_max_func() MSVCRT____mb_cur_max_func +@ cdecl ___mb_cur_max_l_func(ptr) +@ cdecl ___setlc_active_func() MSVCRT____setlc_active_func +@ cdecl ___unguarded_readlc_active_add_func() MSVCRT____unguarded_readlc_active_add_func +@ extern __argc MSVCRT___argc +@ extern __argv MSVCRT___argv ### extern __badioinfo #don't forward to msvcrt.__badioinfo, it has different size -@ cdecl __clean_type_info_names_internal(ptr) msvcr100.__clean_type_info_names_internal -@ cdecl -arch=i386 __control87_2(long long ptr ptr) msvcrt.__control87_2 +@ cdecl __clean_type_info_names_internal(ptr) +@ cdecl -arch=i386 __control87_2(long long ptr ptr) @ stub __create_locale @ stub -arch=win64 __crtCaptureCurrentContext @ stub -arch=win64 __crtCapturePreviousContext -@ cdecl __crtCompareStringA(long long str long str long) msvcrt.__crtCompareStringA +@ cdecl __crtCompareStringA(long long str long str long) @ stub -arch=i386,win64 __crtCompareStringEx -@ cdecl __crtCompareStringW(long long wstr long wstr long) msvcrt.__crtCompareStringW +@ cdecl __crtCompareStringW(long long wstr long wstr long) @ stub -arch=i386 ___crtCreateSemaphoreExW @ stub -arch=x86_64 __crtCreateSymbolicLinkW @ stub -arch=i386,win64 __crtEnumSystemLocalesEx @@ -924,449 +924,449 @@ @ stub -arch=i386,win64 __crtInitializeCriticalSectionEx @ stub __crtIsPackagedApp @ stub -arch=i386,win64 __crtIsValidLocaleName -@ cdecl __crtLCMapStringA(long long str long ptr long long long) msvcrt.__crtLCMapStringA +@ cdecl __crtLCMapStringA(long long str long ptr long long long) @ stub -arch=i386,win64 __crtLCMapStringEx -@ cdecl __crtLCMapStringW(long long wstr long ptr long long long) msvcrt.__crtLCMapStringW +@ cdecl __crtLCMapStringW(long long wstr long ptr long long long) @ stub -arch=i386,win64 __crtSetThreadStackGuarantee @ cdecl __crtSetUnhandledExceptionFilter(ptr) MSVCR110__crtSetUnhandledExceptionFilter @ cdecl -arch=i386,win64 __crtTerminateProcess(long) MSVCR110__crtTerminateProcess @ stub -arch=i386,win64 __crtUnhandledException -@ cdecl __daylight() msvcrt.__daylight -@ cdecl __dllonexit(ptr ptr ptr) msvcrt.__dllonexit -@ cdecl __doserrno() msvcrt.__doserrno +@ cdecl __daylight() MSVCRT___p__daylight +@ cdecl __dllonexit(ptr ptr ptr) +@ cdecl __doserrno() MSVCRT___doserrno @ stub __dstbias -@ cdecl __fpecode() msvcrt.__fpecode +@ cdecl __fpecode() @ stub __free_locale @ stub __get_current_locale @ stub __get_flsindex @ stub __get_tlsindex -@ cdecl __getmainargs(ptr ptr ptr long ptr) msvcrt.__getmainargs -@ extern __initenv msvcrt.__initenv -@ cdecl __iob_func() msvcrt.__iob_func -@ cdecl __isascii(long) msvcrt.__isascii -@ cdecl __iscsym(long) msvcrt.__iscsym -@ cdecl __iscsymf(long) msvcrt.__iscsymf +@ cdecl __getmainargs(ptr ptr ptr long ptr) +@ extern __initenv MSVCRT___initenv +@ cdecl __iob_func() MSVCRT___iob_func +@ cdecl __isascii(long) MSVCRT___isascii +@ cdecl __iscsym(long) MSVCRT___iscsym +@ cdecl __iscsymf(long) MSVCRT___iscsymf @ stub __iswcsym @ stub __iswcsymf @ stub -arch=arm __jump_unwind # extern __lconv -@ cdecl __lconv_init() msvcrt.__lconv_init -@ cdecl -arch=i386 __libm_sse2_acos() msvcrt.__libm_sse2_acos -@ cdecl -arch=i386 __libm_sse2_acosf() msvcrt.__libm_sse2_acosf -@ cdecl -arch=i386 __libm_sse2_asin() msvcrt.__libm_sse2_asin -@ cdecl -arch=i386 __libm_sse2_asinf() msvcrt.__libm_sse2_asinf -@ cdecl -arch=i386 __libm_sse2_atan() msvcrt.__libm_sse2_atan -@ cdecl -arch=i386 __libm_sse2_atan2() msvcrt.__libm_sse2_atan2 -@ cdecl -arch=i386 __libm_sse2_atanf() msvcrt.__libm_sse2_atanf -@ cdecl -arch=i386 __libm_sse2_cos() msvcrt.__libm_sse2_cos -@ cdecl -arch=i386 __libm_sse2_cosf() msvcrt.__libm_sse2_cosf -@ cdecl -arch=i386 __libm_sse2_exp() msvcrt.__libm_sse2_exp -@ cdecl -arch=i386 __libm_sse2_expf() msvcrt.__libm_sse2_expf -@ cdecl -arch=i386 __libm_sse2_log() msvcrt.__libm_sse2_log -@ cdecl -arch=i386 __libm_sse2_log10() msvcrt.__libm_sse2_log10 -@ cdecl -arch=i386 __libm_sse2_log10f() msvcrt.__libm_sse2_log10f -@ cdecl -arch=i386 __libm_sse2_logf() msvcrt.__libm_sse2_logf -@ cdecl -arch=i386 __libm_sse2_pow() msvcrt.__libm_sse2_pow -@ cdecl -arch=i386 __libm_sse2_powf() msvcrt.__libm_sse2_powf -@ cdecl -arch=i386 __libm_sse2_sin() msvcrt.__libm_sse2_sin -@ cdecl -arch=i386 __libm_sse2_sinf() msvcrt.__libm_sse2_sinf -@ cdecl -arch=i386 __libm_sse2_tan() msvcrt.__libm_sse2_tan -@ cdecl -arch=i386 __libm_sse2_tanf() msvcrt.__libm_sse2_tanf -@ extern __mb_cur_max msvcrt.__mb_cur_max -@ cdecl __p___argc() msvcrt.__p___argc -@ cdecl __p___argv() msvcrt.__p___argv -@ cdecl __p___initenv() msvcrt.__p___initenv -@ cdecl __p___mb_cur_max() msvcrt.__p___mb_cur_max -@ cdecl __p___wargv() msvcrt.__p___wargv -@ cdecl __p___winitenv() msvcrt.__p___winitenv -@ cdecl __p__acmdln() msvcrt.__p__acmdln -@ cdecl __p__commode() msvcrt.__p__commode -@ cdecl __p__daylight() msvcrt.__p__daylight -@ cdecl __p__dstbias() msvcrt.__p__dstbias -@ cdecl __p__environ() msvcrt.__p__environ -@ cdecl __p__fmode() msvcrt.__p__fmode -@ cdecl __p__iob() msvcrt.__p__iob -@ cdecl __p__mbcasemap() msvcrt.__p__mbcasemap -@ cdecl __p__mbctype() msvcrt.__p__mbctype -@ cdecl __p__pctype() msvcrt.__p__pctype -@ cdecl __p__pgmptr() msvcrt.__p__pgmptr -@ cdecl __p__pwctype() msvcrt.__p__pwctype -@ cdecl __p__timezone() msvcrt.__p__timezone -@ cdecl __p__tzname() msvcrt.__p__tzname -@ cdecl __p__wcmdln() msvcrt.__p__wcmdln -@ cdecl __p__wenviron() msvcrt.__p__wenviron -@ cdecl __p__wpgmptr() msvcrt.__p__wpgmptr -@ cdecl __pctype_func() msvcrt.__pctype_func +@ cdecl __lconv_init() +@ 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() +@ extern __mb_cur_max MSVCRT___mb_cur_max +@ cdecl __p___argc() MSVCRT___p___argc +@ cdecl __p___argv() MSVCRT___p___argv +@ cdecl __p___initenv() +@ cdecl __p___mb_cur_max() +@ cdecl __p___wargv() MSVCRT___p___wargv +@ cdecl __p___winitenv() +@ cdecl __p__acmdln() +@ cdecl __p__commode() +@ cdecl __p__daylight() MSVCRT___p__daylight +@ cdecl __p__dstbias() +@ cdecl __p__environ() MSVCRT___p__environ +@ cdecl __p__fmode() +@ cdecl __p__iob() MSVCRT___iob_func +@ stub __p__mbcasemap() +@ cdecl __p__mbctype() +@ cdecl __p__pctype() MSVCRT___p__pctype +@ cdecl __p__pgmptr() MSVCRT___p__pgmptr +@ stub __p__pwctype() +@ cdecl __p__timezone() MSVCRT___p__timezone +@ cdecl __p__tzname() +@ cdecl __p__wcmdln() +@ cdecl __p__wenviron() MSVCRT___p__wenviron +@ cdecl __p__wpgmptr() MSVCRT___p__wpgmptr +@ cdecl __pctype_func() MSVCRT___pctype_func #FIXME: add correct __pioinfo implementation -@ extern __pioinfo msvcrt.__pioinfo +@ extern __pioinfo MSVCRT___pioinfo @ stub __pwctype_func -@ cdecl __pxcptinfoptrs() msvcrt.__pxcptinfoptrs +@ cdecl __pxcptinfoptrs() MSVCRT___pxcptinfoptrs @ stub __report_gsfailure -@ cdecl __set_app_type(long) msvcrt.__set_app_type -@ extern __setlc_active msvcrt.__setlc_active -@ cdecl __setusermatherr(ptr) msvcrt.__setusermatherr +@ cdecl __set_app_type(long) MSVCRT___set_app_type +@ extern __setlc_active MSVCRT___setlc_active +@ cdecl __setusermatherr(ptr) MSVCRT___setusermatherr @ stub __strncnt @ stub __swprintf_l -@ cdecl __sys_errlist() msvcr100.__sys_errlist -@ cdecl __sys_nerr() msvcr100.__sys_nerr -@ cdecl __threadhandle() msvcrt.__threadhandle -@ cdecl __threadid() msvcrt.__threadid -@ cdecl __timezone() msvcrt.__p__timezone -@ cdecl __toascii(long) msvcrt.__toascii -@ cdecl __tzname() msvcrt.__p__tzname -@ cdecl __unDName(ptr str long ptr ptr long) msvcrt.__unDName -@ cdecl __unDNameEx(ptr str long ptr ptr ptr long) msvcrt.__unDNameEx +@ 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) @ stub __unDNameHelper -@ extern __unguarded_readlc_active msvcrt.__unguarded_readlc_active -@ cdecl __vswprintf_l(ptr wstr ptr ptr) msvcrt._vswprintf_l -@ extern __wargv msvcrt.__wargv -@ cdecl __wcserror(wstr) msvcrt.__wcserror -@ cdecl __wcserror_s(ptr long wstr) msvcrt.__wcserror_s +@ extern __unguarded_readlc_active MSVCRT___unguarded_readlc_active +@ cdecl __vswprintf_l(ptr wstr ptr ptr) MSVCRT_vswprintf_l +@ extern __wargv MSVCRT___wargv +@ cdecl __wcserror(wstr) MSVCRT___wcserror +@ cdecl __wcserror_s(ptr long wstr) MSVCRT___wcserror_s @ stub __wcsncnt -@ cdecl __wgetmainargs(ptr ptr ptr long ptr) msvcrt.__wgetmainargs -@ extern __winitenv msvcrt.__winitenv -@ cdecl _abnormal_termination() msvcrt._abnormal_termination -@ cdecl -ret64 _abs64(int64) msvcrt._abs64 -@ cdecl _access(str long) msvcrt._access -@ cdecl _access_s(str long) msvcrt._access_s -@ extern _acmdln msvcrt._acmdln -@ cdecl _aligned_free(ptr) msvcrt._aligned_free -@ cdecl _aligned_malloc(long long) msvcrt._aligned_malloc -@ cdecl _aligned_msize(ptr long long) msvcr100._aligned_msize -@ cdecl _aligned_offset_malloc(long long long) msvcrt._aligned_offset_malloc -@ cdecl _aligned_offset_realloc(ptr long long long) msvcrt._aligned_offset_realloc +@ cdecl __wgetmainargs(ptr ptr ptr long ptr) +@ extern __winitenv MSVCRT___winitenv +@ cdecl _abnormal_termination() +@ cdecl -ret64 _abs64(int64) +@ cdecl _access(str long) MSVCRT__access +@ cdecl _access_s(str long) MSVCRT__access_s +@ extern _acmdln MSVCRT__acmdln +@ 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) msvcrt._aligned_realloc +@ cdecl _aligned_realloc(ptr long long) @ stub _aligned_recalloc -@ cdecl _amsg_exit(long) msvcrt._amsg_exit -@ 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) msvcr100._atoflt -@ cdecl _atoflt_l(ptr str ptr) msvcrt._atoflt_l -@ cdecl -ret64 _atoi64(str) msvcrt._atoi64 +@ cdecl _amsg_exit(long) +@ 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 +@ cdecl _atoi_l(str ptr) MSVCRT__atoi_l @ stub _atol_l -@ cdecl _atoldbl(ptr str) msvcrt._atoldbl +@ cdecl _atoldbl(ptr str) MSVCRT__atoldbl @ stub _atoldbl_l -@ cdecl _beep(long long) msvcrt._beep -@ cdecl _beginthread(ptr long ptr) msvcrt._beginthread -@ cdecl _beginthreadex(ptr long ptr ptr long ptr) msvcrt._beginthreadex -@ cdecl _byteswap_uint64(int64) msvcr100._byteswap_uint64 -@ cdecl _byteswap_ulong(long) msvcr100._byteswap_ulong -@ cdecl _byteswap_ushort(long) msvcr100._byteswap_ushort -@ cdecl _c_exit() msvcrt._c_exit -@ cdecl _cabs(long) msvcrt._cabs -@ cdecl _callnewh(long) msvcrt._callnewh -@ cdecl _calloc_crt(long long) msvcrt.calloc -@ cdecl _cexit() msvcrt._cexit -@ cdecl _cgets(ptr) msvcrt._cgets +@ 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) +@ cdecl _calloc_crt(long long) MSVCRT_calloc +@ 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 -arch=arm,x86_64 _chgsignf(float) msvcrt._chgsignf -@ cdecl -arch=i386 -norelay _chkesp() msvcrt._chkesp -@ cdecl _chmod(str long) msvcrt._chmod -@ cdecl _chsize(long long) msvcrt._chsize -@ cdecl _chsize_s(long int64) msvcrt._chsize_s -@ cdecl _clearfp() msvcrt._clearfp -@ cdecl _close(long) msvcrt._close -@ cdecl _commit(long) msvcrt._commit -@ extern _commode msvcrt._commode -@ cdecl _configthreadlocale(long) msvcrt._configthreadlocale -@ cdecl _control87(long long) msvcrt._control87 -@ cdecl _controlfp(long long) msvcrt._controlfp -@ cdecl _controlfp_s(ptr long long) msvcrt._controlfp_s -@ cdecl _copysign(double double) msvcrt._copysign -@ cdecl -arch=arm,x86_64 _copysignf(float float) msvcrt._copysignf -@ varargs _cprintf(str) msvcrt._cprintf +@ cdecl _chdir(str) MSVCRT__chdir +@ cdecl _chdrive(long) MSVCRT__chdrive +@ cdecl _chgsign(double) MSVCRT__chgsign +@ cdecl -arch=arm,x86_64 _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 +@ extern _commode MSVCRT__commode +@ cdecl _configthreadlocale(long) +@ cdecl _control87(long long) +@ cdecl _controlfp(long long) +@ cdecl _controlfp_s(ptr long long) +@ cdecl _copysign(double double) MSVCRT__copysign +@ cdecl -arch=arm,x86_64 _copysignf(float float) MSVCRT__copysignf +@ varargs _cprintf(str) @ stub _cprintf_l @ stub _cprintf_p @ stub _cprintf_p_l @ stub _cprintf_s @ stub _cprintf_s_l -@ cdecl _cputs(str) msvcrt._cputs -@ cdecl _cputws(wstr) msvcrt._cputws -@ cdecl _creat(str long) msvcrt._creat -@ cdecl _create_locale(long str) msvcrt._create_locale +@ cdecl _cputs(str) +@ cdecl _cputws(wstr) +@ cdecl _creat(str long) MSVCRT__creat +@ cdecl _create_locale(long str) MSVCRT__create_locale @ stub -arch=i386 _crt_debugger_hook @ stub -arch=arm,win64 __crt_debugger_hook -@ varargs _cscanf(str) msvcrt._cscanf -@ varargs _cscanf_l(str ptr) msvcrt._cscanf_l -@ varargs _cscanf_s(str) msvcrt._cscanf_s -@ varargs _cscanf_s_l(str ptr) msvcrt._cscanf_s_l -@ 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) msvcrt._cwait -@ varargs _cwprintf(wstr) msvcrt._cwprintf +@ varargs _cscanf(str) +@ varargs _cscanf_l(str ptr) +@ varargs _cscanf_s(str) +@ varargs _cscanf_s_l(str ptr) +@ 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) +@ varargs _cwprintf(wstr) @ stub _cwprintf_l @ stub _cwprintf_p @ stub _cwprintf_p_l @ stub _cwprintf_s @ stub _cwprintf_s_l -@ varargs _cwscanf(wstr) msvcrt._cwscanf -@ varargs _cwscanf_l(wstr ptr) msvcrt._cwscanf_l -@ varargs _cwscanf_s(wstr) msvcrt._cwscanf_s -@ varargs _cwscanf_s_l(wstr ptr) msvcrt._cwscanf_s_l -@ extern _daylight msvcrt._daylight -@ cdecl _difftime32(long long) msvcrt._difftime32 -@ cdecl _difftime64(long long) msvcrt._difftime64 +@ varargs _cwscanf(wstr) +@ varargs _cwscanf_l(wstr ptr) +@ varargs _cwscanf_s(wstr) +@ varargs _cwscanf_s_l(wstr ptr) +@ extern _daylight MSVCRT___daylight +@ cdecl _difftime32(long long) MSVCRT__difftime32 +@ cdecl _difftime64(long long) MSVCRT__difftime64 @ stub _dosmaperr -@ extern _dstbias msvcrt._dstbias -@ cdecl _dup(long) msvcrt._dup -@ cdecl _dup2(long long) msvcrt._dup2 -@ cdecl _dupenv_s(ptr ptr str) msvcrt._dupenv_s -@ cdecl _ecvt(double long ptr ptr) msvcrt._ecvt -@ cdecl _ecvt_s(str long double long ptr ptr) msvcrt._ecvt_s -@ cdecl _endthread() msvcrt._endthread -@ cdecl _endthreadex(long) msvcrt._endthreadex -@ extern _environ msvcrt._environ -@ cdecl _eof(long) msvcrt._eof -@ cdecl _errno() msvcrt._errno -@ cdecl -arch=i386 _except_handler2(ptr ptr ptr ptr) msvcrt._except_handler2 -@ cdecl -arch=i386 _except_handler3(ptr ptr ptr ptr) msvcrt._except_handler3 -@ cdecl -arch=i386 _except_handler4_common(ptr ptr ptr ptr ptr ptr) msvcrt._except_handler4_common -@ varargs _execl(str str) msvcrt._execl -@ varargs _execle(str str) msvcrt._execle -@ varargs _execlp(str str) msvcrt._execlp -@ varargs _execlpe(str str) msvcrt._execlpe -@ cdecl _execv(str ptr) msvcrt._execv -@ cdecl _execve(str ptr ptr) msvcrt._execve -@ cdecl _execvp(str ptr) msvcrt._execvp -@ cdecl _execvpe(str ptr ptr) msvcrt._execvpe -@ cdecl _exit(long) msvcrt._exit -@ cdecl _expand(ptr long) msvcrt._expand +@ extern _dstbias MSVCRT__dstbias +@ 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) +@ extern _environ MSVCRT__environ +@ cdecl _eof(long) MSVCRT__eof +@ cdecl _errno() MSVCRT__errno +@ 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) +@ 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) @ stub _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 -@ cdecl _fdopen(long str) msvcrt._fdopen +@ cdecl _fcloseall() MSVCRT__fcloseall +@ cdecl _fcvt(double long ptr ptr) MSVCRT__fcvt +@ cdecl _fcvt_s(ptr long double long ptr ptr) MSVCRT__fcvt_s +@ cdecl _fdopen(long str) MSVCRT__fdopen @ stub _fflush_nolock -@ cdecl _fgetchar() msvcrt._fgetchar +@ cdecl _fgetchar() MSVCRT__fgetchar @ stub _fgetwc_nolock -@ cdecl _fgetwchar() msvcrt._fgetwchar -@ cdecl _filbuf(ptr) msvcrt._filbuf -@ 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 +@ cdecl _fgetwchar() MSVCRT__fgetwchar +@ cdecl _filbuf(ptr) MSVCRT__filbuf +@ 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 +@ 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 _flsbuf(long ptr) msvcrt._flsbuf -@ cdecl _flushall() msvcrt._flushall -@ extern _fmode msvcrt._fmode -@ cdecl _fpclass(double) msvcrt._fpclass +@ 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 _flsbuf(long ptr) MSVCRT__flsbuf +@ cdecl _flushall() MSVCRT__flushall +@ extern _fmode MSVCRT__fmode +@ cdecl _fpclass(double) MSVCRT__fpclass # stub -arch=x86_64 _fpclassf -@ cdecl _fpieee_flt(long ptr ptr) msvcrt._fpieee_flt -@ cdecl _fpreset() msvcrt._fpreset +@ stub _fpieee_flt(long ptr ptr) +@ cdecl _fpreset() @ stub _fprintf_l @ stub _fprintf_p @ stub _fprintf_p_l @ stub _fprintf_s_l -@ cdecl _fputchar(long) msvcrt._fputchar +@ cdecl _fputchar(long) MSVCRT__fputchar @ stub _fputwc_nolock -@ cdecl _fputwchar(long) msvcrt._fputwchar +@ cdecl _fputwchar(long) MSVCRT__fputwchar @ stub _fread_nolock @ stub _fread_nolock_s -@ cdecl _free_locale(ptr) msvcrt._free_locale +@ cdecl _free_locale(ptr) MSVCRT__free_locale @ stub _freea @ stub _freea_s @ stub _freefls -@ varargs _fscanf_l(ptr str ptr) msvcrt._fscanf_l -@ varargs _fscanf_s_l(ptr str ptr) msvcrt._fscanf_s_l +@ varargs _fscanf_l(ptr str ptr) MSVCRT__fscanf_l +@ varargs _fscanf_s_l(ptr str ptr) MSVCRT__fscanf_s_l @ stub _fseek_nolock -@ cdecl _fseeki64(ptr int64 long) msvcrt._fseeki64 +@ cdecl _fseeki64(ptr int64 long) MSVCRT__fseeki64 @ stub _fseeki64_nolock -@ cdecl _fsopen(str str long) msvcrt._fsopen -@ cdecl _fstat32(long ptr) msvcrt._fstat32 +@ 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 _fstat64(long ptr) MSVCRT__fstat64 +@ cdecl _fstat64i32(long ptr) MSVCRT__fstat64i32 @ stub _ftell_nolock -@ cdecl -ret64 _ftelli64(ptr) msvcrt._ftelli64 +@ cdecl -ret64 _ftelli64(ptr) MSVCRT__ftelli64 @ stub _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) msvcrt._futime32 -@ cdecl _futime64(long ptr) msvcrt._futime64 -@ varargs _fwprintf_l(ptr wstr ptr) msvcrt._fwprintf_l +@ 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) +@ varargs _fwprintf_l(ptr wstr ptr) MSVCRT__fwprintf_l @ stub _fwprintf_p @ stub _fwprintf_p_l @ stub _fwprintf_s_l @ stub _fwrite_nolock -@ varargs _fwscanf_l(ptr wstr ptr) msvcrt._fwscanf_l -@ varargs _fwscanf_s_l(ptr wstr ptr) msvcrt._fwscanf_s_l -@ cdecl _gcvt(double long str) msvcrt._gcvt -@ cdecl _gcvt_s(ptr long double long) msvcrt._gcvt_s -@ cdecl _get_current_locale() msvcrt._get_current_locale -@ cdecl _get_daylight(ptr) msvcr100._get_daylight -@ cdecl _get_doserrno(ptr) msvcrt._get_doserrno +@ varargs _fwscanf_l(ptr wstr ptr) MSVCRT__fwscanf_l +@ varargs _fwscanf_s_l(ptr wstr ptr) MSVCRT__fwscanf_s_l +@ cdecl _gcvt(double long str) MSVCRT__gcvt +@ cdecl _gcvt_s(ptr long double long) MSVCRT__gcvt_s +@ cdecl _get_current_locale() MSVCRT__get_current_locale +@ cdecl _get_daylight(ptr) +@ cdecl _get_doserrno(ptr) @ stub _get_dstbias -@ cdecl _get_errno(ptr) msvcrt._get_errno -@ cdecl _get_fmode(ptr) msvcrt._get_fmode -@ cdecl _get_heap_handle() msvcrt._get_heap_handle -@ cdecl _get_invalid_parameter_handler() msvcrt._get_invalid_parameter_handler -@ cdecl _get_osfhandle(long) msvcrt._get_osfhandle -@ cdecl _get_output_format() msvcrt._get_output_format -@ cdecl _get_pgmptr(ptr) msvcrt._get_pgmptr -@ cdecl _get_printf_count_output() msvcrt._get_printf_count_output +@ cdecl _get_errno(ptr) +@ cdecl _get_fmode(ptr) MSVCRT__get_fmode +@ cdecl _get_heap_handle() +@ cdecl _get_invalid_parameter_handler() +@ cdecl _get_osfhandle(long) MSVCRT__get_osfhandle +@ cdecl _get_output_format() MSVCRT__get_output_format +@ cdecl _get_pgmptr(ptr) +@ cdecl _get_printf_count_output() MSVCRT__get_printf_count_output @ stub _get_purecall_handler -@ cdecl _get_terminate() msvcrt._get_terminate -@ cdecl _get_timezone(ptr) msvcr100._get_timezone -@ cdecl _get_tzname(ptr str long long) msvcrt._get_tzname -@ cdecl _get_unexpected() msvcrt._get_unexpected -@ cdecl _get_wpgmptr(ptr) msvcrt._get_wpgmptr +@ cdecl _get_terminate() MSVCRT__get_terminate +@ cdecl _get_timezone(ptr) +@ cdecl _get_tzname(ptr str long long) MSVCRT__get_tzname +@ cdecl _get_unexpected() MSVCRT__get_unexpected +@ cdecl _get_wpgmptr(ptr) @ stub _getc_nolock -@ cdecl _getch() msvcrt._getch +@ cdecl _getch() @ stub _getch_nolock -@ cdecl _getche() msvcrt._getche +@ cdecl _getche() @ stub _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) msvcrt._getdllprocaddr -@ cdecl _getdrive() msvcrt._getdrive -@ cdecl _getdrives() msvcrt._getdrives -@ cdecl _getmaxstdio() msvcrt._getmaxstdio -@ cdecl _getmbcp() msvcrt._getmbcp -@ cdecl _getpid() msvcrt._getpid -@ cdecl _getptd() msvcrt._getptd -@ cdecl _getsystime(ptr) msvcrt._getsystime -@ cdecl _getw(ptr) msvcrt._getw +@ 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 +@ cdecl _getptd() +@ stub _getsystime(ptr) +@ cdecl _getw(ptr) MSVCRT__getw @ stub _getwch @ stub _getwch_nolock @ stub _getwche @ stub _getwche_nolock -@ cdecl _getws(ptr) msvcrt._getws +@ cdecl _getws(ptr) MSVCRT__getws @ stub _getws_s -@ cdecl -arch=i386 _global_unwind2(ptr) msvcrt._global_unwind2 -@ 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 _heapadd(ptr long) msvcrt._heapadd -@ cdecl _heapchk() msvcrt._heapchk -@ cdecl _heapmin() msvcrt._heapmin -@ cdecl _heapset(long) msvcrt._heapset -@ cdecl _heapused(ptr ptr) msvcrt._heapused -@ cdecl _heapwalk(ptr) msvcrt._heapwalk -@ cdecl _hypot(double double) msvcrt._hypot -@ cdecl _hypotf(float float) msvcrt._hypotf -@ cdecl _i64toa(int64 ptr long) msvcrt._i64toa -@ cdecl _i64toa_s(int64 ptr long long) msvcrt._i64toa_s -@ cdecl _i64tow(int64 ptr long) msvcrt._i64tow -@ cdecl _i64tow_s(int64 ptr long long) msvcrt._i64tow_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 _heapadd(ptr long) +@ cdecl _heapchk() +@ cdecl _heapmin() +@ cdecl _heapset(long) +@ stub _heapused(ptr ptr) +@ 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 @ stub _initptd -@ cdecl _initterm(ptr ptr) msvcrt._initterm -@ cdecl _initterm_e(ptr ptr) msvcrt._initterm_e -@ cdecl -arch=i386 _inp(long) msvcrt._inp -@ cdecl -arch=i386 _inpd(long) msvcrt._inpd -@ cdecl -arch=i386 _inpw(long) msvcrt._inpw -@ cdecl _invalid_parameter(wstr wstr wstr long long) msvcrt._invalid_parameter -@ cdecl _invalid_parameter_noinfo() msvcr100._invalid_parameter_noinfo +@ cdecl _initterm(ptr ptr) +@ cdecl _initterm_e(ptr ptr) +@ stub -arch=i386 _inp(long) +@ stub -arch=i386 _inpd(long) +@ stub -arch=i386 _inpw(long) +@ cdecl _invalid_parameter(wstr wstr wstr long long) MSVCRT__invalid_parameter +@ cdecl _invalid_parameter_noinfo() @ stub _invalid_parameter_noinfo_noreturn @ stub _invoke_watson -@ extern _iob msvcrt._iob -@ cdecl _isalnum_l(long ptr) msvcrt._isalnum_l -@ cdecl _isalpha_l(long ptr) msvcrt._isalpha_l -@ cdecl _isatty(long) msvcrt._isatty -@ 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 -@ cdecl _ismbbalnum(long) msvcrt._ismbbalnum +@ extern _iob MSVCRT__iob +@ cdecl _isalnum_l(long ptr) MSVCRT__isalnum_l +@ cdecl _isalpha_l(long ptr) MSVCRT__isalpha_l +@ cdecl _isatty(long) MSVCRT__isatty +@ 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 -@ cdecl _ismbbalpha(long) msvcrt._ismbbalpha +@ stub _ismbbalpha(long) @ stub _ismbbalpha_l -@ cdecl _ismbbgraph(long) msvcrt._ismbbgraph +@ stub _ismbbgraph(long) @ stub _ismbbgraph_l -@ cdecl _ismbbkalnum(long) msvcrt._ismbbkalnum +@ stub _ismbbkalnum(long) @ stub _ismbbkalnum_l -@ cdecl _ismbbkana(long) msvcrt._ismbbkana +@ cdecl _ismbbkana(long) @ stub _ismbbkana_l -@ cdecl _ismbbkprint(long) msvcrt._ismbbkprint +@ stub _ismbbkprint(long) @ stub _ismbbkprint_l -@ cdecl _ismbbkpunct(long) msvcrt._ismbbkpunct +@ stub _ismbbkpunct(long) @ stub _ismbbkpunct_l -@ cdecl _ismbblead(long) msvcrt._ismbblead +@ cdecl _ismbblead(long) @ stub _ismbblead_l -@ cdecl _ismbbprint(long) msvcrt._ismbbprint +@ stub _ismbbprint(long) @ stub _ismbbprint_l -@ cdecl _ismbbpunct(long) msvcrt._ismbbpunct +@ stub _ismbbpunct(long) @ stub _ismbbpunct_l -@ cdecl _ismbbtrail(long) msvcrt._ismbbtrail +@ cdecl _ismbbtrail(long) @ stub _ismbbtrail_l -@ cdecl _ismbcalnum(long) msvcrt._ismbcalnum +@ cdecl _ismbcalnum(long) @ stub _ismbcalnum_l -@ cdecl _ismbcalpha(long) msvcrt._ismbcalpha +@ cdecl _ismbcalpha(long) @ stub _ismbcalpha_l -@ cdecl _ismbcdigit(long) msvcrt._ismbcdigit +@ cdecl _ismbcdigit(long) @ stub _ismbcdigit_l -@ cdecl _ismbcgraph(long) msvcrt._ismbcgraph +@ cdecl _ismbcgraph(long) @ stub _ismbcgraph_l -@ cdecl _ismbchira(long) msvcrt._ismbchira +@ cdecl _ismbchira(long) @ stub _ismbchira_l -@ cdecl _ismbckata(long) msvcrt._ismbckata +@ cdecl _ismbckata(long) @ stub _ismbckata_l -@ cdecl _ismbcl0(long) msvcrt._ismbcl0 +@ stub _ismbcl0(long) @ stub _ismbcl0_l -@ cdecl _ismbcl1(long) msvcrt._ismbcl1 +@ stub _ismbcl1(long) @ stub _ismbcl1_l -@ cdecl _ismbcl2(long) msvcrt._ismbcl2 +@ stub _ismbcl2(long) @ stub _ismbcl2_l -@ cdecl _ismbclegal(long) msvcrt._ismbclegal +@ cdecl _ismbclegal(long) @ stub _ismbclegal_l -@ cdecl _ismbclower(long) msvcrt._ismbclower +@ stub _ismbclower(long) @ stub _ismbclower_l -@ cdecl _ismbcprint(long) msvcrt._ismbcprint +@ stub _ismbcprint(long) @ stub _ismbcprint_l -@ cdecl _ismbcpunct(long) msvcrt._ismbcpunct +@ cdecl _ismbcpunct(long) @ stub _ismbcpunct_l -@ cdecl _ismbcspace(long) msvcrt._ismbcspace +@ cdecl _ismbcspace(long) @ stub _ismbcspace_l -@ cdecl _ismbcsymbol(long) msvcrt._ismbcsymbol +@ cdecl _ismbcsymbol(long) @ stub _ismbcsymbol_l -@ cdecl _ismbcupper(long) msvcrt._ismbcupper +@ cdecl _ismbcupper(long) @ stub _ismbcupper_l -@ cdecl _ismbslead(ptr ptr) msvcrt._ismbslead +@ cdecl _ismbslead(ptr ptr) @ stub _ismbslead_l -@ cdecl _ismbstrail(ptr ptr) msvcrt._ismbstrail +@ 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 +@ 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 +@ 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 +@ cdecl _iswalpha_l(long ptr) MSVCRT__iswalpha_l @ stub _iswcntrl_l @ stub _iswcsym_l @ stub _iswcsymf_l @ stub _iswctype_l -@ cdecl _iswdigit_l(long ptr) msvcrt._iswdigit_l +@ cdecl _iswdigit_l(long ptr) MSVCRT__iswdigit_l @ stub _iswgraph_l @ stub _iswlower_l @ stub _iswprint_l @@ -1374,413 +1374,413 @@ @ stub _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) msvcrt._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() msvcrt._kbhit -@ cdecl _lfind(ptr ptr ptr long ptr) msvcrt._lfind +@ 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() +@ cdecl _lfind(ptr ptr ptr long ptr) @ stub _lfind_s -@ cdecl -arch=i386 _libm_sse2_acos_precise() msvcrt.__libm_sse2_acos -@ cdecl -arch=i386 _libm_sse2_asin_precise() msvcrt.__libm_sse2_asin -@ cdecl -arch=i386 _libm_sse2_atan_precise() msvcrt.__libm_sse2_atan -@ cdecl -arch=i386 _libm_sse2_cos_precise() msvcrt.__libm_sse2_cos -@ cdecl -arch=i386 _libm_sse2_exp_precise() msvcrt.__libm_sse2_exp -@ cdecl -arch=i386 _libm_sse2_log10_precise() msvcrt.__libm_sse2_log10 -@ cdecl -arch=i386 _libm_sse2_log_precise() msvcrt.__libm_sse2_log -@ cdecl -arch=i386 _libm_sse2_pow_precise() msvcrt.__libm_sse2_pow -@ cdecl -arch=i386 _libm_sse2_sin_precise() msvcrt.__libm_sse2_sin -@ cdecl -arch=i386 _libm_sse2_sqrt_precise() msvcrt.__libm_sse2_sqrt_precise -@ cdecl -arch=i386 _libm_sse2_tan_precise() msvcrt.__libm_sse2_tan -@ cdecl _loaddll(str) msvcrt._loaddll -@ cdecl -arch=x86_64 _local_unwind(ptr ptr) msvcrt._local_unwind -@ cdecl -arch=i386 _local_unwind2(ptr long) msvcrt._local_unwind2 -@ cdecl -arch=i386 _local_unwind4(ptr ptr long) msvcrt._local_unwind4 -@ cdecl _localtime32(ptr) msvcrt._localtime32 -@ cdecl _localtime32_s(ptr ptr) msvcrt._localtime32_s -@ cdecl _localtime64(ptr) msvcrt._localtime64 -@ cdecl _localtime64_s(ptr ptr) msvcrt._localtime64_s -@ cdecl _lock(long) msvcrt._lock -@ cdecl _lock_file(ptr) msvcrt._lock_file -@ 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._longjmpex -@ cdecl _lrotl(long long) msvcrt._lrotl -@ cdecl _lrotr(long long) msvcrt._lrotr -@ cdecl _lsearch(ptr ptr ptr long ptr) msvcrt._lsearch +@ 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(long) +@ cdecl _lock_file(ptr) MSVCRT__lock_file +@ 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) msvcrt._ltoa -@ cdecl _ltoa_s(long ptr long long) msvcrt._ltoa_s -@ cdecl _ltow(long ptr long) msvcrt._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 -@ cdecl _malloc_crt(long) msvcrt.malloc -@ cdecl _mbbtombc(long) msvcrt._mbbtombc +@ 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 +@ cdecl _malloc_crt(long) MSVCRT_malloc +@ cdecl _mbbtombc(long) @ stub _mbbtombc_l -@ cdecl _mbbtype(long long) msvcrt._mbbtype +@ cdecl _mbbtype(long long) @ stub _mbbtype_l # extern _mbcasemap -@ cdecl _mbccpy(ptr str) msvcrt._mbccpy +@ cdecl _mbccpy(ptr str) @ stub _mbccpy_l @ stub _mbccpy_s @ stub _mbccpy_s_l -@ cdecl _mbcjistojms(long) msvcrt._mbcjistojms +@ cdecl _mbcjistojms(long) @ stub _mbcjistojms_l -@ cdecl _mbcjmstojis(long) msvcrt._mbcjmstojis +@ cdecl _mbcjmstojis(long) @ stub _mbcjmstojis_l -@ cdecl _mbclen(ptr) msvcrt._mbclen +@ cdecl _mbclen(ptr) @ stub _mbclen_l -@ cdecl _mbctohira(long) msvcrt._mbctohira +@ stub _mbctohira(long) @ stub _mbctohira_l -@ cdecl _mbctokata(long) msvcrt._mbctokata +@ stub _mbctokata(long) @ stub _mbctokata_l -@ cdecl _mbctolower(long) msvcrt._mbctolower +@ cdecl _mbctolower(long) @ stub _mbctolower_l -@ cdecl _mbctombb(long) msvcrt._mbctombb +@ cdecl _mbctombb(long) @ stub _mbctombb_l -@ cdecl _mbctoupper(long) msvcrt._mbctoupper +@ cdecl _mbctoupper(long) @ stub _mbctoupper_l -@ extern _mbctype msvcrt._mbctype +@ extern _mbctype MSVCRT_mbctype @ stub _mblen_l -@ cdecl _mbsbtype(str long) msvcrt._mbsbtype +@ cdecl _mbsbtype(str long) @ stub _mbsbtype_l @ stub _mbscat_s @ stub _mbscat_s_l -@ cdecl _mbschr(str long) msvcrt._mbschr +@ cdecl _mbschr(str long) @ stub _mbschr_l -@ cdecl _mbscmp(str str) msvcrt._mbscmp +@ cdecl _mbscmp(str str) @ stub _mbscmp_l -@ cdecl _mbscoll(str str) msvcrt._mbscoll -@ cdecl _mbscoll_l(str str ptr) msvcrt._mbscoll_l +@ cdecl _mbscoll(str str) +@ cdecl _mbscoll_l(str str ptr) @ stub _mbscpy_s @ stub _mbscpy_s_l -@ cdecl _mbscspn(str str) msvcrt._mbscspn +@ cdecl _mbscspn(str str) @ stub _mbscspn_l -@ cdecl _mbsdec(ptr ptr) msvcrt._mbsdec +@ cdecl _mbsdec(ptr ptr) @ stub _mbsdec_l -@ cdecl _mbsicmp(str str) msvcrt._mbsicmp +@ cdecl _mbsicmp(str str) @ stub _mbsicmp_l -@ cdecl _mbsicoll(str str) msvcrt._mbsicoll -@ cdecl _mbsicoll_l(str str ptr) msvcrt._mbsicoll_l -@ cdecl _mbsinc(str) msvcrt._mbsinc +@ cdecl _mbsicoll(str str) +@ cdecl _mbsicoll_l(str str ptr) +@ cdecl _mbsinc(str) @ stub _mbsinc_l -@ cdecl _mbslen(str) msvcrt._mbslen +@ cdecl _mbslen(str) @ stub _mbslen_l -@ cdecl _mbslwr(str) msvcrt._mbslwr +@ cdecl _mbslwr(str) @ stub _mbslwr_l -@ cdecl _mbslwr_s(str long) msvcrt._mbslwr_s +@ cdecl _mbslwr_s(str long) @ stub _mbslwr_s_l -@ cdecl _mbsnbcat(str str long) msvcrt._mbsnbcat +@ cdecl _mbsnbcat(str str long) @ stub _mbsnbcat_l -@ cdecl _mbsnbcat_s(str long ptr long) msvcrt._mbsnbcat_s +@ cdecl _mbsnbcat_s(str long ptr long) @ stub _mbsnbcat_s_l -@ cdecl _mbsnbcmp(str str long) msvcrt._mbsnbcmp +@ cdecl _mbsnbcmp(str str long) @ stub _mbsnbcmp_l -@ cdecl _mbsnbcnt(ptr long) msvcrt._mbsnbcnt +@ cdecl _mbsnbcnt(ptr long) @ stub _mbsnbcnt_l -@ cdecl _mbsnbcoll(str str long) msvcrt._mbsnbcoll -@ cdecl _mbsnbcoll_l(str str long ptr) msvcrt._mbsnbcoll_l -@ cdecl _mbsnbcpy(ptr str long) msvcrt._mbsnbcpy +@ 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) msvcrt._mbsnbcpy_s +@ cdecl _mbsnbcpy_s(ptr long str long) @ stub _mbsnbcpy_s_l -@ cdecl _mbsnbicmp(str str long) msvcrt._mbsnbicmp +@ cdecl _mbsnbicmp(str str long) @ stub _mbsnbicmp_l -@ cdecl _mbsnbicoll(str str long) msvcrt._mbsnbicoll -@ cdecl _mbsnbicoll_l(str str long ptr) msvcrt._mbsnbicoll_l -@ cdecl _mbsnbset(ptr long long) msvcrt._mbsnbset +@ 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) msvcrt._mbsncat +@ cdecl _mbsncat(str str long) @ stub _mbsncat_l @ stub _mbsncat_s @ stub _mbsncat_s_l -@ cdecl _mbsnccnt(str long) msvcrt._mbsnccnt +@ cdecl _mbsnccnt(str long) @ stub _mbsnccnt_l -@ cdecl _mbsncmp(str str long) msvcrt._mbsncmp +@ cdecl _mbsncmp(str str long) @ stub _mbsncmp_l -@ cdecl _mbsncoll(str str long) msvcrt._mbsncoll +@ stub _mbsncoll(str str long) @ stub _mbsncoll_l -@ cdecl _mbsncpy(ptr str long) msvcrt._mbsncpy +@ cdecl _mbsncpy(ptr str long) @ stub _mbsncpy_l @ stub _mbsncpy_s @ stub _mbsncpy_s_l -@ cdecl _mbsnextc(str) msvcrt._mbsnextc +@ cdecl _mbsnextc(str) @ stub _mbsnextc_l -@ cdecl _mbsnicmp(str str long) msvcrt._mbsnicmp +@ cdecl _mbsnicmp(str str long) @ stub _mbsnicmp_l -@ cdecl _mbsnicoll(str str long) msvcrt._mbsnicoll +@ stub _mbsnicoll(str str long) @ stub _mbsnicoll_l -@ cdecl _mbsninc(str long) msvcrt._mbsninc +@ cdecl _mbsninc(str long) @ stub _mbsninc_l @ stub _mbsnlen @ stub _mbsnlen_l -@ cdecl _mbsnset(ptr long long) msvcrt._mbsnset +@ cdecl _mbsnset(ptr long long) @ stub _mbsnset_l @ stub _mbsnset_s @ stub _mbsnset_s_l -@ cdecl _mbspbrk(str str) msvcrt._mbspbrk +@ cdecl _mbspbrk(str str) @ stub _mbspbrk_l -@ cdecl _mbsrchr(str long) msvcrt._mbsrchr +@ cdecl _mbsrchr(str long) @ stub _mbsrchr_l -@ cdecl _mbsrev(str) msvcrt._mbsrev +@ cdecl _mbsrev(str) @ stub _mbsrev_l -@ cdecl _mbsset(ptr long) msvcrt._mbsset +@ cdecl _mbsset(ptr long) @ stub _mbsset_l @ stub _mbsset_s @ stub _mbsset_s_l -@ cdecl _mbsspn(str str) msvcrt._mbsspn +@ cdecl _mbsspn(str str) @ stub _mbsspn_l -@ cdecl _mbsspnp(str str) msvcrt._mbsspnp +@ cdecl _mbsspnp(str str) @ stub _mbsspnp_l -@ cdecl _mbsstr(str str) msvcrt._mbsstr +@ cdecl _mbsstr(str str) @ stub _mbsstr_l -@ cdecl _mbstok(str str) msvcr100._mbstok #don't forward to msvcrt -@ cdecl _mbstok_l(str str ptr) msvcrt._mbstok_l -@ cdecl _mbstok_s(str str ptr) msvcrt._mbstok_s -@ cdecl _mbstok_s_l(str str ptr ptr) msvcrt._mbstok_s_l -@ 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) msvcrt._mbstrlen -@ cdecl _mbstrlen_l(str ptr) msvcrt._mbstrlen_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) msvcrt._mbsupr +@ cdecl _mbsupr(str) @ stub _mbsupr_l -@ cdecl _mbsupr_s(str long) msvcrt._mbsupr_s +@ 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) msvcrt._memccpy -@ cdecl _memicmp(str str long) msvcrt._memicmp +@ 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) msvcrt._msize -@ cdecl _nextafter(double double) msvcrt._nextafter -@ cdecl -arch=arm,x86_64 _nextafterf(float float) msvcrt._nextafterf -@ cdecl _onexit(ptr) msvcrt._onexit -@ varargs _open(str long) msvcrt._open -@ cdecl _open_osfhandle(long long) msvcrt._open_osfhandle -@ cdecl -arch=i386 _outp(long long) msvcrt._outp -@ cdecl -arch=i386 _outpd(long long) msvcrt._outpd -@ cdecl -arch=i386 _outpw(long long) msvcrt._outpw -@ cdecl _pclose(ptr) msvcrt._pclose -@ extern _pctype msvcrt._pctype -@ extern _pgmptr msvcrt._pgmptr -@ cdecl _pipe(ptr long long) msvcrt._pipe -@ cdecl _popen(str str) msvcrt._popen +@ 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 +@ cdecl _onexit(ptr) MSVCRT__onexit +@ varargs _open(str long) MSVCRT__open +@ cdecl _open_osfhandle(long long) MSVCRT__open_osfhandle +@ stub -arch=i386 _outp(long long) +@ stub -arch=i386 _outpd(long long) +@ stub -arch=i386 _outpw(long long) +@ cdecl _pclose(ptr) MSVCRT__pclose +@ extern _pctype MSVCRT__pctype +@ extern _pgmptr MSVCRT__pgmptr +@ cdecl _pipe(ptr long long) MSVCRT__pipe +@ cdecl _popen(str str) MSVCRT__popen @ stub _printf_l @ stub _printf_p @ stub _printf_p_l @ stub _printf_s_l -@ cdecl _purecall() msvcrt._purecall -@ cdecl _putch(long) msvcrt._putch +@ cdecl _purecall() +@ cdecl _putch(long) @ stub _putch_nolock -@ cdecl _putenv(str) msvcrt._putenv -@ cdecl _putenv_s(str str) msvcrt._putenv_s -@ cdecl _putw(long ptr) msvcrt._putw -@ cdecl _putwch(long) msvcrt._putwch +@ cdecl _putenv(str) +@ cdecl _putenv_s(str str) +@ cdecl _putw(long ptr) MSVCRT__putw +@ cdecl _putwch(long) MSVCRT__putwch @ stub _putwch_nolock -@ cdecl _putws(wstr) msvcrt._putws +@ cdecl _putws(wstr) MSVCRT__putws # extern _pwctype -@ cdecl _read(long ptr long) msvcrt._read -@ cdecl _realloc_crt(ptr long) msvcrt.realloc -@ cdecl _recalloc(ptr long long) msvcr100._recalloc +@ cdecl _read(long ptr long) MSVCRT__read +@ cdecl _realloc_crt(ptr long) MSVCRT_realloc +@ cdecl _recalloc(ptr long long) @ stub _recalloc_crt -@ cdecl _resetstkoflw() msvcrt._resetstkoflw -@ cdecl _rmdir(str) msvcrt._rmdir -@ cdecl _rmtmp() msvcrt._rmtmp -@ cdecl _rotl(long long) msvcrt._rotl -@ cdecl -ret64 _rotl64(int64 long) msvcrt._rotl64 -@ cdecl _rotr(long long) msvcrt._rotr -@ cdecl -ret64 _rotr64(int64 long) msvcrt._rotr64 -@ cdecl _scalb(double long) msvcrt._scalb -@ cdecl -arch=arm,x86_64 _scalbf(float long) msvcrt._scalbf -@ varargs _scanf_l(str ptr) msvcrt._scanf_l -@ varargs _scanf_s_l(str ptr) msvcrt._scanf_s_l -@ varargs _scprintf(str) msvcrt._scprintf +@ 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 +@ varargs _scanf_l(str ptr) MSVCRT__scanf_l +@ varargs _scanf_s_l(str ptr) MSVCRT__scanf_s_l +@ varargs _scprintf(str) MSVCRT__scprintf @ stub _scprintf_l @ stub _scprintf_p @ stub _scprintf_p_l -@ varargs _scwprintf(wstr) msvcrt._scwprintf +@ varargs _scwprintf(wstr) MSVCRT__scwprintf @ stub _scwprintf_l @ stub _scwprintf_p @ stub _scwprintf_p_l -@ cdecl _searchenv(str str ptr) msvcrt._searchenv -@ cdecl _searchenv_s(str str ptr long) msvcrt._searchenv_s -@ stdcall -arch=i386 _seh_longjmp_unwind4(ptr) msvcrt._seh_longjmp_unwind4 -@ stdcall -arch=i386 _seh_longjmp_unwind(ptr) msvcrt._seh_longjmp_unwind -@ cdecl -arch=i386 __set_SSE2_enable(long) msvcrt._set_SSE2_enable -@ cdecl _set_abort_behavior(long long) msvcrt._set_abort_behavior -@ cdecl _set_controlfp(long long) msvcrt._set_controlfp -@ cdecl _set_doserrno(long) msvcrt._set_doserrno -@ cdecl _set_errno(long) msvcrt._set_errno -@ cdecl _set_error_mode(long) msvcrt._set_error_mode -@ cdecl _set_fmode(long) msvcrt._set_fmode -@ cdecl _set_invalid_parameter_handler(ptr) msvcrt._set_invalid_parameter_handler +@ cdecl _searchenv(str str ptr) MSVCRT__searchenv +@ cdecl _searchenv_s(str str ptr long) MSVCRT__searchenv_s +@ 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_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) @ stub _set_malloc_crt_max_wait -@ cdecl _set_output_format(long) msvcrt._set_output_format -@ cdecl _set_printf_count_output(long) msvcrt._set_printf_count_output -@ cdecl _set_purecall_handler(ptr) msvcrt._set_purecall_handler -@ cdecl _seterrormode(long) msvcrt._seterrormode -@ cdecl -arch=i386,x86_64,arm -norelay _setjmp(ptr) msvcrt._setjmp -@ cdecl -arch=i386 -norelay _setjmp3(ptr long) msvcrt._setjmp3 -@ cdecl -arch=x86_64,arm -norelay _setjmpex(ptr ptr) msvcrt._setjmpex -@ cdecl _setmaxstdio(long) msvcrt._setmaxstdio -@ cdecl _setmbcp(long) msvcrt._setmbcp -@ cdecl _setmode(long long) msvcrt._setmode -@ cdecl _setsystime(ptr long) msvcrt._setsystime -@ cdecl _sleep(long) msvcrt._sleep -@ varargs _snprintf(ptr long str) msvcrt._snprintf +@ cdecl _set_output_format(long) +@ cdecl _set_printf_count_output(long) MSVCRT__set_printf_count_output +@ cdecl _set_purecall_handler(ptr) +@ cdecl _seterrormode(long) +@ cdecl -arch=i386,x86_64,arm -norelay _setjmp(ptr) MSVCRT__setjmp +@ cdecl -arch=i386 -norelay _setjmp3(ptr long) MSVCRT__setjmp3 +@ cdecl -arch=x86_64,arm -norelay _setjmpex(ptr ptr) MSVCRT__setjmpex +@ cdecl _setmaxstdio(long) MSVCRT__setmaxstdio +@ cdecl _setmbcp(long) +@ cdecl _setmode(long long) MSVCRT__setmode +@ stub _setsystime(ptr long) +@ cdecl _sleep(long) MSVCRT__sleep +@ varargs _snprintf(ptr long str) MSVCRT__snprintf @ stub _snprintf_c @ stub _snprintf_c_l @ stub _snprintf_l -@ varargs _snprintf_s(ptr long long str) msvcrt._snprintf_s +@ varargs _snprintf_s(ptr long long str) MSVCRT__snprintf_s @ stub _snprintf_s_l -@ varargs _snscanf(str long str) msvcrt._snscanf -@ varargs _snscanf_l(str long str ptr) msvcrt._snscanf_l -@ varargs _snscanf_s(str long str) msvcrt._snscanf_s -@ varargs _snscanf_s_l(str long str ptr) msvcrt._snscanf_s_l -@ varargs _snwprintf(ptr long wstr) msvcrt._snwprintf -@ varargs _snwprintf_l(ptr long wstr ptr) msvcrt._snwprintf_l -@ varargs _snwprintf_s(ptr long long wstr) msvcrt._snwprintf_s -@ varargs _snwprintf_s_l(ptr long long wstr ptr) msvcrt._snwprintf_s_l -@ varargs _snwscanf(wstr long wstr) msvcrt._snwscanf -@ varargs _snwscanf_l(wstr long wstr ptr) msvcrt._snwscanf_l -@ varargs _snwscanf_s(wstr long wstr) msvcrt._snwscanf_s -@ varargs _snwscanf_s_l(wstr long wstr ptr) msvcrt._snwscanf_s_l -@ varargs _sopen(str long long) msvcrt._sopen -@ cdecl _sopen_s(ptr str long long long) msvcrt._sopen_s -@ varargs _spawnl(long str str) msvcrt._spawnl -@ varargs _spawnle(long str str) msvcrt._spawnle -@ varargs _spawnlp(long str str) msvcrt._spawnlp -@ varargs _spawnlpe(long str str) msvcrt._spawnlpe -@ cdecl _spawnv(long str ptr) msvcrt._spawnv -@ cdecl _spawnve(long str ptr ptr) msvcrt._spawnve -@ cdecl _spawnvp(long str ptr) msvcrt._spawnvp -@ 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 -@ varargs _sprintf_l(ptr str ptr) msvcrt._sprintf_l -@ varargs _sprintf_p(ptr long str) msvcr100._sprintf_p -@ varargs _sprintf_p_l(ptr long str ptr) msvcrt._sprintf_p_l -@ varargs _sprintf_s_l(ptr long str ptr) msvcrt._sprintf_s_l -@ varargs _sscanf_l(str str ptr) msvcrt._sscanf_l -@ varargs _sscanf_s_l(str str ptr) msvcrt._sscanf_s_l -@ cdecl _stat32(str ptr) msvcr100._stat32 -@ cdecl _stat32i64(str ptr) msvcr100._stat32i64 -@ cdecl _stat64(str ptr) msvcrt._stat64 -@ cdecl _stat64i32(str ptr) msvcr100._stat64i32 -@ cdecl _statusfp() msvcrt._statusfp -@ cdecl -arch=i386 _statusfp2(ptr ptr) msvcrt._statusfp2 -@ cdecl _strcoll_l(str str ptr) msvcrt._strcoll_l -@ cdecl _strdate(ptr) msvcrt._strdate -@ cdecl _strdate_s(ptr long) msvcrt._strdate_s -@ cdecl _strdup(str) msvcrt._strdup -@ cdecl _strerror(long) msvcrt._strerror +@ varargs _snscanf(str long str) MSVCRT__snscanf +@ varargs _snscanf_l(str long str ptr) MSVCRT__snscanf_l +@ varargs _snscanf_s(str long str) MSVCRT__snscanf_s +@ varargs _snscanf_s_l(str long str ptr) MSVCRT__snscanf_s_l +@ varargs _snwprintf(ptr long wstr) MSVCRT__snwprintf +@ varargs _snwprintf_l(ptr long wstr ptr) MSVCRT__snwprintf_l +@ varargs _snwprintf_s(ptr long long wstr) MSVCRT__snwprintf_s +@ varargs _snwprintf_s_l(ptr long long wstr ptr) MSVCRT__snwprintf_s_l +@ varargs _snwscanf(wstr long wstr) MSVCRT__snwscanf +@ varargs _snwscanf_l(wstr long wstr ptr) MSVCRT__snwscanf_l +@ varargs _snwscanf_s(wstr long wstr) MSVCRT__snwscanf_s +@ varargs _snwscanf_s_l(wstr long wstr ptr) MSVCRT__snwscanf_s_l +@ varargs _sopen(str long long) MSVCRT__sopen +@ 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 +@ varargs _sprintf_l(ptr str ptr) MSVCRT_sprintf_l +@ varargs _sprintf_p(ptr long str) MSVCRT__sprintf_p +@ varargs _sprintf_p_l(ptr long str ptr) MSVCRT_sprintf_p_l +@ varargs _sprintf_s_l(ptr long str ptr) MSVCRT_sprintf_s_l +@ varargs _sscanf_l(str str ptr) MSVCRT__sscanf_l +@ varargs _sscanf_s_l(str str ptr) MSVCRT__sscanf_s_l +@ 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) msvcrt._strlwr_l -@ 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 _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 @ stub _strnset_s -@ cdecl _strrev(str) msvcrt._strrev -@ cdecl _strset(str long) msvcrt._strset +@ cdecl _strrev(str) MSVCRT__strrev +@ cdecl _strset(str long) @ stub _strset_s -@ cdecl _strtime(ptr) msvcrt._strtime -@ cdecl _strtime_s(ptr long) msvcrt._strtime_s -@ cdecl _strtod_l(str ptr ptr) msvcrt._strtod_l -@ cdecl -ret64 _strtoi64(str ptr long) msvcrt._strtoi64 -@ cdecl -ret64 _strtoi64_l(str ptr long ptr) msvcrt._strtoi64_l +@ cdecl _strtime(ptr) MSVCRT__strtime +@ cdecl _strtime_s(ptr long) +@ cdecl _strtod_l(str ptr ptr) MSVCRT_strtod_l +@ cdecl -ret64 _strtoi64(str ptr long) MSVCRT_strtoi64 +@ cdecl -ret64 _strtoi64_l(str ptr long ptr) MSVCRT_strtoi64_l @ stub _strtol_l -@ cdecl -ret64 _strtoui64(str ptr long) msvcrt._strtoui64 -@ cdecl -ret64 _strtoui64_l(str ptr long ptr) msvcrt._strtoui64_l +@ cdecl -ret64 _strtoui64(str ptr long) MSVCRT_strtoui64 +@ cdecl -ret64 _strtoui64_l(str ptr long ptr) MSVCRT_strtoui64_l @ stub _strtoul_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 _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 @ stub _strxfrm_l -@ cdecl _swab(str str long) msvcrt._swab -@ varargs _swprintf(ptr wstr) msvcrt._swprintf +@ cdecl _swab(str str long) MSVCRT__swab +@ varargs _swprintf(ptr wstr) MSVCRT_swprintf @ stub _swprintf_c @ stub _swprintf_c_l @ stub _swprintf_p -@ varargs _swprintf_p_l(ptr long wstr ptr) msvcrt._swprintf_p_l -@ varargs _swprintf_s_l(ptr long wstr ptr) msvcrt._swprintf_s_l -@ varargs _swscanf_l(wstr wstr ptr) msvcrt._swscanf_l -@ varargs _swscanf_s_l(wstr wstr ptr) msvcrt._swscanf_s_l -@ extern _sys_errlist msvcrt._sys_errlist -@ extern _sys_nerr msvcrt._sys_nerr -@ cdecl _tell(long) msvcrt._tell -@ cdecl -ret64 _telli64(long) msvcrt._telli64 -@ cdecl _tempnam(str str) msvcrt._tempnam -@ cdecl _time32(ptr) msvcrt._time32 -@ cdecl _time64(ptr) msvcrt._time64 -@ extern _timezone msvcrt._timezone -@ 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 -@ extern _tzname msvcrt._tzname -@ cdecl _tzset() msvcrt._tzset -@ cdecl _ui64toa(int64 ptr long) msvcrt._ui64toa -@ cdecl _ui64toa_s(int64 ptr long long) msvcrt._ui64toa_s -@ cdecl _ui64tow(int64 ptr long) msvcrt._ui64tow -@ cdecl _ui64tow_s(int64 ptr long long) msvcrt._ui64tow_s -@ cdecl _ultoa(long ptr long) msvcrt._ultoa -@ cdecl _ultoa_s(long ptr long long) msvcrt._ultoa_s -@ cdecl _ultow(long ptr long) msvcrt._ultow -@ cdecl _ultow_s(long ptr long long) msvcrt._ultow_s -@ cdecl _umask(long) msvcrt._umask +@ varargs _swprintf_p_l(ptr long wstr ptr) MSVCRT_swprintf_p_l +@ varargs _swprintf_s_l(ptr long wstr ptr) MSVCRT__swprintf_s_l +@ varargs _swscanf_l(wstr wstr ptr) MSVCRT__swscanf_l +@ varargs _swscanf_s_l(wstr wstr ptr) MSVCRT__swscanf_s_l +@ extern _sys_errlist MSVCRT__sys_errlist +@ extern _sys_nerr MSVCRT__sys_nerr +@ 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 +@ extern _timezone MSVCRT___timezone +@ 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 +@ extern _tzname MSVCRT__tzname +@ 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 @ stub _ungetc_nolock -@ cdecl _ungetch(long) msvcrt._ungetch +@ cdecl _ungetch(long) @ stub _ungetch_nolock @ stub _ungetwc_nolock @ stub _ungetwch @ stub _ungetwch_nolock -@ cdecl _unlink(str) msvcrt._unlink -@ cdecl _unloaddll(long) msvcrt._unloaddll -@ cdecl _unlock(long) msvcrt._unlock -@ cdecl _unlock_file(ptr) msvcrt._unlock_file -@ cdecl _utime32(str ptr) msvcrt._utime32 -@ cdecl _utime64(str ptr) msvcrt._utime64 -@ cdecl _vcprintf(str ptr) msvcrt._vcprintf +@ cdecl _unlink(str) MSVCRT__unlink +@ cdecl _unloaddll(long) +@ cdecl _unlock(long) +@ cdecl _unlock_file(ptr) MSVCRT__unlock_file +@ cdecl _utime32(str ptr) +@ cdecl _utime64(str ptr) +@ cdecl _vcprintf(str ptr) @ stub _vcprintf_l @ stub _vcprintf_p @ stub _vcprintf_p_l @ stub _vcprintf_s @ stub _vcprintf_s_l -@ cdecl _vcwprintf(wstr ptr) msvcrt._vcwprintf +@ cdecl _vcwprintf(wstr ptr) @ stub _vcwprintf_l @ stub _vcwprintf_p @ stub _vcwprintf_p_l @@ -1790,7 +1790,7 @@ @ stub _vfprintf_p @ stub _vfprintf_p_l @ stub _vfprintf_s_l -@ cdecl _vfwprintf_l(ptr wstr ptr ptr) msvcrt._vfwprintf_l +@ cdecl _vfwprintf_l(ptr wstr ptr ptr) MSVCRT__vfwprintf_l @ stub _vfwprintf_p @ stub _vfwprintf_p_l @ stub _vfwprintf_s_l @@ -1798,452 +1798,452 @@ @ stub _vprintf_p @ stub _vprintf_p_l @ stub _vprintf_s_l -@ cdecl _vscprintf(str ptr) msvcrt._vscprintf +@ cdecl _vscprintf(str ptr) MSVCRT__vscprintf @ stub _vscprintf_l @ stub _vscprintf_p @ stub _vscprintf_p_l -@ cdecl _vscwprintf(wstr ptr) msvcrt._vscwprintf -@ cdecl _vscwprintf_l(wstr ptr ptr) msvcrt._vscwprintf_l -@ cdecl _vscwprintf_p(wstr ptr) msvcr100._vscwprintf_p -@ cdecl _vscwprintf_p_l(wstr ptr ptr) msvcrt._vscwprintf_p_l -@ cdecl _vsnprintf(ptr long str ptr) msvcrt._vsnprintf -@ cdecl _vsnprintf_c(ptr long str ptr) msvcrt._vsnprintf_c -@ cdecl _vsnprintf_c_l(ptr long str ptr ptr) msvcrt._vsnprintf_c_l -@ cdecl _vsnprintf_l(ptr long str ptr ptr) msvcrt._vsnprintf_l -@ cdecl _vsnprintf_s(ptr long long str ptr) msvcrt._vsnprintf_s -@ cdecl _vsnprintf_s_l(ptr long long str ptr ptr) msvcrt._vsnprintf_s_l -@ cdecl _vsnwprintf(ptr long wstr ptr) msvcrt._vsnwprintf -@ cdecl _vsnwprintf_l(ptr long wstr ptr ptr) msvcrt._vsnwprintf_l -@ cdecl _vsnwprintf_s(ptr long long wstr ptr) msvcrt._vsnwprintf_s -@ cdecl _vsnwprintf_s_l(ptr long long wstr ptr ptr) msvcrt._vsnwprintf_s_l -@ cdecl _vsprintf_l(ptr str ptr ptr) msvcrt._vsprintf_l -@ cdecl _vsprintf_p(ptr long str ptr) msvcrt._vsprintf_p -@ cdecl _vsprintf_p_l(ptr long str ptr ptr) msvcrt._vsprintf_p_l -@ cdecl _vsprintf_s_l(ptr long str ptr ptr) msvcrt._vsprintf_s_l -@ cdecl _vswprintf(ptr wstr ptr) msvcrt._vswprintf -@ cdecl _vswprintf_c(ptr long wstr ptr) msvcrt._vswprintf_c -@ cdecl _vswprintf_c_l(ptr long wstr ptr ptr) msvcrt._vswprintf_c_l -@ cdecl _vswprintf_l(ptr wstr ptr ptr) msvcrt._vswprintf_l -@ cdecl _vswprintf_p(ptr long wstr ptr) msvcr100._vswprintf_p -@ cdecl _vswprintf_p_l(ptr long wstr ptr ptr) msvcrt._vswprintf_p_l -@ cdecl _vswprintf_s_l(ptr long wstr ptr ptr) msvcrt._vswprintf_s_l +@ cdecl _vscwprintf(wstr ptr) MSVCRT__vscwprintf +@ cdecl _vscwprintf_l(wstr ptr ptr) MSVCRT__vscwprintf_l +@ cdecl _vscwprintf_p(wstr ptr) MSVCRT__vscwprintf_p +@ cdecl _vscwprintf_p_l(wstr ptr ptr) MSVCRT__vscwprintf_p_l +@ cdecl _vsnprintf(ptr long str ptr) MSVCRT_vsnprintf +@ cdecl _vsnprintf_c(ptr long str ptr) MSVCRT_vsnprintf +@ cdecl _vsnprintf_c_l(ptr long str ptr ptr) MSVCRT_vsnprintf_l +@ cdecl _vsnprintf_l(ptr long str ptr ptr) MSVCRT_vsnprintf_l +@ cdecl _vsnprintf_s(ptr long long str ptr) MSVCRT_vsnprintf_s +@ cdecl _vsnprintf_s_l(ptr long long str ptr ptr) MSVCRT_vsnprintf_s_l +@ cdecl _vsnwprintf(ptr long wstr ptr) MSVCRT_vsnwprintf +@ cdecl _vsnwprintf_l(ptr long wstr ptr ptr) MSVCRT_vsnwprintf_l +@ cdecl _vsnwprintf_s(ptr long long wstr ptr) MSVCRT_vsnwprintf_s +@ cdecl _vsnwprintf_s_l(ptr long long wstr ptr ptr) MSVCRT_vsnwprintf_s_l +@ cdecl _vsprintf_l(ptr str ptr ptr) MSVCRT_vsprintf_l +@ cdecl _vsprintf_p(ptr long str ptr) MSVCRT_vsprintf_p +@ cdecl _vsprintf_p_l(ptr long str ptr ptr) MSVCRT_vsprintf_p_l +@ cdecl _vsprintf_s_l(ptr long str ptr ptr) MSVCRT_vsprintf_s_l +@ cdecl _vswprintf(ptr wstr ptr) MSVCRT_vswprintf +@ cdecl _vswprintf_c(ptr long wstr ptr) MSVCRT_vsnwprintf +@ cdecl _vswprintf_c_l(ptr long wstr ptr ptr) MSVCRT_vsnwprintf_l +@ cdecl _vswprintf_l(ptr wstr ptr ptr) MSVCRT_vswprintf_l +@ cdecl _vswprintf_p(ptr long wstr ptr) MSVCRT__vswprintf_p +@ cdecl _vswprintf_p_l(ptr long wstr ptr ptr) MSVCRT_vswprintf_p_l +@ cdecl _vswprintf_s_l(ptr long wstr ptr ptr) MSVCRT_vswprintf_s_l @ stub _vwprintf_l @ stub _vwprintf_p @ stub _vwprintf_p_l @ stub _vwprintf_s_l -@ 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 -@ extern _wcmdln msvcrt._wcmdln -@ cdecl _wcreat(wstr long) msvcrt._wcreat +@ 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 +@ extern _wcmdln MSVCRT__wcmdln +@ 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 +@ 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 _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) ntdll._wcslwr @ stub _wcslwr_l -@ cdecl _wcslwr_s(wstr long) msvcrt._wcslwr_s +@ cdecl _wcslwr_s(wstr long) MSVCRT__wcslwr_s @ stub _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 _wcsncoll(wstr wstr long) MSVCRT__wcsncoll +@ cdecl _wcsncoll_l(wstr wstr long ptr) MSVCRT__wcsncoll_l +@ cdecl _wcsnicmp(wstr wstr long) MSVCRT__wcsnicmp @ stub _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 +@ 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 _wcsrev(wstr) MSVCRT__wcsrev +@ cdecl _wcsset(wstr long) MSVCRT__wcsset @ stub _wcsset_s -@ cdecl _wcstod_l(wstr ptr) msvcrt._wcstod_l -@ cdecl -ret64 _wcstoi64(wstr ptr long) msvcrt._wcstoi64 -@ cdecl -ret64 _wcstoi64_l(wstr ptr long ptr) msvcrt._wcstoi64_l -@ cdecl _wcstol_l(wstr ptr long ptr) msvcrt._wcstol_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 -@ cdecl _wcsupr(wstr) msvcrt._wcsupr -@ stub _wcsupr_l -@ cdecl _wcsupr_s(wstr long) msvcrt._wcsupr_s -@ cdecl _wcsupr_s_l(wstr long ptr) msvcrt._wcsupr_s_l +@ cdecl _wcstod_l(wstr ptr) MSVCRT__wcstod_l +@ cdecl -ret64 _wcstoi64(wstr ptr long) MSVCRT__wcstoi64 +@ cdecl -ret64 _wcstoi64_l(wstr ptr long ptr) MSVCRT__wcstoi64_l +@ cdecl _wcstol_l(wstr ptr long ptr) MSVCRT__wcstol_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 +@ 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 @ stub _wcsxfrm_l -@ cdecl _wctime32(ptr) msvcrt._wctime32 +@ cdecl _wctime32(ptr) MSVCRT__wctime32 @ stub _wctime32_s -@ cdecl _wctime64(ptr) msvcrt._wctime64 +@ 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 +@ cdecl _wctomb_l(ptr long ptr) MSVCRT__wctomb_l +@ cdecl _wctomb_s_l(ptr ptr long long ptr) MSVCRT__wctomb_s_l # extern _wctype -@ cdecl _wdupenv_s(ptr ptr wstr) msvcrt._wdupenv_s -@ extern _wenviron msvcrt._wenviron -@ varargs _wexecl(wstr wstr) msvcrt._wexecl -@ varargs _wexecle(wstr wstr) msvcrt._wexecle -@ varargs _wexeclp(wstr wstr) msvcrt._wexeclp -@ varargs _wexeclpe(wstr wstr) msvcrt._wexeclpe -@ cdecl _wexecv(wstr ptr) msvcrt._wexecv -@ cdecl _wexecve(wstr ptr ptr) msvcrt._wexecve -@ cdecl _wexecvp(wstr ptr) msvcrt._wexecvp -@ cdecl _wexecvpe(wstr ptr ptr) msvcrt._wexecvpe -@ cdecl _wfdopen(long wstr) msvcrt._wfdopen -@ cdecl _wfindfirst32(wstr ptr) msvcrt._wfindfirst32 +@ cdecl _wdupenv_s(ptr ptr wstr) +@ extern _wenviron MSVCRT__wenviron +@ 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 +@ 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) msvcrt._wgetenv_s -@ 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 -@ cdecl _wperror(wstr) msvcrt._wperror -@ extern _wpgmptr msvcrt._wpgmptr -@ cdecl _wpopen(wstr wstr) msvcrt._wpopen +@ 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) +@ extern _wpgmptr MSVCRT__wpgmptr +@ cdecl _wpopen(wstr wstr) MSVCRT__wpopen @ stub _wprintf_l @ stub _wprintf_p @ stub _wprintf_p_l @ stub _wprintf_s_l -@ cdecl _wputenv(wstr) msvcrt._wputenv -@ cdecl _wputenv_s(wstr wstr) msvcrt._wputenv_s -@ cdecl _wremove(wstr) msvcrt._wremove -@ cdecl _wrename(wstr wstr) msvcrt._wrename -@ cdecl _write(long ptr long) msvcrt._write -@ cdecl _wrmdir(wstr) msvcrt._wrmdir -@ varargs _wscanf_l(wstr ptr) msvcrt._wscanf_l -@ varargs _wscanf_s_l(wstr ptr) msvcrt._wscanf_s_l -@ 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 -@ cdecl _wsopen_s(ptr wstr long long long) msvcrt._wsopen_s -@ varargs _wspawnl(long wstr wstr) msvcrt._wspawnl -@ varargs _wspawnle(long wstr wstr) msvcrt._wspawnle -@ varargs _wspawnlp(long wstr wstr) msvcrt._wspawnlp -@ varargs _wspawnlpe(long wstr wstr) msvcrt._wspawnlpe -@ cdecl _wspawnv(long wstr ptr) msvcrt._wspawnv -@ cdecl _wspawnve(long wstr ptr ptr) msvcrt._wspawnve -@ cdecl _wspawnvp(long wstr ptr) msvcrt._wspawnvp -@ 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) msvcr100._wstat32 -@ cdecl _wstat32i64(wstr ptr) msvcr100._wstat32i64 -@ cdecl _wstat64(wstr ptr) msvcrt._wstat64 -@ cdecl _wstat64i32(wstr ptr) msvcr100._wstat64i32 -@ cdecl _wstrdate(ptr) msvcrt._wstrdate -@ cdecl _wstrdate_s(ptr long) msvcrt._wstrdate_s -@ cdecl _wstrtime(ptr) msvcrt._wstrtime -@ cdecl _wstrtime_s(ptr long) msvcrt._wstrtime_s -@ cdecl _wsystem(wstr) msvcrt._wsystem -@ cdecl _wtempnam(wstr wstr) msvcrt._wtempnam -@ cdecl _wtmpnam(ptr) msvcrt._wtmpnam +@ 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 +@ varargs _wscanf_l(wstr ptr) MSVCRT__wscanf_l +@ varargs _wscanf_s_l(wstr ptr) MSVCRT__wscanf_s_l +@ 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 +@ 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 -@ cdecl _wunlink(wstr) msvcrt._wunlink -@ cdecl _wutime32(wstr ptr) msvcrt._wutime32 -@ cdecl _wutime64(wstr ptr) msvcrt._wutime64 -@ 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 -@ 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 -@ cdecl atan(double) msvcrt.atan -@ cdecl -arch=arm,x86_64 atanf(float) msvcrt.atanf -@ cdecl atan2(double double) msvcrt.atan2 -@ cdecl -arch=arm,x86_64 atan2f(float float) msvcrt.atan2f -@ cdecl atexit(ptr) msvcrt.atexit -@ cdecl atof(str) msvcrt.atof -@ cdecl atoi(str) msvcr100.atoi #don't forward to msvcrt -@ cdecl atol(str) msvcrt.atol -@ 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 -@ cdecl calloc(long long) msvcrt.calloc -@ cdecl ceil(double) msvcrt.ceil -@ cdecl -arch=arm,x86_64 ceilf(float) msvcrt.ceilf -@ cdecl clearerr(ptr) msvcrt.clearerr +@ 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 +@ 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 +@ 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 +@ cdecl atan(double) MSVCRT_atan +@ cdecl -arch=arm,x86_64 atanf(float) MSVCRT_atanf +@ cdecl atan2(double double) MSVCRT_atan2 +@ cdecl -arch=arm,x86_64 atan2f(float float) MSVCRT_atan2f +@ cdecl atexit(ptr) MSVCRT_atexit +@ cdecl atof(str) MSVCRT_atof +@ cdecl atoi(str) MSVCRT_atoi +@ cdecl atol(str) ntdll.atol +@ 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 +@ cdecl calloc(long long) MSVCRT_calloc +@ cdecl ceil(double) MSVCRT_ceil +@ cdecl -arch=arm,x86_64 ceilf(float) MSVCRT_ceilf +@ cdecl clearerr(ptr) MSVCRT_clearerr @ stub clearerr_s -@ cdecl clock() msvcrt.clock -@ 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 -@ cdecl -ret64 div(long long) msvcrt.div -@ cdecl exit(long) msvcrt.exit -@ cdecl exp(double) msvcrt.exp -@ cdecl -arch=arm,x86_64 expf(float) msvcrt.expf -@ cdecl fabs(double) msvcrt.fabs -@ cdecl -arch=arm,x86_64 fabsf(float) msvcrt.fabsf -@ cdecl fclose(ptr) msvcrt.fclose -@ cdecl feof(ptr) msvcrt.feof -@ cdecl ferror(ptr) msvcrt.ferror -@ 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 -@ 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 -@ varargs fprintf(ptr str) msvcrt.fprintf -@ varargs fprintf_s(ptr str) msvcrt.fprintf_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 -@ varargs fscanf(ptr str) msvcrt.fscanf -@ varargs fscanf_s(ptr str) msvcrt.fscanf_s -@ cdecl fseek(ptr long long) msvcrt.fseek -@ cdecl fsetpos(ptr ptr) msvcrt.fsetpos -@ cdecl ftell(ptr) msvcrt.ftell -@ varargs fwprintf(ptr wstr) msvcrt.fwprintf -@ varargs fwprintf_s(ptr wstr) msvcrt.fwprintf_s -@ cdecl fwrite(ptr long long ptr) msvcrt.fwrite -@ varargs fwscanf(ptr wstr) msvcrt.fwscanf -@ varargs fwscanf_s(ptr wstr) msvcrt.fwscanf_s -@ cdecl getc(ptr) msvcrt.getc -@ cdecl getchar() msvcrt.getchar -@ cdecl getenv(str) msvcrt.getenv -@ cdecl getenv_s(ptr ptr long str) msvcrt.getenv_s -@ cdecl gets(str) msvcrt.gets +@ cdecl clock() MSVCRT_clock +@ 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 +@ cdecl -ret64 div(long long) MSVCRT_div +@ cdecl exit(long) MSVCRT_exit +@ cdecl exp(double) MSVCRT_exp +@ cdecl -arch=arm,x86_64 expf(float) MSVCRT_expf +@ cdecl fabs(double) MSVCRT_fabs +@ cdecl -arch=arm,x86_64 fabsf(float) MSVCRT_fabsf +@ cdecl fclose(ptr) MSVCRT_fclose +@ cdecl feof(ptr) MSVCRT_feof +@ cdecl ferror(ptr) MSVCRT_ferror +@ 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 +@ 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 +@ varargs fprintf(ptr str) MSVCRT_fprintf +@ varargs fprintf_s(ptr str) MSVCRT_fprintf_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 +@ varargs fscanf(ptr str) MSVCRT_fscanf +@ varargs fscanf_s(ptr str) MSVCRT_fscanf_s +@ cdecl fseek(ptr long long) MSVCRT_fseek +@ cdecl fsetpos(ptr ptr) MSVCRT_fsetpos +@ cdecl ftell(ptr) MSVCRT_ftell +@ varargs fwprintf(ptr wstr) MSVCRT_fwprintf +@ varargs fwprintf_s(ptr wstr) MSVCRT_fwprintf_s +@ cdecl fwrite(ptr long long ptr) MSVCRT_fwrite +@ varargs fwscanf(ptr wstr) MSVCRT_fwscanf +@ varargs fwscanf_s(ptr wstr) MSVCRT_fwscanf_s +@ 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 -@ cdecl is_wctype(long long) msvcrt.is_wctype -@ cdecl isalnum(long) msvcrt.isalnum -@ cdecl isalpha(long) msvcrt.isalpha -@ 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) msvcrt.iswalpha -@ cdecl iswascii(long) msvcrt.iswascii -@ cdecl iswcntrl(long) msvcrt.iswcntrl -@ cdecl iswctype(long long) msvcrt.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 +@ cdecl getwc(ptr) MSVCRT_getwc +@ cdecl getwchar() MSVCRT_getwchar +@ cdecl is_wctype(long long) ntdll.iswctype +@ cdecl isalnum(long) MSVCRT_isalnum +@ cdecl isalpha(long) MSVCRT_isalpha +@ 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 +@ 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 llabs @ stub lldiv -@ cdecl localeconv() msvcrt.localeconv -@ cdecl log(double) msvcrt.log -@ cdecl -arch=arm,x86_64 logf(float) msvcrt.logf -@ cdecl log10(double) msvcrt.log10 -@ cdecl -arch=arm,x86_64 log10f(float) msvcrt.log10f -@ cdecl -arch=i386,x86_64,arm longjmp(ptr long) msvcrt.longjmp -@ cdecl malloc(long) msvcrt.malloc -@ cdecl mblen(ptr long) msvcrt.mblen -@ cdecl mbrlen(ptr long ptr) msvcrt.mbrlen -@ cdecl mbrtowc(ptr str long ptr) msvcrt.mbrtowc -@ cdecl mbsrtowcs(ptr ptr long ptr) msvcrt.mbsrtowcs +@ cdecl localeconv() MSVCRT_localeconv +@ cdecl log(double) MSVCRT_log +@ cdecl -arch=arm,x86_64 logf(float) MSVCRT_logf +@ cdecl log10(double) MSVCRT_log10 +@ cdecl -arch=arm,x86_64 log10f(float) MSVCRT_log10f +@ cdecl -arch=i386,x86_64,arm longjmp(ptr long) MSVCRT_longjmp +@ cdecl malloc(long) MSVCRT_malloc +@ cdecl mblen(ptr long) MSVCRT_mblen +@ cdecl mbrlen(ptr long ptr) MSVCRT_mbrlen +@ 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 -@ cdecl perror(str) msvcrt.perror -@ cdecl pow(double double) msvcrt.pow -@ cdecl -arch=arm,x86_64 powf(float float) msvcrt.powf -@ varargs printf(str) msvcrt.printf -@ varargs printf_s(str) msvcrt.printf_s -@ cdecl putc(long ptr) msvcrt.putc -@ cdecl putchar(long) msvcrt.putchar -@ cdecl puts(str) msvcrt.puts -@ cdecl putwc(long ptr) msvcrt.putwc -@ cdecl putwchar(long) msvcrt.putwchar -@ cdecl qsort(ptr long long ptr) msvcrt.qsort -@ cdecl qsort_s(ptr long long ptr ptr) msvcrt.qsort_s -@ cdecl raise(long) msvcrt.raise -@ cdecl rand() msvcrt.rand -@ cdecl rand_s(ptr) msvcrt.rand_s -@ cdecl realloc(ptr long) msvcrt.realloc -@ cdecl remove(str) msvcrt.remove -@ cdecl rename(str str) msvcrt.rename -@ cdecl rewind(ptr) msvcrt.rewind -@ varargs scanf(str) msvcrt.scanf -@ varargs scanf_s(str) msvcrt.scanf_s -@ 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 -@ varargs sprintf(ptr str) msvcrt.sprintf -@ varargs sprintf_s(ptr long str) msvcrt.sprintf_s -@ cdecl sqrt(double) msvcrt.sqrt -@ cdecl -arch=arm,x86_64 sqrtf(float) msvcrt.sqrtf -@ cdecl srand(long) msvcrt.srand -@ varargs sscanf(str str) msvcrt.sscanf -@ varargs sscanf_s(str str) msvcrt.sscanf_s -@ cdecl strcat(str str) msvcrt.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) msvcrt.strcpy -@ cdecl strcpy_s(ptr long str) msvcrt.strcpy_s -@ cdecl strcspn(str str) msvcrt.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) msvcrt.strpbrk -@ cdecl strrchr(str long) msvcrt.strrchr -@ cdecl strspn(str str) msvcrt.strspn -@ cdecl strstr(str str) msvcrt.strstr -@ cdecl strtod(str ptr) msvcrt.strtod -@ cdecl strtok(str str) msvcrt.strtok -@ cdecl strtok_s(ptr str ptr) msvcrt.strtok_s -@ cdecl strtol(str ptr long) msvcrt.strtol -@ cdecl strtoul(str ptr long) msvcrt.strtoul -@ cdecl strxfrm(ptr str long) msvcrt.strxfrm -@ varargs swprintf_s(ptr long wstr) msvcrt.swprintf_s -@ varargs swscanf(wstr wstr) msvcrt.swscanf -@ varargs swscanf_s(wstr wstr) msvcrt.swscanf_s -@ 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 tmpfile() msvcrt.tmpfile -@ cdecl tmpfile_s(ptr) msvcrt.tmpfile_s -@ cdecl tmpnam(ptr) msvcrt.tmpnam +@ 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 +@ cdecl perror(str) MSVCRT_perror +@ cdecl pow(double double) MSVCRT_pow +@ cdecl -arch=arm,x86_64 powf(float float) MSVCRT_powf +@ varargs printf(str) MSVCRT_printf +@ varargs printf_s(str) MSVCRT_printf_s +@ 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 +@ cdecl raise(long) MSVCRT_raise +@ cdecl rand() MSVCRT_rand +@ cdecl rand_s(ptr) MSVCRT_rand_s +@ cdecl realloc(ptr long) MSVCRT_realloc +@ cdecl remove(str) MSVCRT_remove +@ cdecl rename(str str) MSVCRT_rename +@ cdecl rewind(ptr) MSVCRT_rewind +@ varargs scanf(str) MSVCRT_scanf +@ varargs scanf_s(str) MSVCRT_scanf_s +@ 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 +@ varargs sprintf(ptr str) MSVCRT_sprintf +@ varargs sprintf_s(ptr long str) MSVCRT_sprintf_s +@ cdecl sqrt(double) MSVCRT_sqrt +@ cdecl -arch=arm,x86_64 sqrtf(float) MSVCRT_sqrtf +@ cdecl srand(long) MSVCRT_srand +@ varargs sscanf(str str) MSVCRT_sscanf +@ varargs sscanf_s(str str) MSVCRT_sscanf_s +@ 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 +@ cdecl strtok(str str) MSVCRT_strtok +@ cdecl strtok_s(ptr str ptr) MSVCRT_strtok_s +@ cdecl strtol(str ptr long) MSVCRT_strtol +@ cdecl strtoul(str ptr long) MSVCRT_strtoul +@ cdecl strxfrm(ptr str long) MSVCRT_strxfrm +@ varargs swprintf_s(ptr long wstr) MSVCRT_swprintf_s +@ varargs swscanf(wstr wstr) MSVCRT_swscanf +@ varargs swscanf_s(wstr wstr) MSVCRT_swscanf_s +@ 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 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 -@ cdecl towlower(long) msvcrt.towlower -@ cdecl towupper(long) msvcrt.towupper -@ cdecl ungetc(long ptr) msvcrt.ungetc -@ cdecl ungetwc(long ptr) msvcrt.ungetwc -@ cdecl vfprintf(ptr str ptr) msvcrt.vfprintf -@ cdecl vfprintf_s(ptr str ptr) msvcrt.vfprintf_s -@ cdecl vfwprintf(ptr wstr ptr) msvcrt.vfwprintf -@ cdecl vfwprintf_s(ptr wstr ptr) msvcrt.vfwprintf_s -@ cdecl vprintf(str ptr) msvcrt.vprintf -@ cdecl vprintf_s(str ptr) msvcrt.vprintf_s -@ cdecl vsprintf(ptr str ptr) msvcrt.vsprintf -@ cdecl vsprintf_s(ptr long str ptr) msvcrt.vsprintf_s -@ cdecl vswprintf_s(ptr long wstr ptr) msvcrt.vswprintf_s -@ cdecl vwprintf(wstr ptr) msvcrt.vwprintf -@ cdecl vwprintf_s(wstr ptr) msvcrt.vwprintf_s -@ cdecl wcrtomb(ptr long ptr) msvcrt.wcrtomb +@ cdecl tolower(long) MSVCRT_tolower +@ cdecl toupper(long) MSVCRT_toupper +@ cdecl towlower(long) MSVCRT_towlower +@ cdecl towupper(long) MSVCRT_towupper +@ cdecl ungetc(long ptr) MSVCRT_ungetc +@ cdecl ungetwc(long ptr) MSVCRT_ungetwc +@ cdecl vfprintf(ptr str ptr) MSVCRT_vfprintf +@ cdecl vfprintf_s(ptr str ptr) MSVCRT_vfprintf_s +@ cdecl vfwprintf(ptr wstr ptr) MSVCRT_vfwprintf +@ cdecl vfwprintf_s(ptr wstr ptr) MSVCRT_vfwprintf_s +@ cdecl vprintf(str ptr) MSVCRT_vprintf +@ cdecl vprintf_s(str ptr) MSVCRT_vprintf_s +@ cdecl vsprintf(ptr str ptr) MSVCRT_vsprintf +@ cdecl vsprintf_s(ptr long str ptr) MSVCRT_vsprintf_s +@ cdecl vswprintf_s(ptr long wstr ptr) MSVCRT_vswprintf_s +@ cdecl vwprintf(wstr ptr) MSVCRT_vwprintf +@ cdecl vwprintf_s(wstr ptr) MSVCRT_vwprintf_s +@ cdecl wcrtomb(ptr long ptr) MSVCRT_wcrtomb @ stub wcrtomb_s -@ cdecl wcscat(wstr wstr) msvcrt.wcscat -@ cdecl wcscat_s(wstr long wstr) msvcrt.wcscat_s -@ cdecl wcschr(wstr long) msvcrt.wcschr -@ cdecl wcscmp(wstr wstr) msvcrt.wcscmp -@ cdecl wcscoll(wstr wstr) msvcrt.wcscoll -@ cdecl wcscpy(ptr wstr) msvcrt.wcscpy -@ cdecl wcscpy_s(ptr long wstr) msvcrt.wcscpy_s -@ cdecl wcscspn(wstr wstr) msvcrt.wcscspn -@ cdecl wcsftime(ptr long wstr ptr) msvcrt.wcsftime -@ cdecl wcslen(wstr) msvcrt.wcslen -@ cdecl wcsncat(wstr wstr long) msvcrt.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) msvcrt.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) msvcrt.wcsspn -@ cdecl wcsstr(wstr wstr) msvcrt.wcsstr -@ cdecl wcstod(wstr ptr) msvcrt.wcstod -@ cdecl wcstok(wstr wstr) msvcrt.wcstok -@ cdecl wcstok_s(ptr wstr ptr) msvcrt.wcstok_s -@ cdecl wcstol(wstr ptr long) msvcrt.wcstol -@ 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 -@ 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 -@ cdecl wmemcpy_s(ptr long ptr long) msvcr100.wmemcpy_s -@ cdecl wmemmove_s(ptr long ptr long) msvcr100.wmemmove_s -@ varargs wprintf(wstr) msvcrt.wprintf -@ varargs wprintf_s(wstr) msvcrt.wprintf_s -@ varargs wscanf(wstr) msvcrt.wscanf -@ varargs wscanf_s(wstr) msvcrt.wscanf_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 +@ cdecl wcstok(wstr wstr) MSVCRT_wcstok +@ cdecl wcstok_s(ptr wstr ptr) MSVCRT_wcstok_s +@ cdecl wcstol(wstr ptr long) ntdll.wcstol +@ 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 wcsxfrm(ptr wstr long) +@ cdecl wctob(long) MSVCRT_wctob +@ cdecl wctomb(ptr long) MSVCRT_wctomb +@ cdecl wctomb_s(ptr ptr long long) MSVCRT_wctomb_s +@ cdecl wmemcpy_s(ptr long ptr long) +@ cdecl wmemmove_s(ptr long ptr long) +@ varargs wprintf(wstr) MSVCRT_wprintf +@ varargs wprintf_s(wstr) MSVCRT_wprintf_s +@ varargs wscanf(wstr) MSVCRT_wscanf +@ varargs wscanf_s(wstr) MSVCRT_wscanf_s diff -Nru wine1.7-1.7.14/dlls/msvcr70/Makefile.in wine1.7-1.7.18/dlls/msvcr70/Makefile.in --- wine1.7-1.7.14/dlls/msvcr70/Makefile.in 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msvcr70/Makefile.in 2014-05-02 18:15:48.000000000 +0000 @@ -1,6 +1,34 @@ +EXTRADEFS = -D_MT -D_MSVCR_VER=70 MODULE = msvcr70.dll IMPORTLIB = msvcr70 -IMPORTS = msvcrt +DELAYIMPORTS = advapi32 user32 +PARENTSRC = ../msvcrt C_SRCS = \ - msvcr70.c + 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.14/dlls/msvcr70/msvcr70.c wine1.7-1.7.18/dlls/msvcr70/msvcr70.c --- wine1.7-1.7.14/dlls/msvcr70/msvcr70.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msvcr70/msvcr70.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ -/* - * msvcr70 specific functions - * - * Copyright 2010 Detlef Riekenberg - * - * 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" - -BOOL WINAPI DllMain(HINSTANCE hdll, DWORD reason, LPVOID reserved) -{ - switch (reason) - { - case DLL_WINE_PREATTACH: - return FALSE; /* prefer native version */ - - case DLL_PROCESS_ATTACH: - DisableThreadLibraryCalls(hdll); - } - return TRUE; -} diff -Nru wine1.7-1.7.14/dlls/msvcr70/msvcr70.spec wine1.7-1.7.18/dlls/msvcr70/msvcr70.spec --- wine1.7-1.7.14/dlls/msvcr70/msvcr70.spec 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msvcr70/msvcr70.spec 2014-05-02 18:15:48.000000000 +0000 @@ -1,876 +1,876 @@ # MS VC++2002 runtime library -@ thiscall -arch=i386 ??0__non_rtti_object@@QAE@ABV0@@Z(ptr ptr) msvcrt.??0__non_rtti_object@@QAE@ABV0@@Z -@ cdecl -arch=win64 ??0__non_rtti_object@@QEAA@AEBV0@@Z(ptr ptr) msvcrt.??0__non_rtti_object@@QEAA@AEBV0@@Z -@ thiscall -arch=i386 ??0__non_rtti_object@@QAE@PBD@Z(ptr ptr) msvcrt.??0__non_rtti_object@@QAE@PBD@Z -@ cdecl -arch=win64 ??0__non_rtti_object@@QEAA@PEBD@Z(ptr ptr) msvcrt.??0__non_rtti_object@@QEAA@PEBD@Z -@ thiscall -arch=i386 ??0bad_cast@@AAE@PBQBD@Z(ptr ptr) msvcrt.??0bad_cast@@AAE@PBQBD@Z -@ cdecl -arch=win64 ??0bad_cast@@AEAA@PEBQEBD@Z(ptr ptr) msvcrt.??0bad_cast@@AEAA@PEBQEBD@Z -@ thiscall -arch=win32 ??0bad_cast@@QAE@ABQBD@Z(ptr ptr) msvcrt.??0bad_cast@@QAE@ABQBD@Z -@ cdecl -arch=win64 ??0bad_cast@@QEAA@AEBQEBD@Z(ptr ptr) msvcrt.??0bad_cast@@QEAA@AEBQEBD@Z -@ thiscall -arch=i386 ??0bad_cast@@QAE@ABV0@@Z(ptr ptr) msvcrt.??0bad_cast@@QAE@ABV0@@Z -@ cdecl -arch=win64 ??0bad_cast@@QEAA@AEBV0@@Z(ptr ptr) msvcrt.??0bad_cast@@QEAA@AEBV0@@Z -@ thiscall -arch=i386 ??0bad_cast@@QAE@PBD@Z(ptr str) msvcrt.??0bad_cast@@QAE@PBD@Z -@ cdecl -arch=win64 ??0bad_cast@@QEAA@PEBD@Z(ptr str) msvcrt.??0bad_cast@@QEAA@PEBD@Z -@ thiscall -arch=i386 ??0bad_typeid@@QAE@ABV0@@Z(ptr ptr) msvcrt.??0bad_typeid@@QAE@ABV0@@Z -@ cdecl -arch=win64 ??0bad_typeid@@QEAA@AEBV0@@Z(ptr ptr) msvcrt.??0bad_typeid@@QEAA@AEBV0@@Z -@ thiscall -arch=i386 ??0bad_typeid@@QAE@PBD@Z(ptr str) msvcrt.??0bad_typeid@@QAE@PBD@Z -@ cdecl -arch=win64 ??0bad_typeid@@QEAA@PEBD@Z(ptr str) msvcrt.??0bad_typeid@@QEAA@PEBD@Z -@ thiscall -arch=i386 ??0exception@@QAE@ABQBD@Z(ptr ptr) msvcrt.??0exception@@QAE@ABQBD@Z -@ cdecl -arch=win64 ??0exception@@QEAA@AEBQEBD@Z(ptr ptr) msvcrt.??0exception@@QEAA@AEBQEBD@Z -@ thiscall -arch=i386 ??0exception@@QAE@ABV0@@Z(ptr ptr) msvcrt.??0exception@@QAE@ABV0@@Z -@ cdecl -arch=win64 ??0exception@@QEAA@AEBV0@@Z(ptr ptr) msvcrt.??0exception@@QEAA@AEBV0@@Z -@ thiscall -arch=i386 ??0exception@@QAE@XZ(ptr) msvcrt.??0exception@@QAE@XZ -@ cdecl -arch=win64 ??0exception@@QEAA@XZ(ptr) msvcrt.??0exception@@QEAA@XZ -@ thiscall -arch=i386 ??1__non_rtti_object@@UAE@XZ(ptr) msvcrt.??1__non_rtti_object@@UAE@XZ -@ cdecl -arch=win64 ??1__non_rtti_object@@UEAA@XZ(ptr) msvcrt.??1__non_rtti_object@@UEAA@XZ -@ thiscall -arch=i386 ??1bad_cast@@UAE@XZ(ptr) msvcrt.??1bad_cast@@UAE@XZ -@ cdecl -arch=win64 ??1bad_cast@@UEAA@XZ(ptr) msvcrt.??1bad_cast@@UEAA@XZ -@ thiscall -arch=i386 ??1bad_typeid@@UAE@XZ(ptr) msvcrt.??1bad_typeid@@UAE@XZ -@ cdecl -arch=win64 ??1bad_typeid@@UEAA@XZ(ptr) msvcrt.??1bad_typeid@@UEAA@XZ -@ thiscall -arch=i386 ??1exception@@UAE@XZ(ptr) msvcrt.??1exception@@UAE@XZ -@ cdecl -arch=win64 ??1exception@@UEAA@XZ(ptr) msvcrt.??1exception@@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 -@ cdecl -arch=win64 ??2@YAPEAX_K@Z(long) msvcrt.??2@YAPEAX_K@Z -@ cdecl -arch=win32 ??3@YAXPAX@Z(ptr) msvcrt.??3@YAXPAX@Z -@ cdecl -arch=win64 ??3@YAXPEAX@Z(ptr) msvcrt.??3@YAXPEAX@Z -@ thiscall -arch=i386 ??4__non_rtti_object@@QAEAAV0@ABV0@@Z(ptr ptr) msvcrt.??4__non_rtti_object@@QAEAAV0@ABV0@@Z -@ cdecl -arch=win64 ??4__non_rtti_object@@QEAAAEAV0@AEBV0@@Z(ptr ptr) msvcrt.??4__non_rtti_object@@QEAAAEAV0@AEBV0@@Z -@ thiscall -arch=i386 ??4bad_cast@@QAEAAV0@ABV0@@Z(ptr ptr) msvcrt.??4bad_cast@@QAEAAV0@ABV0@@Z -@ cdecl -arch=win64 ??4bad_cast@@QEAAAEAV0@AEBV0@@Z(ptr ptr) msvcrt.??4bad_cast@@QEAAAEAV0@AEBV0@@Z -@ thiscall -arch=i386 ??4bad_typeid@@QAEAAV0@ABV0@@Z(ptr ptr) msvcrt.??4bad_typeid@@QAEAAV0@ABV0@@Z -@ cdecl -arch=win64 ??4bad_typeid@@QEAAAEAV0@AEBV0@@Z(ptr ptr) msvcrt.??4bad_typeid@@QEAAAEAV0@AEBV0@@Z -@ thiscall -arch=i386 ??4exception@@QAEAAV0@ABV0@@Z(ptr ptr) msvcrt.??4exception@@QAEAAV0@ABV0@@Z -@ cdecl -arch=win64 ??4exception@@QEAAAEAV0@AEBV0@@Z(ptr ptr) msvcrt.??4exception@@QEAAAEAV0@AEBV0@@Z -@ thiscall -arch=i386 ??8type_info@@QBEHABV0@@Z(ptr ptr) msvcrt.??8type_info@@QBEHABV0@@Z -@ cdecl -arch=win64 ??8type_info@@QEBAHAEBV0@@Z(ptr ptr) msvcrt.??8type_info@@QEBAHAEBV0@@Z -@ thiscall -arch=i386 ??9type_info@@QBEHABV0@@Z(ptr ptr) msvcrt.??9type_info@@QBEHABV0@@Z -@ cdecl -arch=win64 ??9type_info@@QEBAHAEBV0@@Z(ptr ptr) msvcrt.??9type_info@@QEBAHAEBV0@@Z -@ extern ??_7__non_rtti_object@@6B@ msvcrt.??_7__non_rtti_object@@6B@ -@ extern ??_7bad_cast@@6B@ msvcrt.??_7bad_cast@@6B@ -@ extern ??_7bad_typeid@@6B@ msvcrt.??_7bad_typeid@@6B@ -@ extern ??_7exception@@6B@ msvcrt.??_7exception@@6B@ -@ thiscall -arch=win32 ??_E__non_rtti_object@@UAEPAXI@Z(ptr long) msvcrt.??_E__non_rtti_object@@UAEPAXI@Z -@ thiscall -arch=win32 ??_Ebad_cast@@UAEPAXI@Z(ptr long) msvcrt.??_Ebad_cast@@UAEPAXI@Z -@ thiscall -arch=win32 ??_Ebad_typeid@@UAEPAXI@Z(ptr long) msvcrt.??_Ebad_typeid@@UAEPAXI@Z -@ thiscall -arch=win32 ??_Eexception@@UAEPAXI@Z(ptr long) msvcrt.??_Eexception@@UAEPAXI@Z -@ thiscall -arch=i386 ??_Fbad_cast@@QAEXXZ(ptr) msvcrt.??_Fbad_cast@@QAEXXZ -@ cdecl -arch=win64 ??_Fbad_cast@@QEAAXXZ(ptr) msvcrt.??_Fbad_cast@@QEAAXXZ -@ thiscall -arch=i386 ??_Fbad_typeid@@QAEXXZ(ptr) msvcrt.??_Fbad_typeid@@QAEXXZ -@ cdecl -arch=win64 ??_Fbad_typeid@@QEAAXXZ(ptr) msvcrt.??_Fbad_typeid@@QEAAXXZ -@ 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 -@ thiscall -arch=win32 ??_Gbad_typeid@@UAEPAXI@Z(ptr long) msvcrt.??_Gbad_typeid@@UAEPAXI@Z -@ thiscall -arch=win32 ??_Gexception@@UAEPAXI@Z(ptr long) msvcrt.??_Gexception@@UAEPAXI@Z -@ cdecl -arch=win32 ??_U@YAPAXI@Z(long) msvcrt.??_U@YAPAXI@Z -@ cdecl -arch=win64 ??_U@YAPEAX_K@Z(long) msvcrt.??_U@YAPEAX_K@Z -@ cdecl -arch=win32 ??_V@YAXPAX@Z(ptr) msvcrt.??_V@YAXPAX@Z -@ cdecl -arch=win64 ??_V@YAXPEAX@Z(ptr) msvcrt.??_V@YAXPEAX@Z -@ cdecl __uncaught_exception() msvcrt.__uncaught_exception -@ 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 -@ cdecl -arch=win32 ?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z(ptr) msvcrt.?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z -@ cdecl -arch=win64 ?_set_new_handler@@YAP6AH_K@ZP6AH0@Z@Z(ptr) msvcrt.?_set_new_handler@@YAP6AH_K@ZP6AH0@Z@Z -@ cdecl ?_set_new_mode@@YAHH@Z(long) msvcrt.?_set_new_mode@@YAHH@Z -@ cdecl -arch=win32 ?_set_se_translator@@YAP6AXIPAU_EXCEPTION_POINTERS@@@ZP6AXI0@Z@Z(ptr) msvcrt.?_set_se_translator@@YAP6AXIPAU_EXCEPTION_POINTERS@@@ZP6AXI0@Z@Z -@ cdecl -arch=win64 ?_set_se_translator@@YAP6AXIPEAU_EXCEPTION_POINTERS@@@ZP6AXI0@Z@Z(ptr) msvcrt.?_set_se_translator@@YAP6AXIPEAU_EXCEPTION_POINTERS@@@ZP6AXI0@Z@Z -@ thiscall -arch=i386 ?before@type_info@@QBEHABV1@@Z(ptr ptr) msvcrt.?before@type_info@@QBEHABV1@@Z -@ cdecl -arch=win64 ?before@type_info@@QEBAHAEBV1@@Z(ptr ptr) msvcrt.?before@type_info@@QEBAHAEBV1@@Z -@ thiscall -arch=win32 ?name@type_info@@QBEPBDXZ(ptr) msvcrt.?name@type_info@@QBEPBDXZ -@ cdecl -arch=win64 ?name@type_info@@QEBAPEBDXZ(ptr) msvcrt.?name@type_info@@QEBAPEBDXZ -@ thiscall -arch=i386 ?raw_name@type_info@@QBEPBDXZ(ptr) msvcrt.?raw_name@type_info@@QBEPBDXZ -@ cdecl -arch=win64 ?raw_name@type_info@@QEBAPEBDXZ(ptr) msvcrt.?raw_name@type_info@@QEBAPEBDXZ -@ cdecl ?set_new_handler@@YAP6AXXZP6AXXZ@Z(ptr) msvcrt.?set_new_handler@@YAP6AXXZP6AXXZ@Z -@ cdecl ?set_terminate@@YAP6AXXZP6AXXZ@Z(ptr) msvcrt.?set_terminate@@YAP6AXXZP6AXXZ@Z -@ cdecl ?set_unexpected@@YAP6AXXZP6AXXZ@Z(ptr) msvcrt.?set_unexpected@@YAP6AXXZP6AXXZ@Z -@ cdecl ?terminate@@YAXXZ() msvcrt.?terminate@@YAXXZ -@ cdecl ?unexpected@@YAXXZ() msvcrt.?unexpected@@YAXXZ -@ thiscall -arch=i386 ?what@exception@@UBEPBDXZ(ptr) msvcrt.?what@exception@@UBEPBDXZ -@ cdecl -arch=win64 ?what@exception@@UEBAPEBDXZ(ptr) msvcrt.?what@exception@@UEBAPEBDXZ -@ cdecl -norelay $I10_OUTPUT(double long long long ptr) msvcrt.$I10_OUTPUT -@ cdecl -arch=i386 _CIacos() msvcrt._CIacos -@ cdecl -arch=i386 _CIasin() msvcrt._CIasin -@ cdecl -arch=i386 _CIatan() msvcrt._CIatan -@ cdecl -arch=i386 _CIatan2() msvcrt._CIatan2 -@ cdecl -arch=i386 _CIcos() msvcrt._CIcos -@ cdecl -arch=i386 _CIcosh() msvcrt._CIcosh -@ cdecl -arch=i386 _CIexp() msvcrt._CIexp -@ cdecl -arch=i386 _CIfmod() msvcrt._CIfmod -@ cdecl -arch=i386 _CIlog() msvcrt._CIlog -@ cdecl -arch=i386 _CIlog10() msvcrt._CIlog10 -@ cdecl -arch=i386 _CIpow() msvcrt._CIpow -@ cdecl -arch=i386 _CIsin() msvcrt._CIsin -@ cdecl -arch=i386 _CIsinh() msvcrt._CIsinh -@ cdecl -arch=i386 _CIsqrt() msvcrt._CIsqrt -@ cdecl -arch=i386 _CItan() msvcrt._CItan -@ cdecl -arch=i386 _CItanh() msvcrt._CItanh -@ cdecl _CRT_RTC_INIT(ptr ptr long long long) msvcr100._CRT_RTC_INIT -@ stdcall _CxxThrowException(long long) msvcrt._CxxThrowException -@ cdecl -arch=i386 -norelay _EH_prolog() msvcrt._EH_prolog -@ cdecl _Getdays() msvcrt._Getdays -@ cdecl _Getmonths() msvcrt._Getmonths -@ cdecl _Gettnames() msvcrt._Gettnames -@ extern _HUGE msvcrt._HUGE -@ cdecl _Strftime(str long str ptr ptr) msvcrt._Strftime -@ cdecl _XcptFilter(long ptr) msvcrt._XcptFilter +@ thiscall -arch=i386 ??0__non_rtti_object@@QAE@ABV0@@Z(ptr ptr) MSVCRT___non_rtti_object_copy_ctor +@ cdecl -arch=win64 ??0__non_rtti_object@@QEAA@AEBV0@@Z(ptr ptr) MSVCRT___non_rtti_object_copy_ctor +@ thiscall -arch=i386 ??0__non_rtti_object@@QAE@PBD@Z(ptr ptr) MSVCRT___non_rtti_object_ctor +@ cdecl -arch=win64 ??0__non_rtti_object@@QEAA@PEBD@Z(ptr ptr) MSVCRT___non_rtti_object_ctor +@ thiscall -arch=i386 ??0bad_cast@@AAE@PBQBD@Z(ptr ptr) MSVCRT_bad_cast_ctor +@ cdecl -arch=win64 ??0bad_cast@@AEAA@PEBQEBD@Z(ptr ptr) MSVCRT_bad_cast_ctor +@ thiscall -arch=win32 ??0bad_cast@@QAE@ABQBD@Z(ptr ptr) MSVCRT_bad_cast_ctor +@ cdecl -arch=win64 ??0bad_cast@@QEAA@AEBQEBD@Z(ptr ptr) MSVCRT_bad_cast_ctor +@ thiscall -arch=i386 ??0bad_cast@@QAE@ABV0@@Z(ptr ptr) MSVCRT_bad_cast_copy_ctor +@ cdecl -arch=win64 ??0bad_cast@@QEAA@AEBV0@@Z(ptr ptr) MSVCRT_bad_cast_copy_ctor +@ thiscall -arch=i386 ??0bad_cast@@QAE@PBD@Z(ptr str) MSVCRT_bad_cast_ctor_charptr +@ cdecl -arch=win64 ??0bad_cast@@QEAA@PEBD@Z(ptr str) MSVCRT_bad_cast_ctor_charptr +@ thiscall -arch=i386 ??0bad_typeid@@QAE@ABV0@@Z(ptr ptr) MSVCRT_bad_typeid_copy_ctor +@ cdecl -arch=win64 ??0bad_typeid@@QEAA@AEBV0@@Z(ptr ptr) MSVCRT_bad_typeid_copy_ctor +@ thiscall -arch=i386 ??0bad_typeid@@QAE@PBD@Z(ptr str) MSVCRT_bad_typeid_ctor +@ cdecl -arch=win64 ??0bad_typeid@@QEAA@PEBD@Z(ptr str) MSVCRT_bad_typeid_ctor +@ thiscall -arch=i386 ??0exception@@QAE@ABQBD@Z(ptr ptr) MSVCRT_exception_ctor +@ cdecl -arch=win64 ??0exception@@QEAA@AEBQEBD@Z(ptr ptr) MSVCRT_exception_ctor +@ thiscall -arch=i386 ??0exception@@QAE@ABV0@@Z(ptr ptr) MSVCRT_exception_copy_ctor +@ cdecl -arch=win64 ??0exception@@QEAA@AEBV0@@Z(ptr ptr) MSVCRT_exception_copy_ctor +@ thiscall -arch=i386 ??0exception@@QAE@XZ(ptr) MSVCRT_exception_default_ctor +@ cdecl -arch=win64 ??0exception@@QEAA@XZ(ptr) MSVCRT_exception_default_ctor +@ thiscall -arch=i386 ??1__non_rtti_object@@UAE@XZ(ptr) MSVCRT___non_rtti_object_dtor +@ cdecl -arch=win64 ??1__non_rtti_object@@UEAA@XZ(ptr) MSVCRT___non_rtti_object_dtor +@ thiscall -arch=i386 ??1bad_cast@@UAE@XZ(ptr) MSVCRT_bad_cast_dtor +@ cdecl -arch=win64 ??1bad_cast@@UEAA@XZ(ptr) MSVCRT_bad_cast_dtor +@ thiscall -arch=i386 ??1bad_typeid@@UAE@XZ(ptr) MSVCRT_bad_typeid_dtor +@ cdecl -arch=win64 ??1bad_typeid@@UEAA@XZ(ptr) MSVCRT_bad_typeid_dtor +@ thiscall -arch=i386 ??1exception@@UAE@XZ(ptr) MSVCRT_exception_dtor +@ cdecl -arch=win64 ??1exception@@UEAA@XZ(ptr) MSVCRT_exception_dtor +@ thiscall -arch=i386 ??1type_info@@UAE@XZ(ptr) MSVCRT_type_info_dtor +@ cdecl -arch=win64 ??1type_info@@UEAA@XZ(ptr) MSVCRT_type_info_dtor +@ cdecl -arch=win32 ??2@YAPAXI@Z(long) MSVCRT_operator_new +@ cdecl -arch=win64 ??2@YAPEAX_K@Z(long) MSVCRT_operator_new +@ cdecl -arch=win32 ??3@YAXPAX@Z(ptr) MSVCRT_operator_delete +@ cdecl -arch=win64 ??3@YAXPEAX@Z(ptr) MSVCRT_operator_delete +@ thiscall -arch=i386 ??4__non_rtti_object@@QAEAAV0@ABV0@@Z(ptr ptr) MSVCRT___non_rtti_object_opequals +@ cdecl -arch=win64 ??4__non_rtti_object@@QEAAAEAV0@AEBV0@@Z(ptr ptr) MSVCRT___non_rtti_object_opequals +@ thiscall -arch=i386 ??4bad_cast@@QAEAAV0@ABV0@@Z(ptr ptr) MSVCRT_bad_cast_opequals +@ cdecl -arch=win64 ??4bad_cast@@QEAAAEAV0@AEBV0@@Z(ptr ptr) MSVCRT_bad_cast_opequals +@ thiscall -arch=i386 ??4bad_typeid@@QAEAAV0@ABV0@@Z(ptr ptr) MSVCRT_bad_typeid_opequals +@ cdecl -arch=win64 ??4bad_typeid@@QEAAAEAV0@AEBV0@@Z(ptr ptr) MSVCRT_bad_typeid_opequals +@ thiscall -arch=i386 ??4exception@@QAEAAV0@ABV0@@Z(ptr ptr) MSVCRT_exception_opequals +@ cdecl -arch=win64 ??4exception@@QEAAAEAV0@AEBV0@@Z(ptr ptr) MSVCRT_exception_opequals +@ thiscall -arch=i386 ??8type_info@@QBEHABV0@@Z(ptr ptr) MSVCRT_type_info_opequals_equals +@ cdecl -arch=win64 ??8type_info@@QEBAHAEBV0@@Z(ptr ptr) MSVCRT_type_info_opequals_equals +@ thiscall -arch=i386 ??9type_info@@QBEHABV0@@Z(ptr ptr) MSVCRT_type_info_opnot_equals +@ cdecl -arch=win64 ??9type_info@@QEBAHAEBV0@@Z(ptr ptr) MSVCRT_type_info_opnot_equals +@ extern ??_7__non_rtti_object@@6B@ MSVCRT___non_rtti_object_vtable +@ extern ??_7bad_cast@@6B@ MSVCRT_bad_cast_vtable +@ extern ??_7bad_typeid@@6B@ MSVCRT_bad_typeid_vtable +@ extern ??_7exception@@6B@ MSVCRT_exception_vtable +@ thiscall -arch=win32 ??_E__non_rtti_object@@UAEPAXI@Z(ptr long) MSVCRT___non_rtti_object_vector_dtor +@ thiscall -arch=win32 ??_Ebad_cast@@UAEPAXI@Z(ptr long) MSVCRT_bad_cast_vector_dtor +@ thiscall -arch=win32 ??_Ebad_typeid@@UAEPAXI@Z(ptr long) MSVCRT_bad_typeid_vector_dtor +@ thiscall -arch=win32 ??_Eexception@@UAEPAXI@Z(ptr long) MSVCRT_exception_vector_dtor +@ thiscall -arch=i386 ??_Fbad_cast@@QAEXXZ(ptr) MSVCRT_bad_cast_default_ctor +@ cdecl -arch=win64 ??_Fbad_cast@@QEAAXXZ(ptr) MSVCRT_bad_cast_default_ctor +@ thiscall -arch=i386 ??_Fbad_typeid@@QAEXXZ(ptr) MSVCRT_bad_typeid_default_ctor +@ cdecl -arch=win64 ??_Fbad_typeid@@QEAAXXZ(ptr) MSVCRT_bad_typeid_default_ctor +@ thiscall -arch=win32 ??_G__non_rtti_object@@UAEPAXI@Z(ptr long) MSVCRT___non_rtti_object_scalar_dtor +@ thiscall -arch=win32 ??_Gbad_cast@@UAEPAXI@Z(ptr long) MSVCRT_bad_cast_scalar_dtor +@ thiscall -arch=win32 ??_Gbad_typeid@@UAEPAXI@Z(ptr long) MSVCRT_bad_typeid_scalar_dtor +@ thiscall -arch=win32 ??_Gexception@@UAEPAXI@Z(ptr long) MSVCRT_exception_scalar_dtor +@ cdecl -arch=win32 ??_U@YAPAXI@Z(long) MSVCRT_operator_new +@ cdecl -arch=win64 ??_U@YAPEAX_K@Z(long) MSVCRT_operator_new +@ cdecl -arch=win32 ??_V@YAXPAX@Z(ptr) MSVCRT_operator_delete +@ cdecl -arch=win64 ??_V@YAXPEAX@Z(ptr) MSVCRT_operator_delete +@ cdecl __uncaught_exception() MSVCRT___uncaught_exception +@ cdecl -arch=win32 ?_query_new_handler@@YAP6AHI@ZXZ() MSVCRT__query_new_handler +@ cdecl -arch=win64 ?_query_new_handler@@YAP6AH_K@ZXZ() MSVCRT__query_new_handler +@ cdecl ?_query_new_mode@@YAHXZ() MSVCRT__query_new_mode +@ cdecl -arch=win32 ?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z(ptr) MSVCRT__set_new_handler +@ cdecl -arch=win64 ?_set_new_handler@@YAP6AH_K@ZP6AH0@Z@Z(ptr) MSVCRT__set_new_handler +@ cdecl ?_set_new_mode@@YAHH@Z(long) MSVCRT__set_new_mode +@ cdecl -arch=win32 ?_set_se_translator@@YAP6AXIPAU_EXCEPTION_POINTERS@@@ZP6AXI0@Z@Z(ptr) MSVCRT__set_se_translator +@ cdecl -arch=win64 ?_set_se_translator@@YAP6AXIPEAU_EXCEPTION_POINTERS@@@ZP6AXI0@Z@Z(ptr) MSVCRT__set_se_translator +@ thiscall -arch=i386 ?before@type_info@@QBEHABV1@@Z(ptr ptr) MSVCRT_type_info_before +@ cdecl -arch=win64 ?before@type_info@@QEBAHAEBV1@@Z(ptr ptr) MSVCRT_type_info_before +@ thiscall -arch=win32 ?name@type_info@@QBEPBDXZ(ptr) MSVCRT_type_info_name +@ cdecl -arch=win64 ?name@type_info@@QEBAPEBDXZ(ptr) MSVCRT_type_info_name +@ thiscall -arch=i386 ?raw_name@type_info@@QBEPBDXZ(ptr) MSVCRT_type_info_raw_name +@ cdecl -arch=win64 ?raw_name@type_info@@QEBAPEBDXZ(ptr) MSVCRT_type_info_raw_name +@ cdecl ?set_new_handler@@YAP6AXXZP6AXXZ@Z(ptr) MSVCRT_set_new_handler +@ cdecl ?set_terminate@@YAP6AXXZP6AXXZ@Z(ptr) MSVCRT_set_terminate +@ cdecl ?set_unexpected@@YAP6AXXZP6AXXZ@Z(ptr) MSVCRT_set_unexpected +@ cdecl ?terminate@@YAXXZ() MSVCRT_terminate +@ cdecl ?unexpected@@YAXXZ() MSVCRT_unexpected +@ thiscall -arch=i386 ?what@exception@@UBEPBDXZ(ptr) MSVCRT_what_exception +@ cdecl -arch=win64 ?what@exception@@UEBAPEBDXZ(ptr) MSVCRT_what_exception +@ cdecl -norelay $I10_OUTPUT(double long long long ptr) MSVCRT_I10_OUTPUT +@ 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() +@ cdecl _CRT_RTC_INIT(ptr ptr long long long) +@ stdcall _CxxThrowException(long long) +@ cdecl -arch=i386 -norelay _EH_prolog() +@ cdecl _Getdays() +@ cdecl _Getmonths() +@ cdecl _Gettnames() +@ extern _HUGE MSVCRT__HUGE +@ cdecl _Strftime(str long str ptr ptr) +@ cdecl _XcptFilter(long ptr) @ stub __CxxCallUnwindDtor @ stub __CxxCallUnwindVecDtor -@ cdecl -arch=i386,x86_64,arm __CxxDetectRethrow(ptr) msvcrt.__CxxDetectRethrow +@ cdecl -arch=i386,x86_64,arm __CxxDetectRethrow(ptr) @ stub __CxxExceptionFilter -@ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler(ptr ptr ptr ptr) msvcrt.__CxxFrameHandler -@ stdcall -arch=i386 __CxxLongjmpUnwind(ptr) msvcrt.__CxxLongjmpUnwind -@ cdecl -arch=i386,x86_64,arm __CxxQueryExceptionSize() msvcrt.__CxxQueryExceptionSize +@ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler(ptr ptr ptr ptr) +@ stdcall -arch=i386 __CxxLongjmpUnwind(ptr) +@ cdecl -arch=i386,x86_64,arm __CxxQueryExceptionSize() @ stub __CxxRegisterExceptionObject @ stub __CxxUnregisterExceptionObject @ stub __DestructExceptionObject -@ cdecl __RTCastToVoid(ptr) msvcrt.__RTCastToVoid -@ cdecl __RTDynamicCast(ptr long ptr ptr long) msvcrt.__RTDynamicCast -@ cdecl __RTtypeid(ptr) msvcrt.__RTtypeid -@ cdecl __STRINGTOLD(ptr ptr str long) msvcrt.__STRINGTOLD -@ cdecl ___lc_codepage_func() msvcrt.___lc_codepage_func -@ cdecl ___lc_collate_cp_func() msvcrt.___lc_collate_cp_func -@ cdecl ___lc_handle_func() msvcrt.___lc_handle_func -@ cdecl ___mb_cur_max_func() msvcrt.___mb_cur_max_func -@ cdecl ___setlc_active_func() msvcrt.___setlc_active_func -@ cdecl ___unguarded_readlc_active_add_func() msvcrt.___unguarded_readlc_active_add_func -@ extern __argc msvcrt.__argc -@ extern __argv msvcrt.__argv -@ extern __badioinfo msvcrt.__badioinfo +@ cdecl __RTCastToVoid(ptr) MSVCRT___RTCastToVoid +@ cdecl __RTDynamicCast(ptr long ptr ptr long) MSVCRT___RTDynamicCast +@ cdecl __RTtypeid(ptr) MSVCRT___RTtypeid +@ cdecl __STRINGTOLD(ptr ptr str long) +@ cdecl ___lc_codepage_func() +@ cdecl ___lc_collate_cp_func() +@ cdecl ___lc_handle_func() +@ cdecl ___mb_cur_max_func() MSVCRT____mb_cur_max_func +@ cdecl ___setlc_active_func() MSVCRT____setlc_active_func +@ cdecl ___unguarded_readlc_active_add_func() MSVCRT____unguarded_readlc_active_add_func +@ extern __argc MSVCRT___argc +@ extern __argv MSVCRT___argv +@ extern __badioinfo MSVCRT___badioinfo @ stub __buffer_overrun -@ cdecl __crtCompareStringA(long long str long str long) msvcrt.__crtCompareStringA -@ cdecl __crtCompareStringW(long long wstr long wstr long) msvcrt.__crtCompareStringW -@ cdecl __crtGetLocaleInfoW(long long ptr long) msvcrt.__crtGetLocaleInfoW -@ cdecl __crtGetStringTypeW(long long wstr long ptr) msvcrt.__crtGetStringTypeW -@ cdecl __crtLCMapStringA(long long str long ptr long long long) msvcrt.__crtLCMapStringA -@ cdecl __crtLCMapStringW(long long wstr long ptr long long long) msvcrt.__crtLCMapStringW -@ cdecl __dllonexit(ptr ptr ptr) msvcrt.__dllonexit -@ cdecl __doserrno() msvcrt.__doserrno -@ cdecl __fpecode() msvcrt.__fpecode -@ cdecl __getmainargs(ptr ptr ptr long ptr) msvcrt.__getmainargs -@ extern __initenv msvcrt.__initenv -@ cdecl __iob_func() msvcrt.__iob_func -@ cdecl __isascii(long) msvcrt.__isascii -@ cdecl __iscsym(long) msvcrt.__iscsym -@ cdecl __iscsymf(long) msvcrt.__iscsymf +@ cdecl __crtCompareStringA(long long str long str long) +@ cdecl __crtCompareStringW(long long wstr long wstr long) +@ cdecl __crtGetLocaleInfoW(long long ptr long) +@ cdecl __crtGetStringTypeW(long long wstr long ptr) +@ cdecl __crtLCMapStringA(long long str long ptr long long long) +@ cdecl __crtLCMapStringW(long long wstr long ptr long long long) +@ cdecl __dllonexit(ptr ptr ptr) +@ cdecl __doserrno() MSVCRT___doserrno +@ cdecl __fpecode() +@ cdecl __getmainargs(ptr ptr ptr long ptr) +@ extern __initenv MSVCRT___initenv +@ cdecl __iob_func() MSVCRT___iob_func +@ cdecl __isascii(long) MSVCRT___isascii +@ cdecl __iscsym(long) MSVCRT___iscsym +@ cdecl __iscsymf(long) MSVCRT___iscsymf # extern __lc_clike -@ extern __lc_codepage msvcrt.__lc_codepage -@ extern __lc_collate_cp msvcrt.__lc_collate_cp -@ extern __lc_handle msvcrt.__lc_handle -@ cdecl __lconv_init() msvcrt.__lconv_init -@ extern __mb_cur_max msvcrt.__mb_cur_max -@ cdecl __p___argc() msvcrt.__p___argc -@ cdecl __p___argv() msvcrt.__p___argv -@ cdecl __p___initenv() msvcrt.__p___initenv -@ cdecl __p___mb_cur_max() msvcrt.__p___mb_cur_max -@ cdecl __p___wargv() msvcrt.__p___wargv -@ cdecl __p___winitenv() msvcrt.__p___winitenv -@ cdecl __p__acmdln() msvcrt.__p__acmdln -@ cdecl __p__amblksiz() msvcrt.__p__amblksiz -@ cdecl __p__commode() msvcrt.__p__commode -@ cdecl __p__daylight() msvcrt.__p__daylight -@ cdecl __p__dstbias() msvcrt.__p__dstbias -@ cdecl __p__environ() msvcrt.__p__environ -@ cdecl __p__fileinfo() msvcrt.__p__fileinfo -@ cdecl __p__fmode() msvcrt.__p__fmode -@ cdecl __p__iob() msvcrt.__p__iob -@ cdecl __p__mbcasemap() msvcrt.__p__mbcasemap -@ cdecl __p__mbctype() msvcrt.__p__mbctype -@ cdecl __p__osver() msvcrt.__p__osver -@ cdecl __p__pctype() msvcrt.__p__pctype -@ cdecl __p__pgmptr() msvcrt.__p__pgmptr -@ cdecl __p__pwctype() msvcrt.__p__pwctype -@ cdecl __p__timezone() msvcrt.__p__timezone -@ cdecl __p__tzname() msvcrt.__p__tzname -@ cdecl __p__wcmdln() msvcrt.__p__wcmdln -@ cdecl __p__wenviron() msvcrt.__p__wenviron -@ cdecl __p__winmajor() msvcrt.__p__winmajor -@ cdecl __p__winminor() msvcrt.__p__winminor -@ cdecl __p__winver() msvcrt.__p__winver -@ cdecl __p__wpgmptr() msvcrt.__p__wpgmptr -@ cdecl __pctype_func() msvcrt.__pctype_func -@ extern __pioinfo msvcrt.__pioinfo +@ extern __lc_codepage MSVCRT___lc_codepage +@ extern __lc_collate_cp MSVCRT___lc_collate_cp +@ extern __lc_handle MSVCRT___lc_handle +@ cdecl __lconv_init() +@ extern __mb_cur_max MSVCRT___mb_cur_max +@ cdecl __p___argc() MSVCRT___p___argc +@ cdecl __p___argv() MSVCRT___p___argv +@ cdecl __p___initenv() +@ cdecl __p___mb_cur_max() +@ cdecl __p___wargv() MSVCRT___p___wargv +@ cdecl __p___winitenv() +@ cdecl __p__acmdln() +@ cdecl __p__amblksiz() +@ cdecl __p__commode() +@ cdecl __p__daylight() MSVCRT___p__daylight +@ cdecl __p__dstbias() +@ cdecl __p__environ() MSVCRT___p__environ +@ stub __p__fileinfo() +@ cdecl __p__fmode() +@ cdecl __p__iob() MSVCRT___iob_func +@ stub __p__mbcasemap() +@ cdecl __p__mbctype() +@ cdecl __p__osver() +@ cdecl __p__pctype() MSVCRT___p__pctype +@ cdecl __p__pgmptr() MSVCRT___p__pgmptr +@ stub __p__pwctype() +@ cdecl __p__timezone() MSVCRT___p__timezone +@ cdecl __p__tzname() +@ cdecl __p__wcmdln() +@ cdecl __p__wenviron() MSVCRT___p__wenviron +@ cdecl __p__winmajor() +@ cdecl __p__winminor() +@ cdecl __p__winver() +@ cdecl __p__wpgmptr() MSVCRT___p__wpgmptr +@ cdecl __pctype_func() MSVCRT___pctype_func +@ extern __pioinfo MSVCRT___pioinfo @ stub __pwctype_func -@ cdecl __pxcptinfoptrs() msvcrt.__pxcptinfoptrs -@ cdecl __security_error_handler(long ptr) msvcrt.__security_error_handler -@ cdecl __set_app_type(long) msvcrt.__set_app_type +@ cdecl __pxcptinfoptrs() MSVCRT___pxcptinfoptrs +@ cdecl __security_error_handler(long ptr) +@ cdecl __set_app_type(long) MSVCRT___set_app_type @ stub __set_buffer_overrun_handler -@ extern __setlc_active msvcrt.__setlc_active -@ cdecl __setusermatherr(ptr) msvcrt.__setusermatherr -@ cdecl __threadhandle() msvcrt.__threadhandle -@ cdecl __threadid() msvcrt.__threadid -@ cdecl __toascii(long) msvcrt.__toascii -@ cdecl __unDName(ptr str long ptr ptr long) msvcrt.__unDName -@ cdecl __unDNameEx(ptr str long ptr ptr ptr long) msvcrt.__unDNameEx -@ extern __unguarded_readlc_active msvcrt.__unguarded_readlc_active -@ extern __wargv msvcrt.__wargv -@ cdecl __wcserror(wstr) msvcrt.__wcserror -@ cdecl __wgetmainargs(ptr ptr ptr long ptr) msvcrt.__wgetmainargs -@ extern __winitenv msvcrt.__winitenv -@ cdecl _abnormal_termination() msvcrt._abnormal_termination -@ cdecl _access(str long) msvcrt._access -@ extern _acmdln msvcrt._acmdln -@ stdcall -arch=i386 _adj_fdiv_m16i(long) msvcrt._adj_fdiv_m16i -@ stdcall -arch=i386 _adj_fdiv_m32(long) msvcrt._adj_fdiv_m32 -@ stdcall -arch=i386 _adj_fdiv_m32i(long) msvcrt._adj_fdiv_m32i -@ stdcall -arch=i386 _adj_fdiv_m64(int64) msvcrt._adj_fdiv_m64 -@ cdecl -arch=i386 _adj_fdiv_r() msvcrt._adj_fdiv_r -@ stdcall -arch=i386 _adj_fdivr_m16i(long) msvcrt._adj_fdivr_m16i -@ stdcall -arch=i386 _adj_fdivr_m32(long) msvcrt._adj_fdivr_m32 -@ stdcall -arch=i386 _adj_fdivr_m32i(long) msvcrt._adj_fdivr_m32i -@ stdcall -arch=i386 _adj_fdivr_m64(int64) msvcrt._adj_fdivr_m64 -@ cdecl -arch=i386 _adj_fpatan() msvcrt._adj_fpatan -@ cdecl -arch=i386 _adj_fprem() msvcrt._adj_fprem -@ cdecl -arch=i386 _adj_fprem1() msvcrt._adj_fprem1 -@ cdecl -arch=i386 _adj_fptan() msvcrt._adj_fptan -@ extern -arch=i386 _adjust_fdiv msvcrt._adjust_fdiv -@ extern _aexit_rtn msvcrt._aexit_rtn -@ cdecl _aligned_free(ptr) msvcrt._aligned_free -@ cdecl _aligned_malloc(long long) msvcrt._aligned_malloc -@ cdecl _aligned_offset_malloc(long long long) msvcrt._aligned_offset_malloc -@ cdecl _aligned_offset_realloc(ptr long long long) msvcrt._aligned_offset_realloc -@ cdecl _aligned_realloc(ptr long long) msvcrt._aligned_realloc -@ cdecl _amsg_exit(long) msvcrt._amsg_exit -@ cdecl _assert(str str long) msvcrt._assert -@ cdecl _atodbl(ptr str) msvcrt._atodbl -@ cdecl -ret64 _atoi64(str) msvcrt._atoi64 -@ cdecl _atoldbl(ptr str) msvcrt._atoldbl -@ cdecl _beep(long long) msvcrt._beep -@ cdecl _beginthread(ptr long ptr) msvcrt._beginthread -@ cdecl _beginthreadex(ptr long ptr ptr long ptr) msvcrt._beginthreadex -@ cdecl _c_exit() msvcrt._c_exit -@ cdecl _cabs(long) msvcrt._cabs -@ cdecl _callnewh(long) msvcrt._callnewh -@ cdecl _cexit() msvcrt._cexit -@ cdecl _cgets(ptr) msvcrt._cgets +@ extern __setlc_active MSVCRT___setlc_active +@ cdecl __setusermatherr(ptr) MSVCRT___setusermatherr +@ cdecl __threadhandle() kernel32.GetCurrentThread +@ cdecl __threadid() kernel32.GetCurrentThreadId +@ cdecl __toascii(long) MSVCRT___toascii +@ cdecl __unDName(ptr str long ptr ptr long) +@ cdecl __unDNameEx(ptr str long ptr ptr ptr long) +@ extern __unguarded_readlc_active MSVCRT___unguarded_readlc_active +@ extern __wargv MSVCRT___wargv +@ cdecl __wcserror(wstr) MSVCRT___wcserror +@ cdecl __wgetmainargs(ptr ptr ptr long ptr) +@ extern __winitenv MSVCRT___winitenv +@ cdecl _abnormal_termination() +@ cdecl _access(str long) MSVCRT__access +@ extern _acmdln MSVCRT__acmdln +@ stdcall -arch=i386 _adj_fdiv_m16i(long) +@ stdcall -arch=i386 _adj_fdiv_m32(long) +@ stdcall -arch=i386 _adj_fdiv_m32i(long) +@ stdcall -arch=i386 _adj_fdiv_m64(int64) +@ cdecl -arch=i386 _adj_fdiv_r() +@ stdcall -arch=i386 _adj_fdivr_m16i(long) +@ stdcall -arch=i386 _adj_fdivr_m32(long) +@ stdcall -arch=i386 _adj_fdivr_m32i(long) +@ stdcall -arch=i386 _adj_fdivr_m64(int64) +@ cdecl -arch=i386 _adj_fpatan() +@ cdecl -arch=i386 _adj_fprem() +@ cdecl -arch=i386 _adj_fprem1() +@ cdecl -arch=i386 _adj_fptan() +@ extern -arch=i386 _adjust_fdiv MSVCRT__adjust_fdiv +@ extern _aexit_rtn +@ cdecl _aligned_free(ptr) +@ cdecl _aligned_malloc(long long) +@ cdecl _aligned_offset_malloc(long long long) +@ cdecl _aligned_offset_realloc(ptr long long long) +@ cdecl _aligned_realloc(ptr long long) +@ cdecl _amsg_exit(long) +@ cdecl _assert(str str long) MSVCRT__assert +@ cdecl _atodbl(ptr str) MSVCRT__atodbl +@ cdecl -ret64 _atoi64(str) ntdll._atoi64 +@ cdecl _atoldbl(ptr str) MSVCRT__atoldbl +@ cdecl _beep(long long) MSVCRT__beep +@ cdecl _beginthread(ptr long ptr) +@ cdecl _beginthreadex(ptr long ptr ptr long ptr) +@ cdecl _c_exit() MSVCRT__c_exit +@ cdecl _cabs(long) MSVCRT__cabs +@ cdecl _callnewh(long) +@ cdecl _cexit() MSVCRT__cexit +@ cdecl _cgets(ptr) @ stub _cgetws -@ cdecl _chdir(str) msvcrt._chdir -@ cdecl _chdrive(long) msvcrt._chdrive -@ cdecl _chgsign(double) msvcrt._chgsign -@ cdecl -arch=i386 -norelay _chkesp() msvcrt._chkesp -@ cdecl _chmod(str long) msvcrt._chmod -@ cdecl _chsize(long long) msvcrt._chsize -@ cdecl _clearfp() msvcrt._clearfp -@ cdecl _close(long) msvcrt._close -@ cdecl _commit(long) msvcrt._commit -@ extern _commode msvcrt._commode -@ cdecl _control87(long long) msvcrt._control87 -@ cdecl _controlfp(long long) msvcrt._controlfp -@ cdecl _copysign(double double) msvcrt._copysign -@ varargs _cprintf(str) msvcrt._cprintf -@ cdecl _cputs(str) msvcrt._cputs -@ cdecl _cputws(wstr) msvcrt._cputws -@ cdecl _creat(str long) msvcrt._creat -@ varargs _cscanf(str) msvcrt._cscanf -@ cdecl _ctime64(ptr) msvcrt._ctime64 -@ extern _ctype msvcrt._ctype -@ cdecl _cwait(ptr long long) msvcrt._cwait -@ varargs _cwprintf(wstr) msvcrt._cwprintf -@ varargs _cwscanf(wstr) msvcrt._cwscanf -@ extern _daylight msvcrt._daylight -@ extern _dstbias msvcrt._dstbias -@ cdecl _dup(long) msvcrt._dup -@ cdecl _dup2(long long) msvcrt._dup2 -@ cdecl _ecvt(double long ptr ptr) msvcrt._ecvt -@ cdecl _endthread() msvcrt._endthread -@ cdecl _endthreadex(long) msvcrt._endthreadex -@ extern _environ msvcrt._environ -@ cdecl _eof(long) msvcrt._eof -@ cdecl _errno() msvcrt._errno -@ cdecl -arch=i386 _except_handler2(ptr ptr ptr ptr) msvcrt._except_handler2 -@ cdecl -arch=i386 _except_handler3(ptr ptr ptr ptr) msvcrt._except_handler3 -@ varargs _execl(str str) msvcrt._execl -@ varargs _execle(str str) msvcrt._execle -@ varargs _execlp(str str) msvcrt._execlp -@ varargs _execlpe(str str) msvcrt._execlpe -@ cdecl _execv(str ptr) msvcrt._execv -@ cdecl _execve(str ptr ptr) msvcrt._execve -@ cdecl _execvp(str ptr) msvcrt._execvp -@ cdecl _execvpe(str ptr ptr) msvcrt._execvpe -@ cdecl _exit(long) msvcrt._exit -@ cdecl _expand(ptr long) msvcrt._expand -@ cdecl _fcloseall() msvcrt._fcloseall -@ cdecl _fcvt(double long ptr ptr) msvcrt._fcvt -@ cdecl _fdopen(long str) msvcrt._fdopen -@ cdecl _fgetchar() msvcrt._fgetchar -@ cdecl _fgetwchar() msvcrt._fgetwchar -@ cdecl _filbuf(ptr) msvcrt._filbuf +@ cdecl _chdir(str) MSVCRT__chdir +@ cdecl _chdrive(long) MSVCRT__chdrive +@ cdecl _chgsign(double) MSVCRT__chgsign +@ cdecl -arch=i386 -norelay _chkesp() +@ cdecl _chmod(str long) MSVCRT__chmod +@ cdecl _chsize(long long) MSVCRT__chsize +@ cdecl _clearfp() +@ cdecl _close(long) MSVCRT__close +@ cdecl _commit(long) MSVCRT__commit +@ extern _commode MSVCRT__commode +@ cdecl _control87(long long) +@ cdecl _controlfp(long long) +@ cdecl _copysign(double double) MSVCRT__copysign +@ varargs _cprintf(str) +@ cdecl _cputs(str) +@ cdecl _cputws(wstr) +@ cdecl _creat(str long) MSVCRT__creat +@ varargs _cscanf(str) +@ cdecl _ctime64(ptr) MSVCRT__ctime64 +@ extern _ctype MSVCRT__ctype +@ cdecl _cwait(ptr long long) +@ varargs _cwprintf(wstr) +@ varargs _cwscanf(wstr) +@ extern _daylight MSVCRT___daylight +@ extern _dstbias MSVCRT__dstbias +@ cdecl _dup(long) MSVCRT__dup +@ cdecl _dup2(long long) MSVCRT__dup2 +@ cdecl _ecvt(double long ptr ptr) MSVCRT__ecvt +@ cdecl _endthread() +@ cdecl _endthreadex(long) +@ extern _environ MSVCRT__environ +@ cdecl _eof(long) MSVCRT__eof +@ cdecl _errno() MSVCRT__errno +@ cdecl -arch=i386 _except_handler2(ptr ptr ptr ptr) +@ cdecl -arch=i386 _except_handler3(ptr ptr ptr ptr) +@ varargs _execl(str str) +@ varargs _execle(str str) +@ varargs _execlp(str str) +@ varargs _execlpe(str str) +@ 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 _fcloseall() MSVCRT__fcloseall +@ cdecl _fcvt(double long ptr ptr) MSVCRT__fcvt +@ cdecl _fdopen(long str) MSVCRT__fdopen +@ cdecl _fgetchar() MSVCRT__fgetchar +@ cdecl _fgetwchar() MSVCRT__fgetwchar +@ cdecl _filbuf(ptr) MSVCRT__filbuf # extern _fileinfo -@ cdecl _filelength(long) msvcrt._filelength -@ cdecl -ret64 _filelengthi64(long) msvcrt._filelengthi64 -@ cdecl _fileno(ptr) msvcrt._fileno -@ cdecl _findclose(long) msvcrt._findclose -@ cdecl _findfirst(str ptr) msvcrt._findfirst -@ cdecl _findfirst64(str ptr) msvcrt._findfirst64 -@ cdecl _findfirsti64(str ptr) msvcrt._findfirsti64 -@ cdecl _findnext(long ptr) msvcrt._findnext -@ cdecl _findnext64(long ptr) msvcrt._findnext64 -@ cdecl _findnexti64(long ptr) msvcrt._findnexti64 -@ cdecl _finite(double) msvcrt._finite -@ cdecl _flsbuf(long ptr) msvcrt._flsbuf -@ cdecl _flushall() msvcrt._flushall -@ extern _fmode msvcrt._fmode -@ cdecl _fpclass(double) msvcrt._fpclass -@ cdecl _fpieee_flt(long ptr ptr) msvcrt._fpieee_flt -@ cdecl _fpreset() msvcrt._fpreset -@ cdecl _fputchar(long) msvcrt._fputchar -@ cdecl _fputwchar(long) msvcrt._fputwchar -@ cdecl _fsopen(str str long) msvcrt._fsopen -@ cdecl _fstat(long ptr) msvcrt._fstat -@ cdecl _fstat64(long ptr) msvcrt._fstat64 -@ cdecl _fstati64(long ptr) msvcrt._fstati64 -@ cdecl _ftime(ptr) msvcrt._ftime -@ cdecl _ftime64(ptr) msvcrt._ftime64 -@ cdecl -arch=i386 -ret64 _ftol() msvcrt._ftol -@ cdecl _fullpath(ptr str long) msvcrt._fullpath -@ cdecl _futime(long ptr) msvcrt._futime -@ cdecl _futime64(long ptr) msvcrt._futime64 -@ cdecl _gcvt(double long str) msvcrt._gcvt -@ cdecl _get_osfhandle(long) msvcrt._get_osfhandle -@ cdecl _get_sbh_threshold() msvcrt._get_sbh_threshold -@ cdecl _getch() msvcrt._getch -@ cdecl _getche() msvcrt._getche -@ cdecl _getcwd(str long) msvcrt._getcwd -@ cdecl _getdcwd(long str long) msvcrt._getdcwd -@ cdecl _getdiskfree(long ptr) msvcrt._getdiskfree -@ cdecl _getdllprocaddr(long str long) msvcrt._getdllprocaddr -@ cdecl _getdrive() msvcrt._getdrive -@ cdecl _getdrives() msvcrt._getdrives -@ cdecl _getmaxstdio() msvcrt._getmaxstdio -@ cdecl _getmbcp() msvcrt._getmbcp -@ cdecl _getpid() msvcrt._getpid -@ cdecl _getsystime(ptr) msvcrt._getsystime -@ cdecl _getw(ptr) msvcrt._getw +@ cdecl _filelength(long) MSVCRT__filelength +@ cdecl -ret64 _filelengthi64(long) MSVCRT__filelengthi64 +@ cdecl _fileno(ptr) MSVCRT__fileno +@ cdecl _findclose(long) MSVCRT__findclose +@ cdecl _findfirst(str ptr) MSVCRT__findfirst +@ cdecl _findfirst64(str ptr) MSVCRT__findfirst64 +@ cdecl _findfirsti64(str ptr) MSVCRT__findfirsti64 +@ cdecl _findnext(long ptr) MSVCRT__findnext +@ cdecl _findnext64(long ptr) MSVCRT__findnext64 +@ cdecl _findnexti64(long ptr) MSVCRT__findnexti64 +@ cdecl _finite(double) MSVCRT__finite +@ cdecl _flsbuf(long ptr) MSVCRT__flsbuf +@ cdecl _flushall() MSVCRT__flushall +@ extern _fmode MSVCRT__fmode +@ cdecl _fpclass(double) MSVCRT__fpclass +@ stub _fpieee_flt(long ptr ptr) +@ cdecl _fpreset() +@ cdecl _fputchar(long) MSVCRT__fputchar +@ cdecl _fputwchar(long) MSVCRT__fputwchar +@ cdecl _fsopen(str str long) MSVCRT__fsopen +@ cdecl _fstat(long ptr) MSVCRT__fstat +@ cdecl _fstat64(long ptr) MSVCRT__fstat64 +@ cdecl _fstati64(long ptr) MSVCRT__fstati64 +@ cdecl _ftime(ptr) MSVCRT__ftime +@ cdecl _ftime64(ptr) MSVCRT__ftime64 +@ cdecl -arch=i386 -ret64 _ftol() MSVCRT__ftol +@ cdecl _fullpath(ptr str long) MSVCRT__fullpath +@ cdecl _futime(long ptr) +@ cdecl _futime64(long ptr) +@ cdecl _gcvt(double long str) MSVCRT__gcvt +@ cdecl _get_osfhandle(long) MSVCRT__get_osfhandle +@ cdecl _get_sbh_threshold() +@ cdecl _getch() +@ cdecl _getche() +@ 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 @ stub _getwch @ stub _getwche -@ cdecl _getws(ptr) msvcrt._getws -@ cdecl -arch=i386 _global_unwind2(ptr) msvcrt._global_unwind2 -@ cdecl _gmtime64(ptr) msvcrt._gmtime64 -@ cdecl _heapadd(ptr long) msvcrt._heapadd -@ cdecl _heapchk() msvcrt._heapchk -@ cdecl _heapmin() msvcrt._heapmin -@ cdecl _heapset(long) msvcrt._heapset -@ cdecl _heapused(ptr ptr) msvcrt._heapused -@ cdecl _heapwalk(ptr) msvcrt._heapwalk -@ cdecl _hypot(double double) msvcrt._hypot -@ cdecl _i64toa(int64 ptr long) msvcrt._i64toa -@ cdecl _i64tow(int64 ptr long) msvcrt._i64tow -@ cdecl _initterm(ptr ptr) msvcrt._initterm -@ cdecl -arch=i386 _inp(long) msvcrt._inp -@ cdecl -arch=i386 _inpd(long) msvcrt._inpd -@ cdecl -arch=i386 _inpw(long) msvcrt._inpw -@ extern _iob msvcrt._iob -@ cdecl _isatty(long) msvcrt._isatty -@ cdecl _isctype(long long) msvcrt._isctype -@ cdecl _ismbbalnum(long) msvcrt._ismbbalnum -@ cdecl _ismbbalpha(long) msvcrt._ismbbalpha -@ cdecl _ismbbgraph(long) msvcrt._ismbbgraph -@ cdecl _ismbbkalnum(long) msvcrt._ismbbkalnum -@ cdecl _ismbbkana(long) msvcrt._ismbbkana -@ cdecl _ismbbkprint(long) msvcrt._ismbbkprint -@ cdecl _ismbbkpunct(long) msvcrt._ismbbkpunct -@ cdecl _ismbblead(long) msvcrt._ismbblead -@ cdecl _ismbbprint(long) msvcrt._ismbbprint -@ cdecl _ismbbpunct(long) msvcrt._ismbbpunct -@ cdecl _ismbbtrail(long) msvcrt._ismbbtrail -@ cdecl _ismbcalnum(long) msvcrt._ismbcalnum -@ cdecl _ismbcalpha(long) msvcrt._ismbcalpha -@ cdecl _ismbcdigit(long) msvcrt._ismbcdigit -@ cdecl _ismbcgraph(long) msvcrt._ismbcgraph -@ cdecl _ismbchira(long) msvcrt._ismbchira -@ cdecl _ismbckata(long) msvcrt._ismbckata -@ cdecl _ismbcl0(long) msvcrt._ismbcl0 -@ cdecl _ismbcl1(long) msvcrt._ismbcl1 -@ cdecl _ismbcl2(long) msvcrt._ismbcl2 -@ cdecl _ismbclegal(long) msvcrt._ismbclegal -@ cdecl _ismbclower(long) msvcrt._ismbclower -@ cdecl _ismbcprint(long) msvcrt._ismbcprint -@ cdecl _ismbcpunct(long) msvcrt._ismbcpunct -@ cdecl _ismbcspace(long) msvcrt._ismbcspace -@ cdecl _ismbcsymbol(long) msvcrt._ismbcsymbol -@ cdecl _ismbcupper(long) msvcrt._ismbcupper -@ cdecl _ismbslead(ptr ptr) msvcrt._ismbslead -@ cdecl _ismbstrail(ptr ptr) msvcrt._ismbstrail -@ cdecl _isnan(double) msvcrt._isnan -@ cdecl _itoa(long ptr long) msvcrt._itoa -@ cdecl _itow(long ptr long) msvcrt._itow -@ cdecl _j0(double) msvcrt._j0 -@ cdecl _j1(double) msvcrt._j1 -@ cdecl _jn(long double) msvcrt._jn -@ cdecl _kbhit() msvcrt._kbhit -@ cdecl _lfind(ptr ptr ptr long ptr) msvcrt._lfind -@ cdecl _loaddll(str) msvcrt._loaddll -@ cdecl -arch=i386 _local_unwind2(ptr long) msvcrt._local_unwind2 -@ cdecl _localtime64(ptr) msvcrt._localtime64 -@ cdecl _lock(long) msvcrt._lock -@ cdecl _locking(long long long) msvcrt._locking -@ cdecl _logb(double) msvcrt._logb -@ cdecl -arch=i386 _longjmpex(ptr long) msvcrt._longjmpex -@ cdecl _lrotl(long long) msvcrt._lrotl -@ cdecl _lrotr(long long) msvcrt._lrotr -@ cdecl _lsearch(ptr ptr ptr long ptr) msvcrt._lsearch -@ cdecl _lseek(long long long) msvcrt._lseek -@ cdecl -ret64 _lseeki64(long int64 long) msvcrt._lseeki64 -@ cdecl _ltoa(long ptr long) msvcrt._ltoa -@ cdecl _ltow(long ptr long) msvcrt._ltow -@ cdecl _makepath(ptr str str str str) msvcrt._makepath -@ cdecl _mbbtombc(long) msvcrt._mbbtombc -@ cdecl _mbbtype(long long) msvcrt._mbbtype +@ cdecl _getws(ptr) MSVCRT__getws +@ cdecl -arch=i386 _global_unwind2(ptr) +@ cdecl _gmtime64(ptr) MSVCRT__gmtime64 +@ cdecl _heapadd(ptr long) +@ cdecl _heapchk() +@ cdecl _heapmin() +@ cdecl _heapset(long) +@ stub _heapused(ptr ptr) +@ cdecl _heapwalk(ptr) +@ cdecl _hypot(double double) +@ cdecl _i64toa(int64 ptr long) ntdll._i64toa +@ cdecl _i64tow(int64 ptr long) ntdll._i64tow +@ cdecl _initterm(ptr ptr) +@ stub -arch=i386 _inp(long) +@ stub -arch=i386 _inpd(long) +@ stub -arch=i386 _inpw(long) +@ extern _iob MSVCRT__iob +@ cdecl _isatty(long) MSVCRT__isatty +@ cdecl _isctype(long long) MSVCRT__isctype +@ stub _ismbbalnum(long) +@ stub _ismbbalpha(long) +@ stub _ismbbgraph(long) +@ stub _ismbbkalnum(long) +@ cdecl _ismbbkana(long) +@ stub _ismbbkprint(long) +@ stub _ismbbkpunct(long) +@ cdecl _ismbblead(long) +@ stub _ismbbprint(long) +@ stub _ismbbpunct(long) +@ cdecl _ismbbtrail(long) +@ cdecl _ismbcalnum(long) +@ cdecl _ismbcalpha(long) +@ cdecl _ismbcdigit(long) +@ cdecl _ismbcgraph(long) +@ cdecl _ismbchira(long) +@ cdecl _ismbckata(long) +@ stub _ismbcl0(long) +@ stub _ismbcl1(long) +@ stub _ismbcl2(long) +@ cdecl _ismbclegal(long) +@ cdecl _ismbclower(long) +@ cdecl _ismbcprint(long) +@ cdecl _ismbcpunct(long) +@ cdecl _ismbcspace(long) +@ cdecl _ismbcsymbol(long) +@ cdecl _ismbcupper(long) +@ cdecl _ismbslead(ptr ptr) +@ cdecl _ismbstrail(ptr ptr) +@ cdecl _isnan(double) MSVCRT__isnan +@ cdecl _itoa(long ptr long) MSVCRT__itoa +@ cdecl _itow(long ptr long) ntdll._itow +@ cdecl _j0(double) MSVCRT__j0 +@ cdecl _j1(double) MSVCRT__j1 +@ cdecl _jn(long double) MSVCRT__jn +@ cdecl _kbhit() +@ cdecl _lfind(ptr ptr ptr long ptr) +@ cdecl _loaddll(str) +@ cdecl -arch=i386 _local_unwind2(ptr long) +@ cdecl _localtime64(ptr) MSVCRT__localtime64 +@ cdecl _lock(long) +@ cdecl _locking(long long long) MSVCRT__locking +@ cdecl _logb(double) MSVCRT__logb +@ 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) +@ cdecl _lseek(long long long) MSVCRT__lseek +@ cdecl -ret64 _lseeki64(long int64 long) MSVCRT__lseeki64 +@ cdecl _ltoa(long ptr long) ntdll._ltoa +@ cdecl _ltow(long ptr long) ntdll._ltow +@ cdecl _makepath(ptr str str str str) MSVCRT__makepath +@ cdecl _mbbtombc(long) +@ cdecl _mbbtype(long long) # extern _mbcasemap -@ cdecl _mbccpy(ptr str) msvcrt._mbccpy -@ cdecl _mbcjistojms(long) msvcrt._mbcjistojms -@ cdecl _mbcjmstojis(long) msvcrt._mbcjmstojis -@ cdecl _mbclen(ptr) msvcrt._mbclen -@ cdecl _mbctohira(long) msvcrt._mbctohira -@ cdecl _mbctokata(long) msvcrt._mbctokata -@ cdecl _mbctolower(long) msvcrt._mbctolower -@ cdecl _mbctombb(long) msvcrt._mbctombb -@ cdecl _mbctoupper(long) msvcrt._mbctoupper -@ extern _mbctype msvcrt._mbctype -@ cdecl _mbsbtype(str long) msvcrt._mbsbtype -@ cdecl _mbscat(str str) msvcrt._mbscat -@ cdecl _mbschr(str long) msvcrt._mbschr -@ cdecl _mbscmp(str str) msvcrt._mbscmp -@ cdecl _mbscoll(str str) msvcrt._mbscoll -@ cdecl _mbscpy(ptr str) msvcrt._mbscpy -@ cdecl _mbscspn(str str) msvcrt._mbscspn -@ cdecl _mbsdec(ptr ptr) msvcrt._mbsdec -@ cdecl _mbsdup(str) msvcrt._mbsdup -@ cdecl _mbsicmp(str str) msvcrt._mbsicmp -@ cdecl _mbsicoll(str str) msvcrt._mbsicoll -@ cdecl _mbsinc(str) msvcrt._mbsinc -@ cdecl _mbslen(str) msvcrt._mbslen -@ cdecl _mbslwr(str) msvcrt._mbslwr -@ cdecl _mbsnbcat(str str long) msvcrt._mbsnbcat -@ cdecl _mbsnbcmp(str str long) msvcrt._mbsnbcmp -@ cdecl _mbsnbcnt(ptr long) msvcrt._mbsnbcnt -@ cdecl _mbsnbcoll(str str long) msvcrt._mbsnbcoll -@ cdecl _mbsnbcpy(ptr str long) msvcrt._mbsnbcpy -@ cdecl _mbsnbicmp(str str long) msvcrt._mbsnbicmp -@ cdecl _mbsnbicoll(str str long) msvcrt._mbsnbicoll -@ cdecl _mbsnbset(ptr long long) msvcrt._mbsnbset -@ cdecl _mbsncat(str str long) msvcrt._mbsncat -@ cdecl _mbsnccnt(str long) msvcrt._mbsnccnt -@ cdecl _mbsncmp(str str long) msvcrt._mbsncmp -@ cdecl _mbsncoll(str str long) msvcrt._mbsncoll -@ cdecl _mbsncpy(ptr str long) msvcrt._mbsncpy -@ cdecl _mbsnextc(str) msvcrt._mbsnextc -@ cdecl _mbsnicmp(str str long) msvcrt._mbsnicmp -@ cdecl _mbsnicoll(str str long) msvcrt._mbsnicoll -@ cdecl _mbsninc(str long) msvcrt._mbsninc -@ cdecl _mbsnset(ptr long long) msvcrt._mbsnset -@ cdecl _mbspbrk(str str) msvcrt._mbspbrk -@ cdecl _mbsrchr(str long) msvcrt._mbsrchr -@ cdecl _mbsrev(str) msvcrt._mbsrev -@ cdecl _mbsset(ptr long) msvcrt._mbsset -@ cdecl _mbsspn(str str) msvcrt._mbsspn -@ cdecl _mbsspnp(str str) msvcrt._mbsspnp -@ cdecl _mbsstr(str str) msvcrt._mbsstr -@ cdecl _mbstok(str str) msvcr100._mbstok #don't forward to msvcrt -@ cdecl _mbstrlen(str) msvcrt._mbstrlen -@ cdecl _mbsupr(str) msvcrt._mbsupr -@ cdecl _memccpy(ptr ptr long long) msvcrt._memccpy -@ cdecl _memicmp(str str long) msvcrt._memicmp -@ cdecl _mkdir(str) msvcrt._mkdir -@ cdecl _mktemp(str) msvcrt._mktemp -@ cdecl _mktime64(ptr) msvcrt._mktime64 -@ cdecl _msize(ptr) msvcrt._msize -@ cdecl _nextafter(double double) msvcrt._nextafter -@ cdecl _onexit(ptr) msvcrt._onexit -@ varargs _open(str long) msvcrt._open -@ cdecl _open_osfhandle(long long) msvcrt._open_osfhandle -@ extern _osplatform msvcrt._osplatform -@ extern _osver msvcrt._osver -@ cdecl -arch=i386 _outp(long long) msvcrt._outp -@ cdecl -arch=i386 _outpd(long long) msvcrt._outpd -@ cdecl -arch=i386 _outpw(long long) msvcrt._outpw -@ cdecl _pclose(ptr) msvcrt._pclose -@ extern _pctype msvcrt._pctype -@ extern _pgmptr msvcrt._pgmptr -@ cdecl _pipe(ptr long long) msvcrt._pipe -@ cdecl _popen(str str) msvcrt._popen -@ cdecl _purecall() msvcrt._purecall -@ cdecl _putch(long) msvcrt._putch -@ cdecl _putenv(str) msvcrt._putenv -@ cdecl _putw(long ptr) msvcrt._putw -@ cdecl _putwch(long) msvcrt._putwch -@ cdecl _putws(wstr) msvcrt._putws +@ cdecl _mbccpy(ptr str) +@ cdecl _mbcjistojms(long) +@ cdecl _mbcjmstojis(long) +@ cdecl _mbclen(ptr) +@ stub _mbctohira(long) +@ stub _mbctokata(long) +@ cdecl _mbctolower(long) +@ cdecl _mbctombb(long) +@ cdecl _mbctoupper(long) +@ extern _mbctype MSVCRT_mbctype +@ cdecl _mbsbtype(str long) +@ cdecl _mbscat(str str) +@ cdecl _mbschr(str long) +@ cdecl _mbscmp(str str) +@ cdecl _mbscoll(str str) +@ cdecl _mbscpy(ptr str) +@ cdecl _mbscspn(str str) +@ cdecl _mbsdec(ptr ptr) +@ cdecl _mbsdup(str) MSVCRT__strdup +@ cdecl _mbsicmp(str str) +@ cdecl _mbsicoll(str str) +@ cdecl _mbsinc(str) +@ cdecl _mbslen(str) +@ cdecl _mbslwr(str) +@ cdecl _mbsnbcat(str str long) +@ cdecl _mbsnbcmp(str str long) +@ cdecl _mbsnbcnt(ptr long) +@ cdecl _mbsnbcoll(str str long) +@ cdecl _mbsnbcpy(ptr str long) +@ cdecl _mbsnbicmp(str str long) +@ cdecl _mbsnbicoll(str str long) +@ cdecl _mbsnbset(ptr long long) +@ cdecl _mbsncat(str str long) +@ cdecl _mbsnccnt(str long) +@ cdecl _mbsncmp(str str long) +@ stub _mbsncoll(str str long) +@ cdecl _mbsncpy(ptr str long) +@ cdecl _mbsnextc(str) +@ cdecl _mbsnicmp(str str long) +@ stub _mbsnicoll(str str long) +@ cdecl _mbsninc(str long) +@ cdecl _mbsnset(ptr long long) +@ cdecl _mbspbrk(str str) +@ cdecl _mbsrchr(str long) +@ cdecl _mbsrev(str) +@ cdecl _mbsset(ptr long) +@ cdecl _mbsspn(str str) +@ cdecl _mbsspnp(str str) +@ cdecl _mbsstr(str str) +@ cdecl _mbstok(str str) +@ cdecl _mbstrlen(str) +@ cdecl _mbsupr(str) +@ cdecl _memccpy(ptr ptr long long) ntdll._memccpy +@ cdecl _memicmp(str str long) ntdll._memicmp +@ cdecl _mkdir(str) MSVCRT__mkdir +@ cdecl _mktemp(str) MSVCRT__mktemp +@ cdecl _mktime64(ptr) MSVCRT__mktime64 +@ cdecl _msize(ptr) +@ cdecl _nextafter(double double) MSVCRT__nextafter +@ cdecl _onexit(ptr) MSVCRT__onexit +@ varargs _open(str long) MSVCRT__open +@ cdecl _open_osfhandle(long long) MSVCRT__open_osfhandle +@ extern _osplatform MSVCRT__osplatform +@ extern _osver MSVCRT__osver +@ stub -arch=i386 _outp(long long) +@ stub -arch=i386 _outpd(long long) +@ stub -arch=i386 _outpw(long long) +@ cdecl _pclose(ptr) MSVCRT__pclose +@ extern _pctype MSVCRT__pctype +@ extern _pgmptr MSVCRT__pgmptr +@ cdecl _pipe(ptr long long) MSVCRT__pipe +@ cdecl _popen(str str) MSVCRT__popen +@ cdecl _purecall() +@ cdecl _putch(long) +@ cdecl _putenv(str) +@ cdecl _putw(long ptr) MSVCRT__putw +@ cdecl _putwch(long) MSVCRT__putwch +@ cdecl _putws(wstr) MSVCRT__putws # extern _pwctype -@ cdecl _read(long ptr long) msvcrt._read -@ cdecl _resetstkoflw() msvcrt._resetstkoflw -@ cdecl _rmdir(str) msvcrt._rmdir -@ cdecl _rmtmp() msvcrt._rmtmp -@ cdecl _rotl(long long) msvcrt._rotl -@ cdecl _rotr(long long) msvcrt._rotr -@ cdecl -arch=i386 _safe_fdiv() msvcrt._safe_fdiv -@ cdecl -arch=i386 _safe_fdivr() msvcrt._safe_fdivr -@ cdecl -arch=i386 _safe_fprem() msvcrt._safe_fprem -@ cdecl -arch=i386 _safe_fprem1() msvcrt._safe_fprem1 -@ cdecl _scalb(double long) msvcrt._scalb -@ varargs _scprintf(str) msvcrt._scprintf -@ varargs _scwprintf(wstr) msvcrt._scwprintf -@ cdecl _searchenv(str str ptr) msvcrt._searchenv -@ stdcall -arch=i386 _seh_longjmp_unwind(ptr) msvcrt._seh_longjmp_unwind -@ cdecl _set_SSE2_enable(long) msvcrt._set_SSE2_enable -@ cdecl _set_error_mode(long) msvcrt._set_error_mode -@ cdecl _set_sbh_threshold(long) msvcrt._set_sbh_threshold -@ cdecl _set_security_error_handler(ptr) msvcrt._set_security_error_handler -@ cdecl _seterrormode(long) msvcrt._seterrormode -@ cdecl -arch=i386,x86_64,arm -norelay _setjmp(ptr) msvcrt._setjmp -@ cdecl -arch=i386 -norelay _setjmp3(ptr long) msvcrt._setjmp3 -@ cdecl _setmaxstdio(long) msvcrt._setmaxstdio -@ cdecl _setmbcp(long) msvcrt._setmbcp -@ cdecl _setmode(long long) msvcrt._setmode -@ cdecl _setsystime(ptr long) msvcrt._setsystime -@ cdecl _sleep(long) msvcrt._sleep -@ varargs _snprintf(ptr long str) msvcrt._snprintf -@ varargs _snscanf(str long str) msvcrt._snscanf -@ varargs _snwprintf(ptr long wstr) msvcrt._snwprintf -@ varargs _snwscanf(wstr long wstr) msvcrt._snwscanf -@ varargs _sopen(str long long) msvcrt._sopen -@ varargs _spawnl(long str str) msvcrt._spawnl -@ varargs _spawnle(long str str) msvcrt._spawnle -@ varargs _spawnlp(long str str) msvcrt._spawnlp -@ varargs _spawnlpe(long str str) msvcrt._spawnlpe -@ cdecl _spawnv(long str ptr) msvcrt._spawnv -@ cdecl _spawnve(long str ptr ptr) msvcrt._spawnve -@ cdecl _spawnvp(long str ptr) msvcrt._spawnvp -@ cdecl _spawnvpe(long str ptr ptr) msvcrt._spawnvpe -@ cdecl _splitpath(str ptr ptr ptr ptr) msvcrt._splitpath -@ cdecl _stat(str ptr) msvcrt._stat -@ cdecl _stat64(str ptr) msvcrt._stat64 -@ cdecl _stati64(str ptr) msvcrt._stati64 -@ cdecl _statusfp() msvcrt._statusfp -@ cdecl _strcmpi(str str) msvcrt._strcmpi -@ cdecl _strdate(ptr) msvcrt._strdate -@ cdecl _strdup(str) msvcrt._strdup -@ cdecl _strerror(long) msvcrt._strerror -@ cdecl _stricmp(str str) msvcrt._stricmp -@ cdecl _stricoll(str str) msvcrt._stricoll -@ cdecl _strlwr(str) msvcrt._strlwr -@ cdecl _strncoll(str str long) msvcrt._strncoll -@ cdecl _strnicmp(str str long) msvcrt._strnicmp -@ cdecl _strnicoll(str str long) msvcrt._strnicoll -@ cdecl _strnset(str long long) msvcrt._strnset -@ cdecl _strrev(str) msvcrt._strrev -@ cdecl _strset(str long) msvcrt._strset -@ cdecl _strtime(ptr) msvcrt._strtime -@ cdecl -ret64 _strtoi64(str ptr long) msvcrt._strtoi64 -@ cdecl -ret64 _strtoui64(str ptr long) msvcrt._strtoui64 -@ cdecl _strupr(str) msvcrt._strupr -@ cdecl _swab(str str long) msvcrt._swab -@ extern _sys_errlist msvcrt._sys_errlist -@ extern _sys_nerr msvcrt._sys_nerr -@ cdecl _tell(long) msvcrt._tell -@ cdecl -ret64 _telli64(long) msvcrt._telli64 -@ cdecl _tempnam(str str) msvcrt._tempnam -@ cdecl _time64(ptr) msvcrt._time64 -@ extern _timezone msvcrt._timezone -@ cdecl _tolower(long) msvcrt._tolower -@ cdecl _toupper(long) msvcrt._toupper -@ extern _tzname msvcrt._tzname -@ cdecl _tzset() msvcrt._tzset -@ cdecl _ui64toa(int64 ptr long) msvcrt._ui64toa -@ cdecl _ui64tow(int64 ptr long) msvcrt._ui64tow -@ cdecl _ultoa(long ptr long) msvcrt._ultoa -@ cdecl _ultow(long ptr long) msvcrt._ultow -@ cdecl _umask(long) msvcrt._umask -@ cdecl _ungetch(long) msvcrt._ungetch +@ cdecl _read(long ptr long) MSVCRT__read +@ cdecl _resetstkoflw() MSVCRT__resetstkoflw +@ cdecl _rmdir(str) MSVCRT__rmdir +@ cdecl _rmtmp() MSVCRT__rmtmp +@ cdecl _rotl(long long) +@ cdecl _rotr(long long) +@ cdecl -arch=i386 _safe_fdiv() +@ cdecl -arch=i386 _safe_fdivr() +@ cdecl -arch=i386 _safe_fprem() +@ cdecl -arch=i386 _safe_fprem1() +@ cdecl _scalb(double long) MSVCRT__scalb +@ varargs _scprintf(str) MSVCRT__scprintf +@ varargs _scwprintf(wstr) MSVCRT__scwprintf +@ cdecl _searchenv(str str ptr) MSVCRT__searchenv +@ stdcall -arch=i386 _seh_longjmp_unwind(ptr) +@ cdecl _set_SSE2_enable(long) MSVCRT__set_SSE2_enable +@ cdecl _set_error_mode(long) +@ cdecl _set_sbh_threshold(long) +@ cdecl _set_security_error_handler(ptr) +@ cdecl _seterrormode(long) +@ cdecl -arch=i386,x86_64,arm -norelay _setjmp(ptr) MSVCRT__setjmp +@ 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 _snprintf(ptr long str) MSVCRT__snprintf +@ varargs _snscanf(str long str) MSVCRT__snscanf +@ varargs _snwprintf(ptr long wstr) MSVCRT__snwprintf +@ varargs _snwscanf(wstr long wstr) MSVCRT__snwscanf +@ varargs _sopen(str long long) MSVCRT__sopen +@ 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 _stat(str ptr) MSVCRT_stat +@ cdecl _stat64(str ptr) MSVCRT_stat64 +@ cdecl _stati64(str ptr) MSVCRT_stati64 +@ cdecl _statusfp() +@ cdecl _strcmpi(str str) MSVCRT__stricmp +@ cdecl _strdate(ptr) MSVCRT__strdate +@ cdecl _strdup(str) MSVCRT__strdup +@ cdecl _strerror(long) MSVCRT__strerror +@ cdecl _stricmp(str str) MSVCRT__stricmp +@ cdecl _stricoll(str str) MSVCRT__stricoll +@ cdecl _strlwr(str) MSVCRT__strlwr +@ cdecl _strncoll(str str long) MSVCRT__strncoll +@ cdecl _strnicmp(str str long) MSVCRT__strnicmp +@ cdecl _strnicoll(str str long) MSVCRT__strnicoll +@ cdecl _strnset(str long long) MSVCRT__strnset +@ cdecl _strrev(str) MSVCRT__strrev +@ cdecl _strset(str long) +@ cdecl _strtime(ptr) MSVCRT__strtime +@ cdecl -ret64 _strtoi64(str ptr long) MSVCRT_strtoi64 +@ cdecl -ret64 _strtoui64(str ptr long) MSVCRT_strtoui64 +@ cdecl _strupr(str) MSVCRT__strupr +@ cdecl _swab(str str long) MSVCRT__swab +@ extern _sys_errlist MSVCRT__sys_errlist +@ extern _sys_nerr MSVCRT__sys_nerr +@ cdecl _tell(long) MSVCRT__tell +@ cdecl -ret64 _telli64(long) +@ cdecl _tempnam(str str) MSVCRT__tempnam +@ cdecl _time64(ptr) MSVCRT__time64 +@ extern _timezone MSVCRT___timezone +@ cdecl _tolower(long) MSVCRT__tolower +@ cdecl _toupper(long) MSVCRT__toupper +@ extern _tzname MSVCRT__tzname +@ cdecl _tzset() MSVCRT__tzset +@ cdecl _ui64toa(int64 ptr long) ntdll._ui64toa +@ cdecl _ui64tow(int64 ptr long) ntdll._ui64tow +@ cdecl _ultoa(long ptr long) ntdll._ultoa +@ cdecl _ultow(long ptr long) ntdll._ultow +@ cdecl _umask(long) MSVCRT__umask +@ cdecl _ungetch(long) @ stub _ungetwch -@ cdecl _unlink(str) msvcrt._unlink -@ cdecl _unloaddll(long) msvcrt._unloaddll -@ cdecl _unlock(long) msvcrt._unlock -@ cdecl _utime(str ptr) msvcrt._utime -@ cdecl _utime64(str ptr) msvcrt._utime64 -@ cdecl _vscprintf(str ptr) msvcrt._vscprintf -@ cdecl _vscwprintf(wstr ptr) msvcrt._vscwprintf -@ cdecl _vsnprintf(ptr long str ptr) msvcrt._vsnprintf -@ cdecl _vsnwprintf(ptr long wstr ptr) msvcrt._vsnwprintf -@ cdecl _waccess(wstr long) msvcrt._waccess -@ cdecl _wasctime(ptr) msvcrt._wasctime -@ cdecl _wchdir(wstr) msvcrt._wchdir -@ cdecl _wchmod(wstr long) msvcrt._wchmod -@ extern _wcmdln msvcrt._wcmdln -@ cdecl _wcreat(wstr long) msvcrt._wcreat -@ cdecl _wcsdup(wstr) msvcrt._wcsdup -@ cdecl _wcserror(long) msvcrt._wcserror -@ cdecl _wcsicmp(wstr wstr) msvcrt._wcsicmp -@ cdecl _wcsicoll(wstr wstr) msvcrt._wcsicoll -@ cdecl _wcslwr(wstr) msvcrt._wcslwr -@ cdecl _wcsncoll(wstr wstr long) msvcrt._wcsncoll -@ cdecl _wcsnicmp(wstr wstr long) msvcrt._wcsnicmp -@ cdecl _wcsnicoll(wstr wstr long) msvcrt._wcsnicoll -@ cdecl _wcsnset(wstr long long) msvcrt._wcsnset -@ cdecl _wcsrev(wstr) msvcrt._wcsrev -@ cdecl _wcsset(wstr long) msvcrt._wcsset -@ cdecl -ret64 _wcstoi64(wstr ptr long) msvcrt._wcstoi64 -@ cdecl -ret64 _wcstoui64(wstr ptr long) msvcrt._wcstoui64 -@ cdecl _wcsupr(wstr) msvcrt._wcsupr -@ cdecl _wctime(ptr) msvcrt._wctime -@ cdecl _wctime64(ptr) msvcrt._wctime64 +@ cdecl _unlink(str) MSVCRT__unlink +@ cdecl _unloaddll(long) +@ cdecl _unlock(long) +@ cdecl _utime(str ptr) +@ cdecl _utime64(str ptr) +@ cdecl _vscprintf(str ptr) MSVCRT__vscprintf +@ cdecl _vscwprintf(wstr ptr) MSVCRT__vscwprintf +@ cdecl _vsnprintf(ptr long str ptr) MSVCRT_vsnprintf +@ cdecl _vsnwprintf(ptr long wstr ptr) MSVCRT_vsnwprintf +@ cdecl _waccess(wstr long) MSVCRT__waccess +@ cdecl _wasctime(ptr) MSVCRT__wasctime +@ cdecl _wchdir(wstr) MSVCRT__wchdir +@ cdecl _wchmod(wstr long) MSVCRT__wchmod +@ extern _wcmdln MSVCRT__wcmdln +@ cdecl _wcreat(wstr long) MSVCRT__wcreat +@ cdecl _wcsdup(wstr) MSVCRT__wcsdup +@ cdecl _wcserror(long) MSVCRT__wcserror +@ cdecl _wcsicmp(wstr wstr) MSVCRT__wcsicmp +@ cdecl _wcsicoll(wstr wstr) MSVCRT__wcsicoll +@ cdecl _wcslwr(wstr) ntdll._wcslwr +@ cdecl _wcsncoll(wstr wstr long) MSVCRT__wcsncoll +@ cdecl _wcsnicmp(wstr wstr long) MSVCRT__wcsnicmp +@ cdecl _wcsnicoll(wstr wstr long) MSVCRT__wcsnicoll +@ cdecl _wcsnset(wstr long long) MSVCRT__wcsnset +@ cdecl _wcsrev(wstr) MSVCRT__wcsrev +@ cdecl _wcsset(wstr long) MSVCRT__wcsset +@ cdecl -ret64 _wcstoi64(wstr ptr long) MSVCRT__wcstoi64 +@ cdecl -ret64 _wcstoui64(wstr ptr long) MSVCRT__wcstoui64 +@ cdecl _wcsupr(wstr) ntdll._wcsupr +@ cdecl _wctime(ptr) MSVCRT__wctime +@ cdecl _wctime64(ptr) MSVCRT__wctime64 # extern _wctype -@ extern _wenviron msvcrt._wenviron -@ varargs _wexecl(wstr wstr) msvcrt._wexecl -@ varargs _wexecle(wstr wstr) msvcrt._wexecle -@ varargs _wexeclp(wstr wstr) msvcrt._wexeclp -@ varargs _wexeclpe(wstr wstr) msvcrt._wexeclpe -@ cdecl _wexecv(wstr ptr) msvcrt._wexecv -@ cdecl _wexecve(wstr ptr ptr) msvcrt._wexecve -@ cdecl _wexecvp(wstr ptr) msvcrt._wexecvp -@ cdecl _wexecvpe(wstr ptr ptr) msvcrt._wexecvpe -@ cdecl _wfdopen(long wstr) msvcrt._wfdopen -@ cdecl _wfindfirst(wstr ptr) msvcrt._wfindfirst -@ cdecl _wfindfirst64(wstr ptr) msvcrt._wfindfirst64 -@ cdecl _wfindfirsti64(wstr ptr) msvcrt._wfindfirsti64 -@ cdecl _wfindnext(long ptr) msvcrt._wfindnext -@ cdecl _wfindnext64(long ptr) msvcrt._wfindnext64 -@ cdecl _wfindnexti64(long ptr) msvcrt._wfindnexti64 -@ cdecl _wfopen(wstr wstr) msvcrt._wfopen -@ cdecl _wfreopen(wstr wstr ptr) msvcrt._wfreopen -@ 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 -@ extern _winmajor msvcrt._winmajor -@ extern _winminor msvcrt._winminor -@ extern _winver msvcrt._winver -@ cdecl _wmakepath(ptr wstr wstr wstr wstr) msvcrt._wmakepath -@ cdecl _wmkdir(wstr) msvcrt._wmkdir -@ cdecl _wmktemp(wstr) msvcrt._wmktemp -@ varargs _wopen(wstr long) msvcrt._wopen -@ cdecl _wperror(wstr) msvcrt._wperror -@ extern _wpgmptr msvcrt._wpgmptr -@ cdecl _wpopen(wstr wstr) msvcrt._wpopen -@ cdecl _wputenv(wstr) msvcrt._wputenv -@ 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 _wsetlocale(long wstr) msvcrt._wsetlocale -@ varargs _wsopen(wstr long long) msvcrt._wsopen -@ varargs _wspawnl(long wstr wstr) msvcrt._wspawnl -@ varargs _wspawnle(long wstr wstr) msvcrt._wspawnle -@ varargs _wspawnlp(long wstr wstr) msvcrt._wspawnlp -@ varargs _wspawnlpe(long wstr wstr) msvcrt._wspawnlpe -@ cdecl _wspawnv(long wstr ptr) msvcrt._wspawnv -@ cdecl _wspawnve(long wstr ptr ptr) msvcrt._wspawnve -@ cdecl _wspawnvp(long wstr ptr) msvcrt._wspawnvp -@ cdecl _wspawnvpe(long wstr ptr ptr) msvcrt._wspawnvpe -@ cdecl _wsplitpath(wstr ptr ptr ptr ptr) msvcrt._wsplitpath -@ cdecl _wstat(wstr ptr) msvcrt._wstat -@ cdecl _wstat64(wstr ptr) msvcrt._wstat64 -@ cdecl _wstati64(wstr ptr) msvcrt._wstati64 -@ cdecl _wstrdate(ptr) msvcrt._wstrdate -@ cdecl _wstrtime(ptr) msvcrt._wstrtime -@ cdecl _wsystem(wstr) msvcrt._wsystem -@ cdecl _wtempnam(wstr wstr) msvcrt._wtempnam -@ cdecl _wtmpnam(ptr) msvcrt._wtmpnam -@ cdecl _wtof(wstr) msvcrt._wtof -@ cdecl _wtoi(wstr) msvcrt._wtoi -@ cdecl -ret64 _wtoi64(wstr) msvcrt._wtoi64 -@ cdecl _wtol(wstr) msvcrt._wtol -@ cdecl _wunlink(wstr) msvcrt._wunlink -@ cdecl _wutime(wstr ptr) msvcrt._wutime -@ cdecl _wutime64(wstr ptr) msvcrt._wutime64 -@ 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 asctime(ptr) msvcrt.asctime -@ cdecl asin(double) msvcrt.asin -@ cdecl atan(double) msvcrt.atan -@ cdecl atan2(double double) msvcrt.atan2 -@ cdecl atexit(ptr) msvcrt.atexit -@ cdecl atof(str) msvcrt.atof -@ cdecl atoi(str) msvcr100.atoi #don't forward to msvcrt -@ cdecl atol(str) msvcrt.atol -@ cdecl bsearch(ptr ptr long long ptr) msvcrt.bsearch -@ cdecl calloc(long long) msvcrt.calloc -@ cdecl ceil(double) msvcrt.ceil -@ cdecl clearerr(ptr) msvcrt.clearerr -@ cdecl clock() msvcrt.clock -@ cdecl cos(double) msvcrt.cos -@ cdecl cosh(double) msvcrt.cosh -@ cdecl ctime(ptr) msvcrt.ctime -@ cdecl difftime(long long) msvcrt.difftime -@ cdecl -ret64 div(long long) msvcrt.div -@ cdecl exit(long) msvcrt.exit -@ cdecl exp(double) msvcrt.exp -@ cdecl fabs(double) msvcrt.fabs -@ cdecl fclose(ptr) msvcrt.fclose -@ cdecl feof(ptr) msvcrt.feof -@ cdecl ferror(ptr) msvcrt.ferror -@ 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 fmod(double double) msvcrt.fmod -@ cdecl fopen(str str) msvcrt.fopen -@ varargs fprintf(ptr str) msvcrt.fprintf -@ 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 free(ptr) msvcrt.free -@ cdecl freopen(str str ptr) msvcrt.freopen -@ cdecl frexp(double ptr) msvcrt.frexp -@ varargs fscanf(ptr str) msvcrt.fscanf -@ cdecl fseek(ptr long long) msvcrt.fseek -@ cdecl fsetpos(ptr ptr) msvcrt.fsetpos -@ cdecl ftell(ptr) msvcrt.ftell -@ varargs fwprintf(ptr wstr) msvcrt.fwprintf -@ cdecl fwrite(ptr long long ptr) msvcrt.fwrite -@ varargs fwscanf(ptr wstr) msvcrt.fwscanf -@ cdecl getc(ptr) msvcrt.getc -@ cdecl getchar() msvcrt.getchar -@ cdecl getenv(str) msvcrt.getenv -@ cdecl gets(str) msvcrt.gets -@ cdecl getwc(ptr) msvcrt.getwc -@ cdecl getwchar() msvcrt.getwchar -@ cdecl gmtime(ptr) msvcrt.gmtime -@ cdecl is_wctype(long long) msvcrt.is_wctype -@ cdecl isalnum(long) msvcrt.isalnum -@ cdecl isalpha(long) msvcrt.isalpha -@ 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) msvcrt.iswalpha -@ cdecl iswascii(long) msvcrt.iswascii -@ cdecl iswcntrl(long) msvcrt.iswcntrl -@ cdecl iswctype(long long) msvcrt.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 -@ cdecl localeconv() msvcrt.localeconv -@ cdecl localtime(ptr) msvcrt.localtime -@ cdecl log(double) msvcrt.log -@ cdecl log10(double) msvcrt.log10 -@ cdecl -arch=i386,x86_64,arm longjmp(ptr long) msvcrt.longjmp -@ cdecl malloc(long) msvcrt.malloc -@ cdecl mblen(ptr long) msvcrt.mblen -@ cdecl mbstowcs(ptr str long) msvcrt.mbstowcs -@ 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 memmove(ptr ptr long) msvcrt.memmove -@ cdecl memset(ptr long long) msvcrt.memset -@ cdecl mktime(ptr) msvcrt.mktime -@ cdecl modf(double ptr) msvcrt.modf -@ cdecl perror(str) msvcrt.perror -@ cdecl pow(double double) msvcrt.pow -@ varargs printf(str) msvcrt.printf -@ cdecl putc(long ptr) msvcrt.putc -@ cdecl putchar(long) msvcrt.putchar -@ cdecl puts(str) msvcrt.puts -@ cdecl putwc(long ptr) msvcrt.putwc -@ cdecl putwchar(long) msvcrt.putwchar -@ cdecl qsort(ptr long long ptr) msvcrt.qsort -@ cdecl raise(long) msvcrt.raise -@ cdecl rand() msvcrt.rand -@ cdecl realloc(ptr long) msvcrt.realloc -@ cdecl remove(str) msvcrt.remove -@ cdecl rename(str str) msvcrt.rename -@ cdecl rewind(ptr) msvcrt.rewind -@ varargs scanf(str) msvcrt.scanf -@ cdecl setbuf(ptr ptr) msvcrt.setbuf -@ 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 sinh(double) msvcrt.sinh -@ varargs sprintf(ptr str) msvcrt.sprintf -@ cdecl sqrt(double) msvcrt.sqrt -@ cdecl srand(long) msvcrt.srand -@ varargs sscanf(str str) msvcrt.sscanf -@ cdecl strcat(str str) msvcrt.strcat -@ cdecl strchr(str long) msvcrt.strchr -@ cdecl strcmp(str str) msvcrt.strcmp -@ cdecl strcoll(str str) msvcrt.strcoll -@ cdecl strcpy(ptr str) msvcrt.strcpy -@ cdecl strcspn(str str) msvcrt.strcspn -@ cdecl strerror(long) msvcrt.strerror -@ cdecl strftime(str long str ptr) msvcrt.strftime -@ cdecl strlen(str) msvcrt.strlen -@ cdecl strncat(str str long) msvcrt.strncat -@ cdecl strncmp(str str long) msvcrt.strncmp -@ cdecl strncpy(ptr str long) msvcrt.strncpy -@ cdecl strpbrk(str str) msvcrt.strpbrk -@ cdecl strrchr(str long) msvcrt.strrchr -@ cdecl strspn(str str) msvcrt.strspn -@ cdecl strstr(str str) msvcrt.strstr -@ cdecl strtod(str ptr) msvcrt.strtod -@ cdecl strtok(str str) msvcrt.strtok -@ cdecl strtol(str ptr long) msvcrt.strtol -@ cdecl strtoul(str ptr long) msvcrt.strtoul -@ cdecl strxfrm(ptr str long) msvcrt.strxfrm -@ varargs swprintf(ptr wstr) msvcrt.swprintf -@ varargs swscanf(wstr wstr) msvcrt.swscanf -@ cdecl system(str) msvcrt.system -@ cdecl tan(double) msvcrt.tan -@ cdecl tanh(double) msvcrt.tanh -@ cdecl time(ptr) msvcrt.time -@ cdecl tmpfile() msvcrt.tmpfile -@ cdecl tmpnam(ptr) msvcrt.tmpnam -@ cdecl tolower(long) msvcrt.tolower -@ cdecl toupper(long) msvcrt.toupper -@ cdecl towlower(long) msvcrt.towlower -@ cdecl towupper(long) msvcrt.towupper -@ cdecl ungetc(long ptr) msvcrt.ungetc -@ cdecl ungetwc(long ptr) msvcrt.ungetwc -@ cdecl vfprintf(ptr str ptr) msvcrt.vfprintf -@ cdecl vfwprintf(ptr wstr ptr) msvcrt.vfwprintf -@ cdecl vprintf(str ptr) msvcrt.vprintf -@ cdecl vsprintf(ptr str ptr) msvcrt.vsprintf -@ cdecl vswprintf(ptr wstr ptr) msvcrt.vswprintf -@ cdecl vwprintf(wstr ptr) msvcrt.vwprintf -@ cdecl wcscat(wstr wstr) msvcrt.wcscat -@ cdecl wcschr(wstr long) msvcrt.wcschr -@ cdecl wcscmp(wstr wstr) msvcrt.wcscmp -@ cdecl wcscoll(wstr wstr) msvcrt.wcscoll -@ cdecl wcscpy(ptr wstr) msvcrt.wcscpy -@ cdecl wcscspn(wstr wstr) msvcrt.wcscspn -@ cdecl wcsftime(ptr long wstr ptr) msvcrt.wcsftime -@ cdecl wcslen(wstr) msvcrt.wcslen -@ cdecl wcsncat(wstr wstr long) msvcrt.wcsncat -@ cdecl wcsncmp(wstr wstr long) msvcrt.wcsncmp -@ cdecl wcsncpy(ptr wstr long) msvcrt.wcsncpy -@ cdecl wcspbrk(wstr wstr) msvcrt.wcspbrk -@ cdecl wcsrchr(wstr long) msvcrt.wcsrchr -@ cdecl wcsspn(wstr wstr) msvcrt.wcsspn -@ cdecl wcsstr(wstr wstr) msvcrt.wcsstr -@ cdecl wcstod(wstr ptr) msvcrt.wcstod -@ cdecl wcstok(wstr wstr) msvcrt.wcstok -@ cdecl wcstol(wstr ptr long) msvcrt.wcstol -@ cdecl wcstombs(ptr ptr long) msvcrt.wcstombs -@ cdecl wcstoul(wstr ptr long) msvcrt.wcstoul -@ cdecl wcsxfrm(ptr wstr long) msvcrt.wcsxfrm -@ cdecl wctomb(ptr long) msvcrt.wctomb -@ varargs wprintf(wstr) msvcrt.wprintf -@ varargs wscanf(wstr) msvcrt.wscanf +@ extern _wenviron MSVCRT__wenviron +@ 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 _wfindfirst(wstr ptr) MSVCRT__wfindfirst +@ cdecl _wfindfirst64(wstr ptr) MSVCRT__wfindfirst64 +@ cdecl _wfindfirsti64(wstr ptr) MSVCRT__wfindfirsti64 +@ cdecl _wfindnext(long ptr) MSVCRT__wfindnext +@ cdecl _wfindnext64(long ptr) MSVCRT__wfindnext64 +@ cdecl _wfindnexti64(long ptr) MSVCRT__wfindnexti64 +@ cdecl _wfopen(wstr wstr) MSVCRT__wfopen +@ cdecl _wfreopen(wstr wstr ptr) MSVCRT__wfreopen +@ 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 +@ extern _winmajor MSVCRT__winmajor +@ extern _winminor MSVCRT__winminor +@ extern _winver MSVCRT__winver +@ cdecl _wmakepath(ptr wstr wstr wstr wstr) MSVCRT__wmakepath +@ cdecl _wmkdir(wstr) MSVCRT__wmkdir +@ cdecl _wmktemp(wstr) MSVCRT__wmktemp +@ varargs _wopen(wstr long) MSVCRT__wopen +@ stub _wperror(wstr) +@ extern _wpgmptr MSVCRT__wpgmptr +@ cdecl _wpopen(wstr wstr) MSVCRT__wpopen +@ cdecl _wputenv(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 _wsetlocale(long wstr) MSVCRT__wsetlocale +@ varargs _wsopen(wstr long long) MSVCRT__wsopen +@ 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 _wstat(wstr ptr) MSVCRT__wstat +@ cdecl _wstat64(wstr ptr) MSVCRT__wstat64 +@ cdecl _wstati64(wstr ptr) MSVCRT__wstati64 +@ cdecl _wstrdate(ptr) MSVCRT__wstrdate +@ cdecl _wstrtime(ptr) MSVCRT__wstrtime +@ cdecl _wsystem(wstr) +@ cdecl _wtempnam(wstr wstr) MSVCRT__wtempnam +@ cdecl _wtmpnam(ptr) MSVCRT_wtmpnam +@ cdecl _wtof(wstr) MSVCRT__wtof +@ cdecl _wtoi(wstr) MSVCRT__wtoi +@ cdecl -ret64 _wtoi64(wstr) MSVCRT__wtoi64 +@ cdecl _wtol(wstr) MSVCRT__wtol +@ cdecl _wunlink(wstr) MSVCRT__wunlink +@ cdecl _wutime(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 asctime(ptr) MSVCRT_asctime +@ cdecl asin(double) MSVCRT_asin +@ cdecl atan(double) MSVCRT_atan +@ cdecl atan2(double double) MSVCRT_atan2 +@ cdecl atexit(ptr) MSVCRT_atexit +@ cdecl atof(str) MSVCRT_atof +@ cdecl atoi(str) MSVCRT_atoi +@ cdecl atol(str) ntdll.atol +@ cdecl bsearch(ptr ptr long long ptr) MSVCRT_bsearch +@ cdecl calloc(long long) MSVCRT_calloc +@ cdecl ceil(double) MSVCRT_ceil +@ cdecl clearerr(ptr) MSVCRT_clearerr +@ cdecl clock() MSVCRT_clock +@ cdecl cos(double) MSVCRT_cos +@ cdecl cosh(double) MSVCRT_cosh +@ cdecl ctime(ptr) MSVCRT_ctime +@ cdecl difftime(long long) MSVCRT_difftime +@ cdecl -ret64 div(long long) MSVCRT_div +@ cdecl exit(long) MSVCRT_exit +@ cdecl exp(double) MSVCRT_exp +@ cdecl fabs(double) MSVCRT_fabs +@ cdecl fclose(ptr) MSVCRT_fclose +@ cdecl feof(ptr) MSVCRT_feof +@ cdecl ferror(ptr) MSVCRT_ferror +@ 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 fmod(double double) MSVCRT_fmod +@ cdecl fopen(str str) MSVCRT_fopen +@ varargs fprintf(ptr str) MSVCRT_fprintf +@ 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 free(ptr) MSVCRT_free +@ cdecl freopen(str str ptr) MSVCRT_freopen +@ cdecl frexp(double ptr) MSVCRT_frexp +@ varargs fscanf(ptr str) MSVCRT_fscanf +@ cdecl fseek(ptr long long) MSVCRT_fseek +@ cdecl fsetpos(ptr ptr) MSVCRT_fsetpos +@ cdecl ftell(ptr) MSVCRT_ftell +@ varargs fwprintf(ptr wstr) MSVCRT_fwprintf +@ cdecl fwrite(ptr long long ptr) MSVCRT_fwrite +@ varargs fwscanf(ptr wstr) MSVCRT_fwscanf +@ cdecl getc(ptr) MSVCRT_getc +@ cdecl getchar() MSVCRT_getchar +@ cdecl getenv(str) MSVCRT_getenv +@ cdecl gets(str) MSVCRT_gets +@ cdecl getwc(ptr) MSVCRT_getwc +@ cdecl getwchar() MSVCRT_getwchar +@ cdecl gmtime(ptr) MSVCRT_gmtime +@ cdecl is_wctype(long long) ntdll.iswctype +@ cdecl isalnum(long) MSVCRT_isalnum +@ cdecl isalpha(long) MSVCRT_isalpha +@ 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 +@ 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 +@ cdecl localeconv() MSVCRT_localeconv +@ cdecl localtime(ptr) MSVCRT_localtime +@ cdecl log(double) MSVCRT_log +@ cdecl log10(double) MSVCRT_log10 +@ cdecl -arch=i386,x86_64,arm longjmp(ptr long) MSVCRT_longjmp +@ cdecl malloc(long) MSVCRT_malloc +@ cdecl mblen(ptr long) MSVCRT_mblen +@ cdecl mbstowcs(ptr str long) MSVCRT_mbstowcs +@ 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 memmove(ptr ptr long) MSVCRT_memmove +@ cdecl memset(ptr long long) MSVCRT_memset +@ cdecl mktime(ptr) MSVCRT_mktime +@ cdecl modf(double ptr) MSVCRT_modf +@ cdecl perror(str) MSVCRT_perror +@ cdecl pow(double double) MSVCRT_pow +@ varargs printf(str) MSVCRT_printf +@ 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 raise(long) MSVCRT_raise +@ cdecl rand() MSVCRT_rand +@ cdecl realloc(ptr long) MSVCRT_realloc +@ cdecl remove(str) MSVCRT_remove +@ cdecl rename(str str) MSVCRT_rename +@ cdecl rewind(ptr) MSVCRT_rewind +@ varargs scanf(str) MSVCRT_scanf +@ cdecl setbuf(ptr ptr) MSVCRT_setbuf +@ 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 sinh(double) MSVCRT_sinh +@ varargs sprintf(ptr str) MSVCRT_sprintf +@ cdecl sqrt(double) MSVCRT_sqrt +@ cdecl srand(long) MSVCRT_srand +@ varargs sscanf(str str) MSVCRT_sscanf +@ cdecl strcat(str str) ntdll.strcat +@ 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 strcspn(str str) ntdll.strcspn +@ cdecl strerror(long) MSVCRT_strerror +@ cdecl strftime(str long str ptr) MSVCRT_strftime +@ cdecl strlen(str) MSVCRT_strlen +@ cdecl strncat(str str long) MSVCRT_strncat +@ cdecl strncmp(str str long) MSVCRT_strncmp +@ cdecl strncpy(ptr str long) MSVCRT_strncpy +@ 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 +@ cdecl strtok(str str) MSVCRT_strtok +@ cdecl strtol(str ptr long) MSVCRT_strtol +@ cdecl strtoul(str ptr long) MSVCRT_strtoul +@ cdecl strxfrm(ptr str long) MSVCRT_strxfrm +@ varargs swprintf(ptr wstr) MSVCRT_swprintf +@ varargs swscanf(wstr wstr) MSVCRT_swscanf +@ cdecl system(str) MSVCRT_system +@ cdecl tan(double) MSVCRT_tan +@ cdecl tanh(double) MSVCRT_tanh +@ cdecl time(ptr) MSVCRT_time +@ cdecl tmpfile() MSVCRT_tmpfile +@ cdecl tmpnam(ptr) MSVCRT_tmpnam +@ cdecl tolower(long) MSVCRT_tolower +@ cdecl toupper(long) MSVCRT_toupper +@ cdecl towlower(long) MSVCRT_towlower +@ cdecl towupper(long) MSVCRT_towupper +@ cdecl ungetc(long ptr) MSVCRT_ungetc +@ cdecl ungetwc(long ptr) MSVCRT_ungetwc +@ cdecl vfprintf(ptr str ptr) MSVCRT_vfprintf +@ cdecl vfwprintf(ptr wstr ptr) MSVCRT_vfwprintf +@ cdecl vprintf(str ptr) MSVCRT_vprintf +@ cdecl vsprintf(ptr str ptr) MSVCRT_vsprintf +@ cdecl vswprintf(ptr wstr ptr) MSVCRT_vswprintf +@ cdecl vwprintf(wstr ptr) MSVCRT_vwprintf +@ cdecl wcscat(wstr wstr) ntdll.wcscat +@ 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 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 wcsncmp(wstr wstr long) MSVCRT_wcsncmp +@ cdecl wcsncpy(ptr wstr long) MSVCRT_wcsncpy +@ cdecl wcspbrk(wstr wstr) MSVCRT_wcspbrk +@ cdecl wcsrchr(wstr long) ntdll.wcsrchr +@ cdecl wcsspn(wstr wstr) ntdll.wcsspn +@ cdecl wcsstr(wstr wstr) MSVCRT_wcsstr +@ cdecl wcstod(wstr ptr) MSVCRT_wcstod +@ cdecl wcstok(wstr wstr) MSVCRT_wcstok +@ cdecl wcstol(wstr ptr long) ntdll.wcstol +@ cdecl wcstombs(ptr ptr long) MSVCRT_wcstombs +@ cdecl wcstoul(wstr ptr long) MSVCRT_wcstoul +@ stub wcsxfrm(ptr wstr long) +@ cdecl wctomb(ptr long) MSVCRT_wctomb +@ varargs wprintf(wstr) MSVCRT_wprintf +@ varargs wscanf(wstr) MSVCRT_wscanf diff -Nru wine1.7-1.7.14/dlls/msvcr71/Makefile.in wine1.7-1.7.18/dlls/msvcr71/Makefile.in --- wine1.7-1.7.14/dlls/msvcr71/Makefile.in 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msvcr71/Makefile.in 2014-05-02 18:15:48.000000000 +0000 @@ -1,6 +1,34 @@ +EXTRADEFS = -D_MT -D_MSVCR_VER=71 MODULE = msvcr71.dll IMPORTLIB = msvcr71 -IMPORTS = msvcrt +DELAYIMPORTS = advapi32 user32 +PARENTSRC = ../msvcrt C_SRCS = \ - msvcr71.c + 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.14/dlls/msvcr71/msvcr71.c wine1.7-1.7.18/dlls/msvcr71/msvcr71.c --- wine1.7-1.7.14/dlls/msvcr71/msvcr71.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msvcr71/msvcr71.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ -/* - * msvcr71 main file - * - * Copyright (C) 2008 Hans Leidekker - * - * 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" - -BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved ) -{ - switch (reason) - { - case DLL_WINE_PREATTACH: - return FALSE; /* prefer native version */ - case DLL_PROCESS_ATTACH: - DisableThreadLibraryCalls( inst ); - break; - } - return TRUE; -} diff -Nru wine1.7-1.7.14/dlls/msvcr71/msvcr71.spec wine1.7-1.7.18/dlls/msvcr71/msvcr71.spec --- wine1.7-1.7.14/dlls/msvcr71/msvcr71.spec 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msvcr71/msvcr71.spec 2014-05-02 18:15:48.000000000 +0000 @@ -1,872 +1,872 @@ -@ thiscall -arch=i386 ??0__non_rtti_object@@QAE@ABV0@@Z(ptr ptr) msvcrt.??0__non_rtti_object@@QAE@ABV0@@Z -@ cdecl -arch=win64 ??0__non_rtti_object@@QEAA@AEBV0@@Z(ptr ptr) msvcrt.??0__non_rtti_object@@QEAA@AEBV0@@Z -@ thiscall -arch=i386 ??0__non_rtti_object@@QAE@PBD@Z(ptr ptr) msvcrt.??0__non_rtti_object@@QAE@PBD@Z -@ cdecl -arch=win64 ??0__non_rtti_object@@QEAA@PEBD@Z(ptr ptr) msvcrt.??0__non_rtti_object@@QEAA@PEBD@Z -@ thiscall -arch=i386 ??0bad_cast@@AAE@PBQBD@Z(ptr ptr) msvcrt.??0bad_cast@@AAE@PBQBD@Z -@ cdecl -arch=win64 ??0bad_cast@@AEAA@PEBQEBD@Z(ptr ptr) msvcrt.??0bad_cast@@AEAA@PEBQEBD@Z -@ thiscall -arch=win32 ??0bad_cast@@QAE@ABQBD@Z(ptr ptr) msvcrt.??0bad_cast@@QAE@ABQBD@Z -@ cdecl -arch=win64 ??0bad_cast@@QEAA@AEBQEBD@Z(ptr ptr) msvcrt.??0bad_cast@@QEAA@AEBQEBD@Z -@ thiscall -arch=i386 ??0bad_cast@@QAE@ABV0@@Z(ptr ptr) msvcrt.??0bad_cast@@QAE@ABV0@@Z -@ cdecl -arch=win64 ??0bad_cast@@QEAA@AEBV0@@Z(ptr ptr) msvcrt.??0bad_cast@@QEAA@AEBV0@@Z -@ thiscall -arch=i386 ??0bad_cast@@QAE@PBD@Z(ptr str) msvcrt.??0bad_cast@@QAE@PBD@Z -@ cdecl -arch=win64 ??0bad_cast@@QEAA@PEBD@Z(ptr str) msvcrt.??0bad_cast@@QEAA@PEBD@Z -@ thiscall -arch=i386 ??0bad_typeid@@QAE@ABV0@@Z(ptr ptr) msvcrt.??0bad_typeid@@QAE@ABV0@@Z -@ cdecl -arch=win64 ??0bad_typeid@@QEAA@AEBV0@@Z(ptr ptr) msvcrt.??0bad_typeid@@QEAA@AEBV0@@Z -@ thiscall -arch=i386 ??0bad_typeid@@QAE@PBD@Z(ptr str) msvcrt.??0bad_typeid@@QAE@PBD@Z -@ cdecl -arch=win64 ??0bad_typeid@@QEAA@PEBD@Z(ptr str) msvcrt.??0bad_typeid@@QEAA@PEBD@Z -@ thiscall -arch=i386 ??0exception@@QAE@ABQBD@Z(ptr ptr) msvcrt.??0exception@@QAE@ABQBD@Z -@ cdecl -arch=win64 ??0exception@@QEAA@AEBQEBD@Z(ptr ptr) msvcrt.??0exception@@QEAA@AEBQEBD@Z -@ thiscall -arch=i386 ??0exception@@QAE@ABV0@@Z(ptr ptr) msvcrt.??0exception@@QAE@ABV0@@Z -@ cdecl -arch=win64 ??0exception@@QEAA@AEBV0@@Z(ptr ptr) msvcrt.??0exception@@QEAA@AEBV0@@Z -@ thiscall -arch=i386 ??0exception@@QAE@XZ(ptr) msvcrt.??0exception@@QAE@XZ -@ cdecl -arch=win64 ??0exception@@QEAA@XZ(ptr) msvcrt.??0exception@@QEAA@XZ -@ thiscall -arch=i386 ??1__non_rtti_object@@UAE@XZ(ptr) msvcrt.??1__non_rtti_object@@UAE@XZ -@ cdecl -arch=win64 ??1__non_rtti_object@@UEAA@XZ(ptr) msvcrt.??1__non_rtti_object@@UEAA@XZ -@ thiscall -arch=i386 ??1bad_cast@@UAE@XZ(ptr) msvcrt.??1bad_cast@@UAE@XZ -@ cdecl -arch=win64 ??1bad_cast@@UEAA@XZ(ptr) msvcrt.??1bad_cast@@UEAA@XZ -@ thiscall -arch=i386 ??1bad_typeid@@UAE@XZ(ptr) msvcrt.??1bad_typeid@@UAE@XZ -@ cdecl -arch=win64 ??1bad_typeid@@UEAA@XZ(ptr) msvcrt.??1bad_typeid@@UEAA@XZ -@ thiscall -arch=i386 ??1exception@@UAE@XZ(ptr) msvcrt.??1exception@@UAE@XZ -@ cdecl -arch=win64 ??1exception@@UEAA@XZ(ptr) msvcrt.??1exception@@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 -@ cdecl -arch=win64 ??2@YAPEAX_K@Z(long) msvcrt.??2@YAPEAX_K@Z -@ cdecl -arch=win32 ??3@YAXPAX@Z(ptr) msvcrt.??3@YAXPAX@Z -@ cdecl -arch=win64 ??3@YAXPEAX@Z(ptr) msvcrt.??3@YAXPEAX@Z -@ thiscall -arch=i386 ??4__non_rtti_object@@QAEAAV0@ABV0@@Z(ptr ptr) msvcrt.??4__non_rtti_object@@QAEAAV0@ABV0@@Z -@ cdecl -arch=win64 ??4__non_rtti_object@@QEAAAEAV0@AEBV0@@Z(ptr ptr) msvcrt.??4__non_rtti_object@@QEAAAEAV0@AEBV0@@Z -@ thiscall -arch=i386 ??4bad_cast@@QAEAAV0@ABV0@@Z(ptr ptr) msvcrt.??4bad_cast@@QAEAAV0@ABV0@@Z -@ cdecl -arch=win64 ??4bad_cast@@QEAAAEAV0@AEBV0@@Z(ptr ptr) msvcrt.??4bad_cast@@QEAAAEAV0@AEBV0@@Z -@ thiscall -arch=i386 ??4bad_typeid@@QAEAAV0@ABV0@@Z(ptr ptr) msvcrt.??4bad_typeid@@QAEAAV0@ABV0@@Z -@ cdecl -arch=win64 ??4bad_typeid@@QEAAAEAV0@AEBV0@@Z(ptr ptr) msvcrt.??4bad_typeid@@QEAAAEAV0@AEBV0@@Z -@ thiscall -arch=i386 ??4exception@@QAEAAV0@ABV0@@Z(ptr ptr) msvcrt.??4exception@@QAEAAV0@ABV0@@Z -@ cdecl -arch=win64 ??4exception@@QEAAAEAV0@AEBV0@@Z(ptr ptr) msvcrt.??4exception@@QEAAAEAV0@AEBV0@@Z -@ thiscall -arch=i386 ??8type_info@@QBEHABV0@@Z(ptr ptr) msvcrt.??8type_info@@QBEHABV0@@Z -@ cdecl -arch=win64 ??8type_info@@QEBAHAEBV0@@Z(ptr ptr) msvcrt.??8type_info@@QEBAHAEBV0@@Z -@ thiscall -arch=i386 ??9type_info@@QBEHABV0@@Z(ptr ptr) msvcrt.??9type_info@@QBEHABV0@@Z -@ cdecl -arch=win64 ??9type_info@@QEBAHAEBV0@@Z(ptr ptr) msvcrt.??9type_info@@QEBAHAEBV0@@Z -@ extern ??_7__non_rtti_object@@6B@ msvcrt.??_7__non_rtti_object@@6B@ -@ extern ??_7bad_cast@@6B@ msvcrt.??_7bad_cast@@6B@ -@ extern ??_7bad_typeid@@6B@ msvcrt.??_7bad_typeid@@6B@ -@ extern ??_7exception@@6B@ msvcrt.??_7exception@@6B@ -@ thiscall -arch=i386 ??_Fbad_cast@@QAEXXZ(ptr) msvcrt.??_Fbad_cast@@QAEXXZ -@ cdecl -arch=win64 ??_Fbad_cast@@QEAAXXZ(ptr) msvcrt.??_Fbad_cast@@QEAAXXZ -@ thiscall -arch=i386 ??_Fbad_typeid@@QAEXXZ(ptr) msvcrt.??_Fbad_typeid@@QAEXXZ -@ cdecl -arch=win64 ??_Fbad_typeid@@QEAAXXZ(ptr) msvcrt.??_Fbad_typeid@@QEAAXXZ -@ cdecl -arch=win32 ??_U@YAPAXI@Z(long) msvcrt.??_U@YAPAXI@Z -@ cdecl -arch=win64 ??_U@YAPEAX_K@Z(long) msvcrt.??_U@YAPEAX_K@Z -@ cdecl -arch=win32 ??_V@YAXPAX@Z(ptr) msvcrt.??_V@YAXPAX@Z -@ cdecl -arch=win64 ??_V@YAXPEAX@Z(ptr) msvcrt.??_V@YAXPEAX@Z -@ cdecl __uncaught_exception() msvcrt.__uncaught_exception -@ 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 -@ cdecl -arch=win32 ?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z(ptr) msvcrt.?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z -@ cdecl -arch=win64 ?_set_new_handler@@YAP6AH_K@ZP6AH0@Z@Z(ptr) msvcrt.?_set_new_handler@@YAP6AH_K@ZP6AH0@Z@Z -@ cdecl ?_set_new_mode@@YAHH@Z(long) msvcrt.?_set_new_mode@@YAHH@Z -@ cdecl -arch=win32 ?_set_se_translator@@YAP6AXIPAU_EXCEPTION_POINTERS@@@ZP6AXI0@Z@Z(ptr) msvcrt.?_set_se_translator@@YAP6AXIPAU_EXCEPTION_POINTERS@@@ZP6AXI0@Z@Z -@ cdecl -arch=win64 ?_set_se_translator@@YAP6AXIPEAU_EXCEPTION_POINTERS@@@ZP6AXI0@Z@Z(ptr) msvcrt.?_set_se_translator@@YAP6AXIPEAU_EXCEPTION_POINTERS@@@ZP6AXI0@Z@Z -@ thiscall -arch=i386 ?before@type_info@@QBEHABV1@@Z(ptr ptr) msvcrt.?before@type_info@@QBEHABV1@@Z -@ cdecl -arch=win64 ?before@type_info@@QEBAHAEBV1@@Z(ptr ptr) msvcrt.?before@type_info@@QEBAHAEBV1@@Z -@ thiscall -arch=win32 ?name@type_info@@QBEPBDXZ(ptr) msvcrt.?name@type_info@@QBEPBDXZ -@ cdecl -arch=win64 ?name@type_info@@QEBAPEBDXZ(ptr) msvcrt.?name@type_info@@QEBAPEBDXZ -@ thiscall -arch=i386 ?raw_name@type_info@@QBEPBDXZ(ptr) msvcrt.?raw_name@type_info@@QBEPBDXZ -@ cdecl -arch=win64 ?raw_name@type_info@@QEBAPEBDXZ(ptr) msvcrt.?raw_name@type_info@@QEBAPEBDXZ -@ cdecl ?set_new_handler@@YAP6AXXZP6AXXZ@Z(ptr) msvcrt.?set_new_handler@@YAP6AXXZP6AXXZ@Z -@ cdecl ?set_terminate@@YAP6AXXZP6AXXZ@Z(ptr) msvcrt.?set_terminate@@YAP6AXXZP6AXXZ@Z -@ cdecl ?set_unexpected@@YAP6AXXZP6AXXZ@Z(ptr) msvcrt.?set_unexpected@@YAP6AXXZP6AXXZ@Z -@ varargs ?swprintf@@YAHPAGIPBGZZ(ptr long wstr) msvcrt._snwprintf -@ varargs ?swprintf@@YAHPA_WIPB_WZZ(ptr long wstr) msvcrt._snwprintf -@ cdecl ?terminate@@YAXXZ() msvcrt.?terminate@@YAXXZ -@ cdecl ?unexpected@@YAXXZ() msvcrt.?unexpected@@YAXXZ -@ cdecl ?vswprintf@@YAHPAGIPBGPAD@Z(ptr long wstr ptr) msvcrt._vsnwprintf -@ cdecl ?vswprintf@@YAHPA_WIPB_WPAD@Z(ptr long wstr ptr) msvcrt._vsnwprintf -@ thiscall -arch=i386 ?what@exception@@UBEPBDXZ(ptr) msvcrt.?what@exception@@UBEPBDXZ -@ cdecl -arch=win64 ?what@exception@@UEBAPEBDXZ(ptr) msvcrt.?what@exception@@UEBAPEBDXZ -@ cdecl -norelay $I10_OUTPUT(double long long long ptr) msvcrt.$I10_OUTPUT -@ cdecl -arch=i386 _CIacos() msvcrt._CIacos -@ cdecl -arch=i386 _CIasin() msvcrt._CIasin -@ cdecl -arch=i386 _CIatan() msvcrt._CIatan -@ cdecl -arch=i386 _CIatan2() msvcrt._CIatan2 -@ cdecl -arch=i386 _CIcos() msvcrt._CIcos -@ cdecl -arch=i386 _CIcosh() msvcrt._CIcosh -@ cdecl -arch=i386 _CIexp() msvcrt._CIexp -@ cdecl -arch=i386 _CIfmod() msvcrt._CIfmod -@ cdecl -arch=i386 _CIlog() msvcrt._CIlog -@ cdecl -arch=i386 _CIlog10() msvcrt._CIlog10 -@ cdecl -arch=i386 _CIpow() msvcrt._CIpow -@ cdecl -arch=i386 _CIsin() msvcrt._CIsin -@ cdecl -arch=i386 _CIsinh() msvcrt._CIsinh -@ cdecl -arch=i386 _CIsqrt() msvcrt._CIsqrt -@ cdecl -arch=i386 _CItan() msvcrt._CItan -@ cdecl -arch=i386 _CItanh() msvcrt._CItanh -@ cdecl _CRT_RTC_INIT(ptr ptr long long long) msvcr100._CRT_RTC_INIT -@ stdcall _CxxThrowException(long long) msvcrt._CxxThrowException -@ cdecl -arch=i386 -norelay _EH_prolog() msvcrt._EH_prolog -@ cdecl _Getdays() msvcrt._Getdays -@ cdecl _Getmonths() msvcrt._Getmonths -@ cdecl _Gettnames() msvcrt._Gettnames -@ extern _HUGE msvcrt._HUGE -@ cdecl _Strftime(str long str ptr ptr) msvcrt._Strftime -@ cdecl _XcptFilter(long ptr) msvcrt._XcptFilter -@ cdecl -arch=i386,x86_64,arm __CppXcptFilter(long ptr) msvcrt.__CppXcptFilter +@ thiscall -arch=i386 ??0__non_rtti_object@@QAE@ABV0@@Z(ptr ptr) MSVCRT___non_rtti_object_copy_ctor +@ cdecl -arch=win64 ??0__non_rtti_object@@QEAA@AEBV0@@Z(ptr ptr) MSVCRT___non_rtti_object_copy_ctor +@ thiscall -arch=i386 ??0__non_rtti_object@@QAE@PBD@Z(ptr ptr) MSVCRT___non_rtti_object_ctor +@ cdecl -arch=win64 ??0__non_rtti_object@@QEAA@PEBD@Z(ptr ptr) MSVCRT___non_rtti_object_ctor +@ thiscall -arch=i386 ??0bad_cast@@AAE@PBQBD@Z(ptr ptr) MSVCRT_bad_cast_ctor +@ cdecl -arch=win64 ??0bad_cast@@AEAA@PEBQEBD@Z(ptr ptr) MSVCRT_bad_cast_ctor +@ thiscall -arch=win32 ??0bad_cast@@QAE@ABQBD@Z(ptr ptr) MSVCRT_bad_cast_ctor +@ cdecl -arch=win64 ??0bad_cast@@QEAA@AEBQEBD@Z(ptr ptr) MSVCRT_bad_cast_ctor +@ thiscall -arch=i386 ??0bad_cast@@QAE@ABV0@@Z(ptr ptr) MSVCRT_bad_cast_copy_ctor +@ cdecl -arch=win64 ??0bad_cast@@QEAA@AEBV0@@Z(ptr ptr) MSVCRT_bad_cast_copy_ctor +@ thiscall -arch=i386 ??0bad_cast@@QAE@PBD@Z(ptr str) MSVCRT_bad_cast_ctor_charptr +@ cdecl -arch=win64 ??0bad_cast@@QEAA@PEBD@Z(ptr str) MSVCRT_bad_cast_ctor_charptr +@ thiscall -arch=i386 ??0bad_typeid@@QAE@ABV0@@Z(ptr ptr) MSVCRT_bad_typeid_copy_ctor +@ cdecl -arch=win64 ??0bad_typeid@@QEAA@AEBV0@@Z(ptr ptr) MSVCRT_bad_typeid_copy_ctor +@ thiscall -arch=i386 ??0bad_typeid@@QAE@PBD@Z(ptr str) MSVCRT_bad_typeid_ctor +@ cdecl -arch=win64 ??0bad_typeid@@QEAA@PEBD@Z(ptr str) MSVCRT_bad_typeid_ctor +@ thiscall -arch=i386 ??0exception@@QAE@ABQBD@Z(ptr ptr) MSVCRT_exception_ctor +@ cdecl -arch=win64 ??0exception@@QEAA@AEBQEBD@Z(ptr ptr) MSVCRT_exception_ctor +@ thiscall -arch=i386 ??0exception@@QAE@ABV0@@Z(ptr ptr) MSVCRT_exception_copy_ctor +@ cdecl -arch=win64 ??0exception@@QEAA@AEBV0@@Z(ptr ptr) MSVCRT_exception_copy_ctor +@ thiscall -arch=i386 ??0exception@@QAE@XZ(ptr) MSVCRT_exception_default_ctor +@ cdecl -arch=win64 ??0exception@@QEAA@XZ(ptr) MSVCRT_exception_default_ctor +@ thiscall -arch=i386 ??1__non_rtti_object@@UAE@XZ(ptr) MSVCRT___non_rtti_object_dtor +@ cdecl -arch=win64 ??1__non_rtti_object@@UEAA@XZ(ptr) MSVCRT___non_rtti_object_dtor +@ thiscall -arch=i386 ??1bad_cast@@UAE@XZ(ptr) MSVCRT_bad_cast_dtor +@ cdecl -arch=win64 ??1bad_cast@@UEAA@XZ(ptr) MSVCRT_bad_cast_dtor +@ thiscall -arch=i386 ??1bad_typeid@@UAE@XZ(ptr) MSVCRT_bad_typeid_dtor +@ cdecl -arch=win64 ??1bad_typeid@@UEAA@XZ(ptr) MSVCRT_bad_typeid_dtor +@ thiscall -arch=i386 ??1exception@@UAE@XZ(ptr) MSVCRT_exception_dtor +@ cdecl -arch=win64 ??1exception@@UEAA@XZ(ptr) MSVCRT_exception_dtor +@ thiscall -arch=i386 ??1type_info@@UAE@XZ(ptr) MSVCRT_type_info_dtor +@ cdecl -arch=win64 ??1type_info@@UEAA@XZ(ptr) MSVCRT_type_info_dtor +@ cdecl -arch=win32 ??2@YAPAXI@Z(long) MSVCRT_operator_new +@ cdecl -arch=win64 ??2@YAPEAX_K@Z(long) MSVCRT_operator_new +@ cdecl -arch=win32 ??3@YAXPAX@Z(ptr) MSVCRT_operator_delete +@ cdecl -arch=win64 ??3@YAXPEAX@Z(ptr) MSVCRT_operator_delete +@ thiscall -arch=i386 ??4__non_rtti_object@@QAEAAV0@ABV0@@Z(ptr ptr) MSVCRT___non_rtti_object_opequals +@ cdecl -arch=win64 ??4__non_rtti_object@@QEAAAEAV0@AEBV0@@Z(ptr ptr) MSVCRT___non_rtti_object_opequals +@ thiscall -arch=i386 ??4bad_cast@@QAEAAV0@ABV0@@Z(ptr ptr) MSVCRT_bad_cast_opequals +@ cdecl -arch=win64 ??4bad_cast@@QEAAAEAV0@AEBV0@@Z(ptr ptr) MSVCRT_bad_cast_opequals +@ thiscall -arch=i386 ??4bad_typeid@@QAEAAV0@ABV0@@Z(ptr ptr) MSVCRT_bad_typeid_opequals +@ cdecl -arch=win64 ??4bad_typeid@@QEAAAEAV0@AEBV0@@Z(ptr ptr) MSVCRT_bad_typeid_opequals +@ thiscall -arch=i386 ??4exception@@QAEAAV0@ABV0@@Z(ptr ptr) MSVCRT_exception_opequals +@ cdecl -arch=win64 ??4exception@@QEAAAEAV0@AEBV0@@Z(ptr ptr) MSVCRT_exception_opequals +@ thiscall -arch=i386 ??8type_info@@QBEHABV0@@Z(ptr ptr) MSVCRT_type_info_opequals_equals +@ cdecl -arch=win64 ??8type_info@@QEBAHAEBV0@@Z(ptr ptr) MSVCRT_type_info_opequals_equals +@ thiscall -arch=i386 ??9type_info@@QBEHABV0@@Z(ptr ptr) MSVCRT_type_info_opnot_equals +@ cdecl -arch=win64 ??9type_info@@QEBAHAEBV0@@Z(ptr ptr) MSVCRT_type_info_opnot_equals +@ extern ??_7__non_rtti_object@@6B@ MSVCRT___non_rtti_object_vtable +@ extern ??_7bad_cast@@6B@ MSVCRT_bad_cast_vtable +@ extern ??_7bad_typeid@@6B@ MSVCRT_bad_typeid_vtable +@ extern ??_7exception@@6B@ MSVCRT_exception_vtable +@ thiscall -arch=i386 ??_Fbad_cast@@QAEXXZ(ptr) MSVCRT_bad_cast_default_ctor +@ cdecl -arch=win64 ??_Fbad_cast@@QEAAXXZ(ptr) MSVCRT_bad_cast_default_ctor +@ thiscall -arch=i386 ??_Fbad_typeid@@QAEXXZ(ptr) MSVCRT_bad_typeid_default_ctor +@ cdecl -arch=win64 ??_Fbad_typeid@@QEAAXXZ(ptr) MSVCRT_bad_typeid_default_ctor +@ cdecl -arch=win32 ??_U@YAPAXI@Z(long) MSVCRT_operator_new +@ cdecl -arch=win64 ??_U@YAPEAX_K@Z(long) MSVCRT_operator_new +@ cdecl -arch=win32 ??_V@YAXPAX@Z(ptr) MSVCRT_operator_delete +@ cdecl -arch=win64 ??_V@YAXPEAX@Z(ptr) MSVCRT_operator_delete +@ cdecl __uncaught_exception() MSVCRT___uncaught_exception +@ cdecl -arch=win32 ?_query_new_handler@@YAP6AHI@ZXZ() MSVCRT__query_new_handler +@ cdecl -arch=win64 ?_query_new_handler@@YAP6AH_K@ZXZ() MSVCRT__query_new_handler +@ cdecl ?_query_new_mode@@YAHXZ() MSVCRT__query_new_mode +@ cdecl -arch=win32 ?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z(ptr) MSVCRT__set_new_handler +@ cdecl -arch=win64 ?_set_new_handler@@YAP6AH_K@ZP6AH0@Z@Z(ptr) MSVCRT__set_new_handler +@ cdecl ?_set_new_mode@@YAHH@Z(long) MSVCRT__set_new_mode +@ cdecl -arch=win32 ?_set_se_translator@@YAP6AXIPAU_EXCEPTION_POINTERS@@@ZP6AXI0@Z@Z(ptr) MSVCRT__set_se_translator +@ cdecl -arch=win64 ?_set_se_translator@@YAP6AXIPEAU_EXCEPTION_POINTERS@@@ZP6AXI0@Z@Z(ptr) MSVCRT__set_se_translator +@ thiscall -arch=i386 ?before@type_info@@QBEHABV1@@Z(ptr ptr) MSVCRT_type_info_before +@ cdecl -arch=win64 ?before@type_info@@QEBAHAEBV1@@Z(ptr ptr) MSVCRT_type_info_before +@ thiscall -arch=win32 ?name@type_info@@QBEPBDXZ(ptr) MSVCRT_type_info_name +@ cdecl -arch=win64 ?name@type_info@@QEBAPEBDXZ(ptr) MSVCRT_type_info_name +@ thiscall -arch=i386 ?raw_name@type_info@@QBEPBDXZ(ptr) MSVCRT_type_info_raw_name +@ cdecl -arch=win64 ?raw_name@type_info@@QEBAPEBDXZ(ptr) MSVCRT_type_info_raw_name +@ cdecl ?set_new_handler@@YAP6AXXZP6AXXZ@Z(ptr) MSVCRT_set_new_handler +@ cdecl ?set_terminate@@YAP6AXXZP6AXXZ@Z(ptr) MSVCRT_set_terminate +@ cdecl ?set_unexpected@@YAP6AXXZP6AXXZ@Z(ptr) MSVCRT_set_unexpected +@ varargs ?swprintf@@YAHPAGIPBGZZ(ptr long wstr) MSVCRT__snwprintf +@ varargs ?swprintf@@YAHPA_WIPB_WZZ(ptr long wstr) MSVCRT__snwprintf +@ cdecl ?terminate@@YAXXZ() MSVCRT_terminate +@ cdecl ?unexpected@@YAXXZ() MSVCRT_unexpected +@ cdecl ?vswprintf@@YAHPAGIPBGPAD@Z(ptr long wstr ptr) MSVCRT_vsnwprintf +@ cdecl ?vswprintf@@YAHPA_WIPB_WPAD@Z(ptr long wstr ptr) MSVCRT_vsnwprintf +@ thiscall -arch=i386 ?what@exception@@UBEPBDXZ(ptr) MSVCRT_what_exception +@ cdecl -arch=win64 ?what@exception@@UEBAPEBDXZ(ptr) MSVCRT_what_exception +@ cdecl -norelay $I10_OUTPUT(double long long long ptr) MSVCRT_I10_OUTPUT +@ 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() +@ cdecl _CRT_RTC_INIT(ptr ptr long long long) +@ stdcall _CxxThrowException(long long) +@ cdecl -arch=i386 -norelay _EH_prolog() +@ cdecl _Getdays() +@ cdecl _Getmonths() +@ cdecl _Gettnames() +@ extern _HUGE MSVCRT__HUGE +@ cdecl _Strftime(str long str ptr ptr) +@ cdecl _XcptFilter(long ptr) +@ cdecl -arch=i386,x86_64,arm __CppXcptFilter(long ptr) @ stub __CxxCallUnwindDtor @ stub __CxxCallUnwindVecDtor -@ cdecl -arch=i386,x86_64,arm __CxxDetectRethrow(ptr) msvcrt.__CxxDetectRethrow +@ cdecl -arch=i386,x86_64,arm __CxxDetectRethrow(ptr) @ stub __CxxExceptionFilter -@ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler(ptr ptr ptr ptr) msvcrt.__CxxFrameHandler -@ stdcall -arch=i386 __CxxLongjmpUnwind(ptr) msvcrt.__CxxLongjmpUnwind -@ cdecl -arch=i386,x86_64,arm __CxxQueryExceptionSize() msvcrt.__CxxQueryExceptionSize +@ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler(ptr ptr ptr ptr) +@ stdcall -arch=i386 __CxxLongjmpUnwind(ptr) +@ cdecl -arch=i386,x86_64,arm __CxxQueryExceptionSize() @ stub __CxxRegisterExceptionObject @ stub __CxxUnregisterExceptionObject @ stub __DestructExceptionObject -@ cdecl __RTCastToVoid(ptr) msvcrt.__RTCastToVoid -@ cdecl __RTDynamicCast(ptr long ptr ptr long) msvcrt.__RTDynamicCast -@ cdecl __RTtypeid(ptr) msvcrt.__RTtypeid -@ cdecl __STRINGTOLD(ptr ptr str long) msvcrt.__STRINGTOLD -@ cdecl ___lc_codepage_func() msvcrt.___lc_codepage_func -@ cdecl ___lc_collate_cp_func() msvcrt.___lc_collate_cp_func -@ cdecl ___lc_handle_func() msvcrt.___lc_handle_func -@ cdecl ___mb_cur_max_func() msvcrt.___mb_cur_max_func -@ cdecl ___setlc_active_func() msvcrt.___setlc_active_func -@ cdecl ___unguarded_readlc_active_add_func() msvcrt.___unguarded_readlc_active_add_func -@ extern __argc msvcrt.__argc -@ extern __argv msvcrt.__argv -@ extern __badioinfo msvcrt.__badioinfo +@ cdecl __RTCastToVoid(ptr) MSVCRT___RTCastToVoid +@ cdecl __RTDynamicCast(ptr long ptr ptr long) MSVCRT___RTDynamicCast +@ cdecl __RTtypeid(ptr) MSVCRT___RTtypeid +@ cdecl __STRINGTOLD(ptr ptr str long) +@ cdecl ___lc_codepage_func() +@ cdecl ___lc_collate_cp_func() +@ cdecl ___lc_handle_func() +@ cdecl ___mb_cur_max_func() MSVCRT____mb_cur_max_func +@ cdecl ___setlc_active_func() MSVCRT____setlc_active_func +@ cdecl ___unguarded_readlc_active_add_func() MSVCRT____unguarded_readlc_active_add_func +@ extern __argc MSVCRT___argc +@ extern __argv MSVCRT___argv +@ extern __badioinfo MSVCRT___badioinfo @ stub __buffer_overrun -@ cdecl __crtCompareStringA(long long str long str long) msvcrt.__crtCompareStringA -@ cdecl __crtCompareStringW(long long wstr long wstr long) msvcrt.__crtCompareStringW -@ cdecl __crtGetLocaleInfoW(long long ptr long) msvcrt.__crtGetLocaleInfoW -@ cdecl __crtGetStringTypeW(long long wstr long ptr) msvcrt.__crtGetStringTypeW -@ cdecl __crtLCMapStringA(long long str long ptr long long long) msvcrt.__crtLCMapStringA -@ cdecl __crtLCMapStringW(long long wstr long ptr long long long) msvcrt.__crtLCMapStringW -@ cdecl __dllonexit(ptr ptr ptr) msvcrt.__dllonexit -@ cdecl __doserrno() msvcrt.__doserrno -@ cdecl __fpecode() msvcrt.__fpecode -@ cdecl __getmainargs(ptr ptr ptr long ptr) msvcrt.__getmainargs -@ extern __initenv msvcrt.__initenv -@ cdecl __iob_func() msvcrt.__iob_func -@ cdecl __isascii(long) msvcrt.__isascii -@ cdecl __iscsym(long) msvcrt.__iscsym -@ cdecl __iscsymf(long) msvcrt.__iscsymf +@ cdecl __crtCompareStringA(long long str long str long) +@ cdecl __crtCompareStringW(long long wstr long wstr long) +@ cdecl __crtGetLocaleInfoW(long long ptr long) +@ cdecl __crtGetStringTypeW(long long wstr long ptr) +@ cdecl __crtLCMapStringA(long long str long ptr long long long) +@ cdecl __crtLCMapStringW(long long wstr long ptr long long long) +@ cdecl __dllonexit(ptr ptr ptr) +@ cdecl __doserrno() MSVCRT___doserrno +@ cdecl __fpecode() +@ cdecl __getmainargs(ptr ptr ptr long ptr) +@ extern __initenv MSVCRT___initenv +@ cdecl __iob_func() MSVCRT___iob_func +@ cdecl __isascii(long) MSVCRT___isascii +@ cdecl __iscsym(long) MSVCRT___iscsym +@ cdecl __iscsymf(long) MSVCRT___iscsymf # extern __lc_clike -@ extern __lc_codepage msvcrt.__lc_codepage -@ extern __lc_collate_cp msvcrt.__lc_collate_cp -@ extern __lc_handle msvcrt.__lc_handle -@ cdecl __lconv_init() msvcrt.__lconv_init -@ extern __mb_cur_max msvcrt.__mb_cur_max -@ cdecl __p___argc() msvcrt.__p___argc -@ cdecl __p___argv() msvcrt.__p___argv -@ cdecl __p___initenv() msvcrt.__p___initenv -@ cdecl __p___mb_cur_max() msvcrt.__p___mb_cur_max -@ cdecl __p___wargv() msvcrt.__p___wargv -@ cdecl __p___winitenv() msvcrt.__p___winitenv -@ cdecl __p__acmdln() msvcrt.__p__acmdln -@ cdecl __p__amblksiz() msvcrt.__p__amblksiz -@ cdecl __p__commode() msvcrt.__p__commode -@ cdecl __p__daylight() msvcrt.__p__daylight -@ cdecl __p__dstbias() msvcrt.__p__dstbias -@ cdecl __p__environ() msvcrt.__p__environ -@ cdecl __p__fileinfo() msvcrt.__p__fileinfo -@ cdecl __p__fmode() msvcrt.__p__fmode -@ cdecl __p__iob() msvcrt.__p__iob -@ cdecl __p__mbcasemap() msvcrt.__p__mbcasemap -@ cdecl __p__mbctype() msvcrt.__p__mbctype -@ cdecl __p__osver() msvcrt.__p__osver -@ cdecl __p__pctype() msvcrt.__p__pctype -@ cdecl __p__pgmptr() msvcrt.__p__pgmptr -@ cdecl __p__pwctype() msvcrt.__p__pwctype -@ cdecl __p__timezone() msvcrt.__p__timezone -@ cdecl __p__tzname() msvcrt.__p__tzname -@ cdecl __p__wcmdln() msvcrt.__p__wcmdln -@ cdecl __p__wenviron() msvcrt.__p__wenviron -@ cdecl __p__winmajor() msvcrt.__p__winmajor -@ cdecl __p__winminor() msvcrt.__p__winminor -@ cdecl __p__winver() msvcrt.__p__winver -@ cdecl __p__wpgmptr() msvcrt.__p__wpgmptr -@ cdecl __pctype_func() msvcrt.__pctype_func -@ extern __pioinfo msvcrt.__pioinfo +@ extern __lc_codepage MSVCRT___lc_codepage +@ extern __lc_collate_cp MSVCRT___lc_collate_cp +@ extern __lc_handle MSVCRT___lc_handle +@ cdecl __lconv_init() +@ extern __mb_cur_max MSVCRT___mb_cur_max +@ cdecl __p___argc() MSVCRT___p___argc +@ cdecl __p___argv() MSVCRT___p___argv +@ cdecl __p___initenv() +@ cdecl __p___mb_cur_max() +@ cdecl __p___wargv() MSVCRT___p___wargv +@ cdecl __p___winitenv() +@ cdecl __p__acmdln() +@ cdecl __p__amblksiz() +@ cdecl __p__commode() +@ cdecl __p__daylight() MSVCRT___p__daylight +@ cdecl __p__dstbias() +@ cdecl __p__environ() MSVCRT___p__environ +@ stub __p__fileinfo() +@ cdecl __p__fmode() +@ cdecl __p__iob() MSVCRT___iob_func +@ stub __p__mbcasemap() +@ cdecl __p__mbctype() +@ cdecl __p__osver() +@ cdecl __p__pctype() MSVCRT___p__pctype +@ cdecl __p__pgmptr() MSVCRT___p__pgmptr +@ stub __p__pwctype() +@ cdecl __p__timezone() MSVCRT___p__timezone +@ cdecl __p__tzname() +@ cdecl __p__wcmdln() +@ cdecl __p__wenviron() MSVCRT___p__wenviron +@ cdecl __p__winmajor() +@ cdecl __p__winminor() +@ cdecl __p__winver() +@ cdecl __p__wpgmptr() MSVCRT___p__wpgmptr +@ cdecl __pctype_func() MSVCRT___pctype_func +@ extern __pioinfo MSVCRT___pioinfo @ stub __pwctype_func -@ cdecl __pxcptinfoptrs() msvcrt.__pxcptinfoptrs -@ cdecl __security_error_handler(long ptr) msvcrt.__security_error_handler -@ cdecl __set_app_type(long) msvcrt.__set_app_type +@ cdecl __pxcptinfoptrs() MSVCRT___pxcptinfoptrs +@ cdecl __security_error_handler(long ptr) +@ cdecl __set_app_type(long) MSVCRT___set_app_type @ stub __set_buffer_overrun_handler -@ extern __setlc_active msvcrt.__setlc_active -@ cdecl __setusermatherr(ptr) msvcrt.__setusermatherr -@ cdecl __threadhandle() msvcrt.__threadhandle -@ cdecl __threadid() msvcrt.__threadid -@ cdecl __toascii(long) msvcrt.__toascii -@ cdecl __unDName(ptr str long ptr ptr long) msvcrt.__unDName -@ cdecl __unDNameEx(ptr str long ptr ptr ptr long) msvcrt.__unDNameEx -@ extern __unguarded_readlc_active msvcrt.__unguarded_readlc_active -@ extern __wargv msvcrt.__wargv -@ cdecl __wcserror(wstr) msvcrt.__wcserror -@ cdecl __wgetmainargs(ptr ptr ptr long ptr) msvcrt.__wgetmainargs -@ extern __winitenv msvcrt.__winitenv -@ cdecl _abnormal_termination() msvcrt._abnormal_termination -@ cdecl _access(str long) msvcrt._access -@ extern _acmdln msvcrt._acmdln -@ stdcall -arch=i386 _adj_fdiv_m16i(long) msvcrt._adj_fdiv_m16i -@ stdcall -arch=i386 _adj_fdiv_m32(long) msvcrt._adj_fdiv_m32 -@ stdcall -arch=i386 _adj_fdiv_m32i(long) msvcrt._adj_fdiv_m32i -@ stdcall -arch=i386 _adj_fdiv_m64(int64) msvcrt._adj_fdiv_m64 -@ cdecl -arch=i386 _adj_fdiv_r() msvcrt._adj_fdiv_r -@ stdcall -arch=i386 _adj_fdivr_m16i(long) msvcrt._adj_fdivr_m16i -@ stdcall -arch=i386 _adj_fdivr_m32(long) msvcrt._adj_fdivr_m32 -@ stdcall -arch=i386 _adj_fdivr_m32i(long) msvcrt._adj_fdivr_m32i -@ stdcall -arch=i386 _adj_fdivr_m64(int64) msvcrt._adj_fdivr_m64 -@ cdecl -arch=i386 _adj_fpatan() msvcrt._adj_fpatan -@ cdecl -arch=i386 _adj_fprem() msvcrt._adj_fprem -@ cdecl -arch=i386 _adj_fprem1() msvcrt._adj_fprem1 -@ cdecl -arch=i386 _adj_fptan() msvcrt._adj_fptan -@ extern -arch=i386 _adjust_fdiv msvcrt._adjust_fdiv -@ extern _aexit_rtn msvcrt._aexit_rtn -@ cdecl _aligned_free(ptr) msvcrt._aligned_free -@ cdecl _aligned_malloc(long long) msvcrt._aligned_malloc -@ cdecl _aligned_offset_malloc(long long long) msvcrt._aligned_offset_malloc -@ cdecl _aligned_offset_realloc(ptr long long long) msvcrt._aligned_offset_realloc -@ cdecl _aligned_realloc(ptr long long) msvcrt._aligned_realloc -@ cdecl _amsg_exit(long) msvcrt._amsg_exit -@ cdecl _assert(str str long) msvcrt._assert -@ cdecl _atodbl(ptr str) msvcrt._atodbl -@ cdecl -ret64 _atoi64(str) msvcrt._atoi64 -@ cdecl _atoldbl(ptr str) msvcrt._atoldbl -@ cdecl _beep(long long) msvcrt._beep -@ cdecl _beginthread(ptr long ptr) msvcrt._beginthread -@ cdecl _beginthreadex(ptr long ptr ptr long ptr) msvcrt._beginthreadex -@ cdecl _c_exit() msvcrt._c_exit -@ cdecl _cabs(long) msvcrt._cabs -@ cdecl _callnewh(long) msvcrt._callnewh -@ cdecl _cexit() msvcrt._cexit -@ cdecl _cgets(ptr) msvcrt._cgets +@ extern __setlc_active MSVCRT___setlc_active +@ cdecl __setusermatherr(ptr) MSVCRT___setusermatherr +@ cdecl __threadhandle() kernel32.GetCurrentThread +@ cdecl __threadid() kernel32.GetCurrentThreadId +@ cdecl __toascii(long) MSVCRT___toascii +@ cdecl __unDName(ptr str long ptr ptr long) +@ cdecl __unDNameEx(ptr str long ptr ptr ptr long) +@ extern __unguarded_readlc_active MSVCRT___unguarded_readlc_active +@ extern __wargv MSVCRT___wargv +@ cdecl __wcserror(wstr) MSVCRT___wcserror +@ cdecl __wgetmainargs(ptr ptr ptr long ptr) +@ extern __winitenv MSVCRT___winitenv +@ cdecl _abnormal_termination() +@ cdecl _access(str long) MSVCRT__access +@ extern _acmdln MSVCRT__acmdln +@ stdcall -arch=i386 _adj_fdiv_m16i(long) +@ stdcall -arch=i386 _adj_fdiv_m32(long) +@ stdcall -arch=i386 _adj_fdiv_m32i(long) +@ stdcall -arch=i386 _adj_fdiv_m64(int64) +@ cdecl -arch=i386 _adj_fdiv_r() +@ stdcall -arch=i386 _adj_fdivr_m16i(long) +@ stdcall -arch=i386 _adj_fdivr_m32(long) +@ stdcall -arch=i386 _adj_fdivr_m32i(long) +@ stdcall -arch=i386 _adj_fdivr_m64(int64) +@ cdecl -arch=i386 _adj_fpatan() +@ cdecl -arch=i386 _adj_fprem() +@ cdecl -arch=i386 _adj_fprem1() +@ cdecl -arch=i386 _adj_fptan() +@ extern -arch=i386 _adjust_fdiv MSVCRT__adjust_fdiv +@ extern _aexit_rtn +@ cdecl _aligned_free(ptr) +@ cdecl _aligned_malloc(long long) +@ cdecl _aligned_offset_malloc(long long long) +@ cdecl _aligned_offset_realloc(ptr long long long) +@ cdecl _aligned_realloc(ptr long long) +@ cdecl _amsg_exit(long) +@ cdecl _assert(str str long) MSVCRT__assert +@ cdecl _atodbl(ptr str) MSVCRT__atodbl +@ cdecl -ret64 _atoi64(str) ntdll._atoi64 +@ cdecl _atoldbl(ptr str) MSVCRT__atoldbl +@ cdecl _beep(long long) MSVCRT__beep +@ cdecl _beginthread(ptr long ptr) +@ cdecl _beginthreadex(ptr long ptr ptr long ptr) +@ cdecl _c_exit() MSVCRT__c_exit +@ cdecl _cabs(long) MSVCRT__cabs +@ cdecl _callnewh(long) +@ cdecl _cexit() MSVCRT__cexit +@ cdecl _cgets(ptr) @ stub _cgetws -@ cdecl _chdir(str) msvcrt._chdir -@ cdecl _chdrive(long) msvcrt._chdrive -@ cdecl _chgsign(double) msvcrt._chgsign -@ cdecl -arch=i386 -norelay _chkesp() msvcrt._chkesp -@ cdecl _chmod(str long) msvcrt._chmod -@ cdecl _chsize(long long) msvcrt._chsize -@ cdecl _clearfp() msvcrt._clearfp -@ cdecl _close(long) msvcrt._close -@ cdecl _commit(long) msvcrt._commit -@ extern _commode msvcrt._commode -@ cdecl _control87(long long) msvcrt._control87 -@ cdecl _controlfp(long long) msvcrt._controlfp -@ cdecl _copysign(double double) msvcrt._copysign -@ varargs _cprintf(str) msvcrt._cprintf -@ cdecl _cputs(str) msvcrt._cputs -@ cdecl _cputws(wstr) msvcrt._cputws -@ cdecl _creat(str long) msvcrt._creat -@ varargs _cscanf(str) msvcrt._cscanf -@ cdecl _ctime64(ptr) msvcrt._ctime64 -@ cdecl _cwait(ptr long long) msvcrt._cwait -@ varargs _cwprintf(wstr) msvcrt._cwprintf -@ varargs _cwscanf(wstr) msvcrt._cwscanf -@ extern _daylight msvcrt._daylight -@ extern _dstbias msvcrt._dstbias -@ cdecl _dup(long) msvcrt._dup -@ cdecl _dup2(long long) msvcrt._dup2 -@ cdecl _ecvt(double long ptr ptr) msvcrt._ecvt -@ cdecl _endthread() msvcrt._endthread -@ cdecl _endthreadex(long) msvcrt._endthreadex -@ extern _environ msvcrt._environ -@ cdecl _eof(long) msvcrt._eof -@ cdecl _errno() msvcrt._errno -@ cdecl -arch=i386 _except_handler2(ptr ptr ptr ptr) msvcrt._except_handler2 -@ cdecl -arch=i386 _except_handler3(ptr ptr ptr ptr) msvcrt._except_handler3 -@ varargs _execl(str str) msvcrt._execl -@ varargs _execle(str str) msvcrt._execle -@ varargs _execlp(str str) msvcrt._execlp -@ varargs _execlpe(str str) msvcrt._execlpe -@ cdecl _execv(str ptr) msvcrt._execv -@ cdecl _execve(str ptr ptr) msvcrt._execve -@ cdecl _execvp(str ptr) msvcrt._execvp -@ cdecl _execvpe(str ptr ptr) msvcrt._execvpe -@ cdecl _exit(long) msvcrt._exit -@ cdecl _expand(ptr long) msvcrt._expand -@ cdecl _fcloseall() msvcrt._fcloseall -@ cdecl _fcvt(double long ptr ptr) msvcrt._fcvt -@ cdecl _fdopen(long str) msvcrt._fdopen -@ cdecl _fgetchar() msvcrt._fgetchar -@ cdecl _fgetwchar() msvcrt._fgetwchar -@ cdecl _filbuf(ptr) msvcrt._filbuf +@ cdecl _chdir(str) MSVCRT__chdir +@ cdecl _chdrive(long) MSVCRT__chdrive +@ cdecl _chgsign(double) MSVCRT__chgsign +@ cdecl -arch=i386 -norelay _chkesp() +@ cdecl _chmod(str long) MSVCRT__chmod +@ cdecl _chsize(long long) MSVCRT__chsize +@ cdecl _clearfp() +@ cdecl _close(long) MSVCRT__close +@ cdecl _commit(long) MSVCRT__commit +@ extern _commode MSVCRT__commode +@ cdecl _control87(long long) +@ cdecl _controlfp(long long) +@ cdecl _copysign(double double) MSVCRT__copysign +@ varargs _cprintf(str) +@ cdecl _cputs(str) +@ cdecl _cputws(wstr) +@ cdecl _creat(str long) MSVCRT__creat +@ varargs _cscanf(str) +@ cdecl _ctime64(ptr) MSVCRT__ctime64 +@ cdecl _cwait(ptr long long) +@ varargs _cwprintf(wstr) +@ varargs _cwscanf(wstr) +@ extern _daylight MSVCRT___daylight +@ extern _dstbias MSVCRT__dstbias +@ cdecl _dup(long) MSVCRT__dup +@ cdecl _dup2(long long) MSVCRT__dup2 +@ cdecl _ecvt(double long ptr ptr) MSVCRT__ecvt +@ cdecl _endthread() +@ cdecl _endthreadex(long) +@ extern _environ MSVCRT__environ +@ cdecl _eof(long) MSVCRT__eof +@ cdecl _errno() MSVCRT__errno +@ cdecl -arch=i386 _except_handler2(ptr ptr ptr ptr) +@ cdecl -arch=i386 _except_handler3(ptr ptr ptr ptr) +@ varargs _execl(str str) +@ varargs _execle(str str) +@ varargs _execlp(str str) +@ varargs _execlpe(str str) +@ 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 _fcloseall() MSVCRT__fcloseall +@ cdecl _fcvt(double long ptr ptr) MSVCRT__fcvt +@ cdecl _fdopen(long str) MSVCRT__fdopen +@ cdecl _fgetchar() MSVCRT__fgetchar +@ cdecl _fgetwchar() MSVCRT__fgetwchar +@ cdecl _filbuf(ptr) MSVCRT__filbuf # extern _fileinfo -@ cdecl _filelength(long) msvcrt._filelength -@ cdecl -ret64 _filelengthi64(long) msvcrt._filelengthi64 -@ cdecl _fileno(ptr) msvcrt._fileno -@ cdecl _findclose(long) msvcrt._findclose -@ cdecl _findfirst(str ptr) msvcrt._findfirst -@ cdecl _findfirst64(str ptr) msvcrt._findfirst64 -@ cdecl _findfirsti64(str ptr) msvcrt._findfirsti64 -@ cdecl _findnext(long ptr) msvcrt._findnext -@ cdecl _findnext64(long ptr) msvcrt._findnext64 -@ cdecl _findnexti64(long ptr) msvcrt._findnexti64 -@ cdecl _finite(double) msvcrt._finite -@ cdecl _flsbuf(long ptr) msvcrt._flsbuf -@ cdecl _flushall() msvcrt._flushall -@ extern _fmode msvcrt._fmode -@ cdecl _fpclass(double) msvcrt._fpclass -@ cdecl _fpieee_flt(long ptr ptr) msvcrt._fpieee_flt -@ cdecl _fpreset() msvcrt._fpreset -@ cdecl _fputchar(long) msvcrt._fputchar -@ cdecl _fputwchar(long) msvcrt._fputwchar -@ cdecl _fsopen(str str long) msvcrt._fsopen -@ cdecl _fstat(long ptr) msvcrt._fstat -@ cdecl _fstat64(long ptr) msvcrt._fstat64 -@ cdecl _fstati64(long ptr) msvcrt._fstati64 -@ cdecl _ftime(ptr) msvcrt._ftime -@ cdecl _ftime64(ptr) msvcrt._ftime64 -@ cdecl -arch=i386 -ret64 _ftol() msvcrt._ftol -@ cdecl _fullpath(ptr str long) msvcrt._fullpath -@ cdecl _futime(long ptr) msvcrt._futime -@ cdecl _futime64(long ptr) msvcrt._futime64 -@ cdecl _gcvt(double long str) msvcrt._gcvt -@ cdecl _get_heap_handle() msvcrt._get_heap_handle -@ cdecl _get_osfhandle(long) msvcrt._get_osfhandle -@ cdecl _get_sbh_threshold() msvcrt._get_sbh_threshold -@ cdecl _getch() msvcrt._getch -@ cdecl _getche() msvcrt._getche -@ cdecl _getcwd(str long) msvcrt._getcwd -@ cdecl _getdcwd(long str long) msvcrt._getdcwd -@ cdecl _getdiskfree(long ptr) msvcrt._getdiskfree -@ cdecl _getdllprocaddr(long str long) msvcrt._getdllprocaddr -@ cdecl _getdrive() msvcrt._getdrive -@ cdecl _getdrives() msvcrt._getdrives -@ cdecl _getmaxstdio() msvcrt._getmaxstdio -@ cdecl _getmbcp() msvcrt._getmbcp -@ cdecl _getpid() msvcrt._getpid -@ cdecl _getsystime(ptr) msvcrt._getsystime -@ cdecl _getw(ptr) msvcrt._getw +@ cdecl _filelength(long) MSVCRT__filelength +@ cdecl -ret64 _filelengthi64(long) MSVCRT__filelengthi64 +@ cdecl _fileno(ptr) MSVCRT__fileno +@ cdecl _findclose(long) MSVCRT__findclose +@ cdecl _findfirst(str ptr) MSVCRT__findfirst +@ cdecl _findfirst64(str ptr) MSVCRT__findfirst64 +@ cdecl _findfirsti64(str ptr) MSVCRT__findfirsti64 +@ cdecl _findnext(long ptr) MSVCRT__findnext +@ cdecl _findnext64(long ptr) MSVCRT__findnext64 +@ cdecl _findnexti64(long ptr) MSVCRT__findnexti64 +@ cdecl _finite(double) MSVCRT__finite +@ cdecl _flsbuf(long ptr) MSVCRT__flsbuf +@ cdecl _flushall() MSVCRT__flushall +@ extern _fmode MSVCRT__fmode +@ cdecl _fpclass(double) MSVCRT__fpclass +@ stub _fpieee_flt(long ptr ptr) +@ cdecl _fpreset() +@ cdecl _fputchar(long) MSVCRT__fputchar +@ cdecl _fputwchar(long) MSVCRT__fputwchar +@ cdecl _fsopen(str str long) MSVCRT__fsopen +@ cdecl _fstat(long ptr) MSVCRT__fstat +@ cdecl _fstat64(long ptr) MSVCRT__fstat64 +@ cdecl _fstati64(long ptr) MSVCRT__fstati64 +@ cdecl _ftime(ptr) MSVCRT__ftime +@ cdecl _ftime64(ptr) MSVCRT__ftime64 +@ cdecl -arch=i386 -ret64 _ftol() MSVCRT__ftol +@ cdecl _fullpath(ptr str long) MSVCRT__fullpath +@ cdecl _futime(long ptr) +@ cdecl _futime64(long ptr) +@ cdecl _gcvt(double long str) MSVCRT__gcvt +@ cdecl _get_heap_handle() +@ cdecl _get_osfhandle(long) MSVCRT__get_osfhandle +@ cdecl _get_sbh_threshold() +@ cdecl _getch() +@ cdecl _getche() +@ 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 @ stub _getwch @ stub _getwche -@ cdecl _getws(ptr) msvcrt._getws -@ cdecl -arch=i386 _global_unwind2(ptr) msvcrt._global_unwind2 -@ cdecl _gmtime64(ptr) msvcrt._gmtime64 -@ cdecl _heapadd(ptr long) msvcrt._heapadd -@ cdecl _heapchk() msvcrt._heapchk -@ cdecl _heapmin() msvcrt._heapmin -@ cdecl _heapset(long) msvcrt._heapset -@ cdecl _heapused(ptr ptr) msvcrt._heapused -@ cdecl _heapwalk(ptr) msvcrt._heapwalk -@ cdecl _hypot(double double) msvcrt._hypot -@ cdecl _i64toa(int64 ptr long) msvcrt._i64toa -@ cdecl _i64tow(int64 ptr long) msvcrt._i64tow -@ cdecl _initterm(ptr ptr) msvcrt._initterm -@ cdecl -arch=i386 _inp(long) msvcrt._inp -@ cdecl -arch=i386 _inpd(long) msvcrt._inpd -@ cdecl -arch=i386 _inpw(long) msvcrt._inpw -@ extern _iob msvcrt._iob -@ cdecl _isatty(long) msvcrt._isatty -@ cdecl _isctype(long long) msvcrt._isctype -@ cdecl _ismbbalnum(long) msvcrt._ismbbalnum -@ cdecl _ismbbalpha(long) msvcrt._ismbbalpha -@ cdecl _ismbbgraph(long) msvcrt._ismbbgraph -@ cdecl _ismbbkalnum(long) msvcrt._ismbbkalnum -@ cdecl _ismbbkana(long) msvcrt._ismbbkana -@ cdecl _ismbbkprint(long) msvcrt._ismbbkprint -@ cdecl _ismbbkpunct(long) msvcrt._ismbbkpunct -@ cdecl _ismbblead(long) msvcrt._ismbblead -@ cdecl _ismbbprint(long) msvcrt._ismbbprint -@ cdecl _ismbbpunct(long) msvcrt._ismbbpunct -@ cdecl _ismbbtrail(long) msvcrt._ismbbtrail -@ cdecl _ismbcalnum(long) msvcrt._ismbcalnum -@ cdecl _ismbcalpha(long) msvcrt._ismbcalpha -@ cdecl _ismbcdigit(long) msvcrt._ismbcdigit -@ cdecl _ismbcgraph(long) msvcrt._ismbcgraph -@ cdecl _ismbchira(long) msvcrt._ismbchira -@ cdecl _ismbckata(long) msvcrt._ismbckata -@ cdecl _ismbcl0(long) msvcrt._ismbcl0 -@ cdecl _ismbcl1(long) msvcrt._ismbcl1 -@ cdecl _ismbcl2(long) msvcrt._ismbcl2 -@ cdecl _ismbclegal(long) msvcrt._ismbclegal -@ cdecl _ismbclower(long) msvcrt._ismbclower -@ cdecl _ismbcprint(long) msvcrt._ismbcprint -@ cdecl _ismbcpunct(long) msvcrt._ismbcpunct -@ cdecl _ismbcspace(long) msvcrt._ismbcspace -@ cdecl _ismbcsymbol(long) msvcrt._ismbcsymbol -@ cdecl _ismbcupper(long) msvcrt._ismbcupper -@ cdecl _ismbslead(ptr ptr) msvcrt._ismbslead -@ cdecl _ismbstrail(ptr ptr) msvcrt._ismbstrail -@ cdecl _isnan(double) msvcrt._isnan -@ cdecl _itoa(long ptr long) msvcrt._itoa -@ cdecl _itow(long ptr long) msvcrt._itow -@ cdecl _j0(double) msvcrt._j0 -@ cdecl _j1(double) msvcrt._j1 -@ cdecl _jn(long double) msvcrt._jn -@ cdecl _kbhit() msvcrt._kbhit -@ cdecl _lfind(ptr ptr ptr long ptr) msvcrt._lfind -@ cdecl _loaddll(str) msvcrt._loaddll -@ cdecl -arch=i386 _local_unwind2(ptr long) msvcrt._local_unwind2 -@ cdecl _localtime64(ptr) msvcrt._localtime64 -@ cdecl _lock(long) msvcrt._lock -@ cdecl _locking(long long long) msvcrt._locking -@ cdecl _logb(double) msvcrt._logb -@ cdecl -arch=i386 _longjmpex(ptr long) msvcrt._longjmpex -@ cdecl _lrotl(long long) msvcrt._lrotl -@ cdecl _lrotr(long long) msvcrt._lrotr -@ cdecl _lsearch(ptr ptr ptr long ptr) msvcrt._lsearch -@ cdecl _lseek(long long long) msvcrt._lseek -@ cdecl -ret64 _lseeki64(long int64 long) msvcrt._lseeki64 -@ cdecl _ltoa(long ptr long) msvcrt._ltoa -@ cdecl _ltow(long ptr long) msvcrt._ltow -@ cdecl _makepath(ptr str str str str) msvcrt._makepath -@ cdecl _mbbtombc(long) msvcrt._mbbtombc -@ cdecl _mbbtype(long long) msvcrt._mbbtype +@ cdecl _getws(ptr) MSVCRT__getws +@ cdecl -arch=i386 _global_unwind2(ptr) +@ cdecl _gmtime64(ptr) MSVCRT__gmtime64 +@ cdecl _heapadd(ptr long) +@ cdecl _heapchk() +@ cdecl _heapmin() +@ cdecl _heapset(long) +@ stub _heapused(ptr ptr) +@ cdecl _heapwalk(ptr) +@ cdecl _hypot(double double) +@ cdecl _i64toa(int64 ptr long) ntdll._i64toa +@ cdecl _i64tow(int64 ptr long) ntdll._i64tow +@ cdecl _initterm(ptr ptr) +@ stub -arch=i386 _inp(long) +@ stub -arch=i386 _inpd(long) +@ stub -arch=i386 _inpw(long) +@ extern _iob MSVCRT__iob +@ cdecl _isatty(long) MSVCRT__isatty +@ cdecl _isctype(long long) MSVCRT__isctype +@ stub _ismbbalnum(long) +@ stub _ismbbalpha(long) +@ stub _ismbbgraph(long) +@ stub _ismbbkalnum(long) +@ cdecl _ismbbkana(long) +@ stub _ismbbkprint(long) +@ stub _ismbbkpunct(long) +@ cdecl _ismbblead(long) +@ stub _ismbbprint(long) +@ stub _ismbbpunct(long) +@ cdecl _ismbbtrail(long) +@ cdecl _ismbcalnum(long) +@ cdecl _ismbcalpha(long) +@ cdecl _ismbcdigit(long) +@ cdecl _ismbcgraph(long) +@ cdecl _ismbchira(long) +@ cdecl _ismbckata(long) +@ stub _ismbcl0(long) +@ stub _ismbcl1(long) +@ stub _ismbcl2(long) +@ cdecl _ismbclegal(long) +@ cdecl _ismbclower(long) +@ cdecl _ismbcprint(long) +@ cdecl _ismbcpunct(long) +@ cdecl _ismbcspace(long) +@ cdecl _ismbcsymbol(long) +@ cdecl _ismbcupper(long) +@ cdecl _ismbslead(ptr ptr) +@ cdecl _ismbstrail(ptr ptr) +@ cdecl _isnan(double) MSVCRT__isnan +@ cdecl _itoa(long ptr long) MSVCRT__itoa +@ cdecl _itow(long ptr long) ntdll._itow +@ cdecl _j0(double) MSVCRT__j0 +@ cdecl _j1(double) MSVCRT__j1 +@ cdecl _jn(long double) MSVCRT__jn +@ cdecl _kbhit() +@ cdecl _lfind(ptr ptr ptr long ptr) +@ cdecl _loaddll(str) +@ cdecl -arch=i386 _local_unwind2(ptr long) +@ cdecl _localtime64(ptr) MSVCRT__localtime64 +@ cdecl _lock(long) +@ cdecl _locking(long long long) MSVCRT__locking +@ cdecl _logb(double) MSVCRT__logb +@ 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) +@ cdecl _lseek(long long long) MSVCRT__lseek +@ cdecl -ret64 _lseeki64(long int64 long) MSVCRT__lseeki64 +@ cdecl _ltoa(long ptr long) ntdll._ltoa +@ cdecl _ltow(long ptr long) ntdll._ltow +@ cdecl _makepath(ptr str str str str) MSVCRT__makepath +@ cdecl _mbbtombc(long) +@ cdecl _mbbtype(long long) # extern _mbcasemap -@ cdecl _mbccpy(ptr str) msvcrt._mbccpy -@ cdecl _mbcjistojms(long) msvcrt._mbcjistojms -@ cdecl _mbcjmstojis(long) msvcrt._mbcjmstojis -@ cdecl _mbclen(ptr) msvcrt._mbclen -@ cdecl _mbctohira(long) msvcrt._mbctohira -@ cdecl _mbctokata(long) msvcrt._mbctokata -@ cdecl _mbctolower(long) msvcrt._mbctolower -@ cdecl _mbctombb(long) msvcrt._mbctombb -@ cdecl _mbctoupper(long) msvcrt._mbctoupper -@ extern _mbctype msvcrt._mbctype -@ cdecl _mbsbtype(str long) msvcrt._mbsbtype -@ cdecl _mbscat(str str) msvcrt._mbscat -@ cdecl _mbschr(str long) msvcrt._mbschr -@ cdecl _mbscmp(str str) msvcrt._mbscmp -@ cdecl _mbscoll(str str) msvcrt._mbscoll -@ cdecl _mbscpy(ptr str) msvcrt._mbscpy -@ cdecl _mbscspn(str str) msvcrt._mbscspn -@ cdecl _mbsdec(ptr ptr) msvcrt._mbsdec -@ cdecl _mbsdup(str) msvcrt._mbsdup -@ cdecl _mbsicmp(str str) msvcrt._mbsicmp -@ cdecl _mbsicoll(str str) msvcrt._mbsicoll -@ cdecl _mbsinc(str) msvcrt._mbsinc -@ cdecl _mbslen(str) msvcrt._mbslen -@ cdecl _mbslwr(str) msvcrt._mbslwr -@ cdecl _mbsnbcat(str str long) msvcrt._mbsnbcat -@ cdecl _mbsnbcmp(str str long) msvcrt._mbsnbcmp -@ cdecl _mbsnbcnt(ptr long) msvcrt._mbsnbcnt -@ cdecl _mbsnbcoll(str str long) msvcrt._mbsnbcoll -@ cdecl _mbsnbcpy(ptr str long) msvcrt._mbsnbcpy -@ cdecl _mbsnbicmp(str str long) msvcrt._mbsnbicmp -@ cdecl _mbsnbicoll(str str long) msvcrt._mbsnbicoll -@ cdecl _mbsnbset(ptr long long) msvcrt._mbsnbset -@ cdecl _mbsncat(str str long) msvcrt._mbsncat -@ cdecl _mbsnccnt(str long) msvcrt._mbsnccnt -@ cdecl _mbsncmp(str str long) msvcrt._mbsncmp -@ cdecl _mbsncoll(str str long) msvcrt._mbsncoll -@ cdecl _mbsncpy(ptr str long) msvcrt._mbsncpy -@ cdecl _mbsnextc(str) msvcrt._mbsnextc -@ cdecl _mbsnicmp(str str long) msvcrt._mbsnicmp -@ cdecl _mbsnicoll(str str long) msvcrt._mbsnicoll -@ cdecl _mbsninc(str long) msvcrt._mbsninc -@ cdecl _mbsnset(ptr long long) msvcrt._mbsnset -@ cdecl _mbspbrk(str str) msvcrt._mbspbrk -@ cdecl _mbsrchr(str long) msvcrt._mbsrchr -@ cdecl _mbsrev(str) msvcrt._mbsrev -@ cdecl _mbsset(ptr long) msvcrt._mbsset -@ cdecl _mbsspn(str str) msvcrt._mbsspn -@ cdecl _mbsspnp(str str) msvcrt._mbsspnp -@ cdecl _mbsstr(str str) msvcrt._mbsstr -@ cdecl _mbstok(str str) msvcr100._mbstok #don't forward to msvcrt -@ cdecl _mbstrlen(str) msvcrt._mbstrlen -@ cdecl _mbsupr(str) msvcrt._mbsupr -@ cdecl _memccpy(ptr ptr long long) msvcrt._memccpy -@ cdecl _memicmp(str str long) msvcrt._memicmp -@ cdecl _mkdir(str) msvcrt._mkdir -@ cdecl _mktemp(str) msvcrt._mktemp -@ cdecl _mktime64(ptr) msvcrt._mktime64 -@ cdecl _msize(ptr) msvcrt._msize -@ cdecl _nextafter(double double) msvcrt._nextafter -@ cdecl _onexit(ptr) msvcrt._onexit -@ varargs _open(str long) msvcrt._open -@ cdecl _open_osfhandle(long long) msvcrt._open_osfhandle -@ extern _osplatform msvcrt._osplatform -@ extern _osver msvcrt._osver -@ cdecl -arch=i386 _outp(long long) msvcrt._outp -@ cdecl -arch=i386 _outpd(long long) msvcrt._outpd -@ cdecl -arch=i386 _outpw(long long) msvcrt._outpw -@ cdecl _pclose(ptr) msvcrt._pclose -@ extern _pctype msvcrt._pctype -@ extern _pgmptr msvcrt._pgmptr -@ cdecl _pipe(ptr long long) msvcrt._pipe -@ cdecl _popen(str str) msvcrt._popen -@ cdecl _purecall() msvcrt._purecall -@ cdecl _putch(long) msvcrt._putch -@ cdecl _putenv(str) msvcrt._putenv -@ cdecl _putw(long ptr) msvcrt._putw -@ cdecl _putwch(long) msvcrt._putwch -@ cdecl _putws(wstr) msvcrt._putws +@ cdecl _mbccpy(ptr str) +@ cdecl _mbcjistojms(long) +@ cdecl _mbcjmstojis(long) +@ cdecl _mbclen(ptr) +@ stub _mbctohira(long) +@ stub _mbctokata(long) +@ cdecl _mbctolower(long) +@ cdecl _mbctombb(long) +@ cdecl _mbctoupper(long) +@ extern _mbctype MSVCRT_mbctype +@ cdecl _mbsbtype(str long) +@ cdecl _mbscat(str str) +@ cdecl _mbschr(str long) +@ cdecl _mbscmp(str str) +@ cdecl _mbscoll(str str) +@ cdecl _mbscpy(ptr str) +@ cdecl _mbscspn(str str) +@ cdecl _mbsdec(ptr ptr) +@ cdecl _mbsdup(str) MSVCRT__strdup +@ cdecl _mbsicmp(str str) +@ cdecl _mbsicoll(str str) +@ cdecl _mbsinc(str) +@ cdecl _mbslen(str) +@ cdecl _mbslwr(str) +@ cdecl _mbsnbcat(str str long) +@ cdecl _mbsnbcmp(str str long) +@ cdecl _mbsnbcnt(ptr long) +@ cdecl _mbsnbcoll(str str long) +@ cdecl _mbsnbcpy(ptr str long) +@ cdecl _mbsnbicmp(str str long) +@ cdecl _mbsnbicoll(str str long) +@ cdecl _mbsnbset(ptr long long) +@ cdecl _mbsncat(str str long) +@ cdecl _mbsnccnt(str long) +@ cdecl _mbsncmp(str str long) +@ stub _mbsncoll(str str long) +@ cdecl _mbsncpy(ptr str long) +@ cdecl _mbsnextc(str) +@ cdecl _mbsnicmp(str str long) +@ stub _mbsnicoll(str str long) +@ cdecl _mbsninc(str long) +@ cdecl _mbsnset(ptr long long) +@ cdecl _mbspbrk(str str) +@ cdecl _mbsrchr(str long) +@ cdecl _mbsrev(str) +@ cdecl _mbsset(ptr long) +@ cdecl _mbsspn(str str) +@ cdecl _mbsspnp(str str) +@ cdecl _mbsstr(str str) +@ cdecl _mbstok(str str) +@ cdecl _mbstrlen(str) +@ cdecl _mbsupr(str) +@ cdecl _memccpy(ptr ptr long long) ntdll._memccpy +@ cdecl _memicmp(str str long) ntdll._memicmp +@ cdecl _mkdir(str) MSVCRT__mkdir +@ cdecl _mktemp(str) MSVCRT__mktemp +@ cdecl _mktime64(ptr) MSVCRT__mktime64 +@ cdecl _msize(ptr) +@ cdecl _nextafter(double double) MSVCRT__nextafter +@ cdecl _onexit(ptr) MSVCRT__onexit +@ varargs _open(str long) MSVCRT__open +@ cdecl _open_osfhandle(long long) MSVCRT__open_osfhandle +@ extern _osplatform MSVCRT__osplatform +@ extern _osver MSVCRT__osver +@ stub -arch=i386 _outp(long long) +@ stub -arch=i386 _outpd(long long) +@ stub -arch=i386 _outpw(long long) +@ cdecl _pclose(ptr) MSVCRT__pclose +@ extern _pctype MSVCRT__pctype +@ extern _pgmptr MSVCRT__pgmptr +@ cdecl _pipe(ptr long long) MSVCRT__pipe +@ cdecl _popen(str str) MSVCRT__popen +@ cdecl _purecall() +@ cdecl _putch(long) +@ cdecl _putenv(str) +@ cdecl _putw(long ptr) MSVCRT__putw +@ cdecl _putwch(long) MSVCRT__putwch +@ cdecl _putws(wstr) MSVCRT__putws # extern _pwctype -@ cdecl _read(long ptr long) msvcrt._read -@ cdecl _resetstkoflw() msvcrt._resetstkoflw -@ cdecl _rmdir(str) msvcrt._rmdir -@ cdecl _rmtmp() msvcrt._rmtmp -@ cdecl _rotl(long long) msvcrt._rotl -@ cdecl _rotr(long long) msvcrt._rotr -@ cdecl -arch=i386 _safe_fdiv() msvcrt._safe_fdiv -@ cdecl -arch=i386 _safe_fdivr() msvcrt._safe_fdivr -@ cdecl -arch=i386 _safe_fprem() msvcrt._safe_fprem -@ cdecl -arch=i386 _safe_fprem1() msvcrt._safe_fprem1 -@ cdecl _scalb(double long) msvcrt._scalb -@ varargs _scprintf(str) msvcrt._scprintf -@ varargs _scwprintf(wstr) msvcrt._scwprintf -@ cdecl _searchenv(str str ptr) msvcrt._searchenv -@ stdcall -arch=i386 _seh_longjmp_unwind(ptr) msvcrt._seh_longjmp_unwind -@ cdecl _set_SSE2_enable(long) msvcrt._set_SSE2_enable -@ cdecl _set_error_mode(long) msvcrt._set_error_mode -@ cdecl _set_purecall_handler(ptr) msvcrt._set_purecall_handler -@ cdecl _set_sbh_threshold(long) msvcrt._set_sbh_threshold -@ cdecl _set_security_error_handler(ptr) msvcrt._set_security_error_handler -@ cdecl _seterrormode(long) msvcrt._seterrormode -@ cdecl -arch=i386,x86_64,arm -norelay _setjmp(ptr) msvcrt._setjmp -@ cdecl -arch=i386 -norelay _setjmp3(ptr long) msvcrt._setjmp3 -@ cdecl _setmaxstdio(long) msvcrt._setmaxstdio -@ cdecl _setmbcp(long) msvcrt._setmbcp -@ cdecl _setmode(long long) msvcrt._setmode -@ cdecl _setsystime(ptr long) msvcrt._setsystime -@ cdecl _sleep(long) msvcrt._sleep -@ varargs _snprintf(ptr long str) msvcrt._snprintf -@ varargs _snscanf(str long str) msvcrt._snscanf -@ varargs _snwprintf(ptr long wstr) msvcrt._snwprintf -@ varargs _snwscanf(wstr long wstr) msvcrt._snwscanf -@ varargs _sopen(str long long) msvcrt._sopen -@ varargs _spawnl(long str str) msvcrt._spawnl -@ varargs _spawnle(long str str) msvcrt._spawnle -@ varargs _spawnlp(long str str) msvcrt._spawnlp -@ varargs _spawnlpe(long str str) msvcrt._spawnlpe -@ cdecl _spawnv(long str ptr) msvcrt._spawnv -@ cdecl _spawnve(long str ptr ptr) msvcrt._spawnve -@ cdecl _spawnvp(long str ptr) msvcrt._spawnvp -@ cdecl _spawnvpe(long str ptr ptr) msvcrt._spawnvpe -@ cdecl _splitpath(str ptr ptr ptr ptr) msvcrt._splitpath -@ cdecl _stat(str ptr) msvcrt._stat -@ cdecl _stat64(str ptr) msvcrt._stat64 -@ cdecl _stati64(str ptr) msvcrt._stati64 -@ cdecl _statusfp() msvcrt._statusfp -@ cdecl _strcmpi(str str) msvcrt._strcmpi -@ cdecl _strdate(ptr) msvcrt._strdate -@ cdecl _strdup(str) msvcrt._strdup -@ cdecl _strerror(long) msvcrt._strerror -@ cdecl _stricmp(str str) msvcrt._stricmp -@ cdecl _stricoll(str str) msvcrt._stricoll -@ cdecl _strlwr(str) msvcrt._strlwr -@ cdecl _strncoll(str str long) msvcrt._strncoll -@ cdecl _strnicmp(str str long) msvcrt._strnicmp -@ cdecl _strnicoll(str str long) msvcrt._strnicoll -@ cdecl _strnset(str long long) msvcrt._strnset -@ cdecl _strrev(str) msvcrt._strrev -@ cdecl _strset(str long) msvcrt._strset -@ cdecl _strtime(ptr) msvcrt._strtime -@ cdecl -ret64 _strtoi64(str ptr long) msvcrt._strtoi64 -@ cdecl -ret64 _strtoui64(str ptr long) msvcrt._strtoui64 -@ cdecl _strupr(str) msvcrt._strupr -@ cdecl _swab(str str long) msvcrt._swab -@ extern _sys_errlist msvcrt._sys_errlist -@ extern _sys_nerr msvcrt._sys_nerr -@ cdecl _tell(long) msvcrt._tell -@ cdecl -ret64 _telli64(long) msvcrt._telli64 -@ cdecl _tempnam(str str) msvcrt._tempnam -@ cdecl _time64(ptr) msvcrt._time64 -@ extern _timezone msvcrt._timezone -@ cdecl _tolower(long) msvcrt._tolower -@ cdecl _toupper(long) msvcrt._toupper -@ extern _tzname msvcrt._tzname -@ cdecl _tzset() msvcrt._tzset -@ cdecl _ui64toa(int64 ptr long) msvcrt._ui64toa -@ cdecl _ui64tow(int64 ptr long) msvcrt._ui64tow -@ cdecl _ultoa(long ptr long) msvcrt._ultoa -@ cdecl _ultow(long ptr long) msvcrt._ultow -@ cdecl _umask(long) msvcrt._umask -@ cdecl _ungetch(long) msvcrt._ungetch +@ cdecl _read(long ptr long) MSVCRT__read +@ cdecl _resetstkoflw() MSVCRT__resetstkoflw +@ cdecl _rmdir(str) MSVCRT__rmdir +@ cdecl _rmtmp() MSVCRT__rmtmp +@ cdecl _rotl(long long) +@ cdecl _rotr(long long) +@ cdecl -arch=i386 _safe_fdiv() +@ cdecl -arch=i386 _safe_fdivr() +@ cdecl -arch=i386 _safe_fprem() +@ cdecl -arch=i386 _safe_fprem1() +@ cdecl _scalb(double long) MSVCRT__scalb +@ varargs _scprintf(str) MSVCRT__scprintf +@ varargs _scwprintf(wstr) MSVCRT__scwprintf +@ cdecl _searchenv(str str ptr) MSVCRT__searchenv +@ stdcall -arch=i386 _seh_longjmp_unwind(ptr) +@ cdecl _set_SSE2_enable(long) MSVCRT__set_SSE2_enable +@ cdecl _set_error_mode(long) +@ cdecl _set_purecall_handler(ptr) +@ cdecl _set_sbh_threshold(long) +@ cdecl _set_security_error_handler(ptr) +@ cdecl _seterrormode(long) +@ cdecl -arch=i386,x86_64,arm -norelay _setjmp(ptr) MSVCRT__setjmp +@ 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 _snprintf(ptr long str) MSVCRT__snprintf +@ varargs _snscanf(str long str) MSVCRT__snscanf +@ varargs _snwprintf(ptr long wstr) MSVCRT__snwprintf +@ varargs _snwscanf(wstr long wstr) MSVCRT__snwscanf +@ varargs _sopen(str long long) MSVCRT__sopen +@ 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 _stat(str ptr) MSVCRT_stat +@ cdecl _stat64(str ptr) MSVCRT_stat64 +@ cdecl _stati64(str ptr) MSVCRT_stati64 +@ cdecl _statusfp() +@ cdecl _strcmpi(str str) MSVCRT__stricmp +@ cdecl _strdate(ptr) MSVCRT__strdate +@ cdecl _strdup(str) MSVCRT__strdup +@ cdecl _strerror(long) MSVCRT__strerror +@ cdecl _stricmp(str str) MSVCRT__stricmp +@ cdecl _stricoll(str str) MSVCRT__stricoll +@ cdecl _strlwr(str) MSVCRT__strlwr +@ cdecl _strncoll(str str long) MSVCRT__strncoll +@ cdecl _strnicmp(str str long) MSVCRT__strnicmp +@ cdecl _strnicoll(str str long) MSVCRT__strnicoll +@ cdecl _strnset(str long long) MSVCRT__strnset +@ cdecl _strrev(str) MSVCRT__strrev +@ cdecl _strset(str long) +@ cdecl _strtime(ptr) MSVCRT__strtime +@ cdecl -ret64 _strtoi64(str ptr long) MSVCRT_strtoi64 +@ cdecl -ret64 _strtoui64(str ptr long) MSVCRT_strtoui64 +@ cdecl _strupr(str) MSVCRT__strupr +@ cdecl _swab(str str long) MSVCRT__swab +@ extern _sys_errlist MSVCRT__sys_errlist +@ extern _sys_nerr MSVCRT__sys_nerr +@ cdecl _tell(long) MSVCRT__tell +@ cdecl -ret64 _telli64(long) +@ cdecl _tempnam(str str) MSVCRT__tempnam +@ cdecl _time64(ptr) MSVCRT__time64 +@ extern _timezone MSVCRT___timezone +@ cdecl _tolower(long) MSVCRT__tolower +@ cdecl _toupper(long) MSVCRT__toupper +@ extern _tzname MSVCRT__tzname +@ cdecl _tzset() MSVCRT__tzset +@ cdecl _ui64toa(int64 ptr long) ntdll._ui64toa +@ cdecl _ui64tow(int64 ptr long) ntdll._ui64tow +@ cdecl _ultoa(long ptr long) ntdll._ultoa +@ cdecl _ultow(long ptr long) ntdll._ultow +@ cdecl _umask(long) MSVCRT__umask +@ cdecl _ungetch(long) @ stub _ungetwch -@ cdecl _unlink(str) msvcrt._unlink -@ cdecl _unloaddll(long) msvcrt._unloaddll -@ cdecl _unlock(long) msvcrt._unlock -@ cdecl _utime(str ptr) msvcrt._utime -@ cdecl _utime64(str ptr) msvcrt._utime64 -@ cdecl _vscprintf(str ptr) msvcrt._vscprintf -@ cdecl _vscwprintf(wstr ptr) msvcrt._vscwprintf -@ cdecl _vsnprintf(ptr long str ptr) msvcrt._vsnprintf -@ cdecl _vsnwprintf(ptr long wstr ptr) msvcrt._vsnwprintf -@ cdecl _waccess(wstr long) msvcrt._waccess -@ cdecl _wasctime(ptr) msvcrt._wasctime -@ cdecl _wchdir(wstr) msvcrt._wchdir -@ cdecl _wchmod(wstr long) msvcrt._wchmod -@ extern _wcmdln msvcrt._wcmdln -@ cdecl _wcreat(wstr long) msvcrt._wcreat -@ cdecl _wcsdup(wstr) msvcrt._wcsdup -@ cdecl _wcserror(long) msvcrt._wcserror -@ cdecl _wcsicmp(wstr wstr) msvcrt._wcsicmp -@ cdecl _wcsicoll(wstr wstr) msvcrt._wcsicoll -@ cdecl _wcslwr(wstr) msvcrt._wcslwr -@ cdecl _wcsncoll(wstr wstr long) msvcrt._wcsncoll -@ cdecl _wcsnicmp(wstr wstr long) msvcrt._wcsnicmp -@ cdecl _wcsnicoll(wstr wstr long) msvcrt._wcsnicoll -@ cdecl _wcsnset(wstr long long) msvcrt._wcsnset -@ cdecl _wcsrev(wstr) msvcrt._wcsrev -@ cdecl _wcsset(wstr long) msvcrt._wcsset -@ cdecl -ret64 _wcstoi64(wstr ptr long) msvcrt._wcstoi64 -@ cdecl -ret64 _wcstoui64(wstr ptr long) msvcrt._wcstoui64 -@ cdecl _wcsupr(wstr) msvcrt._wcsupr -@ cdecl _wctime(ptr) msvcrt._wctime -@ cdecl _wctime64(ptr) msvcrt._wctime64 +@ cdecl _unlink(str) MSVCRT__unlink +@ cdecl _unloaddll(long) +@ cdecl _unlock(long) +@ cdecl _utime(str ptr) +@ cdecl _utime64(str ptr) +@ cdecl _vscprintf(str ptr) MSVCRT__vscprintf +@ cdecl _vscwprintf(wstr ptr) MSVCRT__vscwprintf +@ cdecl _vsnprintf(ptr long str ptr) MSVCRT_vsnprintf +@ cdecl _vsnwprintf(ptr long wstr ptr) MSVCRT_vsnwprintf +@ cdecl _waccess(wstr long) MSVCRT__waccess +@ cdecl _wasctime(ptr) MSVCRT__wasctime +@ cdecl _wchdir(wstr) MSVCRT__wchdir +@ cdecl _wchmod(wstr long) MSVCRT__wchmod +@ extern _wcmdln MSVCRT__wcmdln +@ cdecl _wcreat(wstr long) MSVCRT__wcreat +@ cdecl _wcsdup(wstr) MSVCRT__wcsdup +@ cdecl _wcserror(long) MSVCRT__wcserror +@ cdecl _wcsicmp(wstr wstr) MSVCRT__wcsicmp +@ cdecl _wcsicoll(wstr wstr) MSVCRT__wcsicoll +@ cdecl _wcslwr(wstr) ntdll._wcslwr +@ cdecl _wcsncoll(wstr wstr long) MSVCRT__wcsncoll +@ cdecl _wcsnicmp(wstr wstr long) MSVCRT__wcsnicmp +@ cdecl _wcsnicoll(wstr wstr long) MSVCRT__wcsnicoll +@ cdecl _wcsnset(wstr long long) MSVCRT__wcsnset +@ cdecl _wcsrev(wstr) MSVCRT__wcsrev +@ cdecl _wcsset(wstr long) MSVCRT__wcsset +@ cdecl -ret64 _wcstoi64(wstr ptr long) MSVCRT__wcstoi64 +@ cdecl -ret64 _wcstoui64(wstr ptr long) MSVCRT__wcstoui64 +@ cdecl _wcsupr(wstr) ntdll._wcsupr +@ cdecl _wctime(ptr) MSVCRT__wctime +@ cdecl _wctime64(ptr) MSVCRT__wctime64 # extern _wctype -@ extern _wenviron msvcrt._wenviron -@ varargs _wexecl(wstr wstr) msvcrt._wexecl -@ varargs _wexecle(wstr wstr) msvcrt._wexecle -@ varargs _wexeclp(wstr wstr) msvcrt._wexeclp -@ varargs _wexeclpe(wstr wstr) msvcrt._wexeclpe -@ cdecl _wexecv(wstr ptr) msvcrt._wexecv -@ cdecl _wexecve(wstr ptr ptr) msvcrt._wexecve -@ cdecl _wexecvp(wstr ptr) msvcrt._wexecvp -@ cdecl _wexecvpe(wstr ptr ptr) msvcrt._wexecvpe -@ cdecl _wfdopen(long wstr) msvcrt._wfdopen -@ cdecl _wfindfirst(wstr ptr) msvcrt._wfindfirst -@ cdecl _wfindfirst64(wstr ptr) msvcrt._wfindfirst64 -@ cdecl _wfindfirsti64(wstr ptr) msvcrt._wfindfirsti64 -@ cdecl _wfindnext(long ptr) msvcrt._wfindnext -@ cdecl _wfindnext64(long ptr) msvcrt._wfindnext64 -@ cdecl _wfindnexti64(long ptr) msvcrt._wfindnexti64 -@ cdecl _wfopen(wstr wstr) msvcrt._wfopen -@ cdecl _wfreopen(wstr wstr ptr) msvcrt._wfreopen -@ 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 -@ extern _winmajor msvcrt._winmajor -@ extern _winminor msvcrt._winminor -@ extern _winver msvcrt._winver -@ cdecl _wmakepath(ptr wstr wstr wstr wstr) msvcrt._wmakepath -@ cdecl _wmkdir(wstr) msvcrt._wmkdir -@ cdecl _wmktemp(wstr) msvcrt._wmktemp -@ varargs _wopen(wstr long) msvcrt._wopen -@ cdecl _wperror(wstr) msvcrt._wperror -@ extern _wpgmptr msvcrt._wpgmptr -@ cdecl _wpopen(wstr wstr) msvcrt._wpopen -@ cdecl _wputenv(wstr) msvcrt._wputenv -@ 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 _wsetlocale(long wstr) msvcrt._wsetlocale -@ varargs _wsopen(wstr long long) msvcrt._wsopen -@ varargs _wspawnl(long wstr wstr) msvcrt._wspawnl -@ varargs _wspawnle(long wstr wstr) msvcrt._wspawnle -@ varargs _wspawnlp(long wstr wstr) msvcrt._wspawnlp -@ varargs _wspawnlpe(long wstr wstr) msvcrt._wspawnlpe -@ cdecl _wspawnv(long wstr ptr) msvcrt._wspawnv -@ cdecl _wspawnve(long wstr ptr ptr) msvcrt._wspawnve -@ cdecl _wspawnvp(long wstr ptr) msvcrt._wspawnvp -@ cdecl _wspawnvpe(long wstr ptr ptr) msvcrt._wspawnvpe -@ cdecl _wsplitpath(wstr ptr ptr ptr ptr) msvcrt._wsplitpath -@ cdecl _wstat(wstr ptr) msvcrt._wstat -@ cdecl _wstat64(wstr ptr) msvcrt._wstat64 -@ cdecl _wstati64(wstr ptr) msvcrt._wstati64 -@ cdecl _wstrdate(ptr) msvcrt._wstrdate -@ cdecl _wstrtime(ptr) msvcrt._wstrtime -@ cdecl _wsystem(wstr) msvcrt._wsystem -@ cdecl _wtempnam(wstr wstr) msvcrt._wtempnam -@ cdecl _wtmpnam(ptr) msvcrt._wtmpnam -@ cdecl _wtof(wstr) msvcrt._wtof -@ cdecl _wtoi(wstr) msvcrt._wtoi -@ cdecl -ret64 _wtoi64(wstr) msvcrt._wtoi64 -@ cdecl _wtol(wstr) msvcrt._wtol -@ cdecl _wunlink(wstr) msvcrt._wunlink -@ cdecl _wutime(wstr ptr) msvcrt._wutime -@ cdecl _wutime64(wstr ptr) msvcrt._wutime64 -@ 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 asctime(ptr) msvcrt.asctime -@ cdecl asin(double) msvcrt.asin -@ cdecl atan(double) msvcrt.atan -@ cdecl atan2(double double) msvcrt.atan2 -@ cdecl atexit(ptr) msvcrt.atexit -@ cdecl atof(str) msvcrt.atof -@ cdecl atoi(str) msvcr100.atoi #don't forward to msvcrt -@ cdecl atol(str) msvcrt.atol -@ cdecl bsearch(ptr ptr long long ptr) msvcrt.bsearch -@ cdecl calloc(long long) msvcrt.calloc -@ cdecl ceil(double) msvcrt.ceil -@ cdecl clearerr(ptr) msvcrt.clearerr -@ cdecl clock() msvcrt.clock -@ cdecl cos(double) msvcrt.cos -@ cdecl cosh(double) msvcrt.cosh -@ cdecl ctime(ptr) msvcrt.ctime -@ cdecl difftime(long long) msvcrt.difftime -@ cdecl -ret64 div(long long) msvcrt.div -@ cdecl exit(long) msvcrt.exit -@ cdecl exp(double) msvcrt.exp -@ cdecl fabs(double) msvcrt.fabs -@ cdecl fclose(ptr) msvcrt.fclose -@ cdecl feof(ptr) msvcrt.feof -@ cdecl ferror(ptr) msvcrt.ferror -@ 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 fmod(double double) msvcrt.fmod -@ cdecl fopen(str str) msvcrt.fopen -@ varargs fprintf(ptr str) msvcrt.fprintf -@ 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 free(ptr) msvcrt.free -@ cdecl freopen(str str ptr) msvcrt.freopen -@ cdecl frexp(double ptr) msvcrt.frexp -@ varargs fscanf(ptr str) msvcrt.fscanf -@ cdecl fseek(ptr long long) msvcrt.fseek -@ cdecl fsetpos(ptr ptr) msvcrt.fsetpos -@ cdecl ftell(ptr) msvcrt.ftell -@ varargs fwprintf(ptr wstr) msvcrt.fwprintf -@ cdecl fwrite(ptr long long ptr) msvcrt.fwrite -@ varargs fwscanf(ptr wstr) msvcrt.fwscanf -@ cdecl getc(ptr) msvcrt.getc -@ cdecl getchar() msvcrt.getchar -@ cdecl getenv(str) msvcrt.getenv -@ cdecl gets(str) msvcrt.gets -@ cdecl getwc(ptr) msvcrt.getwc -@ cdecl getwchar() msvcrt.getwchar -@ cdecl gmtime(ptr) msvcrt.gmtime -@ cdecl is_wctype(long long) msvcrt.is_wctype -@ cdecl isalnum(long) msvcrt.isalnum -@ cdecl isalpha(long) msvcrt.isalpha -@ 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) msvcrt.iswalpha -@ cdecl iswascii(long) msvcrt.iswascii -@ cdecl iswcntrl(long) msvcrt.iswcntrl -@ cdecl iswctype(long long) msvcrt.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 -@ cdecl localeconv() msvcrt.localeconv -@ cdecl localtime(ptr) msvcrt.localtime -@ cdecl log(double) msvcrt.log -@ cdecl log10(double) msvcrt.log10 -@ cdecl -arch=i386,x86_64,arm longjmp(ptr long) msvcrt.longjmp -@ cdecl malloc(long) msvcrt.malloc -@ cdecl mblen(ptr long) msvcrt.mblen -@ cdecl mbstowcs(ptr str long) msvcrt.mbstowcs -@ 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 memmove(ptr ptr long) msvcrt.memmove -@ cdecl memset(ptr long long) msvcrt.memset -@ cdecl mktime(ptr) msvcrt.mktime -@ cdecl modf(double ptr) msvcrt.modf -@ cdecl perror(str) msvcrt.perror -@ cdecl pow(double double) msvcrt.pow -@ varargs printf(str) msvcrt.printf -@ cdecl putc(long ptr) msvcrt.putc -@ cdecl putchar(long) msvcrt.putchar -@ cdecl puts(str) msvcrt.puts -@ cdecl putwc(long ptr) msvcrt.putwc -@ cdecl putwchar(long) msvcrt.putwchar -@ cdecl qsort(ptr long long ptr) msvcrt.qsort -@ cdecl raise(long) msvcrt.raise -@ cdecl rand() msvcrt.rand -@ cdecl realloc(ptr long) msvcrt.realloc -@ cdecl remove(str) msvcrt.remove -@ cdecl rename(str str) msvcrt.rename -@ cdecl rewind(ptr) msvcrt.rewind -@ varargs scanf(str) msvcrt.scanf -@ cdecl setbuf(ptr ptr) msvcrt.setbuf -@ 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 sinh(double) msvcrt.sinh -@ varargs sprintf(ptr str) msvcrt.sprintf -@ cdecl sqrt(double) msvcrt.sqrt -@ cdecl srand(long) msvcrt.srand -@ varargs sscanf(str str) msvcrt.sscanf -@ cdecl strcat(str str) msvcrt.strcat -@ cdecl strchr(str long) msvcrt.strchr -@ cdecl strcmp(str str) msvcrt.strcmp -@ cdecl strcoll(str str) msvcrt.strcoll -@ cdecl strcpy(ptr str) msvcrt.strcpy -@ cdecl strcspn(str str) msvcrt.strcspn -@ cdecl strerror(long) msvcrt.strerror -@ cdecl strftime(str long str ptr) msvcrt.strftime -@ cdecl strlen(str) msvcrt.strlen -@ cdecl strncat(str str long) msvcrt.strncat -@ cdecl strncmp(str str long) msvcrt.strncmp -@ cdecl strncpy(ptr str long) msvcrt.strncpy -@ cdecl strpbrk(str str) msvcrt.strpbrk -@ cdecl strrchr(str long) msvcrt.strrchr -@ cdecl strspn(str str) msvcrt.strspn -@ cdecl strstr(str str) msvcrt.strstr -@ cdecl strtod(str ptr) msvcrt.strtod -@ cdecl strtok(str str) msvcrt.strtok -@ cdecl strtol(str ptr long) msvcrt.strtol -@ cdecl strtoul(str ptr long) msvcrt.strtoul -@ cdecl strxfrm(ptr str long) msvcrt.strxfrm -@ varargs swprintf(ptr wstr) msvcrt.swprintf -@ varargs swscanf(wstr wstr) msvcrt.swscanf -@ cdecl system(str) msvcrt.system -@ cdecl tan(double) msvcrt.tan -@ cdecl tanh(double) msvcrt.tanh -@ cdecl time(ptr) msvcrt.time -@ cdecl tmpfile() msvcrt.tmpfile -@ cdecl tmpnam(ptr) msvcrt.tmpnam -@ cdecl tolower(long) msvcrt.tolower -@ cdecl toupper(long) msvcrt.toupper -@ cdecl towlower(long) msvcrt.towlower -@ cdecl towupper(long) msvcrt.towupper -@ cdecl ungetc(long ptr) msvcrt.ungetc -@ cdecl ungetwc(long ptr) msvcrt.ungetwc -@ cdecl vfprintf(ptr str ptr) msvcrt.vfprintf -@ cdecl vfwprintf(ptr wstr ptr) msvcrt.vfwprintf -@ cdecl vprintf(str ptr) msvcrt.vprintf -@ cdecl vsprintf(ptr str ptr) msvcrt.vsprintf -@ cdecl vswprintf(ptr wstr ptr) msvcrt.vswprintf -@ cdecl vwprintf(wstr ptr) msvcrt.vwprintf -@ cdecl wcscat(wstr wstr) msvcrt.wcscat -@ cdecl wcschr(wstr long) msvcrt.wcschr -@ cdecl wcscmp(wstr wstr) msvcrt.wcscmp -@ cdecl wcscoll(wstr wstr) msvcrt.wcscoll -@ cdecl wcscpy(ptr wstr) msvcrt.wcscpy -@ cdecl wcscspn(wstr wstr) msvcrt.wcscspn -@ cdecl wcsftime(ptr long wstr ptr) msvcrt.wcsftime -@ cdecl wcslen(wstr) msvcrt.wcslen -@ cdecl wcsncat(wstr wstr long) msvcrt.wcsncat -@ cdecl wcsncmp(wstr wstr long) msvcrt.wcsncmp -@ cdecl wcsncpy(ptr wstr long) msvcrt.wcsncpy -@ cdecl wcspbrk(wstr wstr) msvcrt.wcspbrk -@ cdecl wcsrchr(wstr long) msvcrt.wcsrchr -@ cdecl wcsspn(wstr wstr) msvcrt.wcsspn -@ cdecl wcsstr(wstr wstr) msvcrt.wcsstr -@ cdecl wcstod(wstr ptr) msvcrt.wcstod -@ cdecl wcstok(wstr wstr) msvcrt.wcstok -@ cdecl wcstol(wstr ptr long) msvcrt.wcstol -@ cdecl wcstombs(ptr ptr long) msvcrt.wcstombs -@ cdecl wcstoul(wstr ptr long) msvcrt.wcstoul -@ cdecl wcsxfrm(ptr wstr long) msvcrt.wcsxfrm -@ cdecl wctomb(ptr long) msvcrt.wctomb -@ varargs wprintf(wstr) msvcrt.wprintf -@ varargs wscanf(wstr) msvcrt.wscanf +@ extern _wenviron MSVCRT__wenviron +@ 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 _wfindfirst(wstr ptr) MSVCRT__wfindfirst +@ cdecl _wfindfirst64(wstr ptr) MSVCRT__wfindfirst64 +@ cdecl _wfindfirsti64(wstr ptr) MSVCRT__wfindfirsti64 +@ cdecl _wfindnext(long ptr) MSVCRT__wfindnext +@ cdecl _wfindnext64(long ptr) MSVCRT__wfindnext64 +@ cdecl _wfindnexti64(long ptr) MSVCRT__wfindnexti64 +@ cdecl _wfopen(wstr wstr) MSVCRT__wfopen +@ cdecl _wfreopen(wstr wstr ptr) MSVCRT__wfreopen +@ 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 +@ extern _winmajor MSVCRT__winmajor +@ extern _winminor MSVCRT__winminor +@ extern _winver MSVCRT__winver +@ cdecl _wmakepath(ptr wstr wstr wstr wstr) MSVCRT__wmakepath +@ cdecl _wmkdir(wstr) MSVCRT__wmkdir +@ cdecl _wmktemp(wstr) MSVCRT__wmktemp +@ varargs _wopen(wstr long) MSVCRT__wopen +@ stub _wperror(wstr) +@ extern _wpgmptr MSVCRT__wpgmptr +@ cdecl _wpopen(wstr wstr) MSVCRT__wpopen +@ cdecl _wputenv(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 _wsetlocale(long wstr) MSVCRT__wsetlocale +@ varargs _wsopen(wstr long long) MSVCRT__wsopen +@ 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 _wstat(wstr ptr) MSVCRT__wstat +@ cdecl _wstat64(wstr ptr) MSVCRT__wstat64 +@ cdecl _wstati64(wstr ptr) MSVCRT__wstati64 +@ cdecl _wstrdate(ptr) MSVCRT__wstrdate +@ cdecl _wstrtime(ptr) MSVCRT__wstrtime +@ cdecl _wsystem(wstr) +@ cdecl _wtempnam(wstr wstr) MSVCRT__wtempnam +@ cdecl _wtmpnam(ptr) MSVCRT_wtmpnam +@ cdecl _wtof(wstr) MSVCRT__wtof +@ cdecl _wtoi(wstr) MSVCRT__wtoi +@ cdecl -ret64 _wtoi64(wstr) MSVCRT__wtoi64 +@ cdecl _wtol(wstr) MSVCRT__wtol +@ cdecl _wunlink(wstr) MSVCRT__wunlink +@ cdecl _wutime(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 asctime(ptr) MSVCRT_asctime +@ cdecl asin(double) MSVCRT_asin +@ cdecl atan(double) MSVCRT_atan +@ cdecl atan2(double double) MSVCRT_atan2 +@ cdecl atexit(ptr) MSVCRT_atexit +@ cdecl atof(str) MSVCRT_atof +@ cdecl atoi(str) MSVCRT_atoi +@ cdecl atol(str) ntdll.atol +@ cdecl bsearch(ptr ptr long long ptr) MSVCRT_bsearch +@ cdecl calloc(long long) MSVCRT_calloc +@ cdecl ceil(double) MSVCRT_ceil +@ cdecl clearerr(ptr) MSVCRT_clearerr +@ cdecl clock() MSVCRT_clock +@ cdecl cos(double) MSVCRT_cos +@ cdecl cosh(double) MSVCRT_cosh +@ cdecl ctime(ptr) MSVCRT_ctime +@ cdecl difftime(long long) MSVCRT_difftime +@ cdecl -ret64 div(long long) MSVCRT_div +@ cdecl exit(long) MSVCRT_exit +@ cdecl exp(double) MSVCRT_exp +@ cdecl fabs(double) MSVCRT_fabs +@ cdecl fclose(ptr) MSVCRT_fclose +@ cdecl feof(ptr) MSVCRT_feof +@ cdecl ferror(ptr) MSVCRT_ferror +@ 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 fmod(double double) MSVCRT_fmod +@ cdecl fopen(str str) MSVCRT_fopen +@ varargs fprintf(ptr str) MSVCRT_fprintf +@ 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 free(ptr) MSVCRT_free +@ cdecl freopen(str str ptr) MSVCRT_freopen +@ cdecl frexp(double ptr) MSVCRT_frexp +@ varargs fscanf(ptr str) MSVCRT_fscanf +@ cdecl fseek(ptr long long) MSVCRT_fseek +@ cdecl fsetpos(ptr ptr) MSVCRT_fsetpos +@ cdecl ftell(ptr) MSVCRT_ftell +@ varargs fwprintf(ptr wstr) MSVCRT_fwprintf +@ cdecl fwrite(ptr long long ptr) MSVCRT_fwrite +@ varargs fwscanf(ptr wstr) MSVCRT_fwscanf +@ cdecl getc(ptr) MSVCRT_getc +@ cdecl getchar() MSVCRT_getchar +@ cdecl getenv(str) MSVCRT_getenv +@ cdecl gets(str) MSVCRT_gets +@ cdecl getwc(ptr) MSVCRT_getwc +@ cdecl getwchar() MSVCRT_getwchar +@ cdecl gmtime(ptr) MSVCRT_gmtime +@ cdecl is_wctype(long long) ntdll.iswctype +@ cdecl isalnum(long) MSVCRT_isalnum +@ cdecl isalpha(long) MSVCRT_isalpha +@ 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 +@ 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 +@ cdecl localeconv() MSVCRT_localeconv +@ cdecl localtime(ptr) MSVCRT_localtime +@ cdecl log(double) MSVCRT_log +@ cdecl log10(double) MSVCRT_log10 +@ cdecl -arch=i386,x86_64,arm longjmp(ptr long) MSVCRT_longjmp +@ cdecl malloc(long) MSVCRT_malloc +@ cdecl mblen(ptr long) MSVCRT_mblen +@ cdecl mbstowcs(ptr str long) MSVCRT_mbstowcs +@ 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 memmove(ptr ptr long) MSVCRT_memmove +@ cdecl memset(ptr long long) MSVCRT_memset +@ cdecl mktime(ptr) MSVCRT_mktime +@ cdecl modf(double ptr) MSVCRT_modf +@ cdecl perror(str) MSVCRT_perror +@ cdecl pow(double double) MSVCRT_pow +@ varargs printf(str) MSVCRT_printf +@ 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 raise(long) MSVCRT_raise +@ cdecl rand() MSVCRT_rand +@ cdecl realloc(ptr long) MSVCRT_realloc +@ cdecl remove(str) MSVCRT_remove +@ cdecl rename(str str) MSVCRT_rename +@ cdecl rewind(ptr) MSVCRT_rewind +@ varargs scanf(str) MSVCRT_scanf +@ cdecl setbuf(ptr ptr) MSVCRT_setbuf +@ 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 sinh(double) MSVCRT_sinh +@ varargs sprintf(ptr str) MSVCRT_sprintf +@ cdecl sqrt(double) MSVCRT_sqrt +@ cdecl srand(long) MSVCRT_srand +@ varargs sscanf(str str) MSVCRT_sscanf +@ cdecl strcat(str str) ntdll.strcat +@ 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 strcspn(str str) ntdll.strcspn +@ cdecl strerror(long) MSVCRT_strerror +@ cdecl strftime(str long str ptr) MSVCRT_strftime +@ cdecl strlen(str) MSVCRT_strlen +@ cdecl strncat(str str long) MSVCRT_strncat +@ cdecl strncmp(str str long) MSVCRT_strncmp +@ cdecl strncpy(ptr str long) MSVCRT_strncpy +@ 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 +@ cdecl strtok(str str) MSVCRT_strtok +@ cdecl strtol(str ptr long) MSVCRT_strtol +@ cdecl strtoul(str ptr long) MSVCRT_strtoul +@ cdecl strxfrm(ptr str long) MSVCRT_strxfrm +@ varargs swprintf(ptr wstr) MSVCRT_swprintf +@ varargs swscanf(wstr wstr) MSVCRT_swscanf +@ cdecl system(str) MSVCRT_system +@ cdecl tan(double) MSVCRT_tan +@ cdecl tanh(double) MSVCRT_tanh +@ cdecl time(ptr) MSVCRT_time +@ cdecl tmpfile() MSVCRT_tmpfile +@ cdecl tmpnam(ptr) MSVCRT_tmpnam +@ cdecl tolower(long) MSVCRT_tolower +@ cdecl toupper(long) MSVCRT_toupper +@ cdecl towlower(long) MSVCRT_towlower +@ cdecl towupper(long) MSVCRT_towupper +@ cdecl ungetc(long ptr) MSVCRT_ungetc +@ cdecl ungetwc(long ptr) MSVCRT_ungetwc +@ cdecl vfprintf(ptr str ptr) MSVCRT_vfprintf +@ cdecl vfwprintf(ptr wstr ptr) MSVCRT_vfwprintf +@ cdecl vprintf(str ptr) MSVCRT_vprintf +@ cdecl vsprintf(ptr str ptr) MSVCRT_vsprintf +@ cdecl vswprintf(ptr wstr ptr) MSVCRT_vswprintf +@ cdecl vwprintf(wstr ptr) MSVCRT_vwprintf +@ cdecl wcscat(wstr wstr) ntdll.wcscat +@ 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 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 wcsncmp(wstr wstr long) MSVCRT_wcsncmp +@ cdecl wcsncpy(ptr wstr long) MSVCRT_wcsncpy +@ cdecl wcspbrk(wstr wstr) MSVCRT_wcspbrk +@ cdecl wcsrchr(wstr long) ntdll.wcsrchr +@ cdecl wcsspn(wstr wstr) ntdll.wcsspn +@ cdecl wcsstr(wstr wstr) MSVCRT_wcsstr +@ cdecl wcstod(wstr ptr) MSVCRT_wcstod +@ cdecl wcstok(wstr wstr) MSVCRT_wcstok +@ cdecl wcstol(wstr ptr long) ntdll.wcstol +@ cdecl wcstombs(ptr ptr long) MSVCRT_wcstombs +@ cdecl wcstoul(wstr ptr long) MSVCRT_wcstoul +@ stub wcsxfrm(ptr wstr long) +@ cdecl wctomb(ptr long) MSVCRT_wctomb +@ varargs wprintf(wstr) MSVCRT_wprintf +@ varargs wscanf(wstr) MSVCRT_wscanf diff -Nru wine1.7-1.7.14/dlls/msvcr80/Makefile.in wine1.7-1.7.18/dlls/msvcr80/Makefile.in --- wine1.7-1.7.14/dlls/msvcr80/Makefile.in 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msvcr80/Makefile.in 2014-05-02 18:15:48.000000000 +0000 @@ -1,8 +1,36 @@ +EXTRADEFS = -D_MT -D_MSVCR_VER=80 MODULE = msvcr80.dll IMPORTLIB = msvcr80 -IMPORTS = msvcrt +DELAYIMPORTS = advapi32 user32 +PARENTSRC = ../msvcrt C_SRCS = \ - msvcr80.c + 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 RC_SRCS = msvcr80.rc diff -Nru wine1.7-1.7.14/dlls/msvcr80/msvcr80.c wine1.7-1.7.18/dlls/msvcr80/msvcr80.c --- wine1.7-1.7.14/dlls/msvcr80/msvcr80.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msvcr80/msvcr80.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,201 +0,0 @@ -/* - * msvcr80 specific functions - * - * Copyright 2010 Detlef Riekenberg - * - * 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 "stdio.h" -#include "windef.h" -#include "winbase.h" - -#if defined(__i386__) && !defined(__arm__) - -#define THISCALL(func) __thiscall_ ## func -#define __thiscall __stdcall -#define DEFINE_THISCALL_WRAPPER(func,args) \ - extern void THISCALL(func)(void); \ - __ASM_GLOBAL_FUNC(__thiscall_ ## func, \ - "popl %eax\n\t" \ - "pushl %ecx\n\t" \ - "pushl %eax\n\t" \ - "jmp " __ASM_NAME(#func) __ASM_STDCALL(args) ) - -extern void *call_thiscall_func; -__ASM_GLOBAL_FUNC(call_thiscall_func, - "popl %eax\n\t" - "popl %edx\n\t" - "popl %ecx\n\t" - "pushl %eax\n\t" - "jmp *%edx\n\t") - -#define call_func1(func,this) ((void* (WINAPI*)(void*,void*))&call_thiscall_func)(func,this) -#define call_func2(func,this,a) ((void* (WINAPI*)(void*,void*,const void*))&call_thiscall_func)(func,this,(const void*)(a)) -#define call_func3(func,this,a,b) ((void* (WINAPI*)(void*,void*,const void*,const void*))&call_thiscall_func)(func,this,(const void*)(a),(const void*)(b)) - -#else /* __i386__ */ - -#define __thiscall __cdecl -#define DEFINE_THISCALL_WRAPPER(func,args) /* nothing */ - -#define call_func1(func,this) func(this) -#define call_func2(func,this,a) func(this,a) -#define call_func3(func,this,a,b) func(this,a,b) - -#endif /* __i386__ */ - -static void* (__thiscall *MSVCRT_exception_ctor)(void*, const char**); -static void* (__thiscall *MSVCRT_exception_ctor_noalloc)(void*, char**, int); -static void* (__thiscall *MSVCRT_exception_copy_ctor)(void*, const void*); -static void* (__thiscall *MSVCRT_exception_default_ctor)(void*); -static void (__thiscall *MSVCRT_exception_dtor)(void*); -static int (__thiscall *MSVCRT_type_info_opequals_equals)(void*, const void*); -static int (__thiscall *MSVCRT_type_info_opnot_equals)(void*, const void*); -static const char* (__thiscall *MSVCR100_type_info_name_internal_method)(void*, void*); - -static void init_cxx_funcs(void) -{ - HMODULE hmsvcrt = GetModuleHandleA("msvcrt.dll"); - HMODULE hmsvcr100 = GetModuleHandleA("msvcr100.dll"); - - if (sizeof(void *) > sizeof(int)) /* 64-bit has different names */ - { - MSVCRT_exception_ctor = (void*)GetProcAddress(hmsvcrt, "??0exception@@QEAA@AEBQEBD@Z"); - MSVCRT_exception_ctor_noalloc = (void*)GetProcAddress(hmsvcrt, "??0exception@@QEAA@AEBQEBDH@Z"); - MSVCRT_exception_copy_ctor = (void*)GetProcAddress(hmsvcrt, "??0exception@@QEAA@AEBV0@@Z"); - MSVCRT_exception_default_ctor = (void*)GetProcAddress(hmsvcrt, "??0exception@@QEAA@XZ"); - MSVCRT_exception_dtor = (void*)GetProcAddress(hmsvcrt, "??1exception@@UEAA@XZ"); - MSVCRT_type_info_opequals_equals = (void*)GetProcAddress(hmsvcrt, "??8type_info@@QEBAHAEBV0@@Z"); - MSVCRT_type_info_opnot_equals = (void*)GetProcAddress(hmsvcrt, "??9type_info@@QEBAHAEBV0@@Z"); - MSVCR100_type_info_name_internal_method = (void*)GetProcAddress(hmsvcr100, - "?_name_internal_method@type_info@@QEBAPEBDPEAU__type_info_node@@@Z"); - } - else - { -#ifdef __arm__ - MSVCRT_type_info_opequals_equals = (void*)GetProcAddress(hmsvcrt, "??8type_info@@QBA_NABV0@@Z"); - MSVCRT_type_info_opnot_equals = (void*)GetProcAddress(hmsvcrt, "??9type_info@@QBA_NABV0@@Z"); - MSVCR100_type_info_name_internal_method = (void*)GetProcAddress(hmsvcr100, - "?_name_internal_method@type_info@@QBAPBDPAU__type_info_node@@@Z"); -#else - MSVCRT_exception_ctor = (void*)GetProcAddress(hmsvcrt, "??0exception@@QEAA@AEBQEBD@Z"); - MSVCRT_exception_ctor_noalloc = (void*)GetProcAddress(hmsvcrt, "??0exception@@QAE@ABQBDH@Z"); - MSVCRT_exception_copy_ctor = (void*)GetProcAddress(hmsvcrt, "??0exception@@QAE@ABV0@@Z"); - MSVCRT_exception_default_ctor = (void*)GetProcAddress(hmsvcrt, "??0exception@@QAE@XZ"); - MSVCRT_exception_dtor = (void*)GetProcAddress(hmsvcrt, "??1exception@@UAE@XZ"); - MSVCRT_type_info_opequals_equals = (void*)GetProcAddress(hmsvcrt, "??8type_info@@QBEHABV0@@Z"); - MSVCRT_type_info_opnot_equals = (void*)GetProcAddress(hmsvcrt, "??9type_info@@QBEHABV0@@Z"); - MSVCR100_type_info_name_internal_method = (void*)GetProcAddress(hmsvcr100, - "?_name_internal_method@type_info@@QBEPBDPAU__type_info_node@@@Z"); -#endif - } -} - -BOOL WINAPI DllMain(HINSTANCE hdll, DWORD reason, LPVOID reserved) -{ - switch (reason) - { - case DLL_WINE_PREATTACH: - return FALSE; /* prefer native version */ - - case DLL_PROCESS_ATTACH: - DisableThreadLibraryCalls(hdll); - init_cxx_funcs(); - _set_printf_count_output(0); - } - return TRUE; -} - -void * CDECL MSVCR80__decode_pointer(void * ptr) -{ - return DecodePointer(ptr); -} - -void * CDECL MSVCR80__encode_pointer(void * ptr) -{ - return EncodePointer(ptr); -} - -/* ??0exception@std@@QAE@ABQBD@Z */ -/* ??0exception@std@@QEAA@AEBQEBD@Z */ -DEFINE_THISCALL_WRAPPER(exception_ctor, 8) -void* __thiscall exception_ctor(void *this, const char **name) -{ - return call_func2(MSVCRT_exception_ctor, this, name); -} - -/* ??0exception@std@@QAE@ABQBDH@Z */ -/* ??0exception@std@@QEAA@AEBQEBDH@Z */ -DEFINE_THISCALL_WRAPPER(exception_ctor_noalloc, 12) -void* __thiscall exception_ctor_noalloc(void *this, char **name, int noalloc) -{ - return call_func3(MSVCRT_exception_ctor_noalloc, this, name, noalloc); -} - -/* ??0exception@std@@QAE@ABV01@@Z */ -/* ??0exception@std@@QEAA@AEBV01@@Z */ -DEFINE_THISCALL_WRAPPER(exception_copy_ctor, 8) -void* __thiscall exception_copy_ctor(void *this, const void *rhs) -{ - return call_func2(MSVCRT_exception_copy_ctor, this, rhs); -} - -/* ??0exception@std@@QAE@XZ */ -/* ??0exception@std@@QEAA@XZ */ -DEFINE_THISCALL_WRAPPER(exception_default_ctor, 4) -void* __thiscall exception_default_ctor(void *this) -{ - return call_func1(MSVCRT_exception_default_ctor, this); -} - -/* ??1exception@std@@UAE@XZ */ -/* ??1exception@std@@UEAA@XZ */ -DEFINE_THISCALL_WRAPPER(exception_dtor, 4) -void __thiscall exception_dtor(void *this) -{ - call_func1(MSVCRT_exception_dtor, this); -} - -/* ??8type_info@@QBA_NABV0@@Z */ -/* ??8type_info@@QBE_NABV0@@Z */ -/* ??8type_info@@QEBA_NAEBV0@@Z */ -DEFINE_THISCALL_WRAPPER(type_info_op_equals, 8) -int __thiscall type_info_op_equals(void *this, const void *rhs) -{ - return (int)call_func2(MSVCRT_type_info_opequals_equals, this, rhs); -} - -/* ??9type_info@@QBA_NABV0@@Z */ -/* ??9type_info@@QBE_NABV0@@Z */ -/* ??9type_info@@QEBA_NAEBV0@@Z */ -DEFINE_THISCALL_WRAPPER(type_info_opnot_equals, 8) -int __thiscall type_info_opnot_equals(void *this, const void *rhs) -{ - return (int)call_func2(MSVCRT_type_info_opnot_equals, this, rhs); -} - -/* ?_name_internal_method@type_info@@QBAPBDPAU__type_info_node@@@Z */ -/* ?_name_internal_method@type_info@@QBEPBDPAU__type_info_node@@@Z */ -/* ?_name_internal_method@type_info@@QEBAPEBDPEAU__type_info_node@@@Z */ -DEFINE_THISCALL_WRAPPER(type_info_name_internal_method,8) -const char* __thiscall type_info_name_internal_method(void *this, void *node) -{ - return call_func2(MSVCR100_type_info_name_internal_method, this, node); -} diff -Nru wine1.7-1.7.14/dlls/msvcr80/msvcr80.spec wine1.7-1.7.18/dlls/msvcr80/msvcr80.spec --- wine1.7-1.7.14/dlls/msvcr80/msvcr80.spec 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msvcr80/msvcr80.spec 2014-05-02 18:15:48.000000000 +0000 @@ -1,71 +1,71 @@ # MS VC++2005 runtime library -@ thiscall -arch=i386 ??0__non_rtti_object@std@@QAE@ABV01@@Z(ptr ptr) msvcrt.??0__non_rtti_object@@QAE@ABV0@@Z -@ cdecl -arch=win64 ??0__non_rtti_object@std@@QEAA@AEBV01@@Z(ptr ptr) msvcrt.??0__non_rtti_object@@QEAA@AEBV0@@Z -@ cdecl -arch=win64 ??0__non_rtti_object@std@@QEAA@PEBD@Z(ptr ptr) msvcrt.??0__non_rtti_object@@QEAA@PEBD@Z -@ cdecl -arch=win64 ??0bad_cast@std@@AEAA@PEBQEBD@Z(ptr ptr) msvcrt.??0bad_cast@@AEAA@PEBQEBD@Z -@ thiscall -arch=i386 ??0bad_cast@std@@QAE@ABV01@@Z(ptr ptr) msvcrt.??0bad_cast@@QAE@ABV0@@Z -@ cdecl -arch=win64 ??0bad_cast@std@@QEAA@AEBV01@@Z(ptr ptr) msvcrt.??0bad_cast@@QEAA@AEBV0@@Z -@ thiscall -arch=i386 ??0bad_cast@std@@QAE@PBD@Z(ptr str) msvcrt.??0bad_cast@@QAE@PBD@Z -@ cdecl -arch=win64 ??0bad_cast@std@@QEAA@PEBD@Z(ptr str) msvcrt.??0bad_cast@@QEAA@PEBD@Z -@ thiscall -arch=i386 ??0bad_typeid@std@@QAE@ABV01@@Z(ptr ptr) msvcrt.??0bad_typeid@@QAE@ABV0@@Z -@ cdecl -arch=win64 ??0bad_typeid@std@@QEAA@AEBV01@@Z(ptr ptr) msvcrt.??0bad_typeid@@QEAA@AEBV0@@Z -@ thiscall -arch=i386 ??0bad_typeid@std@@QAE@PBD@Z(ptr str) msvcrt.??0bad_typeid@@QAE@PBD@Z -@ cdecl -arch=win64 ??0bad_typeid@std@@QEAA@PEBD@Z(ptr str) msvcrt.??0bad_typeid@@QEAA@PEBD@Z -@ thiscall -arch=i386 ??0exception@std@@QAE@ABQBD@Z(ptr ptr) exception_ctor -@ cdecl -arch=win64 ??0exception@std@@QEAA@AEBQEBD@Z(ptr ptr) exception_ctor -@ thiscall -arch=i386 ??0exception@std@@QAE@ABQBDH@Z(ptr ptr long) exception_ctor_noalloc -@ cdecl -arch=win64 ??0exception@std@@QEAA@AEBQEBDH@Z(ptr ptr long) exception_ctor_noalloc -@ thiscall -arch=i386 ??0exception@std@@QAE@ABV01@@Z(ptr ptr) exception_copy_ctor -@ cdecl -arch=win64 ??0exception@std@@QEAA@AEBV01@@Z(ptr ptr) exception_copy_ctor -@ thiscall -arch=i386 ??0exception@std@@QAE@XZ(ptr) exception_default_ctor -@ cdecl -arch=win64 ??0exception@std@@QEAA@XZ(ptr) exception_default_ctor -@ thiscall -arch=i386 ??1__non_rtti_object@std@@UAE@XZ(ptr) msvcrt.??1__non_rtti_object@@UAE@XZ -@ cdecl -arch=win64 ??1__non_rtti_object@std@@UEAA@XZ(ptr) msvcrt.??1__non_rtti_object@@UEAA@XZ -@ thiscall -arch=i386 ??1bad_cast@std@@UAE@XZ(ptr) msvcrt.??1bad_cast@@UAE@XZ -@ cdecl -arch=win64 ??1bad_cast@std@@UEAA@XZ(ptr) msvcrt.??1bad_cast@@UEAA@XZ -@ thiscall -arch=i386 ??1bad_typeid@std@@UAE@XZ(ptr) msvcrt.??1bad_typeid@@UAE@XZ -@ cdecl -arch=win64 ??1bad_typeid@std@@UEAA@XZ(ptr) msvcrt.??1bad_typeid@@UEAA@XZ -@ thiscall -arch=i386 ??1exception@std@@UAE@XZ(ptr) exception_dtor -@ cdecl -arch=win64 ??1exception@std@@UEAA@XZ(ptr) exception_dtor -@ cdecl -arch=arm ??1type_info@@UAA@XZ(ptr) msvcrt.??1type_info@@UAA@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 -@ cdecl -arch=win64 ??2@YAPEAX_K@Z(long) msvcrt.??2@YAPEAX_K@Z -@ cdecl -arch=win32 ??2@YAPAXIHPBDH@Z(long long str long) msvcrt.??2@YAPAXIHPBDH@Z -@ cdecl -arch=win64 ??2@YAPEAX_KHPEBDH@Z(long long str long) msvcrt.??2@YAPEAX_KHPEBDH@Z -@ cdecl -arch=win32 ??3@YAXPAX@Z(ptr) msvcrt.??3@YAXPAX@Z -@ cdecl -arch=win64 ??3@YAXPEAX@Z(ptr) msvcrt.??3@YAXPEAX@Z -@ thiscall -arch=i386 ??4__non_rtti_object@std@@QAEAAV01@ABV01@@Z(ptr ptr) msvcrt.??4__non_rtti_object@@QAEAAV0@ABV0@@Z -@ cdecl -arch=win64 ??4__non_rtti_object@std@@QEAAAEAV01@AEBV01@@Z(ptr ptr) msvcrt.??4__non_rtti_object@@QEAAAEAV0@AEBV0@@Z -@ thiscall -arch=i386 ??4bad_cast@std@@QAEAAV01@ABV01@@Z(ptr ptr) msvcrt.??4bad_cast@@QAEAAV0@ABV0@@Z -@ cdecl -arch=win64 ??4bad_cast@std@@QEAAAEAV01@AEBV01@@Z(ptr ptr) msvcrt.??4bad_cast@@QEAAAEAV0@AEBV0@@Z -@ thiscall -arch=i386 ??4bad_typeid@std@@QAEAAV01@ABV01@@Z(ptr ptr) msvcrt.??4bad_typeid@@QAEAAV0@ABV0@@Z -@ cdecl -arch=win64 ??4bad_typeid@std@@QEAAAEAV01@AEBV01@@Z(ptr ptr) msvcrt.??4bad_typeid@@QEAAAEAV0@AEBV0@@Z -@ thiscall -arch=i386 ??4exception@std@@QAEAAV01@ABV01@@Z(ptr ptr) msvcrt.??4exception@@QAEAAV0@ABV0@@Z -@ cdecl -arch=win64 ??4exception@std@@QEAAAEAV01@AEBV01@@Z(ptr ptr) msvcrt.??4exception@@QEAAAEAV0@AEBV0@@Z -@ cdecl -arch=arm ??8type_info@@QBA_NABV0@@Z(ptr ptr) type_info_op_equals -@ thiscall -arch=i386 ??8type_info@@QBE_NABV0@@Z(ptr ptr) type_info_op_equals -@ cdecl -arch=win64 ??8type_info@@QEBA_NAEBV0@@Z(ptr ptr) type_info_op_equals -@ cdecl -arch=arm ??9type_info@@QBA_NABV0@@Z(ptr ptr) type_info_opnot_equals -@ thiscall -arch=i386 ??9type_info@@QBE_NABV0@@Z(ptr ptr) type_info_opnot_equals -@ cdecl -arch=win64 ??9type_info@@QEBA_NAEBV0@@Z(ptr ptr) type_info_opnot_equals -@ extern ??_7__non_rtti_object@std@@6B@ msvcrt.??_7__non_rtti_object@@6B@ -@ extern ??_7bad_cast@std@@6B@ msvcrt.??_7bad_cast@@6B@ -@ extern ??_7bad_typeid@std@@6B@ msvcrt.??_7bad_typeid@@6B@ -@ extern ??_7exception@@6B@ msvcrt.??_7exception@@6B@ -@ extern ??_7exception@std@@6B@ msvcrt.??_7exception@@6B@ -@ thiscall -arch=i386 ??_Fbad_cast@std@@QAEXXZ(ptr) msvcrt.??_Fbad_cast@@QAEXXZ -@ cdecl -arch=win64 ??_Fbad_cast@std@@QEAAXXZ(ptr) msvcrt.??_Fbad_cast@@QEAAXXZ -@ thiscall -arch=i386 ??_Fbad_typeid@std@@QAEXXZ(ptr) msvcrt.??_Fbad_typeid@@QAEXXZ -@ cdecl -arch=win64 ??_Fbad_typeid@std@@QEAAXXZ(ptr) msvcrt.??_Fbad_typeid@@QEAAXXZ -@ cdecl -arch=win32 ??_U@YAPAXI@Z(long) msvcrt.??_U@YAPAXI@Z -@ cdecl -arch=win64 ??_U@YAPEAX_K@Z(long) msvcrt.??_U@YAPEAX_K@Z -@ cdecl -arch=win32 ??_U@YAPAXIHPBDH@Z(long long str long) msvcrt.??_U@YAPAXIHPBDH@Z -@ cdecl -arch=win64 ??_U@YAPEAX_KHPEBDH@Z(long long str long) msvcrt.??_U@YAPEAX_KHPEBDH@Z -@ cdecl -arch=win32 ??_V@YAXPAX@Z(ptr) msvcrt.??_V@YAXPAX@Z -@ cdecl -arch=win64 ??_V@YAXPEAX@Z(ptr) msvcrt.??_V@YAXPEAX@Z +@ thiscall -arch=i386 ??0__non_rtti_object@std@@QAE@ABV01@@Z(ptr ptr) MSVCRT___non_rtti_object_copy_ctor +@ cdecl -arch=win64 ??0__non_rtti_object@std@@QEAA@AEBV01@@Z(ptr ptr) MSVCRT___non_rtti_object_copy_ctor +@ cdecl -arch=win64 ??0__non_rtti_object@std@@QEAA@PEBD@Z(ptr ptr) MSVCRT___non_rtti_object_ctor +@ cdecl -arch=win64 ??0bad_cast@std@@AEAA@PEBQEBD@Z(ptr ptr) MSVCRT_bad_cast_ctor +@ thiscall -arch=i386 ??0bad_cast@std@@QAE@ABV01@@Z(ptr ptr) MSVCRT_bad_cast_copy_ctor +@ cdecl -arch=win64 ??0bad_cast@std@@QEAA@AEBV01@@Z(ptr ptr) MSVCRT_bad_cast_copy_ctor +@ thiscall -arch=i386 ??0bad_cast@std@@QAE@PBD@Z(ptr str) MSVCRT_bad_cast_ctor_charptr +@ cdecl -arch=win64 ??0bad_cast@std@@QEAA@PEBD@Z(ptr str) MSVCRT_bad_cast_ctor_charptr +@ thiscall -arch=i386 ??0bad_typeid@std@@QAE@ABV01@@Z(ptr ptr) MSVCRT_bad_typeid_copy_ctor +@ cdecl -arch=win64 ??0bad_typeid@std@@QEAA@AEBV01@@Z(ptr ptr) MSVCRT_bad_typeid_copy_ctor +@ thiscall -arch=i386 ??0bad_typeid@std@@QAE@PBD@Z(ptr str) MSVCRT_bad_typeid_ctor +@ cdecl -arch=win64 ??0bad_typeid@std@@QEAA@PEBD@Z(ptr str) MSVCRT_bad_typeid_ctor +@ thiscall -arch=i386 ??0exception@std@@QAE@ABQBD@Z(ptr ptr) MSVCRT_exception_ctor +@ cdecl -arch=win64 ??0exception@std@@QEAA@AEBQEBD@Z(ptr ptr) MSVCRT_exception_ctor +@ thiscall -arch=i386 ??0exception@std@@QAE@ABQBDH@Z(ptr ptr long) MSVCRT_exception_ctor_noalloc +@ cdecl -arch=win64 ??0exception@std@@QEAA@AEBQEBDH@Z(ptr ptr long) MSVCRT_exception_ctor_noalloc +@ thiscall -arch=i386 ??0exception@std@@QAE@ABV01@@Z(ptr ptr) MSVCRT_exception_copy_ctor +@ cdecl -arch=win64 ??0exception@std@@QEAA@AEBV01@@Z(ptr ptr) MSVCRT_exception_copy_ctor +@ thiscall -arch=i386 ??0exception@std@@QAE@XZ(ptr) MSVCRT_exception_default_ctor +@ cdecl -arch=win64 ??0exception@std@@QEAA@XZ(ptr) MSVCRT_exception_default_ctor +@ thiscall -arch=i386 ??1__non_rtti_object@std@@UAE@XZ(ptr) MSVCRT___non_rtti_object_dtor +@ cdecl -arch=win64 ??1__non_rtti_object@std@@UEAA@XZ(ptr) MSVCRT___non_rtti_object_dtor +@ thiscall -arch=i386 ??1bad_cast@std@@UAE@XZ(ptr) MSVCRT_bad_cast_dtor +@ cdecl -arch=win64 ??1bad_cast@std@@UEAA@XZ(ptr) MSVCRT_bad_cast_dtor +@ thiscall -arch=i386 ??1bad_typeid@std@@UAE@XZ(ptr) MSVCRT_bad_typeid_dtor +@ cdecl -arch=win64 ??1bad_typeid@std@@UEAA@XZ(ptr) MSVCRT_bad_typeid_dtor +@ thiscall -arch=i386 ??1exception@std@@UAE@XZ(ptr) MSVCRT_exception_dtor +@ cdecl -arch=win64 ??1exception@std@@UEAA@XZ(ptr) MSVCRT_exception_dtor +@ cdecl -arch=arm ??1type_info@@UAA@XZ(ptr) MSVCRT_type_info_dtor +@ thiscall -arch=i386 ??1type_info@@UAE@XZ(ptr) MSVCRT_type_info_dtor +@ cdecl -arch=win64 ??1type_info@@UEAA@XZ(ptr) MSVCRT_type_info_dtor +@ cdecl -arch=win32 ??2@YAPAXI@Z(long) MSVCRT_operator_new +@ cdecl -arch=win64 ??2@YAPEAX_K@Z(long) MSVCRT_operator_new +@ cdecl -arch=win32 ??2@YAPAXIHPBDH@Z(long long str long) MSVCRT_operator_new_dbg +@ cdecl -arch=win64 ??2@YAPEAX_KHPEBDH@Z(long long str long) MSVCRT_operator_new_dbg +@ cdecl -arch=win32 ??3@YAXPAX@Z(ptr) MSVCRT_operator_delete +@ cdecl -arch=win64 ??3@YAXPEAX@Z(ptr) MSVCRT_operator_delete +@ thiscall -arch=i386 ??4__non_rtti_object@std@@QAEAAV01@ABV01@@Z(ptr ptr) MSVCRT___non_rtti_object_opequals +@ cdecl -arch=win64 ??4__non_rtti_object@std@@QEAAAEAV01@AEBV01@@Z(ptr ptr) MSVCRT___non_rtti_object_opequals +@ thiscall -arch=i386 ??4bad_cast@std@@QAEAAV01@ABV01@@Z(ptr ptr) MSVCRT_bad_cast_opequals +@ cdecl -arch=win64 ??4bad_cast@std@@QEAAAEAV01@AEBV01@@Z(ptr ptr) MSVCRT_bad_cast_opequals +@ thiscall -arch=i386 ??4bad_typeid@std@@QAEAAV01@ABV01@@Z(ptr ptr) MSVCRT_bad_typeid_opequals +@ cdecl -arch=win64 ??4bad_typeid@std@@QEAAAEAV01@AEBV01@@Z(ptr ptr) MSVCRT_bad_typeid_opequals +@ thiscall -arch=i386 ??4exception@std@@QAEAAV01@ABV01@@Z(ptr ptr) MSVCRT_exception_opequals +@ cdecl -arch=win64 ??4exception@std@@QEAAAEAV01@AEBV01@@Z(ptr ptr) MSVCRT_exception_opequals +@ cdecl -arch=arm ??8type_info@@QBA_NABV0@@Z(ptr ptr) MSVCRT_type_info_opequals_equals +@ thiscall -arch=i386 ??8type_info@@QBE_NABV0@@Z(ptr ptr) MSVCRT_type_info_opequals_equals +@ cdecl -arch=win64 ??8type_info@@QEBA_NAEBV0@@Z(ptr ptr) MSVCRT_type_info_opequals_equals +@ cdecl -arch=arm ??9type_info@@QBA_NABV0@@Z(ptr ptr) MSVCRT_type_info_opnot_equals +@ thiscall -arch=i386 ??9type_info@@QBE_NABV0@@Z(ptr ptr) MSVCRT_type_info_opnot_equals +@ cdecl -arch=win64 ??9type_info@@QEBA_NAEBV0@@Z(ptr ptr) MSVCRT_type_info_opnot_equals +@ extern ??_7__non_rtti_object@std@@6B@ MSVCRT___non_rtti_object_vtable +@ extern ??_7bad_cast@std@@6B@ MSVCRT_bad_cast_vtable +@ extern ??_7bad_typeid@std@@6B@ MSVCRT_bad_typeid_vtable +@ extern ??_7exception@@6B@ MSVCRT_exception_vtable +@ extern ??_7exception@std@@6B@ MSVCRT_exception_vtable +@ thiscall -arch=i386 ??_Fbad_cast@std@@QAEXXZ(ptr) MSVCRT_bad_cast_default_ctor +@ cdecl -arch=win64 ??_Fbad_cast@std@@QEAAXXZ(ptr) MSVCRT_bad_cast_default_ctor +@ thiscall -arch=i386 ??_Fbad_typeid@std@@QAEXXZ(ptr) MSVCRT_bad_typeid_default_ctor +@ cdecl -arch=win64 ??_Fbad_typeid@std@@QEAAXXZ(ptr) MSVCRT_bad_typeid_default_ctor +@ cdecl -arch=win32 ??_U@YAPAXI@Z(long) MSVCRT_operator_new +@ cdecl -arch=win64 ??_U@YAPEAX_K@Z(long) MSVCRT_operator_new +@ cdecl -arch=win32 ??_U@YAPAXIHPBDH@Z(long long str long) MSVCRT_operator_new_dbg +@ cdecl -arch=win64 ??_U@YAPEAX_KHPEBDH@Z(long long str long) MSVCRT_operator_new_dbg +@ cdecl -arch=win32 ??_V@YAXPAX@Z(ptr) MSVCRT_operator_delete +@ cdecl -arch=win64 ??_V@YAXPEAX@Z(ptr) MSVCRT_operator_delete @ stub -arch=win32 ?_Name_base@type_info@@CAPBDPBV1@PAU__type_info_node@@@Z # private: static char const * __cdecl type_info::_Name_base(class type_info const *,struct __type_info_node *) @ stub -arch=win64 ?_Name_base@type_info@@CAPEBDPEBV1@PEAU__type_info_node@@@Z # private: static char const * __ptr64 __cdecl type_info::_Name_base(class type_info const * __ptr64,struct __type_info_node * __ptr64) @ stub -arch=win32 ?_Name_base_internal@type_info@@CAPBDPBV1@PAU__type_info_node@@@Z # private: static char const * __cdecl type_info::_Name_base_internal(class type_info const *,struct __type_info_node *) @@ -80,88 +80,88 @@ @ stub -arch=win64 ?_ValidateRead@@YAHPEBXI@Z # int __cdecl _ValidateRead(void const * __ptr64,unsigned int) @ stub -arch=win32 ?_ValidateWrite@@YAHPAXI@Z # int __cdecl _ValidateWrite(void *,unsigned int) @ stub -arch=win64 ?_ValidateWrite@@YAHPEAXI@Z # int __cdecl _ValidateWrite(void * __ptr64,unsigned int) -@ cdecl __uncaught_exception() msvcrt.__uncaught_exception +@ cdecl __uncaught_exception() MSVCRT___uncaught_exception @ stub ?_inconsistency@@YAXXZ -@ cdecl -arch=win32 ?_invalid_parameter@@YAXPBG00II@Z(wstr wstr wstr long long) msvcrt._invalid_parameter -@ cdecl -arch=win64 ?_invalid_parameter@@YAXPEBG00I_K@Z(wstr wstr wstr long long) msvcrt._invalid_parameter -@ cdecl -arch=win32 ?_is_exception_typeof@@YAHABVtype_info@@PAU_EXCEPTION_POINTERS@@@Z(ptr ptr) msvcrt._is_exception_typeof -@ cdecl -arch=win64 ?_is_exception_typeof@@YAHAEBVtype_info@@PEAU_EXCEPTION_POINTERS@@@Z(ptr ptr) msvcrt._is_exception_typeof +@ cdecl -arch=win32 ?_invalid_parameter@@YAXPBG00II@Z(wstr wstr wstr long long) MSVCRT__invalid_parameter +@ cdecl -arch=win64 ?_invalid_parameter@@YAXPEBG00I_K@Z(wstr wstr wstr long long) MSVCRT__invalid_parameter +@ cdecl -arch=win32 ?_is_exception_typeof@@YAHABVtype_info@@PAU_EXCEPTION_POINTERS@@@Z(ptr ptr) _is_exception_typeof +@ cdecl -arch=win64 ?_is_exception_typeof@@YAHAEBVtype_info@@PEAU_EXCEPTION_POINTERS@@@Z(ptr ptr) _is_exception_typeof @ cdecl -arch=arm ?_name_internal_method@type_info@@QBAPBDPAU__type_info_node@@@Z(ptr ptr) type_info_name_internal_method @ thiscall -arch=i386 ?_name_internal_method@type_info@@QBEPBDPAU__type_info_node@@@Z(ptr ptr) type_info_name_internal_method @ cdecl -arch=win64 ?_name_internal_method@type_info@@QEBAPEBDPEAU__type_info_node@@@Z(ptr ptr) type_info_name_internal_method -@ varargs -arch=win32 ?_open@@YAHPBDHH@Z(str long) msvcrt._open -@ varargs -arch=win64 ?_open@@YAHPEBDHH@Z(str long) msvcrt._open -@ 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 +@ varargs -arch=win32 ?_open@@YAHPBDHH@Z(str long) MSVCRT__open +@ varargs -arch=win64 ?_open@@YAHPEBDHH@Z(str long) MSVCRT__open +@ cdecl -arch=win32 ?_query_new_handler@@YAP6AHI@ZXZ() MSVCRT__query_new_handler +@ cdecl -arch=win64 ?_query_new_handler@@YAP6AH_K@ZXZ() MSVCRT__query_new_handler +@ cdecl ?_query_new_mode@@YAHXZ() MSVCRT__query_new_mode @ stub -arch=win32 ?_set_new_handler@@YAP6AHI@ZH@Z # int (__cdecl*__cdecl _set_new_handler(int))(unsigned int) @ stub -arch=win64 ?_set_new_handler@@YAP6AH_K@ZH@Z # int (__cdecl*__cdecl _set_new_handler(int))(unsigned __int64) -@ cdecl -arch=win32 ?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z(ptr) msvcrt.?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z -@ cdecl -arch=win64 ?_set_new_handler@@YAP6AH_K@ZP6AH0@Z@Z(ptr) msvcrt.?_set_new_handler@@YAP6AH_K@ZP6AH0@Z@Z -@ cdecl ?_set_new_mode@@YAHH@Z(long) msvcrt.?_set_new_mode@@YAHH@Z +@ cdecl -arch=win32 ?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z(ptr) MSVCRT__set_new_handler +@ cdecl -arch=win64 ?_set_new_handler@@YAP6AH_K@ZP6AH0@Z@Z(ptr) MSVCRT__set_new_handler +@ cdecl ?_set_new_mode@@YAHH@Z(long) MSVCRT__set_new_mode @ stub -arch=win32 ?_set_se_translator@@YAP6AXIPAU_EXCEPTION_POINTERS@@@ZH@Z # void (__cdecl*__cdecl _set_se_translator(int))(unsigned int,struct _EXCEPTION_POINTERS *) @ stub -arch=win64 ?_set_se_translator@@YAP6AXIPEAU_EXCEPTION_POINTERS@@@ZH@Z # void (__cdecl*__cdecl _set_se_translator(int))(unsigned int,struct _EXCEPTION_POINTERS * __ptr64) -@ cdecl -arch=win32 ?_set_se_translator@@YAP6AXIPAU_EXCEPTION_POINTERS@@@ZP6AXI0@Z@Z(ptr) msvcrt.?_set_se_translator@@YAP6AXIPAU_EXCEPTION_POINTERS@@@ZP6AXI0@Z@Z -@ cdecl -arch=win64 ?_set_se_translator@@YAP6AXIPEAU_EXCEPTION_POINTERS@@@ZP6AXI0@Z@Z(ptr) msvcrt.?_set_se_translator@@YAP6AXIPEAU_EXCEPTION_POINTERS@@@ZP6AXI0@Z@Z -@ cdecl -arch=win32 ?_sopen@@YAHPBDHHH@Z(str long long long) msvcrt._sopen -@ cdecl -arch=win64 ?_sopen@@YAHPEBDHHH@Z(str long long long) msvcrt._sopen +@ cdecl -arch=win32 ?_set_se_translator@@YAP6AXIPAU_EXCEPTION_POINTERS@@@ZP6AXI0@Z@Z(ptr) MSVCRT__set_se_translator +@ cdecl -arch=win64 ?_set_se_translator@@YAP6AXIPEAU_EXCEPTION_POINTERS@@@ZP6AXI0@Z@Z(ptr) MSVCRT__set_se_translator +@ cdecl -arch=win32 ?_sopen@@YAHPBDHHH@Z(str long long long) MSVCRT__sopen +@ cdecl -arch=win64 ?_sopen@@YAHPEBDHHH@Z(str long long long) MSVCRT__sopen @ stub -arch=win32 ?_type_info_dtor_internal_method@type_info@@QAEXXZ # public: void __thiscall type_info::_type_info_dtor_internal_method(void) @ stub -arch=win64 ?_type_info_dtor_internal_method@type_info@@QEAAXXZ # public: void __cdecl type_info::_type_info_dtor_internal_method(void) __ptr64 -@ cdecl -arch=win32 ?_wopen@@YAHPB_WHH@Z(wstr long long) msvcrt._wopen -@ cdecl -arch=win64 ?_wopen@@YAHPEB_WHH@Z(wstr long long) msvcrt._wopen -@ cdecl -arch=win32 ?_wsopen@@YAHPB_WHHH@Z(wstr long long long) msvcrt._wsopen -@ cdecl -arch=win64 ?_wsopen@@YAHPEB_WHHH@Z(wstr long long long) msvcrt._wsopen -@ thiscall -arch=i386 ?before@type_info@@QBEHABV1@@Z(ptr ptr) msvcrt.?before@type_info@@QBEHABV1@@Z -@ cdecl -arch=win64 ?before@type_info@@QEBAHAEBV1@@Z(ptr ptr) msvcrt.?before@type_info@@QEBAHAEBV1@@Z -@ stub -arch=win32 ?name@type_info@@QBEPBDPAU__type_info_node@@@Z # public: char const * __thiscall type_info::name(struct __type_info_node *)const -@ stub -arch=win64 ?name@type_info@@QEBAPEBDPEAU__type_info_node@@@Z # public: char const * __ptr64 __cdecl type_info::name(struct __type_info_node * __ptr64)const __ptr64 -@ cdecl -arch=arm ?raw_name@type_info@@QBAPBDXZ(ptr) msvcrt.?raw_name@type_info@@QBAPBDXZ -@ thiscall -arch=i386 ?raw_name@type_info@@QBEPBDXZ(ptr) msvcrt.?raw_name@type_info@@QBEPBDXZ -@ cdecl -arch=win64 ?raw_name@type_info@@QEBAPEBDXZ(ptr) msvcrt.?raw_name@type_info@@QEBAPEBDXZ -@ cdecl ?set_new_handler@@YAP6AXXZP6AXXZ@Z(ptr) msvcrt.?set_new_handler@@YAP6AXXZP6AXXZ@Z +@ cdecl -arch=win32 ?_wopen@@YAHPB_WHH@Z(wstr long long) MSVCRT__wopen +@ cdecl -arch=win64 ?_wopen@@YAHPEB_WHH@Z(wstr long long) MSVCRT__wopen +@ cdecl -arch=win32 ?_wsopen@@YAHPB_WHHH@Z(wstr long long long) MSVCRT__wsopen +@ cdecl -arch=win64 ?_wsopen@@YAHPEB_WHHH@Z(wstr long long long) MSVCRT__wsopen +@ thiscall -arch=i386 ?before@type_info@@QBEHABV1@@Z(ptr ptr) MSVCRT_type_info_before +@ cdecl -arch=win64 ?before@type_info@@QEBAHAEBV1@@Z(ptr ptr) MSVCRT_type_info_before +@ thiscall -arch=win32 ?name@type_info@@QBEPBDPAU__type_info_node@@@Z(ptr ptr) type_info_name_internal_method +@ cdecl -arch=win64 ?name@type_info@@QEBAPEBDPEAU__type_info_node@@@Z(ptr ptr) type_info_name_internal_method +@ cdecl -arch=arm ?raw_name@type_info@@QBAPBDXZ(ptr) MSVCRT_type_info_raw_name +@ thiscall -arch=i386 ?raw_name@type_info@@QBEPBDXZ(ptr) MSVCRT_type_info_raw_name +@ cdecl -arch=win64 ?raw_name@type_info@@QEBAPEBDXZ(ptr) MSVCRT_type_info_raw_name +@ cdecl ?set_new_handler@@YAP6AXXZP6AXXZ@Z(ptr) MSVCRT_set_new_handler @ stub ?set_terminate@@YAP6AXXZH@Z -@ cdecl ?set_terminate@@YAP6AXXZP6AXXZ@Z(ptr) msvcrt.?set_terminate@@YAP6AXXZP6AXXZ@Z +@ cdecl ?set_terminate@@YAP6AXXZP6AXXZ@Z(ptr) MSVCRT_set_terminate @ stub ?set_unexpected@@YAP6AXXZH@Z -@ cdecl ?set_unexpected@@YAP6AXXZP6AXXZ@Z(ptr) msvcrt.?set_unexpected@@YAP6AXXZP6AXXZ@Z -@ varargs ?swprintf@@YAHPAGIPBGZZ(ptr long wstr) msvcrt._snwprintf -@ varargs ?swprintf@@YAHPA_WIPB_WZZ(ptr long wstr) msvcrt._snwprintf -@ cdecl ?terminate@@YAXXZ() msvcrt.?terminate@@YAXXZ -@ cdecl ?unexpected@@YAXXZ() msvcrt.?unexpected@@YAXXZ -@ cdecl ?vswprintf@@YAHPA_WIPB_WPAD@Z(ptr long wstr ptr) msvcrt._vsnwprintf -@ thiscall -arch=i386 ?what@exception@std@@UBEPBDXZ(ptr) msvcrt.?what@exception@@UBEPBDXZ -@ cdecl -arch=win64 ?what@exception@std@@UEBAPEBDXZ(ptr) msvcrt.?what@exception@@UEBAPEBDXZ +@ cdecl ?set_unexpected@@YAP6AXXZP6AXXZ@Z(ptr) MSVCRT_set_unexpected +@ varargs ?swprintf@@YAHPAGIPBGZZ(ptr long wstr) MSVCRT__snwprintf +@ varargs ?swprintf@@YAHPA_WIPB_WZZ(ptr long wstr) MSVCRT__snwprintf +@ cdecl ?terminate@@YAXXZ() MSVCRT_terminate +@ cdecl ?unexpected@@YAXXZ() MSVCRT_unexpected +@ cdecl ?vswprintf@@YAHPA_WIPB_WPAD@Z(ptr long wstr ptr) MSVCRT_vsnwprintf +@ thiscall -arch=i386 ?what@exception@std@@UBEPBDXZ(ptr) MSVCRT_what_exception +@ cdecl -arch=win64 ?what@exception@std@@UEBAPEBDXZ(ptr) MSVCRT_what_exception @ stub @_calloc_crt@8 -@ cdecl @_malloc_crt@4(long) msvcrt.malloc +@ cdecl @_malloc_crt@4(long) MSVCRT_malloc @ stub @_realloc_crt@8 -@ cdecl -norelay $I10_OUTPUT(double long long long ptr) msvcrt.$I10_OUTPUT -@ cdecl -arch=i386 _CIacos() msvcrt._CIacos -@ cdecl -arch=i386 _CIasin() msvcrt._CIasin -@ cdecl -arch=i386 _CIatan() msvcrt._CIatan -@ cdecl -arch=i386 _CIatan2() msvcrt._CIatan2 -@ cdecl -arch=i386 _CIcos() msvcrt._CIcos -@ cdecl -arch=i386 _CIcosh() msvcrt._CIcosh -@ cdecl -arch=i386 _CIexp() msvcrt._CIexp -@ cdecl -arch=i386 _CIfmod() msvcrt._CIfmod -@ cdecl -arch=i386 _CIlog() msvcrt._CIlog -@ cdecl -arch=i386 _CIlog10() msvcrt._CIlog10 -@ cdecl -arch=i386 _CIpow() msvcrt._CIpow -@ cdecl -arch=i386 _CIsin() msvcrt._CIsin -@ cdecl -arch=i386 _CIsinh() msvcrt._CIsinh -@ cdecl -arch=i386 _CIsqrt() msvcrt._CIsqrt -@ cdecl -arch=i386 _CItan() msvcrt._CItan -@ cdecl -arch=i386 _CItanh() msvcrt._CItanh -@ cdecl _CRT_RTC_INIT(ptr ptr long long long) msvcr100._CRT_RTC_INIT -@ cdecl _CRT_RTC_INITW(ptr ptr long long long) msvcr100._CRT_RTC_INITW +@ cdecl -norelay $I10_OUTPUT(double long long long ptr) MSVCRT_I10_OUTPUT +@ 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() +@ cdecl _CRT_RTC_INIT(ptr ptr long long long) +@ cdecl _CRT_RTC_INITW(ptr ptr long long long) @ stub _CreateFrameInfo -@ stdcall _CxxThrowException(long long) msvcrt._CxxThrowException -@ cdecl -arch=i386 -norelay _EH_prolog() msvcrt._EH_prolog +@ stdcall _CxxThrowException(long long) +@ cdecl -arch=i386 -norelay _EH_prolog() @ stub _FindAndUnlinkFrame @ stub -arch=win64 _GetImageBase @ stub -arch=win64 _GetThrowImageBase -@ cdecl _Getdays() msvcrt._Getdays -@ cdecl _Getmonths() msvcrt._Getmonths -@ cdecl _Gettnames() msvcrt._Gettnames -@ extern _HUGE msvcrt._HUGE +@ cdecl _Getdays() +@ cdecl _Getmonths() +@ cdecl _Gettnames() +@ extern _HUGE MSVCRT__HUGE @ stub _IsExceptionObjectToBeDestroyed @ stub -arch=i386 _NLG_Dispatch2 @ stub -arch=arm,win64 __NLG_Dispatch2 @@ -170,528 +170,528 @@ @ stub -arch=arm,win64 __NLG_Return2 @ stub -arch=win64 _SetImageBase @ stub -arch=win64 _SetThrowImageBase -@ cdecl _Strftime(str long str ptr ptr) msvcrt._Strftime -@ cdecl _XcptFilter(long ptr) msvcrt._XcptFilter +@ cdecl _Strftime(str long str ptr ptr) +@ cdecl _XcptFilter(long ptr) @ stub __AdjustPointer @ stub __BuildCatchObject @ stub __BuildCatchObjectHelper -@ stdcall -arch=x86_64 __C_specific_handler(ptr long ptr ptr) msvcrt.__C_specific_handler -@ cdecl -arch=i386,x86_64,arm __CppXcptFilter(long ptr) msvcrt.__CppXcptFilter +@ stdcall -arch=x86_64 __C_specific_handler(ptr long ptr ptr) ntdll.__C_specific_handler +@ cdecl -arch=i386,x86_64,arm __CppXcptFilter(long ptr) @ stub __CxxCallUnwindDelDtor @ stub __CxxCallUnwindDtor @ stub __CxxCallUnwindStdDelDtor @ stub __CxxCallUnwindVecDtor -@ cdecl -arch=i386,x86_64,arm __CxxDetectRethrow(ptr) msvcrt.__CxxDetectRethrow +@ cdecl -arch=i386,x86_64,arm __CxxDetectRethrow(ptr) @ stub __CxxExceptionFilter -@ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler(ptr ptr ptr ptr) msvcrt.__CxxFrameHandler -@ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler2(ptr ptr ptr ptr) msvcrt.__CxxFrameHandler2 -@ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler3(ptr ptr ptr ptr) msvcrt.__CxxFrameHandler3 -@ stdcall -arch=i386 __CxxLongjmpUnwind(ptr) msvcrt.__CxxLongjmpUnwind -@ cdecl -arch=i386,x86_64,arm __CxxQueryExceptionSize() msvcrt.__CxxQueryExceptionSize +@ 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 -@ cdecl __RTCastToVoid(ptr) msvcrt.__RTCastToVoid -@ cdecl __RTDynamicCast(ptr long ptr ptr long) msvcrt.__RTDynamicCast -@ cdecl __RTtypeid(ptr) msvcrt.__RTtypeid -@ cdecl __STRINGTOLD(ptr ptr str long) msvcrt.__STRINGTOLD +@ cdecl __RTCastToVoid(ptr) MSVCRT___RTCastToVoid +@ cdecl __RTDynamicCast(ptr long ptr ptr long) MSVCRT___RTDynamicCast +@ cdecl __RTtypeid(ptr) MSVCRT___RTtypeid +@ cdecl __STRINGTOLD(ptr ptr str long) @ stub __STRINGTOLD_L @ stub __TypeMatch -@ cdecl ___lc_codepage_func() msvcrt.___lc_codepage_func -@ cdecl ___lc_collate_cp_func() msvcrt.___lc_collate_cp_func -@ cdecl ___lc_handle_func() msvcrt.___lc_handle_func -@ cdecl ___mb_cur_max_func() msvcrt.___mb_cur_max_func -@ cdecl ___mb_cur_max_l_func(ptr) msvcrt.___mb_cur_max_l_func -@ cdecl ___setlc_active_func() msvcrt.___setlc_active_func -@ cdecl ___unguarded_readlc_active_add_func() msvcrt.___unguarded_readlc_active_add_func -@ extern __argc msvcrt.__argc -@ extern __argv msvcrt.__argv +@ cdecl ___lc_codepage_func() +@ cdecl ___lc_collate_cp_func() +@ cdecl ___lc_handle_func() +@ cdecl ___mb_cur_max_func() MSVCRT____mb_cur_max_func +@ cdecl ___mb_cur_max_l_func(ptr) +@ cdecl ___setlc_active_func() MSVCRT____setlc_active_func +@ cdecl ___unguarded_readlc_active_add_func() MSVCRT____unguarded_readlc_active_add_func +@ extern __argc MSVCRT___argc +@ extern __argv MSVCRT___argv ### extern __badioinfo #don't forward to msvcrt.__badioinfo, it has different size -@ cdecl __clean_type_info_names_internal(ptr) msvcr100.__clean_type_info_names_internal -@ cdecl -arch=i386 __control87_2(long long ptr ptr) msvcrt.__control87_2 +@ cdecl __clean_type_info_names_internal(ptr) +@ cdecl -arch=i386 __control87_2(long long ptr ptr) @ stub __create_locale -@ cdecl __crtCompareStringA(long long str long str long) msvcrt.__crtCompareStringA -@ cdecl __crtCompareStringW(long long wstr long wstr long) msvcrt.__crtCompareStringW -@ cdecl __crtGetLocaleInfoW(long long ptr long) msvcrt.__crtGetLocaleInfoW -@ cdecl __crtGetStringTypeW(long long wstr long ptr) msvcrt.__crtGetStringTypeW -@ cdecl __crtLCMapStringA(long long str long ptr long long long) msvcrt.__crtLCMapStringA -@ cdecl __crtLCMapStringW(long long wstr long ptr long long long) msvcrt.__crtLCMapStringW -@ cdecl __daylight() msvcrt.__daylight -@ cdecl __dllonexit(ptr ptr ptr) msvcrt.__dllonexit -@ cdecl __doserrno() msvcrt.__doserrno +@ cdecl __crtCompareStringA(long long str long str long) +@ cdecl __crtCompareStringW(long long wstr long wstr long) +@ cdecl __crtGetLocaleInfoW(long long ptr long) +@ cdecl __crtGetStringTypeW(long long wstr long ptr) +@ cdecl __crtLCMapStringA(long long str long ptr long long long) +@ cdecl __crtLCMapStringW(long long wstr long ptr long long long) +@ cdecl __daylight() MSVCRT___p__daylight +@ cdecl __dllonexit(ptr ptr ptr) +@ cdecl __doserrno() MSVCRT___doserrno @ stub __dstbias @ stub -arch=i386 ___fls_getvalue@4 @ stub -arch=x86_64 __fls_getvalue @ stub -arch=i386 ___fls_setvalue@8 @ stub -arch=x86_64 __fls_setvalue -@ cdecl __fpecode() msvcrt.__fpecode +@ cdecl __fpecode() @ stub __free_locale @ stub __get_app_type @ stub __get_current_locale @ stub __get_flsindex @ stub __get_tlsindex -@ cdecl __getmainargs(ptr ptr ptr long ptr) msvcrt.__getmainargs -@ extern __initenv msvcrt.__initenv -@ cdecl __iob_func() msvcrt.__iob_func -@ cdecl __isascii(long) msvcrt.__isascii -@ cdecl __iscsym(long) msvcrt.__iscsym -@ cdecl __iscsymf(long) msvcrt.__iscsymf +@ cdecl __getmainargs(ptr ptr ptr long ptr) +@ extern __initenv MSVCRT___initenv +@ cdecl __iob_func() MSVCRT___iob_func +@ cdecl __isascii(long) MSVCRT___isascii +@ cdecl __iscsym(long) MSVCRT___iscsym +@ cdecl __iscsymf(long) MSVCRT___iscsymf @ stub __iswcsym @ stub __iswcsymf # extern __lc_clike -@ extern __lc_codepage msvcrt.__lc_codepage -@ extern __lc_collate_cp msvcrt.__lc_collate_cp -@ extern __lc_handle msvcrt.__lc_handle +@ extern __lc_codepage MSVCRT___lc_codepage +@ extern __lc_collate_cp MSVCRT___lc_collate_cp +@ extern __lc_handle MSVCRT___lc_handle # extern __lconv -@ cdecl __lconv_init() msvcrt.__lconv_init -@ cdecl -arch=i386 __libm_sse2_acos() msvcrt.__libm_sse2_acos -@ cdecl -arch=i386 __libm_sse2_acosf() msvcrt.__libm_sse2_acosf -@ cdecl -arch=i386 __libm_sse2_asin() msvcrt.__libm_sse2_asin -@ cdecl -arch=i386 __libm_sse2_asinf() msvcrt.__libm_sse2_asinf -@ cdecl -arch=i386 __libm_sse2_atan() msvcrt.__libm_sse2_atan -@ cdecl -arch=i386 __libm_sse2_atan2() msvcrt.__libm_sse2_atan2 -@ cdecl -arch=i386 __libm_sse2_atanf() msvcrt.__libm_sse2_atanf -@ cdecl -arch=i386 __libm_sse2_cos() msvcrt.__libm_sse2_cos -@ cdecl -arch=i386 __libm_sse2_cosf() msvcrt.__libm_sse2_cosf -@ cdecl -arch=i386 __libm_sse2_exp() msvcrt.__libm_sse2_exp -@ cdecl -arch=i386 __libm_sse2_expf() msvcrt.__libm_sse2_expf -@ cdecl -arch=i386 __libm_sse2_log() msvcrt.__libm_sse2_log -@ cdecl -arch=i386 __libm_sse2_log10() msvcrt.__libm_sse2_log10 -@ cdecl -arch=i386 __libm_sse2_log10f() msvcrt.__libm_sse2_log10f -@ cdecl -arch=i386 __libm_sse2_logf() msvcrt.__libm_sse2_logf -@ cdecl -arch=i386 __libm_sse2_pow() msvcrt.__libm_sse2_pow -@ cdecl -arch=i386 __libm_sse2_powf() msvcrt.__libm_sse2_powf -@ cdecl -arch=i386 __libm_sse2_sin() msvcrt.__libm_sse2_sin -@ cdecl -arch=i386 __libm_sse2_sinf() msvcrt.__libm_sse2_sinf -@ cdecl -arch=i386 __libm_sse2_tan() msvcrt.__libm_sse2_tan -@ cdecl -arch=i386 __libm_sse2_tanf() msvcrt.__libm_sse2_tanf -@ extern __mb_cur_max msvcrt.__mb_cur_max -@ cdecl __p___argc() msvcrt.__p___argc -@ cdecl __p___argv() msvcrt.__p___argv -@ cdecl __p___initenv() msvcrt.__p___initenv -@ cdecl __p___mb_cur_max() msvcrt.__p___mb_cur_max -@ cdecl __p___wargv() msvcrt.__p___wargv -@ cdecl __p___winitenv() msvcrt.__p___winitenv -@ cdecl __p__acmdln() msvcrt.__p__acmdln -@ cdecl __p__amblksiz() msvcrt.__p__amblksiz -@ cdecl __p__commode() msvcrt.__p__commode -@ cdecl __p__daylight() msvcrt.__p__daylight -@ cdecl __p__dstbias() msvcrt.__p__dstbias -@ cdecl __p__environ() msvcrt.__p__environ -@ cdecl __p__fmode() msvcrt.__p__fmode -@ cdecl __p__iob() msvcrt.__p__iob -@ cdecl __p__mbcasemap() msvcrt.__p__mbcasemap -@ cdecl __p__mbctype() msvcrt.__p__mbctype +@ cdecl __lconv_init() +@ 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() +@ extern __mb_cur_max MSVCRT___mb_cur_max +@ cdecl __p___argc() MSVCRT___p___argc +@ cdecl __p___argv() MSVCRT___p___argv +@ cdecl __p___initenv() +@ cdecl __p___mb_cur_max() +@ cdecl __p___wargv() MSVCRT___p___wargv +@ cdecl __p___winitenv() +@ cdecl __p__acmdln() +@ cdecl __p__amblksiz() +@ cdecl __p__commode() +@ cdecl __p__daylight() MSVCRT___p__daylight +@ cdecl __p__dstbias() +@ cdecl __p__environ() MSVCRT___p__environ +@ cdecl __p__fmode() +@ cdecl __p__iob() MSVCRT___iob_func +@ stub __p__mbcasemap() +@ cdecl __p__mbctype() @ stub __p__osplatform -@ cdecl __p__osver() msvcrt.__p__osver -@ cdecl __p__pctype() msvcrt.__p__pctype -@ cdecl __p__pgmptr() msvcrt.__p__pgmptr -@ cdecl __p__pwctype() msvcrt.__p__pwctype -@ cdecl __p__timezone() msvcrt.__p__timezone -@ cdecl __p__tzname() msvcrt.__p__tzname -@ cdecl __p__wcmdln() msvcrt.__p__wcmdln -@ cdecl __p__wenviron() msvcrt.__p__wenviron -@ cdecl __p__winmajor() msvcrt.__p__winmajor -@ cdecl __p__winminor() msvcrt.__p__winminor -@ cdecl __p__winver() msvcrt.__p__winver -@ cdecl __p__wpgmptr() msvcrt.__p__wpgmptr -@ cdecl __pctype_func() msvcrt.__pctype_func +@ cdecl __p__osver() +@ cdecl __p__pctype() MSVCRT___p__pctype +@ cdecl __p__pgmptr() MSVCRT___p__pgmptr +@ stub __p__pwctype() +@ cdecl __p__timezone() MSVCRT___p__timezone +@ cdecl __p__tzname() +@ cdecl __p__wcmdln() +@ cdecl __p__wenviron() MSVCRT___p__wenviron +@ cdecl __p__winmajor() +@ cdecl __p__winminor() +@ cdecl __p__winver() +@ cdecl __p__wpgmptr() MSVCRT___p__wpgmptr +@ cdecl __pctype_func() MSVCRT___pctype_func #FIXME: add correct __pioinfo implementation -@ extern __pioinfo msvcrt.__pioinfo +@ extern __pioinfo MSVCRT___pioinfo @ stub __pwctype_func -@ cdecl __pxcptinfoptrs() msvcrt.__pxcptinfoptrs +@ cdecl __pxcptinfoptrs() MSVCRT___pxcptinfoptrs @ stub __report_gsfailure -@ cdecl __set_app_type(long) msvcrt.__set_app_type +@ cdecl __set_app_type(long) MSVCRT___set_app_type @ stub __set_flsgetvalue -@ extern __setlc_active msvcrt.__setlc_active -@ cdecl __setusermatherr(ptr) msvcrt.__setusermatherr +@ extern __setlc_active MSVCRT___setlc_active +@ cdecl __setusermatherr(ptr) MSVCRT___setusermatherr @ stub __strncnt @ stub __swprintf_l -@ cdecl __sys_errlist() msvcr100.__sys_errlist -@ cdecl __sys_nerr() msvcr100.__sys_nerr -@ cdecl __threadhandle() msvcrt.__threadhandle -@ cdecl __threadid() msvcrt.__threadid -@ cdecl __timezone() msvcrt.__p__timezone -@ cdecl __toascii(long) msvcrt.__toascii -@ cdecl __tzname() msvcrt.__p__tzname -@ cdecl __unDName(ptr str long ptr ptr long) msvcrt.__unDName -@ cdecl __unDNameEx(ptr str long ptr ptr ptr long) msvcrt.__unDNameEx +@ 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) @ stub __unDNameHelper -@ extern __unguarded_readlc_active msvcrt.__unguarded_readlc_active -@ cdecl __vswprintf_l(ptr wstr ptr ptr) msvcrt._vswprintf_l -@ extern __wargv msvcrt.__wargv -@ cdecl __wcserror(wstr) msvcrt.__wcserror -@ cdecl __wcserror_s(ptr long wstr) msvcrt.__wcserror_s +@ extern __unguarded_readlc_active MSVCRT___unguarded_readlc_active +@ cdecl __vswprintf_l(ptr wstr ptr ptr) MSVCRT_vswprintf_l +@ extern __wargv MSVCRT___wargv +@ cdecl __wcserror(wstr) MSVCRT___wcserror +@ cdecl __wcserror_s(ptr long wstr) MSVCRT___wcserror_s @ stub __wcsncnt -@ cdecl __wgetmainargs(ptr ptr ptr long ptr) msvcrt.__wgetmainargs -@ extern __winitenv msvcrt.__winitenv -@ cdecl _abnormal_termination() msvcrt._abnormal_termination -@ cdecl -ret64 _abs64(int64) msvcrt._abs64 -@ cdecl _access(str long) msvcrt._access -@ cdecl _access_s(str long) msvcrt._access_s -@ extern _acmdln msvcrt._acmdln -@ stdcall -arch=i386 _adj_fdiv_m16i(long) msvcrt._adj_fdiv_m16i -@ stdcall -arch=i386 _adj_fdiv_m32(long) msvcrt._adj_fdiv_m32 -@ stdcall -arch=i386 _adj_fdiv_m32i(long) msvcrt._adj_fdiv_m32i -@ stdcall -arch=i386 _adj_fdiv_m64(int64) msvcrt._adj_fdiv_m64 -@ cdecl -arch=i386 _adj_fdiv_r() msvcrt._adj_fdiv_r -@ stdcall -arch=i386 _adj_fdivr_m16i(long) msvcrt._adj_fdivr_m16i -@ stdcall -arch=i386 _adj_fdivr_m32(long) msvcrt._adj_fdivr_m32 -@ stdcall -arch=i386 _adj_fdivr_m32i(long) msvcrt._adj_fdivr_m32i -@ stdcall -arch=i386 _adj_fdivr_m64(int64) msvcrt._adj_fdivr_m64 -@ cdecl -arch=i386 _adj_fpatan() msvcrt._adj_fpatan -@ cdecl -arch=i386 _adj_fprem() msvcrt._adj_fprem -@ cdecl -arch=i386 _adj_fprem1() msvcrt._adj_fprem1 -@ cdecl -arch=i386 _adj_fptan() msvcrt._adj_fptan -@ extern -arch=i386 _adjust_fdiv msvcrt._adjust_fdiv -@ extern _aexit_rtn msvcrt._aexit_rtn -@ cdecl _aligned_free(ptr) msvcrt._aligned_free -@ cdecl _aligned_malloc(long long) msvcrt._aligned_malloc -@ cdecl _aligned_msize(ptr long long) msvcr100._aligned_msize -@ cdecl _aligned_offset_malloc(long long long) msvcrt._aligned_offset_malloc -@ cdecl _aligned_offset_realloc(ptr long long long) msvcrt._aligned_offset_realloc +@ cdecl __wgetmainargs(ptr ptr ptr long ptr) +@ extern __winitenv MSVCRT___winitenv +@ cdecl _abnormal_termination() +@ cdecl -ret64 _abs64(int64) +@ cdecl _access(str long) MSVCRT__access +@ cdecl _access_s(str long) MSVCRT__access_s +@ extern _acmdln MSVCRT__acmdln +@ stdcall -arch=i386 _adj_fdiv_m16i(long) +@ stdcall -arch=i386 _adj_fdiv_m32(long) +@ stdcall -arch=i386 _adj_fdiv_m32i(long) +@ stdcall -arch=i386 _adj_fdiv_m64(int64) +@ cdecl -arch=i386 _adj_fdiv_r() +@ stdcall -arch=i386 _adj_fdivr_m16i(long) +@ stdcall -arch=i386 _adj_fdivr_m32(long) +@ stdcall -arch=i386 _adj_fdivr_m32i(long) +@ stdcall -arch=i386 _adj_fdivr_m64(int64) +@ cdecl -arch=i386 _adj_fpatan() +@ cdecl -arch=i386 _adj_fprem() +@ cdecl -arch=i386 _adj_fprem1() +@ cdecl -arch=i386 _adj_fptan() +@ extern -arch=i386 _adjust_fdiv MSVCRT__adjust_fdiv +@ extern _aexit_rtn +@ 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) msvcrt._aligned_realloc +@ cdecl _aligned_realloc(ptr long long) @ stub _aligned_recalloc -@ cdecl _amsg_exit(long) msvcrt._amsg_exit -@ 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) msvcr100._atoflt -@ cdecl _atoflt_l(ptr str ptr) msvcrt._atoflt_l -@ cdecl -ret64 _atoi64(str) msvcrt._atoi64 +@ cdecl _amsg_exit(long) +@ 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 +@ cdecl _atoi_l(str ptr) MSVCRT__atoi_l @ stub _atol_l -@ cdecl _atoldbl(ptr str) msvcrt._atoldbl +@ cdecl _atoldbl(ptr str) MSVCRT__atoldbl @ stub _atoldbl_l -@ cdecl _beep(long long) msvcrt._beep -@ cdecl _beginthread(ptr long ptr) msvcrt._beginthread -@ cdecl _beginthreadex(ptr long ptr ptr long ptr) msvcrt._beginthreadex -@ cdecl _byteswap_uint64(int64) msvcr100._byteswap_uint64 -@ cdecl _byteswap_ulong(long) msvcr100._byteswap_ulong -@ cdecl _byteswap_ushort(long) msvcr100._byteswap_ushort -@ cdecl _c_exit() msvcrt._c_exit -@ cdecl _cabs(long) msvcrt._cabs -@ cdecl _callnewh(long) msvcrt._callnewh -@ cdecl _calloc_crt(long long) msvcrt.calloc -@ cdecl _cexit() msvcrt._cexit -@ cdecl _cgets(ptr) msvcrt._cgets +@ 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) +@ cdecl _calloc_crt(long long) MSVCRT_calloc +@ 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 -arch=arm,x86_64 _chgsignf(float) msvcrt._chgsignf -@ cdecl -arch=i386 -norelay _chkesp() msvcrt._chkesp -@ cdecl _chmod(str long) msvcrt._chmod -@ cdecl _chsize(long long) msvcrt._chsize -@ cdecl _chsize_s(long int64) msvcrt._chsize_s -@ cdecl _clearfp() msvcrt._clearfp -@ cdecl _close(long) msvcrt._close -@ cdecl _commit(long) msvcrt._commit -@ extern _commode msvcrt._commode -@ cdecl _configthreadlocale(long) msvcrt._configthreadlocale -@ cdecl _control87(long long) msvcrt._control87 -@ cdecl _controlfp(long long) msvcrt._controlfp -@ cdecl _controlfp_s(ptr long long) msvcrt._controlfp_s -@ cdecl _copysign(double double) msvcrt._copysign -@ cdecl -arch=arm,x86_64 _copysignf(float float) msvcrt._copysignf -@ varargs _cprintf(str) msvcrt._cprintf +@ cdecl _chdir(str) MSVCRT__chdir +@ cdecl _chdrive(long) MSVCRT__chdrive +@ cdecl _chgsign(double) MSVCRT__chgsign +@ cdecl -arch=arm,x86_64 _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 +@ extern _commode MSVCRT__commode +@ cdecl _configthreadlocale(long) +@ cdecl _control87(long long) +@ cdecl _controlfp(long long) +@ cdecl _controlfp_s(ptr long long) +@ cdecl _copysign(double double) MSVCRT__copysign +@ cdecl -arch=arm,x86_64 _copysignf(float float) MSVCRT__copysignf +@ varargs _cprintf(str) @ stub _cprintf_l @ stub _cprintf_p @ stub _cprintf_p_l @ stub _cprintf_s @ stub _cprintf_s_l -@ cdecl _cputs(str) msvcrt._cputs -@ cdecl _cputws(wstr) msvcrt._cputws -@ cdecl _creat(str long) msvcrt._creat -@ cdecl _create_locale(long str) msvcrt._create_locale +@ cdecl _cputs(str) +@ cdecl _cputws(wstr) +@ cdecl _creat(str long) MSVCRT__creat +@ cdecl _create_locale(long str) MSVCRT__create_locale @ stub -arch=i386 _crt_debugger_hook @ stub -arch=arm,win64 __crt_debugger_hook -@ varargs _cscanf(str) msvcrt._cscanf -@ varargs _cscanf_l(str ptr) msvcrt._cscanf_l -@ varargs _cscanf_s(str) msvcrt._cscanf_s -@ varargs _cscanf_s_l(str ptr) msvcrt._cscanf_s_l -@ 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) msvcrt._cwait -@ varargs _cwprintf(wstr) msvcrt._cwprintf +@ varargs _cscanf(str) +@ varargs _cscanf_l(str ptr) +@ varargs _cscanf_s(str) +@ varargs _cscanf_s_l(str ptr) +@ 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) +@ varargs _cwprintf(wstr) @ stub _cwprintf_l @ stub _cwprintf_p @ stub _cwprintf_p_l @ stub _cwprintf_s @ stub _cwprintf_s_l -@ varargs _cwscanf(wstr) msvcrt._cwscanf -@ varargs _cwscanf_l(wstr ptr) msvcrt._cwscanf_l -@ varargs _cwscanf_s(wstr) msvcrt._cwscanf_s -@ varargs _cwscanf_s_l(wstr ptr) msvcrt._cwscanf_s_l -@ extern _daylight msvcrt._daylight -@ cdecl _decode_pointer(ptr) MSVCR80__decode_pointer -@ cdecl _difftime32(long long) msvcrt._difftime32 -@ cdecl _difftime64(long long) msvcrt._difftime64 +@ varargs _cwscanf(wstr) +@ varargs _cwscanf_l(wstr ptr) +@ varargs _cwscanf_s(wstr) +@ varargs _cwscanf_s_l(wstr ptr) +@ extern _daylight MSVCRT___daylight +@ cdecl _decode_pointer(ptr) MSVCRT_decode_pointer +@ cdecl _difftime32(long long) MSVCRT__difftime32 +@ cdecl _difftime64(long long) MSVCRT__difftime64 @ stub _dosmaperr -@ extern _dstbias msvcrt._dstbias -@ cdecl _dup(long) msvcrt._dup -@ cdecl _dup2(long long) msvcrt._dup2 -@ cdecl _dupenv_s(ptr ptr str) msvcrt._dupenv_s -@ cdecl _ecvt(double long ptr ptr) msvcrt._ecvt -@ cdecl _ecvt_s(str long double long ptr ptr) msvcrt._ecvt_s -@ cdecl _encode_pointer(ptr) MSVCR80__encode_pointer -@ cdecl _encoded_null() msvcr100._encoded_null -@ cdecl _endthread() msvcrt._endthread -@ cdecl _endthreadex(long) msvcrt._endthreadex -@ extern _environ msvcrt._environ -@ cdecl _eof(long) msvcrt._eof -@ cdecl _errno() msvcrt._errno -@ cdecl -arch=i386 _except_handler2(ptr ptr ptr ptr) msvcrt._except_handler2 -@ cdecl -arch=i386 _except_handler3(ptr ptr ptr ptr) msvcrt._except_handler3 -@ cdecl -arch=i386 _except_handler4_common(ptr ptr ptr ptr ptr ptr) msvcrt._except_handler4_common -@ varargs _execl(str str) msvcrt._execl -@ varargs _execle(str str) msvcrt._execle -@ varargs _execlp(str str) msvcrt._execlp -@ varargs _execlpe(str str) msvcrt._execlpe -@ cdecl _execv(str ptr) msvcrt._execv -@ cdecl _execve(str ptr ptr) msvcrt._execve -@ cdecl _execvp(str ptr) msvcrt._execvp -@ cdecl _execvpe(str ptr ptr) msvcrt._execvpe -@ cdecl _exit(long) msvcrt._exit -@ cdecl _expand(ptr long) msvcrt._expand +@ extern _dstbias MSVCRT__dstbias +@ 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 _encode_pointer(ptr) MSVCRT_encode_pointer +@ cdecl _encoded_null() +@ cdecl _endthread() +@ cdecl _endthreadex(long) +@ extern _environ MSVCRT__environ +@ cdecl _eof(long) MSVCRT__eof +@ cdecl _errno() MSVCRT__errno +@ 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) +@ 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) @ stub _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 -@ cdecl _fdopen(long str) msvcrt._fdopen +@ cdecl _fcloseall() MSVCRT__fcloseall +@ cdecl _fcvt(double long ptr ptr) MSVCRT__fcvt +@ cdecl _fcvt_s(ptr long double long ptr ptr) MSVCRT__fcvt_s +@ cdecl _fdopen(long str) MSVCRT__fdopen @ stub _fflush_nolock -@ cdecl _fgetchar() msvcrt._fgetchar +@ cdecl _fgetchar() MSVCRT__fgetchar @ stub _fgetwc_nolock -@ cdecl _fgetwchar() msvcrt._fgetwchar -@ cdecl _filbuf(ptr) msvcrt._filbuf -@ 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 +@ cdecl _fgetwchar() MSVCRT__fgetwchar +@ cdecl _filbuf(ptr) MSVCRT__filbuf +@ 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 +@ 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 _flsbuf(long ptr) msvcrt._flsbuf -@ cdecl _flushall() msvcrt._flushall -@ extern _fmode msvcrt._fmode -@ cdecl _fpclass(double) msvcrt._fpclass +@ 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 _flsbuf(long ptr) MSVCRT__flsbuf +@ cdecl _flushall() MSVCRT__flushall +@ extern _fmode MSVCRT__fmode +@ cdecl _fpclass(double) MSVCRT__fpclass # stub -arch=x86_64 _fpclassf -@ cdecl _fpieee_flt(long ptr ptr) msvcrt._fpieee_flt -@ cdecl _fpreset() msvcrt._fpreset +@ stub _fpieee_flt(long ptr ptr) +@ cdecl _fpreset() @ stub _fprintf_l @ stub _fprintf_p @ stub _fprintf_p_l @ stub _fprintf_s_l -@ cdecl _fputchar(long) msvcrt._fputchar +@ cdecl _fputchar(long) MSVCRT__fputchar @ stub _fputwc_nolock -@ cdecl _fputwchar(long) msvcrt._fputwchar +@ cdecl _fputwchar(long) MSVCRT__fputwchar @ stub _fread_nolock @ stub _fread_nolock_s -@ cdecl _free_locale(ptr) msvcrt._free_locale +@ cdecl _free_locale(ptr) MSVCRT__free_locale @ stub _freea @ stub _freea_s @ stub _freefls -@ varargs _fscanf_l(ptr str ptr) msvcrt._fscanf_l -@ varargs _fscanf_s_l(ptr str ptr) msvcrt._fscanf_s_l +@ varargs _fscanf_l(ptr str ptr) MSVCRT__fscanf_l +@ varargs _fscanf_s_l(ptr str ptr) MSVCRT__fscanf_s_l @ stub _fseek_nolock -@ cdecl _fseeki64(ptr int64 long) msvcrt._fseeki64 +@ cdecl _fseeki64(ptr int64 long) MSVCRT__fseeki64 @ stub _fseeki64_nolock -@ cdecl _fsopen(str str long) msvcrt._fsopen -@ cdecl _fstat32(long ptr) msvcrt._fstat32 +@ 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 _fstat64(long ptr) MSVCRT__fstat64 +@ cdecl _fstat64i32(long ptr) MSVCRT__fstat64i32 @ stub _ftell_nolock -@ cdecl -ret64 _ftelli64(ptr) msvcrt._ftelli64 +@ cdecl -ret64 _ftelli64(ptr) MSVCRT__ftelli64 @ stub _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) msvcrt._futime32 -@ cdecl _futime64(long ptr) msvcrt._futime64 -@ varargs _fwprintf_l(ptr wstr ptr) msvcrt._fwprintf_l +@ 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) +@ varargs _fwprintf_l(ptr wstr ptr) MSVCRT__fwprintf_l @ stub _fwprintf_p @ stub _fwprintf_p_l @ stub _fwprintf_s_l @ stub _fwrite_nolock -@ varargs _fwscanf_l(ptr wstr ptr) msvcrt._fwscanf_l -@ varargs _fwscanf_s_l(ptr wstr ptr) msvcrt._fwscanf_s_l -@ cdecl _gcvt(double long str) msvcrt._gcvt -@ cdecl _gcvt_s(ptr long double long) msvcrt._gcvt_s +@ varargs _fwscanf_l(ptr wstr ptr) MSVCRT__fwscanf_l +@ varargs _fwscanf_s_l(ptr wstr ptr) MSVCRT__fwscanf_s_l +@ cdecl _gcvt(double long str) MSVCRT__gcvt +@ cdecl _gcvt_s(ptr long double long) MSVCRT__gcvt_s @ stub _get_amblksiz -@ cdecl _get_current_locale() msvcrt._get_current_locale -@ cdecl _get_daylight(ptr) msvcr100._get_daylight -@ cdecl _get_doserrno(ptr) msvcrt._get_doserrno +@ cdecl _get_current_locale() MSVCRT__get_current_locale +@ cdecl _get_daylight(ptr) +@ cdecl _get_doserrno(ptr) @ stub _get_dstbias -@ cdecl _get_errno(ptr) msvcrt._get_errno -@ cdecl _get_fmode(ptr) msvcrt._get_fmode -@ cdecl _get_heap_handle() msvcrt._get_heap_handle -@ cdecl _get_invalid_parameter_handler() msvcrt._get_invalid_parameter_handler -@ cdecl _get_osfhandle(long) msvcrt._get_osfhandle -@ cdecl _get_osplatform(ptr) msvcrt._get_osplatform +@ cdecl _get_errno(ptr) +@ cdecl _get_fmode(ptr) MSVCRT__get_fmode +@ cdecl _get_heap_handle() +@ cdecl _get_invalid_parameter_handler() +@ cdecl _get_osfhandle(long) MSVCRT__get_osfhandle +@ cdecl _get_osplatform(ptr) MSVCRT__get_osplatform @ stub _get_osver -@ cdecl _get_output_format() msvcrt._get_output_format -@ cdecl _get_pgmptr(ptr) msvcrt._get_pgmptr -@ cdecl _get_printf_count_output() msvcrt._get_printf_count_output +@ cdecl _get_output_format() MSVCRT__get_output_format +@ cdecl _get_pgmptr(ptr) +@ cdecl _get_printf_count_output() MSVCRT__get_printf_count_output @ stub _get_purecall_handler -@ cdecl _get_sbh_threshold() msvcrt._get_sbh_threshold -@ cdecl _get_terminate() msvcrt._get_terminate -@ cdecl _get_timezone(ptr) msvcr100._get_timezone -@ cdecl _get_tzname(ptr str long long) msvcrt._get_tzname -@ cdecl _get_unexpected() msvcrt._get_unexpected +@ cdecl _get_sbh_threshold() +@ cdecl _get_terminate() MSVCRT__get_terminate +@ cdecl _get_timezone(ptr) +@ cdecl _get_tzname(ptr str long long) MSVCRT__get_tzname +@ cdecl _get_unexpected() MSVCRT__get_unexpected @ stub _get_winmajor @ stub _get_winminor @ stub _get_winver -@ cdecl _get_wpgmptr(ptr) msvcrt._get_wpgmptr -@ cdecl _getch() msvcrt._getch +@ cdecl _get_wpgmptr(ptr) +@ cdecl _getch() @ stub _getch_nolock -@ cdecl _getche() msvcrt._getche +@ cdecl _getche() @ stub _getche_nolock -@ cdecl _getcwd(str long) msvcrt._getcwd -@ cdecl _getdcwd(long str long) msvcrt._getdcwd +@ cdecl _getcwd(str long) MSVCRT__getcwd +@ cdecl _getdcwd(long str long) MSVCRT__getdcwd @ stub _getdcwd_nolock -@ cdecl _getdiskfree(long ptr) msvcrt._getdiskfree -@ cdecl _getdllprocaddr(long str long) msvcrt._getdllprocaddr -@ cdecl _getdrive() msvcrt._getdrive -@ cdecl _getdrives() msvcrt._getdrives -@ cdecl _getmaxstdio() msvcrt._getmaxstdio -@ cdecl _getmbcp() msvcrt._getmbcp -@ cdecl _getpid() msvcrt._getpid -@ cdecl _getptd() msvcrt._getptd -@ cdecl _getsystime(ptr) msvcrt._getsystime -@ cdecl _getw(ptr) msvcrt._getw +@ 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 +@ cdecl _getptd() +@ stub _getsystime(ptr) +@ cdecl _getw(ptr) MSVCRT__getw @ stub _getwch @ stub _getwch_nolock @ stub _getwche @ stub _getwche_nolock -@ cdecl _getws(ptr) msvcrt._getws +@ cdecl _getws(ptr) MSVCRT__getws @ stub _getws_s -@ cdecl -arch=i386 _global_unwind2(ptr) msvcrt._global_unwind2 -@ 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 _heapadd(ptr long) msvcrt._heapadd -@ cdecl _heapchk() msvcrt._heapchk -@ cdecl _heapmin() msvcrt._heapmin -@ cdecl _heapset(long) msvcrt._heapset -@ cdecl _heapused(ptr ptr) msvcrt._heapused -@ cdecl _heapwalk(ptr) msvcrt._heapwalk -@ cdecl _hypot(double double) msvcrt._hypot -@ cdecl _hypotf(float float) msvcrt._hypotf -@ cdecl _i64toa(int64 ptr long) msvcrt._i64toa -@ cdecl _i64toa_s(int64 ptr long long) msvcrt._i64toa_s -@ cdecl _i64tow(int64 ptr long) msvcrt._i64tow -@ cdecl _i64tow_s(int64 ptr long long) msvcrt._i64tow_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 _heapadd(ptr long) +@ cdecl _heapchk() +@ cdecl _heapmin() +@ cdecl _heapset(long) +@ stub _heapused(ptr ptr) +@ 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 @ stub _initptd -@ cdecl _initterm(ptr ptr) msvcrt._initterm -@ cdecl _initterm_e(ptr ptr) msvcrt._initterm_e -@ cdecl -arch=i386 _inp(long) msvcrt._inp -@ cdecl -arch=i386 _inpd(long) msvcrt._inpd -@ cdecl -arch=i386 _inpw(long) msvcrt._inpw -@ cdecl _invalid_parameter(wstr wstr wstr long long) msvcrt._invalid_parameter -@ cdecl _invalid_parameter_noinfo() msvcr100._invalid_parameter_noinfo +@ cdecl _initterm(ptr ptr) +@ cdecl _initterm_e(ptr ptr) +@ stub -arch=i386 _inp(long) +@ stub -arch=i386 _inpd(long) +@ stub -arch=i386 _inpw(long) +@ cdecl _invalid_parameter(wstr wstr wstr long long) MSVCRT__invalid_parameter +@ cdecl _invalid_parameter_noinfo() @ stub _invoke_watson -@ extern _iob msvcrt._iob -@ cdecl _isalnum_l(long ptr) msvcrt._isalnum_l -@ cdecl _isalpha_l(long ptr) msvcrt._isalpha_l -@ cdecl _isatty(long) msvcrt._isatty -@ 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 -@ cdecl _ismbbalnum(long) msvcrt._ismbbalnum +@ extern _iob MSVCRT__iob +@ cdecl _isalnum_l(long ptr) MSVCRT__isalnum_l +@ cdecl _isalpha_l(long ptr) MSVCRT__isalpha_l +@ cdecl _isatty(long) MSVCRT__isatty +@ 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 -@ cdecl _ismbbalpha(long) msvcrt._ismbbalpha +@ stub _ismbbalpha(long) @ stub _ismbbalpha_l -@ cdecl _ismbbgraph(long) msvcrt._ismbbgraph +@ stub _ismbbgraph(long) @ stub _ismbbgraph_l -@ cdecl _ismbbkalnum(long) msvcrt._ismbbkalnum +@ stub _ismbbkalnum(long) @ stub _ismbbkalnum_l -@ cdecl _ismbbkana(long) msvcrt._ismbbkana +@ cdecl _ismbbkana(long) @ stub _ismbbkana_l -@ cdecl _ismbbkprint(long) msvcrt._ismbbkprint +@ stub _ismbbkprint(long) @ stub _ismbbkprint_l -@ cdecl _ismbbkpunct(long) msvcrt._ismbbkpunct +@ stub _ismbbkpunct(long) @ stub _ismbbkpunct_l -@ cdecl _ismbblead(long) msvcrt._ismbblead +@ cdecl _ismbblead(long) @ stub _ismbblead_l -@ cdecl _ismbbprint(long) msvcrt._ismbbprint +@ stub _ismbbprint(long) @ stub _ismbbprint_l -@ cdecl _ismbbpunct(long) msvcrt._ismbbpunct +@ stub _ismbbpunct(long) @ stub _ismbbpunct_l -@ cdecl _ismbbtrail(long) msvcrt._ismbbtrail +@ cdecl _ismbbtrail(long) @ stub _ismbbtrail_l -@ cdecl _ismbcalnum(long) msvcrt._ismbcalnum +@ cdecl _ismbcalnum(long) @ stub _ismbcalnum_l -@ cdecl _ismbcalpha(long) msvcrt._ismbcalpha +@ cdecl _ismbcalpha(long) @ stub _ismbcalpha_l -@ cdecl _ismbcdigit(long) msvcrt._ismbcdigit +@ cdecl _ismbcdigit(long) @ stub _ismbcdigit_l -@ cdecl _ismbcgraph(long) msvcrt._ismbcgraph +@ cdecl _ismbcgraph(long) @ stub _ismbcgraph_l -@ cdecl _ismbchira(long) msvcrt._ismbchira +@ cdecl _ismbchira(long) @ stub _ismbchira_l -@ cdecl _ismbckata(long) msvcrt._ismbckata +@ cdecl _ismbckata(long) @ stub _ismbckata_l -@ cdecl _ismbcl0(long) msvcrt._ismbcl0 +@ stub _ismbcl0(long) @ stub _ismbcl0_l -@ cdecl _ismbcl1(long) msvcrt._ismbcl1 +@ stub _ismbcl1(long) @ stub _ismbcl1_l -@ cdecl _ismbcl2(long) msvcrt._ismbcl2 +@ stub _ismbcl2(long) @ stub _ismbcl2_l -@ cdecl _ismbclegal(long) msvcrt._ismbclegal +@ cdecl _ismbclegal(long) @ stub _ismbclegal_l -@ cdecl _ismbclower(long) msvcrt._ismbclower +@ cdecl _ismbclower(long) @ stub _ismbclower_l -@ cdecl _ismbcprint(long) msvcrt._ismbcprint +@ cdecl _ismbcprint(long) @ stub _ismbcprint_l -@ cdecl _ismbcpunct(long) msvcrt._ismbcpunct +@ cdecl _ismbcpunct(long) @ stub _ismbcpunct_l -@ cdecl _ismbcspace(long) msvcrt._ismbcspace +@ cdecl _ismbcspace(long) @ stub _ismbcspace_l -@ cdecl _ismbcsymbol(long) msvcrt._ismbcsymbol +@ cdecl _ismbcsymbol(long) @ stub _ismbcsymbol_l -@ cdecl _ismbcupper(long) msvcrt._ismbcupper +@ cdecl _ismbcupper(long) @ stub _ismbcupper_l -@ cdecl _ismbslead(ptr ptr) msvcrt._ismbslead +@ cdecl _ismbslead(ptr ptr) @ stub _ismbslead_l -@ cdecl _ismbstrail(ptr ptr) msvcrt._ismbstrail +@ 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 +@ 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 +@ 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 +@ cdecl _iswalpha_l(long ptr) MSVCRT__iswalpha_l @ stub _iswcntrl_l @ stub _iswcsym_l @ stub _iswcsymf_l @ stub _iswctype_l -@ cdecl _iswdigit_l(long ptr) msvcrt._iswdigit_l +@ cdecl _iswdigit_l(long ptr) MSVCRT__iswdigit_l @ stub _iswgraph_l @ stub _iswlower_l @ stub _iswprint_l @@ -699,409 +699,409 @@ @ stub _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) msvcrt._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() msvcrt._kbhit -@ cdecl _lfind(ptr ptr ptr long ptr) msvcrt._lfind +@ 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() +@ cdecl _lfind(ptr ptr ptr long ptr) @ stub _lfind_s -@ cdecl _loaddll(str) msvcrt._loaddll -@ cdecl -arch=x86_64 _local_unwind(ptr ptr) msvcrt._local_unwind -@ cdecl -arch=i386 _local_unwind2(ptr long) msvcrt._local_unwind2 -@ cdecl -arch=i386 _local_unwind4(ptr ptr long) msvcrt._local_unwind4 -@ cdecl _localtime32(ptr) msvcrt._localtime32 -@ cdecl _localtime32_s(ptr ptr) msvcrt._localtime32_s -@ cdecl _localtime64(ptr) msvcrt._localtime64 -@ cdecl _localtime64_s(ptr ptr) msvcrt._localtime64_s -@ cdecl _lock(long) msvcrt._lock -@ cdecl _lock_file(ptr) msvcrt._lock_file -@ 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._longjmpex -@ cdecl _lrotl(long long) msvcrt._lrotl -@ cdecl _lrotr(long long) msvcrt._lrotr -@ cdecl _lsearch(ptr ptr ptr long ptr) msvcrt._lsearch +@ 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(long) +@ cdecl _lock_file(ptr) MSVCRT__lock_file +@ 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) msvcrt._ltoa -@ cdecl _ltoa_s(long ptr long long) msvcrt._ltoa_s -@ cdecl _ltow(long ptr long) msvcrt._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 -@ cdecl _malloc_crt(long) msvcrt.malloc -@ cdecl _mbbtombc(long) msvcrt._mbbtombc +@ 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 +@ cdecl _malloc_crt(long) MSVCRT_malloc +@ cdecl _mbbtombc(long) @ stub _mbbtombc_l -@ cdecl _mbbtype(long long) msvcrt._mbbtype +@ cdecl _mbbtype(long long) @ stub _mbbtype_l # extern _mbcasemap -@ cdecl _mbccpy(ptr str) msvcrt._mbccpy +@ cdecl _mbccpy(ptr str) @ stub _mbccpy_l @ stub _mbccpy_s @ stub _mbccpy_s_l -@ cdecl _mbcjistojms(long) msvcrt._mbcjistojms +@ cdecl _mbcjistojms(long) @ stub _mbcjistojms_l -@ cdecl _mbcjmstojis(long) msvcrt._mbcjmstojis +@ cdecl _mbcjmstojis(long) @ stub _mbcjmstojis_l -@ cdecl _mbclen(ptr) msvcrt._mbclen +@ cdecl _mbclen(ptr) @ stub _mbclen_l -@ cdecl _mbctohira(long) msvcrt._mbctohira +@ stub _mbctohira(long) @ stub _mbctohira_l -@ cdecl _mbctokata(long) msvcrt._mbctokata +@ stub _mbctokata(long) @ stub _mbctokata_l -@ cdecl _mbctolower(long) msvcrt._mbctolower +@ cdecl _mbctolower(long) @ stub _mbctolower_l -@ cdecl _mbctombb(long) msvcrt._mbctombb +@ cdecl _mbctombb(long) @ stub _mbctombb_l -@ cdecl _mbctoupper(long) msvcrt._mbctoupper +@ cdecl _mbctoupper(long) @ stub _mbctoupper_l -@ extern _mbctype msvcrt._mbctype +@ extern _mbctype MSVCRT_mbctype @ stub _mblen_l -@ cdecl _mbsbtype(str long) msvcrt._mbsbtype +@ cdecl _mbsbtype(str long) @ stub _mbsbtype_l @ stub _mbscat_s @ stub _mbscat_s_l -@ cdecl _mbschr(str long) msvcrt._mbschr +@ cdecl _mbschr(str long) @ stub _mbschr_l -@ cdecl _mbscmp(str str) msvcrt._mbscmp +@ cdecl _mbscmp(str str) @ stub _mbscmp_l -@ cdecl _mbscoll(str str) msvcrt._mbscoll -@ cdecl _mbscoll_l(str str ptr) msvcrt._mbscoll_l +@ cdecl _mbscoll(str str) +@ cdecl _mbscoll_l(str str ptr) @ stub _mbscpy_s @ stub _mbscpy_s_l -@ cdecl _mbscspn(str str) msvcrt._mbscspn +@ cdecl _mbscspn(str str) @ stub _mbscspn_l -@ cdecl _mbsdec(ptr ptr) msvcrt._mbsdec +@ cdecl _mbsdec(ptr ptr) @ stub _mbsdec_l -@ cdecl _mbsicmp(str str) msvcrt._mbsicmp +@ cdecl _mbsicmp(str str) @ stub _mbsicmp_l -@ cdecl _mbsicoll(str str) msvcrt._mbsicoll -@ cdecl _mbsicoll_l(str str ptr) msvcrt._mbsicoll_l -@ cdecl _mbsinc(str) msvcrt._mbsinc +@ cdecl _mbsicoll(str str) +@ cdecl _mbsicoll_l(str str ptr) +@ cdecl _mbsinc(str) @ stub _mbsinc_l -@ cdecl _mbslen(str) msvcrt._mbslen +@ cdecl _mbslen(str) @ stub _mbslen_l -@ cdecl _mbslwr(str) msvcrt._mbslwr +@ cdecl _mbslwr(str) @ stub _mbslwr_l -@ cdecl _mbslwr_s(str long) msvcrt._mbslwr_s +@ cdecl _mbslwr_s(str long) @ stub _mbslwr_s_l -@ cdecl _mbsnbcat(str str long) msvcrt._mbsnbcat +@ cdecl _mbsnbcat(str str long) @ stub _mbsnbcat_l -@ cdecl _mbsnbcat_s(str long ptr long) msvcrt._mbsnbcat_s +@ cdecl _mbsnbcat_s(str long ptr long) @ stub _mbsnbcat_s_l -@ cdecl _mbsnbcmp(str str long) msvcrt._mbsnbcmp +@ cdecl _mbsnbcmp(str str long) @ stub _mbsnbcmp_l -@ cdecl _mbsnbcnt(ptr long) msvcrt._mbsnbcnt +@ cdecl _mbsnbcnt(ptr long) @ stub _mbsnbcnt_l -@ cdecl _mbsnbcoll(str str long) msvcrt._mbsnbcoll -@ cdecl _mbsnbcoll_l(str str long ptr) msvcrt._mbsnbcoll_l -@ cdecl _mbsnbcpy(ptr str long) msvcrt._mbsnbcpy +@ 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) msvcrt._mbsnbcpy_s +@ cdecl _mbsnbcpy_s(ptr long str long) @ stub _mbsnbcpy_s_l -@ cdecl _mbsnbicmp(str str long) msvcrt._mbsnbicmp +@ cdecl _mbsnbicmp(str str long) @ stub _mbsnbicmp_l -@ cdecl _mbsnbicoll(str str long) msvcrt._mbsnbicoll -@ cdecl _mbsnbicoll_l(str str long ptr) msvcrt._mbsnbicoll_l -@ cdecl _mbsnbset(ptr long long) msvcrt._mbsnbset +@ 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) msvcrt._mbsncat +@ cdecl _mbsncat(str str long) @ stub _mbsncat_l @ stub _mbsncat_s @ stub _mbsncat_s_l -@ cdecl _mbsnccnt(str long) msvcrt._mbsnccnt +@ cdecl _mbsnccnt(str long) @ stub _mbsnccnt_l -@ cdecl _mbsncmp(str str long) msvcrt._mbsncmp +@ cdecl _mbsncmp(str str long) @ stub _mbsncmp_l -@ cdecl _mbsncoll(str str long) msvcrt._mbsncoll +@ stub _mbsncoll(str str long) @ stub _mbsncoll_l -@ cdecl _mbsncpy(ptr str long) msvcrt._mbsncpy +@ cdecl _mbsncpy(ptr str long) @ stub _mbsncpy_l @ stub _mbsncpy_s @ stub _mbsncpy_s_l -@ cdecl _mbsnextc(str) msvcrt._mbsnextc +@ cdecl _mbsnextc(str) @ stub _mbsnextc_l -@ cdecl _mbsnicmp(str str long) msvcrt._mbsnicmp +@ cdecl _mbsnicmp(str str long) @ stub _mbsnicmp_l -@ cdecl _mbsnicoll(str str long) msvcrt._mbsnicoll +@ stub _mbsnicoll(str str long) @ stub _mbsnicoll_l -@ cdecl _mbsninc(str long) msvcrt._mbsninc +@ cdecl _mbsninc(str long) @ stub _mbsninc_l @ stub _mbsnlen @ stub _mbsnlen_l -@ cdecl _mbsnset(ptr long long) msvcrt._mbsnset +@ cdecl _mbsnset(ptr long long) @ stub _mbsnset_l @ stub _mbsnset_s @ stub _mbsnset_s_l -@ cdecl _mbspbrk(str str) msvcrt._mbspbrk +@ cdecl _mbspbrk(str str) @ stub _mbspbrk_l -@ cdecl _mbsrchr(str long) msvcrt._mbsrchr +@ cdecl _mbsrchr(str long) @ stub _mbsrchr_l -@ cdecl _mbsrev(str) msvcrt._mbsrev +@ cdecl _mbsrev(str) @ stub _mbsrev_l -@ cdecl _mbsset(ptr long) msvcrt._mbsset +@ cdecl _mbsset(ptr long) @ stub _mbsset_l @ stub _mbsset_s @ stub _mbsset_s_l -@ cdecl _mbsspn(str str) msvcrt._mbsspn +@ cdecl _mbsspn(str str) @ stub _mbsspn_l -@ cdecl _mbsspnp(str str) msvcrt._mbsspnp +@ cdecl _mbsspnp(str str) @ stub _mbsspnp_l -@ cdecl _mbsstr(str str) msvcrt._mbsstr +@ cdecl _mbsstr(str str) @ stub _mbsstr_l -@ cdecl _mbstok(str str) msvcr100._mbstok #don't forward to msvcrt -@ cdecl _mbstok_l(str str ptr) msvcrt._mbstok_l -@ cdecl _mbstok_s(str str ptr) msvcrt._mbstok_s -@ cdecl _mbstok_s_l(str str ptr ptr) msvcrt._mbstok_s_l -@ 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) msvcrt._mbstrlen -@ cdecl _mbstrlen_l(str ptr) msvcrt._mbstrlen_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) msvcrt._mbsupr +@ cdecl _mbsupr(str) @ stub _mbsupr_l -@ cdecl _mbsupr_s(str long) msvcrt._mbsupr_s +@ 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) msvcrt._memccpy -@ cdecl _memicmp(str str long) msvcrt._memicmp +@ 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) msvcrt._msize -@ cdecl _nextafter(double double) msvcrt._nextafter -@ cdecl -arch=arm,x86_64 _nextafterf(float float) msvcrt._nextafterf -@ cdecl _onexit(ptr) msvcrt._onexit -@ varargs _open(str long) msvcrt._open -@ cdecl _open_osfhandle(long long) msvcrt._open_osfhandle -@ extern _osplatform msvcrt._osplatform -@ extern _osver msvcrt._osver -@ cdecl -arch=i386 _outp(long long) msvcrt._outp -@ cdecl -arch=i386 _outpd(long long) msvcrt._outpd -@ cdecl -arch=i386 _outpw(long long) msvcrt._outpw -@ cdecl _pclose(ptr) msvcrt._pclose -@ extern _pctype msvcrt._pctype -@ extern _pgmptr msvcrt._pgmptr -@ cdecl _pipe(ptr long long) msvcrt._pipe -@ cdecl _popen(str str) msvcrt._popen +@ 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 +@ cdecl _onexit(ptr) MSVCRT__onexit +@ varargs _open(str long) MSVCRT__open +@ cdecl _open_osfhandle(long long) MSVCRT__open_osfhandle +@ extern _osplatform MSVCRT__osplatform +@ extern _osver MSVCRT__osver +@ stub -arch=i386 _outp(long long) +@ stub -arch=i386 _outpd(long long) +@ stub -arch=i386 _outpw(long long) +@ cdecl _pclose(ptr) MSVCRT__pclose +@ extern _pctype MSVCRT__pctype +@ extern _pgmptr MSVCRT__pgmptr +@ cdecl _pipe(ptr long long) MSVCRT__pipe +@ cdecl _popen(str str) MSVCRT__popen @ stub _printf_l @ stub _printf_p @ stub _printf_p_l @ stub _printf_s_l -@ cdecl _purecall() msvcrt._purecall -@ cdecl _putch(long) msvcrt._putch +@ cdecl _purecall() +@ cdecl _putch(long) @ stub _putch_nolock -@ cdecl _putenv(str) msvcrt._putenv -@ cdecl _putenv_s(str str) msvcrt._putenv_s -@ cdecl _putw(long ptr) msvcrt._putw -@ cdecl _putwch(long) msvcrt._putwch +@ cdecl _putenv(str) +@ cdecl _putenv_s(str str) +@ cdecl _putw(long ptr) MSVCRT__putw +@ cdecl _putwch(long) MSVCRT__putwch @ stub _putwch_nolock -@ cdecl _putws(wstr) msvcrt._putws +@ cdecl _putws(wstr) MSVCRT__putws # extern _pwctype -@ cdecl _read(long ptr long) msvcrt._read -@ cdecl _realloc_crt(ptr long) msvcrt.realloc -@ cdecl _recalloc(ptr long long) msvcr100._recalloc +@ cdecl _read(long ptr long) MSVCRT__read +@ cdecl _realloc_crt(ptr long) MSVCRT_realloc +@ cdecl _recalloc(ptr long long) @ stub _recalloc_crt -@ cdecl _resetstkoflw() msvcrt._resetstkoflw -@ cdecl _rmdir(str) msvcrt._rmdir -@ cdecl _rmtmp() msvcrt._rmtmp -@ cdecl _rotl(long long) msvcrt._rotl -@ cdecl -ret64 _rotl64(int64 long) msvcrt._rotl64 -@ cdecl _rotr(long long) msvcrt._rotr -@ cdecl -ret64 _rotr64(int64 long) msvcrt._rotr64 -@ cdecl -arch=i386 _safe_fdiv() msvcrt._safe_fdiv -@ cdecl -arch=i386 _safe_fdivr() msvcrt._safe_fdivr -@ cdecl -arch=i386 _safe_fprem() msvcrt._safe_fprem -@ cdecl -arch=i386 _safe_fprem1() msvcrt._safe_fprem1 -@ cdecl _scalb(double long) msvcrt._scalb -@ cdecl -arch=arm,x86_64 _scalbf(float long) msvcrt._scalbf -@ varargs _scanf_l(str ptr) msvcrt._scanf_l -@ varargs _scanf_s_l(str ptr) msvcrt._scanf_s_l -@ varargs _scprintf(str) msvcrt._scprintf +@ 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 -arch=i386 _safe_fdiv() +@ cdecl -arch=i386 _safe_fdivr() +@ cdecl -arch=i386 _safe_fprem() +@ cdecl -arch=i386 _safe_fprem1() +@ cdecl _scalb(double long) MSVCRT__scalb +@ cdecl -arch=arm,x86_64 _scalbf(float long) MSVCRT__scalbf +@ varargs _scanf_l(str ptr) MSVCRT__scanf_l +@ varargs _scanf_s_l(str ptr) MSVCRT__scanf_s_l +@ varargs _scprintf(str) MSVCRT__scprintf @ stub _scprintf_l @ stub _scprintf_p @ stub _scprintf_p_l -@ varargs _scwprintf(wstr) msvcrt._scwprintf +@ varargs _scwprintf(wstr) MSVCRT__scwprintf @ stub _scwprintf_l @ stub _scwprintf_p @ stub _scwprintf_p_l -@ cdecl _searchenv(str str ptr) msvcrt._searchenv -@ cdecl _searchenv_s(str str ptr long) msvcrt._searchenv_s -@ stdcall -arch=i386 _seh_longjmp_unwind4(ptr) msvcrt._seh_longjmp_unwind4 -@ stdcall -arch=i386 _seh_longjmp_unwind(ptr) msvcrt._seh_longjmp_unwind -@ cdecl _set_SSE2_enable(long) msvcrt._set_SSE2_enable -@ cdecl _set_abort_behavior(long long) msvcrt._set_abort_behavior +@ cdecl _searchenv(str str ptr) MSVCRT__searchenv +@ cdecl _searchenv_s(str str ptr long) MSVCRT__searchenv_s +@ stdcall -arch=i386 _seh_longjmp_unwind4(ptr) +@ stdcall -arch=i386 _seh_longjmp_unwind(ptr) +@ cdecl _set_SSE2_enable(long) MSVCRT__set_SSE2_enable +@ cdecl _set_abort_behavior(long long) MSVCRT__set_abort_behavior @ stub _set_amblksiz -@ cdecl _set_controlfp(long long) msvcrt._set_controlfp -@ cdecl _set_doserrno(long) msvcrt._set_doserrno -@ cdecl _set_errno(long) msvcrt._set_errno -@ cdecl _set_error_mode(long) msvcrt._set_error_mode -@ cdecl _set_fmode(long) msvcrt._set_fmode -@ cdecl _set_invalid_parameter_handler(ptr) msvcrt._set_invalid_parameter_handler +@ 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) @ stub _set_malloc_crt_max_wait -@ cdecl _set_output_format(long) msvcrt._set_output_format -@ cdecl _set_printf_count_output(long) msvcrt._set_printf_count_output -@ cdecl _set_purecall_handler(ptr) msvcrt._set_purecall_handler -@ cdecl _set_sbh_threshold(long) msvcrt._set_sbh_threshold -@ cdecl _seterrormode(long) msvcrt._seterrormode -@ cdecl -arch=i386,x86_64,arm -norelay _setjmp(ptr) msvcrt._setjmp -@ cdecl -arch=i386 -norelay _setjmp3(ptr long) msvcrt._setjmp3 -@ cdecl -arch=x86_64,arm -norelay _setjmpex(ptr ptr) msvcrt._setjmpex -@ cdecl _setmaxstdio(long) msvcrt._setmaxstdio -@ cdecl _setmbcp(long) msvcrt._setmbcp -@ cdecl _setmode(long long) msvcrt._setmode -@ cdecl _setsystime(ptr long) msvcrt._setsystime -@ cdecl _sleep(long) msvcrt._sleep -@ varargs _snprintf(ptr long str) msvcrt._snprintf +@ cdecl _set_output_format(long) +@ cdecl _set_printf_count_output(long) MSVCRT__set_printf_count_output +@ cdecl _set_purecall_handler(ptr) +@ cdecl _set_sbh_threshold(long) +@ cdecl _seterrormode(long) +@ cdecl -arch=i386,x86_64,arm -norelay _setjmp(ptr) MSVCRT__setjmp +@ cdecl -arch=i386 -norelay _setjmp3(ptr long) MSVCRT__setjmp3 +@ cdecl -arch=x86_64,arm -norelay _setjmpex(ptr ptr) MSVCRT__setjmpex +@ cdecl _setmaxstdio(long) MSVCRT__setmaxstdio +@ cdecl _setmbcp(long) +@ cdecl _setmode(long long) MSVCRT__setmode +@ stub _setsystime(ptr long) +@ cdecl _sleep(long) MSVCRT__sleep +@ varargs _snprintf(ptr long str) MSVCRT__snprintf @ stub _snprintf_c @ stub _snprintf_c_l @ stub _snprintf_l -@ varargs _snprintf_s(ptr long long str) msvcrt._snprintf_s +@ varargs _snprintf_s(ptr long long str) MSVCRT__snprintf_s @ stub _snprintf_s_l -@ varargs _snscanf(str long str) msvcrt._snscanf -@ varargs _snscanf_l(str long str ptr) msvcrt._snscanf_l -@ varargs _snscanf_s(str long str) msvcrt._snscanf_s -@ varargs _snscanf_s_l(str long str ptr) msvcrt._snscanf_s_l -@ varargs _snwprintf(ptr long wstr) msvcrt._snwprintf -@ varargs _snwprintf_l(ptr long wstr ptr) msvcrt._snwprintf_l -@ varargs _snwprintf_s(ptr long long wstr) msvcrt._snwprintf_s -@ varargs _snwprintf_s_l(ptr long long wstr ptr) msvcrt._snwprintf_s_l -@ varargs _snwscanf(wstr long wstr) msvcrt._snwscanf -@ varargs _snwscanf_l(wstr long wstr ptr) msvcrt._snwscanf_l -@ varargs _snwscanf_s(wstr long wstr) msvcrt._snwscanf_s -@ varargs _snwscanf_s_l(wstr long wstr ptr) msvcrt._snwscanf_s_l -@ varargs _sopen(str long long) msvcrt._sopen -@ cdecl _sopen_s(ptr str long long long) msvcrt._sopen_s -@ varargs _spawnl(long str str) msvcrt._spawnl -@ varargs _spawnle(long str str) msvcrt._spawnle -@ varargs _spawnlp(long str str) msvcrt._spawnlp -@ varargs _spawnlpe(long str str) msvcrt._spawnlpe -@ cdecl _spawnv(long str ptr) msvcrt._spawnv -@ cdecl _spawnve(long str ptr ptr) msvcrt._spawnve -@ cdecl _spawnvp(long str ptr) msvcrt._spawnvp -@ 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 -@ varargs _sprintf_l(ptr str ptr) msvcrt._sprintf_l -@ varargs _sprintf_p(ptr long str) msvcr100._sprintf_p -@ varargs _sprintf_p_l(ptr long str ptr) msvcrt._sprintf_p_l -@ varargs _sprintf_s_l(ptr long str ptr) msvcrt._sprintf_s_l -@ varargs _sscanf_l(str str ptr) msvcrt._sscanf_l -@ varargs _sscanf_s_l(str str ptr) msvcrt._sscanf_s_l -@ cdecl _stat32(str ptr) msvcr100._stat32 -@ cdecl _stat32i64(str ptr) msvcr100._stat32i64 -@ cdecl _stat64(str ptr) msvcrt._stat64 -@ cdecl _stat64i32(str ptr) msvcr100._stat64i32 -@ cdecl _statusfp() msvcrt._statusfp -@ cdecl -arch=i386 _statusfp2(ptr ptr) msvcrt._statusfp2 -@ cdecl _strcoll_l(str str ptr) msvcrt._strcoll_l -@ cdecl _strdate(ptr) msvcrt._strdate -@ cdecl _strdate_s(ptr long) msvcrt._strdate_s -@ cdecl _strdup(str) msvcrt._strdup -@ cdecl _strerror(long) msvcrt._strerror +@ varargs _snscanf(str long str) MSVCRT__snscanf +@ varargs _snscanf_l(str long str ptr) MSVCRT__snscanf_l +@ varargs _snscanf_s(str long str) MSVCRT__snscanf_s +@ varargs _snscanf_s_l(str long str ptr) MSVCRT__snscanf_s_l +@ varargs _snwprintf(ptr long wstr) MSVCRT__snwprintf +@ varargs _snwprintf_l(ptr long wstr ptr) MSVCRT__snwprintf_l +@ varargs _snwprintf_s(ptr long long wstr) MSVCRT__snwprintf_s +@ varargs _snwprintf_s_l(ptr long long wstr ptr) MSVCRT__snwprintf_s_l +@ varargs _snwscanf(wstr long wstr) MSVCRT__snwscanf +@ varargs _snwscanf_l(wstr long wstr ptr) MSVCRT__snwscanf_l +@ varargs _snwscanf_s(wstr long wstr) MSVCRT__snwscanf_s +@ varargs _snwscanf_s_l(wstr long wstr ptr) MSVCRT__snwscanf_s_l +@ varargs _sopen(str long long) MSVCRT__sopen +@ 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 +@ varargs _sprintf_l(ptr str ptr) MSVCRT_sprintf_l +@ varargs _sprintf_p(ptr long str) MSVCRT__sprintf_p +@ varargs _sprintf_p_l(ptr long str ptr) MSVCRT_sprintf_p_l +@ varargs _sprintf_s_l(ptr long str ptr) MSVCRT_sprintf_s_l +@ varargs _sscanf_l(str str ptr) MSVCRT__sscanf_l +@ varargs _sscanf_s_l(str str ptr) MSVCRT__sscanf_s_l +@ 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) msvcrt._strlwr_l -@ 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 _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 @ stub _strnset_s -@ cdecl _strrev(str) msvcrt._strrev -@ cdecl _strset(str long) msvcrt._strset +@ cdecl _strrev(str) MSVCRT__strrev +@ cdecl _strset(str long) @ stub _strset_s -@ cdecl _strtime(ptr) msvcrt._strtime -@ cdecl _strtime_s(ptr long) msvcrt._strtime_s -@ cdecl _strtod_l(str ptr ptr) msvcrt._strtod_l -@ cdecl -ret64 _strtoi64(str ptr long) msvcrt._strtoi64 -@ cdecl -ret64 _strtoi64_l(str ptr long ptr) msvcrt._strtoi64_l +@ cdecl _strtime(ptr) MSVCRT__strtime +@ cdecl _strtime_s(ptr long) +@ cdecl _strtod_l(str ptr ptr) MSVCRT_strtod_l +@ cdecl -ret64 _strtoi64(str ptr long) MSVCRT_strtoi64 +@ cdecl -ret64 _strtoi64_l(str ptr long ptr) MSVCRT_strtoi64_l @ stub _strtol_l -@ cdecl -ret64 _strtoui64(str ptr long) msvcrt._strtoui64 -@ cdecl -ret64 _strtoui64_l(str ptr long ptr) msvcrt._strtoui64_l +@ cdecl -ret64 _strtoui64(str ptr long) MSVCRT_strtoui64 +@ cdecl -ret64 _strtoui64_l(str ptr long ptr) MSVCRT_strtoui64_l @ stub _strtoul_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 _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 @ stub _strxfrm_l -@ cdecl _swab(str str long) msvcrt._swab -@ varargs _swprintf(ptr wstr) msvcrt._swprintf +@ cdecl _swab(str str long) MSVCRT__swab +@ varargs _swprintf(ptr wstr) MSVCRT_swprintf @ stub _swprintf_c @ stub _swprintf_p -@ varargs _swprintf_p_l(ptr long wstr ptr) msvcrt._swprintf_p_l -@ varargs _swprintf_s_l(ptr long wstr ptr) msvcrt._swprintf_s_l -@ varargs _swscanf_l(wstr wstr ptr) msvcrt._swscanf_l -@ varargs _swscanf_s_l(wstr wstr ptr) msvcrt._swscanf_s_l -@ extern _sys_errlist msvcrt._sys_errlist -@ extern _sys_nerr msvcrt._sys_nerr -@ cdecl _tell(long) msvcrt._tell -@ cdecl -ret64 _telli64(long) msvcrt._telli64 -@ cdecl _tempnam(str str) msvcrt._tempnam -@ cdecl _time32(ptr) msvcrt._time32 -@ cdecl _time64(ptr) msvcrt._time64 -@ extern _timezone msvcrt._timezone -@ 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 -@ extern _tzname msvcrt._tzname -@ cdecl _tzset() msvcrt._tzset -@ cdecl _ui64toa(int64 ptr long) msvcrt._ui64toa -@ cdecl _ui64toa_s(int64 ptr long long) msvcrt._ui64toa_s -@ cdecl _ui64tow(int64 ptr long) msvcrt._ui64tow -@ cdecl _ui64tow_s(int64 ptr long long) msvcrt._ui64tow_s -@ cdecl _ultoa(long ptr long) msvcrt._ultoa -@ cdecl _ultoa_s(long ptr long long) msvcrt._ultoa_s -@ cdecl _ultow(long ptr long) msvcrt._ultow -@ cdecl _ultow_s(long ptr long long) msvcrt._ultow_s -@ cdecl _umask(long) msvcrt._umask +@ varargs _swprintf_p_l(ptr long wstr ptr) MSVCRT_swprintf_p_l +@ varargs _swprintf_s_l(ptr long wstr ptr) MSVCRT__swprintf_s_l +@ varargs _swscanf_l(wstr wstr ptr) MSVCRT__swscanf_l +@ varargs _swscanf_s_l(wstr wstr ptr) MSVCRT__swscanf_s_l +@ extern _sys_errlist MSVCRT__sys_errlist +@ extern _sys_nerr MSVCRT__sys_nerr +@ 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 +@ extern _timezone MSVCRT___timezone +@ 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 +@ extern _tzname MSVCRT__tzname +@ 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 @ stub _ungetc_nolock -@ cdecl _ungetch(long) msvcrt._ungetch +@ cdecl _ungetch(long) @ stub _ungetch_nolock @ stub _ungetwc_nolock @ stub _ungetwch @ stub _ungetwch_nolock -@ cdecl _unlink(str) msvcrt._unlink -@ cdecl _unloaddll(long) msvcrt._unloaddll -@ cdecl _unlock(long) msvcrt._unlock -@ cdecl _unlock_file(ptr) msvcrt._unlock_file -@ cdecl _utime32(str ptr) msvcrt._utime32 -@ cdecl _utime64(str ptr) msvcrt._utime64 -@ cdecl _vcprintf(str ptr) msvcrt._vcprintf +@ cdecl _unlink(str) MSVCRT__unlink +@ cdecl _unloaddll(long) +@ cdecl _unlock(long) +@ cdecl _unlock_file(ptr) MSVCRT__unlock_file +@ cdecl _utime32(str ptr) +@ cdecl _utime64(str ptr) +@ cdecl _vcprintf(str ptr) @ stub _vcprintf_l @ stub _vcprintf_p @ stub _vcprintf_p_l @ stub _vcprintf_s @ stub _vcprintf_s_l -@ cdecl _vcwprintf(wstr ptr) msvcrt._vcwprintf +@ cdecl _vcwprintf(wstr ptr) @ stub _vcwprintf_l @ stub _vcwprintf_p @ stub _vcwprintf_p_l @@ -1111,7 +1111,7 @@ @ stub _vfprintf_p @ stub _vfprintf_p_l @ stub _vfprintf_s_l -@ cdecl _vfwprintf_l(ptr wstr ptr ptr) msvcrt._vfwprintf_l +@ cdecl _vfwprintf_l(ptr wstr ptr ptr) MSVCRT__vfwprintf_l @ stub _vfwprintf_p @ stub _vfwprintf_p_l @ stub _vfwprintf_s_l @@ -1119,450 +1119,450 @@ @ stub _vprintf_p @ stub _vprintf_p_l @ stub _vprintf_s_l -@ cdecl _vscprintf(str ptr) msvcrt._vscprintf +@ cdecl _vscprintf(str ptr) MSVCRT__vscprintf @ stub _vscprintf_l @ stub _vscprintf_p @ stub _vscprintf_p_l -@ cdecl _vscwprintf(wstr ptr) msvcrt._vscwprintf -@ cdecl _vscwprintf_l(wstr ptr ptr) msvcrt._vscwprintf_l -@ cdecl _vscwprintf_p(wstr ptr) msvcr100._vscwprintf_p -@ cdecl _vscwprintf_p_l(wstr ptr ptr) msvcrt._vscwprintf_p_l -@ cdecl _vsnprintf(ptr long str ptr) msvcrt._vsnprintf -@ cdecl _vsnprintf_c(ptr long str ptr) msvcrt._vsnprintf_c -@ cdecl _vsnprintf_c_l(ptr long str ptr ptr) msvcrt._vsnprintf_c_l -@ cdecl _vsnprintf_l(ptr long str ptr ptr) msvcrt._vsnprintf_l -@ cdecl _vsnprintf_s(ptr long long str ptr) msvcrt._vsnprintf_s -@ cdecl _vsnprintf_s_l(ptr long long str ptr ptr) msvcrt._vsnprintf_s_l -@ cdecl _vsnwprintf(ptr long wstr ptr) msvcrt._vsnwprintf -@ cdecl _vsnwprintf_l(ptr long wstr ptr ptr) msvcrt._vsnwprintf_l -@ cdecl _vsnwprintf_s(ptr long long wstr ptr) msvcrt._vsnwprintf_s -@ cdecl _vsnwprintf_s_l(ptr long long wstr ptr ptr) msvcrt._vsnwprintf_s_l -@ cdecl _vsprintf_l(ptr str ptr ptr) msvcrt._vsprintf_l -@ cdecl _vsprintf_p(ptr long str ptr) msvcrt._vsprintf_p -@ cdecl _vsprintf_p_l(ptr long str ptr ptr) msvcrt._vsprintf_p_l -@ cdecl _vsprintf_s_l(ptr long str ptr ptr) msvcrt._vsprintf_s_l -@ cdecl _vswprintf(ptr wstr ptr) msvcrt._vswprintf -@ cdecl _vswprintf_c(ptr long wstr ptr) msvcrt._vswprintf_c -@ cdecl _vswprintf_c_l(ptr long wstr ptr ptr) msvcrt._vswprintf_c_l -@ cdecl _vswprintf_l(ptr wstr ptr ptr) msvcrt._vswprintf_l -@ cdecl _vswprintf_p(ptr long wstr ptr) msvcr100._vswprintf_p -@ cdecl _vswprintf_p_l(ptr long wstr ptr ptr) msvcrt._vswprintf_p_l -@ cdecl _vswprintf_s_l(ptr long wstr ptr ptr) msvcrt._vswprintf_s_l +@ cdecl _vscwprintf(wstr ptr) MSVCRT__vscwprintf +@ cdecl _vscwprintf_l(wstr ptr ptr) MSVCRT__vscwprintf_l +@ cdecl _vscwprintf_p(wstr ptr) MSVCRT__vscwprintf_p +@ cdecl _vscwprintf_p_l(wstr ptr ptr) MSVCRT__vscwprintf_p_l +@ cdecl _vsnprintf(ptr long str ptr) MSVCRT_vsnprintf +@ cdecl _vsnprintf_c(ptr long str ptr) MSVCRT_vsnprintf +@ cdecl _vsnprintf_c_l(ptr long str ptr ptr) MSVCRT_vsnprintf_l +@ cdecl _vsnprintf_l(ptr long str ptr ptr) MSVCRT_vsnprintf_l +@ cdecl _vsnprintf_s(ptr long long str ptr) MSVCRT_vsnprintf_s +@ cdecl _vsnprintf_s_l(ptr long long str ptr ptr) MSVCRT_vsnprintf_s_l +@ cdecl _vsnwprintf(ptr long wstr ptr) MSVCRT_vsnwprintf +@ cdecl _vsnwprintf_l(ptr long wstr ptr ptr) MSVCRT_vsnwprintf_l +@ cdecl _vsnwprintf_s(ptr long long wstr ptr) MSVCRT_vsnwprintf_s +@ cdecl _vsnwprintf_s_l(ptr long long wstr ptr ptr) MSVCRT_vsnwprintf_s_l +@ cdecl _vsprintf_l(ptr str ptr ptr) MSVCRT_vsprintf_l +@ cdecl _vsprintf_p(ptr long str ptr) MSVCRT_vsprintf_p +@ cdecl _vsprintf_p_l(ptr long str ptr ptr) MSVCRT_vsprintf_p_l +@ cdecl _vsprintf_s_l(ptr long str ptr ptr) MSVCRT_vsprintf_s_l +@ cdecl _vswprintf(ptr wstr ptr) MSVCRT_vswprintf +@ cdecl _vswprintf_c(ptr long wstr ptr) MSVCRT_vsnwprintf +@ cdecl _vswprintf_c_l(ptr long wstr ptr ptr) MSVCRT_vsnwprintf_l +@ cdecl _vswprintf_l(ptr wstr ptr ptr) MSVCRT_vswprintf_l +@ cdecl _vswprintf_p(ptr long wstr ptr) MSVCRT__vswprintf_p +@ cdecl _vswprintf_p_l(ptr long wstr ptr ptr) MSVCRT_vswprintf_p_l +@ cdecl _vswprintf_s_l(ptr long wstr ptr ptr) MSVCRT_vswprintf_s_l @ stub _vwprintf_l @ stub _vwprintf_p @ stub _vwprintf_p_l @ stub _vwprintf_s_l -@ 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 -@ extern _wcmdln msvcrt._wcmdln -@ cdecl _wcreat(wstr long) msvcrt._wcreat -@ 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 +@ 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 +@ extern _wcmdln MSVCRT__wcmdln +@ cdecl _wcreat(wstr long) MSVCRT__wcreat +@ 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 _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) ntdll._wcslwr @ stub _wcslwr_l -@ cdecl _wcslwr_s(wstr long) msvcrt._wcslwr_s +@ cdecl _wcslwr_s(wstr long) MSVCRT__wcslwr_s @ stub _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 _wcsncoll(wstr wstr long) MSVCRT__wcsncoll +@ cdecl _wcsncoll_l(wstr wstr long ptr) MSVCRT__wcsncoll_l +@ cdecl _wcsnicmp(wstr wstr long) MSVCRT__wcsnicmp @ stub _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 +@ 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 _wcsrev(wstr) MSVCRT__wcsrev +@ cdecl _wcsset(wstr long) MSVCRT__wcsset @ stub _wcsset_s -@ cdecl _wcstod_l(wstr ptr) msvcrt._wcstod_l -@ cdecl -ret64 _wcstoi64(wstr ptr long) msvcrt._wcstoi64 -@ cdecl -ret64 _wcstoi64_l(wstr ptr long ptr) msvcrt._wcstoi64_l -@ cdecl _wcstol_l(wstr ptr long ptr) msvcrt._wcstol_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 -@ cdecl _wcsupr(wstr) msvcrt._wcsupr -@ stub _wcsupr_l -@ cdecl _wcsupr_s(wstr long) msvcrt._wcsupr_s -@ cdecl _wcsupr_s_l(wstr long ptr) msvcrt._wcsupr_s_l +@ cdecl _wcstod_l(wstr ptr) MSVCRT__wcstod_l +@ cdecl -ret64 _wcstoi64(wstr ptr long) MSVCRT__wcstoi64 +@ cdecl -ret64 _wcstoi64_l(wstr ptr long ptr) MSVCRT__wcstoi64_l +@ cdecl _wcstol_l(wstr ptr long ptr) MSVCRT__wcstol_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 +@ 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 @ stub _wcsxfrm_l -@ cdecl _wctime32(ptr) msvcrt._wctime32 +@ cdecl _wctime32(ptr) MSVCRT__wctime32 @ stub _wctime32_s -@ cdecl _wctime64(ptr) msvcrt._wctime64 +@ 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 +@ cdecl _wctomb_l(ptr long ptr) MSVCRT__wctomb_l +@ cdecl _wctomb_s_l(ptr ptr long long ptr) MSVCRT__wctomb_s_l # extern _wctype -@ cdecl _wdupenv_s(ptr ptr wstr) msvcrt._wdupenv_s -@ extern _wenviron msvcrt._wenviron -@ varargs _wexecl(wstr wstr) msvcrt._wexecl -@ varargs _wexecle(wstr wstr) msvcrt._wexecle -@ varargs _wexeclp(wstr wstr) msvcrt._wexeclp -@ varargs _wexeclpe(wstr wstr) msvcrt._wexeclpe -@ cdecl _wexecv(wstr ptr) msvcrt._wexecv -@ cdecl _wexecve(wstr ptr ptr) msvcrt._wexecve -@ cdecl _wexecvp(wstr ptr) msvcrt._wexecvp -@ cdecl _wexecvpe(wstr ptr ptr) msvcrt._wexecvpe -@ cdecl _wfdopen(long wstr) msvcrt._wfdopen -@ cdecl _wfindfirst32(wstr ptr) msvcrt._wfindfirst32 +@ cdecl _wdupenv_s(ptr ptr wstr) +@ extern _wenviron MSVCRT__wenviron +@ 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 +@ 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 _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 @ stub _wgetdcwd_nolock -@ cdecl _wgetenv(wstr) msvcrt._wgetenv -@ cdecl _wgetenv_s(ptr ptr long wstr) msvcrt._wgetenv_s -@ extern _winmajor msvcrt._winmajor -@ extern _winminor msvcrt._winminor -@ extern _winver msvcrt._winver -@ 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 -@ cdecl _wperror(wstr) msvcrt._wperror -@ extern _wpgmptr msvcrt._wpgmptr -@ cdecl _wpopen(wstr wstr) msvcrt._wpopen +@ cdecl _wgetenv(wstr) MSVCRT__wgetenv +@ cdecl _wgetenv_s(ptr ptr long wstr) +@ extern _winmajor MSVCRT__winmajor +@ extern _winminor MSVCRT__winminor +@ extern _winver MSVCRT__winver +@ 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) +@ extern _wpgmptr MSVCRT__wpgmptr +@ cdecl _wpopen(wstr wstr) MSVCRT__wpopen @ stub _wprintf_l @ stub _wprintf_p @ stub _wprintf_p_l @ stub _wprintf_s_l -@ cdecl _wputenv(wstr) msvcrt._wputenv -@ cdecl _wputenv_s(wstr wstr) msvcrt._wputenv_s -@ cdecl _wremove(wstr) msvcrt._wremove -@ cdecl _wrename(wstr wstr) msvcrt._wrename -@ cdecl _write(long ptr long) msvcrt._write -@ cdecl _wrmdir(wstr) msvcrt._wrmdir -@ varargs _wscanf_l(wstr ptr) msvcrt._wscanf_l -@ varargs _wscanf_s_l(wstr ptr) msvcrt._wscanf_s_l -@ 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 -@ cdecl _wsopen_s(ptr wstr long long long) msvcrt._wsopen_s -@ varargs _wspawnl(long wstr wstr) msvcrt._wspawnl -@ varargs _wspawnle(long wstr wstr) msvcrt._wspawnle -@ varargs _wspawnlp(long wstr wstr) msvcrt._wspawnlp -@ varargs _wspawnlpe(long wstr wstr) msvcrt._wspawnlpe -@ cdecl _wspawnv(long wstr ptr) msvcrt._wspawnv -@ cdecl _wspawnve(long wstr ptr ptr) msvcrt._wspawnve -@ cdecl _wspawnvp(long wstr ptr) msvcrt._wspawnvp -@ 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) msvcr100._wstat32 -@ cdecl _wstat32i64(wstr ptr) msvcr100._wstat32i64 -@ cdecl _wstat64(wstr ptr) msvcrt._wstat64 -@ cdecl _wstat64i32(wstr ptr) msvcr100._wstat64i32 -@ cdecl _wstrdate(ptr) msvcrt._wstrdate -@ cdecl _wstrdate_s(ptr long) msvcrt._wstrdate_s -@ cdecl _wstrtime(ptr) msvcrt._wstrtime -@ cdecl _wstrtime_s(ptr long) msvcrt._wstrtime_s -@ cdecl _wsystem(wstr) msvcrt._wsystem -@ cdecl _wtempnam(wstr wstr) msvcrt._wtempnam -@ cdecl _wtmpnam(ptr) msvcrt._wtmpnam +@ 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 +@ varargs _wscanf_l(wstr ptr) MSVCRT__wscanf_l +@ varargs _wscanf_s_l(wstr ptr) MSVCRT__wscanf_s_l +@ 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 +@ 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 -@ cdecl _wunlink(wstr) msvcrt._wunlink -@ cdecl _wutime32(wstr ptr) msvcrt._wutime32 -@ cdecl _wutime64(wstr ptr) msvcrt._wutime64 -@ 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 -@ 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 -@ cdecl atan(double) msvcrt.atan -@ cdecl -arch=arm,x86_64 atanf(float) msvcrt.atanf -@ cdecl atan2(double double) msvcrt.atan2 -@ cdecl -arch=arm,x86_64 atan2f(float float) msvcrt.atan2f -@ cdecl atexit(ptr) msvcrt.atexit -@ cdecl atof(str) msvcrt.atof -@ cdecl atoi(str) msvcr100.atoi #don't forward to msvcrt -@ cdecl atol(str) msvcrt.atol -@ 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 -@ cdecl calloc(long long) msvcrt.calloc -@ cdecl ceil(double) msvcrt.ceil -@ cdecl -arch=arm,x86_64 ceilf(float) msvcrt.ceilf -@ cdecl clearerr(ptr) msvcrt.clearerr +@ 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 +@ 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 +@ 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 +@ cdecl atan(double) MSVCRT_atan +@ cdecl -arch=arm,x86_64 atanf(float) MSVCRT_atanf +@ cdecl atan2(double double) MSVCRT_atan2 +@ cdecl -arch=arm,x86_64 atan2f(float float) MSVCRT_atan2f +@ cdecl atexit(ptr) MSVCRT_atexit +@ cdecl atof(str) MSVCRT_atof +@ cdecl atoi(str) MSVCRT_atoi +@ cdecl atol(str) ntdll.atol +@ 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 +@ cdecl calloc(long long) MSVCRT_calloc +@ cdecl ceil(double) MSVCRT_ceil +@ cdecl -arch=arm,x86_64 ceilf(float) MSVCRT_ceilf +@ cdecl clearerr(ptr) MSVCRT_clearerr @ stub clearerr_s -@ cdecl clock() msvcrt.clock -@ 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 -@ cdecl -ret64 div(long long) msvcrt.div -@ cdecl exit(long) msvcrt.exit -@ cdecl exp(double) msvcrt.exp -@ cdecl -arch=arm,x86_64 expf(float) msvcrt.expf -@ cdecl fabs(double) msvcrt.fabs -@ cdecl fclose(ptr) msvcrt.fclose -@ cdecl feof(ptr) msvcrt.feof -@ cdecl ferror(ptr) msvcrt.ferror -@ 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 -@ 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 -@ varargs fprintf(ptr str) msvcrt.fprintf -@ varargs fprintf_s(ptr str) msvcrt.fprintf_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 -@ varargs fscanf(ptr str) msvcrt.fscanf -@ varargs fscanf_s(ptr str) msvcrt.fscanf_s -@ cdecl fseek(ptr long long) msvcrt.fseek -@ cdecl fsetpos(ptr ptr) msvcrt.fsetpos -@ cdecl ftell(ptr) msvcrt.ftell -@ varargs fwprintf(ptr wstr) msvcrt.fwprintf -@ varargs fwprintf_s(ptr wstr) msvcrt.fwprintf_s -@ cdecl fwrite(ptr long long ptr) msvcrt.fwrite -@ varargs fwscanf(ptr wstr) msvcrt.fwscanf -@ varargs fwscanf_s(ptr wstr) msvcrt.fwscanf_s -@ cdecl getc(ptr) msvcrt.getc -@ cdecl getchar() msvcrt.getchar -@ cdecl getenv(str) msvcrt.getenv -@ cdecl getenv_s(ptr ptr long str) msvcrt.getenv_s -@ cdecl gets(str) msvcrt.gets +@ cdecl clock() MSVCRT_clock +@ 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 +@ cdecl -ret64 div(long long) MSVCRT_div +@ cdecl exit(long) MSVCRT_exit +@ cdecl exp(double) MSVCRT_exp +@ cdecl -arch=arm,x86_64 expf(float) MSVCRT_expf +@ cdecl fabs(double) MSVCRT_fabs +@ cdecl fclose(ptr) MSVCRT_fclose +@ cdecl feof(ptr) MSVCRT_feof +@ cdecl ferror(ptr) MSVCRT_ferror +@ 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 +@ 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 +@ varargs fprintf(ptr str) MSVCRT_fprintf +@ varargs fprintf_s(ptr str) MSVCRT_fprintf_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 +@ varargs fscanf(ptr str) MSVCRT_fscanf +@ varargs fscanf_s(ptr str) MSVCRT_fscanf_s +@ cdecl fseek(ptr long long) MSVCRT_fseek +@ cdecl fsetpos(ptr ptr) MSVCRT_fsetpos +@ cdecl ftell(ptr) MSVCRT_ftell +@ varargs fwprintf(ptr wstr) MSVCRT_fwprintf +@ varargs fwprintf_s(ptr wstr) MSVCRT_fwprintf_s +@ cdecl fwrite(ptr long long ptr) MSVCRT_fwrite +@ varargs fwscanf(ptr wstr) MSVCRT_fwscanf +@ varargs fwscanf_s(ptr wstr) MSVCRT_fwscanf_s +@ 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 -@ cdecl is_wctype(long long) msvcrt.is_wctype -@ cdecl isalnum(long) msvcrt.isalnum -@ cdecl isalpha(long) msvcrt.isalpha -@ 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) msvcrt.iswalpha -@ cdecl iswascii(long) msvcrt.iswascii -@ cdecl iswcntrl(long) msvcrt.iswcntrl -@ cdecl iswctype(long long) msvcrt.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 -@ cdecl localeconv() msvcrt.localeconv -@ cdecl log(double) msvcrt.log -@ cdecl -arch=arm,x86_64 logf(float) msvcrt.logf -@ cdecl log10(double) msvcrt.log10 -@ cdecl -arch=arm,x86_64 log10f(float) msvcrt.log10f -@ cdecl -arch=i386,x86_64,arm longjmp(ptr long) msvcrt.longjmp -@ cdecl malloc(long) msvcrt.malloc -@ cdecl mblen(ptr long) msvcrt.mblen -@ cdecl mbrlen(ptr long ptr) msvcrt.mbrlen -@ cdecl mbrtowc(ptr str long ptr) msvcrt.mbrtowc -@ cdecl mbsrtowcs(ptr ptr long ptr) msvcrt.mbsrtowcs +@ cdecl getwc(ptr) MSVCRT_getwc +@ cdecl getwchar() MSVCRT_getwchar +@ cdecl is_wctype(long long) ntdll.iswctype +@ cdecl isalnum(long) MSVCRT_isalnum +@ cdecl isalpha(long) MSVCRT_isalpha +@ 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 +@ 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 +@ cdecl localeconv() MSVCRT_localeconv +@ cdecl log(double) MSVCRT_log +@ cdecl -arch=arm,x86_64 logf(float) MSVCRT_logf +@ cdecl log10(double) MSVCRT_log10 +@ cdecl -arch=arm,x86_64 log10f(float) MSVCRT_log10f +@ cdecl -arch=i386,x86_64,arm longjmp(ptr long) MSVCRT_longjmp +@ cdecl malloc(long) MSVCRT_malloc +@ cdecl mblen(ptr long) MSVCRT_mblen +@ cdecl mbrlen(ptr long ptr) MSVCRT_mbrlen +@ 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 -@ cdecl perror(str) msvcrt.perror -@ cdecl pow(double double) msvcrt.pow -@ cdecl -arch=arm,x86_64 powf(float float) msvcrt.powf -@ varargs printf(str) msvcrt.printf -@ varargs printf_s(str) msvcrt.printf_s -@ cdecl putc(long ptr) msvcrt.putc -@ cdecl putchar(long) msvcrt.putchar -@ cdecl puts(str) msvcrt.puts -@ cdecl putwc(long ptr) msvcrt.putwc -@ cdecl putwchar(long) msvcrt.putwchar -@ cdecl qsort(ptr long long ptr) msvcrt.qsort -@ cdecl qsort_s(ptr long long ptr ptr) msvcrt.qsort_s -@ cdecl raise(long) msvcrt.raise -@ cdecl rand() msvcrt.rand -@ cdecl rand_s(ptr) msvcrt.rand_s -@ cdecl realloc(ptr long) msvcrt.realloc -@ cdecl remove(str) msvcrt.remove -@ cdecl rename(str str) msvcrt.rename -@ cdecl rewind(ptr) msvcrt.rewind -@ varargs scanf(str) msvcrt.scanf -@ varargs scanf_s(str) msvcrt.scanf_s -@ 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 -@ varargs sprintf(ptr str) msvcrt.sprintf -@ varargs sprintf_s(ptr long str) msvcrt.sprintf_s -@ cdecl sqrt(double) msvcrt.sqrt -@ cdecl -arch=arm,x86_64 sqrtf(float) msvcrt.sqrtf -@ cdecl srand(long) msvcrt.srand -@ varargs sscanf(str str) msvcrt.sscanf -@ varargs sscanf_s(str str) msvcrt.sscanf_s -@ cdecl strcat(str str) msvcrt.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) msvcrt.strcpy -@ cdecl strcpy_s(ptr long str) msvcrt.strcpy_s -@ cdecl strcspn(str str) msvcrt.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) msvcrt.strpbrk -@ cdecl strrchr(str long) msvcrt.strrchr -@ cdecl strspn(str str) msvcrt.strspn -@ cdecl strstr(str str) msvcrt.strstr -@ cdecl strtod(str ptr) msvcrt.strtod -@ cdecl strtok(str str) msvcrt.strtok -@ cdecl strtok_s(ptr str ptr) msvcrt.strtok_s -@ cdecl strtol(str ptr long) msvcrt.strtol -@ cdecl strtoul(str ptr long) msvcrt.strtoul -@ cdecl strxfrm(ptr str long) msvcrt.strxfrm -@ varargs swprintf_s(ptr long wstr) msvcrt.swprintf_s -@ varargs swscanf(wstr wstr) msvcrt.swscanf -@ varargs swscanf_s(wstr wstr) msvcrt.swscanf_s -@ 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 tmpfile() msvcrt.tmpfile -@ cdecl tmpfile_s(ptr) msvcrt.tmpfile_s -@ cdecl tmpnam(ptr) msvcrt.tmpnam +@ 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 +@ cdecl perror(str) MSVCRT_perror +@ cdecl pow(double double) MSVCRT_pow +@ cdecl -arch=arm,x86_64 powf(float float) MSVCRT_powf +@ varargs printf(str) MSVCRT_printf +@ varargs printf_s(str) MSVCRT_printf_s +@ 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 +@ cdecl raise(long) MSVCRT_raise +@ cdecl rand() MSVCRT_rand +@ cdecl rand_s(ptr) MSVCRT_rand_s +@ cdecl realloc(ptr long) MSVCRT_realloc +@ cdecl remove(str) MSVCRT_remove +@ cdecl rename(str str) MSVCRT_rename +@ cdecl rewind(ptr) MSVCRT_rewind +@ varargs scanf(str) MSVCRT_scanf +@ varargs scanf_s(str) MSVCRT_scanf_s +@ 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 +@ varargs sprintf(ptr str) MSVCRT_sprintf +@ varargs sprintf_s(ptr long str) MSVCRT_sprintf_s +@ cdecl sqrt(double) MSVCRT_sqrt +@ cdecl -arch=arm,x86_64 sqrtf(float) MSVCRT_sqrtf +@ cdecl srand(long) MSVCRT_srand +@ varargs sscanf(str str) MSVCRT_sscanf +@ varargs sscanf_s(str str) MSVCRT_sscanf_s +@ 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 +@ cdecl strtok(str str) MSVCRT_strtok +@ cdecl strtok_s(ptr str ptr) MSVCRT_strtok_s +@ cdecl strtol(str ptr long) MSVCRT_strtol +@ cdecl strtoul(str ptr long) MSVCRT_strtoul +@ cdecl strxfrm(ptr str long) MSVCRT_strxfrm +@ varargs swprintf_s(ptr long wstr) MSVCRT_swprintf_s +@ varargs swscanf(wstr wstr) MSVCRT_swscanf +@ varargs swscanf_s(wstr wstr) MSVCRT_swscanf_s +@ 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 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 -@ cdecl towlower(long) msvcrt.towlower -@ cdecl towupper(long) msvcrt.towupper -@ cdecl ungetc(long ptr) msvcrt.ungetc -@ cdecl ungetwc(long ptr) msvcrt.ungetwc -@ cdecl vfprintf(ptr str ptr) msvcrt.vfprintf -@ cdecl vfprintf_s(ptr str ptr) msvcrt.vfprintf_s -@ cdecl vfwprintf(ptr wstr ptr) msvcrt.vfwprintf -@ cdecl vfwprintf_s(ptr wstr ptr) msvcrt.vfwprintf_s -@ cdecl vprintf(str ptr) msvcrt.vprintf -@ cdecl vprintf_s(str ptr) msvcrt.vprintf_s -@ cdecl vsprintf(ptr str ptr) msvcrt.vsprintf -@ cdecl vsprintf_s(ptr long str ptr) msvcrt.vsprintf_s -@ cdecl vswprintf_s(ptr long wstr ptr) msvcrt.vswprintf_s -@ cdecl vwprintf(wstr ptr) msvcrt.vwprintf -@ cdecl vwprintf_s(wstr ptr) msvcrt.vwprintf_s -@ cdecl wcrtomb(ptr long ptr) msvcrt.wcrtomb +@ cdecl tolower(long) MSVCRT_tolower +@ cdecl toupper(long) MSVCRT_toupper +@ cdecl towlower(long) MSVCRT_towlower +@ cdecl towupper(long) MSVCRT_towupper +@ cdecl ungetc(long ptr) MSVCRT_ungetc +@ cdecl ungetwc(long ptr) MSVCRT_ungetwc +@ cdecl vfprintf(ptr str ptr) MSVCRT_vfprintf +@ cdecl vfprintf_s(ptr str ptr) MSVCRT_vfprintf_s +@ cdecl vfwprintf(ptr wstr ptr) MSVCRT_vfwprintf +@ cdecl vfwprintf_s(ptr wstr ptr) MSVCRT_vfwprintf_s +@ cdecl vprintf(str ptr) MSVCRT_vprintf +@ cdecl vprintf_s(str ptr) MSVCRT_vprintf_s +@ cdecl vsprintf(ptr str ptr) MSVCRT_vsprintf +@ cdecl vsprintf_s(ptr long str ptr) MSVCRT_vsprintf_s +@ cdecl vswprintf_s(ptr long wstr ptr) MSVCRT_vswprintf_s +@ cdecl vwprintf(wstr ptr) MSVCRT_vwprintf +@ cdecl vwprintf_s(wstr ptr) MSVCRT_vwprintf_s +@ cdecl wcrtomb(ptr long ptr) MSVCRT_wcrtomb @ stub wcrtomb_s -@ cdecl wcscat(wstr wstr) msvcrt.wcscat -@ cdecl wcscat_s(wstr long wstr) msvcrt.wcscat_s -@ cdecl wcschr(wstr long) msvcrt.wcschr -@ cdecl wcscmp(wstr wstr) msvcrt.wcscmp -@ cdecl wcscoll(wstr wstr) msvcrt.wcscoll -@ cdecl wcscpy(ptr wstr) msvcrt.wcscpy -@ cdecl wcscpy_s(ptr long wstr) msvcrt.wcscpy_s -@ cdecl wcscspn(wstr wstr) msvcrt.wcscspn -@ cdecl wcsftime(ptr long wstr ptr) msvcrt.wcsftime -@ cdecl wcslen(wstr) msvcrt.wcslen -@ cdecl wcsncat(wstr wstr long) msvcrt.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) msvcrt.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) msvcrt.wcsspn -@ cdecl wcsstr(wstr wstr) msvcrt.wcsstr -@ cdecl wcstod(wstr ptr) msvcrt.wcstod -@ cdecl wcstok(wstr wstr) msvcrt.wcstok -@ cdecl wcstok_s(ptr wstr ptr) msvcrt.wcstok_s -@ cdecl wcstol(wstr ptr long) msvcrt.wcstol -@ 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 -@ 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 -@ varargs wprintf(wstr) msvcrt.wprintf -@ varargs wprintf_s(wstr) msvcrt.wprintf_s -@ varargs wscanf(wstr) msvcrt.wscanf -@ varargs wscanf_s(wstr) msvcrt.wscanf_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 +@ cdecl wcstok(wstr wstr) MSVCRT_wcstok +@ cdecl wcstok_s(ptr wstr ptr) MSVCRT_wcstok_s +@ cdecl wcstol(wstr ptr long) ntdll.wcstol +@ 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 wcsxfrm(ptr wstr long) +@ cdecl wctob(long) MSVCRT_wctob +@ cdecl wctomb(ptr long) MSVCRT_wctomb +@ cdecl wctomb_s(ptr ptr long long) MSVCRT_wctomb_s +@ varargs wprintf(wstr) MSVCRT_wprintf +@ varargs wprintf_s(wstr) MSVCRT_wprintf_s +@ varargs wscanf(wstr) MSVCRT_wscanf +@ varargs wscanf_s(wstr) MSVCRT_wscanf_s diff -Nru wine1.7-1.7.14/dlls/msvcr90/Makefile.in wine1.7-1.7.18/dlls/msvcr90/Makefile.in --- wine1.7-1.7.14/dlls/msvcr90/Makefile.in 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msvcr90/Makefile.in 2014-05-02 18:15:48.000000000 +0000 @@ -1,8 +1,36 @@ +EXTRADEFS = -D_MT -D_MSVCR_VER=90 MODULE = msvcr90.dll IMPORTLIB = msvcr90 -IMPORTS = msvcrt +DELAYIMPORTS = advapi32 user32 +PARENTSRC = ../msvcrt C_SRCS = \ - msvcr90.c + 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 RC_SRCS = msvcr90.rc diff -Nru wine1.7-1.7.14/dlls/msvcr90/msvcr90.c wine1.7-1.7.18/dlls/msvcr90/msvcr90.c --- wine1.7-1.7.14/dlls/msvcr90/msvcr90.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msvcr90/msvcr90.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,199 +0,0 @@ -/* - * msvcr90 specific functions - * - * Copyright 2010 Detlef Riekenberg - * - * 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 "stdio.h" -#include "windef.h" -#include "winbase.h" - -#ifdef __i386__ - -#define THISCALL(func) __thiscall_ ## func -#define __thiscall __stdcall -#define DEFINE_THISCALL_WRAPPER(func,args) \ - extern void THISCALL(func)(void); \ - __ASM_GLOBAL_FUNC(__thiscall_ ## func, \ - "popl %eax\n\t" \ - "pushl %ecx\n\t" \ - "pushl %eax\n\t" \ - "jmp " __ASM_NAME(#func) __ASM_STDCALL(args) ) - -extern void *call_thiscall_func; -__ASM_GLOBAL_FUNC(call_thiscall_func, - "popl %eax\n\t" - "popl %edx\n\t" - "popl %ecx\n\t" - "pushl %eax\n\t" - "jmp *%edx\n\t") - -#define call_func1(func,this) ((void* (WINAPI*)(void*,void*))&call_thiscall_func)(func,this) -#define call_func2(func,this,a) ((void* (WINAPI*)(void*,void*,const void*))&call_thiscall_func)(func,this,(const void*)(a)) -#define call_func3(func,this,a,b) ((void* (WINAPI*)(void*,void*,const void*,const void*))&call_thiscall_func)(func,this,(const void*)(a),(const void*)(b)) - -#else /* __i386__ */ - -#define __thiscall __cdecl -#define DEFINE_THISCALL_WRAPPER(func,args) /* nothing */ - -#define call_func1(func,this) func(this) -#define call_func2(func,this,a) func(this,a) -#define call_func3(func,this,a,b) func(this,a,b) - -#endif /* __i386__ */ - -typedef void (__cdecl *MSVCRT__se_translator_function)(unsigned int code, struct _EXCEPTION_POINTERS *info); - -static void* (__cdecl *MSVCRT_operator_new)(size_t); -static void (__cdecl *MSVCRT_operator_delete)(void*); -static MSVCRT__se_translator_function (__cdecl *MSVCRT__set_se_translator)(MSVCRT__se_translator_function); -static void* (__thiscall *MSVCRT_exception_ctor)(void*, const char**); -static void* (__thiscall *MSVCRT_exception_ctor_noalloc)(void*, char**, int); -static void* (__thiscall *MSVCRT_exception_copy_ctor)(void*, const void*); -static void (__thiscall *MSVCRT_exception_dtor)(void*); - -static void init_cxx_funcs(void) -{ - HMODULE hmod = GetModuleHandleA("msvcrt.dll"); - - if (sizeof(void *) > sizeof(int)) /* 64-bit has different names */ - { - MSVCRT_operator_new = (void*)GetProcAddress(hmod, "??2@YAPEAX_K@Z"); - MSVCRT_operator_delete = (void*)GetProcAddress(hmod, "??3@YAXPEAX@Z"); - MSVCRT__set_se_translator = (void*)GetProcAddress(hmod, - "?_set_se_translator@@YAP6AXIPEAU_EXCEPTION_POINTERS@@@ZP6AXI0@Z@Z"); - MSVCRT_exception_ctor = (void*)GetProcAddress(hmod, "??0exception@@QEAA@AEBQEBD@Z"); - MSVCRT_exception_ctor_noalloc = (void*)GetProcAddress(hmod, "??0exception@@QEAA@AEBQEBDH@Z"); - MSVCRT_exception_copy_ctor = (void*)GetProcAddress(hmod, "??0exception@@QEAA@AEBV0@@Z"); - MSVCRT_exception_dtor = (void*)GetProcAddress(hmod, "??1exception@@UEAA@XZ"); - } - else - { - MSVCRT_operator_new = (void*)GetProcAddress(hmod, "??2@YAPAXI@Z"); - MSVCRT_operator_delete = (void*)GetProcAddress(hmod, "??3@YAXPAX@Z"); - MSVCRT__set_se_translator = (void*)GetProcAddress(hmod, - "?_set_se_translator@@YAP6AXIPAU_EXCEPTION_POINTERS@@@ZP6AXI0@Z@Z"); - MSVCRT_exception_ctor = (void*)GetProcAddress(hmod, "??0exception@@QAE@ABQBD@Z"); - MSVCRT_exception_ctor_noalloc = (void*)GetProcAddress(hmod, "??0exception@@QAE@ABQBDH@Z"); - MSVCRT_exception_copy_ctor = (void*)GetProcAddress(hmod, "??0exception@@QAE@ABV0@@Z"); - MSVCRT_exception_dtor = (void*)GetProcAddress(hmod, "??1exception@@UAE@XZ"); - } -} - -/********************************************************************* - * DllMain (MSVCR90.@) - */ -BOOL WINAPI DllMain(HINSTANCE hdll, DWORD reason, LPVOID reserved) -{ - switch (reason) - { - case DLL_PROCESS_ATTACH: - DisableThreadLibraryCalls(hdll); - init_cxx_funcs(); - _set_printf_count_output(0); - } - return TRUE; -} - -/********************************************************************* - * _decode_pointer (MSVCR90.@) - * - * cdecl version of DecodePointer - * - */ -void * CDECL MSVCR90_decode_pointer(void * ptr) -{ - return DecodePointer(ptr); -} - -/********************************************************************* - * _encode_pointer (MSVCR90.@) - * - * cdecl version of EncodePointer - * - */ -void * CDECL MSVCR90_encode_pointer(void * ptr) -{ - return EncodePointer(ptr); -} - -/********************************************************************* - * ??2@YAPAXI@Z (MSVCR90.@) - * - * Naver LINE expects that this function is implemented inside msvcr90 - */ -void* CDECL MSVCR90_operator_new(size_t size) -{ - return MSVCRT_operator_new(size); -} - -/********************************************************************* - * ??3@YAXPAX@Z (MSVCR90.@) - * - * Naver LINE expects that this function is implemented inside msvcr90 - */ -void CDECL MSVCR90_operator_delete(void *ptr) -{ - MSVCRT_operator_delete(ptr); -} - -/********************************************************************* - * ?_set_se_translator@@YAP6AXIPAU_EXCEPTION_POINTERS@@@ZP6AXI0@Z@Z (MSVCR90.@) - * - * Naver LINE expects that this function is implemented inside msvcr90 - */ -MSVCRT__se_translator_function CDECL MSVCR90__set_se_translator(MSVCRT__se_translator_function func) -{ - return MSVCRT__set_se_translator(func); -} - -/* ??0exception@std@@QAE@ABQBD@Z */ -/* ??0exception@std@@QEAA@AEBQEBD@Z */ -DEFINE_THISCALL_WRAPPER(exception_ctor, 8) -void* __thiscall exception_ctor(void *this, const char **name) -{ - return call_func2(MSVCRT_exception_ctor, this, name); -} - -/* ??0exception@std@@QAE@ABQBDH@Z */ -/* ??0exception@std@@QEAA@AEBQEBDH@Z */ -DEFINE_THISCALL_WRAPPER(exception_ctor_noalloc, 12) -void* __thiscall exception_ctor_noalloc(void *this, char **name, int noalloc) -{ - return call_func3(MSVCRT_exception_ctor_noalloc, this, name, noalloc); -} - -/* ??0exception@std@@QAE@ABV01@@Z */ -/* ??0exception@std@@QEAA@AEBV01@@Z */ -DEFINE_THISCALL_WRAPPER(exception_copy_ctor, 8) -void* __thiscall exception_copy_ctor(void *this, const void *rhs) -{ - return call_func2(MSVCRT_exception_copy_ctor, this, rhs); -} - -/* ??1exception@std@@UAE@XZ */ -/* ??1exception@std@@UEAA@XZ */ -DEFINE_THISCALL_WRAPPER(exception_dtor, 4) -void __thiscall exception_dtor(void *this) -{ - call_func1(MSVCRT_exception_dtor, this); -} diff -Nru wine1.7-1.7.14/dlls/msvcr90/msvcr90.spec wine1.7-1.7.18/dlls/msvcr90/msvcr90.spec --- wine1.7-1.7.14/dlls/msvcr90/msvcr90.spec 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msvcr90/msvcr90.spec 2014-05-02 18:15:48.000000000 +0000 @@ -1,71 +1,71 @@ # MS VC++2008 runtime library -@ thiscall -arch=i386 ??0__non_rtti_object@std@@QAE@ABV01@@Z(ptr ptr) msvcrt.??0__non_rtti_object@@QAE@ABV0@@Z -@ cdecl -arch=win64 ??0__non_rtti_object@std@@QEAA@AEBV01@@Z(ptr ptr) msvcrt.??0__non_rtti_object@@QEAA@AEBV0@@Z -@ cdecl -arch=win64 ??0__non_rtti_object@std@@QEAA@PEBD@Z(ptr ptr) msvcrt.??0__non_rtti_object@@QEAA@PEBD@Z -@ cdecl -arch=win64 ??0bad_cast@std@@AEAA@PEBQEBD@Z(ptr ptr) msvcrt.??0bad_cast@@AEAA@PEBQEBD@Z -@ thiscall -arch=i386 ??0bad_cast@std@@QAE@ABV01@@Z(ptr ptr) msvcrt.??0bad_cast@@QAE@ABV0@@Z -@ cdecl -arch=win64 ??0bad_cast@std@@QEAA@AEBV01@@Z(ptr ptr) msvcrt.??0bad_cast@@QEAA@AEBV0@@Z -@ thiscall -arch=i386 ??0bad_cast@std@@QAE@PBD@Z(ptr str) msvcrt.??0bad_cast@@QAE@PBD@Z -@ cdecl -arch=win64 ??0bad_cast@std@@QEAA@PEBD@Z(ptr str) msvcrt.??0bad_cast@@QEAA@PEBD@Z -@ thiscall -arch=i386 ??0bad_typeid@std@@QAE@ABV01@@Z(ptr ptr) msvcrt.??0bad_typeid@@QAE@ABV0@@Z -@ cdecl -arch=win64 ??0bad_typeid@std@@QEAA@AEBV01@@Z(ptr ptr) msvcrt.??0bad_typeid@@QEAA@AEBV0@@Z -@ thiscall -arch=i386 ??0bad_typeid@std@@QAE@PBD@Z(ptr str) msvcrt.??0bad_typeid@@QAE@PBD@Z -@ cdecl -arch=win64 ??0bad_typeid@std@@QEAA@PEBD@Z(ptr str) msvcrt.??0bad_typeid@@QEAA@PEBD@Z -@ thiscall -arch=i386 ??0exception@std@@QAE@ABQBD@Z(ptr ptr) exception_ctor -@ cdecl -arch=win64 ??0exception@std@@QEAA@AEBQEBD@Z(ptr ptr) exception_ctor -@ thiscall -arch=i386 ??0exception@std@@QAE@ABQBDH@Z(ptr ptr long) exception_ctor_noalloc -@ cdecl -arch=win64 ??0exception@std@@QEAA@AEBQEBDH@Z(ptr ptr long) exception_ctor_noalloc -@ thiscall -arch=i386 ??0exception@std@@QAE@ABV01@@Z(ptr ptr) exception_copy_ctor -@ cdecl -arch=win64 ??0exception@std@@QEAA@AEBV01@@Z(ptr ptr) exception_copy_ctor -@ thiscall -arch=i386 ??0exception@std@@QAE@XZ(ptr) msvcrt.??0exception@@QAE@XZ -@ cdecl -arch=win64 ??0exception@std@@QEAA@XZ(ptr) msvcrt.??0exception@@QEAA@XZ -@ thiscall -arch=i386 ??1__non_rtti_object@std@@UAE@XZ(ptr) msvcrt.??1__non_rtti_object@@UAE@XZ -@ cdecl -arch=win64 ??1__non_rtti_object@std@@UEAA@XZ(ptr) msvcrt.??1__non_rtti_object@@UEAA@XZ -@ thiscall -arch=i386 ??1bad_cast@std@@UAE@XZ(ptr) msvcrt.??1bad_cast@@UAE@XZ -@ cdecl -arch=win64 ??1bad_cast@std@@UEAA@XZ(ptr) msvcrt.??1bad_cast@@UEAA@XZ -@ thiscall -arch=i386 ??1bad_typeid@std@@UAE@XZ(ptr) msvcrt.??1bad_typeid@@UAE@XZ -@ cdecl -arch=win64 ??1bad_typeid@std@@UEAA@XZ(ptr) msvcrt.??1bad_typeid@@UEAA@XZ -@ thiscall -arch=i386 ??1exception@std@@UAE@XZ(ptr) exception_dtor -@ cdecl -arch=win64 ??1exception@std@@UEAA@XZ(ptr) exception_dtor -@ cdecl -arch=arm ??1type_info@@UAA@XZ(ptr) msvcrt.??1type_info@@UAA@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) MSVCR90_operator_new -@ cdecl -arch=win64 ??2@YAPEAX_K@Z(long) MSVCR90_operator_new -@ cdecl -arch=win32 ??2@YAPAXIHPBDH@Z(long long str long) msvcrt.??2@YAPAXIHPBDH@Z -@ cdecl -arch=win64 ??2@YAPEAX_KHPEBDH@Z(long long str long) msvcrt.??2@YAPEAX_KHPEBDH@Z -@ cdecl -arch=win32 ??3@YAXPAX@Z(ptr) MSVCR90_operator_delete -@ cdecl -arch=win64 ??3@YAXPEAX@Z(ptr) MSVCR90_operator_delete -@ thiscall -arch=i386 ??4__non_rtti_object@std@@QAEAAV01@ABV01@@Z(ptr ptr) msvcrt.??4__non_rtti_object@@QAEAAV0@ABV0@@Z -@ cdecl -arch=win64 ??4__non_rtti_object@std@@QEAAAEAV01@AEBV01@@Z(ptr ptr) msvcrt.??4__non_rtti_object@@QEAAAEAV0@AEBV0@@Z -@ thiscall -arch=i386 ??4bad_cast@std@@QAEAAV01@ABV01@@Z(ptr ptr) msvcrt.??4bad_cast@@QAEAAV0@ABV0@@Z -@ cdecl -arch=win64 ??4bad_cast@std@@QEAAAEAV01@AEBV01@@Z(ptr ptr) msvcrt.??4bad_cast@@QEAAAEAV0@AEBV0@@Z -@ thiscall -arch=i386 ??4bad_typeid@std@@QAEAAV01@ABV01@@Z(ptr ptr) msvcrt.??4bad_typeid@@QAEAAV0@ABV0@@Z -@ cdecl -arch=win64 ??4bad_typeid@std@@QEAAAEAV01@AEBV01@@Z(ptr ptr) msvcrt.??4bad_typeid@@QEAAAEAV0@AEBV0@@Z -@ thiscall -arch=i386 ??4exception@std@@QAEAAV01@ABV01@@Z(ptr ptr) msvcrt.??4exception@@QAEAAV0@ABV0@@Z -@ cdecl -arch=win64 ??4exception@std@@QEAAAEAV01@AEBV01@@Z(ptr ptr) msvcrt.??4exception@@QEAAAEAV0@AEBV0@@Z -@ cdecl -arch=arm ??8type_info@@QBA_NABV0@@Z(ptr ptr) msvcrt.??8type_info@@QBA_NABV0@@Z -@ thiscall -arch=i386 ??8type_info@@QBE_NABV0@@Z(ptr ptr) msvcrt.??8type_info@@QBEHABV0@@Z -@ cdecl -arch=win64 ??8type_info@@QEBA_NAEBV0@@Z(ptr ptr) msvcrt.??8type_info@@QEBAHAEBV0@@Z -@ cdecl -arch=arm ??9type_info@@QBA_NABV0@@Z(ptr ptr) msvcrt.??9type_info@@QBA_NABV0@@Z -@ thiscall -arch=i386 ??9type_info@@QBE_NABV0@@Z(ptr ptr) msvcrt.??9type_info@@QBEHABV0@@Z -@ cdecl -arch=win64 ??9type_info@@QEBA_NAEBV0@@Z(ptr ptr) msvcrt.??9type_info@@QEBAHAEBV0@@Z -@ extern ??_7__non_rtti_object@std@@6B@ msvcrt.??_7__non_rtti_object@@6B@ -@ extern ??_7bad_cast@std@@6B@ msvcrt.??_7bad_cast@@6B@ -@ extern ??_7bad_typeid@std@@6B@ msvcrt.??_7bad_typeid@@6B@ -@ extern ??_7exception@@6B@ msvcrt.??_7exception@@6B@ -@ extern ??_7exception@std@@6B@ msvcrt.??_7exception@@6B@ -@ thiscall -arch=i386 ??_Fbad_cast@std@@QAEXXZ(ptr) msvcrt.??_Fbad_cast@@QAEXXZ -@ cdecl -arch=win64 ??_Fbad_cast@std@@QEAAXXZ(ptr) msvcrt.??_Fbad_cast@@QEAAXXZ -@ thiscall -arch=i386 ??_Fbad_typeid@std@@QAEXXZ(ptr) msvcrt.??_Fbad_typeid@@QAEXXZ -@ cdecl -arch=win64 ??_Fbad_typeid@std@@QEAAXXZ(ptr) msvcrt.??_Fbad_typeid@@QEAAXXZ -@ cdecl -arch=win32 ??_U@YAPAXI@Z(long) msvcrt.??_U@YAPAXI@Z -@ cdecl -arch=win64 ??_U@YAPEAX_K@Z(long) msvcrt.??_U@YAPEAX_K@Z -@ cdecl -arch=win32 ??_U@YAPAXIHPBDH@Z(long long str long) msvcrt.??_U@YAPAXIHPBDH@Z -@ cdecl -arch=win64 ??_U@YAPEAX_KHPEBDH@Z(long long str long) msvcrt.??_U@YAPEAX_KHPEBDH@Z -@ cdecl -arch=win32 ??_V@YAXPAX@Z(ptr) MSVCR90_operator_delete -@ cdecl -arch=win64 ??_V@YAXPEAX@Z(ptr) MSVCR90_operator_delete +@ thiscall -arch=i386 ??0__non_rtti_object@std@@QAE@ABV01@@Z(ptr ptr) MSVCRT___non_rtti_object_copy_ctor +@ cdecl -arch=win64 ??0__non_rtti_object@std@@QEAA@AEBV01@@Z(ptr ptr) MSVCRT___non_rtti_object_copy_ctor +@ cdecl -arch=win64 ??0__non_rtti_object@std@@QEAA@PEBD@Z(ptr ptr) MSVCRT___non_rtti_object_ctor +@ cdecl -arch=win64 ??0bad_cast@std@@AEAA@PEBQEBD@Z(ptr ptr) MSVCRT_bad_cast_ctor +@ thiscall -arch=i386 ??0bad_cast@std@@QAE@ABV01@@Z(ptr ptr) MSVCRT_bad_cast_copy_ctor +@ cdecl -arch=win64 ??0bad_cast@std@@QEAA@AEBV01@@Z(ptr ptr) MSVCRT_bad_cast_copy_ctor +@ thiscall -arch=i386 ??0bad_cast@std@@QAE@PBD@Z(ptr str) MSVCRT_bad_cast_ctor_charptr +@ cdecl -arch=win64 ??0bad_cast@std@@QEAA@PEBD@Z(ptr str) MSVCRT_bad_cast_ctor_charptr +@ thiscall -arch=i386 ??0bad_typeid@std@@QAE@ABV01@@Z(ptr ptr) MSVCRT_bad_typeid_copy_ctor +@ cdecl -arch=win64 ??0bad_typeid@std@@QEAA@AEBV01@@Z(ptr ptr) MSVCRT_bad_typeid_copy_ctor +@ thiscall -arch=i386 ??0bad_typeid@std@@QAE@PBD@Z(ptr str) MSVCRT_bad_typeid_ctor +@ cdecl -arch=win64 ??0bad_typeid@std@@QEAA@PEBD@Z(ptr str) MSVCRT_bad_typeid_ctor +@ thiscall -arch=i386 ??0exception@std@@QAE@ABQBD@Z(ptr ptr) MSVCRT_exception_ctor +@ cdecl -arch=win64 ??0exception@std@@QEAA@AEBQEBD@Z(ptr ptr) MSVCRT_exception_ctor +@ thiscall -arch=i386 ??0exception@std@@QAE@ABQBDH@Z(ptr ptr long) MSVCRT_exception_ctor_noalloc +@ cdecl -arch=win64 ??0exception@std@@QEAA@AEBQEBDH@Z(ptr ptr long) MSVCRT_exception_ctor_noalloc +@ thiscall -arch=i386 ??0exception@std@@QAE@ABV01@@Z(ptr ptr) MSVCRT_exception_copy_ctor +@ cdecl -arch=win64 ??0exception@std@@QEAA@AEBV01@@Z(ptr ptr) MSVCRT_exception_copy_ctor +@ thiscall -arch=i386 ??0exception@std@@QAE@XZ(ptr) MSVCRT_exception_default_ctor +@ cdecl -arch=win64 ??0exception@std@@QEAA@XZ(ptr) MSVCRT_exception_default_ctor +@ thiscall -arch=i386 ??1__non_rtti_object@std@@UAE@XZ(ptr) MSVCRT___non_rtti_object_dtor +@ cdecl -arch=win64 ??1__non_rtti_object@std@@UEAA@XZ(ptr) MSVCRT___non_rtti_object_dtor +@ thiscall -arch=i386 ??1bad_cast@std@@UAE@XZ(ptr) MSVCRT_bad_cast_dtor +@ cdecl -arch=win64 ??1bad_cast@std@@UEAA@XZ(ptr) MSVCRT_bad_cast_dtor +@ thiscall -arch=i386 ??1bad_typeid@std@@UAE@XZ(ptr) MSVCRT_bad_typeid_dtor +@ cdecl -arch=win64 ??1bad_typeid@std@@UEAA@XZ(ptr) MSVCRT_bad_typeid_dtor +@ thiscall -arch=i386 ??1exception@std@@UAE@XZ(ptr) MSVCRT_exception_dtor +@ cdecl -arch=win64 ??1exception@std@@UEAA@XZ(ptr) MSVCRT_exception_dtor +@ cdecl -arch=arm ??1type_info@@UAA@XZ(ptr) MSVCRT_type_info_dtor +@ thiscall -arch=i386 ??1type_info@@UAE@XZ(ptr) MSVCRT_type_info_dtor +@ cdecl -arch=win64 ??1type_info@@UEAA@XZ(ptr) MSVCRT_type_info_dtor +@ cdecl -arch=win32 ??2@YAPAXI@Z(long) MSVCRT_operator_new +@ cdecl -arch=win64 ??2@YAPEAX_K@Z(long) MSVCRT_operator_new +@ cdecl -arch=win32 ??2@YAPAXIHPBDH@Z(long long str long) MSVCRT_operator_new_dbg +@ cdecl -arch=win64 ??2@YAPEAX_KHPEBDH@Z(long long str long) MSVCRT_operator_new_dbg +@ cdecl -arch=win32 ??3@YAXPAX@Z(ptr) MSVCRT_operator_delete +@ cdecl -arch=win64 ??3@YAXPEAX@Z(ptr) MSVCRT_operator_delete +@ thiscall -arch=i386 ??4__non_rtti_object@std@@QAEAAV01@ABV01@@Z(ptr ptr) MSVCRT___non_rtti_object_opequals +@ cdecl -arch=win64 ??4__non_rtti_object@std@@QEAAAEAV01@AEBV01@@Z(ptr ptr) MSVCRT___non_rtti_object_opequals +@ thiscall -arch=i386 ??4bad_cast@std@@QAEAAV01@ABV01@@Z(ptr ptr) MSVCRT_bad_cast_opequals +@ cdecl -arch=win64 ??4bad_cast@std@@QEAAAEAV01@AEBV01@@Z(ptr ptr) MSVCRT_bad_cast_opequals +@ thiscall -arch=i386 ??4bad_typeid@std@@QAEAAV01@ABV01@@Z(ptr ptr) MSVCRT_bad_typeid_opequals +@ cdecl -arch=win64 ??4bad_typeid@std@@QEAAAEAV01@AEBV01@@Z(ptr ptr) MSVCRT_bad_typeid_opequals +@ thiscall -arch=i386 ??4exception@std@@QAEAAV01@ABV01@@Z(ptr ptr) MSVCRT_exception_opequals +@ cdecl -arch=win64 ??4exception@std@@QEAAAEAV01@AEBV01@@Z(ptr ptr) MSVCRT_exception_opequals +@ cdecl -arch=arm ??8type_info@@QBA_NABV0@@Z(ptr ptr) MSVCRT_type_info_opequals_equals +@ thiscall -arch=i386 ??8type_info@@QBE_NABV0@@Z(ptr ptr) MSVCRT_type_info_opequals_equals +@ cdecl -arch=win64 ??8type_info@@QEBA_NAEBV0@@Z(ptr ptr) MSVCRT_type_info_opequals_equals +@ cdecl -arch=arm ??9type_info@@QBA_NABV0@@Z(ptr ptr) MSVCRT_type_info_opnot_equals +@ thiscall -arch=i386 ??9type_info@@QBE_NABV0@@Z(ptr ptr) MSVCRT_type_info_opnot_equals +@ cdecl -arch=win64 ??9type_info@@QEBA_NAEBV0@@Z(ptr ptr) MSVCRT_type_info_opnot_equals +@ extern ??_7__non_rtti_object@std@@6B@ MSVCRT___non_rtti_object_vtable +@ extern ??_7bad_cast@std@@6B@ MSVCRT_bad_cast_vtable +@ extern ??_7bad_typeid@std@@6B@ MSVCRT_bad_typeid_vtable +@ extern ??_7exception@@6B@ MSVCRT_exception_vtable +@ extern ??_7exception@std@@6B@ MSVCRT_exception_vtable +@ thiscall -arch=i386 ??_Fbad_cast@std@@QAEXXZ(ptr) MSVCRT_bad_cast_default_ctor +@ cdecl -arch=win64 ??_Fbad_cast@std@@QEAAXXZ(ptr) MSVCRT_bad_cast_default_ctor +@ thiscall -arch=i386 ??_Fbad_typeid@std@@QAEXXZ(ptr) MSVCRT_bad_typeid_default_ctor +@ cdecl -arch=win64 ??_Fbad_typeid@std@@QEAAXXZ(ptr) MSVCRT_bad_typeid_default_ctor +@ cdecl -arch=win32 ??_U@YAPAXI@Z(long) MSVCRT_operator_new +@ cdecl -arch=win64 ??_U@YAPEAX_K@Z(long) MSVCRT_operator_new +@ cdecl -arch=win32 ??_U@YAPAXIHPBDH@Z(long long str long) MSVCRT_operator_new_dbg +@ cdecl -arch=win64 ??_U@YAPEAX_KHPEBDH@Z(long long str long) MSVCRT_operator_new_dbg +@ cdecl -arch=win32 ??_V@YAXPAX@Z(ptr) MSVCRT_operator_delete +@ cdecl -arch=win64 ??_V@YAXPEAX@Z(ptr) MSVCRT_operator_delete @ stub -arch=win32 ?_Name_base@type_info@@CAPBDPBV1@PAU__type_info_node@@@Z # private: static char const * __cdecl type_info::_Name_base(class type_info const *,struct __type_info_node *) @ stub -arch=win64 ?_Name_base@type_info@@CAPEBDPEBV1@PEAU__type_info_node@@@Z # private: static char const * __ptr64 __cdecl type_info::_Name_base(class type_info const * __ptr64,struct __type_info_node * __ptr64) @ stub -arch=win32 ?_Name_base_internal@type_info@@CAPBDPBV1@PAU__type_info_node@@@Z # private: static char const * __cdecl type_info::_Name_base_internal(class type_info const *,struct __type_info_node *) @@ -80,596 +80,596 @@ @ stub -arch=win64 ?_ValidateRead@@YAHPEBXI@Z # int __cdecl _ValidateRead(void const * __ptr64,unsigned int) @ stub -arch=win32 ?_ValidateWrite@@YAHPAXI@Z # int __cdecl _ValidateWrite(void *,unsigned int) @ stub -arch=win64 ?_ValidateWrite@@YAHPEAXI@Z # int __cdecl _ValidateWrite(void * __ptr64,unsigned int) -@ cdecl __uncaught_exception() msvcrt.__uncaught_exception +@ cdecl __uncaught_exception() MSVCRT___uncaught_exception @ stub ?_inconsistency@@YAXXZ -@ cdecl -arch=win32 ?_invalid_parameter@@YAXPBG00II@Z(wstr wstr wstr long long) msvcrt._invalid_parameter -@ cdecl -arch=win64 ?_invalid_parameter@@YAXPEBG00I_K@Z(wstr wstr wstr long long) msvcrt._invalid_parameter -@ cdecl -arch=win32 ?_is_exception_typeof@@YAHABVtype_info@@PAU_EXCEPTION_POINTERS@@@Z(ptr ptr) msvcrt._is_exception_typeof -@ cdecl -arch=win64 ?_is_exception_typeof@@YAHAEBVtype_info@@PEAU_EXCEPTION_POINTERS@@@Z(ptr ptr) msvcrt._is_exception_typeof -@ cdecl -arch=arm ?_name_internal_method@type_info@@QBAPBDPAU__type_info_node@@@Z(ptr ptr) msvcr100.?_name_internal_method@type_info@@QBAPBDPAU__type_info_node@@@Z -@ thiscall -arch=i386 ?_name_internal_method@type_info@@QBEPBDPAU__type_info_node@@@Z(ptr ptr) msvcr100.?_name_internal_method@type_info@@QBEPBDPAU__type_info_node@@@Z -@ cdecl -arch=win64 ?_name_internal_method@type_info@@QEBAPEBDPEAU__type_info_node@@@Z(ptr ptr) msvcr100.?_name_internal_method@type_info@@QEBAPEBDPEAU__type_info_node@@@Z -@ varargs -arch=win32 ?_open@@YAHPBDHH@Z(str long) msvcrt._open -@ varargs -arch=win64 ?_open@@YAHPEBDHH@Z(str long) msvcrt._open -@ 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 +@ cdecl -arch=win32 ?_invalid_parameter@@YAXPBG00II@Z(wstr wstr wstr long long) MSVCRT__invalid_parameter +@ cdecl -arch=win64 ?_invalid_parameter@@YAXPEBG00I_K@Z(wstr wstr wstr long long) MSVCRT__invalid_parameter +@ cdecl -arch=win32 ?_is_exception_typeof@@YAHABVtype_info@@PAU_EXCEPTION_POINTERS@@@Z(ptr ptr) _is_exception_typeof +@ cdecl -arch=win64 ?_is_exception_typeof@@YAHAEBVtype_info@@PEAU_EXCEPTION_POINTERS@@@Z(ptr ptr) _is_exception_typeof +@ cdecl -arch=arm ?_name_internal_method@type_info@@QBAPBDPAU__type_info_node@@@Z(ptr ptr) type_info_name_internal_method +@ thiscall -arch=i386 ?_name_internal_method@type_info@@QBEPBDPAU__type_info_node@@@Z(ptr ptr) type_info_name_internal_method +@ cdecl -arch=win64 ?_name_internal_method@type_info@@QEBAPEBDPEAU__type_info_node@@@Z(ptr ptr) type_info_name_internal_method +@ varargs -arch=win32 ?_open@@YAHPBDHH@Z(str long) MSVCRT__open +@ varargs -arch=win64 ?_open@@YAHPEBDHH@Z(str long) MSVCRT__open +@ cdecl -arch=win32 ?_query_new_handler@@YAP6AHI@ZXZ() MSVCRT__query_new_handler +@ cdecl -arch=win64 ?_query_new_handler@@YAP6AH_K@ZXZ() MSVCRT__query_new_handler +@ cdecl ?_query_new_mode@@YAHXZ() MSVCRT__query_new_mode @ stub -arch=win32 ?_set_new_handler@@YAP6AHI@ZH@Z # int (__cdecl*__cdecl _set_new_handler(int))(unsigned int) @ stub -arch=win64 ?_set_new_handler@@YAP6AH_K@ZH@Z # int (__cdecl*__cdecl _set_new_handler(int))(unsigned __int64) -@ cdecl -arch=win32 ?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z(ptr) msvcrt.?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z -@ cdecl -arch=win64 ?_set_new_handler@@YAP6AH_K@ZP6AH0@Z@Z(ptr) msvcrt.?_set_new_handler@@YAP6AH_K@ZP6AH0@Z@Z -@ cdecl ?_set_new_mode@@YAHH@Z(long) msvcrt.?_set_new_mode@@YAHH@Z +@ cdecl -arch=win32 ?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z(ptr) MSVCRT__set_new_handler +@ cdecl -arch=win64 ?_set_new_handler@@YAP6AH_K@ZP6AH0@Z@Z(ptr) MSVCRT__set_new_handler +@ cdecl ?_set_new_mode@@YAHH@Z(long) MSVCRT__set_new_mode @ stub -arch=win32 ?_set_se_translator@@YAP6AXIPAU_EXCEPTION_POINTERS@@@ZH@Z # void (__cdecl*__cdecl _set_se_translator(int))(unsigned int,struct _EXCEPTION_POINTERS *) @ stub -arch=win64 ?_set_se_translator@@YAP6AXIPEAU_EXCEPTION_POINTERS@@@ZH@Z # void (__cdecl*__cdecl _set_se_translator(int))(unsigned int,struct _EXCEPTION_POINTERS * __ptr64) -@ cdecl -arch=win32 ?_set_se_translator@@YAP6AXIPAU_EXCEPTION_POINTERS@@@ZP6AXI0@Z@Z(ptr) MSVCR90__set_se_translator -@ cdecl -arch=win64 ?_set_se_translator@@YAP6AXIPEAU_EXCEPTION_POINTERS@@@ZP6AXI0@Z@Z(ptr) MSVCR90__set_se_translator -@ cdecl -arch=win32 ?_sopen@@YAHPBDHHH@Z(str long long long) msvcrt._sopen -@ cdecl -arch=win64 ?_sopen@@YAHPEBDHHH@Z(str long long long) msvcrt._sopen +@ cdecl -arch=win32 ?_set_se_translator@@YAP6AXIPAU_EXCEPTION_POINTERS@@@ZP6AXI0@Z@Z(ptr) MSVCRT__set_se_translator +@ cdecl -arch=win64 ?_set_se_translator@@YAP6AXIPEAU_EXCEPTION_POINTERS@@@ZP6AXI0@Z@Z(ptr) MSVCRT__set_se_translator +@ cdecl -arch=win32 ?_sopen@@YAHPBDHHH@Z(str long long long) MSVCRT__sopen +@ cdecl -arch=win64 ?_sopen@@YAHPEBDHHH@Z(str long long long) MSVCRT__sopen @ stub -arch=win32 ?_type_info_dtor_internal_method@type_info@@QAEXXZ # public: void __thiscall type_info::_type_info_dtor_internal_method(void) @ stub -arch=win64 ?_type_info_dtor_internal_method@type_info@@QEAAXXZ # public: void __cdecl type_info::_type_info_dtor_internal_method(void) __ptr64 -@ cdecl -arch=win32 ?_wopen@@YAHPB_WHH@Z(wstr long long) msvcrt._wopen -@ cdecl -arch=win64 ?_wopen@@YAHPEB_WHH@Z(wstr long long) msvcrt._wopen -@ cdecl -arch=win32 ?_wsopen@@YAHPB_WHHH@Z(wstr long long long) msvcrt._wsopen -@ cdecl -arch=win64 ?_wsopen@@YAHPEB_WHHH@Z(wstr long long long) msvcrt._wsopen -@ thiscall -arch=i386 ?before@type_info@@QBEHABV1@@Z(ptr ptr) msvcrt.?before@type_info@@QBEHABV1@@Z -@ cdecl -arch=win64 ?before@type_info@@QEBAHAEBV1@@Z(ptr ptr) msvcrt.?before@type_info@@QEBAHAEBV1@@Z -@ stub -arch=win32 ?name@type_info@@QBEPBDPAU__type_info_node@@@Z # public: char const * __thiscall type_info::name(struct __type_info_node *)const -@ stub -arch=win64 ?name@type_info@@QEBAPEBDPEAU__type_info_node@@@Z # public: char const * __ptr64 __cdecl type_info::name(struct __type_info_node * __ptr64)const __ptr64 -@ cdecl -arch=arm ?raw_name@type_info@@QBAPBDXZ(ptr) msvcrt.?raw_name@type_info@@QBAPBDXZ -@ thiscall -arch=i386 ?raw_name@type_info@@QBEPBDXZ(ptr) msvcrt.?raw_name@type_info@@QBEPBDXZ -@ cdecl -arch=win64 ?raw_name@type_info@@QEBAPEBDXZ(ptr) msvcrt.?raw_name@type_info@@QEBAPEBDXZ -@ cdecl ?set_new_handler@@YAP6AXXZP6AXXZ@Z(ptr) msvcrt.?set_new_handler@@YAP6AXXZP6AXXZ@Z +@ cdecl -arch=win32 ?_wopen@@YAHPB_WHH@Z(wstr long long) MSVCRT__wopen +@ cdecl -arch=win64 ?_wopen@@YAHPEB_WHH@Z(wstr long long) MSVCRT__wopen +@ cdecl -arch=win32 ?_wsopen@@YAHPB_WHHH@Z(wstr long long long) MSVCRT__wsopen +@ cdecl -arch=win64 ?_wsopen@@YAHPEB_WHHH@Z(wstr long long long) MSVCRT__wsopen +@ thiscall -arch=i386 ?before@type_info@@QBEHABV1@@Z(ptr ptr) MSVCRT_type_info_before +@ cdecl -arch=win64 ?before@type_info@@QEBAHAEBV1@@Z(ptr ptr) MSVCRT_type_info_before +@ thiscall -arch=win32 ?name@type_info@@QBEPBDPAU__type_info_node@@@Z(ptr ptr) type_info_name_internal_method +@ cdecl -arch=win64 ?name@type_info@@QEBAPEBDPEAU__type_info_node@@@Z(ptr ptr) type_info_name_internal_method +@ cdecl -arch=arm ?raw_name@type_info@@QBAPBDXZ(ptr) MSVCRT_type_info_raw_name +@ thiscall -arch=i386 ?raw_name@type_info@@QBEPBDXZ(ptr) MSVCRT_type_info_raw_name +@ cdecl -arch=win64 ?raw_name@type_info@@QEBAPEBDXZ(ptr) MSVCRT_type_info_raw_name +@ cdecl ?set_new_handler@@YAP6AXXZP6AXXZ@Z(ptr) MSVCRT_set_new_handler @ stub ?set_terminate@@YAP6AXXZH@Z -@ cdecl ?set_terminate@@YAP6AXXZP6AXXZ@Z(ptr) msvcrt.?set_terminate@@YAP6AXXZP6AXXZ@Z +@ cdecl ?set_terminate@@YAP6AXXZP6AXXZ@Z(ptr) MSVCRT_set_terminate @ stub ?set_unexpected@@YAP6AXXZH@Z -@ cdecl ?set_unexpected@@YAP6AXXZP6AXXZ@Z(ptr) msvcrt.?set_unexpected@@YAP6AXXZP6AXXZ@Z -@ varargs ?swprintf@@YAHPAGIPBGZZ(ptr long wstr) msvcrt._snwprintf -@ varargs ?swprintf@@YAHPA_WIPB_WZZ(ptr long wstr) msvcrt._snwprintf -@ cdecl ?terminate@@YAXXZ() msvcrt.?terminate@@YAXXZ -@ cdecl ?unexpected@@YAXXZ() msvcrt.?unexpected@@YAXXZ -@ cdecl ?vswprintf@@YAHPA_WIPB_WPAD@Z(ptr long wstr ptr) msvcrt._vsnwprintf -@ thiscall -arch=i386 ?what@exception@std@@UBEPBDXZ(ptr) msvcrt.?what@exception@@UBEPBDXZ -@ cdecl -arch=win64 ?what@exception@std@@UEBAPEBDXZ(ptr) msvcrt.?what@exception@@UEBAPEBDXZ -@ cdecl -norelay $I10_OUTPUT(double long long long ptr) msvcrt.$I10_OUTPUT -@ cdecl -arch=i386 _CIacos() msvcrt._CIacos -@ cdecl -arch=i386 _CIasin() msvcrt._CIasin -@ cdecl -arch=i386 _CIatan() msvcrt._CIatan -@ cdecl -arch=i386 _CIatan2() msvcrt._CIatan2 -@ cdecl -arch=i386 _CIcos() msvcrt._CIcos -@ cdecl -arch=i386 _CIcosh() msvcrt._CIcosh -@ cdecl -arch=i386 _CIexp() msvcrt._CIexp -@ cdecl -arch=i386 _CIfmod() msvcrt._CIfmod -@ cdecl -arch=i386 _CIlog() msvcrt._CIlog -@ cdecl -arch=i386 _CIlog10() msvcrt._CIlog10 -@ cdecl -arch=i386 _CIpow() msvcrt._CIpow -@ cdecl -arch=i386 _CIsin() msvcrt._CIsin -@ cdecl -arch=i386 _CIsinh() msvcrt._CIsinh -@ cdecl -arch=i386 _CIsqrt() msvcrt._CIsqrt -@ cdecl -arch=i386 _CItan() msvcrt._CItan -@ cdecl -arch=i386 _CItanh() msvcrt._CItanh -@ cdecl _CRT_RTC_INIT(ptr ptr long long long) msvcr100._CRT_RTC_INIT -@ cdecl _CRT_RTC_INITW(ptr ptr long long long) msvcr100._CRT_RTC_INITW +@ cdecl ?set_unexpected@@YAP6AXXZP6AXXZ@Z(ptr) MSVCRT_set_unexpected +@ varargs ?swprintf@@YAHPAGIPBGZZ(ptr long wstr) MSVCRT__snwprintf +@ varargs ?swprintf@@YAHPA_WIPB_WZZ(ptr long wstr) MSVCRT__snwprintf +@ cdecl ?terminate@@YAXXZ() MSVCRT_terminate +@ cdecl ?unexpected@@YAXXZ() MSVCRT_unexpected +@ cdecl ?vswprintf@@YAHPA_WIPB_WPAD@Z(ptr long wstr ptr) MSVCRT_vsnwprintf +@ thiscall -arch=i386 ?what@exception@std@@UBEPBDXZ(ptr) MSVCRT_what_exception +@ cdecl -arch=win64 ?what@exception@std@@UEBAPEBDXZ(ptr) MSVCRT_what_exception +@ cdecl -norelay $I10_OUTPUT(double long long long ptr) MSVCRT_I10_OUTPUT +@ 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() +@ cdecl _CRT_RTC_INIT(ptr ptr long long long) +@ cdecl _CRT_RTC_INITW(ptr ptr long long long) @ stub _CreateFrameInfo -@ stdcall _CxxThrowException(long long) msvcrt._CxxThrowException -@ cdecl -arch=i386 -norelay _EH_prolog() msvcrt._EH_prolog +@ stdcall _CxxThrowException(long long) +@ cdecl -arch=i386 -norelay _EH_prolog() @ stub _FindAndUnlinkFrame -@ cdecl _Getdays() msvcrt._Getdays -@ cdecl _Getmonths() msvcrt._Getmonths -@ cdecl _Gettnames() msvcrt._Gettnames -@ extern _HUGE msvcrt._HUGE +@ cdecl _Getdays() +@ cdecl _Getmonths() +@ cdecl _Gettnames() +@ extern _HUGE MSVCRT__HUGE @ stub _IsExceptionObjectToBeDestroyed @ stub _NLG_Dispatch2 @ stub _NLG_Return @ stub _NLG_Return2 -@ cdecl _Strftime(str long str ptr ptr) msvcrt._Strftime -@ cdecl _XcptFilter(long ptr) msvcrt._XcptFilter +@ cdecl _Strftime(str long str ptr ptr) +@ cdecl _XcptFilter(long ptr) @ stub __AdjustPointer @ stub __BuildCatchObject @ stub __BuildCatchObjectHelper -@ stdcall -arch=x86_64 __C_specific_handler(ptr long ptr ptr) msvcrt.__C_specific_handler -@ cdecl -arch=i386,x86_64,arm __CppXcptFilter(long ptr) msvcrt.__CppXcptFilter +@ stdcall -arch=x86_64 __C_specific_handler(ptr long ptr ptr) ntdll.__C_specific_handler +@ cdecl -arch=i386,x86_64,arm __CppXcptFilter(long ptr) @ stub __CxxCallUnwindDelDtor @ stub __CxxCallUnwindDtor @ stub __CxxCallUnwindStdDelDtor @ stub __CxxCallUnwindVecDtor -@ cdecl -arch=i386,x86_64,arm __CxxDetectRethrow(ptr) msvcrt.__CxxDetectRethrow +@ cdecl -arch=i386,x86_64,arm __CxxDetectRethrow(ptr) @ stub __CxxExceptionFilter -@ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler(ptr ptr ptr ptr) msvcrt.__CxxFrameHandler -@ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler2(ptr ptr ptr ptr) msvcrt.__CxxFrameHandler2 -@ cdecl -arch=i386,x86_64,arm -norelay __CxxFrameHandler3(ptr ptr ptr ptr) msvcrt.__CxxFrameHandler3 -@ stdcall -arch=i386 __CxxLongjmpUnwind(ptr) msvcrt.__CxxLongjmpUnwind -@ cdecl -arch=i386,x86_64,arm __CxxQueryExceptionSize() msvcrt.__CxxQueryExceptionSize +@ 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 -@ cdecl __RTCastToVoid(ptr) msvcrt.__RTCastToVoid -@ cdecl __RTDynamicCast(ptr long ptr ptr long) msvcrt.__RTDynamicCast -@ cdecl __RTtypeid(ptr) msvcrt.__RTtypeid -@ cdecl __STRINGTOLD(ptr ptr str long) msvcrt.__STRINGTOLD +@ cdecl __RTCastToVoid(ptr) MSVCRT___RTCastToVoid +@ cdecl __RTDynamicCast(ptr long ptr ptr long) MSVCRT___RTDynamicCast +@ cdecl __RTtypeid(ptr) MSVCRT___RTtypeid +@ cdecl __STRINGTOLD(ptr ptr str long) @ stub __STRINGTOLD_L @ stub __TypeMatch -@ cdecl ___lc_codepage_func() msvcrt.___lc_codepage_func -@ cdecl ___lc_collate_cp_func() msvcrt.___lc_collate_cp_func -@ cdecl ___lc_handle_func() msvcrt.___lc_handle_func -@ cdecl ___mb_cur_max_func() msvcrt.___mb_cur_max_func -@ cdecl ___mb_cur_max_l_func(ptr) msvcrt.___mb_cur_max_l_func -@ cdecl ___setlc_active_func() msvcrt.___setlc_active_func -@ cdecl ___unguarded_readlc_active_add_func() msvcrt.___unguarded_readlc_active_add_func -@ extern __argc msvcrt.__argc -@ extern __argv msvcrt.__argv +@ cdecl ___lc_codepage_func() +@ cdecl ___lc_collate_cp_func() +@ cdecl ___lc_handle_func() +@ cdecl ___mb_cur_max_func() MSVCRT____mb_cur_max_func +@ cdecl ___mb_cur_max_l_func(ptr) +@ cdecl ___setlc_active_func() MSVCRT____setlc_active_func +@ cdecl ___unguarded_readlc_active_add_func() MSVCRT____unguarded_readlc_active_add_func +@ extern __argc MSVCRT___argc +@ extern __argv MSVCRT___argv ### extern __badioinfo #don't forward to msvcrt.__badioinfo, it has different size -@ cdecl __clean_type_info_names_internal(ptr) msvcr100.__clean_type_info_names_internal -@ cdecl -arch=i386 __control87_2(long long ptr ptr) msvcrt.__control87_2 +@ cdecl __clean_type_info_names_internal(ptr) +@ cdecl -arch=i386 __control87_2(long long ptr ptr) @ stub __create_locale -@ cdecl __crtCompareStringA(long long str long str long) msvcrt.__crtCompareStringA -@ cdecl __crtCompareStringW(long long wstr long wstr long) msvcrt.__crtCompareStringW -@ cdecl __crtGetLocaleInfoW(long long ptr long) msvcrt.__crtGetLocaleInfoW -@ cdecl __crtGetStringTypeW(long long wstr long ptr) msvcrt.__crtGetStringTypeW -@ cdecl __crtLCMapStringA(long long str long ptr long long long) msvcrt.__crtLCMapStringA -@ cdecl __crtLCMapStringW(long long wstr long ptr long long long) msvcrt.__crtLCMapStringW -@ cdecl __daylight() msvcrt.__daylight -@ cdecl __dllonexit(ptr ptr ptr) msvcrt.__dllonexit -@ cdecl __doserrno() msvcrt.__doserrno +@ cdecl __crtCompareStringA(long long str long str long) +@ cdecl __crtCompareStringW(long long wstr long wstr long) +@ cdecl __crtGetLocaleInfoW(long long ptr long) +@ cdecl __crtGetStringTypeW(long long wstr long ptr) +@ cdecl __crtLCMapStringA(long long str long ptr long long long) +@ cdecl __crtLCMapStringW(long long wstr long ptr long long long) +@ cdecl __daylight() MSVCRT___p__daylight +@ cdecl __dllonexit(ptr ptr ptr) +@ cdecl __doserrno() MSVCRT___doserrno @ stub __dstbias @ stub ___fls_getvalue@4 @ stub ___fls_setvalue@8 -@ cdecl __fpecode() msvcrt.__fpecode +@ cdecl __fpecode() @ stub __free_locale @ stub __get_app_type @ stub __get_current_locale @ stub __get_flsindex @ stub __get_tlsindex -@ cdecl __getmainargs(ptr ptr ptr long ptr) msvcrt.__getmainargs -@ extern __initenv msvcrt.__initenv -@ cdecl __iob_func() msvcrt.__iob_func -@ cdecl __isascii(long) msvcrt.__isascii -@ cdecl __iscsym(long) msvcrt.__iscsym -@ cdecl __iscsymf(long) msvcrt.__iscsymf +@ cdecl __getmainargs(ptr ptr ptr long ptr) +@ extern __initenv MSVCRT___initenv +@ cdecl __iob_func() MSVCRT___iob_func +@ cdecl __isascii(long) MSVCRT___isascii +@ cdecl __iscsym(long) MSVCRT___iscsym +@ cdecl __iscsymf(long) MSVCRT___iscsymf @ stub __iswcsym @ stub __iswcsymf # extern __lc_clike -@ extern __lc_codepage msvcrt.__lc_codepage -@ extern __lc_collate_cp msvcrt.__lc_collate_cp -@ extern __lc_handle msvcrt.__lc_handle +@ extern __lc_codepage MSVCRT___lc_codepage +@ extern __lc_collate_cp MSVCRT___lc_collate_cp +@ extern __lc_handle MSVCRT___lc_handle # extern __lconv -@ cdecl __lconv_init() msvcrt.__lconv_init -@ cdecl -arch=i386 __libm_sse2_acos() msvcrt.__libm_sse2_acos -@ cdecl -arch=i386 __libm_sse2_acosf() msvcrt.__libm_sse2_acosf -@ cdecl -arch=i386 __libm_sse2_asin() msvcrt.__libm_sse2_asin -@ cdecl -arch=i386 __libm_sse2_asinf() msvcrt.__libm_sse2_asinf -@ cdecl -arch=i386 __libm_sse2_atan() msvcrt.__libm_sse2_atan -@ cdecl -arch=i386 __libm_sse2_atan2() msvcrt.__libm_sse2_atan2 -@ cdecl -arch=i386 __libm_sse2_atanf() msvcrt.__libm_sse2_atanf -@ cdecl -arch=i386 __libm_sse2_cos() msvcrt.__libm_sse2_cos -@ cdecl -arch=i386 __libm_sse2_cosf() msvcrt.__libm_sse2_cosf -@ cdecl -arch=i386 __libm_sse2_exp() msvcrt.__libm_sse2_exp -@ cdecl -arch=i386 __libm_sse2_expf() msvcrt.__libm_sse2_expf -@ cdecl -arch=i386 __libm_sse2_log() msvcrt.__libm_sse2_log -@ cdecl -arch=i386 __libm_sse2_log10() msvcrt.__libm_sse2_log10 -@ cdecl -arch=i386 __libm_sse2_log10f() msvcrt.__libm_sse2_log10f -@ cdecl -arch=i386 __libm_sse2_logf() msvcrt.__libm_sse2_logf -@ cdecl -arch=i386 __libm_sse2_pow() msvcrt.__libm_sse2_pow -@ cdecl -arch=i386 __libm_sse2_powf() msvcrt.__libm_sse2_powf -@ cdecl -arch=i386 __libm_sse2_sin() msvcrt.__libm_sse2_sin -@ cdecl -arch=i386 __libm_sse2_sinf() msvcrt.__libm_sse2_sinf -@ cdecl -arch=i386 __libm_sse2_tan() msvcrt.__libm_sse2_tan -@ cdecl -arch=i386 __libm_sse2_tanf() msvcrt.__libm_sse2_tanf -@ extern __mb_cur_max msvcrt.__mb_cur_max -@ cdecl __p___argc() msvcrt.__p___argc -@ cdecl __p___argv() msvcrt.__p___argv -@ cdecl __p___initenv() msvcrt.__p___initenv -@ cdecl __p___mb_cur_max() msvcrt.__p___mb_cur_max -@ cdecl __p___wargv() msvcrt.__p___wargv -@ cdecl __p___winitenv() msvcrt.__p___winitenv -@ cdecl __p__acmdln() msvcrt.__p__acmdln -@ cdecl __p__amblksiz() msvcrt.__p__amblksiz -@ cdecl __p__commode() msvcrt.__p__commode -@ cdecl __p__daylight() msvcrt.__p__daylight -@ cdecl __p__dstbias() msvcrt.__p__dstbias -@ cdecl __p__environ() msvcrt.__p__environ -@ cdecl __p__fmode() msvcrt.__p__fmode -@ cdecl __p__iob() msvcrt.__p__iob -@ cdecl __p__mbcasemap() msvcrt.__p__mbcasemap -@ cdecl __p__mbctype() msvcrt.__p__mbctype -@ cdecl __p__pctype() msvcrt.__p__pctype -@ cdecl __p__pgmptr() msvcrt.__p__pgmptr -@ cdecl __p__pwctype() msvcrt.__p__pwctype -@ cdecl __p__timezone() msvcrt.__p__timezone -@ cdecl __p__tzname() msvcrt.__p__tzname -@ cdecl __p__wcmdln() msvcrt.__p__wcmdln -@ cdecl __p__wenviron() msvcrt.__p__wenviron -@ cdecl __p__wpgmptr() msvcrt.__p__wpgmptr -@ cdecl __pctype_func() msvcrt.__pctype_func +@ cdecl __lconv_init() +@ 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() +@ extern __mb_cur_max MSVCRT___mb_cur_max +@ cdecl __p___argc() MSVCRT___p___argc +@ cdecl __p___argv() MSVCRT___p___argv +@ cdecl __p___initenv() +@ cdecl __p___mb_cur_max() +@ cdecl __p___wargv() MSVCRT___p___wargv +@ cdecl __p___winitenv() +@ cdecl __p__acmdln() +@ cdecl __p__amblksiz() +@ cdecl __p__commode() +@ cdecl __p__daylight() MSVCRT___p__daylight +@ cdecl __p__dstbias() +@ cdecl __p__environ() MSVCRT___p__environ +@ cdecl __p__fmode() +@ cdecl __p__iob() MSVCRT___iob_func +@ stub __p__mbcasemap() +@ cdecl __p__mbctype() +@ cdecl __p__pctype() MSVCRT___p__pctype +@ cdecl __p__pgmptr() MSVCRT___p__pgmptr +@ stub __p__pwctype() +@ cdecl __p__timezone() MSVCRT___p__timezone +@ cdecl __p__tzname() +@ cdecl __p__wcmdln() +@ cdecl __p__wenviron() MSVCRT___p__wenviron +@ cdecl __p__wpgmptr() MSVCRT___p__wpgmptr +@ cdecl __pctype_func() MSVCRT___pctype_func #FIXME: add correct __pioinfo implementation -@ extern __pioinfo msvcrt.__pioinfo +@ extern __pioinfo MSVCRT___pioinfo @ stub __pwctype_func -@ cdecl __pxcptinfoptrs() msvcrt.__pxcptinfoptrs +@ cdecl __pxcptinfoptrs() MSVCRT___pxcptinfoptrs @ stub __report_gsfailure -@ cdecl __set_app_type(long) msvcrt.__set_app_type +@ cdecl __set_app_type(long) MSVCRT___set_app_type @ stub __set_flsgetvalue -@ extern __setlc_active msvcrt.__setlc_active -@ cdecl __setusermatherr(ptr) msvcrt.__setusermatherr +@ extern __setlc_active MSVCRT___setlc_active +@ cdecl __setusermatherr(ptr) MSVCRT___setusermatherr @ stub __strncnt @ stub __swprintf_l -@ cdecl __sys_errlist() msvcr100.__sys_errlist -@ cdecl __sys_nerr() msvcr100.__sys_nerr -@ cdecl __threadhandle() msvcrt.__threadhandle -@ cdecl __threadid() msvcrt.__threadid -@ cdecl __timezone() msvcrt.__p__timezone -@ cdecl __toascii(long) msvcrt.__toascii -@ cdecl __tzname() msvcrt.__p__tzname -@ cdecl __unDName(ptr str long ptr ptr long) msvcrt.__unDName -@ cdecl __unDNameEx(ptr str long ptr ptr ptr long) msvcrt.__unDNameEx +@ 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) @ stub __unDNameHelper -@ extern __unguarded_readlc_active msvcrt.__unguarded_readlc_active -@ cdecl __vswprintf_l(ptr wstr ptr ptr) msvcrt._vswprintf_l -@ extern __wargv msvcrt.__wargv -@ cdecl __wcserror(wstr) msvcrt.__wcserror -@ cdecl __wcserror_s(ptr long wstr) msvcrt.__wcserror_s +@ extern __unguarded_readlc_active MSVCRT___unguarded_readlc_active +@ cdecl __vswprintf_l(ptr wstr ptr ptr) MSVCRT_vswprintf_l +@ extern __wargv MSVCRT___wargv +@ cdecl __wcserror(wstr) MSVCRT___wcserror +@ cdecl __wcserror_s(ptr long wstr) MSVCRT___wcserror_s @ stub __wcsncnt -@ cdecl __wgetmainargs(ptr ptr ptr long ptr) msvcrt.__wgetmainargs -@ extern __winitenv msvcrt.__winitenv -@ cdecl _abnormal_termination() msvcrt._abnormal_termination -@ cdecl -ret64 _abs64(int64) msvcrt._abs64 -@ cdecl _access(str long) msvcrt._access -@ cdecl _access_s(str long) msvcrt._access_s -@ extern _acmdln msvcrt._acmdln -@ stdcall -arch=i386 _adj_fdiv_m16i(long) msvcrt._adj_fdiv_m16i -@ stdcall -arch=i386 _adj_fdiv_m32(long) msvcrt._adj_fdiv_m32 -@ stdcall -arch=i386 _adj_fdiv_m32i(long) msvcrt._adj_fdiv_m32i -@ stdcall -arch=i386 _adj_fdiv_m64(int64) msvcrt._adj_fdiv_m64 -@ cdecl -arch=i386 _adj_fdiv_r() msvcrt._adj_fdiv_r -@ stdcall -arch=i386 _adj_fdivr_m16i(long) msvcrt._adj_fdivr_m16i -@ stdcall -arch=i386 _adj_fdivr_m32(long) msvcrt._adj_fdivr_m32 -@ stdcall -arch=i386 _adj_fdivr_m32i(long) msvcrt._adj_fdivr_m32i -@ stdcall -arch=i386 _adj_fdivr_m64(int64) msvcrt._adj_fdivr_m64 -@ cdecl -arch=i386 _adj_fpatan() msvcrt._adj_fpatan -@ cdecl -arch=i386 _adj_fprem() msvcrt._adj_fprem -@ cdecl -arch=i386 _adj_fprem1() msvcrt._adj_fprem1 -@ cdecl -arch=i386 _adj_fptan() msvcrt._adj_fptan -@ extern -arch=i386 _adjust_fdiv msvcrt._adjust_fdiv -@ extern _aexit_rtn msvcrt._aexit_rtn -@ cdecl _aligned_free(ptr) msvcrt._aligned_free -@ cdecl _aligned_malloc(long long) msvcrt._aligned_malloc -@ cdecl _aligned_msize(ptr long long) msvcr100._aligned_msize -@ cdecl _aligned_offset_malloc(long long long) msvcrt._aligned_offset_malloc -@ cdecl _aligned_offset_realloc(ptr long long long) msvcrt._aligned_offset_realloc +@ cdecl __wgetmainargs(ptr ptr ptr long ptr) +@ extern __winitenv MSVCRT___winitenv +@ cdecl _abnormal_termination() +@ cdecl -ret64 _abs64(int64) +@ cdecl _access(str long) MSVCRT__access +@ cdecl _access_s(str long) MSVCRT__access_s +@ extern _acmdln MSVCRT__acmdln +@ stdcall -arch=i386 _adj_fdiv_m16i(long) +@ stdcall -arch=i386 _adj_fdiv_m32(long) +@ stdcall -arch=i386 _adj_fdiv_m32i(long) +@ stdcall -arch=i386 _adj_fdiv_m64(int64) +@ cdecl -arch=i386 _adj_fdiv_r() +@ stdcall -arch=i386 _adj_fdivr_m16i(long) +@ stdcall -arch=i386 _adj_fdivr_m32(long) +@ stdcall -arch=i386 _adj_fdivr_m32i(long) +@ stdcall -arch=i386 _adj_fdivr_m64(int64) +@ cdecl -arch=i386 _adj_fpatan() +@ cdecl -arch=i386 _adj_fprem() +@ cdecl -arch=i386 _adj_fprem1() +@ cdecl -arch=i386 _adj_fptan() +@ extern -arch=i386 _adjust_fdiv MSVCRT__adjust_fdiv +@ extern _aexit_rtn +@ 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) msvcrt._aligned_realloc +@ cdecl _aligned_realloc(ptr long long) @ stub _aligned_recalloc -@ cdecl _amsg_exit(long) msvcrt._amsg_exit -@ 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) msvcr100._atoflt -@ cdecl _atoflt_l(ptr str ptr) msvcrt._atoflt_l -@ cdecl -ret64 _atoi64(str) msvcrt._atoi64 +@ cdecl _amsg_exit(long) +@ 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 +@ cdecl _atoi_l(str ptr) MSVCRT__atoi_l @ stub _atol_l -@ cdecl _atoldbl(ptr str) msvcrt._atoldbl +@ cdecl _atoldbl(ptr str) MSVCRT__atoldbl @ stub _atoldbl_l -@ cdecl _beep(long long) msvcrt._beep -@ cdecl _beginthread(ptr long ptr) msvcrt._beginthread -@ cdecl _beginthreadex(ptr long ptr ptr long ptr) msvcrt._beginthreadex -@ cdecl _byteswap_uint64(int64) msvcr100._byteswap_uint64 -@ cdecl _byteswap_ulong(long) msvcr100._byteswap_ulong -@ cdecl _byteswap_ushort(long) msvcr100._byteswap_ushort -@ cdecl _c_exit() msvcrt._c_exit -@ cdecl _cabs(long) msvcrt._cabs -@ cdecl _callnewh(long) msvcrt._callnewh -@ cdecl _calloc_crt(long long) msvcrt.calloc -@ cdecl _cexit() msvcrt._cexit -@ cdecl _cgets(ptr) msvcrt._cgets +@ 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) +@ cdecl _calloc_crt(long long) MSVCRT_calloc +@ 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 -arch=i386 -norelay _chkesp() msvcrt._chkesp -@ cdecl _chmod(str long) msvcrt._chmod -@ cdecl _chsize(long long) msvcrt._chsize -@ cdecl _chsize_s(long int64) msvcrt._chsize_s -@ cdecl _clearfp() msvcrt._clearfp -@ cdecl _close(long) msvcrt._close -@ cdecl _commit(long) msvcrt._commit -@ extern _commode msvcrt._commode -@ cdecl _configthreadlocale(long) msvcrt._configthreadlocale -@ cdecl _control87(long long) msvcrt._control87 -@ cdecl _controlfp(long long) msvcrt._controlfp -@ cdecl _controlfp_s(ptr long long) msvcrt._controlfp_s -@ cdecl _copysign(double double) msvcrt._copysign -@ cdecl -arch=arm,x86_64 _copysignf(float float) msvcrt._copysignf -@ varargs _cprintf(str) msvcrt._cprintf +@ cdecl _chdir(str) MSVCRT__chdir +@ cdecl _chdrive(long) MSVCRT__chdrive +@ cdecl _chgsign(double) MSVCRT__chgsign +@ 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 +@ extern _commode MSVCRT__commode +@ cdecl _configthreadlocale(long) +@ cdecl _control87(long long) +@ cdecl _controlfp(long long) +@ cdecl _controlfp_s(ptr long long) +@ cdecl _copysign(double double) MSVCRT__copysign +@ cdecl -arch=arm,x86_64 _copysignf(float float) MSVCRT__copysignf +@ varargs _cprintf(str) @ stub _cprintf_l @ stub _cprintf_p @ stub _cprintf_p_l @ stub _cprintf_s @ stub _cprintf_s_l -@ cdecl _cputs(str) msvcrt._cputs -@ cdecl _cputws(wstr) msvcrt._cputws -@ cdecl _creat(str long) msvcrt._creat -@ cdecl _create_locale(long str) msvcrt._create_locale +@ cdecl _cputs(str) +@ cdecl _cputws(wstr) +@ cdecl _creat(str long) MSVCRT__creat +@ cdecl _create_locale(long str) MSVCRT__create_locale @ stub _crt_debugger_hook -@ varargs _cscanf(str) msvcrt._cscanf -@ varargs _cscanf_l(str ptr) msvcrt._cscanf_l -@ varargs _cscanf_s(str) msvcrt._cscanf_s -@ varargs _cscanf_s_l(str ptr) msvcrt._cscanf_s_l -@ 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) msvcrt._cwait -@ varargs _cwprintf(wstr) msvcrt._cwprintf +@ varargs _cscanf(str) +@ varargs _cscanf_l(str ptr) +@ varargs _cscanf_s(str) +@ varargs _cscanf_s_l(str ptr) +@ 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) +@ varargs _cwprintf(wstr) @ stub _cwprintf_l @ stub _cwprintf_p @ stub _cwprintf_p_l @ stub _cwprintf_s @ stub _cwprintf_s_l -@ varargs _cwscanf(wstr) msvcrt._cwscanf -@ varargs _cwscanf_l(wstr ptr) msvcrt._cwscanf_l -@ varargs _cwscanf_s(wstr) msvcrt._cwscanf_s -@ varargs _cwscanf_s_l(wstr ptr) msvcrt._cwscanf_s_l -@ extern _daylight msvcrt._daylight -@ cdecl _decode_pointer(ptr) MSVCR90_decode_pointer -@ cdecl _difftime32(long long) msvcrt._difftime32 -@ cdecl _difftime64(long long) msvcrt._difftime64 +@ varargs _cwscanf(wstr) +@ varargs _cwscanf_l(wstr ptr) +@ varargs _cwscanf_s(wstr) +@ varargs _cwscanf_s_l(wstr ptr) +@ extern _daylight MSVCRT___daylight +@ cdecl _decode_pointer(ptr) MSVCRT_decode_pointer +@ cdecl _difftime32(long long) MSVCRT__difftime32 +@ cdecl _difftime64(long long) MSVCRT__difftime64 @ stub _dosmaperr -@ extern _dstbias msvcrt._dstbias -@ cdecl _dup(long) msvcrt._dup -@ cdecl _dup2(long long) msvcrt._dup2 -@ cdecl _dupenv_s(ptr ptr str) msvcrt._dupenv_s -@ cdecl _ecvt(double long ptr ptr) msvcrt._ecvt -@ cdecl _ecvt_s(str long double long ptr ptr) msvcrt._ecvt_s -@ cdecl _encode_pointer(ptr) MSVCR90_encode_pointer -@ cdecl _encoded_null() msvcr100._encoded_null -@ cdecl _endthread() msvcrt._endthread -@ cdecl _endthreadex(long) msvcrt._endthreadex -@ extern _environ msvcrt._environ -@ cdecl _eof(long) msvcrt._eof -@ cdecl _errno() msvcrt._errno -@ cdecl -arch=i386 _except_handler2(ptr ptr ptr ptr) msvcrt._except_handler2 -@ cdecl -arch=i386 _except_handler3(ptr ptr ptr ptr) msvcrt._except_handler3 -@ cdecl -arch=i386 _except_handler4_common(ptr ptr ptr ptr ptr ptr) msvcrt._except_handler4_common -@ varargs _execl(str str) msvcrt._execl -@ varargs _execle(str str) msvcrt._execle -@ varargs _execlp(str str) msvcrt._execlp -@ varargs _execlpe(str str) msvcrt._execlpe -@ cdecl _execv(str ptr) msvcrt._execv -@ cdecl _execve(str ptr ptr) msvcrt._execve -@ cdecl _execvp(str ptr) msvcrt._execvp -@ cdecl _execvpe(str ptr ptr) msvcrt._execvpe -@ cdecl _exit(long) msvcrt._exit -@ cdecl _expand(ptr long) msvcrt._expand +@ extern _dstbias MSVCRT__dstbias +@ 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 _encode_pointer(ptr) MSVCRT_encode_pointer +@ cdecl _encoded_null() +@ cdecl _endthread() +@ cdecl _endthreadex(long) +@ extern _environ MSVCRT__environ +@ cdecl _eof(long) MSVCRT__eof +@ cdecl _errno() MSVCRT__errno +@ 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) +@ 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) @ stub _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 -@ cdecl _fdopen(long str) msvcrt._fdopen +@ cdecl _fcloseall() MSVCRT__fcloseall +@ cdecl _fcvt(double long ptr ptr) MSVCRT__fcvt +@ cdecl _fcvt_s(ptr long double long ptr ptr) MSVCRT__fcvt_s +@ cdecl _fdopen(long str) MSVCRT__fdopen @ stub _fflush_nolock -@ cdecl _fgetchar() msvcrt._fgetchar +@ cdecl _fgetchar() MSVCRT__fgetchar @ stub _fgetwc_nolock -@ cdecl _fgetwchar() msvcrt._fgetwchar -@ cdecl _filbuf(ptr) msvcrt._filbuf -@ 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 +@ cdecl _fgetwchar() MSVCRT__fgetwchar +@ cdecl _filbuf(ptr) MSVCRT__filbuf +@ 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 +@ 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 _flsbuf(long ptr) msvcrt._flsbuf -@ cdecl _flushall() msvcrt._flushall -@ extern _fmode msvcrt._fmode -@ cdecl _fpclass(double) msvcrt._fpclass +@ 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 _flsbuf(long ptr) MSVCRT__flsbuf +@ cdecl _flushall() MSVCRT__flushall +@ extern _fmode MSVCRT__fmode +@ cdecl _fpclass(double) MSVCRT__fpclass # stub -arch=win64 _fpclassf(float) -@ cdecl _fpieee_flt(long ptr ptr) msvcrt._fpieee_flt -@ cdecl _fpreset() msvcrt._fpreset +@ stub _fpieee_flt(long ptr ptr) +@ cdecl _fpreset() @ stub _fprintf_l @ stub _fprintf_p @ stub _fprintf_p_l @ stub _fprintf_s_l -@ cdecl _fputchar(long) msvcrt._fputchar +@ cdecl _fputchar(long) MSVCRT__fputchar @ stub _fputwc_nolock -@ cdecl _fputwchar(long) msvcrt._fputwchar +@ cdecl _fputwchar(long) MSVCRT__fputwchar @ stub _fread_nolock @ stub _fread_nolock_s -@ cdecl _free_locale(ptr) msvcrt._free_locale +@ cdecl _free_locale(ptr) MSVCRT__free_locale @ stub _freea @ stub _freea_s @ stub _freefls -@ varargs _fscanf_l(ptr str ptr) msvcrt._fscanf_l -@ varargs _fscanf_s_l(ptr str ptr) msvcrt._fscanf_s_l +@ varargs _fscanf_l(ptr str ptr) MSVCRT__fscanf_l +@ varargs _fscanf_s_l(ptr str ptr) MSVCRT__fscanf_s_l @ stub _fseek_nolock -@ cdecl _fseeki64(ptr int64 long) msvcrt._fseeki64 +@ cdecl _fseeki64(ptr int64 long) MSVCRT__fseeki64 @ stub _fseeki64_nolock -@ cdecl _fsopen(str str long) msvcrt._fsopen -@ cdecl _fstat32(long ptr) msvcrt._fstat32 +@ 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 _fstat64(long ptr) MSVCRT__fstat64 +@ cdecl _fstat64i32(long ptr) MSVCRT__fstat64i32 @ stub _ftell_nolock -@ cdecl -ret64 _ftelli64(ptr) msvcrt._ftelli64 +@ cdecl -ret64 _ftelli64(ptr) MSVCRT__ftelli64 @ stub _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) msvcrt._futime32 -@ cdecl _futime64(long ptr) msvcrt._futime64 -@ varargs _fwprintf_l(ptr wstr ptr) msvcrt._fwprintf_l +@ 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) +@ varargs _fwprintf_l(ptr wstr ptr) MSVCRT__fwprintf_l @ stub _fwprintf_p @ stub _fwprintf_p_l @ stub _fwprintf_s_l @ stub _fwrite_nolock -@ varargs _fwscanf_l(ptr wstr ptr) msvcrt._fwscanf_l -@ varargs _fwscanf_s_l(ptr wstr ptr) msvcrt._fwscanf_s_l -@ cdecl _gcvt(double long str) msvcrt._gcvt -@ cdecl _gcvt_s(ptr long double long) msvcrt._gcvt_s +@ varargs _fwscanf_l(ptr wstr ptr) MSVCRT__fwscanf_l +@ varargs _fwscanf_s_l(ptr wstr ptr) MSVCRT__fwscanf_s_l +@ cdecl _gcvt(double long str) MSVCRT__gcvt +@ cdecl _gcvt_s(ptr long double long) MSVCRT__gcvt_s @ stub _get_amblksiz -@ cdecl _get_current_locale() msvcrt._get_current_locale -@ cdecl _get_daylight(ptr) msvcr100._get_daylight -@ cdecl _get_doserrno(ptr) msvcrt._get_doserrno +@ cdecl _get_current_locale() MSVCRT__get_current_locale +@ cdecl _get_daylight(ptr) +@ cdecl _get_doserrno(ptr) @ stub _get_dstbias -@ cdecl _get_errno(ptr) msvcrt._get_errno -@ cdecl _get_fmode(ptr) msvcrt._get_fmode -@ cdecl _get_heap_handle() msvcrt._get_heap_handle -@ cdecl _get_invalid_parameter_handler() msvcrt._get_invalid_parameter_handler -@ cdecl _get_osfhandle(long) msvcrt._get_osfhandle -@ cdecl _get_output_format() msvcrt._get_output_format -@ cdecl _get_pgmptr(ptr) msvcrt._get_pgmptr -@ cdecl _get_printf_count_output() msvcrt._get_printf_count_output +@ cdecl _get_errno(ptr) +@ cdecl _get_fmode(ptr) MSVCRT__get_fmode +@ cdecl _get_heap_handle() +@ cdecl _get_invalid_parameter_handler() +@ cdecl _get_osfhandle(long) MSVCRT__get_osfhandle +@ cdecl _get_output_format() MSVCRT__get_output_format +@ cdecl _get_pgmptr(ptr) +@ cdecl _get_printf_count_output() MSVCRT__get_printf_count_output @ stub _get_purecall_handler -@ cdecl _get_sbh_threshold() msvcrt._get_sbh_threshold -@ cdecl _get_terminate() msvcrt._get_terminate -@ cdecl _get_timezone(ptr) msvcr100._get_timezone -@ cdecl _get_tzname(ptr str long long) msvcrt._get_tzname -@ cdecl _get_unexpected() msvcrt._get_unexpected -@ cdecl _get_wpgmptr(ptr) msvcrt._get_wpgmptr +@ cdecl _get_sbh_threshold() +@ cdecl _get_terminate() MSVCRT__get_terminate +@ cdecl _get_timezone(ptr) +@ cdecl _get_tzname(ptr str long long) MSVCRT__get_tzname +@ cdecl _get_unexpected() MSVCRT__get_unexpected +@ cdecl _get_wpgmptr(ptr) @ stub _getc_nolock -@ cdecl _getch() msvcrt._getch +@ cdecl _getch() @ stub _getch_nolock -@ cdecl _getche() msvcrt._getche +@ cdecl _getche() @ stub _getche_nolock -@ cdecl _getcwd(str long) msvcrt._getcwd -@ cdecl _getdcwd(long str long) msvcrt._getdcwd +@ cdecl _getcwd(str long) MSVCRT__getcwd +@ cdecl _getdcwd(long str long) MSVCRT__getdcwd @ stub _getdcwd_nolock -@ cdecl _getdiskfree(long ptr) msvcrt._getdiskfree -@ cdecl _getdllprocaddr(long str long) msvcrt._getdllprocaddr -@ cdecl _getdrive() msvcrt._getdrive -@ cdecl _getdrives() msvcrt._getdrives -@ cdecl _getmaxstdio() msvcrt._getmaxstdio -@ cdecl _getmbcp() msvcrt._getmbcp -@ cdecl _getpid() msvcrt._getpid -@ cdecl _getptd() msvcrt._getptd -@ cdecl _getsystime(ptr) msvcrt._getsystime -@ cdecl _getw(ptr) msvcrt._getw +@ 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 +@ cdecl _getptd() +@ stub _getsystime(ptr) +@ cdecl _getw(ptr) MSVCRT__getw @ stub _getwch @ stub _getwch_nolock @ stub _getwche @ stub _getwche_nolock -@ cdecl _getws(ptr) msvcrt._getws +@ cdecl _getws(ptr) MSVCRT__getws @ stub _getws_s -@ cdecl -arch=i386 _global_unwind2(ptr) msvcrt._global_unwind2 -@ 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 _heapadd(ptr long) msvcrt._heapadd -@ cdecl _heapchk() msvcrt._heapchk -@ cdecl _heapmin() msvcrt._heapmin -@ cdecl _heapset(long) msvcrt._heapset -@ cdecl _heapused(ptr ptr) msvcrt._heapused -@ cdecl _heapwalk(ptr) msvcrt._heapwalk -@ cdecl _hypot(double double) msvcrt._hypot -@ cdecl _hypotf(float float) msvcrt._hypotf -@ cdecl _i64toa(int64 ptr long) msvcrt._i64toa -@ cdecl _i64toa_s(int64 ptr long long) msvcrt._i64toa_s -@ cdecl _i64tow(int64 ptr long) msvcrt._i64tow -@ cdecl _i64tow_s(int64 ptr long long) msvcrt._i64tow_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 _heapadd(ptr long) +@ cdecl _heapchk() +@ cdecl _heapmin() +@ cdecl _heapset(long) +@ stub _heapused(ptr ptr) +@ 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 @ stub _initptd -@ cdecl _initterm(ptr ptr) msvcrt._initterm -@ cdecl _initterm_e(ptr ptr) msvcrt._initterm_e -@ cdecl -arch=i386 _inp(long) msvcrt._inp -@ cdecl -arch=i386 _inpd(long) msvcrt._inpd -@ cdecl -arch=i386 _inpw(long) msvcrt._inpw -@ cdecl _invalid_parameter(wstr wstr wstr long long) msvcrt._invalid_parameter -@ cdecl _invalid_parameter_noinfo() msvcr100._invalid_parameter_noinfo +@ cdecl _initterm(ptr ptr) +@ cdecl _initterm_e(ptr ptr) +@ stub -arch=i386 _inp(long) +@ stub -arch=i386 _inpd(long) +@ stub -arch=i386 _inpw(long) +@ cdecl _invalid_parameter(wstr wstr wstr long long) MSVCRT__invalid_parameter +@ cdecl _invalid_parameter_noinfo() @ stub _invoke_watson -@ extern _iob msvcrt._iob -@ cdecl _isalnum_l(long ptr) msvcrt._isalnum_l -@ cdecl _isalpha_l(long ptr) msvcrt._isalpha_l -@ cdecl _isatty(long) msvcrt._isatty -@ 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 -@ cdecl _ismbbalnum(long) msvcrt._ismbbalnum +@ extern _iob MSVCRT__iob +@ cdecl _isalnum_l(long ptr) MSVCRT__isalnum_l +@ cdecl _isalpha_l(long ptr) MSVCRT__isalpha_l +@ cdecl _isatty(long) MSVCRT__isatty +@ 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 -@ cdecl _ismbbalpha(long) msvcrt._ismbbalpha +@ stub _ismbbalpha(long) @ stub _ismbbalpha_l -@ cdecl _ismbbgraph(long) msvcrt._ismbbgraph +@ stub _ismbbgraph(long) @ stub _ismbbgraph_l -@ cdecl _ismbbkalnum(long) msvcrt._ismbbkalnum +@ stub _ismbbkalnum(long) @ stub _ismbbkalnum_l -@ cdecl _ismbbkana(long) msvcrt._ismbbkana +@ cdecl _ismbbkana(long) @ stub _ismbbkana_l -@ cdecl _ismbbkprint(long) msvcrt._ismbbkprint +@ stub _ismbbkprint(long) @ stub _ismbbkprint_l -@ cdecl _ismbbkpunct(long) msvcrt._ismbbkpunct +@ stub _ismbbkpunct(long) @ stub _ismbbkpunct_l -@ cdecl _ismbblead(long) msvcrt._ismbblead +@ cdecl _ismbblead(long) @ stub _ismbblead_l -@ cdecl _ismbbprint(long) msvcrt._ismbbprint +@ stub _ismbbprint(long) @ stub _ismbbprint_l -@ cdecl _ismbbpunct(long) msvcrt._ismbbpunct +@ stub _ismbbpunct(long) @ stub _ismbbpunct_l -@ cdecl _ismbbtrail(long) msvcrt._ismbbtrail +@ cdecl _ismbbtrail(long) @ stub _ismbbtrail_l -@ cdecl _ismbcalnum(long) msvcrt._ismbcalnum +@ cdecl _ismbcalnum(long) @ stub _ismbcalnum_l -@ cdecl _ismbcalpha(long) msvcrt._ismbcalpha +@ cdecl _ismbcalpha(long) @ stub _ismbcalpha_l -@ cdecl _ismbcdigit(long) msvcrt._ismbcdigit +@ cdecl _ismbcdigit(long) @ stub _ismbcdigit_l -@ cdecl _ismbcgraph(long) msvcrt._ismbcgraph +@ cdecl _ismbcgraph(long) @ stub _ismbcgraph_l -@ cdecl _ismbchira(long) msvcrt._ismbchira +@ cdecl _ismbchira(long) @ stub _ismbchira_l -@ cdecl _ismbckata(long) msvcrt._ismbckata +@ cdecl _ismbckata(long) @ stub _ismbckata_l -@ cdecl _ismbcl0(long) msvcrt._ismbcl0 +@ stub _ismbcl0(long) @ stub _ismbcl0_l -@ cdecl _ismbcl1(long) msvcrt._ismbcl1 +@ stub _ismbcl1(long) @ stub _ismbcl1_l -@ cdecl _ismbcl2(long) msvcrt._ismbcl2 +@ stub _ismbcl2(long) @ stub _ismbcl2_l -@ cdecl _ismbclegal(long) msvcrt._ismbclegal +@ cdecl _ismbclegal(long) @ stub _ismbclegal_l -@ cdecl _ismbclower(long) msvcrt._ismbclower +@ cdecl _ismbclower(long) @ stub _ismbclower_l -@ cdecl _ismbcprint(long) msvcrt._ismbcprint +@ cdecl _ismbcprint(long) @ stub _ismbcprint_l -@ cdecl _ismbcpunct(long) msvcrt._ismbcpunct +@ cdecl _ismbcpunct(long) @ stub _ismbcpunct_l -@ cdecl _ismbcspace(long) msvcrt._ismbcspace +@ cdecl _ismbcspace(long) @ stub _ismbcspace_l -@ cdecl _ismbcsymbol(long) msvcrt._ismbcsymbol +@ cdecl _ismbcsymbol(long) @ stub _ismbcsymbol_l -@ cdecl _ismbcupper(long) msvcrt._ismbcupper +@ cdecl _ismbcupper(long) @ stub _ismbcupper_l -@ cdecl _ismbslead(ptr ptr) msvcrt._ismbslead +@ cdecl _ismbslead(ptr ptr) @ stub _ismbslead_l -@ cdecl _ismbstrail(ptr ptr) msvcrt._ismbstrail +@ 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 +@ 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 +@ 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 +@ cdecl _iswalpha_l(long ptr) MSVCRT__iswalpha_l @ stub _iswcntrl_l @ stub _iswcsym_l @ stub _iswcsymf_l @ stub _iswctype_l -@ cdecl _iswdigit_l(long ptr) msvcrt._iswdigit_l +@ cdecl _iswdigit_l(long ptr) MSVCRT__iswdigit_l @ stub _iswgraph_l @ stub _iswlower_l @ stub _iswprint_l @@ -677,407 +677,407 @@ @ stub _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) msvcrt._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() msvcrt._kbhit -@ cdecl _lfind(ptr ptr ptr long ptr) msvcrt._lfind +@ 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() +@ cdecl _lfind(ptr ptr ptr long ptr) @ stub _lfind_s -@ cdecl _loaddll(str) msvcrt._loaddll -@ cdecl -arch=x86_64 _local_unwind(ptr ptr) msvcrt._local_unwind -@ cdecl -arch=i386 _local_unwind2(ptr long) msvcrt._local_unwind2 -@ cdecl -arch=i386 _local_unwind4(ptr ptr long) msvcrt._local_unwind4 -@ cdecl _localtime32(ptr) msvcrt._localtime32 -@ cdecl _localtime32_s(ptr ptr) msvcrt._localtime32_s -@ cdecl _localtime64(ptr) msvcrt._localtime64 -@ cdecl _localtime64_s(ptr ptr) msvcrt._localtime64_s -@ cdecl _lock(long) msvcrt._lock -@ cdecl _lock_file(ptr) msvcrt._lock_file -@ 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._longjmpex -@ cdecl _lrotl(long long) msvcrt._lrotl -@ cdecl _lrotr(long long) msvcrt._lrotr -@ cdecl _lsearch(ptr ptr ptr long ptr) msvcrt._lsearch +@ 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(long) +@ cdecl _lock_file(ptr) MSVCRT__lock_file +@ 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) msvcrt._ltoa -@ cdecl _ltoa_s(long ptr long long) msvcrt._ltoa_s -@ cdecl _ltow(long ptr long) msvcrt._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 -@ cdecl _malloc_crt(long) msvcrt.malloc -@ cdecl _mbbtombc(long) msvcrt._mbbtombc +@ 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 +@ cdecl _malloc_crt(long) MSVCRT_malloc +@ cdecl _mbbtombc(long) @ stub _mbbtombc_l -@ cdecl _mbbtype(long long) msvcrt._mbbtype +@ cdecl _mbbtype(long long) @ stub _mbbtype_l # extern _mbcasemap -@ cdecl _mbccpy(ptr str) msvcrt._mbccpy +@ cdecl _mbccpy(ptr str) @ stub _mbccpy_l @ stub _mbccpy_s @ stub _mbccpy_s_l -@ cdecl _mbcjistojms(long) msvcrt._mbcjistojms +@ cdecl _mbcjistojms(long) @ stub _mbcjistojms_l -@ cdecl _mbcjmstojis(long) msvcrt._mbcjmstojis +@ cdecl _mbcjmstojis(long) @ stub _mbcjmstojis_l -@ cdecl _mbclen(ptr) msvcrt._mbclen +@ cdecl _mbclen(ptr) @ stub _mbclen_l -@ cdecl _mbctohira(long) msvcrt._mbctohira +@ stub _mbctohira(long) @ stub _mbctohira_l -@ cdecl _mbctokata(long) msvcrt._mbctokata +@ stub _mbctokata(long) @ stub _mbctokata_l -@ cdecl _mbctolower(long) msvcrt._mbctolower +@ cdecl _mbctolower(long) @ stub _mbctolower_l -@ cdecl _mbctombb(long) msvcrt._mbctombb +@ cdecl _mbctombb(long) @ stub _mbctombb_l -@ cdecl _mbctoupper(long) msvcrt._mbctoupper +@ cdecl _mbctoupper(long) @ stub _mbctoupper_l -@ extern _mbctype msvcrt._mbctype +@ extern _mbctype MSVCRT_mbctype @ stub _mblen_l -@ cdecl _mbsbtype(str long) msvcrt._mbsbtype +@ cdecl _mbsbtype(str long) @ stub _mbsbtype_l @ stub _mbscat_s @ stub _mbscat_s_l -@ cdecl _mbschr(str long) msvcrt._mbschr +@ cdecl _mbschr(str long) @ stub _mbschr_l -@ cdecl _mbscmp(str str) msvcrt._mbscmp +@ cdecl _mbscmp(str str) @ stub _mbscmp_l -@ cdecl _mbscoll(str str) msvcrt._mbscoll -@ cdecl _mbscoll_l(str str ptr) msvcrt._mbscoll_l +@ cdecl _mbscoll(str str) +@ cdecl _mbscoll_l(str str ptr) @ stub _mbscpy_s @ stub _mbscpy_s_l -@ cdecl _mbscspn(str str) msvcrt._mbscspn +@ cdecl _mbscspn(str str) @ stub _mbscspn_l -@ cdecl _mbsdec(ptr ptr) msvcrt._mbsdec +@ cdecl _mbsdec(ptr ptr) @ stub _mbsdec_l -@ cdecl _mbsicmp(str str) msvcrt._mbsicmp +@ cdecl _mbsicmp(str str) @ stub _mbsicmp_l -@ cdecl _mbsicoll(str str) msvcrt._mbsicoll -@ cdecl _mbsicoll_l(str str ptr) msvcrt._mbsicoll_l -@ cdecl _mbsinc(str) msvcrt._mbsinc +@ cdecl _mbsicoll(str str) +@ cdecl _mbsicoll_l(str str ptr) +@ cdecl _mbsinc(str) @ stub _mbsinc_l -@ cdecl _mbslen(str) msvcrt._mbslen +@ cdecl _mbslen(str) @ stub _mbslen_l -@ cdecl _mbslwr(str) msvcrt._mbslwr +@ cdecl _mbslwr(str) @ stub _mbslwr_l -@ cdecl _mbslwr_s(str long) msvcrt._mbslwr_s +@ cdecl _mbslwr_s(str long) @ stub _mbslwr_s_l -@ cdecl _mbsnbcat(str str long) msvcrt._mbsnbcat +@ cdecl _mbsnbcat(str str long) @ stub _mbsnbcat_l -@ cdecl _mbsnbcat_s(str long ptr long) msvcrt._mbsnbcat_s +@ cdecl _mbsnbcat_s(str long ptr long) @ stub _mbsnbcat_s_l -@ cdecl _mbsnbcmp(str str long) msvcrt._mbsnbcmp +@ cdecl _mbsnbcmp(str str long) @ stub _mbsnbcmp_l -@ cdecl _mbsnbcnt(ptr long) msvcrt._mbsnbcnt +@ cdecl _mbsnbcnt(ptr long) @ stub _mbsnbcnt_l -@ cdecl _mbsnbcoll(str str long) msvcrt._mbsnbcoll -@ cdecl _mbsnbcoll_l(str str long ptr) msvcrt._mbsnbcoll_l -@ cdecl _mbsnbcpy(ptr str long) msvcrt._mbsnbcpy +@ 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) msvcrt._mbsnbcpy_s +@ cdecl _mbsnbcpy_s(ptr long str long) @ stub _mbsnbcpy_s_l -@ cdecl _mbsnbicmp(str str long) msvcrt._mbsnbicmp +@ cdecl _mbsnbicmp(str str long) @ stub _mbsnbicmp_l -@ cdecl _mbsnbicoll(str str long) msvcrt._mbsnbicoll -@ cdecl _mbsnbicoll_l(str str long ptr) msvcrt._mbsnbicoll_l -@ cdecl _mbsnbset(ptr long long) msvcrt._mbsnbset +@ 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) msvcrt._mbsncat +@ cdecl _mbsncat(str str long) @ stub _mbsncat_l @ stub _mbsncat_s @ stub _mbsncat_s_l -@ cdecl _mbsnccnt(str long) msvcrt._mbsnccnt +@ cdecl _mbsnccnt(str long) @ stub _mbsnccnt_l -@ cdecl _mbsncmp(str str long) msvcrt._mbsncmp +@ cdecl _mbsncmp(str str long) @ stub _mbsncmp_l -@ cdecl _mbsncoll(str str long) msvcrt._mbsncoll +@ stub _mbsncoll(str str long) @ stub _mbsncoll_l -@ cdecl _mbsncpy(ptr str long) msvcrt._mbsncpy +@ cdecl _mbsncpy(ptr str long) @ stub _mbsncpy_l @ stub _mbsncpy_s @ stub _mbsncpy_s_l -@ cdecl _mbsnextc(str) msvcrt._mbsnextc +@ cdecl _mbsnextc(str) @ stub _mbsnextc_l -@ cdecl _mbsnicmp(str str long) msvcrt._mbsnicmp +@ cdecl _mbsnicmp(str str long) @ stub _mbsnicmp_l -@ cdecl _mbsnicoll(str str long) msvcrt._mbsnicoll +@ stub _mbsnicoll(str str long) @ stub _mbsnicoll_l -@ cdecl _mbsninc(str long) msvcrt._mbsninc +@ cdecl _mbsninc(str long) @ stub _mbsninc_l @ stub _mbsnlen @ stub _mbsnlen_l -@ cdecl _mbsnset(ptr long long) msvcrt._mbsnset +@ cdecl _mbsnset(ptr long long) @ stub _mbsnset_l @ stub _mbsnset_s @ stub _mbsnset_s_l -@ cdecl _mbspbrk(str str) msvcrt._mbspbrk +@ cdecl _mbspbrk(str str) @ stub _mbspbrk_l -@ cdecl _mbsrchr(str long) msvcrt._mbsrchr +@ cdecl _mbsrchr(str long) @ stub _mbsrchr_l -@ cdecl _mbsrev(str) msvcrt._mbsrev +@ cdecl _mbsrev(str) @ stub _mbsrev_l -@ cdecl _mbsset(ptr long) msvcrt._mbsset +@ cdecl _mbsset(ptr long) @ stub _mbsset_l @ stub _mbsset_s @ stub _mbsset_s_l -@ cdecl _mbsspn(str str) msvcrt._mbsspn +@ cdecl _mbsspn(str str) @ stub _mbsspn_l -@ cdecl _mbsspnp(str str) msvcrt._mbsspnp +@ cdecl _mbsspnp(str str) @ stub _mbsspnp_l -@ cdecl _mbsstr(str str) msvcrt._mbsstr +@ cdecl _mbsstr(str str) @ stub _mbsstr_l -@ cdecl _mbstok(str str) msvcr100._mbstok #don't forward to msvcrt -@ cdecl _mbstok_l(str str ptr) msvcrt._mbstok_l -@ cdecl _mbstok_s(str str ptr) msvcrt._mbstok_s -@ cdecl _mbstok_s_l(str str ptr ptr) msvcrt._mbstok_s_l -@ 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) msvcrt._mbstrlen -@ cdecl _mbstrlen_l(str ptr) msvcrt._mbstrlen_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) msvcrt._mbsupr +@ cdecl _mbsupr(str) @ stub _mbsupr_l -@ cdecl _mbsupr_s(str long) msvcrt._mbsupr_s +@ 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) msvcrt._memccpy -@ cdecl _memicmp(str str long) msvcrt._memicmp +@ 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) msvcrt._msize -@ cdecl _nextafter(double double) msvcrt._nextafter -@ cdecl -arch=arm,x86_64 _nextafterf(float float) msvcrt._nextafterf -@ cdecl _onexit(ptr) msvcrt._onexit -@ varargs _open(str long) msvcrt._open -@ cdecl _open_osfhandle(long long) msvcrt._open_osfhandle -@ cdecl -arch=i386 _outp(long long) msvcrt._outp -@ cdecl -arch=i386 _outpd(long long) msvcrt._outpd -@ cdecl -arch=i386 _outpw(long long) msvcrt._outpw -@ cdecl _pclose(ptr) msvcrt._pclose -@ extern _pctype msvcrt._pctype -@ extern _pgmptr msvcrt._pgmptr -@ cdecl _pipe(ptr long long) msvcrt._pipe -@ cdecl _popen(str str) msvcrt._popen +@ 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 +@ cdecl _onexit(ptr) MSVCRT__onexit +@ varargs _open(str long) MSVCRT__open +@ cdecl _open_osfhandle(long long) MSVCRT__open_osfhandle +@ stub -arch=i386 _outp(long long) +@ stub -arch=i386 _outpd(long long) +@ stub -arch=i386 _outpw(long long) +@ cdecl _pclose(ptr) MSVCRT__pclose +@ extern _pctype MSVCRT__pctype +@ extern _pgmptr MSVCRT__pgmptr +@ cdecl _pipe(ptr long long) MSVCRT__pipe +@ cdecl _popen(str str) MSVCRT__popen @ stub _printf_l @ stub _printf_p @ stub _printf_p_l @ stub _printf_s_l -@ cdecl _purecall() msvcrt._purecall -@ cdecl _putch(long) msvcrt._putch +@ cdecl _purecall() +@ cdecl _putch(long) @ stub _putch_nolock -@ cdecl _putenv(str) msvcrt._putenv -@ cdecl _putenv_s(str str) msvcrt._putenv_s -@ cdecl _putw(long ptr) msvcrt._putw -@ cdecl _putwch(long) msvcrt._putwch +@ cdecl _putenv(str) +@ cdecl _putenv_s(str str) +@ cdecl _putw(long ptr) MSVCRT__putw +@ cdecl _putwch(long) MSVCRT__putwch @ stub _putwch_nolock -@ cdecl _putws(wstr) msvcrt._putws +@ cdecl _putws(wstr) MSVCRT__putws # extern _pwctype -@ cdecl _read(long ptr long) msvcrt._read -@ cdecl _realloc_crt(ptr long) msvcrt.realloc -@ cdecl _recalloc(ptr long long) msvcr100._recalloc +@ cdecl _read(long ptr long) MSVCRT__read +@ cdecl _realloc_crt(ptr long) MSVCRT_realloc +@ cdecl _recalloc(ptr long long) @ stub _recalloc_crt -@ cdecl _resetstkoflw() msvcrt._resetstkoflw -@ cdecl _rmdir(str) msvcrt._rmdir -@ cdecl _rmtmp() msvcrt._rmtmp -@ cdecl _rotl(long long) msvcrt._rotl -@ cdecl -ret64 _rotl64(int64 long) msvcrt._rotl64 -@ cdecl _rotr(long long) msvcrt._rotr -@ cdecl -ret64 _rotr64(int64 long) msvcrt._rotr64 -@ cdecl -arch=i386 _safe_fdiv() msvcrt._safe_fdiv -@ cdecl -arch=i386 _safe_fdivr() msvcrt._safe_fdivr -@ cdecl -arch=i386 _safe_fprem() msvcrt._safe_fprem -@ cdecl -arch=i386 _safe_fprem1() msvcrt._safe_fprem1 -@ cdecl _scalb(double long) msvcrt._scalb -@ cdecl -arch=arm,x86_64 _scalbf(float long) msvcrt._scalbf -@ varargs _scanf_l(str ptr) msvcrt._scanf_l -@ varargs _scanf_s_l(str ptr) msvcrt._scanf_s_l -@ varargs _scprintf(str) msvcrt._scprintf +@ 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 -arch=i386 _safe_fdiv() +@ cdecl -arch=i386 _safe_fdivr() +@ cdecl -arch=i386 _safe_fprem() +@ cdecl -arch=i386 _safe_fprem1() +@ cdecl _scalb(double long) MSVCRT__scalb +@ cdecl -arch=arm,x86_64 _scalbf(float long) MSVCRT__scalbf +@ varargs _scanf_l(str ptr) MSVCRT__scanf_l +@ varargs _scanf_s_l(str ptr) MSVCRT__scanf_s_l +@ varargs _scprintf(str) MSVCRT__scprintf @ stub _scprintf_l @ stub _scprintf_p @ stub _scprintf_p_l -@ varargs _scwprintf(wstr) msvcrt._scwprintf +@ varargs _scwprintf(wstr) MSVCRT__scwprintf @ stub _scwprintf_l @ stub _scwprintf_p @ stub _scwprintf_p_l -@ cdecl _searchenv(str str ptr) msvcrt._searchenv -@ cdecl _searchenv_s(str str ptr long) msvcrt._searchenv_s -@ stdcall -arch=i386 _seh_longjmp_unwind4(ptr) msvcrt._seh_longjmp_unwind4 -@ stdcall -arch=i386 _seh_longjmp_unwind(ptr) msvcrt._seh_longjmp_unwind -@ cdecl _set_SSE2_enable(long) msvcrt._set_SSE2_enable -@ cdecl _set_abort_behavior(long long) msvcrt._set_abort_behavior +@ cdecl _searchenv(str str ptr) MSVCRT__searchenv +@ cdecl _searchenv_s(str str ptr long) MSVCRT__searchenv_s +@ stdcall -arch=i386 _seh_longjmp_unwind4(ptr) +@ stdcall -arch=i386 _seh_longjmp_unwind(ptr) +@ cdecl _set_SSE2_enable(long) MSVCRT__set_SSE2_enable +@ cdecl _set_abort_behavior(long long) MSVCRT__set_abort_behavior @ stub _set_amblksiz -@ cdecl _set_controlfp(long long) msvcrt._set_controlfp -@ cdecl _set_doserrno(long) msvcrt._set_doserrno -@ cdecl _set_errno(long) msvcrt._set_errno -@ cdecl _set_error_mode(long) msvcrt._set_error_mode -@ cdecl _set_fmode(long) msvcrt._set_fmode -@ cdecl _set_invalid_parameter_handler(ptr) msvcrt._set_invalid_parameter_handler +@ 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) @ stub _set_malloc_crt_max_wait -@ cdecl _set_output_format(long) msvcrt._set_output_format -@ cdecl _set_printf_count_output(long) msvcrt._set_printf_count_output -@ cdecl _set_purecall_handler(ptr) msvcrt._set_purecall_handler -@ cdecl _set_sbh_threshold(long) msvcrt._set_sbh_threshold -@ cdecl _seterrormode(long) msvcrt._seterrormode -@ cdecl -arch=i386,x86_64,arm -norelay _setjmp(ptr) msvcrt._setjmp -@ cdecl -arch=i386 -norelay _setjmp3(ptr long) msvcrt._setjmp3 -@ cdecl _setmaxstdio(long) msvcrt._setmaxstdio -@ cdecl _setmbcp(long) msvcrt._setmbcp -@ cdecl _setmode(long long) msvcrt._setmode -@ cdecl _setsystime(ptr long) msvcrt._setsystime -@ cdecl _sleep(long) msvcrt._sleep -@ varargs _snprintf(ptr long str) msvcrt._snprintf +@ cdecl _set_output_format(long) +@ cdecl _set_printf_count_output(long) MSVCRT__set_printf_count_output +@ cdecl _set_purecall_handler(ptr) +@ cdecl _set_sbh_threshold(long) +@ cdecl _seterrormode(long) +@ cdecl -arch=i386,x86_64,arm -norelay _setjmp(ptr) MSVCRT__setjmp +@ 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 _snprintf(ptr long str) MSVCRT__snprintf @ stub _snprintf_c @ stub _snprintf_c_l @ stub _snprintf_l -@ varargs _snprintf_s(ptr long long str) msvcrt._snprintf_s +@ varargs _snprintf_s(ptr long long str) MSVCRT__snprintf_s @ stub _snprintf_s_l -@ varargs _snscanf(str long str) msvcrt._snscanf -@ varargs _snscanf_l(str long str ptr) msvcrt._snscanf_l -@ varargs _snscanf_s(str long str) msvcrt._snscanf_s -@ varargs _snscanf_s_l(str long str ptr) msvcrt._snscanf_s_l -@ varargs _snwprintf(ptr long wstr) msvcrt._snwprintf -@ varargs _snwprintf_l(ptr long wstr ptr) msvcrt._snwprintf_l -@ varargs _snwprintf_s(ptr long long wstr) msvcrt._snwprintf_s -@ varargs _snwprintf_s_l(ptr long long wstr ptr) msvcrt._snwprintf_s_l -@ varargs _snwscanf(wstr long wstr) msvcrt._snwscanf -@ varargs _snwscanf_l(wstr long wstr ptr) msvcrt._snwscanf_l -@ varargs _snwscanf_s(wstr long wstr) msvcrt._snwscanf_s -@ varargs _snwscanf_s_l(wstr long wstr ptr) msvcrt._snwscanf_s_l -@ varargs _sopen(str long long) msvcrt._sopen -@ cdecl _sopen_s(ptr str long long long) msvcrt._sopen_s -@ varargs _spawnl(long str str) msvcrt._spawnl -@ varargs _spawnle(long str str) msvcrt._spawnle -@ varargs _spawnlp(long str str) msvcrt._spawnlp -@ varargs _spawnlpe(long str str) msvcrt._spawnlpe -@ cdecl _spawnv(long str ptr) msvcrt._spawnv -@ cdecl _spawnve(long str ptr ptr) msvcrt._spawnve -@ cdecl _spawnvp(long str ptr) msvcrt._spawnvp -@ 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 -@ varargs _sprintf_l(ptr str ptr) msvcrt._sprintf_l -@ varargs _sprintf_p(ptr long str) msvcr100._sprintf_p -@ varargs _sprintf_p_l(ptr long str ptr) msvcrt._sprintf_p_l -@ varargs _sprintf_s_l(ptr long str ptr) msvcrt._sprintf_s_l -@ varargs _sscanf_l(str str ptr) msvcrt._sscanf_l -@ varargs _sscanf_s_l(str str ptr) msvcrt._sscanf_s_l -@ cdecl _stat32(str ptr) msvcr100._stat32 -@ cdecl _stat32i64(str ptr) msvcr100._stat32i64 -@ cdecl _stat64(str ptr) msvcrt._stat64 -@ cdecl _stat64i32(str ptr) msvcr100._stat64i32 -@ cdecl _statusfp() msvcrt._statusfp -@ cdecl -arch=i386 _statusfp2(ptr ptr) msvcrt._statusfp2 -@ cdecl _strcoll_l(str str ptr) msvcrt._strcoll_l -@ cdecl _strdate(ptr) msvcrt._strdate -@ cdecl _strdate_s(ptr long) msvcrt._strdate_s -@ cdecl _strdup(str) msvcrt._strdup -@ cdecl _strerror(long) msvcrt._strerror +@ varargs _snscanf(str long str) MSVCRT__snscanf +@ varargs _snscanf_l(str long str ptr) MSVCRT__snscanf_l +@ varargs _snscanf_s(str long str) MSVCRT__snscanf_s +@ varargs _snscanf_s_l(str long str ptr) MSVCRT__snscanf_s_l +@ varargs _snwprintf(ptr long wstr) MSVCRT__snwprintf +@ varargs _snwprintf_l(ptr long wstr ptr) MSVCRT__snwprintf_l +@ varargs _snwprintf_s(ptr long long wstr) MSVCRT__snwprintf_s +@ varargs _snwprintf_s_l(ptr long long wstr ptr) MSVCRT__snwprintf_s_l +@ varargs _snwscanf(wstr long wstr) MSVCRT__snwscanf +@ varargs _snwscanf_l(wstr long wstr ptr) MSVCRT__snwscanf_l +@ varargs _snwscanf_s(wstr long wstr) MSVCRT__snwscanf_s +@ varargs _snwscanf_s_l(wstr long wstr ptr) MSVCRT__snwscanf_s_l +@ varargs _sopen(str long long) MSVCRT__sopen +@ 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 +@ varargs _sprintf_l(ptr str ptr) MSVCRT_sprintf_l +@ varargs _sprintf_p(ptr long str) MSVCRT__sprintf_p +@ varargs _sprintf_p_l(ptr long str ptr) MSVCRT_sprintf_p_l +@ varargs _sprintf_s_l(ptr long str ptr) MSVCRT_sprintf_s_l +@ varargs _sscanf_l(str str ptr) MSVCRT__sscanf_l +@ varargs _sscanf_s_l(str str ptr) MSVCRT__sscanf_s_l +@ 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) msvcrt._strlwr_l -@ 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 _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 @ stub _strnset_s -@ cdecl _strrev(str) msvcrt._strrev -@ cdecl _strset(str long) msvcrt._strset +@ cdecl _strrev(str) MSVCRT__strrev +@ cdecl _strset(str long) @ stub _strset_s -@ cdecl _strtime(ptr) msvcrt._strtime -@ cdecl _strtime_s(ptr long) msvcrt._strtime_s -@ cdecl _strtod_l(str ptr ptr) msvcrt._strtod_l -@ cdecl -ret64 _strtoi64(str ptr long) msvcrt._strtoi64 -@ cdecl -ret64 _strtoi64_l(str ptr long ptr) msvcrt._strtoi64_l +@ cdecl _strtime(ptr) MSVCRT__strtime +@ cdecl _strtime_s(ptr long) +@ cdecl _strtod_l(str ptr ptr) MSVCRT_strtod_l +@ cdecl -ret64 _strtoi64(str ptr long) MSVCRT_strtoi64 +@ cdecl -ret64 _strtoi64_l(str ptr long ptr) MSVCRT_strtoi64_l @ stub _strtol_l -@ cdecl -ret64 _strtoui64(str ptr long) msvcrt._strtoui64 -@ cdecl -ret64 _strtoui64_l(str ptr long ptr) msvcrt._strtoui64_l +@ cdecl -ret64 _strtoui64(str ptr long) MSVCRT_strtoui64 +@ cdecl -ret64 _strtoui64_l(str ptr long ptr) MSVCRT_strtoui64_l @ stub _strtoul_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 _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 @ stub _strxfrm_l -@ cdecl _swab(str str long) msvcrt._swab -@ varargs _swprintf(ptr wstr) msvcrt._swprintf +@ cdecl _swab(str str long) MSVCRT__swab +@ varargs _swprintf(ptr wstr) MSVCRT_swprintf @ stub _swprintf_c @ stub _swprintf_c_l @ stub _swprintf_p -@ varargs _swprintf_p_l(ptr long wstr ptr) msvcrt._swprintf_p_l -@ varargs _swprintf_s_l(ptr long wstr ptr) msvcrt._swprintf_s_l -@ varargs _swscanf_l(wstr wstr ptr) msvcrt._swscanf_l -@ varargs _swscanf_s_l(wstr wstr ptr) msvcrt._swscanf_s_l -@ extern _sys_errlist msvcrt._sys_errlist -@ extern _sys_nerr msvcrt._sys_nerr -@ cdecl _tell(long) msvcrt._tell -@ cdecl -ret64 _telli64(long) msvcrt._telli64 -@ cdecl _tempnam(str str) msvcrt._tempnam -@ cdecl _time32(ptr) msvcrt._time32 -@ cdecl _time64(ptr) msvcrt._time64 -@ extern _timezone msvcrt._timezone -@ 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 -@ extern _tzname msvcrt._tzname -@ cdecl _tzset() msvcrt._tzset -@ cdecl _ui64toa(int64 ptr long) msvcrt._ui64toa -@ cdecl _ui64toa_s(int64 ptr long long) msvcrt._ui64toa_s -@ cdecl _ui64tow(int64 ptr long) msvcrt._ui64tow -@ cdecl _ui64tow_s(int64 ptr long long) msvcrt._ui64tow_s -@ cdecl _ultoa(long ptr long) msvcrt._ultoa -@ cdecl _ultoa_s(long ptr long long) msvcrt._ultoa_s -@ cdecl _ultow(long ptr long) msvcrt._ultow -@ cdecl _ultow_s(long ptr long long) msvcrt._ultow_s -@ cdecl _umask(long) msvcrt._umask +@ varargs _swprintf_p_l(ptr long wstr ptr) MSVCRT_swprintf_p_l +@ varargs _swprintf_s_l(ptr long wstr ptr) MSVCRT__swprintf_s_l +@ varargs _swscanf_l(wstr wstr ptr) MSVCRT__swscanf_l +@ varargs _swscanf_s_l(wstr wstr ptr) MSVCRT__swscanf_s_l +@ extern _sys_errlist MSVCRT__sys_errlist +@ extern _sys_nerr MSVCRT__sys_nerr +@ 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 +@ extern _timezone MSVCRT___timezone +@ 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 +@ extern _tzname MSVCRT__tzname +@ 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 @ stub _ungetc_nolock -@ cdecl _ungetch(long) msvcrt._ungetch +@ cdecl _ungetch(long) @ stub _ungetch_nolock @ stub _ungetwc_nolock @ stub _ungetwch @ stub _ungetwch_nolock -@ cdecl _unlink(str) msvcrt._unlink -@ cdecl _unloaddll(long) msvcrt._unloaddll -@ cdecl _unlock(long) msvcrt._unlock -@ cdecl _unlock_file(ptr) msvcrt._unlock_file -@ cdecl _utime32(str ptr) msvcrt._utime32 -@ cdecl _utime64(str ptr) msvcrt._utime64 -@ cdecl _vcprintf(str ptr) msvcrt._vcprintf +@ cdecl _unlink(str) MSVCRT__unlink +@ cdecl _unloaddll(long) +@ cdecl _unlock(long) +@ cdecl _unlock_file(ptr) MSVCRT__unlock_file +@ cdecl _utime32(str ptr) +@ cdecl _utime64(str ptr) +@ cdecl _vcprintf(str ptr) @ stub _vcprintf_l @ stub _vcprintf_p @ stub _vcprintf_p_l @ stub _vcprintf_s @ stub _vcprintf_s_l -@ cdecl _vcwprintf(wstr ptr) msvcrt._vcwprintf +@ cdecl _vcwprintf(wstr ptr) @ stub _vcwprintf_l @ stub _vcwprintf_p @ stub _vcwprintf_p_l @@ -1087,7 +1087,7 @@ @ stub _vfprintf_p @ stub _vfprintf_p_l @ stub _vfprintf_s_l -@ cdecl _vfwprintf_l(ptr wstr ptr ptr) msvcrt._vfwprintf_l +@ cdecl _vfwprintf_l(ptr wstr ptr ptr) MSVCRT__vfwprintf_l @ stub _vfwprintf_p @ stub _vfwprintf_p_l @ stub _vfwprintf_s_l @@ -1095,447 +1095,447 @@ @ stub _vprintf_p @ stub _vprintf_p_l @ stub _vprintf_s_l -@ cdecl _vscprintf(str ptr) msvcrt._vscprintf +@ cdecl _vscprintf(str ptr) MSVCRT__vscprintf @ stub _vscprintf_l @ stub _vscprintf_p @ stub _vscprintf_p_l -@ cdecl _vscwprintf(wstr ptr) msvcrt._vscwprintf -@ cdecl _vscwprintf_l(wstr ptr ptr) msvcrt._vscwprintf_l -@ cdecl _vscwprintf_p(wstr ptr) msvcr100._vscwprintf_p -@ cdecl _vscwprintf_p_l(wstr ptr ptr) msvcrt._vscwprintf_p_l -@ cdecl _vsnprintf(ptr long str ptr) msvcrt._vsnprintf -@ cdecl _vsnprintf_c(ptr long str ptr) msvcrt._vsnprintf_c -@ cdecl _vsnprintf_c_l(ptr long str ptr ptr) msvcrt._vsnprintf_c_l -@ cdecl _vsnprintf_l(ptr long str ptr ptr) msvcrt._vsnprintf_l -@ cdecl _vsnprintf_s(ptr long long str ptr) msvcrt._vsnprintf_s -@ cdecl _vsnprintf_s_l(ptr long long str ptr ptr) msvcrt._vsnprintf_s_l -@ cdecl _vsnwprintf(ptr long wstr ptr) msvcrt._vsnwprintf -@ cdecl _vsnwprintf_l(ptr long wstr ptr ptr) msvcrt._vsnwprintf_l -@ cdecl _vsnwprintf_s(ptr long long wstr ptr) msvcrt._vsnwprintf_s -@ cdecl _vsnwprintf_s_l(ptr long long wstr ptr ptr) msvcrt._vsnwprintf_s_l -@ cdecl _vsprintf_l(ptr str ptr ptr) msvcrt._vsprintf_l -@ cdecl _vsprintf_p(ptr long str ptr) msvcrt._vsprintf_p -@ cdecl _vsprintf_p_l(ptr long str ptr ptr) msvcrt._vsprintf_p_l -@ cdecl _vsprintf_s_l(ptr long str ptr ptr) msvcrt._vsprintf_s_l -@ cdecl _vswprintf(ptr wstr ptr) msvcrt._vswprintf -@ cdecl _vswprintf_c(ptr long wstr ptr) msvcrt._vswprintf_c -@ cdecl _vswprintf_c_l(ptr long wstr ptr ptr) msvcrt._vswprintf_c_l -@ cdecl _vswprintf_l(ptr wstr ptr ptr) msvcrt._vswprintf_l -@ cdecl _vswprintf_p(ptr long wstr ptr) msvcr100._vswprintf_p -@ cdecl _vswprintf_p_l(ptr long wstr ptr ptr) msvcrt._vswprintf_p_l -@ cdecl _vswprintf_s_l(ptr long wstr ptr ptr) msvcrt._vswprintf_s_l +@ cdecl _vscwprintf(wstr ptr) MSVCRT__vscwprintf +@ cdecl _vscwprintf_l(wstr ptr ptr) MSVCRT__vscwprintf_l +@ cdecl _vscwprintf_p(wstr ptr) MSVCRT__vscwprintf_p +@ cdecl _vscwprintf_p_l(wstr ptr ptr) MSVCRT__vscwprintf_p_l +@ cdecl _vsnprintf(ptr long str ptr) MSVCRT_vsnprintf +@ cdecl _vsnprintf_c(ptr long str ptr) MSVCRT_vsnprintf +@ cdecl _vsnprintf_c_l(ptr long str ptr ptr) MSVCRT_vsnprintf_l +@ cdecl _vsnprintf_l(ptr long str ptr ptr) MSVCRT_vsnprintf_l +@ cdecl _vsnprintf_s(ptr long long str ptr) MSVCRT_vsnprintf_s +@ cdecl _vsnprintf_s_l(ptr long long str ptr ptr) MSVCRT_vsnprintf_s_l +@ cdecl _vsnwprintf(ptr long wstr ptr) MSVCRT_vsnwprintf +@ cdecl _vsnwprintf_l(ptr long wstr ptr ptr) MSVCRT_vsnwprintf_l +@ cdecl _vsnwprintf_s(ptr long long wstr ptr) MSVCRT_vsnwprintf_s +@ cdecl _vsnwprintf_s_l(ptr long long wstr ptr ptr) MSVCRT_vsnwprintf_s_l +@ cdecl _vsprintf_l(ptr str ptr ptr) MSVCRT_vsprintf_l +@ cdecl _vsprintf_p(ptr long str ptr) MSVCRT_vsprintf_p +@ cdecl _vsprintf_p_l(ptr long str ptr ptr) MSVCRT_vsprintf_p_l +@ cdecl _vsprintf_s_l(ptr long str ptr ptr) MSVCRT_vsprintf_s_l +@ cdecl _vswprintf(ptr wstr ptr) MSVCRT_vswprintf +@ cdecl _vswprintf_c(ptr long wstr ptr) MSVCRT_vsnwprintf +@ cdecl _vswprintf_c_l(ptr long wstr ptr ptr) MSVCRT_vsnwprintf_l +@ cdecl _vswprintf_l(ptr wstr ptr ptr) MSVCRT_vswprintf_l +@ cdecl _vswprintf_p(ptr long wstr ptr) MSVCRT__vswprintf_p +@ cdecl _vswprintf_p_l(ptr long wstr ptr ptr) MSVCRT_vswprintf_p_l +@ cdecl _vswprintf_s_l(ptr long wstr ptr ptr) MSVCRT_vswprintf_s_l @ stub _vwprintf_l @ stub _vwprintf_p @ stub _vwprintf_p_l @ stub _vwprintf_s_l -@ 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 -@ extern _wcmdln msvcrt._wcmdln -@ cdecl _wcreat(wstr long) msvcrt._wcreat -@ 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 +@ 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 +@ extern _wcmdln MSVCRT__wcmdln +@ cdecl _wcreat(wstr long) MSVCRT__wcreat +@ 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 _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) ntdll._wcslwr @ stub _wcslwr_l -@ cdecl _wcslwr_s(wstr long) msvcrt._wcslwr_s +@ cdecl _wcslwr_s(wstr long) MSVCRT__wcslwr_s @ stub _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 _wcsncoll(wstr wstr long) MSVCRT__wcsncoll +@ cdecl _wcsncoll_l(wstr wstr long ptr) MSVCRT__wcsncoll_l +@ cdecl _wcsnicmp(wstr wstr long) MSVCRT__wcsnicmp @ stub _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 +@ 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 _wcsrev(wstr) MSVCRT__wcsrev +@ cdecl _wcsset(wstr long) MSVCRT__wcsset @ stub _wcsset_s -@ cdecl _wcstod_l(wstr ptr) msvcrt._wcstod_l -@ cdecl -ret64 _wcstoi64(wstr ptr long) msvcrt._wcstoi64 -@ cdecl -ret64 _wcstoi64_l(wstr ptr long ptr) msvcrt._wcstoi64_l -@ cdecl _wcstol_l(wstr ptr long ptr) msvcrt._wcstol_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 -@ cdecl _wcsupr(wstr) msvcrt._wcsupr -@ stub _wcsupr_l -@ cdecl _wcsupr_s(wstr long) msvcrt._wcsupr_s -@ cdecl _wcsupr_s_l(wstr long ptr) msvcrt._wcsupr_s_l +@ cdecl _wcstod_l(wstr ptr) MSVCRT__wcstod_l +@ cdecl -ret64 _wcstoi64(wstr ptr long) MSVCRT__wcstoi64 +@ cdecl -ret64 _wcstoi64_l(wstr ptr long ptr) MSVCRT__wcstoi64_l +@ cdecl _wcstol_l(wstr ptr long ptr) MSVCRT__wcstol_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 +@ 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 @ stub _wcsxfrm_l -@ cdecl _wctime32(ptr) msvcrt._wctime32 +@ cdecl _wctime32(ptr) MSVCRT__wctime32 @ stub _wctime32_s -@ cdecl _wctime64(ptr) msvcrt._wctime64 +@ 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 +@ cdecl _wctomb_l(ptr long ptr) MSVCRT__wctomb_l +@ cdecl _wctomb_s_l(ptr ptr long long ptr) MSVCRT__wctomb_s_l # extern _wctype -@ cdecl _wdupenv_s(ptr ptr wstr) msvcrt._wdupenv_s -@ extern _wenviron msvcrt._wenviron -@ varargs _wexecl(wstr wstr) msvcrt._wexecl -@ varargs _wexecle(wstr wstr) msvcrt._wexecle -@ varargs _wexeclp(wstr wstr) msvcrt._wexeclp -@ varargs _wexeclpe(wstr wstr) msvcrt._wexeclpe -@ cdecl _wexecv(wstr ptr) msvcrt._wexecv -@ cdecl _wexecve(wstr ptr ptr) msvcrt._wexecve -@ cdecl _wexecvp(wstr ptr) msvcrt._wexecvp -@ cdecl _wexecvpe(wstr ptr ptr) msvcrt._wexecvpe -@ cdecl _wfdopen(long wstr) msvcrt._wfdopen -@ cdecl _wfindfirst32(wstr ptr) msvcrt._wfindfirst32 +@ cdecl _wdupenv_s(ptr ptr wstr) +@ extern _wenviron MSVCRT__wenviron +@ 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 +@ 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 _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 @ stub _wgetdcwd_nolock -@ cdecl _wgetenv(wstr) msvcrt._wgetenv -@ cdecl _wgetenv_s(ptr ptr long wstr) msvcrt._wgetenv_s -@ 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 -@ cdecl _wperror(wstr) msvcrt._wperror -@ extern _wpgmptr msvcrt._wpgmptr -@ cdecl _wpopen(wstr wstr) msvcrt._wpopen +@ 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) +@ extern _wpgmptr MSVCRT__wpgmptr +@ cdecl _wpopen(wstr wstr) MSVCRT__wpopen @ stub _wprintf_l @ stub _wprintf_p @ stub _wprintf_p_l @ stub _wprintf_s_l -@ cdecl _wputenv(wstr) msvcrt._wputenv -@ cdecl _wputenv_s(wstr wstr) msvcrt._wputenv_s -@ cdecl _wremove(wstr) msvcrt._wremove -@ cdecl _wrename(wstr wstr) msvcrt._wrename -@ cdecl _write(long ptr long) msvcrt._write -@ cdecl _wrmdir(wstr) msvcrt._wrmdir -@ varargs _wscanf_l(wstr ptr) msvcrt._wscanf_l -@ varargs _wscanf_s_l(wstr ptr) msvcrt._wscanf_s_l -@ 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 -@ cdecl _wsopen_s(ptr wstr long long long) msvcrt._wsopen_s -@ varargs _wspawnl(long wstr wstr) msvcrt._wspawnl -@ varargs _wspawnle(long wstr wstr) msvcrt._wspawnle -@ varargs _wspawnlp(long wstr wstr) msvcrt._wspawnlp -@ varargs _wspawnlpe(long wstr wstr) msvcrt._wspawnlpe -@ cdecl _wspawnv(long wstr ptr) msvcrt._wspawnv -@ cdecl _wspawnve(long wstr ptr ptr) msvcrt._wspawnve -@ cdecl _wspawnvp(long wstr ptr) msvcrt._wspawnvp -@ 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) msvcr100._wstat32 -@ cdecl _wstat32i64(wstr ptr) msvcr100._wstat32i64 -@ cdecl _wstat64(wstr ptr) msvcrt._wstat64 -@ cdecl _wstat64i32(wstr ptr) msvcr100._wstat64i32 -@ cdecl _wstrdate(ptr) msvcrt._wstrdate -@ cdecl _wstrdate_s(ptr long) msvcrt._wstrdate_s -@ cdecl _wstrtime(ptr) msvcrt._wstrtime -@ cdecl _wstrtime_s(ptr long) msvcrt._wstrtime_s -@ cdecl _wsystem(wstr) msvcrt._wsystem -@ cdecl _wtempnam(wstr wstr) msvcrt._wtempnam -@ cdecl _wtmpnam(ptr) msvcrt._wtmpnam +@ 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 +@ varargs _wscanf_l(wstr ptr) MSVCRT__wscanf_l +@ varargs _wscanf_s_l(wstr ptr) MSVCRT__wscanf_s_l +@ 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 +@ 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 -@ cdecl _wunlink(wstr) msvcrt._wunlink -@ cdecl _wutime32(wstr ptr) msvcrt._wutime32 -@ cdecl _wutime64(wstr ptr) msvcrt._wutime64 -@ 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 -@ cdecl asctime(ptr) msvcrt.asctime -@ cdecl asctime_s(ptr long ptr) msvcrt.asctime_s -@ cdecl asin(double) msvcrt.asin -@ cdecl atan(double) msvcrt.atan -@ cdecl atan2(double double) msvcrt.atan2 -@ cdecl -arch=arm,x86_64 asinf(float) msvcrt.asinf -@ cdecl -arch=arm,x86_64 atan2f(float float) msvcrt.atan2f -@ cdecl -arch=arm,x86_64 atanf(float) msvcrt.atanf -@ cdecl atexit(ptr) msvcrt.atexit -@ cdecl atof(str) msvcrt.atof -@ cdecl atoi(str) msvcr100.atoi ##don't forward to msvcrt -@ cdecl atol(str) msvcrt.atol -@ 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 -@ cdecl calloc(long long) msvcrt.calloc -@ cdecl ceil(double) msvcrt.ceil -@ cdecl -arch=arm,x86_64 ceilf(float) msvcrt.ceilf -@ cdecl clearerr(ptr) msvcrt.clearerr +@ 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 +@ 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 +@ cdecl asctime(ptr) MSVCRT_asctime +@ cdecl asctime_s(ptr long ptr) MSVCRT_asctime_s +@ cdecl asin(double) MSVCRT_asin +@ cdecl atan(double) MSVCRT_atan +@ cdecl atan2(double double) MSVCRT_atan2 +@ cdecl -arch=arm,x86_64 asinf(float) MSVCRT_asinf +@ cdecl -arch=arm,x86_64 atan2f(float float) MSVCRT_atan2f +@ cdecl -arch=arm,x86_64 atanf(float) MSVCRT_atanf +@ cdecl atexit(ptr) MSVCRT_atexit +@ cdecl atof(str) MSVCRT_atof +@ cdecl atoi(str) MSVCRT_atoi +@ cdecl atol(str) ntdll.atol +@ 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 +@ cdecl calloc(long long) MSVCRT_calloc +@ cdecl ceil(double) MSVCRT_ceil +@ cdecl -arch=arm,x86_64 ceilf(float) MSVCRT_ceilf +@ cdecl clearerr(ptr) MSVCRT_clearerr @ stub clearerr_s -@ cdecl clock() msvcrt.clock -@ cdecl cos(double) msvcrt.cos -@ cdecl cosh(double) msvcrt.cosh -@ cdecl -arch=arm,x86_64 cosf(float) msvcrt.cosf -@ cdecl -arch=arm,x86_64 coshf(float) msvcrt.coshf -@ cdecl -ret64 div(long long) msvcrt.div -@ cdecl exit(long) msvcrt.exit -@ cdecl exp(double) msvcrt.exp -@ cdecl -arch=arm,x86_64 expf(float) msvcrt.expf -@ cdecl fabs(double) msvcrt.fabs -@ cdecl fclose(ptr) msvcrt.fclose -@ cdecl feof(ptr) msvcrt.feof -@ cdecl ferror(ptr) msvcrt.ferror -@ 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 -@ 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 -@ varargs fprintf(ptr str) msvcrt.fprintf -@ varargs fprintf_s(ptr str) msvcrt.fprintf_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 -@ varargs fscanf(ptr str) msvcrt.fscanf -@ varargs fscanf_s(ptr str) msvcrt.fscanf_s -@ cdecl fseek(ptr long long) msvcrt.fseek -@ cdecl fsetpos(ptr ptr) msvcrt.fsetpos -@ cdecl ftell(ptr) msvcrt.ftell -@ varargs fwprintf(ptr wstr) msvcrt.fwprintf -@ varargs fwprintf_s(ptr wstr) msvcrt.fwprintf_s -@ cdecl fwrite(ptr long long ptr) msvcrt.fwrite -@ varargs fwscanf(ptr wstr) msvcrt.fwscanf -@ varargs fwscanf_s(ptr wstr) msvcrt.fwscanf_s -@ cdecl getc(ptr) msvcrt.getc -@ cdecl getchar() msvcrt.getchar -@ cdecl getenv(str) msvcrt.getenv -@ cdecl getenv_s(ptr ptr long str) msvcrt.getenv_s -@ cdecl gets(str) msvcrt.gets +@ cdecl clock() MSVCRT_clock +@ cdecl cos(double) MSVCRT_cos +@ cdecl cosh(double) MSVCRT_cosh +@ cdecl -arch=arm,x86_64 cosf(float) MSVCRT_cosf +@ cdecl -arch=arm,x86_64 coshf(float) MSVCRT_coshf +@ cdecl -ret64 div(long long) MSVCRT_div +@ cdecl exit(long) MSVCRT_exit +@ cdecl exp(double) MSVCRT_exp +@ cdecl -arch=arm,x86_64 expf(float) MSVCRT_expf +@ cdecl fabs(double) MSVCRT_fabs +@ cdecl fclose(ptr) MSVCRT_fclose +@ cdecl feof(ptr) MSVCRT_feof +@ cdecl ferror(ptr) MSVCRT_ferror +@ 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 +@ 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 +@ varargs fprintf(ptr str) MSVCRT_fprintf +@ varargs fprintf_s(ptr str) MSVCRT_fprintf_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 +@ varargs fscanf(ptr str) MSVCRT_fscanf +@ varargs fscanf_s(ptr str) MSVCRT_fscanf_s +@ cdecl fseek(ptr long long) MSVCRT_fseek +@ cdecl fsetpos(ptr ptr) MSVCRT_fsetpos +@ cdecl ftell(ptr) MSVCRT_ftell +@ varargs fwprintf(ptr wstr) MSVCRT_fwprintf +@ varargs fwprintf_s(ptr wstr) MSVCRT_fwprintf_s +@ cdecl fwrite(ptr long long ptr) MSVCRT_fwrite +@ varargs fwscanf(ptr wstr) MSVCRT_fwscanf +@ varargs fwscanf_s(ptr wstr) MSVCRT_fwscanf_s +@ 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 -@ cdecl is_wctype(long long) msvcrt.is_wctype -@ cdecl isalnum(long) msvcrt.isalnum -@ cdecl isalpha(long) msvcrt.isalpha -@ 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) msvcrt.iswalpha -@ cdecl iswascii(long) msvcrt.iswascii -@ cdecl iswcntrl(long) msvcrt.iswcntrl -@ cdecl iswctype(long long) msvcrt.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 -@ cdecl localeconv() msvcrt.localeconv -@ cdecl log(double) msvcrt.log -@ cdecl log10(double) msvcrt.log10 -@ cdecl -arch=arm,x86_64 log10f(float) msvcrt.log10f -@ cdecl -arch=arm,x86_64 logf(float) msvcrt.logf -@ cdecl -arch=i386,x86_64,arm longjmp(ptr long) msvcrt.longjmp -@ cdecl malloc(long) msvcrt.malloc -@ cdecl mblen(ptr long) msvcrt.mblen -@ cdecl mbrlen(ptr long ptr) msvcrt.mbrlen -@ cdecl mbrtowc(ptr str long ptr) msvcrt.mbrtowc -@ cdecl mbsrtowcs(ptr ptr long ptr) msvcrt.mbsrtowcs +@ cdecl getwc(ptr) MSVCRT_getwc +@ cdecl getwchar() MSVCRT_getwchar +@ cdecl is_wctype(long long) ntdll.iswctype +@ cdecl isalnum(long) MSVCRT_isalnum +@ cdecl isalpha(long) MSVCRT_isalpha +@ 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 +@ 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 +@ cdecl localeconv() MSVCRT_localeconv +@ cdecl log(double) MSVCRT_log +@ cdecl log10(double) MSVCRT_log10 +@ cdecl -arch=arm,x86_64 log10f(float) MSVCRT_log10f +@ cdecl -arch=arm,x86_64 logf(float) MSVCRT_logf +@ cdecl -arch=i386,x86_64,arm longjmp(ptr long) MSVCRT_longjmp +@ cdecl malloc(long) MSVCRT_malloc +@ cdecl mblen(ptr long) MSVCRT_mblen +@ cdecl mbrlen(ptr long ptr) MSVCRT_mbrlen +@ 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 -@ cdecl perror(str) msvcrt.perror -@ cdecl pow(double double) msvcrt.pow -@ cdecl -arch=arm,x86_64 powf(float float) msvcrt.powf -@ varargs printf(str) msvcrt.printf -@ varargs printf_s(str) msvcrt.printf_s -@ cdecl putc(long ptr) msvcrt.putc -@ cdecl putchar(long) msvcrt.putchar -@ cdecl puts(str) msvcrt.puts -@ cdecl putwc(long ptr) msvcrt.putwc -@ cdecl putwchar(long) msvcrt.putwchar -@ cdecl qsort(ptr long long ptr) msvcrt.qsort -@ cdecl qsort_s(ptr long long ptr ptr) msvcrt.qsort_s -@ cdecl raise(long) msvcrt.raise -@ cdecl rand() msvcrt.rand -@ cdecl rand_s(ptr) msvcrt.rand_s -@ cdecl realloc(ptr long) msvcrt.realloc -@ cdecl remove(str) msvcrt.remove -@ cdecl rename(str str) msvcrt.rename -@ cdecl rewind(ptr) msvcrt.rewind -@ varargs scanf(str) msvcrt.scanf -@ varargs scanf_s(str) msvcrt.scanf_s -@ 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 sinh(double) msvcrt.sinh -@ cdecl -arch=arm,x86_64 sinf(float) msvcrt.sinf -@ cdecl -arch=arm,x86_64 sinhf(float) msvcrt.sinhf -@ varargs sprintf(ptr str) msvcrt.sprintf -@ varargs sprintf_s(ptr long str) msvcrt.sprintf_s -@ cdecl sqrt(double) msvcrt.sqrt -@ cdecl -arch=arm,x86_64 sqrtf(float) msvcrt.sqrtf -@ cdecl srand(long) msvcrt.srand -@ varargs sscanf(str str) msvcrt.sscanf -@ varargs sscanf_s(str str) msvcrt.sscanf_s -@ cdecl strcat(str str) msvcrt.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) msvcrt.strcpy -@ cdecl strcpy_s(ptr long str) msvcrt.strcpy_s -@ cdecl strcspn(str str) msvcrt.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) msvcrt.strpbrk -@ cdecl strrchr(str long) msvcrt.strrchr -@ cdecl strspn(str str) msvcrt.strspn -@ cdecl strstr(str str) msvcrt.strstr -@ cdecl strtod(str ptr) msvcrt.strtod -@ cdecl strtok(str str) msvcrt.strtok -@ cdecl strtok_s(ptr str ptr) msvcrt.strtok_s -@ cdecl strtol(str ptr long) msvcrt.strtol -@ cdecl strtoul(str ptr long) msvcrt.strtoul -@ cdecl strxfrm(ptr str long) msvcrt.strxfrm -@ varargs swprintf_s(ptr long wstr) msvcrt.swprintf_s -@ varargs swscanf(wstr wstr) msvcrt.swscanf -@ varargs swscanf_s(wstr wstr) msvcrt.swscanf_s -@ 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 tmpfile() msvcrt.tmpfile -@ cdecl tmpfile_s(ptr) msvcrt.tmpfile_s -@ cdecl tmpnam(ptr) msvcrt.tmpnam +@ 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 +@ cdecl perror(str) MSVCRT_perror +@ cdecl pow(double double) MSVCRT_pow +@ cdecl -arch=arm,x86_64 powf(float float) MSVCRT_powf +@ varargs printf(str) MSVCRT_printf +@ varargs printf_s(str) MSVCRT_printf_s +@ 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 +@ cdecl raise(long) MSVCRT_raise +@ cdecl rand() MSVCRT_rand +@ cdecl rand_s(ptr) MSVCRT_rand_s +@ cdecl realloc(ptr long) MSVCRT_realloc +@ cdecl remove(str) MSVCRT_remove +@ cdecl rename(str str) MSVCRT_rename +@ cdecl rewind(ptr) MSVCRT_rewind +@ varargs scanf(str) MSVCRT_scanf +@ varargs scanf_s(str) MSVCRT_scanf_s +@ 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 sinh(double) MSVCRT_sinh +@ cdecl -arch=arm,x86_64 sinf(float) MSVCRT_sinf +@ cdecl -arch=arm,x86_64 sinhf(float) MSVCRT_sinhf +@ varargs sprintf(ptr str) MSVCRT_sprintf +@ varargs sprintf_s(ptr long str) MSVCRT_sprintf_s +@ cdecl sqrt(double) MSVCRT_sqrt +@ cdecl -arch=arm,x86_64 sqrtf(float) MSVCRT_sqrtf +@ cdecl srand(long) MSVCRT_srand +@ varargs sscanf(str str) MSVCRT_sscanf +@ varargs sscanf_s(str str) MSVCRT_sscanf_s +@ 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 +@ cdecl strtok(str str) MSVCRT_strtok +@ cdecl strtok_s(ptr str ptr) MSVCRT_strtok_s +@ cdecl strtol(str ptr long) MSVCRT_strtol +@ cdecl strtoul(str ptr long) MSVCRT_strtoul +@ cdecl strxfrm(ptr str long) MSVCRT_strxfrm +@ varargs swprintf_s(ptr long wstr) MSVCRT_swprintf_s +@ varargs swscanf(wstr wstr) MSVCRT_swscanf +@ varargs swscanf_s(wstr wstr) MSVCRT_swscanf_s +@ 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 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 -@ cdecl towlower(long) msvcrt.towlower -@ cdecl towupper(long) msvcrt.towupper -@ cdecl ungetc(long ptr) msvcrt.ungetc -@ cdecl ungetwc(long ptr) msvcrt.ungetwc -@ cdecl vfprintf(ptr str ptr) msvcrt.vfprintf -@ cdecl vfprintf_s(ptr str ptr) msvcrt.vfprintf_s -@ cdecl vfwprintf(ptr wstr ptr) msvcrt.vfwprintf -@ cdecl vfwprintf_s(ptr wstr ptr) msvcrt.vfwprintf_s -@ cdecl vprintf(str ptr) msvcrt.vprintf -@ cdecl vprintf_s(str ptr) msvcrt.vprintf_s -@ cdecl vsprintf(ptr str ptr) msvcrt.vsprintf -@ cdecl vsprintf_s(ptr long str ptr) msvcrt.vsprintf_s -@ cdecl vswprintf_s(ptr long wstr ptr) msvcrt.vswprintf_s -@ cdecl vwprintf(wstr ptr) msvcrt.vwprintf -@ cdecl vwprintf_s(wstr ptr) msvcrt.vwprintf_s -@ cdecl wcrtomb(ptr long ptr) msvcrt.wcrtomb +@ cdecl tolower(long) MSVCRT_tolower +@ cdecl toupper(long) MSVCRT_toupper +@ cdecl towlower(long) MSVCRT_towlower +@ cdecl towupper(long) MSVCRT_towupper +@ cdecl ungetc(long ptr) MSVCRT_ungetc +@ cdecl ungetwc(long ptr) MSVCRT_ungetwc +@ cdecl vfprintf(ptr str ptr) MSVCRT_vfprintf +@ cdecl vfprintf_s(ptr str ptr) MSVCRT_vfprintf_s +@ cdecl vfwprintf(ptr wstr ptr) MSVCRT_vfwprintf +@ cdecl vfwprintf_s(ptr wstr ptr) MSVCRT_vfwprintf_s +@ cdecl vprintf(str ptr) MSVCRT_vprintf +@ cdecl vprintf_s(str ptr) MSVCRT_vprintf_s +@ cdecl vsprintf(ptr str ptr) MSVCRT_vsprintf +@ cdecl vsprintf_s(ptr long str ptr) MSVCRT_vsprintf_s +@ cdecl vswprintf_s(ptr long wstr ptr) MSVCRT_vswprintf_s +@ cdecl vwprintf(wstr ptr) MSVCRT_vwprintf +@ cdecl vwprintf_s(wstr ptr) MSVCRT_vwprintf_s +@ cdecl wcrtomb(ptr long ptr) MSVCRT_wcrtomb @ stub wcrtomb_s -@ cdecl wcscat(wstr wstr) msvcrt.wcscat -@ cdecl wcscat_s(wstr long wstr) msvcrt.wcscat_s -@ cdecl wcschr(wstr long) msvcrt.wcschr -@ cdecl wcscmp(wstr wstr) msvcrt.wcscmp -@ cdecl wcscoll(wstr wstr) msvcrt.wcscoll -@ cdecl wcscpy(ptr wstr) msvcrt.wcscpy -@ cdecl wcscpy_s(ptr long wstr) msvcrt.wcscpy_s -@ cdecl wcscspn(wstr wstr) msvcrt.wcscspn -@ cdecl wcsftime(ptr long wstr ptr) msvcrt.wcsftime -@ cdecl wcslen(wstr) msvcrt.wcslen -@ cdecl wcsncat(wstr wstr long) msvcrt.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) msvcrt.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) msvcrt.wcsspn -@ cdecl wcsstr(wstr wstr) msvcrt.wcsstr -@ cdecl wcstod(wstr ptr) msvcrt.wcstod -@ cdecl wcstok(wstr wstr) msvcrt.wcstok -@ cdecl wcstok_s(ptr wstr ptr) msvcrt.wcstok_s -@ cdecl wcstol(wstr ptr long) msvcrt.wcstol -@ 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 -@ 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 -@ varargs wprintf(wstr) msvcrt.wprintf -@ varargs wprintf_s(wstr) msvcrt.wprintf_s -@ varargs wscanf(wstr) msvcrt.wscanf -@ varargs wscanf_s(wstr) msvcrt.wscanf_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 +@ cdecl wcstok(wstr wstr) MSVCRT_wcstok +@ cdecl wcstok_s(ptr wstr ptr) MSVCRT_wcstok_s +@ cdecl wcstol(wstr ptr long) ntdll.wcstol +@ 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 wcsxfrm(ptr wstr long) +@ cdecl wctob(long) MSVCRT_wctob +@ cdecl wctomb(ptr long) MSVCRT_wctomb +@ cdecl wctomb_s(ptr ptr long long) MSVCRT_wctomb_s +@ varargs wprintf(wstr) MSVCRT_wprintf +@ varargs wprintf_s(wstr) MSVCRT_wprintf_s +@ varargs wscanf(wstr) MSVCRT_wscanf +@ varargs wscanf_s(wstr) MSVCRT_wscanf_s diff -Nru wine1.7-1.7.14/dlls/msvcrt/cpp.c wine1.7-1.7.18/dlls/msvcrt/cpp.c --- wine1.7-1.7.14/dlls/msvcrt/cpp.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msvcrt/cpp.c 2014-05-02 18:15:48.000000000 +0000 @@ -35,6 +35,12 @@ WINE_DEFAULT_DEBUG_CHANNEL(msvcrt); +struct __type_info_node +{ + void *memPtr; + struct __type_info_node* next; +}; + typedef exception bad_cast; typedef exception bad_typeid; typedef exception __non_rtti_object; @@ -1169,3 +1175,23 @@ return ret; } #endif + +/********************************************************************* + * __clean_type_info_names_internal (MSVCR100.@) + */ +void CDECL __clean_type_info_names_internal(void *p) +{ + FIXME("(%p) stub\n", p); +} + +/********************************************************************* + * ?_name_internal_method@type_info@@QBEPBDPAU__type_info_node@@@Z (MSVCR100.@) + */ +DEFINE_THISCALL_WRAPPER(type_info_name_internal_method,8) +const char * __thiscall type_info_name_internal_method(type_info * _this, struct __type_info_node *node) +{ + static int once; + if (node && !once++) FIXME("type_info_node parameter ignored\n"); + + return MSVCRT_type_info_name(_this); +} diff -Nru wine1.7-1.7.14/dlls/msvcrt/ctype.c wine1.7-1.7.18/dlls/msvcrt/ctype.c --- wine1.7-1.7.14/dlls/msvcrt/ctype.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msvcrt/ctype.c 2014-05-02 18:15:48.000000000 +0000 @@ -339,37 +339,42 @@ int CDECL MSVCRT__toupper_l(int c, MSVCRT__locale_t locale) { MSVCRT_pthreadlocinfo locinfo; + unsigned char str[2], *p = str; + WCHAR wide, upper; if(!locale) locinfo = get_locinfo(); else locinfo = locale->locinfo; - if(c < 256) - return locinfo->pcumap[(unsigned char)c]; + if((unsigned)c < 256) + return locinfo->pcumap[c]; if(locinfo->pctype[(c>>8)&255] & MSVCRT__LEADBYTE) - { - WCHAR wide, upper; - char str[2], *p = str; *p++ = (c>>8) & 255; - *p++ = c & 255; + else { + *MSVCRT__errno() = MSVCRT_EILSEQ; + str[1] = 0; + } + *p++ = c & 255; - if(!MultiByteToWideChar(locinfo->lc_codepage, - MB_ERR_INVALID_CHARS, str, 2, &wide, 1)) - return c; - - upper = toupperW(wide); - if(upper == wide) - return c; + if(!MultiByteToWideChar(locinfo->lc_codepage, + MB_ERR_INVALID_CHARS, (char*)str, p-str, &wide, 1)) + return c; - WideCharToMultiByte(locinfo->lc_codepage, 0, - &upper, 1, str, 2, NULL, NULL); + upper = toupperW(wide); + if(upper == wide) + return str[0] + (str[1]<<8); + switch(WideCharToMultiByte(locinfo->lc_codepage, 0, + &upper, 1, (char*)str, 2, NULL, NULL)) { + case 0: + return c; + case 1: + return str[0]; + default: return str[0] + (str[1]<<8); } - - return c; } /********************************************************************* @@ -394,37 +399,42 @@ int CDECL MSVCRT__tolower_l(int c, MSVCRT__locale_t locale) { MSVCRT_pthreadlocinfo locinfo; + unsigned char str[2], *p = str; + WCHAR wide, lower; if(!locale) locinfo = get_locinfo(); else locinfo = locale->locinfo; - if(c < 256) - return locinfo->pclmap[(unsigned char)c]; + if((unsigned)c < 256) + return locinfo->pclmap[c]; if(locinfo->pctype[(c>>8)&255] & MSVCRT__LEADBYTE) - { - WCHAR wide, upper; - char str[2], *p = str; *p++ = (c>>8) & 255; - *p++ = c & 255; + else { + *MSVCRT__errno() = MSVCRT_EILSEQ; + str[1] = 0; + } + *p++ = c & 255; - if(!MultiByteToWideChar(locinfo->lc_codepage, - MB_ERR_INVALID_CHARS, str, 2, &wide, 1)) - return c; - - upper = tolowerW(wide); - if(upper == wide) - return c; + if(!MultiByteToWideChar(locinfo->lc_codepage, + MB_ERR_INVALID_CHARS, (char*)str, p-str, &wide, 1)) + return c; - WideCharToMultiByte(locinfo->lc_codepage, 0, - &upper, 1, str, 2, NULL, NULL); + lower = tolowerW(wide); + if(lower == wide) + return str[0] + (str[1]<<8); + switch(WideCharToMultiByte(locinfo->lc_codepage, 0, + &lower, 1, (char*)str, 2, NULL, NULL)) { + case 0: + return c; + case 1: + return str[0]; + default: return str[0] + (str[1]<<8); } - - return c; } /********************************************************************* diff -Nru wine1.7-1.7.14/dlls/msvcrt/data.c wine1.7-1.7.18/dlls/msvcrt/data.c --- wine1.7-1.7.14/dlls/msvcrt/data.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msvcrt/data.c 2014-05-02 18:15:48.000000000 +0000 @@ -141,7 +141,7 @@ /*********************************************************************** * __p___argc (MSVCRT.@) */ -int* CDECL __p___argc(void) { return &MSVCRT___argc; } +int* CDECL MSVCRT___p___argc(void) { return &MSVCRT___argc; } /*********************************************************************** * __p__commode (MSVCRT.@) @@ -152,12 +152,12 @@ /*********************************************************************** * __p__pgmptr (MSVCRT.@) */ -char** CDECL __p__pgmptr(void) { return &MSVCRT__pgmptr; } +char** CDECL MSVCRT___p__pgmptr(void) { return &MSVCRT__pgmptr; } /*********************************************************************** * __p__wpgmptr (MSVCRT.@) */ -WCHAR** CDECL __p__wpgmptr(void) { return &MSVCRT__wpgmptr; } +WCHAR** CDECL MSVCRT___p__wpgmptr(void) { return &MSVCRT__wpgmptr; } /*********************************************************************** * _get_pgmptr (MSVCRT.@) @@ -188,7 +188,7 @@ /*********************************************************************** * _set_fmode (MSVCRT.@) */ -int CDECL _set_fmode(int mode) +int CDECL MSVCRT__set_fmode(int mode) { /* TODO: support _O_WTEXT */ if(!MSVCRT_CHECK_PMT(mode==MSVCRT__O_TEXT || mode==MSVCRT__O_BINARY)) @@ -201,7 +201,7 @@ /*********************************************************************** * _get_fmode (MSVCRT.@) */ -int CDECL _get_fmode(int *mode) +int CDECL MSVCRT__get_fmode(int *mode) { if(!MSVCRT_CHECK_PMT(mode)) return MSVCRT_EINVAL; @@ -243,12 +243,12 @@ /********************************************************************* * __p___argv (MSVCRT.@) */ -char*** CDECL __p___argv(void) { return &MSVCRT___argv; } +char*** CDECL MSVCRT___p___argv(void) { return &MSVCRT___argv; } /********************************************************************* * __p___wargv (MSVCRT.@) */ -MSVCRT_wchar_t*** CDECL __p___wargv(void) { return &MSVCRT___wargv; } +MSVCRT_wchar_t*** CDECL MSVCRT___p___wargv(void) { return &MSVCRT___wargv; } /********************************************************************* * __p__environ (MSVCRT.@) diff -Nru wine1.7-1.7.14/dlls/msvcrt/dir.c wine1.7-1.7.18/dlls/msvcrt/dir.c --- wine1.7-1.7.14/dlls/msvcrt/dir.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msvcrt/dir.c 2014-05-02 18:15:48.000000000 +0000 @@ -1023,7 +1023,7 @@ /****************************************************************** * _splitpath_s (MSVCRT.@) */ -int CDECL _splitpath_s(const char* inpath, +int CDECL MSVCRT__splitpath_s(const char* inpath, char* drive, MSVCRT_size_t sz_drive, char* dir, MSVCRT_size_t sz_dir, char* fname, MSVCRT_size_t sz_fname, @@ -1059,7 +1059,15 @@ /* look for end of directory part */ end = NULL; - for (p = inpath; *p; p++) if (*p == '/' || *p == '\\') end = p + 1; + for (p = inpath; *p; p++) + { + if (_ismbblead((unsigned char)*p)) + { + p++; + continue; + } + if (*p == '/' || *p == '\\') end = p + 1; + } if (end) /* got a directory */ { @@ -1103,10 +1111,10 @@ /********************************************************************* * _splitpath (MSVCRT.@) */ -void CDECL _splitpath(const char *inpath, char *drv, char *dir, +void CDECL MSVCRT__splitpath(const char *inpath, char *drv, char *dir, char *fname, char *ext) { - _splitpath_s(inpath, drv, drv?MSVCRT__MAX_DRIVE:0, dir, dir?MSVCRT__MAX_DIR:0, + MSVCRT__splitpath_s(inpath, drv, drv?MSVCRT__MAX_DRIVE:0, dir, dir?MSVCRT__MAX_DIR:0, fname, fname?MSVCRT__MAX_FNAME:0, ext, ext?MSVCRT__MAX_EXT:0); } @@ -1115,7 +1123,7 @@ * * Secure version of _wsplitpath */ -int CDECL _wsplitpath_s(const MSVCRT_wchar_t* inpath, +int CDECL MSVCRT__wsplitpath_s(const MSVCRT_wchar_t* inpath, MSVCRT_wchar_t* drive, MSVCRT_size_t sz_drive, MSVCRT_wchar_t* dir, MSVCRT_size_t sz_dir, MSVCRT_wchar_t* fname, MSVCRT_size_t sz_fname, @@ -1197,10 +1205,10 @@ * * Unicode version of _splitpath. */ -void CDECL _wsplitpath(const MSVCRT_wchar_t *inpath, MSVCRT_wchar_t *drv, MSVCRT_wchar_t *dir, +void CDECL MSVCRT__wsplitpath(const MSVCRT_wchar_t *inpath, MSVCRT_wchar_t *drv, MSVCRT_wchar_t *dir, MSVCRT_wchar_t *fname, MSVCRT_wchar_t *ext) { - _wsplitpath_s(inpath, drv, drv?MSVCRT__MAX_DRIVE:0, dir, dir?MSVCRT__MAX_DIR:0, + MSVCRT__wsplitpath_s(inpath, drv, drv?MSVCRT__MAX_DRIVE:0, dir, dir?MSVCRT__MAX_DIR:0, fname, fname?MSVCRT__MAX_FNAME:0, ext, ext?MSVCRT__MAX_EXT:0); } @@ -1209,7 +1217,7 @@ * * Unicode version of _fullpath. */ -MSVCRT_wchar_t * CDECL _wfullpath(MSVCRT_wchar_t * absPath, const MSVCRT_wchar_t* relPath, MSVCRT_size_t size) +MSVCRT_wchar_t * CDECL MSVCRT__wfullpath(MSVCRT_wchar_t * absPath, const MSVCRT_wchar_t* relPath, MSVCRT_size_t size) { DWORD rc; WCHAR* buffer; @@ -1263,7 +1271,7 @@ * Otherwise populates absPath with the path and returns it. * Failure: NULL. errno indicates the error. */ -char * CDECL _fullpath(char * absPath, const char* relPath, unsigned int size) +char * CDECL MSVCRT__fullpath(char * absPath, const char* relPath, unsigned int size) { DWORD rc; char* lastpart; @@ -1318,7 +1326,7 @@ * Nothing. If path is not large enough to hold the resulting pathname, * random process memory will be overwritten. */ -VOID CDECL _makepath(char * path, const char * drive, +VOID CDECL MSVCRT__makepath(char * path, const char * drive, const char *directory, const char * filename, const char * extension) { @@ -1365,7 +1373,7 @@ * * Unicode version of _wmakepath. */ -VOID CDECL _wmakepath(MSVCRT_wchar_t *path, const MSVCRT_wchar_t *drive, const MSVCRT_wchar_t *directory, +VOID CDECL MSVCRT__wmakepath(MSVCRT_wchar_t *path, const MSVCRT_wchar_t *drive, const MSVCRT_wchar_t *directory, const MSVCRT_wchar_t *filename, const MSVCRT_wchar_t *extension) { MSVCRT_wchar_t *p = path; @@ -1412,7 +1420,7 @@ * * Safe version of _makepath. */ -int CDECL _makepath_s(char *path, MSVCRT_size_t size, const char *drive, +int CDECL MSVCRT__makepath_s(char *path, MSVCRT_size_t size, const char *drive, const char *directory, const char *filename, const char *extension) { @@ -1516,7 +1524,7 @@ * * Safe version of _wmakepath. */ -int CDECL _wmakepath_s(MSVCRT_wchar_t *path, MSVCRT_size_t size, const MSVCRT_wchar_t *drive, +int CDECL MSVCRT__wmakepath_s(MSVCRT_wchar_t *path, MSVCRT_size_t size, const MSVCRT_wchar_t *drive, const MSVCRT_wchar_t *directory, const MSVCRT_wchar_t *filename, const MSVCRT_wchar_t *extension) { @@ -1690,7 +1698,7 @@ /********************************************************************* * _searchenv_s (MSVCRT.@) */ -int CDECL _searchenv_s(const char* file, const char* env, char *buf, MSVCRT_size_t count) +int CDECL MSVCRT__searchenv_s(const char* file, const char* env, char *buf, MSVCRT_size_t count) { char*envVal, *penv; char curPath[MAX_PATH]; @@ -1821,7 +1829,7 @@ /********************************************************************* * _wsearchenv_s (MSVCRT.@) */ -int CDECL _wsearchenv_s(const MSVCRT_wchar_t* file, const MSVCRT_wchar_t* env, +int CDECL MSVCRT__wsearchenv_s(const MSVCRT_wchar_t* file, const MSVCRT_wchar_t* env, MSVCRT_wchar_t *buf, MSVCRT_size_t count) { MSVCRT_wchar_t* envVal, *penv; diff -Nru wine1.7-1.7.14/dlls/msvcrt/errno.c wine1.7-1.7.18/dlls/msvcrt/errno.c --- wine1.7-1.7.14/dlls/msvcrt/errno.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msvcrt/errno.c 2014-05-02 18:15:48.000000000 +0000 @@ -189,6 +189,22 @@ } /********************************************************************* + * __sys_nerr (MSVCR100.@) + */ +int* CDECL __sys_nerr(void) +{ + return (int*)&MSVCRT__sys_nerr; +} + +/********************************************************************* + * __sys_errlist (MSVCR100.@) + */ +char** CDECL __sys_errlist(void) +{ + return MSVCRT__sys_errlist; +} + +/********************************************************************* * _errno (MSVCRT.@) */ int* CDECL MSVCRT__errno(void) @@ -264,7 +280,7 @@ /********************************************************************** * strerror_s (MSVCRT.@) */ -int CDECL strerror_s(char *buffer, MSVCRT_size_t numberOfElements, int errnum) +int CDECL MSVCRT_strerror_s(char *buffer, MSVCRT_size_t numberOfElements, int errnum) { char *ptr; @@ -330,7 +346,7 @@ /********************************************************************* * _wcserror_s (MSVCRT.@) */ -int CDECL _wcserror_s(MSVCRT_wchar_t* buffer, MSVCRT_size_t nc, int err) +int CDECL MSVCRT__wcserror_s(MSVCRT_wchar_t* buffer, MSVCRT_size_t nc, int err) { if (!MSVCRT_CHECK_PMT(buffer != NULL)) return MSVCRT_EINVAL; if (!MSVCRT_CHECK_PMT(nc > 0)) return MSVCRT_EINVAL; @@ -349,14 +365,14 @@ if (!data->wcserror_buffer) if (!(data->wcserror_buffer = MSVCRT_malloc(256 * sizeof(MSVCRT_wchar_t)))) return NULL; - _wcserror_s(data->wcserror_buffer, 256, err); + MSVCRT__wcserror_s(data->wcserror_buffer, 256, err); return data->wcserror_buffer; } /********************************************************************** * __wcserror_s (MSVCRT.@) */ -int CDECL __wcserror_s(MSVCRT_wchar_t* buffer, MSVCRT_size_t nc, const MSVCRT_wchar_t* str) +int CDECL MSVCRT___wcserror_s(MSVCRT_wchar_t* buffer, MSVCRT_size_t nc, const MSVCRT_wchar_t* str) { int err; static const WCHAR colonW[] = {':', ' ', '\0'}; @@ -397,7 +413,7 @@ if (!data->wcserror_buffer) if (!(data->wcserror_buffer = MSVCRT_malloc(256 * sizeof(MSVCRT_wchar_t)))) return NULL; - err = __wcserror_s(data->wcserror_buffer, 256, str); + err = MSVCRT___wcserror_s(data->wcserror_buffer, 256, str); if (err) FIXME("bad wcserror call (%d)\n", err); return data->wcserror_buffer; @@ -421,18 +437,32 @@ else { ERR( "%s:%u %s: %s %lx\n", debugstr_w(file), line, debugstr_w(func), debugstr_w(expr), arg ); +#if _MSVCR_VER > 0 RaiseException( STATUS_INVALID_CRUNTIME_PARAMETER, EXCEPTION_NONCONTINUABLE, 0, NULL ); +#endif } } -/* _get_invalid_parameter_handler - not exported in native msvcrt, added in msvcr80 */ +/********************************************************************* + * _invalid_parameter_noinfo (MSVCR100.@) + */ +void CDECL _invalid_parameter_noinfo(void) +{ + MSVCRT__invalid_parameter( NULL, NULL, NULL, 0, 0 ); +} + +/********************************************************************* + * _get_invalid_parameter_handler (MSVCR80.@) + */ MSVCRT_invalid_parameter_handler CDECL _get_invalid_parameter_handler(void) { TRACE("\n"); return invalid_parameter_handler; } -/* _set_invalid_parameter_handler - not exproted in native msvcrt, added in msvcr80 */ +/********************************************************************* + * _set_invalid_parameter_handler (MSVCR80.@) + */ MSVCRT_invalid_parameter_handler CDECL _set_invalid_parameter_handler( MSVCRT_invalid_parameter_handler handler) { diff -Nru wine1.7-1.7.14/dlls/msvcrt/except.c wine1.7-1.7.18/dlls/msvcrt/except.c --- wine1.7-1.7.14/dlls/msvcrt/except.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msvcrt/except.c 2014-05-02 18:15:48.000000000 +0000 @@ -285,14 +285,16 @@ } /****************************************************************** - * MSVCRT___uncaught_exception + * __uncaught_exception (MSVCRT.@) */ BOOL CDECL MSVCRT___uncaught_exception(void) { return FALSE; } -/* _set_security_error_handler - not exported in native msvcrt, added in msvcr70 */ +/********************************************************************* + * _set_security_error_handler (MSVCR70.@) + */ MSVCRT_security_error_handler CDECL _set_security_error_handler( MSVCRT_security_error_handler handler ) { @@ -304,7 +306,9 @@ return old; } -/* __security_error_handler - not exported in native msvcrt */ +/********************************************************************* + * __security_error_handler (MSVCR70.@) + */ void CDECL __security_error_handler(int code, void *data) { if(security_error_handler) @@ -314,3 +318,11 @@ MSVCRT__exit(3); } + +/********************************************************************* + * __crtSetUnhandledExceptionFilter (MSVCR110.@) + */ +LPTOP_LEVEL_EXCEPTION_FILTER CDECL MSVCR110__crtSetUnhandledExceptionFilter(LPTOP_LEVEL_EXCEPTION_FILTER filter) +{ + return SetUnhandledExceptionFilter(filter); +} diff -Nru wine1.7-1.7.14/dlls/msvcrt/except_i386.c wine1.7-1.7.18/dlls/msvcrt/except_i386.c --- wine1.7-1.7.14/dlls/msvcrt/except_i386.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msvcrt/except_i386.c 2014-05-02 18:15:48.000000000 +0000 @@ -374,23 +374,28 @@ { PEXCEPTION_RECORD prev_rec = nested_frame->rec; if((rec->ExceptionInformation[1] == 0 && rec->ExceptionInformation[2] == 0) || - (rec->ExceptionInformation[1] == prev_rec->ExceptionInformation[1] && + (prev_rec->ExceptionCode == CXX_EXCEPTION && + rec->ExceptionInformation[1] == prev_rec->ExceptionInformation[1] && rec->ExceptionInformation[2] == prev_rec->ExceptionInformation[2])) { /* exception was rethrown */ - rec->ExceptionInformation[1] = prev_rec->ExceptionInformation[1]; - rec->ExceptionInformation[2] = prev_rec->ExceptionInformation[2]; - TRACE("detect rethrow: re-propagate: obj: %lx, type: %lx\n", - rec->ExceptionInformation[1], rec->ExceptionInformation[2]); + *rec = *prev_rec; + rec->ExceptionFlags &= ~EH_UNWINDING; + if(TRACE_ON(seh)) { + TRACE("detect rethrow: exception code: %x\n", rec->ExceptionCode); + if(rec->ExceptionCode == CXX_EXCEPTION) + TRACE("re-propage: obj: %lx, type: %lx\n", + rec->ExceptionInformation[1], rec->ExceptionInformation[2]); + } } - else if (nested_frame->prev_rec && + else if (nested_frame->prev_rec && nested_frame->prev_rec->ExceptionCode == CXX_EXCEPTION && nested_frame->prev_rec->ExceptionInformation[1] == prev_rec->ExceptionInformation[1] && nested_frame->prev_rec->ExceptionInformation[2] == prev_rec->ExceptionInformation[2]) { TRACE("detect threw new exception in catch block - not owning old(obj: %lx type: %lx)\n", prev_rec->ExceptionInformation[1], prev_rec->ExceptionInformation[2]); } - else { + else if (prev_rec->ExceptionCode == CXX_EXCEPTION) { /* new exception in exception handler, destroy old */ void *object = (void*)prev_rec->ExceptionInformation[1]; cxx_exception_type *info = (cxx_exception_type*) prev_rec->ExceptionInformation[2]; @@ -399,6 +404,10 @@ if(info && info->destructor) call_dtor( info->destructor, object ); } + else + { + TRACE("detect threw new exception in catch block\n"); + } } return cxx_frame_handler( rec, nested_frame->cxx_frame, context, @@ -513,17 +522,21 @@ } if (!descr->tryblock_count) return ExceptionContinueSearch; - if(rec->ExceptionCode == CXX_EXCEPTION) + if(rec->ExceptionCode == CXX_EXCEPTION && + rec->ExceptionInformation[1] == 0 && rec->ExceptionInformation[2] == 0) { - if (rec->ExceptionInformation[1] == 0 && rec->ExceptionInformation[2] == 0) - { - EXCEPTION_RECORD *exc_record = msvcrt_get_thread_data()->exc_record; - rec->ExceptionInformation[1] = exc_record->ExceptionInformation[1]; - rec->ExceptionInformation[2] = exc_record->ExceptionInformation[2]; - TRACE("detect rethrow: obj: %lx, type: %lx\n", - rec->ExceptionInformation[1], rec->ExceptionInformation[2]); + *rec = *msvcrt_get_thread_data()->exc_record; + rec->ExceptionFlags &= ~EH_UNWINDING; + if(TRACE_ON(seh)) { + TRACE("detect rethrow: exception code: %x\n", rec->ExceptionCode); + if(rec->ExceptionCode == CXX_EXCEPTION) + TRACE("re-propage: obj: %lx, type: %lx\n", + rec->ExceptionInformation[1], rec->ExceptionInformation[2]); } + } + if(rec->ExceptionCode == CXX_EXCEPTION) + { exc_type = (cxx_exception_type *)rec->ExceptionInformation[2]; if (rec->ExceptionInformation[0] > CXX_FRAME_MAGIC_VC8 && diff -Nru wine1.7-1.7.14/dlls/msvcrt/exit.c wine1.7-1.7.18/dlls/msvcrt/exit.c --- wine1.7-1.7.14/dlls/msvcrt/exit.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msvcrt/exit.c 2014-05-02 18:15:48.000000000 +0000 @@ -184,9 +184,7 @@ } /********************************************************************* - * _set_abort_behavior (MSVCRT.@) - * - * Not exported by native msvcrt, added in msvcr80 + * _set_abort_behavior (MSVCR80.@) */ unsigned int CDECL MSVCRT__set_abort_behavior(unsigned int flags, unsigned int mask) { @@ -327,7 +325,9 @@ return MSVCRT__onexit((MSVCRT__onexit_t)func) == (MSVCRT__onexit_t)func ? 0 : -1; } -/* _set_purecall_handler - not exported in native msvcrt */ +/********************************************************************* + * _set_purecall_handler (MSVCR71.@) + */ MSVCRT_purecall_handler CDECL _set_purecall_handler(MSVCRT_purecall_handler function) { MSVCRT_purecall_handler ret = purecall_handler; diff -Nru wine1.7-1.7.14/dlls/msvcrt/file.c wine1.7-1.7.18/dlls/msvcrt/file.c --- wine1.7-1.7.14/dlls/msvcrt/file.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msvcrt/file.c 2014-05-02 18:15:48.000000000 +0000 @@ -208,6 +208,21 @@ buf->st_ctime = buf64->st_ctime; } +static void msvcrt_stat64_to_stat32i64(const struct MSVCRT__stat64 *buf64, struct MSVCRT__stat32i64 *buf) +{ + buf->st_dev = buf64->st_dev; + buf->st_ino = buf64->st_ino; + buf->st_mode = buf64->st_mode; + buf->st_nlink = buf64->st_nlink; + buf->st_uid = buf64->st_uid; + buf->st_gid = buf64->st_gid; + buf->st_rdev = buf64->st_rdev; + buf->st_size = buf64->st_size; + buf->st_atime = buf64->st_atime; + buf->st_mtime = buf64->st_mtime; + buf->st_ctime = buf64->st_ctime; +} + static void time_to_filetime( MSVCRT___time64_t time, FILETIME *ft ) { /* 1601 to 1970 is 369 years plus 89 leap days */ @@ -713,7 +728,7 @@ /********************************************************************* * _access_s (MSVCRT.@) */ -int CDECL _access_s(const char *filename, int mode) +int CDECL MSVCRT__access_s(const char *filename, int mode) { if (!MSVCRT_CHECK_PMT(filename != NULL)) return *MSVCRT__errno(); if (!MSVCRT_CHECK_PMT((mode & ~(MSVCRT_R_OK | MSVCRT_W_OK)) == 0)) return *MSVCRT__errno(); @@ -748,7 +763,7 @@ /********************************************************************* * _waccess_s (MSVCRT.@) */ -int CDECL _waccess_s(const MSVCRT_wchar_t *filename, int mode) +int CDECL MSVCRT__waccess_s(const MSVCRT_wchar_t *filename, int mode) { if (!MSVCRT_CHECK_PMT(filename != NULL)) return *MSVCRT__errno(); if (!MSVCRT_CHECK_PMT((mode & ~(MSVCRT_R_OK | MSVCRT_W_OK)) == 0)) return *MSVCRT__errno(); @@ -1613,8 +1628,10 @@ return ret; } -/* _fstat32 - not exported in native msvcrt */ -int CDECL _fstat32(int fd, struct MSVCRT__stat32* buf) +/********************************************************************* + * _fstat32 (MSVCR80.@) + */ +int CDECL MSVCRT__fstat32(int fd, struct MSVCRT__stat32* buf) { int ret; struct MSVCRT__stat64 buf64; @@ -1625,8 +1642,10 @@ return ret; } -/* _fstat64i32 - not exported in native msvcrt */ -int CDECL _fstat64i32(int fd, struct MSVCRT__stat64i32* buf) +/********************************************************************* + * _fstat64i32 (MSVCR80.@) + */ +int CDECL MSVCRT__fstat64i32(int fd, struct MSVCRT__stat64i32* buf) { int ret; struct MSVCRT__stat64 buf64; @@ -2781,7 +2800,8 @@ * _stat (MSVCRT.@) */ int CDECL MSVCRT_stat(const char* path, struct MSVCRT__stat * buf) -{ int ret; +{ + int ret; struct MSVCRT__stat64 buf64; ret = MSVCRT_stat64( path, &buf64); @@ -2791,6 +2811,48 @@ } /********************************************************************* + * _stat32 (MSVCR100.@) + */ +int CDECL MSVCRT__stat32(const char *path, struct MSVCRT__stat32 *buf) +{ + int ret; + struct MSVCRT__stat64 buf64; + + ret = MSVCRT_stat64(path, &buf64); + if (!ret) + msvcrt_stat64_to_stat32(&buf64, buf); + return ret; +} + +/********************************************************************* + * _stat32i64 (MSVCR100.@) + */ +int CDECL MSVCRT__stat32i64(const char *path, struct MSVCRT__stat32i64 *buf) +{ + int ret; + struct MSVCRT__stat64 buf64; + + ret = MSVCRT_stat64(path, &buf64); + if (!ret) + msvcrt_stat64_to_stat32i64(&buf64, buf); + return ret; +} + +/********************************************************************* + * _stat64i32 (MSVCR100.@) + */ +int CDECL MSVCRT__stat64i32(const char* path, struct MSVCRT__stat64i32 *buf) +{ + int ret; + struct MSVCRT__stat64 buf64; + + ret = MSVCRT_stat64(path, &buf64); + if (!ret) + msvcrt_stat64_to_stat64i32(&buf64, buf); + return ret; +} + +/********************************************************************* * _wstat64 (MSVCRT.@) */ int CDECL MSVCRT__wstat64(const MSVCRT_wchar_t* path, struct MSVCRT__stat64 * buf) @@ -2888,6 +2950,48 @@ } /********************************************************************* + * _wstat32 (MSVCR100.@) + */ +int CDECL MSVCRT__wstat32(const MSVCRT_wchar_t *path, struct MSVCRT__stat32 *buf) +{ + int ret; + struct MSVCRT__stat64 buf64; + + ret = MSVCRT__wstat64(path, &buf64); + if (!ret) + msvcrt_stat64_to_stat32(&buf64, buf); + return ret; +} + +/********************************************************************* + * _wstat32i64 (MSVCR100.@) + */ +int CDECL MSVCRT__wstat32i64(const MSVCRT_wchar_t *path, struct MSVCRT__stat32i64 *buf) +{ + int ret; + struct MSVCRT__stat64 buf64; + + ret = MSVCRT__wstat64(path, &buf64); + if (!ret) + msvcrt_stat64_to_stat32i64(&buf64, buf); + return ret; +} + +/********************************************************************* + * _wstat64i32 (MSVCR100.@) + */ +int CDECL MSVCRT__wstat64i32(const MSVCRT_wchar_t *path, struct MSVCRT__stat64i32 *buf) +{ + int ret; + struct MSVCRT__stat64 buf64; + + ret = MSVCRT__wstat64(path, &buf64); + if (!ret) + msvcrt_stat64_to_stat64i32(&buf64, buf); + return ret; +} + +/********************************************************************* * _tell (MSVCRT.@) */ MSVCRT_long CDECL MSVCRT__tell(int fd) @@ -3876,8 +3980,10 @@ } -/* fread_s - not exported in native msvcrt */ -MSVCRT_size_t CDECL fread_s(void *buf, MSVCRT_size_t buf_size, MSVCRT_size_t elem_size, +/********************************************************************* + * fread_s (MSVCR80.@) + */ +MSVCRT_size_t CDECL MSVCRT_fread_s(void *buf, MSVCRT_size_t buf_size, MSVCRT_size_t elem_size, MSVCRT_size_t count, MSVCRT_FILE *stream) { size_t bytes_left, buf_pos; @@ -3934,7 +4040,7 @@ { int open_flags, stream_flags, fd; - TRACE(":path (%s) mode (%s) file (%p) fd (%d)\n", debugstr_w(path), debugstr_w(mode), file, file->_file); + TRACE(":path (%s) mode (%s) file (%p) fd (%d)\n", debugstr_w(path), debugstr_w(mode), file, file ? file->_file : -1); LOCK_FILES(); if (!file || ((fd = file->_file) < 0) || fd > MSVCRT_fdend) diff -Nru wine1.7-1.7.14/dlls/msvcrt/heap.c wine1.7-1.7.18/dlls/msvcrt/heap.c --- wine1.7-1.7.14/dlls/msvcrt/heap.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msvcrt/heap.c 2014-05-02 18:15:48.000000000 +0000 @@ -38,6 +38,7 @@ ((((DWORD_PTR)((char *)ptr + alignment + sizeof(void *) + offset)) & \ ~(alignment - 1)) - offset)) +static HANDLE heap; typedef int (CDECL *MSVCRT_new_handler_func)(MSVCRT_size_t size); @@ -59,7 +60,7 @@ do { - retval = HeapAlloc(GetProcessHeap(), 0, size); + retval = HeapAlloc(heap, 0, size); if(retval) { TRACE("(%ld) returning %p\n", size, retval); @@ -94,7 +95,7 @@ void CDECL MSVCRT_operator_delete(void *mem) { TRACE("(%p)\n", mem); - HeapFree(GetProcessHeap(), 0, mem); + HeapFree(heap, 0, mem); } @@ -166,7 +167,7 @@ */ void* CDECL _expand(void* mem, MSVCRT_size_t size) { - return HeapReAlloc(GetProcessHeap(), HEAP_REALLOC_IN_PLACE_ONLY, mem, size); + return HeapReAlloc(heap, HEAP_REALLOC_IN_PLACE_ONLY, mem, size); } /********************************************************************* @@ -174,7 +175,7 @@ */ int CDECL _heapchk(void) { - if (!HeapValidate( GetProcessHeap(), 0, NULL)) + if (!HeapValidate( heap, 0, NULL)) { msvcrt_set_errno(GetLastError()); return MSVCRT__HEAPBADNODE; @@ -187,7 +188,7 @@ */ int CDECL _heapmin(void) { - if (!HeapCompact( GetProcessHeap(), 0 )) + if (!HeapCompact( heap, 0 )) { if (GetLastError() != ERROR_CALL_NOT_IMPLEMENTED) msvcrt_set_errno(GetLastError()); @@ -209,7 +210,7 @@ phe.wFlags = next->_useflag == MSVCRT__USEDENTRY ? PROCESS_HEAP_ENTRY_BUSY : 0; if (phe.lpData && phe.wFlags & PROCESS_HEAP_ENTRY_BUSY && - !HeapValidate( GetProcessHeap(), 0, phe.lpData )) + !HeapValidate( heap, 0, phe.lpData )) { UNLOCK_HEAP; msvcrt_set_errno(GetLastError()); @@ -218,7 +219,7 @@ do { - if (!HeapWalk( GetProcessHeap(), &phe )) + if (!HeapWalk( heap, &phe )) { UNLOCK_HEAP; if (GetLastError() == ERROR_NO_MORE_ITEMS) @@ -267,11 +268,11 @@ } /********************************************************************* - * _heapadd (MSVCRT.@) + * _get_heap_handle (MSVCRT.@) */ MSVCRT_intptr_t CDECL _get_heap_handle(void) { - return (MSVCRT_intptr_t)GetProcessHeap(); + return (MSVCRT_intptr_t)heap; } /********************************************************************* @@ -279,7 +280,7 @@ */ MSVCRT_size_t CDECL _msize(void* mem) { - MSVCRT_size_t size = HeapSize(GetProcessHeap(),0,mem); + MSVCRT_size_t size = HeapSize(heap,0,mem); if (size == ~(MSVCRT_size_t)0) { WARN(":Probably called with non wine-allocated memory, ret = -1\n"); @@ -289,11 +290,27 @@ } /********************************************************************* + * _aligned_msize (MSVCR100.@) + */ +size_t CDECL _aligned_msize(void *p, MSVCRT_size_t alignment, MSVCRT_size_t offset) +{ + void **alloc_ptr; + + if(!MSVCRT_CHECK_PMT(p)) return -1; + + if(alignment < sizeof(void*)) + alignment = sizeof(void*); + + alloc_ptr = SAVED_PTR(p); + return _msize(*alloc_ptr)-alignment-sizeof(void*); +} + +/********************************************************************* * calloc (MSVCRT.@) */ void* CDECL MSVCRT_calloc(MSVCRT_size_t size, MSVCRT_size_t count) { - return HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, size * count ); + return HeapAlloc( heap, HEAP_ZERO_MEMORY, size * count ); } /********************************************************************* @@ -301,7 +318,7 @@ */ void CDECL MSVCRT_free(void* ptr) { - HeapFree(GetProcessHeap(),0,ptr); + HeapFree(heap,0,ptr); } /********************************************************************* @@ -309,7 +326,7 @@ */ void* CDECL MSVCRT_malloc(MSVCRT_size_t size) { - void *ret = HeapAlloc(GetProcessHeap(),0,size); + void *ret = HeapAlloc(heap,0,size); if (!ret) *MSVCRT__errno() = MSVCRT_ENOMEM; return ret; @@ -321,12 +338,37 @@ void* CDECL MSVCRT_realloc(void* ptr, MSVCRT_size_t size) { if (!ptr) return MSVCRT_malloc(size); - if (size) return HeapReAlloc(GetProcessHeap(), 0, ptr, size); + if (size) return HeapReAlloc(heap, 0, ptr, size); MSVCRT_free(ptr); return NULL; } /********************************************************************* + * _recalloc (MSVCR100.@) + */ +void* CDECL _recalloc(void *mem, MSVCRT_size_t num, MSVCRT_size_t size) +{ + MSVCRT_size_t old_size; + void *ret; + + if(!mem) + return MSVCRT_calloc(num, size); + + size = num*size; + old_size = _msize(mem); + + ret = MSVCRT_realloc(mem, size); + if(!ret) { + *MSVCRT__errno() = MSVCRT_ENOMEM; + return NULL; + } + + if(size>old_size) + memset((BYTE*)ret+old_size, 0, size-old_size); + return ret; +} + +/********************************************************************* * __p__amblksiz (MSVCRT.@) */ unsigned int* CDECL __p__amblksiz(void) @@ -547,7 +589,7 @@ /********************************************************************* * memmove_s (MSVCRT.@) */ -int CDECL memmove_s(void *dest, MSVCRT_size_t numberOfElements, const void *src, MSVCRT_size_t count) +int CDECL MSVCRT_memmove_s(void *dest, MSVCRT_size_t numberOfElements, const void *src, MSVCRT_size_t count) { TRACE("(%p %lu %p %lu)\n", dest, numberOfElements, src, count); @@ -563,9 +605,32 @@ } /********************************************************************* + * wmemmove_s (MSVCR100.@) + */ +int CDECL wmemmove_s(MSVCRT_wchar_t *dest, MSVCRT_size_t numberOfElements, + const MSVCRT_wchar_t *src, MSVCRT_size_t count) +{ + TRACE("(%p %lu %p %lu)\n", dest, numberOfElements, src, count); + + if (!count) + return 0; + + /* Native does not seem to conform to 6.7.1.2.3 in + * http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1225.pdf + * in that it does not zero the output buffer on constraint violation. + */ + if (!MSVCRT_CHECK_PMT(dest != NULL)) return MSVCRT_EINVAL; + if (!MSVCRT_CHECK_PMT(src != NULL)) return MSVCRT_EINVAL; + if (!MSVCRT_CHECK_PMT_ERR(count <= numberOfElements, MSVCRT_ERANGE)) return MSVCRT_ERANGE; + + memmove(dest, src, sizeof(MSVCRT_wchar_t)*count); + return 0; +} + +/********************************************************************* * memcpy_s (MSVCRT.@) */ -int CDECL memcpy_s(void *dest, MSVCRT_size_t numberOfElements, const void *src, MSVCRT_size_t count) +int CDECL MSVCRT_memcpy_s(void *dest, MSVCRT_size_t numberOfElements, const void *src, MSVCRT_size_t count) { TRACE("(%p %lu %p %lu)\n", dest, numberOfElements, src, count); @@ -589,9 +654,35 @@ } /********************************************************************* + * wmemcpy_s (MSVCR100.@) + */ +int CDECL wmemcpy_s(MSVCRT_wchar_t *dest, MSVCRT_size_t numberOfElements, + const MSVCRT_wchar_t *src, MSVCRT_size_t count) +{ + TRACE("(%p %lu %p %lu)\n", dest, numberOfElements, src, count); + + if (!count) + return 0; + + if (!MSVCRT_CHECK_PMT(dest != NULL)) return MSVCRT_EINVAL; + + if (!MSVCRT_CHECK_PMT(src != NULL)) { + memset(dest, 0, numberOfElements*sizeof(MSVCRT_wchar_t)); + return MSVCRT_EINVAL; + } + if (!MSVCRT_CHECK_PMT_ERR(count <= numberOfElements, MSVCRT_ERANGE)) { + memset(dest, 0, numberOfElements*sizeof(MSVCRT_wchar_t)); + return MSVCRT_ERANGE; + } + + memcpy(dest, src, sizeof(MSVCRT_wchar_t)*count); + return 0; +} + +/********************************************************************* * strncpy_s (MSVCRT.@) */ -int CDECL strncpy_s(char *dest, MSVCRT_size_t numberOfElements, +int CDECL MSVCRT_strncpy_s(char *dest, MSVCRT_size_t numberOfElements, const char *src, MSVCRT_size_t count) { MSVCRT_size_t i, end; @@ -625,3 +716,14 @@ dest[0] = '\0'; return MSVCRT_EINVAL; } + +BOOL msvcrt_init_heap(void) +{ + heap = HeapCreate(0, 0, 0); + return heap != NULL; +} + +void msvcrt_destroy_heap(void) +{ + HeapDestroy(heap); +} diff -Nru wine1.7-1.7.14/dlls/msvcrt/locale.c wine1.7-1.7.18/dlls/msvcrt/locale.c --- wine1.7-1.7.14/dlls/msvcrt/locale.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msvcrt/locale.c 2014-05-02 18:15:48.000000000 +0000 @@ -1455,7 +1455,9 @@ return ret ? current_lc_all : NULL; } -/* _configthreadlocale - not exported in native msvcrt */ +/********************************************************************* + * _configthreadlocale (MSVCR80.@) + */ int CDECL _configthreadlocale(int type) { thread_data_t *data = msvcrt_get_thread_data(); diff -Nru wine1.7-1.7.14/dlls/msvcrt/main.c wine1.7-1.7.18/dlls/msvcrt/main.c --- wine1.7-1.7.14/dlls/msvcrt/main.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msvcrt/main.c 2014-05-02 18:15:48.000000000 +0000 @@ -98,12 +98,17 @@ { case DLL_PROCESS_ATTACH: msvcrt_init_exception(hinstDLL); - if (!msvcrt_init_tls()) + if(!msvcrt_init_heap()) + return FALSE; + if(!msvcrt_init_tls()) { + msvcrt_destroy_heap(); return FALSE; + } msvcrt_init_mt_locks(); if(!msvcrt_init_locale()) { msvcrt_free_mt_locks(); msvcrt_free_tls_mem(); + msvcrt_destroy_heap(); return FALSE; } msvcrt_init_math(); @@ -111,8 +116,12 @@ msvcrt_init_console(); msvcrt_init_args(); msvcrt_init_signals(); +#if _MSVCR_VER == 0 /* don't allow unloading msvcrt, we can't setup file handles twice */ LdrAddRefDll( LDR_ADDREF_DLL_PIN, hinstDLL ); +#elif _MSVCR_VER >= 80 + MSVCRT__set_printf_count_output(0); +#endif TRACE("finished process init\n"); break; case DLL_THREAD_ATTACH: @@ -129,6 +138,7 @@ if (!msvcrt_free_tls()) return FALSE; MSVCRT__free_locale(MSVCRT_locale); + msvcrt_destroy_heap(); TRACE("finished process free\n"); break; case DLL_THREAD_DETACH: diff -Nru wine1.7-1.7.14/dlls/msvcrt/Makefile.in wine1.7-1.7.18/dlls/msvcrt/Makefile.in --- wine1.7-1.7.14/dlls/msvcrt/Makefile.in 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msvcrt/Makefile.in 2014-05-02 18:15:48.000000000 +0000 @@ -1,4 +1,4 @@ -EXTRADEFS = -D_MT +EXTRADEFS = -D_MT -D_MSVCR_VER=0 MODULE = msvcrt.dll IMPORTLIB = msvcrt DELAYIMPORTS = advapi32 user32 diff -Nru wine1.7-1.7.14/dlls/msvcrt/math.c wine1.7-1.7.18/dlls/msvcrt/math.c --- wine1.7-1.7.14/dlls/msvcrt/math.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msvcrt/math.c 2014-05-02 18:15:48.000000000 +0000 @@ -1338,7 +1338,7 @@ /********************************************************************* * _ecvt (MSVCRT.@) */ -char * CDECL _ecvt( double number, int ndigits, int *decpt, int *sign ) +char * CDECL MSVCRT__ecvt( double number, int ndigits, int *decpt, int *sign ) { int prec, len; thread_data_t *data = msvcrt_get_thread_data(); @@ -1382,7 +1382,7 @@ /********************************************************************* * _ecvt_s (MSVCRT.@) */ -int CDECL _ecvt_s( char *buffer, MSVCRT_size_t length, double number, int ndigits, int *decpt, int *sign ) +int CDECL MSVCRT__ecvt_s( char *buffer, MSVCRT_size_t length, double number, int ndigits, int *decpt, int *sign ) { int prec, len; char *result; @@ -1443,7 +1443,7 @@ /*********************************************************************** * _fcvt (MSVCRT.@) */ -char * CDECL _fcvt( double number, int ndigits, int *decpt, int *sign ) +char * CDECL MSVCRT__fcvt( double number, int ndigits, int *decpt, int *sign ) { thread_data_t *data = msvcrt_get_thread_data(); int stop, dec1, dec2; @@ -1526,7 +1526,7 @@ /*********************************************************************** * _fcvt_s (MSVCRT.@) */ -int CDECL _fcvt_s(char* outbuffer, MSVCRT_size_t size, double number, int ndigits, int *decpt, int *sign) +int CDECL MSVCRT__fcvt_s(char* outbuffer, MSVCRT_size_t size, double number, int ndigits, int *decpt, int *sign) { int stop, dec1, dec2; char *ptr1, *ptr2, *first; @@ -1615,7 +1615,7 @@ /*********************************************************************** * _gcvt (MSVCRT.@) */ -char * CDECL _gcvt( double number, int ndigit, char *buff ) +char * CDECL MSVCRT__gcvt( double number, int ndigit, char *buff ) { if(!buff) { *MSVCRT__errno() = MSVCRT_EINVAL; @@ -1634,7 +1634,7 @@ /*********************************************************************** * _gcvt_s (MSVCRT.@) */ -int CDECL _gcvt_s(char *buff, MSVCRT_size_t size, double number, int digits) +int CDECL MSVCRT__gcvt_s(char *buff, MSVCRT_size_t size, double number, int digits) { int len; @@ -2185,7 +2185,9 @@ __asm__ __volatile__( "movd %0,%%xmm0" : : "g" (f) ); } -/* __libm_sse2_sqrt_precise */ +/*********************************************************************** + * __libm_sse2_sqrt_precise (MSVCR110.@) + */ void __cdecl __libm_sse2_sqrt_precise(void) { double d; diff -Nru wine1.7-1.7.14/dlls/msvcrt/mbcs.c wine1.7-1.7.18/dlls/msvcrt/mbcs.c --- wine1.7-1.7.14/dlls/msvcrt/mbcs.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msvcrt/mbcs.c 2014-05-02 18:15:48.000000000 +0000 @@ -184,7 +184,9 @@ return get_locinfo()->mb_cur_max; } -/* ___mb_cur_max_l_func - not exported in native msvcrt */ +/********************************************************************* + * ___mb_cur_max_l_func (MSVCR80.@) + */ int* CDECL ___mb_cur_max_l_func(MSVCRT__locale_t locale) { MSVCRT_pthreadlocinfo locinfo; @@ -1151,8 +1153,10 @@ { thread_data_t *data = msvcrt_get_thread_data(); +#if _MSVCR_VER == 0 if(!str && !data->mbstok_next) return NULL; +#endif return _mbstok_s_l(str, delim, &data->mbstok_next, NULL); } diff -Nru wine1.7-1.7.14/dlls/msvcrt/misc.c wine1.7-1.7.18/dlls/msvcrt/misc.c --- wine1.7-1.7.14/dlls/msvcrt/misc.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msvcrt/misc.c 2014-05-02 18:15:48.000000000 +0000 @@ -305,7 +305,7 @@ /********************************************************************* * _get_output_format (MSVCRT.@) */ -unsigned int CDECL _get_output_format(void) +unsigned int CDECL MSVCRT__get_output_format(void) { return output_format; } @@ -334,3 +334,84 @@ /* causes stack fault that updates NtCurrentTeb()->Tib.StackLimit */ return VirtualProtect( &stack_addr, 1, PAGE_GUARD|PAGE_READWRITE, NULL ); } + +/********************************************************************* + * _decode_pointer (MSVCR90.@) + */ +void * CDECL MSVCRT_decode_pointer(void * ptr) +{ + return DecodePointer(ptr); +} + +/********************************************************************* + * _encode_pointer (MSVCR90.@) + */ +void * CDECL MSVCRT_encode_pointer(void * ptr) +{ + return EncodePointer(ptr); +} + +/********************************************************************* + * _encoded_null (MSVCR100.@) + */ +void * CDECL _encoded_null(void) +{ + TRACE("\n"); + + return EncodePointer(NULL); +} + +/********************************************************************* + * _CRT_RTC_INIT (MSVCR100.@) + */ +void* CDECL _CRT_RTC_INIT(void *unk1, void *unk2, int unk3, int unk4, int unk5) +{ + TRACE("%p %p %x %x %x\n", unk1, unk2, unk3, unk4, unk5); + return NULL; +} + +/********************************************************************* + * _CRT_RTC_INITW (MSVCR100.@) + */ +void* CDECL _CRT_RTC_INITW(void *unk1, void *unk2, int unk3, int unk4, int unk5) +{ + TRACE("%p %p %x %x %x\n", unk1, unk2, unk3, unk4, unk5); + return NULL; +} + +/********************************************************************* + * _byteswap_ushort (MSVCR100.@) + */ +unsigned short CDECL _byteswap_ushort(unsigned short s) +{ + return (s<<8) + (s>>8); +} + +/********************************************************************* + * _byteswap_ulong (MSVCR100.@) + */ +ULONG CDECL MSVCRT__byteswap_ulong(ULONG l) +{ + return (l<<24) + ((l<<8)&0xFF0000) + ((l>>8)&0xFF00) + (l>>24); +} + +/********************************************************************* + * _byteswap_uint64 (MSVCR100.@) + */ +unsigned __int64 CDECL _byteswap_uint64(unsigned __int64 i) +{ + return (i<<56) + ((i&0xFF00)<<40) + ((i&0xFF0000)<<24) + ((i&0xFF000000)<<8) + + ((i>>8)&0xFF000000) + ((i>>24)&0xFF0000) + ((i>>40)&0xFF00) + (i>>56); +} + +/********************************************************************* + * __crtGetShowWindowMode (MSVCR110.@) + */ +int CDECL MSVCR110__crtGetShowWindowMode(void) +{ + STARTUPINFOW si; + + GetStartupInfoW(&si); + TRACE("window=%d\n", si.wShowWindow); + return si.wShowWindow; +} diff -Nru wine1.7-1.7.14/dlls/msvcrt/msvcrt.h wine1.7-1.7.18/dlls/msvcrt/msvcrt.h --- wine1.7-1.7.14/dlls/msvcrt/msvcrt.h 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msvcrt/msvcrt.h 2014-05-02 18:15:48.000000000 +0000 @@ -274,6 +274,8 @@ extern void msvcrt_init_signals(void) DECLSPEC_HIDDEN; extern void msvcrt_free_signals(void) DECLSPEC_HIDDEN; extern void msvcrt_free_popen_data(void) DECLSPEC_HIDDEN; +extern BOOL msvcrt_init_heap(void) DECLSPEC_HIDDEN; +extern void msvcrt_destroy_heap(void) DECLSPEC_HIDDEN; extern unsigned msvcrt_create_io_inherit_block(WORD*, BYTE**) DECLSPEC_HIDDEN; @@ -933,6 +935,7 @@ int __cdecl MSVCRT__snprintf(char*,unsigned int,const char*,...); int __cdecl MSVCRT__scprintf(const char*,...); int __cdecl MSVCRT_raise(int sig); +int __cdecl MSVCRT__set_printf_count_output(int); #define MSVCRT__ENABLE_PER_THREAD_LOCALE 1 #define MSVCRT__DISABLE_PER_THREAD_LOCALE 2 @@ -989,7 +992,7 @@ int __cdecl MSVCRT__tolower_l(int,MSVCRT__locale_t); int __cdecl MSVCRT__strnicoll_l(const char*, const char*, MSVCRT_size_t, MSVCRT__locale_t); int __cdecl MSVCRT__strncoll_l(const char*, const char*, MSVCRT_size_t, MSVCRT__locale_t); -unsigned int __cdecl _get_output_format(void); +unsigned int __cdecl MSVCRT__get_output_format(void); char* __cdecl MSVCRT_strtok_s(char*, const char*, char**); /* Maybe one day we'll enable the invalid parameter handlers with the full set of information (msvcrXXd) diff -Nru wine1.7-1.7.14/dlls/msvcrt/msvcrt.spec wine1.7-1.7.18/dlls/msvcrt/msvcrt.spec --- wine1.7-1.7.14/dlls/msvcrt/msvcrt.spec 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msvcrt/msvcrt.spec 2014-05-02 18:15:48.000000000 +0000 @@ -245,11 +245,11 @@ @ cdecl -arch=i386 __libm_sse2_tan() @ cdecl -arch=i386 __libm_sse2_tanf() @ extern __mb_cur_max MSVCRT___mb_cur_max -@ cdecl __p___argc() -@ cdecl __p___argv() +@ cdecl __p___argc() MSVCRT___p___argc +@ cdecl __p___argv() MSVCRT___p___argv @ cdecl __p___initenv() @ cdecl __p___mb_cur_max() -@ cdecl __p___wargv() +@ cdecl __p___wargv() MSVCRT___p___wargv @ cdecl __p___winitenv() @ cdecl __p__acmdln() @ cdecl __p__amblksiz() @@ -264,7 +264,7 @@ @ cdecl __p__mbctype() @ cdecl __p__osver() @ cdecl __p__pctype() MSVCRT___p__pctype -@ cdecl __p__pgmptr() +@ cdecl __p__pgmptr() MSVCRT___p__pgmptr @ stub __p__pwctype() @ cdecl __p__timezone() MSVCRT___p__timezone @ cdecl __p__tzname() @@ -273,7 +273,7 @@ @ cdecl __p__winmajor() @ cdecl __p__winminor() @ cdecl __p__winver() -@ cdecl __p__wpgmptr() +@ cdecl __p__wpgmptr() MSVCRT___p__wpgmptr @ cdecl __pctype_func() MSVCRT___pctype_func @ extern __pioinfo MSVCRT___pioinfo # stub __pwctype_func() @@ -291,14 +291,14 @@ @ extern __unguarded_readlc_active MSVCRT___unguarded_readlc_active @ extern __wargv MSVCRT___wargv @ cdecl __wcserror(wstr) MSVCRT___wcserror -@ cdecl __wcserror_s(ptr long wstr) +@ cdecl __wcserror_s(ptr long wstr) MSVCRT___wcserror_s # stub __wcsncnt(wstr long) @ cdecl __wgetmainargs(ptr ptr ptr long ptr) @ extern __winitenv MSVCRT___winitenv @ cdecl _abnormal_termination() @ cdecl -ret64 _abs64(int64) @ cdecl _access(str long) MSVCRT__access -@ cdecl _access_s(str long) +@ cdecl _access_s(str long) MSVCRT__access_s @ extern _acmdln MSVCRT__acmdln @ stdcall -arch=i386 _adj_fdiv_m16i(long) @ stdcall -arch=i386 _adj_fdiv_m32(long) @@ -407,8 +407,8 @@ @ extern _dstbias MSVCRT__dstbias @ cdecl _dup (long) MSVCRT__dup @ cdecl _dup2 (long long) MSVCRT__dup2 -@ cdecl _ecvt(double long ptr ptr) -@ cdecl _ecvt_s(str long double long ptr ptr) +@ 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) @ extern _environ MSVCRT__environ @@ -429,8 +429,8 @@ @ cdecl _expand(ptr long) # stub _expand_dbg(ptr long long str long) @ cdecl _fcloseall() MSVCRT__fcloseall -@ cdecl _fcvt(double long ptr ptr) -@ cdecl _fcvt_s(ptr long double long ptr ptr) +@ cdecl _fcvt(double long ptr ptr) MSVCRT__fcvt +@ cdecl _fcvt_s(ptr long double long ptr ptr) MSVCRT__fcvt_s @ cdecl _fdopen(long str) MSVCRT__fdopen @ cdecl _fgetchar() MSVCRT__fgetchar @ cdecl _fgetwchar() MSVCRT__fgetwchar @@ -486,7 +486,7 @@ @ cdecl -arch=i386 -ret64 _ftol2() MSVCRT__ftol @ cdecl -arch=i386 -ret64 _ftol2_sse() MSVCRT__ftol #FIXME: SSE variant should be implemented # stub _ftol2_sse_excpt -@ cdecl _fullpath(ptr str long) +@ cdecl _fullpath(ptr str long) MSVCRT__fullpath # stub _fullpath_dbg(ptr str long long str long) @ cdecl _futime(long ptr) @ cdecl _futime32(long ptr) @@ -497,19 +497,19 @@ # stub _fwprintf_s_l(ptr wstr ptr) @ varargs _fwscanf_l(ptr wstr ptr) MSVCRT__fwscanf_l @ varargs _fwscanf_s_l(ptr wstr ptr) MSVCRT__fwscanf_s_l -@ cdecl _gcvt(double long str) -@ cdecl _gcvt_s(ptr long double long) +@ cdecl _gcvt(double long str) MSVCRT__gcvt +@ cdecl _gcvt_s(ptr long double long) MSVCRT__gcvt_s @ cdecl _get_current_locale() MSVCRT__get_current_locale @ cdecl _get_doserrno(ptr) # stub _get_environ(ptr) @ cdecl _get_errno(ptr) # stub _get_fileinfo(ptr) -@ cdecl _get_fmode(ptr) +@ cdecl _get_fmode(ptr) MSVCRT__get_fmode @ cdecl _get_heap_handle() @ cdecl _get_osfhandle(long) MSVCRT__get_osfhandle @ cdecl _get_osplatform(ptr) MSVCRT__get_osplatform # stub _get_osver(ptr) -@ cdecl _get_output_format() +@ cdecl _get_output_format() MSVCRT__get_output_format @ cdecl _get_pgmptr(ptr) @ cdecl _get_sbh_threshold() # stub _get_wenviron(ptr) @@ -550,9 +550,9 @@ @ cdecl _hypot(double double) @ cdecl _hypotf(float float) MSVCRT__hypotf @ cdecl _i64toa(int64 ptr long) ntdll._i64toa -@ cdecl _i64toa_s(int64 ptr long long) _i64toa_s +@ cdecl _i64toa_s(int64 ptr long long) MSVCRT__i64toa_s @ cdecl _i64tow(int64 ptr long) ntdll._i64tow -@ cdecl _i64tow_s(int64 ptr long long) _i64tow_s +@ cdecl _i64tow_s(int64 ptr long long) MSVCRT__i64tow_s @ cdecl _initterm(ptr ptr) @ cdecl _initterm_e(ptr ptr) @ stub -arch=i386 _inp(long) @@ -646,10 +646,10 @@ # stub _iswupper_l(long ptr) # stub _iswxdigit_l(long ptr) @ cdecl _isxdigit_l(long ptr) MSVCRT__isxdigit_l -@ cdecl _itoa(long ptr long) -@ cdecl _itoa_s(long ptr long long) +@ 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) +@ 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 @@ -677,11 +677,11 @@ @ 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) +@ cdecl _ltoa_s(long ptr long long) MSVCRT__ltoa_s @ cdecl _ltow(long ptr long) ntdll._ltow -@ cdecl _ltow_s(long ptr long long) -@ cdecl _makepath(ptr str str str str) -@ cdecl _makepath_s(ptr long str str str str) +@ 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_dbg(long long str long) @ cdecl _matherr(ptr) MSVCRT__matherr @ cdecl _mbbtombc(long) @@ -888,7 +888,7 @@ # stub _scwprintf_l(wstr ptr) # stub _scwprintf_p_l(wstr ptr) @ cdecl _searchenv(str str ptr) MSVCRT__searchenv -@ cdecl _searchenv_s(str str ptr long) +@ cdecl _searchenv_s(str str ptr long) MSVCRT__searchenv_s @ stdcall -arch=i386 _seh_longjmp_unwind4(ptr) @ stdcall -arch=i386 _seh_longjmp_unwind(ptr) @ cdecl _set_SSE2_enable(long) MSVCRT__set_SSE2_enable @@ -897,7 +897,7 @@ @ cdecl _set_errno(long) @ cdecl _set_error_mode(long) # stub _set_fileinfo(long) -@ cdecl _set_fmode(long) +@ cdecl _set_fmode(long) MSVCRT__set_fmode @ cdecl _set_output_format(long) @ cdecl _set_sbh_threshold(long) @ cdecl _seterrormode(long) @@ -937,8 +937,8 @@ @ 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) -@ cdecl _splitpath_s(str ptr long ptr long ptr long ptr long) +@ cdecl _splitpath(str ptr ptr ptr ptr) MSVCRT__splitpath +@ cdecl _splitpath_s(str ptr long ptr long ptr long ptr long) MSVCRT__splitpath_s @ varargs _sprintf_l(ptr str ptr) MSVCRT_sprintf_l @ varargs _sprintf_p_l(ptr long str ptr) MSVCRT_sprintf_p_l @ varargs _sprintf_s_l(ptr long str ptr) MSVCRT_sprintf_s_l @@ -962,8 +962,8 @@ @ cdecl _stricoll_l(str str ptr) MSVCRT__stricoll_l @ cdecl _strlwr(str) MSVCRT__strlwr @ cdecl _strlwr_l(str ptr) -@ cdecl _strlwr_s(ptr long) -@ cdecl _strlwr_s_l(ptr long 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 @@ -986,8 +986,8 @@ # stub _strtoul_l(str ptr long ptr) @ cdecl _strupr(str) MSVCRT__strupr @ cdecl _strupr_l(str ptr) MSVCRT__strupr_l -@ cdecl _strupr_s(str long) -@ cdecl _strupr_s_l(str long ptr) +@ cdecl _strupr_s(str long) MSVCRT__strupr_s +@ cdecl _strupr_s_l(str long ptr) MSVCRT__strupr_s_l # stub _strxfrm_l(ptr str long ptr) @ cdecl _swab(str str long) MSVCRT__swab @ varargs _swprintf(ptr wstr) MSVCRT_swprintf @@ -1019,9 +1019,9 @@ @ 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) +@ cdecl _ultoa_s(long ptr long long) MSVCRT__ultoa_s @ cdecl _ultow(long ptr long) ntdll._ultow -@ cdecl _ultow_s(long ptr long long) +@ cdecl _ultow_s(long ptr long long) MSVCRT__ultow_s @ cdecl _umask(long) MSVCRT__umask # stub _umask_s(long ptr) @ cdecl _ungetch(long) @@ -1088,7 +1088,7 @@ # stub _vwprintf_p_l(wstr ptr ptr) # stub _vwprintf_s_l(wstr ptr ptr) @ cdecl _waccess(wstr long) MSVCRT__waccess -@ cdecl _waccess_s(wstr long) +@ 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 @@ -1100,7 +1100,7 @@ @ cdecl _wcsdup(wstr) MSVCRT__wcsdup # stub _wcsdup_dbg(wstr long str long) @ cdecl _wcserror(long) MSVCRT__wcserror -@ cdecl _wcserror_s(ptr long long) +@ cdecl _wcserror_s(ptr long long) MSVCRT__wcserror_s # stub _wcsftime_l(ptr long wstr ptr ptr) @ cdecl _wcsicmp(wstr wstr) MSVCRT__wcsicmp @ cdecl _wcsicmp_l(wstr wstr ptr) MSVCRT__wcsicmp_l @@ -1131,7 +1131,7 @@ @ cdecl -ret64 _wcstoui64_l(wstr ptr long ptr) MSVCRT__wcstoui64_l @ cdecl _wcstoul_l(wstr ptr long ptr) MSVCRT__wcstoul_l @ cdecl _wcsupr(wstr) ntdll._wcsupr -# stub _wcsupr_l(wstr ptr) +@ 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 # stub _wcsxfrm_l(ptr wstr long ptr) @@ -1167,7 +1167,7 @@ @ 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) +@ cdecl _wfullpath(ptr wstr long) MSVCRT__wfullpath # stub _wfullpath_dbg(ptr wstr long long str long) @ cdecl _wgetcwd(wstr long) MSVCRT__wgetcwd @ cdecl _wgetdcwd(long wstr long) MSVCRT__wgetdcwd @@ -1177,8 +1177,8 @@ @ extern _winminor MSVCRT__winminor # stub _winput_s @ extern _winver MSVCRT__winver -@ cdecl _wmakepath(ptr wstr wstr wstr wstr) -@ cdecl _wmakepath_s(ptr long wstr wstr wstr 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 @@ -1200,7 +1200,7 @@ @ varargs _wscanf_l(wstr ptr) MSVCRT__wscanf_l @ varargs _wscanf_s_l(wstr ptr) MSVCRT__wscanf_s_l @ cdecl _wsearchenv(wstr wstr ptr) MSVCRT__wsearchenv -@ cdecl _wsearchenv_s(wstr wstr ptr long) +@ cdecl _wsearchenv_s(wstr wstr ptr long) MSVCRT__wsearchenv_s @ cdecl _wsetlocale(long wstr) MSVCRT__wsetlocale @ varargs _wsopen(wstr long long) MSVCRT__wsopen @ cdecl _wsopen_s(ptr wstr long long long) MSVCRT__wsopen_s @@ -1212,8 +1212,8 @@ @ 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) -@ cdecl _wsplitpath_s(wstr ptr long ptr long ptr long ptr long) _wsplitpath_s +@ 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 _wstat(wstr ptr) MSVCRT__wstat @ cdecl _wstati64(wstr ptr) MSVCRT__wstati64 @ cdecl _wstat64(wstr ptr) MSVCRT__wstat64 @@ -1229,8 +1229,8 @@ @ cdecl _wtof(wstr) MSVCRT__wtof @ cdecl _wtof_l(wstr ptr) MSVCRT__wtof_l @ cdecl _wtoi(wstr) MSVCRT__wtoi -@ cdecl -ret64 _wtoi64(wstr) -@ cdecl -ret64 _wtoi64_l(wstr ptr) +@ 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 @@ -1372,9 +1372,9 @@ @ 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) +@ cdecl memcpy_s(ptr long ptr long) MSVCRT_memcpy_s @ cdecl memmove(ptr ptr long) MSVCRT_memmove -@ cdecl memmove_s(ptr long ptr long) +@ cdecl memmove_s(ptr long ptr long) MSVCRT_memmove_s @ cdecl memset(ptr long long) MSVCRT_memset @ cdecl mktime(ptr) MSVCRT_mktime @ cdecl modf(double ptr) MSVCRT_modf @@ -1425,14 +1425,14 @@ @ 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) +@ 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) +@ 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 @@ -1504,7 +1504,7 @@ @ cdecl wcsstr(wstr wstr) MSVCRT_wcsstr @ cdecl wcstod(wstr ptr) MSVCRT_wcstod @ cdecl wcstok(wstr wstr) MSVCRT_wcstok -@ cdecl wcstok_s(ptr wstr ptr) +@ cdecl wcstok_s(ptr wstr ptr) MSVCRT_wcstok_s @ cdecl wcstol(wstr ptr long) ntdll.wcstol @ cdecl wcstombs(ptr ptr long) MSVCRT_wcstombs @ cdecl wcstombs_s(ptr ptr long wstr long) MSVCRT_wcstombs_s @@ -1517,25 +1517,3 @@ @ varargs wprintf_s(wstr) MSVCRT_wprintf_s @ varargs wscanf(wstr) MSVCRT_wscanf @ varargs wscanf_s(wstr) MSVCRT_wscanf_s - -# Functions not exported in native dll: -@ cdecl ___mb_cur_max_l_func(ptr) -@ cdecl -arch=i386 __control87_2(long long ptr ptr) -@ cdecl _configthreadlocale(long) -@ cdecl _dupenv_s(ptr ptr str) -@ cdecl _get_invalid_parameter_handler() -@ cdecl _set_abort_behavior(long long) MSVCRT__set_abort_behavior -@ cdecl _set_invalid_parameter_handler(ptr) -@ cdecl _set_purecall_handler(ptr) -@ cdecl _set_security_error_handler(ptr) -@ cdecl __security_error_handler(long ptr) -@ cdecl -arch=i386 _statusfp2(ptr ptr) -@ cdecl _wdupenv_s(ptr ptr wstr) -@ cdecl _get_printf_count_output() MSVCRT__get_printf_count_output -@ cdecl _set_printf_count_output(long) MSVCRT__set_printf_count_output -@ cdecl _getptd() -@ cdecl fread_s(ptr long long long ptr) -@ cdecl _fstat32(long ptr) -@ cdecl _fstat64i32(long ptr) -@ cdecl _is_exception_typeof(ptr ptr) -@ cdecl -arch=i386 __libm_sse2_sqrt_precise() diff -Nru wine1.7-1.7.14/dlls/msvcrt/printf.h wine1.7-1.7.18/dlls/msvcrt/printf.h --- wine1.7-1.7.14/dlls/msvcrt/printf.h 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msvcrt/printf.h 2014-05-02 18:15:48.000000000 +0000 @@ -265,9 +265,11 @@ } i = 0; - if(x==0 && flags->Precision) - buf[i++] = '0'; - else { + if(x == 0) { + flags->Alternate = 0; + if(flags->Precision) + buf[i++] = '0'; + } else { while(x != 0) { j = (ULONGLONG)x%base; x = (ULONGLONG)x/base; @@ -307,7 +309,7 @@ if(tmp[0] && (tmp[1]=='+' || tmp[1]=='-') && isdigit(tmp[2]) && isdigit(tmp[3])) { - BOOL two_digit_exp = (_get_output_format() == MSVCRT__TWO_DIGIT_EXPONENT); + BOOL two_digit_exp = (MSVCRT__get_output_format() == MSVCRT__TWO_DIGIT_EXPONENT); tmp += 2; if(isdigit(tmp[2])) { diff -Nru wine1.7-1.7.14/dlls/msvcrt/process.c wine1.7-1.7.18/dlls/msvcrt/process.c --- wine1.7-1.7.14/dlls/msvcrt/process.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msvcrt/process.c 2014-05-02 18:15:48.000000000 +0000 @@ -1323,3 +1323,11 @@ { return GetCurrentProcessId(); } + +/********************************************************************* + * __crtTerminateProcess (MSVCR110.@) + */ +int CDECL MSVCR110__crtTerminateProcess(UINT exit_code) +{ + return TerminateProcess(GetCurrentProcess(), exit_code); +} diff -Nru wine1.7-1.7.14/dlls/msvcrt/string.c wine1.7-1.7.18/dlls/msvcrt/string.c --- wine1.7-1.7.14/dlls/msvcrt/string.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msvcrt/string.c 2014-05-02 18:15:48.000000000 +0000 @@ -54,7 +54,7 @@ /********************************************************************* * _strlwr_s_l (MSVCRT.@) */ -int CDECL _strlwr_s_l(char *str, MSVCRT_size_t len, MSVCRT__locale_t locale) +int CDECL MSVCRT__strlwr_s_l(char *str, MSVCRT_size_t len, MSVCRT__locale_t locale) { char *ptr = str; @@ -89,9 +89,9 @@ /********************************************************************* * _strlwr_s (MSVCRT.@) */ -int CDECL _strlwr_s(char *str, MSVCRT_size_t len) +int CDECL MSVCRT__strlwr_s(char *str, MSVCRT_size_t len) { - return _strlwr_s_l(str, len, NULL); + return MSVCRT__strlwr_s_l(str, len, NULL); } /********************************************************************* @@ -99,7 +99,7 @@ */ char* CDECL _strlwr_l(char *str, MSVCRT__locale_t locale) { - _strlwr_s_l(str, -1, locale); + MSVCRT__strlwr_s_l(str, -1, locale); return str; } @@ -108,14 +108,14 @@ */ char* CDECL MSVCRT__strlwr(char *str) { - _strlwr_s_l(str, -1, NULL); + MSVCRT__strlwr_s_l(str, -1, NULL); return str; } /********************************************************************* * _strupr_s_l (MSVCRT.@) */ -int CDECL _strupr_s_l(char *str, MSVCRT_size_t len, MSVCRT__locale_t locale) +int CDECL MSVCRT__strupr_s_l(char *str, MSVCRT_size_t len, MSVCRT__locale_t locale) { char *ptr = str; @@ -150,9 +150,9 @@ /********************************************************************* * _strupr_s (MSVCRT.@) */ -int CDECL _strupr_s(char *str, MSVCRT_size_t len) +int CDECL MSVCRT__strupr_s(char *str, MSVCRT_size_t len) { - return _strupr_s_l(str, len, NULL); + return MSVCRT__strupr_s_l(str, len, NULL); } /********************************************************************* @@ -160,7 +160,7 @@ */ char* CDECL MSVCRT__strupr_l(char *str, MSVCRT__locale_t locale) { - _strupr_s_l(str, -1, locale); + MSVCRT__strupr_s_l(str, -1, locale); return str; } @@ -169,7 +169,7 @@ */ char* CDECL MSVCRT__strupr(char *str) { - _strupr_s_l(str, -1, NULL); + MSVCRT__strupr_s_l(str, -1, NULL); return str; } @@ -455,6 +455,14 @@ } /********************************************************************* + * _atoflt (MSVCR100.@) + */ +int CDECL MSVCRT__atoflt(MSVCRT__CRT_FLOAT *value, char *str) +{ + return MSVCRT__atoflt_l(value, str, NULL); +} + +/********************************************************************* * _atodbl_l (MSVCRT.@) */ int CDECL MSVCRT__atodbl_l(MSVCRT__CRT_DOUBLE *value, char *str, MSVCRT__locale_t locale) @@ -854,6 +862,7 @@ /********************************************************************* * atoi (MSVCRT.@) */ +#if _MSVCR_VER == 0 int __cdecl MSVCRT_atoi(const char *str) { BOOL minus = FALSE; @@ -878,6 +887,12 @@ return minus ? -ret : ret; } +#else +int CDECL MSVCRT_atoi(const char *str) +{ + return MSVCRT__atoi_l(str, NULL); +} +#endif /****************************************************************** * strtol (MSVCRT.@) @@ -1055,7 +1070,7 @@ /********************************************************************* * _ltoa_s (MSVCRT.@) */ -int CDECL _ltoa_s(MSVCRT_long value, char *str, MSVCRT_size_t size, int radix) +int CDECL MSVCRT__ltoa_s(MSVCRT_long value, char *str, MSVCRT_size_t size, int radix) { if (!MSVCRT_CHECK_PMT(str != NULL)) return MSVCRT_EINVAL; if (!MSVCRT_CHECK_PMT(size > 0)) return MSVCRT_EINVAL; @@ -1071,7 +1086,7 @@ /********************************************************************* * _ltow_s (MSVCRT.@) */ -int CDECL _ltow_s(MSVCRT_long value, MSVCRT_wchar_t *str, MSVCRT_size_t size, int radix) +int CDECL MSVCRT__ltow_s(MSVCRT_long value, MSVCRT_wchar_t *str, MSVCRT_size_t size, int radix) { MSVCRT_ulong val; unsigned int digit; @@ -1146,15 +1161,15 @@ /********************************************************************* * _itoa_s (MSVCRT.@) */ -int CDECL _itoa_s(int value, char *str, MSVCRT_size_t size, int radix) +int CDECL MSVCRT__itoa_s(int value, char *str, MSVCRT_size_t size, int radix) { - return _ltoa_s(value, str, size, radix); + return MSVCRT__ltoa_s(value, str, size, radix); } /********************************************************************* * _itoa (MSVCRT.@) */ -char* CDECL _itoa(int value, char *str, int radix) +char* CDECL MSVCRT__itoa(int value, char *str, int radix) { return ltoa_helper(value, str, MSVCRT_SIZE_MAX, radix) ? NULL : str; } @@ -1162,9 +1177,9 @@ /********************************************************************* * _itow_s (MSVCRT.@) */ -int CDECL _itow_s(int value, MSVCRT_wchar_t *str, MSVCRT_size_t size, int radix) +int CDECL MSVCRT__itow_s(int value, MSVCRT_wchar_t *str, MSVCRT_size_t size, int radix) { - return _ltow_s(value, str, size, radix); + return MSVCRT__ltow_s(value, str, size, radix); } /********************************************************************* @@ -1247,7 +1262,7 @@ /********************************************************************* * _ultoa_s (MSVCRT.@) */ -int CDECL _ultoa_s(MSVCRT_ulong value, char *str, MSVCRT_size_t size, int radix) +int CDECL MSVCRT__ultoa_s(MSVCRT_ulong value, char *str, MSVCRT_size_t size, int radix) { MSVCRT_ulong digit; char buffer[33], *pos; @@ -1301,7 +1316,7 @@ /********************************************************************* * _ultow_s (MSVCRT.@) */ -int CDECL _ultow_s(MSVCRT_ulong value, MSVCRT_wchar_t *str, MSVCRT_size_t size, int radix) +int CDECL MSVCRT__ultow_s(MSVCRT_ulong value, MSVCRT_wchar_t *str, MSVCRT_size_t size, int radix) { MSVCRT_ulong digit; WCHAR buffer[33], *pos; @@ -1355,7 +1370,7 @@ /********************************************************************* * _i64toa_s (MSVCRT.@) */ -int CDECL _i64toa_s(__int64 value, char *str, MSVCRT_size_t size, int radix) +int CDECL MSVCRT__i64toa_s(__int64 value, char *str, MSVCRT_size_t size, int radix) { unsigned __int64 val; unsigned int digit; @@ -1430,7 +1445,7 @@ /********************************************************************* * _i64tow_s (MSVCRT.@) */ -int CDECL _i64tow_s(__int64 value, MSVCRT_wchar_t *str, MSVCRT_size_t size, int radix) +int CDECL MSVCRT__i64tow_s(__int64 value, MSVCRT_wchar_t *str, MSVCRT_size_t size, int radix) { unsigned __int64 val; unsigned int digit; diff -Nru wine1.7-1.7.14/dlls/msvcrt/tests/dir.c wine1.7-1.7.18/dlls/msvcrt/tests/dir.c --- wine1.7-1.7.14/dlls/msvcrt/tests/dir.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msvcrt/tests/dir.c 2014-05-02 18:15:48.000000000 +0000 @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -390,6 +391,31 @@ RemoveDirectoryA(level1); } +static void test_splitpath(void) +{ + const char* path = "c:\\\x83\x5c\x83\x74\x83\x67.bin"; + char drive[3], dir[MAX_PATH], fname[MAX_PATH], ext[MAX_PATH]; + int prev_cp = _getmbcp(); + + /* SBCS codepage */ + _setmbcp(1252); + _splitpath(path, drive, dir, fname, ext); + ok(!strcmp(drive, "c:"), "got %s\n", drive); + ok(!strcmp(dir, "\\\x83\x5c"), "got %s\n", dir); + ok(!strcmp(fname, "\x83\x74\x83\x67"), "got %s\n", fname); + ok(!strcmp(ext, ".bin"), "got %s\n", ext); + + /* MBCS (Japanese) codepage */ + _setmbcp(932); + _splitpath(path, drive, dir, fname, ext); + ok(!strcmp(drive, "c:"), "got %s\n", drive); + ok(!strcmp(dir, "\\"), "got %s\n", dir); + ok(!strcmp(fname, "\x83\x5c\x83\x74\x83\x67"), "got %s\n", fname); + ok(!strcmp(ext, ".bin"), "got %s\n", ext); + + _setmbcp(prev_cp); +} + START_TEST(dir) { init(); @@ -397,4 +423,5 @@ test_fullpath(); test_makepath(); test_makepath_s(); + test_splitpath(); } diff -Nru wine1.7-1.7.14/dlls/msvcrt/tests/locale.c wine1.7-1.7.18/dlls/msvcrt/tests/locale.c --- wine1.7-1.7.14/dlls/msvcrt/tests/locale.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msvcrt/tests/locale.c 2014-05-02 18:15:48.000000000 +0000 @@ -49,9 +49,6 @@ ret = setlocale(20, "C"); ok(ret == NULL, "ret = %s\n", ret); - ret = setlocale(LC_ALL, ""); - ok(ret != NULL, "ret == NULL\n"); - ret = setlocale(LC_ALL, "C"); ok(!strcmp(ret, "C"), "ret = %s\n", ret); @@ -785,10 +782,8 @@ static void test___mb_cur_max_func(void) { int mb_cur_max; - CPINFO cp; setlocale(LC_ALL, "C"); - GetCPInfo(CP_ACP, &cp); /* for newer Windows */ if(!p___mb_cur_max_func) @@ -812,13 +807,7 @@ win_skip("Skipping __p___mb_cur_max tests\n"); else { mb_cur_max = *p__p___mb_cur_max(); - if (cp.MaxCharSize != 1) { - todo_wine ok(mb_cur_max == cp.MaxCharSize, "mb_cur_max = %d, expected %d\n", - mb_cur_max, cp.MaxCharSize); - } - else { - ok(mb_cur_max == 1, "mb_cur_max = %d, expected 1\n", mb_cur_max); - } + ok(mb_cur_max == 1, "mb_cur_max = %d, expected 1\n", mb_cur_max); /* some old Windows don't set chinese */ if (!setlocale(LC_ALL, "chinese")) diff -Nru wine1.7-1.7.14/dlls/msvcrt/tests/misc.c wine1.7-1.7.18/dlls/msvcrt/tests/misc.c --- wine1.7-1.7.14/dlls/msvcrt/tests/misc.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msvcrt/tests/misc.c 2014-05-02 18:15:48.000000000 +0000 @@ -30,6 +30,8 @@ static int (__cdecl *p_get_errno)(int *); static int (__cdecl *p_set_doserrno)(int); static int (__cdecl *p_set_errno)(int); +static void (__cdecl *p__invalid_parameter)(const wchar_t*, + const wchar_t*, const wchar_t*, unsigned int, uintptr_t); static void init(void) { @@ -42,6 +44,7 @@ p_get_errno = (void *)GetProcAddress(hmod, "_get_errno"); p_set_doserrno = (void *)GetProcAddress(hmod, "_set_doserrno"); p_set_errno = (void *)GetProcAddress(hmod, "_set_errno"); + p__invalid_parameter = (void *)GetProcAddress(hmod, "_invalid_parameter"); } static void test_rand_s(void) @@ -324,7 +327,7 @@ char buf[1024]; int ret; - sprintf(buf, "%s misc popen", name); + sprintf(buf, "\"%s\" misc popen", name); pipe = _popen(buf, "r"); ok(pipe != NULL, "_popen failed with error: %d\n", errno); @@ -341,6 +344,16 @@ ok(errno == EBADF, "errno = %d\n", errno); } +static void test__invalid_parameter(void) +{ + if(!p__invalid_parameter) { + win_skip("_invalid_parameter not available\n"); + return; + } + + p__invalid_parameter(NULL, NULL, NULL, 0, 0); +} + START_TEST(misc) { int arg_c; @@ -366,4 +379,5 @@ test__set_doserrno(); test__set_errno(); test__popen(arg_v[0]); + test__invalid_parameter(); } diff -Nru wine1.7-1.7.14/dlls/msvcrt/tests/printf.c wine1.7-1.7.18/dlls/msvcrt/tests/printf.c --- wine1.7-1.7.14/dlls/msvcrt/tests/printf.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msvcrt/tests/printf.c 2014-05-02 18:15:48.000000000 +0000 @@ -329,18 +329,52 @@ format = "%#012x"; r = sprintf(buffer,format,1); ok(!strcmp(buffer,"0x0000000001"),"Hexadecimal zero-padded \"%s\"\n",buffer); + ok( r==12, "return count wrong\n"); + + r = sprintf(buffer,format,0); + ok(!strcmp(buffer,"000000000000"),"Hexadecimal zero-padded \"%s\"\n",buffer); + ok( r==12, "return count wrong\n"); format = "%#04.8x"; r = sprintf(buffer,format,1); ok(!strcmp(buffer,"0x00000001"), "Hexadecimal zero-padded precision \"%s\"\n",buffer); + ok( r==10, "return count wrong\n"); + + r = sprintf(buffer,format,0); + ok(!strcmp(buffer,"00000000"), "Hexadecimal zero-padded precision \"%s\"\n",buffer); + ok( r==8, "return count wrong\n"); format = "%#-08.2x"; r = sprintf(buffer,format,1); ok(!strcmp(buffer,"0x01 "), "Hexadecimal zero-padded not left-adjusted \"%s\"\n",buffer); + ok( r==8, "return count wrong\n"); + + r = sprintf(buffer,format,0); + ok(!strcmp(buffer,"00 "), "Hexadecimal zero-padded not left-adjusted \"%s\"\n",buffer); + ok( r==8, "return count wrong\n"); + + format = "%#.0x"; + r = sprintf(buffer,format,1); + ok(!strcmp(buffer,"0x1"), "Hexadecimal zero-padded zero-precision \"%s\"\n",buffer); + ok( r==3, "return count wrong\n"); + + r = sprintf(buffer,format,0); + ok(!strcmp(buffer,""), "Hexadecimal zero-padded zero-precision \"%s\"\n",buffer); + ok( r==0, "return count wrong\n"); format = "%#08o"; r = sprintf(buffer,format,1); ok(!strcmp(buffer,"00000001"), "Octal zero-padded \"%s\"\n",buffer); + ok( r==8, "return count wrong\n"); + + format = "%#o"; + r = sprintf(buffer,format,1); + ok(!strcmp(buffer,"01"), "Octal zero-padded \"%s\"\n",buffer); + ok( r==2, "return count wrong\n"); + + r = sprintf(buffer,format,0); + ok(!strcmp(buffer,"0"), "Octal zero-padded \"%s\"\n",buffer); + ok( r==1, "return count wrong\n"); if (sizeof(void *) == 8) { diff -Nru wine1.7-1.7.14/dlls/msvcrt/tests/string.c wine1.7-1.7.18/dlls/msvcrt/tests/string.c --- wine1.7-1.7.14/dlls/msvcrt/tests/string.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msvcrt/tests/string.c 2014-05-02 18:15:48.000000000 +0000 @@ -49,13 +49,6 @@ return buf[nr]; } -static void __cdecl test_invalid_parameter_handler(const wchar_t *expression, - const wchar_t *function, const wchar_t *file, - unsigned line, uintptr_t arg) -{ - /* we just ignore handler calls */ -} - #define expect_eq(expr, value, type, format) { type ret = (expr); ok((value) == ret, #expr " expected " format " got " format "\n", value, ret); } #define expect_bin(buf, value, len) { ok(memcmp((buf), value, len) == 0, "Binary buffer mismatch - expected %s, got %s\n", buf_to_string((unsigned char *)value, len, 1), buf_to_string((buf), len, 0)); } @@ -86,7 +79,6 @@ static errno_t (__cdecl *p_ultoa_s)(__msvcrt_ulong,char*,size_t,int); static int *p__mb_cur_max; static unsigned char *p_mbctype; -static _invalid_parameter_handler (__cdecl *p_set_invalid_parameter_handler)(_invalid_parameter_handler); static int (__cdecl *p_wcslwr_s)(wchar_t*,size_t); static errno_t (__cdecl *p_mbsupr_s)(unsigned char *str, size_t numberOfElements); static errno_t (__cdecl *p_mbslwr_s)(unsigned char *str, size_t numberOfElements); @@ -500,7 +492,7 @@ if(!pstrcpy_s) { - skip("strcpy_s not found\n"); + win_skip("strcpy_s not found\n"); return; } @@ -561,14 +553,10 @@ static const char big[] = {'a','t','o','o','l','o','n','g','s','t','r','i','n','g',0}; int ret; if (!p_memcpy_s) { - skip("memcpy_s not found\n"); + win_skip("memcpy_s not found\n"); return; } - if (p_set_invalid_parameter_handler) - ok(p_set_invalid_parameter_handler(test_invalid_parameter_handler) == NULL, - "Invalid parameter handler was already set\n"); - /* Normal */ memset(dest, 'X', sizeof(dest)); ret = p_memcpy_s(dest, NUMELMS(dest), tiny, NUMELMS(tiny)); @@ -612,10 +600,6 @@ ok(ret == EINVAL, "Copying a NULL buffer into a destination of size 0 returned %d, expected EINVAL\n", ret); ok(errno == EINVAL, "errno is %d, expected EINVAL\n", errno); okchars(dest, 'X', 'X', 'X', 'X', 'X', 'X', 'X', 'X'); - - if (p_set_invalid_parameter_handler) - ok(p_set_invalid_parameter_handler(NULL) == test_invalid_parameter_handler, - "Cannot reset invalid parameter handler\n"); } static void test_memmove_s(void) @@ -625,14 +609,10 @@ static const char big[] = {'a','t','o','o','l','o','n','g','s','t','r','i','n','g',0}; int ret; if (!p_memmove_s) { - skip("memmove_s not found\n"); + win_skip("memmove_s not found\n"); return; } - if (p_set_invalid_parameter_handler) - ok(p_set_invalid_parameter_handler(test_invalid_parameter_handler) == NULL, - "Invalid parameter handler was already set\n"); - /* Normal */ memset(dest, 'X', sizeof(dest)); ret = p_memmove_s(dest, NUMELMS(dest), tiny, NUMELMS(tiny)); @@ -682,10 +662,6 @@ ok(ret == EINVAL, "Moving a NULL buffer into a destination of size 0 returned %d, expected EINVAL\n", ret); ok(errno == EINVAL, "errno is %d, expected EINVAL\n", errno); okchars(dest, 'X', 'X', 'X', 'X', 'X', 'X', 'X', 'X'); - - if (p_set_invalid_parameter_handler) - ok(p_set_invalid_parameter_handler(NULL) == test_invalid_parameter_handler, - "Cannot reset invalid parameter handler\n"); } static void test_strcat_s(void) @@ -696,7 +672,7 @@ if(!pstrcat_s) { - skip("strcat_s not found\n"); + win_skip("strcat_s not found\n"); return; } @@ -760,7 +736,7 @@ if(!p_mbsnbcpy_s) { - skip("_mbsnbcpy_s not found\n"); + win_skip("_mbsnbcpy_s not found\n"); return; } @@ -811,10 +787,6 @@ return; } - if (p_set_invalid_parameter_handler) - ok(p_set_invalid_parameter_handler(test_invalid_parameter_handler) == NULL, - "Invalid parameter handler was already set\n"); - /* Test NULL Dest */ errno = EBADF; ret = p_wcscpy_s(NULL, 18, szLongText); @@ -856,10 +828,6 @@ if(!p_wcsncpy_s) { win_skip("wcsncpy_s not found\n"); - - if (p_set_invalid_parameter_handler) - ok(p_set_invalid_parameter_handler(NULL) == test_invalid_parameter_handler, - "Cannot reset invalid parameter handler\n"); return; } @@ -905,10 +873,6 @@ ok(ret == STRUNCATE, "expected ERROR_SUCCESS got %d\n", ret); ok(szDestShort[0]=='1' && szDestShort[1]=='1' && szDestShort[2]=='1' && szDestShort[3]=='1', "szDestShort = %s\n", wine_dbgstr_w(szDestShort)); - - if (p_set_invalid_parameter_handler) - ok(p_set_invalid_parameter_handler(NULL) == test_invalid_parameter_handler, - "Cannot reset invalid parameter handler\n"); } static void test__wcsupr_s(void) @@ -1750,16 +1714,10 @@ ok(wOut[2] == 0, "wOut[2] = %x\n", wOut[2]); ok(!pmbstr, "pmbstr != NULL\n"); - if (p_set_invalid_parameter_handler) - ok(p_set_invalid_parameter_handler(test_invalid_parameter_handler) == NULL, - "Invalid parameter handler was already set\n"); errno = EBADF; ret = p_mbsrtowcs(wOut, NULL, 6, &state); ok(ret == -1, "mbsrtowcs did not return -1\n"); ok(errno == EINVAL, "Expected errno to be EINVAL, got %d\n", errno); - if (p_set_invalid_parameter_handler) - ok(p_set_invalid_parameter_handler(NULL) == test_invalid_parameter_handler, - "Cannot reset invalid parameter handler\n"); setlocale(LC_ALL, "C"); } @@ -1810,10 +1768,6 @@ return; } - if (p_set_invalid_parameter_handler) - ok(p_set_invalid_parameter_handler(test_invalid_parameter_handler) == NULL, - "Invalid parameter handler was already set\n"); - errno = EBADF; ret = p_itoa_s(0, NULL, 0, 0); ok(ret == EINVAL, "Expected _itoa_s to return EINVAL, got %d\n", ret); @@ -1897,10 +1851,6 @@ itoa(100, buffer, 100); ok(!strcmp(buffer, "10"), "Expected output buffer string to be \"10\", got \"%s\"\n", buffer); - - if (p_set_invalid_parameter_handler) - ok(p_set_invalid_parameter_handler(NULL) == test_invalid_parameter_handler, - "Cannot reset invalid parameter handler\n"); } static void test__strlwr_s(void) @@ -1973,10 +1923,6 @@ return; } - if (p_set_invalid_parameter_handler) - ok(p_set_invalid_parameter_handler(test_invalid_parameter_handler) == NULL, - "Invalid parameter handler was already set\n"); - memcpy(src, abcW, sizeof(abcW)); dst[0] = 0; ret = p_wcsncat_s(NULL, 4, src, 4); @@ -2001,10 +1947,6 @@ dst[3] = 'd'; ret = p_wcsncat_s(dst, 4, src, 4); ok(ret == EINVAL, "err = %d\n", ret); - - if (p_set_invalid_parameter_handler) - ok(p_set_invalid_parameter_handler(NULL) == test_invalid_parameter_handler, - "Cannot reset invalid parameter handler\n"); } static void test__mbsnbcat_s(void) @@ -2419,29 +2361,59 @@ static void test_tolower(void) { - int ret; + char ch, lch; + int ret, len; + /* test C locale when locale was never changed */ ret = p_tolower(0x41); ok(ret == 0x61, "ret = %x\n", ret); ret = p_tolower(0xF4); ok(ret == 0xF4, "ret = %x\n", ret); + errno = 0xdeadbeef; ret = p_tolower((char)0xF4); - ok(ret==0xF4/*Vista+*/ || ret==(char)0xF4, "ret = %x\n", ret); + todo_wine ok(ret == (char)0xF4, "ret = %x\n", ret); + todo_wine ok(errno == 0xdeadbeef, "errno = %d\n", errno); - /* is it using different locale (CP_ACP) for negative values?? */ - /* current implementation matches msvcr90 behaviour */ + errno = 0xdeadbeef; ret = p_tolower((char)0xD0); - todo_wine ok(ret==0xF0/*Vista+*/ || ret==(char)0xD0, "ret = %x\n", ret); - - ret = p_tolower(0xD0); - ok(ret == 0xD0, "ret = %x\n", ret); + todo_wine ok(ret == (char)0xD0, "ret = %x\n", ret); + todo_wine ok(errno == 0xdeadbeef, "errno = %d\n", errno); + /* test C locale after setting locale */ if(!setlocale(LC_ALL, "us")) { win_skip("skipping tolower tests that depends on locale\n"); return; } + setlocale(LC_ALL, "C"); + + ch = 0xF4; + errno = 0xdeadbeef; + ret = p_tolower(ch); + len = LCMapStringA(0, LCMAP_LOWERCASE, &ch, 1, &lch, 1); + if(len) + ok(ret==(unsigned char)lch || broken(ret==ch)/*WinXP-*/, "ret = %x\n", ret); + else + ok(ret == ch, "ret = %x\n", ret); + if(!len || ret==(unsigned char)lch) + ok(errno == EILSEQ, "errno = %d\n", errno); + + ch = 0xD0; + errno = 0xdeadbeef; + ret = p_tolower(ch); + len = LCMapStringA(0, LCMAP_LOWERCASE, &ch, 1, &lch, 1); + if(len) + ok(ret==(unsigned char)lch || broken(ret==ch)/*WinXP-*/, "ret = %x\n", ret); + else + ok(ret == ch, "ret = %x\n", ret); + if(!len || ret==(unsigned char)lch) + ok(errno == EILSEQ, "errno = %d\n", errno); + + ret = p_tolower(0xD0); + ok(ret == 0xD0, "ret = %x\n", ret); + + ok(setlocale(LC_ALL, "us") != NULL, "setlocale failed\n"); ret = p_tolower((char)0xD0); ok(ret == 0xF0, "ret = %x\n", ret); @@ -2676,7 +2648,6 @@ p_itoa_s = (void *)GetProcAddress(hMsvcrt, "_itoa_s"); p_strlwr_s = (void *)GetProcAddress(hMsvcrt, "_strlwr_s"); p_ultoa_s = (void *)GetProcAddress(hMsvcrt, "_ultoa_s"); - p_set_invalid_parameter_handler = (void *) GetProcAddress(hMsvcrt, "_set_invalid_parameter_handler"); p_wcslwr_s = (void*)GetProcAddress(hMsvcrt, "_wcslwr_s"); p_mbsupr_s = (void*)GetProcAddress(hMsvcrt, "_mbsupr_s"); p_mbslwr_s = (void*)GetProcAddress(hMsvcrt, "_mbslwr_s"); @@ -2696,15 +2667,12 @@ ok(pmemcmp(mem+5,xilstring, nLen) == 0, "Got result %s\n",mem+5); - /* Test _swab function */ + /* run tolower tests first */ + test_tolower(); test_swab(); - - /* Test ismbblead*/ test_mbcp(); - /* test _mbsspn */ test_mbsspn(); test_mbsspnp(); - /* test _strdup */ test_strdup(); test_strcpy_s(); test_memcpy_s(); @@ -2736,7 +2704,6 @@ test__mbslwr_s(); test_wctob(); test_wctomb(); - test_tolower(); test__atodbl(); test__stricmp(); test__wcstoi64(); diff -Nru wine1.7-1.7.14/dlls/msvcrt/thread.c wine1.7-1.7.18/dlls/msvcrt/thread.c --- wine1.7-1.7.14/dlls/msvcrt/thread.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msvcrt/thread.c 2014-05-02 18:15:48.000000000 +0000 @@ -155,7 +155,7 @@ } /********************************************************************* - * _getptd - not exported in native msvcrt + * _getptd (MSVCR80.@) */ thread_data_t* CDECL _getptd(void) { diff -Nru wine1.7-1.7.14/dlls/msvcrt/time.c wine1.7-1.7.18/dlls/msvcrt/time.c --- wine1.7-1.7.14/dlls/msvcrt/time.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msvcrt/time.c 2014-05-02 18:15:48.000000000 +0000 @@ -1467,3 +1467,25 @@ return MSVCRT__wctime32( time ); } #endif + +/********************************************************************* + * _get_timezone (MSVCR100.@) + */ +int CDECL _get_timezone(LONG *timezone) +{ + if(!MSVCRT_CHECK_PMT(timezone != NULL)) return MSVCRT_EINVAL; + + *timezone = MSVCRT___timezone; + return 0; +} + +/********************************************************************* + * _get_daylight (MSVCR100.@) + */ +int CDECL _get_daylight(int *hours) +{ + if(!MSVCRT_CHECK_PMT(hours != NULL)) return MSVCRT_EINVAL; + + *hours = MSVCRT___daylight; + return 0; +} diff -Nru wine1.7-1.7.14/dlls/msvcrt/wcs.c wine1.7-1.7.18/dlls/msvcrt/wcs.c --- wine1.7-1.7.14/dlls/msvcrt/wcs.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msvcrt/wcs.c 2014-05-02 18:15:48.000000000 +0000 @@ -40,13 +40,17 @@ #include "printf.h" #undef PRINTF_WIDE -/* _get_printf_count_output - not exported in native msvcrt */ +/********************************************************************* + * _get_printf_count_output (MSVCR80.@) + */ int CDECL MSVCRT__get_printf_count_output( void ) { return n_format_enabled ? 1 : 0; } -/* _set_printf_count_output - not exported in native msvcrt */ +/********************************************************************* + * _set_printf_count_output (MSVCR80.@) + */ int CDECL MSVCRT__set_printf_count_output( int enable ) { BOOL old = n_format_enabled; @@ -222,6 +226,15 @@ } /****************************************************************** + * _wcsupr_l (MSVCRT.@) + */ +MSVCRT_wchar_t* CDECL MSVCRT__wcsupr_l( MSVCRT_wchar_t *str, MSVCRT__locale_t locale ) +{ + MSVCRT__wcsupr_s_l( str, -1, locale); + return str; +} + +/****************************************************************** * _wcslwr_s (MSVCRT.@) */ int CDECL MSVCRT__wcslwr_s( MSVCRT_wchar_t* str, MSVCRT_size_t n ) @@ -860,6 +873,15 @@ } /********************************************************************* + * _vswprintf_p (MSVCR100.@) + */ +int CDECL MSVCRT__vswprintf_p(MSVCRT_wchar_t *buffer, MSVCRT_size_t length, + const MSVCRT_wchar_t *format, __ms_va_list args) +{ + return MSVCRT_vswprintf_p_l(buffer, length, format, NULL, args); +} + +/********************************************************************* * _vsnwprintf_s_l (MSVCRT.@) */ int CDECL MSVCRT_vsnwprintf_s_l( MSVCRT_wchar_t *str, MSVCRT_size_t sizeOfBuffer, @@ -1088,6 +1110,14 @@ } /********************************************************************* + * _vscwprintf_p (MSVCR100.@) + */ +int CDECL MSVCRT__vscwprintf_p(const MSVCRT_wchar_t *format, __ms_va_list args) +{ + return MSVCRT_vswprintf_p_l(NULL, INT_MAX, format, NULL, args); +} + +/********************************************************************* * vswprintf_s (MSVCRT.@) */ int CDECL MSVCRT_vswprintf_s(MSVCRT_wchar_t* str, MSVCRT_size_t numberOfElements, @@ -1161,6 +1191,21 @@ } /********************************************************************* + * _sprintf_p (MSVCR100.@) + */ +int CDECL MSVCRT__sprintf_p(char *buffer, MSVCRT_size_t length, const char *format, ...) +{ + __ms_va_list valist; + int r; + + __ms_va_start(valist, format); + r = MSVCRT_vsprintf_p_l(buffer, length, format, NULL, valist); + __ms_va_end(valist); + + return r; +} + +/********************************************************************* * _swprintf_p_l (MSVCRT.@) */ int CDECL MSVCRT_swprintf_p_l(MSVCRT_wchar_t *buffer, MSVCRT_size_t length, @@ -1219,7 +1264,7 @@ /********************************************************************* * wcstok_s (MSVCRT.@) */ -MSVCRT_wchar_t * CDECL wcstok_s( MSVCRT_wchar_t *str, const MSVCRT_wchar_t *delim, +MSVCRT_wchar_t * CDECL MSVCRT_wcstok_s( MSVCRT_wchar_t *str, const MSVCRT_wchar_t *delim, MSVCRT_wchar_t **next_token ) { MSVCRT_wchar_t *ret; @@ -1244,7 +1289,7 @@ */ MSVCRT_wchar_t * CDECL MSVCRT_wcstok( MSVCRT_wchar_t *str, const MSVCRT_wchar_t *delim ) { - return wcstok_s(str, delim, &msvcrt_get_thread_data()->wcstok_next); + return MSVCRT_wcstok_s(str, delim, &msvcrt_get_thread_data()->wcstok_next); } /********************************************************************* @@ -1946,7 +1991,7 @@ /********************************************************************* * _wtoi64_l (MSVCRT.@) */ -__int64 CDECL _wtoi64_l(const MSVCRT_wchar_t *str, MSVCRT__locale_t locale) +__int64 CDECL MSVCRT__wtoi64_l(const MSVCRT_wchar_t *str, MSVCRT__locale_t locale) { ULONGLONG RunningTotal = 0; BOOL bMinus = FALSE; @@ -1973,9 +2018,9 @@ /********************************************************************* * _wtoi64 (MSVCRT.@) */ -__int64 CDECL _wtoi64(const MSVCRT_wchar_t *str) +__int64 CDECL MSVCRT__wtoi64(const MSVCRT_wchar_t *str) { - return _wtoi64_l(str, NULL); + return MSVCRT__wtoi64_l(str, NULL); } /********************************************************************* diff -Nru wine1.7-1.7.14/dlls/msvfw32/drawdib.c wine1.7-1.7.18/dlls/msvfw32/drawdib.c --- wine1.7-1.7.14/dlls/msvfw32/drawdib.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msvfw32/drawdib.c 2014-05-02 18:15:48.000000000 +0000 @@ -246,9 +246,18 @@ DWORD dwSize; /* No compression */ TRACE("Not compressed!\n"); - dwSize = lpbi->biSize + num_colours(lpbi)*sizeof(RGBQUAD); - whdd->lpbiOut = HeapAlloc(GetProcessHeap(), 0, dwSize); - memcpy(whdd->lpbiOut, lpbi, dwSize); + if (lpbi->biHeight <= 0) + { + /* we don't draw inverted DIBs */ + TRACE("detected inverted DIB\n"); + ret = FALSE; + } + else + { + dwSize = lpbi->biSize + num_colours(lpbi)*sizeof(RGBQUAD); + whdd->lpbiOut = HeapAlloc(GetProcessHeap(), 0, dwSize); + memcpy(whdd->lpbiOut, lpbi, dwSize); + } } if (ret) @@ -332,6 +341,8 @@ { TRACE("Something changed!\n"); ret = DrawDibBegin(hdd, hdc, dxDst, dyDst, lpbi, dxSrc, dySrc, 0); + if (!ret) + return ret; } #undef CHANGED @@ -344,12 +355,6 @@ if (!(wFlags & DDF_UPDATE)) { - DWORD biSizeImage = lpbi->biSizeImage; - - /* biSizeImage may be set to 0 for BI_RGB (uncompressed) bitmaps */ - if ((lpbi->biCompression == BI_RGB) && (biSizeImage == 0)) - biSizeImage = ((lpbi->biWidth * lpbi->biBitCount + 31) / 32) * 4 * lpbi->biHeight; - if (lpbi->biCompression) { DWORD flags = 0; @@ -363,6 +368,8 @@ } else { + /* BI_RGB: lpbi->biSizeImage isn't reliable */ + DWORD biSizeImage = ((lpbi->biWidth * lpbi->biBitCount + 31) / 32) * 4 * lpbi->biHeight; memcpy(whdd->lpvbits, lpBits, biSizeImage); } } diff -Nru wine1.7-1.7.14/dlls/msvfw32/tests/drawdib.c wine1.7-1.7.18/dlls/msvfw32/tests/drawdib.c --- wine1.7-1.7.14/dlls/msvfw32/tests/drawdib.c 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.18/dlls/msvfw32/tests/drawdib.c 2014-05-02 18:15:48.000000000 +0000 @@ -0,0 +1,179 @@ +/* + * Copyright 2014 Akihiro Sagawa + * + * 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 WIN32_LEAN_AND_MEAN + +#include +#include +#include +#include +#include + +#include "wine/test.h" + +#define WIDTH 16 +#define HEIGHT 12 + +static HCRYPTPROV crypt_prov; + +static inline DWORD get_stride(const BITMAPINFO *bmi) +{ + return ((bmi->bmiHeader.biBitCount * bmi->bmiHeader.biWidth + 31) >> 3) & ~3; +} + +static inline DWORD get_dib_size(const BITMAPINFO *bmi) +{ + return get_stride(bmi) * abs(bmi->bmiHeader.biHeight); +} + +static char *hash_dib(const BITMAPINFO *bmi, const void *bits) +{ + DWORD dib_size = get_dib_size(bmi); + HCRYPTHASH hash; + char *buf; + BYTE hash_buf[20]; + DWORD hash_size = sizeof(hash_buf); + int i; + static const char *hex = "0123456789abcdef"; + + if(!crypt_prov) return NULL; + + if(!CryptCreateHash(crypt_prov, CALG_SHA1, 0, 0, &hash)) return NULL; + + CryptHashData(hash, bits, dib_size, 0); + + CryptGetHashParam(hash, HP_HASHVAL, NULL, &hash_size, 0); + if(hash_size != sizeof(hash_buf)) return NULL; + + CryptGetHashParam(hash, HP_HASHVAL, hash_buf, &hash_size, 0); + CryptDestroyHash(hash); + + buf = HeapAlloc(GetProcessHeap(), 0, hash_size * 2 + 1); + + for(i = 0; i < hash_size; i++) + { + buf[i * 2] = hex[hash_buf[i] >> 4]; + buf[i * 2 + 1] = hex[hash_buf[i] & 0xf]; + } + buf[i * 2] = '\0'; + + return buf; +} + +static void init_bmi(BITMAPINFO *bmi, LONG width, LONG height, DWORD size) +{ + memset(bmi, 0, sizeof(*bmi)); + bmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + bmi->bmiHeader.biWidth = width; + bmi->bmiHeader.biHeight = height; + bmi->bmiHeader.biPlanes = 1; + bmi->bmiHeader.biBitCount = 32; + bmi->bmiHeader.biCompression = BI_RGB; + bmi->bmiHeader.biSizeImage = size; +} + +static void test_DrawDib_sizeimage(void) +{ + const struct { + LONG width, height; + DWORD size; + char hash[41]; + } test_data[] = { + /* [0] correct size */ + { WIDTH, HEIGHT, WIDTH * HEIGHT * sizeof(RGBQUAD), "bc943d5ab024b8b0118d0a80aa283055d39942b8" }, + /* [1] zero size */ + { WIDTH, HEIGHT, 0, "bc943d5ab024b8b0118d0a80aa283055d39942b8" }, + /* error patterns */ + { WIDTH, -HEIGHT, 0, "" }, + { -WIDTH, HEIGHT, 0, "" }, + { -WIDTH, -HEIGHT, 0, "" }, + { 0, 0, 0, "" }, + { 0, HEIGHT, 0, "" }, + { WIDTH, 0, 0, "" }, + /* [8] zero size (to compare [9], [10] ) */ + { WIDTH, HEIGHT/2, 0, "8b75bf6d54a8645380114fe77505ee0699ffffaa" }, + /* [9] insufficient size */ + { WIDTH, HEIGHT/2, sizeof(RGBQUAD), "8b75bf6d54a8645380114fe77505ee0699ffffaa" }, + /* [10] too much size */ + { WIDTH, HEIGHT/2, WIDTH * HEIGHT * sizeof(RGBQUAD), "8b75bf6d54a8645380114fe77505ee0699ffffaa" }, + }; + HDC hdc; + DWORD src_dib_size, dst_dib_size; + BOOL r; + HBITMAP dib; + BITMAPINFO src_info, dst_info; + RGBQUAD *src_bits = NULL, *dst_bits; + HDRAWDIB hdd; + unsigned int i; + + hdc = CreateCompatibleDC(NULL); + + init_bmi(&dst_info, WIDTH, HEIGHT, 0); + dib = CreateDIBSection(NULL, &dst_info, DIB_RGB_COLORS, (void **)&dst_bits, NULL, 0); + dst_dib_size = get_dib_size(&dst_info); + ok(dib != NULL, "CreateDIBSection failed\n"); + SelectObject(hdc, dib); + + init_bmi(&src_info, WIDTH, HEIGHT, 0); + src_dib_size = get_dib_size(&src_info); + src_bits = HeapAlloc(GetProcessHeap(), 0, src_dib_size); + ok(src_bits != NULL, "Can't allocate memory\n"); + memset(src_bits, 0x88, src_dib_size); + + hdd = DrawDibOpen(); + ok(hdd != NULL, "DrawDibOpen failed\n"); + + for (i = 0; i < sizeof(test_data)/sizeof(test_data[0]); i++) { + char *hash; + memset(dst_bits, 0xff, dst_dib_size); + init_bmi(&src_info, test_data[i].width, test_data[i].height, test_data[i].size); + r = DrawDibDraw(hdd, hdc, + 0, 0, -1, -1, &src_info.bmiHeader, src_bits, + 0, 0, test_data[i].width, test_data[i].height, 0); + if (test_data[i].hash[0]) + ok(r, "[%u] DrawDibDraw failed, expected success\n", i); + else + ok(!r, "[%u] DrawDibDraw succeeded, expected failed\n", i); + if (!r || !test_data[i].hash[0]) + continue; + + hash = hash_dib(&dst_info, dst_bits); + if (!hash) { + win_skip("This platform doesn't support SHA-1 hash\n"); + continue; + } + ok(strcmp(hash, test_data[i].hash) == 0, + "[%u] got %s, expected %s\n", + i, hash, test_data[i].hash); + HeapFree(GetProcessHeap(), 0, hash); + } + + r = DrawDibClose(hdd); + ok(r, "DrawDibClose failed\n"); + + HeapFree(GetProcessHeap(), 0, src_bits); + + DeleteDC(hdc); +} + +START_TEST(drawdib) +{ + CryptAcquireContextW(&crypt_prov, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT); + test_DrawDib_sizeimage(); + CryptReleaseContext(crypt_prov, 0); +} diff -Nru wine1.7-1.7.14/dlls/msvfw32/tests/Makefile.in wine1.7-1.7.18/dlls/msvfw32/tests/Makefile.in --- wine1.7-1.7.14/dlls/msvfw32/tests/Makefile.in 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msvfw32/tests/Makefile.in 2014-05-02 18:15:48.000000000 +0000 @@ -1,5 +1,6 @@ TESTDLL = msvfw32.dll -IMPORTS = msvfw32 +IMPORTS = msvfw32 advapi32 gdi32 C_SRCS = \ + drawdib.c \ msvfw.c diff -Nru wine1.7-1.7.14/dlls/msxml3/dispex.c wine1.7-1.7.18/dlls/msxml3/dispex.c --- wine1.7-1.7.14/dlls/msxml3/dispex.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msxml3/dispex.c 2014-05-02 18:15:48.000000000 +0000 @@ -86,20 +86,6 @@ struct list entry; }; -typedef struct { - VARIANT var; - LPWSTR name; -} dynamic_prop_t; - -struct dispex_dynamic_data_t { - DWORD buf_size; - DWORD prop_cnt; - dynamic_prop_t *props; -}; - -#define DISPID_DYNPROP_0 0x50000000 -#define DISPID_DYNPROP_MAX 0x5fffffff - static struct list dispex_data_list = LIST_INIT(dispex_data_list); static ITypeLib *typelib[LibXml_Last]; static ITypeInfo *typeinfos[LAST_tid]; @@ -341,11 +327,6 @@ return This->data->data; } -static inline BOOL is_dynamic_dispid(DISPID id) -{ - return DISPID_DYNPROP_0 <= id && id <= DISPID_DYNPROP_MAX; -} - static inline DispatchEx *impl_from_IDispatchEx(IDispatchEx *iface) { return CONTAINING_RECORD(iface, DispatchEx, IDispatchEx_iface); @@ -461,17 +442,6 @@ min = n+1; } - if(This->dynamic_data) { - unsigned i; - - for(i=0; i < This->dynamic_data->prop_cnt; i++) { - if(!strcmpW(This->dynamic_data->props[i].name, bstrName)) { - *pid = DISPID_DYNPROP_0 + i; - return S_OK; - } - } - } - if(This->data->vtbl && This->data->vtbl->get_dispid) { HRESULT hres; @@ -480,42 +450,6 @@ return hres; } - if(grfdex & fdexNameEnsure) { - dispex_dynamic_data_t *dynamic_data; - - TRACE("creating dynamic prop %s\n", debugstr_w(bstrName)); - - if(This->dynamic_data) { - dynamic_data = This->dynamic_data; - }else { - dynamic_data = This->dynamic_data = heap_alloc_zero(sizeof(dispex_dynamic_data_t)); - if(!dynamic_data) - return E_OUTOFMEMORY; - } - - if(!dynamic_data->buf_size) { - dynamic_data->props = heap_alloc(sizeof(dynamic_prop_t)*4); - if(!dynamic_data->props) - return E_OUTOFMEMORY; - dynamic_data->buf_size = 4; - }else if(dynamic_data->buf_size == dynamic_data->prop_cnt) { - dynamic_prop_t *new_props; - - new_props = heap_realloc(dynamic_data->props, sizeof(dynamic_prop_t)*(dynamic_data->buf_size<<1)); - if(!new_props) - return E_OUTOFMEMORY; - - dynamic_data->props = new_props; - dynamic_data->buf_size <<= 1; - } - - dynamic_data->props[dynamic_data->prop_cnt].name = heap_strdupW(bstrName); - VariantInit(&dynamic_data->props[dynamic_data->prop_cnt].var); - *pid = DISPID_DYNPROP_0 + dynamic_data->prop_cnt++; - - return S_OK; - } - TRACE("not found %s\n", debugstr_w(bstrName)); return DISP_E_UNKNOWNNAME; } @@ -567,28 +501,6 @@ return E_NOTIMPL; } - if(is_dynamic_dispid(id)) { - DWORD idx = id - DISPID_DYNPROP_0; - VARIANT *var; - - if(!This->dynamic_data || This->dynamic_data->prop_cnt <= idx) - return DISP_E_UNKNOWNNAME; - - var = &This->dynamic_data->props[idx].var; - - switch(wFlags) { - case INVOKE_PROPERTYGET: - V_VT(pvarRes) = VT_EMPTY; - return VariantCopy(pvarRes, var); - case INVOKE_PROPERTYPUT: - VariantClear(var); - return VariantCopy(var, pdp->rgvarg); - default: - FIXME("unhandled wFlags %x\n", wFlags); - return E_NOTIMPL; - } - } - data = get_dispex_data(This); if(!data) return E_FAIL; @@ -726,26 +638,9 @@ return TRUE; } -void release_dispex(DispatchEx *This) -{ - dynamic_prop_t *prop; - - if(!This->dynamic_data) - return; - - for(prop = This->dynamic_data->props; prop < This->dynamic_data->props + This->dynamic_data->prop_cnt; prop++) { - VariantClear(&prop->var); - heap_free(prop->name); - } - - heap_free(This->dynamic_data->props); - heap_free(This->dynamic_data); -} - void init_dispex(DispatchEx *dispex, IUnknown *outer, dispex_static_data_t *data) { dispex->IDispatchEx_iface.lpVtbl = &DispatchExVtbl; dispex->outer = outer; dispex->data = data; - dispex->dynamic_data = NULL; } diff -Nru wine1.7-1.7.14/dlls/msxml3/domimpl.c wine1.7-1.7.18/dlls/msxml3/domimpl.c --- wine1.7-1.7.14/dlls/msxml3/domimpl.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msxml3/domimpl.c 2014-05-02 18:15:48.000000000 +0000 @@ -101,10 +101,7 @@ TRACE("(%p)->(%d)\n", This, ref); if ( ref == 0 ) - { - release_dispex(&This->dispex); heap_free( This ); - } return ref; } diff -Nru wine1.7-1.7.14/dlls/msxml3/element.c wine1.7-1.7.18/dlls/msxml3/element.c --- wine1.7-1.7.14/dlls/msxml3/element.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msxml3/element.c 2014-05-02 18:15:48.000000000 +0000 @@ -1284,7 +1284,11 @@ xmlFree(local); if (ns) - return xmlStrEqual(ns->href, xml_value) ? S_OK : E_INVALIDARG; + { + int cmp = xmlStrEqual(ns->href, xml_value); + heap_free(xml_value); + return cmp ? S_OK : E_INVALIDARG; + } } if (!xmlSetNsProp(element, NULL, xml_name, xml_value)) diff -Nru wine1.7-1.7.14/dlls/msxml3/main.c wine1.7-1.7.18/dlls/msxml3/main.c --- wine1.7-1.7.14/dlls/msxml3/main.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msxml3/main.c 2014-05-02 18:15:48.000000000 +0000 @@ -35,6 +35,7 @@ # ifdef HAVE_LIBXSLT_TRANSFORM_H # include # endif +# include # include # include # include @@ -63,9 +64,9 @@ void wineXmlCallbackLog(char const* caller, xmlErrorLevel lvl, char const* msg, va_list ap) { - static const int max_size = 200; enum __wine_debug_class dbcl; - char buff[max_size]; + char buff[200]; + const int max_size = sizeof(buff) / sizeof(buff[0]); int len; switch (lvl) @@ -171,8 +172,10 @@ DECL_FUNCPTR(xsltFreeStylesheet); DECL_FUNCPTR(xsltFreeTransformContext); DECL_FUNCPTR(xsltNewTransformContext); +DECL_FUNCPTR(xsltNextImport); DECL_FUNCPTR(xsltParseStylesheetDoc); DECL_FUNCPTR(xsltQuoteUserParams); +DECL_FUNCPTR(xsltSaveResultTo); # undef DECL_FUNCPTR #endif @@ -195,8 +198,10 @@ LOAD_FUNCPTR(xsltFreeStylesheet, 1); LOAD_FUNCPTR(xsltFreeTransformContext, 1); LOAD_FUNCPTR(xsltNewTransformContext, 1); + LOAD_FUNCPTR(xsltNextImport, 1); LOAD_FUNCPTR(xsltParseStylesheetDoc, 1); LOAD_FUNCPTR(xsltQuoteUserParams, 1); + LOAD_FUNCPTR(xsltSaveResultTo, 1); #undef LOAD_FUNCPTR if (pxsltInit) diff -Nru wine1.7-1.7.14/dlls/msxml3/msxml_private.h wine1.7-1.7.18/dlls/msxml3/msxml_private.h --- wine1.7-1.7.14/dlls/msxml3/msxml_private.h 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msxml3/msxml_private.h 2014-05-02 18:15:48.000000000 +0000 @@ -134,7 +134,6 @@ extern void release_typelib(void) DECLSPEC_HIDDEN; typedef struct dispex_data_t dispex_data_t; -typedef struct dispex_dynamic_data_t dispex_dynamic_data_t; typedef struct { HRESULT (*get_dispid)(IUnknown*,BSTR,DWORD,DISPID*); @@ -154,7 +153,6 @@ IUnknown *outer; dispex_static_data_t *data; - dispex_dynamic_data_t *dynamic_data; } DispatchEx; extern HINSTANCE MSXML_hInstance DECLSPEC_HIDDEN; @@ -181,6 +179,11 @@ return HeapReAlloc(GetProcessHeap(), 0, mem, len); } +static inline void *heap_realloc_zero(void *mem, size_t len) +{ + return HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, mem, len); +} + static inline BOOL heap_free(void *mem) { return HeapFree(GetProcessHeap(), 0, mem); @@ -369,7 +372,7 @@ extern HRESULT node_select_nodes(const xmlnode*,BSTR,IXMLDOMNodeList**) DECLSPEC_HIDDEN; extern HRESULT node_select_singlenode(const xmlnode*,BSTR,IXMLDOMNode**) DECLSPEC_HIDDEN; extern HRESULT node_transform_node(const xmlnode*,IXMLDOMNode*,BSTR*) DECLSPEC_HIDDEN; -extern HRESULT node_transform_node_params(const xmlnode*,IXMLDOMNode*,BSTR*,const struct xslprocessor_params*) DECLSPEC_HIDDEN; +extern HRESULT node_transform_node_params(const xmlnode*,IXMLDOMNode*,BSTR*,IStream*,const struct xslprocessor_params*) DECLSPEC_HIDDEN; extern HRESULT node_create_supporterrorinfo(const tid_t*,void**) DECLSPEC_HIDDEN; extern HRESULT get_domdoc_from_xmldoc(xmlDocPtr xmldoc, IXMLDOMDocument3 **document) DECLSPEC_HIDDEN; diff -Nru wine1.7-1.7.14/dlls/msxml3/mxnamespace.c wine1.7-1.7.18/dlls/msxml3/mxnamespace.c --- wine1.7-1.7.14/dlls/msxml3/mxnamespace.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msxml3/mxnamespace.c 2014-05-02 18:15:48.000000000 +0000 @@ -460,7 +460,6 @@ free_ns_context(ctxt); } - release_dispex(&This->dispex); heap_free( This ); } diff -Nru wine1.7-1.7.14/dlls/msxml3/mxwriter.c wine1.7-1.7.18/dlls/msxml3/mxwriter.c --- wine1.7-1.7.14/dlls/msxml3/mxwriter.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msxml3/mxwriter.c 2014-05-02 18:15:48.000000000 +0000 @@ -779,7 +779,6 @@ SysFreeString(This->encoding); SysFreeString(This->element); - release_dispex(&This->dispex); heap_free(This); } @@ -1202,7 +1201,7 @@ write_node_indent(writer); write_output_buffer(writer->buffer, ltW, 1); - write_output_buffer(writer->buffer, qname, len); + write_output_buffer(writer->buffer, qname ? qname : emptyW, qname ? len : 0); writer_inc_indent(writer); } @@ -2605,7 +2604,6 @@ SysFreeString(This->attr[i].value); } - release_dispex(&This->dispex); heap_free(This->attr); heap_free(This); } diff -Nru wine1.7-1.7.14/dlls/msxml3/node.c wine1.7-1.7.18/dlls/msxml3/node.c --- wine1.7-1.7.14/dlls/msxml3/node.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msxml3/node.c 2014-05-02 18:15:48.000000000 +0000 @@ -35,6 +35,7 @@ # ifdef HAVE_LIBXSLT_TRANSFORM_H # include # endif +# include # include # include # include @@ -65,9 +66,13 @@ MAKE_FUNCPTR(xsltFreeStylesheet); MAKE_FUNCPTR(xsltFreeTransformContext); MAKE_FUNCPTR(xsltNewTransformContext); +MAKE_FUNCPTR(xsltNextImport); MAKE_FUNCPTR(xsltParseStylesheetDoc); MAKE_FUNCPTR(xsltQuoteUserParams); +MAKE_FUNCPTR(xsltSaveResultTo); # undef MAKE_FUNCPTR +#else +WINE_DECLARE_DEBUG_CHANNEL(winediag); #endif static const IID IID_xmlnode = {0x4f2f4ba2,0xb822,0x11df,{0x8b,0x8a,0x68,0x50,0xdf,0xd7,0x20,0x85}}; @@ -624,6 +629,9 @@ VARIANT var; HRESULT hr; + if (!child) + return E_INVALIDARG; + hr = IXMLDOMNode_get_nodeType(child, &type); if(FAILED(hr) || type == NODE_ATTRIBUTE) { if (outChild) *outChild = NULL; @@ -901,6 +909,8 @@ return *ret ? S_OK : E_OUTOFMEMORY; } +#ifdef SONAME_LIBXSLT + /* duplicates xmlBufferWriteQuotedString() logic */ static void xml_write_quotedstring(xmlOutputBufferPtr buf, const xmlChar *string) { @@ -910,7 +920,7 @@ { if (xmlStrchr(string, '\'')) { - xmlOutputBufferWrite(buf, 1, "\""); + xmlOutputBufferWrite(buf, 1, "\""); base = cur = string; while (*cur) @@ -928,13 +938,13 @@ } if (base != cur) xmlOutputBufferWrite(buf, cur-base, (const char*)base); - xmlOutputBufferWrite(buf, 1, "\""); - } + xmlOutputBufferWrite(buf, 1, "\""); + } else { - xmlOutputBufferWrite(buf, 1, "\'"); + xmlOutputBufferWrite(buf, 1, "\'"); xmlOutputBufferWriteString(buf, (const char*)string); - xmlOutputBufferWrite(buf, 1, "\'"); + xmlOutputBufferWrite(buf, 1, "\'"); } } else @@ -945,6 +955,112 @@ } } +static int XMLCALL transform_to_stream_write(void *context, const char *buffer, int len) +{ + DWORD written; + HRESULT hr = IStream_Write((IStream*)context, buffer, len, &written); + return hr == S_OK ? written : -1; +} + +/* Output for method "text" */ +static void transform_write_text(xmlDocPtr result, xsltStylesheetPtr style, xmlOutputBufferPtr output) +{ + xmlNodePtr cur = result->children; + while (cur) + { + if (cur->type == XML_TEXT_NODE) + xmlOutputBufferWriteString(output, (const char*)cur->content); + + /* skip to next node */ + if (cur->children) + { + if ((cur->children->type != XML_ENTITY_DECL) && + (cur->children->type != XML_ENTITY_REF_NODE) && + (cur->children->type != XML_ENTITY_NODE)) + { + cur = cur->children; + continue; + } + } + + if (cur->next) { + cur = cur->next; + continue; + } + + do + { + cur = cur->parent; + if (cur == NULL) + break; + if (cur == (xmlNodePtr) style->doc) { + cur = NULL; + break; + } + if (cur->next) { + cur = cur->next; + break; + } + } while (cur); + } +} + +#undef XSLT_GET_IMPORT_PTR +#define XSLT_GET_IMPORT_PTR(res, style, name) { \ + xsltStylesheetPtr st = style; \ + res = NULL; \ + while (st != NULL) { \ + if (st->name != NULL) { res = st->name; break; } \ + st = pxsltNextImport(st); \ + }} + +#undef XSLT_GET_IMPORT_INT +#define XSLT_GET_IMPORT_INT(res, style, name) { \ + xsltStylesheetPtr st = style; \ + res = -1; \ + while (st != NULL) { \ + if (st->name != -1) { res = st->name; break; } \ + st = pxsltNextImport(st); \ + }} + +static void transform_write_xmldecl(xmlDocPtr result, xsltStylesheetPtr style, BOOL omit_encoding, xmlOutputBufferPtr output) +{ + int omit_xmldecl, standalone; + + XSLT_GET_IMPORT_INT(omit_xmldecl, style, omitXmlDeclaration); + if (omit_xmldecl == 1) return; + + XSLT_GET_IMPORT_INT(standalone, style, standalone); + + xmlOutputBufferWriteString(output, "version) + { + xmlOutputBufferWriteString(output, "\""); + xmlOutputBufferWriteString(output, (const char *)result->version); + xmlOutputBufferWriteString(output, "\""); + } + else + xmlOutputBufferWriteString(output, "\"1.0\""); + + if (!omit_encoding) + { + const xmlChar *encoding; + + /* default encoding is UTF-16 */ + XSLT_GET_IMPORT_PTR(encoding, style, encoding); + xmlOutputBufferWriteString(output, " encoding="); + xmlOutputBufferWriteString(output, "\""); + xmlOutputBufferWriteString(output, encoding ? (const char *)encoding : "UTF-16"); + xmlOutputBufferWriteString(output, "\""); + } + + /* standalone attribute */ + if (standalone != -1) + xmlOutputBufferWriteString(output, standalone == 0 ? " standalone=\"no\"" : " standalone=\"yes\""); + + xmlOutputBufferWriteString(output, "?>"); +} + static void htmldtd_dumpcontent(xmlOutputBufferPtr buf, xmlDocPtr doc) { xmlDtdPtr cur = doc->intSubset; @@ -959,7 +1075,7 @@ { xmlOutputBufferWriteString(buf, " "); xml_write_quotedstring(buf, cur->SystemID); - } + } } else if (cur->SystemID) { @@ -969,7 +1085,8 @@ xmlOutputBufferWriteString(buf, ">\n"); } -static void htmldoc_dumpcontent(xmlOutputBufferPtr buf, xmlDocPtr doc) +/* Duplicates htmlDocContentDumpFormatOutput() the way we need it - doesn't add trailing newline. */ +static void htmldoc_dumpcontent(xmlOutputBufferPtr buf, xmlDocPtr doc, const char *encoding, int format) { xmlElementType type; @@ -978,34 +1095,155 @@ doc->type = XML_HTML_DOCUMENT_NODE; if (doc->intSubset) htmldtd_dumpcontent(buf, doc); - if (doc->children) - { + if (doc->children) { xmlNodePtr cur = doc->children; - - while (cur) - { - htmlNodeDumpFormatOutput(buf, doc, cur, NULL, 1); + while (cur) { + htmlNodeDumpFormatOutput(buf, doc, cur, encoding, format); cur = cur->next; } - } doc->type = type; } -static const xmlChar *get_output_buffer_content(xmlOutputBufferPtr output) +static inline BOOL transform_is_empty_resultdoc(xmlDocPtr result) { + return !result->children || ((result->children->type == XML_DTD_NODE) && !result->children->next); +} + +static inline BOOL transform_is_valid_method(xsltStylesheetPtr style) +{ + return !style->methodURI || !(style->method && xmlStrEqual(style->method, (const xmlChar *)"xhtml")); +} + +/* Helper to write transformation result to specified output buffer. */ +static HRESULT node_transform_write(xsltStylesheetPtr style, xmlDocPtr result, BOOL omit_encoding, const char *encoding, xmlOutputBufferPtr output) +{ + const xmlChar *method; + int indent; + + if (!transform_is_valid_method(style)) + { + ERR("unknown output method\n"); + return E_FAIL; + } + + XSLT_GET_IMPORT_PTR(method, style, method) + XSLT_GET_IMPORT_INT(indent, style, indent); + + if (!method && (result->type == XML_HTML_DOCUMENT_NODE)) + method = (const xmlChar *) "html"; + + if (method && xmlStrEqual(method, (const xmlChar *)"html")) + { + htmlSetMetaEncoding(result, (const xmlChar *)encoding); + if (indent == -1) + indent = 1; + htmldoc_dumpcontent(output, result, (const char*)encoding, indent); + } + else if (method && xmlStrEqual(method, (const xmlChar *)"xhtml")) + { + htmlSetMetaEncoding(result, (const xmlChar *) encoding); + htmlDocContentDumpOutput(output, result, encoding); + } + else if (method && xmlStrEqual(method, (const xmlChar *)"text")) + transform_write_text(result, style, output); + else + { + transform_write_xmldecl(result, style, omit_encoding, output); + + if (result->children) + { + xmlNodePtr child = result->children; + + while (child) + { + xmlNodeDumpOutput(output, result, child, 0, indent == 1, encoding); + if (indent && ((child->type == XML_DTD_NODE) || ((child->type == XML_COMMENT_NODE) && child->next))) + xmlOutputBufferWriteString(output, "\r\n"); + child = child->next; + } + } + } + + xmlOutputBufferFlush(output); + return S_OK; +} + +/* For BSTR output is always UTF-16, without 'encoding' attribute */ +static HRESULT node_transform_write_to_bstr(xsltStylesheetPtr style, xmlDocPtr result, BSTR *str) +{ + HRESULT hr = S_OK; + + if (transform_is_empty_resultdoc(result)) + *str = SysAllocStringLen(NULL, 0); + else + { + xmlOutputBufferPtr output = xmlAllocOutputBuffer(xmlFindCharEncodingHandler("UTF-16")); + const xmlChar *content; + size_t len; + + *str = NULL; + if (!output) + return E_OUTOFMEMORY; + + hr = node_transform_write(style, result, TRUE, "UTF-16", output); #ifdef LIBXML2_NEW_BUFFER - return xmlOutputBufferGetContent(output); + content = xmlBufContent(output->conv); + len = xmlBufUse(output->conv); #else - return xmlBufferContent(output->buffer); + content = xmlBufferContent(output->conv); + len = xmlBufferLength(output->conv); #endif + /* UTF-16 encoder places UTF-16 bom, we don't need it for BSTR */ + content += sizeof(WCHAR); + *str = SysAllocStringLen((WCHAR*)content, len/sizeof(WCHAR) - 1); + xmlOutputBufferClose(output); + } + + return *str ? hr : E_OUTOFMEMORY; } +static HRESULT node_transform_write_to_stream(xsltStylesheetPtr style, xmlDocPtr result, IStream *stream) +{ + static const xmlChar *utf16 = (const xmlChar*)"UTF-16"; + xmlOutputBufferPtr output; + const xmlChar *encoding; + HRESULT hr; + + if (transform_is_empty_resultdoc(result)) + { + WARN("empty result document\n"); + return S_OK; + } + + if (style->methodURI && (!style->method || !xmlStrEqual(style->method, (const xmlChar *) "xhtml"))) + { + ERR("unknown output method\n"); + return E_FAIL; + } + + /* default encoding is UTF-16 */ + XSLT_GET_IMPORT_PTR(encoding, style, encoding); + if (!encoding) + encoding = utf16; + + output = xmlOutputBufferCreateIO(transform_to_stream_write, NULL, stream, xmlFindCharEncodingHandler((const char*)encoding)); + if (!output) + return E_OUTOFMEMORY; + + hr = node_transform_write(style, result, FALSE, (const char*)encoding, output); + xmlOutputBufferClose(output); + return hr; +} + +#endif + HRESULT node_transform_node_params(const xmlnode *This, IXMLDOMNode *stylesheet, BSTR *p, - const struct xslprocessor_params *params) + IStream *stream, const struct xslprocessor_params *params) { #ifdef SONAME_LIBXSLT xsltStylesheetPtr xsltSS; + HRESULT hr = S_OK; xmlnode *sheet; if (!libxslt_handle) return E_NOTIMPL; @@ -1054,35 +1292,12 @@ else result = pxsltApplyStylesheet(xsltSS, This->node->doc, NULL); - if(result) + if (result) { - const xmlChar *content; - - if(result->type == XML_HTML_DOCUMENT_NODE) - { - xmlOutputBufferPtr output = xmlAllocOutputBuffer(NULL); - if (output) - { - htmldoc_dumpcontent(output, result->doc); - content = get_output_buffer_content(output); - *p = bstr_from_xmlChar(content); - xmlOutputBufferClose(output); - } - } + if (stream) + hr = node_transform_write_to_stream(xsltSS, result, stream); else - { - xmlBufferPtr buf = xmlBufferCreate(); - if (buf) - { - int size = xmlNodeDump(buf, NULL, (xmlNodePtr)result, 0, 0); - if(size > 0) - { - content = xmlBufferContent(buf); - *p = bstr_from_xmlChar(content); - } - xmlBufferFree(buf); - } - } + hr = node_transform_write_to_bstr(xsltSS, result, p); xmlFreeDoc(result); } /* libxslt "helpfully" frees the XML document the stylesheet was @@ -1093,16 +1308,17 @@ if(!*p) *p = SysAllocStringLen(NULL, 0); - return S_OK; + return hr; #else - FIXME("libxslt headers were not found at compile time\n"); + ERR_(winediag)("libxslt headers were not found at compile time. Expect problems.\n"); + return E_NOTIMPL; #endif } HRESULT node_transform_node(const xmlnode *node, IXMLDOMNode *stylesheet, BSTR *p) { - return node_transform_node_params(node, stylesheet, p, NULL); + return node_transform_node_params(node, stylesheet, p, NULL, NULL); } HRESULT node_select_nodes(const xmlnode *This, BSTR query, IXMLDOMNodeList **nodes) @@ -1198,7 +1414,6 @@ xmlnode_release(This->node); xmldoc_release(This->node->doc); } - release_dispex(&This->dispex); } void init_xmlnode(xmlnode *This, xmlNodePtr node, IXMLDOMNode *node_iface, dispex_static_data_t *dispex_data) diff -Nru wine1.7-1.7.14/dlls/msxml3/nodemap.c wine1.7-1.7.18/dlls/msxml3/nodemap.c --- wine1.7-1.7.14/dlls/msxml3/nodemap.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msxml3/nodemap.c 2014-05-02 18:15:48.000000000 +0000 @@ -142,7 +142,6 @@ { xmldoc_release( This->node->doc ); if (This->enumvariant) IEnumVARIANT_Release(This->enumvariant); - release_dispex(&This->dispex); heap_free( This ); } diff -Nru wine1.7-1.7.14/dlls/msxml3/parseerror.c wine1.7-1.7.18/dlls/msxml3/parseerror.c --- wine1.7-1.7.14/dlls/msxml3/parseerror.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msxml3/parseerror.c 2014-05-02 18:15:48.000000000 +0000 @@ -109,7 +109,6 @@ SysFreeString(This->url); SysFreeString(This->reason); SysFreeString(This->srcText); - release_dispex(&This->dispex); heap_free( This ); } diff -Nru wine1.7-1.7.14/dlls/msxml3/saxreader.c wine1.7-1.7.18/dlls/msxml3/saxreader.c --- wine1.7-1.7.14/dlls/msxml3/saxreader.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msxml3/saxreader.c 2014-05-02 18:15:48.000000000 +0000 @@ -1419,6 +1419,23 @@ return bstr; } +static void free_attribute_values(saxlocator *locator) +{ + int i; + + for (i = 0; i < locator->nb_attributes; i++) + { + SysFreeString(locator->attributes[i].szLocalname); + locator->attributes[i].szLocalname = NULL; + + SysFreeString(locator->attributes[i].szValue); + locator->attributes[i].szValue = NULL; + + SysFreeString(locator->attributes[i].szQName); + locator->attributes[i].szQName = NULL; + } +} + static HRESULT SAXAttributes_populate(saxlocator *locator, int nb_namespaces, const xmlChar **xmlNamespaces, int nb_attributes, const xmlChar **xmlAttributes) @@ -1436,13 +1453,16 @@ locator->nb_attributes = nb_namespaces + nb_attributes; if(locator->nb_attributes > locator->attributesSize) { - attrs = heap_realloc(locator->attributes, sizeof(struct _attributes)*locator->nb_attributes*2); + int new_size = locator->attributesSize * 2; + attrs = heap_realloc_zero(locator->attributes, new_size * sizeof(struct _attributes)); if(!attrs) { + free_attribute_values(locator); locator->nb_attributes = 0; return E_OUTOFMEMORY; } locator->attributes = attrs; + locator->attributesSize = new_size; } else { @@ -1451,9 +1471,15 @@ for (i = 0; i < nb_namespaces; i++) { + SysFreeString(attrs[nb_attributes+i].szLocalname); attrs[nb_attributes+i].szLocalname = SysAllocStringLen(NULL, 0); + attrs[nb_attributes+i].szURI = locator->namespaceUri; + + SysFreeString(attrs[nb_attributes+i].szValue); attrs[nb_attributes+i].szValue = bstr_from_xmlChar(xmlNamespaces[2*i+1]); + + SysFreeString(attrs[nb_attributes+i].szQName); if(!xmlNamespaces[2*i]) attrs[nb_attributes+i].szQName = SysAllocString(xmlnsW); else @@ -1470,10 +1496,14 @@ /* that's an important feature to keep same uri pointer for every reported attribute */ attrs[i].szURI = find_element_uri(locator, xmlAttributes[i*5+2]); + SysFreeString(attrs[i].szLocalname); attrs[i].szLocalname = bstr_from_xmlChar(xmlAttributes[i*5]); + + SysFreeString(attrs[i].szValue); attrs[i].szValue = saxreader_get_unescaped_value(xmlAttributes[i*5+3], xmlAttributes[i*5+4]-xmlAttributes[i*5+3]); - attrs[i].szQName = QName_from_xmlChar(xmlAttributes[i*5+1], - xmlAttributes[i*5]); + + SysFreeString(attrs[i].szQName); + attrs[i].szQName = QName_from_xmlChar(xmlAttributes[i*5+1], xmlAttributes[i*5]); } return S_OK; @@ -1675,6 +1705,7 @@ if (!saxreader_has_handler(This, SAXContentHandler)) { + free_attribute_values(This); This->nb_attributes = 0; free_element_entry(element); return; @@ -1696,6 +1727,7 @@ local, SysStringLen(local), element->qname, SysStringLen(element->qname)); + free_attribute_values(This); This->nb_attributes = 0; if (sax_callback_failed(This, hr)) @@ -2294,7 +2326,7 @@ SysFreeString(This->systemId); SysFreeString(This->namespaceUri); - for(index=0; indexnb_attributes; index++) + for(index=0; indexattributesSize; index++) { SysFreeString(This->attributes[index].szLocalname); SysFreeString(This->attributes[index].szValue); @@ -2432,7 +2464,7 @@ locator->attributesSize = 8; locator->nb_attributes = 0; - locator->attributes = heap_alloc(sizeof(struct _attributes)*locator->attributesSize); + locator->attributes = heap_alloc_zero(sizeof(struct _attributes)*locator->attributesSize); if(!locator->attributes) { ISAXXMLReader_Release(&reader->ISAXXMLReader_iface); @@ -2934,7 +2966,6 @@ SysFreeString(This->xmldecl_version); free_bstr_pool(&This->pool); - release_dispex(&This->dispex); heap_free( This ); } diff -Nru wine1.7-1.7.14/dlls/msxml3/schema.c wine1.7-1.7.18/dlls/msxml3/schema.c --- wine1.7-1.7.14/dlls/msxml3/schema.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msxml3/schema.c 2014-05-02 18:15:48.000000000 +0000 @@ -1058,8 +1058,6 @@ { int pos = 0, len = xmlXPathNodeSetGetLength(nodeset->nodesetval); - if (len == 0) return S_OK; - while (pos < len) { xmlNodePtr node = xmlXPathNodeSetItem(nodeset->nodesetval, pos); @@ -1149,7 +1147,6 @@ heap_free(This->uris[i]); heap_free(This->uris); xmlHashFree(This->cache, cache_free); - release_dispex(&This->dispex); heap_free(This); } @@ -1194,11 +1191,14 @@ static HRESULT WINAPI schema_cache_add(IXMLDOMSchemaCollection2* iface, BSTR uri, VARIANT var) { schema_cache* This = impl_from_IXMLDOMSchemaCollection2(iface); - xmlChar* name = uri ? xmlchar_from_wchar(uri) : xmlchar_from_wchar(emptyW); + xmlChar* name; + TRACE("(%p)->(%s %s)\n", This, debugstr_w(uri), debugstr_variant(&var)); if (This->read_only) return E_FAIL; + name = uri ? xmlchar_from_wchar(uri) : xmlchar_from_wchar(emptyW); + switch (V_VT(&var)) { case VT_NULL: @@ -1293,11 +1293,17 @@ TRACE("(%p)->(%s %p)\n", This, debugstr_w(uri), node); - if (This->version == MSXML6) return E_NOTIMPL; + if (This->version == MSXML6) + { + if (node) *node = NULL; + return E_NOTIMPL; + } if (!node) return E_POINTER; + *node = NULL; + name = uri ? xmlchar_from_wchar(uri) : xmlchar_from_wchar(emptyW); entry = (cache_entry*) xmlHashLookup(This->cache, name); heap_free(name); @@ -1306,7 +1312,6 @@ if (entry && entry->doc) return get_domdoc_from_xmldoc(entry->doc, (IXMLDOMDocument3**)node); - *node = NULL; return S_OK; } @@ -1345,6 +1350,9 @@ if (!uri) return E_POINTER; + if (This->version == MSXML6) + *uri = NULL; + if (index >= This->count) return E_FAIL; diff -Nru wine1.7-1.7.14/dlls/msxml3/selection.c wine1.7-1.7.18/dlls/msxml3/selection.c --- wine1.7-1.7.14/dlls/msxml3/selection.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msxml3/selection.c 2014-05-02 18:15:48.000000000 +0000 @@ -177,7 +177,6 @@ xmlXPathFreeObject(This->result); xmldoc_release(This->node->doc); if (This->enumvariant) IEnumVARIANT_Release(This->enumvariant); - release_dispex(&This->dispex); heap_free(This); } diff -Nru wine1.7-1.7.14/dlls/msxml3/stylesheet.c wine1.7-1.7.18/dlls/msxml3/stylesheet.c --- wine1.7-1.7.14/dlls/msxml3/stylesheet.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msxml3/stylesheet.c 2014-05-02 18:15:48.000000000 +0000 @@ -138,7 +138,6 @@ if ( ref == 0 ) { if (This->node) IXMLDOMNode_Release( This->node ); - release_dispex(&This->dispex); heap_free( This ); } @@ -326,7 +325,6 @@ xslprocessor_par_free(&This->params, par); IXSLTemplate_Release(&This->stylesheet->IXSLTemplate_iface); - release_dispex(&This->dispex); heap_free( This ); } @@ -465,7 +463,7 @@ IStream *stream; HRESULT hr; - FIXME("(%p)->(%s): semi-stub\n", This, debugstr_variant(&output)); + TRACE("(%p)->(%s)\n", This, debugstr_variant(&output)); switch (V_VT(&output)) { @@ -475,8 +473,11 @@ break; case VT_UNKNOWN: hr = IUnknown_QueryInterface(V_UNKNOWN(&output), &IID_IStream, (void**)&stream); + if (FAILED(hr)) + WARN("failed to get IStream from output, 0x%08x\n", hr); break; default: + FIXME("output type %d not handled\n", V_VT(&output)); hr = E_FAIL; } @@ -529,22 +530,8 @@ if (!ret) return E_INVALIDARG; SysFreeString(This->outstr); - - hr = node_transform_node_params(get_node_obj(This->input), This->stylesheet->node, &This->outstr, &This->params); - if (hr == S_OK) - { - if (This->output) - { - ULONG len = 0; - - /* output to stream */ - hr = IStream_Write(This->output, This->outstr, SysStringByteLen(This->outstr), &len); - *ret = len == SysStringByteLen(This->outstr) ? VARIANT_TRUE : VARIANT_FALSE; - } - } - else - *ret = VARIANT_FALSE; - + hr = node_transform_node_params(get_node_obj(This->input), This->stylesheet->node, &This->outstr, This->output, &This->params); + *ret = hr == S_OK ? VARIANT_TRUE : VARIANT_FALSE; return hr; #else FIXME("libxml2 is required but wasn't present at compile time\n"); diff -Nru wine1.7-1.7.14/dlls/msxml3/tests/domdoc.c wine1.7-1.7.18/dlls/msxml3/tests/domdoc.c --- wine1.7-1.7.14/dlls/msxml3/tests/domdoc.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msxml3/tests/domdoc.c 2014-05-02 18:15:48.000000000 +0000 @@ -376,9 +376,10 @@ #define EXPECT_REF(node,ref) _expect_ref((IUnknown*)node, ref, __LINE__) static void _expect_ref(IUnknown* obj, ULONG ref, int line) { - ULONG rc = IUnknown_AddRef(obj); - IUnknown_Release(obj); - ok_(__FILE__,line)(rc-1 == ref, "expected refcount %d, got %d\n", ref, rc-1); + ULONG rc; + IUnknown_AddRef(obj); + rc = IUnknown_Release(obj); + ok_(__FILE__,line)(rc == ref, "expected refcount %d, got %d\n", ref, rc); } #define EXPECT_LIST_LEN(list,len) _expect_list_len(list, len, __LINE__) @@ -2493,18 +2494,18 @@ EXPECT_REF(elem2, 2); todo_wine ok(unk == unk2, "got %p and %p\n", unk, unk2); - IUnknown_Release(unk); - IUnknown_Release(unk2); /* IUnknown refcount is not affected by node refcount */ - todo_wine EXPECT_REF(unk2, 3); + todo_wine EXPECT_REF(unk2, 4); IXMLDOMElement_AddRef(elem2); - todo_wine EXPECT_REF(unk2, 3); + todo_wine EXPECT_REF(unk2, 4); IXMLDOMElement_Release(elem2); IXMLDOMElement_Release(elem2); - todo_wine EXPECT_REF(unk2, 2); + todo_wine EXPECT_REF(unk2, 3); + + IUnknown_Release(unk2); hr = IXMLDOMElement_get_childNodes( element, &node_list ); EXPECT_HR(hr, S_OK); @@ -6077,7 +6078,8 @@ hr = IXMLDOMDocument_loadXML(doc, _bstr_(""), &b); EXPECT_HR(hr, S_OK); - CreateStreamOnHGlobal(NULL, TRUE, &stream); + hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); + ok(hr == S_OK, "got 0x%08x\n", hr); V_VT(&dest) = VT_UNKNOWN; V_UNKNOWN(&dest) = (IUnknown*)stream; hr = IXMLDOMDocument_save(doc, dest); @@ -6120,7 +6122,7 @@ ok(hr == S_OK, "ret %08x\n", hr ); if(hr == S_OK) { - ok( compareIgnoreReturns( bOut, _bstr_(szTransformOutput)), "Stylesheet output not correct\n"); + ok( compareIgnoreReturns( bOut, _bstr_(szTransformOutput)), "got output %s\n", wine_dbgstr_w(bOut)); SysFreeString(bOut); } @@ -8417,7 +8419,8 @@ hr = IXSLProcessor_put_output(processor, v); ok(hr == S_OK, "got 0x%08x\n", hr); - CreateStreamOnHGlobal(NULL, TRUE, &stream); + hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); + ok(hr == S_OK, "got 0x%08x\n", hr); EXPECT_REF(stream, 1); V_VT(&v) = VT_UNKNOWN; @@ -8469,7 +8472,7 @@ hr = IXSLProcessor_get_output(processor, &v); ok(hr == S_OK, "got 0x%08x\n", hr); ok(V_VT(&v) == VT_BSTR, "got type %d\n", V_VT(&v)); - ok(lstrcmpW(V_BSTR(&v), _bstr_("")) == 0, "got %s\n", wine_dbgstr_w(V_BSTR(&v))); + ok(*V_BSTR(&v) == 0, "got %s\n", wine_dbgstr_w(V_BSTR(&v))); IXMLDOMDocument_Release(doc2); VariantClear(&v); @@ -8876,6 +8879,12 @@ EXPECT_NO_CHILDREN(doc); EXPECT_NO_CHILDREN(doc2); + hr = IXMLDOMDocument_appendChild(doc2, NULL, NULL); + ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + + hr = IXMLDOMElement_appendChild(elem, NULL, NULL); + ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + /* append from another document */ hr = IXMLDOMDocument_appendChild(doc2, (IXMLDOMNode*)elem, NULL); ok(hr == S_OK, "got 0x%08x\n", hr); @@ -9406,6 +9415,7 @@ IEnumVARIANT_Release(enum1); IEnumVARIANT_Release(enum2); + IEnumVARIANT_Release(enum3); enum1 = NULL; hr = IXMLDOMSelection_get__newEnum(selection, (IUnknown**)&enum1); @@ -9734,6 +9744,7 @@ static void test_domobj_dispex(IUnknown *obj) { + static const WCHAR testW[] = {'t','e','s','t','p','r','o','p',0}; DISPID dispid = DISPID_XMLDOM_NODELIST_RESET; IDispatchEx *dispex; IUnknown *unk; @@ -9771,9 +9782,15 @@ hr = IDispatchEx_GetNextDispID(dispex, fdexEnumDefault, DISPID_XMLDOM_NODELIST_RESET, &dispid); EXPECT_HR(hr, E_NOTIMPL); + unk = (IUnknown*)0xdeadbeef; hr = IDispatchEx_GetNameSpaceParent(dispex, &unk); EXPECT_HR(hr, E_NOTIMPL); - if (hr == S_OK && unk) IUnknown_Release(unk); + ok(unk == (IUnknown*)0xdeadbeef, "got %p\n", unk); + + name = SysAllocString(testW); + hr = IDispatchEx_GetDispID(dispex, name, fdexNameEnsure, &dispid); + ok(hr == DISP_E_UNKNOWNNAME, "got 0x%08x\n", hr); + SysFreeString(name); IDispatchEx_Release(dispex); } @@ -10309,7 +10326,8 @@ doc = create_document(&IID_IXMLDOMDocument); - IXMLDOMDocument_QueryInterface(doc, &IID_IUnknown, (void**)&unk); + hr = IXMLDOMDocument_QueryInterface(doc, &IID_IUnknown, (void**)&unk); + ok(hr == S_OK, "got 0x%08x\n", hr); test_domobj_dispex(unk); IUnknown_Release(unk); @@ -10342,7 +10360,8 @@ /* IXMLDOMNodeList for children list */ hr = IXMLDOMDocument_get_childNodes(doc, &node_list); EXPECT_HR(hr, S_OK); - IXMLDOMNodeList_QueryInterface(node_list, &IID_IUnknown, (void**)&unk); + hr = IXMLDOMNodeList_QueryInterface(node_list, &IID_IUnknown, (void**)&unk); + ok(hr == S_OK, "got 0x%08x\n", hr); test_domobj_dispex(unk); IUnknown_Release(unk); @@ -10375,7 +10394,8 @@ hr = IDispatchEx_Invoke(dispex, DISPID_VALUE, &IID_NULL, 0, DISPATCH_METHOD, &dispparams, &ret, NULL, NULL); ok(hr == DISP_E_BADPARAMCOUNT, "got 0x%08x\n", hr); ok(V_VT(&ret) == VT_EMPTY, "got %d\n", V_VT(&ret)); - ok(V_DISPATCH(&ret) == (void*)0x1, "got %p\n", V_DISPATCH(&ret)); +todo_wine + ok(broken(V_DISPATCH(&ret) == (void*)0x1) || (V_DISPATCH(&ret) == NULL), "got %p\n", V_DISPATCH(&ret)); V_VT(&arg) = VT_I4; V_I4(&arg) = 0; @@ -10389,7 +10409,8 @@ hr = IDispatchEx_Invoke(dispex, DISPID_VALUE, &IID_NULL, 0, DISPATCH_METHOD, &dispparams, &ret, NULL, NULL); ok(hr == DISP_E_BADPARAMCOUNT, "got 0x%08x\n", hr); ok(V_VT(&ret) == VT_EMPTY, "got %d\n", V_VT(&ret)); - ok(V_DISPATCH(&ret) == (void*)0x1, "got %p\n", V_DISPATCH(&ret)); +todo_wine + ok(broken(V_DISPATCH(&ret) == (void*)0x1) || (V_DISPATCH(&ret) == NULL), "got %p\n", V_DISPATCH(&ret)); V_VT(&arg) = VT_I4; V_I4(&arg) = 0; @@ -10441,7 +10462,8 @@ hr = IDispatchEx_Invoke(dispex, DISPID_DOM_NODELIST_LENGTH, &IID_NULL, 0, DISPATCH_METHOD, &dispparams, &ret, NULL, NULL); ok(hr == DISP_E_MEMBERNOTFOUND, "got 0x%08x\n", hr); ok(V_VT(&ret) == VT_EMPTY, "got %d\n", V_VT(&ret)); - ok(V_I4(&ret) == 1, "got %d\n", V_I4(&ret)); +todo_wine + ok(broken(V_I4(&ret) == 1) || (V_I4(&ret) == 0), "got %d\n", V_I4(&ret)); IXMLDOMNodeList_Release(node_list); @@ -10466,7 +10488,8 @@ hr = IDispatchEx_Invoke(dispex, DISPID_VALUE, &IID_NULL, 0, DISPATCH_METHOD, &dispparams, &ret, NULL, NULL); ok(hr == DISP_E_MEMBERNOTFOUND, "got 0x%08x\n", hr); ok(V_VT(&ret) == VT_EMPTY, "got %d\n", V_VT(&ret)); - ok(V_DISPATCH(&ret) == (void*)0x1, "got %p\n", V_DISPATCH(&ret)); +todo_wine + ok(broken(V_DISPATCH(&ret) == (void*)0x1) || (V_DISPATCH(&ret) == NULL), "got %p\n", V_DISPATCH(&ret)); IDispatchEx_Release(dispex); @@ -10499,6 +10522,7 @@ EXPECT_HR(hr, S_OK); ok(did == DISPID_DOM_COLLECTION_BASE, "got 0x%08x\n", did); IDispatchEx_Release(dispex); + IXMLDOMNamedNodeMap_Release(map); hr = IXMLDOMDocument_selectNodes(doc, _bstr_("root/b"), &node_list); EXPECT_HR(hr, S_OK); @@ -10520,7 +10544,7 @@ hr = IDispatchEx_GetDispID(dispex, _bstr_("1"), 0, &did); EXPECT_HR(hr, S_OK); ok(did == DISPID_DOM_COLLECTION_BASE+1, "got 0x%08x\n", did); - IDispatchEx_Release(dispex); + IXMLDOMNamedNodeMap_Release(map); did = -1; hr = IDispatchEx_GetDispID(dispex, _bstr_("item"), 0, &did); @@ -10540,8 +10564,9 @@ todo_wine { ok(hr == DISP_E_BADPARAMCOUNT, "got 0x%08x\n", hr); ok(V_VT(&ret) == VT_EMPTY, "got %d\n", V_VT(&ret)); - ok(V_DISPATCH(&ret) == (void*)0x1, "got %p\n", V_DISPATCH(&ret)); } + ok(broken(V_DISPATCH(&ret) == (void*)0x1) || (V_DISPATCH(&ret) == NULL), "got %p\n", V_DISPATCH(&ret)); + V_VT(&arg) = VT_I4; V_I4(&arg) = 0; dispparams.cArgs = 2; @@ -10555,8 +10580,9 @@ todo_wine { ok(hr == DISP_E_BADPARAMCOUNT, "got 0x%08x\n", hr); ok(V_VT(&ret) == VT_EMPTY, "got %d\n", V_VT(&ret)); - ok(V_DISPATCH(&ret) == (void*)0x1, "got %p\n", V_DISPATCH(&ret)); } + ok(broken(V_DISPATCH(&ret) == (void*)0x1) || (V_DISPATCH(&ret) == NULL), "got %p\n", V_DISPATCH(&ret)); + V_VT(&arg) = VT_I4; V_I4(&arg) = 0; dispparams.cArgs = 1; @@ -10607,11 +10633,11 @@ V_I4(&ret) = 1; hr = IDispatchEx_Invoke(dispex, DISPID_DOM_NODELIST_LENGTH, &IID_NULL, 0, DISPATCH_METHOD, &dispparams, &ret, NULL, NULL); ok(hr == DISP_E_MEMBERNOTFOUND, "got 0x%08x\n", hr); -todo_wine { +todo_wine ok(V_VT(&ret) == VT_EMPTY, "got %d\n", V_VT(&ret)); - ok(V_I4(&ret) == 1, "got %d\n", V_I4(&ret)); -} - IXMLDOMNamedNodeMap_Release(map); + ok(broken(V_I4(&ret) == 1) || (V_I4(&ret) == 0), "got %d\n", V_I4(&ret)); + + IDispatchEx_Release(dispex); IXMLDOMElement_Release(elem); /* IXMLDOMImplementation */ @@ -10670,6 +10696,13 @@ IXSLProcessor_Release(processor); IXSLTemplate_Release(template); + if (is_clsid_supported(&CLSID_DOMDocument60, &IID_IXMLDOMDocument)) + { + doc = create_document_version(60, &IID_IXMLDOMDocument); + test_domobj_dispex((IUnknown*)doc); + IXMLDOMDocument_Release(doc); + } + free_bstrs(); } @@ -11251,7 +11284,7 @@ node = (void*)0xdeadbeef; hr = IXMLDOMSchemaCollection_get(collection, _bstr_("http://blah.org"), &node); EXPECT_HR(hr, E_NOTIMPL); - ok(node == (void*)0xdeadbeef, "got %p\n", node); + ok(broken(node == (void*)0xdeadbeef) || (node == NULL), "got %p\n", node); /* load schema and try to add it */ doc2 = create_document(&IID_IXMLDOMDocument2); @@ -11277,7 +11310,7 @@ s = (void*)0xdeadbeef; hr = IXMLDOMSchemaCollection_get_namespaceURI(collection, 2, &s); EXPECT_HR(hr, E_FAIL); - ok(s == (void*)0xdeadbeef, "got %p\n", s); + ok(broken(s == (void*)0xdeadbeef) || (s == NULL), "got %p\n", s); /* enumerate */ enumv = (void*)0xdeadbeef; @@ -11645,6 +11678,26 @@ "" ""; +static const char omitxmldecl_xsl[] = +"" +"" +"" +"" +" " +" " +" " +" " +" " +"" +""; + +static const char omitxmldecl_doc[] = +"" +"" +" " +" " +""; + static void test_xsltext(void) { IXMLDOMDocument *doc, *doc2; @@ -11666,6 +11719,17 @@ ok(!lstrcmpW(ret, _bstr_("testdata")), "transform result %s\n", wine_dbgstr_w(ret)); SysFreeString(ret); + /* omit-xml-declaration */ + hr = IXMLDOMDocument_loadXML(doc, _bstr_(omitxmldecl_xsl), &b); + ok(hr == S_OK, "got 0x%08x\n", hr); + hr = IXMLDOMDocument_loadXML(doc2, _bstr_(omitxmldecl_doc), &b); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IXMLDOMDocument_transformNode(doc2, (IXMLDOMNode*)doc, &ret); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(!lstrcmpW(ret, _bstr_("item1item2")), "transform result %s\n", wine_dbgstr_w(ret)); + SysFreeString(ret); + IXMLDOMDocument_Release(doc2); IXMLDOMDocument_Release(doc); free_bstrs(); diff -Nru wine1.7-1.7.14/dlls/msxml3/tests/saxreader.c wine1.7-1.7.18/dlls/msxml3/tests/saxreader.c --- wine1.7-1.7.14/dlls/msxml3/tests/saxreader.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msxml3/tests/saxreader.c 2014-05-02 18:15:48.000000000 +0000 @@ -1515,8 +1515,13 @@ ok(index >= 0 && index <= 2, "invalid index received %d\n", index); - *QName = attrqnamesW[index]; - *QNameLength = attrqnamelen[index]; + if (index >= 0 && index <= 2) { + *QName = attrqnamesW[index]; + *QNameLength = attrqnamelen[index]; + } else { + *QName = NULL; + *QNameLength = 0; + } return S_OK; } @@ -1601,8 +1606,13 @@ ok(index >= 0 && index <= 2, "invalid index received %d\n", index); - *value = attrvaluesW[index]; - *nValue = attrvalueslen[index]; + if (index >= 0 && index <= 2) { + *value = attrvaluesW[index]; + *nValue = attrvalueslen[index]; + } else { + *value = NULL; + *nValue = 0; + } return S_OK; } @@ -2124,6 +2134,7 @@ static const CHAR testXmlA[] = "test.xml"; static const WCHAR testXmlW[] = {'t','e','s','t','.','x','m','l',0}; IXMLDOMDocument *doc; + char seqname[50]; VARIANT_BOOL v; while (table->clsid) @@ -2453,7 +2464,8 @@ V_VT(&var) = VT_UNKNOWN; V_UNKNOWN(&var) = (IUnknown*)stream; - if (IsEqualGUID(table->clsid, &CLSID_SAXXMLReader60)) + if (IsEqualGUID(table->clsid, &CLSID_SAXXMLReader60) || + IsEqualGUID(table->clsid, &CLSID_SAXXMLReader40)) test_seq = cdata_test_alt; else test_seq = cdata_test; @@ -2461,14 +2473,16 @@ set_expected_seq(test_seq); hr = ISAXXMLReader_parse(reader, var); ok(hr == S_OK, "got 0x%08x\n", hr); - ok_sequence(sequences, CONTENT_HANDLER_INDEX, test_seq, "cdata test", TRUE); + sprintf(seqname, "%s: cdata test", table->name); + ok_sequence(sequences, CONTENT_HANDLER_INDEX, test_seq, seqname, TRUE); /* 2. CDATA sections */ stream = create_test_stream(test2_cdata_xml, -1); V_VT(&var) = VT_UNKNOWN; V_UNKNOWN(&var) = (IUnknown*)stream; - if (IsEqualGUID(table->clsid, &CLSID_SAXXMLReader60)) + if (IsEqualGUID(table->clsid, &CLSID_SAXXMLReader60) || + IsEqualGUID(table->clsid, &CLSID_SAXXMLReader40)) test_seq = cdata_test2_alt; else test_seq = cdata_test2; @@ -2476,7 +2490,8 @@ set_expected_seq(test_seq); hr = ISAXXMLReader_parse(reader, var); ok(hr == S_OK, "got 0x%08x\n", hr); - ok_sequence(sequences, CONTENT_HANDLER_INDEX, test_seq, "cdata test 2", TRUE); + sprintf(seqname, "%s: cdata test 2", table->name); + ok_sequence(sequences, CONTENT_HANDLER_INDEX, test_seq, seqname, TRUE); IStream_Release(stream); @@ -2485,7 +2500,8 @@ V_VT(&var) = VT_UNKNOWN; V_UNKNOWN(&var) = (IUnknown*)stream; - if (IsEqualGUID(table->clsid, &CLSID_SAXXMLReader60)) + if (IsEqualGUID(table->clsid, &CLSID_SAXXMLReader60) || + IsEqualGUID(table->clsid, &CLSID_SAXXMLReader40)) test_seq = cdata_test3_alt; else test_seq = cdata_test3; @@ -2493,7 +2509,8 @@ set_expected_seq(test_seq); hr = ISAXXMLReader_parse(reader, var); ok(hr == S_OK, "got 0x%08x\n", hr); - ok_sequence(sequences, CONTENT_HANDLER_INDEX, test_seq, "cdata test 3", TRUE); + sprintf(seqname, "%s: cdata test 3", table->name); + ok_sequence(sequences, CONTENT_HANDLER_INDEX, test_seq, seqname, TRUE); IStream_Release(stream); @@ -4387,6 +4404,7 @@ static void test_obj_dispex(IUnknown *obj) { + static const WCHAR testW[] = {'t','e','s','t','p','r','o','p',0}; static const WCHAR starW[] = {'*',0}; DISPID dispid = DISPID_SAX_XMLREADER_GETFEATURE; IDispatchEx *dispex; @@ -4395,6 +4413,7 @@ UINT ticnt; HRESULT hr; BSTR name; + DISPID did; hr = IUnknown_QueryInterface(obj, &IID_IDispatchEx, (void**)&dispex); EXPECT_HR(hr, S_OK); @@ -4425,9 +4444,15 @@ hr = IDispatchEx_GetNextDispID(dispex, fdexEnumDefault, DISPID_SAX_XMLREADER_GETFEATURE, &dispid); EXPECT_HR(hr, E_NOTIMPL); + unk = (IUnknown*)0xdeadbeef; hr = IDispatchEx_GetNameSpaceParent(dispex, &unk); EXPECT_HR(hr, E_NOTIMPL); - if (hr == S_OK && unk) IUnknown_Release(unk); + ok(unk == (IUnknown*)0xdeadbeef, "got %p\n", unk); + + name = SysAllocString(testW); + hr = IDispatchEx_GetDispID(dispex, name, fdexNameEnsure, &did); + ok(hr == DISP_E_UNKNOWNNAME, "got 0x%08x\n", hr); + SysFreeString(name); IDispatchEx_Release(dispex); } @@ -4491,8 +4516,15 @@ ok(hr == S_OK, "got 0x%08x\n", hr); IVBSAXXMLReader_Release(vbreader); - ISAXXMLReader_Release(reader); + + if (is_clsid_supported(&CLSID_SAXXMLReader60, reader_support_data)) + { + hr = CoCreateInstance(&CLSID_SAXXMLReader60, NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void**)&unk); + ok(hr == S_OK, "got 0x%08x\n", hr); + test_obj_dispex(unk); + IUnknown_Release(unk); + } } static void test_mxwriter_dispex(void) @@ -4512,8 +4544,15 @@ test_obj_dispex(unk); IUnknown_Release(unk); IDispatchEx_Release(dispex); - IMXWriter_Release(writer); + + if (is_clsid_supported(&CLSID_MXXMLWriter60, mxwriter_support_data)) + { + hr = CoCreateInstance(&CLSID_MXXMLWriter60, NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void**)&unk); + ok(hr == S_OK, "got 0x%08x\n", hr); + test_obj_dispex(unk); + IUnknown_Release(unk); + } } static void test_mxwriter_comment(void) @@ -5049,25 +5088,25 @@ EXPECT_HR(hr, E_INVALIDARG); hr = ISAXAttributes_getValue(saxattr, 0, NULL, &len); - EXPECT_HR(hr, E_INVALIDARG); + ok(hr == E_POINTER /* win8 */ || hr == E_INVALIDARG, "got 0x%08x\n", hr); hr = ISAXAttributes_getValue(saxattr, 0, &value, NULL); - EXPECT_HR(hr, E_INVALIDARG); + ok(hr == E_POINTER /* win8 */ || hr == E_INVALIDARG, "got 0x%08x\n", hr); hr = ISAXAttributes_getValue(saxattr, 0, NULL, NULL); - EXPECT_HR(hr, E_INVALIDARG); + ok(hr == E_POINTER /* win8 */ || hr == E_INVALIDARG, "got 0x%08x\n", hr); hr = ISAXAttributes_getType(saxattr, 0, &value, &len); EXPECT_HR(hr, E_INVALIDARG); hr = ISAXAttributes_getType(saxattr, 0, NULL, &len); - EXPECT_HR(hr, E_INVALIDARG); + ok(hr == E_POINTER /* win8 */ || hr == E_INVALIDARG, "got 0x%08x\n", hr); hr = ISAXAttributes_getType(saxattr, 0, &value, NULL); - EXPECT_HR(hr, E_INVALIDARG); + ok(hr == E_POINTER /* win8 */ || hr == E_INVALIDARG, "got 0x%08x\n", hr); hr = ISAXAttributes_getType(saxattr, 0, NULL, NULL); - EXPECT_HR(hr, E_INVALIDARG); + ok(hr == E_POINTER /* win8 */ || hr == E_INVALIDARG, "got 0x%08x\n", hr); hr = IMXAttributes_addAttribute(mxattr, _bstr_(table->uri), _bstr_(table->local), _bstr_(table->qname), _bstr_(table->type), _bstr_(table->value)); @@ -5158,22 +5197,22 @@ IsEqualGUID(table->clsid, &CLSID_SAXAttributes60)) { hr = ISAXAttributes_getValueFromQName(saxattr, NULL, 0, NULL, NULL); - EXPECT_HR(hr, E_INVALIDARG); + ok(hr == E_POINTER /* win8 */ || hr == E_INVALIDARG, "got 0x%08x\n", hr); hr = ISAXAttributes_getValueFromQName(saxattr, _bstr_(table->qname), 0, NULL, NULL); - EXPECT_HR(hr, E_INVALIDARG); + ok(hr == E_POINTER /* win8 */ || hr == E_INVALIDARG, "got 0x%08x\n", hr); hr = ISAXAttributes_getValueFromQName(saxattr, _bstr_(table->qname), 0, &value, NULL); - EXPECT_HR(hr, E_INVALIDARG); + ok(hr == E_POINTER /* win8 */ || hr == E_INVALIDARG, "got 0x%08x\n", hr); hr = ISAXAttributes_getValueFromName(saxattr, NULL, 0, NULL, 0, NULL, NULL); - EXPECT_HR(hr, E_INVALIDARG); + ok(hr == E_POINTER /* win8 */ || hr == E_INVALIDARG, "got 0x%08x\n", hr); hr = ISAXAttributes_getValueFromName(saxattr, _bstr_(table->uri), 0, NULL, 0, NULL, NULL); - EXPECT_HR(hr, E_INVALIDARG); + ok(hr == E_POINTER /* win8 */ || hr == E_INVALIDARG, "got 0x%08x\n", hr); hr = ISAXAttributes_getValueFromName(saxattr, _bstr_(table->uri), 0, NULL, 0, &value, NULL); - EXPECT_HR(hr, E_INVALIDARG); + ok(hr == E_POINTER /* win8 */ || hr == E_INVALIDARG, "got 0x%08x\n", hr); } else { diff -Nru wine1.7-1.7.14/dlls/msxml3/tests/schema.c wine1.7-1.7.18/dlls/msxml3/tests/schema.c --- wine1.7-1.7.14/dlls/msxml3/tests/schema.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/msxml3/tests/schema.c 2014-05-02 18:15:48.000000000 +0000 @@ -1416,6 +1416,7 @@ static void test_obj_dispex(IUnknown *obj) { + static const WCHAR testW[] = {'t','e','s','t','p','r','o','p',0}; static const WCHAR starW[] = {'*',0}; DISPID dispid = DISPID_SAX_XMLREADER_GETFEATURE; IDispatchEx *dispex; @@ -1454,9 +1455,15 @@ hr = IDispatchEx_GetNextDispID(dispex, fdexEnumDefault, DISPID_XMLDOM_SCHEMACOLLECTION_ADD, &dispid); EXPECT_HR(hr, E_NOTIMPL); + unk = (IUnknown*)0xdeadbeef; hr = IDispatchEx_GetNameSpaceParent(dispex, &unk); EXPECT_HR(hr, E_NOTIMPL); - if (hr == S_OK && unk) IUnknown_Release(unk); + ok(unk == (IUnknown*)0xdeadbeef, "got %p\n", unk); + + name = SysAllocString(testW); + hr = IDispatchEx_GetDispID(dispex, name, fdexNameEnsure, &dispid); + ok(hr == DISP_E_UNKNOWNNAME, "got 0x%08x\n", hr); + SysFreeString(name); IDispatchEx_Release(dispex); } @@ -1496,8 +1503,14 @@ ok(V_DISPATCH(&ret) == (void*)0x1, "got %p\n", V_DISPATCH(&ret)); IDispatchEx_Release(dispex); - IXMLDOMSchemaCollection_Release(cache); + + cache = create_cache_version(60, &IID_IXMLDOMSchemaCollection); + if (cache) + { + test_obj_dispex((IUnknown*)cache); + IXMLDOMSchemaCollection_Release(cache); + } } static void test_get(void) diff -Nru wine1.7-1.7.14/dlls/netapi32/netapi32.c wine1.7-1.7.18/dlls/netapi32/netapi32.c --- wine1.7-1.7.14/dlls/netapi32/netapi32.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/netapi32/netapi32.c 2014-05-02 18:15:48.000000000 +0000 @@ -1098,6 +1098,12 @@ return NERR_Success; } +NET_API_STATUS WINAPI NetScheduleJobDel(LPCWSTR server, DWORD minjobid, DWORD maxjobid) +{ + FIXME("stub (%s, %d, %d)\n", debugstr_w(server), minjobid, maxjobid); + return NERR_Success; +} + NET_API_STATUS WINAPI NetScheduleJobEnum(LPCWSTR server, LPBYTE* bufptr, DWORD prefmaxsize, LPDWORD entriesread, LPDWORD totalentries, LPDWORD resumehandle) { diff -Nru wine1.7-1.7.14/dlls/netapi32/netapi32.spec wine1.7-1.7.18/dlls/netapi32/netapi32.spec --- wine1.7-1.7.14/dlls/netapi32/netapi32.spec 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/netapi32/netapi32.spec 2014-05-02 18:15:48.000000000 +0000 @@ -167,7 +167,7 @@ @ stub NetRplWkstaGetInfo @ stub NetRplWkstaSetInfo @ stdcall NetScheduleJobAdd(wstr ptr ptr) -@ stub NetScheduleJobDel +@ stdcall NetScheduleJobDel(wstr long long) @ stdcall NetScheduleJobEnum(wstr ptr long ptr ptr ptr) @ stub NetScheduleJobGetInfo @ stub NetServerComputerNameAdd diff -Nru wine1.7-1.7.14/dlls/netcfgx/main.c wine1.7-1.7.18/dlls/netcfgx/main.c --- wine1.7-1.7.14/dlls/netcfgx/main.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/netcfgx/main.c 2014-05-02 18:15:48.000000000 +0000 @@ -19,16 +19,113 @@ */ #include +#define COBJMACROS + #include "windef.h" #include "winbase.h" +#include "ole2.h" +#include "rpcproxy.h" #include "wine/debug.h" +#include "netcfgx.h" +#include "netcfg_private.h" + WINE_DEFAULT_DEBUG_CHANNEL(netcfgx); +static HINSTANCE NETCFGX_hInstance; + +typedef HRESULT (*ClassFactoryCreateInstanceFunc)(IUnknown **); + +typedef struct netcfgcf +{ + IClassFactory IClassFactory_iface; + ClassFactoryCreateInstanceFunc fnCreateInstance; +} netcfgcf; + +static inline netcfgcf *impl_from_IClassFactory( IClassFactory *iface ) +{ + return CONTAINING_RECORD(iface, netcfgcf, IClassFactory_iface); +} + +static HRESULT WINAPI netcfgcf_QueryInterface(IClassFactory *iface, REFIID riid, LPVOID *ppobj ) +{ + TRACE("%s %p\n", debugstr_guid(riid), ppobj); + + if (IsEqualGUID(riid, &IID_IUnknown) || + IsEqualGUID(riid, &IID_IClassFactory)) + { + IClassFactory_AddRef( iface ); + *ppobj = iface; + return S_OK; + } + + ERR("interface %s not implemented\n", debugstr_guid(riid)); + return E_NOINTERFACE; +} + +static ULONG WINAPI netcfgcf_AddRef(IClassFactory *iface ) +{ + TRACE("%p\n", iface); + + return 2; +} + +static ULONG WINAPI netcfgcf_Release(IClassFactory *iface ) +{ + TRACE("%p\n", iface); + + return 1; +} + +static HRESULT WINAPI netcfgcf_CreateInstance(IClassFactory *iface,LPUNKNOWN pOuter, + REFIID riid, LPVOID *ppobj ) +{ + netcfgcf *This = impl_from_IClassFactory( iface ); + HRESULT hr; + IUnknown *punk; + + TRACE("%p %s %p\n", pOuter, debugstr_guid(riid), ppobj ); + + *ppobj = NULL; + + if (pOuter) + return CLASS_E_NOAGGREGATION; + + hr = This->fnCreateInstance( &punk ); + if (SUCCEEDED(hr)) + { + hr = IUnknown_QueryInterface( punk, riid, ppobj ); + + IUnknown_Release( punk ); + } + else + { + WARN("Cannot create an instance object. 0x%08x\n", hr); + } + return hr; +} + +static HRESULT WINAPI netcfgcf_LockServer(IClassFactory *iface, BOOL dolock) +{ + FIXME("(%p)->(%d),stub!\n",iface,dolock); + return S_OK; +} + +static const struct IClassFactoryVtbl netcfgcf_vtbl = +{ + netcfgcf_QueryInterface, + netcfgcf_AddRef, + netcfgcf_Release, + netcfgcf_CreateInstance, + netcfgcf_LockServer +}; + BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { TRACE("(0x%p, %d, %p)\n", hinstDLL, fdwReason, lpvReserved); + NETCFGX_hInstance = hinstDLL; + switch (fdwReason) { case DLL_WINE_PREATTACH: @@ -42,3 +139,37 @@ return TRUE; } + +static netcfgcf netconfigcf = { {&netcfgcf_vtbl}, INetCfg_CreateInstance }; + +HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv) +{ + IClassFactory *cf = NULL; + + TRACE("(%s, %s, %p)\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv); + + if(IsEqualCLSID(rclsid, &CLSID_CNetCfg)) + { + cf = &netconfigcf.IClassFactory_iface; + } + + if(!cf) + return CLASS_E_CLASSNOTAVAILABLE; + + return IClassFactory_QueryInterface(cf, riid, ppv); +} + +HRESULT WINAPI DllRegisterServer(void) +{ + return __wine_register_resources( NETCFGX_hInstance ); +} + +HRESULT WINAPI DllUnregisterServer(void) +{ + return __wine_unregister_resources( NETCFGX_hInstance ); +} + +HRESULT WINAPI DllCanUnloadNow(void) +{ + return S_FALSE; +} diff -Nru wine1.7-1.7.14/dlls/netcfgx/Makefile.in wine1.7-1.7.18/dlls/netcfgx/Makefile.in --- wine1.7-1.7.14/dlls/netcfgx/Makefile.in 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/netcfgx/Makefile.in 2014-05-02 18:15:48.000000000 +0000 @@ -1,4 +1,8 @@ MODULE = netcfgx.dll +IMPORTS = uuid C_SRCS = \ - main.c + main.c \ + netcfg.c + +IDL_SRCS = netcfgx_classes.idl diff -Nru wine1.7-1.7.14/dlls/netcfgx/netcfg.c wine1.7-1.7.18/dlls/netcfgx/netcfg.c --- wine1.7-1.7.14/dlls/netcfgx/netcfg.c 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.18/dlls/netcfgx/netcfg.c 2014-05-02 18:15:48.000000000 +0000 @@ -0,0 +1,239 @@ +/* + * Copyright 2014 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 + */ +#include +#include +#include + +#define COBJMACROS + +#include "netcfgx.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL( netcfgx ); + + +typedef struct NetConfiguration +{ + INetCfg INetCfg_iface; + INetCfgLock INetCfgLock_iface; + + LONG ref; +} NetConfiguration; + +static inline NetConfiguration *impl_from_INetCfg(INetCfg *iface) +{ + return CONTAINING_RECORD(iface, NetConfiguration, INetCfg_iface); +} + +static inline NetConfiguration *impl_from_INetCfgLock(INetCfgLock *iface) +{ + return CONTAINING_RECORD(iface, NetConfiguration, INetCfgLock_iface); +} + +static HRESULT WINAPI netcfg_QueryInterface(INetCfg *iface, REFIID riid, void **ppvObject) +{ + NetConfiguration *This = impl_from_INetCfg(iface); + TRACE("%p %s %p\n", This, debugstr_guid(riid), ppvObject); + + if (IsEqualGUID(riid, &IID_INetCfg) || + IsEqualGUID(riid, &IID_IUnknown)) + { + *ppvObject = &This->INetCfg_iface; + } + else if(IsEqualGUID(riid, &IID_INetCfgLock)) + { + *ppvObject = &This->INetCfgLock_iface; + } + else + { + FIXME("Unsupported interface %s\n", debugstr_guid(riid)); + return E_NOINTERFACE; + } + + IUnknown_AddRef((IUnknown*)*ppvObject); + + return S_OK; +} + +static ULONG WINAPI netcfg_AddRef(INetCfg *iface) +{ + NetConfiguration *This = impl_from_INetCfg(iface); + ULONG ref = InterlockedIncrement(&This->ref); + + TRACE("%p ref=%u\n", This, ref); + + return ref; +} + +static ULONG WINAPI netcfg_Release(INetCfg *iface) +{ + NetConfiguration *This = impl_from_INetCfg(iface); + ULONG ref = InterlockedDecrement(&This->ref); + + TRACE("%p ref=%u\n", This, ref); + + if (ref == 0) + { + HeapFree(GetProcessHeap(), 0, This); + } + + return ref; +} + +static HRESULT WINAPI netcfg_Initialize(INetCfg *iface, PVOID pvReserved) +{ + NetConfiguration *This = impl_from_INetCfg(iface); + FIXME("%p %p\n", This, pvReserved); + + return S_OK; +} + +static HRESULT WINAPI netcfg_Uninitialize(INetCfg *iface) +{ + NetConfiguration *This = impl_from_INetCfg(iface); + FIXME("%p\n", This); + + return S_OK; +} + +static HRESULT WINAPI netcfg_Apply(INetCfg *iface) +{ + NetConfiguration *This = impl_from_INetCfg(iface); + FIXME("%p\n", This); + + return E_NOTIMPL; +} + +static HRESULT WINAPI netcfg_Cancel(INetCfg *iface) +{ + NetConfiguration *This = impl_from_INetCfg(iface); + FIXME("%p\n", This); + + return E_NOTIMPL; +} + +static HRESULT WINAPI netcfg_EnumComponents(INetCfg *iface, const GUID *pguidClass, IEnumNetCfgComponent **ppenumComponent) +{ + NetConfiguration *This = impl_from_INetCfg(iface); + FIXME("%p %s %p\n", This, debugstr_guid(pguidClass), ppenumComponent); + + return E_NOTIMPL; +} + +static HRESULT WINAPI netcfg_FindComponent(INetCfg *iface, LPCWSTR pszwInfId, INetCfgComponent **pComponent) +{ + NetConfiguration *This = impl_from_INetCfg(iface); + FIXME("%p %s %p\n", This, debugstr_w(pszwInfId), pComponent); + + return E_NOTIMPL; +} + +static HRESULT WINAPI netcfg_QueryNetCfgClass(INetCfg *iface, const GUID *pguidClass, REFIID riid, void **ppvObject) +{ + NetConfiguration *This = impl_from_INetCfg(iface); + FIXME("%p %s %p\n", This, debugstr_guid(pguidClass), ppvObject); + + return E_NOTIMPL; +} + +static const struct INetCfgVtbl NetCfgVtbl = +{ + netcfg_QueryInterface, + netcfg_AddRef, + netcfg_Release, + netcfg_Initialize, + netcfg_Uninitialize, + netcfg_Apply, + netcfg_Cancel, + netcfg_EnumComponents, + netcfg_FindComponent, + netcfg_QueryNetCfgClass +}; + + +static HRESULT WINAPI netcfglock_QueryInterface(INetCfgLock *iface, REFIID riid,void **ppvObject) +{ + NetConfiguration *This = impl_from_INetCfgLock(iface); + + return netcfg_QueryInterface(&This->INetCfg_iface, riid, ppvObject); +} + +static ULONG WINAPI netcfglock_AddRef(INetCfgLock *iface) +{ + NetConfiguration *This = impl_from_INetCfgLock(iface); + + return netcfg_AddRef(&This->INetCfg_iface); +} + +static ULONG WINAPI netcfglock_Release(INetCfgLock *iface) +{ + NetConfiguration *This = impl_from_INetCfgLock(iface); + return netcfg_Release(&This->INetCfg_iface); +} + +static HRESULT WINAPI netcfglock_AcquireWriteLock(INetCfgLock *iface, DWORD cmsTimeout, + LPCWSTR pszwClientDescription, LPWSTR *ppszwClientDescription) +{ + NetConfiguration *This = impl_from_INetCfgLock(iface); + FIXME("%p %d %s %p\n", This, cmsTimeout, debugstr_w(pszwClientDescription), ppszwClientDescription); + + return S_OK; +} + +static HRESULT WINAPI netcfglock_ReleaseWriteLock(INetCfgLock *iface) +{ + NetConfiguration *This = impl_from_INetCfgLock(iface); + FIXME("%p\n", This); + + return S_OK; +} + +static HRESULT WINAPI netcfglock_IsWriteLocked(INetCfgLock *iface, LPWSTR *ppszwClientDescription) +{ + NetConfiguration *This = impl_from_INetCfgLock(iface); + FIXME("%p %p\n", This, ppszwClientDescription); + + return E_NOTIMPL; +} + +static const struct INetCfgLockVtbl NetCfgLockVtbl = +{ + netcfglock_QueryInterface, + netcfglock_AddRef, + netcfglock_Release, + netcfglock_AcquireWriteLock, + netcfglock_ReleaseWriteLock, + netcfglock_IsWriteLocked +}; + +HRESULT INetCfg_CreateInstance(IUnknown **ppUnk) +{ + NetConfiguration *This; + + This = HeapAlloc(GetProcessHeap(), 0, sizeof(NetConfiguration)); + if (!This) + return E_OUTOFMEMORY; + + This->INetCfg_iface.lpVtbl = &NetCfgVtbl; + This->INetCfgLock_iface.lpVtbl = &NetCfgLockVtbl; + This->ref = 1; + + *ppUnk = (IUnknown*)This; + + return S_OK; +} diff -Nru wine1.7-1.7.14/dlls/netcfgx/netcfg_private.h wine1.7-1.7.18/dlls/netcfgx/netcfg_private.h --- wine1.7-1.7.14/dlls/netcfgx/netcfg_private.h 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.18/dlls/netcfgx/netcfg_private.h 2014-05-02 18:15:48.000000000 +0000 @@ -0,0 +1,23 @@ +/* + * Copyright 2014 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 __NETCFG_PRIVATE_H__ +#define __NETCFG_PRIVATE_H__ + +extern HRESULT INetCfg_CreateInstance(IUnknown **ppUnk) DECLSPEC_HIDDEN; + +#endif diff -Nru wine1.7-1.7.14/dlls/netcfgx/netcfgx_classes.idl wine1.7-1.7.18/dlls/netcfgx/netcfgx_classes.idl --- wine1.7-1.7.14/dlls/netcfgx/netcfgx_classes.idl 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.18/dlls/netcfgx/netcfgx_classes.idl 2014-05-02 18:15:48.000000000 +0000 @@ -0,0 +1,21 @@ +/* + * Copyright 2014 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 + */ + +#pragma makedep register + +#include "netcfgx.idl" diff -Nru wine1.7-1.7.14/dlls/netcfgx/netcfgx.spec wine1.7-1.7.18/dlls/netcfgx/netcfgx.spec --- wine1.7-1.7.14/dlls/netcfgx/netcfgx.spec 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/netcfgx/netcfgx.spec 2014-05-02 18:15:48.000000000 +0000 @@ -1,7 +1,7 @@ -@ stub DllCanUnloadNow -@ stub DllGetClassObject -@ stub DllRegisterServer -@ stub DllUnregisterServer +@ stdcall -private DllCanUnloadNow() +@ stdcall -private DllGetClassObject(ptr ptr ptr) +@ stdcall -private DllRegisterServer() +@ stdcall -private DllUnregisterServer() @ stub HrDiAddComponentToINetCfg @ stub LanaCfgFromCommandArgs @ stub ModemClassCoInstaller diff -Nru wine1.7-1.7.14/dlls/netcfgx/tests/Makefile.in wine1.7-1.7.18/dlls/netcfgx/tests/Makefile.in --- wine1.7-1.7.14/dlls/netcfgx/tests/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.18/dlls/netcfgx/tests/Makefile.in 2014-05-02 18:15:48.000000000 +0000 @@ -0,0 +1,5 @@ +TESTDLL = netcfgx.dll +IMPORTS = uuid ole32 + +C_SRCS = \ + netcfgx.c diff -Nru wine1.7-1.7.14/dlls/netcfgx/tests/netcfgx.c wine1.7-1.7.18/dlls/netcfgx/tests/netcfgx.c --- wine1.7-1.7.14/dlls/netcfgx/tests/netcfgx.c 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.18/dlls/netcfgx/tests/netcfgx.c 2014-05-02 18:15:48.000000000 +0000 @@ -0,0 +1,93 @@ +/* + * Copyright 2014 Alistair Leslie-Hughes + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ +#define WIN32_LEAN_AND_MEAN +#include + +#define COBJMACROS + +#include "netcfgx.h" +#include "wine/test.h" + +static void create_configuration(void) +{ + static const WCHAR tcpipW[] = {'M','S','_','T','C','P','I','P',0}; + static const WCHAR myclient[] = {'M','Y',' ','C','L','I','E','N','T',0}; + HRESULT hr; + INetCfg *config = NULL; + INetCfgLock *netlock = NULL; + INetCfgComponent *component = NULL; + LPWSTR client = NULL; + + hr = CoCreateInstance( &CLSID_CNetCfg, NULL, CLSCTX_ALL, &IID_INetCfg, (LPVOID*)&config); + ok(hr == S_OK, "Failed to create object\n"); + if(SUCCEEDED(hr)) + { + hr = INetCfg_QueryInterface(config, &IID_INetCfgLock, (LPVOID*)&netlock); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = INetCfgLock_AcquireWriteLock(netlock, 5000, myclient, &client); + ok(hr == S_OK || + hr == E_ACCESSDENIED /* Not run as admin */, "got 0x%08x\n", hr); + if(hr == S_OK) + { + trace("Lock value: %s\n", wine_dbgstr_w(client)); + CoTaskMemFree(client); + } + else if(hr == E_ACCESSDENIED) + trace("Not run with Admin permissions\n"); + + hr = INetCfg_Initialize(config, NULL); + ok(hr == S_OK, "got 0x%08x\n", hr); + + /* AcquireWriteLock needs to be run before Initialize */ + hr = INetCfgLock_AcquireWriteLock(netlock, 5000, myclient, &client); + todo_wine ok(hr == NETCFG_E_ALREADY_INITIALIZED || hr == E_ACCESSDENIED, "got 0x%08x\n", hr); + + hr = INetCfg_FindComponent(config, tcpipW, &component); + todo_wine ok(hr == S_OK, "got 0x%08x\n", hr); + if(hr == S_OK) + { + INetCfgComponent_Release(component); + } + + hr = INetCfg_Apply(config); + todo_wine ok(hr == S_OK || hr == NETCFG_E_NO_WRITE_LOCK, "got 0x%08x\n", hr); + + hr = INetCfg_Uninitialize(config); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = INetCfgLock_ReleaseWriteLock(netlock); + ok(hr == S_OK, "got 0x%08x\n", hr); + + INetCfg_Release(config); + } +} + +START_TEST(netcfgx) +{ + HRESULT hr; + + hr = CoInitialize(0); + ok( hr == S_OK, "failed to init com\n"); + if (hr != S_OK) + return; + + create_configuration(); + + CoUninitialize(); +} diff -Nru wine1.7-1.7.14/dlls/netprofm/list.c wine1.7-1.7.18/dlls/netprofm/list.c --- wine1.7-1.7.14/dlls/netprofm/list.c 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.18/dlls/netprofm/list.c 2014-05-02 18:15:48.000000000 +0000 @@ -0,0 +1,302 @@ +/* + * Copyright 2014 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 "config.h" +#include +#include "windef.h" +#include "winbase.h" +#define COBJMACROS +#include "initguid.h" +#include "objbase.h" +#include "netlistmgr.h" + +#include "wine/debug.h" +#include "netprofm_private.h" + +WINE_DEFAULT_DEBUG_CHANNEL(netprofm); + +struct list_manager +{ + INetworkListManager INetworkListManager_iface; + INetworkCostManager INetworkCostManager_iface; + LONG refs; +}; + +static inline struct list_manager *impl_from_INetworkCostManager( + INetworkCostManager *iface ) +{ + return CONTAINING_RECORD( iface, struct list_manager, INetworkCostManager_iface ); +} + +static HRESULT WINAPI cost_manager_QueryInterface( + INetworkCostManager *iface, + REFIID riid, + void **obj ) +{ + struct list_manager *mgr = impl_from_INetworkCostManager( iface ); + return INetworkListManager_QueryInterface( &mgr->INetworkListManager_iface, riid, obj ); +} + +static ULONG WINAPI cost_manager_AddRef( + INetworkCostManager *iface ) +{ + struct list_manager *mgr = impl_from_INetworkCostManager( iface ); + return INetworkListManager_AddRef( &mgr->INetworkListManager_iface ); +} + +static ULONG WINAPI cost_manager_Release( + INetworkCostManager *iface ) +{ + struct list_manager *mgr = impl_from_INetworkCostManager( iface ); + return INetworkListManager_Release( &mgr->INetworkListManager_iface ); +} + +static HRESULT WINAPI cost_manager_GetCost( + INetworkCostManager *iface, DWORD *pCost, NLM_SOCKADDR *pDestIPAddr) +{ + FIXME( "%p, %p, %p\n", iface, pCost, pDestIPAddr ); + + if (!pCost) return E_POINTER; + + *pCost = NLM_CONNECTION_COST_UNRESTRICTED; + return S_OK; +} + +static HRESULT WINAPI cost_manager_GetDataPlanStatus( + INetworkCostManager *iface, NLM_DATAPLAN_STATUS *pDataPlanStatus, + NLM_SOCKADDR *pDestIPAddr) +{ + FIXME( "%p, %p, %p\n", iface, pDataPlanStatus, pDestIPAddr ); + return E_NOTIMPL; +} + +static HRESULT WINAPI cost_manager_SetDestinationAddresses( + INetworkCostManager *iface, UINT32 length, NLM_SOCKADDR *pDestIPAddrList, + VARIANT_BOOL bAppend) +{ + FIXME( "%p, %u, %p, %x\n", iface, length, pDestIPAddrList, bAppend ); + return E_NOTIMPL; +} + +static const INetworkCostManagerVtbl cost_manager_vtbl = +{ + cost_manager_QueryInterface, + cost_manager_AddRef, + cost_manager_Release, + cost_manager_GetCost, + cost_manager_GetDataPlanStatus, + 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 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) + { + TRACE( "destroying %p\n", mgr ); + HeapFree( GetProcessHeap(), 0, 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_IUnknown )) + { + *obj = iface; + } + else if (IsEqualGUID( riid, &IID_INetworkCostManager )) + { + *obj = &mgr->INetworkCostManager_iface; + } + else + { + FIXME( "interface %s not implemented\n", debugstr_guid(riid) ); + 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 ) +{ + FIXME( "%p, %x, %p\n", iface, Flags, ppEnumNetwork ); + return E_NOTIMPL; +} + +static HRESULT WINAPI list_manager_GetNetwork( + INetworkListManager *iface, + GUID gdNetworkId, + INetwork **ppNetwork ) +{ + FIXME( "%p, %s, %p\n", iface, debugstr_guid(&gdNetworkId), ppNetwork ); + return E_NOTIMPL; +} + +static HRESULT WINAPI list_manager_GetNetworkConnections( + INetworkListManager *iface, + IEnumNetworkConnections **ppEnum ) +{ + FIXME( "%p, %p\n", iface, ppEnum ); + return E_NOTIMPL; +} + +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; +} + +static HRESULT WINAPI list_manager_IsConnectedToInternet( + INetworkListManager *iface, + VARIANT_BOOL *pbIsConnected ) +{ + FIXME( "%p, %p\n", iface, pbIsConnected ); + + *pbIsConnected = VARIANT_TRUE; + return S_OK; +} + +static HRESULT WINAPI list_manager_IsConnected( + INetworkListManager *iface, + VARIANT_BOOL *pbIsConnected ) +{ + FIXME( "%p, %p\n", iface, pbIsConnected ); + + *pbIsConnected = VARIANT_TRUE; + return S_OK; +} + +static HRESULT WINAPI list_manager_GetConnectivity( + INetworkListManager *iface, + NLM_CONNECTIVITY *pConnectivity ) +{ + FIXME( "%p, %p\n", iface, pConnectivity ); + + *pConnectivity = NLM_CONNECTIVITY_IPV4_INTERNET; + return S_OK; +} + +static const INetworkListManagerVtbl list_manager_vtbl = +{ + list_manager_QueryInterface, + list_manager_AddRef, + list_manager_Release, + list_manager_GetTypeInfoCount, + list_manager_GetTypeInfo, + list_manager_GetIDsOfNames, + list_manager_Invoke, + list_manager_GetNetworks, + list_manager_GetNetwork, + list_manager_GetNetworkConnections, + list_manager_GetNetworkConnection, + list_manager_IsConnectedToInternet, + list_manager_IsConnected, + list_manager_GetConnectivity +}; + +HRESULT list_manager_create( void **obj ) +{ + struct list_manager *mgr; + + TRACE( "%p\n", obj ); + + if (!(mgr = HeapAlloc( GetProcessHeap(), 0, sizeof(*mgr) ))) return E_OUTOFMEMORY; + mgr->INetworkListManager_iface.lpVtbl = &list_manager_vtbl; + mgr->INetworkCostManager_iface.lpVtbl = &cost_manager_vtbl; + mgr->refs = 1; + + *obj = &mgr->INetworkListManager_iface; + TRACE( "returning iface %p\n", *obj ); + return S_OK; +} diff -Nru wine1.7-1.7.14/dlls/netprofm/main.c wine1.7-1.7.18/dlls/netprofm/main.c --- wine1.7-1.7.14/dlls/netprofm/main.c 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.18/dlls/netprofm/main.c 2014-05-02 18:15:48.000000000 +0000 @@ -0,0 +1,159 @@ +/* + * Copyright 2014 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 "config.h" +#include +#include "windef.h" +#include "winbase.h" +#define COBJMACROS +#include "objbase.h" +#include "rpcproxy.h" +#include "netlistmgr.h" + +#include "wine/debug.h" +#include "netprofm_private.h" + +WINE_DEFAULT_DEBUG_CHANNEL(netprofm); + +static HINSTANCE instance; + +BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved ) +{ + switch (reason) + { + case DLL_WINE_PREATTACH: + return FALSE; /* prefer native version */ + case DLL_PROCESS_ATTACH: + instance = hinst; + DisableThreadLibraryCalls( hinst ); + break; + } + return TRUE; +} + +struct netprofm_cf +{ + IClassFactory IClassFactory_iface; + HRESULT (*create_instance)(void **); +}; + +static inline struct netprofm_cf *impl_from_IClassFactory( IClassFactory *iface ) +{ + return CONTAINING_RECORD( iface, struct netprofm_cf, IClassFactory_iface ); +} + +static HRESULT WINAPI netprofm_cf_QueryInterface( IClassFactory *iface, REFIID riid, LPVOID *ppobj ) +{ + if (IsEqualGUID( riid, &IID_IUnknown ) || IsEqualGUID( riid, &IID_IClassFactory )) + { + IClassFactory_AddRef( iface ); + *ppobj = iface; + return S_OK; + } + FIXME( "interface %s not implemented\n", debugstr_guid(riid) ); + return E_NOINTERFACE; +} + +static ULONG WINAPI netprofm_cf_AddRef( IClassFactory *iface ) +{ + return 2; +} + +static ULONG WINAPI netprofm_cf_Release( IClassFactory *iface ) +{ + return 1; +} + +static HRESULT WINAPI netprofm_cf_CreateInstance( IClassFactory *iface, LPUNKNOWN outer, + REFIID riid, LPVOID *obj ) +{ + struct netprofm_cf *factory = impl_from_IClassFactory( iface ); + IUnknown *unk; + HRESULT r; + + TRACE( "%p %s %p\n", outer, debugstr_guid(riid), obj ); + + *obj = NULL; + if (outer) return CLASS_E_NOAGGREGATION; + + r = factory->create_instance( (void **)&unk ); + if (FAILED( r )) + return r; + + r = IUnknown_QueryInterface( unk, riid, obj ); + IUnknown_Release( unk ); + return r; +} + +static HRESULT WINAPI netprofm_cf_LockServer( IClassFactory *iface, BOOL dolock ) +{ + FIXME( "%p, %d\n", iface, dolock ); + return S_OK; +} + +static const struct IClassFactoryVtbl netprofm_cf_vtbl = +{ + netprofm_cf_QueryInterface, + netprofm_cf_AddRef, + netprofm_cf_Release, + netprofm_cf_CreateInstance, + netprofm_cf_LockServer +}; + +static struct netprofm_cf list_manager_cf = { { &netprofm_cf_vtbl }, list_manager_create }; + +/*********************************************************************** + * DllGetClassObject (NETPROFM.@) + */ +HRESULT WINAPI DllGetClassObject( REFCLSID rclsid, REFIID iid, LPVOID *ppv ) +{ + IClassFactory *cf = NULL; + + TRACE("%s %s %p\n", debugstr_guid(rclsid), debugstr_guid(iid), ppv); + + if (IsEqualGUID( rclsid, &CLSID_NetworkListManager )) + { + cf = &list_manager_cf.IClassFactory_iface; + } + if (!cf) return CLASS_E_CLASSNOTAVAILABLE; + return IClassFactory_QueryInterface( cf, iid, ppv ); +} + +/*********************************************************************** + * DllCanUnloadNow (NETPROFM.@) + */ +HRESULT WINAPI DllCanUnloadNow( void ) +{ + return S_FALSE; +} + +/*********************************************************************** + * DllRegisterServer (NETPROFM.@) + */ +HRESULT WINAPI DllRegisterServer( void ) +{ + return __wine_register_resources( instance ); +} + +/*********************************************************************** + * DllUnregisterServer (NETPROFM.@) + */ +HRESULT WINAPI DllUnregisterServer( void ) +{ + return __wine_unregister_resources( instance ); +} diff -Nru wine1.7-1.7.14/dlls/netprofm/Makefile.in wine1.7-1.7.18/dlls/netprofm/Makefile.in --- wine1.7-1.7.14/dlls/netprofm/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.18/dlls/netprofm/Makefile.in 2014-05-02 18:15:48.000000000 +0000 @@ -0,0 +1,7 @@ +MODULE = netprofm.dll + +C_SRCS = \ + list.c \ + main.c + +IDL_SRCS = netprofm.idl diff -Nru wine1.7-1.7.14/dlls/netprofm/netprofm.idl wine1.7-1.7.18/dlls/netprofm/netprofm.idl --- wine1.7-1.7.14/dlls/netprofm/netprofm.idl 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.18/dlls/netprofm/netprofm.idl 2014-05-02 18:15:48.000000000 +0000 @@ -0,0 +1,23 @@ +/* + * COM Classes for netprofm + * + * Copyright 2014 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 + */ + +#pragma makedep register + +#include "netlistmgr.idl" diff -Nru wine1.7-1.7.14/dlls/netprofm/netprofm_private.h wine1.7-1.7.18/dlls/netprofm/netprofm_private.h --- wine1.7-1.7.14/dlls/netprofm/netprofm_private.h 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.18/dlls/netprofm/netprofm_private.h 2014-05-02 18:15:48.000000000 +0000 @@ -0,0 +1,19 @@ +/* + * Copyright 2014 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 + */ + +HRESULT list_manager_create(void **) DECLSPEC_HIDDEN; diff -Nru wine1.7-1.7.14/dlls/netprofm/netprofm.spec wine1.7-1.7.18/dlls/netprofm/netprofm.spec --- wine1.7-1.7.14/dlls/netprofm/netprofm.spec 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.18/dlls/netprofm/netprofm.spec 2014-05-02 18:15:48.000000000 +0000 @@ -0,0 +1,4 @@ +@ stdcall -private DllCanUnloadNow() +@ stdcall -private DllGetClassObject(ptr ptr ptr) +@ stdcall -private DllRegisterServer() +@ stdcall -private DllUnregisterServer() diff -Nru wine1.7-1.7.14/dlls/netprofm/tests/list.c wine1.7-1.7.18/dlls/netprofm/tests/list.c --- wine1.7-1.7.14/dlls/netprofm/tests/list.c 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.18/dlls/netprofm/tests/list.c 2014-05-02 18:15:48.000000000 +0000 @@ -0,0 +1,85 @@ +/* + * Copyright 2014 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" +#define COBJMACROS +#include "initguid.h" +#include "objbase.h" +#include "netlistmgr.h" +#include "wine/test.h" + +static void test_INetworkListManager( void ) +{ + INetworkListManager *mgr; + INetworkCostManager *cost_mgr; + NLM_CONNECTIVITY connectivity; + VARIANT_BOOL connected; + HRESULT hr; + + hr = CoCreateInstance( &CLSID_NetworkListManager, NULL, CLSCTX_INPROC_SERVER, + &IID_INetworkListManager, (void **)&mgr ); + if (hr != S_OK) + { + win_skip( "can't create instance of NetworkListManager\n" ); + return; + } + + connectivity = 0xdeadbeef; + hr = INetworkListManager_GetConnectivity( mgr, &connectivity ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( connectivity != 0xdeadbeef, "unchanged value\n" ); + trace( "GetConnectivity: %08x\n", connectivity ); + + connected = 0xdead; + hr = INetworkListManager_IsConnected( mgr, &connected ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( connected == VARIANT_TRUE || connected == VARIANT_FALSE, "expected boolean value\n" ); + + connected = 0xdead; + hr = INetworkListManager_IsConnectedToInternet( mgr, &connected ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( connected == VARIANT_TRUE || connected == VARIANT_FALSE, "expected boolean value\n" ); + + /* INetworkCostManager is supported starting Win8 */ + 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) + { + DWORD cost; + + hr = INetworkCostManager_GetCost( cost_mgr, NULL, NULL ); + ok( hr == E_POINTER, "got %08x\n", hr ); + + cost = 0xdeadbeef; + hr = INetworkCostManager_GetCost( cost_mgr, &cost, NULL ); + ok( hr == S_OK, "got %08x\n", hr ); + ok( cost != 0xdeadbeef, "cost not set\n" ); + + INetworkCostManager_Release( cost_mgr ); + } + + INetworkListManager_Release( mgr ); +} + +START_TEST( list ) +{ + CoInitialize( NULL ); + test_INetworkListManager(); + CoUninitialize(); +} diff -Nru wine1.7-1.7.14/dlls/netprofm/tests/Makefile.in wine1.7-1.7.18/dlls/netprofm/tests/Makefile.in --- wine1.7-1.7.14/dlls/netprofm/tests/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.18/dlls/netprofm/tests/Makefile.in 2014-05-02 18:15:48.000000000 +0000 @@ -0,0 +1,5 @@ +TESTDLL = netprofm.dll +IMPORTS = ole32 + +C_SRCS = \ + list.c diff -Nru wine1.7-1.7.14/dlls/ntdll/directory.c wine1.7-1.7.18/dlls/ntdll/directory.c --- wine1.7-1.7.14/dlls/ntdll/directory.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/ntdll/directory.c 2014-05-02 18:15:48.000000000 +0000 @@ -365,6 +365,107 @@ return ret; } +#ifdef __ANDROID__ + +static char *unescape_field( char *str ) +{ + char *in, *out; + + for (in = out = str; *in; in++, out++) + { + *out = *in; + if (in[0] == '\\') + { + if (in[1] == '\\') + { + out[0] = '\\'; + in++; + } + else if (in[1] == '0' && in[2] == '4' && in[3] == '0') + { + out[0] = ' '; + in += 3; + } + else if (in[1] == '0' && in[2] == '1' && in[3] == '1') + { + out[0] = '\t'; + in += 3; + } + else if (in[1] == '0' && in[2] == '1' && in[3] == '2') + { + out[0] = '\n'; + in += 3; + } + else if (in[1] == '1' && in[2] == '3' && in[3] == '4') + { + out[0] = '\\'; + in += 3; + } + } + } + *out = '\0'; + + return str; +} + +static inline char *get_field( char **str ) +{ + char *ret; + + ret = strsep( str, " \t" ); + if (*str) *str += strspn( *str, " \t" ); + + return ret; +} +/************************************************************************ + * getmntent_replacement + * + * getmntent replacement for Android. + * + * NB returned static buffer is not thread safe; protect with dir_section. + */ +static struct mntent *getmntent_replacement( FILE *f ) +{ + static struct mntent entry; + static char buf[4096]; + char *p, *start; + + do + { + if (!fgets( buf, sizeof(buf), f )) return NULL; + p = strchr( buf, '\n' ); + if (p) *p = '\0'; + else /* Partially unread line, move file ptr to end */ + { + char tmp[1024]; + while (fgets( tmp, sizeof(tmp), f )) + if (strchr( tmp, '\n' )) break; + } + start = buf + strspn( buf, " \t" ); + } while (start[0] == '\0' || start[0] == '#'); + + p = get_field( &start ); + entry.mnt_fsname = p ? unescape_field( p ) : (char *)""; + + p = get_field( &start ); + entry.mnt_dir = p ? unescape_field( p ) : (char *)""; + + p = get_field( &start ); + entry.mnt_type = p ? unescape_field( p ) : (char *)""; + + p = get_field( &start ); + entry.mnt_opts = p ? unescape_field( p ) : (char *)""; + + p = get_field( &start ); + entry.mnt_freq = p ? atoi(p) : 0; + + p = get_field( &start ); + entry.mnt_passno = p ? atoi(p) : 0; + + return &entry; +} +#define getmntent getmntent_replacement +#endif /*********************************************************************** * DIR_get_drives_info @@ -584,6 +685,13 @@ RtlEnterCriticalSection( &dir_section ); +#ifdef __ANDROID__ + if ((f = fopen( "/proc/mounts", "r" ))) + { + device = parse_mount_entries( f, st.st_dev, st.st_ino ); + fclose( f ); + } +#else if ((f = fopen( "/etc/mtab", "r" ))) { device = parse_mount_entries( f, st.st_dev, st.st_ino ); @@ -595,6 +703,7 @@ device = parse_mount_entries( f, st.st_dev, st.st_ino ); fclose( f ); } +#endif if (device) { ret = RtlAllocateHeap( GetProcessHeap(), 0, strlen(device) + 1 ); @@ -726,7 +835,11 @@ RtlEnterCriticalSection( &dir_section ); +#ifdef __ANDROID__ + if ((f = fopen( "/proc/mounts", "r" ))) +#else if ((f = fopen( "/etc/mtab", "r" ))) +#endif { struct mntent *entry; struct stat st; diff -Nru wine1.7-1.7.14/dlls/ntdll/heap.c wine1.7-1.7.18/dlls/ntdll/heap.c --- wine1.7-1.7.14/dlls/ntdll/heap.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/ntdll/heap.c 2014-05-02 18:15:48.000000000 +0000 @@ -879,7 +879,7 @@ commitSize = min( totalSize, (commitSize + COMMIT_MASK) & ~COMMIT_MASK ); /* allocate the memory block */ - if (NtAllocateVirtualMemory( NtCurrentProcess(), &address, 5, &totalSize, + if (NtAllocateVirtualMemory( NtCurrentProcess(), &address, 0, &totalSize, MEM_RESERVE, get_protection_type( flags ) )) { WARN("Could not allocate %08lx bytes\n", totalSize ); diff -Nru wine1.7-1.7.14/dlls/ntdll/ntdll.spec wine1.7-1.7.18/dlls/ntdll/ntdll.spec --- wine1.7-1.7.14/dlls/ntdll/ntdll.spec 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/ntdll/ntdll.spec 2014-05-02 18:15:48.000000000 +0000 @@ -689,6 +689,7 @@ # @ stub RtlInitializeStackTraceDataBase @ stub RtlInsertElementGenericTable # @ stub RtlInsertElementGenericTableAvl +@ cdecl -arch=x86_64 RtlInstallFunctionTableCallback(long long long ptr ptr wstr) @ stdcall RtlInt64ToUnicodeString(int64 long ptr) @ stdcall RtlIntegerToChar(long long long ptr) @ stdcall RtlIntegerToUnicodeString(long long ptr) @@ -797,6 +798,7 @@ @ stub RtlQuerySecurityObject @ stub RtlQueryTagHeap @ stdcall RtlQueryTimeZoneInformation(ptr) +@ stdcall RtlQueryUnbiasedInterruptTime(ptr) @ stub RtlQueueApcWow64Thread @ stdcall RtlQueueWorkItem(ptr ptr long) @ stdcall -register RtlRaiseException(ptr) diff -Nru wine1.7-1.7.14/dlls/ntdll/signal_i386.c wine1.7-1.7.18/dlls/ntdll/signal_i386.c --- wine1.7-1.7.14/dlls/ntdll/signal_i386.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/ntdll/signal_i386.c 2014-05-02 18:15:48.000000000 +0000 @@ -1868,9 +1868,10 @@ if( !(context->EFlags & 0x100) || (ntdll_get_thread_data()->dr7 & 0xff) ) { /* (possible) hardware breakpoint, fetch the debug registers */ + DWORD saved_flags = context->ContextFlags; context->ContextFlags = CONTEXT_DEBUG_REGISTERS; NtGetContextThread(GetCurrentThread(), context); - context->ContextFlags |= CONTEXT_FULL; /* restore flags */ + context->ContextFlags |= saved_flags; /* restore flags */ } context->EFlags &= ~0x100; /* clear single-step flag */ diff -Nru wine1.7-1.7.14/dlls/ntdll/signal_x86_64.c wine1.7-1.7.18/dlls/ntdll/signal_x86_64.c --- wine1.7-1.7.14/dlls/ntdll/signal_x86_64.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/ntdll/signal_x86_64.c 2014-05-02 18:15:48.000000000 +0000 @@ -56,6 +56,7 @@ #include "winternl.h" #include "wine/library.h" #include "wine/exception.h" +#include "wine/list.h" #include "ntdll_misc.h" #include "wine/debug.h" @@ -271,6 +272,37 @@ static wine_signal_handler handlers[256]; +/*********************************************************************** + * Dynamic unwind table + */ + +struct dynamic_unwind_entry +{ + struct list entry; + + /* memory region which matches this entry */ + DWORD64 base; + DWORD size; + + /* lookup table */ + RUNTIME_FUNCTION *table; + DWORD table_size; + + /* user defined callback */ + PGET_RUNTIME_FUNCTION_CALLBACK callback; + PVOID context; +}; + +static struct list dynamic_unwind_list = LIST_INIT(dynamic_unwind_list); + +static RTL_CRITICAL_SECTION dynamic_unwind_section; +static RTL_CRITICAL_SECTION_DEBUG dynamic_unwind_debug = +{ + 0, 0, &dynamic_unwind_section, + { &dynamic_unwind_debug.ProcessLocksList, &dynamic_unwind_debug.ProcessLocksList }, + 0, 0, { (DWORD_PTR)(__FILE__ ": dynamic_unwind_section") } +}; +static RTL_CRITICAL_SECTION dynamic_unwind_section = { &dynamic_unwind_debug, -1, 0, 0, 0, 0 }; /*********************************************************************** * Definitions for Win32 unwind tables @@ -1921,6 +1953,50 @@ return NULL; } +/********************************************************************** + * lookup_function_info + */ +static RUNTIME_FUNCTION *lookup_function_info( ULONG64 pc, ULONG64 *base, LDR_MODULE **module ) +{ + RUNTIME_FUNCTION *func = NULL; + struct dynamic_unwind_entry *entry; + ULONG size; + + /* PE module or wine module */ + if (!LdrFindEntryForAddress( (void *)pc, module )) + { + *base = (ULONG64)(*module)->BaseAddress; + if ((func = RtlImageDirectoryEntryToData( (*module)->BaseAddress, TRUE, + IMAGE_DIRECTORY_ENTRY_EXCEPTION, &size ))) + { + /* lookup in function table */ + func = find_function_info( pc, (*module)->BaseAddress, func, size ); + } + } + else + { + *module = NULL; + + RtlEnterCriticalSection( &dynamic_unwind_section ); + LIST_FOR_EACH_ENTRY( entry, &dynamic_unwind_list, struct dynamic_unwind_entry, entry ) + { + if (pc >= entry->base && pc < entry->base + entry->size) + { + *base = entry->base; + + /* use callback or lookup in function table */ + if (entry->callback) + func = entry->callback( pc, entry->context ); + else + func = find_function_info( pc, (HMODULE)entry->base, entry->table, entry->table_size ); + break; + } + } + RtlLeaveCriticalSection( &dynamic_unwind_section ); + } + + return func; +} /********************************************************************** * call_handler @@ -2002,7 +2078,6 @@ DISPATCHER_CONTEXT dispatch; CONTEXT context, new_context; LDR_MODULE *module; - DWORD size; NTSTATUS status; context = *orig_context; @@ -2016,31 +2091,17 @@ /* FIXME: should use the history table to make things faster */ - module = NULL; dispatch.ImageBase = 0; /* first look for PE exception information */ - if (!LdrFindEntryForAddress( (void *)context.Rip, &module )) + if ((dispatch.FunctionEntry = lookup_function_info( context.Rip, &dispatch.ImageBase, &module ))) { - RUNTIME_FUNCTION *dir; - - dispatch.ImageBase = (ULONG64)module->BaseAddress; - if ((dir = RtlImageDirectoryEntryToData( module->BaseAddress, TRUE, - IMAGE_DIRECTORY_ENTRY_EXCEPTION, &size ))) - { - if ((dispatch.FunctionEntry = find_function_info( context.Rip, module->BaseAddress, - dir, size ))) - { - dispatch.LanguageHandler = RtlVirtualUnwind( UNW_FLAG_EHANDLER, dispatch.ImageBase, - context.Rip, dispatch.FunctionEntry, - &new_context, &dispatch.HandlerData, - &dispatch.EstablisherFrame, NULL ); - goto unwind_done; - } - } - else if (!(module->Flags & LDR_WINE_INTERNAL)) - WARN( "exception data not found in %s\n", debugstr_w(module->BaseDllName.Buffer) ); + dispatch.LanguageHandler = RtlVirtualUnwind( UNW_FLAG_EHANDLER, dispatch.ImageBase, + context.Rip, dispatch.FunctionEntry, + &new_context, &dispatch.HandlerData, + &dispatch.EstablisherFrame, NULL ); + goto unwind_done; } /* then look for host system exception information */ @@ -2064,6 +2125,7 @@ goto unwind_done; } } + else WARN( "exception data not found in %s\n", debugstr_w(module->BaseDllName.Buffer) ); /* no exception information, treat as a leaf function */ @@ -2457,6 +2519,8 @@ arch_prctl( ARCH_SET_GS, teb ); #elif defined (__FreeBSD__) || defined (__FreeBSD_kernel__) amd64_set_gsbase( teb ); +#elif defined(__NetBSD__) + sysarch( X86_64_SET_GSBASE, &teb ); #else # error Please define setting %gs for your architecture #endif @@ -2518,7 +2582,62 @@ */ BOOLEAN CDECL RtlAddFunctionTable( RUNTIME_FUNCTION *table, DWORD count, DWORD64 addr ) { - FIXME( "%p %u %lx: stub\n", table, count, addr ); + struct dynamic_unwind_entry *entry; + + TRACE( "%p %u %lx\n", table, count, addr ); + + /* NOTE: Windows doesn't check if table is aligned or a NULL pointer */ + + entry = RtlAllocateHeap( GetProcessHeap(), 0, sizeof(*entry) ); + if (!entry) + return FALSE; + + entry->base = addr; + entry->size = table[count - 1].EndAddress; + entry->table = table; + entry->table_size = count * sizeof(RUNTIME_FUNCTION); + entry->callback = NULL; + entry->context = NULL; + + RtlEnterCriticalSection( &dynamic_unwind_section ); + list_add_tail( &dynamic_unwind_list, &entry->entry ); + RtlLeaveCriticalSection( &dynamic_unwind_section ); + + return TRUE; +} + + +/********************************************************************** + * RtlInstallFunctionTableCallback (NTDLL.@) + */ +BOOLEAN CDECL RtlInstallFunctionTableCallback( DWORD64 table, DWORD64 base, DWORD length, + PGET_RUNTIME_FUNCTION_CALLBACK callback, PVOID context, PCWSTR dll ) +{ + struct dynamic_unwind_entry *entry; + + TRACE( "%lx %lx %d %p %p %s\n", table, base, length, callback, context, wine_dbgstr_w(dll) ); + + /* NOTE: Windows doesn't check if the provided callback is a NULL pointer */ + + /* both low-order bits must be set */ + if ((table & 0x3) != 0x3) + return FALSE; + + entry = RtlAllocateHeap( GetProcessHeap(), 0, sizeof(*entry) ); + if (!entry) + return FALSE; + + entry->base = base; + entry->size = length; + entry->table = (RUNTIME_FUNCTION *)table; + entry->table_size = 0; + entry->callback = callback; + entry->context = context; + + RtlEnterCriticalSection( &dynamic_unwind_section ); + list_add_tail( &dynamic_unwind_list, &entry->entry ); + RtlLeaveCriticalSection( &dynamic_unwind_section ); + return TRUE; } @@ -2528,7 +2647,26 @@ */ BOOLEAN CDECL RtlDeleteFunctionTable( RUNTIME_FUNCTION *table ) { - FIXME( "%p: stub\n", table ); + struct dynamic_unwind_entry *entry, *to_free = NULL; + + TRACE( "%p\n", table ); + + RtlEnterCriticalSection( &dynamic_unwind_section ); + LIST_FOR_EACH_ENTRY( entry, &dynamic_unwind_list, struct dynamic_unwind_entry, entry ) + { + if (entry->table == table) + { + to_free = entry; + list_remove( &entry->entry ); + break; + } + } + RtlLeaveCriticalSection( &dynamic_unwind_section ); + + if (!to_free) + return FALSE; + + RtlFreeHeap( GetProcessHeap(), 0, to_free ); return TRUE; } @@ -2540,23 +2678,18 @@ { LDR_MODULE *module; RUNTIME_FUNCTION *func; - ULONG size; /* FIXME: should use the history table to make things faster */ - if (LdrFindEntryForAddress( (void *)pc, &module )) - { - WARN( "module not found for %lx\n", pc ); - return NULL; - } - if (!(func = RtlImageDirectoryEntryToData( module->BaseAddress, TRUE, - IMAGE_DIRECTORY_ENTRY_EXCEPTION, &size ))) + func = lookup_function_info( pc, base, &module ); + if (!func) { - WARN( "no exception table found in module %p pc %lx\n", module->BaseAddress, pc ); - return NULL; + if (module) + WARN( "no exception table found in module %p pc %lx\n", module->BaseAddress, pc ); + else + WARN( "module not found for %lx\n", pc ); } - func = find_function_info( pc, module->BaseAddress, func, size ); - if (func) *base = (ULONG64)module->BaseAddress; + return func; } @@ -2916,7 +3049,7 @@ CONTEXT new_context; LDR_MODULE *module; NTSTATUS status; - DWORD i, size; + DWORD i; RtlCaptureContext( context ); new_context = *context; @@ -2956,32 +3089,18 @@ { /* FIXME: should use the history table to make things faster */ - module = NULL; dispatch.ImageBase = 0; dispatch.ScopeIndex = 0; /* FIXME */ /* first look for PE exception information */ - if (!LdrFindEntryForAddress( (void *)context->Rip, &module )) + if ((dispatch.FunctionEntry = lookup_function_info( context->Rip, &dispatch.ImageBase, &module ))) { - RUNTIME_FUNCTION *dir; - - dispatch.ImageBase = (ULONG64)module->BaseAddress; - if ((dir = RtlImageDirectoryEntryToData( module->BaseAddress, TRUE, - IMAGE_DIRECTORY_ENTRY_EXCEPTION, &size ))) - { - if ((dispatch.FunctionEntry = find_function_info( context->Rip, module->BaseAddress, - dir, size ))) - { - dispatch.LanguageHandler = RtlVirtualUnwind( UNW_FLAG_UHANDLER, dispatch.ImageBase, - context->Rip, dispatch.FunctionEntry, - &new_context, &dispatch.HandlerData, - &dispatch.EstablisherFrame, NULL ); - goto unwind_done; - } - } - else if (!(module->Flags & LDR_WINE_INTERNAL)) - WARN( "exception data not found in %s\n", debugstr_w(module->BaseDllName.Buffer) ); + dispatch.LanguageHandler = RtlVirtualUnwind( UNW_FLAG_UHANDLER, dispatch.ImageBase, + context->Rip, dispatch.FunctionEntry, + &new_context, &dispatch.HandlerData, + &dispatch.EstablisherFrame, NULL ); + goto unwind_done; } /* then look for host system exception information */ @@ -3005,6 +3124,7 @@ goto unwind_done; } } + else WARN( "exception data not found in %s\n", debugstr_w(module->BaseDllName.Buffer) ); /* no exception information, treat as a leaf function */ diff -Nru wine1.7-1.7.14/dlls/ntdll/tests/exception.c wine1.7-1.7.18/dlls/ntdll/tests/exception.c --- wine1.7-1.7.14/dlls/ntdll/tests/exception.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/ntdll/tests/exception.c 2014-05-02 18:15:48.000000000 +0000 @@ -51,6 +51,13 @@ static NTSTATUS (WINAPI *pNtSetInformationProcess)(HANDLE, PROCESSINFOCLASS, PVOID, ULONG); static BOOL (WINAPI *pIsWow64Process)(HANDLE, PBOOL); +#if defined(__x86_64__) +static BOOLEAN (CDECL *pRtlAddFunctionTable)(RUNTIME_FUNCTION*, DWORD, DWORD64); +static BOOLEAN (CDECL *pRtlDeleteFunctionTable)(RUNTIME_FUNCTION*); +static BOOLEAN (CDECL *pRtlInstallFunctionTableCallback)(DWORD64, DWORD64, DWORD, PGET_RUNTIME_FUNCTION_CALLBACK, PVOID, PCWSTR); +static PRUNTIME_FUNCTION (WINAPI *pRtlLookupFunctionEntry)(ULONG64, ULONG64*, UNWIND_HISTORY_TABLE*); +#endif + #ifdef __i386__ #ifndef __WINE_WINTRNL_H @@ -1447,6 +1454,122 @@ call_virtual_unwind( i, &tests[i] ); } +static RUNTIME_FUNCTION* CALLBACK dynamic_unwind_callback( DWORD64 pc, PVOID context ) +{ + static const int code_offset = 1024; + static RUNTIME_FUNCTION runtime_func; + (*(DWORD *)context)++; + + runtime_func.BeginAddress = code_offset + 16; + runtime_func.EndAddress = code_offset + 32; + runtime_func.UnwindData = 0; + return &runtime_func; +} + +static void test_dynamic_unwind(void) +{ + static const int code_offset = 1024; + char buf[sizeof(RUNTIME_FUNCTION) + 4]; + RUNTIME_FUNCTION *runtime_func, *func; + ULONG_PTR table, base; + DWORD count; + + /* Test RtlAddFunctionTable with aligned RUNTIME_FUNCTION pointer */ + runtime_func = (RUNTIME_FUNCTION *)buf; + runtime_func->BeginAddress = code_offset; + runtime_func->EndAddress = code_offset + 16; + runtime_func->UnwindData = 0; + ok( pRtlAddFunctionTable( runtime_func, 1, (ULONG_PTR)code_mem ), + "RtlAddFunctionTable failed for runtime_func = %p (aligned)\n", runtime_func ); + + /* Lookup function outside of any function table */ + base = 0xdeadbeef; + func = pRtlLookupFunctionEntry( (ULONG_PTR)code_mem + code_offset + 16, &base, NULL ); + ok( func == NULL, + "RtlLookupFunctionEntry returned unexpected function, expected: NULL, got: %p\n", func ); + ok( base == 0xdeadbeef, + "RtlLookupFunctionEntry modified base address, expected: 0xdeadbeef, got: %lx\n", base ); + + /* Test with pointer inside of our function */ + base = 0xdeadbeef; + func = pRtlLookupFunctionEntry( (ULONG_PTR)code_mem + code_offset + 8, &base, NULL ); + ok( func == runtime_func, + "RtlLookupFunctionEntry didn't return expected function, expected: %p, got: %p\n", runtime_func, func ); + ok( base == (ULONG_PTR)code_mem, + "RtlLookupFunctionEntry returned invalid base, expected: %lx, got: %lx\n", (ULONG_PTR)code_mem, base ); + + /* Test RtlDeleteFunctionTable */ + ok( pRtlDeleteFunctionTable( runtime_func ), + "RtlDeleteFunctionTable failed for runtime_func = %p (aligned)\n", runtime_func ); + ok( !pRtlDeleteFunctionTable( runtime_func ), + "RtlDeleteFunctionTable returned success for nonexistent table runtime_func = %p\n", runtime_func ); + + /* Unaligned RUNTIME_FUNCTION pointer */ + runtime_func = (RUNTIME_FUNCTION *)((ULONG_PTR)buf | 0x3); + runtime_func->BeginAddress = code_offset; + runtime_func->EndAddress = code_offset + 16; + runtime_func->UnwindData = 0; + ok( pRtlAddFunctionTable( runtime_func, 1, (ULONG_PTR)code_mem ), + "RtlAddFunctionTable failed for runtime_func = %p (unaligned)\n", runtime_func ); + ok( pRtlDeleteFunctionTable( runtime_func ), + "RtlDeleteFunctionTable failed for runtime_func = %p (unaligned)\n", runtime_func ); + + /* Attempt to insert the same entry twice */ + runtime_func = (RUNTIME_FUNCTION *)buf; + runtime_func->BeginAddress = code_offset; + runtime_func->EndAddress = code_offset + 16; + runtime_func->UnwindData = 0; + ok( pRtlAddFunctionTable( runtime_func, 1, (ULONG_PTR)code_mem ), + "RtlAddFunctionTable failed for runtime_func = %p (first attempt)\n", runtime_func ); + ok( pRtlAddFunctionTable( runtime_func, 1, (ULONG_PTR)code_mem ), + "RtlAddFunctionTable failed for runtime_func = %p (second attempt)\n", runtime_func ); + ok( pRtlDeleteFunctionTable( runtime_func ), + "RtlDeleteFunctionTable failed for runtime_func = %p (first attempt)\n", runtime_func ); + ok( pRtlDeleteFunctionTable( runtime_func ), + "RtlDeleteFunctionTable failed for runtime_func = %p (second attempt)\n", runtime_func ); + ok( !pRtlDeleteFunctionTable( runtime_func ), + "RtlDeleteFunctionTable returned success for nonexistent table runtime_func = %p\n", runtime_func ); + + /* Test RtlInstallFunctionTableCallback with both low bits unset */ + table = (ULONG_PTR)code_mem; + ok( !pRtlInstallFunctionTableCallback( table, (ULONG_PTR)code_mem, code_offset + 32, &dynamic_unwind_callback, (PVOID*)&count, NULL ), + "RtlInstallFunctionTableCallback returned success for table = %lx\n", table ); + + /* Test RtlInstallFunctionTableCallback with both low bits set */ + table = (ULONG_PTR)code_mem | 0x3; + ok( pRtlInstallFunctionTableCallback( table, (ULONG_PTR)code_mem, code_offset + 32, &dynamic_unwind_callback, (PVOID*)&count, NULL ), + "RtlInstallFunctionTableCallback failed for table = %lx\n", table ); + + /* Lookup function outside of any function table */ + count = 0; + base = 0xdeadbeef; + func = pRtlLookupFunctionEntry( (ULONG_PTR)code_mem + code_offset + 32, &base, NULL ); + ok( func == NULL, + "RtlLookupFunctionEntry returned unexpected function, expected: NULL, got: %p\n", func ); + ok( base == 0xdeadbeef, + "RtlLookupFunctionEntry modified base address, expected: 0xdeadbeef, got: %lx\n", base ); + ok( !count, + "RtlLookupFunctionEntry issued %d unexpected calls to dynamic_unwind_callback\n", count ); + + /* Test with pointer inside of our function */ + count = 0; + base = 0xdeadbeef; + func = pRtlLookupFunctionEntry( (ULONG_PTR)code_mem + code_offset + 24, &base, NULL ); + ok( func != NULL && func->BeginAddress == code_offset + 16 && func->EndAddress == code_offset + 32, + "RtlLookupFunctionEntry didn't return expected function, got: %p\n", func ); + ok( base == (ULONG_PTR)code_mem, + "RtlLookupFunctionEntry returned invalid base, expected: %lx, got: %lx\n", (ULONG_PTR)code_mem, base ); + ok( count == 1, + "RtlLookupFunctionEntry issued %d calls to dynamic_unwind_callback, expected: 1\n", count ); + + /* Clean up again */ + ok( pRtlDeleteFunctionTable( (PRUNTIME_FUNCTION)table ), + "RtlDeleteFunctionTable failed for table = %p\n", (PVOID)table ); + ok( !pRtlDeleteFunctionTable( (PRUNTIME_FUNCTION)table ), + "RtlDeleteFunctionTable returned success for nonexistent table = %p\n", (PVOID)table ); + +} + #endif /* __x86_64__ */ START_TEST(exception) @@ -1534,9 +1657,22 @@ test_dpe_exceptions(); #elif defined(__x86_64__) + pRtlAddFunctionTable = (void *)GetProcAddress( hntdll, + "RtlAddFunctionTable" ); + pRtlDeleteFunctionTable = (void *)GetProcAddress( hntdll, + "RtlDeleteFunctionTable" ); + pRtlInstallFunctionTableCallback = (void *)GetProcAddress( hntdll, + "RtlInstallFunctionTableCallback" ); + pRtlLookupFunctionEntry = (void *)GetProcAddress( hntdll, + "RtlLookupFunctionEntry" ); test_virtual_unwind(); + if (pRtlAddFunctionTable && pRtlDeleteFunctionTable && pRtlInstallFunctionTableCallback && pRtlLookupFunctionEntry) + test_dynamic_unwind(); + else + skip( "Dynamic unwind functions not found\n" ); + #endif VirtualFree(code_mem, 0, MEM_FREE); diff -Nru wine1.7-1.7.14/dlls/ntdll/tests/file.c wine1.7-1.7.18/dlls/ntdll/tests/file.c --- wine1.7-1.7.14/dlls/ntdll/tests/file.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/ntdll/tests/file.c 2014-05-02 18:15:48.000000000 +0000 @@ -2363,12 +2363,14 @@ offset.QuadPart = 0; status = pNtWriteFile(hfile, 0, NULL, NULL, &iob, contents, sizeof(contents), &offset, NULL); ok(status == STATUS_PENDING || status == STATUS_SUCCESS /* before Vista */, "expected STATUS_PENDING or STATUS_SUCCESS, got %#x\n", status); + if (status == STATUS_PENDING) + { + ret = WaitForSingleObject(hfile, 3000); + ok(ret == WAIT_OBJECT_0, "WaitForSingleObject error %d\n", ret); + } ok(U(iob).Status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#x\n", U(iob).Status); ok(iob.Information == sizeof(contents), "expected sizeof(contents), got %lu\n", iob.Information); - ret = WaitForSingleObject(hfile, 3000); - ok(ret == WAIT_OBJECT_0, "WaitForSingleObject error %d\n", ret); - off = SetFilePointer(hfile, 0, NULL, FILE_CURRENT); ok(off == 0, "expected 0, got %u\n", off); @@ -2501,6 +2503,8 @@ status = pNtReadFile(hfile, 0, NULL, NULL, &iob, buf, sizeof(buf), &offset, NULL); if (status == STATUS_PENDING) { + ret = WaitForSingleObject(hfile, 3000); + ok(ret == WAIT_OBJECT_0, "WaitForSingleObject error %d\n", ret); ok(U(iob).Status == STATUS_END_OF_FILE, "expected STATUS_END_OF_FILE, got %#x\n", U(iob).Status); ok(iob.Information == 0, "expected 0, got %lu\n", iob.Information); } @@ -2520,6 +2524,8 @@ status = pNtReadFile(hfile, 0, NULL, NULL, &iob, buf, 0, &offset, NULL); if (status == STATUS_PENDING) { + ret = WaitForSingleObject(hfile, 3000); + ok(ret == WAIT_OBJECT_0, "WaitForSingleObject error %d\n", ret); ok(U(iob).Status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#x\n", U(iob).Status); ok(iob.Information == 0, "expected 0, got %lu\n", iob.Information); } @@ -2574,31 +2580,33 @@ offset.QuadPart = (LONGLONG)-1 /* FILE_WRITE_TO_END_OF_FILE */; status = pNtWriteFile(hfile, 0, NULL, NULL, &iob, "DCBA", 4, &offset, NULL); ok(status == STATUS_PENDING || status == STATUS_SUCCESS /* before Vista */, "expected STATUS_PENDING or STATUS_SUCCESS, got %#x\n", status); + if (status == STATUS_PENDING) + { + ret = WaitForSingleObject(hfile, 3000); + ok(ret == WAIT_OBJECT_0, "WaitForSingleObject error %d\n", ret); + } ok(U(iob).Status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#x\n", U(iob).Status); ok(iob.Information == 4, "expected 4, got %lu\n", iob.Information); off = SetFilePointer(hfile, 0, NULL, FILE_CURRENT); ok(off == 0, "expected 0, got %u\n", off); - ret = WaitForSingleObject(hfile, 3000); - ok(ret == WAIT_OBJECT_0, "WaitForSingleObject error %d\n", ret); - - off = SetFilePointer(hfile, 0, NULL, FILE_CURRENT); - ok(off == 0, "expected 0, got %u\n", off); - U(iob).Status = -1; iob.Information = -1; offset.QuadPart = 0; status = pNtReadFile(hfile, 0, NULL, NULL, &iob, buf, sizeof(buf), &offset, NULL); ok(status == STATUS_PENDING || status == STATUS_SUCCESS, "expected STATUS_PENDING or STATUS_SUCCESS, got %#x\n", status); + if (status == STATUS_PENDING) + { + ret = WaitForSingleObject(hfile, 3000); + ok(ret == WAIT_OBJECT_0, "WaitForSingleObject error %d\n", ret); + } ok(U(iob).Status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %#x\n", U(iob).Status); ok(iob.Information == sizeof(contents), "expected sizeof(contents), got %lu\n", iob.Information); off = SetFilePointer(hfile, 0, NULL, FILE_CURRENT); ok(off == 0, "expected 0, got %u\n", off); - ret = WaitForSingleObject(hfile, 3000); - ok(ret == WAIT_OBJECT_0, "WaitForSingleObject error %d\n", ret); ok(!memcmp(contents, buf, sizeof(contents) - 4), "file contents mismatch\n"); ok(!memcmp(buf + sizeof(contents) - 4, "DCBA", 4), "file contents mismatch\n"); diff -Nru wine1.7-1.7.14/dlls/ntdll/tests/rtlstr.c wine1.7-1.7.18/dlls/ntdll/tests/rtlstr.c --- wine1.7-1.7.14/dlls/ntdll/tests/rtlstr.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/ntdll/tests/rtlstr.c 2014-05-02 18:15:48.000000000 +0000 @@ -68,6 +68,8 @@ static NTSTATUS (WINAPI *pRtlStringFromGUID)(const GUID*, UNICODE_STRING*); static BOOLEAN (WINAPI *pRtlIsTextUnicode)(LPVOID, INT, INT *); static NTSTATUS (WINAPI *pRtlHashUnicodeString)(PCUNICODE_STRING,BOOLEAN,ULONG,ULONG*); +static NTSTATUS (WINAPI *pRtlUnicodeToUTF8N)(CHAR *, ULONG, ULONG *, const WCHAR *, ULONG); +static NTSTATUS (WINAPI *pRtlUTF8ToUnicodeN)(WCHAR *, ULONG, ULONG *, const CHAR *, ULONG); /*static VOID (WINAPI *pRtlFreeOemString)(PSTRING);*/ /*static VOID (WINAPI *pRtlCopyUnicodeString)(UNICODE_STRING *, const UNICODE_STRING *);*/ @@ -137,6 +139,8 @@ pRtlStringFromGUID = (void *)GetProcAddress(hntdll, "RtlStringFromGUID"); pRtlIsTextUnicode = (void *)GetProcAddress(hntdll, "RtlIsTextUnicode"); pRtlHashUnicodeString = (void*)GetProcAddress(hntdll, "RtlHashUnicodeString"); + pRtlUnicodeToUTF8N = (void*)GetProcAddress(hntdll, "RtlUnicodeToUTF8N"); + pRtlUTF8ToUnicodeN = (void*)GetProcAddress(hntdll, "RtlUTF8ToUnicodeN"); } } @@ -1971,6 +1975,527 @@ } } +struct unicode_to_utf8_test { + WCHAR unicode[128]; + const char *expected; + NTSTATUS status; +}; + +static const struct unicode_to_utf8_test unicode_to_utf8[] = { + { { 0 }, "", STATUS_SUCCESS }, + { { '-',0 }, "-", STATUS_SUCCESS }, + { { 'h','e','l','l','o',0 }, "hello", STATUS_SUCCESS }, + { { '-',0x7f,'-',0x80,'-',0xff,'-',0x100,'-',0 }, "-\x7F-\xC2\x80-\xC3\xBF-\xC4\x80-", STATUS_SUCCESS }, + { { '-',0x7ff,'-',0x800,'-',0 }, "-\xDF\xBF-\xE0\xA0\x80-", STATUS_SUCCESS }, + { { '-',0xd7ff,'-',0xe000,'-',0 }, "-\xED\x9F\xBF-\xEE\x80\x80-", STATUS_SUCCESS }, + /* 0x10000 */ + { { '-',0xffff,'-',0xd800,0xdc00,'-',0 }, "-\xEF\xBF\xBF-\xF0\x90\x80\x80-", STATUS_SUCCESS }, + /* 0x103ff */ /* 0x10400 */ + { { '-',0xd800,0xdfff,'-',0xd801,0xdc00,'-',0 }, "-\xF0\x90\x8F\xBF-\xF0\x90\x90\x80-", STATUS_SUCCESS }, + /* 0x10ffff */ + { { '-',0xdbff,0xdfff,'-',0 }, "-\xF4\x8F\xBF\xBF-", STATUS_SUCCESS }, + /* standalone lead surrogates become 0xFFFD */ + { { '-',0xd800,'-',0xdbff,'-',0 }, "-\xEF\xBF\xBD-\xEF\xBF\xBD-", STATUS_SOME_NOT_MAPPED }, + /* standalone trail surrogates become 0xFFFD */ + { { '-',0xdc00,'-',0xdfff,'-',0 }, "-\xEF\xBF\xBD-\xEF\xBF\xBD-", STATUS_SOME_NOT_MAPPED }, + /* reverse surrogate pair */ + { { '-',0xdfff,0xdbff,'-',0 }, "-\xEF\xBF\xBD\xEF\xBF\xBD-", STATUS_SOME_NOT_MAPPED }, + /* byte order marks */ + { { '-',0xfeff,'-',0xfffe,'-',0 }, "-\xEF\xBB\xBF-\xEF\xBF\xBE-", STATUS_SUCCESS }, + { { 0xfeff,'-',0 }, "\xEF\xBB\xBF-", STATUS_SUCCESS }, + { { 0xfffe,'-',0 }, "\xEF\xBF\xBE-", STATUS_SUCCESS }, + /* invalid code point */ + { { 0xffff,'-',0 }, "\xEF\xBF\xBF-", STATUS_SUCCESS }, + /* canonically equivalent representations -- no normalization should happen */ + { { '-',0x1e09,'-',0 }, "-\xE1\xB8\x89-", STATUS_SUCCESS }, + { { '-',0x0107,0x0327,'-',0 }, "-\xC4\x87\xCC\xA7-", STATUS_SUCCESS }, + { { '-',0x00e7,0x0301,'-',0 }, "-\xC3\xA7\xCC\x81-", STATUS_SUCCESS }, + { { '-',0x0063,0x0327,0x0301,'-',0 }, "-\x63\xCC\xA7\xCC\x81-", STATUS_SUCCESS }, + { { '-',0x0063,0x0301,0x0327,'-',0 }, "-\x63\xCC\x81\xCC\xA7-", STATUS_SUCCESS }, +}; + +static void utf8_expect_(const unsigned char *out_string, ULONG buflen, ULONG out_bytes, + const WCHAR *in_string, ULONG in_bytes, + NTSTATUS expect_status, int line) +{ + NTSTATUS status; + ULONG bytes_out; + char buffer[128]; + unsigned char *buf = (unsigned char *)buffer; + unsigned int i; + + if (buflen == (ULONG)-1) + buflen = sizeof(buffer); + bytes_out = 0x55555555; + memset(buffer, 0x55, sizeof(buffer)); + status = pRtlUnicodeToUTF8N( + out_string ? buffer : NULL, buflen, &bytes_out, + in_string, in_bytes); + ok_(__FILE__, line)(status == expect_status, "status = 0x%x\n", status); + ok_(__FILE__, line)(bytes_out == out_bytes, "bytes_out = %u\n", bytes_out); + if (out_string) + { + for (i = 0; i < bytes_out; i++) + ok_(__FILE__, line)(buf[i] == out_string[i], + "buffer[%d] = 0x%x, expected 0x%x\n", + i, buf[i], out_string[i]); + for (; i < sizeof(buffer); i++) + ok_(__FILE__, line)(buf[i] == 0x55, + "buffer[%d] = 0x%x, expected 0x55\n", + i, buf[i]); + } +} +#define utf8_expect(out_string, buflen, out_bytes, in_string, in_bytes, expect_status) \ + utf8_expect_(out_string, buflen, out_bytes, in_string, in_bytes, expect_status, __LINE__) + +static void test_RtlUnicodeToUTF8N(void) +{ + NTSTATUS status; + ULONG bytes_out; + ULONG bytes_out_array[2]; + void * const invalid_pointer = (void *)0x8; + char buffer[128]; + const WCHAR empty_string[] = { 0 }; + const WCHAR test_string[] = { 'A',0,'a','b','c','d','e','f','g',0 }; + const WCHAR special_string[] = { 'X',0x80,0xd800,0 }; + const unsigned char special_expected[] = { 'X',0xc2,0x80,0xef,0xbf,0xbd,0 }; + unsigned int input_len; + const unsigned int test_count = sizeof(unicode_to_utf8) / sizeof(unicode_to_utf8[0]); + unsigned int i; + + if (!pRtlUnicodeToUTF8N) + { + skip("RtlUnicodeToUTF8N unavailable\n"); + return; + } + + /* show that bytes_out is really ULONG */ + memset(bytes_out_array, 0x55, sizeof(bytes_out_array)); + status = pRtlUnicodeToUTF8N(NULL, 0, bytes_out_array, empty_string, 0); + ok(status == STATUS_SUCCESS, "status = 0x%x\n", status); + ok(bytes_out_array[0] == 0x00000000, "Got 0x%x\n", bytes_out_array[0]); + ok(bytes_out_array[1] == 0x55555555, "Got 0x%x\n", bytes_out_array[1]); + + /* parameter checks */ + status = pRtlUnicodeToUTF8N(NULL, 0, NULL, NULL, 0); + ok(status == STATUS_INVALID_PARAMETER_4, "status = 0x%x\n", status); + + status = pRtlUnicodeToUTF8N(NULL, 0, NULL, empty_string, 0); + ok(status == STATUS_INVALID_PARAMETER, "status = 0x%x\n", status); + + bytes_out = 0x55555555; + status = pRtlUnicodeToUTF8N(NULL, 0, &bytes_out, NULL, 0); + ok(status == STATUS_INVALID_PARAMETER_4, "status = 0x%x\n", status); + ok(bytes_out == 0x55555555, "bytes_out = 0x%x\n", bytes_out); + + bytes_out = 0x55555555; + status = pRtlUnicodeToUTF8N(NULL, 0, &bytes_out, invalid_pointer, 0); + ok(status == STATUS_SUCCESS, "status = 0x%x\n", status); + ok(bytes_out == 0, "bytes_out = 0x%x\n", bytes_out); + + bytes_out = 0x55555555; + status = pRtlUnicodeToUTF8N(NULL, 0, &bytes_out, empty_string, 0); + ok(status == STATUS_SUCCESS, "status = 0x%x\n", status); + ok(bytes_out == 0, "bytes_out = 0x%x\n", bytes_out); + + bytes_out = 0x55555555; + status = pRtlUnicodeToUTF8N(NULL, 0, &bytes_out, test_string, 0); + ok(status == STATUS_SUCCESS, "status = 0x%x\n", status); + ok(bytes_out == 0, "bytes_out = 0x%x\n", bytes_out); + + bytes_out = 0x55555555; + status = pRtlUnicodeToUTF8N(NULL, 0, &bytes_out, empty_string, 1); + ok(status == STATUS_SUCCESS, "status = 0x%x\n", status); + ok(bytes_out == 0, "bytes_out = 0x%x\n", bytes_out); + + bytes_out = 0x55555555; + status = pRtlUnicodeToUTF8N(invalid_pointer, 0, &bytes_out, empty_string, 1); + ok(status == STATUS_INVALID_PARAMETER_5, "status = 0x%x\n", status); + ok(bytes_out == 0x55555555, "bytes_out = 0x%x\n", bytes_out); + + bytes_out = 0x55555555; + status = pRtlUnicodeToUTF8N(invalid_pointer, 8, &bytes_out, empty_string, 1); + ok(status == STATUS_INVALID_PARAMETER_5, "status = 0x%x\n", status); + ok(bytes_out == 0x55555555, "bytes_out = 0x%x\n", bytes_out); + + /* length output with special chars */ +#define length_expect(in_chars, out_bytes, expect_status) \ + utf8_expect_(NULL, 0, out_bytes, \ + special_string, in_chars * sizeof(WCHAR), \ + expect_status, __LINE__) + + length_expect(0, 0, STATUS_SUCCESS); + length_expect(1, 1, STATUS_SUCCESS); + length_expect(2, 3, STATUS_SUCCESS); + length_expect(3, 6, STATUS_SOME_NOT_MAPPED); + length_expect(4, 7, STATUS_SOME_NOT_MAPPED); +#undef length_expect + + /* output truncation */ +#define truncate_expect(buflen, out_bytes, expect_status) \ + utf8_expect_(special_expected, buflen, out_bytes, \ + special_string, sizeof(special_string), \ + expect_status, __LINE__) + + truncate_expect(0, 0, STATUS_BUFFER_TOO_SMALL); + truncate_expect(1, 1, STATUS_BUFFER_TOO_SMALL); + truncate_expect(2, 1, STATUS_BUFFER_TOO_SMALL); + truncate_expect(3, 3, STATUS_BUFFER_TOO_SMALL); + truncate_expect(4, 3, STATUS_BUFFER_TOO_SMALL); + truncate_expect(5, 3, STATUS_BUFFER_TOO_SMALL); + truncate_expect(6, 6, STATUS_BUFFER_TOO_SMALL); + truncate_expect(7, 7, STATUS_SOME_NOT_MAPPED); +#undef truncate_expect + + /* conversion behavior with varying input length */ + for (input_len = 0; input_len <= sizeof(test_string); input_len++) { + /* no output buffer, just length */ + utf8_expect(NULL, 0, input_len / sizeof(WCHAR), + test_string, input_len, STATUS_SUCCESS); + + /* write output */ + bytes_out = 0x55555555; + memset(buffer, 0x55, sizeof(buffer)); + status = pRtlUnicodeToUTF8N( + buffer, sizeof(buffer), &bytes_out, + test_string, input_len); + if (input_len % sizeof(WCHAR) == 0) { + ok(status == STATUS_SUCCESS, + "(len %u): status = 0x%x\n", input_len, status); + ok(bytes_out == input_len / sizeof(WCHAR), + "(len %u): bytes_out = 0x%x\n", input_len, bytes_out); + for (i = 0; i < bytes_out; i++) { + ok(buffer[i] == test_string[i], + "(len %u): buffer[%d] = 0x%x, expected 0x%x\n", + input_len, i, buffer[i], test_string[i]); + } + for (; i < sizeof(buffer); i++) { + ok(buffer[i] == 0x55, + "(len %u): buffer[%d] = 0x%x\n", input_len, i, buffer[i]); + } + } else { + ok(status == STATUS_INVALID_PARAMETER_5, + "(len %u): status = 0x%x\n", input_len, status); + ok(bytes_out == 0x55555555, + "(len %u): bytes_out = 0x%x\n", input_len, bytes_out); + for (i = 0; i < sizeof(buffer); i++) { + ok(buffer[i] == 0x55, + "(len %u): buffer[%d] = 0x%x\n", input_len, i, buffer[i]); + } + } + } + + /* test cases for special characters */ + for (i = 0; i < test_count; i++) { + bytes_out = 0x55555555; + memset(buffer, 0x55, sizeof(buffer)); + status = pRtlUnicodeToUTF8N( + buffer, sizeof(buffer), &bytes_out, + unicode_to_utf8[i].unicode, lstrlenW(unicode_to_utf8[i].unicode) * sizeof(WCHAR)); + ok(status == unicode_to_utf8[i].status, + "(test %d): status is 0x%x, expected 0x%x\n", + i, status, unicode_to_utf8[i].status); + ok(bytes_out == strlen(unicode_to_utf8[i].expected), + "(test %d): bytes_out is %u, expected %u\n", + i, bytes_out, lstrlenA(unicode_to_utf8[i].expected)); + ok(!memcmp(buffer, unicode_to_utf8[i].expected, bytes_out), + "(test %d): got \"%.*s\", expected \"%s\"\n", + i, bytes_out, buffer, unicode_to_utf8[i].expected); + ok(buffer[bytes_out] == 0x55, + "(test %d): behind string: 0x%x\n", i, buffer[bytes_out]); + + /* same test but include the null terminator */ + bytes_out = 0x55555555; + memset(buffer, 0x55, sizeof(buffer)); + status = pRtlUnicodeToUTF8N( + buffer, sizeof(buffer), &bytes_out, + unicode_to_utf8[i].unicode, (lstrlenW(unicode_to_utf8[i].unicode) + 1) * sizeof(WCHAR)); + ok(status == unicode_to_utf8[i].status, + "(test %d): status is 0x%x, expected 0x%x\n", + i, status, unicode_to_utf8[i].status); + ok(bytes_out == strlen(unicode_to_utf8[i].expected) + 1, + "(test %d): bytes_out is %u, expected %u\n", + i, bytes_out, lstrlenA(unicode_to_utf8[i].expected) + 1); + ok(!memcmp(buffer, unicode_to_utf8[i].expected, bytes_out), + "(test %d): got \"%.*s\", expected \"%s\"\n", + i, bytes_out, buffer, unicode_to_utf8[i].expected); + ok(buffer[bytes_out] == 0x55, + "(test %d): behind string: 0x%x\n", i, buffer[bytes_out]); + } +} + +struct utf8_to_unicode_test { + const char *utf8; + WCHAR expected[128]; + NTSTATUS status; +}; + +static const struct utf8_to_unicode_test utf8_to_unicode[] = { + { "", { 0 }, STATUS_SUCCESS }, + { "-", { '-',0 }, STATUS_SUCCESS }, + { "hello", { 'h','e','l','l','o',0 }, STATUS_SUCCESS }, + /* first and last of each range */ + { "-\x7F-\xC2\x80-\xC3\xBF-\xC4\x80-", { '-',0x7f,'-',0x80,'-',0xff,'-',0x100,'-',0 }, STATUS_SUCCESS }, + { "-\xDF\xBF-\xE0\xA0\x80-", { '-',0x7ff,'-',0x800,'-',0 }, STATUS_SUCCESS }, + { "-\xED\x9F\xBF-\xEE\x80\x80-", { '-',0xd7ff,'-',0xe000,'-',0 }, STATUS_SUCCESS }, + /* 0x10000 */ + { "-\xEF\xBF\xBF-\xF0\x90\x80\x80-", { '-',0xffff,'-',0xd800,0xdc00,'-',0 }, STATUS_SUCCESS }, + /* 0x103ff */ /* 0x10400 */ + { "-\xF0\x90\x8F\xBF-\xF0\x90\x90\x80-", { '-',0xd800,0xdfff,'-',0xd801,0xdc00,'-',0 }, STATUS_SUCCESS }, + /* 0x10ffff */ + { "-\xF4\x8F\xBF\xBF-", { '-',0xdbff,0xdfff,'-',0 }, STATUS_SUCCESS }, + /* standalone surrogate code points */ + /* 0xd800 */ /* 0xdbff */ + { "-\xED\xA0\x80-\xED\xAF\xBF-", { '-',0xfffd,0xfffd,'-',0xfffd,0xfffd,'-',0 }, STATUS_SOME_NOT_MAPPED }, + /* 0xdc00 */ /* 0xdfff */ + { "-\xED\xB0\x80-\xED\xBF\xBF-", { '-',0xfffd,0xfffd,'-',0xfffd,0xfffd,'-',0 }, STATUS_SOME_NOT_MAPPED }, + /* UTF-8 encoded surrogate pair */ + /* 0xdbff *//* 0xdfff */ + { "-\xED\xAF\xBF\xED\xBF\xBF-", { '-',0xfffd,0xfffd,0xfffd,0xfffd,'-',0 }, STATUS_SOME_NOT_MAPPED }, + /* reverse surrogate pair */ + /* 0xdfff *//* 0xdbff */ + { "-\xED\xBF\xBF\xED\xAF\xBF-", { '-',0xfffd,0xfffd,0xfffd,0xfffd,'-',0 }, STATUS_SOME_NOT_MAPPED }, + /* code points outside the UTF-16 range */ + /* 0x110000 */ + { "-\xF4\x90\x80\x80-", { '-',0xfffd,0xfffd,0xfffd,'-',0 }, STATUS_SOME_NOT_MAPPED }, + /* 0x1fffff */ + { "-\xF7\xBF\xBF\xBF-", { '-',0xfffd,0xfffd,0xfffd,0xfffd,'-',0 }, STATUS_SOME_NOT_MAPPED }, + /* 0x200000 */ + { "-\xFA\x80\x80\x80\x80-", { '-',0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,'-',0 }, STATUS_SOME_NOT_MAPPED }, + /* 0x3ffffff */ + { "-\xFB\xBF\xBF\xBF\xBF-", { '-',0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,'-',0 }, STATUS_SOME_NOT_MAPPED }, + /* 0x4000000 */ + { "-\xFC\x84\x80\x80\x80\x80-", { '-',0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,'-',0 }, STATUS_SOME_NOT_MAPPED }, + /* 0x7fffffff */ + { "-\xFD\xBF\xBF\xBF\xBF\xBF-", { '-',0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,'-',0 }, STATUS_SOME_NOT_MAPPED }, + /* overlong encodings of each length for -, NUL, and the highest possible value */ + { "-\xC0\xAD-\xC0\x80-\xC1\xBF-", { '-',0xfffd,0xfffd,'-',0xfffd,0xfffd,'-',0xfffd,0xfffd,'-',0 }, STATUS_SOME_NOT_MAPPED }, + { "-\xE0\x80\xAD-\xE0\x80\x80-\xE0\x9F\xBF-", { '-',0xfffd,0xfffd,'-',0xfffd,0xfffd,'-',0xfffd,0xfffd,'-',0 }, STATUS_SOME_NOT_MAPPED }, + { "-\xF0\x80\x80\xAD-", { '-',0xfffd,0xfffd,0xfffd,'-',0 }, STATUS_SOME_NOT_MAPPED }, + { "-\xF0\x80\x80\x80-", { '-',0xfffd,0xfffd,0xfffd,'-',0 }, STATUS_SOME_NOT_MAPPED }, + { "-\xF0\x8F\xBF\xBF-", { '-',0xfffd,0xfffd,0xfffd,'-',0 }, STATUS_SOME_NOT_MAPPED }, + { "-\xF8\x80\x80\x80\xAD-", { '-',0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,'-',0 }, STATUS_SOME_NOT_MAPPED }, + { "-\xF8\x80\x80\x80\x80-", { '-',0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,'-',0 }, STATUS_SOME_NOT_MAPPED }, + { "-\xF8\x87\xBF\xBF\xBF-", { '-',0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,'-',0 }, STATUS_SOME_NOT_MAPPED }, + { "-\xFC\x80\x80\x80\x80\xAD-", { '-',0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,'-',0 }, STATUS_SOME_NOT_MAPPED }, + { "-\xFC\x80\x80\x80\x80\x80-", { '-',0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,'-',0 }, STATUS_SOME_NOT_MAPPED }, + { "-\xFC\x83\xBF\xBF\xBF\xBF-", { '-',0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,'-',0 }, STATUS_SOME_NOT_MAPPED }, + /* invalid bytes */ + { "\xFE", { 0xfffd,0 }, STATUS_SOME_NOT_MAPPED }, + { "\xFF", { 0xfffd,0 }, STATUS_SOME_NOT_MAPPED }, + { "\xFE\xBF\xBF\xBF\xBF\xBF\xBF\xBF\xBF", { 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0 }, STATUS_SOME_NOT_MAPPED }, + { "\xFF\xBF\xBF\xBF\xBF\xBF\xBF\xBF\xBF", { 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0 }, STATUS_SOME_NOT_MAPPED }, + { "\xFF\x80\x80\x80\x80\x80\x80\x80\x80", { 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0 }, STATUS_SOME_NOT_MAPPED }, + { "\xFF\x40\x80\x80\x80\x80\x80\x80\x80", { 0xfffd,0x40,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,0 }, STATUS_SOME_NOT_MAPPED }, + /* lone continuation bytes */ + { "\x80", { 0xfffd,0 }, STATUS_SOME_NOT_MAPPED }, + { "\x80\x80", { 0xfffd,0xfffd,0 }, STATUS_SOME_NOT_MAPPED }, + { "\xBF", { 0xfffd,0 }, STATUS_SOME_NOT_MAPPED }, + { "\xBF\xBF", { 0xfffd,0xfffd,0 }, STATUS_SOME_NOT_MAPPED }, + /* incomplete sequences */ + { "\xC2-", { 0xfffd,'-',0 }, STATUS_SOME_NOT_MAPPED }, + { "\xE0\xA0-", { 0xfffd,'-',0 }, STATUS_SOME_NOT_MAPPED }, + { "\xF0\x90\x80-", { 0xfffd,'-',0 }, STATUS_SOME_NOT_MAPPED }, + { "\xF4\x8F\xBF-", { 0xfffd,'-',0 }, STATUS_SOME_NOT_MAPPED }, + { "\xFA\x80\x80\x80-", { 0xfffd,0xfffd,0xfffd,0xfffd,'-',0 }, STATUS_SOME_NOT_MAPPED }, + { "\xFC\x84\x80\x80\x80-", { 0xfffd,0xfffd,0xfffd,0xfffd,0xfffd,'-',0 }, STATUS_SOME_NOT_MAPPED }, + /* multibyte sequence followed by lone continuation byte */ + { "\xE0\xA0\x80\x80-", { 0x800,0xfffd,'-',0 }, STATUS_SOME_NOT_MAPPED }, + /* byte order marks */ + { "-\xEF\xBB\xBF-\xEF\xBF\xBE-", { '-',0xfeff,'-',0xfffe,'-',0 }, STATUS_SUCCESS }, + { "\xEF\xBB\xBF-", { 0xfeff,'-',0 }, STATUS_SUCCESS }, + { "\xEF\xBF\xBE-", { 0xfffe,'-',0 }, STATUS_SUCCESS }, + /* invalid code point */ + /* 0xffff */ + { "\xEF\xBF\xBF-", { 0xffff,'-',0 }, STATUS_SUCCESS }, + /* canonically equivalent representations -- no normalization should happen */ + { "-\xE1\xB8\x89-", { '-',0x1e09,'-',0 }, STATUS_SUCCESS }, + { "-\xC4\x87\xCC\xA7-", { '-',0x0107,0x0327,'-',0 }, STATUS_SUCCESS }, + { "-\xC3\xA7\xCC\x81-", { '-',0x00e7,0x0301,'-',0 }, STATUS_SUCCESS }, + { "-\x63\xCC\xA7\xCC\x81-", { '-',0x0063,0x0327,0x0301,'-',0 }, STATUS_SUCCESS }, + { "-\x63\xCC\x81\xCC\xA7-", { '-',0x0063,0x0301,0x0327,'-',0 }, STATUS_SUCCESS }, +}; + +static void unicode_expect_(const WCHAR *out_string, ULONG buflen, ULONG out_chars, + const char *in_string, ULONG in_chars, + NTSTATUS expect_status, int line) +{ + NTSTATUS status; + ULONG bytes_out; + WCHAR buffer[128]; + unsigned int i; + + if (buflen == (ULONG)-1) + buflen = sizeof(buffer); + bytes_out = 0x55555555; + memset(buffer, 0x55, sizeof(buffer)); + status = pRtlUTF8ToUnicodeN( + out_string ? buffer : NULL, buflen, &bytes_out, + in_string, in_chars); + ok_(__FILE__, line)(status == expect_status, "status = 0x%x\n", status); + ok_(__FILE__, line)(bytes_out == out_chars * sizeof(WCHAR), + "bytes_out = %u, expected %u\n", bytes_out, out_chars * (ULONG)sizeof(WCHAR)); + if (out_string) + { + for (i = 0; i < bytes_out / sizeof(WCHAR); i++) + ok_(__FILE__, line)(buffer[i] == out_string[i], + "buffer[%d] = 0x%x, expected 0x%x\n", + i, buffer[i], out_string[i]); + for (; i < sizeof(buffer) / sizeof(WCHAR); i++) + ok_(__FILE__, line)(buffer[i] == 0x5555, + "buffer[%d] = 0x%x, expected 0x5555\n", + i, buffer[i]); + } +} +#define unicode_expect(out_string, buflen, out_chars, in_string, in_chars, expect_status) \ + unicode_expect_(out_string, buflen, out_chars, in_string, in_chars, expect_status, __LINE__) + +static void test_RtlUTF8ToUnicodeN(void) +{ + NTSTATUS status; + ULONG bytes_out; + ULONG bytes_out_array[2]; + void * const invalid_pointer = (void *)0x8; + WCHAR buffer[128]; + const char empty_string[] = ""; + const char test_string[] = "A\0abcdefg"; + const WCHAR test_stringW[] = {'A',0,'a','b','c','d','e','f','g',0 }; + const char special_string[] = { 'X',0xc2,0x80,0xF0,0x90,0x80,0x80,0 }; + const WCHAR special_expected[] = { 'X',0x80,0xd800,0xdc00,0 }; + unsigned int input_len; + const unsigned int test_count = sizeof(utf8_to_unicode) / sizeof(utf8_to_unicode[0]); + unsigned int i; + + if (!pRtlUTF8ToUnicodeN) + { + skip("RtlUTF8ToUnicodeN unavailable\n"); + return; + } + + /* show that bytes_out is really ULONG */ + memset(bytes_out_array, 0x55, sizeof(bytes_out_array)); + status = pRtlUTF8ToUnicodeN(NULL, 0, bytes_out_array, empty_string, 0); + ok(status == STATUS_SUCCESS, "status = 0x%x\n", status); + ok(bytes_out_array[0] == 0x00000000, "Got 0x%x\n", bytes_out_array[0]); + ok(bytes_out_array[1] == 0x55555555, "Got 0x%x\n", bytes_out_array[1]); + + /* parameter checks */ + status = pRtlUTF8ToUnicodeN(NULL, 0, NULL, NULL, 0); + ok(status == STATUS_INVALID_PARAMETER_4, "status = 0x%x\n", status); + + status = pRtlUTF8ToUnicodeN(NULL, 0, NULL, empty_string, 0); + ok(status == STATUS_INVALID_PARAMETER, "status = 0x%x\n", status); + + bytes_out = 0x55555555; + status = pRtlUTF8ToUnicodeN(NULL, 0, &bytes_out, NULL, 0); + ok(status == STATUS_INVALID_PARAMETER_4, "status = 0x%x\n", status); + ok(bytes_out == 0x55555555, "bytes_out = 0x%x\n", bytes_out); + + bytes_out = 0x55555555; + status = pRtlUTF8ToUnicodeN(NULL, 0, &bytes_out, invalid_pointer, 0); + ok(status == STATUS_SUCCESS, "status = 0x%x\n", status); + ok(bytes_out == 0, "bytes_out = 0x%x\n", bytes_out); + + bytes_out = 0x55555555; + status = pRtlUTF8ToUnicodeN(NULL, 0, &bytes_out, empty_string, 0); + ok(status == STATUS_SUCCESS, "status = 0x%x\n", status); + ok(bytes_out == 0, "bytes_out = 0x%x\n", bytes_out); + + bytes_out = 0x55555555; + status = pRtlUTF8ToUnicodeN(NULL, 0, &bytes_out, test_string, 0); + ok(status == STATUS_SUCCESS, "status = 0x%x\n", status); + ok(bytes_out == 0, "bytes_out = 0x%x\n", bytes_out); + + bytes_out = 0x55555555; + status = pRtlUTF8ToUnicodeN(NULL, 0, &bytes_out, empty_string, 1); + ok(status == STATUS_SUCCESS, "status = 0x%x\n", status); + ok(bytes_out == sizeof(WCHAR), "bytes_out = 0x%x\n", bytes_out); + + /* length output with special chars */ +#define length_expect(in_chars, out_chars, expect_status) \ + unicode_expect_(NULL, 0, out_chars, special_string, in_chars, \ + expect_status, __LINE__) + + length_expect(0, 0, STATUS_SUCCESS); + length_expect(1, 1, STATUS_SUCCESS); + length_expect(2, 2, STATUS_SOME_NOT_MAPPED); + length_expect(3, 2, STATUS_SUCCESS); + length_expect(4, 3, STATUS_SOME_NOT_MAPPED); + length_expect(5, 3, STATUS_SOME_NOT_MAPPED); + length_expect(6, 3, STATUS_SOME_NOT_MAPPED); + length_expect(7, 4, STATUS_SUCCESS); + length_expect(8, 5, STATUS_SUCCESS); +#undef length_expect + + /* output truncation */ +#define truncate_expect(buflen, out_chars, expect_status) \ + unicode_expect_(special_expected, buflen, out_chars, \ + special_string, sizeof(special_string), \ + expect_status, __LINE__) + + truncate_expect( 0, 0, STATUS_BUFFER_TOO_SMALL); + truncate_expect( 1, 0, STATUS_BUFFER_TOO_SMALL); + truncate_expect( 2, 1, STATUS_BUFFER_TOO_SMALL); + truncate_expect( 3, 1, STATUS_BUFFER_TOO_SMALL); + truncate_expect( 4, 2, STATUS_BUFFER_TOO_SMALL); + truncate_expect( 5, 2, STATUS_BUFFER_TOO_SMALL); + truncate_expect( 6, 3, STATUS_BUFFER_TOO_SMALL); + truncate_expect( 7, 3, STATUS_BUFFER_TOO_SMALL); + truncate_expect( 8, 4, STATUS_BUFFER_TOO_SMALL); + truncate_expect( 9, 4, STATUS_BUFFER_TOO_SMALL); + truncate_expect(10, 5, STATUS_SUCCESS); +#undef truncate_expect + + /* conversion behavior with varying input length */ + for (input_len = 0; input_len <= sizeof(test_string); input_len++) { + /* no output buffer, just length */ + unicode_expect(NULL, 0, input_len, + test_string, input_len, STATUS_SUCCESS); + + /* write output */ + unicode_expect(test_stringW, -1, input_len, + test_string, input_len, STATUS_SUCCESS); + } + + /* test cases for special characters */ + for (i = 0; i < test_count; i++) { + bytes_out = 0x55555555; + memset(buffer, 0x55, sizeof(buffer)); + status = pRtlUTF8ToUnicodeN( + buffer, sizeof(buffer), &bytes_out, + utf8_to_unicode[i].utf8, strlen(utf8_to_unicode[i].utf8)); + ok(status == utf8_to_unicode[i].status, + "(test %d): status is 0x%x, expected 0x%x\n", + i, status, utf8_to_unicode[i].status); + ok(bytes_out == lstrlenW(utf8_to_unicode[i].expected) * sizeof(WCHAR), + "(test %d): bytes_out is %u, expected %u\n", + i, bytes_out, lstrlenW(utf8_to_unicode[i].expected) * (ULONG)sizeof(WCHAR)); + ok(!memcmp(buffer, utf8_to_unicode[i].expected, bytes_out), + "(test %d): got %s, expected %s\n", + i, wine_dbgstr_wn(buffer, bytes_out / sizeof(WCHAR)), wine_dbgstr_w(utf8_to_unicode[i].expected)); + ok(buffer[bytes_out] == 0x5555, + "(test %d): behind string: 0x%x\n", i, buffer[bytes_out]); + + /* same test but include the null terminator */ + bytes_out = 0x55555555; + memset(buffer, 0x55, sizeof(buffer)); + status = pRtlUTF8ToUnicodeN( + buffer, sizeof(buffer), &bytes_out, + utf8_to_unicode[i].utf8, strlen(utf8_to_unicode[i].utf8) + 1); + ok(status == utf8_to_unicode[i].status, + "(test %d): status is 0x%x, expected 0x%x\n", + i, status, utf8_to_unicode[i].status); + ok(bytes_out == (lstrlenW(utf8_to_unicode[i].expected) + 1) * sizeof(WCHAR), + "(test %d): bytes_out is %u, expected %u\n", + i, bytes_out, (lstrlenW(utf8_to_unicode[i].expected) + 1) * (ULONG)sizeof(WCHAR)); + ok(!memcmp(buffer, utf8_to_unicode[i].expected, bytes_out), + "(test %d): got %s, expected %s\n", + i, wine_dbgstr_wn(buffer, bytes_out / sizeof(WCHAR)), wine_dbgstr_w(utf8_to_unicode[i].expected)); + ok(buffer[bytes_out] == 0x5555, + "(test %d): behind string: 0x%x\n", i, buffer[bytes_out]); + } +} + START_TEST(rtlstr) { InitFunctionPtrs(); @@ -2004,4 +2529,6 @@ test_RtlDowncaseUnicodeString(); } test_RtlHashUnicodeString(); + test_RtlUnicodeToUTF8N(); + test_RtlUTF8ToUnicodeN(); } diff -Nru wine1.7-1.7.14/dlls/ntdll/thread.c wine1.7-1.7.18/dlls/ntdll/thread.c --- wine1.7-1.7.14/dlls/ntdll/thread.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/ntdll/thread.c 2014-05-02 18:15:48.000000000 +0000 @@ -256,6 +256,8 @@ RtlInitializeBitMap( &tls_expansion_bitmap, peb->TlsExpansionBitmapBits, sizeof(peb->TlsExpansionBitmapBits) * 8 ); RtlInitializeBitMap( &fls_bitmap, peb->FlsBitmapBits, sizeof(peb->FlsBitmapBits) * 8 ); + RtlSetBits( peb->TlsBitmap, 0, 1 ); /* TLS index 0 is reserved and should be initialized to NULL. */ + RtlSetBits( peb->FlsBitmap, 0, 1 ); InitializeListHead( &peb->FlsListHead ); InitializeListHead( &ldr.InLoadOrderModuleList ); InitializeListHead( &ldr.InMemoryOrderModuleList ); diff -Nru wine1.7-1.7.14/dlls/ntdll/threadpool.c wine1.7-1.7.18/dlls/ntdll/threadpool.c --- wine1.7-1.7.14/dlls/ntdll/threadpool.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/ntdll/threadpool.c 2014-05-02 18:15:48.000000000 +0000 @@ -39,12 +39,13 @@ #define WORKER_TIMEOUT 30000 /* 30 seconds */ +/* threadpool_cs must be held while modifying the following elements */ +static struct list work_item_list = LIST_INIT(work_item_list); static LONG num_workers; -static LONG num_work_items; static LONG num_busy_workers; +static LONG num_items_processed; -static struct list work_item_list = LIST_INIT(work_item_list); -static HANDLE work_item_event; +static RTL_CONDITION_VARIABLE threadpool_cond = RTL_CONDITION_VARIABLE_INIT; static RTL_CRITICAL_SECTION threadpool_cs; static RTL_CRITICAL_SECTION_DEBUG critsect_debug = @@ -84,80 +85,44 @@ static void WINAPI worker_thread_proc(void * param) { - interlocked_inc(&num_workers); + struct list *item; + struct work_item *work_item_ptr, work_item; + LARGE_INTEGER timeout; + timeout.QuadPart = -(WORKER_TIMEOUT * (ULONGLONG)10000); + + RtlEnterCriticalSection( &threadpool_cs ); + num_workers++; - /* free the work item memory sooner to reduce memory usage */ - while (TRUE) + for (;;) { - if (num_work_items > 0) + if ((item = list_head( &work_item_list ))) { - struct list *item; - RtlEnterCriticalSection(&threadpool_cs); - item = list_head(&work_item_list); - if (item) - { - struct work_item *work_item_ptr = LIST_ENTRY(item, struct work_item, entry); - struct work_item work_item; - list_remove(&work_item_ptr->entry); - interlocked_dec(&num_work_items); - - RtlLeaveCriticalSection(&threadpool_cs); - - work_item = *work_item_ptr; - RtlFreeHeap(GetProcessHeap(), 0, work_item_ptr); + work_item_ptr = LIST_ENTRY( item, struct work_item, entry ); + list_remove( &work_item_ptr->entry ); + num_busy_workers++; + num_items_processed++; + RtlLeaveCriticalSection( &threadpool_cs ); + + /* copy item to stack and do the work */ + work_item = *work_item_ptr; + RtlFreeHeap( GetProcessHeap(), 0, work_item_ptr ); + TRACE("executing %p(%p)\n", work_item.function, work_item.context); + work_item.function( work_item.context ); - TRACE("executing %p(%p)\n", work_item.function, work_item.context); - - interlocked_inc(&num_busy_workers); - - /* do the work */ - work_item.function(work_item.context); - - interlocked_dec(&num_busy_workers); - } - else - RtlLeaveCriticalSection(&threadpool_cs); - } - else - { - NTSTATUS status; - LARGE_INTEGER timeout; - timeout.QuadPart = -(WORKER_TIMEOUT * (ULONGLONG)10000); - status = NtWaitForSingleObject(work_item_event, FALSE, &timeout); - if (status != STATUS_WAIT_0) - break; + RtlEnterCriticalSection( &threadpool_cs ); + num_busy_workers--; } + else if (RtlSleepConditionVariableCS( &threadpool_cond, &threadpool_cs, &timeout ) != STATUS_SUCCESS) + break; } - interlocked_dec(&num_workers); - - RtlExitUserThread(0); + num_workers--; + RtlLeaveCriticalSection( &threadpool_cs ); + RtlExitUserThread( 0 ); /* never reached */ } -static NTSTATUS add_work_item_to_queue(struct work_item *work_item) -{ - NTSTATUS status; - - RtlEnterCriticalSection(&threadpool_cs); - list_add_tail(&work_item_list, &work_item->entry); - num_work_items++; - RtlLeaveCriticalSection(&threadpool_cs); - - if (!work_item_event) - { - HANDLE sem; - status = NtCreateSemaphore(&sem, SEMAPHORE_ALL_ACCESS, NULL, 1, INT_MAX); - if (interlocked_cmpxchg_ptr( &work_item_event, sem, 0 )) - NtClose(sem); /* somebody beat us to it */ - } - else - status = NtReleaseSemaphore(work_item_event, 1, NULL); - - return status; -} - /*********************************************************************** * RtlQueueWorkItem (NTDLL.@) * @@ -184,6 +149,7 @@ { HANDLE thread; NTSTATUS status; + LONG items_processed; struct work_item *work_item = RtlAllocateHeap(GetProcessHeap(), 0, sizeof(struct work_item)); if (!work_item) @@ -195,39 +161,40 @@ if (Flags & ~WT_EXECUTELONGFUNCTION) FIXME("Flags 0x%x not supported\n", Flags); - status = add_work_item_to_queue(work_item); + RtlEnterCriticalSection( &threadpool_cs ); + list_add_tail( &work_item_list, &work_item->entry ); + status = (num_workers > num_busy_workers) ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL; + items_processed = num_items_processed; + RtlLeaveCriticalSection( &threadpool_cs ); /* FIXME: tune this algorithm to not be as aggressive with creating threads * if WT_EXECUTELONGFUNCTION isn't specified */ - if ((status == STATUS_SUCCESS) && - ((num_workers == 0) || (num_workers == num_busy_workers))) + if (status == STATUS_SUCCESS) + RtlWakeConditionVariable( &threadpool_cond ); + else { - status = RtlCreateUserThread( GetCurrentProcess(), NULL, FALSE, - NULL, 0, 0, - worker_thread_proc, NULL, &thread, NULL ); - if (status == STATUS_SUCCESS) - NtClose( thread ); + status = RtlCreateUserThread( GetCurrentProcess(), NULL, FALSE, NULL, 0, 0, + worker_thread_proc, NULL, &thread, NULL ); /* NOTE: we don't care if we couldn't create the thread if there is at * least one other available to process the request */ - if ((num_workers > 0) && (status != STATUS_SUCCESS)) - status = STATUS_SUCCESS; - } - - if (status != STATUS_SUCCESS) - { - RtlEnterCriticalSection(&threadpool_cs); - - interlocked_dec(&num_work_items); - list_remove(&work_item->entry); - RtlFreeHeap(GetProcessHeap(), 0, work_item); - - RtlLeaveCriticalSection(&threadpool_cs); + if (status == STATUS_SUCCESS) + NtClose( thread ); + else + { + RtlEnterCriticalSection( &threadpool_cs ); + if (num_workers > 0 || num_items_processed != items_processed) + status = STATUS_SUCCESS; + else + list_remove( &work_item->entry ); + RtlLeaveCriticalSection( &threadpool_cs ); - return status; + if (status != STATUS_SUCCESS) + RtlFreeHeap( GetProcessHeap(), 0, work_item ); + } } - return STATUS_SUCCESS; + return status; } /*********************************************************************** @@ -235,12 +202,14 @@ */ static DWORD CALLBACK iocp_poller(LPVOID Arg) { + HANDLE cport = Arg; + while( TRUE ) { PRTL_OVERLAPPED_COMPLETION_ROUTINE callback; LPVOID overlapped; IO_STATUS_BLOCK iosb; - NTSTATUS res = NtRemoveIoCompletion( compl_port, (PULONG_PTR)&callback, (PULONG_PTR)&overlapped, &iosb, NULL ); + NTSTATUS res = NtRemoveIoCompletion( cport, (PULONG_PTR)&callback, (PULONG_PTR)&overlapped, &iosb, NULL ); if (res) { ERR("NtRemoveIoCompletion failed: 0x%x\n", res); @@ -297,7 +266,7 @@ if (!res) { /* FIXME native can start additional threads in case of e.g. hung callback function. */ - res = RtlQueueWorkItem( iocp_poller, NULL, WT_EXECUTEDEFAULT ); + res = RtlQueueWorkItem( iocp_poller, cport, WT_EXECUTEDEFAULT ); if (!res) compl_port = cport; else diff -Nru wine1.7-1.7.14/dlls/ntdll/time.c wine1.7-1.7.18/dlls/ntdll/time.c --- wine1.7-1.7.14/dlls/ntdll/time.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/ntdll/time.c 2014-05-02 18:15:48.000000000 +0000 @@ -931,3 +931,12 @@ return STATUS_NOT_IMPLEMENTED; #endif } + +/*********************************************************************** + * RtlQueryUnbiasedInterruptTime [NTDLL.@] + */ +NTSTATUS WINAPI RtlQueryUnbiasedInterruptTime(ULONGLONG *time) +{ + *time = monotonic_counter(); + return STATUS_SUCCESS; +} diff -Nru wine1.7-1.7.14/dlls/ntdll/virtual.c wine1.7-1.7.18/dlls/ntdll/virtual.c --- wine1.7-1.7.14/dlls/ntdll/virtual.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/ntdll/virtual.c 2014-05-02 18:15:48.000000000 +0000 @@ -58,10 +58,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(virtual); WINE_DECLARE_DEBUG_CHANNEL(module); -#ifndef MS_SYNC -#define MS_SYNC 0 -#endif - #ifndef MAP_NORESERVE #define MAP_NORESERVE 0 #endif @@ -2734,7 +2730,9 @@ { if (!*size_ptr) *size_ptr = view->size; *addr_ptr = addr; - if (msync( addr, *size_ptr, MS_SYNC )) status = STATUS_NOT_MAPPED_DATA; +#ifdef MS_ASYNC + if (msync( addr, *size_ptr, MS_ASYNC )) status = STATUS_NOT_MAPPED_DATA; +#endif } server_leave_uninterrupted_section( &csVirtual, &sigset ); return status; diff -Nru wine1.7-1.7.14/dlls/ntoskrnl.exe/ntoskrnl.c wine1.7-1.7.18/dlls/ntoskrnl.exe/ntoskrnl.c --- wine1.7-1.7.14/dlls/ntoskrnl.exe/ntoskrnl.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/ntoskrnl.exe/ntoskrnl.c 2014-05-02 18:15:48.000000000 +0000 @@ -34,6 +34,7 @@ #include "excpt.h" #include "winioctl.h" #include "ddk/ntddk.h" +#include "ddk/ntifs.h" #include "wine/unicode.h" #include "wine/server.h" #include "wine/list.h" @@ -1287,6 +1288,14 @@ KeInitializeTimerEx(Timer, NotificationTimer); } +/*********************************************************************** + * KeInsertQueue (NTOSKRNL.EXE.@) + */ +LONG WINAPI KeInsertQueue(PRKQUEUE Queue, PLIST_ENTRY Entry) +{ + FIXME( "stub: %p %p\n", Queue, Entry ); + return 0; +} /********************************************************************** * KeQueryActiveProcessors (NTOSKRNL.EXE.@) @@ -1503,6 +1512,14 @@ /*********************************************************************** + * MmLockPagableSectionByHandle (NTOSKRNL.EXE.@) + */ +VOID WINAPI MmLockPagableSectionByHandle(PVOID ImageSectionHandle) +{ + FIXME("stub %p\n", ImageSectionHandle); +} + +/*********************************************************************** * MmMapLockedPagesSpecifyCache (NTOSKRNL.EXE.@) */ PVOID WINAPI MmMapLockedPagesSpecifyCache(PMDLX MemoryDescriptorList, KPROCESSOR_MODE AccessMode, MEMORY_CACHING_TYPE CacheType, @@ -1513,6 +1530,13 @@ return NULL; } +/*********************************************************************** + * MmUnlockPagableImageSection (NTOSKRNL.EXE.@) + */ +VOID WINAPI MmUnlockPagableImageSection(PVOID ImageSectionHandle) +{ + FIXME("stub %p\n", ImageSectionHandle); +} /*********************************************************************** * MmPageEntireDriver (NTOSKRNL.EXE.@) diff -Nru wine1.7-1.7.14/dlls/ntoskrnl.exe/ntoskrnl.exe.spec wine1.7-1.7.18/dlls/ntoskrnl.exe/ntoskrnl.exe.spec --- wine1.7-1.7.14/dlls/ntoskrnl.exe/ntoskrnl.exe.spec 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/ntoskrnl.exe/ntoskrnl.exe.spec 2014-05-02 18:15:48.000000000 +0000 @@ -558,7 +558,7 @@ @ stub KeInsertByKeyDeviceQueue @ stub KeInsertDeviceQueue @ stub KeInsertHeadQueue -@ stub KeInsertQueue +@ stdcall KeInsertQueue(ptr ptr) @ stub KeInsertQueueApc @ stub KeInsertQueueDpc @ stub KeIsAttachedProcess @@ -687,7 +687,7 @@ @ stub MmIsVerifierEnabled @ stub MmLockPagableDataSection @ stub MmLockPagableImageSection -@ stub MmLockPagableSectionByHandle +@ stdcall MmLockPagableSectionByHandle(ptr) @ stdcall MmMapIoSpace(long long long long) @ stub MmMapLockedPages @ stdcall MmMapLockedPagesSpecifyCache(ptr long long ptr long long) @@ -716,7 +716,7 @@ @ stub MmSizeOfMdl @ stub MmSystemRangeStart @ stub MmTrimAllSystemPagableMemory -@ stub MmUnlockPagableImageSection +@ stdcall MmUnlockPagableImageSection(ptr) @ stdcall MmUnlockPages(ptr) @ stdcall MmUnmapIoSpace(ptr long) @ stub MmUnmapLockedPages diff -Nru wine1.7-1.7.14/dlls/odbccp32/odbccp32.spec wine1.7-1.7.18/dlls/odbccp32/odbccp32.spec --- wine1.7-1.7.14/dlls/odbccp32/odbccp32.spec 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/odbccp32/odbccp32.spec 2014-05-02 18:15:48.000000000 +0000 @@ -1,57 +1,57 @@ -@ stdcall ODBCCPlApplet( long long ptr ptr) -@ stdcall SQLConfigDataSource(ptr long str str) -@ stdcall SQLConfigDataSourceW(ptr long wstr wstr) -@ stdcall SQLConfigDriver(ptr long str str ptr long ptr) -@ stdcall SQLConfigDriverW(ptr long wstr wstr ptr long ptr) -@ stdcall SQLCreateDataSource(ptr str) -@ stub SQLCreateDataSourceEx -@ stub SQLCreateDataSourceExW -@ stdcall SQLCreateDataSourceW(ptr wstr) -@ stdcall SQLGetAvailableDrivers(str ptr long ptr) -@ stdcall SQLGetAvailableDriversW(wstr ptr long ptr) -@ stdcall SQLGetConfigMode(ptr) -@ stdcall SQLGetInstalledDrivers(str long ptr) -@ stdcall SQLGetInstalledDriversW(wstr long ptr) -@ stdcall SQLGetPrivateProfileString(str str str str long str) -@ stdcall SQLGetPrivateProfileStringW(wstr wstr wstr wstr long wstr) -@ stdcall SQLGetTranslator(ptr str long ptr ptr long ptr ptr) -@ stdcall SQLGetTranslatorW(ptr wstr long ptr ptr long ptr ptr) -@ stdcall SQLInstallDriver(str str str long ptr) -@ stdcall SQLInstallDriverEx(str str str long ptr long ptr) -@ stdcall SQLInstallDriverExW(wstr wstr wstr long ptr long ptr) -@ stdcall SQLInstallDriverManager(ptr long ptr) -@ stdcall SQLInstallDriverManagerW(ptr long ptr) -@ stdcall SQLInstallDriverW(wstr wstr wstr long ptr) -@ stdcall SQLInstallODBC(ptr str str str) -@ stdcall SQLInstallODBCW(ptr wstr wstr wstr) -@ stdcall SQLInstallTranslator(str str str ptr long ptr long ptr) -@ stdcall SQLInstallTranslatorEx(str str ptr long ptr long ptr) -@ stdcall SQLInstallTranslatorExW(wstr wstr ptr long ptr long ptr) -@ stdcall SQLInstallTranslatorW(wstr wstr wstr ptr long ptr long ptr) -@ stdcall SQLInstallerError(long ptr ptr long ptr) -@ stdcall SQLInstallerErrorW(long ptr ptr long ptr) -@ stub SQLLoadDataSourcesListBox -@ stub SQLLoadDriverListBox -@ stdcall SQLManageDataSources(ptr) -@ stdcall SQLPostInstallerError(long ptr) -@ stdcall SQLPostInstallerErrorW(long ptr) -@ stdcall SQLReadFileDSN(str str str ptr long ptr) -@ stdcall SQLReadFileDSNW(wstr wstr wstr ptr long ptr) -@ stdcall SQLRemoveDSNFromIni(str) -@ stdcall SQLRemoveDSNFromIniW(wstr) -@ stdcall SQLRemoveDefaultDataSource() -@ stdcall SQLRemoveDriver(str long ptr) -@ stdcall SQLRemoveDriverManager(ptr) -@ stdcall SQLRemoveDriverW(wstr long ptr) -@ stdcall SQLRemoveTranslator(str ptr) -@ stdcall SQLRemoveTranslatorW(wstr ptr) -@ stdcall SQLSetConfigMode(long) -@ stdcall SQLValidDSN(str) -@ stdcall SQLValidDSNW(wstr) -@ stdcall SQLWriteDSNToIni(str str) -@ stdcall SQLWriteDSNToIniW(wstr wstr) -@ stdcall SQLWriteFileDSN(str str str str) -@ stdcall SQLWriteFileDSNW(wstr wstr wstr wstr) -@ stdcall SQLWritePrivateProfileString(str str str str) -@ stdcall SQLWritePrivateProfileStringW(wstr wstr wstr wstr) -@ stub SelectTransDlg +2 stdcall SQLInstallDriver(str str str long ptr) +3 stdcall SQLInstallDriverManager(ptr long ptr) +4 stdcall SQLGetInstalledDrivers(str long ptr) +5 stdcall SQLGetAvailableDrivers(str ptr long ptr) +6 stdcall SQLConfigDataSource(ptr long str str) +7 stdcall SQLRemoveDefaultDataSource() +8 stdcall SQLWriteDSNToIni(str str) +9 stdcall SQLRemoveDSNFromIni(str) +10 stdcall SQLInstallODBC(ptr str str str) +11 stdcall SQLManageDataSources(ptr) +12 stdcall SQLCreateDataSource(ptr str) +13 stdcall SQLGetTranslator(ptr str long ptr ptr long ptr ptr) +14 stdcall SQLWritePrivateProfileString(str str str str) +15 stdcall SQLGetPrivateProfileString(str str str str long str) +16 stdcall SQLValidDSN(str) +17 stdcall SQLRemoveDriverManager(ptr) +18 stdcall SQLInstallTranslator(str str str ptr long ptr long ptr) +19 stdcall SQLRemoveTranslator(str ptr) +20 stdcall SQLRemoveDriver(str long ptr) +21 stdcall SQLConfigDriver(ptr long str str ptr long ptr) +22 stdcall SQLInstallerError(long ptr ptr long ptr) +23 stdcall SQLPostInstallerError(long ptr) +24 stdcall SQLReadFileDSN(str str str ptr long ptr) +25 stdcall SQLWriteFileDSN(str str str str) +26 stdcall SQLInstallDriverEx(str str str long ptr long ptr) +27 stdcall SQLGetConfigMode(ptr) +28 stdcall SQLSetConfigMode(long) +29 stdcall SQLInstallTranslatorEx(str str ptr long ptr long ptr) +30 stub SQLCreateDataSourceEx +101 stdcall ODBCCPlApplet( long long ptr ptr) +112 stub SelectTransDlg +202 stdcall SQLInstallDriverW(wstr wstr wstr long ptr) +203 stdcall SQLInstallDriverManagerW(ptr long ptr) +204 stdcall SQLGetInstalledDriversW(wstr long ptr) +205 stdcall SQLGetAvailableDriversW(wstr ptr long ptr) +206 stdcall SQLConfigDataSourceW(ptr long wstr wstr) +208 stdcall SQLWriteDSNToIniW(wstr wstr) +209 stdcall SQLRemoveDSNFromIniW(wstr) +210 stdcall SQLInstallODBCW(ptr wstr wstr wstr) +212 stdcall SQLCreateDataSourceW(ptr wstr) +213 stdcall SQLGetTranslatorW(ptr wstr long ptr ptr long ptr ptr) +214 stdcall SQLWritePrivateProfileStringW(wstr wstr wstr wstr) +215 stdcall SQLGetPrivateProfileStringW(wstr wstr wstr wstr long wstr) +216 stdcall SQLValidDSNW(wstr) +218 stdcall SQLInstallTranslatorW(wstr wstr wstr ptr long ptr long ptr) +219 stdcall SQLRemoveTranslatorW(wstr ptr) +220 stdcall SQLRemoveDriverW(wstr long ptr) +221 stdcall SQLConfigDriverW(ptr long wstr wstr ptr long ptr) +222 stdcall SQLInstallerErrorW(long ptr ptr long ptr) +223 stdcall SQLPostInstallerErrorW(long ptr) +224 stdcall SQLReadFileDSNW(wstr wstr wstr ptr long ptr) +225 stdcall SQLWriteFileDSNW(wstr wstr wstr wstr) +226 stdcall SQLInstallDriverExW(wstr wstr wstr long ptr long ptr) +229 stdcall SQLInstallTranslatorExW(wstr wstr ptr long ptr long ptr) +230 stub SQLCreateDataSourceExW +231 stub SQLLoadDriverListBox +232 stub SQLLoadDataSourcesListBox diff -Nru wine1.7-1.7.14/dlls/ole32/compobj.c wine1.7-1.7.18/dlls/ole32/compobj.c --- wine1.7-1.7.14/dlls/ole32/compobj.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/ole32/compobj.c 2014-05-02 18:15:48.000000000 +0000 @@ -3318,7 +3318,7 @@ init_multi_qi(count, results); - /* optionaly get CLSID from a file */ + /* optionally get CLSID from a file */ if (!rclsid) { hr = GetClassFile(filename, &clsid); @@ -3380,7 +3380,7 @@ init_multi_qi(count, results); - /* optionaly get CLSID from a file */ + /* optionally get CLSID from a file */ if (!rclsid) { memset(&stat.clsid, 0, sizeof(stat.clsid)); diff -Nru wine1.7-1.7.14/dlls/ole32/compositemoniker.c wine1.7-1.7.18/dlls/ole32/compositemoniker.c --- wine1.7-1.7.14/dlls/ole32/compositemoniker.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/ole32/compositemoniker.c 2014-05-02 18:15:48.000000000 +0000 @@ -1938,10 +1938,12 @@ if (pmkFirst==NULL && pmkRest!=NULL){ *ppmkComposite=pmkRest; + IMoniker_AddRef(pmkRest); return S_OK; } else if (pmkFirst!=NULL && pmkRest==NULL){ *ppmkComposite=pmkFirst; + IMoniker_AddRef(pmkFirst); return S_OK; } else if (pmkFirst==NULL && pmkRest==NULL) diff -Nru wine1.7-1.7.14/dlls/ole32/filelockbytes.c wine1.7-1.7.18/dlls/ole32/filelockbytes.c --- wine1.7-1.7.14/dlls/ole32/filelockbytes.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/ole32/filelockbytes.c 2014-05-02 18:15:48.000000000 +0000 @@ -334,15 +334,47 @@ static HRESULT WINAPI FileLockBytesImpl_LockRegion(ILockBytes* iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType) { - FIXME("stub\n"); - return E_NOTIMPL; + FileLockBytesImpl* This = impl_from_ILockBytes(iface); + OVERLAPPED ol; + DWORD lock_flags = LOCKFILE_FAIL_IMMEDIATELY; + + TRACE("ofs %u count %u flags %x\n", libOffset.u.LowPart, cb.u.LowPart, dwLockType); + + if (dwLockType & LOCK_WRITE) + return STG_E_INVALIDFUNCTION; + + if (dwLockType & (LOCK_EXCLUSIVE|LOCK_ONLYONCE)) + lock_flags |= LOCKFILE_EXCLUSIVE_LOCK; + + ol.hEvent = 0; + ol.u.s.Offset = libOffset.u.LowPart; + ol.u.s.OffsetHigh = libOffset.u.HighPart; + + if (LockFileEx(This->hfile, lock_flags, 0, cb.u.LowPart, cb.u.HighPart, &ol)) + return S_OK; + else + return STG_E_ACCESSDENIED; } static HRESULT WINAPI FileLockBytesImpl_UnlockRegion(ILockBytes* iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType) { - FIXME("stub\n"); - return E_NOTIMPL; + FileLockBytesImpl* This = impl_from_ILockBytes(iface); + OVERLAPPED ol; + + TRACE("ofs %u count %u flags %x\n", libOffset.u.LowPart, cb.u.LowPart, dwLockType); + + if (dwLockType & LOCK_WRITE) + return STG_E_INVALIDFUNCTION; + + ol.hEvent = 0; + ol.u.s.Offset = libOffset.u.LowPart; + ol.u.s.OffsetHigh = libOffset.u.HighPart; + + if (UnlockFileEx(This->hfile, 0, cb.u.LowPart, cb.u.HighPart, &ol)) + return S_OK; + else + return STG_E_ACCESSDENIED; } static HRESULT WINAPI FileLockBytesImpl_Stat(ILockBytes* iface, diff -Nru wine1.7-1.7.14/dlls/ole32/filemoniker.c wine1.7-1.7.18/dlls/ole32/filemoniker.c --- wine1.7-1.7.14/dlls/ole32/filemoniker.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/ole32/filemoniker.c 2014-05-02 18:15:48.000000000 +0000 @@ -935,11 +935,12 @@ FileMonikerImpl_CommonPrefixWith(IMoniker* iface,IMoniker* pmkOther,IMoniker** ppmkPrefix) { - LPOLESTR pathThis,pathOther,*stringTable1,*stringTable2,commonPath; - IBindCtx *pbind; + LPOLESTR pathThis = NULL, pathOther = NULL,*stringTable1,*stringTable2,commonPath = NULL; + IBindCtx *bindctx; DWORD mkSys; ULONG nb1,nb2,i,sameIdx; BOOL machineNameCase = FALSE; + HRESULT ret; if (ppmkPrefix==NULL) return E_POINTER; @@ -951,81 +952,81 @@ /* check if we have the same type of moniker */ IMoniker_IsSystemMoniker(pmkOther,&mkSys); + if (mkSys != MKSYS_FILEMONIKER) + return MonikerCommonPrefixWith(iface, pmkOther, ppmkPrefix); - if(mkSys==MKSYS_FILEMONIKER){ - HRESULT ret; - - ret = CreateBindCtx(0,&pbind); - if (FAILED(ret)) - return ret; - - /* create a string based on common part of the two paths */ - - ret = IMoniker_GetDisplayName(iface,pbind,NULL,&pathThis); - if (FAILED(ret)) - return ret; - ret = IMoniker_GetDisplayName(pmkOther,pbind,NULL,&pathOther); - if (FAILED(ret)) - return ret; - - nb1=FileMonikerImpl_DecomposePath(pathThis,&stringTable1); - if (FAILED(nb1)) - return nb1; - nb2=FileMonikerImpl_DecomposePath(pathOther,&stringTable2); - if (FAILED(nb2)) - { - free_stringtable(stringTable1); - return nb2; - } - - if (nb1==0 || nb2==0) - { - free_stringtable(stringTable1); - free_stringtable(stringTable2); - return MK_E_NOPREFIX; - } - - commonPath=HeapAlloc(GetProcessHeap(),0,sizeof(WCHAR)*(min(lstrlenW(pathThis),lstrlenW(pathOther))+1)); - if (!commonPath) - return E_OUTOFMEMORY; - - *commonPath=0; + ret = CreateBindCtx(0, &bindctx); + if (FAILED(ret)) + return ret; - for(sameIdx=0; ( (stringTable1[sameIdx]!=NULL) && - (stringTable2[sameIdx]!=NULL) && - (lstrcmpiW(stringTable1[sameIdx],stringTable2[sameIdx])==0)); sameIdx++); + /* create a string based on common part of the two paths */ + ret = IMoniker_GetDisplayName(iface, bindctx, NULL, &pathThis); + if (FAILED(ret)) + goto failed; + + ret = IMoniker_GetDisplayName(pmkOther, bindctx, NULL, &pathOther); + if (FAILED(ret)) + goto failed; + + nb1 = FileMonikerImpl_DecomposePath(pathThis, &stringTable1); + if (FAILED(nb1)) { + ret = nb1; + goto failed; + } - if (sameIdx > 1 && *stringTable1[0]=='\\' && *stringTable2[1]=='\\'){ + nb2 = FileMonikerImpl_DecomposePath(pathOther, &stringTable2); + if (FAILED(nb2)) { + ret = nb2; + goto failed; + } - machineNameCase = TRUE; + if (nb1 == 0 || nb2 == 0) { + ret = MK_E_NOPREFIX; + goto failed; + } - for(i=2;i 1 && *stringTable1[0]=='\\' && *stringTable2[1]=='\\'){ + machineNameCase = TRUE; + + for(i=2;i 3 || nb2 > 3) ) - ret = MK_E_NOPREFIX; - else - { - for(i=0;i 3 || nb2 > 3) ) + ret = MK_E_NOPREFIX; else - return MonikerCommonPrefixWith(iface,pmkOther,ppmkPrefix); + { + for (i = 0; i < sameIdx; i++) + strcatW(commonPath,stringTable1[i]); + ret = CreateFileMoniker(commonPath, ppmkPrefix); + } + +failed: + IBindCtx_Release(bindctx); + CoTaskMemFree(pathThis); + CoTaskMemFree(pathOther); + CoTaskMemFree(commonPath); + free_stringtable(stringTable1); + free_stringtable(stringTable2); + + return ret; } /****************************************************************************** @@ -1105,8 +1106,7 @@ CoTaskMemFree(strgtable); } - if (word) - CoTaskMemFree(word); + CoTaskMemFree(word); return ret; } diff -Nru wine1.7-1.7.14/dlls/ole32/moniker.c wine1.7-1.7.18/dlls/ole32/moniker.c --- wine1.7-1.7.14/dlls/ole32/moniker.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/ole32/moniker.c 2014-05-02 18:15:48.000000000 +0000 @@ -1248,8 +1248,10 @@ absFile=pathDec[nbElm-1]; /* failed if the path represents a directory and not an absolute file name*/ - if (!lstrcmpW(absFile, bkslashW)) + if (!lstrcmpW(absFile, bkslashW)) { + CoTaskMemFree(pathDec); return MK_E_INVALIDEXTENSION; + } /* get the extension of the file */ extension = NULL; @@ -1257,8 +1259,10 @@ for(i = length-1; (i >= 0) && *(extension = &absFile[i]) != '.'; i--) /* nothing */; - if (!extension || !lstrcmpW(extension, dotW)) + if (!extension || !lstrcmpW(extension, dotW)) { + CoTaskMemFree(pathDec); return MK_E_INVALIDEXTENSION; + } res=RegQueryValueW(HKEY_CLASSES_ROOT, extension, NULL, &sizeProgId); diff -Nru wine1.7-1.7.14/dlls/ole32/ole2.c wine1.7-1.7.18/dlls/ole32/ole2.c --- wine1.7-1.7.14/dlls/ole32/ole2.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/ole32/ole2.c 2014-05-02 18:15:48.000000000 +0000 @@ -2718,8 +2718,59 @@ */ HRESULT WINAPI OleDoAutoConvert(LPSTORAGE pStg, LPCLSID pClsidNew) { - FIXME("(%p,%p) : stub\n",pStg,pClsidNew); - return E_NOTIMPL; + WCHAR *user_type_old, *user_type_new; + CLIPFORMAT cf; + STATSTG stat; + CLSID clsid; + HRESULT hr; + + TRACE("(%p, %p)\n", pStg, pClsidNew); + + *pClsidNew = CLSID_NULL; + if(!pStg) + return E_INVALIDARG; + hr = IStorage_Stat(pStg, &stat, STATFLAG_NONAME); + if(FAILED(hr)) + return hr; + + *pClsidNew = stat.clsid; + hr = OleGetAutoConvert(&stat.clsid, &clsid); + if(FAILED(hr)) + return hr; + + hr = IStorage_SetClass(pStg, &clsid); + if(FAILED(hr)) + return hr; + + hr = ReadFmtUserTypeStg(pStg, &cf, &user_type_old); + if(FAILED(hr)) { + cf = 0; + user_type_new = NULL; + } + + hr = OleRegGetUserType(&clsid, USERCLASSTYPE_FULL, &user_type_new); + if(FAILED(hr)) + user_type_new = NULL; + + hr = WriteFmtUserTypeStg(pStg, cf, user_type_new); + CoTaskMemFree(user_type_new); + if(FAILED(hr)) + { + CoTaskMemFree(user_type_old); + IStorage_SetClass(pStg, &stat.clsid); + return hr; + } + + hr = SetConvertStg(pStg, TRUE); + if(FAILED(hr)) + { + WriteFmtUserTypeStg(pStg, cf, user_type_old); + IStorage_SetClass(pStg, &stat.clsid); + } + else + *pClsidNew = clsid; + CoTaskMemFree(user_type_old); + return hr; } /****************************************************************************** @@ -2812,10 +2863,14 @@ case VT_UI2: case VT_UI4: case VT_UI8: + case VT_INT: + case VT_UINT: case VT_LPSTR: case VT_LPWSTR: case VT_FILETIME: case VT_BLOB: + case VT_DISPATCH: + case VT_UNKNOWN: case VT_STREAM: case VT_STORAGE: case VT_STREAMED_OBJECT: @@ -2864,7 +2919,10 @@ hr = PROPVARIANT_ValidateType(pvar->vt); if (FAILED(hr)) + { + memset(pvar, 0, sizeof(*pvar)); return hr; + } switch(pvar->vt) { @@ -2885,8 +2943,12 @@ case VT_UI2: case VT_UI4: case VT_UI8: + case VT_INT: + case VT_UINT: case VT_FILETIME: break; + case VT_DISPATCH: + case VT_UNKNOWN: case VT_STREAM: case VT_STREAMED_OBJECT: case VT_STORAGE: @@ -2949,12 +3011,14 @@ } } else + { WARN("Invalid/unsupported type %d\n", pvar->vt); + hr = STG_E_INVALIDPARAMETER; + } } - ZeroMemory(pvar, sizeof(*pvar)); - - return S_OK; + memset(pvar, 0, sizeof(*pvar)); + return hr; } /*********************************************************************** @@ -2991,30 +3055,41 @@ case VT_ERROR: case VT_I8: case VT_UI8: + case VT_INT: + case VT_UINT: case VT_R8: case VT_CY: case VT_DATE: case VT_FILETIME: break; + case VT_DISPATCH: + case VT_UNKNOWN: case VT_STREAM: case VT_STREAMED_OBJECT: case VT_STORAGE: case VT_STORED_OBJECT: - IUnknown_AddRef((LPUNKNOWN)pvarDest->u.pStream); + if (pvarDest->u.pStream) + IStream_AddRef(pvarDest->u.pStream); break; case VT_CLSID: pvarDest->u.puuid = CoTaskMemAlloc(sizeof(CLSID)); *pvarDest->u.puuid = *pvarSrc->u.puuid; break; case VT_LPSTR: - len = strlen(pvarSrc->u.pszVal); - pvarDest->u.pszVal = CoTaskMemAlloc((len+1)*sizeof(CHAR)); - CopyMemory(pvarDest->u.pszVal, pvarSrc->u.pszVal, (len+1)*sizeof(CHAR)); + if (pvarSrc->u.pszVal) + { + len = strlen(pvarSrc->u.pszVal); + pvarDest->u.pszVal = CoTaskMemAlloc((len+1)*sizeof(CHAR)); + CopyMemory(pvarDest->u.pszVal, pvarSrc->u.pszVal, (len+1)*sizeof(CHAR)); + } break; case VT_LPWSTR: - len = lstrlenW(pvarSrc->u.pwszVal); - pvarDest->u.pwszVal = CoTaskMemAlloc((len+1)*sizeof(WCHAR)); - CopyMemory(pvarDest->u.pwszVal, pvarSrc->u.pwszVal, (len+1)*sizeof(WCHAR)); + if (pvarSrc->u.pwszVal) + { + len = lstrlenW(pvarSrc->u.pwszVal); + pvarDest->u.pwszVal = CoTaskMemAlloc((len+1)*sizeof(WCHAR)); + CopyMemory(pvarDest->u.pwszVal, pvarSrc->u.pwszVal, (len+1)*sizeof(WCHAR)); + } break; case VT_BLOB: case VT_BLOB_OBJECT: @@ -3074,7 +3149,7 @@ return E_INVALIDARG; } len = pvarSrc->u.capropvar.cElems; - pvarDest->u.capropvar.pElems = CoTaskMemAlloc(len * elemSize); + pvarDest->u.capropvar.pElems = len ? CoTaskMemAlloc(len * elemSize) : NULL; if (pvarSrc->vt == (VT_VECTOR | VT_VARIANT)) { for (i = 0; i < len; i++) diff -Nru wine1.7-1.7.14/dlls/ole32/storage32.c wine1.7-1.7.18/dlls/ole32/storage32.c --- wine1.7-1.7.14/dlls/ole32/storage32.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/ole32/storage32.c 2014-05-02 18:15:48.000000000 +0000 @@ -111,7 +111,7 @@ static HRESULT StorageImpl_LoadFileHeader(StorageImpl* This); static void StorageImpl_SaveFileHeader(StorageImpl* This); -static void Storage32Impl_AddBlockDepot(StorageImpl* This, ULONG blockIndex); +static void Storage32Impl_AddBlockDepot(StorageImpl* This, ULONG blockIndex, ULONG depotIndex); static ULONG Storage32Impl_AddExtBlockDepot(StorageImpl* This); static ULONG Storage32Impl_GetNextExtendedBlock(StorageImpl* This, ULONG blockIndex); static ULONG Storage32Impl_GetExtDepotBlock(StorageImpl* This, ULONG depotIndex); @@ -2743,6 +2743,157 @@ StorageImpl_StreamLink }; +/* The storage format reserves the region from 0x7fffff00-0x7fffffff for + * locking and synchronization. Unfortuantely, the spec doesn't say which bytes + * within that range are used, and for what. Here's what I've been able to + * gather based on testing (ends of ranges may be wrong): + + 0x0 through 0x57: Unknown. Causes read-only exclusive opens to fail. + 0x58 through 0x7f: Priority mode. + 0x80: Commit lock. + 0x81 through 0x91: Priority mode, again. Not sure why it uses two regions. + 0x92: Lock-checking lock. Held while opening so ranges can be tested without + causing spurious failures if others try to grab or test those ranges at the + same time. + 0x93 through 0xa6: Read mode. + 0xa7 through 0xba: Write mode. + 0xbb through 0xce: Deny read. + 0xcf through 0xe2: Deny write. + 0xe2 through 0xff: Unknown. Causes read-only exclusive opens to fail. +*/ + +static HRESULT StorageImpl_LockRegionSync(StorageImpl *This, ULARGE_INTEGER offset, + ULARGE_INTEGER cb, DWORD dwLockType) +{ + HRESULT hr; + + /* potential optimization: if we have an HFILE use LockFileEx in blocking mode directly */ + + do + { + int delay=0; + + hr = ILockBytes_LockRegion(This->lockBytes, offset, cb, dwLockType); + + if (hr == STG_E_ACCESSDENIED) + { + Sleep(delay); + if (delay < 150) delay++; + } + } while (hr == STG_E_ACCESSDENIED); + + return hr; +} + +static HRESULT StorageImpl_CheckLockRange(StorageImpl *This, unsigned char start, + unsigned char end, HRESULT fail_hr) +{ + HRESULT hr; + ULARGE_INTEGER offset, cb; + + offset.QuadPart = 0x7fffff00 + start; + cb.QuadPart = 1 + end - start; + + hr = ILockBytes_LockRegion(This->lockBytes, offset, cb, LOCK_ONLYONCE); + if (SUCCEEDED(hr)) ILockBytes_UnlockRegion(This->lockBytes, offset, cb, LOCK_ONLYONCE); + + if (hr == STG_E_ACCESSDENIED) + return fail_hr; + else + return S_OK; +} + +static HRESULT StorageImpl_LockOne(StorageImpl *This, unsigned char start, unsigned char end) +{ + HRESULT hr=S_OK; + int i, j; + ULARGE_INTEGER offset, cb; + + cb.QuadPart = 1; + + for (i=start; i<=end; i++) + { + offset.QuadPart = 0x7fffff00 + i; + hr = ILockBytes_LockRegion(This->lockBytes, offset, cb, LOCK_ONLYONCE); + if (hr != STG_E_ACCESSDENIED) + break; + } + + if (SUCCEEDED(hr)) + { + for (j=0; jlocked_bytes)/sizeof(This->locked_bytes[0]); j++) + { + if (This->locked_bytes[j] == 0) + { + This->locked_bytes[j] = i; + break; + } + } + } + + return hr; +} + +static HRESULT StorageImpl_GrabLocks(StorageImpl *This, DWORD openFlags) +{ + HRESULT hr; + ULARGE_INTEGER offset; + ULARGE_INTEGER cb; + DWORD share_mode = STGM_SHARE_MODE(openFlags); + + /* Wrap all other locking inside a single lock so we can check ranges safely */ + offset.QuadPart = 0x7fffff92; + cb.QuadPart = 1; + hr = StorageImpl_LockRegionSync(This, offset, cb, LOCK_ONLYONCE); + + /* If the ILockBytes doesn't support locking that's ok. */ + if (FAILED(hr)) return S_OK; + + hr = S_OK; + + /* First check for any conflicting locks. */ + if (SUCCEEDED(hr) && (openFlags & STGM_PRIORITY) == STGM_PRIORITY) + hr = StorageImpl_CheckLockRange(This, 0x80, 0x80, STG_E_LOCKVIOLATION); + + if (SUCCEEDED(hr) && (STGM_ACCESS_MODE(openFlags) != STGM_WRITE)) + hr = StorageImpl_CheckLockRange(This, 0xbb, 0xce, STG_E_SHAREVIOLATION); + + if (SUCCEEDED(hr) && (STGM_ACCESS_MODE(openFlags) != STGM_READ)) + hr = StorageImpl_CheckLockRange(This, 0xcf, 0xe2, STG_E_SHAREVIOLATION); + + if (SUCCEEDED(hr) && (share_mode == STGM_SHARE_DENY_READ || share_mode == STGM_SHARE_EXCLUSIVE)) + hr = StorageImpl_CheckLockRange(This, 0x93, 0xa6, STG_E_LOCKVIOLATION); + + if (SUCCEEDED(hr) && (share_mode == STGM_SHARE_DENY_WRITE || share_mode == STGM_SHARE_EXCLUSIVE)) + hr = StorageImpl_CheckLockRange(This, 0xa7, 0xba, STG_E_LOCKVIOLATION); + + /* Then grab our locks. */ + if (SUCCEEDED(hr) && (openFlags & STGM_PRIORITY) == STGM_PRIORITY) + { + hr = StorageImpl_LockOne(This, 0x58, 0x7f); + if (SUCCEEDED(hr)) + hr = StorageImpl_LockOne(This, 0x81, 0x91); + } + + if (SUCCEEDED(hr) && (STGM_ACCESS_MODE(openFlags) != STGM_WRITE)) + hr = StorageImpl_LockOne(This, 0x93, 0xa6); + + if (SUCCEEDED(hr) && (STGM_ACCESS_MODE(openFlags) != STGM_READ)) + hr = StorageImpl_LockOne(This, 0xa7, 0xba); + + if (SUCCEEDED(hr) && (share_mode == STGM_SHARE_DENY_READ || share_mode == STGM_SHARE_EXCLUSIVE)) + hr = StorageImpl_LockOne(This, 0xbb, 0xce); + + if (SUCCEEDED(hr) && (share_mode == STGM_SHARE_DENY_WRITE || share_mode == STGM_SHARE_EXCLUSIVE)) + hr = StorageImpl_LockOne(This, 0xcf, 0xe2); + + offset.QuadPart = 0x7fffff92; + cb.QuadPart = 1; + ILockBytes_UnlockRegion(This->lockBytes, offset, cb, LOCK_ONLYONCE); + + return hr; +} + static HRESULT StorageImpl_Construct( HANDLE hFile, LPCOLESTR pwcsName, @@ -2804,6 +2955,11 @@ if (FAILED(hr)) goto end; + hr = StorageImpl_GrabLocks(This, openFlags); + + if (FAILED(hr)) + goto end; + if (create) { ULARGE_INTEGER size; @@ -3038,6 +3194,17 @@ for (i=0; iblockChainCache[i]); + for (i=0; ilocked_bytes)/sizeof(This->locked_bytes[0]); i++) + { + ULARGE_INTEGER offset, cb; + cb.QuadPart = 1; + if (This->locked_bytes[i] != 0) + { + offset.QuadPart = 0x7fffff00 + This->locked_bytes[i]; + ILockBytes_UnlockRegion(This->lockBytes, offset, cb, LOCK_ONLYONCE); + } + } + if (This->lockBytes) ILockBytes_Release(This->lockBytes); HeapFree(GetProcessHeap(), 0, This); @@ -3111,7 +3278,7 @@ /* * Add a block depot. */ - Storage32Impl_AddBlockDepot(This, depotBlockIndexPos); + Storage32Impl_AddBlockDepot(This, depotBlockIndexPos, depotIndex); This->bigBlockDepotCount++; This->bigBlockDepotStart[depotIndex] = depotBlockIndexPos; @@ -3154,7 +3321,7 @@ /* * Add a block depot and mark it in the extended block. */ - Storage32Impl_AddBlockDepot(This, depotBlockIndexPos); + Storage32Impl_AddBlockDepot(This, depotBlockIndexPos, depotIndex); This->bigBlockDepotCount++; Storage32Impl_SetExtDepotBlock(This, depotIndex, depotBlockIndexPos); @@ -3219,14 +3386,24 @@ * This will create a depot block, essentially it is a block initialized * to BLOCK_UNUSEDs. */ -static void Storage32Impl_AddBlockDepot(StorageImpl* This, ULONG blockIndex) +static void Storage32Impl_AddBlockDepot(StorageImpl* This, ULONG blockIndex, ULONG depotIndex) { BYTE blockBuffer[MAX_BIG_BLOCK_SIZE]; + ULONG rangeLockIndex = 0x7fffff00 / This->bigBlockSize - 1; + ULONG blocksPerDepot = This->bigBlockSize / sizeof(ULONG); + ULONG rangeLockDepot = rangeLockIndex / blocksPerDepot; /* * Initialize blocks as free */ memset(blockBuffer, BLOCK_UNUSED, This->bigBlockSize); + + /* Reserve the range lock sector */ + if (depotIndex == rangeLockDepot) + { + ((ULONG*)blockBuffer)[rangeLockIndex % blocksPerDepot] = BLOCK_END_OF_CHAIN; + } + StorageImpl_WriteBigBlock(This, blockIndex, blockBuffer); } @@ -3523,6 +3700,13 @@ assert(depotBlockCount < This->bigBlockDepotCount); assert(blockIndex != nextBlock); + if (blockIndex == (0x7fffff00 / This->bigBlockSize) - 1) + /* This should never happen (storage file format spec forbids it), but + * older versions of Wine may have generated broken files. We don't want to + * assert and potentially lose data, but we do want to know if this ever + * happens in a newly-created file. */ + ERR("Using range lock page\n"); + if (depotBlockCount < COUNT_BBDEPOTINHEADER) { depotBlockIndexPos = This->bigBlockDepotStart[depotBlockCount]; @@ -8698,7 +8882,10 @@ len = MultiByteToWideChar( CP_ACP, 0, str, count, NULL, 0 ); wstr = CoTaskMemAlloc( (len + 1)*sizeof (WCHAR) ); if( wstr ) + { MultiByteToWideChar( CP_ACP, 0, str, count, wstr, len ); + wstr[len] = 0; + } CoTaskMemFree( str ); *string = wstr; @@ -8757,32 +8944,37 @@ HRESULT WINAPI WriteFmtUserTypeStg( LPSTORAGE pstg, CLIPFORMAT cf, LPOLESTR lpszUserType) { + STATSTG stat; HRESULT r; WCHAR szwClipName[0x40]; - CLSID clsid = CLSID_NULL; + CLSID clsid; LPWSTR wstrProgID = NULL; DWORD n; TRACE("(%p,%x,%s)\n",pstg,cf,debugstr_w(lpszUserType)); /* get the clipboard format name */ - n = GetClipboardFormatNameW( cf, szwClipName, sizeof(szwClipName)/sizeof(szwClipName[0]) ); - szwClipName[n]=0; + if( cf ) + { + n = GetClipboardFormatNameW( cf, szwClipName, + sizeof(szwClipName)/sizeof(szwClipName[0]) ); + szwClipName[n]=0; + } TRACE("Clipboard name is %s\n", debugstr_w(szwClipName)); - /* FIXME: There's room to save a CLSID and its ProgID, but - the CLSID is not looked up in the registry and in all the - tests I wrote it was CLSID_NULL. Where does it come from? - */ + r = IStorage_Stat(pstg, &stat, STATFLAG_NONAME); + if(SUCCEEDED(r)) + clsid = stat.clsid; + else + clsid = CLSID_NULL; - /* get the real program ID. This may fail, but that's fine */ ProgIDFromCLSID(&clsid, &wstrProgID); TRACE("progid is %s\n",debugstr_w(wstrProgID)); - r = STORAGE_WriteCompObj( pstg, &clsid, - lpszUserType, szwClipName, wstrProgID ); + r = STORAGE_WriteCompObj( pstg, &clsid, lpszUserType, + cf ? szwClipName : NULL, wstrProgID ); CoTaskMemFree(wstrProgID); @@ -9503,51 +9695,52 @@ */ HRESULT WINAPI SetConvertStg(IStorage *storage, BOOL convert) { + static const WCHAR stream_1oleW[] = {1,'O','l','e',0}; DWORD flags = convert ? OleStream_Convert : 0; + IStream *stream; + DWORD header[2]; HRESULT hr; TRACE("(%p, %d)\n", storage, convert); - hr = STORAGE_CreateOleStream(storage, flags); - if (hr == STG_E_FILEALREADYEXISTS) + hr = IStorage_OpenStream(storage, stream_1oleW, NULL, STGM_READWRITE | STGM_SHARE_EXCLUSIVE, 0, &stream); + if (FAILED(hr)) + { + if (hr != STG_E_FILENOTFOUND) + return hr; + + return STORAGE_CreateOleStream(storage, flags); + } + + hr = IStream_Read(stream, header, sizeof(header), NULL); + if (FAILED(hr)) + { + IStream_Release(stream); + return hr; + } + + /* update flag if differs */ + if ((header[1] ^ flags) & OleStream_Convert) { - static const WCHAR stream_1oleW[] = {1,'O','l','e',0}; - IStream *stream; - DWORD header[2]; + LARGE_INTEGER pos = {{0}}; - hr = IStorage_OpenStream(storage, stream_1oleW, NULL, STGM_READWRITE | STGM_SHARE_EXCLUSIVE, 0, &stream); - if (FAILED(hr)) return hr; + if (header[1] & OleStream_Convert) + flags = header[1] & ~OleStream_Convert; + else + flags = header[1] | OleStream_Convert; - hr = IStream_Read(stream, header, sizeof(header), NULL); + pos.QuadPart = sizeof(DWORD); + hr = IStream_Seek(stream, pos, STREAM_SEEK_SET, NULL); if (FAILED(hr)) { IStream_Release(stream); return hr; } - /* update flag if differs */ - if ((header[1] ^ flags) & OleStream_Convert) - { - LARGE_INTEGER pos; - - if (header[1] & OleStream_Convert) - flags = header[1] & ~OleStream_Convert; - else - flags = header[1] | OleStream_Convert; - - pos.QuadPart = sizeof(DWORD); - hr = IStream_Seek(stream, pos, STREAM_SEEK_SET, NULL); - if (FAILED(hr)) - { - IStream_Release(stream); - return hr; - } - - hr = IStream_Write(stream, &flags, sizeof(flags), NULL); - } - IStream_Release(stream); + hr = IStream_Write(stream, &flags, sizeof(flags), NULL); } + IStream_Release(stream); return hr; } diff -Nru wine1.7-1.7.14/dlls/ole32/storage32.h wine1.7-1.7.18/dlls/ole32/storage32.h --- wine1.7-1.7.14/dlls/ole32/storage32.h 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/ole32/storage32.h 2014-05-02 18:15:48.000000000 +0000 @@ -382,6 +382,8 @@ UINT blockChainToEvict; ILockBytes* lockBytes; + + unsigned char locked_bytes[8]; }; HRESULT StorageImpl_ReadRawDirEntry( diff -Nru wine1.7-1.7.14/dlls/ole32/tests/hglobalstream.c wine1.7-1.7.18/dlls/ole32/tests/hglobalstream.c --- wine1.7-1.7.14/dlls/ole32/tests/hglobalstream.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/ole32/tests/hglobalstream.c 2014-05-02 18:15:48.000000000 +0000 @@ -261,14 +261,17 @@ ok(ull.u.LowPart == 0x80000008, "should have set LowPart to 0x80000008 instead of %08x\n", ull.u.LowPart); ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %d\n", ull.u.HighPart); - /* IStream_Seek -- seek wraps position/size on integer overflow */ + /* IStream_Seek -- seek wraps position/size on integer overflow, but not on win8 */ ull.u.HighPart = 0xCAFECAFE; ull.u.LowPart = 0xCAFECAFE; ll.u.HighPart = 0; ll.u.LowPart = 0x7FFFFFFF; hr = IStream_Seek(pStream, ll, STREAM_SEEK_CUR, &ull); - ok_ole_success(hr, "IStream_Seek"); - ok(ull.u.LowPart == 0x00000007, "should have set LowPart to 0x00000007 instead of %08x\n", ull.u.LowPart); + ok(hr == S_OK || hr == STG_E_SEEKERROR /* win8 */, "IStream_Seek\n"); + if (SUCCEEDED(hr)) + ok(ull.u.LowPart == 0x00000007, "should have set LowPart to 0x00000007 instead of %08x\n", ull.u.LowPart); + else + ok(ull.u.LowPart == 0x80000008, "should have set LowPart to 0x80000008 instead of %08x\n", ull.u.LowPart); ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %d\n", ull.u.HighPart); hr = IStream_Commit(pStream, STGC_DEFAULT); diff -Nru wine1.7-1.7.14/dlls/ole32/tests/ole2.c wine1.7-1.7.18/dlls/ole32/tests/ole2.c --- wine1.7-1.7.14/dlls/ole32/tests/ole2.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/ole32/tests/ole2.c 2014-05-02 18:15:48.000000000 +0000 @@ -33,10 +33,48 @@ #define ok_ole_success(hr, func) ok(hr == S_OK, func " failed with error 0x%08x\n", hr) +#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(Storage_Stat); +DEFINE_EXPECT(Storage_OpenStream_CompObj); +DEFINE_EXPECT(Storage_SetClass); +DEFINE_EXPECT(Storage_CreateStream_CompObj); +DEFINE_EXPECT(Storage_OpenStream_Ole); + static IPersistStorage OleObjectPersistStg; static IOleCache *cache; static IRunnableObject *runnable; +static const CLSID CLSID_WineTestOld = +{ /* 9474ba1a-258b-490b-bc13-516e9239acd0 */ + 0x9474ba1a, + 0x258b, + 0x490b, + {0xbc, 0x13, 0x51, 0x6e, 0x92, 0x39, 0xac, 0xd0} +}; + static const CLSID CLSID_WineTest = { /* 9474ba1a-258b-490b-bc13-516e9239ace0 */ 0x9474ba1a, @@ -1957,6 +1995,363 @@ ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); } +static const WCHAR comp_objW[] = {1,'C','o','m','p','O','b','j',0}; +static IStream *comp_obj_stream; +static IStream *ole_stream; + +static HRESULT WINAPI Storage_QueryInterface(IStorage *iface, REFIID riid, void **ppvObject) +{ + ok(0, "unexpected call to QueryInterface\n"); + return E_NOTIMPL; +} + +static ULONG WINAPI Storage_AddRef(IStorage *iface) +{ + ok(0, "unexpected call to AddRef\n"); + return 2; +} + +static ULONG WINAPI Storage_Release(IStorage *iface) +{ + ok(0, "unexpected call to Release\n"); + return 1; +} + +static HRESULT WINAPI Storage_CreateStream(IStorage *iface, LPCOLESTR pwcsName, DWORD grfMode, DWORD reserved1, DWORD reserved2, IStream **ppstm) +{ + ULARGE_INTEGER size = {{0}}; + LARGE_INTEGER pos = {{0}}; + HRESULT hr; + + CHECK_EXPECT(Storage_CreateStream_CompObj); + ok(!lstrcmpW(pwcsName, comp_objW), "pwcsName = %s\n", wine_dbgstr_w(pwcsName)); + todo_wine ok(grfMode == (STGM_CREATE|STGM_SHARE_EXCLUSIVE|STGM_READWRITE), "grfMode = %x\n", grfMode); + ok(!reserved1, "reserved1 = %x\n", reserved1); + ok(!reserved2, "reserved2 = %x\n", reserved2); + ok(!!ppstm, "ppstm = NULL\n"); + + *ppstm = comp_obj_stream; + IStream_AddRef(comp_obj_stream); + hr = IStream_Seek(comp_obj_stream, pos, STREAM_SEEK_SET, NULL); + ok(hr == S_OK, "IStream_Seek returned %x\n", hr); + hr = IStream_SetSize(comp_obj_stream, size); + ok(hr == S_OK, "IStream_SetSize returned %x\n", hr); + return S_OK; +} + +static HRESULT WINAPI Storage_OpenStream(IStorage *iface, LPCOLESTR pwcsName, void *reserved1, DWORD grfMode, DWORD reserved2, IStream **ppstm) +{ + static const WCHAR ole1W[] = {1,'O','l','e',0}; + + LARGE_INTEGER pos = {{0}}; + HRESULT hr; + + ok(!reserved1, "reserved1 = %p\n", reserved1); + ok(!reserved2, "reserved2 = %x\n", reserved2); + ok(!!ppstm, "ppstm = NULL\n"); + + if(!lstrcmpW(pwcsName, comp_objW)) { + CHECK_EXPECT2(Storage_OpenStream_CompObj); + ok(grfMode == STGM_SHARE_EXCLUSIVE, "grfMode = %x\n", grfMode); + + *ppstm = comp_obj_stream; + IStream_AddRef(comp_obj_stream); + hr = IStream_Seek(comp_obj_stream, pos, STREAM_SEEK_SET, NULL); + ok(hr == S_OK, "IStream_Seek returned %x\n", hr); + return S_OK; + }else if(!lstrcmpW(pwcsName, ole1W)) { + CHECK_EXPECT(Storage_OpenStream_Ole); + ok(grfMode == (STGM_SHARE_EXCLUSIVE|STGM_READWRITE), "grfMode = %x\n", grfMode); + + *ppstm = ole_stream; + IStream_AddRef(ole_stream); + hr = IStream_Seek(ole_stream, pos, STREAM_SEEK_SET, NULL); + ok(hr == S_OK, "IStream_Seek returned %x\n", hr); + return S_OK; + } + + ok(0, "unexpected call to OpenStream: %s\n", wine_dbgstr_w(pwcsName)); + return E_NOTIMPL; +} + +static HRESULT WINAPI Storage_CreateStorage(IStorage *iface, LPCOLESTR pwcsName, DWORD grfMode, DWORD dwStgFmt, DWORD reserved2, IStorage **ppstg) +{ + ok(0, "unexpected call to CreateStorage\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI Storage_OpenStorage(IStorage *iface, LPCOLESTR pwcsName, IStorage *pstgPriority, DWORD grfMode, SNB snbExclude, DWORD reserved, IStorage **ppstg) +{ + ok(0, "unexpected call to OpenStorage\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI Storage_CopyTo(IStorage *iface, DWORD ciidExclude, const IID *rgiidExclude, SNB snbExclude, IStorage *pstgDest) +{ + ok(0, "unexpected call to CopyTo\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI Storage_MoveElementTo(IStorage *iface, LPCOLESTR pwcsName, IStorage *pstgDest, LPCOLESTR pwcsNewName, DWORD grfFlags) +{ + ok(0, "unexpected call to MoveElementTo\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI Storage_Commit(IStorage *iface, DWORD grfCommitFlags) +{ + ok(0, "unexpected call to Commit\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI Storage_Revert(IStorage *iface) +{ + ok(0, "unexpected call to Revert\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI Storage_EnumElements(IStorage *iface, DWORD reserved1, void *reserved2, DWORD reserved3, IEnumSTATSTG **ppenum) +{ + ok(0, "unexpected call to EnumElements\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI Storage_DestroyElement(IStorage *iface, LPCOLESTR pwcsName) +{ + ok(0, "unexpected call to DestroyElement\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI Storage_RenameElement(IStorage *iface, LPCOLESTR pwcsOldName, LPCOLESTR pwcsNewName) +{ + ok(0, "unexpected call to RenameElement\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI Storage_SetElementTimes(IStorage *iface, LPCOLESTR pwcsName, const FILETIME *pctime, const FILETIME *patime, const FILETIME *pmtime) +{ + ok(0, "unexpected call to SetElementTimes\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI Storage_SetClass(IStorage *iface, REFCLSID clsid) +{ + CHECK_EXPECT(Storage_SetClass); + ok(IsEqualIID(clsid, &CLSID_WineTest), "clsid = %s\n", wine_dbgstr_guid(clsid)); + return S_OK; +} + +static HRESULT WINAPI Storage_SetStateBits(IStorage *iface, DWORD grfStateBits, DWORD grfMask) +{ + ok(0, "unexpected call to SetStateBits\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI Storage_Stat(IStorage *iface, STATSTG *pstatstg, DWORD grfStatFlag) +{ + CHECK_EXPECT2(Storage_Stat); + ok(pstatstg != NULL, "pstatstg = NULL\n"); + ok(grfStatFlag == STATFLAG_NONAME, "grfStatFlag = %x\n", grfStatFlag); + + memset(pstatstg, 0, sizeof(STATSTG)); + pstatstg->type = STGTY_STORAGE; + pstatstg->clsid = CLSID_WineTestOld; + return S_OK; +} + +static IStorageVtbl StorageVtbl = +{ + Storage_QueryInterface, + Storage_AddRef, + Storage_Release, + Storage_CreateStream, + Storage_OpenStream, + Storage_CreateStorage, + Storage_OpenStorage, + Storage_CopyTo, + Storage_MoveElementTo, + Storage_Commit, + Storage_Revert, + Storage_EnumElements, + Storage_DestroyElement, + Storage_RenameElement, + Storage_SetElementTimes, + Storage_SetClass, + Storage_SetStateBits, + Storage_Stat +}; + +static IStorage Storage = { &StorageVtbl }; + +static void test_OleDoAutoConvert(void) +{ + static const WCHAR clsidW[] = {'C','L','S','I','D','\\',0}; + static struct { + DWORD reserved1; + DWORD version; + DWORD reserved2[5]; + DWORD ansi_user_type_len; + DWORD ansi_clipboard_format_len; + DWORD reserved3; + DWORD unicode_marker; + DWORD unicode_user_type_len; + DWORD unicode_clipboard_format_len; + DWORD reserved4; + } comp_obj_data; + static struct { + DWORD version; + DWORD flags; + DWORD link_update_option; + DWORD reserved1; + DWORD reserved_moniker_stream_size; + DWORD relative_source_moniker_stream_size; + DWORD absolute_source_moniker_stream_size; + DWORD clsid_indicator; + CLSID clsid; + DWORD reserved_display_name; + DWORD reserved2; + DWORD local_update_time; + DWORD local_check_update_time; + DWORD remote_update_time; + } ole_data; + + LARGE_INTEGER pos = {{0}}; + WCHAR buf[39+6]; + DWORD i, ret; + HKEY root; + CLSID clsid; + HRESULT hr; + + hr = CreateStreamOnHGlobal(NULL, TRUE, &comp_obj_stream); + ok(hr == S_OK, "CreateStreamOnHGlobal returned %x\n", hr); + hr = IStream_Write(comp_obj_stream, (char*)&comp_obj_data, sizeof(comp_obj_data), NULL); + ok(hr == S_OK, "IStream_Write returned %x\n", hr); + + hr = CreateStreamOnHGlobal(NULL, TRUE, &ole_stream); + ok(hr == S_OK, "CreateStreamOnHGlobal returned %x\n", hr); + hr = IStream_Write(ole_stream, (char*)&ole_data, sizeof(ole_data), NULL); + ok(hr == S_OK, "IStream_Write returned %x\n", hr); + + clsid = IID_WineTest; + hr = OleDoAutoConvert(NULL, &clsid); + ok(hr == E_INVALIDARG, "OleDoAutoConvert returned %x\n", hr); + ok(IsEqualIID(&clsid, &IID_NULL), "clsid = %s\n", wine_dbgstr_guid(&clsid)); + + if(0) /* crashes on Win7 */ + OleDoAutoConvert(&Storage, NULL); + + clsid = IID_WineTest; + SET_EXPECT(Storage_Stat); + hr = OleDoAutoConvert(&Storage, &clsid); + ok(hr == REGDB_E_CLASSNOTREG, "OleDoAutoConvert returned %x\n", hr); + CHECK_CALLED(Storage_Stat); + ok(IsEqualIID(&clsid, &CLSID_WineTestOld), "clsid = %s\n", wine_dbgstr_guid(&clsid)); + + lstrcpyW(buf, clsidW); + StringFromGUID2(&CLSID_WineTestOld, buf+6, 39); + + ret = RegCreateKeyExW(HKEY_CLASSES_ROOT, buf, 0, NULL, 0, + KEY_READ | KEY_WRITE | KEY_CREATE_SUB_KEY, NULL, &root, NULL); + if(ret != ERROR_SUCCESS) { + win_skip("not enough permissions to create CLSID key (%u)\n", ret); + return; + } + + clsid = IID_WineTest; + SET_EXPECT(Storage_Stat); + hr = OleDoAutoConvert(&Storage, &clsid); + ok(hr == REGDB_E_KEYMISSING, "OleDoAutoConvert returned %x\n", hr); + CHECK_CALLED(Storage_Stat); + ok(IsEqualIID(&clsid, &CLSID_WineTestOld), "clsid = %s\n", wine_dbgstr_guid(&clsid)); + + hr = OleSetAutoConvert(&CLSID_WineTestOld, &CLSID_WineTest); + ok_ole_success(hr, "OleSetAutoConvert"); + + hr = OleGetAutoConvert(&CLSID_WineTestOld, &clsid); + ok_ole_success(hr, "OleGetAutoConvert"); + ok(IsEqualIID(&clsid, &CLSID_WineTest), "incorrect clsid: %s\n", wine_dbgstr_guid(&clsid)); + + clsid = IID_WineTest; + SET_EXPECT(Storage_Stat); + SET_EXPECT(Storage_OpenStream_CompObj); + SET_EXPECT(Storage_SetClass); + SET_EXPECT(Storage_CreateStream_CompObj); + SET_EXPECT(Storage_OpenStream_Ole); + hr = OleDoAutoConvert(&Storage, &clsid); + ok(hr == S_OK, "OleDoAutoConvert returned %x\n", hr); + CHECK_CALLED(Storage_Stat); + CHECK_CALLED(Storage_OpenStream_CompObj); + CHECK_CALLED(Storage_SetClass); + CHECK_CALLED(Storage_CreateStream_CompObj); + CHECK_CALLED(Storage_OpenStream_Ole); + ok(IsEqualIID(&clsid, &CLSID_WineTest), "clsid = %s\n", wine_dbgstr_guid(&clsid)); + + hr = IStream_Seek(comp_obj_stream, pos, STREAM_SEEK_SET, NULL); + ok(hr == S_OK, "IStream_Seek returned %x\n", hr); + hr = IStream_Read(comp_obj_stream, &comp_obj_data, sizeof(comp_obj_data), NULL); + ok(hr == S_OK, "IStream_Read returned %x\n", hr); + ok(comp_obj_data.reserved1 == 0xfffe0001, "reserved1 = %x\n", comp_obj_data.reserved1); + ok(comp_obj_data.version == 0xa03, "version = %x\n", comp_obj_data.version); + ok(comp_obj_data.reserved2[0] == -1, "reserved2[0] = %x\n", comp_obj_data.reserved2[0]); + ok(IsEqualIID(comp_obj_data.reserved2+1, &CLSID_WineTestOld), "reserved2 = %s\n", wine_dbgstr_guid((CLSID*)(comp_obj_data.reserved2+1))); + ok(!comp_obj_data.ansi_user_type_len, "ansi_user_type_len = %d\n", comp_obj_data.ansi_user_type_len); + ok(!comp_obj_data.ansi_clipboard_format_len, "ansi_clipboard_format_len = %d\n", comp_obj_data.ansi_clipboard_format_len); + ok(!comp_obj_data.reserved3, "reserved3 = %x\n", comp_obj_data.reserved3); + ok(comp_obj_data.unicode_marker == 0x71b239f4, "unicode_marker = %x\n", comp_obj_data.unicode_marker); + ok(!comp_obj_data.unicode_user_type_len, "unicode_user_type_len = %d\n", comp_obj_data.unicode_user_type_len); + ok(!comp_obj_data.unicode_clipboard_format_len, "unicode_clipboard_format_len = %d\n", comp_obj_data.unicode_clipboard_format_len); + ok(!comp_obj_data.reserved4, "reserved4 %d\n", comp_obj_data.reserved4); + + hr = IStream_Seek(ole_stream, pos, STREAM_SEEK_SET, NULL); + ok(hr == S_OK, "IStream_Seek returned %x\n", hr); + hr = IStream_Read(ole_stream, &ole_data, sizeof(ole_data), NULL); + ok(hr == S_OK, "IStream_Read returned %x\n", hr); + ok(ole_data.version == 0, "version = %x\n", ole_data.version); + ok(ole_data.flags == 4, "flags = %x\n", ole_data.flags); + for(i=2; i #define COBJMACROS +#define NONAMELESSUNION +#define NONAMELESSSTRUCT #include #include "wine/test.h" @@ -3142,6 +3144,392 @@ DeleteFileW(fileW); } +struct lock_test +{ + DWORD stg_mode; + BOOL create; + DWORD access; + DWORD sharing; + const int *locked_bytes; + const int *fail_ranges; + BOOL todo; +}; + +static const int priority_locked_bytes[] = { 0x58, 0x81, 0x93, -1 }; +static const int rwex_locked_bytes[] = { 0x93, 0xa7, 0xbb, 0xcf, -1 }; +static const int rw_locked_bytes[] = { 0x93, 0xa7, -1 }; +static const int rwdw_locked_bytes[] = { 0x93, 0xa7, 0xcf, -1 }; +static const int wodw_locked_bytes[] = { 0xa7, 0xcf, -1 }; +static const int tr_locked_bytes[] = { 0x93, -1 }; +static const int no_locked_bytes[] = { -1 }; +static const int roex_locked_bytes[] = { 0x93, 0xbb, 0xcf, -1 }; + +static const int rwex_fail_ranges[] = { 0x93,0xe3, -1 }; +static const int rw_fail_ranges[] = { 0xbb,0xe3, -1 }; +static const int dw_fail_ranges[] = { 0xa7,0xcf, -1 }; +static const int tr_fail_ranges[] = { 0xbb,0xcf, -1 }; +static const int pr_fail_ranges[] = { 0x80,0x81, 0xbb,0xcf, -1 }; +static const int roex_fail_ranges[] = { 0x0,-1 }; + +static const struct lock_test lock_tests[] = { + { STGM_PRIORITY, FALSE, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE, priority_locked_bytes, pr_fail_ranges, FALSE }, + { STGM_CREATE|STGM_SHARE_EXCLUSIVE|STGM_READWRITE, TRUE, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ, rwex_locked_bytes, 0, TRUE }, + { STGM_CREATE|STGM_SHARE_EXCLUSIVE|STGM_READWRITE|STGM_TRANSACTED, TRUE, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ, rwex_locked_bytes, 0, TRUE }, + { STGM_CREATE|STGM_READWRITE|STGM_TRANSACTED, TRUE, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, rw_locked_bytes, 0, FALSE }, + { STGM_CREATE|STGM_READWRITE|STGM_SHARE_DENY_WRITE|STGM_TRANSACTED, TRUE, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ, rwdw_locked_bytes, 0, TRUE }, + { STGM_CREATE|STGM_WRITE|STGM_SHARE_DENY_WRITE|STGM_TRANSACTED, TRUE, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ, wodw_locked_bytes, 0, TRUE }, + { STGM_SHARE_EXCLUSIVE|STGM_READWRITE, FALSE, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ, rwex_locked_bytes, rwex_fail_ranges, TRUE }, + { STGM_SHARE_EXCLUSIVE|STGM_READWRITE|STGM_TRANSACTED, FALSE, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ, rwex_locked_bytes, rwex_fail_ranges, TRUE }, + { STGM_READWRITE|STGM_TRANSACTED, FALSE, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, rw_locked_bytes, rw_fail_ranges, TRUE }, + { STGM_READ|STGM_SHARE_DENY_WRITE, FALSE, GENERIC_READ, FILE_SHARE_READ, no_locked_bytes, dw_fail_ranges, TRUE }, + { STGM_READ|STGM_TRANSACTED, FALSE, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE, tr_locked_bytes, tr_fail_ranges, TRUE }, + { STGM_READ|STGM_SHARE_EXCLUSIVE, FALSE, GENERIC_READ, FILE_SHARE_READ, roex_locked_bytes, roex_fail_ranges, TRUE }, + { STGM_READ|STGM_SHARE_EXCLUSIVE|STGM_TRANSACTED, FALSE, GENERIC_READ, FILE_SHARE_READ, roex_locked_bytes, roex_fail_ranges, TRUE }, +}; + +static BOOL can_open(LPCWSTR filename, DWORD access, DWORD sharing) +{ + HANDLE hfile; + + hfile = CreateFileW(filename, access, sharing, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + + if (hfile == INVALID_HANDLE_VALUE) + return FALSE; + + CloseHandle(hfile); + return TRUE; +} + +static void check_sharing(LPCWSTR filename, const struct lock_test *current, + DWORD access, DWORD sharing, const char *desc, DWORD *open_mode, BOOL *any_failure) +{ + if (can_open(filename, access, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE)) + { + *open_mode = access; + if (!current->todo || (current->sharing & sharing)) + ok(current->sharing & sharing || + broken(!(current->sharing & sharing) && access == GENERIC_WRITE && (current->stg_mode & 0xf) != STGM_READ) /* win2k */, + "file with mode %x should not be openable with %s permission\n", current->stg_mode, desc); + else + { + todo_wine ok(current->sharing & sharing || + broken(!(current->sharing & sharing) && access == GENERIC_WRITE && (current->stg_mode & 0xf) != STGM_READ) /* win2k */, + "file with mode %x should not be openable with %s permission\n", current->stg_mode, desc); + *any_failure = TRUE; + } + } + else + { + if (!current->todo || !(current->sharing & sharing)) + ok(!(current->sharing & sharing), "file with mode %x should be openable with %s permission\n", current->stg_mode, desc); + else + { + todo_wine ok(!(current->sharing & sharing), "file with mode %x should be openable with %s permission\n", current->stg_mode, desc); + *any_failure = TRUE; + } + } +} + +static void check_access(LPCWSTR filename, const struct lock_test *current, + DWORD access, DWORD sharing, const char *desc, DWORD open_mode, BOOL *any_failure) +{ + if (can_open(filename, open_mode, (FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE) & ~sharing)) + { + if (!current->todo || !(current->access & access)) + ok(!(current->access & access), "file with mode %x should not be openable without %s sharing\n", current->stg_mode, desc); + else + { + todo_wine ok(!(current->access & access), "file with mode %x should not be openable without %s sharing\n", current->stg_mode, desc); + *any_failure = TRUE; + } + } + else + { + if (!current->todo || (current->access & access)) + ok(current->access & access, "file with mode %x should be openable without %s sharing\n", current->stg_mode, desc); + else + { + todo_wine ok(current->access & access, "file with mode %x should be openable without %s sharing\n", current->stg_mode, desc); + *any_failure = TRUE; + } + } +} + +static void test_locking(void) +{ + static const WCHAR filename[] = {'w','i','n','e','t','e','s','t',0}; + int i; + IStorage *stg; + HRESULT hr; + + for (i=0; icreate) + { + hr = StgCreateDocfile(filename, current->stg_mode, 0, &stg); + ok(SUCCEEDED(hr), "StgCreateDocfile with mode %x failed with hr %x\n", current->stg_mode, hr); + if (FAILED(hr)) continue; + } + else + { + hr = StgCreateDocfile(filename, STGM_CREATE | STGM_SHARE_EXCLUSIVE | STGM_READWRITE, 0, &stg); + ok(SUCCEEDED(hr), "StgCreateDocfile failed with hr %x\n", hr); + if (FAILED(hr)) continue; + IStorage_Release(stg); + + hr = StgOpenStorage(filename, NULL, current->stg_mode, NULL, 0, &stg); + if (current->stg_mode == (STGM_READ|STGM_TRANSACTED) || current->stg_mode == (STGM_READWRITE|STGM_TRANSACTED)) + todo_wine ok(SUCCEEDED(hr), "StgOpenStorage with mode %x failed with hr %x\n", current->stg_mode, hr); + else + ok(SUCCEEDED(hr), "StgOpenStorage with mode %x failed with hr %x\n", current->stg_mode, hr); + if (FAILED(hr)) + { + DeleteFileW(filename); + continue; + } + } + + check_sharing(filename, current, GENERIC_READ, FILE_SHARE_READ, "READ", &open_mode, &any_failure); + check_sharing(filename, current, GENERIC_WRITE, FILE_SHARE_WRITE, "WRITE", &open_mode, &any_failure); + check_sharing(filename, current, DELETE, FILE_SHARE_DELETE, "DELETE", &open_mode, &any_failure); + + if (open_mode != 0) + { + HANDLE hfile; + BOOL locked, expect_locked; + OVERLAPPED ol; + const int* next_lock = current->locked_bytes; + + check_access(filename, current, GENERIC_READ, FILE_SHARE_READ, "READ", open_mode, &any_failure); + check_access(filename, current, GENERIC_WRITE, FILE_SHARE_WRITE, "WRITE", open_mode, &any_failure); + check_access(filename, current, DELETE, FILE_SHARE_DELETE, "DELETE", open_mode, &any_failure); + + hfile = CreateFileW(filename, open_mode, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + ok(hfile != INVALID_HANDLE_VALUE, "couldn't open file with mode %x\n", current->stg_mode); + + ol.u.s.OffsetHigh = 0; + ol.hEvent = NULL; + + for (ol.u.s.Offset = 0x7fffff00; ol.u.s.Offset != 0x80000000; ol.u.s.Offset++) + { + if (LockFileEx(hfile, LOCKFILE_EXCLUSIVE_LOCK|LOCKFILE_FAIL_IMMEDIATELY, 0, 1, 0, &ol)) + locked = FALSE; + else + { + ok(!LockFileEx(hfile, LOCKFILE_FAIL_IMMEDIATELY, 0, 1, 0, &ol), "shared locks should not be used\n"); + locked = TRUE; + } + + UnlockFileEx(hfile, 0, 1, 0, &ol); + + if ((ol.u.s.Offset&0xff) == *next_lock) + { + expect_locked = TRUE; + next_lock++; + } + else + expect_locked = FALSE; + + if (!current->todo || locked == expect_locked) + ok(locked == expect_locked, "byte %x of file with mode %x is %slocked but should %sbe\n", + ol.u.s.Offset, current->stg_mode, locked?"":"not ", expect_locked?"":"not "); + else + { + any_failure = TRUE; + todo_wine ok(locked == expect_locked, "byte %x of file with mode %x is %slocked but should %sbe\n", + ol.u.s.Offset, current->stg_mode, locked?"":"not ", expect_locked?"":"not "); + } + } + + CloseHandle(hfile); + } + + IStorage_Release( stg ); + + if (!current->create) + { + HANDLE hfile; + BOOL failed, expect_failed=FALSE; + OVERLAPPED ol; + const int* next_range = current->fail_ranges; + + hfile = CreateFileW(filename, open_mode, FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + ok(hfile != INVALID_HANDLE_VALUE, "couldn't open file with mode %x\n", current->stg_mode); + + ol.u.s.OffsetHigh = 0; + ol.hEvent = NULL; + + for (ol.u.s.Offset = 0x7fffff00; ol.u.s.Offset != 0x80000000; ol.u.s.Offset++) + { + if (ol.u.s.Offset == 0x7fffff92 || + (ol.u.s.Offset == 0x7fffff80 && current->stg_mode == (STGM_TRANSACTED|STGM_READWRITE)) || + (ol.u.s.Offset == 0x7fffff80 && current->stg_mode == (STGM_TRANSACTED|STGM_READ))) + continue; /* This makes opens hang */ + + LockFileEx(hfile, LOCKFILE_EXCLUSIVE_LOCK, 0, 1, 0, &ol); + + hr = StgOpenStorage(filename, NULL, current->stg_mode, NULL, 0, &stg); + ok(hr == S_OK || hr == STG_E_LOCKVIOLATION || hr == STG_E_SHAREVIOLATION, "failed with unexpected hr %x\n", hr); + if (SUCCEEDED(hr)) IStorage_Release(stg); + + UnlockFileEx(hfile, 0, 1, 0, &ol); + + failed = FAILED(hr); + + if (!expect_failed && (ol.u.s.Offset&0xff) == next_range[0]) + { + expect_failed = TRUE; + } + else if (expect_failed && (ol.u.s.Offset&0xff) == next_range[1]) + { + expect_failed = FALSE; + next_range += 2; + } + + if (!current->todo || failed == expect_failed) + ok(failed == expect_failed, "open with byte %x locked, mode %x %s but should %s\n", + ol.u.s.Offset, current->stg_mode, failed?"failed":"succeeded", expect_failed?"fail":"succeed"); + else + { + any_failure = TRUE; + todo_wine ok(failed == expect_failed, "open with byte %x locked, mode %x %s but should %s\n", + ol.u.s.Offset, current->stg_mode, failed?"failed":"succeeded", expect_failed?"fail":"succeed"); + } + } + + CloseHandle(hfile); + } + + DeleteFileW(filename); + + if (current->todo && !any_failure) + todo_wine ok(1, "tests succeeded for mode %x\n", current->stg_mode); + } +} + +static void test_transacted_shared(void) +{ + IStorage *stg = NULL; + IStorage *stgrw = NULL; + HRESULT r; + IStream *stm = NULL; + static const WCHAR stmname[] = { 'C','O','N','T','E','N','T','S',0 }; + LARGE_INTEGER pos; + ULARGE_INTEGER upos; + char buffer[10]; + ULONG bytesread; + + DeleteFileA(filenameA); + + /* create a new transacted storage with a stream */ + r = StgCreateDocfile(filename, STGM_CREATE | + STGM_READWRITE |STGM_TRANSACTED, 0, &stg); + ok(r==S_OK, "StgCreateDocfile failed %x\n", r); + + r = WriteClassStg(stg, &test_stg_cls); + ok(r == S_OK, "WriteClassStg failed %x\n", r); + + r = IStorage_CreateStream(stg, stmname, STGM_SHARE_EXCLUSIVE | STGM_READWRITE, 0, 0, &stm); + ok(r==S_OK, "IStorage->CreateStream failed %x\n", r); + + pos.QuadPart = 0; + r = IStream_Seek(stm, pos, 0, &upos); + ok(r==S_OK, "IStream->Seek failed %x\n", r); + + r = IStream_Write(stm, "aaa", 3, NULL); + ok(r==S_OK, "IStream->Write failed %x\n", r); + + r = IStorage_Commit(stg, STGC_ONLYIFCURRENT); + ok(r==S_OK, "IStorage->Commit failed %x\n", r); + + /* open a second transacted read/write storage */ + r = StgOpenStorage(filename, NULL, STGM_READWRITE | STGM_TRANSACTED | STGM_SHARE_DENY_NONE, NULL, 0, &stgrw); + ok(r==S_OK, "StgOpenStorage failed %x\n", r); + + /* update stream on the first storage and commit */ + pos.QuadPart = 0; + r = IStream_Seek(stm, pos, 0, &upos); + ok(r==S_OK, "IStream->Seek failed %x\n", r); + + r = IStream_Write(stm, "ccc", 3, NULL); + ok(r==S_OK, "IStream->Write failed %x\n", r); + + r = IStorage_Commit(stg, STGC_ONLYIFCURRENT); + ok(r==S_OK, "IStorage->Commit failed %x\n", r); + + /* update again without committing */ + pos.QuadPart = 0; + r = IStream_Seek(stm, pos, 0, &upos); + ok(r==S_OK, "IStream->Seek failed %x\n", r); + + r = IStream_Write(stm, "ddd", 3, NULL); + ok(r==S_OK, "IStream->Write failed %x\n", r); + + IStream_Release(stm); + + /* we can still read the old content from the second storage */ + r = IStorage_OpenStream(stgrw, stmname, NULL, STGM_READWRITE | STGM_SHARE_EXCLUSIVE, 0, &stm); + ok(r==S_OK, "IStorage->OpenStream failed %x\n", r); + + pos.QuadPart = 0; + r = IStream_Seek(stm, pos, 0, &upos); + ok(r==S_OK, "IStream->Seek failed %x\n", r); + + r = IStream_Read(stm, buffer, sizeof(buffer), &bytesread); + ok(r==S_OK, "IStream->Read failed %x\n", r); + ok(bytesread == 3, "read wrong number of bytes %i\n", bytesread); + ok(memcmp(buffer, "aaa", 3) == 0, "wrong data\n"); + + /* and overwrite the data */ + pos.QuadPart = 0; + r = IStream_Seek(stm, pos, 0, &upos); + ok(r==S_OK, "IStream->Seek failed %x\n", r); + + r = IStream_Write(stm, "bbb", 3, NULL); + ok(r==S_OK, "IStream->Write failed %x\n", r); + + IStream_Release(stm); + + /* commit fails because we're out of date */ + r = IStorage_Commit(stgrw, STGC_ONLYIFCURRENT); + todo_wine ok(r==STG_E_NOTCURRENT, "IStorage->Commit failed %x\n", r); + + /* unless we force it */ + r = IStorage_Commit(stgrw, STGC_DEFAULT); + ok(r==S_OK, "IStorage->Commit failed %x\n", r); + + /* reverting gets us back to the last commit from the same storage */ + r = IStorage_Revert(stg); + ok(r==S_OK, "IStorage->Revert failed %x\n", r); + + r = IStorage_OpenStream(stg, stmname, NULL, STGM_READWRITE | STGM_SHARE_EXCLUSIVE, 0, &stm); + ok(r==S_OK, "IStorage->CreateStream failed %x\n", r); + + pos.QuadPart = 0; + r = IStream_Seek(stm, pos, 0, &upos); + ok(r==S_OK, "IStream->Seek failed %x\n", r); + + r = IStream_Read(stm, buffer, sizeof(buffer), &bytesread); + ok(r==S_OK, "IStream->Read failed %x\n", r); + ok(bytesread == 3, "read wrong number of bytes %i\n", bytesread); + ok(memcmp(buffer, "ccc", 3) == 0, "wrong data\n"); + + /* and committing fails forever */ + r = IStorage_Commit(stg, STGC_ONLYIFCURRENT); + todo_wine ok(r==STG_E_NOTCURRENT, "IStorage->Commit failed %x\n", r); + + IStream_Release(stm); + + IStorage_Release(stg); + IStorage_Release(stgrw); + + DeleteFileA(filenameA); +} + START_TEST(storage32) { CHAR temp[MAX_PATH]; @@ -3187,4 +3575,6 @@ test_hglobal_storage_creation(); test_convert(); test_direct_swmr(); + test_locking(); + test_transacted_shared(); } diff -Nru wine1.7-1.7.14/dlls/oleacc/client.c wine1.7-1.7.18/dlls/oleacc/client.c --- wine1.7-1.7.14/dlls/oleacc/client.c 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.18/dlls/oleacc/client.c 2014-05-02 18:15:48.000000000 +0000 @@ -0,0 +1,418 @@ +/* + * Copyright 2014 Piotr Caban for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define COBJMACROS + +#include "oleacc_private.h" + +#include "wine/unicode.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(oleacc); + +typedef struct { + IAccessible IAccessible_iface; + + LONG ref; + + HWND hwnd; +} Client; + +static inline Client* impl_from_Client(IAccessible *iface) +{ + return CONTAINING_RECORD(iface, Client, IAccessible_iface); +} + +static HRESULT WINAPI Client_QueryInterface(IAccessible *iface, REFIID riid, void **ppv) +{ + Client *This = impl_from_Client(iface); + + TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv); + + if(IsEqualIID(riid, &IID_IAccessible) || + IsEqualIID(riid, &IID_IDispatch) || + IsEqualIID(riid, &IID_IUnknown)) { + *ppv = iface; + IAccessible_AddRef(iface); + return S_OK; + } + + return E_NOINTERFACE; +} + +static ULONG WINAPI Client_AddRef(IAccessible *iface) +{ + Client *This = impl_from_Client(iface); + ULONG ref = InterlockedIncrement(&This->ref); + + TRACE("(%p) ref = %u\n", This, ref); + return ref; +} + +static ULONG WINAPI Client_Release(IAccessible *iface) +{ + Client *This = impl_from_Client(iface); + ULONG ref = InterlockedDecrement(&This->ref); + + TRACE("(%p) ref = %u\n", This, ref); + + if(!ref) + heap_free(This); + return ref; +} + +static HRESULT WINAPI Client_GetTypeInfoCount(IAccessible *iface, UINT *pctinfo) +{ + Client *This = impl_from_Client(iface); + FIXME("(%p)->(%p)\n", This, pctinfo); + return E_NOTIMPL; +} + +static HRESULT WINAPI Client_GetTypeInfo(IAccessible *iface, + UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) +{ + Client *This = impl_from_Client(iface); + FIXME("(%p)->(%u %x %p)\n", This, iTInfo, lcid, ppTInfo); + return E_NOTIMPL; +} + +static HRESULT WINAPI Client_GetIDsOfNames(IAccessible *iface, REFIID riid, + LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) +{ + Client *This = impl_from_Client(iface); + FIXME("(%p)->(%s %p %u %x %p)\n", This, debugstr_guid(riid), + rgszNames, cNames, lcid, rgDispId); + return E_NOTIMPL; +} + +static HRESULT WINAPI Client_Invoke(IAccessible *iface, DISPID dispIdMember, + REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, + VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) +{ + Client *This = impl_from_Client(iface); + FIXME("(%p)->(%x %s %x %x %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid), + lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); + return E_NOTIMPL; +} + +static HRESULT WINAPI Client_get_accParent(IAccessible *iface, IDispatch **ppdispParent) +{ + Client *This = impl_from_Client(iface); + FIXME("(%p)->(%p)\n", This, ppdispParent); + return E_NOTIMPL; +} + +static HRESULT WINAPI Client_get_accChildCount(IAccessible *iface, LONG *pcountChildren) +{ + Client *This = impl_from_Client(iface); + HWND cur; + + TRACE("(%p)->(%p)\n", This, pcountChildren); + + *pcountChildren = 0; + for(cur = GetWindow(This->hwnd, GW_CHILD); cur; cur = GetWindow(cur, GW_HWNDNEXT)) + (*pcountChildren)++; + + return S_OK; +} + +static HRESULT WINAPI Client_get_accChild(IAccessible *iface, + VARIANT varChildID, IDispatch **ppdispChild) +{ + Client *This = impl_from_Client(iface); + FIXME("(%p)->(%s %p)\n", This, debugstr_variant(&varChildID), ppdispChild); + return E_NOTIMPL; +} + +static HRESULT WINAPI Client_get_accName(IAccessible *iface, VARIANT varID, BSTR *pszName) +{ + Client *This = impl_from_Client(iface); + WCHAR name[1024]; + UINT i, len; + + TRACE("(%p)->(%s %p)\n", This, debugstr_variant(&varID), pszName); + + *pszName = NULL; + if(convert_child_id(&varID) != CHILDID_SELF || !IsWindow(This->hwnd)) + return E_INVALIDARG; + + len = SendMessageW(This->hwnd, WM_GETTEXT, sizeof(name)/sizeof(WCHAR), (LPARAM)name); + if(!len) + return S_FALSE; + + for(i=0; i(%s %p)\n", This, debugstr_variant(&varID), pszValue); + + *pszValue = NULL; + if(convert_child_id(&varID) != CHILDID_SELF) + return E_INVALIDARG; + return S_FALSE; +} + +static HRESULT WINAPI Client_get_accDescription(IAccessible *iface, + VARIANT varID, BSTR *pszDescription) +{ + Client *This = impl_from_Client(iface); + + TRACE("(%p)->(%s %p)\n", This, debugstr_variant(&varID), pszDescription); + + *pszDescription = NULL; + if(convert_child_id(&varID) != CHILDID_SELF) + return E_INVALIDARG; + return S_FALSE; +} + +static HRESULT WINAPI Client_get_accRole(IAccessible *iface, VARIANT varID, VARIANT *pvarRole) +{ + Client *This = impl_from_Client(iface); + + TRACE("(%p)->(%s %p)\n", This, debugstr_variant(&varID), pvarRole); + + if(convert_child_id(&varID) != CHILDID_SELF) { + V_VT(pvarRole) = VT_EMPTY; + return E_INVALIDARG; + } + + V_VT(pvarRole) = VT_I4; + V_I4(pvarRole) = ROLE_SYSTEM_CLIENT; + return S_OK; +} + +static HRESULT WINAPI Client_get_accState(IAccessible *iface, VARIANT varID, VARIANT *pvarState) +{ + Client *This = impl_from_Client(iface); + LONG style; + + TRACE("(%p)->(%s %p)\n", This, debugstr_variant(&varID), pvarState); + + if(convert_child_id(&varID) != CHILDID_SELF) { + V_VT(pvarState) = VT_EMPTY; + return E_INVALIDARG; + } + + V_VT(pvarState) = VT_I4; + V_I4(pvarState) = 0; + + style = GetWindowLongW(This->hwnd, GWL_STYLE); + if(style & WS_DISABLED) + V_I4(pvarState) |= STATE_SYSTEM_UNAVAILABLE; + else if(IsWindow(This->hwnd)) + V_I4(pvarState) |= STATE_SYSTEM_FOCUSABLE; + if(GetFocus() == This->hwnd) + V_I4(pvarState) |= STATE_SYSTEM_FOCUSED; + if(!(style & WS_VISIBLE)) + V_I4(pvarState) |= STATE_SYSTEM_INVISIBLE; + return S_OK; +} + +static HRESULT WINAPI Client_get_accHelp(IAccessible *iface, VARIANT varID, BSTR *pszHelp) +{ + Client *This = impl_from_Client(iface); + + TRACE("(%p)->(%s %p)\n", This, debugstr_variant(&varID), pszHelp); + + *pszHelp = NULL; + if(convert_child_id(&varID) != CHILDID_SELF) + return E_INVALIDARG; + return S_FALSE; +} + +static HRESULT WINAPI Client_get_accHelpTopic(IAccessible *iface, + BSTR *pszHelpFile, VARIANT varID, LONG *pidTopic) +{ + Client *This = impl_from_Client(iface); + FIXME("(%p)->(%p %s %p)\n", This, pszHelpFile, debugstr_variant(&varID), pidTopic); + return E_NOTIMPL; +} + +static HRESULT WINAPI Client_get_accKeyboardShortcut(IAccessible *iface, + VARIANT varID, BSTR *pszKeyboardShortcut) +{ + static const WCHAR shortcut_fmt[] = {'A','l','t','+','!',0}; + Client *This = impl_from_Client(iface); + WCHAR name[1024]; + UINT i, len; + + TRACE("(%p)->(%s %p)\n", This, debugstr_variant(&varID), pszKeyboardShortcut); + + *pszKeyboardShortcut = NULL; + if(convert_child_id(&varID) != CHILDID_SELF) + return E_INVALIDARG; + + len = SendMessageW(This->hwnd, WM_GETTEXT, sizeof(name)/sizeof(WCHAR), (LPARAM)name); + for(i=0; i= len) + return S_FALSE; + + *pszKeyboardShortcut = SysAllocString(shortcut_fmt); + if(!*pszKeyboardShortcut) + return E_OUTOFMEMORY; + + (*pszKeyboardShortcut)[4] = name[i+1]; + return S_OK; +} + +static HRESULT WINAPI Client_get_accFocus(IAccessible *iface, VARIANT *pvarID) +{ + Client *This = impl_from_Client(iface); + FIXME("(%p)->(%p)\n", This, pvarID); + return E_NOTIMPL; +} + +static HRESULT WINAPI Client_get_accSelection(IAccessible *iface, VARIANT *pvarID) +{ + Client *This = impl_from_Client(iface); + FIXME("(%p)->(%p)\n", This, pvarID); + return E_NOTIMPL; +} + +static HRESULT WINAPI Client_get_accDefaultAction(IAccessible *iface, + VARIANT varID, BSTR *pszDefaultAction) +{ + Client *This = impl_from_Client(iface); + + TRACE("(%p)->(%s %p)\n", This, debugstr_variant(&varID), pszDefaultAction); + + *pszDefaultAction = NULL; + if(convert_child_id(&varID) != CHILDID_SELF) + return E_INVALIDARG; + return S_FALSE; +} + +static HRESULT WINAPI Client_accSelect(IAccessible *iface, LONG flagsSelect, VARIANT varID) +{ + Client *This = impl_from_Client(iface); + FIXME("(%p)->(%x %s)\n", This, flagsSelect, debugstr_variant(&varID)); + return E_NOTIMPL; +} + +static HRESULT WINAPI Client_accLocation(IAccessible *iface, LONG *pxLeft, + LONG *pyTop, LONG *pcxWidth, LONG *pcyHeight, VARIANT varID) +{ + Client *This = impl_from_Client(iface); + FIXME("(%p)->(%p %p %p %p %s)\n", This, pxLeft, pyTop, + pcxWidth, pcyHeight, debugstr_variant(&varID)); + return E_NOTIMPL; +} + +static HRESULT WINAPI Client_accNavigate(IAccessible *iface, + LONG navDir, VARIANT varStart, VARIANT *pvarEnd) +{ + Client *This = impl_from_Client(iface); + FIXME("(%p)->(%d %s %p)\n", This, navDir, debugstr_variant(&varStart), pvarEnd); + return E_NOTIMPL; +} + +static HRESULT WINAPI Client_accHitTest(IAccessible *iface, + LONG xLeft, LONG yTop, VARIANT *pvarID) +{ + Client *This = impl_from_Client(iface); + FIXME("(%p)->(%d %d %p)\n", This, xLeft, yTop, pvarID); + return E_NOTIMPL; +} + +static HRESULT WINAPI Client_accDoDefaultAction(IAccessible *iface, VARIANT varID) +{ + Client *This = impl_from_Client(iface); + FIXME("(%p)->(%s)\n", This, debugstr_variant(&varID)); + return E_NOTIMPL; +} + +static HRESULT WINAPI Client_put_accName(IAccessible *iface, VARIANT varID, BSTR pszName) +{ + Client *This = impl_from_Client(iface); + FIXME("(%p)->(%s %s)\n", This, debugstr_variant(&varID), debugstr_w(pszName)); + return E_NOTIMPL; +} + +static HRESULT WINAPI Client_put_accValue(IAccessible *iface, VARIANT varID, BSTR pszValue) +{ + Client *This = impl_from_Client(iface); + FIXME("(%p)->(%s %s)\n", This, debugstr_variant(&varID), debugstr_w(pszValue)); + return E_NOTIMPL; +} + +static const IAccessibleVtbl ClientVtbl = { + Client_QueryInterface, + Client_AddRef, + Client_Release, + Client_GetTypeInfoCount, + Client_GetTypeInfo, + Client_GetIDsOfNames, + Client_Invoke, + Client_get_accParent, + Client_get_accChildCount, + Client_get_accChild, + Client_get_accName, + Client_get_accValue, + Client_get_accDescription, + Client_get_accRole, + Client_get_accState, + Client_get_accHelp, + Client_get_accHelpTopic, + Client_get_accKeyboardShortcut, + Client_get_accFocus, + Client_get_accSelection, + Client_get_accDefaultAction, + Client_accSelect, + Client_accLocation, + Client_accNavigate, + Client_accHitTest, + Client_accDoDefaultAction, + Client_put_accName, + Client_put_accValue +}; + +HRESULT create_client_object(HWND hwnd, const IID *iid, void **obj) +{ + Client *client; + HRESULT hres; + + if(!IsWindow(hwnd)) + return E_FAIL; + + client = heap_alloc_zero(sizeof(Client)); + if(!client) + return E_OUTOFMEMORY; + + client->IAccessible_iface.lpVtbl = &ClientVtbl; + client->ref = 1; + client->hwnd = hwnd; + + hres = IAccessible_QueryInterface(&client->IAccessible_iface, iid, obj); + IAccessible_Release(&client->IAccessible_iface); + return hres; +} diff -Nru wine1.7-1.7.14/dlls/oleacc/main.c wine1.7-1.7.18/dlls/oleacc/main.c --- wine1.7-1.7.14/dlls/oleacc/main.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/oleacc/main.c 2014-05-02 18:15:48.000000000 +0000 @@ -18,38 +18,250 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#define COBJMACROS + #include #include "windef.h" #include "winbase.h" #include "winuser.h" #include "ole2.h" -#include "oleacc.h" + +#include "initguid.h" +#include "oleacc_private.h" #include "wine/unicode.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(oleacc); +static const WCHAR lresult_atom_prefix[] = {'w','i','n','e','_','o','l','e','a','c','c',':'}; + static HINSTANCE oleacc_handle = 0; +const char *debugstr_variant(const VARIANT *v) +{ + if(!v) + return "(null)"; + + if(V_ISBYREF(v)) + return wine_dbg_sprintf("{V_BYREF -> %s}", debugstr_variant(V_BYREF(v))); + + switch(V_VT(v)) { + case VT_EMPTY: + return "{VT_EMPTY}"; + case VT_NULL: + return "{VT_NULL}"; + case VT_I2: + return wine_dbg_sprintf("{VT_I2: %d}", V_I2(v)); + case VT_I4: + return wine_dbg_sprintf("{VT_I4: %d}", V_I4(v)); + case VT_UI4: + return wine_dbg_sprintf("{VT_UI4: %u}", V_UI4(v)); + case VT_R8: + return wine_dbg_sprintf("{VT_R8: %lf}", V_R8(v)); + case VT_BSTR: + return wine_dbg_sprintf("{VT_BSTR: %s}", debugstr_w(V_BSTR(v))); + case VT_DISPATCH: + return wine_dbg_sprintf("{VT_DISPATCH: %p}", V_DISPATCH(v)); + case VT_BOOL: + return wine_dbg_sprintf("{VT_BOOL: %x}", V_BOOL(v)); + default: + return wine_dbg_sprintf("{vt %d}", V_VT(v)); + } +} + +int convert_child_id(VARIANT *v) +{ + switch(V_VT(v)) { + case VT_I4: + return V_I4(v); + default: + FIXME("unhandled child ID variant type: %d\n", V_VT(v)); + return -1; + } +} + HRESULT WINAPI CreateStdAccessibleObject( HWND hwnd, LONG idObject, - REFIID riidInterface, void** ppvObject ) + REFIID riidInterface, void** ppvObject ) { - FIXME("%p %d %s %p\n", hwnd, idObject, + WCHAR class_name[64]; + + TRACE("%p %d %s %p\n", hwnd, idObject, debugstr_guid( riidInterface ), ppvObject ); - return E_NOTIMPL; + if(GetClassNameW(hwnd, class_name, sizeof(class_name)/sizeof(WCHAR))) + FIXME("unhandled window class: %s\n", debugstr_w(class_name)); + + switch(idObject) { + case OBJID_CLIENT: + return create_client_object(hwnd, riidInterface, ppvObject); + default: + FIXME("unhandled object id: %d\n", idObject); + return E_NOTIMPL; + } } HRESULT WINAPI ObjectFromLresult( LRESULT result, REFIID riid, WPARAM wParam, void **ppObject ) { - FIXME("%ld %s %ld %p\n", result, debugstr_guid(riid), wParam, ppObject ); - return E_NOTIMPL; + WCHAR atom_str[sizeof(lresult_atom_prefix)/sizeof(WCHAR)+3*8+3]; + HANDLE server_proc, server_mapping, mapping; + DWORD proc_id, size; + IStream *stream; + HGLOBAL data; + void *view; + HRESULT hr; + WCHAR *p; + + TRACE("%ld %s %ld %p\n", result, debugstr_guid(riid), wParam, ppObject ); + + if(wParam) + FIXME("unsupported wParam = %lx\n", wParam); + + if(!ppObject) + return E_INVALIDARG; + *ppObject = NULL; + + if(result != (ATOM)result) + return E_FAIL; + + if(!GlobalGetAtomNameW(result, atom_str, sizeof(atom_str)/sizeof(WCHAR))) + return E_FAIL; + if(memcmp(atom_str, lresult_atom_prefix, sizeof(lresult_atom_prefix))) + return E_FAIL; + p = atom_str + sizeof(lresult_atom_prefix)/sizeof(WCHAR); + proc_id = strtoulW(p, &p, 16); + if(*p != ':') + return E_FAIL; + server_mapping = ULongToHandle( strtoulW(p+1, &p, 16) ); + if(*p != ':') + return E_FAIL; + size = strtoulW(p+1, &p, 16); + if(*p != 0) + return E_FAIL; + + server_proc = OpenProcess(PROCESS_DUP_HANDLE, FALSE, proc_id); + if(!server_proc) + return E_FAIL; + + if(!DuplicateHandle(server_proc, server_mapping, GetCurrentProcess(), &mapping, + 0, FALSE, DUPLICATE_CLOSE_SOURCE|DUPLICATE_SAME_ACCESS)) + return E_FAIL; + CloseHandle(server_proc); + GlobalDeleteAtom(result); + + view = MapViewOfFile(mapping, FILE_MAP_READ, 0, 0, 0); + CloseHandle(mapping); + if(!view) + return E_FAIL; + + data = GlobalAlloc(GMEM_FIXED, size); + memcpy(data, view, size); + UnmapViewOfFile(view); + if(!data) + return E_OUTOFMEMORY; + + hr = CreateStreamOnHGlobal(data, TRUE, &stream); + if(FAILED(hr)) { + GlobalFree(data); + return hr; + } + + hr = CoUnmarshalInterface(stream, riid, ppObject); + IStream_Release(stream); + return hr; } LRESULT WINAPI LresultFromObject( REFIID riid, WPARAM wParam, LPUNKNOWN pAcc ) { - FIXME("%s %ld %p\n", debugstr_guid(riid), wParam, pAcc ); - return E_NOTIMPL; + static const WCHAR atom_fmt[] = {'%','0','8','x',':','%','0','8','x',':','%','0','8','x',0}; + static const LARGE_INTEGER seek_zero = {{0}}; + + WCHAR atom_str[sizeof(lresult_atom_prefix)/sizeof(WCHAR)+3*8+3]; + IStream *stream; + HANDLE mapping; + STATSTG stat; + HRESULT hr; + ATOM atom; + void *view; + + TRACE("%s %ld %p\n", debugstr_guid(riid), wParam, pAcc); + + if(wParam) + FIXME("unsupported wParam = %lx\n", wParam); + + if(!pAcc) + return E_INVALIDARG; + + hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); + if(FAILED(hr)) + return hr; + + hr = CoMarshalInterface(stream, riid, pAcc, MSHCTX_LOCAL, NULL, MSHLFLAGS_NORMAL); + if(FAILED(hr)) { + IStream_Release(stream); + return hr; + } + + hr = IStream_Seek(stream, seek_zero, STREAM_SEEK_SET, NULL); + if(FAILED(hr)) { + IStream_Release(stream); + return hr; + } + + hr = IStream_Stat(stream, &stat, STATFLAG_NONAME); + if(FAILED(hr)) { + CoReleaseMarshalData(stream); + IStream_Release(stream); + return hr; + }else if(stat.cbSize.u.HighPart) { + FIXME("stream size to big\n"); + CoReleaseMarshalData(stream); + IStream_Release(stream); + return E_NOTIMPL; + } + + mapping = CreateFileMappingW(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, + stat.cbSize.u.HighPart, stat.cbSize.u.LowPart, NULL); + if(!mapping) { + CoReleaseMarshalData(stream); + IStream_Release(stream); + return hr; + } + + view = MapViewOfFile(mapping, FILE_MAP_WRITE, 0, 0, 0); + if(!view) { + CloseHandle(mapping); + CoReleaseMarshalData(stream); + IStream_Release(stream); + return E_FAIL; + } + + hr = IStream_Read(stream, view, stat.cbSize.u.LowPart, NULL); + UnmapViewOfFile(view); + if(FAILED(hr)) { + CloseHandle(mapping); + hr = IStream_Seek(stream, seek_zero, STREAM_SEEK_SET, NULL); + if(SUCCEEDED(hr)) + CoReleaseMarshalData(stream); + IStream_Release(stream); + return hr; + + } + + memcpy(atom_str, lresult_atom_prefix, sizeof(lresult_atom_prefix)); + sprintfW(atom_str+sizeof(lresult_atom_prefix)/sizeof(WCHAR), + atom_fmt, GetCurrentProcessId(), HandleToUlong(mapping), stat.cbSize.u.LowPart); + atom = GlobalAddAtomW(atom_str); + if(!atom) { + CloseHandle(mapping); + hr = IStream_Seek(stream, seek_zero, STREAM_SEEK_SET, NULL); + if(SUCCEEDED(hr)) + CoReleaseMarshalData(stream); + IStream_Release(stream); + return E_FAIL; + } + + IStream_Release(stream); + return atom; } HRESULT WINAPI AccessibleObjectFromPoint( POINT ptScreen, IAccessible** ppacc, VARIANT* pvarChild ) @@ -61,9 +273,24 @@ HRESULT WINAPI AccessibleObjectFromWindow( HWND hwnd, DWORD dwObjectID, REFIID riid, void** ppvObject ) { - FIXME("%p %d %s %p\n", hwnd, dwObjectID, + TRACE("%p %d %s %p\n", hwnd, dwObjectID, debugstr_guid( riid ), ppvObject ); - return E_NOTIMPL; + + if(!ppvObject) + return E_INVALIDARG; + *ppvObject = NULL; + + if(IsWindow(hwnd)) { + LRESULT lres; + + lres = SendMessageW(hwnd, WM_GETOBJECT, 0xffffffff, dwObjectID); + if(FAILED(lres)) + return lres; + else if(lres) + return ObjectFromLresult(lres, riid, 0, ppvObject); + } + + return CreateStdAccessibleObject(hwnd, dwObjectID, riid, ppvObject); } BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, diff -Nru wine1.7-1.7.14/dlls/oleacc/Makefile.in wine1.7-1.7.18/dlls/oleacc/Makefile.in --- wine1.7-1.7.14/dlls/oleacc/Makefile.in 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/oleacc/Makefile.in 2014-05-02 18:15:48.000000000 +0000 @@ -1,8 +1,9 @@ MODULE = oleacc.dll IMPORTLIB = oleacc -IMPORTS = user32 +IMPORTS = uuid oleaut32 ole32 user32 C_SRCS = \ + client.c \ main.c IDL_SRCS = oleacc_classes.idl diff -Nru wine1.7-1.7.14/dlls/oleacc/oleacc_private.h wine1.7-1.7.18/dlls/oleacc/oleacc_private.h --- wine1.7-1.7.14/dlls/oleacc/oleacc_private.h 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.18/dlls/oleacc/oleacc_private.h 2014-05-02 18:15:48.000000000 +0000 @@ -0,0 +1,34 @@ +/* + * Copyright 2014 Piotr 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 + +HRESULT create_client_object(HWND, const IID*, void**) DECLSPEC_HIDDEN; + +const char *debugstr_variant(const VARIANT*) DECLSPEC_HIDDEN; +int convert_child_id(VARIANT *v) DECLSPEC_HIDDEN; + +static inline void * __WINE_ALLOC_SIZE(1) heap_alloc_zero(size_t len) +{ + return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len); +} + +static inline BOOL heap_free(void *mem) +{ + return HeapFree(GetProcessHeap(), 0, mem); +} diff -Nru wine1.7-1.7.14/dlls/oleacc/tests/main.c wine1.7-1.7.18/dlls/oleacc/tests/main.c --- wine1.7-1.7.14/dlls/oleacc/tests/main.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/oleacc/tests/main.c 2014-05-02 18:15:48.000000000 +0000 @@ -18,8 +18,13 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include +#define COBJMACROS + #include "wine/test.h" +#include + +#include "initguid.h" +#include static void test_getroletext(void) { @@ -135,7 +140,285 @@ } } +static int Object_ref = 1; +static HRESULT WINAPI Object_QueryInterface(IUnknown *iface, REFIID riid, void **ppv) +{ + if(IsEqualIID(riid, &IID_IUnknown)) { + *ppv = iface; + IUnknown_AddRef(iface); + return S_OK; + } + return E_NOINTERFACE; +} + +static ULONG WINAPI Object_AddRef(IUnknown *iface) +{ + return InterlockedIncrement(&Object_ref); +} + +static ULONG WINAPI Object_Release(IUnknown *iface) +{ + return InterlockedDecrement(&Object_ref); +} + +static IUnknownVtbl ObjectVtbl = { + Object_QueryInterface, + Object_AddRef, + Object_Release +}; + +static IUnknown Object = {&ObjectVtbl}; + +static void test_LresultFromObject(const char *name) +{ + PROCESS_INFORMATION proc; + STARTUPINFOA startup; + char cmdline[MAX_PATH]; + IUnknown *unk; + HRESULT hres; + LRESULT lres; + + lres = LresultFromObject(NULL, 0, 0); + ok(lres == E_INVALIDARG, "got %lx\n", lres); + + hres = ObjectFromLresult(0, &IID_IUnknown, 0, (void**)&unk); + ok(hres==MAKE_HRESULT(SEVERITY_ERROR,FACILITY_WIN32,ERROR_INVALID_ADDRESS) + || hres==E_FAIL, "got %x\n", hres); + hres = ObjectFromLresult(0x10000, &IID_IUnknown, 0, (void**)&unk); + ok(hres==MAKE_HRESULT(SEVERITY_ERROR,FACILITY_WIN32,ERROR_INVALID_ADDRESS) + || hres==E_FAIL, "got %x\n", hres); + + ok(Object_ref == 1, "Object_ref = %d\n", Object_ref); + lres = LresultFromObject(&IID_IUnknown, 0, &Object); + ok(SUCCEEDED(lres), "got %lx\n", lres); + ok(Object_ref > 1, "Object_ref = %d\n", Object_ref); + + hres = ObjectFromLresult(lres, &IID_IUnknown, 0, (void**)&unk); + ok(hres == S_OK, "hres = %x\n", hres); + ok(unk == &Object, "unk != &Object\n"); + IUnknown_Release(unk); + ok(Object_ref == 1, "Object_ref = %d\n", Object_ref); + + lres = LresultFromObject(&IID_IUnknown, 0, &Object); + ok(SUCCEEDED(lres), "got %lx\n", lres); + ok(Object_ref > 1, "Object_ref = %d\n", Object_ref); + + sprintf(cmdline, "\"%s\" main ObjectFromLresult %lx", name, lres); + memset(&startup, 0, sizeof(startup)); + startup.cb = sizeof(startup); + CreateProcessA(NULL, cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &startup, &proc); + winetest_wait_child_process(proc.hProcess); + ok(Object_ref == 1, "Object_ref = %d\n", Object_ref); +} + +static LRESULT WINAPI test_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) +{ + switch(msg) { + case WM_GETOBJECT: + if(lparam == OBJID_QUERYCLASSNAMEIDX) { + ok(!wparam, "wparam = %lx\n", wparam); + return 0; + } + + ok(wparam==0xffffffff || broken(wparam==0x8000), "wparam = %lx\n", wparam); + if(lparam == (DWORD)OBJID_CURSOR) + return E_UNEXPECTED; + if(lparam == (DWORD)OBJID_CLIENT) + return LresultFromObject(&IID_IUnknown, wparam, &Object); + + ok(0, "unexpected (%ld)\n", lparam); + return 0; + } + + return DefWindowProcA(hwnd, msg, wparam, lparam); +} + +static BOOL register_window_class(void) +{ + WNDCLASSA cls; + + memset(&cls, 0, sizeof(cls)); + cls.lpfnWndProc = test_window_proc; + cls.lpszClassName = "oleacc_test"; + cls.hInstance = GetModuleHandleA(NULL); + + return RegisterClassA(&cls); +} + +static void unregister_window_class(void) +{ + UnregisterClassA("oleacc_test", NULL); +} + +static void test_AccessibleObjectFromWindow(void) +{ + IUnknown *unk; + HRESULT hr; + HWND hwnd; + + hr = AccessibleObjectFromWindow(NULL, OBJID_CURSOR, &IID_IUnknown, NULL); + ok(hr == E_INVALIDARG, "got %x\n", hr); + + hr = AccessibleObjectFromWindow(NULL, OBJID_CURSOR, &IID_IUnknown, (void**)&unk); + todo_wine ok(hr == S_OK, "got %x\n", hr); + if(hr == S_OK) IUnknown_Release(unk); + + hwnd = CreateWindowA("oleacc_test", "test", WS_OVERLAPPEDWINDOW, + 0, 0, 0, 0, NULL, NULL, NULL, NULL); + ok(hwnd != NULL, "CreateWindow failed\n"); + + hr = AccessibleObjectFromWindow(hwnd, OBJID_CURSOR, &IID_IUnknown, (void**)&unk); + ok(hr == E_UNEXPECTED, "got %x\n", hr); + + ok(Object_ref == 1, "Object_ref = %d\n", Object_ref); + hr = AccessibleObjectFromWindow(hwnd, OBJID_CLIENT, &IID_IUnknown, (void**)&unk); + ok(hr == S_OK, "got %x\n", hr); + ok(Object_ref == 2, "Object_ref = %d\n", Object_ref); + IUnknown_Release(unk); + + DestroyWindow(hwnd); +} + +static void test_default_client_accessible_object(void) +{ + static const WCHAR testW[] = {'t','e','s','t',' ','t',' ','&','j','u','n','k',0}; + static const WCHAR shortcutW[] = {'A','l','t','+','t',0}; + + IAccessible *acc; + HWND chld, hwnd; + HRESULT hr; + VARIANT vid, v; + BSTR str; + LONG l; + + hwnd = CreateWindowA("oleacc_test", "test &t &junk", WS_OVERLAPPEDWINDOW, + 0, 0, 0, 0, NULL, NULL, NULL, NULL); + ok(hwnd != NULL, "CreateWindow failed\n"); + chld = CreateWindowA("static", "message", WS_CHILD, + 0, 0, 0, 0, hwnd, NULL, NULL, NULL); + ok(chld != NULL, "CreateWindow failed\n"); + + hr = CreateStdAccessibleObject(NULL, OBJID_CLIENT, &IID_IAccessible, (void**)&acc); + ok(hr == E_FAIL, "got %x\n", hr); + + hr = CreateStdAccessibleObject(hwnd, OBJID_CLIENT, &IID_IAccessible, (void**)&acc); + ok(hr == S_OK, "got %x\n", hr); + + hr = IAccessible_get_accChildCount(acc, &l); + ok(hr == S_OK, "got %x\n", hr); + ok(l == 1, "l = %d\n", l); + + V_VT(&vid) = VT_I4; + V_I4(&vid) = CHILDID_SELF; + hr = IAccessible_get_accName(acc, vid, &str); + ok(hr == S_OK, "got %x\n", hr); + ok(!lstrcmpW(str, testW), "name = %s\n", wine_dbgstr_w(str)); + SysFreeString(str); + + V_I4(&vid) = 1; + str = (void*)0xdeadbeef; + hr = IAccessible_get_accName(acc, vid, &str); + ok(hr == E_INVALIDARG, "got %x\n", hr); + ok(!str, "str != NULL\n"); + V_I4(&vid) = CHILDID_SELF; + + str = (void*)0xdeadbeef; + hr = IAccessible_get_accValue(acc, vid, &str); + ok(hr == S_FALSE, "got %x\n", hr); + ok(!str, "str != NULL\n"); + + str = (void*)0xdeadbeef; + hr = IAccessible_get_accDescription(acc, vid, &str); + ok(hr == S_FALSE, "got %x\n", hr); + ok(!str, "str != NULL\n"); + + V_VT(&v) = VT_DISPATCH; + V_DISPATCH(&v) = (void*)0xdeadbeef; + hr = IAccessible_get_accRole(acc, vid, &v); + ok(hr == S_OK, "got %x\n", hr); + ok(V_VT(&v) == VT_I4, "V_VT(&v) = %d\n", V_VT(&v)); + ok(V_I4(&v) == ROLE_SYSTEM_CLIENT, "V_I4(&v) = %d\n", V_I4(&v)); + + V_VT(&v) = VT_DISPATCH; + V_DISPATCH(&v) = (void*)0xdeadbeef; + hr = IAccessible_get_accState(acc, vid, &v); + ok(hr == S_OK, "got %x\n", hr); + ok(V_VT(&v) == VT_I4, "V_VT(&v) = %d\n", V_VT(&v)); + ok(V_I4(&v) == (STATE_SYSTEM_FOCUSABLE|STATE_SYSTEM_INVISIBLE) || + broken(V_I4(&v) == STATE_SYSTEM_INVISIBLE), "V_I4(&v) = %x\n", V_I4(&v)); + + str = (void*)0xdeadbeef; + hr = IAccessible_get_accHelp(acc, vid, &str); + ok(hr == S_FALSE, "got %x\n", hr); + ok(!str, "str != NULL\n"); + + hr = IAccessible_get_accKeyboardShortcut(acc, vid, &str); + ok(hr == S_OK, "got %x\n", hr); + ok(!lstrcmpW(str, shortcutW), "str = %s\n", wine_dbgstr_w(str)); + SysFreeString(str); + + str = (void*)0xdeadbeef; + hr = IAccessible_get_accDefaultAction(acc, vid, &str); + ok(hr == S_FALSE, "got %x\n", hr); + ok(!str, "str != NULL\n"); + + DestroyWindow(hwnd); + + hr = IAccessible_get_accChildCount(acc, &l); + ok(hr == S_OK, "got %x\n", hr); + ok(l == 0, "l = %d\n", l); + + hr = IAccessible_get_accName(acc, vid, &str); + ok(hr == E_INVALIDARG, "got %x\n", hr); + + hr = IAccessible_get_accValue(acc, vid, &str); + ok(hr == S_FALSE, "got %x\n", hr); + + hr = IAccessible_get_accRole(acc, vid, &v); + ok(hr == S_OK, "got %x\n", hr); + ok(V_VT(&v) == VT_I4, "V_VT(&v) = %d\n", V_VT(&v)); + ok(V_I4(&v) == ROLE_SYSTEM_CLIENT, "V_I4(&v) = %d\n", V_I4(&v)); + + hr = IAccessible_get_accState(acc, vid, &v); + ok(hr == S_OK, "got %x\n", hr); + ok(V_VT(&v) == VT_I4, "V_VT(&v) = %d\n", V_VT(&v)); + ok(V_I4(&v) == STATE_SYSTEM_INVISIBLE, "V_I4(&v) = %x\n", V_I4(&v)); + + IAccessible_Release(acc); +} + START_TEST(main) { + int argc; + char **argv; + + CoInitializeEx(NULL, COINIT_MULTITHREADED); + + argc = winetest_get_mainargs(&argv); + if(argc == 4 && !strcmp(argv[2], "ObjectFromLresult")) { + IUnknown *unk; + HRESULT hres; + LRESULT lres; + + sscanf(argv[3], "%lx", &lres); + hres = ObjectFromLresult(lres, &IID_IUnknown, 0, (void**)&unk); + ok(hres == S_OK, "hres = %x\n", hres); + IUnknown_Release(unk); + + CoUninitialize(); + return; + } + + if(!register_window_class()) { + skip("can't register test window class\n"); + return; + } + test_getroletext(); + test_LresultFromObject(argv[0]); + test_AccessibleObjectFromWindow(); + test_default_client_accessible_object(); + + unregister_window_class(); + CoUninitialize(); } diff -Nru wine1.7-1.7.14/dlls/oleacc/tests/Makefile.in wine1.7-1.7.18/dlls/oleacc/tests/Makefile.in --- wine1.7-1.7.14/dlls/oleacc/tests/Makefile.in 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/oleacc/tests/Makefile.in 2014-05-02 18:15:48.000000000 +0000 @@ -1,5 +1,5 @@ TESTDLL = oleacc.dll -IMPORTS = oleacc +IMPORTS = ole32 oleacc oleaut32 user32 C_SRCS = \ main.c diff -Nru wine1.7-1.7.14/dlls/oleaut32/olepicture.c wine1.7-1.7.18/dlls/oleaut32/olepicture.c --- wine1.7-1.7.14/dlls/oleaut32/olepicture.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/oleaut32/olepicture.c 2014-05-02 18:15:48.000000000 +0000 @@ -1390,12 +1390,17 @@ } headerread += xread; xread = 0; - + if (!memcmp(&(header[0]),"lt\0\0", 4) && (statfailed || (header[1] + headerread <= statstg.cbSize.QuadPart))) { if (toread != 0 && toread != header[1]) FIXME("varying lengths of image data (prev=%u curr=%u), only last one will be used\n", toread, header[1]); toread = header[1]; + if (statfailed) + { + statstg.cbSize.QuadPart = header[1] + 8; + statfailed = FALSE; + } if (toread == 0) break; } else { if (!memcmp(&(header[0]), "GIF8", 4) || /* GIF header */ diff -Nru wine1.7-1.7.14/dlls/oleaut32/recinfo.c wine1.7-1.7.18/dlls/oleaut32/recinfo.c --- wine1.7-1.7.14/dlls/oleaut32/recinfo.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/oleaut32/recinfo.c 2014-05-02 18:15:48.000000000 +0000 @@ -180,7 +180,7 @@ int i; for(i=0; in_vars; i++) SysFreeString(This->fields[i].name); - HeapFree(GetProcessHeap(), 0, This->name); + SysFreeString(This->name); HeapFree(GetProcessHeap(), 0, This->fields); ITypeInfo_Release(This->pTypeInfo); HeapFree(GetProcessHeap(), 0, This); diff -Nru wine1.7-1.7.14/dlls/oleaut32/tests/olepicture.c wine1.7-1.7.18/dlls/oleaut32/tests/olepicture.c --- wine1.7-1.7.14/dlls/oleaut32/tests/olepicture.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/oleaut32/tests/olepicture.c 2014-05-02 18:15:48.000000000 +0000 @@ -1157,7 +1157,8 @@ HGLOBAL hmem; DWORD *mem; IPersistStream *src_stream; - IStream *dst_stream; + IStream *dst_stream, *stream; + LARGE_INTEGER offset; HRESULT hr; memset(&pic, 0, sizeof(pic)); @@ -1192,10 +1193,57 @@ GlobalUnlock(hmem); IPersistStream_Release(src_stream); + IPicture_Release(pic); + + /* first with statable and seekable stream */ + offset.QuadPart = 0; + hr = IStream_Seek(dst_stream, offset, SEEK_SET, NULL); + ok(hr == S_OK, "IStream_Seek %#x\n", hr); + + pic = NULL; + hr = pOleLoadPicture(dst_stream, 0, FALSE, &IID_IPicture, (void **)&pic); + ok(hr == S_OK, "OleLoadPicture error %#x\n", hr); + ok(pic != NULL,"picture should not be not NULL\n"); + if (pic != NULL) + { + type = -1; + hr = IPicture_get_Type(pic, &type); + ok(hr == S_OK,"get_Type error %#8x\n", hr); + ok(type == PICTYPE_NONE,"expected picture type PICTYPE_NONE, got %d\n", type); + + handle = (OLE_HANDLE)0xdeadbeef; + hr = IPicture_get_Handle(pic, &handle); + ok(hr == S_OK,"get_Handle error %#8x\n", hr); + ok(!handle, "get_Handle returned wrong handle %#x\n", handle); + + IPicture_Release(pic); + } IStream_Release(dst_stream); - GlobalFree(hmem); - IPicture_Release(pic); + /* again with non-statable and non-seekable stream */ + stream = NoStatStream_Construct(hmem); + ok(stream != NULL, "failed to create empty image stream\n"); + + pic = NULL; + hr = pOleLoadPicture(stream, 0, FALSE, &IID_IPicture, (void **)&pic); + ok(hr == S_OK, "OleLoadPicture error %#x\n", hr); + ok(pic != NULL,"picture should not be not NULL\n"); + if (pic != NULL) + { + type = -1; + hr = IPicture_get_Type(pic, &type); + ok(hr == S_OK,"get_Type error %#8x\n", hr); + ok(type == PICTYPE_NONE,"expected picture type PICTYPE_NONE, got %d\n", type); + + handle = (OLE_HANDLE)0xdeadbeef; + hr = IPicture_get_Handle(pic, &handle); + ok(hr == S_OK,"get_Handle error %#8x\n", hr); + ok(!handle, "get_Handle returned wrong handle %#x\n", handle); + + IPicture_Release(pic); + } + /* Non-statable impl always deletes on release */ + IStream_Release(stream); } START_TEST(olepicture) diff -Nru wine1.7-1.7.14/dlls/oleaut32/tests/safearray.c wine1.7-1.7.18/dlls/oleaut32/tests/safearray.c --- wine1.7-1.7.14/dlls/oleaut32/tests/safearray.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/oleaut32/tests/safearray.c 2014-05-02 18:15:48.000000000 +0000 @@ -1080,8 +1080,6 @@ return; /* Some early versions can't handle > 3 dims */ ok(sa->cbElements == sizeof(value), "int size mismatch\n"); - if (sa->cbElements != sizeof(value)) - return; /* Failure cases */ for (x = 0; x < NUM_DIMENSIONS; x++) @@ -1233,8 +1231,6 @@ return; ok(sa->cbElements == sizeof(BSTR), "BSTR size mismatch\n"); - if (sa->cbElements != sizeof(BSTR)) - return; indices[0] = sab.lLbound; value = SysAllocString(szTest); @@ -1297,8 +1293,6 @@ return; ok(sa->cbElements == sizeof(LPUNKNOWN), "LPUNKNOWN size mismatch\n"); - if (sa->cbElements != sizeof(LPUNKNOWN)) - return; indices[0] = sab.lLbound; xtunk.ref = 1; @@ -1331,8 +1325,6 @@ return; ok(sa->cbElements == sizeof(LPUNKNOWN), "LPUNKNOWN size mismatch\n"); - if (sa->cbElements != sizeof(LPUNKNOWN)) - return; indices[0] = 2; xtunk.ref = 1; @@ -1363,8 +1355,6 @@ return; ok(sa->cbElements == sizeof(VARIANT), "VARIANT size mismatch\n"); - if (sa->cbElements != sizeof(VARIANT)) - return; indices[0] = sab.lLbound; V_VT(&value) = VT_I4; @@ -1418,8 +1408,6 @@ return; ok(sa->cbElements == sizeof(int), "int size mismatch\n"); - if (sa->cbElements != sizeof(int)) - return; /* Fill the source array with some data; it doesn't matter what */ for (dimension = 0; dimension < size; dimension++) @@ -1662,7 +1650,7 @@ sacopy = pSafeArrayCreateEx(VT_RECORD, 1, sab, &iRec->IRecordInfo_iface); iRec->recordcopy = 0; iRec->clearCalled = 0; - /* array copy code doesn't explicitely clear a record */ + /* array copy code doesn't explicitly clear a record */ hres = SafeArrayCopyData(sa, sacopy); ok(hres == S_OK, "got 0x%08x\n", hres); ok(iRec->recordcopy == sab[0].cElements, "got %d\n", iRec->recordcopy); diff -Nru wine1.7-1.7.14/dlls/oleaut32/tests/vartest.c wine1.7-1.7.18/dlls/oleaut32/tests/vartest.c --- wine1.7-1.7.14/dlls/oleaut32/tests/vartest.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/oleaut32/tests/vartest.c 2014-05-02 18:15:48.000000000 +0000 @@ -542,14 +542,11 @@ static void test_VariantInit(void) { - VARIANTARG v1, v2; + VARIANT v; - /* Test that VariantInit() only sets the type */ - memset(&v1, -1, sizeof(v1)); - v2 = v1; - V_VT(&v2) = VT_EMPTY; - VariantInit(&v1); - ok(!memcmp(&v1, &v2, sizeof(v1)), "VariantInit() set extra fields\n"); + memset(&v, -1, sizeof(v)); + VariantInit(&v); + ok(V_VT(&v) == VT_EMPTY, "VariantInit() returned vt %d\n", V_VT(&v)); } /* All possible combinations of extra V_VT() flags */ @@ -6003,11 +6000,11 @@ VARTYPE i; HRESULT hres; + CHECKPTR(VarAnd); + true_str = SysAllocString(szTrue); false_str = SysAllocString(szFalse); - CHECKPTR(VarAnd); - /* Test all possible flag/vt combinations & the resulting vt type */ for (i = 0; i < sizeof(ExtraFlags)/sizeof(ExtraFlags[0]); i++) { @@ -7482,11 +7479,11 @@ HRESULT hres; double r; + CHECKPTR(VarDiv); + num1_str = SysAllocString(str1); num2_str = SysAllocString(str2); - CHECKPTR(VarDiv); - /* Test all possible flag/vt combinations & the resulting vt type */ for (i = 0; i < sizeof(ExtraFlags)/sizeof(ExtraFlags[0]); i++) { diff -Nru wine1.7-1.7.14/dlls/oleaut32/tests/vartype.c wine1.7-1.7.18/dlls/oleaut32/tests/vartype.c --- wine1.7-1.7.14/dlls/oleaut32/tests/vartype.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/oleaut32/tests/vartype.c 2014-05-02 18:15:48.000000000 +0000 @@ -739,11 +739,15 @@ CHECKPTR(VarI1FromR4); CONVERT(VarI1FromR4, -129.0f); EXPECT_OVERFLOW; + CONVERT(VarI1FromR4, -128.51f); EXPECT_OVERFLOW; + CONVERT(VarI1FromR4, -128.5f); EXPECT(-128); CONVERT(VarI1FromR4, -128.0f); EXPECT(-128); CONVERT(VarI1FromR4, -1.0f); EXPECT(-1); CONVERT(VarI1FromR4, 0.0f); EXPECT(0); CONVERT(VarI1FromR4, 1.0f); EXPECT(1); CONVERT(VarI1FromR4, 127.0f); EXPECT(127); + CONVERT(VarI1FromR4, 127.49f); EXPECT(127); + CONVERT(VarI1FromR4, 127.5f); EXPECT_OVERFLOW; CONVERT(VarI1FromR4, 128.0f); EXPECT_OVERFLOW; CONVERT(VarI1FromR4, -1.5f); EXPECT(-2); @@ -762,11 +766,15 @@ CHECKPTR(VarI1FromR8); CONVERT(VarI1FromR8, -129.0); EXPECT_OVERFLOW; + CONVERT(VarI1FromR8, -128.51); EXPECT_OVERFLOW; + CONVERT(VarI1FromR8, -128.5); EXPECT(-128); CONVERT(VarI1FromR8, -128.0); EXPECT(-128); CONVERT(VarI1FromR8, -1.0); EXPECT(-1); CONVERT(VarI1FromR8, 0.0); EXPECT(0); CONVERT(VarI1FromR8, 1.0); EXPECT(1); CONVERT(VarI1FromR8, 127.0); EXPECT(127); + CONVERT(VarI1FromR8, 127.49); EXPECT(127); + CONVERT(VarI1FromR8, 127.5); EXPECT_OVERFLOW; CONVERT(VarI1FromR8, 128.0); EXPECT_OVERFLOW; CONVERT(VarI1FromR8, -1.5); EXPECT(-2); @@ -983,9 +991,13 @@ CHECKPTR(VarUI1FromR4); CONVERT(VarUI1FromR4, -1.0f); EXPECT_OVERFLOW; + CONVERT(VarUI1FromR4, -0.51f); EXPECT_OVERFLOW; + CONVERT(VarUI1FromR4, -0.5f); EXPECT(0); CONVERT(VarUI1FromR4, 0.0f); EXPECT(0); CONVERT(VarUI1FromR4, 1.0f); EXPECT(1); CONVERT(VarUI1FromR4, 255.0f); EXPECT(255); + CONVERT(VarUI1FromR4, 255.49f); EXPECT(255); + CONVERT(VarUI1FromR4, 255.5f); EXPECT_OVERFLOW; CONVERT(VarUI1FromR4, 256.0f); EXPECT_OVERFLOW; /* Rounding */ @@ -1005,9 +1017,13 @@ CHECKPTR(VarUI1FromR8); CONVERT(VarUI1FromR8, -1.0); EXPECT_OVERFLOW; + CONVERT(VarUI1FromR8, -0.51); EXPECT_OVERFLOW; + CONVERT(VarUI1FromR8, -0.5); EXPECT(0); CONVERT(VarUI1FromR8, 0.0); EXPECT(0); CONVERT(VarUI1FromR8, 1.0); EXPECT(1); CONVERT(VarUI1FromR8, 255.0); EXPECT(255); + CONVERT(VarUI1FromR8, 255.49); EXPECT(255); + CONVERT(VarUI1FromR8, 255.5); EXPECT_OVERFLOW; CONVERT(VarUI1FromR8, 256.0); EXPECT_OVERFLOW; /* Rounding */ @@ -1281,11 +1297,15 @@ CHECKPTR(VarI2FromR4); CONVERT(VarI2FromR4, -32769.0f); EXPECT_OVERFLOW; + CONVERT(VarI2FromR4, -32768.51f); EXPECT_OVERFLOW; + CONVERT(VarI2FromR4, -32768.5f); EXPECT(-32768); CONVERT(VarI2FromR4, -32768.0f); EXPECT(-32768); CONVERT(VarI2FromR4, -1.0f); EXPECT(-1); CONVERT(VarI2FromR4, 0.0f); EXPECT(0); CONVERT(VarI2FromR4, 1.0f); EXPECT(1); CONVERT(VarI2FromR4, 32767.0f); EXPECT(32767); + CONVERT(VarI2FromR4, 32767.49f); EXPECT(32767); + CONVERT(VarI2FromR4, 32767.5f); EXPECT_OVERFLOW; CONVERT(VarI2FromR4, 32768.0f); EXPECT_OVERFLOW; /* Rounding */ @@ -1305,11 +1325,15 @@ CHECKPTR(VarI2FromR8); CONVERT(VarI2FromR8, -32769.0); EXPECT_OVERFLOW; + CONVERT(VarI2FromR8, -32768.51); EXPECT_OVERFLOW; + CONVERT(VarI2FromR8, -32768.5); EXPECT(-32768); CONVERT(VarI2FromR8, -32768.0); EXPECT(-32768); CONVERT(VarI2FromR8, -1.0); EXPECT(-1); CONVERT(VarI2FromR8, 0.0); EXPECT(0); CONVERT(VarI2FromR8, 1.0); EXPECT(1); CONVERT(VarI2FromR8, 32767.0); EXPECT(32767); + CONVERT(VarI2FromR8, 32767.49); EXPECT(32767); + CONVERT(VarI2FromR8, 32767.5); EXPECT_OVERFLOW; CONVERT(VarI2FromR8, 32768.0); EXPECT_OVERFLOW; /* Rounding */ @@ -1529,9 +1553,13 @@ CHECKPTR(VarUI2FromR4); CONVERT(VarUI2FromR4, -1.0f); EXPECT_OVERFLOW; + CONVERT(VarUI2FromR4, -0.51f); EXPECT_OVERFLOW; + CONVERT(VarUI2FromR4, -0.5f); EXPECT(0); CONVERT(VarUI2FromR4, 0.0f); EXPECT(0); CONVERT(VarUI2FromR4, 1.0f); EXPECT(1); CONVERT(VarUI2FromR4, 65535.0f); EXPECT(65535); + CONVERT(VarUI2FromR4, 65535.49f); EXPECT(65535); + CONVERT(VarUI2FromR4, 65535.5f); EXPECT_OVERFLOW; CONVERT(VarUI2FromR4, 65536.0f); EXPECT_OVERFLOW; /* Rounding */ @@ -1551,9 +1579,13 @@ CHECKPTR(VarUI2FromR8); CONVERT(VarUI2FromR8, -1.0); EXPECT_OVERFLOW; + CONVERT(VarUI2FromR8, -0.51); EXPECT_OVERFLOW; + CONVERT(VarUI2FromR8, -0.5); EXPECT(0); CONVERT(VarUI2FromR8, 0.0); EXPECT(0); CONVERT(VarUI2FromR8, 1.0); EXPECT(1); CONVERT(VarUI2FromR8, 65535.0); EXPECT(65535); + CONVERT(VarUI2FromR8, 65535.49); EXPECT(65535); + CONVERT(VarUI2FromR8, 65535.5); EXPECT_OVERFLOW; CONVERT(VarUI2FromR8, 65536.0); EXPECT_OVERFLOW; /* Rounding */ @@ -1792,11 +1824,15 @@ CHECKPTR(VarI4FromR8); CONVERT(VarI4FromR8, -2147483649.0); EXPECT_OVERFLOW; + CONVERT(VarI4FromR8, -2147483648.51); EXPECT_OVERFLOW; + CONVERT(VarI4FromR8, -2147483648.5); EXPECT(-2147483647 - 1); CONVERT(VarI4FromR8, -2147483648.0); EXPECT(-2147483647 - 1); CONVERT(VarI4FromR8, -1.0); EXPECT(-1); CONVERT(VarI4FromR8, 0.0); EXPECT(0); CONVERT(VarI4FromR8, 1.0); EXPECT(1); CONVERT(VarI4FromR8, 2147483647.0); EXPECT(2147483647); + CONVERT(VarI4FromR8, 2147483647.49); EXPECT(2147483647); + CONVERT(VarI4FromR8, 2147483647.5); EXPECT_OVERFLOW; CONVERT(VarI4FromR8, 2147483648.0); EXPECT_OVERFLOW; CONVERT(VarI4FromR8, -1.5); EXPECT(-2); @@ -2017,6 +2053,8 @@ CHECKPTR(VarUI4FromR4); /* We can't test max values as they are not exactly representable in a float */ CONVERT(VarUI4FromR4, -1.0f); EXPECT_OVERFLOW; + CONVERT(VarUI4FromR4, -0.51f); EXPECT_OVERFLOW; + CONVERT(VarUI4FromR4, -0.5f); EXPECT(0); CONVERT(VarUI4FromR4, 0.0f); EXPECT(0); CONVERT(VarUI4FromR4, 1.0f); EXPECT(1); @@ -2037,9 +2075,13 @@ CHECKPTR(VarUI4FromR8); CONVERT(VarUI4FromR8, -1.0); EXPECT_OVERFLOW; + CONVERT(VarUI4FromR4, -0.51f); EXPECT_OVERFLOW; + CONVERT(VarUI4FromR4, -0.5f); EXPECT(0); CONVERT(VarUI4FromR8, 0.0); EXPECT(0); CONVERT(VarUI4FromR8, 1.0); EXPECT(1); CONVERT(VarUI4FromR8, 4294967295.0); EXPECT(4294967295ul); + CONVERT(VarUI4FromR8, 4294967295.49); EXPECT(4294967295ul); + CONVERT(VarUI4FromR8, 4294967295.5); EXPECT_OVERFLOW; CONVERT(VarUI4FromR8, 4294967296.0); EXPECT_OVERFLOW; CONVERT(VarUI4FromR8, -1.5); EXPECT_OVERFLOW; @@ -6227,6 +6269,13 @@ hres = VariantChangeTypeEx(&v2, &v1, 0, 0, VT_INT); ok(hres == DISP_E_TYPEMISMATCH, "VariantChangeTypeEx returns %08x\n", hres); ok(V_VT(&v2) == VT_INT && V_INT(&v2) == 4, "VariantChangeTypeEx changed dst variant\n"); + V_VT(&v2) = 0xff; /* incorrect variant type */ + hres = VariantChangeTypeEx(&v2, &v1, 0, 0, VT_INT); + ok(hres == DISP_E_TYPEMISMATCH, "VariantChangeTypeEx returns %08x\n", hres); + ok(V_VT(&v2) == 0xff, "VariantChangeTypeEx changed dst variant\n"); + hres = VariantChangeTypeEx(&v2, &v1, 0, 0, VT_BSTR); + ok(hres == DISP_E_BADVARTYPE, "VariantChangeTypeEx returns %08x\n", hres); + ok(V_VT(&v2) == 0xff, "VariantChangeTypeEx changed dst variant\n"); SysFreeString(bstr); } diff -Nru wine1.7-1.7.14/dlls/oleaut32/typelib.c wine1.7-1.7.18/dlls/oleaut32/typelib.c --- wine1.7-1.7.14/dlls/oleaut32/typelib.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/oleaut32/typelib.c 2014-05-02 18:15:48.000000000 +0000 @@ -542,12 +542,17 @@ TLIBATTR *attr; res = ITypeLib_GetLibAttr(*ppTLib, &attr); - if (res == S_OK && (attr->wMajorVerNum != wVerMajor || attr->wMinorVerNum < wVerMinor)) + if (res == S_OK) { + BOOL mismatch = attr->wMajorVerNum != wVerMajor || attr->wMinorVerNum < wVerMinor; ITypeLib_ReleaseTLibAttr(*ppTLib, attr); - ITypeLib_Release(*ppTLib); - *ppTLib = NULL; - res = TYPE_E_LIBNOTREGISTERED; + + if (mismatch) + { + ITypeLib_Release(*ppTLib); + *ppTLib = NULL; + res = TYPE_E_LIBNOTREGISTERED; + } } } } diff -Nru wine1.7-1.7.14/dlls/oleaut32/variant.c wine1.7-1.7.18/dlls/oleaut32/variant.c --- wine1.7-1.7.14/dlls/oleaut32/variant.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/oleaut32/variant.c 2014-05-02 18:15:48.000000000 +0000 @@ -575,7 +575,8 @@ { TRACE("(%p)\n", pVarg); - V_VT(pVarg) = VT_EMPTY; /* Native doesn't set any other fields */ + /* Win8.1 zeroes whole struct. Previous implementations don't set any other fields. */ + V_VT(pVarg) = VT_EMPTY; } HRESULT VARIANT_ClearInd(VARIANTARG *pVarg) @@ -1041,7 +1042,7 @@ if (SUCCEEDED(res)) { V_VT(&vTmp) = vt; - VariantCopy(pvargDest, &vTmp); + res = VariantCopy(pvargDest, &vTmp); } VariantClear(&vTmp); VariantClear(&vSrcDeref); diff -Nru wine1.7-1.7.14/dlls/oleaut32/vartype.c wine1.7-1.7.18/dlls/oleaut32/vartype.c --- wine1.7-1.7.14/dlls/oleaut32/vartype.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/oleaut32/vartype.c 2014-05-02 18:15:48.000000000 +0000 @@ -362,7 +362,7 @@ */ HRESULT WINAPI VarI1FromR8(double dblIn, signed char* pcOut) { - if (dblIn < (double)I1_MIN || dblIn > (double)I1_MAX) + if (dblIn < I1_MIN - 0.5 || dblIn >= I1_MAX + 0.5) return DISP_E_OVERFLOW; VARIANT_DutchRound(CHAR, dblIn, *pcOut); return S_OK; @@ -652,7 +652,7 @@ */ HRESULT WINAPI VarUI1FromR8(double dblIn, BYTE* pbOut) { - if (dblIn < -0.5 || dblIn > (double)UI1_MAX) + if (dblIn < -0.5 || dblIn >= UI1_MAX + 0.5) return DISP_E_OVERFLOW; VARIANT_DutchRound(BYTE, dblIn, *pbOut); return S_OK; @@ -958,7 +958,7 @@ */ HRESULT WINAPI VarI2FromR8(double dblIn, SHORT* psOut) { - if (dblIn < (double)I2_MIN || dblIn > (double)I2_MAX) + if (dblIn < I2_MIN - 0.5 || dblIn >= I2_MAX + 0.5) return DISP_E_OVERFLOW; VARIANT_DutchRound(SHORT, dblIn, *psOut); return S_OK; @@ -1270,7 +1270,7 @@ */ HRESULT WINAPI VarUI2FromR8(double dblIn, USHORT* pusOut) { - if (dblIn < -0.5 || dblIn > (double)UI2_MAX) + if (dblIn < -0.5 || dblIn >= UI2_MAX + 0.5) return DISP_E_OVERFLOW; VARIANT_DutchRound(USHORT, dblIn, *pusOut); return S_OK; @@ -1550,7 +1550,7 @@ */ HRESULT WINAPI VarI4FromR8(double dblIn, LONG *piOut) { - if (dblIn < (double)I4_MIN || dblIn > (double)I4_MAX) + if (dblIn < I4_MIN - 0.5 || dblIn >= I4_MAX + 0.5) return DISP_E_OVERFLOW; VARIANT_DutchRound(LONG, dblIn, *piOut); return S_OK; @@ -1859,7 +1859,7 @@ */ HRESULT WINAPI VarUI4FromR8(double dblIn, ULONG *pulOut) { - if (dblIn < -0.5 || dblIn > (double)UI4_MAX) + if (dblIn < -0.5 || dblIn >= UI4_MAX + 0.5) return DISP_E_OVERFLOW; VARIANT_DutchRound(ULONG, dblIn, *pulOut); return S_OK; diff -Nru wine1.7-1.7.14/dlls/opengl32/tests/opengl.c wine1.7-1.7.18/dlls/opengl32/tests/opengl.c --- wine1.7-1.7.14/dlls/opengl32/tests/opengl.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/opengl32/tests/opengl.c 2014-05-02 18:15:48.000000000 +0000 @@ -1509,7 +1509,7 @@ 0, 0, 0 /* layer masks */ }; int pixel_format; - HWND window1, window2; + HWND window1, window2, old_parent; HGLRC ctx1, ctx2, oldctx; BOOL ret; HDC dc1, dc2; @@ -1550,7 +1550,7 @@ ok(ret, "Failed to set swap interval to 0, last error %#x.\n", GetLastError()); interval = pwglGetSwapIntervalEXT(); - ok(interval == 0, "Expected default swap interval 0, got %d\n", interval); + ok(interval == 0, "Expected swap interval 0, got %d\n", interval); /* Check what interval we get on a second context on the same drawable.*/ ctx2 = wglCreateContext(dc1); @@ -1582,7 +1582,17 @@ * is not global or shared among contexts. */ interval = pwglGetSwapIntervalEXT(); - ok(interval == 1, "Expected swap interval 1, got %d\n", interval); + ok(interval == 1, "Expected default swap interval 1, got %d\n", interval); + + /* Test if setting the parent of a window resets the swap interval. */ + ret = wglMakeCurrent(dc1, ctx1); + ok(ret, "Failed to make context current, last error %#x.\n", GetLastError()); + + old_parent = SetParent(window1, window2); + ok(!!old_parent, "Failed to make window1 a child of window2, last error %#x.\n", GetLastError()); + + interval = pwglGetSwapIntervalEXT(); + ok(interval == 0, "Expected swap interval 0, got %d\n", interval); ret = wglDeleteContext(ctx1); ok(ret, "Failed to delete GL context, last error %#x.\n", GetLastError()); diff -Nru wine1.7-1.7.14/dlls/qcap/avico.c wine1.7-1.7.18/dlls/qcap/avico.c --- wine1.7-1.7.14/dlls/qcap/avico.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/qcap/avico.c 2014-05-02 18:15:48.000000000 +0000 @@ -45,6 +45,7 @@ VIDEOINFOHEADER *videoinfo; size_t videoinfo_size; DWORD driver_flags; + DWORD max_frame_size; DWORD frame_cnt; } AVICompressor; @@ -111,6 +112,7 @@ This->videoinfo->dwBitRate = 10000000/src_videoinfo->AvgTimePerFrame * This->videoinfo->bmiHeader.biSizeImage * 8; This->videoinfo->AvgTimePerFrame = src_videoinfo->AvgTimePerFrame; + This->max_frame_size = This->videoinfo->bmiHeader.biSizeImage; return S_OK; } @@ -547,6 +549,7 @@ FIXME("Unsupported temporal compression\n"); src_videoinfo = (VIDEOINFOHEADER*)This->in->pin.mtCurrent.pbFormat; + This->videoinfo->bmiHeader.biSizeImage = This->max_frame_size; res = ICCompress(This->hic, sync_point ? ICCOMPRESS_KEYFRAME : 0, &This->videoinfo->bmiHeader, buf, &src_videoinfo->bmiHeader, ptr, 0, &comp_flags, This->frame_cnt, 0, 0, NULL, NULL); if(res != ICERR_OK) { @@ -658,8 +661,8 @@ if (!ppropInputRequest->cBuffers) ppropInputRequest->cBuffers = 1; - if (ppropInputRequest->cbBuffer < This->videoinfo->bmiHeader.biSizeImage) - ppropInputRequest->cbBuffer = This->videoinfo->bmiHeader.biSizeImage; + if (ppropInputRequest->cbBuffer < This->max_frame_size) + ppropInputRequest->cbBuffer = This->max_frame_size; if (!ppropInputRequest->cbAlign) ppropInputRequest->cbAlign = 1; diff -Nru wine1.7-1.7.14/dlls/qcap/tests/qcap.c wine1.7-1.7.18/dlls/qcap/tests/qcap.c --- wine1.7-1.7.14/dlls/qcap/tests/qcap.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/qcap/tests/qcap.c 2014-05-02 18:15:48.000000000 +0000 @@ -1055,9 +1055,12 @@ REFERENCE_TIME off, tmp; LARGE_INTEGER li; BYTE *data; + HRESULT hr; - IMediaSample_GetTime(pSample, &off, &tmp); - IMediaSample_GetPointer(pSample, &data); + hr = IMediaSample_GetTime(pSample, &off, &tmp); + ok(hr == S_OK, "got 0x%08x\n", hr); + hr = IMediaSample_GetPointer(pSample, &data); + ok(hr == S_OK, "got 0x%08x\n", hr); li.QuadPart = off; IStream_Seek(avi_stream, li, STREAM_SEEK_SET, NULL); IStream_Write(avi_stream, data, IMediaSample_GetActualDataLength(pSample), NULL); @@ -1779,11 +1782,13 @@ props.cbAlign = 0xdeadbee3; props.cbPrefix = 0xdeadbee4; hr = IMemInputPin_GetAllocatorRequirements(memin, &props); - ok(hr == S_OK, "GetAllocatorRequirments returned %x\n", hr); - ok(props.cBuffers == 0xdeadbee1, "cBuffers = %d\n", props.cBuffers); - ok(props.cbBuffer == 0xdeadbee2, "cbBuffer = %d\n", props.cbBuffer); - ok(props.cbAlign == 1, "cbAlign = %d\n", props.cbAlign); - ok(props.cbPrefix == 8, "cbPrefix = %d\n", props.cbPrefix); + ok(hr==S_OK || broken(hr==E_INVALIDARG), "GetAllocatorRequirments returned %x\n", hr); + if(hr == S_OK) { + ok(props.cBuffers == 0xdeadbee1, "cBuffers = %d\n", props.cBuffers); + ok(props.cbBuffer == 0xdeadbee2, "cbBuffer = %d\n", props.cbBuffer); + ok(props.cbAlign == 1, "cbAlign = %d\n", props.cbAlign); + ok(props.cbPrefix == 8, "cbPrefix = %d\n", props.cbPrefix); + } hr = IMemInputPin_GetAllocator(memin, &memalloc); ok(hr == S_OK, "GetAllocator returned %x\n", hr); @@ -1824,13 +1829,13 @@ ok(memalloc != &MemAllocator, "memalloc == &MemAllocator\n"); IMemAllocator_Release(memalloc); - CreateStreamOnHGlobal(NULL, TRUE, &avi_stream); + hr = CreateStreamOnHGlobal(NULL, TRUE, &avi_stream); + ok(hr == S_OK, "got 0x%08x\n", hr); SET_EXPECT(MediaSeeking_GetPositions); SET_EXPECT(MemInputPin_QueryInterface_IStream); hr = IBaseFilter_Run(avimux, 0); ok(hr == S_OK, "Run returned %x\n", hr); CHECK_CALLED(MediaSeeking_GetPositions); - CHECK_CALLED(MemInputPin_QueryInterface_IStream); hr = IBaseFilter_GetState(avimux, 0, &state); ok(hr == S_OK, "GetState returned %x\n", hr); @@ -1911,6 +1916,7 @@ hr = IBaseFilter_Stop(avimux); ok(hr == S_OK, "Stop returned %x\n", hr); + CHECK_CALLED(MemInputPin_QueryInterface_IStream); hr = IBaseFilter_GetState(avimux, 0, &state); ok(hr == S_OK, "GetState returned %x\n", hr); diff -Nru wine1.7-1.7.14/dlls/qcap/v4l.c wine1.7-1.7.18/dlls/qcap/v4l.c --- wine1.7-1.7.14/dlls/qcap/v4l.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/qcap/v4l.c 2014-05-02 18:15:48.000000000 +0000 @@ -110,7 +110,7 @@ IPin *pOut; int fd, mmap; - int iscommitted, stopped; + BOOL iscommitted, stopped; struct video_picture pict; int dbrightness, dhue, dcolour, dcontrast; @@ -661,7 +661,8 @@ LeaveCriticalSection(&capBox->CritSect); fail: - capBox->thread = 0; capBox->stopped = 1; + capBox->thread = 0; + capBox->stopped = TRUE; FIXME("Stop IFilterGraph\n"); return 0; } @@ -677,16 +678,18 @@ EnterCriticalSection(&capBox->CritSect); - capBox->stopped = 0; + capBox->stopped = FALSE; if (*state == State_Stopped) { *state = State_Running; - if (!capBox->iscommitted++) + if (!capBox->iscommitted) { ALLOCATOR_PROPERTIES ap, actual; BaseOutputPin *out; + capBox->iscommitted = TRUE; + ap.cBuffers = 3; if (!capBox->swresize) ap.cbBuffer = capBox->width * capBox->height; @@ -755,14 +758,14 @@ { if (*state == State_Paused) ResumeThread(capBox->thread); - capBox->stopped = 1; + capBox->stopped = TRUE; capBox->thread = 0; if (capBox->iscommitted) { BaseOutputPin *out; HRESULT hr; - capBox->iscommitted = 0; + capBox->iscommitted = FALSE; out = (BaseOutputPin*)capBox->pOut; @@ -894,9 +897,9 @@ capBox->bitDepth = 24; capBox->pOut = pOut; capBox->fps = 3; - capBox->stopped = 0; + capBox->stopped = FALSE; capBox->curframe = 0; - capBox->iscommitted = 0; + capBox->iscommitted = FALSE; TRACE("format: %d bits - %d x %d\n", capBox->bitDepth, capBox->width, capBox->height); diff -Nru wine1.7-1.7.14/dlls/qcap/yuv.c wine1.7-1.7.18/dlls/qcap/yuv.c --- wine1.7-1.7.14/dlls/qcap/yuv.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/qcap/yuv.c 2014-05-02 18:15:48.000000000 +0000 @@ -41,7 +41,7 @@ static int yuv_bu[256]; /* Blue U */ static int yuv_rv[256]; /* Red V */ static int yuv_gv[256]; /* Green V */ -static int initialised = 0; +static BOOL initialised = FALSE; static inline int ValidRange(int in) { if (in > 255) in = 255; @@ -67,7 +67,8 @@ float y, u, v; int y_, cb, cr; - if (initialised++) return; + if (initialised) return; + initialised = TRUE; for (y_ = 0; y_ <= 255; y_++) { diff -Nru wine1.7-1.7.14/dlls/qedit/tests/mediadet.c wine1.7-1.7.18/dlls/qedit/tests/mediadet.c --- wine1.7-1.7.14/dlls/qedit/tests/mediadet.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/qedit/tests/mediadet.c 2014-05-02 18:15:48.000000000 +0000 @@ -84,6 +84,7 @@ char *mem; DWORD size, written; HANDLE fh; + BOOL ret; res = FindResourceW(NULL, MAKEINTRESOURCEW(id), MAKEINTRESOURCEW(AVI_RES_TYPE)); if (!res) @@ -116,12 +117,9 @@ if (fh == INVALID_HANDLE_VALUE) return FALSE; - if (!WriteFile(fh, mem, size, &written, NULL) || written != size) - return FALSE; - + ret = WriteFile(fh, mem, size, &written, NULL); CloseHandle(fh); - - return TRUE; + return ret && written == size; } static BOOL init_tests(void) diff -Nru wine1.7-1.7.14/dlls/qmgr/qmgr_main.c wine1.7-1.7.18/dlls/qmgr/qmgr_main.c --- wine1.7-1.7.14/dlls/qmgr/qmgr_main.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/qmgr/qmgr_main.c 2014-05-02 18:15:48.000000000 +0000 @@ -28,6 +28,7 @@ #include "winreg.h" #include "advpub.h" #include "olectl.h" +#include "rpcproxy.h" #include "winsvc.h" #include "bits.h" @@ -41,9 +42,6 @@ /* Handle to the base address of this DLL */ static HINSTANCE hInst; -/* Other GUIDs used by this module */ -DEFINE_GUID(CLSID_BackgroundCopyQMgr, 0x69AD4AEE, 0x51BE, 0x439b, 0xA9,0x2C, 0x86,0xAE,0x49,0x0E,0x8B,0x30); - /* Entry point for DLL */ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { @@ -62,81 +60,12 @@ return TRUE; } -static HRESULT init_register_strtable(STRTABLEA *strtable) -{ -#define CLSID_EXPANSION_ENTRY(id) { "CLSID_" #id, &CLSID_ ## id } - static const struct { - const char *name; - const CLSID *clsid; - } expns[] = { - CLSID_EXPANSION_ENTRY(BackgroundCopyQMgr), - CLSID_EXPANSION_ENTRY(BackgroundCopyManager) - }; -#undef CLSID_EXPANSION_ENTRY - static STRENTRYA pse[sizeof expns / sizeof expns[0]]; - DWORD i; - - strtable->cEntries = sizeof pse / sizeof pse[0]; - strtable->pse = pse; - for (i = 0; i < strtable->cEntries; i++) { - static const char dummy_sample[] = "{12345678-1234-1234-1234-123456789012}"; - const CLSID *clsid = expns[i].clsid; - pse[i].pszName = qmgr_strdup(expns[i].name); - pse[i].pszValue = HeapAlloc(GetProcessHeap(), 0, sizeof dummy_sample); - if (!pse[i].pszName || !pse[i].pszValue) - return E_OUTOFMEMORY; - sprintf(pse[i].pszValue, "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}", - clsid->Data1, clsid->Data2, clsid->Data3, clsid->Data4[0], - clsid->Data4[1], clsid->Data4[2], clsid->Data4[3], clsid->Data4[4], - clsid->Data4[5], clsid->Data4[6], clsid->Data4[7]); - } - - return S_OK; -} - -static void cleanup_register_strtable(STRTABLEA *strtable) -{ - DWORD i; - for (i = 0; i < strtable->cEntries; i++) { - HeapFree(GetProcessHeap(), 0, strtable->pse[i].pszName); - HeapFree(GetProcessHeap(), 0, strtable->pse[i].pszValue); - if (!strtable->pse[i].pszName || !strtable->pse[i].pszValue) - return; - } -} - -/* Use an INF file to register or unregister the DLL */ -static HRESULT register_server(BOOL do_register) -{ - HRESULT hr; - STRTABLEA strtable; - HMODULE hAdvpack; - HRESULT (WINAPI *pRegInstall)(HMODULE hm, LPCSTR pszSection, const STRTABLEA* pstTable); - static const WCHAR wszAdvpack[] = {'a','d','v','p','a','c','k','.','d','l','l',0}; - - TRACE("(%x)\n", do_register); - - hAdvpack = LoadLibraryW(wszAdvpack); - pRegInstall = (void *)GetProcAddress(hAdvpack, "RegInstall"); - - hr = init_register_strtable(&strtable); - if (SUCCEEDED(hr)) - hr = pRegInstall(hInst, do_register ? "RegisterDll" : "UnregisterDll", - &strtable); - cleanup_register_strtable(&strtable); - - if (FAILED(hr)) - ERR("RegInstall failed: %08x\n", hr); - - return hr; -} - HRESULT WINAPI DllRegisterServer(void) { - return register_server(TRUE); + return __wine_register_resources(hInst); } HRESULT WINAPI DllUnregisterServer(void) { - return register_server(FALSE); + return __wine_unregister_resources(hInst); } diff -Nru wine1.7-1.7.14/dlls/quartz/filtergraph.c wine1.7-1.7.18/dlls/quartz/filtergraph.c --- wine1.7-1.7.14/dlls/quartz/filtergraph.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/quartz/filtergraph.c 2014-05-02 18:15:48.000000000 +0000 @@ -1680,7 +1680,7 @@ } /* The file has been already loaded */ - IFileSourceFilter_GetCurFile(pfile, &filename, &mt); + hr = IFileSourceFilter_GetCurFile(pfile, &filename, &mt); if (FAILED(hr)) { WARN("GetCurFile (%x)\n", hr); goto error; diff -Nru wine1.7-1.7.14/dlls/quartz/regsvr.c wine1.7-1.7.18/dlls/quartz/regsvr.c --- wine1.7-1.7.14/dlls/quartz/regsvr.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/quartz/regsvr.c 2014-05-02 18:15:48.000000000 +0000 @@ -612,7 +612,7 @@ if (list->pins[i].mediatypes[j].subtype) memcpy(lpClsid + j*2 + 1, list->pins[i].mediatypes[j].subtype, sizeof(CLSID)); else { - /* Subtype are often a combination of major type + fourcc/tag */ + /* Subtypes are often a combination of major type + fourcc/tag */ memcpy(lpClsid + j*2 + 1, list->pins[i].mediatypes[j].majortype, sizeof(CLSID)); *(DWORD*)(lpClsid + j*2 + 1) = list->pins[i].mediatypes[j].fourcc; } diff -Nru wine1.7-1.7.14/dlls/riched20/caret.c wine1.7-1.7.18/dlls/riched20/caret.c --- wine1.7-1.7.14/dlls/riched20/caret.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/riched20/caret.c 2014-05-02 18:15:48.000000000 +0000 @@ -904,7 +904,7 @@ } static BOOL ME_FindRunInRow(ME_TextEditor *editor, ME_DisplayItem *pRow, - int x, ME_Cursor *cursor, int *pbCaretAtEnd) + int x, ME_Cursor *cursor, BOOL *pbCaretAtEnd) { ME_DisplayItem *pNext, *pLastRun; ME_Row *row = &pRow->member.row; @@ -964,7 +964,7 @@ y -= editor->rcFormat.top; if (is_eol) - *is_eol = 0; + *is_eol = FALSE; /* find paragraph */ for (; p != editor->pBuffer->pLast; p = p->member.para.next_para) @@ -1109,8 +1109,7 @@ void ME_LButtonDown(ME_TextEditor *editor, int x, int y, int clickNum) { ME_Cursor tmp_cursor; - int is_selection = 0; - BOOL is_shift; + BOOL is_selection = FALSE, is_shift; editor->nUDArrowX = -1; @@ -1535,14 +1534,14 @@ ME_CheckCharOffsets(editor); switch(nVKey) { case VK_LEFT: - editor->bCaretAtEnd = 0; + editor->bCaretAtEnd = FALSE; if (ctrl) success = ME_MoveCursorWords(editor, &tmp_curs, -1); else success = ME_MoveCursorChars(editor, &tmp_curs, -1); break; case VK_RIGHT: - editor->bCaretAtEnd = 0; + editor->bCaretAtEnd = FALSE; if (ctrl) success = ME_MoveCursorWords(editor, &tmp_curs, +1); else @@ -1565,7 +1564,7 @@ ME_ArrowCtrlHome(editor, &tmp_curs); else ME_ArrowHome(editor, &tmp_curs); - editor->bCaretAtEnd = 0; + editor->bCaretAtEnd = FALSE; break; } case VK_END: diff -Nru wine1.7-1.7.14/dlls/riched20/editor.c wine1.7-1.7.18/dlls/riched20/editor.c --- wine1.7-1.7.14/dlls/riched20/editor.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/riched20/editor.c 2014-05-02 18:15:48.000000000 +0000 @@ -1198,11 +1198,8 @@ } if (OleCreateDefaultHandler(&CLSID_NULL, NULL, &IID_IOleObject, (void**)&lpObject) == S_OK && -#if 0 - /* FIXME: enable it when rich-edit properly implements this method */ IRichEditOle_GetClientSite(info->lpRichEditOle, &lpClientSite) == S_OK && IOleObject_SetClientSite(lpObject, lpClientSite) == S_OK && -#endif IOleObject_GetUserClassID(lpObject, &clsid) == S_OK && IOleObject_QueryInterface(lpObject, &IID_IOleCache, (void**)&lpOleCache) == S_OK && IOleCache_Cache(lpOleCache, &fm, 0, &conn) == S_OK && @@ -1633,7 +1630,7 @@ ME_Cursor linebreakCursor = *selEnd; ME_MoveCursorChars(editor, &linebreakCursor, -linebreakSize); - ME_GetTextW(editor, lastchar, 2, &linebreakCursor, linebreakSize, 0); + ME_GetTextW(editor, lastchar, 2, &linebreakCursor, linebreakSize, FALSE); if (lastchar[0] == '\r' && (lastchar[1] == '\n' || lastchar[1] == '\0')) { ME_InternalDeleteText(editor, &linebreakCursor, linebreakSize, FALSE); } @@ -2003,12 +2000,12 @@ { if (!strText) return 0; if (unicode) { - return ME_GetTextW(editor, strText, INT_MAX, start, nLen, 0); + return ME_GetTextW(editor, strText, INT_MAX, start, nLen, FALSE); } else { int nChars; WCHAR *p = ALLOC_N_OBJ(WCHAR, nLen+1); if (!p) return 0; - nChars = ME_GetTextW(editor, p, nLen, start, nLen, 0); + nChars = ME_GetTextW(editor, p, nLen, start, nLen, FALSE); WideCharToMultiByte(CP_ACP, 0, p, nChars+1, (char *)strText, nLen+1, NULL, NULL); FREE_OBJ(p); @@ -2858,6 +2855,8 @@ ed->horz_si.nPage = 0; ed->horz_si.nPos = 0; + ed->wheel_remain = 0; + OleInitialize(NULL); return ed; @@ -2925,6 +2924,23 @@ return TRUE; } +static inline int get_default_line_height( ME_TextEditor *editor ) +{ + int height = 0; + + if (editor->pBuffer && editor->pBuffer->pDefaultStyle) + height = editor->pBuffer->pDefaultStyle->tm.tmHeight; + if (height <= 0) height = 24; + + return height; +} + +static inline int calc_wheel_change( int *remain, int amount_per_click ) +{ + int change = amount_per_click * (float)*remain / WHEEL_DELTA; + *remain -= WHEEL_DELTA * change / amount_per_click; + return change; +} static const char * const edit_messages[] = { "EM_GETSEL", @@ -3142,11 +3158,14 @@ return ME_StreamOut(editor, wParam, (EDITSTREAM *)lParam); case WM_GETDLGCODE: { - UINT code = DLGC_WANTCHARS|DLGC_WANTTAB|DLGC_WANTARROWS|DLGC_HASSETSEL; + UINT code = DLGC_WANTCHARS|DLGC_WANTTAB|DLGC_WANTARROWS; + if (lParam) editor->bDialogMode = TRUE; if (editor->styleFlags & ES_MULTILINE) code |= DLGC_WANTMESSAGE; + if (!(editor->styleFlags & ES_SAVESEL)) + code |= DLGC_HASSETSEL; return code; } case EM_EMPTYUNDOBUFFER: @@ -3545,7 +3564,7 @@ { if (!(editor->styleFlags & ES_MULTILINE)) return FALSE; - ME_ScrollDown(editor, lParam * 8); /* FIXME follow the original */ + ME_ScrollDown( editor, lParam * get_default_line_height( editor ) ); return TRUE; } case WM_CLEAR: @@ -4132,6 +4151,7 @@ case WM_KILLFOCUS: ME_CommitUndo(editor); /* End coalesced undos for typed characters */ editor->bHaveFocus = FALSE; + editor->wheel_remain = 0; ME_HideCaret(editor); ME_SendOldNotify(editor, EN_KILLFOCUS); return 0; @@ -4218,14 +4238,9 @@ case WM_VSCROLL: { int origNPos; - int lineHeight; + int lineHeight = get_default_line_height( editor ); origNPos = editor->vert_si.nPos; - lineHeight = 24; - - if (editor->pBuffer && editor->pBuffer->pDefaultStyle) - lineHeight = editor->pBuffer->pDefaultStyle->tm.tmHeight; - if (lineHeight <= 0) lineHeight = 24; switch(LOWORD(wParam)) { @@ -4265,8 +4280,7 @@ } case WM_MOUSEWHEEL: { - int gcWheelDelta; - UINT pulScrollLines; + int delta; BOOL ctrl_is_down; if ((editor->nEventMask & ENM_MOUSEEVENTS) && @@ -4275,9 +4289,16 @@ ctrl_is_down = GetKeyState(VK_CONTROL) & 0x8000; - gcWheelDelta = GET_WHEEL_DELTA_WPARAM(wParam); + delta = GET_WHEEL_DELTA_WPARAM(wParam); - if (abs(gcWheelDelta) >= WHEEL_DELTA) + /* if scrolling changes direction, ignore left overs */ + if ((delta < 0 && editor->wheel_remain < 0) || + (delta > 0 && editor->wheel_remain > 0)) + editor->wheel_remain += delta; + else + editor->wheel_remain = delta; + + if (editor->wheel_remain) { if (ctrl_is_down) { int numerator; @@ -4287,14 +4308,18 @@ } else { numerator = editor->nZoomNumerator * 100 / editor->nZoomDenominator; } - numerator = numerator + (gcWheelDelta / WHEEL_DELTA) * 10; + numerator += calc_wheel_change( &editor->wheel_remain, 10 ); if (numerator >= 10 && numerator <= 500) ME_SetZoom(editor, numerator, 100); } else { - SystemParametersInfoW(SPI_GETWHEELSCROLLLINES,0, &pulScrollLines, 0); - /* FIXME follow the original */ - if (pulScrollLines) - ME_ScrollDown(editor,pulScrollLines * (-gcWheelDelta / WHEEL_DELTA) * 8); + UINT max_lines = 3; + int lines = 0; + + SystemParametersInfoW( SPI_GETWHEELSCROLLLINES, 0, &max_lines, 0 ); + if (max_lines) + lines = calc_wheel_change( &editor->wheel_remain, (int)max_lines ); + if (lines) + ME_ScrollDown( editor, -lines * get_default_line_height( editor ) ); } } break; @@ -4702,7 +4727,7 @@ int nLen; /* bCRLF flag is only honored in 2.0 and up. 1.0 must always return text verbatim */ - if (editor->bEmulateVersion10) bCRLF = 0; + if (editor->bEmulateVersion10) bCRLF = FALSE; pRun = start->pRun; assert(pRun); @@ -4987,7 +5012,7 @@ WCHAR bufferW[MAX_PREFIX_LEN + 1]; unsigned int i; - ME_GetTextW(editor, bufferW, MAX_PREFIX_LEN, start, nChars, 0); + ME_GetTextW(editor, bufferW, MAX_PREFIX_LEN, start, nChars, FALSE); for (i = 0; i < sizeof(prefixes) / sizeof(*prefixes); i++) { if (nChars < prefixes[i].length) continue; diff -Nru wine1.7-1.7.14/dlls/riched20/editstr.h wine1.7-1.7.18/dlls/riched20/editstr.h --- wine1.7-1.7.14/dlls/riched20/editstr.h 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/riched20/editstr.h 2014-05-02 18:15:48.000000000 +0000 @@ -443,6 +443,7 @@ SCROLLINFO vert_si, horz_si; BOOL bMouseCaptured; + int wheel_remain; } ME_TextEditor; typedef struct tagME_Context diff -Nru wine1.7-1.7.14/dlls/riched20/reader.c wine1.7-1.7.18/dlls/riched20/reader.c --- wine1.7-1.7.14/dlls/riched20/reader.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/riched20/reader.c 2014-05-02 18:15:48.000000000 +0000 @@ -256,7 +256,7 @@ info->rtfLineNum = 0; info->rtfLinePos = 0; info->prevChar = EOF; - info->bumpLine = 0; + info->bumpLine = FALSE; info->dwCPOutputCount = 0; if (!info->cpOutputBuffer) @@ -710,7 +710,7 @@ /* * Read the next character from the input. This handles setting the - * current line and position-within-line variables. Those variable are + * current line and position-within-line variables. Those variables are * set correctly whether lines end with CR, LF, or CRLF (the last being * the tricky case). * @@ -722,7 +722,7 @@ static int GetChar(RTF_Info *info) { int c; - int oldBumpLine; + BOOL oldBumpLine; if ((c = _RTFGetChar(info)) != EOF) { @@ -730,16 +730,16 @@ info->rtfTextBuf[info->rtfTextLen] = '\0'; } if (info->prevChar == EOF) - info->bumpLine = 1; - oldBumpLine = info->bumpLine; /* non-zero if prev char was line ending */ - info->bumpLine = 0; + info->bumpLine = TRUE; + oldBumpLine = info->bumpLine; /* TRUE if prev char was line ending */ + info->bumpLine = FALSE; if (c == '\r') - info->bumpLine = 1; + info->bumpLine = TRUE; else if (c == '\n') { - info->bumpLine = 1; + info->bumpLine = TRUE; if (info->prevChar == '\r') /* oops, previous \r wasn't */ - oldBumpLine = 0; /* really a line ending */ + oldBumpLine = FALSE; /* really a line ending */ } ++info->rtfLinePos; if (oldBumpLine) /* were we supposed to increment the */ diff -Nru wine1.7-1.7.14/dlls/riched20/richole.c wine1.7-1.7.18/dlls/riched20/richole.c --- wine1.7-1.7.14/dlls/riched20/richole.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/riched20/richole.c 2014-05-02 18:15:48.000000000 +0000 @@ -515,6 +515,9 @@ { IRichEditOleImpl *This = impl_from_ITextDocument(me); TRACE("(%p)\n", me); + + if(!ppSel) + return E_INVALIDARG; *ppSel = &This->txtSel->ITextSelection_iface; ITextSelection_AddRef(*ppSel); return S_OK; @@ -1514,7 +1517,7 @@ return 0; } reo->clientSite = CreateOleClientSite(reo); - if (!reo->txtSel) + if (!reo->clientSite) { ITextSelection_Release(&reo->txtSel->ITextSelection_iface); heap_free(reo); diff -Nru wine1.7-1.7.14/dlls/riched20/rtf.h wine1.7-1.7.18/dlls/riched20/rtf.h --- wine1.7-1.7.14/dlls/riched20/rtf.h 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/riched20/rtf.h 2014-05-02 18:15:48.000000000 +0000 @@ -1139,7 +1139,7 @@ char *pushedTextBuf; int prevChar; - int bumpLine; + BOOL bumpLine; /* Document-wide attributes */ RTFFont *fontList; /* these lists MUST be */ diff -Nru wine1.7-1.7.14/dlls/riched20/tests/editor.c wine1.7-1.7.18/dlls/riched20/tests/editor.c --- wine1.7-1.7.14/dlls/riched20/tests/editor.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/riched20/tests/editor.c 2014-05-02 18:15:48.000000000 +0000 @@ -6729,6 +6729,16 @@ ok(res == expected, "WM_GETDLGCODE returned %x but expected %x\n", res, expected); DestroyWindow(hwnd); + + hwnd = CreateWindowExA(0, RICHEDIT_CLASS20A, NULL, + WS_POPUP|ES_SAVESEL, + 0, 0, 200, 60, NULL, NULL, hmoduleRichEdit, NULL); + ok(hwnd != NULL, "class: %s, error: %d\n", RICHEDIT_CLASS20A, (int) GetLastError()); + res = SendMessageA(hwnd, WM_GETDLGCODE, 0, 0); + expected = DLGC_WANTCHARS|DLGC_WANTTAB|DLGC_WANTARROWS; + ok(res == expected, "WM_GETDLGCODE returned %x but expected %x\n", + res, expected); + DestroyWindow(hwnd); } static void test_zoom(void) diff -Nru wine1.7-1.7.14/dlls/riched20/tests/richole.c wine1.7-1.7.18/dlls/riched20/tests/richole.c --- wine1.7-1.7.14/dlls/riched20/tests/richole.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/riched20/tests/richole.c 2014-05-02 18:15:48.000000000 +0000 @@ -117,6 +117,9 @@ ok(hres == S_OK, "IRichEditOle_QueryInterface\n"); ok(txtDoc != NULL, "IRichEditOle_QueryInterface\n"); + hres = ITextDocument_GetSelection(txtDoc, NULL); + ok(hres == E_INVALIDARG, "ITextDocument_GetSelection: 0x%x\n", hres); + ITextDocument_GetSelection(txtDoc, &txtSel); punk = NULL; @@ -190,7 +193,7 @@ int tomNumSingle = sizeof(tomConstantsSingle)/sizeof(tomConstantsSingle[0]); int tomNumMulti = sizeof(tomConstantsMulti)/sizeof(tomConstantsMulti[0]); int i; - VariantInit(&testfile); + V_VT(&testfile) = VT_BSTR; V_BSTR(&testfile) = SysAllocString(filename); @@ -378,6 +381,8 @@ todo_wine ok(result == 0, "ITextDocument_Open: Test UTF-16 set wrong text: Result: %s\n", wine_dbgstr_w(bufUnicode)); release_interfaces(&w, &reOle, &txtDoc, &txtSel); DeleteFileW(filename); + + VariantClear(&testfile); } START_TEST(richole) diff -Nru wine1.7-1.7.14/dlls/riched20/tests/txtsrv.c wine1.7-1.7.18/dlls/riched20/tests/txtsrv.c --- wine1.7-1.7.14/dlls/riched20/tests/txtsrv.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/riched20/tests/txtsrv.c 2014-05-02 18:15:48.000000000 +0000 @@ -65,7 +65,7 @@ #define ITextServices_OnTxUIDeactivate(This) TXTSERV_VTABLE(This)->OnTxUIDeactivate(This) #define ITextServices_TxGetText(This,a) TXTSERV_VTABLE(This)->TxGetText(This,a) #define ITextServices_TxSetText(This,a) TXTSERV_VTABLE(This)->TxSetText(This,a) -#define ITextServices_TxGetCurrentTargetX(This,a) TXTSERV_VTABLE(This)->TxGetCurrentTargetX(This,a) +#define ITextServices_TxGetCurTargetX(This,a) TXTSERV_VTABLE(This)->TxGetCurTargetX(This,a) #define ITextServices_TxGetBaseLinePos(This,a) TXTSERV_VTABLE(This)->TxGetBaseLinePos(This,a) #define ITextServices_TxGetNaturalSize(This,a,b,c,d,e,f,g,h) TXTSERV_VTABLE(This)->TxGetNaturalSize(This,a,b,c,d,e,f,g,h) #define ITextServices_TxGetDropTarget(This,a) TXTSERV_VTABLE(This)->TxGetDropTarget(This,a) diff -Nru wine1.7-1.7.14/dlls/riched20/txtsrv.c wine1.7-1.7.18/dlls/riched20/txtsrv.c --- wine1.7-1.7.14/dlls/riched20/txtsrv.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/riched20/txtsrv.c 2014-05-02 18:15:48.000000000 +0000 @@ -292,7 +292,7 @@ return S_OK; } -DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_TxGetCurrentTargetX(ITextServices *iface, LONG *x) +DECLSPEC_HIDDEN HRESULT WINAPI fnTextSrv_TxGetCurTargetX(ITextServices *iface, LONG *x) { ITextServicesImpl *This = impl_from_ITextServices(iface); @@ -354,7 +354,7 @@ DEFINE_THISCALL_WRAPPER(fnTextSrv_OnTxUIDeactivate,4) DEFINE_THISCALL_WRAPPER(fnTextSrv_TxGetText,8) DEFINE_THISCALL_WRAPPER(fnTextSrv_TxSetText,8) -DEFINE_THISCALL_WRAPPER(fnTextSrv_TxGetCurrentTargetX,8) +DEFINE_THISCALL_WRAPPER(fnTextSrv_TxGetCurTargetX,8) DEFINE_THISCALL_WRAPPER(fnTextSrv_TxGetBaseLinePos,8) DEFINE_THISCALL_WRAPPER(fnTextSrv_TxGetNaturalSize,36) DEFINE_THISCALL_WRAPPER(fnTextSrv_TxGetDropTarget,8) @@ -378,7 +378,7 @@ THISCALL(fnTextSrv_OnTxUIDeactivate), THISCALL(fnTextSrv_TxGetText), THISCALL(fnTextSrv_TxSetText), - THISCALL(fnTextSrv_TxGetCurrentTargetX), + THISCALL(fnTextSrv_TxGetCurTargetX), THISCALL(fnTextSrv_TxGetBaseLinePos), THISCALL(fnTextSrv_TxGetNaturalSize), THISCALL(fnTextSrv_TxGetDropTarget), diff -Nru wine1.7-1.7.14/dlls/rpcrt4/tests/server.c wine1.7-1.7.18/dlls/rpcrt4/tests/server.c --- wine1.7-1.7.14/dlls/rpcrt4/tests/server.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/rpcrt4/tests/server.c 2014-05-02 18:15:48.000000000 +0000 @@ -54,6 +54,9 @@ /* type check statements generated in header file */ fnprintf *p_printf = printf; +static const WCHAR helloW[] = { 'H','e','l','l','o',0 }; +static const WCHAR worldW[] = { 'W','o','r','l','d','!',0 }; + static void InitFunctionPointers(void) { HMODULE hrpcrt4 = GetModuleHandleA("rpcrt4.dll"); @@ -572,6 +575,34 @@ name->name[name->size - 1] = 0; } +void __cdecl s_get_names(int *n, str_array_t *names) +{ + str_array_t list; + + list = MIDL_user_allocate(2 * sizeof(list[0])); + list[0] = MIDL_user_allocate(6); + strcpy(list[0], "Hello"); + list[1] = MIDL_user_allocate(7); + strcpy(list[1], "World!"); + + *names = list; + *n = 2; +} + +void __cdecl s_get_namesw(int *n, wstr_array_t *names) +{ + wstr_array_t list; + + list = MIDL_user_allocate(2 * sizeof(list[0])); + list[0] = MIDL_user_allocate(sizeof(helloW)); + lstrcpyW(list[0], helloW); + list[1] = MIDL_user_allocate(sizeof(worldW)); + lstrcpyW(list[1], worldW); + + *names = list; + *n = 2; +} + int __cdecl s_sum_pcarr2(int n, int **pa) { return s_sum_conf_array(*pa, n); @@ -1191,12 +1222,36 @@ if (!old_windows_version) { + int n; + str_array_t names; + wstr_array_t namesw; + name.size = 10; name.name = buffer = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, name.size); get_name(&name); ok(name.name == buffer, "[in,out] pointer should have stayed as %p but instead changed to %p\n", name.name, buffer); ok(!strcmp(name.name, "Jeremy Wh"), "name didn't unmarshall properly, expected \"Jeremy Wh\", but got \"%s\"\n", name.name); HeapFree(GetProcessHeap(), 0, name.name); + + n = -1; + names = NULL; + get_names(&n, &names); + ok(n == 2, "expected 2, got %d\n", n); + ok(!strcmp(names[0], "Hello"), "expected Hello, got %s\n", names[0]); + ok(!strcmp(names[1], "World!"), "expected World!, got %s\n", names[1]); + MIDL_user_free(names[0]); + MIDL_user_free(names[1]); + MIDL_user_free(names); + + n = -1; + namesw = NULL; + get_namesw(&n, &namesw); + ok(n == 2, "expected 2, got %d\n", n); + ok(!lstrcmpW(namesw[0], helloW), "expected Hello, got %s\n", wine_dbgstr_w(namesw[0])); + ok(!lstrcmpW(namesw[1], worldW), "expected World!, got %s\n", wine_dbgstr_w(namesw[1])); + MIDL_user_free(namesw[0]); + MIDL_user_free(namesw[1]); + MIDL_user_free(namesw); } pa2 = a; diff -Nru wine1.7-1.7.14/dlls/rpcrt4/tests/server.idl wine1.7-1.7.18/dlls/rpcrt4/tests/server.idl --- wine1.7-1.7.14/dlls/rpcrt4/tests/server.idl 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/rpcrt4/tests/server.idl 2014-05-02 18:15:48.000000000 +0000 @@ -328,6 +328,11 @@ } name_t; void get_name([in,out] name_t *name); + typedef char **str_array_t; + void get_names([out] int *n, [out, string, size_is(,*n)] str_array_t *names); + typedef WCHAR **wstr_array_t; + void get_namesw([out] int *n, [out, string, size_is(,*n)] wstr_array_t *names); + int sum_pcarr2(int n, [size_is(, n)] int **pa); int sum_L1_norms(int n, [size_is(n)] vector_t *vs); diff -Nru wine1.7-1.7.14/dlls/schedsvc/Makefile.in wine1.7-1.7.18/dlls/schedsvc/Makefile.in --- wine1.7-1.7.14/dlls/schedsvc/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.18/dlls/schedsvc/Makefile.in 2014-05-02 18:15:48.000000000 +0000 @@ -0,0 +1,8 @@ +MODULE = schedsvc.dll +IMPORTS = rpcrt4 advapi32 ole32 + +C_SRCS = \ + schedsvc.c \ + svc_main.c + +IDL_SRCS = schrpc.idl diff -Nru wine1.7-1.7.14/dlls/schedsvc/schedsvc.c wine1.7-1.7.18/dlls/schedsvc/schedsvc.c --- wine1.7-1.7.14/dlls/schedsvc/schedsvc.c 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.18/dlls/schedsvc/schedsvc.c 2014-05-02 18:15:48.000000000 +0000 @@ -0,0 +1,711 @@ +/* + * Task Scheduler Service + * + * Copyright 2014 Dmitry Timoshkov + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include + +#include "windef.h" +#include "schrpc.h" +#include "taskschd.h" +#include "wine/debug.h" + +#include "schedsvc_private.h" + +WINE_DEFAULT_DEBUG_CHANNEL(schedsvc); + +static const char bom_utf8[] = { 0xef,0xbb,0xbf }; + +HRESULT __cdecl SchRpcHighestVersion(DWORD *version) +{ + TRACE("%p\n", version); + + *version = MAKELONG(3, 1); + return S_OK; +} + +static WCHAR *get_full_name(const WCHAR *path, WCHAR **relative_path) +{ + static const WCHAR tasksW[] = { '\\','t','a','s','k','s','\\',0 }; + WCHAR *target; + int len; + + len = GetSystemDirectoryW(NULL, 0); + len += strlenW(tasksW) + strlenW(path); + + target = heap_alloc(len * sizeof(WCHAR)); + if (target) + { + GetSystemDirectoryW(target, len); + strcatW(target, tasksW); + if (relative_path) + *relative_path = target + strlenW(target) - 1; + while (*path == '\\') path++; + strcatW(target, path); + } + return target; +} + +/* + * Recursively create all directories in the path. + */ +static HRESULT create_directory(const WCHAR *path) +{ + HRESULT hr = S_OK; + WCHAR *new_path; + int len; + + new_path = heap_alloc((strlenW(path) + 1) * sizeof(WCHAR)); + if (!new_path) return E_OUTOFMEMORY; + + strcpyW(new_path, path); + + len = strlenW(new_path); + while (len && new_path[len - 1] == '\\') + { + new_path[len - 1] = 0; + len--; + } + + while (!CreateDirectoryW(new_path, NULL)) + { + WCHAR *slash; + DWORD last_error = GetLastError(); + + if (last_error == ERROR_ALREADY_EXISTS || last_error != ERROR_PATH_NOT_FOUND || + !(slash = strrchrW(new_path, '\\'))) + { + hr = HRESULT_FROM_WIN32(last_error); + break; + } + + len = slash - new_path; + new_path[len] = 0; + hr = create_directory(new_path); + if (hr != S_OK) break; + new_path[len] = '\\'; + } + + heap_free(new_path); + return hr; +} + +static HRESULT write_xml_utf8(const WCHAR *name, DWORD disposition, const WCHAR *xmlW) +{ + static const char comment[] = "\n"; + HANDLE hfile; + DWORD size; + char *xml; + HRESULT hr = S_OK; + + hfile = CreateFileW(name, GENERIC_WRITE, 0, NULL, disposition, 0, 0); + if (hfile == INVALID_HANDLE_VALUE) + { + if (GetLastError() == ERROR_FILE_EXISTS) + return HRESULT_FROM_WIN32(ERROR_ALREADY_EXISTS); + + return HRESULT_FROM_WIN32(GetLastError()); + } + + size = WideCharToMultiByte(CP_UTF8, 0, xmlW, -1, NULL, 0, NULL, NULL); + xml = heap_alloc(size); + if (!xml) + { + CloseHandle(hfile); + return E_OUTOFMEMORY; + } + WideCharToMultiByte(CP_UTF8, 0, xmlW, -1, xml, size, NULL, NULL); + + if (!WriteFile(hfile, bom_utf8, sizeof(bom_utf8), &size, NULL)) + { + hr = HRESULT_FROM_WIN32(GetLastError()); + goto failed; + } + if (!WriteFile(hfile, comment, strlen(comment), &size, NULL)) + { + hr = HRESULT_FROM_WIN32(GetLastError()); + goto failed; + } + + /* skip XML declaration with UTF-16 specifier */ + if (!memcmp(xml, "'); + if (p++) while (isspace(*p)) p++; + else p = xml; + if (!WriteFile(hfile, p, strlen(p), &size, NULL)) + hr = HRESULT_FROM_WIN32(GetLastError()); + } + else + { + if (!WriteFile(hfile, xml, strlen(xml), &size, NULL)) + hr = HRESULT_FROM_WIN32(GetLastError()); + } + +failed: + heap_free(xml); + CloseHandle(hfile); + return hr; +} + +HRESULT __cdecl SchRpcRegisterTask(const WCHAR *path, const WCHAR *xml, DWORD flags, const WCHAR *sddl, + DWORD task_logon_type, DWORD n_creds, const TASK_USER_CRED *creds, + WCHAR **actual_path, TASK_XML_ERROR_INFO **xml_error_info) +{ + WCHAR *full_name, *relative_path; + DWORD disposition; + HRESULT hr; + + TRACE("%s,%s,%#x,%s,%u,%u,%p,%p,%p\n", debugstr_w(path), debugstr_w(xml), flags, + debugstr_w(sddl), task_logon_type, n_creds, creds, actual_path, xml_error_info); + + *actual_path = NULL; + *xml_error_info = NULL; + + /* FIXME: assume that validation is performed on the client side */ + if (flags & TASK_VALIDATE_ONLY) return S_OK; + + if (path) + { + full_name = get_full_name(path, &relative_path); + if (!full_name) return E_OUTOFMEMORY; + + if (strchrW(path, '\\') || strchrW(path, '/')) + { + WCHAR *p = strrchrW(full_name, '/'); + if (!p) p = strrchrW(full_name, '\\'); + *p = 0; + hr = create_directory(full_name); + if (hr != S_OK && hr != HRESULT_FROM_WIN32(ERROR_ALREADY_EXISTS)) + { + heap_free(full_name); + return hr; + } + *p = '\\'; + } + } + else + { + IID iid; + WCHAR uuid_str[39]; + + UuidCreate(&iid); + StringFromGUID2(&iid, uuid_str, 39); + + full_name = get_full_name(uuid_str, &relative_path); + if (!full_name) return E_OUTOFMEMORY; + /* skip leading '\' */ + relative_path++; + } + + switch (flags & (TASK_CREATE | TASK_UPDATE)) + { + default: + case TASK_CREATE: + disposition = CREATE_NEW; + break; + + case TASK_UPDATE: + disposition = OPEN_EXISTING; + break; + + case (TASK_CREATE | TASK_UPDATE): + disposition = OPEN_ALWAYS; + break; + } + + hr = write_xml_utf8(full_name, disposition, xml); + if (hr == S_OK) + { + *actual_path = heap_strdupW(relative_path); + schedsvc_auto_start(); + } + + heap_free(full_name); + return hr; +} + +static int detect_encoding(const void *buffer, DWORD size) +{ + if (size >= sizeof(bom_utf8) && !memcmp(buffer, bom_utf8, sizeof(bom_utf8))) + return CP_UTF8; + else + { + int flags = IS_TEXT_UNICODE_SIGNATURE | + IS_TEXT_UNICODE_REVERSE_SIGNATURE | + IS_TEXT_UNICODE_ODD_LENGTH; + IsTextUnicode(buffer, size, &flags); + if (flags & IS_TEXT_UNICODE_SIGNATURE) + return -1; + if (flags & IS_TEXT_UNICODE_REVERSE_SIGNATURE) + return -2; + return CP_ACP; + } +} + +static HRESULT read_xml(const WCHAR *name, WCHAR **xml) +{ + HANDLE hfile; + DWORD size, attrs; + char *src; + int cp; + + attrs = GetFileAttributesW(name); + if (attrs == INVALID_FILE_ATTRIBUTES) + return HRESULT_FROM_WIN32(GetLastError()); + if (attrs & FILE_ATTRIBUTE_DIRECTORY) + return HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND); + + hfile = CreateFileW(name, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0); + if (hfile == INVALID_HANDLE_VALUE) + return HRESULT_FROM_WIN32(GetLastError()); + + size = GetFileSize(hfile, NULL); + src = heap_alloc(size + 2); + if (!src) + { + CloseHandle(hfile); + return E_OUTOFMEMORY; + } + + src[size] = 0; + src[size + 1] = 0; + + ReadFile(hfile, src, size, &size, NULL); + CloseHandle(hfile); + + cp = detect_encoding(src, size); + if (cp < 0) + { + *xml = (WCHAR *)src; + return S_OK; + } + + if (cp == CP_UTF8 && size >= sizeof(bom_utf8) && !memcmp(src, bom_utf8, sizeof(bom_utf8))) + src += sizeof(bom_utf8); + + size = MultiByteToWideChar(cp, 0, src, -1, NULL, 0); + *xml = heap_alloc(size * sizeof(WCHAR)); + if (!*xml) return E_OUTOFMEMORY; + MultiByteToWideChar(cp, 0, src, -1, *xml, size); + return S_OK; +} + +HRESULT __cdecl SchRpcRetrieveTask(const WCHAR *path, const WCHAR *languages, ULONG *n_languages, WCHAR **xml) +{ + WCHAR *full_name; + HRESULT hr; + + TRACE("%s,%s,%p,%p\n", debugstr_w(path), debugstr_w(languages), n_languages, xml); + + full_name = get_full_name(path, NULL); + if (!full_name) return E_OUTOFMEMORY; + + hr = read_xml(full_name, xml); + if (hr != S_OK) *xml = NULL; + + heap_free(full_name); + return hr; +} + +HRESULT __cdecl SchRpcCreateFolder(const WCHAR *path, const WCHAR *sddl, DWORD flags) +{ + WCHAR *full_name; + HRESULT hr; + + TRACE("%s,%s,%#x\n", debugstr_w(path), debugstr_w(sddl), flags); + + if (flags) return E_INVALIDARG; + + full_name = get_full_name(path, NULL); + if (!full_name) return E_OUTOFMEMORY; + + hr = create_directory(full_name); + + heap_free(full_name); + return hr; +} + +HRESULT __cdecl SchRpcSetSecurity(const WCHAR *path, const WCHAR *sddl, DWORD flags) +{ + FIXME("%s,%s,%#x: stub\n", debugstr_w(path), debugstr_w(sddl), flags); + return E_NOTIMPL; +} + +HRESULT __cdecl SchRpcGetSecurity(const WCHAR *path, DWORD flags, WCHAR **sddl) +{ + FIXME("%s,%#x,%p: stub\n", debugstr_w(path), flags, sddl); + return E_NOTIMPL; +} + +static void free_list(TASK_NAMES list, LONG count) +{ + LONG i; + + for (i = 0; i < count; i++) + heap_free(list[i]); + + heap_free(list); +} + +static inline BOOL is_directory(const WIN32_FIND_DATAW *data) +{ + if (data->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) + { + if (data->cFileName[0] == '.') + { + if (!data->cFileName[1] || (data->cFileName[1] == '.' && !data->cFileName[2])) + return FALSE; + } + return TRUE; + } + return FALSE; +} + +static inline BOOL is_file(const WIN32_FIND_DATAW *data) +{ + return !(data->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY); +} + +HRESULT __cdecl SchRpcEnumFolders(const WCHAR *path, DWORD flags, DWORD *start_index, DWORD n_requested, + DWORD *n_names, TASK_NAMES *names) +{ + static const WCHAR allW[] = {'\\','*',0}; + HRESULT hr = S_OK; + WCHAR *full_name; + WCHAR pathW[MAX_PATH]; + WIN32_FIND_DATAW data; + HANDLE handle; + DWORD allocated, count, index; + TASK_NAMES list; + + TRACE("%s,%#x,%u,%u,%p,%p\n", debugstr_w(path), flags, *start_index, n_requested, n_names, names); + + *n_names = 0; + *names = NULL; + + if (flags & ~TASK_ENUM_HIDDEN) return E_INVALIDARG; + + if (!n_requested) n_requested = ~0u; + + full_name = get_full_name(path, NULL); + if (!full_name) return E_OUTOFMEMORY; + + if (strlenW(full_name) + 2 > MAX_PATH) + { + heap_free(full_name); + return HRESULT_FROM_WIN32(ERROR_FILENAME_EXCED_RANGE); + } + + strcpyW(pathW, full_name); + strcatW(pathW, allW); + + heap_free(full_name); + + allocated = 64; + list = heap_alloc(allocated * sizeof(list[0])); + if (!list) return E_OUTOFMEMORY; + + index = count = 0; + + handle = FindFirstFileW(pathW, &data); + if (handle == INVALID_HANDLE_VALUE) + { + heap_free(list); + if (GetLastError() == ERROR_PATH_NOT_FOUND) + return HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND); + return HRESULT_FROM_WIN32(GetLastError()); + } + + do + { + if (is_directory(&data) && index++ >= *start_index) + { + if (count >= allocated) + { + TASK_NAMES new_list; + allocated *= 2; + new_list = heap_realloc(list, allocated * sizeof(list[0])); + if (!new_list) + { + hr = E_OUTOFMEMORY; + break; + } + list = new_list; + } + + TRACE("adding %s\n", debugstr_w(data.cFileName)); + + list[count] = heap_strdupW(data.cFileName); + if (!list[count]) + { + hr = E_OUTOFMEMORY; + break; + } + + count++; + + if (count >= n_requested) + { + hr = S_FALSE; + break; + } + } + } while (FindNextFileW(handle, &data)); + + FindClose(handle); + + if (FAILED(hr)) + { + free_list(list, count); + return hr; + } + + *n_names = count; + + if (count) + { + *names = list; + *start_index = index; + return hr; + } + + heap_free(list); + *names = NULL; + return *start_index ? S_FALSE : S_OK; +} + +HRESULT __cdecl SchRpcEnumTasks(const WCHAR *path, DWORD flags, DWORD *start_index, DWORD n_requested, + DWORD *n_names, TASK_NAMES *names) +{ + static const WCHAR allW[] = {'\\','*',0}; + HRESULT hr = S_OK; + WCHAR *full_name; + WCHAR pathW[MAX_PATH]; + WIN32_FIND_DATAW data; + HANDLE handle; + DWORD allocated, count, index; + TASK_NAMES list; + + TRACE("%s,%#x,%u,%u,%p,%p\n", debugstr_w(path), flags, *start_index, n_requested, n_names, names); + + *n_names = 0; + *names = NULL; + + if (flags & ~TASK_ENUM_HIDDEN) return E_INVALIDARG; + + if (!n_requested) n_requested = ~0u; + + full_name = get_full_name(path, NULL); + if (!full_name) return E_OUTOFMEMORY; + + if (strlenW(full_name) + 2 > MAX_PATH) + { + heap_free(full_name); + return HRESULT_FROM_WIN32(ERROR_FILENAME_EXCED_RANGE); + } + + strcpyW(pathW, full_name); + strcatW(pathW, allW); + + heap_free(full_name); + + allocated = 64; + list = heap_alloc(allocated * sizeof(list[0])); + if (!list) return E_OUTOFMEMORY; + + index = count = 0; + + handle = FindFirstFileW(pathW, &data); + if (handle == INVALID_HANDLE_VALUE) + { + heap_free(list); + if (GetLastError() == ERROR_PATH_NOT_FOUND) + return HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND); + return HRESULT_FROM_WIN32(GetLastError()); + } + + do + { + if (is_file(&data) && index++ >= *start_index) + { + if (count >= allocated) + { + TASK_NAMES new_list; + allocated *= 2; + new_list = heap_realloc(list, allocated * sizeof(list[0])); + if (!new_list) + { + hr = E_OUTOFMEMORY; + break; + } + list = new_list; + } + + TRACE("adding %s\n", debugstr_w(data.cFileName)); + + list[count] = heap_strdupW(data.cFileName); + if (!list[count]) + { + hr = E_OUTOFMEMORY; + break; + } + + count++; + + if (count >= n_requested) + { + hr = S_FALSE; + break; + } + } + } while (FindNextFileW(handle, &data)); + + FindClose(handle); + + if (FAILED(hr)) + { + free_list(list, count); + return hr; + } + + *n_names = count; + + if (count) + { + *names = list; + *start_index = index; + return hr; + } + + heap_free(list); + *names = NULL; + return *start_index ? S_FALSE : S_OK; +} + +HRESULT __cdecl SchRpcEnumInstances(const WCHAR *path, DWORD flags, DWORD *n_guids, GUID **guids) +{ + FIXME("%s,%#x,%p,%p: stub\n", debugstr_w(path), flags, n_guids, guids); + return E_NOTIMPL; +} + +HRESULT __cdecl SchRpcGetInstanceInfo(GUID guid, WCHAR **path, DWORD *task_state, WCHAR **action, + WCHAR **info, DWORD *n_instances, GUID **instances, DWORD *pid) +{ + FIXME("%s,%p,%p,%p,%p,%p,%p,%p: stub\n", wine_dbgstr_guid(&guid), path, task_state, action, + info, n_instances, instances, pid); + return E_NOTIMPL; +} + +HRESULT __cdecl SchRpcStopInstance(GUID guid, DWORD flags) +{ + FIXME("%s,%#x: stub\n", wine_dbgstr_guid(&guid), flags); + return E_NOTIMPL; +} + +HRESULT __cdecl SchRpcStop(const WCHAR *path, DWORD flags) +{ + FIXME("%s,%#x: stub\n", debugstr_w(path), flags); + return E_NOTIMPL; +} + +HRESULT __cdecl SchRpcRun(const WCHAR *path, DWORD n_args, const WCHAR **args, DWORD flags, + DWORD session_id, const WCHAR *user, GUID *guid) +{ + FIXME("%s,%u,%p,%#x,%#x,%s,%p: stub\n", debugstr_w(path), n_args, args, flags, + session_id, debugstr_w(user), guid); + return E_NOTIMPL; +} + +HRESULT __cdecl SchRpcDelete(const WCHAR *path, DWORD flags) +{ + WCHAR *full_name; + HRESULT hr = S_OK; + + TRACE("%s,%#x\n", debugstr_w(path), flags); + + if (flags) return E_INVALIDARG; + + while (*path == '\\' || *path == '/') path++; + if (!*path) return E_ACCESSDENIED; + + full_name = get_full_name(path, NULL); + if (!full_name) return E_OUTOFMEMORY; + + if (!RemoveDirectoryW(full_name)) + { + hr = HRESULT_FROM_WIN32(GetLastError()); + if (hr == HRESULT_FROM_WIN32(ERROR_DIRECTORY)) + hr = DeleteFileW(full_name) ? S_OK : HRESULT_FROM_WIN32(GetLastError()); + } + + heap_free(full_name); + return hr; +} + +HRESULT __cdecl SchRpcRename(const WCHAR *path, const WCHAR *name, DWORD flags) +{ + FIXME("%s,%s,%#x: stub\n", debugstr_w(path), debugstr_w(name), flags); + return E_NOTIMPL; +} + +HRESULT __cdecl SchRpcScheduledRuntimes(const WCHAR *path, SYSTEMTIME *start, SYSTEMTIME *end, DWORD flags, + DWORD n_requested, DWORD *n_runtimes, SYSTEMTIME **runtimes) +{ + FIXME("%s,%p,%p,%#x,%u,%p,%p: stub\n", debugstr_w(path), start, end, flags, + n_requested, n_runtimes, runtimes); + return E_NOTIMPL; +} + +HRESULT __cdecl SchRpcGetLastRunInfo(const WCHAR *path, SYSTEMTIME *last_runtime, DWORD *last_return_code) +{ + FIXME("%s,%p,%p: stub\n", debugstr_w(path), last_runtime, last_return_code); + return E_NOTIMPL; +} + +HRESULT __cdecl SchRpcGetTaskInfo(const WCHAR *path, DWORD flags, DWORD *enabled, DWORD *task_state) +{ + WCHAR *full_name, *xml; + HRESULT hr; + + FIXME("%s,%#x,%p,%p: stub\n", debugstr_w(path), flags, enabled, task_state); + + full_name = get_full_name(path, NULL); + if (!full_name) return E_OUTOFMEMORY; + + hr = read_xml(full_name, &xml); + heap_free(full_name); + if (hr != S_OK) return hr; + heap_free(xml); + + *enabled = 0; + *task_state = (flags & SCH_FLAG_STATE) ? TASK_STATE_DISABLED : TASK_STATE_UNKNOWN; + return S_OK; +} + +HRESULT __cdecl SchRpcGetNumberOfMissedRuns(const WCHAR *path, DWORD *runs) +{ + FIXME("%s,%p: stub\n", debugstr_w(path), runs); + return E_NOTIMPL; +} + +HRESULT __cdecl SchRpcEnableTask(const WCHAR *path, DWORD enabled) +{ + FIXME("%s,%u: stub\n", debugstr_w(path), enabled); + return E_NOTIMPL; +} diff -Nru wine1.7-1.7.14/dlls/schedsvc/schedsvc_private.h wine1.7-1.7.18/dlls/schedsvc/schedsvc_private.h --- wine1.7-1.7.14/dlls/schedsvc/schedsvc_private.h 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.18/dlls/schedsvc/schedsvc_private.h 2014-05-02 18:15:48.000000000 +0000 @@ -0,0 +1,61 @@ +/* + * Copyright 2014 Dmitry Timoshkov + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef __WINE_SCHEDSVC_PRIVATE_H__ +#define __WINE_SCHEDSVC_PRIVATE_H__ + +#include "wine/unicode.h" + +void schedsvc_auto_start(void) DECLSPEC_HIDDEN; + +static void *heap_alloc_zero(SIZE_T size) __WINE_ALLOC_SIZE(1); +static inline void *heap_alloc_zero(SIZE_T size) +{ + void *ptr = MIDL_user_allocate(size); + if (ptr) memset(ptr, 0, size); + return ptr; +} + +static void *heap_alloc(SIZE_T size) __WINE_ALLOC_SIZE(1); +static inline void *heap_alloc(SIZE_T size) +{ + return MIDL_user_allocate(size); +} + +static void *heap_realloc(void *ptr, SIZE_T size) __WINE_ALLOC_SIZE(2); +static inline void *heap_realloc(void *ptr, SIZE_T size) +{ + return HeapReAlloc(GetProcessHeap(), 0, ptr, size); +} + +static inline void heap_free(void *ptr) +{ + MIDL_user_free(ptr); +} + +static inline WCHAR *heap_strdupW(const WCHAR *src) +{ + WCHAR *dst; + unsigned len; + if (!src) return NULL; + len = (strlenW(src) + 1) * sizeof(WCHAR); + if ((dst = heap_alloc(len))) memcpy(dst, src, len); + return dst; +} + +#endif /* __WINE_SCHEDSVC_PRIVATE_H__ */ diff -Nru wine1.7-1.7.14/dlls/schedsvc/schedsvc.spec wine1.7-1.7.18/dlls/schedsvc/schedsvc.spec --- wine1.7-1.7.14/dlls/schedsvc/schedsvc.spec 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.18/dlls/schedsvc/schedsvc.spec 2014-05-02 18:15:48.000000000 +0000 @@ -0,0 +1 @@ +@ stdcall -private ServiceMain(long ptr) diff -Nru wine1.7-1.7.14/dlls/schedsvc/schrpc.idl wine1.7-1.7.18/dlls/schedsvc/schrpc.idl --- wine1.7-1.7.14/dlls/schedsvc/schrpc.idl 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.18/dlls/schedsvc/schrpc.idl 2014-05-02 18:15:48.000000000 +0000 @@ -0,0 +1,3 @@ +#pragma makedep server + +#include "wine/schrpc.idl" diff -Nru wine1.7-1.7.14/dlls/schedsvc/svc_main.c wine1.7-1.7.18/dlls/schedsvc/svc_main.c --- wine1.7-1.7.14/dlls/schedsvc/svc_main.c 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.18/dlls/schedsvc/svc_main.c 2014-05-02 18:15:48.000000000 +0000 @@ -0,0 +1,207 @@ +/* + * Task Scheduler Service + * + * Copyright 2014 Dmitry Timoshkov + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include + +#include "windef.h" +#include "winbase.h" +#include "winsvc.h" +#include "rpc.h" +#include "schrpc.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(schedsvc); + +static const WCHAR scheduleW[] = {'S','c','h','e','d','u','l','e',0}; +static SERVICE_STATUS_HANDLE schedsvc_handle; +static HANDLE done_event; + +void schedsvc_auto_start(void) +{ + static DWORD start_type; + SC_HANDLE scm, service; + QUERY_SERVICE_CONFIGW *cfg; + DWORD cfg_size; + + if (start_type == SERVICE_AUTO_START) return; + + TRACE("changing service start type to SERVICE_AUTO_START\n"); + + scm = OpenSCManagerW(NULL, NULL, 0); + if (!scm) + { + WARN("failed to open SCM (%u)\n", GetLastError()); + return; + } + + service = OpenServiceW(scm, scheduleW, SERVICE_QUERY_CONFIG | SERVICE_CHANGE_CONFIG); + if (service) + { + if (!QueryServiceConfigW(service, NULL, 0, &cfg_size) && GetLastError() == ERROR_INSUFFICIENT_BUFFER) + { + cfg = HeapAlloc(GetProcessHeap(), 0, cfg_size); + if (cfg) + { + if (QueryServiceConfigW(service, cfg, cfg_size, &cfg_size)) + { + start_type = cfg->dwStartType; + if (start_type != SERVICE_AUTO_START) + { + if (ChangeServiceConfigW(service, SERVICE_NO_CHANGE, SERVICE_AUTO_START, SERVICE_NO_CHANGE, + NULL, NULL, NULL, NULL, NULL, NULL, NULL)) + start_type = SERVICE_AUTO_START; + } + } + HeapFree(GetProcessHeap(), 0, cfg); + } + } + else + WARN("failed to query service config (%u)\n", GetLastError()); + + CloseServiceHandle(service); + } + else + WARN("failed to open service (%u)\n", GetLastError()); + + CloseServiceHandle(scm); +} + +static void schedsvc_update_status(DWORD state) +{ + SERVICE_STATUS status; + + status.dwServiceType = SERVICE_WIN32; + status.dwControlsAccepted = SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN; + status.dwWin32ExitCode = 0; + status.dwServiceSpecificExitCode = 0; + status.dwCheckPoint = 0; + status.dwWaitHint = 0; + status.dwControlsAccepted = 0; + status.dwCurrentState = state; + + SetServiceStatus(schedsvc_handle, &status); +} + +static void WINAPI schedsvc_handler(DWORD control) +{ + TRACE("%#x\n", control); + + switch (control) + { + case SERVICE_CONTROL_STOP: + case SERVICE_CONTROL_SHUTDOWN: + schedsvc_update_status(SERVICE_STOP_PENDING); + SetEvent(done_event); + break; + + default: + schedsvc_update_status(SERVICE_RUNNING); + break; + } +} + +static RPC_BINDING_VECTOR *sched_bindings; + +static RPC_STATUS RPC_init(void) +{ + WCHAR transport[] = SCHEDSVC_TRANSPORT; + RPC_STATUS status; + + TRACE("using %s\n", debugstr_w(transport)); + + status = RpcServerUseProtseqEpW(transport, 0, NULL, NULL); + if (status != RPC_S_OK) + { + WINE_ERR("RpcServerUseProtseqEp error %#x\n", status); + return status; + } + + status = RpcServerRegisterIf(ITaskSchedulerService_v1_0_s_ifspec, 0, 0); + if (status != RPC_S_OK) + { + WINE_ERR("RpcServerRegisterIf error %#x\n", status); + return status; + } + + status = RpcServerInqBindings(&sched_bindings); + if (status != RPC_S_OK) + { + WINE_ERR("RpcServerInqBindings error %#x\n", status); + return status; + } + + status = RpcEpRegisterW(ITaskSchedulerService_v1_0_s_ifspec, sched_bindings, NULL, NULL); + if (status != RPC_S_OK) + { + WINE_ERR("RpcEpRegister error %#x\n", status); + return status; + } + + status = RpcServerListen(1, RPC_C_LISTEN_MAX_CALLS_DEFAULT, TRUE); + if (status != RPC_S_OK) + { + WINE_ERR("RpcServerListen error %#x\n", status); + return status; + } + return RPC_S_OK; +} + +static void RPC_finish(void) +{ + RpcMgmtStopServerListening(NULL); + RpcEpUnregister(ITaskSchedulerService_v1_0_s_ifspec, sched_bindings, NULL); + RpcBindingVectorFree(&sched_bindings); + RpcServerUnregisterIf(NULL, NULL, FALSE); +} + +void WINAPI ServiceMain(DWORD argc, LPWSTR *argv) +{ + TRACE("starting Task Scheduler Service\n"); + + if (RPC_init() != RPC_S_OK) return; + + schedsvc_handle = RegisterServiceCtrlHandlerW(scheduleW, schedsvc_handler); + if (!schedsvc_handle) + { + WINE_ERR("RegisterServiceCtrlHandler error %d\n", GetLastError()); + return; + } + + done_event = CreateEventW(NULL, TRUE, FALSE, NULL); + + schedsvc_update_status(SERVICE_RUNNING); + + WaitForSingleObject(done_event, INFINITE); + + RPC_finish(); + schedsvc_update_status(SERVICE_STOPPED); + + TRACE("exiting Task Scheduler Service\n"); +} + +void __RPC_FAR * __RPC_USER MIDL_user_allocate(SIZE_T len) +{ + return HeapAlloc(GetProcessHeap(), 0, len); +} + +void __RPC_USER MIDL_user_free(void __RPC_FAR * ptr) +{ + HeapFree(GetProcessHeap(), 0, ptr); +} diff -Nru wine1.7-1.7.14/dlls/schedsvc/tests/Makefile.in wine1.7-1.7.18/dlls/schedsvc/tests/Makefile.in --- wine1.7-1.7.14/dlls/schedsvc/tests/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.18/dlls/schedsvc/tests/Makefile.in 2014-05-02 18:15:48.000000000 +0000 @@ -0,0 +1,8 @@ +TESTDLL = schedsvc.dll +IMPORTS = rpcrt4 ole32 + +C_SRCS = \ + rpcapi.c + +IDL_SRCS = \ + schrpc.idl diff -Nru wine1.7-1.7.14/dlls/schedsvc/tests/rpcapi.c wine1.7-1.7.18/dlls/schedsvc/tests/rpcapi.c --- wine1.7-1.7.14/dlls/schedsvc/tests/rpcapi.c 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.18/dlls/schedsvc/tests/rpcapi.c 2014-05-02 18:15:48.000000000 +0000 @@ -0,0 +1,544 @@ +/* + * Copyright 2014 Dmitry Timoshkov + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include +#include +#include +#include +#include +#include "schrpc.h" + +#include "wine/test.h" + +extern handle_t rpc_handle; + +static LONG CALLBACK rpc_exception_filter(EXCEPTION_POINTERS *ptrs) +{ + skip("Can't connect to Scheduler service: %#x\n", ptrs->ExceptionRecord->ExceptionCode); + + if (winetest_debug) + { + fprintf(stdout, "rpcapi: 0 tests executed (0 marked as todo, 0 failures), 1 skipped.\n"); + fflush(stdout); + } + ExitProcess(0); +} + +START_TEST(rpcapi) +{ + static unsigned char ncalrpc[] = "ncalrpc"; + static const WCHAR empty[] = { 0 }; + static const WCHAR Wine[] = { '\\','W','i','n','e',0 }; + static const WCHAR Wine_Folder1[] = { '\\','W','i','n','e','\\','F','o','l','d','e','r','1',0 }; + static const WCHAR Wine_Folder2[] = { '\\','W','i','n','e','\\','F','o','l','d','e','r','2',0 }; + static const WCHAR Folder1[] = { 'F','o','l','d','e','r','1',0 }; + static const WCHAR Folder2[] = { 'F','o','l','d','e','r','2',0 }; + static const WCHAR Wine_Task1[] = { '\\','W','i','n','e','\\','T','a','s','k','1',0 }; + static const WCHAR Wine_Task2[] = { '\\','W','i','n','e','\\','T','a','s','k','2',0 }; + static const WCHAR Wine_Task3[] = { '\\','W','i','n','e','\\','T','a','s','k','3',0 }; + static const WCHAR Wine_Folder1_Task1[] = { '\\','W','i','n','e','\\','F','o','l','d','e','r','1','\\','T','a','s','k','1',0 }; + static const WCHAR Task1[] = { 'T','a','s','k','1',0 }; + static const WCHAR Task2[] = { 'T','a','s','k','2',0 }; + static const WCHAR Task3[] = { 'T','a','s','k','3',0 }; + static const char xml1[] = + "\n" + "\n" + " \n" + " \"Task1\"\n" + " \n" + " \n" + " false\n" + " false\n" + " \n" + " \n" + " \n" + " \"task1.exe\"\n" + " \n" + " \n" + "\n"; + static const struct + { + DWORD flags, hr; + } create_new_task[] = + { + { 0, S_OK }, + { TASK_CREATE, S_OK }, + { TASK_UPDATE, 0x80070002 /* HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) */ }, + { TASK_CREATE | TASK_UPDATE, S_OK } + }; + static const struct + { + DWORD flags, hr; + } open_existing_task[] = + { + { 0, 0x800700b7 /* HRESULT_FROM_WIN32(ERROR_ALREADY_EXISTS) */ }, + { TASK_CREATE, 0x800700b7 /* HRESULT_FROM_WIN32(ERROR_ALREADY_EXISTS) */ }, + { TASK_UPDATE, S_OK }, + { TASK_CREATE | TASK_UPDATE, S_OK } + }; + WCHAR xmlW[sizeof(xml1)], *xml; + HRESULT hr; + DWORD version, start_index, count, i, enumed, enabled, state; + WCHAR *path; + TASK_XML_ERROR_INFO *info; + TASK_NAMES names; + unsigned char *binding_str; + PTOP_LEVEL_EXCEPTION_FILTER old_exception_filter; + IID iid; + + hr = RpcStringBindingComposeA(NULL, ncalrpc, NULL, NULL, NULL, &binding_str); + ok(hr == RPC_S_OK, "RpcStringBindingCompose error %#x\n", hr); + hr = RpcBindingFromStringBindingA(binding_str, &rpc_handle); + ok(hr == RPC_S_OK, "RpcBindingFromStringBinding error %#x\n", hr); + hr = RpcStringFreeA(&binding_str); + ok(hr == RPC_S_OK, "RpcStringFree error %#x\n", hr); + + /* widl generated RpcTryExcept/RpcExcept can't catch raised exceptions */ + old_exception_filter = SetUnhandledExceptionFilter(rpc_exception_filter); + + version = 0; + hr = SchRpcHighestVersion(&version); + ok(version == 0x10002 /* vista */ || version == 0x10003 /* win7 */ || version == 0x10004 /* win8 */, + "wrong version %#x\n", version); + + SetUnhandledExceptionFilter(old_exception_filter); + + hr = SchRpcCreateFolder(Wine_Folder1, NULL, 1); + ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#x\n", hr); + + hr = SchRpcCreateFolder(Wine_Folder1, NULL, 0); + ok(hr == S_OK, "expected S_OK, got %#x\n", hr); + + hr = SchRpcCreateFolder(Wine_Folder1, NULL, 0); + ok(hr == HRESULT_FROM_WIN32(ERROR_ALREADY_EXISTS), "expected ERROR_ALREADY_EXISTS, got %#x\n", hr); + + hr = SchRpcCreateFolder(Wine_Folder2+1, empty, 0); + ok(hr == S_OK, "expected S_OK, got %#x\n", hr); + + hr = SchRpcDelete(Wine+1, 0); + ok(hr == HRESULT_FROM_WIN32(ERROR_DIR_NOT_EMPTY), "expected ERROR_DIR_NOT_EMPTY, got %#x\n", hr); + + hr = SchRpcDelete(Wine_Folder1+1, 1); + ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#x\n", hr); + + hr = SchRpcDelete(Wine_Folder1+1, 0); + ok(hr == S_OK, "expected S_OK, got %#x\n", hr); + + hr = SchRpcDelete(Wine_Folder2, 0); + ok(hr == S_OK, "expected S_OK, got %#x\n", hr); + + hr = SchRpcDelete(Wine, 0); + ok(hr == S_OK, "expected S_OK, got %#x\n", hr); + + hr = SchRpcDelete(Wine, 0); + ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), "expected ERROR_FILE_NOT_FOUND, got %#x\n", hr); + + hr = SchRpcDelete(empty, 0); + ok(hr == E_ACCESSDENIED /* win7 */ || hr == E_INVALIDARG /* vista */, "expected E_ACCESSDENIED, got %#x\n", hr); + + hr = SchRpcCreateFolder(Wine, NULL, 0); + ok(hr == S_OK, "expected S_OK, got %#x\n", hr); + + MultiByteToWideChar(CP_ACP, 0, xml1, -1, xmlW, sizeof(xmlW)/sizeof(xmlW[0])); + + path = NULL; + info = NULL; + hr = SchRpcRegisterTask(Wine+1, xmlW, TASK_VALIDATE_ONLY, NULL, TASK_LOGON_NONE, 0, NULL, &path, &info); + ok(hr == S_OK, "expected S_OK, got %#x\n", hr); + ok(!path, "expected NULL, path %p\n", path); + ok(!info, "expected NULL, info %p\n", info); + + for (i = 0; i < sizeof(create_new_task)/sizeof(create_new_task[0]); i++) + { + path = NULL; + info = NULL; + hr = SchRpcRegisterTask(Wine_Task1, xmlW, create_new_task[i].flags, NULL, TASK_LOGON_NONE, 0, NULL, &path, &info); + ok(hr == create_new_task[i].hr, "%u: expected %#x, got %#x\n", i, create_new_task[i].hr, hr); + + if (hr == S_OK) + { + hr = SchRpcDelete(Wine_Task1, 0); + ok(hr == S_OK, "expected S_OK, got %#x\n", hr); + ok(!info, "expected NULL, info %p\n", info); + MIDL_user_free(path); + } + } + + path = NULL; + info = NULL; + hr = SchRpcRegisterTask(Wine_Task1, xmlW, TASK_VALIDATE_ONLY, NULL, TASK_LOGON_NONE, 0, NULL, &path, &info); + ok(hr == S_OK, "expected S_OK, got %#x\n", hr); + ok(!path, "expected NULL, path %p\n", path); + ok(!info, "expected NULL, info %p\n", info); + + path = NULL; + info = NULL; + hr = SchRpcRegisterTask(NULL, xmlW, TASK_VALIDATE_ONLY, NULL, TASK_LOGON_NONE, 0, NULL, &path, &info); + ok(hr == S_OK, "expected S_OK, got %#x\n", hr); + ok(!path, "expected NULL, path %p\n", path); + ok(!info, "expected NULL, info %p\n", info); + + path = NULL; + info = NULL; + hr = SchRpcRegisterTask(Wine_Folder1_Task1+1, xmlW, TASK_CREATE, NULL, TASK_LOGON_NONE, 0, NULL, &path, &info); + ok(hr == S_OK, "expected S_OK, got %#x\n", hr); + ok(!lstrcmpW(path, Wine_Folder1_Task1) /* win7 */ || !lstrcmpW(path, Wine_Folder1_Task1+1) /* vista */, + "expected \\Wine\\Folder1\\Task1, task actual path %s\n", wine_dbgstr_w(path)); + ok(!info, "expected NULL, info %p\n", info); + MIDL_user_free(path); + + for (i = 0; i < sizeof(open_existing_task)/sizeof(open_existing_task[0]); i++) + { + path = NULL; + info = NULL; + hr = SchRpcRegisterTask(Wine_Folder1_Task1+1, xmlW, open_existing_task[i].flags, NULL, TASK_LOGON_NONE, 0, NULL, &path, &info); + ok(hr == open_existing_task[i].hr, "%u: expected %#x, got %#x\n", i, open_existing_task[i].hr, hr); + if (hr == S_OK) + { + ok(!lstrcmpW(path, Wine_Folder1_Task1) /* win7 */ || !lstrcmpW(path, Wine_Folder1_Task1+1) /* vista */, + "expected \\Wine\\Folder1\\Task1, task actual path %s\n", wine_dbgstr_w(path)); + MIDL_user_free(path); + } + else + ok(!path, "%u: expected NULL, path %p\n", i, path); + ok(!info, "%u: expected NULL, info %p\n", i, info); + } + + path = NULL; + info = NULL; + hr = SchRpcRegisterTask(Wine_Folder1_Task1+1, xmlW, TASK_CREATE, NULL, TASK_LOGON_NONE, 0, NULL, &path, &info); + ok(hr == HRESULT_FROM_WIN32(ERROR_ALREADY_EXISTS), "expected ERROR_ALREADY_EXISTS, got %#x\n", hr); + ok(!path, "expected NULL, path %p\n", path); + ok(!info, "expected NULL, info %p\n", info); + + count = 0; + xml = NULL; + hr = SchRpcRetrieveTask(Wine_Folder1_Task1, empty, &count, &xml); + ok(hr == S_OK, "expected S_OK, got %#x\n", hr); + if (hr == S_OK) trace("%s\n", wine_dbgstr_w(xml)); + MIDL_user_free(xml); + + hr = SchRpcDelete(Wine_Folder1_Task1+1, 0); + ok(hr == S_OK, "expected S_OK, got %#x\n", hr); + hr = SchRpcDelete(Wine_Folder1+1, 0); + ok(hr == S_OK, "expected S_OK, got %#x\n", hr); + hr = SchRpcDelete(Wine+1, 0); + ok(hr == S_OK, "expected S_OK, got %#x\n", hr); + + start_index = 0; + count = 0xdeadbeef; + names = NULL; + hr = SchRpcEnumFolders(Wine, TASK_ENUM_HIDDEN, &start_index, 0, &count, &names); + ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), "expected ERROR_FILE_NOT_FOUND, got %#x\n", hr); + ok(!count, "expected 0, got %u\n", count); + ok(!start_index, "expected 0, got %u\n", start_index); + ok(!names, "expected NULL, got %p\n", names); + + hr = SchRpcCreateFolder(Wine, NULL, 0); + ok(hr == S_OK, "expected S_OK, got %#x\n", hr); + + start_index = 0; + count = 0xdeadbeef; + names = NULL; + hr = SchRpcEnumFolders(Wine, 0, &start_index, 0, &count, &names); + ok(hr == S_OK, "expected S_OK, got %#x\n", hr); + ok(!count, "expected 0, got %u\n", count); + ok(!start_index, "expected 0, got %u\n", start_index); + ok(!names, "expected NULL, got %p\n", names); + + hr = SchRpcCreateFolder(Wine_Folder1, NULL, 0); + ok(hr == S_OK, "expected S_OK, got %#x\n", hr); + hr = SchRpcCreateFolder(Wine_Folder2, NULL, 0); + ok(hr == S_OK, "expected S_OK, got %#x\n", hr); + + start_index = 0; + count = 0xdeadbeef; + names = NULL; + hr = SchRpcEnumFolders(Wine, 0, &start_index, 0, &count, &names); + ok(hr == S_OK, "expected S_OK, got %#x\n", hr); + ok(count == 2, "expected 2, got %u\n", count); + ok(start_index == 2, "expected 2, got %u\n", start_index); + ok(names != NULL, "names should not be NULL\n"); + enumed = 0; + for (i = 0; i < count; i++) + { + if (!lstrcmpW(names[i], Folder1)) + enumed += 1; + else if (!lstrcmpW(names[i], Folder2)) + enumed += 2; + MIDL_user_free(names[i]); + } + MIDL_user_free(names); + ok(enumed == 3, "expected 3, got %u\n", enumed); + + start_index = 0; + count = 0xdeadbeef; + names = NULL; + hr = SchRpcEnumFolders(Wine, 0, &start_index, 1, &count, &names); + ok(hr == S_FALSE, "expected S_FALSE, got %#x\n", hr); + ok(count == 1, "expected 1, got %u\n", count); + ok(start_index == 1, "expected 1, got %u\n", start_index); + ok(names != NULL, "names should not be NULL\n"); + ok(!lstrcmpW(names[0], Folder1), "expected Folder1, got %s\n", wine_dbgstr_w(names[0])); + MIDL_user_free(names[0]); + MIDL_user_free(names); + + start_index = 0; + count = 0xdeadbeef; + names = NULL; + hr = SchRpcEnumFolders(Wine, 0, &start_index, 2, &count, &names); + ok(hr == S_FALSE, "expected S_FALSE, got %#x\n", hr); + ok(count == 2, "expected 2, got %u\n", count); + ok(start_index == 2, "expected 2, got %u\n", start_index); + ok(names != NULL, "names should not be NULL\n"); + enumed = 0; + for (i = 0; i < count; i++) + { + if (!lstrcmpW(names[i], Folder1)) + enumed += 1; + else if (!lstrcmpW(names[i], Folder2)) + enumed += 2; + MIDL_user_free(names[i]); + } + MIDL_user_free(names); + ok(enumed == 3, "expected 3, got %u\n", enumed); + + start_index = 0; + count = 0xdeadbeef; + names = NULL; + hr = SchRpcEnumFolders(Wine, 0, &start_index, 10, &count, &names); + ok(hr == S_OK, "expected S_OK, got %#x\n", hr); + ok(count == 2, "expected 2, got %u\n", count); + ok(start_index == 2, "expected 2, got %u\n", start_index); + ok(names != NULL, "names should not be NULL\n"); + enumed = 0; + for (i = 0; i < count; i++) + { + if (!lstrcmpW(names[i], Folder1)) + enumed += 1; + else if (!lstrcmpW(names[i], Folder2)) + enumed += 2; + MIDL_user_free(names[i]); + } + MIDL_user_free(names); + ok(enumed == 3, "expected 3, got %u\n", enumed); + + start_index = 10; + count = 0xdeadbeef; + names = NULL; + hr = SchRpcEnumFolders(Wine, 0, &start_index, 0, &count, &names); + ok(hr == S_FALSE, "expected S_FALSE, got %#x\n", hr); + ok(!count, "expected 0, got %u\n", count); + ok(start_index == 10, "expected 10, got %u\n", start_index); + ok(!names, "expected NULL, got %p\n", names); + + hr = SchRpcDelete(Wine_Folder1+1, 0); + ok(hr == S_OK, "expected S_OK, got %#x\n", hr); + hr = SchRpcDelete(Wine_Folder2, 0); + ok(hr == S_OK, "expected S_OK, got %#x\n", hr); + + start_index = 0; + count = 0xdeadbeef; + names = NULL; + hr = SchRpcEnumTasks(Wine_Folder1, TASK_ENUM_HIDDEN, &start_index, 0, &count, &names); + ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), "expected ERROR_FILE_NOT_FOUND, got %#x\n", hr); + ok(!count, "expected 0, got %u\n", count); + ok(!start_index, "expected 0, got %u\n", start_index); + ok(!names, "expected NULL, got %p\n", names); + + path = NULL; + info = NULL; + hr = SchRpcRegisterTask(Wine_Task1+1, xmlW, TASK_CREATE, NULL, TASK_LOGON_NONE, 0, NULL, &path, &info); + ok(hr == S_OK, "expected S_OK, got %#x\n", hr); + ok(!lstrcmpW(path, Wine_Task1) /* win7 */ || !lstrcmpW(path, Wine_Task1+1) /* vista */, + "expected \\Wine\\Task1, task actual path %s\n", wine_dbgstr_w(path)); + ok(!info, "expected NULL, info %p\n", info); + MIDL_user_free(path); + + path = NULL; + info = NULL; + hr = SchRpcRegisterTask(Wine_Task2, xmlW, TASK_CREATE, NULL, TASK_LOGON_NONE, 0, NULL, &path, &info); + ok(hr == S_OK, "expected S_OK, got %#x\n", hr); + ok(!lstrcmpW(path, Wine_Task2), "expected \\Wine\\Task2, task actual path %s\n", wine_dbgstr_w(path)); + ok(!info, "expected NULL, info %p\n", info); + MIDL_user_free(path); + + start_index = 0; + count = 0xdeadbeef; + names = NULL; + hr = SchRpcEnumTasks(Wine, 0, &start_index, 0, &count, &names); + ok(hr == S_OK, "expected S_OK, got %#x\n", hr); + ok(count == 2, "expected 2, got %u\n", count); + ok(start_index == 2, "expected 2, got %u\n", start_index); + ok(names != NULL, "names should not be NULL\n"); + enumed = 0; + for (i = 0; i < count; i++) + { + if (!lstrcmpW(names[i], Task1)) + enumed += 1; + else if (!lstrcmpW(names[i], Task2)) + enumed += 2; + MIDL_user_free(names[i]); + } + MIDL_user_free(names); + ok(enumed == 3, "expected 3, got %u\n", enumed); + + start_index = 0; + count = 0xdeadbeef; + names = NULL; + hr = SchRpcEnumTasks(Wine, 0, &start_index, 1, &count, &names); + ok(hr == S_FALSE, "expected S_FALSE, got %#x\n", hr); + ok(count == 1, "expected 1, got %u\n", count); + ok(start_index == 1, "expected 1, got %u\n", start_index); + ok(names != NULL, "names should not be NULL\n"); + /* returned name depends whether directory randomization is on */ + ok(!lstrcmpW(names[0], Task1) || !lstrcmpW(names[0], Task2), + "expected Task1, got %s\n", wine_dbgstr_w(names[0])); + MIDL_user_free(names[0]); + MIDL_user_free(names); + + start_index = 0; + count = 0xdeadbeef; + names = NULL; + hr = SchRpcEnumTasks(Wine, 0, &start_index, 2, &count, &names); + ok(hr == S_FALSE, "expected S_FALSE, got %#x\n", hr); + ok(count == 2, "expected 2, got %u\n", count); + ok(start_index == 2, "expected 2, got %u\n", start_index); + ok(names != NULL, "names should not be NULL\n"); + enumed = 0; + for (i = 0; i < count; i++) + { + if (!lstrcmpW(names[i], Task1)) + enumed += 1; + else if (!lstrcmpW(names[i], Task2)) + enumed += 2; + MIDL_user_free(names[i]); + } + MIDL_user_free(names); + ok(enumed == 3, "expected 3, got %u\n", enumed); + + start_index = 0; + count = 0xdeadbeef; + names = NULL; + hr = SchRpcEnumTasks(Wine, 0, &start_index, 10, &count, &names); + ok(hr == S_OK, "expected S_OK, got %#x\n", hr); + ok(count == 2, "expected 2, got %u\n", count); + ok(start_index == 2, "expected 2, got %u\n", start_index); + ok(names != NULL, "names should not be NULL\n"); + enumed = 0; + for (i = 0; i < count; i++) + { + if (!lstrcmpW(names[i], Task1)) + enumed += 1; + else if (!lstrcmpW(names[i], Task2)) + enumed += 2; + MIDL_user_free(names[i]); + } + MIDL_user_free(names); + ok(enumed == 3, "expected 3, got %u\n", enumed); + + path = NULL; + info = NULL; + hr = SchRpcRegisterTask(Wine_Task3+1, xmlW, TASK_CREATE, NULL, TASK_LOGON_NONE, 0, NULL, &path, &info); + ok(hr == S_OK, "expected S_OK, got %#x\n", hr); + ok(!lstrcmpW(path, Wine_Task3) /* win7 */ || !lstrcmpW(path, Wine_Task3+1) /* vista */, + "expected \\Wine\\Task3, task actual path %s\n", wine_dbgstr_w(path)); + ok(!info, "expected NULL, info %p\n", info); + MIDL_user_free(path); + + count = 0xdeadbeef; + names = NULL; + hr = SchRpcEnumTasks(Wine+1, 0, &start_index, 10, &count, &names); + ok(hr == S_OK, "expected S_OK, got %#x\n", hr); + ok(count == 1, "expected 1, got %u\n", count); + ok(start_index == 3, "expected 3, got %u\n", start_index); + ok(names != NULL, "names should not be NULL\n"); + /* returned name depends whether directory randomization is on */ + ok(!lstrcmpW(names[0], Task1) || !lstrcmpW(names[0], Task2) || !lstrcmpW(names[0], Task3), + "expected Task3, got %s\n", wine_dbgstr_w(names[0])); + MIDL_user_free(names[0]); + MIDL_user_free(names); + + if (0) /* crashes under win7 */ + { + hr = SchRpcGetTaskInfo(NULL, 0, NULL, NULL); + hr = SchRpcGetTaskInfo(Task1, 0, NULL, NULL); + hr = SchRpcGetTaskInfo(Task1, 0, &enabled, NULL); + hr = SchRpcGetTaskInfo(Task1, 0, NULL, &state); + } + + hr = SchRpcGetTaskInfo(Task1, 0, &enabled, &state); + ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), "expected ERROR_FILE_NOT_FOUND, got %#x\n", hr); + + enabled = state = 0xdeadbeef; + hr = SchRpcGetTaskInfo(Wine_Task1, 0, &enabled, &state); + ok(hr == S_OK, "expected S_OK, got %#x\n", hr); + ok(enabled == 0, "expected 0, got %u\n", enabled); + ok(state == TASK_STATE_UNKNOWN, "expected TASK_STATE_UNKNOWN, got %u\n", state); + + enabled = state = 0xdeadbeef; + hr = SchRpcGetTaskInfo(Wine_Task1, SCH_FLAG_STATE, &enabled, &state); + ok(hr == S_OK, "expected S_OK, got %#x\n", hr); + ok(enabled == 0, "expected 0, got %u\n", enabled); + ok(state == TASK_STATE_DISABLED, "expected TASK_STATE_DISABLED, got %u\n", state); + + hr = SchRpcEnableTask(Wine_Task1, 0xdeadbeef); +todo_wine + ok(hr == S_OK, "expected S_OK, got %#x\n", hr); + + enabled = state = 0xdeadbeef; + hr = SchRpcGetTaskInfo(Wine_Task1, SCH_FLAG_STATE, &enabled, &state); + ok(hr == S_OK, "expected S_OK, got %#x\n", hr); +todo_wine + ok(enabled == 1, "expected 1, got %u\n", enabled); +todo_wine + ok(state == TASK_STATE_READY, "expected TASK_STATE_READY, got %u\n", state); + + hr = SchRpcDelete(Wine_Task1+1, 0); + ok(hr == S_OK, "expected S_OK, got %#x\n", hr); + hr = SchRpcDelete(Wine_Task2+1, 0); + ok(hr == S_OK, "expected S_OK, got %#x\n", hr); + hr = SchRpcDelete(Wine_Task3+1, 0); + ok(hr == S_OK, "expected S_OK, got %#x\n", hr); + hr = SchRpcDelete(Wine, 0); + ok(hr == S_OK, "expected S_OK, got %#x\n", hr); + + path = NULL; + info = NULL; + hr = SchRpcRegisterTask(NULL, xmlW, TASK_CREATE, NULL, TASK_LOGON_NONE, 0, NULL, &path, &info); + ok(hr == S_OK, "expected S_OK, got %#x\n", hr); + ok(!info, "expected NULL, info %p\n", info); + hr = IIDFromString(path, &iid); + ok(hr == S_OK, "IIDFromString(%s) error %#x\n", wine_dbgstr_w(path), hr); + hr = SchRpcDelete(path, 0); + ok(hr == S_OK, "expected S_OK, got %#x\n", hr); + MIDL_user_free(path); + + hr = RpcBindingFree(&rpc_handle); + ok(hr == RPC_S_OK, "RpcBindingFree error %#x\n", hr); +} + +void __RPC_FAR *__RPC_USER MIDL_user_allocate(SIZE_T n) +{ + return HeapAlloc(GetProcessHeap(), 0, n); +} + +void __RPC_USER MIDL_user_free(void __RPC_FAR *p) +{ + HeapFree(GetProcessHeap(), 0, p); +} diff -Nru wine1.7-1.7.14/dlls/schedsvc/tests/schrpc.idl wine1.7-1.7.18/dlls/schedsvc/tests/schrpc.idl --- wine1.7-1.7.14/dlls/schedsvc/tests/schrpc.idl 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.18/dlls/schedsvc/tests/schrpc.idl 2014-05-02 18:15:48.000000000 +0000 @@ -0,0 +1,3 @@ +#pragma makedep client + +#include "wine/schrpc.idl" diff -Nru wine1.7-1.7.14/dlls/scrrun/filesystem.c wine1.7-1.7.18/dlls/scrrun/filesystem.c --- wine1.7-1.7.14/dlls/scrrun/filesystem.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/scrrun/filesystem.c 2014-05-02 18:15:48.000000000 +0000 @@ -37,6 +37,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(scrrun); static const WCHAR bsW[] = {'\\',0}; +static const WCHAR utf16bom = 0xfeff; struct foldercollection { IFolderCollection IFolderCollection_iface; @@ -54,6 +55,7 @@ IDriveCollection IDriveCollection_iface; LONG ref; DWORD drives; + LONG count; }; struct enumdata { @@ -108,6 +110,10 @@ LONG ref; IOMode mode; + BOOL unicode; + BOOL first_read; + LARGE_INTEGER size; + HANDLE file; }; enum iotype { @@ -207,7 +213,7 @@ if (type == IORead) return This->mode == ForWriting || This->mode == ForAppending; else - return TRUE; + return This->mode == ForReading; } static HRESULT WINAPI textstream_QueryInterface(ITextStream *iface, REFIID riid, void **obj) @@ -244,7 +250,10 @@ TRACE("(%p)->(%d)\n", This, ref); if (!ref) + { + CloseHandle(This->file); heap_free(This); + } return ref; } @@ -325,8 +334,24 @@ static HRESULT WINAPI textstream_get_AtEndOfStream(ITextStream *iface, VARIANT_BOOL *eos) { struct textstream *This = impl_from_ITextStream(iface); - FIXME("(%p)->(%p): stub\n", This, eos); - return E_NOTIMPL; + LARGE_INTEGER pos, dist; + + TRACE("(%p)->(%p)\n", This, eos); + + if (!eos) + return E_POINTER; + + if (textstream_check_iomode(This, IORead)) { + *eos = VARIANT_TRUE; + return CTL_E_BADFILEMODE; + } + + dist.QuadPart = 0; + if (!SetFilePointerEx(This->file, dist, &pos, FILE_CURRENT)) + return E_FAIL; + + *eos = This->size.QuadPart == pos.QuadPart ? VARIANT_TRUE : VARIANT_FALSE; + return S_OK; } static HRESULT WINAPI textstream_get_AtEndOfLine(ITextStream *iface, VARIANT_BOOL *eol) @@ -336,51 +361,252 @@ return E_NOTIMPL; } +/* + Reads 'toread' bytes from a file, converts if needed + BOM is skipped if 'bof' is set. + */ +static HRESULT textstream_read(struct textstream *stream, LONG toread, BOOL bof, BSTR *text) +{ + HRESULT hr = S_OK; + DWORD read; + char *buff; + BOOL ret; + + if (toread == 0) { + *text = SysAllocStringLen(NULL, 0); + return *text ? S_FALSE : E_OUTOFMEMORY; + } + + if (toread < sizeof(WCHAR)) + return CTL_E_ENDOFFILE; + + buff = heap_alloc(toread); + if (!buff) + return E_OUTOFMEMORY; + + ret = ReadFile(stream->file, buff, toread, &read, NULL); + if (!ret || toread != read) { + WARN("failed to read from file %d, %d, error %d\n", read, toread, GetLastError()); + heap_free(buff); + return E_FAIL; + } + + if (stream->unicode) { + int i = 0; + + /* skip BOM */ + if (bof && *(WCHAR*)buff == utf16bom) { + read -= sizeof(WCHAR); + i += sizeof(WCHAR); + } + + *text = SysAllocStringLen(read ? (WCHAR*)&buff[i] : NULL, read/sizeof(WCHAR)); + if (!*text) hr = E_OUTOFMEMORY; + } + else { + INT len = MultiByteToWideChar(CP_ACP, 0, buff, read, NULL, 0); + *text = SysAllocStringLen(NULL, len); + if (*text) + MultiByteToWideChar(CP_ACP, 0, buff, read, *text, len); + else + hr = E_OUTOFMEMORY; + } + heap_free(buff); + + return hr; +} + static HRESULT WINAPI textstream_Read(ITextStream *iface, LONG len, BSTR *text) { struct textstream *This = impl_from_ITextStream(iface); - FIXME("(%p)->(%p): stub\n", This, text); + LARGE_INTEGER start, end, dist; + DWORD toread; + HRESULT hr; + + TRACE("(%p)->(%d %p)\n", This, len, text); + + if (!text) + return E_POINTER; + + *text = NULL; + if (len <= 0) + return len == 0 ? S_OK : E_INVALIDARG; if (textstream_check_iomode(This, IORead)) return CTL_E_BADFILEMODE; - return E_NOTIMPL; + if (!This->first_read) { + VARIANT_BOOL eos; + + /* check for EOF */ + hr = ITextStream_get_AtEndOfStream(iface, &eos); + if (FAILED(hr)) + return hr; + + if (eos == VARIANT_TRUE) + return CTL_E_ENDOFFILE; + } + + /* read everything from current position */ + dist.QuadPart = 0; + SetFilePointerEx(This->file, dist, &start, FILE_CURRENT); + SetFilePointerEx(This->file, dist, &end, FILE_END); + toread = end.QuadPart - start.QuadPart; + /* rewind back */ + dist.QuadPart = start.QuadPart; + SetFilePointerEx(This->file, dist, NULL, FILE_BEGIN); + + This->first_read = FALSE; + if (This->unicode) len *= sizeof(WCHAR); + + hr = textstream_read(This, min(toread, len), start.QuadPart == 0, text); + if (FAILED(hr)) + return hr; + else + return toread <= len ? S_FALSE : S_OK; } static HRESULT WINAPI textstream_ReadLine(ITextStream *iface, BSTR *text) { struct textstream *This = impl_from_ITextStream(iface); + VARIANT_BOOL eos; + HRESULT hr; + FIXME("(%p)->(%p): stub\n", This, text); + if (!text) + return E_POINTER; + + *text = NULL; if (textstream_check_iomode(This, IORead)) return CTL_E_BADFILEMODE; + /* check for EOF */ + hr = ITextStream_get_AtEndOfStream(iface, &eos); + if (FAILED(hr)) + return hr; + + if (eos == VARIANT_TRUE) + return CTL_E_ENDOFFILE; + return E_NOTIMPL; } static HRESULT WINAPI textstream_ReadAll(ITextStream *iface, BSTR *text) { struct textstream *This = impl_from_ITextStream(iface); - FIXME("(%p)->(%p): stub\n", This, text); + LARGE_INTEGER start, end, dist; + DWORD toread; + HRESULT hr; + + TRACE("(%p)->(%p)\n", This, text); + + if (!text) + return E_POINTER; + *text = NULL; if (textstream_check_iomode(This, IORead)) return CTL_E_BADFILEMODE; - return E_NOTIMPL; + if (!This->first_read) { + VARIANT_BOOL eos; + + /* check for EOF */ + hr = ITextStream_get_AtEndOfStream(iface, &eos); + if (FAILED(hr)) + return hr; + + if (eos == VARIANT_TRUE) + return CTL_E_ENDOFFILE; + } + + /* read everything from current position */ + dist.QuadPart = 0; + SetFilePointerEx(This->file, dist, &start, FILE_CURRENT); + SetFilePointerEx(This->file, dist, &end, FILE_END); + toread = end.QuadPart - start.QuadPart; + /* rewind back */ + dist.QuadPart = start.QuadPart; + SetFilePointerEx(This->file, dist, NULL, FILE_BEGIN); + + This->first_read = FALSE; + + hr = textstream_read(This, toread, start.QuadPart == 0, text); + return FAILED(hr) ? hr : S_FALSE; +} + +static HRESULT textstream_writestr(struct textstream *stream, BSTR text) +{ + DWORD written = 0; + BOOL ret; + + if (stream->unicode) { + ret = WriteFile(stream->file, text, SysStringByteLen(text), &written, NULL); + return (ret && written == SysStringByteLen(text)) ? S_OK : create_error(GetLastError()); + } else { + DWORD len = WideCharToMultiByte(CP_ACP, 0, text, SysStringLen(text), NULL, 0, NULL, NULL); + char *buffA; + HRESULT hr; + + buffA = heap_alloc(len); + if (!buffA) + return E_OUTOFMEMORY; + + WideCharToMultiByte(CP_ACP, 0, text, SysStringLen(text), buffA, len, NULL, NULL); + ret = WriteFile(stream->file, buffA, len, &written, NULL); + hr = (ret && written == len) ? S_OK : create_error(GetLastError()); + heap_free(buffA); + return hr; + } } static HRESULT WINAPI textstream_Write(ITextStream *iface, BSTR text) { struct textstream *This = impl_from_ITextStream(iface); - FIXME("(%p)->(%s): stub\n", This, debugstr_w(text)); - return E_NOTIMPL; + + TRACE("(%p)->(%s)\n", This, debugstr_w(text)); + + if (textstream_check_iomode(This, IOWrite)) + return CTL_E_BADFILEMODE; + + return textstream_writestr(This, text); +} + +static HRESULT textstream_writecrlf(struct textstream *stream) +{ + static const WCHAR crlfW[] = {'\r','\n'}; + static const char crlfA[] = {'\r','\n'}; + DWORD written = 0, len; + const void *ptr; + BOOL ret; + + if (stream->unicode) { + ptr = crlfW; + len = sizeof(crlfW); + } + else { + ptr = crlfA; + len = sizeof(crlfA); + } + + ret = WriteFile(stream->file, ptr, len, &written, NULL); + return (ret && written == len) ? S_OK : create_error(GetLastError()); } static HRESULT WINAPI textstream_WriteLine(ITextStream *iface, BSTR text) { struct textstream *This = impl_from_ITextStream(iface); - FIXME("(%p)->(%s): stub\n", This, debugstr_w(text)); - return E_NOTIMPL; + HRESULT hr; + + TRACE("(%p)->(%s)\n", This, debugstr_w(text)); + + if (textstream_check_iomode(This, IOWrite)) + return CTL_E_BADFILEMODE; + + hr = textstream_writestr(This, text); + if (SUCCEEDED(hr)) + hr = textstream_writecrlf(This); + return hr; } static HRESULT WINAPI textstream_WriteBlankLines(ITextStream *iface, LONG lines) @@ -434,9 +660,26 @@ textstream_Close }; -static HRESULT create_textstream(IOMode mode, ITextStream **ret) +static HRESULT create_textstream(const WCHAR *filename, DWORD disposition, IOMode mode, BOOL unicode, ITextStream **ret) { struct textstream *stream; + DWORD access = 0; + + /* map access mode */ + switch (mode) + { + case ForReading: + access = GENERIC_READ; + break; + case ForWriting: + access = GENERIC_WRITE; + break; + case ForAppending: + access = FILE_APPEND_DATA; + break; + default: + return E_INVALIDARG; + } stream = heap_alloc(sizeof(struct textstream)); if (!stream) return E_OUTOFMEMORY; @@ -444,6 +687,31 @@ stream->ITextStream_iface.lpVtbl = &textstreamvtbl; stream->ref = 1; stream->mode = mode; + stream->unicode = unicode; + stream->first_read = TRUE; + + stream->file = CreateFileW(filename, access, 0, NULL, disposition, FILE_ATTRIBUTE_NORMAL, NULL); + if (stream->file == INVALID_HANDLE_VALUE) + { + HRESULT hr = create_error(GetLastError()); + heap_free(stream); + return hr; + } + + if (mode == ForReading) + GetFileSizeEx(stream->file, &stream->size); + else + stream->size.QuadPart = 0; + + /* Write Unicode BOM */ + if (unicode && mode == ForWriting && (disposition == CREATE_ALWAYS || disposition == CREATE_NEW)) { + DWORD written = 0; + BOOL ret = WriteFile(stream->file, &utf16bom, sizeof(utf16bom), &written, NULL); + if (!ret || written != sizeof(utf16bom)) { + ITextStream_Release(&stream->ITextStream_iface); + return create_error(GetLastError()); + } + } *ret = &stream->ITextStream_iface; return S_OK; @@ -562,8 +830,17 @@ static HRESULT WINAPI drive_get_DriveLetter(IDrive *iface, BSTR *letter) { struct drive *This = impl_from_IDrive(iface); - FIXME("(%p)->(%p): stub\n", This, letter); - return E_NOTIMPL; + + TRACE("(%p)->(%p)\n", This, letter); + + if (!letter) + return E_POINTER; + + *letter = SysAllocStringLen(This->root, 1); + if (!*letter) + return E_OUTOFMEMORY; + + return S_OK; } static HRESULT WINAPI drive_get_ShareName(IDrive *iface, BSTR *share_name) @@ -611,25 +888,55 @@ return E_NOTIMPL; } -static HRESULT WINAPI drive_get_AvailableSpace(IDrive *iface, VARIANT *avail) +static HRESULT WINAPI drive_get_AvailableSpace(IDrive *iface, VARIANT *v) { struct drive *This = impl_from_IDrive(iface); - FIXME("(%p)->(%p): stub\n", This, avail); - return E_NOTIMPL; + ULARGE_INTEGER avail; + + TRACE("(%p)->(%p)\n", This, v); + + if (!v) + return E_POINTER; + + if (!GetDiskFreeSpaceExW(This->root, &avail, NULL, NULL)) + return E_FAIL; + + V_VT(v) = VT_R8; + return VarR8FromUI8(avail.QuadPart, &V_R8(v)); } static HRESULT WINAPI drive_get_FreeSpace(IDrive *iface, VARIANT *v) { struct drive *This = impl_from_IDrive(iface); - FIXME("(%p)->(%p): stub\n", This, v); - return E_NOTIMPL; + ULARGE_INTEGER freespace; + + TRACE("(%p)->(%p)\n", This, v); + + if (!v) + return E_POINTER; + + if (!GetDiskFreeSpaceExW(This->root, &freespace, NULL, NULL)) + return E_FAIL; + + V_VT(v) = VT_R8; + return VarR8FromUI8(freespace.QuadPart, &V_R8(v)); } static HRESULT WINAPI drive_get_TotalSize(IDrive *iface, VARIANT *v) { struct drive *This = impl_from_IDrive(iface); - FIXME("(%p)->(%p): stub\n", This, v); - return E_NOTIMPL; + ULARGE_INTEGER total; + + TRACE("(%p)->(%p)\n", This, v); + + if (!v) + return E_POINTER; + + if (!GetDiskFreeSpaceExW(This->root, NULL, &total, NULL)) + return E_FAIL; + + V_VT(v) = VT_R8; + return VarR8FromUI8(total.QuadPart, &V_R8(v)); } static HRESULT WINAPI drive_get_VolumeName(IDrive *iface, BSTR *name) @@ -663,8 +970,17 @@ static HRESULT WINAPI drive_get_IsReady(IDrive *iface, VARIANT_BOOL *ready) { struct drive *This = impl_from_IDrive(iface); - FIXME("(%p)->(%p): stub\n", This, ready); - return E_NOTIMPL; + ULARGE_INTEGER freespace; + BOOL ret; + + TRACE("(%p)->(%p)\n", This, ready); + + if (!ready) + return E_POINTER; + + ret = GetDiskFreeSpaceExW(This->root, &freespace, NULL, NULL); + *ready = ret ? VARIANT_TRUE : VARIANT_FALSE; + return S_OK; } static const IDriveVtbl drivevtbl = { @@ -761,7 +1077,7 @@ return ref; } -static HANDLE start_enumeration(const WCHAR *path, WIN32_FIND_DATAW *data) +static HANDLE start_enumeration(const WCHAR *path, WIN32_FIND_DATAW *data, BOOL file) { static const WCHAR allW[] = {'*',0}; WCHAR pathW[MAX_PATH]; @@ -776,10 +1092,10 @@ handle = FindFirstFileW(pathW, data); if (handle == INVALID_HANDLE_VALUE) return 0; - /* find first dir */ + /* find first dir/file */ while (1) { - if (is_dir_data(data)) + if (file ? is_file_data(data) : is_dir_data(data)) break; if (!FindNextFileW(handle, data)) @@ -807,7 +1123,7 @@ if (!handle) { - handle = start_enumeration(This->data.u.foldercoll.coll->path, &data); + handle = start_enumeration(This->data.u.foldercoll.coll->path, &data, FALSE); if (!handle) return S_FALSE; This->data.u.foldercoll.find = handle; @@ -857,7 +1173,7 @@ if (!handle) { - handle = start_enumeration(This->data.u.foldercoll.coll->path, &data); + handle = start_enumeration(This->data.u.foldercoll.coll->path, &data, FALSE); if (!handle) return S_FALSE; This->data.u.foldercoll.find = handle; @@ -957,43 +1273,19 @@ if (fetched) *fetched = 0; + if (!celt) return S_OK; + if (!handle) { - static const WCHAR allW[] = {'*',0}; - WCHAR pathW[MAX_PATH]; - BSTR parent = This->data.u.filecoll.coll->path; - int len; - - strcpyW(pathW, parent); - len = SysStringLen(parent); - if (parent[len-1] != '\\') - strcatW(pathW, bsW); - strcatW(pathW, allW); - handle = FindFirstFileW(pathW, &data); - if (handle == INVALID_HANDLE_VALUE) - return S_FALSE; - - while (1) - { - if (is_file_data(&data)) - break; - else - if (!FindNextFileW(handle, &data)) - { - FindClose(handle); - return S_FALSE; - } - } - + handle = start_enumeration(This->data.u.filecoll.coll->path, &data, TRUE); + if (!handle) return S_FALSE; This->data.u.filecoll.find = handle; } - else if (celt) - FindNextFileW(handle, &data); + else if (!FindNextFileW(handle, &data)) + return S_FALSE; do { - if (count >= celt) break; - if (is_file_data(&data)) { IFile *file; @@ -1007,17 +1299,14 @@ V_VT(&var[count]) = VT_DISPATCH; V_DISPATCH(&var[count]) = (IDispatch*)file; - count++; + if (++count >= celt) break; } } while (FindNextFileW(handle, &data)); - if (count < celt) - return S_FALSE; - if (fetched) *fetched = count; - return S_OK; + return (count < celt) ? S_FALSE : S_OK; } static HRESULT WINAPI filecoll_enumvariant_Skip(IEnumVARIANT *iface, ULONG celt) @@ -1028,9 +1317,22 @@ TRACE("(%p)->(%d)\n", This, celt); - while (FindNextFileW(handle, &data) && celt) + if (!celt) return S_OK; + + if (!handle) + { + handle = start_enumeration(This->data.u.filecoll.coll->path, &data, TRUE); + if (!handle) return S_FALSE; + This->data.u.filecoll.find = handle; + } + else if (!FindNextFileW(handle, &data)) + return S_FALSE; + + do + { if (is_file_data(&data)) --celt; + } while (celt && FindNextFileW(handle, &data)); return celt ? S_FALSE : S_OK; } @@ -1075,6 +1377,7 @@ This->IEnumVARIANT_iface.lpVtbl = &filecollenumvariantvtbl; This->ref = 1; + This->data.u.filecoll.find = NULL; This->data.u.filecoll.coll = collection; IFileCollection_AddRef(&collection->IFileCollection_iface); @@ -1117,16 +1420,18 @@ { struct enumvariant *This = impl_from_IEnumVARIANT(iface); ULONG count = 0; - HRESULT hr; TRACE("(%p)->(%d %p %p)\n", This, celt, var, fetched); if (fetched) *fetched = 0; + if (!celt) return S_OK; + while (find_next_drive(This) == S_OK) { IDrive *drive; + HRESULT hr; hr = create_drive('A' + This->data.u.drivecoll.cur, &drive); if (FAILED(hr)) return hr; @@ -1137,22 +1442,24 @@ if (++count >= celt) break; } - if (count < celt) - return S_FALSE; - if (fetched) *fetched = count; - return S_OK; + return (count < celt) ? S_FALSE : S_OK; } static HRESULT WINAPI drivecoll_enumvariant_Skip(IEnumVARIANT *iface, ULONG celt) { struct enumvariant *This = impl_from_IEnumVARIANT(iface); - FIXME("(%p)->(%d): stub\n", This, celt); + TRACE("(%p)->(%d)\n", This, celt); - return E_NOTIMPL; + if (!celt) return S_OK; + + while (celt && find_next_drive(This) == S_OK) + celt--; + + return celt ? S_FALSE : S_OK; } static HRESULT WINAPI drivecoll_enumvariant_Reset(IEnumVARIANT *iface) @@ -1685,8 +1992,13 @@ static HRESULT WINAPI drivecoll_get_Count(IDriveCollection *iface, LONG *count) { struct drivecollection *This = impl_from_IDriveCollection(iface); - FIXME("(%p)->(%p): stub\n", This, count); - return E_NOTIMPL; + + TRACE("(%p)->(%p)\n", This, count); + + if (!count) return E_POINTER; + + *count = This->count; + return S_OK; } static const IDriveCollectionVtbl drivecollectionvtbl = { @@ -1705,6 +2017,7 @@ static HRESULT create_drivecoll(IDriveCollection **drives) { struct drivecollection *This; + DWORD mask; *drives = NULL; @@ -1713,7 +2026,10 @@ This->IDriveCollection_iface.lpVtbl = &drivecollectionvtbl; This->ref = 1; - This->drives = GetLogicalDrives(); + This->drives = mask = GetLogicalDrives(); + /* count set bits */ + for (This->count = 0; mask; This->count++) + mask &= mask - 1; *drives = &This->IDriveCollection_iface; return S_OK; @@ -1825,8 +2141,14 @@ static HRESULT WINAPI folder_get_Path(IFolder *iface, BSTR *path) { struct folder *This = impl_from_IFolder(iface); - FIXME("(%p)->(%p): stub\n", This, path); - return E_NOTIMPL; + + TRACE("(%p)->(%p)\n", This, path); + + if(!path) + return E_POINTER; + + *path = SysAllocString(This->path); + return *path ? S_OK : E_OUTOFMEMORY; } static HRESULT WINAPI folder_get_Name(IFolder *iface, BSTR *name) @@ -2325,11 +2647,18 @@ return E_NOTIMPL; } -static HRESULT WINAPI file_OpenAsTextStream(IFile *iface, IOMode IOMode, Tristate Format, ITextStream **ppts) +static HRESULT WINAPI file_OpenAsTextStream(IFile *iface, IOMode mode, Tristate format, ITextStream **stream) { struct file *This = impl_from_IFile(iface); - FIXME("(%p)->(%x %x %p)\n", This, IOMode, Format, ppts); - return E_NOTIMPL; + + TRACE("(%p)->(%d %d %p)\n", This, mode, format, stream); + + if (format == TristateUseDefault) { + FIXME("default format not handled, defaulting to unicode\n"); + format = TristateTrue; + } + + return create_textstream(This->path, OPEN_EXISTING, mode, format == TristateTrue, stream); } static const IFileVtbl file_vtbl = { @@ -3051,8 +3380,10 @@ return CTL_E_FILENOTFOUND; src_len = get_parent_folder_name(source, source_len); - if(src_len+1 >= MAX_PATH) + if(src_len+1 >= MAX_PATH) { + FindClose(f); return E_FAIL; + } if(src_len) { memcpy(src_path, source, src_len*sizeof(WCHAR)); src_path[src_len++] = '\\'; @@ -3195,10 +3526,9 @@ FindClose(f); return CTL_E_FILEALREADYEXISTS; } - }else { - FindClose(f); - return create_error(GetLastError()); } + + FindClose(f); return create_error(GetLastError()); } copied = TRUE; @@ -3250,21 +3580,33 @@ return create_folder(path, folder); } -static HRESULT WINAPI filesys_CreateTextFile(IFileSystem3 *iface, BSTR FileName, - VARIANT_BOOL Overwrite, VARIANT_BOOL Unicode, - ITextStream **ppts) +static HRESULT WINAPI filesys_CreateTextFile(IFileSystem3 *iface, BSTR filename, + VARIANT_BOOL overwrite, VARIANT_BOOL unicode, + ITextStream **stream) { - FIXME("%p %s %d %d %p\n", iface, debugstr_w(FileName), Overwrite, Unicode, ppts); + DWORD disposition; - return E_NOTIMPL; + TRACE("%p %s %d %d %p\n", iface, debugstr_w(filename), overwrite, unicode, stream); + + disposition = overwrite == VARIANT_TRUE ? CREATE_ALWAYS : CREATE_NEW; + return create_textstream(filename, disposition, ForWriting, !!unicode, stream); } static HRESULT WINAPI filesys_OpenTextFile(IFileSystem3 *iface, BSTR filename, IOMode mode, VARIANT_BOOL create, Tristate format, ITextStream **stream) { - FIXME("(%p)->(%s %d %d %d %p)\n", iface, debugstr_w(filename), mode, create, format, stream); - return create_textstream(mode, stream); + DWORD disposition; + + TRACE("(%p)->(%s %d %d %d %p)\n", iface, debugstr_w(filename), mode, create, format, stream); + disposition = create == VARIANT_TRUE ? OPEN_ALWAYS : OPEN_EXISTING; + + if (format == TristateUseDefault) { + FIXME("default format not handled, defaulting to unicode\n"); + format = TristateTrue; + } + + return create_textstream(filename, disposition, mode, format == TristateTrue, stream); } static HRESULT WINAPI filesys_GetStandardStream(IFileSystem3 *iface, diff -Nru wine1.7-1.7.14/dlls/scrrun/scrrun.idl wine1.7-1.7.18/dlls/scrrun/scrrun.idl --- wine1.7-1.7.14/dlls/scrrun/scrrun.idl 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/scrrun/scrrun.idl 2014-05-02 18:15:48.000000000 +0000 @@ -27,6 +27,7 @@ cpp_quote("#undef DeleteFile") cpp_quote("#undef MoveFile") cpp_quote("#endif") +cpp_quote("#define CTL_E_ENDOFFILE STD_CTL_SCODE(62)") /* this is not defined in public headers */ [ uuid(420B2830-E718-11CF-893D-00A0C9054228), @@ -36,23 +37,13 @@ { importlib("stdole2.tlb"); - interface IDictionary; - interface IDrive; - interface IDriveCollection; - interface IFile; - interface IFileCollection; - interface IFileSystem; - interface IFileSystem3; interface IFolder; - interface IFolderCollection; - interface IScriptEncoder; - interface ITextStream; typedef enum CompareMethod { - BinaryCompare = 0, - TextCompare = 1, - DatabaseCompare = 2 + BinaryCompare, + TextCompare, + DatabaseCompare } CompareMethod; typedef enum IOMode @@ -64,10 +55,10 @@ typedef enum Tristate { - TristateTrue = 0xffffffff, - TristateFalse = 0, - TristateUseDefault = 0xfffffffe, - TristateMixed = 0xfffffffe + TristateTrue = -1, + TristateFalse = 0, + TristateUseDefault = -2, + TristateMixed = -2 } Tristate; typedef enum FileAttribute @@ -85,9 +76,9 @@ typedef enum SpecialFolderConst { - WindowsFolder = 0, - SystemFolder = 1, - TemporaryFolder = 2 + WindowsFolder, + SystemFolder, + TemporaryFolder } SpecialFolderConst; typedef enum DriveTypeConst @@ -102,9 +93,9 @@ typedef enum StandardStreamTypes { - StdIn = 0, - StdOut = 1, - StdErr = 2 + StdIn, + StdOut, + StdErr } StandardStreamTypes; [ @@ -164,94 +155,52 @@ [ odl, - uuid(0AB5A3D0-E5B6-11D0-ABF5-00A0C90FFFC0), + uuid(C7C3F5A0-88A3-11D0-ABCB-00A0C90FFFC0), hidden, dual, nonextensible, oleautomation ] - interface IFileSystem : IDispatch + interface IDrive : IDispatch { - [id(0x0000271a), propget] - HRESULT Drives([out, retval] IDriveCollection** ppdrives); - - [id(0x00002710)] - HRESULT BuildPath([in] BSTR Path, [in] BSTR Name, [out, retval] BSTR* pbstrResult); - - [id(0x00002714)] - HRESULT GetDriveName([in] BSTR Path, [out, retval] BSTR* pbstrResult); - - [id(0x00002715)] - HRESULT GetParentFolderName([in] BSTR Path, [out, retval] BSTR* pbstrResult); - - [id(0x00002716)] - HRESULT GetFileName([in] BSTR Path, [out, retval] BSTR* pbstrResult); - - [id(0x00002717)] - HRESULT GetBaseName([in] BSTR Path, [out, retval] BSTR* pbstrResult); - - [id(0x00002718)] - HRESULT GetExtensionName([in] BSTR Path, [out, retval] BSTR* pbstrResult); - - [id(0x00002712)] - HRESULT GetAbsolutePathName([in] BSTR Path, [out, retval] BSTR* pbstrResult); - - [id(0x00002713)] - HRESULT GetTempName([out, retval] BSTR* pbstrResult); - - [id(0x0000271f)] - HRESULT DriveExists([in] BSTR DriveSpec, [out, retval] VARIANT_BOOL* pfExists); - - [id(0x00002720)] - HRESULT FileExists([in] BSTR FileSpec, [out, retval] VARIANT_BOOL* pfExists); - - [id(0x00002721)] - HRESULT FolderExists([in] BSTR FolderSpec, [out, retval] VARIANT_BOOL* pfExists); - - [id(0x0000271b)] - HRESULT GetDrive([in] BSTR DriveSpec, [out, retval] IDrive** ppdrive); + [id(DISPID_VALUE), propget] + HRESULT Path([out, retval] BSTR* pbstrPath); - [id(0x0000271c)] - HRESULT GetFile([in] BSTR FilePath, [out, retval] IFile** ppfile); + [id(0x00002710), propget] + HRESULT DriveLetter([out, retval] BSTR* pbstrLetter); - [id(0x0000271d)] - HRESULT GetFolder([in] BSTR FolderPath, [out, retval] IFolder** ppfolder); + [id(0x00002711), propget] + HRESULT ShareName([out, retval] BSTR* pbstrShareName); - [id(0x0000271e)] - HRESULT GetSpecialFolder([in] SpecialFolderConst SpecialFolder, [out, retval] IFolder** ppfolder); + [id(0x00002712), propget] + HRESULT DriveType([out, retval] DriveTypeConst* pdt); - [id(0x000004b0)] - HRESULT DeleteFile([in] BSTR FileSpec, [in, optional, defaultvalue(0)] VARIANT_BOOL Force); + [id(0x00002713), propget] + HRESULT RootFolder([out, retval] IFolder** ppfolder); - [id(0x000004b1)] - HRESULT DeleteFolder([in] BSTR FolderSpec, [in, optional, defaultvalue(0)] VARIANT_BOOL Force); + [id(0x00002715), propget] + HRESULT AvailableSpace([out, retval] VARIANT* pvarAvail); - [id(0x000004b4), helpstring("Move a file"), helpcontext(0x00214bab)] - HRESULT MoveFile([in] BSTR Source, [in] BSTR Destination); + [id(0x00002714), propget] + HRESULT FreeSpace([out, retval] VARIANT* pvarFree); - [id(0x000004b5)] - HRESULT MoveFolder([in] BSTR Source, [in] BSTR Destination); + [id(0x00002716), propget] + HRESULT TotalSize([out, retval] VARIANT* pvarTotal); - [id(0x000004b2)] - HRESULT CopyFile([in] BSTR Source, [in] BSTR Destination, - [in, optional, defaultvalue(-1)] VARIANT_BOOL OverWriteFiles); + [id(0x00002717), propget] + HRESULT VolumeName([out, retval] BSTR* pbstrName); - [id(0x000004b3)] - HRESULT CopyFolder([in] BSTR Source, [in] BSTR Destination, - [in, optional, defaultvalue(-1)] VARIANT_BOOL OverWriteFiles); + [id(0x00002717), propput] + HRESULT VolumeName([in] BSTR pbstrName); - [id(0x00000460)] - HRESULT CreateFolder([in] BSTR Path, [out, retval] IFolder** ppfolder); + [id(0x00002718), propget] + HRESULT FileSystem([out, retval] BSTR* pbstrFileSystem); - [id(0x0000044d)] - HRESULT CreateTextFile([in] BSTR FileName, [in, optional, defaultvalue(-1)] VARIANT_BOOL Overwrite, - [in, optional, defaultvalue(0)] VARIANT_BOOL Unicode, [out, retval] ITextStream** ppts); + [id(0x00002719), propget] + HRESULT SerialNumber([out, retval] long* pulSerialNumber); - [id(0x0000044c)] - HRESULT OpenTextFile([in] BSTR FileName, [in, optional, defaultvalue(1)] IOMode IOMode, - [in, optional, defaultvalue(0)] VARIANT_BOOL Create, - [in, optional, defaultvalue(0)] Tristate Format, - [out, retval] ITextStream** ppts); + [id(0x0000271a), propget] + HRESULT IsReady([out, retval] VARIANT_BOOL* pfReady); } [ @@ -275,63 +224,63 @@ [ odl, - uuid(C7C3F5A0-88A3-11D0-ABCB-00A0C90FFFC0), + uuid(53BAD8C1-E718-11CF-893D-00A0C9054228), hidden, dual, nonextensible, oleautomation ] - interface IDrive : IDispatch + interface ITextStream : IDispatch { - [id(DISPID_VALUE), propget] - HRESULT Path([out, retval] BSTR* pbstrPath); - [id(0x00002710), propget] - HRESULT DriveLetter([out, retval] BSTR* pbstrLetter); + HRESULT Line([out, retval] long* Line); - [id(0x00002711), propget] - HRESULT ShareName([out, retval] BSTR* pbstrShareName); + [id(0xfffffdef), propget] + HRESULT Column([out, retval] long* Column); [id(0x00002712), propget] - HRESULT DriveType([out, retval] DriveTypeConst* pdt); + HRESULT AtEndOfStream([out, retval] VARIANT_BOOL* EOS); [id(0x00002713), propget] - HRESULT RootFolder([out, retval] IFolder** ppfolder); + HRESULT AtEndOfLine([out, retval] VARIANT_BOOL* EOL); - [id(0x00002715), propget] - HRESULT AvailableSpace([out, retval] VARIANT* pvarAvail); + [id(0x00002714)] + HRESULT Read([in] long Characters, [out, retval] BSTR* Text); - [id(0x00002714), propget] - HRESULT FreeSpace([out, retval] VARIANT* pvarFree); + [id(0x00002715)] + HRESULT ReadLine([out, retval] BSTR* Text); - [id(0x00002716), propget] - HRESULT TotalSize([out, retval] VARIANT* pvarTotal); + [id(0x00002716)] + HRESULT ReadAll([out, retval] BSTR* Text); - [id(0x00002717), propget] - HRESULT VolumeName([out, retval] BSTR* pbstrName); + [id(0x00002717)] + HRESULT Write([in] BSTR Text); - [id(0x00002717), propput] - HRESULT VolumeName([in] BSTR pbstrName); + [id(0x00002718)] + HRESULT WriteLine([in, defaultvalue("")] BSTR Text); - [id(0x00002718), propget] - HRESULT FileSystem([out, retval] BSTR* pbstrFileSystem); + [id(0x00002719)] + HRESULT WriteBlankLines([in] long Lines); - [id(0x00002719), propget] - HRESULT SerialNumber([out, retval] long* pulSerialNumber); + [id(0x0000271a)] + HRESULT Skip([in] long Characters); - [id(0x0000271a), propget] - HRESULT IsReady([out, retval] VARIANT_BOOL* pfReady); + [id(0x0000271b)] + HRESULT SkipLine(); + + [id(0x0000271c)] + HRESULT Close(); } [ odl, - uuid(C7C3F5A2-88A3-11D0-ABCB-00A0C90FFFC0), + uuid(C7C3F5A4-88A3-11D0-ABCB-00A0C90FFFC0), hidden, dual, nonextensible, oleautomation ] - interface IFolder : IDispatch + interface IFile : IDispatch { [id(DISPID_VALUE), propget] HRESULT Path([out, retval] BSTR* pbstrPath); @@ -369,50 +318,130 @@ [id(0x000003f0), propget] HRESULT DateLastAccessed([out, retval] DATE* pdate); + [id(0x000003f1), propget] + HRESULT Size([out, retval] VARIANT* pvarSize); + [id(0x000003f2), propget] HRESULT Type([out, retval] BSTR* pbstrType); - [id(0x000004b1)] - HRESULT Delete([in, optional, defaultvalue(0)] VARIANT_BOOL Force); + [id(0x000004b0)] + HRESULT Delete([in, defaultvalue(0)] VARIANT_BOOL Force); - [id(0x000004b3)] - HRESULT Copy([in] BSTR Destination, [in, optional, defaultvalue(-1)] VARIANT_BOOL OverWriteFiles); + [id(0x000004b2)] + HRESULT Copy([in] BSTR Destination, [in, defaultvalue(-1)] VARIANT_BOOL OverWriteFiles); - [id(0x000004b5)] + [id(0x000004b4)] HRESULT Move([in] BSTR Destination); - [id(0x00002710), propget] - HRESULT IsRootFolder([out, retval] VARIANT_BOOL* pfRootFolder); + [id(0x0000044c)] + HRESULT OpenAsTextStream([in, defaultvalue(1)] IOMode IOMode, + [in, defaultvalue(0)] Tristate Format, [out, retval] ITextStream** ppts); + } - [id(0x000003f1), propget] - HRESULT Size([out, retval] VARIANT* pvarSize); + [ + odl, + uuid(0AB5A3D0-E5B6-11D0-ABF5-00A0C90FFFC0), + hidden, + dual, + nonextensible, + oleautomation + ] + interface IFileSystem : IDispatch + { + [id(0x0000271a), propget] + HRESULT Drives([out, retval] IDriveCollection** ppdrives); - [id(0x00002711), propget] - HRESULT SubFolders([out, retval] IFolderCollection** ppfolders); + [id(0x00002710)] + HRESULT BuildPath([in] BSTR Path, [in] BSTR Name, [out, retval] BSTR* pbstrResult); - [id(0x00002712), propget] - HRESULT Files([out, retval] IFileCollection** ppfiles); + [id(0x00002714)] + HRESULT GetDriveName([in] BSTR Path, [out, retval] BSTR* pbstrResult); + + [id(0x00002715)] + HRESULT GetParentFolderName([in] BSTR Path, [out, retval] BSTR* pbstrResult); + + [id(0x00002716)] + HRESULT GetFileName([in] BSTR Path, [out, retval] BSTR* pbstrResult); + + [id(0x00002717)] + HRESULT GetBaseName([in] BSTR Path, [out, retval] BSTR* pbstrResult); + + [id(0x00002718)] + HRESULT GetExtensionName([in] BSTR Path, [out, retval] BSTR* pbstrResult); + + [id(0x00002712)] + HRESULT GetAbsolutePathName([in] BSTR Path, [out, retval] BSTR* pbstrResult); + + [id(0x00002713)] + HRESULT GetTempName([out, retval] BSTR* pbstrResult); + + [id(0x0000271f)] + HRESULT DriveExists([in] BSTR DriveSpec, [out, retval] VARIANT_BOOL* pfExists); + + [id(0x00002720)] + HRESULT FileExists([in] BSTR FileSpec, [out, retval] VARIANT_BOOL* pfExists); + + [id(0x00002721)] + HRESULT FolderExists([in] BSTR FolderSpec, [out, retval] VARIANT_BOOL* pfExists); + + [id(0x0000271b)] + HRESULT GetDrive([in] BSTR DriveSpec, [out, retval] IDrive** ppdrive); + + [id(0x0000271c)] + HRESULT GetFile([in] BSTR FilePath, [out, retval] IFile** ppfile); + + [id(0x0000271d)] + HRESULT GetFolder([in] BSTR FolderPath, [out, retval] IFolder** ppfolder); + + [id(0x0000271e)] + HRESULT GetSpecialFolder([in] SpecialFolderConst SpecialFolder, [out, retval] IFolder** ppfolder); + + [id(0x000004b0)] + HRESULT DeleteFile([in] BSTR FileSpec, [in, defaultvalue(0)] VARIANT_BOOL Force); + + [id(0x000004b1)] + HRESULT DeleteFolder([in] BSTR FolderSpec, [in, defaultvalue(0)] VARIANT_BOOL Force); + + [id(0x000004b4), helpstring("Move a file"), helpcontext(0x00214bab)] + HRESULT MoveFile([in] BSTR Source, [in] BSTR Destination); + + [id(0x000004b5)] + HRESULT MoveFolder([in] BSTR Source, [in] BSTR Destination); + + [id(0x000004b2)] + HRESULT CopyFile([in] BSTR Source, [in] BSTR Destination, + [in, defaultvalue(-1)] VARIANT_BOOL OverWriteFiles); + + [id(0x000004b3)] + HRESULT CopyFolder([in] BSTR Source, [in] BSTR Destination, + [in, defaultvalue(-1)] VARIANT_BOOL OverWriteFiles); + + [id(0x00000460)] + HRESULT CreateFolder([in] BSTR Path, [out, retval] IFolder** ppfolder); [id(0x0000044d)] - HRESULT CreateTextFile([in] BSTR FileName, [in, optional, defaultvalue(-1)] VARIANT_BOOL Overwrite, - [in, optional, defaultvalue(0)] VARIANT_BOOL Unicode, [out, retval] ITextStream** ppts); + HRESULT CreateTextFile([in] BSTR FileName, [in, defaultvalue(-1)] VARIANT_BOOL Overwrite, + [in, defaultvalue(0)] VARIANT_BOOL Unicode, [out, retval] ITextStream** ppts); + + [id(0x0000044c)] + HRESULT OpenTextFile([in] BSTR FileName, [in, defaultvalue(1)] IOMode IOMode, + [in, defaultvalue(0)] VARIANT_BOOL Create, + [in, defaultvalue(0)] Tristate Format, + [out, retval] ITextStream** ppts); } [ odl, - uuid(C7C3F5A3-88A3-11D0-ABCB-00A0C90FFFC0), + uuid(C7C3F5A5-88A3-11D0-ABCB-00A0C90FFFC0), hidden, dual, nonextensible, oleautomation ] - interface IFolderCollection : IDispatch + interface IFileCollection : IDispatch { - [id(0x00000002)] - HRESULT Add([in] BSTR Name, [out, retval] IFolder** ppfolder); - [id(DISPID_VALUE), propget] - HRESULT Item([in] VARIANT Key, [out, retval] IFolder** ppfolder); + HRESULT Item([in] VARIANT Key, [out, retval] IFile** ppfile); [id(DISPID_NEWENUM), propget, restricted, hidden] HRESULT _NewEnum([out, retval] IUnknown** ppenum); @@ -423,16 +452,19 @@ [ odl, - uuid(C7C3F5A5-88A3-11D0-ABCB-00A0C90FFFC0), + uuid(C7C3F5A3-88A3-11D0-ABCB-00A0C90FFFC0), hidden, dual, nonextensible, oleautomation ] - interface IFileCollection : IDispatch + interface IFolderCollection : IDispatch { + [id(0x00000002)] + HRESULT Add([in] BSTR Name, [out, retval] IFolder** ppfolder); + [id(DISPID_VALUE), propget] - HRESULT Item([in] VARIANT Key, [out, retval] IFile** ppfile); + HRESULT Item([in] VARIANT Key, [out, retval] IFolder** ppfolder); [id(DISPID_NEWENUM), propget, restricted, hidden] HRESULT _NewEnum([out, retval] IUnknown** ppenum); @@ -443,13 +475,13 @@ [ odl, - uuid(C7C3F5A4-88A3-11D0-ABCB-00A0C90FFFC0), + uuid(C7C3F5A2-88A3-11D0-ABCB-00A0C90FFFC0), hidden, dual, nonextensible, oleautomation ] - interface IFile : IDispatch + interface IFolder : IDispatch { [id(DISPID_VALUE), propget] HRESULT Path([out, retval] BSTR* pbstrPath); @@ -487,74 +519,33 @@ [id(0x000003f0), propget] HRESULT DateLastAccessed([out, retval] DATE* pdate); - [id(0x000003f1), propget] - HRESULT Size([out, retval] VARIANT* pvarSize); - [id(0x000003f2), propget] HRESULT Type([out, retval] BSTR* pbstrType); - [id(0x000004b0)] - HRESULT Delete([in, optional, defaultvalue(0)] VARIANT_BOOL Force); + [id(0x000004b1)] + HRESULT Delete([in, defaultvalue(0)] VARIANT_BOOL Force); - [id(0x000004b2)] - HRESULT Copy([in] BSTR Destination, [in, optional, defaultvalue(-1)] VARIANT_BOOL OverWriteFiles); + [id(0x000004b3)] + HRESULT Copy([in] BSTR Destination, [in, defaultvalue(-1)] VARIANT_BOOL OverWriteFiles); - [id(0x000004b4)] + [id(0x000004b5)] HRESULT Move([in] BSTR Destination); - [id(0x0000044c)] - HRESULT OpenAsTextStream([in, optional, defaultvalue(1)] IOMode IOMode, - [in, optional, defaultvalue(0)] Tristate Format, [out, retval] ITextStream** ppts); - } - - [ - odl, - uuid(53BAD8C1-E718-11CF-893D-00A0C9054228), - hidden, - dual, - nonextensible, - oleautomation - ] - interface ITextStream : IDispatch - { [id(0x00002710), propget] - HRESULT Line([out, retval] long* Line); - - [id(0xfffffdef), propget] - HRESULT Column([out, retval] long* Column); - - [id(0x00002712), propget] - HRESULT AtEndOfStream([out, retval] VARIANT_BOOL* EOS); - - [id(0x00002713), propget] - HRESULT AtEndOfLine([out, retval] VARIANT_BOOL* EOL); - - [id(0x00002714)] - HRESULT Read([in] long Characters, [out, retval] BSTR* Text); - - [id(0x00002715)] - HRESULT ReadLine([out, retval] BSTR* Text); - - [id(0x00002716)] - HRESULT ReadAll([out, retval] BSTR* Text); - - [id(0x00002717)] - HRESULT Write([in] BSTR Text); - - [id(0x00002718)] - HRESULT WriteLine([in, optional, defaultvalue("")] BSTR Text); + HRESULT IsRootFolder([out, retval] VARIANT_BOOL* pfRootFolder); - [id(0x00002719)] - HRESULT WriteBlankLines([in] long Lines); + [id(0x000003f1), propget] + HRESULT Size([out, retval] VARIANT* pvarSize); - [id(0x0000271a)] - HRESULT Skip([in] long Characters); + [id(0x00002711), propget] + HRESULT SubFolders([out, retval] IFolderCollection** ppfolders); - [id(0x0000271b)] - HRESULT SkipLine(); + [id(0x00002712), propget] + HRESULT Files([out, retval] IFileCollection** ppfiles); - [id(0x0000271c)] - HRESULT Close(); + [id(0x0000044d)] + HRESULT CreateTextFile([in] BSTR FileName, [in, defaultvalue(-1)] VARIANT_BOOL Overwrite, + [in, defaultvalue(0)] VARIANT_BOOL Unicode, [out, retval] ITextStream** ppts); } [ @@ -568,7 +559,7 @@ { [id(0x00004e20)] HRESULT GetStandardStream([in] StandardStreamTypes StandardStreamType, - [in, optional, defaultvalue(0)] VARIANT_BOOL Unicode, [out, retval] ITextStream** ppts); + [in, defaultvalue(0)] VARIANT_BOOL Unicode, [out, retval] ITextStream** ppts); [id(0x00004e2a)] HRESULT GetFileVersion([in] BSTR FileName, [out, retval] BSTR* FileVersion); diff -Nru wine1.7-1.7.14/dlls/scrrun/tests/filesystem.c wine1.7-1.7.18/dlls/scrrun/tests/filesystem.c --- wine1.7-1.7.14/dlls/scrrun/tests/filesystem.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/scrrun/tests/filesystem.c 2014-05-02 18:15:48.000000000 +0000 @@ -40,6 +40,8 @@ return IUnknown_Release(iface); } +static const WCHAR crlfW[] = {'\r','\n',0}; + #define GET_REFCOUNT(iface) \ get_refcount((IUnknown*)iface) @@ -127,19 +129,26 @@ static void test_createfolder(void) { + WCHAR pathW[MAX_PATH], buffW[MAX_PATH]; HRESULT hr; - WCHAR pathW[MAX_PATH]; BSTR path; IFolder *folder; + BOOL ret; + + GetTempPathW(MAX_PATH, pathW); + GetTempFileNameW(pathW, NULL, 0, buffW); + DeleteFileW(buffW); + ret = CreateDirectoryW(buffW, NULL); + ok(ret, "got %d, %d\n", ret, GetLastError()); /* create existing directory */ - GetCurrentDirectoryW(sizeof(pathW)/sizeof(WCHAR), pathW); - path = SysAllocString(pathW); + path = SysAllocString(buffW); folder = (void*)0xdeabeef; hr = IFileSystem3_CreateFolder(fs3, path, &folder); ok(hr == CTL_E_FILEALREADYEXISTS, "got 0x%08x\n", hr); ok(folder == NULL, "got %p\n", folder); SysFreeString(path); + RemoveDirectoryW(buffW); } static void test_textstream(void) @@ -147,9 +156,11 @@ static const WCHAR testfileW[] = {'t','e','s','t','f','i','l','e','.','t','x','t',0}; ITextStream *stream; VARIANT_BOOL b; + DWORD written; HANDLE file; HRESULT hr; BSTR name, data; + BOOL ret; file = CreateFileW(testfileW, GENERIC_READ, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); CloseHandle(file); @@ -160,15 +171,46 @@ ok(hr == S_OK, "got 0x%08x, expected 0x%08x\n", hr, S_OK); ok(b == VARIANT_TRUE, "got %x\n", b); + /* different mode combinations */ + hr = IFileSystem3_OpenTextFile(fs3, name, ForWriting | ForAppending, VARIANT_FALSE, TristateFalse, &stream); + ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + + hr = IFileSystem3_OpenTextFile(fs3, name, ForReading | ForAppending, VARIANT_FALSE, TristateFalse, &stream); + ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + + hr = IFileSystem3_OpenTextFile(fs3, name, ForWriting | ForReading, VARIANT_FALSE, TristateFalse, &stream); + ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + + hr = IFileSystem3_OpenTextFile(fs3, name, ForAppending, VARIANT_FALSE, TristateFalse, &stream); + ok(hr == S_OK, "got 0x%08x\n", hr); + hr = ITextStream_Read(stream, 1, &data); + ok(hr == CTL_E_BADFILEMODE, "got 0x%08x\n", hr); + ITextStream_Release(stream); + + hr = IFileSystem3_OpenTextFile(fs3, name, ForWriting, VARIANT_FALSE, TristateFalse, &stream); + ok(hr == S_OK, "got 0x%08x\n", hr); + hr = ITextStream_Read(stream, 1, &data); + ok(hr == CTL_E_BADFILEMODE, "got 0x%08x\n", hr); + ITextStream_Release(stream); + hr = IFileSystem3_OpenTextFile(fs3, name, ForReading, VARIANT_FALSE, TristateFalse, &stream); ok(hr == S_OK, "got 0x%08x\n", hr); + /* try to write when open for reading */ + hr = ITextStream_WriteLine(stream, name); + ok(hr == CTL_E_BADFILEMODE, "got 0x%08x\n", hr); + + hr = ITextStream_Write(stream, name); + ok(hr == CTL_E_BADFILEMODE, "got 0x%08x\n", hr); + + hr = ITextStream_get_AtEndOfStream(stream, NULL); + ok(hr == E_POINTER, "got 0x%08x\n", hr); + b = 10; hr = ITextStream_get_AtEndOfStream(stream, &b); -todo_wine { - ok(hr == S_FALSE || broken(hr == S_OK), "got 0x%08x\n", hr); + ok(hr == S_OK || broken(hr == S_FALSE), "got 0x%08x\n", hr); ok(b == VARIANT_TRUE, "got 0x%x\n", b); -} + ITextStream_Release(stream); hr = IFileSystem3_OpenTextFile(fs3, name, ForWriting, VARIANT_FALSE, TristateFalse, &stream); @@ -176,10 +218,9 @@ b = 10; hr = ITextStream_get_AtEndOfStream(stream, &b); -todo_wine { ok(hr == CTL_E_BADFILEMODE, "got 0x%08x\n", hr); ok(b == VARIANT_TRUE || broken(b == 10), "got 0x%x\n", b); -} + b = 10; hr = ITextStream_get_AtEndOfLine(stream, &b); todo_wine { @@ -199,14 +240,12 @@ hr = IFileSystem3_OpenTextFile(fs3, name, ForAppending, VARIANT_FALSE, TristateFalse, &stream); ok(hr == S_OK, "got 0x%08x\n", hr); - SysFreeString(name); b = 10; hr = ITextStream_get_AtEndOfStream(stream, &b); -todo_wine { ok(hr == CTL_E_BADFILEMODE, "got 0x%08x\n", hr); ok(b == VARIANT_TRUE || broken(b == 10), "got 0x%x\n", b); -} + b = 10; hr = ITextStream_get_AtEndOfLine(stream, &b); todo_wine { @@ -224,6 +263,21 @@ ITextStream_Release(stream); + /* now with non-empty file */ + file = CreateFileW(testfileW, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + ret = WriteFile(file, testfileW, sizeof(testfileW), &written, NULL); + ok(ret && written == sizeof(testfileW), "got %d\n", ret); + CloseHandle(file); + + hr = IFileSystem3_OpenTextFile(fs3, name, ForReading, VARIANT_FALSE, TristateFalse, &stream); + ok(hr == S_OK, "got 0x%08x\n", hr); + b = 10; + hr = ITextStream_get_AtEndOfStream(stream, &b); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(b == VARIANT_FALSE, "got 0x%x\n", b); + ITextStream_Release(stream); + + SysFreeString(name); DeleteFileW(testfileW); } @@ -788,7 +842,7 @@ /* Please keep the tests for IFolderCollection and IFileCollection in sync */ static void test_FolderCollection(void) { - static const WCHAR fooW[] = {'\\','f','o','o',0}; + static const WCHAR fooW[] = {'f','o','o',0}; static const WCHAR aW[] = {'\\','a',0}; static const WCHAR bW[] = {'\\','b',0}; static const WCHAR cW[] = {'\\','c',0}; @@ -817,6 +871,14 @@ hr = IFolder_get_SubFolders(folder, NULL); ok(hr == E_POINTER, "got 0x%08x\n", hr); + hr = IFolder_get_Path(folder, NULL); + ok(hr == E_POINTER, "got 0x%08x\n", hr); + + hr = IFolder_get_Path(folder, &str); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(!lstrcmpW(buffW, str), "got %s, expected %s\n", wine_dbgstr_w(str), wine_dbgstr_w(buffW)); + SysFreeString(str); + lstrcpyW(pathW, buffW); lstrcatW(pathW, aW); CreateDirectoryW(pathW, NULL); @@ -1089,12 +1151,10 @@ ok(0, "unexpected file %s was found\n", wine_dbgstr_w(str)); SysFreeString(str); - /* FIXME: uncomment once Wine is fixed - IFile_Release(file); */ + IFile_Release(file); VariantClear(&var); } -todo_wine ok(found_a == 1 && found_b == 1 && found_c == 1, "each file should be found 1 time instead of %d/%d/%d\n", found_a, found_b, found_c); @@ -1102,15 +1162,12 @@ VariantInit(&var); fetched = -1; hr = IEnumVARIANT_Next(enumvar, 1, &var, &fetched); -todo_wine ok(hr == S_FALSE, "got 0x%08x\n", hr); -todo_wine ok(fetched == 0, "got %d\n", fetched); hr = IEnumVARIANT_Reset(enumvar); ok(hr == S_OK, "got 0x%08x\n", hr); hr = IEnumVARIANT_Skip(enumvar, 2); -todo_wine ok(hr == S_OK, "got 0x%08x\n", hr); hr = IEnumVARIANT_Skip(enumvar, 0); ok(hr == S_OK, "got 0x%08x\n", hr); @@ -1123,9 +1180,7 @@ ok(fetched == 0, "got %d\n", fetched); fetched = -1; hr = IEnumVARIANT_Next(enumvar, 2, var2, &fetched); -todo_wine ok(hr == S_FALSE, "got 0x%08x\n", hr); -todo_wine ok(fetched == 1, "got %d\n", fetched); ok(V_VT(&var2[0]) == VT_DISPATCH, "got type %d\n", V_VT(&var2[0])); VariantClear(&var2[0]); @@ -1142,6 +1197,527 @@ IFileCollection_Release(files); } +static void test_DriveCollection(void) +{ + IDriveCollection *drives; + IEnumVARIANT *enumvar; + ULONG fetched; + VARIANT var; + HRESULT hr; + LONG count; + + hr = IFileSystem3_get_Drives(fs3, &drives); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IDriveCollection_get__NewEnum(drives, (IUnknown**)&enumvar); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IDriveCollection_get_Count(drives, NULL); + ok(hr == E_POINTER, "got 0x%08x\n", hr); + + count = 0; + hr = IDriveCollection_get_Count(drives, &count); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(count > 0, "got %d\n", count); + + V_VT(&var) = VT_EMPTY; + fetched = -1; + hr = IEnumVARIANT_Next(enumvar, 0, &var, &fetched); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(fetched == 0, "got %d\n", fetched); + + hr = IEnumVARIANT_Skip(enumvar, 0); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IEnumVARIANT_Skip(enumvar, count); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IEnumVARIANT_Skip(enumvar, 1); + ok(hr == S_FALSE, "got 0x%08x\n", hr); + + /* reset and iterate again */ + hr = IEnumVARIANT_Reset(enumvar); + ok(hr == S_OK, "got 0x%08x\n", hr); + + while (IEnumVARIANT_Next(enumvar, 1, &var, &fetched) == S_OK) { + IDrive *drive = (IDrive*)V_DISPATCH(&var); + DriveTypeConst type; + BSTR str; + + hr = IDrive_get_DriveType(drive, &type); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = IDrive_get_DriveLetter(drive, NULL); + ok(hr == E_POINTER, "got 0x%08x\n", hr); + + hr = IDrive_get_DriveLetter(drive, &str); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(SysStringLen(str) == 1, "got string %s\n", wine_dbgstr_w(str)); + SysFreeString(str); + + hr = IDrive_get_IsReady(drive, NULL); + ok(hr == E_POINTER, "got 0x%08x\n", hr); + + hr = IDrive_get_TotalSize(drive, NULL); + ok(hr == E_POINTER, "got 0x%08x\n", hr); + + hr = IDrive_get_AvailableSpace(drive, NULL); + ok(hr == E_POINTER, "got 0x%08x\n", hr); + + hr = IDrive_get_FreeSpace(drive, NULL); + ok(hr == E_POINTER, "got 0x%08x\n", hr); + + if (type == Fixed) { + VARIANT_BOOL ready = VARIANT_FALSE; + VARIANT size; + + hr = IDrive_get_IsReady(drive, &ready); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(ready == VARIANT_TRUE, "got %x\n", ready); + + V_VT(&size) = VT_EMPTY; + hr = IDrive_get_TotalSize(drive, &size); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(V_VT(&size) == VT_R8, "got %d\n", V_VT(&size)); + ok(V_R8(&size) > 0, "got %f\n", V_R8(&size)); + + V_VT(&size) = VT_EMPTY; + hr = IDrive_get_AvailableSpace(drive, &size); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(V_VT(&size) == VT_R8, "got %d\n", V_VT(&size)); + ok(V_R8(&size) > 0, "got %f\n", V_R8(&size)); + + V_VT(&size) = VT_EMPTY; + hr = IDrive_get_FreeSpace(drive, &size); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(V_VT(&size) == VT_R8, "got %d\n", V_VT(&size)); + ok(V_R8(&size) > 0, "got %f\n", V_R8(&size)); + } + VariantClear(&var); + } + + IEnumVARIANT_Release(enumvar); + IDriveCollection_Release(drives); +} + +static void test_CreateTextFile(void) +{ + static const WCHAR scrrunW[] = {'s','c','r','r','u','n','\\',0}; + static const WCHAR testfileW[] = {'t','e','s','t','.','t','x','t',0}; + static const WCHAR bomAW[] = {0xff,0xfe,0}; + WCHAR pathW[MAX_PATH], dirW[MAX_PATH]; + ITextStream *stream; + BSTR nameW, str; + HANDLE file; + HRESULT hr; + BOOL ret; + + GetTempPathW(sizeof(pathW)/sizeof(WCHAR), pathW); + lstrcatW(pathW, scrrunW); + lstrcpyW(dirW, pathW); + lstrcatW(pathW, testfileW); + + /* dir doesn't exist */ + nameW = SysAllocString(pathW); + hr = IFileSystem3_CreateTextFile(fs3, nameW, VARIANT_FALSE, VARIANT_FALSE, &stream); + ok(hr == CTL_E_PATHNOTFOUND, "got 0x%08x\n", hr); + + ret = CreateDirectoryW(dirW, NULL); + ok(ret, "got %d, %d\n", ret, GetLastError()); + + hr = IFileSystem3_CreateTextFile(fs3, nameW, VARIANT_FALSE, VARIANT_FALSE, &stream); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = ITextStream_Read(stream, 1, &str); + ok(hr == CTL_E_BADFILEMODE, "got 0x%08x\n", hr); + + ITextStream_Release(stream); + + /* check it's created */ + file = CreateFileW(pathW, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + ok(file != INVALID_HANDLE_VALUE, "got %p\n", file); + CloseHandle(file); + + /* try to create again with no-overwrite mode */ + hr = IFileSystem3_CreateTextFile(fs3, nameW, VARIANT_FALSE, VARIANT_FALSE, &stream); + ok(hr == CTL_E_FILEALREADYEXISTS, "got 0x%08x\n", hr); + + /* now overwrite */ + hr = IFileSystem3_CreateTextFile(fs3, nameW, VARIANT_TRUE, VARIANT_FALSE, &stream); + ok(hr == S_OK, "got 0x%08x\n", hr); + ITextStream_Release(stream); + + /* overwrite in Unicode mode, check for BOM */ + hr = IFileSystem3_CreateTextFile(fs3, nameW, VARIANT_TRUE, VARIANT_TRUE, &stream); + ok(hr == S_OK, "got 0x%08x\n", hr); + ITextStream_Release(stream); + + hr = IFileSystem3_OpenTextFile(fs3, nameW, ForReading, VARIANT_FALSE, TristateFalse, &stream); + ok(hr == S_OK, "got 0x%08x\n", hr); + hr = ITextStream_ReadAll(stream, &str); + ok(hr == S_FALSE || broken(hr == S_OK) /* win2k */, "got 0x%08x\n", hr); + ok(!lstrcmpW(str, bomAW), "got %s\n", wine_dbgstr_w(str)); + SysFreeString(str); + ITextStream_Release(stream); + + DeleteFileW(nameW); + RemoveDirectoryW(dirW); + SysFreeString(nameW); +} + +static void test_WriteLine(void) +{ + static const WCHAR scrrunW[] = {'s','c','r','r','u','n','\\',0}; + static const WCHAR testfileW[] = {'t','e','s','t','.','t','x','t',0}; + WCHAR pathW[MAX_PATH], dirW[MAX_PATH]; + WCHAR buffW[MAX_PATH], buff2W[MAX_PATH]; + char buffA[MAX_PATH]; + ITextStream *stream; + DWORD r, len; + HANDLE file; + BSTR nameW; + HRESULT hr; + BOOL ret; + + GetTempPathW(sizeof(pathW)/sizeof(WCHAR), pathW); + lstrcatW(pathW, scrrunW); + lstrcpyW(dirW, pathW); + lstrcatW(pathW, testfileW); + + ret = CreateDirectoryW(dirW, NULL); + ok(ret, "got %d, %d\n", ret, GetLastError()); + + /* create as ASCII file first */ + nameW = SysAllocString(pathW); + hr = IFileSystem3_CreateTextFile(fs3, nameW, VARIANT_FALSE, VARIANT_FALSE, &stream); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = ITextStream_WriteLine(stream, nameW); + ok(hr == S_OK, "got 0x%08x\n", hr); + ITextStream_Release(stream); + + /* check contents */ + file = CreateFileW(pathW, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + ok(file != INVALID_HANDLE_VALUE, "got %p\n", file); + r = 0; + ret = ReadFile(file, buffA, sizeof(buffA), &r, NULL); + ok(ret && r, "read %d, got %d, %d\n", r, ret, GetLastError()); + + len = MultiByteToWideChar(CP_ACP, 0, buffA, r, buffW, sizeof(buffW)/sizeof(WCHAR)); + buffW[len] = 0; + lstrcpyW(buff2W, nameW); + lstrcatW(buff2W, crlfW); + ok(!lstrcmpW(buff2W, buffW), "got %s, expected %s\n", wine_dbgstr_w(buffW), wine_dbgstr_w(buff2W)); + CloseHandle(file); + DeleteFileW(nameW); + + /* same for unicode file */ + hr = IFileSystem3_CreateTextFile(fs3, nameW, VARIANT_FALSE, VARIANT_TRUE, &stream); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = ITextStream_WriteLine(stream, nameW); + ok(hr == S_OK, "got 0x%08x\n", hr); + ITextStream_Release(stream); + + /* check contents */ + file = CreateFileW(pathW, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + ok(file != INVALID_HANDLE_VALUE, "got %p\n", file); + r = 0; + ret = ReadFile(file, buffW, sizeof(buffW), &r, NULL); + ok(ret && r, "read %d, got %d, %d\n", r, ret, GetLastError()); + buffW[r/sizeof(WCHAR)] = 0; + + buff2W[0] = 0xfeff; + buff2W[1] = 0; + lstrcatW(buff2W, nameW); + lstrcatW(buff2W, crlfW); + ok(!lstrcmpW(buff2W, buffW), "got %s, expected %s\n", wine_dbgstr_w(buffW), wine_dbgstr_w(buff2W)); + CloseHandle(file); + DeleteFileW(nameW); + + RemoveDirectoryW(dirW); + SysFreeString(nameW); +} + +static void test_ReadAll(void) +{ + static const WCHAR scrrunW[] = {'s','c','r','r','u','n','\\',0}; + static const WCHAR testfileW[] = {'t','e','s','t','.','t','x','t',0}; + static const WCHAR secondlineW[] = {'s','e','c','o','n','d',0}; + static const WCHAR aW[] = {'A',0}; + WCHAR pathW[MAX_PATH], dirW[MAX_PATH], buffW[500]; + ITextStream *stream; + BSTR nameW; + HRESULT hr; + BOOL ret; + BSTR str; + + GetTempPathW(sizeof(pathW)/sizeof(WCHAR), pathW); + lstrcatW(pathW, scrrunW); + lstrcpyW(dirW, pathW); + lstrcatW(pathW, testfileW); + + ret = CreateDirectoryW(dirW, NULL); + ok(ret, "got %d, %d\n", ret, GetLastError()); + + /* Unicode file -> read with ascii stream */ + nameW = SysAllocString(pathW); + hr = IFileSystem3_CreateTextFile(fs3, nameW, VARIANT_FALSE, VARIANT_TRUE, &stream); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = ITextStream_WriteLine(stream, nameW); + ok(hr == S_OK, "got 0x%08x\n", hr); + + str = SysAllocString(secondlineW); + hr = ITextStream_WriteLine(stream, str); + ok(hr == S_OK, "got 0x%08x\n", hr); + SysFreeString(str); + + hr = ITextStream_ReadAll(stream, NULL); + ok(hr == E_POINTER, "got 0x%08x\n", hr); + + str = (void*)0xdeadbeef; + hr = ITextStream_ReadAll(stream, &str); + ok(hr == CTL_E_BADFILEMODE, "got 0x%08x\n", hr); + ok(str == NULL || broken(str == (void*)0xdeadbeef) /* win2k */, "got %p\n", str); + + ITextStream_Release(stream); + + hr = IFileSystem3_OpenTextFile(fs3, nameW, ForReading, VARIANT_FALSE, TristateFalse, &stream); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = ITextStream_ReadAll(stream, NULL); + ok(hr == E_POINTER, "got 0x%08x\n", hr); + + /* Buffer content is not interpreted - BOM is kept, all data is converted to WCHARs */ + str = NULL; + hr = ITextStream_ReadAll(stream, &str); + ok(hr == S_FALSE || broken(hr == S_OK) /* win2k */, "got 0x%08x\n", hr); + ok(str[0] == 0x00ff && str[1] == 0x00fe, "got %s, %d\n", wine_dbgstr_w(str), SysStringLen(str)); + SysFreeString(str); + ITextStream_Release(stream); + + /* Unicode file -> read with unicode stream */ + hr = IFileSystem3_OpenTextFile(fs3, nameW, ForReading, VARIANT_FALSE, TristateTrue, &stream); + ok(hr == S_OK, "got 0x%08x\n", hr); + + lstrcpyW(buffW, nameW); + lstrcatW(buffW, crlfW); + lstrcatW(buffW, secondlineW); + lstrcatW(buffW, crlfW); + str = NULL; + hr = ITextStream_ReadAll(stream, &str); + ok(hr == S_FALSE || broken(hr == S_OK) /* win2k */, "got 0x%08x\n", hr); + ok(!lstrcmpW(buffW, str), "got %s\n", wine_dbgstr_w(str)); + SysFreeString(str); + + /* ReadAll one more time */ + str = (void*)0xdeadbeef; + hr = ITextStream_ReadAll(stream, &str); + ok(hr == CTL_E_ENDOFFILE, "got 0x%08x\n", hr); + ok(str == NULL || broken(str == (void*)0xdeadbeef) /* win2k */, "got %p\n", str); + + /* ReadLine fails the same way */ + str = (void*)0xdeadbeef; + hr = ITextStream_ReadLine(stream, &str); + ok(hr == CTL_E_ENDOFFILE, "got 0x%08x\n", hr); + ok(str == NULL || broken(str == (void*)0xdeadbeef) /* win2k */, "got %p\n", str); + ITextStream_Release(stream); + + /* Open again and skip first line before ReadAll */ + hr = IFileSystem3_OpenTextFile(fs3, nameW, ForReading, VARIANT_FALSE, TristateTrue, &stream); + ok(hr == S_OK, "got 0x%08x\n", hr); + + str = NULL; + hr = ITextStream_ReadLine(stream, &str); +todo_wine { + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(str != NULL, "got %p\n", str); +} + SysFreeString(str); + + lstrcpyW(buffW, secondlineW); + lstrcatW(buffW, crlfW); + str = NULL; + hr = ITextStream_ReadAll(stream, &str); + ok(hr == S_FALSE || broken(hr == S_OK) /* win2k */, "got 0x%08x\n", hr); +todo_wine + ok(!lstrcmpW(buffW, str), "got %s\n", wine_dbgstr_w(str)); + SysFreeString(str); + ITextStream_Release(stream); + + /* ASCII file, read with Unicode stream */ + /* 1. one byte content, not enough for Unicode read */ + hr = IFileSystem3_CreateTextFile(fs3, nameW, VARIANT_TRUE, VARIANT_FALSE, &stream); + ok(hr == S_OK, "got 0x%08x\n", hr); + str = SysAllocString(aW); + hr = ITextStream_Write(stream, str); + SysFreeString(str); + ITextStream_Release(stream); + + hr = IFileSystem3_OpenTextFile(fs3, nameW, ForReading, VARIANT_FALSE, TristateTrue, &stream); + ok(hr == S_OK, "got 0x%08x\n", hr); + + str = (void*)0xdeadbeef; + hr = ITextStream_ReadAll(stream, &str); + ok(hr == CTL_E_ENDOFFILE, "got 0x%08x\n", hr); + ok(str == NULL || broken(str == (void*)0xdeadbeef) /* win2k */, "got %p\n", str); + + ITextStream_Release(stream); + + DeleteFileW(nameW); + RemoveDirectoryW(dirW); + SysFreeString(nameW); +} + +static void test_Read(void) +{ + static const WCHAR scrrunW[] = {'s','c','r','r','u','n','\\',0}; + static const WCHAR testfileW[] = {'t','e','s','t','.','t','x','t',0}; + static const WCHAR secondlineW[] = {'s','e','c','o','n','d',0}; + static const WCHAR aW[] = {'A',0}; + WCHAR pathW[MAX_PATH], dirW[MAX_PATH], buffW[500]; + ITextStream *stream; + BSTR nameW; + HRESULT hr; + BOOL ret; + BSTR str; + + GetTempPathW(sizeof(pathW)/sizeof(WCHAR), pathW); + lstrcatW(pathW, scrrunW); + lstrcpyW(dirW, pathW); + lstrcatW(pathW, testfileW); + + ret = CreateDirectoryW(dirW, NULL); + ok(ret, "got %d, %d\n", ret, GetLastError()); + + /* Unicode file -> read with ascii stream */ + nameW = SysAllocString(pathW); + hr = IFileSystem3_CreateTextFile(fs3, nameW, VARIANT_FALSE, VARIANT_TRUE, &stream); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = ITextStream_WriteLine(stream, nameW); + ok(hr == S_OK, "got 0x%08x\n", hr); + + str = SysAllocString(secondlineW); + hr = ITextStream_WriteLine(stream, str); + ok(hr == S_OK, "got 0x%08x\n", hr); + SysFreeString(str); + + hr = ITextStream_Read(stream, 0, NULL); + ok(hr == E_POINTER, "got 0x%08x\n", hr); + + hr = ITextStream_Read(stream, 1, NULL); + ok(hr == E_POINTER, "got 0x%08x\n", hr); + + hr = ITextStream_Read(stream, -1, NULL); + ok(hr == E_POINTER, "got 0x%08x\n", hr); + + str = (void*)0xdeadbeef; + hr = ITextStream_Read(stream, 1, &str); + ok(hr == CTL_E_BADFILEMODE, "got 0x%08x\n", hr); + ok(str == NULL, "got %p\n", str); + + ITextStream_Release(stream); + + hr = IFileSystem3_OpenTextFile(fs3, nameW, ForReading, VARIANT_FALSE, TristateFalse, &stream); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = ITextStream_Read(stream, 1, NULL); + ok(hr == E_POINTER, "got 0x%08x\n", hr); + + str = (void*)0xdeadbeef; + hr = ITextStream_Read(stream, -1, &str); + ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(str == NULL, "got %p\n", str); + + str = (void*)0xdeadbeef; + hr = ITextStream_Read(stream, 0, &str); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(str == NULL, "got %p\n", str); + + /* Buffer content is not interpreted - BOM is kept, all data is converted to WCHARs */ + str = NULL; + hr = ITextStream_Read(stream, 2, &str); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(str[0] == 0x00ff && str[1] == 0x00fe, "got %s, %d\n", wine_dbgstr_w(str), SysStringLen(str)); + ok(SysStringLen(str) == 2, "got %d\n", SysStringLen(str)); + SysFreeString(str); + ITextStream_Release(stream); + + /* Unicode file -> read with unicode stream */ + hr = IFileSystem3_OpenTextFile(fs3, nameW, ForReading, VARIANT_FALSE, TristateTrue, &stream); + ok(hr == S_OK, "got 0x%08x\n", hr); + + lstrcpyW(buffW, nameW); + lstrcatW(buffW, crlfW); + lstrcatW(buffW, secondlineW); + lstrcatW(buffW, crlfW); + str = NULL; + hr = ITextStream_Read(stream, 500, &str); + ok(hr == S_FALSE || broken(hr == S_OK) /* win2k */, "got 0x%08x\n", hr); + ok(!lstrcmpW(buffW, str), "got %s\n", wine_dbgstr_w(str)); + SysFreeString(str); + + /* ReadAll one more time */ + str = (void*)0xdeadbeef; + hr = ITextStream_Read(stream, 10, &str); + ok(hr == CTL_E_ENDOFFILE, "got 0x%08x\n", hr); + ok(str == NULL, "got %p\n", str); + + /* ReadLine fails the same way */ + str = (void*)0xdeadbeef; + hr = ITextStream_ReadLine(stream, &str); + ok(hr == CTL_E_ENDOFFILE, "got 0x%08x\n", hr); + ok(str == NULL || broken(str == (void*)0xdeadbeef), "got %p\n", str); + ITextStream_Release(stream); + + /* Open again and skip first line before ReadAll */ + hr = IFileSystem3_OpenTextFile(fs3, nameW, ForReading, VARIANT_FALSE, TristateTrue, &stream); + ok(hr == S_OK, "got 0x%08x\n", hr); + + str = NULL; + hr = ITextStream_ReadLine(stream, &str); +todo_wine { + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(str != NULL, "got %p\n", str); +} + SysFreeString(str); + + lstrcpyW(buffW, secondlineW); + lstrcatW(buffW, crlfW); + str = NULL; + hr = ITextStream_Read(stream, 100, &str); + ok(hr == S_FALSE || broken(hr == S_OK) /* win2k */, "got 0x%08x\n", hr); +todo_wine + ok(!lstrcmpW(buffW, str), "got %s\n", wine_dbgstr_w(str)); + SysFreeString(str); + ITextStream_Release(stream); + + /* ASCII file, read with Unicode stream */ + /* 1. one byte content, not enough for Unicode read */ + hr = IFileSystem3_CreateTextFile(fs3, nameW, VARIANT_TRUE, VARIANT_FALSE, &stream); + ok(hr == S_OK, "got 0x%08x\n", hr); + str = SysAllocString(aW); + hr = ITextStream_Write(stream, str); + SysFreeString(str); + ITextStream_Release(stream); + + hr = IFileSystem3_OpenTextFile(fs3, nameW, ForReading, VARIANT_FALSE, TristateTrue, &stream); + ok(hr == S_OK, "got 0x%08x\n", hr); + + str = (void*)0xdeadbeef; + hr = ITextStream_Read(stream, 500, &str); + ok(hr == CTL_E_ENDOFFILE, "got 0x%08x\n", hr); + ok(str == NULL, "got %p\n", str); + + ITextStream_Release(stream); + + DeleteFileW(nameW); + RemoveDirectoryW(dirW); + SysFreeString(nameW); +} + START_TEST(filesystem) { HRESULT hr; @@ -1169,6 +1745,11 @@ test_GetFolder(); test_FolderCollection(); test_FileCollection(); + test_DriveCollection(); + test_CreateTextFile(); + test_WriteLine(); + test_ReadAll(); + test_Read(); IFileSystem3_Release(fs3); diff -Nru wine1.7-1.7.14/dlls/scrrun/tests/scrrun.idl wine1.7-1.7.18/dlls/scrrun/tests/scrrun.idl --- wine1.7-1.7.14/dlls/scrrun/tests/scrrun.idl 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/scrrun/tests/scrrun.idl 2014-05-02 18:15:48.000000000 +0000 @@ -24,6 +24,7 @@ cpp_quote("#undef DeleteFile") cpp_quote("#undef MoveFile") cpp_quote("#endif") +cpp_quote("#define CTL_E_ENDOFFILE STD_CTL_SCODE(62)") /* this is not defined in public headers */ [ uuid(420B2830-E718-11CF-893D-00A0C9054228), @@ -33,23 +34,13 @@ { importlib("stdole2.tlb"); - interface IDictionary; - interface IDrive; - interface IDriveCollection; - interface IFile; - interface IFileCollection; - interface IFileSystem; - interface IFileSystem3; interface IFolder; - interface IFolderCollection; - interface IScriptEncoder; - interface ITextStream; typedef enum CompareMethod { - BinaryCompare = 0, - TextCompare = 1, - DatabaseCompare = 2 + BinaryCompare, + TextCompare, + DatabaseCompare } CompareMethod; typedef enum IOMode @@ -61,10 +52,10 @@ typedef enum Tristate { - TristateTrue = 0xffffffff, - TristateFalse = 0, - TristateUseDefault = 0xfffffffe, - TristateMixed = 0xfffffffe + TristateTrue = -1, + TristateFalse = 0, + TristateUseDefault = -2, + TristateMixed = -2 } Tristate; typedef enum FileAttribute @@ -82,26 +73,26 @@ typedef enum SpecialFolderConst { - WindowsFolder = 0, - SystemFolder = 1, - TemporaryFolder = 2 + WindowsFolder, + SystemFolder, + TemporaryFolder } SpecialFolderConst; typedef enum DriveTypeConst { - UnknownType = 0, - Removable = 1, - Fixed = 2, - Remote = 3, - CDRom = 4, - RamDisk = 5 + UnknownType, + Removable, + Fixed, + Remote, + CDRom, + RamDisk } DriveTypeConst; typedef enum StandardStreamTypes { - StdIn = 0, - StdOut = 1, - StdErr = 2 + StdIn, + StdOut, + StdErr } StandardStreamTypes; [ @@ -113,13 +104,13 @@ ] interface IDictionary : IDispatch { - [id(00000000), propputref] + [id(DISPID_VALUE), propputref] HRESULT Item([in] VARIANT* Key, [in] VARIANT* pRetItem); - [id(00000000), propput] + [id(DISPID_VALUE), propput] HRESULT Item([in] VARIANT* Key, [in] VARIANT* pRetItem); - [id(00000000), propget] + [id(DISPID_VALUE), propget] HRESULT Item([in] VARIANT* Key, [out, retval] VARIANT* pRetItem); [id(0x00000001)] @@ -161,94 +152,52 @@ [ odl, - uuid(0AB5A3D0-E5B6-11D0-ABF5-00A0C90FFFC0), + uuid(C7C3F5A0-88A3-11D0-ABCB-00A0C90FFFC0), hidden, dual, nonextensible, oleautomation ] - interface IFileSystem : IDispatch + interface IDrive : IDispatch { - [id(0x0000271a), propget] - HRESULT Drives([out, retval] IDriveCollection** ppdrives); - - [id(0x00002710)] - HRESULT BuildPath([in] BSTR Path, [in] BSTR Name, [out, retval] BSTR* pbstrResult); - - [id(0x00002714)] - HRESULT GetDriveName([in] BSTR Path, [out, retval] BSTR* pbstrResult); - - [id(0x00002715)] - HRESULT GetParentFolderName([in] BSTR Path, [out, retval] BSTR* pbstrResult); - - [id(0x00002716)] - HRESULT GetFileName([in] BSTR Path, [out, retval] BSTR* pbstrResult); - - [id(0x00002717)] - HRESULT GetBaseName([in] BSTR Path, [out, retval] BSTR* pbstrResult); - - [id(0x00002718)] - HRESULT GetExtensionName([in] BSTR Path, [out, retval] BSTR* pbstrResult); - - [id(0x00002712)] - HRESULT GetAbsolutePathName([in] BSTR Path, [out, retval] BSTR* pbstrResult); - - [id(0x00002713)] - HRESULT GetTempName([out, retval] BSTR* pbstrResult); - - [id(0x0000271f)] - HRESULT DriveExists([in] BSTR DriveSpec, [out, retval] VARIANT_BOOL* pfExists); - - [id(0x00002720)] - HRESULT FileExists([in] BSTR FileSpec, [out, retval] VARIANT_BOOL* pfExists); - - [id(0x00002721)] - HRESULT FolderExists([in] BSTR FolderSpec, [out, retval] VARIANT_BOOL* pfExists); - - [id(0x0000271b)] - HRESULT GetDrive([in] BSTR DriveSpec, [out, retval] IDrive** ppdrive); + [id(DISPID_VALUE), propget] + HRESULT Path([out, retval] BSTR* pbstrPath); - [id(0x0000271c)] - HRESULT GetFile([in] BSTR FilePath, [out, retval] IFile** ppfile); + [id(0x00002710), propget] + HRESULT DriveLetter([out, retval] BSTR* pbstrLetter); - [id(0x0000271d)] - HRESULT GetFolder([in] BSTR FolderPath, [out, retval] IFolder** ppfolder); + [id(0x00002711), propget] + HRESULT ShareName([out, retval] BSTR* pbstrShareName); - [id(0x0000271e)] - HRESULT GetSpecialFolder([in] SpecialFolderConst SpecialFolder, [out, retval] IFolder** ppfolder); + [id(0x00002712), propget] + HRESULT DriveType([out, retval] DriveTypeConst* pdt); - [id(0x000004b0)] - HRESULT DeleteFile([in] BSTR FileSpec, [in, optional, defaultvalue(0)] VARIANT_BOOL Force); + [id(0x00002713), propget] + HRESULT RootFolder([out, retval] IFolder** ppfolder); - [id(0x000004b1)] - HRESULT DeleteFolder([in] BSTR FolderSpec, [in, optional, defaultvalue(0)] VARIANT_BOOL Force); + [id(0x00002715), propget] + HRESULT AvailableSpace([out, retval] VARIANT* pvarAvail); - [id(0x000004b4), helpstring("Move a file"), helpcontext(0x00214bab)] - HRESULT MoveFile([in] BSTR Source, [in] BSTR Destination); + [id(0x00002714), propget] + HRESULT FreeSpace([out, retval] VARIANT* pvarFree); - [id(0x000004b5)] - HRESULT MoveFolder([in] BSTR Source, [in] BSTR Destination); + [id(0x00002716), propget] + HRESULT TotalSize([out, retval] VARIANT* pvarTotal); - [id(0x000004b2)] - HRESULT CopyFile([in] BSTR Source, [in] BSTR Destination, - [in, optional, defaultvalue(-1)] VARIANT_BOOL OverWriteFiles); + [id(0x00002717), propget] + HRESULT VolumeName([out, retval] BSTR* pbstrName); - [id(0x000004b3)] - HRESULT CopyFolder([in] BSTR Source, [in] BSTR Destination, - [in, optional, defaultvalue(-1)] VARIANT_BOOL OverWriteFiles); + [id(0x00002717), propput] + HRESULT VolumeName([in] BSTR pbstrName); - [id(0x00000460)] - HRESULT CreateFolder([in] BSTR Path, [out, retval] IFolder** ppfolder); + [id(0x00002718), propget] + HRESULT FileSystem([out, retval] BSTR* pbstrFileSystem); - [id(0x0000044d)] - HRESULT CreateTextFile([in] BSTR FileName, [in, optional, defaultvalue(-1)] VARIANT_BOOL Overwrite, - [in, optional, defaultvalue(0)] VARIANT_BOOL Unicode, [out, retval] ITextStream** ppts); + [id(0x00002719), propget] + HRESULT SerialNumber([out, retval] long* pulSerialNumber); - [id(0x0000044c)] - HRESULT OpenTextFile([in] BSTR FileName, [in, optional, defaultvalue(1)] IOMode IOMode, - [in, optional, defaultvalue(0)] VARIANT_BOOL Create, - [in, optional, defaultvalue(0)] Tristate Format, - [out, retval] ITextStream** ppts); + [id(0x0000271a), propget] + HRESULT IsReady([out, retval] VARIANT_BOOL* pfReady); } [ @@ -260,7 +209,7 @@ oleautomation ] interface IDriveCollection : IDispatch { - [id(00000000)] + [id(DISPID_VALUE), propget] HRESULT Item([in] VARIANT Key, [out, retval] IDrive** ppdrive); [id(DISPID_NEWENUM), propget, restricted, hidden] @@ -272,65 +221,65 @@ [ odl, - uuid(C7C3F5A0-88A3-11D0-ABCB-00A0C90FFFC0), + uuid(53BAD8C1-E718-11CF-893D-00A0C9054228), hidden, dual, nonextensible, oleautomation ] - interface IDrive : IDispatch + interface ITextStream : IDispatch { - [id(00000000), propget] - HRESULT Path([out, retval] BSTR* pbstrPath); - [id(0x00002710), propget] - HRESULT DriveLetter([out, retval] BSTR* pbstrLetter) -; - [id(0x00002711), propget] - HRESULT ShareName([out, retval] BSTR* pbstrShareName); + HRESULT Line([out, retval] long* Line); + + [id(0xfffffdef), propget] + HRESULT Column([out, retval] long* Column); [id(0x00002712), propget] - HRESULT DriveType([out, retval] DriveTypeConst* pdt); + HRESULT AtEndOfStream([out, retval] VARIANT_BOOL* EOS); [id(0x00002713), propget] - HRESULT RootFolder([out, retval] IFolder** ppfolder); + HRESULT AtEndOfLine([out, retval] VARIANT_BOOL* EOL); - [id(0x00002715), propget] - HRESULT AvailableSpace([out, retval] VARIANT* pvarAvail); + [id(0x00002714)] + HRESULT Read([in] long Characters, [out, retval] BSTR* Text); - [id(0x00002714), propget] - HRESULT FreeSpace([out, retval] VARIANT* pvarFree); + [id(0x00002715)] + HRESULT ReadLine([out, retval] BSTR* Text); - [id(0x00002716), propget] - HRESULT TotalSize([out, retval] VARIANT* pvarTotal); + [id(0x00002716)] + HRESULT ReadAll([out, retval] BSTR* Text); - [id(0x00002717), propget] - HRESULT VolumeName([out, retval] BSTR* pbstrName); + [id(0x00002717)] + HRESULT Write([in] BSTR Text); - [id(0x00002717), propput] - HRESULT VolumeName([in] BSTR pbstrName); + [id(0x00002718)] + HRESULT WriteLine([in, defaultvalue("")] BSTR Text); - [id(0x00002718), propget] - HRESULT FileSystem([out, retval] BSTR* pbstrFileSystem); + [id(0x00002719)] + HRESULT WriteBlankLines([in] long Lines); - [id(0x00002719), propget] - HRESULT SerialNumber([out, retval] long* pulSerialNumber); + [id(0x0000271a)] + HRESULT Skip([in] long Characters); - [id(0x0000271a), propget] - HRESULT IsReady([out, retval] VARIANT_BOOL* pfReady); + [id(0x0000271b)] + HRESULT SkipLine(); + + [id(0x0000271c)] + HRESULT Close(); } [ odl, - uuid(C7C3F5A2-88A3-11D0-ABCB-00A0C90FFFC0), + uuid(C7C3F5A4-88A3-11D0-ABCB-00A0C90FFFC0), hidden, dual, nonextensible, oleautomation ] - interface IFolder : IDispatch + interface IFile : IDispatch { - [id(00000000), propget] + [id(DISPID_VALUE), propget] HRESULT Path([out, retval] BSTR* pbstrPath); [id(0x000003e8), propget] @@ -366,50 +315,130 @@ [id(0x000003f0), propget] HRESULT DateLastAccessed([out, retval] DATE* pdate); + [id(0x000003f1), propget] + HRESULT Size([out, retval] VARIANT* pvarSize); + [id(0x000003f2), propget] HRESULT Type([out, retval] BSTR* pbstrType); - [id(0x000004b1)] - HRESULT Delete([in, optional, defaultvalue(0)] VARIANT_BOOL Force); + [id(0x000004b0)] + HRESULT Delete([in, defaultvalue(0)] VARIANT_BOOL Force); - [id(0x000004b3)] - HRESULT Copy([in] BSTR Destination, [in, optional, defaultvalue(-1)] VARIANT_BOOL OverWriteFiles); + [id(0x000004b2)] + HRESULT Copy([in] BSTR Destination, [in, defaultvalue(-1)] VARIANT_BOOL OverWriteFiles); - [id(0x000004b5)] + [id(0x000004b4)] HRESULT Move([in] BSTR Destination); - [id(0x00002710), propget] - HRESULT IsRootFolder([out, retval] VARIANT_BOOL* pfRootFolder); + [id(0x0000044c)] + HRESULT OpenAsTextStream([in, defaultvalue(1)] IOMode IOMode, + [in, defaultvalue(0)] Tristate Format, [out, retval] ITextStream** ppts); + } - [id(0x000003f1), propget] - HRESULT Size([out, retval] VARIANT* pvarSize); + [ + odl, + uuid(0AB5A3D0-E5B6-11D0-ABF5-00A0C90FFFC0), + hidden, + dual, + nonextensible, + oleautomation + ] + interface IFileSystem : IDispatch + { + [id(0x0000271a), propget] + HRESULT Drives([out, retval] IDriveCollection** ppdrives); - [id(0x00002711), propget] - HRESULT SubFolders([out, retval] IFolderCollection** ppfolders); + [id(0x00002710)] + HRESULT BuildPath([in] BSTR Path, [in] BSTR Name, [out, retval] BSTR* pbstrResult); - [id(0x00002712), propget] - HRESULT Files([out, retval] IFileCollection** ppfiles); + [id(0x00002714)] + HRESULT GetDriveName([in] BSTR Path, [out, retval] BSTR* pbstrResult); + + [id(0x00002715)] + HRESULT GetParentFolderName([in] BSTR Path, [out, retval] BSTR* pbstrResult); + + [id(0x00002716)] + HRESULT GetFileName([in] BSTR Path, [out, retval] BSTR* pbstrResult); + + [id(0x00002717)] + HRESULT GetBaseName([in] BSTR Path, [out, retval] BSTR* pbstrResult); + + [id(0x00002718)] + HRESULT GetExtensionName([in] BSTR Path, [out, retval] BSTR* pbstrResult); + + [id(0x00002712)] + HRESULT GetAbsolutePathName([in] BSTR Path, [out, retval] BSTR* pbstrResult); + + [id(0x00002713)] + HRESULT GetTempName([out, retval] BSTR* pbstrResult); + + [id(0x0000271f)] + HRESULT DriveExists([in] BSTR DriveSpec, [out, retval] VARIANT_BOOL* pfExists); + + [id(0x00002720)] + HRESULT FileExists([in] BSTR FileSpec, [out, retval] VARIANT_BOOL* pfExists); + + [id(0x00002721)] + HRESULT FolderExists([in] BSTR FolderSpec, [out, retval] VARIANT_BOOL* pfExists); + + [id(0x0000271b)] + HRESULT GetDrive([in] BSTR DriveSpec, [out, retval] IDrive** ppdrive); + + [id(0x0000271c)] + HRESULT GetFile([in] BSTR FilePath, [out, retval] IFile** ppfile); + + [id(0x0000271d)] + HRESULT GetFolder([in] BSTR FolderPath, [out, retval] IFolder** ppfolder); + + [id(0x0000271e)] + HRESULT GetSpecialFolder([in] SpecialFolderConst SpecialFolder, [out, retval] IFolder** ppfolder); + + [id(0x000004b0)] + HRESULT DeleteFile([in] BSTR FileSpec, [in, defaultvalue(0)] VARIANT_BOOL Force); + + [id(0x000004b1)] + HRESULT DeleteFolder([in] BSTR FolderSpec, [in, defaultvalue(0)] VARIANT_BOOL Force); + + [id(0x000004b4), helpstring("Move a file"), helpcontext(0x00214bab)] + HRESULT MoveFile([in] BSTR Source, [in] BSTR Destination); + + [id(0x000004b5)] + HRESULT MoveFolder([in] BSTR Source, [in] BSTR Destination); + + [id(0x000004b2)] + HRESULT CopyFile([in] BSTR Source, [in] BSTR Destination, + [in, defaultvalue(-1)] VARIANT_BOOL OverWriteFiles); + + [id(0x000004b3)] + HRESULT CopyFolder([in] BSTR Source, [in] BSTR Destination, + [in, defaultvalue(-1)] VARIANT_BOOL OverWriteFiles); + + [id(0x00000460)] + HRESULT CreateFolder([in] BSTR Path, [out, retval] IFolder** ppfolder); [id(0x0000044d)] - HRESULT CreateTextFile([in] BSTR FileName, [in, optional, defaultvalue(-1)] VARIANT_BOOL Overwrite, - [in, optional, defaultvalue(0)] VARIANT_BOOL Unicode, [out, retval] ITextStream** ppts); + HRESULT CreateTextFile([in] BSTR FileName, [in, defaultvalue(-1)] VARIANT_BOOL Overwrite, + [in, defaultvalue(0)] VARIANT_BOOL Unicode, [out, retval] ITextStream** ppts); + + [id(0x0000044c)] + HRESULT OpenTextFile([in] BSTR FileName, [in, defaultvalue(1)] IOMode IOMode, + [in, defaultvalue(0)] VARIANT_BOOL Create, + [in, defaultvalue(0)] Tristate Format, + [out, retval] ITextStream** ppts); } [ odl, - uuid(C7C3F5A3-88A3-11D0-ABCB-00A0C90FFFC0), + uuid(C7C3F5A5-88A3-11D0-ABCB-00A0C90FFFC0), hidden, dual, nonextensible, oleautomation ] - interface IFolderCollection : IDispatch + interface IFileCollection : IDispatch { - [id(0x00000002)] - HRESULT Add([in] BSTR Name, [out, retval] IFolder** ppfolder); - - [id(00000000), propget] - HRESULT Item([in] VARIANT Key, [out, retval] IFolder** ppfolder); + [id(DISPID_VALUE), propget] + HRESULT Item([in] VARIANT Key, [out, retval] IFile** ppfile); [id(DISPID_NEWENUM), propget, restricted, hidden] HRESULT _NewEnum([out, retval] IUnknown** ppenum); @@ -420,16 +449,19 @@ [ odl, - uuid(C7C3F5A5-88A3-11D0-ABCB-00A0C90FFFC0), + uuid(C7C3F5A3-88A3-11D0-ABCB-00A0C90FFFC0), hidden, dual, nonextensible, oleautomation ] - interface IFileCollection : IDispatch + interface IFolderCollection : IDispatch { - [id(00000000), propget] - HRESULT Item([in] VARIANT Key, [out, retval] IFile** ppfile); + [id(0x00000002)] + HRESULT Add([in] BSTR Name, [out, retval] IFolder** ppfolder); + + [id(DISPID_VALUE), propget] + HRESULT Item([in] VARIANT Key, [out, retval] IFolder** ppfolder); [id(DISPID_NEWENUM), propget, restricted, hidden] HRESULT _NewEnum([out, retval] IUnknown** ppenum); @@ -440,15 +472,15 @@ [ odl, - uuid(C7C3F5A4-88A3-11D0-ABCB-00A0C90FFFC0), + uuid(C7C3F5A2-88A3-11D0-ABCB-00A0C90FFFC0), hidden, dual, nonextensible, oleautomation ] - interface IFile : IDispatch + interface IFolder : IDispatch { - [id(00000000), propget] + [id(DISPID_VALUE), propget] HRESULT Path([out, retval] BSTR* pbstrPath); [id(0x000003e8), propget] @@ -484,74 +516,33 @@ [id(0x000003f0), propget] HRESULT DateLastAccessed([out, retval] DATE* pdate); - [id(0x000003f1), propget] - HRESULT Size([out, retval] VARIANT* pvarSize); - [id(0x000003f2), propget] HRESULT Type([out, retval] BSTR* pbstrType); - [id(0x000004b0)] - HRESULT Delete([in, optional, defaultvalue(0)] VARIANT_BOOL Force); + [id(0x000004b1)] + HRESULT Delete([in, defaultvalue(0)] VARIANT_BOOL Force); - [id(0x000004b2)] - HRESULT Copy([in] BSTR Destination, [in, optional, defaultvalue(-1)] VARIANT_BOOL OverWriteFiles); + [id(0x000004b3)] + HRESULT Copy([in] BSTR Destination, [in, defaultvalue(-1)] VARIANT_BOOL OverWriteFiles); - [id(0x000004b4)] + [id(0x000004b5)] HRESULT Move([in] BSTR Destination); - [id(0x0000044c)] - HRESULT OpenAsTextStream([in, optional, defaultvalue(1)] IOMode IOMode, - [in, optional, defaultvalue(0)] Tristate Format, [out, retval] ITextStream** ppts); - } - - [ - odl, - uuid(53BAD8C1-E718-11CF-893D-00A0C9054228), - hidden, - dual, - nonextensible, - oleautomation - ] - interface ITextStream : IDispatch - { [id(0x00002710), propget] - HRESULT Line([out, retval] long* Line); - - [id(0xfffffdef), propget] - HRESULT Column([out, retval] long* Column); - - [id(0x00002712), propget] - HRESULT AtEndOfStream([out, retval] VARIANT_BOOL* EOS); - - [id(0x00002713), propget] - HRESULT AtEndOfLine([out, retval] VARIANT_BOOL* EOL); - - [id(0x00002714)] - HRESULT Read([in] long Characters, [out, retval] BSTR* Text); - - [id(0x00002715)] - HRESULT ReadLine([out, retval] BSTR* Text); - - [id(0x00002716)] - HRESULT ReadAll([out, retval] BSTR* Text); - - [id(0x00002717)] - HRESULT Write([in] BSTR Text); - - [id(0x00002718)] - HRESULT WriteLine([in, optional, defaultvalue("")] BSTR Text); + HRESULT IsRootFolder([out, retval] VARIANT_BOOL* pfRootFolder); - [id(0x00002719)] - HRESULT WriteBlankLines([in] long Lines); + [id(0x000003f1), propget] + HRESULT Size([out, retval] VARIANT* pvarSize); - [id(0x0000271a)] - HRESULT Skip([in] long Characters); + [id(0x00002711), propget] + HRESULT SubFolders([out, retval] IFolderCollection** ppfolders); - [id(0x0000271b)] - HRESULT SkipLine(); + [id(0x00002712), propget] + HRESULT Files([out, retval] IFileCollection** ppfiles); - [id(0x0000271c)] - HRESULT Close(); + [id(0x0000044d)] + HRESULT CreateTextFile([in] BSTR FileName, [in, defaultvalue(-1)] VARIANT_BOOL Overwrite, + [in, defaultvalue(0)] VARIANT_BOOL Unicode, [out, retval] ITextStream** ppts); } [ @@ -565,7 +556,7 @@ { [id(0x00004e20)] HRESULT GetStandardStream([in] StandardStreamTypes StandardStreamType, - [in, optional, defaultvalue(0)] VARIANT_BOOL Unicode, [out, retval] ITextStream** ppts); + [in, defaultvalue(0)] VARIANT_BOOL Unicode, [out, retval] ITextStream** ppts); [id(0x00004e2a)] HRESULT GetFileVersion([in] BSTR FileName, [out, retval] BSTR* FileVersion); @@ -579,7 +570,7 @@ ] interface IScriptEncoder : IDispatch { - [id(00000000)] + [id(DISPID_VALUE)] HRESULT EncodeScriptFile([in] BSTR szExt, [in] BSTR bstrStreamIn, [in] long cFlags, [in] BSTR bstrDefaultLang, [out, retval] BSTR* pbstrStreamOut); } diff -Nru wine1.7-1.7.14/dlls/secur32/ntlm.c wine1.7-1.7.18/dlls/secur32/ntlm.c --- wine1.7-1.7.14/dlls/secur32/ntlm.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/secur32/ntlm.c 2014-05-02 18:15:48.000000000 +0000 @@ -1226,11 +1226,13 @@ } else { - size_t ntlm_pipe_err_len = strlen("BH NT_STATUS_ACCESS_DENIED"); + size_t ntlm_pipe_err_v3_len = strlen("BH NT_STATUS_ACCESS_DENIED"); + size_t ntlm_pipe_err_v4_len = strlen("BH NT_STATUS_UNSUCCESSFUL"); - if( (buffer_len >= ntlm_pipe_err_len) && - (strncmp(buffer, "BH NT_STATUS_ACCESS_DENIED", - ntlm_pipe_err_len) == 0)) + if( (buffer_len >= ntlm_pipe_err_v3_len && + strncmp(buffer, "BH NT_STATUS_ACCESS_DENIED", ntlm_pipe_err_v3_len) == 0) || + (buffer_len >= ntlm_pipe_err_v4_len && + strncmp(buffer, "BH NT_STATUS_UNSUCCESSFUL", ntlm_pipe_err_v4_len) == 0) ) { TRACE("Connection to winbindd failed\n"); ret = SEC_E_LOGON_DENIED; diff -Nru wine1.7-1.7.14/dlls/secur32/tests/schannel.c wine1.7-1.7.18/dlls/secur32/tests/schannel.c --- wine1.7-1.7.14/dlls/secur32/tests/schannel.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/secur32/tests/schannel.c 2014-05-02 18:15:48.000000000 +0000 @@ -809,7 +809,8 @@ status = pQueryContextAttributesA(&context, SECPKG_ATTR_CONNECTION_INFO, (void*)&conn_info); ok(status == SEC_E_OK, "QueryContextAttributesW(SECPKG_ATTR_CONNECTION_INFO) failed: %08x\n", status); if(status == SEC_E_OK) { - ok(conn_info.dwCipherStrength == 128, "conn_info.dwCipherStrength = %d\n", conn_info.dwCipherStrength); + ok(conn_info.dwCipherStrength == 128 || conn_info.dwCipherStrength == 168, + "conn_info.dwCipherStrength = %d\n", conn_info.dwCipherStrength); ok(conn_info.dwHashStrength >= 128, "conn_info.dwHashStrength = %d\n", conn_info.dwHashStrength); } diff -Nru wine1.7-1.7.14/dlls/setupapi/devinst.c wine1.7-1.7.18/dlls/setupapi/devinst.c --- wine1.7-1.7.14/dlls/setupapi/devinst.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/setupapi/devinst.c 2014-05-02 18:15:48.000000000 +0000 @@ -2795,8 +2795,11 @@ SetLastError(ERROR_INVALID_PARAMETER); return FALSE; } + /* In case application fails to check return value, clear output */ memset(DeviceInterfaceData, 0, sizeof(*DeviceInterfaceData)); + DeviceInterfaceData->cbSize = sizeof(SP_DEVICE_INTERFACE_DATA); + if (DeviceInfoData) { struct DeviceInfo *devInfo = diff -Nru wine1.7-1.7.14/dlls/setupapi/fakedll.c wine1.7-1.7.18/dlls/setupapi/fakedll.c --- wine1.7-1.7.14/dlls/setupapi/fakedll.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/setupapi/fakedll.c 2014-05-02 18:15:48.000000000 +0000 @@ -275,8 +275,14 @@ nt = info.nt = (IMAGE_NT_HEADERS *)(buffer + lfanew); /* some fields are copied from the source dll */ -#ifdef _WIN64 +#if defined __x86_64__ nt->FileHeader.Machine = IMAGE_FILE_MACHINE_AMD64; +#elif defined __aarch64__ + nt->FileHeader.Machine = IMAGE_FILE_MACHINE_ARM64; +#elif defined __arm__ + nt->FileHeader.Machine = IMAGE_FILE_MACHINE_ARMNT; +#elif defined __powerpc__ + nt->FileHeader.Machine = IMAGE_FILE_MACHINE_POWERPC; #else nt->FileHeader.Machine = IMAGE_FILE_MACHINE_I386; #endif diff -Nru wine1.7-1.7.14/dlls/setupapi/misc.c wine1.7-1.7.18/dlls/setupapi/misc.c --- wine1.7-1.7.14/dlls/setupapi/misc.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/setupapi/misc.c 2014-05-02 18:15:48.000000000 +0000 @@ -1412,7 +1412,8 @@ return ERROR_INVALID_PARAMETER; ret = SetupGetFileCompressionInfoExW( source, NULL, 0, &required, NULL, NULL, NULL ); - if (!(actual_name = MyMalloc( required ))) return ERROR_NOT_ENOUGH_MEMORY; + if (!(actual_name = MyMalloc( required * sizeof(WCHAR) ))) + return ERROR_NOT_ENOUGH_MEMORY; ret = SetupGetFileCompressionInfoExW( source, actual_name, required, &required, source_size, target_size, type ); diff -Nru wine1.7-1.7.14/dlls/shell32/control.c wine1.7-1.7.18/dlls/shell32/control.c --- wine1.7-1.7.14/dlls/shell32/control.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/shell32/control.c 2014-05-02 18:15:48.000000000 +0000 @@ -62,6 +62,7 @@ CPlApplet* Control_LoadApplet(HWND hWnd, LPCWSTR cmd, CPanel* panel) { CPlApplet* applet; + DWORD len; unsigned i; CPLINFO info; NEWCPLINFOW newinfo; @@ -69,21 +70,30 @@ if (!(applet = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*applet)))) return applet; - if (!(applet->cmd = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(cmd)+1) * sizeof(WCHAR)))) { - WARN("Cannot allocate memory for applet path\n"); + len = ExpandEnvironmentStringsW(cmd, NULL, 0); + if (len > 0) + { + if (!(applet->cmd = HeapAlloc(GetProcessHeap(), 0, (len+1) * sizeof(WCHAR)))) + { + WARN("Cannot allocate memory for applet path\n"); + goto theError; + } + ExpandEnvironmentStringsW(cmd, applet->cmd, len+1); + } + else + { + WARN("Cannot expand applet path\n"); goto theError; } - lstrcpyW(applet->cmd, cmd); - applet->hWnd = hWnd; - if (!(applet->hModule = LoadLibraryW(cmd))) { - WARN("Cannot load control panel applet %s\n", debugstr_w(cmd)); + if (!(applet->hModule = LoadLibraryW(applet->cmd))) { + WARN("Cannot load control panel applet %s\n", debugstr_w(applet->cmd)); goto theError; } if (!(applet->proc = (APPLET_PROC)GetProcAddress(applet->hModule, "CPlApplet"))) { - WARN("Not a valid control panel applet %s\n", debugstr_w(cmd)); + WARN("Not a valid control panel applet %s\n", debugstr_w(applet->cmd)); goto theError; } if (!applet->proc(hWnd, CPL_INIT, 0L, 0L)) { diff -Nru wine1.7-1.7.14/dlls/shell32/shell32.spec wine1.7-1.7.18/dlls/shell32/shell32.spec --- wine1.7-1.7.14/dlls/shell32/shell32.spec 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/shell32/shell32.spec 2014-05-02 18:15:48.000000000 +0000 @@ -347,7 +347,7 @@ @ stdcall SHCreateShellItemArrayFromShellItem(ptr ptr ptr) @ stdcall SHEmptyRecycleBinA(long str long) @ stdcall SHEmptyRecycleBinW(long wstr long) -@ stub SHExtractIconsW +@ stdcall SHExtractIconsW(wstr long long long ptr ptr long long) user32.PrivateExtractIconsW @ stdcall SHFileOperation(ptr) SHFileOperationA @ stdcall SHFileOperationA(ptr) @ stdcall SHFileOperationW(ptr) diff -Nru wine1.7-1.7.14/dlls/shell32/shelllink.c wine1.7-1.7.18/dlls/shell32/shelllink.c --- wine1.7-1.7.14/dlls/shell32/shelllink.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/shell32/shelllink.c 2014-05-02 18:15:48.000000000 +0000 @@ -2500,7 +2500,7 @@ memset( &sei, 0, sizeof sei ); sei.cbSize = sizeof sei; - sei.fMask = SEE_MASK_UNICODE | (lpici->fMask & (SEE_MASK_NOASYNC|SEE_MASK_ASYNCOK|SEE_MASK_FLAG_NO_UI)); + sei.fMask = SEE_MASK_UNICODE | (lpici->fMask & (SEE_MASK_NOASYNC|SEE_MASK_NO_CONSOLE|SEE_MASK_ASYNCOK|SEE_MASK_FLAG_NO_UI)); sei.lpFile = path; sei.nShow = This->iShowCmd; sei.lpIDList = This->pPidl; diff -Nru wine1.7-1.7.14/dlls/shell32/shellpath.c wine1.7-1.7.18/dlls/shell32/shellpath.c --- wine1.7-1.7.14/dlls/shell32/shellpath.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/shell32/shellpath.c 2014-05-02 18:15:48.000000000 +0000 @@ -2265,8 +2265,8 @@ if (FAILED(hr)) goto end; if(pszSubPath) { - /* make sure the new path does not exceed th bufferlength - * rememebr to backslash and the termination */ + /* make sure the new path does not exceed the buffer length + * and remember to backslash and terminate it */ if(MAX_PATH < (lstrlenW(szBuildPath) + lstrlenW(pszSubPath) + 2)) { hr = HRESULT_FROM_WIN32(ERROR_FILENAME_EXCED_RANGE); goto end; @@ -2441,7 +2441,8 @@ CSIDL_COOKIES, CSIDL_HISTORY, CSIDL_MYPICTURES, - CSIDL_FONTS + CSIDL_FONTS, + CSIDL_ADMINTOOLS }; WCHAR userShellFolderPath[MAX_PATH], shellFolderPath[MAX_PATH]; LPCWSTR pUserShellFolderPath, pShellFolderPath; diff -Nru wine1.7-1.7.14/dlls/shell32/shellstring.c wine1.7-1.7.18/dlls/shell32/shellstring.c --- wine1.7-1.7.14/dlls/shell32/shellstring.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/shell32/shellstring.c 2014-05-02 18:15:48.000000000 +0000 @@ -183,7 +183,7 @@ if (lstrcpynW (lpWide, lpStrW, nWide)) { return lstrlenW (lpWide); } - return 0; + return FALSE; } BOOL WINAPI StrToOleStrNAW (LPWSTR lpWide, INT nWide, LPCVOID lpStr, INT nStr) diff -Nru wine1.7-1.7.14/dlls/shell32/shfldr_unixfs.c wine1.7-1.7.18/dlls/shell32/shfldr_unixfs.c --- wine1.7-1.7.14/dlls/shell32/shfldr_unixfs.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/shell32/shfldr_unixfs.c 2014-05-02 18:15:48.000000000 +0000 @@ -170,9 +170,6 @@ #if !defined(__MINGW32__) && !defined(_MSC_VER) -#define ADJUST_THIS(c,m,p) ((c*)(((long)p)-(long)&(((c*)0)->lp##m##Vtbl))) -#define STATIC_CAST(i,p) ((i*)&p->lp##i##Vtbl) - #define LEN_SHITEMID_FIXED_PART ((USHORT) \ ( sizeof(USHORT) /* SHITEMID's cb field. */ \ + sizeof(PIDLTYPE) /* PIDLDATA's type field. */ \ @@ -971,14 +968,12 @@ return result; } -static IUnknown *UnixSubFolderIterator_Constructor(UnixFolder *pUnixFolder, SHCONTF fFilter); +static IEnumIDList *UnixSubFolderIterator_Constructor(UnixFolder *pUnixFolder, SHCONTF fFilter); static HRESULT WINAPI ShellFolder2_EnumObjects(IShellFolder2* iface, HWND hwndOwner, SHCONTF grfFlags, IEnumIDList** ppEnumIDList) { UnixFolder *This = impl_from_IShellFolder2(iface); - IUnknown *newIterator; - HRESULT hr; TRACE("(%p)->(%p 0x%08x %p)\n", This, hwndOwner, grfFlags, ppEnumIDList); @@ -987,11 +982,8 @@ return E_UNEXPECTED; } - newIterator = UnixSubFolderIterator_Constructor(This, grfFlags); - hr = IUnknown_QueryInterface(newIterator, &IID_IEnumIDList, (void**)ppEnumIDList); - IUnknown_Release(newIterator); - - return hr; + *ppEnumIDList = UnixSubFolderIterator_Constructor(This, grfFlags); + return S_OK; } static HRESULT CreateUnixFolder(IUnknown *pUnkOuter, REFIID riid, LPVOID *ppv, const CLSID *pCLSID); @@ -2373,13 +2365,18 @@ /* UnixSubFolderIterator object layout and typedef. */ typedef struct _UnixSubFolderIterator { - const IEnumIDListVtbl *lpIEnumIDListVtbl; - LONG m_cRef; + IEnumIDList IEnumIDList_iface; + LONG ref; SHCONTF m_fFilter; DIR *m_dirFolder; char m_szFolder[FILENAME_MAX]; } UnixSubFolderIterator; +static inline UnixSubFolderIterator *impl_from_IEnumIDList(IEnumIDList *iface) +{ + return CONTAINING_RECORD(iface, UnixSubFolderIterator, IEnumIDList_iface); +} + static void UnixSubFolderIterator_Destroy(UnixSubFolderIterator *iterator) { TRACE("(iterator=%p)\n", iterator); @@ -2405,35 +2402,34 @@ IEnumIDList_AddRef(iface); return S_OK; } - + static ULONG WINAPI UnixSubFolderIterator_IEnumIDList_AddRef(IEnumIDList* iface) { - UnixSubFolderIterator *This = ADJUST_THIS(UnixSubFolderIterator, IEnumIDList, iface); + UnixSubFolderIterator *This = impl_from_IEnumIDList(iface); + ULONG ref = InterlockedIncrement(&This->ref); - TRACE("(iface=%p)\n", iface); - - return InterlockedIncrement(&This->m_cRef); + TRACE("(%p) ref=%d\n", This, ref); + + return ref; } static ULONG WINAPI UnixSubFolderIterator_IEnumIDList_Release(IEnumIDList* iface) { - UnixSubFolderIterator *This = ADJUST_THIS(UnixSubFolderIterator, IEnumIDList, iface); - ULONG cRef; - - TRACE("(iface=%p)\n", iface); + UnixSubFolderIterator *This = impl_from_IEnumIDList(iface); + ULONG ref = InterlockedDecrement(&This->ref); - cRef = InterlockedDecrement(&This->m_cRef); - - if (!cRef) + TRACE("(%p) ref=%d\n", This, ref); + + if (!ref) UnixSubFolderIterator_Destroy(This); - return cRef; + return ref; } static HRESULT WINAPI UnixSubFolderIterator_IEnumIDList_Next(IEnumIDList* iface, ULONG celt, LPITEMIDLIST* rgelt, ULONG* pceltFetched) { - UnixSubFolderIterator *This = ADJUST_THIS(UnixSubFolderIterator, IEnumIDList, iface); + UnixSubFolderIterator *This = impl_from_IEnumIDList(iface); ULONG i = 0; /* This->m_dirFolder will be NULL if the user doesn't have access rights for the dir. */ @@ -2492,8 +2488,8 @@ static HRESULT WINAPI UnixSubFolderIterator_IEnumIDList_Reset(IEnumIDList* iface) { - UnixSubFolderIterator *This = ADJUST_THIS(UnixSubFolderIterator, IEnumIDList, iface); - + UnixSubFolderIterator *This = impl_from_IEnumIDList(iface); + TRACE("(iface=%p)\n", iface); if (This->m_dirFolder) @@ -2521,21 +2517,20 @@ UnixSubFolderIterator_IEnumIDList_Clone }; -static IUnknown *UnixSubFolderIterator_Constructor(UnixFolder *pUnixFolder, SHCONTF fFilter) { +static IEnumIDList *UnixSubFolderIterator_Constructor(UnixFolder *pUnixFolder, SHCONTF fFilter) +{ UnixSubFolderIterator *iterator; TRACE("(pUnixFolder=%p)\n", pUnixFolder); - - iterator = SHAlloc((ULONG)sizeof(UnixSubFolderIterator)); - iterator->lpIEnumIDListVtbl = &UnixSubFolderIterator_IEnumIDList_Vtbl; - iterator->m_cRef = 0; + + iterator = SHAlloc(sizeof(*iterator)); + iterator->IEnumIDList_iface.lpVtbl = &UnixSubFolderIterator_IEnumIDList_Vtbl; + iterator->ref = 1; iterator->m_fFilter = fFilter; iterator->m_dirFolder = opendir(pUnixFolder->m_pszPath); lstrcpyA(iterator->m_szFolder, pUnixFolder->m_pszPath); - UnixSubFolderIterator_IEnumIDList_AddRef((IEnumIDList*)iterator); - - return (IUnknown*)iterator; + return &iterator->IEnumIDList_iface; } #else /* __MINGW32__ || _MSC_VER */ diff -Nru wine1.7-1.7.14/dlls/shell32/shlexec.c wine1.7-1.7.18/dlls/shell32/shlexec.c --- wine1.7-1.7.14/dlls/shell32/shlexec.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/shell32/shlexec.c 2014-05-02 18:15:48.000000000 +0000 @@ -338,7 +338,7 @@ startup.dwFlags = STARTF_USESHOWWINDOW; startup.wShowWindow = psei->nShow; dwCreationFlags = CREATE_UNICODE_ENVIRONMENT; - if (psei->fMask & SEE_MASK_NO_CONSOLE) + if (!(psei->fMask & SEE_MASK_NO_CONSOLE)) dwCreationFlags |= CREATE_NEW_CONSOLE; if (CreateProcessW(NULL, (LPWSTR)lpCmd, NULL, NULL, FALSE, dwCreationFlags, env, lpDirectory, &startup, &info)) @@ -1248,7 +1248,7 @@ memset( &ici, 0, sizeof ici ); ici.cbSize = sizeof ici; - ici.fMask = CMIC_MASK_UNICODE | (sei->fMask & (SEE_MASK_NOASYNC|SEE_MASK_ASYNCOK|SEE_MASK_FLAG_NO_UI)); + ici.fMask = CMIC_MASK_UNICODE | (sei->fMask & (SEE_MASK_NO_CONSOLE|SEE_MASK_NOASYNC|SEE_MASK_ASYNCOK|SEE_MASK_FLAG_NO_UI)); ici.nShow = sei->nShow; ici.lpVerb = MAKEINTRESOURCEA( def ); ici.hwnd = sei->hwnd; diff -Nru wine1.7-1.7.14/dlls/shell32/shlfolder.c wine1.7-1.7.18/dlls/shell32/shlfolder.c --- wine1.7-1.7.14/dlls/shell32/shlfolder.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/shell32/shlfolder.c 2014-05-02 18:15:48.000000000 +0000 @@ -531,11 +531,11 @@ isEmpty2 = _ILIsDesktop (nextpidl2); if (isEmpty1 && isEmpty2) { - return MAKE_HRESULT( SEVERITY_SUCCESS, 0, 0 ); + nReturn = MAKE_HRESULT( SEVERITY_SUCCESS, 0, 0 ); } else if (isEmpty1) { - return MAKE_HRESULT( SEVERITY_SUCCESS, 0, (WORD)-1 ); + nReturn = MAKE_HRESULT( SEVERITY_SUCCESS, 0, (WORD)-1 ); } else if (isEmpty2) { - return MAKE_HRESULT( SEVERITY_SUCCESS, 0, 1 ); + nReturn = MAKE_HRESULT( SEVERITY_SUCCESS, 0, 1 ); /* optimizing end */ } else if (SUCCEEDED(IShellFolder2_BindToObject(sf, firstpidl, NULL, &IID_IShellFolder, (void **)&psf))) { nReturn = IShellFolder_CompareIDs (psf, lParam, nextpidl1, nextpidl2); diff -Nru wine1.7-1.7.14/dlls/shell32/shlview_cmenu.c wine1.7-1.7.18/dlls/shell32/shlview_cmenu.c --- wine1.7-1.7.14/dlls/shell32/shlview_cmenu.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/shell32/shlview_cmenu.c 2014-05-02 18:15:48.000000000 +0000 @@ -285,9 +285,10 @@ return TRUE; } +#define MAX_PROP_PAGES 99 + static void DoOpenProperties(ContextMenu *This, HWND hwnd) { - static const UINT MAX_PROP_PAGES = 99; static const WCHAR wszFolder[] = {'F','o','l','d','e','r', 0}; static const WCHAR wszFiletypeAll[] = {'*',0}; LPSHELLFOLDER lpDesktopSF; diff -Nru wine1.7-1.7.14/dlls/shell32/tests/shelllink.c wine1.7-1.7.18/dlls/shell32/tests/shelllink.c --- wine1.7-1.7.14/dlls/shell32/tests/shelllink.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/shell32/tests/shelllink.c 2014-05-02 18:15:48.000000000 +0000 @@ -42,6 +42,7 @@ static HRESULT (WINAPI *pSHGetStockIconInfo)(SHSTOCKICONID, UINT, SHSTOCKICONINFO *); static DWORD (WINAPI *pGetLongPathNameA)(LPCSTR, LPSTR, DWORD); static DWORD (WINAPI *pGetShortPathNameA)(LPCSTR, LPSTR, DWORD); +static UINT (WINAPI *pSHExtractIconsW)(LPCWSTR, int, int, int, HICON *, UINT *, UINT, UINT); static const GUID _IID_IShellLinkDataList = { 0x45e2b4ae, 0xb1c3, 0x11d0, @@ -1095,6 +1096,63 @@ ok(hr == E_INVALIDARG, "NULL: got 0x%x\n", hr); } +static void test_SHExtractIcons(void) +{ + static const WCHAR notepadW[] = {'n','o','t','e','p','a','d','.','e','x','e',0}; + static const WCHAR shell32W[] = {'s','h','e','l','l','3','2','.','d','l','l',0}; + static const WCHAR emptyW[] = {0}; + UINT ret, ret2; + HICON icons[256]; + UINT ids[256], i; + + if (!pSHExtractIconsW) + { + win_skip("SHExtractIconsW not available\n"); + return; + } + + ret = pSHExtractIconsW(emptyW, 0, 16, 16, icons, ids, 1, 0); + ok(ret == ~0u, "got %u\n", ret); + + ret = pSHExtractIconsW(notepadW, 0, 16, 16, NULL, NULL, 1, 0); + ok(ret == 1 || broken(ret == 2) /* win2k */, "got %u\n", ret); + + icons[0] = (HICON)0xdeadbeef; + ret = pSHExtractIconsW(notepadW, 0, 16, 16, icons, NULL, 1, 0); + ok(ret == 1, "got %u\n", ret); + ok(icons[0] != (HICON)0xdeadbeef, "icon not set\n"); + DestroyIcon(icons[0]); + + icons[0] = (HICON)0xdeadbeef; + ids[0] = 0xdeadbeef; + ret = pSHExtractIconsW(notepadW, 0, 16, 16, icons, ids, 1, 0); + ok(ret == 1, "got %u\n", ret); + ok(icons[0] != (HICON)0xdeadbeef, "icon not set\n"); + ok(ids[0] != 0xdeadbeef, "id not set\n"); + DestroyIcon(icons[0]); + + ret = pSHExtractIconsW(shell32W, 0, 16, 16, NULL, NULL, 0, 0); + ret2 = pSHExtractIconsW(shell32W, 4, MAKELONG(32,16), MAKELONG(32,16), NULL, NULL, 256, 0); + ok(ret && ret == ret2, + "icon count should be independent of requested icon sizes and base icon index\n"); + + ret = pSHExtractIconsW(shell32W, 0, 16, 16, icons, ids, 0, 0); + ok(ret == ~0u || !ret /* < vista */, "got %u\n", ret); + + ret = pSHExtractIconsW(shell32W, 0, 16, 16, icons, ids, 3, 0); + ok(ret == 3, "got %u\n", ret); + for (i = 0; i < ret; i++) DestroyIcon(icons[i]); + + /* count must be a multiple of two when getting two sizes */ + ret = pSHExtractIconsW(shell32W, 0, MAKELONG(16,32), MAKELONG(16,32), icons, ids, 3, 0); + ok(!ret /* vista */ || ret == 4, "got %u\n", ret); + for (i = 0; i < ret; i++) DestroyIcon(icons[i]); + + ret = pSHExtractIconsW(shell32W, 0, MAKELONG(16,32), MAKELONG(16,32), icons, ids, 4, 0); + ok(ret == 4, "got %u\n", ret); + for (i = 0; i < ret; i++) DestroyIcon(icons[i]); +} + START_TEST(shelllink) { HRESULT r; @@ -1108,6 +1166,7 @@ pSHGetStockIconInfo = (void *)GetProcAddress(hmod, "SHGetStockIconInfo"); pGetLongPathNameA = (void *)GetProcAddress(hkernel32, "GetLongPathNameA"); pGetShortPathNameA = (void *)GetProcAddress(hkernel32, "GetShortPathNameA"); + pSHExtractIconsW = (void *)GetProcAddress(hmod, "SHExtractIconsW"); r = CoInitialize(NULL); ok(r == S_OK, "CoInitialize failed (0x%08x)\n", r); @@ -1120,6 +1179,7 @@ test_shdefextracticon(); test_GetIconLocation(); test_SHGetStockIconInfo(); + test_SHExtractIcons(); CoUninitialize(); } diff -Nru wine1.7-1.7.14/dlls/shell32/tests/shlexec.c wine1.7-1.7.18/dlls/shell32/tests/shlexec.c --- wine1.7-1.7.14/dlls/shell32/tests/shlexec.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/shell32/tests/shlexec.c 2014-05-02 18:15:48.000000000 +0000 @@ -183,7 +183,7 @@ trace("%s\n", shell_call); sei.cbSize=sizeof(sei); - sei.fMask=SEE_MASK_NOCLOSEPROCESS | mask; + sei.fMask=SEE_MASK_NOCLOSEPROCESS | SEE_MASK_NO_CONSOLE | mask; sei.hwnd=NULL; sei.lpVerb=verb; sei.lpFile=file; @@ -747,10 +747,19 @@ "%s expected %d, but got %d\n", key, expected, result); } +static void _okChildIntBroken(const char* file, int line, const char* key, int expected) +{ + INT result; + result=GetPrivateProfileIntA("Arguments", key, expected, child_file); + ok_(file, line)(result == expected || broken(result != expected), + "%s expected %d, but got %d\n", key, expected, result); +} + #define okChildString(key, expected) _okChildString(__FILE__, __LINE__, (key), (expected), (expected)) #define okChildStringBroken(key, expected, broken) _okChildString(__FILE__, __LINE__, (key), (expected), (broken)) #define okChildPath(key, expected) _okChildPath(__FILE__, __LINE__, (key), (expected)) -#define okChildInt(key, expected) _okChildInt(__FILE__, __LINE__, (key), (expected)) +#define okChildInt(key, expected) _okChildInt(__FILE__, __LINE__, (key), (expected)) +#define okChildIntBroken(key, expected) _okChildIntBroken(__FILE__, __LINE__, (key), (expected)) /*** * @@ -2118,35 +2127,35 @@ const char* ifexec; int expectedArgs; const char* expectedDdeExec; - int todo; + BOOL broken; } dde_tests_t; static dde_tests_t dde_tests[] = { /* Test passing and not passing command-line * argument, no DDE */ - {"", NULL, NULL, NULL, NULL, FALSE, "", 0x0}, - {"\"%1\"", NULL, NULL, NULL, NULL, TRUE, "", 0x0}, + {"", NULL, NULL, NULL, NULL, FALSE, ""}, + {"\"%1\"", NULL, NULL, NULL, NULL, TRUE, ""}, /* Test passing and not passing command-line * argument, with DDE */ - {"", "[open(\"%1\")]", "shlexec", "dde", NULL, FALSE, "[open(\"%s\")]", 0x0}, - {"\"%1\"", "[open(\"%1\")]", "shlexec", "dde", NULL, TRUE, "[open(\"%s\")]", 0x0}, + {"", "[open(\"%1\")]", "shlexec", "dde", NULL, FALSE, "[open(\"%s\")]"}, + {"\"%1\"", "[open(\"%1\")]", "shlexec", "dde", NULL, TRUE, "[open(\"%s\")]"}, /* Test unquoted %1 in command and ddeexec * (test filename has space) */ - {"%1", "[open(%1)]", "shlexec", "dde", NULL, 2, "[open(%s)]", 0x0}, + {"%1", "[open(%1)]", "shlexec", "dde", NULL, 2, "[open(%s)]", TRUE /* before vista */}, /* Test ifexec precedence over ddeexec */ - {"", "[open(\"%1\")]", "shlexec", "dde", "[ifexec(\"%1\")]", FALSE, "[ifexec(\"%s\")]", 0x0}, + {"", "[open(\"%1\")]", "shlexec", "dde", "[ifexec(\"%1\")]", FALSE, "[ifexec(\"%s\")]"}, /* Test default DDE topic */ - {"", "[open(\"%1\")]", "shlexec", NULL, NULL, FALSE, "[open(\"%s\")]", 0x0}, + {"", "[open(\"%1\")]", "shlexec", NULL, NULL, FALSE, "[open(\"%s\")]"}, /* Test default DDE application */ - {"", "[open(\"%1\")]", NULL, "dde", NULL, FALSE, "[open(\"%s\")]", 0x0}, + {"", "[open(\"%1\")]", NULL, "dde", NULL, FALSE, "[open(\"%s\")]"}, - {NULL, NULL, NULL, NULL, NULL, 0, 0x0} + {NULL} }; static DWORD WINAPI hooked_WaitForInputIdle(HANDLE process, DWORD timeout) @@ -2266,47 +2275,19 @@ dde_ready_event = CreateEventA(NULL, FALSE, FALSE, "winetest_shlexec_dde_ready"); rc = shell_execute_ex(SEE_MASK_FLAG_DDEWAIT | SEE_MASK_FLAG_NO_UI, NULL, filename, NULL, NULL, NULL); CloseHandle(dde_ready_event); - if ((test->todo & 0x1)==0) - { - ok(32 < rc, "%s failed: rc=%lu err=%u\n", shell_call, - rc, GetLastError()); - } - else todo_wine - { - ok(32 < rc, "%s failed: rc=%lu err=%u\n", shell_call, - rc, GetLastError()); - } + ok(32 < rc, "%s failed: rc=%lu err=%u\n", shell_call, rc, GetLastError()); + if (32 < rc) { - if ((test->todo & 0x2)==0) - { - okChildInt("argcA", test->expectedArgs + 3); - } - else todo_wine - { + if (test->broken) + okChildIntBroken("argcA", test->expectedArgs + 3); + else okChildInt("argcA", test->expectedArgs + 3); - } - if (test->expectedArgs == 1) - { - if ((test->todo & 0x4) == 0) - { - okChildPath("argvA3", filename); - } - else todo_wine - { - okChildPath("argvA3", filename); - } - } - if ((test->todo & 0x8) == 0) - { - sprintf(params, test->expectedDdeExec, filename); - okChildPath("ddeExec", params); - } - else todo_wine - { - sprintf(params, test->expectedDdeExec, filename); - okChildPath("ddeExec", params); - } + + if (test->expectedArgs == 1) okChildPath("argvA3", filename); + + sprintf(params, test->expectedDdeExec, filename); + okChildPath("ddeExec", params); } delete_test_association(".sde"); diff -Nru wine1.7-1.7.14/dlls/shell32/tests/shlfileop.c wine1.7-1.7.18/dlls/shell32/tests/shlfileop.c --- wine1.7-1.7.14/dlls/shell32/tests/shlfileop.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/shell32/tests/shlfileop.c 2014-05-02 18:15:48.000000000 +0000 @@ -898,13 +898,13 @@ DeleteFileA("test7.txt"); RemoveDirectoryA("test8.txt"); - /* number of sources do not correspond to number of targets */ + /* number of sources does not correspond to number of targets */ set_curr_dir_path(from, "test1.txt\0test2.txt\0test4.txt\0"); set_curr_dir_path(to, "test6.txt\0test7.txt\0"); retval = SHFileOperationA(&shfo2); if (dir_exists("test6.txt")) { - /* Vista and W2K8 (broken or new behavior ?) */ + /* Vista and W2K8 (broken or new behavior?) */ ok(retval == DE_DESTSAMETREE, "Expected DE_DESTSAMETREE, got %d\n", retval); ok(DeleteFileA("test6.txt\\test1.txt"), "The file is not copied - many files " "are specified as a target\n"); @@ -1871,7 +1871,7 @@ init_shfo_tests(); - /* number of sources do not correspond to number of targets, + /* number of sources does not correspond to number of targets, include directories */ set_curr_dir_path(from, "test1.txt\0test2.txt\0test4.txt\0"); set_curr_dir_path(to, "test6.txt\0test7.txt\0"); @@ -1904,7 +1904,7 @@ } init_shfo_tests(); - /* number of sources do not correspond to number of targets, + /* number of sources does not correspond to number of targets, files only, from exceeds to */ set_curr_dir_path(from, "test1.txt\0test2.txt\0test3.txt\0"); @@ -1939,7 +1939,7 @@ } init_shfo_tests(); - /* number of sources do not correspond to number of targets, + /* number of sources does not correspond to number of targets, files only, too exceeds from */ set_curr_dir_path(from, "test1.txt\0test2.txt\0"); @@ -1963,7 +1963,7 @@ } init_shfo_tests(); - /* number of sources do not correspond to number of targets, + /* number of sources does not correspond to number of targets, target directories */ set_curr_dir_path(from, "test1.txt\0test2.txt\0test3.txt\0"); set_curr_dir_path(to, "test4.txt\0test5.txt\0"); diff -Nru wine1.7-1.7.14/dlls/shell32/trash.c wine1.7-1.7.18/dlls/shell32/trash.c --- wine1.7-1.7.14/dlls/shell32/trash.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/shell32/trash.c 2014-05-02 18:15:48.000000000 +0000 @@ -562,7 +562,7 @@ goto failed; if (DPA_InsertPtr(ret, DPA_APPEND, filename) == -1) { - SHFree(filename); + LocalFree(filename); goto failed; } (*count)++; diff -Nru wine1.7-1.7.14/dlls/shell32/xdg.c wine1.7-1.7.18/dlls/shell32/xdg.c --- wine1.7-1.7.14/dlls/shell32/xdg.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/shell32/xdg.c 2014-05-02 18:15:48.000000000 +0000 @@ -572,6 +572,7 @@ SHFree(group); group = next; } + SHFree(parsed); } #define LINE_GROUP 1 diff -Nru wine1.7-1.7.14/dlls/shlwapi/ordinal.c wine1.7-1.7.18/dlls/shlwapi/ordinal.c --- wine1.7-1.7.14/dlls/shlwapi/ordinal.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/shlwapi/ordinal.c 2014-05-02 18:15:48.000000000 +0000 @@ -60,7 +60,7 @@ extern DWORD SHLWAPI_ThreadRef_index; HRESULT WINAPI IUnknown_QueryService(IUnknown*,REFGUID,REFIID,LPVOID*); -HRESULT WINAPI SHInvokeCommand(HWND,IShellFolder*,LPCITEMIDLIST,BOOL); +HRESULT WINAPI SHInvokeCommand(HWND,IShellFolder*,LPCITEMIDLIST,DWORD); BOOL WINAPI SHAboutInfoW(LPWSTR,DWORD); /* @@ -2933,7 +2933,7 @@ HRESULT WINAPI SHInvokeDefaultCommand(HWND hWnd, IShellFolder* lpFolder, LPCITEMIDLIST lpApidl) { TRACE("%p %p %p\n", hWnd, lpFolder, lpApidl); - return SHInvokeCommand(hWnd, lpFolder, lpApidl, FALSE); + return SHInvokeCommand(hWnd, lpFolder, lpApidl, 0); } /************************************************************************* @@ -3481,19 +3481,19 @@ * hWnd [I] Window displaying the shell folder * lpFolder [I] IShellFolder interface * lpApidl [I] Id for the particular folder desired - * bInvokeDefault [I] Whether to invoke the default menu item + * dwCommandId [I] The command ID to invoke (0=invoke default) * * RETURNS * Success: S_OK. If bInvokeDefault is TRUE, the default menu action was * executed. * Failure: An HRESULT error code indicating the error. */ -HRESULT WINAPI SHInvokeCommand(HWND hWnd, IShellFolder* lpFolder, LPCITEMIDLIST lpApidl, BOOL bInvokeDefault) +HRESULT WINAPI SHInvokeCommand(HWND hWnd, IShellFolder* lpFolder, LPCITEMIDLIST lpApidl, DWORD dwCommandId) { IContextMenu *iContext; HRESULT hRet; - TRACE("(%p, %p, %p, %d)\n", hWnd, lpFolder, lpApidl, bInvokeDefault); + TRACE("(%p, %p, %p, %u)\n", hWnd, lpFolder, lpApidl, dwCommandId); if (!lpFolder) return E_FAIL; @@ -3507,16 +3507,16 @@ if ((hMenu = CreatePopupMenu())) { HRESULT hQuery; - DWORD dwDefaultId = 0; /* Add the context menu entries to the popup */ hQuery = IContextMenu_QueryContextMenu(iContext, hMenu, 0, 1, 0x7FFF, - bInvokeDefault ? CMF_NORMAL : CMF_DEFAULTONLY); + dwCommandId ? CMF_NORMAL : CMF_DEFAULTONLY); if (SUCCEEDED(hQuery)) { - if (bInvokeDefault && - (dwDefaultId = GetMenuDefaultItem(hMenu, 0, 0)) != (UINT)-1) + if (!dwCommandId) + dwCommandId = GetMenuDefaultItem(hMenu, 0, 0); + if (dwCommandId != (UINT)-1) { CMINVOKECOMMANDINFO cmIci; /* Invoke the default item */ @@ -3524,8 +3524,8 @@ cmIci.cbSize = sizeof(cmIci); cmIci.fMask = CMIC_MASK_ASYNCOK; cmIci.hwnd = hWnd; - cmIci.lpVerb = MAKEINTRESOURCEA(dwDefaultId); - cmIci.nShow = SW_SCROLLCHILDREN; + cmIci.lpVerb = MAKEINTRESOURCEA(dwCommandId); + cmIci.nShow = SW_SHOWNORMAL; hRet = IContextMenu_InvokeCommand(iContext, &cmIci); } diff -Nru wine1.7-1.7.14/dlls/shlwapi/path.c wine1.7-1.7.18/dlls/shlwapi/path.c --- wine1.7-1.7.14/dlls/shlwapi/path.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/shlwapi/path.c 2014-05-02 18:15:48.000000000 +0000 @@ -3885,16 +3885,14 @@ strcpyW(szSearch + dwLen, szAllFiles); hfind = FindFirstFileW(szSearch, &find_data); - - if (hfind != INVALID_HANDLE_VALUE && - find_data.cFileName[0] == '.' && - find_data.cFileName[1] == '.') + if (hfind != INVALID_HANDLE_VALUE) { - /* The only directory entry should be the parent */ - if (!FindNextFileW(hfind, &find_data)) - retVal = TRUE; + if (find_data.cFileName[0] == '.' && find_data.cFileName[1] == '.') + /* The only directory entry should be the parent */ + retVal = !FindNextFileW(hfind, &find_data); FindClose(hfind); } + return retVal; } diff -Nru wine1.7-1.7.14/dlls/shlwapi/reg.c wine1.7-1.7.18/dlls/shlwapi/reg.c --- wine1.7-1.7.14/dlls/shlwapi/reg.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/shlwapi/reg.c 2014-05-02 18:15:48.000000000 +0000 @@ -209,31 +209,48 @@ /************************************************************************* * SHRegCreateUSKeyA [SHLWAPI.@] * - * Create or open a user-specific registry key. - * - * PARAMS - * pszPath [I] Key name to create or open. - * samDesired [I] Wanted security access. - * hRelativeUSKey [I] Base path if pszPath is relative. NULL otherwise. - * phNewUSKey [O] Receives a handle to the new or opened key. - * dwFlags [I] Base key under which the key should be opened. - * - * RETURNS - * Success: ERROR_SUCCESS - * Failure: Nonzero error code from winerror.h + * See SHRegCreateUSKeyW. */ -LONG WINAPI SHRegCreateUSKeyA(LPCSTR pszPath, REGSAM samDesired, HUSKEY hRelativeUSKey, - PHUSKEY phNewUSKey, DWORD dwFlags) +LONG WINAPI SHRegCreateUSKeyA(LPCSTR path, REGSAM samDesired, HUSKEY relative_key, + PHUSKEY new_uskey, DWORD flags) { - FIXME("(%s, 0x%08x, %p, %p, 0x%08x) stub\n", debugstr_a(pszPath), samDesired, - hRelativeUSKey, phNewUSKey, dwFlags); - return ERROR_SUCCESS; + WCHAR *pathW; + LONG ret; + + TRACE("(%s, 0x%08x, %p, %p, 0x%08x)\n", debugstr_a(path), samDesired, relative_key, + new_uskey, flags); + + if (path) + { + INT len = MultiByteToWideChar(CP_ACP, 0, path, -1, NULL, 0); + pathW = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR)); + if (!pathW) + return ERROR_NOT_ENOUGH_MEMORY; + MultiByteToWideChar(CP_ACP, 0, path, -1, pathW, len); + } + else + pathW = NULL; + + ret = SHRegCreateUSKeyW(pathW, samDesired, relative_key, new_uskey, flags); + HeapFree(GetProcessHeap(), 0, pathW); + return ret; } /************************************************************************* * SHRegCreateUSKeyW [SHLWAPI.@] * - * See SHRegCreateUSKeyA. + * Create or open a user-specific registry key. + * + * PARAMS + * path [I] Key name to create or open. + * samDesired [I] Wanted security access. + * relative_key [I] Base path if 'path' is relative. NULL otherwise. + * new_uskey [O] Receives a handle to the new or opened key. + * flags [I] Base key under which the key should be opened. + * + * RETURNS + * Success: ERROR_SUCCESS + * Failure: Nonzero error code from winerror.h */ LONG WINAPI SHRegCreateUSKeyW(LPCWSTR path, REGSAM samDesired, HUSKEY relative_key, PHUSKEY new_uskey, DWORD flags) diff -Nru wine1.7-1.7.14/dlls/shlwapi/string.c wine1.7-1.7.18/dlls/shlwapi/string.c --- wine1.7-1.7.14/dlls/shlwapi/string.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/shlwapi/string.c 2014-05-02 18:15:48.000000000 +0000 @@ -2821,7 +2821,7 @@ TRACE("returning %s\n", debugstr_w(dst)); end: if(hmod) FreeLibrary(hmod); - HeapFree(GetProcessHeap(), 0, dllname); + LocalFree(dllname); return hr; } diff -Nru wine1.7-1.7.14/dlls/shlwapi/tests/assoc.c wine1.7-1.7.18/dlls/shlwapi/tests/assoc.c --- wine1.7-1.7.14/dlls/shlwapi/tests/assoc.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/shlwapi/tests/assoc.c 2014-05-02 18:15:48.000000000 +0000 @@ -39,6 +39,8 @@ static void test_getstring_bad(void) { + static const WCHAR openwith[] = {'O','p','e','n','W','i','t','h','.','e','x','e',0}; + WCHAR buf[MAX_PATH]; HRESULT hr; DWORD len; @@ -48,47 +50,71 @@ return; } + len = 0xdeadbeef; hr = pAssocQueryStringW(0, ASSOCSTR_EXECUTABLE, NULL, open, NULL, &len); expect_hr(E_INVALIDARG, hr); + ok(len == 0xdeadbeef, "got %u\n", len); + + len = 0xdeadbeef; hr = pAssocQueryStringW(0, ASSOCSTR_EXECUTABLE, badBad, open, NULL, &len); ok(hr == E_FAIL || hr == HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION), /* Win9x/WinMe/NT4/W2K/Vista/W2K8 */ "Unexpected result : %08x\n", hr); - hr = pAssocQueryStringW(0, ASSOCSTR_EXECUTABLE, dotBad, open, NULL, &len); + ok(len == 0xdeadbeef, "got %u\n", len); + + len = sizeof(buf)/sizeof(buf[0]); + hr = pAssocQueryStringW(0, ASSOCSTR_EXECUTABLE, dotBad, open, buf, &len); ok(hr == E_FAIL || - hr == HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION), /* Win9x/WinMe/NT4/W2K/Vista/W2K8 */ + hr == HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION) /* Win9x/WinMe/NT4/W2K/Vista/W2K8 */ || + hr == S_OK /* Win8 */, "Unexpected result : %08x\n", hr); - hr = pAssocQueryStringW(0, ASSOCSTR_EXECUTABLE, dotHtml, invalid, NULL, - &len); + if (hr == S_OK) + { + ok(len < sizeof(buf)/sizeof(buf[0]), "got %u\n", len); + ok(!lstrcmpiW(buf + len - sizeof(openwith)/sizeof(openwith[0]), openwith), "wrong data\n"); + } + + len = 0xdeadbeef; + hr = pAssocQueryStringW(0, ASSOCSTR_EXECUTABLE, dotHtml, invalid, NULL, &len); ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) || hr == HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION), /* Win9x/WinMe/NT4/W2K/Vista/W2K8 */ "Unexpected result : %08x\n", hr); + ok(len == 0xdeadbeef, "got %u\n", len); + hr = pAssocQueryStringW(0, ASSOCSTR_EXECUTABLE, dotHtml, open, NULL, NULL); ok(hr == E_UNEXPECTED || hr == E_INVALIDARG, /* Win9x/WinMe/NT4/W2K/Vista/W2K8 */ "Unexpected result : %08x\n", hr); + len = 0xdeadbeef; hr = pAssocQueryStringW(0, ASSOCSTR_FRIENDLYAPPNAME, NULL, open, NULL, &len); expect_hr(E_INVALIDARG, hr); - hr = pAssocQueryStringW(0, ASSOCSTR_FRIENDLYAPPNAME, badBad, open, NULL, - &len); + ok(len == 0xdeadbeef, "got %u\n", len); + + len = 0xdeadbeef; + hr = pAssocQueryStringW(0, ASSOCSTR_FRIENDLYAPPNAME, badBad, open, NULL, &len); ok(hr == E_FAIL || hr == HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION), /* Win9x/WinMe/NT4/W2K/Vista/W2K8 */ "Unexpected result : %08x\n", hr); - hr = pAssocQueryStringW(0, ASSOCSTR_FRIENDLYAPPNAME, dotBad, open, NULL, - &len); + ok(len == 0xdeadbeef, "got %u\n", len); + + len = 0xdeadbeef; + hr = pAssocQueryStringW(0, ASSOCSTR_FRIENDLYAPPNAME, dotBad, open, NULL, &len); ok(hr == E_FAIL || hr == HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION) /* Win9x/WinMe/NT4/W2K/Vista/W2K8 */ || hr == HRESULT_FROM_WIN32(ERROR_NOT_FOUND), /* Win8 */ "Unexpected result : %08x\n", hr); - hr = pAssocQueryStringW(0, ASSOCSTR_FRIENDLYAPPNAME, dotHtml, invalid, NULL, - &len); + ok(len == 0xdeadbeef, "got %u\n", len); + + len = 0xdeadbeef; + hr = pAssocQueryStringW(0, ASSOCSTR_FRIENDLYAPPNAME, dotHtml, invalid, NULL, &len); ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) || hr == HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION) || /* W2K/Vista/W2K8 */ hr == E_FAIL, /* Win9x/WinMe/NT4 */ "Unexpected result : %08x\n", hr); - hr = pAssocQueryStringW(0, ASSOCSTR_FRIENDLYAPPNAME, dotHtml, open, NULL, - NULL); + ok(len == 0xdeadbeef, "got %u\n", len); + + hr = pAssocQueryStringW(0, ASSOCSTR_FRIENDLYAPPNAME, dotHtml, open, NULL, NULL); ok(hr == E_UNEXPECTED || hr == E_INVALIDARG, /* Win9x/WinMe/NT4/W2K/Vista/W2K8 */ "Unexpected result : %08x\n", hr); diff -Nru wine1.7-1.7.14/dlls/shlwapi/tests/ordinal.c wine1.7-1.7.18/dlls/shlwapi/tests/ordinal.c --- wine1.7-1.7.14/dlls/shlwapi/tests/ordinal.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/shlwapi/tests/ordinal.c 2014-05-02 18:15:48.000000000 +0000 @@ -289,14 +289,15 @@ When the buffer is large enough, the default language is returned When the buffer is too small for that fallback, win7_32 and w2k8_64 - and above fail with HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), but - recent os succeed and return a partial result while - older os succeed and overflow the buffer */ + fail with HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), win8 fails + with HRESULT_FROM_WIN32(ERROR_MORE_DATA), other versions succeed and + return a partial result while older os succeed and overflow the buffer */ ok(((hr == E_INVALIDARG) && (len == 0)) || (((hr == S_OK) && !lstrcmpA(buffer, language) && (len == lstrlenA(language))) || ((hr == S_OK) && !memcmp(buffer, language, len)) || - ((hr == __HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER)) && !len)), + ((hr == __HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER)) && !len) || + ((hr == __HRESULT_FROM_WIN32(ERROR_MORE_DATA)) && len == exactsize)), "==_#%d: got 0x%x with %d and %s\n", i, hr, len, buffer); if (exactsize > 1) { @@ -307,7 +308,8 @@ ok(((hr == E_INVALIDARG) && (len == 0)) || (((hr == S_OK) && !lstrcmpA(buffer, language) && (len == lstrlenA(language))) || ((hr == S_OK) && !memcmp(buffer, language, len)) || - ((hr == __HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER)) && !len)), + ((hr == __HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER)) && !len) || + ((hr == __HRESULT_FROM_WIN32(ERROR_MORE_DATA)) && len == exactsize - 1)), "-1_#%d: got 0x%x with %d and %s\n", i, hr, len, buffer); } @@ -318,15 +320,16 @@ ok(((hr == E_INVALIDARG) && (len == 0)) || (((hr == S_OK) && !lstrcmpA(buffer, language) && (len == lstrlenA(language))) || ((hr == S_OK) && !memcmp(buffer, language, len)) || - ((hr == __HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER)) && !len)), + ((hr == __HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER)) && !len) || + ((hr == __HRESULT_FROM_WIN32(ERROR_MORE_DATA)) && len == 1)), "=1_#%d: got 0x%x with %d and %s\n", i, hr, len, buffer); len = maxlen; hr = pGetAcceptLanguagesA( NULL, &len); /* w2k3 and below: E_FAIL and untouched len, - since w2k8: S_OK and needed size (excluding 0) */ - ok( ((hr == S_OK) && (len == exactsize)) || + since w2k8: S_OK and needed size (excluding 0), win8 S_OK and size including 0. */ + ok( ((hr == S_OK) && ((len == exactsize) || (len == exactsize + 1))) || ((hr == E_FAIL) && (len == maxlen)), "NULL,max #%d: got 0x%x with %d and %s\n", i, hr, len, buffer); @@ -349,7 +352,8 @@ buffer[maxlen] = 0; hr = pGetAcceptLanguagesA( buffer, &len); ok( (((hr == S_OK) || (hr == E_INVALIDARG)) && !memcmp(buffer, language, len)) || - ((hr == __HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER)) && !len), + ((hr == __HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER)) && !len) || + ((hr == __HRESULT_FROM_WIN32(ERROR_CANNOT_COPY)) && !len), "=2: got 0x%x with %d and %s\n", hr, len, buffer); len = 1; @@ -357,20 +361,21 @@ buffer[maxlen] = 0; hr = pGetAcceptLanguagesA( buffer, &len); /* When the buffer is too small, win7_32 and w2k8_64 and above fail with - HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), other versions succeed - and return a partial 0 terminated result while other versions + HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), win8 ERROR_CANNOT_COPY, + other versions succeed and return a partial 0 terminated result while other versions fail with E_INVALIDARG and return a partial unterminated result */ ok( (((hr == S_OK) || (hr == E_INVALIDARG)) && !memcmp(buffer, language, len)) || - ((hr == __HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER)) && !len), + ((hr == __HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER)) && !len) || + ((hr == __HRESULT_FROM_WIN32(ERROR_CANNOT_COPY)) && !len), "=1: got 0x%x with %d and %s\n", hr, len, buffer); len = 0; memset(buffer, '#', maxlen); buffer[maxlen] = 0; hr = pGetAcceptLanguagesA( buffer, &len); - /* w2k3 and below: E_FAIL, since w2k8: E_INVALIDARG */ - ok((hr == E_FAIL) || (hr == E_INVALIDARG), - "got 0x%x (expected E_FAIL or E_INVALIDARG)\n", hr); + /* w2k3 and below: E_FAIL, since w2k8: E_INVALIDARG, win8 ERROR_CANNOT_COPY */ + ok((hr == E_FAIL) || (hr == E_INVALIDARG) || (hr == __HRESULT_FROM_WIN32(ERROR_CANNOT_COPY)), + "got 0x%x\n", hr); memset(buffer, '#', maxlen); buffer[maxlen] = 0; @@ -2290,7 +2295,9 @@ /* null source pointer */ hr = pIUnknown_QueryServiceExec(NULL, &dummy_serviceid, &dummy_groupid, 0, 0, 0, 0); - ok(hr == E_FAIL, "got 0x%08x\n", hr); + ok(hr == E_FAIL || + hr == E_NOTIMPL, /* win 8 */ + "got 0x%08x\n", hr); /* expected trace: IUnknown_QueryServiceExec( ptr1, serviceid, groupid, arg1, arg2, arg3, arg4); @@ -2406,7 +2413,9 @@ /* null source pointer */ hr = pIUnknown_ProfferService(NULL, &dummy_serviceid, 0, 0); - ok(hr == E_FAIL, "got 0x%08x\n", hr); + ok(hr == E_FAIL || + hr == E_NOTIMPL, /* win 8 */ + "got 0x%08x\n", hr); /* expected trace: IUnknown_ProfferService( ptr1, serviceid, arg1, arg2); diff -Nru wine1.7-1.7.14/dlls/shlwapi/tests/url.c wine1.7-1.7.18/dlls/shlwapi/tests/url.c --- wine1.7-1.7.14/dlls/shlwapi/tests/url.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/shlwapi/tests/url.c 2014-05-02 18:15:48.000000000 +0000 @@ -297,7 +297,9 @@ {"ftp://fo/o@bar.baz/fo#o\\bar", 0, 0, S_OK, "ftp://fo/o@bar.baz/fo#o\\bar"}, {"ftp://localhost/o@bar.baz/fo#o\\bar", 0, 0, S_OK, "ftp://localhost/o@bar.baz/fo#o\\bar"}, {"ftp:///fo/o@bar.baz/foo/bar", 0, 0, S_OK, "ftp:///fo/o@bar.baz/foo/bar"}, - {"ftp:////fo/o@bar.baz/foo/bar", 0, 0, S_OK, "ftp:////fo/o@bar.baz/foo/bar"} + {"ftp:////fo/o@bar.baz/foo/bar", 0, 0, S_OK, "ftp:////fo/o@bar.baz/foo/bar"}, + + {"ftp\x1f\1end/", 0, 0, S_OK, "ftp%1F%01end/"} }; /* ################ */ @@ -779,34 +781,6 @@ } /* ########################### */ - -static void test_url_escape(const char *szUrl, DWORD dwFlags, HRESULT dwExpectReturn, const char *szExpectUrl) -{ - CHAR szReturnUrl[INTERNET_MAX_URL_LENGTH]; - DWORD dwEscaped; - WCHAR ret_urlW[INTERNET_MAX_URL_LENGTH]; - WCHAR *urlW, *expected_urlW; - dwEscaped=INTERNET_MAX_URL_LENGTH; - - ok(pUrlEscapeA(szUrl, szReturnUrl, &dwEscaped, dwFlags) == dwExpectReturn, - "UrlEscapeA didn't return 0x%08x from \"%s\"\n", dwExpectReturn, szUrl); - ok(strcmp(szReturnUrl,szExpectUrl)==0, "Expected \"%s\", but got \"%s\" from \"%s\"\n", szExpectUrl, szReturnUrl, szUrl); - - if (pUrlEscapeW) { - dwEscaped = INTERNET_MAX_URL_LENGTH; - urlW = GetWideString(szUrl); - expected_urlW = GetWideString(szExpectUrl); - ok(pUrlEscapeW(urlW, ret_urlW, &dwEscaped, dwFlags) == dwExpectReturn, - "UrlEscapeW didn't return 0x%08x from \"%s\"\n", dwExpectReturn, szUrl); - WideCharToMultiByte(CP_ACP,0,ret_urlW,-1,szReturnUrl,INTERNET_MAX_URL_LENGTH,0,0); - ok(lstrcmpW(ret_urlW, expected_urlW)==0, - "Expected \"%s\", but got \"%s\" from \"%s\" flags %08x\n", - szExpectUrl, szReturnUrl, szUrl, dwFlags); - FreeWideString(urlW); - FreeWideString(expected_urlW); - } -} - static void test_url_canonicalize(int index, const char *szUrl, DWORD dwFlags, HRESULT dwExpectReturn, HRESULT dwExpectReturnAlt, const char *szExpectUrl, BOOL todo) { CHAR szReturnUrl[INTERNET_MAX_URL_LENGTH]; @@ -850,18 +824,15 @@ } -static void test_UrlEscape(void) +static void test_UrlEscapeA(void) { - static const WCHAR out[] = { 'f','o','o','%','2','0','b','a','r',0 }; - DWORD size = 0; HRESULT ret; unsigned int i; char empty_string[] = ""; - WCHAR overwrite[] = { 'f','o','o',' ','b','a','r',0,0,0 }; if (!pUrlEscapeA) { - win_skip("UrlEscapeA noz found\n"); + win_skip("UrlEscapeA not found\n"); return; } @@ -891,26 +862,68 @@ ok(size == 34, "got %d, expected %d\n", size, 34); ok(empty_string[0] == 127, "String has changed, empty_string[0] = %d\n", empty_string[0]); - if(pUrlEscapeW) { - WCHAR wc; + for(i=0; i= 127) + if (ch <= 31 || (ch >= 127 && ch <= 255) ) return TRUE; - else { - switch (ch) { - case ' ': - case '<': - case '>': - case '\"': - case '{': - case '}': - case '|': - case '\\': - case '^': - case ']': - case '[': - case '`': - case '&': - return TRUE; - - case '/': - if (int_flags & WINE_URL_ESCAPE_SLASH) return TRUE; - return FALSE; - - case '?': - if (int_flags & WINE_URL_ESCAPE_QUESTION) return TRUE; - return FALSE; - - case '#': - if (int_flags & WINE_URL_ESCAPE_HASH) return TRUE; - return FALSE; - - default: - return FALSE; - } + if (isalnumW(ch)) + return FALSE; + + switch (ch) { + case ' ': + case '<': + case '>': + case '\"': + case '{': + case '}': + case '|': + case '\\': + case '^': + case ']': + case '[': + case '`': + case '&': + return TRUE; + case '/': + return !!(int_flags & WINE_URL_ESCAPE_SLASH); + case '?': + return !!(int_flags & WINE_URL_ESCAPE_QUESTION); + case '#': + return !!(int_flags & WINE_URL_ESCAPE_HASH); + default: + return FALSE; } } diff -Nru wine1.7-1.7.14/dlls/tapi32/line.c wine1.7-1.7.18/dlls/tapi32/line.c --- wine1.7-1.7.14/dlls/tapi32/line.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/tapi32/line.c 2014-05-02 18:15:48.000000000 +0000 @@ -1268,6 +1268,15 @@ } /*********************************************************************** + * lineOpenW (TAPI32.@) + */ +DWORD WINAPI lineOpenW(HLINEAPP hLineApp, DWORD dwDeviceID, LPHLINE lphLine, DWORD dwAPIVersion, DWORD dwExtVersion, DWORD dwCallbackInstance, DWORD dwPrivileges, DWORD dwMediaModes, LPLINECALLPARAMS lpCallParams) +{ + FIXME("stub.\n"); + return 0; +} + +/*********************************************************************** * lineOpen (TAPI32.@) */ DWORD WINAPI lineOpenA(HLINEAPP hLineApp, DWORD dwDeviceID, LPHLINE lphLine, DWORD dwAPIVersion, DWORD dwExtVersion, DWORD dwCallbackInstance, DWORD dwPrivileges, DWORD dwMediaModes, LPLINECALLPARAMS lpCallParams) diff -Nru wine1.7-1.7.14/dlls/tapi32/tapi32.spec wine1.7-1.7.18/dlls/tapi32/tapi32.spec --- wine1.7-1.7.14/dlls/tapi32/tapi32.spec 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/tapi32/tapi32.spec 2014-05-02 18:15:48.000000000 +0000 @@ -83,6 +83,7 @@ @ stdcall lineNegotiateExtVersion(long long long long long ptr) @ stdcall lineOpen(long long ptr long long long long long ptr) lineOpenA @ stdcall lineOpenA(long long ptr long long long long long ptr) +@ stdcall lineOpenW(long long ptr long long long long long ptr) @ stdcall linePark(long long str ptr) lineParkA @ stdcall lineParkA(long long str ptr) @ stdcall linePickup(long long ptr str str) linePickupA diff -Nru wine1.7-1.7.14/dlls/taskschd/folder.c wine1.7-1.7.18/dlls/taskschd/folder.c --- wine1.7-1.7.14/dlls/taskschd/folder.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/taskschd/folder.c 2014-05-02 18:15:48.000000000 +0000 @@ -25,6 +25,7 @@ #include "winreg.h" #include "objbase.h" #include "taskschd.h" +#include "schrpc.h" #include "taskschd_private.h" #include "wine/unicode.h" @@ -32,8 +33,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(taskschd); -static const char root[] = "Software\\Microsoft\\Windows NT\\CurrentVersion\\Schedule\\TaskCache\\Tree"; - typedef struct { ITaskFolder ITaskFolder_iface; @@ -135,76 +134,6 @@ return S_OK; } -static HRESULT reg_create_folder(const WCHAR *path, HKEY *hfolder) -{ - HKEY hroot; - DWORD ret, disposition; - - ret = RegCreateKeyA(HKEY_LOCAL_MACHINE, root, &hroot); - if (ret) return HRESULT_FROM_WIN32(ret); - - while (*path == '\\') path++; - ret = RegCreateKeyExW(hroot, path, 0, NULL, 0, KEY_ALL_ACCESS, NULL, hfolder, &disposition); - if (ret == ERROR_FILE_NOT_FOUND) - ret = ERROR_PATH_NOT_FOUND; - - if (ret == ERROR_SUCCESS && disposition == REG_OPENED_EXISTING_KEY) - { - RegCloseKey(*hfolder); - ret = ERROR_ALREADY_EXISTS; - } - - RegCloseKey(hroot); - - return HRESULT_FROM_WIN32(ret); -} - -static HRESULT reg_open_folder(const WCHAR *path, HKEY *hfolder) -{ - HKEY hroot; - DWORD ret; - - ret = RegCreateKeyA(HKEY_LOCAL_MACHINE, root, &hroot); - if (ret) return HRESULT_FROM_WIN32(ret); - - while (*path == '\\') path++; - ret = RegOpenKeyExW(hroot, path, 0, KEY_ALL_ACCESS, hfolder); - if (ret == ERROR_FILE_NOT_FOUND) - ret = ERROR_PATH_NOT_FOUND; - - RegCloseKey(hroot); - - return HRESULT_FROM_WIN32(ret); -} - -static HRESULT reg_delete_folder(const WCHAR *path, const WCHAR *name) -{ - HKEY hroot, hfolder; - DWORD ret; - - ret = RegCreateKeyA(HKEY_LOCAL_MACHINE, root, &hroot); - if (ret) return HRESULT_FROM_WIN32(ret); - - while (*path == '\\') path++; - ret = RegOpenKeyExW(hroot, path, 0, DELETE, &hfolder); - - RegCloseKey(hroot); - - while (*name == '\\') name++; - if (ret == ERROR_SUCCESS) - { - ret = RegDeleteKeyW(hfolder, name); - RegCloseKey(hfolder); - } - - return HRESULT_FROM_WIN32(ret); -} - -static inline void reg_close_folder(HKEY hfolder) -{ - RegCloseKey(hfolder); -} - static HRESULT WINAPI TaskFolder_get_Path(ITaskFolder *iface, BSTR *path) { TaskFolder *folder = impl_from_ITaskFolder(iface); @@ -273,9 +202,47 @@ return hr; } +WCHAR *get_full_path(const WCHAR *parent, const WCHAR *path) +{ + static const WCHAR bslash[] = { '\\', 0 }; + WCHAR *folder_path; + int len = 0; + + if (path) len = strlenW(path); + + if (parent) len += strlenW(parent); + + /* +1 if parent is not '\' terminated */ + folder_path = heap_alloc((len + 2) * sizeof(WCHAR)); + if (!folder_path) return NULL; + + folder_path[0] = 0; + + if (parent) + strcpyW(folder_path, parent); + + if (path && *path) + { + len = strlenW(folder_path); + if (!len || folder_path[len - 1] != '\\') + strcatW(folder_path, bslash); + + while (*path == '\\') path++; + strcatW(folder_path, path); + } + + len = strlenW(folder_path); + if (!len) + strcatW(folder_path, bslash); + + return folder_path; +} + static HRESULT WINAPI TaskFolder_DeleteFolder(ITaskFolder *iface, BSTR name, LONG flags) { TaskFolder *folder = impl_from_ITaskFolder(iface); + WCHAR *folder_path; + HRESULT hr; TRACE("%p,%s,%x\n", iface, debugstr_w(name), flags); @@ -284,18 +251,31 @@ if (flags) FIXME("unsupported flags %x\n", flags); - return reg_delete_folder(folder->path, name); + folder_path = get_full_path(folder->path, name); + if (!folder_path) return E_OUTOFMEMORY; + + hr = SchRpcDelete(folder_path, 0); + heap_free(folder_path); + return hr; } static HRESULT WINAPI TaskFolder_GetTask(ITaskFolder *iface, BSTR name, IRegisteredTask **task) { TaskFolder *folder = impl_from_ITaskFolder(iface); + ITaskDefinition *taskdef; + HRESULT hr; TRACE("%p,%s,%p\n", iface, debugstr_w(name), task); if (!task) return E_POINTER; - return RegisteredTask_create(folder->path, name, NULL, 0, task, FALSE); + hr = TaskDefinition_create(&taskdef); + if (hr != S_OK) return hr; + + hr = RegisteredTask_create(folder->path, name, taskdef, 0, 0, task, FALSE); + if (hr != S_OK) + ITaskDefinition_Release(taskdef); + return hr; } static HRESULT WINAPI TaskFolder_GetTasks(ITaskFolder *iface, LONG flags, IRegisteredTaskCollection **tasks) @@ -311,14 +291,31 @@ static HRESULT WINAPI TaskFolder_DeleteTask(ITaskFolder *iface, BSTR name, LONG flags) { - FIXME("%p,%s,%x: stub\n", iface, debugstr_w(name), flags); - return E_NOTIMPL; + TaskFolder *folder = impl_from_ITaskFolder(iface); + WCHAR *folder_path; + HRESULT hr; + + TRACE("%p,%s,%x\n", iface, debugstr_w(name), flags); + + if (!name || !*name) return E_ACCESSDENIED; + + if (flags) + FIXME("unsupported flags %x\n", flags); + + folder_path = get_full_path(folder->path, name); + if (!folder_path) return E_OUTOFMEMORY; + + hr = SchRpcDelete(folder_path, 0); + heap_free(folder_path); + return hr; } static HRESULT WINAPI TaskFolder_RegisterTask(ITaskFolder *iface, BSTR name, BSTR xml, LONG flags, VARIANT user, VARIANT password, TASK_LOGON_TYPE logon, VARIANT sddl, IRegisteredTask **task) { + TaskFolder *folder = impl_from_ITaskFolder(iface); + IRegisteredTask *regtask = NULL; ITaskDefinition *taskdef; HRESULT hr; @@ -327,14 +324,21 @@ if (!xml) return HRESULT_FROM_WIN32(RPC_X_NULL_REF_POINTER); + if (!task) task = ®task; + hr = TaskDefinition_create(&taskdef); if (hr != S_OK) return hr; hr = ITaskDefinition_put_XmlText(taskdef, xml); if (hr == S_OK) - hr = ITaskFolder_RegisterTaskDefinition(iface, name, taskdef, flags, user, password, logon, sddl, task); + hr = RegisteredTask_create(folder->path, name, taskdef, flags, logon, task, TRUE); + + if (hr != S_OK) + ITaskDefinition_Release(taskdef); + + if (regtask) + IRegisteredTask_Release(regtask); - ITaskDefinition_Release(taskdef); return hr; } @@ -357,7 +361,10 @@ if (!task) task = ®task; - hr = RegisteredTask_create(folder->path, name, definition, logon, task, TRUE); + ITaskDefinition_AddRef(definition); + hr = RegisteredTask_create(folder->path, name, definition, flags, logon, task, TRUE); + if (hr != S_OK) + ITaskDefinition_Release(definition); if (regtask) IRegisteredTask_Release(regtask); @@ -403,53 +410,50 @@ HRESULT TaskFolder_create(const WCHAR *parent, const WCHAR *path, ITaskFolder **obj, BOOL create) { - static const WCHAR bslash[] = { '\\', 0 }; TaskFolder *folder; WCHAR *folder_path; - int len = 0; HRESULT hr; - HKEY hfolder; if (path) { - len = strlenW(path); + int len = strlenW(path); if (len && path[len - 1] == '\\') return ERROR_INVALID_NAME; } - if (parent) len += strlenW(parent); - - /* +1 if parent is not '\' terminated */ - folder_path = heap_alloc((len + 2) * sizeof(WCHAR)); + folder_path = get_full_path(parent, path); if (!folder_path) return E_OUTOFMEMORY; - folder_path[0] = 0; - - if (parent) - strcpyW(folder_path, parent); - - if (path && *path) + if (create) { - len = strlenW(folder_path); - if (!len || folder_path[len - 1] != '\\') - strcatW(folder_path, bslash); - - while (*path == '\\') path++; - strcatW(folder_path, path); + hr = SchRpcCreateFolder(folder_path, NULL, 0); } + else + { + DWORD start_index, count, i; + TASK_NAMES names; - len = strlenW(folder_path); - if (!len) - strcatW(folder_path, bslash); + start_index = 0; + names = NULL; + hr = SchRpcEnumFolders(folder_path, 0, &start_index, 0, &count, &names); + if (hr == S_OK) + { + for (i = 0; i < count; i++) + MIDL_user_free(names[i]); + MIDL_user_free(names); + } + else + { + if (hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)) + hr = HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND); + } + } - hr = create ? reg_create_folder(folder_path, &hfolder) : reg_open_folder(folder_path, &hfolder); - if (hr) + if (FAILED(hr)) { heap_free(folder_path); return hr; } - reg_close_folder(hfolder); - folder = heap_alloc(sizeof(*folder)); if (!folder) { diff -Nru wine1.7-1.7.14/dlls/taskschd/folder_collection.c wine1.7-1.7.18/dlls/taskschd/folder_collection.c --- wine1.7-1.7.14/dlls/taskschd/folder_collection.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/taskschd/folder_collection.c 2014-05-02 18:15:48.000000000 +0000 @@ -24,6 +24,7 @@ #include "winbase.h" #include "objbase.h" #include "taskschd.h" +#include "schrpc.h" #include "taskschd_private.h" #include "wine/unicode.h" @@ -31,15 +32,13 @@ WINE_DEFAULT_DEBUG_CHANNEL(taskschd); -static const char root[] = "Software\\Microsoft\\Windows NT\\CurrentVersion\\Schedule\\TaskCache\\Tree"; - typedef struct { ITaskFolderCollection ITaskFolderCollection_iface; LONG ref; WCHAR *path; - LPWSTR *list; - LONG count; + TASK_NAMES list; + DWORD count; } TaskFolderCollection; static HRESULT NewEnum_create(TaskFolderCollection *folders, IUnknown **obj); @@ -55,14 +54,14 @@ return InterlockedIncrement(&folders->ref); } -static void free_list(LPWSTR *list, LONG count) +static void free_list(LPWSTR *list, DWORD count) { LONG i; for (i = 0; i < count; i++) - heap_free(list[i]); + MIDL_user_free(list[i]); - heap_free(list); + MIDL_user_free(list); } static ULONG WINAPI folders_Release(ITaskFolderCollection *iface) @@ -216,98 +215,17 @@ folders_get__NewEnum }; -static HRESULT reg_open_folder(const WCHAR *path, HKEY *hfolder) -{ - HKEY hroot; - DWORD ret; - - ret = RegCreateKeyA(HKEY_LOCAL_MACHINE, root, &hroot); - if (ret) return HRESULT_FROM_WIN32(ret); - - while (*path == '\\') path++; - ret = RegOpenKeyExW(hroot, path, 0, KEY_ALL_ACCESS, hfolder); - if (ret == ERROR_FILE_NOT_FOUND) - ret = ERROR_PATH_NOT_FOUND; - - RegCloseKey(hroot); - - return HRESULT_FROM_WIN32(ret); -} - -static inline void reg_close_folder(HKEY hfolder) -{ - RegCloseKey(hfolder); -} - -static HRESULT create_folders_list(const WCHAR *path, LPWSTR **folders_list, LONG *folders_count) -{ - HRESULT hr; - HKEY hfolder; - WCHAR name[MAX_PATH]; - LONG ret, idx, allocated, count; - LPWSTR *list; - - *folders_list = NULL; - *folders_count = 0; - - hr = reg_open_folder(path, &hfolder); - if (hr) return hr; - - allocated = 64; - list = heap_alloc(allocated * sizeof(LPWSTR)); - if (!list) - { - reg_close_folder(hfolder); - return E_OUTOFMEMORY; - } - - idx = count = 0; - - while (!(ret = RegEnumKeyW(hfolder, idx++, name, MAX_PATH))) - { - /* FIXME: differentiate between folders and tasks */ - if (count >= allocated) - { - LPWSTR *new_list; - allocated *= 2; - new_list = heap_realloc(list, allocated * sizeof(LPWSTR)); - if (!new_list) - { - reg_close_folder(hfolder); - free_list(list, count); - return E_OUTOFMEMORY; - } - list = new_list; - } - - list[count] = heap_strdupW(name); - if (!list[count]) - { - reg_close_folder(hfolder); - free_list(list, count); - return E_OUTOFMEMORY; - } - - count++; - } - - reg_close_folder(hfolder); - - *folders_list = list; - *folders_count = count; - - return S_OK; -} - HRESULT TaskFolderCollection_create(const WCHAR *path, ITaskFolderCollection **obj) { TaskFolderCollection *folders; HRESULT hr; - LPWSTR *list; - LONG count; + TASK_NAMES list; + DWORD start_index, count; - hr = create_folders_list(path, &list, &count); - if (hr) return hr; + start_index = 0; + list = NULL; + hr = SchRpcEnumFolders(path, 0, &start_index, 0, &count, &list); + if (hr != S_OK) return hr; folders = heap_alloc(sizeof(*folders)); if (!folders) diff -Nru wine1.7-1.7.14/dlls/taskschd/Makefile.in wine1.7-1.7.18/dlls/taskschd/Makefile.in --- wine1.7-1.7.14/dlls/taskschd/Makefile.in 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/taskschd/Makefile.in 2014-05-02 18:15:48.000000000 +0000 @@ -1,5 +1,5 @@ MODULE = taskschd.dll -IMPORTS = oleaut32 ole32 advapi32 xmllite +IMPORTS = oleaut32 ole32 advapi32 xmllite rpcrt4 C_SRCS = \ folder.c \ @@ -8,4 +8,6 @@ task.c \ taskschd.c -IDL_SRCS = taskschd_tlb.idl +IDL_SRCS = \ + schrpc.idl \ + taskschd_tlb.idl diff -Nru wine1.7-1.7.14/dlls/taskschd/regtask.c wine1.7-1.7.18/dlls/taskschd/regtask.c --- wine1.7-1.7.14/dlls/taskschd/regtask.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/taskschd/regtask.c 2014-05-02 18:15:48.000000000 +0000 @@ -25,6 +25,7 @@ #include "winreg.h" #include "objbase.h" #include "taskschd.h" +#include "schrpc.h" #include "taskschd_private.h" #include "wine/unicode.h" @@ -116,26 +117,65 @@ static HRESULT WINAPI regtask_get_Name(IRegisteredTask *iface, BSTR *name) { - FIXME("%p,%p: stub\n", iface, name); - return E_NOTIMPL; + RegisteredTask *regtask = impl_from_IRegisteredTask(iface); + const WCHAR *p_name; + + TRACE("%p,%p\n", iface, name); + + if (!name) return E_POINTER; + + p_name = strrchrW(regtask->path, '\\'); + if (!p_name) + p_name = regtask->path; + else + if (p_name[1] != 0) p_name++; + + *name = SysAllocString(p_name); + if (!*name) return E_OUTOFMEMORY; + + return S_OK; } static HRESULT WINAPI regtask_get_Path(IRegisteredTask *iface, BSTR *path) { - FIXME("%p,%p: stub\n", iface, path); - return E_NOTIMPL; + RegisteredTask *regtask = impl_from_IRegisteredTask(iface); + + TRACE("%p,%p\n", iface, path); + + if (!path) return E_POINTER; + + *path = SysAllocString(regtask->path); + if (!*path) return E_OUTOFMEMORY; + + return S_OK; } static HRESULT WINAPI regtask_get_State(IRegisteredTask *iface, TASK_STATE *state) { - FIXME("%p,%p: stub\n", iface, state); - return E_NOTIMPL; + RegisteredTask *regtask = impl_from_IRegisteredTask(iface); + DWORD enabled; + + TRACE("%p,%p\n", iface, state); + + if (!state) return E_POINTER; + + return SchRpcGetTaskInfo(regtask->path, SCH_FLAG_STATE, &enabled, state); } -static HRESULT WINAPI regtask_get_Enabled(IRegisteredTask *iface, VARIANT_BOOL *enabled) +static HRESULT WINAPI regtask_get_Enabled(IRegisteredTask *iface, VARIANT_BOOL *v_enabled) { - FIXME("%p,%p: stub\n", iface, enabled); - return E_NOTIMPL; + RegisteredTask *regtask = impl_from_IRegisteredTask(iface); + DWORD enabled, state; + HRESULT hr; + + TRACE("%p,%p\n", iface, v_enabled); + + if (!v_enabled) return E_POINTER; + + hr = SchRpcGetTaskInfo(regtask->path, 0, &enabled, &state); + if (hr == S_OK) + *v_enabled = enabled ? VARIANT_TRUE : VARIANT_FALSE; + return hr; } static HRESULT WINAPI regtask_put_Enabled(IRegisteredTask *iface, VARIANT_BOOL enabled) @@ -266,18 +306,74 @@ regtask_GetRunTimes }; -HRESULT RegisteredTask_create(const WCHAR *path, const WCHAR *name, ITaskDefinition *definition, +HRESULT RegisteredTask_create(const WCHAR *path, const WCHAR *name, ITaskDefinition *definition, LONG flags, TASK_LOGON_TYPE logon, IRegisteredTask **obj, BOOL create) { + WCHAR *full_name; RegisteredTask *regtask; + HRESULT hr; + + if (!name) + { + if (!create) return E_INVALIDARG; + + /* NULL task name is allowed only in the root folder */ + if (path[0] != '\\' || path[1]) + return E_INVALIDARG; + + full_name = NULL; + } + else + { + full_name = get_full_path(path, name); + if (!full_name) return E_OUTOFMEMORY; + } regtask = heap_alloc(sizeof(*regtask)); - if (!regtask) return E_OUTOFMEMORY; + if (!regtask) + { + heap_free(full_name); + return E_OUTOFMEMORY; + } + + if (create) + { + WCHAR *actual_path = NULL; + TASK_XML_ERROR_INFO *error_info = NULL; + BSTR xml = NULL; + + hr = ITaskDefinition_get_XmlText(definition, &xml); + if (hr != S_OK || (hr = SchRpcRegisterTask(full_name, xml, flags, NULL, logon, 0, NULL, &actual_path, &error_info)) != S_OK) + { + heap_free(full_name); + heap_free(regtask); + SysFreeString(xml); + return hr; + } + + heap_free(full_name); + full_name = heap_strdupW(actual_path); + MIDL_user_free(actual_path); + } + else + { + static const WCHAR languages[] = { 0 }; + DWORD count = 0; + WCHAR *xml = NULL; + + hr = SchRpcRetrieveTask(full_name, languages, &count, &xml); + if (hr != S_OK || (hr = ITaskDefinition_put_XmlText(definition, xml)) != S_OK) + { + heap_free(full_name); + heap_free(regtask); + return hr; + } + MIDL_user_free(xml); + } regtask->IRegisteredTask_iface.lpVtbl = &RegisteredTask_vtbl; - regtask->path = heap_strdupW(path); + regtask->path = full_name; regtask->ref = 1; - ITaskDefinition_AddRef(definition); regtask->taskdef = definition; *obj = ®task->IRegisteredTask_iface; diff -Nru wine1.7-1.7.14/dlls/taskschd/schrpc.idl wine1.7-1.7.18/dlls/taskschd/schrpc.idl --- wine1.7-1.7.14/dlls/taskschd/schrpc.idl 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.18/dlls/taskschd/schrpc.idl 2014-05-02 18:15:48.000000000 +0000 @@ -0,0 +1,3 @@ +#pragma makedep client + +#include "wine/schrpc.idl" diff -Nru wine1.7-1.7.14/dlls/taskschd/task.c wine1.7-1.7.18/dlls/taskschd/task.c --- wine1.7-1.7.14/dlls/taskschd/task.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/taskschd/task.c 2014-05-02 18:15:48.000000000 +0000 @@ -26,6 +26,8 @@ #include "objbase.h" #include "xmllite.h" #include "taskschd.h" +#include "winsvc.h" +#include "schrpc.h" #include "taskschd_private.h" #include "wine/unicode.h" @@ -37,6 +39,7 @@ { IRegistrationInfo IRegistrationInfo_iface; LONG ref; + WCHAR *description, *author, *version, *date, *documentation, *uri, *source; } registration_info; static inline registration_info *impl_from_IRegistrationInfo(IRegistrationInfo *iface) @@ -58,6 +61,13 @@ if (!ref) { TRACE("destroying %p\n", iface); + heap_free(reginfo->description); + heap_free(reginfo->author); + heap_free(reginfo->version); + heap_free(reginfo->date); + heap_free(reginfo->documentation); + heap_free(reginfo->uri); + heap_free(reginfo->source); heap_free(reginfo); } @@ -113,62 +123,132 @@ static HRESULT WINAPI RegistrationInfo_get_Description(IRegistrationInfo *iface, BSTR *description) { - FIXME("%p,%p: stub\n", iface, description); - return E_NOTIMPL; + registration_info *reginfo = impl_from_IRegistrationInfo(iface); + + TRACE("%p,%p\n", iface, description); + + if (!description) return E_POINTER; + + *description = SysAllocString(reginfo->description); + return S_OK; } static HRESULT WINAPI RegistrationInfo_put_Description(IRegistrationInfo *iface, BSTR description) { - FIXME("%p,%p: stub\n", iface, debugstr_w(description)); - return E_NOTIMPL; + registration_info *reginfo = impl_from_IRegistrationInfo(iface); + + TRACE("%p,%p\n", iface, debugstr_w(description)); + + if (!description) return E_INVALIDARG; + + heap_free(reginfo->description); + reginfo->description = heap_strdupW(description); + /* FIXME: update XML on the server side */ + return reginfo->description ? S_OK : E_OUTOFMEMORY; } static HRESULT WINAPI RegistrationInfo_get_Author(IRegistrationInfo *iface, BSTR *author) { - FIXME("%p,%p: stub\n", iface, author); - return E_NOTIMPL; + registration_info *reginfo = impl_from_IRegistrationInfo(iface); + + TRACE("%p,%p\n", iface, author); + + if (!author) return E_POINTER; + + *author = SysAllocString(reginfo->author); + return S_OK; } static HRESULT WINAPI RegistrationInfo_put_Author(IRegistrationInfo *iface, BSTR author) { - FIXME("%p,%p: stub\n", iface, debugstr_w(author)); - return E_NOTIMPL; + registration_info *reginfo = impl_from_IRegistrationInfo(iface); + + TRACE("%p,%p\n", iface, debugstr_w(author)); + + if (!author) return E_INVALIDARG; + + heap_free(reginfo->author); + reginfo->author = heap_strdupW(author); + /* FIXME: update XML on the server side */ + return reginfo->author ? S_OK : E_OUTOFMEMORY; } static HRESULT WINAPI RegistrationInfo_get_Version(IRegistrationInfo *iface, BSTR *version) { - FIXME("%p,%p: stub\n", iface, version); - return E_NOTIMPL; + registration_info *reginfo = impl_from_IRegistrationInfo(iface); + + TRACE("%p,%p\n", iface, version); + + if (!version) return E_POINTER; + + *version = SysAllocString(reginfo->version); + return S_OK; } static HRESULT WINAPI RegistrationInfo_put_Version(IRegistrationInfo *iface, BSTR version) { - FIXME("%p,%p: stub\n", iface, debugstr_w(version)); - return E_NOTIMPL; + registration_info *reginfo = impl_from_IRegistrationInfo(iface); + + TRACE("%p,%p\n", iface, debugstr_w(version)); + + if (!version) return E_INVALIDARG; + + heap_free(reginfo->version); + reginfo->version = heap_strdupW(version); + /* FIXME: update XML on the server side */ + return reginfo->version ? S_OK : E_OUTOFMEMORY; } static HRESULT WINAPI RegistrationInfo_get_Date(IRegistrationInfo *iface, BSTR *date) { - FIXME("%p,%p: stub\n", iface, date); - return E_NOTIMPL; + registration_info *reginfo = impl_from_IRegistrationInfo(iface); + + TRACE("%p,%p\n", iface, date); + + if (!date) return E_POINTER; + + *date = SysAllocString(reginfo->date); + return S_OK; } static HRESULT WINAPI RegistrationInfo_put_Date(IRegistrationInfo *iface, BSTR date) { - FIXME("%p,%p: stub\n", iface, debugstr_w(date)); - return E_NOTIMPL; + registration_info *reginfo = impl_from_IRegistrationInfo(iface); + + TRACE("%p,%p\n", iface, debugstr_w(date)); + + if (!date) return E_INVALIDARG; + + heap_free(reginfo->date); + reginfo->date = heap_strdupW(date); + /* FIXME: update XML on the server side */ + return reginfo->date ? S_OK : E_OUTOFMEMORY; } static HRESULT WINAPI RegistrationInfo_get_Documentation(IRegistrationInfo *iface, BSTR *doc) { - FIXME("%p,%p: stub\n", iface, doc); - return E_NOTIMPL; + registration_info *reginfo = impl_from_IRegistrationInfo(iface); + + TRACE("%p,%p\n", iface, doc); + + if (!doc) return E_POINTER; + + *doc = SysAllocString(reginfo->documentation); + return S_OK; } static HRESULT WINAPI RegistrationInfo_put_Documentation(IRegistrationInfo *iface, BSTR doc) { - FIXME("%p,%p: stub\n", iface, debugstr_w(doc)); - return E_NOTIMPL; + registration_info *reginfo = impl_from_IRegistrationInfo(iface); + + TRACE("%p,%p\n", iface, debugstr_w(doc)); + + if (!doc) return E_INVALIDARG; + + heap_free(reginfo->documentation); + reginfo->documentation = heap_strdupW(doc); + /* FIXME: update XML on the server side */ + return reginfo->documentation ? S_OK : E_OUTOFMEMORY; } static HRESULT WINAPI RegistrationInfo_get_XmlText(IRegistrationInfo *iface, BSTR *xml) @@ -185,14 +265,28 @@ static HRESULT WINAPI RegistrationInfo_get_URI(IRegistrationInfo *iface, BSTR *uri) { - FIXME("%p,%p: stub\n", iface, uri); - return E_NOTIMPL; + registration_info *reginfo = impl_from_IRegistrationInfo(iface); + + TRACE("%p,%p\n", iface, uri); + + if (!uri) return E_POINTER; + + *uri = SysAllocString(reginfo->uri); + return S_OK; } static HRESULT WINAPI RegistrationInfo_put_URI(IRegistrationInfo *iface, BSTR uri) { - FIXME("%p,%p: stub\n", iface, debugstr_w(uri)); - return E_NOTIMPL; + registration_info *reginfo = impl_from_IRegistrationInfo(iface); + + TRACE("%p,%p\n", iface, debugstr_w(uri)); + + if (!uri) return E_INVALIDARG; + + heap_free(reginfo->uri); + reginfo->uri = heap_strdupW(uri); + /* FIXME: update XML on the server side */ + return reginfo->uri ? S_OK : E_OUTOFMEMORY; } static HRESULT WINAPI RegistrationInfo_get_SecurityDescriptor(IRegistrationInfo *iface, VARIANT *sddl) @@ -209,14 +303,28 @@ static HRESULT WINAPI RegistrationInfo_get_Source(IRegistrationInfo *iface, BSTR *source) { - FIXME("%p,%p: stub\n", iface, source); - return E_NOTIMPL; + registration_info *reginfo = impl_from_IRegistrationInfo(iface); + + TRACE("%p,%p\n", iface, source); + + if (!source) return E_POINTER; + + *source = SysAllocString(reginfo->source); + return S_OK; } static HRESULT WINAPI RegistrationInfo_put_Source(IRegistrationInfo *iface, BSTR source) { - FIXME("%p,%p: stub\n", iface, debugstr_w(source)); - return E_NOTIMPL; + registration_info *reginfo = impl_from_IRegistrationInfo(iface); + + TRACE("%p,%p\n", iface, debugstr_w(source)); + + if (!source) return E_INVALIDARG; + + heap_free(reginfo->source); + reginfo->source = heap_strdupW(source); + /* FIXME: update XML on the server side */ + return reginfo->source ? S_OK : E_OUTOFMEMORY; } static const IRegistrationInfoVtbl RegistrationInfo_vtbl = @@ -1236,49 +1344,49 @@ push_indent(); hr = IRegistrationInfo_get_Source(reginfo, &bstr); - if (hr == S_OK) + if (hr == S_OK && bstr) { hr = write_text_value(stream, Source, bstr); SysFreeString(bstr); if (hr != S_OK) return hr; } hr = IRegistrationInfo_get_Date(reginfo, &bstr); - if (hr == S_OK) + if (hr == S_OK && bstr) { hr = write_text_value(stream, Date, bstr); SysFreeString(bstr); if (hr != S_OK) return hr; } hr = IRegistrationInfo_get_Author(reginfo, &bstr); - if (hr == S_OK) + if (hr == S_OK && bstr) { hr = write_text_value(stream, Author, bstr); SysFreeString(bstr); if (hr != S_OK) return hr; } hr = IRegistrationInfo_get_Version(reginfo, &bstr); - if (hr == S_OK) + if (hr == S_OK && bstr) { hr = write_text_value(stream, Version, bstr); SysFreeString(bstr); if (hr != S_OK) return hr; } hr = IRegistrationInfo_get_Description(reginfo, &bstr); - if (hr == S_OK) + if (hr == S_OK && bstr) { hr = write_text_value(stream, Description, bstr); SysFreeString(bstr); if (hr != S_OK) return hr; } hr = IRegistrationInfo_get_Documentation(reginfo, &bstr); - if (hr == S_OK) + if (hr == S_OK && bstr) { hr = write_text_value(stream, Documentation, bstr); SysFreeString(bstr); if (hr != S_OK) return hr; } hr = IRegistrationInfo_get_URI(reginfo, &bstr); - if (hr == S_OK) + if (hr == S_OK && bstr) { hr = write_text_value(stream, URI, bstr); SysFreeString(bstr); @@ -2170,6 +2278,7 @@ static HRESULT WINAPI TaskDefinition_put_XmlText(ITaskDefinition *iface, BSTR xml) { + TaskDefinition *taskdef = impl_from_ITaskDefinition(iface); HRESULT hr; IStream *stream; IXmlReader *reader; @@ -2203,7 +2312,35 @@ hr = IXmlReader_SetInput(reader, (IUnknown *)stream); if (hr == S_OK) + { + if (taskdef->reginfo) + { + IRegistrationInfo_Release(taskdef->reginfo); + taskdef->reginfo = NULL; + } + if (taskdef->taskset) + { + ITaskSettings_Release(taskdef->taskset); + taskdef->taskset = NULL; + } + if (taskdef->triggers) + { + ITriggerCollection_Release(taskdef->triggers); + taskdef->triggers = NULL; + } + if (taskdef->principal) + { + IPrincipal_Release(taskdef->principal); + taskdef->principal = NULL; + } + if (taskdef->actions) + { + IActionCollection_Release(taskdef->actions); + taskdef->actions = NULL; + } + hr = read_xml(reader, iface); + } IXmlReader_Release(reader); IStream_Release(stream); @@ -2257,6 +2394,7 @@ ITaskService ITaskService_iface; LONG ref; BOOL connected; + DWORD version; WCHAR comp_name[MAX_COMPUTERNAME_LENGTH + 1]; } TaskService; @@ -2370,11 +2508,70 @@ (V_VT(var) == VT_BSTR && (V_BSTR(var) == NULL || !*V_BSTR(var))); } +static HRESULT start_schedsvc(void) +{ + static const WCHAR scheduleW[] = { 'S','c','h','e','d','u','l','e',0 }; + SC_HANDLE scm, service; + SERVICE_STATUS_PROCESS status; + ULONGLONG start_time; + HRESULT hr = SCHED_E_SERVICE_NOT_RUNNING; + + TRACE("Trying to start %s service\n", debugstr_w(scheduleW)); + + scm = OpenSCManagerW(NULL, NULL, 0); + if (!scm) return SCHED_E_SERVICE_NOT_INSTALLED; + + service = OpenServiceW(scm, scheduleW, SERVICE_START | SERVICE_QUERY_STATUS); + if (service) + { + if (StartServiceW(service, 0, NULL) || GetLastError() == ERROR_SERVICE_ALREADY_RUNNING) + { + start_time = GetTickCount64(); + do + { + DWORD dummy; + + if (!QueryServiceStatusEx(service, SC_STATUS_PROCESS_INFO, (BYTE *)&status, sizeof(status), &dummy)) + { + WARN("failed to query scheduler status (%u)\n", GetLastError()); + break; + } + + if (status.dwCurrentState == SERVICE_RUNNING) + { + hr = S_OK; + break; + } + + if (GetTickCount64() - start_time > 30000) break; + Sleep(1000); + + } while (status.dwCurrentState == SERVICE_START_PENDING); + + if (status.dwCurrentState != SERVICE_RUNNING) + WARN("scheduler failed to start %u\n", status.dwCurrentState); + } + else + WARN("failed to start scheduler service (%u)\n", GetLastError()); + + CloseServiceHandle(service); + } + else + WARN("failed to open scheduler service (%u)\n", GetLastError()); + + CloseServiceHandle(scm); + return hr; +} + static HRESULT WINAPI TaskService_Connect(ITaskService *iface, VARIANT server, VARIANT user, VARIANT domain, VARIANT password) { + static WCHAR ncalrpc[] = { 'n','c','a','l','r','p','c',0 }; TaskService *task_svc = impl_from_ITaskService(iface); WCHAR comp_name[MAX_COMPUTERNAME_LENGTH + 1]; DWORD len; + HRESULT hr; + RPC_WSTR binding_str; + extern handle_t rpc_handle; TRACE("%p,%s,%s,%s,%s\n", iface, debugstr_variant(&server), debugstr_variant(&user), debugstr_variant(&domain), debugstr_variant(&password)); @@ -2408,6 +2605,21 @@ } } + hr = start_schedsvc(); + if (hr != S_OK) return hr; + + 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); + + /* Make sure that the connection works */ + hr = SchRpcHighestVersion(&task_svc->version); + if (hr != S_OK) return hr; + + TRACE("server version %#x\n", task_svc->version); + strcpyW(task_svc->comp_name, comp_name); task_svc->connected = TRUE; @@ -2458,8 +2670,18 @@ static HRESULT WINAPI TaskService_get_HighestVersion(ITaskService *iface, DWORD *version) { - FIXME("%p,%p: stub\n", iface, version); - return E_NOTIMPL; + TaskService *task_svc = impl_from_ITaskService(iface); + + TRACE("%p,%p\n", iface, version); + + if (!version) return E_POINTER; + + if (!task_svc->connected) + return HRESULT_FROM_WIN32(ERROR_ONLY_IF_CONNECTED); + + *version = task_svc->version; + + return S_OK; } static const ITaskServiceVtbl TaskService_vtbl = @@ -2498,3 +2720,13 @@ return S_OK; } + +void __RPC_FAR *__RPC_USER MIDL_user_allocate(SIZE_T n) +{ + return HeapAlloc(GetProcessHeap(), 0, n); +} + +void __RPC_USER MIDL_user_free(void __RPC_FAR *p) +{ + HeapFree(GetProcessHeap(), 0, p); +} diff -Nru wine1.7-1.7.14/dlls/taskschd/taskschd_private.h wine1.7-1.7.18/dlls/taskschd/taskschd_private.h --- wine1.7-1.7.14/dlls/taskschd/taskschd_private.h 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/taskschd/taskschd_private.h 2014-05-02 18:15:48.000000000 +0000 @@ -25,10 +25,11 @@ HRESULT TaskDefinition_create(ITaskDefinition **obj) DECLSPEC_HIDDEN; HRESULT TaskFolder_create(const WCHAR *parent, const WCHAR *path, ITaskFolder **obj, BOOL create) DECLSPEC_HIDDEN; HRESULT TaskFolderCollection_create(const WCHAR *path, ITaskFolderCollection **obj) DECLSPEC_HIDDEN; -HRESULT RegisteredTask_create(const WCHAR *path, const WCHAR *name, ITaskDefinition *definition, TASK_LOGON_TYPE logon, - IRegisteredTask **obj, BOOL create) DECLSPEC_HIDDEN; +HRESULT RegisteredTask_create(const WCHAR *path, const WCHAR *name, ITaskDefinition *definition, LONG flags, + TASK_LOGON_TYPE logon, IRegisteredTask **obj, BOOL create) DECLSPEC_HIDDEN; HRESULT RegisteredTaskCollection_create(const WCHAR *path, IRegisteredTaskCollection **obj) DECLSPEC_HIDDEN; +WCHAR *get_full_path(const WCHAR *parent, const WCHAR *path) DECLSPEC_HIDDEN; const char *debugstr_variant(const VARIANT *v) DECLSPEC_HIDDEN; static void *heap_alloc_zero(SIZE_T size) __WINE_ALLOC_SIZE(1); diff -Nru wine1.7-1.7.14/dlls/taskschd/tests/scheduler.c wine1.7-1.7.18/dlls/taskschd/tests/scheduler.c --- wine1.7-1.7.14/dlls/taskschd/tests/scheduler.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/taskschd/tests/scheduler.c 2014-05-02 18:15:48.000000000 +0000 @@ -341,7 +341,6 @@ ITaskFolder_Release(subfolder); hr = ITaskFolder_DeleteFolder(folder, Wine, 0); -todo_wine ok(hr == HRESULT_FROM_WIN32(ERROR_DIR_NOT_EMPTY), "expected ERROR_DIR_NOT_EMPTY, got %#x\n", hr); hr = ITaskFolder_DeleteFolder(folder, Wine_Folder1_Folder2, 0); @@ -754,34 +753,24 @@ ITaskFolder_DeleteTask(root, Wine_Task2, 0); ITaskFolder_DeleteFolder(root, Wine, 0); - if (0) /* FIXME: Uncomment once implemented */ - { - hr = ITaskFolder_GetTask(root, Wine_Task1, &task1); - ok(hr == HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND), "expected ERROR_PATH_NOT_FOUND, got %#x\n", hr); - } + hr = ITaskFolder_GetTask(root, Wine_Task1, &task1); + ok(hr == HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND), "expected ERROR_PATH_NOT_FOUND, got %#x\n", hr); + hr = ITaskFolder_CreateFolder(root, Wine, v_null, &folder); ok(hr == S_OK, "CreateFolder error %#x\n", hr); - if (0) /* FIXME: Uncomment once implemented */ - { - hr = ITaskFolder_GetTask(root, Wine, &task1); - ok(hr == HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND), "expected ERROR_PATH_NOT_FOUND, got %#x\n", hr); - } + hr = ITaskFolder_GetTask(root, Wine, &task1); + ok(hr == HRESULT_FROM_WIN32(ERROR_PATH_NOT_FOUND), "expected ERROR_PATH_NOT_FOUND, got %#x\n", hr); MultiByteToWideChar(CP_ACP, 0, xml1, -1, xmlW, sizeof(xmlW)/sizeof(xmlW[0])); for (i = 0; i < sizeof(create_new_task)/sizeof(create_new_task[0]); i++) { hr = ITaskFolder_RegisterTask(root, Wine_Task1, xmlW, create_new_task[i].flags, v_null, v_null, TASK_LOGON_NONE, v_null, &task1); -/* FIXME: Remove once Wine is fixed */ -if (create_new_task[i].hr != S_OK) todo_wine - ok(hr == create_new_task[i].hr, "%d: expected %#x, got %#x\n", i, create_new_task[i].hr, hr); -else ok(hr == create_new_task[i].hr, "%d: expected %#x, got %#x\n", i, create_new_task[i].hr, hr); if (hr == S_OK) { hr = ITaskFolder_DeleteTask(root, Wine_Task1, 0); -todo_wine ok(hr == S_OK, "DeleteTask error %#x\n", hr); } } @@ -800,11 +789,9 @@ ok(hr == S_OK, "RegisterTask error %#x\n", hr); hr = ITaskFolder_RegisterTask(root, Wine_Task1, xmlW, TASK_CREATE, v_null, v_null, TASK_LOGON_NONE, v_null, &task1); -todo_wine ok(hr == HRESULT_FROM_WIN32(ERROR_ALREADY_EXISTS), "expected ERROR_ALREADY_EXISTS, got %#x\n", hr); hr = ITaskFolder_RegisterTask(root, Wine_Task1, xmlW, 0, v_null, v_null, TASK_LOGON_NONE, v_null, NULL); -todo_wine ok(hr == HRESULT_FROM_WIN32(ERROR_ALREADY_EXISTS), "expected ERROR_ALREADY_EXISTS, got %#x\n", hr); hr = ITaskFolder_RegisterTask(root, Wine_Task1, xmlW, TASK_CREATE_OR_UPDATE, v_null, v_null, TASK_LOGON_NONE, v_null, &task1); @@ -813,22 +800,14 @@ 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); -/* FIXME: Remove once Wine is fixed */ -if (open_existing_task[i].hr != S_OK) todo_wine - ok(hr == open_existing_task[i].hr, "%d: expected %#x, got %#x\n", i, open_existing_task[i].hr, hr); -else ok(hr == open_existing_task[i].hr, "%d: expected %#x, got %#x\n", i, open_existing_task[i].hr, hr); } hr = IRegisteredTask_get_Name(task1, NULL); -todo_wine ok(hr == E_POINTER, "expected E_POINTER, got %#x\n", hr); hr = IRegisteredTask_get_Name(task1, &bstr); -todo_wine ok(hr == S_OK, "get_Name error %#x\n", hr); - /* FIXME: Remove once implemented */ - if (hr != S_OK) goto failed; ok(!lstrcmpW(bstr, Task1), "expected Task1, got %s\n", wine_dbgstr_w(bstr)); SysFreeString(bstr); hr = IRegisteredTask_get_Path(task1, &bstr); @@ -862,9 +841,11 @@ SysFreeString(bstr); hr = IRegisteredTask_get_State(task2, &state); ok(hr == S_OK, "get_State error %#x\n", hr); +todo_wine ok(state == TASK_STATE_READY, "expected TASK_STATE_READY, got %d\n", state); hr = IRegisteredTask_get_Enabled(task2, &vbool); ok(hr == S_OK, "get_Enabled error %#x\n", hr); +todo_wine ok(vbool == VARIANT_TRUE, "expected VARIANT_TRUE, got %d\n", vbool); IRegisteredTask_Release(task2); @@ -894,12 +875,15 @@ ok(vbool == VARIANT_FALSE, "expected VARIANT_FALSE, got %d\n", vbool); hr = IRegisteredTask_put_Enabled(task1, VARIANT_TRUE); +todo_wine ok(hr == S_OK, "put_Enabled error %#x\n", hr); hr = IRegisteredTask_get_State(task1, &state); ok(hr == S_OK, "get_State error %#x\n", hr); +todo_wine ok(state == TASK_STATE_READY, "expected TASK_STATE_READY, got %d\n", state); hr = IRegisteredTask_get_Enabled(task1, &vbool); ok(hr == S_OK, "get_Enabled error %#x\n", hr); +todo_wine ok(vbool == VARIANT_TRUE, "expected VARIANT_TRUE, got %d\n", vbool); IRegisteredTask_Release(task1); @@ -917,14 +901,22 @@ SysFreeString(bstr); hr = IRegisteredTask_get_State(task2, &state); ok(hr == S_OK, "get_State error %#x\n", hr); +todo_wine ok(state == TASK_STATE_READY, "expected TASK_STATE_READY, got %d\n", state); hr = IRegisteredTask_get_Enabled(task2, &vbool); ok(hr == S_OK, "get_Enabled error %#x\n", hr); +todo_wine ok(vbool == VARIANT_TRUE, "expected VARIANT_TRUE, got %d\n", vbool); + hr = IRegisteredTask_get_State(task2, NULL); + ok(hr == E_POINTER, "expected E_POINTER, got %#x\n", hr); + hr = IRegisteredTask_get_Enabled(task2, NULL); + ok(hr == E_POINTER, "expected E_POINTER, got %#x\n", hr); + IRegisteredTask_Release(task2); hr = ITaskFolder_DeleteTask(folder, NULL, 0); +todo_wine ok(hr == HRESULT_FROM_WIN32(ERROR_DIR_NOT_EMPTY), "expected ERROR_DIR_NOT_EMPTY, got %#x\n", hr); hr = ITaskFolder_DeleteTask(root, Wine_Task1, 0); @@ -948,7 +940,9 @@ hr = ITaskFolder_DeleteTask(root, bstr, 0); ok(hr == S_OK, "DeleteTask error %#x\n", hr); -failed: + hr = ITaskFolder_RegisterTask(folder, NULL, xmlW, TASK_CREATE, v_null, v_null, TASK_LOGON_NONE, v_null, &task1); + ok(hr == E_INVALIDARG, "expected E_INVALIDARG, got %#x\n", hr); + ITaskFolder_Release(folder); hr = ITaskFolder_DeleteFolder(root, Wine, 0); @@ -1264,6 +1258,7 @@ " \n" " \n" "\n"; + static WCHAR Task1[] = { '"','T','a','s','k','1','"',0 }; static struct settings def_settings = { { 0 }, { 'P','T','7','2','H',0 }, { 0 }, 0, 7, TASK_INSTANCES_IGNORE_NEW, TASK_COMPATIBILITY_V2, VARIANT_TRUE, VARIANT_TRUE, VARIANT_TRUE, VARIANT_TRUE, VARIANT_FALSE, VARIANT_FALSE, VARIANT_TRUE, VARIANT_FALSE, @@ -1275,7 +1270,9 @@ HRESULT hr; ITaskService *service; ITaskDefinition *taskdef; - BSTR xml; + IRegistrationInfo *reginfo; + BSTR xml, bstr; + VARIANT var; WCHAR xmlW[sizeof(xml1)]; hr = CoCreateInstance(&CLSID_TaskScheduler, NULL, CLSCTX_INPROC_SERVER, &IID_ITaskService, (void **)&service); @@ -1347,6 +1344,57 @@ hr = ITaskDefinition_put_XmlText(taskdef, xmlW); ok(hr == SCHED_E_MALFORMEDXML, "expected SCHED_E_MALFORMEDXML, got %#x\n", hr); + /* test registration info */ + MultiByteToWideChar(CP_ACP, 0, xml1, -1, xmlW, sizeof(xmlW)/sizeof(xmlW[0])); + hr = ITaskDefinition_put_XmlText(taskdef, xmlW); + ok(hr == S_OK, "put_XmlText error %#x\n", hr); + hr = ITaskDefinition_get_RegistrationInfo(taskdef, ®info); + ok(hr == S_OK, "get_RegistrationInfo error %#x\n", hr); + + hr = IRegistrationInfo_get_Description(reginfo, &bstr); + ok(hr == S_OK, "get_Description error %#x\n", hr); + ok(!lstrcmpW(bstr, Task1), "expected Task1, got %s\n", wine_dbgstr_w(bstr)); + SysFreeString(bstr); + hr = IRegistrationInfo_get_Author(reginfo, &bstr); + ok(hr == S_OK, "get_Author error %#x\n", hr); + ok(!bstr, "expected NULL, got %s\n", wine_dbgstr_w(bstr)); + hr = IRegistrationInfo_get_Version(reginfo, &bstr); + ok(hr == S_OK, "get_Version error %#x\n", hr); + ok(!bstr, "expected NULL, got %s\n", wine_dbgstr_w(bstr)); + hr = IRegistrationInfo_get_Date(reginfo, &bstr); + ok(hr == S_OK, "get_Date error %#x\n", hr); + ok(!bstr, "expected NULL, got %s\n", wine_dbgstr_w(bstr)); + hr = IRegistrationInfo_get_Documentation(reginfo, &bstr); + ok(hr == S_OK, "get_Documentation error %#x\n", hr); + ok(!bstr, "expected NULL, got %s\n", wine_dbgstr_w(bstr)); + hr = IRegistrationInfo_get_URI(reginfo, &bstr); + ok(hr == S_OK, "get_URI error %#x\n", hr); + ok(!bstr, "expected NULL, got %s\n", wine_dbgstr_w(bstr)); + hr = IRegistrationInfo_get_Source(reginfo, &bstr); + ok(hr == S_OK, "get_Source error %#x\n", hr); + ok(!bstr, "expected NULL, got %s\n", wine_dbgstr_w(bstr)); + V_VT(&var) = VT_BSTR; + V_BSTR(&var) = NULL; + hr = IRegistrationInfo_get_SecurityDescriptor(reginfo, &var); +todo_wine + ok(hr == S_OK, "get_SecurityDescriptor error %#x\n", hr); +if (hr == S_OK) + ok(V_VT(&var) == VT_EMPTY, "expected VT_EMPTY, got %u\n", V_VT(&var)); + + IRegistrationInfo_Release(reginfo); + + MultiByteToWideChar(CP_ACP, 0, xml4, -1, xmlW, sizeof(xmlW)/sizeof(xmlW[0])); + hr = ITaskDefinition_put_XmlText(taskdef, xmlW); + ok(hr == S_OK, "put_XmlText error %#x\n", hr); + hr = ITaskDefinition_get_RegistrationInfo(taskdef, ®info); + ok(hr == S_OK, "get_RegistrationInfo error %#x\n", hr); + + hr = IRegistrationInfo_get_Description(reginfo, &bstr); + ok(hr == S_OK, "get_Description error %#x\n", hr); +if (hr == S_OK) + ok(!bstr, "expected NULL, got %s\n", wine_dbgstr_w(bstr)); + + IRegistrationInfo_Release(reginfo); ITaskDefinition_Release(taskdef); ITaskService_Release(service); } diff -Nru wine1.7-1.7.14/dlls/urlmon/tests/misc.c wine1.7-1.7.18/dlls/urlmon/tests/misc.c --- wine1.7-1.7.14/dlls/urlmon/tests/misc.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/urlmon/tests/misc.c 2014-05-02 18:15:48.000000000 +0000 @@ -1740,7 +1740,8 @@ char *name; HKEY feature_control; HKEY feature; - DWORD value, skip_zone; + DWORD value; + BOOL skip_zone; BOOL delete_feature_key = TRUE; static const char* szFeatureBehaviorsKey = "FEATURE_BEHAVIORS"; @@ -1805,11 +1806,11 @@ if (res == ERROR_ACCESS_DENIED) { skip("Not allowed to modify zone elevation\n"); - skip_zone = 1; + skip_zone = TRUE; } else { - skip_zone = 0; + skip_zone = FALSE; ok(res == ERROR_SUCCESS, "RegSetValueEx failed: %d\n", res); hres = pCoInternetIsFeatureEnabled(FEATURE_ZONE_ELEVATION, GET_FEATURE_FROM_PROCESS); diff -Nru wine1.7-1.7.14/dlls/urlmon/tests/sec_mgr.c wine1.7-1.7.18/dlls/urlmon/tests/sec_mgr.c --- wine1.7-1.7.14/dlls/urlmon/tests/sec_mgr.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/urlmon/tests/sec_mgr.c 2014-05-02 18:15:48.000000000 +0000 @@ -65,6 +65,11 @@ expect_ ## func = called_ ## func = FALSE; \ }while(0) +#define SET_CALLED(func) \ + do { \ + expect_ ## func = called_ ## func = FALSE; \ + }while(0) + DEFINE_EXPECT(ParseUrl_SECURITY_URL_input); DEFINE_EXPECT(ParseUrl_SECURITY_URL_input2); DEFINE_EXPECT(ParseUrl_SECURITY_URL_expected); @@ -509,15 +514,26 @@ */ res = RegOpenKeyA(HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\3", &hkey); - if(res != ERROR_SUCCESS) { - ok(0, "Could not open zone key\n"); + ok(res == ERROR_SUCCESS, "Could not open zone key\n"); + if(res != ERROR_SUCCESS) return; - } wsprintfA(buf, "%X", action); size = sizeof(DWORD); res = RegQueryValueExA(hkey, buf, NULL, NULL, (BYTE*)®_policy, &size); RegCloseKey(hkey); + + /* Try settings from HKEY_LOCAL_MACHINE. */ + if(res != ERROR_SUCCESS || size != sizeof(DWORD)) { + res = RegOpenKeyA(HKEY_LOCAL_MACHINE, + "Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings\\Zones\\3", &hkey); + ok(res == ERROR_SUCCESS, "Could not open zone key\n"); + + size = sizeof(DWORD); + res = RegQueryValueExA(hkey, buf, NULL, NULL, (BYTE*)®_policy, &size); + RegCloseKey(hkey); + } + if(res != ERROR_SUCCESS || size != sizeof(DWORD)) { policy = 0xdeadbeef; hres = IInternetSecurityManager_ProcessUrlAction(secmgr, url9, action, (BYTE*)&policy, @@ -1213,10 +1229,10 @@ ok((pZA->cbSize == 0xffffffff) || (pZA->cbSize == sizeof(ZONEATTRIBUTES)), "got cbSize = 0x%x (expected 0xffffffff)\n", pZA->cbSize); - /* IE8 no longer fail on invalid zones */ + /* IE8 up to IE10 don't fail on invalid zones */ memset(buffer, -1, sizeof(buffer)); hr = IInternetZoneManager_GetZoneAttributes(zonemgr, 0xdeadbeef, pZA); - ok(hr == S_OK || (hr == E_FAIL), + ok(hr == S_OK || hr == E_FAIL || hr == E_POINTER, "got 0x%x (expected S_OK or E_FAIL)\n", hr); hr = IInternetZoneManager_GetZoneAttributes(zonemgr, 0, NULL); @@ -1958,6 +1974,16 @@ testcases[i].policy_flags = URLPOLICY_ALLOW; } + /* IE10 does not seem to use passed ISecurityManager */ + SET_EXPECT(ProcessUrlAction); + pCoInternetIsFeatureZoneElevationEnabled(url1, url1, &security_manager, 0); + i = called_ProcessUrlAction; + SET_CALLED(ProcessUrlAction); + if(!i) { + skip("CoInternetIsFeatureZoneElevationEnabled does not use passed ISecurityManager\n"); + return; + } + for(i=0; istr_props[Uri_PROPERTY_RAW_URI].value, wine_dbgstr_w(raw_uri)); SysFreeString(raw_uri); + IPersistStream_Release(persist_stream); hr = IUri_QueryInterface(uri, &IID_IMarshal, (void**)&marshal); ok(hr == S_OK, "%d) QueryInterface(IID_IMarshal) failed 0x%08x, expected S_OK.\n", i, hr); @@ -11395,7 +11397,6 @@ IMarshal_Release(marshal); IStream_Release(stream); - IPersistStream_Release(persist_stream); IUri_Release(uri); heap_free(uriW); } diff -Nru wine1.7-1.7.14/dlls/user32/clipboard.c wine1.7-1.7.18/dlls/user32/clipboard.c --- wine1.7-1.7.14/dlls/user32/clipboard.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/user32/clipboard.c 2014-05-02 18:15:48.000000000 +0000 @@ -580,3 +580,21 @@ TRACE("returning %x\n", seqno); return seqno; } + +/************************************************************************** + * AddClipboardFormatListener (USER32.@) + */ +BOOL WINAPI AddClipboardFormatListener(HWND hwnd) +{ + FIXME("%p: stub\n", hwnd); + return TRUE; +} + +/************************************************************************** + * RemoveClipboardFormatListener (USER32.@) + */ +BOOL WINAPI RemoveClipboardFormatListener(HWND hwnd) +{ + FIXME("%p: stub\n", hwnd); + return TRUE; +} diff -Nru wine1.7-1.7.14/dlls/user32/driver.c wine1.7-1.7.18/dlls/user32/driver.c --- wine1.7-1.7.14/dlls/user32/driver.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/user32/driver.c 2014-05-02 18:15:48.000000000 +0000 @@ -457,9 +457,8 @@ { } -static int CDECL nulldrv_SetWindowRgn( HWND hwnd, HRGN hrgn, BOOL redraw ) +static void CDECL nulldrv_SetWindowRgn( HWND hwnd, HRGN hrgn, BOOL redraw ) { - return 1; } static void CDECL nulldrv_SetWindowIcon( HWND hwnd, UINT type, HICON icon ) @@ -757,9 +756,9 @@ load_driver()->pSetLayeredWindowAttributes( hwnd, key, alpha, flags ); } -static int CDECL loaderdrv_SetWindowRgn( HWND hwnd, HRGN hrgn, BOOL redraw ) +static void CDECL loaderdrv_SetWindowRgn( HWND hwnd, HRGN hrgn, BOOL redraw ) { - return load_driver()->pSetWindowRgn( hwnd, hrgn, redraw ); + load_driver()->pSetWindowRgn( hwnd, hrgn, redraw ); } static BOOL CDECL loaderdrv_UpdateLayeredWindow( HWND hwnd, const UPDATELAYEREDWINDOWINFO *info, diff -Nru wine1.7-1.7.14/dlls/user32/edit.c wine1.7-1.7.18/dlls/user32/edit.c --- wine1.7-1.7.14/dlls/user32/edit.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/user32/edit.c 2014-05-02 18:15:48.000000000 +0000 @@ -2914,7 +2914,7 @@ default_right_margin = tm.tmAveCharWidth / 2; min_size = calc_min_set_margin_size(dc, default_left_margin, default_right_margin); GetClientRect(es->hwndSelf, &rc); - if(rc.right - rc.left < min_size) { + if (!IsRectEmpty(&rc) && (rc.right - rc.left < min_size)) { default_left_margin = es->left_margin; default_right_margin = es->right_margin; } @@ -3244,14 +3244,11 @@ /********************************************************************* * - * WM_COMMAND + * EDIT_ContextMenuCommand * */ -static void EDIT_WM_Command(EDITSTATE *es, INT code, INT id, HWND control) +static void EDIT_ContextMenuCommand(EDITSTATE *es, UINT id) { - if (code || control) - return; - switch (id) { case EM_UNDO: SendMessageW(es->hwndSelf, WM_UNDO, 0, 0); @@ -3269,8 +3266,7 @@ SendMessageW(es->hwndSelf, WM_CLEAR, 0, 0); break; case EM_SETSEL: - EDIT_EM_SetSel(es, 0, (UINT)-1, FALSE); - EDIT_EM_ScrollCaret(es); + SendMessageW(es->hwndSelf, EM_SETSEL, 0, -1); break; default: ERR("unknown menu item, please report\n"); @@ -3301,6 +3297,7 @@ HMENU popup = GetSubMenu(menu, 0); UINT start = es->selection_start; UINT end = es->selection_end; + UINT cmd; ORDER_UINT(start, end); @@ -3329,7 +3326,12 @@ if (!(es->flags & EF_FOCUSED)) SetFocus(es->hwndSelf); - TrackPopupMenu(popup, TPM_LEFTALIGN | TPM_RIGHTBUTTON, x, y, 0, es->hwndSelf, NULL); + cmd = TrackPopupMenu(popup, TPM_LEFTALIGN | TPM_RIGHTBUTTON | TPM_RETURNCMD | TPM_NONOTIFY, + x, y, 0, es->hwndSelf, NULL); + + if (cmd) + EDIT_ContextMenuCommand(es, cmd); + DestroyMenu(menu); } @@ -4984,10 +4986,6 @@ EDIT_WM_Clear(es); break; - case WM_COMMAND: - EDIT_WM_Command(es, HIWORD(wParam), LOWORD(wParam), (HWND)lParam); - break; - case WM_CONTEXTMENU: EDIT_WM_ContextMenu(es, (short)LOWORD(lParam), (short)HIWORD(lParam)); break; diff -Nru wine1.7-1.7.14/dlls/user32/focus.c wine1.7-1.7.18/dlls/user32/focus.c --- wine1.7-1.7.14/dlls/user32/focus.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/user32/focus.c 2014-05-02 18:15:48.000000000 +0000 @@ -277,6 +277,7 @@ HWND parent; LONG style = GetWindowLongW( hwndTop, GWL_STYLE ); if (style & (WS_MINIMIZE | WS_DISABLED)) return 0; + if (!(style & WS_CHILD)) break; parent = GetAncestor( hwndTop, GA_PARENT ); if (!parent || parent == GetDesktopWindow()) { diff -Nru wine1.7-1.7.14/dlls/user32/listbox.c wine1.7-1.7.18/dlls/user32/listbox.c --- wine1.7-1.7.14/dlls/user32/listbox.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/user32/listbox.c 2014-05-02 18:15:48.000000000 +0000 @@ -83,7 +83,7 @@ INT item_height; /* Default item height */ INT page_size; /* Items per listbox page */ INT column_width; /* Column width for multi-column listboxes */ - INT horz_extent; /* Horizontal extent (0 if no hscroll) */ + INT horz_extent; /* Horizontal extent */ INT horz_pos; /* Horizontal position */ INT nb_tabs; /* Number of tabs in array */ INT *tabs; /* Array of tabs */ @@ -265,17 +265,14 @@ if (descr->style & WS_VSCROLL) SetScrollInfo( descr->self, SB_VERT, &info, TRUE ); - if (descr->horz_extent) + if (descr->style & WS_HSCROLL) { - info.nMin = 0; - info.nMax = descr->horz_extent - 1; info.nPos = descr->horz_pos; info.nPage = descr->width; - info.fMask = SIF_RANGE | SIF_POS | SIF_PAGE; + info.fMask = SIF_POS | SIF_PAGE; if (descr->style & LBS_DISABLENOSCROLL) info.fMask |= SIF_DISABLENOSCROLL; - if (descr->style & WS_HSCROLL) - SetScrollInfo( descr->self, SB_HORZ, &info, TRUE ); + SetScrollInfo( descr->self, SB_HORZ, &info, TRUE ); } } } @@ -1239,16 +1236,21 @@ */ static LRESULT LISTBOX_SetHorizontalExtent( LB_DESCR *descr, INT extent ) { - if (!descr->horz_extent || (descr->style & LBS_MULTICOLUMN)) + if (descr->style & LBS_MULTICOLUMN) return LB_OKAY; - if (extent <= 0) extent = 1; if (extent == descr->horz_extent) return LB_OKAY; TRACE("[%p]: new horz extent = %d\n", descr->self, extent ); descr->horz_extent = extent; + if (descr->style & WS_HSCROLL) { + SCROLLINFO info; + info.cbSize = sizeof(info); + info.nMin = 0; + info.nMax = descr->horz_extent ? descr->horz_extent - 1 : 0; + info.fMask = SIF_RANGE; + SetScrollInfo( descr->self, SB_HORZ, &info, TRUE ); + } if (descr->horz_pos > extent - descr->width) LISTBOX_SetHorizontalPos( descr, extent - descr->width ); - else - LISTBOX_UpdateScroll( descr ); return LB_OKAY; } @@ -2485,7 +2487,7 @@ descr->item_height = 1; descr->page_size = 1; descr->column_width = 150; - descr->horz_extent = (descr->style & WS_HSCROLL) ? 1 : 0; + descr->horz_extent = 0; descr->horz_pos = 0; descr->nb_tabs = 0; descr->tabs = NULL; diff -Nru wine1.7-1.7.14/dlls/user32/menu.c wine1.7-1.7.18/dlls/user32/menu.c --- wine1.7-1.7.14/dlls/user32/menu.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/user32/menu.c 2014-05-02 18:15:48.000000000 +0000 @@ -1817,6 +1817,41 @@ /*********************************************************************** + * MENU_InitPopup + * + * Popup menu initialization before WM_ENTERMENULOOP. + */ +static BOOL MENU_InitPopup( HWND hwndOwner, HMENU hmenu, UINT flags ) +{ + POPUPMENU *menu; + DWORD ex_style = 0; + + TRACE("owner=%p hmenu=%p\n", hwndOwner, hmenu); + + if (!(menu = MENU_GetMenu( hmenu ))) return FALSE; + + /* store the owner for DrawItem */ + if (!IsWindow( hwndOwner )) + { + SetLastError( ERROR_INVALID_WINDOW_HANDLE ); + return FALSE; + } + menu->hwndOwner = hwndOwner; + + if (flags & TPM_LAYOUTRTL) + ex_style = WS_EX_LAYOUTRTL; + + /* NOTE: In Windows, top menu popup is not owned. */ + menu->hWnd = CreateWindowExW( ex_style, (LPCWSTR)POPUPMENU_CLASS_ATOM, NULL, + WS_POPUP, 0, 0, 0, 0, + hwndOwner, 0, (HINSTANCE)GetWindowLongPtrW(hwndOwner, GWLP_HINSTANCE), + (LPVOID)hmenu ); + if( !menu->hWnd ) return FALSE; + return TRUE; +} + + +/*********************************************************************** * MENU_ShowPopup * * Display a popup menu. @@ -1829,7 +1864,6 @@ POINT pt; HMONITOR monitor; MONITORINFO info; - DWORD ex_style = 0; TRACE("owner=%p hmenu=%p id=0x%04x x=0x%04x y=0x%04x xa=0x%04x ya=0x%04x\n", hwndOwner, hmenu, id, x, y, xanchor, yanchor); @@ -1841,14 +1875,6 @@ menu->FocusedItem = NO_SELECTED_ITEM; } - /* store the owner for DrawItem */ - if (!IsWindow( hwndOwner )) - { - SetLastError( ERROR_INVALID_WINDOW_HANDLE ); - return FALSE; - } - menu->hwndOwner = hwndOwner; - menu->nScrollPos = 0; MENU_PopupMenuCalcSize( menu ); @@ -1865,10 +1891,7 @@ GetMonitorInfoW( monitor, &info ); if (flags & TPM_LAYOUTRTL) - { - ex_style = WS_EX_LAYOUTRTL; flags ^= TPM_RIGHTALIGN; - } if( flags & TPM_RIGHTALIGN ) x -= width; if( flags & TPM_CENTERALIGN ) x -= width / 2; @@ -1896,20 +1919,14 @@ } if( y < info.rcWork.top ) y = info.rcWork.top; - /* NOTE: In Windows, top menu popup is not owned. */ - menu->hWnd = CreateWindowExW( ex_style, (LPCWSTR)POPUPMENU_CLASS_ATOM, NULL, - WS_POPUP, x, y, width, height, - hwndOwner, 0, (HINSTANCE)GetWindowLongPtrW(hwndOwner, GWLP_HINSTANCE), - (LPVOID)hmenu ); - if( !menu->hWnd ) return FALSE; if (!top_popup) { top_popup = menu->hWnd; top_popup_hmenu = hmenu; } /* Display the window */ - SetWindowPos( menu->hWnd, HWND_TOPMOST, 0, 0, 0, 0, - SWP_SHOWWINDOW | SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE ); + SetWindowPos( menu->hWnd, HWND_TOPMOST, x, y, width, height, + SWP_SHOWWINDOW | SWP_NOACTIVATE ); UpdateWindow( menu->hWnd ); return TRUE; } @@ -2386,6 +2403,8 @@ /* use default alignment for submenus */ wFlags &= ~(TPM_CENTERALIGN | TPM_RIGHTALIGN | TPM_VCENTERALIGN | TPM_BOTTOMALIGN); + MENU_InitPopup( hwndOwner, item->hSubMenu, wFlags ); + MENU_ShowPopup( hwndOwner, item->hSubMenu, menu->FocusedItem, wFlags, rect.left, rect.top, rect.right, rect.bottom ); if (selectFirst) @@ -2996,7 +3015,6 @@ TRACE("hmenu=%p flags=0x%08x (%d,%d) hwnd=%p %s\n", hmenu, wFlags, x, y, hwnd, wine_dbgstr_rect( lprect)); - fEndMenu = FALSE; if (!(menu = MENU_GetMenu( hmenu ))) { WARN("Invalid menu handle %p\n", hmenu); @@ -3287,12 +3305,20 @@ HideCaret(0); + if (!(menu = MENU_GetMenu( hMenu ))) return FALSE; + /* This makes the menus of applications built with Delphi work. * It also enables menus to be displayed in more than one window, * but there are some bugs left that need to be fixed in this case. */ - if ((menu = MENU_GetMenu( hMenu ))) menu->hWnd = hWnd; - if (!top_popup) top_popup_hmenu = hMenu; + if (!bPopup) menu->hWnd = hWnd; + if (!top_popup) + { + top_popup = menu->hWnd; + top_popup_hmenu = hMenu; + } + + fEndMenu = FALSE; /* Send WM_ENTERMENULOOP and WM_INITMENU message only if TPM_NONOTIFY flag is not specified */ if (!(wFlags & TPM_NONOTIFY)) @@ -3442,16 +3468,29 @@ return FALSE; } - MENU_InitTracking(hWnd, hMenu, TRUE, wFlags); + if (MENU_InitPopup( hWnd, hMenu, wFlags )) + { + MENU_InitTracking(hWnd, hMenu, TRUE, wFlags); - /* Send WM_INITMENUPOPUP message only if TPM_NONOTIFY flag is not specified */ - if (!(wFlags & TPM_NONOTIFY)) - SendMessageW( hWnd, WM_INITMENUPOPUP, (WPARAM)hMenu, 0); + /* Send WM_INITMENUPOPUP message only if TPM_NONOTIFY flag is not specified */ + if (!(wFlags & TPM_NONOTIFY)) + SendMessageW( hWnd, WM_INITMENUPOPUP, (WPARAM)hMenu, 0); - if (MENU_ShowPopup( hWnd, hMenu, 0, wFlags, x, y, 0, 0 )) - ret = MENU_TrackMenu( hMenu, wFlags | TPM_POPUPMENU, 0, 0, hWnd, - lpTpm ? &lpTpm->rcExclude : NULL ); - MENU_ExitTracking(hWnd, TRUE); + if (MENU_ShowPopup( hWnd, hMenu, 0, wFlags, x, y, 0, 0 )) + ret = MENU_TrackMenu( hMenu, wFlags | TPM_POPUPMENU, 0, 0, hWnd, + lpTpm ? &lpTpm->rcExclude : NULL ); + MENU_ExitTracking(hWnd, TRUE); + + if (menu->hWnd) + { + DestroyWindow( menu->hWnd ); + menu->hWnd = 0; + + if (!(wFlags & TPM_NONOTIFY)) + SendMessageW( hWnd, WM_UNINITMENUPOPUP, (WPARAM)hMenu, + MAKELPARAM(0, IS_SYSTEM_MENU(menu)) ); + } + } return ret; } @@ -3820,7 +3859,7 @@ pmii->fMask |= MIIM_DATA; pmii->dwItemData = (ULONG_PTR) str; } - if( flags & MF_POPUP) { + if( flags & MF_POPUP && MENU_GetMenu((HMENU)id)) { pmii->fMask |= MIIM_SUBMENU; pmii->hSubMenu = (HMENU)id; } @@ -4328,17 +4367,18 @@ BOOL WINAPI DrawMenuBar( HWND hWnd ) { LPPOPUPMENU lppop; - HMENU hMenu = GetMenu(hWnd); + HMENU hMenu; - if (!WIN_ALLOWED_MENU(GetWindowLongW( hWnd, GWL_STYLE ))) + if (!IsWindow( hWnd )) return FALSE; - if (!hMenu || !(lppop = MENU_GetMenu( hMenu ))) return FALSE; - lppop->Height = 0; /* Make sure we call MENU_MenuBarCalcSize */ - lppop->hwndOwner = hWnd; - SetWindowPos( hWnd, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | - SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED ); - return TRUE; + if ((hMenu = GetMenu( hWnd )) && (lppop = MENU_GetMenu( hMenu ))) { + lppop->Height = 0; /* Make sure we call MENU_MenuBarCalcSize */ + lppop->hwndOwner = hWnd; + } + + return SetWindowPos( hWnd, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | + SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED ); } /*********************************************************************** diff -Nru wine1.7-1.7.14/dlls/user32/message.c wine1.7-1.7.18/dlls/user32/message.c --- wine1.7-1.7.14/dlls/user32/message.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/user32/message.c 2014-05-02 18:15:48.000000000 +0000 @@ -2778,6 +2778,11 @@ if (res) { HeapFree( GetProcessHeap(), 0, buffer ); + if (res == STATUS_PENDING) + { + thread_info->wake_mask = changed_mask & (QS_SENDMESSAGE | QS_SMRESULT); + thread_info->changed_mask = changed_mask; + } if (res != STATUS_BUFFER_OVERFLOW) return FALSE; if (!(buffer = HeapAlloc( GetProcessHeap(), 0, buffer_size ))) return FALSE; continue; @@ -3001,6 +3006,7 @@ */ static void wait_message_reply( UINT flags ) { + struct user_thread_info *thread_info = get_user_thread_info(); HANDLE server_queue = get_server_queue_handle(); for (;;) @@ -3017,6 +3023,8 @@ } SERVER_END_REQ; + thread_info->wake_mask = thread_info->changed_mask = 0; + if (wake_bits & QS_SMRESULT) return; /* got a result */ if (wake_bits & QS_SENDMESSAGE) { @@ -3029,6 +3037,43 @@ } } + +/*********************************************************************** + * wait_objects + * + * Wait for multiple objects including the server queue, with specific queue masks. + */ +static DWORD wait_objects( DWORD count, const HANDLE *handles, DWORD timeout, + DWORD wake_mask, DWORD changed_mask, DWORD flags ) +{ + struct user_thread_info *thread_info = get_user_thread_info(); + DWORD ret; + + assert( count ); /* we must have at least the server queue */ + + flush_window_surfaces( TRUE ); + + if (thread_info->wake_mask != wake_mask || thread_info->changed_mask != changed_mask) + { + SERVER_START_REQ( set_queue_mask ) + { + req->wake_mask = wake_mask; + req->changed_mask = changed_mask; + req->skip_wait = 0; + wine_server_call( req ); + } + SERVER_END_REQ; + thread_info->wake_mask = wake_mask; + thread_info->changed_mask = changed_mask; + } + + ret = wow_handlers.wait_message( count, handles, timeout, changed_mask, flags ); + + if (ret != WAIT_TIMEOUT) thread_info->wake_mask = thread_info->changed_mask = 0; + return ret; +} + + /*********************************************************************** * put_message_in_queue * @@ -3771,8 +3816,7 @@ while (!peek_message( msg, hwnd, first, last, PM_REMOVE | (mask << 16), mask )) { - flush_window_surfaces( TRUE ); - wow_handlers.wait_message( 1, &server_queue, INFINITE, mask, 0 ); + wait_objects( 1, &server_queue, INFINITE, mask & (QS_SENDMESSAGE | QS_SMRESULT), mask, 0 ); } check_for_driver_events( msg->message ); @@ -4093,22 +4137,12 @@ return WAIT_FAILED; } - /* set the queue mask */ - SERVER_START_REQ( set_queue_mask ) - { - req->wake_mask = (flags & MWMO_INPUTAVAILABLE) ? mask : 0; - req->changed_mask = mask; - req->skip_wait = 0; - wine_server_call( req ); - } - SERVER_END_REQ; - /* add the queue to the handle list */ for (i = 0; i < count; i++) handles[i] = pHandles[i]; handles[count] = get_server_queue_handle(); - flush_window_surfaces( TRUE ); - return wow_handlers.wait_message( count+1, handles, timeout, mask, flags ); + return wait_objects( count+1, handles, timeout, + (flags & MWMO_INPUTAVAILABLE) ? mask : 0, mask, flags ); } @@ -4405,9 +4439,7 @@ if (proc) winproc = WINPROC_AllocProc( (WNDPROC)proc, FALSE ); - /* MSDN states that the minimum timeout should be USER_TIMER_MINIMUM (10.0 ms), but testing - * indicates that the true minimum is closer to 15.6 ms. */ - timeout = min( max( 15, timeout ), USER_TIMER_MAXIMUM ); + timeout = min( max( USER_TIMER_MINIMUM, timeout ), USER_TIMER_MAXIMUM ); SERVER_START_REQ( set_win_timer ) { @@ -4440,9 +4472,7 @@ if (proc) winproc = WINPROC_AllocProc( (WNDPROC)proc, FALSE ); - /* MSDN states that the minimum timeout should be USER_TIMER_MINIMUM (10.0 ms), but testing - * indicates that the true minimum is closer to 15.6 ms. */ - timeout = min( max( 15, timeout ), USER_TIMER_MAXIMUM ); + timeout = min( max( USER_TIMER_MINIMUM, timeout ), USER_TIMER_MAXIMUM ); SERVER_START_REQ( set_win_timer ) { @@ -4577,3 +4607,12 @@ FIXME( "%x %08x\n", message, flag ); return TRUE; } + +/****************************************************************** + * ChangeWindowMessageFilterEx (USER32.@) + */ +BOOL WINAPI ChangeWindowMessageFilterEx( HWND hwnd, UINT message, DWORD action, CHANGEFILTERSTRUCT *changefilter ) +{ + FIXME( "%p %x %d %p\n", hwnd, message, action, changefilter ); + return TRUE; +} diff -Nru wine1.7-1.7.14/dlls/user32/misc.c wine1.7-1.7.18/dlls/user32/misc.c --- wine1.7-1.7.14/dlls/user32/misc.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/user32/misc.c 2014-05-02 18:15:48.000000000 +0000 @@ -419,6 +419,9 @@ MONITORINFOEXA *miA = (MONITORINFOEXA*)lpMonitorInfo; BOOL ret; + if((miA->cbSize != sizeof(MONITORINFOEXA)) && (miA->cbSize != sizeof(MONITORINFO))) + return FALSE; + miW.cbSize = sizeof(miW); ret = GetMonitorInfoW(hMonitor, (MONITORINFO*)&miW); @@ -427,7 +430,7 @@ miA->rcMonitor = miW.rcMonitor; miA->rcWork = miW.rcWork; miA->dwFlags = miW.dwFlags; - if(miA->cbSize >= offsetof(MONITORINFOEXA, szDevice) + sizeof(miA->szDevice)) + if(miA->cbSize == sizeof(MONITORINFOEXA)) WideCharToMultiByte(CP_ACP, 0, miW.szDevice, -1, miA->szDevice, sizeof(miA->szDevice), NULL, NULL); return ret; } @@ -437,7 +440,12 @@ */ BOOL WINAPI GetMonitorInfoW(HMONITOR hMonitor, LPMONITORINFO lpMonitorInfo) { - BOOL ret = USER_Driver->pGetMonitorInfo( hMonitor, lpMonitorInfo ); + BOOL ret; + + if (lpMonitorInfo->cbSize != sizeof(MONITORINFOEXW) && lpMonitorInfo->cbSize != sizeof(MONITORINFO)) + return FALSE; + + ret = USER_Driver->pGetMonitorInfo( hMonitor, lpMonitorInfo ); if (ret) TRACE("flags %04x, monitor %s, work %s\n", lpMonitorInfo->dwFlags, wine_dbgstr_rect(&lpMonitorInfo->rcMonitor), @@ -667,3 +675,12 @@ FIXME("(%p,%p,%d): stub\n", handle, job, grant); return TRUE; } + +/********************************************************************** + * RegisterPowerSettingNotification [USER32.@] + */ +HPOWERNOTIFY WINAPI RegisterPowerSettingNotification(HANDLE recipient, const GUID *guid, DWORD flags) +{ + FIXME("(%p,%s,%x): stub\n", recipient, debugstr_guid(guid), flags); + return NULL; +} diff -Nru wine1.7-1.7.14/dlls/user32/msgbox.c wine1.7-1.7.18/dlls/user32/msgbox.c --- wine1.7-1.7.14/dlls/user32/msgbox.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/user32/msgbox.c 2014-05-02 18:15:48.000000000 +0000 @@ -61,9 +61,9 @@ return TRUE; } -static HFONT MSGBOX_OnInit(HWND hwnd, LPMSGBOXPARAMSW lpmb) +static void MSGBOX_OnInit(HWND hwnd, LPMSGBOXPARAMSW lpmb) { - HFONT hFont = 0, hPrevFont = 0; + HFONT hPrevFont; RECT rect; HWND hItem; HDC hdc; @@ -84,15 +84,6 @@ nclm.cbSize = sizeof(nclm); SystemParametersInfoW (SPI_GETNONCLIENTMETRICS, 0, &nclm, 0); - hFont = CreateFontIndirectW (&nclm.lfMessageFont); - /* set button font */ - for (i = IDOK; i <= IDCONTINUE; i++) - /* no close button */ - if (i != IDCLOSE) - SendDlgItemMessageW (hwnd, i, WM_SETFONT, (WPARAM)hFont, 0); - - /* set text font */ - SendDlgItemMessageW (hwnd, MSGBOX_IDTEXT, WM_SETFONT, (WPARAM)hFont, 0); if (!IS_INTRESOURCE(lpmb->lpszCaption)) { SetWindowTextW(hwnd, lpmb->lpszCaption); @@ -229,8 +220,7 @@ iwidth = rect.right - ileft; hdc = GetDC(hwnd); - if (hFont) - hPrevFont = SelectObject(hdc, hFont); + hPrevFont = SelectObject( hdc, (HFONT)SendMessageW( hwnd, WM_GETFONT, 0, 0 )); /* Get the number of visible buttons and their size */ bh = bw = 1; /* Minimum button sizes */ @@ -270,8 +260,7 @@ twidth = max((bw + bspace) * buttons + bspace - tleft, rect.right); theight = rect.bottom; - if (hFont) - SelectObject(hdc, hPrevFont); + SelectObject(hdc, hPrevFont); ReleaseDC(hwnd, hdc); tiheight = 16 + max(iheight, theight); @@ -319,7 +308,6 @@ SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE); HeapFree( GetProcessHeap(), 0, buffer ); - return hFont; } @@ -331,15 +319,12 @@ static INT_PTR CALLBACK MSGBOX_DlgProc( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam ) { - HFONT hFont; - switch(message) { case WM_INITDIALOG: { LPMSGBOXPARAMSW mbp = (LPMSGBOXPARAMSW)lParam; SetWindowContextHelpId(hwnd, mbp->dwContextHelpId); - hFont = MSGBOX_OnInit(hwnd, mbp); - SetPropA(hwnd, "WINE_MSGBOX_HFONT", hFont); + MSGBOX_OnInit(hwnd, mbp); SetPropA(hwnd, "WINE_MSGBOX_HELPCALLBACK", mbp->lpfnMsgBoxCallback); break; } @@ -356,10 +341,7 @@ case IDNO: case IDTRYAGAIN: case IDCONTINUE: - hFont = GetPropA(hwnd, "WINE_MSGBOX_HFONT"); EndDialog(hwnd, wParam); - if (hFont) - DeleteObject(hFont); break; case IDHELP: FIXME("Help button not supported yet\n"); diff -Nru wine1.7-1.7.14/dlls/user32/nonclient.c wine1.7-1.7.18/dlls/user32/nonclient.c --- wine1.7-1.7.14/dlls/user32/nonclient.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/user32/nonclient.c 2014-05-02 18:15:48.000000000 +0000 @@ -1396,7 +1396,15 @@ { case HTCAPTION: { - HWND top = GetAncestor( hwnd, GA_ROOT ); + HWND top = hwnd, parent; + while(1) + { + if ((GetWindowLongW( top, GWL_STYLE ) & (WS_POPUP|WS_CHILD)) != WS_CHILD) + break; + parent = GetAncestor( top, GA_PARENT ); + if (!parent || parent == GetDesktopWindow()) break; + top = parent; + } if (FOCUS_MouseActivate( top ) || (GetActiveWindow() == top)) SendMessageW( hwnd, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, lParam ); diff -Nru wine1.7-1.7.14/dlls/user32/tests/edit.c wine1.7-1.7.18/dlls/user32/tests/edit.c --- wine1.7-1.7.14/dlls/user32/tests/edit.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/user32/tests/edit.c 2014-05-02 18:15:48.000000000 +0000 @@ -1299,6 +1299,7 @@ len = SendMessageA(hWnd, WM_GETTEXTLENGTH, 0, 0); ok(lstrlenA(str) == len, "text shouldn't have been truncated\n"); DestroyWindow(hWnd); + DestroyWindow(parentWnd); } /* Test WM_GETTEXT processing @@ -1423,6 +1424,8 @@ RECT old_rect, new_rect; INT old_right_margin; DWORD old_margins, new_margins; + LOGFONTA lf; + HFONT hfont; hwEdit = create_editcontrol(WS_BORDER | ES_AUTOHSCROLL | ES_AUTOVSCROLL, 0); @@ -1470,6 +1473,46 @@ ok(new_rect.bottom == old_rect.bottom, "The bottom border of the rectangle has changed\n"); DestroyWindow (hwEdit); + + memset(&lf, 0, sizeof(lf)); + lf.lfHeight = -11; + lf.lfWeight = FW_NORMAL; + lf.lfCharSet = DEFAULT_CHARSET; + strcpy(lf.lfFaceName, "Tahoma"); + + hfont = CreateFontIndirectA(&lf); + ok(hfont != NULL, "got %p\n", hfont); + + /* Empty window rectangle */ + hwEdit = CreateWindowExA(0, "Edit", "A", WS_POPUP, 0, 0, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, NULL, NULL); + ok(hwEdit != NULL, "got %p\n", hwEdit); + GetClientRect(hwEdit, &old_rect); + ok(IsRectEmpty(&old_rect), "got rect %d,%d-%d,%d\n", old_rect.left, old_rect.top, old_rect.right, old_rect.bottom); + + old_margins = SendMessageA(hwEdit, EM_GETMARGINS, 0, 0); + ok(old_margins == 0, "got %x\n", old_margins); + + SendMessageA(hwEdit, WM_SETFONT, (WPARAM)hfont, MAKELPARAM(TRUE, 0)); + old_margins = SendMessageA(hwEdit, EM_GETMARGINS, 0, 0); + ok(HIWORD(old_margins) > 0 && LOWORD(old_margins) > 0, "got %d, %d\n", HIWORD(old_margins), LOWORD(old_margins)); + + DestroyWindow(hwEdit); + + /* Size is not enough to display a text, but not empty */ + hwEdit = CreateWindowExA(0, "Edit", "A", WS_POPUP, 0, 0, 2, 2, NULL, NULL, NULL, NULL); + ok(hwEdit != NULL, "got %p\n", hwEdit); + GetClientRect(hwEdit, &old_rect); + ok(!IsRectEmpty(&old_rect), "got rect %d,%d-%d,%d\n", old_rect.left, old_rect.top, old_rect.right, old_rect.bottom); + + old_margins = SendMessageA(hwEdit, EM_GETMARGINS, 0, 0); + ok(old_margins == 0, "got %x\n", old_margins); + + SendMessageA(hwEdit, WM_SETFONT, (WPARAM)hfont, MAKELPARAM(TRUE, 0)); + old_margins = SendMessageA(hwEdit, EM_GETMARGINS, 0, 0); + ok(old_margins == 0, "got %d, %d\n", HIWORD(old_margins), LOWORD(old_margins)); + + DeleteObject(hfont); + DestroyWindow(hwEdit); } static INT CALLBACK find_font_proc(const LOGFONTA *elf, const TEXTMETRICA *ntm, DWORD type, LPARAM lParam) @@ -2200,9 +2243,49 @@ return p_edit_proc(hWnd, msg, wParam, lParam); } +struct context_menu_messages +{ + unsigned int wm_command, em_setsel; +}; + +static struct context_menu_messages menu_messages; + +static LRESULT CALLBACK child_edit_menu_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + switch (msg) { + case WM_ENTERIDLE: + if (wParam == MSGF_MENU) { + HWND hwndMenu = (HWND)lParam; + MENUBARINFO mbi = { sizeof(MENUBARINFO) }; + if (pGetMenuBarInfo(hwndMenu, OBJID_CLIENT, 0, &mbi)) { + MENUITEMINFOA mii = { sizeof(MENUITEMINFOA), MIIM_STATE }; + if (GetMenuItemInfoA(mbi.hMenu, EM_SETSEL, FALSE, &mii)) { + if (mii.fState & MFS_HILITE) { + PostMessageA(hwnd, WM_KEYDOWN, VK_RETURN, 0x1c0001); + PostMessageA(hwnd, WM_KEYUP, VK_RETURN, 0x1c0001); + } + else { + PostMessageA(hwnd, WM_KEYDOWN, VK_DOWN, 0x500001); + PostMessageA(hwnd, WM_KEYUP, VK_DOWN, 0x500001); + } + } + } + } + break; + case WM_COMMAND: + menu_messages.wm_command++; + break; + case EM_SETSEL: + menu_messages.em_setsel++; + break; + } + return CallWindowProcA(p_edit_proc, hwnd, msg, wParam, lParam); +} + static void test_contextmenu(void) { HWND hwndMain, hwndEdit; + MSG msg; hwndMain = CreateWindowA(szEditTest4Class, "ET4", WS_OVERLAPPEDWINDOW|WS_VISIBLE, 0, 0, 200, 200, NULL, NULL, hinst, NULL); @@ -2227,6 +2310,25 @@ } DestroyWindow (hwndEdit); + + hwndEdit = CreateWindowA("EDIT", "Test Text", + WS_CHILD | WS_BORDER | WS_VISIBLE, + 0, 0, 100, 100, + hwndMain, NULL, hinst, NULL); + memset(&menu_messages, 0, sizeof(menu_messages)); + p_edit_proc = (void*)SetWindowLongPtrA(hwndEdit, GWLP_WNDPROC, + (ULONG_PTR)child_edit_menu_proc); + + SetFocus(hwndEdit); + SendMessageA(hwndEdit, WM_SETTEXT, 0, (LPARAM)"foo"); + SendMessageA(hwndEdit, WM_CONTEXTMENU, (WPARAM)hwndEdit, MAKEWORD(-1, -1)); + while (PeekMessageA(&msg, hwndEdit, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); + ok(menu_messages.wm_command == 0, + "Expected no WM_COMMAND messages, got %d\n", menu_messages.wm_command); + ok(menu_messages.em_setsel == 1, + "Expected 1 EM_SETSEL message, got %d\n", menu_messages.em_setsel); + + DestroyWindow (hwndEdit); DestroyWindow (hwndMain); } diff -Nru wine1.7-1.7.14/dlls/user32/tests/listbox.c wine1.7-1.7.18/dlls/user32/tests/listbox.c --- wine1.7-1.7.14/dlls/user32/tests/listbox.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/user32/tests/listbox.c 2014-05-02 18:15:48.000000000 +0000 @@ -1617,6 +1617,83 @@ DestroyWindow(parent); } +static void test_extents(void) +{ + HWND listbox, parent; + DWORD res; + SCROLLINFO sinfo; + BOOL br; + + parent = create_parent(); + + listbox = create_listbox(WS_CHILD | WS_VISIBLE, 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 == 100, "got wrong max: %u\n", sinfo.nMax); + + 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 == 100, "got wrong max: %u\n", sinfo.nMax); + + DestroyWindow(listbox); + + + listbox = create_listbox(WS_CHILD | WS_VISIBLE | WS_HSCROLL, 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 == 100, "got wrong max: %u\n", sinfo.nMax); + + 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); + + 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); + + DestroyWindow(listbox); + + DestroyWindow(parent); +} + START_TEST(listbox) { const struct listbox_test SS = @@ -1698,4 +1775,5 @@ test_set_count(); test_GetListBoxInfo(); test_missing_lbuttonup(); + test_extents(); } diff -Nru wine1.7-1.7.14/dlls/user32/tests/menu.c wine1.7-1.7.18/dlls/user32/tests/menu.c --- wine1.7-1.7.14/dlls/user32/tests/menu.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/user32/tests/menu.c 2014-05-02 18:15:48.000000000 +0000 @@ -147,7 +147,10 @@ static BOOL MOD_GotDrawItemMsg = FALSE; static int gflag_initmenupopup, gflag_entermenuloop, - gflag_initmenu; + gflag_initmenu, + gflag_enteridle; +static WPARAM selectitem_wp; +static LPARAM selectitem_lp; /* wndproc used by test_menu_ownerdraw() */ static LRESULT WINAPI menu_ownerdraw_wnd_proc(HWND hwnd, UINT msg, @@ -236,6 +239,7 @@ } case WM_ENTERIDLE: { + gflag_enteridle++; ok( lparam || broken(!lparam), /* win9x, nt4 */ "Menu window handle is NULL!\n"); if( lparam) { @@ -246,7 +250,10 @@ PostMessageA(hwnd, WM_CANCELMODE, 0, 0); return TRUE; } - + case WM_MENUSELECT: + selectitem_wp = wparam; + selectitem_lp = lparam; + break; } return DefWindowProcA(hwnd, msg, wparam, lparam); } @@ -418,9 +425,7 @@ ok(ret, "DestroyMenu failed with error %d\n", GetLastError()); ret = DrawMenuBar(hwnd); - todo_wine { ok(ret, "DrawMenuBar failed with error %d\n", GetLastError()); - } ret = IsMenu(GetMenu(hwnd)); ok(!ret || broken(ret) /* nt4 */, "Menu handle should have been destroyed\n"); @@ -2505,6 +2510,11 @@ if (mii.hSubMenu) { ok(mii.wID == (UINT_PTR)mii.hSubMenu, "id %u: wID should be equal to hSubMenu\n", checked_cmd); + if (!GetMenuItemCount(mii.hSubMenu)) + { + ok(mii.fType == checked_type, "id %u: expected fType %04x, got %04x\n", checked_cmd, checked_type, mii.fType); + ok(mii.fState == checked_state, "id %u: expected fState %04x, got %04x\n", checked_cmd, checked_state, mii.fState); + } check_menu_items(mii.hSubMenu, checked_cmd, checked_type, checked_state); } else @@ -3244,8 +3254,13 @@ g_hmenu = CreatePopupMenu(); ok(g_hmenu != NULL, "CreateMenu failed with error %d\n", GetLastError()); + ret = AppendMenuA(g_hmenu, MF_STRING , 100, "item 1"); + ok(ret, "AppendMenu failed.\n"); + ret = AppendMenuA(g_hmenu, MF_STRING , 101, "item 2"); + ok(ret, "AppendMenu failed.\n"); + ret = TrackPopupMenu( g_hmenu, 0, 100, 100, 0, hwnd, NULL); - todo_wine ok(ret == FALSE, "got %d\n", ret); + ok(ret == TRUE, "got %d\n", ret); DestroyMenu(g_hmenu); DestroyWindow(hwnd); @@ -3314,17 +3329,11 @@ /* menu owner is top level window */ g_hwndtosend = hwnd; TrackPopupMenu( menu, TPM_RETURNCMD, 100,100, 0, hwnd, NULL); - todo_wine { - ok( g_got_enteridle == 0, "received %d WM_ENTERIDLE messages, none expected\n", g_got_enteridle); - } - ok( g_got_enteridle < 2, "received %d WM_ENTERIDLE messages, should be less than 2\n", g_got_enteridle); + ok( g_got_enteridle == 0, "received %d WM_ENTERIDLE messages, none expected\n", g_got_enteridle); /* menu owner is child window */ g_hwndtosend = hwndchild; TrackPopupMenu( menu, TPM_RETURNCMD, 100,100, 0, hwndchild, NULL); - todo_wine { - ok(g_got_enteridle == 0, "received %d WM_ENTERIDLE messages, none expected\n", g_got_enteridle); - } - ok(g_got_enteridle < 2, "received %d WM_ENTERIDLE messages, should be less than 2\n", g_got_enteridle); + ok(g_got_enteridle == 0, "received %d WM_ENTERIDLE messages, none expected\n", g_got_enteridle); /* now send the WM_CANCELMODE messages to the WRONG window */ /* those should fail ( to have any effect) */ g_hwndtosend = hwnd; @@ -3344,10 +3353,7 @@ ok( ret == 0, "Sending WM_SYSCOMMAND/SC_KEYMENU failed lasterror is %u\n", GetLastError()); while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg); - todo_wine { - ok(g_got_enteridle == 0, "received %d WM_ENTERIDLE messages, none expected\n", g_got_enteridle); - } - ok(g_got_enteridle < 2, "received %d WM_ENTERIDLE messages, should be less than 2\n", g_got_enteridle); + ok(g_got_enteridle == 0, "received %d WM_ENTERIDLE messages, none expected\n", g_got_enteridle); /* cleanup */ DestroyMenu( menubar ); @@ -3517,6 +3523,223 @@ DestroyWindow( hwnd); } +static LRESULT WINAPI menu_fill_in_init(HWND hwnd, UINT msg, + WPARAM wparam, LPARAM lparam) +{ + HMENU hmenupopup; + BOOL ret; + switch (msg) + { + case WM_INITMENUPOPUP: + gflag_initmenupopup++; + hmenupopup = (HMENU) wparam; + ret = AppendMenuA(hmenupopup, MF_STRING , 100, "item 1"); + ok(ret, "AppendMenu failed.\n"); + ret = AppendMenuA(hmenupopup, MF_STRING , 101, "item 2"); + ok(ret, "AppendMenu failed.\n"); + break; + case WM_ENTERMENULOOP: + gflag_entermenuloop++; + break; + case WM_INITMENU: + gflag_initmenu++; + break; + case WM_ENTERIDLE: + gflag_enteridle++; + PostMessageA(hwnd, WM_CANCELMODE, 0, 0); + return TRUE; + case WM_MENUSELECT: + selectitem_wp = wparam; + selectitem_lp = lparam; + break; + } + return DefWindowProcA(hwnd, msg, wparam, lparam); +} + +static void test_emptypopup(void) +{ + BOOL ret; + HMENU hmenu; + + HWND hwnd = CreateWindowExA(0, (LPCSTR)MAKEINTATOM(atomMenuCheckClass), NULL, + WS_VISIBLE, CW_USEDEFAULT, CW_USEDEFAULT, 200, 200, + NULL, NULL, NULL, NULL); + ok(hwnd != NULL, "CreateWindowEx failed with error %d\n", GetLastError()); + SetWindowLongPtrA( hwnd, GWLP_WNDPROC, (LONG_PTR)menu_ownerdraw_wnd_proc); + + hmenu = CreatePopupMenu(); + ok(hmenu != NULL, "CreateMenu failed with error %d\n", GetLastError()); + + gflag_initmenupopup = gflag_entermenuloop = gflag_initmenu = gflag_enteridle = 0; + selectitem_wp = 0xdeadbeef; + selectitem_lp = 0xdeadbeef; + + ret = TrackPopupMenu( hmenu, TPM_RETURNCMD, 100,100, 0, hwnd, NULL); + ok(ret == 0, "got %i\n", ret); + + ok(gflag_initmenupopup == 1, "got %i\n", gflag_initmenupopup); + ok(gflag_entermenuloop == 1, "got %i\n", gflag_entermenuloop); + ok(gflag_initmenu == 1, "got %i\n", gflag_initmenu); + todo_wine ok(gflag_enteridle == 0, "got %i\n", gflag_initmenu); + + todo_wine ok(selectitem_wp == 0xdeadbeef, "got %lx\n", selectitem_wp); + todo_wine ok(selectitem_lp == 0xdeadbeef, "got %lx\n", selectitem_lp); + + gflag_initmenupopup = gflag_entermenuloop = gflag_initmenu = gflag_enteridle = 0; + selectitem_wp = 0xdeadbeef; + selectitem_lp = 0xdeadbeef; + + ret = TrackPopupMenu( hmenu, 0, 100,100, 0, hwnd, NULL); + todo_wine ok(ret == 0, "got %i\n", ret); + + ok(gflag_initmenupopup == 1, "got %i\n", gflag_initmenupopup); + ok(gflag_entermenuloop == 1, "got %i\n", gflag_entermenuloop); + ok(gflag_initmenu == 1, "got %i\n", gflag_initmenu); + todo_wine ok(gflag_enteridle == 0, "got %i\n", gflag_initmenu); + + todo_wine ok(selectitem_wp == 0xdeadbeef, "got %lx\n", selectitem_wp); + todo_wine ok(selectitem_lp == 0xdeadbeef, "got %lx\n", selectitem_lp); + + SetWindowLongPtrA( hwnd, GWLP_WNDPROC, (LONG_PTR)menu_fill_in_init); + + gflag_initmenupopup = gflag_entermenuloop = gflag_initmenu = gflag_enteridle = 0; + selectitem_wp = 0xdeadbeef; + selectitem_lp = 0xdeadbeef; + + ret = TrackPopupMenu( hmenu, 0, 100,100, 0, hwnd, NULL); + ok(ret == 1, "got %i\n", ret); + + ok(gflag_initmenupopup == 1, "got %i\n", gflag_initmenupopup); + ok(gflag_entermenuloop == 1, "got %i\n", gflag_entermenuloop); + ok(gflag_initmenu == 1, "got %i\n", gflag_initmenu); + ok(gflag_enteridle == 1, "got %i\n", gflag_initmenu); + + ok(selectitem_wp == 0xffff0000, "got %lx\n", selectitem_wp); + ok(selectitem_lp == 0, "got %lx\n", selectitem_lp); + + DestroyWindow(hwnd); + + ret = DestroyMenu(hmenu); + ok(ret, "DestroyMenu failed with error %d\n", GetLastError()); +} + +static void test_AppendMenu(void) +{ + MENUITEMINFOA mii; + HMENU hmenu, hsubmenu; + BOOL ret; + + hmenu = CreateMenu(); + ok(hmenu != 0, "CreateMenu failed\n"); + ret = AppendMenuA(hmenu, MF_OWNERDRAW, 201, "item 1"); + ok(ret, "AppendMenu failed\n"); + check_menu_items(hmenu, 201, MF_OWNERDRAW, 0); + DestroyMenu(hmenu); + + hmenu = CreateMenu(); + ok(hmenu != 0, "CreateMenu failed\n"); + ret = AppendMenuA(hmenu, MF_POPUP, 202, "item 1"); + ok(ret, "AppendMenu failed\n"); + check_menu_items(hmenu, 202, MF_STRING, 0); + DestroyMenu(hmenu); + + hmenu = CreateMenu(); + ok(hmenu != 0, "CreateMenu failed\n"); + ret = AppendMenuA(hmenu, MF_OWNERDRAW | MF_POPUP, 203, "item 1"); + ok(ret, "AppendMenu failed\n"); + check_menu_items(hmenu, 203, MF_OWNERDRAW, 0); + DestroyMenu(hmenu); + + hmenu = CreateMenu(); + ok(hmenu != 0, "CreateMenu failed\n"); + hsubmenu = CreateMenu(); + ok(hsubmenu != 0, "CreateMenu failed\n"); + ret = AppendMenuA(hmenu, MF_OWNERDRAW, (UINT_PTR)hsubmenu, "item 1"); + ok(ret, "AppendMenu failed\n"); + check_menu_items(hmenu, (UINT_PTR)hsubmenu, MF_OWNERDRAW, 0); + DestroyMenu(hmenu); + DestroyMenu(hsubmenu); + + hmenu = CreateMenu(); + ok(hmenu != 0, "CreateMenu failed\n"); + hsubmenu = CreateMenu(); + ok(hsubmenu != 0, "CreateMenu failed\n"); + ret = AppendMenuA(hmenu, MF_POPUP, (UINT_PTR)hsubmenu, "item 1"); + ok(ret, "AppendMenu failed\n"); + check_menu_items(hmenu, (UINT_PTR)hsubmenu, MF_STRING, 0); + DestroyMenu(hmenu); + DestroyMenu(hsubmenu); + + hmenu = CreateMenu(); + ok(hmenu != 0, "CreateMenu failed\n"); + hsubmenu = CreateMenu(); + ok(hsubmenu != 0, "CreateMenu failed\n"); + ret = AppendMenuA(hmenu, MF_OWNERDRAW | MF_POPUP, (UINT_PTR)hsubmenu, "item 1"); + ok(ret, "AppendMenu failed\n"); + check_menu_items(hmenu, (UINT_PTR)hsubmenu, MF_OWNERDRAW, 0); + DestroyMenu(hmenu); + DestroyMenu(hsubmenu); + + hmenu = CreateMenu(); + ok(hmenu != 0, "CreateMenu failed\n"); + hsubmenu = CreatePopupMenu(); + ok(hsubmenu != 0, "CreatePopupMenu failed\n"); + ret = AppendMenuA(hmenu, MF_OWNERDRAW, (UINT_PTR)hsubmenu, "item 1"); + ok(ret, "AppendMenu failed\n"); + check_menu_items(hmenu, (UINT_PTR)hsubmenu, MF_OWNERDRAW, 0); + DestroyMenu(hmenu); + DestroyMenu(hsubmenu); + + hmenu = CreateMenu(); + ok(hmenu != 0, "CreateMenu failed\n"); + hsubmenu = CreatePopupMenu(); + ok(hsubmenu != 0, "CreatePopupMenu failed\n"); + ret = AppendMenuA(hmenu, MF_POPUP, (UINT_PTR)hsubmenu, "item 1"); + ok(ret, "AppendMenu failed\n"); + check_menu_items(hmenu, (UINT_PTR)hsubmenu, MF_STRING, 0); + DestroyMenu(hmenu); + DestroyMenu(hsubmenu); + + hmenu = CreateMenu(); + ok(hmenu != 0, "CreateMenu failed\n"); + hsubmenu = CreatePopupMenu(); + ok(hsubmenu != 0, "CreatePopupMenu failed\n"); + ret = AppendMenuA(hmenu, MF_OWNERDRAW | MF_POPUP, (UINT_PTR)hsubmenu, "item 1"); + ok(ret, "AppendMenu failed\n"); + check_menu_items(hmenu, (UINT_PTR)hsubmenu, MF_OWNERDRAW, 0); + DestroyMenu(hmenu); + DestroyMenu(hsubmenu); + + hmenu = CreateMenu(); + ok(hmenu != 0, "CreateMenu failed\n"); + ret = AppendMenuA(hmenu, MF_STRING, 204, "item 1"); + ok(ret, "AppendMenu failed\n"); + check_menu_items(hmenu, 204, MF_STRING, 0); + ret = ModifyMenuA(hmenu, 0, MF_POPUP | MF_BYPOSITION, 205, "item 2"); + ok(ret, "ModifyMenu failed\n"); + check_menu_items(hmenu, 205, MF_STRING, 0); + memset(&mii, 0, sizeof(mii)); + mii.cbSize = sizeof(mii); + mii.fMask = MIIM_SUBMENU; + mii.hSubMenu = (HMENU)204; + ret = InsertMenuItemA(hmenu, 0, TRUE, &mii); + ok(!ret, "InsertMenuItem should fail\n"); + ret = SetMenuItemInfoA(hmenu, 0, TRUE, &mii); + ok(!ret, "SetMenuItemInfo should fail\n"); + mii.fMask = MIIM_ID; + mii.wID = 206; + ret = InsertMenuItemA(hmenu, 0, TRUE, &mii); + ok(ret, "InsertMenuItem failed\n"); +if (0) /* FIXME: uncomment once Wine is fixed */ + check_menu_items(hmenu, 206, MF_SEPARATOR, MFS_GRAYED); + mii.wID = 207; + ret = SetMenuItemInfoA(hmenu, 0, TRUE, &mii); + ok(ret, "SetMenuItemInfo failed\n"); +if (0) /* FIXME: uncomment once Wine is fixed */ + check_menu_items(hmenu, 207, MF_SEPARATOR, MFS_GRAYED); + DestroyMenu(hmenu); +} + START_TEST(menu) { init_function_pointers(); @@ -3553,4 +3776,6 @@ test_menu_cancelmode(); test_menu_maxdepth(); test_menu_circref(); + test_emptypopup(); + test_AppendMenu(); } diff -Nru wine1.7-1.7.14/dlls/user32/tests/monitor.c wine1.7-1.7.18/dlls/user32/tests/monitor.c --- wine1.7-1.7.14/dlls/user32/tests/monitor.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/user32/tests/monitor.c 2014-05-02 18:15:48.000000000 +0000 @@ -30,6 +30,7 @@ static BOOL (WINAPI *pEnumDisplayDevicesA)(LPCSTR,DWORD,LPDISPLAY_DEVICEA,DWORD); static BOOL (WINAPI *pEnumDisplayMonitors)(HDC,LPRECT,MONITORENUMPROC,LPARAM); static BOOL (WINAPI *pGetMonitorInfoA)(HMONITOR,LPMONITORINFO); +static BOOL (WINAPI *pGetMonitorInfoW)(HMONITOR,LPMONITORINFO); static HMONITOR (WINAPI *pMonitorFromPoint)(POINT,DWORD); static HMONITOR (WINAPI *pMonitorFromRect)(LPCRECT,DWORD); static HMONITOR (WINAPI *pMonitorFromWindow)(HWND,DWORD); @@ -48,6 +49,7 @@ GET_PROC(EnumDisplayDevicesA) GET_PROC(EnumDisplayMonitors) GET_PROC(GetMonitorInfoA) + GET_PROC(GetMonitorInfoW) GET_PROC(MonitorFromPoint) GET_PROC(MonitorFromRect) GET_PROC(MonitorFromWindow) @@ -296,6 +298,40 @@ HMONITOR monitor, primary, nearest; POINT pt; RECT rc; + MONITORINFO mi; + MONITORINFOEXA miexa; + MONITORINFOEXW miexw; + BOOL ret; + DWORD i; + + static const struct + { + DWORD cbSize; + BOOL ret; + } testdatami[] = { + {0, FALSE}, + {sizeof(MONITORINFO)+1, FALSE}, + {sizeof(MONITORINFO)-1, FALSE}, + {sizeof(MONITORINFO), TRUE}, + {-1, FALSE}, + {0xdeadbeef, FALSE}, + }, + testdatamiexa[] = { + {0, FALSE}, + {sizeof(MONITORINFOEXA)+1, FALSE}, + {sizeof(MONITORINFOEXA)-1, FALSE}, + {sizeof(MONITORINFOEXA), TRUE}, + {-1, FALSE}, + {0xdeadbeef, FALSE}, + }, + testdatamiexw[] = { + {0, FALSE}, + {sizeof(MONITORINFOEXW)+1, FALSE}, + {sizeof(MONITORINFOEXW)-1, FALSE}, + {sizeof(MONITORINFOEXW), TRUE}, + {-1, FALSE}, + {0xdeadbeef, FALSE}, + }; if (!pMonitorFromPoint || !pMonitorFromWindow || !pMonitorFromRect) { @@ -351,8 +387,6 @@ nearest = primary; while (monitor != NULL) { - MONITORINFO mi; - BOOL ret; ok( monitor != primary, "got primary %p\n", monitor ); nearest = monitor; mi.cbSize = sizeof(mi); @@ -362,6 +396,55 @@ monitor = pMonitorFromRect( &rc, MONITOR_DEFAULTTONULL ); } + /* tests for cbSize in MONITORINFO */ + monitor = pMonitorFromWindow( 0, MONITOR_DEFAULTTOPRIMARY ); + for (i = 0; i < (sizeof(testdatami) / sizeof(testdatami[0])); i++) + { + memset( &mi, 0, sizeof(mi) ); + mi.cbSize = testdatami[i].cbSize; + ret = pGetMonitorInfoA( monitor, &mi ); + ok( ret == testdatami[i].ret, "GetMonitorInfo returned wrong value\n" ); + if (ret) + ok( (mi.dwFlags & MONITORINFOF_PRIMARY), "MONITORINFOF_PRIMARY flag isn't set\n" ); + else + ok( !(mi.dwFlags & MONITORINFOF_PRIMARY), "MONITORINFOF_PRIMARY flag is set\n" ); + + memset( &miexw, 0, sizeof(miexw) ); + miexw.cbSize = testdatamiexw[i].cbSize; + ret = pGetMonitorInfoW( monitor, (LPMONITORINFO)&miexw ); + ok( ret == testdatamiexw[i].ret, "GetMonitorInfo returned wrong value\n" ); + if (ret) + ok( (miexw.dwFlags & MONITORINFOF_PRIMARY), "MONITORINFOF_PRIMARY flag isn't set\n" ); + else + ok( !(miexw.dwFlags & MONITORINFOF_PRIMARY), "MONITORINFOF_PRIMARY flag is set\n" ); + } + + /* tests for cbSize in MONITORINFOEXA */ + for (i = 0; i < (sizeof(testdatamiexa) / sizeof(testdatamiexa[0])); i++) + { + memset( &miexa, 0, sizeof(miexa) ); + miexa.cbSize = testdatamiexa[i].cbSize; + ret = pGetMonitorInfoA( monitor, (LPMONITORINFO)&miexa ); + ok( ret == testdatamiexa[i].ret, "GetMonitorInfo returned wrong value\n" ); + if (ret) + ok( (miexa.dwFlags & MONITORINFOF_PRIMARY), "MONITORINFOF_PRIMARY flag isn't set\n" ); + else + ok( !(miexa.dwFlags & MONITORINFOF_PRIMARY), "MONITORINFOF_PRIMARY flag is set\n" ); + } + + /* tests for cbSize in MONITORINFOEXW */ + for (i = 0; i < (sizeof(testdatamiexw) / sizeof(testdatamiexw[0])); i++) + { + memset( &miexw, 0, sizeof(miexw) ); + miexw.cbSize = testdatamiexw[i].cbSize; + ret = pGetMonitorInfoW( monitor, (LPMONITORINFO)&miexw ); + ok( ret == testdatamiexw[i].ret, "GetMonitorInfo returned wrong value\n" ); + if (ret) + ok( (miexw.dwFlags & MONITORINFOF_PRIMARY), "MONITORINFOF_PRIMARY flag isn't set\n" ); + else + ok( !(miexw.dwFlags & MONITORINFOF_PRIMARY), "MONITORINFOF_PRIMARY flag is set\n" ); + } + SetRect( &rc, rc.left+1, rc.top+1, rc.left+2, rc.top+2 ); monitor = pMonitorFromRect( &rc, MONITOR_DEFAULTTONULL ); diff -Nru wine1.7-1.7.14/dlls/user32/tests/msg.c wine1.7-1.7.18/dlls/user32/tests/msg.c --- wine1.7-1.7.14/dlls/user32/tests/msg.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/user32/tests/msg.c 2014-05-02 18:15:48.000000000 +0000 @@ -444,20 +444,20 @@ { WM_NCPAINT, sent|wparam|optional, 1 }, { WM_GETTEXT, sent|defwinproc|optional }, { WM_ERASEBKGND, sent|optional }, - { HCBT_ACTIVATE, hook }, + { HCBT_ACTIVATE, hook|optional }, { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam, 0, 0 }, { WM_QUERYNEWPALETTE, sent|wparam|lparam|optional, 0, 0 }, { WM_WINDOWPOSCHANGING, sent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE }, { WM_NCPAINT, sent|wparam|optional, 1 }, - { WM_ACTIVATEAPP, sent|wparam, 1 }, - { WM_NCACTIVATE, sent|wparam, 1 }, + { WM_ACTIVATEAPP, sent|wparam|optional, 1 }, + { WM_NCACTIVATE, sent|wparam|optional, 1 }, { WM_GETTEXT, sent|defwinproc|optional }, - { WM_ACTIVATE, sent|wparam, 1 }, - { HCBT_SETFOCUS, hook }, + { WM_ACTIVATE, sent|wparam|optional, 1 }, + { HCBT_SETFOCUS, hook|optional }, { WM_IME_SETCONTEXT, sent|wparam|defwinproc|optional, 1 }, { WM_IME_NOTIFY, sent|wparam|defwinproc|optional, 2 }, { EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 }, - { WM_SETFOCUS, sent|wparam|defwinproc, 0 }, + { WM_SETFOCUS, sent|wparam|defwinproc|optional, 0 }, { WM_GETTEXT, sent|optional }, { WM_NCPAINT, sent|wparam|optional, 1 }, { WM_GETTEXT, sent|defwinproc|optional }, @@ -488,19 +488,19 @@ { WM_GETMINMAXINFO, sent|defwinproc }, { WM_NCCALCSIZE, sent|wparam, TRUE }, { EVENT_OBJECT_SHOW, winevent_hook|wparam|lparam, 0, 0 }, - { HCBT_ACTIVATE, hook }, + { HCBT_ACTIVATE, hook|optional }, { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam, 0, 0 }, { WM_QUERYNEWPALETTE, sent|wparam|lparam|optional, 0, 0 }, { WM_WINDOWPOSCHANGING, sent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE }, - { WM_ACTIVATEAPP, sent|wparam, 1 }, - { WM_NCACTIVATE, sent|wparam, 1 }, + { WM_ACTIVATEAPP, sent|wparam|optional, 1 }, + { WM_NCACTIVATE, sent|wparam|optional, 1 }, { WM_GETTEXT, sent|defwinproc|optional }, - { WM_ACTIVATE, sent|wparam, 1 }, - { HCBT_SETFOCUS, hook }, + { WM_ACTIVATE, sent|wparam|optional, 1 }, + { HCBT_SETFOCUS, hook|optional }, { WM_IME_SETCONTEXT, sent|wparam|defwinproc|optional, 1 }, { WM_IME_NOTIFY, sent|wparam|defwinproc|optional, 2 }, { EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 }, - { WM_SETFOCUS, sent|wparam|defwinproc, 0 }, + { WM_SETFOCUS, sent|wparam|defwinproc|optional, 0 }, { WM_GETTEXT, sent|optional }, { WM_NCPAINT, sent|wparam|optional, 1 }, { WM_GETTEXT, sent|defwinproc|optional }, @@ -549,20 +549,27 @@ { HCBT_MINMAX, hook|lparam, 0, SW_RESTORE }, { WM_QUERYOPEN, sent|optional }, { WM_GETTEXT, sent|optional }, - { WM_WINDOWPOSCHANGING, sent|wparam, SWP_FRAMECHANGED|SWP_STATECHANGED|SWP_NOCOPYBITS }, - { WM_GETMINMAXINFO, sent|defwinproc }, - { WM_NCCALCSIZE, sent|wparam, TRUE }, - { HCBT_ACTIVATE, hook }, + { WM_NCACTIVATE, sent|wparam|optional, 1 }, + { WM_WINDOWPOSCHANGING, sent|optional }, /* SWP_NOSIZE|SWP_NOMOVE */ + { WM_WINDOWPOSCHANGED, sent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE|SWP_NOCLIENTSIZE|SWP_NOCLIENTMOVE }, + { WM_NCCALCSIZE, sent|wparam|optional, TRUE }, + { WM_MOVE, sent|optional }, + { WM_SIZE, sent|wparam|optional, SIZE_RESTORED }, + { WM_GETTEXT, sent|optional }, + { WM_WINDOWPOSCHANGING, sent|wparam|optional, SWP_FRAMECHANGED|SWP_STATECHANGED|SWP_NOCOPYBITS }, + { WM_GETMINMAXINFO, sent|defwinproc|optional }, + { WM_NCCALCSIZE, sent|wparam|optional, TRUE }, + { HCBT_ACTIVATE, hook|optional }, { WM_QUERYNEWPALETTE, sent|wparam|lparam|optional, 0, 0 }, { WM_WINDOWPOSCHANGING, sent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE }, - { WM_ACTIVATEAPP, sent|wparam, 1 }, - { WM_NCACTIVATE, sent|wparam, 1 }, + { WM_ACTIVATEAPP, sent|wparam|optional, 1 }, + { WM_NCACTIVATE, sent|wparam|optional, 1 }, { WM_GETTEXT, sent|defwinproc|optional }, - { WM_ACTIVATE, sent|wparam, 1 }, - { HCBT_SETFOCUS, hook }, + { WM_ACTIVATE, sent|wparam|optional, 1 }, + { HCBT_SETFOCUS, hook|optional }, { WM_IME_SETCONTEXT, sent|wparam|defwinproc|optional, 1 }, { WM_IME_NOTIFY, sent|wparam|defwinproc|optional, 2 }, - { WM_SETFOCUS, sent|wparam|defwinproc, 0 }, + { WM_SETFOCUS, sent|wparam|defwinproc|optional, 0 }, { WM_GETTEXT, sent|optional }, { WM_NCPAINT, sent|wparam|optional, 1 }, { WM_GETTEXT, sent|defwinproc|optional }, @@ -570,9 +577,13 @@ { WM_WINDOWPOSCHANGED, sent|wparam, SWP_STATECHANGED|SWP_FRAMECHANGED|SWP_NOCOPYBITS }, { WM_MOVE, sent|defwinproc }, { WM_SIZE, sent|defwinproc|wparam, SIZE_RESTORED }, + { HCBT_SETFOCUS, hook|optional }, + { WM_SETFOCUS, sent|wparam|optional, 0 }, { WM_NCCALCSIZE, sent|wparam|optional, TRUE }, { WM_NCPAINT, sent|wparam|optional, 1 }, { WM_ERASEBKGND, sent|optional }, + { HCBT_SETFOCUS, hook|optional }, + { WM_SETFOCUS, sent|wparam|optional, 0 }, { WM_ACTIVATE, sent|wparam, 1 }, { WM_GETTEXT, sent|optional }, { WM_PAINT, sent|optional }, @@ -584,9 +595,9 @@ /* ShowWindow(SW_SHOWMINIMIZED) for a not visible overlapped window */ static const struct message WmShowMinOverlappedSeq[] = { { HCBT_MINMAX, hook|lparam, 0, SW_MINIMIZE }, - { HCBT_SETFOCUS, hook }, + { HCBT_SETFOCUS, hook|optional }, { EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 }, - { WM_KILLFOCUS, sent }, + { WM_KILLFOCUS, sent|optional }, { WM_IME_SETCONTEXT, sent|wparam|optional, 0 }, { WM_IME_NOTIFY, sent|wparam|optional|defwinproc, 1 }, { WM_GETTEXT, sent|optional }, @@ -603,10 +614,10 @@ { EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam, 0, 0 }, { EVENT_OBJECT_LOCATIONCHANGE, winevent_hook|wparam|lparam, 0, 0 }, { EVENT_SYSTEM_MINIMIZESTART, winevent_hook|wparam|lparam, 0, 0 }, - { WM_NCACTIVATE, sent|wparam, 0 }, + { WM_NCACTIVATE, sent|wparam|optional, 0 }, { WM_GETTEXT, sent|defwinproc|optional }, - { WM_ACTIVATE, sent }, - { WM_ACTIVATEAPP, sent|wparam, 0 }, + { WM_ACTIVATE, sent|optional }, + { WM_ACTIVATEAPP, sent|wparam|optional, 0 }, /* Vista sometimes restores the window right away... */ { WM_SYSCOMMAND, sent|optional|wparam, SC_RESTORE }, @@ -652,7 +663,7 @@ { WM_ACTIVATE, sent|wparam|optional, 0 }, { WM_ACTIVATEAPP, sent|wparam|optional, 0 }, { HCBT_SETFOCUS, hook|optional }, - { WM_KILLFOCUS, sent|wparam, 0 }, + { WM_KILLFOCUS, sent|wparam|optional, 0 }, { WM_IME_SETCONTEXT, sent|wparam|optional, 0 }, { WM_IME_NOTIFY, sent|wparam|optional|defwinproc, 1 }, { 0 } @@ -1719,6 +1730,72 @@ { 0 } }; +static const struct message WmTrackPopupMenu[] = { + { HCBT_CREATEWND, hook }, + { WM_ENTERMENULOOP, sent|wparam|lparam, TRUE, 0 }, + { WM_INITMENU, sent|lparam, 0, 0 }, + { WM_INITMENUPOPUP, sent|lparam, 0, 0 }, + { 0x0093, sent|optional }, + { 0x0094, sent|optional }, + { 0x0094, sent|optional }, + { WM_ENTERIDLE, sent|wparam, 2 }, + { WM_CAPTURECHANGED, sent }, + { HCBT_DESTROYWND, hook }, + { WM_UNINITMENUPOPUP, sent|lparam, 0, 0 }, + { WM_MENUSELECT, sent|wparam|lparam, 0xffff0000, 0 }, + { WM_EXITMENULOOP, sent|wparam|lparam, 1, 0 }, + { 0 } +}; + +static const struct message WmTrackPopupMenuCapture[] = { + { HCBT_CREATEWND, hook }, + { WM_ENTERMENULOOP, sent|wparam|lparam, TRUE, 0 }, + { WM_CAPTURECHANGED, sent }, + { WM_INITMENU, sent|lparam, 0, 0 }, + { WM_INITMENUPOPUP, sent|lparam, 0, 0 }, + { 0x0093, sent|optional }, + { 0x0094, sent|optional }, + { 0x0094, sent|optional }, + { WM_ENTERIDLE, sent|wparam, 2 }, + { WM_CAPTURECHANGED, sent }, + { HCBT_DESTROYWND, hook }, + { WM_UNINITMENUPOPUP, sent|lparam, 0, 0 }, + { WM_MENUSELECT, sent|wparam|lparam, 0xffff0000, 0 }, + { WM_EXITMENULOOP, sent|wparam|lparam, 1, 0 }, + { 0 } +}; + +static const struct message WmTrackPopupMenuEmpty[] = { + { HCBT_CREATEWND, hook }, + { WM_ENTERMENULOOP, sent|wparam|lparam, TRUE, 0 }, + { WM_INITMENU, sent|lparam, 0, 0 }, + { WM_INITMENUPOPUP, sent|lparam, 0, 0 }, + { 0x0093, sent|optional }, + { 0x0094, sent|optional }, + { 0x0094, sent|optional }, + { WM_CAPTURECHANGED, sent }, + { WM_EXITMENULOOP, sent|wparam|lparam, 1, 0 }, + { HCBT_DESTROYWND, hook }, + { WM_UNINITMENUPOPUP, sent|lparam, 0, 0 }, + { 0 } +}; + +static const struct message WmTrackPopupMenuAbort[] = { + { HCBT_CREATEWND, hook }, + { WM_ENTERMENULOOP, sent|wparam|lparam, TRUE, 0 }, + { WM_INITMENU, sent|lparam, 0, 0 }, + { WM_INITMENUPOPUP, sent|lparam, 0, 0 }, + { 0x0093, sent|optional }, + { 0x0094, sent|optional }, + { 0x0094, sent|optional }, + { WM_CAPTURECHANGED, sent }, + { HCBT_DESTROYWND, hook }, + { WM_UNINITMENUPOPUP, sent|lparam, 0, 0 }, + { WM_MENUSELECT, sent|wparam|lparam, 0xffff0000, 0 }, + { WM_EXITMENULOOP, sent|wparam|lparam, 1, 0 }, + { 0 } +}; + static BOOL after_end_dialog, test_def_id, paint_loop_done; static int sequence_cnt, sequence_size; static struct recvd_message* sequence; @@ -4516,6 +4593,7 @@ HMENU hmenu; MSG msg; LRESULT res; + POINT pos; flush_sequence(); @@ -4776,13 +4854,23 @@ after_end_dialog = FALSE; test_def_id = FALSE; - hwnd = CreateWindowExA(0, "TestDialogClass", NULL, WS_POPUP, + ok(GetCursorPos(&pos), "GetCursorPos failed\n"); + ok(SetCursorPos(109, 109), "SetCursorPos failed\n"); + + hwnd = CreateWindowExA(0, "TestDialogClass", NULL, WS_POPUP|WS_CHILD, 0, 0, 100, 100, 0, 0, GetModuleHandleA(0), NULL); ok(hwnd != 0, "Failed to create custom dialog window\n"); flush_sequence(); trace("call ShowWindow(%p, SW_SHOW)\n", hwnd); ShowWindow(hwnd, SW_SHOW); ok_sequence(WmShowCustomDialogSeq, "ShowCustomDialog", TRUE); + + flush_events(); + flush_sequence(); + ok(DrawMenuBar(hwnd), "DrawMenuBar failed: %d\n", GetLastError()); + flush_events(); + ok_sequence(WmDrawMenuBarSeq, "DrawMenuBar", FALSE); + ok(SetCursorPos(pos.x, pos.y), "SetCursorPos failed\n"); DestroyWindow(hwnd); flush_sequence(); @@ -4793,7 +4881,8 @@ flush_sequence(); /* Message sequence for SetMenu */ - ok(!DrawMenuBar(hwnd), "DrawMenuBar should return FALSE for a window without a menu\n"); + ok(!DrawMenuBar(hwnd), "DrawMenuBar should return FALSE for a destroyed window\n"); + ok(GetLastError() == ERROR_INVALID_WINDOW_HANDLE, "last error is %d\n", GetLastError()); ok_sequence(WmEmptySeq, "DrawMenuBar for a window without a menu", FALSE); hmenu = CreateMenu(); @@ -8301,8 +8390,8 @@ } #define TIMER_ID 0x19 -#define TIMER_COUNT_EXPECTED 64 -#define TIMER_COUNT_TOLERANCE 9 +#define TIMER_COUNT_EXPECTED 100 +#define TIMER_COUNT_TOLERANCE 10 static int count = 0; static void CALLBACK callback_count(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime) @@ -8353,8 +8442,9 @@ ok( KillTimer(info.hWnd, TIMER_ID), "KillTimer failed\n"); /* Check the minimum allowed timeout for a timer. MSDN indicates that it should be 10.0 ms, - * but testing indicates that the minimum timeout is actually about 15.6 ms. Since there is - * some measurement error between test runs we're allowing for ±8 counts (~2 ms). + * which occurs sometimes, but most testing on the VMs indicates a minimum timeout closer to + * 15.6 ms. Since there is some measurement error between test runs we are allowing for + * ±9 counts (~4 ms) around the expected value. */ count = 0; id = SetTimer(info.hWnd, TIMER_ID, 0, callback_count); @@ -8363,8 +8453,9 @@ start = GetTickCount(); while (GetTickCount()-start < 1001 && GetMessageA(&msg, info.hWnd, 0, 0)) DispatchMessageA(&msg); - ok(abs(count-TIMER_COUNT_EXPECTED) < TIMER_COUNT_TOLERANCE - || broken(abs(count-43) < TIMER_COUNT_TOLERANCE) /* w2k3 */, + ok(abs(count-TIMER_COUNT_EXPECTED) < TIMER_COUNT_TOLERANCE /* xp */ + || broken(abs(count-64) < TIMER_COUNT_TOLERANCE) /* most common */ + || broken(abs(count-43) < TIMER_COUNT_TOLERANCE) /* w2k3, win8 */, "did not get expected count for minimum timeout (%d != ~%d).\n", count, TIMER_COUNT_EXPECTED); ok(KillTimer(info.hWnd, id), "KillTimer failed\n"); @@ -8384,7 +8475,9 @@ syscount++; DispatchMessageA(&msg); } - ok(abs(syscount-TIMER_COUNT_EXPECTED) < TIMER_COUNT_TOLERANCE, + ok(abs(syscount-TIMER_COUNT_EXPECTED) < TIMER_COUNT_TOLERANCE + || broken(abs(syscount-64) < TIMER_COUNT_TOLERANCE) /* most common */ + || broken(syscount > 4000 && syscount < 12000) /* win2k3sp0 */, "did not get expected count for minimum timeout (%d != ~%d).\n", syscount, TIMER_COUNT_EXPECTED); todo_wine ok(count == 0, "did not get expected count for callback timeout (%d != 0).\n", @@ -8418,8 +8511,9 @@ ok(count == 1, "killing replaced timer did not work (%i).\n", count); /* Check the minimum allowed timeout for a timer. MSDN indicates that it should be 10.0 ms, - * but testing indicates that the minimum timeout is actually about 15.6 ms. Since there is - * some measurement error between test runs we're allowing for ±8 counts (~2 ms). + * which occurs sometimes, but most testing on the VMs indicates a minimum timeout closer to + * 15.6 ms. Since there is some measurement error between test runs we are allowing for + * ±9 counts (~4 ms) around the expected value. */ count = 0; id = SetTimer(NULL, 0, 0, callback_count); @@ -8427,7 +8521,8 @@ start = GetTickCount(); while (GetTickCount()-start < 1001 && GetMessageA(&msg, NULL, 0, 0)) DispatchMessageA(&msg); - ok(abs(count-TIMER_COUNT_EXPECTED) < TIMER_COUNT_TOLERANCE, + ok(abs(count-TIMER_COUNT_EXPECTED) < TIMER_COUNT_TOLERANCE /* xp */ + || broken(abs(count-64) < TIMER_COUNT_TOLERANCE) /* most common */, "did not get expected count for minimum timeout (%d != ~%d).\n", count, TIMER_COUNT_EXPECTED); KillTimer(NULL, id); @@ -10816,8 +10911,11 @@ }; static const struct message WmShowNoActivate_2[] = { { HCBT_MINMAX, hook|lparam, 0, SW_SHOWNOACTIVATE }, - { WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_NOACTIVATE|SWP_FRAMECHANGED|SWP_NOCOPYBITS|SWP_STATECHANGED }, - { WM_WINDOWPOSCHANGED, sent|wparam, SWP_SHOWWINDOW|SWP_NOACTIVATE|SWP_FRAMECHANGED|SWP_NOCOPYBITS|SWP_STATECHANGED }, + { WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_NOACTIVATE|SWP_FRAMECHANGED|SWP_NOCOPYBITS|SWP_STATECHANGED, 0, SWP_NOACTIVATE }, + { HCBT_ACTIVATE, hook|optional }, + { WM_WINDOWPOSCHANGING, sent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE }, + { HCBT_SETFOCUS, hook|optional }, + { WM_WINDOWPOSCHANGED, sent|wparam, SWP_SHOWWINDOW|SWP_NOACTIVATE|SWP_FRAMECHANGED|SWP_NOCOPYBITS|SWP_STATECHANGED, 0, SWP_NOACTIVATE }, { WM_MOVE, sent|defwinproc }, { WM_SIZE, sent|wparam|defwinproc, SIZE_RESTORED }, { HCBT_SETFOCUS, hook|optional }, @@ -10937,16 +11035,18 @@ static const struct message WmMinimize_2[] = { { HCBT_MINMAX, hook|lparam, 0, SW_MINIMIZE }, { HCBT_SETFOCUS, hook|optional }, - { WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_NOACTIVATE|SWP_FRAMECHANGED|SWP_NOCOPYBITS|SWP_STATECHANGED }, - { WM_WINDOWPOSCHANGED, sent|wparam, SWP_NOACTIVATE|SWP_FRAMECHANGED|SWP_NOCOPYBITS|SWP_STATECHANGED }, + { WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_NOACTIVATE|SWP_FRAMECHANGED|SWP_NOCOPYBITS|SWP_STATECHANGED, 0, SWP_NOACTIVATE }, + { WM_WINDOWPOSCHANGED, sent|wparam, SWP_NOACTIVATE|SWP_FRAMECHANGED|SWP_NOCOPYBITS|SWP_STATECHANGED, 0, SWP_NOACTIVATE }, { WM_MOVE, sent|defwinproc }, { WM_SIZE, sent|wparam|lparam|defwinproc, SIZE_MINIMIZED, 0 }, { 0 } }; static const struct message WmMinimize_3[] = { { HCBT_MINMAX, hook|lparam, 0, SW_MINIMIZE }, - { WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_NOACTIVATE|SWP_FRAMECHANGED|SWP_NOCOPYBITS|SWP_STATECHANGED }, - { WM_WINDOWPOSCHANGED, sent|wparam, SWP_SHOWWINDOW|SWP_NOACTIVATE|SWP_FRAMECHANGED|SWP_NOCOPYBITS|SWP_STATECHANGED }, + { WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_NOACTIVATE|SWP_FRAMECHANGED|SWP_NOCOPYBITS|SWP_STATECHANGED, 0, SWP_NOACTIVATE }, + { HCBT_ACTIVATE, hook|optional }, + { WM_WINDOWPOSCHANGING, sent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE }, + { WM_WINDOWPOSCHANGED, sent|wparam, SWP_SHOWWINDOW|SWP_NOACTIVATE|SWP_FRAMECHANGED|SWP_NOCOPYBITS|SWP_STATECHANGED, 0, SWP_NOACTIVATE }, { WM_MOVE, sent|defwinproc }, { WM_SIZE, sent|wparam|lparam|defwinproc, SIZE_MINIMIZED, 0 }, { 0 } @@ -11284,12 +11384,9 @@ win_rc.left, win_rc.top, win_rc.right, win_rc.bottom, wp.rcNormalPosition.left, wp.rcNormalPosition.top, wp.rcNormalPosition.right, wp.rcNormalPosition.bottom); - - flush_events(); - flush_sequence(); } - DestroyWindow(hwnd); + flush_events(); } static INT_PTR WINAPI test_dlg_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) @@ -12084,7 +12181,11 @@ PostMessageW( hwnd, WM_CHAR, 0x3b1, 0 ); - ok( GetMessageW( &msg, hwnd, 0, 0 ), "no message\n" ); + while (GetMessageW( &msg, hwnd, 0, 0 )) + { + if (!ignore_message( msg.message )) break; + } + ok( msg.hwnd == hwnd, "unexpected hwnd %p\n", msg.hwnd ); ok( msg.message == WM_CHAR, "unexpected message %x\n", msg.message ); ok( msg.wParam == 0x3b1, "bad wparam %lx\n", msg.wParam ); @@ -14260,6 +14361,114 @@ DeleteObject( bmp ); } +static HMENU hpopupmenu; + +static LRESULT WINAPI cancel_popup_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + if (ignore_message( message )) return 0; + + switch (message) { + case WM_ENTERIDLE: + todo_wine ok(GetCapture() == hwnd, "expected %p, got %p\n", hwnd, GetCapture()); + EndMenu(); + break; + case WM_INITMENU: + case WM_INITMENUPOPUP: + case WM_UNINITMENUPOPUP: + ok((HMENU)wParam == hpopupmenu, "expected %p, got %lx\n", hpopupmenu, wParam); + break; + case WM_CAPTURECHANGED: + todo_wine ok(!lParam || (HWND)lParam == hwnd, "lost capture to %lx\n", lParam); + break; + } + + return MsgCheckProc (FALSE, hwnd, message, wParam, lParam); +} + +static LRESULT WINAPI cancel_init_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + if (ignore_message( message )) return 0; + + switch (message) { + case WM_ENTERMENULOOP: + ok(EndMenu() == TRUE, "EndMenu() failed\n"); + break; + } + + return MsgCheckProc (FALSE, hwnd, message, wParam, lParam); +} + +static void test_TrackPopupMenu(void) +{ + HWND hwnd; + BOOL ret; + + hwnd = CreateWindowExA(0, "TestWindowClass", NULL, 0, + 0, 0, 1, 1, 0, + NULL, NULL, 0); + ok(hwnd != NULL, "CreateWindowEx failed with error %d\n", GetLastError()); + + SetWindowLongPtrA( hwnd, GWLP_WNDPROC, (LONG_PTR)cancel_popup_proc); + + hpopupmenu = CreatePopupMenu(); + ok(hpopupmenu != NULL, "CreateMenu failed with error %d\n", GetLastError()); + + AppendMenuA(hpopupmenu, MF_STRING, 100, "item 1"); + AppendMenuA(hpopupmenu, MF_STRING, 100, "item 2"); + + flush_events(); + flush_sequence(); + ret = TrackPopupMenu(hpopupmenu, 0, 100,100, 0, hwnd, NULL); + ok_sequence(WmTrackPopupMenu, "TrackPopupMenu", TRUE); + ok(ret == 1, "TrackPopupMenu failed with error %i\n", GetLastError()); + + SetWindowLongPtrA( hwnd, GWLP_WNDPROC, (LONG_PTR)cancel_init_proc); + + flush_events(); + flush_sequence(); + ret = TrackPopupMenu(hpopupmenu, 0, 100,100, 0, hwnd, NULL); + ok_sequence(WmTrackPopupMenuAbort, "WmTrackPopupMenuAbort", TRUE); + ok(ret == TRUE, "TrackPopupMenu failed\n"); + + SetWindowLongPtrA( hwnd, GWLP_WNDPROC, (LONG_PTR)cancel_popup_proc); + + SetCapture(hwnd); + + flush_events(); + flush_sequence(); + ret = TrackPopupMenu(hpopupmenu, 0, 100,100, 0, hwnd, NULL); + ok_sequence(WmTrackPopupMenuCapture, "TrackPopupMenuCapture", TRUE); + ok(ret == 1, "TrackPopupMenuCapture failed with error %i\n", GetLastError()); + + DestroyMenu(hpopupmenu); + DestroyWindow(hwnd); +} + +static void test_TrackPopupMenuEmpty(void) +{ + HWND hwnd; + BOOL ret; + + hwnd = CreateWindowExA(0, "TestWindowClass", NULL, 0, + 0, 0, 1, 1, 0, + NULL, NULL, 0); + ok(hwnd != NULL, "CreateWindowEx failed with error %d\n", GetLastError()); + + SetWindowLongPtrA( hwnd, GWLP_WNDPROC, (LONG_PTR)cancel_popup_proc); + + hpopupmenu = CreatePopupMenu(); + ok(hpopupmenu != NULL, "CreateMenu failed with error %d\n", GetLastError()); + + flush_events(); + flush_sequence(); + ret = TrackPopupMenu(hpopupmenu, 0, 100,100, 0, hwnd, NULL); + ok_sequence(WmTrackPopupMenuEmpty, "TrackPopupMenuEmpty", TRUE); + todo_wine ok(ret == 0, "TrackPopupMenu succeeded\n"); + + DestroyMenu(hpopupmenu); + DestroyWindow(hwnd); +} + static void init_funcs(void) { HMODULE hKernel32 = GetModuleHandleA("kernel32.dll"); @@ -14337,7 +14546,6 @@ pUnhookWinEvent = 0; } hEvent_hook = 0; - test_SetFocus(); test_SetParent(); test_PostMessage(); @@ -14389,6 +14597,8 @@ test_keyflags(); test_hotkey(); test_layered_window(); + test_TrackPopupMenu(); + test_TrackPopupMenuEmpty(); /* keep it the last test, under Windows it tends to break the tests * which rely on active/foreground windows being correct. */ diff -Nru wine1.7-1.7.14/dlls/user32/tests/resource.c wine1.7-1.7.18/dlls/user32/tests/resource.c --- wine1.7-1.7.14/dlls/user32/tests/resource.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/user32/tests/resource.c 2014-05-02 18:15:48.000000000 +0000 @@ -333,11 +333,30 @@ static void test_PrivateExtractIcons(void) { const CHAR szShell32Dll[] = "shell32.dll"; HICON ahIcon[256]; - UINT aIconId[256]; - UINT cIcons, cIcons2; + UINT i, aIconId[256], cIcons, cIcons2; if (!pPrivateExtractIconsA) return; - + + cIcons = pPrivateExtractIconsA("", 0, 16, 16, ahIcon, aIconId, 1, 0); + ok(cIcons == ~0u, "got %u\n", cIcons); + + cIcons = pPrivateExtractIconsA("notepad.exe", 0, 16, 16, NULL, NULL, 1, 0); + ok(cIcons == 1 || broken(cIcons == 2) /* win2k */, "got %u\n", cIcons); + + ahIcon[0] = (HICON)0xdeadbeef; + cIcons = pPrivateExtractIconsA("notepad.exe", 0, 16, 16, ahIcon, NULL, 1, 0); + ok(cIcons == 1, "got %u\n", cIcons); + ok(ahIcon[0] != (HICON)0xdeadbeef, "icon not set\n"); + DestroyIcon(ahIcon[0]); + + ahIcon[0] = (HICON)0xdeadbeef; + aIconId[0] = 0xdeadbeef; + cIcons = pPrivateExtractIconsA("notepad.exe", 0, 16, 16, ahIcon, aIconId, 1, 0); + ok(cIcons == 1, "got %u\n", cIcons); + ok(ahIcon[0] != (HICON)0xdeadbeef, "icon not set\n"); + ok(aIconId[0] != 0xdeadbeef, "id not set\n"); + DestroyIcon(ahIcon[0]); + cIcons = pPrivateExtractIconsA(szShell32Dll, 0, 16, 16, NULL, NULL, 0, 0); cIcons2 = pPrivateExtractIconsA(szShell32Dll, 4, MAKELONG(32,16), MAKELONG(32,16), NULL, NULL, 256, 0); @@ -350,14 +369,18 @@ cIcons = pPrivateExtractIconsA(szShell32Dll, 0, 16, 16, ahIcon, aIconId, 3, 0); ok(cIcons == 3, "Three icons requested got cIcons=%d\n", cIcons); + for (i = 0; i < cIcons; i++) DestroyIcon(ahIcon[i]); /* count must be a multiple of two when getting two sizes */ cIcons = pPrivateExtractIconsA(szShell32Dll, 0, MAKELONG(16,32), MAKELONG(16,32), ahIcon, aIconId, 3, 0); ok(cIcons == 0 /* vista */ || cIcons == 4, "Three icons requested got cIcons=%d\n", cIcons); + for (i = 0; i < cIcons; i++) DestroyIcon(ahIcon[i]); + cIcons = pPrivateExtractIconsA(szShell32Dll, 0, MAKELONG(16,32), MAKELONG(16,32), ahIcon, aIconId, 4, 0); ok(cIcons == 4, "Four icons requested got cIcons=%d\n", cIcons); + for (i = 0; i < cIcons; i++) DestroyIcon(ahIcon[i]); } static void test_LoadImage(void) diff -Nru wine1.7-1.7.14/dlls/user32/tests/text.c wine1.7-1.7.18/dlls/user32/tests/text.c --- wine1.7-1.7.14/dlls/user32/tests/text.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/user32/tests/text.c 2014-05-02 18:15:48.000000000 +0000 @@ -42,6 +42,8 @@ 's','t','r','i','n','g','\0'}; static CHAR emptystring[] = ""; static WCHAR emptystringW[] = { 0 }; + static CHAR wordbreak_text[] = "line1 line2"; + static WCHAR wordbreak_textW[] = {'l','i','n','e','1',' ','l','i','n','e','2',0}; INT textlen, textheight, heightcheck; RECT rect = { 0, 0, 100, 0 }; BOOL ret; @@ -556,6 +558,20 @@ ok(rect.bottom, "rect.bottom should not be 0\n"); } + SetRect(&rect, 0, 0, 1, 1); + heightcheck = DrawTextA(hdc, wordbreak_text, -1, &rect, DT_CALCRECT); + SetRect(&rect, 0, 0, 1, 1); + textheight = DrawTextA(hdc, wordbreak_text, -1, &rect, DT_CALCRECT | DT_WORDBREAK); + ok(textheight == heightcheck * 2, "Got unexpected textheight %d, expected %d.\n", + textheight, heightcheck * 2); + + SetRect(&rect, 0, 0, 1, 1); + heightcheck = DrawTextW(hdc, wordbreak_textW, -1, &rect, DT_CALCRECT); + SetRect(&rect, 0, 0, 1, 1); + textheight = DrawTextW(hdc, wordbreak_textW, -1, &rect, DT_CALCRECT | DT_WORDBREAK); + ok(textheight == heightcheck * 2, "Got unexpected textheight %d, expected %d.\n", + textheight, heightcheck * 2); + SelectObject(hdc, hOldFont); ret = DeleteObject(hFont); ok( ret, "DeleteObject error %u\n", GetLastError()); diff -Nru wine1.7-1.7.14/dlls/user32/tests/uitools.c wine1.7-1.7.18/dlls/user32/tests/uitools.c --- wine1.7-1.7.14/dlls/user32/tests/uitools.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/user32/tests/uitools.c 2014-05-02 18:15:48.000000000 +0000 @@ -63,7 +63,57 @@ ReleaseDC(0, hdc); } +static void test_SubtractRect(void) +{ + RECT rect1; + RECT rect2; + RECT rectr; + BOOL result; + + /* source rectangles don't intersect */ + SetRect(&rect1, 50, 50, 150, 100); + SetRect(&rect2, 250, 200, 1500, 1000); + result = SubtractRect(&rectr, &rect1, &rect2); + ok(result, "SubtractRect returned FALSE but subtraction should not be empty\n"); + ok(result && rectr.left == 50 && rectr.top == 50 && rectr.right ==150 + && rectr.bottom == 100, "wrong rect subtraction of SubtractRect " + "(dest rect={%d, %d, %d, %d})\n", rectr.left, rectr.top, rectr.right, rectr.bottom); + + /* source rect 2 partially overlaps rect 1 */ + SetRect(&rect1, 2431, 626, 3427, 1608); + SetRect(&rect2, 2499, 626, 3427, 1608); + result = SubtractRect(&rectr, &rect1, &rect2); + ok(result, "SubtractRect returned FALSE but subtraction should not be empty\n"); + ok(result && rectr.left == 2431 && rectr.top == 626 && rectr.right == 2499 + && rectr.bottom == 1608, "wrong rect subtraction of SubtractRect " + "(dest rect={%d, %d, %d, %d})\n", rectr.left, rectr.top, rectr.right, rectr.bottom); + + /* source rect 2 partially overlaps rect 1 - dest is src rect 2 */ + SetRect(&rect1, 2431, 626, 3427, 1608); + SetRect(&rect2, 2499, 626, 3427, 1608); + result = SubtractRect(&rect2, &rect1, &rect2); + ok(result, "SubtractRect returned FALSE but subtraction should not be empty\n"); + ok(result && rectr.left == 2431 && rectr.top == 626 && rectr.right == 2499 + && rectr.bottom == 1608, "wrong rect subtraction of SubtractRect " + "(dest rect={%d, %d, %d, %d})\n", rectr.left, rectr.top, rectr.right, rectr.bottom); + + /* source rect 2 completely overlaps rect 1 */ + SetRect(&rect1, 250, 250, 400, 500); + SetRect(&rect2, 50, 50, 1500, 1000); + result = SubtractRect(&rectr, &rect1, &rect2); + ok(!result, "SubtractRect returned TRUE but subtraction should be empty " + "(dest rect={%d, %d, %d, %d})\n", rectr.left, rectr.top, rectr.right, rectr.bottom); + + /* source rect 2 completely overlaps rect 1 - dest is src rect 2 */ + SetRect(&rect1, 250, 250, 400, 500); + SetRect(&rect2, 50, 50, 1500, 1000); + result = SubtractRect(&rect2, &rect1, &rect2); + ok(!result, "SubtractRect returned TRUE but subtraction should be empty " + "(dest rect={%d, %d, %d, %d})\n", rect2.left, rect2.top, rect2.right, rect2.bottom); +} + START_TEST(uitools) { test_FillRect(); + test_SubtractRect(); } diff -Nru wine1.7-1.7.14/dlls/user32/tests/win.c wine1.7-1.7.18/dlls/user32/tests/win.c --- wine1.7-1.7.14/dlls/user32/tests/win.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/user32/tests/win.c 2014-05-02 18:15:48.000000000 +0000 @@ -2794,6 +2794,7 @@ BOOL ret; HWND hwnd2; MSG msg; + LONG style; flush_events( TRUE ); ShowWindow(hwnd, SW_HIDE); @@ -2889,6 +2890,19 @@ todo_wine ok(GetActiveWindow() == hwnd2, "Expected active window %p, got %p.\n", hwnd2, GetActiveWindow()); todo_wine ok(GetFocus() == hwnd2, "Expected focus window %p, got %p.\n", hwnd2, GetFocus()); + SetForegroundWindow(hwnd); + check_wnd_state(hwnd, hwnd, hwnd, 0); + style = GetWindowLongA(hwnd2, GWL_STYLE) | WS_CHILD; + ok(SetWindowLongA(hwnd2, GWL_STYLE, style), "SetWindowLong failed\n"); + ok(SetForegroundWindow(hwnd2), "SetForegroundWindow failed\n"); + check_wnd_state(hwnd2, hwnd2, hwnd2, 0); + + SetForegroundWindow(hwnd); + check_wnd_state(hwnd, hwnd, hwnd, 0); + ok(SetWindowLongA(hwnd2, GWL_STYLE, style & (~WS_POPUP)), "SetWindowLong failed\n"); + ok(!SetForegroundWindow(hwnd2), "SetForegroundWindow failed\n"); + check_wnd_state(hwnd, hwnd, hwnd, 0); + SetEvent(thread_params.test_finished); WaitForSingleObject(thread, INFINITE); CloseHandle(thread_params.test_finished); @@ -3084,6 +3098,9 @@ } cap_wnd = GetCapture(); + ok(cap_wnd == (HWND)lParam, "capture window %p does not match lparam %lx\n", cap_wnd, lParam); + todo_wine ok(cap_wnd == hWnd, "capture window %p does not match hwnd %p\n", cap_wnd, hWnd); + /* check that re-setting the capture for the menu fails */ set_cap_wnd = SetCapture(cap_wnd); ok(!set_cap_wnd || broken(set_cap_wnd == cap_wnd), /* nt4 */ @@ -3720,21 +3737,34 @@ ret = SetParent(popup, child1); ok(ret == desktop, "expected %p, got %p\n", desktop, ret); check_parents(popup, child1, child1, 0, 0, parent, popup); -todo_wine check_active_state(popup, 0, popup); SetActiveWindow(parent); + SetFocus(popup); + check_active_state(popup, 0, popup); + + EnableWindow(child1, FALSE); + check_active_state(popup, 0, popup); + SetFocus(parent); + check_active_state(parent, 0, parent); + SetFocus(popup); + check_active_state(popup, 0, popup); + EnableWindow(child1, TRUE); + + ShowWindow(child1, SW_MINIMIZE); + SetFocus(parent); + check_active_state(parent, 0, parent); + SetFocus(popup); + check_active_state(popup, 0, popup); + ShowWindow(child1, SW_HIDE); + + SetActiveWindow(parent); SetFocus(parent); check_active_state(parent, 0, parent); bret = SetForegroundWindow(popup); -todo_wine { - ok(bret || broken(!bret), "SetForegroundWindow() failed\n"); - if (!bret) - check_active_state(popup, 0, popup); - else - check_active_state(popup, popup, popup); - } + ok(bret, "SetForegroundWindow() failed\n"); + check_active_state(popup, popup, popup); ok(DestroyWindow(parent), "DestroyWindow() failed\n"); @@ -5899,7 +5929,7 @@ ShowWindow(hwnd, SW_SHOW); UpdateWindow(hwnd); flush_events( FALSE ); - while(PeekMessageA(&msg, hwnd, 0, 0, PM_REMOVE) != 0) + while (PeekMessageA(&msg, hwnd, 0, 0, PM_REMOVE)) { if (msg.message == WM_PAINT) loopcount++; if (loopcount >= 100) break; @@ -7063,7 +7093,7 @@ struct window_attributes { char class_name[128]; - int is_visible, is_enabled, is_groupbox, is_httransparent, is_extransparent; + BOOL is_visible, is_enabled, is_groupbox, is_httransparent, is_extransparent; }; static void get_window_attributes(HWND hwnd, struct window_attributes *attrs) @@ -7483,6 +7513,26 @@ DestroyWindow(parent); } +static void test_window_without_child_style(void) +{ + HWND hwnd; + + hwnd = CreateWindowExA(0, "edit", NULL, WS_VISIBLE|WS_CHILD, + 0, 0, 50, 50, hwndMain, NULL, 0, NULL); + ok(hwnd != NULL, "CreateWindow failed\n"); + + ok(SetWindowLongA(hwnd, GWL_STYLE, GetWindowLongA(hwnd, GWL_STYLE) & (~WS_CHILD)), + "can't remove WS_CHILD style\n"); + + SetActiveWindow(hwndMain); + PostMessageW(hwnd, WM_LBUTTONUP, 0, 0); + SendMessageW(hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0); + check_active_state(hwnd, hwnd, hwnd); + flush_events(TRUE); + + DestroyWindow(hwnd); +} + START_TEST(win) { HMODULE user32 = GetModuleHandleA( "user32.dll" ); @@ -7507,6 +7557,32 @@ if (!RegisterWindowClasses()) assert(0); + hwndMain = CreateWindowExA(/*WS_EX_TOOLWINDOW*/ 0, "MainWindowClass", "Main window", + WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | + WS_MAXIMIZEBOX | WS_POPUP | WS_VISIBLE, + 100, 100, 200, 200, + 0, 0, GetModuleHandleA(NULL), NULL); + assert( hwndMain ); + + if(!SetForegroundWindow(hwndMain)) { + /* workaround for foreground lock timeout */ + INPUT input[2]; + UINT events_no; + + memset(input, 0, sizeof(input)); + input[0].type = INPUT_MOUSE; + U(input[0]).mi.dx = 101; + U(input[0]).mi.dy = 101; + U(input[0]).mi.dwFlags = MOUSEEVENTF_LEFTDOWN; + input[0].type = INPUT_MOUSE; + U(input[0]).mi.dx = 101; + U(input[0]).mi.dy = 101; + U(input[0]).mi.dwFlags = MOUSEEVENTF_LEFTUP; + events_no = SendInput(2, input, sizeof(input[0])); + ok(events_no == 2, "SendInput returned %d\n", events_no); + ok(SetForegroundWindow(hwndMain), "SetForegroundWindow failed\n"); + } + SetLastError(0xdeafbeef); GetWindowLongPtrW(GetDesktopWindow(), GWLP_WNDPROC); is_win9x = (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED); @@ -7518,17 +7594,11 @@ test_FindWindowEx(); test_SetParent(); - hwndMain = CreateWindowExA(/*WS_EX_TOOLWINDOW*/ 0, "MainWindowClass", "Main window", - WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | - WS_MAXIMIZEBOX | WS_POPUP, - 100, 100, 200, 200, - 0, 0, GetModuleHandleA(NULL), NULL); hwndMain2 = CreateWindowExA(/*WS_EX_TOOLWINDOW*/ 0, "MainWindowClass", "Main window 2", WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP, 100, 100, 200, 200, 0, 0, GetModuleHandleA(NULL), NULL); - assert( hwndMain ); assert( hwndMain2 ); our_pid = GetWindowThreadProcessId(hwndMain, NULL); @@ -7593,6 +7663,7 @@ test_winregion(); test_map_points(); test_update_region(); + test_window_without_child_style(); /* add the tests above this line */ if (hhook) UnhookWindowsHookEx(hhook); diff -Nru wine1.7-1.7.14/dlls/user32/tests/winstation.c wine1.7-1.7.18/dlls/user32/tests/winstation.c --- wine1.7-1.7.14/dlls/user32/tests/winstation.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/user32/tests/winstation.c 2014-05-02 18:15:48.000000000 +0000 @@ -297,7 +297,8 @@ static void test_enumstations(void) { - BOOL ret; + DWORD ret; + HWINSTA hwinsta; if (0) /* Crashes instead */ { @@ -307,6 +308,15 @@ ok(GetLastError() == ERROR_INVALID_PARAMETER, "LastError is set to %08x\n", GetLastError()); } + hwinsta = CreateWindowStationA("winsta_test", 0, WINSTA_ALL_ACCESS, NULL); + ret = GetLastError(); + ok(hwinsta != NULL || ret == ERROR_ACCESS_DENIED, "CreateWindowStation failed (%u)\n", ret); + if (!hwinsta) + { + win_skip("Not enough privileges for CreateWindowStation\n"); + return; + } + SetLastError(0xdeadbeef); ret = EnumWindowStationsA(open_window_station_callbackA, 0x12345); ok(ret == 0x12345, "EnumWindowStationsA returned %x\n", ret); diff -Nru wine1.7-1.7.14/dlls/user32/text.c wine1.7-1.7.18/dlls/user32/text.c --- wine1.7-1.7.14/dlls/user32/text.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/user32/text.c 2014-05-02 18:15:48.000000000 +0000 @@ -379,7 +379,7 @@ i = chars_fit; word_fits = TRUE; if (!chars_fit) - ; /* we pretend that it fits anyway */ + word_fits = FALSE; else if (sla[i].fSoftBreak) /* chars_fit < *len_str so this is valid */ { /* the word just fitted */ @@ -392,7 +392,7 @@ word_fits = (i != 0 || sla[i+1].fSoftBreak ); } - /* If there was one or the first character didn't fit then */ + /* If there was one. */ if (word_fits) { BOOL next_is_space; diff -Nru wine1.7-1.7.14/dlls/user32/uitools.c wine1.7-1.7.18/dlls/user32/uitools.c --- wine1.7-1.7.14/dlls/user32/uitools.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/user32/uitools.c 2014-05-02 18:15:48.000000000 +0000 @@ -1421,14 +1421,14 @@ SetRectEmpty( dest ); return FALSE; } - *dest = *src1; if (IntersectRect( &tmp, src1, src2 )) { - if (EqualRect( &tmp, dest )) + if (EqualRect( &tmp, src1 )) { SetRectEmpty( dest ); return FALSE; } + *dest = *src1; if ((tmp.top == dest->top) && (tmp.bottom == dest->bottom)) { if (tmp.left == dest->left) dest->left = tmp.right; @@ -1440,6 +1440,10 @@ else if (tmp.bottom == dest->bottom) dest->bottom = tmp.top; } } + else + { + *dest = *src1; + } return TRUE; } diff -Nru wine1.7-1.7.14/dlls/user32/user32.rc wine1.7-1.7.18/dlls/user32/user32.rc --- wine1.7-1.7.14/dlls/user32/user32.rc 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/user32/user32.rc 2014-05-02 18:15:48.000000000 +0000 @@ -72,7 +72,7 @@ } MSGBOX DIALOG 100, 80, 216, 168 -STYLE DS_MODALFRAME | DS_NOIDLEMSG | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +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 diff -Nru wine1.7-1.7.14/dlls/user32/user32.spec wine1.7-1.7.18/dlls/user32/user32.spec --- wine1.7-1.7.14/dlls/user32/user32.spec 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/user32/user32.spec 2014-05-02 18:15:48.000000000 +0000 @@ -1,4 +1,5 @@ @ stdcall ActivateKeyboardLayout(long long) +@ stdcall AddClipboardFormatListener(long) @ stdcall AdjustWindowRect(ptr long long) @ stdcall AdjustWindowRectEx(ptr long long long) @ stdcall AlignRects(ptr long long long) @@ -38,6 +39,7 @@ @ stdcall ChangeMenuA(long long ptr long long) @ stdcall ChangeMenuW(long long ptr long long) @ stdcall ChangeWindowMessageFilter(long long) +@ stdcall ChangeWindowMessageFilterEx(long long long ptr) @ stdcall CharLowerA(str) @ stdcall CharLowerBuffA(str long) @ stdcall CharLowerBuffW(wstr long) @@ -565,6 +567,7 @@ @ stdcall RegisterLogonProcess(long long) # @ stub RegisterMessagePumpHook @ stub RegisterNetworkCapabilities +@ stdcall RegisterPowerSettingNotification(long ptr long) @ stdcall RegisterRawInputDevices(ptr long long) @ stdcall RegisterServicesProcess(long) @ stdcall RegisterShellHookWindow (long) @@ -575,6 +578,7 @@ @ stdcall RegisterWindowMessageW(wstr) @ stdcall ReleaseCapture() @ stdcall ReleaseDC(long long) +@ stdcall RemoveClipboardFormatListener(long) @ stdcall RemoveMenu(long long long) @ stdcall RemovePropA(long str) @ stdcall RemovePropW(long wstr) diff -Nru wine1.7-1.7.14/dlls/user32/user_private.h wine1.7-1.7.18/dlls/user32/user_private.h --- wine1.7-1.7.14/dlls/user32/user_private.h 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/user32/user_private.h 2014-05-02 18:15:48.000000000 +0000 @@ -105,7 +105,7 @@ void (CDECL *pSetFocus)(HWND); void (CDECL *pSetLayeredWindowAttributes)(HWND,COLORREF,BYTE,DWORD); void (CDECL *pSetParent)(HWND,HWND,HWND); - int (CDECL *pSetWindowRgn)(HWND,HRGN,BOOL); + void (CDECL *pSetWindowRgn)(HWND,HRGN,BOOL); void (CDECL *pSetWindowIcon)(HWND,UINT,HICON); void (CDECL *pSetWindowStyle)(HWND,INT,STYLESTRUCT*); void (CDECL *pSetWindowText)(HWND,LPCWSTR); @@ -172,6 +172,8 @@ struct user_thread_info { HANDLE server_queue; /* Handle to server-side queue */ + DWORD wake_mask; /* Current queue wake mask */ + DWORD changed_mask; /* Current queue changed mask */ WORD recursion_count; /* SendMessage recursion counter */ WORD message_count; /* Get/PeekMessage loop counter */ BOOL hook_unicode; /* Is current hook unicode? */ @@ -188,7 +190,7 @@ HWND msg_window; /* HWND_MESSAGE parent window */ RAWINPUT *rawinput; - ULONG pad[8]; /* Available for more data */ + ULONG pad[6]; /* Available for more data */ }; struct hook_extra_info diff -Nru wine1.7-1.7.14/dlls/user.exe16/message.c wine1.7-1.7.18/dlls/user.exe16/message.c --- wine1.7-1.7.14/dlls/user.exe16/message.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/user.exe16/message.c 2014-05-02 18:15:48.000000000 +0000 @@ -882,14 +882,14 @@ case 0: if (hi) { - MESSAGE("DDE_ACK: neither atom nor handle!!!\n"); + WARN("DDE_ACK: neither atom nor handle!!!\n"); hi = 0; } break; case 1: break; /* atom, nothing to do */ case 3: - MESSAGE("DDE_ACK: %lx both atom and handle... choosing handle\n", hi); + WARN("DDE_ACK: %lx both atom and handle... choosing handle\n", hi); /* fall through */ case 2: hi = convert_handle_16_to_32(hi, GMEM_DDESHARE); @@ -1262,14 +1262,14 @@ case 0: if (hi) { - MESSAGE("DDE_ACK: neither atom nor handle!!!\n"); + WARN("DDE_ACK: neither atom nor handle!!!\n"); hi = 0; } break; case 1: break; /* atom, nothing to do */ case 3: - MESSAGE("DDE_ACK: %lx both atom and handle... choosing handle\n", hi); + WARN("DDE_ACK: %lx both atom and handle... choosing handle\n", hi); /* fall through */ case 2: hi = convert_handle_32_to_16(hi, GMEM_DDESHARE); diff -Nru wine1.7-1.7.14/dlls/usp10/bidi.c wine1.7-1.7.18/dlls/usp10/bidi.c --- wine1.7-1.7.14/dlls/usp10/bidi.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/usp10/bidi.c 2014-05-02 18:15:48.000000000 +0000 @@ -827,10 +827,13 @@ static void computeIsolatingRunsSet(unsigned baselevel, WORD *pcls, WORD *pLevel, int uCount, struct list *set) { int run_start, run_end, i; - Run runs[uCount]; int run_count = 0; + Run *runs; IsolatedRun *current_isolated; + runs = HeapAlloc(GetProcessHeap(), 0, uCount * sizeof(Run)); + if (!runs) return; + list_init(set); /* Build Runs */ @@ -857,6 +860,7 @@ int type_fence, real_end; int j; current_isolated = HeapAlloc(GetProcessHeap(), 0, sizeof(IsolatedRun) + sizeof(WORD*)*uCount); + if (!current_isolated) break; run_start = runs[k].start; current_isolated->e = runs[k].e; @@ -944,6 +948,8 @@ } i++; } + + HeapFree(GetProcessHeap(), 0, runs); } /************************************************************* diff -Nru wine1.7-1.7.14/dlls/usp10/tests/usp10.c wine1.7-1.7.18/dlls/usp10/tests/usp10.c --- wine1.7-1.7.14/dlls/usp10/tests/usp10.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/usp10/tests/usp10.c 2014-05-02 18:15:48.000000000 +0000 @@ -837,7 +837,7 @@ return 1; i = rp->range; - while (i > sizeof(DWORD)*8) + while (i >= sizeof(DWORD)*8) { idx++; i -= (sizeof(DWORD)*8); diff -Nru wine1.7-1.7.14/dlls/usp10/usp10.c wine1.7-1.7.18/dlls/usp10/usp10.c --- wine1.7-1.7.14/dlls/usp10/usp10.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/usp10/usp10.c 2014-05-02 18:15:48.000000000 +0000 @@ -1616,12 +1616,12 @@ * item is set up to prevent random behaviour if the caller erroneously * checks the n+1 structure */ index++; + if (index + 1 > cMaxItems) return E_OUTOFMEMORY; memset(&pItems[index].a, 0, sizeof(SCRIPT_ANALYSIS)); TRACE("index=%d cnt=%d iCharPos=%d\n", index, cnt, pItems[index].iCharPos); /* Set one SCRIPT_STATE item being returned */ - if (index + 1 > cMaxItems) return E_OUTOFMEMORY; if (pcItems) *pcItems = index; /* Set SCRIPT_ITEM */ diff -Nru wine1.7-1.7.14/dlls/uuid/uuid.c wine1.7-1.7.18/dlls/uuid/uuid.c --- wine1.7-1.7.14/dlls/uuid/uuid.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/uuid/uuid.c 2014-05-02 18:15:48.000000000 +0000 @@ -86,6 +86,7 @@ #include "commdlg.h" #include "tlogstg.h" #include "msdasc.h" +#include "netcfgx.h" /* FIXME: cguids declares GUIDs but does not define their values */ diff -Nru wine1.7-1.7.14/dlls/uxtheme/tests/system.c wine1.7-1.7.18/dlls/uxtheme/tests/system.c --- wine1.7-1.7.14/dlls/uxtheme/tests/system.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/uxtheme/tests/system.c 2014-05-02 18:15:48.000000000 +0000 @@ -132,26 +132,16 @@ HWND hWnd; BOOL bDestroyed; - SetLastError(0xdeadbeef); hRes = pSetWindowTheme(NULL, NULL, NULL); - todo_wine - { - ok( hRes == E_HANDLE, "Expected E_HANDLE, got 0x%08x\n", hRes); - ok( GetLastError() == 0xdeadbeef, - "Expected 0xdeadbeef, got 0x%08x\n", - GetLastError()); - } +todo_wine + ok( hRes == E_HANDLE, "Expected E_HANDLE, got 0x%08x\n", hRes); /* Only do the bare minimum to get a valid hwnd */ hWnd = CreateWindowExA(0, "static", "", WS_POPUP, 0,0,100,100,0, 0, 0, NULL); if (!hWnd) return; - SetLastError(0xdeadbeef); hRes = pSetWindowTheme(hWnd, NULL, NULL); ok( hRes == S_OK, "Expected S_OK, got 0x%08x\n", hRes); - ok( GetLastError() == 0xdeadbeef, - "Expected 0xdeadbeef, got 0x%08x\n", - GetLastError()); bDestroyed = DestroyWindow(hWnd); if (!bDestroyed) @@ -279,20 +269,12 @@ "Expected 0xdeadbeef, got 0x%08x\n", GetLastError()); - SetLastError(0xdeadbeef); hRes = pCloseThemeData(hTheme); ok( hRes == S_OK, "Expected S_OK, got 0x%08x\n", hRes); - ok( GetLastError() == 0xdeadbeef, - "Expected 0xdeadbeef, got 0x%08x\n", - GetLastError()); /* Close a second time */ - SetLastError(0xdeadbeef); hRes = pCloseThemeData(hTheme); ok( hRes == S_OK, "Expected S_OK, got 0x%08x\n", hRes); - ok( GetLastError() == 0xdeadbeef, - "Expected 0xdeadbeef, got 0x%08x\n", - GetLastError()); /* See if closing makes a difference for GetWindowTheme */ SetLastError(0xdeadbeef); @@ -476,28 +458,19 @@ bThemeActive = pIsThemeActive(); /* All NULLs */ - SetLastError(0xdeadbeef); hRes = pGetCurrentThemeName(NULL, 0, NULL, 0, NULL, 0); if (bThemeActive) ok( hRes == S_OK, "Expected S_OK, got 0x%08x\n", hRes); else ok( hRes == E_PROP_ID_UNSUPPORTED, "Expected E_PROP_ID_UNSUPPORTED, got 0x%08x\n", hRes); - ok( GetLastError() == 0xdeadbeef, - "Expected 0xdeadbeef, got 0x%08x\n", - GetLastError()); /* Number of characters given is 0 */ - SetLastError(0xdeadbeef); hRes = pGetCurrentThemeName(currentTheme, 0, NULL, 0, NULL, 0); if (bThemeActive) ok( hRes == S_OK || broken(hRes == E_FAIL /* WinXP SP1 */), "Expected S_OK, got 0x%08x\n", hRes); else ok( hRes == E_PROP_ID_UNSUPPORTED, "Expected E_PROP_ID_UNSUPPORTED, got 0x%08x\n", hRes); - ok( GetLastError() == 0xdeadbeef, - "Expected 0xdeadbeef, got 0x%08x\n", - GetLastError()); - SetLastError(0xdeadbeef); hRes = pGetCurrentThemeName(currentTheme, 2, NULL, 0, NULL, 0); if (bThemeActive) todo_wine @@ -506,12 +479,8 @@ "Expected HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), got 0x%08x\n", hRes); else ok( hRes == E_PROP_ID_UNSUPPORTED, "Expected E_PROP_ID_UNSUPPORTED, got 0x%08x\n", hRes); - ok( GetLastError() == 0xdeadbeef, - "Expected 0xdeadbeef, got 0x%08x\n", - GetLastError()); /* The same is true if the number of characters is too small for Color and/or Size */ - SetLastError(0xdeadbeef); hRes = pGetCurrentThemeName(currentTheme, sizeof(currentTheme) / sizeof(WCHAR), currentColor, 2, currentSize, sizeof(currentSize) / sizeof(WCHAR)); @@ -522,23 +491,15 @@ "Expected HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER), got 0x%08x\n", hRes); else ok( hRes == E_PROP_ID_UNSUPPORTED, "Expected E_PROP_ID_UNSUPPORTED, got 0x%08x\n", hRes); - ok( GetLastError() == 0xdeadbeef, - "Expected 0xdeadbeef, got 0x%08x\n", - GetLastError()); /* Given number of characters is correct */ - SetLastError(0xdeadbeef); hRes = pGetCurrentThemeName(currentTheme, sizeof(currentTheme) / sizeof(WCHAR), NULL, 0, NULL, 0); if (bThemeActive) ok( hRes == S_OK, "Expected S_OK, got 0x%08x\n", hRes); else ok( hRes == E_PROP_ID_UNSUPPORTED, "Expected E_PROP_ID_UNSUPPORTED, got 0x%08x\n", hRes); - ok( GetLastError() == 0xdeadbeef, - "Expected 0xdeadbeef, got 0x%08x\n", - GetLastError()); /* Given number of characters for the theme name is too large */ - SetLastError(0xdeadbeef); hRes = pGetCurrentThemeName(currentTheme, sizeof(currentTheme), NULL, 0, NULL, 0); if (bThemeActive) ok( hRes == E_POINTER || hRes == S_OK, "Expected E_POINTER or S_OK, got 0x%08x\n", hRes); @@ -546,12 +507,8 @@ ok( hRes == E_PROP_ID_UNSUPPORTED || hRes == E_POINTER, /* win2k3 */ "Expected E_PROP_ID_UNSUPPORTED, got 0x%08x\n", hRes); - ok( GetLastError() == 0xdeadbeef, - "Expected 0xdeadbeef, got 0x%08x\n", - GetLastError()); /* The too large case is only for the theme name, not for color name or size name */ - SetLastError(0xdeadbeef); hRes = pGetCurrentThemeName(currentTheme, sizeof(currentTheme) / sizeof(WCHAR), currentColor, sizeof(currentTheme), currentSize, sizeof(currentSize) / sizeof(WCHAR)); @@ -559,11 +516,7 @@ ok( hRes == S_OK, "Expected S_OK, got 0x%08x\n", hRes); else ok( hRes == E_PROP_ID_UNSUPPORTED, "Expected E_PROP_ID_UNSUPPORTED, got 0x%08x\n", hRes); - ok( GetLastError() == 0xdeadbeef, - "Expected 0xdeadbeef, got 0x%08x\n", - GetLastError()); - SetLastError(0xdeadbeef); hRes = pGetCurrentThemeName(currentTheme, sizeof(currentTheme) / sizeof(WCHAR), currentColor, sizeof(currentTheme) / sizeof(WCHAR), currentSize, sizeof(currentSize)); @@ -571,12 +524,8 @@ ok( hRes == S_OK, "Expected S_OK, got 0x%08x\n", hRes); else ok( hRes == E_PROP_ID_UNSUPPORTED, "Expected E_PROP_ID_UNSUPPORTED, got 0x%08x\n", hRes); - ok( GetLastError() == 0xdeadbeef, - "Expected 0xdeadbeef, got 0x%08x\n", - GetLastError()); /* Correct call */ - SetLastError(0xdeadbeef); hRes = pGetCurrentThemeName(currentTheme, sizeof(currentTheme) / sizeof(WCHAR), currentColor, sizeof(currentColor) / sizeof(WCHAR), currentSize, sizeof(currentSize) / sizeof(WCHAR)); @@ -584,21 +533,14 @@ ok( hRes == S_OK, "Expected S_OK, got 0x%08x\n", hRes); else ok( hRes == E_PROP_ID_UNSUPPORTED, "Expected E_PROP_ID_UNSUPPORTED, got 0x%08x\n", hRes); - ok( GetLastError() == 0xdeadbeef, - "Expected 0xdeadbeef, got 0x%08x\n", - GetLastError()); } static void test_CloseThemeData(void) { HRESULT hRes; - SetLastError(0xdeadbeef); hRes = pCloseThemeData(NULL); ok( hRes == E_HANDLE, "Expected E_HANDLE, got 0x%08x\n", hRes); - ok( GetLastError() == 0xdeadbeef, - "Expected 0xdeadbeef, got 0x%08x\n", - GetLastError()); } START_TEST(system) diff -Nru wine1.7-1.7.14/dlls/vbscript/compile.c wine1.7-1.7.18/dlls/vbscript/compile.c --- wine1.7-1.7.14/dlls/vbscript/compile.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/vbscript/compile.c 2014-05-02 18:15:48.000000000 +0000 @@ -346,6 +346,35 @@ ctx->labels[label & ~LABEL_FLAG] = ctx->instr_cnt; } +static inline unsigned stack_offset(compile_ctx_t *ctx) +{ + statement_ctx_t *iter; + unsigned ret = 0; + + for(iter = ctx->stat_ctx; iter; iter = iter->next) + ret += iter->stack_use; + + return ret; +} + +static BOOL emit_catch_jmp(compile_ctx_t *ctx, unsigned stack_off, unsigned code_off) +{ + unsigned code; + + code = push_instr(ctx, OP_catch); + if(!code) + return FALSE; + + instr_ptr(ctx, code)->arg1.uint = code_off; + instr_ptr(ctx, code)->arg2.uint = stack_off + stack_offset(ctx); + return TRUE; +} + +static inline BOOL emit_catch(compile_ctx_t *ctx, unsigned off) +{ + return emit_catch_jmp(ctx, off, ctx->instr_cnt); +} + static expression_t *lookup_const_decls(compile_ctx_t *ctx, const WCHAR *name, BOOL lookup_global) { const_decl_t *decl; @@ -533,6 +562,9 @@ if(!cnd_jmp) return E_OUTOFMEMORY; + if(!emit_catch(ctx, 0)) + return E_OUTOFMEMORY; + hres = compile_statement(ctx, NULL, stat->if_stat); if(FAILED(hres)) return hres; @@ -558,6 +590,9 @@ if(!cnd_jmp) return E_OUTOFMEMORY; + if(!emit_catch(ctx, 0)) + return E_OUTOFMEMORY; + hres = compile_statement(ctx, NULL, elseif_decl->stat); if(FAILED(hres)) return hres; @@ -597,6 +632,9 @@ if(!jmp_end) return E_OUTOFMEMORY; + if(!emit_catch(ctx, 0)) + return E_OUTOFMEMORY; + if(stat->stat.type == STAT_WHILE) { loop_ctx = NULL; }else { @@ -652,6 +690,10 @@ return hres; label_set_addr(ctx, loop_ctx.while_end_label); + + if(!emit_catch(ctx, 0)) + return E_OUTOFMEMORY; + return S_OK; } @@ -661,6 +703,10 @@ unsigned loop_start; HRESULT hres; + /* Preserve a place on the stack in case we throw before having proper enum collection. */ + if(!push_instr(ctx, OP_empty)) + return E_OUTOFMEMORY; + hres = compile_expression(ctx, stat->group_expr); if(FAILED(hres)) return hres; @@ -668,7 +714,6 @@ if(!push_instr(ctx, OP_newenum)) return E_OUTOFMEMORY; - loop_start = ctx->instr_cnt; if(!(loop_ctx.for_end_label = alloc_label(ctx))) return E_OUTOFMEMORY; @@ -676,10 +721,19 @@ if(FAILED(hres)) return hres; + if(!emit_catch(ctx, 1)) + return E_OUTOFMEMORY; + + loop_start = ctx->instr_cnt; hres = compile_statement(ctx, &loop_ctx, stat->body); if(FAILED(hres)) return hres; + /* We need a separated enumnext here, because we need to jump out of the loop on exception. */ + hres = push_instr_uint_bstr(ctx, OP_enumnext, loop_ctx.for_end_label, stat->identifier); + if(FAILED(hres)) + return hres; + hres = push_instr_addr(ctx, OP_jmp, loop_start); if(FAILED(hres)) return hres; @@ -703,6 +757,7 @@ if(FAILED(hres)) return hres; + /* FIXME: Assign should happen after both expressions evaluation. */ instr = push_instr(ctx, OP_assign_ident); if(!instr) return E_OUTOFMEMORY; @@ -739,10 +794,14 @@ instr_ptr(ctx, step_instr)->arg2.bstr = identifier; instr_ptr(ctx, step_instr)->arg1.uint = loop_ctx.for_end_label; + if(!emit_catch(ctx, 2)) + return E_OUTOFMEMORY; + hres = compile_statement(ctx, &loop_ctx, stat->body); if(FAILED(hres)) return hres; + /* FIXME: Error handling can't be done compatible with native using OP_incc here. */ instr = push_instr(ctx, OP_incc); if(!instr) return E_OUTOFMEMORY; @@ -757,6 +816,11 @@ return hres; label_set_addr(ctx, loop_ctx.for_end_label); + + /* FIXME: reconsider after OP_incc fixup. */ + if(!emit_catch(ctx, 0)) + return E_OUTOFMEMORY; + return S_OK; } @@ -778,6 +842,9 @@ if(!end_label) return E_OUTOFMEMORY; + if(!emit_catch_jmp(ctx, 0, end_label)) + return E_OUTOFMEMORY; + for(case_iter = stat->case_clausules; case_iter; case_iter = case_iter->next) case_cnt++; @@ -805,6 +872,11 @@ hres = push_instr_addr(ctx, OP_case, case_labels[i]); if(FAILED(hres)) break; + + if(!emit_catch_jmp(ctx, 0, case_labels[i])) { + hres = E_OUTOFMEMORY; + break; + } } } @@ -871,7 +943,14 @@ if(FAILED(hres)) return hres; - return push_instr_bstr_uint(ctx, op, member_expr->identifier, args_cnt); + hres = push_instr_bstr_uint(ctx, op, member_expr->identifier, args_cnt); + if(FAILED(hres)) + return hres; + + if(!emit_catch(ctx, 0)) + return E_OUTOFMEMORY; + + return S_OK; } static HRESULT compile_assign_statement(compile_ctx_t *ctx, assign_statement_t *stat, BOOL is_set) @@ -881,6 +960,8 @@ static HRESULT compile_call_statement(compile_ctx_t *ctx, call_statement_t *stat) { + HRESULT hres; + /* It's challenging for parser to distinguish parameterized assignment with one argument from call * with equality expression argument, so we do it in compiler. */ if(!stat->is_strict && stat->expr->args && !stat->expr->args->next && stat->expr->args->type == EXPR_EQUAL) { @@ -896,7 +977,14 @@ } } - return compile_member_expression(ctx, stat->expr, FALSE); + hres = compile_member_expression(ctx, stat->expr, FALSE); + if(FAILED(hres)) + return hres; + + if(!emit_catch(ctx, 0)) + return E_OUTOFMEMORY; + + return S_OK; } static BOOL lookup_dim_decls(compile_ctx_t *ctx, const WCHAR *name) @@ -940,6 +1028,9 @@ HRESULT hres = push_instr_bstr_uint(ctx, OP_dim, dim_decl->name, ctx->func->array_cnt++); if(FAILED(hres)) return hres; + + if(!emit_catch(ctx, 0)) + return E_OUTOFMEMORY; } if(!dim_decl->next) @@ -978,6 +1069,9 @@ hres = push_instr_bstr(ctx, OP_const, decl->name); if(FAILED(hres)) return hres; + + if(!emit_catch(ctx, 0)) + return E_OUTOFMEMORY; } next_decl = decl->next; @@ -1054,11 +1148,7 @@ static HRESULT exit_label(compile_ctx_t *ctx, unsigned jmp_label) { - statement_ctx_t *iter; - unsigned pop_cnt = 0; - - for(iter = ctx->stat_ctx; iter; iter = iter->next) - pop_cnt += iter->stack_use; + unsigned pop_cnt = stack_offset(ctx); if(pop_cnt) { HRESULT hres; diff -Nru wine1.7-1.7.14/dlls/vbscript/error.c wine1.7-1.7.18/dlls/vbscript/error.c --- wine1.7-1.7.14/dlls/vbscript/error.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/vbscript/error.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,91 +0,0 @@ -/* - * Copyright 2011 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 "vbscript.h" -#include "vbscript_defs.h" - -#include "wine/debug.h" - -WINE_DEFAULT_DEBUG_CHANNEL(vbscript); - -static HRESULT Err_Description(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARIANT *res) -{ - FIXME("\n"); - return E_NOTIMPL; -} - -static HRESULT Err_HelpContext(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARIANT *res) -{ - FIXME("\n"); - return E_NOTIMPL; -} - -static HRESULT Err_HelpFile(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARIANT *res) -{ - FIXME("\n"); - return E_NOTIMPL; -} - -static HRESULT Err_Number(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARIANT *res) -{ - FIXME("\n"); - return E_NOTIMPL; -} - -static HRESULT Err_Source(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARIANT *res) -{ - FIXME("\n"); - return E_NOTIMPL; -} - -static HRESULT Err_Clear(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARIANT *res) -{ - FIXME("\n"); - return E_NOTIMPL; -} - -static HRESULT Err_Raise(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARIANT *res) -{ - FIXME("\n"); - return E_NOTIMPL; -} - -static const builtin_prop_t err_props[] = { - {DISPID_ERR_DESCRIPTION, Err_Description, BP_GETPUT}, - {DISPID_ERR_HELPCONTEXT, Err_HelpContext, BP_GETPUT}, - {DISPID_ERR_HELPFILE, Err_HelpFile, BP_GETPUT}, - {DISPID_ERR_NUMBER, Err_Number, BP_GETPUT}, - {DISPID_ERR_SOURCE, Err_Source, BP_GETPUT}, - {DISPID_ERR_CLEAR, Err_Clear}, - {DISPID_ERR_RAISE, Err_Raise, 0, 5}, -}; - -HRESULT init_err(script_ctx_t *ctx) -{ - HRESULT hres; - - ctx->err_desc.ctx = ctx; - ctx->err_desc.builtin_prop_cnt = sizeof(err_props)/sizeof(*err_props); - ctx->err_desc.builtin_props = err_props; - - hres = get_typeinfo(ErrObj_tid, &ctx->err_desc.typeinfo); - if(FAILED(hres)) - return hres; - - return create_vbdisp(&ctx->err_desc, &ctx->err_obj); -} diff -Nru wine1.7-1.7.14/dlls/vbscript/global.c wine1.7-1.7.18/dlls/vbscript/global.c --- wine1.7-1.7.14/dlls/vbscript/global.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/vbscript/global.c 2014-05-02 18:15:48.000000000 +0000 @@ -1141,8 +1141,8 @@ return hres; if(c < 0 || c >= 0x100) { - FIXME("invalid arg\n"); - return E_FAIL; + WARN("invalid arg %d\n", c); + return MAKE_VBSERROR(VBSE_ILLEGAL_FUNC_CALL); } if(res) { @@ -1866,6 +1866,75 @@ {DISPID_GLOBAL_VBMSGBOXRTLREADING, NULL, BP_GET, VT_I4, MB_RTLREADING} }; +static HRESULT Err_Description(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARIANT *res) +{ + FIXME("\n"); + return E_NOTIMPL; +} + +static HRESULT Err_HelpContext(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARIANT *res) +{ + FIXME("\n"); + return E_NOTIMPL; +} + +static HRESULT Err_HelpFile(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARIANT *res) +{ + FIXME("\n"); + return E_NOTIMPL; +} + +static HRESULT Err_Number(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARIANT *res) +{ + HRESULT hres; + + TRACE("\n"); + + if(!This->desc) + return E_UNEXPECTED; + + if(args_cnt) { + FIXME("setter not implemented\n"); + return E_NOTIMPL; + } + + hres = This->desc->ctx->err_number; + return return_int(res, HRESULT_FACILITY(hres) == FACILITY_VBS ? HRESULT_CODE(hres) : hres); +} + +static HRESULT Err_Source(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARIANT *res) +{ + FIXME("\n"); + return E_NOTIMPL; +} + +static HRESULT Err_Clear(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARIANT *res) +{ + TRACE("\n"); + + if(!This->desc) + return E_UNEXPECTED; + + This->desc->ctx->err_number = S_OK; + return S_OK; +} + +static HRESULT Err_Raise(vbdisp_t *This, VARIANT *args, unsigned args_cnt, VARIANT *res) +{ + FIXME("\n"); + return E_NOTIMPL; +} + +static const builtin_prop_t err_props[] = { + {DISPID_ERR_DESCRIPTION, Err_Description, BP_GETPUT}, + {DISPID_ERR_HELPCONTEXT, Err_HelpContext, BP_GETPUT}, + {DISPID_ERR_HELPFILE, Err_HelpFile, BP_GETPUT}, + {DISPID_ERR_NUMBER, Err_Number, BP_GETPUT}, + {DISPID_ERR_SOURCE, Err_Source, BP_GETPUT}, + {DISPID_ERR_CLEAR, Err_Clear}, + {DISPID_ERR_RAISE, Err_Raise, 0, 5}, +}; + HRESULT init_global(script_ctx_t *ctx) { HRESULT hres; @@ -1886,5 +1955,13 @@ if(FAILED(hres)) return hres; - return init_err(ctx); + ctx->err_desc.ctx = ctx; + ctx->err_desc.builtin_prop_cnt = sizeof(err_props)/sizeof(*err_props); + ctx->err_desc.builtin_props = err_props; + + hres = get_typeinfo(ErrObj_tid, &ctx->err_desc.typeinfo); + if(FAILED(hres)) + return hres; + + return create_vbdisp(&ctx->err_desc, &ctx->err_obj); } diff -Nru wine1.7-1.7.14/dlls/vbscript/interp.c wine1.7-1.7.18/dlls/vbscript/interp.c --- wine1.7-1.7.14/dlls/vbscript/interp.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/vbscript/interp.c 2014-05-02 18:15:48.000000000 +0000 @@ -309,33 +309,42 @@ VariantClear(stack_pop(ctx)); } -static HRESULT stack_pop_val(exec_ctx_t *ctx, variant_val_t *v) +static void stack_pop_deref(exec_ctx_t *ctx, variant_val_t *r) { - VARIANT *var; + VARIANT *v; - var = stack_pop(ctx); - - if(V_VT(var) == (VT_BYREF|VT_VARIANT)) { - v->owned = FALSE; - var = V_VARIANTREF(var); + v = stack_pop(ctx); + if(V_VT(v) == (VT_BYREF|VT_VARIANT)) { + r->owned = FALSE; + r->v = V_VARIANTREF(v); }else { - v->owned = TRUE; + r->owned = TRUE; + r->v = v; } +} + +static inline void release_val(variant_val_t *v) +{ + if(v->owned) + VariantClear(v->v); +} + +static HRESULT stack_pop_val(exec_ctx_t *ctx, variant_val_t *r) +{ + stack_pop_deref(ctx, r); - if(V_VT(var) == VT_DISPATCH) { + if(V_VT(r->v) == VT_DISPATCH) { DISPPARAMS dp = {0}; HRESULT hres; - hres = disp_call(ctx->script, V_DISPATCH(var), DISPID_VALUE, &dp, &v->store); - if(v->owned) - IDispatch_Release(V_DISPATCH(var)); + hres = disp_call(ctx->script, V_DISPATCH(r->v), DISPID_VALUE, &dp, &r->store); + if(r->owned) + IDispatch_Release(V_DISPATCH(r->v)); if(FAILED(hres)) return hres; - v->owned = TRUE; - v->v = &v->store; - }else { - v->v = var; + r->owned = TRUE; + r->v = &r->store; } return S_OK; @@ -370,12 +379,6 @@ return S_OK; } -static inline void release_val(variant_val_t *v) -{ - if(v->owned) - VariantClear(v->v); -} - static int stack_pop_bool(exec_ctx_t *ctx, BOOL *b) { variant_val_t val; @@ -972,8 +975,19 @@ VARIANT v; HRESULT hres; + static const WCHAR regexpW[] = {'r','e','g','e','x','p',0}; + TRACE("%s\n", debugstr_w(arg)); + if(!strcmpiW(arg, regexpW)) { + V_VT(&v) = VT_DISPATCH; + hres = create_regexp(&V_DISPATCH(&v)); + if(FAILED(hres)) + return hres; + + return stack_push(ctx, &v); + } + for(class_desc = ctx->script->classes; class_desc; class_desc = class_desc->next) { if(!strcmpiW(class_desc->name, arg)) break; @@ -1079,21 +1093,25 @@ static HRESULT interp_newenum(exec_ctx_t *ctx) { - VARIANT *v, r; + variant_val_t v; + VARIANT *r; HRESULT hres; TRACE("\n"); - v = stack_pop(ctx); - switch(V_VT(v)) { + stack_pop_deref(ctx, &v); + assert(V_VT(stack_top(ctx, 0)) == VT_EMPTY); + r = stack_top(ctx, 0); + + switch(V_VT(v.v)) { case VT_DISPATCH|VT_BYREF: case VT_DISPATCH: { IEnumVARIANT *iter; DISPPARAMS dp = {0}; VARIANT iterv; - hres = disp_call(ctx->script, V_ISBYREF(v) ? *V_DISPATCHREF(v) : V_DISPATCH(v), DISPID_NEWENUM, &dp, &iterv); - VariantClear(v); + hres = disp_call(ctx->script, V_ISBYREF(v.v) ? *V_DISPATCHREF(v.v) : V_DISPATCH(v.v), DISPID_NEWENUM, &dp, &iterv); + release_val(&v); if(FAILED(hres)) return hres; @@ -1110,17 +1128,17 @@ return hres; } - V_VT(&r) = VT_UNKNOWN; - V_UNKNOWN(&r) = (IUnknown*)iter; + V_VT(r) = VT_UNKNOWN; + V_UNKNOWN(r) = (IUnknown*)iter; break; } default: - FIXME("Unsupported for %s\n", debugstr_variant(v)); - VariantClear(v); + FIXME("Unsupported for %s\n", debugstr_variant(v.v)); + release_val(&v); return E_NOTIMPL; } - return stack_push(ctx, &r); + return S_OK; } static HRESULT interp_enumnext(exec_ctx_t *ctx) @@ -1135,6 +1153,11 @@ TRACE("\n"); + if(V_VT(stack_top(ctx, 0)) == VT_EMPTY) { + FIXME("uninitialized\n"); + return E_FAIL; + } + assert(V_VT(stack_top(ctx, 0)) == VT_UNKNOWN); iter = (IEnumVARIANT*)V_UNKNOWN(stack_top(ctx, 0)); @@ -1944,6 +1967,12 @@ return S_OK; } +static HRESULT interp_catch(exec_ctx_t *ctx) +{ + /* Nothing to do here, the OP is for unwinding only. */ + return S_OK; +} + static const instr_func_t op_funcs[] = { #define X(x,n,a,b) interp_ ## x, OP_LIST @@ -2029,9 +2058,9 @@ if(func->args[i].by_ref) exec.args[i] = *v; else - hres = VariantCopy(exec.args+i, V_VARIANTREF(v)); + hres = VariantCopyInd(exec.args+i, V_VARIANTREF(v)); }else { - hres = VariantCopy(exec.args+i, v); + hres = VariantCopyInd(exec.args+i, v); } if(FAILED(hres)) { release_exec(&exec); @@ -2078,12 +2107,45 @@ op = exec.instr->op; hres = op_funcs[op](&exec); if(FAILED(hres)) { - if(exec.resume_next) - FIXME("Failed %08x in resume next mode\n", hres); - else + ctx->err_number = hres = map_hres(hres); + + if(exec.resume_next) { + unsigned stack_off; + + WARN("Failed %08x in resume next mode\n", hres); + + /* + * Unwinding here is simple. We need to find the next OP_catch, which contains + * information about expected stack size and jump offset on error. Generated + * bytecode needs to guarantee, that simple jump and stack adjustment will + * guarantee proper execution continuation. + */ + while((++exec.instr)->op != OP_catch); + + TRACE("unwind jmp %d stack_off %d\n", exec.instr->arg1.uint, exec.instr->arg2.uint); + + stack_off = exec.instr->arg2.uint; + instr_jmp(&exec, exec.instr->arg1.uint); + + if(exec.top > stack_off) { + stack_popn(&exec, exec.top-stack_off); + }else if(exec.top < stack_off) { + VARIANT v; + + V_VT(&v) = VT_EMPTY; + while(exec.top < stack_off) { + hres = stack_push(&exec, &v); + if(FAILED(hres)) + break; + } + } + + continue; + }else { WARN("Failed %08x\n", hres); - stack_popn(&exec, exec.top); - break; + stack_popn(&exec, exec.top); + break; + } } exec.instr += op_move[op]; diff -Nru wine1.7-1.7.14/dlls/vbscript/Makefile.in wine1.7-1.7.18/dlls/vbscript/Makefile.in --- wine1.7-1.7.14/dlls/vbscript/Makefile.in 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/vbscript/Makefile.in 2014-05-02 18:15:48.000000000 +0000 @@ -3,7 +3,6 @@ C_SRCS = \ compile.c \ - error.c \ global.c \ interp.c \ lex.c \ diff -Nru wine1.7-1.7.14/dlls/vbscript/parser.y wine1.7-1.7.18/dlls/vbscript/parser.y --- wine1.7-1.7.14/dlls/vbscript/parser.y 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/vbscript/parser.y 2014-05-02 18:15:48.000000000 +0000 @@ -205,7 +205,7 @@ { $$ = new_forto_statement(ctx, $2, $4, $6, $7, $9); CHECK_ERROR; } | tFOR tEACH Identifier tIN Expression tNL StatementsNl_opt tNEXT { $$ = new_foreach_statement(ctx, $3, $5, $7); } - | tSELECT tCASE Expression tNL CaseClausules tEND tSELECT + | tSELECT tCASE Expression StSep CaseClausules tEND tSELECT { $$ = new_select_statement(ctx, $3, $5); } MemberExpression @@ -273,8 +273,8 @@ CaseClausules : /* empty */ { $$ = NULL; } - | tCASE tELSE tNL StatementsNl { $$ = new_case_clausule(ctx, NULL, $4, NULL); } - | tCASE ExpressionList tNL StatementsNl_opt CaseClausules + | tCASE tELSE StSep StatementsNl { $$ = new_case_clausule(ctx, NULL, $4, NULL); } + | tCASE ExpressionList StSep StatementsNl_opt CaseClausules { $$ = new_case_clausule(ctx, $2, $4, $5); } Arguments_opt @@ -403,8 +403,8 @@ | PropertyDecl tNL ClassBody { $$ = add_class_function(ctx, $3, $1); CHECK_ERROR; } PropertyDecl - : Storage_opt tPROPERTY tGET tIdentifier EmptyBrackets_opt tNL StatementsNl_opt tEND tPROPERTY - { $$ = new_function_decl(ctx, $4, FUNC_PROPGET, $1, NULL, $7); CHECK_ERROR; } + : Storage_opt tPROPERTY tGET tIdentifier ArgumentsDecl_opt tNL StatementsNl_opt tEND tPROPERTY + { $$ = new_function_decl(ctx, $4, FUNC_PROPGET, $1, $5, $7); CHECK_ERROR; } | Storage_opt tPROPERTY tLET tIdentifier '(' ArgumentDecl ')' tNL StatementsNl_opt tEND tPROPERTY { $$ = new_function_decl(ctx, $4, FUNC_PROPLET, $1, $6, $9); CHECK_ERROR; } | Storage_opt tPROPERTY tSET tIdentifier '(' ArgumentDecl ')' tNL StatementsNl_opt tEND tPROPERTY @@ -434,14 +434,20 @@ | ArgumentDecl ',' ArgumentDeclList { $1->next = $3; $$ = $1; } ArgumentDecl - : Identifier { $$ = new_argument_decl(ctx, $1, TRUE); } - | tBYREF Identifier { $$ = new_argument_decl(ctx, $2, TRUE); } - | tBYVAL Identifier { $$ = new_argument_decl(ctx, $2, FALSE); } + : Identifier EmptyBrackets_opt { $$ = new_argument_decl(ctx, $1, TRUE); } + | tBYREF Identifier EmptyBrackets_opt { $$ = new_argument_decl(ctx, $2, TRUE); } + | tBYVAL Identifier EmptyBrackets_opt { $$ = new_argument_decl(ctx, $2, FALSE); } /* 'property' may be both keyword and identifier, depending on context */ Identifier : tIdentifier { $$ = $1; } | tPROPERTY { $$ = propertyW; } + +/* Some statements accept both new line and ':' as a separator */ +StSep + : tNL + | ':' + %% static int parser_error(parser_ctx_t *ctx, const char *str) diff -Nru wine1.7-1.7.14/dlls/vbscript/tests/api.vbs wine1.7-1.7.18/dlls/vbscript/tests/api.vbs --- wine1.7-1.7.14/dlls/vbscript/tests/api.vbs 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/vbscript/tests/api.vbs 2014-05-02 18:15:48.000000000 +0000 @@ -137,6 +137,20 @@ Call ok(Chr(120.5) = "x", "Chr(120.5) = " & Chr(120.5)) Call ok(Chr(119.5) = "x", "Chr(119.5) = " & Chr(119.5)) +sub testChrError + on error resume next + + call Err.clear() + call Chr(-1) + call ok(Err.number = 5, "Err.number = " & Err.number) + + call Err.clear() + call Chr(256) + call ok(Err.number = 5, "Err.number = " & Err.number) +end sub + +call testChrError + Call ok(isObject(new EmptyClass), "isObject(new EmptyClass) is not true?") Set x = new EmptyClass Call ok(isObject(x), "isObject(x) is not true?") diff -Nru wine1.7-1.7.14/dlls/vbscript/tests/error.vbs wine1.7-1.7.18/dlls/vbscript/tests/error.vbs --- wine1.7-1.7.14/dlls/vbscript/tests/error.vbs 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.18/dlls/vbscript/tests/error.vbs 2014-05-02 18:15:48.000000000 +0000 @@ -0,0 +1,374 @@ +' +' Copyright 2014 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 +' + +Option Explicit + +const E_TESTERROR = &h80080008& + +const VB_E_FORLOOPNOTINITIALIZED = 92 +const VB_E_OBJNOTCOLLECTION = 451 + +const E_NOTIMPL = &h80004001& +const E_NOINTERFACE = &h80004002& +const DISP_E_UNKNOWNINTERFACE = &h80020001& +const DISP_E_MEMBERNOTFOUND = &h80020003& +const DISP_E_PARAMNOTFOUND = &h80020004& +const DISP_E_TYPEMISMATCH = &h80020005& +const DISP_E_UNKNOWNNAME = &h80020006& +const DISP_E_NONAMEDARGS = &h80020007& +const DISP_E_BADVARTYPE = &h80020008& +const DISP_E_OVERFLOW = &h8002000A& +const DISP_E_BADINDEX = &h8002000B& +const DISP_E_UNKNOWNLCID = &h8002000C& +const DISP_E_ARRAYISLOCKED = &h8002000D& +const DISP_E_BADPARAMCOUNT = &h8002000E& +const DISP_E_PARAMNOTOPTIONAL = &h8002000F& +const DISP_E_NOTACOLLECTION = &h80020011& +const TYPE_E_DLLFUNCTIONNOTFOUND = &h8002802F& +const TYPE_E_TYPEMISMATCH = &h80028CA0& +const TYPE_E_OUTOFBOUNDS = &h80028CA1& +const TYPE_E_IOERROR = &h80028CA2& +const TYPE_E_CANTCREATETMPFILE = &h80028CA3& +const STG_E_FILENOTFOUND = &h80030002& +const STG_E_PATHNOTFOUND = &h80030003& +const STG_E_TOOMANYOPENFILES = &h80030004& +const STG_E_ACCESSDENIED = &h80030005& +const STG_E_INSUFFICIENTMEMORY = &h80030008& +const STG_E_NOMOREFILES = &h80030012& +const STG_E_DISKISWRITEPROTECTED = &h80030013& +const STG_E_WRITEFAULT = &h8003001D& +const STG_E_READFAULT = &h8003001E& +const STG_E_SHAREVIOLATION = &h80030020& +const STG_E_LOCKVIOLATION = &h80030021& +const STG_E_FILEALREADYEXISTS = &h80030050& +const STG_E_MEDIUMFULL = &h80030070& +const STG_E_INVALIDNAME = &h800300FC& +const STG_E_INUSE = &h80030100& +const STG_E_NOTCURRENT = &h80030101& +const STG_E_CANTSAVE = &h80030103& +const REGDB_E_CLASSNOTREG = &h80040154& +const MK_E_UNAVAILABLE = &h800401E3& +const MK_E_INVALIDEXTENSION = &h800401E6& +const MK_E_CANTOPENFILE = &h800401EA& +const CO_E_CLASSSTRING = &h800401F3& +const CO_E_APPNOTFOUND = &h800401F5& +const O_E_APPDIDNTREG = &h800401FE& +const E_ACCESSDENIED = &h80070005& +const E_OUTOFMEMORY = &h8007000E& +const E_INVALIDARG = &h80070057& +const RPC_S_SERVER_UNAVAILABLE = &h800706BA& +const CO_E_SERVER_EXEC_FAILURE = &h80080005& + +call ok(Err.Number = 0, "Err.Number = " & Err.Number) + +dim calledFunc + +sub returnTrue + calledFunc = true + returnTrue = true +end sub + +sub testThrow + on error resume next + + dim x, y + + call throwInt(1000) + call ok(Err.Number = 0, "Err.Number = " & Err.Number) + + call throwInt(E_TESTERROR) + call ok(Err.Number = E_TESTERROR, "Err.Number = " & Err.Number) + + call throwInt(1000) + call ok(Err.Number = E_TESTERROR, "Err.Number = " & Err.Number) + + call Err.clear() + call ok(Err.Number = 0, "Err.Number = " & Err.Number) + + x = 6 + calledFunc = false + x = throwInt(E_TESTERROR) and returnTrue() + call ok(x = 6, "x = " & x) + call ok(not calledFunc, "calledFunc = " & calledFunc) + call ok(Err.Number = E_TESTERROR, "Err.Number = " & Err.Number) + + x = false + call Err.clear() + if false and throwInt(E_TESTERROR) then + x = true + else + call ok(false, "unexpected if else branch on throw") + end if + call ok(x, "if branch not taken") + call ok(Err.Number = E_TESTERROR, "Err.Number = " & Err.Number) + + x = false + call Err.clear() + if throwInt(E_TESTERROR) then x = true + call ok(x, "if branch not taken") + call ok(Err.Number = E_TESTERROR, "Err.Number = " & Err.Number) + + x = false + call Err.clear() + if false then + call ok(false, "unexpected if else branch on throw") + elseif throwInt(E_TESTERROR) then + x = true + else + call ok(false, "unexpected if else branch on throw") + end if + call ok(x, "elseif branch not taken") + call ok(Err.Number = E_TESTERROR, "Err.Number = " & Err.Number) + + call Err.clear() + if true then + call throwInt(E_TESTERROR) + else + call ok(false, "unexpected if else branch on throw") + end if + call ok(Err.Number = E_TESTERROR, "Err.Number = " & Err.Number) + + x = false + call Err.clear() + do while throwInt(E_TESTERROR) + call ok(Err.Number = E_TESTERROR, "Err.Number = " & Err.Number) + x = true + exit do + loop + call ok(x, "if branch not taken") + call ok(Err.Number = E_TESTERROR, "Err.Number = " & Err.Number) + + x = 0 + call Err.clear() + do + x = x+1 + call ok(Err.Number = 0, "Err.Number = " & Err.Number) + loop while throwInt(E_TESTERROR) + call ok(x = 1, "if branch not taken") + call ok(Err.Number = E_TESTERROR, "Err.Number = " & Err.Number) + + x = 0 + call Err.clear() + do + x = x+1 + call ok(Err.Number = 0, "Err.Number = " & Err.Number) + loop until throwInt(E_TESTERROR) + call ok(x = 1, "if branch not taken") + call ok(Err.Number = E_TESTERROR, "Err.Number = " & Err.Number) + + call Err.clear() + x = 0 + while x < 2 + x = x+1 + call throwInt(E_TESTERROR) + wend + call ok(x = 2, "x = " & x) + call ok(Err.Number = E_TESTERROR, "Err.Number = " & Err.Number) + + call Err.clear() + x = 2 + y = 0 + for each x in throwInt(E_TESTERROR) + call ok(Err.Number = E_TESTERROR, "Err.Number = " & Err.Number) + y = y+1 + next + call ok(x = 2, "x = " & x) + call ok(y = 1, "y = " & y) + 'todo_wine call ok(Err.Number = VB_E_OBJNOTCOLLECTION, "Err.Number = " & Err.Number) + + Err.clear() + y = 0 + x = 6 + for x = throwInt(E_TESTERROR) to 100 + call ok(Err.Number = E_TESTERROR, "Err.Number = " & Err.Number) + call ok(x = 6, "x = " & x) + y = y+1 + next + call ok(y = 1, "y = " & y) + call ok(x = 6, "x = " & x) + 'todo_wine call ok(Err.Number = VB_E_FORLOOPNOTINITIALIZED, "Err.Number = " & Err.Number) + + Err.clear() + y = 0 + x = 6 + for x = 100 to throwInt(E_TESTERROR) + call ok(Err.Number = E_TESTERROR, "Err.Number = " & Err.Number) + 'todo_wine call ok(x = 6, "x = " & x) + y = y+1 + next + call ok(y = 1, "y = " & y) + 'todo_wine call ok(x = 6, "x = " & x) + 'todo_wine call ok(Err.Number = VB_E_FORLOOPNOTINITIALIZED, "Err.Number = " & Err.Number) + + select case throwInt(E_TESTERROR) + case true + call ok(false, "unexpected case true") + case false + call ok(false, "unexpected case false") + case empty + call ok(false, "unexpected case empty") + case else + call ok(false, "unexpected case else") + end select + call ok(Err.Number = E_TESTERROR, "Err.Number = " & Err.Number) + + x = false + select case false + case true + call ok(false, "unexpected case true") + case throwInt(E_TESTERROR) + x = true + case else + call ok(false, "unexpected case else") + end select + call ok(x, "case not executed") + call ok(Err.Number = E_TESTERROR, "Err.Number = " & Err.Number) + + 'Exception in non-trivial stack context + for x = 1 to 1 + for each y in collectionObj + select case 3 + case 1 + call ok(false, "unexpected case") + case throwInt(E_TESTERROR) + exit for + case 2 + call ok(false, "unexpected case") + end select + next + next +end sub + +call testThrow + +dim x + +sub testOnError(resumeNext) + if resumeNext then + on error resume next + else + on error goto 0 + end if + x = 1 + throwInt(E_TESTERROR) + x = 2 + call ok(Err.Number = E_TESTERROR, "Err.Number = " & Err.Number) +end sub + +sub callTestOnError(resumeNext) + on error resume next + call testOnError(resumeNext) + call ok(Err.Number = E_TESTERROR, "Err.Number = " & Err.Number) +end sub + +x = 0 +call callTestOnError(true) +call ok(x = 2, "x = " & x) + +x = 0 +call callTestOnError(false) +call ok(x = 1, "x = " & x) + +sub testForEachError() + on error resume next + + dim x, y + y = false + for each x in empty + y = true + next + call ok(y, "for each not executed") + 'todo_wine call ok(Err.Number = VB_E_OBJNOTCOLLECTION, "Err.Number = " & Err.Number) +end sub + +call testForEachError() + +sub testHresMap(hres, code) + on error resume next + + call Err.Clear() + call throwInt(hres) + call ok(Err.Number = code, "throw(" & hex(hres) & ") Err.Number = " & Err.Number) +end sub + +testHresMap E_NOTIMPL, 445 +testHresMap E_NOINTERFACE, 430 +testHresMap DISP_E_UNKNOWNINTERFACE, 438 +testHresMap DISP_E_MEMBERNOTFOUND, 438 +testHresMap DISP_E_PARAMNOTFOUND, 448 +testHresMap DISP_E_TYPEMISMATCH, 13 +testHresMap DISP_E_UNKNOWNNAME, 438 +testHresMap DISP_E_NONAMEDARGS, 446 +testHresMap DISP_E_BADVARTYPE, 458 +testHresMap DISP_E_OVERFLOW, 6 +testHresMap DISP_E_BADINDEX, 9 +testHresMap DISP_E_UNKNOWNLCID, 447 +testHresMap DISP_E_ARRAYISLOCKED, 10 +testHresMap DISP_E_BADPARAMCOUNT, 450 +testHresMap DISP_E_PARAMNOTOPTIONAL, 449 +testHresMap DISP_E_NOTACOLLECTION, 451 +testHresMap TYPE_E_DLLFUNCTIONNOTFOUND, 453 +testHresMap TYPE_E_TYPEMISMATCH, 13 +testHresMap TYPE_E_OUTOFBOUNDS, 9 +testHresMap TYPE_E_IOERROR, 57 +testHresMap TYPE_E_CANTCREATETMPFILE, 322 +testHresMap STG_E_FILENOTFOUND, 432 +testHresMap STG_E_PATHNOTFOUND, 76 +testHresMap STG_E_TOOMANYOPENFILES, 67 +testHresMap STG_E_ACCESSDENIED, 70 +testHresMap STG_E_INSUFFICIENTMEMORY, 7 +testHresMap STG_E_NOMOREFILES, 67 +testHresMap STG_E_DISKISWRITEPROTECTED, 70 +testHresMap STG_E_WRITEFAULT, 57 +testHresMap STG_E_READFAULT, 57 +testHresMap STG_E_SHAREVIOLATION, 75 +testHresMap STG_E_LOCKVIOLATION, 70 +testHresMap STG_E_FILEALREADYEXISTS, 58 +testHresMap STG_E_MEDIUMFULL, 61 +testHresMap STG_E_INVALIDNAME, 53 +testHresMap STG_E_INUSE, 70 +testHresMap STG_E_NOTCURRENT, 70 +testHresMap STG_E_CANTSAVE, 57 +testHresMap REGDB_E_CLASSNOTREG, 429 +testHresMap MK_E_UNAVAILABLE, 429 +testHresMap MK_E_INVALIDEXTENSION, 432 +testHresMap MK_E_CANTOPENFILE, 432 +testHresMap CO_E_CLASSSTRING, 429 +testHresMap CO_E_APPNOTFOUND, 429 +testHresMap O_E_APPDIDNTREG, 429 +testHresMap E_ACCESSDENIED, 70 +testHresMap E_OUTOFMEMORY, 7 +testHresMap E_INVALIDARG, 5 +testHresMap RPC_S_SERVER_UNAVAILABLE, 462 +testHresMap CO_E_SERVER_EXEC_FAILURE, 429 + +sub testVBErrorCodes() + on error resume next + + Err.clear() + throwInt(&h800a00aa&) + call ok(Err.number = 170, "Err.number = " & Err.number) + + Err.clear() + throwInt(&h800a10aa&) + call ok(Err.number = 4266, "Err.number = " & Err.number) +end sub + +call testVBErrorCodes + +call reportSuccess() diff -Nru wine1.7-1.7.14/dlls/vbscript/tests/lang.vbs wine1.7-1.7.18/dlls/vbscript/tests/lang.vbs --- wine1.7-1.7.14/dlls/vbscript/tests/lang.vbs 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/vbscript/tests/lang.vbs 2014-05-02 18:15:48.000000000 +0000 @@ -19,6 +19,7 @@ Option Explicit dim x, y, z +Dim obj call ok(true, "true is not true?") ok true, "true is not true?" @@ -224,6 +225,10 @@ if false then x=1 else x=2 end if +x = false +if false then x = true : x = true +Call ok(x = false, "x <> false") + if false then ok false, "if false called" end if @@ -482,6 +487,17 @@ Call ok(y = 1, "y = " & y) Call ok(x = 2, "x = " & x) +Set obj = collectionObj +Call obj.reset() +y = 0 +x = 10 +for each x in obj + y = y+1 + Call ok(x = y, "x <> y") +next +Call ok(y = 3, "y = " & y) +Call ok(getVT(x) = "VT_EMPTY*", "getVT(x) = " & getVT(x)) + x = false select case 3 case 2 @@ -538,6 +554,22 @@ select case 0 end select +x = false +select case 2 + case 3,1,2,4: x = true + case 5,6,7 + Call ok(false, "unexpected case") +end select +Call ok(x, "wrong case") + +x = false +select case 2: case 5,6,7: Call ok(false, "unexpected case") + case 2,1,2,4 + x = true + case else: Call ok(false, "unexpected case else") +end select +Call ok(x, "wrong case") + if false then Sub testsub x = true @@ -747,7 +779,6 @@ set x = testObj Call ok(getVT(x) = "VT_DISPATCH*", "getVT(x=testObj) = " & getVT(x)) -Dim obj Set obj = New EmptyClass Call ok(getVT(obj) = "VT_DISPATCH*", "getVT(obj) = " & getVT(obj)) @@ -818,6 +849,10 @@ Call ok(getVT(publicProp2) = "VT_I2*", "getVT(publicProp2) = " & getVT(publicProp2)) Call ok(getVT(Me.publicProp2) = "VT_I2", "getVT(Me.publicProp2) = " & getVT(Me.publicProp2)) End Sub + + Property Get gsGetProp(x) + gsGetProp = x + End Property End Class Call testDisp(new testClass) @@ -885,6 +920,29 @@ Call (New testclass).publicSub() Call (New testclass).publicSub +class PropTest + property get prop0() + prop0 = 1 + end property + + property get prop1(x) + prop1 = x+1 + end property + + property get prop2(x, y) + prop2 = x+y + end property +end class + +set obj = new PropTest + +call ok(obj.prop0 = 1, "obj.prop0 = " & obj.prop0) +call ok(obj.prop1(3) = 4, "obj.prop1(3) = " & obj.prop1(3)) +call ok(obj.prop2(3,4) = 7, "obj.prop2(3,4) = " & obj.prop2(3,4)) +call obj.prop0() +call obj.prop1(2) +call obj.prop2(3,4) + x = "following ':' is correct syntax" : x = "following ':' is correct syntax" :: : :: x = "also correct syntax" @@ -1061,10 +1119,56 @@ classarr(2) = 3 classarr(3) = 4 End Sub + + Public Sub testVarVT + Call ok(getVT(var) = "VT_ARRAY|VT_VARIANT*", "getVT(var) = " & getVT(var)) + End Sub End Class Set obj = new ArrClass -'todo_wine Call ok(getVT(obj.classarr) = "VT_ARRAY|VT_VARIANT", "getVT(obj.classarr) = " & getVT(obj.classarr)) +Call ok(getVT(obj.classarr) = "VT_ARRAY|VT_VARIANT", "getVT(obj.classarr) = " & getVT(obj.classarr)) 'todo_wine Call ok(obj.classarr(1) = 2, "obj.classarr(1) = " & obj.classarr(1)) +obj.var = arr +Call ok(getVT(obj.var) = "VT_ARRAY|VT_VARIANT", "getVT(obj.var) = " & getVT(obj.var)) +Call obj.testVarVT + +Sub arrarg(byref refarr, byval valarr, byref refarr2, byval valarr2) + Call ok(getVT(refarr) = "VT_ARRAY|VT_BYREF|VT_VARIANT*", "getVT(refarr) = " & getVT(refarr)) + Call ok(getVT(valarr) = "VT_ARRAY|VT_VARIANT*", "getVT(valarr) = " & getVT(valarr)) + Call ok(getVT(refarr2) = "VT_ARRAY|VT_VARIANT*", "getVT(refarr2) = " & getVT(refarr2)) + Call ok(getVT(valarr2) = "VT_ARRAY|VT_VARIANT*", "getVT(valarr2) = " & getVT(valarr2)) +End Sub + +Call arrarg(arr, arr, obj.classarr, obj.classarr) + +Sub arrarg2(byref refarr(), byval valarr(), byref refarr2(), byval valarr2()) + Call ok(getVT(refarr) = "VT_ARRAY|VT_BYREF|VT_VARIANT*", "getVT(refarr) = " & getVT(refarr)) + Call ok(getVT(valarr) = "VT_ARRAY|VT_VARIANT*", "getVT(valarr) = " & getVT(valarr)) + Call ok(getVT(refarr2) = "VT_ARRAY|VT_VARIANT*", "getVT(refarr2) = " & getVT(refarr2)) + Call ok(getVT(valarr2) = "VT_ARRAY|VT_VARIANT*", "getVT(valarr2) = " & getVT(valarr2)) +End Sub + +Call arrarg2(arr, arr, obj.classarr, obj.classarr) + +Sub testarrarg(arg(), vt) + Call ok(getVT(arg) = vt, "getVT() = " & getVT(arg) & " expected " & vt) +End Sub + +Call testarrarg(1, "VT_I2*") +Call testarrarg(false, "VT_BOOL*") +Call testarrarg(Empty, "VT_EMPTY*") + +' It's allowed to declare non-builtin RegExp class... +class RegExp + public property get Global() + Call ok(false, "Global called") + Global = "fail" + end property +end class + +' ...but there is no way to use it because builtin instance is always created +set x = new RegExp +Call ok(x.Global = false, "x.Global = " & x.Global) + reportSuccess() diff -Nru wine1.7-1.7.14/dlls/vbscript/tests/regexp.vbs wine1.7-1.7.18/dlls/vbscript/tests/regexp.vbs --- wine1.7-1.7.14/dlls/vbscript/tests/regexp.vbs 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/vbscript/tests/regexp.vbs 2014-05-02 18:15:48.000000000 +0000 @@ -168,4 +168,10 @@ Call ok(submatch.Item(0) = "a", "submatch.Item(0) = " & submatch.Item(0)) Call ok(submatch.Item(1) = "b", "submatch.Item(0) = " & submatch.Item(1)) +Set x = new regexp +Call ok(x.Pattern = "", "RegExp.Pattern = " & x.Pattern) +Call ok(x.IgnoreCase = false, "RegExp.IgnoreCase = " & x.IgnoreCase) +Call ok(x.Global = false, "RegExp.Global = " & x.Global) +Call ok(x.Multiline = false, "RegExp.Multiline = " & x.Multiline) + Call reportSuccess() diff -Nru wine1.7-1.7.14/dlls/vbscript/tests/rsrc.rc wine1.7-1.7.18/dlls/vbscript/tests/rsrc.rc --- wine1.7-1.7.14/dlls/vbscript/tests/rsrc.rc 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/vbscript/tests/rsrc.rc 2014-05-02 18:15:48.000000000 +0000 @@ -19,6 +19,9 @@ /* @makedep: api.vbs */ api.vbs 40 "api.vbs" +/* @makedep: error.vbs */ +error.vbs 40 "error.vbs" + /* @makedep: lang.vbs */ lang.vbs 40 "lang.vbs" diff -Nru wine1.7-1.7.14/dlls/vbscript/tests/run.c wine1.7-1.7.18/dlls/vbscript/tests/run.c --- wine1.7-1.7.14/dlls/vbscript/tests/run.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/vbscript/tests/run.c 2014-05-02 18:15:48.000000000 +0000 @@ -113,12 +113,16 @@ #define DISPID_GLOBAL_COLLOBJ 1013 #define DISPID_GLOBAL_DOUBLEASSTRING 1014 #define DISPID_GLOBAL_TESTARRAY 1015 +#define DISPID_GLOBAL_THROWINT 1016 #define DISPID_TESTOBJ_PROPGET 2000 #define DISPID_TESTOBJ_PROPPUT 2001 #define DISPID_COLLOBJ_RESET 3000 +#define FACILITY_VBS 0xa +#define MAKE_VBSERROR(code) MAKE_HRESULT(SEVERITY_ERROR, FACILITY_VBS, code) + static const WCHAR testW[] = {'t','e','s','t',0}; static const WCHAR emptyW[] = {0}; @@ -240,7 +244,7 @@ static void test_disp(IDispatch *disp) { - DISPID id, public_prop_id, public_prop2_id, public_func_id, public_sub_id, defvalget_id; + DISPID id, public_prop_id, public_prop2_id, public_func_id, public_sub_id, defvalget_id, gs_getter_id; DISPID named_args[5] = {DISPID_PROPERTYPUT}; VARIANT v, args[5]; DISPPARAMS dp = {args, named_args}; @@ -304,6 +308,12 @@ ok(V_BOOL(&v), "V_BOOL(v) = %x\n", V_BOOL(&v)); dp.cArgs = dp.cNamedArgs = 0; + hres = IDispatchEx_Invoke(dispex, public_prop_id, &IID_NULL, 0, DISPATCH_PROPERTYGET|DISPATCH_METHOD, &dp, &v, &ei, NULL); + ok(hres == S_OK, "InvokeEx failed: %08x\n", hres); + ok(V_VT(&v) == VT_BOOL, "V_VT(v) = %d\n", V_VT(&v)); + ok(V_BOOL(&v), "V_BOOL(v) = %x\n", V_BOOL(&v)); + + dp.cArgs = dp.cNamedArgs = 0; hres = IDispatchEx_InvokeEx(dispex, public_prop_id, 0, DISPATCH_PROPERTYGET, &dp, &v, &ei, NULL); ok(hres == S_OK, "InvokeEx failed: %08x\n", hres); ok(V_VT(&v) == VT_BOOL, "V_VT(v) = %d\n", V_VT(&v)); @@ -384,6 +394,12 @@ ok(V_I2(&v) == 4, "V_I2(v) = %d\n", V_I2(&v)); dp.cArgs = dp.cNamedArgs = 0; + hres = IDispatchEx_Invoke(dispex, public_func_id, &IID_NULL, 0, DISPATCH_METHOD, &dp, &v, &ei, NULL); + ok(hres == S_OK, "InvokeEx failed: %08x\n", hres); + ok(V_VT(&v) == VT_I2, "V_VT(v) = %d\n", V_VT(&v)); + ok(V_I2(&v) == 4, "V_I2(v) = %d\n", V_I2(&v)); + + dp.cArgs = dp.cNamedArgs = 0; hres = IDispatchEx_InvokeEx(dispex, public_sub_id, 0, DISPATCH_PROPERTYGET|DISPATCH_METHOD, &dp, &v, &ei, NULL); ok(hres == S_OK, "InvokeEx failed: %08x\n", hres); ok(V_VT(&v) == VT_EMPTY, "V_VT(v) = %d\n", V_VT(&v)); @@ -427,6 +443,40 @@ ok(hres == S_OK, "GetDispID(publicProp) failed: %08x\n", hres); ok(id == public_prop_id, "id = %d, expected %d\n", id, public_prop_id); + str = a2bstr("gsGetProp"); + hres = IDispatchEx_GetDispID(dispex, str, fdexNameCaseInsensitive, &gs_getter_id); + SysFreeString(str); + ok(hres == S_OK, "GetDispID(publicFunction) failed: %08x\n", hres); + ok(gs_getter_id != -1, "gs_getter_id = -1\n"); + + V_VT(args) = VT_BOOL; + V_BOOL(args) = VARIANT_TRUE; + dp.cNamedArgs = 0; + dp.cArgs = 1; + V_VT(&v) = VT_I8; + hres = IDispatchEx_InvokeEx(dispex, gs_getter_id, 0, DISPATCH_PROPERTYGET, &dp, &v, &ei, NULL); + ok(hres == S_OK, "InvokeEx failed: %08x\n", hres); + ok(V_VT(&v) == VT_BOOL && V_BOOL(&v), "V_VT(v) = %d\n", V_VT(&v)); + + hres = IDispatchEx_InvokeEx(dispex, gs_getter_id, 0, DISPATCH_PROPERTYGET, &dp, NULL, &ei, NULL); + ok(hres == S_OK, "InvokeEx failed: %08x\n", hres); + + V_VT(args) = VT_BOOL; + V_BOOL(args) = VARIANT_FALSE; + dp.cArgs = 1; + V_VT(&v) = VT_I8; + hres = IDispatchEx_InvokeEx(dispex, gs_getter_id, 0, DISPATCH_PROPERTYGET|DISPATCH_METHOD, &dp, &v, &ei, NULL); + ok(hres == S_OK, "InvokeEx failed: %08x\n", hres); + ok(V_VT(&v) == VT_BOOL && !V_BOOL(&v), "V_VT(v) = %d\n", V_VT(&v)); + + V_VT(args) = VT_BOOL; + V_BOOL(args) = VARIANT_TRUE; + V_VT(&v) = VT_I8; + dp.cArgs = 1; + hres = IDispatchEx_InvokeEx(dispex, gs_getter_id, 0, DISPATCH_METHOD, &dp, &v, &ei, NULL); + ok(hres == S_OK, "InvokeEx failed: %08x\n", hres); + ok(V_VT(&v) == VT_BOOL && V_BOOL(&v), "V_VT(v) = %d\n", V_VT(&v)); + IDispatchEx_Release(dispex); } @@ -922,6 +972,11 @@ *pid = DISPID_GLOBAL_TESTARRAY; return S_OK; } + if(!strcmp_wa(bstrName, "throwInt")) { + test_grfdex(grfdex, fdexNameCaseInsensitive); + *pid = DISPID_GLOBAL_THROWINT; + return S_OK; + } if(strict_dispid_check && strcmp_wa(bstrName, "x")) ok(0, "unexpected call %s %x\n", wine_dbgstr_w(bstrName), grfdex); @@ -1200,6 +1255,41 @@ else test_safearray(*V_ARRAYREF(V_VARIANTREF(pdp->rgvarg)), V_I2(pdp->rgvarg+1)); return S_OK; + + case DISPID_GLOBAL_THROWINT: { + VARIANT *v = pdp->rgvarg; + HRESULT hres; + + ok((wFlags & ~INVOKE_PROPERTYGET) == INVOKE_FUNC, "wFlags = %x\n", wFlags); + ok(pdp != NULL, "pdp == NULL\n"); + ok(pdp->rgvarg != NULL, "rgvarg == NULL\n"); + ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n"); + ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs); + ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs); + ok(pei != NULL, "pei == NULL\n"); + if(pvarRes) { + ok(V_VT(pvarRes) == VT_EMPTY, "V_VT(pvarRes) = %d\n", V_VT(pvarRes)); + V_VT(pvarRes) = VT_BOOL; + V_BOOL(pvarRes) = VARIANT_FALSE; + } + + if(V_VT(v) == (VT_VARIANT|VT_BYREF)) + v = V_VARIANTREF(v); + + switch(V_VT(v)) { + case VT_I2: + hres = V_I2(v); + break; + case VT_I4: + hres = V_I4(v); + break; + default: + ok(0, "unexpected vt %d\n", V_VT(v)); + return E_INVALIDARG; + } + + return hres; + } } ok(0, "unexpected call %d\n", id); @@ -1941,6 +2031,20 @@ test_global_vars_ref(TRUE); test_global_vars_ref(FALSE); + hres = parse_script_ar("throwInt(&h80080008&)"); + ok(hres == 0x80080008, "hres = %08x\n", hres); + + /* DISP_E_BADINDEX */ + hres = parse_script_ar("throwInt(&h8002000b&)"); + ok(hres == MAKE_VBSERROR(9), "hres = %08x\n", hres); + + hres = parse_script_ar("throwInt(&h800a0009&)"); + ok(hres == MAKE_VBSERROR(9), "hres = %08x\n", hres); + + /* E_NOTIMPL */ + hres = parse_script_ar("throwInt(&h80004001&)"); + ok(hres == MAKE_VBSERROR(445), "hres = %08x\n", hres); + strict_dispid_check = FALSE; parse_script_a("Sub testsub\n" @@ -1960,6 +2064,7 @@ run_from_res("lang.vbs"); run_from_res("api.vbs"); run_from_res("regexp.vbs"); + run_from_res("error.vbs"); test_procedures(); test_gc(); diff -Nru wine1.7-1.7.14/dlls/vbscript/vbdisp.c wine1.7-1.7.18/dlls/vbscript/vbdisp.c --- wine1.7-1.7.14/dlls/vbscript/vbdisp.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/vbscript/vbdisp.c 2014-05-02 18:15:48.000000000 +0000 @@ -109,7 +109,7 @@ return DISP_E_MEMBERNOTFOUND; /* That's what tests show */ } - hres = VariantCopy(res, v); + hres = VariantCopyInd(res, v); break; case DISPATCH_PROPERTYPUT: { @@ -129,7 +129,7 @@ if(res) V_VT(res) = VT_EMPTY; - hres = VariantCopy(v, put_val); + hres = VariantCopyInd(v, put_val); break; } @@ -340,12 +340,14 @@ static HRESULT WINAPI DispatchEx_Invoke(IDispatchEx *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, - VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) + VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) { vbdisp_t *This = impl_from_IDispatchEx(iface); - 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; + + return IDispatchEx_InvokeEx(&This->IDispatchEx_iface, dispIdMember, lcid, wFlags, pDispParams, pVarResult, pExcepInfo, NULL); } static HRESULT WINAPI DispatchEx_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid) @@ -389,6 +391,15 @@ function_t *func; switch(wFlags) { + case DISPATCH_PROPERTYGET: + func = This->desc->funcs[id].entries[VBDISP_CALLGET]; + if(!func || (func->type != FUNC_PROPGET && func->type != FUNC_DEFGET)) { + WARN("no getter\n"); + return DISP_E_MEMBERNOTFOUND; + } + + return exec_script(This->desc->ctx, func, This, pdp, pvarRes); + case DISPATCH_METHOD: case DISPATCH_METHOD|DISPATCH_PROPERTYGET: func = This->desc->funcs[id].entries[VBDISP_CALLGET]; @@ -968,6 +979,69 @@ return hres; } +#define RPC_E_SERVER_UNAVAILABLE 0x800706ba + +HRESULT map_hres(HRESULT hres) +{ + if(SUCCEEDED(hres) || HRESULT_FACILITY(hres) == FACILITY_VBS) + return hres; + + switch(hres) { + case E_NOTIMPL: return MAKE_VBSERROR(VBSE_ACTION_NOT_SUPPORTED); + case E_NOINTERFACE: return MAKE_VBSERROR(VBSE_OLE_NOT_SUPPORTED); + case DISP_E_UNKNOWNINTERFACE: return MAKE_VBSERROR(VBSE_OLE_NO_PROP_OR_METHOD); + case DISP_E_MEMBERNOTFOUND: return MAKE_VBSERROR(VBSE_OLE_NO_PROP_OR_METHOD); + case DISP_E_PARAMNOTFOUND: return MAKE_VBSERROR(VBSE_NAMED_PARAM_NOT_FOUND); + case DISP_E_TYPEMISMATCH: return MAKE_VBSERROR(VBSE_TYPE_MISMATCH); + case DISP_E_UNKNOWNNAME: return MAKE_VBSERROR(VBSE_OLE_NO_PROP_OR_METHOD); + case DISP_E_NONAMEDARGS: return MAKE_VBSERROR(VBSE_NAMED_ARGS_NOT_SUPPORTED); + case DISP_E_BADVARTYPE: return MAKE_VBSERROR(VBSE_INVALID_TYPELIB_VARIABLE); + case DISP_E_OVERFLOW: return MAKE_VBSERROR(VBSE_OVERFLOW); + case DISP_E_BADINDEX: return MAKE_VBSERROR(VBSE_OUT_OF_BOUNDS); + case DISP_E_UNKNOWNLCID: return MAKE_VBSERROR(VBSE_LOCALE_SETTING_NOT_SUPPORTED); + case DISP_E_ARRAYISLOCKED: return MAKE_VBSERROR(VBSE_ARRAY_LOCKED); + case DISP_E_BADPARAMCOUNT: return MAKE_VBSERROR(VBSE_FUNC_ARITY_MISMATCH); + case DISP_E_PARAMNOTOPTIONAL: return MAKE_VBSERROR(VBSE_PARAMETER_NOT_OPTIONAL); + case DISP_E_NOTACOLLECTION: return MAKE_VBSERROR(VBSE_NOT_ENUM); + case TYPE_E_DLLFUNCTIONNOTFOUND: return MAKE_VBSERROR(VBSE_INVALID_DLL_FUNCTION_NAME); + case TYPE_E_TYPEMISMATCH: return MAKE_VBSERROR(VBSE_TYPE_MISMATCH); + case TYPE_E_OUTOFBOUNDS: return MAKE_VBSERROR(VBSE_OUT_OF_BOUNDS); + case TYPE_E_IOERROR: return MAKE_VBSERROR(VBSE_IO_ERROR); + case TYPE_E_CANTCREATETMPFILE: return MAKE_VBSERROR(VBSE_CANT_CREATE_TMP_FILE); + case STG_E_FILENOTFOUND: return MAKE_VBSERROR(VBSE_OLE_FILE_NOT_FOUND); + case STG_E_PATHNOTFOUND: return MAKE_VBSERROR(VBSE_PATH_NOT_FOUND); + case STG_E_TOOMANYOPENFILES: return MAKE_VBSERROR(VBSE_TOO_MANY_FILES); + case STG_E_ACCESSDENIED: return MAKE_VBSERROR(VBSE_PERMISSION_DENIED); + case STG_E_INSUFFICIENTMEMORY: return MAKE_VBSERROR(VBSE_OUT_OF_MEMORY); + case STG_E_NOMOREFILES: return MAKE_VBSERROR(VBSE_TOO_MANY_FILES); + case STG_E_DISKISWRITEPROTECTED: return MAKE_VBSERROR(VBSE_PERMISSION_DENIED); + case STG_E_WRITEFAULT: return MAKE_VBSERROR(VBSE_IO_ERROR); + case STG_E_READFAULT: return MAKE_VBSERROR(VBSE_IO_ERROR); + case STG_E_SHAREVIOLATION: return MAKE_VBSERROR(VBSE_PATH_FILE_ACCESS); + case STG_E_LOCKVIOLATION: return MAKE_VBSERROR(VBSE_PERMISSION_DENIED); + case STG_E_FILEALREADYEXISTS: return MAKE_VBSERROR(VBSE_FILE_ALREADY_EXISTS); + case STG_E_MEDIUMFULL: return MAKE_VBSERROR(VBSE_DISK_FULL); + case STG_E_INVALIDNAME: return MAKE_VBSERROR(VBSE_FILE_NOT_FOUND); + case STG_E_INUSE: return MAKE_VBSERROR(VBSE_PERMISSION_DENIED); + case STG_E_NOTCURRENT: return MAKE_VBSERROR(VBSE_PERMISSION_DENIED); + case STG_E_CANTSAVE: return MAKE_VBSERROR(VBSE_IO_ERROR); + case REGDB_E_CLASSNOTREG: return MAKE_VBSERROR(VBSE_CANT_CREATE_OBJECT); + case MK_E_UNAVAILABLE: return MAKE_VBSERROR(VBSE_CANT_CREATE_OBJECT); + case MK_E_INVALIDEXTENSION: return MAKE_VBSERROR(VBSE_OLE_FILE_NOT_FOUND); + case MK_E_CANTOPENFILE: return MAKE_VBSERROR(VBSE_OLE_FILE_NOT_FOUND); + case CO_E_CLASSSTRING: return MAKE_VBSERROR(VBSE_CANT_CREATE_OBJECT); + case CO_E_APPNOTFOUND: return MAKE_VBSERROR(VBSE_CANT_CREATE_OBJECT); + case CO_E_APPDIDNTREG: return MAKE_VBSERROR(VBSE_CANT_CREATE_OBJECT); + case E_ACCESSDENIED: return MAKE_VBSERROR(VBSE_PERMISSION_DENIED); + case E_OUTOFMEMORY: return MAKE_VBSERROR(VBSE_OUT_OF_MEMORY); + case E_INVALIDARG: return MAKE_VBSERROR(VBSE_ILLEGAL_FUNC_CALL); + case RPC_E_SERVER_UNAVAILABLE: return MAKE_VBSERROR(VBSE_SERVER_NOT_FOUND); + case CO_E_SERVER_EXEC_FAILURE: return MAKE_VBSERROR(VBSE_CANT_CREATE_OBJECT); + } + + return hres; +} + HRESULT disp_call(script_ctx_t *ctx, IDispatch *disp, DISPID id, DISPPARAMS *dp, VARIANT *retv) { const WORD flags = DISPATCH_METHOD|(retv ? DISPATCH_PROPERTYGET : 0); diff -Nru wine1.7-1.7.14/dlls/vbscript/vbregexp.c wine1.7-1.7.18/dlls/vbscript/vbregexp.c --- wine1.7-1.7.14/dlls/vbscript/vbregexp.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/vbscript/vbregexp.c 2014-05-02 18:15:48.000000000 +0000 @@ -1599,29 +1599,41 @@ RegExp_Replace }; -HRESULT WINAPI VBScriptRegExpFactory_CreateInstance(IClassFactory *iface, IUnknown *pUnkOuter, REFIID riid, void **ppv) +HRESULT create_regexp(IDispatch **ret) { - RegExp2 *ret; + RegExp2 *regexp; HRESULT hres; - TRACE("(%p %s %p)\n", pUnkOuter, debugstr_guid(riid), ppv); - hres = init_regexp_typeinfo(RegExp2_tid); if(FAILED(hres)) return hres; - ret = heap_alloc_zero(sizeof(*ret)); - if(!ret) + regexp = heap_alloc_zero(sizeof(*regexp)); + if(!regexp) return E_OUTOFMEMORY; - ret->IRegExp2_iface.lpVtbl = &RegExp2Vtbl; - ret->IRegExp_iface.lpVtbl = &RegExpVtbl; + regexp->IRegExp2_iface.lpVtbl = &RegExp2Vtbl; + regexp->IRegExp_iface.lpVtbl = &RegExpVtbl; + regexp->ref = 1; + heap_pool_init(®exp->pool); - ret->ref = 1; - heap_pool_init(&ret->pool); + *ret = (IDispatch*)®exp->IRegExp2_iface; + return S_OK; +} + +HRESULT WINAPI VBScriptRegExpFactory_CreateInstance(IClassFactory *iface, IUnknown *pUnkOuter, REFIID riid, void **ppv) +{ + IDispatch *regexp; + HRESULT hres; + + TRACE("(%p %s %p)\n", pUnkOuter, debugstr_guid(riid), ppv); + + hres = create_regexp(®exp); + if(FAILED(hres)) + return hres; - hres = IRegExp2_QueryInterface(&ret->IRegExp2_iface, riid, ppv); - IRegExp2_Release(&ret->IRegExp2_iface); + hres = IDispatch_QueryInterface(regexp, riid, ppv); + IDispatch_Release(regexp); return hres; } diff -Nru wine1.7-1.7.14/dlls/vbscript/vbscript.h wine1.7-1.7.18/dlls/vbscript/vbscript.h --- wine1.7-1.7.14/dlls/vbscript/vbscript.h 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/vbscript/vbscript.h 2014-05-02 18:15:48.000000000 +0000 @@ -189,6 +189,8 @@ class_desc_t err_desc; vbdisp_t *err_obj; + HRESULT err_number; + dynamic_var_t *global_vars; function_t *global_funcs; class_desc_t *classes; @@ -222,6 +224,7 @@ X(assign_ident, 1, ARG_BSTR, ARG_UINT) \ X(assign_member, 1, ARG_BSTR, ARG_UINT) \ X(bool, 1, ARG_INT, 0) \ + X(catch, 1, ARG_ADDR, ARG_UINT) \ X(case, 0, ARG_ADDR, 0) \ X(concat, 1, 0, 0) \ X(const, 1, ARG_BSTR, 0) \ @@ -382,6 +385,43 @@ return INT32_MIN <= d && d <= INT32_MAX && (double)(int)d == d; } +HRESULT create_regexp(IDispatch**) DECLSPEC_HIDDEN; + +HRESULT map_hres(HRESULT) DECLSPEC_HIDDEN; + +#define FACILITY_VBS 0xa +#define MAKE_VBSERROR(code) MAKE_HRESULT(SEVERITY_ERROR, FACILITY_VBS, code) + +#define VBSE_ILLEGAL_FUNC_CALL 5 +#define VBSE_OVERFLOW 6 +#define VBSE_OUT_OF_MEMORY 7 +#define VBSE_OUT_OF_BOUNDS 9 +#define VBSE_ARRAY_LOCKED 10 +#define VBSE_TYPE_MISMATCH 13 +#define VBSE_FILE_NOT_FOUND 53 +#define VBSE_IO_ERROR 57 +#define VBSE_FILE_ALREADY_EXISTS 58 +#define VBSE_DISK_FULL 61 +#define VBSE_TOO_MANY_FILES 67 +#define VBSE_PERMISSION_DENIED 70 +#define VBSE_PATH_FILE_ACCESS 75 +#define VBSE_PATH_NOT_FOUND 76 +#define VBSE_OLE_NOT_SUPPORTED 430 +#define VBSE_OLE_NO_PROP_OR_METHOD 438 +#define VBSE_ACTION_NOT_SUPPORTED 445 +#define VBSE_NAMED_ARGS_NOT_SUPPORTED 446 +#define VBSE_LOCALE_SETTING_NOT_SUPPORTED 447 +#define VBSE_NAMED_PARAM_NOT_FOUND 448 +#define VBSE_INVALID_TYPELIB_VARIABLE 458 +#define VBSE_FUNC_ARITY_MISMATCH 450 +#define VBSE_PARAMETER_NOT_OPTIONAL 449 +#define VBSE_NOT_ENUM 451 +#define VBSE_INVALID_DLL_FUNCTION_NAME 453 +#define VBSE_CANT_CREATE_TMP_FILE 322 +#define VBSE_OLE_FILE_NOT_FOUND 432 +#define VBSE_CANT_CREATE_OBJECT 429 +#define VBSE_SERVER_NOT_FOUND 462 + HRESULT WINAPI VBScriptFactory_CreateInstance(IClassFactory*,IUnknown*,REFIID,void**) DECLSPEC_HIDDEN; HRESULT WINAPI VBScriptRegExpFactory_CreateInstance(IClassFactory*,IUnknown*,REFIID,void**) DECLSPEC_HIDDEN; diff -Nru wine1.7-1.7.14/dlls/version/tests/info.c wine1.7-1.7.18/dlls/version/tests/info.c --- wine1.7-1.7.14/dlls/version/tests/info.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/version/tests/info.c 2014-05-02 18:15:48.000000000 +0000 @@ -508,7 +508,7 @@ SetLastError(0xdeadbeef); ret = VerQueryValueA(ver, "StringFileInfo", (LPVOID*)&p, &len); ok(ret, "VerQueryValue error %u\n", GetLastError()); -todo_wine ok(len == 0, "VerQueryValue returned %u, expected 0\n", len); + ok(len == 0, "VerQueryValue returned %u, expected 0\n", len); ok(p != (char *)0xdeadbeef, "not expected 0xdeadbeef\n"); p = (char *)0xdeadbeef; @@ -516,7 +516,7 @@ SetLastError(0xdeadbeef); ret = VerQueryValueA(ver, "\\StringFileInfo", (LPVOID*)&p, &len); ok(ret, "VerQueryValue error %u\n", GetLastError()); -todo_wine ok(len == 0, "VerQueryValue returned %u, expected 0\n", len); + ok(len == 0, "VerQueryValue returned %u, expected 0\n", len); ok(p != (char *)0xdeadbeef, "not expected 0xdeadbeef\n"); p = (char *)0xdeadbeef; @@ -524,7 +524,7 @@ SetLastError(0xdeadbeef); ret = VerQueryValueA(ver, "\\\\StringFileInfo", (LPVOID*)&p, &len); ok(ret, "VerQueryValue error %u\n", GetLastError()); -todo_wine ok(len == 0, "VerQueryValue returned %u, expected 0\n", len); + ok(len == 0, "VerQueryValue returned %u, expected 0\n", len); ok(p != (char *)0xdeadbeef, "not expected 0xdeadbeef\n"); p = (char *)0xdeadbeef; @@ -532,7 +532,7 @@ SetLastError(0xdeadbeef); ret = VerQueryValueA(ver, "\\StringFileInfo\\\\", (LPVOID*)&p, &len); ok(ret, "VerQueryValue error %u\n", GetLastError()); -todo_wine ok(len == 0, "VerQueryValue returned %u, expected 0\n", len); + ok(len == 0, "VerQueryValue returned %u, expected 0\n", len); ok(p != (char *)0xdeadbeef, "not expected 0xdeadbeef\n"); sprintf(buf, "\\StringFileInfo\\%08x", translation); @@ -541,7 +541,7 @@ SetLastError(0xdeadbeef); ret = VerQueryValueA(ver, buf, (LPVOID*)&p, &len); ok(ret, "VerQueryValue error %u\n", GetLastError()); -todo_wine ok(len == 0, "VerQueryValue returned %u, expected 0\n", len); + ok(len == 0, "VerQueryValue returned %u, expected 0\n", len); ok(p != (char *)0xdeadbeef, "not expected 0xdeadbeef\n"); for (i = 0; i < sizeof(value_name)/sizeof(value_name[0]); i++) @@ -574,10 +574,61 @@ HeapFree(GetProcessHeap(), 0, ver); } +static void test_extra_block(void) +{ + WORD extra_block[] = { + 72, 0, 0, 'W', 'i', 'n', 'e', 'T', 'e', 's', 't', '\0', + 24, 4, 0, 'B', 'i', 'n', 'a', 'r', 'y', '\0', 0xbeef, 0xdead, + 24, 4, 1, 'T', 'e', 'x', 't', '\0', 'B', '-', ')', '\0', + }; + char buf[MAX_PATH]; + UINT len, ret; + ULONG w; + char *ver, *p; + WORD *length; + + ret = GetModuleFileNameA(NULL, buf, sizeof(buf)); + ok(ret, "GetModuleFileNameA failed\n"); + + len = GetFileVersionInfoSizeA(buf, NULL); + ok(len, "GetFileVersionInfoSizeA(%s) error %u\n", buf, GetLastError()); + + ver = HeapAlloc(GetProcessHeap(), 0, len + sizeof(extra_block) * 2); + ok(ver != NULL, "Can't allocate memory\n"); + + ret = GetFileVersionInfoA(buf, 0, len, ver); + ok(ret, "GetFileVersionInfoA error %u\n", GetLastError()); + + /* forge the string table, as windres dislike an extra block */ + length = (WORD *)ver; /* see VS_VERSION_INFO_STRUCT32 for details */ + memcpy(ver + *length, extra_block, sizeof(extra_block)); + *length += sizeof(extra_block); + + p = (char *)0xdeadbeef; + len = 0xdeadbeef; + w = 0xdeadbeef; + ret = VerQueryValueA(ver, "WineTest\\Binary", (LPVOID*)&p, &len); + ok(ret, "VerQueryValue error %u\n", GetLastError()); + ok(len == 4, "VerQueryValue returned %u, expected 4\n", len); + ok(p != (char *)0xdeadbeef, "not expected 0xdeadbeef\n"); + ok(memcmp(p, &w, sizeof(w)) == 0, "got 0x%08x, expected 0x%08x\n", *(PULONG)p, w); + + p = (char *)0xdeadbeef; + len = 0xdeadbeef; + ret = VerQueryValueA(ver, "WineTest\\Text", (LPVOID*)&p, &len); + ok(ret, "VerQueryValue error %u\n", GetLastError()); + ok(len == 4, "VerQueryValue returned %u, expected 4\n", len); + ok(p != (char *)0xdeadbeef, "not expected 0xdeadbeef\n"); + ok(strcmp(p, "B-)") == 0, "got '%s', expected '%s'\n", p, "B-)"); + + HeapFree(GetProcessHeap(), 0, ver); +} + START_TEST(info) { test_info_size(); test_info(); test_32bit_win(); test_VerQueryValueA(); + test_extra_block(); } diff -Nru wine1.7-1.7.14/dlls/version/version.c wine1.7-1.7.18/dlls/version/version.c --- wine1.7-1.7.14/dlls/version/version.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/version/version.c 2014-05-02 18:15:48.000000000 +0000 @@ -567,7 +567,7 @@ { WORD wLength; WORD wValueLength; - WORD wType; + WORD wType; /* 1:Text, 0:Binary */ WCHAR szKey[1]; #if 0 /* variable length structure */ /* DWORD aligned */ @@ -887,7 +887,7 @@ * Gets a value from a 32-bit PE resource */ static BOOL VersionInfo32_QueryValue( const VS_VERSION_INFO_STRUCT32 *info, LPCWSTR lpSubBlock, - LPVOID *lplpBuffer, UINT *puLen ) + LPVOID *lplpBuffer, UINT *puLen, BOOL *pbText ) { TRACE("lpSubBlock : (%s)\n", debugstr_w(lpSubBlock)); @@ -923,6 +923,8 @@ *lplpBuffer = VersionInfo32_Value( info ); if (puLen) *puLen = info->wValueLength; + if (pbText) + *pbText = info->wType; return TRUE; } @@ -934,7 +936,6 @@ LPVOID *lplpBuffer, PUINT puLen ) { static const char rootA[] = "\\"; - static const char varfileinfoA[] = "\\VarFileInfo\\Translation"; const VS_VERSION_INFO_STRUCT16 *info = pBlock; TRACE("(%p,%s,%p,%p)\n", @@ -948,7 +949,7 @@ if ( !VersionInfoIs16( info ) ) { - BOOL ret; + BOOL ret, isText; INT len; LPWSTR lpSubBlockW; @@ -960,11 +961,11 @@ MultiByteToWideChar(CP_ACP, 0, lpSubBlock, -1, lpSubBlockW, len); - ret = VersionInfo32_QueryValue(pBlock, lpSubBlockW, lplpBuffer, puLen); + ret = VersionInfo32_QueryValue(pBlock, lpSubBlockW, lplpBuffer, puLen, &isText); HeapFree(GetProcessHeap(), 0, lpSubBlockW); - if (ret && strcasecmp( lpSubBlock, rootA ) && strcasecmp( lpSubBlock, varfileinfoA )) + if (ret && isText) { /* Set lpBuffer so it points to the 'empty' area where we store * the converted strings @@ -1040,7 +1041,7 @@ return ret; } - return VersionInfo32_QueryValue(info, lpSubBlock, lplpBuffer, puLen); + return VersionInfo32_QueryValue(info, lpSubBlock, lplpBuffer, puLen, NULL); } diff -Nru wine1.7-1.7.14/dlls/wbemprox/builtin.c wine1.7-1.7.18/dlls/wbemprox/builtin.c --- wine1.7-1.7.14/dlls/wbemprox/builtin.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/wbemprox/builtin.c 2014-05-02 18:15:48.000000000 +0000 @@ -75,6 +75,8 @@ {'_','_','P','A','R','A','M','E','T','E','R','S',0}; static const WCHAR class_physicalmediaW[] = {'W','i','n','3','2','_','P','h','y','s','i','c','a','l','M','e','d','i','a',0}; +static const WCHAR class_physicalmemoryW[] = + {'W','i','n','3','2','_','P','h','y','s','i','c','a','l','M','e','m','o','r','y',0}; static const WCHAR class_qualifiersW[] = {'_','_','Q','U','A','L','I','F','I','E','R','S',0}; static const WCHAR class_process_getowner_outW[] = @@ -101,10 +103,16 @@ {'A','d','a','p','t','e','r','T','y','p','e',0}; static const WCHAR prop_addresswidthW[] = {'A','d','d','r','e','s','s','W','i','d','t','h',0}; +static const WCHAR prop_availabilityW[] = + {'A','v','a','i','l','a','b','i','l','i','t','y',0}; static const WCHAR prop_bootableW[] = {'B','o','o','t','a','b','l','e',0}; static const WCHAR prop_bootpartitionW[] = {'B','o','o','t','P','a','r','t','i','t','i','o','n',0}; +static const WCHAR prop_buildnumberW[] = + {'B','u','i','l','d','N','u','m','b','e','r',0}; +static const WCHAR prop_capacityW[] = + {'C','a','p','a','c','i','t','y',0}; static const WCHAR prop_captionW[] = {'C','a','p','t','i','o','n',0}; static const WCHAR prop_classW[] = @@ -121,6 +129,8 @@ {'C','S','D','V','e','r','s','i','o','n',0}; static const WCHAR prop_currentbitsperpixelW[] = {'C','u','r','r','e','n','t','B','i','t','s','P','e','r','P','i','x','e','l',0}; +static const WCHAR prop_currentclockspeedW[] = + {'C','u','r','r','e','n','t','C','l','o','c','k','S','p','e','e','d',0}; static const WCHAR prop_currenthorizontalresW[] = {'C','u','r','r','e','n','t','H','o','r','i','z','o','n','t','a','l','R','e','s','o','l','u','t','i','o','n',0}; static const WCHAR prop_currentverticalresW[] = @@ -161,8 +171,12 @@ {'I','d','e','n','t','i','f','i','c','a','t','i','o','n','C','o','d','e',0}; static const WCHAR prop_indexW[] = {'I','n','d','e','x',0}; +static const WCHAR prop_installdateW[] = + {'I','n','s','t','a','l','l','D','a','t','e',0}; static const WCHAR prop_interfaceindexW[] = {'I','n','t','e','r','f','a','c','e','I','n','d','e','x',0}; +static const WCHAR prop_interfacetypeW[] = + {'I','n','t','e','r','f','a','c','e','T','y','p','e',0}; static const WCHAR prop_intvalueW[] = {'I','n','t','e','g','e','r','V','a','l','u','e',0}; static const WCHAR prop_ipconnectionmetricW[] = @@ -263,6 +277,8 @@ {'V','a','r','i','a','n','t','T','y','p','e',0}; static const WCHAR prop_versionW[] = {'V','e','r','s','i','o','n',0}; +static const WCHAR prop_volumeserialnumberW[] = + {'V','o','l','u','m','e','S','e','r','i','a','l','N','u','m','b','e','r',0}; /* column definitions must be kept in sync with record structures below */ static const struct column col_baseboard[] = @@ -287,6 +303,7 @@ { { prop_deviceidW, CIM_STRING|COL_FLAG_KEY }, { prop_driveW, CIM_STRING|COL_FLAG_DYNAMIC }, + { prop_mediatypeW, CIM_STRING }, { prop_nameW, CIM_STRING }, { prop_pnpdeviceidW, CIM_STRING } }; @@ -314,12 +331,14 @@ }; static const struct column col_diskdrive[] = { - { prop_deviceidW, CIM_STRING|COL_FLAG_KEY }, - { prop_indexW, CIM_UINT32, VT_I4 }, - { prop_manufacturerW, CIM_STRING }, - { prop_mediatypeW, CIM_STRING }, - { prop_modelW, CIM_STRING }, - { prop_serialnumberW, CIM_STRING } + { prop_deviceidW, CIM_STRING|COL_FLAG_DYNAMIC|COL_FLAG_KEY }, + { prop_indexW, CIM_UINT32, VT_I4 }, + { prop_interfacetypeW, CIM_STRING }, + { prop_manufacturerW, CIM_STRING }, + { prop_mediatypeW, CIM_STRING }, + { prop_modelW, CIM_STRING }, + { prop_serialnumberW, CIM_STRING }, + { prop_sizeW, CIM_UINT64 } }; static const struct column col_diskpartition[] = { @@ -335,12 +354,13 @@ }; static const struct column col_logicaldisk[] = { - { prop_deviceidW, CIM_STRING|COL_FLAG_DYNAMIC|COL_FLAG_KEY }, - { prop_drivetypeW, CIM_UINT32, VT_I4 }, - { prop_filesystemW, CIM_STRING|COL_FLAG_DYNAMIC }, - { prop_freespaceW, CIM_UINT64 }, - { prop_nameW, CIM_STRING|COL_FLAG_DYNAMIC }, - { prop_sizeW, CIM_UINT64 } + { prop_deviceidW, CIM_STRING|COL_FLAG_DYNAMIC|COL_FLAG_KEY }, + { prop_drivetypeW, CIM_UINT32, VT_I4 }, + { prop_filesystemW, CIM_STRING|COL_FLAG_DYNAMIC }, + { prop_freespaceW, CIM_UINT64 }, + { prop_nameW, CIM_STRING|COL_FLAG_DYNAMIC }, + { prop_sizeW, CIM_UINT64 }, + { prop_volumeserialnumberW, CIM_STRING|COL_FLAG_DYNAMIC } }; static const struct column col_networkadapter[] = { @@ -365,10 +385,12 @@ }; static const struct column col_os[] = { + { prop_buildnumberW, CIM_STRING }, { prop_captionW, CIM_STRING }, { prop_codesetW, CIM_STRING|COL_FLAG_DYNAMIC }, { prop_countrycodeW, CIM_STRING|COL_FLAG_DYNAMIC }, { prop_csdversionW, CIM_STRING }, + { prop_installdateW, CIM_DATETIME }, { prop_lastbootuptimeW, CIM_DATETIME|COL_FLAG_DYNAMIC }, { prop_localdatetimeW, CIM_DATETIME|COL_FLAG_DYNAMIC }, { prop_localeW, CIM_STRING|COL_FLAG_DYNAMIC }, @@ -377,6 +399,7 @@ { prop_oslanguageW, CIM_UINT32, VT_I4 }, { prop_osproductsuiteW, CIM_UINT32, VT_I4 }, { prop_ostypeW, CIM_UINT16, VT_I4 }, + { prop_serialnumberW, CIM_STRING }, { prop_servicepackmajorW, CIM_UINT16, VT_I4 }, { prop_servicepackminorW, CIM_UINT16, VT_I4 }, { prop_suitemaskW, CIM_UINT32, VT_I4 }, @@ -398,6 +421,10 @@ { prop_serialnumberW, CIM_STRING }, { prop_tagW, CIM_STRING } }; +static const struct column col_physicalmemory[] = +{ + { prop_capacityW, CIM_UINT64 } +}; static const struct column col_process[] = { { prop_captionW, CIM_STRING|COL_FLAG_DYNAMIC }, @@ -415,6 +442,7 @@ { { prop_addresswidthW, CIM_UINT16, VT_I4 }, { prop_cpustatusW, CIM_UINT16 }, + { prop_currentclockspeedW, CIM_UINT32, VT_I4 }, { prop_deviceidW, CIM_STRING|COL_FLAG_DYNAMIC|COL_FLAG_KEY }, { prop_familyW, CIM_UINT16, VT_I4 }, { prop_manufacturerW, CIM_STRING|COL_FLAG_DYNAMIC }, @@ -467,6 +495,7 @@ { { prop_adapterdactypeW, CIM_STRING }, { prop_adapterramW, CIM_UINT32, VT_I4 }, + { prop_availabilityW, CIM_UINT16 }, { prop_currentbitsperpixelW, CIM_UINT32 }, { prop_currenthorizontalresW, CIM_UINT32 }, { prop_currentverticalresW, CIM_UINT32 }, @@ -494,6 +523,8 @@ {'W','i','n','e',0}; static const WCHAR bios_versionW[] = {'W','I','N','E',' ',' ',' ','-',' ','1',0}; +static const WCHAR cdromdrive_mediatypeW[] = + {'C','D','-','R','O','M',0}; static const WCHAR cdromdrive_nameW[] = {'W','i','n','e',' ','C','D','-','R','O','M',' ','A','T','A',' ','D','e','v','i','c','e',0}; static const WCHAR cdromdrive_pnpdeviceidW[]= @@ -509,12 +540,14 @@ {'T','h','e',' ','W','i','n','e',' ','P','r','o','j','e','c','t',0}; static const WCHAR compsys_modelW[] = {'W','i','n','e',0}; -static const WCHAR diskdrive_deviceidW[] = - {'\\','\\','\\','\\','.','\\','\\','P','H','Y','S','I','C','A','L','D','R','I','V','E','0',0}; +static const WCHAR diskdrive_interfacetypeW[] = + {'I','D','E',0}; static const WCHAR diskdrive_manufacturerW[] = {'(','S','t','a','n','d','a','r','d',' ','d','i','s','k',' ','d','r','i','v','e','s',')',0}; -static const WCHAR diskdrive_mediatypeW[] = +static const WCHAR diskdrive_mediatype_fixedW[] = {'F','i','x','e','d',' ','h','a','r','d',' ','d','i','s','k',0}; +static const WCHAR diskdrive_mediatype_removableW[] = + {'R','e','m','o','v','a','b','l','e',' ','m','e','d','i','a',0}; static const WCHAR diskdrive_modelW[] = {'W','i','n','e',' ','D','i','s','k',' ','D','r','i','v','e',0}; static const WCHAR diskdrive_serialW[] = @@ -523,20 +556,26 @@ {'P','C','I','\\','V','E','N','_','8','0','8','6','&','D','E','V','_','1','0','0','E','&', 'S','U','B','S','Y','S','_','0','0','1','E','8','0','8','6','&','R','E','V','_','0','2','\\', '3','&','2','6','7','A','6','1','6','A','&','1','&','1','8',0}; +static const WCHAR os_32bitW[] = + {'3','2','-','b','i','t',0}; +static const WCHAR os_64bitW[] = + {'6','4','-','b','i','t',0}; +static const WCHAR os_buildnumberW[] = + {'2','6','0','0',0}; static const WCHAR os_captionW[] = {'M','i','c','r','o','s','o','f','t',' ','W','i','n','d','o','w','s',' ','X','P',' ', 'V','e','r','s','i','o','n',' ','=',' ','5','.','1','.','2','6','0','0',0}; static const WCHAR os_csdversionW[] = {'S','e','r','v','i','c','e',' ','P','a','c','k',' ','3',0}; -static const WCHAR os_32bitW[] = - {'3','2','-','b','i','t',0}; -static const WCHAR os_64bitW[] = - {'6','4','-','b','i','t',0}; +static const WCHAR os_installdateW[] = + {'2','0','1','4','0','1','0','1','0','0','0','0','0','0','.','0','0','0','0','0','0','+','0','0','0',0}; static const WCHAR os_nameW[] = {'M','i','c','r','o','s','o','f','t',' ','W','i','n','d','o','w','s',' ','X','P',' ', 'P','r','o','f','e','s','s','i','o','n','a','l','|','C',':','\\','W','I','N','D','O','W','S', '|','\\','D','e','v','i','c','e','\\','H','a','r','d','d','i','s','k','0', '\\','P','a','r','t','i','t','i','o','n','1',0}; +static const WCHAR os_serialnumberW[] = + {'1','2','3','4','5','-','O','E','M','-','1','2','3','4','5','6','7','-','1','2','3','4','5',0}; static const WCHAR os_versionW[] = {'5','.','1','.','2','6','0','0',0}; static const WCHAR physicalmedia_tagW[] = @@ -571,6 +610,7 @@ { const WCHAR *device_id; const WCHAR *drive; + const WCHAR *mediatype; const WCHAR *name; const WCHAR *pnpdevice_id; }; @@ -600,10 +640,12 @@ { const WCHAR *device_id; UINT32 index; + const WCHAR *interfacetype; const WCHAR *manufacturer; const WCHAR *mediatype; - const WCHAR *name; + const WCHAR *model; const WCHAR *serialnumber; + UINT64 size; }; struct record_diskpartition { @@ -625,6 +667,7 @@ UINT64 freespace; const WCHAR *name; UINT64 size; + const WCHAR *volumeserialnumber; }; struct record_networkadapter { @@ -649,10 +692,12 @@ }; struct record_operatingsystem { + const WCHAR *buildnumber; const WCHAR *caption; const WCHAR *codeset; const WCHAR *countrycode; const WCHAR *csdversion; + const WCHAR *installdate; const WCHAR *lastbootuptime; const WCHAR *localdatetime; const WCHAR *locale; @@ -661,6 +706,7 @@ UINT32 oslanguage; UINT32 osproductsuite; UINT16 ostype; + const WCHAR *serialnumber; UINT16 servicepackmajor; UINT16 servicepackminor; UINT32 suitemask; @@ -682,6 +728,10 @@ const WCHAR *serialnumber; const WCHAR *tag; }; +struct record_physicalmemory +{ + UINT64 capacity; +}; struct record_process { const WCHAR *caption; @@ -699,6 +749,7 @@ { UINT16 addresswidth; UINT16 cpu_status; + UINT32 currentclockspeed; const WCHAR *device_id; UINT16 family; const WCHAR *manufacturer; @@ -751,6 +802,7 @@ { const WCHAR *adapter_dactype; UINT32 adapter_ram; + UINT16 availability; UINT32 current_bitsperpixel; UINT32 current_horizontalres; UINT32 current_verticalres; @@ -770,11 +822,6 @@ { bios_descriptionW, bios_descriptionW, bios_manufacturerW, bios_releasedateW, bios_serialnumberW, bios_smbiosbiosversionW, bios_versionW } }; -static const struct record_diskdrive data_diskdrive[] = -{ - { diskdrive_deviceidW, 0, diskdrive_manufacturerW, diskdrive_mediatypeW, diskdrive_modelW, - diskdrive_serialW } -}; static const struct record_param data_param[] = { { class_processW, method_getownerW, -1, param_returnvalueW, CIM_UINT32, VT_I4 }, @@ -885,6 +932,7 @@ rec->device_id = cdromdrive_pnpdeviceidW; sprintfW( drive, fmtW, 'A' + i ); rec->drive = heap_strdupW( drive ); + rec->mediatype = cdromdrive_mediatypeW; rec->name = cdromdrive_nameW; rec->pnpdevice_id = cdromdrive_pnpdeviceidW; if (!match_row( table, row, cond, &status )) @@ -1266,11 +1314,13 @@ DWORD drives = GetLogicalDrives(); WIN32_FIND_DATAW data; HANDLE handle; - struct dirstack *dirstack = alloc_dirstack(2); + struct dirstack *dirstack; enum fill_status status = FILL_STATUS_UNFILTERED; if (!resize_table( table, 8, sizeof(*rec) )) return FILL_STATUS_FAILED; + dirstack = alloc_dirstack(2); + for (i = 0; i < sizeof(drives); i++) { if (!(drives & (1 << i))) continue; @@ -1296,6 +1346,7 @@ if (!resize_table( table, row + 1, sizeof(*rec) )) { status = FILL_STATUS_FAILED; + FindClose( handle ); goto done; } if (!strcmpW( data.cFileName, dotW ) || !strcmpW( data.cFileName, dotdotW )) continue; @@ -1305,6 +1356,7 @@ { if (push_dir( dirstack, new_path, len )) continue; heap_free( new_path ); + FindClose( handle ); status = FILL_STATUS_FAILED; goto done; } @@ -1438,16 +1490,6 @@ return status; } -static WCHAR *get_filesystem( const WCHAR *root ) -{ - static const WCHAR ntfsW[] = {'N','T','F','S',0}; - WCHAR buffer[MAX_PATH + 1]; - - if (GetVolumeInformationW( root, NULL, 0, NULL, NULL, NULL, buffer, MAX_PATH + 1 )) - return heap_strdupW( buffer ); - return heap_strdupW( ntfsW ); -} - static UINT64 get_freespace( const WCHAR *dir, UINT64 *disksize ) { WCHAR root[] = {'\\','\\','.','\\','A',':',0}; @@ -1469,6 +1511,69 @@ return free.QuadPart; } +static enum fill_status fill_diskdrive( struct table *table, const struct expr *cond ) +{ + static const WCHAR fmtW[] = + {'\\','\\','\\','\\','.','\\','\\','P','H','Y','S','I','C','A','L','D','R','I','V','E','%','u',0}; + WCHAR device_id[sizeof(fmtW)/sizeof(fmtW[0]) + 10], root[] = {'A',':','\\',0}; + struct record_diskdrive *rec; + UINT i, row = 0, offset = 0, index = 0, type; + UINT64 size = 1024 * 1024 * 1024; + DWORD drives = GetLogicalDrives(); + enum fill_status status = FILL_STATUS_UNFILTERED; + + if (!resize_table( table, 2, sizeof(*rec) )) return FILL_STATUS_FAILED; + + for (i = 0; i < sizeof(drives); i++) + { + if (drives & (1 << i)) + { + root[0] = 'A' + i; + type = GetDriveTypeW( root ); + if (type != DRIVE_FIXED && type != DRIVE_REMOVABLE) + continue; + + if (!resize_table( table, row + 1, sizeof(*rec) )) return FILL_STATUS_FAILED; + + rec = (struct record_diskdrive *)(table->data + offset); + sprintfW( device_id, fmtW, index ); + rec->device_id = heap_strdupW( device_id ); + rec->index = index; + rec->interfacetype = diskdrive_interfacetypeW; + rec->manufacturer = diskdrive_manufacturerW; + if (type == DRIVE_FIXED) + rec->mediatype = diskdrive_mediatype_fixedW; + else + rec->mediatype = diskdrive_mediatype_removableW; + rec->model = diskdrive_modelW; + rec->serialnumber = diskdrive_serialW; + get_freespace( root, &size ); + rec->size = size; + if (!match_row( table, row, cond, &status )) + { + free_row_values( table, row ); + continue; + } + offset += sizeof(*rec); + index++; + row++; + } + } + TRACE("created %u rows\n", row); + table->num_rows = row; + return status; +} + +static WCHAR *get_filesystem( const WCHAR *root ) +{ + static const WCHAR ntfsW[] = {'N','T','F','S',0}; + WCHAR buffer[MAX_PATH + 1]; + + if (GetVolumeInformationW( root, NULL, 0, NULL, NULL, NULL, buffer, MAX_PATH + 1 )) + return heap_strdupW( buffer ); + return heap_strdupW( ntfsW ); +} + static enum fill_status fill_diskpartition( struct table *table, const struct expr *cond ) { static const WCHAR fmtW[] = @@ -1520,6 +1625,17 @@ return status; } +static WCHAR *get_volumeserialnumber( const WCHAR *root ) +{ + static const WCHAR fmtW[] = {'%','0','8','X',0}; + DWORD serial = 0; + WCHAR buffer[9]; + + GetVolumeInformationW( root, NULL, 0, &serial, NULL, NULL, NULL, 0 ); + sprintfW( buffer, fmtW, serial ); + return heap_strdupW( buffer ); +} + static enum fill_status fill_logicaldisk( struct table *table, const struct expr *cond ) { static const WCHAR fmtW[] = {'%','c',':',0}; @@ -1545,12 +1661,13 @@ rec = (struct record_logicaldisk *)(table->data + offset); sprintfW( device_id, fmtW, 'A' + i ); - rec->device_id = heap_strdupW( device_id ); - rec->drivetype = type; - rec->filesystem = get_filesystem( root ); - rec->freespace = get_freespace( root, &size ); - rec->name = heap_strdupW( device_id ); - rec->size = size; + rec->device_id = heap_strdupW( device_id ); + rec->drivetype = type; + rec->filesystem = get_filesystem( root ); + rec->freespace = get_freespace( root, &size ); + rec->name = heap_strdupW( device_id ); + rec->size = size; + rec->volumeserialnumber = get_volumeserialnumber( root ); if (!match_row( table, row, cond, &status )) { free_row_values( table, row ); @@ -1718,6 +1835,24 @@ return status; } +static enum fill_status fill_physicalmemory( struct table *table, const struct expr *cond ) +{ + struct record_physicalmemory *rec; + enum fill_status status = FILL_STATUS_UNFILTERED; + UINT row = 0; + + if (!resize_table( table, 1, sizeof(*rec) )) return FILL_STATUS_FAILED; + + rec = (struct record_physicalmemory *)table->data; + rec->capacity = get_total_physical_memory(); + if (!match_row( table, row, cond, &status )) free_row_values( table, row ); + else row++; + + TRACE("created %u rows\n", row); + table->num_rows = row; + return status; +} + static WCHAR *get_cmdline( DWORD process_id ) { if (process_id == GetCurrentProcessId()) return heap_strdupW( GetCommandLineW() ); @@ -1828,7 +1963,21 @@ regs_to_str( regs, 16, name + 32 ); } } -static UINT get_processor_maxclockspeed( void ) +static UINT get_processor_currentclockspeed( UINT index ) +{ + PROCESSOR_POWER_INFORMATION *info; + UINT ret = 1000, size = get_processor_count() * sizeof(PROCESSOR_POWER_INFORMATION); + NTSTATUS status; + + if ((info = heap_alloc( size ))) + { + status = NtPowerInformation( ProcessorInformation, NULL, 0, info, size ); + if (!status) ret = info[index].CurrentMhz; + heap_free( info ); + } + return ret; +} +static UINT get_processor_maxclockspeed( UINT index ) { PROCESSOR_POWER_INFORMATION *info; UINT ret = 1000, size = get_processor_count() * sizeof(PROCESSOR_POWER_INFORMATION); @@ -1837,7 +1986,7 @@ if ((info = heap_alloc( size ))) { status = NtPowerInformation( ProcessorInformation, NULL, 0, info, size ); - if (!status) ret = info[0].MaxMhz; + if (!status) ret = info[index].MaxMhz; heap_free( info ); } return ret; @@ -1855,7 +2004,7 @@ static const WCHAR fmtW[] = {'C','P','U','%','u',0}; WCHAR device_id[14], processor_id[17], manufacturer[13], name[49] = {0}; struct record_processor *rec; - UINT i, offset = 0, maxclockspeed, num_cores, num_logical_processors, count = get_processor_count(); + UINT i, offset = 0, num_cores, num_logical_processors, count = get_processor_count(); enum fill_status status = FILL_STATUS_UNFILTERED; if (!resize_table( table, count, sizeof(*rec) )) return FILL_STATUS_FAILED; @@ -1864,7 +2013,6 @@ get_processor_manufacturer( manufacturer ); get_processor_name( name ); - maxclockspeed = get_processor_maxclockspeed(); num_logical_processors = get_logical_processor_count( &num_cores ) / count; num_cores /= count; @@ -1873,11 +2021,12 @@ rec = (struct record_processor *)(table->data + offset); rec->addresswidth = get_osarchitecture() == os_32bitW ? 32 : 64; rec->cpu_status = 1; /* CPU Enabled */ + rec->currentclockspeed = get_processor_currentclockspeed( i ); sprintfW( device_id, fmtW, i ); rec->device_id = heap_strdupW( device_id ); rec->family = 2; /* Unknown */ rec->manufacturer = heap_strdupW( manufacturer ); - rec->maxclockspeed = maxclockspeed; + rec->maxclockspeed = get_processor_maxclockspeed( i ); rec->name = heap_strdupW( name ); rec->num_cores = num_cores; rec->num_logical_processors = num_logical_processors; @@ -1977,10 +2126,12 @@ if (!resize_table( table, 1, sizeof(*rec) )) return FILL_STATUS_FAILED; rec = (struct record_operatingsystem *)table->data; + rec->buildnumber = os_buildnumberW; rec->caption = os_captionW; rec->codeset = get_codeset(); rec->countrycode = get_countrycode(); rec->csdversion = os_csdversionW; + rec->installdate = os_installdateW; rec->lastbootuptime = get_lastbootuptime(); rec->localdatetime = get_localdatetime(); rec->locale = get_locale(); @@ -1989,6 +2140,7 @@ rec->oslanguage = GetSystemDefaultLangID(); rec->osproductsuite = 2461140; /* Windows XP Professional */ rec->ostype = 18; /* WINNT */ + rec->serialnumber = os_serialnumberW; rec->servicepackmajor = 3; rec->servicepackminor = 0; rec->suitemask = 272; /* Single User + Terminal */ @@ -2216,6 +2368,7 @@ rec = (struct record_videocontroller *)table->data; rec->adapter_dactype = videocontroller_dactypeW; rec->adapter_ram = vidmem; + rec->availability = 3; /* Running or Full Power */ rec->current_bitsperpixel = get_bits_per_pixel( &hres, &vres ); rec->current_horizontalres = hres; rec->current_verticalres = vres; @@ -2242,7 +2395,7 @@ { class_compsysW, SIZEOF(col_compsys), col_compsys, 0, 0, NULL, fill_compsys }, { class_datafileW, SIZEOF(col_datafile), col_datafile, 0, 0, NULL, fill_datafile }, { class_directoryW, SIZEOF(col_directory), col_directory, 0, 0, NULL, fill_directory }, - { class_diskdriveW, SIZEOF(col_diskdrive), col_diskdrive, SIZEOF(data_diskdrive), 0, (BYTE *)data_diskdrive }, + { class_diskdriveW, SIZEOF(col_diskdrive), col_diskdrive, 0, 0, NULL, fill_diskdrive }, { class_diskpartitionW, SIZEOF(col_diskpartition), col_diskpartition, 0, 0, NULL, fill_diskpartition }, { class_logicaldiskW, SIZEOF(col_logicaldisk), col_logicaldisk, 0, 0, NULL, fill_logicaldisk }, { class_logicaldisk2W, SIZEOF(col_logicaldisk), col_logicaldisk, 0, 0, NULL, fill_logicaldisk }, @@ -2252,6 +2405,7 @@ { class_osW, SIZEOF(col_os), col_os, 0, 0, NULL, fill_os }, { class_paramsW, SIZEOF(col_param), col_param, SIZEOF(data_param), 0, (BYTE *)data_param }, { class_physicalmediaW, SIZEOF(col_physicalmedia), col_physicalmedia, SIZEOF(data_physicalmedia), 0, (BYTE *)data_physicalmedia }, + { class_physicalmemoryW, SIZEOF(col_physicalmemory), col_physicalmemory, 0, 0, NULL, fill_physicalmemory }, { class_processW, SIZEOF(col_process), col_process, 0, 0, NULL, fill_process }, { class_processorW, SIZEOF(col_processor), col_processor, 0, 0, NULL, fill_processor }, { class_qualifiersW, SIZEOF(col_qualifier), col_qualifier, SIZEOF(data_qualifier), 0, (BYTE *)data_qualifier }, diff -Nru wine1.7-1.7.14/dlls/wbemprox/class.c wine1.7-1.7.18/dlls/wbemprox/class.c --- wine1.7-1.7.14/dlls/wbemprox/class.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/wbemprox/class.c 2014-05-02 18:15:48.000000000 +0000 @@ -476,17 +476,17 @@ TRACE("%p, %s, %08x, %s, %p\n", iface, debugstr_w(wszQualifierName), lFlags, debugstr_variant(pQualifierVal), pNames); - if (wszQualifierName || pQualifierVal) - { - FIXME("qualifier not supported\n"); - return E_NOTIMPL; - } - if (lFlags != WBEM_FLAG_ALWAYS) + if (lFlags != WBEM_FLAG_ALWAYS && + lFlags != WBEM_FLAG_NONSYSTEM_ONLY && + lFlags != WBEM_FLAG_SYSTEM_ONLY) { FIXME("flags %08x not supported\n", lFlags); return E_NOTIMPL; } - return get_properties( ec->query->view, pNames ); + if (wszQualifierName || pQualifierVal) + FIXME("qualifier not supported\n"); + + return get_properties( ec->query->view, lFlags, pNames ); } static HRESULT WINAPI class_object_BeginEnumeration( @@ -511,23 +511,30 @@ CIMTYPE *pType, LONG *plFlavor ) { - struct class_object *co = impl_from_IWbemClassObject( iface ); - struct enum_class_object *ec = impl_from_IEnumWbemClassObject( co->iter ); - struct view *view = ec->query->view; - BSTR property; + struct class_object *obj = impl_from_IWbemClassObject( iface ); + struct enum_class_object *iter = impl_from_IEnumWbemClassObject( obj->iter ); + struct view *view = iter->query->view; + BSTR prop; HRESULT hr; + UINT i; TRACE("%p, %08x, %p, %p, %p, %p\n", iface, lFlags, strName, pVal, pType, plFlavor); - if (!(property = get_property_name( co->name, co->index_property ))) return WBEM_S_NO_MORE_DATA; - if ((hr = get_propval( view, co->index, property, pVal, pType, plFlavor ) != S_OK)) + for (i = obj->index_property; i < view->table->num_cols; i++) { - SysFreeString( property ); - return hr; + if (is_method( view->table, i )) continue; + if (!is_selected_prop( view, view->table->columns[i].name )) continue; + if (!(prop = SysAllocString( view->table->columns[i].name ))) return E_OUTOFMEMORY; + if ((hr = get_propval( view, obj->index, prop, pVal, pType, plFlavor )) != S_OK) + { + SysFreeString( prop ); + return hr; + } + obj->index_property = i + 1; + *strName = prop; + return S_OK; } - *strName = property; - co->index_property++; - return S_OK; + return WBEM_S_NO_MORE_DATA; } static HRESULT WINAPI class_object_EndEnumeration( diff -Nru wine1.7-1.7.14/dlls/wbemprox/query.c wine1.7-1.7.18/dlls/wbemprox/query.c --- wine1.7-1.7.14/dlls/wbemprox/query.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/wbemprox/query.c 2014-05-02 18:15:48.000000000 +0000 @@ -424,7 +424,7 @@ return hr; } -static BOOL is_selected_prop( const struct view *view, const WCHAR *name ) +BOOL is_selected_prop( const struct view *view, const WCHAR *name ) { const struct property *prop = view->proplist; @@ -563,7 +563,7 @@ return ret; } -static inline BOOL is_method( const struct table *table, UINT column ) +BOOL is_method( const struct table *table, UINT column ) { return table->columns[column].type & COL_FLAG_METHOD; } @@ -959,18 +959,25 @@ return set_value( view->table, row, column, val, type ); } -HRESULT get_properties( const struct view *view, SAFEARRAY **props ) +HRESULT get_properties( const struct view *view, LONG flags, SAFEARRAY **props ) { SAFEARRAY *sa; BSTR str; LONG i; - UINT num_props = count_properties( view ); + UINT num_props = count_selected_properties( view ); if (!(sa = SafeArrayCreateVector( VT_BSTR, 0, num_props ))) return E_OUTOFMEMORY; for (i = 0; i < view->table->num_cols; i++) { + BOOL is_system; + if (is_method( view->table, i )) continue; + if (!is_selected_prop( view, view->table->columns[i].name )) continue; + + is_system = is_system_prop( view->table->columns[i].name ); + if ((flags & WBEM_FLAG_NONSYSTEM_ONLY) && is_system) continue; + else if ((flags & WBEM_FLAG_SYSTEM_ONLY) && !is_system) continue; str = SysAllocString( view->table->columns[i].name ); if (!str || SafeArrayPutElement( sa, &i, str ) != S_OK) diff -Nru wine1.7-1.7.14/dlls/wbemprox/table.c wine1.7-1.7.18/dlls/wbemprox/table.c --- wine1.7-1.7.14/dlls/wbemprox/table.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/wbemprox/table.c 2014-05-02 18:15:48.000000000 +0000 @@ -406,28 +406,3 @@ release_table( table ); return NULL; } - -BSTR get_property_name( const WCHAR *class, UINT index ) -{ - struct table *table; - UINT i, count = 0; - BSTR ret; - - if (!(table = grab_table( class ))) return NULL; - - for (i = 0; i < table->num_cols; i++) - { - if (!(table->columns[i].type & COL_FLAG_METHOD)) - { - if (index == count) - { - ret = SysAllocString( table->columns[i].name ); - release_table( table ); - return ret; - } - count++; - } - } - release_table( table ); - return NULL; -} diff -Nru wine1.7-1.7.14/dlls/wbemprox/tests/query.c wine1.7-1.7.18/dlls/wbemprox/tests/query.c --- wine1.7-1.7.14/dlls/wbemprox/tests/query.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/wbemprox/tests/query.c 2014-05-02 18:15:48.000000000 +0000 @@ -46,7 +46,7 @@ { VARIANT var; - IEnumWbemClassObject_Next( *result, WBEM_INFINITE, 1, &obj, &count ); + IEnumWbemClassObject_Next( *result, 10000, 1, &obj, &count ); if (!count) break; if (IWbemClassObject_Get( obj, captionW, 0, &var, NULL, NULL ) == WBEM_S_NO_ERROR) @@ -616,6 +616,40 @@ SysFreeString( query ); } +static void test_GetNames( IWbemServices *services ) +{ + static const WCHAR queryW[] = + {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ','W','i','n','3','2','_', + 'O','p','e','r','a','t','i','n','g','S','y','s','t','e','m',0}; + BSTR wql = SysAllocString( wqlW ), query = SysAllocString( queryW ); + IEnumWbemClassObject *result; + HRESULT hr; + + hr = IWbemServices_ExecQuery( services, wql, query, 0, NULL, &result ); + ok( hr == S_OK, "got %08x\n", hr ); + + for (;;) + { + IWbemClassObject *obj; + SAFEARRAY *names; + ULONG count; + VARIANT val; + + IEnumWbemClassObject_Next( result, 10000, 1, &obj, &count ); + if (!count) break; + + VariantInit( &val ); + hr = IWbemClassObject_GetNames( obj, NULL, WBEM_FLAG_NONSYSTEM_ONLY, &val, &names ); + ok( hr == S_OK, "got %08x\n", hr ); + + SafeArrayDestroy( names ); + IWbemClassObject_Release( obj ); + } + IEnumWbemClassObject_Release( result ); + SysFreeString( query ); + SysFreeString( wql ); +} + START_TEST(query) { static const WCHAR cimv2W[] = {'R','O','O','T','\\','C','I','M','V','2',0}; @@ -647,6 +681,7 @@ test_StdRegProv( services ); test_notification_query_async( services ); test_query_async( services ); + test_GetNames( services ); SysFreeString( path ); IWbemServices_Release( services ); diff -Nru wine1.7-1.7.14/dlls/wbemprox/wbemprox_private.h wine1.7-1.7.18/dlls/wbemprox/wbemprox_private.h --- wine1.7-1.7.14/dlls/wbemprox/wbemprox_private.h 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/wbemprox/wbemprox_private.h 2014-05-02 18:15:48.000000000 +0000 @@ -192,6 +192,7 @@ HRESULT get_value( const struct table *, UINT, UINT, LONGLONG * ) DECLSPEC_HIDDEN; BSTR get_value_bstr( const struct table *, UINT, UINT ) DECLSPEC_HIDDEN; HRESULT set_value( const struct table *, UINT, UINT, LONGLONG, CIMTYPE ) DECLSPEC_HIDDEN; +BOOL is_method( const struct table *, UINT ) DECLSPEC_HIDDEN; HRESULT get_method( const struct table *, const WCHAR *, class_method ** ) DECLSPEC_HIDDEN; HRESULT get_propval( const struct view *, UINT, const WCHAR *, VARIANT *, CIMTYPE *, LONG * ) DECLSPEC_HIDDEN; @@ -200,10 +201,10 @@ SAFEARRAY *to_safearray( const struct array *, CIMTYPE ) DECLSPEC_HIDDEN; VARTYPE to_vartype( CIMTYPE ) DECLSPEC_HIDDEN; void destroy_array( struct array *, CIMTYPE ) DECLSPEC_HIDDEN; -HRESULT get_properties( const struct view *, SAFEARRAY ** ) DECLSPEC_HIDDEN; +BOOL is_selected_prop( const struct view *, const WCHAR * ) DECLSPEC_HIDDEN; +HRESULT get_properties( const struct view *, LONG, SAFEARRAY ** ) DECLSPEC_HIDDEN; HRESULT get_object( const WCHAR *, IWbemClassObject ** ) DECLSPEC_HIDDEN; BSTR get_method_name( const WCHAR *, UINT ) DECLSPEC_HIDDEN; -BSTR get_property_name( const WCHAR *, UINT ) DECLSPEC_HIDDEN; void set_variant( VARTYPE, LONGLONG, void *, VARIANT * ) DECLSPEC_HIDDEN; HRESULT create_signature( const WCHAR *, const WCHAR *, enum param_direction, IWbemClassObject ** ) DECLSPEC_HIDDEN; diff -Nru wine1.7-1.7.14/dlls/wined3d/arb_program_shader.c wine1.7-1.7.18/dlls/wined3d/arb_program_shader.c --- wine1.7-1.7.14/dlls/wined3d/arb_program_shader.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/wined3d/arb_program_shader.c 2014-05-02 18:15:48.000000000 +0000 @@ -9,7 +9,7 @@ * Copyright 2006 Ivan Gyurdiev * Copyright 2006 Jason Green * Copyright 2006 Henri Verbeet - * Copyright 2007-2011, 2013 Stefan Dösinger for CodeWeavers + * Copyright 2007-2011, 2013-2014 Stefan Dösinger for CodeWeavers * Copyright 2009 Henri Verbeet for CodeWeavers * * This library is free software; you can redistribute it and/or @@ -1792,6 +1792,11 @@ static void shader_hw_nop(const struct wined3d_shader_instruction *ins) {} +static DWORD shader_arb_select_component(DWORD swizzle, DWORD component) +{ + return ((swizzle >> 2 * component) & 0x3) * 0x55; +} + static void shader_hw_mov(const struct wined3d_shader_instruction *ins) { const struct wined3d_shader *shader = ins->ctx->shader; @@ -1862,7 +1867,7 @@ * with more than one component. Thus replicate the first source argument over all * 4 components. For example, .xyzw -> .x (or better: .xxxx), .zwxy -> .z, etc) */ struct wined3d_shader_src_param tmp_src = ins->src[0]; - tmp_src.swizzle = (tmp_src.swizzle & 0x3) * 0x55; + tmp_src.swizzle = shader_arb_select_component(tmp_src.swizzle, 0); shader_arb_get_src_param(ins, &tmp_src, 0, src0_param); shader_addline(buffer, "ARL A0.x, %s;\n", src0_param); } @@ -2472,30 +2477,36 @@ } } -static void shader_hw_rcp(const struct wined3d_shader_instruction *ins) +static DWORD abs_modifier(DWORD mod, BOOL *need_abs) { - struct wined3d_shader_buffer *buffer = ins->ctx->buffer; - - char dst[50]; - char src[50]; + *need_abs = FALSE; - shader_arb_get_dst_param(ins, &ins->dst[0], dst); /* Destination */ - shader_arb_get_src_param(ins, &ins->src[0], 0, src); - if (ins->src[0].swizzle == WINED3DSP_NOSWIZZLE) + switch(mod) { - /* Dx sdk says .x is used if no swizzle is given, but our test shows that - * .w is used - */ - strcat(src, ".w"); + case WINED3DSPSM_NONE: return WINED3DSPSM_ABS; + case WINED3DSPSM_NEG: return WINED3DSPSM_ABS; + case WINED3DSPSM_BIAS: *need_abs = TRUE; return WINED3DSPSM_BIAS; + case WINED3DSPSM_BIASNEG: *need_abs = TRUE; return WINED3DSPSM_BIASNEG; + case WINED3DSPSM_SIGN: *need_abs = TRUE; return WINED3DSPSM_SIGN; + case WINED3DSPSM_SIGNNEG: *need_abs = TRUE; return WINED3DSPSM_SIGNNEG; + case WINED3DSPSM_COMP: *need_abs = TRUE; return WINED3DSPSM_COMP; + case WINED3DSPSM_X2: *need_abs = TRUE; return WINED3DSPSM_X2; + case WINED3DSPSM_X2NEG: *need_abs = TRUE; return WINED3DSPSM_X2NEG; + case WINED3DSPSM_DZ: *need_abs = TRUE; return WINED3DSPSM_DZ; + case WINED3DSPSM_DW: *need_abs = TRUE; return WINED3DSPSM_DW; + case WINED3DSPSM_ABS: return WINED3DSPSM_ABS; + case WINED3DSPSM_ABSNEG: return WINED3DSPSM_ABS; } - - shader_addline(buffer, "RCP%s %s, %s;\n", shader_arb_get_modifier(ins), dst, src); + FIXME("Unknown modifier %u\n", mod); + return mod; } static void shader_hw_scalar_op(const struct wined3d_shader_instruction *ins) { struct wined3d_shader_buffer *buffer = ins->ctx->buffer; const char *instruction; + struct wined3d_shader_src_param src0_copy = ins->src[0]; + BOOL need_abs = FALSE; char dst[50]; char src[50]; @@ -2504,24 +2515,46 @@ { case WINED3DSIH_RSQ: instruction = "RSQ"; break; case WINED3DSIH_RCP: instruction = "RCP"; break; - case WINED3DSIH_EXP: instruction = "EX2"; break; - case WINED3DSIH_EXPP: instruction = "EXP"; break; + case WINED3DSIH_EXPP: + if (ins->ctx->reg_maps->shader_version.major < 2) + { + instruction = "EXP"; + break; + } + /* Drop through. */ + case WINED3DSIH_EXP: + instruction = "EX2"; + break; + case WINED3DSIH_LOG: + case WINED3DSIH_LOGP: + /* The precision requirements suggest that LOGP matches ARBvp's LOG + * instruction, but notice that the output of those instructions is + * different. */ + src0_copy.modifiers = abs_modifier(src0_copy.modifiers, &need_abs); + instruction = "LG2"; + break; default: instruction = ""; FIXME("Unhandled opcode %#x\n", ins->handler_idx); break; } + /* Dx sdk says .x is used if no swizzle is given, but our test shows that + * .w is used. */ + src0_copy.swizzle = shader_arb_select_component(src0_copy.swizzle, 3); + shader_arb_get_dst_param(ins, &ins->dst[0], dst); /* Destination */ - shader_arb_get_src_param(ins, &ins->src[0], 0, src); - if (ins->src[0].swizzle == WINED3DSP_NOSWIZZLE) + shader_arb_get_src_param(ins, &src0_copy, 0, src); + + if(need_abs) { - /* Dx sdk says .x is used if no swizzle is given, but our test shows that - * .w is used - */ - strcat(src, ".w"); + shader_addline(buffer, "ABS TA.w, %s;\n", src); + shader_addline(buffer, "%s%s %s, TA.w;\n", instruction, shader_arb_get_modifier(ins), dst); + } + else + { + shader_addline(buffer, "%s%s %s, %s;\n", instruction, shader_arb_get_modifier(ins), dst, src); } - shader_addline(buffer, "%s%s %s, %s;\n", instruction, shader_arb_get_modifier(ins), dst, src); } static void shader_hw_nrm(const struct wined3d_shader_instruction *ins) @@ -2761,64 +2794,6 @@ shader_addline(buffer, "MUL%s %s, %s, ycorrection.y;\n", shader_arb_get_modifier(ins), dst, dst_name); } -static DWORD abs_modifier(DWORD mod, BOOL *need_abs) -{ - *need_abs = FALSE; - - switch(mod) - { - case WINED3DSPSM_NONE: return WINED3DSPSM_ABS; - case WINED3DSPSM_NEG: return WINED3DSPSM_ABS; - case WINED3DSPSM_BIAS: *need_abs = TRUE; return WINED3DSPSM_BIAS; - case WINED3DSPSM_BIASNEG: *need_abs = TRUE; return WINED3DSPSM_BIASNEG; - case WINED3DSPSM_SIGN: *need_abs = TRUE; return WINED3DSPSM_SIGN; - case WINED3DSPSM_SIGNNEG: *need_abs = TRUE; return WINED3DSPSM_SIGNNEG; - case WINED3DSPSM_COMP: *need_abs = TRUE; return WINED3DSPSM_COMP; - case WINED3DSPSM_X2: *need_abs = TRUE; return WINED3DSPSM_X2; - case WINED3DSPSM_X2NEG: *need_abs = TRUE; return WINED3DSPSM_X2NEG; - case WINED3DSPSM_DZ: *need_abs = TRUE; return WINED3DSPSM_DZ; - case WINED3DSPSM_DW: *need_abs = TRUE; return WINED3DSPSM_DW; - case WINED3DSPSM_ABS: return WINED3DSPSM_ABS; - case WINED3DSPSM_ABSNEG: return WINED3DSPSM_ABS; - } - FIXME("Unknown modifier %u\n", mod); - return mod; -} - -static void shader_hw_log(const struct wined3d_shader_instruction *ins) -{ - struct wined3d_shader_buffer *buffer = ins->ctx->buffer; - char src0[50], dst[50]; - struct wined3d_shader_src_param src0_copy = ins->src[0]; - BOOL need_abs = FALSE; - const char *instr; - - switch(ins->handler_idx) - { - case WINED3DSIH_LOG: instr = "LG2"; break; - case WINED3DSIH_LOGP: instr = "LOG"; break; - default: - ERR("Unexpected instruction %d\n", ins->handler_idx); - return; - } - - /* LOG and LOGP operate on the absolute value of the input */ - src0_copy.modifiers = abs_modifier(src0_copy.modifiers, &need_abs); - - shader_arb_get_dst_param(ins, &ins->dst[0], dst); - shader_arb_get_src_param(ins, &src0_copy, 0, src0); - - if(need_abs) - { - shader_addline(buffer, "ABS TA, %s;\n", src0); - shader_addline(buffer, "%s%s %s, TA;\n", instr, shader_arb_get_modifier(ins), dst); - } - else - { - shader_addline(buffer, "%s%s %s, %s;\n", instr, shader_arb_get_modifier(ins), dst, src0); - } -} - static void shader_hw_pow(const struct wined3d_shader_instruction *ins) { struct wined3d_shader_buffer *buffer = ins->ctx->buffer; @@ -3309,7 +3284,7 @@ GLuint program_id = 0; GLint pos; - const char *blt_vprogram = + static const char blt_vprogram[] = "!!ARBvp1.0\n" "PARAM c[1] = { { 1, 0.5 } };\n" "MOV result.position, vertex.position;\n" @@ -5052,8 +5027,12 @@ static void shader_arb_free_context_data(struct wined3d_context *context) { - struct shader_arb_priv *priv = context->swapchain->device->shader_priv; + struct shader_arb_priv *priv; + + if (!context->swapchain) + return; + priv = context->swapchain->device->shader_priv; if (priv->last_context == context) priv->last_context = NULL; } @@ -5239,8 +5218,8 @@ /* WINED3DSIH_LABEL */ shader_hw_label, /* WINED3DSIH_LD */ NULL, /* WINED3DSIH_LIT */ shader_hw_map2gl, - /* WINED3DSIH_LOG */ shader_hw_log, - /* WINED3DSIH_LOGP */ shader_hw_log, + /* WINED3DSIH_LOG */ shader_hw_scalar_op, + /* WINED3DSIH_LOGP */ shader_hw_scalar_op, /* WINED3DSIH_LOOP */ shader_hw_loop, /* WINED3DSIH_LRP */ shader_hw_lrp, /* WINED3DSIH_LT */ NULL, @@ -5260,7 +5239,7 @@ /* WINED3DSIH_NRM */ shader_hw_nrm, /* WINED3DSIH_PHASE */ shader_hw_nop, /* WINED3DSIH_POW */ shader_hw_pow, - /* WINED3DSIH_RCP */ shader_hw_rcp, + /* WINED3DSIH_RCP */ shader_hw_scalar_op, /* WINED3DSIH_REP */ shader_hw_rep, /* WINED3DSIH_RET */ shader_hw_ret, /* WINED3DSIH_ROUND_NI */ NULL, diff -Nru wine1.7-1.7.14/dlls/wined3d/context.c wine1.7-1.7.18/dlls/wined3d/context.c --- wine1.7-1.7.14/dlls/wined3d/context.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/wined3d/context.c 2014-05-02 18:15:48.000000000 +0000 @@ -614,6 +614,53 @@ context->free_event_queries[context->free_event_query_count++] = query->object; } +/* Context activation is done by the caller. */ +void context_alloc_timestamp_query(struct wined3d_context *context, struct wined3d_timestamp_query *query) +{ + const struct wined3d_gl_info *gl_info = context->gl_info; + + if (context->free_timestamp_query_count) + { + query->id = context->free_timestamp_queries[--context->free_timestamp_query_count]; + } + else + { + GL_EXTCALL(glGenQueriesARB(1, &query->id)); + checkGLcall("glGenQueriesARB"); + + TRACE("Allocated timestamp query %u in context %p.\n", query->id, context); + } + + query->context = context; + list_add_head(&context->timestamp_queries, &query->entry); +} + +void context_free_timestamp_query(struct wined3d_timestamp_query *query) +{ + struct wined3d_context *context = query->context; + + list_remove(&query->entry); + query->context = NULL; + + if (context->free_timestamp_query_count >= context->free_timestamp_query_size - 1) + { + UINT new_size = context->free_timestamp_query_size << 1; + GLuint *new_data = HeapReAlloc(GetProcessHeap(), 0, context->free_timestamp_queries, + new_size * sizeof(*context->free_timestamp_queries)); + + if (!new_data) + { + ERR("Failed to grow free list, leaking query %u in context %p.\n", query->id, context); + return; + } + + context->free_timestamp_query_size = new_size; + context->free_timestamp_queries = new_data; + } + + context->free_timestamp_queries[context->free_timestamp_query_count++] = query->id; +} + typedef void (context_fbo_entry_func_t)(struct wined3d_context *context, struct fbo_entry *entry); static void context_enum_surface_fbo_entries(const struct wined3d_device *device, @@ -719,9 +766,10 @@ } } -static void context_restore_pixel_format(struct wined3d_context *ctx) +static BOOL context_restore_pixel_format(struct wined3d_context *ctx) { const struct wined3d_gl_info *gl_info = ctx->gl_info; + BOOL ret = FALSE; if (ctx->restore_pf && IsWindow(ctx->restore_pf_win)) { @@ -730,7 +778,7 @@ HDC dc = GetDC(ctx->restore_pf_win); if (dc) { - if (!GL_EXTCALL(wglSetPixelFormatWINE(dc, ctx->restore_pf))) + if (!(ret = GL_EXTCALL(wglSetPixelFormatWINE(dc, ctx->restore_pf)))) { ERR("wglSetPixelFormatWINE failed to restore pixel format %d on window %p.\n", ctx->restore_pf, ctx->restore_pf_win); @@ -746,14 +794,19 @@ ctx->restore_pf = 0; ctx->restore_pf_win = NULL; + return ret; } -static BOOL context_set_pixel_format(struct wined3d_context *context, HDC dc, int format) +static BOOL context_set_pixel_format(struct wined3d_context *context, HDC dc, BOOL private, int format) { const struct wined3d_gl_info *gl_info = context->gl_info; - int current = GetPixelFormat(dc); + int current; + + if (dc == context->hdc && context->hdc_is_private && context->hdc_has_format) + return TRUE; - if (current == format) return TRUE; + current = GetPixelFormat(dc); + if (current == format) goto success; if (!current) { @@ -766,8 +819,8 @@ } context->restore_pf = 0; - context->restore_pf_win = WindowFromDC(dc); - return TRUE; + context->restore_pf_win = private ? NULL : WindowFromDC(dc); + goto success; } /* By default WGL doesn't allow pixel format adjustments but we need it @@ -785,16 +838,16 @@ return FALSE; } - win = WindowFromDC(dc); + win = private ? NULL : WindowFromDC(dc); if (win != context->restore_pf_win) { context_restore_pixel_format(context); - context->restore_pf = current; + context->restore_pf = private ? 0 : current; context->restore_pf_win = win; } - return TRUE; + goto success; } /* OpenGL doesn't allow pixel format adjustments. Print an error and @@ -804,6 +857,11 @@ ERR("Unable to set pixel format %d on device context %p. Already using format %d.\n", format, dc, current); return TRUE; + +success: + if (dc == context->hdc && context->hdc_is_private) + context->hdc_has_format = TRUE; + return TRUE; } static BOOL context_set_gl_context(struct wined3d_context *ctx) @@ -811,7 +869,7 @@ struct wined3d_swapchain *swapchain = ctx->swapchain; BOOL backup = FALSE; - if (!context_set_pixel_format(ctx, ctx->hdc, ctx->pixel_format)) + if (!context_set_pixel_format(ctx, ctx->hdc, ctx->hdc_is_private, ctx->pixel_format)) { WARN("Failed to set pixel format %d on device context %p.\n", ctx->pixel_format, ctx->hdc); @@ -844,7 +902,7 @@ return FALSE; } - if (!context_set_pixel_format(ctx, dc, ctx->pixel_format)) + if (!context_set_pixel_format(ctx, dc, TRUE, ctx->pixel_format)) { ERR("Failed to set pixel format %d on device context %p.\n", ctx->pixel_format, dc); @@ -884,29 +942,26 @@ TRACE("Updating context %p window from %p to %p.\n", context, context->win_handle, context->swapchain->win_handle); - if (context->valid) + if (context->hdc) wined3d_release_dc(context->win_handle, context->hdc); - else - context->valid = 1; context->win_handle = context->swapchain->win_handle; + context->hdc_is_private = FALSE; + context->hdc_has_format = FALSE; context->needs_set = 1; + context->valid = 1; if (!(context->hdc = GetDC(context->win_handle))) { ERR("Failed to get a device context for window %p.\n", context->win_handle); - goto err; + context->valid = 0; } - - return; - -err: - context->valid = 0; } static void context_destroy_gl_resources(struct wined3d_context *context) { const struct wined3d_gl_info *gl_info = context->gl_info; + struct wined3d_timestamp_query *timestamp_query; struct wined3d_occlusion_query *occlusion_query; struct wined3d_event_query *event_query; struct fbo_entry *entry, *entry2; @@ -922,6 +977,13 @@ else if (context->valid) context_set_gl_context(context); + LIST_FOR_EACH_ENTRY(timestamp_query, &context->timestamp_queries, struct wined3d_timestamp_query, entry) + { + if (context->valid) + GL_EXTCALL(glDeleteQueriesARB(1, ×tamp_query->id)); + timestamp_query->context = NULL; + } + LIST_FOR_EACH_ENTRY(occlusion_query, &context->occlusion_queries, struct wined3d_occlusion_query, entry) { if (context->valid && gl_info->supported[ARB_OCCLUSION_QUERY]) @@ -962,6 +1024,9 @@ GL_EXTCALL(glDeleteProgramsARB(1, &context->dummy_arbfp_prog)); } + if (gl_info->supported[ARB_TIMER_QUERY]) + GL_EXTCALL(glDeleteQueriesARB(context->free_timestamp_query_count, context->free_timestamp_queries)); + if (gl_info->supported[ARB_OCCLUSION_QUERY]) GL_EXTCALL(glDeleteQueriesARB(context->free_occlusion_query_count, context->free_occlusion_queries)); @@ -990,6 +1055,7 @@ checkGLcall("context cleanup"); } + HeapFree(GetProcessHeap(), 0, context->free_timestamp_queries); HeapFree(GetProcessHeap(), 0, context->free_occlusion_queries); HeapFree(GetProcessHeap(), 0, context->free_event_queries); @@ -1094,7 +1160,8 @@ if (!--context->level) { - context_restore_pixel_format(context); + if (context_restore_pixel_format(context)) + context->needs_set = 1; if (context->restore_ctx) { TRACE("Restoring GL context %p on device context %p.\n", context->restore_ctx, context->restore_dc); @@ -1122,7 +1189,8 @@ context->restore_dc = wglGetCurrentDC(); context->needs_set = 1; } - else if (context->pixel_format != GetPixelFormat(context->hdc)) + else if (!context->needs_set && !(context->hdc_is_private && context->hdc_has_format) + && context->pixel_format != GetPixelFormat(context->hdc)) context->needs_set = 1; } } @@ -1331,6 +1399,7 @@ int swap_interval; DWORD state; HDC hdc; + BOOL hdc_is_private = FALSE; TRACE("swapchain %p, target %p, window %p.\n", swapchain, target, swapchain->win_handle); @@ -1348,6 +1417,13 @@ if (!ret->draw_buffers) goto out; + ret->free_timestamp_query_size = 4; + ret->free_timestamp_queries = HeapAlloc(GetProcessHeap(), 0, + ret->free_timestamp_query_size * sizeof(*ret->free_timestamp_queries)); + if (!ret->free_timestamp_queries) + goto out; + list_init(&ret->timestamp_queries); + ret->free_occlusion_query_size = 4; ret->free_occlusion_queries = HeapAlloc(GetProcessHeap(), 0, ret->free_occlusion_query_size * sizeof(*ret->free_occlusion_queries)); @@ -1391,7 +1467,9 @@ { WARN("Failed to retireve device context, trying swapchain backup.\n"); - if (!(hdc = swapchain_get_backup_dc(swapchain))) + if ((hdc = swapchain_get_backup_dc(swapchain))) + hdc_is_private = TRUE; + else { ERR("Failed to retrieve a device context.\n"); goto out; @@ -1442,7 +1520,7 @@ ret->gl_info = gl_info; - if (!context_set_pixel_format(ret, hdc, pixel_format)) + 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); context_release(ret); @@ -1519,6 +1597,8 @@ ret->glCtx = ctx; ret->win_handle = swapchain->win_handle; ret->hdc = hdc; + ret->hdc_is_private = hdc_is_private; + ret->hdc_has_format = TRUE; ret->pixel_format = pixel_format; ret->needs_set = 1; @@ -1641,7 +1721,7 @@ * So make sure a program is assigned to each context. The first real ARBFP use will set a different * program and the dummy program is destroyed when the context is destroyed. */ - const char *dummy_program = + static const char dummy_program[] = "!!ARBfp1.0\n" "MOV result.color, fragment.color.primary;\n" "END\n"; @@ -1686,6 +1766,7 @@ device->shader_backend->shader_free_context_data(ret); HeapFree(GetProcessHeap(), 0, ret->free_event_queries); HeapFree(GetProcessHeap(), 0, ret->free_occlusion_queries); + HeapFree(GetProcessHeap(), 0, ret->free_timestamp_queries); HeapFree(GetProcessHeap(), 0, ret->draw_buffers); HeapFree(GetProcessHeap(), 0, ret->blit_targets); HeapFree(GetProcessHeap(), 0, ret); diff -Nru wine1.7-1.7.14/dlls/wined3d/directx.c wine1.7-1.7.18/dlls/wined3d/directx.c --- wine1.7-1.7.14/dlls/wined3d/directx.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/wined3d/directx.c 2014-05-02 18:15:48.000000000 +0000 @@ -31,6 +31,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d); WINE_DECLARE_DEBUG_CHANNEL(d3d_perf); +WINE_DECLARE_DEBUG_CHANNEL(winediag); #define WINE_DEFAULT_VIDMEM (64 * 1024 * 1024) #define DEFAULT_REFRESH_RATE 0 @@ -93,6 +94,7 @@ {"GL_APPLE_ycbcr_422", APPLE_YCBCR_422 }, /* ARB */ + {"GL_ARB_blend_func_extended", ARB_BLEND_FUNC_EXTENDED }, {"GL_ARB_color_buffer_float", ARB_COLOR_BUFFER_FLOAT }, {"GL_ARB_debug_output", ARB_DEBUG_OUTPUT }, {"GL_ARB_depth_buffer_float", ARB_DEPTH_BUFFER_FLOAT }, @@ -138,6 +140,7 @@ {"GL_ARB_texture_non_power_of_two", ARB_TEXTURE_NON_POWER_OF_TWO }, {"GL_ARB_texture_rectangle", ARB_TEXTURE_RECTANGLE }, {"GL_ARB_texture_rg", ARB_TEXTURE_RG }, + {"GL_ARB_timer_query", ARB_TIMER_QUERY }, {"GL_ARB_vertex_array_bgra", ARB_VERTEX_ARRAY_BGRA }, {"GL_ARB_vertex_blend", ARB_VERTEX_BLEND }, {"GL_ARB_vertex_buffer_object", ARB_VERTEX_BUFFER_OBJECT }, @@ -436,7 +439,7 @@ { GLuint prog; BOOL ret = FALSE; - const char *testcode = + static const char testcode[] = "!!ARBvp1.0\n" "PARAM C[66] = { program.env[0..65] };\n" "ADDRESS A0;" @@ -650,7 +653,7 @@ GLuint prog; BOOL ret = FALSE; GLint pos; - const char *testcode = + static const char testcode[] = "!!ARBvp1.0\n" "OPTION NV_vertex_program2;\n" "MOV result.clip[0], 0.0;\n" @@ -787,7 +790,7 @@ float color[4] = {0.0f, 1.0f, 0.0f, 0.0f}; GLuint prog; GLint err_pos; - static const char *program_code = + static const char program_code[] = "!!ARBfp1.0\n" "OPTION ARB_fog_linear;\n" "MOV result.color, {1.0, 0.0, 0.0, 0.0};\n" @@ -1261,9 +1264,14 @@ {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX670, "NVIDIA GeForce GTX 670", DRIVER_NVIDIA_GEFORCE6, 2048}, {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX670MX, "NVIDIA GeForce GTX 670MX", DRIVER_NVIDIA_GEFORCE6, 3072}, {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX680, "NVIDIA GeForce GTX 680", DRIVER_NVIDIA_GEFORCE6, 2048}, + {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX750, "NVIDIA GeForce GTX 750", DRIVER_NVIDIA_GEFORCE6, 1024}, + {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX750TI, "NVIDIA GeForce GTX 750 Ti", DRIVER_NVIDIA_GEFORCE6, 2048}, + {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX760, "NVIDIA Geforce GTX 760", DRIVER_NVIDIA_GEFORCE6, 2048}, {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX765M, "NVIDIA GeForce GTX 765M", DRIVER_NVIDIA_GEFORCE6, 2048}, {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX770M, "NVIDIA GeForce GTX 770M", DRIVER_NVIDIA_GEFORCE6, 3072}, {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX770, "NVIDIA GeForce GTX 770", DRIVER_NVIDIA_GEFORCE6, 2048}, + {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX780, "NVIDIA GeForce GTX 780", DRIVER_NVIDIA_GEFORCE6, 3072}, + {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX780TI, "NVIDIA GeForce GTX 780 Ti", DRIVER_NVIDIA_GEFORCE6, 3072}, /* AMD cards */ {HW_VENDOR_AMD, CARD_AMD_RAGE_128PRO, "ATI Rage Fury", DRIVER_AMD_RAGE_128PRO, 16 }, @@ -1361,33 +1369,56 @@ return NULL; } +static const struct gpu_description *get_gpu_description(enum wined3d_pci_vendor vendor, + enum wined3d_pci_device device) +{ + unsigned int i; + + for (i = 0; i < (sizeof(gpu_description_table) / sizeof(*gpu_description_table)); ++i) + { + if (vendor == gpu_description_table[i].vendor && device == gpu_description_table[i].card) + return &gpu_description_table[i]; + } + + return NULL; +} + static void init_driver_info(struct wined3d_driver_info *driver_info, enum wined3d_pci_vendor vendor, enum wined3d_pci_device device) { OSVERSIONINFOW os_version; WORD driver_os_version; - unsigned int i; - enum wined3d_display_driver driver = DRIVER_UNKNOWN; + enum wined3d_display_driver driver; enum wined3d_driver_model driver_model; const struct driver_version_information *version_info; + const struct gpu_description *gpu_desc; - if (wined3d_settings.pci_vendor_id != PCI_VENDOR_NONE) + if (driver_info->vendor != PCI_VENDOR_NONE || driver_info->device != PCI_DEVICE_NONE) { - TRACE("Overriding PCI vendor ID with 0x%04x.\n", wined3d_settings.pci_vendor_id); - vendor = wined3d_settings.pci_vendor_id; - } - driver_info->vendor = vendor; + static unsigned int once; - if (wined3d_settings.pci_device_id != PCI_DEVICE_NONE) - { - TRACE("Overriding PCI device ID with 0x%04x.\n", wined3d_settings.pci_device_id); - device = wined3d_settings.pci_device_id; + TRACE("GPU override %04x:%04x.\n", wined3d_settings.pci_vendor_id, wined3d_settings.pci_device_id); + + driver_info->vendor = wined3d_settings.pci_vendor_id; + if (driver_info->vendor == PCI_VENDOR_NONE) + driver_info->vendor = vendor; + + driver_info->device = wined3d_settings.pci_device_id; + if (driver_info->device == PCI_DEVICE_NONE) + driver_info->device = device; + + if (get_gpu_description(driver_info->vendor, driver_info->device)) + { + vendor = driver_info->vendor; + device = driver_info->device; + } + else if (!once++) + ERR_(winediag)("Invalid GPU override %04x:%04x specified, ignoring.\n", + driver_info->vendor, driver_info->device); } - driver_info->device = device; - /* Set a default amount of video memory (64 MB). In general this code isn't used unless the user - * overrides the pci ids to a card which is not in our database. */ - driver_info->vidmem = WINE_DEFAULT_VIDMEM; + driver_info->vendor = vendor; + driver_info->device = device; memset(&os_version, 0, sizeof(os_version)); os_version.dwOSVersionInfoSize = sizeof(os_version); @@ -1447,19 +1478,18 @@ } } - /* When we reach this stage we always have a vendor or device id (it can be a default one). - * This means that unless the ids are overridden, we will always find a GPU description. */ - for (i = 0; i < (sizeof(gpu_description_table) / sizeof(gpu_description_table[0])); i++) + if ((gpu_desc = get_gpu_description(driver_info->vendor, driver_info->device))) { - if (vendor == gpu_description_table[i].vendor && device == gpu_description_table[i].card) - { - TRACE("Found card %04x:%04x in driver DB.\n", vendor, device); - - driver_info->description = gpu_description_table[i].description; - driver_info->vidmem = gpu_description_table[i].vidmem * 1024*1024; - driver = gpu_description_table[i].driver; - break; - } + driver_info->description = gpu_desc->description; + driver_info->vidmem = gpu_desc->vidmem * 1024 * 1024; + driver = gpu_desc->driver; + } + else + { + ERR("Card %04x:%04x not found in driver DB.\n", vendor, device); + driver_info->description = "Direct3D HAL"; + driver_info->vidmem = WINE_DEFAULT_VIDMEM; + driver = DRIVER_UNKNOWN; } if (wined3d_settings.emulated_textureram) @@ -1481,8 +1511,8 @@ * - the gpu is not in our database (can happen when the user overrides the vendor_id / device_id) * This could be an indication that our database is not up to date, so this should be fixed. */ - version_info = get_driver_version_info(driver, driver_model); - if (version_info) + if ((version_info = get_driver_version_info(driver, driver_model)) + || (version_info = get_driver_version_info(driver, DRIVER_MODEL_NT5X))) { driver_info->name = version_info->driver_name; driver_info->version_high = MAKEDWORD_VERSION(driver_os_version, version_info->version); @@ -1490,23 +1520,11 @@ } else { - version_info = get_driver_version_info(driver, DRIVER_MODEL_NT5X); - if (version_info) - { - driver_info->name = version_info->driver_name; - driver_info->version_high = MAKEDWORD_VERSION(driver_os_version, version_info->version); - driver_info->version_low = MAKEDWORD_VERSION(version_info->subversion, version_info->build); - } - else - { - driver_info->description = "Direct3D HAL"; - driver_info->name = "Display"; - driver_info->version_high = MAKEDWORD_VERSION(driver_os_version, 15); - driver_info->version_low = MAKEDWORD_VERSION(8, 6); /* Nvidia RIVA TNT, arbitrary */ - - FIXME("Unable to find a driver/device info for vendor_id=%#x device_id=%#x for driver_model=%d\n", - vendor, device, driver_model); - } + ERR("No driver version info found for device %04x:%04x, driver model %#x.\n", + vendor, device, driver_model); + driver_info->name = "Display"; + driver_info->version_high = MAKEDWORD_VERSION(driver_os_version, 15); + driver_info->version_low = MAKEDWORD_VERSION(8, 6); /* Nvidia RIVA TNT, arbitrary */ } TRACE("Reporting (fake) driver version 0x%08x-0x%08x.\n", @@ -1670,9 +1688,14 @@ } cards[] = { + {"GTX 780 Ti", CARD_NVIDIA_GEFORCE_GTX780TI}, /* Geforce 700 - highend */ + {"GTX 780", CARD_NVIDIA_GEFORCE_GTX780}, /* Geforce 700 - highend */ {"GTX 770M", CARD_NVIDIA_GEFORCE_GTX770M}, /* Geforce 700 - midend high mobile */ {"GTX 770", CARD_NVIDIA_GEFORCE_GTX770}, /* Geforce 700 - highend */ {"GTX 765M", CARD_NVIDIA_GEFORCE_GTX765M}, /* Geforce 700 - midend high mobile */ + {"GTX 760", CARD_NVIDIA_GEFORCE_GTX760}, /* Geforce 700 - midend high */ + {"GTX 750 Ti", CARD_NVIDIA_GEFORCE_GTX750TI}, /* Geforce 700 - midend */ + {"GTX 750", CARD_NVIDIA_GEFORCE_GTX750}, /* Geforce 700 - midend */ {"GTX 680", CARD_NVIDIA_GEFORCE_GTX680}, /* Geforce 600 - highend */ {"GTX 670MX", CARD_NVIDIA_GEFORCE_GTX670MX}, /* Geforce 600 - highend */ {"GTX 670", CARD_NVIDIA_GEFORCE_GTX670}, /* Geforce 600 - midend high */ @@ -2166,7 +2189,11 @@ } cards[] = { + /* Maxwell */ + {"NV117", CARD_NVIDIA_GEFORCE_GTX750}, /* Kepler */ + {"NVF1", CARD_NVIDIA_GEFORCE_GTX780TI}, + {"NVF0", CARD_NVIDIA_GEFORCE_GTX780}, {"NVE6", CARD_NVIDIA_GEFORCE_GTX770M}, {"NVE4", CARD_NVIDIA_GEFORCE_GTX680}, /* Fermi */ @@ -2959,6 +2986,15 @@ if (!counter_bits) gl_info->supported[ARB_OCCLUSION_QUERY] = FALSE; } + if (gl_info->supported[ARB_TIMER_QUERY]) + { + GLint counter_bits; + + GL_EXTCALL(glGetQueryivARB(GL_TIMESTAMP, GL_QUERY_COUNTER_BITS_ARB, &counter_bits)); + TRACE("Timestamp query counter has %d bits.\n", counter_bits); + if (!counter_bits) + gl_info->supported[ARB_TIMER_QUERY] = FALSE; + } if (!gl_info->supported[ATI_TEXTURE_MIRROR_ONCE] && gl_info->supported[EXT_TEXTURE_MIRROR_CLAMP]) { TRACE(" IMPLIED: ATI_texture_mirror_once support (by EXT_texture_mirror_clamp).\n"); @@ -4006,6 +4042,21 @@ return WINED3D_OK; } +UINT CDECL wined3d_calculate_format_pitch(const struct wined3d *wined3d, UINT adapter_idx, + enum wined3d_format_id format_id, UINT width) +{ + const struct wined3d_gl_info *gl_info; + + TRACE("wined3d %p, adapter_idx %u, format_id %s, width %u.\n", + wined3d, adapter_idx, debug_d3dformat(format_id), width); + + if (adapter_idx >= wined3d->adapter_count) + return ~0u; + + gl_info = &wined3d->adapters[adapter_idx].gl_info; + return wined3d_format_calculate_pitch(wined3d_get_format(gl_info, format_id), width); +} + HRESULT CDECL wined3d_check_device_format_conversion(const struct wined3d *wined3d, UINT adapter_idx, enum wined3d_device_type device_type, enum wined3d_format_id src_format, enum wined3d_format_id dst_format) { @@ -4231,6 +4282,8 @@ WINED3DPCMPCAPS_NEVER | WINED3DPCMPCAPS_NOTEQUAL; + /* WINED3DPBLENDCAPS_BOTHINVSRCALPHA and WINED3DPBLENDCAPS_BOTHSRCALPHA + * are legacy settings for srcblend only. */ caps->SrcBlendCaps = WINED3DPBLENDCAPS_BOTHINVSRCALPHA | WINED3DPBLENDCAPS_BOTHSRCALPHA | WINED3DPBLENDCAPS_DESTALPHA | @@ -4255,12 +4308,9 @@ WINED3DPBLENDCAPS_SRCALPHA | WINED3DPBLENDCAPS_SRCCOLOR | WINED3DPBLENDCAPS_ZERO; - /* NOTE: WINED3DPBLENDCAPS_SRCALPHASAT is not supported as dest blend factor, - * according to the glBlendFunc manpage - * - * WINED3DPBLENDCAPS_BOTHINVSRCALPHA and WINED3DPBLENDCAPS_BOTHSRCALPHA are - * legacy settings for srcblend only - */ + + if (gl_info->supported[ARB_BLEND_FUNC_EXTENDED]) + caps->DestBlendCaps |= WINED3DPBLENDCAPS_SRCALPHASAT; if (gl_info->supported[EXT_BLEND_COLOR]) { @@ -4473,8 +4523,8 @@ caps->MaxAnisotropy = gl_info->limits.anisotropy; caps->MaxPointSize = gl_info->limits.pointsize_max; - caps->MaxPrimitiveCount = 0xfffff; /* For now set 2^20-1 which is used by most >=Geforce3/Radeon8500 cards */ - caps->MaxVertexIndex = 0xfffff; + caps->MaxPrimitiveCount = 0x555555; /* Taken from an AMD Radeon HD 5700 (Evergreen) GPU. */ + caps->MaxVertexIndex = 0xffffff; /* Taken from an AMD Radeon HD 5700 (Evergreen) GPU. */ caps->MaxStreams = MAX_STREAMS; caps->MaxStreamStride = 1024; @@ -4538,6 +4588,7 @@ caps->MaxVShaderInstructionsExecuted = 65535; /* VS 3.0 needs at least 65535, some cards even use 2^32-1 */ caps->MaxVertexShader30InstructionSlots = max(512, adapter->gl_info.limits.arb_vs_instructions); + caps->VertexTextureFilterCaps = WINED3DPTFILTERCAPS_MINFPOINT | WINED3DPTFILTERCAPS_MAGFPOINT; } else if (caps->VertexShaderVersion == 2) { @@ -5204,9 +5255,8 @@ wined3d_null_wined3d_object_destroyed, }; -HRESULT wined3d_init(struct wined3d *wined3d, UINT version, DWORD flags) +HRESULT wined3d_init(struct wined3d *wined3d, DWORD flags) { - wined3d->dxVersion = version; wined3d->ref = 1; wined3d->flags = flags; diff -Nru wine1.7-1.7.14/dlls/wined3d/glsl_shader.c wine1.7-1.7.18/dlls/wined3d/glsl_shader.c --- wine1.7-1.7.14/dlls/wined3d/glsl_shader.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/wined3d/glsl_shader.c 2014-05-02 18:15:48.000000000 +0000 @@ -34,6 +34,9 @@ #include #include +#ifdef HAVE_FLOAT_H +# include +#endif #include "wined3d_private.h" @@ -129,6 +132,7 @@ GLint bumpenv_mat_location[MAX_TEXTURES]; GLint bumpenv_lum_scale_location[MAX_TEXTURES]; GLint bumpenv_lum_offset_location[MAX_TEXTURES]; + GLint tss_constant_location[MAX_TEXTURES]; GLint tex_factor_location; GLint specular_enable_location; GLint ycorrection_location; @@ -868,6 +872,15 @@ else GL_EXTCALL(glUniform4fARB(prog->ps.specular_enable_location, 0.0f, 0.0f, 0.0f, 0.0f)); + for (i = 0; i < MAX_TEXTURES; ++i) + { + if (prog->ps.tss_constant_location[i] == -1) + continue; + + D3DCOLORTOGLFLOAT4(state->texture_states[i][WINED3D_TSS_CONSTANT], col); + GL_EXTCALL(glUniform4fvARB(prog->ps.tss_constant_location[i], 1, col)); + } + checkGLcall("fixed function uniforms"); } @@ -5083,17 +5096,16 @@ break; case WINED3DTA_CONSTANT: - FIXME("Per-stage constants not implemented.\n"); switch (stage) { - case 0: ret = "const0"; break; - case 1: ret = "const1"; break; - case 2: ret = "const2"; break; - case 3: ret = "const3"; break; - case 4: ret = "const4"; break; - case 5: ret = "const5"; break; - case 6: ret = "const6"; break; - case 7: ret = "const7"; break; + case 0: ret = "tss_const0"; break; + case 1: ret = "tss_const1"; break; + case 2: ret = "tss_const2"; break; + case 3: ret = "tss_const3"; break; + case 4: ret = "tss_const4"; break; + case 5: ret = "tss_const5"; break; + case 6: ret = "tss_const6"; break; + case 7: ret = "tss_const7"; break; default: ret = ""; break; @@ -5284,8 +5296,8 @@ static GLuint shader_glsl_generate_ffp_fragment_shader(struct wined3d_shader_buffer *buffer, const struct ffp_frag_settings *settings, const struct wined3d_gl_info *gl_info) { + BYTE lum_map = 0, bump_map = 0, tex_map = 0, tss_const_map = 0; BOOL tempreg_used = FALSE, tfactor_used = FALSE; - BYTE lum_map = 0, bump_map = 0, tex_map = 0; const char *final_combiner_src = "ret"; UINT lowest_disabled_stage; GLhandleARB shader_obj; @@ -5312,6 +5324,8 @@ tempreg_used = TRUE; if (settings->op[stage].dst == tempreg) tempreg_used = TRUE; + if (arg0 == WINED3DTA_CONSTANT || arg1 == WINED3DTA_CONSTANT || arg2 == WINED3DTA_CONSTANT) + tss_const_map |= 1 << stage; switch (settings->op[stage].cop) { @@ -5347,6 +5361,8 @@ 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; } lowest_disabled_stage = stage; @@ -5363,6 +5379,9 @@ for (stage = 0; stage < MAX_TEXTURES; ++stage) { + if (tss_const_map & (1 << stage)) + shader_addline(buffer, "uniform vec4 tss_const%u;\n", stage); + if (!(tex_map & (1 << stage))) continue; @@ -5723,6 +5742,8 @@ ps->bumpenv_lum_scale_location[i] = GL_EXTCALL(glGetUniformLocationARB(program_id, name)); snprintf(name, sizeof(name), "bumpenv_lum_offset%u", i); ps->bumpenv_lum_offset_location[i] = GL_EXTCALL(glGetUniformLocationARB(program_id, name)); + snprintf(name, sizeof(name), "tss_const%u", i); + ps->tss_constant_location[i] = GL_EXTCALL(glGetUniformLocationARB(program_id, name)); } ps->tex_factor_location = GL_EXTCALL(glGetUniformLocationARB(program_id, "tex_factor")); @@ -6001,7 +6022,7 @@ GLhandleARB vshader_id, pshader_id; const char *blt_pshader; - static const char *blt_vshader = + static const char blt_vshader[] = "#version 120\n" "void main(void)\n" "{\n" @@ -6572,7 +6593,10 @@ * the shader will generate incorrect results too. Unfortunately, GL deliberately doesn't * offer a way to query this. */ - caps->ps_1x_max_value = 8.0; + if (shader_model >= 4) + caps->ps_1x_max_value = FLT_MAX; + else + caps->ps_1x_max_value = 1024.0f; /* Ideally we'd only set caps like sRGB writes here if supported by both * the shader backend and the fragment pipe, but we can get called before @@ -7027,7 +7051,8 @@ { caps->wined3d_caps = WINED3D_FRAGMENT_CAP_PROJ_CONTROL | WINED3D_FRAGMENT_CAP_SRGB_WRITE; - caps->PrimitiveMiscCaps = WINED3DPMISCCAPS_TSSARGTEMP; + caps->PrimitiveMiscCaps = WINED3DPMISCCAPS_TSSARGTEMP + | WINED3DPMISCCAPS_PERSTAGECONSTANT; caps->TextureOpCaps = WINED3DTEXOPCAPS_DISABLE | WINED3DTEXOPCAPS_SELECTARG1 | WINED3DTEXOPCAPS_SELECTARG2 @@ -7253,6 +7278,14 @@ {STATE_TEXTURESTAGE(5,WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS), {STATE_TEXTURESTAGE(5, WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS), glsl_fragment_pipe_tex_transform }, WINED3D_GL_EXT_NONE }, {STATE_TEXTURESTAGE(6,WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS), {STATE_TEXTURESTAGE(6, WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS), glsl_fragment_pipe_tex_transform }, WINED3D_GL_EXT_NONE }, {STATE_TEXTURESTAGE(7,WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS), {STATE_TEXTURESTAGE(7, WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS), glsl_fragment_pipe_tex_transform }, WINED3D_GL_EXT_NONE }, + {STATE_TEXTURESTAGE(0, WINED3D_TSS_CONSTANT), {STATE_TEXTURESTAGE(0, WINED3D_TSS_CONSTANT), glsl_fragment_pipe_invalidate_constants}, WINED3D_GL_EXT_NONE }, + {STATE_TEXTURESTAGE(1, WINED3D_TSS_CONSTANT), {STATE_TEXTURESTAGE(1, WINED3D_TSS_CONSTANT), glsl_fragment_pipe_invalidate_constants}, WINED3D_GL_EXT_NONE }, + {STATE_TEXTURESTAGE(2, WINED3D_TSS_CONSTANT), {STATE_TEXTURESTAGE(2, WINED3D_TSS_CONSTANT), glsl_fragment_pipe_invalidate_constants}, WINED3D_GL_EXT_NONE }, + {STATE_TEXTURESTAGE(3, WINED3D_TSS_CONSTANT), {STATE_TEXTURESTAGE(3, WINED3D_TSS_CONSTANT), glsl_fragment_pipe_invalidate_constants}, WINED3D_GL_EXT_NONE }, + {STATE_TEXTURESTAGE(4, WINED3D_TSS_CONSTANT), {STATE_TEXTURESTAGE(4, WINED3D_TSS_CONSTANT), glsl_fragment_pipe_invalidate_constants}, WINED3D_GL_EXT_NONE }, + {STATE_TEXTURESTAGE(5, WINED3D_TSS_CONSTANT), {STATE_TEXTURESTAGE(5, WINED3D_TSS_CONSTANT), glsl_fragment_pipe_invalidate_constants}, WINED3D_GL_EXT_NONE }, + {STATE_TEXTURESTAGE(6, WINED3D_TSS_CONSTANT), {STATE_TEXTURESTAGE(6, WINED3D_TSS_CONSTANT), glsl_fragment_pipe_invalidate_constants}, WINED3D_GL_EXT_NONE }, + {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 }, {0 /* Terminate */, {0, 0 }, WINED3D_GL_EXT_NONE }, }; diff -Nru wine1.7-1.7.14/dlls/wined3d/palette.c wine1.7-1.7.18/dlls/wined3d/palette.c --- wine1.7-1.7.14/dlls/wined3d/palette.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/wined3d/palette.c 2014-05-02 18:15:48.000000000 +0000 @@ -45,10 +45,7 @@ TRACE("%p decreasing refcount to %u.\n", palette, refcount); if (!refcount) - { - DeleteObject(palette->hpal); HeapFree(GetProcessHeap(), 0, palette); - } return refcount; } @@ -61,7 +58,7 @@ if (flags) return WINED3DERR_INVALIDCALL; /* unchecked */ - if (start > palette->palNumEntries || count > palette->palNumEntries - start) + if (start > palette->size || count > palette->size - start) return WINED3DERR_INVALIDCALL; if (palette->flags & WINED3D_PALETTE_8BIT_ENTRIES) @@ -111,9 +108,6 @@ palette->palents[255].peGreen = 255; palette->palents[255].peBlue = 255; } - - if (palette->hpal) - SetPaletteEntries(palette->hpal, start, count, palette->palents + start); } /* If the palette is attached to the render target, update all render targets */ @@ -138,19 +132,11 @@ palette->ref = 1; palette->device = device; palette->flags = flags; - - palette->palNumEntries = entry_count; - palette->hpal = CreatePalette((const LOGPALETTE *)&palette->palVersion); - if (!palette->hpal) - { - WARN("Failed to create palette.\n"); - return E_FAIL; - } + palette->size = entry_count; if (FAILED(hr = wined3d_palette_set_entries(palette, 0, 0, entry_count, entries))) { WARN("Failed to set palette entries, hr %#x.\n", hr); - DeleteObject(palette->hpal); return hr; } diff -Nru wine1.7-1.7.14/dlls/wined3d/query.c wine1.7-1.7.18/dlls/wined3d/query.c --- wine1.7-1.7.14/dlls/wined3d/query.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/wined3d/query.c 2014-05-02 18:15:48.000000000 +0000 @@ -257,6 +257,14 @@ if (oq->context) context_free_occlusion_query(oq); HeapFree(GetProcessHeap(), 0, query->extendedData); } + else if (query->type == WINED3D_QUERY_TYPE_TIMESTAMP) + { + struct wined3d_timestamp_query *tq = query->extendedData; + + if (tq->context) + context_free_timestamp_query(tq); + HeapFree(GetProcessHeap(), 0, query->extendedData); + } HeapFree(GetProcessHeap(), 0, query); } @@ -519,6 +527,148 @@ return WINED3D_OK; /* can be WINED3DERR_INVALIDCALL. */ } +static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query, + void *data, DWORD size, DWORD flags) +{ + struct wined3d_timestamp_query *tq = query->extendedData; + struct wined3d_device *device = query->device; + const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; + struct wined3d_context *context; + UINT64 *u64data = data; + GLuint available; + GLuint64 timestamp; + HRESULT res; + + TRACE("(%p) : type D3DQUERY_TIMESTAMP, data %p, size %#x, flags %#x.\n", query, data, size, flags); + + if (!tq->context) + query->state = QUERY_CREATED; + + if (query->state == QUERY_CREATED) + { + /* D3D allows GetData on a new query, OpenGL doesn't. So just invent the data ourselves. */ + TRACE("Query wasn't yet started, returning S_OK.\n"); + if (u64data) + *u64data = 0; + return S_OK; + } + + if (tq->context->tid != GetCurrentThreadId()) + { + FIXME("%p Wrong thread, returning 1.\n", query); + if (u64data) + *u64data = 1; + return S_OK; + } + + context = context_acquire(query->device, tq->context->current_rt); + + GL_EXTCALL(glGetQueryObjectuivARB(tq->id, GL_QUERY_RESULT_AVAILABLE_ARB, &available)); + checkGLcall("glGetQueryObjectuivARB(GL_QUERY_RESULT_AVAILABLE)"); + TRACE("available %#x.\n", available); + + if (available) + { + if (u64data) + { + GL_EXTCALL(glGetQueryObjectui64v(tq->id, GL_QUERY_RESULT_ARB, ×tamp)); + checkGLcall("glGetQueryObjectuivARB(GL_QUERY_RESULT)"); + TRACE("Returning timestamp %s.\n", wine_dbgstr_longlong(timestamp)); + *u64data = timestamp; + } + res = S_OK; + } + else + { + res = S_FALSE; + } + + context_release(context); + + return res; +} + +static HRESULT wined3d_timestamp_query_ops_issue(struct wined3d_query *query, DWORD flags) +{ + struct wined3d_device *device = query->device; + const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; + + TRACE("query %p, flags %#x.\n", query, flags); + + if (gl_info->supported[ARB_TIMER_QUERY]) + { + struct wined3d_timestamp_query *tq = query->extendedData; + struct wined3d_context *context; + + if (flags & WINED3DISSUE_BEGIN) + { + WARN("Ignoring WINED3DISSUE_BEGIN with a TIMESTAMP query.\n"); + } + if (flags & WINED3DISSUE_END) + { + if (tq->context) + context_free_timestamp_query(tq); + context = context_acquire(query->device, NULL); + context_alloc_timestamp_query(context, tq); + GL_EXTCALL(glQueryCounter(tq->id, GL_TIMESTAMP)); + checkGLcall("glQueryCounter()"); + context_release(context); + } + } + else + { + ERR("Timestamp queries not supported.\n"); + } + + if (flags & WINED3DISSUE_END) + query->state = QUERY_SIGNALLED; + + return WINED3D_OK; +} + +static HRESULT wined3d_timestamp_disjoint_query_ops_get_data(struct wined3d_query *query, + void *data, DWORD size, DWORD flags) +{ + TRACE("(%p) : type D3DQUERY_TIMESTAMP_DISJOINT, data %p, size %#x, flags %#x.\n", query, data, size, flags); + + if (query->type == WINED3D_QUERY_TYPE_TIMESTAMP_DISJOINT) + { + struct wined3d_query_data_timestamp_disjoint *disjoint_data = data; + + if (query->state == QUERY_BUILDING) + { + TRACE("Query is building, returning S_FALSE.\n"); + return S_FALSE; + } + + if (disjoint_data) + { + disjoint_data->disjoint = FALSE; + disjoint_data->frequency = 1000 * 1000 * 1000; + } + } + else + { + UINT64 *u64data = data; + + if (u64data) + *u64data = 1000 * 1000 * 1000; + } + return S_OK; +} + +static HRESULT wined3d_timestamp_disjoint_query_ops_issue(struct wined3d_query *query, DWORD flags) +{ + TRACE("query %p, flags %#x.\n", query, flags); + + if (flags & WINED3DISSUE_BEGIN) + query->state = QUERY_BUILDING; + if (flags & WINED3DISSUE_END) + query->state = QUERY_SIGNALLED; + + return WINED3D_OK; +} + static const struct wined3d_query_ops event_query_ops = { wined3d_event_query_ops_get_data, @@ -531,6 +681,18 @@ wined3d_occlusion_query_ops_issue, }; +static const struct wined3d_query_ops timestamp_query_ops = +{ + wined3d_timestamp_query_ops_get_data, + wined3d_timestamp_query_ops_issue, +}; + +static const struct wined3d_query_ops timestamp_disjoint_query_ops = +{ + wined3d_timestamp_disjoint_query_ops_get_data, + wined3d_timestamp_disjoint_query_ops_issue, +}; + static HRESULT query_init(struct wined3d_query *query, struct wined3d_device *device, enum wined3d_query_type type) { const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; @@ -575,12 +737,41 @@ } break; - case WINED3D_QUERY_TYPE_VCACHE: - case WINED3D_QUERY_TYPE_RESOURCE_MANAGER: - case WINED3D_QUERY_TYPE_VERTEX_STATS: case WINED3D_QUERY_TYPE_TIMESTAMP: + TRACE("Timestamp query.\n"); + if (!gl_info->supported[ARB_TIMER_QUERY]) + { + WARN("Unsupported in local OpenGL implementation: ARB_TIMER_QUERY.\n"); + return WINED3DERR_NOTAVAILABLE; + } + query->query_ops = ×tamp_query_ops; + query->data_size = sizeof(UINT64); + query->extendedData = HeapAlloc(GetProcessHeap(), 0, sizeof(struct wined3d_timestamp_query)); + if (!query->extendedData) + { + ERR("Failed to allocate timestamp query extended data.\n"); + return E_OUTOFMEMORY; + } + ((struct wined3d_timestamp_query *)query->extendedData)->context = NULL; + break; + case WINED3D_QUERY_TYPE_TIMESTAMP_DISJOINT: case WINED3D_QUERY_TYPE_TIMESTAMP_FREQ: + TRACE("TIMESTAMP_DISJOINT query.\n"); + if (!gl_info->supported[ARB_TIMER_QUERY]) + { + WARN("Unsupported in local OpenGL implementation: ARB_TIMER_QUERY.\n"); + return WINED3DERR_NOTAVAILABLE; + } + query->query_ops = ×tamp_disjoint_query_ops; + query->data_size = type == WINED3D_QUERY_TYPE_TIMESTAMP_DISJOINT + ? sizeof(struct wined3d_query_data_timestamp_disjoint) : sizeof(UINT64); + query->extendedData = NULL; + break; + + case WINED3D_QUERY_TYPE_VCACHE: + case WINED3D_QUERY_TYPE_RESOURCE_MANAGER: + case WINED3D_QUERY_TYPE_VERTEX_STATS: case WINED3D_QUERY_TYPE_PIPELINE_TIMINGS: case WINED3D_QUERY_TYPE_INTERFACE_TIMINGS: case WINED3D_QUERY_TYPE_VERTEX_TIMINGS: diff -Nru wine1.7-1.7.14/dlls/wined3d/resource.c wine1.7-1.7.18/dlls/wined3d/resource.c --- wine1.7-1.7.14/dlls/wined3d/resource.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/wined3d/resource.c 2014-05-02 18:15:48.000000000 +0000 @@ -27,22 +27,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d); -struct private_data -{ - struct list entry; - - GUID tag; - DWORD flags; /* DDSPD_* */ - - union - { - void *data; - IUnknown *object; - } ptr; - - DWORD size; -}; - static DWORD resource_access_from_pool(enum wined3d_pool pool) { switch (pool) @@ -116,7 +100,6 @@ resource->parent = parent; resource->parent_ops = parent_ops; resource->resource_ops = resource_ops; - list_init(&resource->privateData); if (size) { @@ -151,9 +134,6 @@ void resource_cleanup(struct wined3d_resource *resource) { const struct wined3d *d3d = resource->device->wined3d; - struct private_data *data; - struct list *e1, *e2; - HRESULT hr; TRACE("Cleaning up resource %p.\n", resource); @@ -163,14 +143,6 @@ adapter_adjust_memory(resource->device->adapter, 0 - resource->size); } - LIST_FOR_EACH_SAFE(e1, e2, &resource->privateData) - { - data = LIST_ENTRY(e1, struct private_data, entry); - hr = wined3d_resource_free_private_data(resource, &data->tag); - if (FAILED(hr)) - ERR("Failed to free private data when destroying resource %p, hr = %#x.\n", resource, hr); - } - wined3d_resource_free_sysmem(resource); device_resource_released(resource->device, resource); @@ -185,128 +157,6 @@ resource, resource->type); } -static struct private_data *resource_find_private_data(const struct wined3d_resource *resource, REFGUID tag) -{ - struct private_data *data; - struct list *entry; - - TRACE("Searching for private data %s\n", debugstr_guid(tag)); - LIST_FOR_EACH(entry, &resource->privateData) - { - data = LIST_ENTRY(entry, struct private_data, entry); - if (IsEqualGUID(&data->tag, tag)) { - TRACE("Found %p\n", data); - return data; - } - } - TRACE("Not found\n"); - return NULL; -} - -HRESULT CDECL wined3d_resource_set_private_data(struct wined3d_resource *resource, REFGUID guid, - const void *data, DWORD data_size, DWORD flags) -{ - struct private_data *d; - - TRACE("resource %p, riid %s, data %p, data_size %u, flags %#x.\n", - resource, debugstr_guid(guid), data, data_size, flags); - - wined3d_resource_free_private_data(resource, guid); - - d = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*d)); - if (!d) return E_OUTOFMEMORY; - - d->tag = *guid; - d->flags = flags; - - if (flags & WINED3DSPD_IUNKNOWN) - { - if (data_size != sizeof(IUnknown *)) - { - WARN("IUnknown data with size %u, returning WINED3DERR_INVALIDCALL.\n", data_size); - HeapFree(GetProcessHeap(), 0, d); - return WINED3DERR_INVALIDCALL; - } - d->ptr.object = (IUnknown *)data; - d->size = sizeof(IUnknown *); - IUnknown_AddRef(d->ptr.object); - } - else - { - d->ptr.data = HeapAlloc(GetProcessHeap(), 0, data_size); - if (!d->ptr.data) - { - HeapFree(GetProcessHeap(), 0, d); - return E_OUTOFMEMORY; - } - d->size = data_size; - memcpy(d->ptr.data, data, data_size); - } - list_add_tail(&resource->privateData, &d->entry); - - return WINED3D_OK; -} - -HRESULT CDECL wined3d_resource_get_private_data(const struct wined3d_resource *resource, REFGUID guid, - void *data, DWORD *data_size) -{ - const struct private_data *d; - - TRACE("resource %p, guid %s, data %p, data_size %p.\n", - resource, debugstr_guid(guid), data, data_size); - - d = resource_find_private_data(resource, guid); - if (!d) return WINED3DERR_NOTFOUND; - - if (*data_size < d->size) - { - *data_size = d->size; - return WINED3DERR_MOREDATA; - } - - if (d->flags & WINED3DSPD_IUNKNOWN) - { - *(IUnknown **)data = d->ptr.object; - if (resource->device->wined3d->dxVersion != 7) - { - /* D3D8 and D3D9 addref the private data, DDraw does not. This - * can't be handled in ddraw because it doesn't know if the - * pointer returned is an IUnknown * or just a blob. */ - IUnknown_AddRef(d->ptr.object); - } - } - else - { - memcpy(data, d->ptr.data, d->size); - } - - return WINED3D_OK; -} -HRESULT CDECL wined3d_resource_free_private_data(struct wined3d_resource *resource, REFGUID guid) -{ - struct private_data *data; - - TRACE("resource %p, guid %s.\n", resource, debugstr_guid(guid)); - - data = resource_find_private_data(resource, guid); - if (!data) return WINED3DERR_NOTFOUND; - - if (data->flags & WINED3DSPD_IUNKNOWN) - { - if (data->ptr.object) - IUnknown_Release(data->ptr.object); - } - else - { - HeapFree(GetProcessHeap(), 0, data->ptr.data); - } - list_remove(&data->entry); - - HeapFree(GetProcessHeap(), 0, data); - - return WINED3D_OK; -} - DWORD resource_set_priority(struct wined3d_resource *resource, DWORD priority) { DWORD prev = resource->priority; diff -Nru wine1.7-1.7.14/dlls/wined3d/shader.c wine1.7-1.7.18/dlls/wined3d/shader.c --- wine1.7-1.7.14/dlls/wined3d/shader.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/wined3d/shader.c 2014-05-02 18:15:48.000000000 +0000 @@ -1151,7 +1151,7 @@ if (write_mask && write_mask != WINED3DSP_WRITEMASK_ALL) { - static const char *write_mask_chars = "xyzw"; + static const char write_mask_chars[] = "xyzw"; TRACE("."); if (write_mask & WINED3DSP_WRITEMASK_0) TRACE("%c", write_mask_chars[0]); @@ -1207,7 +1207,7 @@ if (swizzle != WINED3DSP_NOSWIZZLE) { - static const char *swizzle_chars = "xyzw"; + static const char swizzle_chars[] = "xyzw"; DWORD swizzle_x = swizzle & 0x03; DWORD swizzle_y = (swizzle >> 2) & 0x03; DWORD swizzle_z = (swizzle >> 4) & 0x03; diff -Nru wine1.7-1.7.14/dlls/wined3d/surface.c wine1.7-1.7.18/dlls/wined3d/surface.c --- wine1.7-1.7.14/dlls/wined3d/surface.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/wined3d/surface.c 2014-05-02 18:15:48.000000000 +0000 @@ -499,7 +499,6 @@ surface->hDC = CreateCompatibleDC(0); SelectObject(surface->hDC, surface->dib.DIBsection); TRACE("Using wined3d palette %p.\n", surface->palette); - SelectPalette(surface->hDC, surface->palette ? surface->palette->hpal : 0, FALSE); surface->flags |= SFLAG_DIBSECTION; @@ -671,8 +670,6 @@ TRACE("surface %p.\n", surface); - surface->texture_target = GL_TEXTURE_2D; - /* Non-power2 support */ if (gl_info->supported[ARB_TEXTURE_NON_POWER_OF_TWO] || gl_info->supported[WINED3D_GL_NORMALIZED_TEXRECT] || gl_info->supported[ARB_TEXTURE_RECTANGLE]) @@ -1436,26 +1433,6 @@ gdi_surface_unmap, }; -void surface_set_texture_target(struct wined3d_surface *surface, GLenum target, GLint level) -{ - TRACE("surface %p, target %#x.\n", surface, target); - - if (surface->texture_target != target) - { - if (target == GL_TEXTURE_RECTANGLE_ARB) - { - surface->flags &= ~SFLAG_NORMCOORD; - } - else if (surface->texture_target == GL_TEXTURE_RECTANGLE_ARB) - { - surface->flags |= SFLAG_NORMCOORD; - } - } - surface->texture_target = target; - surface->texture_level = level; - surface_force_reload(surface); -} - /* This call just downloads data, the caller is responsible for binding the * correct texture. */ /* Context activation is done by the caller. */ @@ -2435,7 +2412,7 @@ DWORD CDECL wined3d_surface_get_pitch(const struct wined3d_surface *surface) { - const struct wined3d_format *format = surface->resource.format; + unsigned int alignment; DWORD pitch; TRACE("surface %p.\n", surface); @@ -2443,19 +2420,9 @@ if (surface->pitch) return surface->pitch; - if (format->flags & WINED3DFMT_FLAG_BLOCKS) - { - /* Since compressed formats are block based, pitch means the amount of - * bytes to the next row of block rather than the next row of pixels. */ - UINT row_block_count = (surface->resource.width + format->block_width - 1) / format->block_width; - pitch = row_block_count * format->block_byte_count; - } - else - { - unsigned char alignment = surface->resource.device->surface_alignment; - pitch = surface->resource.format->byte_count * surface->resource.width; /* Bytes / row */ - pitch = (pitch + alignment - 1) & ~(alignment - 1); - } + alignment = surface->resource.device->surface_alignment; + pitch = wined3d_format_calculate_pitch(surface->resource.format, surface->resource.width); + pitch = (pitch + alignment - 1) & ~(alignment - 1); TRACE("Returning %u.\n", pitch); @@ -6310,7 +6277,7 @@ } static HRESULT surface_init(struct wined3d_surface *surface, struct wined3d_texture *container, - const struct wined3d_resource_desc *desc, DWORD flags) + const struct wined3d_resource_desc *desc, GLenum target, GLint level, DWORD flags) { struct wined3d_device *device = container->resource.device; const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; @@ -6380,7 +6347,8 @@ list_init(&surface->overlays); /* Flags */ - surface->flags |= SFLAG_NORMCOORD; /* Default to normalized coords. */ + if (target != GL_TEXTURE_RECTANGLE_ARB) + surface->flags |= SFLAG_NORMCOORD; if (flags & WINED3D_SURFACE_DISCARD) surface->flags |= SFLAG_DISCARD; if (flags & WINED3D_SURFACE_PIN_SYSMEM) @@ -6389,6 +6357,8 @@ surface->resource.access_flags |= WINED3D_RESOURCE_ACCESS_CPU; surface->map_binding = WINED3D_LOCATION_SYSMEM; + surface->texture_target = target; + surface->texture_level = level; /* Call the private setup routine */ hr = surface->surface_ops->surface_private_setup(surface); @@ -6417,8 +6387,8 @@ return hr; } -HRESULT CDECL wined3d_surface_create(struct wined3d_texture *container, - const struct wined3d_resource_desc *desc, DWORD flags, struct wined3d_surface **surface) +HRESULT wined3d_surface_create(struct wined3d_texture *container, const struct wined3d_resource_desc *desc, + GLenum target, GLint level, DWORD flags, struct wined3d_surface **surface) { struct wined3d_device_parent *device_parent = container->resource.device->device_parent; const struct wined3d_parent_ops *parent_ops; @@ -6426,16 +6396,16 @@ void *parent; HRESULT hr; - TRACE("container %p, width %u, height %u, format %s, usage %s (%#x), " - "pool %s, multisample_type %#x, multisample_quality %u, flags %#x, surface %p.\n", + TRACE("container %p, width %u, height %u, format %s, usage %s (%#x), pool %s, " + "multisample_type %#x, multisample_quality %u, target %#x, level %d, flags %#x, surface %p.\n", container, desc->width, desc->height, debug_d3dformat(desc->format), debug_d3dusage(desc->usage), desc->usage, debug_d3dpool(desc->pool), - desc->multisample_type, desc->multisample_quality, flags, surface); + desc->multisample_type, desc->multisample_quality, target, level, flags, surface); if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)))) return E_OUTOFMEMORY; - if (FAILED(hr = surface_init(object, container, desc, flags))) + if (FAILED(hr = surface_init(object, container, desc, target, level, flags))) { WARN("Failed to initialize surface, returning %#x.\n", hr); HeapFree(GetProcessHeap(), 0, object); diff -Nru wine1.7-1.7.14/dlls/wined3d/texture.c wine1.7-1.7.18/dlls/wined3d/texture.c --- wine1.7-1.7.14/dlls/wined3d/texture.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/wined3d/texture.c 2014-05-02 18:15:48.000000000 +0000 @@ -744,7 +744,6 @@ { struct wined3d_surface *surface = surface_from_resource(sub_resource); - surface_set_texture_target(surface, 0, 0); surface_set_container(surface, NULL); wined3d_surface_decref(surface); } @@ -879,14 +878,14 @@ UINT idx = j * texture->level_count + i; struct wined3d_surface *surface; - if (FAILED(hr = wined3d_surface_create(texture, &surface_desc, surface_flags, &surface))) + if (FAILED(hr = wined3d_surface_create(texture, &surface_desc, + cube_targets[j], i, surface_flags, &surface))) { WARN("Failed to create surface, hr %#x.\n", hr); wined3d_texture_cleanup(texture); return hr; } - surface_set_texture_target(surface, cube_targets[j], i); texture->sub_resources[idx] = &surface->resource; TRACE("Created surface level %u @ %p.\n", i, surface); } @@ -1033,14 +1032,14 @@ { struct wined3d_surface *surface; - if (FAILED(hr = wined3d_surface_create(texture, &surface_desc, surface_flags, &surface))) + if (FAILED(hr = wined3d_surface_create(texture, &surface_desc, + texture->target, i, surface_flags, &surface))) { WARN("Failed to create surface, hr %#x.\n", hr); wined3d_texture_cleanup(texture); return hr; } - surface_set_texture_target(surface, texture->target, i); texture->sub_resources[i] = &surface->resource; TRACE("Created surface level %u @ %p.\n", i, surface); /* Calculate the next mipmap level. */ diff -Nru wine1.7-1.7.14/dlls/wined3d/utils.c wine1.7-1.7.18/dlls/wined3d/utils.c --- wine1.7-1.7.14/dlls/wined3d/utils.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/wined3d/utils.c 2014-05-02 18:15:48.000000000 +0000 @@ -2019,9 +2019,20 @@ return &gl_info->formats[idx]; } +UINT wined3d_format_calculate_pitch(const struct wined3d_format *format, UINT width) +{ + /* For block based formats, pitch means the amount of bytes to the next + * row of blocks rather than the next row of pixels. */ + if (format->flags & WINED3DFMT_FLAG_BLOCKS) + return format->block_byte_count * ((width + format->block_width - 1) / format->block_width); + + return format->byte_count * width; +} + UINT wined3d_format_calculate_size(const struct wined3d_format *format, UINT alignment, UINT width, UINT height, UINT depth) { + UINT pitch = wined3d_format_calculate_pitch(format, width); UINT size; if (format->id == WINED3DFMT_UNKNOWN) @@ -2030,13 +2041,12 @@ } else if (format->flags & WINED3DFMT_FLAG_BLOCKS) { - UINT row_block_count = (width + format->block_width - 1) / format->block_width; UINT row_count = (height + format->block_height - 1) / format->block_height; - size = row_count * (((row_block_count * format->block_byte_count) + alignment - 1) & ~(alignment - 1)); + size = row_count * ((pitch + alignment - 1) & ~(alignment - 1)); } else { - size = height * (((width * format->byte_count) + alignment - 1) & ~(alignment - 1)); + size = height * ((pitch + alignment - 1) & ~(alignment - 1)); } if (format->flags & WINED3DFMT_FLAG_HEIGHT_SCALE) diff -Nru wine1.7-1.7.14/dlls/wined3d/wined3d_gl.h wine1.7-1.7.18/dlls/wined3d/wined3d_gl.h --- wine1.7-1.7.14/dlls/wined3d/wined3d_gl.h 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/wined3d/wined3d_gl.h 2014-05-02 18:15:48.000000000 +0000 @@ -43,6 +43,7 @@ APPLE_FLUSH_BUFFER_RANGE, APPLE_YCBCR_422, /* ARB */ + ARB_BLEND_FUNC_EXTENDED, ARB_COLOR_BUFFER_FLOAT, ARB_DEBUG_OUTPUT, ARB_DEPTH_BUFFER_FLOAT, @@ -88,6 +89,7 @@ ARB_TEXTURE_NON_POWER_OF_TWO, ARB_TEXTURE_RECTANGLE, ARB_TEXTURE_RG, + ARB_TIMER_QUERY, ARB_VERTEX_ARRAY_BGRA, ARB_VERTEX_BLEND, ARB_VERTEX_BUFFER_OBJECT, @@ -180,6 +182,9 @@ /* GL_APPLE_flush_buffer_range */ \ USE_GL_FUNC(glBufferParameteriAPPLE) \ USE_GL_FUNC(glFlushMappedBufferRangeAPPLE) \ + /* GL_ARB_blend_func_extended */ \ + USE_GL_FUNC(glBindFragDataLocationIndexed) \ + USE_GL_FUNC(glGetFragDataIndex) \ /* GL_ARB_color_buffer_float */ \ USE_GL_FUNC(glClampColorARB) \ /* GL_ARB_debug_output */ \ @@ -317,6 +322,9 @@ USE_GL_FUNC(glCompressedTexSubImage2DARB) \ USE_GL_FUNC(glCompressedTexSubImage3DARB) \ USE_GL_FUNC(glGetCompressedTexImageARB) \ + /* GL_ARB_timer_query */ \ + USE_GL_FUNC(glQueryCounter) \ + USE_GL_FUNC(glGetQueryObjectui64v) \ /* GL_ARB_vertex_blend */ \ USE_GL_FUNC(glVertexBlendARB) \ USE_GL_FUNC(glWeightPointerARB) \ diff -Nru wine1.7-1.7.14/dlls/wined3d/wined3d_main.c wine1.7-1.7.18/dlls/wined3d/wined3d_main.c --- wine1.7-1.7.14/dlls/wined3d/wined3d_main.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/wined3d/wined3d_main.c 2014-05-02 18:15:48.000000000 +0000 @@ -87,7 +87,7 @@ FALSE, /* 3D support enabled by default. */ }; -struct wined3d * CDECL wined3d_create(UINT version, DWORD flags) +struct wined3d * CDECL wined3d_create(DWORD flags) { struct wined3d *object; HRESULT hr; @@ -99,10 +99,10 @@ return NULL; } - if (version == 7 && wined3d_settings.no_3d) + if (wined3d_settings.no_3d) flags |= WINED3D_NO3D; - hr = wined3d_init(object, version, flags); + hr = wined3d_init(object, flags); if (FAILED(hr)) { WARN("Failed to initialize wined3d object, hr %#x.\n", hr); @@ -110,7 +110,7 @@ return NULL; } - TRACE("Created wined3d object %p for d3d%d support.\n", object, version); + TRACE("Created wined3d object %p.\n", object); return object; } diff -Nru wine1.7-1.7.14/dlls/wined3d/wined3d_private.h wine1.7-1.7.18/dlls/wined3d/wined3d_private.h --- wine1.7-1.7.14/dlls/wined3d/wined3d_private.h 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/wined3d/wined3d_private.h 2014-05-02 18:15:48.000000000 +0000 @@ -1045,6 +1045,16 @@ void wined3d_event_query_issue(struct wined3d_event_query *query, const struct wined3d_device *device) DECLSPEC_HIDDEN; BOOL wined3d_event_query_supported(const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN; +struct wined3d_timestamp_query +{ + struct list entry; + GLuint id; + struct wined3d_context *context; +}; + +void context_alloc_timestamp_query(struct wined3d_context *context, struct wined3d_timestamp_query *query) DECLSPEC_HIDDEN; +void context_free_timestamp_query(struct wined3d_timestamp_query *query) DECLSPEC_HIDDEN; + struct wined3d_context { const struct wined3d_gl_info *gl_info; @@ -1086,7 +1096,9 @@ DWORD lowest_disabled_stage : 4; /* Max MAX_TEXTURES, 8 */ DWORD rebind_fbo : 1; DWORD needs_set : 1; - DWORD padding : 18; + DWORD hdc_is_private : 1; + DWORD hdc_has_format : 1; /* only meaningful if hdc_is_private */ + DWORD padding : 16; DWORD shader_update_mask; DWORD constant_update_mask; DWORD numbered_array_mask; @@ -1135,6 +1147,11 @@ UINT free_event_query_count; struct list event_queries; + GLuint *free_timestamp_queries; + UINT free_timestamp_query_size; + UINT free_timestamp_query_count; + struct list timestamp_queries; + struct wined3d_stream_info stream_info; /* Fences for GL_APPLE_flush_buffer_range */ @@ -1472,9 +1489,14 @@ CARD_NVIDIA_GEFORCE_GTX670 = 0x1189, CARD_NVIDIA_GEFORCE_GTX670MX = 0x11a1, CARD_NVIDIA_GEFORCE_GTX680 = 0x1180, + CARD_NVIDIA_GEFORCE_GTX750 = 0x1381, + CARD_NVIDIA_GEFORCE_GTX750TI = 0x1380, + CARD_NVIDIA_GEFORCE_GTX760 = 0x1187, CARD_NVIDIA_GEFORCE_GTX765M = 0x11e2, CARD_NVIDIA_GEFORCE_GTX770M = 0x11e0, CARD_NVIDIA_GEFORCE_GTX770 = 0x1184, + CARD_NVIDIA_GEFORCE_GTX780 = 0x1004, + CARD_NVIDIA_GEFORCE_GTX780TI = 0x100a, CARD_VMWARE_SVGA3D = 0x0405, @@ -1785,12 +1807,11 @@ { LONG ref; DWORD flags; - UINT dxVersion; UINT adapter_count; struct wined3d_adapter adapters[1]; }; -HRESULT wined3d_init(struct wined3d *wined3d, UINT version, DWORD flags) DECLSPEC_HIDDEN; +HRESULT wined3d_init(struct wined3d *wined3d, DWORD flags) DECLSPEC_HIDDEN; BOOL wined3d_register_window(HWND window, struct wined3d_device *device) DECLSPEC_HIDDEN; void wined3d_unregister_window(HWND window) DECLSPEC_HIDDEN; @@ -2006,7 +2027,6 @@ UINT size; DWORD priority; void *heap_memory; - struct list privateData; struct list resource_list_entry; void *parent; @@ -2280,8 +2300,8 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const POINT *dst_point, struct wined3d_surface *src_surface, const RECT *src_rect) DECLSPEC_HIDDEN; void surface_validate_location(struct wined3d_surface *surface, DWORD location) DECLSPEC_HIDDEN; -HRESULT CDECL wined3d_surface_create(struct wined3d_texture *container, - const struct wined3d_resource_desc *desc, DWORD flags, struct wined3d_surface **surface) DECLSPEC_HIDDEN; +HRESULT wined3d_surface_create(struct wined3d_texture *container, const struct wined3d_resource_desc *desc, + GLenum target, GLint level, DWORD flags, struct wined3d_surface **surface) DECLSPEC_HIDDEN; void surface_prepare_map_memory(struct wined3d_surface *surface) DECLSPEC_HIDDEN; void get_drawable_size_swapchain(const struct wined3d_context *context, UINT *width, UINT *height) DECLSPEC_HIDDEN; @@ -2937,10 +2957,8 @@ LONG ref; struct wined3d_device *device; - HPALETTE hpal; - WORD palVersion; /*| */ - WORD palNumEntries; /*| LOGPALETTE */ - PALETTEENTRY palents[256]; /*| */ + unsigned int size; + PALETTEENTRY palents[256]; DWORD flags; }; @@ -3021,6 +3039,7 @@ const struct wined3d_format *wined3d_get_format(const struct wined3d_gl_info *gl_info, enum wined3d_format_id format_id) DECLSPEC_HIDDEN; +UINT wined3d_format_calculate_pitch(const struct wined3d_format *format, UINT width) DECLSPEC_HIDDEN; UINT wined3d_format_calculate_size(const struct wined3d_format *format, UINT alignment, UINT width, UINT height, UINT depth) DECLSPEC_HIDDEN; DWORD wined3d_format_convert_from_float(const struct wined3d_surface *surface, diff -Nru wine1.7-1.7.14/dlls/wined3d/wined3d.spec wine1.7-1.7.18/dlls/wined3d/wined3d.spec --- wine1.7-1.7.14/dlls/wined3d/wined3d.spec 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/wined3d/wined3d.spec 2014-05-02 18:15:48.000000000 +0000 @@ -1,12 +1,13 @@ @ stdcall wined3d_mutex_lock() @ stdcall wined3d_mutex_unlock() +@ cdecl wined3d_calculate_format_pitch(ptr long long long) @ cdecl wined3d_check_depth_stencil_match(ptr long long long long long) @ cdecl wined3d_check_device_format(ptr long long long long long long) @ cdecl wined3d_check_device_format_conversion(ptr long long long long) @ cdecl wined3d_check_device_multisample_type(ptr long long long long long ptr) @ cdecl wined3d_check_device_type(ptr long long long long long) -@ cdecl wined3d_create(long long) +@ cdecl wined3d_create(long) @ cdecl wined3d_decref(ptr) @ cdecl wined3d_enum_adapter_modes(ptr long long long long ptr) @ cdecl wined3d_get_adapter_count(ptr) @@ -170,12 +171,9 @@ @ cdecl wined3d_query_incref(ptr) @ cdecl wined3d_query_issue(ptr long) -@ cdecl wined3d_resource_free_private_data(ptr ptr) @ cdecl wined3d_resource_get_desc(ptr ptr) @ cdecl wined3d_resource_get_parent(ptr) -@ cdecl wined3d_resource_get_private_data(ptr ptr ptr ptr) @ cdecl wined3d_resource_set_parent(ptr ptr) -@ cdecl wined3d_resource_set_private_data(ptr ptr ptr long long) @ cdecl wined3d_rendertarget_view_create(ptr ptr ptr) @ cdecl wined3d_rendertarget_view_decref(ptr) diff -Nru wine1.7-1.7.14/dlls/winemac.drv/cocoa_app.h wine1.7-1.7.18/dlls/winemac.drv/cocoa_app.h --- wine1.7-1.7.14/dlls/winemac.drv/cocoa_app.h 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/winemac.drv/cocoa_app.h 2014-05-02 18:15:48.000000000 +0000 @@ -97,6 +97,8 @@ @property (readonly, copy, nonatomic) NSEvent* lastFlagsChanged; @property (readonly, nonatomic) BOOL areDisplaysCaptured; +@property (readonly) BOOL clippingCursor; + + (WineApplicationController*) sharedController; - (void) transformProcessToForeground; diff -Nru wine1.7-1.7.14/dlls/winemac.drv/cocoa_app.m wine1.7-1.7.18/dlls/winemac.drv/cocoa_app.m --- wine1.7-1.7.14/dlls/winemac.drv/cocoa_app.m 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/winemac.drv/cocoa_app.m 2014-05-02 18:15:48.000000000 +0000 @@ -100,6 +100,8 @@ @synthesize cursorFrames, cursorTimer, cursor; @synthesize mouseCaptureWindow; + @synthesize clippingCursor; + + (void) initialize { if (self == [WineApplicationController class]) @@ -1354,6 +1356,16 @@ [self deactivateCursorClipping]; } + - (void) updateWindowsForCursorClipping + { + WineWindow* window; + for (window in [NSApp windows]) + { + if ([window isKindOfClass:[WineWindow class]]) + [window updateForCursorClipping]; + } + } + - (BOOL) startClippingCursor:(CGRect)rect { CGError err; @@ -1372,6 +1384,7 @@ clippingCursor = TRUE; cursorClipRect = rect; [self updateCursorClippingState]; + [self updateWindowsForCursorClipping]; return TRUE; } @@ -1384,6 +1397,7 @@ clippingCursor = FALSE; [self updateCursorClippingState]; + [self updateWindowsForCursorClipping]; return TRUE; } diff -Nru wine1.7-1.7.14/dlls/winemac.drv/cocoa_window.h wine1.7-1.7.18/dlls/winemac.drv/cocoa_window.h --- wine1.7-1.7.14/dlls/winemac.drv/cocoa_window.h 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/winemac.drv/cocoa_window.h 2014-05-02 18:15:48.000000000 +0000 @@ -54,6 +54,8 @@ NSUInteger lastModifierFlags; NSTimer* liveResizeDisplayTimer; + NSRect frameAtResizeStart; + BOOL resizingFromLeft, resizingFromTop; void* imeData; BOOL commandDone; @@ -86,4 +88,6 @@ - (WineWindow*) ancestorWineWindow; + - (void) updateForCursorClipping; + @end diff -Nru wine1.7-1.7.14/dlls/winemac.drv/cocoa_window.m wine1.7-1.7.18/dlls/winemac.drv/cocoa_window.m --- wine1.7-1.7.14/dlls/winemac.drv/cocoa_window.m 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/winemac.drv/cocoa_window.m 2014-05-02 18:15:48.000000000 +0000 @@ -628,7 +628,8 @@ - (BOOL) preventResizing { - return ([self styleMask] & NSResizableWindowMask) && (disabled || !resizable || maximized); + BOOL preventForClipping = cursor_clipping_locks_windows && [[WineApplicationController sharedController] clippingCursor]; + return ([self styleMask] & NSResizableWindowMask) && (disabled || !resizable || maximized || preventForClipping); } - (void) adjustFeaturesForState @@ -659,8 +660,15 @@ [self setContentMinSize:savedContentMinSize]; } - if (allow_immovable_windows) - [self setMovable:!disabled && !maximized]; + if (allow_immovable_windows || cursor_clipping_locks_windows) + { + if (allow_immovable_windows && (disabled || maximized)) + [self setMovable:NO]; + else if (cursor_clipping_locks_windows && [[WineApplicationController sharedController] clippingCursor]) + [self setMovable:NO]; + else + [self setMovable:YES]; + } } - (void) adjustFullScreenBehavior:(NSWindowCollectionBehavior)behavior @@ -713,6 +721,12 @@ [self setStyleMask:newStyle ^ NSClosableWindowMask]; } [self setStyleMask:newStyle]; + + // -setStyleMask: resets the firstResponder to the window. Set it + // back to the content view. + if ([[self contentView] acceptsFirstResponder]) + [self makeFirstResponder:[self contentView]]; + [self adjustFullScreenBehavior:[self collectionBehavior]]; if ([[self title] length] == 0 && [title length] > 0) @@ -1488,6 +1502,11 @@ macdrv_release_event(event); } + - (void) updateForCursorClipping + { + [self adjustFeaturesForState]; + } + /* * ---------- NSWindow method overrides ---------- @@ -1803,7 +1822,17 @@ - (void)windowDidResize:(NSNotification *)notification { macdrv_event* event; - NSRect frame = [self contentRectForFrameRect:[self frame]]; + NSRect frame = [self frame]; + + if ([self inLiveResize]) + { + if (NSMinX(frame) != NSMinX(frameAtResizeStart)) + resizingFromLeft = TRUE; + if (NSMaxY(frame) != NSMaxY(frameAtResizeStart)) + resizingFromTop = TRUE; + } + + frame = [self contentRectForFrameRect:frame]; if (ignore_windowResize || exitingFullScreen) return; @@ -1893,6 +1922,42 @@ [self becameIneligibleParentOrChild]; } + - (NSSize) windowWillResize:(NSWindow*)sender toSize:(NSSize)frameSize + { + if ([self inLiveResize]) + { + NSRect rect; + macdrv_query* query; + + rect = [self frame]; + if (resizingFromLeft) + rect.origin.x = NSMaxX(rect) - frameSize.width; + if (!resizingFromTop) + rect.origin.y = NSMaxY(rect) - frameSize.height; + rect.size = frameSize; + rect = [self contentRectForFrameRect:rect]; + [[WineApplicationController sharedController] flipRect:&rect]; + + query = macdrv_create_query(); + query->type = QUERY_RESIZE_SIZE; + query->window = (macdrv_window)[self retain]; + query->resize_size.rect = NSRectToCGRect(rect); + query->resize_size.from_left = resizingFromLeft; + query->resize_size.from_top = resizingFromTop; + + if ([self.queue query:query timeout:0.1]) + { + rect = NSRectFromCGRect(query->resize_size.rect); + rect = [self frameRectForContentRect:rect]; + frameSize = rect.size; + } + + macdrv_release_query(query); + } + + return frameSize; + } + - (void) windowWillStartLiveResize:(NSNotification *)notification { macdrv_query* query = macdrv_create_query(); @@ -1902,6 +1967,9 @@ [self.queue query:query timeout:0.3]; macdrv_release_query(query); + 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 diff -Nru wine1.7-1.7.14/dlls/winemac.drv/event.c wine1.7-1.7.18/dlls/winemac.drv/event.c --- wine1.7-1.7.14/dlls/winemac.drv/event.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/winemac.drv/event.c 2014-05-02 18:15:48.000000000 +0000 @@ -162,6 +162,10 @@ TRACE("QUERY_PASTEBOARD_DATA\n"); success = query_pasteboard_data(hwnd, query->pasteboard_data.type); break; + case QUERY_RESIZE_SIZE: + TRACE("QUERY_RESIZE_SIZE\n"); + success = query_resize_size(hwnd, query); + break; case QUERY_RESIZE_START: TRACE("QUERY_RESIZE_START\n"); success = query_resize_start(hwnd); diff -Nru wine1.7-1.7.14/dlls/winemac.drv/ime.c wine1.7-1.7.18/dlls/winemac.drv/ime.c --- wine1.7-1.7.14/dlls/winemac.drv/ime.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/winemac.drv/ime.c 2014-05-02 18:15:48.000000000 +0000 @@ -1410,7 +1410,7 @@ InitOnceExecuteOnce( &init_once, register_classes, NULL, NULL ); lpIMEInfo->dwPrivateDataSize = sizeof(IMEPRIVATE); lpIMEInfo->fdwProperty = IME_PROP_UNICODE | IME_PROP_AT_CARET; - lpIMEInfo->fdwConversionCaps = IME_CMODE_NATIVE; + lpIMEInfo->fdwConversionCaps = IME_CMODE_NATIVE | IME_CMODE_FULLSHAPE; lpIMEInfo->fdwSentenceCaps = IME_SMODE_AUTOMATIC; lpIMEInfo->fdwUICaps = UI_CAP_2700; /* Tell App we cannot accept ImeSetCompositionString calls */ diff -Nru wine1.7-1.7.14/dlls/winemac.drv/keyboard.c wine1.7-1.7.18/dlls/winemac.drv/keyboard.c --- wine1.7-1.7.14/dlls/winemac.drv/keyboard.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/winemac.drv/keyboard.c 2014-05-02 18:15:48.000000000 +0000 @@ -1229,6 +1229,8 @@ UInt32 deadKeyState = 0; UniCharCount len; OSStatus status; + DWORD vkey; + int i; uchr = (const UCKeyboardLayout*)CFDataGetBytePtr(thread_data->keyboard_layout_uchr); status = UCKeyTranslate(uchr, keyc, kUCKeyActionDisplay, 0, thread_data->keyboard_type, @@ -1237,51 +1239,46 @@ len = 0; if (len && isgraphW(buffer[0])) buffer[len] = 0; - else - { - DWORD vkey = thread_data->keyc2vkey[keyc]; - int i; - - if (scan & 0x100) vkey |= 0x100; - if (lparam & (1 << 25)) + vkey = thread_data->keyc2vkey[keyc]; + if (lparam & (1 << 25)) + { + /* Caller doesn't care about distinctions between left and + right keys. */ + switch (vkey) { - /* Caller doesn't care about distinctions between left and - right keys. */ - switch (vkey) - { - case VK_LSHIFT: - case VK_RSHIFT: - vkey = VK_SHIFT; break; - case VK_LCONTROL: - case VK_RCONTROL: - vkey = VK_CONTROL; break; - case VK_LMENU: - case VK_RMENU: - vkey = VK_MENU; break; - } + case VK_LSHIFT: + case VK_RSHIFT: + vkey = VK_SHIFT; break; + case VK_LCONTROL: + case VK_RCONTROL: + vkey = VK_CONTROL; break; + case VK_LMENU: + case VK_RMENU: + vkey = VK_MENU; break; } + } - len = 0; - for (i = 0; i < sizeof(vkey_names) / sizeof(vkey_names[0]); i++) - { - if (vkey_names[i].vkey == vkey) - { - len = MultiByteToWideChar(CP_UTF8, 0, vkey_names[i].name, -1, buffer, size); - if (len) len--; - break; - } - } + if (scan & 0x100) vkey |= 0x100; - if (!len) + for (i = 0; i < sizeof(vkey_names) / sizeof(vkey_names[0]); i++) + { + if (vkey_names[i].vkey == vkey) { - static const WCHAR format[] = {'K','e','y',' ','0','x','%','0','2','x',0}; - snprintfW(buffer, size, format, vkey); - len = strlenW(buffer); + len = MultiByteToWideChar(CP_UTF8, 0, vkey_names[i].name, -1, buffer, size); + if (len) len--; + break; } } if (!len) + { + static const WCHAR format[] = {'K','e','y',' ','0','x','%','0','2','x',0}; + snprintfW(buffer, size, format, vkey); + len = strlenW(buffer); + } + + if (!len) break; if (status == noErr && deadKeyState) diff -Nru wine1.7-1.7.14/dlls/winemac.drv/macdrv_cocoa.h wine1.7-1.7.18/dlls/winemac.drv/macdrv_cocoa.h --- wine1.7-1.7.14/dlls/winemac.drv/macdrv_cocoa.h 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/winemac.drv/macdrv_cocoa.h 2014-05-02 18:15:48.000000000 +0000 @@ -89,7 +89,7 @@ #ifndef DECLSPEC_HIDDEN -# if defined(__MSC_VER) || defined(__MINGW32__) || defined(__CYGWIN__) +# if defined(_MSC_VER) || defined(__MINGW32__) || defined(__CYGWIN__) # define DECLSPEC_HIDDEN # elif defined(__GNUC__) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3))) # define DECLSPEC_HIDDEN __attribute__((visibility ("hidden"))) @@ -147,6 +147,7 @@ extern int left_option_is_alt DECLSPEC_HIDDEN; extern int right_option_is_alt DECLSPEC_HIDDEN; extern int allow_immovable_windows DECLSPEC_HIDDEN; +extern int cursor_clipping_locks_windows 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; @@ -298,6 +299,7 @@ QUERY_DRAG_OPERATION, QUERY_IME_CHAR_RECT, QUERY_PASTEBOARD_DATA, + QUERY_RESIZE_SIZE, QUERY_RESIZE_START, QUERY_MIN_MAX_INFO, NUM_QUERY_TYPES @@ -331,6 +333,11 @@ struct { CFStringRef type; } pasteboard_data; + struct { + CGRect rect; + unsigned int from_left : 1; + unsigned int from_top : 1; + } resize_size; }; } macdrv_query; diff -Nru wine1.7-1.7.14/dlls/winemac.drv/macdrv.h wine1.7-1.7.18/dlls/winemac.drv/macdrv.h --- wine1.7-1.7.14/dlls/winemac.drv/macdrv.h 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/winemac.drv/macdrv.h 2014-05-02 18:15:48.000000000 +0000 @@ -141,6 +141,7 @@ unsigned int per_pixel_alpha : 1; /* is window using per-pixel alpha? */ unsigned int minimized : 1; /* is window minimized? */ unsigned int being_dragged : 1; /* is window being dragged under Cocoa's control? */ + unsigned int swap_interval : 1; /* GL swap interval for window */ struct window_surface *surface; struct window_surface *unminimized_surface; }; @@ -172,6 +173,7 @@ extern void macdrv_window_restore_requested(HWND hwnd) DECLSPEC_HIDDEN; extern void macdrv_window_drag_begin(HWND hwnd) DECLSPEC_HIDDEN; extern void macdrv_window_drag_end(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.14/dlls/winemac.drv/macdrv_main.c wine1.7-1.7.18/dlls/winemac.drv/macdrv_main.c --- wine1.7-1.7.14/dlls/winemac.drv/macdrv_main.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/winemac.drv/macdrv_main.c 2014-05-02 18:15:48.000000000 +0000 @@ -55,6 +55,7 @@ BOOL allow_software_rendering = FALSE; BOOL disable_window_decorations = FALSE; int allow_immovable_windows = TRUE; +int cursor_clipping_locks_windows = TRUE; HMODULE macdrv_module = 0; @@ -175,6 +176,9 @@ if (!get_config_key(hkey, appkey, "AllowImmovableWindows", buffer, sizeof(buffer))) allow_immovable_windows = IS_OPTION_TRUE(buffer[0]); + if (!get_config_key(hkey, appkey, "CursorClippingLocksWindows", buffer, sizeof(buffer))) + cursor_clipping_locks_windows = IS_OPTION_TRUE(buffer[0]); + if (appkey) RegCloseKey(appkey); if (hkey) RegCloseKey(hkey); } diff -Nru wine1.7-1.7.14/dlls/winemac.drv/opengl.c wine1.7-1.7.18/dlls/winemac.drv/opengl.c --- wine1.7-1.7.14/dlls/winemac.drv/opengl.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/winemac.drv/opengl.c 2014-05-02 18:15:48.000000000 +0000 @@ -26,6 +26,7 @@ #include "winuser.h" #include "winternl.h" +#include "winnt.h" #include "wine/library.h" #include "wine/debug.h" #include "wine/wgl.h" @@ -56,18 +57,32 @@ struct wgl_context { + struct list entry; int format; macdrv_opengl_context context; CGLContextObj cglcontext; + HWND draw_hwnd; macdrv_view draw_view; struct wgl_pbuffer *draw_pbuffer; macdrv_view read_view; struct wgl_pbuffer *read_pbuffer; BOOL has_been_current; BOOL sharing; + LONG update_swap_interval; DWORD last_flush_time; }; +static struct list context_list = LIST_INIT(context_list); + +static CRITICAL_SECTION context_section; +static CRITICAL_SECTION_DEBUG critsect_debug = +{ + 0, 0, &context_section, + { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList }, + 0, 0, { (DWORD_PTR)(__FILE__ ": context_section") } +}; +static CRITICAL_SECTION context_section = { &critsect_debug, -1, 0, 0, 0, 0 }; + struct wgl_pbuffer { @@ -101,6 +116,7 @@ static void (*pglCopyColorTable)(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); static void (*pglCopyPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type); +static void (*pglFinish)(void); static void (*pglFlush)(void); static void (*pglFlushRenderAPPLE)(void); static const GLubyte *(*pglGetString)(GLenum name); @@ -1295,27 +1311,28 @@ */ static BOOL set_win_format(struct macdrv_win_data *data, int format) { - macdrv_window cocoa_window; - TRACE("hwnd %p format %d\n", data->hwnd, format); - if (!get_gl_view_window_rect(data, &cocoa_window, &data->gl_rect)) + if (!data->gl_view) { - ERR("no top-level parent with Cocoa window in this process\n"); - return FALSE; - } + macdrv_window cocoa_window; - if (data->gl_view) macdrv_dispose_view(data->gl_view); - data->gl_view = macdrv_create_view(cocoa_window, cgrect_from_rect(data->gl_rect)); + if (!get_gl_view_window_rect(data, &cocoa_window, &data->gl_rect)) + { + ERR("no top-level parent with Cocoa window in this process\n"); + return FALSE; + } - if (!data->gl_view) - { - WARN("failed to create GL view for window %p rect %s\n", cocoa_window, wine_dbgstr_rect(&data->gl_rect)); - return FALSE; - } + data->gl_view = macdrv_create_view(cocoa_window, cgrect_from_rect(data->gl_rect)); + if (!data->gl_view) + { + WARN("failed to create GL view for window %p rect %s\n", cocoa_window, wine_dbgstr_rect(&data->gl_rect)); + return FALSE; + } - TRACE("created GL view %p in window %p at %s\n", data->gl_view, cocoa_window, - wine_dbgstr_rect(&data->gl_rect)); + TRACE("created GL view %p in window %p at %s\n", data->gl_view, cocoa_window, + wine_dbgstr_rect(&data->gl_rect)); + } data->pixel_format = format; @@ -1462,6 +1479,55 @@ /********************************************************************** + * set_swap_interval + */ +static BOOL set_swap_interval(struct wgl_context *context, long interval) +{ + CGLError err; + + /* In theory, for single-buffered contexts, there's no such thing as a swap + so the swap interval shouldn't matter. But OS X will synchronize flushes + of single-buffered contexts if the interval is set to non-zero. */ + if (interval && !pixel_formats[context->format - 1].double_buffer) + interval = 0; + + err = CGLSetParameter(context->cglcontext, kCGLCPSwapInterval, (GLint*)&interval); + if (err != kCGLNoError) + WARN("CGLSetParameter(kCGLCPSwapInterval) failed; error %d %s\n", err, CGLErrorString(err)); + + return err == kCGLNoError; +} + + +/********************************************************************** + * sync_swap_interval + */ +static void sync_swap_interval(struct wgl_context *context) +{ + if (InterlockedCompareExchange(&context->update_swap_interval, FALSE, TRUE)) + { + int interval; + + if (context->draw_hwnd) + { + struct macdrv_win_data *data = get_win_data(context->draw_hwnd); + if (data) + { + interval = data->swap_interval; + release_win_data(data); + } + else /* window was destroyed? */ + interval = 1; + } + else /* pbuffer */ + interval = 0; + + set_swap_interval(context, interval); + } +} + + +/********************************************************************** * macdrv_glCopyColorTable * * Hook into glCopyColorTable as part of the implementation of @@ -1508,25 +1574,48 @@ } +/********************************************************************** + * macdrv_glFinish + */ +static void macdrv_glFinish(void) +{ + struct wgl_context *context = NtCurrentTeb()->glContext; + + sync_swap_interval(context); + pglFinish(); +} + + +/********************************************************************** + * macdrv_glFlush + */ static void macdrv_glFlush(void) { struct wgl_context *context = NtCurrentTeb()->glContext; - const pixel_format *pf = &pixel_formats[context->format - 1]; - DWORD now = GetTickCount(); - TRACE("double buffer %d last flush time %d now %d\n", (int)pf->double_buffer, - context->last_flush_time, now); - if (pglFlushRenderAPPLE && !pf->double_buffer && (now - context->last_flush_time) < 17) - { - TRACE("calling glFlushRenderAPPLE()\n"); - pglFlushRenderAPPLE(); - } - else + sync_swap_interval(context); + + if (skip_single_buffer_flushes) { - TRACE("calling glFlush()\n"); - pglFlush(); - context->last_flush_time = now; + const pixel_format *pf = &pixel_formats[context->format - 1]; + DWORD now = GetTickCount(); + + TRACE("double buffer %d last flush time %d now %d\n", (int)pf->double_buffer, + context->last_flush_time, now); + if (pglFlushRenderAPPLE && !pf->double_buffer && (now - context->last_flush_time) < 17) + { + TRACE("calling glFlushRenderAPPLE()\n"); + pglFlushRenderAPPLE(); + return; + } + else + { + TRACE("calling glFlush()\n"); + context->last_flush_time = now; + } } + + pglFlush(); } @@ -2541,17 +2630,29 @@ static int macdrv_wglGetSwapIntervalEXT(void) { struct wgl_context *context = NtCurrentTeb()->glContext; + struct macdrv_win_data *data; long value; CGLError err; TRACE("\n"); - err = CGLGetParameter(context->cglcontext, kCGLCPSwapInterval, (GLint*)&value); - if (err != kCGLNoError) + if ((data = get_win_data(context->draw_hwnd))) { - WARN("CGLGetParameter(kCGLCPSwapInterval) failed; error %d %s\n", - err, CGLErrorString(err)); - value = 1; + value = data->swap_interval; + release_win_data(data); + + if (InterlockedCompareExchange(&context->update_swap_interval, FALSE, TRUE)) + set_swap_interval(context, value); + } + else + { + err = CGLGetParameter(context->cglcontext, kCGLCPSwapInterval, (GLint*)&value); + if (err != kCGLNoError) + { + WARN("CGLGetParameter(kCGLCPSwapInterval) failed; error %d %s\n", + err, CGLErrorString(err)); + value = 1; + } } return value; @@ -2606,6 +2707,10 @@ return FALSE; } + if (allow_vsync && (InterlockedCompareExchange(&context->update_swap_interval, FALSE, TRUE) || hwnd != context->draw_hwnd)) + set_swap_interval(context, data->swap_interval); + + context->draw_hwnd = hwnd; context->draw_view = data->gl_view; context->draw_pbuffer = NULL; release_win_data(data); @@ -2625,6 +2730,10 @@ SetLastError(ERROR_INVALID_PIXEL_FORMAT); return FALSE; } + + if (allow_vsync && + (InterlockedCompareExchange(&context->update_swap_interval, FALSE, TRUE) || pbuffer != context->draw_pbuffer)) + set_swap_interval(context, 0); } else { @@ -2634,6 +2743,7 @@ return FALSE; } + context->draw_hwnd = NULL; context->draw_view = NULL; context->draw_pbuffer = pbuffer; LeaveCriticalSection(&dc_pbuffers_section); @@ -2925,8 +3035,7 @@ static BOOL macdrv_wglSwapIntervalEXT(int interval) { struct wgl_context *context = NtCurrentTeb()->glContext; - long value; - CGLError err; + BOOL changed = FALSE; TRACE("interval %d\n", interval); @@ -2935,22 +3044,43 @@ SetLastError(ERROR_INVALID_DATA); return FALSE; } + if (interval > 1) + interval = 1; - if (!pixel_formats[context->format - 1].double_buffer) + if (context->draw_hwnd) + { + struct macdrv_win_data *data = get_win_data(context->draw_hwnd); + if (data) + { + changed = data->swap_interval != interval; + if (changed) + data->swap_interval = interval; + release_win_data(data); + } + } + else /* pbuffer */ interval = 0; - else if (interval > 1) - interval = 1; - value = interval; - err = CGLSetParameter(context->cglcontext, kCGLCPSwapInterval, (GLint*)&value); - if (err != kCGLNoError) + InterlockedExchange(&context->update_swap_interval, FALSE); + if (!set_swap_interval(context, interval)) { - WARN("CGLSetParameter(kCGLCPSwapInterval) failed; error %d %s\n", - err, CGLErrorString(err)); SetLastError(ERROR_GEN_FAILURE); return FALSE; } + if (changed) + { + struct wgl_context *ctx; + + EnterCriticalSection(&context_section); + LIST_FOR_EACH_ENTRY(ctx, &context_list, struct wgl_context, entry) + { + if (ctx != context && ctx->draw_hwnd == context->draw_hwnd) + InterlockedExchange(&context->update_swap_interval, TRUE); + } + LeaveCriticalSection(&context_section); + } + return TRUE; } @@ -3092,8 +3222,10 @@ REDIRECT(glGetString); REDIRECT(glReadPixels); REDIRECT(glViewport); - if (skip_single_buffer_flushes) + if (skip_single_buffer_flushes || allow_vsync) REDIRECT(glFlush); + if (allow_vsync) + REDIRECT(glFinish); #undef REDIRECT /* redirect some OpenGL extension functions */ @@ -3193,7 +3325,6 @@ CGLPixelFormatObj pix; GLint virtualScreens; CGLError err; - long swap_interval; pf = get_pixel_format(context->format, TRUE /* non-displayable */); if (!pf) @@ -3279,19 +3410,6 @@ return FALSE; } - /* According to the WGL_EXT_swap_control docs, the default swap interval for - a context is 1. CGL contexts default to 0, so we need to set it. This - only make sense for double-buffered contexts, though. In theory, for - single-buffered contexts, there's no such thing as a swap. But OS X - will synchronize flushes of single-buffered contexts if this is set. */ - if (pf->double_buffer && allow_vsync) - swap_interval = 1; - else - swap_interval = 0; - err = CGLSetParameter(context->cglcontext, kCGLCPSwapInterval, (GLint*)&swap_interval); - if (err != kCGLNoError) - WARN("CGLSetParameter(kCGLCPSwapInterval) failed with error %d %s; leaving un-vsynced\n", err, CGLErrorString(err)); - context->context = macdrv_create_opengl_context(context->cglcontext); CGLReleaseContext(context->cglcontext); if (!context->context) @@ -3300,6 +3418,9 @@ return FALSE; } + if (allow_vsync) + InterlockedExchange(&context->update_swap_interval, TRUE); + TRACE("created context %p/%p/%p\n", context, context->context, context->cglcontext); return TRUE; @@ -3415,6 +3536,10 @@ return NULL; } + EnterCriticalSection(&context_section); + list_add_tail(&context_list, &context->entry); + LeaveCriticalSection(&context_section); + return context; } @@ -3424,6 +3549,11 @@ static void macdrv_wglDeleteContext(struct wgl_context *context) { TRACE("deleting context %p/%p/%p\n", context, context->context, context->cglcontext); + + EnterCriticalSection(&context_section); + list_remove(&context->entry); + LeaveCriticalSection(&context_section); + macdrv_dispose_opengl_context(context->context); HeapFree(GetProcessHeap(), 0, context); } @@ -3553,17 +3683,61 @@ static BOOL macdrv_wglSwapBuffers(HDC hdc) { struct wgl_context *context = NtCurrentTeb()->glContext; + BOOL match = FALSE; + HWND hwnd; TRACE("hdc %p context %p/%p/%p\n", hdc, context, (context ? context->context : NULL), (context ? context->cglcontext : NULL)); - if (!context) + if (context) + sync_swap_interval(context); + + if ((hwnd = WindowFromDC(hdc))) { - SetLastError(ERROR_INVALID_HANDLE); - return FALSE; + struct macdrv_win_data *data; + + if (!(data = get_win_data(hwnd))) + { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + + if (context && context->draw_view == data->gl_view) + match = TRUE; + + release_win_data(data); + } + else + { + struct wgl_pbuffer *pbuffer; + + EnterCriticalSection(&dc_pbuffers_section); + pbuffer = (struct wgl_pbuffer*)CFDictionaryGetValue(dc_pbuffers, hdc); + LeaveCriticalSection(&dc_pbuffers_section); + + if (!pbuffer) + { + SetLastError(ERROR_INVALID_HANDLE); + return FALSE; + } + + if (context && context->draw_pbuffer == pbuffer) + match = TRUE; + } + + if (match) + macdrv_flush_opengl_context(context->context); + else + { + FIXME("current context %p doesn't match hdc %p; can't swap\n", context, hdc); + + /* If there is a current context, then wglSwapBuffers should do an implicit + glFlush(). That would be taken care of by macdrv_flush_opengl_context() + in the other branch, but we have to do it explicitly here. */ + if (context) + pglFlush(); } - macdrv_flush_opengl_context(context->context); return TRUE; } diff -Nru wine1.7-1.7.14/dlls/winemac.drv/window.c wine1.7-1.7.18/dlls/winemac.drv/window.c --- wine1.7-1.7.14/dlls/winemac.drv/window.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/winemac.drv/window.c 2014-05-02 18:15:48.000000000 +0000 @@ -239,6 +239,7 @@ { data->hwnd = hwnd; data->color_key = CLR_INVALID; + data->swap_interval = 1; EnterCriticalSection(&win_data_section); if (!win_datas) win_datas = CFDictionaryCreateMutable(NULL, 0, NULL, NULL); @@ -1373,7 +1374,7 @@ * * Assign specified region to window (for non-rectangular windows) */ -int CDECL macdrv_SetWindowRgn(HWND hwnd, HRGN hrgn, BOOL redraw) +void CDECL macdrv_SetWindowRgn(HWND hwnd, HRGN hrgn, BOOL redraw) { struct macdrv_win_data *data; @@ -1392,8 +1393,6 @@ if (procid != GetCurrentProcessId()) SendMessageW(hwnd, WM_MACDRV_SET_WIN_REGION, 0, 0); } - - return TRUE; } @@ -2398,6 +2397,46 @@ } +/*********************************************************************** + * query_resize_size + * + * Handler for QUERY_RESIZE_SIZE query. + */ +BOOL query_resize_size(HWND hwnd, macdrv_query *query) +{ + struct macdrv_win_data *data = get_win_data(hwnd); + RECT rect = rect_from_cgrect(query->resize_size.rect); + int corner; + BOOL ret = FALSE; + + if (!data) return FALSE; + + macdrv_mac_to_window_rect(data, &rect); + + if (query->resize_size.from_left) + { + if (query->resize_size.from_top) + corner = WMSZ_TOPLEFT; + else + corner = WMSZ_BOTTOMLEFT; + } + else if (query->resize_size.from_top) + corner = WMSZ_TOPRIGHT; + else + corner = WMSZ_BOTTOMRIGHT; + + if (SendMessageW(hwnd, WM_SIZING, corner, (LPARAM)&rect)) + { + macdrv_window_to_mac_rect(data, GetWindowLongW(hwnd, GWL_STYLE), &rect); + query->resize_size.rect = cgrect_from_rect(rect); + ret = TRUE; + } + + release_win_data(data); + return ret; +} + + /*********************************************************************** * query_resize_start * diff -Nru wine1.7-1.7.14/dlls/wineps.drv/ppd.c wine1.7-1.7.18/dlls/wineps.drv/ppd.c --- wine1.7-1.7.14/dlls/wineps.drv/ppd.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/wineps.drv/ppd.c 2014-05-02 18:15:48.000000000 +0000 @@ -816,26 +816,13 @@ tuple.value = NULL; } - else if(!strcmp("*PageSize", tuple.key)) { + else if(!strcmp("*PageSize", tuple.key)) + { page = get_pagesize( ppd, tuple.option, TRUE ); if(!page->Name) { - int i; - page->Name = tuple.option; tuple.option = NULL; - - for(i = 0; PageTrans[i].PSName; i++) { - if(!strcmp(PageTrans[i].PSName, page->Name)) { /* case ? */ - page->WinPage = PageTrans[i].WinPage; - break; - } - } - if(!page->WinPage) { - TRACE("Can't find Windows page type for '%s' - using %u\n", - page->Name, UserPageType); - page->WinPage = UserPageType++; - } } if(!page->FullName) { if(tuple.opttrans) { @@ -851,7 +838,24 @@ page->InvocationString = tuple.value; tuple.value = NULL; } - } + if (!page->WinPage) + { + int i; + for (i = 0; PageTrans[i].PSName; i++) + { + if (!strcmp( PageTrans[i].PSName, page->Name )) + { + page->WinPage = PageTrans[i].WinPage; + break; + } + } + if (!page->WinPage) + { + TRACE( "Can't find Windows page type for %s - using %u\n", debugstr_a(page->Name), UserPageType ); + page->WinPage = UserPageType++; + } + } + } else if(!strcmp("*DefaultPageSize", tuple.key)) { diff -Nru wine1.7-1.7.14/dlls/winex11.drv/ime.c wine1.7-1.7.18/dlls/winex11.drv/ime.c --- wine1.7-1.7.14/dlls/winex11.drv/ime.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/winex11.drv/ime.c 2014-05-02 18:15:48.000000000 +0000 @@ -564,7 +564,7 @@ InitOnceExecuteOnce( &init_once, register_classes, NULL, NULL ); lpIMEInfo->dwPrivateDataSize = sizeof (IMEPRIVATE); lpIMEInfo->fdwProperty = IME_PROP_UNICODE | IME_PROP_AT_CARET; - lpIMEInfo->fdwConversionCaps = IME_CMODE_NATIVE; + lpIMEInfo->fdwConversionCaps = IME_CMODE_NATIVE | IME_CMODE_FULLSHAPE; lpIMEInfo->fdwSentenceCaps = IME_SMODE_AUTOMATIC; lpIMEInfo->fdwUICaps = UI_CAP_2700; /* Tell App we cannot accept ImeSetCompositionString calls */ diff -Nru wine1.7-1.7.14/dlls/winex11.drv/opengl.c wine1.7-1.7.18/dlls/winex11.drv/opengl.c --- wine1.7-1.7.14/dlls/winex11.drv/opengl.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/winex11.drv/opengl.c 2014-05-02 18:15:48.000000000 +0000 @@ -252,6 +252,7 @@ XVisualInfo *visual; /* information about the GL visual */ RECT rect; /* drawable rect, relative to whole window drawable */ int swap_interval; + BOOL refresh_swap_interval; }; enum glx_swap_control_method @@ -1185,6 +1186,43 @@ } } +static BOOL set_swap_interval(Drawable drawable, int interval) +{ + BOOL ret = TRUE; + + switch (swap_control_method) + { + case GLX_SWAP_CONTROL_EXT: + X11DRV_expect_error(gdi_display, GLXErrorHandler, NULL); + pglXSwapIntervalEXT(gdi_display, drawable, interval); + XSync(gdi_display, False); + ret = !X11DRV_check_error(); + break; + + case GLX_SWAP_CONTROL_MESA: + ret = !pglXSwapIntervalMESA(interval); + break; + + case GLX_SWAP_CONTROL_SGI: + /* wglSwapIntervalEXT considers an interval value of zero to mean that + * vsync should be disabled, but glXSwapIntervalSGI considers such a + * value to be an error. Just silently ignore the request for now. + */ + if (!interval) + WARN("Request to disable vertical sync is not handled\n"); + else + ret = !pglXSwapIntervalSGI(interval); + break; + + case GLX_SWAP_CONTROL_NONE: + /* Unlikely to happen on modern GLX implementations */ + WARN("Request to adjust swap interval is not handled\n"); + break; + } + + return ret; +} + static struct gl_drawable *get_gl_drawable( HWND hwnd, HDC hdc ) { struct gl_drawable *gl; @@ -1250,13 +1288,9 @@ /*********************************************************************** * create_gl_drawable */ -static BOOL create_gl_drawable( HWND hwnd, HWND parent, struct gl_drawable *gl ) +static BOOL create_gl_drawable( HWND hwnd, struct gl_drawable *gl ) { gl->drawable = 0; - /* Default GLX and WGL swap interval is 1, but in case of glXSwapIntervalSGI - * there is no way to query it, so we have to store it here. - */ - gl->swap_interval = 1; if (GetAncestor( hwnd, GA_PARENT ) == GetDesktopWindow()) /* top-level window */ { @@ -1318,6 +1352,8 @@ } } + if (gl->drawable) + gl->refresh_swap_interval = TRUE; return gl->drawable != 0; } @@ -1327,10 +1363,14 @@ */ static BOOL set_win_format( HWND hwnd, const struct wgl_pixel_format *format ) { - HWND parent = GetAncestor( hwnd, GA_PARENT ); struct gl_drawable *gl, *prev; gl = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*gl) ); + /* Default GLX and WGL swap interval is 1, but in case of glXSwapIntervalSGI + * there is no way to query it, so we have to store it here. + */ + gl->swap_interval = 1; + gl->refresh_swap_interval = TRUE; gl->format = format; gl->visual = pglXGetVisualFromFBConfig( gdi_display, format->fbconfig ); if (!gl->visual) @@ -1343,7 +1383,7 @@ gl->rect.right = min( max( 1, gl->rect.right ), 65535 ); gl->rect.bottom = min( max( 1, gl->rect.bottom ), 65535 ); - if (!create_gl_drawable( hwnd, parent, gl )) + if (!create_gl_drawable( hwnd, gl )) { XFree( gl->visual ); HeapFree( GetProcessHeap(), 0, gl ); @@ -1356,7 +1396,10 @@ EnterCriticalSection( &context_section ); if (!XFindContext( gdi_display, (XID)hwnd, gl_hwnd_context, (char **)&prev )) + { + gl->swap_interval = prev->swap_interval; free_gl_drawable( prev ); + } XSaveContext( gdi_display, (XID)hwnd, gl_hwnd_context, (char *)gl ); LeaveCriticalSection( &context_section ); @@ -1450,7 +1493,7 @@ goto done; } - if (!create_gl_drawable( hwnd, parent, gl )) + if (!create_gl_drawable( hwnd, gl )) { XDeleteContext( gdi_display, (XID)hwnd, gl_hwnd_context ); release_gl_drawable( gl ); @@ -2280,11 +2323,9 @@ LeaveCriticalSection( &context_section ); escape.code = X11DRV_SET_DRAWABLE; - escape.hwnd = 0; escape.drawable = object->drawable; escape.mode = IncludeInferiors; SetRect( &escape.dc_rect, 0, 0, object->width, object->height ); - escape.fbconfig_id = object->fmt->fmt_id; ExtEscape( hdc, X11DRV_ESCAPE, sizeof(escape), (LPSTR)&escape, 0, NULL ); TRACE( "(%p)->(%p)\n", object, hdc ); @@ -2958,36 +2999,8 @@ return FALSE; } - switch (swap_control_method) - { - case GLX_SWAP_CONTROL_EXT: - X11DRV_expect_error(gdi_display, GLXErrorHandler, NULL); - pglXSwapIntervalEXT(gdi_display, gl->drawable, interval); - XSync(gdi_display, False); - ret = !X11DRV_check_error(); - break; - - case GLX_SWAP_CONTROL_MESA: - ret = !pglXSwapIntervalMESA(interval); - break; - - case GLX_SWAP_CONTROL_SGI: - /* wglSwapIntervalEXT considers an interval value of zero to mean that - * vsync should be disabled, but glXSwapIntervalSGI considers such a - * value to be an error. Just silently ignore the request for now. - */ - if (!interval) - WARN("Request to disable vertical sync is not handled\n"); - else - ret = !pglXSwapIntervalSGI(interval); - break; - - case GLX_SWAP_CONTROL_NONE: - /* Unlikely to happen on modern GLX implementations */ - WARN("Request to adjust swap interval is not handled\n"); - break; - } - + ret = set_swap_interval(gl->drawable, interval); + gl->refresh_swap_interval = FALSE; if (ret) gl->swap_interval = interval; else @@ -3203,6 +3216,12 @@ return FALSE; } + if (gl->refresh_swap_interval) + { + set_swap_interval(gl->drawable, gl->swap_interval); + gl->refresh_swap_interval = FALSE; + } + switch (gl->type) { case DC_GL_PIXMAP_WIN: diff -Nru wine1.7-1.7.14/dlls/winex11.drv/window.c wine1.7-1.7.18/dlls/winex11.drv/window.c --- wine1.7-1.7.14/dlls/winex11.drv/window.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/winex11.drv/window.c 2014-05-02 18:15:48.000000000 +0000 @@ -314,7 +314,6 @@ attr->colormap = data->colormap ? data->colormap : default_colormap; attr->save_under = ((GetClassLongW( data->hwnd, GCL_STYLE ) & CS_SAVEBITS) != 0); attr->bit_gravity = NorthWestGravity; - attr->win_gravity = StaticGravity; attr->backing_store = NotUseful; attr->border_pixel = 0; attr->event_mask = (ExposureMask | PointerMotionMask | @@ -1378,6 +1377,13 @@ int cx = min( max( 1, data->client_rect.right - data->client_rect.left ), 65535 ); int cy = min( max( 1, data->client_rect.bottom - data->client_rect.top ), 65535 ); + if (data->client_window) + { + XDeleteContext( data->display, data->client_window, winContext ); + XDestroyWindow( data->display, data->client_window ); + } + + if (data->colormap) XFreeColormap( data->display, data->colormap ); data->colormap = XCreateColormap( data->display, root_window, visual->visual, (visual->class == PseudoColor || visual->class == GrayScale || @@ -1963,10 +1969,8 @@ struct x11drv_escape_set_drawable escape; HWND parent; - escape.code = X11DRV_SET_DRAWABLE; - escape.hwnd = hwnd; - escape.mode = IncludeInferiors; - escape.fbconfig_id = 0; + escape.code = X11DRV_SET_DRAWABLE; + escape.mode = IncludeInferiors; escape.dc_rect.left = win_rect->left - top_rect->left; escape.dc_rect.top = win_rect->top - top_rect->top; @@ -2012,12 +2016,10 @@ struct x11drv_escape_set_drawable escape; escape.code = X11DRV_SET_DRAWABLE; - escape.hwnd = GetDesktopWindow(); escape.drawable = root_window; escape.mode = IncludeInferiors; escape.dc_rect = get_virtual_screen_rect(); OffsetRect( &escape.dc_rect, -2 * escape.dc_rect.left, -2 * escape.dc_rect.top ); - escape.fbconfig_id = 0; ExtEscape( hdc, X11DRV_ESCAPE, sizeof(escape), (LPSTR)&escape, 0, NULL ); } @@ -2433,7 +2435,7 @@ * * Assign specified region to window (for non-rectangular windows) */ -int CDECL X11DRV_SetWindowRgn( HWND hwnd, HRGN hrgn, BOOL redraw ) +void CDECL X11DRV_SetWindowRgn( HWND hwnd, HRGN hrgn, BOOL redraw ) { struct x11drv_win_data *data; @@ -2446,7 +2448,6 @@ { SendMessageW( hwnd, WM_X11DRV_SET_WIN_REGION, 0, 0 ); } - return TRUE; } diff -Nru wine1.7-1.7.14/dlls/winex11.drv/wintab.c wine1.7-1.7.18/dlls/winex11.drv/wintab.c --- wine1.7-1.7.14/dlls/winex11.drv/wintab.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/winex11.drv/wintab.c 2014-05-02 18:15:48.000000000 +0000 @@ -415,7 +415,7 @@ return FALSE; } -static BOOL is_stylus(const char *name, const char *type) +static UINT get_cursor_type(const char *name, const char *type) { int i; static const char* tablet_stylus_whitelist[] = { @@ -426,23 +426,21 @@ NULL }; + /* First check device type to avoid cases where name is "Pen and Eraser" and type is "ERASER" */ for (i=0; tablet_stylus_whitelist[i] != NULL; i++) { - if (name && match_token(name, tablet_stylus_whitelist[i])) - return TRUE; if (type && match_token(type, tablet_stylus_whitelist[i])) - return TRUE; + return CSR_TYPE_PEN; } - - return FALSE; -} - -static BOOL is_eraser(const char *name, const char *type) -{ - if (name && match_token(name, "eraser")) - return TRUE; if (type && match_token(type, "eraser")) - return TRUE; - return FALSE; + return CSR_TYPE_ERASER; + for (i=0; tablet_stylus_whitelist[i] != NULL; i++) { + if (name && match_token(name, tablet_stylus_whitelist[i])) + return CSR_TYPE_PEN; + } + if (name && match_token(name, "eraser")) + return CSR_TYPE_ERASER; + + return CSR_TYPE_OTHER; } /* cursors are placed in gSysCursor rows depending on their type @@ -538,6 +536,8 @@ gSysContext.lcSensZ = 65536; gSysContext.lcSysSensX= 65536; gSysContext.lcSysSensY= 65536; + gSysContext.lcOutExtX= GetSystemMetrics(SM_CXSCREEN); + gSysContext.lcOutExtY= GetSystemMetrics(SM_CYSCREEN); /* initialize cursors */ disable_system_cursors(); @@ -635,13 +635,7 @@ cursor.NPBTNMARKS[1] = 1 ; cursor.CAPABILITIES = CRC_MULTIMODE; - /* prefer finding TYPE_PEN(most capable) */ - if (is_stylus(target->name, device_type)) - cursor.TYPE = CSR_TYPE_PEN; - else if (is_eraser(target->name, device_type)) - cursor.TYPE = CSR_TYPE_ERASER; - else - cursor.TYPE = CSR_TYPE_OTHER; + cursor.TYPE = get_cursor_type(target->name, device_type); any = target->inputclassinfo; diff -Nru wine1.7-1.7.14/dlls/winex11.drv/x11drv.h wine1.7-1.7.18/dlls/winex11.drv/x11drv.h --- wine1.7-1.7.14/dlls/winex11.drv/x11drv.h 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/winex11.drv/x11drv.h 2014-05-02 18:15:48.000000000 +0000 @@ -283,11 +283,9 @@ struct x11drv_escape_set_drawable { enum x11drv_escape_codes code; /* escape code (X11DRV_SET_DRAWABLE) */ - HWND hwnd; /* window for this drawable */ Drawable drawable; /* X drawable */ int mode; /* ClipByChildren or IncludeInferiors */ RECT dc_rect; /* DC rectangle relative to drawable */ - XID fbconfig_id; /* fbconfig id used by the GL drawable */ }; struct x11drv_escape_get_drawable diff -Nru wine1.7-1.7.14/dlls/winhttp/cookie.c wine1.7-1.7.18/dlls/winhttp/cookie.c --- wine1.7-1.7.14/dlls/winhttp/cookie.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/winhttp/cookie.c 2014-05-02 18:15:48.000000000 +0000 @@ -134,10 +134,6 @@ const WCHAR *p; int len; - if (!(cookie = heap_alloc_zero( sizeof(cookie_t) ))) return NULL; - - list_init( &cookie->entry ); - if (!(p = strchrW( string, '=' ))) { WARN("no '=' in %s\n", debugstr_w(string)); @@ -148,6 +144,11 @@ WARN("empty cookie name in %s\n", debugstr_w(string)); return NULL; } + + if (!(cookie = heap_alloc_zero( sizeof(cookie_t) ))) return NULL; + + list_init( &cookie->entry ); + len = p - string; if (!(cookie->name = heap_alloc( (len + 1) * sizeof(WCHAR) ))) { diff -Nru wine1.7-1.7.14/dlls/winhttp/request.c wine1.7-1.7.18/dlls/winhttp/request.c --- wine1.7-1.7.14/dlls/winhttp/request.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/winhttp/request.c 2014-05-02 18:15:48.000000000 +0000 @@ -1628,7 +1628,11 @@ { int len = strlenW( ++p ); in.cbBuffer = decode_base64( p, len, NULL ); - if (!(in.pvBuffer = heap_alloc( in.cbBuffer ))) return FALSE; + if (!(in.pvBuffer = heap_alloc( in.cbBuffer ))) { + destroy_authinfo( authinfo ); + *auth_ptr = NULL; + return FALSE; + } decode_base64( p, len, in.pvBuffer ); } out.BufferType = SECBUFFER_TOKEN; @@ -1636,6 +1640,8 @@ if (!(out.pvBuffer = heap_alloc( authinfo->max_token ))) { heap_free( in.pvBuffer ); + destroy_authinfo( authinfo ); + *auth_ptr = NULL; return FALSE; } out_desc.ulVersion = 0; diff -Nru wine1.7-1.7.14/dlls/winhttp/session.c wine1.7-1.7.18/dlls/winhttp/session.c --- wine1.7-1.7.14/dlls/winhttp/session.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/winhttp/session.c 2014-05-02 18:15:48.000000000 +0000 @@ -1612,11 +1612,11 @@ heap_free( hdr ); if (!ret) { - heap_free( config->lpszAutoConfigUrl ); + GlobalFree( config->lpszAutoConfigUrl ); config->lpszAutoConfigUrl = NULL; - heap_free( config->lpszProxy ); + GlobalFree( config->lpszProxy ); config->lpszProxy = NULL; - heap_free( config->lpszProxyBypass ); + GlobalFree( config->lpszProxyBypass ); config->lpszProxyBypass = NULL; } return ret; diff -Nru wine1.7-1.7.14/dlls/winhttp/tests/winhttp.c wine1.7-1.7.18/dlls/winhttp/tests/winhttp.c --- wine1.7-1.7.14/dlls/winhttp/tests/winhttp.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/winhttp/tests/winhttp.c 2014-05-02 18:15:48.000000000 +0000 @@ -1721,6 +1721,11 @@ SetLastError(0xdeadbeef); ret = WinHttpSendRequest(req, NULL, 0, NULL, 0, 0, 0); + if(ret == 1) + { + skip("nxdomain returned success. Broken ISP redirects?\n"); + return; + } ok(!ret, "sent request\n"); ok(GetLastError() == ERROR_WINHTTP_NAME_NOT_RESOLVED, "expected ERROR_WINHTTP_NAME_NOT_RESOLVED got %u\n", GetLastError()); diff -Nru wine1.7-1.7.14/dlls/wininet/http.c wine1.7-1.7.18/dlls/wininet/http.c --- wine1.7-1.7.14/dlls/wininet/http.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/wininet/http.c 2014-05-02 18:15:48.000000000 +0000 @@ -3289,7 +3289,7 @@ { appinfo_t *hIC = session->appInfo; http_request_t *request; - DWORD len, res = ERROR_SUCCESS; + DWORD len; TRACE("-->\n"); @@ -3378,13 +3378,7 @@ INTERNET_STATUS_HANDLE_CREATED, &request->hdr.hInternet, sizeof(HINTERNET)); - TRACE("<-- %u (%p)\n", res, request); - - if(res != ERROR_SUCCESS) { - WININET_Release( &request->hdr ); - *ret = NULL; - return res; - } + TRACE("<-- (%p)\n", request); *ret = request->hdr.hInternet; return ERROR_SUCCESS; diff -Nru wine1.7-1.7.14/dlls/wininet/tests/http.c wine1.7-1.7.18/dlls/wininet/tests/http.c --- wine1.7-1.7.14/dlls/wininet/tests/http.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/wininet/tests/http.c 2014-05-02 18:15:48.000000000 +0000 @@ -2196,7 +2196,7 @@ if (!memcmp(buffer, "GET ", sizeof("GET ")-1) && !strstr(buffer, "Cache-Control: no-cache\r\n")) send(c, okmsg, sizeof(okmsg)-1, 0); else if (strstr(buffer, "Cache-Control: no-cache\r\n")) send(c, okmsg, sizeof(okmsg)-1, 0); - send(c, notokmsg, sizeof(notokmsg)-1, 0); + else send(c, notokmsg, sizeof(notokmsg)-1, 0); } if (strstr(buffer, "GET /test_premature_disconnect")) trace("closing connection\n"); @@ -2213,7 +2213,7 @@ static void test_basic_request(int port, const char *verb, const char *url) { HINTERNET hi, hc, hr; - DWORD r, count; + DWORD r, count, error; char buffer[0x100]; hi = InternetOpenA(NULL, INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0); @@ -2225,7 +2225,10 @@ hr = HttpOpenRequestA(hc, verb, url, NULL, NULL, NULL, 0, 0); ok(hr != NULL, "HttpOpenRequest failed\n"); + SetLastError(0xdeadbeef); r = HttpSendRequestA(hr, NULL, 0, NULL, 0); + error = GetLastError(); + ok(error == ERROR_SUCCESS || broken(error != ERROR_SUCCESS), "expected ERROR_SUCCESS, got %u\n", error); ok(r, "HttpSendRequest failed\n"); count = 0; @@ -2241,32 +2244,6 @@ InternetCloseHandle(hi); } -static void test_last_error(int port) -{ - HINTERNET hi, hc, hr; - DWORD error; - BOOL r; - - 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); - ok(hc != NULL, "connect failed\n"); - - hr = HttpOpenRequestA(hc, NULL, "/test1", NULL, NULL, NULL, 0, 0); - ok(hr != NULL, "HttpOpenRequest failed\n"); - - SetLastError(0xdeadbeef); - r = HttpSendRequestA(hr, NULL, 0, NULL, 0); - error = GetLastError(); - ok(r, "HttpSendRequest failed\n"); - ok(error == ERROR_SUCCESS || broken(error != ERROR_SUCCESS), "expected ERROR_SUCCESS, got %u\n", error); - - InternetCloseHandle(hr); - InternetCloseHandle(hc); - InternetCloseHandle(hi); -} - static void test_proxy_indirect(int port) { HINTERNET hi, hc, hr; @@ -3078,12 +3055,17 @@ CHECK_NOTIFIED(INTERNET_STATUS_REQUEST_SENT); CHECK_NOTIFIED(INTERNET_STATUS_RECEIVING_RESPONSE); CHECK_NOTIFIED(INTERNET_STATUS_RESPONSE_RECEIVED); - CHECK_NOTIFIED(INTERNET_STATUS_CLOSING_CONNECTION); - CHECK_NOTIFIED(INTERNET_STATUS_CONNECTION_CLOSED); CHECK_NOTIFIED(INTERNET_STATUS_REQUEST_COMPLETE); close_async_handle(session, hCompleteEvent, 2); CloseHandle(hCompleteEvent); + + /* + * The connection should be closed before closing handle. This is true for most + * wininet versions (including Wine), but some old win2k versions fail to do that. + */ + CHECK_NOTIFIED(INTERNET_STATUS_CLOSING_CONNECTION); + CHECK_NOTIFIED(INTERNET_STATUS_CONNECTION_CLOSED); } static void test_conn_close(int port) @@ -3933,6 +3915,7 @@ ret = HttpSendRequestA(request, NULL, 0, NULL, 0); ok(ret, "HttpSendRequest failed %u\n", GetLastError()); test_status_code(request, 200); + InternetCloseHandle(request); request = HttpOpenRequestA(connect, "POST", "/test_cache_control_verb", NULL, NULL, NULL, INTERNET_FLAG_NO_CACHE_WRITE, 0); @@ -3940,6 +3923,7 @@ ret = HttpSendRequestA(request, NULL, 0, NULL, 0); ok(ret, "HttpSendRequest failed %u\n", GetLastError()); test_status_code(request, 200); + InternetCloseHandle(request); request = HttpOpenRequestA(connect, "HEAD", "/test_cache_control_verb", NULL, NULL, NULL, INTERNET_FLAG_NO_CACHE_WRITE, 0); @@ -3947,6 +3931,7 @@ ret = HttpSendRequestA(request, NULL, 0, NULL, 0); ok(ret, "HttpSendRequest failed %u\n", GetLastError()); test_status_code(request, 200); + InternetCloseHandle(request); request = HttpOpenRequestA(connect, "GET", "/test_cache_control_verb", NULL, NULL, NULL, INTERNET_FLAG_NO_CACHE_WRITE, 0); @@ -3954,8 +3939,8 @@ ret = HttpSendRequestA(request, NULL, 0, NULL, 0); ok(ret, "HttpSendRequest failed %u\n", GetLastError()); test_status_code(request, 200); - InternetCloseHandle(request); + InternetCloseHandle(connect); InternetCloseHandle(session); } @@ -3994,7 +3979,6 @@ test_response_without_headers(si.port); test_HttpQueryInfo(si.port); test_HttpSendRequestW(si.port); - test_last_error(si.port); test_options(si.port); test_no_content(si.port); test_conn_close(si.port); diff -Nru wine1.7-1.7.14/dlls/winmm/tests/capture.c wine1.7-1.7.18/dlls/winmm/tests/capture.c --- wine1.7-1.7.14/dlls/winmm/tests/capture.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/winmm/tests/capture.c 2014-05-02 18:15:48.000000000 +0000 @@ -454,7 +454,8 @@ format.cbSize=0; rc=waveInOpen(&win,device,&format,0,0,CALLBACK_NULL|WAVE_FORMAT_DIRECT); ok(rc==MMSYSERR_NOERROR || rc==WAVERR_BADFORMAT || - rc==MMSYSERR_INVALFLAG || rc==MMSYSERR_INVALPARAM, + rc==MMSYSERR_INVALFLAG || rc==MMSYSERR_INVALPARAM || + rc==MMSYSERR_ALLOCATED, "waveInOpen(%s): returned: %s\n",dev_name(device),wave_in_error(rc)); if (rc==MMSYSERR_NOERROR) { waveInClose(win); @@ -472,7 +473,8 @@ format.cbSize=0; rc=waveInOpen(&win,device,&format,0,0,CALLBACK_NULL|WAVE_FORMAT_DIRECT); ok(rc==MMSYSERR_NOERROR || rc==WAVERR_BADFORMAT || - rc==MMSYSERR_INVALFLAG || rc==MMSYSERR_INVALPARAM, + rc==MMSYSERR_INVALFLAG || rc==MMSYSERR_INVALPARAM || + rc==MMSYSERR_ALLOCATED, "waveInOpen(%s): returned: %s\n",dev_name(device),wave_in_error(rc)); if (rc==MMSYSERR_NOERROR) { waveInClose(win); @@ -496,7 +498,8 @@ rc=waveInOpen(&win,device,&wfex.Format,0,0, CALLBACK_NULL|WAVE_FORMAT_DIRECT); ok(rc==MMSYSERR_NOERROR || rc==WAVERR_BADFORMAT || - rc==MMSYSERR_INVALFLAG || rc==MMSYSERR_INVALPARAM, + rc==MMSYSERR_INVALFLAG || rc==MMSYSERR_INVALPARAM || + rc==MMSYSERR_ALLOCATED, "waveInOpen(%s): returned: %s\n",dev_name(device),wave_in_error(rc)); if (rc==MMSYSERR_NOERROR) { waveInClose(win); @@ -520,7 +523,8 @@ rc=waveInOpen(&win,device,&wfex.Format,0,0, CALLBACK_NULL|WAVE_FORMAT_DIRECT); ok(rc==MMSYSERR_NOERROR || rc==WAVERR_BADFORMAT || - rc==MMSYSERR_INVALFLAG || rc==MMSYSERR_INVALPARAM, + rc==MMSYSERR_INVALFLAG || rc==MMSYSERR_INVALPARAM || + rc==MMSYSERR_ALLOCATED, "waveInOpen(%s): returned: %s\n",dev_name(device),wave_in_error(rc)); if (rc==MMSYSERR_NOERROR) { waveInClose(win); @@ -544,7 +548,8 @@ rc=waveInOpen(&win,device,&wfex.Format,0,0, CALLBACK_NULL|WAVE_FORMAT_DIRECT); ok(rc==MMSYSERR_NOERROR || rc==WAVERR_BADFORMAT || - rc==MMSYSERR_INVALFLAG || rc==MMSYSERR_INVALPARAM, + rc==MMSYSERR_INVALFLAG || rc==MMSYSERR_INVALPARAM || + rc==MMSYSERR_ALLOCATED, "waveInOpen(%s): returned: %s\n",dev_name(device),wave_in_error(rc)); if (rc==MMSYSERR_NOERROR) { waveInClose(win); @@ -571,7 +576,8 @@ rc=waveInOpen(&win,device,&wfex.Format,0,0, CALLBACK_NULL|WAVE_FORMAT_DIRECT); ok(rc==MMSYSERR_NOERROR || rc==WAVERR_BADFORMAT || - rc==MMSYSERR_INVALFLAG || rc==MMSYSERR_INVALPARAM, + rc==MMSYSERR_INVALFLAG || rc==MMSYSERR_INVALPARAM || + rc==MMSYSERR_ALLOCATED, "waveInOpen(%s): returned: %s\n",dev_name(device),wave_in_error(rc)); if (rc==MMSYSERR_NOERROR) { waveInClose(win); @@ -596,7 +602,8 @@ rc=waveInOpen(&win,device,&wfex.Format,0,0, CALLBACK_NULL|WAVE_FORMAT_DIRECT); ok(rc==MMSYSERR_NOERROR || rc==WAVERR_BADFORMAT || - rc==MMSYSERR_INVALFLAG || rc==MMSYSERR_INVALPARAM, + rc==MMSYSERR_INVALFLAG || rc==MMSYSERR_INVALPARAM || + rc==MMSYSERR_ALLOCATED, "waveInOpen(%s): returned: %s\n",dev_name(device),wave_in_error(rc)); if (rc==MMSYSERR_NOERROR) { waveInClose(win); @@ -620,7 +627,8 @@ rc=waveInOpen(&win,device,&wfex.Format,0,0, CALLBACK_NULL|WAVE_FORMAT_DIRECT); ok(rc==MMSYSERR_NOERROR || rc==WAVERR_BADFORMAT || - rc==MMSYSERR_INVALFLAG || rc==MMSYSERR_INVALPARAM, + rc==MMSYSERR_INVALFLAG || rc==MMSYSERR_INVALPARAM || + rc==MMSYSERR_ALLOCATED, "waveInOpen(%s): returned: %s\n",dev_name(device),wave_in_error(rc)); if (rc==MMSYSERR_NOERROR) { waveInClose(win); diff -Nru wine1.7-1.7.14/dlls/wintab32/context.c wine1.7-1.7.18/dlls/wintab32/context.c --- wine1.7-1.7.14/dlls/wintab32/context.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/wintab32/context.c 2014-05-02 18:15:48.000000000 +0000 @@ -313,7 +313,7 @@ if (context->context.lcPktData & PK_CHANGED) ptr+=CopyTabletData(ptr,&wtp->pkChanged,sizeof(WTPKT)); if (context->context.lcPktData & PK_SERIAL_NUMBER) - ptr+=CopyTabletData(ptr,&wtp->pkChanged,sizeof(UINT)); + ptr+=CopyTabletData(ptr,&wtp->pkSerialNumber,sizeof(UINT)); if (context->context.lcPktData & PK_CURSOR) ptr+=CopyTabletData(ptr,&wtp->pkCursor,sizeof(UINT)); if (context->context.lcPktData & PK_BUTTONS) diff -Nru wine1.7-1.7.14/dlls/wldap32/tests/parse.c wine1.7-1.7.18/dlls/wldap32/tests/parse.c --- wine1.7-1.7.14/dlls/wldap32/tests/parse.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/wldap32/tests/parse.c 2014-05-02 18:15:48.000000000 +0000 @@ -48,7 +48,7 @@ timeout.tv_sec = 20; timeout.tv_usec = 0; ret = ldap_search_ext_sA( ld, (char *)"", LDAP_SCOPE_ONELEVEL, (char *)"(ou=*)", NULL, 0, ctrls, NULL, &timeout, 10, &res ); - if (ret == LDAP_SERVER_DOWN) + if (ret == LDAP_SERVER_DOWN || ret == LDAP_TIMEOUT) { skip("test server can't be reached\n"); ldap_control_freeA( sort ); diff -Nru wine1.7-1.7.14/dlls/wmiutils/path.c wine1.7-1.7.18/dlls/wmiutils/path.c --- wine1.7-1.7.14/dlls/wmiutils/path.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/wmiutils/path.c 2014-05-02 18:15:48.000000000 +0000 @@ -313,8 +313,11 @@ static void clear_path( struct path *path ) { + unsigned int i; + heap_free( path->text ); heap_free( path->server ); + for (i = 0; i < path->num_namespaces; i++) heap_free( path->namespaces[i] ); heap_free( path->namespaces ); heap_free( path->len_namespaces ); heap_free( path->class ); diff -Nru wine1.7-1.7.14/dlls/wmp/wmp.rgs wine1.7-1.7.18/dlls/wmp/wmp.rgs --- wine1.7-1.7.14/dlls/wmp/wmp.rgs 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/wmp/wmp.rgs 2014-05-02 18:15:48.000000000 +0000 @@ -18,3 +18,20 @@ Insertable } } + +HKLM +{ + NoRemove Software + { + NoRemove Microsoft + { + NoRemove Multimedia + { + WMPlayer + { + Extensions + } + } + } + } +} diff -Nru wine1.7-1.7.14/dlls/wmvcore/wmvcore_main.c wine1.7-1.7.18/dlls/wmvcore/wmvcore_main.c --- wine1.7-1.7.14/dlls/wmvcore/wmvcore_main.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/wmvcore/wmvcore_main.c 2014-05-02 18:15:48.000000000 +0000 @@ -20,13 +20,26 @@ #include +#define COBJMACROS + #include "windef.h" #include "winbase.h" +#include "initguid.h" #include "wmsdkidl.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(wmvcore); +static inline void *heap_alloc(size_t len) +{ + return HeapAlloc(GetProcessHeap(), 0, len); +} + +static inline BOOL heap_free(void *mem) +{ + return HeapFree(GetProcessHeap(), 0, mem); +} + BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { TRACE("(0x%p, %d, %p)\n", hinstDLL, fdwReason, lpvReserved); @@ -76,3 +89,126 @@ return E_NOTIMPL; } + +typedef struct { + IWMProfileManager IWMProfileManager_iface; + LONG ref; +} WMProfileManager; + +static inline WMProfileManager *impl_from_IWMProfileManager(IWMProfileManager *iface) +{ + return CONTAINING_RECORD(iface, WMProfileManager, IWMProfileManager_iface); +} + +static HRESULT WINAPI WMProfileManager_QueryInterface(IWMProfileManager *iface, REFIID riid, void **ppv) +{ + WMProfileManager *This = impl_from_IWMProfileManager(iface); + + if(IsEqualGUID(&IID_IUnknown, riid)) { + TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv); + *ppv = &This->IWMProfileManager_iface; + }else if(IsEqualGUID(&IID_IWMProfileManager, riid)) { + TRACE("(%p)->(IID_IWMProfileManager %p)\n", This, ppv); + *ppv = &This->IWMProfileManager_iface; + }else { + *ppv = NULL; + return E_NOINTERFACE; + } + + IUnknown_AddRef((IUnknown*)*ppv); + return S_OK; +} + +static ULONG WINAPI WMProfileManager_AddRef(IWMProfileManager *iface) +{ + WMProfileManager *This = impl_from_IWMProfileManager(iface); + LONG ref = InterlockedIncrement(&This->ref); + + TRACE("(%p) ref=%d\n", This, ref); + + return ref; +} + +static ULONG WINAPI WMProfileManager_Release(IWMProfileManager *iface) +{ + WMProfileManager *This = impl_from_IWMProfileManager(iface); + LONG ref = InterlockedDecrement(&This->ref); + + TRACE("(%p) ref=%d\n", This, ref); + + if(!ref) + heap_free(This); + + return ref; +} + +static HRESULT WINAPI WMProfileManager_CreateEmptyProfile(IWMProfileManager *iface, WMT_VERSION version, IWMProfile **ret) +{ + WMProfileManager *This = impl_from_IWMProfileManager(iface); + FIXME("(%p)->(%x %p)\n", This, version, ret); + return E_NOTIMPL; +} + +static HRESULT WINAPI WMProfileManager_LoadProfileByID(IWMProfileManager *iface, REFGUID guid, IWMProfile **ret) +{ + WMProfileManager *This = impl_from_IWMProfileManager(iface); + FIXME("(%p)->(%s %p)\n", This, debugstr_guid(guid), ret); + return E_NOTIMPL; +} + +static HRESULT WINAPI WMProfileManager_LoadProfileByData(IWMProfileManager *iface, const WCHAR *profile, IWMProfile **ret) +{ + WMProfileManager *This = impl_from_IWMProfileManager(iface); + FIXME("(%p)->(%s %p)\n", This, debugstr_w(profile), ret); + return E_NOTIMPL; +} + +static HRESULT WINAPI WMProfileManager_SaveProfile(IWMProfileManager *iface, IWMProfile *profile, WCHAR *profile_str, DWORD *len) +{ + WMProfileManager *This = impl_from_IWMProfileManager(iface); + FIXME("(%p)->(%p %p %p)\n", This, profile, profile_str, len); + return E_NOTIMPL; +} + +static HRESULT WINAPI WMProfileManager_GetSystemProfileCount(IWMProfileManager *iface, DWORD *ret) +{ + WMProfileManager *This = impl_from_IWMProfileManager(iface); + FIXME("(%p)->(%p)\n", This, ret); + return E_NOTIMPL; +} + +static HRESULT WINAPI WMProfileManager_LoadSystemProfile(IWMProfileManager *iface, DWORD index, IWMProfile **ret) +{ + WMProfileManager *This = impl_from_IWMProfileManager(iface); + FIXME("(%p)->(%d %p)\n", This, index, ret); + return E_NOTIMPL; +} + +static const IWMProfileManagerVtbl WMProfileManagerVtbl = { + WMProfileManager_QueryInterface, + WMProfileManager_AddRef, + WMProfileManager_Release, + WMProfileManager_CreateEmptyProfile, + WMProfileManager_LoadProfileByID, + WMProfileManager_LoadProfileByData, + WMProfileManager_SaveProfile, + WMProfileManager_GetSystemProfileCount, + WMProfileManager_LoadSystemProfile +}; + +HRESULT WINAPI WMCreateProfileManager(IWMProfileManager **ret) +{ + WMProfileManager *profile_mgr; + + TRACE("(%p)\n", ret); + + profile_mgr = heap_alloc(sizeof(*profile_mgr)); + if(!profile_mgr) + return E_OUTOFMEMORY; + + profile_mgr->IWMProfileManager_iface.lpVtbl = &WMProfileManagerVtbl; + profile_mgr->ref = 1; + + *ret = &profile_mgr->IWMProfileManager_iface; + return S_OK; +} diff -Nru wine1.7-1.7.14/dlls/wmvcore/wmvcore.spec wine1.7-1.7.18/dlls/wmvcore/wmvcore.spec --- wine1.7-1.7.14/dlls/wmvcore/wmvcore.spec 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/wmvcore/wmvcore.spec 2014-05-02 18:15:48.000000000 +0000 @@ -8,7 +8,7 @@ @ stub WMCreateBackupRestorer @ stdcall WMCreateEditor(ptr) @ stub WMCreateIndexer -@ stub WMCreateProfileManager +@ stdcall WMCreateProfileManager(ptr) @ stdcall WMCreateReader(ptr long ptr) @ stub WMCreateReaderPriv @ stdcall WMCreateSyncReader(ptr long ptr) diff -Nru wine1.7-1.7.14/dlls/ws2_32/socket.c wine1.7-1.7.18/dlls/ws2_32/socket.c --- wine1.7-1.7.14/dlls/ws2_32/socket.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/ws2_32/socket.c 2014-05-02 18:15:48.000000000 +0000 @@ -3337,12 +3337,13 @@ #endif #ifdef HAS_IRDA +#define MAX_IRDA_DEVICES 10 + case WS_SOL_IRLMP: switch(optname) { case WS_IRLMP_ENUMDEVICES: { - static const int MAX_IRDA_DEVICES = 10; char buf[sizeof(struct irda_device_list) + (MAX_IRDA_DEVICES - 1) * sizeof(struct irda_device_info)]; int res; @@ -3402,6 +3403,7 @@ return SOCKET_ERROR; } break; /* case WS_SOL_IRLMP */ +#undef MAX_IRDA_DEVICES #endif /* Levels WS_IPPROTO_TCP and WS_IPPROTO_IP convert directly */ @@ -3671,6 +3673,40 @@ (USHORT)(ioctl & 0xffff)); } +/* do an ioctl call through the server */ +static DWORD server_ioctl_sock( SOCKET s, DWORD code, LPVOID in_buff, DWORD in_size, + LPVOID out_buff, DWORD out_size, LPDWORD ret_size, + LPWSAOVERLAPPED overlapped, + LPWSAOVERLAPPED_COMPLETION_ROUTINE completion ) +{ + HANDLE event = overlapped ? overlapped->hEvent : 0; + HANDLE handle = SOCKET2HANDLE( s ); + struct ws2_async *wsa; + NTSTATUS status; + PIO_STATUS_BLOCK io; + + if (!(wsa = RtlAllocateHeap( GetProcessHeap(), 0, sizeof(*wsa) ))) + return WSA_NOT_ENOUGH_MEMORY; + wsa->hSocket = handle; + wsa->user_overlapped = overlapped; + wsa->completion_func = completion; + io = (overlapped ? (PIO_STATUS_BLOCK)overlapped : &wsa->local_iosb); + + status = NtDeviceIoControlFile( handle, event, (PIO_APC_ROUTINE)ws2_async_apc, wsa, io, code, + in_buff, in_size, out_buff, out_size ); + if (status == STATUS_NOT_SUPPORTED) + { + FIXME("Unsupported ioctl %x (device=%x access=%x func=%x method=%x)\n", + code, code >> 16, (code >> 14) & 3, (code >> 2) & 0xfff, code & 3); + } + else if (status == STATUS_SUCCESS) + *ret_size = io->Information; /* "Information" is the size written to the output buffer */ + + if (status != STATUS_PENDING) RtlFreeHeap( GetProcessHeap(), 0, wsa ); + + return NtStatusToWSAError( status ); +} + /********************************************************************** * WSAIoctl (WS2_32.50) * @@ -3863,12 +3899,6 @@ break; } - case WS_SIO_ADDRESS_LIST_CHANGE: - FIXME("-> SIO_ADDRESS_LIST_CHANGE request: stub\n"); - /* FIXME: error and return code depend on whether socket was created - * with WSA_FLAG_OVERLAPPED, but there is no easy way to get this */ - break; - case WS_SIO_ADDRESS_LIST_QUERY: { DWORD size; @@ -4104,11 +4134,29 @@ WSASetLastError(WSAEOPNOTSUPP); return SOCKET_ERROR; default: - FIXME("unsupported WS_IOCTL cmd (%s)\n", debugstr_wsaioctl(code)); status = WSAEOPNOTSUPP; break; } + if (status == WSAEOPNOTSUPP) + { + status = server_ioctl_sock(s, code, in_buff, in_size, out_buff, out_size, &total, + overlapped, completion); + if (status != WSAEOPNOTSUPP) + { + if (status == 0 || status == WSA_IO_PENDING) + TRACE("-> %s request\n", debugstr_wsaioctl(code)); + else + ERR("-> %s request failed with status 0x%x\n", debugstr_wsaioctl(code), status); + + /* overlapped and completion operations will be handled by the server */ + completion = NULL; + overlapped = NULL; + } + else + FIXME("unsupported WS_IOCTL cmd (%s)\n", debugstr_wsaioctl(code)); + } + if (completion) { FIXME( "completion routine %p not supported\n", completion ); @@ -5036,31 +5084,41 @@ { struct WS_hostent *retval = NULL; struct hostent* host; - + int unixtype = convert_af_w2u(type); + const char *paddr = addr; + unsigned long loopback; #ifdef HAVE_LINUX_GETHOSTBYNAME_R_6 char *extrabuf; - int ebufsize=1024; + int ebufsize = 1024; struct hostent hostentry; - int locerr=ENOBUFS; + int locerr = ENOBUFS; +#endif + + /* convert back the magic loopback address if necessary */ + if (unixtype == AF_INET && len == 4 && !memcmp(addr, magic_loopback_addr, 4)) + { + loopback = htonl(INADDR_LOOPBACK); + paddr = (char*) &loopback; + } + +#ifdef HAVE_LINUX_GETHOSTBYNAME_R_6 host = NULL; extrabuf=HeapAlloc(GetProcessHeap(),0,ebufsize) ; while(extrabuf) { - int res = gethostbyaddr_r(addr, len, type, + int res = gethostbyaddr_r(paddr, len, unixtype, &hostentry, extrabuf, ebufsize, &host, &locerr); - if( res != ERANGE) break; + if (res != ERANGE) break; ebufsize *=2; extrabuf=HeapReAlloc(GetProcessHeap(),0,extrabuf,ebufsize) ; } - if (!host) SetLastError((locerr < 0) ? wsaErrno() : wsaHerrno(locerr)); -#else - EnterCriticalSection( &csWSgetXXXbyYYY ); - host = gethostbyaddr(addr, len, type); - if (!host) SetLastError((h_errno < 0) ? wsaErrno() : wsaHerrno(h_errno)); -#endif - if( host != NULL ) retval = WS_dup_he(host); -#ifdef HAVE_LINUX_GETHOSTBYNAME_R_6 + if (host) retval = WS_dup_he(host); + else SetLastError((locerr < 0) ? wsaErrno() : wsaHerrno(locerr)); HeapFree(GetProcessHeap(),0,extrabuf); #else + EnterCriticalSection( &csWSgetXXXbyYYY ); + host = gethostbyaddr(paddr, len, unixtype); + if (host) retval = WS_dup_he(host); + else SetLastError((h_errno < 0) ? wsaErrno() : wsaHerrno(h_errno)); LeaveCriticalSection( &csWSgetXXXbyYYY ); #endif TRACE("ptr %p, len %d, type %d ret %p\n", addr, len, type, retval); @@ -6360,7 +6418,7 @@ p_to = WS_create_he(p_he->h_name, i + 1, alias_size, addresses + 1, p_he->h_length); if (!p_to) return NULL; - p_to->h_addrtype = p_he->h_addrtype; + p_to->h_addrtype = convert_af_u2w(p_he->h_addrtype); p_to->h_length = p_he->h_length; for(i = 0, p = p_to->h_addr_list[0]; p_he->h_addr_list[i]; i++, p += p_to->h_length) diff -Nru wine1.7-1.7.14/dlls/ws2_32/tests/sock.c wine1.7-1.7.18/dlls/ws2_32/tests/sock.c --- wine1.7-1.7.14/dlls/ws2_32/tests/sock.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/ws2_32/tests/sock.c 2014-05-02 18:15:48.000000000 +0000 @@ -5518,11 +5518,21 @@ result = (ADDRINFOW *)0xdeadbeef; ret = pGetAddrInfoW(NULL, NULL, NULL, &result); + if(ret == 0) + { + skip("nxdomain returned success. Broken ISP redirects?\n"); + return; + } ok(ret == WSAHOST_NOT_FOUND, "got %d expected WSAHOST_NOT_FOUND\n", ret); ok(result == NULL, "got %p\n", result); result = (ADDRINFOW *)0xdeadbeef; ret = pGetAddrInfoW(nxdomain, NULL, NULL, &result); + if(ret == 0) + { + skip("nxdomain returned success. Broken ISP redirects?\n"); + return; + } ok(ret == WSAHOST_NOT_FOUND, "got %d expected WSAHOST_NOT_FOUND\n", ret); ok(result == NULL, "got %p\n", result); @@ -5659,6 +5669,11 @@ result = (ADDRINFOA *)0xdeadbeef; ret = pgetaddrinfo("nxdomain.codeweavers.com", NULL, NULL, &result); + if(ret == 0) + { + skip("nxdomain returned success. Broken ISP redirects?\n"); + return; + } ok(ret == WSAHOST_NOT_FOUND, "got %d expected WSAHOST_NOT_FOUND\n", ret); ok(result == NULL, "got %p\n", result); diff -Nru wine1.7-1.7.14/dlls/wshom.ocx/shell.c wine1.7-1.7.18/dlls/wshom.ocx/shell.c --- wine1.7-1.7.14/dlls/wshom.ocx/shell.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/wshom.ocx/shell.c 2014-05-02 18:15:48.000000000 +0000 @@ -77,6 +77,12 @@ BSTR path_link; } WshShortcut; +typedef struct +{ + IWshEnvironment IWshEnvironment_iface; + LONG ref; +} WshEnvironment; + static inline WshCollection *impl_from_IWshCollection( IWshCollection *iface ) { return CONTAINING_RECORD(iface, WshCollection, IWshCollection_iface); @@ -87,6 +93,180 @@ return CONTAINING_RECORD(iface, WshShortcut, IWshShortcut_iface); } +static inline WshEnvironment *impl_from_IWshEnvironment( IWshEnvironment *iface ) +{ + return CONTAINING_RECORD(iface, WshEnvironment, IWshEnvironment_iface); +} + +static HRESULT WINAPI WshEnvironment_QueryInterface(IWshEnvironment *iface, REFIID riid, void **obj) +{ + WshEnvironment *This = impl_from_IWshEnvironment(iface); + + TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(riid), obj); + + if (IsEqualGUID(riid, &IID_IUnknown) || + IsEqualGUID(riid, &IID_IDispatch) || + IsEqualGUID(riid, &IID_IWshEnvironment)) + { + *obj = iface; + }else { + FIXME("Unknown iface %s\n", debugstr_guid(riid)); + *obj = NULL; + return E_NOINTERFACE; + } + + IUnknown_AddRef((IUnknown*)*obj); + return S_OK; +} + +static ULONG WINAPI WshEnvironment_AddRef(IWshEnvironment *iface) +{ + WshEnvironment *This = impl_from_IWshEnvironment(iface); + LONG ref = InterlockedIncrement(&This->ref); + TRACE("(%p) ref = %d\n", This, ref); + return ref; +} + +static ULONG WINAPI WshEnvironment_Release(IWshEnvironment *iface) +{ + WshEnvironment *This = impl_from_IWshEnvironment(iface); + LONG ref = InterlockedDecrement(&This->ref); + TRACE("(%p) ref = %d\n", This, ref); + + if (!ref) + HeapFree(GetProcessHeap(), 0, This); + + return ref; +} + +static HRESULT WINAPI WshEnvironment_GetTypeInfoCount(IWshEnvironment *iface, UINT *pctinfo) +{ + WshEnvironment *This = impl_from_IWshEnvironment(iface); + TRACE("(%p)->(%p)\n", This, pctinfo); + *pctinfo = 1; + return S_OK; +} + +static HRESULT WINAPI WshEnvironment_GetTypeInfo(IWshEnvironment *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) +{ + WshEnvironment *This = impl_from_IWshEnvironment(iface); + TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo); + return get_typeinfo(IWshEnvironment_tid, ppTInfo); +} + +static HRESULT WINAPI WshEnvironment_GetIDsOfNames(IWshEnvironment *iface, REFIID riid, LPOLESTR *rgszNames, + UINT cNames, LCID lcid, DISPID *rgDispId) +{ + WshEnvironment *This = impl_from_IWshEnvironment(iface); + ITypeInfo *typeinfo; + HRESULT hr; + + TRACE("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId); + + hr = get_typeinfo(IWshEnvironment_tid, &typeinfo); + if(SUCCEEDED(hr)) + { + hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId); + ITypeInfo_Release(typeinfo); + } + + return hr; +} + +static HRESULT WINAPI WshEnvironment_Invoke(IWshEnvironment *iface, DISPID dispIdMember, REFIID riid, LCID lcid, + WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) +{ + WshEnvironment *This = impl_from_IWshEnvironment(iface); + ITypeInfo *typeinfo; + HRESULT hr; + + TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid), + lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); + + hr = get_typeinfo(IWshEnvironment_tid, &typeinfo); + if(SUCCEEDED(hr)) + { + hr = ITypeInfo_Invoke(typeinfo, &This->IWshEnvironment_iface, dispIdMember, wFlags, + pDispParams, pVarResult, pExcepInfo, puArgErr); + ITypeInfo_Release(typeinfo); + } + + return hr; +} + +static HRESULT WINAPI WshEnvironment_get_Item(IWshEnvironment *iface, BSTR name, BSTR *value) +{ + WshEnvironment *This = impl_from_IWshEnvironment(iface); + FIXME("(%p)->(%s %p): stub\n", This, debugstr_w(name), value); + return E_NOTIMPL; +} + +static HRESULT WINAPI WshEnvironment_put_Item(IWshEnvironment *iface, BSTR name, BSTR value) +{ + WshEnvironment *This = impl_from_IWshEnvironment(iface); + FIXME("(%p)->(%s %s): stub\n", This, debugstr_w(name), debugstr_w(value)); + return E_NOTIMPL; +} + +static HRESULT WINAPI WshEnvironment_Count(IWshEnvironment *iface, LONG *count) +{ + WshEnvironment *This = impl_from_IWshEnvironment(iface); + FIXME("(%p)->(%p): stub\n", This, count); + return E_NOTIMPL; +} + +static HRESULT WINAPI WshEnvironment_get_length(IWshEnvironment *iface, LONG *len) +{ + WshEnvironment *This = impl_from_IWshEnvironment(iface); + FIXME("(%p)->(%p): stub\n", This, len); + return E_NOTIMPL; +} + +static HRESULT WINAPI WshEnvironment__NewEnum(IWshEnvironment *iface, IUnknown **penum) +{ + WshEnvironment *This = impl_from_IWshEnvironment(iface); + FIXME("(%p)->(%p): stub\n", This, penum); + return E_NOTIMPL; +} + +static HRESULT WINAPI WshEnvironment_Remove(IWshEnvironment *iface, BSTR name) +{ + WshEnvironment *This = impl_from_IWshEnvironment(iface); + FIXME("(%p)->(%s): stub\n", This, debugstr_w(name)); + return E_NOTIMPL; +} + +static const IWshEnvironmentVtbl WshEnvironmentVtbl = { + WshEnvironment_QueryInterface, + WshEnvironment_AddRef, + WshEnvironment_Release, + WshEnvironment_GetTypeInfoCount, + WshEnvironment_GetTypeInfo, + WshEnvironment_GetIDsOfNames, + WshEnvironment_Invoke, + WshEnvironment_get_Item, + WshEnvironment_put_Item, + WshEnvironment_Count, + WshEnvironment_get_length, + WshEnvironment__NewEnum, + WshEnvironment_Remove +}; + +static HRESULT WshEnvironment_Create(IWshEnvironment **env) +{ + WshEnvironment *This; + + This = HeapAlloc(GetProcessHeap(), 0, sizeof(*This)); + if (!This) return E_OUTOFMEMORY; + + This->IWshEnvironment_iface.lpVtbl = &WshEnvironmentVtbl; + This->ref = 1; + + *env = &This->IWshEnvironment_iface; + + return S_OK; +} + static HRESULT WINAPI WshCollection_QueryInterface(IWshCollection *iface, REFIID riid, void **ppv) { WshCollection *This = impl_from_IWshCollection(iface); @@ -744,10 +924,10 @@ return WshCollection_Create(folders); } -static HRESULT WINAPI WshShell3_get_Environment(IWshShell3 *iface, VARIANT *Type, IWshEnvironment **out_Env) +static HRESULT WINAPI WshShell3_get_Environment(IWshShell3 *iface, VARIANT *type, IWshEnvironment **env) { - FIXME("(%p %p): stub\n", Type, out_Env); - return E_NOTIMPL; + FIXME("(%s %p): semi-stub\n", debugstr_variant(type), env); + return WshEnvironment_Create(env); } static HRESULT WINAPI WshShell3_Run(IWshShell3 *iface, BSTR cmd, VARIANT *style, VARIANT *WaitOnReturn, int *exit_code) diff -Nru wine1.7-1.7.14/dlls/wshom.ocx/tests/wshom.idl wine1.7-1.7.18/dlls/wshom.ocx/tests/wshom.idl --- wine1.7-1.7.14/dlls/wshom.ocx/tests/wshom.idl 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/wshom.ocx/tests/wshom.idl 2014-05-02 18:15:48.000000000 +0000 @@ -105,7 +105,7 @@ HRESULT Write([in] BSTR Text); [id(0x2718)] - HRESULT WriteLine([in, optional, defaultvalue("")] BSTR Text); + HRESULT WriteLine([in, defaultvalue("")] BSTR Text); [id(0x2719)] HRESULT WriteBlankLines([in] long Lines); @@ -221,20 +221,20 @@ HRESULT Type([out, retval] BSTR* Type); [id(0x04b0)] - HRESULT Delete([in, optional, defaultvalue(0)] VARIANT_BOOL Force); + HRESULT Delete([in, defaultvalue(0)] VARIANT_BOOL Force); [id(0x04b2)] HRESULT Copy( [in] BSTR Destination, - [in, optional, defaultvalue(-1)] VARIANT_BOOL OverWriteFiles); + [in, defaultvalue(-1)] VARIANT_BOOL OverWriteFiles); [id(0x04b4)] HRESULT Move([in] BSTR Destination); [id(0x044c)] HRESULT OpenAsTextStream( - [in, optional, defaultvalue(1)] IOMode IOMode, - [in, optional, defaultvalue(0)] Tristate Format, + [in, defaultvalue(1)] IOMode IOMode, + [in, defaultvalue(0)] Tristate Format, [out, retval] ITextStream** ppts); }; @@ -306,12 +306,12 @@ HRESULT Type([out, retval] BSTR* type); [id(0x04b1)] - HRESULT Delete([in, optional, defaultvalue(0)] VARIANT_BOOL force); + HRESULT Delete([in, defaultvalue(0)] VARIANT_BOOL force); [id(0x04b3)] HRESULT Copy( [in] BSTR Destination, - [in, optional, defaultvalue(-1)] VARIANT_BOOL OverWriteFiles); + [in, defaultvalue(-1)] VARIANT_BOOL OverWriteFiles); [id(0x04b5)] HRESULT Move([in] BSTR Destination); @@ -331,8 +331,8 @@ [id(0x044d)] HRESULT CreateTextFile( [in] BSTR FileName, - [in, optional, defaultvalue(-1)] VARIANT_BOOL Overwrite, - [in, optional, defaultvalue(0)] VARIANT_BOOL Unicode, + [in, defaultvalue(-1)] VARIANT_BOOL Overwrite, + [in, defaultvalue(0)] VARIANT_BOOL Unicode, [out, retval] ITextStream** ppts); }; @@ -399,7 +399,7 @@ [id(DISPID_VALUE), propput] HRESULT Item( [in] BSTR Name, - [in] BSTR out_Value); + [in] BSTR Value); [id(1)] HRESULT Count([out, retval] long *out_Count); @@ -408,7 +408,7 @@ HRESULT length([out, retval] long *out_Count); [id(DISPID_NEWENUM)] - HRESULT _NewEnum([out, retval] IUnknown *out_Enum); + HRESULT _NewEnum([out, retval] IUnknown **out_Enum); [id(0x03e9)] HRESULT Remove([in] BSTR Name); @@ -573,7 +573,7 @@ HRESULT LogEvent( [in] VARIANT* Type, [in] BSTR Message, - [in, optional, defaultvalue("")] BSTR Target, + [in, defaultvalue("")] BSTR Target, [out, retval] VARIANT_BOOL* out_Success); [id(0x0bc2)] diff -Nru wine1.7-1.7.14/dlls/wshom.ocx/wshom.idl wine1.7-1.7.18/dlls/wshom.ocx/wshom.idl --- wine1.7-1.7.14/dlls/wshom.ocx/wshom.idl 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/wshom.ocx/wshom.idl 2014-05-02 18:15:48.000000000 +0000 @@ -107,7 +107,7 @@ HRESULT Write([in] BSTR Text); [id(0x2718)] - HRESULT WriteLine([in, optional, defaultvalue("")] BSTR Text); + HRESULT WriteLine([in, defaultvalue("")] BSTR Text); [id(0x2719)] HRESULT WriteBlankLines([in] long Lines); @@ -223,20 +223,20 @@ HRESULT Type([out, retval] BSTR* Type); [id(0x04b0)] - HRESULT Delete([in, optional, defaultvalue(0)] VARIANT_BOOL Force); + HRESULT Delete([in, defaultvalue(0)] VARIANT_BOOL Force); [id(0x04b2)] HRESULT Copy( [in] BSTR Destination, - [in, optional, defaultvalue(-1)] VARIANT_BOOL OverWriteFiles); + [in, defaultvalue(-1)] VARIANT_BOOL OverWriteFiles); [id(0x04b4)] HRESULT Move([in] BSTR Destination); [id(0x044c)] HRESULT OpenAsTextStream( - [in, optional, defaultvalue(1)] IOMode IOMode, - [in, optional, defaultvalue(0)] Tristate Format, + [in, defaultvalue(1)] IOMode IOMode, + [in, defaultvalue(0)] Tristate Format, [out, retval] ITextStream** ppts); }; @@ -308,12 +308,12 @@ HRESULT Type([out, retval] BSTR* type); [id(0x04b1)] - HRESULT Delete([in, optional, defaultvalue(0)] VARIANT_BOOL force); + HRESULT Delete([in, defaultvalue(0)] VARIANT_BOOL force); [id(0x04b3)] HRESULT Copy( [in] BSTR Destination, - [in, optional, defaultvalue(-1)] VARIANT_BOOL OverWriteFiles); + [in, defaultvalue(-1)] VARIANT_BOOL OverWriteFiles); [id(0x04b5)] HRESULT Move([in] BSTR Destination); @@ -333,8 +333,8 @@ [id(0x044d)] HRESULT CreateTextFile( [in] BSTR FileName, - [in, optional, defaultvalue(-1)] VARIANT_BOOL Overwrite, - [in, optional, defaultvalue(0)] VARIANT_BOOL Unicode, + [in, defaultvalue(-1)] VARIANT_BOOL Overwrite, + [in, defaultvalue(0)] VARIANT_BOOL Unicode, [out, retval] ITextStream** ppts); }; @@ -401,7 +401,7 @@ [id(DISPID_VALUE), propput] HRESULT Item( [in] BSTR Name, - [in] BSTR out_Value); + [in] BSTR Value); [id(1)] HRESULT Count([out, retval] long *out_Count); @@ -410,7 +410,7 @@ HRESULT length([out, retval] long *out_Count); [id(DISPID_NEWENUM)] - HRESULT _NewEnum([out, retval] IUnknown *out_Enum); + HRESULT _NewEnum([out, retval] IUnknown **out_Enum); [id(0x03e9)] HRESULT Remove([in] BSTR Name); @@ -575,7 +575,7 @@ HRESULT LogEvent( [in] VARIANT* Type, [in] BSTR Message, - [in, optional, defaultvalue("")] BSTR Target, + [in, defaultvalue("")] BSTR Target, [out, retval] VARIANT_BOOL* out_Success); [id(0x0bc2)] diff -Nru wine1.7-1.7.14/dlls/wshom.ocx/wshom_main.c wine1.7-1.7.18/dlls/wshom.ocx/wshom_main.c --- wine1.7-1.7.14/dlls/wshom.ocx/wshom_main.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/wshom.ocx/wshom_main.c 2014-05-02 18:15:48.000000000 +0000 @@ -33,8 +33,9 @@ static REFIID tid_ids[] = { &IID_NULL, - &IID_IWshShell3, &IID_IWshCollection, + &IID_IWshEnvironment, + &IID_IWshShell3, &IID_IWshShortcut }; diff -Nru wine1.7-1.7.14/dlls/wshom.ocx/wshom_private.h wine1.7-1.7.18/dlls/wshom.ocx/wshom_private.h --- wine1.7-1.7.14/dlls/wshom.ocx/wshom_private.h 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/wshom.ocx/wshom_private.h 2014-05-02 18:15:48.000000000 +0000 @@ -27,8 +27,9 @@ /* typelibs */ typedef enum tid_t { NULL_tid, - IWshShell3_tid, IWshCollection_tid, + IWshEnvironment_tid, + IWshShell3_tid, IWshShortcut_tid, LAST_tid } tid_t; diff -Nru wine1.7-1.7.14/dlls/wtsapi32/tests/wtsapi.c wine1.7-1.7.18/dlls/wtsapi32/tests/wtsapi.c --- wine1.7-1.7.14/dlls/wtsapi32/tests/wtsapi.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/wtsapi32/tests/wtsapi.c 2014-05-02 18:15:48.000000000 +0000 @@ -45,43 +45,33 @@ info = NULL; SetLastError(0xdeadbeef); ret = WTSEnumerateProcessesW(WTS_CURRENT_SERVER_HANDLE, 1, 1, &info, &count); - todo_wine ok(!ret, "expected WTSEnumerateProcessesW to fail\n"); - todo_wine ok(GetLastError()== ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER got: %d\n", GetLastError()); if (info) WTSFreeMemory(info); info = NULL; SetLastError(0xdeadbeef); ret = WTSEnumerateProcessesW(WTS_CURRENT_SERVER_HANDLE, 0, 0, &info, &count); - todo_wine ok(!ret, "expected WTSEnumerateProcessesW to fail\n"); - todo_wine ok(GetLastError()== ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER got: %d\n", GetLastError()); if (info) WTSFreeMemory(info); info = NULL; SetLastError(0xdeadbeef); ret = WTSEnumerateProcessesW(WTS_CURRENT_SERVER_HANDLE, 0, 2, &info, &count); - todo_wine ok(!ret, "expected WTSEnumerateProcessesW to fail\n"); - todo_wine ok(GetLastError()== ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER got: %d\n", GetLastError()); if (info) WTSFreeMemory(info); - info = NULL; SetLastError(0xdeadbeef); ret = WTSEnumerateProcessesW(WTS_CURRENT_SERVER_HANDLE, 0, 1, NULL, &count); ok(!ret, "expected WTSEnumerateProcessesW to fail\n"); - todo_wine ok(GetLastError()== ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER got: %d\n", GetLastError()); - if (info) WTSFreeMemory(info); info = NULL; SetLastError(0xdeadbeef); ret = WTSEnumerateProcessesW(WTS_CURRENT_SERVER_HANDLE, 0, 1, &info, NULL); ok(!ret, "expected WTSEnumerateProcessesW to fail\n"); - todo_wine ok(GetLastError()== ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER got: %d\n", GetLastError()); if (info) WTSFreeMemory(info); diff -Nru wine1.7-1.7.14/dlls/wtsapi32/wtsapi32.c wine1.7-1.7.18/dlls/wtsapi32/wtsapi32.c --- wine1.7-1.7.14/dlls/wtsapi32/wtsapi32.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/wtsapi32/wtsapi32.c 2014-05-02 18:15:48.000000000 +0000 @@ -87,7 +87,11 @@ FIXME("Stub %p 0x%08x 0x%08x %p %p\n", hServer, Reserved, Version, ppProcessInfo, pCount); - if (!ppProcessInfo || !pCount) return FALSE; + if (!ppProcessInfo || !pCount || Reserved != 0 || Version != 1) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } *pCount = 0; *ppProcessInfo = NULL; diff -Nru wine1.7-1.7.14/dlls/xmllite/reader.c wine1.7-1.7.18/dlls/xmllite/reader.c --- wine1.7-1.7.14/dlls/xmllite/reader.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/xmllite/reader.c 2014-05-02 18:15:48.000000000 +0000 @@ -40,13 +40,6 @@ typedef enum { - XmlEncoding_UTF16, - XmlEncoding_UTF8, - XmlEncoding_Unknown -} xml_encoding; - -typedef enum -{ XmlReadInState_Initial, XmlReadInState_XmlDecl, XmlReadInState_Misc_DTD, @@ -265,14 +258,6 @@ return CONTAINING_RECORD(iface, xmlreaderinput, IXmlReaderInput_iface); } -static inline void *m_alloc(IMalloc *imalloc, size_t len) -{ - if (imalloc) - return IMalloc_Alloc(imalloc, len); - else - return heap_alloc(len); -} - static inline void *m_realloc(IMalloc *imalloc, void *mem, size_t len) { if (imalloc) @@ -281,14 +266,6 @@ return heap_realloc(mem, len); } -static inline void m_free(IMalloc *imalloc, void *mem) -{ - if (imalloc) - IMalloc_Free(imalloc, mem); - else - heap_free(mem); -} - /* reader memory allocation functions */ static inline void *reader_alloc(xmlreader *reader, size_t len) { @@ -590,7 +567,7 @@ return S_OK; } -static xml_encoding parse_encoding_name(const WCHAR *name, int len) +xml_encoding parse_encoding_name(const WCHAR *name, int len) { int min, max, n, c; diff -Nru wine1.7-1.7.14/dlls/xmllite/tests/writer.c wine1.7-1.7.18/dlls/xmllite/tests/writer.c --- wine1.7-1.7.14/dlls/xmllite/tests/writer.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/xmllite/tests/writer.c 2014-05-02 18:15:48.000000000 +0000 @@ -28,7 +28,44 @@ #include "xmllite.h" #include "wine/test.h" +#include "initguid.h" +DEFINE_GUID(IID_IXmlWriterOutput, 0xc1131708, 0x0f59, 0x477f, 0x93, 0x59, 0x7d, 0x33, 0x24, 0x51, 0xbc, 0x1a); + static HRESULT (WINAPI *pCreateXmlWriter)(REFIID riid, void **ppvObject, IMalloc *pMalloc); +static HRESULT (WINAPI *pCreateXmlWriterOutputWithEncodingName)(IUnknown *stream, + IMalloc *imalloc, + LPCWSTR encoding_name, + IXmlWriterOutput **output); + +static HRESULT WINAPI testoutput_QueryInterface(IUnknown *iface, REFIID riid, void **obj) +{ + if (IsEqualGUID(riid, &IID_IUnknown)) { + *obj = iface; + return S_OK; + } + else { + ok(0, "unknown riid=%s\n", wine_dbgstr_guid(riid)); + return E_NOINTERFACE; + } +} + +static ULONG WINAPI testoutput_AddRef(IUnknown *iface) +{ + return 2; +} + +static ULONG WINAPI testoutput_Release(IUnknown *iface) +{ + return 1; +} + +static const IUnknownVtbl testoutputvtbl = { + testoutput_QueryInterface, + testoutput_AddRef, + testoutput_Release +}; + +static IUnknown testoutput = { &testoutputvtbl }; static void test_writer_create(void) { @@ -44,10 +81,7 @@ hr = pCreateXmlWriter(&IID_IXmlWriter, (LPVOID*)&writer, NULL); ok(hr == S_OK, "Expected S_OK, got %08x\n", hr); - if(hr == S_OK) - { - IXmlWriter_Release(writer); - } + IXmlWriter_Release(writer); } static BOOL init_pointers(void) @@ -63,15 +97,34 @@ #define MAKEFUNC(f) if (!(p##f = (void*)GetProcAddress(mod, #f))) return FALSE; MAKEFUNC(CreateXmlWriter); + MAKEFUNC(CreateXmlWriterOutputWithEncodingName); #undef MAKEFUNC return TRUE; } +static void test_writeroutput(void) +{ + static const WCHAR utf16W[] = {'u','t','f','-','1','6',0}; + IXmlWriterOutput *output; + IUnknown *unk; + HRESULT hr; + + hr = pCreateXmlWriterOutputWithEncodingName(&testoutput, NULL, utf16W, &output); + ok(hr == S_OK, "got %08x\n", hr); + unk = NULL; + hr = IUnknown_QueryInterface(output, &IID_IXmlWriterOutput, (void**)&unk); + ok(hr == S_OK, "got %08x\n", hr); + ok(unk != NULL, "got %p\n", unk); + /* releasing 'unk' crashes on native */ + IUnknown_Release(output); +} + START_TEST(writer) { if (!init_pointers()) return; test_writer_create(); + test_writeroutput(); } diff -Nru wine1.7-1.7.14/dlls/xmllite/writer.c wine1.7-1.7.18/dlls/xmllite/writer.c --- wine1.7-1.7.14/dlls/xmllite/writer.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/xmllite/writer.c 2014-05-02 18:15:48.000000000 +0000 @@ -24,11 +24,25 @@ #include "winbase.h" #include "objbase.h" #include "xmllite.h" +#include "xmllite_private.h" +#include "initguid.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(xmllite); +/* not defined in public headers */ +DEFINE_GUID(IID_IXmlWriterOutput, 0xc1131708, 0x0f59, 0x477f, 0x93, 0x59, 0x7d, 0x33, 0x24, 0x51, 0xbc, 0x1a); + +typedef struct +{ + IXmlWriterOutput IXmlWriterOutput_iface; + LONG ref; + IUnknown *output; + IMalloc *imalloc; + xml_encoding encoding; +} xmlwriteroutput; + typedef struct _xmlwriter { IXmlWriter IXmlWriter_iface; @@ -40,6 +54,22 @@ return CONTAINING_RECORD(iface, xmlwriter, IXmlWriter_iface); } +static inline xmlwriteroutput *impl_from_IXmlWriterOutput(IXmlWriterOutput *iface) +{ + return CONTAINING_RECORD(iface, xmlwriteroutput, IXmlWriterOutput_iface); +} + +/* reader input memory allocation functions */ +static inline void *writeroutput_alloc(xmlwriteroutput *output, size_t len) +{ + return m_alloc(output->imalloc, len); +} + +static inline void writeroutput_free(xmlwriteroutput *output, void *mem) +{ + m_free(output->imalloc, mem); +} + static HRESULT WINAPI xmlwriter_QueryInterface(IXmlWriter *iface, REFIID riid, void **ppvObject) { xmlwriter *This = impl_from_IXmlWriter(iface); @@ -73,9 +103,7 @@ ref = InterlockedDecrement(&This->ref); if (ref == 0) - { - HeapFree(GetProcessHeap(), 0, This); - } + heap_free(This); return ref; } @@ -385,6 +413,63 @@ xmlwriter_Flush }; +/** IXmlWriterOutput **/ +static HRESULT WINAPI xmlwriteroutput_QueryInterface(IXmlWriterOutput *iface, REFIID riid, void** ppvObject) +{ + xmlwriteroutput *This = impl_from_IXmlWriterOutput(iface); + + TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppvObject); + + if (IsEqualGUID(riid, &IID_IXmlWriterOutput) || + IsEqualGUID(riid, &IID_IUnknown)) + { + *ppvObject = iface; + } + else + { + WARN("interface %s not implemented\n", debugstr_guid(riid)); + *ppvObject = NULL; + return E_NOINTERFACE; + } + + IUnknown_AddRef(iface); + + return S_OK; +} + +static ULONG WINAPI xmlwriteroutput_AddRef(IXmlWriterOutput *iface) +{ + xmlwriteroutput *This = impl_from_IXmlWriterOutput(iface); + ULONG ref = InterlockedIncrement(&This->ref); + TRACE("(%p)->(%d)\n", This, ref); + return ref; +} + +static ULONG WINAPI xmlwriteroutput_Release(IXmlWriterOutput *iface) +{ + xmlwriteroutput *This = impl_from_IXmlWriterOutput(iface); + LONG ref = InterlockedDecrement(&This->ref); + + TRACE("(%p)->(%d)\n", This, ref); + + if (ref == 0) + { + IMalloc *imalloc = This->imalloc; + if (This->output) IUnknown_Release(This->output); + writeroutput_free(This, This); + if (imalloc) IMalloc_Release(imalloc); + } + + return ref; +} + +static const struct IUnknownVtbl xmlwriteroutputvtbl = +{ + xmlwriteroutput_QueryInterface, + xmlwriteroutput_AddRef, + xmlwriteroutput_Release +}; + HRESULT WINAPI CreateXmlWriter(REFIID riid, void **pObject, IMalloc *pMalloc) { xmlwriter *writer; @@ -399,7 +484,7 @@ return E_FAIL; } - writer = HeapAlloc(GetProcessHeap(), 0, sizeof (*writer)); + writer = heap_alloc(sizeof(*writer)); if(!writer) return E_OUTOFMEMORY; writer->IXmlWriter_iface.lpVtbl = &xmlwriter_vtbl; @@ -411,3 +496,35 @@ return S_OK; } + +HRESULT WINAPI CreateXmlWriterOutputWithEncodingName(IUnknown *stream, + IMalloc *imalloc, + LPCWSTR encoding, + IXmlWriterOutput **output) +{ + xmlwriteroutput *writeroutput; + + TRACE("%p %p %s %p\n", stream, imalloc, debugstr_w(encoding), output); + + if (!stream || !output) return E_INVALIDARG; + + if (imalloc) + writeroutput = IMalloc_Alloc(imalloc, sizeof(*writeroutput)); + else + writeroutput = heap_alloc(sizeof(*writeroutput)); + if(!writeroutput) return E_OUTOFMEMORY; + + writeroutput->IXmlWriterOutput_iface.lpVtbl = &xmlwriteroutputvtbl; + writeroutput->ref = 1; + writeroutput->imalloc = imalloc; + if (imalloc) IMalloc_AddRef(imalloc); + writeroutput->encoding = parse_encoding_name(encoding, -1); + + IUnknown_QueryInterface(stream, &IID_IUnknown, (void**)&writeroutput->output); + + *output = &writeroutput->IXmlWriterOutput_iface; + + TRACE("returning iface %p\n", *output); + + return S_OK; +} diff -Nru wine1.7-1.7.14/dlls/xmllite/xmllite_private.h wine1.7-1.7.18/dlls/xmllite/xmllite_private.h --- wine1.7-1.7.14/dlls/xmllite/xmllite_private.h 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/xmllite/xmllite_private.h 2014-05-02 18:15:48.000000000 +0000 @@ -37,4 +37,29 @@ return HeapFree(GetProcessHeap(), 0, mem); } +static inline void *m_alloc(IMalloc *imalloc, size_t len) +{ + if (imalloc) + return IMalloc_Alloc(imalloc, len); + else + return heap_alloc(len); +} + +static inline void m_free(IMalloc *imalloc, void *mem) +{ + if (imalloc) + IMalloc_Free(imalloc, mem); + else + heap_free(mem); +} + +typedef enum +{ + XmlEncoding_UTF16, + XmlEncoding_UTF8, + XmlEncoding_Unknown +} xml_encoding; + +xml_encoding parse_encoding_name(const WCHAR *name, int len) DECLSPEC_HIDDEN; + #endif /* __XMLLITE_PRIVATE__ */ diff -Nru wine1.7-1.7.14/dlls/xmllite/xmllite.spec wine1.7-1.7.18/dlls/xmllite/xmllite.spec --- wine1.7-1.7.14/dlls/xmllite/xmllite.spec 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/dlls/xmllite/xmllite.spec 2014-05-02 18:15:48.000000000 +0000 @@ -3,4 +3,4 @@ @ stdcall CreateXmlReaderInputWithEncodingName(ptr ptr ptr long ptr ptr) @ stdcall CreateXmlWriter(ptr ptr ptr) @ stub CreateXmlWriterOutputWithEncodingCodePage -@ stub CreateXmlWriterOutputWithEncodingName +@ stdcall CreateXmlWriterOutputWithEncodingName(ptr ptr wstr ptr) diff -Nru wine1.7-1.7.14/documentation/README.de wine1.7-1.7.18/documentation/README.de --- wine1.7-1.7.14/documentation/README.de 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/documentation/README.de 2014-05-02 18:15:48.000000000 +0000 @@ -32,7 +32,7 @@ folgenden Betriebssysteme: Linux version 2.0.36 oder neuer - FreeBSD 7.0 oder neuer + FreeBSD 8.0 oder neuer Solaris x86 9 oder neuer NetBSD-current Mac OS X 10.5 oder neuer @@ -43,7 +43,7 @@ Umständen in der Zukunft unterstützt. FreeBSD-Info: - Wine läuft prinzipiell erst ab FreeBSD 7.0 richtig. Siehe dazu auch + Wine läuft prinzipiell erst ab FreeBSD 8.0 richtig. Siehe dazu auch http://wiki.freebsd.org/Wine für weitere Informationen. Solaris-Info: diff -Nru wine1.7-1.7.14/documentation/README.es wine1.7-1.7.18/documentation/README.es --- wine1.7-1.7.14/documentation/README.es 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/documentation/README.es 2014-05-02 18:15:48.000000000 +0000 @@ -30,7 +30,7 @@ Para compilar y ejecutar Wine, deberá tener uno de los siguientes: Linux versión 2.0.36 o superior - FreeBSD 7.0 o superior + FreeBSD 8.0 o superior Solaris x86 9 o superior NetBSD-current Mac OS X 10.5 o superior @@ -42,7 +42,7 @@ Información sobre FreeBSD: Por lo general Wine no funcionará correctamente en versiones anteriores a - FreeBSD 7.0. Visite http://wiki.freebsd.org/Wine para más información. + FreeBSD 8.0. Visite http://wiki.freebsd.org/Wine para más información. Información sobre Solaris: Lo más probable es que necesite compilar con el conjunto de herramientas GNU diff -Nru wine1.7-1.7.14/documentation/README.fi wine1.7-1.7.18/documentation/README.fi --- wine1.7-1.7.14/documentation/README.fi 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/documentation/README.fi 2014-05-02 18:15:48.000000000 +0000 @@ -28,7 +28,7 @@ Winen kääntämiseen tarvitaan jokin seuraavista: Linuxin versio 2.0.36 tai uudempi - FreeBSD 7.0 tai uudempi + FreeBSD 8.0 tai uudempi Solaris x86 9 tai uudempi NetBSD-current Mac OS X 10.5 tai uudempi @@ -38,7 +38,7 @@ muillekin käyttöjärjestelmille, joissa on tarvittava tuki säikeille. Tietoa FreeBSD:lle: - Pääsääntöisesti Wine ei toimi vanhemmilla versioilla kuin FreeBSD 7.0. + Pääsääntöisesti Wine ei toimi vanhemmilla versioilla kuin FreeBSD 8.0. Osoitteessa http://wiki.freebsd.org/Wine kerrotaan tästä lisää. Tietoa Solarikselle: diff -Nru wine1.7-1.7.14/documentation/README.fr wine1.7-1.7.18/documentation/README.fr --- wine1.7-1.7.14/documentation/README.fr 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/documentation/README.fr 2014-05-02 18:15:48.000000000 +0000 @@ -30,7 +30,7 @@ d'exploitation suivants : Linux version 2.0.36 ou ultérieur - FreeBSD 7.0 ou ultérieur + FreeBSD 8.0 ou ultérieur Solaris x86 9 ou ultérieur NetBSD-current Mac OS X 10.5 ou ultérieur @@ -42,7 +42,7 @@ Informations FreeBSD : Wine ne fonctionnera généralement pas bien avec les versions FreeBSD - antérieures à 7.0. Voyez http://wiki.freebsd.org/Wine pour plus + antérieures à 8.0. Voyez http://wiki.freebsd.org/Wine pour plus d'informations. Informations Solaris : diff -Nru wine1.7-1.7.14/documentation/README.it wine1.7-1.7.18/documentation/README.it --- wine1.7-1.7.14/documentation/README.it 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/documentation/README.it 2014-05-02 18:15:48.000000000 +0000 @@ -31,7 +31,7 @@ Per compilare ed eseguire Wine, è necessario avere uno dei seguenti sistemi: Linux versione 2.0.36 o successiva - FreeBSD 7.0 o successiva + FreeBSD 8.0 o successiva Solaris x86 9 o successiva NetBSD-current Mac OS X 10.5 o successiva @@ -42,7 +42,7 @@ Informazioni per FreeBSD: In generale Wine non funzionerà correttamente con versioni precedenti - a FreeBSD 7.0. + a FreeBSD 8.0. Leggere http://wiki.freebsd.org/Wine per maggiori informazioni. Informazioni per Solaris: diff -Nru wine1.7-1.7.14/documentation/README.ja wine1.7-1.7.18/documentation/README.ja --- wine1.7-1.7.14/documentation/README.ja 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/documentation/README.ja 2014-05-02 18:15:48.000000000 +0000 @@ -30,7 +30,7 @@ Wineをコンパイルし実行するには、以下のうち一つを持っていなければなりません: Linux バージョン2.0.36以上 - FreeBSD 7.0以降 + FreeBSD 8.0以降 Solaris x86 9以降 NetBSD-current Mac OS X 10.5以降 @@ -41,7 +41,7 @@ 将来サポートされるかもしれません。 FreeBSD情報: - Wineは一般的にFreeBSD 7.0より前のバージョン上で正しく動作しないでしょう。 + Wineは一般的にFreeBSD 8.0より前のバージョン上で正しく動作しないでしょう。 詳細については http://wiki.freebsd.org/Wine を参照してください。 Solaris情報: diff -Nru wine1.7-1.7.14/documentation/README.no wine1.7-1.7.18/documentation/README.no --- wine1.7-1.7.14/documentation/README.no 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/documentation/README.no 2014-05-02 18:15:48.000000000 +0000 @@ -29,7 +29,7 @@ Følgende kreves for å bygge og kjøre Wine: Linux versjon 2.0.36 eller nyere - FreeBSD 7.0 eller nyere + FreeBSD 8.0 eller nyere Solaris x86 9 eller nyere NetBSD-current Mac OS X 10.5 eller nyere @@ -39,7 +39,7 @@ støtter kjernetråder støttes kanskje i framtiden. Informasjon for FreeBSD: - Wine vil som regel ikke virke på FreeBSD-versjoner eldre enn 7.0. + Wine vil som regel ikke virke på FreeBSD-versjoner eldre enn 8.0. Se for mer informasjon. Informsjon for Solaris: diff -Nru wine1.7-1.7.14/documentation/README.pt_br wine1.7-1.7.18/documentation/README.pt_br --- wine1.7-1.7.14/documentation/README.pt_br 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/documentation/README.pt_br 2014-05-02 18:15:48.000000000 +0000 @@ -31,7 +31,7 @@ Para compilar e executar o Wine, voc deve ter o seguinte: Linux verso 2.0.36 ou posterior - FreeBSD 7.0 ou posterior + FreeBSD 8.0 ou posterior Solaris x86 9 ou posterior NetBSD-atual Mac OS X 10.5 ou posterior @@ -42,7 +42,7 @@ ter suporte no futuro. Informaes para o FreeBSD: - O Wine em geral no deve funcionar corretamente em verses antes da 7.0. + O Wine em geral no deve funcionar corretamente em verses antes da 8.0. Veja http://wiki.freebsd.org/Wine para mais informaes. Informaes para o Solaris: diff -Nru wine1.7-1.7.14/documentation/README.ru wine1.7-1.7.18/documentation/README.ru --- wine1.7-1.7.14/documentation/README.ru 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/documentation/README.ru 2014-05-02 18:15:48.000000000 +0000 @@ -29,7 +29,7 @@ Компиляция и запуск Wine поддерживается в следующих операционных системах: Linux версии 2.0.36 или более новой - FreeBSD 7.0 или более новой + FreeBSD 8.0 или более новой Solaris x86 9 или более новой NetBSD-текущей версии Mac OS X 10.5 или более новой @@ -40,7 +40,7 @@ возможно будут поддерживаться Wine в будущем. FreeBSD: - Wine не будет работать как следует на версиях ниже, чем FreeBSD 7.0. + Wine не будет работать как следует на версиях ниже, чем FreeBSD 8.0. Посетите для дополнительной информации. Solaris: diff -Nru wine1.7-1.7.14/documentation/README.sv wine1.7-1.7.18/documentation/README.sv --- wine1.7-1.7.14/documentation/README.sv 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/documentation/README.sv 2014-05-02 18:15:48.000000000 +0000 @@ -28,7 +28,7 @@ Fr att kompilera och kra Wine krvs ett av fljande: Linux version 2.0.36 eller senare - FreeBSD 7.0 eller senare + FreeBSD 8.0 eller senare Solaris x86 9 eller senare NetBSD-current Mac OS X 10.5 eller senare @@ -38,7 +38,7 @@ stder kerneltrdar kommer eventuellt att stdjas i framtiden. Information fr FreeBSD: - Wine kommer i regel inte att fungera p FreeBSD-versioner ldre n 7.0. + Wine kommer i regel inte att fungera p FreeBSD-versioner ldre n 8.0. Se http://wiki.freebsd.org/Wine fr mer information. Information fr Solaris: diff -Nru wine1.7-1.7.14/fonts/tahomabd.sfd wine1.7-1.7.18/fonts/tahomabd.sfd --- wine1.7-1.7.14/fonts/tahomabd.sfd 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/fonts/tahomabd.sfd 2014-05-02 18:15:48.000000000 +0000 @@ -102,6 +102,7 @@ !<)rC!;6Els31Q VStem: 361 308 LayerCount: 2 @@ -19527,8 +19529,63 @@ Refer: 970 806 S 1 0 0 1 -146.5 13 2 Refer: 85 116 N 1 0 0 1 0 0 3 EndChar + +StartChar: afii10101 +Encoding: 1108 1108 975 +Width: 1088 +Flags: W +HStem: -22 156<379.84 750.074> +LayerCount: 2 +Fore +SplineSet +734.45 688 m 17 + 246.609 688.039 l 1 + 258.777 769.045 285.982 836.366 328.226 890 c 0 + 369.559 951.333 453.559 982 580.226 982 c 0 + 684.893 982 789.893 953.333 895.226 896 c 1 + 895.226 1053 l 1 + 795.893 1099 692.893 1127.67 586.226 1139 c 1 + 418.226 1127 290.559 1081.33 203.226 1002 c 0 + 97.8926 902.667 45.2256 763 45.2256 583 c 0 + 29.8926 393 69.2256 245.667 163.226 141 c 0 + 241.226 32.333 367.559 -22 542.226 -22 c 0 + 662.893 -22 774.559 2 877.226 50 c 1 + 868.226 255 l 1 + 771.559 174.333 669.559 134 562.226 134 c 0 + 436.226 134 350.559 174.667 305.226 256 c 1 + 251.998 323.661 228.885 418.995 235.885 542 c 1 + 734.45 542 l 1 + 734.45 688 l 17 +EndSplineSet +EndChar + +StartChar: afii10053 +Encoding: 1028 1028 976 +Width: 1367 +Flags: W +HStem: 729.5 175.5<257.219 961> 1151 21G<1065.79 1173> +VStem: 43 205.5<450.026 729.5 905 1041.58> +LayerCount: 2 +Fore +SplineSet +257.219 905 m 1 + 961 905 l 1 + 961 729 l 1 + 248.5 729.5 l 0 + 248.5 275.006 486.995 167.646 688 144 c 0 + 826.667 128 988.33 192.333 1173 337 c 1 + 1173 101 l 1 + 780.549 -139.979 189.12 -67.8848 67 502 c 0 + 51 576.667 43 657 43 743 c 0 + 43 1215.54 271.645 1486.98 690 1516 c 0 + 876.797 1528.44 1006.01 1474.75 1173 1390 c 1 + 1173 1151 l 1 + 958.577 1330.82 779.285 1356.53 688 1346 c 0 + 435.849 1314.62 292.256 1167.62 257.219 905 c 1 +EndSplineSet +EndChar EndChars -BitmapFont: 9 976 7 2 1 +BitmapFont: 9 978 7 2 1 BDFChar: 0 65536 9 1 7 0 6 rdo`RJqEt% BDFChar: 1 32 3 0 0 0 0 @@ -20401,12 +20458,16 @@ ^jlCb BDFChar: 974 539 4 0 1 -3 -2 ^jlCb +BDFChar: 975 1108 5 0 4 0 4 +GeigaGQ7^D +BDFChar: 976 1028 7 0 5 0 6 +Gg*tu^s%$' BDFRefChar: 971 52 0 0 N BDFRefChar: 972 84 0 0 N BDFRefChar: 973 53 0 0 N BDFRefChar: 974 85 0 0 N EndBitmapFont -BitmapFont: 10 976 8 2 1 +BitmapFont: 10 978 8 2 1 BDFChar: 0 65536 10 1 8 0 7 s+,`PJUrCP BDFChar: 1 32 3 0 0 0 0 @@ -21279,12 +21340,16 @@ ^jlCb BDFChar: 974 539 4 0 1 -3 -2 ^jlCb +BDFChar: 975 1108 6 0 4 0 4 +GeigaGQ7^D +BDFChar: 976 1028 7 0 5 0 6 +Gg*tu^s%$' BDFRefChar: 971 52 0 0 N BDFRefChar: 972 84 0 0 N BDFRefChar: 973 53 0 0 N BDFRefChar: 974 85 0 0 N EndBitmapFont -BitmapFont: 11 976 9 2 1 FontForge +BitmapFont: 11 978 9 2 1 FontForge BDFStartProperties: 36 FONT 1 "-FontForge-Tahoma-Normal-R-Normal--11-80-96-96-P-62-ISO10646-1" FONTBOUNDINGBOX 1 "15 11 0 -2" @@ -22192,12 +22257,16 @@ @))aB BDFChar: 974 539 5 0 2 -3 -2 @))aB +BDFChar: 975 1108 6 0 4 0 5 +Geiga^j#hZ +BDFChar: 976 1028 7 0 5 0 7 +I)*Pm^qda5 BDFRefChar: 971 52 0 0 N BDFRefChar: 972 84 0 0 N BDFRefChar: 973 53 0 0 N BDFRefChar: 974 85 0 0 N EndBitmapFont -BitmapFont: 12 976 10 2 1 FontForge +BitmapFont: 12 978 10 2 1 FontForge BDFStartProperties: 36 FONT 1 "-FontForge-Tahoma-Normal-R-Normal--12-90-96-96-P-70-ISO10646-1" FONTBOUNDINGBOX 1 "16 12 0 -2" @@ -22907,12 +22976,16 @@ @))aB BDFChar: 974 539 6 1 3 -3 -2 @))aB +BDFChar: 975 1108 6 0 5 0 6 +Gf7De^r1Ht +BDFChar: 976 1028 8 0 6 0 8 +I)<\7pqX\^HiO-H BDFRefChar: 971 52 0 0 N BDFRefChar: 972 84 0 0 N BDFRefChar: 973 53 0 0 N BDFRefChar: 974 85 0 0 N EndBitmapFont -BitmapFont: 13 976 10 3 1 FontForge +BitmapFont: 13 978 10 3 1 FontForge BDFStartProperties: 36 FONT 1 "-FontForge-Tahoma-Normal-R-Normal--13-100-96-96-P-73-ISO10646-1" FONTBOUNDINGBOX 1 "15 13 0 -3" @@ -23618,12 +23691,16 @@ @))aB BDFChar: 974 539 4 0 2 -3 -2 @))aB +BDFChar: 975 1108 7 0 5 0 6 +Gf7Dm^r1Ht +BDFChar: 976 1028 9 0 7 0 8 +5%27Br4p*V4obQ_ BDFRefChar: 971 52 0 0 N BDFRefChar: 972 84 0 0 N BDFRefChar: 973 53 0 0 N BDFRefChar: 974 85 0 0 N EndBitmapFont -BitmapFont: 15 976 12 3 1 FontForge +BitmapFont: 15 978 12 3 1 FontForge BDFStartProperties: 36 FONT 1 "-FontForge-Tahoma-Normal-R-Normal--15-110-96-96-P-85-ISO10646-1" FONTBOUNDINGBOX 1 "19 15 0 -3" @@ -24329,12 +24406,16 @@ @))aB BDFChar: 974 539 5 1 3 -3 -2 @))aB +BDFChar: 975 1108 8 0 5 0 7 +3(/;dJ:L$I +BDFChar: 976 1028 10 0 7 0 10 +5!a^LJGaqJJ3c@! BDFRefChar: 971 52 0 0 N BDFRefChar: 972 84 0 0 N BDFRefChar: 973 53 0 0 N BDFRefChar: 974 85 0 0 N EndBitmapFont -BitmapFont: 16 976 13 3 1 FontForge +BitmapFont: 16 978 13 3 1 FontForge BDFStartProperties: 36 FONT 1 "-FontForge-Tahoma-Normal-R-Normal--16-120-96-96-P-93-ISO10646-1" FONTBOUNDINGBOX 1 "21 16 0 -3" @@ -25040,6 +25121,10 @@ @))aB BDFChar: 974 539 5 1 3 -3 -2 @))aB +BDFChar: 975 1108 8 0 5 0 8 +3(/:Ipjdl_2uipY +BDFChar: 976 1028 11 0 8 0 11 +*rmF65QH<7J,oQKJ,k*"J,hh7+FkO6 BDFRefChar: 971 52 0 0 N BDFRefChar: 972 84 0 0 N BDFRefChar: 973 53 0 0 N Binary files /tmp/3nsIA_MmjG/wine1.7-1.7.14/fonts/tahomabd.ttf and /tmp/wgLXlygwsm/wine1.7-1.7.18/fonts/tahomabd.ttf differ diff -Nru wine1.7-1.7.14/fonts/tahoma.sfd wine1.7-1.7.18/fonts/tahoma.sfd --- wine1.7-1.7.14/fonts/tahoma.sfd 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/fonts/tahoma.sfd 2014-05-02 18:15:48.000000000 +0000 @@ -102,6 +102,7 @@ !<)rC!;6Els31Q +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + + +DEFINE_GUID(CLSID_DirectPlayVoiceClient, 0xb9f3eb85, 0xb781, 0x4ac1, 0x8d, 0x90, 0x93, 0xa0, 0x5e, 0xe3, 0x7d, 0x7d); +DEFINE_GUID(CLSID_DirectPlayVoiceServer, 0xd3f5b8e6, 0x9b78, 0x4a4c, 0x94, 0xea, 0xca, 0x23, 0x97, 0xb6, 0x63, 0xd3); +DEFINE_GUID(CLSID_DirectPlayVoiceTest, 0x0f0f094b, 0xb01c, 0x4091, 0xa1, 0x4d, 0xdd, 0x0c, 0xd8, 0x07, 0x71, 0x1a); + +DEFINE_GUID(IID_IDirectPlayVoiceClient, 0x1dfdc8ea, 0xbcf7, 0x41d6, 0xb2, 0x95, 0xab, 0x64, 0xb3, 0xb2, 0x33, 0x06); +DEFINE_GUID(IID_IDirectPlayVoiceServer, 0xfaa1c173, 0x0468, 0x43b6, 0x8a, 0x2a, 0xea, 0x8a, 0x4f, 0x20, 0x76, 0xc9); +DEFINE_GUID(IID_IDirectPlayVoiceTest, 0xd26af734, 0x208b, 0x41da, 0x82, 0x24, 0xe0, 0xce, 0x79, 0x81, 0x0b, 0xe1); + +DEFINE_GUID(DPVCTGUID_ADPCM, 0x699b52c1, 0xa885, 0x46a8, 0xa3, 0x08, 0x97, 0x17, 0x24, 0x19, 0xad, 0xc7); +DEFINE_GUID(DPVCTGUID_GSM, 0x24768c60, 0x5a0d, 0x11d3, 0x9b, 0xe4, 0x52, 0x54, 0x00, 0xd9, 0x85, 0xe7); +DEFINE_GUID(DPVCTGUID_NONE, 0x8de12fd4, 0x7cb3, 0x48ce, 0xa7, 0xe8, 0x9c, 0x47, 0xa2, 0x2e, 0x8a, 0xc5); +DEFINE_GUID(DPVCTGUID_SC03, 0x7d82a29b, 0x2242, 0x4f82, 0x8f, 0x39, 0x5d, 0x11, 0x53, 0xdf, 0x3e, 0x41); +DEFINE_GUID(DPVCTGUID_SC06, 0x53def900, 0x7168, 0x4633, 0xb4, 0x7f, 0xd1, 0x43, 0x91, 0x6a, 0x13, 0xc7); +DEFINE_GUID(DPVCTGUID_TRUESPEECH, 0xd7954361, 0x5a0b, 0x11d3, 0x9b, 0xe4, 0x52, 0x54, 0x00, 0xd9, 0x85, 0xe7); +DEFINE_GUID(DPVCTGUID_VR12, 0xfe44a9fe, 0x8ed4, 0x48bf, 0x9d, 0x66, 0x1b, 0x1a, 0xdf, 0xf9, 0xff, 0x6d); + +#define DPVCTGUID_DEFAULT DPVCTGUID_SC03 + +typedef struct IDirectPlayVoiceClient *LPDIRECTPLAYVOICECLIENT, *PDIRECTPLAYVOICECLIENT; +typedef struct IDirectPlayVoiceServer *LPDIRECTPLAYVOICESERVER, *PDIRECTPLAYVOICESERVER; +typedef struct IDirectPlayVoiceTest *LPDIRECTPLAYVOICETEST, *PDIRECTPLAYVOICETEST; + + +typedef HRESULT (PASCAL *PDVMESSAGEHANDLER)(PVOID pvUserContext, DWORD dwMessageType, LPVOID lpMessage); +typedef PDVMESSAGEHANDLER LPDVMESSAGEHANDLER; + +typedef DWORD DVID, *LPDVID, *PDVID; + +#define DVMSGID_MINBASE DVMSGID_CREATEVOICEPLAYER +#define DVMSGID_CREATEVOICEPLAYER 0x0001 +#define DVMSGID_DELETEVOICEPLAYER 0x0002 +#define DVMSGID_SESSIONLOST 0x0003 +#define DVMSGID_PLAYERVOICESTART 0x0004 +#define DVMSGID_PLAYERVOICESTOP 0x0005 +#define DVMSGID_RECORDSTART 0x0006 +#define DVMSGID_RECORDSTOP 0x0007 +#define DVMSGID_CONNECTRESULT 0x0008 +#define DVMSGID_DISCONNECTRESULT 0x0009 +#define DVMSGID_INPUTLEVEL 0x000A +#define DVMSGID_OUTPUTLEVEL 0x000B +#define DVMSGID_HOSTMIGRATED 0x000C +#define DVMSGID_SETTARGETS 0x000D +#define DVMSGID_PLAYEROUTPUTLEVEL 0x000E +#define DVMSGID_LOSTFOCUS 0x0010 +#define DVMSGID_GAINFOCUS 0x0011 +#define DVMSGID_LOCALHOSTSETUP 0x0012 +#define DVMSGID_MAXBASE DVMSGID_LOCALHOSTSETUP + +#define DVBUFFERAGGRESSIVENESS_MIN 0x00000001 +#define DVBUFFERAGGRESSIVENESS_MAX 0x00000064 +#define DVBUFFERAGGRESSIVENESS_DEFAULT 0x00000000 + +#define DVBUFFERQUALITY_MIN 0x00000001 +#define DVBUFFERQUALITY_MAX 0x00000064 +#define DVBUFFERQUALITY_DEFAULT 0x00000000 + +#define DVID_SERVERPLAYER 1 +#define DVID_ALLPLAYERS 0 +#define DVID_REMAINING 0xFFFFFFFF + +#define DVINPUTLEVEL_MIN 0x00000000 +#define DVINPUTLEVEL_MAX 0x00000063 + +#define DVNOTIFYPERIOD_MINPERIOD 20 + +#define DVPLAYBACKVOLUME_DEFAULT DSBVOLUME_MAX + +#define DVRECORDVOLUME_LAST 0x00000001 + + +#define DVTHRESHOLD_DEFAULT 0xFFFFFFFF +#define DVTHRESHOLD_MIN 0x00000000 +#define DVTHRESHOLD_MAX 0x00000063 +#define DVTHRESHOLD_UNUSED 0xFFFFFFFE + + +#define DVSESSIONTYPE_PEER 0x00000001 +#define DVSESSIONTYPE_MIXING 0x00000002 +#define DVSESSIONTYPE_FORWARDING 0x00000003 +#define DVSESSIONTYPE_ECHO 0x00000004 + +#define DVCLIENTCONFIG_RECORDMUTE 0x00000001 +#define DVCLIENTCONFIG_PLAYBACKMUTE 0x00000002 +#define DVCLIENTCONFIG_MANUALVOICEACTIVATED 0x00000004 +#define DVCLIENTCONFIG_AUTORECORDVOLUME 0x00000008 +#define DVCLIENTCONFIG_MUTEGLOBAL 0x00000010 +#define DVCLIENTCONFIG_AUTOVOICEACTIVATED 0x00000020 +#define DVCLIENTCONFIG_ECHOSUPPRESSION 0x08000000 + +#define DVFLAGS_SYNC 0x00000001 +#define DVFLAGS_QUERYONLY 0x00000002 +#define DVFLAGS_NOHOSTMIGRATE 0x00000008 +#define DVFLAGS_ALLOWBACK 0x00000010 + +#define DVSESSION_NOHOSTMIGRATION 0x00000001 +#define DVSESSION_SERVERCONTROLTARGET 0x00000002 + +#define DVSOUNDCONFIG_NORMALMODE 0x00000001 +#define DVSOUNDCONFIG_AUTOSELECT 0x00000002 +#define DVSOUNDCONFIG_HALFDUPLEX 0x00000004 +#define DVSOUNDCONFIG_NORECVOLAVAILABLE 0x00000010 +#define DVSOUNDCONFIG_NOFOCUS 0x20000000 + +#define DVSOUNDCONFIG_SETCONVERSIONQUALITY 0x00000008 +#define DVSOUNDCONFIG_STRICTFOCUS 0x40000000 +#define DVPLAYERCAPS_HALFDUPLEX 0x00000001 +#define DVPLAYERCAPS_LOCAL 0x00000002 + +typedef struct +{ + DWORD dwSize; + DWORD dwFlags; +} DVCAPS, *LPDVCAPS, *PDVCAPS; + +typedef struct +{ + DWORD dwSize; + DWORD dwFlags; + LONG lRecordVolume; + LONG lPlaybackVolume; + DWORD dwThreshold; + DWORD dwBufferQuality; + DWORD dwBufferAggressiveness; + DWORD dwNotifyPeriod; +} DVCLIENTCONFIG, *LPDVCLIENTCONFIG, *PDVCLIENTCONFIG; + +typedef struct +{ + DWORD dwSize; + GUID guidType; + LPWSTR lpszName; + LPWSTR lpszDescription; + DWORD dwFlags; + DWORD dwMaxBitsPerSecond; +} DVCOMPRESSIONINFO, *LPDVCOMPRESSIONINFO, *PDVCOMPRESSIONINFO; + +typedef struct +{ + DWORD dwSize; + DWORD dwFlags; + DWORD dwSessionType; + GUID guidCT; + DWORD dwBufferQuality; + DWORD dwBufferAggressiveness; +} DVSESSIONDESC, *LPDVSESSIONDESC, *PDVSESSIONDESC; + +typedef struct +{ + DWORD dwSize; + DWORD dwFlags; + GUID guidPlaybackDevice; + LPDIRECTSOUND lpdsPlaybackDevice; + GUID guidCaptureDevice; + LPDIRECTSOUNDCAPTURE lpdsCaptureDevice; + HWND hwndAppWindow; + LPDIRECTSOUNDBUFFER lpdsMainBuffer; + DWORD dwMainBufferFlags; + DWORD dwMainBufferPriority; +} DVSOUNDDEVICECONFIG, *LPDVSOUNDDEVICECONFIG, *PDVSOUNDDEVICECONFIG; + +typedef struct +{ + DWORD dwSize; + HRESULT hrResult; +} DVMSG_CONNECTRESULT, *LPDVMSG_CONNECTRESULT, *PDVMSG_CONNECTRESULT; + +typedef struct +{ + DWORD dwSize; + DVID dvidPlayer; + DWORD dwFlags; + PVOID pvPlayerContext; +} DVMSG_CREATEVOICEPLAYER, *LPDVMSG_CREATEVOICEPLAYER, *PDVMSG_CREATEVOICEPLAYER; + +typedef struct +{ + DWORD dwSize; + DVID dvidPlayer; + PVOID pvPlayerContext; +} DVMSG_DELETEVOICEPLAYER, *LPDVMSG_DELETEVOICEPLAYER, *PDVMSG_DELETEVOICEPLAYER; + +typedef struct +{ + DWORD dwSize; + HRESULT hrResult; +} DVMSG_DISCONNECTRESULT, *LPDVMSG_DISCONNECTRESULT, *PDVMSG_DISCONNECTRESULT; + +typedef struct +{ + DWORD dwSize; + DVID dvidNewHostID; + LPDIRECTPLAYVOICESERVER pdvServerInterface; +} DVMSG_HOSTMIGRATED, *LPDVMSG_HOSTMIGRATED, *PDVMSG_HOSTMIGRATED; + +typedef struct +{ + DWORD dwSize; + DWORD dwPeakLevel; + LONG lRecordVolume; + PVOID pvLocalPlayerContext; +} DVMSG_INPUTLEVEL, *LPDVMSG_INPUTLEVEL, *PDVMSG_INPUTLEVEL; + +typedef struct +{ + DWORD dwSize; + PVOID pvContext; + PDVMESSAGEHANDLER pMessageHandler; +} DVMSG_LOCALHOSTSETUP, *LPDVMSG_LOCALHOSTSETUP, *PDVMSG_LOCALHOSTSETUP; + +typedef struct +{ + DWORD dwSize; + DWORD dwPeakLevel; + LONG lOutputVolume; + PVOID pvLocalPlayerContext; +} DVMSG_OUTPUTLEVEL, *LPDVMSG_OUTPUTLEVEL, *PDVMSG_OUTPUTLEVEL; + +typedef struct +{ + DWORD dwSize; + DVID dvidSourcePlayerID; + DWORD dwPeakLevel; + PVOID pvPlayerContext; +} DVMSG_PLAYEROUTPUTLEVEL, *LPDVMSG_PLAYEROUTPUTLEVEL, *PDVMSG_PLAYEROUTPUTLEVEL; + +typedef struct +{ + DWORD dwSize; + DVID dvidSourcePlayerID; + PVOID pvPlayerContext; +} DVMSG_PLAYERVOICESTART, *LPDVMSG_PLAYERVOICESTART, *PDVMSG_PLAYERVOICESTART; + +typedef struct +{ + DWORD dwSize; + DVID dvidSourcePlayerID; + PVOID pvPlayerContext; +} DVMSG_PLAYERVOICESTOP, *LPDVMSG_PLAYERVOICESTOP, *PDVMSG_PLAYERVOICESTOP; + +typedef struct +{ + DWORD dwSize; + DWORD dwPeakLevel; + PVOID pvLocalPlayerContext; +} DVMSG_RECORDSTART, *LPDVMSG_RECORDSTART, *PDVMSG_RECORDSTART; + +typedef struct +{ + DWORD dwSize; + DWORD dwPeakLevel; + PVOID pvLocalPlayerContext; +} DVMSG_RECORDSTOP, *LPDVMSG_RECORDSTOP, *PDVMSG_RECORDSTOP; + +typedef struct +{ + DWORD dwSize; + HRESULT hrResult; +} DVMSG_SESSIONLOST, *LPDVMSG_SESSIONLOST, *PDVMSG_SESSIONLOST; + +typedef struct +{ + DWORD dwSize; + DWORD dwNumTargets; + PDVID pdvidTargets; +} DVMSG_SETTARGETS, *LPDVMSG_SETTARGETS, *PDVMSG_SETTARGETS; + + +#define _FACDPV 0x15 +#define MAKE_DVHRESULT( code ) MAKE_HRESULT( 1, _FACDPV, code ) + +#define DV_OK S_OK +#define DV_FULLDUPLEX MAKE_HRESULT(0, _FACDPV, 0x0005) +#define DV_HALFDUPLEX MAKE_HRESULT(0, _FACDPV, 0x000A) +#define DV_PENDING MAKE_HRESULT(0, _FACDPV, 0x0010) + +#define DVERR_BUFFERTOOSMALL MAKE_DVHRESULT(0x001E) +#define DVERR_EXCEPTION MAKE_DVHRESULT(0x004A) +#define DVERR_GENERIC E_FAIL +#define DVERR_INVALIDFLAGS MAKE_DVHRESULT(0x0078) +#define DVERR_INVALIDOBJECT MAKE_DVHRESULT(0x0082) +#define DVERR_INVALIDPARAM E_INVALIDARG +#define DVERR_INVALIDPLAYER MAKE_DVHRESULT(0x0087) +#define DVERR_INVALIDGROUP MAKE_DVHRESULT(0x0091) +#define DVERR_INVALIDHANDLE MAKE_DVHRESULT(0x0096) +#define DVERR_OUTOFMEMORY E_OUTOFMEMORY +#define DVERR_PENDING DV_PENDING +#define DVERR_NOTSUPPORTED E_NOTIMPL +#define DVERR_NOINTERFACE E_NOINTERFACE +#define DVERR_SESSIONLOST MAKE_DVHRESULT(0x012C) +#define DVERR_NOVOICESESSION MAKE_DVHRESULT(0x012E) +#define DVERR_CONNECTIONLOST MAKE_DVHRESULT(0x0168) +#define DVERR_NOTINITIALIZED MAKE_DVHRESULT(0x0169) +#define DVERR_CONNECTED MAKE_DVHRESULT(0x016A) +#define DVERR_NOTCONNECTED MAKE_DVHRESULT(0x016B) +#define DVERR_CONNECTABORTING MAKE_DVHRESULT(0x016E) +#define DVERR_NOTALLOWED MAKE_DVHRESULT(0x016F) +#define DVERR_INVALIDTARGET MAKE_DVHRESULT(0x0170) +#define DVERR_TRANSPORTNOTHOST MAKE_DVHRESULT(0x0171) +#define DVERR_COMPRESSIONNOTSUPPORTED MAKE_DVHRESULT(0x0172) +#define DVERR_ALREADYPENDING MAKE_DVHRESULT(0x0173) +#define DVERR_SOUNDINITFAILURE MAKE_DVHRESULT(0x0174) +#define DVERR_TIMEOUT MAKE_DVHRESULT(0x0175) +#define DVERR_CONNECTABORTED MAKE_DVHRESULT(0x0176) +#define DVERR_NO3DSOUND MAKE_DVHRESULT(0x0177) +#define DVERR_ALREADYBUFFERED MAKE_DVHRESULT(0x0178) +#define DVERR_NOTBUFFERED MAKE_DVHRESULT(0x0179) +#define DVERR_HOSTING MAKE_DVHRESULT(0x017A) +#define DVERR_NOTHOSTING MAKE_DVHRESULT(0x017B) +#define DVERR_INVALIDDEVICE MAKE_DVHRESULT(0x017C) +#define DVERR_RECORDSYSTEMERROR MAKE_DVHRESULT(0x017D) +#define DVERR_PLAYBACKSYSTEMERROR MAKE_DVHRESULT(0x017E) +#define DVERR_SENDERROR MAKE_DVHRESULT(0x017F) +#define DVERR_USERCANCEL MAKE_DVHRESULT(0x0180) +#define DVERR_RUNSETUP MAKE_DVHRESULT(0x0183) +#define DVERR_INCOMPATIBLEVERSION MAKE_DVHRESULT(0x0184) +#define DVERR_INITIALIZED MAKE_DVHRESULT(0x0187) +#define DVERR_INVALIDPOINTER E_POINTER +#define DVERR_NOTRANSPORT MAKE_DVHRESULT(0x0188) +#define DVERR_NOCALLBACK MAKE_DVHRESULT(0x0189) +#define DVERR_TRANSPORTNOTINIT MAKE_DVHRESULT(0x018A) +#define DVERR_TRANSPORTNOSESSION MAKE_DVHRESULT(0x018B) +#define DVERR_TRANSPORTNOPLAYER MAKE_DVHRESULT(0x018C) +#define DVERR_USERBACK MAKE_DVHRESULT(0x018D) +#define DVERR_NORECVOLAVAILABLE MAKE_DVHRESULT(0x018E) +#define DVERR_INVALIDBUFFER MAKE_DVHRESULT(0x018F) +#define DVERR_LOCKEDBUFFER MAKE_DVHRESULT(0x0190) + +#undef INTERFACE +#define INTERFACE IDirectPlayVoiceClient +DECLARE_INTERFACE_(IDirectPlayVoiceClient, IUnknown) +{ + STDMETHOD(QueryInterface) (THIS_ REFIID riid, PVOID *ppvObj) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + STDMETHOD(Initialize) (THIS_ LPUNKNOWN, PDVMESSAGEHANDLER, PVOID, PDWORD, DWORD) PURE; + STDMETHOD(Connect) (THIS_ PDVSOUNDDEVICECONFIG, PDVCLIENTCONFIG, DWORD) PURE; + STDMETHOD(Disconnect) (THIS_ DWORD) PURE; + STDMETHOD(GetSessionDesc) (THIS_ PDVSESSIONDESC) PURE; + STDMETHOD(GetClientConfig) (THIS_ PDVCLIENTCONFIG) PURE; + STDMETHOD(SetClientConfig) (THIS_ PDVCLIENTCONFIG) PURE; + STDMETHOD(GetCaps) (THIS_ PDVCAPS) PURE; + STDMETHOD(GetCompressionTypes) (THIS_ PVOID, PDWORD, PDWORD, DWORD) PURE; + STDMETHOD(SetTransmitTargets) (THIS_ PDVID, DWORD, DWORD) PURE; + STDMETHOD(GetTransmitTargets) (THIS_ PDVID, PDWORD, DWORD) PURE; + STDMETHOD(Create3DSoundBuffer) (THIS_ DVID, LPDIRECTSOUNDBUFFER, DWORD, DWORD, LPDIRECTSOUND3DBUFFER *) PURE; + STDMETHOD(Delete3DSoundBuffer) (THIS_ DVID, LPDIRECTSOUND3DBUFFER *) PURE; + STDMETHOD(SetNotifyMask) (THIS_ PDWORD, DWORD) PURE; + STDMETHOD(GetSoundDeviceConfig)(THIS_ PDVSOUNDDEVICECONFIG, PDWORD) PURE; +}; +#undef INTERFACE + +#define INTERFACE IDirectPlayVoiceServer +DECLARE_INTERFACE_(IDirectPlayVoiceServer, IUnknown) +{ + STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID *ppvObj) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + STDMETHOD(Initialize) (THIS_ LPUNKNOWN, PDVMESSAGEHANDLER, PVOID, LPDWORD, DWORD) PURE; + STDMETHOD(StartSession) (THIS_ PDVSESSIONDESC, DWORD) PURE; + STDMETHOD(StopSession) (THIS_ DWORD) PURE; + STDMETHOD(GetSessionDesc) (THIS_ PDVSESSIONDESC) PURE; + STDMETHOD(SetSessionDesc) (THIS_ PDVSESSIONDESC) PURE; + STDMETHOD(GetCaps) (THIS_ PDVCAPS) PURE; + STDMETHOD(GetCompressionTypes) (THIS_ PVOID, PDWORD, PDWORD, DWORD) PURE; + STDMETHOD(SetTransmitTargets) (THIS_ DVID, PDVID, DWORD, DWORD) PURE; + STDMETHOD(GetTransmitTargets) (THIS_ DVID, PDVID, PDWORD, DWORD) PURE; + STDMETHOD(SetNotifyMask) (THIS_ PDWORD, DWORD) PURE; +}; +#undef INTERFACE + +#define INTERFACE IDirectPlayVoiceTest +DECLARE_INTERFACE_(IDirectPlayVoiceTest, IUnknown) +{ + STDMETHOD(QueryInterface) (THIS_ REFIID riid, PVOID *ppvObj) PURE; + STDMETHOD_(ULONG,AddRef) (THIS) PURE; + STDMETHOD_(ULONG,Release) (THIS) PURE; + STDMETHOD(CheckAudioSetup) (THIS_ const GUID *, const GUID *, HWND, DWORD) PURE; +}; +#undef INTERFACE + +#if !defined(__cplusplus) || defined(CINTERFACE) + +#define IDirectPlayVoiceClient_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectPlayVoiceClient_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectPlayVoiceClient_Release(p) (p)->lpVtbl->Release(p) + +#define IDirectPlayVoiceClient_Initialize(p,a,b,c,d,e) (p)->lpVtbl->Initialize(p,a,b,c,d,e) +#define IDirectPlayVoiceClient_Connect(p,a,b,c) (p)->lpVtbl->Connect(p,a,b,c) +#define IDirectPlayVoiceClient_Disconnect(p,a) (p)->lpVtbl->Disconnect(p,a) +#define IDirectPlayVoiceClient_GetSessionDesc(p,a) (p)->lpVtbl->GetSessionDesc(p,a) +#define IDirectPlayVoiceClient_GetClientConfig(p,a) (p)->lpVtbl->GetClientConfig(p,a) +#define IDirectPlayVoiceClient_SetClientConfig(p,a) (p)->lpVtbl->SetClientConfig(p,a) +#define IDirectPlayVoiceClient_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a) +#define IDirectPlayVoiceClient_GetCompressionTypes(p,a,b,c,d) (p)->lpVtbl->GetCompressionTypes(p,a,b,c,d) +#define IDirectPlayVoiceClient_SetTransmitTargets(p,a,b,c) (p)->lpVtbl->SetTransmitTargets(p,a,b,c) +#define IDirectPlayVoiceClient_GetTransmitTargets(p,a,b,c) (p)->lpVtbl->GetTransmitTargets(p,a,b,c) +#define IDirectPlayVoiceClient_Create3DSoundBuffer(p,a,b,c,d,e) (p)->lpVtbl->Create3DSoundBuffer(p,a,b,c,d,e) +#define IDirectPlayVoiceClient_Delete3DSoundBuffer(p,a,b) (p)->lpVtbl->Delete3DSoundBuffer(p,a,b) +#define IDirectPlayVoiceClient_SetNotifyMask(p,a,b) (p)->lpVtbl->SetNotifyMask(p,a,b) +#define IDirectPlayVoiceClient_GetSoundDeviceConfig(p,a,b) (p)->lpVtbl->GetSoundDeviceConfig(p,a,b) + +#define IDirectPlayVoiceServer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectPlayVoiceServer_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectPlayVoiceServer_Release(p) (p)->lpVtbl->Release(p) + +#define IDirectPlayVoiceServer_Initialize(p,a,b,c,d,e) (p)->lpVtbl->Initialize(p,a,b,c,d,e) +#define IDirectPlayVoiceServer_StartSession(p,a,b) (p)->lpVtbl->StartSession(p,a,b) +#define IDirectPlayVoiceServer_StopSession(p,a) (p)->lpVtbl->StopSession(p,a) +#define IDirectPlayVoiceServer_GetSessionDesc(p,a) (p)->lpVtbl->GetSessionDesc(p,a) +#define IDirectPlayVoiceServer_SetSessionDesc(p,a) (p)->lpVtbl->SetSessionDesc(p,a) +#define IDirectPlayVoiceServer_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a) +#define IDirectPlayVoiceServer_GetCompressionTypes(p,a,b,c,d) (p)->lpVtbl->GetCompressionTypes(p,a,b,c,d) +#define IDirectPlayVoiceServer_SetTransmitTargets(p,a,b,c,d) (p)->lpVtbl->SetTransmitTargets(p,a,b,c,d) +#define IDirectPlayVoiceServer_GetTransmitTargets(p,a,b,c,d) (p)->lpVtbl->GetTransmitTargets(p,a,b,c,d) +#define IDirectPlayVoiceServer_SetNotifyMask(p,a,b) (p)->lpVtbl->SetNotifyMask(p,a,b) +#define IDirectPlayVoiceTest_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) +#define IDirectPlayVoiceTest_AddRef(p) (p)->lpVtbl->AddRef(p) +#define IDirectPlayVoiceTest_Release(p) (p)->lpVtbl->Release(p) +#define IDirectPlayVoiceTest_CheckAudioSetup(p,a,b,c,d) (p)->lpVtbl->CheckAudioSetup(p,a,b,c,d) + + +#else /* C++ */ + +#define IDirectPlayVoiceClient_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirectPlayVoiceClient_AddRef(p) (p)->AddRef() +#define IDirectPlayVoiceClient_Release(p) (p)->Release() +#define IDirectPlayVoiceClient_Initialize(p,a,b,c,d,e) (p)->Initialize(a,b,c,d,e) +#define IDirectPlayVoiceClient_Connect(p,a,b,c) (p)->Connect(a,b,c) +#define IDirectPlayVoiceClient_Disconnect(p,a) (p)->Disconnect(a) +#define IDirectPlayVoiceClient_GetSessionDesc(p,a) (p)->GetSessionDesc(a) +#define IDirectPlayVoiceClient_GetClientConfig(p,a) (p)->GetClientConfig(a) +#define IDirectPlayVoiceClient_SetClientConfig(p,a) (p)->SetClientConfig(a) +#define IDirectPlayVoiceClient_GetCaps(p,a) (p)->GetCaps(a) +#define IDirectPlayVoiceClient_GetCompressionTypes(p,a,b,c,d) (p)->GetCompressionTypes(a,b,c,d) +#define IDirectPlayVoiceClient_SetTransmitTargets(p,a,b,c) (p)->SetTransmitTargets(a,b,c) +#define IDirectPlayVoiceClient_GetTransmitTargets(p,a,b,c) (p)->GetTransmitTargets(a,b,c) +#define IDirectPlayVoiceClient_Create3DSoundBuffer(p,a,b,c,d,e) (p)->Create3DSoundBuffer(a,b,c,d,e) +#define IDirectPlayVoiceClient_Delete3DSoundBuffer(p,a,b) (p)->Delete3DSoundBuffer(a,b) +#define IDirectPlayVoiceClient_SetNotifyMask(p,a,b) (p)->SetNotifyMask(a,b) +#define IDirectPlayVoiceClient_GetSoundDeviceConfig(p,a,b) (p)->GetSoundDeviceConfig(a,b) + +#define IDirectPlayVoiceServer_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirectPlayVoiceServer_AddRef(p) (p)->AddRef() +#define IDirectPlayVoiceServer_Release(p) (p)->Release() +#define IDirectPlayVoiceServer_Initialize(p,a,b,c,d,e) (p)->Initialize(a,b,c,d,e) +#define IDirectPlayVoiceServer_StartSession(p,a,b) (p)->StartSession(a,b) +#define IDirectPlayVoiceServer_StopSession(p,a) (p)->StopSession(a) +#define IDirectPlayVoiceServer_GetSessionDesc(p,a) (p)->GetSessionDesc(a) +#define IDirectPlayVoiceServer_SetSessionDesc(p,a) (p)->SetSessionDesc(a) +#define IDirectPlayVoiceServer_GetCaps(p,a) (p)->GetCaps(a) +#define IDirectPlayVoiceServer_GetCompressionTypes(p,a,b,c,d) (p)->GetCompressionTypes(a,b,c,d) +#define IDirectPlayVoiceServer_SetTransmitTargets(p,a,b,c,d) (p)->SetTransmitTargets(a,b,c,d) +#define IDirectPlayVoiceServer_GetTransmitTargets(p,a,b,c,d) (p)->GetTransmitTargets(a,b,c,d) +#define IDirectPlayVoiceServer_SetNotifyMask(p,a,b) (p)->SetNotifyMask(a,b) + +#define IDirectPlayVoiceTest_QueryInterface(p,a,b) (p)->QueryInterface(a,b) +#define IDirectPlayVoiceTest_AddRef(p) (p)->AddRef() +#define IDirectPlayVoiceTest_Release(p) (p)->Release() +#define IDirectPlayVoiceTest_CheckAudioSetup(p,a,b,c,d) (p)->CheckAudioSetup(a,b,c,d) + +#endif + + +#ifdef __cplusplus +} +#endif + +#endif /* __DVOICE_INCLUDED__ */ diff -Nru wine1.7-1.7.14/include/dwrite_2.idl wine1.7-1.7.18/include/dwrite_2.idl --- wine1.7-1.7.14/include/dwrite_2.idl 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.18/include/dwrite_2.idl 2014-05-02 18:15:48.000000000 +0000 @@ -0,0 +1,329 @@ +/* + * Copyright 2014 Nikolay Sivov for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +import "dwrite_1.idl"; + +typedef enum DWRITE_OPTICAL_ALIGNMENT +{ + DWRITE_OPTICAL_ALIGNMENT_NONE, + DWRITE_OPTICAL_ALIGNMENT_NO_SIDE_BEARINGS +} DWRITE_OPTICAL_ALIGNMENT; + +typedef enum DWRITE_GRID_FIT_MODE +{ + DWRITE_GRID_FIT_MODE_DEFAULT, + DWRITE_GRID_FIT_MODE_DISABLED, + DWRITE_GRID_FIT_MODE_ENABLED +} DWRITE_GRID_FIT_MODE; + +typedef struct DWRITE_TEXT_METRICS1 +{ + /* DWRITE_TEXT_METRICS fields */ + FLOAT left; + FLOAT top; + FLOAT width; + FLOAT widthIncludingTrailingWhitespace; + FLOAT height; + FLOAT layoutWidth; + FLOAT layoutHeight; + UINT32 maxBidiReorderingDepth; + UINT32 lineCount; + /* DWRITE_TEXT_METRICS1 fields */ + FLOAT heightIncludingTrailingWhitespace; +} DWRITE_TEXT_METRICS1; + +typedef struct _D3DCOLORVALUE +{ + union { + FLOAT r; + FLOAT dvR; + }; + union { + FLOAT g; + FLOAT dvG; + }; + union { + FLOAT b; + FLOAT dvB; + }; + union { + FLOAT a; + FLOAT dvA; + }; +} D3DCOLORVALUE; + +typedef D3DCOLORVALUE DWRITE_COLOR_F; + +typedef struct DWRITE_COLOR_GLYPH_RUN +{ + DWRITE_GLYPH_RUN glyphRun; + DWRITE_GLYPH_RUN_DESCRIPTION* glyphRunDescription; + FLOAT baselineOriginX; + FLOAT baselineOriginY; + DWRITE_COLOR_F runColor; + UINT16 paletteIndex; +} DWRITE_COLOR_GLYPH_RUN; + +[ + local, + object, + uuid(d3e0e934-22a0-427e-aae4-7d9574b59db1) +] +interface IDWriteTextRenderer1 : IDWriteTextRenderer +{ + HRESULT DrawGlyphRun(void *context, + FLOAT originX, + FLOAT originY, + DWRITE_GLYPH_ORIENTATION_ANGLE angle, + DWRITE_MEASURING_MODE mode, + DWRITE_GLYPH_RUN const *run, + DWRITE_GLYPH_RUN_DESCRIPTION const *rundescr, + IUnknown *effect); + + HRESULT DrawUnderline(void *context, + FLOAT originX, + FLOAT originY, + DWRITE_GLYPH_ORIENTATION_ANGLE angle, + DWRITE_UNDERLINE const *underline, + IUnknown *effect); + + HRESULT DrawStrikethrough(void *context, + FLOAT originX, + FLOAT originY, + DWRITE_GLYPH_ORIENTATION_ANGLE angle, + DWRITE_STRIKETHROUGH const *strikethrough, + IUnknown *effect + ); + + HRESULT DrawInlineObject(void *context, + FLOAT originX, + FLOAT originY, + DWRITE_GLYPH_ORIENTATION_ANGLE angle, + IDWriteInlineObject *inlineObject, + BOOL is_sideways, + BOOL is_rtl, + IUnknown *effect + ); +} + +[ + local, + object, + uuid(efa008f9-f7a1-48bf-b05c-f224713cc0ff) +] +interface IDWriteFontFallback : IUnknown +{ + HRESULT MapCharacters(IDWriteTextAnalysisSource *source, + UINT32 position, + UINT32 length, + IDWriteFontCollection *basecollection, + const WCHAR *baseFamilyName, + DWRITE_FONT_WEIGHT baseWeight, + DWRITE_FONT_STYLE baseStyle, + DWRITE_FONT_STRETCH baseStretch, + UINT32 *mappedLength, + IDWriteFont **mappedFont, + FLOAT *scale + ); +} + +[ + local, + object, + uuid(5f174b49-0d8b-4cfb-8bca-f1cce9d06c67) +] +interface IDWriteTextFormat1 : IDWriteTextFormat +{ + HRESULT SetVerticalGlyphOrientation(DWRITE_VERTICAL_GLYPH_ORIENTATION orientation); + DWRITE_VERTICAL_GLYPH_ORIENTATION GetVerticalGlyphOrientation(); + HRESULT SetLastLineWrapping(BOOL lastline_wrapping_enabled); + BOOL GetLastLineWrapping(); + HRESULT SetOpticalAlignment(DWRITE_OPTICAL_ALIGNMENT alignment); + DWRITE_OPTICAL_ALIGNMENT GetOpticalAlignment(); + HRESULT SetFontFallback(IDWriteFontFallback *fallback); + HRESULT GetFontFallback(IDWriteFontFallback **fallback); +} + +[ + local, + object, + uuid(1093c18f-8d5e-43f0-b064-0917311b525e) +] +interface IDWriteTextLayout2 : IDWriteTextLayout1 +{ + HRESULT GetMetrics(DWRITE_TEXT_METRICS1 *metrics); + HRESULT SetVerticalGlyphOrientation(DWRITE_VERTICAL_GLYPH_ORIENTATION orientation); + DWRITE_VERTICAL_GLYPH_ORIENTATION GetVerticalGlyphOrientation(); + HRESULT SetLastLineWrapping(BOOL lastline_wrapping_enabled); + BOOL GetLastLineWrapping(); + HRESULT SetOpticalAlignment(DWRITE_OPTICAL_ALIGNMENT alignment); + DWRITE_OPTICAL_ALIGNMENT GetOpticalAlignment(); + HRESULT SetFontFallback(IDWriteFontFallback *fallback); + HRESULT GetFontFallback(IDWriteFontFallback **fallback); +} + +[ + local, + object, + uuid(553a9ff3-5693-4df7-b52b-74806f7f2eb9) +] +interface IDWriteTextAnalyzer2 : IDWriteTextAnalyzer1 +{ + HRESULT GetGlyphOrientationTransform(DWRITE_GLYPH_ORIENTATION_ANGLE angle, + BOOL is_sideways, + FLOAT originX, + FLOAT originY, + DWRITE_MATRIX *transform + ); + HRESULT GetTypographicFeatures(IDWriteFontFace *fontface, + DWRITE_SCRIPT_ANALYSIS analysis, + const WCHAR *localeName, + UINT32 max_tagcount, + UINT32 *actual_tagcount, + DWRITE_FONT_FEATURE_TAG *tags + ); + + HRESULT CheckTypographicFeature(IDWriteFontFace *fontface, + DWRITE_SCRIPT_ANALYSIS analysis, + const WCHAR *localeName, + DWRITE_FONT_FEATURE_TAG feature, + UINT32 glyph_count, + const UINT16 *indices, + UINT8 *feature_applies + ); +} + +[ + local, + object, + uuid(fd882d06-8aba-4fb8-b849-8be8b73e14de) +] +interface IDWriteFontFallbackBuilder : IUnknown +{ + HRESULT AddMapping(const DWRITE_UNICODE_RANGE *ranges, + UINT32 rangesCount, + WCHAR const **targetFamilyNames, + UINT32 targetFamilyNamesCount, + [defaultvalue(NULL)] IDWriteFontCollection *collection, + [defaultvalue(NULL)] WCHAR const *localeName, + [defaultvalue(NULL)] WCHAR const *baseFamilyName, + [defaultvalue(1)] FLOAT scale + ); + HRESULT AddMappings(IDWriteFontFallback *fallback); + HRESULT CreateFontFallback(IDWriteFontFallback **fallback); +} + +[ + local, + object, + uuid(29748ed6-8c9c-4a6a-be0b-d912e8538944) +] +interface IDWriteFont2 : IDWriteFont1 +{ + BOOL IsColorFont(); +} + +[ + local, + object, + uuid(d8b768ff-64bc-4e66-982b-ec8e87f693f7) +] +interface IDWriteFontFace2 : IDWriteFontFace1 +{ + BOOL IsColorFont(); + UINT32 GetColorPaletteCount(); + UINT32 GetPaletteEntryCount(); + HRESULT GetPaletteEntries(UINT32 palette_index, + UINT32 first_entry_index, + UINT32 entry_count, + DWRITE_COLOR_F *entries + ); + HRESULT GetRecommendedRenderingMode(FLOAT fontEmSize, + FLOAT dpiX, + FLOAT dpiY, + DWRITE_MATRIX const *transform, + BOOL is_sideways, + DWRITE_OUTLINE_THRESHOLD threshold, + DWRITE_MEASURING_MODE measuringmode, + IDWriteRenderingParams *params, + DWRITE_RENDERING_MODE *renderingmode, + DWRITE_GRID_FIT_MODE *gridfitmode + ); +} + +[ + local, + object, + uuid(d31fbe17-f157-41a2-8d24-cb779e0560e8) +] +interface IDWriteColorGlyphRunEnumerator : IUnknown +{ + HRESULT MoveNext(BOOL *hasRun); + HRESULT GetCurrentRun(DWRITE_COLOR_GLYPH_RUN const **run); +} + +[ + local, + object, + uuid(f9d711c3-9777-40ae-87e8-3e5aF9bf0948) +] +interface IDWriteRenderingParams2 : IDWriteRenderingParams1 +{ + DWRITE_GRID_FIT_MODE GetGridFitMode(); +}; + +[ + local, + object, + uuid(0439fc60-ca44-4994-8dee-3a9af7b732ec) +] +interface IDWriteFactory2 : IDWriteFactory1 +{ + HRESULT GetSystemFontFallback(IDWriteFontFallback **fallback); + HRESULT CreateFontFallbackBuilder(IDWriteFontFallbackBuilder **fallbackbuilder); + HRESULT TranslateColorGlyphRun(FLOAT originX, + FLOAT originY, + const DWRITE_GLYPH_RUN *run, + const DWRITE_GLYPH_RUN_DESCRIPTION *rundescr, + DWRITE_MEASURING_MODE mode, + const DWRITE_MATRIX *transform, + UINT32 palette_index, + IDWriteColorGlyphRunEnumerator **colorlayers + ); + + HRESULT CreateCustomRenderingParams(FLOAT gamma, + FLOAT contrast, + FLOAT grayscalecontrast, + FLOAT cleartypeLevel, + DWRITE_PIXEL_GEOMETRY pixelGeometry, + DWRITE_RENDERING_MODE renderingMode, + DWRITE_GRID_FIT_MODE gridFitMode, + IDWriteRenderingParams2 **params + ); + + HRESULT CreateGlyphRunAnalysis(const DWRITE_GLYPH_RUN *run, + const DWRITE_MATRIX *transform, + DWRITE_RENDERING_MODE renderingMode, + DWRITE_MEASURING_MODE measuringMode, + DWRITE_GRID_FIT_MODE gridFitMode, + DWRITE_TEXT_ANTIALIAS_MODE antialiasMode, + FLOAT originX, + FLOAT originY, + IDWriteGlyphRunAnalysis **analysis + ); +} diff -Nru wine1.7-1.7.14/include/dxgi1_2.idl wine1.7-1.7.18/include/dxgi1_2.idl --- wine1.7-1.7.14/include/dxgi1_2.idl 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.18/include/dxgi1_2.idl 2014-05-02 18:15:48.000000000 +0000 @@ -0,0 +1,47 @@ +/* + * Copyright 2014 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 + */ + +import "dxgi.idl"; + +typedef enum _DXGI_OFFER_RESOURCE_PRIORITY { + DXGI_OFFER_RESOURCE_PRIORITY_LOW = 1, + DXGI_OFFER_RESOURCE_PRIORITY_NORMAL, + DXGI_OFFER_RESOURCE_PRIORITY_HIGH +} DXGI_OFFER_RESOURCE_PRIORITY; + +[ + object, + uuid(05008617-fbfd-4051-a790-144884b4f6a9), + local, + pointer_default(unique) +] +interface IDXGIDevice2 : IDXGIDevice1 +{ + HRESULT OfferResources( + [in] UINT NumResources, + [in, size_is(NumResources)] IDXGIResource *const *ppResources, + [in] DXGI_OFFER_RESOURCE_PRIORITY Priority); + + HRESULT ReclaimResources( + [in] UINT NumResources, + [in, size_is(NumResources)] IDXGIResource *const *ppResources, + [out, size_is(NumResources)] BOOL *pDiscarded); + + HRESULT EnqueueSetEvent( + [in] HANDLE hEvent); +} diff -Nru wine1.7-1.7.14/include/dxgi.idl wine1.7-1.7.18/include/dxgi.idl --- wine1.7-1.7.14/include/dxgi.idl 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/include/dxgi.idl 2014-05-02 18:15:48.000000000 +0000 @@ -446,6 +446,18 @@ [ object, + uuid(77db970f-6276-48ba-ba28-070143b4392c), + local, + pointer_default(unique) +] +interface IDXGIDevice1 : IDXGIDevice +{ + HRESULT SetMaximumFrameLatency([in] UINT MaxLatency); + HRESULT GetMaximumFrameLatency([out] UINT *pMaxLatency); +} + +[ + object, uuid(770aae78-f26f-4dba-a829-253c83d1b387), local, pointer_default(unique) diff -Nru wine1.7-1.7.14/include/dxva2api.idl wine1.7-1.7.18/include/dxva2api.idl --- wine1.7-1.7.14/include/dxva2api.idl 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.18/include/dxva2api.idl 2014-05-02 18:15:48.000000000 +0000 @@ -0,0 +1,527 @@ +/* + * Copyright 2014 Michael Müller for Pipelight + * + * 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"; + +cpp_quote("#if 0") +typedef DWORD IDirect3DDevice9; +typedef DWORD IDirect3DSurface9; + +typedef DWORD D3DFORMAT; +typedef DWORD D3DPOOL; +cpp_quote("#endif") + +/* MPEG2 */ +cpp_quote("DEFINE_GUID(DXVA2_ModeMPEG2_MoComp, 0xe6a9f44b, 0x61b0,0x4563, 0x9e,0xa4,0x63,0xd2,0xa3,0xc6,0xfe,0x66);") +cpp_quote("#define DXVA2_ModeMPEG2_MOCOMP DXVA2_ModeMPEG2_MoComp") + +cpp_quote("DEFINE_GUID(DXVA2_ModeMPEG2_IDCT, 0xbf22ad00, 0x03ea,0x4690, 0x80,0x77,0x47,0x33,0x46,0x20,0x9b,0x7e);") + +cpp_quote("DEFINE_GUID(DXVA2_ModeMPEG2_VLD, 0xee27417f, 0x5e28,0x4e65, 0xbe,0xea,0x1d,0x26,0xb5,0x08,0xad,0xc9);") + +/* H264 */ +cpp_quote("DEFINE_GUID(DXVA2_ModeH264_A, 0x1b81be64, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);") +cpp_quote("#define DXVA2_ModeH264_MoComp_NoFGT DXVA2_ModeH264_A") + +cpp_quote("DEFINE_GUID(DXVA2_ModeH264_B, 0x1b81be65, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);") +cpp_quote("#define DXVA2_ModeH264_MoComp_FGT DXVA2_ModeH264_B") + +cpp_quote("DEFINE_GUID(DXVA2_ModeH264_C, 0x1b81be66, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);") +cpp_quote("#define DXVA2_ModeH264_IDCT_NoFGT DXVA2_ModeH264_C") + +cpp_quote("DEFINE_GUID(DXVA2_ModeH264_D, 0x1b81be67, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);") +cpp_quote("#define DXVA2_ModeH264_IDCT_FGT DXVA2_ModeH264_D") + +cpp_quote("DEFINE_GUID(DXVA2_ModeH264_E, 0x1b81be68, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);") +cpp_quote("#define DXVA2_ModeH264_VLD_NoFGT DXVA2_ModeH264_E") + +cpp_quote("DEFINE_GUID(DXVA2_ModeH264_F, 0x1b81be69, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);") +cpp_quote("#define DXVA2_ModeH264_VLD_FGT DXVA2_ModeH264_F") + +/* WMV8 */ +cpp_quote("DEFINE_GUID(DXVA2_ModeWMV8_A, 0x1b81be80, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);") +cpp_quote("#define DXVA2_ModeWMV8_PostProc DXVA2_ModeWMV8_A") + +cpp_quote("DEFINE_GUID(DXVA2_ModeWMV8_B, 0x1b81be81, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);") +cpp_quote("#define DXVA2_ModeWMV8_MoComp DXVA2_ModeWMV8_B") + +/* WMV9 */ +cpp_quote("DEFINE_GUID(DXVA2_ModeWMV9_A, 0x1b81be90, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);") +cpp_quote("#define DXVA2_ModeWMV9_PostProc DXVA2_ModeWMV9_A") + +cpp_quote("DEFINE_GUID(DXVA2_ModeWMV9_B, 0x1b81be91, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);") +cpp_quote("#define DXVA2_ModeWMV9_MoComp DXVA2_ModeWMV9_B") + +cpp_quote("DEFINE_GUID(DXVA2_ModeWMV9_C, 0x1b81be94, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);") +cpp_quote("#define DXVA2_ModeWMV9_IDCT DXVA2_ModeWMV9_C") + +/* VC1 */ +cpp_quote("DEFINE_GUID(DXVA2_ModeVC1_A, 0x1b81beA0, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);") +cpp_quote("#define DXVA2_ModeVC1_PostProc DXVA2_ModeVC1_A") + +cpp_quote("DEFINE_GUID(DXVA2_ModeVC1_B, 0x1b81beA1, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);") +cpp_quote("#define DXVA2_ModeVC1_MoComp DXVA2_ModeVC1_B") + +cpp_quote("DEFINE_GUID(DXVA2_ModeVC1_C, 0x1b81beA2, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);") +cpp_quote("#define DXVA2_ModeVC1_IDCT DXVA2_ModeVC1_C") + +cpp_quote("DEFINE_GUID(DXVA2_ModeVC1_D, 0x1b81beA3, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);") +cpp_quote("#define DXVA2_ModeVC1_VLD DXVA2_ModeVC1_D") + +/* Encryption */ +cpp_quote("DEFINE_GUID(DXVA_NoEncrypt, 0x1b81bed0, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);") + +typedef LONGLONG REFERENCE_TIME; + +enum +{ + DXVA2_PictureParametersBufferType, + DXVA2_MacroBlockControlBufferType, + DXVA2_ResidualDifferenceBufferType, + DXVA2_DeblockingControlBufferType, + DXVA2_InverseQuantizationMatrixBufferType, + DXVA2_SliceControlBufferType, + DXVA2_BitStreamDateBufferType, + DXVA2_MotionVectorBuffer, + DXVA2_FilmGrainBuffer +}; + +enum +{ + DXVA2_VideoDecoderRenderTarget, + DXVA2_VideoProcessorRenderTarget, + DXVA2_VideoSoftwareRenderTarget +}; + +typedef struct _DXVA2_ExtendedFormat +{ + union + { + struct + { + UINT SampleFormat :8; + UINT VideoChromaSubsampling :4; + UINT NominalRange :3; + UINT VideoTransferMatrix :3; + UINT VideoLighting :4; + UINT VideoPrimaries :5; + UINT VideoTransferFunction :5; + }; + UINT value; + }; +} DXVA2_ExtendedFormat; + +typedef struct _DXVA2_Frequency +{ + UINT Numerator; + UINT Denominator; +} DXVA2_Frequency; + +typedef struct _DXVA2_ConfigPictureDecode +{ + 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; + UINT ConfigMinRenderTargetBuffCount; + USHORT ConfigDecoderSpecific; +} DXVA2_ConfigPictureDecode; + +typedef struct _DXVA2_VideoDesc +{ + UINT SampleWidth; + UINT SampleHeight; + DXVA2_ExtendedFormat SampleFormat; + D3DFORMAT Format; + DXVA2_Frequency InputSampleFreq; + DXVA2_Frequency OutputFrameFreq; + UINT UABProtectionLevel; + UINT Reserved; +} DXVA2_VideoDesc; + +typedef struct _DXVA2_DecodeBufferDesc +{ + DWORD CompressedBufferType; + UINT BufferIndex; + UINT DataOffset; + UINT DataSize; + UINT FirstMBaddress; + UINT NumMBsInBuffer; + UINT Width; + UINT Height; + UINT Stride; + UINT ReservedBits; + PVOID pvPVPState; +} DXVA2_DecodeBufferDesc; + +typedef struct _DXVA2_DecodeExtensionData +{ + UINT Function; + PVOID pPrivateInputData; + UINT PrivateInputDataSize; + PVOID pPrivateOutputData; + UINT PrivateOutputDataSize; +} DXVA2_DecodeExtensionData; + +typedef struct _DXVA2_DecodeExecuteParams +{ + UINT NumCompBuffers; + DXVA2_DecodeBufferDesc* pCompressedBuffers; + DXVA2_DecodeExtensionData* pExtensionData; +} DXVA2_DecodeExecuteParams; + +typedef struct _DXVA2_VideoProcessorCaps +{ + UINT DeviceCaps; + D3DPOOL InputPool; + UINT NumForwardRefSamples; + UINT NumBackwardRefSamples; + UINT Reserved; + UINT DeinterlaceTechnology; + UINT ProcAmpControlCaps; + UINT VideoProcessorOperations; + UINT NoiseFilterTechnology; + UINT DetailFilterTechnology; +} DXVA2_VideoProcessorCaps; + +typedef struct _DXVA2_Fixed32 +{ + union + { + struct + { + USHORT Fraction; + SHORT Value; + }; + LONG ll; + }; +} DXVA2_Fixed32; + +typedef struct _DXVA2_ValueRange +{ + DXVA2_Fixed32 MinValue; + DXVA2_Fixed32 MaxValue; + DXVA2_Fixed32 DefaultValue; + DXVA2_Fixed32 StepSize; +} DXVA2_ValueRange; + +typedef struct _DXVA2_AYUVSample8 +{ + UCHAR Cr; + UCHAR Cb; + UCHAR Y; + UCHAR Alpha; +} DXVA2_AYUVSample8; + +typedef struct _DXVA2_AYUVSample16 +{ + USHORT Cr; + USHORT Cb; + USHORT Y; + USHORT Alpha; +} DXVA2_AYUVSample16; + +typedef struct _DXVA2_ProcAmpValues +{ + DXVA2_Fixed32 Brightness; + DXVA2_Fixed32 Contrast; + DXVA2_Fixed32 Hue; + DXVA2_Fixed32 Saturation; +} DXVA2_ProcAmpValues; + +typedef struct _DXVA2_FilterValues +{ + DXVA2_Fixed32 Level; + DXVA2_Fixed32 Threshold; + DXVA2_Fixed32 Radius; +} DXVA2_FilterValues; + +typedef struct _DXVA2_VideoProcessBltParams +{ + REFERENCE_TIME TargetFrame; + RECT TargetRect; + SIZE ConstrictionSize; + UINT StreamingFlags; + DXVA2_AYUVSample16 BackgroundColor; + DXVA2_ExtendedFormat DestFormat; + DXVA2_ProcAmpValues ProcAmpValues; + DXVA2_Fixed32 Alpha; + DXVA2_FilterValues NoiseFilterLuma; + DXVA2_FilterValues NoiseFilterChroma; + DXVA2_FilterValues DetailFilterLuma; + DXVA2_FilterValues DetailFilterChroma; + DWORD DestData; +} DXVA2_VideoProcessBltParams; + +typedef struct _DXVA2_VideoSample +{ + REFERENCE_TIME Start; + REFERENCE_TIME End; + DXVA2_ExtendedFormat SampleFormat; + IDirect3DSurface9* SrcSurface; + RECT SrcRect; + RECT DstRect; + DXVA2_AYUVSample8 Pal[16]; + DXVA2_Fixed32 PlanarAlpha; + DWORD SampleData; +} DXVA2_VideoSample; + +interface IDirectXVideoDecoder; +interface IDirectXVideoProcessor; + +/***************************************************************************** + * IDirect3DDeviceManager9 interface + */ +[ + object, + uuid(a0cade0f-06d5-4cf4-a1c7-f3cdd725aa75), + local +] +interface IDirect3DDeviceManager9 : IUnknown +{ + HRESULT ResetDevice( + [in] IDirect3DDevice9* pDevice, + [in] UINT resetToken); + + HRESULT OpenDeviceHandle( + [out] HANDLE* phDevice); + + HRESULT CloseDeviceHandle( + [in] HANDLE hDevice); + + HRESULT TestDevice( + [in] HANDLE hDevice); + + HRESULT LockDevice( + [in] HANDLE hDevice, + [out] IDirect3DDevice9** ppDevice, + [in] BOOL fBlock); + + HRESULT UnlockDevice( + [in] HANDLE hDevice, + [in] BOOL fSaveState); + + HRESULT GetVideoService( + [in] HANDLE hDevice, + [in] REFIID riid, + [out] void** ppService); +}; + +/***************************************************************************** + * IDirectXVideoAccelerationService interface + */ +[ + object, + uuid(fc51a550-d5e7-11d9-af55-00054e43ff02), + local +] +interface IDirectXVideoAccelerationService : IUnknown +{ + HRESULT CreateSurface( + [in] UINT width, + [in] UINT height, + [in] UINT backBuffers, + [in] D3DFORMAT format, + [in] D3DPOOL pool, + [in] DWORD usage, + [in] DWORD dxvaType, + [out] IDirect3DSurface9 **ppSurface, + [in, out] HANDLE *pSharedHandle); +}; + +/***************************************************************************** + * IDirectXVideoDecoderService interface + */ +[ + object, + uuid(fc51a551-d5e7-11d9-af55-00054e43ff02), + local +] +interface IDirectXVideoDecoderService : IDirectXVideoAccelerationService +{ + HRESULT GetDecoderDeviceGuids( + [out] UINT *count, + [out] GUID **pGuids); + + HRESULT GetDecoderRenderTargets( + [in] REFGUID guid, + [out] UINT *pCount, + [out] D3DFORMAT **pFormats); + + HRESULT GetDecoderConfigurations( + [in] REFGUID guid, + [in] const DXVA2_VideoDesc *pVideoDesc, + [in] IUnknown *pReserved, + [out] UINT *pCount, + [out] DXVA2_ConfigPictureDecode **ppConfigs); + + HRESULT CreateVideoDecoder( + [in] REFGUID guid, + [in] const DXVA2_VideoDesc *pVideoDesc, + [in] DXVA2_ConfigPictureDecode *pConfig, + [in] IDirect3DSurface9 **ppDecoderRenderTargets, + [in] UINT NumSurfaces, + [out] IDirectXVideoDecoder **ppDecode); +}; + +/***************************************************************************** + * IDirectXVideoDecoder interface + */ +[ + object, + uuid(f2b0810a-fd00-43c9-918c-df94e2d8ef7d), + local +] +interface IDirectXVideoDecoder : IUnknown +{ + HRESULT GetVideoDecoderService( + [out] IDirectXVideoDecoderService** ppService); + + HRESULT GetCreationParameters( + [out] GUID* pDeviceGuid, + [out] DXVA2_VideoDesc* pVideoDesc, + [out] DXVA2_ConfigPictureDecode* pConfig, + [out] IDirect3DSurface9*** pDecoderRenderTargets, + [out] UINT* pNumSurfaces); + + HRESULT GetBuffer( + [in] UINT BufferType, + [out] void** ppBuffer, + [out] UINT* pBufferSize); + + HRESULT ReleaseBuffer( + [in] UINT BufferType); + + HRESULT BeginFrame( + [in] IDirect3DSurface9* pRenderTarget, + [in] void* pvPVPData); + + HRESULT EndFrame( + [out] HANDLE* pHandleComplete); + + HRESULT Execute( + [in] const DXVA2_DecodeExecuteParams* pExecuteParams); +}; + +/***************************************************************************** + * IDirectXVideoProcessorService interface + */ +[ + object, + uuid(fc51a551-d5e7-11d9-af55-00054e43ff02), + local +] +interface IDirectXVideoProcessorService : IDirectXVideoAccelerationService +{ + HRESULT RegisterVideoProcessorSoftwareDevice( + [in] void* pCallbacks); + + HRESULT GetVideoProcessorDeviceGuids( + [in] const DXVA2_VideoDesc* pVideoDesc, + [out] UINT* pCount, + [out] GUID** pGuids); + + HRESULT GetVideoProcessorRenderTargets( + [in] REFGUID VideoProcDeviceGuid, + [in] const DXVA2_VideoDesc* pVideoDesc, + [out] UINT* pCount, + [out] D3DFORMAT** pFormats); + + HRESULT GetVideoProcessorSubStreamFormats( + [in] REFGUID VideoProcDeviceGuid, + [in] const DXVA2_VideoDesc* pVideoDesc, + [in] D3DFORMAT RenderTargetFormat, + [out] UINT* pCount, + [out] D3DFORMAT** pFormats); + + HRESULT GetVideoProcessorCaps( + [in] REFGUID VideoProcDeviceGuid, + [in] const DXVA2_VideoDesc* pVideoDesc, + [in] D3DFORMAT RenderTargetFormat, + [out] DXVA2_VideoProcessorCaps* pCaps); + + HRESULT GetProcAmpRange( + [in] REFGUID VideoProcDeviceGuid, + [in] const DXVA2_VideoDesc* pVideoDesc, + [in] D3DFORMAT RenderTargetFormat, + [in] UINT ProcAmpCap, + [out] DXVA2_ValueRange* pRange); + + HRESULT GetFilterPropertyRange( + [in] REFGUID VideoProcDeviceGuid, + [in] const DXVA2_VideoDesc* pVideoDesc, + [in] D3DFORMAT renderTargetFormat, + [in] UINT FilterSetting, + [out] DXVA2_ValueRange* pRange); + + HRESULT CreateVideoProcessor( + [in] REFGUID VideoProcDeviceGuid, + [in] const DXVA2_VideoDesc* pVideoDesc, + [in] D3DFORMAT RenderTargetFormat, + [in] UINT MaxNumSubStreams, + [out] IDirectXVideoProcessor** ppVidProcess); +}; + +/***************************************************************************** + * IDirectXVideoProcessor interface + */ +[ + object, + uuid(8c3a39f0-916e-4690-804f-4c8001355d25), + local +] +interface IDirectXVideoProcessor : IUnknown +{ + HRESULT GetVideoProcessorService( + [out] IDirectXVideoProcessorService** ppService); + + HRESULT GetCreationParameters( + [out] GUID* pDeviceGuid, + [out] DXVA2_VideoDesc* pVideoDesc, + [out] D3DFORMAT* pRenderTargetFormat, + [out] UINT* pMaxNumSubStreams); + + HRESULT GetVideoProcessorCaps( + [out] DXVA2_VideoProcessorCaps* pCaps); + + HRESULT GetProcAmpRange( + [in] UINT ProcAmpCap, + [out] DXVA2_ValueRange* pRange); + + HRESULT GetFilterPropertyRange( + [in] UINT FilterSetting, + [out] DXVA2_ValueRange* pRange); + + HRESULT VideoProcessBlt( + [in] IDirect3DSurface9* pRenderTarget, + [in] const DXVA2_VideoProcessBltParams* pBltParams, + [in] const DXVA2_VideoSample* pSamples, + [in] UINT NumSamples, + [out] HANDLE* pHandleCompleteIDirect3DDeviceManager9); +}; diff -Nru wine1.7-1.7.14/include/evntrace.h wine1.7-1.7.18/include/evntrace.h --- wine1.7-1.7.14/include/evntrace.h 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/include/evntrace.h 2014-05-02 18:15:48.000000000 +0000 @@ -30,6 +30,14 @@ #define EVENT_TRACE_CONTROL_UPDATE 2 #define EVENT_TRACE_CONTROL_FLUSH 3 +#define TRACE_LEVEL_NONE 0 +#define TRACE_LEVEL_CRITICAL 1 +#define TRACE_LEVEL_FATAL 1 +#define TRACE_LEVEL_ERROR 2 +#define TRACE_LEVEL_WARNING 3 +#define TRACE_LEVEL_INFORMATION 4 +#define TRACE_LEVEL_VERBOSE 5 + typedef ULONG64 TRACEHANDLE, *PTRACEHANDLE; struct _EVENT_TRACE_LOGFILEA; @@ -221,6 +229,9 @@ ULONG WINAPI FlushTraceA(TRACEHANDLE,LPCSTR,PEVENT_TRACE_PROPERTIES); ULONG WINAPI FlushTraceW(TRACEHANDLE,LPCWSTR,PEVENT_TRACE_PROPERTIES); #define FlushTrace WINELIB_NAME_AW(FlushTrace) +ULONG WINAPI GetTraceEnableFlags(TRACEHANDLE); +UCHAR WINAPI GetTraceEnableLevel(TRACEHANDLE); +TRACEHANDLE WINAPI GetTraceLoggerHandle(PVOID); ULONG WINAPI QueryAllTracesA(PEVENT_TRACE_PROPERTIES*,ULONG,PULONG); ULONG WINAPI QueryAllTracesW(PEVENT_TRACE_PROPERTIES*,ULONG,PULONG); #define QueryAllTraces WINELIB_NAME_AW(QueryAllTraces) diff -Nru wine1.7-1.7.14/include/highlevelmonitorconfigurationapi.h wine1.7-1.7.18/include/highlevelmonitorconfigurationapi.h --- wine1.7-1.7.14/include/highlevelmonitorconfigurationapi.h 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.18/include/highlevelmonitorconfigurationapi.h 2014-05-02 18:15:48.000000000 +0000 @@ -0,0 +1,82 @@ +/* + * Copyright 2014 Michael Müller for Pipelight + * + * 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_HIGHLEVELMONITORCONFIGURATIONAPI_H +#define __WINE_HIGHLEVELMONITORCONFIGURATIONAPI_H + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum _MC_COLOR_TEMPERATURE +{ + MC_COLOR_TEMPERATURE_UNKNOWN, + MC_COLOR_TEMPERATURE_4000K, + MC_COLOR_TEMPERATURE_5000K, + MC_COLOR_TEMPERATURE_6500K, + MC_COLOR_TEMPERATURE_7500K, + MC_COLOR_TEMPERATURE_8200K, + MC_COLOR_TEMPERATURE_9300K, + MC_COLOR_TEMPERATURE_10000K, + MC_COLOR_TEMPERATURE_11500K +} MC_COLOR_TEMPERATURE, *LPMC_COLOR_TEMPERATURE; + +typedef enum _MC_POSITION_TYPE +{ + MC_HORIZONTAL_POSITION, + MC_VERTICAL_POSITION +} MC_POSITION_TYPE; + +typedef enum _MC_SIZE_TYPE +{ + MC_WIDTH, + MC_HEIGHT +} MC_SIZE_TYPE; + +typedef enum _MC_DRIVE_TYPE +{ + MC_RED_DRIVE, + MC_GREEN_DRIVE, + MC_BLUE_DRIVE +} MC_DRIVE_TYPE; + +typedef enum _MC_GAIN_TYPE +{ + MC_RED_GAIN, + MC_GREEN_GAIN, + MC_BLUE_GAIN +} MC_GAIN_TYPE; + +typedef enum _MC_DISPLAY_TECHNOLOGY_TYPE +{ + MC_SHADOW_MASK_CATHODE_RAY_TUBE, + MC_APERTURE_GRILL_CATHODE_RAY_TUBE, + MC_THIN_FILM_TRANSISTOR, + MC_LIQUID_CRYSTAL_ON_SILICON, + MC_PLASMA, + MC_ORGANIC_LIGHT_EMITTING_DIODE, + MC_ELECTROLUMINESCENT, + MC_MICROELECTROMECHANICAL, + MC_FIELD_EMISSION_DEVICE +} MC_DISPLAY_TECHNOLOGY_TYPE, *LPMC_DISPLAY_TECHNOLOGY_TYPE; + +#ifdef __cplusplus +} +#endif + +#endif /* __WINE_HIGHLEVELMONITORCONFIGURATIONAPI_H */ diff -Nru wine1.7-1.7.14/include/lmat.h wine1.7-1.7.18/include/lmat.h --- wine1.7-1.7.14/include/lmat.h 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/include/lmat.h 2014-05-02 18:15:48.000000000 +0000 @@ -26,6 +26,7 @@ #endif NET_API_STATUS WINAPI NetScheduleJobAdd(LPCWSTR,LPBYTE,LPDWORD); +NET_API_STATUS WINAPI NetScheduleJobDel(LPCWSTR,DWORD,DWORD); NET_API_STATUS WINAPI NetScheduleJobEnum(LPCWSTR,LPBYTE*,DWORD,LPDWORD,LPDWORD,LPDWORD); #ifdef __cplusplus diff -Nru wine1.7-1.7.14/include/lowlevelmonitorconfigurationapi.h wine1.7-1.7.18/include/lowlevelmonitorconfigurationapi.h --- wine1.7-1.7.14/include/lowlevelmonitorconfigurationapi.h 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.18/include/lowlevelmonitorconfigurationapi.h 2014-05-02 18:15:48.000000000 +0000 @@ -0,0 +1,43 @@ +/* + * Copyright 2014 Michael Müller for Pipelight + * + * 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_LOWLEVELMONITORCONFIGURATIONAPI_H +#define __WINE_LOWLEVELMONITORCONFIGURATIONAPI_H + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct _MC_TIMING_REPORT +{ + BYTE bTimingStatusByte; + DWORD dwHorizontalFrequencyInHZ; + DWORD dwVerticalFrequencyInHZ; +} MC_TIMING_REPORT, *LPMC_TIMING_REPORT; + +typedef enum _MC_VCP_CODE_TYPE +{ + MC_MOMENTARY, + MC_SET_PARAMETER +} MC_VCP_CODE_TYPE, *LPMC_VCP_CODE_TYPE; + +#ifdef __cplusplus +} +#endif + +#endif /* __WINE_LOWLEVELMONITORCONFIGURATIONAPI_H */ diff -Nru wine1.7-1.7.14/include/Makefile.in wine1.7-1.7.18/include/Makefile.in --- wine1.7-1.7.14/include/Makefile.in 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/include/Makefile.in 2014-05-02 18:15:48.000000000 +0000 @@ -38,7 +38,10 @@ downloadmgr.idl \ dwrite.idl \ dwrite_1.idl \ + dwrite_2.idl \ dxgi.idl \ + dxgi1_2.idl \ + dxva2api.idl \ endpointvolume.idl \ exdisp.idl \ fusion.idl \ @@ -74,8 +77,10 @@ msxml.idl \ msxml2.idl \ msxml6.idl \ + netcfgx.idl \ netcon.idl \ netfw.idl \ + netlistmgr.idl \ oaidl.idl \ objectarray.idl \ objidl.idl \ @@ -244,6 +249,7 @@ ddk/ntddk.h \ ddk/ntddser.h \ ddk/ntddtape.h \ + ddk/ntifs.h \ ddk/usb.h \ ddk/usb100.h \ ddk/usb200.h \ @@ -293,6 +299,7 @@ dsound.h \ dsrole.h \ dvdmedia.h \ + dvoice.h \ dwmapi.h \ dxdiag.h \ dxerr8.h \ @@ -326,6 +333,7 @@ gdipluspixelformats.h \ gdiplustypes.h \ guiddef.h \ + highlevelmonitorconfigurationapi.h \ hlguids.h \ htmlhelp.h \ http.h \ @@ -369,6 +377,7 @@ lmuseflg.h \ lmwksta.h \ loadperf.h \ + lowlevelmonitorconfigurationapi.h \ lzexpand.h \ mapi.h \ mapicode.h \ @@ -471,6 +480,7 @@ patchapi.h \ pdh.h \ pdhmsg.h \ + physicalmonitorenumerationapi.h \ pktdef.h \ poppack.h \ powrprof.h \ diff -Nru wine1.7-1.7.14/include/msinkaut.idl wine1.7-1.7.18/include/msinkaut.idl --- wine1.7-1.7.14/include/msinkaut.idl 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/include/msinkaut.idl 2014-05-02 18:15:48.000000000 +0000 @@ -211,8 +211,8 @@ [in] single VerticalComponent); [id(0x00000003)] HRESULT Rotate( [in] single Degrees, - [in, optional, defaultvalue(0)] single x, - [in, optional, defaultvalue(0)] single y); + [in, defaultvalue(0)] single x, + [in, defaultvalue(0)] single y); [id(0x00000004)] HRESULT Reflect( [in] VARIANT_BOOL Horizontally, [in] VARIANT_BOOL Vertically); @@ -336,7 +336,7 @@ [id(0x00000014), propget] HRESULT Deleted( [out, retval] VARIANT_BOOL* Deleted); [id(0x00000003)] HRESULT GetBoundingBox( - [in, optional, defaultvalue(0)] InkBoundingBoxMode BoundingBoxMode, + [in, defaultvalue(0)] InkBoundingBoxMode BoundingBoxMode, [out, retval] IInkRectangle** Rectangle); [id(0x00000005)] HRESULT FindIntersections( [in] IInkStrokes* Strokes, @@ -354,7 +354,7 @@ [id(0x00000009)] HRESULT NearestPoint( [in] long x, [in] long y, - [in, out, optional, defaultvalue(0)] single* Distance, + [in, out, defaultvalue(0)] single* Distance, [out, retval] single* Point); [id(0x0000000a)] HRESULT Split( [in] single SplitAt, @@ -366,35 +366,35 @@ [out] TabletPropertyMetricUnit* Units, [out] single* Resolution); [id(0x00000016)] HRESULT GetPoints( - [in, optional, defaultvalue(0)] long Index, - [in, optional, defaultvalue(-1)] long Count, + [in, defaultvalue(0)] long Index, + [in, defaultvalue(-1)] long Count, [out, retval] VARIANT* Points); [id(0x00000017)] HRESULT SetPoints( [in] VARIANT Points, - [in, optional, defaultvalue(0)] long Index, - [in, optional, defaultvalue(-1)] long Count, + [in, defaultvalue(0)] long Index, + [in, defaultvalue(-1)] long Count, [out, retval] long* NumberOfPointsSet); [id(0x00000018)] HRESULT GetPacketData( - [in, optional, defaultvalue(0)] long Index, - [in, optional, defaultvalue(-1)] long Count, + [in, defaultvalue(0)] long Index, + [in, defaultvalue(-1)] long Count, [out, retval] VARIANT* PacketData); [id(0x00000019)] HRESULT GetPacketValuesByProperty( [in] BSTR propertyName, - [in, optional, defaultvalue(0)] long Index, - [in, optional, defaultvalue(-1)] long Count, + [in, defaultvalue(0)] long Index, + [in, defaultvalue(-1)] long Count, [out, retval] VARIANT* PacketValues); [id(0x0000001a)] HRESULT SetPacketValuesByProperty( [in] BSTR bstrPropertyName, [in] VARIANT PacketValues, - [in, optional, defaultvalue(0)] long Index, - [in, optional, defaultvalue(-1)] long Count, + [in, defaultvalue(0)] long Index, + [in, defaultvalue(-1)] long Count, [out, retval] long* NumberOfPacketsSet); [id(0x0000001b)] HRESULT GetFlattenedBezierPoints( - [in, optional, defaultvalue(0)] long FittingError, + [in, defaultvalue(0)] long FittingError, [out, retval] VARIANT* FlattenedBezierPoints); [id(0x0000001d)] HRESULT Transform( [in] IInkTransform* Transform, - [in, optional, defaultvalue(0)] VARIANT_BOOL ApplyOnPenWidth); + [in, defaultvalue(0)] VARIANT_BOOL ApplyOnPenWidth); [id(0x0000001c)] HRESULT ScaleToRectangle( [in] IInkRectangle* Rectangle); [id(0x0000001e)] HRESULT Move( @@ -402,8 +402,8 @@ [in] single VerticalComponent); [id(0x0000001f)] HRESULT Rotate( [in] single Degrees, - [in, optional, defaultvalue(0)] single x, - [in, optional, defaultvalue(0)] single y); + [in, defaultvalue(0)] single x, + [in, defaultvalue(0)] single y); [id(0x00000020)] HRESULT Shear( [in] single HorizontalMultiplier, [in] single VerticalMultiplier); @@ -693,7 +693,7 @@ HRESULT DrawStroke( [in] long hDC, [in] IInkStrokeDisp* Stroke, - [in, optional, defaultvalue(0)] + [in, defaultvalue(0)] IInkDrawingAttributes* DrawingAttributes); HRESULT PixelToInkSpace( [in] long hDC, @@ -714,19 +714,19 @@ [out, retval] IInkRectangle** Rectangle); HRESULT MeasureStroke( [in] IInkStrokeDisp* Stroke, - [in, optional, defaultvalue(0)] IInkDrawingAttributes* DrawingAttributes, + [in, defaultvalue(0)] IInkDrawingAttributes* DrawingAttributes, [out, retval] IInkRectangle** Rectangle); HRESULT Move( [in] single HorizontalComponent, [in] single VerticalComponent); HRESULT Rotate( [in] single Degrees, - [in, optional, defaultvalue(0)] single x, - [in, optional, defaultvalue(0)] single y); + [in, defaultvalue(0)] single x, + [in, defaultvalue(0)] single y); HRESULT ScaleTransform( [in] single HorizontalMultiplier, [in] single VerticalMultiplier, - [in, optional, defaultvalue(-1)] VARIANT_BOOL ApplyOnPenWidth); + [in, defaultvalue(-1)] VARIANT_BOOL ApplyOnPenWidth); }; typedef enum { @@ -996,7 +996,7 @@ [id(0x00000017)] HRESULT SetWindowInputRectangle( [in] IInkRectangle* WindowInputRectangle); [id(0x0000001a)] HRESULT SetAllTabletsMode( - [in, optional, defaultvalue(-1)] VARIANT_BOOL UseMouseForInput); + [in, defaultvalue(-1)] VARIANT_BOOL UseMouseForInput); [id(0x0000001b)] HRESULT SetSingleTabletIntegratedMode( [in] IInkTablet* Tablet); [id(0x0000000b)] HRESULT GetEventInterest( diff -Nru wine1.7-1.7.14/include/netcfgx.idl wine1.7-1.7.18/include/netcfgx.idl --- wine1.7-1.7.14/include/netcfgx.idl 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.18/include/netcfgx.idl 2014-05-02 18:15:48.000000000 +0000 @@ -0,0 +1,133 @@ +/* + * + * Copyright 2014 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 "unknwn.idl"; +import "wtypes.idl"; + +#ifndef __WIDL__ +#define threading(model) +#define progid(str) +#define vi_progid(str) +#endif + +cpp_quote("#define NETCFG_E_ALREADY_INITIALIZED MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0xA020)") +cpp_quote("#define NETCFG_E_NO_WRITE_LOCK MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0xA024)") + +[ + local, + object, + uuid(c0e8ae99-306e-11d1-aacf-00805fc1270e), + pointer_default(unique) +] +interface INetCfgComponent : IUnknown +{ + typedef enum tagCOMPONENT_CHARACTERISTICS + { + NCF_VIRTUAL = 0x00000001, + NCF_SOFTWARE_ENUMERATED = 0x00000002, + NCF_PHYSICAL = 0x00000004, + NCF_HIDDEN = 0x00000008, + NCF_NO_SERVICE = 0x00000010, + NCF_NOT_USER_REMOVABLE = 0x00000020, + NCF_MULTIPORT_INSTANCED_ADAPTER = 0x00000040, + NCF_HAS_UI = 0x00000080, + NCF_SINGLE_INSTANCE = 0x00000100, + NCF_FILTER = 0x00000400, + NCF_DONTEXPOSELOWER = 0x00001000, + NCF_HIDE_BINDING = 0x00002000, + NCF_NDIS_PROTOCOL = 0x00004000, + NCF_FIXED_BINDING = 0x00020000, + NCF_LW_FILTER = 0x00040000 + } COMPONENT_CHARACTERISTICS; + + typedef enum tagNCRP_FLAGS + { + NCRP_QUERY_PROPERTY_UI = 0x00000001, + NCRP_SHOW_PROPERTY_UI = 0x00000002 + } NCRP_FLAGS; + + HRESULT GetDisplayName ([out] LPWSTR* ppszwDisplayName); + HRESULT SetDisplayName ([in] LPCWSTR pszwDisplayName); + HRESULT GetHelpText ([out] LPWSTR* pszwHelpText); + HRESULT GetId ([out] LPWSTR* ppszwId); + HRESULT GetCharacteristics ([out] LPDWORD pdwCharacteristics); + HRESULT GetInstanceGuid ([out] GUID* pGuid); + HRESULT GetPnpDevNodeId ([out] LPWSTR* ppszwDevNodeId); + HRESULT GetClassGuid ([out] GUID* pGuid); + HRESULT GetBindName ([out] LPWSTR* ppszwBindName); + HRESULT GetDeviceStatus ([out] ULONG* pulStatus); + HRESULT OpenParamKey ([out] HKEY* phkey); + HRESULT RaisePropertyUi ([in] HWND hwndParent, [in] DWORD dwFlags, [in] IUnknown* punkContext); +}; + + +[ + local, + object, + uuid(c0e8ae92-306e-11d1-aacf-00805fc1270e), + pointer_default(unique) +] +interface IEnumNetCfgComponent : IUnknown +{ + HRESULT Next ([in] ULONG celt, [out] INetCfgComponent** rgelt, [out] ULONG *pceltFetched); + HRESULT Skip ([in] ULONG celt); + HRESULT Reset (); + HRESULT Clone ([out] IEnumNetCfgComponent** ppenum); +}; + +[ + local, + object, + uuid(c0e8ae9f-306e-11d1-aacf-00805fc1270e), + pointer_default(unique) +] +interface INetCfgLock : IUnknown +{ + HRESULT AcquireWriteLock ([in] DWORD cmsTimeout, [in] LPCWSTR pszwClientDescription, + [out] LPWSTR* ppszwClientDescription); + HRESULT ReleaseWriteLock (); + HRESULT IsWriteLocked ([out] LPWSTR* ppszwClientDescription); +}; + +[ + local, + object, + uuid(c0e8ae93-306e-11d1-aacf-00805fc1270e), + pointer_default(unique) +] +interface INetCfg : IUnknown +{ + HRESULT Initialize ([in] PVOID pvReserved); + HRESULT Uninitialize (); + HRESULT Apply (); + HRESULT Cancel (); + HRESULT EnumComponents ([in] const GUID* pguidClass, [out] IEnumNetCfgComponent** ppenumComponent); + HRESULT FindComponent ([in] LPCWSTR pszwInfId, [out] INetCfgComponent** pComponent); + HRESULT QueryNetCfgClass ([in] const GUID* pguidClass, [in] REFIID riid,[out] void** ppvObject); +}; + +[ + helpstring("Network Configuration Component Object"), + threading(both), + uuid(5b035261-40f9-11d1-aaec-00805fc1270e) +] +coclass CNetCfg +{ + [default] interface INetCfg; +} diff -Nru wine1.7-1.7.14/include/netlistmgr.idl wine1.7-1.7.18/include/netlistmgr.idl --- wine1.7-1.7.14/include/netlistmgr.idl 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.18/include/netlistmgr.idl 2014-05-02 18:15:48.000000000 +0000 @@ -0,0 +1,147 @@ +/* + * Copyright 2014 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 + */ + +import "oaidl.idl"; +import "objidl.idl"; + +#ifndef __WIDL__ +#define threading(model) +#endif + +interface IEnumNetworks; +interface IEnumNetworkConnections; +interface INetwork; +interface INetworkConnection; +interface INetworkCostManager; +interface INetworkListManager; + +typedef [v1_enum] enum NLM_CONNECTIVITY +{ + NLM_CONNECTIVITY_DISCONNECTED = 0x0000, + NLM_CONNECTIVITY_IPV4_NOTRAFFIC = 0x0001, + NLM_CONNECTIVITY_IPV6_NOTRAFFIC = 0x0002, + NLM_CONNECTIVITY_IPV4_SUBNET = 0x0010, + NLM_CONNECTIVITY_IPV4_LOCALNETWORK = 0x0020, + NLM_CONNECTIVITY_IPV4_INTERNET = 0x0040, + NLM_CONNECTIVITY_IPV6_SUBNET = 0x0100, + NLM_CONNECTIVITY_IPV6_LOCALNETWORK = 0x0200, + NLM_CONNECTIVITY_IPV6_INTERNET = 0x0400 +} NLM_CONNECTIVITY; + +typedef [v1_enum] enum NLM_ENUM_NETWORK +{ + NLM_ENUM_NETWORK_CONNECTED = 0x01, + NLM_ENUM_NETWORK_DISCONNECTED = 0x02, + NLM_ENUM_NETWORK_ALL = 0x03 +} NLM_ENUM_NETWORK; + +typedef [v1_enum] enum NLM_CONNECTION_COST +{ + NLM_CONNECTION_COST_UNKNOWN = 0x0, + NLM_CONNECTION_COST_UNRESTRICTED = 0x1, + NLM_CONNECTION_COST_FIXED = 0x2, + NLM_CONNECTION_COST_VARIABLE = 0x4, + NLM_CONNECTION_COST_OVERDATALIMIT = 0x10000, + NLM_CONNECTION_COST_CONGESTED = 0x20000, + NLM_CONNECTION_COST_ROAMING = 0x40000, + NLM_CONNECTION_COST_APPROACHINGDATALIMIT = 0x80000 +} NLM_CONNECTION_COST; + +typedef struct NLM_SOCKADDR +{ + BYTE data[128]; +} NLM_SOCKADDR; + +typedef struct NLM_USAGE_DATA +{ + DWORD UsageInMegabytes; + FILETIME LastSyncTime; +} NLM_USAGE_DATA; + +typedef struct NLM_DATAPLAN_STATUS +{ + GUID InterfaceGuid; + NLM_USAGE_DATA UsageData; + DWORD DataLimitInMegabytes; + DWORD InboundBandwidthInKbps; + DWORD OutboundBandwidthInKbps; + FILETIME NextBillingCycle; + DWORD MaxTransferSizeInMegabytes; + DWORD Reserved; +} NLM_DATAPLAN_STATUS; + +[ + object, + pointer_default(unique), + uuid(dcb00008-570f-4a9b-8d69-199fdba5723b) +] +interface INetworkCostManager : IUnknown +{ + HRESULT GetCost( + [out] DWORD *pCost, + [in, unique] NLM_SOCKADDR *pDestIPAddr); + + HRESULT GetDataPlanStatus( + [out] NLM_DATAPLAN_STATUS *pDataPlanStatus, + [in, unique] NLM_SOCKADDR *pDestIPAddr); + + HRESULT SetDestinationAddresses( + [in] UINT32 length, + [in, unique, size_is(length)] NLM_SOCKADDR *pDestIPAddrList, + [in] VARIANT_BOOL bAppend); +} + +[ + dual, + object, + oleautomation, + pointer_default(unique), + uuid(dcb00000-570f-4a9b-8d69-199fdba5723b) +] +interface INetworkListManager : IDispatch +{ + HRESULT GetNetworks( + [in] NLM_ENUM_NETWORK Flags, + [out, retval] IEnumNetworks **ppEnumNetwork); + + HRESULT GetNetwork( + [in] GUID gdNetworkId, + [out, retval] INetwork **ppNetwork); + + HRESULT GetNetworkConnections( + [out, retval] IEnumNetworkConnections **ppEnum); + + HRESULT GetNetworkConnection( + [in] GUID gdNetworkConnectionId, + [out, retval] INetworkConnection **ppNetworkConnection); + + HRESULT IsConnectedToInternet( + [out, retval] VARIANT_BOOL *pbIsConnected); + + HRESULT IsConnected( + [out, retval] VARIANT_BOOL *pbIsConnected); + + HRESULT GetConnectivity( + [out, retval] NLM_CONNECTIVITY *pConnectivity); +} + +[ + threading(both), + uuid(dcb00c01-570f-4a9b-8d69-199fdba5723b) +] +coclass NetworkListManager { interface INetworkListManager; } diff -Nru wine1.7-1.7.14/include/oleacc.idl wine1.7-1.7.18/include/oleacc.idl --- wine1.7-1.7.14/include/oleacc.idl 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/include/oleacc.idl 2014-05-02 18:15:48.000000000 +0000 @@ -270,7 +270,6 @@ } }; -cpp_quote("DEFINE_GUID(LIBID_Accessibility, 0x1ea4dbf0, 0x3c3b, 0x11cf, 0x81, 0x0c, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71);") cpp_quote("DEFINE_GUID(CLSID_AccPropServices, 0xb5f8350b, 0x0548, 0x48b1, 0xa6, 0xee, 0x88, 0xbd, 0x00, 0xb4, 0xa5, 0xe7);") cpp_quote("DEFINE_GUID(IIS_IsOleaccProxy, 0x902697fa, 0x80e4, 0x4560, 0x80, 0x2a, 0xa1, 0x3f, 0x22, 0xa6, 0x47, 0x09);") diff -Nru wine1.7-1.7.14/include/physicalmonitorenumerationapi.h wine1.7-1.7.18/include/physicalmonitorenumerationapi.h --- wine1.7-1.7.14/include/physicalmonitorenumerationapi.h 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.18/include/physicalmonitorenumerationapi.h 2014-05-02 18:15:48.000000000 +0000 @@ -0,0 +1,40 @@ +/* + * Copyright 2014 Michael Müller for Pipelight + * + * 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_PHYSICALMONITORENUMERATIONAPI_H +#define __WINE_PHYSICALMONITORENUMERATIONAPI_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define PHYSICAL_MONITOR_DESCRIPTION_SIZE 128 + +typedef struct _PHYSICAL_MONITOR +{ + HANDLE hPhysicalMonitor; + WCHAR szPhysicalMonitorDescription[PHYSICAL_MONITOR_DESCRIPTION_SIZE]; +} PHYSICAL_MONITOR, *LPPHYSICAL_MONITOR; + +#ifdef __cplusplus +} +#endif + +#endif /* __WINE_PHYSICALMONITORENUMERATIONAPI_H */ diff -Nru wine1.7-1.7.14/include/rpcndr.h wine1.7-1.7.18/include/rpcndr.h --- wine1.7-1.7.14/include/rpcndr.h 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/include/rpcndr.h 2014-05-02 18:15:48.000000000 +0000 @@ -37,6 +37,7 @@ # define CONST_VTBL #endif +#ifndef EXTERN_GUID #ifdef __cplusplus #define EXTERN_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ EXTERN_C const GUID DECLSPEC_SELECTANY name DECLSPEC_HIDDEN; \ @@ -48,6 +49,7 @@ const GUID DECLSPEC_SELECTANY name = \ { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } #endif +#endif /* stupid #if can't handle casts... this __stupidity is just a workaround for that limitation */ @@ -427,7 +429,7 @@ } MIDL_STUBLESS_PROXY_INFO, *PMIDL_STUBLESS_PROXY_INFO; -#if defined(__i386__) && !defined(__MSC_VER) && !defined(__MINGW32__) && !defined(__CYGWIN__) +#if defined(__i386__) && !defined(_MSC_VER) && !defined(__MINGW32__) && !defined(__CYGWIN__) /* Calling convention for returning structures/unions is different between Windows and gcc on i386 */ typedef LONG_PTR CLIENT_CALL_RETURN; #else diff -Nru wine1.7-1.7.14/include/stdole2.idl wine1.7-1.7.18/include/stdole2.idl --- wine1.7-1.7.14/include/stdole2.idl 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/include/stdole2.idl 2014-05-02 18:15:48.000000000 +0000 @@ -405,9 +405,9 @@ helpcontext(0x2775) ] HRESULT LoadPicture([in, optional] VARIANT filename, - [in, optional, defaultvalue(0)] int widthDesired, - [in, optional, defaultvalue(0)] int heightDesired, - [in, optional, defaultvalue(Default)] enum LoadPictureConstants flags, + [in, defaultvalue(0)] int widthDesired, + [in, defaultvalue(0)] int heightDesired, + [in, defaultvalue(Default)] enum LoadPictureConstants flags, [out, retval] IPictureDisp **retval); [ entry("OleSavePictureFile"), diff -Nru wine1.7-1.7.14/include/textserv.h wine1.7-1.7.18/include/textserv.h --- wine1.7-1.7.14/include/textserv.h 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/include/textserv.h 2014-05-02 18:15:48.000000000 +0000 @@ -112,7 +112,7 @@ STDMETHOD(TxSetText)( THIS_ LPCWSTR pszText) PURE; - STDMETHOD(TxGetCurrentTargetX)( THIS_ + STDMETHOD(TxGetCurTargetX)( THIS_ LONG* x) PURE; STDMETHOD(TxGetBaseLinePos)( THIS_ diff -Nru wine1.7-1.7.14/include/vfw.h wine1.7-1.7.18/include/vfw.h --- wine1.7-1.7.14/include/vfw.h 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/include/vfw.h 2014-05-02 18:15:48.000000000 +0000 @@ -1148,8 +1148,8 @@ STDMETHOD_(ULONG,AddRef)(THIS) PURE; STDMETHOD_(ULONG,Release)(THIS) PURE; /*** IAVIStreaming methods ***/ - STDMETHOD(Begin)(IAVIStreaming*iface,LONG lStart,LONG lEnd,LONG lRate) PURE; - STDMETHOD(End)(IAVIStreaming*iface) PURE; + STDMETHOD(Begin)(THIS_ LONG lStart,LONG lEnd,LONG lRate) PURE; + STDMETHOD(End)(THIS) PURE; }; #undef INTERFACE @@ -1174,11 +1174,11 @@ STDMETHOD_(ULONG,AddRef)(THIS) PURE; STDMETHOD_(ULONG,Release)(THIS) PURE; /*** IAVIEditStream methods ***/ - STDMETHOD(Cut)(IAVIEditStream*iface,LONG*plStart,LONG*plLength,PAVISTREAM*ppResult) PURE; - STDMETHOD(Copy)(IAVIEditStream*iface,LONG*plStart,LONG*plLength,PAVISTREAM*ppResult) PURE; - STDMETHOD(Paste)(IAVIEditStream*iface,LONG*plStart,LONG*plLength,PAVISTREAM pSource,LONG lStart,LONG lEnd) PURE; - STDMETHOD(Clone)(IAVIEditStream*iface,PAVISTREAM*ppResult) PURE; - STDMETHOD(SetInfo)(IAVIEditStream*iface,LPAVISTREAMINFOW asi, LONG size) PURE; + STDMETHOD(Cut)(THIS_ LONG *plStart,LONG *plLength,PAVISTREAM *ppResult) PURE; + STDMETHOD(Copy)(THIS_ LONG *plStart,LONG *plLength,PAVISTREAM *ppResult) PURE; + STDMETHOD(Paste)(THIS_ LONG *plStart,LONG *plLength,PAVISTREAM pSource,LONG lStart,LONG lEnd) PURE; + STDMETHOD(Clone)(THIS_ PAVISTREAM *ppResult) PURE; + STDMETHOD(SetInfo)(THIS_ LPAVISTREAMINFOW asi, LONG size) PURE; }; #undef INTERFACE diff -Nru wine1.7-1.7.14/include/wbemdisp.idl wine1.7-1.7.18/include/wbemdisp.idl --- wine1.7-1.7.14/include/wbemdisp.idl 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/include/wbemdisp.idl 2014-05-02 18:15:48.000000000 +0000 @@ -53,6 +53,85 @@ interface ISWbemSecurity; interface ISWbemServices; +typedef +[ + v1_enum, + uuid(bf078c2a-07d9-11d2-8b21-00600806d9b6) +] +enum WbemTimeout +{ + wbemTimeoutInfinite = 0xffffffff +} WbemTimeout; + +typedef +[ + v1_enum, + uuid(4a249b72-fc9a-11d1-8b1e-00600806d9b6) +] +enum WbemChangeFlagEnum +{ + wbemChangeFlagCreateOrUpdate = 0, + wbemChangeFlagUpdateOnly = 0x00000001, + wbemChangeFlagCreateOnly = 0x00000002, + wbemChangeFlagUpdateCompatible = 0x00000000, + wbemChangeFlagUpdateSafeMode = 0x00000020, + wbemChangeFlagUpdateForceMode = 0x00000040, + wbemChangeFlagStrongValidation = 0x00000080, + wbemChangeFlagAdvisory = 0x00010000 +} WbemChangeFlagEnum; + +typedef +[ + v1_enum, + uuid(4a249b73-fc9a-11d1-8b1e-00600806d9b6) +] +enum WbemFlagEnum +{ + wbemFlagReturnImmediately = 0x00010, + wbemFlagReturnWhenComplete = 0, + wbemFlagBidirectional = 0, + wbemFlagForwardOnly = 0x00020, + wbemFlagNoErrorObject = 0x00040, + wbemFlagReturnErrorObject = 0, + wbemFlagSendStatus = 0x00080, + wbemFlagDontSendStatus = 0, + wbemFlagEnsureLocatable = 0x00100, + wbemFlagDirectRead = 0x00200, + wbemFlagSendOnlySelected = 0, + wbemFlagUseAmendedQualifiers = 0x20000, + wbemFlagGetDefault = 0x0, + wbemFlagSpawnInstance = 0x00001, + wbemFlagUseCurrentTime = 0x00001 +} WbemFlagEnum; + +typedef +[ + v1_enum, + uuid(4a249b76-fc9a-11d1-8b1e-00600806d9b6) +] +enum WbemQueryFlagEnum +{ + wbemQueryFlagDeep, + wbemQueryFlagShallow, + wbemQueryFlagPrototype +} WbemQueryFlagEnum; + +typedef +[ + v1_enum, + uuid(4A249B79-FC9A-11d1-8B1E-00600806D9B6) +] +enum WbemComparisonFlagEnum +{ + wbemComparisonFlagIncludeAll = 0, + wbemComparisonFlagIgnoreQualifiers = 1, + wbemComparisonFlagIgnoreObjectSource = 2, + wbemComparisonFlagIgnoreDefaultValues = 4, + wbemComparisonFlagIgnoreClass = 8, + wbemComparisonFlagIgnoreCase = 16, + wbemComparisonFlagIgnoreFlavor = 32 +} WbemComparisonFlagEnum; + [ object, local, @@ -66,7 +145,7 @@ { [ id(1) ] HRESULT NextEvent( - [in] long iTimeoutMs, + [in, defaultvalue(wbemTimeoutInfinite)] long iTimeoutMs, [out, retval] ISWbemObject **objWbemObject); [ id(2), propget ] @@ -87,19 +166,18 @@ { [ id(1) ] HRESULT ConnectServer( - [in] BSTR strServer, - [in] BSTR strNamespace, - [in] BSTR strUser, - [in] BSTR strPassword, - [in] BSTR strLocale, - [in] BSTR strAuthority, - [in] long iSecurityFlags, - [in] IDispatch *objWbemNamedValueSet, + [in, defaultvalue(".")] BSTR strServer, + [in, defaultvalue("")] BSTR strNamespace, + [in, defaultvalue("")] BSTR strUser, + [in, defaultvalue("")] BSTR strPassword, + [in, defaultvalue("")] BSTR strLocale, + [in, defaultvalue("")] BSTR strAuthority, + [in, defaultvalue(0)] long iSecurityFlags, + [in, defaultvalue(0)] IDispatch *objWbemNamedValueSet, [out, retval] ISWbemServices **objWbemServices); [ id(2), propget ] - HRESULT Security_( - ISWbemSecurity **objWbemSecurity); + HRESULT Security_([out, retval] ISWbemSecurity **objWbemSecurity); }; [ @@ -153,7 +231,7 @@ [ id(DISPID_VALUE) ] HRESULT Item( [in] BSTR strName, - [in] long iFlags, + [in, defaultvalue(0)] long iFlags, [out, retval] ISWbemMethod **objWbemMethod); [ id(1), propget ] @@ -201,7 +279,7 @@ [ id(DISPID_VALUE) ] HRESULT Item( [in] BSTR strName, - [in] long iFlags, + [in, defaultvalue(0)] long iFlags, [out, retval] ISWbemNamedValue **objWbemNamedValue); [ id(1), propget ] @@ -212,13 +290,13 @@ HRESULT Add( [in] BSTR strName, [in] VARIANT *varValue, - [in] long iFlags, + [in, defaultvalue(0)] long iFlags, [out, retval] ISWbemNamedValue **objWbemNamedValue); [ id(3) ] HRESULT Remove( [in] BSTR strName, - [in] long iFlags); + [in, defaultvalue(0)] long iFlags); [ id(4) ] HRESULT Clone( @@ -240,123 +318,123 @@ { [ id(1) ] HRESULT Put_( - [in] long iFlags, - [in] IDispatch *objWbemNamedValueSet, + [in, defaultvalue(wbemChangeFlagCreateOrUpdate)] long iFlags, + [in, defaultvalue(0)] IDispatch *objWbemNamedValueSet, [out, retval] ISWbemObjectPath **objWbemObjectPath); [ id(2) ] HRESULT PutAsync_( [in] IDispatch *objWbemSink, - [in] long iFlags, - [in] IDispatch *objWbemNamedValueSet, - [in] IDispatch *objWbemAsyncContext); + [in, defaultvalue(wbemChangeFlagCreateOrUpdate)] long iFlags, + [in, defaultvalue(0)] IDispatch *objWbemNamedValueSet, + [in, defaultvalue(0)] IDispatch *objWbemAsyncContext); [ id (3) ] HRESULT Delete_( - [in] long iFlags, - [in] IDispatch *objWbemNamedValueSet); + [in, defaultvalue(0)] long iFlags, + [in, defaultvalue(0)] IDispatch *objWbemNamedValueSet); [ id (4) ] HRESULT DeleteAsync_( [in] IDispatch *objWbemSink, - [in] long iFlags, - [in] IDispatch *objWbemNamedValueSet, - [in] IDispatch *objWbemAsyncContext); + [in, defaultvalue(0)] long iFlags, + [in, defaultvalue(0)] IDispatch *objWbemNamedValueSet, + [in, defaultvalue(0)] IDispatch *objWbemAsyncContext); [ id(5) ] HRESULT Instances_( - [in] long iFlags, - [in] IDispatch *objWbemNamedValueSet, + [in, defaultvalue(wbemFlagReturnImmediately)] long iFlags, + [in, defaultvalue(0)] IDispatch *objWbemNamedValueSet, [out, retval] ISWbemObjectSet **objWbemObjectSet); [ id(6) ] HRESULT InstancesAsync_( [in] IDispatch *objWbemSink, - [in] long iFlags, - [in] IDispatch *objWbemNamedValueSet, - [in] IDispatch *objWbemAsyncContext); + [in, defaultvalue(0)] long iFlags, + [in, defaultvalue(0)] IDispatch *objWbemNamedValueSet, + [in, defaultvalue(0)] IDispatch *objWbemAsyncContext); [ id(7) ] HRESULT Subclasses_( - [in] long iFlags, - [in] IDispatch *objWbemNamedValueSet, + [in, defaultvalue(wbemFlagReturnImmediately|wbemQueryFlagDeep)] long iFlags, + [in, defaultvalue(0)] IDispatch *objWbemNamedValueSet, [out, retval] ISWbemObjectSet **objWbemObjectSet); [ id(8) ] HRESULT SubclassesAsync_( [in] IDispatch *objWbemSink, - [in] long iFlags, - [in] IDispatch *objWbemNamedValueSet, - [in] IDispatch *objWbemAsyncContext); + [in, defaultvalue(wbemQueryFlagDeep)] long iFlags, + [in, defaultvalue(0)] IDispatch *objWbemNamedValueSet, + [in, defaultvalue(0)] IDispatch *objWbemAsyncContext); [ id(9) ] HRESULT Associators_( - [in] BSTR strAssocClass, - [in] BSTR strResultClass, - [in] BSTR strResultRole, - [in] BSTR strRole, - [in] VARIANT_BOOL bClassesOnly, - [in] VARIANT_BOOL bSchemaOnly, - [in] BSTR strRequiredAssocQualifier, - [in] BSTR strRequiredQualifier, - [in] long iFlags, - [in] IDispatch *objWbemNamedValueSet, + [in, defaultvalue("")] BSTR strAssocClass, + [in, defaultvalue("")] BSTR strResultClass, + [in, defaultvalue("")] BSTR strResultRole, + [in, defaultvalue("")] BSTR strRole, + [in, defaultvalue(FALSE)] VARIANT_BOOL bClassesOnly, + [in, defaultvalue(FALSE)] VARIANT_BOOL bSchemaOnly, + [in, defaultvalue("")] BSTR strRequiredAssocQualifier, + [in, defaultvalue("")] BSTR strRequiredQualifier, + [in, defaultvalue(wbemFlagReturnImmediately)] long iFlags, + [in, defaultvalue(0)] IDispatch *objWbemNamedValueSet, [out, retval] ISWbemObjectSet **objWbemObjectSet); [ id(10) ] HRESULT AssociatorsAsync_( [in] IDispatch *objWbemSink, - [in] BSTR strAssocClass, - [in] BSTR strResultClass, - [in] BSTR strResultRole, - [in] BSTR strRole, - [in] VARIANT_BOOL bClassesOnly, - [in] VARIANT_BOOL bSchemaOnly, - [in] BSTR strRequiredAssocQualifier, - [in] BSTR strRequiredQualifier, - [in] long iFlags, - [in] IDispatch *objWbemNamedValueSet, - [in] IDispatch *objWbemAsyncContext); + [in, defaultvalue("")] BSTR strAssocClass, + [in, defaultvalue("")] BSTR strResultClass, + [in, defaultvalue("")] BSTR strResultRole, + [in, defaultvalue("")] BSTR strRole, + [in, defaultvalue(FALSE)] VARIANT_BOOL bClassesOnly, + [in, defaultvalue(FALSE)] VARIANT_BOOL bSchemaOnly, + [in, defaultvalue("")] BSTR strRequiredAssocQualifier, + [in, defaultvalue("")] BSTR strRequiredQualifier, + [in, defaultvalue(0)] long iFlags, + [in, defaultvalue(0)] IDispatch *objWbemNamedValueSet, + [in, defaultvalue(0)] IDispatch *objWbemAsyncContext); [ id(11) ] HRESULT References_( - [in] BSTR strResultClass, - [in] BSTR strRole, - [in] VARIANT_BOOL bClassesOnly, - [in] VARIANT_BOOL bSchemaOnly, - [in] BSTR strRequiredQualifier, - [in] long iFlags, - [in] IDispatch *objWbemNamedValueSet, + [in, defaultvalue("")] BSTR strResultClass, + [in, defaultvalue("")] BSTR strRole, + [in, defaultvalue(FALSE)] VARIANT_BOOL bClassesOnly, + [in, defaultvalue(FALSE)] VARIANT_BOOL bSchemaOnly, + [in, defaultvalue("")] BSTR strRequiredQualifier, + [in, defaultvalue(wbemFlagReturnImmediately)] long iFlags, + [in, defaultvalue(0)] IDispatch *objWbemNamedValueSet, [out, retval] ISWbemObjectSet **objWbemObjectSet); [ id(12) ] HRESULT ReferencesAsync_( [in] IDispatch *objWbemSink, - [in] BSTR strResultClass, - [in] BSTR strRole, - [in] VARIANT_BOOL bClassesOnly, - [in] VARIANT_BOOL bSchemaOnly, - [in] BSTR strRequiredQualifier, - [in] long iFlags, - [in] IDispatch *objWbemNamedValueSet, - [in] IDispatch *objWbemAsyncContext); + [in, defaultvalue("")] BSTR strResultClass, + [in, defaultvalue("")] BSTR strRole, + [in, defaultvalue(FALSE)] VARIANT_BOOL bClassesOnly, + [in, defaultvalue(FALSE)] VARIANT_BOOL bSchemaOnly, + [in, defaultvalue("")] BSTR strRequiredQualifier, + [in, defaultvalue(0)] long iFlags, + [in, defaultvalue(0)] IDispatch *objWbemNamedValueSet, + [in, defaultvalue(0)] IDispatch *objWbemAsyncContext); [ id(13) ] HRESULT ExecMethod_( [in] BSTR strMethodName, - [in] IDispatch *objWbemInParameters, - [in] long iFlags, - [in] IDispatch *objWbemNamedValueSet, + [in, defaultvalue(0)] IDispatch *objWbemInParameters, + [in, defaultvalue(0)] long iFlags, + [in, defaultvalue(0)] IDispatch *objWbemNamedValueSet, [out, retval] ISWbemObject **objWbemOutParameters); [ id(14) ] HRESULT ExecMethodAsync_( [in] IDispatch *objWbemSink, [in] BSTR strMethodName, - [in] IDispatch *objWbemInParameters, - [in] long iFlags, - [in] IDispatch *objWbemNamedValueSet, - [in] IDispatch *objWbemAsyncContext); + [in, defaultvalue(0)] IDispatch *objWbemInParameters, + [in, defaultvalue(0)] long iFlags, + [in, defaultvalue(0)] IDispatch *objWbemNamedValueSet, + [in, defaultvalue(0)] IDispatch *objWbemAsyncContext); [ id(15) ] HRESULT Clone_( @@ -364,23 +442,23 @@ [ id(16) ] HRESULT GetObjectText_( - [in] long iFlags, + [in, defaultvalue(0)] long iFlags, [out, retval] BSTR *strObjectText); [ id(17) ] HRESULT SpawnDerivedClass_( - [in] long iFlags, + [in, defaultvalue(0)] long iFlags, [out, retval] ISWbemObject **objWbemObject); [ id(18) ] HRESULT SpawnInstance_( - [in] long iFlags, + [in, defaultvalue(0)] long iFlags, [out, retval] ISWbemObject **objWbemObject); [ id(19) ] HRESULT CompareTo_( [in] IDispatch *objWbemObject, - [in] long iFlags, + [in, defaultvalue(wbemComparisonFlagIncludeAll)] long iFlags, [out, retval] VARIANT_BOOL *bResult); [ id(20), propget ] @@ -528,7 +606,7 @@ [ id(DISPID_VALUE) ] HRESULT Item( [in] BSTR strObjectPath, - [in] long iFlags, + [in, defaultvalue(0)] long iFlags, [out, retval] ISWbemObject **objWbemObject); [ id(1), propget ] @@ -640,7 +718,7 @@ [ id(2) ] HRESULT Add( [in] WbemPrivilegeEnum iPrivilege, - [in] VARIANT_BOOL bIsEnabled, + [in, defaultvalue(TRUE)] VARIANT_BOOL bIsEnabled, [out, retval] ISWbemPrivilege **objWbemPrivilege); [ id(3) ] @@ -653,7 +731,7 @@ [ id(5) ] HRESULT AddAsString( [in] BSTR strPrivilege, - [in] VARIANT_BOOL bIsEnabled, + [in, defaultvalue(TRUE)] VARIANT_BOOL bIsEnabled, [out, retval] ISWbemPrivilege **objWbemPrivilege); }; @@ -743,7 +821,7 @@ [ id(DISPID_VALUE) ] HRESULT Item( [in] BSTR strName, - [in] long iFlags, + [in, defaultvalue(0)] long iFlags, [out, retval] ISWbemProperty **objWbemProperty); [ id(1), propget ] @@ -754,14 +832,14 @@ HRESULT Add( [in] BSTR strName, [in] WbemCimtypeEnum iCIMType, - [in] VARIANT_BOOL bIsArray, - [in] long iFlags, + [in, defaultvalue(FALSE)] VARIANT_BOOL bIsArray, + [in, defaultvalue(0)] long iFlags, [out, retval] ISWbemProperty **objWbemProperty); [ id(3) ] HRESULT Remove( [in] BSTR strName, - [in] long iFlags); + [in, defaultvalue(0)] long iFlags); }; [ @@ -839,7 +917,7 @@ [ id(DISPID_VALUE) ] HRESULT Item( [in] BSTR name, - [in] long iFlags, + [in, defaultvalue(0)] long iFlags, [out, retval] ISWbemQualifier **objWbemQualifier); [ id(1), propget ] @@ -850,16 +928,16 @@ HRESULT Add( [in] BSTR strName, [in] VARIANT *varVal, - [in] VARIANT_BOOL bPropagatesToSubclass, - [in] VARIANT_BOOL bPropagatesToInstance, - [in] VARIANT_BOOL bIsOverridable, - [in] long iFlags, + [in, defaultvalue(TRUE)] VARIANT_BOOL bPropagatesToSubclass, + [in, defaultvalue(TRUE)] VARIANT_BOOL bPropagatesToInstance, + [in, defaultvalue(TRUE)] VARIANT_BOOL bIsOverridable, + [in, defaultvalue(0)] long iFlags, [out, retval] ISWbemQualifier **objWbemQualifier); [ id(3) ] HRESULT Remove( [in] BSTR strName, - [in] long iFlags); + [in, defaultvalue(0)] long iFlags); }; typedef @@ -936,160 +1014,160 @@ { [ id(1) ] HRESULT Get( - [in] BSTR strObjectPath, - [in] long iFlags, - [in] IDispatch *objWbemNamedValueSet, + [in, defaultvalue("")] BSTR strObjectPath, + [in, defaultvalue(0)] long iFlags, + [in, defaultvalue(0)] IDispatch *objWbemNamedValueSet, [out, retval] ISWbemObject **objWbemObject); [ id(2) ] HRESULT GetAsync( [in] IDispatch *objWbemSink, - [in] BSTR strObjectPath, - [in] long iFlags, - [in] IDispatch *objWbemNamedValueSet, - [in] IDispatch *objWbemAsyncContext); + [in, defaultvalue("")] BSTR strObjectPath, + [in, defaultvalue(0)] long iFlags, + [in, defaultvalue(0)] IDispatch *objWbemNamedValueSet, + [in, defaultvalue(0)] IDispatch *objWbemAsyncContext); [ id(3) ] HRESULT Delete( [in] BSTR strObjectPath, - [in] long iFlags, - [in] IDispatch *objWbemNamedValueSet); + [in, defaultvalue(0)] long iFlags, + [in, defaultvalue(0)] IDispatch *objWbemNamedValueSet); [ id(4) ] HRESULT DeleteAsync( [in] IDispatch *objWbemSink, [in] BSTR strObjectPath, - [in] long iFlags, - [in] IDispatch *objWbemNamedValueSet, - [in] IDispatch *objWbemAsyncContext); + [in, defaultvalue(0)] long iFlags, + [in, defaultvalue(0)] IDispatch *objWbemNamedValueSet, + [in, defaultvalue(0)] IDispatch *objWbemAsyncContext); [ id(5) ] HRESULT InstancesOf( [in] BSTR strClass, - [in] long iFlags, - [in] IDispatch *objWbemNamedValueSet, + [in, defaultvalue(wbemFlagReturnImmediately)] long iFlags, + [in, defaultvalue(0)] IDispatch *objWbemNamedValueSet, [out, retval] ISWbemObjectSet **objWbemObjectSet); [ id(6) ] HRESULT InstancesOfAsync( [in] IDispatch *objWbemSink, [in] BSTR strClass, - [in] long iFlags, - [in] IDispatch *objWbemNamedValueSet, - [in] IDispatch *objWbemAsyncContext); + [in, defaultvalue(0)] long iFlags, + [in, defaultvalue(0)] IDispatch *objWbemNamedValueSet, + [in, defaultvalue(0)] IDispatch *objWbemAsyncContext); [ id(7) ] HRESULT SubclassesOf( - [in] BSTR strSuperclass, - [in] long iFlags, - [in] IDispatch *objWbemNamedValueSet, + [in, defaultvalue("")] BSTR strSuperclass, + [in, defaultvalue(wbemFlagReturnImmediately|wbemQueryFlagDeep)] long iFlags, + [in, defaultvalue(0)] IDispatch *objWbemNamedValueSet, [out, retval] ISWbemObjectSet **objWbemObjectSet); [ id(8) ] HRESULT SubclassesOfAsync( [in] IDispatch *objWbemSink, - [in] BSTR strSuperclass, - [in] long iFlags, - [in] IDispatch *objWbemNamedValueSet, - [in] IDispatch *objWbemAsyncContext); + [in, defaultvalue("")] BSTR strSuperclass, + [in, defaultvalue(wbemQueryFlagDeep)] long iFlags, + [in, defaultvalue(0)] IDispatch *objWbemNamedValueSet, + [in, defaultvalue(0)] IDispatch *objWbemAsyncContext); [ id(9) ] HRESULT ExecQuery( [in] BSTR strQuery, - [in] BSTR strQueryLanguage, - [in] long iFlags, - [in] IDispatch *objWbemNamedValueSet, + [in, defaultvalue("WQL")] BSTR strQueryLanguage, + [in, defaultvalue(wbemFlagReturnImmediately)] long iFlags, + [in, defaultvalue(0)] IDispatch *objWbemNamedValueSet, [out, retval] ISWbemObjectSet **objWbemObjectSet); [ id(10) ] HRESULT ExecQueryAsync( [in] IDispatch *objWbemSink, [in] BSTR strQuery, - [in] BSTR strQueryLanguage, - [in] long lFlags, - [in] IDispatch *objWbemNamedValueSet, - [in] IDispatch *objWbemAsyncContext); + [in, defaultvalue("WQL")] BSTR strQueryLanguage, + [in, defaultvalue(0)] long lFlags, + [in, defaultvalue(0)] IDispatch *objWbemNamedValueSet, + [in, defaultvalue(0)] IDispatch *objWbemAsyncContext); [ id(11) ] HRESULT AssociatorsOf( [in] BSTR strObjectPath, - [in] BSTR strAssocClass, - [in] BSTR strResultClass, - [in] BSTR strResultRole, - [in] BSTR strRole, - [in] VARIANT_BOOL bClassesOnly, - [in] VARIANT_BOOL bSchemaOnly, - [in] BSTR strRequiredAssocQualifier, - [in] BSTR strRequiredQualifier, - [in] long iFlags, - [in] IDispatch *objWbemNamedValueSet, + [in, defaultvalue("")] BSTR strAssocClass, + [in, defaultvalue("")] BSTR strResultClass, + [in, defaultvalue("")] BSTR strResultRole, + [in, defaultvalue("")] BSTR strRole, + [in, defaultvalue(FALSE)] VARIANT_BOOL bClassesOnly, + [in, defaultvalue(FALSE)] VARIANT_BOOL bSchemaOnly, + [in, defaultvalue("")] BSTR strRequiredAssocQualifier, + [in, defaultvalue("")] BSTR strRequiredQualifier, + [in, defaultvalue(wbemFlagReturnImmediately)] long iFlags, + [in, defaultvalue(0)] IDispatch *objWbemNamedValueSet, [out, retval] ISWbemObjectSet **objWbemObjectSet); [ id(12) ] HRESULT AssociatorsOfAsync( [in] IDispatch *objWbemSink, [in] BSTR strObjectPath, - [in] BSTR strAssocClass, - [in] BSTR strResultClass, - [in] BSTR strResultRole, - [in] BSTR strRole, - [in] VARIANT_BOOL bClassesOnly, - [in] VARIANT_BOOL bSchemaOnly, - [in] BSTR strRequiredAssocQualifier, - [in] BSTR strRequiredQualifier, - [in] long iFlags, - [in] IDispatch *objWbemNamedValueSet, - [in] IDispatch *objWbemAsyncContext); + [in, defaultvalue("")] BSTR strAssocClass, + [in, defaultvalue("")] BSTR strResultClass, + [in, defaultvalue("")] BSTR strResultRole, + [in, defaultvalue("")] BSTR strRole, + [in, defaultvalue(FALSE)] VARIANT_BOOL bClassesOnly, + [in, defaultvalue(FALSE)] VARIANT_BOOL bSchemaOnly, + [in, defaultvalue("")] BSTR strRequiredAssocQualifier, + [in, defaultvalue("")] BSTR strRequiredQualifier, + [in, defaultvalue(0)] long iFlags, + [in, defaultvalue(0)] IDispatch *objWbemNamedValueSet, + [in, defaultvalue(0)] IDispatch *objWbemAsyncContext); [ id(13) ] HRESULT ReferencesTo( [in] BSTR strObjectPath, - [in] BSTR strResultClass, - [in] BSTR strRole, - [in] VARIANT_BOOL bClassesOnly, - [in] VARIANT_BOOL bSchemaOnly, - [in] BSTR strRequiredQualifier, - [in] long iFlags, - [in] IDispatch *objWbemNamedValueSet, + [in, defaultvalue("")] BSTR strResultClass, + [in, defaultvalue("")] BSTR strRole, + [in, defaultvalue(FALSE)] VARIANT_BOOL bClassesOnly, + [in, defaultvalue(FALSE)] VARIANT_BOOL bSchemaOnly, + [in, defaultvalue("")] BSTR strRequiredQualifier, + [in, defaultvalue(wbemFlagReturnImmediately)] long iFlags, + [in, defaultvalue(0)] IDispatch *objWbemNamedValueSet, [out, retval] ISWbemObjectSet **objWbemObjectSet); [ id(14) ] HRESULT ReferencesToAsync( [in] IDispatch *objWbemSink, [in] BSTR strObjectPath, - [in] BSTR strResultClass, - [in] BSTR strRole, - [in] VARIANT_BOOL bClassesOnly, - [in] VARIANT_BOOL bSchemaOnly, - [in] BSTR strRequiredQualifier, - [in] long iFlags, - [in] IDispatch *objWbemNamedValueSet, - [in] IDispatch *objWbemAsyncContext); + [in, defaultvalue("")] BSTR strResultClass, + [in, defaultvalue("")] BSTR strRole, + [in, defaultvalue(FALSE)] VARIANT_BOOL bClassesOnly, + [in, defaultvalue(FALSE)] VARIANT_BOOL bSchemaOnly, + [in, defaultvalue("")] BSTR strRequiredQualifier, + [in, defaultvalue(0)] long iFlags, + [in, defaultvalue(0)] IDispatch *objWbemNamedValueSet, + [in, defaultvalue(0)] IDispatch *objWbemAsyncContext); [ id(15) ] HRESULT ExecNotificationQuery( [in] BSTR strQuery, - [in] BSTR strQueryLanguage, - [in] long iFlags, - [in] IDispatch *objWbemNamedValueSet, + [in, defaultvalue("WQL")] BSTR strQueryLanguage, + [in, defaultvalue(wbemFlagReturnImmediately|wbemFlagForwardOnly)] long iFlags, + [in, defaultvalue(0)] IDispatch *objWbemNamedValueSet, [out, retval] ISWbemEventSource **objWbemEventSource); [ id(16) ] HRESULT ExecNotificationQueryAsync( [in] IDispatch *objWbemSink, [in] BSTR strQuery, - [in] BSTR strQueryLanguage, - [in] long iFlags, - [in] IDispatch *objWbemNamedValueSet, - [in] IDispatch *objWbemAsyncContext); + [in, defaultvalue("WQL")] BSTR strQueryLanguage, + [in, defaultvalue(0)] long iFlags, + [in, defaultvalue(0)] IDispatch *objWbemNamedValueSet, + [in, defaultvalue(0)] IDispatch *objWbemAsyncContext); [ id(17) ] HRESULT ExecMethod( [in] BSTR strObjectPath, [in] BSTR strMethodName, - [in] IDispatch *objWbemInParameters, - [in] long iFlags, - [in] IDispatch *objWbemNamedValueSet, + [in, defaultvalue(0)] IDispatch *objWbemInParameters, + [in, defaultvalue(0)] long iFlags, + [in, defaultvalue(0)] IDispatch *objWbemNamedValueSet, [out, retval] ISWbemObject **objWbemOutParameters); [ id(18) ] @@ -1097,10 +1175,10 @@ [in] IDispatch *objWbemSink, [in] BSTR strObjectPath, [in] BSTR strMethodName, - [in] IDispatch *objWbemInParameters, - [in] long iFlags, - [in] IDispatch *objWbemNamedValueSet, - [in] IDispatch *objWbemAsyncContext); + [in, defaultvalue(0)] IDispatch *objWbemInParameters, + [in, defaultvalue(0)] long iFlags, + [in, defaultvalue(0)] IDispatch *objWbemNamedValueSet, + [in, defaultvalue(0)] IDispatch *objWbemAsyncContext); [ id(19), propget ] HRESULT Security_( diff -Nru wine1.7-1.7.14/include/werapi.h wine1.7-1.7.18/include/werapi.h --- wine1.7-1.7.14/include/werapi.h 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/include/werapi.h 2014-05-02 18:15:48.000000000 +0000 @@ -175,6 +175,8 @@ HRESULT WINAPI WerAddExcludedApplication(PCWSTR, BOOL); HRESULT WINAPI WerRegisterFile(PCWSTR file, WER_REGISTER_FILE_TYPE regfiletype, DWORD flags); +HRESULT WINAPI WerRegisterMemoryBlock(void *block, DWORD size); +HRESULT WINAPI WerRegisterRuntimeExceptionModule(PCWSTR callbackdll, void *context); HRESULT WINAPI WerRemoveExcludedApplication(PCWSTR, BOOL); HRESULT WINAPI WerReportAddFile(HREPORT, PCWSTR, WER_FILE_TYPE, DWORD); HRESULT WINAPI WerReportCloseHandle(HREPORT); @@ -182,6 +184,8 @@ HRESULT WINAPI WerReportSetParameter(HREPORT, DWORD, PCWSTR, PCWSTR); HRESULT WINAPI WerReportSetUIOption(HREPORT, WER_REPORT_UI, PCWSTR); HRESULT WINAPI WerReportSubmit(HREPORT, WER_CONSENT, DWORD, PWER_SUBMIT_RESULT); +HRESULT WINAPI WerSetFlags(DWORD flags); +HRESULT WINAPI WerUnregisterMemoryBlock(void *block); #ifdef __cplusplus } diff -Nru wine1.7-1.7.14/include/winbase.h wine1.7-1.7.18/include/winbase.h --- wine1.7-1.7.14/include/winbase.h 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/include/winbase.h 2014-05-02 18:15:48.000000000 +0000 @@ -1512,6 +1512,23 @@ /* initialization callback prototype */ typedef BOOL (WINAPI *PINIT_ONCE_FN)(PINIT_ONCE,PVOID,PVOID*); +typedef struct _REASON_CONTEXT +{ + ULONG Version; + DWORD Flags; + union + { + struct + { + HMODULE LocalizedReasonModule; + ULONG LocalizedReasonId; + ULONG ReasonStringCount; + LPWSTR *ReasonStrings; + } Detailed; + LPWSTR SimpleReasonString; + } Reason; +} REASON_CONTEXT, *PREASON_CONTEXT; + WINBASEAPI BOOL WINAPI ActivateActCtx(HANDLE,ULONG_PTR *); WINADVAPI BOOL WINAPI AddAccessAllowedAce(PACL,DWORD,DWORD,PSID); WINADVAPI BOOL WINAPI AddAccessAllowedAceEx(PACL,DWORD,DWORD,DWORD,PSID); @@ -2363,6 +2380,7 @@ WINBASEAPI BOOL WINAPI SetVolumeMountPointW(LPCSTR,LPCSTR); #define SetVolumeMountPoint WINELIB_NAME_AW(SetVolumeMountPoint) WINBASEAPI BOOL WINAPI SetWaitableTimer(HANDLE,const LARGE_INTEGER*,LONG,PTIMERAPCROUTINE,LPVOID,BOOL); +WINBASEAPI BOOL WINAPI SetWaitableTimerEx(HANDLE,const LARGE_INTEGER*,LONG,PTIMERAPCROUTINE,LPVOID,REASON_CONTEXT*,ULONG); WINBASEAPI BOOL WINAPI SetupComm(HANDLE,DWORD,DWORD); WINBASEAPI DWORD WINAPI SignalObjectAndWait(HANDLE,HANDLE,DWORD,BOOL); WINBASEAPI DWORD WINAPI SizeofResource(HMODULE,HRSRC); diff -Nru wine1.7-1.7.14/include/wine/schrpc.idl wine1.7-1.7.18/include/wine/schrpc.idl --- wine1.7-1.7.14/include/wine/schrpc.idl 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.18/include/wine/schrpc.idl 2014-05-02 18:15:48.000000000 +0000 @@ -0,0 +1,101 @@ +/* + * Task Scheduler Service definitions + * + * Copyright 2014 Dmitry Timoshkov + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +cpp_quote("#define SCHEDSVC_TRANSPORT {'n','c','a','l','r','p','c',0}") +cpp_quote("#define SCH_FLAG_STATE 0x10000000") + +import "oaidl.idl"; +import "ocidl.idl"; + +[ + uuid(86d35949-83c9-4044-b424-db363231fd0c), + implicit_handle(handle_t rpc_handle), + version(1.0), + pointer_default(unique) +] +interface ITaskSchedulerService +{ + typedef struct _TASK_USER_CRED + { + [string] const WCHAR *user; + [string] const WCHAR *password; + DWORD flags; + } TASK_USER_CRED; + + typedef struct _TASK_XML_ERROR_INFO + { + DWORD line, column; + [string] WCHAR *node; + [string] WCHAR *value; + } TASK_XML_ERROR_INFO; + + typedef [string] WCHAR **TASK_NAMES; + + HRESULT SchRpcHighestVersion([out] DWORD *version); + HRESULT SchRpcRegisterTask([in, string, unique] const WCHAR *path, + [in, string] const WCHAR *xml, [in] DWORD flags, + [in, string, unique] const WCHAR *sddl, + [in] DWORD task_logon_type, [in] DWORD n_creds, + [in, size_is(n_creds), unique] const TASK_USER_CRED *creds, + [out, string] WCHAR **actual_path, + [out] TASK_XML_ERROR_INFO **xml_error_info); + HRESULT SchRpcRetrieveTask([in, string] const WCHAR *path, + [in, string] const WCHAR *languages, + [in] unsigned long *n_languages, [out, string] WCHAR **xml); + HRESULT SchRpcCreateFolder([in, string] const WCHAR *path, + [in, string, unique] const WCHAR *sddl, [in] DWORD flags); + HRESULT SchRpcSetSecurity([in, string] const WCHAR *path, + [in, string] const WCHAR *sddl, [in] DWORD flags); + HRESULT SchRpcGetSecurity([in, string] const WCHAR *path, + [in] DWORD flags, [out, string] WCHAR **sddl); + HRESULT SchRpcEnumFolders([in, string] const WCHAR *path, + [in] DWORD flags, [in, out] DWORD *start_index, + [in] DWORD n_requested, [out] DWORD *n_names, + [out, string, size_is(,*n_names)] TASK_NAMES *names); + HRESULT SchRpcEnumTasks([in, string] const WCHAR *path, + [in] DWORD flags, [in, out] DWORD *start_index, + [in] DWORD n_requested, [out] DWORD *n_names, + [out, string, size_is(,*n_names)] TASK_NAMES *names); + HRESULT SchRpcEnumInstances([in, string, unique] const WCHAR *path, + [in] DWORD flags, [out] DWORD *n_guids, + [out, size_is(,*n_guids)] GUID **guids); + HRESULT SchRpcGetInstanceInfo([in] GUID guid, [out, string] WCHAR **path, + [out] DWORD *task_state, [out, string] WCHAR **action, + [out, string] WCHAR **info, [out] DWORD *n_instances, + [out, size_is(,*n_instances)] GUID **instances, [out] DWORD *pid); + HRESULT SchRpcStopInstance([in] GUID guid, [in] DWORD flags); + HRESULT SchRpcStop([in, string, unique] const WCHAR *path, [in] DWORD flags); + HRESULT SchRpcRun([in, string] const WCHAR *path, + [in] DWORD n_args, [in, size_is(n_args),unique] const WCHAR **args, + [in] DWORD flags, [in] DWORD session_id, + [in, unique, string] const WCHAR *user, [out] GUID *guid); + HRESULT SchRpcDelete([in, string] const WCHAR *path, [in] DWORD flags); + HRESULT SchRpcRename([in, string] const WCHAR *path, [in, string] const WCHAR *name, [in] DWORD flags); + HRESULT SchRpcScheduledRuntimes([in, string] const WCHAR *path, + [in, unique] SYSTEMTIME *start, [in, unique] SYSTEMTIME *end, + [in] DWORD flags, [in] DWORD n_requested, [out] DWORD *n_runtimes, + [out, size_is(,*n_runtimes)] SYSTEMTIME **runtimes); + HRESULT SchRpcGetLastRunInfo([in, string] const WCHAR *path, + [out] SYSTEMTIME *last_runtime, [out] DWORD *last_return_code); + HRESULT SchRpcGetTaskInfo([in, string] const WCHAR *path, [in] DWORD flags, + [out] DWORD *enabled, [out] DWORD *task_state); + HRESULT SchRpcGetNumberOfMissedRuns([in, string] const WCHAR *path, [out] DWORD *runs); + HRESULT SchRpcEnableTask([in, string] const WCHAR *path, [in] DWORD enabled); +} diff -Nru wine1.7-1.7.14/include/wine/wined3d.h wine1.7-1.7.18/include/wine/wined3d.h --- wine1.7-1.7.14/include/wine/wined3d.h 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/include/wine/wined3d.h 2014-05-02 18:15:48.000000000 +0000 @@ -26,6 +26,8 @@ #ifndef __WINE_WINED3D_H #define __WINE_WINED3D_H +#include "wine/list.h" + #define WINED3D_OK S_OK #define _FACWINED3D 0x876 @@ -708,6 +710,12 @@ WINED3D_QUERY_TYPE_CACHE_UTILIZATION = 18 }; +struct wined3d_query_data_timestamp_disjoint +{ + UINT64 frequency; + BOOL disjoint; +}; + #define WINED3DISSUE_BEGIN (1 << 1) #define WINED3DISSUE_END (1 << 0) #define WINED3DGETDATA_FLUSH (1 << 0) @@ -1983,11 +1991,32 @@ struct wined3d_swapchain_desc *desc, struct wined3d_swapchain **swapchain); }; +struct wined3d_private_store +{ + struct list content; +}; + +struct wined3d_private_data +{ + struct list entry; + + GUID tag; + DWORD flags; /* DDSPD_* */ + DWORD size; + union + { + BYTE data[1]; + IUnknown *object; + } content; +}; + typedef HRESULT (CDECL *wined3d_device_reset_cb)(struct wined3d_resource *resource); void __stdcall wined3d_mutex_lock(void); void __stdcall wined3d_mutex_unlock(void); +UINT __cdecl wined3d_calculate_format_pitch(const struct wined3d *wined3d, UINT adapter_idx, + enum wined3d_format_id format_id, UINT width); HRESULT __cdecl wined3d_check_depth_stencil_match(const struct wined3d *wined3d, UINT adapter_idx, enum wined3d_device_type device_type, enum wined3d_format_id adapter_format_id, enum wined3d_format_id render_target_format_id, enum wined3d_format_id depth_stencil_format_id); @@ -2003,7 +2032,7 @@ HRESULT __cdecl wined3d_check_device_type(const struct wined3d *wined3d, UINT adapter_idx, enum wined3d_device_type device_type, enum wined3d_format_id display_format_id, enum wined3d_format_id backbuffer_format_id, BOOL windowed); -struct wined3d * __cdecl wined3d_create(UINT version, DWORD flags); +struct wined3d * __cdecl wined3d_create(DWORD flags); ULONG __cdecl wined3d_decref(struct wined3d *wined3d); HRESULT __cdecl wined3d_enum_adapter_modes(const struct wined3d *wined3d, UINT adapter_idx, enum wined3d_format_id format_id, enum wined3d_scanline_ordering scanline_ordering, @@ -2245,15 +2274,84 @@ ULONG __cdecl wined3d_query_incref(struct wined3d_query *query); HRESULT __cdecl wined3d_query_issue(struct wined3d_query *query, DWORD flags); -HRESULT __cdecl wined3d_resource_free_private_data(struct wined3d_resource *resource, REFGUID guid); +static inline void wined3d_private_store_init(struct wined3d_private_store *store) +{ + list_init(&store->content); +} + +static inline struct wined3d_private_data *wined3d_private_store_get_private_data( + const struct wined3d_private_store *store, const GUID *tag) +{ + struct wined3d_private_data *data; + struct list *entry; + + LIST_FOR_EACH(entry, &store->content) + { + data = LIST_ENTRY(entry, struct wined3d_private_data, entry); + if (IsEqualGUID(&data->tag, tag)) + return data; + } + return NULL; +} + +static inline void wined3d_private_store_free_private_data(struct wined3d_private_store *store, + struct wined3d_private_data *entry) +{ + if (entry->flags & WINED3DSPD_IUNKNOWN) + IUnknown_Release(entry->content.object); + list_remove(&entry->entry); + HeapFree(GetProcessHeap(), 0, entry); +} + +static inline void wined3d_private_store_cleanup(struct wined3d_private_store *store) +{ + struct wined3d_private_data *data; + struct list *e1, *e2; + + LIST_FOR_EACH_SAFE(e1, e2, &store->content) + { + data = LIST_ENTRY(e1, struct wined3d_private_data, entry); + wined3d_private_store_free_private_data(store, data); + } +} + +static inline HRESULT wined3d_private_store_set_private_data(struct wined3d_private_store *store, + const GUID *guid, const void *data, DWORD data_size, DWORD flags) +{ + struct wined3d_private_data *d, *old; + const void *ptr = data; + + if (flags & WINED3DSPD_IUNKNOWN) + { + if (data_size != sizeof(IUnknown *)) + return WINED3DERR_INVALIDCALL; + ptr = &data; + } + + if (!(d = HeapAlloc(GetProcessHeap(), 0, + FIELD_OFFSET(struct wined3d_private_data, content.data[data_size])))) + return E_OUTOFMEMORY; + + d->tag = *guid; + d->flags = flags; + d->size = data_size; + + memcpy(d->content.data, ptr, data_size); + if (flags & WINED3DSPD_IUNKNOWN) + IUnknown_AddRef(d->content.object); + + old = wined3d_private_store_get_private_data(store, guid); + if (old) + wined3d_private_store_free_private_data(store, old); + list_add_tail(&store->content, &d->entry); + + return WINED3D_OK; +} + void __cdecl wined3d_resource_get_desc(const struct wined3d_resource *resource, struct wined3d_resource_desc *desc); void * __cdecl wined3d_resource_get_parent(const struct wined3d_resource *resource); -HRESULT __cdecl wined3d_resource_get_private_data(const struct wined3d_resource *resource, - REFGUID guid, void *data, DWORD *data_size); void __cdecl wined3d_resource_set_parent(struct wined3d_resource *resource, void *parent); -HRESULT __cdecl wined3d_resource_set_private_data(struct wined3d_resource *resource, - REFGUID guid, const void *data, DWORD data_size, DWORD flags); HRESULT __cdecl wined3d_rendertarget_view_create(struct wined3d_resource *resource, void *parent, struct wined3d_rendertarget_view **rendertarget_view); diff -Nru wine1.7-1.7.14/include/wingdi.h wine1.7-1.7.18/include/wingdi.h --- wine1.7-1.7.14/include/wingdi.h 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/include/wingdi.h 2014-05-02 18:15:48.000000000 +0000 @@ -776,31 +776,34 @@ #define FS_SYMBOL __MSABI_LONG(0x80000000) /* lfOutPrecision values */ -#define OUT_DEFAULT_PRECIS 0 -#define OUT_STRING_PRECIS 1 -#define OUT_CHARACTER_PRECIS 2 -#define OUT_STROKE_PRECIS 3 -#define OUT_TT_PRECIS 4 -#define OUT_DEVICE_PRECIS 5 -#define OUT_RASTER_PRECIS 6 -#define OUT_TT_ONLY_PRECIS 7 -#define OUT_OUTLINE_PRECIS 8 +#define OUT_DEFAULT_PRECIS 0 +#define OUT_STRING_PRECIS 1 +#define OUT_CHARACTER_PRECIS 2 +#define OUT_STROKE_PRECIS 3 +#define OUT_TT_PRECIS 4 +#define OUT_DEVICE_PRECIS 5 +#define OUT_RASTER_PRECIS 6 +#define OUT_TT_ONLY_PRECIS 7 +#define OUT_OUTLINE_PRECIS 8 +#define OUT_SCREEN_OUTLINE_PRECIS 9 +#define OUT_PS_ONLY_PRECIS 10 /* lfClipPrecision values */ #define CLIP_DEFAULT_PRECIS 0x00 #define CLIP_CHARACTER_PRECIS 0x01 #define CLIP_STROKE_PRECIS 0x02 -#define CLIP_MASK 0x0F -#define CLIP_LH_ANGLES 0x10 -#define CLIP_TT_ALWAYS 0x20 -#define CLIP_EMBEDDED 0x80 +#define CLIP_MASK 0x0F +#define CLIP_LH_ANGLES 0x10 +#define CLIP_TT_ALWAYS 0x20 +#define CLIP_DFA_DISABLE 0x40 +#define CLIP_EMBEDDED 0x80 /* lfQuality values */ -#define DEFAULT_QUALITY 0 -#define DRAFT_QUALITY 1 -#define PROOF_QUALITY 2 -#define NONANTIALIASED_QUALITY 3 -#define ANTIALIASED_QUALITY 4 +#define DEFAULT_QUALITY 0 +#define DRAFT_QUALITY 1 +#define PROOF_QUALITY 2 +#define NONANTIALIASED_QUALITY 3 +#define ANTIALIASED_QUALITY 4 #define CLEARTYPE_QUALITY 5 #define CLEARTYPE_NATURAL_QUALITY 6 diff -Nru wine1.7-1.7.14/include/winnt.h wine1.7-1.7.18/include/winnt.h --- wine1.7-1.7.14/include/winnt.h 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/include/winnt.h 2014-05-02 18:15:48.000000000 +0000 @@ -154,7 +154,7 @@ # define DECLSPEC_EXPORT #endif -#if defined(__MSC_VER) || defined(__MINGW32__) || defined(__CYGWIN__) +#if defined(_MSC_VER) || defined(__MINGW32__) || defined(__CYGWIN__) # define DECLSPEC_HIDDEN #elif defined(__GNUC__) && ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3))) # define DECLSPEC_HIDDEN __attribute__((visibility ("hidden"))) @@ -1193,8 +1193,11 @@ } DUMMYUNIONNAME2; } KNONVOLATILE_CONTEXT_POINTERS, *PKNONVOLATILE_CONTEXT_POINTERS; +typedef PRUNTIME_FUNCTION (CALLBACK *PGET_RUNTIME_FUNCTION_CALLBACK)(DWORD64,PVOID); + BOOLEAN CDECL RtlAddFunctionTable(RUNTIME_FUNCTION*,DWORD,DWORD64); BOOLEAN CDECL RtlDeleteFunctionTable(RUNTIME_FUNCTION*); +BOOLEAN CDECL RtlInstallFunctionTableCallback(DWORD64,DWORD64,DWORD,PGET_RUNTIME_FUNCTION_CALLBACK,PVOID,PCWSTR); PRUNTIME_FUNCTION WINAPI RtlLookupFunctionEntry(DWORD64,DWORD64*,UNWIND_HISTORY_TABLE*); PVOID WINAPI RtlVirtualUnwind(ULONG,ULONG64,ULONG64,RUNTIME_FUNCTION*,CONTEXT*,PVOID*,ULONG64*,KNONVOLATILE_CONTEXT_POINTERS*); diff -Nru wine1.7-1.7.14/include/winternl.h wine1.7-1.7.18/include/winternl.h --- wine1.7-1.7.14/include/winternl.h 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/include/winternl.h 2014-05-02 18:15:48.000000000 +0000 @@ -2469,6 +2469,7 @@ NTSYSAPI NTSTATUS WINAPI RtlQueryProcessDebugInformation(ULONG,ULONG,PDEBUG_BUFFER); NTSYSAPI NTSTATUS WINAPI RtlQueryRegistryValues(ULONG, PCWSTR, PRTL_QUERY_REGISTRY_TABLE, PVOID, PVOID); NTSYSAPI NTSTATUS WINAPI RtlQueryTimeZoneInformation(RTL_TIME_ZONE_INFORMATION*); +NTSYSAPI NTSTATUS WINAPI RtlQueryUnbiasedInterruptTime(ULONGLONG*); NTSYSAPI NTSTATUS WINAPI RtlQueueWorkItem(PRTL_WORK_ITEM_ROUTINE,PVOID,ULONG); NTSYSAPI void WINAPI RtlRaiseException(PEXCEPTION_RECORD); NTSYSAPI void WINAPI RtlRaiseStatus(NTSTATUS); diff -Nru wine1.7-1.7.14/include/winuser.h wine1.7-1.7.18/include/winuser.h --- wine1.7-1.7.14/include/winuser.h 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/include/winuser.h 2014-05-02 18:15:48.000000000 +0000 @@ -91,6 +91,7 @@ typedef HANDLE HDWP; +typedef void* HPOWERNOTIFY; #define UOI_FLAGS 1 #define UOI_NAME 2 @@ -3219,6 +3220,27 @@ #define AnsiToOemBuffW CharToOemBuffW #define AnsiToOemBuff WINELIB_NAME_AW(AnsiToOemBuff) +/* ChangeWindowMessageFilter flags */ +#define MSGFLT_ADD 1 +#define MSGFLT_REMOVE 2 + +/* ChangeWindowMessageFilterEx defines */ +#define MSGFLTINFO_NONE 0 +#define MSGFLTINFO_ALREADYALLOWED_FORWND 1 +#define MSGFLTINFO_ALREADYDISALLOWED_FORWND 2 +#define MSGFLTINFO_ALLOWED_HIGHER 3 + +typedef struct tagCHANGEFILTERSTRUCT +{ + DWORD cbSize; + DWORD ExtStatus; +} CHANGEFILTERSTRUCT, *PCHANGEFILTERSTRUCT; + +/* Actions for ChangeWindowMessageFilterEx */ +#define MSGFLT_RESET 0 +#define MSGFLT_ALLOW 1 +#define MSGFLT_DISALLOW 2 + #if defined(_WINGDI_) && !defined(NOGDI) WINUSERAPI LONG WINAPI ChangeDisplaySettingsA(LPDEVMODEA,DWORD); WINUSERAPI LONG WINAPI ChangeDisplaySettingsW(LPDEVMODEW,DWORD); @@ -3293,6 +3315,8 @@ WINUSERAPI BOOL WINAPI ChangeMenuA(HMENU,UINT,LPCSTR,UINT,UINT); WINUSERAPI BOOL WINAPI ChangeMenuW(HMENU,UINT,LPCWSTR,UINT,UINT); #define ChangeMenu WINELIB_NAME_AW(ChangeMenu) +WINUSERAPI BOOL WINAPI ChangeWindowMessageFilter(UINT,DWORD); +WINUSERAPI BOOL WINAPI ChangeWindowMessageFilterEx(HWND,UINT,DWORD,CHANGEFILTERSTRUCT*); WINUSERAPI LPSTR WINAPI CharLowerA(LPSTR); WINUSERAPI LPWSTR WINAPI CharLowerW(LPWSTR); #define CharLower WINELIB_NAME_AW(CharLower) @@ -3830,6 +3854,7 @@ WINUSERAPI HDEVNOTIFY WINAPI RegisterDeviceNotificationW(HANDLE,LPVOID,DWORD); #define RegisterDeviceNotification WINELIB_NAME_AW(RegisterDeviceNotification) WINUSERAPI BOOL WINAPI RegisterHotKey(HWND,INT,UINT,UINT); +WINUSERAPI HPOWERNOTIFY WINAPI RegisterPowerSettingNotification(HANDLE,LPCGUID,DWORD); WINUSERAPI BOOL WINAPI RegisterRawInputDevices(PRAWINPUTDEVICE,UINT,UINT); WINUSERAPI UINT WINAPI RegisterWindowMessageA(LPCSTR); WINUSERAPI UINT WINAPI RegisterWindowMessageW(LPCWSTR); diff -Nru wine1.7-1.7.14/include/wmsdkidl.idl wine1.7-1.7.18/include/wmsdkidl.idl --- wine1.7-1.7.14/include/wmsdkidl.idl 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/include/wmsdkidl.idl 2014-05-02 18:15:48.000000000 +0000 @@ -110,6 +110,15 @@ WMT_ON = 2, } WMT_STREAM_SELECTION; +typedef enum WMT_VERSION +{ + WMT_VER_4_0 = 0x00040000, + WMT_VER_7_0 = 0x00070000, + WMT_VER_8_0 = 0x00080000, + WMT_VER_9_0 = 0x00090000 +} WMT_VERSION; + +typedef LPCWSTR LPCWSTR_WMSDK_TYPE_SAFE; [ object, @@ -146,6 +155,167 @@ [ object, + uuid(96406Bdd-2b2b-11d3-b36b-00c04f6108ff), + pointer_default(unique), + local +] +interface IWMStreamList : IUnknown +{ + HRESULT GetStreams( + [out, size_is(*pcStreams)] WORD *pwStreamNumArray, + [in, out] WORD *pcStreams); + + HRESULT AddStream([in] WORD wStreamNum); + HRESULT RemoveStream([in] WORD wStreamNum); +} + +[ + object, + uuid(96406Bde-2b2b-11d3-b36b-00c04f6108ff), + pointer_default(unique), + local +] +interface IWMMutualExclusion : IWMStreamList +{ + HRESULT GetType([out] GUID *pguidType); + HRESULT SetType([in] REFGUID guidType); +} + +[ + object, + uuid(96406Bdc-2b2b-11d3-b36b-00c04f6108ff), + pointer_default(unique), + local +] +interface IWMStreamConfig : IUnknown +{ + HRESULT GetStreamType([out] GUID *pguidStreamType); + HRESULT GetStreamNumber([out] WORD *pwStreamNum); + HRESULT SetStreamNumber([in] WORD wStreamNum); + + HRESULT GetStreamName( + [out, size_is(*pcchStreamName)] WCHAR *pwszStreamName, + [in, out] WORD *pcchStreamName); + + HRESULT SetStreamName([in] LPCWSTR_WMSDK_TYPE_SAFE pwszStreamName); + + HRESULT GetConnectionName( + [out, size_is(*pcchInputName)] WCHAR *pwszInputName, + [in, out] WORD *pcchInputName); + + HRESULT SetConnectionName([in] LPCWSTR_WMSDK_TYPE_SAFE pwszInputName); + HRESULT GetBitrate([out] DWORD *pdwBitrate); + HRESULT SetBitrate([in] DWORD pdwBitrate); + HRESULT GetBufferWindow([out] DWORD *pmsBufferWindow); + HRESULT SetBufferWindow([in] DWORD msBufferWindow); +} + +[ + object, + uuid(96406bdb-2b2b-11d3-b36b-00c04f6108ff), + pointer_default(unique), + local +] +interface IWMProfile : IUnknown +{ + HRESULT GetVersion( + [out] WMT_VERSION *pdwVersion); + + HRESULT GetName( + [out, size_is(*pcchName)] WCHAR *pwszName, + [in, out] DWORD *pcchName); + + HRESULT SetName( + [in] const WCHAR *pwszName); + + HRESULT GetDescription( + [out, size_is(*pcchDescription)] WCHAR *pwszDescription, + [in, out] DWORD *pcchDescription); + + HRESULT SetDescription( + [in] const WCHAR *pwszDescription); + + HRESULT GetStreamCount( + [out] DWORD *pcStreams); + + HRESULT GetStream( + [in] DWORD dwStreamIndex, + [out] IWMStreamConfig **ppConfig); + + HRESULT GetStreamByNumber( + [in] WORD wStreamNum, + [out] IWMStreamConfig **ppConfig); + + HRESULT RemoveStream( + [in] IWMStreamConfig *pConfig); + + HRESULT RemoveStreamByNumber( + [in] WORD wStreamNum); + + HRESULT AddStream( + [in] IWMStreamConfig *pConfig); + + HRESULT ReconfigStream( + [in] IWMStreamConfig *pConfig); + + HRESULT CreateNewStream( + [in] REFGUID guidStreamType, + [out] IWMStreamConfig **ppConfig); + + HRESULT GetMutualExclusionCount( + [out] DWORD *pcME); + + HRESULT GetMutualExclusion( + [in] DWORD dwMEIndex, + [out] IWMMutualExclusion **ppME); + + HRESULT RemoveMutualExclusion( + [in] IWMMutualExclusion *pME); + + HRESULT AddMutualExclusion( + [in] IWMMutualExclusion *pME); + + HRESULT CreateNewMutualExclusion( + [out] IWMMutualExclusion **ppME); +} + +[ + object, + uuid(d16679f2-6ca0-472d-8d31-2f5d55aee155), + pointer_default(unique), + local +] +interface IWMProfileManager : IUnknown +{ + HRESULT CreateEmptyProfile( + [in] WMT_VERSION dwVersion, + [out] IWMProfile **ppProfile); + + HRESULT LoadProfileByID( + [in] REFGUID guidProfile, + [out] IWMProfile **ppProfile); + + HRESULT LoadProfileByData( + [in] const WCHAR *pwszProfile, + [out] IWMProfile **ppProfile); + + HRESULT SaveProfile( + [in] IWMProfile *pIWMProfile, + [in] WCHAR *pwszProfile, + [in, out] DWORD *pdwLength); + + HRESULT GetSystemProfileCount( + [out] DWORD *pcProfiles); + + HRESULT LoadSystemProfile( + [in] DWORD dwProfileIndex, + [out] IWMProfile **ppProfile); +} + +cpp_quote("HRESULT WINAPI WMCreateProfileManager(IWMProfileManager**);") + +[ + object, uuid(96406bce-2b2b-11d3-b36b-00c04f6108ff), pointer_default(unique), local diff -Nru wine1.7-1.7.14/include/xmldomdid.h wine1.7-1.7.18/include/xmldomdid.h --- wine1.7-1.7.14/include/xmldomdid.h 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/include/xmldomdid.h 2014-05-02 18:15:48.000000000 +0000 @@ -19,173 +19,174 @@ #ifndef __XMLDOMDID_H__ #define __XMLDOMDID_H__ -#define DISPID_DOM_BASE 1 -#define DISPID_DOM_COLLECTION_BASE 1000000 -#define DISPID_DOM_COLLECTION_MAX 2999999 - -#define DISPID_DOM_NODE 1 -#define DISPID_DOM_NODE_NODENAME 2 -#define DISPID_DOM_NODE_NODEVALUE 3 -#define DISPID_DOM_NODE_NODETYPE 4 -#define DISPID_DOM_NODE_NODETYPEENUM 5 -#define DISPID_DOM_NODE_PARENTNODE 6 -#define DISPID_DOM_NODE_CHILDNODES 7 -#define DISPID_DOM_NODE_FIRSTCHILD 8 -#define DISPID_DOM_NODE_LASTCHILD 9 -#define DISPID_DOM_NODE_PREVIOUSSIBLING 10 -#define DISPID_DOM_NODE_NEXTSIBLING 11 -#define DISPID_DOM_NODE_ATTRIBUTES 12 -#define DISPID_DOM_NODE_INSERTBEFORE 13 -#define DISPID_DOM_NODE_REPLACECHILD 14 -#define DISPID_DOM_NODE_REMOVECHILD 15 -#define DISPID_DOM_NODE_APPENDCHILD 16 -#define DISPID_DOM_NODE_HASCHILDNODES 17 -#define DISPID_DOM_NODE_OWNERDOC 18 -#define DISPID_DOM_NODE_CLONENODE 19 - -#define DISPID_XMLDOM_NODE 20 -#define DISPID_XMLDOM_NODE_STRINGTYPE 21 -#define DISPID_XMLDOM_NODE_SPECIFIED 22 -#define DISPID_XMLDOM_NODE_DEFINITION 23 -#define DISPID_XMLDOM_NODE_TEXT 24 -#define DISPID_XMLDOM_NODE_NODETYPEDVALUE 25 -#define DISPID_XMLDOM_NODE_DATATYPE 26 -#define DISPID_XMLDOM_NODE_XML 27 -#define DISPID_XMLDOM_NODE_TRANSFORMNODE 28 -#define DISPID_XMLDOM_NODE_SELECTNODES 29 -#define DISPID_XMLDOM_NODE_SELECTSINGLENODE 30 -#define DISPID_XMLDOM_NODE_PARSED 31 -#define DISPID_XMLDOM_NODE_NAMESPACE 32 -#define DISPID_XMLDOM_NODE_PREFIX 33 -#define DISPID_XMLDOM_NODE_BASENAME 34 -#define DISPID_XMLDOM_NODE_TRANSFORMNODETOOBJECT 35 -#define DISPID_XMLDOM_NODE__TOP 36 - -#define DISPID_DOM_DOCUMENT 37 -#define DISPID_DOM_DOCUMENT_DOCTYPE 38 -#define DISPID_DOM_DOCUMENT_IMPLEMENTATION 39 -#define DISPID_DOM_DOCUMENT_DOCUMENTELEMENT 40 -#define DISPID_DOM_DOCUMENT_CREATEELEMENT 41 -#define DISPID_DOM_DOCUMENT_CREATEDOCUMENTFRAGMENT 42 -#define DISPID_DOM_DOCUMENT_CREATETEXTNODE 43 -#define DISPID_DOM_DOCUMENT_CREATECOMMENT 44 -#define DISPID_DOM_DOCUMENT_CREATECDATASECTION 45 -#define DISPID_DOM_DOCUMENT_CREATEPROCESSINGINSTRUCTION 46 -#define DISPID_DOM_DOCUMENT_CREATEATTRIBUTE 47 -#define DISPID_DOM_DOCUMENT_CREATEENTITY 48 -#define DISPID_DOM_DOCUMENT_CREATEENTITYREFERENCE 49 -#define DISPID_DOM_DOCUMENT_GETELEMENTSBYTAGNAME 50 -#define DISPID_DOM_DOCUMENT_TOP 51 - -#define DISPID_XMLDOM_DOCUMENT 52 -#define DISPID_XMLDOM_DOCUMENT_DOCUMENTNODE 53 -#define DISPID_XMLDOM_DOCUMENT_CREATENODE 54 -#define DISPID_XMLDOM_DOCUMENT_CREATENODEEX 55 -#define DISPID_XMLDOM_DOCUMENT_NODEFROMID 56 -#define DISPID_XMLDOM_DOCUMENT_DOCUMENTNAMESPACES 57 -#define DISPID_XMLDOM_DOCUMENT_LOAD 58 -#define DISPID_XMLDOM_DOCUMENT_PARSEERROR 59 -#define DISPID_XMLDOM_DOCUMENT_URL 60 -#define DISPID_XMLDOM_DOCUMENT_ASYNC 61 -#define DISPID_XMLDOM_DOCUMENT_ABORT 62 -#define DISPID_XMLDOM_DOCUMENT_LOADXML 63 -#define DISPID_XMLDOM_DOCUMENT_SAVE 64 -#define DISPID_XMLDOM_DOCUMENT_VALIDATE 65 -#define DISPID_XMLDOM_DOCUMENT_RESOLVENAMESPACE 66 -#define DISPID_XMLDOM_DOCUMENT_PRESERVEWHITESPACE 67 -#define DISPID_XMLDOM_DOCUMENT_ONREADYSTATECHANGE 68 -#define DISPID_XMLDOM_DOCUMENT_ONDATAAVAILABLE 69 -#define DISPID_XMLDOM_DOCUMENT_ONTRANSFORMNODE 70 -#define DISPID_XMLDOM_DOCUMENT__TOP 71 - -#define DISPID_DOM_NODELIST 72 -#define DISPID_DOM_NODELIST_ITEM 73 -#define DISPID_DOM_NODELIST_LENGTH 74 - -#define DISPID_XMLDOM_NODELIST 75 -#define DISPID_XMLDOM_NODELIST_NEXTNODE 76 -#define DISPID_XMLDOM_NODELIST_RESET 77 -#define DISPID_XMLDOM_NODELIST_NEWENUM 78 -#define DISPID_XMLDOM_NODELIST__TOP 79 - -#define DISPID_DOM_NAMEDNODEMAP 80 -#define DISPID_DOM_NAMEDNODEMAP_GETNAMEDITEM 81 -#define DISPID_DOM_NAMEDNODEMAP_SETNAMEDITEM 82 -#define DISPID_DOM_NAMEDNODEMAP_REMOVENAMEDITEM 83 - -#define DISPID_XMLDOM_NAMEDNODEMAP 84 -#define DISPID_XMLDOM_NAMEDNODEMAP_GETQUALIFIEDITEM 85 -#define DISPID_XMLDOM_NAMEDNODEMAP_REMOVEQUALIFIEDITEM 86 -#define DISPID_XMLDOM_NAMEDNODEMAP_NEXTNODE 87 -#define DISPID_XMLDOM_NAMEDNODEMAP_RESET 88 -#define DISPID_XMLDOM_NAMEDNODEMAP_NEWENUM 89 -#define DISPID_XMLDOM_NAMEDNODEMAP__TOP 90 - -#define DISPID_DOM_W3CWRAPPERS 91 - -#define DISPID_DOM_DOCUMENTFRAGMENT 92 -#define DISPID_DOM_DOCUMENTFRAGMENT__TOP 93 - -#define DISPID_DOM_ELEMENT 94 -#define DISPID_DOM_ELEMENT_GETTAGNAME 95 -#define DISPID_DOM_ELEMENT_GETATTRIBUTES 96 -#define DISPID_DOM_ELEMENT_GETATTRIBUTE 97 -#define DISPID_DOM_ELEMENT_SETATTRIBUTE 98 -#define DISPID_DOM_ELEMENT_REMOVEATTRIBUTE 99 -#define DISPID_DOM_ELEMENT_GETATTRIBUTENODE 100 -#define DISPID_DOM_ELEMENT_SETATTRIBUTENODE 101 -#define DISPID_DOM_ELEMENT_REMOVEATTRIBUTENODE 102 -#define DISPID_DOM_ELEMENT_GETELEMENTSBYTAGNAME 103 -#define DISPID_DOM_ELEMENT_NORMALIZE 104 -#define DISPID_DOM_ELEMENT__TOP 105 - -#define DISPID_DOM_DATA 106 -#define DISPID_DOM_DATA_DATA 107 -#define DISPID_DOM_DATA_LENGTH 108 -#define DISPID_DOM_DATA_SUBSTRING 109 -#define DISPID_DOM_DATA_APPEND 110 -#define DISPID_DOM_DATA_INSERT 111 -#define DISPID_DOM_DATA_DELETE 112 -#define DISPID_DOM_DATA_REPLACE 113 -#define DISPID_DOM_DATA__TOP 114 - -#define DISPID_DOM_ATTRIBUTE 115 -#define DISPID_DOM_ATTRIBUTE_GETNAME 116 -#define DISPID_DOM_ATTRIBUTE_SPECIFIED 117 -#define DISPID_DOM_ATTRIBUTE_VALUE 118 -#define DISPID_DOM_ATTRIBUTE__TOP 119 - -#define DISPID_DOM_TEXT 120 -#define DISPID_DOM_TEXT_SPLITTEXT 121 -#define DISPID_DOM_TEXT_JOINTEXT 122 -#define DISPID_DOM_TEXT__TOP 123 - -#define DISPID_DOM_PI 124 -#define DISPID_DOM_PI_TARGET 125 -#define DISPID_DOM_PI_DATA 126 -#define DISPID_DOM_PI__TOP 127 - -#define DISPID_DOM_DOCUMENTTYPE 128 -#define DISPID_DOM_DOCUMENTTYPE_NAME 129 -#define DISPID_DOM_DOCUMENTTYPE_ENTITIES 130 -#define DISPID_DOM_DOCUMENTTYPE_NOTATIONS 131 -#define DISPID_DOM_DOCUMENTTYPE__TOP 132 - -#define DISPID_DOM_NOTATION 133 -#define DISPID_DOM_NOTATION_PUBLICID 134 -#define DISPID_DOM_NOTATION_SYSTEMID 135 -#define DISPID_DOM_NOTATION__TOP 136 - -#define DISPID_DOM_ENTITY 137 -#define DISPID_DOM_ENTITY_PUBLICID 138 -#define DISPID_DOM_ENTITY_SYSTEMID 139 -#define DISPID_DOM_ENTITY_NOTATIONNAME 140 -#define DISPID_DOM_ENTITY__TOP 141 - -#define DISPID_DOM_IMPLEMENTATION 142 -#define DISPID_DOM_IMPLEMENTATION_HASFEATURE 143 -#define DISPID_DOM_IMPLEMENTATION__TOP 144 +#define DISPID_DOM_BASE 0x00000001 +#define DISPID_DOM_COLLECTION_BASE 0x000f4240 +#define DISPID_DOM_COLLECTION_MAX 0x002dc6bf + +#define DISPID_DOM_NODE 0x00000001 +#define DISPID_DOM_NODE_NODENAME 0x00000002 +#define DISPID_DOM_NODE_NODEVALUE 0x00000003 +#define DISPID_DOM_NODE_NODETYPE 0x00000004 +#define DISPID_DOM_NODE_NODETYPEENUM 0x00000005 +#define DISPID_DOM_NODE_PARENTNODE 0x00000006 +#define DISPID_DOM_NODE_CHILDNODES 0x00000007 +#define DISPID_DOM_NODE_FIRSTCHILD 0x00000008 +#define DISPID_DOM_NODE_LASTCHILD 0x00000009 +#define DISPID_DOM_NODE_PREVIOUSSIBLING 0x0000000a +#define DISPID_DOM_NODE_NEXTSIBLING 0x0000000b +#define DISPID_DOM_NODE_ATTRIBUTES 0x0000000c +#define DISPID_DOM_NODE_INSERTBEFORE 0x0000000d +#define DISPID_DOM_NODE_REPLACECHILD 0x0000000e +#define DISPID_DOM_NODE_REMOVECHILD 0x0000000f +#define DISPID_DOM_NODE_APPENDCHILD 0x00000010 +#define DISPID_DOM_NODE_HASCHILDNODES 0x00000011 +#define DISPID_DOM_NODE_OWNERDOC 0x00000012 +#define DISPID_DOM_NODE_CLONENODE 0x00000013 + +#define DISPID_XMLDOM_NODE 0x00000014 +#define DISPID_XMLDOM_NODE_STRINGTYPE 0x00000015 +#define DISPID_XMLDOM_NODE_SPECIFIED 0x00000016 +#define DISPID_XMLDOM_NODE_DEFINITION 0x00000017 +#define DISPID_XMLDOM_NODE_TEXT 0x00000018 +#define DISPID_XMLDOM_NODE_NODETYPEDVALUE 0x00000019 +#define DISPID_XMLDOM_NODE_DATATYPE 0x0000001a +#define DISPID_XMLDOM_NODE_XML 0x0000001b +#define DISPID_XMLDOM_NODE_TRANSFORMNODE 0x0000001c +#define DISPID_XMLDOM_NODE_SELECTNODES 0x0000001d +#define DISPID_XMLDOM_NODE_SELECTSINGLENODE 0x0000001e +#define DISPID_XMLDOM_NODE_PARSED 0x0000001f +#define DISPID_XMLDOM_NODE_NAMESPACE 0x00000020 +#define DISPID_XMLDOM_NODE_PREFIX 0x00000021 +#define DISPID_XMLDOM_NODE_BASENAME 0x00000022 +#define DISPID_XMLDOM_NODE_TRANSFORMNODETOOBJECT 0x00000023 +#define DISPID_XMLDOM_NODE__TOP 0x00000024 + +#define DISPID_DOM_DOCUMENT 0x00000025 +#define DISPID_DOM_DOCUMENT_DOCTYPE 0x00000026 +#define DISPID_DOM_DOCUMENT_IMPLEMENTATION 0x00000027 +#define DISPID_DOM_DOCUMENT_DOCUMENTELEMENT 0x00000028 +#define DISPID_DOM_DOCUMENT_CREATEELEMENT 0x00000029 +#define DISPID_DOM_DOCUMENT_CREATEDOCUMENTFRAGMENT 0x0000002a +#define DISPID_DOM_DOCUMENT_CREATETEXTNODE 0x0000002b +#define DISPID_DOM_DOCUMENT_CREATECOMMENT 0x0000002c +#define DISPID_DOM_DOCUMENT_CREATECDATASECTION 0x0000002d +#define DISPID_DOM_DOCUMENT_CREATEPROCESSINGINSTRUCTION 0x0000002e +#define DISPID_DOM_DOCUMENT_CREATEATTRIBUTE 0x0000002f +#define DISPID_DOM_DOCUMENT_CREATEENTITY 0x00000030 +#define DISPID_DOM_DOCUMENT_CREATEENTITYREFERENCE 0x00000031 +#define DISPID_DOM_DOCUMENT_GETELEMENTSBYTAGNAME 0x00000032 +#define DISPID_DOM_DOCUMENT_TOP 0x00000033 + +#define DISPID_XMLDOM_DOCUMENT 0x00000034 +#define DISPID_XMLDOM_DOCUMENT_DOCUMENTNODE 0x00000035 +#define DISPID_XMLDOM_DOCUMENT_CREATENODE 0x00000036 +#define DISPID_XMLDOM_DOCUMENT_CREATENODEEX 0x00000037 +#define DISPID_XMLDOM_DOCUMENT_NODEFROMID 0x00000038 +#define DISPID_XMLDOM_DOCUMENT_DOCUMENTNAMESPACES 0x00000039 +#define DISPID_XMLDOM_DOCUMENT_LOAD 0x0000003a +#define DISPID_XMLDOM_DOCUMENT_PARSEERROR 0x0000003b +#define DISPID_XMLDOM_DOCUMENT_URL 0x0000003c +#define DISPID_XMLDOM_DOCUMENT_ASYNC 0x0000003d +#define DISPID_XMLDOM_DOCUMENT_ABORT 0x0000003e +#define DISPID_XMLDOM_DOCUMENT_LOADXML 0x0000003f +#define DISPID_XMLDOM_DOCUMENT_SAVE 0x00000040 +#define DISPID_XMLDOM_DOCUMENT_VALIDATE 0x00000041 +#define DISPID_XMLDOM_DOCUMENT_RESOLVENAMESPACE 0x00000042 +#define DISPID_XMLDOM_DOCUMENT_PRESERVEWHITESPACE 0x00000043 +#define DISPID_XMLDOM_DOCUMENT_ONREADYSTATECHANGE 0x00000044 +#define DISPID_XMLDOM_DOCUMENT_ONDATAAVAILABLE 0x00000045 +#define DISPID_XMLDOM_DOCUMENT_ONTRANSFORMNODE 0x00000046 +#define DISPID_XMLDOM_DOCUMENT__TOP 0x00000047 + +#define DISPID_DOM_NODELIST 0x00000048 +#define DISPID_DOM_NODELIST_ITEM 0x00000049 +#define DISPID_DOM_NODELIST_LENGTH 0x0000004a +#define DISPID_XMLDOM_NODELIST 0x0000004b +#define DISPID_XMLDOM_NODELIST_NEXTNODE 0x0000004c +#define DISPID_XMLDOM_NODELIST_RESET 0x0000004d +#define DISPID_XMLDOM_NODELIST_NEWENUM 0x0000004e +#define DISPID_XMLDOM_NODELIST__TOP 0x0000004f + +#define DISPID_DOM_NAMEDNODEMAP 0x00000050 +#define DISPID_DOM_NAMEDNODEMAP_GETNAMEDITEM 0x00000053 +#define DISPID_DOM_NAMEDNODEMAP_SETNAMEDITEM 0x00000054 +#define DISPID_DOM_NAMEDNODEMAP_REMOVENAMEDITEM 0x00000055 +#define DISPID_XMLDOM_NAMEDNODEMAP 0x00000056 +#define DISPID_XMLDOM_NAMEDNODEMAP_GETQUALIFIEDITEM 0x00000057 +#define DISPID_XMLDOM_NAMEDNODEMAP_REMOVEQUALIFIEDITEM 0x00000058 +#define DISPID_XMLDOM_NAMEDNODEMAP_NEXTNODE 0x00000059 +#define DISPID_XMLDOM_NAMEDNODEMAP_RESET 0x0000005a +#define DISPID_XMLDOM_NAMEDNODEMAP_NEWENUM 0x0000005b +#define DISPID_XMLDOM_NAMEDNODEMAP__TOP 0x0000005c + +#define DISPID_DOM_W3CWRAPPERS 0x0000005d + +#define DISPID_DOM_DOCUMENTFRAGMENT 0x0000005e +#define DISPID_DOM_DOCUMENTFRAGMENT__TOP 0x0000005f + +#define DISPID_DOM_ELEMENT 0x00000060 +#define DISPID_DOM_ELEMENT_GETTAGNAME 0x00000061 +#define DISPID_DOM_ELEMENT_GETATTRIBUTES 0x00000062 +#define DISPID_DOM_ELEMENT_GETATTRIBUTE 0x00000063 +#define DISPID_DOM_ELEMENT_SETATTRIBUTE 0x00000064 +#define DISPID_DOM_ELEMENT_REMOVEATTRIBUTE 0x00000065 +#define DISPID_DOM_ELEMENT_GETATTRIBUTENODE 0x00000066 +#define DISPID_DOM_ELEMENT_SETATTRIBUTENODE 0x00000067 +#define DISPID_DOM_ELEMENT_REMOVEATTRIBUTENODE 0x00000068 +#define DISPID_DOM_ELEMENT_GETELEMENTSBYTAGNAME 0x00000069 +#define DISPID_DOM_ELEMENT_NORMALIZE 0x0000006a +#define DISPID_DOM_ELEMENT__TOP 0x0000006b + +#define DISPID_DOM_DATA 0x0000006c +#define DISPID_DOM_DATA_DATA 0x0000006d +#define DISPID_DOM_DATA_LENGTH 0x0000006e +#define DISPID_DOM_DATA_SUBSTRING 0x0000006f +#define DISPID_DOM_DATA_APPEND 0x00000070 +#define DISPID_DOM_DATA_INSERT 0x00000071 +#define DISPID_DOM_DATA_DELETE 0x00000072 +#define DISPID_DOM_DATA_REPLACE 0x00000073 +#define DISPID_DOM_DATA__TOP 0x00000074 + +#define DISPID_DOM_ATTRIBUTE 0x00000075 +#define DISPID_DOM_ATTRIBUTE_GETNAME 0x00000076 +#define DISPID_DOM_ATTRIBUTE_SPECIFIED 0x00000077 +#define DISPID_DOM_ATTRIBUTE_VALUE 0x00000078 +#define DISPID_DOM_ATTRIBUTE__TOP 0x00000079 + +#define DISPID_DOM_TEXT 0x0000007a +#define DISPID_DOM_TEXT_SPLITTEXT 0x0000007b +#define DISPID_DOM_TEXT_JOINTEXT 0x0000007c +#define DISPID_DOM_TEXT__TOP 0x0000007d + +#define DISPID_DOM_PI 0x0000007e +#define DISPID_DOM_PI_TARGET 0x0000007f +#define DISPID_DOM_PI_DATA 0x00000080 +#define DISPID_DOM_PI__TOP 0x00000081 + +#define DISPID_DOM_DOCUMENTTYPE 0x00000082 +#define DISPID_DOM_DOCUMENTTYPE_NAME 0x00000083 +#define DISPID_DOM_DOCUMENTTYPE_ENTITIES 0x00000084 +#define DISPID_DOM_DOCUMENTTYPE_NOTATIONS 0x00000085 +#define DISPID_DOM_DOCUMENTTYPE__TOP 0x00000086 + +#define DISPID_DOM_NOTATION 0x00000087 +#define DISPID_DOM_NOTATION_PUBLICID 0x00000088 +#define DISPID_DOM_NOTATION_SYSTEMID 0x00000089 +#define DISPID_DOM_NOTATION__TOP 0x0000008a + +#define DISPID_DOM_ENTITY 0x0000008b +#define DISPID_DOM_ENTITY_PUBLICID 0x0000008c +#define DISPID_DOM_ENTITY_SYSTEMID 0x0000008d +#define DISPID_DOM_ENTITY_NOTATIONNAME 0x0000008e +#define DISPID_DOM_ENTITY__TOP 0x0000008f + +#define DISPID_DOM_W3CWRAPPERS_TOP 0x0000008f + +#define DISPID_DOM_IMPLEMENTATION 0x00000090 +#define DISPID_DOM_IMPLEMENTATION_HASFEATURE 0x00000091 +#define DISPID_DOM_IMPLEMENTATION__TOP 0x00000092 +#define DISPID_DOM__TOP 0x000000af #define DISPID_DOM_ERROR 0x000000b0 #define DISPID_DOM_ERROR_ERRORCODE 0x000000b1 @@ -197,9 +198,21 @@ #define DISPID_DOM_ERROR_FILEPOS 0x000000b7 #define DISPID_DOM_ERROR__TOP 0x000000b8 -#define DISPID_XMLDOMEVENT 197 +#define DISPID_XTLRUNTIME 0x000000b9 +#define DISPID_XTLRUNTIME_UNIQUEID 0x000000ba +#define DISPID_XTLRUNTIME_DEPTH 0x000000bb +#define DISPID_XTLRUNTIME_CHILDNUMBER 0x000000bc +#define DISPID_XTLRUNTIME_ANCESTORCHILDNUMBER 0x000000bd +#define DISPID_XTLRUNTIME_ABSOLUTECHILDNUMBER 0x000000be +#define DISPID_XTLRUNTIME_FORMATINDEX 0x000000bf +#define DISPID_XTLRUNTIME_FORMATNUMBER 0x000000c0 +#define DISPID_XTLRUNTIME_FORMATDATE 0x000000c1 +#define DISPID_XTLRUNTIME_FORMATTIME 0x000000c2 +#define DISPID_XTLRUNTIME__TOP 0x000000c3 + +#define DISPID_XMLDOMEVENT 0x000000c4 #define DISPID_XMLDOMEVENT_ONREADYSTATECHANGE DISPID_READYSTATECHANGE -#define DISPID_XMLDOMEVENT_ONDATAAVAILABLE 198 -#define DISPID_XMLDOMEVENT__TOP 199 +#define DISPID_XMLDOMEVENT_ONDATAAVAILABLE 0x000000c5 +#define DISPID_XMLDOMEVENT__TOP 0x000000c6 #endif /* __XMLDOMDID_H__ */ diff -Nru wine1.7-1.7.14/include/xmllite.idl wine1.7-1.7.18/include/xmllite.idl --- wine1.7-1.7.14/include/xmllite.idl 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/include/xmllite.idl 2014-05-02 18:15:48.000000000 +0000 @@ -293,3 +293,10 @@ HRESULT WriteWhitespace([in] LPCWSTR pwszWhitespace); HRESULT Flush(); } + +/* IXmlWriter construction */ +cpp_quote("STDAPI CreateXmlWriter(REFIID riid, void **ppvObject, IMalloc *pMalloc);") + +cpp_quote("typedef IUnknown IXmlWriterOutput;") +cpp_quote("STDAPI CreateXmlWriterOutputWithEncodingName(IUnknown *stream, IMalloc *pMalloc,") +cpp_quote(" LPCWSTR encoding, IXmlWriterOutput **output);") diff -Nru wine1.7-1.7.14/loader/wine.inf.in wine1.7-1.7.18/loader/wine.inf.in --- wine1.7-1.7.14/loader/wine.inf.in 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/loader/wine.inf.in 2014-05-02 18:15:48.000000000 +0000 @@ -124,6 +124,7 @@ AddService=FontCache3.0.0.0,0,WPFFontCacheService AddService=LanmanServer,0,LanmanServerService AddService=FontCache,0,FontCacheService +AddService=Schedule,0,TaskSchedulerService [DefaultInstall.NT.Services] AddService=BITS,0,BITSService @@ -136,6 +137,7 @@ AddService=FontCache3.0.0.0,0,WPFFontCacheService AddService=LanmanServer,0,LanmanServerService AddService=FontCache,0,FontCacheService +AddService=Schedule,0,TaskSchedulerService [DefaultInstall.ntamd64.Services] AddService=BITS,0,BITSService @@ -148,6 +150,7 @@ AddService=FontCache3.0.0.0,0,WPFFontCacheService AddService=LanmanServer,0,LanmanServerService AddService=FontCache,0,FontCacheService +AddService=Schedule,0,TaskSchedulerService [Strings] MciExtStr="Software\Microsoft\Windows NT\CurrentVersion\MCI Extensions" @@ -542,6 +545,7 @@ HKLM,%Control%\Session Manager\Environment,"TMP",0x00020002,"%10%\temp" HKLM,%Control%\Session Manager\Environment,"windir",0x00020000,"%10%" HKLM,%Control%\Session Manager\Environment,"winsysdir",,"%11%" +HKLM,%Control%\Session Manager\Memory Management,PagingFiles,,"%24%\pagefile.sys 27 77" HKLM,%Control%\Session Manager\Memory Management,WriteWatch,0x00040002,1 [Fonts] @@ -2510,6 +2514,7 @@ 10,logs, 10,temp, 11,mui, +11,tasks, 11,spool\drivers\color, 11,spool\printers, 10,,explorer.exe @@ -2542,6 +2547,9 @@ 11,wbem,wbemprox.dll 11,wbem,wmic.exe 11,wbem,wmiutils.dll +; empty folders to make sure the parent dirs are not removed +16410,Microsoft, +16412,Microsoft, 16422,Internet Explorer,iexplore.exe 16427,System\OLE DB,oledb32.dll 16427,System\OLE DB,msdaps.dll @@ -3024,7 +3032,20 @@ [FontCacheServiceKeys] HKR,Parameters,"ServiceDll",,"%11%\fntcache.dll" -;; HKLM,%CurrentVersionNT%\SvcHost,"netsvcs",0x00010008,"fontcache" +HKLM,%CurrentVersionNT%\SvcHost,"netsvcs",0x00010008,"fontcache" + +[TaskSchedulerService] +AddReg=TaskSchedulerServiceKeys +Description="Task Scheduler" +DisplayName="Task Scheduler" +ServiceBinary="%11%\svchost.exe -k netsvcs" +ServiceType=32 +StartType=3 +ErrorControl=1 + +[TaskSchedulerServiceKeys] +HKR,Parameters,"ServiceDll",,"%11%\schedsvc.dll" +HKLM,%CurrentVersionNT%\SvcHost,"netsvcs",0x00010008,"Schedule" [Services] HKLM,%CurrentVersion%\RunServices,"winemenubuilder",2,"%11%\winemenubuilder.exe -a -r" diff -Nru wine1.7-1.7.14/po/ar.po wine1.7-1.7.18/po/ar.po --- wine1.7-1.7.14/po/ar.po 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/po/ar.po 2014-05-02 18:15:48.000000000 +0000 @@ -11628,6 +11628,76 @@ msgid "Exports selected branch of the registry to a text file" msgstr "تصدير الفرع المختار من السجل إلى ملف نصي" +#: regsvr32.rc:32 +msgid "" +"Wine DLL Registration Utility\n" +"\n" +"Provides DLL registration services.\n" +"\n" +msgstr "" + +#: regsvr32.rc:40 +msgid "" +"Usage:\n" +" regsvr32 [/u] [/s] [/n] [/i[:cmdline]] DllName\n" +"\n" +"Options:\n" +" [/u] Unregister a server.\n" +" [/s] Silent mode (no messages will be displayed).\n" +" [/i] Call DllInstall, passing an optional [cmdline].\n" +"\tWhen used with [/u] DllInstall is called in uninstall mode.\n" +" [/n] Do not call DllRegisterServer. This option must be used with [/i].\n" +"\n" +msgstr "" + +#: regsvr32.rc:41 +msgid "" +"regsvr32: Invalid or unrecognized switch [%1]\n" +"\n" +msgstr "" + +#: regsvr32.rc:42 +#, fuzzy +#| msgid "Failed to open '%1'\n" +msgid "regsvr32: Failed to load DLL '%1'\n" +msgstr "فشل فتح '%1'\n" + +#: regsvr32.rc:43 +msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgstr "" + +#: regsvr32.rc:44 +msgid "regsvr32: Failed to register DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:45 +msgid "regsvr32: Successfully registered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:46 +msgid "regsvr32: Failed to unregister DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:47 +msgid "regsvr32: Successfully unregistered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:48 +msgid "regsvr32: Failed to install DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:49 +msgid "regsvr32: Successfully installed DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:50 +msgid "regsvr32: Failed to uninstall DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:51 +msgid "regsvr32: Successfully uninstalled DLL '%1'\n" +msgstr "" + #: start.rc:55 msgid "" "Application could not be started, or no application associated with the " diff -Nru wine1.7-1.7.14/po/bg.po wine1.7-1.7.18/po/bg.po --- wine1.7-1.7.14/po/bg.po 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/po/bg.po 2014-05-02 18:15:48.000000000 +0000 @@ -11500,6 +11500,74 @@ "Записва цялото или част от съдържанието на системния регистър във текстов " "файл" +#: regsvr32.rc:32 +msgid "" +"Wine DLL Registration Utility\n" +"\n" +"Provides DLL registration services.\n" +"\n" +msgstr "" + +#: regsvr32.rc:40 +msgid "" +"Usage:\n" +" regsvr32 [/u] [/s] [/n] [/i[:cmdline]] DllName\n" +"\n" +"Options:\n" +" [/u] Unregister a server.\n" +" [/s] Silent mode (no messages will be displayed).\n" +" [/i] Call DllInstall, passing an optional [cmdline].\n" +"\tWhen used with [/u] DllInstall is called in uninstall mode.\n" +" [/n] Do not call DllRegisterServer. This option must be used with [/i].\n" +"\n" +msgstr "" + +#: regsvr32.rc:41 +msgid "" +"regsvr32: Invalid or unrecognized switch [%1]\n" +"\n" +msgstr "" + +#: regsvr32.rc:42 +msgid "regsvr32: Failed to load DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:43 +msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgstr "" + +#: regsvr32.rc:44 +msgid "regsvr32: Failed to register DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:45 +msgid "regsvr32: Successfully registered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:46 +msgid "regsvr32: Failed to unregister DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:47 +msgid "regsvr32: Successfully unregistered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:48 +msgid "regsvr32: Failed to install DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:49 +msgid "regsvr32: Successfully installed DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:50 +msgid "regsvr32: Failed to uninstall DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:51 +msgid "regsvr32: Successfully uninstalled DLL '%1'\n" +msgstr "" + #: start.rc:55 msgid "" "Application could not be started, or no application associated with the " diff -Nru wine1.7-1.7.14/po/ca.po wine1.7-1.7.18/po/ca.po --- wine1.7-1.7.14/po/ca.po 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/po/ca.po 2014-05-02 18:15:48.000000000 +0000 @@ -11856,6 +11856,76 @@ msgid "Exports selected branch of the registry to a text file" msgstr "Exporta la branca del registre seleccionada a un fitxer de text" +#: regsvr32.rc:32 +msgid "" +"Wine DLL Registration Utility\n" +"\n" +"Provides DLL registration services.\n" +"\n" +msgstr "" + +#: regsvr32.rc:40 +msgid "" +"Usage:\n" +" regsvr32 [/u] [/s] [/n] [/i[:cmdline]] DllName\n" +"\n" +"Options:\n" +" [/u] Unregister a server.\n" +" [/s] Silent mode (no messages will be displayed).\n" +" [/i] Call DllInstall, passing an optional [cmdline].\n" +"\tWhen used with [/u] DllInstall is called in uninstall mode.\n" +" [/n] Do not call DllRegisterServer. This option must be used with [/i].\n" +"\n" +msgstr "" + +#: regsvr32.rc:41 +msgid "" +"regsvr32: Invalid or unrecognized switch [%1]\n" +"\n" +msgstr "" + +#: regsvr32.rc:42 +#, fuzzy +#| msgid "Failed to open '%1'\n" +msgid "regsvr32: Failed to load DLL '%1'\n" +msgstr "S'ha fallat en obrir '%1'\n" + +#: regsvr32.rc:43 +msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgstr "" + +#: regsvr32.rc:44 +msgid "regsvr32: Failed to register DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:45 +msgid "regsvr32: Successfully registered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:46 +msgid "regsvr32: Failed to unregister DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:47 +msgid "regsvr32: Successfully unregistered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:48 +msgid "regsvr32: Failed to install DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:49 +msgid "regsvr32: Successfully installed DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:50 +msgid "regsvr32: Failed to uninstall DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:51 +msgid "regsvr32: Successfully uninstalled DLL '%1'\n" +msgstr "" + #: start.rc:55 msgid "" "Application could not be started, or no application associated with the " diff -Nru wine1.7-1.7.14/po/cs.po wine1.7-1.7.18/po/cs.po --- wine1.7-1.7.14/po/cs.po 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/po/cs.po 2014-05-02 18:15:48.000000000 +0000 @@ -11509,6 +11509,76 @@ msgid "Exports selected branch of the registry to a text file" msgstr "Exportuje vybranou větev registru do textového souboru" +#: regsvr32.rc:32 +msgid "" +"Wine DLL Registration Utility\n" +"\n" +"Provides DLL registration services.\n" +"\n" +msgstr "" + +#: regsvr32.rc:40 +msgid "" +"Usage:\n" +" regsvr32 [/u] [/s] [/n] [/i[:cmdline]] DllName\n" +"\n" +"Options:\n" +" [/u] Unregister a server.\n" +" [/s] Silent mode (no messages will be displayed).\n" +" [/i] Call DllInstall, passing an optional [cmdline].\n" +"\tWhen used with [/u] DllInstall is called in uninstall mode.\n" +" [/n] Do not call DllRegisterServer. This option must be used with [/i].\n" +"\n" +msgstr "" + +#: regsvr32.rc:41 +msgid "" +"regsvr32: Invalid or unrecognized switch [%1]\n" +"\n" +msgstr "" + +#: regsvr32.rc:42 +#, fuzzy +#| msgid "Failed to open '%1'\n" +msgid "regsvr32: Failed to load DLL '%1'\n" +msgstr "Otevření „%1“ se nezdařilo\n" + +#: regsvr32.rc:43 +msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgstr "" + +#: regsvr32.rc:44 +msgid "regsvr32: Failed to register DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:45 +msgid "regsvr32: Successfully registered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:46 +msgid "regsvr32: Failed to unregister DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:47 +msgid "regsvr32: Successfully unregistered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:48 +msgid "regsvr32: Failed to install DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:49 +msgid "regsvr32: Successfully installed DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:50 +msgid "regsvr32: Failed to uninstall DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:51 +msgid "regsvr32: Successfully uninstalled DLL '%1'\n" +msgstr "" + #: start.rc:55 msgid "" "Application could not be started, or no application associated with the " diff -Nru wine1.7-1.7.14/po/da.po wine1.7-1.7.18/po/da.po --- wine1.7-1.7.14/po/da.po 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/po/da.po 2014-05-02 18:15:48.000000000 +0000 @@ -11765,6 +11765,76 @@ msgid "Exports selected branch of the registry to a text file" msgstr "Eksporter udvalgte gren af registreringsdatabasen til en tekst fil" +#: regsvr32.rc:32 +msgid "" +"Wine DLL Registration Utility\n" +"\n" +"Provides DLL registration services.\n" +"\n" +msgstr "" + +#: regsvr32.rc:40 +msgid "" +"Usage:\n" +" regsvr32 [/u] [/s] [/n] [/i[:cmdline]] DllName\n" +"\n" +"Options:\n" +" [/u] Unregister a server.\n" +" [/s] Silent mode (no messages will be displayed).\n" +" [/i] Call DllInstall, passing an optional [cmdline].\n" +"\tWhen used with [/u] DllInstall is called in uninstall mode.\n" +" [/n] Do not call DllRegisterServer. This option must be used with [/i].\n" +"\n" +msgstr "" + +#: regsvr32.rc:41 +msgid "" +"regsvr32: Invalid or unrecognized switch [%1]\n" +"\n" +msgstr "" + +#: regsvr32.rc:42 +#, fuzzy +#| msgid "Failed to open '%1'\n" +msgid "regsvr32: Failed to load DLL '%1'\n" +msgstr "Kunne ikke åbne «%1»\n" + +#: regsvr32.rc:43 +msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgstr "" + +#: regsvr32.rc:44 +msgid "regsvr32: Failed to register DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:45 +msgid "regsvr32: Successfully registered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:46 +msgid "regsvr32: Failed to unregister DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:47 +msgid "regsvr32: Successfully unregistered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:48 +msgid "regsvr32: Failed to install DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:49 +msgid "regsvr32: Successfully installed DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:50 +msgid "regsvr32: Failed to uninstall DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:51 +msgid "regsvr32: Successfully uninstalled DLL '%1'\n" +msgstr "" + #: start.rc:55 msgid "" "Application could not be started, or no application associated with the " diff -Nru wine1.7-1.7.14/po/de.po wine1.7-1.7.18/po/de.po --- wine1.7-1.7.14/po/de.po 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/po/de.po 2014-05-02 18:15:48.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: 2013-12-02 22:42+0100\n" +"PO-Revision-Date: 2014-04-17 03:01+0200\n" "Last-Translator: Julian Rüger\n" "Language-Team: none\n" "Language: German\n" @@ -6593,10 +6593,8 @@ msgstr "Der Benutzername konnte nicht gefunden werden.\n" #: winerror.mc:3741 -#, fuzzy -#| msgid "The site does not exist.\n" msgid "This network connection does not exist.\n" -msgstr "Die Seite existiert nicht.\n" +msgstr "Diese Netzwerkverbindung existiert nicht.\n" #: localspl.rc:31 localui.rc:31 winspool.rc:30 msgid "Local Port" @@ -11745,6 +11743,91 @@ msgid "Exports selected branch of the registry to a text file" msgstr "Exportiert den ausgewählten Zweig der Registry in eine Textdatei" +#: regsvr32.rc:32 +msgid "" +"Wine DLL Registration Utility\n" +"\n" +"Provides DLL registration services.\n" +"\n" +msgstr "" +"Wine DLL-Registrierungswerkzeug\n" +"\n" +"Stellt Dienste zur DLL-Registrierung bereit.\n" +"\n" + +#: regsvr32.rc:40 +msgid "" +"Usage:\n" +" regsvr32 [/u] [/s] [/n] [/i[:cmdline]] DllName\n" +"\n" +"Options:\n" +" [/u] Unregister a server.\n" +" [/s] Silent mode (no messages will be displayed).\n" +" [/i] Call DllInstall, passing an optional [cmdline].\n" +"\tWhen used with [/u] DllInstall is called in uninstall mode.\n" +" [/n] Do not call DllRegisterServer. This option must be used with [/i].\n" +"\n" +msgstr "" +"Aufruf:\n" +" regsvr32 [/u] [/s] [/n] [/i[:Befehlszeile]] DllName\n" +"\n" +"Optionen:\n" +" [/u] Registrierung eines Servers aufheben.\n" +" [/s] Stiller Modus (es werden keine Meldungen angezeigt).\n" +" [/i] DllInstall mit einer optionalen [Befehlszeile] aufrufen.\n" +"\tBei Angabe von [/u] wird DLLInstall im Uninstall-Modus aufgerufen.\n" +" [/n] DllRegisterServer nicht aufrufen. Muss in Verbindung mit [/i]\n" +"\tbenutzt werden.\n" +"\n" + +#: regsvr32.rc:41 +msgid "" +"regsvr32: Invalid or unrecognized switch [%1]\n" +"\n" +msgstr "" +"regsvr32: Ungültiges oder nicht erkanntes Argument [%1]\n" +"\n" + +#: regsvr32.rc:42 +msgid "regsvr32: Failed to load DLL '%1'\n" +msgstr "regsvr32: DLL '%1' konnte nicht geladen werden\n" + +#: regsvr32.rc:43 +msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgstr "regsvr32: %1 nicht in DLL '%2' implementiert\n" + +#: regsvr32.rc:44 +msgid "regsvr32: Failed to register DLL '%1'\n" +msgstr "regsvr32: DLL '%1' konnte nicht registriert werden\n" + +#: regsvr32.rc:45 +msgid "regsvr32: Successfully registered DLL '%1'\n" +msgstr "regsvr32: DLL '%1' erfolgreich registriert\n" + +#: regsvr32.rc:46 +msgid "regsvr32: Failed to unregister DLL '%1'\n" +msgstr "regsvr32: Registrierung von DLL '%1' konnte nicht aufgehoben werden\n" + +#: regsvr32.rc:47 +msgid "regsvr32: Successfully unregistered DLL '%1'\n" +msgstr "regsvr32: Registrierung von DLL '%1' erfolgreich aufgehoben\n" + +#: regsvr32.rc:48 +msgid "regsvr32: Failed to install DLL '%1'\n" +msgstr "regsvr32: DLL '%1' konnte nicht installiert werden\n" + +#: regsvr32.rc:49 +msgid "regsvr32: Successfully installed DLL '%1'\n" +msgstr "regsvr32: DLL '%1' erfolgreich installiert\n" + +#: regsvr32.rc:50 +msgid "regsvr32: Failed to uninstall DLL '%1'\n" +msgstr "regsvr32: DLL '%1' konnte nicht deinstalliert werden\n" + +#: regsvr32.rc:51 +msgid "regsvr32: Successfully uninstalled DLL '%1'\n" +msgstr "regsvr32: DLL '%1' erfolgreich deinstalliert\n" + #: start.rc:55 msgid "" "Application could not be started, or no application associated with the " diff -Nru wine1.7-1.7.14/po/el.po wine1.7-1.7.18/po/el.po --- wine1.7-1.7.14/po/el.po 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/po/el.po 2014-05-02 18:15:48.000000000 +0000 @@ -11297,6 +11297,74 @@ msgid "Exports selected branch of the registry to a text file" msgstr "" +#: regsvr32.rc:32 +msgid "" +"Wine DLL Registration Utility\n" +"\n" +"Provides DLL registration services.\n" +"\n" +msgstr "" + +#: regsvr32.rc:40 +msgid "" +"Usage:\n" +" regsvr32 [/u] [/s] [/n] [/i[:cmdline]] DllName\n" +"\n" +"Options:\n" +" [/u] Unregister a server.\n" +" [/s] Silent mode (no messages will be displayed).\n" +" [/i] Call DllInstall, passing an optional [cmdline].\n" +"\tWhen used with [/u] DllInstall is called in uninstall mode.\n" +" [/n] Do not call DllRegisterServer. This option must be used with [/i].\n" +"\n" +msgstr "" + +#: regsvr32.rc:41 +msgid "" +"regsvr32: Invalid or unrecognized switch [%1]\n" +"\n" +msgstr "" + +#: regsvr32.rc:42 +msgid "regsvr32: Failed to load DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:43 +msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgstr "" + +#: regsvr32.rc:44 +msgid "regsvr32: Failed to register DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:45 +msgid "regsvr32: Successfully registered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:46 +msgid "regsvr32: Failed to unregister DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:47 +msgid "regsvr32: Successfully unregistered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:48 +msgid "regsvr32: Failed to install DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:49 +msgid "regsvr32: Successfully installed DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:50 +msgid "regsvr32: Failed to uninstall DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:51 +msgid "regsvr32: Successfully uninstalled DLL '%1'\n" +msgstr "" + #: start.rc:55 msgid "" "Application could not be started, or no application associated with the " diff -Nru wine1.7-1.7.14/po/en.po wine1.7-1.7.18/po/en.po --- wine1.7-1.7.14/po/en.po 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/po/en.po 2014-05-02 18:15:48.000000000 +0000 @@ -11667,6 +11667,90 @@ msgid "Exports selected branch of the registry to a text file" msgstr "Exports selected branch of the registry to a text file" +#: regsvr32.rc:32 +msgid "" +"Wine DLL Registration Utility\n" +"\n" +"Provides DLL registration services.\n" +"\n" +msgstr "" +"Wine DLL Registration Utility\n" +"\n" +"Provides DLL registration services.\n" +"\n" + +#: regsvr32.rc:40 +msgid "" +"Usage:\n" +" regsvr32 [/u] [/s] [/n] [/i[:cmdline]] DllName\n" +"\n" +"Options:\n" +" [/u] Unregister a server.\n" +" [/s] Silent mode (no messages will be displayed).\n" +" [/i] Call DllInstall, passing an optional [cmdline].\n" +"\tWhen used with [/u] DllInstall is called in uninstall mode.\n" +" [/n] Do not call DllRegisterServer. This option must be used with [/i].\n" +"\n" +msgstr "" +"Usage:\n" +" regsvr32 [/u] [/s] [/n] [/i[:cmdline]] DllName\n" +"\n" +"Options:\n" +" [/u] Unregister a server.\n" +" [/s] Silent mode (no messages will be displayed).\n" +" [/i] Call DllInstall, passing an optional [cmdline].\n" +"\tWhen used with [/u] DllInstall is called in uninstall mode.\n" +" [/n] Do not call DllRegisterServer. This option must be used with [/i].\n" +"\n" + +#: regsvr32.rc:41 +msgid "" +"regsvr32: Invalid or unrecognized switch [%1]\n" +"\n" +msgstr "" +"regsvr32: Invalid or unrecognized switch [%1]\n" +"\n" + +#: regsvr32.rc:42 +msgid "regsvr32: Failed to load DLL '%1'\n" +msgstr "regsvr32: Failed to load DLL '%1'\n" + +#: regsvr32.rc:43 +msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgstr "regsvr32: %1 not implemented in DLL '%2'\n" + +#: regsvr32.rc:44 +msgid "regsvr32: Failed to register DLL '%1'\n" +msgstr "regsvr32: Failed to register DLL '%1'\n" + +#: regsvr32.rc:45 +msgid "regsvr32: Successfully registered DLL '%1'\n" +msgstr "regsvr32: Successfully registered DLL '%1'\n" + +#: regsvr32.rc:46 +msgid "regsvr32: Failed to unregister DLL '%1'\n" +msgstr "regsvr32: Failed to unregister DLL '%1'\n" + +#: regsvr32.rc:47 +msgid "regsvr32: Successfully unregistered DLL '%1'\n" +msgstr "regsvr32: Successfully unregistered DLL '%1'\n" + +#: regsvr32.rc:48 +msgid "regsvr32: Failed to install DLL '%1'\n" +msgstr "regsvr32: Failed to install DLL '%1'\n" + +#: regsvr32.rc:49 +msgid "regsvr32: Successfully installed DLL '%1'\n" +msgstr "regsvr32: Successfully installed DLL '%1'\n" + +#: regsvr32.rc:50 +msgid "regsvr32: Failed to uninstall DLL '%1'\n" +msgstr "regsvr32: Failed to uninstall DLL '%1'\n" + +#: regsvr32.rc:51 +msgid "regsvr32: Successfully uninstalled DLL '%1'\n" +msgstr "regsvr32: Successfully uninstalled DLL '%1'\n" + #: start.rc:55 msgid "" "Application could not be started, or no application associated with the " diff -Nru wine1.7-1.7.14/po/en_US.po wine1.7-1.7.18/po/en_US.po --- wine1.7-1.7.14/po/en_US.po 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/po/en_US.po 2014-05-02 18:15:48.000000000 +0000 @@ -11667,6 +11667,90 @@ msgid "Exports selected branch of the registry to a text file" msgstr "Exports selected branch of the registry to a text file" +#: regsvr32.rc:32 +msgid "" +"Wine DLL Registration Utility\n" +"\n" +"Provides DLL registration services.\n" +"\n" +msgstr "" +"Wine DLL Registration Utility\n" +"\n" +"Provides DLL registration services.\n" +"\n" + +#: regsvr32.rc:40 +msgid "" +"Usage:\n" +" regsvr32 [/u] [/s] [/n] [/i[:cmdline]] DllName\n" +"\n" +"Options:\n" +" [/u] Unregister a server.\n" +" [/s] Silent mode (no messages will be displayed).\n" +" [/i] Call DllInstall, passing an optional [cmdline].\n" +"\tWhen used with [/u] DllInstall is called in uninstall mode.\n" +" [/n] Do not call DllRegisterServer. This option must be used with [/i].\n" +"\n" +msgstr "" +"Usage:\n" +" regsvr32 [/u] [/s] [/n] [/i[:cmdline]] DllName\n" +"\n" +"Options:\n" +" [/u] Unregister a server.\n" +" [/s] Silent mode (no messages will be displayed).\n" +" [/i] Call DllInstall, passing an optional [cmdline].\n" +"\tWhen used with [/u] DllInstall is called in uninstall mode.\n" +" [/n] Do not call DllRegisterServer. This option must be used with [/i].\n" +"\n" + +#: regsvr32.rc:41 +msgid "" +"regsvr32: Invalid or unrecognized switch [%1]\n" +"\n" +msgstr "" +"regsvr32: Invalid or unrecognized switch [%1]\n" +"\n" + +#: regsvr32.rc:42 +msgid "regsvr32: Failed to load DLL '%1'\n" +msgstr "regsvr32: Failed to load DLL '%1'\n" + +#: regsvr32.rc:43 +msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgstr "regsvr32: %1 not implemented in DLL '%2'\n" + +#: regsvr32.rc:44 +msgid "regsvr32: Failed to register DLL '%1'\n" +msgstr "regsvr32: Failed to register DLL '%1'\n" + +#: regsvr32.rc:45 +msgid "regsvr32: Successfully registered DLL '%1'\n" +msgstr "regsvr32: Successfully registered DLL '%1'\n" + +#: regsvr32.rc:46 +msgid "regsvr32: Failed to unregister DLL '%1'\n" +msgstr "regsvr32: Failed to unregister DLL '%1'\n" + +#: regsvr32.rc:47 +msgid "regsvr32: Successfully unregistered DLL '%1'\n" +msgstr "regsvr32: Successfully unregistered DLL '%1'\n" + +#: regsvr32.rc:48 +msgid "regsvr32: Failed to install DLL '%1'\n" +msgstr "regsvr32: Failed to install DLL '%1'\n" + +#: regsvr32.rc:49 +msgid "regsvr32: Successfully installed DLL '%1'\n" +msgstr "regsvr32: Successfully installed DLL '%1'\n" + +#: regsvr32.rc:50 +msgid "regsvr32: Failed to uninstall DLL '%1'\n" +msgstr "regsvr32: Failed to uninstall DLL '%1'\n" + +#: regsvr32.rc:51 +msgid "regsvr32: Successfully uninstalled DLL '%1'\n" +msgstr "regsvr32: Successfully uninstalled DLL '%1'\n" + #: start.rc:55 msgid "" "Application could not be started, or no application associated with the " diff -Nru wine1.7-1.7.14/po/eo.po wine1.7-1.7.18/po/eo.po --- wine1.7-1.7.14/po/eo.po 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/po/eo.po 2014-05-02 18:15:48.000000000 +0000 @@ -11163,6 +11163,74 @@ msgid "Exports selected branch of the registry to a text file" msgstr "Eksportas elektitan branĉon de la registrejo al tekstodosiero" +#: regsvr32.rc:32 +msgid "" +"Wine DLL Registration Utility\n" +"\n" +"Provides DLL registration services.\n" +"\n" +msgstr "" + +#: regsvr32.rc:40 +msgid "" +"Usage:\n" +" regsvr32 [/u] [/s] [/n] [/i[:cmdline]] DllName\n" +"\n" +"Options:\n" +" [/u] Unregister a server.\n" +" [/s] Silent mode (no messages will be displayed).\n" +" [/i] Call DllInstall, passing an optional [cmdline].\n" +"\tWhen used with [/u] DllInstall is called in uninstall mode.\n" +" [/n] Do not call DllRegisterServer. This option must be used with [/i].\n" +"\n" +msgstr "" + +#: regsvr32.rc:41 +msgid "" +"regsvr32: Invalid or unrecognized switch [%1]\n" +"\n" +msgstr "" + +#: regsvr32.rc:42 +msgid "regsvr32: Failed to load DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:43 +msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgstr "" + +#: regsvr32.rc:44 +msgid "regsvr32: Failed to register DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:45 +msgid "regsvr32: Successfully registered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:46 +msgid "regsvr32: Failed to unregister DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:47 +msgid "regsvr32: Successfully unregistered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:48 +msgid "regsvr32: Failed to install DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:49 +msgid "regsvr32: Successfully installed DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:50 +msgid "regsvr32: Failed to uninstall DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:51 +msgid "regsvr32: Successfully uninstalled DLL '%1'\n" +msgstr "" + #: start.rc:55 msgid "" "Application could not be started, or no application associated with the " diff -Nru wine1.7-1.7.14/po/es.po wine1.7-1.7.18/po/es.po --- wine1.7-1.7.14/po/es.po 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/po/es.po 2014-05-02 18:15:48.000000000 +0000 @@ -11852,6 +11852,76 @@ msgid "Exports selected branch of the registry to a text file" msgstr "Exporta la rama seleccionada del registro a un archivo de texto" +#: regsvr32.rc:32 +msgid "" +"Wine DLL Registration Utility\n" +"\n" +"Provides DLL registration services.\n" +"\n" +msgstr "" + +#: regsvr32.rc:40 +msgid "" +"Usage:\n" +" regsvr32 [/u] [/s] [/n] [/i[:cmdline]] DllName\n" +"\n" +"Options:\n" +" [/u] Unregister a server.\n" +" [/s] Silent mode (no messages will be displayed).\n" +" [/i] Call DllInstall, passing an optional [cmdline].\n" +"\tWhen used with [/u] DllInstall is called in uninstall mode.\n" +" [/n] Do not call DllRegisterServer. This option must be used with [/i].\n" +"\n" +msgstr "" + +#: regsvr32.rc:41 +msgid "" +"regsvr32: Invalid or unrecognized switch [%1]\n" +"\n" +msgstr "" + +#: regsvr32.rc:42 +#, fuzzy +#| msgid "Failed to open '%1'\n" +msgid "regsvr32: Failed to load DLL '%1'\n" +msgstr "No se pudo abrir '%1'\n" + +#: regsvr32.rc:43 +msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgstr "" + +#: regsvr32.rc:44 +msgid "regsvr32: Failed to register DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:45 +msgid "regsvr32: Successfully registered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:46 +msgid "regsvr32: Failed to unregister DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:47 +msgid "regsvr32: Successfully unregistered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:48 +msgid "regsvr32: Failed to install DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:49 +msgid "regsvr32: Successfully installed DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:50 +msgid "regsvr32: Failed to uninstall DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:51 +msgid "regsvr32: Successfully uninstalled DLL '%1'\n" +msgstr "" + #: start.rc:55 msgid "" "Application could not be started, or no application associated with the " diff -Nru wine1.7-1.7.14/po/fa.po wine1.7-1.7.18/po/fa.po --- wine1.7-1.7.14/po/fa.po 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/po/fa.po 2014-05-02 18:15:48.000000000 +0000 @@ -11304,6 +11304,74 @@ msgid "Exports selected branch of the registry to a text file" msgstr "" +#: regsvr32.rc:32 +msgid "" +"Wine DLL Registration Utility\n" +"\n" +"Provides DLL registration services.\n" +"\n" +msgstr "" + +#: regsvr32.rc:40 +msgid "" +"Usage:\n" +" regsvr32 [/u] [/s] [/n] [/i[:cmdline]] DllName\n" +"\n" +"Options:\n" +" [/u] Unregister a server.\n" +" [/s] Silent mode (no messages will be displayed).\n" +" [/i] Call DllInstall, passing an optional [cmdline].\n" +"\tWhen used with [/u] DllInstall is called in uninstall mode.\n" +" [/n] Do not call DllRegisterServer. This option must be used with [/i].\n" +"\n" +msgstr "" + +#: regsvr32.rc:41 +msgid "" +"regsvr32: Invalid or unrecognized switch [%1]\n" +"\n" +msgstr "" + +#: regsvr32.rc:42 +msgid "regsvr32: Failed to load DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:43 +msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgstr "" + +#: regsvr32.rc:44 +msgid "regsvr32: Failed to register DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:45 +msgid "regsvr32: Successfully registered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:46 +msgid "regsvr32: Failed to unregister DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:47 +msgid "regsvr32: Successfully unregistered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:48 +msgid "regsvr32: Failed to install DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:49 +msgid "regsvr32: Successfully installed DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:50 +msgid "regsvr32: Failed to uninstall DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:51 +msgid "regsvr32: Successfully uninstalled DLL '%1'\n" +msgstr "" + #: start.rc:55 msgid "" "Application could not be started, or no application associated with the " diff -Nru wine1.7-1.7.14/po/fi.po wine1.7-1.7.18/po/fi.po --- wine1.7-1.7.14/po/fi.po 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/po/fi.po 2014-05-02 18:15:48.000000000 +0000 @@ -11647,6 +11647,90 @@ msgid "Exports selected branch of the registry to a text file" msgstr "Vie rekisterin valitun haaran tekstitiedostoon" +#: regsvr32.rc:32 +msgid "" +"Wine DLL Registration Utility\n" +"\n" +"Provides DLL registration services.\n" +"\n" +msgstr "" +"Winen DLL-rekisteröintityökalu\n" +"\n" +"Tuottaa DLL-rekisteröintipalvelut.\n" +"\n" + +#: regsvr32.rc:40 +msgid "" +"Usage:\n" +" regsvr32 [/u] [/s] [/n] [/i[:cmdline]] DllName\n" +"\n" +"Options:\n" +" [/u] Unregister a server.\n" +" [/s] Silent mode (no messages will be displayed).\n" +" [/i] Call DllInstall, passing an optional [cmdline].\n" +"\tWhen used with [/u] DllInstall is called in uninstall mode.\n" +" [/n] Do not call DllRegisterServer. This option must be used with [/i].\n" +"\n" +msgstr "" +"Käyttö:\n" +" regsvr32 [/u] [/s] [/n] [/i[:komentorivi]] Dll-tiedostonNimi\n" +"\n" +"Valitsimet:\n" +" [/u] Pura palvelimen rekisteröinti.\n" +" [/s] Hiljainen tila (mitään viestejä ei näytetä).\n" +" [/i] Kutsu funktiota DllInstall, välitä valinnainen [komentorivi].\n" +"\tValitsimen [/u] kanssa kutsuu funktiota DllInstall poistotilassa.\n" +" [/n] Älä kutsu funktiota DllRegisterServer. Vaatii valitsimen [/i].\n" +"\n" + +#: regsvr32.rc:41 +msgid "" +"regsvr32: Invalid or unrecognized switch [%1]\n" +"\n" +msgstr "" +"regsvr32: Virheellinen tai tuntematon valitsin [%1]\n" +"\n" + +#: regsvr32.rc:42 +msgid "regsvr32: Failed to load DLL '%1'\n" +msgstr "regsvr32: DLL:n '%1' lataaminen epäonnistui\n" + +#: regsvr32.rc:43 +msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgstr "regsvr32: %1-toteutusta ei ole DLL:ssä '%2'\n" + +#: regsvr32.rc:44 +msgid "regsvr32: Failed to register DLL '%1'\n" +msgstr "regsvr32: DLL:n '%1' rekisteröinti epäonnistui\n" + +#: regsvr32.rc:45 +msgid "regsvr32: Successfully registered DLL '%1'\n" +msgstr "regsvr32: DLL '%1' rekisteröity\n" + +#: regsvr32.rc:46 +msgid "regsvr32: Failed to unregister DLL '%1'\n" +msgstr "regsvr32: DLL:n '%1' rekisteröinnin purkaminen epäonnistui\n" + +#: regsvr32.rc:47 +msgid "regsvr32: Successfully unregistered DLL '%1'\n" +msgstr "regsvr32: DLL:n '%1' rekisteröinti purettu\n" + +#: regsvr32.rc:48 +msgid "regsvr32: Failed to install DLL '%1'\n" +msgstr "regsvr32: DLL:n '%1' asennus epäonnistui\n" + +#: regsvr32.rc:49 +msgid "regsvr32: Successfully installed DLL '%1'\n" +msgstr "regsvr32: DLL '%1' asennettu\n" + +#: regsvr32.rc:50 +msgid "regsvr32: Failed to uninstall DLL '%1'\n" +msgstr "regsvr32: DLL:n '%1' asennuksen purku epäonnistui\n" + +#: regsvr32.rc:51 +msgid "regsvr32: Successfully uninstalled DLL '%1'\n" +msgstr "regsvr32: DLL:n '%1' asennus purettu\n" + #: start.rc:55 msgid "" "Application could not be started, or no application associated with the " diff -Nru wine1.7-1.7.14/po/fr.po wine1.7-1.7.18/po/fr.po --- wine1.7-1.7.14/po/fr.po 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/po/fr.po 2014-05-02 18:15:48.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: 2014-01-16 23:01+0100\n" +"PO-Revision-Date: 2014-04-19 09:10+0100\n" "Last-Translator: Frédéric Delanoy \n" "Language-Team: none\n" "Language: French\n" @@ -6615,10 +6615,8 @@ msgstr "Nom d'utilisateur introuvable.\n" #: winerror.mc:3741 -#, fuzzy -#| msgid "The site does not exist.\n" msgid "This network connection does not exist.\n" -msgstr "Le site n'existe pas.\n" +msgstr "Cette connexion réseau n'existe pas.\n" #: localspl.rc:31 localui.rc:31 winspool.rc:30 msgid "Local Port" @@ -11803,6 +11801,92 @@ msgid "Exports selected branch of the registry to a text file" msgstr "Exporte la branche du registre sélectionnée dans un fichier texte" +#: regsvr32.rc:32 +msgid "" +"Wine DLL Registration Utility\n" +"\n" +"Provides DLL registration services.\n" +"\n" +msgstr "" +"Utilitaire d'enregistrement de DLL de Wine\n" +"\n" +"Fournit des services d'enregistrement de DLL.\n" +"\n" + +#: regsvr32.rc:40 +msgid "" +"Usage:\n" +" regsvr32 [/u] [/s] [/n] [/i[:cmdline]] DllName\n" +"\n" +"Options:\n" +" [/u] Unregister a server.\n" +" [/s] Silent mode (no messages will be displayed).\n" +" [/i] Call DllInstall, passing an optional [cmdline].\n" +"\tWhen used with [/u] DllInstall is called in uninstall mode.\n" +" [/n] Do not call DllRegisterServer. This option must be used with [/i].\n" +"\n" +msgstr "" +"Usage :\n" +" regsvr32 [/u] [/s] [/n] [/i[:commande]] NomDLL\n" +"\n" +"Options:\n" +" [/u] Annuler l'enregistrement d'un serveur.\n" +" [/s] Mode silencieux (aucun message ne sera affiché).\n" +" [/i] Appeler DllInstall, en passant une [commande] facultative.\n" +"\tQuand [/u] est utilisée, DllInstall est appelé en mode de " +"désinstallation.\n" +" [/n] Ne pas appeler DllRegisterServer. Cette option doit être utilisée " +"avec [/i].\n" +"\n" + +#: regsvr32.rc:41 +msgid "" +"regsvr32: Invalid or unrecognized switch [%1]\n" +"\n" +msgstr "" +"regsvr32: Option [%1] invalide ou non reconnue\n" +"\n" + +#: regsvr32.rc:42 +msgid "regsvr32: Failed to load DLL '%1'\n" +msgstr "regsvr32 : Impossible de charger la DLL « %1 »\n" + +#: regsvr32.rc:43 +msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgstr "regsvr32 : %1 non implémentée dans la DLL « %2 »\n" + +#: regsvr32.rc:44 +msgid "regsvr32: Failed to register DLL '%1'\n" +msgstr "regsvr32 : Impossible d'enregistrer la DLL « %1 »\n" + +#: regsvr32.rc:45 +msgid "regsvr32: Successfully registered DLL '%1'\n" +msgstr "regsvr32 : DLL « %1 » enregistrée avec succès\n" + +#: regsvr32.rc:46 +msgid "regsvr32: Failed to unregister DLL '%1'\n" +msgstr "regsvr32 : Impossible d'enregistrer la DLL « %1 »\n" + +#: regsvr32.rc:47 +msgid "regsvr32: Successfully unregistered DLL '%1'\n" +msgstr "regsvr32 : DLL « %1 » désenregistrée avec succès\n" + +#: regsvr32.rc:48 +msgid "regsvr32: Failed to install DLL '%1'\n" +msgstr "regsvr32 : Impossible d'installer la DLL « %1 »\n" + +#: regsvr32.rc:49 +msgid "regsvr32: Successfully installed DLL '%1'\n" +msgstr "regsvr32 : DLL « %1 » installée avec succès\n" + +#: regsvr32.rc:50 +msgid "regsvr32: Failed to uninstall DLL '%1'\n" +msgstr "regsvr32 : Impossible de désinstaller la DLL « %1 »\n" + +#: regsvr32.rc:51 +msgid "regsvr32: Successfully uninstalled DLL '%1'\n" +msgstr "regsvr32 : DLL « %1 » désinstallée avec succès\n" + #: start.rc:55 msgid "" "Application could not be started, or no application associated with the " diff -Nru wine1.7-1.7.14/po/he.po wine1.7-1.7.18/po/he.po --- wine1.7-1.7.14/po/he.po 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/po/he.po 2014-05-02 18:15:48.000000000 +0000 @@ -11840,6 +11840,76 @@ msgid "Exports selected branch of the registry to a text file" msgstr "יצוא הענף הנבחר מרישום המערכת לקובץ טקסט" +#: regsvr32.rc:32 +msgid "" +"Wine DLL Registration Utility\n" +"\n" +"Provides DLL registration services.\n" +"\n" +msgstr "" + +#: regsvr32.rc:40 +msgid "" +"Usage:\n" +" regsvr32 [/u] [/s] [/n] [/i[:cmdline]] DllName\n" +"\n" +"Options:\n" +" [/u] Unregister a server.\n" +" [/s] Silent mode (no messages will be displayed).\n" +" [/i] Call DllInstall, passing an optional [cmdline].\n" +"\tWhen used with [/u] DllInstall is called in uninstall mode.\n" +" [/n] Do not call DllRegisterServer. This option must be used with [/i].\n" +"\n" +msgstr "" + +#: regsvr32.rc:41 +msgid "" +"regsvr32: Invalid or unrecognized switch [%1]\n" +"\n" +msgstr "" + +#: regsvr32.rc:42 +#, fuzzy +#| msgid "Failed to open '%1'\n" +msgid "regsvr32: Failed to load DLL '%1'\n" +msgstr "Failed to open '%1'\n" + +#: regsvr32.rc:43 +msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgstr "" + +#: regsvr32.rc:44 +msgid "regsvr32: Failed to register DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:45 +msgid "regsvr32: Successfully registered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:46 +msgid "regsvr32: Failed to unregister DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:47 +msgid "regsvr32: Successfully unregistered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:48 +msgid "regsvr32: Failed to install DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:49 +msgid "regsvr32: Successfully installed DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:50 +msgid "regsvr32: Failed to uninstall DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:51 +msgid "regsvr32: Successfully uninstalled DLL '%1'\n" +msgstr "" + #: start.rc:55 msgid "" "Application could not be started, or no application associated with the " diff -Nru wine1.7-1.7.14/po/hi.po wine1.7-1.7.18/po/hi.po --- wine1.7-1.7.14/po/hi.po 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/po/hi.po 2014-05-02 18:15:48.000000000 +0000 @@ -11118,6 +11118,74 @@ msgid "Exports selected branch of the registry to a text file" msgstr "" +#: regsvr32.rc:32 +msgid "" +"Wine DLL Registration Utility\n" +"\n" +"Provides DLL registration services.\n" +"\n" +msgstr "" + +#: regsvr32.rc:40 +msgid "" +"Usage:\n" +" regsvr32 [/u] [/s] [/n] [/i[:cmdline]] DllName\n" +"\n" +"Options:\n" +" [/u] Unregister a server.\n" +" [/s] Silent mode (no messages will be displayed).\n" +" [/i] Call DllInstall, passing an optional [cmdline].\n" +"\tWhen used with [/u] DllInstall is called in uninstall mode.\n" +" [/n] Do not call DllRegisterServer. This option must be used with [/i].\n" +"\n" +msgstr "" + +#: regsvr32.rc:41 +msgid "" +"regsvr32: Invalid or unrecognized switch [%1]\n" +"\n" +msgstr "" + +#: regsvr32.rc:42 +msgid "regsvr32: Failed to load DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:43 +msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgstr "" + +#: regsvr32.rc:44 +msgid "regsvr32: Failed to register DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:45 +msgid "regsvr32: Successfully registered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:46 +msgid "regsvr32: Failed to unregister DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:47 +msgid "regsvr32: Successfully unregistered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:48 +msgid "regsvr32: Failed to install DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:49 +msgid "regsvr32: Successfully installed DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:50 +msgid "regsvr32: Failed to uninstall DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:51 +msgid "regsvr32: Successfully uninstalled DLL '%1'\n" +msgstr "" + #: start.rc:55 msgid "" "Application could not be started, or no application associated with the " diff -Nru wine1.7-1.7.14/po/hr.po wine1.7-1.7.18/po/hr.po --- wine1.7-1.7.14/po/hr.po 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/po/hr.po 2014-05-02 18:15:48.000000000 +0000 @@ -11327,6 +11327,76 @@ msgid "Exports selected branch of the registry to a text file" msgstr "" +#: regsvr32.rc:32 +msgid "" +"Wine DLL Registration Utility\n" +"\n" +"Provides DLL registration services.\n" +"\n" +msgstr "" + +#: regsvr32.rc:40 +msgid "" +"Usage:\n" +" regsvr32 [/u] [/s] [/n] [/i[:cmdline]] DllName\n" +"\n" +"Options:\n" +" [/u] Unregister a server.\n" +" [/s] Silent mode (no messages will be displayed).\n" +" [/i] Call DllInstall, passing an optional [cmdline].\n" +"\tWhen used with [/u] DllInstall is called in uninstall mode.\n" +" [/n] Do not call DllRegisterServer. This option must be used with [/i].\n" +"\n" +msgstr "" + +#: regsvr32.rc:41 +msgid "" +"regsvr32: Invalid or unrecognized switch [%1]\n" +"\n" +msgstr "" + +#: regsvr32.rc:42 +#, fuzzy +#| msgid "Failed to open '%1'\n" +msgid "regsvr32: Failed to load DLL '%1'\n" +msgstr "Neuspjelo otvaranje '%1'\n" + +#: regsvr32.rc:43 +msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgstr "" + +#: regsvr32.rc:44 +msgid "regsvr32: Failed to register DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:45 +msgid "regsvr32: Successfully registered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:46 +msgid "regsvr32: Failed to unregister DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:47 +msgid "regsvr32: Successfully unregistered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:48 +msgid "regsvr32: Failed to install DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:49 +msgid "regsvr32: Successfully installed DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:50 +msgid "regsvr32: Failed to uninstall DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:51 +msgid "regsvr32: Successfully uninstalled DLL '%1'\n" +msgstr "" + #: start.rc:55 msgid "" "Application could not be started, or no application associated with the " diff -Nru wine1.7-1.7.14/po/hu.po wine1.7-1.7.18/po/hu.po --- wine1.7-1.7.14/po/hu.po 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/po/hu.po 2014-05-02 18:15:48.000000000 +0000 @@ -11771,6 +11771,76 @@ msgid "Exports selected branch of the registry to a text file" msgstr "Az egész kijelölt regisztrációs ágat kiexportálja egy szövegfájlba" +#: regsvr32.rc:32 +msgid "" +"Wine DLL Registration Utility\n" +"\n" +"Provides DLL registration services.\n" +"\n" +msgstr "" + +#: regsvr32.rc:40 +msgid "" +"Usage:\n" +" regsvr32 [/u] [/s] [/n] [/i[:cmdline]] DllName\n" +"\n" +"Options:\n" +" [/u] Unregister a server.\n" +" [/s] Silent mode (no messages will be displayed).\n" +" [/i] Call DllInstall, passing an optional [cmdline].\n" +"\tWhen used with [/u] DllInstall is called in uninstall mode.\n" +" [/n] Do not call DllRegisterServer. This option must be used with [/i].\n" +"\n" +msgstr "" + +#: regsvr32.rc:41 +msgid "" +"regsvr32: Invalid or unrecognized switch [%1]\n" +"\n" +msgstr "" + +#: regsvr32.rc:42 +#, fuzzy +#| msgid "Failed to open '%1'\n" +msgid "regsvr32: Failed to load DLL '%1'\n" +msgstr "'%1' megnyitása sikertelen\n" + +#: regsvr32.rc:43 +msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgstr "" + +#: regsvr32.rc:44 +msgid "regsvr32: Failed to register DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:45 +msgid "regsvr32: Successfully registered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:46 +msgid "regsvr32: Failed to unregister DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:47 +msgid "regsvr32: Successfully unregistered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:48 +msgid "regsvr32: Failed to install DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:49 +msgid "regsvr32: Successfully installed DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:50 +msgid "regsvr32: Failed to uninstall DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:51 +msgid "regsvr32: Successfully uninstalled DLL '%1'\n" +msgstr "" + #: start.rc:55 msgid "" "Application could not be started, or no application associated with the " diff -Nru wine1.7-1.7.14/po/it.po wine1.7-1.7.18/po/it.po --- wine1.7-1.7.14/po/it.po 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/po/it.po 2014-05-02 18:15:48.000000000 +0000 @@ -11852,6 +11852,76 @@ msgid "Exports selected branch of the registry to a text file" msgstr "Esporta il ramo selezionato del registro in un file di testo" +#: regsvr32.rc:32 +msgid "" +"Wine DLL Registration Utility\n" +"\n" +"Provides DLL registration services.\n" +"\n" +msgstr "" + +#: regsvr32.rc:40 +msgid "" +"Usage:\n" +" regsvr32 [/u] [/s] [/n] [/i[:cmdline]] DllName\n" +"\n" +"Options:\n" +" [/u] Unregister a server.\n" +" [/s] Silent mode (no messages will be displayed).\n" +" [/i] Call DllInstall, passing an optional [cmdline].\n" +"\tWhen used with [/u] DllInstall is called in uninstall mode.\n" +" [/n] Do not call DllRegisterServer. This option must be used with [/i].\n" +"\n" +msgstr "" + +#: regsvr32.rc:41 +msgid "" +"regsvr32: Invalid or unrecognized switch [%1]\n" +"\n" +msgstr "" + +#: regsvr32.rc:42 +#, fuzzy +#| msgid "Failed to open '%1'\n" +msgid "regsvr32: Failed to load DLL '%1'\n" +msgstr "Impossibile aprire '%1'\n" + +#: regsvr32.rc:43 +msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgstr "" + +#: regsvr32.rc:44 +msgid "regsvr32: Failed to register DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:45 +msgid "regsvr32: Successfully registered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:46 +msgid "regsvr32: Failed to unregister DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:47 +msgid "regsvr32: Successfully unregistered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:48 +msgid "regsvr32: Failed to install DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:49 +msgid "regsvr32: Successfully installed DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:50 +msgid "regsvr32: Failed to uninstall DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:51 +msgid "regsvr32: Successfully uninstalled DLL '%1'\n" +msgstr "" + #: start.rc:55 msgid "" "Application could not be started, or no application associated with the " diff -Nru wine1.7-1.7.14/po/ja.po wine1.7-1.7.18/po/ja.po --- wine1.7-1.7.14/po/ja.po 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/po/ja.po 2014-05-02 18:15:48.000000000 +0000 @@ -11661,6 +11661,76 @@ msgid "Exports selected branch of the registry to a text file" msgstr "選択したレジストリ キー以下をテキスト ファイルに出力" +#: regsvr32.rc:32 +msgid "" +"Wine DLL Registration Utility\n" +"\n" +"Provides DLL registration services.\n" +"\n" +msgstr "" + +#: regsvr32.rc:40 +msgid "" +"Usage:\n" +" regsvr32 [/u] [/s] [/n] [/i[:cmdline]] DllName\n" +"\n" +"Options:\n" +" [/u] Unregister a server.\n" +" [/s] Silent mode (no messages will be displayed).\n" +" [/i] Call DllInstall, passing an optional [cmdline].\n" +"\tWhen used with [/u] DllInstall is called in uninstall mode.\n" +" [/n] Do not call DllRegisterServer. This option must be used with [/i].\n" +"\n" +msgstr "" + +#: regsvr32.rc:41 +msgid "" +"regsvr32: Invalid or unrecognized switch [%1]\n" +"\n" +msgstr "" + +#: regsvr32.rc:42 +#, fuzzy +#| msgid "Failed to open '%1'\n" +msgid "regsvr32: Failed to load DLL '%1'\n" +msgstr "'%1' を開けません\n" + +#: regsvr32.rc:43 +msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgstr "" + +#: regsvr32.rc:44 +msgid "regsvr32: Failed to register DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:45 +msgid "regsvr32: Successfully registered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:46 +msgid "regsvr32: Failed to unregister DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:47 +msgid "regsvr32: Successfully unregistered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:48 +msgid "regsvr32: Failed to install DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:49 +msgid "regsvr32: Successfully installed DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:50 +msgid "regsvr32: Failed to uninstall DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:51 +msgid "regsvr32: Successfully uninstalled DLL '%1'\n" +msgstr "" + #: start.rc:55 msgid "" "Application could not be started, or no application associated with the " diff -Nru wine1.7-1.7.14/po/ko.po wine1.7-1.7.18/po/ko.po --- wine1.7-1.7.14/po/ko.po 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/po/ko.po 2014-05-02 18:15:48.000000000 +0000 @@ -11652,6 +11652,76 @@ msgid "Exports selected branch of the registry to a text file" msgstr "레지스트리의 선택된 부분을 텍스트 파일로 내보내기" +#: regsvr32.rc:32 +msgid "" +"Wine DLL Registration Utility\n" +"\n" +"Provides DLL registration services.\n" +"\n" +msgstr "" + +#: regsvr32.rc:40 +msgid "" +"Usage:\n" +" regsvr32 [/u] [/s] [/n] [/i[:cmdline]] DllName\n" +"\n" +"Options:\n" +" [/u] Unregister a server.\n" +" [/s] Silent mode (no messages will be displayed).\n" +" [/i] Call DllInstall, passing an optional [cmdline].\n" +"\tWhen used with [/u] DllInstall is called in uninstall mode.\n" +" [/n] Do not call DllRegisterServer. This option must be used with [/i].\n" +"\n" +msgstr "" + +#: regsvr32.rc:41 +msgid "" +"regsvr32: Invalid or unrecognized switch [%1]\n" +"\n" +msgstr "" + +#: regsvr32.rc:42 +#, fuzzy +#| msgid "Failed to open '%1'\n" +msgid "regsvr32: Failed to load DLL '%1'\n" +msgstr "'%1' 열기 실패\n" + +#: regsvr32.rc:43 +msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgstr "" + +#: regsvr32.rc:44 +msgid "regsvr32: Failed to register DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:45 +msgid "regsvr32: Successfully registered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:46 +msgid "regsvr32: Failed to unregister DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:47 +msgid "regsvr32: Successfully unregistered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:48 +msgid "regsvr32: Failed to install DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:49 +msgid "regsvr32: Successfully installed DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:50 +msgid "regsvr32: Failed to uninstall DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:51 +msgid "regsvr32: Successfully uninstalled DLL '%1'\n" +msgstr "" + #: start.rc:55 msgid "" "Application could not be started, or no application associated with the " diff -Nru wine1.7-1.7.14/po/lt.po wine1.7-1.7.18/po/lt.po --- wine1.7-1.7.14/po/lt.po 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/po/lt.po 2014-05-02 18:15:48.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: 2014-02-10 22:51+0300\n" +"PO-Revision-Date: 2014-04-03 21:16+0300\n" "Last-Translator: Aurimas Fišeras \n" "Language-Team: komp_lt@konf.lt\n" "Language: Lithuanian\n" @@ -11673,6 +11673,90 @@ msgid "Exports selected branch of the registry to a text file" msgstr "Eksportuoja pasirinktą registro šaką į tekstinį failą" +#: regsvr32.rc:32 +msgid "" +"Wine DLL Registration Utility\n" +"\n" +"Provides DLL registration services.\n" +"\n" +msgstr "" +"Wine DLL bibliotekų registravimo programa\n" +"\n" +"Teikia DLL bibliotekų registravimo paslaugą.\n" +"\n" + +#: regsvr32.rc:40 +msgid "" +"Usage:\n" +" regsvr32 [/u] [/s] [/n] [/i[:cmdline]] DllName\n" +"\n" +"Options:\n" +" [/u] Unregister a server.\n" +" [/s] Silent mode (no messages will be displayed).\n" +" [/i] Call DllInstall, passing an optional [cmdline].\n" +"\tWhen used with [/u] DllInstall is called in uninstall mode.\n" +" [/n] Do not call DllRegisterServer. This option must be used with [/i].\n" +"\n" +msgstr "" +"Naudojimas:\n" +" regsvr32 [/u] [/s] [/n] [/i[:cmdeilutė]] DllVardas\n" +"\n" +"Parametrai:\n" +" [/u] Išregistruoti serverį.\n" +" [/s] Tyli veiksena (nebus rodomi pranešimai).\n" +" [/i] Kviesti „DllInstall“, perduodant nebūtiną [cmdeilutę].\n" +"\tKai naudojama su [/u], „DllInstall“ kviečiamas pašalinimo veiksenoje.\n" +" [/n] Nekviesti „DllRegisterServer“. Privalo būti naudojamas su [/i].\n" +"\n" + +#: regsvr32.rc:41 +msgid "" +"regsvr32: Invalid or unrecognized switch [%1]\n" +"\n" +msgstr "" +"regsvr32: Netinkamas arba neatpažintas parametras [%1]\n" +"\n" + +#: regsvr32.rc:42 +msgid "regsvr32: Failed to load DLL '%1'\n" +msgstr "regsvr32: Nepavyko įkelti DLL bibliotekos „%1“\n" + +#: regsvr32.rc:43 +msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgstr "regsvr32: %1 neįgyvendinta DLL bibliotekoje „%2“\n" + +#: regsvr32.rc:44 +msgid "regsvr32: Failed to register DLL '%1'\n" +msgstr "regsvr32: Nepavyko užregistruoti DLL bibliotekos „%1“\n" + +#: regsvr32.rc:45 +msgid "regsvr32: Successfully registered DLL '%1'\n" +msgstr "regsvr32: Sėkmingai užregistruota DLL biblioteka „%1“\n" + +#: regsvr32.rc:46 +msgid "regsvr32: Failed to unregister DLL '%1'\n" +msgstr "regsvr32: Nepavyko išregistruoti DLL bibliotekos „%1“\n" + +#: regsvr32.rc:47 +msgid "regsvr32: Successfully unregistered DLL '%1'\n" +msgstr "regsvr32: Sėkmingai išregistruota DLL biblioteka „%1“\n" + +#: regsvr32.rc:48 +msgid "regsvr32: Failed to install DLL '%1'\n" +msgstr "regsvr32: Nepavyko įdiegti DLL bibliotekos „%1“\n" + +#: regsvr32.rc:49 +msgid "regsvr32: Successfully installed DLL '%1'\n" +msgstr "regsvr32: Sėkmingai įdiegta DLL biblioteka „%1“\n" + +#: regsvr32.rc:50 +msgid "regsvr32: Failed to uninstall DLL '%1'\n" +msgstr "regsvr32: Nepavyko pašalinti DLL bibliotekos „%1“\n" + +#: regsvr32.rc:51 +msgid "regsvr32: Successfully uninstalled DLL '%1'\n" +msgstr "regsvr32: Sėkmingai pašalinta DLL biblioteka „%1“\n" + #: start.rc:55 msgid "" "Application could not be started, or no application associated with the " diff -Nru wine1.7-1.7.14/po/ml.po wine1.7-1.7.18/po/ml.po --- wine1.7-1.7.14/po/ml.po 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/po/ml.po 2014-05-02 18:15:48.000000000 +0000 @@ -11118,6 +11118,74 @@ msgid "Exports selected branch of the registry to a text file" msgstr "" +#: regsvr32.rc:32 +msgid "" +"Wine DLL Registration Utility\n" +"\n" +"Provides DLL registration services.\n" +"\n" +msgstr "" + +#: regsvr32.rc:40 +msgid "" +"Usage:\n" +" regsvr32 [/u] [/s] [/n] [/i[:cmdline]] DllName\n" +"\n" +"Options:\n" +" [/u] Unregister a server.\n" +" [/s] Silent mode (no messages will be displayed).\n" +" [/i] Call DllInstall, passing an optional [cmdline].\n" +"\tWhen used with [/u] DllInstall is called in uninstall mode.\n" +" [/n] Do not call DllRegisterServer. This option must be used with [/i].\n" +"\n" +msgstr "" + +#: regsvr32.rc:41 +msgid "" +"regsvr32: Invalid or unrecognized switch [%1]\n" +"\n" +msgstr "" + +#: regsvr32.rc:42 +msgid "regsvr32: Failed to load DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:43 +msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgstr "" + +#: regsvr32.rc:44 +msgid "regsvr32: Failed to register DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:45 +msgid "regsvr32: Successfully registered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:46 +msgid "regsvr32: Failed to unregister DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:47 +msgid "regsvr32: Successfully unregistered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:48 +msgid "regsvr32: Failed to install DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:49 +msgid "regsvr32: Successfully installed DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:50 +msgid "regsvr32: Failed to uninstall DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:51 +msgid "regsvr32: Successfully uninstalled DLL '%1'\n" +msgstr "" + #: start.rc:55 msgid "" "Application could not be started, or no application associated with the " diff -Nru wine1.7-1.7.14/po/nb_NO.po wine1.7-1.7.18/po/nb_NO.po --- wine1.7-1.7.14/po/nb_NO.po 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/po/nb_NO.po 2014-05-02 18:15:48.000000000 +0000 @@ -11670,6 +11670,76 @@ msgid "Exports selected branch of the registry to a text file" msgstr "Eksporterer den valgte greinen av registeret til en tekstfil" +#: regsvr32.rc:32 +msgid "" +"Wine DLL Registration Utility\n" +"\n" +"Provides DLL registration services.\n" +"\n" +msgstr "" + +#: regsvr32.rc:40 +msgid "" +"Usage:\n" +" regsvr32 [/u] [/s] [/n] [/i[:cmdline]] DllName\n" +"\n" +"Options:\n" +" [/u] Unregister a server.\n" +" [/s] Silent mode (no messages will be displayed).\n" +" [/i] Call DllInstall, passing an optional [cmdline].\n" +"\tWhen used with [/u] DllInstall is called in uninstall mode.\n" +" [/n] Do not call DllRegisterServer. This option must be used with [/i].\n" +"\n" +msgstr "" + +#: regsvr32.rc:41 +msgid "" +"regsvr32: Invalid or unrecognized switch [%1]\n" +"\n" +msgstr "" + +#: regsvr32.rc:42 +#, fuzzy +#| msgid "Failed to open '%1'\n" +msgid "regsvr32: Failed to load DLL '%1'\n" +msgstr "Klarte ikke åpne «%1»\n" + +#: regsvr32.rc:43 +msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgstr "" + +#: regsvr32.rc:44 +msgid "regsvr32: Failed to register DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:45 +msgid "regsvr32: Successfully registered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:46 +msgid "regsvr32: Failed to unregister DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:47 +msgid "regsvr32: Successfully unregistered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:48 +msgid "regsvr32: Failed to install DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:49 +msgid "regsvr32: Successfully installed DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:50 +msgid "regsvr32: Failed to uninstall DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:51 +msgid "regsvr32: Successfully uninstalled DLL '%1'\n" +msgstr "" + #: start.rc:55 msgid "" "Application could not be started, or no application associated with the " diff -Nru wine1.7-1.7.14/po/nl.po wine1.7-1.7.18/po/nl.po --- wine1.7-1.7.14/po/nl.po 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/po/nl.po 2014-05-02 18:15:48.000000000 +0000 @@ -11818,6 +11818,76 @@ "Exporteert de geselecteerde subsleutel van het register naar een tekst " "bestand" +#: regsvr32.rc:32 +msgid "" +"Wine DLL Registration Utility\n" +"\n" +"Provides DLL registration services.\n" +"\n" +msgstr "" + +#: regsvr32.rc:40 +msgid "" +"Usage:\n" +" regsvr32 [/u] [/s] [/n] [/i[:cmdline]] DllName\n" +"\n" +"Options:\n" +" [/u] Unregister a server.\n" +" [/s] Silent mode (no messages will be displayed).\n" +" [/i] Call DllInstall, passing an optional [cmdline].\n" +"\tWhen used with [/u] DllInstall is called in uninstall mode.\n" +" [/n] Do not call DllRegisterServer. This option must be used with [/i].\n" +"\n" +msgstr "" + +#: regsvr32.rc:41 +msgid "" +"regsvr32: Invalid or unrecognized switch [%1]\n" +"\n" +msgstr "" + +#: regsvr32.rc:42 +#, fuzzy +#| msgid "Failed to open '%1'\n" +msgid "regsvr32: Failed to load DLL '%1'\n" +msgstr "Openen van '%1' is mislukt\n" + +#: regsvr32.rc:43 +msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgstr "" + +#: regsvr32.rc:44 +msgid "regsvr32: Failed to register DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:45 +msgid "regsvr32: Successfully registered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:46 +msgid "regsvr32: Failed to unregister DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:47 +msgid "regsvr32: Successfully unregistered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:48 +msgid "regsvr32: Failed to install DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:49 +msgid "regsvr32: Successfully installed DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:50 +msgid "regsvr32: Failed to uninstall DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:51 +msgid "regsvr32: Successfully uninstalled DLL '%1'\n" +msgstr "" + #: start.rc:55 msgid "" "Application could not be started, or no application associated with the " diff -Nru wine1.7-1.7.14/po/or.po wine1.7-1.7.18/po/or.po --- wine1.7-1.7.14/po/or.po 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/po/or.po 2014-05-02 18:15:48.000000000 +0000 @@ -11118,6 +11118,74 @@ msgid "Exports selected branch of the registry to a text file" msgstr "" +#: regsvr32.rc:32 +msgid "" +"Wine DLL Registration Utility\n" +"\n" +"Provides DLL registration services.\n" +"\n" +msgstr "" + +#: regsvr32.rc:40 +msgid "" +"Usage:\n" +" regsvr32 [/u] [/s] [/n] [/i[:cmdline]] DllName\n" +"\n" +"Options:\n" +" [/u] Unregister a server.\n" +" [/s] Silent mode (no messages will be displayed).\n" +" [/i] Call DllInstall, passing an optional [cmdline].\n" +"\tWhen used with [/u] DllInstall is called in uninstall mode.\n" +" [/n] Do not call DllRegisterServer. This option must be used with [/i].\n" +"\n" +msgstr "" + +#: regsvr32.rc:41 +msgid "" +"regsvr32: Invalid or unrecognized switch [%1]\n" +"\n" +msgstr "" + +#: regsvr32.rc:42 +msgid "regsvr32: Failed to load DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:43 +msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgstr "" + +#: regsvr32.rc:44 +msgid "regsvr32: Failed to register DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:45 +msgid "regsvr32: Successfully registered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:46 +msgid "regsvr32: Failed to unregister DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:47 +msgid "regsvr32: Successfully unregistered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:48 +msgid "regsvr32: Failed to install DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:49 +msgid "regsvr32: Successfully installed DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:50 +msgid "regsvr32: Failed to uninstall DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:51 +msgid "regsvr32: Successfully uninstalled DLL '%1'\n" +msgstr "" + #: start.rc:55 msgid "" "Application could not be started, or no application associated with the " diff -Nru wine1.7-1.7.14/po/pa.po wine1.7-1.7.18/po/pa.po --- wine1.7-1.7.14/po/pa.po 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/po/pa.po 2014-05-02 18:15:48.000000000 +0000 @@ -11118,6 +11118,74 @@ msgid "Exports selected branch of the registry to a text file" msgstr "" +#: regsvr32.rc:32 +msgid "" +"Wine DLL Registration Utility\n" +"\n" +"Provides DLL registration services.\n" +"\n" +msgstr "" + +#: regsvr32.rc:40 +msgid "" +"Usage:\n" +" regsvr32 [/u] [/s] [/n] [/i[:cmdline]] DllName\n" +"\n" +"Options:\n" +" [/u] Unregister a server.\n" +" [/s] Silent mode (no messages will be displayed).\n" +" [/i] Call DllInstall, passing an optional [cmdline].\n" +"\tWhen used with [/u] DllInstall is called in uninstall mode.\n" +" [/n] Do not call DllRegisterServer. This option must be used with [/i].\n" +"\n" +msgstr "" + +#: regsvr32.rc:41 +msgid "" +"regsvr32: Invalid or unrecognized switch [%1]\n" +"\n" +msgstr "" + +#: regsvr32.rc:42 +msgid "regsvr32: Failed to load DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:43 +msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgstr "" + +#: regsvr32.rc:44 +msgid "regsvr32: Failed to register DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:45 +msgid "regsvr32: Successfully registered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:46 +msgid "regsvr32: Failed to unregister DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:47 +msgid "regsvr32: Successfully unregistered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:48 +msgid "regsvr32: Failed to install DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:49 +msgid "regsvr32: Successfully installed DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:50 +msgid "regsvr32: Failed to uninstall DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:51 +msgid "regsvr32: Successfully uninstalled DLL '%1'\n" +msgstr "" + #: start.rc:55 msgid "" "Application could not be started, or no application associated with the " diff -Nru wine1.7-1.7.14/po/pl.po wine1.7-1.7.18/po/pl.po --- wine1.7-1.7.14/po/pl.po 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/po/pl.po 2014-05-02 18:15:48.000000000 +0000 @@ -11727,6 +11727,76 @@ msgid "Exports selected branch of the registry to a text file" msgstr "Eksportuje zaznaczoną gałąź rejestru do pliku tekstowego" +#: regsvr32.rc:32 +msgid "" +"Wine DLL Registration Utility\n" +"\n" +"Provides DLL registration services.\n" +"\n" +msgstr "" + +#: regsvr32.rc:40 +msgid "" +"Usage:\n" +" regsvr32 [/u] [/s] [/n] [/i[:cmdline]] DllName\n" +"\n" +"Options:\n" +" [/u] Unregister a server.\n" +" [/s] Silent mode (no messages will be displayed).\n" +" [/i] Call DllInstall, passing an optional [cmdline].\n" +"\tWhen used with [/u] DllInstall is called in uninstall mode.\n" +" [/n] Do not call DllRegisterServer. This option must be used with [/i].\n" +"\n" +msgstr "" + +#: regsvr32.rc:41 +msgid "" +"regsvr32: Invalid or unrecognized switch [%1]\n" +"\n" +msgstr "" + +#: regsvr32.rc:42 +#, fuzzy +#| msgid "Failed to open '%1'\n" +msgid "regsvr32: Failed to load DLL '%1'\n" +msgstr "Nieudane otwarcie '%1'\n" + +#: regsvr32.rc:43 +msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgstr "" + +#: regsvr32.rc:44 +msgid "regsvr32: Failed to register DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:45 +msgid "regsvr32: Successfully registered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:46 +msgid "regsvr32: Failed to unregister DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:47 +msgid "regsvr32: Successfully unregistered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:48 +msgid "regsvr32: Failed to install DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:49 +msgid "regsvr32: Successfully installed DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:50 +msgid "regsvr32: Failed to uninstall DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:51 +msgid "regsvr32: Successfully uninstalled DLL '%1'\n" +msgstr "" + #: start.rc:55 msgid "" "Application could not be started, or no application associated with the " diff -Nru wine1.7-1.7.14/po/pt_BR.po wine1.7-1.7.18/po/pt_BR.po --- wine1.7-1.7.14/po/pt_BR.po 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/po/pt_BR.po 2014-05-02 18:15:48.000000000 +0000 @@ -11730,6 +11730,91 @@ msgid "Exports selected branch of the registry to a text file" msgstr "Exporta o ramo do registro selecionado para um arquivo de texto" +#: regsvr32.rc:32 +msgid "" +"Wine DLL Registration Utility\n" +"\n" +"Provides DLL registration services.\n" +"\n" +msgstr "" +"Utilitário de Registro de DLL do Wine\n" +"\n" +"Fornece serviços de registro de DLL.\n" +"\n" + +#: regsvr32.rc:40 +msgid "" +"Usage:\n" +" regsvr32 [/u] [/s] [/n] [/i[:cmdline]] DllName\n" +"\n" +"Options:\n" +" [/u] Unregister a server.\n" +" [/s] Silent mode (no messages will be displayed).\n" +" [/i] Call DllInstall, passing an optional [cmdline].\n" +"\tWhen used with [/u] DllInstall is called in uninstall mode.\n" +" [/n] Do not call DllRegisterServer. This option must be used with [/i].\n" +"\n" +msgstr "" +"Uso:\n" +" regsvr32 [/u] [/s] [/n] [/i[:cmdline]] arquivo\n" +"\n" +"Opções:\n" +" [/u] Remove o registro de um servidor.\n" +" [/s] Modo silencioso (nenhuma mensagem será exibida).\n" +" [/i] Executa DllInstall, passando o parâmetro opcional [cmdline].\n" +"\tQuando é usado com [/u] a operação DllInstall é chamada com modo de " +"desinstalação.\n" +" [/n] Não executar DllRegisterServer. Essa opção deve ser usada com [/i].\n" +"\n" + +#: regsvr32.rc:41 +msgid "" +"regsvr32: Invalid or unrecognized switch [%1]\n" +"\n" +msgstr "" +"regsvr32: Parâmetro inválido ou não reconhecido [%1]\n" +"\n" + +#: regsvr32.rc:42 +msgid "regsvr32: Failed to load DLL '%1'\n" +msgstr "regsvr32: Falha ao carregar a DLL '%1'\n" + +#: regsvr32.rc:43 +msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgstr "regsvr32: %1 não implementado na DLL '%2'\n" + +#: regsvr32.rc:44 +msgid "regsvr32: Failed to register DLL '%1'\n" +msgstr "regsvr32: Falha ao registrar DLL '%1'\n" + +#: regsvr32.rc:45 +msgid "regsvr32: Successfully registered DLL '%1'\n" +msgstr "regsvr32: DLL '%1' registrada com sucesso\n" + +#: regsvr32.rc:46 +msgid "regsvr32: Failed to unregister DLL '%1'\n" +msgstr "regsvr32: Falha ao remover o registro da DLL '%1'\n" + +#: regsvr32.rc:47 +msgid "regsvr32: Successfully unregistered DLL '%1'\n" +msgstr "regsvr32: Registro da DLL '%1' removido com sucesso\n" + +#: regsvr32.rc:48 +msgid "regsvr32: Failed to install DLL '%1'\n" +msgstr "regsvr32: Falha ao instalar DLL '%1'\n" + +#: regsvr32.rc:49 +msgid "regsvr32: Successfully installed DLL '%1'\n" +msgstr "regsvr32: DLL '%1' instalada com sucesso\n" + +#: regsvr32.rc:50 +msgid "regsvr32: Failed to uninstall DLL '%1'\n" +msgstr "regsvr32: Falha ao desinstalar DLL '%1'\n" + +#: regsvr32.rc:51 +msgid "regsvr32: Successfully uninstalled DLL '%1'\n" +msgstr "regsvr32: DLL '%1' desinstalada com sucesso\n" + #: start.rc:55 msgid "" "Application could not be started, or no application associated with the " diff -Nru wine1.7-1.7.14/po/pt_PT.po wine1.7-1.7.18/po/pt_PT.po --- wine1.7-1.7.14/po/pt_PT.po 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/po/pt_PT.po 2014-05-02 18:15:48.000000000 +0000 @@ -11737,6 +11737,76 @@ msgid "Exports selected branch of the registry to a text file" msgstr "Exporta o ramo seleccionado do registo para um ficheiro de texto" +#: regsvr32.rc:32 +msgid "" +"Wine DLL Registration Utility\n" +"\n" +"Provides DLL registration services.\n" +"\n" +msgstr "" + +#: regsvr32.rc:40 +msgid "" +"Usage:\n" +" regsvr32 [/u] [/s] [/n] [/i[:cmdline]] DllName\n" +"\n" +"Options:\n" +" [/u] Unregister a server.\n" +" [/s] Silent mode (no messages will be displayed).\n" +" [/i] Call DllInstall, passing an optional [cmdline].\n" +"\tWhen used with [/u] DllInstall is called in uninstall mode.\n" +" [/n] Do not call DllRegisterServer. This option must be used with [/i].\n" +"\n" +msgstr "" + +#: regsvr32.rc:41 +msgid "" +"regsvr32: Invalid or unrecognized switch [%1]\n" +"\n" +msgstr "" + +#: regsvr32.rc:42 +#, fuzzy +#| msgid "Failed to open '%1'\n" +msgid "regsvr32: Failed to load DLL '%1'\n" +msgstr "Falhou ao abrir '%1'\n" + +#: regsvr32.rc:43 +msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgstr "" + +#: regsvr32.rc:44 +msgid "regsvr32: Failed to register DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:45 +msgid "regsvr32: Successfully registered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:46 +msgid "regsvr32: Failed to unregister DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:47 +msgid "regsvr32: Successfully unregistered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:48 +msgid "regsvr32: Failed to install DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:49 +msgid "regsvr32: Successfully installed DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:50 +msgid "regsvr32: Failed to uninstall DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:51 +msgid "regsvr32: Successfully uninstalled DLL '%1'\n" +msgstr "" + #: start.rc:55 msgid "" "Application could not be started, or no application associated with the " diff -Nru wine1.7-1.7.14/po/rm.po wine1.7-1.7.18/po/rm.po --- wine1.7-1.7.14/po/rm.po 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/po/rm.po 2014-05-02 18:15:48.000000000 +0000 @@ -11200,6 +11200,74 @@ msgid "Exports selected branch of the registry to a text file" msgstr "" +#: regsvr32.rc:32 +msgid "" +"Wine DLL Registration Utility\n" +"\n" +"Provides DLL registration services.\n" +"\n" +msgstr "" + +#: regsvr32.rc:40 +msgid "" +"Usage:\n" +" regsvr32 [/u] [/s] [/n] [/i[:cmdline]] DllName\n" +"\n" +"Options:\n" +" [/u] Unregister a server.\n" +" [/s] Silent mode (no messages will be displayed).\n" +" [/i] Call DllInstall, passing an optional [cmdline].\n" +"\tWhen used with [/u] DllInstall is called in uninstall mode.\n" +" [/n] Do not call DllRegisterServer. This option must be used with [/i].\n" +"\n" +msgstr "" + +#: regsvr32.rc:41 +msgid "" +"regsvr32: Invalid or unrecognized switch [%1]\n" +"\n" +msgstr "" + +#: regsvr32.rc:42 +msgid "regsvr32: Failed to load DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:43 +msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgstr "" + +#: regsvr32.rc:44 +msgid "regsvr32: Failed to register DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:45 +msgid "regsvr32: Successfully registered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:46 +msgid "regsvr32: Failed to unregister DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:47 +msgid "regsvr32: Successfully unregistered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:48 +msgid "regsvr32: Failed to install DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:49 +msgid "regsvr32: Successfully installed DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:50 +msgid "regsvr32: Failed to uninstall DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:51 +msgid "regsvr32: Successfully uninstalled DLL '%1'\n" +msgstr "" + #: start.rc:55 msgid "" "Application could not be started, or no application associated with the " diff -Nru wine1.7-1.7.14/po/ro.po wine1.7-1.7.18/po/ro.po --- wine1.7-1.7.14/po/ro.po 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/po/ro.po 2014-05-02 18:15:48.000000000 +0000 @@ -11859,6 +11859,76 @@ msgid "Exports selected branch of the registry to a text file" msgstr "Exportă ramura de registru selectată ca fișier text" +#: regsvr32.rc:32 +msgid "" +"Wine DLL Registration Utility\n" +"\n" +"Provides DLL registration services.\n" +"\n" +msgstr "" + +#: regsvr32.rc:40 +msgid "" +"Usage:\n" +" regsvr32 [/u] [/s] [/n] [/i[:cmdline]] DllName\n" +"\n" +"Options:\n" +" [/u] Unregister a server.\n" +" [/s] Silent mode (no messages will be displayed).\n" +" [/i] Call DllInstall, passing an optional [cmdline].\n" +"\tWhen used with [/u] DllInstall is called in uninstall mode.\n" +" [/n] Do not call DllRegisterServer. This option must be used with [/i].\n" +"\n" +msgstr "" + +#: regsvr32.rc:41 +msgid "" +"regsvr32: Invalid or unrecognized switch [%1]\n" +"\n" +msgstr "" + +#: regsvr32.rc:42 +#, fuzzy +#| msgid "Failed to open '%1'\n" +msgid "regsvr32: Failed to load DLL '%1'\n" +msgstr "Deschiderea „%1” a eșuat\n" + +#: regsvr32.rc:43 +msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgstr "" + +#: regsvr32.rc:44 +msgid "regsvr32: Failed to register DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:45 +msgid "regsvr32: Successfully registered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:46 +msgid "regsvr32: Failed to unregister DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:47 +msgid "regsvr32: Successfully unregistered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:48 +msgid "regsvr32: Failed to install DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:49 +msgid "regsvr32: Successfully installed DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:50 +msgid "regsvr32: Failed to uninstall DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:51 +msgid "regsvr32: Successfully uninstalled DLL '%1'\n" +msgstr "" + #: start.rc:55 msgid "" "Application could not be started, or no application associated with the " diff -Nru wine1.7-1.7.14/po/ru.po wine1.7-1.7.18/po/ru.po --- wine1.7-1.7.14/po/ru.po 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/po/ru.po 2014-05-02 18:15:48.000000000 +0000 @@ -247,7 +247,7 @@ "Unexpected checksum of downloaded file. Aborting installation of corrupted " "file." msgstr "" -"Ошибка контрольной суммы загруженного файла. Установка поврежденного файла " +"Ошибка контрольной суммы загруженного файла. Установка повреждённого файла " "отменяется." #: avifil32.rc:42 @@ -981,7 +981,7 @@ "This large number of copies is not supported by your printer.\n" "Please enter a value between 1 and %d." msgstr "" -"Такое большое количество копий не может быть напечатано вашим принтером.\n" +"Такое большое количество копий не может быть напечатано этим принтером.\n" "Введите значение от 1 до %d." #: comdlg32.rc:66 @@ -1013,8 +1013,8 @@ "Before you can perform printer-related tasks such as page setup or printing " "a document, you need to install a printer. Please install one and retry." msgstr "" -"Перед тем как настраивать страницу печати или печатать документ нужно " -"установить принтеры. Пожалуйста установите его и попробуйте еще раз." +"Чтобы настраивать страницу печати или печатать документ, нужно иметь хотя бы " +"один установленный принтер. Установите принтер и попробуйте ещё раз." #: comdlg32.rc:140 msgid "Select a font size between %1!d! and %2!d! points." @@ -2610,7 +2610,7 @@ #: cryptui.rc:84 msgid "Please select a file." -msgstr "Пожалуйста, выберите файл." +msgstr "Выберите файл." #: cryptui.rc:85 msgid "The file format is not recognized. Please select another file." @@ -6786,7 +6786,7 @@ "\t/q{|n|b|r|f|n+|b+|b-}\n" "Зарегистрировать службу MSI:\n" "\t/y\n" -"Разрегистрировать службу MSI:\n" +"Удалить регистрационные данные службы MSI:\n" "\t/z\n" "Вывести эту справку:\n" "\t/help\n" @@ -7307,7 +7307,7 @@ #: sane.rc:44 msgid "SCANNING... Please Wait" -msgstr "СКАНИРОВАНИЕ... пожалуйста, ждите" +msgstr "СКАНИРОВАНИЕ... пожалуйста, подождите" #: sane.rc:31 msgctxt "unit: pixels" @@ -7400,7 +7400,7 @@ #: shdoclc.rc:42 msgid "F&orward" -msgstr "&Вперед" +msgstr "&Вперёд" #: shdoclc.rc:44 msgid "&Save Background As..." @@ -7615,7 +7615,7 @@ #: shdoclc.rc:210 msgid "Performance Meters" -msgstr "Счетчики производительности" +msgstr "Счётчики производительности" #: shdoclc.rc:211 msgid "Save HTML" @@ -8114,7 +8114,7 @@ #: shell32.rc:177 msgid "" "Are you sure that you want to send '%1' and all its content to the Trash?" -msgstr "Переместить папку «%1» и все ее содержимое корзину?" +msgstr "Переместить папку «%1» и всё её содержимое в корзину?" #: shell32.rc:176 msgid "Are you sure that you want to send '%1' to the Trash?" @@ -8287,8 +8287,8 @@ "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 "" -"Установленный компонент ActiveX имеет полный доступ к вашему компьютеру. " -"Если вы не уверены в его безопасности, не устанавливайте его." +"После установки компонент ActiveX будет иметь полный доступ к вашему " +"компьютеру. Если вы не уверены в его безопасности, не устанавливайте его." #: urlmon.rc:51 msgid "Installation of component failed: %08x" @@ -8393,7 +8393,7 @@ #: wininet.rc:82 msgid "Do you want to continue anyway?" -msgstr "Все равно хотите продолжить?" +msgstr "Всё равно хотите продолжить?" #: wininet.rc:28 msgid "LAN Connection" @@ -8401,7 +8401,7 @@ #: wininet.rc:29 msgid "The certificate is issued by an unknown or untrusted publisher." -msgstr "Сертификат выдан неизвестным или не доверенным издателем." +msgstr "Сертификат выдан неизвестным или недоверенным издателем." #: wininet.rc:30 msgid "The date on the certificate is invalid." @@ -8524,7 +8524,7 @@ "MIDIMAP.CFG file may be corrupt or missing." msgstr "" "Карта (map) MIDI не найдена. Возможно, это ошибка драйвера, или файл MIDIMAP." -"CFG отсутствует или поврежден." +"CFG отсутствует или повреждён." #: winmm.rc:54 msgid "" @@ -8569,7 +8569,7 @@ "There is a problem with your media device. Make sure it is working correctly " "or contact the device manufacturer." msgstr "" -"Ошибка мультимедиа устройства. Убедитесь, что устройство работает нормально " +"Ошибка мультимедиа-устройства. Убедитесь, что устройство работает нормально " "или свяжитесь с изготовителем устройства." #: winmm.rc:63 @@ -8747,7 +8747,7 @@ msgid "" "A closing double-quotation mark is missing from the parameter value. Please " "supply one." -msgstr "Закрывающая кавычка отсутствует в значении параметра. Поставьте ее." +msgstr "Закрывающая кавычка отсутствует в значении параметра. Поставьте её." #: winmm.rc:93 msgid "A parameter or value was specified twice. Only specify it once." @@ -8760,7 +8760,7 @@ "may be corrupt, or not in the correct format." msgstr "" "Указанный файл не может быть проигран на выбранном устройстве MCI. Файл " -"может быть поврежден или имеет некорректный формат." +"может быть повреждён или имеет некорректный формат." #: winmm.rc:95 msgid "A null parameter block was passed to MCI." @@ -8811,7 +8811,7 @@ #: winmm.rc:103 msgid "" "Cannot specify extra characters after a string enclosed in quotation marks." -msgstr "Нельзя указывать символы после строки, заключенной в кавычки." +msgstr "Нельзя указывать символы после строки, заключённой в кавычки." #: winmm.rc:104 msgid "" @@ -10482,7 +10482,7 @@ #: netstat.rc:56 msgid "Receive Errors" -msgstr "Ошибок приема" +msgstr "Ошибок приёма" #: netstat.rc:57 msgid "Datagrams Sent" @@ -10762,7 +10762,7 @@ #: oleview.rc:47 msgid "&Remote server" -msgstr "&Удаленный сервер" +msgstr "&Удалённый сервер" #: oleview.rc:50 msgid "View &Type information" @@ -11673,6 +11673,90 @@ msgid "Exports selected branch of the registry to a text file" msgstr "Экспортирует выделенную ветку реестра в текстовый файл" +#: regsvr32.rc:32 +msgid "" +"Wine DLL Registration Utility\n" +"\n" +"Provides DLL registration services.\n" +"\n" +msgstr "" +"Утилита регистрации DLL в Wine\n" +"\n" +"Используется для регистрации DLL.\n" +"\n" + +#: regsvr32.rc:40 +msgid "" +"Usage:\n" +" regsvr32 [/u] [/s] [/n] [/i[:cmdline]] DllName\n" +"\n" +"Options:\n" +" [/u] Unregister a server.\n" +" [/s] Silent mode (no messages will be displayed).\n" +" [/i] Call DllInstall, passing an optional [cmdline].\n" +"\tWhen used with [/u] DllInstall is called in uninstall mode.\n" +" [/n] Do not call DllRegisterServer. This option must be used with [/i].\n" +"\n" +msgstr "" +"Использование:\n" +" regsvr32 [/u] [/s] [/n] [/i[:cmdline]] имя_dll\n" +"\n" +"Параметры:\n" +" [/u] Удалить регистрационные данные сервера.\n" +" [/s] Тихий режим (сообщения не выводятся).\n" +" [/i] Вызвать DllInstall с дополнительными параметрами [cmdline].\n" +"\tПри использовании с [/u] DllInstall будет вызвана в режиме удаления.\n" +" [/n] Не вызывать DllRegisterServer. Используется с [/i].\n" +"\n" + +#: regsvr32.rc:41 +msgid "" +"regsvr32: Invalid or unrecognized switch [%1]\n" +"\n" +msgstr "" +"regsvr32: неверный или неизвестный параметр [%1]\n" +"\n" + +#: regsvr32.rc:42 +msgid "regsvr32: Failed to load DLL '%1'\n" +msgstr "regsvr32: не удалось загрузить DLL «%1»\n" + +#: regsvr32.rc:43 +msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgstr "regsvr32: %1 не реализован в DLL «%2»\n" + +#: regsvr32.rc:44 +msgid "regsvr32: Failed to register DLL '%1'\n" +msgstr "regsvr32: не удалось зарегистрировать «%1»\n" + +#: regsvr32.rc:45 +msgid "regsvr32: Successfully registered DLL '%1'\n" +msgstr "regsvr32: DLL «%1» успешно зарегистрирована\n" + +#: regsvr32.rc:46 +msgid "regsvr32: Failed to unregister DLL '%1'\n" +msgstr "regsvr32: не удалось удалить регистрационные данные DLL «%1»\n" + +#: regsvr32.rc:47 +msgid "regsvr32: Successfully unregistered DLL '%1'\n" +msgstr "regsvr32: регистрационные данные DLL «%1» успешно удалены\n" + +#: regsvr32.rc:48 +msgid "regsvr32: Failed to install DLL '%1'\n" +msgstr "regsvr32: не удалось установить DLL «%1»\n" + +#: regsvr32.rc:49 +msgid "regsvr32: Successfully installed DLL '%1'\n" +msgstr "regsvr32: DLL «%1» успешно установлена\n" + +#: regsvr32.rc:50 +msgid "regsvr32: Failed to uninstall DLL '%1'\n" +msgstr "regsvr32: не удалось удалить DLL «%1»\n" + +#: regsvr32.rc:51 +msgid "regsvr32: Successfully uninstalled DLL '%1'\n" +msgstr "regsvr32: DLL «%1» успешно удалена\n" + #: start.rc:55 msgid "" "Application could not be started, or no application associated with the " @@ -11760,7 +11844,7 @@ #: taskmgr.rc:47 msgid "&Hide When Minimized" -msgstr "С&крывать свернутое" +msgstr "С&крывать свёрнутое" #: taskmgr.rc:49 taskmgr.rc:257 msgid "&Show 16-bit tasks" @@ -12174,7 +12258,7 @@ #: taskmgr.rc:549 msgid "&Virtual Memory Size" -msgstr "Объем вирту&альной памяти" +msgstr "Объём вирту&альной памяти" #: taskmgr.rc:551 msgid "Pa&ged Pool" @@ -12227,15 +12311,15 @@ #: taskmgr.rc:188 msgid "Task Manager remains in front of all other windows unless minimized" msgstr "" -"Окно Диспетчера задач отображается поверх других окон, если не свернуто" +"Окно Диспетчера задач отображается поверх других окон, если не свёрнуто" #: taskmgr.rc:190 msgid "Task Manager is minimized when a SwitchTo operation is performed" -msgstr "Окно Диспетчера задач свертывается при выполнении переключения" +msgstr "Окно Диспетчера задач свёртывается при выполнении переключения" #: taskmgr.rc:191 msgid "Hide the Task Manager when it is minimized" -msgstr "Скрывает свернутое окно Диспетчера задач" +msgstr "Скрывает свёрнутое окно Диспетчера задач" #: taskmgr.rc:192 msgid "Force Task Manager to update now, regardless of Update Speed setting" @@ -12327,7 +12411,7 @@ #: taskmgr.rc:222 msgid "Brings a task to the foreground, switch focus to that task" -msgstr "Перемещает задачи на передний план и передает им управление" +msgstr "Перемещает задачи на передний план и передаёт им управление" #: taskmgr.rc:227 msgid "Tells the selected tasks to close" @@ -12601,7 +12685,7 @@ #: wineboot.rc:46 msgid "The Wine configuration in %s is being updated, please wait..." -msgstr "Обновление конфигурации Wine %s, пожалуйста подождите..." +msgstr "Выполняется обновление конфигурации Wine %s. Пожалуйста, подождите..." #: winecfg.rc:135 msgid "" @@ -13131,7 +13215,7 @@ #: winecfg.rc:117 msgid "Controls Dark Shadow" -msgstr "Элементы управления - темная тень" +msgstr "Элементы управления - тёмная тень" #: winecfg.rc:118 msgid "Controls Light" @@ -13422,7 +13506,7 @@ "button, then file a bug report " "and attach that file to the report." msgstr "" -"Если эта проблема отсутствует в Windows и о ней еще никто не сообщил, вы " +"Если эта проблема отсутствует в Windows и о ней ещё никто не сообщил, вы " "можете сохранить подробную информация в файл с помощью кнопки «Сохранить " "как», затем сообщить об ошибке и " "приложить этот файл к отчету." @@ -13445,7 +13529,7 @@ #: winedbg.rc:44 msgid "Loading detailed information, please wait..." -msgstr "Загружается дополнительная информация, пожалуйста подождите..." +msgstr "Загружается дополнительная информация. Пожалуйста, подождите..." #: winefile.rc:29 msgid "&Open\tEnter" @@ -13729,7 +13813,7 @@ #: winemine.rc:79 msgid "Please enter your name" -msgstr "Пожалуйста, введите ваше имя" +msgstr "Введите ваше имя" #: winemine.rc:87 msgid "Custom Game" @@ -14175,7 +14259,7 @@ #: wordpad.rc:185 msgid "Finished searching the document." -msgstr "Поиск в документе завершен." +msgstr "Поиск в документе завершён." #: wordpad.rc:186 msgid "Failed to load the RichEdit library." @@ -14345,7 +14429,7 @@ "[/A] Копирует только файлы с атрибутом «архивный».\n" "[/M] Копирует только файлы с атрибутом «архивный»,\n" "при этом очищает атрибут.\n" -"[/D | /D:m-d-y] Копирует только новые файлы или файлы, измененные\n" +"[/D | /D:m-d-y] Копирует только новые файлы или файлы, изменённые\n" "\t\tпосле указанной даты. Если дата не указана, заменяет все старые файлы\n" "\t\tсуществующими новыми.\n" "\n" diff -Nru wine1.7-1.7.14/po/sk.po wine1.7-1.7.18/po/sk.po --- wine1.7-1.7.14/po/sk.po 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/po/sk.po 2014-05-02 18:15:48.000000000 +0000 @@ -11316,6 +11316,74 @@ msgid "Exports selected branch of the registry to a text file" msgstr "" +#: regsvr32.rc:32 +msgid "" +"Wine DLL Registration Utility\n" +"\n" +"Provides DLL registration services.\n" +"\n" +msgstr "" + +#: regsvr32.rc:40 +msgid "" +"Usage:\n" +" regsvr32 [/u] [/s] [/n] [/i[:cmdline]] DllName\n" +"\n" +"Options:\n" +" [/u] Unregister a server.\n" +" [/s] Silent mode (no messages will be displayed).\n" +" [/i] Call DllInstall, passing an optional [cmdline].\n" +"\tWhen used with [/u] DllInstall is called in uninstall mode.\n" +" [/n] Do not call DllRegisterServer. This option must be used with [/i].\n" +"\n" +msgstr "" + +#: regsvr32.rc:41 +msgid "" +"regsvr32: Invalid or unrecognized switch [%1]\n" +"\n" +msgstr "" + +#: regsvr32.rc:42 +msgid "regsvr32: Failed to load DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:43 +msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgstr "" + +#: regsvr32.rc:44 +msgid "regsvr32: Failed to register DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:45 +msgid "regsvr32: Successfully registered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:46 +msgid "regsvr32: Failed to unregister DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:47 +msgid "regsvr32: Successfully unregistered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:48 +msgid "regsvr32: Failed to install DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:49 +msgid "regsvr32: Successfully installed DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:50 +msgid "regsvr32: Failed to uninstall DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:51 +msgid "regsvr32: Successfully uninstalled DLL '%1'\n" +msgstr "" + #: start.rc:55 msgid "" "Application could not be started, or no application associated with the " diff -Nru wine1.7-1.7.14/po/sl.po wine1.7-1.7.18/po/sl.po --- wine1.7-1.7.14/po/sl.po 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/po/sl.po 2014-05-02 18:15:48.000000000 +0000 @@ -11793,6 +11793,76 @@ msgid "Exports selected branch of the registry to a text file" msgstr "Izvozi izbrano vejo registra v besedilno datoteko" +#: regsvr32.rc:32 +msgid "" +"Wine DLL Registration Utility\n" +"\n" +"Provides DLL registration services.\n" +"\n" +msgstr "" + +#: regsvr32.rc:40 +msgid "" +"Usage:\n" +" regsvr32 [/u] [/s] [/n] [/i[:cmdline]] DllName\n" +"\n" +"Options:\n" +" [/u] Unregister a server.\n" +" [/s] Silent mode (no messages will be displayed).\n" +" [/i] Call DllInstall, passing an optional [cmdline].\n" +"\tWhen used with [/u] DllInstall is called in uninstall mode.\n" +" [/n] Do not call DllRegisterServer. This option must be used with [/i].\n" +"\n" +msgstr "" + +#: regsvr32.rc:41 +msgid "" +"regsvr32: Invalid or unrecognized switch [%1]\n" +"\n" +msgstr "" + +#: regsvr32.rc:42 +#, fuzzy +#| msgid "Failed to open '%1'\n" +msgid "regsvr32: Failed to load DLL '%1'\n" +msgstr "Odpiranje '%1' je spodletelo\n" + +#: regsvr32.rc:43 +msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgstr "" + +#: regsvr32.rc:44 +msgid "regsvr32: Failed to register DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:45 +msgid "regsvr32: Successfully registered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:46 +msgid "regsvr32: Failed to unregister DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:47 +msgid "regsvr32: Successfully unregistered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:48 +msgid "regsvr32: Failed to install DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:49 +msgid "regsvr32: Successfully installed DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:50 +msgid "regsvr32: Failed to uninstall DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:51 +msgid "regsvr32: Successfully uninstalled DLL '%1'\n" +msgstr "" + #: start.rc:55 msgid "" "Application could not be started, or no application associated with the " diff -Nru wine1.7-1.7.14/po/sr_RS@cyrillic.po wine1.7-1.7.18/po/sr_RS@cyrillic.po --- wine1.7-1.7.14/po/sr_RS@cyrillic.po 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/po/sr_RS@cyrillic.po 2014-05-02 18:15:48.000000000 +0000 @@ -11733,6 +11733,75 @@ msgid "Exports selected branch of the registry to a text file" msgstr "" +#: regsvr32.rc:32 +msgid "" +"Wine DLL Registration Utility\n" +"\n" +"Provides DLL registration services.\n" +"\n" +msgstr "" + +#: regsvr32.rc:40 +msgid "" +"Usage:\n" +" regsvr32 [/u] [/s] [/n] [/i[:cmdline]] DllName\n" +"\n" +"Options:\n" +" [/u] Unregister a server.\n" +" [/s] Silent mode (no messages will be displayed).\n" +" [/i] Call DllInstall, passing an optional [cmdline].\n" +"\tWhen used with [/u] DllInstall is called in uninstall mode.\n" +" [/n] Do not call DllRegisterServer. This option must be used with [/i].\n" +"\n" +msgstr "" + +#: regsvr32.rc:41 +msgid "" +"regsvr32: Invalid or unrecognized switch [%1]\n" +"\n" +msgstr "" + +#: regsvr32.rc:42 +#, fuzzy +msgid "regsvr32: Failed to load DLL '%1'\n" +msgstr "Отварање „%s“ датотеке није успело\n" + +#: regsvr32.rc:43 +msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgstr "" + +#: regsvr32.rc:44 +msgid "regsvr32: Failed to register DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:45 +msgid "regsvr32: Successfully registered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:46 +msgid "regsvr32: Failed to unregister DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:47 +msgid "regsvr32: Successfully unregistered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:48 +msgid "regsvr32: Failed to install DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:49 +msgid "regsvr32: Successfully installed DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:50 +msgid "regsvr32: Failed to uninstall DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:51 +msgid "regsvr32: Successfully uninstalled DLL '%1'\n" +msgstr "" + #: start.rc:55 msgid "" "Application could not be started, or no application associated with the " diff -Nru wine1.7-1.7.14/po/sr_RS@latin.po wine1.7-1.7.18/po/sr_RS@latin.po --- wine1.7-1.7.14/po/sr_RS@latin.po 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/po/sr_RS@latin.po 2014-05-02 18:15:48.000000000 +0000 @@ -11879,6 +11879,75 @@ msgid "Exports selected branch of the registry to a text file" msgstr "" +#: regsvr32.rc:32 +msgid "" +"Wine DLL Registration Utility\n" +"\n" +"Provides DLL registration services.\n" +"\n" +msgstr "" + +#: regsvr32.rc:40 +msgid "" +"Usage:\n" +" regsvr32 [/u] [/s] [/n] [/i[:cmdline]] DllName\n" +"\n" +"Options:\n" +" [/u] Unregister a server.\n" +" [/s] Silent mode (no messages will be displayed).\n" +" [/i] Call DllInstall, passing an optional [cmdline].\n" +"\tWhen used with [/u] DllInstall is called in uninstall mode.\n" +" [/n] Do not call DllRegisterServer. This option must be used with [/i].\n" +"\n" +msgstr "" + +#: regsvr32.rc:41 +msgid "" +"regsvr32: Invalid or unrecognized switch [%1]\n" +"\n" +msgstr "" + +#: regsvr32.rc:42 +#, fuzzy +msgid "regsvr32: Failed to load DLL '%1'\n" +msgstr "Otvaranje „%s“ datoteke nije uspelo\n" + +#: regsvr32.rc:43 +msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgstr "" + +#: regsvr32.rc:44 +msgid "regsvr32: Failed to register DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:45 +msgid "regsvr32: Successfully registered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:46 +msgid "regsvr32: Failed to unregister DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:47 +msgid "regsvr32: Successfully unregistered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:48 +msgid "regsvr32: Failed to install DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:49 +msgid "regsvr32: Successfully installed DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:50 +msgid "regsvr32: Failed to uninstall DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:51 +msgid "regsvr32: Successfully uninstalled DLL '%1'\n" +msgstr "" + #: start.rc:55 msgid "" "Application could not be started, or no application associated with the " diff -Nru wine1.7-1.7.14/po/sv.po wine1.7-1.7.18/po/sv.po --- wine1.7-1.7.14/po/sv.po 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/po/sv.po 2014-05-02 18:15:48.000000000 +0000 @@ -11562,6 +11562,76 @@ msgid "Exports selected branch of the registry to a text file" msgstr "Exporterar vald gren av registret till en textfil" +#: regsvr32.rc:32 +msgid "" +"Wine DLL Registration Utility\n" +"\n" +"Provides DLL registration services.\n" +"\n" +msgstr "" + +#: regsvr32.rc:40 +msgid "" +"Usage:\n" +" regsvr32 [/u] [/s] [/n] [/i[:cmdline]] DllName\n" +"\n" +"Options:\n" +" [/u] Unregister a server.\n" +" [/s] Silent mode (no messages will be displayed).\n" +" [/i] Call DllInstall, passing an optional [cmdline].\n" +"\tWhen used with [/u] DllInstall is called in uninstall mode.\n" +" [/n] Do not call DllRegisterServer. This option must be used with [/i].\n" +"\n" +msgstr "" + +#: regsvr32.rc:41 +msgid "" +"regsvr32: Invalid or unrecognized switch [%1]\n" +"\n" +msgstr "" + +#: regsvr32.rc:42 +#, fuzzy +#| msgid "Failed to open '%1'\n" +msgid "regsvr32: Failed to load DLL '%1'\n" +msgstr "Misslyckades med att öppna '%1'\n" + +#: regsvr32.rc:43 +msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgstr "" + +#: regsvr32.rc:44 +msgid "regsvr32: Failed to register DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:45 +msgid "regsvr32: Successfully registered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:46 +msgid "regsvr32: Failed to unregister DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:47 +msgid "regsvr32: Successfully unregistered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:48 +msgid "regsvr32: Failed to install DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:49 +msgid "regsvr32: Successfully installed DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:50 +msgid "regsvr32: Failed to uninstall DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:51 +msgid "regsvr32: Successfully uninstalled DLL '%1'\n" +msgstr "" + #: start.rc:55 msgid "" "Application could not be started, or no application associated with the " diff -Nru wine1.7-1.7.14/po/te.po wine1.7-1.7.18/po/te.po --- wine1.7-1.7.14/po/te.po 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/po/te.po 2014-05-02 18:15:48.000000000 +0000 @@ -11118,6 +11118,74 @@ msgid "Exports selected branch of the registry to a text file" msgstr "" +#: regsvr32.rc:32 +msgid "" +"Wine DLL Registration Utility\n" +"\n" +"Provides DLL registration services.\n" +"\n" +msgstr "" + +#: regsvr32.rc:40 +msgid "" +"Usage:\n" +" regsvr32 [/u] [/s] [/n] [/i[:cmdline]] DllName\n" +"\n" +"Options:\n" +" [/u] Unregister a server.\n" +" [/s] Silent mode (no messages will be displayed).\n" +" [/i] Call DllInstall, passing an optional [cmdline].\n" +"\tWhen used with [/u] DllInstall is called in uninstall mode.\n" +" [/n] Do not call DllRegisterServer. This option must be used with [/i].\n" +"\n" +msgstr "" + +#: regsvr32.rc:41 +msgid "" +"regsvr32: Invalid or unrecognized switch [%1]\n" +"\n" +msgstr "" + +#: regsvr32.rc:42 +msgid "regsvr32: Failed to load DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:43 +msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgstr "" + +#: regsvr32.rc:44 +msgid "regsvr32: Failed to register DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:45 +msgid "regsvr32: Successfully registered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:46 +msgid "regsvr32: Failed to unregister DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:47 +msgid "regsvr32: Successfully unregistered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:48 +msgid "regsvr32: Failed to install DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:49 +msgid "regsvr32: Successfully installed DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:50 +msgid "regsvr32: Failed to uninstall DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:51 +msgid "regsvr32: Successfully uninstalled DLL '%1'\n" +msgstr "" + #: start.rc:55 msgid "" "Application could not be started, or no application associated with the " diff -Nru wine1.7-1.7.14/po/th.po wine1.7-1.7.18/po/th.po --- wine1.7-1.7.14/po/th.po 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/po/th.po 2014-05-02 18:15:48.000000000 +0000 @@ -11334,6 +11334,74 @@ msgid "Exports selected branch of the registry to a text file" msgstr "" +#: regsvr32.rc:32 +msgid "" +"Wine DLL Registration Utility\n" +"\n" +"Provides DLL registration services.\n" +"\n" +msgstr "" + +#: regsvr32.rc:40 +msgid "" +"Usage:\n" +" regsvr32 [/u] [/s] [/n] [/i[:cmdline]] DllName\n" +"\n" +"Options:\n" +" [/u] Unregister a server.\n" +" [/s] Silent mode (no messages will be displayed).\n" +" [/i] Call DllInstall, passing an optional [cmdline].\n" +"\tWhen used with [/u] DllInstall is called in uninstall mode.\n" +" [/n] Do not call DllRegisterServer. This option must be used with [/i].\n" +"\n" +msgstr "" + +#: regsvr32.rc:41 +msgid "" +"regsvr32: Invalid or unrecognized switch [%1]\n" +"\n" +msgstr "" + +#: regsvr32.rc:42 +msgid "regsvr32: Failed to load DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:43 +msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgstr "" + +#: regsvr32.rc:44 +msgid "regsvr32: Failed to register DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:45 +msgid "regsvr32: Successfully registered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:46 +msgid "regsvr32: Failed to unregister DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:47 +msgid "regsvr32: Successfully unregistered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:48 +msgid "regsvr32: Failed to install DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:49 +msgid "regsvr32: Successfully installed DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:50 +msgid "regsvr32: Failed to uninstall DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:51 +msgid "regsvr32: Successfully uninstalled DLL '%1'\n" +msgstr "" + #: start.rc:55 msgid "" "Application could not be started, or no application associated with the " diff -Nru wine1.7-1.7.14/po/tr.po wine1.7-1.7.18/po/tr.po --- wine1.7-1.7.14/po/tr.po 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/po/tr.po 2014-05-02 18:15:48.000000000 +0000 @@ -11623,6 +11623,76 @@ 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" +#: regsvr32.rc:32 +msgid "" +"Wine DLL Registration Utility\n" +"\n" +"Provides DLL registration services.\n" +"\n" +msgstr "" + +#: regsvr32.rc:40 +msgid "" +"Usage:\n" +" regsvr32 [/u] [/s] [/n] [/i[:cmdline]] DllName\n" +"\n" +"Options:\n" +" [/u] Unregister a server.\n" +" [/s] Silent mode (no messages will be displayed).\n" +" [/i] Call DllInstall, passing an optional [cmdline].\n" +"\tWhen used with [/u] DllInstall is called in uninstall mode.\n" +" [/n] Do not call DllRegisterServer. This option must be used with [/i].\n" +"\n" +msgstr "" + +#: regsvr32.rc:41 +msgid "" +"regsvr32: Invalid or unrecognized switch [%1]\n" +"\n" +msgstr "" + +#: regsvr32.rc:42 +#, fuzzy +#| msgid "Failed to open '%1'\n" +msgid "regsvr32: Failed to load DLL '%1'\n" +msgstr "'%1' açılamadı\n" + +#: regsvr32.rc:43 +msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgstr "" + +#: regsvr32.rc:44 +msgid "regsvr32: Failed to register DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:45 +msgid "regsvr32: Successfully registered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:46 +msgid "regsvr32: Failed to unregister DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:47 +msgid "regsvr32: Successfully unregistered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:48 +msgid "regsvr32: Failed to install DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:49 +msgid "regsvr32: Successfully installed DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:50 +msgid "regsvr32: Failed to uninstall DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:51 +msgid "regsvr32: Successfully uninstalled DLL '%1'\n" +msgstr "" + #: start.rc:55 msgid "" "Application could not be started, or no application associated with the " diff -Nru wine1.7-1.7.14/po/uk.po wine1.7-1.7.18/po/uk.po --- wine1.7-1.7.14/po/uk.po 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/po/uk.po 2014-05-02 18:15:48.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: 2014-01-17 12:58+0300\n" +"PO-Revision-Date: 2014-04-02 17:53+0300\n" "Last-Translator: Andrey Gusev \n" "Language-Team: none\n" "Language: Ukrainian\n" @@ -2204,8 +2204,6 @@ "списку анульованих сертифікатів, чи списку довірених сертифікатів:" #: cryptui.rc:299 -#, fuzzy -#| msgid "CMS/PKCS #7 Messages (*.p7b)" msgid "Cryptographic Message Syntax Standard/PKCS #7 Messages (*.p7b)" msgstr "Повідомлення CMS/PKCS #7 (*.p7b)" @@ -2356,15 +2354,13 @@ #: cryptui.rc:408 msgid "&DER-encoded X.509 (*.cer)" -msgstr "" +msgstr "X.509 в кодуванні &DER (*.cer)" #: cryptui.rc:410 msgid "Ba&se64-encoded X.509 (*.cer):" -msgstr "" +msgstr "X.509 в кодуванні Ba&se64 (*.cer):" #: cryptui.rc:412 -#, fuzzy -#| msgid "CMS/PKCS #7 Messages (*.p7b)" msgid "&Cryptographic Message Syntax Standard/PKCS #7 Message (*.p7b)" msgstr "Повідомлення CMS/PKCS #7 (*.p7b)" @@ -4865,7 +4861,7 @@ #: winerror.mc:1571 msgid "No match found.\n" -msgstr "Немає співпадіння.\n" +msgstr "Відповідностей не знайдено.\n" #: winerror.mc:1576 msgid "Property set not found.\n" @@ -6588,10 +6584,8 @@ msgstr "Ім'я користувача не знайдено.\n" #: winerror.mc:3741 -#, fuzzy -#| msgid "The site does not exist.\n" msgid "This network connection does not exist.\n" -msgstr "Сайт не існує.\n" +msgstr "Цього мережевого з'єднання не існує.\n" #: localspl.rc:31 localui.rc:31 winspool.rc:30 msgid "Local Port" @@ -6824,7 +6818,7 @@ #: msi.rc:60 msgid "enter which folder contains %s" -msgstr "вкажіть папку, що містить %s" +msgstr "вкажіть теку, що містить %s" #: msi.rc:61 msgid "install source for feature missing" @@ -6840,7 +6834,7 @@ #: msi.rc:64 msgid "choose which folder contains %s" -msgstr "виберіть папку, що містить %s" +msgstr "виберіть теку, що містить %s" #: msrle32.rc:31 msgid "Wine MS-RLE video codec" @@ -11707,6 +11701,90 @@ msgid "Exports selected branch of the registry to a text file" msgstr "Експортує вибрану гілку реєстру до текстового файлу" +#: regsvr32.rc:32 +msgid "" +"Wine DLL Registration Utility\n" +"\n" +"Provides DLL registration services.\n" +"\n" +msgstr "" +"Утиліта реєстрації DLL у Wine\n" +"\n" +"Слугує сервісом для реєстрації DLL\n" +"\n" + +#: regsvr32.rc:40 +msgid "" +"Usage:\n" +" regsvr32 [/u] [/s] [/n] [/i[:cmdline]] DllName\n" +"\n" +"Options:\n" +" [/u] Unregister a server.\n" +" [/s] Silent mode (no messages will be displayed).\n" +" [/i] Call DllInstall, passing an optional [cmdline].\n" +"\tWhen used with [/u] DllInstall is called in uninstall mode.\n" +" [/n] Do not call DllRegisterServer. This option must be used with [/i].\n" +"\n" +msgstr "" +"Використання:\n" +" regsvr32 [/u] [/s] [/n] [/i[:cmdline]] DllName\n" +"\n" +"Опції:\n" +" [/u] Скасувати реєстрацію сервера.\n" +" [/s] Тихий режим (повідомлення не відображатимуться).\n" +" [/i] Виклик DllInstall з додатковими параметрами [cmdline].\n" +"\tПри використанні з [/u] DllInstall буде викликана в режимі видалення.\n" +" [/n] Не викликати DllRegisterServer. Має використовуватися з [/i].\n" +"\n" + +#: regsvr32.rc:41 +msgid "" +"regsvr32: Invalid or unrecognized switch [%1]\n" +"\n" +msgstr "" +"regsvr32: Невірний або нерозпізнаний параметр [%1]\n" +"\n" + +#: regsvr32.rc:42 +msgid "regsvr32: Failed to load DLL '%1'\n" +msgstr "regsvr32: Не вдалося завантажити DLL '%1'\n" + +#: regsvr32.rc:43 +msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgstr "regsvr32: %1 не реалізовано у DLL '%2'\n" + +#: regsvr32.rc:44 +msgid "regsvr32: Failed to register DLL '%1'\n" +msgstr "regsvr32: Не вдалося зареєструвати DLL '%1'\n" + +#: regsvr32.rc:45 +msgid "regsvr32: Successfully registered DLL '%1'\n" +msgstr "regsvr32: DLL '%1' успішно зареєстрована\n" + +#: regsvr32.rc:46 +msgid "regsvr32: Failed to unregister DLL '%1'\n" +msgstr "regsvr32: Не вдалося скасувати реєстрацію DLL '%1'\n" + +#: regsvr32.rc:47 +msgid "regsvr32: Successfully unregistered DLL '%1'\n" +msgstr "regsvr32: Реєстрація для DLL '%1' успішно скасована\n" + +#: regsvr32.rc:48 +msgid "regsvr32: Failed to install DLL '%1'\n" +msgstr "regsvr32: Не вдалося встановити DLL '%1'\n" + +#: regsvr32.rc:49 +msgid "regsvr32: Successfully installed DLL '%1'\n" +msgstr "regsvr32: DLL '%1' успішно встановлена\n" + +#: regsvr32.rc:50 +msgid "regsvr32: Failed to uninstall DLL '%1'\n" +msgstr "regsvr32: Не вдалося видалити DLL '%1'\n" + +#: regsvr32.rc:51 +msgid "regsvr32: Successfully uninstalled DLL '%1'\n" +msgstr "regsvr32: DLL '%1' успішно видалена\n" + #: start.rc:55 msgid "" "Application could not be started, or no application associated with the " diff -Nru wine1.7-1.7.14/po/wa.po wine1.7-1.7.18/po/wa.po --- wine1.7-1.7.14/po/wa.po 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/po/wa.po 2014-05-02 18:15:48.000000000 +0000 @@ -11248,6 +11248,74 @@ msgid "Exports selected branch of the registry to a text file" msgstr "" +#: regsvr32.rc:32 +msgid "" +"Wine DLL Registration Utility\n" +"\n" +"Provides DLL registration services.\n" +"\n" +msgstr "" + +#: regsvr32.rc:40 +msgid "" +"Usage:\n" +" regsvr32 [/u] [/s] [/n] [/i[:cmdline]] DllName\n" +"\n" +"Options:\n" +" [/u] Unregister a server.\n" +" [/s] Silent mode (no messages will be displayed).\n" +" [/i] Call DllInstall, passing an optional [cmdline].\n" +"\tWhen used with [/u] DllInstall is called in uninstall mode.\n" +" [/n] Do not call DllRegisterServer. This option must be used with [/i].\n" +"\n" +msgstr "" + +#: regsvr32.rc:41 +msgid "" +"regsvr32: Invalid or unrecognized switch [%1]\n" +"\n" +msgstr "" + +#: regsvr32.rc:42 +msgid "regsvr32: Failed to load DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:43 +msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgstr "" + +#: regsvr32.rc:44 +msgid "regsvr32: Failed to register DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:45 +msgid "regsvr32: Successfully registered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:46 +msgid "regsvr32: Failed to unregister DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:47 +msgid "regsvr32: Successfully unregistered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:48 +msgid "regsvr32: Failed to install DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:49 +msgid "regsvr32: Successfully installed DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:50 +msgid "regsvr32: Failed to uninstall DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:51 +msgid "regsvr32: Successfully uninstalled DLL '%1'\n" +msgstr "" + #: start.rc:55 msgid "" "Application could not be started, or no application associated with the " diff -Nru wine1.7-1.7.14/po/wine.pot wine1.7-1.7.18/po/wine.pot --- wine1.7-1.7.14/po/wine.pot 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/po/wine.pot 2014-05-02 18:15:48.000000000 +0000 @@ -11057,6 +11057,74 @@ msgid "Exports selected branch of the registry to a text file" msgstr "" +#: regsvr32.rc:32 +msgid "" +"Wine DLL Registration Utility\n" +"\n" +"Provides DLL registration services.\n" +"\n" +msgstr "" + +#: regsvr32.rc:40 +msgid "" +"Usage:\n" +" regsvr32 [/u] [/s] [/n] [/i[:cmdline]] DllName\n" +"\n" +"Options:\n" +" [/u] Unregister a server.\n" +" [/s] Silent mode (no messages will be displayed).\n" +" [/i] Call DllInstall, passing an optional [cmdline].\n" +"\tWhen used with [/u] DllInstall is called in uninstall mode.\n" +" [/n] Do not call DllRegisterServer. This option must be used with [/i].\n" +"\n" +msgstr "" + +#: regsvr32.rc:41 +msgid "" +"regsvr32: Invalid or unrecognized switch [%1]\n" +"\n" +msgstr "" + +#: regsvr32.rc:42 +msgid "regsvr32: Failed to load DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:43 +msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgstr "" + +#: regsvr32.rc:44 +msgid "regsvr32: Failed to register DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:45 +msgid "regsvr32: Successfully registered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:46 +msgid "regsvr32: Failed to unregister DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:47 +msgid "regsvr32: Successfully unregistered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:48 +msgid "regsvr32: Failed to install DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:49 +msgid "regsvr32: Successfully installed DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:50 +msgid "regsvr32: Failed to uninstall DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:51 +msgid "regsvr32: Successfully uninstalled DLL '%1'\n" +msgstr "" + #: start.rc:55 msgid "" "Application could not be started, or no application associated with the " diff -Nru wine1.7-1.7.14/po/zh_CN.po wine1.7-1.7.18/po/zh_CN.po --- wine1.7-1.7.14/po/zh_CN.po 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/po/zh_CN.po 2014-05-02 18:15:48.000000000 +0000 @@ -11169,6 +11169,74 @@ msgid "Exports selected branch of the registry to a text file" msgstr "把选定的注册表分支导出为文本文件" +#: regsvr32.rc:32 +msgid "" +"Wine DLL Registration Utility\n" +"\n" +"Provides DLL registration services.\n" +"\n" +msgstr "" + +#: regsvr32.rc:40 +msgid "" +"Usage:\n" +" regsvr32 [/u] [/s] [/n] [/i[:cmdline]] DllName\n" +"\n" +"Options:\n" +" [/u] Unregister a server.\n" +" [/s] Silent mode (no messages will be displayed).\n" +" [/i] Call DllInstall, passing an optional [cmdline].\n" +"\tWhen used with [/u] DllInstall is called in uninstall mode.\n" +" [/n] Do not call DllRegisterServer. This option must be used with [/i].\n" +"\n" +msgstr "" + +#: regsvr32.rc:41 +msgid "" +"regsvr32: Invalid or unrecognized switch [%1]\n" +"\n" +msgstr "" + +#: regsvr32.rc:42 +msgid "regsvr32: Failed to load DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:43 +msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgstr "" + +#: regsvr32.rc:44 +msgid "regsvr32: Failed to register DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:45 +msgid "regsvr32: Successfully registered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:46 +msgid "regsvr32: Failed to unregister DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:47 +msgid "regsvr32: Successfully unregistered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:48 +msgid "regsvr32: Failed to install DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:49 +msgid "regsvr32: Successfully installed DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:50 +msgid "regsvr32: Failed to uninstall DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:51 +msgid "regsvr32: Successfully uninstalled DLL '%1'\n" +msgstr "" + #: start.rc:55 msgid "" "Application could not be started, or no application associated with the " diff -Nru wine1.7-1.7.14/po/zh_TW.po wine1.7-1.7.18/po/zh_TW.po --- wine1.7-1.7.14/po/zh_TW.po 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/po/zh_TW.po 2014-05-02 18:15:48.000000000 +0000 @@ -11537,6 +11537,76 @@ msgid "Exports selected branch of the registry to a text file" msgstr "匯出註冊表的所選分支到文字檔" +#: regsvr32.rc:32 +msgid "" +"Wine DLL Registration Utility\n" +"\n" +"Provides DLL registration services.\n" +"\n" +msgstr "" + +#: regsvr32.rc:40 +msgid "" +"Usage:\n" +" regsvr32 [/u] [/s] [/n] [/i[:cmdline]] DllName\n" +"\n" +"Options:\n" +" [/u] Unregister a server.\n" +" [/s] Silent mode (no messages will be displayed).\n" +" [/i] Call DllInstall, passing an optional [cmdline].\n" +"\tWhen used with [/u] DllInstall is called in uninstall mode.\n" +" [/n] Do not call DllRegisterServer. This option must be used with [/i].\n" +"\n" +msgstr "" + +#: regsvr32.rc:41 +msgid "" +"regsvr32: Invalid or unrecognized switch [%1]\n" +"\n" +msgstr "" + +#: regsvr32.rc:42 +#, fuzzy +#| msgid "Failed to open '%1'\n" +msgid "regsvr32: Failed to load DLL '%1'\n" +msgstr "開啟 %1 失敗\n" + +#: regsvr32.rc:43 +msgid "regsvr32: %1 not implemented in DLL '%2'\n" +msgstr "" + +#: regsvr32.rc:44 +msgid "regsvr32: Failed to register DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:45 +msgid "regsvr32: Successfully registered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:46 +msgid "regsvr32: Failed to unregister DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:47 +msgid "regsvr32: Successfully unregistered DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:48 +msgid "regsvr32: Failed to install DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:49 +msgid "regsvr32: Successfully installed DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:50 +msgid "regsvr32: Failed to uninstall DLL '%1'\n" +msgstr "" + +#: regsvr32.rc:51 +msgid "regsvr32: Successfully uninstalled DLL '%1'\n" +msgstr "" + #: start.rc:55 msgid "" "Application could not be started, or no application associated with the " diff -Nru wine1.7-1.7.14/programs/cmd/tests/batch.c wine1.7-1.7.18/programs/cmd/tests/batch.c --- wine1.7-1.7.14/programs/cmd/tests/batch.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/programs/cmd/tests/batch.c 2014-05-02 18:15:48.000000000 +0000 @@ -459,8 +459,14 @@ drive[0] = workdir[0]; drive[1] = workdir[1]; /* Should be ':' */ memcpy(path, workdir + drive_len, (workdir_len - drive_len) * sizeof(drive[0])); - path[workdir_len - drive_len] = '\\'; - path_len = workdir_len - drive_len + 1; + + /* Only add trailing backslash to 'path' for non-root directory */ + if (workdir_len - drive_len > 1) { + path[workdir_len - drive_len] = '\\'; + path_len = workdir_len - drive_len + 1; + } else { + path_len = 1; /* \ */ + } shortpath_len = GetShortPathNameA(path, shortpath, sizeof(shortpath)/sizeof(shortpath[0])); diff -Nru wine1.7-1.7.14/programs/cmd/tests/test_builtins.cmd wine1.7-1.7.18/programs/cmd/tests/test_builtins.cmd --- wine1.7-1.7.14/programs/cmd/tests/test_builtins.cmd 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/programs/cmd/tests/test_builtins.cmd 2014-05-02 18:15:48.000000000 +0000 @@ -308,6 +308,13 @@ echo ------------ Testing variable expansion ------------ call :setError 0 +echo ~p0 should be path containing batch file +echo %~p0 +mkdir dummydir +cd dummydir +echo %~p0 +cd .. +rmdir dummydir echo ~dp0 should be directory containing batch file echo %~dp0 mkdir dummydir diff -Nru wine1.7-1.7.14/programs/cmd/tests/test_builtins.cmd.exp wine1.7-1.7.18/programs/cmd/tests/test_builtins.cmd.exp --- wine1.7-1.7.14/programs/cmd/tests/test_builtins.cmd.exp 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/programs/cmd/tests/test_builtins.cmd.exp 2014-05-02 18:15:48.000000000 +0000 @@ -259,9 +259,12 @@ 'jim' 'apple"banana"grape' ------------ Testing variable expansion ------------ +~p0 should be path containing batch file +@path@ +@path@ ~dp0 should be directory containing batch file -@pwd@\ -@pwd@\ +@drive@@path@ +@drive@@path@ CD value @pwd@@or_broken@CD value@space@ % P @@ -296,8 +299,8 @@ C 'A B'@or_broken@'' 'C'@or_broken@'' -@pwd@\C D@or_broken@%~ff -@pwd@\E@or_broken@%~ff +@drive@@path@C D@or_broken@%~ff +@drive@@path@E@or_broken@%~ff @drive@ @drive@ @path@@or_broken@%~pd @@ -332,8 +335,8 @@ C 'A B'@or_broken@'' 'C'@or_broken@'' -@pwd@\C D -@pwd@\E +@drive@@path@C D +@drive@@path@E @drive@ @drive@ @path@ @@ -389,22 +392,22 @@ foo6@space@ @todo_wine@------------ Testing cd ------------ singleFile -Current dir: @pwd@\foobar@or_broken@Current dir:@space@ -@pwd@\foobar +Current dir: @drive@@path@foobar@or_broken@Current dir:@space@ +@drive@@path@foobar @pwd@ -@pwd@\foobar +@drive@@path@foobar @pwd@ -@pwd@\foobar +@drive@@path@foobar @pwd@ @pwd@ @pwd@ -@pwd@\foobar\bar bak -@pwd@\foobar\bar bak -@pwd@\foobar\bar bak -@pwd@\foobar\bar bak -@pwd@\foobar\bar bak +@drive@@path@foobar\bar bak +@drive@@path@foobar\bar bak +@drive@@path@foobar\bar bak +@drive@@path@foobar\bar bak +@drive@@path@foobar\bar bak @pwd@ -@pwd@\foobar +@drive@@path@foobar ------------ Testing type ------------ @pwd@>type foobaz@space@ @@ -1087,31 +1090,31 @@ --- pushing non-existing dir @pwd@ --- basic behaviour -@pwd@\foobar +@drive@@path@foobar @pwd@ -@pwd@\foobar\baz -@pwd@\foobar -@pwd@\foobar +@drive@@path@foobar\baz +@drive@@path@foobar +@drive@@path@foobar @pwd@ -@pwd@\foobar +@drive@@path@foobar @pwd@ ------------ Testing attrib ------------ -A @pwd@\foobar\foo@or_broken@A @pwd@\foobar\foo@or_broken@A I @pwd@\foobar\foo +A @drive@@path@foobar\foo@or_broken@A @drive@@path@foobar\foo@or_broken@A I @drive@@path@foobar\foo --- read-only attribute -A R @pwd@\foobar\foo@or_broken@A R @pwd@\foobar\foo@or_broken@A R I @pwd@\foobar\foo +A R @drive@@path@foobar\foo@or_broken@A R @drive@@path@foobar\foo@or_broken@A R I @drive@@path@foobar\foo foo foo original contents Read-only file not deleted Read-only file forcibly deleted --- recursive behaviour -A @pwd@\foobar\baz\level2@or_broken@A @pwd@\foobar\baz\level2@or_broken@A I @pwd@\foobar\baz\level2 -A R @pwd@\foobar\level1@or_broken@A R @pwd@\foobar\level1@or_broken@A R I @pwd@\foobar\level1 -A R @pwd@\foobar\baz\level2@or_broken@A R @pwd@\foobar\baz\level2@or_broken@A R I @pwd@\foobar\baz\level2 -A @pwd@\foobar\bar@or_broken@A @pwd@\foobar\bar@or_broken@A I @pwd@\foobar\bar +A @drive@@path@foobar\baz\level2@or_broken@A @drive@@path@foobar\baz\level2@or_broken@A I @drive@@path@foobar\baz\level2 +A R @drive@@path@foobar\level1@or_broken@A R @drive@@path@foobar\level1@or_broken@A R I @drive@@path@foobar\level1 +A R @drive@@path@foobar\baz\level2@or_broken@A R @drive@@path@foobar\baz\level2@or_broken@A R I @drive@@path@foobar\baz\level2 +A @drive@@path@foobar\bar@or_broken@A @drive@@path@foobar\bar@or_broken@A I @drive@@path@foobar\bar --- folders processing - @pwd@\foobar@or_broken@ @pwd@\foobar@or_broken@ I @pwd@\foobar -@todo_wine@ R @pwd@\foobar\baz@or_broken@ R @pwd@\foobar\baz@or_broken@ @pwd@\foobar\baz@or_broken@ R I @pwd@\foobar\baz -A @pwd@\foobar\baz\toto@or_broken@A @pwd@\foobar\baz\toto@or_broken@A I @pwd@\foobar\baz\toto + @drive@@path@foobar@or_broken@ @drive@@path@foobar@or_broken@ I @drive@@path@foobar +@todo_wine@ R @drive@@path@foobar\baz@or_broken@ R @drive@@path@foobar\baz@or_broken@ @drive@@path@foobar\baz@or_broken@ R I @drive@@path@foobar\baz +A @drive@@path@foobar\baz\toto@or_broken@A @drive@@path@foobar\baz\toto@or_broken@A I @drive@@path@foobar\baz\toto toto lulu file created in read-only dir @@ -1248,17 +1251,17 @@ --- setlocal with corresponding endlocal globalval localval -@pwd@\foobar\foobar2 +@drive@@path@foobar\foobar2 globalval -@pwd@\foobar +@drive@@path@foobar globalval -@pwd@\foobar +@drive@@path@foobar --- setlocal with no corresponding endlocal globalval localval -@pwd@\foobar\foobar2 +@drive@@path@foobar\foobar2 globalval -@pwd@\foobar +@drive@@path@foobar --- setlocal within same batch program Var1 ok 1 Var2 ok 2 @@ -1276,23 +1279,23 @@ --- Extra setlocal in called batch value2 2set1endvalue1 -@pwd@\foobar\foodir3 +@drive@@path@foobar\foodir3 Finished: value2 -@pwd@\foobar\foodir2 +@drive@@path@foobar\foodir2 value1 -@pwd@\foobar +@drive@@path@foobar --- Extra endlocal in called batch value2 value2 -@pwd@\foobar\foodir2 +@drive@@path@foobar\foodir2 value2 -@pwd@\foobar\foodir2 +@drive@@path@foobar\foodir2 Finished: value2 -@pwd@\foobar\foodir2 +@drive@@path@foobar\foodir2 value1 -@pwd@\foobar +@drive@@path@foobar --- endlocal in called function rather than batch pgm is ineffective 2 2 diff -Nru wine1.7-1.7.14/programs/cscript/main.c wine1.7-1.7.18/programs/cscript/main.c --- wine1.7-1.7.14/programs/cscript/main.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/programs/cscript/main.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,61 +0,0 @@ -/* - * CSCRIPT Implementation - * - * Copyright 2011 André Hentschel - * - * 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 WIN32_LEAN_AND_MEAN -#include -#include -#include - -#include -#include - -WINE_DEFAULT_DEBUG_CHANNEL(cscript); - -int WINAPI wWinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPWSTR cmdline, int cmdshow) -{ - static const WCHAR wscriptW[] = {'\\','w','s','c','r','i','p','t','.','e','x','e',0}; - static const WCHAR parbW[] = {' ','/','B',' ',0}; - WCHAR app[MAX_PATH]; - WCHAR cmd[MAX_PATH]; - PROCESS_INFORMATION pi; - BOOL ret; - DWORD exitcode; - STARTUPINFOW si = { sizeof(si) }; - - WINE_FIXME("(%p %p %s %x) forwarding to wscript\n", hInst, hPrevInst, wine_dbgstr_w(cmdline), cmdshow); - - GetSystemDirectoryW(app, MAX_PATH); - strcatW(app, wscriptW); - strcpyW(cmd, app); - strcatW(cmd, parbW); - strcatW(cmd, cmdline); - - if (!CreateProcessW(app, cmd, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) return 1; - WaitForSingleObject( pi.hProcess, INFINITE ); - - ret = GetExitCodeProcess(pi.hProcess, &exitcode); - CloseHandle( pi.hProcess ); - CloseHandle( pi.hThread ); - - if (ret) - return exitcode; - else - return 1; -} diff -Nru wine1.7-1.7.14/programs/cscript/Makefile.in wine1.7-1.7.18/programs/cscript/Makefile.in --- wine1.7-1.7.14/programs/cscript/Makefile.in 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/programs/cscript/Makefile.in 2014-05-02 18:15:48.000000000 +0000 @@ -1,5 +1,12 @@ MODULE = cscript.exe APPMODE = -mwindows -municode +IMPORTS = uuid shell32 oleaut32 ole32 advapi32 +EXTRADEFS = -DCSCRIPT_BUILD +PARENTSRC = ../wscript C_SRCS = \ + arguments.c \ + host.c \ main.c + +IDL_SRCS = ihost.idl diff -Nru wine1.7-1.7.14/programs/iexplore/Makefile.in wine1.7-1.7.18/programs/iexplore/Makefile.in --- wine1.7-1.7.14/programs/iexplore/Makefile.in 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/programs/iexplore/Makefile.in 2014-05-02 18:15:48.000000000 +0000 @@ -1,5 +1,5 @@ MODULE = iexplore.exe -APPMODE = -mwindows -municode +APPMODE = -mwindows -municode -Wl,--large-address-aware IMPORTS = ieframe DELAYIMPORTS = advpack version diff -Nru wine1.7-1.7.14/programs/oleview/details.c wine1.7-1.7.18/programs/oleview/details.c --- wine1.7-1.7.14/programs/oleview/details.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/programs/oleview/details.c 2014-05-02 18:15:48.000000000 +0000 @@ -158,7 +158,7 @@ RegCloseKey(hCurKey); - memmove(&wszData[6], wszData, sizeof(WCHAR[lenData])); + memmove(&wszData[6], wszData, lenData * sizeof(WCHAR)); memcpy(wszData, wszCLSID, sizeof(WCHAR[6])); wszData[5] = '\\'; @@ -187,7 +187,7 @@ RegCloseKey(hCurKey); - memmove(&wszData[8], wszData, sizeof(WCHAR[lenData])); + memmove(&wszData[8], wszData, lenData * sizeof(WCHAR)); memcpy(wszData, wszTypeLib, sizeof(WCHAR[8])); wszData[7] = '\\'; RegOpenKeyW(HKEY_CLASSES_ROOT, wszData, &hCurKey); @@ -238,9 +238,9 @@ if(RegQueryValueW(hKey, NULL, wszTree, (LONG *)&lenTree) == ERROR_SUCCESS) { memmove(&wszTree[lenBuffer-lastLenBuffer+3], wszTree, - sizeof(WCHAR[lenTree])); + lenTree * sizeof(WCHAR)); memcpy(wszTree, &buffer[lastLenBuffer], - sizeof(WCHAR[lenBuffer-lastLenBuffer])); + (lenBuffer - lastLenBuffer) * sizeof(WCHAR)); if(lenTree == 1) wszTree[lenBuffer-lastLenBuffer] = '\0'; else diff -Nru wine1.7-1.7.14/programs/oleview/tree.c wine1.7-1.7.18/programs/oleview/tree.c --- wine1.7-1.7.14/programs/oleview/tree.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/programs/oleview/tree.c 2014-05-02 18:15:48.000000000 +0000 @@ -225,7 +225,7 @@ int bufLen; BOOL ret; - memset(buffer, 0, sizeof(WCHAR[bufSize])); + memset(buffer, 0, bufSize * sizeof(WCHAR)); memset(&tvi, 0, sizeof(TVITEMW)); tvi.hItem = item; @@ -239,8 +239,8 @@ if(tvi.lParam && (((ITEM_INFO *)tvi.lParam)->cFlag & (REGPATH|REGTOP))) { bufLen = lstrlenW(((ITEM_INFO *)tvi.lParam)->info); - memmove(&buffer[bufLen], buffer, sizeof(WCHAR[bufSize-bufLen])); - memcpy(buffer, ((ITEM_INFO *)tvi.lParam)->info, sizeof(WCHAR[bufLen])); + memmove(&buffer[bufLen], buffer, (bufSize - bufLen) * sizeof(WCHAR)); + memcpy(buffer, ((ITEM_INFO *)tvi.lParam)->info, bufLen * sizeof(WCHAR)); } if(tvi.lParam && ((ITEM_INFO *)tvi.lParam)->cFlag & REGTOP) break; diff -Nru wine1.7-1.7.14/programs/regsvr32/Makefile.in wine1.7-1.7.18/programs/regsvr32/Makefile.in --- wine1.7-1.7.14/programs/regsvr32/Makefile.in 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/programs/regsvr32/Makefile.in 2014-05-02 18:15:48.000000000 +0000 @@ -1,6 +1,6 @@ MODULE = regsvr32.exe APPMODE = -mconsole -IMPORTS = ole32 +IMPORTS = ole32 user32 C_SRCS = \ regsvr32.c diff -Nru wine1.7-1.7.14/programs/regsvr32/regsvr32.c wine1.7-1.7.18/programs/regsvr32/regsvr32.c --- wine1.7-1.7.14/programs/regsvr32/regsvr32.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/programs/regsvr32/regsvr32.c 2014-05-02 18:15:48.000000000 +0000 @@ -51,10 +51,13 @@ #include "config.h" #include "wine/port.h" -#include #include #include #include +#include "regsvr32.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(regsvr32); typedef HRESULT (*DLLREGISTER) (void); typedef HRESULT (*DLLUNREGISTER) (void); @@ -62,16 +65,38 @@ static BOOL Silent = FALSE; -static int Usage(void) +static void __cdecl output_write(UINT id, ...) { - printf("regsvr32 [/u] [/s] [/n] [/i[:cmdline]] dllname ...\n"); - printf("\t[/u] unregister server\n"); - printf("\t[/s] silent (no message boxes)\n"); - printf("\t[/i] Call DllInstall passing it an optional [cmdline];\n"); - printf("\t when used with /u calls dll uninstall\n"); - printf("\t[/n] Do not call DllRegisterServer; this option " - "must be used with [/i]\n"); - return 0; + char fmt[1024]; + __ms_va_list va_args; + char *str; + DWORD len, nOut, ret; + + if (Silent) return; + + if (!LoadStringA(GetModuleHandleA(NULL), id, fmt, sizeof(fmt)/sizeof(fmt[0]))) + { + WINE_FIXME("LoadString failed with %d\n", GetLastError()); + return; + } + + __ms_va_start(va_args, id); + SetLastError(NO_ERROR); + len = FormatMessageA(FORMAT_MESSAGE_FROM_STRING|FORMAT_MESSAGE_ALLOCATE_BUFFER, + fmt, 0, 0, (LPSTR)&str, 0, &va_args); + __ms_va_end(va_args); + if (len == 0 && GetLastError() != NO_ERROR) + { + WINE_FIXME("Could not format string: le=%u, fmt=%s\n", GetLastError(), wine_dbgstr_a(fmt)); + return; + } + + ret = WriteConsoleA(GetStdHandle(STD_OUTPUT_HANDLE), str, len, &nOut, NULL); + + if (!ret) + WINE_WARN("regsvr32: WriteConsoleA() failed.\n"); + + LocalFree(str); } /** @@ -89,16 +114,13 @@ *DllHandle = LoadLibraryExA(strDll, 0, LOAD_WITH_ALTERED_SEARCH_PATH); if(!*DllHandle) { - if(!Silent) - printf("Failed to load DLL %s\n", strDll); - + output_write(STRING_DLL_LOAD_FAILED, strDll); ExitProcess(1); } proc = (VOID *) GetProcAddress(*DllHandle, procName); if(!proc) { - if(!Silent) - printf("%s not implemented in DLL %s\n", procName, strDll); + output_write(STRING_PROC_NOT_IMPLEMENTED, procName, strDll); FreeLibrary(*DllHandle); return NULL; } @@ -118,13 +140,10 @@ hr = pfRegister(); if(FAILED(hr)) { - if(!Silent) - printf("Failed to register DLL %s\n", strDll); - + output_write(STRING_REGISTER_FAILED, strDll); return -1; } - if(!Silent) - printf("Successfully registered DLL %s\n", strDll); + output_write(STRING_REGISTER_SUCCESSFUL, strDll); if(DllHandle) FreeLibrary(DllHandle); @@ -144,13 +163,10 @@ hr = pfUnregister(); if(FAILED(hr)) { - if(!Silent) - printf("Failed to unregister DLL %s\n", strDll); - + output_write(STRING_UNREGISTER_FAILED, strDll); return -1; } - if(!Silent) - printf("Successfully unregistered DLL %s\n", strDll); + output_write(STRING_UNREGISTER_SUCCESSFUL, strDll); if(DllHandle) FreeLibrary(DllHandle); @@ -170,14 +186,16 @@ hr = pfInstall(install, command_line); if(FAILED(hr)) { - if(!Silent) - printf("Failed to %s DLL %s\n", install ? "install" : "uninstall", - strDll); + if (install) + output_write(STRING_INSTALL_FAILED, strDll); + else + output_write(STRING_UNINSTALL_FAILED, strDll); return -1; } - if(!Silent) - printf("Successfully %s DLL %s\n", install ? "installed" : "uninstalled", - strDll); + if (install) + output_write(STRING_INSTALL_SUCCESSFUL, strDll); + else + output_write(STRING_UNINSTALL_SUCCESSFUL, strDll); if(DllHandle) FreeLibrary(DllHandle); @@ -197,7 +215,7 @@ OleInitialize(NULL); /* Strictly, the Microsoft version processes all the flags before - * the files (e.g. regsvr32 file1 /s file2 is silent even for file1. + * 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. */ @@ -254,7 +272,11 @@ else if((!strcasecmp(argv[i], "/c"))||(!strcasecmp(argv[i], "-c"))) /* console output */; else if (argv[i][0] == '/' && (!argv[i][2] || argv[i][2] == ':')) - printf("Unrecognized switch %s\n", argv[i]); + { + output_write(STRING_UNRECOGNIZED_SWITCH, argv[i]); + output_write(STRING_USAGE); + return 1; + } else { char *DllName = argv[i]; @@ -285,10 +307,9 @@ if (!DllFound) { - if(!Silent) - return Usage(); - else - return -1; + output_write(STRING_HEADER); + output_write(STRING_USAGE); + return 1; } OleUninitialize(); diff -Nru wine1.7-1.7.14/programs/regsvr32/regsvr32.h wine1.7-1.7.18/programs/regsvr32/regsvr32.h --- wine1.7-1.7.14/programs/regsvr32/regsvr32.h 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.18/programs/regsvr32/regsvr32.h 2014-05-02 18:15:48.000000000 +0000 @@ -0,0 +1,34 @@ +/* + * Regsvr32 definitions + * + * Copyright 2014 Hugh McMaster + * + * 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 + */ + +/* Resource strings */ +#define STRING_HEADER 1000 +#define STRING_USAGE 1001 +#define STRING_UNRECOGNIZED_SWITCH 1002 +#define STRING_DLL_LOAD_FAILED 1003 +#define STRING_PROC_NOT_IMPLEMENTED 1004 +#define STRING_REGISTER_FAILED 1005 +#define STRING_REGISTER_SUCCESSFUL 1006 +#define STRING_UNREGISTER_FAILED 1007 +#define STRING_UNREGISTER_SUCCESSFUL 1008 +#define STRING_INSTALL_FAILED 1009 +#define STRING_INSTALL_SUCCESSFUL 1010 +#define STRING_UNINSTALL_FAILED 1011 +#define STRING_UNINSTALL_SUCCESSFUL 1012 diff -Nru wine1.7-1.7.14/programs/regsvr32/regsvr32.rc wine1.7-1.7.18/programs/regsvr32/regsvr32.rc --- wine1.7-1.7.14/programs/regsvr32/regsvr32.rc 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/programs/regsvr32/regsvr32.rc 2014-05-02 18:15:48.000000000 +0000 @@ -1,6 +1,7 @@ -/* Language neutral resources. +/* Regsvr32 resource strings * * Copyright 2003 Stefan Leichter + * Copyright 2014 Hugh McMaster * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -17,8 +18,40 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include +#include "regsvr32.h" + +#pragma makedep po + +LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT + +STRINGTABLE +{ + STRING_HEADER, "Wine DLL Registration Utility\n\n\ +Provides DLL registration services.\n\n" + STRING_USAGE, "Usage:\n\ +\ regsvr32 [/u] [/s] [/n] [/i[:cmdline]] DllName\n\n\ +Options:\n\ +\ [/u] Unregister a server.\n\ +\ [/s] Silent mode (no messages will be displayed).\n\ +\ [/i] Call DllInstall, passing an optional [cmdline].\n\ +\tWhen used with [/u] DllInstall is called in uninstall mode.\n\ +\ [/n] Do not call DllRegisterServer. This option must be used with [/i].\n\n" + STRING_UNRECOGNIZED_SWITCH, "regsvr32: Invalid or unrecognized switch [%1]\n\n" + STRING_DLL_LOAD_FAILED, "regsvr32: Failed to load DLL '%1'\n" + STRING_PROC_NOT_IMPLEMENTED, "regsvr32: %1 not implemented in DLL '%2'\n" + STRING_REGISTER_FAILED, "regsvr32: Failed to register DLL '%1'\n" + STRING_REGISTER_SUCCESSFUL, "regsvr32: Successfully registered DLL '%1'\n" + STRING_UNREGISTER_FAILED, "regsvr32: Failed to unregister DLL '%1'\n" + STRING_UNREGISTER_SUCCESSFUL, "regsvr32: Successfully unregistered DLL '%1'\n" + STRING_INSTALL_FAILED, "regsvr32: Failed to install DLL '%1'\n" + STRING_INSTALL_SUCCESSFUL, "regsvr32: Successfully installed DLL '%1'\n" + STRING_UNINSTALL_FAILED, "regsvr32: Failed to uninstall DLL '%1'\n" + STRING_UNINSTALL_SUCCESSFUL, "regsvr32: Successfully uninstalled DLL '%1'\n" +} + #define WINE_FILEDESCRIPTION_STR "Wine Register Server" -#define WINE_FILENAME_STR "REGSVR32" +#define WINE_FILENAME_STR "REGSVR32.EXE" #define WINE_FILETYPE VFT_APP #define WINE_FILEVERSION 5,0,1586,1 #define WINE_FILEVERSION_STR "5.0.1586.1" diff -Nru wine1.7-1.7.14/programs/sdbinst/main.c wine1.7-1.7.18/programs/sdbinst/main.c --- wine1.7-1.7.14/programs/sdbinst/main.c 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.18/programs/sdbinst/main.c 2014-05-02 18:15:48.000000000 +0000 @@ -0,0 +1,33 @@ +/* + * Copyright 2014 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 + */ + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(sdbinst); + +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.14/programs/sdbinst/Makefile.in wine1.7-1.7.18/programs/sdbinst/Makefile.in --- wine1.7-1.7.14/programs/sdbinst/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ wine1.7-1.7.18/programs/sdbinst/Makefile.in 2014-05-02 18:15:48.000000000 +0000 @@ -0,0 +1,5 @@ +MODULE = sdbinst.exe +APPMODE = -mconsole -municode + +C_SRCS = \ + main.c diff -Nru wine1.7-1.7.14/programs/services/services.c wine1.7-1.7.18/programs/services/services.c --- wine1.7-1.7.14/programs/services/services.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/programs/services/services.c 2014-05-02 18:15:48.000000000 +0000 @@ -695,32 +695,29 @@ static DWORD service_wait_for_startup(struct service_entry *service_entry, HANDLE process_handle) { + HANDLE handles[2] = { service_entry->status_changed_event, process_handle }; + DWORD state, ret; + WINE_TRACE("%p\n", service_entry); - for (;;) + ret = WaitForMultipleObjects( 2, handles, FALSE, service_pipe_timeout ); + if (ret != WAIT_OBJECT_0) + return ERROR_SERVICE_REQUEST_TIMEOUT; + service_lock_shared(service_entry); + state = service_entry->status.dwCurrentState; + service_unlock(service_entry); + if (state == SERVICE_START_PENDING) + { + WINE_TRACE("Service state changed to SERVICE_START_PENDING\n"); + return ERROR_SUCCESS; + } + else if (state == SERVICE_RUNNING) { - DWORD dwCurrentStatus; - HANDLE handles[2] = { service_entry->status_changed_event, process_handle }; - DWORD ret; - ret = WaitForMultipleObjects( 2, handles, FALSE, service_pipe_timeout ); - if (ret != WAIT_OBJECT_0) - return ERROR_SERVICE_REQUEST_TIMEOUT; - service_lock_shared(service_entry); - dwCurrentStatus = service_entry->status.dwCurrentState; - service_unlock(service_entry); - if (dwCurrentStatus == SERVICE_START_PENDING) - { - WINE_TRACE("Service changed its status to SERVICE_START_PENDING\n"); - return ERROR_SUCCESS; - } - else if (dwCurrentStatus == SERVICE_RUNNING) - { - WINE_TRACE("Service started successfully\n"); - return ERROR_SUCCESS; - } - if (dwCurrentStatus != SERVICE_START_PENDING) - return ERROR_SERVICE_REQUEST_TIMEOUT; + WINE_TRACE("Service started successfully\n"); + return ERROR_SUCCESS; } + + return ERROR_SERVICE_REQUEST_TIMEOUT; } /****************************************************************************** diff -Nru wine1.7-1.7.14/programs/services/tests/service.c wine1.7-1.7.18/programs/services/tests/service.c --- wine1.7-1.7.14/programs/services/tests/service.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/programs/services/tests/service.c 2014-05-02 18:15:48.000000000 +0000 @@ -471,10 +471,14 @@ return; } - argc = winetest_get_mainargs(&argv); - scm_handle = OpenSCManagerA(NULL, NULL, GENERIC_ALL); - ok(scm_handle != NULL, "OpenSCManager failed: %u\n", GetLastError()); + ok(scm_handle != NULL || GetLastError() == ERROR_ACCESS_DENIED, "OpenSCManager failed: %u\n", GetLastError()); + if(!scm_handle) { + skip("OpenSCManager failed, skipping tests\n"); + return; + } + + argc = winetest_get_mainargs(&argv); if(argc < 3) { test_runner(test_service); diff -Nru wine1.7-1.7.14/programs/start/start.c wine1.7-1.7.18/programs/start/start.c --- wine1.7-1.7.14/programs/start/start.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/programs/start/start.c 2014-05-02 18:15:48.000000000 +0000 @@ -216,8 +216,7 @@ sei.nShow = SW_SHOWNORMAL; /* Dunno what these mean, but it looks like winMe's start uses them */ sei.fMask = SEE_MASK_FLAG_DDEWAIT| - SEE_MASK_FLAG_NO_UI| - SEE_MASK_NO_CONSOLE; + SEE_MASK_FLAG_NO_UI; sei.lpDirectory = NULL; creation_flags = CREATE_NEW_CONSOLE; diff -Nru wine1.7-1.7.14/programs/svchost/svchost.c wine1.7-1.7.18/programs/svchost/svchost.c --- wine1.7-1.7.14/programs/svchost/svchost.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/programs/svchost/svchost.c 2014-05-02 18:15:48.000000000 +0000 @@ -254,6 +254,7 @@ LPWSTR service_name = NULL; SERVICE_TABLE_ENTRYW *service_table = NULL; DWORD service_count; + BOOL ret; /* Count the services to load */ service_count = 0; @@ -264,8 +265,7 @@ service_name = service_name + lstrlenW(service_name); ++service_name; } - WINE_TRACE("Service group %s contains %d services\n", - wine_dbgstr_w(services), service_count); + WINE_TRACE("Service group contains %d services\n", service_count); /* Populate the service table */ service_table = HeapAlloc(GetProcessHeap(), 0, @@ -287,15 +287,12 @@ service_table[service_count].lpServiceProc = NULL; /* Start the services */ - if (!StartServiceCtrlDispatcherW(service_table)) - { + if (!(ret = StartServiceCtrlDispatcherW(service_table))) WINE_ERR("StartServiceCtrlDispatcherW failed to start %s: %u\n", wine_dbgstr_w(services), GetLastError()); - HeapFree(GetProcessHeap(), 0, service_table); - return FALSE; - } + HeapFree(GetProcessHeap(), 0, service_table); - return TRUE; + return ret; } /* Find the list of services associated with a group name and start those @@ -327,14 +324,11 @@ } /* Start services */ - if (StartGroupServices(services) == FALSE) - { + if (!(ret = StartGroupServices(services))) WINE_TRACE("Failed to start service group\n"); - HeapFree(GetProcessHeap(), 0, services); - return FALSE; - } + HeapFree(GetProcessHeap(), 0, services); - return TRUE; + return ret; } /* Load svchost group specified on the command line via the /k option */ diff -Nru wine1.7-1.7.14/programs/winemenubuilder/winemenubuilder.c wine1.7-1.7.18/programs/winemenubuilder/winemenubuilder.c --- wine1.7-1.7.14/programs/winemenubuilder/winemenubuilder.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/programs/winemenubuilder/winemenubuilder.c 2014-05-02 18:15:48.000000000 +0000 @@ -3216,14 +3216,14 @@ if( !linkname[0] ) { WINE_ERR("link name missing\n"); - return 1; + return FALSE; } len=GetFullPathNameW( linkname, MAX_PATH, fullname, NULL ); if (len==0 || len>MAX_PATH) { WINE_ERR("couldn't get full path of link file\n"); - return 1; + return FALSE; } r = CoCreateInstance( &CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, @@ -3231,14 +3231,14 @@ if( FAILED( r ) ) { WINE_ERR("No IID_IShellLink\n"); - return 1; + return FALSE; } r = IShellLinkW_QueryInterface( sl, &IID_IPersistFile, (LPVOID*) &pf ); if( FAILED( r ) ) { WINE_ERR("No IID_IPersistFile\n"); - return 1; + return FALSE; } r = IPersistFile_Load( pf, fullname, STGM_READ ); @@ -3277,14 +3277,14 @@ if( !urlname[0] ) { WINE_ERR("URL name missing\n"); - return 1; + return FALSE; } len=GetFullPathNameW( urlname, MAX_PATH, fullname, NULL ); if (len==0 || len>MAX_PATH) { WINE_ERR("couldn't get full path of URL file\n"); - return 1; + return FALSE; } r = CoCreateInstance( &CLSID_InternetShortcut, NULL, CLSCTX_INPROC_SERVER, @@ -3292,14 +3292,14 @@ if( FAILED( r ) ) { WINE_ERR("No IID_IUniformResourceLocatorW\n"); - return 1; + return FALSE; } r = url->lpVtbl->QueryInterface( url, &IID_IPersistFile, (LPVOID*) &pf ); if( FAILED( r ) ) { WINE_ERR("No IID_IPersistFile\n"); - return 1; + return FALSE; } r = IPersistFile_Load( pf, fullname, STGM_READ ); if( SUCCEEDED( r ) ) diff -Nru wine1.7-1.7.14/programs/winhlp32/winhelp.c wine1.7-1.7.18/programs/winhlp32/winhelp.c --- wine1.7-1.7.14/programs/winhlp32/winhelp.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/programs/winhlp32/winhelp.c 2014-05-02 18:15:48.000000000 +0000 @@ -1131,7 +1131,6 @@ win->hHistoryWnd = hWnd; break; case WM_CREATE: - win = (WINHELP_WINDOW*) GetWindowLongPtrW(hWnd, 0); hDc = GetDC(hWnd); GetTextMetricsW(hDc, &tm); GetWindowRect(hWnd, &r); @@ -1146,7 +1145,6 @@ ReleaseDC(hWnd, hDc); break; case WM_LBUTTONDOWN: - win = (WINHELP_WINDOW*) GetWindowLongPtrW(hWnd, 0); hDc = GetDC(hWnd); GetTextMetricsW(hDc, &tm); i = HIWORD(lParam) / tm.tmHeight; @@ -1156,7 +1154,6 @@ break; case WM_PAINT: hDc = BeginPaint(hWnd, &ps); - win = (WINHELP_WINDOW*) GetWindowLongPtrW(hWnd, 0); GetTextMetricsW(hDc, &tm); for (i = 0; i < Globals.history.index; i++) diff -Nru wine1.7-1.7.14/programs/wscript/host.c wine1.7-1.7.18/programs/wscript/host.c --- wine1.7-1.7.14/programs/wscript/host.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/programs/wscript/host.c 2014-05-02 18:15:48.000000000 +0000 @@ -34,7 +34,13 @@ static const WCHAR wshNameW[] = {'W','i','n','d','o','w','s',' ','S','c','r','i','p','t',' ','H','o','s','t',0}; static const WCHAR wshVersionW[] = {'5','.','8'}; -VARIANT_BOOL wshInteractive = VARIANT_TRUE; + +VARIANT_BOOL wshInteractive = +#ifndef CSCRIPT_BUILD + VARIANT_TRUE; +#else + VARIANT_FALSE; +#endif WINE_DEFAULT_DEBUG_CHANNEL(wscript); @@ -230,8 +236,29 @@ static HRESULT WINAPI Host_CreateObject(IHost *iface, BSTR ProgID, BSTR Prefix, IDispatch **out_Dispatch) { - WINE_FIXME("(%s %s %p)\n", wine_dbgstr_w(ProgID), wine_dbgstr_w(Prefix), out_Dispatch); - return E_NOTIMPL; + IUnknown *unk; + GUID guid; + HRESULT hres; + + TRACE("(%s %s %p)\n", wine_dbgstr_w(ProgID), wine_dbgstr_w(Prefix), out_Dispatch); + + if(Prefix && *Prefix) { + FIXME("Prefix %s not supported\n", debugstr_w(Prefix)); + return E_NOTIMPL; + } + + hres = CLSIDFromProgID(ProgID, &guid); + if(FAILED(hres)) + return hres; + + hres = CoCreateInstance(&guid, NULL, CLSCTX_INPROC_SERVER|CLSCTX_LOCAL_SERVER|CLSCTX_REMOTE_SERVER, + &IID_IUnknown, (void**)&unk); + if(FAILED(hres)) + return hres; + + hres = IUnknown_QueryInterface(unk, &IID_IDispatch, (void**)out_Dispatch); + IUnknown_Release(unk); + return hres; } static HRESULT WINAPI Host_Echo(IHost *iface, SAFEARRAY *args) diff -Nru wine1.7-1.7.14/programs/wscript/main.c wine1.7-1.7.18/programs/wscript/main.c --- wine1.7-1.7.14/programs/wscript/main.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/programs/wscript/main.c 2014-05-02 18:15:48.000000000 +0000 @@ -229,7 +229,7 @@ return SUCCEEDED(hres); } -static HRESULT create_engine(CLSID *clsid, IActiveScript **script_ret, +static BOOL create_engine(CLSID *clsid, IActiveScript **script_ret, IActiveScriptParse **parser) { IActiveScript *script; @@ -256,7 +256,7 @@ return TRUE; } -static HRESULT init_engine(IActiveScript *script, IActiveScriptParse *parser) +static BOOL init_engine(IActiveScript *script, IActiveScriptParse *parser) { HRESULT hres; @@ -339,6 +339,7 @@ static BOOL set_host_properties(const WCHAR *prop) { + static const WCHAR nologoW[] = {'n','o','l','o','g','o',0}; static const WCHAR iactive[] = {'i',0}; static const WCHAR batch[] = {'b',0}; @@ -354,8 +355,13 @@ wshInteractive = VARIANT_TRUE; else if(strcmpiW(prop, batch) == 0) wshInteractive = VARIANT_FALSE; + else if(strcmpiW(prop, nologoW) == 0) + WINE_FIXME("ignored %s switch\n", debugstr_w(nologoW)); else + { + WINE_FIXME("unsupported switch %s\n", debugstr_w(prop)); return FALSE; + } return TRUE; } diff -Nru wine1.7-1.7.14/programs/wscript/tests/run.js wine1.7-1.7.18/programs/wscript/tests/run.js --- wine1.7-1.7.14/programs/wscript/tests/run.js 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/programs/wscript/tests/run.js 2014-05-02 18:15:48.000000000 +0000 @@ -49,4 +49,12 @@ ok(WScript.Interactive === true, "WScript.Interactive = " + WScript.Interactive); ok(WScript.Application === WScript, "WScript.Application = " + WScript.Application); +var obj = WScript.CreateObject("Wine.Test"); +obj.ok(true, "Broken WScript.CreateObject object?"); + +try { + obj = WScript.CreateObject("nonexistent"); + ok(false, "Expected exception for CreateObject('nonexistent')"); +}catch(e) {} + winetest.reportSuccess(); diff -Nru wine1.7-1.7.14/README wine1.7-1.7.18/README --- wine1.7-1.7.14/README 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/README 2014-05-02 18:15:48.000000000 +0000 @@ -29,7 +29,7 @@ To compile and run Wine, you must have one of the following: Linux version 2.0.36 or later - FreeBSD 7.0 or later + FreeBSD 8.0 or later Solaris x86 9 or later NetBSD-current Mac OS X 10.5 or later @@ -39,7 +39,7 @@ support kernel threads may be supported in the future. FreeBSD info: - Wine will generally not work properly on versions before FreeBSD 7.0. + Wine will generally not work properly on versions before FreeBSD 8.0. See http://wiki.freebsd.org/Wine for more information. Solaris info: diff -Nru wine1.7-1.7.14/server/process.c wine1.7-1.7.18/server/process.c --- wine1.7-1.7.14/server/process.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/server/process.c 2014-05-02 18:15:48.000000000 +0000 @@ -955,7 +955,8 @@ if (!(thread = create_process( socket_fd, current, req->inherit_all ))) goto done; process = thread->process; - process->debug_children = !!(req->create_flags & DEBUG_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 ); /* connect to the window station */ diff -Nru wine1.7-1.7.14/server/queue.c wine1.7-1.7.18/server/queue.c --- wine1.7-1.7.14/server/queue.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/server/queue.c 2014-05-02 18:15:48.000000000 +0000 @@ -2860,9 +2860,9 @@ reply->send_msg_old = (reply->previous && desktop->foreground_input != queue->input); reply->send_msg_new = FALSE; - if (is_top_level_window( req->handle ) && - ((thread = get_window_thread( req->handle ))) && - (thread->queue->input->desktop == desktop)) + if (is_valid_foreground_window( req->handle ) && + (thread = get_window_thread( req->handle )) && + thread->queue->input->desktop == desktop) { set_foreground_input( desktop, thread->queue->input ); reply->send_msg_new = (desktop->foreground_input != queue->input); diff -Nru wine1.7-1.7.14/server/thread.c wine1.7-1.7.18/server/thread.c --- wine1.7-1.7.14/server/thread.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/server/thread.c 2014-05-02 18:15:48.000000000 +0000 @@ -450,10 +450,10 @@ if (!sched_getaffinity( thread->unix_tid, sizeof(set), &set )) for (i = 0; i < 8 * sizeof(mask); i++) - if (CPU_ISSET( i, &set )) mask |= 1 << i; + if (CPU_ISSET( i, &set )) mask |= (affinity_t)1 << i; } #endif - if (!mask) mask = ~0; + if (!mask) mask = ~(affinity_t)0; return mask; } diff -Nru wine1.7-1.7.14/server/user.h wine1.7-1.7.18/server/user.h --- wine1.7-1.7.14/server/user.h 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/server/user.h 2014-05-02 18:15:48.000000000 +0000 @@ -152,7 +152,7 @@ extern void destroy_window( struct window *win ); extern void destroy_thread_windows( struct thread *thread ); extern int is_child_window( user_handle_t parent, user_handle_t child ); -extern int is_top_level_window( user_handle_t window ); +extern int is_valid_foreground_window( user_handle_t window ); extern int is_window_visible( user_handle_t window ); extern int is_window_transparent( user_handle_t window ); extern int make_window_active( user_handle_t window ); diff -Nru wine1.7-1.7.14/server/window.c wine1.7-1.7.18/server/window.c --- wine1.7-1.7.14/server/window.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/server/window.c 2014-05-02 18:15:48.000000000 +0000 @@ -581,11 +581,11 @@ return 0; } -/* check whether window is a top-level window */ -int is_top_level_window( user_handle_t window ) +/* check if window can be set as foreground window */ +int is_valid_foreground_window( user_handle_t window ) { struct window *win = get_user_object( window, USER_WINDOW ); - return (win && (is_desktop_window(win) || is_desktop_window(win->parent))); + return win && (win->style & (WS_POPUP|WS_CHILD)) != WS_CHILD; } /* make a window active if possible */ diff -Nru wine1.7-1.7.14/tools/c2man.pl wine1.7-1.7.18/tools/c2man.pl --- wine1.7-1.7.14/tools/c2man.pl 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/tools/c2man.pl 2014-05-02 18:15:48.000000000 +0000 @@ -99,13 +99,14 @@ sub process_spec_file($) { my $spec_name = shift; - my ($dll_name, $dll_ext) = split(/\./, $spec_name); + (my $basename = $spec_name) =~ s/.*\///; + my ($dll_name, $dll_ext) = split(/\./, $basename); $dll_ext = "dll" if ( $dll_ext eq "spec" ); my $uc_dll_name = uc $dll_name; my $spec_details = { - NAME => $spec_name, + NAME => $basename, DLL_NAME => $dll_name, DLL_EXT => $dll_ext, NUM_EXPORTS => 0, diff -Nru wine1.7-1.7.14/tools/makedep.c wine1.7-1.7.18/tools/makedep.c --- wine1.7-1.7.14/tools/makedep.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/tools/makedep.c 2014-05-02 18:15:48.000000000 +0000 @@ -35,25 +35,51 @@ #endif #include "wine/list.h" +enum incl_type +{ + INCL_NORMAL, /* #include "foo.h" */ + INCL_SYSTEM, /* #include */ + INCL_IMPORT, /* idl import "foo.idl" */ + INCL_CPP_QUOTE, /* idl cpp_quote("#include \"foo.h\"") */ + INCL_CPP_QUOTE_SYSTEM /* idl cpp_quote("#include ") */ +}; + +struct dependency +{ + int line; /* source line where this header is included */ + enum incl_type type; /* type of include */ + char *name; /* header name */ +}; + +struct file +{ + struct list entry; + char *name; /* full file name relative to cwd */ + void *args; /* custom arguments for makefile rule */ + unsigned int flags; /* flags (see below) */ + unsigned int deps_count; /* files in use */ + unsigned int deps_size; /* total allocated size */ + struct dependency *deps; /* all header dependencies */ +}; + struct incl_file { struct list entry; + struct file *file; char *name; char *filename; char *sourcename; /* source file name for generated headers */ - void *args; /* custom arguments for makefile rule */ struct incl_file *included_by; /* file that included this one */ int included_line; /* line where this file was included */ - unsigned int flags; /* flags (see below) */ + int system; /* is it a system include (#include ) */ struct incl_file *owner; unsigned int files_count; /* files in use */ unsigned int files_size; /* total allocated size */ struct incl_file **files; }; -#define FLAG_SYSTEM 0x000001 /* is it a system include (#include ) */ -#define FLAG_GENERATED 0x000002 /* generated file */ -#define FLAG_INSTALL 0x000004 /* file to install */ +#define FLAG_GENERATED 0x000001 /* generated file */ +#define FLAG_INSTALL 0x000002 /* file to install */ #define FLAG_IDL_PROXY 0x000100 /* generates a proxy (_p.c) file */ #define FLAG_IDL_CLIENT 0x000200 /* generates a client (_c.c) file */ #define FLAG_IDL_SERVER 0x000400 /* generates a server (_s.c) file */ @@ -82,8 +108,9 @@ { FLAG_IDL_HEADER, ".h" } }; -static struct list sources = LIST_INIT(sources); -static struct list includes = LIST_INIT(includes); +#define HASH_SIZE 137 + +static struct list files[HASH_SIZE]; struct strarray { @@ -94,28 +121,61 @@ static const struct strarray empty_strarray; -static struct strarray include_args; -static struct strarray define_args; -static struct strarray appmode; -static struct strarray dllflags; -static struct strarray imports; -static struct strarray make_vars; +/* variables common to all makefiles */ +static struct strarray linguas; +static struct strarray dll_flags; +static struct strarray target_flags; +static struct strarray msvcrt_flags; +static struct strarray extra_cflags; +static struct strarray cpp_flags; +static struct strarray unwind_flags; +static struct strarray libs; static struct strarray cmdline_vars; -static struct strarray testlist_files; - -static const char *base_dir; -static const char *src_dir; -static const char *top_src_dir; -static const char *top_obj_dir; -static const char *parent_dir; +static const char *root_src_dir; static const char *tools_dir; static const char *tools_ext; +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; + +struct makefile +{ + struct strarray vars; + struct strarray include_args; + struct strarray define_args; + struct strarray appmode; + struct strarray imports; + struct strarray delayimports; + struct strarray extradllflags; + struct list sources; + struct list includes; + const char *base_dir; + const char *src_dir; + const char *obj_dir; + const char *top_src_dir; + const char *top_obj_dir; + const char *parent_dir; + const char *module; + const char *testdll; + const char *staticlib; + const char *importlib; + int use_msvcrt; + int is_win16; +}; + +static struct makefile *top_makefile; + static const char *makefile_name = "Makefile"; static const char *Separator = "### Dependencies"; static const char *input_file_name; static const char *output_file_name; static const char *temp_file_name; -static int use_msvcrt; static int relative_dir_mode; static int input_line; static int output_column; @@ -312,14 +372,59 @@ /******************************************************************* + * strarray_exists + */ +static int strarray_exists( struct strarray *array, const char *str ) +{ + unsigned int i; + + for (i = 0; i < array->count; i++) if (!strcmp( array->str[i], str )) return 1; + return 0; +} + + +/******************************************************************* * strarray_add_uniq */ static void strarray_add_uniq( struct strarray *array, const char *str ) { + if (!strarray_exists( array, str )) strarray_add( array, str ); +} + + +/******************************************************************* + * strarray_get_value + * + * Find a value in a name/value pair string array. + */ +static char *strarray_get_value( const struct strarray *array, const char *name ) +{ unsigned int i; - for (i = 0; i < array->count; i++) if (!strcmp( array->str[i], str )) return; - strarray_add( array, str ); + for (i = 0; i < array->count; i += 2) + if (!strcmp( array->str[i], name )) return xstrdup( array->str[i + 1] ); + return NULL; +} + + +/******************************************************************* + * strarray_set_value + * + * Define a value in a name/value pair string array. + */ +static void strarray_set_value( struct strarray *array, const char *name, const char *value ) +{ + unsigned int i; + + /* redefining a variable replaces the previous value */ + for (i = 0; i < array->count; i += 2) + { + if (strcmp( array->str[i], name )) continue; + array->str[i + 1] = value; + return; + } + strarray_add( array, name ); + strarray_add( array, value ); } @@ -454,64 +559,89 @@ /******************************************************************* + * concat_paths + */ +static char *concat_paths( const char *base, const char *path ) +{ + if (!base || !base[0]) return xstrdup( path && path[0] ? path : "." ); + if (!path || !path[0]) return xstrdup( base ); + if (path[0] == '/') return xstrdup( path ); + return strmake( "%s/%s", base, path ); +} + + +/******************************************************************* * base_dir_path */ -static char *base_dir_path( const char *path ) +static char *base_dir_path( struct makefile *make, const char *path ) +{ + return concat_paths( make->base_dir, path ); +} + + +/******************************************************************* + * obj_dir_path + */ +static char *obj_dir_path( struct makefile *make, const char *path ) { - if (base_dir && path[0] != '/') return strmake( "%s/%s", base_dir, path ); - return xstrdup( path ); + return concat_paths( make->obj_dir, path ); } /******************************************************************* * src_dir_path */ -static char *src_dir_path( const char *path ) +static char *src_dir_path( struct makefile *make, const char *path ) { - if (src_dir) return strmake( "%s/%s", src_dir, path ); - return xstrdup( path ); + if (make->src_dir) return concat_paths( make->src_dir, path ); + return obj_dir_path( make, path ); } /******************************************************************* * top_obj_dir_path */ -static char *top_obj_dir_path( const char *path ) +static char *top_obj_dir_path( struct makefile *make, const char *path ) { - if (top_obj_dir) return strmake( "%s/%s", top_obj_dir, path ); - return xstrdup( path ); + return concat_paths( make->top_obj_dir, path ); } /******************************************************************* * top_dir_path */ -static char *top_dir_path( const char *path ) +static char *top_dir_path( struct makefile *make, const char *path ) { - if (top_src_dir) return strmake( "%s/%s", top_src_dir, path ); - return top_obj_dir_path( path ); + if (make->top_src_dir) return concat_paths( make->top_src_dir, path ); + return top_obj_dir_path( make, path ); +} + + +/******************************************************************* + * root_dir_path + */ +static char *root_dir_path( const char *path ) +{ + return concat_paths( root_src_dir, path ); } /******************************************************************* * tools_dir_path */ -static char *tools_dir_path( const char *path ) +static char *tools_dir_path( struct makefile *make, const char *path ) { - if (tools_dir) return strmake( "%s/tools/%s", tools_dir, path ); - if (top_obj_dir) return strmake( "%s/tools/%s", top_obj_dir, path ); - return strmake( "tools/%s", 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 )); } /******************************************************************* * tools_path */ -static char *tools_path( const char *name ) +static char *tools_path( struct makefile *make, const char *name ) { - if (tools_dir) return strmake( "%s/tools/%s/%s%s", tools_dir, name, name, tools_ext ); - if (top_obj_dir) return strmake( "%s/tools/%s/%s%s", top_obj_dir, name, name, tools_ext ); - return strmake( "tools/%s/%s%s", name, name, tools_ext ); + return strmake( "%s/%s%s", tools_dir_path( make, name ), name, tools_ext ); } @@ -559,47 +689,36 @@ } } + /******************************************************************* - * find_src_file + * hash_filename */ -static struct incl_file *find_src_file( const char *name ) +static unsigned int hash_filename( const char *name ) { - struct incl_file *file; - - LIST_FOR_EACH_ENTRY( file, &sources, struct incl_file, entry ) - if (!strcmp( name, file->name )) return file; - return NULL; + unsigned int ret = 0; + while (*name) ret = (ret << 7) + (ret << 3) + *name++; + return ret % HASH_SIZE; } + /******************************************************************* - * find_include_file + * add_file */ -static struct incl_file *find_include_file( const char *name ) +static struct file *add_file( const char *name ) { - struct incl_file *file; - - LIST_FOR_EACH_ENTRY( file, &includes, struct incl_file, entry ) - if (!strcmp( name, file->name )) return file; - return NULL; + struct file *file = xmalloc( sizeof(*file) ); + memset( file, 0, sizeof(*file) ); + file->name = xstrdup( name ); + list_add_tail( &files[hash_filename( name )], &file->entry ); + return file; } + /******************************************************************* - * add_include - * - * Add an include file if it doesn't already exists. + * add_dependency */ -static struct incl_file *add_include( struct incl_file *parent, const char *name, int system ) +static void add_dependency( struct file *file, const char *name, enum incl_type type ) { - struct incl_file *include; - char *ext; - - if (parent->files_count >= parent->files_size) - { - parent->files_size *= 2; - if (parent->files_size < 16) parent->files_size = 16; - parent->files = xrealloc( parent->files, parent->files_size * sizeof(*parent->files) ); - } - /* enforce some rules for the Wine tree */ if (!memcmp( name, "../", 3 )) @@ -607,240 +726,110 @@ if (!strcmp( name, "config.h" )) { - if ((ext = strrchr( parent->filename, '.' )) && !strcmp( ext, ".h" )) + if (strendswith( file->name, ".h" )) fatal_error( "config.h must not be included by a header file\n" ); - if (parent->files_count) + if (file->deps_count) fatal_error( "config.h must be included before anything else\n" ); } else if (!strcmp( name, "wine/port.h" )) { - if ((ext = strrchr( parent->filename, '.' )) && !strcmp( ext, ".h" )) + if (strendswith( file->name, ".h" )) fatal_error( "wine/port.h must not be included by a header file\n" ); - if (!parent->files_count) fatal_error( "config.h must be included before wine/port.h\n" ); - if (parent->files_count > 1) + if (!file->deps_count) fatal_error( "config.h must be included before wine/port.h\n" ); + if (file->deps_count > 1) fatal_error( "wine/port.h must be included before everything except config.h\n" ); - if (strcmp( parent->files[0]->name, "config.h" )) + if (strcmp( file->deps[0].name, "config.h" )) fatal_error( "config.h must be included before wine/port.h\n" ); } - LIST_FOR_EACH_ENTRY( include, &includes, struct incl_file, entry ) - if (!strcmp( name, include->name )) goto found; - - include = xmalloc( sizeof(*include) ); - memset( include, 0, sizeof(*include) ); - include->name = xstrdup(name); - include->included_by = parent; - include->included_line = input_line; - if (system) include->flags |= FLAG_SYSTEM; - list_add_tail( &includes, &include->entry ); -found: - parent->files[parent->files_count++] = include; - return include; + if (file->deps_count >= file->deps_size) + { + file->deps_size *= 2; + if (file->deps_size < 16) file->deps_size = 16; + file->deps = xrealloc( file->deps, file->deps_size * sizeof(*file->deps) ); + } + file->deps[file->deps_count].line = input_line; + file->deps[file->deps_count].type = type; + file->deps[file->deps_count].name = xstrdup( name ); + file->deps_count++; } /******************************************************************* - * add_generated_source - * - * Add a generated source file to the list. + * find_src_file */ -static struct incl_file *add_generated_source( const char *name, const char *filename ) +static struct incl_file *find_src_file( struct makefile *make, const char *name ) { struct incl_file *file; - if ((file = find_src_file( name ))) return file; /* we already have it */ - file = xmalloc( sizeof(*file) ); - memset( file, 0, sizeof(*file) ); - file->name = xstrdup( name ); - file->filename = xstrdup( filename ? filename : name ); - file->flags = FLAG_GENERATED; - list_add_tail( &sources, &file->entry ); - return file; + LIST_FOR_EACH_ENTRY( file, &make->sources, struct incl_file, entry ) + if (!strcmp( name, file->name )) return file; + return NULL; } - /******************************************************************* - * open_file + * find_include_file */ -static FILE *open_file( const char *path ) +static struct incl_file *find_include_file( struct makefile *make, const char *name ) { - return fopen( base_dir_path( path ), "r" ); + struct incl_file *file; + + LIST_FOR_EACH_ENTRY( file, &make->includes, struct incl_file, entry ) + if (!strcmp( name, file->name )) return file; + return NULL; } /******************************************************************* - * open_src_file + * add_include + * + * Add an include file if it doesn't already exists. */ -static FILE *open_src_file( struct incl_file *pFile ) +static struct incl_file *add_include( struct makefile *make, struct incl_file *parent, + const char *name, int line, int system ) { - FILE *file; - - /* try in source dir */ - pFile->filename = src_dir_path( pFile->name ); - file = open_file( pFile->filename ); + struct incl_file *include; - /* now try parent dir */ - if (!file && parent_dir) + if (parent->files_count >= parent->files_size) { - pFile->filename = src_dir_path( strmake( "%s/%s", parent_dir, pFile->name )); - file = open_file( pFile->filename ); + parent->files_size *= 2; + if (parent->files_size < 16) parent->files_size = 16; + parent->files = xrealloc( parent->files, parent->files_size * sizeof(*parent->files) ); } - if (!file) fatal_perror( "open %s", pFile->name ); - return file; + + LIST_FOR_EACH_ENTRY( include, &make->includes, struct incl_file, entry ) + if (!strcmp( name, include->name )) goto found; + + include = xmalloc( sizeof(*include) ); + memset( include, 0, sizeof(*include) ); + include->name = xstrdup(name); + include->included_by = parent; + include->included_line = line; + include->system = system; + list_add_tail( &make->includes, &include->entry ); +found: + parent->files[parent->files_count++] = include; + return include; } /******************************************************************* - * open_include_file + * add_generated_source + * + * Add a generated source file to the list. */ -static FILE *open_include_file( struct incl_file *pFile ) +static struct incl_file *add_generated_source( struct makefile *make, + const char *name, const char *filename ) { - FILE *file = NULL; - char *filename, *p; - unsigned int i, len; - - errno = ENOENT; - - /* check for generated bison header */ - - if (strendswith( pFile->name, ".tab.h" )) - { - filename = src_dir_path( replace_extension( pFile->name, ".tab.h", ".y" )); - if ((file = open_file( filename ))) - { - pFile->sourcename = filename; - pFile->filename = xstrdup( pFile->name ); - /* don't bother to parse it */ - fclose( file ); - return NULL; - } - free( filename ); - } - - /* check for corresponding idl file in source dir */ - - if (strendswith( pFile->name, ".h" )) - { - filename = src_dir_path( replace_extension( pFile->name, ".h", ".idl" )); - if ((file = open_file( filename ))) - { - pFile->sourcename = filename; - pFile->filename = xstrdup( pFile->name ); - return file; - } - free( filename ); - } - - /* now try in source dir */ - filename = src_dir_path( pFile->name ); - if ((file = open_file( filename ))) goto found; - free( filename ); - - /* now try in parent source dir */ - if (parent_dir) - { - filename = src_dir_path( strmake( "%s/%s", parent_dir, pFile->name )); - if ((file = open_file( filename ))) goto found; - free( filename ); - } - - /* check for corresponding idl file in global includes */ - - if (strendswith( pFile->name, ".h" )) - { - filename = top_dir_path( strmake( "include/%s", replace_extension( pFile->name, ".h", ".idl" ))); - if ((file = open_file( filename ))) - { - pFile->sourcename = filename; - pFile->filename = top_obj_dir_path( strmake( "include/%s", pFile->name )); - return file; - } - free( filename ); - } - - /* check for corresponding .in file in global includes (for config.h.in) */ - - if (strendswith( pFile->name, ".h" )) - { - filename = top_dir_path( strmake( "include/%s", replace_extension( pFile->name, ".h", ".h.in" ))); - if ((file = open_file( filename ))) - { - pFile->sourcename = filename; - pFile->filename = top_obj_dir_path( strmake( "include/%s", pFile->name )); - return file; - } - free( filename ); - } - - /* check for corresponding .x file in global includes */ - - if (strendswith( pFile->name, "tmpl.h" )) - { - filename = top_dir_path( strmake( "include/%s", replace_extension( pFile->name, ".h", ".x" ))); - if ((file = open_file( filename ))) - { - pFile->sourcename = filename; - pFile->filename = top_obj_dir_path( strmake( "include/%s", pFile->name )); - return file; - } - free( filename ); - } - - /* check in global includes source dir */ - - filename = top_dir_path( strmake( "include/%s", pFile->name )); - if ((file = open_file( filename ))) goto found; - - /* check in global msvcrt includes */ - if (use_msvcrt) - { - filename = top_dir_path( strmake( "include/msvcrt/%s", pFile->name )); - if ((file = open_file( filename ))) goto found; - } - - /* now search in include paths */ - for (i = 0; i < include_args.count; i++) - { - const char *dir = include_args.str[i] + 2; /* skip -I */ - if (*dir == '/') - { - /* ignore absolute paths that don't point into the source dir */ - if (!top_src_dir) continue; - len = strlen( top_src_dir ); - if (strncmp( dir, top_src_dir, len )) continue; - if (dir[len] && dir[len] != '/') continue; - } - filename = strmake( "%s/%s", dir, pFile->name ); - if ((file = open_file( filename ))) goto found; - free( filename ); - } - if (pFile->flags & FLAG_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( filename ))) goto found; - free( filename ); - } - - fprintf( stderr, "%s:%d: error: ", pFile->included_by->filename, pFile->included_line ); - perror( pFile->name ); - pFile = pFile->included_by; - while (pFile && pFile->included_by) - { - const char *parent = pFile->included_by->sourcename; - if (!parent) parent = pFile->included_by->name; - fprintf( stderr, "%s:%d: note: %s was first included here\n", - parent, pFile->included_line, pFile->name ); - pFile = pFile->included_by; - } - exit(1); + struct incl_file *file; -found: - pFile->filename = filename; + if ((file = find_src_file( make, name ))) return file; /* we already have it */ + file = xmalloc( sizeof(*file) ); + memset( file, 0, sizeof(*file) ); + file->file = add_file( name ); + file->name = xstrdup( name ); + file->filename = obj_dir_path( make, filename ? filename : name ); + file->file->flags = FLAG_GENERATED; + list_add_tail( &make->sources, &file->entry ); return file; } @@ -848,7 +837,7 @@ /******************************************************************* * parse_include_directive */ -static void parse_include_directive( struct incl_file *source, char *str ) +static void parse_include_directive( struct file *source, char *str ) { char quote, *include, *p = str; @@ -860,14 +849,14 @@ while (*p && (*p != quote)) p++; if (!*p) fatal_error( "malformed include directive '%s'\n", str ); *p = 0; - add_include( source, include, (quote == '>') ); + add_dependency( source, include, (quote == '>') ? INCL_SYSTEM : INCL_NORMAL ); } /******************************************************************* * parse_pragma_directive */ -static void parse_pragma_directive( struct incl_file *source, char *str ) +static void parse_pragma_directive( struct file *source, char *str ) { char *flag, *p = str; @@ -880,7 +869,7 @@ { if (!strcmp( flag, "depend" )) { - while ((p = strtok( NULL, " \t" ))) add_include( source, p, 0 ); + while ((p = strtok( NULL, " \t" ))) add_dependency( source, p, INCL_NORMAL ); return; } else if (!strcmp( flag, "install" )) source->flags |= FLAG_INSTALL; @@ -924,7 +913,7 @@ /******************************************************************* * parse_cpp_directive */ -static void parse_cpp_directive( struct incl_file *source, char *str ) +static void parse_cpp_directive( struct file *source, char *str ) { while (*str && isspace(*str)) str++; if (*str++ != '#') return; @@ -941,21 +930,12 @@ /******************************************************************* * parse_idl_file - * - * If for_h_file is non-zero, it means we are not interested in the idl file - * itself, but only in the contents of the .h file that will be generated from it. */ -static void parse_idl_file( struct incl_file *pFile, FILE *file, int for_h_file ) +static void parse_idl_file( struct file *source, FILE *file ) { char *buffer, *include; input_line = 0; - if (for_h_file) - { - /* generated .h file always includes these */ - add_include( pFile, "rpc.h", 1 ); - add_include( pFile, "rpcndr.h", 1 ); - } while ((buffer = get_line( file ))) { @@ -972,14 +952,13 @@ while (*p && (*p != '"')) p++; if (!*p) fatal_error( "malformed import directive\n" ); *p = 0; - if (for_h_file && strendswith( include, ".idl" )) strcpy( p - 4, ".h" ); - add_include( pFile, include, 0 ); + add_dependency( source, include, INCL_IMPORT ); continue; } - if (for_h_file) /* only check for #include inside cpp_quote */ + /* check for #include inside cpp_quote */ + if (!strncmp( p, "cpp_quote", 9 )) { - if (strncmp( p, "cpp_quote", 9 )) continue; p += 9; while (*p && isspace(*p)) p++; if (*p++ != '(') continue; @@ -1006,25 +985,25 @@ fatal_error( "malformed #include directive inside cpp_quote\n" ); if (quote == '"') p--; /* remove backslash */ *p = 0; - add_include( pFile, include, (quote == '>') ); + add_dependency( source, include, (quote == '>') ? INCL_CPP_QUOTE_SYSTEM : INCL_CPP_QUOTE ); continue; } - parse_cpp_directive( pFile, p ); + parse_cpp_directive( source, p ); } } /******************************************************************* * parse_c_file */ -static void parse_c_file( struct incl_file *pFile, FILE *file ) +static void parse_c_file( struct file *source, FILE *file ) { char *buffer; input_line = 0; while ((buffer = get_line( file ))) { - parse_cpp_directive( pFile, buffer ); + parse_cpp_directive( source, buffer ); } } @@ -1032,7 +1011,7 @@ /******************************************************************* * parse_rc_file */ -static void parse_rc_file( struct incl_file *pFile, FILE *file ) +static void parse_rc_file( struct file *source, FILE *file ) { char *buffer, *include; @@ -1064,11 +1043,11 @@ if (!*p) fatal_error( "malformed makedep comment\n" ); *p = 0; - add_include( pFile, include, (quote == '>') ); + add_dependency( source, include, (quote == '>') ? INCL_SYSTEM : INCL_NORMAL ); continue; } - parse_cpp_directive( pFile, buffer ); + parse_cpp_directive( source, buffer ); } } @@ -1076,14 +1055,14 @@ /******************************************************************* * parse_in_file */ -static void parse_in_file( struct incl_file *source, FILE *file ) +static void parse_in_file( struct file *source, FILE *file ) { char *p, *buffer; /* make sure it gets rebuilt when the version changes */ - add_include( source, "config.h", 1 ); + add_dependency( source, "config.h", INCL_SYSTEM ); - if (!strendswith( source->filename, ".man.in" )) return; /* not a man page */ + if (!strendswith( source->name, ".man.in" )) return; /* not a man page */ input_line = 0; while ((buffer = get_line( file ))) @@ -1101,7 +1080,7 @@ /******************************************************************* * parse_sfd_file */ -static void parse_sfd_file( struct incl_file *source, FILE *file ) +static void parse_sfd_file( struct file *source, FILE *file ) { char *p, *eol, *buffer; @@ -1137,41 +1116,329 @@ /******************************************************************* + * load_file + */ +static struct file *load_file( const char *name ) +{ + struct file *file; + FILE *f; + unsigned int hash = hash_filename( name ); + + LIST_FOR_EACH_ENTRY( file, &files[hash], struct file, entry ) + if (!strcmp( name, file->name )) return file; + + if (!(f = fopen( name, "r" ))) return NULL; + + file = add_file( name ); + 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 ); + + fclose( f ); + input_file_name = NULL; + + return file; +} + + +/******************************************************************* + * open_file + */ +static struct file *open_file( struct makefile *make, const char *path, char **filename ) +{ + struct file *ret = load_file( base_dir_path( make, path )); + + if (ret) *filename = xstrdup( path ); + return ret; +} + + +/******************************************************************* + * open_local_file + * + * Open a file in the source directory of the makefile. + */ +static struct file *open_local_file( 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 ); + + /* if not found, try parent dir */ + if (!ret && make->parent_dir) + { + free( src_path ); + path = strmake( "%s/%s", make->parent_dir, path ); + src_path = root_dir_path( base_dir_path( make, path )); + ret = load_file( src_path ); + } + + if (ret) *filename = src_dir_path( make, path ); + free( src_path ); + return ret; +} + + +/******************************************************************* + * open_global_file + * + * Open a file in the top-level source directory. + */ +static struct file *open_global_file( struct makefile *make, const char *path, char **filename ) +{ + char *src_path = root_dir_path( path ); + struct file *ret = load_file( src_path ); + + if (ret) *filename = top_dir_path( make, path ); + free( src_path ); + return ret; +} + + +/******************************************************************* + * open_global_header + * + * Open a file in the global include source directory. + */ +static struct file *open_global_header( struct makefile *make, const char *path, char **filename ) +{ + return open_global_file( make, strmake( "include/%s", path ), filename ); +} + + +/******************************************************************* + * open_src_file + */ +static struct file *open_src_file( struct makefile *make, struct incl_file *pFile ) +{ + struct file *file = open_local_file( make, pFile->name, &pFile->filename ); + + if (!file) fatal_perror( "open %s", pFile->name ); + return file; +} + + +/******************************************************************* + * open_include_file + */ +static struct file *open_include_file( struct makefile *make, struct incl_file *pFile ) +{ + struct file *file = NULL; + char *filename, *p; + unsigned int i, len; + + errno = ENOENT; + + /* check for generated bison header */ + + if (strendswith( pFile->name, ".tab.h" ) && + (file = open_local_file( make, replace_extension( pFile->name, ".tab.h", ".y" ), &filename ))) + { + pFile->sourcename = filename; + pFile->filename = obj_dir_path( make, pFile->name ); + return file; + } + + /* check for corresponding idl file in source dir */ + + if (strendswith( pFile->name, ".h" ) && + (file = open_local_file( make, replace_extension( pFile->name, ".h", ".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; + + /* check for corresponding idl file in global includes */ + + if (strendswith( pFile->name, ".h" ) && + (file = open_global_header( make, replace_extension( pFile->name, ".h", ".idl" ), &filename ))) + { + pFile->sourcename = filename; + pFile->filename = top_obj_dir_path( make, strmake( "include/%s", pFile->name )); + return file; + } + + /* check for corresponding .in file in global includes (for config.h.in) */ + + if (strendswith( pFile->name, ".h" ) && + (file = open_global_header( make, replace_extension( pFile->name, ".h", ".h.in" ), &filename ))) + { + pFile->sourcename = filename; + pFile->filename = top_obj_dir_path( make, strmake( "include/%s", pFile->name )); + return file; + } + + /* check for corresponding .x file in global includes */ + + if (strendswith( pFile->name, "tmpl.h" ) && + (file = open_global_header( make, replace_extension( pFile->name, ".h", ".x" ), &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; + + /* check in global msvcrt includes */ + if (make->use_msvcrt && + (file = open_global_header( make, strmake( "msvcrt/%s", pFile->name ), &pFile->filename ))) + return file; + + /* now search in include paths */ + for (i = 0; i < make->include_args.count; i++) + { + const char *dir = make->include_args.str[i] + 2; /* skip -I */ + const char *prefix = make->top_src_dir ? make->top_src_dir : make->top_obj_dir; + + if (prefix) + { + len = strlen( prefix ); + if (!strncmp( dir, prefix, len ) && (!dir[len] || dir[len] == '/')) + { + while (dir[len] == '/') len++; + file = open_global_file( make, concat_paths( dir + len, pFile->name ), &pFile->filename ); + if (file) return file; + } + if (make->top_src_dir) continue; /* ignore paths that don't point to the top source dir */ + } + if (*dir != '/') + { + if ((file = open_file( make, concat_paths( dir, pFile->name ), &pFile->filename ))) + return file; + } + } + if (pFile->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 ); + } + + fprintf( stderr, "%s:%d: error: ", pFile->included_by->file->name, pFile->included_line ); + perror( pFile->name ); + pFile = pFile->included_by; + while (pFile && pFile->included_by) + { + const char *parent = pFile->included_by->sourcename; + if (!parent) parent = pFile->included_by->file->name; + fprintf( stderr, "%s:%d: note: %s was first included here\n", + parent, pFile->included_line, pFile->name ); + pFile = pFile->included_by; + } + exit(1); +} + + +/******************************************************************* + * add_all_includes + */ +static void add_all_includes( struct makefile *make, struct incl_file *parent, struct file *file ) +{ + unsigned int i; + + parent->files_count = 0; + parent->files_size = file->deps_count; + parent->files = xmalloc( parent->files_size * sizeof(*parent->files) ); + for (i = 0; i < file->deps_count; i++) + { + switch (file->deps[i].type) + { + case INCL_NORMAL: + case INCL_IMPORT: + add_include( make, parent, file->deps[i].name, file->deps[i].line, 0 ); + break; + case INCL_SYSTEM: + add_include( make, parent, file->deps[i].name, file->deps[i].line, 1 ); + break; + case INCL_CPP_QUOTE: + case INCL_CPP_QUOTE_SYSTEM: + break; + } + } +} + + +/******************************************************************* * parse_file */ -static void parse_file( struct incl_file *source, int src ) +static void parse_file( struct makefile *make, struct incl_file *source, int src ) { - FILE *file; + struct file *file; /* don't try to open certain types of files */ if (strendswith( source->name, ".tlb" )) { - source->filename = xstrdup( source->name ); + source->filename = obj_dir_path( make, source->name ); return; } - file = src ? open_src_file( source ) : open_include_file( source ); + file = src ? open_src_file( make, source ) : open_include_file( make, source ); if (!file) return; - input_file_name = source->filename; - if (source->sourcename && strendswith( source->sourcename, ".idl" )) - parse_idl_file( source, file, 1 ); - else if (strendswith( source->filename, ".idl" )) - parse_idl_file( source, file, 0 ); - else if (strendswith( source->filename, ".c" ) || - strendswith( source->filename, ".m" ) || - strendswith( source->filename, ".h" ) || - strendswith( source->filename, ".l" ) || - strendswith( source->filename, ".y" )) - parse_c_file( source, file ); - else if (strendswith( source->filename, ".rc" )) - parse_rc_file( source, file ); - else if (strendswith( source->filename, ".in" )) - parse_in_file( source, file ); - else if (strendswith( source->filename, ".sfd" )) - parse_sfd_file( source, file ); - fclose(file); - input_file_name = NULL; + source->file = file; + source->files_count = 0; + source->files_size = file->deps_count; + source->files = xmalloc( source->files_size * sizeof(*source->files) ); + + if (source->sourcename) + { + if (strendswith( source->sourcename, ".idl" )) + { + unsigned int i; + + /* generated .h file always includes these */ + add_include( make, source, "rpc.h", 0, 1 ); + add_include( make, source, "rpcndr.h", 0, 1 ); + for (i = 0; i < file->deps_count; i++) + { + switch (file->deps[i].type) + { + 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 ); + else + add_include( make, source, file->deps[i].name, file->deps[i].line, 0 ); + break; + case INCL_CPP_QUOTE: + add_include( make, source, file->deps[i].name, file->deps[i].line, 0 ); + break; + case INCL_CPP_QUOTE_SYSTEM: + add_include( make, source, file->deps[i].name, file->deps[i].line, 1 ); + break; + case INCL_NORMAL: + case INCL_SYSTEM: + break; + } + } + return; + } + if (strendswith( source->sourcename, ".y" )) + return; /* generated .tab.h doesn't include anything */ + } + + add_all_includes( make, source, file ); } @@ -1180,16 +1447,16 @@ * * Add a source file to the list. */ -static struct incl_file *add_src_file( const char *name ) +static struct incl_file *add_src_file( struct makefile *make, const char *name ) { struct incl_file *file; - if ((file = find_src_file( name ))) return file; /* we already have it */ + if ((file = find_src_file( make, name ))) return file; /* we already have it */ file = xmalloc( sizeof(*file) ); memset( file, 0, sizeof(*file) ); file->name = xstrdup(name); - list_add_tail( &sources, &file->entry ); - parse_file( file, 1 ); + list_add_tail( &make->sources, &file->entry ); + parse_file( make, file, 1 ); return file; } @@ -1197,17 +1464,13 @@ /******************************************************************* * get_make_variable */ -static char *get_make_variable( const char *name ) +static char *get_make_variable( struct makefile *make, const char *name ) { - unsigned int i; + char *ret; - for (i = 0; i < cmdline_vars.count; i += 2) - if (!strcmp( cmdline_vars.str[i], name )) - return xstrdup( cmdline_vars.str[i + 1] ); - - for (i = 0; i < make_vars.count; i += 2) - if (!strcmp( make_vars.str[i], name )) - return xstrdup( make_vars.str[i + 1] ); + if ((ret = strarray_get_value( &cmdline_vars, name ))) return ret; + if ((ret = strarray_get_value( &make->vars, name ))) return ret; + if (top_makefile && (ret = strarray_get_value( &top_makefile->vars, name ))) return ret; return NULL; } @@ -1215,11 +1478,11 @@ /******************************************************************* * get_expanded_make_variable */ -static char *get_expanded_make_variable( const char *name ) +static char *get_expanded_make_variable( struct makefile *make, const char *name ) { char *p, *end, *var, *expand, *tmp; - expand = get_make_variable( name ); + expand = get_make_variable( make, name ); if (!expand) return NULL; p = expand; @@ -1230,7 +1493,7 @@ if (!(end = strchr( p + 2, ')' ))) fatal_error( "syntax error in '%s'\n", expand ); *end++ = 0; if (strchr( p + 2, ':' )) fatal_error( "pattern replacement not supported for '%s'\n", p + 2 ); - var = get_make_variable( p + 2 ); + var = get_make_variable( make, p + 2 ); tmp = replace_substr( expand, p, end - p, var ? var : "" ); free( var ); } @@ -1264,12 +1527,12 @@ /******************************************************************* * get_expanded_make_var_array */ -static struct strarray get_expanded_make_var_array( const char *name ) +static struct strarray get_expanded_make_var_array( struct makefile *make, const char *name ) { struct strarray ret = empty_strarray; char *value, *token; - if ((value = get_expanded_make_variable( name ))) + if ((value = get_expanded_make_variable( make, name ))) for (token = strtok( value, " \t" ); token; token = strtok( NULL, " \t" )) strarray_add( &ret, token ); return ret; @@ -1281,7 +1544,6 @@ */ static int set_make_variable( struct strarray *array, const char *assignment ) { - unsigned int i; char *p, *name; p = name = xstrdup( assignment ); @@ -1296,15 +1558,7 @@ *p++ = 0; while (isspace(*p)) p++; - /* redefining a variable replaces the previous value */ - for (i = 0; i < array->count; i += 2) - { - if (strcmp( array->str[i], name )) continue; - array->str[i + 1] = p; - return 1; - } - strarray_add( array, name ); - strarray_add( array, p ); + strarray_set_value( array, name, p ); return 1; } @@ -1312,81 +1566,92 @@ /******************************************************************* * parse_makefile */ -static void parse_makefile(void) +static struct makefile *parse_makefile( const char *path, const char *separator ) { char *buffer; FILE *file; + struct makefile *make = xmalloc( sizeof(*make) ); - input_file_name = base_dir_path( makefile_name ); - if (!(file = fopen( input_file_name, "r" ))) + memset( make, 0, sizeof(*make) ); + if (path) { - fatal_perror( "open" ); - exit( 1 ); + make->top_obj_dir = get_relative_path( path, "" ); + make->base_dir = path; + 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; while ((buffer = get_line( file ))) { - if (Separator && !strncmp( buffer, Separator, strlen(Separator) )) break; + if (separator && !strncmp( buffer, separator, strlen(separator) )) break; if (*buffer == '\t') continue; /* command */ while (isspace( *buffer )) buffer++; if (*buffer == '#') continue; /* comment */ - set_make_variable( &make_vars, buffer ); + set_make_variable( &make->vars, buffer ); } fclose( file ); input_file_name = NULL; + return make; } /******************************************************************* * add_generated_sources */ -static void add_generated_sources(void) +static void add_generated_sources( struct makefile *make ) { struct incl_file *source, *next, *file; - LIST_FOR_EACH_ENTRY_SAFE( source, next, &sources, struct incl_file, entry ) + LIST_FOR_EACH_ENTRY_SAFE( source, next, &make->sources, struct incl_file, entry ) { - if (source->flags & FLAG_IDL_CLIENT) + if (source->file->flags & FLAG_IDL_CLIENT) { - file = add_generated_source( replace_extension( source->name, ".idl", "_c.c" ), NULL ); - add_include( file, replace_extension( source->name, ".idl", ".h" ), 0 ); + file = add_generated_source( make, replace_extension( source->name, ".idl", "_c.c" ), NULL ); + add_dependency( file->file, replace_extension( source->name, ".idl", ".h" ), INCL_NORMAL ); + add_all_includes( make, file, file->file ); } - if (source->flags & FLAG_IDL_SERVER) + if (source->file->flags & FLAG_IDL_SERVER) { - file = add_generated_source( replace_extension( source->name, ".idl", "_s.c" ), NULL ); - add_include( file, "wine/exception.h", 0 ); - add_include( file, replace_extension( source->name, ".idl", ".h" ), 0 ); + file = add_generated_source( make, replace_extension( source->name, ".idl", "_s.c" ), NULL ); + add_dependency( file->file, "wine/exception.h", INCL_NORMAL ); + add_dependency( file->file, replace_extension( source->name, ".idl", ".h" ), INCL_NORMAL ); + add_all_includes( make, file, file->file ); } - if (source->flags & FLAG_IDL_IDENT) + if (source->file->flags & FLAG_IDL_IDENT) { - file = add_generated_source( replace_extension( source->name, ".idl", "_i.c" ), NULL ); - add_include( file, "rpc.h", 0 ); - add_include( file, "rpcndr.h", 0 ); - add_include( file, "guiddef.h", 0 ); + file = add_generated_source( make, replace_extension( source->name, ".idl", "_i.c" ), NULL ); + add_dependency( file->file, "rpc.h", INCL_NORMAL ); + add_dependency( file->file, "rpcndr.h", INCL_NORMAL ); + add_dependency( file->file, "guiddef.h", INCL_NORMAL ); + add_all_includes( make, file, file->file ); } - if (source->flags & FLAG_IDL_PROXY) + if (source->file->flags & FLAG_IDL_PROXY) { - file = add_generated_source( "dlldata.o", "dlldata.c" ); - add_include( file, "objbase.h", 0 ); - add_include( file, "rpcproxy.h", 0 ); - file = add_generated_source( replace_extension( source->name, ".idl", "_p.c" ), NULL ); - add_include( file, "objbase.h", 0 ); - add_include( file, "rpcproxy.h", 0 ); - add_include( file, "wine/exception.h", 0 ); - add_include( file, replace_extension( source->name, ".idl", ".h" ), 0 ); + file = add_generated_source( make, "dlldata.o", "dlldata.c" ); + add_dependency( file->file, "objbase.h", INCL_NORMAL ); + add_dependency( file->file, "rpcproxy.h", INCL_NORMAL ); + add_all_includes( make, file, file->file ); + file = add_generated_source( make, replace_extension( source->name, ".idl", "_p.c" ), NULL ); + add_dependency( file->file, "objbase.h", INCL_NORMAL ); + add_dependency( file->file, "rpcproxy.h", INCL_NORMAL ); + add_dependency( file->file, "wine/exception.h", INCL_NORMAL ); + add_dependency( file->file, replace_extension( source->name, ".idl", ".h" ), INCL_NORMAL ); + add_all_includes( make, file, file->file ); } - if (source->flags & FLAG_IDL_REGTYPELIB) + if (source->file->flags & FLAG_IDL_REGTYPELIB) { - add_generated_source( replace_extension( source->name, ".idl", "_t.res" ), NULL ); + add_generated_source( make, replace_extension( source->name, ".idl", "_t.res" ), NULL ); } - if (source->flags & FLAG_IDL_REGISTER) + if (source->file->flags & FLAG_IDL_REGISTER) { - add_generated_source( replace_extension( source->name, ".idl", "_r.res" ), NULL ); + add_generated_source( make, replace_extension( source->name, ".idl", "_r.res" ), NULL ); } if (strendswith( source->name, ".y" )) { - file = add_generated_source( replace_extension( source->name, ".y", ".tab.c" ), NULL ); + file = add_generated_source( make, replace_extension( source->name, ".y", ".tab.c" ), NULL ); /* steal the includes list from the source file */ file->files_count = source->files_count; file->files_size = source->files_size; @@ -1396,7 +1661,7 @@ } if (strendswith( source->name, ".l" )) { - file = add_generated_source( replace_extension( source->name, ".l", ".yy.c" ), NULL ); + file = add_generated_source( make, replace_extension( source->name, ".l", ".yy.c" ), NULL ); /* steal the includes list from the source file */ file->files_count = source->files_count; file->files_size = source->files_size; @@ -1405,10 +1670,11 @@ source->files = NULL; } } - if (get_make_variable( "TESTDLL" )) + if (get_make_variable( make, "TESTDLL" )) { - file = add_generated_source( "testlist.o", "testlist.c" ); - add_include( file, "wine/test.h", 0 ); + file = add_generated_source( make, "testlist.o", "testlist.c" ); + add_dependency( file->file, "wine/test.h", INCL_NORMAL ); + add_all_includes( make, file, file->file ); } } @@ -1434,6 +1700,17 @@ /******************************************************************* + * output_filenames_obj_dir + */ +static void output_filenames_obj_dir( struct makefile *make, struct strarray array ) +{ + unsigned int i; + + for (i = 0; i < array.count; i++) output_filename( obj_dir_path( make, array.str[i] )); +} + + +/******************************************************************* * output_include */ static void output_include( struct incl_file *pFile, struct incl_file *owner ) @@ -1451,12 +1728,10 @@ /******************************************************************* * output_sources */ -static struct strarray output_sources(void) +static struct strarray output_sources( struct makefile *make, struct strarray *testlist_files ) { struct incl_file *source; unsigned int i; - int is_win16 = 0; - const char *dllext = ".so"; struct strarray object_files = empty_strarray; struct strarray crossobj_files = empty_strarray; struct strarray res_files = empty_strarray; @@ -1471,33 +1746,20 @@ struct strarray includes = empty_strarray; struct strarray subdirs = empty_strarray; struct strarray phony_targets = empty_strarray; - struct strarray linguas = get_expanded_make_var_array( "LINGUAS" ); - struct strarray all_targets = get_expanded_make_var_array( "PROGRAMS" ); - struct strarray targetflags = get_expanded_make_var_array( "TARGETFLAGS" ); - struct strarray delayimports = get_expanded_make_var_array( "DELAYIMPORTS" ); - struct strarray extradllflags = get_expanded_make_var_array( "EXTRADLLFLAGS" ); - char *module = get_expanded_make_variable( "MODULE" ); - char *exeext = get_expanded_make_variable( "EXEEXT" ); - char *testdll = get_expanded_make_variable( "TESTDLL" ); - char *staticlib = get_expanded_make_variable( "STATICLIB" ); - char *crosstarget = get_expanded_make_variable( "CROSSTARGET" ); - - if (exeext && !strcmp( exeext, ".exe" )) dllext = ""; - if (module && strendswith( module, ".a" )) staticlib = module; - for (i = 0; i < extradllflags.count; i++) if (!strcmp( extradllflags.str[i], "-m16" )) is_win16 = 1; + struct strarray all_targets = get_expanded_make_var_array( make, "PROGRAMS" ); for (i = 0; i < linguas.count; i++) - strarray_add( &mo_files, strmake( "%s/%s.mo", top_obj_dir_path( "po" ), linguas.str[i] )); + strarray_add( &mo_files, strmake( "%s/%s.mo", top_obj_dir_path( make, "po" ), linguas.str[i] )); - strarray_add( &includes, "-I." ); - if (src_dir) strarray_add( &includes, strmake( "-I%s", src_dir )); - if (parent_dir) strarray_add( &includes, strmake( "-I%s", src_dir_path( parent_dir ))); - if (top_obj_dir) strarray_add( &includes, strmake( "-I%s/include", top_obj_dir )); - if (top_src_dir) strarray_add( &includes, strmake( "-I%s/include", top_src_dir )); - if (use_msvcrt) strarray_add( &includes, strmake( "-I%s", top_dir_path( "include/msvcrt" ))); - strarray_addall( &includes, include_args ); + 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" ))); + 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 ); - LIST_FOR_EACH_ENTRY( source, &sources, struct incl_file, entry ) + LIST_FOR_EACH_ENTRY( source, &make->sources, struct incl_file, entry ) { struct strarray extradefs; char *obj = xstrdup( source->name ); @@ -1506,132 +1768,136 @@ if (!ext) fatal_error( "unsupported file type %s\n", source->name ); *ext++ = 0; - if (src_dir && strchr( obj, '/' )) + if (make->src_dir && strchr( obj, '/' )) { - char *subdir = base_dir_path( obj ); + char *subdir = base_dir_path( make, obj ); *strrchr( subdir, '/' ) = 0; strarray_add_uniq( &subdirs, subdir ); } - extradefs = get_expanded_make_var_array( strmake( "%s_EXTRADEFS", obj )); + extradefs = get_expanded_make_var_array( make, strmake( "%s_EXTRADEFS", obj )); if (!strcmp( ext, "y" )) /* yacc file */ { /* add source file dependency for parallel makes */ char *header = strmake( "%s.tab.h", obj ); - if (find_include_file( header )) + if (find_include_file( make, header )) { - output( "%s.tab.h: %s\n", obj, source->filename ); + output( "%s: %s\n", obj_dir_path( make, header ), source->filename ); output( "\t$(BISON) -p %s_ -o %s.tab.c -d %s\n", - obj, obj, source->filename ); - output( "%s.tab.c: %s %s\n", obj, source->filename, header ); - strarray_add( &clean_files, strmake( "%s.tab.h", obj )); + obj, obj_dir_path( make, obj ), source->filename ); + output( "%s.tab.c: %s %s\n", obj_dir_path( make, obj ), + source->filename, obj_dir_path( make, header )); + strarray_add( &clean_files, header ); } else output( "%s.tab.c: %s\n", obj, source->filename ); output( "\t$(BISON) -p %s_ -o $@ %s\n", obj, source->filename ); - free( header ); continue; /* no dependencies */ } else if (!strcmp( ext, "x" )) /* template file */ { - output( "%s.h: %s%s %s\n", obj, tools_dir_path( "make_xftmpl" ), tools_ext, source->filename ); - output( "\t%s%s -H -o $@ %s\n", tools_dir_path( "make_xftmpl" ), tools_ext, source->filename ); + output( "%s.h: %s%s %s\n", obj_dir_path( make, obj ), + 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 */ } else if (!strcmp( ext, "l" )) /* lex file */ { - output( "%s.yy.c: %s\n", obj, source->filename ); + 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 */ { strarray_add( &res_files, strmake( "%s.res", obj )); - output( "%s.res: %s %s\n", obj, tools_path( "wrc" ), source->filename ); - output( "\t%s -o $@ %s", tools_path( "wrc" ), source->filename ); - if (is_win16) output_filename( "-m16" ); - else output_filenames( targetflags ); + output( "%s.res: %s %s\n", obj_dir_path( make, obj ), + tools_path( make, "wrc" ), source->filename ); + output( "\t%s -o $@ %s", tools_path( make, "wrc" ), source->filename ); + if (make->is_win16) output_filename( "-m16" ); + else output_filenames( target_flags ); output_filename( "--nostdinc" ); output_filenames( includes ); - output_filenames( define_args ); + output_filenames( make->define_args ); output_filenames( extradefs ); - if (mo_files.count && (source->flags & FLAG_RC_PO)) + if (mo_files.count && (source->file->flags & FLAG_RC_PO)) { strarray_add( &po_files, source->filename ); - output_filename( strmake( "--po-dir=%s", top_obj_dir_path( "po" ))); + output_filename( strmake( "--po-dir=%s", top_obj_dir_path( make, "po" ))); output( "\n" ); - output( "%s.res:", obj ); + output( "%s.res:", obj_dir_path( make, obj )); output_filenames( mo_files ); output( "\n" ); - output( "rsrc.pot " ); + output( "%s ", obj_dir_path( make, "rsrc.pot" )); } else output( "\n" ); - output( "%s.res:", obj ); + output( "%s.res:", obj_dir_path( make, obj )); } else if (!strcmp( ext, "mc" )) /* message file */ { strarray_add( &res_files, strmake( "%s.res", obj )); - output( "%s.res: %s %s\n", obj, tools_path( "wmc" ), source->filename ); - output( "\t%s -U -O res -o $@ %s", tools_path( "wmc" ), source->filename ); + output( "%s.res: %s %s\n", obj_dir_path( make, obj ), + tools_path( make, "wmc" ), source->filename ); + output( "\t%s -U -O res -o $@ %s", tools_path( make, "wmc" ), source->filename ); if (mo_files.count) { strarray_add( &mc_files, source->filename ); - output_filename( strmake( "--po-dir=%s", top_obj_dir_path( "po" ))); + output_filename( strmake( "--po-dir=%s", top_obj_dir_path( make, "po" ))); output( "\n" ); - output( "%s.res:", obj ); + output( "%s.res:", obj_dir_path( make, obj )); output_filenames( mo_files ); output( "\n" ); - output( "msg.pot " ); + output( "%s ", obj_dir_path( make, "msg.pot" )); } else output( "\n" ); - output( "%s.res:", obj ); + output( "%s.res:", obj_dir_path( make, obj )); } else if (!strcmp( ext, "idl" )) /* IDL file */ { struct strarray targets = empty_strarray; char *dest; - if (!source->flags || find_include_file( strmake( "%s.h", obj ))) - source->flags |= FLAG_IDL_HEADER; + if (!source->file->flags || 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++) { - if (!(source->flags & idl_outputs[i].flag)) continue; + if (!(source->file->flags & idl_outputs[i].flag)) continue; dest = strmake( "%s%s", obj, idl_outputs[i].ext ); - if (!find_src_file( dest )) strarray_add( &clean_files, dest ); + if (!find_src_file( make, dest )) strarray_add( &clean_files, dest ); strarray_add( &targets, dest ); } - if (source->flags & FLAG_IDL_PROXY) strarray_add( &dlldata_files, source->name ); - output_filenames( targets ); - output( ": %s\n", tools_path( "widl" )); - output( "\t%s -o $@ %s", tools_path( "widl" ), source->filename ); - output_filenames( targetflags ); + if (source->file->flags & FLAG_IDL_PROXY) strarray_add( &dlldata_files, source->name ); + output_filenames_obj_dir( make, targets ); + output( ": %s\n", tools_path( make, "widl" )); + output( "\t%s -o $@ %s", tools_path( make, "widl" ), source->filename ); + output_filenames( target_flags ); output_filenames( includes ); - output_filenames( define_args ); + output_filenames( make->define_args ); output_filenames( extradefs ); - output_filenames( get_expanded_make_var_array( "EXTRAIDLFLAGS" )); + output_filenames( get_expanded_make_var_array( make, "EXTRAIDLFLAGS" )); output( "\n" ); - output_filenames( targets ); + output_filenames_obj_dir( make, targets ); output( ": %s", source->filename ); } else if (!strcmp( ext, "in" )) /* .in file or man page */ { - if (strendswith( obj, ".man" ) && source->args) + if (strendswith( obj, ".man" ) && source->file->args) { char *dir, *dest = replace_extension( obj, ".man", "" ); char *lang = strchr( dest, '.' ); - char *section = source->args; + char *section = source->file->args; if (lang) { *lang++ = 0; dir = strmake( "$(DESTDIR)$(mandir)/%s/man%s", lang, section ); } else dir = strmake( "$(DESTDIR)$(mandir)/man%s", section ); - output( "install-man-pages:: %s\n", obj ); - output( "\t$(INSTALL_DATA) %s %s/%s.%s\n", obj, dir, dest, 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 ); free( dest ); @@ -1641,64 +1907,64 @@ strarray_add_uniq( &phony_targets, "uninstall" ); } else strarray_add( &clean_files, xstrdup(obj) ); - output( "%s: %s\n", obj, source->filename ); + output( "%s: %s\n", obj_dir_path( make, obj ), source->filename ); output( "\t$(SED_CMD) %s >$@ || ($(RM) $@ && false)\n", source->filename ); - output( "%s:", obj ); + output( "%s:", obj_dir_path( make, obj )); } else if (!strcmp( ext, "sfd" )) /* font file */ { - char *ttf_file = src_dir_path( strmake( "%s.ttf", obj )); - char *fontforge = get_expanded_make_variable( "FONTFORGE" ); - if (fontforge && !src_dir) + char *ttf_file = src_dir_path( make, strmake( "%s.ttf", obj )); + if (fontforge && !make->src_dir) { output( "%s: %s\n", ttf_file, source->filename ); output( "\t%s -script %s %s $@\n", - fontforge, top_dir_path( "fonts/genttf.ff" ), source->filename ); + fontforge, top_dir_path( make, "fonts/genttf.ff" ), source->filename ); + if (!(source->file->flags & FLAG_SFD_FONTS)) output( "all: %s\n", ttf_file ); } - if (source->flags & FLAG_INSTALL) + 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 ); } - if (source->flags & FLAG_SFD_FONTS) + if (source->file->flags & FLAG_SFD_FONTS) { - struct strarray *array = source->args; + struct strarray *array = source->file->args; for (i = 0; i < array->count; i++) { char *font = strtok( xstrdup(array->str[i]), " \t" ); char *args = strtok( NULL, "" ); - strarray_add( &all_targets, font ); - output( "%s: %s %s\n", font, tools_path( "sfnt2fon" ), ttf_file ); - output( "\t%s -o $@ %s %s\n", tools_path( "sfnt2fon" ), ttf_file, args ); + strarray_add( &all_targets, xstrdup( font )); + 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", font, 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_uniq( &phony_targets, "install" ); - strarray_add_uniq( &phony_targets, "install-lib" ); - strarray_add_uniq( &phony_targets, "uninstall" ); } } + 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 */ { - char *convert = get_expanded_make_variable( "CONVERT" ); - char *rsvg = get_expanded_make_variable( "RSVG" ); - char *icotool = get_expanded_make_variable( "ICOTOOL" ); - if (convert && rsvg && icotool && !src_dir) - { - output( "%s.ico %s.bmp: %s\n", obj, obj, source->filename ); - output( "\tCONVERT=\"%s\" ICOTOOL=\"%s\" RSVG=\"%s\" %s %s $@\n", - convert, icotool, rsvg, top_dir_path( "tools/buildimage" ), source->filename ); - } - free( convert ); - free( rsvg ); - free( icotool ); + if (convert && rsvg && icotool && !make->src_dir) + { + output( "%s.ico %s.bmp: %s\n", + src_dir_path( make, obj ), src_dir_path( make, obj ), source->filename ); + output( "\tCONVERT=\"%s\" ICOTOOL=\"%s\" RSVG=\"%s\" %s %s $@\n", convert, icotool, rsvg, + top_dir_path( make, "tools/buildimage" ), source->filename ); + } continue; /* no dependencies */ } else if (!strcmp( ext, "res" )) @@ -1708,47 +1974,54 @@ } else { - int need_cross = testdll || (source->flags & FLAG_C_IMPLIB) || (module && staticlib); + int need_cross = make->testdll || + (source->file->flags & FLAG_C_IMPLIB) || + (make->module && make->staticlib); - if ((source->flags & FLAG_GENERATED) && (!testdll || strcmp( source->filename, "testlist.c" ))) + if ((source->file->flags & FLAG_GENERATED) && + (!make->testdll || !strendswith( source->filename, "testlist.c" ))) strarray_add( &clean_files, source->filename ); - if (source->flags & FLAG_C_IMPLIB) strarray_add( &implib_objs, strmake( "%s.o", obj )); + if (source->file->flags & FLAG_C_IMPLIB) strarray_add( &implib_objs, strmake( "%s.o", obj )); strarray_add( &object_files, strmake( "%s.o", obj )); - output( "%s.o: %s\n", obj, source->filename ); + output( "%s.o: %s\n", obj_dir_path( make, obj ), source->filename ); output( "\t$(CC) -c -o $@ %s", source->filename ); output_filenames( includes ); - output_filenames( define_args ); + output_filenames( make->define_args ); output_filenames( extradefs ); - if (module || staticlib || testdll) output_filenames( dllflags ); - output_filenames( get_expanded_make_var_array( "EXTRACFLAGS" )); - output_filenames( get_expanded_make_var_array( "CPPFLAGS" )); + if (make->module || make->staticlib || make->testdll) + { + output_filenames( dll_flags ); + if (make->use_msvcrt) output_filenames( msvcrt_flags ); + } + output_filenames( extra_cflags ); + output_filenames( cpp_flags ); output_filename( "$(CFLAGS)" ); output( "\n" ); if (crosstarget && need_cross) { strarray_add( &crossobj_files, strmake( "%s.cross.o", obj )); - output( "%s.cross.o: %s\n", obj, source->filename ); + output( "%s.cross.o: %s\n", obj_dir_path( make, obj ), source->filename ); output( "\t$(CROSSCC) -c -o $@ %s", source->filename ); output_filenames( includes ); - output_filenames( define_args ); + output_filenames( make->define_args ); output_filenames( extradefs ); output_filename( "-DWINE_CROSSTEST" ); - output_filenames( get_expanded_make_var_array( "CPPFLAGS" )); + output_filenames( cpp_flags ); output_filename( "$(CFLAGS)" ); output( "\n" ); } - if (testdll && !strcmp( ext, "c" ) && !(source->flags & FLAG_GENERATED)) + if (make->testdll && !strcmp( ext, "c" ) && !(source->file->flags & FLAG_GENERATED)) { strarray_add( &ok_files, strmake( "%s.ok", obj )); - output( "%s.ok:\n", obj ); + output( "%s.ok:\n", obj_dir_path( make, obj )); output( "\t%s $(RUNTESTFLAGS) -T %s -M %s -p %s%s %s && touch $@\n", - top_dir_path( "tools/runtest" ), top_obj_dir, - testdll, replace_extension( testdll, ".dll", "_test.exe" ), dllext, obj ); + top_dir_path( make, "tools/runtest" ), top_obj_dir_path( make, "" ), make->testdll, + replace_extension( make->testdll, ".dll", "_test.exe" ), dll_ext, obj ); } - if (!strcmp( ext, "c" ) && !(source->flags & FLAG_GENERATED)) + if (!strcmp( ext, "c" ) && !(source->file->flags & FLAG_GENERATED)) strarray_add( &c2man_files, source->filename ); - output( "%s.o", obj ); - if (crosstarget && need_cross) output( " %s.cross.o", obj ); + output( "%s.o", obj_dir_path( make, obj )); + if (crosstarget && need_cross) output( " %s.cross.o", obj_dir_path( make, obj )); output( ":" ); } free( obj ); @@ -1761,26 +2034,26 @@ if (po_files.count) { - output( "rsrc.pot: %s", tools_path( "wrc" ) ); + output( "%s: %s", obj_dir_path( make, "rsrc.pot" ), tools_path( make, "wrc" ) ); output_filenames( po_files ); output( "\n" ); - output( "\t%s -O pot -o $@", tools_path( "wrc" )); + output( "\t%s -O pot -o $@", tools_path( make, "wrc" )); output_filenames( po_files ); - if (is_win16) output_filename( "-m16" ); - else output_filenames( targetflags ); + if (make->is_win16) output_filename( "-m16" ); + else output_filenames( target_flags ); output_filename( "--nostdinc" ); output_filenames( includes ); - output_filenames( define_args ); + output_filenames( make->define_args ); output( "\n" ); strarray_add( &clean_files, "rsrc.pot" ); } if (mc_files.count) { - output( "msg.pot: %s", tools_path( "wmc" )); + output( "%s: %s", obj_dir_path( make, "msg.pot" ), tools_path( make, "wmc" )); output_filenames( mc_files ); output( "\n" ); - output( "\t%s -O pot -o $@", tools_path( "wmc" )); + output( "\t%s -O pot -o $@", tools_path( make, "wmc" )); output_filenames( mc_files ); output( "\n" ); strarray_add( &clean_files, "msg.pot" ); @@ -1788,138 +2061,147 @@ if (dlldata_files.count) { - output( "dlldata.c: %s %s\n", tools_path( "widl" ), src_dir_path( "Makefile.in" )); - output( "\t%s --dlldata-only -o $@", tools_path( "widl" )); + output( "%s: %s %s\n", obj_dir_path( make, "dlldata.c" ), + tools_path( make, "widl" ), src_dir_path( make, "Makefile.in" )); + output( "\t%s --dlldata-only -o $@", tools_path( make, "widl" )); output_filenames( dlldata_files ); output( "\n" ); } - if (module && !staticlib) + if (make->module && !make->staticlib) { - char *importlib = get_expanded_make_variable( "IMPORTLIB" ); struct strarray all_libs = empty_strarray; + char *module_path = obj_dir_path( make, make->module ); char *spec_file = NULL; - if (!appmode.count) spec_file = src_dir_path( replace_extension( module, ".dll", ".spec" )); - for (i = 0; i < delayimports.count; i++) - strarray_add( &all_libs, strmake( "-l%s", delayimports.str[i] )); - for (i = 0; i < imports.count; i++) - strarray_add( &all_libs, strmake( "-l%s", imports.str[i] )); - for (i = 0; i < delayimports.count; i++) - strarray_add( &all_libs, strmake( "-Wb,-d%s", delayimports.str[i] )); + if (!make->appmode.count) + spec_file = src_dir_path( make, replace_extension( make->module, ".dll", ".spec" )); + for (i = 0; i < make->delayimports.count; i++) + strarray_add( &all_libs, strmake( "-l%s", make->delayimports.str[i] )); + for (i = 0; i < make->imports.count; i++) + strarray_add( &all_libs, strmake( "-l%s", make->imports.str[i] )); + for (i = 0; i < make->delayimports.count; i++) + strarray_add( &all_libs, strmake( "-Wb,-d%s", make->delayimports.str[i] )); strarray_add( &all_libs, "-lwine" ); - strarray_addall( &all_libs, get_expanded_make_var_array( "LIBPORT" )); - strarray_addall( &all_libs, get_expanded_make_var_array( "EXTRALIBS" )); - strarray_addall( &all_libs, get_expanded_make_var_array( "LIBS" )); - - if (*dllext) - { - strarray_add( &all_targets, strmake( "%s%s", module, dllext )); - strarray_add( &all_targets, strmake( "%s.fake", module )); - output( "%s%s %s.fake:", module, dllext, module ); + 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 ); + + if (*dll_ext) + { + strarray_add( &all_targets, strmake( "%s%s", make->module, dll_ext )); + strarray_add( &all_targets, strmake( "%s.fake", make->module )); + output( "%s%s %s.fake:", module_path, dll_ext, module_path ); } else { - strarray_add( &all_targets, module ); - output( "%s:", module ); + strarray_add( &all_targets, make->module ); + output( "%s:", module_path ); } if (spec_file) output_filename( spec_file ); - output_filenames( object_files ); - output_filenames( res_files ); + output_filenames_obj_dir( make, object_files ); + output_filenames_obj_dir( make, res_files ); output( "\n" ); - output( "\t%s -o $@", tools_path( "winegcc" )); - output_filename( strmake( "-B%s", tools_dir_path( "winebuild" ))); - if (tools_dir) output_filename( strmake( "--sysroot=%s", top_obj_dir )); - output_filenames( targetflags ); - output_filenames( get_expanded_make_var_array( "UNWINDFLAGS" )); + output( "\t%s -o $@", tools_path( make, "winegcc" )); + output_filename( strmake( "-B%s", tools_dir_path( make, "winebuild" ))); + if (tools_dir) output_filename( strmake( "--sysroot=%s", top_obj_dir_path( make, "" ))); + output_filenames( target_flags ); + output_filenames( unwind_flags ); if (spec_file) { output( " -shared %s", spec_file ); - output_filenames( extradllflags ); + output_filenames( make->extradllflags ); } - else output_filenames( appmode ); - output_filenames( object_files ); - output_filenames( res_files ); + else output_filenames( make->appmode ); + output_filenames_obj_dir( make, object_files ); + output_filenames_obj_dir( make, res_files ); output_filenames( all_libs ); output_filename( "$(LDFLAGS)" ); output( "\n" ); - if (spec_file && importlib) + if (spec_file && make->importlib) { - if (*dllext) + char *importlib_path = obj_dir_path( make, strmake( "lib%s", make->importlib )); + if (*dll_ext) { - strarray_add( &clean_files, strmake( "lib%s.def", importlib )); - output( "lib%s.def: %s %s\n", importlib, tools_path( "winebuild" ), spec_file ); - output( "\t%s -w --def -o $@ --export %s", tools_path( "winebuild" ), spec_file ); - output_filenames( targetflags ); - if (is_win16) output_filename( "-m16" ); + strarray_add( &clean_files, strmake( "lib%s.def", make->importlib )); + output( "%s.def: %s %s\n", importlib_path, tools_path( make, "winebuild" ), spec_file ); + output( "\t%s -w --def -o $@ --export %s", tools_path( make, "winebuild" ), spec_file ); + output_filenames( target_flags ); + if (make->is_win16) output_filename( "-m16" ); output( "\n" ); if (implib_objs.count) { - strarray_add( &clean_files, strmake( "lib%s.def.a", importlib )); - output( "lib%s.def.a:", importlib ); - output_filenames( implib_objs ); + 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( "\t$(AR) $(ARFLAGS) $@" ); - output_filenames( implib_objs ); + output_filenames_obj_dir( make, implib_objs ); output( "\n" ); output( "\t$(RANLIB) $@\n" ); } } else { - strarray_add( &clean_files, strmake( "lib%s.a", importlib )); - output( "lib%s.a: %s %s", importlib, tools_path( "winebuild" ), spec_file ); - output_filenames( implib_objs ); + strarray_add( &clean_files, strmake( "lib%s.a", make->importlib )); + output( "%s.a: %s %s", importlib_path, tools_path( make, "winebuild" ), spec_file ); + output_filenames_obj_dir( make, implib_objs ); output( "\n" ); - output( "\t%s -w --implib -o $@ --export %s", tools_path( "winebuild" ), spec_file ); - output_filenames( targetflags ); - output_filenames( implib_objs ); + output( "\t%s -w --implib -o $@ --export %s", tools_path( make, "winebuild" ), spec_file ); + output_filenames( target_flags ); + output_filenames_obj_dir( make, implib_objs ); output( "\n" ); } - if (crosstarget && !is_win16) + if (crosstarget && !make->is_win16) { struct strarray cross_files = strarray_replace_extension( &implib_objs, ".o", ".cross.o" ); - strarray_add( &clean_files, strmake( "lib%s.cross.a", importlib )); - output( "lib%s.cross.a: %s %s", importlib, tools_path( "winebuild" ), spec_file ); - output_filenames( cross_files ); + strarray_add( &clean_files, strmake( "lib%s.cross.a", make->importlib )); + output( "%s.cross.a: %s %s", importlib_path, tools_path( make, "winebuild" ), spec_file ); + output_filenames_obj_dir( make, cross_files ); output( "\n" ); output( "\t%s -b %s -w --implib -o $@ --export %s", - tools_path( "winebuild" ), crosstarget, spec_file ); - output_filenames( cross_files ); + tools_path( make, "winebuild" ), crosstarget, spec_file ); + output_filenames_obj_dir( make, cross_files ); output( "\n" ); } } if (spec_file) { - if (c2man_files.count && top_obj_dir) + if (c2man_files.count) { - char *manext = get_expanded_make_variable( "api_manext" ); - output( "manpages::\n" ); - output( "\t%s -w %s -R%s", top_dir_path( "tools/c2man.pl" ), spec_file, top_obj_dir ); - output_filename( strmake( "-I%s", top_dir_path( "include" ))); - output_filename( strmake( "-o %s/documentation/man%s", top_obj_dir, manext ? manext : "3w" )); + output( "\t%s -w %s", top_dir_path( make, "tools/c2man.pl" ), spec_file ); + output_filename( strmake( "-R%s", top_dir_path( make, "" ))); + output_filename( strmake( "-I%s", top_dir_path( make, "include" ))); + output_filename( strmake( "-o %s/man%s", + top_obj_dir_path( make, "documentation" ), man_ext )); output_filenames( c2man_files ); output( "\n" ); output( "htmlpages::\n" ); - output( "\t%s -Th -w %s -R%s", top_dir_path( "tools/c2man.pl" ), spec_file, top_obj_dir ); - output_filename( strmake( "-I%s", top_dir_path( "include" ))); - output_filename( strmake( "-o %s/documentation/html", top_obj_dir )); + output( "\t%s -Th -w %s", top_dir_path( make, "tools/c2man.pl" ), spec_file ); + output_filename( strmake( "-R%s", top_dir_path( make, "" ))); + output_filename( strmake( "-I%s", top_dir_path( make, "include" ))); + output_filename( strmake( "-o %s", + top_obj_dir_path( make, "documentation/html" ))); output_filenames( c2man_files ); output( "\n" ); output( "sgmlpages::\n" ); - output( "\t%s -Ts -w %s -R%s", top_dir_path( "tools/c2man.pl" ), spec_file, top_obj_dir ); - output_filename( strmake( "-I%s", top_dir_path( "include" ))); - output_filename( strmake( "-o %s/documentation/api-guide", top_obj_dir )); + output( "\t%s -Ts -w %s", top_dir_path( make, "tools/c2man.pl" ), spec_file ); + output_filename( strmake( "-R%s", top_dir_path( make, "" ))); + output_filename( strmake( "-I%s", top_dir_path( make, "include" ))); + output_filename( strmake( "-o %s", + top_obj_dir_path( make, "documentation/api-guide" ))); output_filenames( c2man_files ); output( "\n" ); output( "xmlpages::\n" ); - output( "\t%s -Tx -w %s -R%s", top_dir_path( "tools/c2man.pl" ), spec_file, top_obj_dir ); - output_filename( strmake( "-I%s", top_dir_path( "include" ))); - output_filename( strmake( "-o %s/documentation/api-guide-xml", top_obj_dir )); + output( "\t%s -Tx -w %s", top_dir_path( make, "tools/c2man.pl" ), spec_file ); + output_filename( strmake( "-R%s", top_dir_path( make, "" ))); + output_filename( strmake( "-I%s", top_dir_path( make, "include" ))); + output_filename( strmake( "-o %s", + top_obj_dir_path( make, "documentation/api-guide-xml" ))); output_filenames( c2man_files ); output( "\n" ); strarray_add( &phony_targets, "manpages" ); @@ -1931,121 +2213,122 @@ } } - if (staticlib) + if (make->staticlib) { - strarray_add( &all_targets, staticlib ); - output( "%s:", staticlib ); - output_filenames( object_files ); + 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( "\t$(AR) $(ARFLAGS) $@" ); - output_filenames( object_files ); + output_filenames_obj_dir( make, object_files ); output( "\n\t$(RANLIB) $@\n" ); - if (crosstarget && module) + if (crosstarget && make->module) { - char *name = replace_extension( staticlib, ".a", ".cross.a" ); + char *name = replace_extension( make->staticlib, ".a", ".cross.a" ); strarray_add( &all_targets, name ); - output( "%s:", name ); - output_filenames( crossobj_files ); + output( "%s:", obj_dir_path( make, name )); + output_filenames_obj_dir( make, crossobj_files ); output( "\n\t$(RM) $@\n" ); output( "\t%s-ar $(ARFLAGS) $@", crosstarget ); - output_filenames( crossobj_files ); + output_filenames_obj_dir( make, crossobj_files ); output( "\n\t%s-ranlib $@\n", crosstarget ); } } - if (testdll) + if (make->testdll) { - char *testmodule = replace_extension( testdll, ".dll", "_test.exe" ); - char *stripped = replace_extension( testdll, ".dll", "_test-stripped.exe" ); + char *testmodule = replace_extension( make->testdll, ".dll", "_test.exe" ); + char *stripped = replace_extension( make->testdll, ".dll", "_test-stripped.exe" ); + char *testres = replace_extension( make->testdll, ".dll", "_test.res" ); struct strarray all_libs = empty_strarray; - for (i = 0; i < imports.count; i++) strarray_add( &all_libs, strmake( "-l%s", imports.str[i] )); - strarray_addall( &all_libs, get_expanded_make_var_array( "LIBS" )); - - strarray_add( &all_targets, strmake( "%s%s", testmodule, dllext )); - strarray_add( &clean_files, strmake( "%s%s", stripped, dllext )); - output( "%s%s:\n", testmodule, dllext ); - output( "\t%s -o $@", tools_path( "winegcc" )); - output_filename( strmake( "-B%s", tools_dir_path( "winebuild" ))); - if (tools_dir) output_filename( strmake( "--sysroot=%s", top_obj_dir )); - output_filenames( targetflags ); - output_filenames( get_expanded_make_var_array( "UNWINDFLAGS" )); - output_filenames( appmode ); - output_filenames( object_files ); - output_filenames( res_files ); + 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_add( &all_targets, strmake( "%s%s", testmodule, dll_ext )); + strarray_add( &clean_files, strmake( "%s%s", stripped, dll_ext )); + output( "%s%s:\n", obj_dir_path( make, testmodule ), dll_ext ); + output( "\t%s -o $@", tools_path( make, "winegcc" )); + output_filename( strmake( "-B%s", tools_dir_path( make, "winebuild" ))); + if (tools_dir) output_filename( strmake( "--sysroot=%s", top_obj_dir_path( make, "" ))); + output_filenames( target_flags ); + output_filenames( unwind_flags ); + output_filenames( make->appmode ); + output_filenames_obj_dir( make, object_files ); + output_filenames_obj_dir( make, res_files ); output_filenames( all_libs ); output_filename( "$(LDFLAGS)" ); output( "\n" ); - output( "%s%s:\n", stripped, dllext ); - output( "\t%s -o $@", tools_path( "winegcc" )); - output_filename( strmake( "-B%s", tools_dir_path( "winebuild" ))); - if (tools_dir) output_filename( strmake( "--sysroot=%s", top_obj_dir )); - output_filenames( targetflags ); - output_filenames( get_expanded_make_var_array( "UNWINDFLAGS" )); + output( "%s%s:\n", obj_dir_path( make, stripped ), dll_ext ); + output( "\t%s -o $@", tools_path( make, "winegcc" )); + output_filename( strmake( "-B%s", tools_dir_path( make, "winebuild" ))); + if (tools_dir) output_filename( strmake( "--sysroot=%s", top_obj_dir_path( make, "" ))); + output_filenames( target_flags ); + output_filenames( unwind_flags ); output_filename( strmake( "-Wb,-F,%s", testmodule )); - output_filenames( appmode ); - output_filenames( object_files ); - output_filenames( res_files ); + output_filenames( make->appmode ); + output_filenames_obj_dir( make, object_files ); + output_filenames_obj_dir( make, res_files ); output_filenames( all_libs ); output_filename( "$(LDFLAGS)" ); output( "\n" ); - output( "%s%s %s%s:", testmodule, dllext, stripped, dllext ); - output_filenames( object_files ); - output_filenames( res_files ); + output( "%s%s %s%s:", obj_dir_path( make, testmodule ), dll_ext, + obj_dir_path( make, stripped ), dll_ext ); + output_filenames_obj_dir( make, object_files ); + output_filenames_obj_dir( make, res_files ); output( "\n" ); - if (top_obj_dir) - { - char *testres = replace_extension( testdll, ".dll", "_test.res" ); - output( "all: %s/%s\n", top_obj_dir_path( "programs/winetest" ), testres ); - output( "%s/%s: %s%s\n", top_obj_dir_path( "programs/winetest" ), testres, stripped, dllext ); - output( "\techo \"%s TESTRES \\\"%s%s\\\"\" | %s -o $@\n", - testmodule, stripped, dllext, tools_path( "wrc" )); - } + output( "all: %s/%s\n", top_obj_dir_path( make, "programs/winetest" ), testres ); + output( "%s/%s: %s%s\n", top_obj_dir_path( make, "programs/winetest" ), testres, + obj_dir_path( make, stripped ), dll_ext ); + output( "\techo \"%s TESTRES \\\"%s%s\\\"\" | %s -o $@\n", + testmodule, obj_dir_path( make, stripped ), dll_ext, tools_path( make, "wrc" )); if (crosstarget) { - char *crosstest = replace_extension( testdll, ".dll", "_crosstest.exe" ); + char *crosstest = replace_extension( make->testdll, ".dll", "_crosstest.exe" ); strarray_add( &clean_files, crosstest ); - output( "crosstest: %s\n", crosstest ); - output( "%s:", crosstest ); - output_filenames( crossobj_files ); - output_filenames( res_files ); + output( "%s: %s\n", obj_dir_path( make, "crosstest" ), obj_dir_path( make, crosstest )); + output( "%s:", obj_dir_path( make, crosstest )); + output_filenames_obj_dir( make, crossobj_files ); + output_filenames_obj_dir( make, res_files ); output( "\n" ); - output( "\t%s -o $@ -b %s", tools_path( "winegcc" ), crosstarget ); - output_filename( strmake( "-B%s", tools_dir_path( "winebuild" ))); - if (tools_dir) output_filename( strmake( "--sysroot=%s", top_obj_dir )); + output( "\t%s -o $@ -b %s", tools_path( make, "winegcc" ), crosstarget ); + output_filename( strmake( "-B%s", tools_dir_path( make, "winebuild" ))); + if (tools_dir) output_filename( strmake( "--sysroot=%s", top_obj_dir_path( make, "" ))); output_filename( "--lib-suffix=.cross.a" ); - output_filenames( crossobj_files ); - output_filenames( res_files ); + output_filenames_obj_dir( make, crossobj_files ); + output_filenames_obj_dir( make, res_files ); output_filenames( all_libs ); output_filename( "$(LDFLAGS)" ); output( "\n" ); - strarray_add( &phony_targets, "crosstest" ); + strarray_add( &phony_targets, obj_dir_path( make, "crosstest" )); + if (make->obj_dir) output( "crosstest: %s\n", obj_dir_path( make, "crosstest" )); } - output_filenames( ok_files ); - output( ": %s%s ../%s%s\n", testmodule, dllext, testdll, dllext ); + output_filenames_obj_dir( make, ok_files ); + output( ": %s%s ../%s%s\n", testmodule, dll_ext, make->testdll, dll_ext ); output( "check test:" ); - output_filenames( ok_files ); + output_filenames_obj_dir( make, ok_files ); output( "\n" ); output( "testclean::\n" ); output( "\t$(RM)" ); - output_filenames( ok_files ); + output_filenames_obj_dir( make, ok_files ); output( "\n" ); strarray_addall( &clean_files, ok_files ); strarray_add( &phony_targets, "check" ); strarray_add( &phony_targets, "test" ); strarray_add( &phony_targets, "testclean" ); - testlist_files = strarray_replace_extension( &ok_files, ".ok", "" ); + *testlist_files = strarray_replace_extension( &ok_files, ".ok", "" ); } if (all_targets.count) { output( "all:" ); - output_filenames( all_targets ); + output_filenames_obj_dir( make, all_targets ); output( "\n" ); } @@ -2053,21 +2336,22 @@ strarray_addall( &clean_files, crossobj_files ); strarray_addall( &clean_files, res_files ); strarray_addall( &clean_files, all_targets ); - strarray_addall( &clean_files, get_expanded_make_var_array( "EXTRA_TARGETS" )); + strarray_addall( &clean_files, get_expanded_make_var_array( make, "EXTRA_TARGETS" )); if (clean_files.count) { - output( "clean::\n" ); + output( "%s::\n", obj_dir_path( make, "clean" )); output( "\t$(RM)" ); - output_filenames( clean_files ); + output_filenames_obj_dir( make, clean_files ); output( "\n" ); - strarray_add( &phony_targets, "clean" ); + if (make->obj_dir) output( "__clean__: %s\n", obj_dir_path( make, "clean" )); + strarray_add( &phony_targets, obj_dir_path( make, "clean" )); } - if (top_obj_dir) + if (make->top_obj_dir) { output( "depend:\n" ); - output( "\t@cd %s && $(MAKE) %s\n", top_obj_dir, base_dir_path( "depend" )); + output( "\t@cd %s && $(MAKE) %s\n", make->top_obj_dir, base_dir_path( make, "depend" )); strarray_add( &phony_targets, "depend" ); } @@ -2225,9 +2509,9 @@ /******************************************************************* * output_dependencies */ -static void output_dependencies( const char *path ) +static void output_dependencies( struct makefile *make, const char *path ) { - struct strarray targets, ignore_files = empty_strarray; + struct strarray targets, testlist_files = empty_strarray, ignore_files = empty_strarray; if (Separator && ((output_file = fopen( path, "r" )))) { @@ -2250,8 +2534,7 @@ fatal_perror( "%s", path ); } - testlist_files = empty_strarray; - targets = output_sources(); + targets = output_sources( make, &testlist_files ); fclose( output_file ); output_file = NULL; @@ -2262,8 +2545,10 @@ if (testlist_files.count) strarray_add( &ignore_files, "testlist.c" ); strarray_addall( &ignore_files, targets ); - if (testlist_files.count) output_testlist( base_dir_path( "testlist.c" ), testlist_files ); - if (!src_dir && base_dir) output_gitignore( base_dir_path( ".gitignore" ), ignore_files ); + if (testlist_files.count) + 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 ); } @@ -2292,74 +2577,75 @@ unsigned int i; struct strarray value; struct incl_file *file; + struct makefile *make; - base_dir = path; - if (!strcmp( base_dir, "." )) base_dir = NULL; - output_file_name = base_dir_path( makefile_name ); - parse_makefile(); - - src_dir = get_expanded_make_variable( "srcdir" ); - top_src_dir = get_expanded_make_variable( "top_srcdir" ); - top_obj_dir = get_expanded_make_variable( "top_builddir" ); - parent_dir = get_expanded_make_variable( "PARENTSRC" ); - tools_dir = get_expanded_make_variable( "TOOLSDIR" ); - tools_ext = get_expanded_make_variable( "TOOLSEXT" ); - - /* ignore redundant source paths */ - if (src_dir && !strcmp( src_dir, "." )) src_dir = NULL; - if (top_src_dir && top_obj_dir && !strcmp( top_src_dir, top_obj_dir )) top_src_dir = NULL; - if (tools_dir && top_obj_dir && !strcmp( tools_dir, top_obj_dir )) tools_dir = NULL; - if (top_obj_dir && !strcmp( top_obj_dir, "." )) top_obj_dir = NULL; - - appmode = get_expanded_make_var_array( "APPMODE" ); - dllflags = get_expanded_make_var_array( "DLLFLAGS" ); - imports = get_expanded_make_var_array( "IMPORTS" ); - - use_msvcrt = 0; - for (i = 0; i < appmode.count && !use_msvcrt; i++) - use_msvcrt = !strcmp( appmode.str[i], "-mno-cygwin" ); - for (i = 0; i < imports.count && !use_msvcrt; i++) - use_msvcrt = !strncmp( imports.str[i], "msvcr", 5 ); - - include_args = empty_strarray; - define_args = empty_strarray; - strarray_add( &define_args, "-D__WINESRC__" ); + make = parse_makefile( path, Separator ); - if (!tools_ext) tools_ext = ""; + if (root_src_dir) + { + make->top_src_dir = concat_paths( make->top_obj_dir, root_src_dir ); + make->src_dir = concat_paths( make->top_src_dir, make->base_dir ); + } + strarray_set_value( &make->vars, "top_builddir", top_obj_dir_path( make, "" )); + strarray_set_value( &make->vars, "top_srcdir", top_dir_path( make, "" )); + strarray_set_value( &make->vars, "srcdir", src_dir_path( make, "" )); + + 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->staticlib = get_expanded_make_variable( make, "STATICLIB" ); + make->importlib = get_expanded_make_variable( make, "IMPORTLIB" ); + + 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" ); + + if (make->module && strendswith( make->module, ".a" )) make->staticlib = make->module; + + make->is_win16 = strarray_exists( &make->extradllflags, "-m16" ); + 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->include_args = empty_strarray; + make->define_args = empty_strarray; + strarray_add( &make->define_args, "-D__WINESRC__" ); - value = get_expanded_make_var_array( "EXTRAINCL" ); + 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( &include_args, value.str[i] ); + strarray_add_uniq( &make->include_args, value.str[i] ); else - strarray_add_uniq( &define_args, value.str[i] ); - strarray_addall( &define_args, get_expanded_make_var_array( "EXTRADEFS" )); + strarray_add_uniq( &make->define_args, value.str[i] ); + strarray_addall( &make->define_args, get_expanded_make_var_array( make, "EXTRADEFS" )); - if (use_msvcrt) strarray_add( &dllflags, get_expanded_make_variable( "MSVCRTFLAGS" )); - - list_init( &sources ); - list_init( &includes ); + list_init( &make->sources ); + list_init( &make->includes ); for (var = source_vars; *var; var++) { - value = get_expanded_make_var_array( *var ); - for (i = 0; i < value.count; i++) add_src_file( value.str[i] ); + value = get_expanded_make_var_array( make, *var ); + for (i = 0; i < value.count; i++) add_src_file( make, value.str[i] ); } - add_generated_sources(); + add_generated_sources( make ); - value = get_expanded_make_var_array( "EXTRA_OBJS" ); + value = get_expanded_make_var_array( make, "EXTRA_OBJS" ); for (i = 0; i < value.count; i++) { /* default to .c for unknown extra object files */ if (strendswith( value.str[i], ".o" )) - add_generated_source( value.str[i], replace_extension( value.str[i], ".o", ".c" ) ); + add_generated_source( make, value.str[i], replace_extension( value.str[i], ".o", ".c" ) ); else - add_generated_source( value.str[i], NULL ); + add_generated_source( make, value.str[i], NULL ); } - LIST_FOR_EACH_ENTRY( file, &includes, struct incl_file, entry ) parse_file( file, 0 ); - output_dependencies( output_file_name ); + 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; } @@ -2464,6 +2750,38 @@ signal( SIGHUP, exit_on_signal ); #endif + for (i = 0; i < HASH_SIZE; i++) list_init( &files[i] ); + + top_makefile = parse_makefile( NULL, "# End of common header" ); + + linguas = get_expanded_make_var_array( top_makefile, "LINGUAS" ); + target_flags = get_expanded_make_var_array( top_makefile, "TARGETFLAGS" ); + msvcrt_flags = get_expanded_make_var_array( top_makefile, "MSVCRTFLAGS" ); + dll_flags = get_expanded_make_var_array( top_makefile, "DLLFLAGS" ); + extra_cflags = get_expanded_make_var_array( top_makefile, "EXTRACFLAGS" ); + cpp_flags = get_expanded_make_var_array( top_makefile, "CPPFLAGS" ); + unwind_flags = get_expanded_make_var_array( top_makefile, "UNWINDFLAGS" ); + libs = get_expanded_make_var_array( top_makefile, "LIBS" ); + + root_src_dir = get_expanded_make_variable( top_makefile, "srcdir" ); + tools_dir = get_expanded_make_variable( top_makefile, "TOOLSDIR" ); + tools_ext = get_expanded_make_variable( top_makefile, "TOOLSEXT" ); + 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" ); + + if (root_src_dir && !strcmp( root_src_dir, "." )) root_src_dir = NULL; + if (tools_dir && !strcmp( tools_dir, "." )) tools_dir = NULL; + 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] ); return 0; } diff -Nru wine1.7-1.7.14/tools/make_makefiles wine1.7-1.7.18/tools/make_makefiles --- wine1.7-1.7.14/tools/make_makefiles 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/tools/make_makefiles 2014-05-02 18:15:48.000000000 +0000 @@ -448,6 +448,7 @@ my $parent = get_parent_makefile( $file ); next unless $parent; preserve_shared_source_files( $makefiles{$file}, $makefiles{$parent}, "C_SRCS" ); + preserve_shared_source_files( $makefiles{$file}, $makefiles{$parent}, "IDL_SRCS" ); preserve_shared_source_files( $makefiles{$file}, $makefiles{$parent}, "LEX_SRCS" ); preserve_shared_source_files( $makefiles{$file}, $makefiles{$parent}, "BISON_SRCS" ); } diff -Nru wine1.7-1.7.14/tools/make_specfiles wine1.7-1.7.18/tools/make_specfiles --- wine1.7-1.7.14/tools/make_specfiles 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/tools/make_specfiles 2014-05-02 18:15:48.000000000 +0000 @@ -28,13 +28,7 @@ ( [ "msvcrt", - "msvcr100", - "msvcr110", "msvcirt", - "msvcr90", - "msvcr80", - "msvcr71", - "msvcr70", "msvcrt40", "msvcrt20", "msvcrtd", diff -Nru wine1.7-1.7.14/tools/make_xftmpl.c wine1.7-1.7.18/tools/make_xftmpl.c --- wine1.7-1.7.14/tools/make_xftmpl.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/tools/make_xftmpl.c 2014-05-02 18:15:48.000000000 +0000 @@ -69,13 +69,6 @@ #define TOKEN_CSTRING 51 #define TOKEN_ARRAY 52 -struct parser -{ - FILE *infile; - FILE *outfile; - int line_no; -}; - struct keyword { const char *word; @@ -106,7 +99,10 @@ static char *option_inc_size_name = NULL; static const char *option_outfile_name = "-"; static char *program_name; +static FILE *infile; +static int line_no; static const char *infile_name; +static FILE *outfile; static BYTE *output_data; static UINT output_pos, output_size; @@ -114,15 +110,15 @@ #define __attribute__(x) #endif -static void fatal_error( struct parser *parser, const char *msg, ... ) __attribute__ ((__format__ (__printf__, 2, 3))); +static void fatal_error( const char *msg, ... ) __attribute__ ((__format__ (__printf__, 1, 2))); -static void fatal_error( struct parser *parser, const char *msg, ... ) +static void fatal_error( const char *msg, ... ) { va_list valist; va_start( valist, msg ); if (infile_name) { - fprintf( stderr, "%s:%d:", infile_name, parser->line_no ); + fprintf( stderr, "%s:%d:", infile_name, line_no ); fprintf( stderr, " error: " ); } else fprintf( stderr, "%s: error: ", program_name ); @@ -132,43 +128,43 @@ } -static inline BOOL read_byte(struct parser *parser, char *byte) +static inline BOOL read_byte( char *byte ) { - int c = fgetc(parser->infile); + int c = fgetc(infile); *byte = c; - if (c == '\n') parser->line_no++; + if (c == '\n') line_no++; return c != EOF; } -static inline BOOL unread_byte(struct parser *parser, char last_byte) +static inline BOOL unread_byte( char last_byte ) { - if (last_byte == '\n') parser->line_no--; - return ungetc(last_byte, parser->infile) != EOF; + if (last_byte == '\n') line_no--; + return ungetc(last_byte, infile) != EOF; } -static inline BOOL read_bytes(struct parser *parser, void *data, DWORD size) +static inline BOOL read_bytes( void *data, DWORD size ) { - return fread(data, size, 1, parser->infile) > 0; + return fread(data, size, 1, infile) > 0; } -static BOOL write_c_hex_bytes(struct parser *parser) +static BOOL write_c_hex_bytes(void) { UINT i; for (i = 0; i < output_pos; i++) { if (i % 12 == 0) - fprintf(parser->outfile, "\n "); - fprintf(parser->outfile, " 0x%02x,", output_data[i]); + fprintf(outfile, "\n "); + fprintf(outfile, " 0x%02x,", output_data[i]); } return TRUE; } -static BOOL write_raw_bytes(struct parser *parser) +static BOOL write_raw_bytes(void) { - return fwrite(output_data, output_pos, 1, parser->outfile) > 0; + return fwrite(output_data, output_pos, 1, outfile) > 0; } -static inline BOOL write_bytes(struct parser *parser, const void *data, DWORD size) +static inline BOOL write_bytes(const void *data, DWORD size) { if (output_pos + size > output_size) { @@ -181,19 +177,36 @@ return TRUE; } -static inline BOOL write_byte(struct parser *parser, BYTE value) +static inline BOOL write_byte(BYTE value) +{ + return write_bytes( &value, sizeof(value) ); +} + +static inline BOOL write_word(WORD value) +{ + return write_byte( value ) && + write_byte( value >> 8 ); +} + +static inline BOOL write_dword(DWORD value) { - return write_bytes(parser, &value, sizeof(value)); + return write_word( value ) && + write_word( value >> 16 ); } -static inline BOOL write_word(struct parser *parser, WORD value) +static inline BOOL write_float(float value) { - return write_bytes(parser, &value, sizeof(value)); + DWORD val; + memcpy( &val, &value, sizeof(value) ); + return write_dword( val ); } -static inline BOOL write_dword(struct parser *parser, DWORD value) +static inline BOOL write_guid(const GUID *guid) { - return write_bytes(parser, &value, sizeof(value)); + return write_dword( guid->Data1 ) && + write_word( guid->Data2 ) && + write_word( guid->Data3 ) && + write_bytes( guid->Data4, sizeof(guid->Data4) ); } static int compare_names(const void *a, const void *b) @@ -201,7 +214,7 @@ return strcasecmp(*(const char **)a, *(const char **)b); } -static BOOL parse_keyword(struct parser *parser, const char *name) +static BOOL parse_keyword( const char *name ) { const struct keyword *keyword; @@ -210,10 +223,10 @@ if (!keyword) return FALSE; - return write_word(parser, keyword->token); + return write_word(keyword->token); } -static BOOL parse_guid(struct parser *parser) +static BOOL parse_guid(void) { char buf[39]; GUID guid; @@ -222,11 +235,11 @@ static const char *guidfmt = "<%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X>"; buf[0] = '<'; - if (!read_bytes(parser, buf + 1, 37)) fatal_error( parser, "truncated GUID\n" ); + if (!read_bytes(buf + 1, 37)) fatal_error( "truncated GUID\n" ); buf[38] = 0; ret = sscanf(buf, guidfmt, &guid.Data1, tab, tab+1, tab+2, tab+3, tab+4, tab+5, tab+6, tab+7, tab+8, tab+9); - if (ret != 11) fatal_error( parser, "invalid GUID '%s'\n", buf ); + if (ret != 11) fatal_error( "invalid GUID '%s'\n", buf ); guid.Data2 = tab[0]; guid.Data3 = tab[1]; @@ -239,35 +252,35 @@ guid.Data4[6] = tab[8]; guid.Data4[7] = tab[9]; - return write_word(parser, TOKEN_GUID) && - write_bytes(parser, &guid, sizeof(guid)); + return write_word(TOKEN_GUID) && + write_guid(&guid); } -static BOOL parse_name(struct parser *parser) +static BOOL parse_name(void) { char c; int len = 0; char name[512]; - while (read_byte(parser, &c) && len < sizeof(name) && + while (read_byte(&c) && len < sizeof(name) && (isalnum(c) || c == '_' || c == '-')) { if (len + 1 < sizeof(name)) name[len++] = c; } - unread_byte(parser, c); + unread_byte(c); name[len] = 0; - if (parse_keyword(parser, name)) { + if (parse_keyword(name)) { return TRUE; } else { - return write_word(parser, TOKEN_NAME) && - write_dword(parser, len) && - write_bytes(parser, name, len); + return write_word(TOKEN_NAME) && + write_dword(len) && + write_bytes(name, len); } } -static BOOL parse_number(struct parser *parser) +static BOOL parse_number(void) { int len = 0; char c; @@ -275,7 +288,7 @@ BOOL dot = FALSE; BOOL ret; - while (read_byte(parser, &c) && + while (read_byte(&c) && ((!len && c == '-') || (!dot && c == '.') || isdigit(c))) { if (len + 1 < sizeof(buffer)) @@ -283,33 +296,33 @@ if (c == '.') dot = TRUE; } - unread_byte(parser, c); + unread_byte(c); buffer[len] = 0; if (dot) { float value; ret = sscanf(buffer, "%f", &value); - if (!ret) fatal_error( parser, "invalid float token\n" ); - ret = write_word(parser, TOKEN_FLOAT) && - write_bytes(parser, &value, sizeof(value)); + if (!ret) fatal_error( "invalid float token\n" ); + ret = write_word(TOKEN_FLOAT) && + write_float(value); } else { int value; ret = sscanf(buffer, "%d", &value); - if (!ret) fatal_error( parser, "invalid integer token\n" ); - ret = write_word(parser, TOKEN_INTEGER) && - write_dword(parser, value); + if (!ret) fatal_error( "invalid integer token\n" ); + ret = write_word(TOKEN_INTEGER) && + write_dword(value); } return ret; } -static BOOL parse_token(struct parser *parser) +static BOOL parse_token(void) { char c; int len; char *tok, buffer[512]; - if (!read_byte(parser, &c)) + if (!read_byte(&c)) return FALSE; switch (c) @@ -320,27 +333,27 @@ case '\t': return TRUE; - case '{': return write_word(parser, TOKEN_OBRACE); - case '}': return write_word(parser, TOKEN_CBRACE); - case '[': return write_word(parser, TOKEN_OBRACKET); - case ']': return write_word(parser, TOKEN_CBRACKET); - case '(': return write_word(parser, TOKEN_OPAREN); - case ')': return write_word(parser, TOKEN_CPAREN); - case ',': return write_word(parser, TOKEN_COMMA); - case ';': return write_word(parser, TOKEN_SEMICOLON); - case '.': return write_word(parser, TOKEN_DOT); + case '{': return write_word(TOKEN_OBRACE); + case '}': return write_word(TOKEN_CBRACE); + case '[': return write_word(TOKEN_OBRACKET); + case ']': return write_word(TOKEN_CBRACKET); + case '(': return write_word(TOKEN_OPAREN); + case ')': return write_word(TOKEN_CPAREN); + case ',': return write_word(TOKEN_COMMA); + case ';': return write_word(TOKEN_SEMICOLON); + case '.': return write_word(TOKEN_DOT); case '/': - if (!read_byte(parser, &c) || c != '/') - fatal_error( parser, "invalid single '/' comment token\n" ); - while (read_byte(parser, &c) && c != '\n'); + if (!read_byte(&c) || c != '/') + fatal_error( "invalid single '/' comment token\n" ); + while (read_byte(&c) && c != '\n'); return c == '\n'; case '#': len = 0; - while (read_byte(parser, &c) && c != '\n') + while (read_byte(&c) && c != '\n') if (len + 1 < sizeof(buffer)) buffer[len++] = c; - if (c != '\n') fatal_error( parser, "line too long\n" ); + if (c != '\n') fatal_error( "line too long\n" ); buffer[len] = 0; tok = strtok( buffer, " \t" ); if (!tok || strcmp( tok, "pragma" )) return TRUE; @@ -361,28 +374,28 @@ return TRUE; case '<': - return parse_guid(parser); + return parse_guid(); case '"': len = 0; /* FIXME: Handle '\' (e.g. "valid\"string") */ - while (read_byte(parser, &c) && c != '"') { + while (read_byte(&c) && c != '"') { if (len + 1 < sizeof(buffer)) buffer[len++] = c; } - if (c != '"') fatal_error( parser, "unterminated string\n" ); - return write_word(parser, TOKEN_STRING) && - write_dword(parser, len) && - write_bytes(parser, buffer, len); + if (c != '"') fatal_error( "unterminated string\n" ); + return write_word(TOKEN_STRING) && + write_dword(len) && + write_bytes(buffer, len); default: - unread_byte(parser, c); + unread_byte(c); if (isdigit(c) || c == '-') - return parse_number(parser); + return parse_number(); if (isalpha(c) || c == '_') - return parse_name(parser); - fatal_error( parser, "invalid character '%c' to start token\n", c ); + return parse_name(); + fatal_error( "invalid character '%c' to start token\n", c ); } return TRUE; @@ -443,7 +456,6 @@ int main(int argc, char **argv) { char header[16]; - struct parser parser; char **args; char *header_name = NULL; @@ -457,17 +469,17 @@ return 1; } - parser.infile = stdin; - parser.outfile = NULL; + infile = stdin; + outfile = NULL; if (!strcmp(infile_name, "-")) { infile_name = "stdin"; - } else if (!(parser.infile = fopen(infile_name, "rb"))) { + } else if (!(infile = fopen(infile_name, "rb"))) { perror(infile_name); goto error; } - if (!read_bytes(&parser, header, sizeof(header))) { + if (!read_bytes(header, sizeof(header))) { fprintf(stderr, "%s: Failed to read file header\n", program_name); goto error; } @@ -496,7 +508,7 @@ if (!strcmp(option_outfile_name, "-")) { option_outfile_name = "stdout"; - parser.outfile = stdout; + outfile = stdout; } else { output_file = option_outfile_name; atexit(cleanup_files); @@ -505,19 +517,19 @@ #ifdef SIGHUP signal(SIGHUP, exit_on_signal); #endif - if (!(parser.outfile = fopen(output_file, "wb"))) { + if (!(outfile = fopen(output_file, "wb"))) { perror(option_outfile_name); goto error; } } - if (!write_bytes(&parser, "xof 0302bin 0064", 16)) + if (!write_bytes("xof 0302bin 0064", 16)) goto error; - parser.line_no = 1; - while (parse_token(&parser)); + line_no = 1; + while (parse_token()); - if (ferror(parser.outfile) || ferror(parser.infile)) + if (ferror(outfile) || ferror(infile)) goto error; if (option_header) @@ -525,7 +537,7 @@ char *str_ptr; if (!option_inc_var_name) - fatal_error( &parser, "variable name must be specified with -i or #pragma name\n" ); + fatal_error( "variable name must be specified with -i or #pragma name\n" ); header_name = strrchr(option_outfile_name, '/'); if (header_name) @@ -546,7 +558,7 @@ str_ptr++; } - fprintf(parser.outfile, + fprintf(outfile, "/* File generated automatically from %s; do not edit */\n" "\n" "#ifndef __WINE_%s\n" @@ -554,31 +566,31 @@ "\n" "unsigned char %s[] = {", infile_name, header_name, header_name, option_inc_var_name); - write_c_hex_bytes( &parser ); - fprintf(parser.outfile, "\n};\n\n"); + write_c_hex_bytes(); + fprintf(outfile, "\n};\n\n"); if (option_inc_size_name) - fprintf(parser.outfile, "#define %s %u\n\n", option_inc_size_name, output_pos); - fprintf(parser.outfile, "#endif /* __WINE_%s */\n", header_name); - if (ferror(parser.outfile)) + fprintf(outfile, "#define %s %u\n\n", option_inc_size_name, output_pos); + fprintf(outfile, "#endif /* __WINE_%s */\n", header_name); + if (ferror(outfile)) goto error; } - else write_raw_bytes( &parser ); + else write_raw_bytes(); - fclose(parser.infile); - fclose(parser.outfile); + fclose(infile); + fclose(outfile); output_file = NULL; return 0; error: - if (parser.infile) { - if (ferror(parser.infile)) + if (infile) { + if (ferror(infile)) perror(infile_name); - fclose(parser.infile); + fclose(infile); } - if (parser.outfile) { - if (ferror(parser.outfile)) + if (outfile) { + if (ferror(outfile)) perror(option_outfile_name); - fclose(parser.outfile); + fclose(outfile); } return 1; } diff -Nru wine1.7-1.7.14/tools/widl/header.c wine1.7-1.7.18/tools/widl/header.c --- wine1.7-1.7.14/tools/widl/header.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/tools/widl/header.c 2014-05-02 18:15:48.000000000 +0000 @@ -109,16 +109,6 @@ return 0; } -int is_void(const type_t *t) -{ - return type_get_type(t) == TYPE_VOID; -} - -int is_conformant_array(const type_t *t) -{ - return is_array(t) && type_array_has_conformance(t); -} - static void write_guid(FILE *f, const char *guid_prefix, const char *name, const UUID *uuid) { if (!uuid) return; diff -Nru wine1.7-1.7.14/tools/widl/header.h wine1.7-1.7.18/tools/widl/header.h --- wine1.7-1.7.14/tools/widl/header.h 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/tools/widl/header.h 2014-05-02 18:15:48.000000000 +0000 @@ -28,9 +28,6 @@ extern int is_attr(const attr_list_t *list, enum attr_type t); extern void *get_attrp(const attr_list_t *list, enum attr_type t); extern unsigned int get_attrv(const attr_list_t *list, enum attr_type t); -extern int is_void(const type_t *t); -extern int is_conformant_array(const type_t *t); -extern int is_declptr(const type_t *t); extern const char* get_name(const var_t *v); extern void write_type_left(FILE *h, type_t *t, int declonly); extern void write_type_right(FILE *h, type_t *t, int is_field); @@ -58,6 +55,31 @@ extern int has_out_arg_or_return(const var_t *func); extern int is_const_decl(const var_t *var); +static inline int is_ptr(const type_t *t) +{ + return type_get_type(t) == TYPE_POINTER; +} + +static inline int is_array(const type_t *t) +{ + return type_get_type(t) == TYPE_ARRAY; +} + +static inline int is_void(const type_t *t) +{ + return type_get_type(t) == TYPE_VOID; +} + +static inline int is_declptr(const type_t *t) +{ + return is_ptr(t) || (type_get_type(t) == TYPE_ARRAY && type_array_is_decl_as_ptr(t)); +} + +static inline int is_conformant_array(const type_t *t) +{ + return is_array(t) && type_array_has_conformance(t); +} + static inline int last_ptr(const type_t *type) { return is_ptr(type) && !is_declptr(type_pointer_get_ref(type)); diff -Nru wine1.7-1.7.14/tools/widl/typegen.c wine1.7-1.7.18/tools/widl/typegen.c --- wine1.7-1.7.14/tools/widl/typegen.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/tools/widl/typegen.c 2014-05-02 18:15:48.000000000 +0000 @@ -85,6 +85,8 @@ static unsigned int field_memsize(const type_t *type, unsigned int *offset); static unsigned int fields_memsize(const var_list_t *fields, unsigned int *align); static unsigned int type_memsize_and_alignment(const type_t *t, unsigned int *align); +static unsigned int write_array_tfs(FILE *file, const attr_list_t *attrs, type_t *type, + const char *name, unsigned int *typestring_offset); static unsigned int write_struct_tfs(FILE *file, type_t *type, const char *name, unsigned int *tfsoff); static int write_embedded_types(FILE *file, const attr_list_t *attrs, type_t *type, const char *name, int write_ptr, unsigned int *tfsoff); @@ -860,7 +862,7 @@ do { \ if (file) \ fprintf(file, "/* %2u */\n", typestring_offset); \ - print_file((file), 2, "0x%02x, /* " #fctype " */\n", RPC_##fctype); \ + print_file((file), 2, "0x%02x,\t/* " #fctype " */\n", RPC_##fctype); \ } \ while (0) @@ -1447,8 +1449,8 @@ if (!is_new_style) { print_file(file, 0, "/* %u (void) */\n", *offset); - print_file(file, indent, "0x5b, /* FC_END */\n"); - print_file(file, indent, "0x5c, /* FC_PAD */\n"); + print_file(file, indent, "0x5b,\t/* FC_END */\n"); + print_file(file, indent, "0x5c,\t/* FC_PAD */\n"); *offset += 2; } } @@ -2316,7 +2318,7 @@ error("Unsupported member type %d\n", type_get_type(type)); } -static void write_array_element_type(FILE *file, const type_t *type, +static void write_array_element_type(FILE *file, const attr_list_t *attrs, const type_t *type, int cont_is_complex, unsigned int *tfsoff) { type_t *elem = type_array_get_element(type); @@ -2331,7 +2333,7 @@ ref->typestring_offset, tfsoff); return; } - if (cont_is_complex && is_string_type(NULL, elem)) + if (cont_is_complex && is_string_type(attrs, elem)) { write_string_tfs(file, NULL, elem, TYPE_CONTEXT_CONTAINER, NULL, tfsoff); return; @@ -2350,10 +2352,10 @@ { if (*tfsoff % 2 == 0) { - print_file(file, 2, "0x%x,\t\t/* FC_PAD */\n", RPC_FC_PAD); + print_file(file, 2, "0x%x,\t/* FC_PAD */\n", RPC_FC_PAD); *tfsoff += 1; } - print_file(file, 2, "0x%x,\t\t/* FC_END */\n", RPC_FC_END); + print_file(file, 2, "0x%x,\t/* FC_END */\n", RPC_FC_END); *tfsoff += 1; } @@ -2728,7 +2730,7 @@ return pointer_count; } -static void write_pointer_description(FILE *file, type_t *type, +static void write_pointer_description(FILE *file, const attr_list_t *attrs, type_t *type, unsigned int *typestring_offset) { unsigned int offset_in_buffer; @@ -2757,7 +2759,7 @@ if (is_conformant_array(type) && (type_array_is_decl_as_ptr(type) || !current_structure)) write_conformant_array_pointer_descriptions( - file, NULL, type, 0, typestring_offset); + file, attrs, type, 0, typestring_offset); else if (type_get_type(type) == TYPE_STRUCT && get_struct_fc(type) == RPC_FC_CPSTRUCT) { @@ -2774,11 +2776,6 @@ &offset_in_memory, &offset_in_buffer, typestring_offset); } -int is_declptr(const type_t *t) -{ - return is_ptr(t) || (type_get_type(t) == TYPE_ARRAY && type_array_is_decl_as_ptr(t)); -} - static unsigned int write_string_tfs(FILE *file, const attr_list_t *attrs, type_t *type, enum type_context context, const char *name, unsigned int *typestring_offset) @@ -2814,6 +2811,9 @@ else elem_type = type_pointer_get_ref(type); + if (type_get_type(elem_type) == TYPE_POINTER && is_array(type)) + return write_array_tfs(file, attrs, type, name, typestring_offset); + if (type_get_type(elem_type) != TYPE_BASIC) { error("write_string_tfs: Unimplemented for non-basic type %s\n", name); @@ -2842,7 +2842,7 @@ WRITE_FCTYPE(file, FC_WSTRING, *typestring_offset); else WRITE_FCTYPE(file, FC_CSTRING, *typestring_offset); - print_file(file, 2, "0x%x, /* FC_PAD */\n", RPC_FC_PAD); + print_file(file, 2, "0x%x,\t/* FC_PAD */\n", RPC_FC_PAD); *typestring_offset += 2; print_file(file, 2, "NdrFcShort(0x%hx),\t/* %d */\n", (unsigned short)dim, dim); @@ -2857,7 +2857,7 @@ WRITE_FCTYPE(file, FC_C_WSTRING, *typestring_offset); else WRITE_FCTYPE(file, FC_C_CSTRING, *typestring_offset); - print_file(file, 2, "0x%x, /* FC_STRING_SIZED */\n", RPC_FC_STRING_SIZED); + print_file(file, 2, "0x%x,\t/* FC_STRING_SIZED */\n", RPC_FC_STRING_SIZED); *typestring_offset += 2; *typestring_offset += write_conf_or_var_desc( @@ -2878,7 +2878,7 @@ WRITE_FCTYPE(file, FC_C_WSTRING, *typestring_offset); else WRITE_FCTYPE(file, FC_C_CSTRING, *typestring_offset); - print_file(file, 2, "0x%x, /* FC_PAD */\n", RPC_FC_PAD); + print_file(file, 2, "0x%x,\t/* FC_PAD */\n", RPC_FC_PAD); *typestring_offset += 2; update_tfsoff(type, start_offset, file); @@ -2904,7 +2904,8 @@ if (!pointer_type) pointer_type = RPC_FC_RP; - write_embedded_types(file, attrs, type_array_get_element(type), name, FALSE, typestring_offset); + if (!is_string_type(attrs, type_array_get_element(type))) + write_embedded_types(file, attrs, type_array_get_element(type), name, FALSE, typestring_offset); size = type_memsize(is_conformant_array(type) ? type_array_get_element(type) : type); align = type_buffer_alignment(is_conformant_array(type) ? type_array_get_element(type) : type); @@ -2964,15 +2965,15 @@ if (type_has_pointers(type_array_get_element(type)) && (type_array_is_decl_as_ptr(type) || !current_structure)) { - print_file(file, 2, "0x%x, /* FC_PP */\n", RPC_FC_PP); - print_file(file, 2, "0x%x, /* FC_PAD */\n", RPC_FC_PAD); + print_file(file, 2, "0x%x,\t/* FC_PP */\n", RPC_FC_PP); + print_file(file, 2, "0x%x,\t/* FC_PAD */\n", RPC_FC_PAD); *typestring_offset += 2; - write_pointer_description(file, type, typestring_offset); - print_file(file, 2, "0x%x, /* FC_END */\n", RPC_FC_END); + write_pointer_description(file, is_string_type(attrs, type) ? attrs : NULL, type, typestring_offset); + print_file(file, 2, "0x%x,\t/* FC_END */\n", RPC_FC_END); *typestring_offset += 1; } - write_array_element_type(file, type, FALSE, typestring_offset); + write_array_element_type(file, is_string_type(attrs, type) ? attrs : NULL, type, FALSE, typestring_offset); write_end(file, typestring_offset); } else @@ -2987,7 +2988,7 @@ += write_conf_or_var_desc(file, current_structure, baseoff, type, length_is); - write_array_element_type(file, type, TRUE, typestring_offset); + write_array_element_type(file, is_string_type(attrs, type) ? attrs : NULL, type, TRUE, typestring_offset); write_end(file, typestring_offset); } @@ -3151,11 +3152,11 @@ (fc == RPC_FC_CPSTRUCT) || (fc == RPC_FC_CVSTRUCT && type_has_pointers(type))) { - print_file(file, 2, "0x%x, /* FC_PP */\n", RPC_FC_PP); - print_file(file, 2, "0x%x, /* FC_PAD */\n", RPC_FC_PAD); + print_file(file, 2, "0x%x,\t/* FC_PP */\n", RPC_FC_PP); + print_file(file, 2, "0x%x,\t/* FC_PAD */\n", RPC_FC_PAD); *tfsoff += 2; - write_pointer_description(file, type, tfsoff); - print_file(file, 2, "0x%x, /* FC_END */\n", RPC_FC_END); + write_pointer_description(file, NULL, type, tfsoff); + print_file(file, 2, "0x%x,\t/* FC_END */\n", RPC_FC_END); *tfsoff += 1; } @@ -3586,12 +3587,26 @@ case TGT_POINTER: { enum type_context ref_context; + type_t *ref = type_pointer_get_ref(type); + if (context == TYPE_CONTEXT_TOPLEVELPARAM) ref_context = TYPE_CONTEXT_PARAM; else if (context == TYPE_CONTEXT_CONTAINER_NO_POINTERS) ref_context = TYPE_CONTEXT_CONTAINER; else ref_context = context; + + if (is_string_type(attrs, ref)) + { + if (context != TYPE_CONTEXT_CONTAINER_NO_POINTERS) + write_pointer_tfs(file, attrs, type, *typeformat_offset + 4, context, typeformat_offset); + + offset = write_type_tfs(file, indent, attrs, ref, name, ref_context, typeformat_offset); + if (context == TYPE_CONTEXT_CONTAINER_NO_POINTERS) + return 0; + return offset; + } + offset = write_type_tfs( file, indent, attrs, type_pointer_get_ref(type), name, ref_context, typeformat_offset); if (context == TYPE_CONTEXT_CONTAINER_NO_POINTERS) diff -Nru wine1.7-1.7.14/tools/widl/typelib.c wine1.7-1.7.18/tools/widl/typelib.c --- wine1.7-1.7.14/tools/widl/typelib.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/tools/widl/typelib.c 2014-05-02 18:15:48.000000000 +0000 @@ -49,16 +49,6 @@ static typelib_t *typelib; -int is_ptr(const type_t *t) -{ - return type_get_type(t) == TYPE_POINTER; -} - -int is_array(const type_t *t) -{ - return type_get_type(t) == TYPE_ARRAY; -} - /* List of oleauto types that should be recognized by name. * (most of) these seem to be intrinsic types in mktyplib. * This table MUST be alphabetically sorted on the kw field. diff -Nru wine1.7-1.7.14/tools/widl/widltypes.h wine1.7-1.7.18/tools/widl/widltypes.h --- wine1.7-1.7.14/tools/widl/widltypes.h 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/tools/widl/widltypes.h 2014-05-02 18:15:48.000000000 +0000 @@ -544,9 +544,6 @@ void set_all_tfswrite(int val); void clear_all_offsets(void); -int is_ptr(const type_t *t); -int is_array(const type_t *t); - #define tsENUM 1 #define tsSTRUCT 2 #define tsUNION 3 diff -Nru wine1.7-1.7.14/tools/widl/write_msft.c wine1.7-1.7.18/tools/widl/write_msft.c --- wine1.7-1.7.14/tools/widl/write_msft.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/tools/widl/write_msft.c 2014-05-02 18:15:48.000000000 +0000 @@ -1191,6 +1191,8 @@ case VT_UINT: case VT_HRESULT: case VT_PTR: + case VT_UNKNOWN: + case VT_DISPATCH: { const unsigned int lv = get_ulong_val(*(const unsigned int *)value, vt); if((lv & 0x3ffffff) == lv) { @@ -1257,6 +1259,33 @@ return S_OK; } +/* It's possible to have a default value for pointer arguments too. + In this case default value has a referenced type, e.g. + 'LONG*' argument gets VT_I4, 'DOUBLE*' - VT_R8. IUnknown* and IDispatch* + are recognised too and stored as VT_UNKNOWN and VT_DISPATCH. + But IUnknown/IDispatch arguments can only have default value of 0 + (or expression that resolves to zero) while other pointers can have + any default value. */ +static int get_defaultvalue_vt(type_t *type) +{ + int vt = get_type_vt(type); + if (type_get_type(type) == TYPE_ENUM) + vt = VT_I4; + else + { + vt = get_type_vt(type); + if (vt == VT_PTR && is_ptr(type)) { + vt = get_type_vt(type_pointer_get_ref(type)); + /* The only acceptable value for pointers to non-basic types + is NULL, it's stored as VT_I4 for both 32 and 64 bit typelibs. */ + if (vt == VT_USERDEFINED) + vt = VT_I4; + } + } + + return vt; +} + static HRESULT add_func_desc(msft_typeinfo_t* typeinfo, var_t *func, int index) { int offset, name_offset; @@ -1481,10 +1510,7 @@ { int vt; expr_t *expr = (expr_t *)attr->u.pval; - if (type_get_type(arg->type) == TYPE_ENUM) - vt = VT_INT; - else - vt = get_type_vt(arg->type); + vt = get_defaultvalue_vt(arg->type); paramflags |= 0x30; /* PARAMFLAG_FHASDEFAULT | PARAMFLAG_FOPT */ if (expr->type == EXPR_STRLIT || expr->type == EXPR_WSTRLIT) { @@ -2101,6 +2127,9 @@ var_t *cur; msft_typeinfo_t *msft_typeinfo; + if (-1 < enumeration->typelib_idx) + return; + enumeration->typelib_idx = typelib->typelib_header.nrtypeinfos; msft_typeinfo = create_msft_typeinfo(typelib, TKIND_ENUM, enumeration->name, enumeration->attrs); msft_typeinfo->typeinfo->size = 0; diff -Nru wine1.7-1.7.14/tools/winedump/tlb.c wine1.7-1.7.18/tools/winedump/tlb.c --- wine1.7-1.7.14/tools/winedump/tlb.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/tools/winedump/tlb.c 2014-05-02 18:15:48.000000000 +0000 @@ -44,6 +44,61 @@ TKIND_MAX }; +enum VARENUM { + VT_EMPTY = 0, + VT_NULL = 1, + VT_I2 = 2, + VT_I4 = 3, + VT_R4 = 4, + VT_R8 = 5, + VT_CY = 6, + VT_DATE = 7, + VT_BSTR = 8, + VT_DISPATCH = 9, + VT_ERROR = 10, + VT_BOOL = 11, + VT_VARIANT = 12, + VT_UNKNOWN = 13, + VT_DECIMAL = 14, + VT_I1 = 16, + VT_UI1 = 17, + VT_UI2 = 18, + VT_UI4 = 19, + VT_I8 = 20, + VT_UI8 = 21, + VT_INT = 22, + VT_UINT = 23, + VT_VOID = 24, + VT_HRESULT = 25, + VT_PTR = 26, + VT_SAFEARRAY = 27, + VT_CARRAY = 28, + VT_USERDEFINED = 29, + VT_LPSTR = 30, + VT_LPWSTR = 31, + VT_RECORD = 36, + VT_INT_PTR = 37, + VT_UINT_PTR = 38, + VT_FILETIME = 64, + VT_BLOB = 65, + VT_STREAM = 66, + VT_STORAGE = 67, + VT_STREAMED_OBJECT = 68, + VT_STORED_OBJECT = 69, + VT_BLOB_OBJECT = 70, + VT_CF = 71, + VT_CLSID = 72, + VT_VERSIONED_STREAM = 73, + VT_BSTR_BLOB = 0xfff, + VT_VECTOR = 0x1000, + VT_ARRAY = 0x2000, + VT_BYREF = 0x4000, + VT_RESERVED = 0x8000, + VT_ILLEGAL = 0xffff, + VT_ILLEGALMASKED = 0xfff, + VT_TYPEMASK = 0xfff +}; + struct seg_t; typedef BOOL (*dump_seg_t)(struct seg_t*); @@ -54,6 +109,25 @@ int offset; int length; } seg_t; +static seg_t segdir[]; + +enum SEGDIRTYPE { + SEGDIR_TYPEINFO, + SEGDIR_IMPINFO, + SEGDIR_IMPFILES, + SEGDIR_REF, + SEGDIR_GUIDHASH, + SEGDIR_GUID, + SEGDIR_NAMEHASH, + SEGDIR_NAME, + SEGDIR_STRING, + SEGDIR_TYPEDESC, + SEGDIR_ARRAYDESC, + SEGDIR_CUSTDATA, + SEGDIR_CDGUID, + SEGDIR_res0e, + SEGDIR_res0f +}; static int offset=0; static int indent; @@ -172,6 +246,25 @@ guid.Data4[5], guid.Data4[6], guid.Data4[7]); } +static void print_vartype(int vartype) +{ + static const char *vartypes[VT_LPWSTR+1] = { + "VT_EMPTY", "VT_NULL", "VT_I2", "VT_I4", "VT_R4", + "VT_R8", "VT_CY", "VT_DATE", "VT_BSTR", "VT_DISPATCH", + "VT_ERROR", "VT_BOOL", "VT_VARIANT", "VT_UNKNOWN","VT_DECIMAL", + "unk 15", "VT_I1", "VT_UI1", "VT_UI2", "VT_UI4", + "VT_I8", "VT_UI8", "VT_INT", "VT_UINT", "VT_VOID", + "VT_HRESULT", "VT_PTR", "VT_SAFEARRAY","VT_CARRAY", "VT_USERDEFINED", + "VT_LPSTR", "VT_LPWSTR" + }; + + vartype &= VT_TYPEMASK; + if (vartype >= VT_EMPTY && vartype <= VT_LPWSTR) + printf("%s\n", vartypes[vartype]); + else + printf("unk %d\n", vartype); +} + static void print_ctl2(const char *name) { int len; @@ -214,6 +307,29 @@ printf("\n"); } +static int dump_msft_varflags(void) +{ + static const char *syskind[] = { + "SYS_WIN16", "SYS_WIN32", "SYS_MAC", "SYS_WIN64", "unknown" + }; + int kind, flags; + + print_offset(); + flags = tlb_read_int(); + kind = flags & 0xf; + if (kind > 3) kind = 4; + printf("varflags = %08x, syskind = %s\n", flags, syskind[kind]); + return flags; +} + +static void dump_msft_version(void) +{ + int version; + print_offset(); + version = tlb_read_int(); + printf("version = %d.%d\n", version & 0xff, version >> 16); +} + static void dump_msft_header(void) { print_begin_block("Header"); @@ -222,15 +338,15 @@ print_hex("magic2"); print_hex("posguid"); print_hex("lcid"); - print_hex("lsid2"); - header_flags = print_hex("varflags"); - print_hex("version"); + print_hex("lcid2"); + header_flags = dump_msft_varflags(); + dump_msft_version(); print_hex("flags"); typeinfo_cnt = print_dec("ntypeinfos"); - print_hex("helpstring"); - print_hex("helpstringcontext"); - print_hex("helpcontext"); - print_dec("nametablecont"); + print_dec("helpstring"); + print_dec("helpstringcontext"); + print_dec("helpcontext"); + print_dec("nametablecount"); print_dec("nametablechars"); print_hex("NameOffset"); print_hex("helpfile"); @@ -243,11 +359,27 @@ print_end_block(); } +static int dump_msft_typekind(void) +{ + static const char *tkind[TKIND_MAX] = { + "TKIND_ENUM", "TKIND_RECORD", "TKIND_MODULE", + "TKIND_INTERFACE", "TKIND_DISPATCH", "TKIND_COCLASS", + "TKIND_ALIAS", "TKIND_UNION" + }; + int ret, typekind; + + print_offset(); + ret = tlb_read_int(); + typekind = ret & 0xf; + printf("typekind = %s, align = %d\n", typekind < TKIND_MAX ? tkind[typekind] : "unknown", (ret >> 11) & 0x1f); + return ret; +} + static void dump_msft_typeinfobase(void) { print_begin_block_id("TypeInfoBase", msft_typeinfo_cnt); - msft_typeinfo_kind[msft_typeinfo_cnt] = print_hex("typekind"); + msft_typeinfo_kind[msft_typeinfo_cnt] = dump_msft_typekind(); msft_typeinfo_offs[msft_typeinfo_cnt] = print_hex("memoffset"); print_hex("res2"); print_hex("res3"); @@ -508,7 +640,7 @@ n = tlb_read_int(); switch(vt) { - case 8 /* VT_BSTR */: + case VT_BSTR: printf(" len %d: ", n); dump_string(n, 2); printf("\n"); @@ -563,6 +695,75 @@ return TRUE; } +/* Used for function return value and arguments type */ +static void dump_msft_datatype(const char *name) +{ + int datatype; + + print_offset(); + datatype = tlb_read_int(); + printf("%s = %08x", name, datatype); + if (datatype < 0) { + printf(", "); + print_vartype(datatype); + } + else { + const short *vt; + + if (datatype > segdir[SEGDIR_TYPEDESC].length) { + printf(", invalid offset\n"); + return; + } + + /* FIXME: in case of VT_USERDEFINED use hreftype */ + vt = PRD(segdir[SEGDIR_TYPEDESC].offset + datatype, 4*sizeof(short)); + datatype = vt[0] & VT_TYPEMASK; + if (datatype == VT_PTR) { + printf(", VT_PTR -> "); + if (vt[3] < 0) + datatype = vt[2]; + else { + vt = PRD(segdir[SEGDIR_TYPEDESC].offset + vt[2], 4*sizeof(short)); + datatype = *vt; + } + } + else { + printf(", "); + datatype = *vt; + } + + print_vartype(datatype); + } +} + +static void dump_defaultvalue(int id) +{ + int offset; + + print_offset(); + offset = tlb_read_int(); + + printf("default value[%d] = %08x", id, offset); + if (offset == -1) + printf("\n"); + else if (offset < 0) { + printf(", "); + print_vartype((offset & 0x7c000000) >> 26); + } + else { + const unsigned short *vt; + + if (offset > segdir[SEGDIR_CUSTDATA].length) { + printf(", invalid offset\n"); + return; + } + + vt = PRD(segdir[SEGDIR_CUSTDATA].offset + offset, sizeof(*vt)); + printf(", "); + print_vartype(*vt); + } +} + static void dump_msft_func(int n) { int size, args_cnt, i, extra_attr, fkccic; @@ -571,7 +772,7 @@ size = print_short_hex("size"); print_short_hex("index"); - print_hex("DataType"); + dump_msft_datatype("retval type"); print_hex("flags"); print_short_hex("VtableOffset"); print_short_hex("funcdescsize"); @@ -600,16 +801,16 @@ if(fkccic & 0x1000) { for(i=0; i < args_cnt; i++) - print_hex_id("default value[%d]", i); + dump_defaultvalue(i); } for(i=0; i < args_cnt; i++) { print_begin_block_id("param", i); /* FIXME: Handle default values */ - print_hex("data[0]"); + dump_msft_datatype("datatype"); + print_hex("name"); print_hex("paramflags"); - print_hex("data[2]"); print_end_block(); } diff -Nru wine1.7-1.7.14/tools/winegcc/winegcc.c wine1.7-1.7.18/tools/winegcc/winegcc.c --- wine1.7-1.7.14/tools/winegcc/winegcc.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/tools/winegcc/winegcc.c 2014-05-02 18:15:48.000000000 +0000 @@ -926,7 +926,8 @@ if (opts->image_base) strarray_add(link_args, strmake("-Wl,--image-base,%s", opts->image_base)); - if (opts->large_address_aware) strarray_add( link_args, "-Wl,--large-address-aware" ); + if (opts->large_address_aware && opts->target_cpu == CPU_x86) + strarray_add( link_args, "-Wl,--large-address-aware" ); if (opts->unicode_app && !opts->shared) strarray_add(link_args, mingw_unicode_hack(opts)); diff -Nru wine1.7-1.7.14/tools/wrc/genres.c wine1.7-1.7.18/tools/wrc/genres.c --- wine1.7-1.7.14/tools/wrc/genres.c 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/tools/wrc/genres.c 2014-05-02 18:15:48.000000000 +0000 @@ -682,6 +682,7 @@ } put_string(res, dlg->font->name, str_unicode, TRUE, dlg->lvc.language); } + else if (dlg->style->or_mask & DS_SETFONT) put_word( res, 0x7fff ); put_pad(res); while(ctrl) diff -Nru wine1.7-1.7.14/VERSION wine1.7-1.7.18/VERSION --- wine1.7-1.7.14/VERSION 2014-03-07 20:03:23.000000000 +0000 +++ wine1.7-1.7.18/VERSION 2014-05-02 18:15:48.000000000 +0000 @@ -1 +1 @@ -Wine version 1.7.14 +Wine version 1.7.18