diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/ANNOUNCE wine-compholio-1.7.22~ubuntu13.10.1/ANNOUNCE --- wine-compholio-1.7.21~ubuntu13.10.1/ANNOUNCE 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/ANNOUNCE 2014-07-11 19:15:41.000000000 +0000 @@ -1,16 +1,16 @@ -The Wine development release 1.7.21 is now available. +The Wine development release 1.7.22 is now available. What's new in this release (see below for details): - - Support for critical sections in the C runtime. - - Unicode data updated to Unicode 7.0. - - Support for interlaced PNG encoding. - - Initial stub for the Packager library. + - Support for Unicode bracketing pairs. + - Improved Internet cookie support. + - OS X CoreAudio driver uses AUHAL instead of AudioQueue. + - Initial support for geographical information. - Various bug fixes. The source is available from the following locations: - http://prdownloads.sourceforge.net/wine/wine-1.7.21.tar.bz2 - http://mirrors.ibiblio.org/wine/source/1.7/wine-1.7.21.tar.bz2 + http://prdownloads.sourceforge.net/wine/wine-1.7.22.tar.bz2 + http://mirrors.ibiblio.org/wine/source/1.7/wine-1.7.22.tar.bz2 Binary packages for various distributions will be available from: @@ -26,316 +26,232 @@ ---------------------------------------------------------------- -Bugs fixed in 1.7.21 (total 77): +Bugs fixed in 1.7.22 (total 68): - 9898 Virtual Moon Atlas 3.5 expert Mostly black drawing - 15478 Unity Web Player 2.1.0 doesn't show graphics in browser - 15600 Windows Live Writer crashes (IHTMLDocument2::put_designMode is a stub) - 17818 Runes of Magic menus like EULA or login doesn't appear on some graphic cards. - 18316 Word Pro: dashed "-" in parameters not resolved in command line - 19792 program "Antik Virtual set-top-box" crashes at startup - 19889 Steam client major lag - 20086 NewPGen: Doesn't restore from tray - 20497 Smilebox cannot be installed (web update fails) - 21116 page fault when running SoftwarePhoenix.BIOS.Editor.Pro.2.2.0.2.45094.exe - 21275 python's test_startfile test fails - 21521 Improper audio selection - 22091 Dragon Age Awakening/Mass Effect 2 installers crash with ntdll error - 22404 Unigine Heaven Benchmark 2.0 lacks shadows and smoke in Wine in d3d - 22697 wine iexplore browserchoice.eu is not displayed - 23219 AT4RE FastScanner v3.0 exe scanning bug - 23220 AT4RE FastScanner v3.0 UI button rectangle bug - 26504 Runes of Magic 3.0.x: "ClientUpdater.exe" crashes sometimes during updates on MD5 checksum processing (squirrel virtual machine) - 27113 Free download manager "Unknow network error" without native wininet - 27549 Frozen Synapse crash - 28756 ws2_32/tests/sock.ok: uninitialised value created in test_events(), used in get_cached_fd()? - 28824 shell32/tests/recyclebin.ok: uninitialised value used in TRASH_GetDetails - 29755 Deadlock during crash while installing gecko? - 29790 popo 2011 crash with builtin msvcrt - 29843 IE4 crashes on resetting profile sharing, needs shdocvw.dll.ResetProfileSharing - 30966 Firefox 13.0 improper region redrawing/user interface artifacts - 31349 Office 365 (Office 2013) web installer aborts early (needs support for string alias for common RID in sid strings) - 32000 ANSYS 14.0 tools crash on startup (missing system message text for 'WSAECONNRESET', error code 10054) - 32077 Runes of Magic 5.0.0.2535 (full client) crashes during update - 32150 Notepad .Net crashes doing nothing - 34215 Adobe Creative Cloud needs KERNEL32.dll.UnregisterApplicationRestart - 34525 Marine Benefit freezes in Stages 1-3 due to gstreamer error - 34828 Visual Studio 2010 fails to start (IWICBitmapFrameEncode_WriteSource_Proxy, empty rect) - 34847 The Swapper 2.0.x (GOG.com) crashes on startup (OpenGL glBindTexture on thread with no active gl context) - 34942 WinLaunch 0.4.6.1 (OSX Style free Launcher) needs support for WIC encoder "InterlaceOption" option (property bag) - 35466 Can't paste into search dialog of notepad - 35646 Multiple applications protected with Obsidium v1.4+ fail on startup, reporting "Debugger detected - please disable it and restart the application" (Condes 9, Universal mechanism) - 35948 Starcraft Campaign Editor displays incorrect numeric values when editing triggers - 36131 valgrind shows some multiple leaks in ole32/clipboard.c - 36185 comctl32/button tests shows an unitialized variable under valgrind - 36188 valgrind shows an invalid free for comctl32/tests/listview.c - 36240 valgrind shows several leaks in d3dx9_36/tests/asm.c - 36285 valgrind shows several leaks in kernel32/tests/debugger.c - 36287 valgrind shows some uninitialized memory use in kernel32/tests/format_msg.c - 36334 The Chosen (Well of Souls) demo has graphical glitches - 36350 valgrind shows a leak in d3dx9_36/tests/asm.c - 36351 valgrind shows a few leaks in d3drm/tests/d3drm.c - 36436 Popup menu is closed when clicking a sub-menu parent item twice. - 36487 Avast Free Antivirus fails to install, reporting 'HTMLayout.dll cannot be loaded to properly start GUI.' (EnumSystemLocalesEx fails to call user provided callback) - 36500 Multiple games and applications crash on unimplemented function msvcp110.dll._Mtx_init (Avast Free Antivirus, Trion's Trove MMO) - 36504 The XFORM matrix is calculated incorrectly in PlgBlt() - 36506 Wolfenstein - The New Order fails to start (glGetString(GL_VENDOR) without a current WGL context) - 36553 Tomb Raider Chronicles crashes in 32 bit color mode - 36572 valgrind shows a definite leak in shlwapi/tests/ordinal.c - 36593 valgrind shows a possible leak in windowscodecs/tests/bitmap.c - 36595 valgrind shows several memory leaks in windowscodecs/tests/metadata.c - 36596 valgrind shows a definite leak in windowscodecs/tests/propertybag.c - 36597 valgrind shows several definite leaks in user32/tests/msg.c - 36598 valgrind shows a definite leak in windowscodecs/tests/tiffformat.c - 36606 valgrind shows uninitialized memory use in ws2_32/tests/protocol.c - 36617 boost::wregex causes programs to crash - needs wcsxfrm() - 36647 Windows 7 USB/DVD download tool hangs on startup (DrawTextExW/TEXT_NextLineW live loop) - 36665 Adobe Acrobat Pro 8 freezes when using 'Combine files... and Create PDF / From multiple files' dialog - 36683 RPG Maker VX Ace 1.00: clicking menu item results in 'Out of memory' error message - 36702 PlayOn 3.9.13 installer reports 'Setup requires Windows Media Player 9 to be installed on this PC' (needs IWMPCore::get_versionInfo) - 36717 DeltaCad 8.0 crashes when trying to set printer or print - 36722 dmusic/tests/dmusic.c crashes under WINEDEBUG=warn+heap - 36736 Tucows Download Manager 2014 crashes on startup (decryption scheme relies on 'kernel32.dll.SetFilePointer' hotpatch signature) - 36737 Multiple Graviteam tank simulation games crash on start with built-in msvcr80 (small-block heap support needed) - 36745 Wine broken on FreeBSD+NFS - 36749 WinLaunch 0.4.6.1 (OSX Style free Launcher) fails to save theme (libpng png_write_end fails with 'No IDATs written into file') - 36757 Microsoft Visual Studio 2005 Express reports 'object does not support this action' during project creation (needs IFileSystem::GetDriveName method impl) - 36766 Jane Doe View build 140615 endlessly reports 'OLE Error 80004001' (JSGlobal_CollectGarbage stub returns E_NOTIMPL) - 36768 valgrind shows a couple invalid reads in windowscodecs/tests/tiffformat.c - 36782 valgrind shows a leak in kernel32/tests/thread.c - 36784 valgrind shows a leak in kernel32/tests/thread.c - 36790 ACDSee v17.0 needs unimplemented function msvcr110.dll.__crtInitializeCriticalSectionEx + 4122 Picasa 2.x/3.x: "Open File" from photo menu does nothing + 7404 ShowWindow(SW_MINIMIZE) should not generate a WM_PAINT message + 8284 Wild Earth: Photo Safari Demo: Freezes at a loading screen following main menu start game selection choices + 10182 Hapedit doesn't launch web browser + 10264 Multiple games wrapped with Tages Protection 5.x DRM scheme fail to start (Tages driver needs 'IoAllocateMdl' implementation) + 10480 Safari refuses to load secure URLs + 13075 Planetside crashes Character selection screen + 15353 Safari 3.1.2: crash when clicking on tab + 15520 DVD version of Riven fails to start. + 16648 Defense Grid, the Awakening: Fails to load, X3DAudio1_4.dll, d3dx9_38.dll + 19303 Sketchup 7 shows toolbars and menus, but work area is blank + 19838 Treeview 'access violation' in ImgBurn v2.5.0.0's Disc Layout Editor window + 21804 FPS Creator trial crashes on startup + 22698 mshtml: iexplore crash after click "Install" at www.browserchoice.eu + 22829 Sysinternals RAMMap crashes (shell32.CommandLineToArgvW needs to include terminating NULL element in returned array of pointers starting with WinVer >= Windows Vista) + 23210 REDCINE v20.0.0 silently exits during startup + 24286 Google SketchUp 8 crashes when using Phototextures feature + 24904 No$Zoomer.exe 2.3.x crashes when run. + 25110 PDF Password Cracker 3.2 Enterprise immediately page faults + 25916 MediaGet v1.12.x crashes when starting downloading file + 26166 Google Sketchup 8.0.4811 is not functional + 26635 SketchUp 8 cannot use the components tool + 27249 Edcast 3.1.21 fails on startup + 27259 progeCAD 10.x installer causes spurious 'winemenubuilder' hangs + 27487 Rift crashes on exit in winebrowser + 27878 Picasa 3.8 in Fedora 15 just displays a black window + 27880 Google Sketchup: moving tool windows: mouse button state not correct? + 28465 shlwapi/path.c test crashes if CFLAGS="-fstack-protector-all" is used + 28469 Lahore Trading Work Station crashes on startup + 28490 IE 3.02 installer crashes with builtin shdocvw - unimplemented function shdocvw.dll.InstallReg_RunDLL + 29159 Multiple apps and games fail due to 'HTTP_HttpOpenRequestW' being unable to escape some characters + 29191 Google Sketchup 8 - no scrollbar on template selection screen + 29408 Call to Power 1.2 crashes on startup + 30258 NIPO Odin Developer crashes on unimplemented function rpcrt4.dll.RpcSsDontSerializeContext + 30416 Live Baduk fails to start + 30829 Fallout 3: Game of the Year Edition (Steam) crashes on startup + 30865 Flash Player 11 "downloader" fails + 31048 Dolphin XPS Viewer crashes on load + 31224 Toribash 3.x/4.x crashes with hardware acceleration disabled in nouveau + 31269 Multiple .NET apps and games crash with System.OverflowException (incorrect scaling for DECIMAL values in VarDecAdd)(Dungeons, Space Engineers) + 31559 Planetside 2 (Beta), extremely low FPS + 31577 Avast! antivirus protection driver crashes on unimplemented function ntoskrnl.exe.ExCreateCallback + 31844 CitiesXL (all versions) needs native D3DXCreateSphere (purist) + 31966 Babylon 9 installer crashes + 32207 Planetside 2 (Beta) Crash when opening ingame Menus + 32415 Distance 6.x randomly crashes on startup + 32711 Multiple applications crash on unimplemented function ADVAPI32.dll.RegSetKeyValueA/W (Vista+ API)(BSAopt, Microsoft OneDrive) + 32912 Wine Crash following champion select + 33125 Tomb Raider (2013) freezes (bug in game engine, semaphore object handle value must be zero on all error paths) + 33529 Planetside 2 0.608.21.21306 crashed ingame + 34015 crash problem planetside 2 + 34069 "wine winemenubuilder" chokes on safari shortcut. + 34456 Rift installer crashes + 35395 Google SketchUp 8.2 draw pane freezes after save + 35703 Lingea Lexicon 5 crashes on start up + 36021 In the KDE Plasma desktop the mousepointer disappears in wine windows + 36435 Adobe Flash Builder 4.6 uses potentially erroneous shell32.dll PathYetAnotherMakeUniqueName stub + 36483 Multiple applications crash on unimplemented function ADVAPI32.dll.RegDeleteKeyValueA/W (Vista+ API)(Age of Mythology: Extended Edition) + 36641 valgrind shows several invalid reads in wininet/tests/http.c + 36651 shlwapi/tests/path.c: stack smashing detected (valgrind/gcc-4.9.0) + 36810 valgrind shows a definite leak in winspool.drv/tests/info.c + 36811 Avast! Free Antivirus 9.0.2013 'AvastSvc.exe' crashes on unimplemented function KERNEL32.dll.GetFirmwareEnvironmentVariableA + 36817 valgrind shows a mismatched free in msvcrt/tests/file.c + 36829 Can not recieve kindle delivery + 36832 winetricks ie7 / riched20/tests/editor.c crash + 36840 Tron 2.0 Demo crashes with "Out of memory" error + 36858 Wine 1.7.16 does not work correctly with Pacestar LanFlow + 36867 Localization bug in gdi32 font.c test ---------------------------------------------------------------- -Changes since 1.7.20: +Changes since 1.7.21: -Akihiro Sagawa (7): - winmm/tests: Activate some mmioSeek tests with todo_wine keyword. - winmm: Memory file buffer is available even if we just allocate memory. - winmm: Avoid direct seeking for memory files. - winmm: Update lBufOffset after seeking file directly. - winmm: Fix SEEK_END handling for memory files. - po: Update Japanese translation. - jscript: Improve CollectGarbage stub. - -Alex Henrie (1): - riched20: Consider adjacent runs when computing EN_LINK range. - -Alexander Almaleh (1): - gdi32: Fix XFORM.eM22 calculation in PlgBlt. - -Alexandre Julliard (10): - kernel32/tests: Silence some noisy traces. - gdi32/tests: Silence some noisy traces. - user32/tests: Silence some noisy traces. - user32: Properly block sent messages while waiting for a reply with SMTO_BLOCK. - krnl386: Properly handle failure to set a 16-bit LDT entry. - kernel32: Only try to load krnl386 in native applications. - msvcrt/tests: Avoid size_t in traces. - usp10: Update the character data tables to Unicode 7.0.0. - libwine: Update the codepage tables to Unicode 7.0.0. - opengl32: Make sure the function table is initialized in all threads. - -Andrew Eikum (8): - ole32: Implement CoTreatAsClass for classes without AutoTreatAs. - ole32: Respect TreatAs in CoCreateInstance. - packager: Add stub Packager implementation. - packager: Add loading support for Ole10Native storage objects. - packager: Implement IOleObject::SetClientSite. - packager: Implement IOleObject::GetMiscStatus. - packager: Implement Activate verb for OleObject::DoVerb. - packager: Implement IOleObject::Close. - -André Hentschel (1): - krnl386: Fix typo in a comment. - -Aurimas Fišeras (1): - po: Update Lithuanian translation. - -Austin English (3): - user32: Add a stub for SetGestureConfig. - kernel32: Add DECLSPEC_HOTPATCH to SetFilePointer. - kernel32: Add a stub for UnregisterApplicationRestart. +Akihiro Sagawa (1): + winmm: Fallback to SND_FILENAME if the alias isn't found in the profile. + +Alexandre Julliard (2): + configure: Always build wine.inf even if we don't install it. + tools: Don't include wine/unicode.h if not necessary. + +Andrew Eikum (3): + mmdevapi: Standardize period sizes. + mmdevapi: Don't stop sending event signals after IAudioClient::Stop. + winecoreaudio.drv: Use AUHAL API instead of AudioQueue. + +Aric Stewart (2): + tools: Generate the Unicode Bidi Bracketing table. + usp10: Implement N0: bracketing pairs. + +Austin English (5): + kernel32: Add stubs for GetFirmwareEnvironmentVariableA/W. + loader: Add WBEM installation directory key. + rpcrt4: Add a stub for RpcSsDontSerializeContext. + kernel32: Initialize return value in CreateSemaphoreExW. + advapi32: Fix a memory leak in test_process_security. Bruno Jesus (7): - ws2_32/tests: Wait for thread test before returning (valgrind). - ws2_32: Don't call WS_EnterSingleProtocol[A|W] on unsupported protocols (valgrind). - winhttp: Use a helper to send data and take care of EINTR. - winhttp: Use a helper to receive data and take care of EINTR. - wininet/tests: Add more HTTP_QUERY_RAW_HEADERS tests. - bcrypt: Add a stub for BCryptCloseAlgorithmProvider. - opengl32/tests: Test glGetString() without an active GL context. - -Christoph von Wittich (1): - shlwapi: Avoid buffer overflow in PathCombineA. - -François Gouget (8): - ole32: Fix StorageImpl_LockRegionSync() to actually wait between locking attempts. - ole32: FileLockBytesImpl_WriteAt() should return STG_E_WRITEFAULT for write errors. - server: Treat ENOTSUP the same way as ENOLCK, consider locking to be non-functional on that filesystem. - ole32: Treat STG_E_LOCKVIOLATION the same way as STG_E_ACCESSDENIED as both indicate locking contention. - ole32: Return the correct error in FileLockBytesImpl_*LockRegion*(). - msvcrt/tests: Add a trailing '\n' to an ok() call. - packager/tests: Make the IStorage methods static. - mshtml: Remove nsAString_SetData() because it is unused. + dssenh/tests: Add tests for the default encryption chaining mode. + rsaenh/tests: Add tests for the default encryption chaining mode. + rsaenh/tests: Add more AES encrypt/decrypt tests. + ws2_32: Only declare IPX support if the required definitions are found. + ws2_32: Improve WSAStartup/WSACleanup tracing. + dnsapi: Do not fail if NETDB_INTERNAL is not present. + winspool: Fix a leak in DocumentPropertiesA (valgrind). + +Erich Hoover (1): + advapi32: Implement RegSetKeySecurity on top of NtSetSecurityObject. + +François Gouget (1): + shlwapi/tests: Make test_PathIsRelative[AW]() static. -Frédéric Delanoy (1): +Frédéric Delanoy (3): + msvcrt: Avoid potential integer overflow when computing median position in bsearch. Assorted spelling/grammar fixes. + ntdll: Avoid potential integer overflow when computing median position in bsearch. -Grazvydas Ignotas (6): - msvcrt: Free old buffer properly in setvbuf. - msvcrt/tests: Add a test for fwrite flushing behavior. - msvcrt: Change internal buffer size to 4k. - msvcrt/tests: Test _cnt value after rewind/fflush. - msvcrt: Clear _cnt on buffer flush. - msvcrt: Implement bufsiz block flushing behavior. +Gediminas Jakutis (2): + d3dx9: Add adjacency generation for D3DXCreateSphere(). + d3dx9: Implement D3DXCreateTorus() + tests. + +Grazvydas Ignotas (1): + kernel32: Don't return uninitialized values on failures. Henri Verbeet (10): - ddraw/tests: Get rid of some unused assignments. - ddraw/tests: Properly declare matrices. - d2d1: Implement d2d_d3d_render_target_CreateSolidColorBrush(). - d2d1: Implement d2d_d3d_render_target_CreateGradientStopCollection(). - d2d1: Implement d2d_d3d_render_target_CreateLinearGradientBrush(). - d3d9/tests: Add some lost device tests. - d3d8/tests: Add some lost device tests. - ddraw/tests: Add some lost device tests. - d3d9: Improve d3d9_device_TestCooperativeLevel(). - d3d9: Check the device status in present calls. - -Huw D. M. Davies (1): - fonts: Add some barb arrow glyphs. - -Jacek Caban (9): - vbscript: Reset error number on error mode change. - mshtml: Added IHTMLWindow2::scroll implementation. - wininet: Don't change hostPort in HTTP_HttpOpenRequestW. - wininet: Update hostPort in HTTP_HandleRedirect. - wininet: Use current server in HTTP_GetRedirectURL. - wininet: Don't try to read content in response to HEAD request. - shdocvw: Added ResetProfileSharing stub. - ieframe: Use URL_APPLY_DEFAULT in UrlApplyScheme call. - shdocvw: Added InstallReg_RunDLL stub. - -Julian Rüger (1): - po: Update German translation. - -Lauri Kenttä (1): - po: Update Finnish translation. - -Marcus Meissner (3): - oleaut32: Avoid buffer overread (Coverity). - mscms: Removed duplicate return ret (Coverity). - winealsa/wineoss/winecoreaudio: Calculate frequency in 64bit (Coverity). - -Matteo Bruni (8): - d3d9/tests: Test GetData behavior with various size values. - wined3d: Validate and handle query size parameter. - wpp: Properly free defines (Valgrind). - wpp: Free the include filename on error (Valgrind). - d3dcompiler/tests: Add a couple more checks for parent data values. - wpp: Free some filename strings after processing an include (Valgrind). - wpp: Correctly handle OOM in pop_buffer(). - d3dx9: Correctly set parent_data for direct includes from the main file. - -Michael Stefaniuc (2): - dmusic: Increment the refcount when a IReferenceClock pointer is returned. - comctl32: Functions using setjmp can never be inlined. - -Nikolay Sivov (21): - comctl32/tests: Avoid testing uninitialized value (Valgrind). - wmp: Implement get_versionInfo(). - d3drm/tests: Release frame instance (Valgrind). - d3dx9: Trace out parameters as pointers (Valgrind). - quartz/tests: Fix couple of test failures running with limited user. - shell32: Release cached desktop folder on process detach. - windowscodecs/tests: Fixed some leaks on error path (Valgrind). - dsound/tests: Accept another error code. - msctf/tests: Fix crash when ITfInputProcessorProfileMgr is not supported. - msxml3/tests: Accept Stat() method called on test stream. - xmllite/writer: Maintain a stack of written elements to write end tags. - dwrite: Recognize more Unicode ranges in script analyzer. - kernel32: Added a message for WSAECONNRESET. - xmllite/writer: Implement WriteFullEndElement(). - po: Update Russian translation. - scrrun: Implement GetDriveName(). - scrrun: Implement SerialNumber property. - scrrun: Implement FileSystem property. - scrrun: Implement get_VolumeName(). - scrrun/tests: Run test on fixed drive. - iphlpapi/tests: Skipping test on access error. - -Piotr Caban (18): - msvcrt: Use size_t to store indexes in qsort. - msvcrt: Allocate data with 16-bytes alignement if small blocks heap is used. - msvcrt: Add small blocks heap tests. - msvcr100: Add _SpinWait implementation. - msvcr100/tests: Add _SpinWait tests. - msvcr100: Add critical_section class stub. - msvcr100: Add critical_section::scoped_lock implementation. - msvcr100: Add critical_section class implementation. - msvcr110: Add critical_section::try_lock_for implementation. - msvcp110: Add missing exports to msvcp110.spec file. - kernel32: Fix typo in enum_locale_ex_proc. - msvcp110: Add _Mtx_{destroy,getconcrtcs,init,lock,unlock,trylock} implementation. - msvcr110: Add __crtInitializeCriticalSectionEx implementation. - msvcrt: Fix _flsbuf behavior on streams with MSVCRT__IONBF flag. - msvcrt: Fix ungetc on files with empty buffer. - msvcrt: Support NULL buffer in setvbuf. - msvcrt: Use file->_flag to check if file buffering is enabled. - msvcrt: Don't touch _bufsiz value while initializing FILE structure. - -Sebastian Lackner (23): - kernel32: Update VirtualAddress of resource section in write_raw_resources. - msvcr110: Fix typo in exported symbol _set_SSE2_enable. - user32: Avoid race-condition when unloading module while hook is still active. - kernel32: Raise DBG_PRINTEXCEPTION_C exception in OutputDebugStringA. - wininet: Don't update *lpdwIndex if HttpQueryInfoW fails with ERROR_INSUFFICIENT_BUFFER. - ntdll/tests: Add exception tests for RtlUnwind on i386. - ntdll/tests: Use an EXCEPTION_REGISTRATION_RECORD array to prevent compiler from reordering variables. - ntdll/tests: Run crashing i386 exception tests as the last step. - kernel32: Process OutputDebugString events like regular exceptions. - server: Remove output_debug_string request. - ntdll/tests: Add more tests for debug string events. - server: Grab borrowed debugger reference while handling wake_up() events. (Valgrind). - server: Avoid invalid memory access when thread is killed while in wake_up(). (Valgrind). - kernel32: Fix a valgrind warning in format_add_char(). (Valgrind). - kernel32/tests: Add missing HeapFree() in doChildren(). (Valgrind). - comctl32: Allocate new memory in notify_forward_header() to avoid Free() on wrong pointer. (Valgrind). - ntdll: Fix leaking activation context when terminating via exit_thread(). (Valgrind). - kernel32/tests: Add missing ReleaseActCtx() calls. (Valgrind). - ntdll: Avoid leaking activation context in RtlCreateUserThread. (Valgrind). - kernel32: Process DBG_RIPEXCEPTION events like regular exceptions. - server: Get rid of RIP_EVENT union elements. - ntdll/tests: Add tests for DBG_RIPEXCEPTION debugger events. - user32/tests: Add a missing call to ReleaseActCtx(). + d3d9: Improve d3d9_device_CheckDeviceState() a little. + d3d8: Improve d3d8_device_TestCooperativeLevel(). + d3d8: Check the device status in present calls. + ddraw: Improve ddraw7_TestCooperativeLevel(). + ddraw: Implement ddraw7_RestoreAllSurfaces(). + ddraw: Check for a lost surface in ddraw_surface7_Flip(). + wined3d: Print a winediag message if we failed to create a DXTn texture because of lack of driver support. + ddraw/tests: Get rid of struct vertex. + ddraw/tests: Get rid of struct tvertex. + ddraw/tests: Get rid of struct nvertex. + +Huw D. M. Davies (4): + comctl32: Don't use the RECT from the custom draw structure when referring to the button alone. + comctl32: The RECT in the custom draw structure should be the entire item's size. This includes any separated dropdown arrow. + comctl32: Propagate the return value of WM_ERASEBKGND. + tools: Only allow the absolute difference in bracket pairs to be less than 128, since we need the sign. + +Jacek Caban (13): + iphlpapi: Protect res_init call with critical section. + urlmon: Don't decode percent-encoded characters in file URLs with implicit scheme. + urlmon.idl: Added missing Uri_CREATE_* flags. + wininet: Forward InternetGetCookieA to InternetGetCookieExA, not the other way around. + wininet: Forward InternetGetCookieW to InternetGetCookieExW, not the other way around. + wininet.h: Added missing INTERNET_COOKIE_* flags. + wininet: Forward InternetSetCookieExA to InternetSetCookieExW instead of InternetSetCookieA. + wininet.h: Added InternetCookieState declaration. + wininet: Fixed InternetSetCookieExW return type and forward InternetSetCookieW to InternetSetCookieExW instead of the other way around. + wininet: Added support for INTERNET_COOKIE_HTTPONLY flag to InternetSetCookieEx. + wininet: Added support for INTERNET_COOKIE_HTTPONLY flag to InternetGetCookieEx. + wininet/tests: Added INTERNET_COOKIE_HTTPONLY tests. + wininet: Don't allow overriding httponly cookies with non-httponly ones. + +Jactry Zeng (3): + riched20: Don't create too many IRichEditOle interface for a RichEdit. + riched20: Initialize ed->reOle in ME_MakeEditor(). + riched20: Return nonzero value instead of zero when EM_SETREADONLY succeeds. + +Joris van der Wel (4): + server: Any of the 4 SE_*_DEFAULTED controls should not be stored on objects, their usage is transient. + advapi32/tests: Changed an invalid comment. + advapi32/tests: Refactor the retrieval of a security descriptor into a separate function so that it can be used in other tests. + server: Setting a security descriptor should not replace an existing owner or group with a default, if only a DACL is being set. + +Ken Thomases (2): + dbghelp: If the caller didn't provide a module load address use the segment start address. + dbghelp: Ignore the __PAGEZERO segment. + +Marcus Meissner (2): + windowscodecs: Fixed incorrect memset (Coverity). + packager: Fixed incorrect size (Coverity). + +Nikolay Sivov (5): + shell32: Implement PathYetAnotherMakeUniqueName(). + advapi32: Implement RegDeleteKeyValue(). + kernel32: Added support for C3_HIGHSURROGATE/C3_LOWSURROGATE in GetStringTypeW(). + advapi32: Implement RegSetKeyValue(). + kernel32: Partially implement GetGeoInfo(). + +Piotr Caban (4): + msvcrt: Fix buffer allocation in setvbuf. + ole32: Don't do any message processing when we're already done with dragdrop operation. + msvcrt: Always set fd to -1 in _sopen_s on failure. + urlmon: Recognize tag in FindMimeFromData function. + +Qian Hong (3): + mshtml: Fixed typo. + gdi32/tests: Improve font name localization tests by not requiring a strict language match. + gdiplus: Set outer pointer to NULL when image loading functions fail. + +Sebastian Lackner (4): + wininet: Fix invalid memory access in HTTP_QUERY_RAW_HEADERS (Valgrind). + oleaut32/tests: Add additional tests for VarDecAdd. + oleaut32: Decrease accuracy if scaling is not possible in VarDecAdd. + shell32: Return NULL-terminated list of arguments in CommandLineToArgvW. Shuai Meng (2): - vbscript: Implemented CSng. - vbscript: Implemented TypeName. + vbscript: Implemented VarType. + vbscript: Implemented Sgn. + +Stefan Dösinger (8): + wined3d: Set palettes on the swapchain. + wined3d: Do not write a FIXME about WINED3DUSAGE_WRITEONLY. + ddraw: Refuse SetPalette and GetPalette on lost surfaces. + d3d9: Ignore SetPriority and GetPriority calls on surfaces. + wined3d: Ignore set_priority calls on non-managed resources. + d3d9/tests: Add a test for SetPriority and GetPriority. + d3d8/tests: Add a test for SetPriority and GetPriority. + d3d9/tests: Fix some ok() call style issues. + +Vincent Povirk (7): + ole32: Simplify the FileMonikerImpl_BindToStorage code. + winebrowser: Manually percent-encode file: paths for unix filenames. + winebrowser: Add traces for file uri conversion steps. + winebrowser: Don't use IUriBuilder with unix file: uri's. + urlmon: Add tests for implicit file uri's with percent encodings. + gdiplus: Account for transforms when calculating hdc bounds. + winex11: Leave fullscreen state alone when minimizing. -Thomas Faber (2): - rpcrt4: Do not omit mandatory argument to VirtualProtect. - msvcrt: Do not omit mandatory argument to VirtualProtect. - -Vincent Povirk (13): - ole32: Add tests for STGC_OVERWRITE. - windowscodecs: Share WriteSource code between implementations. - windowscodecs: Check for empty rect in WriteSource_Proxy. - windowscodecs: Support InterlaceOption in PNG encoder. - shell32: Set tm_isdst before calling mktime. - advapi32/tests: Account for limited users in registry test. - windowscodecs: Fix memory leak in ComponentFactory_CreateBitmapFromSource. - windowscodecs: Fix leak in DGifGetImageDesc. - windowscodecs: Fix leak in test_propertybag_getpropertyinfo. - windowscodecs: Fix leak in test_QueryCapability. - windowscodecs: Fix leak in test_QueryCapability. - Revert "windowscodecs: Fix leak in test_QueryCapability.". - windowscodecs: Fix interlaced PNG writing. - -Zhenbo Li (2): - mshtml: Added IHTMLTableCell::cellIndex method implementation. - shell32: Fix SHFileOperation when deleting a nonexistent directory. +Zhenbo Li (1): + shlwapi/tests: Add tests for PathIsRelativeA/W. -- Alexandre Julliard diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/AUTHORS wine-compholio-1.7.22~ubuntu13.10.1/AUTHORS --- wine-compholio-1.7.21~ubuntu13.10.1/AUTHORS 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/AUTHORS 2014-07-11 19:15:41.000000000 +0000 @@ -689,6 +689,7 @@ Jörg Mayer Joris Beugnies Joris Huizer +Joris van der Wel Jose Alonso Josef Meixner José Manuel Ferrer Ortiz diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/configure wine-compholio-1.7.22~ubuntu13.10.1/configure --- wine-compholio-1.7.21~ubuntu13.10.1/configure 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/configure 2014-07-11 19:15:41.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for Wine 1.7.21. +# Generated by GNU Autoconf 2.69 for Wine 1.7.22. # # Report bugs to . # @@ -580,8 +580,8 @@ # Identity of this package. PACKAGE_NAME='Wine' PACKAGE_TARNAME='wine' -PACKAGE_VERSION='1.7.21' -PACKAGE_STRING='Wine 1.7.21' +PACKAGE_VERSION='1.7.22' +PACKAGE_STRING='Wine 1.7.22' PACKAGE_BUGREPORT='wine-devel@winehq.org' PACKAGE_URL='http://www.winehq.org' @@ -1976,7 +1976,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures Wine 1.7.21 to adapt to many kinds of systems. +\`configure' configures Wine 1.7.22 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -2045,7 +2045,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of Wine 1.7.21:";; + short | recursive ) echo "Configuration of Wine 1.7.22:";; esac cat <<\_ACEOF @@ -2240,7 +2240,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -Wine configure 1.7.21 +Wine configure 1.7.22 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2758,7 +2758,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by Wine $as_me 1.7.21, which was +It was created by Wine $as_me 1.7.22, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -7535,6 +7535,8 @@ libwine_soversion=`expr $libwine_version : '\([0-9]*\)\..*'` LOADER_RULES=" +all: wine.inf + install install-lib:: wine-installed \$(INSTALL_PROGRAM) wine-installed \$(DESTDIR)\$(bindir)/$wine_binary @@ -17565,8 +17567,6 @@ \$(RM) fonts server tools $with_wine64/loader/wine $with_wine64/loader/wine-preloader" else as_fn_append LOADER_RULES " -all: wine.inf - install install-lib:: wine.inf install-man-pages \$(INSTALL_DATA) wine.inf \$(DESTDIR)\$(datadir)/wine/wine.inf \$(INSTALL_DATA) \$(srcdir)/l_intl.nls \$(DESTDIR)\$(datadir)/wine/l_intl.nls @@ -18089,7 +18089,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by Wine $as_me 1.7.21, which was +This file was extended by Wine $as_me 1.7.22, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -18160,7 +18160,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -Wine config.status 1.7.21 +Wine config.status 1.7.22 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/configure.ac wine-compholio-1.7.22~ubuntu13.10.1/configure.ac --- wine-compholio-1.7.21~ubuntu13.10.1/configure.ac 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/configure.ac 2014-07-11 19:15:41.000000000 +0000 @@ -684,6 +684,8 @@ libwine_soversion=`expr $libwine_version : '\([[0-9]]*\)\..*'` AC_SUBST(LOADER_RULES,[" +all: wine.inf + install install-lib:: wine-installed \$(INSTALL_PROGRAM) wine-installed \$(DESTDIR)\$(bindir)/$wine_binary @@ -3557,8 +3559,6 @@ \$(RM) fonts server tools $with_wine64/loader/wine $with_wine64/loader/wine-preloader]) else AS_VAR_APPEND([LOADER_RULES],[" -all: wine.inf - install install-lib:: wine.inf install-man-pages \$(INSTALL_DATA) wine.inf \$(DESTDIR)\$(datadir)/wine/wine.inf \$(INSTALL_DATA) \$(srcdir)/l_intl.nls \$(DESTDIR)\$(datadir)/wine/l_intl.nls diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/debian/bzr-builder.manifest wine-compholio-1.7.22~ubuntu13.10.1/debian/bzr-builder.manifest --- wine-compholio-1.7.21~ubuntu13.10.1/debian/bzr-builder.manifest 2014-06-28 06:07:39.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/debian/bzr-builder.manifest 2014-07-11 20:08:42.000000000 +0000 @@ -1,3 +1,3 @@ # bzr-builder format 0.3 deb-version {debversion} -lp:wine revid:git-v1:991575c2370debd29f53ab90689a8889b54a7d86 -merge compholio-release-package lp:wine-compholio revid:git-v1:5d354c9b2a329d89c738dc4ba88e3a3be8d5e414 +lp:wine revid:git-v1:307b7fe71879b718512dadc09fd4b533f6bdd151 +merge compholio-release-package lp:wine-compholio revid:git-v1:4b95841bdbdb2157b27871a5db184607ea7ca9fa diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/debian/changelog wine-compholio-1.7.22~ubuntu13.10.1/debian/changelog --- wine-compholio-1.7.21~ubuntu13.10.1/debian/changelog 2014-06-28 06:07:39.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/debian/changelog 2014-07-11 20:08:42.000000000 +0000 @@ -1,8 +1,21 @@ -wine-compholio (1.7.21~ubuntu13.10.1) saucy; urgency=low +wine-compholio (1.7.22~ubuntu13.10.1) saucy; urgency=low * Auto build. - -- Erich E. Hoover Sat, 28 Jun 2014 06:07:39 +0000 + -- Erich E. Hoover Fri, 11 Jul 2014 20:08:42 +0000 + +wine-compholio (1.7.22) unstable; urgency=low + * Implement passing ACLs to CreateProcess. + * Removed several patches (accepted upstream). + * Added NT4 support to the process ACL tests. + * Implement RegSetKeySecurity on top of NtSetSecurityObject. + * Updated RegSetKeySecurity patch to work with special root keys. + * Add patch for wtsapi32.WTSEnumerateProcessesW function. + * Fix incorrect scaling for DECIMAL values in VarDecAdd. + * Updated main extended attributes patch to include BSD support. + * Return NULL-terminated list of arguments in CommandLineToArgvW. + * Updated main extended attributes patch to include additional data checks. + -- Erich E. Hoover Fri, 11 Jul 2014 13:00:03 -0600 wine-compholio (1.7.21) unstable; urgency=low * Remove several patches (accepted upstream). diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/debian/tools/gitapply.sh wine-compholio-1.7.22~ubuntu13.10.1/debian/tools/gitapply.sh --- wine-compholio-1.7.21~ubuntu13.10.1/debian/tools/gitapply.sh 2014-06-28 05:38:42.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/debian/tools/gitapply.sh 2014-07-11 19:37:29.000000000 +0000 @@ -31,7 +31,7 @@ usage() { echo "" - echo "Usage: ./gitapply [-v] [-d DIRECTORY]" + echo "Usage: ./gitapply [--nogit] [-v] [-d DIRECTORY]" echo "" echo "Reads patch data from stdin and applies the patch to the current" echo "directory or the directory given via commandline." @@ -46,6 +46,14 @@ cmd="$1"; shift case "$cmd" in + --nogit) + nogit=1 + ;; + + -v) + verbose=1 + ;; + --directory=*) cd "${cmd#*=}" ;; @@ -57,14 +65,6 @@ abort "Reverse applying patches not supported yet with this patch tool." ;; - -v) - verbose=1 - ;; - - --nogit) - nogit=1 - ;; - --help) usage exit 0 @@ -333,8 +333,8 @@ sha="0000000000000000000000000000000000000000" fi if [ "$patch_oldsha1" != "$sha" ]; then - echo "$lineno: Expected $patch_oldsha1" - echo "$lineno: Got $sha" + echo "$lineno: Expected $patch_oldsha1" >&2 + echo "$lineno: Got $sha" >&2 abort "Unable to continue because of sha1 mismatch of original file." fi fi @@ -434,8 +434,8 @@ # Check shasum if its not a patch creating a new file sha=$(echo -en "blob $(du -b "$patch_tmpfile" | cut -f1)\x00" | cat - "$patch_tmpfile" | sha1sum | cut -d' ' -f1) if [ "$patch_newsha1" != "$sha" ]; then - echo "$lineno: Expected $patch_newsha1" - echo "$lineno: Got $sha" + echo "$lineno: Expected $patch_newsha1" >&2 + echo "$lineno: Got $sha" >&2 abort "Unable to continue because of sha1 mismatch after applying the patch." fi diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/advapi32/advapi32.spec wine-compholio-1.7.22~ubuntu13.10.1/dlls/advapi32/advapi32.spec --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/advapi32/advapi32.spec 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/advapi32/advapi32.spec 2014-07-11 19:15:41.000000000 +0000 @@ -588,8 +588,8 @@ # @ stub RegDeleteKeyTransactedA # @ stub RegDeleteKeyTransactedW @ stdcall RegDeleteKeyW(long wstr) -# @ stub RegDeleteKeyValueA -# @ stub RegDeleteKeyValueW +@ stdcall RegDeleteKeyValueA(long str str) +@ stdcall RegDeleteKeyValueW(long wstr wstr) @ stdcall RegDeleteTreeA(long str) @ stdcall RegDeleteTreeW(long wstr) @ stdcall RegDeleteValueA(long str) @@ -645,8 +645,8 @@ # @ stub RegSaveKeyExW @ stdcall RegSaveKeyW(long ptr ptr) @ stdcall RegSetKeySecurity(long long ptr) -# @ stub RegSetKeyValueA -# @ stub RegSetKeyValueW +@ stdcall RegSetKeyValueA(long str str long ptr long) +@ stdcall RegSetKeyValueW(long wstr wstr long ptr long) @ stdcall RegSetValueA(long str long ptr long) @ stdcall RegSetValueExA(long str long long ptr long) @ stdcall RegSetValueExW(long wstr long long ptr long) diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/advapi32/registry.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/advapi32/registry.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/advapi32/registry.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/advapi32/registry.c 2014-07-11 19:15:41.000000000 +0000 @@ -1276,61 +1276,80 @@ * Sets the data for the default or unnamed value of a reg key. * * PARAMS - * hKey [I] Handle to an open key. - * lpSubKey [I] Name of a subkey of hKey. - * dwType [I] Type of information to store. - * lpData [I] String that contains the data to set for the default value. - * cbData [I] Ignored. + * hkey [I] Handle to an open key. + * subkey [I] Name of a subkey of hKey. + * type [I] Type of information to store. + * data [I] String that contains the data to set for the default value. + * count [I] Ignored. * * RETURNS * Success: ERROR_SUCCESS * Failure: nonzero error code from Winerror.h */ -LSTATUS WINAPI RegSetValueW( HKEY hkey, LPCWSTR name, DWORD type, LPCWSTR data, DWORD count ) +LSTATUS WINAPI RegSetValueW( HKEY hkey, LPCWSTR subkey, DWORD type, LPCWSTR data, DWORD count ) { - HKEY subkey = hkey; - DWORD ret; - - TRACE("(%p,%s,%d,%s,%d)\n", hkey, debugstr_w(name), type, debugstr_w(data), count ); + TRACE("(%p,%s,%d,%s,%d)\n", hkey, debugstr_w(subkey), type, debugstr_w(data), count ); if (type != REG_SZ || !data) return ERROR_INVALID_PARAMETER; - if (name && name[0]) /* need to create the subkey */ - { - if ((ret = RegCreateKeyW( hkey, name, &subkey )) != ERROR_SUCCESS) return ret; - } - - ret = RegSetValueExW( subkey, NULL, 0, REG_SZ, (const BYTE*)data, - (strlenW( data ) + 1) * sizeof(WCHAR) ); - if (subkey != hkey) RegCloseKey( subkey ); - return ret; + return RegSetKeyValueW( hkey, subkey, NULL, type, data, (strlenW(data) + 1)*sizeof(WCHAR) ); } - /****************************************************************************** * RegSetValueA [ADVAPI32.@] * * See RegSetValueW. */ -LSTATUS WINAPI RegSetValueA( HKEY hkey, LPCSTR name, DWORD type, LPCSTR data, DWORD count ) +LSTATUS WINAPI RegSetValueA( HKEY hkey, LPCSTR subkey, DWORD type, LPCSTR data, DWORD count ) { - HKEY subkey = hkey; - DWORD ret; - - TRACE("(%p,%s,%d,%s,%d)\n", hkey, debugstr_a(name), type, debugstr_a(data), count ); + TRACE("(%p,%s,%d,%s,%d)\n", hkey, debugstr_a(subkey), type, debugstr_a(data), count ); if (type != REG_SZ || !data) return ERROR_INVALID_PARAMETER; - if (name && name[0]) /* need to create the subkey */ + return RegSetKeyValueA( hkey, subkey, NULL, type, data, strlen(data) + 1 ); +} + +/****************************************************************************** + * RegSetKeyValueW [ADVAPI32.@] + */ +LONG WINAPI RegSetKeyValueW( HKEY hkey, LPCWSTR subkey, LPCWSTR name, DWORD type, const void *data, DWORD len ) +{ + HKEY hsubkey = NULL; + DWORD ret; + + TRACE("(%p,%s,%s,%d,%p,%d)\n", hkey, debugstr_w(subkey), debugstr_w(name), type, data, len ); + + if (subkey && subkey[0]) /* need to create the subkey */ { - if ((ret = RegCreateKeyA( hkey, name, &subkey )) != ERROR_SUCCESS) return ret; + if ((ret = RegCreateKeyW( hkey, subkey, &hsubkey )) != ERROR_SUCCESS) return ret; + hkey = hsubkey; } - ret = RegSetValueExA( subkey, NULL, 0, REG_SZ, (const BYTE*)data, strlen(data)+1 ); - if (subkey != hkey) RegCloseKey( subkey ); + + ret = RegSetValueExW( hkey, name, 0, type, (const BYTE*)data, len ); + if (hsubkey) RegCloseKey( hsubkey ); return ret; } +/****************************************************************************** + * RegSetKeyValueA [ADVAPI32.@] + */ +LONG WINAPI RegSetKeyValueA( HKEY hkey, LPCSTR subkey, LPCSTR name, DWORD type, const void *data, DWORD len ) +{ + HKEY hsubkey = NULL; + DWORD ret; + TRACE("(%p,%s,%s,%d,%p,%d)\n", hkey, debugstr_a(subkey), debugstr_a(name), type, data, len ); + + if (subkey && subkey[0]) /* need to create the subkey */ + { + if ((ret = RegCreateKeyA( hkey, subkey, &hsubkey )) != ERROR_SUCCESS) return ret; + hkey = hsubkey; + } + + ret = RegSetValueExA( hkey, name, 0, type, (const BYTE*)data, len ); + if (hsubkey) RegCloseKey( hsubkey ); + return ret; +} /****************************************************************************** * RegQueryValueExW [ADVAPI32.@] @@ -2050,8 +2069,6 @@ return RtlNtStatusToDosError(status); } - - /****************************************************************************** * RegDeleteValueW [ADVAPI32.@] * @@ -2059,15 +2076,9 @@ */ LSTATUS WINAPI RegDeleteValueW( HKEY hkey, LPCWSTR name ) { - UNICODE_STRING nameW; - - if (!(hkey = get_special_root_hkey( hkey, 0 ))) return ERROR_INVALID_HANDLE; - - RtlInitUnicodeString( &nameW, name ); - return RtlNtStatusToDosError( NtDeleteValueKey( hkey, &nameW ) ); + return RegDeleteKeyValueW( hkey, NULL, name ); } - /****************************************************************************** * RegDeleteValueA [ADVAPI32.@] * @@ -2083,22 +2094,64 @@ */ LSTATUS WINAPI RegDeleteValueA( HKEY hkey, LPCSTR name ) { - ANSI_STRING nameA; + return RegDeleteKeyValueA( hkey, NULL, name ); +} + +/****************************************************************************** + * RegDeleteKeyValueW [ADVAPI32.@] + */ +LONG WINAPI RegDeleteKeyValueW( HKEY hkey, LPCWSTR subkey, LPCWSTR name ) +{ + UNICODE_STRING nameW; + HKEY hsubkey = 0; + LONG ret; + + if (!(hkey = get_special_root_hkey( hkey, 0 ))) return ERROR_INVALID_HANDLE; + + if (subkey) + { + if ((ret = RegOpenKeyExW( hkey, subkey, 0, KEY_SET_VALUE, &hsubkey ))) + return ret; + hkey = hsubkey; + } + + RtlInitUnicodeString( &nameW, name ); + ret = RtlNtStatusToDosError( NtDeleteValueKey( hkey, &nameW ) ); + if (hsubkey) RegCloseKey( hsubkey ); + return ret; +} + +/****************************************************************************** + * RegDeleteKeyValueA [ADVAPI32.@] + */ +LONG WINAPI RegDeleteKeyValueA( HKEY hkey, LPCSTR subkey, LPCSTR name ) +{ UNICODE_STRING nameW; + HKEY hsubkey = 0; + ANSI_STRING nameA; NTSTATUS status; if (!(hkey = get_special_root_hkey( hkey, 0 ))) return ERROR_INVALID_HANDLE; + if (subkey) + { + LONG ret = RegOpenKeyExA( hkey, subkey, 0, KEY_SET_VALUE, &hsubkey ); + if (ret) + return ret; + hkey = hsubkey; + } + RtlInitAnsiString( &nameA, name ); if (!(status = RtlAnsiStringToUnicodeString( &nameW, &nameA, TRUE ))) { status = NtDeleteValueKey( hkey, &nameW ); RtlFreeUnicodeString( &nameW ); } + + if (hsubkey) RegCloseKey( hsubkey ); return RtlNtStatusToDosError( status ); } - /****************************************************************************** * RegLoadKeyW [ADVAPI32.@] * @@ -2435,9 +2488,9 @@ if (!pSecurityDesc) return ERROR_INVALID_PARAMETER; - FIXME(":(%p,%d,%p): stub\n",hkey,SecurityInfo,pSecurityDesc); + if (!(hkey = get_special_root_hkey( hkey, 0 ))) return ERROR_INVALID_HANDLE; - return ERROR_SUCCESS; + return RtlNtStatusToDosError( NtSetSecurityObject( hkey, SecurityInfo, pSecurityDesc ) ); } diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/advapi32/tests/registry.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/advapi32/tests/registry.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/advapi32/tests/registry.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/advapi32/tests/registry.c 2014-07-11 19:15:41.000000000 +0000 @@ -47,6 +47,8 @@ static NTSTATUS (WINAPI * pNtDeleteKey)(HANDLE); static NTSTATUS (WINAPI * pRtlFormatCurrentUserKeyPath)(UNICODE_STRING*); static NTSTATUS (WINAPI * pRtlFreeUnicodeString)(PUNICODE_STRING); +static LONG (WINAPI *pRegDeleteKeyValueA)(HKEY,LPCSTR,LPCSTR); +static LONG (WINAPI *pRegSetKeyValueW)(HKEY,LPCWSTR,LPCWSTR,DWORD,const void*,DWORD); static BOOL limited_user; @@ -135,6 +137,8 @@ ADVAPI32_GET_PROC(RegGetValueA); ADVAPI32_GET_PROC(RegDeleteTreeA); ADVAPI32_GET_PROC(RegDeleteKeyExA); + ADVAPI32_GET_PROC(RegDeleteKeyValueA); + ADVAPI32_GET_PROC(RegSetKeyValueW); pIsWow64Process = (void *)GetProcAddress( hkernel32, "IsWow64Process" ); pRtlFormatCurrentUserKeyPath = (void *)GetProcAddress( hntdll, "RtlFormatCurrentUserKeyPath" ); @@ -431,6 +435,37 @@ ok(ret == ERROR_NOACCESS, "RegSetValueExW should have failed with ERROR_NOACCESS: %d, GLE=%d\n", ret, GetLastError()); ret = RegSetValueExW(hkey_main, name2W, 0, REG_DWORD, (const BYTE *)1, 1); ok(ret == ERROR_NOACCESS, "RegSetValueExW should have failed with ERROR_NOACCESS: %d, GLE=%d\n", ret, GetLastError()); + + /* RegSetKeyValue */ + if (!pRegSetKeyValueW) + win_skip("RegSetKeyValue() is not supported.\n"); + else + { + static const WCHAR subkeyW[] = {'s','u','b','k','e','y',0}; + DWORD len, type; + HKEY subkey; + + ret = pRegSetKeyValueW(hkey_main, NULL, name1W, REG_SZ, (const BYTE*)string2W, sizeof(string2W)); + ok(ret == ERROR_SUCCESS, "got %d\n", ret); + test_hkey_main_Value_A(name1A, string2A, sizeof(string2A)); + test_hkey_main_Value_W(name1W, string2W, sizeof(string2W)); + + ret = pRegSetKeyValueW(hkey_main, subkeyW, name1W, REG_SZ, string1W, sizeof(string1W)); + ok(ret == ERROR_SUCCESS, "got %d\n", ret); + + ret = RegOpenKeyExW(hkey_main, subkeyW, 0, KEY_QUERY_VALUE, &subkey); + ok(ret == ERROR_SUCCESS, "got %d\n", ret); + type = len = 0; + ret = RegQueryValueExW(subkey, name1W, 0, &type, NULL, &len); + ok(ret == ERROR_SUCCESS, "got %d\n", ret); + ok(len == sizeof(string1W), "got %d\n", len); + ok(type == REG_SZ, "got type %d\n", type); + + ret = pRegSetKeyValueW(hkey_main, subkeyW, name1W, REG_SZ, NULL, 0); + ok(ret == ERROR_SUCCESS, "got %d\n", ret); + + RegCloseKey(subkey); + } } static void create_test_entries(void) @@ -1068,14 +1103,15 @@ } else { - /* The "sanctioned" methods of setting a registry ACL aren't implemented in Wine. */ - bRet = SetKernelObjectSecurity(hkRoot64, DACL_SECURITY_INFORMATION, sd); - ok(bRet == TRUE, - "Expected SetKernelObjectSecurity to return TRUE, got %d, last error %u\n", bRet, GetLastError()); - - bRet = SetKernelObjectSecurity(hkRoot32, DACL_SECURITY_INFORMATION, sd); - ok(bRet == TRUE, - "Expected SetKernelObjectSecurity to return TRUE, got %d, last error %u\n", bRet, GetLastError()); + LONG error; + + error = RegSetKeySecurity(hkRoot64, DACL_SECURITY_INFORMATION, sd); + ok(error == ERROR_SUCCESS, + "Expected RegSetKeySecurity to return success, got error %u\n", error); + + bRet = RegSetKeySecurity(hkRoot32, DACL_SECURITY_INFORMATION, sd); + ok(error == ERROR_SUCCESS, + "Expected RegSetKeySecurity to return success, got error %u\n", error); hkResult = NULL; ret = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine", 0, KEY_WOW64_64KEY | KEY_READ, &hkResult); @@ -1229,14 +1265,13 @@ } else { - /* The "sanctioned" methods of setting a registry ACL aren't implemented in Wine. */ - bRet = SetKernelObjectSecurity(hkRoot64, DACL_SECURITY_INFORMATION, sd); - ok(bRet == TRUE, - "Expected SetKernelObjectSecurity to return TRUE, got %d, last error %u\n", bRet, GetLastError()); - - bRet = SetKernelObjectSecurity(hkRoot32, DACL_SECURITY_INFORMATION, sd); - ok(bRet == TRUE, - "Expected SetKernelObjectSecurity to return TRUE, got %d, last error %u\n", bRet, GetLastError()); + ret = RegSetKeySecurity(hkRoot64, DACL_SECURITY_INFORMATION, sd); + ok(ret == ERROR_SUCCESS, + "Expected RegSetKeySecurity to return success, got error %u\n", ret); + + ret = RegSetKeySecurity(hkRoot32, DACL_SECURITY_INFORMATION, sd); + ok(ret == ERROR_SUCCESS, + "Expected RegSetKeySecurity to return success, got error %u\n", ret); hkey1 = NULL; ret = RegCreateKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine", 0, NULL, 0, @@ -2768,6 +2803,56 @@ "expect ERROR_FILE_NOT_FOUND, got %i\n", res); } +static void test_delete_key_value(void) +{ + HKEY subkey; + LONG ret; + + if (!pRegDeleteKeyValueA) + { + win_skip("RegDeleteKeyValue is not available.\n"); + return; + } + + ret = pRegDeleteKeyValueA(NULL, NULL, NULL); + ok(ret == ERROR_INVALID_HANDLE, "got %d\n", ret); + + ret = pRegDeleteKeyValueA(hkey_main, NULL, NULL); + ok(ret == ERROR_FILE_NOT_FOUND, "got %d\n", ret); + + ret = RegSetValueExA(hkey_main, "test", 0, REG_SZ, (const BYTE*)"value", 6); + ok(ret == ERROR_SUCCESS, "got %d\n", ret); + + ret = RegQueryValueExA(hkey_main, "test", NULL, NULL, NULL, NULL); + ok(ret == ERROR_SUCCESS, "got %d\n", ret); + + /* NULL subkey name means delete from open key */ + ret = pRegDeleteKeyValueA(hkey_main, NULL, "test"); + ok(ret == ERROR_SUCCESS, "got %d\n", ret); + + ret = RegQueryValueExA(hkey_main, "test", NULL, NULL, NULL, NULL); + ok(ret == ERROR_FILE_NOT_FOUND, "got %d\n", ret); + + /* now with real subkey */ + ret = RegCreateKeyExA(hkey_main, "Subkey1", 0, NULL, 0, KEY_WRITE|KEY_READ, NULL, &subkey, NULL); + ok(!ret, "failed with error %d\n", ret); + + ret = RegSetValueExA(subkey, "test", 0, REG_SZ, (const BYTE*)"value", 6); + ok(ret == ERROR_SUCCESS, "got %d\n", ret); + + ret = RegQueryValueExA(subkey, "test", NULL, NULL, NULL, NULL); + ok(ret == ERROR_SUCCESS, "got %d\n", ret); + + ret = pRegDeleteKeyValueA(hkey_main, "Subkey1", "test"); + ok(ret == ERROR_SUCCESS, "got %d\n", ret); + + ret = RegQueryValueExA(subkey, "test", NULL, NULL, NULL, NULL); + ok(ret == ERROR_FILE_NOT_FOUND, "got %d\n", ret); + + RegDeleteKeyA(subkey, ""); + RegCloseKey(subkey); +} + START_TEST(registry) { /* Load pointers for functions that are not available in all Windows versions */ @@ -2808,6 +2893,7 @@ test_rw_order(); test_deleted_key(); test_delete_value(); + test_delete_key_value(); /* cleanup */ delete_key( hkey_main ); diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/advapi32/tests/security.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/advapi32/tests/security.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/advapi32/tests/security.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/advapi32/tests/security.c 2014-07-11 19:15:41.000000000 +0000 @@ -208,6 +208,68 @@ myARGC = winetest_get_mainargs( &myARGV ); } +static SECURITY_DESCRIPTOR* test_get_security_descriptor(HANDLE handle, int line) +{ + /* use HeapFree(GetProcessHeap(), 0, sd); when done */ + DWORD ret, length, needed; + SECURITY_DESCRIPTOR *sd; + + needed = 0xdeadbeef; + SetLastError(0xdeadbeef); + ret = GetKernelObjectSecurity(handle, OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION, + NULL, 0, &needed); + ok_(__FILE__, line)(!ret, "GetKernelObjectSecurity should fail\n"); + ok_(__FILE__, line)(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError()); + ok_(__FILE__, line)(needed != 0xdeadbeef, "GetKernelObjectSecurity should return required buffer length\n"); + + length = needed; + sd = HeapAlloc(GetProcessHeap(), 0, length); + + needed = 0xdeadbeef; + SetLastError(0xdeadbeef); + ret = GetKernelObjectSecurity(handle, OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION, + sd, length, &needed); + ok_(__FILE__, line)(ret, "GetKernelObjectSecurity error %d\n", GetLastError()); + ok_(__FILE__, line)(needed == length || needed == 0 /* file, pipe */, "GetKernelObjectSecurity should return %u instead of %u\n", length, needed); + return sd; +} + +static void test_owner_equal(HANDLE Handle, PSID expected, int line) +{ + BOOL res; + SECURITY_DESCRIPTOR *queriedSD = NULL; + PSID owner; + BOOL owner_defaulted; + + queriedSD = test_get_security_descriptor( Handle, line ); + + res = GetSecurityDescriptorOwner(queriedSD, &owner, &owner_defaulted); + ok_(__FILE__, line)(res, "GetSecurityDescriptorOwner failed with error %d\n", GetLastError()); + + ok_(__FILE__, line)(EqualSid(owner, expected), "Owner SIDs are not equal\n"); + ok_(__FILE__, line)(!owner_defaulted, "Defaulted is true\n"); + + HeapFree(GetProcessHeap(), 0, queriedSD); +} + +static void test_group_equal(HANDLE Handle, PSID expected, int line) +{ + BOOL res; + SECURITY_DESCRIPTOR *queriedSD = NULL; + PSID group; + BOOL group_defaulted; + + queriedSD = test_get_security_descriptor( Handle, line ); + + res = GetSecurityDescriptorGroup(queriedSD, &group, &group_defaulted); + ok_(__FILE__, line)(res, "GetSecurityDescriptorGroup failed with error %d\n", GetLastError()); + + ok_(__FILE__, line)(EqualSid(group, expected), "Group SIDs are not equal\n"); + ok_(__FILE__, line)(!group_defaulted, "Defaulted is true\n"); + + HeapFree(GetProcessHeap(), 0, queriedSD); +} + static void test_sid(void) { struct sidRef refs[] = { @@ -2478,6 +2540,8 @@ SECURITY_ATTRIBUTES psa; HANDLE token, event; DWORD size; + SID_IDENTIFIER_AUTHORITY SIDAuthWorld = { SECURITY_WORLD_SID_AUTHORITY }; + PSID EveryoneSid = NULL; Acl = HeapAlloc(GetProcessHeap(), 0, 256); res = InitializeAcl(Acl, 256, ACL_REVISION); @@ -2489,6 +2553,9 @@ } ok(res, "InitializeAcl failed with error %d\n", GetLastError()); + res = AllocateAndInitializeSid( &SIDAuthWorld, 1, SECURITY_WORLD_RID, 0, 0, 0, 0, 0, 0, 0, &EveryoneSid); + ok(res, "AllocateAndInitializeSid failed with error %d\n", GetLastError()); + /* get owner from the token we might be running as a user not admin */ res = OpenProcessToken( GetCurrentProcess(), MAXIMUM_ALLOWED, &token ); ok(res, "OpenProcessToken failed with error %d\n", GetLastError()); @@ -2547,7 +2614,7 @@ CHECK_SET_SECURITY( event, GROUP_SECURITY_INFORMATION, ERROR_INVALID_SECURITY_DESCR ); CHECK_SET_SECURITY( event, SACL_SECURITY_INFORMATION, ERROR_ACCESS_DENIED ); CHECK_SET_SECURITY( event, DACL_SECURITY_INFORMATION, ERROR_SUCCESS ); - /* NULL DACL is valid and means default DACL from token */ + /* NULL DACL is valid and means that everyone has access */ SecurityDescriptor->Control |= SE_DACL_PRESENT; CHECK_SET_SECURITY( event, DACL_SECURITY_INFORMATION, ERROR_SUCCESS ); @@ -2555,12 +2622,31 @@ res = SetSecurityDescriptorOwner(SecurityDescriptor, AdminSid, FALSE); ok(res, "SetSecurityDescriptorOwner failed with error %d\n", GetLastError()); CHECK_SET_SECURITY( event, OWNER_SECURITY_INFORMATION, ERROR_SUCCESS ); + test_owner_equal( event, AdminSid, __LINE__ ); + + res = SetSecurityDescriptorGroup(SecurityDescriptor, EveryoneSid, FALSE); + ok(res, "SetSecurityDescriptorGroup failed with error %d\n", GetLastError()); + CHECK_SET_SECURITY( event, GROUP_SECURITY_INFORMATION, ERROR_SUCCESS ); + test_group_equal( event, EveryoneSid, __LINE__ ); + + res = SetSecurityDescriptorDacl(SecurityDescriptor, TRUE, Acl, FALSE); + ok(res, "SetSecurityDescriptorDacl failed with error %d\n", GetLastError()); + CHECK_SET_SECURITY( event, DACL_SECURITY_INFORMATION, ERROR_SUCCESS ); + /* setting a dacl should not change the owner or group */ + test_owner_equal( event, AdminSid, __LINE__ ); + test_group_equal( event, EveryoneSid, __LINE__ ); + + /* Test again with a different SID in case the previous SID also happens to + * be the one that is incorrectly replacing the group. */ res = SetSecurityDescriptorGroup(SecurityDescriptor, UsersSid, FALSE); ok(res, "SetSecurityDescriptorGroup failed with error %d\n", GetLastError()); CHECK_SET_SECURITY( event, GROUP_SECURITY_INFORMATION, ERROR_SUCCESS ); + test_group_equal( event, UsersSid, __LINE__ ); + res = SetSecurityDescriptorDacl(SecurityDescriptor, TRUE, Acl, FALSE); ok(res, "SetSecurityDescriptorDacl failed with error %d\n", GetLastError()); CHECK_SET_SECURITY( event, DACL_SECURITY_INFORMATION, ERROR_SUCCESS ); + test_group_equal( event, UsersSid, __LINE__ ); sprintf(buffer, "%s tests/security.c test", myARGV[0]); memset(&startup, 0, sizeof(startup)); @@ -2579,6 +2665,7 @@ STANDARD_RIGHTS_ALL | SPECIFIC_RIGHTS_ALL ); winetest_wait_child_process( info.hProcess ); + FreeSid(EveryoneSid); CloseHandle( info.hProcess ); CloseHandle( info.hThread ); CloseHandle( event ); @@ -4432,29 +4519,12 @@ static void test_default_handle_security(HANDLE token, HANDLE handle, GENERIC_MAPPING *mapping) { - DWORD ret, length, needed, granted, priv_set_len; + DWORD ret, granted, priv_set_len; BOOL status; PRIVILEGE_SET priv_set; SECURITY_DESCRIPTOR *sd; - needed = 0xdeadbeef; - SetLastError(0xdeadbeef); - ret = GetKernelObjectSecurity(handle, OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION, - NULL, 0, &needed); - ok(!ret, "GetKernelObjectSecurity should fail\n"); - ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError()); - ok(needed != 0xdeadbeef, "GetKernelObjectSecurity should return required buffer length\n"); - - length = needed; - sd = HeapAlloc(GetProcessHeap(), 0, length); - - needed = 0xdeadbeef; - SetLastError(0xdeadbeef); - ret = GetKernelObjectSecurity(handle, OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION, - sd, length, &needed); - ok(ret, "GetKernelObjectSecurity error %d\n", GetLastError()); - ok(needed == length || needed == 0 /* file, pipe */, "GetKernelObjectSecurity should return %u instead of %u\n", length, needed); - + sd = test_get_security_descriptor(handle, __LINE__); validate_default_security_descriptor(sd); priv_set_len = sizeof(priv_set); @@ -5341,7 +5411,7 @@ ret = GetSecurityDescriptorOwner( sd, &owner, &defaulted ); ok( ret, "error %u\n", GetLastError() ); ok( owner != (void *)0xdeadbeef, "owner not set\n" ); - todo_wine ok( !defaulted, "owner defaulted\n" ); + ok( !defaulted, "owner defaulted\n" ); dacl = (void *)0xdeadbeef; present = FALSE; @@ -5350,7 +5420,7 @@ ok( ret, "error %u\n", GetLastError() ); ok( present, "dacl not present\n" ); ok( dacl != (void *)0xdeadbeef, "dacl not set\n" ); - todo_wine ok( !defaulted, "dacl defaulted\n" ); + ok( !defaulted, "dacl defaulted\n" ); index = 0; found = FALSE; diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/comctl32/pager.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/comctl32/pager.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/comctl32/pager.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/comctl32/pager.c 2014-07-11 19:15:41.000000000 +0000 @@ -985,16 +985,17 @@ { POINT pt, ptorig; HWND parent; + LRESULT ret; pt.x = 0; pt.y = 0; parent = GetParent(infoPtr->hwndSelf); MapWindowPoints(infoPtr->hwndSelf, parent, &pt, 1); OffsetWindowOrgEx (hdc, pt.x, pt.y, &ptorig); - SendMessageW (parent, WM_ERASEBKGND, (WPARAM)hdc, 0); + ret = SendMessageW (parent, WM_ERASEBKGND, (WPARAM)hdc, 0); SetWindowOrgEx (hdc, ptorig.x, ptorig.y, 0); - return 0; + return ret; } diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/comctl32/toolbar.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/comctl32/toolbar.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/comctl32/toolbar.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/comctl32/toolbar.c 2014-07-11 19:15:41.000000000 +0000 @@ -748,10 +748,10 @@ /* draws a blank frame for a toolbar button */ static void -TOOLBAR_DrawFrame(const TOOLBAR_INFO *infoPtr, const NMTBCUSTOMDRAW *tbcd, DWORD dwItemCDFlag) +TOOLBAR_DrawFrame(const TOOLBAR_INFO *infoPtr, const NMTBCUSTOMDRAW *tbcd, const RECT *rect, DWORD dwItemCDFlag) { HDC hdc = tbcd->nmcd.hdc; - RECT rc = tbcd->nmcd.rc; + RECT rc = *rect; /* if the state is disabled or indeterminate then the button * cannot have an interactive look like pressed or hot */ BOOL non_interactive_state = (tbcd->nmcd.uItemState & CDIS_DISABLED) || @@ -954,7 +954,7 @@ tbcd.rcText.bottom = rcText.bottom - rc.top; tbcd.nmcd.uItemState = TOOLBAR_TranslateState(btnPtr); tbcd.nmcd.hdc = hdc; - tbcd.nmcd.rc = rc; + tbcd.nmcd.rc = btnPtr->rect; tbcd.hbrMonoDither = COMCTL32_hPattern55AABrush; /* FIXME: what are these used for? */ @@ -972,7 +972,7 @@ ntfret = TOOLBAR_SendNotify(&tbcd.nmcd.hdr, infoPtr, NM_CUSTOMDRAW); /* reset these fields so the user can't alter the behaviour like native */ tbcd.nmcd.hdc = hdc; - tbcd.nmcd.rc = rc; + tbcd.nmcd.rc = btnPtr->rect; dwItemCustDraw = ntfret & 0xffff; dwItemCDFlag = ntfret & 0xffff0000; @@ -1021,10 +1021,10 @@ || (drawSepDropDownArrow && btnPtr->bDropDownPressed)) stateId = TS_HOT; - DrawThemeBackground (theme, hdc, partId, stateId, &tbcd.nmcd.rc, NULL); + DrawThemeBackground (theme, hdc, partId, stateId, &rc, NULL); } else - TOOLBAR_DrawFrame(infoPtr, &tbcd, dwItemCDFlag); + TOOLBAR_DrawFrame(infoPtr, &tbcd, &rc, dwItemCDFlag); if (drawSepDropDownArrow) { diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/d3d8/d3d8_private.h wine-compholio-1.7.22~ubuntu13.10.1/dlls/d3d8/d3d8_private.h --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/d3d8/d3d8_private.h 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/d3d8/d3d8_private.h 2014-07-11 19:15:41.000000000 +0000 @@ -144,6 +144,13 @@ struct d3d8_vertex_declaration *declaration; }; +enum d3d8_device_state +{ + D3D8_DEVICE_STATE_OK, + D3D8_DEVICE_STATE_LOST, + D3D8_DEVICE_STATE_NOT_RESET, +}; + struct d3d8_device { /* IUnknown fields */ @@ -166,14 +173,19 @@ UINT index_buffer_size; UINT index_buffer_pos; + LONG device_state; /* Avoids recursion with nested ReleaseRef to 0 */ BOOL inDestruction; - BOOL lost; }; HRESULT device_init(struct d3d8_device *device, struct d3d8 *parent, struct wined3d *wined3d, UINT adapter, D3DDEVTYPE device_type, HWND focus_window, DWORD flags, D3DPRESENT_PARAMETERS *parameters) DECLSPEC_HIDDEN; +static inline struct d3d8_device *impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface) +{ + return CONTAINING_RECORD(iface, struct d3d8_device, IDirect3DDevice8_iface); +} + struct d3d8_resource { LONG refcount; diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/d3d8/device.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/d3d8/device.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/d3d8/device.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/d3d8/device.c 2014-07-11 19:15:41.000000000 +0000 @@ -301,11 +301,6 @@ return entry->object; } -static inline struct d3d8_device *impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface) -{ - return CONTAINING_RECORD(iface, struct d3d8_device, IDirect3DDevice8_iface); -} - static HRESULT WINAPI d3d8_device_QueryInterface(IDirect3DDevice8 *iface, REFIID riid, void **out) { TRACE("iface %p, riid %s, out %p.\n", @@ -388,13 +383,18 @@ TRACE("iface %p.\n", iface); - if (device->lost) + TRACE("device state: %#x.\n", device->device_state); + + switch (device->device_state) { - TRACE("Device is lost.\n"); - return D3DERR_DEVICENOTRESET; + default: + case D3D8_DEVICE_STATE_OK: + return D3D_OK; + case D3D8_DEVICE_STATE_LOST: + return D3DERR_DEVICELOST; + case D3D8_DEVICE_STATE_NOT_RESET: + return D3DERR_DEVICENOTRESET; } - - return D3D_OK; } static UINT WINAPI d3d8_device_GetAvailableTextureMem(IDirect3DDevice8 *iface) @@ -641,11 +641,11 @@ NULL, reset_enum_callback, TRUE))) { wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_POINTSIZE_MIN, 0); - device->lost = FALSE; + device->device_state = D3D8_DEVICE_STATE_OK; } else { - device->lost = TRUE; + device->device_state = D3D8_DEVICE_STATE_NOT_RESET; } wined3d_mutex_unlock(); @@ -661,6 +661,9 @@ TRACE("iface %p, src_rect %s, dst_rect %s, dst_window_override %p, dirty_region %p.\n", iface, wine_dbgstr_rect(src_rect), wine_dbgstr_rect(dst_rect), dst_window_override, dirty_region); + if (device->device_state != D3D8_DEVICE_STATE_OK) + return D3DERR_DEVICELOST; + wined3d_mutex_lock(); hr = wined3d_device_present(device->wined3d_device, src_rect, dst_rect, dst_window_override, dirty_region, 0); @@ -2923,7 +2926,14 @@ static void CDECL device_parent_activate(struct wined3d_device_parent *device_parent, BOOL activate) { + struct d3d8_device *device = device_from_device_parent(device_parent); + TRACE("device_parent %p, activate %#x.\n", device_parent, activate); + + if (!activate) + InterlockedCompareExchange(&device->device_state, D3D8_DEVICE_STATE_LOST, D3D8_DEVICE_STATE_OK); + else + InterlockedCompareExchange(&device->device_state, D3D8_DEVICE_STATE_NOT_RESET, D3D8_DEVICE_STATE_LOST); } static HRESULT CDECL device_parent_surface_created(struct wined3d_device_parent *device_parent, diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/d3d8/swapchain.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/d3d8/swapchain.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/d3d8/swapchain.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/d3d8/swapchain.c 2014-07-11 19:15:41.000000000 +0000 @@ -91,11 +91,15 @@ const RGNDATA *dirty_region) { struct d3d8_swapchain *swapchain = impl_from_IDirect3DSwapChain8(iface); + struct d3d8_device *device = impl_from_IDirect3DDevice8(swapchain->parent_device); HRESULT hr; TRACE("iface %p, src_rect %s, dst_rect %s, dst_window_override %p, dirty_region %p.\n", iface, wine_dbgstr_rect(src_rect), wine_dbgstr_rect(dst_rect), dst_window_override, dirty_region); + if (device->device_state != D3D8_DEVICE_STATE_OK) + return D3DERR_DEVICELOST; + wined3d_mutex_lock(); hr = wined3d_swapchain_present(swapchain->wined3d_swapchain, src_rect, dst_rect, dst_window_override, dirty_region, 0); diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/d3d8/tests/device.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/d3d8/tests/device.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/d3d8/tests/device.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/d3d8/tests/device.c 2014-07-11 19:15:41.000000000 +0000 @@ -6281,18 +6281,18 @@ ret = SetForegroundWindow(GetDesktopWindow()); ok(ret, "Failed to set foreground window.\n"); hr = IDirect3DDevice8_TestCooperativeLevel(device); - todo_wine ok(hr == D3DERR_DEVICELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == D3DERR_DEVICELOST, "Got unexpected hr %#x.\n", hr); hr = IDirect3DDevice8_Present(device, NULL, NULL, NULL, NULL); - todo_wine ok(hr == D3DERR_DEVICELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == D3DERR_DEVICELOST, "Got unexpected hr %#x.\n", hr); ret = ShowWindow(window, SW_RESTORE); ok(ret, "Failed to restore window.\n"); ret = SetForegroundWindow(window); ok(ret, "Failed to set foreground window.\n"); hr = IDirect3DDevice8_TestCooperativeLevel(device); - todo_wine ok(hr == D3DERR_DEVICENOTRESET, "Got unexpected hr %#x.\n", hr); + ok(hr == D3DERR_DEVICENOTRESET, "Got unexpected hr %#x.\n", hr); hr = IDirect3DDevice8_Present(device, NULL, NULL, NULL, NULL); - todo_wine ok(hr == D3DERR_DEVICELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == D3DERR_DEVICELOST, "Got unexpected hr %#x.\n", hr); hr = reset_device(device, window, FALSE); ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); @@ -6336,6 +6336,95 @@ DestroyWindow(window); } +static void test_resource_priority(void) +{ + IDirect3DDevice8 *device; + IDirect3DTexture8 *texture; + IDirect3DVertexBuffer8 *buffer; + IDirect3D8 *d3d; + ULONG refcount; + HWND window; + HRESULT hr; + static const struct + { + D3DPOOL pool; + const char *name; + BOOL can_set_priority; + } + test_data[] = + { + {D3DPOOL_DEFAULT, "D3DPOOL_DEFAULT", FALSE}, + {D3DPOOL_SYSTEMMEM, "D3DPOOL_SYSTEMMEM", FALSE}, + {D3DPOOL_MANAGED, "D3DPOOL_MANAGED", TRUE}, + {D3DPOOL_SCRATCH, "D3DPOOL_SCRATCH", FALSE} + }; + unsigned int i; + DWORD priority; + + window = CreateWindowA("static", "d3d8_test", WS_OVERLAPPEDWINDOW, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + d3d = Direct3DCreate8(D3D_SDK_VERSION); + ok(!!d3d, "Failed to create a D3D object.\n"); + if (!(device = create_device(d3d, window, window, TRUE))) + { + skip("Failed to create a D3D device, skipping tests.\n"); + IDirect3D8_Release(d3d); + DestroyWindow(window); + return; + } + + for (i = 0; i < sizeof(test_data) / sizeof(*test_data); i++) + { + hr = IDirect3DDevice8_CreateTexture(device, 16, 16, 0, 0, D3DFMT_X8R8G8B8, + test_data[i].pool, &texture); + ok(SUCCEEDED(hr), "Failed to create texture, hr %#x, pool %s.\n", hr, test_data[i].name); + + priority = IDirect3DTexture8_GetPriority(texture); + ok(priority == 0, "Got unexpected priority %u, pool %s.\n", priority, test_data[i].name); + priority = IDirect3DTexture8_SetPriority(texture, 1); + ok(priority == 0, "Got unexpected priority %u, pool %s.\n", priority, test_data[i].name); + priority = IDirect3DTexture8_GetPriority(texture); + if (test_data[i].can_set_priority) + { + ok(priority == 1, "Got unexpected priority %u, pool %s.\n", priority, test_data[i].name); + priority = IDirect3DTexture8_SetPriority(texture, 0); + ok(priority == 1, "Got unexpected priority %u, pool %s.\n", priority, test_data[i].name); + } + else + ok(priority == 0, "Got unexpected priority %u, pool %s.\n", priority, test_data[i].name); + + IDirect3DTexture8_Release(texture); + + if (test_data[i].pool != D3DPOOL_SCRATCH) + { + hr = IDirect3DDevice8_CreateVertexBuffer(device, 256, 0, 0, + test_data[i].pool, &buffer); + ok(SUCCEEDED(hr), "Failed to create buffer, hr %#x, pool %s.\n", hr, test_data[i].name); + + priority = IDirect3DVertexBuffer8_GetPriority(buffer); + ok(priority == 0, "Got unexpected priority %u, pool %s.\n", priority, test_data[i].name); + priority = IDirect3DVertexBuffer8_SetPriority(buffer, 1); + ok(priority == 0, "Got unexpected priority %u, pool %s.\n", priority, test_data[i].name); + priority = IDirect3DVertexBuffer8_GetPriority(buffer); + if (test_data[i].can_set_priority) + { + ok(priority == 1, "Got unexpected priority %u, pool %s.\n", priority, test_data[i].name); + priority = IDirect3DVertexBuffer8_SetPriority(buffer, 0); + ok(priority == 1, "Got unexpected priority %u, pool %s.\n", priority, test_data[i].name); + } + else + ok(priority == 0, "Got unexpected priority %u, pool %s.\n", priority, test_data[i].name); + + IDirect3DVertexBuffer8_Release(buffer); + } + } + + refcount = IDirect3DDevice8_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + IDirect3D8_Release(d3d); + DestroyWindow(window); +} + START_TEST(device) { HMODULE d3d8_handle = LoadLibraryA( "d3d8.dll" ); @@ -6422,6 +6511,7 @@ test_mipmap_lock(); test_writeonly_resource(); test_lost_device(); + test_resource_priority(); UnregisterClassA("d3d8_test_wc", GetModuleHandleA(NULL)); } diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/d3d9/device.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/d3d9/device.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/d3d9/device.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/d3d9/device.c 2014-07-11 19:15:41.000000000 +0000 @@ -3147,14 +3147,26 @@ static HRESULT WINAPI d3d9_device_CheckDeviceState(IDirect3DDevice9Ex *iface, HWND dst_window) { - static int i; + struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface); + struct wined3d_swapchain_desc swapchain_desc; + struct wined3d_swapchain *swapchain; - TRACE("iface %p, dst_window %p stub!\n", iface, dst_window); + TRACE("iface %p, dst_window %p.\n", iface, dst_window); - if (!i++) - FIXME("iface %p, dst_window %p stub!\n", iface, dst_window); + wined3d_mutex_lock(); + swapchain = wined3d_device_get_swapchain(device->wined3d_device, 0); + wined3d_swapchain_get_desc(swapchain, &swapchain_desc); + wined3d_mutex_unlock(); - return D3D_OK; + if (swapchain_desc.windowed) + return D3D_OK; + + /* FIXME: This is actually supposed to check if any other device is in + * fullscreen mode. */ + if (dst_window != swapchain_desc.device_window) + return device->device_state == D3D9_DEVICE_STATE_OK ? S_PRESENT_OCCLUDED : D3D_OK; + + return device->device_state == D3D9_DEVICE_STATE_OK ? D3D_OK : S_PRESENT_OCCLUDED; } static HRESULT WINAPI d3d9_device_CreateRenderTargetEx(IDirect3DDevice9Ex *iface, diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/d3d9/surface.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/d3d9/surface.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/d3d9/surface.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/d3d9/surface.c 2014-07-11 19:15:41.000000000 +0000 @@ -169,30 +169,14 @@ static DWORD WINAPI d3d9_surface_SetPriority(IDirect3DSurface9 *iface, DWORD priority) { - struct d3d9_surface *surface = impl_from_IDirect3DSurface9(iface); - DWORD ret; - - TRACE("iface %p, priority %u.\n", iface, priority); - - wined3d_mutex_lock(); - ret = wined3d_surface_set_priority(surface->wined3d_surface, priority); - wined3d_mutex_unlock(); - - return ret; + TRACE("iface %p, priority %u. Ignored on surfaces.\n", iface, priority); + return 0; } static DWORD WINAPI d3d9_surface_GetPriority(IDirect3DSurface9 *iface) { - struct d3d9_surface *surface = impl_from_IDirect3DSurface9(iface); - DWORD ret; - - TRACE("iface %p.\n", iface); - - wined3d_mutex_lock(); - ret = wined3d_surface_get_priority(surface->wined3d_surface); - wined3d_mutex_unlock(); - - return ret; + TRACE("iface %p. Ignored on surfaces.\n", iface); + return 0; } static void WINAPI d3d9_surface_PreLoad(IDirect3DSurface9 *iface) diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/d3d9/tests/d3d9ex.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/d3d9/tests/d3d9ex.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/d3d9/tests/d3d9ex.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/d3d9/tests/d3d9ex.c 2014-07-11 19:15:41.000000000 +0000 @@ -1219,7 +1219,7 @@ hr = IDirect3DDevice9Ex_CheckDeviceState(device, window); ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); hr = IDirect3DDevice9Ex_CheckDeviceState(device, NULL); - todo_wine ok(hr == S_PRESENT_OCCLUDED, "Got unexpected hr %#x.\n", hr); + ok(hr == S_PRESENT_OCCLUDED, "Got unexpected hr %#x.\n", hr); ret = SetForegroundWindow(GetDesktopWindow()); ok(ret, "Failed to set foreground window.\n"); @@ -1230,7 +1230,7 @@ hr = IDirect3DDevice9Ex_PresentEx(device, NULL, NULL, NULL, NULL, 0); ok(hr == S_PRESENT_OCCLUDED, "Got unexpected hr %#x.\n", hr); hr = IDirect3DDevice9Ex_CheckDeviceState(device, window); - todo_wine ok(hr == S_PRESENT_OCCLUDED, "Got unexpected hr %#x.\n", hr); + ok(hr == S_PRESENT_OCCLUDED, "Got unexpected hr %#x.\n", hr); hr = IDirect3DDevice9Ex_CheckDeviceState(device, NULL); ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); @@ -1245,7 +1245,7 @@ hr = IDirect3DDevice9Ex_CheckDeviceState(device, window); ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); hr = IDirect3DDevice9Ex_CheckDeviceState(device, NULL); - todo_wine ok(hr == S_PRESENT_OCCLUDED, "Got unexpected hr %#x.\n", hr); + ok(hr == S_PRESENT_OCCLUDED, "Got unexpected hr %#x.\n", hr); hr = reset_device(device, window, FALSE); ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); @@ -1258,7 +1258,7 @@ hr = IDirect3DDevice9Ex_CheckDeviceState(device, window); ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); hr = IDirect3DDevice9Ex_CheckDeviceState(device, NULL); - todo_wine ok(hr == S_PRESENT_OCCLUDED, "Got unexpected hr %#x.\n", hr); + ok(hr == S_PRESENT_OCCLUDED, "Got unexpected hr %#x.\n", hr); hr = reset_device(device, window, TRUE); ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); @@ -1323,7 +1323,7 @@ hr = IDirect3DDevice9Ex_CheckDeviceState(device, window); ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); hr = IDirect3DDevice9Ex_CheckDeviceState(device, NULL); - todo_wine ok(hr == S_PRESENT_OCCLUDED, "Got unexpected hr %#x.\n", hr); + ok(hr == S_PRESENT_OCCLUDED, "Got unexpected hr %#x.\n", hr); refcount = IDirect3DDevice9Ex_Release(device); ok(!refcount, "Device has %u references left.\n", refcount); diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/d3d9/tests/device.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/d3d9/tests/device.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/d3d9/tests/device.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/d3d9/tests/device.c 2014-07-11 19:15:41.000000000 +0000 @@ -7279,7 +7279,7 @@ } else { - ok (locked_box.pBits == NULL, "Failed lock set pBits = %p, expected NULL.\n", locked_box.pBits); + ok(locked_box.pBits == NULL, "Failed lock set pBits = %p, expected NULL.\n", locked_box.pBits); } IDirect3DVolumeTexture9_Release(texture); } @@ -8885,13 +8885,13 @@ hr = IDirect3DVertexBuffer9_Lock(buffer, 0, 0, &ptr, 0); ok(SUCCEEDED(hr), "Failed to lock vertex buffer, hr %#x.\n", hr); - ok (!memcmp(ptr, quad, sizeof(quad)), "Got unexpected vertex buffer data.\n"); + ok(!memcmp(ptr, quad, sizeof(quad)), "Got unexpected vertex buffer data.\n"); hr = IDirect3DVertexBuffer9_Unlock(buffer); ok(SUCCEEDED(hr), "Failed to unlock vertex buffer, hr %#x.\n", hr); hr = IDirect3DVertexBuffer9_Lock(buffer, 0, 0, &ptr, D3DLOCK_READONLY); ok(SUCCEEDED(hr), "Failed to lock vertex buffer, hr %#x.\n", hr); - ok (!memcmp(ptr, quad, sizeof(quad)), "Got unexpected vertex buffer data.\n"); + ok(!memcmp(ptr, quad, sizeof(quad)), "Got unexpected vertex buffer data.\n"); hr = IDirect3DVertexBuffer9_Unlock(buffer); ok(SUCCEEDED(hr), "Failed to unlock vertex buffer, hr %#x.\n", hr); @@ -8987,6 +8987,135 @@ DestroyWindow(window); } +static void test_resource_priority(void) +{ + IDirect3DDevice9 *device; + IDirect3DSurface9 *surface; + IDirect3DTexture9 *texture; + IDirect3DVertexBuffer9 *buffer; + IDirect3D9 *d3d; + ULONG refcount; + HWND window; + HRESULT hr; + static const struct + { + D3DPOOL pool; + const char *name; + BOOL can_set_priority; + } + test_data[] = + { + {D3DPOOL_DEFAULT, "D3DPOOL_DEFAULT", FALSE}, + {D3DPOOL_SYSTEMMEM, "D3DPOOL_SYSTEMMEM", FALSE}, + {D3DPOOL_MANAGED, "D3DPOOL_MANAGED", TRUE}, + {D3DPOOL_SCRATCH, "D3DPOOL_SCRATCH", FALSE} + }; + unsigned int i; + DWORD priority; + + window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + d3d = Direct3DCreate9(D3D_SDK_VERSION); + ok(!!d3d, "Failed to create a D3D object.\n"); + if (!(device = create_device(d3d, window, window, TRUE))) + { + skip("Failed to create a D3D device, skipping tests.\n"); + IDirect3D9_Release(d3d); + DestroyWindow(window); + return; + } + + for (i = 0; i < sizeof(test_data) / sizeof(*test_data); i++) + { + hr = IDirect3DDevice9_CreateTexture(device, 16, 16, 0, 0, D3DFMT_X8R8G8B8, + test_data[i].pool, &texture, NULL); + ok(SUCCEEDED(hr), "Failed to create texture, hr %#x, pool %s.\n", hr, test_data[i].name); + hr = IDirect3DTexture9_GetSurfaceLevel(texture, 0, &surface); + ok(SUCCEEDED(hr), "Failed to get surface level, hr %#x.\n", hr); + + priority = IDirect3DTexture9_GetPriority(texture); + ok(priority == 0, "Got unexpected priority %u, pool %s.\n", priority, test_data[i].name); + priority = IDirect3DTexture9_SetPriority(texture, 1); + ok(priority == 0, "Got unexpected priority %u, pool %s.\n", priority, test_data[i].name); + priority = IDirect3DTexture9_GetPriority(texture); + if (test_data[i].can_set_priority) + { + ok(priority == 1, "Got unexpected priority %u, pool %s.\n", priority, test_data[i].name); + priority = IDirect3DTexture9_SetPriority(texture, 2); + ok(priority == 1, "Got unexpected priority %u, pool %s.\n", priority, test_data[i].name); + } + else + ok(priority == 0, "Got unexpected priority %u, pool %s.\n", priority, test_data[i].name); + + priority = IDirect3DSurface9_GetPriority(surface); + ok(priority == 0, "Got unexpected priority %u, pool %s.\n", priority, test_data[i].name); + priority = IDirect3DSurface9_SetPriority(surface, 1); + ok(priority == 0, "Got unexpected priority %u, pool %s.\n", priority, test_data[i].name); + priority = IDirect3DSurface9_GetPriority(surface); + ok(priority == 0, "Got unexpected priority %u, pool %s.\n", priority, test_data[i].name); + + IDirect3DSurface9_Release(surface); + IDirect3DTexture9_Release(texture); + + if (test_data[i].pool != D3DPOOL_MANAGED) + { + hr = IDirect3DDevice9_CreateOffscreenPlainSurface(device, 16, 16, D3DFMT_X8R8G8B8, + test_data[i].pool, &surface, NULL); + ok(SUCCEEDED(hr), "Failed to create surface, hr %#x, pool %s.\n", hr, test_data[i].name); + + priority = IDirect3DSurface9_GetPriority(surface); + ok(priority == 0, "Got unexpected priority %u, pool %s.\n", priority, test_data[i].name); + priority = IDirect3DSurface9_SetPriority(surface, 1); + ok(priority == 0, "Got unexpected priority %u, pool %s.\n", priority, test_data[i].name); + priority = IDirect3DSurface9_GetPriority(surface); + ok(priority == 0, "Got unexpected priority %u, pool %s.\n", priority, test_data[i].name); + + IDirect3DSurface9_Release(surface); + } + + if (test_data[i].pool != D3DPOOL_SCRATCH) + { + hr = IDirect3DDevice9_CreateVertexBuffer(device, 256, 0, 0, + test_data[i].pool, &buffer, NULL); + ok(SUCCEEDED(hr), "Failed to create buffer, hr %#x, pool %s.\n", hr, test_data[i].name); + + priority = IDirect3DVertexBuffer9_GetPriority(buffer); + ok(priority == 0, "Got unexpected priority %u, pool %s.\n", priority, test_data[i].name); + priority = IDirect3DVertexBuffer9_SetPriority(buffer, 1); + ok(priority == 0, "Got unexpected priority %u, pool %s.\n", priority, test_data[i].name); + priority = IDirect3DVertexBuffer9_GetPriority(buffer); + if (test_data[i].can_set_priority) + { + ok(priority == 1, "Got unexpected priority %u, pool %s.\n", priority, test_data[i].name); + priority = IDirect3DVertexBuffer9_SetPriority(buffer, 0); + ok(priority == 1, "Got unexpected priority %u, pool %s.\n", priority, test_data[i].name); + } + else + ok(priority == 0, "Got unexpected priority %u, pool %s.\n", priority, test_data[i].name); + + IDirect3DVertexBuffer9_Release(buffer); + } + } + + hr = IDirect3DDevice9_CreateRenderTarget(device, 16, 16, D3DFMT_X8R8G8B8, + D3DMULTISAMPLE_NONE, 0, FALSE, &surface, NULL); + + ok(SUCCEEDED(hr), "Failed to create render target, hr %#x.\n", hr); + priority = IDirect3DSurface9_GetPriority(surface); + ok(priority == 0, "Got unexpected priority %u.\n", priority); + priority = IDirect3DSurface9_SetPriority(surface, 1); + ok(priority == 0, "Got unexpected priority %u.\n", priority); + priority = IDirect3DSurface9_GetPriority(surface); + ok(priority == 0, "Got unexpected priority %u.\n", priority); + + IDirect3DSurface9_Release(surface); + + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + IDirect3D9_Release(d3d); + DestroyWindow(window); +} + START_TEST(device) { WNDCLASSA wc = {0}; @@ -9086,6 +9215,7 @@ test_mipmap_lock(); test_writeonly_resource(); test_lost_device(); + test_resource_priority(); UnregisterClassA("d3d9_test_wc", GetModuleHandleA(NULL)); } diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/d3dx9_36/d3dx9_36.spec wine-compholio-1.7.22~ubuntu13.10.1/dlls/d3dx9_36/d3dx9_36.spec --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/d3dx9_36/d3dx9_36.spec 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/d3dx9_36/d3dx9_36.spec 2014-07-11 19:15:41.000000000 +0000 @@ -105,7 +105,7 @@ @ stdcall D3DXCreateTextureFromResourceW(ptr ptr wstr ptr) @ stub D3DXCreateTextureGutterHelper(long long ptr long ptr) @ stub D3DXCreateTextureShader(ptr ptr) -@ stub D3DXCreateTorus(ptr long long long long ptr ptr) +@ stdcall D3DXCreateTorus(ptr long long long long ptr ptr) @ stdcall D3DXCreateVolumeTexture(ptr long long long long long long long ptr) @ stdcall D3DXCreateVolumeTextureFromFileA(ptr ptr ptr) @ stdcall D3DXCreateVolumeTextureFromFileExA(ptr ptr long long long long long long long long long long ptr ptr ptr) diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/d3dx9_36/mesh.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/d3dx9_36/mesh.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/d3dx9_36/mesh.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/d3dx9_36/mesh.c 2014-07-11 19:15:41.000000000 +0000 @@ -4693,12 +4693,6 @@ return D3DERR_INVALIDCALL; } - if (adjacency) - { - FIXME("Case of adjacency != NULL not implemented.\n"); - return E_NOTIMPL; - } - number_of_vertices = 2 + slices * (stacks-1); number_of_faces = 2 * slices + (stacks - 2) * (2 * slices); @@ -4836,6 +4830,24 @@ free_sincos_table(&phi); sphere->lpVtbl->UnlockIndexBuffer(sphere); sphere->lpVtbl->UnlockVertexBuffer(sphere); + + + if (adjacency) + { + if (FAILED(hr = D3DXCreateBuffer(number_of_faces * sizeof(DWORD) * 3, adjacency))) + { + sphere->lpVtbl->Release(sphere); + return hr; + } + + if (FAILED(hr = sphere->lpVtbl->GenerateAdjacency(sphere, 0.0f, (*adjacency)->lpVtbl->GetBufferPointer(*adjacency)))) + { + (*adjacency)->lpVtbl->Release(*adjacency); + sphere->lpVtbl->Release(sphere); + return hr; + } + } + *mesh = sphere; return D3D_OK; @@ -5056,6 +5068,113 @@ return hr; } +HRESULT WINAPI D3DXCreateTorus(struct IDirect3DDevice9 *device, + float innerradius, float outerradius, UINT sides, UINT rings, struct ID3DXMesh **mesh, ID3DXBuffer **adjacency) +{ + HRESULT hr; + ID3DXMesh *torus; + WORD (*faces)[3]; + struct vertex *vertices; + float phi, phi_step, sin_phi, cos_phi; + float theta, theta_step, sin_theta, cos_theta; + unsigned int i, j, numvert, numfaces; + + TRACE("device %p, innerradius %.8e, outerradius %.8e, sides %u, rings %u, mesh %p, adjacency %p.\n", + device, innerradius, outerradius, sides, rings, mesh, adjacency); + + numvert = sides * rings; + numfaces = numvert * 2; + + if (!device || innerradius < 0.0f || outerradius < 0.0f || sides < 3 || rings < 3 || !mesh) + { + WARN("Invalid arguments.\n"); + return D3DERR_INVALIDCALL; + } + + if (FAILED(hr = D3DXCreateMeshFVF(numfaces, numvert, D3DXMESH_MANAGED, D3DFVF_XYZ | D3DFVF_NORMAL, device, &torus))) + return hr; + + if (FAILED(hr = torus->lpVtbl->LockVertexBuffer(torus, 0, (void **)&vertices))) + { + torus->lpVtbl->Release(torus); + return hr; + } + + if (FAILED(hr = torus->lpVtbl->LockIndexBuffer(torus, 0, (void **)&faces))) + { + torus->lpVtbl->UnlockVertexBuffer(torus); + torus->lpVtbl->Release(torus); + return hr; + } + + phi_step = D3DX_PI / sides * 2.0f; + theta_step = D3DX_PI / rings * -2.0f; + + theta = 0.0f; + + for (i = 0; i < rings; ++i) + { + phi = 0.0f; + + sin_theta = sinf(theta); + cos_theta = cosf(theta); + + for (j = 0; j < sides; ++j) + { + sin_phi = sinf(phi); + cos_phi = cosf(phi); + + vertices[i * sides + j].position.x = (innerradius * cos_phi + outerradius) * cos_theta; + vertices[i * sides + j].position.y = (innerradius * cos_phi + outerradius) * sin_theta; + vertices[i * sides + j].position.z = innerradius * sin_phi; + vertices[i * sides + j].normal.x = cos_phi * cos_theta; + vertices[i * sides + j].normal.y = cos_phi * sin_theta; + vertices[i * sides + j].normal.z = sin_phi; + + phi += phi_step; + } + + theta += theta_step; + } + + for (i = 0; i < numfaces - sides * 2; ++i) + { + faces[i][0] = i % 2 ? i / 2 + sides : i / 2; + faces[i][1] = (i / 2 + 1) % sides ? i / 2 + 1 : i / 2 + 1 - sides; + faces[i][2] = (i + 1) % (sides * 2) ? (i + 1) / 2 + sides : (i + 1) / 2; + } + + for (j = 0; i < numfaces; ++i, ++j) + { + faces[i][0] = i % 2 ? j / 2 : i / 2; + faces[i][1] = (i / 2 + 1) % sides ? i / 2 + 1 : i / 2 + 1 - sides; + faces[i][2] = i == numfaces - 1 ? 0 : (j + 1) / 2; + } + + torus->lpVtbl->UnlockIndexBuffer(torus); + torus->lpVtbl->UnlockVertexBuffer(torus); + + if (adjacency) + { + if (FAILED(hr = D3DXCreateBuffer(numfaces * sizeof(DWORD) * 3, adjacency))) + { + torus->lpVtbl->Release(torus); + return hr; + } + + if (FAILED(hr = torus->lpVtbl->GenerateAdjacency(torus, 0.0f, (*adjacency)->lpVtbl->GetBufferPointer(*adjacency)))) + { + (*adjacency)->lpVtbl->Release(*adjacency); + torus->lpVtbl->Release(torus); + return hr; + } + } + + *mesh = torus; + + return D3D_OK; +} + enum pointtype { POINTTYPE_CURVE = 0, POINTTYPE_CORNER, diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/d3dx9_36/surface.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/d3dx9_36/surface.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/d3dx9_36/surface.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/d3dx9_36/surface.c 2014-07-11 19:15:41.000000000 +0000 @@ -1030,7 +1030,7 @@ * * RETURNS * Success: D3D_OK - * Failure: D3DERR_INVALIDCALL, if pDestSurface or pSrcData or SrcDataSize are NULL + * Failure: D3DERR_INVALIDCALL, if pDestSurface, pSrcData or SrcDataSize is NULL * D3DXERR_INVALIDDATA, if pSrcData is no valid image file * */ @@ -1720,7 +1720,7 @@ * RETURNS * Success: D3D_OK, if we successfully load the pixel data into our surface or * if pSrcMemory is NULL but the other parameters are valid - * Failure: D3DERR_INVALIDCALL, if pDestSurface, SrcPitch or pSrcRect are NULL or + * Failure: D3DERR_INVALIDCALL, if pDestSurface, SrcPitch or pSrcRect is NULL or * if SrcFormat is an invalid format (other than D3DFMT_UNKNOWN) or * if DestRect is invalid * D3DXERR_INVALIDDATA, if we fail to lock pDestSurface @@ -1871,7 +1871,7 @@ * * RETURNS * Success: D3D_OK - * Failure: D3DERR_INVALIDCALL, if pDestSurface or pSrcSurface are NULL + * Failure: D3DERR_INVALIDCALL, if pDestSurface or pSrcSurface is NULL * D3DXERR_INVALIDDATA, if one of the surfaces is not lockable * */ diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/d3dx9_36/tests/mesh.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/d3dx9_36/tests/mesh.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/d3dx9_36/tests/mesh.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/d3dx9_36/tests/mesh.c 2014-07-11 19:15:41.000000000 +0000 @@ -3157,6 +3157,165 @@ DestroyWindow(wnd); } +static BOOL compute_torus(struct mesh *mesh, float innerradius, float outerradius, UINT sides, UINT rings) +{ + float phi, phi_step, sin_phi, cos_phi; + float theta, theta_step, sin_theta, cos_theta; + unsigned int numvert, numfaces, i, j; + + numvert = sides * rings; + numfaces = numvert * 2; + + if (!new_mesh(mesh, numvert, numfaces)) + return FALSE; + + phi_step = D3DX_PI / sides * 2.0f; + theta_step = D3DX_PI / rings * -2.0f; + + theta = 0.0f; + + for (i = 0; i < rings; ++i) + { + phi = 0.0f; + + cos_theta = cosf(theta); + sin_theta = sinf(theta); + + for (j = 0; j < sides; ++j) + { + sin_phi = sinf(phi); + cos_phi = cosf(phi); + + mesh->vertices[i * sides + j].position.x = (innerradius * cos_phi + outerradius) * cos_theta; + mesh->vertices[i * sides + j].position.y = (innerradius * cos_phi + outerradius) * sin_theta; + mesh->vertices[i * sides + j].position.z = innerradius * sin_phi; + mesh->vertices[i * sides + j].normal.x = cos_phi * cos_theta; + mesh->vertices[i * sides + j].normal.y = cos_phi * sin_theta; + mesh->vertices[i * sides + j].normal.z = sin_phi; + + phi += phi_step; + } + + theta += theta_step; + } + + for (i = 0; i < numfaces - sides * 2; ++i) + { + mesh->faces[i][0] = i % 2 ? i / 2 + sides : i / 2; + mesh->faces[i][1] = (i / 2 + 1) % sides ? i / 2 + 1 : i / 2 + 1 - sides; + mesh->faces[i][2] = (i + 1) % (sides * 2) ? (i + 1) / 2 + sides : (i + 1) / 2; + } + + for (j = 0; i < numfaces; ++i, ++j) + { + mesh->faces[i][0] = i % 2 ? j / 2 : i / 2; + mesh->faces[i][1] = (i / 2 + 1) % sides ? i / 2 + 1 : i / 2 + 1 - sides; + mesh->faces[i][2] = i == numfaces - 1 ? 0 : (j + 1) / 2; + } + + return TRUE; +} + +static void test_torus(IDirect3DDevice9 *device, float innerradius, float outerradius, UINT sides, UINT rings) +{ + HRESULT hr; + ID3DXMesh *torus; + struct mesh mesh; + char name[256]; + + hr = D3DXCreateTorus(device, innerradius, outerradius, sides, rings, &torus, NULL); + ok(hr == D3D_OK, "Got result %#x, expected 0 (D3D_OK)\n", hr); + if (hr != D3D_OK) + { + skip("Couldn't create torus\n"); + return; + } + + if (!compute_torus(&mesh, innerradius, outerradius, sides, rings)) + { + skip("Couldn't create mesh\n"); + torus->lpVtbl->Release(torus); + return; + } + + mesh.fvf = D3DFVF_XYZ | D3DFVF_NORMAL; + + sprintf(name, "torus (%g, %g, %u, %u)", innerradius, outerradius, sides, rings); + compare_mesh(name, torus, &mesh); + + free_mesh(&mesh); + + torus->lpVtbl->Release(torus); +} + +static void D3DXCreateTorusTest(void) +{ + + HRESULT hr; + HWND wnd; + IDirect3D9* d3d; + IDirect3DDevice9* device; + D3DPRESENT_PARAMETERS d3dpp; + ID3DXMesh* torus = NULL; + + if (!(wnd = CreateWindowA("static", "d3dx9_test", WS_OVERLAPPEDWINDOW, 0, 0, + 640, 480, NULL, NULL, NULL, NULL))) + { + skip("Couldn't create application window\n"); + return; + } + + if (!(d3d = Direct3DCreate9(D3D_SDK_VERSION))) + { + skip("Couldn't create IDirect3D9 object\n"); + DestroyWindow(wnd); + return; + } + + ZeroMemory(&d3dpp, sizeof(d3dpp)); + d3dpp.Windowed = TRUE; + d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; + hr = IDirect3D9_CreateDevice(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, wnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &device); + if (FAILED(hr)) + { + skip("Failed to create IDirect3DDevice9 object %#x\n", hr); + IDirect3D9_Release(d3d); + DestroyWindow(wnd); + return; + } + + hr = D3DXCreateTorus(NULL, 0.0f, 0.0f, 3, 3, &torus, NULL); + ok(hr == D3DERR_INVALIDCALL, "Got result %#x, expected %#x (D3DERR_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL); + + hr = D3DXCreateTorus(device, -1.0f, 0.0f, 3, 3, &torus, NULL); + ok(hr == D3DERR_INVALIDCALL, "Got result %#x, expected %#x (D3DERR_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL); + + hr = D3DXCreateTorus(device, 0.0f, -1.0f, 3, 3, &torus, NULL); + ok(hr == D3DERR_INVALIDCALL, "Got result %#x, expected %#x (D3DERR_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL); + + hr = D3DXCreateTorus(device, 0.0f, 0.0f, 2, 3, &torus, NULL); + ok(hr == D3DERR_INVALIDCALL, "Got result %#x, expected %#x (D3DERR_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL); + + hr = D3DXCreateTorus(device, 0.0f, 0.0f, 3, 2, &torus, NULL); + ok(hr == D3DERR_INVALIDCALL, "Got result %#x, expected %#x (D3DERR_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL); + + hr = D3DXCreateTorus(device, 0.0f, 0.0f, 3, 3, NULL, NULL); + ok(hr == D3DERR_INVALIDCALL, "Got result %#x, expected %#x (D3DERR_INVALIDCALL)\n", hr, D3DERR_INVALIDCALL); + + test_torus(device, 0.0f, 0.0f, 3, 3); + test_torus(device, 1.0f, 1.0f, 3, 3); + test_torus(device, 1.0f, 1.0f, 32, 64); + test_torus(device, 0.0f, 1.0f, 5, 5); + test_torus(device, 1.0f, 0.0f, 5, 5); + test_torus(device, 5.0f, 0.2f, 8, 8); + test_torus(device, 0.2f, 1.0f, 60, 3); + test_torus(device, 0.2f, 1.0f, 8, 70); + + IDirect3DDevice9_Release(device); + IDirect3D9_Release(d3d); + DestroyWindow(wnd); +} + struct dynamic_array { int count, capacity; @@ -10302,6 +10461,7 @@ D3DXCreateSphereTest(); D3DXCreateCylinderTest(); D3DXCreateTextTest(); + D3DXCreateTorusTest(); test_get_decl_length(); test_get_decl_vertex_size(); test_fvf_decl_conversion(); diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/dbghelp/macho_module.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/dbghelp/macho_module.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/dbghelp/macho_module.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/dbghelp/macho_module.c 2014-07-11 19:15:41.000000000 +0000 @@ -398,6 +398,11 @@ TRACE("Ignoring special Wine segment %s\n", debugstr_an(sc->segname, sizeof(sc->segname))); return 0; } + if (!strncmp(sc->segname, "__PAGEZERO", 10)) + { + TRACE("Ignoring __PAGEZERO segment\n"); + return 0; + } /* If this segment starts before previously-known earliest, record * new earliest. */ @@ -1020,6 +1025,8 @@ struct module_format* modfmt = HeapAlloc(GetProcessHeap(), 0, sizeof(struct module_format) + sizeof(struct macho_module_info)); if (!modfmt) goto leave; + if (!load_addr) + load_addr = fmap.segs_start; macho_info->module = module_new(pcs, filename, DMT_MACHO, FALSE, load_addr, fmap.segs_size, 0, calc_crc32(fmap.fd)); if (!macho_info->module) diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/ddraw/ddraw.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/ddraw/ddraw.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/ddraw/ddraw.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/ddraw/ddraw.c 2014-07-11 19:15:41.000000000 +0000 @@ -2185,23 +2185,13 @@ return ddraw7_GetScanLine(&ddraw->IDirectDraw7_iface, line); } -/***************************************************************************** - * IDirectDraw7::TestCooperativeLevel - * - * Informs the application about the state of the video adapter, depending - * on the cooperative level - * - * Returns: - * DD_OK if the device is in a sane state - * DDERR_NOEXCLUSIVEMODE or DDERR_EXCLUSIVEMODEALREADYSET - * if the state is not correct(See below) - * - *****************************************************************************/ static HRESULT WINAPI ddraw7_TestCooperativeLevel(IDirectDraw7 *iface) { + struct ddraw *ddraw = impl_from_IDirectDraw7(iface); + TRACE("iface %p.\n", iface); - return DD_OK; + return ddraw->device_state == DDRAW_DEVICE_STATE_OK ? DD_OK : DDERR_NOEXCLUSIVEMODE; } static HRESULT WINAPI ddraw4_TestCooperativeLevel(IDirectDraw4 *iface) @@ -2685,27 +2675,20 @@ return hr; } -/***************************************************************************** - * IDirectDraw7::RestoreAllSurfaces - * - * Calls the restore method of all surfaces - * - * Params: - * - * Returns: - * Always returns DD_OK because it's a stub - * - *****************************************************************************/ +static HRESULT CALLBACK restore_callback(IDirectDrawSurface7 *surface, DDSURFACEDESC2 *desc, void *context) +{ + IDirectDrawSurface_Restore(surface); + IDirectDrawSurface_Release(surface); + + return DDENUMRET_OK; +} + static HRESULT WINAPI ddraw7_RestoreAllSurfaces(IDirectDraw7 *iface) { - FIXME("iface %p stub!\n", iface); + TRACE("iface %p.\n", iface); - /* This isn't hard to implement: Enumerate all WineD3D surfaces, - * get their parent and call their restore method. Do not implement - * it in WineD3D, as restoring a surface means re-creating the - * WineD3DDSurface - */ - return DD_OK; + return IDirectDraw7_EnumSurfaces(iface, DDENUMSURFACES_ALL | DDENUMSURFACES_DOESEXIST, + NULL, NULL, restore_callback); } static HRESULT WINAPI ddraw4_RestoreAllSurfaces(IDirectDraw4 *iface) @@ -4724,7 +4707,14 @@ static void CDECL device_parent_activate(struct wined3d_device_parent *device_parent, BOOL activate) { + struct ddraw *ddraw = ddraw_from_device_parent(device_parent); + TRACE("device_parent %p, activate %#x.\n", device_parent, activate); + + if (!activate) + InterlockedCompareExchange(&ddraw->device_state, DDRAW_DEVICE_STATE_LOST, DDRAW_DEVICE_STATE_OK); + else + InterlockedCompareExchange(&ddraw->device_state, DDRAW_DEVICE_STATE_OK, DDRAW_DEVICE_STATE_LOST); } static HRESULT CDECL device_parent_surface_created(struct wined3d_device_parent *device_parent, diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/ddraw/ddraw_private.h wine-compholio-1.7.22~ubuntu13.10.1/dlls/ddraw/ddraw_private.h --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/ddraw/ddraw_private.h 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/ddraw/ddraw_private.h 2014-07-11 19:15:41.000000000 +0000 @@ -58,6 +58,12 @@ #define DDRAW_STRIDE_ALIGNMENT 8 +enum ddraw_device_state +{ + DDRAW_DEVICE_STATE_OK, + DDRAW_DEVICE_STATE_LOST, +}; + struct ddraw { /* Interfaces */ @@ -77,6 +83,7 @@ struct wined3d *wined3d; struct wined3d_device *wined3d_device; DWORD flags; + LONG device_state; struct ddraw_surface *primary; RECT primary_lock; @@ -200,6 +207,8 @@ HRESULT ddraw_surface_init(struct ddraw_surface *surface, struct ddraw *ddraw, struct ddraw_texture *texture, struct wined3d_surface *wined3d_surface, const struct wined3d_parent_ops **parent_ops) DECLSPEC_HIDDEN; ULONG ddraw_surface_release_iface(struct ddraw_surface *This) DECLSPEC_HIDDEN; +HRESULT ddraw_surface_update_frontbuffer(struct ddraw_surface *surface, + const RECT *rect, BOOL read) DECLSPEC_HIDDEN; static inline struct ddraw_surface *impl_from_IDirect3DTexture(IDirect3DTexture *iface) { diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/ddraw/palette.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/ddraw/palette.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/ddraw/palette.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/ddraw/palette.c 2014-07-11 19:15:41.000000000 +0000 @@ -175,6 +175,10 @@ wined3d_mutex_lock(); hr = wined3d_palette_set_entries(palette->wineD3DPalette, flags, start, count, entries); + + if (SUCCEEDED(hr) && palette->flags & DDPCAPS_PRIMARYSURFACE) + ddraw_surface_update_frontbuffer(palette->ddraw->primary, NULL, FALSE); + wined3d_mutex_unlock(); return hr; diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/ddraw/surface.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/ddraw/surface.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/ddraw/surface.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/ddraw/surface.c 2014-07-11 19:15:41.000000000 +0000 @@ -40,7 +40,7 @@ * applications from drawing to the screen while we've locked the frontbuffer. * We'd like to do this in wined3d instead, but for that to work wined3d needs * to support windowless rendering first. */ -static HRESULT ddraw_surface_update_frontbuffer(struct ddraw_surface *surface, const RECT *rect, BOOL read) +HRESULT ddraw_surface_update_frontbuffer(struct ddraw_surface *surface, const RECT *rect, BOOL read) { HDC surface_dc, screen_dc; int x, y, w, h; @@ -473,17 +473,15 @@ prev->flags &= ~DDPCAPS_PRIMARYSURFACE; if (palette_impl) palette_impl->flags |= DDPCAPS_PRIMARYSURFACE; - /* Update the wined3d frontbuffer if this is the primary. */ - if (surface->ddraw->wined3d_frontbuffer) - wined3d_surface_set_palette(surface->ddraw->wined3d_frontbuffer, - palette_impl ? palette_impl->wineD3DPalette : NULL); + wined3d_swapchain_set_palette(surface->ddraw->wined3d_swapchain, + palette_impl ? palette_impl->wineD3DPalette : NULL); + ddraw_surface_update_frontbuffer(surface, NULL, FALSE); } if (palette_impl) IDirectDrawPalette_AddRef(&palette_impl->IDirectDrawPalette_iface); if (prev) IDirectDrawPalette_Release(&prev->IDirectDrawPalette_iface); surface->palette = palette_impl; - wined3d_surface_set_palette(surface->wined3d_surface, palette_impl ? palette_impl->wineD3DPalette : NULL); wined3d_mutex_unlock(); @@ -1229,6 +1227,9 @@ if (src == iface || !(dst_impl->surface_desc.ddsCaps.dwCaps & (DDSCAPS_FRONTBUFFER | DDSCAPS_OVERLAY))) return DDERR_NOTFLIPPABLE; + if (IDirectDrawSurface7_IsLost(iface) == DDERR_SURFACELOST) + return DDERR_SURFACELOST; + wined3d_mutex_lock(); tmp = dst_impl->wined3d_surface; @@ -4514,6 +4515,11 @@ if (!palette) return DDERR_INVALIDPARAMS; + if (IDirectDrawSurface7_IsLost(iface) == DDERR_SURFACELOST) + { + WARN("Surface lost, returning DDERR_SURFACELOST.\n"); + return DDERR_SURFACELOST; + } wined3d_mutex_lock(); if ((palette_impl = surface->palette)) @@ -4704,6 +4710,11 @@ if (surface->surface_desc.ddsCaps.dwCaps2 & DDSCAPS2_MIPMAPSUBLEVEL) return DDERR_NOTONMIPMAPSUBLEVEL; + if (IDirectDrawSurface7_IsLost(iface) == DDERR_SURFACELOST) + { + WARN("Surface lost, returning DDERR_SURFACELOST.\n"); + return DDERR_SURFACELOST; + } return ddraw_surface_set_palette(surface, palette); } @@ -4714,6 +4725,12 @@ TRACE("iface %p, palette %p.\n", iface, palette); + if (IDirectDrawSurface4_IsLost(iface) == DDERR_SURFACELOST) + { + WARN("Surface lost, returning DDERR_SURFACELOST.\n"); + return DDERR_SURFACELOST; + } + return ddraw_surface_set_palette(surface, palette); } @@ -4723,6 +4740,12 @@ TRACE("iface %p, palette %p.\n", iface, palette); + if (IDirectDrawSurface3_IsLost(iface) == DDERR_SURFACELOST) + { + WARN("Surface lost, returning DDERR_SURFACELOST.\n"); + return DDERR_SURFACELOST; + } + return ddraw_surface_set_palette(surface, palette); } @@ -4732,6 +4755,12 @@ TRACE("iface %p, palette %p.\n", iface, palette); + if (IDirectDrawSurface2_IsLost(iface) == DDERR_SURFACELOST) + { + WARN("Surface lost, returning DDERR_SURFACELOST.\n"); + return DDERR_SURFACELOST; + } + return ddraw_surface_set_palette(surface, palette); } @@ -4741,6 +4770,12 @@ TRACE("iface %p, palette %p.\n", iface, palette); + if (IDirectDrawSurface_IsLost(iface) == DDERR_SURFACELOST) + { + WARN("Surface lost, returning DDERR_SURFACELOST.\n"); + return DDERR_SURFACELOST; + } + return ddraw_surface_set_palette(surface, palette); } diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/ddraw/tests/ddraw1.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/ddraw/tests/ddraw1.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/ddraw/tests/ddraw1.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/ddraw/tests/ddraw1.c 2014-07-11 19:15:41.000000000 +0000 @@ -4777,10 +4777,10 @@ HRESULT hr; PALETTEENTRY palette_entries[256]; unsigned int x; - static const BYTE src_data[] = {0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0xff, 0x80}; + static const BYTE src_data[] = {0x10, 0x1, 0x2, 0x3, 0x4, 0x5, 0xff, 0x80}; static const D3DCOLOR expected[] = { - 0x00000000, 0x00010101, 0x00020202, 0x00030303, + 0x00101010, 0x00010101, 0x00020202, 0x00030303, 0x00040404, 0x00050505, 0x00ffffff, 0x00808080, }; D3DCOLOR color; @@ -4793,10 +4793,10 @@ ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); memset(palette_entries, 0, sizeof(palette_entries)); - palette_entries[0].peRed = 0xff; palette_entries[1].peGreen = 0xff; palette_entries[2].peBlue = 0xff; palette_entries[3].peFlags = 0xff; + palette_entries[4].peRed = 0xff; hr = IDirectDraw_CreatePalette(ddraw, DDPCAPS_8BIT | DDPCAPS_ALLOW256, palette_entries, &palette, NULL); ok(SUCCEEDED(hr), "Failed to create palette, hr %#x.\n", hr); diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/ddraw/tests/ddraw2.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/ddraw/tests/ddraw2.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/ddraw/tests/ddraw2.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/ddraw/tests/ddraw2.c 2014-07-11 19:15:41.000000000 +0000 @@ -5862,10 +5862,10 @@ HRESULT hr; PALETTEENTRY palette_entries[256]; unsigned int x; - static const BYTE src_data[] = {0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0xff, 0x80}; + static const BYTE src_data[] = {0x10, 0x1, 0x2, 0x3, 0x4, 0x5, 0xff, 0x80}; static const D3DCOLOR expected[] = { - 0x00000000, 0x00010101, 0x00020202, 0x00030303, + 0x00101010, 0x00010101, 0x00020202, 0x00030303, 0x00040404, 0x00050505, 0x00ffffff, 0x00808080, }; D3DCOLOR color; @@ -5878,10 +5878,10 @@ ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); memset(palette_entries, 0, sizeof(palette_entries)); - palette_entries[0].peRed = 0xff; palette_entries[1].peGreen = 0xff; palette_entries[2].peBlue = 0xff; palette_entries[3].peFlags = 0xff; + palette_entries[4].peRed = 0xff; hr = IDirectDraw2_CreatePalette(ddraw, DDPCAPS_8BIT | DDPCAPS_ALLOW256, palette_entries, &palette, NULL); ok(SUCCEEDED(hr), "Failed to create palette, hr %#x.\n", hr); @@ -6610,7 +6610,7 @@ hr = IDirectDrawSurface_IsLost(surface); ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); hr = IDirectDrawSurface_Flip(surface, NULL, DDFLIP_WAIT); - todo_wine ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); /* Trying to restore the primary will crash, probably because flippable * surfaces can't exist in DDSCL_NORMAL. */ diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/ddraw/tests/ddraw4.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/ddraw/tests/ddraw4.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/ddraw/tests/ddraw4.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/ddraw/tests/ddraw4.c 2014-07-11 19:15:41.000000000 +0000 @@ -6850,10 +6850,10 @@ HRESULT hr; PALETTEENTRY palette_entries[256]; unsigned int x; - static const BYTE src_data[] = {0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0xff, 0x80}; + static const BYTE src_data[] = {0x10, 0x1, 0x2, 0x3, 0x4, 0x5, 0xff, 0x80}; static const D3DCOLOR expected[] = { - 0x00000000, 0x00010101, 0x00020202, 0x00030303, + 0x00101010, 0x00010101, 0x00020202, 0x00030303, 0x00040404, 0x00050505, 0x00ffffff, 0x00808080, }; D3DCOLOR color; @@ -6866,10 +6866,10 @@ ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); memset(palette_entries, 0, sizeof(palette_entries)); - palette_entries[0].peRed = 0xff; palette_entries[1].peGreen = 0xff; palette_entries[2].peBlue = 0xff; palette_entries[3].peFlags = 0xff; + palette_entries[4].peRed = 0xff; hr = IDirectDraw4_CreatePalette(ddraw, DDPCAPS_8BIT | DDPCAPS_ALLOW256, palette_entries, &palette, NULL); ok(SUCCEEDED(hr), "Failed to create palette, hr %#x.\n", hr); @@ -7644,7 +7644,7 @@ ret = SetForegroundWindow(GetDesktopWindow()); ok(ret, "Failed to set foreground window.\n"); hr = IDirectDraw4_TestCooperativeLevel(ddraw); - todo_wine ok(hr == DDERR_NOEXCLUSIVEMODE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOEXCLUSIVEMODE, "Got unexpected hr %#x.\n", hr); hr = IDirectDrawSurface4_IsLost(surface); todo_wine ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); hr = IDirectDrawSurface4_Flip(surface, NULL, DDFLIP_WAIT); @@ -7675,7 +7675,7 @@ hr = IDirectDrawSurface4_IsLost(surface); ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); hr = IDirectDrawSurface4_Flip(surface, NULL, DDFLIP_WAIT); - todo_wine ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); /* Trying to restore the primary will crash, probably because flippable * surfaces can't exist in DDSCL_NORMAL. */ @@ -7718,7 +7718,7 @@ hr = IDirectDraw4_TestCooperativeLevel(ddraw); ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); hr = IDirectDrawSurface4_IsLost(surface); - todo_wine ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); IDirectDrawSurface4_Release(surface); refcount = IDirectDraw4_Release(ddraw); diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/ddraw/tests/ddraw7.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/ddraw/tests/ddraw7.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/ddraw/tests/ddraw7.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/ddraw/tests/ddraw7.c 2014-07-11 19:15:41.000000000 +0000 @@ -6680,10 +6680,10 @@ HRESULT hr; PALETTEENTRY palette_entries[256]; unsigned int x; - static const BYTE src_data[] = {0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0xff, 0x80}; + static const BYTE src_data[] = {0x10, 0x1, 0x2, 0x3, 0x4, 0x5, 0xff, 0x80}; static const D3DCOLOR expected[] = { - 0x00000000, 0x00010101, 0x00020202, 0x00030303, + 0x00101010, 0x00010101, 0x00020202, 0x00030303, 0x00040404, 0x00050505, 0x00ffffff, 0x00808080, }; D3DCOLOR color; @@ -6696,10 +6696,10 @@ ok(SUCCEEDED(hr), "Failed to set cooperative level, hr %#x.\n", hr); memset(palette_entries, 0, sizeof(palette_entries)); - palette_entries[0].peRed = 0xff; palette_entries[1].peGreen = 0xff; palette_entries[2].peBlue = 0xff; palette_entries[3].peFlags = 0xff; + palette_entries[4].peRed = 0xff; hr = IDirectDraw7_CreatePalette(ddraw, DDPCAPS_8BIT | DDPCAPS_ALLOW256, palette_entries, &palette, NULL); ok(SUCCEEDED(hr), "Failed to create palette, hr %#x.\n", hr); @@ -7366,7 +7366,7 @@ ret = SetForegroundWindow(GetDesktopWindow()); ok(ret, "Failed to set foreground window.\n"); hr = IDirectDraw7_TestCooperativeLevel(ddraw); - todo_wine ok(hr == DDERR_NOEXCLUSIVEMODE, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_NOEXCLUSIVEMODE, "Got unexpected hr %#x.\n", hr); hr = IDirectDrawSurface7_IsLost(surface); todo_wine ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); hr = IDirectDrawSurface7_Flip(surface, NULL, DDFLIP_WAIT); @@ -7397,7 +7397,7 @@ hr = IDirectDrawSurface7_IsLost(surface); ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); hr = IDirectDrawSurface7_Flip(surface, NULL, DDFLIP_WAIT); - todo_wine ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); + ok(hr == DDERR_SURFACELOST, "Got unexpected hr %#x.\n", hr); /* Trying to restore the primary will crash, probably because flippable * surfaces can't exist in DDSCL_NORMAL. */ @@ -7440,7 +7440,7 @@ hr = IDirectDraw7_TestCooperativeLevel(ddraw); ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); hr = IDirectDrawSurface7_IsLost(surface); - todo_wine ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); IDirectDrawSurface7_Release(surface); refcount = IDirectDraw7_Release(ddraw); diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/ddraw/tests/visual.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/ddraw/tests/visual.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/ddraw/tests/visual.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/ddraw/tests/visual.c 2014-07-11 19:15:41.000000000 +0000 @@ -23,6 +23,16 @@ #include "ddraw.h" #include "d3d.h" +struct vec3 +{ + float x, y, z; +}; + +struct vec4 +{ + float x, y, z, w; +}; + static HWND window; static IDirectDraw7 *DirectDraw; static IDirectDrawSurface7 *Surface; @@ -264,25 +274,6 @@ return; } -struct vertex -{ - float x, y, z; - DWORD diffuse; -}; - -struct tvertex -{ - float x, y, z, w; - DWORD diffuse; -}; - -struct nvertex -{ - float x, y, z; - float nx, ny, nz; - DWORD diffuse; -}; - static void lighting_test(IDirect3DDevice7 *device) { HRESULT hr; @@ -297,33 +288,44 @@ 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, }; - struct vertex unlitquad[] = + struct { - {-1.0f, -1.0f, 0.1f, 0xffff0000}, - {-1.0f, 0.0f, 0.1f, 0xffff0000}, - { 0.0f, 0.0f, 0.1f, 0xffff0000}, - { 0.0f, -1.0f, 0.1f, 0xffff0000}, - }; - struct vertex litquad[] = + struct vec3 position; + DWORD diffuse; + } + unlitquad[] = { - {-1.0f, 0.0f, 0.1f, 0xff00ff00}, - {-1.0f, 1.0f, 0.1f, 0xff00ff00}, - { 0.0f, 1.0f, 0.1f, 0xff00ff00}, - { 0.0f, 0.0f, 0.1f, 0xff00ff00}, + {{-1.0f, -1.0f, 0.1f}, 0xffff0000}, + {{-1.0f, 0.0f, 0.1f}, 0xffff0000}, + {{ 0.0f, 0.0f, 0.1f}, 0xffff0000}, + {{ 0.0f, -1.0f, 0.1f}, 0xffff0000}, + }, + litquad[] = + { + {{-1.0f, 0.0f, 0.1f}, 0xff00ff00}, + {{-1.0f, 1.0f, 0.1f}, 0xff00ff00}, + {{ 0.0f, 1.0f, 0.1f}, 0xff00ff00}, + {{ 0.0f, 0.0f, 0.1f}, 0xff00ff00}, }; - struct nvertex unlitnquad[] = + struct { - { 0.0f, -1.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xff0000ff}, - { 0.0f, 0.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xff0000ff}, - { 1.0f, 0.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xff0000ff}, - { 1.0f, -1.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xff0000ff}, - }; - struct nvertex litnquad[] = + struct vec3 position; + struct vec3 normal; + DWORD diffuse; + } + unlitnquad[] = { - { 0.0f, 0.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xffffff00}, - { 0.0f, 1.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xffffff00}, - { 1.0f, 1.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xffffff00}, - { 1.0f, 0.0f, 0.1f, 1.0f, 1.0f, 1.0f, 0xffffff00}, + {{0.0f, -1.0f, 0.1f}, {1.0f, 1.0f, 1.0f}, 0xff0000ff}, + {{0.0f, 0.0f, 0.1f}, {1.0f, 1.0f, 1.0f}, 0xff0000ff}, + {{1.0f, 0.0f, 0.1f}, {1.0f, 1.0f, 1.0f}, 0xff0000ff}, + {{1.0f, -1.0f, 0.1f}, {1.0f, 1.0f, 1.0f}, 0xff0000ff}, + }, + litnquad[] = + { + {{0.0f, 0.0f, 0.1f}, {1.0f, 1.0f, 1.0f}, 0xffffff00}, + {{0.0f, 1.0f, 0.1f}, {1.0f, 1.0f, 1.0f}, 0xffffff00}, + {{1.0f, 1.0f, 0.1f}, {1.0f, 1.0f, 1.0f}, 0xffffff00}, + {{1.0f, 0.0f, 0.1f}, {1.0f, 1.0f, 1.0f}, 0xffffff00}, }; WORD Indices[] = {0, 1, 2, 2, 3, 0}; @@ -930,19 +932,24 @@ DWORD color, red, green, blue; DDSURFACEDESC2 ddsd; - struct vertex quad1[] = + struct { - {-1.0f, -1.0f, 0.1f, 0x4000ff00}, - {-1.0f, 0.0f, 0.1f, 0x4000ff00}, - { 1.0f, -1.0f, 0.1f, 0x4000ff00}, - { 1.0f, 0.0f, 0.1f, 0x4000ff00}, - }; - struct vertex quad2[] = - { - {-1.0f, 0.0f, 0.1f, 0xc00000ff}, - {-1.0f, 1.0f, 0.1f, 0xc00000ff}, - { 1.0f, 0.0f, 0.1f, 0xc00000ff}, - { 1.0f, 1.0f, 0.1f, 0xc00000ff}, + struct vec3 position; + DWORD diffuse; + } + quad1[] = + { + {{-1.0f, -1.0f, 0.1f}, 0x4000ff00}, + {{-1.0f, 0.0f, 0.1f}, 0x4000ff00}, + {{ 1.0f, -1.0f, 0.1f}, 0x4000ff00}, + {{ 1.0f, 0.0f, 0.1f}, 0x4000ff00}, + }, + quad2[] = + { + {{-1.0f, 0.0f, 0.1f}, 0xc00000ff}, + {{-1.0f, 1.0f, 0.1f}, 0xc00000ff}, + {{ 1.0f, 0.0f, 0.1f}, 0xc00000ff}, + {{ 1.0f, 1.0f, 0.1f}, 0xc00000ff}, }; static float composite_quad[][5] = { { 0.0f, -1.0f, 0.1f, 0.0f, 1.0f}, @@ -2237,12 +2244,17 @@ 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, }; - struct vertex quad[] = + struct + { + struct vec3 position; + DWORD diffuse; + } + quad[] = { - {-1.0f, -1.0f, 0.1f, 0xffffffff}, - {-1.0f, 1.0f, 0.1f, 0xffffffff}, - { 1.0f, 1.0f, 0.1f, 0xffffffff}, - { 1.0f, -1.0f, 0.1f, 0xffffffff}, + {{-1.0f, -1.0f, 0.1f}, 0xffffffff}, + {{-1.0f, 1.0f, 0.1f}, 0xffffffff}, + {{ 1.0f, 1.0f, 0.1f}, 0xffffffff}, + {{ 1.0f, -1.0f, 0.1f}, 0xffffffff}, }; WORD Indices[] = {0, 1, 2, 2, 3, 0}; @@ -2967,47 +2979,57 @@ */ static void depth_clamp_test(IDirect3DDevice7 *device) { - struct tvertex quad1[] = - { - { 0.0f, 0.0f, 5.0f, 1.0f, 0xff002b7f}, - {640.0f, 0.0f, 5.0f, 1.0f, 0xff002b7f}, - { 0.0f, 480.0f, 5.0f, 1.0f, 0xff002b7f}, - {640.0f, 480.0f, 5.0f, 1.0f, 0xff002b7f}, - }; - struct tvertex quad2[] = + struct { - { 0.0f, 300.0f, 10.0f, 1.0f, 0xfff9e814}, - {640.0f, 300.0f, 10.0f, 1.0f, 0xfff9e814}, - { 0.0f, 360.0f, 10.0f, 1.0f, 0xfff9e814}, - {640.0f, 360.0f, 10.0f, 1.0f, 0xfff9e814}, - }; - struct tvertex quad3[] = - { - {112.0f, 108.0f, 5.0f, 1.0f, 0xffffffff}, - {208.0f, 108.0f, 5.0f, 1.0f, 0xffffffff}, - {112.0f, 204.0f, 5.0f, 1.0f, 0xffffffff}, - {208.0f, 204.0f, 5.0f, 1.0f, 0xffffffff}, - }; - struct tvertex quad4[] = + struct vec4 position; + DWORD diffuse; + } + quad1[] = { - { 42.0f, 41.0f, 10.0f, 1.0f, 0xffffffff}, - {112.0f, 41.0f, 10.0f, 1.0f, 0xffffffff}, - { 42.0f, 108.0f, 10.0f, 1.0f, 0xffffffff}, - {112.0f, 108.0f, 10.0f, 1.0f, 0xffffffff}, + {{ 0.0f, 0.0f, 5.0f, 1.0f}, 0xff002b7f}, + {{640.0f, 0.0f, 5.0f, 1.0f}, 0xff002b7f}, + {{ 0.0f, 480.0f, 5.0f, 1.0f}, 0xff002b7f}, + {{640.0f, 480.0f, 5.0f, 1.0f}, 0xff002b7f}, + }, + quad2[] = + { + {{ 0.0f, 300.0f, 10.0f, 1.0f}, 0xfff9e814}, + {{640.0f, 300.0f, 10.0f, 1.0f}, 0xfff9e814}, + {{ 0.0f, 360.0f, 10.0f, 1.0f}, 0xfff9e814}, + {{640.0f, 360.0f, 10.0f, 1.0f}, 0xfff9e814}, + }, + quad3[] = + { + {{112.0f, 108.0f, 5.0f, 1.0f}, 0xffffffff}, + {{208.0f, 108.0f, 5.0f, 1.0f}, 0xffffffff}, + {{112.0f, 204.0f, 5.0f, 1.0f}, 0xffffffff}, + {{208.0f, 204.0f, 5.0f, 1.0f}, 0xffffffff}, + }, + quad4[] = + { + {{ 42.0f, 41.0f, 10.0f, 1.0f}, 0xffffffff}, + {{112.0f, 41.0f, 10.0f, 1.0f}, 0xffffffff}, + {{ 42.0f, 108.0f, 10.0f, 1.0f}, 0xffffffff}, + {{112.0f, 108.0f, 10.0f, 1.0f}, 0xffffffff}, }; - struct vertex quad5[] = + struct { - { -0.5f, 0.5f, 10.0f, 0xff14f914}, - { 0.5f, 0.5f, 10.0f, 0xff14f914}, - { -0.5f, -0.5f, 10.0f, 0xff14f914}, - { 0.5f, -0.5f, 10.0f, 0xff14f914}, - }; - struct vertex quad6[] = + struct vec3 position; + DWORD diffuse; + } + quad5[] = { - { -1.0f, 0.5f, 10.0f, 0xfff91414}, - { 1.0f, 0.5f, 10.0f, 0xfff91414}, - { -1.0f, 0.25f, 10.0f, 0xfff91414}, - { 1.0f, 0.25f, 10.0f, 0xfff91414}, + {{-0.5f, 0.5f, 10.0f}, 0xff14f914}, + {{ 0.5f, 0.5f, 10.0f}, 0xff14f914}, + {{-0.5f, -0.5f, 10.0f}, 0xff14f914}, + {{ 0.5f, -0.5f, 10.0f}, 0xff14f914}, + }, + quad6[] = + { + {{-1.0f, 0.5f, 10.0f}, 0xfff91414}, + {{ 1.0f, 0.5f, 10.0f}, 0xfff91414}, + {{-1.0f, 0.25f, 10.0f}, 0xfff91414}, + {{ 1.0f, 0.25f, 10.0f}, 0xfff91414}, }; D3DVIEWPORT7 vp; diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/dnsapi/query.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/dnsapi/query.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/dnsapi/query.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/dnsapi/query.c 2014-07-11 19:15:41.000000000 +0000 @@ -147,7 +147,9 @@ case HOST_NOT_FOUND: return DNS_ERROR_RCODE_NAME_ERROR; case TRY_AGAIN: return DNS_ERROR_RCODE_SERVER_FAILURE; case NO_RECOVERY: return DNS_ERROR_RCODE_REFUSED; +#ifdef NETDB_INTERNAL case NETDB_INTERNAL: return DNS_ERROR_RCODE; +#endif default: FIXME( "unmapped error code: %d\n", error ); return DNS_ERROR_RCODE_NOT_IMPLEMENTED; diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/dssenh/tests/dssenh.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/dssenh/tests/dssenh.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/dssenh/tests/dssenh.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/dssenh/tests/dssenh.c 2014-07-11 19:15:41.000000000 +0000 @@ -704,6 +704,27 @@ result = CryptDestroyHash(hHash); ok(result, "Expected destruction of hash after deriving key.\n"); + /* the default algorithm is CBC, test that without setting a mode */ + mode = 0xdeadbeef; + dataLen = sizeof(mode); + result = CryptGetKeyParam(pKey, KP_MODE, (BYTE*)&mode, &dataLen, 0); + ok(result, "Expected getting of KP_MODE, got %x.\n", GetLastError()); + ok(mode == CRYPT_MODE_CBC, "Default mode should be CBC\n"); + + memcpy(pbData, plainText, plainLen); + dataLen = plainLen; + result = CryptEncrypt(pKey, 0, TRUE, 0, pbData, &dataLen, 36); + ok(result, "Expected data encryption, got %x.\n", GetLastError()); + + /* Verify we have the correct encrypted data */ + ok(!memcmp(pbData, tests[1].encrypted, dataLen), "Incorrect encrypted data.\n"); + + result = CryptDecrypt(pKey, 0, TRUE, 0, pbData, &dataLen); + ok(result, "Expected data decryption, got %x.\n", GetLastError()); + + /* Verify we have the correct decrypted data */ + ok(!memcmp(pbData, (BYTE *)plainText, dataLen), "Incorrect decrypted data.\n"); + /* test block cipher modes */ for(i = 0; i < testLen; i++) { diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/gdi32/tests/font.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/gdi32/tests/font.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/gdi32/tests/font.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/gdi32/tests/font.c 2014-07-11 19:15:41.000000000 +0000 @@ -3357,7 +3357,12 @@ return r; } +#define TT_PLATFORM_APPLE_UNICODE 0 +#define TT_PLATFORM_MACINTOSH 1 #define TT_PLATFORM_MICROSOFT 3 +#define TT_APPLE_ID_DEFAULT 0 +#define TT_APPLE_ID_ISO_10646 2 +#define TT_APPLE_ID_UNICODE_2_0 3 #define TT_MS_ID_SYMBOL_CS 0 #define TT_MS_ID_UNICODE_CS 1 #define TT_MS_LANGID_ENGLISH_UNITED_STATES 0x0409 @@ -3365,6 +3370,194 @@ #define TT_NAME_ID_FONT_SUBFAMILY 2 #define TT_NAME_ID_UNIQUE_ID 3 #define TT_NAME_ID_FULL_NAME 4 +#define TT_MAC_ID_SIMPLIFIED_CHINESE 25 + +typedef struct sfnt_name +{ + USHORT platform_id; + USHORT encoding_id; + USHORT language_id; + USHORT name_id; + USHORT length; + USHORT offset; +} sfnt_name; + +static const LANGID mac_langid_table[] = +{ + MAKELANGID(LANG_ENGLISH,SUBLANG_DEFAULT), /* TT_MAC_LANGID_ENGLISH */ + MAKELANGID(LANG_FRENCH,SUBLANG_DEFAULT), /* TT_MAC_LANGID_FRENCH */ + MAKELANGID(LANG_GERMAN,SUBLANG_DEFAULT), /* TT_MAC_LANGID_GERMAN */ + MAKELANGID(LANG_ITALIAN,SUBLANG_DEFAULT), /* TT_MAC_LANGID_ITALIAN */ + MAKELANGID(LANG_DUTCH,SUBLANG_DEFAULT), /* TT_MAC_LANGID_DUTCH */ + MAKELANGID(LANG_SWEDISH,SUBLANG_DEFAULT), /* TT_MAC_LANGID_SWEDISH */ + MAKELANGID(LANG_SPANISH,SUBLANG_DEFAULT), /* TT_MAC_LANGID_SPANISH */ + MAKELANGID(LANG_DANISH,SUBLANG_DEFAULT), /* TT_MAC_LANGID_DANISH */ + MAKELANGID(LANG_PORTUGUESE,SUBLANG_DEFAULT), /* TT_MAC_LANGID_PORTUGUESE */ + MAKELANGID(LANG_NORWEGIAN,SUBLANG_DEFAULT), /* TT_MAC_LANGID_NORWEGIAN */ + MAKELANGID(LANG_HEBREW,SUBLANG_DEFAULT), /* TT_MAC_LANGID_HEBREW */ + MAKELANGID(LANG_JAPANESE,SUBLANG_DEFAULT), /* TT_MAC_LANGID_JAPANESE */ + MAKELANGID(LANG_ARABIC,SUBLANG_DEFAULT), /* TT_MAC_LANGID_ARABIC */ + MAKELANGID(LANG_FINNISH,SUBLANG_DEFAULT), /* TT_MAC_LANGID_FINNISH */ + MAKELANGID(LANG_GREEK,SUBLANG_DEFAULT), /* TT_MAC_LANGID_GREEK */ + MAKELANGID(LANG_ICELANDIC,SUBLANG_DEFAULT), /* TT_MAC_LANGID_ICELANDIC */ + MAKELANGID(LANG_MALTESE,SUBLANG_DEFAULT), /* TT_MAC_LANGID_MALTESE */ + MAKELANGID(LANG_TURKISH,SUBLANG_DEFAULT), /* TT_MAC_LANGID_TURKISH */ + MAKELANGID(LANG_CROATIAN,SUBLANG_DEFAULT), /* TT_MAC_LANGID_CROATIAN */ + MAKELANGID(LANG_CHINESE_TRADITIONAL,SUBLANG_DEFAULT), /* TT_MAC_LANGID_CHINESE_TRADITIONAL */ + MAKELANGID(LANG_URDU,SUBLANG_DEFAULT), /* TT_MAC_LANGID_URDU */ + MAKELANGID(LANG_HINDI,SUBLANG_DEFAULT), /* TT_MAC_LANGID_HINDI */ + MAKELANGID(LANG_THAI,SUBLANG_DEFAULT), /* TT_MAC_LANGID_THAI */ + MAKELANGID(LANG_KOREAN,SUBLANG_DEFAULT), /* TT_MAC_LANGID_KOREAN */ + MAKELANGID(LANG_LITHUANIAN,SUBLANG_DEFAULT), /* TT_MAC_LANGID_LITHUANIAN */ + MAKELANGID(LANG_POLISH,SUBLANG_DEFAULT), /* TT_MAC_LANGID_POLISH */ + MAKELANGID(LANG_HUNGARIAN,SUBLANG_DEFAULT), /* TT_MAC_LANGID_HUNGARIAN */ + MAKELANGID(LANG_ESTONIAN,SUBLANG_DEFAULT), /* TT_MAC_LANGID_ESTONIAN */ + MAKELANGID(LANG_LATVIAN,SUBLANG_DEFAULT), /* TT_MAC_LANGID_LETTISH */ + MAKELANGID(LANG_SAMI,SUBLANG_DEFAULT), /* TT_MAC_LANGID_SAAMISK */ + MAKELANGID(LANG_FAEROESE,SUBLANG_DEFAULT), /* TT_MAC_LANGID_FAEROESE */ + MAKELANGID(LANG_FARSI,SUBLANG_DEFAULT), /* TT_MAC_LANGID_FARSI */ + MAKELANGID(LANG_RUSSIAN,SUBLANG_DEFAULT), /* TT_MAC_LANGID_RUSSIAN */ + MAKELANGID(LANG_CHINESE_SIMPLIFIED,SUBLANG_DEFAULT), /* TT_MAC_LANGID_CHINESE_SIMPLIFIED */ + MAKELANGID(LANG_DUTCH,SUBLANG_DUTCH_BELGIAN), /* TT_MAC_LANGID_FLEMISH */ + MAKELANGID(LANG_IRISH,SUBLANG_DEFAULT), /* TT_MAC_LANGID_IRISH */ + MAKELANGID(LANG_ALBANIAN,SUBLANG_DEFAULT), /* TT_MAC_LANGID_ALBANIAN */ + MAKELANGID(LANG_ROMANIAN,SUBLANG_DEFAULT), /* TT_MAC_LANGID_ROMANIAN */ + MAKELANGID(LANG_CZECH,SUBLANG_DEFAULT), /* TT_MAC_LANGID_CZECH */ + MAKELANGID(LANG_SLOVAK,SUBLANG_DEFAULT), /* TT_MAC_LANGID_SLOVAK */ + MAKELANGID(LANG_SLOVENIAN,SUBLANG_DEFAULT), /* TT_MAC_LANGID_SLOVENIAN */ + 0, /* TT_MAC_LANGID_YIDDISH */ + MAKELANGID(LANG_SERBIAN,SUBLANG_DEFAULT), /* TT_MAC_LANGID_SERBIAN */ + MAKELANGID(LANG_MACEDONIAN,SUBLANG_DEFAULT), /* TT_MAC_LANGID_MACEDONIAN */ + MAKELANGID(LANG_BULGARIAN,SUBLANG_DEFAULT), /* TT_MAC_LANGID_BULGARIAN */ + MAKELANGID(LANG_UKRAINIAN,SUBLANG_DEFAULT), /* TT_MAC_LANGID_UKRAINIAN */ + MAKELANGID(LANG_BELARUSIAN,SUBLANG_DEFAULT), /* TT_MAC_LANGID_BYELORUSSIAN */ + MAKELANGID(LANG_UZBEK,SUBLANG_DEFAULT), /* TT_MAC_LANGID_UZBEK */ + MAKELANGID(LANG_KAZAK,SUBLANG_DEFAULT), /* TT_MAC_LANGID_KAZAKH */ + MAKELANGID(LANG_AZERI,SUBLANG_AZERI_CYRILLIC), /* TT_MAC_LANGID_AZERBAIJANI */ + 0, /* TT_MAC_LANGID_AZERBAIJANI_ARABIC_SCRIPT */ + MAKELANGID(LANG_ARMENIAN,SUBLANG_DEFAULT), /* TT_MAC_LANGID_ARMENIAN */ + MAKELANGID(LANG_GEORGIAN,SUBLANG_DEFAULT), /* TT_MAC_LANGID_GEORGIAN */ + 0, /* TT_MAC_LANGID_MOLDAVIAN */ + MAKELANGID(LANG_KYRGYZ,SUBLANG_DEFAULT), /* TT_MAC_LANGID_KIRGHIZ */ + MAKELANGID(LANG_TAJIK,SUBLANG_DEFAULT), /* TT_MAC_LANGID_TAJIKI */ + MAKELANGID(LANG_TURKMEN,SUBLANG_DEFAULT), /* TT_MAC_LANGID_TURKMEN */ + MAKELANGID(LANG_MONGOLIAN,SUBLANG_DEFAULT), /* TT_MAC_LANGID_MONGOLIAN */ + MAKELANGID(LANG_MONGOLIAN,SUBLANG_MONGOLIAN_CYRILLIC_MONGOLIA), /* TT_MAC_LANGID_MONGOLIAN_CYRILLIC_SCRIPT */ + MAKELANGID(LANG_PASHTO,SUBLANG_DEFAULT), /* TT_MAC_LANGID_PASHTO */ + 0, /* TT_MAC_LANGID_KURDISH */ + MAKELANGID(LANG_KASHMIRI,SUBLANG_DEFAULT), /* TT_MAC_LANGID_KASHMIRI */ + MAKELANGID(LANG_SINDHI,SUBLANG_DEFAULT), /* TT_MAC_LANGID_SINDHI */ + MAKELANGID(LANG_TIBETAN,SUBLANG_DEFAULT), /* TT_MAC_LANGID_TIBETAN */ + MAKELANGID(LANG_NEPALI,SUBLANG_DEFAULT), /* TT_MAC_LANGID_NEPALI */ + MAKELANGID(LANG_SANSKRIT,SUBLANG_DEFAULT), /* TT_MAC_LANGID_SANSKRIT */ + MAKELANGID(LANG_MARATHI,SUBLANG_DEFAULT), /* TT_MAC_LANGID_MARATHI */ + MAKELANGID(LANG_BENGALI,SUBLANG_DEFAULT), /* TT_MAC_LANGID_BENGALI */ + MAKELANGID(LANG_ASSAMESE,SUBLANG_DEFAULT), /* TT_MAC_LANGID_ASSAMESE */ + MAKELANGID(LANG_GUJARATI,SUBLANG_DEFAULT), /* TT_MAC_LANGID_GUJARATI */ + MAKELANGID(LANG_PUNJABI,SUBLANG_DEFAULT), /* TT_MAC_LANGID_PUNJABI */ + MAKELANGID(LANG_ORIYA,SUBLANG_DEFAULT), /* TT_MAC_LANGID_ORIYA */ + MAKELANGID(LANG_MALAYALAM,SUBLANG_DEFAULT), /* TT_MAC_LANGID_MALAYALAM */ + MAKELANGID(LANG_KANNADA,SUBLANG_DEFAULT), /* TT_MAC_LANGID_KANNADA */ + MAKELANGID(LANG_TAMIL,SUBLANG_DEFAULT), /* TT_MAC_LANGID_TAMIL */ + MAKELANGID(LANG_TELUGU,SUBLANG_DEFAULT), /* TT_MAC_LANGID_TELUGU */ + MAKELANGID(LANG_SINHALESE,SUBLANG_DEFAULT), /* TT_MAC_LANGID_SINHALESE */ + 0, /* TT_MAC_LANGID_BURMESE */ + MAKELANGID(LANG_KHMER,SUBLANG_DEFAULT), /* TT_MAC_LANGID_KHMER */ + MAKELANGID(LANG_LAO,SUBLANG_DEFAULT), /* TT_MAC_LANGID_LAO */ + MAKELANGID(LANG_VIETNAMESE,SUBLANG_DEFAULT), /* TT_MAC_LANGID_VIETNAMESE */ + MAKELANGID(LANG_INDONESIAN,SUBLANG_DEFAULT), /* TT_MAC_LANGID_INDONESIAN */ + 0, /* TT_MAC_LANGID_TAGALOG */ + MAKELANGID(LANG_MALAY,SUBLANG_DEFAULT), /* TT_MAC_LANGID_MALAY_ROMAN_SCRIPT */ + 0, /* TT_MAC_LANGID_MALAY_ARABIC_SCRIPT */ + MAKELANGID(LANG_AMHARIC,SUBLANG_DEFAULT), /* TT_MAC_LANGID_AMHARIC */ + MAKELANGID(LANG_TIGRIGNA,SUBLANG_DEFAULT), /* TT_MAC_LANGID_TIGRINYA */ + 0, /* TT_MAC_LANGID_GALLA */ + 0, /* TT_MAC_LANGID_SOMALI */ + MAKELANGID(LANG_SWAHILI,SUBLANG_DEFAULT), /* TT_MAC_LANGID_SWAHILI */ + 0, /* TT_MAC_LANGID_RUANDA */ + 0, /* TT_MAC_LANGID_RUNDI */ + 0, /* TT_MAC_LANGID_CHEWA */ + MAKELANGID(LANG_MALAGASY,SUBLANG_DEFAULT), /* TT_MAC_LANGID_MALAGASY */ + MAKELANGID(LANG_ESPERANTO,SUBLANG_DEFAULT), /* TT_MAC_LANGID_ESPERANTO */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 95-111 */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 112-127 */ + MAKELANGID(LANG_WELSH,SUBLANG_DEFAULT), /* TT_MAC_LANGID_WELSH */ + MAKELANGID(LANG_BASQUE,SUBLANG_DEFAULT), /* TT_MAC_LANGID_BASQUE */ + MAKELANGID(LANG_CATALAN,SUBLANG_DEFAULT), /* TT_MAC_LANGID_CATALAN */ + 0, /* TT_MAC_LANGID_LATIN */ + MAKELANGID(LANG_QUECHUA,SUBLANG_DEFAULT), /* TT_MAC_LANGID_QUECHUA */ + 0, /* TT_MAC_LANGID_GUARANI */ + 0, /* TT_MAC_LANGID_AYMARA */ + MAKELANGID(LANG_TATAR,SUBLANG_DEFAULT), /* TT_MAC_LANGID_TATAR */ + MAKELANGID(LANG_UIGHUR,SUBLANG_DEFAULT), /* TT_MAC_LANGID_UIGHUR */ + 0, /* TT_MAC_LANGID_DZONGKHA */ + 0, /* TT_MAC_LANGID_JAVANESE */ + 0, /* TT_MAC_LANGID_SUNDANESE */ + MAKELANGID(LANG_GALICIAN,SUBLANG_DEFAULT), /* TT_MAC_LANGID_GALICIAN */ + MAKELANGID(LANG_AFRIKAANS,SUBLANG_DEFAULT), /* TT_MAC_LANGID_AFRIKAANS */ + MAKELANGID(LANG_BRETON,SUBLANG_DEFAULT), /* TT_MAC_LANGID_BRETON */ + MAKELANGID(LANG_INUKTITUT,SUBLANG_DEFAULT), /* TT_MAC_LANGID_INUKTITUT */ + MAKELANGID(LANG_SCOTTISH_GAELIC,SUBLANG_DEFAULT), /* TT_MAC_LANGID_SCOTTISH_GAELIC */ + MAKELANGID(LANG_MANX_GAELIC,SUBLANG_DEFAULT), /* TT_MAC_LANGID_MANX_GAELIC */ + MAKELANGID(LANG_IRISH,SUBLANG_IRISH_IRELAND), /* TT_MAC_LANGID_IRISH_GAELIC */ + 0, /* TT_MAC_LANGID_TONGAN */ + 0, /* TT_MAC_LANGID_GREEK_POLYTONIC */ + MAKELANGID(LANG_GREENLANDIC,SUBLANG_DEFAULT), /* TT_MAC_LANGID_GREELANDIC */ + MAKELANGID(LANG_AZERI,SUBLANG_AZERI_LATIN), /* TT_MAC_LANGID_AZERBAIJANI_ROMAN_SCRIPT */ +}; + +static inline WORD get_mac_code_page( const sfnt_name *name ) +{ + if (GET_BE_WORD(name->encoding_id) == TT_MAC_ID_SIMPLIFIED_CHINESE) return 10008; /* special case */ + return 10000 + GET_BE_WORD(name->encoding_id); +} + +static int match_name_table_language( const sfnt_name *name, LANGID lang ) +{ + LANGID name_lang; + int res = 0; + + switch (GET_BE_WORD(name->platform_id)) + { + case TT_PLATFORM_MICROSOFT: + res += 5; /* prefer the Microsoft name */ + switch (GET_BE_WORD(name->encoding_id)) + { + case TT_MS_ID_UNICODE_CS: + case TT_MS_ID_SYMBOL_CS: + name_lang = GET_BE_WORD(name->language_id); + break; + default: + return 0; + } + break; + case TT_PLATFORM_MACINTOSH: + if (!IsValidCodePage( get_mac_code_page( name ))) return 0; + if (GET_BE_WORD(name->language_id) >= sizeof(mac_langid_table)/sizeof(mac_langid_table[0])) return 0; + name_lang = mac_langid_table[GET_BE_WORD(name->language_id)]; + break; + case TT_PLATFORM_APPLE_UNICODE: + res += 2; /* prefer Unicode encodings */ + switch (GET_BE_WORD(name->encoding_id)) + { + case TT_APPLE_ID_DEFAULT: + case TT_APPLE_ID_ISO_10646: + case TT_APPLE_ID_UNICODE_2_0: + if (GET_BE_WORD(name->language_id) >= sizeof(mac_langid_table)/sizeof(mac_langid_table[0])) return 0; + name_lang = mac_langid_table[GET_BE_WORD(name->language_id)]; + break; + default: + return 0; + } + break; + default: + return 0; + } + if (name_lang == lang) res += 30; + else if (PRIMARYLANGID( name_lang ) == PRIMARYLANGID( lang )) res += 20; + else if (name_lang == MAKELANGID( LANG_ENGLISH, SUBLANG_DEFAULT )) res += 10; + return res; +} static BOOL get_ttf_nametable_entry(HDC hdc, WORD name_id, WCHAR *out_buf, SIZE_T out_size, LCID language_id) { @@ -3374,21 +3567,14 @@ USHORT number_of_record; USHORT storage_offset; } *header; - struct sfnt_name - { - USHORT platform_id; - USHORT encoding_id; - USHORT language_id; - USHORT name_id; - USHORT length; - USHORT offset; - } *entry; + sfnt_name *entry; BOOL r = FALSE; LONG size, offset, length; LONG c, ret; WCHAR *name; BYTE *data; USHORT i; + int res, best_lang = 0, best_index = -1; size = GetFontData(hdc, MS_NAME_TAG, 0, NULL, 0); ok(size != GDI_ERROR, "no name table found\n"); @@ -3421,35 +3607,34 @@ entry = (void *)&header[1]; for (i = 0; i < header->number_of_record; i++) { - if (GET_BE_WORD(entry[i].platform_id) != TT_PLATFORM_MICROSOFT || - (GET_BE_WORD(entry[i].encoding_id) != TT_MS_ID_UNICODE_CS && GET_BE_WORD(entry[i].encoding_id) != TT_MS_ID_SYMBOL_CS) || - GET_BE_WORD(entry[i].language_id) != language_id || - GET_BE_WORD(entry[i].name_id) != name_id) + if (GET_BE_WORD(entry[i].name_id) != name_id) continue; + res = match_name_table_language( &entry[i], language_id); + if (res > best_lang) { - continue; + best_lang = res; + best_index = i; } + } - offset = header->storage_offset + GET_BE_WORD(entry[i].offset); - length = GET_BE_WORD(entry[i].length); - if (offset + length > size) - { - trace("entry %d is out of range\n", i); - break; - } - if (length >= out_size) - { - trace("buffer too small for entry %d\n", i); - break; - } + offset = header->storage_offset + GET_BE_WORD(entry[best_index].offset); + length = GET_BE_WORD(entry[best_index].length); + if (offset + length > size) + { + trace("entry %d is out of range\n", best_index); + goto out; + } + if (length >= out_size) + { + trace("buffer too small for entry %d\n", best_index); + goto out; + } - name = (WCHAR *)(data + offset); - for (c = 0; c < length / 2; c++) - out_buf[c] = GET_BE_WORD(name[c]); - out_buf[c] = 0; + name = (WCHAR *)(data + offset); + for (c = 0; c < length / 2; c++) + out_buf[c] = GET_BE_WORD(name[c]); + out_buf[c] = 0; - r = TRUE; - break; - } + r = TRUE; out: HeapFree(GetProcessHeap(), 0, data); diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/gdi32/vertical.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/gdi32/vertical.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/gdi32/vertical.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/gdi32/vertical.c 2014-07-11 19:15:41.000000000 +0000 @@ -2,8 +2,6 @@ /* generated from http://www.unicode.org/Public/vertical/revision-11/VerticalOrientation-11.txt */ /* DO NOT EDIT!! */ -#include "wine/unicode.h" - const unsigned short vertical_orientation_table[1536] = { /* level 1 offsets */ diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/gdiplus/graphics.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/gdiplus/graphics.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/gdiplus/graphics.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/gdiplus/graphics.c 2014-07-11 19:15:41.000000000 +0000 @@ -1995,6 +1995,24 @@ rect->Height = GetDeviceCaps(graphics->hdc, VERTRES); } + if (graphics->hdc && + (GetMapMode(graphics->hdc) != MM_TEXT || GetGraphicsMode(graphics->hdc) != GM_COMPATIBLE)) + { + POINT points[2]; + + points[0].x = rect->X; + points[0].y = rect->Y; + points[1].x = rect->X + rect->Width; + points[1].y = rect->Y + rect->Height; + + DPtoLP(graphics->hdc, points, sizeof(points)/sizeof(points[0])); + + rect->X = min(points[0].x, points[1].x); + rect->Y = min(points[0].y, points[1].y); + rect->Width = abs(points[1].x - points[0].x); + rect->Height = abs(points[1].y - points[0].y); + } + return stat; } diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/gdiplus/image.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/gdiplus/image.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/gdiplus/image.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/gdiplus/image.c 2014-07-11 19:15:41.000000000 +0000 @@ -1387,6 +1387,8 @@ if(!filename || !bitmap) return InvalidParameter; + *bitmap = NULL; + stat = GdipCreateStreamOnFile(filename, GENERIC_READ, &stream); if(stat != Ok) @@ -2945,6 +2947,8 @@ if (!filename || !image) return InvalidParameter; + *image = NULL; + stat = GdipCreateStreamOnFile(filename, GENERIC_READ, &stream); if (stat != Ok) diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/gdiplus/tests/image.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/gdiplus/tests/image.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/gdiplus/tests/image.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/gdiplus/tests/image.c 2014-07-11 19:15:41.000000000 +0000 @@ -374,24 +374,48 @@ static void test_LoadingImages(void) { GpStatus stat; + GpBitmap *bm; + GpImage *img; + static const WCHAR nonexistentW[] = {'n','o','n','e','x','i','s','t','e','n','t',0}; stat = GdipCreateBitmapFromFile(0, 0); expect(InvalidParameter, stat); - stat = GdipCreateBitmapFromFile(0, (GpBitmap**)0xdeadbeef); + bm = (GpBitmap *)0xdeadbeef; + stat = GdipCreateBitmapFromFile(0, &bm); expect(InvalidParameter, stat); + ok(bm == (GpBitmap *)0xdeadbeef, "returned %p\n", bm); + + bm = (GpBitmap *)0xdeadbeef; + stat = GdipCreateBitmapFromFile(nonexistentW, &bm); + todo_wine expect(InvalidParameter, stat); + ok(!bm, "returned %p\n", bm); stat = GdipLoadImageFromFile(0, 0); expect(InvalidParameter, stat); - stat = GdipLoadImageFromFile(0, (GpImage**)0xdeadbeef); + img = (GpImage *)0xdeadbeef; + stat = GdipLoadImageFromFile(0, &img); expect(InvalidParameter, stat); + ok(img == (GpImage *)0xdeadbeef, "returned %p\n", img); + + img = (GpImage *)0xdeadbeef; + stat = GdipLoadImageFromFile(nonexistentW, &img); + todo_wine expect(OutOfMemory, stat); + ok(!img, "returned %p\n", img); stat = GdipLoadImageFromFileICM(0, 0); expect(InvalidParameter, stat); - stat = GdipLoadImageFromFileICM(0, (GpImage**)0xdeadbeef); + img = (GpImage *)0xdeadbeef; + stat = GdipLoadImageFromFileICM(0, &img); expect(InvalidParameter, stat); + ok(img == (GpImage *)0xdeadbeef, "returned %p\n", img); + + img = (GpImage *)0xdeadbeef; + stat = GdipLoadImageFromFileICM(nonexistentW, &img); + todo_wine expect(OutOfMemory, stat); + ok(!img, "returned %p\n", img); } static void test_SavingImages(void) diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/iphlpapi/iphlpapi_main.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/iphlpapi/iphlpapi_main.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/iphlpapi/iphlpapi_main.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/iphlpapi/iphlpapi_main.c 2014-07-11 19:15:41.000000000 +0000 @@ -1068,10 +1068,21 @@ #ifdef HAVE_STRUCT___RES_STATE /* call res_init() just once because of a bug in Mac OS X 10.4 */ /* Call once per thread on systems that have per-thread _res. */ + +static CRITICAL_SECTION res_init_cs; +static CRITICAL_SECTION_DEBUG res_init_cs_debug = { + 0, 0, &res_init_cs, + { &res_init_cs_debug.ProcessLocksList, &res_init_cs_debug.ProcessLocksList }, + 0, 0, { (DWORD_PTR)(__FILE__ ": res_init_cs") } +}; +static CRITICAL_SECTION res_init_cs = { &res_init_cs_debug, -1, 0, 0, 0, 0 }; + static void initialise_resolver(void) { + EnterCriticalSection(&res_init_cs); if ((_res.options & RES_INIT) == 0) res_init(); + LeaveCriticalSection(&res_init_cs); } static int get_dns_servers( SOCKADDR_STORAGE *servers, int num, BOOL ip4_only ) diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/kernel32/environ.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/kernel32/environ.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/kernel32/environ.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/kernel32/environ.c 2014-07-11 19:15:41.000000000 +0000 @@ -491,3 +491,23 @@ RtlReleasePebLock(); } + +/*********************************************************************** + * GetFirmwareEnvironmentVariableA (KERNEL32.@) + */ +DWORD WINAPI GetFirmwareEnvironmentVariableA(LPCSTR name, LPCSTR guid, PVOID buffer, DWORD size) +{ + FIXME("stub: %s %s %p %u\n", debugstr_a(name), debugstr_a(guid), buffer, size); + SetLastError(ERROR_INVALID_FUNCTION); + return 0; +} + +/*********************************************************************** + * GetFirmwareEnvironmentVariableA (KERNEL32.@) + */ +DWORD WINAPI GetFirmwareEnvironmentVariableW(LPCWSTR name, LPCWSTR guid, PVOID buffer, DWORD size) +{ + FIXME("stub: %s %s %p %u\n", debugstr_w(name), debugstr_w(guid), buffer, size); + SetLastError(ERROR_INVALID_FUNCTION); + return 0; +} diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/kernel32/kernel32.spec wine-compholio-1.7.22~ubuntu13.10.1/dlls/kernel32/kernel32.spec --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/kernel32/kernel32.spec 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/kernel32/kernel32.spec 2014-07-11 19:15:41.000000000 +0000 @@ -542,8 +542,8 @@ @ stdcall GetFileSizeEx(long ptr) @ stdcall GetFileTime(long ptr ptr ptr) @ stdcall GetFileType(long) -# @ stub GetFirmwareEnvironmentVariableA -# @ stub GetFirmwareEnvironmentVariableW +@ stdcall GetFirmwareEnvironmentVariableA(str str ptr long) +@ stdcall GetFirmwareEnvironmentVariableW(wstr wstr ptr long) @ stdcall GetFullPathNameA(str long ptr ptr) @ stdcall GetFullPathNameW(wstr long ptr ptr) @ stdcall GetGeoInfoA(long long ptr long long) diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/kernel32/locale.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/kernel32/locale.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/kernel32/locale.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/kernel32/locale.c 2014-07-11 19:15:41.000000000 +0000 @@ -2504,6 +2504,9 @@ if ((c>=0x0600)&&(c<=0x06FF)) type3 |= C3_KASHIDA; if ((c>=0x3000)&&(c<=0x303F)) type3 |= C3_SYMBOL; + if ((c>=0xD800)&&(c<=0xDBFF)) type3 |= C3_HIGHSURROGATE; + if ((c>=0xDC00)&&(c<=0xDFFF)) type3 |= C3_LOWSURROGATE; + if ((c>=0xFF00)&&(c<=0xFF60)) type3 |= C3_FULLWIDTH; if ((c>=0xFF00)&&(c<=0xFF20)) type3 |= C3_SYMBOL; if ((c>=0xFF3B)&&(c<=0xFF40)) type3 |= C3_SYMBOL; @@ -4078,18 +4081,466 @@ return TRUE; } -INT WINAPI GetGeoInfoW(GEOID GeoId, GEOTYPE GeoType, LPWSTR lpGeoData, - int cchData, LANGID language) +struct geoinfo_t { + WCHAR iso2W[3]; + WCHAR iso3W[4]; + INT uncode; +}; + +static const struct geoinfo_t geoinfodata[] = { + { }, /* 0 unassigned */ + { }, /* 1 unassigned */ + { {'A','G',0}, {'A','T','G',0}, 28 }, /* Antigua and Barbuda */ + { {'A','F',0}, {'A','F','G',0}, 4 }, /* Afghanistan */ + { {'D','Z',0}, {'D','Z','A',0}, 12 }, /* Algeria */ + { {'A','Z',0}, {'A','Z','E',0}, 31 }, /* Azerbaijan */ + { {'A','L',0}, {'A','L','B',0}, 8 }, /* Albania */ + { {'A','M',0}, {'A','R','M',0}, 51 }, /* Armenia */ + { {'A','D',0}, {'A','N','D',0}, 20 }, /* Andorra */ + { {'A','O',0}, {'A','G','O',0}, 24 }, /* Angola */ + { {'A','S',0}, {'A','S','M',0}, 16 }, /* American Samoa */ + { {'A','R',0}, {'A','R','G',0}, 32 }, /* Argentina */ + { {'A','U',0}, {'A','U','S',0}, 36 }, /* Australia */ + { }, /* 13 unassigned */ + { {'A','T',0}, {'A','U','T',0}, 40 }, /* Austria */ + { }, /* 15 unassigned */ + { }, /* 16 unassigned */ + { {'B','H',0}, {'B','H','R',0}, 48 }, /* Bahrain */ + { {'B','B',0}, {'B','R','B',0}, 52 }, /* Barbados */ + { {'B','W',0}, {'B','W','A',0}, 72 }, /* Botswana */ + { {'B','M',0}, {'B','M','U',0}, 60 }, /* Bermuda */ + { {'B','E',0}, {'B','E','L',0}, 56 }, /* Belgium */ + { {'B','S',0}, {'B','H','S',0}, 44 }, /* Bahamas, The */ + { {'B','D',0}, {'B','G','D',0}, 50 }, /* Bangladesh */ + { {'B','Z',0}, {'B','L','Z',0}, 84 }, /* Belize */ + { {'B','A',0}, {'B','I','H',0}, 70 }, /* Bosnia and Herzegovina */ + { {'B','O',0}, {'B','O','L',0}, 68 }, /* Bolivia */ + { {'M','M',0}, {'M','M','R',0}, 104 }, /* Myanmar */ + { {'B','J',0}, {'B','E','N',0}, 204 }, /* Benin */ + { {'B','Y',0}, {'B','L','R',0}, 112 }, /* Belarus */ + { {'S','B',0}, {'S','L','B',0}, 90 }, /* Solomon Islands */ + { }, /* 31 unassigned */ + { {'B','R',0}, {'B','R','A',0}, 76 }, /* Brazil */ + { }, /* 33 unassigned */ + { {'B','T',0}, {'B','T','N',0}, 64 }, /* Bhutan */ + { {'B','G',0}, {'B','G','R',0}, 100 }, /* Bulgaria */ + { }, /* 36 unassigned */ + { {'B','N',0}, {'B','R','N',0}, 96 }, /* Brunei */ + { {'B','I',0}, {'B','D','I',0}, 108 }, /* Burundi */ + { {'C','A',0}, {'C','A','N',0}, 124 }, /* Canada */ + { {'K','H',0}, {'K','H','M',0}, 116 }, /* Cambodia */ + { {'T','D',0}, {'T','C','D',0}, 148 }, /* Chad */ + { {'L','K',0}, {'L','K','A',0}, 144 }, /* Sri Lanka */ + { {'C','G',0}, {'C','O','G',0}, 178 }, /* Congo */ + { {'C','D',0}, {'C','O','D',0}, 180 }, /* Congo (DRC) */ + { {'C','N',0}, {'C','H','N',0}, 156 }, /* China */ + { {'C','L',0}, {'C','H','L',0}, 152 }, /* Chile */ + { }, /* 47 unassigned */ + { }, /* 48 unassigned */ + { {'C','M',0}, {'C','M','R',0}, 120 }, /* Cameroon */ + { {'K','M',0}, {'C','O','M',0}, 174 }, /* Comoros */ + { {'C','O',0}, {'C','O','L',0}, 170 }, /* Colombia */ + { }, /* 52 unassigned */ + { }, /* 53 unassigned */ + { {'C','R',0}, {'C','R','I',0}, 188 }, /* Costa Rica */ + { {'C','F',0}, {'C','A','F',0}, 140 }, /* Central African Republic */ + { {'C','U',0}, {'C','U','B',0}, 192 }, /* Cuba */ + { {'C','V',0}, {'C','P','V',0}, 132 }, /* Cape Verde */ + { }, /* 58 unassigned */ + { {'C','Y',0}, {'C','Y','P',0}, 196 }, /* Cyprus */ + { }, /* 60 unassigned */ + { {'D','K',0}, {'D','N','K',0}, 208 }, /* Denmark */ + { {'D','J',0}, {'D','J','I',0}, 262 }, /* Djibouti */ + { {'D','M',0}, {'D','M','A',0}, 212 }, /* Dominica */ + { }, /* 64 unassigned */ + { {'D','O',0}, {'D','O','M',0}, 214 }, /* Dominican Republic */ + { {'E','C',0}, {'E','C','U',0}, 218 }, /* Ecuador */ + { {'E','G',0}, {'E','G','Y',0}, 818 }, /* Egypt */ + { {'I','E',0}, {'I','R','L',0}, 372 }, /* Ireland */ + { {'G','Q',0}, {'G','N','Q',0}, 226 }, /* Equatorial Guinea */ + { {'E','E',0}, {'E','S','T',0}, 233 }, /* Estonia */ + { {'E','R',0}, {'E','R','I',0}, 232 }, /* Eritrea */ + { {'S','V',0}, {'S','L','V',0}, 222 }, /* El Salvador */ + { {'E','T',0}, {'E','T','H',0}, 231 }, /* Ethiopia */ + { }, /* 74 unassigned */ + { {'C','Z',0}, {'C','Z','E',0}, 203 }, /* Czech Republic */ + { }, /* 76 unassigned */ + { {'F','I',0}, {'F','I','N',0}, 246 }, /* Finland */ + { {'F','J',0}, {'F','J','I',0}, 242 }, /* Fiji Islands */ + { }, /* 79 unassigned */ + { {'F','M',0}, {'F','S','M',0}, 583 }, /* Micronesia */ + { {'F','O',0}, {'F','R','O',0}, 234 }, /* Faroe Islands */ + { }, /* 82 unassigned */ + { }, /* 83 unassigned */ + { {'F','R',0}, {'F','R','A',0}, 250 }, /* France */ + { }, /* 85 unassigned */ + { {'G','M',0}, {'G','M','B',0}, 270 }, /* Gambia, The */ + { {'G','A',0}, {'G','A','B',0}, 266 }, /* Gabon */ + { {'G','E',0}, {'G','E','O',0}, 268 }, /* Georgia */ + { {'G','H',0}, {'G','H','A',0}, 288 }, /* Ghana */ + { {'G','I',0}, {'G','I','B',0}, 292 }, /* Gibraltar */ + { {'G','D',0}, {'G','R','D',0}, 308 }, /* Grenada */ + { }, /* 92 unassigned */ + { {'G','L',0}, {'G','R','L',0}, 304 }, /* Greenland */ + { {'D','E',0}, {'D','E','U',0}, 276 }, /* Germany */ + { }, /* 95 unassigned */ + { }, /* 96 unassigned */ + { }, /* 97 unassigned */ + { {'G','R',0}, {'G','R','C',0}, 300 }, /* Greece */ + { {'G','T',0}, {'G','T','M',0}, 320 }, /* Guatemala */ + { {'G','N',0}, {'G','I','N',0}, 324 }, /* Guinea */ + { {'G','Y',0}, {'G','U','Y',0}, 328 }, /* Guyana */ + { }, /* 102 unassigned */ + { {'H','T',0}, {'H','T','I',0}, 332 }, /* Haiti */ + { {'H','K',0}, {'H','K','G',0}, 344 }, /* Hong Kong S.A.R. */ + { }, /* 105 unassigned */ + { {'H','N',0}, {'H','N','D',0}, 340 }, /* Honduras */ + { }, /* 107 unassigned */ + { {'H','R',0}, {'H','R','V',0}, 191 }, /* Croatia */ + { {'H','U',0}, {'H','U','N',0}, 348 }, /* Hungary */ + { {'I','S',0}, {'I','S','L',0}, 352 }, /* Iceland */ + { {'I','D',0}, {'I','D','N',0}, 360 }, /* Indonesia */ + { }, /* 112 unassigned */ + { {'I','N',0}, {'I','N','D',0}, 356 }, /* India */ + { {'I','O',0}, {'I','O','T',0}, 86 }, /* British Indian Ocean Territory */ + { }, /* 115 unassigned */ + { {'I','R',0}, {'I','R','N',0}, 364 }, /* Iran */ + { {'I','L',0}, {'I','S','R',0}, 376 }, /* Israel */ + { {'I','T',0}, {'I','T','A',0}, 380 }, /* Italy */ + { {'C','I',0}, {'C','I','V',0}, 384 }, /* Côte d'Ivoire */ + { }, /* 120 unassigned */ + { {'I','Q',0}, {'I','R','Q',0}, 368 }, /* Iraq */ + { {'J','P',0}, {'J','P','N',0}, 392 }, /* Japan */ + { }, /* 123 unassigned */ + { {'J','M',0}, {'J','A','M',0}, 388 }, /* Jamaica */ + { {'S','J',0}, {'S','J','M',0}, 744 }, /* Jan Mayen */ + { {'J','O',0}, {'J','O','R',0}, 400 }, /* Jordan */ + { {'X','X',0}, {'X','X',0}, 0 }, /* Johnston Atoll */ + { }, /* 128 unassigned */ + { {'K','E',0}, {'K','E','N',0}, 404 }, /* Kenya */ + { {'K','G',0}, {'K','G','Z',0}, 417 }, /* Kyrgyzstan */ + { {'K','P',0}, {'P','R','K',0}, 408 }, /* North Korea */ + { }, /* 132 unassigned */ + { {'K','I',0}, {'K','I','R',0}, 296 }, /* Kiribati */ + { {'K','R',0}, {'K','O','R',0}, 410 }, /* Korea */ + { }, /* 135 unassigned */ + { {'K','W',0}, {'K','W','T',0}, 414 }, /* Kuwait */ + { {'K','Z',0}, {'K','A','Z',0}, 398 }, /* Kazakhstan */ + { {'L','A',0}, {'L','A','O',0}, 418 }, /* Laos */ + { {'L','B',0}, {'L','B','N',0}, 422 }, /* Lebanon */ + { {'L','V',0}, {'L','V','A',0}, 428 }, /* Latvia */ + { {'L','T',0}, {'L','T','U',0}, 440 }, /* Lithuania */ + { {'L','R',0}, {'L','B','R',0}, 430 }, /* Liberia */ + { {'S','K',0}, {'S','V','K',0}, 703 }, /* Slovakia */ + { }, /* 144 unassigned */ + { {'L','I',0}, {'L','I','E',0}, 438 }, /* Liechtenstein */ + { {'L','S',0}, {'L','S','O',0}, 426 }, /* Lesotho */ + { {'L','U',0}, {'L','U','X',0}, 442 }, /* Luxembourg */ + { {'L','Y',0}, {'L','B','Y',0}, 434 }, /* Libya */ + { {'M','G',0}, {'M','D','G',0}, 450 }, /* Madagascar */ + { }, /* 150 unassigned */ + { {'M','O',0}, {'M','A','C',0}, 446 }, /* Macao S.A.R. */ + { {'M','D',0}, {'M','D','A',0}, 498 }, /* Moldova */ + { }, /* 153 unassigned */ + { {'M','N',0}, {'M','N','G',0}, 496 }, /* Mongolia */ + { }, /* 155 unassigned */ + { {'M','W',0}, {'M','W','I',0}, 454 }, /* Malawi */ + { {'M','L',0}, {'M','L','I',0}, 466 }, /* Mali */ + { {'M','C',0}, {'M','C','O',0}, 492 }, /* Monaco */ + { {'M','A',0}, {'M','A','R',0}, 504 }, /* Morocco */ + { {'M','U',0}, {'M','U','S',0}, 480 }, /* Mauritius */ + { }, /* 161 unassigned */ + { {'M','R',0}, {'M','R','T',0}, 478 }, /* Mauritania */ + { {'M','T',0}, {'M','L','T',0}, 470 }, /* Malta */ + { {'O','M',0}, {'O','M','N',0}, 512 }, /* Oman */ + { {'M','V',0}, {'M','D','V',0}, 462 }, /* Maldives */ + { {'M','X',0}, {'M','E','X',0}, 484 }, /* Mexico */ + { {'M','Y',0}, {'M','Y','S',0}, 458 }, /* Malaysia */ + { {'M','Z',0}, {'M','O','Z',0}, 508 }, /* Mozambique */ + { }, /* 169 unassigned */ + { }, /* 170 unassigned */ + { }, /* 171 unassigned */ + { }, /* 172 unassigned */ + { {'N','E',0}, {'N','E','R',0}, 562 }, /* Niger */ + { {'V','U',0}, {'V','U','T',0}, 548 }, /* Vanuatu */ + { {'N','G',0}, {'N','G','A',0}, 566 }, /* Nigeria */ + { {'N','L',0}, {'N','L','D',0}, 528 }, /* Netherlands */ + { {'N','O',0}, {'N','O','R',0}, 578 }, /* Norway */ + { {'N','P',0}, {'N','P','L',0}, 524 }, /* Nepal */ + { }, /* 179 unassigned */ + { {'N','R',0}, {'N','R','U',0}, 520 }, /* Nauru */ + { {'S','R',0}, {'S','U','R',0}, 740 }, /* Suriname */ + { {'N','I',0}, {'N','I','C',0}, 558 }, /* Nicaragua */ + { {'N','Z',0}, {'N','Z','L',0}, 554 }, /* New Zealand */ + { {'P','S',0}, {'P','S','E',0}, 275 }, /* Palestinian Authority */ + { {'P','Y',0}, {'P','R','Y',0}, 600 }, /* Paraguay */ + { }, /* 186 unassigned */ + { {'P','E',0}, {'P','E','R',0}, 604 }, /* Peru */ + { }, /* 188 unassigned */ + { }, /* 189 unassigned */ + { {'P','K',0}, {'P','A','K',0}, 586 }, /* Pakistan */ + { {'P','L',0}, {'P','O','L',0}, 616 }, /* Poland */ + { {'P','A',0}, {'P','A','N',0}, 591 }, /* Panama */ + { {'P','T',0}, {'P','R','T',0}, 620 }, /* Portugal */ + { {'P','G',0}, {'P','N','G',0}, 598 }, /* Papua New Guinea */ + { {'P','W',0}, {'P','L','W',0}, 585 }, /* Palau */ + { {'G','W',0}, {'G','N','B',0}, 624 }, /* Guinea-Bissau */ + { {'Q','A',0}, {'Q','A','T',0}, 634 }, /* Qatar */ + { {'R','E',0}, {'R','E','U',0}, 638 }, /* Reunion */ + { {'M','H',0}, {'M','H','L',0}, 584 }, /* Marshall Islands */ + { {'R','O',0}, {'R','O','U',0}, 642 }, /* Romania */ + { {'P','H',0}, {'P','H','L',0}, 608 }, /* Philippines */ + { {'P','R',0}, {'P','R','I',0}, 630 }, /* Puerto Rico */ + { {'R','U',0}, {'R','U','S',0}, 643 }, /* Russia */ + { {'R','W',0}, {'R','W','A',0}, 646 }, /* Rwanda */ + { {'S','A',0}, {'S','A','U',0}, 682 }, /* Saudi Arabia */ + { {'P','M',0}, {'S','P','M',0}, 666 }, /* St. Pierre and Miquelon */ + { {'K','N',0}, {'K','N','A',0}, 659 }, /* St. Kitts and Nevis */ + { {'S','C',0}, {'S','Y','C',0}, 690 }, /* Seychelles */ + { {'Z','A',0}, {'Z','A','F',0}, 710 }, /* South Africa */ + { {'S','N',0}, {'S','E','N',0}, 686 }, /* Senegal */ + { }, /* 211 unassigned */ + { {'S','I',0}, {'S','V','N',0}, 705 }, /* Slovenia */ + { {'S','L',0}, {'S','L','E',0}, 694 }, /* Sierra Leone */ + { {'S','M',0}, {'S','M','R',0}, 674 }, /* San Marino */ + { {'S','G',0}, {'S','G','P',0}, 702 }, /* Singapore */ + { {'S','O',0}, {'S','O','M',0}, 706 }, /* Somalia */ + { {'E','S',0}, {'E','S','P',0}, 724 }, /* Spain */ + { {'L','C',0}, {'L','C','A',0}, 662 }, /* St. Lucia */ + { {'S','D',0}, {'S','D','N',0}, 736 }, /* Sudan */ + { {'S','J',0}, {'S','J','M',0}, 744 }, /* Svalbard */ + { {'S','E',0}, {'S','W','E',0}, 752 }, /* Sweden */ + { {'S','Y',0}, {'S','Y','R',0}, 760 }, /* Syria */ + { {'C','H',0}, {'C','H','E',0}, 756 }, /* Switzerland */ + { {'A','E',0}, {'A','R','E',0}, 784 }, /* United Arab Emirates */ + { {'T','T',0}, {'T','T','O',0}, 780 }, /* Trinidad and Tobago */ + { }, /* 226 unassigned */ + { {'T','H',0}, {'T','H','A',0}, 764 }, /* Thailand */ + { {'T','J',0}, {'T','J','K',0}, 762 }, /* Tajikistan */ + { }, /* 229 unassigned */ + { }, /* 230 unassigned */ + { {'T','O',0}, {'T','O','N',0}, 776 }, /* Tonga */ + { {'T','G',0}, {'T','G','O',0}, 768 }, /* Togo */ + { {'S','T',0}, {'S','T','P',0}, 678 }, /* São Tomé and Príncipe */ + { {'T','N',0}, {'T','U','N',0}, 788 }, /* Tunisia */ + { {'T','R',0}, {'T','U','R',0}, 792 }, /* Turkey */ + { {'T','V',0}, {'T','U','V',0}, 798 }, /* Tuvalu */ + { {'T','W',0}, {'T','W','N',0}, 158 }, /* Taiwan */ + { {'T','M',0}, {'T','K','M',0}, 795 }, /* Turkmenistan */ + { {'T','Z',0}, {'T','Z','A',0}, 834 }, /* Tanzania */ + { {'U','G',0}, {'U','G','A',0}, 800 }, /* Uganda */ + { {'U','A',0}, {'U','K','R',0}, 804 }, /* Ukraine */ + { {'G','B',0}, {'G','B','R',0}, 826 }, /* United Kingdom */ + { }, /* 243 unassigned */ + { {'U','S',0}, {'U','S','A',0}, 840 }, /* United States */ + { {'B','F',0}, {'B','F','A',0}, 854 }, /* Burkina Faso */ + { {'U','Y',0}, {'U','R','Y',0}, 858 }, /* Uruguay */ + { {'U','Z',0}, {'U','Z','B',0}, 860 }, /* Uzbekistan */ + { {'V','C',0}, {'V','C','T',0}, 670 }, /* St. Vincent and the Grenadines */ + { {'V','E',0}, {'V','E','N',0}, 862 }, /* Bolivarian Republic of Venezuela */ + { }, /* 250 unassigned */ + { {'V','N',0}, {'V','N','M',0}, 704 }, /* Vietnam */ + { {'V','I',0}, {'V','I','R',0}, 850 }, /* Virgin Islands */ + { {'V','A',0}, {'V','A','T',0}, 336 }, /* Vatican City */ + { {'N','A',0}, {'N','A','M',0}, 516 }, /* Namibia */ + { }, /* 255 unassigned */ + { }, /* 256 unassigned */ + { {'E','H',0}, {'E','S','H',0}, 732 }, /* Western Sahara (disputed) */ + { {'X','X',0}, {'X','X',0}, 0 }, /* Wake Island */ + { {'W','S',0}, {'W','S','M',0}, 882 }, /* Samoa */ + { {'S','Z',0}, {'S','W','Z',0}, 748 }, /* Swaziland */ + { {'Y','E',0}, {'Y','E','M',0}, 887 }, /* Yemen */ + { }, /* 262 unassigned */ + { {'Z','M',0}, {'Z','M','B',0}, 894 }, /* Zambia */ + { {'Z','W',0}, {'Z','W','E',0}, 716 }, /* Zimbabwe */ + { }, /* 265 unassigned */ + { }, /* 266 unassigned */ + { }, /* 267 unassigned */ + { }, /* 268 unassigned */ + { {'C','S',0}, {'S','C','G',0}, 891 }, /* Serbia and Montenegro (Former) */ + { {'M','E',0}, {'M','N','E',0}, 499 }, /* Montenegro */ + { {'R','S',0}, {'S','R','B',0}, 688 }, /* Serbia */ + { }, /* 272 unassigned */ + { {'C','W',0}, {'C','U','W',0}, 531 }, /* Curaçao */ + { }, /* 274 unassigned */ + { }, /* 275 unassigned */ + { {'S','S',0}, {'S','S','D',0}, 728 }, /* South Sudan */ + { }, /* 277 unassigned */ + { }, /* 278 unassigned */ + { }, /* 279 unassigned */ + { }, /* 280 unassigned */ + { }, /* 281 unassigned */ + { }, /* 282 unassigned */ + { }, /* 283 unassigned */ + { }, /* 284 unassigned */ + { }, /* 285 unassigned */ + { }, /* 286 unassigned */ + { }, /* 287 unassigned */ + { }, /* 288 unassigned */ + { }, /* 289 unassigned */ + { }, /* 290 unassigned */ + { }, /* 291 unassigned */ + { }, /* 292 unassigned */ + { }, /* 293 unassigned */ + { }, /* 294 unassigned */ + { }, /* 295 unassigned */ + { }, /* 296 unassigned */ + { }, /* 297 unassigned */ + { }, /* 298 unassigned */ + { }, /* 299 unassigned */ + { {'A','I',0}, {'A','I','A',0}, 660 }, /* Anguilla */ + { {'A','Q',0}, {'A','T','A',0}, 10 }, /* Antarctica */ + { {'A','W',0}, {'A','B','W',0}, 533 }, /* Aruba */ + { {'X','X',0}, {'X','X',0}, 0 }, /* Ascension Island */ + { {'X','X',0}, {'X','X',0}, 0 }, /* Ashmore and Cartier Islands */ + { {'X','X',0}, {'X','X',0}, 0 }, /* Baker Island */ + { {'B','V',0}, {'B','V','T',0}, 74 }, /* Bouvet Island */ + { {'K','Y',0}, {'C','Y','M',0}, 136 }, /* Cayman Islands */ + { {'X','X',0}, {'X','X',0}, 0 }, /* Channel Islands */ + { {'C','X',0}, {'C','X','R',0}, 162 }, /* Christmas Island */ + { {'X','X',0}, {'X','X',0}, 0 }, /* Clipperton Island */ + { {'C','C',0}, {'C','C','K',0}, 166 }, /* Cocos (Keeling) Islands */ + { {'C','K',0}, {'C','O','K',0}, 184 }, /* Cook Islands */ + { {'X','X',0}, {'X','X',0}, 0 }, /* Coral Sea Islands */ + { {'X','X',0}, {'X','X',0}, 0 }, /* Diego Garcia */ + { {'F','K',0}, {'F','L','K',0}, 238 }, /* Falkland Islands (Islas Malvinas) */ + { }, /* 316 unassigned */ + { {'G','F',0}, {'G','U','F',0}, 254 }, /* French Guiana */ + { {'P','F',0}, {'P','Y','F',0}, 258 }, /* French Polynesia */ + { {'T','F',0}, {'A','T','F',0}, 260 }, /* French Southern and Antarctic Lands */ + { }, /* 320 unassigned */ + { {'G','P',0}, {'G','L','P',0}, 312 }, /* Guadeloupe */ + { {'G','U',0}, {'G','U','M',0}, 316 }, /* Guam */ + { {'X','X',0}, {'X','X',0}, 0 }, /* Guantanamo Bay */ + { {'G','G',0}, {'G','G','Y',0}, 831 }, /* Guernsey */ + { {'H','M',0}, {'H','M','D',0}, 334 }, /* Heard Island and McDonald Islands */ + { {'X','X',0}, {'X','X',0}, 0 }, /* Howland Island */ + { {'X','X',0}, {'X','X',0}, 0 }, /* Jarvis Island */ + { {'J','E',0}, {'J','E','Y',0}, 832 }, /* Jersey */ + { {'X','X',0}, {'X','X',0}, 0 }, /* Kingman Reef */ + { {'M','Q',0}, {'M','T','Q',0}, 474 }, /* Martinique */ + { {'Y','T',0}, {'M','Y','T',0}, 175 }, /* Mayotte */ + { {'M','S',0}, {'M','S','R',0}, 500 }, /* Montserrat */ + { {'A','N',0}, {'A','N','T',0}, 530 }, /* Netherlands Antilles (Former) */ + { {'N','C',0}, {'N','C','L',0}, 540 }, /* New Caledonia */ + { {'N','U',0}, {'N','I','U',0}, 570 }, /* Niue */ + { {'N','F',0}, {'N','F','K',0}, 574 }, /* Norfolk Island */ + { {'M','P',0}, {'M','N','P',0}, 580 }, /* Northern Mariana Islands */ + { {'X','X',0}, {'X','X',0}, 0 }, /* Palmyra Atoll */ + { {'P','N',0}, {'P','C','N',0}, 612 }, /* Pitcairn Islands */ + { {'X','X',0}, {'X','X',0}, 0 }, /* Rota Island */ + { {'X','X',0}, {'X','X',0}, 0 }, /* Saipan */ + { {'G','S',0}, {'S','G','S',0}, 239 }, /* South Georgia and the South Sandwich Islands */ + { {'S','H',0}, {'S','H','N',0}, 654 }, /* St. Helena */ + { }, /* 344 unassigned */ + { }, /* 345 unassigned */ + { {'X','X',0}, {'X','X',0}, 0 }, /* Tinian Island */ + { {'T','K',0}, {'T','K','L',0}, 772 }, /* Tokelau */ + { {'X','X',0}, {'X','X',0}, 0 }, /* Tristan da Cunha */ + { {'T','C',0}, {'T','C','A',0}, 796 }, /* Turks and Caicos Islands */ + { }, /* 350 unassigned */ + { {'V','G',0}, {'V','G','B',0}, 92 }, /* Virgin Islands, British */ + { {'W','F',0}, {'W','L','F',0}, 876 }, /* Wallis and Futuna */ +}; + +/****************************************************************************** + * GetGeoInfoW (KERNEL32.@) + */ +INT WINAPI GetGeoInfoW(GEOID geoid, GEOTYPE geotype, LPWSTR data, int data_len, LANGID lang) { - FIXME("%d %d %p %d %d\n", GeoId, GeoType, lpGeoData, cchData, language); - return 0; + const struct geoinfo_t *ptr; + const WCHAR *str = NULL; + WCHAR buffW[12]; + INT len; + + TRACE("%d %d %p %d %d\n", geoid, geotype, data, data_len, lang); + + /* validate index */ + if (geoid < 0 || geoid > sizeof(geoinfodata)/sizeof(struct geoinfo_t)) { + SetLastError(ERROR_INVALID_PARAMETER); + return 0; + } + + ptr = &geoinfodata[geoid]; + if (!*ptr->iso2W) { + SetLastError(ERROR_INVALID_PARAMETER); + return 0; + } + + switch (geotype) { + case GEO_NATION: + case GEO_ISO_UN_NUMBER: + { + static const WCHAR fmtW[] = {'%','d',0}; + sprintfW(buffW, fmtW, geotype == GEO_NATION ? geoid : ptr->uncode); + str = buffW; + break; + } + case GEO_ISO2: + case GEO_ISO3: + { + str = geotype == GEO_ISO2 ? ptr->iso2W : ptr->iso3W; + break; + } + case GEO_RFC1766: + case GEO_LCID: + case GEO_FRIENDLYNAME: + case GEO_OFFICIALNAME: + case GEO_TIMEZONES: + case GEO_OFFICIALLANGUAGES: + case GEO_LATITUDE: + case GEO_LONGITUDE: + case GEO_PARENT: + FIXME("type %d is not supported\n", geotype); + SetLastError(ERROR_CALL_NOT_IMPLEMENTED); + return 0; + default: + WARN("unrecognized type %d\n", geotype); + SetLastError(ERROR_INVALID_FLAGS); + return 0; + } + + len = strlenW(str) + 1; + if (!data || !data_len) + return len; + + memcpy(data, str, min(len, data_len)*sizeof(WCHAR)); + if (data_len < len) + SetLastError(ERROR_INSUFFICIENT_BUFFER); + return data_len < len ? 0 : len; } -INT WINAPI GetGeoInfoA(GEOID GeoId, GEOTYPE GeoType, LPSTR lpGeoData, - int cchData, LANGID language) +/****************************************************************************** + * GetGeoInfoA (KERNEL32.@) + */ +INT WINAPI GetGeoInfoA(GEOID geoid, GEOTYPE geotype, LPSTR data, int data_len, LANGID lang) { - FIXME("%d %d %p %d %d\n", GeoId, GeoType, lpGeoData, cchData, language); - return 0; + WCHAR *buffW; + INT len; + + TRACE("%d %d %p %d %d\n", geoid, geotype, data, data_len, lang); + + len = GetGeoInfoW(geoid, geotype, NULL, 0, lang); + if (!len) + return 0; + + buffW = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR)); + if (!buffW) + return 0; + + GetGeoInfoW(geoid, geotype, buffW, len, lang); + len = WideCharToMultiByte(CP_ACP, 0, buffW, -1, NULL, 0, NULL, NULL); + if (!data || !data_len) { + HeapFree(GetProcessHeap(), 0, buffW); + return len; + } + + len = WideCharToMultiByte(CP_ACP, 0, buffW, -1, data, data_len, NULL, NULL); + HeapFree(GetProcessHeap(), 0, buffW); + + if (data_len < len) + SetLastError(ERROR_INSUFFICIENT_BUFFER); + return data_len < len ? 0 : len; } INT WINAPI GetUserDefaultLocaleName(LPWSTR localename, int buffersize) diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/kernel32/nameprep.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/kernel32/nameprep.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/kernel32/nameprep.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/kernel32/nameprep.c 2014-07-11 19:15:41.000000000 +0000 @@ -2,8 +2,6 @@ /* generated from http://www.rfc-editor.org/rfc/rfc3454.txt */ /* DO NOT EDIT!! */ -#include "wine/unicode.h" - const unsigned short nameprep_char_type[4432] = { /* level 1 offsets */ @@ -564,7 +562,7 @@ 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0001, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002, 0x0002 }; -const WCHAR nameprep_mapping[5856] = +const unsigned short nameprep_mapping[5856] = { /* index */ 0x0110, 0x0120, 0x0130, 0x0140, 0x0150, 0x0160, 0x0100, 0x0100, diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/kernel32/sync.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/kernel32/sync.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/kernel32/sync.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/kernel32/sync.c 2014-07-11 19:15:41.000000000 +0000 @@ -458,7 +458,7 @@ */ HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventExW( SECURITY_ATTRIBUTES *sa, LPCWSTR name, DWORD flags, DWORD access ) { - HANDLE ret; + HANDLE ret = 0; UNICODE_STRING nameW; OBJECT_ATTRIBUTES attr; NTSTATUS status; @@ -632,7 +632,7 @@ */ HANDLE WINAPI DECLSPEC_HOTPATCH CreateMutexExW( SECURITY_ATTRIBUTES *sa, LPCWSTR name, DWORD flags, DWORD access ) { - HANDLE ret; + HANDLE ret = 0; UNICODE_STRING nameW; OBJECT_ATTRIBUTES attr; NTSTATUS status; @@ -777,7 +777,7 @@ HANDLE WINAPI DECLSPEC_HOTPATCH CreateSemaphoreExW( SECURITY_ATTRIBUTES *sa, LONG initial, LONG max, LPCWSTR name, DWORD flags, DWORD access ) { - HANDLE ret; + HANDLE ret = 0; UNICODE_STRING nameW; OBJECT_ATTRIBUTES attr; NTSTATUS status; diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/kernel32/tests/locale.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/kernel32/tests/locale.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/kernel32/tests/locale.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/kernel32/tests/locale.c 2014-07-11 19:15:41.000000000 +0000 @@ -90,27 +90,34 @@ static INT (WINAPI *pCompareStringOrdinal)(const WCHAR *, INT, const WCHAR *, INT, BOOL); static INT (WINAPI *pCompareStringEx)(LPCWSTR, DWORD, LPCWSTR, INT, LPCWSTR, INT, LPNLSVERSIONINFO, LPVOID, LPARAM); +static INT (WINAPI *pGetGeoInfoA)(GEOID, GEOTYPE, LPSTR, INT, LANGID); +static INT (WINAPI *pGetGeoInfoW)(GEOID, GEOTYPE, LPWSTR, INT, LANGID); static void InitFunctionPointers(void) { hKernel32 = GetModuleHandleA("kernel32"); - pEnumSystemLanguageGroupsA = (void*)GetProcAddress(hKernel32, "EnumSystemLanguageGroupsA"); - pEnumLanguageGroupLocalesA = (void*)GetProcAddress(hKernel32, "EnumLanguageGroupLocalesA"); - pLocaleNameToLCID = (void*)GetProcAddress(hKernel32, "LocaleNameToLCID"); - pLCIDToLocaleName = (void*)GetProcAddress(hKernel32, "LCIDToLocaleName"); - pLCMapStringEx = (void*)GetProcAddress(hKernel32, "LCMapStringEx"); - pFoldStringA = (void*)GetProcAddress(hKernel32, "FoldStringA"); - pFoldStringW = (void*)GetProcAddress(hKernel32, "FoldStringW"); - pIsValidLanguageGroup = (void*)GetProcAddress(hKernel32, "IsValidLanguageGroup"); - pEnumUILanguagesA = (void*)GetProcAddress(hKernel32, "EnumUILanguagesA"); - pEnumSystemLocalesEx = (void*)GetProcAddress(hKernel32, "EnumSystemLocalesEx"); - pIdnToNameprepUnicode = (void*)GetProcAddress(hKernel32, "IdnToNameprepUnicode"); - pIdnToAscii = (void*)GetProcAddress(hKernel32, "IdnToAscii"); - pIdnToUnicode = (void*)GetProcAddress(hKernel32, "IdnToUnicode"); - pGetLocaleInfoEx = (void*)GetProcAddress(hKernel32, "GetLocaleInfoEx"); - pIsValidLocaleName = (void*)GetProcAddress(hKernel32, "IsValidLocaleName"); - pCompareStringOrdinal = (void*)GetProcAddress(hKernel32, "CompareStringOrdinal"); - pCompareStringEx = (void*)GetProcAddress(hKernel32, "CompareStringEx"); + +#define X(f) p##f = (void*)GetProcAddress(hKernel32, #f) + X(EnumSystemLanguageGroupsA); + X(EnumLanguageGroupLocalesA); + X(LocaleNameToLCID); + X(LCIDToLocaleName); + X(LCMapStringEx); + X(FoldStringA); + X(FoldStringW); + X(IsValidLanguageGroup); + X(EnumUILanguagesA); + X(EnumSystemLocalesEx); + X(IdnToNameprepUnicode); + X(IdnToAscii); + X(IdnToUnicode); + X(GetLocaleInfoEx); + X(IsValidLocaleName); + X(CompareStringOrdinal); + X(CompareStringEx); + X(GetGeoInfoA); + X(GetGeoInfoW); +#undef X } #define eq(received, expected, label, type) \ @@ -3271,6 +3278,7 @@ static const WCHAR space_special[] = {0x09, 0x0d, 0x85}; WORD types[20]; + WCHAR ch; int i; memset(types,0,sizeof(types)); @@ -3327,6 +3335,21 @@ GetStringTypeW(CT_CTYPE1, space_special, 3, types); for (i = 0; i < 3; i++) ok(types[i] & C1_SPACE || broken(types[i] == C1_CNTRL) || broken(types[i] == 0), "incorrect types returned for %x -> (%x does not have %x)\n",space_special[i], types[i], C1_SPACE ); + + /* surrogate pairs */ + ch = 0xd800; + memset(types, 0, sizeof(types)); + GetStringTypeW(CT_CTYPE3, &ch, 1, types); + if (types[0] == C3_NOTAPPLICABLE) + win_skip("C3_HIGHSURROGATE/C3_LOWSURROGATE are not supported.\n"); + else { + ok(types[0] == C3_HIGHSURROGATE, "got %x\n", types[0]); + + ch = 0xdc00; + memset(types, 0, sizeof(types)); + GetStringTypeW(CT_CTYPE3, &ch, 1, types); + ok(types[0] == C3_LOWSURROGATE, "got %x\n", types[0]); + } } static void test_IdnToNameprepUnicode(void) @@ -3821,6 +3844,75 @@ ok(ret == CSTR_LESS_THAN, "Got %u, expected %u\n", ret, CSTR_LESS_THAN); } +static void test_GetGeoInfo(void) +{ + char buffA[20]; + INT ret; + + if (!pGetGeoInfoA) + { + win_skip("GetGeoInfo is not available.\n"); + return; + } + + /* unassigned id */ + SetLastError(0xdeadbeef); + ret = pGetGeoInfoA(344, GEO_ISO2, NULL, 0, 0); + ok(ret == 0, "got %d\n", ret); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %d\n", GetLastError()); + + ret = pGetGeoInfoA(203, GEO_ISO2, NULL, 0, 0); + ok(ret == 3, "got %d\n", ret); + + ret = pGetGeoInfoA(203, GEO_ISO3, NULL, 0, 0); + ok(ret == 4, "got %d\n", ret); + + ret = pGetGeoInfoA(203, GEO_ISO2, buffA, 3, 0); + ok(ret == 3, "got %d\n", ret); + ok(!strcmp(buffA, "RU"), "got %s\n", buffA); + + /* buffer pointer not NULL, length is 0 - return required length */ + buffA[0] = 'a'; + SetLastError(0xdeadbeef); + ret = pGetGeoInfoA(203, GEO_ISO2, buffA, 0, 0); + ok(ret == 3, "got %d\n", ret); + ok(buffA[0] == 'a', "got %c\n", buffA[0]); + + ret = pGetGeoInfoA(203, GEO_ISO3, buffA, 4, 0); + ok(ret == 4, "got %d\n", ret); + ok(!strcmp(buffA, "RUS"), "got %s\n", buffA); + + /* shorter buffer */ + SetLastError(0xdeadbeef); + buffA[1] = buffA[2] = 0; + ret = pGetGeoInfoA(203, GEO_ISO2, buffA, 2, 0); + ok(ret == 0, "got %d\n", ret); + ok(!strcmp(buffA, "RU"), "got %s\n", buffA); + ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "got %d\n", GetLastError()); + + /* GEO_NATION returns GEOID in a string form */ + buffA[0] = 0; + ret = pGetGeoInfoA(203, GEO_NATION, buffA, 20, 0); + ok(ret == 4, "got %d\n", ret); + ok(!strcmp(buffA, "203"), "got %s\n", buffA); + + buffA[0] = 0; + ret = pGetGeoInfoA(203, GEO_ISO_UN_NUMBER, buffA, 20, 0); + if (ret == 0) + win_skip("GEO_ISO_UN_NUMBER not supported.\n"); + else + { + ok(ret == 4, "got %d\n", ret); + ok(!strcmp(buffA, "643"), "got %s\n", buffA); + } + + /* try invalid type value */ + SetLastError(0xdeadbeef); + ret = pGetGeoInfoA(203, GEO_PARENT + 1, NULL, 0, 0); + ok(ret == 0, "got %d\n", ret); + ok(GetLastError() == ERROR_INVALID_FLAGS, "got %d\n", GetLastError()); +} + START_TEST(locale) { InitFunctionPointers(); @@ -3856,6 +3948,7 @@ test_IdnToUnicode(); test_IsValidLocaleName(); test_CompareStringOrdinal(); + test_GetGeoInfo(); /* this requires collation table patch to make it MS compatible */ if (0) test_sorting(); } diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/mmdevapi/tests/capture.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/mmdevapi/tests/capture.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/mmdevapi/tests/capture.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/mmdevapi/tests/capture.c 2014-07-11 19:15:41.000000000 +0000 @@ -424,7 +424,7 @@ /* Still receiving events! */ r = WaitForSingleObject(handle, 20); - todo_wine ok(r == WAIT_OBJECT_0, "Wait(event) after Stop gave %x\n", r); + ok(r == WAIT_OBJECT_0, "Wait(event) after Stop gave %x\n", r); hr = IAudioClient_Reset(ac); ok(hr == S_OK, "Reset failed: %08x\n", hr); @@ -432,13 +432,13 @@ ok(ResetEvent(handle), "ResetEvent\n"); r = WaitForSingleObject(handle, 120); - todo_wine ok(r == WAIT_OBJECT_0, "Wait(event) after Reset gave %x\n", r); + ok(r == WAIT_OBJECT_0, "Wait(event) after Reset gave %x\n", r); hr = IAudioClient_SetEventHandle(ac, NULL); ok(hr == E_INVALIDARG, "SetEventHandle(NULL) returns %08x\n", hr); r = WaitForSingleObject(handle, 70); - todo_wine ok(r == WAIT_OBJECT_0, "Wait(NULL event) gave %x\n", r); + ok(r == WAIT_OBJECT_0, "Wait(NULL event) gave %x\n", r); hr = IAudioClient_Start(ac); ok(hr == S_OK, "Start failed: %08x\n", hr); diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/mmdevapi/tests/render.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/mmdevapi/tests/render.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/mmdevapi/tests/render.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/mmdevapi/tests/render.c 2014-07-11 19:15:41.000000000 +0000 @@ -651,7 +651,7 @@ /* Still receiving events! */ r = WaitForSingleObject(event, 20); - todo_wine ok(r == WAIT_OBJECT_0, "Wait(event) after Stop gave %x\n", r); + ok(r == WAIT_OBJECT_0, "Wait(event) after Stop gave %x\n", r); hr = IAudioClient_Reset(ac); ok(hr == S_OK, "Reset failed: %08x\n", hr); @@ -659,13 +659,13 @@ ok(ResetEvent(event), "ResetEvent\n"); r = WaitForSingleObject(event, 120); - todo_wine ok(r == WAIT_OBJECT_0, "Wait(event) after Reset gave %x\n", r); + ok(r == WAIT_OBJECT_0, "Wait(event) after Reset gave %x\n", r); hr = IAudioClient_SetEventHandle(ac, NULL); ok(hr == E_INVALIDARG, "SetEventHandle(NULL) returns %08x\n", hr); r = WaitForSingleObject(event, 70); - todo_wine ok(r == WAIT_OBJECT_0, "Wait(NULL event) gave %x\n", r); + ok(r == WAIT_OBJECT_0, "Wait(NULL event) gave %x\n", r); /* test releasing a playing stream */ hr = IAudioClient_Start(ac); diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/mshtml/navigate.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/mshtml/navigate.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/mshtml/navigate.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/mshtml/navigate.c 2014-07-11 19:15:41.000000000 +0000 @@ -993,7 +993,7 @@ break; } - MultiByteToWideChar(CP_ACP, 0, bsc->buf, bsc->bsc.readed, text, len); + MultiByteToWideChar(cp, 0, bsc->buf, bsc->bsc.readed, text, len); text[len] = 0; } } diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/msvcrt/file.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/msvcrt/file.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/msvcrt/file.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/msvcrt/file.c 2014-07-11 19:15:41.000000000 +0000 @@ -2185,6 +2185,9 @@ MSVCRT_wchar_t *pathW; int ret; + if (!MSVCRT_CHECK_PMT(fd != NULL)) + return MSVCRT_EINVAL; + *fd = -1; if(!MSVCRT_CHECK_PMT(path && (pathW = msvcrt_wstrdupa(path)))) return MSVCRT_EINVAL; @@ -4506,7 +4509,7 @@ file->_flag |= MSVCRT__USERBUF; file->_bufsiz = size; }else { - file->_base = file->_ptr = malloc(size); + file->_base = file->_ptr = MSVCRT_malloc(size); if(!file->_base) { file->_bufsiz = 0; MSVCRT__unlock_file(file); diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/msvcrt/misc.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/msvcrt/misc.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/msvcrt/misc.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/msvcrt/misc.c 2014-07-11 19:15:41.000000000 +0000 @@ -139,7 +139,7 @@ while (min <= max) { - ssize_t cursor = (min + max) / 2; + ssize_t cursor = min + (max - min) / 2; int ret = compare(ctx, key,(const char *)base+(cursor*size)); if (!ret) return (char*)base+(cursor*size); diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/msvfw32/msvideo_main.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/msvfw32/msvideo_main.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/msvfw32/msvideo_main.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/msvfw32/msvideo_main.c 2014-07-11 19:15:41.000000000 +0000 @@ -67,7 +67,7 @@ static reg_driver* reg_driver_list = NULL; -/* This one is a macro such that it works for both ASCII and Unicode */ +/* This one is a macro in order to work for both ASCII and Unicode */ #define fourcc_to_string(str, fcc) do { \ (str)[0] = LOBYTE(LOWORD(fcc)); \ (str)[1] = HIBYTE(LOWORD(fcc)); \ diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/ntdll/misc.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/ntdll/misc.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/ntdll/misc.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/ntdll/misc.c 2014-07-11 19:15:41.000000000 +0000 @@ -299,7 +299,7 @@ while (min <= max) { - ssize_t cursor = (min + max) / 2; + ssize_t cursor = min + (max - min) / 2; int ret = compar(key,(const char *)base+(cursor*size)); if (!ret) return (char*)base+(cursor*size); diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/ole32/filemoniker.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/ole32/filemoniker.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/ole32/filemoniker.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/ole32/filemoniker.c 2014-07-11 19:15:41.000000000 +0000 @@ -605,22 +605,11 @@ /* get the file name */ IMoniker_GetDisplayName(iface,pbc,pmkToLeft,&filePath); - /* verify if the file contains a storage object */ - res=StgIsStorageFile(filePath); + res=StgOpenStorage(filePath,NULL,STGM_READWRITE|STGM_SHARE_DENY_WRITE,NULL,0,&pstg); - if(res==S_OK){ + if (SUCCEEDED(res)) + *ppvObject=pstg; - res=StgOpenStorage(filePath,NULL,STGM_READWRITE|STGM_SHARE_DENY_WRITE,NULL,0,&pstg); - - if (SUCCEEDED(res)){ - - *ppvObject=pstg; - - IStorage_AddRef(pstg); - - return res; - } - } CoTaskMemFree(filePath); } else diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/ole32/ole2.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/ole32/ole2.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/ole32/ole2.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/ole32/ole2.c 2014-07-11 19:15:41.000000000 +0000 @@ -2205,7 +2205,9 @@ case WM_MBUTTONDOWN: case WM_RBUTTONDOWN: { - OLEDD_TrackStateChange((TrackerWindowInfo*)GetWindowLongPtrA(hwnd, 0)); + TrackerWindowInfo *trackerInfo = (TrackerWindowInfo*)GetWindowLongPtrA(hwnd, 0); + if (trackerInfo->trackingDone) break; + OLEDD_TrackStateChange(trackerInfo); break; } case WM_DESTROY: diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/oleaut32/tests/vartype.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/oleaut32/tests/vartype.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/oleaut32/tests/vartype.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/oleaut32/tests/vartype.c 2014-07-11 19:15:41.000000000 +0000 @@ -4408,8 +4408,39 @@ ok(hres == DISP_E_OVERFLOW,"Expected overflow, got (%d,%d,%d,(%8x,%8x)x) hres 0x%08x\n", S(U(out)).scale, S(U(out)).sign, out.Hi32, S1(U1(out)).Mid32, S1(U1(out)).Lo32, hres); + SETDEC64(l,1,0,0xffffffff,0xffffffff,0xffffffff);SETDEC(r,1,0,0,1); MATH2(VarDecAdd); + todo_wine EXPECTDEC64(0,0,0x19999999,0x99999999,0x9999999A); + + SETDEC64(l,0,0,0xe22ea493,0xb30310a7,0x70000000);SETDEC64(r,0,0,0xe22ea493,0xb30310a7,0x70000000); MATH2(VarDecAdd); + ok(hres == DISP_E_OVERFLOW,"Expected overflow, got (%d,%d,%d,(%8x,%8x)x) hres 0x%08x\n", + S(U(out)).scale, S(U(out)).sign, out.Hi32, S1(U1(out)).Mid32, S1(U1(out)).Lo32, hres); + + SETDEC64(l,1,0,0xe22ea493,0xb30310a7,0x70000000);SETDEC64(r,1,0,0xe22ea493,0xb30310a7,0x70000000); MATH2(VarDecAdd); + todo_wine EXPECTDEC64(0,0,0x2d3c8750,0xbd670354,0xb0000000); + SETDEC(l,3,128,0,123456); SETDEC64(r,0,0,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF); - MATH2(VarDecAdd); todo_wine EXPECTDEC64(0,0,-1,0xFFFFFFFF,0xFFFFFF84); + MATH2(VarDecAdd); EXPECTDEC64(0,0,-1,0xFFFFFFFF,0xFFFFFF84); + + SETDEC(l,3,0,0,123456); SETDEC64(r,0,0,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF); MATH2(VarDecAdd); + ok(hres == DISP_E_OVERFLOW,"Expected overflow, got (%d,%d,%d,(%8x,%8x)x) hres 0x%08x\n", + S(U(out)).scale, S(U(out)).sign, out.Hi32, S1(U1(out)).Mid32, S1(U1(out)).Lo32, hres); + + SETDEC(l,4,0,0,123456); SETDEC64(r,0,0,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF); MATH2(VarDecAdd); + ok(hres == DISP_E_OVERFLOW,"Expected overflow, got (%d,%d,%d,(%8x,%8x)x) hres 0x%08x\n", + S(U(out)).scale, S(U(out)).sign, out.Hi32, S1(U1(out)).Mid32, S1(U1(out)).Lo32, hres); + + SETDEC(l,5,0,0,123456); SETDEC64(r,0,0,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF); MATH2(VarDecAdd); + ok(hres == DISP_E_OVERFLOW,"Expected overflow, got (%d,%d,%d,(%8x,%8x)x) hres 0x%08x\n", + S(U(out)).scale, S(U(out)).sign, out.Hi32, S1(U1(out)).Mid32, S1(U1(out)).Lo32, hres); + + SETDEC(l,6,0,0,123456); SETDEC64(r,0,0,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF); + MATH2(VarDecAdd); EXPECTDEC64(0,0,-1,0xFFFFFFFF,0xFFFFFFFF); + + SETDEC(l,3,128,0,123456); SETDEC64(r,0,0,0x19999999,0x99999999,0x99999999); + MATH2(VarDecAdd); EXPECTDEC64(1,0,-1,0xFFFFFFFF,0xFFFFFB27); + + SETDEC(l,3,128,0,123567); SETDEC64(r,0,0,0x19999999,0x99999999,0x99999999); + MATH2(VarDecAdd); EXPECTDEC64(1,0,-1,0xFFFFFFFF,0xFFFFFB26); /* Promotes to the highest scale, so here the results are in the scale of 2 */ SETDEC(l,2,0,0,0); SETDEC(r,0,0,0,0); MATH2(VarDecAdd); EXPECTDEC(2,0,0,0); @@ -4632,7 +4663,7 @@ SETDEC(out,0,DECIMAL_NEG,-1,-1); SETDEC(l,0,DECIMAL_NEG,-1,-1); MATH1(VarDecCmp); EXPECT_EQ; SETDEC(l,3,0,0,123456); SETDEC64(out,0,0,0xFFFFFFFF,0xFFFFFFFF,0xFFFFFFFF); - MATH1(VarDecCmp); todo_wine EXPECT_LT; + MATH1(VarDecCmp); EXPECT_LT; } static void test_VarDecCmpR8(void) diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/oleaut32/vartype.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/oleaut32/vartype.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/oleaut32/vartype.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/oleaut32/vartype.c 2014-07-11 19:15:41.000000000 +0000 @@ -4164,6 +4164,8 @@ static HRESULT VARIANT_DI_FromR8(double source, VARIANT_DI * dest); static void VARIANT_DIFromDec(const DECIMAL * from, VARIANT_DI * to); static void VARIANT_DecFromDI(const VARIANT_DI * from, DECIMAL * to); +static unsigned char VARIANT_int_divbychar(DWORD * p, unsigned int n, unsigned char divisor); +static BOOL VARIANT_int_iszero(const DWORD * p, unsigned int n); /************************************************************************ * VarDecFromR4 (OLEAUT32.193) @@ -4439,12 +4441,13 @@ /* Make two DECIMALS the same scale; used by math functions below */ static HRESULT VARIANT_DecScale(const DECIMAL** ppDecLeft, const DECIMAL** ppDecRight, - DECIMAL* pDecOut) + DECIMAL pDecOut[2]) { static DECIMAL scaleFactor; + unsigned char remainder; DECIMAL decTemp; + VARIANT_DI di; int scaleAmount, i; - HRESULT hRet = S_OK; if (DEC_SIGN(*ppDecLeft) & ~DECIMAL_NEG || DEC_SIGN(*ppDecRight) & ~DECIMAL_NEG) return E_INVALIDARG; @@ -4459,27 +4462,62 @@ if (scaleAmount > 0) { decTemp = *(*ppDecRight); /* Left is bigger - scale the right hand side */ - *ppDecRight = pDecOut; + *ppDecRight = &pDecOut[0]; } else { decTemp = *(*ppDecLeft); /* Right is bigger - scale the left hand side */ - *ppDecLeft = pDecOut; - i = scaleAmount = -scaleAmount; + *ppDecLeft = &pDecOut[0]; + i = -scaleAmount; } - if (DEC_SCALE(&decTemp) + scaleAmount > DEC_MAX_SCALE) - return DISP_E_OVERFLOW; /* Can't scale up */ + /* Multiply up the value to be scaled by the correct amount (if possible) */ + while (i > 0 && SUCCEEDED(VarDecMul(&decTemp, &scaleFactor, &pDecOut[0]))) + { + decTemp = pDecOut[0]; + i--; + } + + if (!i) + { + DEC_SCALE(&pDecOut[0]) += (scaleAmount > 0) ? scaleAmount : (-scaleAmount); + return S_OK; /* Same scale */ + } + + /* Scaling further not possible, reduce accuracy of other argument */ + pDecOut[0] = decTemp; + if (scaleAmount > 0) + { + DEC_SCALE(&pDecOut[0]) += scaleAmount - i; + VARIANT_DIFromDec(*ppDecLeft, &di); + *ppDecLeft = &pDecOut[1]; + } + else + { + DEC_SCALE(&pDecOut[0]) += (-scaleAmount) - i; + VARIANT_DIFromDec(*ppDecRight, &di); + *ppDecRight = &pDecOut[1]; + } - /* Multiply up the value to be scaled by the correct amount */ - while (SUCCEEDED(hRet) && i--) + di.scale -= i; + remainder = 0; + while (i-- > 0 && !VARIANT_int_iszero(di.bitsnum, sizeof(di.bitsnum)/sizeof(DWORD))) { - /* Note we are multiplying by a value with a scale of 0, so we don't recurse */ - hRet = VarDecMul(&decTemp, &scaleFactor, pDecOut); - decTemp = *pDecOut; + remainder = VARIANT_int_divbychar(di.bitsnum, sizeof(di.bitsnum)/sizeof(DWORD), 10); + if (remainder > 0) WARN("losing significant digits (remainder %u)...\n", remainder); } - DEC_SCALE(pDecOut) += scaleAmount; /* Set the new scale */ - return hRet; + + /* round up the result - native oleaut32 does this */ + if (remainder >= 5) { + for (remainder = 1, i = 0; i < sizeof(di.bitsnum)/sizeof(DWORD) && remainder; i++) { + ULONGLONG digit = di.bitsnum[i] + 1; + remainder = (digit > 0xFFFFFFFF) ? 1 : 0; + di.bitsnum[i] = digit & 0xFFFFFFFF; + } + } + + VARIANT_DecFromDI(&di, &pDecOut[1]); + return S_OK; } /* Add two unsigned 32 bit values with overflow */ @@ -4554,9 +4592,9 @@ HRESULT WINAPI VarDecAdd(const DECIMAL* pDecLeft, const DECIMAL* pDecRight, DECIMAL* pDecOut) { HRESULT hRet; - DECIMAL scaled; + DECIMAL scaled[2]; - hRet = VARIANT_DecScale(&pDecLeft, &pDecRight, &scaled); + hRet = VARIANT_DecScale(&pDecLeft, &pDecRight, scaled); if (SUCCEEDED(hRet)) { diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/packager/packager_main.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/packager/packager_main.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/packager/packager_main.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/packager/packager_main.c 2014-07-11 19:15:41.000000000 +0000 @@ -474,7 +474,7 @@ ++stream_filename; stream_filename_len = len - (stream_filename - filenameW); - len = GetTempPathW(sizeof(This->filename), This->filename); + len = GetTempPathW(sizeof(This->filename)/sizeof(WCHAR), This->filename); memcpy(This->filename + len, stream_filename, stream_filename_len * sizeof(WCHAR)); This->filename[len + stream_filename_len] = 0; diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/riched20/editor.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/riched20/editor.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/riched20/editor.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/riched20/editor.c 2014-07-11 19:15:41.000000000 +0000 @@ -2744,6 +2744,7 @@ ed->hwndParent = NULL; ed->sizeWindow.cx = ed->sizeWindow.cy = 0; ed->texthost = texthost; + ed->reOle = NULL; ed->bEmulateVersion10 = bEmulateVersion10; ed->styleFlags = 0; ITextHost_TxGetPropertyBits(texthost, @@ -2886,6 +2887,11 @@ if(editor->lpOleCallback) IRichEditOleCallback_Release(editor->lpOleCallback); ITextHost_Release(editor->texthost); + if (editor->reOle) + { + IRichEditOle_Release(editor->reOle); + editor->reOle = NULL; + } OleUninitialize(); FREE_OBJ(editor->pBuffer); @@ -3473,7 +3479,7 @@ editor->styleFlags |= ES_READONLY; else editor->styleFlags &= ~ES_READONLY; - return 0; + return 1; } case EM_SETEVENTMASK: { @@ -4467,8 +4473,12 @@ } case EM_GETOLEINTERFACE: { - LPVOID *ppvObj = (LPVOID*) lParam; - return CreateIRichEditOle(editor, ppvObj); + if (!editor->reOle) + if (!CreateIRichEditOle(editor, (LPVOID *)&editor->reOle)) + return 0; + *(LPVOID *)lParam = editor->reOle; + IRichEditOle_AddRef(editor->reOle); + return 1; } case EM_GETPASSWORDCHAR: { diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/riched20/editstr.h wine-compholio-1.7.22~ubuntu13.10.1/dlls/riched20/editstr.h --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/riched20/editstr.h 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/riched20/editstr.h 2014-07-11 19:15:41.000000000 +0000 @@ -388,6 +388,7 @@ { HWND hWnd, hwndParent; ITextHost *texthost; + IRichEditOle *reOle; BOOL bEmulateVersion10; ME_TextBuffer *pBuffer; ME_Cursor *pCursors; diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/riched20/tests/editor.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/riched20/tests/editor.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/riched20/tests/editor.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/riched20/tests/editor.c 2014-07-11 19:15:41.000000000 +0000 @@ -7576,6 +7576,25 @@ DestroyWindow( richedit ); } +static void test_EM_SETREADONLY(void) +{ + HWND richedit = new_richeditW(NULL); + DWORD dwStyle; + LRESULT res; + + res = SendMessageA(richedit, EM_SETREADONLY, TRUE, 0); + ok(res == 1, "EM_SETREADONLY\n"); + dwStyle = GetWindowLongA(richedit, GWL_STYLE); + ok(dwStyle & ES_READONLY, "got wrong value: 0x%x\n", dwStyle & ES_READONLY); + + res = SendMessageA(richedit, EM_SETREADONLY, FALSE, 0); + ok(res == 1, "EM_SETREADONLY\n"); + dwStyle = GetWindowLongA(richedit, GWL_STYLE); + ok(!(dwStyle & ES_READONLY), "got wrong value: 0x%x\n", dwStyle & ES_READONLY); + + DestroyWindow(richedit); +} + START_TEST( editor ) { BOOL ret; @@ -7639,6 +7658,7 @@ test_enter(); test_WM_CREATE(); test_reset_default_para_fmt(); + test_EM_SETREADONLY(); /* Set the environment variable WINETEST_RICHED20 to keep windows * responsive and open for 30 seconds. This is useful for debugging. diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/riched20/tests/richole.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/riched20/tests/richole.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/riched20/tests/richole.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/riched20/tests/richole.c 2014-07-11 19:15:41.000000000 +0000 @@ -92,15 +92,22 @@ ITextSelection_Release(*txtSel); } +static ULONG get_refcount(IUnknown *iface) +{ + IUnknown_AddRef(iface); + return IUnknown_Release(iface); +} + static void test_Interfaces(void) { - IRichEditOle *reOle = NULL; + IRichEditOle *reOle = NULL, *reOle1 = NULL; ITextDocument *txtDoc = NULL; ITextSelection *txtSel = NULL; IUnknown *punk; HRESULT hres; LRESULT res; HWND w; + ULONG refcount; w = new_richedit(NULL); if (!w) { @@ -111,6 +118,14 @@ res = SendMessageA(w, EM_GETOLEINTERFACE, 0, (LPARAM)&reOle); ok(res, "SendMessage\n"); ok(reOle != NULL, "EM_GETOLEINTERFACE\n"); + refcount = get_refcount((IUnknown *)reOle); + ok(refcount == 2, "got wrong ref count: %d\n", refcount); + + res = SendMessageA(w, EM_GETOLEINTERFACE, 0, (LPARAM)&reOle1); + ok(res == 1, "SendMessage\n"); + ok(reOle1 == reOle, "Should not return a new IRichEditOle interface\n"); + refcount = get_refcount((IUnknown *)reOle); + ok(refcount == 3, "got wrong ref count: %d\n", refcount); hres = IRichEditOle_QueryInterface(reOle, &IID_ITextDocument, (void **) &txtDoc); @@ -142,6 +157,8 @@ ITextDocument_Release(txtDoc); IRichEditOle_Release(reOle); + refcount = IRichEditOle_Release(reOle); + ok(refcount == 1, "got wrong ref count: %d\n", refcount); DestroyWindow(w); /* Methods should return CO_E_RELEASED if the backing document has diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/rpcrt4/ndr_contexthandle.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/rpcrt4/ndr_contexthandle.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/rpcrt4/ndr_contexthandle.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/rpcrt4/ndr_contexthandle.c 2014-07-11 19:15:41.000000000 +0000 @@ -157,6 +157,14 @@ RpcRaiseException(status); } +/*********************************************************************** + * RpcSsDontSerializeContext [RPCRT4.@] + */ + void WINAPI RpcSsDontSerializeContext(void) +{ + FIXME("stub\n"); +} + static UINT ndr_update_context_handle(NDR_CCONTEXT *CContext, RPC_BINDING_HANDLE hBinding, const ndr_context_handle *chi) diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/rpcrt4/rpcrt4.spec wine-compholio-1.7.22~ubuntu13.10.1/dlls/rpcrt4/rpcrt4.spec --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/rpcrt4/rpcrt4.spec 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/rpcrt4/rpcrt4.spec 2014-07-11 19:15:41.000000000 +0000 @@ -471,7 +471,7 @@ @ stub RpcSsContextLockShared # wxp @ stdcall RpcSsDestroyClientContext(ptr) @ stub RpcSsDisableAllocate -@ stub RpcSsDontSerializeContext +@ stdcall RpcSsDontSerializeContext() @ stub RpcSsEnableAllocate @ stub RpcSsFree @ stub RpcSsGetContextBinding diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/rsaenh/tests/rsaenh.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/rsaenh/tests/rsaenh.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/rsaenh/tests/rsaenh.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/rsaenh/tests/rsaenh.c 2014-07-11 19:15:41.000000000 +0000 @@ -700,6 +700,13 @@ memcpy(abData, plain, sizeof(plain)); + /* test default chaining mode */ + dwMode = 0xdeadbeef; + dwLen = sizeof(dwMode); + result = CryptGetKeyParam(hKey, KP_MODE, (BYTE*)&dwMode, &dwLen, 0); + ok(result, "%08x\n", GetLastError()); + ok(dwMode == CRYPT_MODE_CBC, "Wrong default chaining mode\n"); + dwMode = CRYPT_MODE_ECB; result = CryptSetKeyParam(hKey, KP_MODE, (BYTE*)&dwMode, 0); ok(result, "%08x\n", GetLastError()); @@ -1040,25 +1047,55 @@ { HCRYPTKEY hKey; BOOL result; - DWORD dwLen; - unsigned char pbData[16], enc_data[16], bad_data[16]; + DWORD dwLen, dwMode; + unsigned char pbData[48], enc_data[16], bad_data[16]; int i; - + static const BYTE aes_plain[32] = { + "AES Test With 2 Blocks Of Data." }; + static const BYTE aes_cbc_enc[3][48] = { + /* 128 bit key encrypted text */ + { 0xfe, 0x85, 0x3b, 0xe1, 0xf5, 0xe1, 0x58, 0x75, 0xd5, 0xa9, 0x74, 0xe3, 0x09, 0xea, 0xa5, 0x04, + 0x23, 0x35, 0xa2, 0x3b, 0x5c, 0xf1, 0x6c, 0x6f, 0xb9, 0xcd, 0x64, 0x06, 0x3e, 0x41, 0x83, 0xef, + 0x2a, 0xfe, 0xea, 0xb5, 0x6c, 0x17, 0x20, 0x79, 0x8c, 0x51, 0x3e, 0x56, 0xed, 0xe1, 0x47, 0x68 }, + /* 192 bit key encrypted text */ + { 0x6b, 0xf0, 0xfd, 0x32, 0xee, 0xc6, 0x06, 0x13, 0xa8, 0xe6, 0x3c, 0x81, 0x85, 0xb8, 0x2e, 0xa1, + 0xd4, 0x3b, 0xe8, 0x22, 0xa5, 0x74, 0x4a, 0xbe, 0x9d, 0xcf, 0xcc, 0x37, 0x26, 0x19, 0x5a, 0xd1, + 0x7f, 0x76, 0xbf, 0x94, 0x28, 0xce, 0x27, 0x21, 0x61, 0x87, 0xeb, 0xb9, 0x8b, 0xa8, 0xb4, 0x57 }, + /* 256 bit key encrypted text */ + { 0x20, 0x57, 0x17, 0x0b, 0x17, 0x76, 0xd8, 0x3b, 0x26, 0x90, 0x8b, 0x4c, 0xf2, 0x00, 0x79, 0x33, + 0x29, 0x2b, 0x13, 0x9c, 0xe2, 0x95, 0x09, 0xc1, 0xcd, 0x20, 0x87, 0x22, 0x32, 0x70, 0x9d, 0x75, + 0x9a, 0x94, 0xf5, 0x76, 0x5c, 0xb1, 0x62, 0x2c, 0xe1, 0x76, 0x7c, 0x86, 0x73, 0xe6, 0x7a, 0x23 } + }; switch (keylen) { case 256: result = derive_key(CALG_AES_256, &hKey, 0); + i = 2; break; case 192: result = derive_key(CALG_AES_192, &hKey, 0); + i = 1; break; default: case 128: result = derive_key(CALG_AES_128, &hKey, 0); + i = 0; break; } if (!result) return; + dwLen = sizeof(aes_plain); + memcpy(pbData, aes_plain, dwLen); + result = CryptEncrypt(hKey, 0, TRUE, 0, pbData, &dwLen, sizeof(pbData)); + ok(result, "Expected OK, got last error %d\n", GetLastError()); + ok(dwLen == 48, "Expected dwLen 48, got %d\n", dwLen); +todo_wine + ok(!memcmp(aes_cbc_enc[i], pbData, dwLen), "Expected equal data sequences\n"); + + result = CryptDecrypt(hKey, 0, TRUE, 0, pbData, &dwLen); + ok(result && dwLen == 32 && !memcmp(aes_plain, pbData, dwLen), + "%08x, dwLen: %d\n", GetLastError(), dwLen); + for (i=0; iargs[count]) @@ -1218,6 +1220,8 @@ *strW = 0; args = CommandLineToArgvW(strW, &numargs); ok(numargs == 1, "expected 1 args, got %d\n", numargs); + ok(!args || (!args[numargs] || broken(args[numargs] != NULL) /* before Vista */), + "expected NULL-terminated list of commandline arguments\n"); if (numargs == 1) { GetModuleFileNameW(NULL, strW, sizeof(strW)/sizeof(*strW)); diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/shlwapi/tests/path.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/shlwapi/tests/path.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/shlwapi/tests/path.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/shlwapi/tests/path.c 2014-07-11 19:15:41.000000000 +0000 @@ -36,6 +36,8 @@ static BOOL (WINAPI *pPathAppendA)(LPSTR, LPCSTR); static BOOL (WINAPI *pPathUnExpandEnvStringsA)(LPCSTR, LPSTR, UINT); static BOOL (WINAPI *pPathUnExpandEnvStringsW)(LPCWSTR, LPWSTR, UINT); +static BOOL (WINAPI *pPathIsRelativeA)(LPCSTR); +static BOOL (WINAPI *pPathIsRelativeW)(LPCWSTR); /* ################ */ @@ -1585,6 +1587,62 @@ ok(!lstrcmpW(buffW, pathW), "wrong unexpanded string %s, expected %s\n", wine_dbgstr_w(buffW), wine_dbgstr_w(pathW)); } +static const struct { + const char *path; + BOOL expect; +} test_path_is_relative[] = { + {NULL, TRUE}, + {"\0", TRUE}, + {"test.txt", TRUE}, + {"\\\\folder\\test.txt", FALSE}, + {"file://folder/test.txt", TRUE}, + {"C:\\test.txt", FALSE}, + {"file:///C:/test.txt", TRUE} +}; + +static void test_PathIsRelativeA(void) +{ + BOOL ret; + int i, num; + + if (!pPathIsRelativeA) { + win_skip("PathIsRelativeA not available\n"); + return; + } + + num = sizeof(test_path_is_relative) / sizeof(test_path_is_relative[0]); + for (i = 0; i < num; i++) { + ret = pPathIsRelativeA(test_path_is_relative[i].path); + ok(ret == test_path_is_relative[i].expect, + "PathIsRelativeA(\"%s\") expects %d, got %d.\n", + test_path_is_relative[i].path, test_path_is_relative[i].expect, ret); + } +} + +static void test_PathIsRelativeW(void) +{ + BOOL ret; + int i, num; + LPWSTR path; + + if (!pPathIsRelativeW) { + win_skip("PathIsRelativeA not available\n"); + return; + } + + num = sizeof(test_path_is_relative) / sizeof(test_path_is_relative[0]); + for (i = 0; i < num; i++) { + path = GetWideString(test_path_is_relative[i].path); + + ret = pPathIsRelativeW(path); + ok(ret == test_path_is_relative[i].expect, + "PathIsRelativeW(\"%s\") expects %d, got %d.\n", + test_path_is_relative[i].path, test_path_is_relative[i].expect, ret); + + FreeWideString(path); + } +} + START_TEST(path) { HMODULE hShlwapi = GetModuleHandleA("shlwapi.dll"); @@ -1604,6 +1662,8 @@ pPathAppendA = (void*)GetProcAddress(hShlwapi, "PathAppendA"); pPathUnExpandEnvStringsA = (void*)GetProcAddress(hShlwapi, "PathUnExpandEnvStringsA"); pPathUnExpandEnvStringsW = (void*)GetProcAddress(hShlwapi, "PathUnExpandEnvStringsW"); + pPathIsRelativeA = (void*)GetProcAddress(hShlwapi, "PathIsRelativeA"); + pPathIsRelativeW = (void*)GetProcAddress(hShlwapi, "PathIsRelativeW"); test_PathSearchAndQualify(); test_PathCreateFromUrl(); @@ -1626,4 +1686,6 @@ test_PathUnquoteSpaces(); test_PathGetDriveNumber(); test_PathUnExpandEnvStrings(); + test_PathIsRelativeA(); + test_PathIsRelativeW(); } diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/urlmon/mimefilter.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/urlmon/mimefilter.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/urlmon/mimefilter.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/urlmon/mimefilter.c 2014-07-11 19:15:41.000000000 +0000 @@ -280,7 +280,12 @@ && (b[1] == 'h' || b[1] == 'H') && (b[2] == 'e' || b[2] == 'E') && (b[3] == 'a' || b[3] == 'A') - && (b[4] == 'd' || b[4] == 'D'))) return TRUE; + && (b[4] == 'd' || b[4] == 'D')) + || (b[0] == '<' + && (b[1] == 'b' || b[1] == 'B') + && (b[2] == 'o' || b[2] == 'O') + && (b[3] == 'd' || b[3] == 'D') + && (b[4] == 'y' || b[4] == 'Y'))) return TRUE; return FALSE; } diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/urlmon/sec_mgr.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/urlmon/sec_mgr.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/urlmon/sec_mgr.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/urlmon/sec_mgr.c 2014-07-11 19:15:41.000000000 +0000 @@ -2077,7 +2077,7 @@ /******************************************************************** * IsInternetESCEnabledLocal (URLMON.108) * - * Undocumented, returns if IE is running in Enhanced Security Configuration. + * Undocumented, returns TRUE if IE is running in Enhanced Security Configuration. */ BOOL WINAPI IsInternetESCEnabledLocal(void) { diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/urlmon/tests/misc.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/urlmon/tests/misc.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/urlmon/tests/misc.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/urlmon/tests/misc.c 2014-07-11 19:15:41.000000000 +0000 @@ -575,6 +575,8 @@ static BYTE data94[] = {'<','h','t','m','l','>','<','?','x','m','l',' ',' '}; static BYTE data95[] = {'{','\\','r','t','f','<','?','x','m','l',' ',' '}; static BYTE data96[] = {'<','?','x','m','l',' '}; +static BYTE data97[] = " file:///c:/test%25test */ static DWORD canonicalize_path_hierarchical(const WCHAR *path, DWORD path_len, URL_SCHEME scheme_type, BOOL has_host, DWORD flags, - WCHAR *ret_path) { + BOOL is_implicit_scheme, WCHAR *ret_path) { const BOOL known_scheme = scheme_type != URL_SCHEME_UNKNOWN; const BOOL is_file = scheme_type == URL_SCHEME_FILE; const BOOL is_res = scheme_type == URL_SCHEME_RES; @@ -2904,7 +2904,7 @@ len += 3; do_default_action = FALSE; } else if((is_unreserved(val) && known_scheme) || - (is_file && (is_unreserved(val) || is_reserved(val) || + (is_file && !is_implicit_scheme && (is_unreserved(val) || is_reserved(val) || (val && flags&Uri_CREATE_FILE_USE_DOS_PATH && !is_forbidden_dos_path_char(val))))) { if(ret_path) ret_path[len] = val; @@ -2929,7 +2929,7 @@ } } else if(known_scheme && !is_res && !is_unreserved(*ptr) && !is_reserved(*ptr) && (!(flags & Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS) || is_file)) { - if(!(is_file && (flags & Uri_CREATE_FILE_USE_DOS_PATH))) { + if(!is_file || !(flags & Uri_CREATE_FILE_USE_DOS_PATH)) { /* Escape the forbidden character. */ if(ret_path) pct_encode_val(*ptr, ret_path+len); @@ -3122,7 +3122,7 @@ if(!computeOnly) uri->path_start = uri->canon_len; uri->path_len = canonicalize_path_hierarchical(data->path, data->path_len, data->scheme_type, data->host_len != 0, - flags, computeOnly ? NULL : uri->canon_uri+uri->canon_len); + flags, data->has_implicit_scheme, computeOnly ? NULL : uri->canon_uri+uri->canon_len); uri->canon_len += uri->path_len; if(!computeOnly && !uri->path_len) uri->path_start = -1; @@ -3889,8 +3889,8 @@ return S_OK; } - len_a = canonicalize_path_hierarchical(a->canon_uri+a->path_start, a->path_len, a->scheme_type, FALSE, 0, NULL); - len_b = canonicalize_path_hierarchical(b->canon_uri+b->path_start, b->path_len, b->scheme_type, FALSE, 0, NULL); + len_a = canonicalize_path_hierarchical(a->canon_uri+a->path_start, a->path_len, a->scheme_type, FALSE, 0, FALSE, NULL); + len_b = canonicalize_path_hierarchical(b->canon_uri+b->path_start, b->path_len, b->scheme_type, FALSE, 0, FALSE, NULL); canon_path_a = heap_alloc(len_a*sizeof(WCHAR)); if(!canon_path_a) @@ -3901,8 +3901,8 @@ return E_OUTOFMEMORY; } - len_a = canonicalize_path_hierarchical(a->canon_uri+a->path_start, a->path_len, a->scheme_type, FALSE, 0, canon_path_a); - len_b = canonicalize_path_hierarchical(b->canon_uri+b->path_start, b->path_len, b->scheme_type, FALSE, 0, canon_path_b); + len_a = canonicalize_path_hierarchical(a->canon_uri+a->path_start, a->path_len, a->scheme_type, FALSE, 0, FALSE, canon_path_a); + len_b = canonicalize_path_hierarchical(b->canon_uri+b->path_start, b->path_len, b->scheme_type, FALSE, 0, FALSE, canon_path_b); *ret = len_a == len_b && !memicmpW(canon_path_a, canon_path_b, len_a); diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/usp10/bidi.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/usp10/bidi.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/usp10/bidi.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/usp10/bidi.c 2014-07-11 19:15:41.000000000 +0000 @@ -44,6 +44,7 @@ #include "config.h" #include +#include #include "windef.h" #include "winbase.h" #include "wingdi.h" @@ -55,6 +56,8 @@ #include "usp10_internal.h" +extern const unsigned short bidi_bracket_table[]; + WINE_DEFAULT_DEBUG_CHANNEL(bidi); #define ASSERT(x) do { if (!(x)) FIXME("assert failed: %s\n", #x); } while(0) @@ -462,6 +465,12 @@ WORD e; } Run; +typedef struct tagRunChar +{ + WCHAR ch; + WORD *pcls; +} RunChar; + typedef struct tagIsolatedRun { struct list entry; @@ -470,14 +479,14 @@ WORD eos; WORD e; - WORD *ppcls[1]; + RunChar item[1]; } IsolatedRun; static inline int iso_nextValidChar(IsolatedRun *iso_run, int index) { if (index >= (iso_run->length-1)) return -1; index ++; - while (index < iso_run->length && *iso_run->ppcls[index] == BN) index++; + while (index < iso_run->length && *iso_run->item[index].pcls == BN) index++; if (index == iso_run->length) return -1; return index; } @@ -487,7 +496,7 @@ if (index <= 0) return -1; index --; - while (index > -1 && *iso_run->ppcls[index] == BN) index--; + while (index > -1 && *iso_run->item[index].pcls == BN) index--; return index; } @@ -503,7 +512,7 @@ TRACE("%s:",header); TRACE("[ "); for (i = 0; i < iso_run->length; i++) - TRACE(" %s",debug_type[*iso_run->ppcls[i]]); + TRACE(" %s",debug_type[*iso_run->item[i].pcls]); TRACE(" ]\n"); } @@ -530,30 +539,30 @@ /* W1 */ for (i=0; i < iso_run->length; i++) { - if (*iso_run->ppcls[i] == NSM) + if (*iso_run->item[i].pcls == NSM) { int j = iso_previousValidChar(iso_run, i); if (j == -1) - *iso_run->ppcls[i] = iso_run->sos; - else if (*iso_run->ppcls[j] >= LRI) - *iso_run->ppcls[i] = ON; + *iso_run->item[i].pcls = iso_run->sos; + else if (*iso_run->item[j].pcls >= LRI) + *iso_run->item[i].pcls = ON; else - *iso_run->ppcls[i] = *iso_run->ppcls[j]; + *iso_run->item[i].pcls = *iso_run->item[j].pcls; } } /* W2 */ for (i = 0; i < iso_run->length; i++) { - if (*iso_run->ppcls[i] == EN) + if (*iso_run->item[i].pcls == EN) { int j = iso_previousValidChar(iso_run, i); while (j > -1) { - if (*iso_run->ppcls[j] == R || *iso_run->ppcls[j] == L || *iso_run->ppcls[j] == AL) + if (*iso_run->item[j].pcls == R || *iso_run->item[j].pcls == L || *iso_run->item[j].pcls == AL) { - if (*iso_run->ppcls[j] == AL) - *iso_run->ppcls[i] = AN; + if (*iso_run->item[j].pcls == AL) + *iso_run->item[i].pcls = AN; break; } j = iso_previousValidChar(iso_run, j); @@ -564,53 +573,53 @@ /* W3 */ for (i = 0; i < iso_run->length; i++) { - if (*iso_run->ppcls[i] == AL) - *iso_run->ppcls[i] = R; + if (*iso_run->item[i].pcls == AL) + *iso_run->item[i].pcls = R; } /* W4 */ for (i = 0; i < iso_run->length; i++) { - if (*iso_run->ppcls[i] == ES) + if (*iso_run->item[i].pcls == ES) { int b = iso_previousValidChar(iso_run, i); int f = iso_nextValidChar(iso_run, i); - if (b > -1 && f > -1 && *iso_run->ppcls[b] == EN && *iso_run->ppcls[f] == EN) - *iso_run->ppcls[i] = EN; + if (b > -1 && f > -1 && *iso_run->item[b].pcls == EN && *iso_run->item[f].pcls == EN) + *iso_run->item[i].pcls = EN; } - else if (*iso_run->ppcls[i] == CS) + else if (*iso_run->item[i].pcls == CS) { int b = iso_previousValidChar(iso_run, i); int f = iso_nextValidChar(iso_run, i); - if (b > -1 && f > -1 && *iso_run->ppcls[b] == EN && *iso_run->ppcls[f] == EN) - *iso_run->ppcls[i] = EN; - else if (b > -1 && f > -1 && *iso_run->ppcls[b] == AN && *iso_run->ppcls[f] == AN) - *iso_run->ppcls[i] = AN; + if (b > -1 && f > -1 && *iso_run->item[b].pcls == EN && *iso_run->item[f].pcls == EN) + *iso_run->item[i].pcls = EN; + else if (b > -1 && f > -1 && *iso_run->item[b].pcls == AN && *iso_run->item[f].pcls == AN) + *iso_run->item[i].pcls = AN; } } /* W5 */ for (i = 0; i < iso_run->length; i++) { - if (*iso_run->ppcls[i] == ET) + if (*iso_run->item[i].pcls == ET) { int j; for (j = i-1 ; j > -1; j--) { - if (*iso_run->ppcls[j] == BN) continue; - if (*iso_run->ppcls[j] == ET) continue; - else if (*iso_run->ppcls[j] == EN) *iso_run->ppcls[i] = EN; + if (*iso_run->item[j].pcls == BN) continue; + if (*iso_run->item[j].pcls == ET) continue; + else if (*iso_run->item[j].pcls == EN) *iso_run->item[i].pcls = EN; else break; } - if (*iso_run->ppcls[i] == ET) + if (*iso_run->item[i].pcls == ET) { for (j = i+1; j < iso_run->length; j++) { - if (*iso_run->ppcls[j] == BN) continue; - if (*iso_run->ppcls[j] == ET) continue; - else if (*iso_run->ppcls[j] == EN) *iso_run->ppcls[i] = EN; + if (*iso_run->item[j].pcls == BN) continue; + if (*iso_run->item[j].pcls == ET) continue; + else if (*iso_run->item[j].pcls == EN) *iso_run->item[i].pcls = EN; else break; } } @@ -620,38 +629,118 @@ /* W6 */ for (i = 0; i < iso_run->length; i++) { - if (*iso_run->ppcls[i] == ET || *iso_run->ppcls[i] == ES || *iso_run->ppcls[i] == CS || *iso_run->ppcls[i] == ON) + if (*iso_run->item[i].pcls == ET || *iso_run->item[i].pcls == ES || *iso_run->item[i].pcls == CS || *iso_run->item[i].pcls == ON) { int b = i-1; int f = i+1; - if (b > -1 && *iso_run->ppcls[b] == BN) - *iso_run->ppcls[b] = ON; - if (f < iso_run->length && *iso_run->ppcls[f] == BN) - *iso_run->ppcls[f] = ON; + if (b > -1 && *iso_run->item[b].pcls == BN) + *iso_run->item[b].pcls = ON; + if (f < iso_run->length && *iso_run->item[f].pcls == BN) + *iso_run->item[f].pcls = ON; - *iso_run->ppcls[i] = ON; + *iso_run->item[i].pcls = ON; } } /* W7 */ for (i = 0; i < iso_run->length; i++) { - if (*iso_run->ppcls[i] == EN) + if (*iso_run->item[i].pcls == EN) { int j; for (j = iso_previousValidChar(iso_run, i); j > -1; j = iso_previousValidChar(iso_run, j)) - if (*iso_run->ppcls[j] == R || *iso_run->ppcls[j] == L) + if (*iso_run->item[j].pcls == R || *iso_run->item[j].pcls == L) { - if (*iso_run->ppcls[j] == L) - *iso_run->ppcls[i] = L; + if (*iso_run->item[j].pcls == L) + *iso_run->item[i].pcls = L; break; } if (iso_run->sos == L && j == -1) - *iso_run->ppcls[i] = L; + *iso_run->item[i].pcls = L; } } } +typedef struct tagBracketPair +{ + int start; + int end; +} BracketPair; + +static int compr(const void *a, const void* b) +{ + return ((BracketPair*)a)->start - ((BracketPair*)b)->start; +} + +static BracketPair *computeBracketPairs(IsolatedRun *iso_run) +{ + WCHAR *open_stack; + int *stack_index; + int stack_top = iso_run->length; + BracketPair *out = NULL; + int pair_count = 0; + int i; + + open_stack = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR) * iso_run->length); + stack_index = HeapAlloc(GetProcessHeap(), 0, sizeof(int) * iso_run->length); + + for (i = 0; i < iso_run->length; i++) + { + unsigned short ubv = get_table_entry(bidi_bracket_table, iso_run->item[i].ch); + if (ubv) + { + if (!out) + { + out = HeapAlloc(GetProcessHeap(),0,sizeof(BracketPair)); + out[0].start = -1; + } + + if ((ubv >> 8) == 0) + { + stack_top --; + open_stack[stack_top] = iso_run->item[i].ch + (signed char)(ubv & 0xff); + /* deal with canonical equivalent U+2329/232A and U+3008/3009 */ + if (open_stack[stack_top] == 0x232A) + open_stack[stack_top] = 0x3009; + stack_index[stack_top] = i; + } + else if ((ubv >> 8) == 1) + { + int j; + if (stack_top == iso_run->length) continue; + for (j = stack_top; j < iso_run->length; j++) + { + WCHAR c = iso_run->item[i].ch; + if (c == 0x232A) c = 0x3009; + if (c == open_stack[j]) + { + out[pair_count].start = stack_index[j]; + out[pair_count].end = i; + pair_count++; + out = HeapReAlloc(GetProcessHeap(), 0, out, sizeof(BracketPair) * (pair_count+1)); + out[pair_count].start = -1; + stack_top = j+1; + break; + } + } + } + } + } + if (pair_count == 0) + { + HeapFree(GetProcessHeap(),0,out); + out = NULL; + } + else if (pair_count > 1) + qsort(out, pair_count, sizeof(BracketPair), compr); + + HeapFree(GetProcessHeap(), 0, open_stack); + HeapFree(GetProcessHeap(), 0, stack_index); + return out; +} + +#define N0_TYPE(a) ((a == AN || a == EN)?R:a) + /*------------------------------------------------------------------------ Function: resolveNeutrals @@ -673,31 +762,87 @@ static void resolveNeutrals(IsolatedRun *iso_run) { int i; + BracketPair *pairs = NULL; /* Translate isolates into NI */ for (i = 0; i < iso_run->length; i++) { - if (*iso_run->ppcls[i] >= LRI) - *iso_run->ppcls[i] = NI; + if (*iso_run->item[i].pcls >= LRI) + *iso_run->item[i].pcls = NI; - switch(*iso_run->ppcls[i]) + switch(*iso_run->item[i].pcls) { case B: case S: - case WS: *iso_run->ppcls[i] = NI; + case WS: *iso_run->item[i].pcls = NI; } - ASSERT(*iso_run->ppcls[i] < 5 || *iso_run->ppcls[i] == BN); /* "Only NI, L, R, AN, EN and BN are allowed" */ + ASSERT(*iso_run->item[i].pcls < 5 || *iso_run->item[i].pcls == BN); /* "Only NI, L, R, AN, EN and BN are allowed" */ } /* N0: Skipping bracketed pairs for now */ + pairs = computeBracketPairs(iso_run); + if (pairs) + { + BracketPair *p = &pairs[0]; + int i = 0; + while (p->start >= 0) + { + int j; + int e = EmbeddingDirection(iso_run->e); + int o = EmbeddingDirection(iso_run->e+1); + BOOL flag_o = FALSE; + TRACE("Bracket Pair [%i - %i]\n",p->start, p->end); + + /* N0.b */ + for (j = p->start+1; j < p->end; j++) + { + if (N0_TYPE(*iso_run->item[j].pcls) == e) + { + *iso_run->item[p->start].pcls = e; + *iso_run->item[p->end].pcls = e; + break; + } + else if (N0_TYPE(*iso_run->item[j].pcls) == o) + flag_o = TRUE; + } + /* N0.c */ + if (j == p->end && flag_o) + { + for (j = p->start; j >= 0; j--) + { + if (N0_TYPE(*iso_run->item[j].pcls) == o) + { + *iso_run->item[p->start].pcls = o; + *iso_run->item[p->end].pcls = o; + break; + } + else if (N0_TYPE(*iso_run->item[j].pcls) == e) + { + *iso_run->item[p->start].pcls = e; + *iso_run->item[p->end].pcls = e; + break; + } + } + if ( j < 0 ) + { + *iso_run->item[p->start].pcls = iso_run->sos; + *iso_run->item[p->end].pcls = iso_run->sos; + } + } + + i++; + p = &pairs[i]; + } + HeapFree(GetProcessHeap(),0,pairs); + } /* N1 */ for (i = 0; i < iso_run->length; i++) { WORD l,r; - if (*iso_run->ppcls[i] == NI) + if (*iso_run->item[i].pcls == NI) { int j; int b = iso_previousValidChar(iso_run, i); @@ -709,24 +854,24 @@ } else { - if (*iso_run->ppcls[b] == R || *iso_run->ppcls[b] == AN || *iso_run->ppcls[b] == EN) + if (*iso_run->item[b].pcls == R || *iso_run->item[b].pcls == AN || *iso_run->item[b].pcls == EN) l = R; - else if (*iso_run->ppcls[b] == L) + else if (*iso_run->item[b].pcls == L) l = L; else /* No string type */ continue; } j = iso_nextValidChar(iso_run, i); - while (j > -1 && *iso_run->ppcls[j] == NI) j = iso_nextValidChar(iso_run, j); + while (j > -1 && *iso_run->item[j].pcls == NI) j = iso_nextValidChar(iso_run, j); if (j == -1) { r = iso_run->eos; j = iso_run->length; } - else if (*iso_run->ppcls[j] == R || *iso_run->ppcls[j] == AN || *iso_run->ppcls[j] == EN) + else if (*iso_run->item[j].pcls == R || *iso_run->item[j].pcls == AN || *iso_run->item[j].pcls == EN) r = R; - else if (*iso_run->ppcls[j] == L) + else if (*iso_run->item[j].pcls == L) r = L; else /* No string type */ continue; @@ -734,7 +879,7 @@ if (r == l) { for (b = i; b < j && b < iso_run->length; b++) - *iso_run->ppcls[b] = r; + *iso_run->item[b].pcls = r; } } } @@ -742,15 +887,15 @@ /* N2 */ for (i = 0; i < iso_run->length; i++) { - if (*iso_run->ppcls[i] == NI) + if (*iso_run->item[i].pcls == NI) { int b = i-1; int f = i+1; - *iso_run->ppcls[i] = EmbeddingDirection(iso_run->e); - if (b > -1 && *iso_run->ppcls[b] == BN) - *iso_run->ppcls[b] = EmbeddingDirection(iso_run->e); - if (f < iso_run->length && *iso_run->ppcls[f] == BN) - *iso_run->ppcls[f] = EmbeddingDirection(iso_run->e); + *iso_run->item[i].pcls = EmbeddingDirection(iso_run->e); + if (b > -1 && *iso_run->item[b].pcls == BN) + *iso_run->item[b].pcls = EmbeddingDirection(iso_run->e); + if (f < iso_run->length && *iso_run->item[f].pcls == BN) + *iso_run->item[f].pcls = EmbeddingDirection(iso_run->e); } } } @@ -824,7 +969,7 @@ } } -static void computeIsolatingRunsSet(unsigned baselevel, WORD *pcls, WORD *pLevel, int uCount, struct list *set) +static void computeIsolatingRunsSet(unsigned baselevel, WORD *pcls, WORD *pLevel, LPCWSTR lpString, int uCount, struct list *set) { int run_start, run_end, i; int run_count = 0; @@ -859,7 +1004,7 @@ { int type_fence, real_end; int j; - current_isolated = HeapAlloc(GetProcessHeap(), 0, sizeof(IsolatedRun) + sizeof(WORD*)*uCount); + current_isolated = HeapAlloc(GetProcessHeap(), 0, sizeof(IsolatedRun) + sizeof(RunChar)*uCount); if (!current_isolated) break; run_start = runs[k].start; @@ -867,7 +1012,10 @@ current_isolated->length = (runs[k].end - runs[k].start)+1; for (j = 0; j < current_isolated->length; j++) - current_isolated->ppcls[j] = &pcls[runs[k].start+j]; + { + current_isolated->item[j].pcls = &pcls[runs[k].start+j]; + current_isolated->item[j].ch = lpString[runs[k].start+j]; + } run_end = runs[k].end; @@ -894,7 +1042,10 @@ current_isolated->length += (runs[j].end - runs[j].start)+1; for (m = 0; l < current_isolated->length; l++, m++) - current_isolated->ppcls[l] = &pcls[runs[j].start+m]; + { + current_isolated->item[l].pcls = &pcls[runs[j].start+m]; + current_isolated->item[l].ch = lpString[runs[j].start+m]; + } TRACE("[%i -- %i]",runs[j].start, runs[j].end); @@ -987,7 +1138,7 @@ if (TRACE_ON(bidi)) dump_types("After Explicit", chartype, 0, uCount); /* X10/BD13: Computer Isolating runs */ - computeIsolatingRunsSet(baselevel, chartype, lpOutLevels, uCount, &IsolatingRuns); + computeIsolatingRunsSet(baselevel, chartype, lpOutLevels, lpString, uCount, &IsolatingRuns); LIST_FOR_EACH_ENTRY_SAFE(iso_run, next, &IsolatingRuns, IsolatedRun, entry) { diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/usp10/bracket.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/usp10/bracket.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/usp10/bracket.c 1970-01-01 00:00:00.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/usp10/bracket.c 2014-07-11 19:15:41.000000000 +0000 @@ -0,0 +1,106 @@ +/* Unicode Bidirectional Bracket table */ +/* generated from http://www.unicode.org/Public/7.0.0/ucd/BidiBrackets.txt */ +/* DO NOT EDIT!! */ + +const unsigned short bidi_bracket_table[768] = +{ + /* level 1 offsets */ + 0x0100, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, + 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0120, + 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0130, 0x0110, + 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, + 0x0140, 0x0110, 0x0110, 0x0150, 0x0110, 0x0110, 0x0110, 0x0160, + 0x0110, 0x0170, 0x0110, 0x0110, 0x0110, 0x0110, 0x0180, 0x0110, + 0x0190, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, + 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, + 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, + 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, + 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, + 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, + 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, + 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, + 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, + 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, + 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, + 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, + 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, + 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, + 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, + 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, + 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, + 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, + 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, + 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, + 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, + 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, + 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, + 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, + 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, + 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x0110, 0x01a0, 0x01b0, + /* level 2 offsets */ + 0x01c0, 0x01c0, 0x01d0, 0x01c0, 0x01c0, 0x01e0, 0x01c0, 0x01e0, + 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, + 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, + 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, + 0x01c0, 0x01c0, 0x01c0, 0x01f0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, + 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, + 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, + 0x01c0, 0x0200, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, + 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x0210, 0x01c0, 0x01c0, 0x0220, + 0x0220, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, + 0x0230, 0x01c0, 0x0240, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, + 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, + 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x0250, 0x0260, + 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x0210, 0x01c0, 0x0270, 0x01c0, + 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, + 0x0280, 0x0290, 0x01c0, 0x01c0, 0x01c0, 0x0230, 0x01c0, 0x02a0, + 0x01c0, 0x01c0, 0x02b0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, + 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, + 0x0250, 0x02c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, + 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, + 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x02d0, 0x01c0, 0x01c0, + 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, + 0x01d0, 0x01c0, 0x01c0, 0x01e0, 0x01c0, 0x02e0, 0x02f0, 0x01c0, + 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, 0x01c0, + /* values */ + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0001, 0x01fe, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0002, 0x0000, 0x01fd, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0001, 0x01fe, 0x0001, 0x01fe, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0001, 0x01fe, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x01fe, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x01fe, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0001, 0x01fe, 0x0001, 0x01fe, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0001, 0x01fe, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0001, 0x01fe, 0x0001, 0x01fe, 0x0001, 0x01fe, 0x0001, 0x01fe, + 0x0001, 0x01fe, 0x0001, 0x01fe, 0x0001, 0x01fe, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x01fe, + 0x0001, 0x01fe, 0x0001, 0x01fe, 0x0001, 0x01fe, 0x0001, 0x01fe, + 0x0000, 0x0000, 0x0000, 0x0001, 0x01fe, 0x0001, 0x01fe, 0x0001, + 0x01fe, 0x0001, 0x01fe, 0x0001, 0x01fe, 0x0003, 0x0101, 0x00fe, + 0x01fc, 0x0001, 0x01fe, 0x0001, 0x01fe, 0x0001, 0x01fe, 0x0001, + 0x01fe, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x01fe, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0001, 0x01fe, 0x0001, 0x01fe, 0x0001, 0x01fe, + 0x0001, 0x01fe, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0001, 0x01fe, 0x0000, 0x0000, 0x0001, 0x01fe, 0x0001, 0x01fe, + 0x0001, 0x01fe, 0x0001, 0x01fe, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0001, 0x01fe, 0x0001, 0x01fe, 0x0001, 0x01fe, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0002, 0x0000, 0x01fd, 0x0000, 0x0001, + 0x01fe, 0x0000, 0x0001, 0x01fe, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000 +}; diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/usp10/indicsyllable.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/usp10/indicsyllable.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/usp10/indicsyllable.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/usp10/indicsyllable.c 2014-07-11 19:15:41.000000000 +0000 @@ -3,8 +3,6 @@ /* and from http://www.unicode.org/Public/7.0.0/ucd/IndicMatraCategory.txt */ /* DO NOT EDIT!! */ -#include "wine/unicode.h" - const unsigned short indic_syllabic_table[2864] = { /* level 1 offsets */ diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/usp10/linebreak.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/usp10/linebreak.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/usp10/linebreak.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/usp10/linebreak.c 2014-07-11 19:15:41.000000000 +0000 @@ -2,8 +2,6 @@ /* generated from http://www.unicode.org/Public/7.0.0/ucd/LineBreak.txt */ /* DO NOT EDIT!! */ -#include "wine/unicode.h" - const unsigned short wine_linebreak_table[7232] = { /* level 1 offsets */ diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/usp10/Makefile.in wine-compholio-1.7.22~ubuntu13.10.1/dlls/usp10/Makefile.in --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/usp10/Makefile.in 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/usp10/Makefile.in 2014-07-11 19:15:41.000000000 +0000 @@ -4,6 +4,7 @@ C_SRCS = \ bidi.c \ + bracket.c \ breaking.c \ indic.c \ indicsyllable.c \ diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/usp10/shaping.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/usp10/shaping.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/usp10/shaping.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/usp10/shaping.c 2014-07-11 19:15:41.000000000 +0000 @@ -2,8 +2,6 @@ /* generated from http://www.unicode.org/Public/7.0.0/ucd/ArabicShaping.txt */ /* DO NOT EDIT!! */ -#include "wine/unicode.h" - const unsigned short wine_shaping_table[2864] = { /* level 1 offsets */ diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/vbscript/global.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/vbscript/global.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/vbscript/global.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/vbscript/global.c 2014-07-11 19:15:41.000000000 +0000 @@ -182,35 +182,15 @@ static HRESULT to_double(VARIANT *v, double *ret) { - switch(V_VT(v)) { - case VT_I2: - *ret = V_I2(v); - break; - case VT_I4: - *ret = V_I4(v); - break; - case VT_R4: - *ret = V_R4(v); - break; - case VT_R8: - *ret = V_R8(v); - break; - case VT_BSTR: { - VARIANT dst; - HRESULT hres; + VARIANT dst; + HRESULT hres; - V_VT(&dst) = VT_EMPTY; - hres = VariantChangeType(&dst, v, VARIANT_LOCALBOOL, VT_R8); - if(FAILED(hres)) - return hres; - *ret = V_R8(&dst); - break; - } - default: - FIXME("arg %s not supported\n", debugstr_variant(v)); - return E_NOTIMPL; - } + V_VT(&dst) = VT_EMPTY; + hres = VariantChangeType(&dst, v, 0, VT_R8); + if(FAILED(hres)) + return hres; + *ret = V_R8(&dst); return S_OK; } @@ -602,8 +582,16 @@ static HRESULT Global_VarType(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; + TRACE("(%s)\n", debugstr_variant(arg)); + + assert(args_cnt == 1); + + if(V_VT(arg) & ~VT_TYPEMASK) { + FIXME("not supported %s\n", debugstr_variant(arg)); + return E_NOTIMPL; + } + + return return_short(res, V_VT(arg)); } static HRESULT Global_IsDate(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) @@ -1276,8 +1264,23 @@ static HRESULT Global_Sgn(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) { - FIXME("\n"); - return E_NOTIMPL; + double v; + short val; + HRESULT hres; + + TRACE("(%s)\n", debugstr_variant(arg)); + + assert(args_cnt == 1); + + if(V_VT(arg) == VT_NULL) + return MAKE_VBSERROR(VBSE_ILLEGAL_NULL_USE); + + hres = to_double(arg, &v); + if (FAILED(hres)) + return hres; + + val = v == 0 ? 0 : (v > 0 ? 1 : -1); + return return_short(res, val); } static HRESULT Global_Now(vbdisp_t *This, VARIANT *arg, unsigned args_cnt, VARIANT *res) diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/vbscript/tests/api.vbs wine-compholio-1.7.22~ubuntu13.10.1/dlls/vbscript/tests/api.vbs --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/vbscript/tests/api.vbs 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/vbscript/tests/api.vbs 2014-07-11 19:15:41.000000000 +0000 @@ -857,4 +857,56 @@ Call ok(TypeName(MyEmpty) = "Empty", "TypeName(MyEmpty) = " & TypeName(Empty)) Call ok(TypeName(Null) = "Null", "TypeName(Null) = " & TypeName(Null)) +Call ok(VarType(Empty) = vbEmpty, "VarType(Empty) = " & VarType(Empty)) +Call ok(getVT(VarType(Empty)) = "VT_I2", "getVT(VarType(Empty)) = " & getVT(VarType(Empty))) +Call ok(VarType(Null) = vbNull, "VarType(Null) = " & VarType(Null)) +Call ok(getVT(VarType(Null)) = "VT_I2", "getVT(VarType(Null)) = " & getVT(VarType(Null))) +Call ok(VarType(255) = vbInteger, "VarType(255) = " & VarType(255)) +Call ok(getVT(VarType(255)) = "VT_I2", "getVT(VarType(255)) = " & getVT(VarType(255))) +Call ok(VarType(32768) = vbLong, "VarType(32768) = " & VarType(32768)) +Call ok(getVT(VarType(32768)) = "VT_I2", "getVT(VarType(32768)) = " & getVT(VarType(32768))) +Call ok(VarType(CSng(0.5)) = vbSingle, "VarType(CSng(0.5)) = " & VarType(CSng(0.5))) +Call ok(getVT(VarType(CSng(0.5))) = "VT_I2", "getVT(VarType(CSng(0.5))) = " & getVT(VarType(CSng(0.5)))) +Call ok(VarType(-0.5) = vbDouble, "VarType(-0.5) = " & VarType(-0.5)) +Call ok(getVT(VarType(-0.5)) = "VT_I2", "getVT(VarType(-0.5)) = " & getVT(VarType(-0.5))) +Call ok(VarType(CCur(0.5)) = vbCurrency, "VarType(CCur(0.5)) = " & VarType(CCur(0.5))) +Call ok(getVT(VarType(CCur(0.5))) = "VT_I2", "getVT(VarType(CCur(0.5))) = " & getVT(VarType(CCur(0.5)))) +Call ok(VarType(CStr(0.5)) = vbString, "VarType(CStr(0.5)) = " & VarType(CStr(0.5))) +Call ok(getVT(VarType(CStr(0.5))) = "VT_I2", "getVT(VarType(CStr(0.5))) = " & getVT(VarType(CStr(0.5)))) +Call ok(VarType(CBool(0.5)) = vbBoolean, "VarType(CBool(0.5)) = " & VarType(CBool(0.5))) +Call ok(getVT(VarType(CBool(0.5))) = "VT_I2", "getVT(VarType(CBool(0.5))) = " & getVT(VarType(CBool(0.5)))) +Call ok(VarType(CByte(255)) = vbByte, "VarType(CByte(255)) = " & VarType(CByte(255))) +Call ok(getVT(VarType(CByte(255))) = "VT_I2", "getVT(VarType(CByte(255))) = " & getVT(VarType(CByte(255)))) + +Call ok(Sgn(Empty) = 0, "Sgn(MyEmpty) = " & Sgn(Empty)) +Call ok(getVT(Sgn(Empty)) = "VT_I2", "getVT(Sgn(MyEmpty)) = " & getVT(Sgn(Empty))) +Call ok(Sgn(0) = 0, "Sgn(0) = " & Sgn(0)) +Call ok(getVT(Sgn(0)) = "VT_I2", "getVT(Sgn(0)) = " & getVT(Sgn(0))) +Call ok(Sgn(-32769) = -1, "Sgn(-32769) = " & Sgn(-32769)) +Call ok(getVT(Sgn(-32769)) = "VT_I2", "getVT(Sgn(-32769)) = " & getVT(Sgn(-32769))) +Call ok(Sgn(CSng(-0.5)) = -1, "Sgn(CSng(-0.5)) = " & Sgn(CSng(-0.5))) +Call ok(getVT(Sgn(CSng(-0.5))) = "VT_I2", "getVT(Sgn(CSng(-0.5))) = " & getVT(Sgn(CSng(-0.5)))) +Call ok(Sgn(0.5) = 1, "Sgn(0.5) = " & Sgn(0.5)) +Call ok(getVT(Sgn(0.5)) = "VT_I2", "getVT(Sgn(0.5)) = " & getVT(Sgn(0.5))) +Call ok(Sgn(CCur(-1)) = -1, "Sgn(CCur(-1)) = " & Sgn(CCur(-1))) +Call ok(getVT(Sgn(CCur(-1))) = "VT_I2", "getVT(Sgn(CCur(-1))) = " & getVT(Sgn(CCur(-1)))) +Call ok(Sgn(CStr(-1)) = -1, "Sgn(CStr(-1)) = " & Sgn(CStr(-1))) +Call ok(getVT(Sgn(CStr(-1))) = "VT_I2", "getVT(Sgn(CStr(-1))) = " & getVT(Sgn(CStr(-1)))) +Call ok(Sgn(False) = 0, "Sgn(False) = " & Sgn(False)) +Call ok(getVT(Sgn(False)) = "VT_I2", "getVT(Sgn(False)) = " & getVT(Sgn(False))) +Call ok(Sgn(True) = -1, "Sgn(True) = " & Sgn(True)) +Call ok(getVT(Sgn(True)) = "VT_I2", "getVT(Sgn(True)) = " & getVT(Sgn(True))) +Call ok(Sgn(CByte(1)) = 1, "Sgn(CByte(1)) = " & Sgn(CByte(1))) +Call ok(getVT(Sgn(CByte(1))) ="VT_I2", "getVT(Sgn(CByte(1))) = " & getVT(Sgn(CByte(1)))) + +Sub testSgnError(strings, error_num) + on error resume next + + Call Err.clear() + Call Sgn(strings) + Call ok(Err.number = error_num, "Err.number = " & Err.number) +End Sub + +Call testSgnError(Null, 94) + Call reportSuccess() diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/vbscript/vbscript.h wine-compholio-1.7.22~ubuntu13.10.1/dlls/vbscript/vbscript.h --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/vbscript/vbscript.h 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/vbscript/vbscript.h 2014-07-11 19:15:41.000000000 +0000 @@ -406,6 +406,7 @@ #define VBSE_PERMISSION_DENIED 70 #define VBSE_PATH_FILE_ACCESS 75 #define VBSE_PATH_NOT_FOUND 76 +#define VBSE_ILLEGAL_NULL_USE 94 #define VBSE_OLE_NOT_SUPPORTED 430 #define VBSE_OLE_NO_PROP_OR_METHOD 438 #define VBSE_ACTION_NOT_SUPPORTED 445 diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/windowscodecs/pngformat.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/windowscodecs/pngformat.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/windowscodecs/pngformat.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/windowscodecs/pngformat.c 2014-07-11 19:15:41.000000000 +0000 @@ -1138,7 +1138,7 @@ return hr; } else - memset(opt_values, sizeof(opt_values), 0); + memset(opt_values, 0, sizeof(opt_values)); if (V_VT(&opt_values[0]) == VT_EMPTY) interlace = FALSE; diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/winealsa.drv/mmdevdrv.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/winealsa.drv/mmdevdrv.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/winealsa.drv/mmdevdrv.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/winealsa.drv/mmdevdrv.c 2014-07-11 19:15:41.000000000 +0000 @@ -889,9 +889,21 @@ { ACImpl *This = impl_from_IAudioClient(iface); ULONG ref; + ref = InterlockedDecrement(&This->ref); TRACE("(%p) Refcount now %u\n", This, ref); if(!ref){ + if(This->timer){ + HANDLE event; + DWORD wait; + event = CreateEventW(NULL, TRUE, FALSE, NULL); + wait = !DeleteTimerQueueTimer(g_timer_q, This->timer, event); + wait = wait && GetLastError() == ERROR_IO_PENDING; + if(event && wait) + WaitForSingleObject(event, INFINITE); + CloseHandle(event); + } + IAudioClient_Stop(iface); IMMDevice_Release(This->parent); IUnknown_Release(This->pUnkFTMarshal); @@ -2191,11 +2203,13 @@ This->bufsize_frames); } - if(!CreateTimerQueueTimer(&This->timer, g_timer_q, alsa_push_buffer_data, - This, 0, This->mmdev_period_rt / 10000, WT_EXECUTEINTIMERTHREAD)){ - LeaveCriticalSection(&This->lock); - WARN("Unable to create timer: %u\n", GetLastError()); - return E_OUTOFMEMORY; + if(!This->timer){ + if(!CreateTimerQueueTimer(&This->timer, g_timer_q, alsa_push_buffer_data, + This, 0, This->mmdev_period_rt / 10000, WT_EXECUTEINTIMERTHREAD)){ + LeaveCriticalSection(&This->lock); + WARN("Unable to create timer: %u\n", GetLastError()); + return E_OUTOFMEMORY; + } } This->started = TRUE; @@ -2208,8 +2222,6 @@ static HRESULT WINAPI AudioClient_Stop(IAudioClient *iface) { ACImpl *This = impl_from_IAudioClient(iface); - HANDLE event; - BOOL wait; TRACE("(%p)\n", This); @@ -2225,24 +2237,10 @@ return S_FALSE; } - /* Stop without losing written frames or position. - * snd_pcm_pause would be appropriate but is unsupported by dmix. - * snd_pcm_drain yields EAGAIN in NONBLOCK mode, except with Pulse. */ - - event = CreateEventW(NULL, TRUE, FALSE, NULL); - wait = !DeleteTimerQueueTimer(g_timer_q, This->timer, event); - if(wait) - WARN("DeleteTimerQueueTimer error %u\n", GetLastError()); - wait = wait && GetLastError() == ERROR_IO_PENDING; - This->started = FALSE; LeaveCriticalSection(&This->lock); - if(event && wait) - WaitForSingleObject(event, INFINITE); - CloseHandle(event); - return S_OK; } diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/winecoreaudio.drv/mmdevdrv.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/winecoreaudio.drv/mmdevdrv.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/winecoreaudio.drv/mmdevdrv.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/winecoreaudio.drv/mmdevdrv.c 2014-07-11 19:15:41.000000000 +0000 @@ -20,8 +20,37 @@ #define COBJMACROS #include "config.h" +#define LoadResource __carbon_LoadResource +#define CompareString __carbon_CompareString +#define GetCurrentThread __carbon_GetCurrentThread +#define GetCurrentProcess __carbon_GetCurrentProcess + #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#undef LoadResource +#undef CompareString +#undef GetCurrentThread +#undef GetCurrentProcess +#undef _CDECL +#undef DPRINTF + #include "windef.h" #include "winbase.h" #include "winnls.h" @@ -41,41 +70,34 @@ #include "audioclient.h" #include "audiopolicy.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +WINE_DEFAULT_DEBUG_CHANNEL(coreaudio); -#include -#include -#include -#include +#ifndef HAVE_AUDIOUNIT_AUDIOCOMPONENT_H +/* Define new AudioComponent Manager functions for OSX 10.5 */ +typedef Component AudioComponent; +typedef ComponentDescription AudioComponentDescription; +typedef ComponentInstance AudioComponentInstance; -WINE_DEFAULT_DEBUG_CHANNEL(coreaudio); +static inline AudioComponent AudioComponentFindNext(AudioComponent ac, AudioComponentDescription *desc) +{ + return FindNextComponent(ac, desc); +} -#define NULL_PTR_ERR MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, RPC_X_NULL_REF_POINTER) +static inline OSStatus AudioComponentInstanceNew(AudioComponent ac, AudioComponentInstance *aci) +{ + return OpenAComponent(ac, aci); +} -static const REFERENCE_TIME DefaultPeriod = 200000; -static const REFERENCE_TIME MinimumPeriod = 100000; +static inline OSStatus AudioComponentInstanceDispose(AudioComponentInstance aci) +{ + return CloseComponent(aci); +} +#endif -typedef struct _QueuedBufInfo { - Float64 start_sampletime; - UINT64 start_pos; - UINT32 len_frames; - struct list entry; -} QueuedBufInfo; +#define NULL_PTR_ERR MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, RPC_X_NULL_REF_POINTER) -typedef struct _AQBuffer { - AudioQueueBufferRef buf; - struct list entry; - BOOL used; -} AQBuffer; +static const REFERENCE_TIME DefaultPeriod = 100000; +static const REFERENCE_TIME MinimumPeriod = 50000; struct ACImpl; typedef struct ACImpl ACImpl; @@ -128,37 +150,29 @@ HANDLE event; float *vols; + BOOL initted; AudioDeviceID adevid; - AudioQueueRef aqueue; AudioObjectPropertyScope scope; + AudioConverterRef converter; + AudioComponentInstance unit; + AudioStreamBasicDescription dev_desc; /* audio unit format, not necessarily the same as fmt */ HANDLE timer; - UINT32 period_ms, bufsize_frames, inbuf_frames, read_offs_bytes, period_frames; - UINT64 last_time, written_frames; - AudioQueueBufferRef public_buffer; - UINT32 getbuf_last; - int playing; - BYTE *tmp_buffer, *capture_buf; - - Float64 highest_sampletime, next_sampletime; + UINT32 period_ms, bufsize_frames, period_frames; + UINT64 written_frames; + UINT32 lcl_offs_frames, wri_offs_frames, held_frames, tmp_buffer_frames; + UINT32 cap_bufsize_frames, cap_offs_frames, cap_held_frames, wrap_bufsize_frames, resamp_bufsize_frames; + INT32 getbuf_last; + BOOL playing; + BYTE *cap_buffer, *wrap_buffer, *resamp_buffer, *local_buffer, *tmp_buffer; AudioSession *session; AudioSessionWrapper *session_wrapper; struct list entry; - struct list avail_buffers; - struct list queued_buffers; /* either in avail, queued or public_buffer */ - struct list queued_bufinfos; - OSSpinLock lock; }; -enum PlayingStates { - StateStopped = 0, - StatePlaying, - StateInTransition -}; - static const IAudioClientVtbl AudioClient_Vtbl; static const IAudioRenderClientVtbl AudioRenderClient_Vtbl; static const IAudioCaptureClientVtbl AudioCaptureClient_Vtbl; @@ -593,6 +607,62 @@ return FALSE; } +static AudioComponentInstance get_audiounit(EDataFlow dataflow, AudioDeviceID adevid) +{ + AudioComponentInstance unit; + AudioComponent comp; + AudioComponentDescription desc; + OSStatus sc; + + memset(&desc, 0, sizeof(desc)); + desc.componentType = kAudioUnitType_Output; + desc.componentSubType = kAudioUnitSubType_HALOutput; + desc.componentManufacturer = kAudioUnitManufacturer_Apple; + + if(!(comp = AudioComponentFindNext(NULL, &desc))){ + WARN("AudioComponentFindNext failed\n"); + return NULL; + } + + sc = AudioComponentInstanceNew(comp, &unit); + if(sc != noErr){ + WARN("AudioComponentInstanceNew failed: %lx\n", sc); + return NULL; + } + + if(dataflow == eCapture){ + UInt32 enableio; + + enableio = 1; + sc = AudioUnitSetProperty(unit, kAudioOutputUnitProperty_EnableIO, + kAudioUnitScope_Input, 1, &enableio, sizeof(enableio)); + if(sc != noErr){ + WARN("Couldn't enable I/O on input element: %lx\n", sc); + AudioComponentInstanceDispose(unit); + return NULL; + } + + enableio = 0; + sc = AudioUnitSetProperty(unit, kAudioOutputUnitProperty_EnableIO, + kAudioUnitScope_Output, 0, &enableio, sizeof(enableio)); + if(sc != noErr){ + WARN("Couldn't disable I/O on output element: %lx\n", sc); + AudioComponentInstanceDispose(unit); + return NULL; + } + } + + sc = AudioUnitSetProperty(unit, kAudioOutputUnitProperty_CurrentDevice, + kAudioUnitScope_Global, 0, &adevid, sizeof(adevid)); + if(sc != noErr){ + WARN("Couldn't set audio unit device\n"); + AudioComponentInstanceDispose(unit); + return NULL; + } + + return unit; +} + HRESULT WINAPI AUDDRV_GetAudioEndpoint(GUID *guid, IMMDevice *dev, IAudioClient **out) { ACImpl *This; @@ -639,156 +709,19 @@ This->parent = dev; IMMDevice_AddRef(This->parent); - list_init(&This->avail_buffers); - list_init(&This->queued_buffers); - list_init(&This->queued_bufinfos); - This->adevid = adevid; + if(!(This->unit = get_audiounit(This->dataflow, This->adevid))){ + HeapFree(GetProcessHeap(), 0, This); + return AUDCLNT_E_DEVICE_INVALIDATED; + } + *out = &This->IAudioClient_iface; IAudioClient_AddRef(&This->IAudioClient_iface); return S_OK; } -/* current position from start of stream */ -#define BUFPOS_ABSOLUTE 1 -/* current position from start of this buffer */ -#define BUFPOS_RELATIVE 2 - -static UINT64 get_current_aqbuffer_position(ACImpl *This, int mode) -{ - struct list *head; - QueuedBufInfo *bufinfo; - UINT64 ret; - - head = list_head(&This->queued_bufinfos); - if(!head){ - TRACE("No buffers queued\n"); - if(mode == BUFPOS_ABSOLUTE) - return This->written_frames; - return 0; - } - bufinfo = LIST_ENTRY(head, QueuedBufInfo, entry); - - if(This->playing == StatePlaying){ - AudioTimeStamp tstamp; - OSStatus sc; - - /* AudioQueueGetCurrentTime() is brain damaged. The returned - * mSampleTime member jumps backwards seemingly at random, so - * we record the highest sampletime and use that during these - * anomalies. - * - * It also behaves poorly when the queue is paused, jumping - * forwards during the pause and backwards again after resuming. - * So we record the sampletime when the queue is paused and use - * that. */ - sc = AudioQueueGetCurrentTime(This->aqueue, NULL, &tstamp, NULL); - if(sc != noErr){ - if(sc != kAudioQueueErr_InvalidRunState) - WARN("Unable to get current time: %lx\n", sc); - if(mode == BUFPOS_ABSOLUTE) - return This->highest_sampletime; - return 0; - } - - if(!(tstamp.mFlags & kAudioTimeStampSampleTimeValid)){ - FIXME("SampleTime not valid: %lx\n", tstamp.mFlags); - return 0; - } - - if(tstamp.mSampleTime > This->highest_sampletime) - This->highest_sampletime = tstamp.mSampleTime; - } - - while(This->highest_sampletime > bufinfo->start_sampletime + bufinfo->len_frames){ - This->inbuf_frames -= bufinfo->len_frames; - list_remove(&bufinfo->entry); - HeapFree(GetProcessHeap(), 0, bufinfo); - - head = list_head(&This->queued_bufinfos); - if(!head){ - TRACE("No buffers queued\n"); - if(mode == BUFPOS_ABSOLUTE) - return This->written_frames; - return 0; - } - bufinfo = LIST_ENTRY(head, QueuedBufInfo, entry); - } - - if(This->highest_sampletime < bufinfo->start_sampletime) - ret = 0; - else - ret = This->highest_sampletime - bufinfo->start_sampletime; - - if(mode == BUFPOS_ABSOLUTE){ - ret = This->written_frames - (bufinfo->len_frames - ret); - while((head = list_next(&This->queued_bufinfos, &bufinfo->entry))){ - bufinfo = LIST_ENTRY(head, QueuedBufInfo, entry); - ret -= bufinfo->len_frames; - } - } - - TRACE("%llu frames (%s)\n", ret, - mode == BUFPOS_ABSOLUTE ? "absolute" : "relative"); - - return ret; -} - -static void avail_update(ACImpl *This) -{ - AQBuffer *buf, *next; - OSStatus sc; - - if(This->dataflow == eCapture){ - DWORD bufsize_bytes = This->bufsize_frames * This->fmt->nBlockAlign; - DWORD inbuf_bytes = This->inbuf_frames * This->fmt->nBlockAlign; - - LIST_FOR_EACH_ENTRY_SAFE(buf, next, &This->queued_buffers, AQBuffer, entry){ - DWORD buffer_bytes = buf->buf->mAudioDataByteSize, to_copy_bytes; - - if(buf->used) - break; - - to_copy_bytes = bufsize_bytes - (This->read_offs_bytes + inbuf_bytes) % bufsize_bytes; - - if(buffer_bytes <= to_copy_bytes){ - memcpy(This->capture_buf + (This->read_offs_bytes + inbuf_bytes) % bufsize_bytes, - buf->buf->mAudioData, buffer_bytes); - }else{ - memcpy(This->capture_buf + (This->read_offs_bytes + inbuf_bytes) % bufsize_bytes, - buf->buf->mAudioData, to_copy_bytes); - memcpy(This->capture_buf, ((char *)buf->buf->mAudioData) + to_copy_bytes, - buffer_bytes - to_copy_bytes); - } - - if(inbuf_bytes + buffer_bytes > bufsize_bytes){ - This->read_offs_bytes += inbuf_bytes + buffer_bytes; - This->read_offs_bytes %= bufsize_bytes; - inbuf_bytes = bufsize_bytes; - }else - inbuf_bytes += buffer_bytes; - - buf->used = TRUE; - list_remove(&buf->entry); - list_add_tail(&This->queued_buffers, &buf->entry); - sc = AudioQueueEnqueueBuffer(This->aqueue, buf->buf, 0, NULL); - if(sc != noErr) - WARN("EnqueueBuffer gave: %lx\n", sc); - } - - This->inbuf_frames = inbuf_bytes / This->fmt->nBlockAlign; - }else{ - LIST_FOR_EACH_ENTRY_SAFE(buf, next, &This->queued_buffers, AQBuffer, entry){ - if(buf->used) - break; - list_remove(&buf->entry); - list_add_tail(&This->avail_buffers, &buf->entry); - } - } -} - static HRESULT WINAPI AudioClient_QueryInterface(IAudioClient *iface, REFIID riid, void **ppv) { @@ -827,31 +760,20 @@ ref = InterlockedDecrement(&This->ref); TRACE("(%p) Refcount now %u\n", This, ref); if(!ref){ - if(This->aqueue){ - AQBuffer *buf, *next; - QueuedBufInfo *bufinfo, *bufinfo2; - - if(This->public_buffer){ - buf = This->public_buffer->mUserData; - list_add_tail(&This->avail_buffers, &buf->entry); - } - - IAudioClient_Stop(iface); - AudioQueueStop(This->aqueue, 1); - - /* Stopped synchronously, all buffers returned. */ - list_move_tail(&This->avail_buffers, &This->queued_buffers); - LIST_FOR_EACH_ENTRY_SAFE(buf, next, &This->avail_buffers, AQBuffer, entry){ - AudioQueueFreeBuffer(This->aqueue, buf->buf); - HeapFree(GetProcessHeap(), 0, buf); - } - - LIST_FOR_EACH_ENTRY_SAFE(bufinfo, bufinfo2, &This->queued_bufinfos, - QueuedBufInfo, entry) - HeapFree(GetProcessHeap(), 0, bufinfo); - - AudioQueueDispose(This->aqueue, 1); - } + if(This->timer){ + HANDLE event; + BOOL wait; + event = CreateEventW(NULL, TRUE, FALSE, NULL); + wait = !DeleteTimerQueueTimer(g_timer_q, This->timer, event); + wait = wait && GetLastError() == ERROR_IO_PENDING; + if(event && wait) + WaitForSingleObject(event, INFINITE); + CloseHandle(event); + } + AudioOutputUnitStop(This->unit); + AudioComponentInstanceDispose(This->unit); + if(This->converter) + AudioConverterDispose(This->converter); if(This->session){ EnterCriticalSection(&g_sessions_lock); list_remove(&This->entry); @@ -859,7 +781,10 @@ } HeapFree(GetProcessHeap(), 0, This->vols); HeapFree(GetProcessHeap(), 0, This->tmp_buffer); - HeapFree(GetProcessHeap(), 0, This->capture_buf); + HeapFree(GetProcessHeap(), 0, This->cap_buffer); + HeapFree(GetProcessHeap(), 0, This->local_buffer); + free(This->wrap_buffer); + HeapFree(GetProcessHeap(), 0, This->resamp_buffer); CoTaskMemFree(This->fmt); IMMDevice_Release(This->parent); IUnknown_Release(This->pUnkFTMarshal); @@ -989,84 +914,6 @@ return S_OK; } -/* We can't use debug printing or {Enter,Leave}CriticalSection from - * OSX callback threads. We may use OSSpinLock. - * OSSpinLock is not a recursive lock, so don't call - * synchronized functions while holding the lock. */ -static void ca_out_buffer_cb(void *user, AudioQueueRef aqueue, - AudioQueueBufferRef buffer) -{ - AQBuffer *buf = buffer->mUserData; - - buf->used = FALSE; -} - -static void ca_in_buffer_cb(void *user, AudioQueueRef aqueue, - AudioQueueBufferRef buffer, const AudioTimeStamp *start, - UInt32 ndesc, const AudioStreamPacketDescription *descs) -{ - AQBuffer *buf = buffer->mUserData; - - buf->used = FALSE; - /* let's update inbuf_frames synchronously without OSAddAtomic */ -} - -static HRESULT ca_setup_aqueue(AudioDeviceID did, EDataFlow flow, - const WAVEFORMATEX *fmt, void *user, AudioQueueRef *aqueue) -{ - AudioStreamBasicDescription desc; - AudioObjectPropertyAddress addr; - CFStringRef uid; - OSStatus sc; - HRESULT hr; - UInt32 size; - - addr.mScope = kAudioObjectPropertyScopeGlobal; - addr.mElement = 0; - addr.mSelector = kAudioDevicePropertyDeviceUID; - - size = sizeof(uid); - sc = AudioObjectGetPropertyData(did, &addr, 0, NULL, &size, &uid); - if(sc != noErr){ - WARN("Unable to get _DeviceUID property: %lx\n", sc); - return osstatus_to_hresult(sc); - } - - hr = ca_get_audiodesc(&desc, fmt); - if(FAILED(hr)){ - CFRelease(uid); - return hr; - } - - if(flow == eRender) - sc = AudioQueueNewOutput(&desc, ca_out_buffer_cb, user, NULL, NULL, 0, - aqueue); - else if(flow == eCapture) - sc = AudioQueueNewInput(&desc, ca_in_buffer_cb, user, NULL, NULL, 0, - aqueue); - else{ - CFRelease(uid); - return E_UNEXPECTED; - } - if(sc != noErr){ - WARN("Unable to create AudioQueue: %lx\n", sc); - CFRelease(uid); - return osstatus_to_hresult(sc); - } - - sc = AudioQueueSetProperty(*aqueue, kAudioQueueProperty_CurrentDevice, - &uid, sizeof(uid)); - if(sc != noErr){ - WARN("Unable to change AQueue device: %lx\n", sc); - CFRelease(uid); - return osstatus_to_hresult(sc); - } - - CFRelease(uid); - - return S_OK; -} - static void session_init_vols(AudioSession *session, UINT channels) { if(session->channel_count < channels){ @@ -1149,6 +996,299 @@ return S_OK; } +static void ca_wrap_buffer(BYTE *dst, UINT32 dst_offs, UINT32 dst_bytes, + BYTE *src, UINT32 src_bytes) +{ + UINT32 chunk_bytes = dst_bytes - dst_offs; + + if(chunk_bytes < src_bytes){ + memcpy(dst + dst_offs, src, chunk_bytes); + memcpy(dst, src + chunk_bytes, src_bytes - chunk_bytes); + }else + memcpy(dst + dst_offs, src, src_bytes); +} + +static void silence_buffer(ACImpl *This, BYTE *buffer, UINT32 frames) +{ + WAVEFORMATEXTENSIBLE *fmtex = (WAVEFORMATEXTENSIBLE*)This->fmt; + if((This->fmt->wFormatTag == WAVE_FORMAT_PCM || + (This->fmt->wFormatTag == WAVE_FORMAT_EXTENSIBLE && + IsEqualGUID(&fmtex->SubFormat, &KSDATAFORMAT_SUBTYPE_PCM))) && + This->fmt->wBitsPerSample == 8) + memset(buffer, 128, frames * This->fmt->nBlockAlign); + else + memset(buffer, 0, frames * This->fmt->nBlockAlign); +} + +/* CA is pulling data from us */ +static OSStatus ca_render_cb(void *user, AudioUnitRenderActionFlags *flags, + const AudioTimeStamp *ts, UInt32 bus, UInt32 nframes, + AudioBufferList *data) +{ + ACImpl *This = user; + UINT32 to_copy_bytes, to_copy_frames, chunk_bytes, lcl_offs_bytes; + + OSSpinLockLock(&This->lock); + + if(This->playing){ + lcl_offs_bytes = This->lcl_offs_frames * This->fmt->nBlockAlign; + to_copy_frames = min(nframes, This->held_frames); + to_copy_bytes = to_copy_frames * This->fmt->nBlockAlign; + + chunk_bytes = (This->bufsize_frames - This->lcl_offs_frames) * This->fmt->nBlockAlign; + + if(to_copy_bytes > chunk_bytes){ + memcpy(data->mBuffers[0].mData, This->local_buffer + lcl_offs_bytes, chunk_bytes); + memcpy(((BYTE *)data->mBuffers[0].mData) + chunk_bytes, This->local_buffer, to_copy_bytes - chunk_bytes); + }else + memcpy(data->mBuffers[0].mData, This->local_buffer + lcl_offs_bytes, to_copy_bytes); + + This->lcl_offs_frames += to_copy_frames; + This->lcl_offs_frames %= This->bufsize_frames; + This->held_frames -= to_copy_frames; + }else + to_copy_bytes = to_copy_frames = 0; + + if(nframes > to_copy_frames) + silence_buffer(This, ((BYTE *)data->mBuffers[0].mData) + to_copy_bytes, nframes - to_copy_frames); + + OSSpinLockUnlock(&This->lock); + + return noErr; +} + +static UINT buf_ptr_diff(UINT left, UINT right, UINT bufsize) +{ + if(left <= right) + return right - left; + return bufsize - (left - right); +} + +/* place data from cap_buffer into provided AudioBufferList */ +static OSStatus feed_cb(AudioConverterRef converter, UInt32 *nframes, AudioBufferList *data, + AudioStreamPacketDescription **packets, void *user) +{ + ACImpl *This = user; + + *nframes = min(*nframes, This->cap_held_frames); + if(!*nframes){ + data->mBuffers[0].mData = NULL; + data->mBuffers[0].mDataByteSize = 0; + data->mBuffers[0].mNumberChannels = This->fmt->nChannels; + return noErr; + } + + data->mBuffers[0].mDataByteSize = *nframes * This->fmt->nBlockAlign; + data->mBuffers[0].mNumberChannels = This->fmt->nChannels; + + if(This->cap_offs_frames + *nframes > This->cap_bufsize_frames){ + UINT32 chunk_frames = This->cap_bufsize_frames - This->cap_offs_frames; + + if(This->wrap_bufsize_frames < *nframes){ + free(This->wrap_buffer); + This->wrap_buffer = malloc(data->mBuffers[0].mDataByteSize); + This->wrap_bufsize_frames = *nframes; + } + + memcpy(This->wrap_buffer, This->cap_buffer + This->cap_offs_frames * This->fmt->nBlockAlign, + chunk_frames * This->fmt->nBlockAlign); + memcpy(This->wrap_buffer + chunk_frames * This->fmt->nBlockAlign, This->cap_buffer, + (*nframes - chunk_frames) * This->fmt->nBlockAlign); + + data->mBuffers[0].mData = This->wrap_buffer; + }else + data->mBuffers[0].mData = This->cap_buffer + This->cap_offs_frames * This->fmt->nBlockAlign; + + This->cap_offs_frames += *nframes; + This->cap_offs_frames %= This->cap_bufsize_frames; + This->cap_held_frames -= *nframes; + + if(packets) + *packets = NULL; + + return noErr; +} + +static void capture_resample(ACImpl *This) +{ + UINT32 resamp_period_frames = MulDiv(This->period_frames, This->dev_desc.mSampleRate, This->fmt->nSamplesPerSec); + OSStatus sc; + + /* the resampling process often needs more source frames than we'd + * guess from a straight conversion using the sample rate ratio. so + * only convert if we have extra source data. */ + while(This->cap_held_frames > resamp_period_frames * 2){ + AudioBufferList converted_list; + UInt32 wanted_frames = This->period_frames; + + converted_list.mNumberBuffers = 1; + converted_list.mBuffers[0].mNumberChannels = This->fmt->nChannels; + converted_list.mBuffers[0].mDataByteSize = wanted_frames * This->fmt->nBlockAlign; + + if(This->resamp_bufsize_frames < wanted_frames){ + HeapFree(GetProcessHeap(), 0, This->resamp_buffer); + This->resamp_buffer = HeapAlloc(GetProcessHeap(), 0, converted_list.mBuffers[0].mDataByteSize); + This->resamp_bufsize_frames = wanted_frames; + } + + converted_list.mBuffers[0].mData = This->resamp_buffer; + + sc = AudioConverterFillComplexBuffer(This->converter, feed_cb, + This, &wanted_frames, &converted_list, NULL); + if(sc != noErr){ + WARN("AudioConverterFillComplexBuffer failed: %lx\n", sc); + break; + } + + ca_wrap_buffer(This->local_buffer, + This->wri_offs_frames * This->fmt->nBlockAlign, + This->bufsize_frames * This->fmt->nBlockAlign, + This->resamp_buffer, wanted_frames * This->fmt->nBlockAlign); + + This->wri_offs_frames += wanted_frames; + This->wri_offs_frames %= This->bufsize_frames; + if(This->held_frames + wanted_frames > This->bufsize_frames){ + This->lcl_offs_frames += buf_ptr_diff(This->lcl_offs_frames, + This->wri_offs_frames, This->bufsize_frames); + This->held_frames = This->bufsize_frames; + }else + This->held_frames += wanted_frames; + } +} + +/* we need to trigger CA to pull data from the device and give it to us + * + * raw data from CA is stored in cap_buffer, possibly via wrap_buffer + * + * raw data is resampled from cap_buffer into resamp_buffer in period-size + * chunks and copied to local_buffer + */ +static OSStatus ca_capture_cb(void *user, AudioUnitRenderActionFlags *flags, + const AudioTimeStamp *ts, UInt32 bus, UInt32 nframes, + AudioBufferList *data) +{ + ACImpl *This = user; + AudioBufferList list; + OSStatus sc; + UINT32 cap_wri_offs_frames; + + OSSpinLockLock(&This->lock); + + cap_wri_offs_frames = (This->cap_offs_frames + This->cap_held_frames) % This->cap_bufsize_frames; + + list.mNumberBuffers = 1; + list.mBuffers[0].mNumberChannels = This->fmt->nChannels; + list.mBuffers[0].mDataByteSize = nframes * This->fmt->nBlockAlign; + + if(!This->playing || cap_wri_offs_frames + nframes > This->cap_bufsize_frames){ + if(This->wrap_bufsize_frames < nframes){ + free(This->wrap_buffer); + This->wrap_buffer = malloc(list.mBuffers[0].mDataByteSize); + This->wrap_bufsize_frames = nframes; + } + + list.mBuffers[0].mData = This->wrap_buffer; + }else + list.mBuffers[0].mData = This->cap_buffer + cap_wri_offs_frames * This->fmt->nBlockAlign; + + sc = AudioUnitRender(This->unit, flags, ts, bus, nframes, &list); + if(sc != noErr){ + OSSpinLockUnlock(&This->lock); + return sc; + } + + if(This->playing){ + if(list.mBuffers[0].mData == This->wrap_buffer){ + ca_wrap_buffer(This->cap_buffer, + cap_wri_offs_frames * This->fmt->nBlockAlign, + This->cap_bufsize_frames * This->fmt->nBlockAlign, + This->wrap_buffer, list.mBuffers[0].mDataByteSize); + } + + This->cap_held_frames += list.mBuffers[0].mDataByteSize / This->fmt->nBlockAlign; + if(This->cap_held_frames > This->cap_bufsize_frames){ + This->cap_offs_frames += This->cap_held_frames % This->cap_bufsize_frames; + This->cap_offs_frames %= This->cap_bufsize_frames; + This->cap_held_frames = This->cap_bufsize_frames; + } + } + + OSSpinLockUnlock(&This->lock); + return noErr; +} + +static void dump_adesc(const char *aux, AudioStreamBasicDescription *desc) +{ + TRACE("%s: mSampleRate: %f\n", aux, desc->mSampleRate); + TRACE("%s: mBytesPerPacket: %ld\n", aux, desc->mBytesPerPacket); + TRACE("%s: mFramesPerPacket: %ld\n", aux, desc->mFramesPerPacket); + TRACE("%s: mBytesPerFrame: %ld\n", aux, desc->mBytesPerFrame); + TRACE("%s: mChannelsPerFrame: %ld\n", aux, desc->mChannelsPerFrame); + TRACE("%s: mBitsPerChannel: %ld\n", aux, desc->mBitsPerChannel); +} + +static HRESULT ca_setup_audiounit(EDataFlow dataflow, AudioComponentInstance unit, + const WAVEFORMATEX *fmt, AudioStreamBasicDescription *dev_desc, + AudioConverterRef *converter) +{ + OSStatus sc; + HRESULT hr; + + if(dataflow == eCapture){ + AudioStreamBasicDescription desc; + UInt32 size; + Float64 rate; + + hr = ca_get_audiodesc(&desc, fmt); + if(FAILED(hr)) + return hr; + dump_adesc("requested", &desc); + + /* input-only units can't perform sample rate conversion, so we have to + * set up our own AudioConverter to support arbitrary sample rates. */ + size = sizeof(*dev_desc); + sc = AudioUnitGetProperty(unit, kAudioUnitProperty_StreamFormat, + kAudioUnitScope_Input, 1, dev_desc, &size); + if(sc != noErr){ + WARN("Couldn't get unit format: %lx\n", sc); + return osstatus_to_hresult(sc); + } + dump_adesc("hardware", dev_desc); + + rate = dev_desc->mSampleRate; + *dev_desc = desc; + dev_desc->mSampleRate = rate; + + dump_adesc("final", dev_desc); + sc = AudioUnitSetProperty(unit, kAudioUnitProperty_StreamFormat, + kAudioUnitScope_Output, 1, dev_desc, sizeof(*dev_desc)); + if(sc != noErr){ + WARN("Couldn't set unit format: %lx\n", sc); + return osstatus_to_hresult(sc); + } + + sc = AudioConverterNew(dev_desc, &desc, converter); + if(sc != noErr){ + WARN("Couldn't create audio converter: %lx\n", sc); + return osstatus_to_hresult(sc); + } + }else{ + hr = ca_get_audiodesc(dev_desc, fmt); + if(FAILED(hr)) + return hr; + + dump_adesc("final", dev_desc); + sc = AudioUnitSetProperty(unit, kAudioUnitProperty_StreamFormat, + kAudioUnitScope_Input, 0, dev_desc, sizeof(*dev_desc)); + if(sc != noErr){ + WARN("Couldn't set format: %lx\n", sc); + return osstatus_to_hresult(sc); + } + } + + return S_OK; +} + static HRESULT WINAPI AudioClient_Initialize(IAudioClient *iface, AUDCLNT_SHAREMODE mode, DWORD flags, REFERENCE_TIME duration, REFERENCE_TIME period, const WAVEFORMATEX *fmt, @@ -1212,21 +1352,13 @@ OSSpinLockLock(&This->lock); - if(This->aqueue){ + if(This->initted){ OSSpinLockUnlock(&This->lock); return AUDCLNT_E_ALREADY_INITIALIZED; } - hr = ca_setup_aqueue(This->adevid, This->dataflow, fmt, This, &This->aqueue); - if(FAILED(hr)){ - OSSpinLockUnlock(&This->lock); - return hr; - } - This->fmt = clone_format(fmt); if(!This->fmt){ - AudioQueueDispose(This->aqueue, 1); - This->aqueue = NULL; OSSpinLockUnlock(&This->lock); return E_OUTOFMEMORY; } @@ -1238,53 +1370,88 @@ if(mode == AUDCLNT_SHAREMODE_EXCLUSIVE) This->bufsize_frames -= This->bufsize_frames % This->period_frames; + hr = ca_setup_audiounit(This->dataflow, This->unit, This->fmt, &This->dev_desc, &This->converter); + if(FAILED(hr)){ + CoTaskMemFree(This->fmt); + This->fmt = NULL; + OSSpinLockUnlock(&This->lock); + return hr; + } + if(This->dataflow == eCapture){ - int i, nbuffs = (This->bufsize_frames / This->period_frames) + 1; + AURenderCallbackStruct input; + + memset(&input, 0, sizeof(input)); + input.inputProc = &ca_capture_cb; + input.inputProcRefCon = This; - This->capture_buf = HeapAlloc(GetProcessHeap(), 0, This->bufsize_frames * This->fmt->nBlockAlign); + sc = AudioUnitSetProperty(This->unit, kAudioOutputUnitProperty_SetInputCallback, + kAudioUnitScope_Output, 1, &input, sizeof(input)); + if(sc != noErr){ + WARN("Couldn't set callback: %lx\n", sc); + AudioConverterDispose(This->converter); + This->converter = NULL; + CoTaskMemFree(This->fmt); + This->fmt = NULL; + OSSpinLockUnlock(&This->lock); + return osstatus_to_hresult(sc); + } + }else{ + AURenderCallbackStruct input; - for(i = 0; i < nbuffs; ++i){ - AQBuffer *buf; + memset(&input, 0, sizeof(input)); + input.inputProc = &ca_render_cb; + input.inputProcRefCon = This; - buf = HeapAlloc(GetProcessHeap(), 0, sizeof(AQBuffer)); - if(!buf){ - HeapFree(GetProcessHeap(), 0, This->capture_buf); - AudioQueueDispose(This->aqueue, 1); - This->aqueue = NULL; - CoTaskMemFree(This->fmt); - This->fmt = NULL; - OSSpinLockUnlock(&This->lock); - return E_OUTOFMEMORY; - } + sc = AudioUnitSetProperty(This->unit, kAudioUnitProperty_SetRenderCallback, + kAudioUnitScope_Input, 0, &input, sizeof(input)); + if(sc != noErr){ + WARN("Couldn't set callback: %lx\n", sc); + CoTaskMemFree(This->fmt); + This->fmt = NULL; + OSSpinLockUnlock(&This->lock); + return osstatus_to_hresult(sc); + } + } - sc = AudioQueueAllocateBuffer(This->aqueue, This->period_frames * This->fmt->nBlockAlign, &buf->buf); - if(sc != noErr){ - HeapFree(GetProcessHeap(), 0, This->capture_buf); - AudioQueueDispose(This->aqueue, 1); - This->aqueue = NULL; - CoTaskMemFree(This->fmt); - This->fmt = NULL; - OSSpinLockUnlock(&This->lock); - WARN("Couldn't allocate buffer: %lx\n", sc); - return osstatus_to_hresult(sc); - } + sc = AudioUnitInitialize(This->unit); + if(sc != noErr){ + WARN("Couldn't initialize: %lx\n", sc); + if(This->converter){ + AudioConverterDispose(This->converter); + This->converter = NULL; + } + CoTaskMemFree(This->fmt); + This->fmt = NULL; + OSSpinLockUnlock(&This->lock); + return osstatus_to_hresult(sc); + } - buf->buf->mUserData = buf; - buf->used = TRUE; - sc = AudioQueueEnqueueBuffer(This->aqueue, buf->buf, 0, NULL); - if(sc != noErr){ - ERR("Couldn't enqueue buffer: %lx\n", sc); - break; - } - list_add_tail(&This->queued_buffers, &buf->entry); + /* we play audio continuously because AudioOutputUnitStart sometimes takes + * a while to return */ + sc = AudioOutputUnitStart(This->unit); + if(sc != noErr){ + WARN("Unit failed to start: %lx\n", sc); + if(This->converter){ + AudioConverterDispose(This->converter); + This->converter = NULL; } + CoTaskMemFree(This->fmt); + This->fmt = NULL; + OSSpinLockUnlock(&This->lock); + return osstatus_to_hresult(sc); + } + + This->local_buffer = HeapAlloc(GetProcessHeap(), 0, This->bufsize_frames * fmt->nBlockAlign); + silence_buffer(This, This->local_buffer, This->bufsize_frames); + + if(This->dataflow == eCapture){ + This->cap_bufsize_frames = MulDiv(duration, This->dev_desc.mSampleRate, 10000000); + This->cap_buffer = HeapAlloc(GetProcessHeap(), 0, This->cap_bufsize_frames * This->fmt->nBlockAlign); } This->vols = HeapAlloc(GetProcessHeap(), 0, fmt->nChannels * sizeof(float)); if(!This->vols){ - HeapFree(GetProcessHeap(), 0, This->capture_buf); - AudioQueueDispose(This->aqueue, 1); - This->aqueue = NULL; CoTaskMemFree(This->fmt); This->fmt = NULL; OSSpinLockUnlock(&This->lock); @@ -1303,11 +1470,8 @@ &This->session); if(FAILED(hr)){ LeaveCriticalSection(&g_sessions_lock); - AudioQueueDispose(This->aqueue, 1); - This->aqueue = NULL; CoTaskMemFree(This->fmt); This->fmt = NULL; - HeapFree(GetProcessHeap(), 0, This->capture_buf); HeapFree(GetProcessHeap(), 0, This->vols); This->vols = NULL; OSSpinLockUnlock(&This->lock); @@ -1320,6 +1484,8 @@ ca_setvol(This, -1); + This->initted = TRUE; + OSSpinLockUnlock(&This->lock); return S_OK; @@ -1337,7 +1503,7 @@ OSSpinLockLock(&This->lock); - if(!This->aqueue){ + if(!This->initted){ OSSpinLockUnlock(&This->lock); return AUDCLNT_E_NOT_INITIALIZED; } @@ -1419,7 +1585,7 @@ OSSpinLockLock(&This->lock); - if(!This->aqueue){ + if(!This->initted){ OSSpinLockUnlock(&This->lock); return AUDCLNT_E_NOT_INITIALIZED; } @@ -1457,20 +1623,13 @@ static HRESULT AudioClient_GetCurrentPadding_nolock(ACImpl *This, UINT32 *numpad) { - if(!This->aqueue) + if(!This->initted) return AUDCLNT_E_NOT_INITIALIZED; - avail_update(This); + if(This->dataflow == eCapture) + capture_resample(This); - if(This->dataflow == eRender){ - UINT64 bufpos; - bufpos = get_current_aqbuffer_position(This, BUFPOS_RELATIVE); - *numpad = This->inbuf_frames - bufpos; - }else{ - *numpad = This->inbuf_frames; - if(*numpad < This->period_frames) - *numpad = 0; - } + *numpad = This->held_frames; return S_OK; } @@ -1500,8 +1659,10 @@ WAVEFORMATEX **outpwfx) { ACImpl *This = impl_from_IAudioClient(iface); + AudioStreamBasicDescription dev_desc; + AudioConverterRef converter; + AudioComponentInstance unit; WAVEFORMATEXTENSIBLE *fmtex = (WAVEFORMATEXTENSIBLE*)pwfx; - AudioQueueRef aqueue; HRESULT hr; TRACE("(%p)->(%x, %p, %p)\n", This, mode, pwfx, outpwfx); @@ -1545,20 +1706,18 @@ if(pwfx->nChannels == 0) return AUDCLNT_E_UNSUPPORTED_FORMAT; - OSSpinLockLock(&This->lock); + unit = get_audiounit(This->dataflow, This->adevid); - hr = ca_setup_aqueue(This->adevid, This->dataflow, pwfx, NULL, &aqueue); - if(SUCCEEDED(hr)){ - AudioQueueDispose(aqueue, 1); - OSSpinLockUnlock(&This->lock); - TRACE("returning %08x\n", S_OK); - return S_OK; - } - OSSpinLockUnlock(&This->lock); - if(hr != AUDCLNT_E_UNSUPPORTED_FORMAT){ - TRACE("returning %08x\n", hr); - return hr; - } + converter = NULL; + hr = ca_setup_audiounit(This->dataflow, unit, pwfx, &dev_desc, &converter); + AudioComponentInstanceDispose(unit); + if(FAILED(hr)) + goto unsupported; + + if(converter) + AudioConverterDispose(converter); + + return S_OK; unsupported: if(outpwfx){ @@ -1685,18 +1844,17 @@ static HRESULT WINAPI AudioClient_Start(IAudioClient *iface) { ACImpl *This = impl_from_IAudioClient(iface); - OSStatus sc; TRACE("(%p)\n", This); OSSpinLockLock(&This->lock); - if(!This->aqueue){ + if(!This->initted){ OSSpinLockUnlock(&This->lock); return AUDCLNT_E_NOT_INITIALIZED; } - if(This->playing != StateStopped){ + if(This->playing){ OSSpinLockUnlock(&This->lock); return AUDCLNT_E_NOT_STOPPED; } @@ -1706,7 +1864,7 @@ return AUDCLNT_E_EVENTHANDLE_NOT_SET; } - if(This->event) + if(This->event && !This->timer) if(!CreateTimerQueueTimer(&This->timer, g_timer_q, ca_period_cb, This, 0, This->period_ms, WT_EXECUTEINTIMERTHREAD)){ This->timer = NULL; @@ -1715,19 +1873,7 @@ return E_OUTOFMEMORY; } - /* enqueue buffers */ - avail_update(This); - - This->playing = StateInTransition; - - sc = AudioQueueStart(This->aqueue, NULL); - if(sc != noErr){ - OSSpinLockUnlock(&This->lock); - WARN("Unable to start audio queue: %lx\n", sc); - return osstatus_to_hresult(sc); - } - - This->playing = StatePlaying; + This->playing = TRUE; OSSpinLockUnlock(&This->lock); @@ -1737,86 +1883,42 @@ static HRESULT WINAPI AudioClient_Stop(IAudioClient *iface) { ACImpl *This = impl_from_IAudioClient(iface); - AudioTimeStamp tstamp; - OSStatus sc; - HANDLE event = NULL; - BOOL wait = FALSE; TRACE("(%p)\n", This); OSSpinLockLock(&This->lock); - if(!This->aqueue){ + if(!This->initted){ OSSpinLockUnlock(&This->lock); return AUDCLNT_E_NOT_INITIALIZED; } - if(This->playing == StateStopped){ + if(!This->playing){ OSSpinLockUnlock(&This->lock); return S_FALSE; } - if(This->playing == StateInTransition){ - OSSpinLockUnlock(&This->lock); - return S_OK; - } - - if(This->timer){ - event = CreateEventW(NULL, TRUE, FALSE, NULL); - wait = !DeleteTimerQueueTimer(g_timer_q, This->timer, event); - This->timer = NULL; - if(wait) - WARN("DeleteTimerQueueTimer error %u\n", GetLastError()); - wait = wait && GetLastError() == ERROR_IO_PENDING; - } - - This->playing = StateInTransition; - - sc = AudioQueueGetCurrentTime(This->aqueue, NULL, &tstamp, NULL); - if(sc == noErr){ - if(tstamp.mFlags & kAudioTimeStampSampleTimeValid){ - if(tstamp.mSampleTime > This->highest_sampletime) - This->highest_sampletime = tstamp.mSampleTime; - }else - WARN("Returned tstamp mSampleTime not valid: %lx\n", tstamp.mFlags); - }else - WARN("GetCurrentTime failed: %lx\n", sc); - - /* Mac OS bug? Our capture callback is no more called past AQStop */ - sc = AudioQueuePause(This->aqueue); - if(sc != noErr){ - OSSpinLockUnlock(&This->lock); - WARN("Unable to pause audio queue: %lx\n", sc); - return osstatus_to_hresult(sc); - } - - This->playing = StateStopped; + This->playing = FALSE; OSSpinLockUnlock(&This->lock); - if(event && wait) - WaitForSingleObject(event, INFINITE); - CloseHandle(event); - return S_OK; } static HRESULT WINAPI AudioClient_Reset(IAudioClient *iface) { ACImpl *This = impl_from_IAudioClient(iface); - OSStatus sc; - QueuedBufInfo *bufinfo, *bufinfo2; TRACE("(%p)\n", This); OSSpinLockLock(&This->lock); - if(!This->aqueue){ + if(!This->initted){ OSSpinLockUnlock(&This->lock); return AUDCLNT_E_NOT_INITIALIZED; } - if(This->playing != StateStopped){ + if(This->playing){ OSSpinLockUnlock(&This->lock); return AUDCLNT_E_NOT_STOPPED; } @@ -1826,27 +1928,17 @@ return AUDCLNT_E_BUFFER_OPERATION_PENDING; } - avail_update(This); /* going to skip over inbuf_frames */ - - LIST_FOR_EACH_ENTRY_SAFE(bufinfo, bufinfo2, &This->queued_bufinfos, - QueuedBufInfo, entry){ - list_remove(&bufinfo->entry); - HeapFree(GetProcessHeap(), 0, bufinfo); - } - - sc = AudioQueueReset(This->aqueue); - if(sc != noErr){ - OSSpinLockUnlock(&This->lock); - WARN("Unable to reset audio queue: %lx\n", sc); - return osstatus_to_hresult(sc); - } - if(This->dataflow == eRender){ This->written_frames = 0; }else{ - This->written_frames += This->inbuf_frames; + This->written_frames += This->held_frames; } - This->inbuf_frames = 0; + + This->held_frames = 0; + This->lcl_offs_frames = 0; + This->wri_offs_frames = 0; + This->cap_offs_frames = 0; + This->cap_held_frames = 0; OSSpinLockUnlock(&This->lock); @@ -1865,7 +1957,7 @@ OSSpinLockLock(&This->lock); - if(!This->aqueue){ + if(!This->initted){ OSSpinLockUnlock(&This->lock); return AUDCLNT_E_NOT_INITIALIZED; } @@ -1901,7 +1993,7 @@ OSSpinLockLock(&This->lock); - if(!This->aqueue){ + if(!This->initted){ OSSpinLockUnlock(&This->lock); return AUDCLNT_E_NOT_INITIALIZED; } @@ -2028,26 +2120,12 @@ return AudioClient_Release(&This->IAudioClient_iface); } -static void silence_buffer(ACImpl *This, BYTE *buffer, UINT32 frames) -{ - WAVEFORMATEXTENSIBLE *fmtex = (WAVEFORMATEXTENSIBLE*)This->fmt; - if((This->fmt->wFormatTag == WAVE_FORMAT_PCM || - (This->fmt->wFormatTag == WAVE_FORMAT_EXTENSIBLE && - IsEqualGUID(&fmtex->SubFormat, &KSDATAFORMAT_SUBTYPE_PCM))) && - This->fmt->wBitsPerSample == 8) - memset(buffer, 128, frames * This->fmt->nBlockAlign); - else - memset(buffer, 0, frames * This->fmt->nBlockAlign); -} - static HRESULT WINAPI AudioRenderClient_GetBuffer(IAudioRenderClient *iface, UINT32 frames, BYTE **data) { ACImpl *This = impl_from_IAudioRenderClient(iface); - AQBuffer *buf; - UINT32 pad, bytes; + UINT32 pad; HRESULT hr; - OSStatus sc; TRACE("(%p)->(%u, %p)\n", This, frames, data); @@ -2078,38 +2156,23 @@ return AUDCLNT_E_BUFFER_TOO_LARGE; } - bytes = frames * This->fmt->nBlockAlign; - LIST_FOR_EACH_ENTRY(buf, &This->avail_buffers, AQBuffer, entry){ - if(buf->buf->mAudioDataBytesCapacity >= bytes){ - This->public_buffer = buf->buf; - list_remove(&buf->entry); - break; - } - } - - if(&buf->entry == &This->avail_buffers){ - sc = AudioQueueAllocateBuffer(This->aqueue, bytes, - &This->public_buffer); - if(sc != noErr){ - This->public_buffer = NULL; - OSSpinLockUnlock(&This->lock); - WARN("Unable to allocate buffer: %lx\n", sc); - return E_OUTOFMEMORY; - } - buf = HeapAlloc(GetProcessHeap(), 0, sizeof(AQBuffer)); - if(!buf){ - AudioQueueFreeBuffer(This->aqueue, This->public_buffer); - This->public_buffer = NULL; - OSSpinLockUnlock(&This->lock); - return E_OUTOFMEMORY; + if(This->wri_offs_frames + frames > This->bufsize_frames){ + if(This->tmp_buffer_frames < frames){ + HeapFree(GetProcessHeap(), 0, This->tmp_buffer); + This->tmp_buffer = HeapAlloc(GetProcessHeap(), 0, frames * This->fmt->nBlockAlign); + if(!This->tmp_buffer){ + OSSpinLockUnlock(&This->lock); + return E_OUTOFMEMORY; + } + This->tmp_buffer_frames = frames; } - buf->used = FALSE; - buf->buf = This->public_buffer; - This->public_buffer->mUserData = buf; + *data = This->tmp_buffer; + This->getbuf_last = -frames; + }else{ + *data = This->local_buffer + This->wri_offs_frames * This->fmt->nBlockAlign; + This->getbuf_last = frames; } - This->getbuf_last = frames; - *data = This->public_buffer->mAudioData; silence_buffer(This, *data, frames); OSSpinLockUnlock(&This->lock); @@ -2121,9 +2184,7 @@ IAudioRenderClient *iface, UINT32 frames, DWORD flags) { ACImpl *This = impl_from_IAudioRenderClient(iface); - AQBuffer *buf; - AudioTimeStamp start_time, req_time = {0}, *passed_time = NULL; - OSStatus sc; + BYTE *buffer; TRACE("(%p)->(%u, %x)\n", This, frames, flags); @@ -2131,11 +2192,6 @@ if(!frames){ This->getbuf_last = 0; - if(This->public_buffer){ - buf = This->public_buffer->mUserData; - list_add_head(&This->avail_buffers, &buf->entry); - This->public_buffer = NULL; - } OSSpinLockUnlock(&This->lock); return S_OK; } @@ -2145,62 +2201,31 @@ return AUDCLNT_E_OUT_OF_ORDER; } - if(frames > This->getbuf_last){ + if(frames > (This->getbuf_last >= 0 ? This->getbuf_last : -This->getbuf_last)){ OSSpinLockUnlock(&This->lock); return AUDCLNT_E_INVALID_SIZE; } - if(flags & AUDCLNT_BUFFERFLAGS_SILENT) - silence_buffer(This, This->public_buffer->mAudioData, frames); - - This->public_buffer->mAudioDataByteSize = frames * This->fmt->nBlockAlign; - - buf = This->public_buffer->mUserData; - buf->used = TRUE; - - if(list_empty(&This->queued_bufinfos)){ - sc = AudioQueueGetCurrentTime(This->aqueue, NULL, &req_time, NULL); - if(sc == noErr) - passed_time = &req_time; - else - TRACE("AudioQueueGetCurrentTime failed: %lx\n", sc); - }else{ - req_time.mSampleTime = This->next_sampletime; - req_time.mFlags = kAudioTimeStampSampleTimeValid; - passed_time = &req_time; - } - - sc = AudioQueueEnqueueBufferWithParameters(This->aqueue, - This->public_buffer, 0, NULL, 0, 0, 0, NULL, passed_time, - &start_time); - if(sc != noErr){ - OSSpinLockUnlock(&This->lock); - ERR("Unable to enqueue buffer: %lx\n", sc); - return AUDCLNT_E_DEVICE_INVALIDATED; - } - list_add_tail(&This->queued_buffers, &buf->entry); - - if(start_time.mFlags & kAudioTimeStampSampleTimeValid){ - QueuedBufInfo *bufinfo; + if(This->getbuf_last >= 0) + buffer = This->local_buffer + This->wri_offs_frames * This->fmt->nBlockAlign; + else + buffer = This->tmp_buffer; - bufinfo = HeapAlloc(GetProcessHeap(), 0, sizeof(*bufinfo)); - bufinfo->start_sampletime = start_time.mSampleTime; - bufinfo->start_pos = This->written_frames; - bufinfo->len_frames = frames; + if(flags & AUDCLNT_BUFFERFLAGS_SILENT) + silence_buffer(This, buffer, frames); - list_add_tail(&This->queued_bufinfos, &bufinfo->entry); + if(This->getbuf_last < 0) + ca_wrap_buffer(This->local_buffer, + This->wri_offs_frames * This->fmt->nBlockAlign, + This->bufsize_frames * This->fmt->nBlockAlign, + buffer, frames * This->fmt->nBlockAlign); - This->next_sampletime = start_time.mSampleTime + bufinfo->len_frames; - }else - WARN("Start time didn't contain valid SampleTime member\n"); - if(This->playing == StateStopped) - AudioQueuePrime(This->aqueue, 0, NULL); - - This->public_buffer = NULL; - This->getbuf_last = 0; + This->wri_offs_frames += frames; + This->wri_offs_frames %= This->bufsize_frames; + This->held_frames += frames; This->written_frames += frames; - This->inbuf_frames += frames; + This->getbuf_last = 0; OSSpinLockUnlock(&This->lock); @@ -2257,7 +2282,7 @@ UINT64 *qpcpos) { ACImpl *This = impl_from_IAudioCaptureClient(iface); - DWORD chunk_bytes; + UINT32 chunk_bytes, chunk_frames; TRACE("(%p)->(%p, %p, %p, %p, %p)\n", This, data, frames, flags, devpos, qpcpos); @@ -2272,9 +2297,9 @@ return AUDCLNT_E_OUT_OF_ORDER; } - avail_update(This); + capture_resample(This); - if(This->inbuf_frames < This->period_frames){ + if(This->held_frames < This->period_frames){ *frames = 0; OSSpinLockUnlock(&This->lock); return AUDCLNT_S_BUFFER_EMPTY; @@ -2282,15 +2307,16 @@ *flags = 0; - chunk_bytes = This->bufsize_frames * This->fmt->nBlockAlign - This->read_offs_bytes; - if(chunk_bytes < This->period_frames * This->fmt->nBlockAlign){ + chunk_frames = This->bufsize_frames - This->lcl_offs_frames; + if(chunk_frames < This->period_frames){ + chunk_bytes = chunk_frames * This->fmt->nBlockAlign; if(!This->tmp_buffer) This->tmp_buffer = HeapAlloc(GetProcessHeap(), 0, This->period_frames * This->fmt->nBlockAlign); *data = This->tmp_buffer; - memcpy(*data, This->capture_buf + This->read_offs_bytes, chunk_bytes); - memcpy((*data) + chunk_bytes, This->capture_buf, This->period_frames * This->fmt->nBlockAlign - chunk_bytes); + memcpy(*data, This->local_buffer + This->lcl_offs_frames * This->fmt->nBlockAlign, chunk_bytes); + memcpy((*data) + chunk_bytes, This->local_buffer, This->period_frames * This->fmt->nBlockAlign - chunk_bytes); }else - *data = This->capture_buf + This->read_offs_bytes; + *data = This->local_buffer + This->lcl_offs_frames * This->fmt->nBlockAlign; This->getbuf_last = *frames = This->period_frames; @@ -2334,9 +2360,9 @@ } This->written_frames += done; - This->inbuf_frames -= done; - This->read_offs_bytes += done * This->fmt->nBlockAlign; - This->read_offs_bytes %= This->bufsize_frames * This->fmt->nBlockAlign; + This->held_frames -= done; + This->lcl_offs_frames += done; + This->lcl_offs_frames %= This->bufsize_frames; This->getbuf_last = 0; OSSpinLockUnlock(&This->lock); @@ -2356,9 +2382,9 @@ OSSpinLockLock(&This->lock); - avail_update(This); + capture_resample(This); - if(This->inbuf_frames >= This->period_frames) + if(This->held_frames >= This->period_frames) *frames = This->period_frames; else *frames = 0; @@ -2431,12 +2457,7 @@ static HRESULT AudioClock_GetPosition_nolock(ACImpl *This, UINT64 *pos, UINT64 *qpctime) { - avail_update(This); - - if(This->dataflow == eRender) - *pos = get_current_aqbuffer_position(This, BUFPOS_ABSOLUTE); - else - *pos = This->inbuf_frames + This->written_frames; + *pos = This->written_frames - This->held_frames; if(This->share == AUDCLNT_SHAREMODE_SHARED) *pos *= This->fmt->nBlockAlign; @@ -2627,8 +2648,7 @@ LIST_FOR_EACH_ENTRY(client, &This->session->clients, ACImpl, entry){ OSSpinLockLock(&client->lock); - if(client->playing == StatePlaying || - client->playing == StateInTransition){ + if(client->playing){ *state = AudioSessionStateActive; OSSpinLockUnlock(&client->lock); LeaveCriticalSection(&g_sessions_lock); @@ -2804,30 +2824,30 @@ /* index == -1 means set all channels, otherwise sets only the given channel */ static HRESULT ca_setvol(ACImpl *This, UINT32 index) { - float level; + Float32 level; OSStatus sc; - if(index == (UINT32)-1){ - HRESULT ret = S_OK; - UINT32 i; - for(i = 0; i < This->fmt->nChannels; ++i){ - HRESULT hr; - hr = ca_setvol(This, i); - if(FAILED(hr)) - ret = hr; - } - return ret; - } - if(This->session->mute) - level = 0; - else - level = This->session->master_vol * - This->session->channel_vols[index] * This->vols[index]; + level = 0.; + else{ + if(index == (UINT32)-1){ + UINT32 i; + level = 1.; + for(i = 0; i < This->fmt->nChannels; ++i){ + Float32 tmp; + tmp = This->session->master_vol * + This->session->channel_vols[i] * This->vols[i]; + level = tmp < level ? tmp : level; + } + }else + level = This->session->master_vol * + This->session->channel_vols[index] * This->vols[index]; + } - sc = AudioQueueSetParameter(This->aqueue, kAudioQueueParam_Volume, level); + sc = AudioUnitSetParameter(This->unit, kHALOutputParam_Volume, + kAudioUnitScope_Global, 0, level, 0); if(sc != noErr) - WARN("Setting _Volume property failed: %lx\n", sc); + WARN("Couldn't set volume: %lx\n", sc); return S_OK; } @@ -3037,7 +3057,7 @@ This->vols[index] = level; - WARN("AudioQueue doesn't support per-channel volume control\n"); + WARN("CoreAudio doesn't support per-channel volume control\n"); ret = ca_setvol(This, index); OSSpinLockUnlock(&This->lock); @@ -3199,7 +3219,7 @@ session->channel_vols[index] = level; - WARN("AudioQueue doesn't support per-channel volume control\n"); + WARN("CoreAudio doesn't support per-channel volume control\n"); ret = ca_session_setvol(session, index); LeaveCriticalSection(&session->lock); diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/wined3d/arb_program_shader.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/wined3d/arb_program_shader.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/wined3d/arb_program_shader.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/wined3d/arb_program_shader.c 2014-07-11 19:15:41.000000000 +0000 @@ -7283,7 +7283,7 @@ struct wined3d_device *device = surface->resource.device; const struct wined3d_gl_info *gl_info = context->gl_info; struct arbfp_blit_priv *priv = device->blit_priv; - const struct wined3d_palette *palette = surface->palette; + const struct wined3d_palette *palette = surface->swapchain ? surface->swapchain->palette : NULL; if (!priv->palette_texture) gl_info->gl_ops.gl.p_glGenTextures(1, &priv->palette_texture); diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/wined3d/palette.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/wined3d/palette.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/wined3d/palette.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/wined3d/palette.c 2014-07-11 19:15:41.000000000 +0000 @@ -92,7 +92,6 @@ HRESULT CDECL wined3d_palette_set_entries(struct wined3d_palette *palette, DWORD flags, DWORD start, DWORD count, const PALETTEENTRY *entries) { - struct wined3d_resource *resource; unsigned int i; TRACE("palette %p, flags %#x, start %u, count %u, entries %p.\n", @@ -130,17 +129,6 @@ } } - /* If the palette is attached to the render target, update all render targets */ - LIST_FOR_EACH_ENTRY(resource, &palette->device->resources, struct wined3d_resource, resource_list_entry) - { - if (resource->type == WINED3D_RTYPE_SURFACE) - { - struct wined3d_surface *surface = surface_from_resource(resource); - if (surface->palette == palette) - surface->surface_ops->surface_realize_palette(surface); - } - } - return WINED3D_OK; } diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/wined3d/resource.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/wined3d/resource.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/wined3d/resource.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/wined3d/resource.c 2014-07-11 19:15:41.000000000 +0000 @@ -26,6 +26,7 @@ #include "wined3d_private.h" WINE_DEFAULT_DEBUG_CHANNEL(d3d); +WINE_DECLARE_DEBUG_CHANNEL(d3d_perf); static DWORD resource_access_from_pool(enum wined3d_pool pool) { @@ -51,6 +52,7 @@ { static const DWORD handled = WINED3DUSAGE_RENDERTARGET | WINED3DUSAGE_DEPTHSTENCIL + | WINED3DUSAGE_WRITEONLY | WINED3DUSAGE_DYNAMIC | WINED3DUSAGE_AUTOGENMIPMAP | WINED3DUSAGE_STATICDECL @@ -59,6 +61,8 @@ if (usage & ~handled) FIXME("Unhandled usage flags %#x.\n", usage & ~handled); + if ((usage & (WINED3DUSAGE_DYNAMIC | WINED3DUSAGE_WRITEONLY)) == WINED3DUSAGE_DYNAMIC) + WARN_(d3d_perf)("WINED3DUSAGE_DYNAMIC used without WINED3DUSAGE_WRITEONLY.\n"); } HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *device, @@ -159,7 +163,15 @@ DWORD resource_set_priority(struct wined3d_resource *resource, DWORD priority) { - DWORD prev = resource->priority; + DWORD prev; + + if (resource->pool != WINED3D_POOL_MANAGED) + { + WARN("Called on non-managed resource %p, ignoring.\n", resource); + return 0; + } + + prev = resource->priority; resource->priority = priority; TRACE("resource %p, new priority %u, returning old priority %u.\n", resource, priority, prev); return prev; diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/wined3d/surface.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/wined3d/surface.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/wined3d/surface.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/wined3d/surface.c 2014-07-11 19:15:41.000000000 +0000 @@ -498,7 +498,6 @@ /* Now allocate a DC. */ surface->hDC = CreateCompatibleDC(0); SelectObject(surface->hDC, surface->dib.DIBsection); - TRACE("Using wined3d palette %p.\n", surface->palette); surface->flags |= SFLAG_DIBSECTION; @@ -754,44 +753,6 @@ return WINED3D_OK; } -static void surface_realize_palette(struct wined3d_surface *surface) -{ - struct wined3d_palette *palette = surface->palette; - - TRACE("surface %p.\n", surface); - - if (!palette) return; - - if (surface->resource.format->id == WINED3DFMT_P8_UINT - || surface->resource.format->id == WINED3DFMT_P8_UINT_A8_UNORM) - { - if (surface->resource.usage & WINED3DUSAGE_RENDERTARGET) - { - /* Make sure the texture is up to date. This call doesn't do - * anything if the texture is already up to date. */ - surface_load_location(surface, WINED3D_LOCATION_TEXTURE_RGB); - - /* We want to force a palette refresh, so mark the drawable as not being up to date */ - if (!surface_is_offscreen(surface)) - surface_invalidate_location(surface, WINED3D_LOCATION_DRAWABLE); - } - else - { - if (!(surface->locations & surface->map_binding)) - { - TRACE("Palette changed with surface that does not have an up to date system memory copy.\n"); - surface_prepare_map_memory(surface); - surface_load_location(surface, surface->map_binding); - } - surface_invalidate_location(surface, ~surface->map_binding); - } - } - - /* Propagate the changes to the drawable when we have a palette. */ - if (surface->resource.usage & WINED3DUSAGE_RENDERTARGET) - surface_load_location(surface, surface->draw_binding); -} - static void surface_unmap(struct wined3d_surface *surface) { struct wined3d_device *device = surface->resource.device; @@ -1098,15 +1059,18 @@ DWORD color, struct wined3d_color *float_color) { const struct wined3d_format *format = surface->resource.format; + const struct wined3d_palette *palette; switch (format->id) { case WINED3DFMT_P8_UINT: - if (surface->palette) + palette = surface->swapchain ? surface->swapchain->palette : NULL; + + if (palette) { - float_color->r = surface->palette->colors[color].rgbRed / 255.0f; - float_color->g = surface->palette->colors[color].rgbGreen / 255.0f; - float_color->b = surface->palette->colors[color].rgbBlue / 255.0f; + float_color->r = palette->colors[color].rgbRed / 255.0f; + float_color->g = palette->colors[color].rgbGreen / 255.0f; + float_color->b = palette->colors[color].rgbBlue / 255.0f; } else { @@ -1320,7 +1284,6 @@ static const struct wined3d_surface_ops surface_ops = { surface_private_setup, - surface_realize_palette, surface_unmap, }; @@ -1365,24 +1328,6 @@ return WINED3D_OK; } -static void gdi_surface_realize_palette(struct wined3d_surface *surface) -{ - struct wined3d_palette *palette = surface->palette; - - TRACE("surface %p.\n", surface); - - if (!palette) return; - - /* Update the image because of the palette change. Some games like e.g. - * Red Alert call SetEntries a lot to implement fading. */ - /* Tell the swapchain to update the screen. */ - if (surface->swapchain && surface == surface->swapchain->front_buffer) - { - wined3d_palette_apply_to_dc(palette, surface->hDC); - x11_copy_to_screen(surface->swapchain, NULL); - } -} - static void gdi_surface_unmap(struct wined3d_surface *surface) { TRACE("surface %p.\n", surface); @@ -1397,7 +1342,6 @@ static const struct wined3d_surface_ops gdi_surface_ops = { gdi_surface_private_setup, - gdi_surface_realize_palette, gdi_surface_unmap, }; @@ -2346,21 +2290,6 @@ return WINED3D_OK; } -void CDECL wined3d_surface_set_palette(struct wined3d_surface *surface, struct wined3d_palette *palette) -{ - TRACE("surface %p, palette %p.\n", surface, palette); - - if (surface->palette == palette) - { - TRACE("Nop palette change.\n"); - return; - } - - surface->palette = palette; - if (palette) - surface->surface_ops->surface_realize_palette(surface); -} - DWORD CDECL wined3d_surface_get_pitch(const struct wined3d_surface *surface) { unsigned int alignment; @@ -3388,10 +3317,10 @@ } case WINED3D_CT_PALETTED: - if (surface->palette) + if (surface->swapchain && surface->swapchain->palette) { unsigned int x, y; - const struct wined3d_palette *palette = surface->palette; + const struct wined3d_palette *palette = surface->swapchain->palette; for (y = 0; y < height; y++) { source = src + pitch * y; diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/wined3d/swapchain.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/wined3d/swapchain.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/wined3d/swapchain.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/wined3d/swapchain.c 2014-07-11 19:15:41.000000000 +0000 @@ -258,6 +258,12 @@ return WINED3D_OK; } +void CDECL wined3d_swapchain_set_palette(struct wined3d_swapchain *swapchain, struct wined3d_palette *palette) +{ + TRACE("swapchain %p, palette %p.\n", swapchain, palette); + swapchain->palette = palette; +} + HRESULT CDECL wined3d_swapchain_get_gamma_ramp(const struct wined3d_swapchain *swapchain, struct wined3d_gamma_ramp *ramp) { @@ -619,6 +625,9 @@ TRACE("swapchain %p, rect %s.\n", swapchain, wine_dbgstr_rect(rect)); + if (swapchain->palette) + wined3d_palette_apply_to_dc(swapchain->palette, swapchain->front_buffer->hDC); + front = swapchain->front_buffer; if (front->resource.map_count) ERR("Trying to blit a mapped surface.\n"); diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/wined3d/texture.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/wined3d/texture.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/wined3d/texture.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/wined3d/texture.c 2014-07-11 19:15:41.000000000 +0000 @@ -25,6 +25,7 @@ #include "wined3d_private.h" WINE_DEFAULT_DEBUG_CHANNEL(d3d_texture); +WINE_DECLARE_DEBUG_CHANNEL(winediag); static HRESULT wined3d_texture_init(struct wined3d_texture *texture, const struct wined3d_texture_ops *texture_ops, UINT layer_count, UINT level_count, const struct wined3d_resource_desc *desc, struct wined3d_device *device, @@ -53,6 +54,13 @@ desc->multisample_type, desc->multisample_quality, desc->usage, desc->pool, desc->width, desc->height, desc->depth, 0, parent, parent_ops, resource_ops))) { + static unsigned int once; + + if ((desc->format == WINED3DFMT_DXT1 || desc->format == WINED3DFMT_DXT2 || desc->format == WINED3DFMT_DXT3 + || desc->format == WINED3DFMT_DXT4 || desc->format == WINED3DFMT_DXT5) + && !(format->flags & WINED3DFMT_FLAG_TEXTURE) && !once++) + ERR_(winediag)("The application tried to create a DXTn texture, but the driver does not support them.\n"); + WARN("Failed to initialize resource, returning %#x\n", hr); return hr; } diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/wined3d/wined3d_private.h wine-compholio-1.7.22~ubuntu13.10.1/dlls/wined3d/wined3d_private.h --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/wined3d/wined3d_private.h 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/wined3d/wined3d_private.h 2014-07-11 19:15:41.000000000 +0000 @@ -2212,7 +2212,6 @@ struct wined3d_surface_ops { HRESULT (*surface_private_setup)(struct wined3d_surface *surface); - void (*surface_realize_palette)(struct wined3d_surface *surface); void (*surface_unmap)(struct wined3d_surface *surface); }; @@ -2222,7 +2221,6 @@ const struct wined3d_surface_ops *surface_ops; struct wined3d_texture *container; struct wined3d_swapchain *swapchain; - struct wined3d_palette *palette; /* D3D7 style palette handling */ DWORD draw_binding, map_binding; void *user_memory; DWORD locations; @@ -2622,6 +2620,7 @@ struct wined3d_gamma_ramp orig_gamma; BOOL render_to_fbo; const struct wined3d_format *ds_format; + struct wined3d_palette *palette; LONG prev_time, frames; /* Performance tracking */ diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/wined3d/wined3d.spec wine-compholio-1.7.22~ubuntu13.10.1/dlls/wined3d/wined3d.spec --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/wined3d/wined3d.spec 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/wined3d/wined3d.spec 2014-07-11 19:15:41.000000000 +0000 @@ -221,7 +221,6 @@ @ cdecl wined3d_surface_releasedc(ptr ptr) @ cdecl wined3d_surface_restore(ptr) @ cdecl wined3d_surface_set_overlay_position(ptr long long) -@ cdecl wined3d_surface_set_palette(ptr ptr) @ cdecl wined3d_surface_set_priority(ptr long) @ cdecl wined3d_surface_unmap(ptr) @ cdecl wined3d_surface_update_desc(ptr long long long long long ptr long) @@ -241,6 +240,7 @@ @ cdecl wined3d_swapchain_incref(ptr) @ cdecl wined3d_swapchain_present(ptr ptr ptr ptr ptr long) @ cdecl wined3d_swapchain_set_gamma_ramp(ptr long ptr) +@ cdecl wined3d_swapchain_set_palette(ptr ptr) @ cdecl wined3d_swapchain_set_window(ptr ptr) @ cdecl wined3d_texture_add_dirty_region(ptr long ptr) diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/wineoss.drv/mmdevdrv.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/wineoss.drv/mmdevdrv.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/wineoss.drv/mmdevdrv.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/wineoss.drv/mmdevdrv.c 2014-07-11 19:15:41.000000000 +0000 @@ -57,8 +57,8 @@ #define NULL_PTR_ERR MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, RPC_X_NULL_REF_POINTER) -static const REFERENCE_TIME DefaultPeriod = 200000; -static const REFERENCE_TIME MinimumPeriod = 100000; +static const REFERENCE_TIME DefaultPeriod = 100000; +static const REFERENCE_TIME MinimumPeriod = 50000; struct ACImpl; typedef struct ACImpl ACImpl; @@ -712,9 +712,21 @@ { ACImpl *This = impl_from_IAudioClient(iface); ULONG ref; + ref = InterlockedDecrement(&This->ref); TRACE("(%p) Refcount now %u\n", This, ref); if(!ref){ + if(This->timer){ + HANDLE event; + DWORD wait; + event = CreateEventW(NULL, TRUE, FALSE, NULL); + wait = !DeleteTimerQueueTimer(g_timer_q, This->timer, event); + wait = wait && GetLastError() == ERROR_IO_PENDING; + if(event && wait) + WaitForSingleObject(event, INFINITE); + CloseHandle(event); + } + IAudioClient_Stop(iface); IMMDevice_Release(This->parent); IUnknown_Release(This->pUnkFTMarshal); @@ -1542,10 +1554,12 @@ return AUDCLNT_E_NOT_STOPPED; } - if(!CreateTimerQueueTimer(&This->timer, g_timer_q, - oss_period_callback, This, 0, This->period_us / 1000, - WT_EXECUTEINTIMERTHREAD)) - ERR("Unable to create period timer: %u\n", GetLastError()); + if(!This->timer){ + if(!CreateTimerQueueTimer(&This->timer, g_timer_q, + oss_period_callback, This, 0, This->period_us / 1000, + WT_EXECUTEINTIMERTHREAD)) + ERR("Unable to create period timer: %u\n", GetLastError()); + } This->playing = TRUE; @@ -1557,8 +1571,6 @@ static HRESULT WINAPI AudioClient_Stop(IAudioClient *iface) { ACImpl *This = impl_from_IAudioClient(iface); - HANDLE event; - DWORD wait; TRACE("(%p)\n", This); @@ -1574,20 +1586,10 @@ return S_FALSE; } - event = CreateEventW(NULL, TRUE, FALSE, NULL); - wait = !DeleteTimerQueueTimer(g_timer_q, This->timer, event); - if(wait) - WARN("DeleteTimerQueueTimer error %u\n", GetLastError()); - wait = wait && GetLastError() == ERROR_IO_PENDING; - This->playing = FALSE; LeaveCriticalSection(&This->lock); - if(event && wait) - WaitForSingleObject(event, INFINITE); - CloseHandle(event); - return S_OK; } diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/wineps.drv/psdrv.h wine-compholio-1.7.22~ubuntu13.10.1/dlls/wineps.drv/psdrv.h --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/wineps.drv/psdrv.h 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/wineps.drv/psdrv.h 2014-07-11 19:15:41.000000000 +0000 @@ -99,7 +99,7 @@ const AFMMETRICS *Metrics; } AFM; -/* Note no 'next' in AFM. Use AFMLISTENTRY as a container. This allow more than +/* Note no 'next' in AFM. Use AFMLISTENTRY as a container. This allows more than one list to exist without having to reallocate the entire AFM structure. We keep a global list of all afms (PSDRV_AFMFontList) plus a list of available fonts for each DC (dc->physDev->Fonts) */ diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/wineps.drv/vertical.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/wineps.drv/vertical.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/wineps.drv/vertical.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/wineps.drv/vertical.c 2014-07-11 19:15:41.000000000 +0000 @@ -2,8 +2,6 @@ /* generated from http://www.unicode.org/Public/vertical/revision-11/VerticalOrientation-11.txt */ /* DO NOT EDIT!! */ -#include "wine/unicode.h" - const unsigned short vertical_orientation_table[1536] = { /* level 1 offsets */ diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/winex11.drv/window.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/winex11.drv/window.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/winex11.drv/window.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/winex11.drv/window.c 2014-07-11 19:15:41.000000000 +0000 @@ -974,6 +974,8 @@ if (data->whole_window == root_window) return; style = GetWindowLongW( data->hwnd, GWL_STYLE ); + if (style & WS_MINIMIZE) + new_state |= data->net_wm_state & (1 << NET_WM_STATE_FULLSCREEN); if (is_window_rect_fullscreen( &data->whole_rect )) { if ((style & WS_MAXIMIZE) && (style & WS_CAPTION) == WS_CAPTION) diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/wininet/cookie.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/wininet/cookie.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/wininet/cookie.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/wininet/cookie.c 2014-07-11 19:15:41.000000000 +0000 @@ -531,7 +531,7 @@ heap_free(deadDomain); } -DWORD get_cookie(const WCHAR *host, const WCHAR *path, WCHAR *cookie_data, DWORD *size) +DWORD get_cookie(const WCHAR *host, const WCHAR *path, WCHAR *cookie_data, DWORD *size, DWORD flags) { static const WCHAR empty_path[] = { '/',0 }; @@ -590,6 +590,9 @@ continue; } + if((cookie_iter->flags & INTERNET_COOKIE_HTTPONLY) && !(flags & INTERNET_COOKIE_HTTPONLY)) + continue; + if (cookie_count) cnt += 2; /* '; ' */ cnt += name_len = strlenW(cookie_iter->lpCookieName); @@ -649,7 +652,7 @@ } /*********************************************************************** - * InternetGetCookieW (WININET.@) + * InternetGetCookieExW (WININET.@) * * Retrieve cookie from the specified url * @@ -661,14 +664,17 @@ * FALSE on failure * */ -BOOL WINAPI InternetGetCookieW(LPCWSTR lpszUrl, LPCWSTR lpszCookieName, - LPWSTR lpCookieData, LPDWORD lpdwSize) +BOOL WINAPI InternetGetCookieExW(LPCWSTR lpszUrl, LPCWSTR lpszCookieName, + LPWSTR lpCookieData, LPDWORD lpdwSize, DWORD flags, void *reserved) { WCHAR host[INTERNET_MAX_HOST_NAME_LENGTH], path[INTERNET_MAX_PATH_LENGTH]; DWORD res; BOOL ret; - TRACE("(%s, %s, %p, %p)\n", debugstr_w(lpszUrl),debugstr_w(lpszCookieName), lpCookieData, lpdwSize); + TRACE("(%s, %s, %p, %p, %x, %p)\n", debugstr_w(lpszUrl),debugstr_w(lpszCookieName), lpCookieData, lpdwSize, flags, reserved); + + if (flags) + FIXME("flags 0x%08x not supported\n", flags); if (!lpszUrl) { @@ -683,15 +689,26 @@ return FALSE; } - res = get_cookie(host, path, lpCookieData, lpdwSize); + res = get_cookie(host, path, lpCookieData, lpdwSize, flags); if(res != ERROR_SUCCESS) SetLastError(res); return res == ERROR_SUCCESS; } +/*********************************************************************** + * InternetGetCookieW (WININET.@) + * + * Retrieve cookie for the specified URL. + */ +BOOL WINAPI InternetGetCookieW(const WCHAR *url, const WCHAR *name, WCHAR *data, DWORD *size) +{ + TRACE("(%s, %s, %s, %p)\n", debugstr_w(url), debugstr_w(name), debugstr_w(data), size); + + return InternetGetCookieExW(url, name, data, size, 0, NULL); +} /*********************************************************************** - * InternetGetCookieA (WININET.@) + * InternetGetCookieExA (WININET.@) * * Retrieve cookie from the specified url * @@ -700,20 +717,20 @@ * FALSE on failure * */ -BOOL WINAPI InternetGetCookieA(LPCSTR lpszUrl, LPCSTR lpszCookieName, - LPSTR lpCookieData, LPDWORD lpdwSize) +BOOL WINAPI InternetGetCookieExA(LPCSTR lpszUrl, LPCSTR lpszCookieName, + LPSTR lpCookieData, LPDWORD lpdwSize, DWORD flags, void *reserved) { WCHAR *url, *name; DWORD len, size; BOOL r; - TRACE("(%s %s %p %p(%u))\n", debugstr_a(lpszUrl), debugstr_a(lpszCookieName), - lpCookieData, lpdwSize, lpdwSize ? *lpdwSize : 0); + TRACE("(%s %s %p %p(%u) %x %p)\n", debugstr_a(lpszUrl), debugstr_a(lpszCookieName), + lpCookieData, lpdwSize, lpdwSize ? *lpdwSize : 0, flags, reserved); url = heap_strdupAtoW(lpszUrl); name = heap_strdupAtoW(lpszCookieName); - r = InternetGetCookieW( url, name, NULL, &len ); + r = InternetGetCookieExW( url, name, NULL, &len, flags, reserved ); if( r ) { WCHAR *szCookieData; @@ -725,7 +742,7 @@ } else { - r = InternetGetCookieW( url, name, szCookieData, &len ); + r = InternetGetCookieExW( url, name, szCookieData, &len, flags, reserved ); if(r) { size = WideCharToMultiByte( CP_ACP, 0, szCookieData, len, NULL, 0, NULL, NULL); @@ -748,6 +765,17 @@ return r; } +/*********************************************************************** + * InternetGetCookieA (WININET.@) + * + * See InternetGetCookieW. + */ +BOOL WINAPI InternetGetCookieA(const char *url, const char *name, char *data, DWORD *size) +{ + TRACE("(%s, %s, %s, %p)\n", debugstr_a(url), debugstr_a(name), debugstr_a(data), size); + + return InternetGetCookieExA(url, name, data, size, 0, NULL); +} /*********************************************************************** * IsDomainLegalCookieDomainW (WININET.@) @@ -785,7 +813,7 @@ return TRUE; } -BOOL set_cookie(LPCWSTR domain, LPCWSTR path, LPCWSTR cookie_name, LPCWSTR cookie_data) +DWORD set_cookie(const WCHAR *domain, const WCHAR *path, const WCHAR *cookie_name, const WCHAR *cookie_data, DWORD flags) { cookie_domain *thisCookieDomain = NULL; cookie *thisCookie; @@ -794,13 +822,13 @@ WCHAR *ptr; FILETIME expiry, create; BOOL expired = FALSE, update_persistent = FALSE; - DWORD flags = 0; + DWORD cookie_flags = 0; value = data = heap_strdupW(cookie_data); if (!data) { ERR("could not allocate the cookie data buffer\n"); - return FALSE; + return COOKIE_STATE_UNKNOWN; } memset(&expiry,0,sizeof(expiry)); @@ -826,7 +854,7 @@ { heap_free(data); ERR("could not allocate the cookie value buffer\n"); - return FALSE; + return COOKIE_STATE_UNKNOWN; } strcpyW(value, data); @@ -848,7 +876,7 @@ if(value != data) heap_free(value); heap_free(data); - return FALSE; + return COOKIE_STATE_UNKNOWN; } if(end_ptr) @@ -885,7 +913,15 @@ } else if (strncmpiW(ptr, szHttpOnly, 8) == 0) { - FIXME("httponly not handled (%s)\n",debugstr_w(ptr)); + if(!(flags & INTERNET_COOKIE_HTTPONLY)) { + WARN("HTTP only cookie added without INTERNET_COOKIE_HTTPONLY flag\n"); + heap_free(data); + if (value != data) heap_free(value); + SetLastError(ERROR_INVALID_OPERATION); + return COOKIE_STATE_REJECT; + } + + cookie_flags |= INTERNET_COOKIE_HTTPONLY; ptr += strlenW(szHttpOnly); } else if (*ptr) @@ -916,17 +952,25 @@ heap_free(data); if (value != data) heap_free(value); LeaveCriticalSection(&cookie_cs); - return TRUE; + return COOKIE_STATE_ACCEPT; } } if(!expiry.dwLowDateTime && !expiry.dwHighDateTime) - flags |= INTERNET_COOKIE_IS_SESSION; + cookie_flags |= INTERNET_COOKIE_IS_SESSION; else update_persistent = TRUE; if ((thisCookie = COOKIE_findCookie(thisCookieDomain, cookie_name))) { + if ((thisCookie->flags & INTERNET_COOKIE_HTTPONLY) && !(flags & INTERNET_COOKIE_HTTPONLY)) { + WARN("An attempt to override httponly cookie\n"); + SetLastError(ERROR_INVALID_OPERATION); + heap_free(data); + if (value != data) heap_free(value); + return COOKIE_STATE_REJECT; + } + if (!(thisCookie->flags & INTERNET_COOKIE_IS_SESSION)) update_persistent = TRUE; COOKIE_deleteCookie(thisCookie, FALSE); @@ -935,12 +979,12 @@ TRACE("setting cookie %s=%s for domain %s path %s\n", debugstr_w(cookie_name), debugstr_w(value), debugstr_w(thisCookieDomain->lpCookieDomain),debugstr_w(thisCookieDomain->lpCookiePath)); - if (!expired && !COOKIE_addCookie(thisCookieDomain, cookie_name, value, expiry, create, flags)) + if (!expired && !COOKIE_addCookie(thisCookieDomain, cookie_name, value, expiry, create, cookie_flags)) { heap_free(data); if (value != data) heap_free(value); LeaveCriticalSection(&cookie_cs); - return FALSE; + return COOKIE_STATE_UNKNOWN; } heap_free(data); if (value != data) heap_free(value); @@ -948,50 +992,49 @@ if (!update_persistent || save_persistent_cookie(thisCookieDomain)) { LeaveCriticalSection(&cookie_cs); - return TRUE; + return COOKIE_STATE_ACCEPT; } LeaveCriticalSection(&cookie_cs); - return FALSE; + return COOKIE_STATE_UNKNOWN; } /*********************************************************************** - * InternetSetCookieW (WININET.@) + * InternetSetCookieExW (WININET.@) * * Sets cookie for the specified url - * - * RETURNS - * TRUE on success - * FALSE on failure - * */ -BOOL WINAPI InternetSetCookieW(LPCWSTR lpszUrl, LPCWSTR lpszCookieName, - LPCWSTR lpCookieData) +DWORD WINAPI InternetSetCookieExW(LPCWSTR lpszUrl, LPCWSTR lpszCookieName, + LPCWSTR lpCookieData, DWORD flags, DWORD_PTR reserved) { BOOL ret; WCHAR hostName[INTERNET_MAX_HOST_NAME_LENGTH], path[INTERNET_MAX_PATH_LENGTH]; - TRACE("(%s,%s,%s)\n", debugstr_w(lpszUrl), - debugstr_w(lpszCookieName), debugstr_w(lpCookieData)); + TRACE("(%s, %s, %s, %x, %lx)\n", debugstr_w(lpszUrl), debugstr_w(lpszCookieName), + debugstr_w(lpCookieData), flags, reserved); + + if (flags & ~INTERNET_COOKIE_HTTPONLY) + FIXME("flags %x not supported\n", flags); if (!lpszUrl || !lpCookieData) { SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; + return COOKIE_STATE_UNKNOWN; } hostName[0] = 0; ret = COOKIE_crackUrlSimple(lpszUrl, hostName, sizeof(hostName)/sizeof(hostName[0]), path, sizeof(path)/sizeof(path[0])); - if (!ret || !hostName[0]) return FALSE; + if (!ret || !hostName[0]) return COOKIE_STATE_UNKNOWN; if (!lpszCookieName) { WCHAR *cookie, *data; + DWORD res; cookie = heap_strdupW(lpCookieData); if (!cookie) { SetLastError(ERROR_OUTOFMEMORY); - return FALSE; + return COOKIE_STATE_UNKNOWN; } /* some apps (or is it us??) try to add a cookie with no cookie name, but @@ -1000,14 +1043,25 @@ if (!(data = strchrW(cookie, '='))) data = cookie + strlenW(cookie); else *data++ = 0; - ret = set_cookie(hostName, path, cookie, data); + res = set_cookie(hostName, path, cookie, data, flags); heap_free(cookie); - return ret; + return res; } - return set_cookie(hostName, path, lpszCookieName, lpCookieData); + return set_cookie(hostName, path, lpszCookieName, lpCookieData, flags); } +/*********************************************************************** + * InternetSetCookieW (WININET.@) + * + * Sets a cookie for the specified URL. + */ +BOOL WINAPI InternetSetCookieW(const WCHAR *url, const WCHAR *name, const WCHAR *data) +{ + TRACE("(%s, %s, %s)\n", debugstr_w(url), debugstr_w(name), debugstr_w(data)); + + return InternetSetCookieExW(url, name, data, 0, 0) == COOKIE_STATE_ACCEPT; +} /*********************************************************************** * InternetSetCookieA (WININET.@) @@ -1048,70 +1102,22 @@ DWORD WINAPI InternetSetCookieExA( LPCSTR lpszURL, LPCSTR lpszCookieName, LPCSTR lpszCookieData, DWORD dwFlags, DWORD_PTR dwReserved) { - TRACE("(%s, %s, %s, 0x%08x, 0x%08lx)\n", - debugstr_a(lpszURL), debugstr_a(lpszCookieName), debugstr_a(lpszCookieData), - dwFlags, dwReserved); - - if (dwFlags) FIXME("flags 0x%08x not supported\n", dwFlags); - return InternetSetCookieA(lpszURL, lpszCookieName, lpszCookieData); -} - -/*********************************************************************** - * InternetSetCookieExW (WININET.@) - * - * Sets a cookie for the specified URL. - * - * RETURNS - * TRUE on success - * FALSE on failure - * - */ -DWORD WINAPI InternetSetCookieExW( LPCWSTR lpszURL, LPCWSTR lpszCookieName, LPCWSTR lpszCookieData, - DWORD dwFlags, DWORD_PTR dwReserved) -{ - TRACE("(%s, %s, %s, 0x%08x, 0x%08lx)\n", - debugstr_w(lpszURL), debugstr_w(lpszCookieName), debugstr_w(lpszCookieData), - dwFlags, dwReserved); + WCHAR *data, *url, *name; + DWORD r; - if (dwFlags) FIXME("flags 0x%08x not supported\n", dwFlags); - return InternetSetCookieW(lpszURL, lpszCookieName, lpszCookieData); -} + TRACE("(%s, %s, %s, %x, %lx)\n", debugstr_a(lpszURL), debugstr_a(lpszCookieName), + debugstr_a(lpszCookieData), dwFlags, dwReserved); -/*********************************************************************** - * InternetGetCookieExA (WININET.@) - * - * See InternetGetCookieExW. - */ -BOOL WINAPI InternetGetCookieExA( LPCSTR pchURL, LPCSTR pchCookieName, LPSTR pchCookieData, - LPDWORD pcchCookieData, DWORD dwFlags, LPVOID lpReserved) -{ - TRACE("(%s, %s, %s, %p, 0x%08x, %p)\n", - debugstr_a(pchURL), debugstr_a(pchCookieName), debugstr_a(pchCookieData), - pcchCookieData, dwFlags, lpReserved); + url = heap_strdupAtoW(lpszURL); + name = heap_strdupAtoW(lpszCookieName); + data = heap_strdupAtoW(lpszCookieData); - if (dwFlags) FIXME("flags 0x%08x not supported\n", dwFlags); - return InternetGetCookieA(pchURL, pchCookieName, pchCookieData, pcchCookieData); -} + r = InternetSetCookieExW(url, name, data, dwFlags, dwReserved); -/*********************************************************************** - * InternetGetCookieExW (WININET.@) - * - * Retrieve cookie for the specified URL. - * - * RETURNS - * TRUE on success - * FALSE on failure - * - */ -BOOL WINAPI InternetGetCookieExW( LPCWSTR pchURL, LPCWSTR pchCookieName, LPWSTR pchCookieData, - LPDWORD pcchCookieData, DWORD dwFlags, LPVOID lpReserved) -{ - TRACE("(%s, %s, %s, %p, 0x%08x, %p)\n", - debugstr_w(pchURL), debugstr_w(pchCookieName), debugstr_w(pchCookieData), - pcchCookieData, dwFlags, lpReserved); - - if (dwFlags) FIXME("flags 0x%08x not supported\n", dwFlags); - return InternetGetCookieW(pchURL, pchCookieName, pchCookieData, pcchCookieData); + heap_free( data ); + heap_free( name ); + heap_free( url ); + return r; } /*********************************************************************** diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/wininet/http.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/wininet/http.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/wininet/http.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/wininet/http.c 2014-07-11 19:15:41.000000000 +0000 @@ -767,7 +767,7 @@ continue; data++; - set_cookie(host->lpszValue, request->path, name, data); + set_cookie(host->lpszValue, request->path, name, data, INTERNET_COOKIE_HTTPONLY); heap_free(name); } } @@ -3589,12 +3589,12 @@ TRACE("returning data: %s\n", debugstr_wn(headers, len / sizeof(WCHAR))); - for (i=0; ilpszValue, request->path, NULL, &cookie_size) != ERROR_SUCCESS) + if(get_cookie(host->lpszValue, request->path, NULL, &cookie_size, INTERNET_COOKIE_HTTPONLY) != ERROR_SUCCESS) return; size = sizeof(cookieW) + cookie_size * sizeof(WCHAR) + sizeof(szCrLf); @@ -4194,7 +4194,7 @@ return; cnt += sprintfW(cookies, cookieW); - get_cookie(host->lpszValue, request->path, cookies+cnt, &cookie_size); + get_cookie(host->lpszValue, request->path, cookies+cnt, &cookie_size, INTERNET_COOKIE_HTTPONLY); strcatW(cookies, szCrLf); HTTP_HttpAddRequestHeadersW(request, cookies, strlenW(cookies), HTTP_ADDREQ_FLAG_REPLACE); diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/wininet/internet.h wine-compholio-1.7.22~ubuntu13.10.1/dlls/wininet/internet.h --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/wininet/internet.h 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/wininet/internet.h 2014-07-11 19:15:41.000000000 +0000 @@ -420,8 +420,8 @@ BOOL GetAddress(LPCWSTR lpszServerName, INTERNET_PORT nServerPort, struct sockaddr *psa, socklen_t *sa_len) DECLSPEC_HIDDEN; -DWORD get_cookie(const WCHAR*,const WCHAR*,WCHAR*,DWORD*) DECLSPEC_HIDDEN; -BOOL set_cookie(const WCHAR*,const WCHAR*,const WCHAR*,const WCHAR*) DECLSPEC_HIDDEN; +DWORD get_cookie(const WCHAR*,const WCHAR*,WCHAR*,DWORD*,DWORD) DECLSPEC_HIDDEN; +DWORD set_cookie(const WCHAR*,const WCHAR*,const WCHAR*,const WCHAR*,DWORD) DECLSPEC_HIDDEN; void INTERNET_SetLastError(DWORD dwError) DECLSPEC_HIDDEN; DWORD INTERNET_GetLastError(void) DECLSPEC_HIDDEN; diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/wininet/tests/http.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/wininet/tests/http.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/wininet/tests/http.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/wininet/tests/http.c 2014-07-11 19:15:41.000000000 +0000 @@ -465,6 +465,7 @@ char *post_data = NULL; BOOL res, on_async = TRUE; CHAR buffer[4000]; + WCHAR wbuffer[4000]; DWORD length, length2, index, exlen = 0, post_len = 0; const char *types[2] = { "*", NULL }; HINTERNET hi, hic = 0, hor = 0; @@ -649,6 +650,37 @@ ok(buffer[length2+1] == 0x77, "Expected 0x77, got %02X\n", buffer[length2+1]); ok(length2 == length, "Value should not have changed: %d != %d\n", length2, length); + length = sizeof(wbuffer)-sizeof(WCHAR); + memset(wbuffer, 0x77, sizeof(wbuffer)); + res = HttpQueryInfoW(hor, HTTP_QUERY_RAW_HEADERS, wbuffer, &length, 0x0); + ok(res, "HttpQueryInfoW(HTTP_QUERY_RAW_HEADERS) failed with error %d\n", GetLastError()); + ok(length % sizeof(WCHAR) == 0, "Expected that length is a multiple of sizeof(WCHAR), got %d.\n", length); + length /= sizeof(WCHAR); + /* show that the function writes data past the length returned */ + ok(wbuffer[length-2], "Expected any header character, got 0x0000\n"); + ok(!wbuffer[length-1], "Expected 0x0000, got %04X\n", wbuffer[length-1]); + ok(!wbuffer[length], "Expected 0x0000, got %04X\n", wbuffer[length]); + ok(wbuffer[length+1] == 0x7777 || broken(wbuffer[length+1] != 0x7777), + "Expected 0x7777, got %04X\n", wbuffer[length+1]); + + length2 = length*sizeof(WCHAR); + res = HttpQueryInfoW(hor,HTTP_QUERY_RAW_HEADERS,wbuffer,&length2,0x0); + ok(!res, "Expected 0x00, got %d\n", res); + ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "Unexpected last error: %d\n", GetLastError()); + ok(length2 % sizeof(WCHAR) == 0, "Expected that length is a multiple of sizeof(WCHAR), got %d.\n", length2); + length2 /= sizeof(WCHAR); + ok(length2 == length+1, "Expected %d, got %d\n", length+1, length2); + /* the in length of the buffer must be +1 but the length returned does not count this */ + length2 = (length+1)*sizeof(WCHAR); + memset(wbuffer, 0x77, sizeof(wbuffer)); + res = HttpQueryInfoW(hor,HTTP_QUERY_RAW_HEADERS,wbuffer,&length2,0x0); + ok(res, "HttpQueryInfoW(HTTP_QUERY_RAW_HEADERS) failed with error %d\n", GetLastError()); + ok(length2 % sizeof(WCHAR) == 0, "Expected that length is a multiple of sizeof(WCHAR), got %d.\n", length2); + length2 /= sizeof(WCHAR); + ok(!wbuffer[length2], "Expected 0x0000, got %04X\n", wbuffer[length2]); + ok(wbuffer[length2+1] == 0x7777, "Expected 0x7777, got %04X\n", wbuffer[length2+1]); + ok(length2 == length, "Value should not have changed: %d != %d\n", length2, length); + length = sizeof(buffer); res = InternetQueryOptionA(hor, INTERNET_OPTION_URL, buffer, &length); ok(res, "InternetQueryOptionA(INTERNET_OPTION_URL) failed: %u\n", GetLastError()); diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/wininet/tests/internet.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/wininet/tests/internet.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/wininet/tests/internet.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/wininet/tests/internet.c 2014-07-11 19:15:41.000000000 +0000 @@ -557,6 +557,61 @@ todo_wine ok(!ret, "InternetSetCookie succeeded\n"); } +static void test_cookie_attrs(void) +{ + char buf[100]; + DWORD size, state; + BOOL ret; + + if(!GetProcAddress(GetModuleHandleA("wininet.dll"), "InternetGetSecurityInfoByURLA")) { + win_skip("Skipping cookie attributes tests. Too old IE.\n"); + return; + } + + ret = InternetSetCookieA("http://cookie.attrs.com/bar", NULL, "A=data; httponly"); + ok(!ret && GetLastError() == ERROR_INVALID_OPERATION, "InternetSetCookie returned: %x (%u)\n", ret, GetLastError()); + + SetLastError(0xdeadbeef); + state = InternetSetCookieExA("http://cookie.attrs.com/bar", NULL, "A=data; httponly", 0, 0); + ok(state == COOKIE_STATE_REJECT && GetLastError() == ERROR_INVALID_OPERATION, + "InternetSetCookieEx returned: %x (%u)\n", ret, GetLastError()); + + size = sizeof(buf); + ret = InternetGetCookieExA("http://cookie.attrs.com/", NULL, buf, &size, INTERNET_COOKIE_HTTPONLY, NULL); + ok(!ret && GetLastError() == ERROR_NO_MORE_ITEMS, "InternetGetCookieEx returned: %x (%u)\n", ret, GetLastError()); + + state = InternetSetCookieExA("http://cookie.attrs.com/bar",NULL,"A=data; httponly", INTERNET_COOKIE_HTTPONLY, 0); + ok(state == COOKIE_STATE_ACCEPT,"InternetSetCookieEx failed: %u\n", GetLastError()); + + size = sizeof(buf); + ret = InternetGetCookieA("http://cookie.attrs.com/", NULL, buf, &size); + ok(!ret && GetLastError() == ERROR_NO_MORE_ITEMS, "InternetGetCookie returned: %x (%u)\n", ret, GetLastError()); + + size = sizeof(buf); + ret = InternetGetCookieExA("http://cookie.attrs.com/", NULL, buf, &size, 0, NULL); + ok(!ret && GetLastError() == ERROR_NO_MORE_ITEMS, "InternetGetCookieEx returned: %x (%u)\n", ret, GetLastError()); + + size = sizeof(buf); + ret = InternetGetCookieExA("http://cookie.attrs.com/", NULL, buf, &size, INTERNET_COOKIE_HTTPONLY, NULL); + ok(ret, "InternetGetCookieEx failed: %u\n", GetLastError()); + ok(!strcmp(buf, "A=data"), "data = %s\n", buf); + + /* Try to override httponly cookie with non-httponly one */ + ret = InternetSetCookieA("http://cookie.attrs.com/bar", NULL, "A=test"); + ok(!ret && GetLastError() == ERROR_INVALID_OPERATION, "InternetSetCookie returned: %x (%u)\n", ret, GetLastError()); + + SetLastError(0xdeadbeef); + state = InternetSetCookieExA("http://cookie.attrs.com/bar", NULL, "A=data", 0, 0); + ok(state == COOKIE_STATE_REJECT && GetLastError() == ERROR_INVALID_OPERATION, + "InternetSetCookieEx returned: %x (%u)\n", ret, GetLastError()); + + size = sizeof(buf); + ret = InternetGetCookieExA("http://cookie.attrs.com/", NULL, buf, &size, INTERNET_COOKIE_HTTPONLY, NULL); + ok(ret, "InternetGetCookieEx failed: %u\n", GetLastError()); + ok(!strcmp(buf, "A=data"), "data = %s\n", buf); + +} + static void test_cookie_url(void) { WCHAR bufw[512]; @@ -1618,6 +1673,7 @@ test_get_cookie(); test_complicated_cookie(); test_cookie_url(); + test_cookie_attrs(); test_version(); test_null(); test_Option_PerConnectionOption(); diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/winmm/playsound.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/winmm/playsound.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/winmm/playsound.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/winmm/playsound.c 2014-07-11 19:15:41.000000000 +0000 @@ -338,6 +338,11 @@ else goto errCleanUp; } hmmio = get_mmioFromProfile(wps->fdwSound, wps->pszSound); + if (!hmmio) + { + wps->fdwSound &= ~SND_ALIAS; + wps->fdwSound |= SND_FILENAME; + } } if (!hmmio && wps->fdwSound & SND_FILENAME) { diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/winspool.drv/info.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/winspool.drv/info.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/winspool.drv/info.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/winspool.drv/info.c 2014-07-11 19:15:41.000000000 +0000 @@ -2361,7 +2361,7 @@ LPSTR pDeviceName, LPDEVMODEA pDevModeOutput, LPDEVMODEA pDevModeInput,DWORD fMode ) { - LPSTR lpName = pDeviceName; + LPSTR lpName = pDeviceName, dupname = NULL; static CHAR port[] = "LPT1:"; LONG ret; @@ -2376,7 +2376,7 @@ SetLastError(ERROR_INVALID_HANDLE); return -1; } - lpName = strdupWtoA(lpNameW); + lpName = dupname = strdupWtoA(lpNameW); } if (!GDI_CallExtDeviceMode16) @@ -2385,14 +2385,15 @@ (LPCSTR)102 ); if (!GDI_CallExtDeviceMode16) { ERR("No CallExtDeviceMode16?\n"); - return -1; + ret = -1; + goto end; } } ret = GDI_CallExtDeviceMode16(hWnd, pDevModeOutput, lpName, port, pDevModeInput, NULL, fMode); - if(!pDeviceName) - HeapFree(GetProcessHeap(),0,lpName); +end: + HeapFree(GetProcessHeap(), 0, dupname); return ret; } diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/dlls/ws2_32/socket.c wine-compholio-1.7.22~ubuntu13.10.1/dlls/ws2_32/socket.c --- wine-compholio-1.7.21~ubuntu13.10.1/dlls/ws2_32/socket.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/dlls/ws2_32/socket.c 2014-07-11 19:15:41.000000000 +0000 @@ -100,7 +100,6 @@ #ifdef HAVE_NETIPX_IPX_H # include -# define HAS_IPX #elif defined(HAVE_LINUX_IPX_H) # ifdef HAVE_ASM_TYPES_H # include @@ -109,6 +108,8 @@ # include # endif # include +#endif +#if defined(SOL_IPX) || defined(SO_DEFAULT_HEADERS) # define HAS_IPX #endif @@ -1237,7 +1238,7 @@ /* don't do anything with lpWSAData->lpVendorInfo */ /* (some apps don't allocate the space for this field) */ - TRACE("succeeded\n"); + TRACE("succeeded starts: %d\n", num_startup); return 0; } @@ -1249,6 +1250,7 @@ { if (num_startup) { num_startup--; + TRACE("pending cleanups: %d\n", num_startup); return 0; } SetLastError(WSANOTINITIALISED); @@ -4758,7 +4760,7 @@ switch(optname) { /* Some options need some conversion before they can be sent to - * setsockopt. The conversions are done here, then they will fall though + * setsockopt. The conversions are done here, then they will fall through * to the general case. Special options that are not passed to * setsockopt follow below that.*/ diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/include/d3dx9shape.h wine-compholio-1.7.22~ubuntu13.10.1/include/d3dx9shape.h --- wine-compholio-1.7.21~ubuntu13.10.1/include/d3dx9shape.h 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/include/d3dx9shape.h 2014-07-11 19:15:41.000000000 +0000 @@ -37,6 +37,8 @@ float extrusion, struct ID3DXMesh **mesh, struct ID3DXBuffer **adjacency, GLYPHMETRICSFLOAT *glyphmetrics); HRESULT WINAPI D3DXCreateTextW(struct IDirect3DDevice9 *device, HDC hdc, const WCHAR *text, float deviation, FLOAT extrusion, struct ID3DXMesh **mesh, struct ID3DXBuffer **adjacency, GLYPHMETRICSFLOAT *glyphmetrics); +HRESULT WINAPI D3DXCreateTorus(struct IDirect3DDevice9 *device, + float innerradius, float outerradius, UINT sides, UINT rings, struct ID3DXMesh **mesh, ID3DXBuffer **adjacency); #define D3DXCreateText WINELIB_NAME_AW(D3DXCreateText) #ifdef __cplusplus diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/include/urlmon.idl wine-compholio-1.7.22~ubuntu13.10.1/include/urlmon.idl --- wine-compholio-1.7.21~ubuntu13.10.1/include/urlmon.idl 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/include/urlmon.idl 2014-07-11 19:15:41.000000000 +0000 @@ -1848,6 +1848,8 @@ cpp_quote("#define Uri_CREATE_IE_SETTINGS 0x2000") cpp_quote("#define Uri_CREATE_NO_IE_SETTINGS 0x4000") cpp_quote("#define Uri_CREATE_NO_ENCODE_FORBIDDEN_CHARACTERS 0x8000") +cpp_quote("#define Uri_CREATE_NORMALIZE_INTL_CHARACTERS 0x00010000") +cpp_quote("#define Uri_CREATE_CANONICALIZE_ABSOLUTE 0x00020000") cpp_quote("#define Uri_DISPLAY_NO_FRAGMENT 0x00000001") cpp_quote("#define Uri_PUNYCODE_IDN_HOST 0x00000002") diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/include/wine/wined3d.h wine-compholio-1.7.22~ubuntu13.10.1/include/wine/wined3d.h --- wine-compholio-1.7.21~ubuntu13.10.1/include/wine/wined3d.h 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/include/wine/wined3d.h 2014-07-11 19:15:41.000000000 +0000 @@ -2414,7 +2414,6 @@ HRESULT __cdecl wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc); HRESULT __cdecl wined3d_surface_restore(struct wined3d_surface *surface); HRESULT __cdecl wined3d_surface_set_overlay_position(struct wined3d_surface *surface, LONG x, LONG y); -void __cdecl wined3d_surface_set_palette(struct wined3d_surface *surface, struct wined3d_palette *palette); DWORD __cdecl wined3d_surface_set_priority(struct wined3d_surface *surface, DWORD new_priority); HRESULT __cdecl wined3d_surface_unmap(struct wined3d_surface *surface); HRESULT __cdecl wined3d_surface_update_desc(struct wined3d_surface *surface, @@ -2449,6 +2448,7 @@ const RGNDATA *dirty_region, DWORD flags); HRESULT __cdecl wined3d_swapchain_set_gamma_ramp(const struct wined3d_swapchain *swapchain, DWORD flags, const struct wined3d_gamma_ramp *ramp); +void __cdecl wined3d_swapchain_set_palette(struct wined3d_swapchain *swapchain, struct wined3d_palette *palette); void __cdecl wined3d_swapchain_set_window(struct wined3d_swapchain *swapchain, HWND window); HRESULT __cdecl wined3d_texture_add_dirty_region(struct wined3d_texture *texture, diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/include/wininet.h wine-compholio-1.7.22~ubuntu13.10.1/include/wininet.h --- wine-compholio-1.7.21~ubuntu13.10.1/include/wininet.h 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/include/wininet.h 2014-07-11 19:15:41.000000000 +0000 @@ -1305,6 +1305,16 @@ BOOLAPI HttpQueryInfoW(HINTERNET ,DWORD ,LPVOID ,LPDWORD ,LPDWORD); #define HttpQueryInfo WINELIB_NAME_AW(HttpQueryInfo) +typedef enum { + COOKIE_STATE_UNKNOWN, + COOKIE_STATE_ACCEPT, + COOKIE_STATE_PROMPT, + COOKIE_STATE_LEASH, + COOKIE_STATE_DOWNGRADE, + COOKIE_STATE_REJECT, + COOKIE_STATE_MAX = COOKIE_STATE_REJECT +} InternetCookieState; + BOOLAPI InternetClearAllPerSiteCookieDecisions(VOID); BOOLAPI InternetEnumPerSiteCookieDecisionA(LPSTR,ULONG *,ULONG *,ULONG); @@ -1321,6 +1331,8 @@ #define INTERNET_COOKIE_IS_RESTRICTED 0x00000200 #define INTERNET_COOKIE_IE6 0x00000400 #define INTERNET_COOKIE_IS_LEGACY 0x00000800 +#define INTERNET_COOKIE_NON_SCRIPT 0x00001000 +#define INTERNET_COOKIE_HTTPONLY 0x00002000 BOOLAPI InternetGetCookieExA(LPCSTR,LPCSTR,LPSTR,LPDWORD,DWORD,LPVOID); BOOLAPI InternetGetCookieExW(LPCWSTR,LPCWSTR,LPWSTR,LPDWORD,DWORD,LPVOID); diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/include/winnls.h wine-compholio-1.7.22~ubuntu13.10.1/include/winnls.h --- wine-compholio-1.7.21~ubuntu13.10.1/include/winnls.h 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/include/winnls.h 2014-07-11 19:15:41.000000000 +0000 @@ -460,6 +460,8 @@ #define C3_IDEOGRAPH 0x0100 #define C3_KASHIDA 0x0200 #define C3_LEXICAL 0x0400 +#define C3_HIGHSURROGATE 0x0800 +#define C3_LOWSURROGATE 0x1000 #define C3_ALPHA 0x8000 #define C3_NOTAPPLICABLE 0x0000 @@ -756,7 +758,9 @@ GEO_FRIENDLYNAME, GEO_OFFICIALNAME, GEO_TIMEZONES, - GEO_OFFICIALLANGUAGES + GEO_OFFICIALLANGUAGES, + GEO_ISO_UN_NUMBER, + GEO_PARENT }; enum SYSGEOCLASS diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/include/winreg.h wine-compholio-1.7.22~ubuntu13.10.1/include/winreg.h --- wine-compholio-1.7.21~ubuntu13.10.1/include/winreg.h 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/include/winreg.h 2014-07-11 19:15:41.000000000 +0000 @@ -169,6 +169,8 @@ WINADVAPI LSTATUS WINAPI RegSaveKeyW(HKEY,LPCWSTR,LPSECURITY_ATTRIBUTES); #define RegSaveKey WINELIB_NAME_AW(RegSaveKey) WINADVAPI LSTATUS WINAPI RegSetKeySecurity(HKEY,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR); +WINADVAPI LSTATUS WINAPI RegSetKeyValueA(HKEY,LPCSTR,LPCSTR,DWORD,const void*,DWORD); +WINADVAPI LSTATUS WINAPI RegSetKeyValueW(HKEY,LPCWSTR,LPCWSTR,DWORD,const void*,DWORD); WINADVAPI LSTATUS WINAPI RegSetValueA(HKEY,LPCSTR,DWORD,LPCSTR,DWORD); WINADVAPI LSTATUS WINAPI RegSetValueW(HKEY,LPCWSTR,DWORD,LPCWSTR,DWORD); #define RegSetValue WINELIB_NAME_AW(RegSetValue) diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/loader/wine.inf.in wine-compholio-1.7.22~ubuntu13.10.1/loader/wine.inf.in --- wine-compholio-1.7.21~ubuntu13.10.1/loader/wine.inf.in 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/loader/wine.inf.in 2014-07-11 19:15:41.000000000 +0000 @@ -640,6 +640,7 @@ HKLM,Software\Microsoft\SystemCertificates,,16 HKLM,Software\Microsoft\TermServLicensing,,16 HKLM,Software\Microsoft\Transaction Server,,16 +HKLM,Software\Microsoft\WBEM,"Installation Directory",2,"%11%\wbem" HKLM,Software\Policies,,16 HKLM,Software\Registered Applications,,16 HKLM,System\CurrentControlSet\Control\Lsa,,16 diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/patches/02-ACL_Extended_Attributes/0003-server-Store-file-security-attributes-with-extended-.patch wine-compholio-1.7.22~ubuntu13.10.1/patches/02-ACL_Extended_Attributes/0003-server-Store-file-security-attributes-with-extended-.patch --- wine-compholio-1.7.21~ubuntu13.10.1/patches/02-ACL_Extended_Attributes/0003-server-Store-file-security-attributes-with-extended-.patch 2014-06-28 05:38:42.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/patches/02-ACL_Extended_Attributes/0003-server-Store-file-security-attributes-with-extended-.patch 2014-07-11 19:37:29.000000000 +0000 @@ -1,4 +1,4 @@ -From 4ae376bebffe60ef378e08528d50c1e5723be739 Mon Sep 17 00:00:00 2001 +From a424efd08ebe4a247b4a3b874137faadb7f59266 Mon Sep 17 00:00:00 2001 From: "Erich E. Hoover" Date: Fri, 18 Apr 2014 15:34:47 -0600 Subject: server: Store file security attributes with extended file @@ -6,11 +6,11 @@ --- configure.ac | 12 ++++++++++++ - server/file.c | 31 +++++++++++++++++++++++++++++++ - 2 files changed, 43 insertions(+) + server/file.c | 39 +++++++++++++++++++++++++++++++++++++++ + 2 files changed, 51 insertions(+) diff --git a/configure.ac b/configure.ac -index 46602d6..99fcb9b 100644 +index c913f9f..2d5d5ee 100644 --- a/configure.ac +++ b/configure.ac @@ -73,6 +73,7 @@ AC_ARG_WITH(pthread, AS_HELP_STRING([--without-pthread],[do not use the pthrea @@ -27,7 +27,7 @@ +if test "x$with_xattr" != "xno" +then -+ AC_CHECK_HEADERS(attr/xattr.h,HAVE_XATTR=1) ++ AC_CHECK_HEADERS(attr/xattr.h sys/extattr.h,HAVE_XATTR=1) +fi +if test "x$with_xattr" == "xyes" +then @@ -40,7 +40,7 @@ AC_SUBST(dlldir,"\${libdir}/wine") diff --git a/server/file.c b/server/file.c -index 1f008ea..ceb57be 100644 +index 1f008ea..951e25b 100644 --- a/server/file.c +++ b/server/file.c @@ -32,6 +32,7 @@ @@ -51,23 +51,27 @@ #include #ifdef HAVE_UTIME_H #include -@@ -39,6 +40,9 @@ +@@ -39,6 +40,13 @@ #ifdef HAVE_POLL_H #include #endif +#ifdef HAVE_ATTR_XATTR_H +#include +#endif ++#ifdef HAVE_SYS_EXTATTR_H ++#include ++#define XATTR_SIZE_MAX 65536 ++#endif #include "ntstatus.h" #define WIN32_NO_STATUS -@@ -178,6 +182,30 @@ static struct object *create_file_obj( struct fd *fd, unsigned int access, mode_ +@@ -178,6 +186,34 @@ static struct object *create_file_obj( struct fd *fd, unsigned int access, mode_ return &file->obj; } +void set_xattr_sd( int fd, const struct security_descriptor *sd ) +{ -+#ifdef HAVE_ATTR_XATTR_H ++#if defined(HAVE_ATTR_XATTR_H) || defined(HAVE_SYS_EXTATTR_H) + char buffer[XATTR_SIZE_MAX]; + int present, len; + const ACL *dacl; @@ -85,14 +89,18 @@ + buffer[0] = SECURITY_DESCRIPTOR_REVISION; + buffer[1] = 0; + memcpy( &buffer[2], sd, len - 2 ); ++#if defined(HAVE_ATTR_XATTR_H) + fsetxattr( fd, "user.wine.sd", buffer, len, 0 ); ++#else ++ extattr_set_fd( fd, EXTATTR_NAMESPACE_USER, "wine.sd", buffer, len ); ++#endif +#endif +} + static struct object *create_file( struct fd *root, const char *nameptr, data_size_t len, unsigned int access, unsigned int sharing, int create, unsigned int options, unsigned int attrs, -@@ -239,6 +267,7 @@ static struct object *create_file( struct fd *root, const char *nameptr, data_si +@@ -239,6 +275,7 @@ static struct object *create_file( struct fd *root, const char *nameptr, data_si /* FIXME: should set error to STATUS_OBJECT_NAME_COLLISION if file existed before */ fd = open_fd( root, name, flags | O_NONBLOCK | O_LARGEFILE, &mode, access, sharing, options ); if (!fd) goto done; @@ -100,7 +108,7 @@ if (S_ISDIR(mode)) obj = create_dir_obj( fd, access, mode ); -@@ -580,6 +609,8 @@ int set_file_sd( struct object *obj, struct fd *fd, const struct security_descri +@@ -580,6 +617,8 @@ int set_file_sd( struct object *obj, struct fd *fd, const struct security_descri mode = st.st_mode & (S_ISUID|S_ISGID|S_ISVTX); mode |= sd_to_mode( sd, owner ); diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/patches/02-ACL_Extended_Attributes/0004-server-Store-user-and-group-inside-stored-extended-f.patch wine-compholio-1.7.22~ubuntu13.10.1/patches/02-ACL_Extended_Attributes/0004-server-Store-user-and-group-inside-stored-extended-f.patch --- wine-compholio-1.7.21~ubuntu13.10.1/patches/02-ACL_Extended_Attributes/0004-server-Store-user-and-group-inside-stored-extended-f.patch 2014-06-28 05:38:42.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/patches/02-ACL_Extended_Attributes/0004-server-Store-user-and-group-inside-stored-extended-f.patch 2014-07-11 19:37:29.000000000 +0000 @@ -1,4 +1,4 @@ -From ea0c98e71750a0a55273c8cfb4a9c8931d3cf510 Mon Sep 17 00:00:00 2001 +From 9b59ad02610a11d39ee8338404fd26021e0458c6 Mon Sep 17 00:00:00 2001 From: "Erich E. Hoover" Date: Fri, 18 Apr 2014 15:35:24 -0600 Subject: server: Store user and group inside stored extended file attribute @@ -9,17 +9,17 @@ 1 file changed, 70 insertions(+), 9 deletions(-) diff --git a/server/file.c b/server/file.c -index ceb57be..b9106a8 100644 +index 951e25b..6981fca 100644 --- a/server/file.c +++ b/server/file.c -@@ -182,11 +182,12 @@ static struct object *create_file_obj( struct fd *fd, unsigned int access, mode_ +@@ -186,11 +186,12 @@ static struct object *create_file_obj( struct fd *fd, unsigned int access, mode_ return &file->obj; } -void set_xattr_sd( int fd, const struct security_descriptor *sd ) +void set_xattr_sd( int fd, const struct security_descriptor *sd, const SID *user, const SID *group ) { - #ifdef HAVE_ATTR_XATTR_H + #if defined(HAVE_ATTR_XATTR_H) || defined(HAVE_SYS_EXTATTR_H) - char buffer[XATTR_SIZE_MAX]; - int present, len; + char buffer[XATTR_SIZE_MAX], *dst_ptr = &buffer[2], *src_ptr = (char *)sd; @@ -28,7 +28,7 @@ const ACL *dacl; /* there's no point in storing the security descriptor if there's no DACL */ -@@ -194,14 +195,52 @@ void set_xattr_sd( int fd, const struct security_descriptor *sd ) +@@ -198,14 +199,52 @@ void set_xattr_sd( int fd, const struct security_descriptor *sd ) dacl = sd_get_dacl( sd, &present ); if (!present || !dacl) return; @@ -80,10 +80,10 @@ + memcpy( dst_ptr, src_ptr, sd->dacl_len ); + src_ptr += sd->dacl_len; + dst_ptr += sd->dacl_len; + #if defined(HAVE_ATTR_XATTR_H) fsetxattr( fd, "user.wine.sd", buffer, len, 0 ); - #endif - } -@@ -211,6 +250,7 @@ static struct object *create_file( struct fd *root, const char *nameptr, data_si + #else +@@ -219,6 +258,7 @@ static struct object *create_file( struct fd *root, const char *nameptr, data_si unsigned int options, unsigned int attrs, const struct security_descriptor *sd ) { @@ -91,7 +91,7 @@ struct object *obj = NULL; struct fd *fd; int flags; -@@ -241,9 +281,12 @@ static struct object *create_file( struct fd *root, const char *nameptr, data_si +@@ -249,9 +289,12 @@ static struct object *create_file( struct fd *root, const char *nameptr, data_si if (sd) { @@ -105,7 +105,7 @@ mode = sd_to_mode( sd, owner ); } else if (options & FILE_DIRECTORY_FILE) -@@ -267,7 +310,7 @@ static struct object *create_file( struct fd *root, const char *nameptr, data_si +@@ -275,7 +318,7 @@ static struct object *create_file( struct fd *root, const char *nameptr, data_si /* FIXME: should set error to STATUS_OBJECT_NAME_COLLISION if file existed before */ fd = open_fd( root, name, flags | O_NONBLOCK | O_LARGEFILE, &mode, access, sharing, options ); if (!fd) goto done; @@ -114,7 +114,7 @@ if (S_ISDIR(mode)) obj = create_dir_obj( fd, access, mode ); -@@ -577,7 +620,7 @@ int set_file_sd( struct object *obj, struct fd *fd, const struct security_descri +@@ -585,7 +628,7 @@ int set_file_sd( struct object *obj, struct fd *fd, const struct security_descri unsigned int set_info ) { int unix_fd = get_unix_fd( fd ); @@ -123,7 +123,7 @@ struct stat st; mode_t mode; -@@ -601,6 +644,24 @@ int set_file_sd( struct object *obj, struct fd *fd, const struct security_descri +@@ -609,6 +652,24 @@ int set_file_sd( struct object *obj, struct fd *fd, const struct security_descri else owner = token_get_user( current->process->token ); @@ -148,7 +148,7 @@ /* group and sacl not supported */ if (set_info & DACL_SECURITY_INFORMATION) -@@ -609,7 +670,7 @@ int set_file_sd( struct object *obj, struct fd *fd, const struct security_descri +@@ -617,7 +678,7 @@ int set_file_sd( struct object *obj, struct fd *fd, const struct security_descri mode = st.st_mode & (S_ISUID|S_ISGID|S_ISVTX); mode |= sd_to_mode( sd, owner ); diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/patches/02-ACL_Extended_Attributes/0005-server-Retrieve-file-security-attributes-with-extend.patch wine-compholio-1.7.22~ubuntu13.10.1/patches/02-ACL_Extended_Attributes/0005-server-Retrieve-file-security-attributes-with-extend.patch --- wine-compholio-1.7.21~ubuntu13.10.1/patches/02-ACL_Extended_Attributes/0005-server-Retrieve-file-security-attributes-with-extend.patch 2014-06-28 05:38:42.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/patches/02-ACL_Extended_Attributes/0005-server-Retrieve-file-security-attributes-with-extend.patch 2014-07-11 19:37:29.000000000 +0000 @@ -1,4 +1,4 @@ -From 4498c57f61bf85fca6eb17afd21c0c7051534f75 Mon Sep 17 00:00:00 2001 +From 0fea62714c3bdf5384f2f47c1985c21470710cfd Mon Sep 17 00:00:00 2001 From: "Erich E. Hoover" Date: Fri, 18 Apr 2014 14:01:35 -0600 Subject: server: Retrieve file security attributes with extended file @@ -7,14 +7,14 @@ --- dlls/advapi32/tests/security.c | 49 ++++++++++++++++++++-------------------- server/change.c | 2 +- - server/file.c | 28 ++++++++++++++++++++--- - 3 files changed, 50 insertions(+), 29 deletions(-) + server/file.c | 38 ++++++++++++++++++++++++++++--- + 3 files changed, 60 insertions(+), 29 deletions(-) diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c -index a0574c4..26cde37 100644 +index f3ccc8e..4352ba6 100644 --- a/dlls/advapi32/tests/security.c +++ b/dlls/advapi32/tests/security.c -@@ -3105,24 +3105,24 @@ static void test_CreateDirectoryA(void) +@@ -3131,24 +3131,24 @@ static void test_CreateDirectoryA(void) bret = pGetAce(pDacl, 0, (VOID **)&ace); ok(bret, "Failed to get Current User ACE.\n"); bret = EqualSid(&ace->SidStart, user_sid); @@ -51,7 +51,7 @@ } LocalFree(pSD); -@@ -3297,23 +3297,22 @@ static void test_GetNamedSecurityInfoA(void) +@@ -3323,23 +3323,22 @@ static void test_GetNamedSecurityInfoA(void) bret = pGetAce(pDacl, 0, (VOID **)&ace); ok(bret, "Failed to get Current User ACE.\n"); bret = EqualSid(&ace->SidStart, user_sid); @@ -81,7 +81,7 @@ } LocalFree(pSD); HeapFree(GetProcessHeap(), 0, user); -@@ -3963,22 +3962,22 @@ static void test_GetSecurityInfo(void) +@@ -3989,22 +3988,22 @@ static void test_GetSecurityInfo(void) bret = pGetAce(pDacl, 0, (VOID **)&ace); ok(bret, "Failed to get Current User ACE.\n"); bret = EqualSid(&ace->SidStart, user_sid); @@ -111,10 +111,10 @@ LocalFree(pSD); CloseHandle(obj); diff --git a/server/change.c b/server/change.c -index c391180..77c01bb 100644 +index c673c48..27dbe25 100644 --- a/server/change.c +++ b/server/change.c -@@ -287,7 +287,7 @@ static struct security_descriptor *dir_get_sd( struct object *obj ) +@@ -290,7 +290,7 @@ static struct security_descriptor *dir_get_sd( struct object *obj ) assert( obj->ops == &dir_ops ); fd = dir_get_fd( obj ); @@ -124,27 +124,37 @@ return sd; } diff --git a/server/file.c b/server/file.c -index b9106a8..c4706b6 100644 +index 6981fca..26962df 100644 --- a/server/file.c +++ b/server/file.c -@@ -496,12 +496,33 @@ struct security_descriptor *mode_to_sd( mode_t mode, const SID *user, const SID +@@ -504,12 +504,43 @@ struct security_descriptor *mode_to_sd( mode_t mode, const SID *user, const SID return sd; } +struct security_descriptor *get_xattr_sd( int fd ) +{ -+#ifdef HAVE_ATTR_XATTR_H ++#if defined(HAVE_ATTR_XATTR_H) || defined(HAVE_SYS_EXTATTR_H) + struct security_descriptor *sd; + char buffer[XATTR_SIZE_MAX]; + int n; + ++#if defined(HAVE_ATTR_XATTR_H) + n = fgetxattr( fd, "user.wine.sd", buffer, sizeof(buffer) ); -+ if (n == -1) return NULL; ++#else ++ n = extattr_get_fd( fd, EXTATTR_NAMESPACE_USER, "wine.sd", buffer, sizeof(buffer) ); ++#endif ++ if (n == -1 || n < 2 + sizeof(struct security_descriptor)) return NULL; ++ + /* validate that we can handle the descriptor */ + if (buffer[0] != SECURITY_DESCRIPTOR_REVISION || buffer[1] != 0) return NULL; + ++ sd = (struct security_descriptor *)&buffer[2]; ++ if (n < 2 + sizeof(struct security_descriptor) + sd->owner_len ++ + sd->group_len + sd->sacl_len + sd->dacl_len) ++ return NULL; ++ + sd = mem_alloc( n - 2 ); -+ memcpy( sd, &buffer[2], n - 2 ); ++ if (sd) memcpy( sd, &buffer[2], n - 2 ); + return sd; +#else + return NULL; @@ -161,7 +171,7 @@ if (unix_fd == -1 || fstat( unix_fd, &st ) == -1) return obj->sd; -@@ -511,9 +532,10 @@ struct security_descriptor *get_file_sd( struct object *obj, struct fd *fd, mode +@@ -519,9 +550,10 @@ struct security_descriptor *get_file_sd( struct object *obj, struct fd *fd, mode (st.st_uid == *uid)) return obj->sd; diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/patches/02-ACL_Extended_Attributes/0011-server-Add-additional-checks-in-get_xattr_sd-to-prev.patch wine-compholio-1.7.22~ubuntu13.10.1/patches/02-ACL_Extended_Attributes/0011-server-Add-additional-checks-in-get_xattr_sd-to-prev.patch --- wine-compholio-1.7.21~ubuntu13.10.1/patches/02-ACL_Extended_Attributes/0011-server-Add-additional-checks-in-get_xattr_sd-to-prev.patch 2014-06-28 05:38:42.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/patches/02-ACL_Extended_Attributes/0011-server-Add-additional-checks-in-get_xattr_sd-to-prev.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ -From 8abcd1aac3f65585dfb2e761dd737c0609cd5f93 Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Sun, 1 Jun 2014 23:46:09 +0200 -Subject: server: Add additional checks in get_xattr_sd to prevent crashes - caused by invalid attributes. - ---- - server/file.c | 10 ++++++++-- - 1 file changed, 8 insertions(+), 2 deletions(-) - -diff --git a/server/file.c b/server/file.c -index 08231a7..11522c3 100644 ---- a/server/file.c -+++ b/server/file.c -@@ -738,12 +738,18 @@ struct security_descriptor *get_xattr_sd( int fd ) - int n; - - n = fgetxattr( fd, "user.wine.sd", buffer, sizeof(buffer) ); -- if (n == -1) return NULL; -+ if (n == -1 || n < 2 + sizeof(struct security_descriptor)) return NULL; -+ - /* validate that we can handle the descriptor */ - if (buffer[0] != SECURITY_DESCRIPTOR_REVISION || buffer[1] != 0) return NULL; - -+ sd = (struct security_descriptor *)&buffer[2]; -+ if (n < 2 + sizeof(struct security_descriptor) + sd->owner_len -+ + sd->group_len + sd->sacl_len + sd->dacl_len) -+ return NULL; -+ - sd = mem_alloc( n - 2 ); -- memcpy( sd, &buffer[2], n - 2 ); -+ if (sd) memcpy( sd, &buffer[2], n - 2 ); - return sd; - #else - return NULL; --- -1.7.9.5 - diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/patches/02-ACL_Extended_Attributes/0012-server-Add-support-for-ACLs-xattr-on-FreeBSD.patch wine-compholio-1.7.22~ubuntu13.10.1/patches/02-ACL_Extended_Attributes/0012-server-Add-support-for-ACLs-xattr-on-FreeBSD.patch --- wine-compholio-1.7.21~ubuntu13.10.1/patches/02-ACL_Extended_Attributes/0012-server-Add-support-for-ACLs-xattr-on-FreeBSD.patch 2014-06-28 05:38:42.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/patches/02-ACL_Extended_Attributes/0012-server-Add-support-for-ACLs-xattr-on-FreeBSD.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,80 +0,0 @@ -From 682e63875f4ae2f58da1677ff44cf1adea35e7d8 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Michael=20M=C3=BCller?= -Date: Sun, 1 Jun 2014 22:06:35 +0200 -Subject: server: Add support for ACLs/xattr on FreeBSD - ---- - configure.ac | 2 +- - server/file.c | 16 ++++++++++++++-- - 2 files changed, 15 insertions(+), 3 deletions(-) - -diff --git a/configure.ac b/configure.ac -index 0663893..c1ea0c9 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -668,7 +668,7 @@ AC_CHECK_HEADERS([libprocstat.h],,, - - if test "x$with_xattr" != "xno" - then -- AC_CHECK_HEADERS(attr/xattr.h,HAVE_XATTR=1) -+ AC_CHECK_HEADERS(attr/xattr.h sys/extattr.h,HAVE_XATTR=1) - fi - if test "x$with_xattr" == "xyes" - then -diff --git a/server/file.c b/server/file.c -index d5d5ad4..5a4d2f4 100644 ---- a/server/file.c -+++ b/server/file.c -@@ -43,6 +43,10 @@ - #ifdef HAVE_ATTR_XATTR_H - #include - #endif -+#ifdef HAVE_SYS_EXTATTR_H -+#include -+#define XATTR_SIZE_MAX 65536 -+#endif - - #include "ntstatus.h" - #define WIN32_NO_STATUS -@@ -184,7 +188,7 @@ static struct object *create_file_obj( struct fd *fd, unsigned int access, mode_ - - void set_xattr_sd( int fd, const struct security_descriptor *sd, const SID *user, const SID *group ) - { --#ifdef HAVE_ATTR_XATTR_H -+#if defined(HAVE_ATTR_XATTR_H) || defined(HAVE_SYS_EXTATTR_H) - char buffer[XATTR_SIZE_MAX], *dst_ptr = &buffer[2], *src_ptr = (char *)sd; - int present, len, owner_len, group_len; - struct security_descriptor *dst_sd; -@@ -241,7 +245,11 @@ void set_xattr_sd( int fd, const struct security_descriptor *sd, const SID *user - memcpy( dst_ptr, src_ptr, sd->dacl_len ); - src_ptr += sd->dacl_len; - dst_ptr += sd->dacl_len; -+#if defined(HAVE_ATTR_XATTR_H) - fsetxattr( fd, "user.wine.sd", buffer, len, 0 ); -+#else -+ extattr_set_fd( fd, EXTATTR_NAMESPACE_USER, "wine.sd", buffer, len ); -+#endif - #endif - } - -@@ -732,12 +740,16 @@ struct security_descriptor *mode_to_sd( mode_t mode, const SID *user, const SID - - struct security_descriptor *get_xattr_sd( int fd ) - { --#ifdef HAVE_ATTR_XATTR_H -+#if defined(HAVE_ATTR_XATTR_H) || defined(HAVE_SYS_EXTATTR_H) - struct security_descriptor *sd; - char buffer[XATTR_SIZE_MAX]; - int n; - -+#if defined(HAVE_ATTR_XATTR_H) - n = fgetxattr( fd, "user.wine.sd", buffer, sizeof(buffer) ); -+#else -+ n = extattr_get_fd( fd, EXTATTR_NAMESPACE_USER, "wine.sd", buffer, sizeof(buffer) ); -+#endif - if (n == -1 || n < 2 + sizeof(struct security_descriptor)) return NULL; - - /* validate that we can handle the descriptor */ --- -1.7.9.5 - diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/patches/13-Misc_ACL/0001-server-Add-default-security-descriptor-ownership-for.patch wine-compholio-1.7.22~ubuntu13.10.1/patches/13-Misc_ACL/0001-server-Add-default-security-descriptor-ownership-for.patch --- wine-compholio-1.7.21~ubuntu13.10.1/patches/13-Misc_ACL/0001-server-Add-default-security-descriptor-ownership-for.patch 2014-06-28 05:38:42.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/patches/13-Misc_ACL/0001-server-Add-default-security-descriptor-ownership-for.patch 2014-07-11 19:37:29.000000000 +0000 @@ -1,17 +1,17 @@ -From ccfec2389d48a56f0bfdf54b5f1fde6ead00e345 Mon Sep 17 00:00:00 2001 +From 977d05dff239899b548e170055e2a38ee16d5fd6 Mon Sep 17 00:00:00 2001 From: "Erich E. Hoover" -Date: Tue, 13 May 2014 16:49:31 -0600 +Date: Wed, 25 Jun 2014 11:49:12 -0600 Subject: server: Add default security descriptor ownership for processes. --- - dlls/advapi32/tests/security.c | 34 ++++++++++++++++++++++++++++++++++ + dlls/advapi32/tests/security.c | 35 +++++++++++++++++++++++++++++++++++ server/process.c | 26 +++++++++++++++++++++++++- server/security.h | 1 + server/token.c | 8 ++++++++ - 4 files changed, 68 insertions(+), 1 deletion(-) + 4 files changed, 69 insertions(+), 1 deletion(-) diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c -index 05da0ae..2cf18e0 100644 +index 05da0ae..2fb57c4 100644 --- a/dlls/advapi32/tests/security.c +++ b/dlls/advapi32/tests/security.c @@ -3853,11 +3853,15 @@ static void test_acls(void) @@ -30,10 +30,12 @@ ACL_SIZE_INFORMATION acl_size; PSECURITY_DESCRIPTOR pSD; ACCESS_ALLOWED_ACE *ace; -@@ -3887,6 +3891,18 @@ static void test_GetSecurityInfo(void) - CloseHandle( token ); - user_sid = ((TOKEN_USER *)b)->User.Sid; - +@@ -3982,6 +3986,37 @@ static void test_GetSecurityInfo(void) + } + LocalFree(pSD); + CloseHandle(obj); ++ ++ /* Obtain the "domain users" SID from the user SID */ + if (!AllocateAndInitializeSid(&sia, 4, *GetSidSubAuthority(user_sid, 0), + *GetSidSubAuthority(user_sid, 1), + *GetSidSubAuthority(user_sid, 2), @@ -46,14 +48,6 @@ + pCreateWellKnownSid(WinAccountDomainUsersSid, domain_sid, domain_users_sid, &sid_size); + FreeSid(domain_sid); + - /* Create something. Files have lots of associated security info. */ - obj = CreateFileA(myARGV[0], GENERIC_READ|WRITE_DAC, FILE_SHARE_READ, NULL, - OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); -@@ -3982,6 +3998,24 @@ static void test_GetSecurityInfo(void) - } - LocalFree(pSD); - CloseHandle(obj); -+ + /* Test querying the ownership of a process */ + ret = pGetSecurityInfo(GetCurrentProcess(), SE_KERNEL_OBJECT, + OWNER_SECURITY_INFORMATION|GROUP_SECURITY_INFORMATION, diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/patches/13-Misc_ACL/0002-server-Add-default-security-descriptor-DACL-for-proc.patch wine-compholio-1.7.22~ubuntu13.10.1/patches/13-Misc_ACL/0002-server-Add-default-security-descriptor-DACL-for-proc.patch --- wine-compholio-1.7.21~ubuntu13.10.1/patches/13-Misc_ACL/0002-server-Add-default-security-descriptor-DACL-for-proc.patch 2014-06-28 05:38:42.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/patches/13-Misc_ACL/0002-server-Add-default-security-descriptor-DACL-for-proc.patch 2014-07-11 19:37:29.000000000 +0000 @@ -1,6 +1,6 @@ -From 83880f60c7b647123815acb945c090bec17bab47 Mon Sep 17 00:00:00 2001 +From 7e00c939d05fbb097fa22a60fed2e920587f8de6 Mon Sep 17 00:00:00 2001 From: "Erich E. Hoover" -Date: Wed, 14 May 2014 08:14:46 -0600 +Date: Wed, 25 Jun 2014 11:51:05 -0600 Subject: server: Add default security descriptor DACL for processes. --- @@ -9,7 +9,7 @@ 2 files changed, 76 insertions(+), 2 deletions(-) diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c -index 2cf18e0..f767512 100644 +index 2fb57c4..900c3ff 100644 --- a/dlls/advapi32/tests/security.c +++ b/dlls/advapi32/tests/security.c @@ -3858,10 +3858,12 @@ static void test_GetSecurityInfo(void) @@ -33,7 +33,7 @@ DWORD ret; if (!pGetSecurityInfo || !pSetSecurityInfo) -@@ -4016,6 +4019,53 @@ static void test_GetSecurityInfo(void) +@@ -4017,6 +4020,53 @@ static void test_GetSecurityInfo(void) ok(group != NULL, "group should not be NULL\n"); ok(EqualSid(group, domain_users_sid), "Process group SID != Domain Users SID.\n"); LocalFree(pSD); diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/patches/14-UrlCombineW/0001-shlwapi-tests-Add-additional-tests-for-UrlCombine-and-.patch wine-compholio-1.7.22~ubuntu13.10.1/patches/14-UrlCombineW/0001-shlwapi-tests-Add-additional-tests-for-UrlCombine-and-.patch --- wine-compholio-1.7.21~ubuntu13.10.1/patches/14-UrlCombineW/0001-shlwapi-tests-Add-additional-tests-for-UrlCombine-and-.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/patches/14-UrlCombineW/0001-shlwapi-tests-Add-additional-tests-for-UrlCombine-and-.patch 2014-07-11 19:37:29.000000000 +0000 @@ -0,0 +1,126 @@ +From 549999ab13d6078b39210a467753e8b8dfff705e Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Fri, 17 Jan 2014 01:19:41 +0100 +Subject: shlwapi/tests: Add additional tests for UrlCombine and + UrlCanonicalize + +--- + dlls/shlwapi/tests/url.c | 46 ++++++++++++++++++++++++++++++++++++---------- + 1 file changed, 36 insertions(+), 10 deletions(-) + +diff --git a/dlls/shlwapi/tests/url.c b/dlls/shlwapi/tests/url.c +index f53a545..ecbdfab 100644 +--- a/dlls/shlwapi/tests/url.c ++++ b/dlls/shlwapi/tests/url.c +@@ -195,7 +195,15 @@ static const TEST_URL_CANONICALIZE TEST_CANONICALIZE[] = { + {"res://c:\\tests/res\\foo%20bar/strange\\sth", URL_UNESCAPE, S_OK, "res://c:\\tests/res\\foo bar/strange\\sth", FALSE}, + {"A", 0, S_OK, "A", FALSE}, + {"../A", 0, S_OK, "../A", FALSE}, ++ {".\\A", 0, S_OK, ".\\A", FALSE}, ++ {"A\\.\\B", 0, S_OK, "A\\.\\B", FALSE}, + {"A/../B", 0, S_OK, "B", TRUE}, ++ {"A/../B/./../C", 0, S_OK, "C", TRUE}, ++ {"A/../B/./../C", URL_DONT_SIMPLIFY, S_OK, "A/../B/./../C", FALSE}, ++ {".", 0, S_OK, "/", TRUE}, ++ {"./A", 0, S_OK, "A", TRUE}, ++ {"A/./B", 0, S_OK, "A/B", TRUE}, ++ {"/:test\\", 0, S_OK, "/:test\\", TRUE}, + {"/uri-res/N2R?urn:sha1:B3K", URL_DONT_ESCAPE_EXTRA_INFO | URL_WININET_COMPATIBILITY /*0x82000000*/, S_OK, "/uri-res/N2R?urn:sha1:B3K", FALSE} /*LimeWire online installer calls this*/, + {"http:www.winehq.org/dir/../index.html", 0, S_OK, "http:www.winehq.org/index.html"}, + {"http://localhost/test.html", URL_FILE_USE_PATHURL, S_OK, "http://localhost/test.html"}, +@@ -308,6 +316,7 @@ typedef struct _TEST_URL_COMBINE { + DWORD flags; + HRESULT expectret; + const char *expecturl; ++ BOOL todo; + } TEST_URL_COMBINE; + + static const TEST_URL_COMBINE TEST_COMBINE[] = { +@@ -329,6 +338,15 @@ static const TEST_URL_COMBINE TEST_COMBINE[] = { + {"http://www.winehq.org/test14#aaa/bbb#ccc", "#", 0, S_OK, "http://www.winehq.org/test14#"}, + {"http://www.winehq.org/tests/?query=x/y/z", "tests15", 0, S_OK, "http://www.winehq.org/tests/tests15"}, + {"http://www.winehq.org/tests/?query=x/y/z#example", "tests16", 0, S_OK, "http://www.winehq.org/tests/tests16"}, ++ {"http://www.winehq.org/tests17", ".", 0, S_OK, "http://www.winehq.org/", TRUE}, ++ {"http://www.winehq.org/tests18/test", ".", 0, S_OK, "http://www.winehq.org/tests18/", TRUE}, ++ {"http://www.winehq.org/tests19/test", "./", 0, S_OK, "http://www.winehq.org/tests19/", FALSE}, ++ {"http://www.winehq.org/tests20/test", "/", 0, S_OK, "http://www.winehq.org/", FALSE}, ++ {"http://www.winehq.org/tests/test", "./test21", 0, S_OK, "http://www.winehq.org/tests/test21", FALSE}, ++ {"http://www.winehq.org/tests/test", "./test22/../test", 0, S_OK, "http://www.winehq.org/tests/test", FALSE}, ++ {"http://www.winehq.org/tests/", "http://www.winehq.org:80/tests23", 0, S_OK, "http://www.winehq.org/tests23", TRUE}, ++ {"http://www.winehq.org/tests/", "tests24/./test/../test", 0, S_OK, "http://www.winehq.org/tests/tests24/test", FALSE}, ++ {"http://www.winehq.org/tests/./tests25", "./", 0, S_OK, "http://www.winehq.org/tests/", FALSE}, + {"file:///C:\\dir\\file.txt", "test.txt", 0, S_OK, "file:///C:/dir/test.txt"}, + {"file:///C:\\dir\\file.txt#hash\\hash", "test.txt", 0, S_OK, "file:///C:/dir/file.txt#hash/test.txt"}, + {"file:///C:\\dir\\file.html#hash\\hash", "test.html", 0, S_OK, "file:///C:/dir/test.html"}, +@@ -1077,7 +1095,7 @@ static void test_UrlCanonicalizeW(void) + + /* ########################### */ + +-static void test_url_combine(const char *szUrl1, const char *szUrl2, DWORD dwFlags, HRESULT dwExpectReturn, const char *szExpectUrl) ++static void test_url_combine(const char *szUrl1, const char *szUrl2, DWORD dwFlags, HRESULT dwExpectReturn, const char *szExpectUrl, BOOL todo) + { + HRESULT hr; + CHAR szReturnUrl[INTERNET_MAX_URL_LENGTH]; +@@ -1102,34 +1120,42 @@ static void test_url_combine(const char *szUrl1, const char *szUrl2, DWORD dwFla + dwSize = 0; + hr = pUrlCombineA(szUrl1, szUrl2, NULL, &dwSize, dwFlags); + ok(hr == E_POINTER, "Checking length of string, return was 0x%08x, expected 0x%08x\n", hr, E_POINTER); +- ok(dwSize == dwExpectLen+1, "Got length %d, expected %d\n", dwSize, dwExpectLen+1); ++ ok(todo || dwSize == dwExpectLen+1, "Got length %d, expected %d\n", dwSize, dwExpectLen+1); + + dwSize--; + hr = pUrlCombineA(szUrl1, szUrl2, szReturnUrl, &dwSize, dwFlags); + ok(hr == E_POINTER, "UrlCombineA returned 0x%08x, expected 0x%08x\n", hr, E_POINTER); +- ok(dwSize == dwExpectLen+1, "Got length %d, expected %d\n", dwSize, dwExpectLen+1); ++ ok(todo || dwSize == dwExpectLen+1, "Got length %d, expected %d\n", dwSize, dwExpectLen+1); + + hr = pUrlCombineA(szUrl1, szUrl2, szReturnUrl, &dwSize, dwFlags); + ok(hr == dwExpectReturn, "UrlCombineA returned 0x%08x, expected 0x%08x\n", hr, dwExpectReturn); +- ok(dwSize == dwExpectLen, "Got length %d, expected %d\n", dwSize, dwExpectLen); +- if(SUCCEEDED(hr)) { +- ok(strcmp(szReturnUrl,szExpectUrl)==0, "Expected %s, but got %s\n", szExpectUrl, szReturnUrl); ++ ++ if (todo) ++ { ++ todo_wine ok(dwSize == dwExpectLen && (!SUCCEEDED(hr) || strcmp(szReturnUrl, szExpectUrl)==0), ++ "Expected %s (len=%d), but got %s (len=%d)\n", szExpectUrl, dwExpectLen, SUCCEEDED(hr) ? szReturnUrl : "(null)", dwSize); ++ } ++ else ++ { ++ ok(dwSize == dwExpectLen, "Got length %d, expected %d\n", dwSize, dwExpectLen); ++ if (SUCCEEDED(hr)) ++ ok(strcmp(szReturnUrl, szExpectUrl)==0, "Expected %s, but got %s\n", szExpectUrl, szReturnUrl); + } + + if (pUrlCombineW) { + dwSize = 0; + hr = pUrlCombineW(wszUrl1, wszUrl2, NULL, &dwSize, dwFlags); + ok(hr == E_POINTER, "Checking length of string, return was 0x%08x, expected 0x%08x\n", hr, E_POINTER); +- ok(dwSize == dwExpectLen+1, "Got length %d, expected %d\n", dwSize, dwExpectLen+1); ++ ok(todo || dwSize == dwExpectLen+1, "Got length %d, expected %d\n", dwSize, dwExpectLen+1); + + dwSize--; + hr = pUrlCombineW(wszUrl1, wszUrl2, wszReturnUrl, &dwSize, dwFlags); + ok(hr == E_POINTER, "UrlCombineW returned 0x%08x, expected 0x%08x\n", hr, E_POINTER); +- ok(dwSize == dwExpectLen+1, "Got length %d, expected %d\n", dwSize, dwExpectLen+1); ++ ok(todo || dwSize == dwExpectLen+1, "Got length %d, expected %d\n", dwSize, dwExpectLen+1); + + hr = pUrlCombineW(wszUrl1, wszUrl2, wszReturnUrl, &dwSize, dwFlags); + ok(hr == dwExpectReturn, "UrlCombineW returned 0x%08x, expected 0x%08x\n", hr, dwExpectReturn); +- ok(dwSize == dwExpectLen, "Got length %d, expected %d\n", dwSize, dwExpectLen); ++ ok(todo || dwSize == dwExpectLen, "Got length %d, expected %d\n", dwSize, dwExpectLen); + if(SUCCEEDED(hr)) { + wszConvertedUrl = GetWideString(szReturnUrl); + ok(lstrcmpW(wszReturnUrl, wszConvertedUrl)==0, "Strings didn't match between ascii and unicode UrlCombine!\n"); +@@ -1149,7 +1175,7 @@ static void test_UrlCombine(void) + unsigned int i; + for(i=0; i +Date: Fri, 17 Jan 2014 01:27:53 +0100 +Subject: shlwapi: UrlCombineW workaround for relative paths + +--- + dlls/shlwapi/tests/url.c | 4 ++-- + dlls/shlwapi/url.c | 5 ++++- + 2 files changed, 6 insertions(+), 3 deletions(-) + +diff --git a/dlls/shlwapi/tests/url.c b/dlls/shlwapi/tests/url.c +index ecbdfab..8a99f7e 100644 +--- a/dlls/shlwapi/tests/url.c ++++ b/dlls/shlwapi/tests/url.c +@@ -338,8 +338,8 @@ static const TEST_URL_COMBINE TEST_COMBINE[] = { + {"http://www.winehq.org/test14#aaa/bbb#ccc", "#", 0, S_OK, "http://www.winehq.org/test14#"}, + {"http://www.winehq.org/tests/?query=x/y/z", "tests15", 0, S_OK, "http://www.winehq.org/tests/tests15"}, + {"http://www.winehq.org/tests/?query=x/y/z#example", "tests16", 0, S_OK, "http://www.winehq.org/tests/tests16"}, +- {"http://www.winehq.org/tests17", ".", 0, S_OK, "http://www.winehq.org/", TRUE}, +- {"http://www.winehq.org/tests18/test", ".", 0, S_OK, "http://www.winehq.org/tests18/", TRUE}, ++ {"http://www.winehq.org/tests17", ".", 0, S_OK, "http://www.winehq.org/"}, ++ {"http://www.winehq.org/tests18/test", ".", 0, S_OK, "http://www.winehq.org/tests18/"}, + {"http://www.winehq.org/tests19/test", "./", 0, S_OK, "http://www.winehq.org/tests19/", FALSE}, + {"http://www.winehq.org/tests20/test", "/", 0, S_OK, "http://www.winehq.org/", FALSE}, + {"http://www.winehq.org/tests/test", "./test21", 0, S_OK, "http://www.winehq.org/tests/test21", FALSE}, +diff --git a/dlls/shlwapi/url.c b/dlls/shlwapi/url.c +index 11589e4..58eb87c 100644 +--- a/dlls/shlwapi/url.c ++++ b/dlls/shlwapi/url.c +@@ -914,7 +914,10 @@ HRESULT WINAPI UrlCombineW(LPCWSTR pszBase, LPCWSTR pszRelative, + work = preliminary + base.cchProtocol+1+base.cchSuffix - 1; + if (*work++ != '/') + *(work++) = '/'; +- strcpyW(work, relative.pszSuffix); ++ if (relative.pszSuffix[0] == '.' && relative.pszSuffix[1] == 0) ++ *work = 0; ++ else ++ strcpyW(work, relative.pszSuffix); + break; + + default: +-- +1.7.9.5 + diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/patches/14-UrlCombineW/e46b26df-3c1b-419c-9579-f0d1e1c50bea.def wine-compholio-1.7.22~ubuntu13.10.1/patches/14-UrlCombineW/e46b26df-3c1b-419c-9579-f0d1e1c50bea.def --- wine-compholio-1.7.21~ubuntu13.10.1/patches/14-UrlCombineW/e46b26df-3c1b-419c-9579-f0d1e1c50bea.def 1970-01-01 00:00:00.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/patches/14-UrlCombineW/e46b26df-3c1b-419c-9579-f0d1e1c50bea.def 2014-07-11 19:37:29.000000000 +0000 @@ -0,0 +1,3 @@ +Revision: 1 +Author: Sebastian Lackner +Title: Workaround for broken implementation of shlwapi url functions. diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/patches/15-wtsapi32/0001-wtsapi32-Partial-implementation-of-WTSEnumerateProce.patch wine-compholio-1.7.22~ubuntu13.10.1/patches/15-wtsapi32/0001-wtsapi32-Partial-implementation-of-WTSEnumerateProce.patch --- wine-compholio-1.7.21~ubuntu13.10.1/patches/15-wtsapi32/0001-wtsapi32-Partial-implementation-of-WTSEnumerateProce.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/patches/15-wtsapi32/0001-wtsapi32-Partial-implementation-of-WTSEnumerateProce.patch 2014-07-11 19:37:29.000000000 +0000 @@ -0,0 +1,142 @@ +From 828665a6803984db12958dfe7e9c735c192ae257 Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Sun, 22 Jun 2014 19:04:38 +0200 +Subject: wtsapi32: Partial implementation of WTSEnumerateProcessesW. + +--- + dlls/wtsapi32/tests/wtsapi.c | 1 - + dlls/wtsapi32/wtsapi32.c | 82 ++++++++++++++++++++++++++++++++++++++---- + 2 files changed, 75 insertions(+), 8 deletions(-) + +diff --git a/dlls/wtsapi32/tests/wtsapi.c b/dlls/wtsapi32/tests/wtsapi.c +index e8dced7..a317e5f 100644 +--- a/dlls/wtsapi32/tests/wtsapi.c ++++ b/dlls/wtsapi32/tests/wtsapi.c +@@ -85,7 +85,6 @@ static void test_WTSEnumerateProcessesW(void) + { + found = found || !lstrcmpW(pname, info[i].pProcessName); + } +- todo_wine + ok(found || broken(!ret), "process name %s not found\n", wine_dbgstr_w(pname)); + if (info) WTSFreeMemory(info); + } +diff --git a/dlls/wtsapi32/wtsapi32.c b/dlls/wtsapi32/wtsapi32.c +index 79d5a7f..9457143 100644 +--- a/dlls/wtsapi32/wtsapi32.c ++++ b/dlls/wtsapi32/wtsapi32.c +@@ -18,8 +18,11 @@ + #include "config.h" + #include + #include ++#include "ntstatus.h" ++#define WIN32_NO_STATUS + #include "windef.h" + #include "winbase.h" ++#include "winternl.h" + #include "wtsapi32.h" + #include "wine/debug.h" + +@@ -84,8 +87,13 @@ BOOL WINAPI WTSEnumerateProcessesA(HANDLE hServer, DWORD Reserved, DWORD Version + BOOL WINAPI WTSEnumerateProcessesW(HANDLE hServer, DWORD Reserved, DWORD Version, + PWTS_PROCESS_INFOW* ppProcessInfo, DWORD* pCount) + { +- FIXME("Stub %p 0x%08x 0x%08x %p %p\n", hServer, Reserved, Version, +- ppProcessInfo, pCount); ++ WTS_PROCESS_INFOW *processInfo; ++ SYSTEM_PROCESS_INFORMATION *spi; ++ ULONG size = 0x4000; ++ void *buf = NULL; ++ NTSTATUS status; ++ DWORD count; ++ WCHAR *name; + + if (!ppProcessInfo || !pCount || Reserved != 0 || Version != 1) + { +@@ -93,9 +101,71 @@ BOOL WINAPI WTSEnumerateProcessesW(HANDLE hServer, DWORD Reserved, DWORD Version + return FALSE; + } + +- *pCount = 0; +- *ppProcessInfo = NULL; ++ if (hServer != WTS_CURRENT_SERVER_HANDLE) ++ { ++ SetLastError(ERROR_CALL_NOT_IMPLEMENTED); ++ return FALSE; ++ } ++ ++ do ++ { ++ size *= 2; ++ HeapFree(GetProcessHeap(), 0, buf); ++ buf = HeapAlloc(GetProcessHeap(), 0, size); ++ if (!buf) ++ { ++ SetLastError(ERROR_OUTOFMEMORY); ++ return FALSE; ++ } ++ status = NtQuerySystemInformation(SystemProcessInformation, buf, size, NULL); ++ } ++ while (status == STATUS_INFO_LENGTH_MISMATCH); ++ ++ if (status != STATUS_SUCCESS) ++ { ++ HeapFree(GetProcessHeap(), 0, buf); ++ SetLastError(RtlNtStatusToDosError(status)); ++ return FALSE; ++ } + ++ spi = buf; ++ count = size = 0; ++ for (;;) ++ { ++ size += sizeof(WTS_PROCESS_INFOW) + spi->ProcessName.Length + sizeof(WCHAR); ++ count++; ++ if (spi->NextEntryOffset == 0) break; ++ spi = (SYSTEM_PROCESS_INFORMATION *)(((PCHAR)spi) + spi->NextEntryOffset); ++ } ++ ++ processInfo = HeapAlloc(GetProcessHeap(), 0, size); ++ if (!processInfo) ++ { ++ HeapFree(GetProcessHeap(), 0, buf); ++ SetLastError(ERROR_OUTOFMEMORY); ++ return FALSE; ++ } ++ name = (WCHAR *)&processInfo[count]; ++ ++ *ppProcessInfo = processInfo; ++ *pCount = count; ++ ++ spi = buf; ++ while (count--) ++ { ++ processInfo->SessionId = 0; ++ processInfo->ProcessId = HandleToUlong(spi->UniqueProcessId); ++ processInfo->pProcessName = name; ++ processInfo->pUserSid = NULL; ++ memcpy( name, spi->ProcessName.Buffer, spi->ProcessName.Length ); ++ name[ spi->ProcessName.Length/sizeof(WCHAR) ] = 0; ++ ++ processInfo++; ++ name += (spi->ProcessName.Length + sizeof(WCHAR))/sizeof(WCHAR); ++ spi = (SYSTEM_PROCESS_INFORMATION *)(((PCHAR)spi) + spi->NextEntryOffset); ++ } ++ ++ HeapFree(GetProcessHeap(), 0, buf); + return TRUE; + } + +@@ -159,9 +229,7 @@ BOOL WINAPI WTSEnumerateSessionsW(HANDLE hServer, DWORD Reserved, DWORD Version, + */ + void WINAPI WTSFreeMemory(PVOID pMemory) + { +- static int once; +- +- if (!once++) FIXME("Stub %p\n", pMemory); ++ HeapFree(GetProcessHeap(), 0, pMemory); + } + + /************************************************************ +-- +1.7.9.5 + diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/patches/15-wtsapi32/3790a2d5-f930-423e-9c03-f7fc1c1e0811.def wine-compholio-1.7.22~ubuntu13.10.1/patches/15-wtsapi32/3790a2d5-f930-423e-9c03-f7fc1c1e0811.def --- wine-compholio-1.7.21~ubuntu13.10.1/patches/15-wtsapi32/3790a2d5-f930-423e-9c03-f7fc1c1e0811.def 1970-01-01 00:00:00.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/patches/15-wtsapi32/3790a2d5-f930-423e-9c03-f7fc1c1e0811.def 2014-07-11 19:37:29.000000000 +0000 @@ -0,0 +1,3 @@ +Revision: 1 +Author: Sebastian Lackner +Title: Partial implementation of WTSEnumerateProcessesW. diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/patches/16-server-CreateProcess_ACLs/0001-server-A-new-function-set_sd_defaults_from_token-try.patch wine-compholio-1.7.22~ubuntu13.10.1/patches/16-server-CreateProcess_ACLs/0001-server-A-new-function-set_sd_defaults_from_token-try.patch --- wine-compholio-1.7.21~ubuntu13.10.1/patches/16-server-CreateProcess_ACLs/0001-server-A-new-function-set_sd_defaults_from_token-try.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/patches/16-server-CreateProcess_ACLs/0001-server-A-new-function-set_sd_defaults_from_token-try.patch 2014-07-11 19:37:29.000000000 +0000 @@ -0,0 +1,103 @@ +From 91fb6970f6b7f5a5c93d066c143e96398fba294e Mon Sep 17 00:00:00 2001 +From: Joris van der Wel +Date: Wed, 9 Jul 2014 00:58:10 +0200 +Subject: server: A new function "set_sd_defaults_from_token" (try 3) + +server: A new function "set_sd_defaults_from_token" that sets the + security descriptor along with a token that will be used to gather +defaults, instead of always using the primary token. + +Some objects take their defaults not from a primary token but from a +different one +(such as from the impersonation token or the process token). +This function can be used to create the various set_sd implementations +for the objects that need it. +As a bonus, a NULL token will skip setting any defaults, this is +useful for object implementations that would like to set their +defaults _only_ upon creation. +--- + server/object.c | 23 +++++++++++++++-------- + server/object.h | 2 ++ + 2 files changed, 17 insertions(+), 8 deletions(-) + +diff --git a/server/object.c b/server/object.c +index 11ef0ce..6389409 100644 +--- a/server/object.c ++++ b/server/object.c +@@ -423,8 +423,8 @@ struct security_descriptor *default_get_sd( struct object *obj ) + return obj->sd; + } + +-int default_set_sd( struct object *obj, const struct security_descriptor *sd, +- unsigned int set_info ) ++int set_sd_defaults_from_token( struct object *obj, const struct security_descriptor *sd, ++ unsigned int set_info, struct token *token ) + { + struct security_descriptor new_sd, *new_sd_ptr; + int present; +@@ -446,9 +446,9 @@ int default_set_sd( struct object *obj, const struct security_descriptor *sd, + owner = sd_get_owner( obj->sd ); + new_sd.owner_len = obj->sd->owner_len; + } +- else ++ else if (token) + { +- owner = token_get_user( current->process->token ); ++ owner = token_get_user( token ); + new_sd.owner_len = security_sid_len( owner ); + } + +@@ -462,9 +462,9 @@ int default_set_sd( struct object *obj, const struct security_descriptor *sd, + group = sd_get_group( obj->sd ); + new_sd.group_len = obj->sd->group_len; + } +- else ++ else if (token) + { +- group = token_get_primary_group( current->process->token ); ++ group = token_get_primary_group( token ); + new_sd.group_len = security_sid_len( group ); + } + +@@ -494,9 +494,9 @@ int default_set_sd( struct object *obj, const struct security_descriptor *sd, + + if (obj->sd && present) + new_sd.dacl_len = obj->sd->dacl_len; +- else ++ else if (token) + { +- dacl = token_get_default_dacl( current->process->token ); ++ dacl = token_get_default_dacl( token ); + new_sd.dacl_len = dacl->AclSize; + } + } +@@ -521,6 +521,13 @@ int default_set_sd( struct object *obj, const struct security_descriptor *sd, + return 1; + } + ++/** Set the security descriptor using the current primary token for defaults. */ ++int default_set_sd( struct object *obj, const struct security_descriptor *sd, ++ unsigned int set_info ) ++{ ++ return set_sd_defaults_from_token( obj, sd, set_info, current->process->token ); ++} ++ + struct object *no_lookup_name( struct object *obj, struct unicode_str *name, + unsigned int attr ) + { +diff --git a/server/object.h b/server/object.h +index bb3ff21..7201ff9 100644 +--- a/server/object.h ++++ b/server/object.h +@@ -139,6 +139,8 @@ extern struct fd *no_get_fd( struct object *obj ); + extern unsigned int no_map_access( struct object *obj, unsigned int access ); + extern struct security_descriptor *default_get_sd( struct object *obj ); + extern int default_set_sd( struct object *obj, const struct security_descriptor *sd, unsigned int set_info ); ++extern int set_sd_defaults_from_token( struct object *obj, const struct security_descriptor *sd, ++ unsigned int set_info, struct token *token ); + extern struct object *no_lookup_name( struct object *obj, struct unicode_str *name, unsigned int attributes ); + extern struct object *no_open_file( struct object *obj, unsigned int access, unsigned int sharing, + unsigned int options ); +-- +1.7.9.5 + diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/patches/16-server-CreateProcess_ACLs/0002-server-Support-sending-process-and-thread-security-d.patch wine-compholio-1.7.22~ubuntu13.10.1/patches/16-server-CreateProcess_ACLs/0002-server-Support-sending-process-and-thread-security-d.patch --- wine-compholio-1.7.21~ubuntu13.10.1/patches/16-server-CreateProcess_ACLs/0002-server-Support-sending-process-and-thread-security-d.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/patches/16-server-CreateProcess_ACLs/0002-server-Support-sending-process-and-thread-security-d.patch 2014-07-11 19:37:29.000000000 +0000 @@ -0,0 +1,176 @@ +From fe16cbc2062778bef273ac84eca992dcc45653e6 Mon Sep 17 00:00:00 2001 +From: Joris van der Wel +Date: Wed, 9 Jul 2014 00:58:47 +0200 +Subject: server: Support sending process and thread security descriptors for + the "new_process" request in the protocol. + +server: Support sending process and thread security descriptors for + the "new_process" request in the protocol. +--- + dlls/kernel32/process.c | 30 +++++++++++++++++------------- + server/process.c | 33 ++++++++++++++++++++------------- + server/protocol.def | 41 +++++++++++++++++++++++------------------ + 3 files changed, 60 insertions(+), 44 deletions(-) + +diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c +index 2566ac4..8bf1934 100644 +--- a/dlls/kernel32/process.c ++++ b/dlls/kernel32/process.c +@@ -2025,19 +2025,23 @@ static BOOL create_process( HANDLE hFile, LPCWSTR filename, LPWSTR cmd_line, LPW + + SERVER_START_REQ( new_process ) + { +- req->inherit_all = inherit; +- req->create_flags = flags; +- req->socket_fd = socketfd[1]; +- req->exe_file = wine_server_obj_handle( hFile ); +- req->process_access = PROCESS_ALL_ACCESS; +- req->process_attr = (psa && (psa->nLength >= sizeof(*psa)) && psa->bInheritHandle) ? OBJ_INHERIT : 0; +- req->thread_access = THREAD_ALL_ACCESS; +- req->thread_attr = (tsa && (tsa->nLength >= sizeof(*tsa)) && tsa->bInheritHandle) ? OBJ_INHERIT : 0; +- req->cpu = cpu; +- req->info_size = startup_info_size; +- +- wine_server_add_data( req, startup_info, startup_info_size ); +- wine_server_add_data( req, env, (env_end - env) * sizeof(WCHAR) ); ++ req->inherit_all = inherit; ++ req->create_flags = flags; ++ req->socket_fd = socketfd[1]; ++ req->exe_file = wine_server_obj_handle( hFile ); ++ req->process_access = PROCESS_ALL_ACCESS; ++ req->process_attr = (psa && (psa->nLength >= sizeof(*psa)) && psa->bInheritHandle) ? OBJ_INHERIT : 0; ++ req->thread_access = THREAD_ALL_ACCESS; ++ req->thread_attr = (tsa && (tsa->nLength >= sizeof(*tsa)) && tsa->bInheritHandle) ? OBJ_INHERIT : 0; ++ req->cpu = cpu; ++ req->process_sd_size = 0; ++ req->thread_sd_size = 0; ++ req->info_size = startup_info_size; ++ req->env_size = (env_end - env) * sizeof(WCHAR); ++ ++ wine_server_add_data( req, startup_info, req->info_size ); ++ wine_server_add_data( req, env , req->env_size ); ++ + if (!(status = wine_server_call( req ))) + { + info->dwProcessId = (DWORD)reply->pid; +diff --git a/server/process.c b/server/process.c +index 7b9a3b2..9942eb3 100644 +--- a/server/process.c ++++ b/server/process.c +@@ -880,6 +880,9 @@ DECL_HANDLER(new_process) + struct process *process; + struct process *parent = current->process; + int socket_fd = thread_get_inflight_fd( current, req->socket_fd ); ++ const startup_info_t *req_info; ++ data_size_t req_info_size; ++ const WCHAR *req_env; + + if (socket_fd == -1) + { +@@ -903,6 +906,12 @@ DECL_HANDLER(new_process) + close( socket_fd ); + return; + } ++ ++ req_info = (const startup_info_t *) ++ ((char*)get_req_data() + req->process_sd_size + req->thread_sd_size); ++ ++ req_env = (const WCHAR *) ++ ((char*)get_req_data() + req->process_sd_size + req->thread_sd_size + req->info_size); + + if (!req->info_size) /* create an orphaned process */ + { +@@ -920,27 +929,25 @@ DECL_HANDLER(new_process) + !(info->exe_file = get_file_obj( current->process, req->exe_file, FILE_READ_DATA ))) + goto done; + +- info->data_size = get_req_data_size(); +- info->info_size = min( req->info_size, info->data_size ); +- + if (req->info_size < sizeof(*info->data)) + { + /* make sure we have a full startup_info_t structure */ +- data_size_t env_size = info->data_size - info->info_size; +- data_size_t info_size = min( req->info_size, FIELD_OFFSET( startup_info_t, curdir_len )); +- +- if (!(info->data = mem_alloc( sizeof(*info->data) + env_size ))) goto done; +- memcpy( info->data, get_req_data(), info_size ); +- memset( (char *)info->data + info_size, 0, sizeof(*info->data) - info_size ); +- memcpy( info->data + 1, (const char *)get_req_data() + req->info_size, env_size ); +- info->info_size = sizeof(startup_info_t); +- info->data_size = info->info_size + env_size; ++ info->info_size = sizeof(*info->data); ++ info->data_size = sizeof(*info->data) + req->env_size; ++ ++ req_info_size = min( req->info_size, FIELD_OFFSET( startup_info_t, curdir_len )); ++ if (!(info->data = mem_alloc( info->data_size ))) goto done; ++ memset( info->data, 0, info->data_size ); ++ memcpy( info->data, req_info, req_info_size ); ++ memcpy( info->data + 1, req_env, req->env_size ); + } + else + { + data_size_t pos = sizeof(*info->data); ++ info->info_size = req->info_size; ++ info->data_size = req->info_size + req->env_size; + +- if (!(info->data = memdup( get_req_data(), info->data_size ))) goto done; ++ if (!(info->data = memdup( req_info, info->data_size ))) goto done; + #define FIXUP_LEN(len) do { (len) = min( (len), info->info_size - pos ); pos += (len); } while(0) + FIXUP_LEN( info->data->curdir_len ); + FIXUP_LEN( info->data->dllpath_len ); +diff --git a/server/protocol.def b/server/protocol.def +index a8c1fb9..7b0b769 100644 +--- a/server/protocol.def ++++ b/server/protocol.def +@@ -661,24 +661,29 @@ struct rawinput_device + + /* Create a new process from the context of the parent */ + @REQ(new_process) +- int inherit_all; /* inherit all handles from parent */ +- unsigned int create_flags; /* creation flags */ +- int socket_fd; /* file descriptor for process socket */ +- obj_handle_t exe_file; /* file handle for main exe */ +- unsigned int process_access; /* access rights for process object */ +- unsigned int process_attr; /* attributes for process object */ +- unsigned int thread_access; /* access rights for thread object */ +- unsigned int thread_attr; /* attributes for thread object */ +- cpu_type_t cpu; /* CPU that the new process will use */ +- data_size_t info_size; /* size of startup info */ +- VARARG(info,startup_info,info_size); /* startup information */ +- VARARG(env,unicode_str); /* environment for new process */ +-@REPLY +- obj_handle_t info; /* new process info handle */ +- process_id_t pid; /* process id */ +- obj_handle_t phandle; /* process handle (in the current process) */ +- thread_id_t tid; /* thread id */ +- obj_handle_t thandle; /* thread handle (in the current process) */ ++ int inherit_all; /* inherit all handles from parent */ ++ unsigned int create_flags; /* creation flags */ ++ int socket_fd; /* file descriptor for process socket */ ++ obj_handle_t exe_file; /* file handle for main exe */ ++ unsigned int process_access; /* access rights for process object */ ++ unsigned int process_attr; /* attributes for process object */ ++ unsigned int thread_access; /* access rights for thread object */ ++ unsigned int thread_attr; /* attributes for thread object */ ++ cpu_type_t cpu; /* CPU that the new process will use */ ++ data_size_t process_sd_size; /* size of the process security descriptor */ ++ data_size_t thread_sd_size; /* size of the thread security descriptor */ ++ data_size_t info_size; /* size of startup info */ ++ data_size_t env_size; /* size of the environment */ ++ VARARG(process_sd,security_descriptor,process_sd_size); /* security descriptor to set on the process */ ++ VARARG(thread_sd,security_descriptor,thread_sd_size); /* security descriptor to set on the thread */ ++ VARARG(info,startup_info,info_size); /* startup information */ ++ VARARG(env,unicode_str,env_size); /* environment for new process */ ++@REPLY ++ obj_handle_t info; /* new process info handle */ ++ process_id_t pid; /* process id */ ++ obj_handle_t phandle; /* process handle (in the current process) */ ++ thread_id_t tid; /* thread id */ ++ obj_handle_t thandle; /* thread handle (in the current process) */ + @END + + +-- +1.7.9.5 + diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/patches/16-server-CreateProcess_ACLs/0003-server-implement-passing-a-process-security-descript.patch wine-compholio-1.7.22~ubuntu13.10.1/patches/16-server-CreateProcess_ACLs/0003-server-implement-passing-a-process-security-descript.patch --- wine-compholio-1.7.21~ubuntu13.10.1/patches/16-server-CreateProcess_ACLs/0003-server-implement-passing-a-process-security-descript.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/patches/16-server-CreateProcess_ACLs/0003-server-implement-passing-a-process-security-descript.patch 2014-07-11 19:37:29.000000000 +0000 @@ -0,0 +1,242 @@ +From d565d8b72c9f57d5553f72dfd7d18e2e05033c0c Mon Sep 17 00:00:00 2001 +From: Joris van der Wel +Date: Wed, 9 Jul 2014 00:59:30 +0200 +Subject: server: implement passing a process security descriptor to + CreateProcess. + +server: implement passing a process security descriptor to CreateProcess. + +For now the function "NTDLL_create_struct_sd" has been duplicated in +kernel32. +This is needed because kernel32 makes the server call. kernel32 currently +makes the server call because NtCreateProcess(Ex) has not been implemented in +ntdll. When NtCreateProcessEx (and NtCreateThreadEx) gets implemented, the +server call will be made from within ntdll instead, and this extra function +in kernel32 will no longer be needed. +--- + dlls/advapi32/tests/security.c | 3 -- + dlls/kernel32/process.c | 85 +++++++++++++++++++++++++++++++++++++++- + server/process.c | 24 ++++++++++++ + 3 files changed, 108 insertions(+), 4 deletions(-) + +diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c +index b44496a..b1b35aa 100644 +--- a/dlls/advapi32/tests/security.c ++++ b/dlls/advapi32/tests/security.c +@@ -2696,7 +2696,6 @@ static void test_process_security_child(void) + ret = DuplicateHandle( GetCurrentProcess(), handle, GetCurrentProcess(), + &handle1, PROCESS_ALL_ACCESS, TRUE, 0 ); + err = GetLastError(); +- todo_wine + ok(!ret && err == ERROR_ACCESS_DENIED, "duplicating handle should have failed " + "with STATUS_ACCESS_DENIED, instead of err:%d\n", err); + +@@ -2704,10 +2703,8 @@ static void test_process_security_child(void) + + /* These two should fail - they are denied by ACL */ + handle = OpenProcess( PROCESS_VM_READ, FALSE, GetCurrentProcessId() ); +- todo_wine + ok(handle == NULL, "OpenProcess(PROCESS_VM_READ) should have failed\n"); + handle = OpenProcess( PROCESS_ALL_ACCESS, FALSE, GetCurrentProcessId() ); +- todo_wine + ok(handle == NULL, "OpenProcess(PROCESS_ALL_ACCESS) should have failed\n"); + + /* Documented privilege elevation */ +diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c +index 8bf1934..5f6c2e5 100644 +--- a/dlls/kernel32/process.c ++++ b/dlls/kernel32/process.c +@@ -1916,6 +1916,70 @@ static pid_t exec_loader( LPCWSTR cmd_line, unsigned int flags, int socketfd, + return pid; + } + ++/* creates a struct security_descriptor and contained information in one contiguous piece of memory */ ++static NTSTATUS create_struct_sd(PSECURITY_DESCRIPTOR nt_sd, struct security_descriptor **server_sd, ++ data_size_t *server_sd_len) ++{ ++ unsigned int len; ++ PSID owner, group; ++ ACL *dacl, *sacl; ++ BOOLEAN owner_present, group_present, dacl_present, sacl_present; ++ BOOLEAN defaulted; ++ NTSTATUS status; ++ unsigned char *ptr; ++ ++ if (!nt_sd) ++ { ++ *server_sd = NULL; ++ *server_sd_len = 0; ++ return STATUS_SUCCESS; ++ } ++ ++ len = sizeof(struct security_descriptor); ++ ++ status = RtlGetOwnerSecurityDescriptor(nt_sd, &owner, &owner_present); ++ if (status != STATUS_SUCCESS) return status; ++ status = RtlGetGroupSecurityDescriptor(nt_sd, &group, &group_present); ++ if (status != STATUS_SUCCESS) return status; ++ status = RtlGetSaclSecurityDescriptor(nt_sd, &sacl_present, &sacl, &defaulted); ++ if (status != STATUS_SUCCESS) return status; ++ status = RtlGetDaclSecurityDescriptor(nt_sd, &dacl_present, &dacl, &defaulted); ++ if (status != STATUS_SUCCESS) return status; ++ ++ if (owner_present) ++ len += RtlLengthSid(owner); ++ if (group_present) ++ len += RtlLengthSid(group); ++ if (sacl_present && sacl) ++ len += sacl->AclSize; ++ if (dacl_present && dacl) ++ len += dacl->AclSize; ++ ++ /* fix alignment for the Unicode name that follows the structure */ ++ len = (len + sizeof(WCHAR) - 1) & ~(sizeof(WCHAR) - 1); ++ *server_sd = RtlAllocateHeap(GetProcessHeap(), 0, len); ++ if (!*server_sd) return STATUS_NO_MEMORY; ++ ++ (*server_sd)->control = ((SECURITY_DESCRIPTOR *)nt_sd)->Control & ~SE_SELF_RELATIVE; ++ (*server_sd)->owner_len = owner_present ? RtlLengthSid(owner) : 0; ++ (*server_sd)->group_len = group_present ? RtlLengthSid(group) : 0; ++ (*server_sd)->sacl_len = (sacl_present && sacl) ? sacl->AclSize : 0; ++ (*server_sd)->dacl_len = (dacl_present && dacl) ? dacl->AclSize : 0; ++ ++ ptr = (unsigned char *)(*server_sd + 1); ++ memcpy(ptr, owner, (*server_sd)->owner_len); ++ ptr += (*server_sd)->owner_len; ++ memcpy(ptr, group, (*server_sd)->group_len); ++ ptr += (*server_sd)->group_len; ++ memcpy(ptr, sacl, (*server_sd)->sacl_len); ++ ptr += (*server_sd)->sacl_len; ++ memcpy(ptr, dacl, (*server_sd)->dacl_len); ++ ++ *server_sd_len = len; ++ ++ return STATUS_SUCCESS; ++} ++ + /*********************************************************************** + * create_process + * +@@ -1939,17 +2003,31 @@ static BOOL create_process( HANDLE hFile, LPCWSTR filename, LPWSTR cmd_line, LPW + int socketfd[2], stdin_fd = -1, stdout_fd = -1; + pid_t pid; + int err, cpu; ++ struct security_descriptor *psd = NULL; ++ data_size_t psd_len = 0; + + if ((cpu = get_process_cpu( filename, binary_info )) == -1) + { + SetLastError( ERROR_BAD_EXE_FORMAT ); + return FALSE; ++ } ++ ++ if (psa && (psa->nLength >= sizeof(*psa)) && psa->lpSecurityDescriptor) ++ { ++ status = create_struct_sd( psa->lpSecurityDescriptor, &psd, &psd_len ); ++ if (status != STATUS_SUCCESS) ++ { ++ WARN("Invalid process security descriptor with status %x\n", status); ++ SetLastError( RtlNtStatusToDosError(status) ); ++ return FALSE; ++ } + } + + /* create the socket for the new process */ + + if (socketpair( PF_UNIX, SOCK_STREAM, 0, socketfd ) == -1) + { ++ RtlFreeHeap(GetProcessHeap(), 0, psd); + SetLastError( ERROR_TOO_MANY_OPEN_FILES ); + return FALSE; + } +@@ -1989,6 +2067,7 @@ static BOOL create_process( HANDLE hFile, LPCWSTR filename, LPWSTR cmd_line, LPW + winedebug, binary_info, TRUE ); + } + close( socketfd[0] ); ++ RtlFreeHeap(GetProcessHeap(), 0, psd); + SetLastError( RtlNtStatusToDosError( status )); + return FALSE; + } +@@ -2001,6 +2080,7 @@ static BOOL create_process( HANDLE hFile, LPCWSTR filename, LPWSTR cmd_line, LPW + RtlReleasePebLock(); + close( socketfd[0] ); + close( socketfd[1] ); ++ RtlFreeHeap(GetProcessHeap(), 0, psd); + return FALSE; + } + if (!env) env = NtCurrentTeb()->Peb->ProcessParameters->Environment; +@@ -2034,11 +2114,12 @@ static BOOL create_process( HANDLE hFile, LPCWSTR filename, LPWSTR cmd_line, LPW + req->thread_access = THREAD_ALL_ACCESS; + req->thread_attr = (tsa && (tsa->nLength >= sizeof(*tsa)) && tsa->bInheritHandle) ? OBJ_INHERIT : 0; + req->cpu = cpu; +- req->process_sd_size = 0; ++ req->process_sd_size = psd_len; + req->thread_sd_size = 0; + req->info_size = startup_info_size; + req->env_size = (env_end - env) * sizeof(WCHAR); + ++ wine_server_add_data( req, psd , req->process_sd_size ); + wine_server_add_data( req, startup_info, req->info_size ); + wine_server_add_data( req, env , req->env_size ); + +@@ -2053,6 +2134,8 @@ static BOOL create_process( HANDLE hFile, LPCWSTR filename, LPWSTR cmd_line, LPW + } + SERVER_END_REQ; + ++ RtlFreeHeap(GetProcessHeap(), 0, psd); ++ + RtlReleasePebLock(); + if (status) + { +diff --git a/server/process.c b/server/process.c +index 9942eb3..1fba134 100644 +--- a/server/process.c ++++ b/server/process.c +@@ -883,6 +883,7 @@ DECL_HANDLER(new_process) + const startup_info_t *req_info; + data_size_t req_info_size; + const WCHAR *req_env; ++ const struct security_descriptor *req_psd = NULL; + + if (socket_fd == -1) + { +@@ -907,6 +908,17 @@ DECL_HANDLER(new_process) + return; + } + ++ if (req->process_sd_size) ++ { ++ req_psd = get_req_data(); ++ ++ if (!sd_is_valid( req_psd, req->process_sd_size )) ++ { ++ set_error( STATUS_INVALID_SECURITY_DESCR ); ++ return; ++ } ++ } ++ + req_info = (const startup_info_t *) + ((char*)get_req_data() + req->process_sd_size + req->thread_sd_size); + +@@ -1011,6 +1023,18 @@ DECL_HANDLER(new_process) + reply->phandle = alloc_handle( parent, process, req->process_access, req->process_attr ); + reply->thandle = alloc_handle( parent, thread, req->thread_access, req->thread_attr ); + ++ /* note: alloc_handle might fail with access denied ++ * if the security descriptor is set before that call */ ++ ++ if (req_psd) ++ { ++ default_set_sd( &process->obj, ++ req_psd, ++ OWNER_SECURITY_INFORMATION| ++ GROUP_SECURITY_INFORMATION| ++ DACL_SECURITY_INFORMATION| ++ SACL_SECURITY_INFORMATION ); ++ } + done: + release_object( info ); + } +-- +1.7.9.5 + diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/patches/16-server-CreateProcess_ACLs/0004-server-implement-passing-a-thread-security-descripto.patch wine-compholio-1.7.22~ubuntu13.10.1/patches/16-server-CreateProcess_ACLs/0004-server-implement-passing-a-thread-security-descripto.patch --- wine-compholio-1.7.21~ubuntu13.10.1/patches/16-server-CreateProcess_ACLs/0004-server-implement-passing-a-thread-security-descripto.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/patches/16-server-CreateProcess_ACLs/0004-server-implement-passing-a-thread-security-descripto.patch 2014-07-11 19:37:29.000000000 +0000 @@ -0,0 +1,234 @@ +From e924e19cc72127f16b64bef300e394a7f641dba1 Mon Sep 17 00:00:00 2001 +From: Joris van der Wel +Date: Wed, 9 Jul 2014 01:00:02 +0200 +Subject: server: implement passing a thread security descriptor to + CreateProcess + +server: implement passing a thread security descriptor to CreateProcess +--- + dlls/advapi32/tests/security.c | 45 ++++++++++++++++++++++++++++++++++++---- + dlls/kernel32/process.c | 24 ++++++++++++++++++--- + server/process.c | 28 ++++++++++++++++++++++++- + 3 files changed, 89 insertions(+), 8 deletions(-) + +diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c +index b1b35aa..aab63f3 100644 +--- a/dlls/advapi32/tests/security.c ++++ b/dlls/advapi32/tests/security.c +@@ -2532,12 +2532,12 @@ static void test_process_security(void) + PTOKEN_OWNER owner; + PTOKEN_PRIMARY_GROUP group; + PSID AdminSid = NULL, UsersSid = NULL; +- PACL Acl = NULL; +- SECURITY_DESCRIPTOR *SecurityDescriptor = NULL; ++ PACL Acl = NULL, ThreadAcl = NULL; ++ SECURITY_DESCRIPTOR *SecurityDescriptor = NULL, *ThreadSecurityDescriptor = NULL; + char buffer[MAX_PATH]; + PROCESS_INFORMATION info; + STARTUPINFOA startup; +- SECURITY_ATTRIBUTES psa; ++ SECURITY_ATTRIBUTES psa, tsa; + HANDLE token, event; + DWORD size; + SID_IDENTIFIER_AUTHORITY SIDAuthWorld = { SECURITY_WORLD_SID_AUTHORITY }; +@@ -2657,12 +2657,38 @@ static void test_process_security(void) + psa.nLength = sizeof(psa); + psa.lpSecurityDescriptor = SecurityDescriptor; + psa.bInheritHandle = TRUE; ++ ++ ++ ThreadSecurityDescriptor = HeapAlloc(GetProcessHeap(), 0, SECURITY_DESCRIPTOR_MIN_LENGTH); ++ res = InitializeSecurityDescriptor(ThreadSecurityDescriptor, SECURITY_DESCRIPTOR_REVISION); ++ ok(res, "InitializeSecurityDescriptor failed with error %d\n", GetLastError()); ++ ++ ThreadAcl = HeapAlloc(GetProcessHeap(), 0, 256); ++ res = InitializeAcl(ThreadAcl, 256, ACL_REVISION); ++ ok(res, "InitializeAcl failed with error %d\n", GetLastError()); ++ res = AddAccessDeniedAce(ThreadAcl, ACL_REVISION, THREAD_SET_THREAD_TOKEN, AdminSid); ++ ok(res, "AddAccessDeniedAce failed with error %d\n", GetLastError()); ++ res = AddAccessAllowedAce(ThreadAcl, ACL_REVISION, THREAD_ALL_ACCESS, AdminSid); ++ ok(res, "AddAccessAllowedAce failed with error %d\n", GetLastError()); ++ ++ res = SetSecurityDescriptorOwner(ThreadSecurityDescriptor, AdminSid, FALSE); ++ ok(res, "SetSecurityDescriptorOwner failed with error %d\n", GetLastError()); ++ res = SetSecurityDescriptorGroup(ThreadSecurityDescriptor, UsersSid, FALSE); ++ ok(res, "SetSecurityDescriptorGroup failed with error %d\n", GetLastError()); ++ res = SetSecurityDescriptorDacl(ThreadSecurityDescriptor, TRUE, ThreadAcl, FALSE); ++ ok(res, "SetSecurityDescriptorDacl failed with error %d\n", GetLastError()); ++ ++ tsa.nLength = sizeof(tsa); ++ tsa.lpSecurityDescriptor = ThreadSecurityDescriptor; ++ tsa.bInheritHandle = TRUE; + + /* Doesn't matter what ACL say we should get full access for ourselves */ +- res = CreateProcessA( NULL, buffer, &psa, NULL, FALSE, 0, NULL, NULL, &startup, &info ); ++ res = CreateProcessA( NULL, buffer, &psa, &tsa, FALSE, 0, NULL, NULL, &startup, &info ); + ok(res, "CreateProcess with err:%d\n", GetLastError()); + TEST_GRANTED_ACCESS2( info.hProcess, PROCESS_ALL_ACCESS_NT4, + STANDARD_RIGHTS_ALL | SPECIFIC_RIGHTS_ALL ); ++ TEST_GRANTED_ACCESS2( info.hThread, THREAD_ALL_ACCESS_NT4, ++ STANDARD_RIGHTS_ALL | SPECIFIC_RIGHTS_ALL ); + winetest_wait_child_process( info.hProcess ); + + FreeSid(EveryoneSid); +@@ -2673,6 +2699,8 @@ static void test_process_security(void) + HeapFree(GetProcessHeap(), 0, owner); + HeapFree(GetProcessHeap(), 0, Acl); + HeapFree(GetProcessHeap(), 0, SecurityDescriptor); ++ HeapFree(GetProcessHeap(), 0, ThreadAcl); ++ HeapFree(GetProcessHeap(), 0, ThreadSecurityDescriptor); + } + + static void test_process_security_child(void) +@@ -2728,6 +2756,15 @@ static void test_process_security_child(void) + TEST_GRANTED_ACCESS( handle1, PROCESS_VM_READ ); + CloseHandle( handle1 ); + CloseHandle( handle ); ++ ++ ++ handle = OpenThread( THREAD_TERMINATE, FALSE, GetCurrentThreadId() ); ++ ok(handle != NULL, "OpenThread(THREAD_TERMINATE) with err:%d\n", GetLastError()); ++ TEST_GRANTED_ACCESS( handle, PROCESS_TERMINATE ); ++ CloseHandle( handle ); ++ ++ handle = OpenThread( THREAD_SET_THREAD_TOKEN, FALSE, GetCurrentThreadId() ); ++ ok(handle == NULL, "OpenThread(THREAD_SET_THREAD_TOKEN) should have failed\n"); + } + + static void test_impersonation_level(void) +diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c +index 5f6c2e5..a01e681 100644 +--- a/dlls/kernel32/process.c ++++ b/dlls/kernel32/process.c +@@ -2003,8 +2003,8 @@ static BOOL create_process( HANDLE hFile, LPCWSTR filename, LPWSTR cmd_line, LPW + int socketfd[2], stdin_fd = -1, stdout_fd = -1; + pid_t pid; + int err, cpu; +- struct security_descriptor *psd = NULL; +- data_size_t psd_len = 0; ++ struct security_descriptor *psd = NULL, *tsd = NULL; ++ data_size_t psd_len = 0, tsd_len = 0; + + if ((cpu = get_process_cpu( filename, binary_info )) == -1) + { +@@ -2022,12 +2022,26 @@ static BOOL create_process( HANDLE hFile, LPCWSTR filename, LPWSTR cmd_line, LPW + return FALSE; + } + } ++ ++ if (tsa && (tsa->nLength >= sizeof(*tsa)) && tsa->lpSecurityDescriptor) ++ { ++ status = create_struct_sd( tsa->lpSecurityDescriptor, &tsd, &tsd_len ); ++ ++ if (status != STATUS_SUCCESS) ++ { ++ RtlFreeHeap(GetProcessHeap(), 0, psd); ++ WARN("Invalid thread security descriptor with status %x\n", status); ++ SetLastError( RtlNtStatusToDosError(status) ); ++ return FALSE; ++ } ++ } + + /* create the socket for the new process */ + + if (socketpair( PF_UNIX, SOCK_STREAM, 0, socketfd ) == -1) + { + RtlFreeHeap(GetProcessHeap(), 0, psd); ++ RtlFreeHeap(GetProcessHeap(), 0, tsd); + SetLastError( ERROR_TOO_MANY_OPEN_FILES ); + return FALSE; + } +@@ -2068,6 +2082,7 @@ static BOOL create_process( HANDLE hFile, LPCWSTR filename, LPWSTR cmd_line, LPW + } + close( socketfd[0] ); + RtlFreeHeap(GetProcessHeap(), 0, psd); ++ RtlFreeHeap(GetProcessHeap(), 0, tsd); + SetLastError( RtlNtStatusToDosError( status )); + return FALSE; + } +@@ -2081,6 +2096,7 @@ static BOOL create_process( HANDLE hFile, LPCWSTR filename, LPWSTR cmd_line, LPW + close( socketfd[0] ); + close( socketfd[1] ); + RtlFreeHeap(GetProcessHeap(), 0, psd); ++ RtlFreeHeap(GetProcessHeap(), 0, tsd); + return FALSE; + } + if (!env) env = NtCurrentTeb()->Peb->ProcessParameters->Environment; +@@ -2115,11 +2131,12 @@ static BOOL create_process( HANDLE hFile, LPCWSTR filename, LPWSTR cmd_line, LPW + req->thread_attr = (tsa && (tsa->nLength >= sizeof(*tsa)) && tsa->bInheritHandle) ? OBJ_INHERIT : 0; + req->cpu = cpu; + req->process_sd_size = psd_len; +- req->thread_sd_size = 0; ++ req->thread_sd_size = tsd_len; + req->info_size = startup_info_size; + req->env_size = (env_end - env) * sizeof(WCHAR); + + wine_server_add_data( req, psd , req->process_sd_size ); ++ wine_server_add_data( req, tsd , req->thread_sd_size ); + wine_server_add_data( req, startup_info, req->info_size ); + wine_server_add_data( req, env , req->env_size ); + +@@ -2135,6 +2152,7 @@ static BOOL create_process( HANDLE hFile, LPCWSTR filename, LPWSTR cmd_line, LPW + SERVER_END_REQ; + + RtlFreeHeap(GetProcessHeap(), 0, psd); ++ RtlFreeHeap(GetProcessHeap(), 0, tsd); + + RtlReleasePebLock(); + if (status) +diff --git a/server/process.c b/server/process.c +index 1fba134..f9a4611 100644 +--- a/server/process.c ++++ b/server/process.c +@@ -883,7 +883,7 @@ DECL_HANDLER(new_process) + const startup_info_t *req_info; + data_size_t req_info_size; + const WCHAR *req_env; +- const struct security_descriptor *req_psd = NULL; ++ const struct security_descriptor *req_psd = NULL, *req_tsd = NULL; + + if (socket_fd == -1) + { +@@ -919,6 +919,18 @@ DECL_HANDLER(new_process) + } + } + ++ if (req->thread_sd_size) ++ { ++ req_tsd = (const struct security_descriptor *) ++ ((char*)get_req_data() + req->process_sd_size); ++ ++ if (!sd_is_valid( req_tsd, req->thread_sd_size )) ++ { ++ set_error( STATUS_INVALID_SECURITY_DESCR ); ++ return; ++ } ++ } ++ + req_info = (const startup_info_t *) + ((char*)get_req_data() + req->process_sd_size + req->thread_sd_size); + +@@ -1035,6 +1047,20 @@ DECL_HANDLER(new_process) + DACL_SECURITY_INFORMATION| + SACL_SECURITY_INFORMATION ); + } ++ ++ if (req_tsd) ++ { ++ /* In CreateProcess the thread defaults come from the process token, ++ * (this is not the case during CreateThread however) */ ++ set_sd_defaults_from_token( &thread->obj, ++ req_tsd, ++ OWNER_SECURITY_INFORMATION| ++ GROUP_SECURITY_INFORMATION| ++ DACL_SECURITY_INFORMATION| ++ SACL_SECURITY_INFORMATION, ++ process->token ); ++ } ++ + done: + release_object( info ); + } +-- +1.7.9.5 + diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/patches/16-server-CreateProcess_ACLs/a3f43350-092c-11e4-9b1e-0090f5c75ad5.def wine-compholio-1.7.22~ubuntu13.10.1/patches/16-server-CreateProcess_ACLs/a3f43350-092c-11e4-9b1e-0090f5c75ad5.def --- wine-compholio-1.7.21~ubuntu13.10.1/patches/16-server-CreateProcess_ACLs/a3f43350-092c-11e4-9b1e-0090f5c75ad5.def 1970-01-01 00:00:00.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/patches/16-server-CreateProcess_ACLs/a3f43350-092c-11e4-9b1e-0090f5c75ad5.def 2014-07-11 19:37:29.000000000 +0000 @@ -0,0 +1,3 @@ +Revision: 1 +Author: Joris van der Wel +Title: Implement passing ACLs to CreateProcess. diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/patches/98-Miscellaneous/0001-quartz-tests-Add-tests-for-IVMRMonitorConfig-and-IVMRM.patch wine-compholio-1.7.22~ubuntu13.10.1/patches/98-Miscellaneous/0001-quartz-tests-Add-tests-for-IVMRMonitorConfig-and-IVMRM.patch --- wine-compholio-1.7.21~ubuntu13.10.1/patches/98-Miscellaneous/0001-quartz-tests-Add-tests-for-IVMRMonitorConfig-and-IVMRM.patch 2014-06-28 05:38:42.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/patches/98-Miscellaneous/0001-quartz-tests-Add-tests-for-IVMRMonitorConfig-and-IVMRM.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,360 +0,0 @@ -From 4347b37128afcd1878a0f993a058fe147f219982 Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Fri, 22 Nov 2013 18:40:59 +0100 -Subject: quartz/tests: Add tests for IVMRMonitorConfig and IVMRMonitorConfig9 - interface - ---- - dlls/quartz/tests/videorenderer.c | 275 ++++++++++++++++++++++++++++++++++--- - 1 file changed, 254 insertions(+), 21 deletions(-) - -diff --git a/dlls/quartz/tests/videorenderer.c b/dlls/quartz/tests/videorenderer.c -index ce1ac29..e3a4fa2 100644 ---- a/dlls/quartz/tests/videorenderer.c -+++ b/dlls/quartz/tests/videorenderer.c -@@ -22,6 +22,9 @@ - - #include "wine/test.h" - #include "dshow.h" -+#include "initguid.h" -+#include "d3d9.h" -+#include "vmr9.h" - - #define QI_SUCCEED(iface, riid, ppv) hr = IUnknown_QueryInterface(iface, &riid, (LPVOID*)&ppv); \ - ok(hr == S_OK, "IUnknown_QueryInterface returned %x\n", hr); \ -@@ -32,28 +35,17 @@ - ok(hr == num, "IUnknown_Release should return %d, got %d\n", num, hr); \ - } - --static IUnknown *pVideoRenderer = NULL; -- --static int create_video_renderer(void) -+static const WCHAR *memchrW( const WCHAR *ptr, WCHAR ch, size_t n ) - { -- HRESULT hr; -- -- hr = CoCreateInstance(&CLSID_VideoRenderer, NULL, CLSCTX_INPROC_SERVER, -- &IID_IUnknown, (LPVOID*)&pVideoRenderer); -- return (hr == S_OK && pVideoRenderer != NULL); --} -- --static void release_video_renderer(void) --{ -- HRESULT hr; -- -- hr = IUnknown_Release(pVideoRenderer); -- ok(hr == 0, "IUnknown_Release failed with %x\n", hr); -+ const WCHAR *end; -+ for (end = ptr + n; ptr < end; ptr++) if (*ptr == ch) return ptr; -+ return NULL; - } - - static void test_query_interface(void) - { - HRESULT hr; -+ IUnknown *pVideoRenderer = NULL; - IBaseFilter *pBaseFilter = NULL; - IBasicVideo *pBasicVideo = NULL; - IDirectDrawVideo *pDirectDrawVideo = NULL; -@@ -64,6 +56,15 @@ static void test_query_interface(void) - IQualProp *pQualProp = NULL; - IVideoWindow *pVideoWindow = NULL; - -+ hr = CoCreateInstance(&CLSID_VideoRenderer, NULL, CLSCTX_INPROC_SERVER, -+ &IID_IUnknown, (LPVOID*)&pVideoRenderer); -+ ok(hr != S_OK || pVideoRenderer != NULL, "CoCreateInstance returned S_OK, but pVideoRenderer is NULL.\n"); -+ if (hr != S_OK || !pVideoRenderer) -+ { -+ skip("VideoRenderer is not available, skipping QI test.\n"); -+ return; -+ } -+ - QI_SUCCEED(pVideoRenderer, IID_IBaseFilter, pBaseFilter); - RELEASE_EXPECT(pBaseFilter, 1); - QI_SUCCEED(pVideoRenderer, IID_IBasicVideo, pBasicVideo); -@@ -84,6 +85,8 @@ static void test_query_interface(void) - RELEASE_EXPECT(pMediaPosition, 1); - QI_SUCCEED(pVideoRenderer, IID_IVideoWindow, pVideoWindow); - RELEASE_EXPECT(pVideoWindow, 1); -+ -+ RELEASE_EXPECT(pVideoRenderer, 0); - } - - static void test_pin(IPin *pin) -@@ -104,18 +107,28 @@ static void test_pin(IPin *pin) - - static void test_basefilter(void) - { -+ IUnknown *pVideoRenderer = NULL; - IEnumPins *pin_enum = NULL; - IBaseFilter *base = NULL; - IPin *pins[2]; - ULONG ref; - HRESULT hr; - -+ hr = CoCreateInstance(&CLSID_VideoRenderer, NULL, CLSCTX_INPROC_SERVER, -+ &IID_IUnknown, (LPVOID*)&pVideoRenderer); -+ ok(hr != S_OK || pVideoRenderer != NULL, "CoCreateInstance returned S_OK, but pVideoRenderer is NULL.\n"); -+ if (hr != S_OK || !pVideoRenderer) -+ { -+ skip("VideoRenderer is not available, skipping BaseFilter test.\n"); -+ return; -+ } -+ - IUnknown_QueryInterface(pVideoRenderer, &IID_IBaseFilter, (void **)&base); - if (base == NULL) - { - /* test_query_interface handles this case */ - skip("No IBaseFilter\n"); -- return; -+ goto out; - } - - hr = IBaseFilter_EnumPins(base, NULL); -@@ -147,19 +160,239 @@ static void test_basefilter(void) - ref = IEnumPins_Release(pin_enum); - ok(ref == 0, "ref is %u and not 0!\n", ref); - -- IBaseFilter_Release(base); -+out: -+ if (base) IBaseFilter_Release(base); -+ RELEASE_EXPECT(pVideoRenderer, 0); -+} -+ -+static void test_monitorconfig7(void) -+{ -+ HRESULT hr; -+ IUnknown *pVMR7 = NULL; -+ IVMRMonitorConfig *pMonitorConfig = NULL; -+ VMRGUID guid; -+ VMRMONITORINFO info[8]; -+ DWORD numdev_total, numdev; -+ GUID max_guid; -+ RECT max_rect; -+ -+ hr = CoCreateInstance(&CLSID_VideoMixingRenderer, NULL, CLSCTX_INPROC_SERVER, -+ &IID_IUnknown, (LPVOID*)&pVMR7); -+ ok(hr != S_OK || pVMR7 != NULL, "CoCreateInstance returned S_OK, but pVMR7 is NULL.\n"); -+ if (hr != S_OK || !pVMR7) -+ { -+ skip("VideoMixingRenderer7 is not available, skipping MonitorConfig7 test.\n"); -+ return; -+ } -+ -+ hr = IUnknown_QueryInterface(pVMR7, &IID_IVMRMonitorConfig, (LPVOID*)&pMonitorConfig); -+ ok(hr == S_OK, "IUnknown_QueryInterface returned %x.\n", hr); -+ ok(pMonitorConfig != NULL, "pMonitorConfig is NULL.\n"); -+ if (!pMonitorConfig) goto out; -+ -+ hr = IVMRMonitorConfig_SetMonitor(pMonitorConfig, NULL); -+ ok(hr == E_POINTER, "SetMonitor returned %x, expected E_POINTER.\n", hr); -+ -+ hr = IVMRMonitorConfig_GetMonitor(pMonitorConfig, NULL); -+ ok(hr == E_POINTER, "GetMonitor returned %x, expected E_POINTER.\n", hr); -+ -+ hr = IVMRMonitorConfig_SetDefaultMonitor(pMonitorConfig, NULL); -+ ok(hr == E_POINTER, "SetDefaultMonitor returned %x, expected E_POINTER.\n", hr); -+ -+ hr = IVMRMonitorConfig_GetDefaultMonitor(pMonitorConfig, NULL); -+ ok(hr == E_POINTER, "GetDefaultMonitor returned %x, expected E_POINTER.\n", hr); -+ -+ memset(&guid, 0, sizeof(guid)); -+ guid.pGUID = NULL; /* default DirectDraw device */ -+ hr = IVMRMonitorConfig_SetMonitor(pMonitorConfig, &guid); -+ ok(hr == S_OK, "SetMonitor failed with %x.\n", hr); -+ -+ memset(&guid, 255, sizeof(guid)); -+ hr = IVMRMonitorConfig_GetMonitor(pMonitorConfig, &guid); -+ ok(hr == S_OK, "GetMonitor failed with %x.\n", hr); -+ ok(guid.pGUID == NULL, "GetMonitor returned guid.pGUID = %p, expected NULL.\n", guid.pGUID); -+ -+ memset(&guid, 0, sizeof(guid)); -+ guid.pGUID = NULL; /* default DirectDraw device */ -+ hr = IVMRMonitorConfig_SetDefaultMonitor(pMonitorConfig, &guid); -+ ok(hr == S_OK, "SetDefaultMonitor failed with %x.\n", hr); -+ -+ memset(&guid, 255, sizeof(guid)); -+ hr = IVMRMonitorConfig_GetDefaultMonitor(pMonitorConfig, &guid); -+ ok(hr == S_OK, "GetDefaultMonitor failed with %x.\n", hr); -+ ok(guid.pGUID == NULL, "GetDefaultMonitor returned guid.pGUID = %p, expected NULL.\n", guid.pGUID); -+ -+ hr = IVMRMonitorConfig_GetAvailableMonitors(pMonitorConfig, NULL, 0, NULL); -+ ok(hr == E_POINTER, "GetAvailableMonitors returned %x, expected E_POINTER.\n", hr); -+ -+ hr = IVMRMonitorConfig_GetAvailableMonitors(pMonitorConfig, info, 0, &numdev_total); -+ ok(hr == E_INVALIDARG, "GetAvailableMonitors returned %x, expected E_INVALIDARG.\n", hr); -+ -+ numdev_total = 0; -+ hr = IVMRMonitorConfig_GetAvailableMonitors(pMonitorConfig, NULL, 0, &numdev_total); -+ ok(hr == S_OK, "GetAvailableMonitors failed with %x.\n", hr); -+ ok(numdev_total > 0, "GetAvailableMonitors returned numdev_total = %d, expected > 0.\n", numdev_total); -+ -+ /* check if its possible to provide a buffer which is too small for all entries */ -+ if (numdev_total > 1) -+ { -+ hr = IVMRMonitorConfig_GetAvailableMonitors(pMonitorConfig, info, 1, &numdev); -+ ok(hr == S_OK, "GetAvailableMonitors failed with %x.\n", hr); -+ ok(numdev == 1, "GetAvailableMonitors returned numdev = %d, expected 1.\n", numdev); -+ } -+ -+ /* don't request information for more monitors than memory available */ -+ if (numdev_total > sizeof(info)/sizeof(info[0])) -+ numdev_total = sizeof(info)/sizeof(info[0]); -+ memset(info, 255, sizeof(info)); -+ hr = IVMRMonitorConfig_GetAvailableMonitors(pMonitorConfig, info, numdev_total, &numdev); -+ ok(hr == S_OK, "GetAvailableMonitors failed with %x.\n", hr); -+ ok(numdev == numdev_total, "GetAvailableMonitors returned numdev = %d, expected %d.\n", numdev, numdev_total); -+ -+ memset(&max_guid, 255, sizeof(max_guid)); -+ memset(&max_rect, 255, sizeof(max_rect)); -+ -+ /* check that result is filled out, we do not check if the values actually make any sense */ -+ while (numdev--) -+ { -+ ok(info[numdev].guid.pGUID == NULL || info[numdev].guid.pGUID == &info[numdev].guid.GUID, -+ "GetAvailableMonitors returned info[%d].guid.pGUID = %p, expected NULL or %p.\n", numdev, info[numdev].guid.pGUID, &info[numdev].guid.GUID); -+ ok(info[numdev].guid.pGUID != &info[numdev].guid.GUID || memcmp(&info[numdev].guid.GUID, &max_guid, sizeof(max_guid)) != 0, -+ "GetAvailableMonitors returned info[%d].GUID = {FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF}, expected any other value.\n", numdev); -+ ok(memcmp(&info[numdev].rcMonitor, &max_rect, sizeof(max_rect)) != 0, -+ "GetAvailableMonitors returned info[%d].rcMonitor = {-1, -1, -1, -1}, expected any other value.\n", numdev); -+ ok(info[numdev].hMon != (HMONITOR)0 && info[numdev].hMon != (HMONITOR)-1, -+ "GetAvailableMonitors returned info[%d].hMon = %p, expected != 0 and != -1.\n", numdev, info[numdev].hMon); -+ ok(info[numdev].dwFlags != (DWORD)-1, -+ "GetAvailableMonitors returned info[%d].dwFlags = -1, expected != -1.\n", numdev); -+ ok(memchrW(info[numdev].szDevice, 0, sizeof(info[numdev].szDevice)/sizeof(WCHAR)) != NULL, -+ "GetAvailableMonitors returned info[%d].szDevice without null-termination.\n", numdev); -+ ok(memchrW(info[numdev].szDescription, 0, sizeof(info[numdev].szDescription)/sizeof(WCHAR)) != NULL, -+ "GetAvailableMonitors returned info[%d].szDescription without null-termination.\n", numdev); -+ } -+ -+out: -+ if (pMonitorConfig) IVMRMonitorConfig_Release(pMonitorConfig); -+ RELEASE_EXPECT(pVMR7, 0); -+} -+ -+static void test_monitorconfig9(void) -+{ -+ HRESULT hr; -+ IUnknown *pVMR9 = NULL; -+ IVMRMonitorConfig9 *pMonitorConfig = NULL; -+ UINT uDev; -+ VMR9MonitorInfo info[8]; -+ DWORD numdev_total, numdev; -+ RECT max_rect; -+ -+ hr = CoCreateInstance(&CLSID_VideoMixingRenderer9, NULL, CLSCTX_INPROC_SERVER, -+ &IID_IUnknown, (LPVOID*)&pVMR9); -+ ok(hr != S_OK || pVMR9 != NULL, "CoCreateInstance returned S_OK, but pVMR9 is NULL.\n"); -+ if (hr != S_OK || !pVMR9) -+ { -+ skip("VideoMixingRenderer9 is not available, skipping MonitorConfig9 test.\n"); -+ return; -+ } -+ -+ hr = IUnknown_QueryInterface(pVMR9, &IID_IVMRMonitorConfig9, (LPVOID*)&pMonitorConfig); -+ ok(hr == S_OK, "IUnknown_QueryInterface returned %x.\n", hr); -+ ok(pMonitorConfig != NULL, "pMonitorConfig is NULL.\n"); -+ if (!pMonitorConfig) goto out; -+ -+ hr = IVMRMonitorConfig9_GetMonitor(pMonitorConfig, NULL); -+ ok(hr == E_POINTER, "GetMonitor returned %x, expected E_POINTER.\n", hr); -+ -+ hr = IVMRMonitorConfig9_GetDefaultMonitor(pMonitorConfig, NULL); -+ ok(hr == E_POINTER, "GetDefaultMonitor returned %x, expected E_POINTER.\n", hr); -+ -+ hr = IVMRMonitorConfig9_SetMonitor(pMonitorConfig, 0); -+ ok(hr == S_OK, "SetMonitor failed with %x.\n", hr); -+ -+ uDev = 0xdeadbeef; -+ hr = IVMRMonitorConfig9_GetMonitor(pMonitorConfig, &uDev); -+ ok(hr == S_OK, "GetMonitor failed with %x.\n", hr); -+ ok(uDev == 0, "GetMonitor returned uDev = %d, expected 0.\n", uDev); -+ -+ hr = IVMRMonitorConfig9_SetDefaultMonitor(pMonitorConfig, 0); -+ ok(hr == S_OK, "SetDefaultMonitor failed with %x.\n", hr); -+ -+ uDev = 0xdeadbeef; -+ hr = IVMRMonitorConfig9_GetDefaultMonitor(pMonitorConfig, &uDev); -+ ok(hr == S_OK, "GetDefaultMonitor failed with %x.\n", hr); -+ ok(uDev == 0, "GetDefaultMonitor returned uDev = %d, expected 0.\n", uDev); -+ -+ hr = IVMRMonitorConfig9_GetAvailableMonitors(pMonitorConfig, NULL, 0, NULL); -+ ok(hr == E_POINTER, "GetAvailableMonitors returned %x, expected E_POINTER.\n", hr); -+ -+ hr = IVMRMonitorConfig9_GetAvailableMonitors(pMonitorConfig, info, 0, &numdev_total); -+ ok(hr == E_INVALIDARG, "GetAvailableMonitors returned %x, expected E_INVALIDARG.\n", hr); -+ -+ numdev_total = 0; -+ hr = IVMRMonitorConfig9_GetAvailableMonitors(pMonitorConfig, NULL, 0, &numdev_total); -+ ok(hr == S_OK, "GetAvailableMonitors failed with %x.\n", hr); -+ ok(numdev_total > 0, "GetAvailableMonitors returned numdev_total = %d, expected > 0.\n", numdev_total); -+ -+ /* check if its possible to provide a buffer which is too small for all entries */ -+ if (numdev_total > 1) -+ { -+ hr = IVMRMonitorConfig9_GetAvailableMonitors(pMonitorConfig, info, 1, &numdev); -+ ok(hr == S_OK, "GetAvailableMonitors failed with %x.\n", hr); -+ ok(numdev == 1, "GetAvailableMonitors returned numdev = %d, expected 1.\n", numdev); -+ } -+ -+ if (numdev_total > sizeof(info)/sizeof(info[0])) -+ numdev_total = sizeof(info)/sizeof(info[0]); -+ memset(info, 255, sizeof(info)); -+ hr = IVMRMonitorConfig9_GetAvailableMonitors(pMonitorConfig, info, numdev_total, &numdev); -+ ok(hr == S_OK, "GetAvailableMonitors failed with %x.\n", hr); -+ ok(numdev == numdev_total, "GetAvailableMonitors returned numdev = %d, expected %d.\n", numdev, numdev_total); -+ -+ memset(&max_rect, 255, sizeof(max_rect)); -+ -+ /* check that result is filled out, we do not check if the values actually make any sense */ -+ while (numdev--) -+ { -+ ok(info[numdev].uDevID != (UINT)-1, -+ "GetAvailableMonitors returned info[%d].uDevID = -1, expected != -1.\n", numdev); -+ ok(memcmp(&info[numdev].rcMonitor, &max_rect, sizeof(max_rect)) != 0, -+ "GetAvailableMonitors returned info[%d].rcMonitor = {-1, -1, -1, -1}, expected any other value.\n", numdev); -+ ok(info[numdev].hMon != (HMONITOR)0 && info[numdev].hMon != (HMONITOR)-1, -+ "GetAvailableMonitors returned info[%d].hMon = %p, expected != 0 and != -1.\n", numdev, info[numdev].hMon); -+ ok(info[numdev].dwFlags != (DWORD)-1, -+ "GetAvailableMonitors returned info[%d].dwFlags = -1, expected != -1.\n", numdev); -+ ok(memchrW(info[numdev].szDevice, 0, sizeof(info[numdev].szDevice)/sizeof(WCHAR)) != NULL, -+ "GetAvailableMonitors returned info[%d].szDevice without null-termination.\n", numdev); -+ ok(memchrW(info[numdev].szDescription, 0, sizeof(info[numdev].szDescription)/sizeof(WCHAR)) != NULL, -+ "GetAvailableMonitors returned info[%d].szDescription without null-termination.\n", numdev); -+ ok(info[numdev].dwVendorId != (DWORD)-1, -+ "GetAvailableMonitors returned info[%d].dwVendorId = -1, expected != -1.\n", numdev); -+ ok(info[numdev].dwDeviceId != (DWORD)-1, -+ "GetAvailableMonitors returned info[%d].dwDeviceId = -1, expected != -1.\n", numdev); -+ ok(info[numdev].dwSubSysId != (DWORD)-1, -+ "GetAvailableMonitors returned info[%d].dwSubSysId = -1, expected != -1.\n", numdev); -+ ok(info[numdev].dwRevision != (DWORD)-1, -+ "GetAvailableMonitors returned info[%d].dwRevision = -1, expected != -1.\n", numdev); -+ } -+ -+out: -+ if (pMonitorConfig) IVMRMonitorConfig9_Release(pMonitorConfig); -+ RELEASE_EXPECT(pVMR9, 0); - } - - START_TEST(videorenderer) - { - CoInitialize(NULL); -- if (!create_video_renderer()) -- return; - -+ /* Video Renderer tests */ - test_query_interface(); - test_basefilter(); - -- release_video_renderer(); -+ /* Video Mixing Renderer 7 tests */ -+ test_monitorconfig7(); -+ -+ /* Video Mixing Renderer 9 tests */ -+ test_monitorconfig9(); - - CoUninitialize(); - } --- -1.7.9.5 - diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/patches/98-Miscellaneous/0001-wined3d-Silence-repeated-resource_check_usage-FIXME.patch wine-compholio-1.7.22~ubuntu13.10.1/patches/98-Miscellaneous/0001-wined3d-Silence-repeated-resource_check_usage-FIXME.patch --- wine-compholio-1.7.21~ubuntu13.10.1/patches/98-Miscellaneous/0001-wined3d-Silence-repeated-resource_check_usage-FIXME.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/patches/98-Miscellaneous/0001-wined3d-Silence-repeated-resource_check_usage-FIXME.patch 2014-07-11 19:37:29.000000000 +0000 @@ -0,0 +1,36 @@ +From b1b13aac629c00d03d68dcca64cb81e976e20580 Mon Sep 17 00:00:00 2001 +From: "Erich E. Hoover" +Date: Thu, 3 Apr 2014 21:36:33 -0600 +Subject: wined3d: Silence repeated resource_check_usage FIXME. + +--- + dlls/wined3d/resource.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c +index 3a54dd8..d164681 100644 +--- a/dlls/wined3d/resource.c ++++ b/dlls/wined3d/resource.c +@@ -50,7 +50,7 @@ static DWORD resource_access_from_pool(enum wined3d_pool pool) + + static void resource_check_usage(DWORD usage) + { +- static const DWORD handled = WINED3DUSAGE_RENDERTARGET ++ static DWORD handled = WINED3DUSAGE_RENDERTARGET + | WINED3DUSAGE_DEPTHSTENCIL + | WINED3DUSAGE_WRITEONLY + | WINED3DUSAGE_DYNAMIC +@@ -60,7 +60,10 @@ static void resource_check_usage(DWORD usage) + | WINED3DUSAGE_TEXTURE; + + if (usage & ~handled) ++ { + FIXME("Unhandled usage flags %#x.\n", usage & ~handled); ++ handled |= usage; ++ } + if ((usage & (WINED3DUSAGE_DYNAMIC | WINED3DUSAGE_WRITEONLY)) == WINED3DUSAGE_DYNAMIC) + WARN_(d3d_perf)("WINED3DUSAGE_DYNAMIC used without WINED3DUSAGE_WRITEONLY.\n"); + } +-- +1.7.9.5 + diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/patches/98-Miscellaneous/0002-kernel32-Silence-repeated-CompareStringEx-FIXME.patch wine-compholio-1.7.22~ubuntu13.10.1/patches/98-Miscellaneous/0002-kernel32-Silence-repeated-CompareStringEx-FIXME.patch --- wine-compholio-1.7.21~ubuntu13.10.1/patches/98-Miscellaneous/0002-kernel32-Silence-repeated-CompareStringEx-FIXME.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/patches/98-Miscellaneous/0002-kernel32-Silence-repeated-CompareStringEx-FIXME.patch 2014-07-11 19:37:29.000000000 +0000 @@ -0,0 +1,50 @@ +From 33fa174b6404cfea673d510457d21d784a23efbd Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Sun, 4 May 2014 00:18:11 +0200 +Subject: kernel32: Silence repeated CompareStringEx FIXME. + +--- + dlls/kernel32/locale.c | 14 +++++++++----- + 1 file changed, 9 insertions(+), 5 deletions(-) + +diff --git a/dlls/kernel32/locale.c b/dlls/kernel32/locale.c +index eca0e39..55ef3d6 100644 +--- a/dlls/kernel32/locale.c ++++ b/dlls/kernel32/locale.c +@@ -2985,9 +2985,10 @@ INT WINAPI CompareStringW(LCID lcid, DWORD flags, + 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; ++ static const DWORD supported_flags = NORM_IGNORECASE|NORM_IGNORENONSPACE|NORM_IGNORESYMBOLS|SORT_STRINGSORT ++ |NORM_IGNOREKANATYPE|NORM_IGNOREWIDTH|LOCALE_USE_CP_ACP ++ |NORM_LINGUISTIC_CASING|LINGUISTIC_IGNORECASE|0x10000000; ++ static DWORD semistub_flags = NORM_LINGUISTIC_CASING|LINGUISTIC_IGNORECASE|0x10000000; + /* 0x10000000 is related to diacritics in Arabic, Japanese, and Hebrew */ + INT ret; + +@@ -3001,14 +3002,17 @@ INT WINAPI CompareStringEx(LPCWSTR locale, DWORD flags, LPCWSTR str1, INT len1, + return 0; + } + +- if (flags & ~(supported_flags|semistub_flags)) ++ if (flags & ~supported_flags) + { + SetLastError(ERROR_INVALID_FLAGS); + return 0; + } + + if (flags & semistub_flags) +- FIXME("semi-stub behavor for flag(s) 0x%x\n", flags & semistub_flags); ++ { ++ FIXME("semi-stub behavior for flag(s) 0x%x\n", flags & semistub_flags); ++ semistub_flags &= ~flags; ++ } + + if (len1 < 0) len1 = strlenW(str1); + if (len2 < 0) len2 = strlenW(str2); +-- +1.7.9.5 + diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/patches/98-Miscellaneous/0002-wined3d-Silence-repeated-resource_check_usage-FIXME.patch wine-compholio-1.7.22~ubuntu13.10.1/patches/98-Miscellaneous/0002-wined3d-Silence-repeated-resource_check_usage-FIXME.patch --- wine-compholio-1.7.21~ubuntu13.10.1/patches/98-Miscellaneous/0002-wined3d-Silence-repeated-resource_check_usage-FIXME.patch 2014-06-28 05:38:42.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/patches/98-Miscellaneous/0002-wined3d-Silence-repeated-resource_check_usage-FIXME.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -From 13d5795515836c4b8674bf96643333d68cd3d3a0 Mon Sep 17 00:00:00 2001 -From: "Erich E. Hoover" -Date: Thu, 3 Apr 2014 21:36:33 -0600 -Subject: wined3d: Silence repeated resource_check_usage FIXME. - ---- - dlls/wined3d/resource.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c -index 999dc5c..3558440 100644 ---- a/dlls/wined3d/resource.c -+++ b/dlls/wined3d/resource.c -@@ -49,7 +49,7 @@ static DWORD resource_access_from_pool(enum wined3d_pool pool) - - static void resource_check_usage(DWORD usage) - { -- static const DWORD handled = WINED3DUSAGE_RENDERTARGET -+ static DWORD handled = WINED3DUSAGE_RENDERTARGET - | WINED3DUSAGE_DEPTHSTENCIL - | WINED3DUSAGE_DYNAMIC - | WINED3DUSAGE_AUTOGENMIPMAP -@@ -58,7 +58,10 @@ static void resource_check_usage(DWORD usage) - | WINED3DUSAGE_TEXTURE; - - if (usage & ~handled) -+ { - FIXME("Unhandled usage flags %#x.\n", usage & ~handled); -+ handled |= usage; -+ } - } - - HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *device, --- -1.7.9.5 - diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/patches/98-Miscellaneous/0003-kernel32-Silence-repeated-CompareStringEx-FIXME.patch wine-compholio-1.7.22~ubuntu13.10.1/patches/98-Miscellaneous/0003-kernel32-Silence-repeated-CompareStringEx-FIXME.patch --- wine-compholio-1.7.21~ubuntu13.10.1/patches/98-Miscellaneous/0003-kernel32-Silence-repeated-CompareStringEx-FIXME.patch 2014-06-28 05:38:42.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/patches/98-Miscellaneous/0003-kernel32-Silence-repeated-CompareStringEx-FIXME.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,50 +0,0 @@ -From 33fa174b6404cfea673d510457d21d784a23efbd Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Sun, 4 May 2014 00:18:11 +0200 -Subject: kernel32: Silence repeated CompareStringEx FIXME. - ---- - dlls/kernel32/locale.c | 14 +++++++++----- - 1 file changed, 9 insertions(+), 5 deletions(-) - -diff --git a/dlls/kernel32/locale.c b/dlls/kernel32/locale.c -index eca0e39..55ef3d6 100644 ---- a/dlls/kernel32/locale.c -+++ b/dlls/kernel32/locale.c -@@ -2985,9 +2985,10 @@ INT WINAPI CompareStringW(LCID lcid, DWORD flags, - 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; -+ static const DWORD supported_flags = NORM_IGNORECASE|NORM_IGNORENONSPACE|NORM_IGNORESYMBOLS|SORT_STRINGSORT -+ |NORM_IGNOREKANATYPE|NORM_IGNOREWIDTH|LOCALE_USE_CP_ACP -+ |NORM_LINGUISTIC_CASING|LINGUISTIC_IGNORECASE|0x10000000; -+ static DWORD semistub_flags = NORM_LINGUISTIC_CASING|LINGUISTIC_IGNORECASE|0x10000000; - /* 0x10000000 is related to diacritics in Arabic, Japanese, and Hebrew */ - INT ret; - -@@ -3001,14 +3002,17 @@ INT WINAPI CompareStringEx(LPCWSTR locale, DWORD flags, LPCWSTR str1, INT len1, - return 0; - } - -- if (flags & ~(supported_flags|semistub_flags)) -+ if (flags & ~supported_flags) - { - SetLastError(ERROR_INVALID_FLAGS); - return 0; - } - - if (flags & semistub_flags) -- FIXME("semi-stub behavor for flag(s) 0x%x\n", flags & semistub_flags); -+ { -+ FIXME("semi-stub behavior for flag(s) 0x%x\n", flags & semistub_flags); -+ semistub_flags &= ~flags; -+ } - - if (len1 < 0) len1 = strlenW(str1); - if (len2 < 0) len2 = strlenW(str2); --- -1.7.9.5 - diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/patches/98-Miscellaneous/0003-wined3d-Silence-repeated-wined3d_swapchain_present-F.patch wine-compholio-1.7.22~ubuntu13.10.1/patches/98-Miscellaneous/0003-wined3d-Silence-repeated-wined3d_swapchain_present-F.patch --- wine-compholio-1.7.21~ubuntu13.10.1/patches/98-Miscellaneous/0003-wined3d-Silence-repeated-wined3d_swapchain_present-F.patch 1970-01-01 00:00:00.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/patches/98-Miscellaneous/0003-wined3d-Silence-repeated-wined3d_swapchain_present-F.patch 2014-07-11 19:37:29.000000000 +0000 @@ -0,0 +1,36 @@ +From a347c9baa86ec4503d51b03c1659d08a7062839a Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Sun, 4 May 2014 00:53:51 +0200 +Subject: wined3d: Silence repeated wined3d_swapchain_present FIXME. + +--- + dlls/wined3d/swapchain.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c +index 75e6628..10c3911 100644 +--- a/dlls/wined3d/swapchain.c ++++ b/dlls/wined3d/swapchain.c +@@ -136,12 +136,17 @@ HRESULT CDECL wined3d_swapchain_present(struct wined3d_swapchain *swapchain, + const RECT *src_rect, const RECT *dst_rect, HWND dst_window_override, + const RGNDATA *dirty_region, DWORD flags) + { ++ static DWORD notified_flags = 0; ++ + TRACE("swapchain %p, src_rect %s, dst_rect %s, dst_window_override %p, dirty_region %p, flags %#x.\n", + swapchain, wine_dbgstr_rect(src_rect), wine_dbgstr_rect(dst_rect), + dst_window_override, dirty_region, flags); + +- if (flags) +- FIXME("Ignoring flags %#x.\n", flags); ++ if (flags & ~notified_flags) ++ { ++ FIXME("Ignoring flags %#x.\n", flags & ~notified_flags); ++ notified_flags |= flags; ++ } + + if (!swapchain->back_buffers) + { +-- +1.7.9.5 + diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/patches/98-Miscellaneous/0004-wined3d-Silence-repeated-wined3d_swapchain_present-F.patch wine-compholio-1.7.22~ubuntu13.10.1/patches/98-Miscellaneous/0004-wined3d-Silence-repeated-wined3d_swapchain_present-F.patch --- wine-compholio-1.7.21~ubuntu13.10.1/patches/98-Miscellaneous/0004-wined3d-Silence-repeated-wined3d_swapchain_present-F.patch 2014-06-28 05:38:42.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/patches/98-Miscellaneous/0004-wined3d-Silence-repeated-wined3d_swapchain_present-F.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -From a347c9baa86ec4503d51b03c1659d08a7062839a Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Sun, 4 May 2014 00:53:51 +0200 -Subject: wined3d: Silence repeated wined3d_swapchain_present FIXME. - ---- - dlls/wined3d/swapchain.c | 9 +++++++-- - 1 file changed, 7 insertions(+), 2 deletions(-) - -diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c -index 75e6628..10c3911 100644 ---- a/dlls/wined3d/swapchain.c -+++ b/dlls/wined3d/swapchain.c -@@ -136,12 +136,17 @@ HRESULT CDECL wined3d_swapchain_present(struct wined3d_swapchain *swapchain, - const RECT *src_rect, const RECT *dst_rect, HWND dst_window_override, - const RGNDATA *dirty_region, DWORD flags) - { -+ static DWORD notified_flags = 0; -+ - TRACE("swapchain %p, src_rect %s, dst_rect %s, dst_window_override %p, dirty_region %p, flags %#x.\n", - swapchain, wine_dbgstr_rect(src_rect), wine_dbgstr_rect(dst_rect), - dst_window_override, dirty_region, flags); - -- if (flags) -- FIXME("Ignoring flags %#x.\n", flags); -+ if (flags & ~notified_flags) -+ { -+ FIXME("Ignoring flags %#x.\n", flags & ~notified_flags); -+ notified_flags |= flags; -+ } - - if (!swapchain->back_buffers) - { --- -1.7.9.5 - diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/patches/98-Miscellaneous/eec5dea8-879d-417b-9f97-364deaae6576.def wine-compholio-1.7.22~ubuntu13.10.1/patches/98-Miscellaneous/eec5dea8-879d-417b-9f97-364deaae6576.def --- wine-compholio-1.7.21~ubuntu13.10.1/patches/98-Miscellaneous/eec5dea8-879d-417b-9f97-364deaae6576.def 2014-06-28 05:38:42.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/patches/98-Miscellaneous/eec5dea8-879d-417b-9f97-364deaae6576.def 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -Revision: 1 -Author: Sebastian Lackner -Title: Add tests for IVMRMonitorConfig. - diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/patches/99-Workarounds/0001-shlwapi-tests-Add-additional-tests-for-UrlCombine-and-.patch wine-compholio-1.7.22~ubuntu13.10.1/patches/99-Workarounds/0001-shlwapi-tests-Add-additional-tests-for-UrlCombine-and-.patch --- wine-compholio-1.7.21~ubuntu13.10.1/patches/99-Workarounds/0001-shlwapi-tests-Add-additional-tests-for-UrlCombine-and-.patch 2014-06-28 05:38:42.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/patches/99-Workarounds/0001-shlwapi-tests-Add-additional-tests-for-UrlCombine-and-.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,126 +0,0 @@ -From 549999ab13d6078b39210a467753e8b8dfff705e Mon Sep 17 00:00:00 2001 -From: Sebastian Lackner -Date: Fri, 17 Jan 2014 01:19:41 +0100 -Subject: shlwapi/tests: Add additional tests for UrlCombine and - UrlCanonicalize - ---- - dlls/shlwapi/tests/url.c | 46 ++++++++++++++++++++++++++++++++++++---------- - 1 file changed, 36 insertions(+), 10 deletions(-) - -diff --git a/dlls/shlwapi/tests/url.c b/dlls/shlwapi/tests/url.c -index f53a545..ecbdfab 100644 ---- a/dlls/shlwapi/tests/url.c -+++ b/dlls/shlwapi/tests/url.c -@@ -195,7 +195,15 @@ static const TEST_URL_CANONICALIZE TEST_CANONICALIZE[] = { - {"res://c:\\tests/res\\foo%20bar/strange\\sth", URL_UNESCAPE, S_OK, "res://c:\\tests/res\\foo bar/strange\\sth", FALSE}, - {"A", 0, S_OK, "A", FALSE}, - {"../A", 0, S_OK, "../A", FALSE}, -+ {".\\A", 0, S_OK, ".\\A", FALSE}, -+ {"A\\.\\B", 0, S_OK, "A\\.\\B", FALSE}, - {"A/../B", 0, S_OK, "B", TRUE}, -+ {"A/../B/./../C", 0, S_OK, "C", TRUE}, -+ {"A/../B/./../C", URL_DONT_SIMPLIFY, S_OK, "A/../B/./../C", FALSE}, -+ {".", 0, S_OK, "/", TRUE}, -+ {"./A", 0, S_OK, "A", TRUE}, -+ {"A/./B", 0, S_OK, "A/B", TRUE}, -+ {"/:test\\", 0, S_OK, "/:test\\", TRUE}, - {"/uri-res/N2R?urn:sha1:B3K", URL_DONT_ESCAPE_EXTRA_INFO | URL_WININET_COMPATIBILITY /*0x82000000*/, S_OK, "/uri-res/N2R?urn:sha1:B3K", FALSE} /*LimeWire online installer calls this*/, - {"http:www.winehq.org/dir/../index.html", 0, S_OK, "http:www.winehq.org/index.html"}, - {"http://localhost/test.html", URL_FILE_USE_PATHURL, S_OK, "http://localhost/test.html"}, -@@ -308,6 +316,7 @@ typedef struct _TEST_URL_COMBINE { - DWORD flags; - HRESULT expectret; - const char *expecturl; -+ BOOL todo; - } TEST_URL_COMBINE; - - static const TEST_URL_COMBINE TEST_COMBINE[] = { -@@ -329,6 +338,15 @@ static const TEST_URL_COMBINE TEST_COMBINE[] = { - {"http://www.winehq.org/test14#aaa/bbb#ccc", "#", 0, S_OK, "http://www.winehq.org/test14#"}, - {"http://www.winehq.org/tests/?query=x/y/z", "tests15", 0, S_OK, "http://www.winehq.org/tests/tests15"}, - {"http://www.winehq.org/tests/?query=x/y/z#example", "tests16", 0, S_OK, "http://www.winehq.org/tests/tests16"}, -+ {"http://www.winehq.org/tests17", ".", 0, S_OK, "http://www.winehq.org/", TRUE}, -+ {"http://www.winehq.org/tests18/test", ".", 0, S_OK, "http://www.winehq.org/tests18/", TRUE}, -+ {"http://www.winehq.org/tests19/test", "./", 0, S_OK, "http://www.winehq.org/tests19/", FALSE}, -+ {"http://www.winehq.org/tests20/test", "/", 0, S_OK, "http://www.winehq.org/", FALSE}, -+ {"http://www.winehq.org/tests/test", "./test21", 0, S_OK, "http://www.winehq.org/tests/test21", FALSE}, -+ {"http://www.winehq.org/tests/test", "./test22/../test", 0, S_OK, "http://www.winehq.org/tests/test", FALSE}, -+ {"http://www.winehq.org/tests/", "http://www.winehq.org:80/tests23", 0, S_OK, "http://www.winehq.org/tests23", TRUE}, -+ {"http://www.winehq.org/tests/", "tests24/./test/../test", 0, S_OK, "http://www.winehq.org/tests/tests24/test", FALSE}, -+ {"http://www.winehq.org/tests/./tests25", "./", 0, S_OK, "http://www.winehq.org/tests/", FALSE}, - {"file:///C:\\dir\\file.txt", "test.txt", 0, S_OK, "file:///C:/dir/test.txt"}, - {"file:///C:\\dir\\file.txt#hash\\hash", "test.txt", 0, S_OK, "file:///C:/dir/file.txt#hash/test.txt"}, - {"file:///C:\\dir\\file.html#hash\\hash", "test.html", 0, S_OK, "file:///C:/dir/test.html"}, -@@ -1077,7 +1095,7 @@ static void test_UrlCanonicalizeW(void) - - /* ########################### */ - --static void test_url_combine(const char *szUrl1, const char *szUrl2, DWORD dwFlags, HRESULT dwExpectReturn, const char *szExpectUrl) -+static void test_url_combine(const char *szUrl1, const char *szUrl2, DWORD dwFlags, HRESULT dwExpectReturn, const char *szExpectUrl, BOOL todo) - { - HRESULT hr; - CHAR szReturnUrl[INTERNET_MAX_URL_LENGTH]; -@@ -1102,34 +1120,42 @@ static void test_url_combine(const char *szUrl1, const char *szUrl2, DWORD dwFla - dwSize = 0; - hr = pUrlCombineA(szUrl1, szUrl2, NULL, &dwSize, dwFlags); - ok(hr == E_POINTER, "Checking length of string, return was 0x%08x, expected 0x%08x\n", hr, E_POINTER); -- ok(dwSize == dwExpectLen+1, "Got length %d, expected %d\n", dwSize, dwExpectLen+1); -+ ok(todo || dwSize == dwExpectLen+1, "Got length %d, expected %d\n", dwSize, dwExpectLen+1); - - dwSize--; - hr = pUrlCombineA(szUrl1, szUrl2, szReturnUrl, &dwSize, dwFlags); - ok(hr == E_POINTER, "UrlCombineA returned 0x%08x, expected 0x%08x\n", hr, E_POINTER); -- ok(dwSize == dwExpectLen+1, "Got length %d, expected %d\n", dwSize, dwExpectLen+1); -+ ok(todo || dwSize == dwExpectLen+1, "Got length %d, expected %d\n", dwSize, dwExpectLen+1); - - hr = pUrlCombineA(szUrl1, szUrl2, szReturnUrl, &dwSize, dwFlags); - ok(hr == dwExpectReturn, "UrlCombineA returned 0x%08x, expected 0x%08x\n", hr, dwExpectReturn); -- ok(dwSize == dwExpectLen, "Got length %d, expected %d\n", dwSize, dwExpectLen); -- if(SUCCEEDED(hr)) { -- ok(strcmp(szReturnUrl,szExpectUrl)==0, "Expected %s, but got %s\n", szExpectUrl, szReturnUrl); -+ -+ if (todo) -+ { -+ todo_wine ok(dwSize == dwExpectLen && (!SUCCEEDED(hr) || strcmp(szReturnUrl, szExpectUrl)==0), -+ "Expected %s (len=%d), but got %s (len=%d)\n", szExpectUrl, dwExpectLen, SUCCEEDED(hr) ? szReturnUrl : "(null)", dwSize); -+ } -+ else -+ { -+ ok(dwSize == dwExpectLen, "Got length %d, expected %d\n", dwSize, dwExpectLen); -+ if (SUCCEEDED(hr)) -+ ok(strcmp(szReturnUrl, szExpectUrl)==0, "Expected %s, but got %s\n", szExpectUrl, szReturnUrl); - } - - if (pUrlCombineW) { - dwSize = 0; - hr = pUrlCombineW(wszUrl1, wszUrl2, NULL, &dwSize, dwFlags); - ok(hr == E_POINTER, "Checking length of string, return was 0x%08x, expected 0x%08x\n", hr, E_POINTER); -- ok(dwSize == dwExpectLen+1, "Got length %d, expected %d\n", dwSize, dwExpectLen+1); -+ ok(todo || dwSize == dwExpectLen+1, "Got length %d, expected %d\n", dwSize, dwExpectLen+1); - - dwSize--; - hr = pUrlCombineW(wszUrl1, wszUrl2, wszReturnUrl, &dwSize, dwFlags); - ok(hr == E_POINTER, "UrlCombineW returned 0x%08x, expected 0x%08x\n", hr, E_POINTER); -- ok(dwSize == dwExpectLen+1, "Got length %d, expected %d\n", dwSize, dwExpectLen+1); -+ ok(todo || dwSize == dwExpectLen+1, "Got length %d, expected %d\n", dwSize, dwExpectLen+1); - - hr = pUrlCombineW(wszUrl1, wszUrl2, wszReturnUrl, &dwSize, dwFlags); - ok(hr == dwExpectReturn, "UrlCombineW returned 0x%08x, expected 0x%08x\n", hr, dwExpectReturn); -- ok(dwSize == dwExpectLen, "Got length %d, expected %d\n", dwSize, dwExpectLen); -+ ok(todo || dwSize == dwExpectLen, "Got length %d, expected %d\n", dwSize, dwExpectLen); - if(SUCCEEDED(hr)) { - wszConvertedUrl = GetWideString(szReturnUrl); - ok(lstrcmpW(wszReturnUrl, wszConvertedUrl)==0, "Strings didn't match between ascii and unicode UrlCombine!\n"); -@@ -1149,7 +1175,7 @@ static void test_UrlCombine(void) - unsigned int i; - for(i=0; i -Date: Fri, 17 Jan 2014 01:27:53 +0100 -Subject: shlwapi: UrlCombineW workaround for relative paths - ---- - dlls/shlwapi/tests/url.c | 4 ++-- - dlls/shlwapi/url.c | 5 ++++- - 2 files changed, 6 insertions(+), 3 deletions(-) - -diff --git a/dlls/shlwapi/tests/url.c b/dlls/shlwapi/tests/url.c -index ecbdfab..8a99f7e 100644 ---- a/dlls/shlwapi/tests/url.c -+++ b/dlls/shlwapi/tests/url.c -@@ -338,8 +338,8 @@ static const TEST_URL_COMBINE TEST_COMBINE[] = { - {"http://www.winehq.org/test14#aaa/bbb#ccc", "#", 0, S_OK, "http://www.winehq.org/test14#"}, - {"http://www.winehq.org/tests/?query=x/y/z", "tests15", 0, S_OK, "http://www.winehq.org/tests/tests15"}, - {"http://www.winehq.org/tests/?query=x/y/z#example", "tests16", 0, S_OK, "http://www.winehq.org/tests/tests16"}, -- {"http://www.winehq.org/tests17", ".", 0, S_OK, "http://www.winehq.org/", TRUE}, -- {"http://www.winehq.org/tests18/test", ".", 0, S_OK, "http://www.winehq.org/tests18/", TRUE}, -+ {"http://www.winehq.org/tests17", ".", 0, S_OK, "http://www.winehq.org/"}, -+ {"http://www.winehq.org/tests18/test", ".", 0, S_OK, "http://www.winehq.org/tests18/"}, - {"http://www.winehq.org/tests19/test", "./", 0, S_OK, "http://www.winehq.org/tests19/", FALSE}, - {"http://www.winehq.org/tests20/test", "/", 0, S_OK, "http://www.winehq.org/", FALSE}, - {"http://www.winehq.org/tests/test", "./test21", 0, S_OK, "http://www.winehq.org/tests/test21", FALSE}, -diff --git a/dlls/shlwapi/url.c b/dlls/shlwapi/url.c -index 11589e4..58eb87c 100644 ---- a/dlls/shlwapi/url.c -+++ b/dlls/shlwapi/url.c -@@ -914,7 +914,10 @@ HRESULT WINAPI UrlCombineW(LPCWSTR pszBase, LPCWSTR pszRelative, - work = preliminary + base.cchProtocol+1+base.cchSuffix - 1; - if (*work++ != '/') - *(work++) = '/'; -- strcpyW(work, relative.pszSuffix); -+ if (relative.pszSuffix[0] == '.' && relative.pszSuffix[1] == 0) -+ *work = 0; -+ else -+ strcpyW(work, relative.pszSuffix); - break; - - default: --- -1.7.9.5 - diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/patches/99-Workarounds/e46b26df-3c1b-419c-9579-f0d1e1c50bea.def wine-compholio-1.7.22~ubuntu13.10.1/patches/99-Workarounds/e46b26df-3c1b-419c-9579-f0d1e1c50bea.def --- wine-compholio-1.7.21~ubuntu13.10.1/patches/99-Workarounds/e46b26df-3c1b-419c-9579-f0d1e1c50bea.def 2014-06-28 05:38:42.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/patches/99-Workarounds/e46b26df-3c1b-419c-9579-f0d1e1c50bea.def 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -Revision: 1 -Author: Sebastian Lackner -Title: Workaround for broken implementation of shlwapi url functions. diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/patches/patch-list.patch wine-compholio-1.7.22~ubuntu13.10.1/patches/patch-list.patch --- wine-compholio-1.7.21~ubuntu13.10.1/patches/patch-list.patch 2014-06-28 05:38:42.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/patches/patch-list.patch 2014-07-11 19:37:29.000000000 +0000 @@ -6,7 +6,7 @@ index a273502..5fa0cd5 100644 --- a/libs/wine/config.c +++ b/libs/wine/config.c -@@ -478,6 +478,43 @@ const char *wine_get_version(void) +@@ -478,6 +478,44 @@ const char *wine_get_version(void) return PACKAGE_VERSION; } @@ -29,6 +29,9 @@ + { "3d7c4774-9e7f-11e3-9cfc-0090f5c75ad5:1", "Erich E. Hoover", "Implement missing fonts expected by Silverlight." }, + { "e7581ed7-12b3-4ed3-835b-5a62afbf9c85:4", "Sebastian Lackner", "Use lockfree implementation for get_cached_fd." }, + { "3405aa34-f341-11e3-83ce-0090f5c75ad5:1", "Erich E. Hoover", "Add default security descriptor ownership and DACLs for processes." }, ++ { "e46b26df-3c1b-419c-9579-f0d1e1c50bea:1", "Sebastian Lackner", "Workaround for broken implementation of shlwapi url functions." }, ++ { "3790a2d5-f930-423e-9c03-f7fc1c1e0811:1", "Sebastian Lackner", "Partial implementation of WTSEnumerateProcessesW." }, ++ { "a3f43350-092c-11e4-9b1e-0090f5c75ad5:1", "Joris van der Wel", "Implement passing ACLs to CreateProcess." }, + { "0b21d7ac-0387-4493-aa38-fbafe3e749f5:2", "Michael Müller", "Decrease minimum SetTimer interval to 5 ms." }, + { "2394843e-2bc4-4fa4-8368-1ef32093b89e:1", "Michael Müller", "Allow changing strict draw ordering through an exported function." }, + { "255473fa-4e0a-4f51-952b-4deecc1a2181:1", "Michael Müller", "Indicate direct rendering through OpenGL extension." }, @@ -36,8 +39,6 @@ + { "325645ba-d39d-4de4-9c94-3fe694eedaab:1", "Sebastian Lackner", "kernel32: Silence repeated CompareStringEx FIXME." }, + { "acff3012-0f75-4710-9941-08b5ce4c61f3:2", "Erich E. Hoover", "wined3d: Silence repeated resource_check_usage FIXME." }, + { "c7263660-be78-439b-979f-e745a8d87120:1", "Sebastian Lackner", "wined3d: Silence repeated wined3d_swapchain_present FIXME." }, -+ { "eec5dea8-879d-417b-9f97-364deaae6576:1", "Sebastian Lackner", "Add tests for IVMRMonitorConfig." }, -+ { "e46b26df-3c1b-419c-9579-f0d1e1c50bea:1", "Sebastian Lackner", "Workaround for broken implementation of shlwapi url functions." }, + { NULL, NULL, NULL } +}; + diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/programs/cmd/builtins.c wine-compholio-1.7.22~ubuntu13.10.1/programs/cmd/builtins.c --- wine-compholio-1.7.21~ubuntu13.10.1/programs/cmd/builtins.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/programs/cmd/builtins.c 2014-07-11 19:15:41.000000000 +0000 @@ -874,7 +874,7 @@ if (thiscopy->binarycopy == -1) thiscopy->binarycopy = !anyconcats; /* Convert to fully qualified path/filename in srcpath, file filenamepart pointing - to where the filename portion begins (used for wildcart expansion. */ + to where the filename portion begins (used for wildcard expansion). */ GetFullPathNameW(thiscopy->name, sizeof(srcpath)/sizeof(WCHAR), srcpath, &filenamepart); WINE_TRACE("Full src name is '%s'\n", wine_dbgstr_w(srcpath)); diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/programs/cmd/wcmdmain.c wine-compholio-1.7.22~ubuntu13.10.1/programs/cmd/wcmdmain.c --- wine-compholio-1.7.21~ubuntu13.10.1/programs/cmd/wcmdmain.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/programs/cmd/wcmdmain.c 2014-07-11 19:15:41.000000000 +0000 @@ -1605,8 +1605,8 @@ case WCMD_FOR: case WCMD_IF: /* Very oddly, probably because of all the special parsing required for - these two commands, neither for nor if are supported when called, - ie call if 1==1... will fail. */ + these two commands, neither 'for' nor 'if' is supported when called, + i.e. 'call if 1==1...' will fail. */ if (!retrycall) { if (i==WCMD_FOR) WCMD_for (p, cmdList); else if (i==WCMD_IF) WCMD_if (p, cmdList); diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/programs/winebrowser/main.c wine-compholio-1.7.22~ubuntu13.10.1/programs/winebrowser/main.c --- wine-compholio-1.7.21~ubuntu13.10.1/programs/winebrowser/main.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/programs/winebrowser/main.c 2014-07-11 19:15:41.000000000 +0000 @@ -309,15 +309,69 @@ return ret; } -static IUri *convert_file_uri(IUri *uri) +static WCHAR *encode_unix_path(const char *src) +{ + const char *tmp_src; + WCHAR *dst, *tmp_dst; + const char safe_chars[] = "/-_.~@&=+$,:"; + const char hex_digits[] = "0123456789ABCDEF"; + const WCHAR schema[] = {'f','i','l','e',':','/','/',0}; + int len = sizeof(schema)/sizeof(schema[0]); + + tmp_src = src; + + while (*tmp_src != 0) + { + if ((*tmp_src >= 'a' && *tmp_src <= 'z') || + (*tmp_src >= 'A' && *tmp_src <= 'Z') || + (*tmp_src >= '0' && *tmp_src <= '9') || + strchr(safe_chars, *tmp_src)) + len += 1; + else + len += 3; + tmp_src++; + } + + dst = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR)); + + if (!dst) + return NULL; + + strcpyW(dst, schema); + + tmp_src = src; + tmp_dst = dst + strlenW(dst); + + while (*tmp_src != 0) + { + if ((*tmp_src >= 'a' && *tmp_src <= 'z') || + (*tmp_src >= 'A' && *tmp_src <= 'Z') || + (*tmp_src >= '0' && *tmp_src <= '9') || + strchr(safe_chars, *tmp_src)) + { + *tmp_dst++ = *tmp_src; + } + else + { + *tmp_dst++ = '%'; + *tmp_dst++ = hex_digits[*(unsigned char*)(tmp_src) / 16]; + *tmp_dst++ = hex_digits[*tmp_src & 0xf]; + } + tmp_src++; + } + + *tmp_dst = 0; + + return dst; +} + +static WCHAR *convert_file_uri(IUri *uri) { wine_get_unix_file_name_t wine_get_unix_file_name_ptr; - IUriBuilder *uri_builder; struct stat dummy; WCHAR *new_path; char *unixpath; BSTR filename; - IUri *new_uri; HRESULT hres; /* check if the argument is a local file */ @@ -330,15 +384,13 @@ if(FAILED(hres)) return NULL; + WINE_TRACE("Windows path: %s\n", wine_dbgstr_w(filename)); + unixpath = wine_get_unix_file_name_ptr(filename); SysFreeString(filename); if(unixpath && stat(unixpath, &dummy) >= 0) { - int len; - - len = MultiByteToWideChar(CP_UNIXCP, 0, unixpath, -1, NULL, 0); - new_path = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR)); - if(new_path) - MultiByteToWideChar(CP_UNIXCP, 0, unixpath, -1, new_path, len); + WINE_TRACE("Unix path: %s\n", wine_dbgstr_a(unixpath)); + new_path = encode_unix_path(unixpath); HeapFree(GetProcessHeap(), 0, unixpath); }else { WINE_WARN("File %s does not exist\n", wine_dbgstr_a(unixpath)); @@ -346,19 +398,9 @@ new_path = NULL; } - hres = CreateIUriBuilder(uri, 0, 0, &uri_builder); - if(SUCCEEDED(hres) && new_path) - hres = IUriBuilder_SetPath(uri_builder, new_path); - HeapFree(GetProcessHeap(), 0, new_path); - if(FAILED(hres)) - return NULL; + WINE_TRACE("New path: %s\n", wine_dbgstr_w(new_path)); - hres = IUriBuilder_CreateUri(uri_builder, 0, 0, 0, &new_uri); - IUriBuilder_Release(uri_builder); - if(FAILED(hres)) - return NULL; - - return new_uri; + return new_path; } /***************************************************************************** @@ -370,7 +412,7 @@ static const WCHAR nohomeW[] = {'-','n','o','h','o','m','e',0}; WCHAR *url = argv[1]; - BSTR display_uri; + BSTR display_uri = NULL; DWORD scheme; IUri *uri; HRESULT hres; @@ -398,18 +440,14 @@ IUri_GetScheme(uri, &scheme); if(scheme == URL_SCHEME_FILE) { - IUri *file_uri; - - file_uri = convert_file_uri(uri); - if(file_uri) { - IUri_Release(uri); - uri = file_uri; - }else { + display_uri = convert_file_uri(uri); + if(!display_uri) { WINE_ERR("Failed to convert file URL to unix path\n"); } } - hres = IUri_GetDisplayUri(uri, &display_uri); + if (!display_uri) + hres = IUri_GetDisplayUri(uri, &display_uri); IUri_Release(uri); if(FAILED(hres)) return -1; diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/README.md wine-compholio-1.7.22~ubuntu13.10.1/README.md --- wine-compholio-1.7.21~ubuntu13.10.1/README.md 2014-06-28 05:38:42.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/README.md 2014-07-11 19:37:29.000000000 +0000 @@ -1,17 +1,20 @@ -wine-compholio-daily -==================== +wine-compholio +============== -Daily updates for the Wine "Compholio" Edition. +The Wine "Compholio" Edition repository includes a variety of patches for Wine to run common Windows applications under Linux. Current patches include: -* Support for interface change notifications (http://bugs.winehq.org/show_bug.cgi?id=32328) -* Support for stored file ACLs (http://bugs.winehq.org/show_bug.cgi?id=31858) -* Support for inherited file ACLs (http://bugs.winehq.org/show_bug.cgi?id=34406) -* Support for Junction Points (http://bugs.winehq.org/show_bug.cgi?id=12401) -* Support for TransmitFile (http://bugs.winehq.org/show_bug.cgi?id=5048) + +* Support for interface change notifications ([Wine Bug #32328](http://bugs.winehq.org/show_bug.cgi?id=32328)) +* Support for stored file ACLs ([Wine Bug #31858](http://bugs.winehq.org/show_bug.cgi?id=31858)) +* Support for inherited file ACLs ([Wine Bug #34406](http://bugs.winehq.org/show_bug.cgi?id=34406)) +* Support for Junction Points ([Wine Bug #12401](http://bugs.winehq.org/show_bug.cgi?id=12401)) +* Support for TransmitFile ([Wine Bug #5048](http://bugs.winehq.org/show_bug.cgi?id=5048)) * Support for GetVolumePathName -* Implement an Arial replacement font (http://bugs.winehq.org/show_bug.cgi?id=32323) -* Workaround for TransactNamedPipe not being supported (http://bugs.winehq.org/show_bug.cgi?id=17273) +* Implement an Arial replacement font ([Wine Bug #32323](http://bugs.winehq.org/show_bug.cgi?id=32323)) +* Workaround for TransactNamedPipe not being supported ([Wine Bug #17273](http://bugs.winehq.org/show_bug.cgi?id=17273)) +* Fix incorrect scaling for DECIMAL values in VarDecAdd ([Wine Bug #31269](http://bugs.winehq.org/show_bug.cgi?id=31269)) +* Return NULL-terminated list of arguments in CommandLineToArgvW ([Wine Bug #22829](http://bugs.winehq.org/show_bug.cgi?id=22829)) * XEMBED support for embedding Wine windows inside Linux applications * Reduced SetTimer minimum value from 15 ms to 5 ms (improves Silverlight framerates) * Lockfree algorithm for filedescriptor cache (improves file access speed) diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/server/object.c wine-compholio-1.7.22~ubuntu13.10.1/server/object.c --- wine-compholio-1.7.21~ubuntu13.10.1/server/object.c 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/server/object.c 2014-07-11 19:15:41.000000000 +0000 @@ -436,24 +436,36 @@ new_sd.control = sd->control & ~SE_SELF_RELATIVE; - owner = sd_get_owner( sd ); - if (set_info & OWNER_SECURITY_INFORMATION && owner) + if (set_info & OWNER_SECURITY_INFORMATION && sd->owner_len) + { + owner = sd_get_owner( sd ); new_sd.owner_len = sd->owner_len; + } + else if (obj->sd && obj->sd->owner_len) + { + owner = sd_get_owner( obj->sd ); + new_sd.owner_len = obj->sd->owner_len; + } else { owner = token_get_user( current->process->token ); new_sd.owner_len = security_sid_len( owner ); - new_sd.control |= SE_OWNER_DEFAULTED; } - group = sd_get_group( sd ); - if (set_info & GROUP_SECURITY_INFORMATION && group) + if (set_info & GROUP_SECURITY_INFORMATION && sd->group_len) + { + group = sd_get_group( sd ); new_sd.group_len = sd->group_len; + } + else if (obj->sd && obj->sd->group_len) + { + group = sd_get_group( obj->sd ); + new_sd.group_len = obj->sd->group_len; + } else { group = token_get_primary_group( current->process->token ); new_sd.group_len = security_sid_len( group ); - new_sd.control |= SE_GROUP_DEFAULTED; } new_sd.control |= SE_SACL_PRESENT; @@ -469,7 +481,6 @@ else { new_sd.sacl_len = 0; - new_sd.control |= SE_SACL_DEFAULTED; } } @@ -487,7 +498,6 @@ { dacl = token_get_default_dacl( current->process->token ); new_sd.dacl_len = dacl->AclSize; - new_sd.control |= SE_DACL_DEFAULTED; } } diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/tools/c2man.pl wine-compholio-1.7.22~ubuntu13.10.1/tools/c2man.pl --- wine-compholio-1.7.21~ubuntu13.10.1/tools/c2man.pl 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/tools/c2man.pl 2014-07-11 19:15:41.000000000 +0000 @@ -521,7 +521,7 @@ s/\[I\]|\[i\]|\[in\]|\[IN\]/\[In\] /g; s/\[O\]|\[o\]|\[out\]|\[OUT\]/\[Out\]/g; s/\[I\/O\]|\[I\,O\]|\[i\/o\]|\[in\/out\]|\[IN\/OUT\]/\[In\/Out\]/g; - # TRUE/FALSE/NULL are defines, capitilise them + # TRUE/FALSE/NULL are defines, capitalise them s/True|true/TRUE/g; s/False|false/FALSE/g; s/Null|null/NULL/g; diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/tools/make_unicode wine-compholio-1.7.22~ubuntu13.10.1/tools/make_unicode --- wine-compholio-1.7.21~ubuntu13.10.1/tools/make_unicode 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/tools/make_unicode 2014-07-11 19:15:41.000000000 +0000 @@ -131,6 +131,12 @@ "defin" => 0x0200 ); +my %bracket_types = +( + "o" => 0x0000, + "c" => 0x0001, +); + my %indic_types = ( "Other" => 0x0000, @@ -1234,7 +1240,6 @@ print OUTPUT "/* generated from $UNIDATA/IndicSyllabicCategory.txt */\n"; print OUTPUT "/* and from $UNIDATA/IndicMatraCategory.txt */\n"; print OUTPUT "/* DO NOT EDIT!! */\n\n"; - print OUTPUT "#include \"wine/unicode.h\"\n\n"; dump_two_level_mapping( "indic_syllabic_table", @indic_table); @@ -1282,7 +1287,6 @@ print OUTPUT "/* Unicode Line Break Properties */\n"; print OUTPUT "/* generated from $UNIDATA/LineBreak.txt */\n"; print OUTPUT "/* DO NOT EDIT!! */\n\n"; - print OUTPUT "#include \"wine/unicode.h\"\n\n"; dump_two_level_mapping( "wine_linebreak_table", @break_table); @@ -1324,6 +1328,43 @@ save_file($filename); } +################################################################ +# dump the Bidi Brackets +sub dump_bracket($) +{ + my $filename = shift; + my @bracket_table = (0) x 65536;; + + my $INPUT = open_data_file( $UNIDATA, "BidiBrackets.txt" ); + while (<$INPUT>) + { + next if /^\#/; # skip comments + next if /^\s*$/; # skip empty lines + next if /\x1a/; # skip ^Z + if (/^\s*([0-9a-fA-F]+)\s*;\s*([0-9a-fA-F]+);\s*([con])/) + { + my $type = $3; + die "unknown bracket $type" unless defined $bracket_types{$type}; + die "characters too distant $1 and $2" if abs(hex($2) - hex($1)) >= 128; + $bracket_table[hex $1] = (hex($2) - hex($1)) % 255; + $bracket_table[hex $1] += $bracket_types{$type} << 8; + next; + } + die "malformed line $_"; + } + close $INPUT; + + open OUTPUT,">$filename.new" or die "Cannot create $filename"; + print "Building $filename\n"; + print OUTPUT "/* Unicode Bidirectional Bracket table */\n"; + print OUTPUT "/* generated from $UNIDATA/BidiBrackets.txt */\n"; + print OUTPUT "/* DO NOT EDIT!! */\n\n"; + + dump_two_level_mapping( "bidi_bracket_table", @bracket_table); + + close OUTPUT; + save_file($filename); +} ################################################################ # dump the Arabic shaping table @@ -1358,7 +1399,6 @@ print OUTPUT "/* Unicode Arabic shaping */\n"; print OUTPUT "/* generated from $UNIDATA/ArabicShaping.txt */\n"; print OUTPUT "/* DO NOT EDIT!! */\n\n"; - print OUTPUT "#include \"wine/unicode.h\"\n\n"; dump_two_level_mapping( "wine_shaping_table", @joining_table ); @@ -1419,7 +1459,6 @@ print OUTPUT "/* Unicode Vertical Orientation */\n"; print OUTPUT "/* generated from $VERTICALDATA/VerticalOrientation-11.txt */\n"; print OUTPUT "/* DO NOT EDIT!! */\n\n"; - print OUTPUT "#include \"wine/unicode.h\"\n\n"; dump_two_level_mapping( "vertical_orientation_table", @vertical_table); @@ -1755,7 +1794,6 @@ print OUTPUT "/* Nameprep algorithm related data */\n"; print OUTPUT "/* generated from $RFCS/$STRINGPREP */\n"; print OUTPUT "/* DO NOT EDIT!! */\n\n"; - print OUTPUT "#include \"wine/unicode.h\"\n\n"; dump_two_level_mapping( "nameprep_char_type", @flags_table ); @@ -1793,7 +1831,7 @@ } # dump the main index - printf OUTPUT "const WCHAR nameprep_mapping[%d] =\n", $total; + printf OUTPUT "const unsigned short nameprep_mapping[%d] =\n", $total; printf OUTPUT "{\n /* index */\n"; printf OUTPUT "%s", DUMP_ARRAY( "0x%04x", 0, @filled_idx ); printf OUTPUT ",\n /* null sub-index */\n%s", DUMP_ARRAY( "0x%04x", 0, ($null_offset) x 16 ); @@ -2233,6 +2271,7 @@ DUMP_COMPOSE_TABLES( "libs/wine/compose.c" ); DUMP_CTYPE_TABLES( "libs/wine/wctype.c" ); dump_mirroring( "dlls/usp10/mirror.c" ); +dump_bracket( "dlls/usp10/bracket.c" ); dump_shaping( "dlls/usp10/shaping.c" ); dump_linebreak( "dlls/usp10/linebreak.c" ); dump_indic( "dlls/usp10/indicsyllable.c" ); diff -Nru wine-compholio-1.7.21~ubuntu13.10.1/VERSION wine-compholio-1.7.22~ubuntu13.10.1/VERSION --- wine-compholio-1.7.21~ubuntu13.10.1/VERSION 2014-06-28 05:20:15.000000000 +0000 +++ wine-compholio-1.7.22~ubuntu13.10.1/VERSION 2014-07-11 19:15:41.000000000 +0000 @@ -1 +1 @@ -Wine version 1.7.21 +Wine version 1.7.22