From 51223d07c0073ed002a45685f2b8dc2ab6be5fb6 Mon Sep 17 00:00:00 2001 From: Jan Zerebecki Date: Tue, 23 Dec 2008 20:48:45 +0100 Subject: [PATCH] push 94e35525417ba0671ead00a6c6dfaaed30f46234 --- ANNOUNCE | 1533 ++++++++++++++------------ VERSION | 2 +- configure | 88 +- configure.ac | 17 +- dlls/Makedll.rules.in | 2 +- dlls/crypt32/crl.c | 2 +- dlls/crypt32/ctl.c | 23 +- dlls/crypt32/store.c | 40 + dlls/cryptui/Makefile.in | 2 +- dlls/cryptui/cryptui.spec | 4 +- dlls/cryptui/cryptui_En.rc | 103 ++ dlls/cryptui/cryptuires.h | 50 + dlls/cryptui/main.c | 1366 +++++++++++++++++++++-- dlls/cryptui/tests/cryptui.c | 160 +++ dlls/d3d9/tests/shader.c | 8 - dlls/d3d9/vertexshader.c | 1 + dlls/d3dxof/d3dxof.c | 71 +- dlls/d3dxof/d3dxof_private.h | 6 +- dlls/d3dxof/tests/d3dxof.c | 51 +- dlls/ddraw/tests/visual.c | 26 +- dlls/dmime/dmutils.c | 47 +- dlls/dmstyle/dmutils.c | 47 +- dlls/dmusic/dmusic.c | 12 +- dlls/dmusic/downloadedinstrument.c | 3 +- dlls/dmusic/port.c | 37 +- dlls/dsound/primary.c | 23 +- dlls/gdi32/enhmfdrv/bitblt.c | 12 +- dlls/gdi32/enhmfdrv/dc.c | 48 +- dlls/gdi32/enhmfdrv/enhmetafiledrv.h | 326 +++--- dlls/gdi32/enhmfdrv/graphics.c | 48 +- dlls/gdi32/enhmfdrv/mapping.c | 26 +- dlls/gdi32/enhmfdrv/objects.c | 14 +- dlls/gdi32/freetype.c | 157 ++- dlls/gdi32/gdi_private.h | 268 ++--- dlls/gdi32/mfdrv/bitblt.c | 28 +- dlls/gdi32/mfdrv/dc.c | 48 +- dlls/gdi32/mfdrv/graphics.c | 44 +- dlls/gdi32/mfdrv/init.c | 6 +- dlls/gdi32/mfdrv/mapping.c | 18 +- dlls/gdi32/mfdrv/metafiledrv.h | 327 +++--- dlls/gdi32/mfdrv/objects.c | 16 +- dlls/gdi32/mfdrv/text.c | 2 +- dlls/itircl/itircl.spec | 6 +- dlls/itircl/itircl_main.c | 27 + dlls/kernel32/path.c | 4 +- dlls/kernel32/process.c | 2 +- dlls/mciavi32/info.c | 2 +- dlls/mciseq/mcimidi.c | 2 +- dlls/mshtml/editor.c | 2 +- dlls/mshtml/htmlstylesheet.c | 4 +- dlls/mshtml/nsembed.c | 8 +- dlls/mshtml/nsio.c | 2 + dlls/mshtml/olecmd.c | 2 +- dlls/msi/media.c | 18 +- dlls/msvcrt/tests/file.c | 18 +- dlls/msvfw32/msvideo_main.c | 6 +- dlls/msxml3/node.c | 26 +- dlls/msxml3/tests/domdoc.c | 28 + dlls/ntdll/loader.c | 2 +- dlls/ntdll/serial.c | 30 +- dlls/ole32/clipboard.c | 3 +- dlls/ole32/tests/clipboard.c | 3 +- dlls/pidgen/Makefile.in | 2 +- dlls/riched20/editor.c | 4 +- dlls/riched20/table.c | 5 +- dlls/rpcrt4/rpc_transport.c | 8 + dlls/secur32/dispatcher.c | 5 + dlls/shell32/folder.ico | Bin 15086 -> 15086 bytes dlls/shell32/folder.svg | 323 +++++- dlls/shell32/folder_open.ico | Bin 15086 -> 15086 bytes dlls/shell32/{folder.svg => folder_open.svg} | 347 +++++- dlls/shell32/tests/shlfileop.c | 248 ++++- dlls/shell32/trash.c | 20 +- dlls/sxs/sxs.c | 3 - dlls/user32/driver.c | 240 ++-- dlls/user32/sysparams.c | 22 +- dlls/user32/user_private.h | 104 +- dlls/winealsa.drv/waveinit.c | 5 +- dlls/winecoreaudio.drv/audiounit.c | 7 +- dlls/winecoreaudio.drv/coremidi.c | 8 +- dlls/winecoreaudio.drv/midi.c | 4 + dlls/wined3d/directx.c | 1 - dlls/wined3d/wined3d_gl.h | 8 +- dlls/wined3d/wined3d_main.c | 6 +- dlls/wined3d/wined3d_private.h | 4 +- dlls/wineoss.drv/midi.c | 3 + dlls/winex11.drv/bitblt.c | 12 +- dlls/winex11.drv/bitmap.c | 10 +- dlls/winex11.drv/brush.c | 4 +- dlls/winex11.drv/clipboard.c | 24 +- dlls/winex11.drv/dib.c | 22 +- dlls/winex11.drv/event.c | 6 +- dlls/winex11.drv/graphics.c | 42 +- dlls/winex11.drv/init.c | 12 +- dlls/winex11.drv/keyboard.c | 26 +- dlls/winex11.drv/mouse.c | 10 +- dlls/winex11.drv/opengl.c | 76 +- dlls/winex11.drv/pen.c | 4 +- dlls/winex11.drv/scroll.c | 4 +- dlls/winex11.drv/settings.c | 6 +- dlls/winex11.drv/text.c | 6 +- dlls/winex11.drv/window.c | 44 +- dlls/winex11.drv/x11drv.h | 156 ++- dlls/winex11.drv/x11drv_main.c | 8 +- dlls/winex11.drv/xfont.c | 12 +- dlls/winex11.drv/xinerama.c | 4 +- dlls/winex11.drv/xrender.c | 82 +- dlls/winex11.drv/xvidmode.c | 4 +- dlls/winhttp/Makefile.in | 1 + dlls/wininet/ftp.c | 78 +- dlls/wininet/tests/ftp.c | 85 +- dlls/winmm/joystick.c | 9 + dlls/winmm/tests/mixer.c | 95 +- dlls/winmm/winmm.c | 2 +- dlls/winmm/winmm.spec | 2 +- dlls/wintrust/asn.c | 7 +- dlls/wintrust/crypt.c | 591 +++++++++- dlls/wintrust/tests/crypt.c | 79 +- dlls/wintrust/wintrust.spec | 14 +- dlls/ws2_32/socket.c | 24 + dlls/ws2_32/ws2_32.spec | 1 + include/config.h.in | 21 +- include/mscat.h | 37 +- include/richedit.h | 2 +- include/winbase.h | 4 +- include/wincrypt.h | 2 + include/wine/exception.h | 2 +- include/wine/port.h | 24 +- include/wingdi.h | 7 +- libs/port/Makefile.in | 2 + libs/port/poll.c | 77 ++ dlls/sxs/sxs.c => libs/port/symlink.c | 37 +- programs/start/start.c | 2 +- programs/winecfg/En.rc | 2 +- programs/winedevice/device.c | 24 +- programs/winepath/winepath.c | 4 +- 136 files changed, 6098 insertions(+), 2395 deletions(-) rewrite ANNOUNCE (96%) rewrite dlls/gdi32/enhmfdrv/enhmetafiledrv.h (77%) rewrite dlls/gdi32/mfdrv/metafiledrv.h (71%) rewrite dlls/shell32/folder.ico (80%) rewrite dlls/shell32/folder_open.ico (81%) copy dlls/shell32/{folder.svg => folder_open.svg} (61%) create mode 100644 libs/port/poll.c copy dlls/sxs/sxs.c => libs/port/symlink.c (57%) diff --git a/ANNOUNCE b/ANNOUNCE dissimilarity index 96% index c2a9afc4a20..bbbe77dffe0 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,701 +1,832 @@ -The Wine development release 1.1.10 is now available. - -What's new in this release (see below for details): - - Support for virtual memory write watches. - - Workarounds for the WINAPI compiler bug on Mac OS. - - Several fixes for the 64-bit build. - - Some more GdiPlus functions. - - Various bug fixes. - -The source is available from the following locations: - - http://ibiblio.org/pub/linux/system/emulators/wine/wine-1.1.10.tar.bz2 - http://prdownloads.sourceforge.net/wine/wine-1.1.10.tar.bz2 - -Binary packages for various distributions will be available from: - - http://www.winehq.org/site/download - -You will find documentation on http://www.winehq.org/site/documentation - -You can also get the current source directly from the git -repository. Check http://www.winehq.org/site/git for details. - -Wine is available thanks to the work of many people. See the file -AUTHORS in the distribution for the complete list. - ----------------------------------------------------------------- - -Bugs fixed in 1.1.10: - - 709 riched32.dll needs to be improved a lot (was:Richedit does not handle input with PTE) - 1114 Winrar2.90/3.00: Comboex doesn't trigger a event when you mouse-click in some value of it - 1700 Failed to detect Serial Port - 1990 modifier keys not released when switching desktop - 2872 Superpower2 fails to install - 2934 Microsoft Masked Controls 6 Problem - 3552 Unhandled dwRenderStateType playing DeusEx - 3769 photodex plug in or self contained exe's uses 100% CPU - 4090 eMule Plus text entry behavior is broken. cursor is lost in some conditions. - 4095 Warcraft III Polish installer crashes - 4678 DirectX sound doesn't work with OSS Sound driver - 4752 wine client error:1e: write: Bad file descriptor - 5462 Half-Life 2 runs in only part of screen instead of fullscreen (no window) - 5786 Crash while using MSRDO in a Visual Basic 5 Application - 5810 Squeak won't start, complains "failed to create pipe" - 5828 Command and Conquer Generals (Zero Hour) doesn't change the mouse cursor from the default X mouse - 6256 Ankh Demo crashes in DirectX mode - 6314 Emperor.exe crashes when -c is not given in commandline options - 6343 a-10 cuba fails to change resolution and to be topmost window - 6393 Ocad crash report - 6413 Floating point bug exposed in Director MX - 6453 MPLAB 7.43 crashes at startup - 6491 Chief Architech: resizing kde window creates several cloned wine buttons next to file in the bar - 6557 Classic99 v3.7 starts runs extremely slowly - 6587 Missing COM interface Release call in the IGraphBuilder implementation - 6588 Strange return value of the GraphBuilder_Connect function - 6693 wink 2.0 can't capture - 6760 warn:palette:GDISelectPalette invalid selected palette (nil) - 6801 gpstrack help windows are empty - 6807 Sunbird crashes on first run - 6821 Graphical artifacts in HL2:EP1 - 6882 vb3 app hornresp won't run, complains "Invalid property value" on startup. - 6883 vb3 app hornresp crashes on startup - 7113 Hitman Contracts hangs when using Direct3D mode - 7145 Miranda crashes while opening a message window - 7205 Using ALT-F to bring up File menu crashes foobar2000 - 7371 Steinberg License Manager lcc.exe does not run, causes many ole:err - 7440 Command and Conquer Generals (Zero Hour) non-buildable items show as black and white rather than greyscale - 7451 Unreal Editor bitblt fails and crashes - 7538 IvAe crashes with GLXBadDrawable error - 7709 err:d3d_shader:vshader_input_is_color Error - 7903 Crash in CircumReality (maybe related to MIDI) - 7986 Citavi trial fails to install correctly - 8064 DxO Optics Pro 4 installer doesn't display text properly - 8122 Command and Conqueror 3 renders incorrectly with >Low VFX detail - 8134 Finale Notepad 2007: Random crashes during playback. - 8228 Mediamonkey 2.5.5 hangs on startup - 8312 Startopia Demo: Freezes after starting application - 8515 Game Runaway: The dream of the Turtle does not start - 8525 Pokerstars cashier window freezes - 8584 IL-2 Sturmovik: fixme:dbghelp:addr_to_linear Failed to linearize address 4545:00005246 (mode 0) - 8603 Installer crashers during install of Life Balance - 8789 d3d:IWineD3DDeviceImpl_SetMaterial - 8830 IM fails when edit box is a child window in a separate process - 8949 Neocron 2.2 Client.exe crashes at character selection screen - 8998 Unhandled page fault with ME_MarkForPainting in WASTE 1.5 - 9296 Info Select 2007 crashes on startup - 9335 Cannot switch tabs in MYOB - 9349 wine 0.9.43 crash on etherlords 2 - 9353 CreateFile with OPEN_ALWAYS on an existing directory fails with ERROR_ACCESS_DENIED - 9367 Quicktime Player 7.1.0.210 aborts on startup - 9377 Ricochet Infinity cannot download Level Set Catalog - 9514 ABBYY FineReader 8.0 Professional Edition does not start - 9627 Graphical corruption in EVE ONLINE - 9648 Birthday selector in account creation screen positioning is off - 9683 BlipGen's ui disappears - 9773 FileMaker crashes - 9977 Google Earth geographical labels behave strangely - 10029 Tahoma entry in registry, but tahoma related errors re-occur followed by registry entry vanishing - 10104 Oblivion Construction Set main window disappears - 10123 sample .msi file from The Definitive Guide to Windows Installer Chapter 14 crashes wine - 10166 HTML Help (CHM) not working - 10208 testing the high color mode - 10241 Fonts are unreadable when using Turkish Locale - 10420 Nostradamus demo fails to start - 10475 Safari: no space between menu items in menubar - 10492 SDL-based game won't start unless you copy timidity.cfg into current directory - 10511 crash istool on run help/search help/context help/index - 10513 The I of the Dragon: Access violation - 10589 speedfan 4.32 crashes when opened - 10676 Sega rally 2 crashes on start - 10708 Wine lacks support for animated cursors - 10746 ADinstrument Chart crashes when opening a file - 10909 Soul Reaver 2: raziel moves up and down very fast when swimming - 10979 Descent FreeSpace Retail and Demo hang - 11053 Tropico 2: blank screen - 11200 hhctrl.ocx crash in stream_chr - 11517 Microsoft Virtual Earth 3D beta fails to install - 11541 NSIS calls not working on installer - 11813 Port royale: Sound very jittery - 11997 Crash error "Frichinline" on Miranda IM with History++ plugin - 12105 Safari does not have window decorations on KDE - 12125 Enable option No windows border, but use X window manager - 12224 particle effects disappear in everquest 2 - 12256 MathCAD 2000 Pro embedded bit maps not drawn correctly in worksheet - 12646 Guild Wars hang on : GUild Wars hang on this : err:d3d:IWineD3DDeviceImpl_SetLightEnable Too many concurrently active lights - 12756 GunboundWC does not run - 12767 Crash on close of hh when showing any real help file - 12820 Age of Mythology GOLD has strange bars near text - 12951 original lotro-launcher under wine - 13008 tntMPD program will install but not execute (throws error and quits) - 13153 SmartBarXP closes during startup - 13184 Settler 6 Demo SegFault - 13283 ArchiCAD 11 cannot install, overflow of free space? - 13519 Master of Orion 3 shows black screen - 13716 ISIS Draw atom symbol selector disappears - 14208 Star Wars Galactic Battlegrounds crashes - 14270 KeepTools hora.exe gives "OLE error 80004001" at startup - 14440 SWAT4: Severe graphics glitches - 14473 msn 8.5 final does not show the initial screen - 14919 Atomic Bomberman reports 2 gamepads, when 4 are present. - 14993 Microsoft Office 2003 installation not finishing correctly - 15064 MSN Messenger 7.0 hangs after configuring the webcam - 15070 HxD cant find Internetupdate - 15263 Cannot install games in Steam (requires opening new iexplore window) - 15559 winealsa sound regression: scratchiness/stutter in multiple games - 15571 Adobe Photoshop CS3 aborts with missing gdiplus functions - 15748 .NET 1.1's dotnetfx fails to install, aborts when it can't stop the msi service? - 15788 Battlefield 1942 fails to install - 16011 widl: Complex structs should have their pointer layout section after the structure's description - 16090 Fritz 11 Crashes on exit with builtin shdocvw - 16157 Rhino 4.0 fails to install, MSI version not found - 16180 Delphi 1 app won't start, dos support unavailable - 16207 After running for an indeterminate amount of time, the system tray icon disappears. - 16213 Excel 2003 hangs on formulas - Regression from 1.1.8 - 16247 Safari crashes on launch - 16261 SmartBarXP crashes during launch - 16266 Avatar legends of the arena cannot access it's database - 16269 InternetCreateUrl does not encode URL_COMPONENTS.lpszExtraInfo - 16287 InternetCreateUrl does not encode URL_COMPONENTS.lpszExtraInfo - 16318 ‘GdipMultiplyMatrix’ discards qualifiers from pointer target type - 16319 winealsa: compiler errors - 16321 test_ImmSetCompositionString passing argument 1 of ‘winetest_ok’ makes integer from pointer without a cast - ----------------------------------------------------------------- - -Changes since 1.1.9: - -Alexander Morozov (1): - ntoskrnl.exe: Fix ObfDereferenceObject function calling convention. - -Alexandre Julliard (96): - configure: Print a few more hints about requiring 32-bit libraries. - kernel32: Fix the base DOS memory address when the low 64K are not accessible. - winetest: Optionally compress the distributed exe with upx. - services: Properly initialize service status at creation time. - ntdll: Check for valid memory view size directly in VIRTUAL_FindView. - ntdll: Pass the error code to VIRTUAL_HandleFault, and allow it to ignore the exception. - ntdll: Add support for virtual write watches. - widl: Make sure format strings for structure and union types are only output once. - kernel32/tests: Fix the unimplemented check for EnumSystemLanguageGroupsA. - user32/tests: Fix a number of window tests on Win9x and Vista. - advapi32: Reimplemented ChangeServiceConfig2W in services.exe. - widl: Fix the handling of proxy delegation. - rpcrt4: Convert the dll registration routines to Unicode. - rpcrt4: Use RegDeleteTree to properly unregister interfaces. - rpcrt4: Create the NumMethods key too when registering an interface. - widl: Do not make the stub vtbl const for delegating interfaces since it needs to be patched up at run-time. - cryptdlg: Include objbase.h for function prototypes. - gdiplus: Export the GdipGetAllPropertyItems function. - mswsock: Export the WSARecvEx function. - include: Fix an enum definition that was actually defining a variable. - dmband: Remove some unused functions. - dmcompos: Remove some unused functions. - dmime: Remove some unused functions. - dmscript: Remove some unused functions. - dmstyle: Remove some unused functions. - dmsynth: Remove some unused functions. - dmusic: Remove some unused functions. - dplayx: Remove some unused functions. - dswave: Remove some unused functions. - widl: Make the generated global variables and functions hidden. - widl: Don't define PROXY_DELEGATION unconditionally. - widl: Output vtable information even for interfaces that don't define new functions. - widl: Sort the proxy interfaces by iid and use a binary search in IID_Lookup. - ole32: Use a dlldata.c file instead of maintaining the data manually. - oleaut32: Use a dlldata.c file instead of maintaining the data manually. - oleaut32: Make some functions static. - quartz: Make some functions and variables static. - sane.ds: Make some functions static. - gphoto.ds: Make some functions and variables static. - twain_32: Make some functions static. - winemp3.acm: Make some variables static. - winspool.drv: Make some functions static. - localspl: Make some functions static. - jscript: Make some functions and variables static. - ddraw: Make some functions static. - devenum: Make some functions static. - dxdiagn: Make some functions static. - crypt32: Make some functions and variables static. - mshtml: Make some functions static. - wined3d: Make some functions and variables static. - ole32: Register interfaces through dlldata.c as far as possible. - oleaut32: Register interfaces through dlldata.c as far as possible. - wined3d: Fix some macros definitions to make them proper C statements. - shell32: Remove some unused functions. - shell32: Make some functions static. - winex11: Remove some unused functions. - winex11: Make some functions static. - ole32: Remove some unused functions. - dmloader: Remove an unused function. - dmloader: Make some functions static. - comdlg32: Make some functions static. - dinput: Make some functions static. - rpcss: Get rid of the useless rpcss.h header. - rpcss: Build with -D__WINESRC__ since it's using Wine-specific features. - winebuild: Don't add stdcall decorations on non-x86 platforms. - gdiplus: Fix the GdipMultiplyMatrix prototype. - Define _WIN32_WINNT before including any headers. - comctl32/tests: Avoid handle casts in traces. - gdiplus/tests: Don't cast pointers to integers. - imm32/tests: Don't use a pointer in an ok test. - ntdll/tests: Use the correct prototype for RtlAllocateHeap/RtlReAllocateHeap. - quartz: Use FIELD_OFFSET instead of casting a pointer to int. - ntdll: Implemented RtlCaptureContext. - Avoid including time.h before winsock.h in tests. - browseui: Make a function static. - comctl32: Make a function static. - d3d8: Make a function static. - d3d9: Make some functions static. - d3d9_36: Make a function static. - d3dxof: Make some functions static. - dbghelp: Make a function static. - inetcomm: Make a function static. - mciavi32: Make a function static. - ole32: Make a function static. - rpcrt4: Make a variable static. - uxtheme: Make some functions static. - wintab32: Make a function static. - winedos: Make a function static. - mountmgr.sys: Avoid a compiler warning on older gcc. - wininet/tests: Avoid using size_t in a trace. - winealsa.drv: Fix a printf format warning. - wineoss.drv: Fix a couple of printf format warnings. - server: Limit the number of allocated handles before running out of memory. - configure: Disable some modules by default on non-x86. - fnt2bdf: Get rid of useless string constants. - libwine: Don't export the selector functions for the Windows build. - -Alistair Leslie-Hughes (10): - shdocvw: Silence invalid QueryInterface FIXME. - version: Stop crash under vista and 2k8. - mshtml: Implement IHTMLDocument2 get_applets. - mshtml: Implement IHTMLDocument2 get_links. - mshtml: Implement IHTMLDocument2 get_forms. - mshtml: Implement IHTMLDocument2 get_anchors. - mshtml: Add a test case. - mshtml: Implement IDispatch for IHTMLCommentElement. - msxml3: Implement IXMLDOMAttribute get/put value. - mshtml: Implement IHTMLStyle get/put overflow. - -Andrew Nguyen (9): - jscript: Implement the String.toLowerCase() method. - jscript: Implement the String.toUpperCase() method. - jscript: Implement the String.big() method. - jscript: Implement the String.blink() method. - jscript: Implement the String.bold() method. - jscript: Implement the String.fixed() method. - jscript: Implement the String.italics() method. - jscript: Implement the String.small() method. - jscript: Implement the String.strike() method. - -Andrew Riedi (5): - user32: Make the hotspot ICON_HOTSPOT when loading icons. - user32: Cursors can have more than one color. - user32: The frames of .ani cursors are .ico's, not .cur's. - imm32: No need for tests to return 0. - imm32: Add some really basic tests for ImmSetCompositionString(). - -Andrew Talbot (10): - gdiplus: Void function should not return a value. - wined3d: Sign-compare warnings fix. - wined3d: Sign-compare warnings fix. - wineps.drv: Declare some variables static const. - wined3d: Sign-compare warnings fix. - winedos: Sign-compare warning fix. - winemp3.acm: Sign-compare warnings fix. - dxgi: Memory allocation size fix. - wineoss.drv: Sign-compare warnings fix. - winex11.drv: Sign-compare warnings fix. - -Aric Stewart (2): - comctl32/tab: Return default tab width in TCM_SETMINTABWIDTH if lParam is a negative value. - gdi32: Use the substitute name, if it exists, when looking for font system links. - -Austin English (1): - dnsapi: Remove a useless check. - -Chris Robinson (1): - wined3d: Make sure a context is set for query object generation. - -Christian Costa (12): - d3dxof: Support multi-dimentional array in templates. - d3dxof: Small clean-up. - d3dxof: Finish support for multi-dimensional array. - wined3d: Implement CONVERT_CK_RGB24 in d3dfmt_convert_surface. - d3dxof: Keywords are case insensitive. - dmime: Make stub returns a error to avoid crashing. - d3dxof: Make parsing more permissive about semicolon and comma in objects. - d3dxof: Increase some buffer and array sizes. - d3dxof: Handle comments when going to next template or object. - quartz: Avoid leaking penummt and mt on error. - quartz: Return properly when input is flushing or reaching end of stream. - ddraw: Fix some comments. - -David Adam (1): - d3dx8: Add a few tests for MatrixStack. - -Dmitry Timoshkov (1): - gdi32: Make PATH_AddEntry static. - -Francois Gouget (46): - regedit: Fix handling of zero-byte binary values for 'regedit /E'. - atl: Remove WINAPI on static functions where not needed. - comdlg32: Remove WINAPI on static functions where not needed. - crypt32: Remove WINAPI on static functions where not needed. - d3d8: Remove WINAPI on static functions where not needed. - ddraw: Remove WINAPI on static functions where not needed. - Assorted spelling fixes. - d3d9: Remove IDirect3DDevice9Impl_GetFrontBuffer() as it is unused. - d3d9: Remove WINAPI on static functions where not needed. - shlwapi: Remove WINAPI on static functions where not needed. - wined3d: Remove WINAPI on static functions where not needed. - user32: Remove WINAPI/CALLBACK on static functions where not needed. - msxml3: Remove WINAPI on static functions where not needed. - wintrust: Remove WINAPI on static functions where not needed. - wininet: Remove WINAPI on static functions where not needed. - wineoss: Remove WINAPI on static functions where not needed. - version: Remove WINAPI on static functions where not needed. - wrc: parser_error() does not need a trailing '\n'. - ole32: Remove __RPC_USER on static functions where not needed. - oleaut32: Remove WINAPI on static functions where not needed. - opengl32: Remove WINAPI on static functions where not needed. - shdocvw: Remove WINAPI on static functions where not needed. - quartz: Remove WINAPI on static functions where not needed. - quartz: Remove CALLBACK on static functions where not needed. - rpcrt4: Remove WINAPI on static functions where not needed. - ole32: Remove WINAPI on static functions where not needed. - shell32: Remove WINAPI/CALLBACK on static functions where not needed. - Straighten out some ellipses. - dxdiagn: Remove WINAPI on static functions where not needed. - objsel: Remove WINAPI on static functions where not needed. - ntdll: Remove WINAPI on static functions where not needed. - msvcrt: Remove WINAPI on static functions where not needed. - msi: Remove WINAPI on static functions where not needed. - mapi32: Remove WINAPI on static functions where not needed. - mlang: Remove WINAPI on static functions where not needed. - localspl: Remove WINAPI on static functions where not needed. - dmloader: Remove WINAPI on static functions where not needed. - dplay: Remove WINAPI on static functions where not needed. - dplayx: Remove WINAPI on static functions where not needed. - dsound: Remove WINAPI on static functions where not needed. - ws2_32: Fix the checks for AQ_WIN16. - ntdll: Remove an unneeded cast. - regedit: Deal with races in 'regedit /E' by resizing the buffers and retrying. - server: Remove an unneeded cast. - cmdlgtst: Fix an ellipsis in the copyright message. - Make sure we have a space before the ellipses in Slovenian resources. - -Hans Leidekker (16): - gdiplus: Add a stub implementation of GdiplusNotificationHook and GdiplusNotificationUnhook. - gdiplus: Implement GdipGetLineSpacing. - gdiplus: Implement GdipNewPrivateFontCollection and GdipDeletePrivateFontCollection. - gdiplus: Add a stub implementation of GdipPrivateAddMemoryFont. - gdiplus: Implement GdipGetFontCollectionFamilyCount and GdipGetFontCollectionFamilyList. - gdiplus: Improve GdipMeasureString. - gdiplus: Return success from the GdipSaveGraphics and GdipRestoreGraphics stubs. - gdiplus: Add stub implementations of GdipBeginContainer2 and GdipEndContainer. - gdiplus: Add stub implementations of GdipCreateHalftonePalette and GdipImageForceValidation. - gdiplus: Improve GdipGetImageRawFormat stub. - setupapi: Implement SetupInstallFile{A, W}. - gdiplus: Better implementation of GdipGetFontHeightGivenDPI. - wininet: Don't increase index in HttpQueryInfo if requested level is HTTP_QUERY_STATUS_CODE. - wininet: Append the extra info part in InternetCreateUrl{A, W}. - wininet: Support setting username and password options on request handles. - wininet: Stop leaking username and password. - -Henri Verbeet (40): - wined3d: Move caps related constants and structures to wined3d_caps.h. - wined3d: Use IDL to generate wined3d.h. - wined3d: Const correctness fixes. - wined3d: Don't call IWineD3DSurfaceImpl_GetData() from surface_gdi.c. - wined3d: Slightly reduce the scope of fragment_palette_conversion. - wined3d: Make some functions static. - wined3d: Const correctness fixes for utils.c. - wined3d: Make the SHADER_OPCODE_ARG parameter to shader handlers const. - wined3d: Const correctness fixes for arb_program_shader.c. - wined3d: Const correctness fixes for glsl_shader.c. - wined3d: Const correctness fixes for surface.c. - wined3d: Const correctness fixes for ati_fragment_shader.c. - wined3d: Remove some unnecessary casts in process_vertices_strided(). - wined3d: Const correctness fixes for device.c. - wined3d: Make minMipLookup_noFilter and magLookup_noFilter const. - wined3d: Const correctness fixes for surface_base.c. - wined3d: Remove some superfluous casts. - wined3d: Const correctness fixes for directx.c. - wined3d: Fix the glWeightPointerARB prototype. - wined3d: Make the lpData member of WineDirect3DStridedData const. - wined3d: Const correctness fixes for drawprim.c. - wined3d: Handle a few "silent" FIXMEs more consistent with the rest of the code. - wined3d: Const correctness fixes for state.c. - wined3d: Const correctness fixes. - wined3d: IWineD3DBaseTexture and IWineD3DResource don't need Vtbl's. - wined3d: Remove some unused code. - wined3d: Rename basetexture functions to reflect that they're not COM functions. - wined3d: Rename resource functions to reflect that they're not COM functions. - wined3d: Make functions static where possible. - wined3d: Use a bitmask to store which bool and int constants are set. - wined3d: Disable checkGLcall when WINE_NO_DEBUG_MSGS is specified. - wined3d: Move GlPixelFormatDesc to wined3d_private.h where it belongs. - wined3d: Remove sampled_format from IWineD3DBaseShaderClass, it isn't used anywhere. - wined3d: Make shader texture format fixups more generic. - wined3d: Get rid of vcheckGLcall. - wined3d: Slightly improve drawStridedSlow() performance. - wined3d: Remove a redundant condition in shader_get_opcode(). - wined3d: Explicitly pass the version and instruction table to shader_get_opcode(). - wined3d: Explicitly pass the shader version to shader_dump_decl_usage(). - wined3d: Explicitly pass the shader version to shader_dump_param() and shader_dump_arr_entry(). - -Huw Davies (12): - ole32: Factor out the code to release the delegate interfaces. - ole32: Defer releasing the delegate interfaces until after we return from an OnClose notification. - version: Fixed comments. - oleaut32: Add support for loading typelibs from NE files. - comdlg32: GetPrinterW and GetPrinterDriverW return the size in bytes so don't multiply by sizeof(WCHAR). - ole32: Forward the ASYNC_STGMEDIUM user marshallers to the STGMEDIUM quadruple. - d3d8/tests: Skip tests if we can't create the D3D8 object. - d3d9/tests: Skip tests if we can't create the D3D9 object. - d3d10core/tests: Skip the tests if we can't create a DXGI factory. - dxgi: Don't crash and just skip the tests if glX in not available. - ddraw/tests: Skip tests if we can't create a primary surface. - opengl/tests: Skip tests if we can't find a pixel format. - -Hwang YunSong(황윤성) (3): - crypt32: Updated Korean resource. - wordpad: Updated Korean resource. - appwiz.cpl: Updated Korean resource. - -Jacek Caban (6): - mshtml: Call necko's SetUploadStream from wrapper's SetUploadStream. - mshtml: Skip tests on old IE as soon as possible. - mshtml: Skip tests on old IE as soon as possible. - jscript: Set script object instead of ctx lcid in SetScriptSite. - activdbg.idl: Added IDebugApplication64 and IActiveScriptSiteDebug64 declarations. - ntoskrnl.exe: Forward ZwMakeTemporaryObject to ntdll. - -Jan de Mooij (2): - shell32/autocomplete: Fix handling of WM_KILLFOCUS messages. - shell32/autocomplete: Add unit tests for autocomplete. - -Jeff Zaroyko (3): - ntdll: Avoid NULL deref in RtlDeleteTimer. - kernel32: Add a test for CreateFile when using OPEN_ALWAYS on directories. - wineserver: Don't use O_CREAT and O_EXCL when attempting to open directories. - -Jerome Gardou (1): - d3dx8: Implement D3DXMatrixStack_MultMatrix. - -Juan Lang (4): - crypt32: Implement CryptFormatObject for the Netscape string OIDs. - rsaenh: Fix some test failures on older versions of Windows. - crypt32: Accept any string format as the display text of a user notice policy qualifier. - cryptdlg: Implement FormatVerisignExtension. - -Jérôme Gardou (9): - d3dx8: Implement D3DXMatrixStack_MultMatrixLocal. - d3dx8: Implement D3DXMatrixStack_RotateAxis. - d3dx8: Implement D3DXMatrixStack_RotateAxisLocal. - d3dx8: Implement D3DXMatrixStack_RotateYawPitchRoll. - d3dx8: Implement D3DXMatrixStack_RotateYawPitchRollLocal. - d3dx8: Implement D3DXMatrixStack_Scale. - d3dx8: Implement D3DXMatrixStack_ScaleLocal. - d3dx8: Implement D3DXMatrixStack_Translate. - d3dx8: Implement D3DXMatrixStack_TranslateLocal. - -Kai Blin (2): - dbghelp: Upgrade FIXME to ERR. - kernel32/tests: logfile can be NULL, avoid dereferencing it (Coverity). - -Kirill K. Smirnov (3): - winecfg/audio: Fix uninitialized variable. - winecfg/audio: Simplify removeDriver() function. - winecfg/audio: Properly terminate an empty list of drivers. - -Konstantin Kondratyuk (1): - include: Add new interfaces to mshtml.idl. - -Lei Zhang (5): - advapi32: Allow opening HKEY_CLASSES_ROOT subkeys with backslash prefix on NT. - comctl32: Process WM_CHAR instead of WM_KEYDOWN for numbers in datetime. - comctl32: Do ascii to integer conversion only once. - comctl32: Better day of the month input checking in datetime. - msi: Set DllVersion registry key for CLSID_IMsiServerMessage. - -Maarten Lankhorst (20): - includes: Add win64 calling convention. - winebuild: Use ms-abi for delayed load stubs. - ntdll: Make 64-bits wine only able to load amd64 binaries. - msvcrt: Add CDECL to all cdecl functions. - wldap32: Fix winldap_private header compatibility with 64-bit. - tools: Add calling conventions for win64 to winegcc. - qmgrprxy: Fix building on wine64. - kernel32: Fix 64-bits error in profile. - ole32: Add Co*InitializeSpy functions. - winmm: Some 64-bit pointer fixes. - msacm: Fix pointer truncation. - dsound: 64-bit pointer fixes. - ole32: Fix releasing spy. - loader: Implement setting %gs for amd64. - include: Add NtCurrentTeb assembly for win64. - wineoss.drv: Get rid of sizeof in traces. - wineoss.drv: Fix 64-bits incompatibilities. - winealsa.drv: Get rid of sizeof in traces. - winealsa.drv: Fix 64-bits incompatibilities. - user32: Fix dialogs for 64-bits wine. - -Marcus Meissner (1): - wined3d: Output the rectangles in the debug message. - -Michael Karcher (8): - msvcrt: Out strings should be ptr instead of wstr in .spec file. - msxml3: Avoid duplicate encoding. - msxml3/tests: Fix BSTR leak. - msxml3: Quiet noisy fixmes. - msxml3: Move attach_xmlnode.c to domdoc.c. - msxml3: Specialize attach_xmlnode to XML documents. - msxml3: Remove attach_xmldoc(This, NULL) calls. - msxml3: attach_xmldoc may fail. - -Michael Stefaniuc (27): - msi: Remove casts of void pointers. - regedit: Remove NULL check before HeapFree (Smatch). - gdi32: Remove some superfluous casts. - kernel32: Remove some superfluous casts of void pointers. - iphlpapi: Remove a comment that dared to ponder to use malloc. - winex11.drv: Remove some superfluous casts. - wininet: Remove some superfluous casts. - iphlpapi/tests: Replace malloc with HeapAlloc. - oledlg: Remove some superfluous casts. - imm32: Remove some superfluous casts. - itss: Remove unneeded casts of zero. - winecfg: Remove some superfluous casts. - cmd: Remove some superfluous casts. - regedit: Remove some superfluous casts. - ws2_32/tests: Remove some superfluous casts. - hal: Don't cast zero. - mshtml: Remove two superfluous casts. - msrle32: Remove some superfluous casts. - msvcrt: Use NULL instead of casting zero. - msxml3: Do not cast void pointers to other pointer types. - quartz: Don't cast zero. - wnaspi32: Replace malloc with HeapAlloc. - wnaspi32: Remove some superfluous casts. - atl: Remove two superfluous casts. - ddraw: Remove two superfluous casts. - gdiplus: Reduce the number of casts by using the proper type for variables. - gdiplus: Remove some superfluous casts. - -Nikolay Sivov (6): - gdiplus: Stub for GdipGetImagePaletteSize. - gdiplus: Added GdipTranslateTextureTransform. - gdiplus: Added GdipRotateTextureTransform. - gdiplus: Added GdipMultiplyTextureTransform. - gdiplus: Added GdipGetPenFillType. - gdiplus: Added GdipScaleTextureTransform. - -Paul Vriens (26): - advapi32/tests: Fix a test failure on NT4. - rsaenh/tests: Fix a test failure on W2K and below. - rsaenh/tests: Use a 40-bit session key instead of 56-bit. - rsaenh/tests: Fix a test failure on W2K and below. - rsaenh/tests: Use a 40-bit session key instead of 56-bit. - rsaenh/tests: Fix a test failure on W2K and below. - aclocal.m4: Add i686-pc-mingw32 to the cross-compiler prefixes. - rsaenh/tests: Fix a test failure on NT4 and below. - rsaenh/tests: Fix a test failure on NT4 and below. - rsaenh/tests: Fix a test failure on Win98. - shell32/tests: Fix a few test failures on Win9x and NT4. - shell32/tests: Skip some tests on Win9x and WinMe. - lz32/tests: Fix a test failure on Win9x. - advapi32/tests: Fix some crashes on NT4. - shell32/tests: Fix a test failure on Win9x. - ntdll/tests: Fix a test failure on W2K. - shell32/tests: Cast-qual warning fixes. - shell32/tests: Fix some errors on Win9x and Vista and prevent a crash on NT4. - shell32/tests: Fix a test failure on Win9x, NT4, Vista and W2K8. - gdi32/tests: Fix a few test failures on Win9x and WinMe. - shlwapi/tests: Use a codepage that is supported on all platforms. - gdi32/tests: Fix a few test failures on Win9x and WinMe. - hlink/tests: Fix some failures on Win9x and WinMe. - oleacc/tests: Fix the test failures on Win9x/WinMe and Vista/W2K8. - shell32/tests: Fix some new test failures on W2K. - user32/tests: Fix some typos. - -Peter Dons Tychsen (2): - winedos: Fixed memory resize function which returned paragraphs in some cases instead of bytes. - winedos: Fixed a problem with timer values that are below 50ms. - -Reece Dunn (2): - winealsa: Calculate the delay correctly as snd_pcm_delay is not reliable in this context. - winealsa.drv: Correct the period_time value for pulseaudio. - -Ricardo Filipe (7): - advapi32: Removed dead assignments (llvm/clang). - quartz: Removed dead code and variables (llvm/clang). - comctl32: Removed dead assignments (llvm/clang). - comdlg32: Removed dead assignments (llvm/clang). - crypt32: Remove dead code (llvm/clang). - iccvid: Remove dead stores (llvm/clang). - setupapi: Add stubs for SetupPromptForDiskA/W. - -Rob Shearman (3): - widl: Output the correct buffer size required for parameters whose sizes are known at type-generation time. - widl: Fix optimisation for writing out ref pointers to simple structs and base types. - winspool.drv: Use CP_UNIXCP instead of CP_ACP for data that is going to or coming from system library functions. - -Roderick Colenbrander (2): - wined3d: Add registry key for overriding pci device id. - wined3d: Add registry key for overriding the pci vendor id. - -Stefan Dösinger (8): - wined3d: Make the shader backend call CompileShader. - wined3d: Pass some stateblock values around directly. - wined3d: Store shader IDs in the vs and ps impl structures. - wined3d: Add the ability to duplicate GL pixel shaders. - wined3d: Enable blue = 1.0 fixup for D3DFMT_V8U8. - wined3d: Put the ps compile parameters into the glsl program hashmap. - d3d9: Document a Microsoft header bug. - wined3d: Fix D3DFMT_R32F, R16F, G16R16F, ... in the pixel shader. - -Vincent Pelletier (1): - wined3d: Add detection for NVIDIA's GTX 280. - -Vincent Povirk (18): - gdiplus: Implement CachedBitmap based on Image. - setupapi: Implement FLG_PROFITEM_GROUP. - gdiplus: Add parameter checking to GdipGetRegionHRgn. - gdiplus: Implement GdipGetRegionHRgn for infinite regions. - gdiplus: Implement GdipGetRegionHRgn for empty regions. - gdiplus: Implement GdipRegionGetHRgn for paths. - gdiplus: Implement GdipGetRegionHRgn for rects. - gdiplus: Implement GdipGetRegionHRgn for combined regions. - gdiplus: Add stub for GdipSetPenCompoundArray. - shell32: Add test for localized filenames in desktop.ini. - winex11.drv: Fix string format warning. - advpack/tests: Fix string format warning. - dinput/tests: Fix string format warning. - msxml3/tests: Fix string format warnings. - setupapi/tests: Fix string format warnings. - winedbg: Fix string format warnings. - widl: Fix string format warning. - server: Fix string format warning. - -Vitaliy Margolen (2): - dinput: Use correct GetObjectInfo for joystick. - ntdll: Stub NtMakeTemporaryObject. - -Vitaly Lipatov (2): - kernel32: gethostname returns string in CP_UNIXCP encoding. - winex11: Add check for XmbTextPropertyToTextList result. - -Vitaly Perov (2): - mlang: Add implementation of fnIMLangFontLink_GetCharCodePages. - mlang/tests: Add tests for fnIMLangFontLink_GetCharCodePages. - -Vladimir Pankratov (1): - shdocvw: Implement go_home function. - --- -Alexandre Julliard -julliard@winehq.org +The Wine development release 1.1.11 is now available. + +What's new in this release (see below for details): + - Numerous fixes for IE7 support. + - Support for 64-bit cross-compile using Mingw64. + - User interface support for crypto certificates. + - Better support for MSI installation patches. + - Various Direct3D optimizations. + - Various bug fixes. + +The source is available from the following locations: + + http://ibiblio.org/pub/linux/system/emulators/wine/wine-1.1.11.tar.bz2 + http://prdownloads.sourceforge.net/wine/wine-1.1.11.tar.bz2 + +Binary packages for various distributions will be available from: + + http://www.winehq.org/site/download + +You will find documentation on http://www.winehq.org/site/documentation + +You can also get the current source directly from the git +repository. Check http://www.winehq.org/site/git for details. + +Wine is available thanks to the work of many people. See the file +AUTHORS in the distribution for the complete list. + +---------------------------------------------------------------- + +Bugs fixed in 1.1.11: + + 986 ODBC.dll unimplemented + 1973 Bug in StretchDIBits with biBitCount=32 + 4293 text invisible in myODBC installer 2.5 -buggy refresh? + 5182 Wrong Time read into program + 5241 X BadAlloc failure (X_CreatePixmap) in StrePla.exe + 5463 ie6 installs now, but doesn't work... + 6126 SoulSeek crashes + 6139 Spanish Vocabulary Builder won't install => devision by zero + 6458 Wing Commander Prophecy: Objects are no longer rendered correctly + 6618 Warcraft III Crash on intro movie playback + 6921 C&C Tiberian Sun menu disappears after save + 7292 SystemDrive and a bunch other variables not set + 7543 Window position geometry not saved between app executions + 7795 Zoo Tycoon 2 D3D Device error + 8264 Streaming Media Player v5.0: "Unspecified error" when "Play from remote playlist..." is attempted + 9350 Cannot change country in iTunes 6.0 due to unimpletmented 'TrackPopupMenuEx' function + 9462 Mouse cursor appears only when clickling left mouse button (Star Wars: KOTOR) + 9500 StarCraft Battle.net-Hitting the Browse button hangs the game + 9528 Battlefield 2142 breaks on startup with ReportEventW errors + 9839 Game cannot connect using DirectPlay8.1 + 9994 mshtml: No icons visible in the Adobe Reader 8.1 "First Run" - Advertisement + 10005 Ever 17 - out of infinity crashes + 10036 The General PL: Problem with RichLine, it makes game unplayable + 10124 Turok doesn't see D3D Compatible Adapter. + 10137 WinSock ServerSocket + 10221 "make test" fails on d3d9/tests/visual.c + 10294 Mouse Y is off by 100 pixels in some fullscreen games + 10378 Programmer's Notepad 2 gives an error message, closes after using search function + 10457 Application complains that directsound is not detected + 10470 Radmin viewer 3.1: Black squares in the voice chat window + 10714 wps do not work + 10769 Window contents spontaneously move to root (0,0), stops updating + 10805 EmEditor hangs + 10820 Unhandled division by zero in ALSA_AddRingMessage in PowerPoint Viewer 2008 + 10976 Palm Desktop fails to install + 11186 Worms 2 regression: Page fault if you start the game by throwing a grenade + 11229 Sonic Adventure DX 3D models leave behind a "ghost" + 11376 Origin 7.5 crashes while plotting data + 11403 Installation fails after selecting the install folder + 11444 Pirates Of the Caribbean Online having login issue + 11544 Audio problems with Heroes II and ALSA Driver + 11634 erratic mouse in Starfleet Command Volume II Empires at war + 11816 Magic Workstation main window disappears immediately? + 11912 Wine desktop minimized icon on top + 11961 Zinc-based apps don't run? (Go Diego Go Wolf Pup Rescue, Virble) + 11979 Legacy 5 - Can't check for online update + 12075 Endnote X1: crashes when selecting text by mouse + 12158 Installer Everest Poker + 12247 Page fault in quartz during DLL registration prevents video playback in Ares P2P client + 12252 Need for Speed: Hot Pursuit 2 demo crashes on car select + 12360 load/save preferences.ini file error[file corrupt] + 12438 Marratech 6.1 hangs on startup + 12495 The free DWG viewer from brava doesn't work + 12528 You can resize the WinMerge dialog vertically on Wine, but not Windows + 12588 Trillian crashes at startup when trying to load dwmapi.dll + 12602 Duo Princess - using dmime crashes the game + 12628 wine: Call from 0x7b840fc8 to unimplemented function hal.dll.ExAcquireFastMutex + 12800 CIsco IP Communicator crash calling winhttp.dll.WinHttpCreateUrl + 12823 newer games using OpenGL cannot be played + 12991 eMule ScarAngel + 13111 xfile support is still non-existant in wine + 13361 firefox 3 can't handle local paths in location window [dogfood] + 13425 The Punisher demo sound effect from launcher gets stuck + 13458 Starcraft hangs in wine-1.0rc2 in dsound + 13478 Winehelp crash in textpad + 13512 Sniper Elite: game hangs on applying options (change to try resolution and crash) + 13625 Page fault when closing help viewer + 13639 Regression: No sound in Scorcher Demo + 13640 Scorcher Demo crashes on start + 13680 DC++: closing help browser crashes wine + 13697 sound problems in Battlezone 2 + 13764 SMPlayer doesn't render video properly [dogfood] + 13793 Prince of Persia: the Sands of Time crashes mid-way through. + 13824 Flash8 draws outside from frame after desktop switching + 13841 Babylon 7: Babylon freezes in trial version mode + 13842 SW: Knights of the Old Republic PL and fonts + 13859 Star Wars Race cursor duplicate + 13897 Live For Speed CMX Viewer S2Y: Lost window when shade window or switch workspace + 13904 Axis & Allies starts in zero sized window mode + 14215 Terragen crashes immediately on startup + 14322 Crashes when I try to run FeedDemon + 14488 Bonjour Service with iTunes + 14493 RumbleBox fails to install ==> Crash + 14515 AutoWikiBrowser doesn't install (uses gdiplus and .NET 2 framework) + 14587 wineprefixcreate creates useless directories in "My Files" directory + 14664 VeZA Route Planner 2005: crashes on startup + 14687 Helium Music Manager 2008 installation doesn't work + 14709 The White Chamber game crashes on exit + 14808 CS2 Compiz tooltips + 14952 Microsoft Word 2003 hangs while instaling a new feature + 15044 Random crash in MSN Messenger 7.0 + 15183 MagicMaps crashes with nvidia above version 169.12 + 15296 Installation of MS office broken until last GIT + 15309 Flashplayer crashes in quartz when used with an IM. + 15338 setup_exception_record stack overflow when running wineboot + 15491 Star Wars: Jedi Knight - Jedi Academy : Clicking install button in autorun menu freezes autorun.exe + 15578 Px-map crashes (probably caused because reading registry-key fails) + 15699 Winecfg crashes if no audio driver is present + 15835 Rapid Uploader: Delete button shows a popup menu that self closes. + 15840 SuddenStrike: crashes when loading a level + 15931 Photoshop CS4 Crashes while launching + 16086 Problems with sound in Soldier of Fortune + 16101 WMP10: Crashes on launch + 16103 Google Sketchup 7 crashes after downloading model + 16164 Google Sketchup 7 crashes when you click "Start using Sketchup" + 16317 Unhandled exception unimplemented function setupapi.dll.SetupPromptForDiskA + 16334 tools/fnt2bdf.c: format not a string literal and no format arguments + 16335 winex11.drv/xrender: format not a string literal and no format arguments + 16336 advpack/tests/install: format not a string literal and no format arguments + 16337 dinput/tests/joystick: format not a string literal and no format arguments + 16338 msxml3/tests/xmldoc: format not a string literal and no format arguments + 16339 setupapi/tests: format not a string literal and no format arguments + 16340 winedbg/db_disasm: format not a string literal and no format arguments + 16341 wineserver/trace: format not a string literal and no format arguments + 16345 ShadowFlare: Crashes on entering game + 16376 Braille2000 does not authenticate with server + 16381 Fading effects not working in Lineage2 and other graphic issues + 16386 FAR crashes with Unimplemented KERNEL32.dll.GetConsoleAliasW + 16414 New Xlive (8.12.2008 and newer) is not working + 16443 Regression in ntdll breaks IE6 setup + 16458 Endless Online installer crashes on start + 16464 IMVU crashes on startup + 16482 FeedDemon pops up an error about msxml on startup + 16511 Google Sketchup rejects some ruby scripts containing CRLF + +---------------------------------------------------------------- + +Changes since 1.1.10: + +Alex Balut (1): + mshtml: Removed the reference counting of the DLL. + +Alexander Morozov (2): + hal: Add missing WINAPI. + ntoskrnl.exe: Add stubs for Io{Allocate,Get}DriverObjectExtension. + +Alexander Nicolaysen Sørnes (1): + kernel32: Add stub for GetConsoleAliasW. + +Alexandre Julliard (73): + server: Convert the registry key modification time to a win32-style time. + server: The name len in the get_directory_entry request must be a data_size_t. + kernel32/tests: Added some tests for behavior of 64-bit kernel handles. + include: Fix the 64-bit value of magic handle constants. + server: Make object handles ints instead of pointers. + server: Add functions for conversions between server object handles and pointer-style handles. + widl: Use local functions where possible instead of STUB_FORWARDING_FUNCTION in stub vtables. + user32/tests: Added some tests for behavior of 64-bit user handles. + server: Make user handles ints instead of pointers. + server: Add functions for conversions between server user handles and pointer-style handles. + winebuild: Make the cpu flag more generic to allow supporting a given entry point on multiple platforms. + include: Implemented inline asm functions for x86_64. Export Interlocked* only on i386. + include: Added some definitions for x86_64 exception handling. + ntdll: Added stubs for RtlLookupFunctionEntry and RtlVirtualUnwind. + kernel32/tests: Fixed the handle test for Win9x. + include: Added the msvcrt memory.h header. + wininet: Include ws2tcpip.h before anything else for the Windows build. + server: Get rid of the support for module snapshots, it is no longer needed. + server: Don't use size_t for module sizes, they are limited to 2Gb anyway. + configure: Add a wrapper macro for mkdir on Windows. + configure: Add a check for the grp.h header. + shell32: Disable the Unix folder for the Windows build. + include: Disable the asm optimizations for the Windows build. + include: Fix the definition of 64-bit types for Mingw64. + configure: Add detection of Mingw64 for crosstests. + include: Fix a few compiler warnings for the Mingw64 build. + ntdll: Add a function to export the host OS type and version. + winetest: Report information about the CPU and host OS. + wininet/tests: Use new test URLs on test.winehq.org. + server: Define an lparam_t type for message parameters that can hold all sorts of data. + server: Windows properties are actually generic params, not handles. + tools: Re-use the file updating routines from make_makefiles in make_requests. + tools: Keep track of requests sizes and alignments in make_requests. + ntdll: Add a heuristic to detect dlls that are wrongly marked as using native subsystem. + cabinet: Don't allocate a huge buffer on the stack. + ntdll: Enforce correct protection values in virtual memory functions. + include: Fix typo in the 64-bit version of GetProcessHeap(). + ntdll: Convert the handles to server handles in NTDLL_wait_for_multiple_objects. + ntdll: Fix heap management for 64-bit. + libwine: Don't try to use the preloader on non-i386. + msi: Don't include msvcrt headers. + setupapi: Don't include msvcrt headers. + msvcrt: Don't include msvcrt headers, instead duplicate the definitions in msvcrt.h. + include: Add the msvcrt/crtdefs.h header and include it where needed. + msvcrt: Use intptr_t or size_t instead of long where appropriate. + msvcrt: Use iob_func instead of p__iob on non-x86. + msvcrt/tests: Load __mb_cur_max and _mbctype dynamically since they may not be available to link against. + msvcrt: Avoid truncated relocations on 64-bit. + winegcc: Fix the file mode check. + server: Add an apc_param_t type to store APC client-side parameters. + server: Make async I/O transfer sizes always 32-bit. + include: Allow 64-bit pointers to pass through LDT functions unmolested. + ntdll: NtCurrentTeb is not exported on x86_64. + msvcrt: The _CI* math functions are only exported on i386. + msvcrt: Add a few more *_func functions to replace the __p_* ones. + msvcrt: The __p_* functions are only exported on i386. + msvcrt: Rename _ftime to avoid conflicts. + widl: Use ULONG_PTR instead of unsigned long for pointer casts in generated code. + winetest: Use main instead of WinMain as entry point. + winebuild: Generate stub entry points for x86_64. + ntdll: Add support for dynamically generated stub entry points. + msvcrt: Rewrite va_list to string conversions to avoid depending on va_copy. + configure: Get rid of the va_copy checks. + msvcrt: Add __cdecl to all function prototypes. + include: Use __p__iob on i386 to avoid problems with Mingw libraries. + server: Add a mem_size_t type to represent memory sizes and offsets. + server: Make mem_size_t always 64-bit. + server: Use mem_size_t instead of file_pos_t for memory mapping sizes. + server: Make apc_param_t always 64-bit. + cryptui: Commit checks.bmp missed in a previous patch. + d3dxof/tests: Avoid size_t in a trace. + msi/tests: Avoid sizeof in traces. + msvcrt/tests: Avoid sizeof in a trace. + +Alistair Leslie-Hughes (11): + mshtml: Implement IHTMLStyle get/put posWidth. + mshtml: Implement IHTMLStyle get/put posHeight. + mshtml: Add support for V_I4 in IHTMLStyle put_zIndex. + mshtml: Implement IHTMLStyle put_fontStyle. + mshtml: Implement IHTMLStyle get/put fontVariant. + mshtml: Implement IHTMLScriptElement get/put Defer. + mshtml: Implement IHTMLStyle get_backgroundImage. + msxml3: Corrected getAttributeNode to return correct values. + mshtml: Implement IHTMLStyle get_position. + msxml3: Make functions static. + msxml3: Add ISupportErrorInfo interface to IXMLDOMDocument. + +Andrei Derevyanko (2): + mshtml: Silence IMarshal QueryInterface FIXME. + mshtml: Updated test of QueryInterface. + +Andrew Nguyen (4): + jscript: Fix some errors detected by Valgrind. + jscript: Fix the lexicographical order of the String class properties array. + jscript: Implement the String.sub() method. + jscript: Implement the String.sup() method. + +Andrew Talbot (34): + widl: Remove unneeded address-of operators from array names. + widl: Remove unneeded address-of operators from function names. + winex11.drv: Sign-compare warnings fix. + msi: Remove an unused declaration. + winhttp: Sign-compare warning fix. + wininet: Sign-compare warnings fix. + shdocvw: Remove unneeded address-of operators from array name. + wined3d: Remove unneeded address-of operators from array names. + wintrust: Sign-compare warnings fix. + ws2_32: Sign-compare warnings fix. + winmm: Sign-compare warning fix. + user32: Sign-compare warnings fix. + comctl32: Remove unused Wine debug channel. + d3drm: Remove unused Wine debug channel. + d3dx8: Remove unused Wine debug channel. + d3dx9_24: Remove unused Wine debug channel. + d3dx9_25: Remove unused Wine debug channel. + d3dx9_26: Remove unused Wine debug channel. + d3dx9_27: Remove unused Wine debug channel. + d3dx9_28: Remove unused Wine debug channel. + d3dx9_29: Remove unused Wine debug channel. + d3dx9_30: Remove unused Wine debug channel. + d3dx9_31: Remove unused Wine debug channel. + d3dx9_32: Remove unused Wine debug channel. + d3dx9_33: Remove unused Wine debug channel. + d3dx9_34: Remove unused Wine debug channel. + d3dx9_35: Remove unused Wine debug channel. + d3dx9_36: Remove unused Wine debug channel. + d3dx9_37: Remove unused Wine debug channel. + ole32: Remove unused Wine debug channel. + msvcrt40: Remove unused Wine debug channel. + msvcr71: Remove unused Wine debug channel. + kernel32: Remove unused Wine debug channel. + jscript: Remove unused Wine debug channel. + +Aric Stewart (9): + imm32: Implement ImmAssociateContextEx. + imm32: Implement W/A handling in ImmEscape. + user32: Implement handling of WM_INPUTLANGCHANGE. + user32: Proper handling of WM_INPUTLANGCHANGEREQUEST. + msi: EndDialog with Ignore should not be an error. + x11drv: If a keyboard layout is an IME only check the loword when comparing to the x11 keyboard layout. + x11drv: Allow ActivateKeyboardLayout to set the keyboard for the thread and GetKeyboardLayout to return the stored keyboard. + user32: Remove the driver call for GetKeyboardLayoutList and instead populate from the registry. + msi: Fix some NULL checking in MSI_RecordGetStringA. + +Austin English (3): + shell32: Fix German translation. + uxtheme: Fix a compiler warning. + kernel32: Convert a warn to an err. + +ByeongSik Jeon (3): + gdi32: Unify Chinese and Japanese default font name. + *Zh.rc: Update the Chinese resource font name to "MS Shell Dlg". + *Ko.rc: Update Korean resource. + +Chris Wulff (1): + mscoree: Add a stub for LockClrVersion. + +Christian Costa (23): + quartz: Accept null clsMinorType for pins when registering filters + tests. + ddraw: Fix trace. + winedbg: Make frame numbers display starting from 0 so we match frame command. + d3dxof: Increase strings buffer size. + devenum: Fix traces and fixmes. + quartz: Turn some fixmes into traces. + setupx: Add stub for DiInstallClass. + d3dxof: Add a test to dump an X object data (enabled when objects.txt and templates.txt are present). + d3dxof: Improve error handling. + d3dxof: Increase string buffer size. + dplayx: Fix typo. + dmime: Improve IDirectMusicPerformance8Impl_PlaySegment(Ex) stubs. + dmime: Check input params in IDirectMusicSegmentState8Impl_QueryInterface. + amstream: Implement IDirectDrawMediaStream. + amstream: Some fixes. + amstream: Add stubbed implementation of MediaStreamFilter. + d3dxof: Improve IDirectXFileImpl_CreateSaveObject stub. + d3dxof: Add some preliminary support for binary objects. + d3dxof: Remove IDirectXFileObjectImpl stuff. That's not needed. + dswave: Add missing segment vtbl initialisation (with DirectMusicSegment8_Segment_Vtbl). + winealsa.drv: Initialize correctly the header before adding it to the queue. + dmusic: Move IDirectMusicThru and IDirectMusicPortDownload to DirectMusicPort object where they belong. + winealsa.drv: Handle midi sysex greater than a buffer. + +Damjan Jovanovic (1): + winemenubuilder: Create xdg_config_dir if it does not exist. + +Dan Kegel (2): + msvcrt: fread: Exhaust buffered data before using unbuffered data in ascii mode. + winver: Add version resource. + +Daniel Nylander (6): + clock: Updated Swedish translation. + winefile: Updated Swedish translation. + winhlp32: Updated Swedish translation. + notepad: Updated Swedish translation. + winecfg: Updated Swedish translation. + shell32: Updated Swedish translation. + +Dylan Smith (15): + richedit: Use ME_EnsureVisible to implement EM_SCROLLCARET. + richedit: Compare editor rather than hWnd in ME_CalculateClickCount. + richedit: Removed an unnecessary call to GetScrollInfo. + richedit: Removed unused hwndEdit variable for the RTF parser. + richedit: Missing capitalization on TxGetScrollBars. + richedit: Move implementation of EM_GETTEXTRANGE to its own function. + richedit: Move implementation of EM_GETTEXTEX to its own function. + richedit: Removed some unnecessary SendMessage calls to itself. + richedit: Move implementation of WM_CHAR to its own function. + richedit: Fixed ITextHostImpl return values for tests. + richedit: Added tests for the formatting rectangle. + richedit: Made sure text is offset by formatting rectangle. + richedit: Removed redundant editor height variables and calculations. + richedit: Avoid re-calculating positions found in wrapping for painting. + richedit: Move message handling to function callable without window. + +Francois Gouget (70): + ws2_32: Add MSG_WAITALL and MSG_INTERRUPT. + ws2_32: Add the inet_ntop() and inet_pton() prototypes and their relatives. + dsound: Remove unneeded casts of zero. + winspool.drv: Remove unneeded casts of zero. + port: Remove unneeded casts of zero. + fnt2bdf: Remove unneeded casts of zero. + winealsa: Fix a couple of types and avoid unneeded casts. + avifil32: Remove unneeded casts of zero. + crypt32: Remove unneeded casts of zero. + kernel32: Remove unneeded casts of zero. + msacm32: Remove unneeded casts of zero. + netapi32: Remove unneeded casts of zero. + oleaut32: Remove unneeded casts of zero. + wnaspi32: Remove unneeded casts. + gdiplus: Add a trailing '\n' to a Wine trace. + wininet & winhttp: Fix a pointer type mismatch warning when compiling on Windows. On Windows setsockopt() expects a char* while on Unix it accepts anything. + msvcrt/tests: Stricter fstat() tests. + msvcrt/tests: Add a stat() test. + msvcrt: Fix the permissions returned by fstat*() (with test). + appwiz.cpl: It's ok to use "SysListView32" directly. + clock: Remove spaces before '\n' in the Swedish resources. + msvcrt/tests: Add a trailing '\n' to ok() calls. + msvcrt: Remove _adjust_fdiv() as it is unused. + shell32: Add a couple of spaces in the spec file. + ole32: Fix the STORAGE_dump_pps_entry() description. + cabinet/tests: Make CopyProgress() static. + d3d9/tests: Make some functions static. + gdi32/tests: Make test_GdiAlphaBlend() static. + msvcrt/tests: Make void test_cp_table() static. + ntdll/tests: Make rtlraiseexception_vectored_handler() static. + shell32/tests: Make test_cbsize() static. + ole32/tests: Make test_runnable() static. + user32/tests: Make some functions static. + msvcrt: Point the set_new_handler() entrypoint to the right implementation. + wineoss.drv: Make widOpen() and wodOpen() static. + userenv/tests: Make userenv_dbgstr_w() static. + kernel32: Remove _hread16() as it is not used. Move _hwrite16() next to the other related functions. + wininet & winhttp: Remove the MSG_WAITALL definition as it is not needed. + devenum: French and German should use SUBLANG_NEUTRAL. + ole32: Use the IStream16_(CreateStream,CreateStorage,Write) implementations. + cmd: Make WCMD_DumpCommands() static. + d3d8: Make D3D8CB_CreateSurface() static. + port: S_IWUSR and S_IX* are not needed. Remove them. + msiexec: Make KillService() static. + winapi_check: Add support for '-arch=xxx' in spec files. + explorer: Make appbar_wndproc() static. + winejack.drv: Make some functions static. + wineesd.drv: Make some functions static. + wineaudioio.drv: Export widMessage(). + setupapi/tests: Make devinst_RegDeleteTreeW() static. + riched20/tests: Make keep_responsive() and customWordBreakProc() static. + mlang/tests: Make strstrW() static. + gdi32: Make [GS]etDCState() static. + gdi32: Export three implemented 16bit Engine*() functions. + kernel32: Make some functions static. + ddraw/tests: Make some functions static. + net: Make output_string() and output_error_string() static. + oleaut32/tests: Make the Widget_*() and KindaEnum_*() functions static. + msi/tests: Make enum_stream_names() and package_RegDeleteTreeW() static. + devenum: Explicitly identify the translation as being for SUBLANG_PORTUGUESE_BRAZILIAN. + wrc: Add a trailing '\n' to some warning and error messages. + msvcrt/tests: Add a trailing '\n' to an ok() call. + dmloader: Add a trailing '\n' to a Wine trace. + rpcrt4/tests: Fix the trailing '\n' in an ok() call. + wined3d: Fix double const. + winapi_check: Extend support for '-arch=xxx' in spec files. + devenum: Make the Romanian translation LANG_NEUTRAL. + wintrust/tests: Add a trailing '\n' to ok() calls. + wineoss.drv: Fix the m[io]dMessage() documentation. + winealsa.drv: Fix the m[io]dMessage() documentation. + +Hans Leidekker (34): + setupapi: Forward pSetupIsUserAdmin to IsUserAdmin. + setupapi: Implement StringTableAddStringEx. + setupapi: Fix typo in StringTableGetExtraData. + wininet: Set secure flag when scheme is https. + winhttp: Prepend slash to request path if necessary. + clusapi: Add stubs for OpenCluster and CloseCluster. + ws2_32: Implement WSAIoctl(SIO_KEEPALIVE_VALS). + winhttp: Validate parameters per component in WinHttpCrackUrl. + winhttp: Resolve host port at the latest possible moment. + wininet: Adapt tests to winehq changes. + hal: Add version resource. + wine.inf: Create fake hal.dll. + pidgen: Add stub implementation. + pidgen: Add a placeholder BINK resource. + janitorial: Don't depend on user32 for the self registration functions. + janitorial: Remove unneeded user32 imports. + wuapi: New dll. + include: Add IAutomaticUpdates, IUpdateSession, IUpdateSearcher, IUpdateDownloader and IUpdateInstaller interfaces. + wuapi: Add a stub implementation of IUpdateDownloader. + wuapi: Add a stub implementation of IUpdateInstaller. + wuapi: Add a stub implementation of IUpdateSearcher. + wuapi: Add a stub implementation of IAutomaticUpdates. + wuapi: Add a stub implementation of IUpdateSession. + wuapi: Add class factory. + wuapi: Register interfaces. + wintrust: Open test file with share mode FILE_SHARE_READ. + wintrust: Don't test last error on success. + wintrust: Implement CryptCATAdminAcquireContext. + wintrust: Implement CryptCATAdminReleaseContext. + wininet: Relax a notification test. + wintrust: Implement CryptCATAdminAddCatalog, CryptCATAdminReleaseCatalogContext and CryptCATAdminReleaseContext. + wintrust: Add tests for adding and removing catalog files. + mscat32: Forward more functions to wintrust. + wintrust: Implement CryptCATAdminCalcHashFromFileHandle. + +Henri Verbeet (50): + wined3d: Load texture coordinates from the correct streams. + wined3d: Explicitly pass the shader version to shader_get_param(). + wined3d: Explicitly pass the shader version to shader_skip_unrecognized(). + wined3d: Return early from shader_trace_init() when a NULL pFunction is passed. + wined3d: Avoid disabling numbered arrays if we're going to enable them afterwards anyway. + wined3d: Remove some unused code. + wined3d: Don't leak memory in IWineD3DPixelShaderImpl_GenerateShader(). + wined3d: Add functions to initialize and free shader buffers. + wined3d: Fix the IWineD3DVertexShader and IWineD3DPixelShader IUnknown methods. + wined3d: Fix some spelling errors. + wined3d: Use the actual fixup for the stage in gen_ati_shader(). + wined3d: Rename texture_stage_op.color_correction to texture_stage_op.color_fixup. + wined3d: Compare & copy with the correct clipplane size in IWineD3DStateBlockImpl_Capture(). + wined3d: Make some constant arrays also static. + wined3d: Get rid of the "len" variable in shader_trace_init(). + wined3d: baseShader.functionLength should be 0 when a NULL pFunction is passed. + wined3d: Remove some more unused code. + wined3d: shader_trace_init() shouldn't have side effects. + wined3d: Don't trace the shader if nobody's looking. + wined3d: Don't reparse the entire shader just to update the sampler types. + wined3d: We only care is a sampler is sampled at all in device_map_vsamplers(), not the specific type. + wined3d: Get rid of the textureDimensions field in the state block. + wined3d: Use a simpler way to calculate the number of texture levels. + wined3d: Don't leak memory on failure in allocate_shader_constants(). + wined3d: Explicitly pass the shader version to some more functions. + wined3d: Move the shader version to reg_maps. + wined3d: Simplify shader_generate_main() a bit. + d3d8: Create a d3d8 declaration as parent for FVF based declarations. + d3d8: Use the wined3d declaration to retrieve the d3d8 shader in IDirect3DDevice8Impl_GetVertexShader(). + d3d8: Remove unused code. + wined3d: Refuse to create shaders with a NULL function. + wined3d: Shaders will never have a NULL function. + wined3d: Fix use_vs() usage in vertexdeclaration(). + d3d8: Add a test for GetVertexShader() with a FVF set. + wined3d: Remove GetFVF() and SetFVF() from IWineD3DDevice. + wined3d: Record floating point pixel shader constants in EndStateBlock() as well. + d3d9: Fix the shader constant test. + wined3d: Remove the shader_cleanup() method from the shader backend. + winex11.drv: Fix color conversion for 16 bpp cursors. + d3d9: Fix a trace. + d3d9: Add a test for shader constant application through IDirect3DStateBlock9_Apply(). + wined3d: Fix constant setting for the ARB backend. + wined3d: Don't mark shader constants dirty when we're recording a stateblock. + wined3d: Track shader constants in the shader backend. + wined3d: Don't call allocate_shader_constants() from Init3D(). + wined3d: Set the initial viewport in InitStartupStateBlock(). + wined3d: Properly reset the stateblock. + wined3d: Only apply shader constants that changed. + wined3d: Remove a useless FIXME. + wined3d: Consistently use .xyzw for vector components. + +Hwang YunSong(황윤성) (2): + cryptdlg: New Korean resource. + oleview: Updated Korean resource. + +Jacek Caban (14): + mshtml: Make IHTMLElement::get_document vtbl offset independent. + mshtml: Skip tests on broken IE6 versions. + mshtml: Fixed a typo. + jscript: Added Math.PI implementation. + jscript: Added Math.E implementation. + jscript: Added Math.LOG2E implementation. + jscript: Added Math.LOG10E implementation. + jscript: Delay setting named info if SCRIPTITEM_GLOBALMEMBER flag is not set. + mshtml: Fixed IHTMLInputTextElement vtbl and QueryInterface implementation. + jscript: Correctly handle SCRIPTITEM_GLOBALMEMBERS flag in identifier_eval. + urlmon: Remove broken IBindCtx ref count test. + mshtml: Use stored nsINetUtil interface. + mshtml: Added nsIChannel::[Get|Set]Owner implementation. + mshtml: Write aCount bytes in nsIInputStream::ReadSegments. + +James Hawkins (27): + msi: Fix the type of the last parameter of MsiEnumPatchesEx. + msi: Add the MSIPATCHSTATE enumeration. + msi: Forward MsiEnumPatchesExA to MsiEnumPatchesExW. + msi: Implement MsiEnumPatchesExW. + msi: Fix an uninitialized variable. + msi: Add tests for MsiEnumPatchesEx. + msi: Add the ability to open multiple users product keys. + msi: Add the ability to open multiple users' component keys. + msi: Add the ability to open multiple users' install properties key. + msi: Remove a duplicated function. + msi: Remove a duplicated function. + msi: Add the ability to delete multiple users' component keys. + msi: Forward MsiEnumPatchesA to MsiEnumPatchesW. + msi: Implement MsiEnumPatchesW. + msi: Add tests for MsiEnumPatches. + msi: Forward MsiGetProductPropertyA to MsiGetProductPropertyW. + msi: Implement MsiGetProductPropertyW. + msi: Add tests for MsiGetProductProperty. + msi: Add a stub implementation of MsiGetPatchInfoEx. + msi: Forward MsiGetPatchInfoExA to MsiGetPatchInfoExW. + msi: Add the ability to query a specific context for a product key. + msi: Add the ability to query a specific context for a patch. + msi: Add the ability to query a specific context for install properties. + msi: Implement MsiGetPatchInfoExW. + msi: Publish the patch information. + msi: Set the property specified by the Source attribute of the Media table when applying a patch. + msi: Add tests for MsiGetPatchInfo. + +Jeff Zaroyko (2): + msadp32.acm: Make the szFormatTag the same as windows. + imaadp32: Report the same driver details as windows. + +Jeremy Drake (1): + oleaut32/tests: Fix double GlobalFree in olepicture tests. + +Jonathan Ernst (7): + wordpad: Updated French translation. + winhlp32: WINE->Wine. + winhlp32: Updated French translation. + shell32: Updated French translation. + crypt32: Updated French translation. + cryptdlg: New French translation. + oleacc: New French translation. + +Juan Lang (57): + crypt32: Remove unnecessary casts. + crypt32: Allow setting CERT_KEY_PROV_HANDLE_PROP_ID if CERT_KEY_CONTEXT_PROP_ID has not previously been set. + wintrust: Add stub for WVTAsn1SpcSpOpusInfoEncode. + wintrust: Add tests for WVTAsn1SpcSpOpusInfoEncode. + wintrust: Implement WVTAsn1SpcSpOpusInfoEncode. + wintrust: Add tests for WVTAsn1SpcSpOpusInfoDecode. + crypt32: Add tests for CryptQueryObject. + crypt32: Validate input arguments to CryptQueryObject. + crypt32: Don't claim to have queried an object as a serialized context when reading it has failed. + crypt32: Downgrade a fixme to a warn. + crypt32: Support base64-encoded context objects in CryptQueryObject. + crypt32: Split querying PKCS messages into helper functions. + crypt32: Support base64-encoded PKCS messages in CryptQueryObject. + crypt32: Implement CryptStringToBinaryW. + crypt32: Support wide character base64-encoded PKCS messages in CryptQueryObject. + cryptui: Ignore additional prop sheet pages when calling CryptUIViewCertificateW from CryptUIViewCertificateA. + cryptui: Call WinVerifyTrust if the caller has not. + cryptui: Show (empty) certificate dialog. + cryptui: Show subject, issuer, and validity period for a cert in the properties dialog. + cryptui: Show icon and text representing trust state of certificate. + cryptui: Show valid policies for a cert. + cryptui: Show issuer statement in cert properties dialog. + cryptui: Add a (empty) details page to the cert properties dialog. + cryptui: Add selections to field selection list in details page. + cryptui: Show the X.509 v1 certificate fields in the details page. + cryptui: Show detailed value of a field when it's selected in the details page. + cryptui: Show the certificate extensions in the details page. + cryptui: Show the certificate properties in the details page. + cryptui: Remove unnecessary check. + cryptui: Add a (empty) hierarchy page to the cert properties dialog. + cryptui: Show cert chain in hierarchy page. + cryptui: Show status for end cert in hierarchy page. + cryptui: Show certificate status for selected certificate in hierarchy page. + cryptui: Allow viewing another cert in the chain from the hierarchy page. + crypt32: Make a function static. + cryptui: Remove code duplication in formatting an enhanced key usage value. + cryptui: Show cert when it's double-clicked in the hierarchy page. + cryptui: Add (empty) edit cert properties dialog. + cryptui: Show cert's friendly name and description in edit properties dialog. + cryptui: Show/hide description's scrollbar depending on how much text it has. + cryptui: Show a cert's allowed usages in cert properties dialog. + cryptui: Redraw purposes list based on purpose selection. + cryptui: Set purpose selection radio button based on enhanced key usage value. + cryptui: Add an add purpose dialog. + cryptui: Show/hide add purpose OID's scrollbar depending on how much text it has. + cryptui: Validate OID in add purpose dialog. + cryptui: Toggle a usage when it's clicked. + cryptui: Set cert friendly name and description in response to applying the edit cert properties dialog. + cryptui: Apply changes to enabled usages in response to applying the edit cert properties dialog. + cryptui: Refresh tabs in response to cert properties changes being applied. + include: Document definitions missing from cryptuiapi.h. + cryptui: Partially implement CryptUIDlgViewContext. + cryptui: Don't crash if a chain can't be created for the viewed cert. + cryptui: Fix problem with usage checkbox bitmap not being visible after the first time the edit cert properties dialog is shown. + crypt32: Don't restrict file stores to binary-encoded files. + crypt32: Don't check for the TLV after indefinite-length sequence items, the item's decoder has already done so. + crypt32: Fix encoding OIDs with only two components. + +Jörg Höhle (2): + msvfw32/tests: ICCOpen() is case-insensitive on MS-Windows. + winecfg: Prevent crash when clearing volume serial number input. + +Konstantin Kondratyuk (1): + mshtml: Correct UIDs of interfaces. + +Lei Zhang (5): + user32: Check input to GetAsyncKeyState(). + qcap: Don't clip intermediate values in YUV to RGB conversion code. + quartz: Enumerate all the pins on filter and check directions when rendering. + gdi32: Prevent integer overflow in CreateBitmapIndirect. + quartz: Ignore unknown chunks when parsing AVI headers. + +Maarten Lankhorst (7): + includes: Fix packing for commdlg in Win64. + wintab32/winex11.drv: Add CDECL to imported functions. + winex11.drv: Make XIM functions hidden. + winex11.drv/explorer: Add CDECL to exported functions. + ntdll: Make all exported wine functions CDECL. + gdi32/user32: Make __wine_make_gdi_object_system CDECL. + ntoskrnl.exe/winedevice: Make wine_ntoskrnl_main_loop CDECL. + +Marcus Meissner (2): + gphoto2.ds: Merge ds_ctrl.c into gphoto2_main.c. + include: Add prototype for GetConsoleInputExeNameA/W(). + +Michael Stefaniuc (6): + rsaenh: Do not cast zero. + taskmgr: Replace malloc with HeapAlloc. + taskmgr: Remove some superfluous casts. + setupapi: Remove some superfluous casts. + winedos: Don't cast zero. + d3dxof/tests: Remove redundant NULL check before HeapFree (Smatch). + +Mikołaj Zalewski (1): + devenum: Italian, Spanish, Dutch and VERSIONINFO should use SUBLANG_NEUTRAL. + +Nikolay Sivov (6): + oleaut32: Added SAFEARRAY support for RecordInfo::RecordClear. + gdiplus: Stub for GdipGetNearestColor. + oleaut32: Added PICTYPE_NONE and PICTYPE_UNINITIALIZED to IPicture::Render. + gdiplus: Added GdipAddPathCurve3/GdipAddPathCurve3I with tests. + gdiplus: Fix Font test failure on charset mismatch. + ole32: Make OleSetClipboard affected by previous OleInitialize() calls. + +Paul Chitescu (1): + shell32.dll: Return SE_ERR_FNF if file not found before checking for associations. + +Paul Vriens (33): + advapi32/tests: Fix a few test failures on NT4. + crypt32/tests: Fix some test failures on Win9x and NT4. + advapi32/tests: Fix some test failures on NT4. + riched32/tests: Remove an incorrect comment. + msi/tests: Run tests again on Win9x and NT4. + advapi32/tests: Only skip tests on NT4. + advapi32/tests: Fix a test failure on NT4. + gdi32/tests: Fix a failure on NT4. + riched32/tests: Remove the todo_wine logic where appropriate. + riched20/tests: Remove the todo_wine logic where appropriate. + msi/tests: Skip tests on win9x due to different registry keys. + gdi32/tests: Remove the todo_wine logic where appropriate. + rsaenh/tests: Fix a test failure on NT4. + setupapi/tests: Fix a test failure on Vista/W2K8. + ddraw/tests: Fix a test failure on a Win98 VMware box. + gdi32/tests: Fix some test failures on Win9x. + gdi32/tests: Fix a few failures on Win9x. + user32/tests: Destroy the windows after the tests. + xinput1_3/tests: Call FreeLibrary() after tests. + rpcrt4/tests: Use GetModuleHandle instead of LoadLibrary. + rpcrt4/tests: Move function pointer initialization to the init function. + msi/tests: Run tests again on Win9x and NT4. + comctl32/tests: Destroy the window after the tests. + riched20/tests: Fix test failures on Win9x, WinMe and Wine in win9x mode. + jscript/tests: Fix test failures on Win9x. + shlwapi/tests: Fix some test failures on Vista. + setupapi/tests: Fix a test failure on Vista (and skip some tests). + imm32/tests: We check for failure not success. + quartz/tests: Fix test failures on Win9x by using A-functions. + riched20/tests: Fix tests on Win9x by using A-calls. + wintrust/tests: Fix test crash on Win9x. + wintrust/tests: Don't crash on NT4 and W2K. + msvfw32/tests: Fix a test failure on W2K3. + +Ricardo Filipe (5): + clusapi: Add stubs for ClusterEnum, ClusterOpenEnum and ClusterCloseEnum. + hal: Add stubs for ExAcquireFastMutex and ExReleaseFastMutex. + advapi32: Add stub for UnregisterTraceGuids. + include: Add DEVNODEID and DEVINSTID definitions. + include: Add header information for CDN_INCLUDEITEM notification. + +Rico Schüller (3): + wordpad: Fix German translation. + winhlp32: Fix German translation. + comdlg32: Fix German translation. + +Roderick Colenbrander (4): + wined3d: Add GL_ARB_texture_rg / GL_EXT_texture_swizzle support. These extensions are needed for more efficient R32F/RG32F support. + wined3d: Add R16F using ARB_texture_rg. + wined3d: Add R32F using ARB_texture_rg. + wined3d: Add GL_RG16F / GL_RG32F support using ARB_texture_rg. + +Rok Mandeljc (12): + regedit: Updated Slovenian translation. + serialui: Added Slovenian translation. + start: Updated Slovenian translation. + winecfg: Updated Slovenian translation. + mshtml: Fixed Slovenian translation. + shell32: Updated Slovenian translation. + wordpad: Updated Slovenian translation. + cmdlgtst: Fix problem with ellipses in Slovenian translation. + winefile: Fix problem with ellipses in Slovenian translation. + appwiz.cpl: Added Slovenian translation. + winhlp32: Updated Slovenian translation. + setupapi: Added Slovenian translation. + +Simon C. Ion (1): + winemaker: Correctly process directories containing regexp metacharacters. + +Stefan Dösinger (21): + ntdll: Print the SYSTEM_PERFORMANCE_INFORMATION only once. + wined3d: Don't load INT and BOOL constants needlessly. + WineD3D: Abstract some ATIfs op debug TRACEs. + wined3d: Fix ARG_UNUSED and use it properly. + wined3d: Give ATIFS a pixel shader handler. + wined3d: Remove a blank line in state.c. + wined3d: Fake GL_ARB_multitexture. + wined3d: Set up the shaders when delaying fixed func applying. + wined3d: Reinstall the G16R16F format surface load fixup. + wined3d: Some GL_EXT_fog_coord prototype fixes. + wined3d: Remove some needless initializations. + wined3d: Emulate GL_EXT_fog_coord. + wined3d: Correct a stage number. + wined3d: Initialize max_combined_samplers properly. + wined3d: Avoid loading opengl32.dll. + wined3d: Get rid of IWineD3DPixelShaderImpl_GenerateShader. + wined3d: Pass the ps_compile_args structures to the shader generation code. + wined3d: Make use of the ps_compile_args structure in glsl_shader. + wined3d: Make use of ps_compile_args in arb shader. + wined3d: Use the ps_compile_args struct in glsl. + wined3d: Make pixelshaders disable fog properly. + +Vincent Povirk (10): + explorer,shell32: Improve ABM_GETTASKBARPOS stub. + gdiplus: Fix a memory leak in GdipCombineRegionRegion. + gdiplus/tests: Fix a double-free in the region test. + gdiplus/tests: Fix a double-free in the graphics test. + shell32: Fix a memory leak in the run dialog code. + shell32: Use the NO_UI flag in ShellExecute. + shell32: Display error messages in ShellExecuteEx. + shell32: Use ShellExecuteEx instead of ShellExecute in the run dialog. + shell32: Use ShellExecuteEx to create error dialogs for the run dialog. + winex11.drv: Do not assume window managers support _NET_WORKAREA. + +Vitaliy Margolen (1): + dinput: Remove DIEnumDevicesCallbackAtoW. + +Wolfgang Walter (1): + wineps.drv: Fix freeing of not allocated memory in type42.c. + +-- +Alexandre Julliard +julliard@winehq.org diff --git a/VERSION b/VERSION index ed413deec76..f4052b2d916 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Wine version 1.1.10 +Wine version 1.1.11 diff --git a/configure b/configure index 960764a73ba..ce93133bafe 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for Wine 1.1.10. +# Generated by GNU Autoconf 2.61 for Wine 1.1.11. # # Report bugs to . # @@ -574,8 +574,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='Wine' PACKAGE_TARNAME='wine' -PACKAGE_VERSION='1.1.10' -PACKAGE_STRING='Wine 1.1.10' +PACKAGE_VERSION='1.1.11' +PACKAGE_STRING='Wine 1.1.11' PACKAGE_BUGREPORT='wine-devel@winehq.org' ac_unique_file="server/atom.c" @@ -1305,7 +1305,7 @@ if test "$ac_init_help" = "long"; then # 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.1.10 to adapt to many kinds of systems. +\`configure' configures Wine 1.1.11 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1374,7 +1374,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of Wine 1.1.10:";; + short | recursive ) echo "Configuration of Wine 1.1.11:";; esac cat <<\_ACEOF @@ -1506,7 +1506,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -Wine configure 1.1.10 +Wine configure 1.1.11 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1520,7 +1520,7 @@ cat >config.log <<_ACEOF 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.1.10, which was +It was created by Wine $as_me 1.1.11, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -7246,6 +7246,7 @@ done + for ac_header in \ AudioUnit/AudioUnit.h \ Carbon/Carbon.h \ @@ -7359,6 +7360,7 @@ for ac_header in \ termios.h \ unistd.h \ utime.h \ + winsock2.h \ valgrind/memcheck.h \ valgrind/valgrind.h @@ -14116,6 +14118,7 @@ fi + for ac_header in ft2build.h \ freetype/freetype.h \ freetype/ftglyph.h \ @@ -14127,6 +14130,7 @@ for ac_header in ft2build.h \ freetype/ftoutln.h \ freetype/ftwinfnt.h \ freetype/ftmodapi.h \ + freetype/ftlcdfil.h \ freetype/internal/sfnt.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` @@ -17009,7 +17013,7 @@ case $host_os in mingw32*) CRTLIBS="-lmsvcrt" - SOCKETLIBS="-lws2_32" + SOCKETLIBS="-L\$(TOPOBJDIR)/dlls/ws2_32 -lws2_32" ;; esac @@ -17104,8 +17108,9 @@ esac + + for ac_func in \ - _mkdir \ _pclose \ _popen \ _snprintf \ @@ -17137,6 +17142,7 @@ for ac_func in \ gettid \ gettimeofday \ getuid \ + inet_ntop \ inet_pton \ kqueue \ lstat \ @@ -17159,6 +17165,7 @@ for ac_func in \ sigaltstack \ sigprocmask \ snprintf \ + socketpair \ spawnvp \ statfs \ statvfs \ @@ -17169,6 +17176,7 @@ for ac_func in \ strtold \ strtoll \ strtoull \ + symlink \ tcgetattr \ thr_kill2 \ timegm \ @@ -18197,6 +18205,64 @@ esac fi +{ echo "$as_me:$LINENO: checking whether mkdir takes only one argument" >&5 +echo $ECHO_N "checking whether mkdir takes only one argument... $ECHO_C" >&6; } +if test "${wine_cv_one_arg_mkdir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +mkdir("foo"); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + wine_cv_one_arg_mkdir=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + wine_cv_one_arg_mkdir=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $wine_cv_one_arg_mkdir" >&5 +echo "${ECHO_T}$wine_cv_one_arg_mkdir" >&6; } +if test "$wine_cv_one_arg_mkdir" = "yes" +then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_ONE_ARG_MKDIR 1 +_ACEOF + +fi + { echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6; } @@ -26407,7 +26473,7 @@ exec 6>&1 # 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.1.10, which was +This file was extended by Wine $as_me 1.1.11, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -26460,7 +26526,7 @@ Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -Wine config.status 1.1.10 +Wine config.status 1.1.11 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" diff --git a/configure.ac b/configure.ac index 293ca62e146..0109e354816 100644 --- a/configure.ac +++ b/configure.ac @@ -352,6 +352,7 @@ AC_CHECK_HEADERS(\ termios.h \ unistd.h \ utime.h \ + winsock2.h \ valgrind/memcheck.h \ valgrind/valgrind.h ) @@ -1041,6 +1042,7 @@ then freetype/ftoutln.h \ freetype/ftwinfnt.h \ freetype/ftmodapi.h \ + freetype/ftlcdfil.h \ freetype/internal/sfnt.h,,, [#ifdef HAVE_FT2BUILD_H # include @@ -1357,7 +1359,7 @@ dnl Mingw needs explicit msvcrt for linking libwine and winsock for wininet case $host_os in mingw32*) AC_SUBST(CRTLIBS,"-lmsvcrt") - AC_SUBST(SOCKETLIBS,"-lws2_32") + AC_SUBST(SOCKETLIBS,"-L\$(TOPOBJDIR)/dlls/ws2_32 -lws2_32") ;; esac @@ -1378,7 +1380,6 @@ esac dnl **** Check for functions **** AC_CHECK_FUNCS(\ - _mkdir \ _pclose \ _popen \ _snprintf \ @@ -1410,6 +1411,7 @@ AC_CHECK_FUNCS(\ gettid \ gettimeofday \ getuid \ + inet_ntop \ inet_pton \ kqueue \ lstat \ @@ -1432,6 +1434,7 @@ AC_CHECK_FUNCS(\ sigaltstack \ sigprocmask \ snprintf \ + socketpair \ spawnvp \ statfs \ statvfs \ @@ -1442,6 +1445,7 @@ AC_CHECK_FUNCS(\ strtold \ strtoll \ strtoull \ + symlink \ tcgetattr \ thr_kill2 \ timegm \ @@ -1511,6 +1515,15 @@ fi WINE_NOTICE_WITH(ldap,[test "x$LDAPLIBS" = "x"], [libldap (OpenLDAP) ${notice_platform}development files not found, LDAP won't be supported.]) +AC_CACHE_CHECK([whether mkdir takes only one argument], + wine_cv_one_arg_mkdir, + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]],[[mkdir("foo");]])], + [wine_cv_one_arg_mkdir=yes],[wine_cv_one_arg_mkdir=no])) +if test "$wine_cv_one_arg_mkdir" = "yes" +then + AC_DEFINE(HAVE_ONE_ARG_MKDIR, 1, [Define if mkdir takes only one argument]) +fi + dnl **** Check for types **** AC_C_CONST diff --git a/dlls/Makedll.rules.in b/dlls/Makedll.rules.in index 965302f63d4..c91696604d7 100644 --- a/dlls/Makedll.rules.in +++ b/dlls/Makedll.rules.in @@ -18,7 +18,7 @@ MAINSPEC = $(BASEMODULE).spec SPEC_DEF = $(BASEMODULE).def WIN16_FILES = $(SPEC_SRCS16:.spec=.spec.o) $(C_SRCS16:.c=.o) $(EXTRA_OBJS16) ALL_OBJS = @WIN16_FILES@ $(OBJS) $(RC_SRCS:.rc=.res) -ALL_LIBS = $(EXTRALIBS) $(LIBPORT) $(LDFLAGS) $(LIBS) +ALL_LIBS = $(LIBPORT) $(EXTRALIBS) $(LDFLAGS) $(LIBS) IMPLIB_OBJS = $(IMPLIB_SRCS:.c=.o) IMPORTLIBFILE = $(IMPORTLIB:%=lib%.$(IMPLIBEXT)) STATICIMPLIB = $(IMPORTLIBFILE:.def=.def.a) diff --git a/dlls/crypt32/crl.c b/dlls/crypt32/crl.c index 9ae0d5d8aad..a1138b5ed67 100644 --- a/dlls/crypt32/crl.c +++ b/dlls/crypt32/crl.c @@ -275,7 +275,7 @@ static BOOL CRLContext_GetHashProp(PCCRL_CONTEXT context, DWORD dwPropId, { BOOL ret = CryptHashCertificate(0, algID, 0, toHash, toHashLen, pvData, pcbData); - if (ret) + if (ret && pvData) { CRYPT_DATA_BLOB blob = { *pcbData, pvData }; diff --git a/dlls/crypt32/ctl.c b/dlls/crypt32/ctl.c index ffac6674dfd..42abcd73346 100644 --- a/dlls/crypt32/ctl.c +++ b/dlls/crypt32/ctl.c @@ -82,6 +82,27 @@ BOOL WINAPI CertAddCTLContextToStore(HCERTSTORE hCertStore, else toAdd = CertDuplicateCTLContext(pCtlContext); break; + case CERT_STORE_ADD_NEWER_INHERIT_PROPERTIES: + if (existing) + { + LONG newer = CompareFileTime(&existing->pCtlInfo->ThisUpdate, + &pCtlContext->pCtlInfo->ThisUpdate); + + if (newer < 0) + { + toAdd = CertDuplicateCTLContext(pCtlContext); + CtlContext_CopyProperties(existing, pCtlContext); + } + else + { + TRACE("existing CTL is newer, not adding\n"); + SetLastError(CRYPT_E_EXISTS); + ret = FALSE; + } + } + else + toAdd = CertDuplicateCTLContext(pCtlContext); + break; case CERT_STORE_ADD_REPLACE_EXISTING: toAdd = CertDuplicateCTLContext(pCtlContext); break; @@ -484,7 +505,7 @@ static BOOL CTLContext_GetHashProp(PCCTL_CONTEXT context, DWORD dwPropId, { BOOL ret = CryptHashCertificate(0, algID, 0, toHash, toHashLen, pvData, pcbData); - if (ret) + if (ret && pvData) { CRYPT_DATA_BLOB blob = { *pcbData, pvData }; diff --git a/dlls/crypt32/store.c b/dlls/crypt32/store.c index 1519c968ee0..3b42893d3dd 100644 --- a/dlls/crypt32/store.c +++ b/dlls/crypt32/store.c @@ -893,6 +893,25 @@ BOOL WINAPI CertAddCertificateContextToStore(HCERTSTORE hCertStore, else toAdd = CertDuplicateCertificateContext(pCertContext); break; + case CERT_STORE_ADD_NEWER_INHERIT_PROPERTIES: + if (existing) + { + if (CompareFileTime(&existing->pCertInfo->NotBefore, + &pCertContext->pCertInfo->NotBefore) >= 0) + { + TRACE("existing certificate is newer, not adding\n"); + SetLastError(CRYPT_E_EXISTS); + ret = FALSE; + } + else + { + toAdd = CertDuplicateCertificateContext(pCertContext); + CertContext_CopyProperties(toAdd, existing); + } + } + else + toAdd = CertDuplicateCertificateContext(pCertContext); + break; default: FIXME("Unimplemented add disposition %d\n", dwAddDisposition); SetLastError(E_INVALIDARG); @@ -1016,6 +1035,27 @@ BOOL WINAPI CertAddCRLContextToStore(HCERTSTORE hCertStore, else toAdd = CertDuplicateCRLContext(pCrlContext); break; + case CERT_STORE_ADD_NEWER_INHERIT_PROPERTIES: + if (existing) + { + LONG newer = CompareFileTime(&existing->pCrlInfo->ThisUpdate, + &pCrlContext->pCrlInfo->ThisUpdate); + + if (newer < 0) + { + toAdd = CertDuplicateCRLContext(pCrlContext); + CrlContext_CopyProperties(toAdd, existing); + } + else + { + TRACE("existing CRL is newer, not adding\n"); + SetLastError(CRYPT_E_EXISTS); + ret = FALSE; + } + } + else + toAdd = CertDuplicateCRLContext(pCrlContext); + break; case CERT_STORE_ADD_REPLACE_EXISTING: toAdd = CertDuplicateCRLContext(pCrlContext); break; diff --git a/dlls/cryptui/Makefile.in b/dlls/cryptui/Makefile.in index e268be61cf7..d70d0ea6857 100644 --- a/dlls/cryptui/Makefile.in +++ b/dlls/cryptui/Makefile.in @@ -3,7 +3,7 @@ TOPOBJDIR = ../.. SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = cryptui.dll -IMPORTS = uuid crypt32 ole32 comctl32 user32 gdi32 kernel32 +IMPORTS = uuid crypt32 ole32 comctl32 comdlg32 user32 gdi32 kernel32 DELAYIMPORTS = wintrust urlmon IMPORTLIB = cryptui diff --git a/dlls/cryptui/cryptui.spec b/dlls/cryptui/cryptui.spec index 9c5a8612640..c8b161f4d04 100644 --- a/dlls/cryptui/cryptui.spec +++ b/dlls/cryptui/cryptui.spec @@ -5,8 +5,8 @@ 5 stub CryptUIDlgSelectCertificateA 6 stub CryptUIDlgSelectCertificateFromStore 7 stub CryptUIDlgSelectCertificateW -8 stub CryptUIDlgSelectStoreA -9 stub CryptUIDlgSelectStoreW +8 stdcall CryptUIDlgSelectStoreA(ptr) +9 stdcall CryptUIDlgSelectStoreW(ptr) 10 stub CryptUIDlgViewCRLA 11 stub CryptUIDlgViewCRLW 12 stub CryptUIDlgViewCTLA diff --git a/dlls/cryptui/cryptui_En.rc b/dlls/cryptui/cryptui_En.rc index f904fa7d6ac..0bd34786747 100644 --- a/dlls/cryptui/cryptui_En.rc +++ b/dlls/cryptui/cryptui_En.rc @@ -61,6 +61,38 @@ STRINGTABLE DISCARDABLE IDS_CERTIFICATE_PROPERTIES "Certificate Properties" IDS_CERTIFICATE_PURPOSE_ERROR "Please enter an OID in the form 1.2.3.4" IDS_CERTIFICATE_PURPOSE_EXISTS "The OID you entered already exists." + IDS_SELECT_STORE_TITLE "Select Certificate Store" + IDS_SELECT_STORE "Please select a certificate store." + IDS_IMPORT_WIZARD "Certificate Import Wizard" + IDS_IMPORT_TYPE_MISMATCH "The file contains objects that do not match the given criteria. Please select another file." + IDS_IMPORT_FILE_TITLE "File to Import" + IDS_IMPORT_FILE_SUBTITLE "Specify the file you want to import." + IDS_IMPORT_STORE_TITLE "Certificate Store" + IDS_IMPORT_STORE_SUBTITLE "Certificate stores are collections of certificates, certificate revocation lists, and certificate trust lists." + IDS_IMPORT_FILTER_CERT "X.509 Certificate (*.cer; *.crt)" + IDS_IMPORT_FILTER_PFX "Personal Information Exchange (*.pfx; *.p12)" + IDS_IMPORT_FILTER_CRL "Certificate Revocation List (*.crl)" + IDS_IMPORT_FILTER_CTL "Certificate Trust List (*.stl)" + IDS_IMPORT_FILTER_SERIALIZED_STORE "Microsoft Serialized Certificate Store (*.sst)" + IDS_IMPORT_FILTER_CMS "CMS/PKCS #7 Messages (*.spc; *.p7b)" + IDS_IMPORT_FILTER_ALL "All Files (*.*)" + IDS_IMPORT_EMPTY_FILE "Please select a file." + IDS_IMPORT_BAD_FORMAT "The file format is not recognized. Please select another file." + IDS_IMPORT_OPEN_FAILED "Could not open " + IDS_IMPORT_DEST_DETERMINED "Determined by the program" + IDS_IMPORT_SELECT_STORE "Please select a store" + IDS_IMPORT_STORE_SELECTION "Certificate Store Selected" + IDS_IMPORT_DEST_AUTOMATIC "Automatically determined by the program" + IDS_IMPORT_FILE "File" + IDS_IMPORT_CONTENT "Content" + IDS_IMPORT_CONTENT_CERT "Certificate" + IDS_IMPORT_CONTENT_CRL "Certificate Revocation List" + IDS_IMPORT_CONTENT_CTL "Certificate Trust List" + IDS_IMPORT_CONTENT_CMS "CMS/PKCS #7 Message" + IDS_IMPORT_CONTENT_PFX "Personal Information Exchange" + IDS_IMPORT_CONTENT_STORE "Certificate Store" + IDS_IMPORT_SUCCEEDED "The import was successful." + IDS_IMPORT_FAILED "The import failed." IDS_PURPOSE_SERVER_AUTH "Ensures the identify of a remote computer" IDS_PURPOSE_CLIENT_AUTH "Proves your identity to a remote computer" IDS_PURPOSE_CODE_SIGNING "Ensures software came from software publisher\nProtects software from alteration after publication" @@ -183,3 +215,74 @@ BEGIN PUSHBUTTON "OK", IDOK, 33,48,60,14 PUSHBUTTON "Cancel", IDCANCEL, 100,48,60,14 END + +IDD_SELECT_STORE DIALOG DISCARDABLE 0,0,200,136 +CAPTION "Select Certificate Store" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Select the certificate store you want to use:", IDC_STORE_TEXT, 6,6,190,28 + CONTROL "",IDC_STORE_LIST, "SysTreeView32", TVS_HASLINES|WS_BORDER|WS_TABSTOP, + 6,28,188,70 + CHECKBOX "&Show physical stores", IDC_SHOW_PHYSICAL_STORES, 6,102,90,14, + BS_AUTOCHECKBOX|WS_TABSTOP + PUSHBUTTON "OK", IDOK, 90,118,50,14, BS_DEFPUSHBUTTON + PUSHBUTTON "Cancel", IDCANCEL, 144,118,50,14 +END + +IDD_IMPORT_WELCOME DIALOG DISCARDABLE 0,0,317,143 +CAPTION "Certificate Import Wizard" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Welcome to the Certificate Import Wizard", IDC_IMPORT_TITLE, + 115,1,195,24 + LTEXT "This wizard helps you import certificates, certificate revocation lists, and certificate trust lists from a file to a certificate store.", + stc1, 115,33,195,16 + LTEXT "A certificate can be used to identify you or the computer with which you are communicating. It can also be used for authentication, and to sign messages. Certificate stores are collections of certificates, certificate revocation lists, and certificate trust lists.", + stc2, 115,56,195,40 + LTEXT "To continue, click Next.", + stc3, 115,103,195,8 +END + +IDD_IMPORT_FILE DIALOG DISCARDABLE 0,0,317,143 +CAPTION "Certificate Import Wizard" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "&File name:", stc1, 21,1,195,10 + EDITTEXT IDC_IMPORT_FILENAME, 21,11,208,14, ES_AUTOHSCROLL|WS_TABSTOP + PUSHBUTTON "B&rowse...", IDC_IMPORT_BROWSE_FILE, 236,11,60,14 + LTEXT "Note: The following file formats may contain more than one certificate, certificate revocation list, or certificate trust list:", stc2, 21,26,265,16 + LTEXT "Cryptographic Message Syntax Standard/PKCS #7 Messages (.p7b)", + stc3, 31,49,265,10 + LTEXT "Personal Information Exchange/PKCS #12 (.pfx, .p12)", + stc3, 31,64,265,10 + LTEXT "Microsoft Serialized Certificate Store (.sst)", + stc3, 31,79,265,10 +END + +IDD_IMPORT_STORE DIALOG DISCARDABLE 0,0,317,143 +CAPTION "Certificate Import Wizard" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Wine can automatically select the certificate store, or you can specify a location for the certificates.", stc1, 21,1,195,20 + AUTORADIOBUTTON "&Automatically select certificate store", + IDC_IMPORT_AUTO_STORE, 31,18,180,12, BS_AUTORADIOBUTTON|WS_TABSTOP + AUTORADIOBUTTON "&Place all certificates in the following store:", + IDC_IMPORT_SPECIFY_STORE, 31,30,180,12, BS_AUTORADIOBUTTON + EDITTEXT IDC_IMPORT_STORE, 44,49,185,14, ES_READONLY + PUSHBUTTON "B&rowse...", IDC_IMPORT_BROWSE_STORE, 236,49,60,14 +END + +IDD_IMPORT_FINISH DIALOG DISCARDABLE 0,0,317,143 +CAPTION "Certificate Import Wizard" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "Completing the Certificate Import Wizard", IDC_IMPORT_TITLE, + 115,1,195,24 + LTEXT "You have successfully completed the Certificate Import Wizard.", + stc1, 115,33,195,24 + LTEXT "You have specified the following settings:", + stc2, 115,57,195,12 + CONTROL "", IDC_IMPORT_SETTINGS, "SysListView32", + LVS_REPORT|LVS_SINGLESEL|WS_CHILD|WS_VISIBLE|WS_TABSTOP|WS_BORDER, + 115,67,174,100 +END diff --git a/dlls/cryptui/cryptuires.h b/dlls/cryptui/cryptuires.h index 9e188524594..fbbf441b6d1 100644 --- a/dlls/cryptui/cryptuires.h +++ b/dlls/cryptui/cryptuires.h @@ -58,6 +58,38 @@ #define IDS_CERTIFICATE_PROPERTIES 1038 #define IDS_CERTIFICATE_PURPOSE_ERROR 1039 #define IDS_CERTIFICATE_PURPOSE_EXISTS 1040 +#define IDS_SELECT_STORE_TITLE 1041 +#define IDS_SELECT_STORE 1042 +#define IDS_IMPORT_WIZARD 1043 +#define IDS_IMPORT_TYPE_MISMATCH 1044 +#define IDS_IMPORT_FILE_TITLE 1045 +#define IDS_IMPORT_FILE_SUBTITLE 1046 +#define IDS_IMPORT_STORE_TITLE 1047 +#define IDS_IMPORT_STORE_SUBTITLE 1048 +#define IDS_IMPORT_FILTER_CERT 1049 +#define IDS_IMPORT_FILTER_PFX 1050 +#define IDS_IMPORT_FILTER_CRL 1051 +#define IDS_IMPORT_FILTER_CTL 1052 +#define IDS_IMPORT_FILTER_SERIALIZED_STORE 1053 +#define IDS_IMPORT_FILTER_CMS 1054 +#define IDS_IMPORT_FILTER_ALL 1055 +#define IDS_IMPORT_EMPTY_FILE 1056 +#define IDS_IMPORT_BAD_FORMAT 1057 +#define IDS_IMPORT_OPEN_FAILED 1058 +#define IDS_IMPORT_DEST_DETERMINED 1059 +#define IDS_IMPORT_SELECT_STORE 1060 +#define IDS_IMPORT_STORE_SELECTION 1061 +#define IDS_IMPORT_DEST_AUTOMATIC 1062 +#define IDS_IMPORT_FILE 1063 +#define IDS_IMPORT_CONTENT 1064 +#define IDS_IMPORT_CONTENT_CERT 1065 +#define IDS_IMPORT_CONTENT_CRL 1066 +#define IDS_IMPORT_CONTENT_CTL 1067 +#define IDS_IMPORT_CONTENT_CMS 1068 +#define IDS_IMPORT_CONTENT_PFX 1069 +#define IDS_IMPORT_CONTENT_STORE 1070 +#define IDS_IMPORT_SUCCEEDED 1071 +#define IDS_IMPORT_FAILED 1072 #define IDS_PURPOSE_SERVER_AUTH 1100 #define IDS_PURPOSE_CLIENT_AUTH 1101 @@ -92,6 +124,11 @@ #define IDD_USERNOTICE 103 #define IDD_CERT_PROPERTIES_GENERAL 104 #define IDD_ADD_CERT_PURPOSE 105 +#define IDD_SELECT_STORE 106 +#define IDD_IMPORT_WELCOME 107 +#define IDD_IMPORT_FILE 108 +#define IDD_IMPORT_STORE 109 +#define IDD_IMPORT_FINISH 110 #define IDB_SMALL_ICONS 200 #define IDB_CERT 201 @@ -131,4 +168,17 @@ #define IDC_NEW_PURPOSE 2500 +#define IDC_STORE_TEXT 2600 +#define IDC_STORE_LIST 2601 +#define IDC_SHOW_PHYSICAL_STORES 2602 + +#define IDC_IMPORT_TITLE 2700 +#define IDC_IMPORT_FILENAME 2701 +#define IDC_IMPORT_BROWSE_FILE 2702 +#define IDC_IMPORT_AUTO_STORE 2703 +#define IDC_IMPORT_SPECIFY_STORE 2704 +#define IDC_IMPORT_STORE 2705 +#define IDC_IMPORT_BROWSE_STORE 2706 +#define IDC_IMPORT_SETTINGS 2707 + #endif /* ndef __CRYPTUIRES_H_ */ diff --git a/dlls/cryptui/main.c b/dlls/cryptui/main.c index 82a877f0456..286899dde85 100644 --- a/dlls/cryptui/main.c +++ b/dlls/cryptui/main.c @@ -32,6 +32,7 @@ #include "richedit.h" #include "ole2.h" #include "richole.h" +#include "commdlg.h" #include "commctrl.h" #include "cryptuiapi.h" #include "cryptuires.h" @@ -73,6 +74,354 @@ BOOL WINAPI CryptUIDlgCertMgr(PCCRYPTUI_CERT_MGR_STRUCT pCryptUICertMgr) return FALSE; } +/* FIXME: real names are unknown, functions are undocumented */ +typedef struct _CRYPTUI_ENUM_SYSTEM_STORE_ARGS +{ + DWORD dwFlags; + void *pvSystemStoreLocationPara; +} CRYPTUI_ENUM_SYSTEM_STORE_ARGS, *PCRYPTUI_ENUM_SYSTEM_STORE_ARGS; + +typedef struct _CRYPTUI_ENUM_DATA +{ + DWORD cStores; + HCERTSTORE *rghStore; + DWORD cEnumArgs; + PCRYPTUI_ENUM_SYSTEM_STORE_ARGS rgEnumArgs; +} CRYPTUI_ENUM_DATA, *PCRYPTUI_ENUM_DATA; + +typedef BOOL (WINAPI *PFN_SELECTED_STORE_CB)(HCERTSTORE store, HWND hwnd, + void *pvArg); + +/* Values for dwFlags */ +#define CRYPTUI_ENABLE_SHOW_PHYSICAL_STORE 0x00000001 + +typedef struct _CRYPTUI_SELECTSTORE_INFO_A +{ + DWORD dwSize; + HWND parent; + DWORD dwFlags; + LPSTR pszTitle; + LPSTR pszText; + CRYPTUI_ENUM_DATA *pEnumData; + PFN_SELECTED_STORE_CB pfnSelectedStoreCallback; + void *pvArg; +} CRYPTUI_SELECTSTORE_INFO_A, *PCRYPTUI_SELECTSTORE_INFO_A; + +typedef struct _CRYPTUI_SELECTSTORE_INFO_W +{ + DWORD dwSize; + HWND parent; + DWORD dwFlags; + LPWSTR pwszTitle; + LPWSTR pwszText; + CRYPTUI_ENUM_DATA *pEnumData; + PFN_SELECTED_STORE_CB pfnSelectedStoreCallback; + void *pvArg; +} CRYPTUI_SELECTSTORE_INFO_W, *PCRYPTUI_SELECTSTORE_INFO_W; + +struct StoreInfo +{ + enum { + StoreHandle, + SystemStore + } type; + union { + HCERTSTORE store; + LPWSTR name; + } DUMMYUNIONNAME; +}; + +static BOOL WINAPI enum_store_callback(const void *pvSystemStore, + DWORD dwFlags, PCERT_SYSTEM_STORE_INFO pStoreInfo, void *pvReserved, + void *pvArg) +{ + HWND tree = GetDlgItem(pvArg, IDC_STORE_LIST); + TVINSERTSTRUCTW tvis; + LPCWSTR localizedName; + BOOL ret = TRUE; + + tvis.hParent = NULL; + tvis.hInsertAfter = TVI_LAST; + tvis.u.item.mask = TVIF_TEXT; + if ((localizedName = CryptFindLocalizedName(pvSystemStore))) + { + struct StoreInfo *storeInfo = HeapAlloc(GetProcessHeap(), 0, + sizeof(struct StoreInfo)); + + if (storeInfo) + { + storeInfo->type = SystemStore; + storeInfo->u.name = HeapAlloc(GetProcessHeap(), 0, + (strlenW(pvSystemStore) + 1) * sizeof(WCHAR)); + if (storeInfo->u.name) + { + tvis.u.item.mask |= TVIF_PARAM; + tvis.u.item.lParam = (LPARAM)storeInfo; + strcpyW(storeInfo->u.name, pvSystemStore); + } + else + { + HeapFree(GetProcessHeap(), 0, storeInfo); + ret = FALSE; + } + } + else + ret = FALSE; + tvis.u.item.pszText = (LPWSTR)localizedName; + } + else + tvis.u.item.pszText = (LPWSTR)pvSystemStore; + /* FIXME: need a folder icon for the store too */ + if (ret) + SendMessageW(tree, TVM_INSERTITEMW, 0, (LPARAM)&tvis); + return ret; +} + +static void enumerate_stores(HWND hwnd, CRYPTUI_ENUM_DATA *pEnumData) +{ + DWORD i; + HWND tree = GetDlgItem(hwnd, IDC_STORE_LIST); + + for (i = 0; i < pEnumData->cEnumArgs; i++) + CertEnumSystemStore(pEnumData->rgEnumArgs[i].dwFlags, + pEnumData->rgEnumArgs[i].pvSystemStoreLocationPara, + hwnd, enum_store_callback); + for (i = 0; i < pEnumData->cStores; i++) + { + DWORD size; + + if (CertGetStoreProperty(pEnumData->rghStore[i], + CERT_STORE_LOCALIZED_NAME_PROP_ID, NULL, &size)) + { + LPWSTR name = HeapAlloc(GetProcessHeap(), 0, size); + + if (name) + { + if (CertGetStoreProperty(pEnumData->rghStore[i], + CERT_STORE_LOCALIZED_NAME_PROP_ID, name, &size)) + { + struct StoreInfo *storeInfo = HeapAlloc(GetProcessHeap(), + 0, sizeof(struct StoreInfo)); + + if (storeInfo) + { + TVINSERTSTRUCTW tvis; + + storeInfo->type = StoreHandle; + storeInfo->u.store = pEnumData->rghStore[i]; + tvis.hParent = NULL; + tvis.hInsertAfter = TVI_LAST; + tvis.u.item.mask = TVIF_TEXT | TVIF_PARAM; + tvis.u.item.pszText = name; + tvis.u.item.lParam = (LPARAM)storeInfo; + SendMessageW(tree, TVM_INSERTITEMW, 0, (LPARAM)&tvis); + } + } + HeapFree(GetProcessHeap(), 0, name); + } + } + } +} + +static void free_store_info(HWND tree) +{ + HTREEITEM next = (HTREEITEM)SendMessageW(tree, TVM_GETNEXTITEM, TVGN_CHILD, + (LPARAM)NULL); + + while (next) + { + TVITEMW item; + + memset(&item, 0, sizeof(item)); + item.mask = TVIF_HANDLE | TVIF_PARAM; + item.hItem = next; + SendMessageW(tree, TVM_GETITEMW, 0, (LPARAM)&item); + if (item.lParam) + { + struct StoreInfo *storeInfo = (struct StoreInfo *)item.lParam; + + if (storeInfo->type == SystemStore) + HeapFree(GetProcessHeap(), 0, storeInfo->u.name); + HeapFree(GetProcessHeap(), 0, storeInfo); + } + next = (HTREEITEM)SendMessageW(tree, TVM_GETNEXTITEM, TVGN_NEXT, + (LPARAM)next); + } +} + +#define MAX_STRING_LEN 512 + +static HCERTSTORE selected_item_to_store(HWND tree, HTREEITEM hItem) +{ + WCHAR buf[MAX_STRING_LEN]; + TVITEMW item; + HCERTSTORE store; + + memset(&item, 0, sizeof(item)); + item.mask = TVIF_HANDLE | TVIF_PARAM | TVIF_TEXT; + item.hItem = hItem; + item.cchTextMax = sizeof(buf) / sizeof(buf[0]); + item.pszText = buf; + SendMessageW(tree, TVM_GETITEMW, 0, (LPARAM)&item); + if (item.lParam) + { + struct StoreInfo *storeInfo = (struct StoreInfo *)item.lParam; + + if (storeInfo->type == StoreHandle) + store = storeInfo->u.store; + else + store = CertOpenSystemStoreW(0, storeInfo->u.name); + } + else + { + /* It's implicitly a system store */ + store = CertOpenSystemStoreW(0, buf); + } + return store; +} + +struct SelectStoreInfo +{ + PCRYPTUI_SELECTSTORE_INFO_W info; + HCERTSTORE store; +}; + +static LRESULT CALLBACK select_store_dlg_proc(HWND hwnd, UINT msg, WPARAM wp, + LPARAM lp) +{ + struct SelectStoreInfo *selectInfo; + LRESULT ret = 0; + + switch (msg) + { + case WM_INITDIALOG: + { + selectInfo = (struct SelectStoreInfo *)lp; + SetWindowLongPtrW(hwnd, DWLP_USER, lp); + if (selectInfo->info->pwszTitle) + SendMessageW(hwnd, WM_SETTEXT, 0, + (LPARAM)selectInfo->info->pwszTitle); + if (selectInfo->info->pwszText) + SendMessageW(GetDlgItem(hwnd, IDC_STORE_TEXT), WM_SETTEXT, 0, + (LPARAM)selectInfo->info->pwszText); + if (!(selectInfo->info->dwFlags & CRYPTUI_ENABLE_SHOW_PHYSICAL_STORE)) + ShowWindow(GetDlgItem(hwnd, IDC_SHOW_PHYSICAL_STORES), FALSE); + enumerate_stores(hwnd, selectInfo->info->pEnumData); + break; + } + case WM_COMMAND: + switch (wp) + { + case IDOK: + { + HWND tree = GetDlgItem(hwnd, IDC_STORE_LIST); + HTREEITEM selection = (HTREEITEM)SendMessageW(tree, + TVM_GETNEXTITEM, TVGN_CARET, (LPARAM)NULL); + + selectInfo = (struct SelectStoreInfo *)GetWindowLongPtrW(hwnd, + DWLP_USER); + if (!selection) + { + WCHAR title[MAX_STRING_LEN], error[MAX_STRING_LEN], *pTitle; + + if (selectInfo->info->pwszTitle) + pTitle = selectInfo->info->pwszTitle; + else + { + LoadStringW(hInstance, IDS_SELECT_STORE_TITLE, title, + sizeof(title) / sizeof(title[0])); + pTitle = title; + } + LoadStringW(hInstance, IDS_SELECT_STORE, error, + sizeof(error) / sizeof(error[0])); + MessageBoxW(hwnd, error, pTitle, MB_ICONEXCLAMATION | MB_OK); + } + else + { + HCERTSTORE store = selected_item_to_store(tree, selection); + + if (!selectInfo->info->pfnSelectedStoreCallback || + selectInfo->info->pfnSelectedStoreCallback(store, hwnd, + selectInfo->info->pvArg)) + { + selectInfo->store = store; + free_store_info(tree); + EndDialog(hwnd, IDOK); + } + else + CertCloseStore(store, 0); + } + ret = TRUE; + break; + } + case IDCANCEL: + free_store_info(GetDlgItem(hwnd, IDC_STORE_LIST)); + EndDialog(hwnd, IDCANCEL); + ret = TRUE; + break; + } + break; + } + return ret; +} + +/*********************************************************************** + * CryptUIDlgSelectStoreW (CRYPTUI.@) + */ +HCERTSTORE WINAPI CryptUIDlgSelectStoreW(PCRYPTUI_SELECTSTORE_INFO_W info) +{ + struct SelectStoreInfo selectInfo = { info, NULL }; + + TRACE("(%p)\n", info); + + if (info->dwSize != sizeof(CRYPTUI_SELECTSTORE_INFO_W)) + { + WARN("unexpected size %d\n", info->dwSize); + SetLastError(E_INVALIDARG); + return NULL; + } + DialogBoxParamW(hInstance, MAKEINTRESOURCEW(IDD_SELECT_STORE), info->parent, + select_store_dlg_proc, (LPARAM)&selectInfo); + return selectInfo.store; +} + +/*********************************************************************** + * CryptUIDlgSelectStoreA (CRYPTUI.@) + */ +HCERTSTORE WINAPI CryptUIDlgSelectStoreA(PCRYPTUI_SELECTSTORE_INFO_A info) +{ + CRYPTUI_SELECTSTORE_INFO_W infoW; + HCERTSTORE ret; + int len; + + TRACE("(%p)\n", info); + + if (info->dwSize != sizeof(CRYPTUI_SELECTSTORE_INFO_A)) + { + WARN("unexpected size %d\n", info->dwSize); + SetLastError(E_INVALIDARG); + return NULL; + } + memcpy(&infoW, &info, sizeof(info)); + if (info->pszTitle) + { + len = MultiByteToWideChar(CP_ACP, 0, info->pszTitle, -1, NULL, 0); + infoW.pwszTitle = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); + MultiByteToWideChar(CP_ACP, 0, info->pszTitle, -1, infoW.pwszTitle, + len); + } + if (info->pszText) + { + len = MultiByteToWideChar(CP_ACP, 0, info->pszText, -1, NULL, 0); + infoW.pwszText = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); + MultiByteToWideChar(CP_ACP, 0, info->pszText, -1, infoW.pwszText, len); + } + ret = CryptUIDlgSelectStoreW(&infoW); + HeapFree(GetProcessHeap(), 0, infoW.pwszText); + HeapFree(GetProcessHeap(), 0, infoW.pwszTitle); + return ret; +} + /*********************************************************************** * CryptUIDlgViewCertificateA (CRYPTUI.@) */ @@ -309,8 +658,6 @@ static void add_oid_text_to_control(HWND hwnd, char *oid) } } -#define MAX_STRING_LEN 512 - struct OIDToString { LPCSTR oid; @@ -941,7 +1288,7 @@ static LRESULT CALLBACK general_dlg_proc(HWND hwnd, UINT msg, WPARAM wp, switch (wp) { case IDC_ADDTOSTORE: - FIXME("call CryptUIWizImport\n"); + CryptUIWizImport(0, hwnd, NULL, NULL, NULL); break; case IDC_ISSUERSTATEMENT: { @@ -2999,46 +3346,6 @@ BOOL WINAPI CryptUIDlgViewContext(DWORD dwContextType, LPVOID pvContext, return ret; } -static PCCERT_CONTEXT make_cert_from_file(LPCWSTR fileName) -{ - HANDLE file; - DWORD size, encoding = X509_ASN_ENCODING | PKCS_7_ASN_ENCODING; - BYTE *buffer; - PCCERT_CONTEXT cert; - - file = CreateFileW(fileName, GENERIC_READ, FILE_SHARE_READ, NULL, - OPEN_EXISTING, 0, NULL); - if (file == INVALID_HANDLE_VALUE) - { - WARN("can't open certificate file %s\n", debugstr_w(fileName)); - return NULL; - } - if ((size = GetFileSize(file, NULL))) - { - if ((buffer = HeapAlloc(GetProcessHeap(), 0, size))) - { - DWORD read; - if (!ReadFile(file, buffer, size, &read, NULL) || read != size) - { - WARN("can't read certificate file %s\n", debugstr_w(fileName)); - HeapFree(GetProcessHeap(), 0, buffer); - CloseHandle(file); - return NULL; - } - } - } - else - { - WARN("empty file %s\n", debugstr_w(fileName)); - CloseHandle(file); - return NULL; - } - CloseHandle(file); - cert = CertCreateCertificateContext(encoding, buffer, size); - HeapFree(GetProcessHeap(), 0, buffer); - return cert; -} - /* Decodes a cert's basic constraints extension (either szOID_BASIC_CONSTRAINTS * or szOID_BASIC_CONSTRAINTS2, whichever is present) to determine if it * should be a CA. If neither extension is present, returns @@ -3097,64 +3404,971 @@ static HCERTSTORE choose_store_for_cert(PCCERT_CONTEXT cert) CERT_SYSTEM_STORE_CURRENT_USER, storeName); } -BOOL WINAPI CryptUIWizImport(DWORD dwFlags, HWND hwndParent, LPCWSTR pwszWizardTitle, - PCCRYPTUI_WIZ_IMPORT_SRC_INFO pImportSrc, HCERTSTORE hDestCertStore) +static BOOL import_cert(PCCERT_CONTEXT cert, HCERTSTORE hDestCertStore) { - BOOL ret; HCERTSTORE store; - const CERT_CONTEXT *cert; - BOOL freeCert = FALSE; - - TRACE("(0x%08x, %p, %s, %p, %p)\n", dwFlags, hwndParent, debugstr_w(pwszWizardTitle), - pImportSrc, hDestCertStore); - - if (!(dwFlags & CRYPTUI_WIZ_NO_UI)) FIXME("UI not implemented\n"); + BOOL ret; - if (!pImportSrc || - pImportSrc->dwSize != sizeof(CRYPTUI_WIZ_IMPORT_SRC_INFO)) + if (!cert) { SetLastError(E_INVALIDARG); return FALSE; } - - switch (pImportSrc->dwSubjectChoice) + if (hDestCertStore) store = hDestCertStore; + else { - case CRYPTUI_WIZ_IMPORT_SUBJECT_FILE: - if (!(cert = make_cert_from_file(pImportSrc->u.pwszFileName))) + if (!(store = choose_store_for_cert(cert))) { - WARN("unable to create certificate context\n"); + WARN("unable to open certificate store\n"); return FALSE; } - else - freeCert = TRUE; - break; - case CRYPTUI_WIZ_IMPORT_SUBJECT_CERT_CONTEXT: - cert = pImportSrc->u.pCertContext; - if (!cert) + } + ret = CertAddCertificateContextToStore(store, cert, + CERT_STORE_ADD_REPLACE_EXISTING_INHERIT_PROPERTIES, NULL); + if (!hDestCertStore) CertCloseStore(store, 0); + return ret; +} + +static BOOL import_crl(PCCRL_CONTEXT crl, HCERTSTORE hDestCertStore) +{ + HCERTSTORE store; + BOOL ret; + + if (!crl) + { + SetLastError(E_INVALIDARG); + return FALSE; + } + if (hDestCertStore) store = hDestCertStore; + else + { + static const WCHAR ca[] = { 'C','A',0 }; + + if (!(store = CertOpenStore(CERT_STORE_PROV_SYSTEM_W, 0, 0, + CERT_SYSTEM_STORE_CURRENT_USER, ca))) { - SetLastError(E_INVALIDARG); + WARN("unable to open certificate store\n"); return FALSE; } - break; - default: - FIXME("source type not implemented: %u\n", pImportSrc->dwSubjectChoice); + } + ret = CertAddCRLContextToStore(store, crl, + CERT_STORE_ADD_REPLACE_EXISTING_INHERIT_PROPERTIES, NULL); + if (!hDestCertStore) CertCloseStore(store, 0); + return ret; +} + +static BOOL import_ctl(PCCTL_CONTEXT ctl, HCERTSTORE hDestCertStore) +{ + HCERTSTORE store; + BOOL ret; + + if (!ctl) + { SetLastError(E_INVALIDARG); return FALSE; } if (hDestCertStore) store = hDestCertStore; else { - if (!(store = choose_store_for_cert(cert))) + static const WCHAR trust[] = { 'T','r','u','s','t',0 }; + + if (!(store = CertOpenStore(CERT_STORE_PROV_SYSTEM_W, 0, 0, + CERT_SYSTEM_STORE_CURRENT_USER, trust))) { WARN("unable to open certificate store\n"); - CertFreeCertificateContext(cert); return FALSE; } } - ret = CertAddCertificateContextToStore(store, cert, CERT_STORE_ADD_REPLACE_EXISTING, NULL); - + ret = CertAddCTLContextToStore(store, ctl, + CERT_STORE_ADD_REPLACE_EXISTING_INHERIT_PROPERTIES, NULL); if (!hDestCertStore) CertCloseStore(store, 0); - if (freeCert) - CertFreeCertificateContext(cert); + return ret; +} + +/* Checks type, a type such as CERT_QUERY_CONTENT_CERT returned by + * CryptQueryObject, against the allowed types. Returns TRUE if the + * type is allowed, FALSE otherwise. + */ +static BOOL check_context_type(DWORD dwFlags, DWORD type) +{ + BOOL ret; + + if (dwFlags & + (CRYPTUI_WIZ_IMPORT_ALLOW_CERT | CRYPTUI_WIZ_IMPORT_ALLOW_CRL | + CRYPTUI_WIZ_IMPORT_ALLOW_CTL)) + { + switch (type) + { + case CERT_QUERY_CONTENT_CERT: + case CERT_QUERY_CONTENT_SERIALIZED_CERT: + ret = dwFlags & CRYPTUI_WIZ_IMPORT_ALLOW_CERT; + break; + case CERT_QUERY_CONTENT_CRL: + case CERT_QUERY_CONTENT_SERIALIZED_CRL: + ret = dwFlags & CRYPTUI_WIZ_IMPORT_ALLOW_CRL; + break; + case CERT_QUERY_CONTENT_CTL: + case CERT_QUERY_CONTENT_SERIALIZED_CTL: + ret = dwFlags & CRYPTUI_WIZ_IMPORT_ALLOW_CTL; + break; + default: + /* The remaining types contain more than one type, so allow + * any combination. + */ + ret = TRUE; + } + } + else + { + /* No allowed types specified, so any type is allowed */ + ret = TRUE; + } + if (!ret) + SetLastError(E_INVALIDARG); + return ret; +} + + +static void import_warning(DWORD dwFlags, HWND hwnd, LPCWSTR szTitle, + int warningID) +{ + if (!(dwFlags & CRYPTUI_WIZ_NO_UI)) + { + WCHAR title[MAX_STRING_LEN], error[MAX_STRING_LEN]; + LPCWSTR pTitle; + + if (szTitle) + pTitle = szTitle; + else + { + LoadStringW(hInstance, IDS_IMPORT_WIZARD, title, + sizeof(title) / sizeof(title[0])); + pTitle = title; + } + LoadStringW(hInstance, warningID, error, + sizeof(error) / sizeof(error[0])); + MessageBoxW(hwnd, error, pTitle, MB_ICONERROR | MB_OK); + } +} + +static void import_warn_type_mismatch(DWORD dwFlags, HWND hwnd, LPCWSTR szTitle) +{ + import_warning(dwFlags, hwnd, szTitle, IDS_IMPORT_TYPE_MISMATCH); +} + +static BOOL check_store_context_type(DWORD dwFlags, HCERTSTORE store) +{ + BOOL ret; + + if (dwFlags & + (CRYPTUI_WIZ_IMPORT_ALLOW_CERT | CRYPTUI_WIZ_IMPORT_ALLOW_CRL | + CRYPTUI_WIZ_IMPORT_ALLOW_CTL)) + { + PCCERT_CONTEXT cert; + PCCRL_CONTEXT crl; + PCCTL_CONTEXT ctl; + + ret = TRUE; + if ((cert = CertEnumCertificatesInStore(store, NULL))) + { + CertFreeCertificateContext(cert); + if (!(dwFlags & CRYPTUI_WIZ_IMPORT_ALLOW_CERT)) + ret = FALSE; + } + if (ret && (crl = CertEnumCRLsInStore(store, NULL))) + { + CertFreeCRLContext(crl); + if (!(dwFlags & CRYPTUI_WIZ_IMPORT_ALLOW_CRL)) + ret = FALSE; + } + if (ret && (ctl = CertEnumCTLsInStore(store, NULL))) + { + CertFreeCTLContext(ctl); + if (!(dwFlags & CRYPTUI_WIZ_IMPORT_ALLOW_CTL)) + ret = FALSE; + } + } + else + ret = TRUE; + if (!ret) + SetLastError(E_INVALIDARG); + return ret; +} + +static BOOL import_store(DWORD dwFlags, HWND hwnd, LPCWSTR szTitle, + HCERTSTORE source, HCERTSTORE dest) +{ + BOOL ret; + + if ((ret = check_store_context_type(dwFlags, source))) + { + PCCERT_CONTEXT cert = NULL; + PCCRL_CONTEXT crl = NULL; + PCCTL_CONTEXT ctl = NULL; + + do { + cert = CertEnumCertificatesInStore(source, cert); + if (cert) + ret = import_cert(cert, dest); + } while (ret && cert); + do { + crl = CertEnumCRLsInStore(source, crl); + if (crl) + ret = import_crl(crl, dest); + } while (ret && crl); + do { + ctl = CertEnumCTLsInStore(source, ctl); + if (ctl) + ret = import_ctl(ctl, dest); + } while (ret && ctl); + } + else + import_warn_type_mismatch(dwFlags, hwnd, szTitle); + return ret; +} + +static HCERTSTORE open_store_from_file(DWORD dwFlags, LPCWSTR fileName, + DWORD *pContentType) +{ + HCERTSTORE store = NULL; + DWORD contentType = 0, expectedContentTypeFlags; + + if (dwFlags & + (CRYPTUI_WIZ_IMPORT_ALLOW_CERT | CRYPTUI_WIZ_IMPORT_ALLOW_CRL | + CRYPTUI_WIZ_IMPORT_ALLOW_CTL)) + { + expectedContentTypeFlags = + CERT_QUERY_CONTENT_FLAG_SERIALIZED_STORE | + CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED | + CERT_QUERY_CONTENT_FLAG_PFX; + if (dwFlags & CRYPTUI_WIZ_IMPORT_ALLOW_CERT) + expectedContentTypeFlags |= + CERT_QUERY_CONTENT_FLAG_CERT | + CERT_QUERY_CONTENT_FLAG_SERIALIZED_CERT; + if (dwFlags & CRYPTUI_WIZ_IMPORT_ALLOW_CRL) + expectedContentTypeFlags |= + CERT_QUERY_CONTENT_FLAG_SERIALIZED_CRL | + CERT_QUERY_CONTENT_FLAG_CRL; + if (dwFlags & CRYPTUI_WIZ_IMPORT_ALLOW_CTL) + expectedContentTypeFlags |= + CERT_QUERY_CONTENT_FLAG_CTL | + CERT_QUERY_CONTENT_FLAG_SERIALIZED_CTL; + } + else + expectedContentTypeFlags = + CERT_QUERY_CONTENT_FLAG_CERT | + CERT_QUERY_CONTENT_FLAG_CTL | + CERT_QUERY_CONTENT_FLAG_CRL | + CERT_QUERY_CONTENT_FLAG_SERIALIZED_STORE | + CERT_QUERY_CONTENT_FLAG_SERIALIZED_CERT | + CERT_QUERY_CONTENT_FLAG_SERIALIZED_CTL | + CERT_QUERY_CONTENT_FLAG_SERIALIZED_CRL | + CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED | + CERT_QUERY_CONTENT_FLAG_PFX; + + CryptQueryObject(CERT_QUERY_OBJECT_FILE, fileName, + expectedContentTypeFlags, CERT_QUERY_FORMAT_FLAG_ALL, 0, NULL, + &contentType, NULL, &store, NULL, NULL); + if (pContentType) + *pContentType = contentType; + return store; +} + +static BOOL import_file(DWORD dwFlags, HWND hwnd, LPCWSTR szTitle, + LPCWSTR fileName, HCERTSTORE dest) +{ + HCERTSTORE source; + BOOL ret; + + if ((source = open_store_from_file(dwFlags, fileName, NULL))) + { + ret = import_store(dwFlags, hwnd, szTitle, source, dest); + CertCloseStore(source, 0); + } + else + ret = FALSE; + return ret; +} + +static LRESULT CALLBACK import_welcome_dlg_proc(HWND hwnd, UINT msg, WPARAM wp, + LPARAM lp) +{ + LRESULT ret = 0; + + switch (msg) + { + case WM_NOTIFY: + { + NMHDR *hdr = (NMHDR *)lp; + + switch (hdr->code) + { + case PSN_SETACTIVE: + PostMessageW(GetParent(hwnd), PSM_SETWIZBUTTONS, 0, PSWIZB_NEXT); + ret = TRUE; + break; + } + break; + } + } + return ret; +} + +static const WCHAR filter_cert[] = { '*','.','c','e','r',';','*','.', + 'c','r','t',0 }; +static const WCHAR filter_pfx[] = { '*','.','p','f','x',';','*','.', + 'p','1','2',0 }; +static const WCHAR filter_crl[] = { '*','.','c','r','l',0 }; +static const WCHAR filter_ctl[] = { '*','.','s','t','l',0 }; +static const WCHAR filter_serialized_store[] = { '*','.','s','s','t',0 }; +static const WCHAR filter_cms[] = { '*','.','s','p','c',';','*','.', + 'p','7','b',0 }; +static const WCHAR filter_all[] = { '*','.','*',0 }; + +struct StringToFilter +{ + int id; + DWORD allowFlags; + LPCWSTR filter; +} import_filters[] = { + { IDS_IMPORT_FILTER_CERT, CRYPTUI_WIZ_IMPORT_ALLOW_CERT, filter_cert }, + { IDS_IMPORT_FILTER_PFX, 0, filter_pfx }, + { IDS_IMPORT_FILTER_CRL, CRYPTUI_WIZ_IMPORT_ALLOW_CRL, filter_crl }, + { IDS_IMPORT_FILTER_CTL, CRYPTUI_WIZ_IMPORT_ALLOW_CTL, filter_ctl }, + { IDS_IMPORT_FILTER_SERIALIZED_STORE, 0, filter_serialized_store }, + { IDS_IMPORT_FILTER_CMS, 0, filter_cms }, + { IDS_IMPORT_FILTER_ALL, 0, filter_all }, +}; + +static WCHAR *make_import_file_filter(DWORD dwFlags) +{ + DWORD i; + int len, totalLen = 2; + LPWSTR filter = NULL, str; + + for (i = 0; i < sizeof(import_filters) / sizeof(import_filters[0]); i++) + { + if (!import_filters[i].allowFlags || !dwFlags || + (dwFlags & import_filters[i].allowFlags)) + { + len = LoadStringW(hInstance, import_filters[i].id, (LPWSTR)&str, 0); + totalLen += len + strlenW(import_filters[i].filter) + 2; + } + } + filter = HeapAlloc(GetProcessHeap(), 0, totalLen * sizeof(WCHAR)); + if (filter) + { + LPWSTR ptr; + + ptr = filter; + for (i = 0; i < sizeof(import_filters) / sizeof(import_filters[0]); i++) + { + if (!import_filters[i].allowFlags || !dwFlags || + (dwFlags & import_filters[i].allowFlags)) + { + len = LoadStringW(hInstance, import_filters[i].id, + (LPWSTR)&str, 0); + memcpy(ptr, str, len * sizeof(WCHAR)); + ptr += len; + *ptr++ = 0; + strcpyW(ptr, import_filters[i].filter); + ptr += strlenW(import_filters[i].filter) + 1; + } + } + *ptr++ = 0; + } + return filter; +} + +struct ImportWizData +{ + DWORD dwFlags; + LPCWSTR pwszWizardTitle; + CRYPTUI_WIZ_IMPORT_SRC_INFO importSrc; + LPWSTR fileName; + DWORD contentType; + BOOL freeSource; + HCERTSTORE hDestCertStore; + BOOL freeDest; + BOOL autoDest; + BOOL success; +}; + +static BOOL import_validate_filename(HWND hwnd, struct ImportWizData *data, + LPCWSTR fileName) +{ + HANDLE file; + BOOL ret = FALSE; + + file = CreateFileW(fileName, GENERIC_READ, FILE_SHARE_READ, NULL, + OPEN_EXISTING, 0, NULL); + if (file != INVALID_HANDLE_VALUE) + { + HCERTSTORE source = open_store_from_file(data->dwFlags, fileName, + &data->contentType); + int warningID = 0; + + if (!source) + warningID = IDS_IMPORT_BAD_FORMAT; + else if (!check_store_context_type(data->dwFlags, source)) + warningID = IDS_IMPORT_TYPE_MISMATCH; + else + { + data->importSrc.dwSubjectChoice = + CRYPTUI_WIZ_IMPORT_SUBJECT_CERT_STORE; + data->importSrc.u.hCertStore = source; + data->freeSource = TRUE; + ret = TRUE; + } + if (warningID) + { + import_warning(data->dwFlags, hwnd, data->pwszWizardTitle, + warningID); + } + CloseHandle(file); + } + else + { + WCHAR title[MAX_STRING_LEN], error[MAX_STRING_LEN]; + LPCWSTR pTitle; + LPWSTR msgBuf, fullError; + + if (data->pwszWizardTitle) + pTitle = data->pwszWizardTitle; + else + { + LoadStringW(hInstance, IDS_IMPORT_WIZARD, title, + sizeof(title) / sizeof(title[0])); + pTitle = title; + } + LoadStringW(hInstance, IDS_IMPORT_OPEN_FAILED, error, + sizeof(error) / sizeof(error[0])); + FormatMessageW( + FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, + GetLastError(), 0, (LPWSTR) &msgBuf, 0, NULL); + fullError = HeapAlloc(GetProcessHeap(), 0, + (strlenW(error) + strlenW(fileName) + strlenW(msgBuf) + 3) + * sizeof(WCHAR)); + if (fullError) + { + LPWSTR ptr = fullError; + + strcpyW(ptr, error); + ptr += strlenW(error); + strcpyW(ptr, fileName); + ptr += strlenW(fileName); + *ptr++ = ':'; + *ptr++ = '\n'; + strcpyW(ptr, msgBuf); + MessageBoxW(hwnd, fullError, pTitle, MB_ICONERROR | MB_OK); + HeapFree(GetProcessHeap(), 0, fullError); + } + LocalFree(msgBuf); + } + return ret; +} + +static LRESULT CALLBACK import_file_dlg_proc(HWND hwnd, UINT msg, WPARAM wp, + LPARAM lp) +{ + LRESULT ret = 0; + struct ImportWizData *data; + + switch (msg) + { + case WM_INITDIALOG: + { + PROPSHEETPAGEW *page = (PROPSHEETPAGEW *)lp; + + data = (struct ImportWizData *)page->lParam; + SetWindowLongPtrW(hwnd, DWLP_USER, (LPARAM)data); + break; + } + case WM_NOTIFY: + { + NMHDR *hdr = (NMHDR *)lp; + + switch (hdr->code) + { + case PSN_SETACTIVE: + PostMessageW(GetParent(hwnd), PSM_SETWIZBUTTONS, 0, + PSWIZB_BACK | PSWIZB_NEXT); + ret = TRUE; + break; + case PSN_WIZNEXT: + { + HWND fileNameEdit = GetDlgItem(hwnd, IDC_IMPORT_FILENAME); + DWORD len = SendMessageW(fileNameEdit, WM_GETTEXTLENGTH, 0, 0); + + data = (struct ImportWizData *)GetWindowLongPtrW(hwnd, DWLP_USER); + if (!len) + { + import_warning(data->dwFlags, hwnd, data->pwszWizardTitle, + IDS_IMPORT_EMPTY_FILE); + SetWindowLongPtrW(hwnd, DWLP_MSGRESULT, 1); + ret = 1; + } + else + { + LPWSTR fileName = HeapAlloc(GetProcessHeap(), 0, + (len + 1) * sizeof(WCHAR)); + + if (fileName) + { + SendMessageW(fileNameEdit, WM_GETTEXT, len + 1, + (LPARAM)fileName); + if (!import_validate_filename(hwnd, data, fileName)) + { + HeapFree(GetProcessHeap(), 0, fileName); + SetWindowLongPtrW(hwnd, DWLP_MSGRESULT, 1); + ret = 1; + } + else + data->fileName = fileName; + } + } + break; + } + } + break; + } + case WM_COMMAND: + switch (wp) + { + case IDC_IMPORT_BROWSE_FILE: + { + OPENFILENAMEW ofn; + WCHAR fileBuf[MAX_PATH]; + + data = (struct ImportWizData *)GetWindowLongPtrW(hwnd, DWLP_USER); + memset(&ofn, 0, sizeof(ofn)); + ofn.lStructSize = sizeof(ofn); + ofn.hwndOwner = hwnd; + ofn.lpstrFilter = make_import_file_filter(data->dwFlags); + ofn.lpstrFile = fileBuf; + ofn.nMaxFile = sizeof(fileBuf) / sizeof(fileBuf[0]); + fileBuf[0] = 0; + if (GetOpenFileNameW(&ofn)) + SendMessageW(GetDlgItem(hwnd, IDC_IMPORT_FILENAME), WM_SETTEXT, + 0, (LPARAM)ofn.lpstrFile); + HeapFree(GetProcessHeap(), 0, (LPWSTR)ofn.lpstrFilter); + break; + } + } + break; + } + return ret; +} + +static LRESULT CALLBACK import_store_dlg_proc(HWND hwnd, UINT msg, WPARAM wp, + LPARAM lp) +{ + LRESULT ret = 0; + struct ImportWizData *data; + + switch (msg) + { + case WM_INITDIALOG: + { + PROPSHEETPAGEW *page = (PROPSHEETPAGEW *)lp; + + data = (struct ImportWizData *)page->lParam; + SetWindowLongPtrW(hwnd, DWLP_USER, (LPARAM)data); + SendMessageW(GetDlgItem(hwnd, IDC_IMPORT_AUTO_STORE), BM_CLICK, 0, 0); + if (data->dwFlags & CRYPTUI_WIZ_IMPORT_NO_CHANGE_DEST_STORE) + EnableWindow(GetDlgItem(hwnd, IDC_IMPORT_SPECIFY_STORE), FALSE); + EnableWindow(GetDlgItem(hwnd, IDC_IMPORT_STORE), FALSE); + EnableWindow(GetDlgItem(hwnd, IDC_IMPORT_BROWSE_STORE), FALSE); + break; + } + case WM_NOTIFY: + { + NMHDR *hdr = (NMHDR *)lp; + + switch (hdr->code) + { + case PSN_SETACTIVE: + PostMessageW(GetParent(hwnd), PSM_SETWIZBUTTONS, 0, + PSWIZB_BACK | PSWIZB_NEXT); + ret = TRUE; + break; + case PSN_WIZNEXT: + { + data = (struct ImportWizData *)GetWindowLongPtrW(hwnd, DWLP_USER); + if (IsDlgButtonChecked(hwnd, IDC_IMPORT_SPECIFY_STORE) && + !data->hDestCertStore) + { + import_warning(data->dwFlags, hwnd, data->pwszWizardTitle, + IDS_IMPORT_SELECT_STORE); + SetWindowLongPtrW(hwnd, DWLP_MSGRESULT, 1); + ret = 1; + } + break; + } + } + break; + } + case WM_COMMAND: + switch (wp) + { + case IDC_IMPORT_AUTO_STORE: + data = (struct ImportWizData *)GetWindowLongPtrW(hwnd, DWLP_USER); + data->autoDest = TRUE; + EnableWindow(GetDlgItem(hwnd, IDC_IMPORT_STORE), FALSE); + EnableWindow(GetDlgItem(hwnd, IDC_IMPORT_BROWSE_STORE), FALSE); + break; + case IDC_IMPORT_SPECIFY_STORE: + data = (struct ImportWizData *)GetWindowLongPtrW(hwnd, DWLP_USER); + data->autoDest = FALSE; + EnableWindow(GetDlgItem(hwnd, IDC_IMPORT_STORE), TRUE); + EnableWindow(GetDlgItem(hwnd, IDC_IMPORT_BROWSE_STORE), TRUE); + break; + case IDC_IMPORT_BROWSE_STORE: + { + CRYPTUI_ENUM_SYSTEM_STORE_ARGS enumArgs = { + CERT_SYSTEM_STORE_CURRENT_USER, NULL }; + CRYPTUI_ENUM_DATA enumData = { 0, NULL, 1, &enumArgs }; + CRYPTUI_SELECTSTORE_INFO_W selectInfo; + HCERTSTORE store; + + data = (struct ImportWizData *)GetWindowLongPtrW(hwnd, DWLP_USER); + selectInfo.dwSize = sizeof(selectInfo); + selectInfo.parent = hwnd; + selectInfo.dwFlags = CRYPTUI_ENABLE_SHOW_PHYSICAL_STORE; + selectInfo.pwszTitle = selectInfo.pwszTitle = NULL; + selectInfo.pEnumData = &enumData; + selectInfo.pfnSelectedStoreCallback = NULL; + if ((store = CryptUIDlgSelectStoreW(&selectInfo))) + { + WCHAR storeTitle[MAX_STRING_LEN]; + + LoadStringW(hInstance, IDS_IMPORT_DEST_DETERMINED, + storeTitle, sizeof(storeTitle) / sizeof(storeTitle[0])); + SendMessageW(GetDlgItem(hwnd, IDC_IMPORT_STORE), WM_SETTEXT, + 0, (LPARAM)storeTitle); + data->hDestCertStore = store; + data->freeDest = TRUE; + } + break; + } + } + break; + } + return ret; +} + +static void show_import_details(HWND lv, struct ImportWizData *data) +{ + WCHAR text[MAX_STRING_LEN]; + LVITEMW item; + int contentID; + + item.mask = LVIF_TEXT; + item.iItem = SendMessageW(lv, LVM_GETITEMCOUNT, 0, 0); + item.iSubItem = 0; + LoadStringW(hInstance, IDS_IMPORT_STORE_SELECTION, text, + sizeof(text)/ sizeof(text[0])); + item.pszText = text; + SendMessageW(lv, LVM_INSERTITEMW, 0, (LPARAM)&item); + item.iSubItem = 1; + if (data->autoDest) + LoadStringW(hInstance, IDS_IMPORT_DEST_AUTOMATIC, text, + sizeof(text)/ sizeof(text[0])); + else + LoadStringW(hInstance, IDS_IMPORT_DEST_DETERMINED, text, + sizeof(text)/ sizeof(text[0])); + SendMessageW(lv, LVM_SETITEMTEXTW, item.iItem, (LPARAM)&item); + item.iItem = SendMessageW(lv, LVM_GETITEMCOUNT, 0, 0); + item.iSubItem = 0; + LoadStringW(hInstance, IDS_IMPORT_CONTENT, text, + sizeof(text)/ sizeof(text[0])); + SendMessageW(lv, LVM_INSERTITEMW, 0, (LPARAM)&item); + switch (data->contentType) + { + case CERT_QUERY_CONTENT_CERT: + case CERT_QUERY_CONTENT_SERIALIZED_CERT: + contentID = IDS_IMPORT_CONTENT_CERT; + break; + case CERT_QUERY_CONTENT_CRL: + case CERT_QUERY_CONTENT_SERIALIZED_CRL: + contentID = IDS_IMPORT_CONTENT_CRL; + break; + case CERT_QUERY_CONTENT_CTL: + case CERT_QUERY_CONTENT_SERIALIZED_CTL: + contentID = IDS_IMPORT_CONTENT_CTL; + break; + case CERT_QUERY_CONTENT_PKCS7_SIGNED: + contentID = IDS_IMPORT_CONTENT_CMS; + break; + case CERT_QUERY_CONTENT_FLAG_PFX: + contentID = IDS_IMPORT_CONTENT_PFX; + break; + default: + contentID = IDS_IMPORT_CONTENT_STORE; + break; + } + LoadStringW(hInstance, contentID, text, sizeof(text)/ sizeof(text[0])); + item.iSubItem = 1; + SendMessageW(lv, LVM_SETITEMTEXTW, item.iItem, (LPARAM)&item); + if (data->fileName) + { + item.iItem = SendMessageW(lv, LVM_GETITEMCOUNT, 0, 0); + item.iSubItem = 0; + LoadStringW(hInstance, IDS_IMPORT_FILE, text, + sizeof(text)/ sizeof(text[0])); + SendMessageW(lv, LVM_INSERTITEMW, 0, (LPARAM)&item); + item.iSubItem = 1; + item.pszText = data->fileName; + SendMessageW(lv, LVM_SETITEMTEXTW, item.iItem, (LPARAM)&item); + } +} + +static BOOL do_import(DWORD dwFlags, HWND hwndParent, LPCWSTR pwszWizardTitle, + PCCRYPTUI_WIZ_IMPORT_SRC_INFO pImportSrc, HCERTSTORE hDestCertStore) +{ + BOOL ret; + + switch (pImportSrc->dwSubjectChoice) + { + case CRYPTUI_WIZ_IMPORT_SUBJECT_FILE: + ret = import_file(dwFlags, hwndParent, pwszWizardTitle, + pImportSrc->u.pwszFileName, hDestCertStore); + break; + case CRYPTUI_WIZ_IMPORT_SUBJECT_CERT_CONTEXT: + if ((ret = check_context_type(dwFlags, CERT_QUERY_CONTENT_CERT))) + ret = import_cert(pImportSrc->u.pCertContext, hDestCertStore); + else + import_warn_type_mismatch(dwFlags, hwndParent, pwszWizardTitle); + break; + case CRYPTUI_WIZ_IMPORT_SUBJECT_CRL_CONTEXT: + if ((ret = check_context_type(dwFlags, CERT_QUERY_CONTENT_CRL))) + ret = import_crl(pImportSrc->u.pCRLContext, hDestCertStore); + else + import_warn_type_mismatch(dwFlags, hwndParent, pwszWizardTitle); + break; + case CRYPTUI_WIZ_IMPORT_SUBJECT_CTL_CONTEXT: + if ((ret = check_context_type(dwFlags, CERT_QUERY_CONTENT_CTL))) + ret = import_ctl(pImportSrc->u.pCTLContext, hDestCertStore); + else + import_warn_type_mismatch(dwFlags, hwndParent, pwszWizardTitle); + break; + case CRYPTUI_WIZ_IMPORT_SUBJECT_CERT_STORE: + ret = import_store(dwFlags, hwndParent, pwszWizardTitle, + pImportSrc->u.hCertStore, hDestCertStore); + break; + default: + WARN("unknown source type: %u\n", pImportSrc->dwSubjectChoice); + SetLastError(E_INVALIDARG); + ret = FALSE; + } + return ret; +} + +static LRESULT CALLBACK import_finish_dlg_proc(HWND hwnd, UINT msg, WPARAM wp, + LPARAM lp) +{ + LRESULT ret = 0; + struct ImportWizData *data; + + switch (msg) + { + case WM_INITDIALOG: + { + PROPSHEETPAGEW *page = (PROPSHEETPAGEW *)lp; + HWND lv = GetDlgItem(hwnd, IDC_IMPORT_SETTINGS); + RECT rc; + LVCOLUMNW column; + + data = (struct ImportWizData *)page->lParam; + SetWindowLongPtrW(hwnd, DWLP_USER, (LPARAM)data); + GetWindowRect(lv, &rc); + column.mask = LVCF_WIDTH; + column.cx = (rc.right - rc.left) / 2 - 2; + SendMessageW(lv, LVM_INSERTCOLUMNW, 0, (LPARAM)&column); + SendMessageW(lv, LVM_INSERTCOLUMNW, 1, (LPARAM)&column); + show_import_details(lv, data); + break; + } + case WM_NOTIFY: + { + NMHDR *hdr = (NMHDR *)lp; + + switch (hdr->code) + { + case PSN_SETACTIVE: + { + HWND lv = GetDlgItem(hwnd, IDC_IMPORT_SETTINGS); + + data = (struct ImportWizData *)GetWindowLongPtrW(hwnd, DWLP_USER); + SendMessageW(lv, LVM_DELETEALLITEMS, 0, 0); + show_import_details(lv, data); + PostMessageW(GetParent(hwnd), PSM_SETWIZBUTTONS, 0, + PSWIZB_BACK | PSWIZB_FINISH); + ret = TRUE; + break; + } + case PSN_WIZFINISH: + { + data = (struct ImportWizData *)GetWindowLongPtrW(hwnd, DWLP_USER); + if ((data->success = do_import(data->dwFlags, hwnd, + data->pwszWizardTitle, &data->importSrc, data->hDestCertStore))) + { + WCHAR title[MAX_STRING_LEN], message[MAX_STRING_LEN]; + LPCWSTR pTitle; + + if (data->pwszWizardTitle) + pTitle = data->pwszWizardTitle; + else + { + LoadStringW(hInstance, IDS_IMPORT_WIZARD, title, + sizeof(title) / sizeof(title[0])); + pTitle = title; + } + LoadStringW(hInstance, IDS_IMPORT_SUCCEEDED, message, + sizeof(message) / sizeof(message[0])); + MessageBoxW(hwnd, message, pTitle, MB_OK); + } + else + import_warning(data->dwFlags, hwnd, data->pwszWizardTitle, + IDS_IMPORT_SUCCEEDED); + break; + } + } + break; + } + } + return ret; +} + +static BOOL show_import_ui(DWORD dwFlags, HWND hwndParent, + LPCWSTR pwszWizardTitle, PCCRYPTUI_WIZ_IMPORT_SRC_INFO pImportSrc, + HCERTSTORE hDestCertStore) +{ + PROPSHEETHEADERW hdr; + PROPSHEETPAGEW pages[4]; + struct ImportWizData data; + int nPages = 0; + + data.dwFlags = dwFlags; + data.pwszWizardTitle = pwszWizardTitle; + if (pImportSrc) + memcpy(&data.importSrc, pImportSrc, sizeof(data.importSrc)); + else + memset(&data.importSrc, 0, sizeof(data.importSrc)); + data.fileName = NULL; + data.freeSource = FALSE; + data.hDestCertStore = hDestCertStore; + data.freeDest = FALSE; + data.autoDest = TRUE; + data.success = TRUE; + + memset(&pages, 0, sizeof(pages)); + + pages[nPages].dwSize = sizeof(pages[0]); + pages[nPages].hInstance = hInstance; + pages[nPages].u.pszTemplate = MAKEINTRESOURCEW(IDD_IMPORT_WELCOME); + pages[nPages].pfnDlgProc = import_welcome_dlg_proc; + pages[nPages].dwFlags = PSP_HIDEHEADER; + nPages++; + + if (!pImportSrc || + pImportSrc->dwSubjectChoice == CRYPTUI_WIZ_IMPORT_SUBJECT_FILE) + { + pages[nPages].dwSize = sizeof(pages[0]); + pages[nPages].hInstance = hInstance; + pages[nPages].u.pszTemplate = MAKEINTRESOURCEW(IDD_IMPORT_FILE); + pages[nPages].pfnDlgProc = import_file_dlg_proc; + pages[nPages].dwFlags = PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE; + pages[nPages].pszHeaderTitle = MAKEINTRESOURCEW(IDS_IMPORT_FILE_TITLE); + pages[nPages].pszHeaderSubTitle = + MAKEINTRESOURCEW(IDS_IMPORT_FILE_SUBTITLE); + pages[nPages].lParam = (LPARAM)&data; + nPages++; + } + else + { + switch (pImportSrc->dwSubjectChoice) + { + case CRYPTUI_WIZ_IMPORT_SUBJECT_CERT_CONTEXT: + data.contentType = CERT_QUERY_CONTENT_CERT; + break; + case CRYPTUI_WIZ_IMPORT_SUBJECT_CRL_CONTEXT: + data.contentType = CERT_QUERY_CONTENT_CRL; + break; + case CRYPTUI_WIZ_IMPORT_SUBJECT_CTL_CONTEXT: + data.contentType = CERT_QUERY_CONTENT_CTL; + break; + case CRYPTUI_WIZ_IMPORT_SUBJECT_CERT_STORE: + data.contentType = CERT_QUERY_CONTENT_SERIALIZED_STORE; + break; + } + } + + pages[nPages].dwSize = sizeof(pages[0]); + pages[nPages].hInstance = hInstance; + pages[nPages].u.pszTemplate = MAKEINTRESOURCEW(IDD_IMPORT_STORE); + pages[nPages].pfnDlgProc = import_store_dlg_proc; + pages[nPages].dwFlags = PSP_USEHEADERTITLE | PSP_USEHEADERSUBTITLE; + pages[nPages].pszHeaderTitle = MAKEINTRESOURCEW(IDS_IMPORT_STORE_TITLE); + pages[nPages].pszHeaderSubTitle = + MAKEINTRESOURCEW(IDS_IMPORT_STORE_SUBTITLE); + pages[nPages].lParam = (LPARAM)&data; + nPages++; + + pages[nPages].dwSize = sizeof(pages[0]); + pages[nPages].hInstance = hInstance; + pages[nPages].u.pszTemplate = MAKEINTRESOURCEW(IDD_IMPORT_FINISH); + pages[nPages].pfnDlgProc = import_finish_dlg_proc; + pages[nPages].dwFlags = PSP_HIDEHEADER; + pages[nPages].lParam = (LPARAM)&data; + nPages++; + + memset(&hdr, 0, sizeof(hdr)); + hdr.dwSize = sizeof(hdr); + hdr.hwndParent = hwndParent; + hdr.dwFlags = PSH_PROPSHEETPAGE | PSH_WIZARD97_OLD | PSH_HEADER; + hdr.hInstance = hInstance; + if (pwszWizardTitle) + hdr.pszCaption = pwszWizardTitle; + else + hdr.pszCaption = MAKEINTRESOURCEW(IDS_IMPORT_WIZARD); + hdr.u3.ppsp = pages; + hdr.nPages = nPages; + PropertySheetW(&hdr); + HeapFree(GetProcessHeap(), 0, data.fileName); + if (data.freeSource && + data.importSrc.dwSubjectChoice == CRYPTUI_WIZ_IMPORT_SUBJECT_CERT_STORE) + CertCloseStore(data.importSrc.u.hCertStore, 0); + return data.success; +} + +BOOL WINAPI CryptUIWizImport(DWORD dwFlags, HWND hwndParent, LPCWSTR pwszWizardTitle, + PCCRYPTUI_WIZ_IMPORT_SRC_INFO pImportSrc, HCERTSTORE hDestCertStore) +{ + BOOL ret; + + TRACE("(0x%08x, %p, %s, %p, %p)\n", dwFlags, hwndParent, debugstr_w(pwszWizardTitle), + pImportSrc, hDestCertStore); + + if (pImportSrc && + pImportSrc->dwSize != sizeof(CRYPTUI_WIZ_IMPORT_SRC_INFO)) + { + SetLastError(E_INVALIDARG); + return FALSE; + } + + if (!(dwFlags & CRYPTUI_WIZ_NO_UI)) + ret = show_import_ui(dwFlags, hwndParent, pwszWizardTitle, pImportSrc, + hDestCertStore); + else if (pImportSrc) + ret = do_import(dwFlags, hwndParent, pwszWizardTitle, pImportSrc, + hDestCertStore); + else + { + /* Can't have no UI without specifying source */ + SetLastError(E_INVALIDARG); + ret = FALSE; + } + return ret; } diff --git a/dlls/cryptui/tests/cryptui.c b/dlls/cryptui/tests/cryptui.c index 6665c0cd333..2cac5211fc9 100644 --- a/dlls/cryptui/tests/cryptui.c +++ b/dlls/cryptui/tests/cryptui.c @@ -283,6 +283,12 @@ static const BYTE iTunesCert3[] = { 0xd3,0x9c,0x6e,0xc1,0x9c,0xac,0x74,0x3d,0x77,0x06,0x5e,0x28,0x28,0x5c,0xf5, 0xe0,0x9c,0x19,0xd8,0xba,0x74,0x81,0x2d,0x67,0x77,0x93,0x8d,0xbf,0xd2,0x52, 0x00,0xe6,0xa5,0x38,0x4e,0x2e,0x73,0x66,0x7a }; +static const BYTE signedCRL[] = { 0x30, 0x45, 0x30, 0x2c, 0x30, 0x02, 0x06, + 0x00, 0x30, 0x15, 0x31, 0x13, 0x30, 0x11, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, + 0x0a, 0x4a, 0x75, 0x61, 0x6e, 0x20, 0x4c, 0x61, 0x6e, 0x67, 0x00, 0x18, 0x0f, + 0x31, 0x36, 0x30, 0x31, 0x30, 0x31, 0x30, 0x31, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x5a, 0x30, 0x02, 0x06, 0x00, 0x03, 0x11, 0x00, 0x0f, 0x0e, 0x0d, 0x0c, + 0x0b, 0x0a, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00 }; /* CBT hook to ensure a window (e.g., MessageBox) cannot be created */ static HHOOK hook; @@ -321,6 +327,9 @@ static void test_crypt_ui_wiz_import(void) BOOL ret; CRYPTUI_WIZ_IMPORT_SRC_INFO info; HCERTSTORE store; + PCCERT_CONTEXT cert; + PCCRL_CONTEXT crl; + DWORD count; if (!pCryptUIWizImport) { @@ -362,9 +371,28 @@ static void test_crypt_ui_wiz_import(void) 0, NULL, &info, NULL); ok(!ret && GetLastError() == E_INVALIDARG, "expected E_INVALIDARG, got %08x\n", GetLastError()); + /* Check allowed vs. given type mismatches */ + info.u.pCertContext = CertCreateCertificateContext(X509_ASN_ENCODING, + v1CertWithValidPubKey, sizeof(v1CertWithValidPubKey)); + SetLastError(0xdeadbeef); + ret = pCryptUIWizImport(CRYPTUI_WIZ_NO_UI | CRYPTUI_WIZ_IMPORT_ALLOW_CRL, + 0, NULL, &info, NULL); + ok(!ret && GetLastError() == E_INVALIDARG, + "expected E_INVALIDARG, got %08x\n", GetLastError()); + CertFreeCertificateContext(info.u.pCertContext); + info.dwSubjectChoice = CRYPTUI_WIZ_IMPORT_SUBJECT_CRL_CONTEXT; + info.u.pCRLContext = CertCreateCRLContext(X509_ASN_ENCODING, + signedCRL, sizeof(signedCRL)); + SetLastError(0xdeadbeef); + ret = pCryptUIWizImport(CRYPTUI_WIZ_NO_UI | CRYPTUI_WIZ_IMPORT_ALLOW_CERT, + 0, NULL, &info, NULL); + ok(!ret && GetLastError() == E_INVALIDARG, + "expected E_INVALIDARG, got %08x\n", GetLastError()); + CertFreeCRLContext(info.u.pCRLContext); /* Imports the following cert--self-signed, with no basic constraints set-- * to the CA store. Puts up a dialog at the end if it succeeds or fails. */ + info.dwSubjectChoice = CRYPTUI_WIZ_IMPORT_SUBJECT_CERT_CONTEXT; info.u.pCertContext = CertCreateCertificateContext(X509_ASN_ENCODING, v1CertWithValidPubKey, sizeof(v1CertWithValidPubKey)); ret = pCryptUIWizImport(CRYPTUI_WIZ_NO_UI, 0, NULL, &info, NULL); @@ -481,6 +509,138 @@ static void test_crypt_ui_wiz_import(void) } CertFreeCertificateContext(info.u.pCertContext); + info.u.hCertStore = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0, + CERT_STORE_CREATE_NEW_FLAG, NULL); + CertAddEncodedCertificateToStore(info.u.hCertStore, X509_ASN_ENCODING, + v1CertWithValidPubKey, sizeof(v1CertWithValidPubKey), + CERT_STORE_ADD_ALWAYS, NULL); + CertAddEncodedCRLToStore(info.u.hCertStore, X509_ASN_ENCODING, signedCRL, + sizeof(signedCRL), CERT_STORE_ADD_ALWAYS, NULL); + info.dwSubjectChoice = CRYPTUI_WIZ_IMPORT_SUBJECT_CERT_STORE; + /* The ALLOW flags aren't allowed with a store as the source if the source + * contains types other than those allowed. + */ + store = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0, + CERT_STORE_CREATE_NEW_FLAG, NULL); + SetLastError(0xdeadbeef); + ret = CryptUIWizImport(CRYPTUI_WIZ_NO_UI | CRYPTUI_WIZ_IMPORT_ALLOW_CERT, + 0, NULL, &info, store); + ok(!ret && GetLastError() == E_INVALIDARG, + "expected E_INVALIDARG, got %08x\n", GetLastError()); + SetLastError(0xdeadbeef); + ret = CryptUIWizImport(CRYPTUI_WIZ_NO_UI | CRYPTUI_WIZ_IMPORT_ALLOW_CRL, + 0, NULL, &info, store); + ok(!ret && GetLastError() == E_INVALIDARG, + "expected E_INVALIDARG, got %08x\n", GetLastError()); + SetLastError(0xdeadbeef); + ret = CryptUIWizImport(CRYPTUI_WIZ_NO_UI | + CRYPTUI_WIZ_IMPORT_NO_CHANGE_DEST_STORE | + CRYPTUI_WIZ_IMPORT_ALLOW_CERT | CRYPTUI_WIZ_IMPORT_ALLOW_CRL, 0, NULL, + &info, store); + ok(ret, "CryptUIWizImport failed: %08x\n", GetLastError()); + if (ret) + { + count = 0; + cert = NULL; + do { + cert = CertEnumCertificatesInStore(store, cert); + if (cert) + count++; + } while (cert); + ok(count == 1, "expected 1 cert, got %d\n", count); + count = 0; + crl = NULL; + do { + crl = CertEnumCRLsInStore(store, crl); + if (crl) + count++; + } while (cert); + ok(count == 1, "expected 1 CRL, got %d\n", count); + } + CertCloseStore(store, 0); + CertCloseStore(info.u.hCertStore, 0); + + /* If the ALLOW flags match the content of the store, the store can be + * imported. + */ + info.u.hCertStore = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0, + CERT_STORE_CREATE_NEW_FLAG, NULL); + CertAddEncodedCertificateToStore(info.u.hCertStore, X509_ASN_ENCODING, + v1CertWithValidPubKey, sizeof(v1CertWithValidPubKey), + CERT_STORE_ADD_ALWAYS, NULL); + store = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0, + CERT_STORE_CREATE_NEW_FLAG, NULL); + SetLastError(0xdeadbeef); + ret = CryptUIWizImport(CRYPTUI_WIZ_NO_UI | CRYPTUI_WIZ_IMPORT_ALLOW_CERT, + 0, NULL, &info, store); + ok(ret, "CryptUIWizImport failed: %08x\n", GetLastError()); + if (ret) + { + count = 0; + cert = NULL; + do { + cert = CertEnumCertificatesInStore(store, cert); + if (cert) + count++; + } while (cert); + ok(count == 1, "expected 1 cert, got %d\n", count); + count = 0; + crl = NULL; + do { + crl = CertEnumCRLsInStore(store, crl); + if (crl) + count++; + } while (cert); + ok(count == 0, "expected 0 CRLs, got %d\n", count); + } + SetLastError(0xdeadbeef); + ret = CryptUIWizImport(CRYPTUI_WIZ_NO_UI | CRYPTUI_WIZ_IMPORT_ALLOW_CRL, + 0, NULL, &info, store); + ok(!ret && GetLastError() == E_INVALIDARG, + "expected E_INVALIDARG, got %08x\n", GetLastError()); + CertCloseStore(store, 0); + CertCloseStore(info.u.hCertStore, 0); + + /* Again, if the ALLOW flags match the content of the store, the store can + * be imported. + */ + info.u.hCertStore = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0, + CERT_STORE_CREATE_NEW_FLAG, NULL); + CertAddEncodedCRLToStore(info.u.hCertStore, X509_ASN_ENCODING, signedCRL, + sizeof(signedCRL), CERT_STORE_ADD_ALWAYS, NULL); + store = CertOpenStore(CERT_STORE_PROV_MEMORY, 0, 0, + CERT_STORE_CREATE_NEW_FLAG, NULL); + SetLastError(0xdeadbeef); + ret = CryptUIWizImport(CRYPTUI_WIZ_NO_UI | CRYPTUI_WIZ_IMPORT_ALLOW_CRL, + 0, NULL, &info, store); + ok(ret, "CryptUIWizImport failed: %08x\n", GetLastError()); + if (ret) + { + count = 0; + cert = NULL; + do { + cert = CertEnumCertificatesInStore(store, cert); + if (cert) + count++; + } while (cert); + ok(count == 0, "expected 0 certs, got %d\n", count); + count = 0; + crl = NULL; + do { + crl = CertEnumCRLsInStore(store, crl); + if (crl) + count++; + } while (cert); + ok(count == 1, "expected 1 CRL, got %d\n", count); + } + SetLastError(0xdeadbeef); + ret = CryptUIWizImport(CRYPTUI_WIZ_NO_UI | CRYPTUI_WIZ_IMPORT_ALLOW_CERT, + 0, NULL, &info, store); + ok(!ret && GetLastError() == E_INVALIDARG, + "expected E_INVALIDARG, got %08x\n", GetLastError()); + CertCloseStore(store, 0); + CertCloseStore(info.u.hCertStore, 0); + UnhookWindowsHookEx(hook); } diff --git a/dlls/d3d9/tests/shader.c b/dlls/d3d9/tests/shader.c index 522f1280f2e..3d808837606 100644 --- a/dlls/d3d9/tests/shader.c +++ b/dlls/d3d9/tests/shader.c @@ -91,10 +91,6 @@ static void test_get_set_vertex_shader(IDirect3DDevice9 *device_ptr) int shader_refcount = 0; int i = 0; - hret = IDirect3DDevice9_CreateVertexShader(device_ptr, NULL, &shader_ptr); - ok(hret == D3DERR_INVALIDCALL, "CreateVertexShader returned %#x, expected D3DERR_INVALIDCALL (%#x).\n", - hret, D3DERR_INVALIDCALL); - hret = IDirect3DDevice9_CreateVertexShader(device_ptr, simple_vs, &shader_ptr); ok(hret == D3D_OK && shader_ptr != NULL, "CreateVertexShader returned: hret 0x%x, shader_ptr %p. " "Expected hret 0x%x, shader_ptr != %p. Aborting.\n", hret, shader_ptr, D3D_OK, NULL); @@ -159,10 +155,6 @@ static void test_get_set_pixel_shader(IDirect3DDevice9 *device_ptr) int shader_refcount = 0; int i = 0; - hret = IDirect3DDevice9_CreatePixelShader(device_ptr, NULL, &shader_ptr); - ok(hret == D3DERR_INVALIDCALL, "CreatePixelShader returned %#x, expected D3DERR_INVALIDCALL (%#x).\n", - hret, D3DERR_INVALIDCALL); - hret = IDirect3DDevice9_CreatePixelShader(device_ptr, simple_ps, &shader_ptr); ok(hret == D3D_OK && shader_ptr != NULL, "CreatePixelShader returned: hret 0x%x, shader_ptr %p. " "Expected hret 0x%x, shader_ptr != %p. Aborting.\n", hret, shader_ptr, D3D_OK, NULL); diff --git a/dlls/d3d9/vertexshader.c b/dlls/d3d9/vertexshader.c index 66ce2862f92..61722255004 100644 --- a/dlls/d3d9/vertexshader.c +++ b/dlls/d3d9/vertexshader.c @@ -170,6 +170,7 @@ HRESULT WINAPI IDirect3DDevice9Impl_GetVertexShader(LPDIRECT3DDEVICE9EX iface, I hrc = IWineD3DVertexShader_GetParent(pShader, (IUnknown **)ppShader); IWineD3DVertexShader_Release(pShader); } else { + *ppShader = NULL; WARN("(%p) : Call to IWineD3DDevice_GetVertexShader failed %u (device %p)\n", This, hrc, This->WineD3DDevice); } LeaveCriticalSection(&d3d9_cs); diff --git a/dlls/d3dxof/d3dxof.c b/dlls/d3dxof/d3dxof.c index d7892d4e61f..46f3db95a5b 100644 --- a/dlls/d3dxof/d3dxof.c +++ b/dlls/d3dxof/d3dxof.c @@ -1538,7 +1538,14 @@ static ULONG WINAPI IDirectXFileDataImpl_Release(IDirectXFileData* iface) TRACE("(%p/%p): ReleaseRef to %d\n", iface, This, ref); if (!ref) + { + if (!This->level) + { + HeapFree(GetProcessHeap(), 0, This->pdata); + HeapFree(GetProcessHeap(), 0, This->pstrings); + } HeapFree(GetProcessHeap(), 0, This); + } return ref; } @@ -1902,7 +1909,13 @@ static ULONG WINAPI IDirectXFileEnumObjectImpl_Release(IDirectXFileEnumObject* i if (!ref) { - CloseHandle(This->hFile); + int i; + for (i = 0; i < This->nb_xobjects; i++) + IDirectXFileData_Release(This->pRefObjects[i]); + if (This->source == DXFILELOAD_FROMFILE) + HeapFree(GetProcessHeap(), 0, This->buf.buffer); + if (This->hFile != INVALID_HANDLE_VALUE) + CloseHandle(This->hFile); HeapFree(GetProcessHeap(), 0, This); } @@ -2109,9 +2122,9 @@ static BOOL parse_object_parts(parse_buffer * buf, BOOL allow_optional) TRACE("Found optional reference %s\n", (char*)buf->value); for (i = 0; i < buf->nb_pxo_globals; i++) { - for (j = 0; j < buf->pxo_globals[i*MAX_SUBOBJECTS].nb_subobjects; j++) + for (j = 0; j < (buf->pxo_globals[i])[0].nb_subobjects; j++) { - if (!strcmp(buf->pxo_globals[i*MAX_SUBOBJECTS+j].name, (char*)buf->value)) + if (!strcmp((buf->pxo_globals[i])[j].name, (char*)buf->value)) goto _exit; } } @@ -2122,7 +2135,7 @@ _exit: return FALSE; } buf->pxo->childs[buf->pxo->nb_childs] = &buf->pxo_tab[buf->cur_subobject++]; - buf->pxo->childs[buf->pxo->nb_childs]->ptarget = &buf->pxo_globals[i*MAX_SUBOBJECTS+j]; + buf->pxo->childs[buf->pxo->nb_childs]->ptarget = &(buf->pxo_globals[i])[j]; buf->pxo->nb_childs++; } else if (check_TOKEN(buf) == TOKEN_NAME) @@ -2219,8 +2232,8 @@ static HRESULT WINAPI IDirectXFileEnumObjectImpl_GetNextDataObject(IDirectXFileE IDirectXFileEnumObjectImpl *This = (IDirectXFileEnumObjectImpl *)iface; IDirectXFileDataImpl* object; HRESULT hr; - LPBYTE pdata; - LPBYTE pstrings; + LPBYTE pdata = NULL; + LPBYTE pstrings = NULL; TRACE("(%p/%p)->(%p)\n", This, iface, ppDataObj); @@ -2237,43 +2250,51 @@ static HRESULT WINAPI IDirectXFileEnumObjectImpl_GetNextDataObject(IDirectXFileE if (FAILED(hr)) return hr; - This->buf.pxo_globals = &This->xobjects[0][0]; + This->buf.pxo_globals = This->xobjects; This->buf.nb_pxo_globals = This->nb_xobjects; - This->buf.pxo_tab = &This->xobjects[This->nb_xobjects][0]; - This->buf.cur_subobject = 0; - This->buf.pxo = &This->buf.pxo_tab[This->buf.cur_subobject++]; + This->buf.cur_subobject = 1; This->buf.level = 0; + This->buf.pxo_tab = HeapAlloc(GetProcessHeap(), 0, sizeof(xobject)*MAX_SUBOBJECTS); + if (!This->buf.pxo_tab) + { + ERR("Out of memory\n"); + hr = DXFILEERR_BADALLOC; + goto error; + } + This->buf.pxo = This->xobjects[This->nb_xobjects] = This->buf.pxo_tab; + pdata = HeapAlloc(GetProcessHeap(), 0, MAX_DATA_SIZE); if (!pdata) { ERR("Out of memory\n"); - return DXFILEERR_BADALLOC; + hr = DXFILEERR_BADALLOC; + goto error; } - This->buf.cur_pdata = This->buf.pdata = pdata; + This->buf.cur_pdata = This->buf.pdata = object->pdata = pdata; pstrings = HeapAlloc(GetProcessHeap(), 0, MAX_STRINGS_BUFFER); if (!pstrings) { ERR("Out of memory\n"); - HeapFree(GetProcessHeap(), 0, This->buf.pxo->pdata); - return DXFILEERR_BADALLOC; + hr = DXFILEERR_BADALLOC; + goto error; } - This->buf.cur_pstrings = This->buf.pstrings = pstrings; + This->buf.cur_pstrings = This->buf.pstrings = object->pstrings = pstrings; if (!parse_object(&This->buf)) { TRACE("Object is not correct\n"); - HeapFree(GetProcessHeap(), 0, This->buf.pxo->pdata); - HeapFree(GetProcessHeap(), 0, This->buf.pstrings); - return DXFILEERR_PARSEERROR; + hr = DXFILEERR_PARSEERROR; + goto error; } This->buf.pxo->nb_subobjects = This->buf.cur_subobject; if (This->buf.cur_subobject > MAX_SUBOBJECTS) { FIXME("Too many suobjects %d\n", This->buf.cur_subobject); - return DXFILEERR_BADALLOC; + hr = DXFILEERR_BADALLOC; + goto error; } object->pstrings = pstrings; @@ -2284,9 +2305,21 @@ static HRESULT WINAPI IDirectXFileEnumObjectImpl_GetNextDataObject(IDirectXFileE *ppDataObj = (LPDIRECTXFILEDATA)object; + /* Get a reference to created object */ + This->pRefObjects[This->nb_xobjects] = (LPDIRECTXFILEDATA)object; + IDirectXFileData_AddRef(This->pRefObjects[This->nb_xobjects]); + This->nb_xobjects++; return DXFILE_OK; + +error: + + HeapFree(GetProcessHeap(), 0, This->buf.pxo_tab); + HeapFree(GetProcessHeap(), 0, pdata); + HeapFree(GetProcessHeap(), 0, pstrings); + + return hr; } static HRESULT WINAPI IDirectXFileEnumObjectImpl_GetDataObjectById(IDirectXFileEnumObject* iface, REFGUID rguid, LPDIRECTXFILEDATA* ppDataObj) diff --git a/dlls/d3dxof/d3dxof_private.h b/dlls/d3dxof/d3dxof_private.h index 7cb82cd41ab..bc78bc05186 100644 --- a/dlls/d3dxof/d3dxof_private.h +++ b/dlls/d3dxof/d3dxof_private.h @@ -104,6 +104,7 @@ typedef struct { int cur_enum_object; BOOL from_ref; ULONG level; + LPBYTE pdata; LPBYTE pstrings; } IDirectXFileDataImpl; @@ -130,7 +131,7 @@ typedef struct { LPBYTE cur_pdata; LPBYTE cur_pstrings; BYTE value[100]; - xobject* pxo_globals; + xobject** pxo_globals; ULONG nb_pxo_globals; xobject* pxo_tab; IDirectXFileImpl* pdxf; @@ -149,7 +150,8 @@ typedef struct { parse_buffer buf; IDirectXFileImpl* pDirectXFile; ULONG nb_xobjects; - xobject xobjects[MAX_OBJECTS][MAX_SUBOBJECTS]; + xobject* xobjects[MAX_OBJECTS]; + IDirectXFileData* pRefObjects[MAX_OBJECTS]; } IDirectXFileEnumObjectImpl; typedef struct { diff --git a/dlls/d3dxof/tests/d3dxof.c b/dlls/d3dxof/tests/d3dxof.c index f70758630f4..12df0c673f0 100644 --- a/dlls/d3dxof/tests/d3dxof.c +++ b/dlls/d3dxof/tests/d3dxof.c @@ -46,6 +46,13 @@ char template[] = "DWORD flags;\n" "}\n"; +char object[] = +"xof 0302txt 0064\n" +"Header Object\n" +"{\n" +"1; 2; 3;\n" +"}\n"; + static void init_function_pointers(void) { /* We have to use LoadLibrary as no d3dxof functions are referenced directly */ @@ -60,11 +67,14 @@ static unsigned long getRefcount(IUnknown *iface) return IUnknown_Release(iface); } -static void test_d3dxof(void) +static void test_refcount(void) { HRESULT hr; unsigned long ref; LPDIRECTXFILE lpDirectXFile = NULL; + LPDIRECTXFILEENUMOBJECT lpdxfeo; + LPDIRECTXFILEDATA lpdxfd; + DXFILELOADMEMORY dxflm; if (!pDirectXFileCreate) { @@ -82,18 +92,49 @@ static void test_d3dxof(void) ref = getRefcount( (IUnknown *) lpDirectXFile); ok(ref == 1, "Got refcount %ld, expected 1\n", ref); - ref = IDirectXFile_AddRef(lpDirectXFile); ok(ref == 2, "Got refcount %ld, expected 1\n", ref); - ref = IDirectXFile_Release(lpDirectXFile); ok(ref == 1, "Got refcount %ld, expected 1\n", ref); hr = IDirectXFile_RegisterTemplates(lpDirectXFile, template, strlen(template)); ok(hr == DXFILE_OK, "IDirectXFileImpl_RegisterTemplates: %x\n", hr); + dxflm.lpMemory = &object; + dxflm.dSize = strlen(object); + hr = IDirectXFile_CreateEnumObject(lpDirectXFile, &dxflm, DXFILELOAD_FROMMEMORY, &lpdxfeo); + ok(hr == DXFILE_OK, "IDirectXFile_CreateEnumObject: %x\n", hr); + ref = getRefcount( (IUnknown *) lpDirectXFile); + ok(ref == 1, "Got refcount %ld, expected 1\n", ref); + ref = getRefcount( (IUnknown *) lpdxfeo); + ok(ref == 1, "Got refcount %ld, expected 1\n", ref); + + hr = IDirectXFileEnumObject_GetNextDataObject(lpdxfeo, &lpdxfd); + ok(hr == DXFILE_OK, "IDirectXFileEnumObject_GetNextDataObject: %x\n", hr); + ref = getRefcount( (IUnknown *) lpDirectXFile); + ok(ref == 1, "Got refcount %ld, expected 1\n", ref); + ref = getRefcount( (IUnknown *) lpdxfeo); + ok(ref == 1, "Got refcount %ld, expected 1\n", ref); + /* Enum object gets references to all top level objects */ + ref = getRefcount( (IUnknown *) lpdxfd); + ok(ref == 2, "Got refcount %ld, expected 2\n", ref); + ref = IDirectXFile_Release(lpDirectXFile); - ok(ref == 0, "Got refcount %ld, expected 1\n", ref); + ok(ref == 0, "Got refcount %ld, expected 0\n", ref); + /* Nothing changes for all other objects */ + ref = getRefcount( (IUnknown *) lpdxfeo); + ok(ref == 1, "Got refcount %ld, expected 1\n", ref); + ref = getRefcount( (IUnknown *) lpdxfd); + ok(ref == 2, "Got refcount %ld, expected 1\n", ref); + + ref = IDirectXFileEnumObject_Release(lpdxfeo); + ok(ref == 0, "Got refcount %ld, expected 0\n", ref); + /* Enum object releases references to all top level objects */ + ref = getRefcount( (IUnknown *) lpdxfd); + ok(ref == 1, "Got refcount %ld, expected 1\n", ref); + + ref = IDirectXFileData_Release(lpdxfd); + ok(ref == 0, "Got refcount %ld, expected 0\n", ref); } /* Set it to 1 to expand the string when dumping the object. This is usefull when there is @@ -268,7 +309,7 @@ START_TEST(d3dxof) { init_function_pointers(); - test_d3dxof(); + test_refcount(); test_dump(); FreeLibrary(hd3dxof); diff --git a/dlls/ddraw/tests/visual.c b/dlls/ddraw/tests/visual.c index 030354a3ca4..7820e5e14a8 100644 --- a/dlls/ddraw/tests/visual.c +++ b/dlls/ddraw/tests/visual.c @@ -185,6 +185,21 @@ out: return ret; } +/* + * Helper function to get and set the viewport - needed on geforce 8800 on XP - driver bug? + * This is needed after IDirect3DDevice7_SetRenderTarget in combination with offscreen to backbuffer rendering. + */ +static void set_the_same_viewport_again(IDirect3DDevice7 *device) +{ + D3DVIEWPORT7 vp = {0}; + HRESULT hr; + hr = IDirect3DDevice7_GetViewport(device,&vp); + ok(hr == D3D_OK && vp.dwWidth == 640 && vp.dwHeight == 480, "IDirect3DDevice7_SetViewport returned %08x\n", hr); + hr = IDirect3DDevice7_SetViewport(device, &vp); + ok(hr == D3D_OK, "IDirect3DDevice7_SetViewport returned %08x\n", hr); + return; +} + struct vertex { float x, y, z; @@ -559,6 +574,8 @@ static void offscreen_test(IDirect3DDevice7 *device) hr = IDirect3DDevice7_SetRenderTarget(device, backbuffer, 0); ok(hr == D3D_OK, "SetRenderTarget failed, hr = %08x\n", hr); + set_the_same_viewport_again(device); + hr = IDirect3DDevice7_SetTexture(device, 0, offscreen); ok(hr == D3D_OK, "SetTexture failed, %08x\n", hr); @@ -716,6 +733,7 @@ static void alpha_test(IDirect3DDevice7 *device) hr = IDirect3DDevice7_SetRenderTarget(device, backbuffer, 0); ok(hr == D3D_OK, "Can't get back buffer, hr = %08x\n", hr); + set_the_same_viewport_again(device); /* Render the offscreen texture onto the frame buffer to be able to compare it regularly. * Disable alpha blending for the final composition @@ -739,28 +757,28 @@ static void alpha_test(IDirect3DDevice7 *device) green = (color & 0x0000ff00) >> 8; blue = (color & 0x000000ff); ok(red >= 0xbe && red <= 0xc0 && green >= 0x39 && green <= 0x41 && blue == 0x00, - "SRCALPHA on frame buffer returned color %08x, expected 0x00bf4000\n", color); + "SRCALPHA on frame buffer returned color 0x%08x, expected 0x00bf4000\n", color); color = getPixelColor(device, 160, 120); red = (color & 0x00ff0000) >> 16; green = (color & 0x0000ff00) >> 8; blue = (color & 0x000000ff); ok(red == 0x00 && green == 0x00 && blue >= 0xfe && blue <= 0xff , - "DSTALPHA on frame buffer returned color %08x, expected 0x00ff0000\n", color); + "DSTALPHA on frame buffer returned color 0x%08x, expected 0x000000ff\n", color); color = getPixelColor(device, 480, 360); red = (color & 0x00ff0000) >> 16; green = (color & 0x0000ff00) >> 8; blue = (color & 0x000000ff); ok(red >= 0xbe && red <= 0xc0 && green >= 0x39 && green <= 0x41 && blue == 0x00, - "SRCALPHA on texture returned color %08x, expected bar\n", color); + "SRCALPHA on texture returned color 0x%08x, expected 0x00bf4000\n", color); color = getPixelColor(device, 480, 120); red = (color & 0x00ff0000) >> 16; green = (color & 0x0000ff00) >> 8; blue = (color & 0x000000ff); ok(red >= 0x7e && red <= 0x81 && green == 0x00 && blue >= 0x7e && blue <= 0x81, - "DSTALPHA on texture returned color %08x, expected foo\n", color); + "DSTALPHA on texture returned color 0x%08x, expected 0x00800080\n", color); out: if(offscreen) IDirectDrawSurface7_Release(offscreen); diff --git a/dlls/dmime/dmutils.c b/dlls/dmime/dmutils.c index ad46303e7df..614677cd35c 100644 --- a/dlls/dmime/dmutils.c +++ b/dlls/dmime/dmutils.c @@ -43,44 +43,43 @@ #include "dmutils.h" -WINE_DEFAULT_DEBUG_CHANNEL(dmusic); -WINE_DECLARE_DEBUG_CHANNEL(dmfile); +WINE_DEFAULT_DEBUG_CHANNEL(dmfile); HRESULT IDirectMusicUtils_IPersistStream_ParseDescGeneric (DMUS_PRIVATE_CHUNK* pChunk, IStream* pStm, LPDMUS_OBJECTDESC pDesc) { switch (pChunk->fccID) { case DMUS_FOURCC_GUID_CHUNK: { - TRACE_(dmfile)(": GUID chunk\n"); + TRACE(": GUID chunk\n"); pDesc->dwValidData |= DMUS_OBJ_OBJECT; IStream_Read (pStm, &pDesc->guidObject, pChunk->dwSize, NULL); break; } case DMUS_FOURCC_DATE_CHUNK: { - TRACE_(dmfile)(": file date chunk\n"); + TRACE(": file date chunk\n"); pDesc->dwValidData |= DMUS_OBJ_DATE; IStream_Read (pStm, &pDesc->ftDate, pChunk->dwSize, NULL); break; } case DMUS_FOURCC_NAME_CHUNK: { - TRACE_(dmfile)(": name chunk\n"); + TRACE(": name chunk\n"); pDesc->dwValidData |= DMUS_OBJ_NAME; IStream_Read (pStm, pDesc->wszName, pChunk->dwSize, NULL); break; } case DMUS_FOURCC_FILE_CHUNK: { - TRACE_(dmfile)(": file name chunk\n"); + TRACE(": file name chunk\n"); pDesc->dwValidData |= DMUS_OBJ_FILENAME; IStream_Read (pStm, pDesc->wszFileName, pChunk->dwSize, NULL); break; } case DMUS_FOURCC_VERSION_CHUNK: { - TRACE_(dmfile)(": version chunk\n"); + TRACE(": version chunk\n"); pDesc->dwValidData |= DMUS_OBJ_VERSION; IStream_Read (pStm, &pDesc->vVersion, pChunk->dwSize, NULL); break; } case DMUS_FOURCC_CATEGORY_CHUNK: { - TRACE_(dmfile)(": category chunk\n"); + TRACE(": category chunk\n"); pDesc->dwValidData |= DMUS_OBJ_CATEGORY; IStream_Read (pStm, pDesc->wszCategory, pChunk->dwSize, NULL); break; @@ -105,37 +104,37 @@ HRESULT IDirectMusicUtils_IPersistStream_ParseUNFOGeneric (DMUS_PRIVATE_CHUNK* p case mmioFOURCC('I','N','A','M'): case DMUS_FOURCC_UNAM_CHUNK: { - TRACE_(dmfile)(": name chunk\n"); + TRACE(": name chunk\n"); pDesc->dwValidData |= DMUS_OBJ_NAME; IStream_Read (pStm, pDesc->wszName, pChunk->dwSize, NULL); - TRACE_(dmfile)(" - wszName: %s\n", debugstr_w(pDesc->wszName)); + TRACE(" - wszName: %s\n", debugstr_w(pDesc->wszName)); break; } case mmioFOURCC('I','A','R','T'): case DMUS_FOURCC_UART_CHUNK: { - TRACE_(dmfile)(": artist chunk (ignored)\n"); + TRACE(": artist chunk (ignored)\n"); liMove.QuadPart = pChunk->dwSize; IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL); break; } case mmioFOURCC('I','C','O','P'): case DMUS_FOURCC_UCOP_CHUNK: { - TRACE_(dmfile)(": copyright chunk (ignored)\n"); + TRACE(": copyright chunk (ignored)\n"); liMove.QuadPart = pChunk->dwSize; IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL); break; } case mmioFOURCC('I','S','B','J'): case DMUS_FOURCC_USBJ_CHUNK: { - TRACE_(dmfile)(": subject chunk (ignored)\n"); + TRACE(": subject chunk (ignored)\n"); liMove.QuadPart = pChunk->dwSize; IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL); break; } case mmioFOURCC('I','C','M','T'): case DMUS_FOURCC_UCMT_CHUNK: { - TRACE_(dmfile)(": comment chunk (ignored)\n"); + TRACE(": comment chunk (ignored)\n"); liMove.QuadPart = pChunk->dwSize; IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL); break; @@ -161,7 +160,7 @@ HRESULT IDirectMusicUtils_IPersistStream_ParseReference (LPPERSISTSTREAM iface, memset(&ref_desc, 0, sizeof(ref_desc)); if (pChunk->fccID != DMUS_FOURCC_REF_LIST) { - ERR_(dmfile)(": %s chunk should be a REF list\n", debugstr_fourcc (pChunk->fccID)); + ERR(": %s chunk should be a REF list\n", debugstr_fourcc (pChunk->fccID)); return E_FAIL; } @@ -171,7 +170,7 @@ HRESULT IDirectMusicUtils_IPersistStream_ParseReference (LPPERSISTSTREAM iface, do { IStream_Read (pStm, &Chunk, sizeof(FOURCC)+sizeof(DWORD), NULL); ListCount[0] += sizeof(FOURCC) + sizeof(DWORD) + Chunk.dwSize; - TRACE_(dmfile)(": %s chunk (size = %d)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize); + TRACE(": %s chunk (size = %d)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize); hr = IDirectMusicUtils_IPersistStream_ParseDescGeneric(&Chunk, pStm, &ref_desc); if (FAILED(hr)) return hr; @@ -179,29 +178,29 @@ HRESULT IDirectMusicUtils_IPersistStream_ParseReference (LPPERSISTSTREAM iface, if (hr == S_FALSE) { switch (Chunk.fccID) { case DMUS_FOURCC_REF_CHUNK: { - TRACE_(dmfile)(": Reference chunk\n"); + TRACE(": Reference chunk\n"); if (Chunk.dwSize != sizeof(DMUS_IO_REFERENCE)) return E_FAIL; IStream_Read (pStm, &ref, sizeof(DMUS_IO_REFERENCE), NULL); - TRACE_(dmfile)(" - guidClassID: %s\n", debugstr_dmguid(&ref.guidClassID)); - TRACE_(dmfile)(" - dwValidData: %u\n", ref.dwValidData); + TRACE(" - guidClassID: %s\n", debugstr_dmguid(&ref.guidClassID)); + TRACE(" - dwValidData: %u\n", ref.dwValidData); break; } default: { - TRACE_(dmfile)(": unknown chunk (irrevelant & skipping)\n"); + TRACE(": unknown chunk (irrevelant & skipping)\n"); liMove.QuadPart = Chunk.dwSize; IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL); break; } } } - TRACE_(dmfile)(": ListCount[0] = %d < ListSize[0] = %d\n", ListCount[0], ListSize[0]); + TRACE(": ListCount[0] = %d < ListSize[0] = %d\n", ListCount[0], ListSize[0]); } while (ListCount[0] < ListSize[0]); ref_desc.dwValidData |= DMUS_OBJ_CLASS; ref_desc.guidClass = ref.guidClassID; - TRACE_(dmfile)("** DM Reference Begin of Load ***\n"); - TRACE_(dmfile)("With Desc:\n"); + TRACE("** DM Reference Begin of Load ***\n"); + TRACE("With Desc:\n"); debugstr_DMUS_OBJECTDESC(&ref_desc); { @@ -215,7 +214,7 @@ HRESULT IDirectMusicUtils_IPersistStream_ParseReference (LPPERSISTSTREAM iface, hr = IDirectMusicLoader_GetObject (pLoader, &ref_desc, &IID_IDirectMusicObject, (LPVOID*)ppObject); IDirectMusicLoader_Release (pLoader); /* release loader */ } - TRACE_(dmfile)("** DM Reference End of Load ***\n"); + TRACE("** DM Reference End of Load ***\n"); return S_OK; } diff --git a/dlls/dmstyle/dmutils.c b/dlls/dmstyle/dmutils.c index 72014612e98..e3663aad989 100644 --- a/dlls/dmstyle/dmutils.c +++ b/dlls/dmstyle/dmutils.c @@ -40,44 +40,43 @@ #include "dmutils.h" -WINE_DEFAULT_DEBUG_CHANNEL(dmusic); -WINE_DECLARE_DEBUG_CHANNEL(dmfile); +WINE_DEFAULT_DEBUG_CHANNEL(dmfile); HRESULT IDirectMusicUtils_IPersistStream_ParseDescGeneric (DMUS_PRIVATE_CHUNK* pChunk, IStream* pStm, LPDMUS_OBJECTDESC pDesc) { switch (pChunk->fccID) { case DMUS_FOURCC_GUID_CHUNK: { - TRACE_(dmfile)(": GUID chunk\n"); + TRACE(": GUID chunk\n"); pDesc->dwValidData |= DMUS_OBJ_OBJECT; IStream_Read (pStm, &pDesc->guidObject, pChunk->dwSize, NULL); break; } case DMUS_FOURCC_DATE_CHUNK: { - TRACE_(dmfile)(": file date chunk\n"); + TRACE(": file date chunk\n"); pDesc->dwValidData |= DMUS_OBJ_DATE; IStream_Read (pStm, &pDesc->ftDate, pChunk->dwSize, NULL); break; } case DMUS_FOURCC_NAME_CHUNK: { - TRACE_(dmfile)(": name chunk\n"); + TRACE(": name chunk\n"); pDesc->dwValidData |= DMUS_OBJ_NAME; IStream_Read (pStm, pDesc->wszName, pChunk->dwSize, NULL); break; } case DMUS_FOURCC_FILE_CHUNK: { - TRACE_(dmfile)(": file name chunk\n"); + TRACE(": file name chunk\n"); pDesc->dwValidData |= DMUS_OBJ_FILENAME; IStream_Read (pStm, pDesc->wszFileName, pChunk->dwSize, NULL); break; } case DMUS_FOURCC_VERSION_CHUNK: { - TRACE_(dmfile)(": version chunk\n"); + TRACE(": version chunk\n"); pDesc->dwValidData |= DMUS_OBJ_VERSION; IStream_Read (pStm, &pDesc->vVersion, pChunk->dwSize, NULL); break; } case DMUS_FOURCC_CATEGORY_CHUNK: { - TRACE_(dmfile)(": category chunk\n"); + TRACE(": category chunk\n"); pDesc->dwValidData |= DMUS_OBJ_CATEGORY; IStream_Read (pStm, pDesc->wszCategory, pChunk->dwSize, NULL); break; @@ -102,37 +101,37 @@ HRESULT IDirectMusicUtils_IPersistStream_ParseUNFOGeneric (DMUS_PRIVATE_CHUNK* p case mmioFOURCC('I','N','A','M'): case DMUS_FOURCC_UNAM_CHUNK: { - TRACE_(dmfile)(": name chunk\n"); + TRACE(": name chunk\n"); pDesc->dwValidData |= DMUS_OBJ_NAME; IStream_Read (pStm, pDesc->wszName, pChunk->dwSize, NULL); - TRACE_(dmfile)(" - wszName: %s\n", debugstr_w(pDesc->wszName)); + TRACE(" - wszName: %s\n", debugstr_w(pDesc->wszName)); break; } case mmioFOURCC('I','A','R','T'): case DMUS_FOURCC_UART_CHUNK: { - TRACE_(dmfile)(": artist chunk (ignored)\n"); + TRACE(": artist chunk (ignored)\n"); liMove.QuadPart = pChunk->dwSize; IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL); break; } case mmioFOURCC('I','C','O','P'): case DMUS_FOURCC_UCOP_CHUNK: { - TRACE_(dmfile)(": copyright chunk (ignored)\n"); + TRACE(": copyright chunk (ignored)\n"); liMove.QuadPart = pChunk->dwSize; IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL); break; } case mmioFOURCC('I','S','B','J'): case DMUS_FOURCC_USBJ_CHUNK: { - TRACE_(dmfile)(": subject chunk (ignored)\n"); + TRACE(": subject chunk (ignored)\n"); liMove.QuadPart = pChunk->dwSize; IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL); break; } case mmioFOURCC('I','C','M','T'): case DMUS_FOURCC_UCMT_CHUNK: { - TRACE_(dmfile)(": comment chunk (ignored)\n"); + TRACE(": comment chunk (ignored)\n"); liMove.QuadPart = pChunk->dwSize; IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL); break; @@ -158,7 +157,7 @@ HRESULT IDirectMusicUtils_IPersistStream_ParseReference (LPPERSISTSTREAM iface, memset(&ref_desc, 0, sizeof(ref_desc)); if (pChunk->fccID != DMUS_FOURCC_REF_LIST) { - ERR_(dmfile)(": %s chunk should be a REF list\n", debugstr_fourcc (pChunk->fccID)); + ERR(": %s chunk should be a REF list\n", debugstr_fourcc (pChunk->fccID)); return E_FAIL; } @@ -168,7 +167,7 @@ HRESULT IDirectMusicUtils_IPersistStream_ParseReference (LPPERSISTSTREAM iface, do { IStream_Read (pStm, &Chunk, sizeof(FOURCC)+sizeof(DWORD), NULL); ListCount[0] += sizeof(FOURCC) + sizeof(DWORD) + Chunk.dwSize; - TRACE_(dmfile)(": %s chunk (size = %d)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize); + TRACE(": %s chunk (size = %d)", debugstr_fourcc (Chunk.fccID), Chunk.dwSize); hr = IDirectMusicUtils_IPersistStream_ParseDescGeneric(&Chunk, pStm, &ref_desc); if (FAILED(hr)) return hr; @@ -176,29 +175,29 @@ HRESULT IDirectMusicUtils_IPersistStream_ParseReference (LPPERSISTSTREAM iface, if (hr == S_FALSE) { switch (Chunk.fccID) { case DMUS_FOURCC_REF_CHUNK: { - TRACE_(dmfile)(": Reference chunk\n"); + TRACE(": Reference chunk\n"); if (Chunk.dwSize != sizeof(DMUS_IO_REFERENCE)) return E_FAIL; IStream_Read (pStm, &ref, sizeof(DMUS_IO_REFERENCE), NULL); - TRACE_(dmfile)(" - guidClassID: %s\n", debugstr_dmguid(&ref.guidClassID)); - TRACE_(dmfile)(" - dwValidData: %u\n", ref.dwValidData); + TRACE(" - guidClassID: %s\n", debugstr_dmguid(&ref.guidClassID)); + TRACE(" - dwValidData: %u\n", ref.dwValidData); break; } default: { - TRACE_(dmfile)(": unknown chunk (irrevelant & skipping)\n"); + TRACE(": unknown chunk (irrevelant & skipping)\n"); liMove.QuadPart = Chunk.dwSize; IStream_Seek (pStm, liMove, STREAM_SEEK_CUR, NULL); break; } } } - TRACE_(dmfile)(": ListCount[0] = %d < ListSize[0] = %d\n", ListCount[0], ListSize[0]); + TRACE(": ListCount[0] = %d < ListSize[0] = %d\n", ListCount[0], ListSize[0]); } while (ListCount[0] < ListSize[0]); ref_desc.dwValidData |= DMUS_OBJ_CLASS; ref_desc.guidClass = ref.guidClassID; - TRACE_(dmfile)("** DM Reference Begin of Load ***\n"); - TRACE_(dmfile)("With Desc:\n"); + TRACE("** DM Reference Begin of Load ***\n"); + TRACE("With Desc:\n"); debugstr_DMUS_OBJECTDESC(&ref_desc); { @@ -212,7 +211,7 @@ HRESULT IDirectMusicUtils_IPersistStream_ParseReference (LPPERSISTSTREAM iface, hr = IDirectMusicLoader_GetObject (pLoader, &ref_desc, &IID_IDirectMusicObject, (LPVOID*)ppObject); IDirectMusicLoader_Release (pLoader); /* release loader */ } - TRACE_(dmfile)("** DM Reference End of Load ***\n"); + TRACE("** DM Reference End of Load ***\n"); return S_OK; } diff --git a/dlls/dmusic/dmusic.c b/dlls/dmusic/dmusic.c index e2c8d2cd70d..2c6bdd20fbf 100644 --- a/dlls/dmusic/dmusic.c +++ b/dlls/dmusic/dmusic.c @@ -108,8 +108,16 @@ static HRESULT WINAPI IDirectMusic8Impl_EnumPort(LPDIRECTMUSIC8 iface, DWORD dwI static HRESULT WINAPI IDirectMusic8Impl_CreateMusicBuffer (LPDIRECTMUSIC8 iface, LPDMUS_BUFFERDESC pBufferDesc, LPDIRECTMUSICBUFFER** ppBuffer, LPUNKNOWN pUnkOuter) { IDirectMusic8Impl *This = (IDirectMusic8Impl *)iface; - FIXME("(%p, %p, %p, %p): stub\n", This, pBufferDesc, ppBuffer, pUnkOuter); - return S_OK; + + TRACE("(%p, %p, %p, %p)\n", This, pBufferDesc, ppBuffer, pUnkOuter); + + if (pUnkOuter) + return CLASS_E_NOAGGREGATION; + + if (!pBufferDesc || !ppBuffer) + return E_POINTER; + + return DMUSIC_CreateDirectMusicBufferImpl(&IID_IDirectMusicBuffer, (LPVOID)ppBuffer, NULL); } static HRESULT WINAPI IDirectMusic8Impl_CreatePort (LPDIRECTMUSIC8 iface, REFCLSID rclsidPort, LPDMUS_PORTPARAMS pPortParams, LPDIRECTMUSICPORT* ppPort, LPUNKNOWN pUnkOuter) { diff --git a/dlls/dmusic/downloadedinstrument.c b/dlls/dmusic/downloadedinstrument.c index e20aaf02a4e..2a71a3eeb20 100644 --- a/dlls/dmusic/downloadedinstrument.c +++ b/dlls/dmusic/downloadedinstrument.c @@ -27,7 +27,8 @@ static HRESULT WINAPI IDirectMusicDownloadedInstrumentImpl_QueryInterface (LPDIR TRACE("(%p, %s, %p)\n", This, debugstr_dmguid(riid), ppobj); if (IsEqualIID (riid, &IID_IUnknown) - || IsEqualIID (riid, &IID_IDirectMusicDownloadedInstrument)) { + || IsEqualIID (riid, &IID_IDirectMusicDownloadedInstrument) + || IsEqualIID (riid, &IID_IDirectMusicDownloadedInstrument8)) { IUnknown_AddRef(iface); *ppobj = This; return S_OK; diff --git a/dlls/dmusic/port.c b/dlls/dmusic/port.c index 7773d2873e2..5c4e848625e 100644 --- a/dlls/dmusic/port.c +++ b/dlls/dmusic/port.c @@ -23,18 +23,25 @@ WINE_DEFAULT_DEBUG_CHANNEL(dmusic); /* IDirectMusicPortImpl IUnknown part: */ static HRESULT WINAPI IDirectMusicPortImpl_QueryInterface (LPDIRECTMUSICPORT iface, REFIID riid, LPVOID *ppobj) { - IDirectMusicPortImpl *This = (IDirectMusicPortImpl *)iface; + ICOM_THIS_MULTI(IDirectMusicPortImpl, lpVtbl, iface); + TRACE("(%p, %s, %p)\n", This, debugstr_dmguid(riid), ppobj); if (IsEqualIID (riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDirectMusicPort) || - IsEqualGUID(riid, &IID_IDirectMusicPort8) || - IsEqualGUID(riid, &IID_IDirectMusicPortDownload) || - IsEqualGUID(riid, &IID_IDirectMusicPortDownload8) || - IsEqualGUID(riid, &IID_IDirectMusicThru) || - IsEqualGUID(riid, &IID_IDirectMusicThru8)) { - IUnknown_AddRef(iface); - *ppobj = This; + IsEqualGUID(riid, &IID_IDirectMusicPort8)) { + *ppobj = &This->lpVtbl; + IDirectMusicPort_AddRef((LPDIRECTMUSICPORT)*ppobj); + return S_OK; + } else if (IsEqualGUID(riid, &IID_IDirectMusicPortDownload) || + IsEqualGUID(riid, &IID_IDirectMusicPortDownload8)) { + *ppobj = &This->lpDownloadVtbl; + IDirectMusicPortDownload_AddRef((LPDIRECTMUSICPORTDOWNLOAD)*ppobj); + return S_OK; + } else if (IsEqualGUID(riid, &IID_IDirectMusicThru) || + IsEqualGUID(riid, &IID_IDirectMusicThru8)) { + *ppobj = &This->lpThruVtbl; + IDirectMusicThru_AddRef((LPDIRECTMUSICTHRU)*ppobj); return S_OK; } WARN("(%p, %s, %p): not found\n", This, debugstr_dmguid(riid), ppobj); @@ -88,8 +95,13 @@ static HRESULT WINAPI IDirectMusicPortImpl_Read (LPDIRECTMUSICPORT iface, LPDIRE static HRESULT WINAPI IDirectMusicPortImpl_DownloadInstrument (LPDIRECTMUSICPORT iface, IDirectMusicInstrument* pInstrument, IDirectMusicDownloadedInstrument** ppDownloadedInstrument, DMUS_NOTERANGE* pNoteRanges, DWORD dwNumNoteRanges) { IDirectMusicPortImpl *This = (IDirectMusicPortImpl *)iface; + FIXME("(%p, %p, %p, %p, %d): stub\n", This, pInstrument, ppDownloadedInstrument, pNoteRanges, dwNumNoteRanges); - return S_OK; + + if (!pInstrument || !ppDownloadedInstrument || (dwNumNoteRanges && !pNoteRanges)) + return E_POINTER; + + return DMUSIC_CreateDirectMusicDownloadedInstrumentImpl(&IID_IDirectMusicDownloadedInstrument, (LPVOID*)ppDownloadedInstrument, NULL); } static HRESULT WINAPI IDirectMusicPortImpl_UnloadInstrument (LPDIRECTMUSICPORT iface, IDirectMusicDownloadedInstrument *pDownloadedInstrument) { @@ -264,8 +276,13 @@ static ULONG WINAPI IDirectMusicPortDownloadImpl_Release (LPDIRECTMUSICPORTDOWNL /* IDirectMusicPortDownload Interface follow: */ static HRESULT WINAPI IDirectMusicPortDownloadImpl_GetBuffer (LPDIRECTMUSICPORTDOWNLOAD iface, DWORD dwDLId, IDirectMusicDownload** ppIDMDownload) { ICOM_THIS_MULTI(IDirectMusicPortImpl, lpDownloadVtbl, iface); + FIXME("(%p/%p)->(%d, %p): stub\n", This, iface, dwDLId, ppIDMDownload); - return S_OK; + + if (!ppIDMDownload) + return E_POINTER; + + return DMUSIC_CreateDirectMusicDownloadImpl(&IID_IDirectMusicDownload, (LPVOID*)ppIDMDownload, NULL); } static HRESULT WINAPI IDirectMusicPortDownloadImpl_AllocateBuffer (LPDIRECTMUSICPORTDOWNLOAD iface, DWORD dwSize, IDirectMusicDownload** ppIDMDownload) { diff --git a/dlls/dsound/primary.c b/dlls/dsound/primary.c index 661cd8ca048..5812f0086f0 100644 --- a/dlls/dsound/primary.c +++ b/dlls/dsound/primary.c @@ -46,19 +46,24 @@ WINE_DEFAULT_DEBUG_CHANNEL(dsound); */ DWORD DSOUND_fraglen(DWORD nSamplesPerSec, DWORD nBlockAlign) { - DWORD fraglen = 256 * nBlockAlign; + /* Given a timer delay of 10ms, the fragment size is approximately: + * fraglen = (nSamplesPerSec * 10 / 1000) * nBlockAlign + * ==> fraglen = (nSamplesPerSec / 100) * nBlockSize + * + * ALSA uses buffers that are powers of 2. Because of this, fraglen + * is rounded up to the nearest power of 2: + */ - /* Compensate for only being roughly accurate */ - if (nSamplesPerSec <= 26000) - fraglen /= 2; + if (nSamplesPerSec <= 12800) + return 128 * nBlockAlign; - if (nSamplesPerSec <= 10000) - fraglen /= 2; + if (nSamplesPerSec <= 25600) + return 256 * nBlockAlign; - if (nSamplesPerSec >= 80000) - fraglen *= 2; + if (nSamplesPerSec <= 51200) + return 512 * nBlockAlign; - return fraglen; + return 1024 * nBlockAlign; } static void DSOUND_RecalcPrimary(DirectSoundDevice *device) diff --git a/dlls/gdi32/enhmfdrv/bitblt.c b/dlls/gdi32/enhmfdrv/bitblt.c index 0458ac11610..ddb9dd1ffd9 100644 --- a/dlls/gdi32/enhmfdrv/bitblt.c +++ b/dlls/gdi32/enhmfdrv/bitblt.c @@ -27,8 +27,8 @@ #include "enhmetafiledrv.h" #include "wine/debug.h" -BOOL EMFDRV_PatBlt( PHYSDEV dev, INT left, INT top, - INT width, INT height, DWORD rop ) +BOOL CDECL EMFDRV_PatBlt( PHYSDEV dev, INT left, INT top, + INT width, INT height, DWORD rop ) { EMRBITBLT emr; BOOL ret; @@ -173,7 +173,7 @@ static BOOL EMFDRV_BitBlockTransfer( return ret; } -BOOL EMFDRV_BitBlt( +BOOL CDECL EMFDRV_BitBlt( PHYSDEV devDst, INT xDst, INT yDst, INT width, INT height, PHYSDEV devSrc, INT xSrc, INT ySrc, DWORD rop) { @@ -182,7 +182,7 @@ BOOL EMFDRV_BitBlt( rop, EMR_BITBLT ); } -BOOL EMFDRV_StretchBlt( +BOOL CDECL EMFDRV_StretchBlt( PHYSDEV devDst, INT xDst, INT yDst, INT widthDst, INT heightDst, PHYSDEV devSrc, INT xSrc, INT ySrc, INT widthSrc, INT heightSrc, DWORD rop ) { @@ -191,7 +191,7 @@ BOOL EMFDRV_StretchBlt( rop, EMR_STRETCHBLT ); } -INT EMFDRV_StretchDIBits( PHYSDEV dev, INT xDst, INT yDst, INT widthDst, +INT CDECL EMFDRV_StretchDIBits( PHYSDEV dev, INT xDst, INT yDst, INT widthDst, INT heightDst, INT xSrc, INT ySrc, INT widthSrc, INT heightSrc, const void *bits, const BITMAPINFO *info, @@ -254,7 +254,7 @@ INT EMFDRV_StretchDIBits( PHYSDEV dev, INT xDst, INT yDst, INT widthDst, return ret ? heightSrc : GDI_ERROR; } -INT EMFDRV_SetDIBitsToDevice( +INT CDECL EMFDRV_SetDIBitsToDevice( PHYSDEV dev, INT xDst, INT yDst, DWORD width, DWORD height, INT xSrc, INT ySrc, UINT startscan, UINT lines, LPCVOID bits, const BITMAPINFO *info, UINT wUsage ) diff --git a/dlls/gdi32/enhmfdrv/dc.c b/dlls/gdi32/enhmfdrv/dc.c index 01159916023..f08b17da087 100644 --- a/dlls/gdi32/enhmfdrv/dc.c +++ b/dlls/gdi32/enhmfdrv/dc.c @@ -23,7 +23,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(enhmetafile); -INT EMFDRV_SaveDC( PHYSDEV dev ) +INT CDECL EMFDRV_SaveDC( PHYSDEV dev ) { EMRSAVEDC emr; emr.emr.iType = EMR_SAVEDC; @@ -31,7 +31,7 @@ INT EMFDRV_SaveDC( PHYSDEV dev ) return EMFDRV_WriteRecord( dev, &emr.emr ); } -BOOL EMFDRV_RestoreDC( PHYSDEV dev, INT level ) +BOOL CDECL EMFDRV_RestoreDC( PHYSDEV dev, INT level ) { EMFDRV_PDEVICE* physDev = (EMFDRV_PDEVICE*)dev; DC *dc = get_dc_ptr( physDev->hdc ); @@ -51,7 +51,7 @@ BOOL EMFDRV_RestoreDC( PHYSDEV dev, INT level ) return TRUE; } -UINT EMFDRV_SetTextAlign( PHYSDEV dev, UINT align ) +UINT CDECL EMFDRV_SetTextAlign( PHYSDEV dev, UINT align ) { EMRSETTEXTALIGN emr; emr.emr.iType = EMR_SETTEXTALIGN; @@ -60,7 +60,7 @@ UINT EMFDRV_SetTextAlign( PHYSDEV dev, UINT align ) return EMFDRV_WriteRecord( dev, &emr.emr ); } -BOOL EMFDRV_SetTextJustification(PHYSDEV dev, INT nBreakExtra, INT nBreakCount) +BOOL CDECL EMFDRV_SetTextJustification(PHYSDEV dev, INT nBreakExtra, INT nBreakCount) { EMRSETTEXTJUSTIFICATION emr; emr.emr.iType = EMR_SETTEXTJUSTIFICATION; @@ -70,7 +70,7 @@ BOOL EMFDRV_SetTextJustification(PHYSDEV dev, INT nBreakExtra, INT nBreakCount) return EMFDRV_WriteRecord(dev, &emr.emr); } -INT EMFDRV_SetBkMode( PHYSDEV dev, INT mode ) +INT CDECL EMFDRV_SetBkMode( PHYSDEV dev, INT mode ) { EMRSETBKMODE emr; emr.emr.iType = EMR_SETBKMODE; @@ -79,7 +79,7 @@ INT EMFDRV_SetBkMode( PHYSDEV dev, INT mode ) return EMFDRV_WriteRecord( dev, &emr.emr ); } -INT EMFDRV_SetROP2( PHYSDEV dev, INT rop ) +INT CDECL EMFDRV_SetROP2( PHYSDEV dev, INT rop ) { EMRSETROP2 emr; emr.emr.iType = EMR_SETROP2; @@ -88,7 +88,7 @@ INT EMFDRV_SetROP2( PHYSDEV dev, INT rop ) return EMFDRV_WriteRecord( dev, &emr.emr ); } -INT EMFDRV_SetPolyFillMode( PHYSDEV dev, INT mode ) +INT CDECL EMFDRV_SetPolyFillMode( PHYSDEV dev, INT mode ) { EMRSETPOLYFILLMODE emr; emr.emr.iType = EMR_SETPOLYFILLMODE; @@ -97,7 +97,7 @@ INT EMFDRV_SetPolyFillMode( PHYSDEV dev, INT mode ) return EMFDRV_WriteRecord( dev, &emr.emr ); } -INT EMFDRV_SetStretchBltMode( PHYSDEV dev, INT mode ) +INT CDECL EMFDRV_SetStretchBltMode( PHYSDEV dev, INT mode ) { EMRSETSTRETCHBLTMODE emr; emr.emr.iType = EMR_SETSTRETCHBLTMODE; @@ -106,7 +106,7 @@ INT EMFDRV_SetStretchBltMode( PHYSDEV dev, INT mode ) return EMFDRV_WriteRecord( dev, &emr.emr ); } -INT EMFDRV_ExcludeClipRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom ) +INT CDECL EMFDRV_ExcludeClipRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom ) { EMREXCLUDECLIPRECT emr; emr.emr.iType = EMR_EXCLUDECLIPRECT; @@ -118,7 +118,7 @@ INT EMFDRV_ExcludeClipRect( PHYSDEV dev, INT left, INT top, INT right, INT botto return EMFDRV_WriteRecord( dev, &emr.emr ); } -INT EMFDRV_IntersectClipRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom) +INT CDECL EMFDRV_IntersectClipRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom) { EMRINTERSECTCLIPRECT emr; emr.emr.iType = EMR_INTERSECTCLIPRECT; @@ -130,7 +130,7 @@ INT EMFDRV_IntersectClipRect( PHYSDEV dev, INT left, INT top, INT right, INT bot return EMFDRV_WriteRecord( dev, &emr.emr ); } -INT EMFDRV_OffsetClipRgn( PHYSDEV dev, INT x, INT y ) +INT CDECL EMFDRV_OffsetClipRgn( PHYSDEV dev, INT x, INT y ) { EMROFFSETCLIPRGN emr; emr.emr.iType = EMR_OFFSETCLIPRGN; @@ -140,7 +140,7 @@ INT EMFDRV_OffsetClipRgn( PHYSDEV dev, INT x, INT y ) return EMFDRV_WriteRecord( dev, &emr.emr ); } -INT EMFDRV_ExtSelectClipRgn( PHYSDEV dev, HRGN hrgn, INT mode ) +INT CDECL EMFDRV_ExtSelectClipRgn( PHYSDEV dev, HRGN hrgn, INT mode ) { EMREXTSELECTCLIPRGN *emr; DWORD size, rgnsize; @@ -167,7 +167,7 @@ INT EMFDRV_ExtSelectClipRgn( PHYSDEV dev, HRGN hrgn, INT mode ) return ret ? SIMPLEREGION : ERROR; } -DWORD EMFDRV_SetMapperFlags( PHYSDEV dev, DWORD flags ) +DWORD CDECL EMFDRV_SetMapperFlags( PHYSDEV dev, DWORD flags ) { EMRSETMAPPERFLAGS emr; @@ -178,7 +178,7 @@ DWORD EMFDRV_SetMapperFlags( PHYSDEV dev, DWORD flags ) return EMFDRV_WriteRecord( dev, &emr.emr ); } -BOOL EMFDRV_AbortPath( PHYSDEV dev ) +BOOL CDECL EMFDRV_AbortPath( PHYSDEV dev ) { EMRABORTPATH emr; @@ -188,7 +188,7 @@ BOOL EMFDRV_AbortPath( PHYSDEV dev ) return EMFDRV_WriteRecord( dev, &emr.emr ); } -BOOL EMFDRV_BeginPath( PHYSDEV dev ) +BOOL CDECL EMFDRV_BeginPath( PHYSDEV dev ) { EMRBEGINPATH emr; @@ -198,7 +198,7 @@ BOOL EMFDRV_BeginPath( PHYSDEV dev ) return EMFDRV_WriteRecord( dev, &emr.emr ); } -BOOL EMFDRV_CloseFigure( PHYSDEV dev ) +BOOL CDECL EMFDRV_CloseFigure( PHYSDEV dev ) { EMRCLOSEFIGURE emr; @@ -208,7 +208,7 @@ BOOL EMFDRV_CloseFigure( PHYSDEV dev ) return EMFDRV_WriteRecord( dev, &emr.emr ); } -BOOL EMFDRV_EndPath( PHYSDEV dev ) +BOOL CDECL EMFDRV_EndPath( PHYSDEV dev ) { EMRENDPATH emr; @@ -218,7 +218,7 @@ BOOL EMFDRV_EndPath( PHYSDEV dev ) return EMFDRV_WriteRecord( dev, &emr.emr ); } -BOOL EMFDRV_FillPath( PHYSDEV dev ) +BOOL CDECL EMFDRV_FillPath( PHYSDEV dev ) { EMRFILLPATH emr; @@ -232,7 +232,7 @@ BOOL EMFDRV_FillPath( PHYSDEV dev ) return EMFDRV_WriteRecord( dev, &emr.emr ); } -BOOL EMFDRV_FlattenPath( PHYSDEV dev ) +BOOL CDECL EMFDRV_FlattenPath( PHYSDEV dev ) { EMRFLATTENPATH emr; @@ -242,7 +242,7 @@ BOOL EMFDRV_FlattenPath( PHYSDEV dev ) return EMFDRV_WriteRecord( dev, &emr.emr ); } -BOOL EMFDRV_SelectClipPath( PHYSDEV dev, INT iMode ) +BOOL CDECL EMFDRV_SelectClipPath( PHYSDEV dev, INT iMode ) { EMRSELECTCLIPPATH emr; @@ -253,7 +253,7 @@ BOOL EMFDRV_SelectClipPath( PHYSDEV dev, INT iMode ) return EMFDRV_WriteRecord( dev, &emr.emr ); } -BOOL EMFDRV_StrokeAndFillPath( PHYSDEV dev ) +BOOL CDECL EMFDRV_StrokeAndFillPath( PHYSDEV dev ) { EMRSTROKEANDFILLPATH emr; @@ -267,7 +267,7 @@ BOOL EMFDRV_StrokeAndFillPath( PHYSDEV dev ) return EMFDRV_WriteRecord( dev, &emr.emr ); } -BOOL EMFDRV_StrokePath( PHYSDEV dev ) +BOOL CDECL EMFDRV_StrokePath( PHYSDEV dev ) { EMRSTROKEPATH emr; @@ -281,7 +281,7 @@ BOOL EMFDRV_StrokePath( PHYSDEV dev ) return EMFDRV_WriteRecord( dev, &emr.emr ); } -BOOL EMFDRV_WidenPath( PHYSDEV dev ) +BOOL CDECL EMFDRV_WidenPath( PHYSDEV dev ) { EMRWIDENPATH emr; @@ -291,7 +291,7 @@ BOOL EMFDRV_WidenPath( PHYSDEV dev ) return EMFDRV_WriteRecord( dev, &emr.emr ); } -INT EMFDRV_GetDeviceCaps(PHYSDEV dev, INT cap) +INT CDECL EMFDRV_GetDeviceCaps(PHYSDEV dev, INT cap) { EMFDRV_PDEVICE *physDev = (EMFDRV_PDEVICE*) dev; diff --git a/dlls/gdi32/enhmfdrv/enhmetafiledrv.h b/dlls/gdi32/enhmfdrv/enhmetafiledrv.h dissimilarity index 77% index c00c65364a9..f7a417d4c9f 100644 --- a/dlls/gdi32/enhmfdrv/enhmetafiledrv.h +++ b/dlls/gdi32/enhmfdrv/enhmetafiledrv.h @@ -1,163 +1,163 @@ -/* - * Enhanced MetaFile driver definitions - * - * Copyright 1999 Huw D M Davies - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#ifndef __WINE_ENHMETAFILEDRV_H -#define __WINE_ENHMETAFILEDRV_H - -#include - -#include "windef.h" -#include "winbase.h" -#include "wingdi.h" -#include "gdi_private.h" - -/* Enhanced Metafile driver physical DC */ - -typedef struct -{ - HDC hdc; - ENHMETAHEADER *emh; /* Pointer to enhanced metafile header */ - UINT handles_size, cur_handles; - HGDIOBJ *handles; - HANDLE hFile; /* Handle for disk based MetaFile */ - INT horzres, vertres; - INT horzsize, vertsize; - INT logpixelsx, logpixelsy; - INT bitspixel; - INT textcaps; - INT rastercaps; - INT technology; - INT planes; - INT numcolors; -} EMFDRV_PDEVICE; - - -extern BOOL EMFDRV_WriteRecord( PHYSDEV dev, EMR *emr ) DECLSPEC_HIDDEN; -extern void EMFDRV_UpdateBBox( PHYSDEV dev, RECTL *rect ) DECLSPEC_HIDDEN; -extern DWORD EMFDRV_CreateBrushIndirect( PHYSDEV dev, HBRUSH hBrush ) DECLSPEC_HIDDEN; - -#define HANDLE_LIST_INC 20 - -/* Metafile driver functions */ -extern BOOL EMFDRV_AbortPath( PHYSDEV dev ) DECLSPEC_HIDDEN; -extern BOOL EMFDRV_Arc( PHYSDEV dev, INT left, INT top, INT right, - INT bottom, INT xstart, INT ystart, INT xend, - INT yend ) DECLSPEC_HIDDEN; -extern BOOL EMFDRV_BeginPath( PHYSDEV dev ) DECLSPEC_HIDDEN; -extern BOOL EMFDRV_BitBlt( PHYSDEV devDst, INT xDst, INT yDst, - INT width, INT height, PHYSDEV devSrc, - INT xSrc, INT ySrc, DWORD rop ) DECLSPEC_HIDDEN; -extern BOOL EMFDRV_Chord( PHYSDEV dev, INT left, INT top, INT right, - INT bottom, INT xstart, INT ystart, INT xend, - INT yend ) DECLSPEC_HIDDEN; -extern BOOL EMFDRV_CloseFigure( PHYSDEV dev ) DECLSPEC_HIDDEN; -extern BOOL EMFDRV_DeleteObject( PHYSDEV dev, HGDIOBJ obj ) DECLSPEC_HIDDEN; -extern BOOL EMFDRV_Ellipse( PHYSDEV dev, INT left, INT top, - INT right, INT bottom ) DECLSPEC_HIDDEN; -extern BOOL EMFDRV_EndPath( PHYSDEV dev ) DECLSPEC_HIDDEN; -extern INT EMFDRV_ExcludeClipRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom ) DECLSPEC_HIDDEN; -extern BOOL EMFDRV_ExtFloodFill( PHYSDEV dev, INT x, INT y, COLORREF color, UINT fillType ) DECLSPEC_HIDDEN; -extern INT EMFDRV_ExtSelectClipRgn( PHYSDEV dev, HRGN hrgn, INT mode ) DECLSPEC_HIDDEN; -extern BOOL EMFDRV_ExtTextOut( PHYSDEV dev, INT x, INT y, - UINT flags, const RECT *lprect, LPCWSTR str, - UINT count, const INT *lpDx ) DECLSPEC_HIDDEN; -extern BOOL EMFDRV_FillPath( PHYSDEV dev ) DECLSPEC_HIDDEN; -extern BOOL EMFDRV_FillRgn( PHYSDEV dev, HRGN hrgn, HBRUSH hbrush ) DECLSPEC_HIDDEN; -extern BOOL EMFDRV_FlattenPath( PHYSDEV dev ) DECLSPEC_HIDDEN; -extern BOOL EMFDRV_FrameRgn( PHYSDEV dev, HRGN hrgn, HBRUSH hbrush, INT width, - INT height ) DECLSPEC_HIDDEN; -extern BOOL EMFDRV_GdiComment( PHYSDEV dev, UINT bytes, CONST BYTE *buffer ) DECLSPEC_HIDDEN; -extern INT EMFDRV_GetDeviceCaps( PHYSDEV dev, INT cap ) DECLSPEC_HIDDEN; -extern INT EMFDRV_IntersectClipRect( PHYSDEV dev, INT left, INT top, INT right, - INT bottom ) DECLSPEC_HIDDEN; -extern BOOL EMFDRV_InvertRgn( PHYSDEV dev, HRGN hrgn ) DECLSPEC_HIDDEN; -extern BOOL EMFDRV_LineTo( PHYSDEV dev, INT x, INT y ) DECLSPEC_HIDDEN; -extern BOOL EMFDRV_ModifyWorldTransform( PHYSDEV dev, const XFORM *xform, INT mode ) DECLSPEC_HIDDEN; -extern BOOL EMFDRV_MoveTo( PHYSDEV dev, INT x, INT y ) DECLSPEC_HIDDEN; -extern INT EMFDRV_OffsetClipRgn( PHYSDEV dev, INT x, INT y ) DECLSPEC_HIDDEN; -extern INT EMFDRV_OffsetViewportOrg( PHYSDEV dev, INT x, INT y ) DECLSPEC_HIDDEN; -extern INT EMFDRV_OffsetWindowOrg( PHYSDEV dev, INT x, INT y ) DECLSPEC_HIDDEN; -extern BOOL EMFDRV_PaintRgn( PHYSDEV dev, HRGN hrgn ) DECLSPEC_HIDDEN; -extern BOOL EMFDRV_PatBlt( PHYSDEV dev, INT left, INT top, - INT width, INT height, DWORD rop ) DECLSPEC_HIDDEN; -extern BOOL EMFDRV_Pie( PHYSDEV dev, INT left, INT top, INT right, - INT bottom, INT xstart, INT ystart, INT xend, - INT yend ) DECLSPEC_HIDDEN; -extern BOOL EMFDRV_PolyPolygon( PHYSDEV dev, const POINT* pt, - const INT* counts, UINT polys) DECLSPEC_HIDDEN; -extern BOOL EMFDRV_PolyPolyline( PHYSDEV dev, const POINT* pt, - const DWORD* counts, DWORD polys) DECLSPEC_HIDDEN; -extern BOOL EMFDRV_Polygon( PHYSDEV dev, const POINT* pt, INT count ) DECLSPEC_HIDDEN; -extern BOOL EMFDRV_Polyline( PHYSDEV dev, const POINT* pt,INT count) DECLSPEC_HIDDEN; -extern BOOL EMFDRV_Rectangle( PHYSDEV dev, INT left, INT top, - INT right, INT bottom) DECLSPEC_HIDDEN; -extern BOOL EMFDRV_RestoreDC( PHYSDEV dev, INT level ) DECLSPEC_HIDDEN; -extern BOOL EMFDRV_RoundRect( PHYSDEV dev, INT left, INT top, - INT right, INT bottom, INT ell_width, - INT ell_height ) DECLSPEC_HIDDEN; -extern INT EMFDRV_SaveDC( PHYSDEV dev ) DECLSPEC_HIDDEN; -extern INT EMFDRV_ScaleViewportExt( PHYSDEV dev, INT xNum, - INT xDenom, INT yNum, INT yDenom ) DECLSPEC_HIDDEN; -extern INT EMFDRV_ScaleWindowExt( PHYSDEV dev, INT xNum, INT xDenom, - INT yNum, INT yDenom ) DECLSPEC_HIDDEN; -extern HBITMAP EMFDRV_SelectBitmap( PHYSDEV dev, HBITMAP handle ) DECLSPEC_HIDDEN; -extern HBRUSH EMFDRV_SelectBrush( PHYSDEV dev, HBRUSH handle ) DECLSPEC_HIDDEN; -extern BOOL EMFDRV_SelectClipPath( PHYSDEV dev, INT iMode ) DECLSPEC_HIDDEN; -extern HFONT EMFDRV_SelectFont( PHYSDEV dev, HFONT handle, HANDLE gdiFont ) DECLSPEC_HIDDEN; -extern HPEN EMFDRV_SelectPen( PHYSDEV dev, HPEN handle ) DECLSPEC_HIDDEN; -extern HPALETTE EMFDRV_SelectPalette( PHYSDEV dev, HPALETTE hPal, BOOL force ) DECLSPEC_HIDDEN; -extern INT EMFDRV_SetArcDirection( PHYSDEV dev, INT arcDirection ) DECLSPEC_HIDDEN; -extern COLORREF EMFDRV_SetBkColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN; -extern INT EMFDRV_SetBkMode( PHYSDEV dev, INT mode ) DECLSPEC_HIDDEN; -extern INT EMFDRV_SetDIBitsToDevice( PHYSDEV dev, INT xDest, INT yDest, - DWORD cx, DWORD cy, INT xSrc, - INT ySrc, UINT startscan, UINT lines, - LPCVOID bits, const BITMAPINFO *info, - UINT coloruse ) DECLSPEC_HIDDEN; -extern INT EMFDRV_SetMapMode( PHYSDEV dev, INT mode ) DECLSPEC_HIDDEN; -extern DWORD EMFDRV_SetMapperFlags( PHYSDEV dev, DWORD flags ) DECLSPEC_HIDDEN; -extern COLORREF EMFDRV_SetPixel( PHYSDEV dev, INT x, INT y, COLORREF color ) DECLSPEC_HIDDEN; -extern INT EMFDRV_SetPolyFillMode( PHYSDEV dev, INT mode ) DECLSPEC_HIDDEN; -extern INT EMFDRV_SetROP2( PHYSDEV dev, INT rop ) DECLSPEC_HIDDEN; -extern INT EMFDRV_SetStretchBltMode( PHYSDEV dev, INT mode ) DECLSPEC_HIDDEN; -extern UINT EMFDRV_SetTextAlign( PHYSDEV dev, UINT align ) DECLSPEC_HIDDEN; -extern COLORREF EMFDRV_SetTextColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN; -extern BOOL EMFDRV_SetTextJustification( PHYSDEV dev, INT nBreakExtra, - INT nBreakCount ) DECLSPEC_HIDDEN; -extern INT EMFDRV_SetViewportExt( PHYSDEV dev, INT x, INT y ) DECLSPEC_HIDDEN; -extern INT EMFDRV_SetViewportOrg( PHYSDEV dev, INT x, INT y ) DECLSPEC_HIDDEN; -extern INT EMFDRV_SetWindowExt( PHYSDEV dev, INT x, INT y ) DECLSPEC_HIDDEN; -extern INT EMFDRV_SetWindowOrg( PHYSDEV dev, INT x, INT y ) DECLSPEC_HIDDEN; -extern BOOL EMFDRV_SetWorldTransform( PHYSDEV dev, const XFORM *xform ) DECLSPEC_HIDDEN; -extern BOOL EMFDRV_StretchBlt( PHYSDEV devDst, INT xDst, INT yDst, - INT widthDst, INT heightDst, - PHYSDEV devSrc, INT xSrc, INT ySrc, - INT widthSrc, INT heightSrc, DWORD rop ) DECLSPEC_HIDDEN; -extern INT EMFDRV_StretchDIBits( PHYSDEV dev, INT xDst, INT yDst, INT widthDst, - INT heightDst, INT xSrc, INT ySrc, - INT widthSrc, INT heightSrc, - const void *bits, const BITMAPINFO *info, - UINT wUsage, DWORD dwRop ) DECLSPEC_HIDDEN; -extern BOOL EMFDRV_StrokeAndFillPath( PHYSDEV dev ) DECLSPEC_HIDDEN; -extern BOOL EMFDRV_StrokePath( PHYSDEV dev ) DECLSPEC_HIDDEN; -extern BOOL EMFDRV_WidenPath( PHYSDEV dev ) DECLSPEC_HIDDEN; - - -#endif /* __WINE_METAFILEDRV_H */ +/* + * Enhanced MetaFile driver definitions + * + * Copyright 1999 Huw D M Davies + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef __WINE_ENHMETAFILEDRV_H +#define __WINE_ENHMETAFILEDRV_H + +#include + +#include "windef.h" +#include "winbase.h" +#include "wingdi.h" +#include "gdi_private.h" + +/* Enhanced Metafile driver physical DC */ + +typedef struct +{ + HDC hdc; + ENHMETAHEADER *emh; /* Pointer to enhanced metafile header */ + UINT handles_size, cur_handles; + HGDIOBJ *handles; + HANDLE hFile; /* Handle for disk based MetaFile */ + INT horzres, vertres; + INT horzsize, vertsize; + INT logpixelsx, logpixelsy; + INT bitspixel; + INT textcaps; + INT rastercaps; + INT technology; + INT planes; + INT numcolors; +} EMFDRV_PDEVICE; + + +extern BOOL EMFDRV_WriteRecord( PHYSDEV dev, EMR *emr ) DECLSPEC_HIDDEN; +extern void EMFDRV_UpdateBBox( PHYSDEV dev, RECTL *rect ) DECLSPEC_HIDDEN; +extern DWORD EMFDRV_CreateBrushIndirect( PHYSDEV dev, HBRUSH hBrush ) DECLSPEC_HIDDEN; + +#define HANDLE_LIST_INC 20 + +/* Metafile driver functions */ +extern BOOL CDECL EMFDRV_AbortPath( PHYSDEV dev ) DECLSPEC_HIDDEN; +extern BOOL CDECL EMFDRV_Arc( PHYSDEV dev, INT left, INT top, INT right, + INT bottom, INT xstart, INT ystart, INT xend, + INT yend ) DECLSPEC_HIDDEN; +extern BOOL CDECL EMFDRV_BeginPath( PHYSDEV dev ) DECLSPEC_HIDDEN; +extern BOOL CDECL EMFDRV_BitBlt( PHYSDEV devDst, INT xDst, INT yDst, + INT width, INT height, PHYSDEV devSrc, + INT xSrc, INT ySrc, DWORD rop ) DECLSPEC_HIDDEN; +extern BOOL CDECL EMFDRV_Chord( PHYSDEV dev, INT left, INT top, INT right, + INT bottom, INT xstart, INT ystart, INT xend, + INT yend ) DECLSPEC_HIDDEN; +extern BOOL CDECL EMFDRV_CloseFigure( PHYSDEV dev ) DECLSPEC_HIDDEN; +extern BOOL CDECL EMFDRV_DeleteObject( PHYSDEV dev, HGDIOBJ obj ) DECLSPEC_HIDDEN; +extern BOOL CDECL EMFDRV_Ellipse( PHYSDEV dev, INT left, INT top, + INT right, INT bottom ) DECLSPEC_HIDDEN; +extern BOOL CDECL EMFDRV_EndPath( PHYSDEV dev ) DECLSPEC_HIDDEN; +extern INT CDECL EMFDRV_ExcludeClipRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom ) DECLSPEC_HIDDEN; +extern BOOL CDECL EMFDRV_ExtFloodFill( PHYSDEV dev, INT x, INT y, COLORREF color, UINT fillType ) DECLSPEC_HIDDEN; +extern INT CDECL EMFDRV_ExtSelectClipRgn( PHYSDEV dev, HRGN hrgn, INT mode ) DECLSPEC_HIDDEN; +extern BOOL CDECL EMFDRV_ExtTextOut( PHYSDEV dev, INT x, INT y, + UINT flags, const RECT *lprect, LPCWSTR str, + UINT count, const INT *lpDx ) DECLSPEC_HIDDEN; +extern BOOL CDECL EMFDRV_FillPath( PHYSDEV dev ) DECLSPEC_HIDDEN; +extern BOOL CDECL EMFDRV_FillRgn( PHYSDEV dev, HRGN hrgn, HBRUSH hbrush ) DECLSPEC_HIDDEN; +extern BOOL CDECL EMFDRV_FlattenPath( PHYSDEV dev ) DECLSPEC_HIDDEN; +extern BOOL CDECL EMFDRV_FrameRgn( PHYSDEV dev, HRGN hrgn, HBRUSH hbrush, INT width, + INT height ) DECLSPEC_HIDDEN; +extern BOOL CDECL EMFDRV_GdiComment( PHYSDEV dev, UINT bytes, CONST BYTE *buffer ) DECLSPEC_HIDDEN; +extern INT CDECL EMFDRV_GetDeviceCaps( PHYSDEV dev, INT cap ) DECLSPEC_HIDDEN; +extern INT CDECL EMFDRV_IntersectClipRect( PHYSDEV dev, INT left, INT top, INT right, + INT bottom ) DECLSPEC_HIDDEN; +extern BOOL CDECL EMFDRV_InvertRgn( PHYSDEV dev, HRGN hrgn ) DECLSPEC_HIDDEN; +extern BOOL CDECL EMFDRV_LineTo( PHYSDEV dev, INT x, INT y ) DECLSPEC_HIDDEN; +extern BOOL CDECL EMFDRV_ModifyWorldTransform( PHYSDEV dev, const XFORM *xform, INT mode ) DECLSPEC_HIDDEN; +extern BOOL CDECL EMFDRV_MoveTo( PHYSDEV dev, INT x, INT y ) DECLSPEC_HIDDEN; +extern INT CDECL EMFDRV_OffsetClipRgn( PHYSDEV dev, INT x, INT y ) DECLSPEC_HIDDEN; +extern INT CDECL EMFDRV_OffsetViewportOrg( PHYSDEV dev, INT x, INT y ) DECLSPEC_HIDDEN; +extern INT CDECL EMFDRV_OffsetWindowOrg( PHYSDEV dev, INT x, INT y ) DECLSPEC_HIDDEN; +extern BOOL CDECL EMFDRV_PaintRgn( PHYSDEV dev, HRGN hrgn ) DECLSPEC_HIDDEN; +extern BOOL CDECL EMFDRV_PatBlt( PHYSDEV dev, INT left, INT top, + INT width, INT height, DWORD rop ) DECLSPEC_HIDDEN; +extern BOOL CDECL EMFDRV_Pie( PHYSDEV dev, INT left, INT top, INT right, + INT bottom, INT xstart, INT ystart, INT xend, + INT yend ) DECLSPEC_HIDDEN; +extern BOOL CDECL EMFDRV_PolyPolygon( PHYSDEV dev, const POINT* pt, + const INT* counts, UINT polys) DECLSPEC_HIDDEN; +extern BOOL CDECL EMFDRV_PolyPolyline( PHYSDEV dev, const POINT* pt, + const DWORD* counts, DWORD polys) DECLSPEC_HIDDEN; +extern BOOL CDECL EMFDRV_Polygon( PHYSDEV dev, const POINT* pt, INT count ) DECLSPEC_HIDDEN; +extern BOOL CDECL EMFDRV_Polyline( PHYSDEV dev, const POINT* pt,INT count) DECLSPEC_HIDDEN; +extern BOOL CDECL EMFDRV_Rectangle( PHYSDEV dev, INT left, INT top, + INT right, INT bottom) DECLSPEC_HIDDEN; +extern BOOL CDECL EMFDRV_RestoreDC( PHYSDEV dev, INT level ) DECLSPEC_HIDDEN; +extern BOOL CDECL EMFDRV_RoundRect( PHYSDEV dev, INT left, INT top, + INT right, INT bottom, INT ell_width, + INT ell_height ) DECLSPEC_HIDDEN; +extern INT CDECL EMFDRV_SaveDC( PHYSDEV dev ) DECLSPEC_HIDDEN; +extern INT CDECL EMFDRV_ScaleViewportExt( PHYSDEV dev, INT xNum, + INT xDenom, INT yNum, INT yDenom ) DECLSPEC_HIDDEN; +extern INT CDECL EMFDRV_ScaleWindowExt( PHYSDEV dev, INT xNum, INT xDenom, + INT yNum, INT yDenom ) DECLSPEC_HIDDEN; +extern HBITMAP CDECL EMFDRV_SelectBitmap( PHYSDEV dev, HBITMAP handle ) DECLSPEC_HIDDEN; +extern HBRUSH CDECL EMFDRV_SelectBrush( PHYSDEV dev, HBRUSH handle ) DECLSPEC_HIDDEN; +extern BOOL CDECL EMFDRV_SelectClipPath( PHYSDEV dev, INT iMode ) DECLSPEC_HIDDEN; +extern HFONT CDECL EMFDRV_SelectFont( PHYSDEV dev, HFONT handle, HANDLE gdiFont ) DECLSPEC_HIDDEN; +extern HPEN CDECL EMFDRV_SelectPen( PHYSDEV dev, HPEN handle ) DECLSPEC_HIDDEN; +extern HPALETTE CDECL EMFDRV_SelectPalette( PHYSDEV dev, HPALETTE hPal, BOOL force ) DECLSPEC_HIDDEN; +extern INT CDECL EMFDRV_SetArcDirection( PHYSDEV dev, INT arcDirection ) DECLSPEC_HIDDEN; +extern COLORREF CDECL EMFDRV_SetBkColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN; +extern INT CDECL EMFDRV_SetBkMode( PHYSDEV dev, INT mode ) DECLSPEC_HIDDEN; +extern INT CDECL EMFDRV_SetDIBitsToDevice( PHYSDEV dev, INT xDest, INT yDest, + DWORD cx, DWORD cy, INT xSrc, + INT ySrc, UINT startscan, UINT lines, + LPCVOID bits, const BITMAPINFO *info, + UINT coloruse ) DECLSPEC_HIDDEN; +extern INT CDECL EMFDRV_SetMapMode( PHYSDEV dev, INT mode ) DECLSPEC_HIDDEN; +extern DWORD CDECL EMFDRV_SetMapperFlags( PHYSDEV dev, DWORD flags ) DECLSPEC_HIDDEN; +extern COLORREF CDECL EMFDRV_SetPixel( PHYSDEV dev, INT x, INT y, COLORREF color ) DECLSPEC_HIDDEN; +extern INT CDECL EMFDRV_SetPolyFillMode( PHYSDEV dev, INT mode ) DECLSPEC_HIDDEN; +extern INT CDECL EMFDRV_SetROP2( PHYSDEV dev, INT rop ) DECLSPEC_HIDDEN; +extern INT CDECL EMFDRV_SetStretchBltMode( PHYSDEV dev, INT mode ) DECLSPEC_HIDDEN; +extern UINT CDECL EMFDRV_SetTextAlign( PHYSDEV dev, UINT align ) DECLSPEC_HIDDEN; +extern COLORREF CDECL EMFDRV_SetTextColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN; +extern BOOL CDECL EMFDRV_SetTextJustification( PHYSDEV dev, INT nBreakExtra, + INT nBreakCount ) DECLSPEC_HIDDEN; +extern INT CDECL EMFDRV_SetViewportExt( PHYSDEV dev, INT x, INT y ) DECLSPEC_HIDDEN; +extern INT CDECL EMFDRV_SetViewportOrg( PHYSDEV dev, INT x, INT y ) DECLSPEC_HIDDEN; +extern INT CDECL EMFDRV_SetWindowExt( PHYSDEV dev, INT x, INT y ) DECLSPEC_HIDDEN; +extern INT CDECL EMFDRV_SetWindowOrg( PHYSDEV dev, INT x, INT y ) DECLSPEC_HIDDEN; +extern BOOL CDECL EMFDRV_SetWorldTransform( PHYSDEV dev, const XFORM *xform ) DECLSPEC_HIDDEN; +extern BOOL CDECL EMFDRV_StretchBlt( PHYSDEV devDst, INT xDst, INT yDst, + INT widthDst, INT heightDst, + PHYSDEV devSrc, INT xSrc, INT ySrc, + INT widthSrc, INT heightSrc, DWORD rop ) DECLSPEC_HIDDEN; +extern INT CDECL EMFDRV_StretchDIBits( PHYSDEV dev, INT xDst, INT yDst, INT widthDst, + INT heightDst, INT xSrc, INT ySrc, + INT widthSrc, INT heightSrc, + const void *bits, const BITMAPINFO *info, + UINT wUsage, DWORD dwRop ) DECLSPEC_HIDDEN; +extern BOOL CDECL EMFDRV_StrokeAndFillPath( PHYSDEV dev ) DECLSPEC_HIDDEN; +extern BOOL CDECL EMFDRV_StrokePath( PHYSDEV dev ) DECLSPEC_HIDDEN; +extern BOOL CDECL EMFDRV_WidenPath( PHYSDEV dev ) DECLSPEC_HIDDEN; + + +#endif /* __WINE_METAFILEDRV_H */ diff --git a/dlls/gdi32/enhmfdrv/graphics.c b/dlls/gdi32/enhmfdrv/graphics.c index 28f34cd7afe..c7eace21726 100644 --- a/dlls/gdi32/enhmfdrv/graphics.c +++ b/dlls/gdi32/enhmfdrv/graphics.c @@ -36,7 +36,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(enhmetafile); /********************************************************************** * EMFDRV_MoveTo */ -BOOL +BOOL CDECL EMFDRV_MoveTo(PHYSDEV dev, INT x, INT y) { EMRMOVETOEX emr; @@ -52,7 +52,7 @@ EMFDRV_MoveTo(PHYSDEV dev, INT x, INT y) /*********************************************************************** * EMFDRV_LineTo */ -BOOL +BOOL CDECL EMFDRV_LineTo( PHYSDEV dev, INT x, INT y ) { POINT pt; @@ -188,7 +188,7 @@ EMFDRV_ArcChordPie( PHYSDEV dev, INT left, INT top, INT right, INT bottom, /*********************************************************************** * EMFDRV_Arc */ -BOOL +BOOL CDECL EMFDRV_Arc( PHYSDEV dev, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend ) { @@ -199,7 +199,7 @@ EMFDRV_Arc( PHYSDEV dev, INT left, INT top, INT right, INT bottom, /*********************************************************************** * EMFDRV_Pie */ -BOOL +BOOL CDECL EMFDRV_Pie( PHYSDEV dev, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend ) { @@ -211,7 +211,7 @@ EMFDRV_Pie( PHYSDEV dev, INT left, INT top, INT right, INT bottom, /*********************************************************************** * EMFDRV_Chord */ -BOOL +BOOL CDECL EMFDRV_Chord( PHYSDEV dev, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend ) { @@ -222,7 +222,7 @@ EMFDRV_Chord( PHYSDEV dev, INT left, INT top, INT right, INT bottom, /*********************************************************************** * EMFDRV_Ellipse */ -BOOL +BOOL CDECL EMFDRV_Ellipse( PHYSDEV dev, INT left, INT top, INT right, INT bottom ) { EMRELLIPSE emr; @@ -255,7 +255,7 @@ EMFDRV_Ellipse( PHYSDEV dev, INT left, INT top, INT right, INT bottom ) /*********************************************************************** * EMFDRV_Rectangle */ -BOOL +BOOL CDECL EMFDRV_Rectangle(PHYSDEV dev, INT left, INT top, INT right, INT bottom) { EMRRECTANGLE emr; @@ -288,7 +288,7 @@ EMFDRV_Rectangle(PHYSDEV dev, INT left, INT top, INT right, INT bottom) /*********************************************************************** * EMFDRV_RoundRect */ -BOOL +BOOL CDECL EMFDRV_RoundRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom, INT ell_width, INT ell_height ) { @@ -322,7 +322,7 @@ EMFDRV_RoundRect( PHYSDEV dev, INT left, INT top, INT right, /*********************************************************************** * EMFDRV_SetPixel */ -COLORREF +COLORREF CDECL EMFDRV_SetPixel( PHYSDEV dev, INT x, INT y, COLORREF color ) { EMRSETPIXELV emr; @@ -447,7 +447,7 @@ EMFDRV_Polylinegon16( PHYSDEV dev, const POINT* pt, INT count, DWORD iType ) /********************************************************************** * EMFDRV_Polyline */ -BOOL +BOOL CDECL EMFDRV_Polyline( PHYSDEV dev, const POINT* pt, INT count ) { if( EMFDRV_Polylinegon16( dev, pt, count, EMR_POLYLINE16 ) ) @@ -458,7 +458,7 @@ EMFDRV_Polyline( PHYSDEV dev, const POINT* pt, INT count ) /********************************************************************** * EMFDRV_Polygon */ -BOOL +BOOL CDECL EMFDRV_Polygon( PHYSDEV dev, const POINT* pt, INT count ) { if(count < 2) return FALSE; @@ -521,7 +521,7 @@ EMFDRV_PolyPolylinegon( PHYSDEV dev, const POINT* pt, const INT* counts, UINT po /********************************************************************** * EMFDRV_PolyPolyline */ -BOOL +BOOL CDECL EMFDRV_PolyPolyline(PHYSDEV dev, const POINT* pt, const DWORD* counts, DWORD polys) { return EMFDRV_PolyPolylinegon( dev, pt, (const INT *)counts, polys, @@ -531,7 +531,7 @@ EMFDRV_PolyPolyline(PHYSDEV dev, const POINT* pt, const DWORD* counts, DWORD pol /********************************************************************** * EMFDRV_PolyPolygon */ -BOOL +BOOL CDECL EMFDRV_PolyPolygon( PHYSDEV dev, const POINT* pt, const INT* counts, UINT polys ) { return EMFDRV_PolyPolylinegon( dev, pt, counts, polys, EMR_POLYPOLYGON ); @@ -541,7 +541,7 @@ EMFDRV_PolyPolygon( PHYSDEV dev, const POINT* pt, const INT* counts, UINT polys /********************************************************************** * EMFDRV_ExtFloodFill */ -BOOL +BOOL CDECL EMFDRV_ExtFloodFill( PHYSDEV dev, INT x, INT y, COLORREF color, UINT fillType ) { EMREXTFLOODFILL emr; @@ -560,7 +560,7 @@ EMFDRV_ExtFloodFill( PHYSDEV dev, INT x, INT y, COLORREF color, UINT fillType ) /********************************************************************* * EMFDRV_FillRgn */ -BOOL EMFDRV_FillRgn( PHYSDEV dev, HRGN hrgn, HBRUSH hbrush ) +BOOL CDECL EMFDRV_FillRgn( PHYSDEV dev, HRGN hrgn, HBRUSH hbrush ) { EMRFILLRGN *emr; DWORD size, rgnsize, index; @@ -593,7 +593,7 @@ BOOL EMFDRV_FillRgn( PHYSDEV dev, HRGN hrgn, HBRUSH hbrush ) /********************************************************************* * EMFDRV_FrameRgn */ -BOOL EMFDRV_FrameRgn( PHYSDEV dev, HRGN hrgn, HBRUSH hbrush, INT width, INT height ) +BOOL CDECL EMFDRV_FrameRgn( PHYSDEV dev, HRGN hrgn, HBRUSH hbrush, INT width, INT height ) { EMRFRAMERGN *emr; DWORD size, rgnsize, index; @@ -662,7 +662,7 @@ static BOOL EMFDRV_PaintInvertRgn( PHYSDEV dev, HRGN hrgn, DWORD iType ) /********************************************************************** * EMFDRV_PaintRgn */ -BOOL +BOOL CDECL EMFDRV_PaintRgn( PHYSDEV dev, HRGN hrgn ) { return EMFDRV_PaintInvertRgn( dev, hrgn, EMR_PAINTRGN ); @@ -671,7 +671,7 @@ EMFDRV_PaintRgn( PHYSDEV dev, HRGN hrgn ) /********************************************************************** * EMFDRV_InvertRgn */ -BOOL +BOOL CDECL EMFDRV_InvertRgn( PHYSDEV dev, HRGN hrgn ) { return EMFDRV_PaintInvertRgn( dev, hrgn, EMR_INVERTRGN ); @@ -680,7 +680,7 @@ EMFDRV_InvertRgn( PHYSDEV dev, HRGN hrgn ) /********************************************************************** * EMFDRV_SetBkColor */ -COLORREF +COLORREF CDECL EMFDRV_SetBkColor( PHYSDEV dev, COLORREF color ) { EMRSETBKCOLOR emr; @@ -696,7 +696,7 @@ EMFDRV_SetBkColor( PHYSDEV dev, COLORREF color ) /********************************************************************** * EMFDRV_SetTextColor */ -COLORREF +COLORREF CDECL EMFDRV_SetTextColor( PHYSDEV dev, COLORREF color ) { EMRSETTEXTCOLOR emr; @@ -711,9 +711,9 @@ EMFDRV_SetTextColor( PHYSDEV dev, COLORREF color ) /********************************************************************** * EMFDRV_ExtTextOut */ -BOOL EMFDRV_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags, - const RECT *lprect, LPCWSTR str, UINT count, - const INT *lpDx ) +BOOL CDECL EMFDRV_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags, + const RECT *lprect, LPCWSTR str, UINT count, + const INT *lpDx ) { EMREXTTEXTOUTW *pemr; DWORD nSize; @@ -832,7 +832,7 @@ no_bounds: /********************************************************************** * EMFDRV_SetArcDirection */ -INT EMFDRV_SetArcDirection(PHYSDEV dev, INT arcDirection) +INT CDECL EMFDRV_SetArcDirection(PHYSDEV dev, INT arcDirection) { EMRSETARCDIRECTION emr; diff --git a/dlls/gdi32/enhmfdrv/mapping.c b/dlls/gdi32/enhmfdrv/mapping.c index cc4f9969827..b72e0fc2d97 100644 --- a/dlls/gdi32/enhmfdrv/mapping.c +++ b/dlls/gdi32/enhmfdrv/mapping.c @@ -20,7 +20,7 @@ #include "enhmfdrv/enhmetafiledrv.h" -INT EMFDRV_SetMapMode( PHYSDEV dev, INT mode ) +INT CDECL EMFDRV_SetMapMode( PHYSDEV dev, INT mode ) { EMRSETMAPMODE emr; emr.emr.iType = EMR_SETMAPMODE; @@ -30,7 +30,7 @@ INT EMFDRV_SetMapMode( PHYSDEV dev, INT mode ) return EMFDRV_WriteRecord( dev, &emr.emr ); } -INT EMFDRV_SetViewportExt( PHYSDEV dev, INT cx, INT cy ) +INT CDECL EMFDRV_SetViewportExt( PHYSDEV dev, INT cx, INT cy ) { EMRSETVIEWPORTEXTEX emr; @@ -42,7 +42,7 @@ INT EMFDRV_SetViewportExt( PHYSDEV dev, INT cx, INT cy ) return EMFDRV_WriteRecord( dev, &emr.emr ); } -INT EMFDRV_SetWindowExt( PHYSDEV dev, INT cx, INT cy ) +INT CDECL EMFDRV_SetWindowExt( PHYSDEV dev, INT cx, INT cy ) { EMRSETWINDOWEXTEX emr; @@ -54,7 +54,7 @@ INT EMFDRV_SetWindowExt( PHYSDEV dev, INT cx, INT cy ) return EMFDRV_WriteRecord( dev, &emr.emr ); } -INT EMFDRV_SetViewportOrg( PHYSDEV dev, INT x, INT y ) +INT CDECL EMFDRV_SetViewportOrg( PHYSDEV dev, INT x, INT y ) { EMRSETVIEWPORTORGEX emr; @@ -66,7 +66,7 @@ INT EMFDRV_SetViewportOrg( PHYSDEV dev, INT x, INT y ) return EMFDRV_WriteRecord( dev, &emr.emr ); } -INT EMFDRV_SetWindowOrg( PHYSDEV dev, INT x, INT y ) +INT CDECL EMFDRV_SetWindowOrg( PHYSDEV dev, INT x, INT y ) { EMRSETWINDOWORGEX emr; @@ -78,8 +78,8 @@ INT EMFDRV_SetWindowOrg( PHYSDEV dev, INT x, INT y ) return EMFDRV_WriteRecord( dev, &emr.emr ); } -INT EMFDRV_ScaleViewportExt( PHYSDEV dev, INT xNum, INT xDenom, INT yNum, - INT yDenom ) +INT CDECL EMFDRV_ScaleViewportExt( PHYSDEV dev, INT xNum, INT xDenom, INT yNum, + INT yDenom ) { EMRSCALEVIEWPORTEXTEX emr; @@ -93,8 +93,8 @@ INT EMFDRV_ScaleViewportExt( PHYSDEV dev, INT xNum, INT xDenom, INT yNum, return EMFDRV_WriteRecord( dev, &emr.emr ); } -INT EMFDRV_ScaleWindowExt( PHYSDEV dev, INT xNum, INT xDenom, INT yNum, - INT yDenom ) +INT CDECL EMFDRV_ScaleWindowExt( PHYSDEV dev, INT xNum, INT xDenom, INT yNum, + INT yDenom ) { EMRSCALEWINDOWEXTEX emr; @@ -108,7 +108,7 @@ INT EMFDRV_ScaleWindowExt( PHYSDEV dev, INT xNum, INT xDenom, INT yNum, return EMFDRV_WriteRecord( dev, &emr.emr ); } -BOOL EMFDRV_SetWorldTransform( PHYSDEV dev, const XFORM *xform) +BOOL CDECL EMFDRV_SetWorldTransform( PHYSDEV dev, const XFORM *xform) { EMRSETWORLDTRANSFORM emr; @@ -119,7 +119,7 @@ BOOL EMFDRV_SetWorldTransform( PHYSDEV dev, const XFORM *xform) return EMFDRV_WriteRecord( dev, &emr.emr ); } -BOOL EMFDRV_ModifyWorldTransform( PHYSDEV dev, const XFORM *xform, INT mode) +BOOL CDECL EMFDRV_ModifyWorldTransform( PHYSDEV dev, const XFORM *xform, INT mode) { EMRMODIFYWORLDTRANSFORM emr; @@ -131,7 +131,7 @@ BOOL EMFDRV_ModifyWorldTransform( PHYSDEV dev, const XFORM *xform, INT mode) return EMFDRV_WriteRecord( dev, &emr.emr ); } -INT EMFDRV_OffsetViewportOrg( PHYSDEV dev, INT x, INT y ) +INT CDECL EMFDRV_OffsetViewportOrg( PHYSDEV dev, INT x, INT y ) { POINT pt; EMRSETVIEWPORTORGEX emr; @@ -147,7 +147,7 @@ INT EMFDRV_OffsetViewportOrg( PHYSDEV dev, INT x, INT y ) return EMFDRV_WriteRecord( dev, &emr.emr ); } -INT EMFDRV_OffsetWindowOrg( PHYSDEV dev, INT x, INT y ) +INT CDECL EMFDRV_OffsetWindowOrg( PHYSDEV dev, INT x, INT y ) { POINT pt; EMRSETWINDOWORGEX emr; diff --git a/dlls/gdi32/enhmfdrv/objects.c b/dlls/gdi32/enhmfdrv/objects.c index f46fed2e6a5..a1cf8cfdbcc 100644 --- a/dlls/gdi32/enhmfdrv/objects.c +++ b/dlls/gdi32/enhmfdrv/objects.c @@ -74,7 +74,7 @@ static UINT EMFDRV_FindObject( PHYSDEV dev, HGDIOBJ obj ) /****************************************************************** * EMFDRV_DeleteObject */ -BOOL EMFDRV_DeleteObject( PHYSDEV dev, HGDIOBJ obj ) +BOOL CDECL EMFDRV_DeleteObject( PHYSDEV dev, HGDIOBJ obj ) { EMRDELETEOBJECT emr; EMFDRV_PDEVICE *physDev = (EMFDRV_PDEVICE*) dev; @@ -99,7 +99,7 @@ BOOL EMFDRV_DeleteObject( PHYSDEV dev, HGDIOBJ obj ) /*********************************************************************** * EMFDRV_SelectBitmap */ -HBITMAP EMFDRV_SelectBitmap( PHYSDEV dev, HBITMAP hbitmap ) +HBITMAP CDECL EMFDRV_SelectBitmap( PHYSDEV dev, HBITMAP hbitmap ) { return 0; } @@ -273,7 +273,7 @@ DWORD EMFDRV_CreateBrushIndirect( PHYSDEV dev, HBRUSH hBrush ) /*********************************************************************** * EMFDRV_SelectBrush */ -HBRUSH EMFDRV_SelectBrush(PHYSDEV dev, HBRUSH hBrush ) +HBRUSH CDECL EMFDRV_SelectBrush(PHYSDEV dev, HBRUSH hBrush ) { EMFDRV_PDEVICE *physDev = (EMFDRV_PDEVICE*)dev; EMRSELECTOBJECT emr; @@ -350,7 +350,7 @@ static BOOL EMFDRV_CreateFontIndirect(PHYSDEV dev, HFONT hFont ) /*********************************************************************** * EMFDRV_SelectFont */ -HFONT EMFDRV_SelectFont( PHYSDEV dev, HFONT hFont, HANDLE gdiFont ) +HFONT CDECL EMFDRV_SelectFont( PHYSDEV dev, HFONT hFont, HANDLE gdiFont ) { EMFDRV_PDEVICE *physDev = (EMFDRV_PDEVICE*)dev; EMRSELECTOBJECT emr; @@ -429,7 +429,7 @@ static DWORD EMFDRV_CreatePenIndirect(PHYSDEV dev, HPEN hPen) /****************************************************************** * EMFDRV_SelectPen */ -HPEN EMFDRV_SelectPen(PHYSDEV dev, HPEN hPen ) +HPEN CDECL EMFDRV_SelectPen(PHYSDEV dev, HPEN hPen ) { EMFDRV_PDEVICE *physDev = (EMFDRV_PDEVICE*)dev; EMRSELECTOBJECT emr; @@ -495,7 +495,7 @@ static DWORD EMFDRV_CreatePalette(PHYSDEV dev, HPALETTE hPal) /****************************************************************** * EMFDRV_SelectPalette */ -HPALETTE EMFDRV_SelectPalette( PHYSDEV dev, HPALETTE hPal, BOOL force ) +HPALETTE CDECL EMFDRV_SelectPalette( PHYSDEV dev, HPALETTE hPal, BOOL force ) { EMFDRV_PDEVICE *physDev = (EMFDRV_PDEVICE*)dev; EMRSELECTPALETTE emr; @@ -524,7 +524,7 @@ found: /****************************************************************** * EMFDRV_GdiComment */ -BOOL EMFDRV_GdiComment(PHYSDEV dev, UINT bytes, CONST BYTE *buffer) +BOOL CDECL EMFDRV_GdiComment(PHYSDEV dev, UINT bytes, CONST BYTE *buffer) { EMRGDICOMMENT *emr; UINT total, rounded_size; diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index aac5fde3f96..9eb1d13c9ad 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -132,6 +132,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(font); #ifdef HAVE_FREETYPE_FTMODAPI_H #include #endif +#ifdef HAVE_FREETYPE_FTLCDFIL_H +#include +#endif #ifndef HAVE_FT_TRUETYPEENGINETYPE typedef enum @@ -179,11 +182,15 @@ MAKE_FUNCPTR(FT_Select_Charmap); MAKE_FUNCPTR(FT_Set_Charmap); MAKE_FUNCPTR(FT_Set_Pixel_Sizes); MAKE_FUNCPTR(FT_Vector_Transform); +MAKE_FUNCPTR(FT_Render_Glyph); static void (*pFT_Library_Version)(FT_Library,FT_Int*,FT_Int*,FT_Int*); static FT_Error (*pFT_Load_Sfnt_Table)(FT_Face,FT_ULong,FT_Long,FT_Byte*,FT_ULong*); static FT_ULong (*pFT_Get_First_Char)(FT_Face,FT_UInt*); static FT_ULong (*pFT_Get_Next_Char)(FT_Face,FT_ULong,FT_UInt*); static FT_TrueTypeEngineType (*pFT_Get_TrueType_Engine_Type)(FT_Library); +#ifdef HAVE_FREETYPE_FTLCDFIL_H +static FT_Error (*pFT_Library_SetLcdFilter)(FT_Library, FT_LcdFilter); +#endif #ifdef HAVE_FREETYPE_FTWINFNT_H MAKE_FUNCPTR(FT_Get_WinFNT_Header); #endif @@ -2481,6 +2488,7 @@ static BOOL init_freetype(void) LOAD_FUNCPTR(FT_Set_Charmap) LOAD_FUNCPTR(FT_Set_Pixel_Sizes) LOAD_FUNCPTR(FT_Vector_Transform) + LOAD_FUNCPTR(FT_Render_Glyph) #undef LOAD_FUNCPTR /* Don't warn if these ones are missing */ @@ -2489,6 +2497,9 @@ static BOOL init_freetype(void) pFT_Get_First_Char = wine_dlsym(ft_handle, "FT_Get_First_Char", NULL, 0); pFT_Get_Next_Char = wine_dlsym(ft_handle, "FT_Get_Next_Char", NULL, 0); pFT_Get_TrueType_Engine_Type = wine_dlsym(ft_handle, "FT_Get_TrueType_Engine_Type", NULL, 0); +#ifdef HAVE_FREETYPE_FTLCDFIL_H + pFT_Library_SetLcdFilter = wine_dlsym(ft_handle, "FT_Library_SetLcdFilter", NULL, 0); +#endif #ifdef HAVE_FREETYPE_FTWINFNT_H pFT_Get_WinFNT_Header = wine_dlsym(ft_handle, "FT_Get_WinFNT_Header", NULL, 0); #endif @@ -4491,8 +4502,12 @@ DWORD WineEngGetGlyphOutline(GdiFont *incoming_font, UINT glyph, UINT format, needsTransform = TRUE; } - if (needsTransform || (format != GGO_METRICS && format != GGO_BITMAP && format != WINE_GGO_GRAY16_BITMAP)) + if (needsTransform || (format == GGO_NATIVE || format == GGO_BEZIER || + format == GGO_GRAY2_BITMAP || format == GGO_GRAY4_BITMAP || + format == GGO_GRAY8_BITMAP)) + { load_flags |= FT_LOAD_NO_BITMAP; + } err = pFT_Load_Glyph(ft_face, glyph_index, load_flags); @@ -4563,7 +4578,9 @@ DWORD WineEngGetGlyphOutline(GdiFont *incoming_font, UINT glyph, UINT format, wine_dbgstr_point(&lpgm->gmptGlyphOrigin), lpgm->gmCellIncX, lpgm->gmCellIncY); - if ((format == GGO_METRICS || format == GGO_BITMAP || format == WINE_GGO_GRAY16_BITMAP) && + if ((format == GGO_METRICS || format == GGO_BITMAP || format == WINE_GGO_GRAY16_BITMAP || + format == WINE_GGO_HRGB_BITMAP || format == WINE_GGO_HBGR_BITMAP || + format == WINE_GGO_VRGB_BITMAP || format == WINE_GGO_VBGR_BITMAP ) && (!lpmat || is_identity_MAT2(lpmat))) /* don't cache custom transforms */ { FONT_GM(font,original_index)->gm = *lpgm; @@ -4579,7 +4596,11 @@ DWORD WineEngGetGlyphOutline(GdiFont *incoming_font, UINT glyph, UINT format, return 1; /* FIXME */ } - if(ft_face->glyph->format != ft_glyph_format_outline && format != GGO_BITMAP && format != WINE_GGO_GRAY16_BITMAP) { + if(ft_face->glyph->format != ft_glyph_format_outline && + (needsTransform || format == GGO_NATIVE || format == GGO_BEZIER || + format == GGO_GRAY2_BITMAP || format == GGO_GRAY4_BITMAP || + format == GGO_GRAY8_BITMAP)) + { TRACE("loaded a bitmap\n"); LeaveCriticalSection( &freetype_cs ); return GDI_ERROR; @@ -4714,6 +4735,117 @@ DWORD WineEngGetGlyphOutline(GdiFont *incoming_font, UINT glyph, UINT format, break; } + case WINE_GGO_HRGB_BITMAP: + case WINE_GGO_HBGR_BITMAP: + case WINE_GGO_VRGB_BITMAP: + case WINE_GGO_VBGR_BITMAP: +#ifdef HAVE_FREETYPE_FTLCDFIL_H + { + width = lpgm->gmBlackBoxX; + height = lpgm->gmBlackBoxY; + pitch = width * 4; + needed = pitch * height; + + if (!buf || !buflen) break; + + memset(buf, 0, buflen); + + switch (ft_face->glyph->format) + { + case FT_GLYPH_FORMAT_BITMAP: + { + BYTE *src = ft_face->glyph->bitmap.buffer, *dst = buf; + INT src_pitch = ft_face->glyph->bitmap.pitch; + INT x; + + while ( height-- ) + { + for (x = 0; x < width; x++) + { + if ( src[x / 8] & (1 << ( (7 - (x % 8)))) ) + ((unsigned int *)dst)[x] = ~0u; + } + src += src_pitch; + dst += pitch; + } + + break; + } + + case FT_GLYPH_FORMAT_OUTLINE: + { + unsigned int *dst = (unsigned int *) buf; + BYTE *src; + INT x, src_pitch, rgb_interval, hmul, vmul; + BOOL rgb = (format == WINE_GGO_HRGB_BITMAP || format == WINE_GGO_VRGB_BITMAP); + FT_LcdFilter lcdfilter = FT_LCD_FILTER_DEFAULT; + FT_Render_Mode render_mode = + (format == WINE_GGO_HRGB_BITMAP || format == WINE_GGO_HBGR_BITMAP)? + FT_RENDER_MODE_LCD: FT_RENDER_MODE_LCD_V; + + if ( needsTransform ) + pFT_Outline_Transform (&ft_face->glyph->outline, &transMat); + pFT_Outline_Translate (&ft_face->glyph->outline, -left, -bottom ); + if ( pFT_Library_SetLcdFilter ) + pFT_Library_SetLcdFilter( library, lcdfilter ); + pFT_Render_Glyph (ft_face->glyph, render_mode); + + src = ft_face->glyph->bitmap.buffer; + src_pitch = ft_face->glyph->bitmap.pitch; + if ( render_mode == FT_RENDER_MODE_LCD) + { + rgb_interval = 1; + hmul = 3; + vmul = 1; + } + else + { + rgb_interval = src_pitch; + hmul = 1; + vmul = 3; + } + + if ( lcdfilter == FT_LCD_FILTER_DEFAULT || lcdfilter == FT_LCD_FILTER_LIGHT ) + src += rgb_interval * 3; + while ( height-- ) + { + for ( x = 0; x < width; x++ ) + { + if ( rgb ) + { + dst[x] = ((unsigned int)src[hmul * x + rgb_interval * 0] << 16) | + ((unsigned int)src[hmul * x + rgb_interval * 1] << 8) | + ((unsigned int)src[hmul * x + rgb_interval * 2] << 0) | + ((unsigned int)src[hmul * x + rgb_interval * 1] << 24) ; + } + else + { + dst[x] = ((unsigned int)src[hmul * x + rgb_interval * 2] << 16) | + ((unsigned int)src[hmul * x + rgb_interval * 1] << 8) | + ((unsigned int)src[hmul * x + rgb_interval * 0] << 0) | + ((unsigned int)src[hmul * x + rgb_interval * 1] << 24) ; + } + } + src += src_pitch * vmul; + dst += pitch / 4; + } + + break; + } + + default: + FIXME ("loaded glyph format %x\n", ft_face->glyph->format); + LeaveCriticalSection ( &freetype_cs ); + return GDI_ERROR; + } + + break; + } +#else + LeaveCriticalSection( &freetype_cs ); + return GDI_ERROR; +#endif + case GGO_NATIVE: { int contour, point = 0, first_pt; @@ -5792,12 +5924,23 @@ static BOOL is_hinting_enabled(void) return FALSE; } +static BOOL is_subpixel_rendering_enabled( void ) +{ +#ifdef HAVE_FREETYPE_FTLCDFIL_H + return pFT_Library_SetLcdFilter && + pFT_Library_SetLcdFilter( NULL, 0 ) != FT_Err_Unimplemented_Feature; +#else + return FALSE; +#endif +} + /************************************************************************* * GetRasterizerCaps (GDI32.@) */ BOOL WINAPI GetRasterizerCaps( LPRASTERIZER_STATUS lprs, UINT cbNumBytes) { static int hinting = -1; + static int subpixel = -1; if(hinting == -1) { @@ -5805,8 +5948,16 @@ BOOL WINAPI GetRasterizerCaps( LPRASTERIZER_STATUS lprs, UINT cbNumBytes) TRACE("hinting is %senabled\n", hinting ? "" : "NOT "); } + if ( subpixel == -1 ) + { + subpixel = is_subpixel_rendering_enabled(); + TRACE("subpixel rendering is %senabled\n", subpixel ? "" : "NOT "); + } + lprs->nSize = sizeof(RASTERIZER_STATUS); lprs->wFlags = TT_AVAILABLE | TT_ENABLED | (hinting ? WINE_TT_HINTER_ENABLED : 0); + if ( subpixel ) + lprs->wFlags |= WINE_TT_SUBPIXEL_RENDERING_ENABLED; lprs->nLanguageID = 0; return TRUE; } diff --git a/dlls/gdi32/gdi_private.h b/dlls/gdi32/gdi_private.h index ba072171180..dfd58b2b228 100644 --- a/dlls/gdi32/gdi_private.h +++ b/dlls/gdi32/gdi_private.h @@ -98,142 +98,142 @@ typedef struct { int opaque; } *PHYSDEV; /* PHYSDEV is an opaque pointer */ typedef struct tagDC_FUNCS { - INT (*pAbortDoc)(PHYSDEV); - BOOL (*pAbortPath)(PHYSDEV); - BOOL (*pAlphaBlend)(PHYSDEV,INT,INT,INT,INT,PHYSDEV,INT,INT,INT,INT,BLENDFUNCTION); - BOOL (*pAngleArc)(PHYSDEV,INT,INT,DWORD,FLOAT,FLOAT); - BOOL (*pArc)(PHYSDEV,INT,INT,INT,INT,INT,INT,INT,INT); - BOOL (*pArcTo)(PHYSDEV,INT,INT,INT,INT,INT,INT,INT,INT); - BOOL (*pBeginPath)(PHYSDEV); - BOOL (*pBitBlt)(PHYSDEV,INT,INT,INT,INT,PHYSDEV,INT,INT,DWORD); - INT (*pChoosePixelFormat)(PHYSDEV,const PIXELFORMATDESCRIPTOR *); - BOOL (*pChord)(PHYSDEV,INT,INT,INT,INT,INT,INT,INT,INT); - BOOL (*pCloseFigure)(PHYSDEV); - BOOL (*pCreateBitmap)(PHYSDEV,HBITMAP,LPVOID); - BOOL (*pCreateDC)(HDC,PHYSDEV *,LPCWSTR,LPCWSTR,LPCWSTR,const DEVMODEW*); - HBITMAP (*pCreateDIBSection)(PHYSDEV,HBITMAP,const BITMAPINFO *,UINT); - BOOL (*pDeleteBitmap)(HBITMAP); - BOOL (*pDeleteDC)(PHYSDEV); - BOOL (*pDeleteObject)(PHYSDEV,HGDIOBJ); - INT (*pDescribePixelFormat)(PHYSDEV,INT,UINT,PIXELFORMATDESCRIPTOR *); - DWORD (*pDeviceCapabilities)(LPSTR,LPCSTR,LPCSTR,WORD,LPSTR,LPDEVMODEA); - BOOL (*pEllipse)(PHYSDEV,INT,INT,INT,INT); - INT (*pEndDoc)(PHYSDEV); - INT (*pEndPage)(PHYSDEV); - BOOL (*pEndPath)(PHYSDEV); - BOOL (*pEnumDeviceFonts)(PHYSDEV,LPLOGFONTW,FONTENUMPROCW,LPARAM); - INT (*pExcludeClipRect)(PHYSDEV,INT,INT,INT,INT); - INT (*pExtDeviceMode)(LPSTR,HWND,LPDEVMODEA,LPSTR,LPSTR,LPDEVMODEA,LPSTR,DWORD); - INT (*pExtEscape)(PHYSDEV,INT,INT,LPCVOID,INT,LPVOID); - BOOL (*pExtFloodFill)(PHYSDEV,INT,INT,COLORREF,UINT); - INT (*pExtSelectClipRgn)(PHYSDEV,HRGN,INT); - BOOL (*pExtTextOut)(PHYSDEV,INT,INT,UINT,const RECT*,LPCWSTR,UINT,const INT*); - BOOL (*pFillPath)(PHYSDEV); - BOOL (*pFillRgn)(PHYSDEV,HRGN,HBRUSH); - BOOL (*pFlattenPath)(PHYSDEV); - BOOL (*pFrameRgn)(PHYSDEV,HRGN,HBRUSH,INT,INT); - BOOL (*pGdiComment)(PHYSDEV,UINT,CONST BYTE*); - LONG (*pGetBitmapBits)(HBITMAP,void*,LONG); - BOOL (*pGetCharWidth)(PHYSDEV,UINT,UINT,LPINT); - BOOL (*pGetDCOrgEx)(PHYSDEV,LPPOINT); - UINT (*pGetDIBColorTable)(PHYSDEV,UINT,UINT,RGBQUAD*); - INT (*pGetDIBits)(PHYSDEV,HBITMAP,UINT,UINT,LPVOID,BITMAPINFO*,UINT); - INT (*pGetDeviceCaps)(PHYSDEV,INT); - BOOL (*pGetDeviceGammaRamp)(PHYSDEV,LPVOID); - BOOL (*pGetICMProfile)(PHYSDEV,LPDWORD,LPWSTR); - COLORREF (*pGetNearestColor)(PHYSDEV,COLORREF); - COLORREF (*pGetPixel)(PHYSDEV,INT,INT); - INT (*pGetPixelFormat)(PHYSDEV); - UINT (*pGetSystemPaletteEntries)(PHYSDEV,UINT,UINT,LPPALETTEENTRY); - BOOL (*pGetTextExtentExPoint)(PHYSDEV,LPCWSTR,INT,INT,LPINT,LPINT,LPSIZE); - BOOL (*pGetTextMetrics)(PHYSDEV,TEXTMETRICW*); - INT (*pIntersectClipRect)(PHYSDEV,INT,INT,INT,INT); - BOOL (*pInvertRgn)(PHYSDEV,HRGN); - BOOL (*pLineTo)(PHYSDEV,INT,INT); - BOOL (*pModifyWorldTransform)(PHYSDEV,const XFORM*,INT); - BOOL (*pMoveTo)(PHYSDEV,INT,INT); - INT (*pOffsetClipRgn)(PHYSDEV,INT,INT); - INT (*pOffsetViewportOrg)(PHYSDEV,INT,INT); - INT (*pOffsetWindowOrg)(PHYSDEV,INT,INT); - BOOL (*pPaintRgn)(PHYSDEV,HRGN); - BOOL (*pPatBlt)(PHYSDEV,INT,INT,INT,INT,DWORD); - BOOL (*pPie)(PHYSDEV,INT,INT,INT,INT,INT,INT,INT,INT); - BOOL (*pPolyBezier)(PHYSDEV,const POINT*,DWORD); - BOOL (*pPolyBezierTo)(PHYSDEV,const POINT*,DWORD); - BOOL (*pPolyDraw)(PHYSDEV,const POINT*,const BYTE *,DWORD); - BOOL (*pPolyPolygon)(PHYSDEV,const POINT*,const INT*,UINT); - BOOL (*pPolyPolyline)(PHYSDEV,const POINT*,const DWORD*,DWORD); - BOOL (*pPolygon)(PHYSDEV,const POINT*,INT); - BOOL (*pPolyline)(PHYSDEV,const POINT*,INT); - BOOL (*pPolylineTo)(PHYSDEV,const POINT*,INT); - UINT (*pRealizeDefaultPalette)(PHYSDEV); - UINT (*pRealizePalette)(PHYSDEV,HPALETTE,BOOL); - BOOL (*pRectangle)(PHYSDEV,INT,INT,INT,INT); - HDC (*pResetDC)(PHYSDEV,const DEVMODEW*); - BOOL (*pRestoreDC)(PHYSDEV,INT); - BOOL (*pRoundRect)(PHYSDEV,INT,INT,INT,INT,INT,INT); - INT (*pSaveDC)(PHYSDEV); - INT (*pScaleViewportExt)(PHYSDEV,INT,INT,INT,INT); - INT (*pScaleWindowExt)(PHYSDEV,INT,INT,INT,INT); - HBITMAP (*pSelectBitmap)(PHYSDEV,HBITMAP); - HBRUSH (*pSelectBrush)(PHYSDEV,HBRUSH); - BOOL (*pSelectClipPath)(PHYSDEV,INT); - HFONT (*pSelectFont)(PHYSDEV,HFONT,HANDLE); - HPALETTE (*pSelectPalette)(PHYSDEV,HPALETTE,BOOL); - HPEN (*pSelectPen)(PHYSDEV,HPEN); - INT (*pSetArcDirection)(PHYSDEV,INT); - LONG (*pSetBitmapBits)(HBITMAP,const void*,LONG); - COLORREF (*pSetBkColor)(PHYSDEV,COLORREF); - INT (*pSetBkMode)(PHYSDEV,INT); - COLORREF (*pSetDCBrushColor)(PHYSDEV, COLORREF); - DWORD (*pSetDCOrg)(PHYSDEV,INT,INT); - COLORREF (*pSetDCPenColor)(PHYSDEV, COLORREF); - UINT (*pSetDIBColorTable)(PHYSDEV,UINT,UINT,const RGBQUAD*); - INT (*pSetDIBits)(PHYSDEV,HBITMAP,UINT,UINT,LPCVOID,const BITMAPINFO*,UINT); - INT (*pSetDIBitsToDevice)(PHYSDEV,INT,INT,DWORD,DWORD,INT,INT,UINT,UINT,LPCVOID, - const BITMAPINFO*,UINT); - VOID (*pSetDeviceClipping)(PHYSDEV,HRGN,HRGN); - BOOL (*pSetDeviceGammaRamp)(PHYSDEV,LPVOID); - INT (*pSetMapMode)(PHYSDEV,INT); - DWORD (*pSetMapperFlags)(PHYSDEV,DWORD); - COLORREF (*pSetPixel)(PHYSDEV,INT,INT,COLORREF); - BOOL (*pSetPixelFormat)(PHYSDEV,INT,const PIXELFORMATDESCRIPTOR *); - INT (*pSetPolyFillMode)(PHYSDEV,INT); - INT (*pSetROP2)(PHYSDEV,INT); - INT (*pSetRelAbs)(PHYSDEV,INT); - INT (*pSetStretchBltMode)(PHYSDEV,INT); - UINT (*pSetTextAlign)(PHYSDEV,UINT); - INT (*pSetTextCharacterExtra)(PHYSDEV,INT); - DWORD (*pSetTextColor)(PHYSDEV,DWORD); - INT (*pSetTextJustification)(PHYSDEV,INT,INT); - INT (*pSetViewportExt)(PHYSDEV,INT,INT); - INT (*pSetViewportOrg)(PHYSDEV,INT,INT); - INT (*pSetWindowExt)(PHYSDEV,INT,INT); - INT (*pSetWindowOrg)(PHYSDEV,INT,INT); - BOOL (*pSetWorldTransform)(PHYSDEV,const XFORM*); - INT (*pStartDoc)(PHYSDEV,const DOCINFOW*); - INT (*pStartPage)(PHYSDEV); - BOOL (*pStretchBlt)(PHYSDEV,INT,INT,INT,INT,PHYSDEV,INT,INT,INT,INT,DWORD); - INT (*pStretchDIBits)(PHYSDEV,INT,INT,INT,INT,INT,INT,INT,INT,const void *, - const BITMAPINFO*,UINT,DWORD); - BOOL (*pStrokeAndFillPath)(PHYSDEV); - BOOL (*pStrokePath)(PHYSDEV); - BOOL (*pSwapBuffers)(PHYSDEV); - BOOL (*pUnrealizePalette)(HPALETTE); - BOOL (*pWidenPath)(PHYSDEV); + INT (CDECL *pAbortDoc)(PHYSDEV); + BOOL (CDECL *pAbortPath)(PHYSDEV); + BOOL (CDECL *pAlphaBlend)(PHYSDEV,INT,INT,INT,INT,PHYSDEV,INT,INT,INT,INT,BLENDFUNCTION); + BOOL (CDECL *pAngleArc)(PHYSDEV,INT,INT,DWORD,FLOAT,FLOAT); + BOOL (CDECL *pArc)(PHYSDEV,INT,INT,INT,INT,INT,INT,INT,INT); + BOOL (CDECL *pArcTo)(PHYSDEV,INT,INT,INT,INT,INT,INT,INT,INT); + BOOL (CDECL *pBeginPath)(PHYSDEV); + BOOL (CDECL *pBitBlt)(PHYSDEV,INT,INT,INT,INT,PHYSDEV,INT,INT,DWORD); + INT (CDECL *pChoosePixelFormat)(PHYSDEV,const PIXELFORMATDESCRIPTOR *); + BOOL (CDECL *pChord)(PHYSDEV,INT,INT,INT,INT,INT,INT,INT,INT); + BOOL (CDECL *pCloseFigure)(PHYSDEV); + BOOL (CDECL *pCreateBitmap)(PHYSDEV,HBITMAP,LPVOID); + BOOL (CDECL *pCreateDC)(HDC,PHYSDEV *,LPCWSTR,LPCWSTR,LPCWSTR,const DEVMODEW*); + HBITMAP (CDECL *pCreateDIBSection)(PHYSDEV,HBITMAP,const BITMAPINFO *,UINT); + BOOL (CDECL *pDeleteBitmap)(HBITMAP); + BOOL (CDECL *pDeleteDC)(PHYSDEV); + BOOL (CDECL *pDeleteObject)(PHYSDEV,HGDIOBJ); + INT (CDECL *pDescribePixelFormat)(PHYSDEV,INT,UINT,PIXELFORMATDESCRIPTOR *); + DWORD (CDECL *pDeviceCapabilities)(LPSTR,LPCSTR,LPCSTR,WORD,LPSTR,LPDEVMODEA); + BOOL (CDECL *pEllipse)(PHYSDEV,INT,INT,INT,INT); + INT (CDECL *pEndDoc)(PHYSDEV); + INT (CDECL *pEndPage)(PHYSDEV); + BOOL (CDECL *pEndPath)(PHYSDEV); + BOOL (CDECL *pEnumDeviceFonts)(PHYSDEV,LPLOGFONTW,FONTENUMPROCW,LPARAM); + INT (CDECL *pExcludeClipRect)(PHYSDEV,INT,INT,INT,INT); + INT (CDECL *pExtDeviceMode)(LPSTR,HWND,LPDEVMODEA,LPSTR,LPSTR,LPDEVMODEA,LPSTR,DWORD); + INT (CDECL *pExtEscape)(PHYSDEV,INT,INT,LPCVOID,INT,LPVOID); + BOOL (CDECL *pExtFloodFill)(PHYSDEV,INT,INT,COLORREF,UINT); + INT (CDECL *pExtSelectClipRgn)(PHYSDEV,HRGN,INT); + BOOL (CDECL *pExtTextOut)(PHYSDEV,INT,INT,UINT,const RECT*,LPCWSTR,UINT,const INT*); + BOOL (CDECL *pFillPath)(PHYSDEV); + BOOL (CDECL *pFillRgn)(PHYSDEV,HRGN,HBRUSH); + BOOL (CDECL *pFlattenPath)(PHYSDEV); + BOOL (CDECL *pFrameRgn)(PHYSDEV,HRGN,HBRUSH,INT,INT); + BOOL (CDECL *pGdiComment)(PHYSDEV,UINT,CONST BYTE*); + LONG (CDECL *pGetBitmapBits)(HBITMAP,void*,LONG); + BOOL (CDECL *pGetCharWidth)(PHYSDEV,UINT,UINT,LPINT); + BOOL (CDECL *pGetDCOrgEx)(PHYSDEV,LPPOINT); + UINT (CDECL *pGetDIBColorTable)(PHYSDEV,UINT,UINT,RGBQUAD*); + INT (CDECL *pGetDIBits)(PHYSDEV,HBITMAP,UINT,UINT,LPVOID,BITMAPINFO*,UINT); + INT (CDECL *pGetDeviceCaps)(PHYSDEV,INT); + BOOL (CDECL *pGetDeviceGammaRamp)(PHYSDEV,LPVOID); + BOOL (CDECL *pGetICMProfile)(PHYSDEV,LPDWORD,LPWSTR); + COLORREF (CDECL *pGetNearestColor)(PHYSDEV,COLORREF); + COLORREF (CDECL *pGetPixel)(PHYSDEV,INT,INT); + INT (CDECL *pGetPixelFormat)(PHYSDEV); + UINT (CDECL *pGetSystemPaletteEntries)(PHYSDEV,UINT,UINT,LPPALETTEENTRY); + BOOL (CDECL *pGetTextExtentExPoint)(PHYSDEV,LPCWSTR,INT,INT,LPINT,LPINT,LPSIZE); + BOOL (CDECL *CDECL pGetTextMetrics)(PHYSDEV,TEXTMETRICW*); + INT (CDECL *pIntersectClipRect)(PHYSDEV,INT,INT,INT,INT); + BOOL (CDECL *pInvertRgn)(PHYSDEV,HRGN); + BOOL (CDECL *pLineTo)(PHYSDEV,INT,INT); + BOOL (CDECL *pModifyWorldTransform)(PHYSDEV,const XFORM*,INT); + BOOL (CDECL *pMoveTo)(PHYSDEV,INT,INT); + INT (CDECL *pOffsetClipRgn)(PHYSDEV,INT,INT); + INT (CDECL *pOffsetViewportOrg)(PHYSDEV,INT,INT); + INT (CDECL *pOffsetWindowOrg)(PHYSDEV,INT,INT); + BOOL (CDECL *pPaintRgn)(PHYSDEV,HRGN); + BOOL (CDECL *pPatBlt)(PHYSDEV,INT,INT,INT,INT,DWORD); + BOOL (CDECL *pPie)(PHYSDEV,INT,INT,INT,INT,INT,INT,INT,INT); + BOOL (CDECL *pPolyBezier)(PHYSDEV,const POINT*,DWORD); + BOOL (CDECL *pPolyBezierTo)(PHYSDEV,const POINT*,DWORD); + BOOL (CDECL *pPolyDraw)(PHYSDEV,const POINT*,const BYTE *,DWORD); + BOOL (CDECL *pPolyPolygon)(PHYSDEV,const POINT*,const INT*,UINT); + BOOL (CDECL *pPolyPolyline)(PHYSDEV,const POINT*,const DWORD*,DWORD); + BOOL (CDECL *pPolygon)(PHYSDEV,const POINT*,INT); + BOOL (CDECL *pPolyline)(PHYSDEV,const POINT*,INT); + BOOL (CDECL *pPolylineTo)(PHYSDEV,const POINT*,INT); + UINT (CDECL *pRealizeDefaultPalette)(PHYSDEV); + UINT (CDECL *pRealizePalette)(PHYSDEV,HPALETTE,BOOL); + BOOL (CDECL *pRectangle)(PHYSDEV,INT,INT,INT,INT); + HDC (CDECL *pResetDC)(PHYSDEV,const DEVMODEW*); + BOOL (CDECL *pRestoreDC)(PHYSDEV,INT); + BOOL (CDECL *pRoundRect)(PHYSDEV,INT,INT,INT,INT,INT,INT); + INT (CDECL *pSaveDC)(PHYSDEV); + INT (CDECL *pScaleViewportExt)(PHYSDEV,INT,INT,INT,INT); + INT (CDECL *pScaleWindowExt)(PHYSDEV,INT,INT,INT,INT); + HBITMAP (CDECL *pSelectBitmap)(PHYSDEV,HBITMAP); + HBRUSH (CDECL *pSelectBrush)(PHYSDEV,HBRUSH); + BOOL (CDECL *pSelectClipPath)(PHYSDEV,INT); + HFONT (CDECL *pSelectFont)(PHYSDEV,HFONT,HANDLE); + HPALETTE (CDECL *pSelectPalette)(PHYSDEV,HPALETTE,BOOL); + HPEN (CDECL *pSelectPen)(PHYSDEV,HPEN); + INT (CDECL *pSetArcDirection)(PHYSDEV,INT); + LONG (CDECL *pSetBitmapBits)(HBITMAP,const void*,LONG); + COLORREF (CDECL *pSetBkColor)(PHYSDEV,COLORREF); + INT (CDECL *pSetBkMode)(PHYSDEV,INT); + COLORREF (CDECL *pSetDCBrushColor)(PHYSDEV, COLORREF); + DWORD (CDECL *pSetDCOrg)(PHYSDEV,INT,INT); + COLORREF (CDECL *pSetDCPenColor)(PHYSDEV, COLORREF); + UINT (CDECL *pSetDIBColorTable)(PHYSDEV,UINT,UINT,const RGBQUAD*); + INT (CDECL *pSetDIBits)(PHYSDEV,HBITMAP,UINT,UINT,LPCVOID,const BITMAPINFO*,UINT); + INT (CDECL *pSetDIBitsToDevice)(PHYSDEV,INT,INT,DWORD,DWORD,INT,INT,UINT,UINT,LPCVOID, + const BITMAPINFO*,UINT); + VOID (CDECL *pSetDeviceClipping)(PHYSDEV,HRGN,HRGN); + BOOL (CDECL *pSetDeviceGammaRamp)(PHYSDEV,LPVOID); + INT (CDECL *pSetMapMode)(PHYSDEV,INT); + DWORD (CDECL *pSetMapperFlags)(PHYSDEV,DWORD); + COLORREF (CDECL *pSetPixel)(PHYSDEV,INT,INT,COLORREF); + BOOL (CDECL *pSetPixelFormat)(PHYSDEV,INT,const PIXELFORMATDESCRIPTOR *); + INT (CDECL *pSetPolyFillMode)(PHYSDEV,INT); + INT (CDECL *pSetROP2)(PHYSDEV,INT); + INT (CDECL *pSetRelAbs)(PHYSDEV,INT); + INT (CDECL *pSetStretchBltMode)(PHYSDEV,INT); + UINT (CDECL *pSetTextAlign)(PHYSDEV,UINT); + INT (CDECL *pSetTextCharacterExtra)(PHYSDEV,INT); + DWORD (CDECL *pSetTextColor)(PHYSDEV,DWORD); + INT (CDECL *pSetTextJustification)(PHYSDEV,INT,INT); + INT (CDECL *pSetViewportExt)(PHYSDEV,INT,INT); + INT (CDECL *pSetViewportOrg)(PHYSDEV,INT,INT); + INT (CDECL *pSetWindowExt)(PHYSDEV,INT,INT); + INT (CDECL *pSetWindowOrg)(PHYSDEV,INT,INT); + BOOL (CDECL *pSetWorldTransform)(PHYSDEV,const XFORM*); + INT (CDECL *pStartDoc)(PHYSDEV,const DOCINFOW*); + INT (CDECL *pStartPage)(PHYSDEV); + BOOL (CDECL *pStretchBlt)(PHYSDEV,INT,INT,INT,INT,PHYSDEV,INT,INT,INT,INT,DWORD); + INT (CDECL *pStretchDIBits)(PHYSDEV,INT,INT,INT,INT,INT,INT,INT,INT,const void *, + const BITMAPINFO*,UINT,DWORD); + BOOL (CDECL *pStrokeAndFillPath)(PHYSDEV); + BOOL (CDECL *pStrokePath)(PHYSDEV); + BOOL (CDECL *pSwapBuffers)(PHYSDEV); + BOOL (CDECL *pUnrealizePalette)(HPALETTE); + BOOL (CDECL *pWidenPath)(PHYSDEV); /* OpenGL32 */ - BOOL (*pwglCopyContext)(HGLRC, HGLRC, UINT); - HGLRC (*pwglCreateContext)(PHYSDEV); - BOOL (*pwglDeleteContext)(HGLRC); - PROC (*pwglGetProcAddress)(LPCSTR); - HDC (*pwglGetPbufferDCARB)(PHYSDEV, void*); - BOOL (*pwglMakeCurrent)(PHYSDEV, HGLRC); - BOOL (*pwglMakeContextCurrentARB)(PHYSDEV, PHYSDEV, HGLRC); - BOOL (*pwglSetPixelFormatWINE)(PHYSDEV,INT,const PIXELFORMATDESCRIPTOR *); - BOOL (*pwglShareLists)(HGLRC hglrc1, HGLRC hglrc2); - BOOL (*pwglUseFontBitmapsA)(PHYSDEV, DWORD, DWORD, DWORD); - BOOL (*pwglUseFontBitmapsW)(PHYSDEV, DWORD, DWORD, DWORD); + BOOL (CDECL *pwglCopyContext)(HGLRC, HGLRC, UINT); + HGLRC (CDECL *pwglCreateContext)(PHYSDEV); + BOOL (CDECL *pwglDeleteContext)(HGLRC); + PROC (CDECL *pwglGetProcAddress)(LPCSTR); + HDC (CDECL *pwglGetPbufferDCARB)(PHYSDEV, void*); + BOOL (CDECL *pwglMakeCurrent)(PHYSDEV, HGLRC); + BOOL (CDECL *pwglMakeContextCurrentARB)(PHYSDEV, PHYSDEV, HGLRC); + BOOL (CDECL *pwglSetPixelFormatWINE)(PHYSDEV,INT,const PIXELFORMATDESCRIPTOR *); + BOOL (CDECL *pwglShareLists)(HGLRC hglrc1, HGLRC hglrc2); + BOOL (CDECL *pwglUseFontBitmapsA)(PHYSDEV, DWORD, DWORD, DWORD); + BOOL (CDECL *pwglUseFontBitmapsW)(PHYSDEV, DWORD, DWORD, DWORD); } DC_FUNCTIONS; /* It should not be necessary to access the contents of the GdiPath diff --git a/dlls/gdi32/mfdrv/bitblt.c b/dlls/gdi32/mfdrv/bitblt.c index 48d79d36d00..85d4b167df0 100644 --- a/dlls/gdi32/mfdrv/bitblt.c +++ b/dlls/gdi32/mfdrv/bitblt.c @@ -28,7 +28,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(metafile); /*********************************************************************** * MFDRV_PatBlt */ -BOOL MFDRV_PatBlt( PHYSDEV dev, INT left, INT top, INT width, INT height, DWORD rop ) +BOOL CDECL MFDRV_PatBlt( PHYSDEV dev, INT left, INT top, INT width, INT height, DWORD rop ) { MFDRV_MetaParam6( dev, META_PATBLT, left, top, width, height, HIWORD(rop), LOWORD(rop) ); return TRUE; @@ -38,8 +38,8 @@ BOOL MFDRV_PatBlt( PHYSDEV dev, INT left, INT top, INT width, INT height, DWORD /*********************************************************************** * MFDRV_BitBlt */ -BOOL MFDRV_BitBlt( PHYSDEV devDst, INT xDst, INT yDst, INT width, INT height, - PHYSDEV devSrc, INT xSrc, INT ySrc, DWORD rop ) +BOOL CDECL MFDRV_BitBlt( PHYSDEV devDst, INT xDst, INT yDst, INT width, INT height, + PHYSDEV devSrc, INT xSrc, INT ySrc, DWORD rop ) { return MFDRV_StretchBlt(devDst, xDst, yDst, width, height, devSrc, xSrc, ySrc, width, height, rop); @@ -55,9 +55,9 @@ BOOL MFDRV_BitBlt( PHYSDEV devDst, INT xDst, INT yDst, INT width, INT height, */ #define STRETCH_VIA_DIB -BOOL MFDRV_StretchBlt( PHYSDEV devDst, INT xDst, INT yDst, INT widthDst, - INT heightDst, PHYSDEV devSrc, INT xSrc, INT ySrc, - INT widthSrc, INT heightSrc, DWORD rop ) +BOOL CDECL MFDRV_StretchBlt( PHYSDEV devDst, INT xDst, INT yDst, INT widthDst, + INT heightDst, PHYSDEV devSrc, INT xSrc, INT ySrc, + INT widthSrc, INT heightSrc, DWORD rop ) { BOOL ret; DWORD len; @@ -141,10 +141,10 @@ BOOL MFDRV_StretchBlt( PHYSDEV devDst, INT xDst, INT yDst, INT widthDst, /*********************************************************************** * MFDRV_StretchDIBits */ -INT MFDRV_StretchDIBits( PHYSDEV dev, INT xDst, INT yDst, INT widthDst, - INT heightDst, INT xSrc, INT ySrc, INT widthSrc, - INT heightSrc, const void *bits, - const BITMAPINFO *info, UINT wUsage, DWORD dwRop ) +INT CDECL MFDRV_StretchDIBits( PHYSDEV dev, INT xDst, INT yDst, INT widthDst, + INT heightDst, INT xSrc, INT ySrc, INT widthSrc, + INT heightSrc, const void *bits, + const BITMAPINFO *info, UINT wUsage, DWORD dwRop ) { DWORD len, infosize, imagesize; METARECORD *mr; @@ -182,10 +182,10 @@ INT MFDRV_StretchDIBits( PHYSDEV dev, INT xDst, INT yDst, INT widthDst, /*********************************************************************** * MFDRV_SetDIBitsToDeivce */ -INT MFDRV_SetDIBitsToDevice( PHYSDEV dev, INT xDst, INT yDst, DWORD cx, - DWORD cy, INT xSrc, INT ySrc, UINT startscan, - UINT lines, LPCVOID bits, const BITMAPINFO *info, - UINT coloruse ) +INT CDECL MFDRV_SetDIBitsToDevice( PHYSDEV dev, INT xDst, INT yDst, DWORD cx, + DWORD cy, INT xSrc, INT ySrc, UINT startscan, + UINT lines, LPCVOID bits, const BITMAPINFO *info, + UINT coloruse ) { DWORD len, infosize, imagesize; diff --git a/dlls/gdi32/mfdrv/dc.c b/dlls/gdi32/mfdrv/dc.c index e81b04c1d4b..e99c164b4ea 100644 --- a/dlls/gdi32/mfdrv/dc.c +++ b/dlls/gdi32/mfdrv/dc.c @@ -20,128 +20,128 @@ #include "mfdrv/metafiledrv.h" -INT MFDRV_SaveDC( PHYSDEV dev ) +INT CDECL MFDRV_SaveDC( PHYSDEV dev ) { return MFDRV_MetaParam0( dev, META_SAVEDC ); } -BOOL MFDRV_RestoreDC( PHYSDEV dev, INT level ) +BOOL CDECL MFDRV_RestoreDC( PHYSDEV dev, INT level ) { if(level != -1) return FALSE; return MFDRV_MetaParam1( dev, META_RESTOREDC, level ); } -UINT MFDRV_SetTextAlign( PHYSDEV dev, UINT align ) +UINT CDECL MFDRV_SetTextAlign( PHYSDEV dev, UINT align ) { return MFDRV_MetaParam2( dev, META_SETTEXTALIGN, HIWORD(align), LOWORD(align)); } -INT MFDRV_SetBkMode( PHYSDEV dev, INT mode ) +INT CDECL MFDRV_SetBkMode( PHYSDEV dev, INT mode ) { return MFDRV_MetaParam1( dev, META_SETBKMODE, (WORD)mode); } -INT MFDRV_SetROP2( PHYSDEV dev, INT rop ) +INT CDECL MFDRV_SetROP2( PHYSDEV dev, INT rop ) { return MFDRV_MetaParam1( dev, META_SETROP2, (WORD)rop); } -INT MFDRV_SetRelAbs( PHYSDEV dev, INT mode ) +INT CDECL MFDRV_SetRelAbs( PHYSDEV dev, INT mode ) { return MFDRV_MetaParam1( dev, META_SETRELABS, (WORD)mode); } -INT MFDRV_SetPolyFillMode( PHYSDEV dev, INT mode ) +INT CDECL MFDRV_SetPolyFillMode( PHYSDEV dev, INT mode ) { return MFDRV_MetaParam1( dev, META_SETPOLYFILLMODE, (WORD)mode); } -INT MFDRV_SetStretchBltMode( PHYSDEV dev, INT mode ) +INT CDECL MFDRV_SetStretchBltMode( PHYSDEV dev, INT mode ) { return MFDRV_MetaParam1( dev, META_SETSTRETCHBLTMODE, (WORD)mode); } -INT MFDRV_IntersectClipRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom ) +INT CDECL MFDRV_IntersectClipRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom ) { return MFDRV_MetaParam4( dev, META_INTERSECTCLIPRECT, left, top, right, bottom ); } -INT MFDRV_ExcludeClipRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom ) +INT CDECL MFDRV_ExcludeClipRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom ) { return MFDRV_MetaParam4( dev, META_EXCLUDECLIPRECT, left, top, right, bottom ); } -INT MFDRV_OffsetClipRgn( PHYSDEV dev, INT x, INT y ) +INT CDECL MFDRV_OffsetClipRgn( PHYSDEV dev, INT x, INT y ) { return MFDRV_MetaParam2( dev, META_OFFSETCLIPRGN, x, y ); } -INT MFDRV_SetTextJustification( PHYSDEV dev, INT extra, INT breaks ) +INT CDECL MFDRV_SetTextJustification( PHYSDEV dev, INT extra, INT breaks ) { return MFDRV_MetaParam2( dev, META_SETTEXTJUSTIFICATION, extra, breaks ); } -INT MFDRV_SetTextCharacterExtra( PHYSDEV dev, INT extra ) +INT CDECL MFDRV_SetTextCharacterExtra( PHYSDEV dev, INT extra ) { if(!MFDRV_MetaParam1( dev, META_SETTEXTCHAREXTRA, extra )) return 0x80000000; return TRUE; } -DWORD MFDRV_SetMapperFlags( PHYSDEV dev, DWORD flags ) +DWORD CDECL MFDRV_SetMapperFlags( PHYSDEV dev, DWORD flags ) { return MFDRV_MetaParam2( dev, META_SETMAPPERFLAGS, HIWORD(flags), LOWORD(flags) ); } -BOOL MFDRV_AbortPath( PHYSDEV dev ) +BOOL CDECL MFDRV_AbortPath( PHYSDEV dev ) { return FALSE; } -BOOL MFDRV_BeginPath( PHYSDEV dev ) +BOOL CDECL MFDRV_BeginPath( PHYSDEV dev ) { return FALSE; } -BOOL MFDRV_CloseFigure( PHYSDEV dev ) +BOOL CDECL MFDRV_CloseFigure( PHYSDEV dev ) { return FALSE; } -BOOL MFDRV_EndPath( PHYSDEV dev ) +BOOL CDECL MFDRV_EndPath( PHYSDEV dev ) { return FALSE; } -BOOL MFDRV_FillPath( PHYSDEV dev ) +BOOL CDECL MFDRV_FillPath( PHYSDEV dev ) { return FALSE; } -BOOL MFDRV_FlattenPath( PHYSDEV dev ) +BOOL CDECL MFDRV_FlattenPath( PHYSDEV dev ) { return FALSE; } -BOOL MFDRV_SelectClipPath( PHYSDEV dev, INT iMode ) +BOOL CDECL MFDRV_SelectClipPath( PHYSDEV dev, INT iMode ) { return FALSE; } -BOOL MFDRV_StrokeAndFillPath( PHYSDEV dev ) +BOOL CDECL MFDRV_StrokeAndFillPath( PHYSDEV dev ) { return FALSE; } -BOOL MFDRV_StrokePath( PHYSDEV dev ) +BOOL CDECL MFDRV_StrokePath( PHYSDEV dev ) { return FALSE; } -BOOL MFDRV_WidenPath( PHYSDEV dev ) +BOOL CDECL MFDRV_WidenPath( PHYSDEV dev ) { return FALSE; } diff --git a/dlls/gdi32/mfdrv/graphics.c b/dlls/gdi32/mfdrv/graphics.c index 316ee7852ce..9b92f850907 100644 --- a/dlls/gdi32/mfdrv/graphics.c +++ b/dlls/gdi32/mfdrv/graphics.c @@ -29,7 +29,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(metafile); /********************************************************************** * MFDRV_MoveTo */ -BOOL +BOOL CDECL MFDRV_MoveTo(PHYSDEV dev, INT x, INT y) { return MFDRV_MetaParam2(dev,META_MOVETO,x,y); @@ -38,7 +38,7 @@ MFDRV_MoveTo(PHYSDEV dev, INT x, INT y) /*********************************************************************** * MFDRV_LineTo */ -BOOL +BOOL CDECL MFDRV_LineTo( PHYSDEV dev, INT x, INT y ) { return MFDRV_MetaParam2(dev, META_LINETO, x, y); @@ -48,7 +48,7 @@ MFDRV_LineTo( PHYSDEV dev, INT x, INT y ) /*********************************************************************** * MFDRV_Arc */ -BOOL +BOOL CDECL MFDRV_Arc( PHYSDEV dev, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend ) { @@ -60,7 +60,7 @@ MFDRV_Arc( PHYSDEV dev, INT left, INT top, INT right, INT bottom, /*********************************************************************** * MFDRV_Pie */ -BOOL +BOOL CDECL MFDRV_Pie( PHYSDEV dev, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend ) { @@ -72,7 +72,7 @@ MFDRV_Pie( PHYSDEV dev, INT left, INT top, INT right, INT bottom, /*********************************************************************** * MFDRV_Chord */ -BOOL +BOOL CDECL MFDRV_Chord( PHYSDEV dev, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend ) { @@ -83,7 +83,7 @@ MFDRV_Chord( PHYSDEV dev, INT left, INT top, INT right, INT bottom, /*********************************************************************** * MFDRV_Ellipse */ -BOOL +BOOL CDECL MFDRV_Ellipse( PHYSDEV dev, INT left, INT top, INT right, INT bottom ) { return MFDRV_MetaParam4(dev, META_ELLIPSE, left, top, right, bottom); @@ -92,7 +92,7 @@ MFDRV_Ellipse( PHYSDEV dev, INT left, INT top, INT right, INT bottom ) /*********************************************************************** * MFDRV_Rectangle */ -BOOL +BOOL CDECL MFDRV_Rectangle(PHYSDEV dev, INT left, INT top, INT right, INT bottom) { return MFDRV_MetaParam4(dev, META_RECTANGLE, left, top, right, bottom); @@ -101,7 +101,7 @@ MFDRV_Rectangle(PHYSDEV dev, INT left, INT top, INT right, INT bottom) /*********************************************************************** * MFDRV_RoundRect */ -BOOL +BOOL CDECL MFDRV_RoundRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom, INT ell_width, INT ell_height ) { @@ -112,7 +112,7 @@ MFDRV_RoundRect( PHYSDEV dev, INT left, INT top, INT right, /*********************************************************************** * MFDRV_SetPixel */ -COLORREF +COLORREF CDECL MFDRV_SetPixel( PHYSDEV dev, INT x, INT y, COLORREF color ) { return MFDRV_MetaParam4(dev, META_SETPIXEL, x, y,HIWORD(color), @@ -146,7 +146,7 @@ static BOOL MFDRV_MetaPoly(PHYSDEV dev, short func, LPPOINT16 pt, short count) /********************************************************************** * MFDRV_Polyline */ -BOOL +BOOL CDECL MFDRV_Polyline( PHYSDEV dev, const POINT* pt, INT count ) { register int i; @@ -170,7 +170,7 @@ MFDRV_Polyline( PHYSDEV dev, const POINT* pt, INT count ) /********************************************************************** * MFDRV_Polygon */ -BOOL +BOOL CDECL MFDRV_Polygon( PHYSDEV dev, const POINT* pt, INT count ) { register int i; @@ -194,7 +194,7 @@ MFDRV_Polygon( PHYSDEV dev, const POINT* pt, INT count ) /********************************************************************** * MFDRV_PolyPolygon */ -BOOL +BOOL CDECL MFDRV_PolyPolygon( PHYSDEV dev, const POINT* pt, const INT* counts, UINT polygons) { BOOL ret; @@ -249,7 +249,7 @@ MFDRV_PolyPolygon( PHYSDEV dev, const POINT* pt, const INT* counts, UINT polygon /********************************************************************** * MFDRV_ExtFloodFill */ -BOOL +BOOL CDECL MFDRV_ExtFloodFill( PHYSDEV dev, INT x, INT y, COLORREF color, UINT fillType ) { return MFDRV_MetaParam4(dev,META_FLOODFILL,x,y,HIWORD(color), @@ -348,7 +348,7 @@ static INT16 MFDRV_CreateRegion(PHYSDEV dev, HRGN hrgn) /********************************************************************** * MFDRV_PaintRgn */ -BOOL +BOOL CDECL MFDRV_PaintRgn( PHYSDEV dev, HRGN hrgn ) { INT16 index; @@ -362,7 +362,7 @@ MFDRV_PaintRgn( PHYSDEV dev, HRGN hrgn ) /********************************************************************** * MFDRV_InvertRgn */ -BOOL +BOOL CDECL MFDRV_InvertRgn( PHYSDEV dev, HRGN hrgn ) { INT16 index; @@ -376,7 +376,7 @@ MFDRV_InvertRgn( PHYSDEV dev, HRGN hrgn ) /********************************************************************** * MFDRV_FillRgn */ -BOOL +BOOL CDECL MFDRV_FillRgn( PHYSDEV dev, HRGN hrgn, HBRUSH hbrush ) { INT16 iRgn, iBrush; @@ -392,7 +392,7 @@ MFDRV_FillRgn( PHYSDEV dev, HRGN hrgn, HBRUSH hbrush ) /********************************************************************** * MFDRV_FrameRgn */ -BOOL +BOOL CDECL MFDRV_FrameRgn( PHYSDEV dev, HRGN hrgn, HBRUSH hbrush, INT x, INT y ) { INT16 iRgn, iBrush; @@ -409,7 +409,7 @@ MFDRV_FrameRgn( PHYSDEV dev, HRGN hrgn, HBRUSH hbrush, INT x, INT y ) /********************************************************************** * MFDRV_ExtSelectClipRgn */ -INT MFDRV_ExtSelectClipRgn( PHYSDEV dev, HRGN hrgn, INT mode ) +INT CDECL MFDRV_ExtSelectClipRgn( PHYSDEV dev, HRGN hrgn, INT mode ) { INT16 iRgn; INT ret; @@ -428,7 +428,7 @@ INT MFDRV_ExtSelectClipRgn( PHYSDEV dev, HRGN hrgn, INT mode ) /********************************************************************** * MFDRV_SetBkColor */ -COLORREF +COLORREF CDECL MFDRV_SetBkColor( PHYSDEV dev, COLORREF color ) { return MFDRV_MetaParam2(dev, META_SETBKCOLOR, HIWORD(color), @@ -439,7 +439,7 @@ MFDRV_SetBkColor( PHYSDEV dev, COLORREF color ) /********************************************************************** * MFDRV_SetTextColor */ -COLORREF +COLORREF CDECL MFDRV_SetTextColor( PHYSDEV dev, COLORREF color ) { return MFDRV_MetaParam2(dev, META_SETTEXTCOLOR, HIWORD(color), @@ -452,7 +452,7 @@ MFDRV_SetTextColor( PHYSDEV dev, COLORREF color ) * Since MetaFiles don't record Beziers and they don't even record * approximations to them using lines, we need this stub function. */ -BOOL +BOOL CDECL MFDRV_PolyBezier( PHYSDEV dev, const POINT *pts, DWORD count ) { return FALSE; @@ -463,7 +463,7 @@ MFDRV_PolyBezier( PHYSDEV dev, const POINT *pts, DWORD count ) * Since MetaFiles don't record Beziers and they don't even record * approximations to them using lines, we need this stub function. */ -BOOL +BOOL CDECL MFDRV_PolyBezierTo( PHYSDEV dev, const POINT *pts, DWORD count ) { return FALSE; diff --git a/dlls/gdi32/mfdrv/init.c b/dlls/gdi32/mfdrv/init.c index 69e5b55a237..a1bee458495 100644 --- a/dlls/gdi32/mfdrv/init.c +++ b/dlls/gdi32/mfdrv/init.c @@ -586,8 +586,8 @@ BOOL MFDRV_MetaParam8(PHYSDEV dev, short func, short param1, short param2, /********************************************************************** * MFDRV_ExtEscape */ -INT MFDRV_ExtEscape( PHYSDEV dev, INT nEscape, INT cbInput, LPCVOID in_data, - INT cbOutput, LPVOID out_data ) +INT CDECL MFDRV_ExtEscape( PHYSDEV dev, INT nEscape, INT cbInput, LPCVOID in_data, + INT cbOutput, LPVOID out_data ) { METARECORD *mr; DWORD len; @@ -613,7 +613,7 @@ INT MFDRV_ExtEscape( PHYSDEV dev, INT nEscape, INT cbInput, LPCVOID in_data, * *A very simple implementation that returns DT_METAFILE */ -INT MFDRV_GetDeviceCaps(PHYSDEV dev, INT cap) +INT CDECL MFDRV_GetDeviceCaps(PHYSDEV dev, INT cap) { switch(cap) { diff --git a/dlls/gdi32/mfdrv/mapping.c b/dlls/gdi32/mfdrv/mapping.c index d921eb145e6..998a7a12ece 100644 --- a/dlls/gdi32/mfdrv/mapping.c +++ b/dlls/gdi32/mfdrv/mapping.c @@ -25,7 +25,7 @@ /*********************************************************************** * MFDRV_SetMapMode */ -INT MFDRV_SetMapMode( PHYSDEV dev, INT mode ) +INT CDECL MFDRV_SetMapMode( PHYSDEV dev, INT mode ) { if(!MFDRV_MetaParam1( dev, META_SETMAPMODE, mode )) return FALSE; @@ -36,7 +36,7 @@ INT MFDRV_SetMapMode( PHYSDEV dev, INT mode ) /*********************************************************************** * MFDRV_SetViewportExt */ -INT MFDRV_SetViewportExt( PHYSDEV dev, INT x, INT y ) +INT CDECL MFDRV_SetViewportExt( PHYSDEV dev, INT x, INT y ) { if(!MFDRV_MetaParam2( dev, META_SETVIEWPORTEXT, x, y )) return FALSE; @@ -47,7 +47,7 @@ INT MFDRV_SetViewportExt( PHYSDEV dev, INT x, INT y ) /*********************************************************************** * MFDRV_SetViewportOrg */ -INT MFDRV_SetViewportOrg( PHYSDEV dev, INT x, INT y ) +INT CDECL MFDRV_SetViewportOrg( PHYSDEV dev, INT x, INT y ) { if(!MFDRV_MetaParam2( dev, META_SETVIEWPORTORG, x, y )) return FALSE; @@ -58,7 +58,7 @@ INT MFDRV_SetViewportOrg( PHYSDEV dev, INT x, INT y ) /*********************************************************************** * MFDRV_SetWindowExt */ -INT MFDRV_SetWindowExt( PHYSDEV dev, INT x, INT y ) +INT CDECL MFDRV_SetWindowExt( PHYSDEV dev, INT x, INT y ) { if(!MFDRV_MetaParam2( dev, META_SETWINDOWEXT, x, y )) return FALSE; @@ -69,7 +69,7 @@ INT MFDRV_SetWindowExt( PHYSDEV dev, INT x, INT y ) /*********************************************************************** * MFDRV_SetWindowOrg */ -INT MFDRV_SetWindowOrg( PHYSDEV dev, INT x, INT y ) +INT CDECL MFDRV_SetWindowOrg( PHYSDEV dev, INT x, INT y ) { if(!MFDRV_MetaParam2( dev, META_SETWINDOWORG, x, y )) return FALSE; @@ -80,7 +80,7 @@ INT MFDRV_SetWindowOrg( PHYSDEV dev, INT x, INT y ) /*********************************************************************** * MFDRV_OffsetViewportOrg */ -INT MFDRV_OffsetViewportOrg( PHYSDEV dev, INT x, INT y ) +INT CDECL MFDRV_OffsetViewportOrg( PHYSDEV dev, INT x, INT y ) { if(!MFDRV_MetaParam2( dev, META_OFFSETVIEWPORTORG, x, y )) return FALSE; @@ -91,7 +91,7 @@ INT MFDRV_OffsetViewportOrg( PHYSDEV dev, INT x, INT y ) /*********************************************************************** * MFDRV_OffsetWindowOrg */ -INT MFDRV_OffsetWindowOrg( PHYSDEV dev, INT x, INT y ) +INT CDECL MFDRV_OffsetWindowOrg( PHYSDEV dev, INT x, INT y ) { if(!MFDRV_MetaParam2( dev, META_OFFSETWINDOWORG, x, y )) return FALSE; @@ -102,7 +102,7 @@ INT MFDRV_OffsetWindowOrg( PHYSDEV dev, INT x, INT y ) /*********************************************************************** * MFDRV_ScaleViewportExt */ -INT MFDRV_ScaleViewportExt( PHYSDEV dev, INT xNum, INT xDenom, INT yNum, INT yDenom ) +INT CDECL MFDRV_ScaleViewportExt( PHYSDEV dev, INT xNum, INT xDenom, INT yNum, INT yDenom ) { if(!MFDRV_MetaParam4( dev, META_SCALEVIEWPORTEXT, xNum, xDenom, yNum, yDenom )) return FALSE; @@ -113,7 +113,7 @@ INT MFDRV_ScaleViewportExt( PHYSDEV dev, INT xNum, INT xDenom, INT yNum, INT yDe /*********************************************************************** * MFDRV_ScaleWindowExt */ -INT MFDRV_ScaleWindowExt( PHYSDEV dev, INT xNum, INT xDenom, INT yNum, INT yDenom ) +INT CDECL MFDRV_ScaleWindowExt( PHYSDEV dev, INT xNum, INT xDenom, INT yNum, INT yDenom ) { if(!MFDRV_MetaParam4( dev, META_SCALEWINDOWEXT, xNum, xDenom, yNum, yDenom )) return FALSE; diff --git a/dlls/gdi32/mfdrv/metafiledrv.h b/dlls/gdi32/mfdrv/metafiledrv.h dissimilarity index 71% index 67c1d66cecb..bdef9662e02 100644 --- a/dlls/gdi32/mfdrv/metafiledrv.h +++ b/dlls/gdi32/mfdrv/metafiledrv.h @@ -1,164 +1,163 @@ -/* - * Metafile driver definitions - * - * Copyright 1996 Alexandre Julliard - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#ifndef __WINE_METAFILEDRV_H -#define __WINE_METAFILEDRV_H - -#include - -#include "windef.h" -#include "winbase.h" -#include "wingdi.h" -#include "gdi_private.h" - -/* Metafile driver physical DC */ - -typedef struct -{ - HDC hdc; - METAHEADER *mh; /* Pointer to metafile header */ - UINT handles_size, cur_handles; - HGDIOBJ *handles; - HANDLE hFile; /* Handle for disk based MetaFile */ -} METAFILEDRV_PDEVICE; - -#define HANDLE_LIST_INC 20 - - -extern BOOL MFDRV_MetaParam0(PHYSDEV dev, short func) DECLSPEC_HIDDEN; -extern BOOL MFDRV_MetaParam1(PHYSDEV dev, short func, short param1) DECLSPEC_HIDDEN; -extern BOOL MFDRV_MetaParam2(PHYSDEV dev, short func, short param1, short param2) DECLSPEC_HIDDEN; -extern BOOL MFDRV_MetaParam4(PHYSDEV dev, short func, short param1, short param2, - short param3, short param4) DECLSPEC_HIDDEN; -extern BOOL MFDRV_MetaParam6(PHYSDEV dev, short func, short param1, short param2, - short param3, short param4, short param5, - short param6) DECLSPEC_HIDDEN; -extern BOOL MFDRV_MetaParam8(PHYSDEV dev, short func, short param1, short param2, - short param3, short param4, short param5, - short param6, short param7, short param8) DECLSPEC_HIDDEN; -extern BOOL MFDRV_WriteRecord(PHYSDEV dev, METARECORD *mr, DWORD rlen) DECLSPEC_HIDDEN; -extern UINT MFDRV_AddHandle( PHYSDEV dev, HGDIOBJ obj ) DECLSPEC_HIDDEN; -extern BOOL MFDRV_RemoveHandle( PHYSDEV dev, UINT index ) DECLSPEC_HIDDEN; -extern INT16 MFDRV_CreateBrushIndirect( PHYSDEV dev, HBRUSH hBrush ) DECLSPEC_HIDDEN; - -/* Metafile driver functions */ - -extern BOOL MFDRV_AbortPath( PHYSDEV dev ) DECLSPEC_HIDDEN; -extern BOOL MFDRV_Arc( PHYSDEV dev, INT left, INT top, INT right, INT bottom, - INT xstart, INT ystart, INT xend, INT yend ) DECLSPEC_HIDDEN; -extern BOOL MFDRV_BeginPath( PHYSDEV dev ) DECLSPEC_HIDDEN; -extern BOOL MFDRV_BitBlt( PHYSDEV devDst, INT xDst, INT yDst, INT width, - INT height, PHYSDEV devSrc, INT xSrc, INT ySrc, - DWORD rop ) DECLSPEC_HIDDEN; -extern BOOL MFDRV_Chord( PHYSDEV dev, INT left, INT top, INT right, - INT bottom, INT xstart, INT ystart, INT xend, - INT yend ) DECLSPEC_HIDDEN; -extern BOOL MFDRV_CloseFigure( PHYSDEV dev ) DECLSPEC_HIDDEN; -extern BOOL MFDRV_DeleteObject( PHYSDEV dev, HGDIOBJ obj ) DECLSPEC_HIDDEN; -extern BOOL MFDRV_Ellipse( PHYSDEV dev, INT left, INT top, - INT right, INT bottom ) DECLSPEC_HIDDEN; -extern BOOL MFDRV_EndPath( PHYSDEV dev ) DECLSPEC_HIDDEN; -extern INT MFDRV_ExcludeClipRect( PHYSDEV dev, INT left, INT top, INT right, INT - bottom ) DECLSPEC_HIDDEN; -extern INT MFDRV_ExtEscape( PHYSDEV dev, INT nEscape, INT cbInput, LPCVOID in_data, - INT cbOutput, LPVOID out_data ) DECLSPEC_HIDDEN; -extern BOOL MFDRV_ExtFloodFill( PHYSDEV dev, INT x, INT y, COLORREF color, UINT fillType ) DECLSPEC_HIDDEN; -extern INT MFDRV_ExtSelectClipRgn( PHYSDEV dev, HRGN hrgn, INT mode ) DECLSPEC_HIDDEN; -extern BOOL MFDRV_ExtTextOut( PHYSDEV dev, INT x, INT y, - UINT flags, const RECT *lprect, LPCWSTR str, - UINT count, const INT *lpDx ) DECLSPEC_HIDDEN; -extern BOOL MFDRV_FillPath( PHYSDEV dev ) DECLSPEC_HIDDEN; -extern BOOL MFDRV_FillRgn( PHYSDEV dev, HRGN hrgn, HBRUSH hbrush ) DECLSPEC_HIDDEN; -extern BOOL MFDRV_FlattenPath( PHYSDEV dev ) DECLSPEC_HIDDEN; -extern BOOL MFDRV_FrameRgn( PHYSDEV dev, HRGN hrgn, HBRUSH hbrush, INT x, INT y ) DECLSPEC_HIDDEN; -extern INT MFDRV_GetDeviceCaps( PHYSDEV dev , INT cap ) DECLSPEC_HIDDEN; -extern INT MFDRV_IntersectClipRect( PHYSDEV dev, INT left, INT top, INT right, INT - bottom ) DECLSPEC_HIDDEN; -extern BOOL MFDRV_InvertRgn( PHYSDEV dev, HRGN hrgn ) DECLSPEC_HIDDEN; -extern BOOL MFDRV_LineTo( PHYSDEV dev, INT x, INT y ) DECLSPEC_HIDDEN; -extern BOOL MFDRV_MoveTo( PHYSDEV dev, INT x, INT y ) DECLSPEC_HIDDEN; -extern INT MFDRV_OffsetClipRgn( PHYSDEV dev, INT x, INT y ) DECLSPEC_HIDDEN; -extern INT MFDRV_OffsetViewportOrg( PHYSDEV dev, INT x, INT y ) DECLSPEC_HIDDEN; -extern INT MFDRV_OffsetWindowOrg( PHYSDEV dev, INT x, INT y ) DECLSPEC_HIDDEN; -extern BOOL MFDRV_PaintRgn( PHYSDEV dev, HRGN hrgn ) DECLSPEC_HIDDEN; -extern BOOL MFDRV_PatBlt( PHYSDEV dev, INT left, INT top, INT width, INT height, - DWORD rop ) DECLSPEC_HIDDEN; -extern BOOL MFDRV_Pie( PHYSDEV dev, INT left, INT top, INT right, - INT bottom, INT xstart, INT ystart, INT xend, - INT yend ) DECLSPEC_HIDDEN; -extern BOOL MFDRV_PolyBezier( PHYSDEV dev, const POINT* pt, DWORD count ) DECLSPEC_HIDDEN; -extern BOOL MFDRV_PolyBezierTo( PHYSDEV dev, const POINT* pt, DWORD count ) DECLSPEC_HIDDEN; -extern BOOL MFDRV_PolyPolygon( PHYSDEV dev, const POINT* pt, const INT* counts, - UINT polygons) DECLSPEC_HIDDEN; -extern BOOL MFDRV_Polygon( PHYSDEV dev, const POINT* pt, INT count ) DECLSPEC_HIDDEN; -extern BOOL MFDRV_Polyline( PHYSDEV dev, const POINT* pt,INT count) DECLSPEC_HIDDEN; -extern BOOL MFDRV_Rectangle( PHYSDEV dev, INT left, INT top, - INT right, INT bottom) DECLSPEC_HIDDEN; -extern BOOL MFDRV_RestoreDC( PHYSDEV dev, INT level ) DECLSPEC_HIDDEN; -extern BOOL MFDRV_RoundRect( PHYSDEV dev, INT left, INT top, - INT right, INT bottom, INT ell_width, - INT ell_height ) DECLSPEC_HIDDEN; -extern INT MFDRV_SaveDC( PHYSDEV dev ) DECLSPEC_HIDDEN; -extern INT MFDRV_ScaleViewportExt( PHYSDEV dev, INT xNum, INT xDenom, INT yNum, - INT yDenom ) DECLSPEC_HIDDEN; -extern INT MFDRV_ScaleWindowExt( PHYSDEV dev, INT xNum, INT xDenom, INT yNum, - INT yDenom ) DECLSPEC_HIDDEN; -extern HBITMAP MFDRV_SelectBitmap( PHYSDEV dev, HBITMAP handle ) DECLSPEC_HIDDEN; -extern HBRUSH MFDRV_SelectBrush( PHYSDEV dev, HBRUSH handle ) DECLSPEC_HIDDEN; -extern BOOL MFDRV_SelectClipPath( PHYSDEV dev, INT iMode ) DECLSPEC_HIDDEN; -extern HFONT MFDRV_SelectFont( PHYSDEV dev, HFONT handle, HANDLE gdiFont ) DECLSPEC_HIDDEN; -extern HPEN MFDRV_SelectPen( PHYSDEV dev, HPEN handle ) DECLSPEC_HIDDEN; -extern HPALETTE MFDRV_SelectPalette( PHYSDEV dev, HPALETTE hPalette, BOOL bForceBackground) DECLSPEC_HIDDEN; -extern UINT MFDRV_RealizePalette(PHYSDEV dev, HPALETTE hPalette, BOOL primary) DECLSPEC_HIDDEN; -extern COLORREF MFDRV_SetBkColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN; -extern INT MFDRV_SetBkMode( PHYSDEV dev, INT mode ) DECLSPEC_HIDDEN; -extern INT MFDRV_SetMapMode( PHYSDEV dev, INT mode ) DECLSPEC_HIDDEN; -extern DWORD MFDRV_SetMapperFlags( PHYSDEV dev, DWORD flags ) DECLSPEC_HIDDEN; -extern COLORREF MFDRV_SetPixel( PHYSDEV dev, INT x, INT y, COLORREF color ) DECLSPEC_HIDDEN; -extern INT MFDRV_SetPolyFillMode( PHYSDEV dev, INT mode ) DECLSPEC_HIDDEN; -extern INT MFDRV_SetROP2( PHYSDEV dev, INT rop ) DECLSPEC_HIDDEN; -extern INT MFDRV_SetRelAbs( PHYSDEV dev, INT mode ) DECLSPEC_HIDDEN; -extern INT MFDRV_SetStretchBltMode( PHYSDEV dev, INT mode ) DECLSPEC_HIDDEN; -extern UINT MFDRV_SetTextAlign( PHYSDEV dev, UINT align ) DECLSPEC_HIDDEN; -extern INT MFDRV_SetTextCharacterExtra( PHYSDEV dev, INT extra ) DECLSPEC_HIDDEN; -extern COLORREF MFDRV_SetTextColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN; -extern INT MFDRV_SetTextJustification( PHYSDEV dev, INT extra, INT breaks ) DECLSPEC_HIDDEN; -extern INT MFDRV_SetViewportExt( PHYSDEV dev, INT x, INT y ) DECLSPEC_HIDDEN; -extern INT MFDRV_SetViewportOrg( PHYSDEV dev, INT x, INT y ) DECLSPEC_HIDDEN; -extern INT MFDRV_SetWindowExt( PHYSDEV dev, INT x, INT y ) DECLSPEC_HIDDEN; -extern INT MFDRV_SetWindowOrg( PHYSDEV dev, INT x, INT y ) DECLSPEC_HIDDEN; -extern BOOL MFDRV_StretchBlt( PHYSDEV devDst, INT xDst, INT yDst, INT widthDst, - INT heightDst, PHYSDEV devSrc, INT xSrc, INT ySrc, - INT widthSrc, INT heightSrc, DWORD rop ) DECLSPEC_HIDDEN; -extern BOOL MFDRV_PaintRgn( PHYSDEV dev, HRGN hrgn ) DECLSPEC_HIDDEN; -extern INT MFDRV_SetDIBitsToDevice( PHYSDEV dev, INT xDest, INT yDest, DWORD cx, - DWORD cy, INT xSrc, INT ySrc, - UINT startscan, UINT lines, LPCVOID bits, - const BITMAPINFO *info, UINT coloruse ) DECLSPEC_HIDDEN; -extern INT MFDRV_StretchDIBits( PHYSDEV dev, INT xDst, INT yDst, INT widthDst, - INT heightDst, INT xSrc, INT ySrc, - INT widthSrc, INT heightSrc, const void *bits, - const BITMAPINFO *info, UINT wUsage, - DWORD dwRop ) DECLSPEC_HIDDEN; -extern BOOL MFDRV_StrokeAndFillPath( PHYSDEV dev ) DECLSPEC_HIDDEN; -extern BOOL MFDRV_StrokePath( PHYSDEV dev ) DECLSPEC_HIDDEN; -extern BOOL MFDRV_WidenPath( PHYSDEV dev ) DECLSPEC_HIDDEN; - -#endif /* __WINE_METAFILEDRV_H */ +/* + * Metafile driver definitions + * + * Copyright 1996 Alexandre Julliard + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef __WINE_METAFILEDRV_H +#define __WINE_METAFILEDRV_H + +#include + +#include "windef.h" +#include "winbase.h" +#include "wingdi.h" +#include "gdi_private.h" + +/* Metafile driver physical DC */ + +typedef struct +{ + HDC hdc; + METAHEADER *mh; /* Pointer to metafile header */ + UINT handles_size, cur_handles; + HGDIOBJ *handles; + HANDLE hFile; /* Handle for disk based MetaFile */ +} METAFILEDRV_PDEVICE; + +#define HANDLE_LIST_INC 20 + + +extern BOOL MFDRV_MetaParam0(PHYSDEV dev, short func) DECLSPEC_HIDDEN; +extern BOOL MFDRV_MetaParam1(PHYSDEV dev, short func, short param1) DECLSPEC_HIDDEN; +extern BOOL MFDRV_MetaParam2(PHYSDEV dev, short func, short param1, short param2) DECLSPEC_HIDDEN; +extern BOOL MFDRV_MetaParam4(PHYSDEV dev, short func, short param1, short param2, + short param3, short param4) DECLSPEC_HIDDEN; +extern BOOL MFDRV_MetaParam6(PHYSDEV dev, short func, short param1, short param2, + short param3, short param4, short param5, + short param6) DECLSPEC_HIDDEN; +extern BOOL MFDRV_MetaParam8(PHYSDEV dev, short func, short param1, short param2, + short param3, short param4, short param5, + short param6, short param7, short param8) DECLSPEC_HIDDEN; +extern BOOL MFDRV_WriteRecord(PHYSDEV dev, METARECORD *mr, DWORD rlen) DECLSPEC_HIDDEN; +extern UINT MFDRV_AddHandle( PHYSDEV dev, HGDIOBJ obj ) DECLSPEC_HIDDEN; +extern BOOL MFDRV_RemoveHandle( PHYSDEV dev, UINT index ) DECLSPEC_HIDDEN; +extern INT16 MFDRV_CreateBrushIndirect( PHYSDEV dev, HBRUSH hBrush ) DECLSPEC_HIDDEN; + +/* Metafile driver functions */ + +extern BOOL CDECL MFDRV_AbortPath( PHYSDEV dev ) DECLSPEC_HIDDEN; +extern BOOL CDECL MFDRV_Arc( PHYSDEV dev, INT left, INT top, INT right, INT bottom, + INT xstart, INT ystart, INT xend, INT yend ) DECLSPEC_HIDDEN; +extern BOOL CDECL MFDRV_BeginPath( PHYSDEV dev ) DECLSPEC_HIDDEN; +extern BOOL CDECL MFDRV_BitBlt( PHYSDEV devDst, INT xDst, INT yDst, INT width, + INT height, PHYSDEV devSrc, INT xSrc, INT ySrc, + DWORD rop ) DECLSPEC_HIDDEN; +extern BOOL CDECL MFDRV_Chord( PHYSDEV dev, INT left, INT top, INT right, + INT bottom, INT xstart, INT ystart, INT xend, + INT yend ) DECLSPEC_HIDDEN; +extern BOOL CDECL MFDRV_CloseFigure( PHYSDEV dev ) DECLSPEC_HIDDEN; +extern BOOL CDECL MFDRV_DeleteObject( PHYSDEV dev, HGDIOBJ obj ) DECLSPEC_HIDDEN; +extern BOOL CDECL MFDRV_Ellipse( PHYSDEV dev, INT left, INT top, + INT right, INT bottom ) DECLSPEC_HIDDEN; +extern BOOL CDECL MFDRV_EndPath( PHYSDEV dev ) DECLSPEC_HIDDEN; +extern INT CDECL MFDRV_ExcludeClipRect( PHYSDEV dev, INT left, INT top, INT right, + INT bottom ) DECLSPEC_HIDDEN; +extern INT CDECL MFDRV_ExtEscape( PHYSDEV dev, INT nEscape, INT cbInput, LPCVOID in_data, + INT cbOutput, LPVOID out_data ) DECLSPEC_HIDDEN; +extern BOOL CDECL MFDRV_ExtFloodFill( PHYSDEV dev, INT x, INT y, COLORREF color, UINT fillType ) DECLSPEC_HIDDEN; +extern INT CDECL MFDRV_ExtSelectClipRgn( PHYSDEV dev, HRGN hrgn, INT mode ) DECLSPEC_HIDDEN; +extern BOOL CDECL MFDRV_ExtTextOut( PHYSDEV dev, INT x, INT y, + UINT flags, const RECT *lprect, LPCWSTR str, + UINT count, const INT *lpDx ) DECLSPEC_HIDDEN; +extern BOOL CDECL MFDRV_FillPath( PHYSDEV dev ) DECLSPEC_HIDDEN; +extern BOOL CDECL MFDRV_FillRgn( PHYSDEV dev, HRGN hrgn, HBRUSH hbrush ) DECLSPEC_HIDDEN; +extern BOOL CDECL MFDRV_FlattenPath( PHYSDEV dev ) DECLSPEC_HIDDEN; +extern BOOL CDECL MFDRV_FrameRgn( PHYSDEV dev, HRGN hrgn, HBRUSH hbrush, INT x, INT y ) DECLSPEC_HIDDEN; +extern INT CDECL MFDRV_GetDeviceCaps( PHYSDEV dev , INT cap ) DECLSPEC_HIDDEN; +extern INT CDECL MFDRV_IntersectClipRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom ) DECLSPEC_HIDDEN; +extern BOOL CDECL MFDRV_InvertRgn( PHYSDEV dev, HRGN hrgn ) DECLSPEC_HIDDEN; +extern BOOL CDECL MFDRV_LineTo( PHYSDEV dev, INT x, INT y ) DECLSPEC_HIDDEN; +extern BOOL CDECL MFDRV_MoveTo( PHYSDEV dev, INT x, INT y ) DECLSPEC_HIDDEN; +extern INT CDECL MFDRV_OffsetClipRgn( PHYSDEV dev, INT x, INT y ) DECLSPEC_HIDDEN; +extern INT CDECL MFDRV_OffsetViewportOrg( PHYSDEV dev, INT x, INT y ) DECLSPEC_HIDDEN; +extern INT CDECL MFDRV_OffsetWindowOrg( PHYSDEV dev, INT x, INT y ) DECLSPEC_HIDDEN; +extern BOOL CDECL MFDRV_PaintRgn( PHYSDEV dev, HRGN hrgn ) DECLSPEC_HIDDEN; +extern BOOL CDECL MFDRV_PatBlt( PHYSDEV dev, INT left, INT top, INT width, INT height, + DWORD rop ) DECLSPEC_HIDDEN; +extern BOOL CDECL MFDRV_Pie( PHYSDEV dev, INT left, INT top, INT right, + INT bottom, INT xstart, INT ystart, INT xend, + INT yend ) DECLSPEC_HIDDEN; +extern BOOL CDECL MFDRV_PolyBezier( PHYSDEV dev, const POINT* pt, DWORD count ) DECLSPEC_HIDDEN; +extern BOOL CDECL MFDRV_PolyBezierTo( PHYSDEV dev, const POINT* pt, DWORD count ) DECLSPEC_HIDDEN; +extern BOOL CDECL MFDRV_PolyPolygon( PHYSDEV dev, const POINT* pt, const INT* counts, + UINT polygons) DECLSPEC_HIDDEN; +extern BOOL CDECL MFDRV_Polygon( PHYSDEV dev, const POINT* pt, INT count ) DECLSPEC_HIDDEN; +extern BOOL CDECL MFDRV_Polyline( PHYSDEV dev, const POINT* pt,INT count) DECLSPEC_HIDDEN; +extern BOOL CDECL MFDRV_Rectangle( PHYSDEV dev, INT left, INT top, + INT right, INT bottom) DECLSPEC_HIDDEN; +extern BOOL CDECL MFDRV_RestoreDC( PHYSDEV dev, INT level ) DECLSPEC_HIDDEN; +extern BOOL CDECL MFDRV_RoundRect( PHYSDEV dev, INT left, INT top, + INT right, INT bottom, INT ell_width, + INT ell_height ) DECLSPEC_HIDDEN; +extern INT CDECL MFDRV_SaveDC( PHYSDEV dev ) DECLSPEC_HIDDEN; +extern INT CDECL MFDRV_ScaleViewportExt( PHYSDEV dev, INT xNum, INT xDenom, INT yNum, + INT yDenom ) DECLSPEC_HIDDEN; +extern INT CDECL MFDRV_ScaleWindowExt( PHYSDEV dev, INT xNum, INT xDenom, INT yNum, + INT yDenom ) DECLSPEC_HIDDEN; +extern HBITMAP CDECL MFDRV_SelectBitmap( PHYSDEV dev, HBITMAP handle ) DECLSPEC_HIDDEN; +extern HBRUSH CDECL MFDRV_SelectBrush( PHYSDEV dev, HBRUSH handle ) DECLSPEC_HIDDEN; +extern BOOL CDECL MFDRV_SelectClipPath( PHYSDEV dev, INT iMode ) DECLSPEC_HIDDEN; +extern HFONT CDECL MFDRV_SelectFont( PHYSDEV dev, HFONT handle, HANDLE gdiFont ) DECLSPEC_HIDDEN; +extern HPEN CDECL MFDRV_SelectPen( PHYSDEV dev, HPEN handle ) DECLSPEC_HIDDEN; +extern HPALETTE CDECL MFDRV_SelectPalette( PHYSDEV dev, HPALETTE hPalette, BOOL bForceBackground) DECLSPEC_HIDDEN; +extern UINT CDECL MFDRV_RealizePalette(PHYSDEV dev, HPALETTE hPalette, BOOL primary) DECLSPEC_HIDDEN; +extern COLORREF CDECL MFDRV_SetBkColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN; +extern INT CDECL MFDRV_SetBkMode( PHYSDEV dev, INT mode ) DECLSPEC_HIDDEN; +extern INT CDECL MFDRV_SetMapMode( PHYSDEV dev, INT mode ) DECLSPEC_HIDDEN; +extern DWORD CDECL MFDRV_SetMapperFlags( PHYSDEV dev, DWORD flags ) DECLSPEC_HIDDEN; +extern COLORREF CDECL MFDRV_SetPixel( PHYSDEV dev, INT x, INT y, COLORREF color ) DECLSPEC_HIDDEN; +extern INT CDECL MFDRV_SetPolyFillMode( PHYSDEV dev, INT mode ) DECLSPEC_HIDDEN; +extern INT CDECL MFDRV_SetROP2( PHYSDEV dev, INT rop ) DECLSPEC_HIDDEN; +extern INT CDECL MFDRV_SetRelAbs( PHYSDEV dev, INT mode ) DECLSPEC_HIDDEN; +extern INT CDECL MFDRV_SetStretchBltMode( PHYSDEV dev, INT mode ) DECLSPEC_HIDDEN; +extern UINT CDECL MFDRV_SetTextAlign( PHYSDEV dev, UINT align ) DECLSPEC_HIDDEN; +extern INT CDECL MFDRV_SetTextCharacterExtra( PHYSDEV dev, INT extra ) DECLSPEC_HIDDEN; +extern COLORREF CDECL MFDRV_SetTextColor( PHYSDEV dev, COLORREF color ) DECLSPEC_HIDDEN; +extern INT CDECL MFDRV_SetTextJustification( PHYSDEV dev, INT extra, INT breaks ) DECLSPEC_HIDDEN; +extern INT CDECL MFDRV_SetViewportExt( PHYSDEV dev, INT x, INT y ) DECLSPEC_HIDDEN; +extern INT CDECL MFDRV_SetViewportOrg( PHYSDEV dev, INT x, INT y ) DECLSPEC_HIDDEN; +extern INT CDECL MFDRV_SetWindowExt( PHYSDEV dev, INT x, INT y ) DECLSPEC_HIDDEN; +extern INT CDECL MFDRV_SetWindowOrg( PHYSDEV dev, INT x, INT y ) DECLSPEC_HIDDEN; +extern BOOL CDECL MFDRV_StretchBlt( PHYSDEV devDst, INT xDst, INT yDst, INT widthDst, + INT heightDst, PHYSDEV devSrc, INT xSrc, INT ySrc, + INT widthSrc, INT heightSrc, DWORD rop ) DECLSPEC_HIDDEN; +extern BOOL CDECL MFDRV_PaintRgn( PHYSDEV dev, HRGN hrgn ) DECLSPEC_HIDDEN; +extern INT CDECL MFDRV_SetDIBitsToDevice( PHYSDEV dev, INT xDest, INT yDest, DWORD cx, + DWORD cy, INT xSrc, INT ySrc, + UINT startscan, UINT lines, LPCVOID bits, + const BITMAPINFO *info, UINT coloruse ) DECLSPEC_HIDDEN; +extern INT CDECL MFDRV_StretchDIBits( PHYSDEV dev, INT xDst, INT yDst, INT widthDst, + INT heightDst, INT xSrc, INT ySrc, + INT widthSrc, INT heightSrc, const void *bits, + const BITMAPINFO *info, UINT wUsage, + DWORD dwRop ) DECLSPEC_HIDDEN; +extern BOOL CDECL MFDRV_StrokeAndFillPath( PHYSDEV dev ) DECLSPEC_HIDDEN; +extern BOOL CDECL MFDRV_StrokePath( PHYSDEV dev ) DECLSPEC_HIDDEN; +extern BOOL CDECL MFDRV_WidenPath( PHYSDEV dev ) DECLSPEC_HIDDEN; + +#endif /* __WINE_METAFILEDRV_H */ diff --git a/dlls/gdi32/mfdrv/objects.c b/dlls/gdi32/mfdrv/objects.c index f5f2aeb0b25..8370a2c22e5 100644 --- a/dlls/gdi32/mfdrv/objects.c +++ b/dlls/gdi32/mfdrv/objects.c @@ -95,8 +95,8 @@ static INT16 MFDRV_FindObject( PHYSDEV dev, HGDIOBJ obj ) /****************************************************************** * MFDRV_DeleteObject */ -BOOL MFDRV_DeleteObject( PHYSDEV dev, HGDIOBJ obj ) -{ +BOOL CDECL MFDRV_DeleteObject( PHYSDEV dev, HGDIOBJ obj ) +{ METARECORD mr; METAFILEDRV_PDEVICE *physDev = (METAFILEDRV_PDEVICE *)dev; INT16 index; @@ -137,7 +137,7 @@ static BOOL MFDRV_SelectObject( PHYSDEV dev, INT16 index) /*********************************************************************** * MFDRV_SelectBitmap */ -HBITMAP MFDRV_SelectBitmap( PHYSDEV dev, HBITMAP hbitmap ) +HBITMAP CDECL MFDRV_SelectBitmap( PHYSDEV dev, HBITMAP hbitmap ) { return 0; } @@ -334,7 +334,7 @@ done: /*********************************************************************** * MFDRV_SelectBrush */ -HBRUSH MFDRV_SelectBrush( PHYSDEV dev, HBRUSH hbrush ) +HBRUSH CDECL MFDRV_SelectBrush( PHYSDEV dev, HBRUSH hbrush ) { METAFILEDRV_PDEVICE *physDev = (METAFILEDRV_PDEVICE *)dev; INT16 index; @@ -389,7 +389,7 @@ static UINT16 MFDRV_CreateFontIndirect(PHYSDEV dev, HFONT hFont, LOGFONTW *logfo /*********************************************************************** * MFDRV_SelectFont */ -HFONT MFDRV_SelectFont( PHYSDEV dev, HFONT hfont, HANDLE gdiFont ) +HFONT CDECL MFDRV_SelectFont( PHYSDEV dev, HFONT hfont, HANDLE gdiFont ) { METAFILEDRV_PDEVICE *physDev = (METAFILEDRV_PDEVICE *)dev; LOGFONTW font; @@ -428,7 +428,7 @@ static UINT16 MFDRV_CreatePenIndirect(PHYSDEV dev, HPEN hPen, LOGPEN16 *logpen) /*********************************************************************** * MFDRV_SelectPen */ -HPEN MFDRV_SelectPen( PHYSDEV dev, HPEN hpen ) +HPEN CDECL MFDRV_SelectPen( PHYSDEV dev, HPEN hpen ) { METAFILEDRV_PDEVICE *physDev = (METAFILEDRV_PDEVICE *)dev; LOGPEN16 logpen; @@ -511,7 +511,7 @@ static BOOL MFDRV_CreatePalette(PHYSDEV dev, HPALETTE hPalette, LOGPALETTE* logP /*********************************************************************** * MFDRV_SelectPalette */ -HPALETTE MFDRV_SelectPalette( PHYSDEV dev, HPALETTE hPalette, BOOL bForceBackground ) +HPALETTE CDECL MFDRV_SelectPalette( PHYSDEV dev, HPALETTE hPalette, BOOL bForceBackground ) { #define PALVERSION 0x0300 @@ -547,7 +547,7 @@ HPALETTE MFDRV_SelectPalette( PHYSDEV dev, HPALETTE hPalette, BOOL bForceBackgro /*********************************************************************** * MFDRV_RealizePalette */ -UINT MFDRV_RealizePalette(PHYSDEV dev, HPALETTE hPalette, BOOL dummy) +UINT CDECL MFDRV_RealizePalette(PHYSDEV dev, HPALETTE hPalette, BOOL dummy) { char buffer[sizeof(METARECORD) - sizeof(WORD)]; METARECORD *mr = (METARECORD *)&buffer; diff --git a/dlls/gdi32/mfdrv/text.c b/dlls/gdi32/mfdrv/text.c index 0236493b64c..c3c182c67b5 100644 --- a/dlls/gdi32/mfdrv/text.c +++ b/dlls/gdi32/mfdrv/text.c @@ -71,7 +71,7 @@ static BOOL MFDRV_MetaExtTextOut( PHYSDEV dev, short x, short y, UINT16 flags, /*********************************************************************** * MFDRV_ExtTextOut */ -BOOL +BOOL CDECL MFDRV_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags, const RECT *lprect, LPCWSTR str, UINT count, const INT *lpDx ) diff --git a/dlls/itircl/itircl.spec b/dlls/itircl/itircl.spec index c5fc87af6d5..a9b7505d360 100644 --- a/dlls/itircl/itircl.spec +++ b/dlls/itircl/itircl.spec @@ -1,4 +1,4 @@ -@ stub DllCanUnloadNow +@ stdcall -private DllCanUnloadNow() @ stub DllGetClassObject -@ stub DllRegisterServer -@ stub DllUnregisterServer +@ stdcall -private DllRegisterServer() +@ stdcall -private DllUnregisterServer() diff --git a/dlls/itircl/itircl_main.c b/dlls/itircl/itircl_main.c index e8279cc87b3..8cd4fa0fa97 100644 --- a/dlls/itircl/itircl_main.c +++ b/dlls/itircl/itircl_main.c @@ -47,3 +47,30 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) return TRUE; } + +/*********************************************************************** + * DllRegisterServer (ITIRCL.@) + */ +HRESULT WINAPI DllRegisterServer(void) +{ + FIXME("stub\n"); + return S_FALSE; +} + +/*********************************************************************** + * DllRegisterServer (ITIRCL.@) + */ +HRESULT WINAPI DllUnregisterServer(void) +{ + FIXME("stub\n"); + return S_FALSE; +} + +/*********************************************************************** + * DllCanUnloadNow (ITIRCL.@) + */ +HRESULT WINAPI DllCanUnloadNow(void) +{ + FIXME("stub\n"); + return S_FALSE; +} diff --git a/dlls/kernel32/path.c b/dlls/kernel32/path.c index fca12ccd60f..b0f2fa0be05 100644 --- a/dlls/kernel32/path.c +++ b/dlls/kernel32/path.c @@ -1583,7 +1583,7 @@ BOOL WINAPI NeedCurrentDirectoryForExePathA( LPCSTR name ) * Return the full Unix file name for a given path. * Returned buffer must be freed by caller. */ -char *wine_get_unix_file_name( LPCWSTR dosW ) +char CDECL *wine_get_unix_file_name( LPCWSTR dosW ) { UNICODE_STRING nt_name; ANSI_STRING unix_name; @@ -1607,7 +1607,7 @@ char *wine_get_unix_file_name( LPCWSTR dosW ) * Return the full DOS file name for a given Unix path. * Returned buffer must be freed by caller. */ -WCHAR *wine_get_dos_file_name( LPCSTR str ) +WCHAR CDECL *wine_get_dos_file_name( LPCSTR str ) { UNICODE_STRING nt_name; ANSI_STRING unix_name; diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c index 918ce3e3a29..8b1fb9f5fb0 100644 --- a/dlls/kernel32/process.c +++ b/dlls/kernel32/process.c @@ -956,7 +956,7 @@ static void set_process_name( int argc, char *argv[] ) * * Wine initialisation: load and start the main exe file. */ -void __wine_kernel_init(void) +void CDECL __wine_kernel_init(void) { static const WCHAR kernel32W[] = {'k','e','r','n','e','l','3','2',0}; static const WCHAR dotW[] = {'.',0}; diff --git a/dlls/mciavi32/info.c b/dlls/mciavi32/info.c index 247b37a95f6..61b79b71dc1 100644 --- a/dlls/mciavi32/info.c +++ b/dlls/mciavi32/info.c @@ -452,7 +452,7 @@ DWORD MCIAVI_mciStatus(UINT wDevID, DWORD dwFlags, LPMCI_DGV_STATUS_PARMSW lpPar case MCI_STATUS_MEDIA_PRESENT: #endif default: - FIXME("Unknowm command %08X !\n", lpParms->dwItem); + FIXME("Unknown command %08X !\n", lpParms->dwItem); TRACE("(%04x, %08X, %p)\n", wDevID, dwFlags, lpParms); LeaveCriticalSection(&wma->cs); return MCIERR_UNRECOGNIZED_COMMAND; diff --git a/dlls/mciseq/mcimidi.c b/dlls/mciseq/mcimidi.c index f9273c74a3c..2340de90278 100644 --- a/dlls/mciseq/mcimidi.c +++ b/dlls/mciseq/mcimidi.c @@ -1470,7 +1470,7 @@ static DWORD MIDI_mciStatus(UINT wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpPar lpParms->dwReturn = wmm->dwTempo; break; default: - FIXME("Unknowm command %08X !\n", lpParms->dwItem); + FIXME("Unknown command %08X !\n", lpParms->dwItem); return MCIERR_UNRECOGNIZED_COMMAND; } } else { diff --git a/dlls/mshtml/editor.c b/dlls/mshtml/editor.c index efbaf238c77..7cbdf2e46d9 100644 --- a/dlls/mshtml/editor.c +++ b/dlls/mshtml/editor.c @@ -137,7 +137,7 @@ static nsresult get_ns_command_state(NSContainer *This, const char *cmd, nsIComm return nsres; } - nsres = nsICommandManager_GetCommandState(cmdmgr, cmd, NULL, nsparam); + nsres = nsICommandManager_GetCommandState(cmdmgr, cmd, This->doc->window->nswindow, nsparam); if(NS_FAILED(nsres)) ERR("GetCommandState(%s) failed: %08x\n", debugstr_a(cmd), nsres); diff --git a/dlls/mshtml/htmlstylesheet.c b/dlls/mshtml/htmlstylesheet.c index b074c255b65..adbe740db45 100644 --- a/dlls/mshtml/htmlstylesheet.c +++ b/dlls/mshtml/htmlstylesheet.c @@ -56,8 +56,8 @@ typedef struct { nsIDOMCSSRuleList *nslist; } HTMLStyleSheetRulesCollection; -#define HTMLSTYLESHEET(x) ((IHTMLStyleSheet*) &(x)->lpHTMLStyleSheetVtbl); -#define HTMLSTYLESHEETSCOL(x) ((IHTMLStyleSheetsCollection*) &(x)->lpHTMLStyleSheetsCollectionVtbl); +#define HTMLSTYLESHEET(x) ((IHTMLStyleSheet*) &(x)->lpHTMLStyleSheetVtbl) +#define HTMLSTYLESHEETSCOL(x) ((IHTMLStyleSheetsCollection*) &(x)->lpHTMLStyleSheetsCollectionVtbl) #define HTMLSTYLERULESCOL(x) ((IHTMLStyleSheetRulesCollection*) &(x)->lpHTMLStyleSheetRulesCollectionVtbl) #define HTMLSTYLERULESCOL_THIS(iface) \ diff --git a/dlls/mshtml/nsembed.c b/dlls/mshtml/nsembed.c index 34bc6d5dc89..a653e245a4a 100644 --- a/dlls/mshtml/nsembed.c +++ b/dlls/mshtml/nsembed.c @@ -371,7 +371,6 @@ static void set_bool_pref(nsIPrefBranch *pref, const char *pref_name, BOOL val) static void set_profile(void) { - nsIPrefBranch *pref; nsIProfile *profile; PRBool exists = FALSE; nsresult nsres; @@ -397,6 +396,12 @@ static void set_profile(void) ERR("SetCurrentProfile failed: %08x\n", nsres); nsIProfile_Release(profile); +} + +static void set_preferences(void) +{ + nsIPrefBranch *pref; + nsresult nsres; nsres = nsIServiceManager_GetServiceByContractID(pServMgr, NS_PREFERENCES_CONTRACTID, &IID_nsIPrefBranch, (void**)&pref); @@ -469,6 +474,7 @@ static BOOL init_xpcom(const PRUnichar *gre_path) } set_profile(); + set_preferences(); nsres = nsIComponentManager_CreateInstanceByContractID(pCompMgr, NS_MEMORY_CONTRACTID, NULL, &IID_nsIMemory, (void**)&nsmem); diff --git a/dlls/mshtml/nsio.c b/dlls/mshtml/nsio.c index 1dca2a49eb1..c918d12ff72 100644 --- a/dlls/mshtml/nsio.c +++ b/dlls/mshtml/nsio.c @@ -219,6 +219,8 @@ static nsrefcnt NSAPI nsChannel_Release(nsIHttpChannel *iface) nsIChannel_Release(This->channel); if(This->http_channel) nsIHttpChannel_Release(This->http_channel); + if(This->owner) + nsISupports_Release(This->owner); if(This->post_data_stream) nsIInputStream_Release(This->post_data_stream); if(This->load_group) diff --git a/dlls/mshtml/olecmd.c b/dlls/mshtml/olecmd.c index 0b1b477e9c8..a122e0cb089 100644 --- a/dlls/mshtml/olecmd.c +++ b/dlls/mshtml/olecmd.c @@ -52,7 +52,7 @@ void do_ns_command(NSContainer *This, const char *cmd, nsICommandParams *nsparam return; } - nsres = nsICommandManager_DoCommand(cmdmgr, cmd, nsparam, NULL); + nsres = nsICommandManager_DoCommand(cmdmgr, cmd, nsparam, This->doc->window->nswindow); if(NS_FAILED(nsres)) ERR("DoCommand(%s) failed: %08x\n", debugstr_a(cmd), nsres); diff --git a/dlls/msi/media.c b/dlls/msi/media.c index a236eba4daf..28b6e2fd96b 100644 --- a/dlls/msi/media.c +++ b/dlls/msi/media.c @@ -145,17 +145,17 @@ end: return rc; } -static void *cabinet_alloc(ULONG cb) +static void CDECL *cabinet_alloc(ULONG cb) { return msi_alloc(cb); } -static void cabinet_free(void *pv) +static void CDECL cabinet_free(void *pv) { msi_free(pv); } -static INT_PTR cabinet_open(char *pszFile, int oflag, int pmode) +static INT_PTR CDECL cabinet_open(char *pszFile, int oflag, int pmode) { HANDLE handle; DWORD dwAccess = 0; @@ -191,7 +191,7 @@ static INT_PTR cabinet_open(char *pszFile, int oflag, int pmode) return (INT_PTR)handle; } -static UINT cabinet_read(INT_PTR hf, void *pv, UINT cb) +static UINT CDECL cabinet_read(INT_PTR hf, void *pv, UINT cb) { HANDLE handle = (HANDLE)hf; DWORD read; @@ -202,7 +202,7 @@ static UINT cabinet_read(INT_PTR hf, void *pv, UINT cb) return 0; } -static UINT cabinet_write(INT_PTR hf, void *pv, UINT cb) +static UINT CDECL cabinet_write(INT_PTR hf, void *pv, UINT cb) { HANDLE handle = (HANDLE)hf; DWORD written; @@ -213,20 +213,20 @@ static UINT cabinet_write(INT_PTR hf, void *pv, UINT cb) return 0; } -static int cabinet_close(INT_PTR hf) +static int CDECL cabinet_close(INT_PTR hf) { HANDLE handle = (HANDLE)hf; return CloseHandle(handle) ? 0 : -1; } -static long cabinet_seek(INT_PTR hf, long dist, int seektype) +static long CDECL cabinet_seek(INT_PTR hf, long dist, int seektype) { HANDLE handle = (HANDLE)hf; /* flags are compatible and so are passed straight through */ return SetFilePointer(handle, dist, NULL, seektype); } -static UINT msi_media_get_disk_info(MSIPACKAGE *package, MSIMEDIAINFO *mi) +static UINT CDECL msi_media_get_disk_info(MSIPACKAGE *package, MSIMEDIAINFO *mi) { MSIRECORD *row; LPWSTR ptr; @@ -374,7 +374,7 @@ static INT_PTR cabinet_close_file_info(FDINOTIFICATIONTYPE fdint, return 1; } -static INT_PTR cabinet_notify(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION pfdin) +static INT_PTR CDECL cabinet_notify(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION pfdin) { TRACE("(%d)\n", fdint); diff --git a/dlls/msvcrt/tests/file.c b/dlls/msvcrt/tests/file.c index 66a0035b4a8..0f235b52ed9 100644 --- a/dlls/msvcrt/tests/file.c +++ b/dlls/msvcrt/tests/file.c @@ -320,15 +320,15 @@ static void test_asciimode2(void) char ibuf[4]; int i; static const char obuf[] = -"00\n\ -000000000000000000000000000000000000000000000000000000000000000000000000000000\n\ -000000000000000000000000000000000000000000000000000000000000000000000000000000\n\ -000000000000000000000000000000000000000000000000000000000000000000000000000000\n\ -000000000000000000000000000000000000000000000000000000000000000000000000000000\n\ -000000000000000000000000000000000000000000000000000000000000000000000000000000\n\ -000000000000000000000000000000000000000000000000000000000000000000000000000000\n\ -000000000000000000\n\ -1111111111111111111"; +"00\n" +"000000000000000000000000000000000000000000000000000000000000000000000000000000\n" +"000000000000000000000000000000000000000000000000000000000000000000000000000000\n" +"000000000000000000000000000000000000000000000000000000000000000000000000000000\n" +"000000000000000000000000000000000000000000000000000000000000000000000000000000\n" +"000000000000000000000000000000000000000000000000000000000000000000000000000000\n" +"000000000000000000000000000000000000000000000000000000000000000000000000000000\n" +"000000000000000000\n" +"1111111111111111111"; fp = fopen("ascii2.tst", "wt"); fwrite(obuf, 1, sizeof(obuf), fp); diff --git a/dlls/msvfw32/msvideo_main.c b/dlls/msvfw32/msvideo_main.c index fa02716fbe9..247c00e7d62 100644 --- a/dlls/msvfw32/msvideo_main.c +++ b/dlls/msvfw32/msvideo_main.c @@ -1026,9 +1026,9 @@ void VFWAPI ICCompressorFree(PCOMPVARS pc) LRESULT MSVIDEO_SendMessage(WINE_HIC* whic, UINT msg, DWORD_PTR lParam1, DWORD_PTR lParam2) { LRESULT ret; - -#define XX(x) case x: TRACE("(%p,"#x",0x%08lx,0x%08lx)\n",whic,lParam1,lParam2); break; - + +#define XX(x) case x: TRACE("(%p,"#x",0x%08lx,0x%08lx)\n",whic,lParam1,lParam2); break + switch (msg) { /* DRV_* */ XX(DRV_LOAD); diff --git a/dlls/msxml3/node.c b/dlls/msxml3/node.c index 3169f351fe2..69601e39733 100644 --- a/dlls/msxml3/node.c +++ b/dlls/msxml3/node.c @@ -864,32 +864,18 @@ static HRESULT WINAPI xmlnode_get_text( { xmlnode *This = impl_from_IXMLDOMNode( iface ); BSTR str = NULL; + xmlChar *pContent; - TRACE("%p\n", This); + TRACE("%p type %d\n", This, This->node->type); if ( !text ) return E_INVALIDARG; - switch(This->node->type) - { - case XML_ELEMENT_NODE: - case XML_ATTRIBUTE_NODE: + pContent = xmlNodeGetContent((xmlNodePtr)This->node); + if(pContent) { - xmlNodePtr child = This->node->children; - if ( child && child->type == XML_TEXT_NODE ) - str = bstr_from_xmlChar( child->content ); - break; - } - - case XML_TEXT_NODE: - case XML_CDATA_SECTION_NODE: - case XML_PI_NODE: - case XML_COMMENT_NODE: - str = bstr_from_xmlChar( This->node->content ); - break; - - default: - FIXME("Unhandled node type %d\n", This->node->type); + str = bstr_from_xmlChar(pContent); + xmlFree(pContent); } /* Always return a string. */ diff --git a/dlls/msxml3/tests/domdoc.c b/dlls/msxml3/tests/domdoc.c index 0c8c14786ab..3d2944a10f2 100644 --- a/dlls/msxml3/tests/domdoc.c +++ b/dlls/msxml3/tests/domdoc.c @@ -260,6 +260,20 @@ static BOOL compareIgnoreReturns(BSTR sLeft, BSTR sRight) } } +static BOOL compareIgnoreReturnsWhitespace(BSTR sLeft, BSTR sRight) +{ + /* MSXML3 inserts whitespace where as libxml doesn't. */ + for (;;) + { + while (*sLeft == '\r' || *sLeft == '\n' || *sLeft == ' ') sLeft++; + while (*sRight == '\r' || *sRight == '\n' || *sRight == ' ') sRight++; + if (*sLeft != *sRight) return FALSE; + if (!*sLeft) return TRUE; + sLeft++; + sRight++; + } +} + static void get_str_for_type(DOMNodeType type, char *buf) { switch (type) @@ -1706,6 +1720,7 @@ static void test_get_text(void) VARIANT_BOOL b; IXMLDOMDocument *doc; IXMLDOMNode *node, *node2, *node3; + IXMLDOMNode *nodeRoot; IXMLDOMNodeList *node_list; IXMLDOMNamedNodeMap *node_map; long len; @@ -1726,6 +1741,19 @@ static void test_get_text(void) ok( r == S_OK, "ret %08x\n", r ); SysFreeString(str); + /* Test to get all child node text. */ + r = IXMLDOMDocument_QueryInterface(doc, &IID_IXMLDOMNode, (LPVOID*)&nodeRoot); + ok( r == S_OK, "ret %08x\n", r ); + if(r == S_OK) + { + r = IXMLDOMNode_get_text( nodeRoot, &str ); + ok( r == S_OK, "ret %08x\n", r ); + ok( compareIgnoreReturnsWhitespace(str, _bstr_("fn1.txt\n\n fn2.txt \n\nf1\n")), "wrong get_text\n"); + SysFreeString(str); + + IXMLDOMNode_Release(nodeRoot); + } + if (0) { /* this test crashes on win9x */ r = IXMLDOMNodeList_QueryInterface(node_list, &IID_IDispatch, NULL); diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 3bada928eec..968d7fd68a7 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -2652,7 +2652,7 @@ void __wine_process_init(void) WINE_MODREF *wm; NTSTATUS status; ANSI_STRING func_name; - void (* DECLSPEC_NORETURN init_func)(void); + void (* DECLSPEC_NORETURN CDECL init_func)(void); extern mode_t FILE_umask; main_exe_file = thread_init(); diff --git a/dlls/ntdll/serial.c b/dlls/ntdll/serial.c index 95be78d8b8f..e174c12c1d7 100644 --- a/dlls/ntdll/serial.c +++ b/dlls/ntdll/serial.c @@ -800,39 +800,25 @@ static NTSTATUS set_wait_mask(HANDLE hDevice, DWORD mask) return status; } +/* + * does not change IXOFF but simulates that IXOFF has been received: + */ static NTSTATUS set_XOff(int fd) { - struct termios port; - - if (tcgetattr(fd,&port) == -1) - { - FIXME("tcgetattr on fd %d failed (%s)!\n", fd, strerror(errno)); - return FILE_GetNtStatus(); - - - } - port.c_iflag |= IXOFF; - if (tcsetattr(fd, TCSADRAIN, &port) == -1) + if (tcflow(fd, TCOOFF)) { - FIXME("tcsetattr on fd %d failed (%s)!\n", fd, strerror(errno)); return FILE_GetNtStatus(); } return STATUS_SUCCESS; } +/* + * does not change IXON but simulates that IXON has been received: + */ static NTSTATUS set_XOn(int fd) { - struct termios port; - - if (tcgetattr(fd,&port) == -1) - { - FIXME("tcgetattr on fd %d failed (%s)!\n", fd, strerror(errno)); - return FILE_GetNtStatus(); - } - port.c_iflag |= IXON; - if (tcsetattr(fd, TCSADRAIN, &port) == -1) + if (tcflow(fd, TCOON)) { - FIXME("tcsetattr on fd %d failed (%s)!\n", fd, strerror(errno)); return FILE_GetNtStatus(); } return STATUS_SUCCESS; diff --git a/dlls/ole32/clipboard.c b/dlls/ole32/clipboard.c index 762afc7c3bf..9b290bb314f 100644 --- a/dlls/ole32/clipboard.c +++ b/dlls/ole32/clipboard.c @@ -1246,7 +1246,8 @@ static HRESULT WINAPI OLEClipbrd_IDataObject_GetData( } if ( pformatetcIn->lindex != -1 ) - return DV_E_LINDEX; + return DV_E_FORMATETC; + if ( (pformatetcIn->tymed & TYMED_HGLOBAL) != TYMED_HGLOBAL ) return DV_E_TYMED; /* diff --git a/dlls/ole32/tests/clipboard.c b/dlls/ole32/tests/clipboard.c index 7e3809e620e..8445f8b1c0f 100644 --- a/dlls/ole32/tests/clipboard.c +++ b/dlls/ole32/tests/clipboard.c @@ -200,7 +200,7 @@ static HRESULT WINAPI DataObjectImpl_GetData(IDataObject* iface, FORMATETC *pfor DataObjectImpl_GetData_calls++; if(pformatetc->lindex != -1) - return DV_E_LINDEX; + return DV_E_FORMATETC; if(!(pformatetc->tymed & TYMED_HGLOBAL)) return DV_E_TYMED; @@ -400,7 +400,6 @@ static void test_get_clipboard(void) InitFormatEtc(fmtetc, CF_TEXT, TYMED_HGLOBAL); fmtetc.lindex = 256; hr = IDataObject_GetData(data_obj, &fmtetc, &stgmedium); - todo_wine ok(hr == DV_E_FORMATETC || broken(hr == S_OK), "IDataObject_GetData should have failed with DV_E_FORMATETC instead of 0x%08x\n", hr); if (hr == S_OK) { diff --git a/dlls/pidgen/Makefile.in b/dlls/pidgen/Makefile.in index e05833d6c28..797417af38f 100644 --- a/dlls/pidgen/Makefile.in +++ b/dlls/pidgen/Makefile.in @@ -8,7 +8,7 @@ IMPORTS = kernel32 C_SRCS = \ main.c -RS_SRCS = rsrc.rc +RC_SRCS = rsrc.rc @MAKE_DLL_RULES@ diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index 696061a3bb8..c93a1e484f5 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -1616,7 +1616,7 @@ ME_StreamInRTFString(ME_TextEditor *editor, BOOL selection, char *string) data.string = string; data.length = strlen(string); data.pos = 0; - es.dwCookie = (DWORD)&data; + es.dwCookie = (DWORD_PTR)&data; es.pfnCallback = ME_ReadFromRTFString; ME_StreamIn(editor, SF_RTF | (selection ? SFF_SELECTION : 0), &es, FALSE); } @@ -2065,7 +2065,7 @@ static BOOL ME_Paste(ME_TextEditor *editor) return FALSE; gds.hData = GetClipboardData(cf); gds.nLength = 0; - es.dwCookie = (DWORD)&gds; + es.dwCookie = (DWORD_PTR)&gds; es.pfnCallback = dwFormat == SF_RTF ? ME_ReadFromHGLOBALRTF : ME_ReadFromHGLOBALUnicode; ME_StreamIn(editor, dwFormat|SFF_SELECTION, &es, FALSE); diff --git a/dlls/riched20/table.c b/dlls/riched20/table.c index 3581306547a..c9aadb00f72 100644 --- a/dlls/riched20/table.c +++ b/dlls/riched20/table.c @@ -54,8 +54,7 @@ #include "editor.h" #include "rtf.h" -WINE_DEFAULT_DEBUG_CHANNEL(richedit); -WINE_DECLARE_DEBUG_CHANNEL(richedit_lists); +WINE_DEFAULT_DEBUG_CHANNEL(richedit_lists); static ME_DisplayItem* ME_InsertEndParaFromCursor(ME_TextEditor *editor, int nCursor, @@ -176,7 +175,7 @@ void ME_CheckTablesForCorruption(ME_TextEditor *editor) { if(TRACE_ON(richedit_lists)) { - TRACE_(richedit_lists)("---\n"); + TRACE("---\n"); ME_DumpDocument(editor->pBuffer); } #ifndef NDEBUG diff --git a/dlls/rpcrt4/rpc_transport.c b/dlls/rpcrt4/rpc_transport.c index 815ed64c19e..d635d499b4b 100644 --- a/dlls/rpcrt4/rpc_transport.c +++ b/dlls/rpcrt4/rpc_transport.c @@ -732,6 +732,8 @@ static RPC_STATUS rpcrt4_ncalrpc_parse_top_of_tower(const unsigned char *tower_d /**** ncacn_ip_tcp support ****/ +#ifdef HAVE_SOCKETPAIR + typedef struct _RpcConnection_tcp { RpcConnection common; @@ -1372,6 +1374,8 @@ static int rpcrt4_protseq_sock_wait_for_new_connection(RpcServerProtseq *protseq return 1; } +#endif /* HAVE_SOCKETPAIR */ + static const struct connection_ops conn_protseq_list[] = { { "ncacn_np", { EPM_PROTOCOL_NCACN, EPM_PROTOCOL_SMB }, @@ -1399,6 +1403,7 @@ static const struct connection_ops conn_protseq_list[] = { rpcrt4_ncalrpc_get_top_of_tower, rpcrt4_ncalrpc_parse_top_of_tower, }, +#ifdef HAVE_SOCKETPAIR { "ncacn_ip_tcp", { EPM_PROTOCOL_NCACN, EPM_PROTOCOL_TCP }, rpcrt4_conn_tcp_alloc, @@ -1412,6 +1417,7 @@ static const struct connection_ops conn_protseq_list[] = { rpcrt4_ncacn_ip_tcp_get_top_of_tower, rpcrt4_ncacn_ip_tcp_parse_top_of_tower, } +#endif }; @@ -1435,6 +1441,7 @@ static const struct protseq_ops protseq_list[] = rpcrt4_protseq_np_wait_for_new_connection, rpcrt4_protseq_ncalrpc_open_endpoint, }, +#ifdef HAVE_SOCKETPAIR { "ncacn_ip_tcp", rpcrt4_protseq_sock_alloc, @@ -1444,6 +1451,7 @@ static const struct protseq_ops protseq_list[] = rpcrt4_protseq_sock_wait_for_new_connection, rpcrt4_protseq_ncacn_ip_tcp_open_endpoint, }, +#endif }; #define ARRAYSIZE(a) (sizeof((a)) / sizeof((a)[0])) diff --git a/dlls/secur32/dispatcher.c b/dlls/secur32/dispatcher.c index 5707e6a2546..91f425ca1f9 100644 --- a/dlls/secur32/dispatcher.c +++ b/dlls/secur32/dispatcher.c @@ -44,6 +44,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(ntlm); SECURITY_STATUS fork_helper(PNegoHelper *new_helper, const char *prog, char* const argv[]) { +#ifdef HAVE_FORK int pipe_in[2]; int pipe_out[2]; int i; @@ -132,6 +133,10 @@ SECURITY_STATUS fork_helper(PNegoHelper *new_helper, const char *prog, } return SEC_E_OK; +#else + ERR( "no fork support on this platform\n" ); + return SEC_E_INTERNAL_ERROR; +#endif } static SECURITY_STATUS read_line(PNegoHelper helper, int *offset_len) diff --git a/dlls/shell32/folder.ico b/dlls/shell32/folder.ico dissimilarity index 80% index 8527794d80b5b4de263b31d3398cab0ea3041d48..d748166052edb7ee1e315d0dba3bce855f7d60a2 100644 GIT binary patch literal 15086 zcwX&Wd013O5`S+7qG*(JxKu8K#<)gz)zx?tiHLx5%`o>2!#Tik--v>Us8McE4nYtU z?;A8m7ju}HxY2|dLtJ%tW7K35kE~g@#Nyi6Y11qj>r=Opn(^zpf*hUt>>(_qNVg9vyFy(J|!SSm* zVEyGCutYFJdPjbt(S80qV8?Df;V1NSc9N|D8)ada_D{kBgh@!ZL1M$1#nOm5_94Y! z6}_3UU3ZK~ZanvfD15ekbRBRK>lo|zXrI#XzME9#>X3Q>I4kzSYoFfiGp2p~H4IN` z_=~G7$#2xEcfc&A891@K!7{2Itdv{8I=qU&DxwA~RgJ)j+Y6>C$G{}x6ig1vj-!O- zrW7~d2)7@%_6(S2o(9w9e*yEf<6x0|81-jA*d{dnIxf2Mx?^np9qZJiV3BbGY|@VY zIy+>ANb9>ULGg+u)feDT1s}nr4Ik=YpZgw656@eL>v(y24fBvlCb&tXT^1`84ok%DlWnhf&X20My8$^*}uaLo`73vo-DT zI^%$_fYMuMOsGK_lqZU@B*)QMkp0GpfSkbL!gVRb`FU|K2CRuvN>u8jweJ%UFm944=|?;HdaxJgfMNboWJ!3e$6=|1S| zH=4fyI;i}v*1oT=uge5cTBm~~2iZ>ttJK;qF~RgJ_h1}~VQ{Q51%h-i8;RhR^wLfh8{L(Ar-bAmol0uLL~) zj{N0dt}0`UQS>qQ>OGixMID!6;23HG;)mlt9H-f!aU0QXE?I&CpyXLYv3<7yq10Kn z8tkNN!9lnZ%v9x!HlGHVC+3CyiX|%Uq_}0)*uFbgs2m%(7VH8yfP;7yn5z08^YsVV zr`VE`PRcKTBDVjAC^*3}qyR<-6_PP9j;UhQ@vJbw_J!-6vHe8?MXG&R8H@@mhcSwL zFiG6X*#22T?DI=(iG4|Eo@4Y@u#MOPqe9ETEUBKc{j-84ME=KJYfQ#p61K)JVJBFt z8W4wSFime_Z2znv{;#p`E>*tih+=)K_&s19-3S(0dl}n53+AJ}n1Q&c6Gf^t>Ax&u z)7b12D84@emhpSRBxO6i+Wa{}TUQ+YtS7qHA?>>3B1~@i?BV3&7ypAX@z8|_hO&}h zwd>Ct(#Xv(<(&bujJLr8?N`iVcY#?{BbZ0jfq8fhaKb8q6S^5JgEt|RA(U#$a^Rr2 zgA-Z_7U9)k5mAfUZA0tF4ls$`1I7slVPsM>j7)BUDYA^?Bp%X2Q246W{vugq#j6|7 zlD&?ZZm)yJB4IyR#_a;Dm>tA7tX1`39aRT5QMCwL$!BZTHZ*73!78>1jolu!KRTf9 zL;4A%uT{N&LRg?kJVHH27Ri)5rWbvrt4nxfoK*8jISQPlLuxKazh&HR!by$YWWI<^ zR0rF|ZE#zCT^RF%(%ycYeb>O)y4N><(xZ)bJn+0=z2>Pc#0KVMk#YnkMHGBDD|mU^ z%;3!SY2ms5{6lo<56dxici2g``stbXMbg}B(&v^F{S^SmQ-_RW=6yPnb~_g zXXhS<`D6<`LIp0cAY(3C@K~_)L zcLDuyWfl#P#YPscJu-&RDew`goYFg|c!?U6K^c@m8I-<=X;3rhxHx%ao8-4ya{vGXuI`CdZ2Vvnuv^U6l0)5)ekAH1q;L46+vO;{00W4K5 z&}ln>&fW*~+QUGvKiU=RjsQOU>w(;ZUBBlXc!ZUEfL^{!gPll!6VM6U9wDg#=oPz> zZe*|aJ)jSK3iRF!z>3|9`+)Yg`OA7E?<@ATnad0M-Zs1f@Oh(A*k+(kUu8Zs87Q3n z23XP(pk>9kdgG7cvsY&ELT}@JGCnV`k!=Kn-2KdY2N3keX7wCMi|l&gKWQdUd3Q{3 z2{~`Eljeb;vVu|Pfa0xo@+`2$#pS*5e{BXg{O%Yu_V)61I-%H8nfPk0zP9V zK2-8mcmDqV{&S~s!+*kKkI#D@M61ADvW}dKGwK~cu#&d}EiL}3JAXeO&uuC%>b{-) zO>$o8Aj|?AeipDdpJLQGke~~X<7c3w`}@Gh-+vk6|Fhb6a==lL31fH}V34(kQRhH{ zZak|#qY@U*>&oAUJ2@ckzjiXjUz|hEi=DX1XrJFe&ZY4=Fh2iv(&XodeQ}%7*7E>; zs7?Jo3)raC=kLw+l~3WvJtSw%$oDb-v53EA^5gUL_}m!x$*%nlxo7ZPauVHf@-pF% z-rsNP^Iz)cqnIQ}0{!vF{LSNP7|;E5=YQAk!DLN;UVL8jgWqF#4V4rh=)&K}Cw`JJ z1?&lbH2wlLf79rvKl9d~AAA>NIO@~Ti?_kx;tx9Xd(QA0iuub*&g%2`;PKO65vBpo z)#0_@QJ4u%yc8H2`FwK*TFgUzeeLR_=WHx`&aBXLX4K0(vP4B_4J~QY=kMvy%XvkT z3F`HK4SEJvf>S^m7)Mnw+J4@^{lYmTZC_ZjQuGchy{ymQjVCF1S(-)i6uM^s`Oxoy zzZNbCc>QCAR^ai!uFro7PgFKuz6Ql^MaYLX=-y$*%7O8p{@{i1N<9AG=<|2yiR&f= zuSc0t7Y9fWIE591t+JZr>qyQJ`O%2zYDRqn4Z>em+TMjfUw*_sqLSoKMj`*w?qf#A z)-viFXc)>%d+>J?NKe?Swvv31O=PXE52o?`zvuV7!4?(b_2-g4|0Tk}R;Tzzu#DT; zr4MFF+Zgo?G)Vj=EBi#Bzq?Rz+BtncSSIY#^}#x_1~|)iGU^*h%x}M~jvu6@?{^u0 zLE!u2vs%C+>99Jd7rP5MQK%1j2N`t^BxYZ@so`I8Sf9U#P;qWT?nzya6z3jsuGU0Z z3C@ilYVg5thz}oOdv}~A7}xkghjY`}2l{ZTd-rFw|3c3|QK>$EPjS#E6W6^9X3J0M z@~akT9!yamOe5>TTvVD^u4; z?Qnad2kFClv3?U(6PU#82IIJWFf#rij7U5}FkKvX6UF(i-N6}}R?*wlxoK^_I--W$ufXpOTV<7c-9o^h$?phwEgW%c z$Bf2@bH>vUlm&;`{amV5* zR$QJ}_E)f7^=?-^I8UDbw#KKL)z1bRGyHtuz7RenXOFnWb_HGo$lr9FHRDZqx2VUQ zSW)XrEPb4rUa8{6w9^ukiDs*BA92hGTm77@EO8 zuAyV0Ec&LqIPf3tqM$2_#Ua-hA%B>!NV+v6Jm>pYBMTqA98(RBi929a3YyFG6PWb?NaayvtUbt!1f5x{vsvBR2Gwoz7D^;c zw*H@j{X!@dn)*n5Ed7LjP8jGnGp2TfGAO@CQQsEoe@QOc8&lNZ^~)jMN_Ia>`tfD! YK$Os*k_I*@*&5*G+Dv*R;Y!k<@P4RZ|QE6j6LZ1{&ox&`k4*j|>!05PYO! zrkP3M_1>~1MG+I_je-hV;vU zIrD9zHe^U0JCYdQGNM<}_UIw)@5SR^;IaPw`Mw2_eHWtM*cQ47hqWPou#6r|*x6Yc zEm$yBU_5`mhoQH(t41qVI?2|oaTFMOd5xyw!(Sl>ho=qJ?=O&L{9b-fGH(>ie0}|C zg6C9&fMZOSbn~7epDll?|LWD7Xwtjxf2#kCh2!O4zpY+iZJz1KSC^DsHpg5Ds6%9@q=tK*0CkC(*QbM^R1)#lo zv)}z9jz4hVGU@e?-y)75a!_Z#`$Zgo(4Yn4_~WPS(EIpHjxd8yqL}Q|Ey+m@Qq`o~ zY?7?zUdA8ix}ES{+u+l~OqNmJjM3S0W(+3SHifp>HalC!+GUinC!js{J3vS11fAjU z@Fa8rb9f4#hG)>PD_EqZC3Ld2mEQli-uZ+!o?w;{N7>+-hdW42FXZ zjDR=57SD|YdvE|p7zLxj3C4gkjK#6zzy-#`M3{ufCxiDdznmNB<`yiD@9w#Q!qeEq z$XK?pq@FE;#oz-=U@0tv|`UE{98FIAE&obXzQ4f7#+*w}nXzZEr7^=(E~TqRe* zl?xgemBB6Urd&OvQm%w6=86P(UB7dMkcYV)GGrk&g&~a@vk3Qm`zSB30XHyAtIL-g z$jvR9X3pG4GiU9iS=^E(duZ855wvpEcjO-!NsE0B(fox+B#VyFJf&?f?>!`+d(~(| zix(%gIDTkomYDB@im_uoC?w=EpE<>Ex@RkW6P;0bCYqT6D zWMHtA+O^w2?b~k@nVIc`FPkwo-bp4Vn;}#ynQSf28KlD!@VN)V|9H)xW;3%O*1H#IeZCOJ7FT4iSkn_j!--=g&NAmiBBKv8t`$JDiJII?|KE&EQ?v16=pdivM* zgUN*ppWkn$)zv}5oXGa5g-qSii^ z`6o;Hnl`8#Vr-keGizLCz%Fs=T@`XnVGq(3Jdpl>C(ktk^gXqBsyBmo_u>An^{!PW^wPsZ1{ki zQ&h+1!iU^En9nUJu44<)F2Zqw#o$vcS%U4Qu#8)d$37~OtbmWv&$n3OhwYWzDjeqz z0bF2FE!%wcYGFiCQDXP*-GdbQ4;z_8i8op2vF^-yT^Mr;4P%Z0>)Ej70nE-fh&hLZ zF`w9zY;#E++gg5`eOhr_T=yyXOkDpdtpVLp(ZD{hkk*0fXiu^~|$H{BU3KzJaD-=3~?PY!3r?b9O z|HJxva8o5#avsysPM2EF5_-8ed9ek(b+8&VsIXtZeob{^Asj}>sMMU*>(0uxXLN1xjwH)#BCb@pAbZ zYV*qV`DQhG4R!jK=1Wulue^GIN~@dd@`~ELQhmNmtxm5}t5>VnE7$Cs)$P@4_sa97 zan6+HD_=|g&pb1jyu9-1+kN$vl+5UMW0M9Y^-6?w--24M6z^?8iJDRl+t-Wn{&3}Z z4OMp}m3P$EH8iNsneu!cO{gVH%lDh*FNLtad^nk#@1o + inkscape:current-layer="g3975" + showgrid="false"> + + + id="linearGradient3963"> + id="stop3965" /> + id="stop3967" /> - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + gradientTransform="matrix(2.774389,0,0,1.969706,-1892.179,-872.8854)" + x1="302.85715" + y1="366.64789" + x2="302.85715" + y2="609.50507" /> + + + + + + + + + + gradientTransform="matrix(1.1903441,-0.4484476,0.3804416,1.0098313,-150.24895,119.22569)" + cx="169.61081" + cy="82.940277" + fx="169.61081" + fy="82.940277" + r="80.413557" /> - - - - + + + + + + + + diff --git a/dlls/shell32/folder_open.ico b/dlls/shell32/folder_open.ico dissimilarity index 81% index 685411bf3a28bac3673ef26040391a3bbf3c482c..fac9b64b33cc5d468a76f520d7e5e3280e6eb028 100644 GIT binary patch literal 15086 zcwX&W2~<=^)_&bBqH#fXK{hoeI)D6KV&ZWJch-mm=$-DSX%!WPurIR6E<4Juf&vN{ zS7O}7HE~PSsKgi@{+Wr!T{AhE%!%Pn-D(<}7I+Y4{yB5F=X_Ro^IqMr-n~_I-@PTn za2OslWC%lLX&;99khFGo>hIgh@0-YP%2A-n(TO)t3lhnqRY$APo) z6mTle5PSig>ho>DEjr%J397is$Ts)W+&@;Cw9{I?4)m(N0Os0bb{x9}ycL_aYVQ9Z zWy)DQNg^1=l!M;&F5FMR39bH4bN^_+j9a!oX<#LZgX!1q!;Cx6;k{eW!1CLt(6@vB zIH~nNF@hv>M@L8fQ2`~7EteF*a8W#r+j$;l|M{m@I1qer`#HQz`m??H6igbQKp*UL z-!&$;R5m9B4KR`V_E_kwu5v+}|E%{rNeJyz&5ef#vnHd?O?ylTVYep8%7P zePEWfhxL993?sH*wO^GPHYWWGdOyM->JVvngGodUn1)n>X;>wg#MFR!TpgGt>;bEU znun%^hocbv!?y*_iz>;Vkae#0er*^<90HTjdV+mm680GwMIMIHt4j}S`;K$cwoe@j zFSUC=9aHqtm;J>wzy$w{6z%&LhUZs%mVNop$$1yRI`K3NTYH*tJqhL!`+uFPS`#%_ zzG}gAWrX~LC5gdPlrd6!d;3>rk%Ldb`_qGR)0|W4j=QDrzV4c~`>UA&X;He@{U-{5 z8gV=Vjt-a>=#zh1z#-S3f|vKEB`qnlgavx@d}=6;T;uZCXA0W z5yYpP^4FFd3lhtR2$D)$AzfEKM3%8-uuoAG%Sw4Z+^riXDJY^wpmz4o`bp=^ZtAG<$tw#7Z;6!fk9)c@@rzmLVO7nkV zBpX~i(Lelul?hKQmli|6;H|)1eaO1jcL$u>i@+7<{>Dhw4R25XVlUy$cl^>`SS$0u zQkDgJ1xHx>>@GN&p94p>{(5`*7fMtC!+kTsMxFt<=M4xbdE?K3IsXHB26-Pz-My9rKoT{BObw?$XKgLKs%E58kD{lZun=@|@z zqbk9W?5l6xcmkX*^xYM3c3(joJkZrYT^4i__i23oxZjWT3o}k5e8%HFSonLV=VJ05__1D zScccd*hmBJlH%VOewMpNH^zw{Dr4>p4X6T~f7bFWuoJI^5nf?nvu-zQykSo;{`+TO zL!ONRu~$d2RjUn1EW?wp->K2RShUz`Qb6tlvrl%y(3M+Zn5wYF4sl={x|vmfd%*Z? z8hJ+J2(J;}Jq4r2mp0>Uy8s+T!CzYSles@Ws^&N2h=YLf8s*U93qw@-F!jbmR()N; z^gC+*;U2yPT%YwnYxLvXpOAQn#zK_CC%Y&Iw1v4M2gdHd%G!5#F!B0BTnm5K=%4Si zym)-Z*_ZJciRVm%_kj7TZD8TQ35Ks{k6pV9J+jX*-g)Ct|7>~CPK@)~#F!)|Gzr^J z?6Ct(6WM*RyD%Vo8&{eeM91$R(_mlFeyobmVqj1W7(~{AVN@*`t*Im2NE=VuIMPOL z1Jmg3U`k?XiUj1l6HJo#!qBvO7@D$=#IH5K3|&`$0b!AQ@Qh{N!81cbD*wh+7ABy6 zm%x-O^Gd$%Fjm&^z?d87i23Ro;vbbTbVUVNEZ+>4{$+q`2Y$xi@Nakx`Vq$GGZdjG zm<|Nz{-VhICg+WpJJsLHBl;NiQRHG8yqnG!b7CX2z&dqHzMBT`qVFum;RnDd>L@tK zgLZeMALss}#L7p4%4@8;Uqu7$AD<1rlThI2$RpH$@EY^TgD_vZw9UIk8~tSNyJpqD z@T+SClh~78(AhnV4lMg=vA1|)NBVK@FDf_5wHy3N89%PZbE){ zkbiOpZQPOmdD3O2ZX3U%`h`{3z%JM|{7jo%P#YAv|s7`7B>Qdui-B$GD2ejvLN^N5xf; zZo3Y$?KePNeGObUU52TV<6QO-A^V)spZGxv8}F!iQ$a#0L5-1M?Po^(q$5KFDW?Vt zlFtnmrk)!lU3YPSDC25>QAT6C5NBNNC(OL2fxa}Wv9BcO8(rv$vM*|&FV1XuOOU>? zuOMB(#^3l`n}E4+7nrZ_v*rKA<>V# za=kj^E))t49R#WeR(|y)yZ|_&yr$0hyL)?& zn<5Q-Y^}^E&prceB}p`AI@~(~`YtIX{`iPpR}X=+;V7{|PBY`a-nb+FAA5iN(Rg{x zuWJ75Xuf;6AO=Qwg@Pfm1?Fhk^z;~xeXm(l<2&O25nmiU#y5q`-MrT4kNh!bZ0ivU zgX8PK>gH3Lo5fr)mrdsz23J)K9C2<_NBo_{ii(j-b6}Wi1I_i~+(rMveDA2mt6<=g z0&uwVyfs&b`CY7akNWNz7&kuYcD}j0;AHH_we)wUgS>^a$oDkvU3C2<>kroWF=s!5 z`2X7;L0~9JhVdtFcbNOr&Q}j4_F?1GU2y6yQ6D0E!K`-qi{;;Ajt=v7So6R&i29IF z?L$@`Az+=epEZZ6!Bk?acZh8;$Nffp?c5LQb(Eh|)*khSC+E!ZVxkC&S+SWxzq3ZAGZzHuMjwryj!~5U0q$@a+IyOhq+7h zRolU0#b$awgYIKme$>x552iFeV&%&Qv<>>&=v(SK1g;CF-#&o>EHxxf><-M)|EkNM zto>sgmc`zuxpB+|2UOD-4r?YDN7zVHY2Cy~k_uxEH?s139pF5|n%HnMt^qpph*Q*{ zo&#JE(mrmy97D2Cx2OwX4^~Br*>DH_4Nd%kvW3#GelK^%VLqEx~uTA9eVDJG-d8T2q6%u7YR1TKvgK zRR$x=PqFIhDHui9KwoKon>EN$qWp{7rYjxR2Gnz6KedGk@h6itJ6QGf6f84713gLp z3x)v>a`*J~?C+`yyyv;)8`k;;J>y2^Hcy-jgI1Nppx~`w7*Yj>p;a&>teQam8DSh= z1!l1|FG1ozv-llgN??(=lfp7>AB9DFJy?+VW?0teV4ZycY_sZLSmz#iY+ZQtflbk| z`-l-`4bMhwJn`H#w(cK#q8wm6)#o*E?RO4LejuvqTCL0|`nXoDZkM`7hc#U?Kj^+k z=7`0T5*SM6xdquTEy(-ZOBB-I%@M?p&HOil+46EQSy2hb0o%Zc^kp2l1EzTUf6MT* zCNaX?_uE4sN%m~UbHhO7@8RX;T7Oal<zYIRrLw7fJ#bChwrNGB(cbqk+y3 zY7?U0gp7sSMN>mXek88K+AXc$((kpj29E19G9CF>VG7ut$?^;pT8fa9k1S+ZVZA7fYM|GJpZ z_h#d*5ofXQY1iT})wR;pvz_znHX77^M(fE(UIM=($lnZGYRVeS^bP-Uk+=6qHr^V+ zxZl0}D&;>Z=X@79^(>sliodaO))q&J-(Rr~iu@Opc79%=r(qLPN9L~Yr)-=xf_3Qm z@_>8F+D6J>Qhgna*Rbp93d|$+6Fxh@GHg$WwRmj|3)>3|B+Kp+PF=2adGI|ZI4ocL z2)S$ERCXCmU*pVzUGVl73#F zxQOJ9?(Xg#=9yF~l^&iiAzY`By=N{yLy1H(prh+M6a4=G?%qPai&%ah{bK6-( zFM+(~1|0{UUzxuCBD|k{9>$XKXrMXA@OH{suuVGCVy_06D+{>S9s9pYapUtX-9$cX z$^5@P+b`_Lnep3ypIdkyytjS>+Ww^rJey&^;R2rhcussKj!naxIUv zG-(mbFwd}^rPJE#v<5n@{>!$hy_VO-mcuX&-DvUuaOt*jjCwqswfZfs0d0BoIW&-8 Vv3=IkHZ!*B=hPJ2rRS*I{tMy<|Cs;) literal 15086 zcwX(>2Urx>769NgyQ>&A21`(5fvB-p1dWOsBMQ+xHI|rIz=91?5EV2kg0W#kDN3`T zVlM&2f>`NQX@ZR+U68(%1w8N0?y}4dvo0p;%lkgh_x)a3=FUB{PCa)7pnwmmsvwT# z0)Szp)zFaqe2#p6jC?kDu=MBe049D7(3||7?m{m{fplR3eDI(wcl+^dPsUU0cV2}F zlP#fX(}DEI%KFs>@4%HDK~N#e+)RGUbGcc`J9IUNztcUEXR_rK4ANXi7X5~+Kehcr zmRx@Y_?Kg9dCtB<-ocCMl#O!$%rg2>yn_AysRFMgrTrVMZ~Kuu;{NV&FIv0Y!%pEv zVx7Z_#kxckV^=A4DGlP=NQw3?XT!z)kHWnw=N zLoawIiu<2>oX~~z|2?H#Yz{FuRbpOhh1h(;K*~^RX;MmZn;}E`f@gGWJ4b)C$g02% zIaRnZSK<$;O~huYEmBs5U18~~ah8?_a3=B*<&%Y~9)Z~XY#{1*1)+6P8oCx&i@8a; zOC2SS5m(B}bC#YwX$u#_BOssvnZERi$G%sBQTIkD&c73e8v-KGHU1g;39He+qE;-t zvZ~P5&+i&IpF0L2nN{$(1mA@U&cqHrp{RX51ZUh0N1NMsGB$a5go(eybGI(Q%W{;7 zOe+Dui02UYvI3HYDEGTM?x(F}JK@r$-Qkdv1)RI;4mTd$2YY8b@#m`KsGUE56707# zhqG6XfX^L&xD)mQVpBwL*mWcP-RRz34F(Qup=`0n1R{Vs0b2<^NRC`KMp%<&(gP&@ zX!LnTgZKd$=NVP_9PDV;lQx)m%xB4;$LrX9d^dQSdMad9F8VD6^eq z)SMMrlZ@8&neAe_n~!bN3zE0 zL>pzp%EDloJ+;hE`IwCnT!8#D!8MfSfpW^w>@_uM))VN{-xpf8+(AYfLwvzGzTrOQ z>;5MmWFybzMm1%&qmSC@mrW2!fxdLgVy~WdPLRxj-e+@FNWR>eWFv#+fJOgT{gbq(nGK>1;1FbABV)0 z$Y?SQjjgA}qRlXjVK~e8aS|ir(uLm|8oJBIU$D{<9MZ6fsRxbAN7xgE+DEN+Bo6DvSBJP`ed z%$nsO`S&+*f=f9_>$uSYt#ZoIIa#3KEJ3c1ToI> z&Yi@TEnD^jgBA90pWNRoLHVYjhOG-~?RP;vlFMAz6S(VPD4x$PM(^@kIX(>67<`Fa zg(adm#OD!0;fn#|##xBJe{x=aZ-IHpzZiyX51zta`&@Cqq0}0DR!Q~+AV1E+(A8^6(j_&yTVK?01 zc^)r4iouwo;+h=9*R;jf)(>ICh)%G^!WZ1G=0aR4el(G}*z`&Os++DW(%-Pbm+XJh z`etTcvh(l+Ju8TPgYZPQs6n4T(_qr1 zU0}TOG%Pc|K|cFZStp>E>C$C1j2pKF7Ay+aMGyEKpW|c1NMaVzMcIP?!e~MD?O#e+?5(8qW|l(l{`sJ$_8giuyGwqz zlhB3tse63-7(q>)Q!DpePuG`%a*==3uZCK_xq=$4Ujp5G=0NM#PoQa2Z_$QzXx!3iEf45>ew9C?Dg0fj+i;;@`q>-3pRx zSB3dcS%(6jPgAS?JNTXfZ{f=?-4x{yi;g3I-$kYC`Jai(L+IQ&Okw_;!jWgVL18Ug zQB9g%m*%QZvuo9CEkYV<8B!!KrT_(f`ot*Ae^)XJCNIXXLW@w9Lu(FgII!#F>{>Zj z&0JCKT&{i|SAflRbm(Vf_BCIYe-pjM_zhi4m+Hi!ZoZ$1p8IF(%0Zoj28X(L2AH}f z6k-PxlUS1PaE0Ihf6Vb)|Ce&Le0DuwQC**1+vlqB*VpdT>DbV~nhC|)EB1}IpB^To_2?=3eYiZqR zkiT<;2prRp)@H^M9G@gV7ouoRL_9C@v>`nX`W$}ZFp0zDXGCf-8YCu0s_W|qfTU(n zpT7&q-#Hy=t)?2`lovvosT`(p_=UrC4($0F_M8pZ+>KazDXw_-?9n(In+G7dKdR5) zHB1EV8A$u$xApi-bcXEx9;P`Q>fZffs(TNJX+8%74u%{Sq!F2=xc=qKSmVIJyQ-Z! zt(D8)EmQ<2GLgnxa~$=~_$r)F63;26H?)MqQVz>FEa$KygC)BRx2C2h*jHEIQ0v|M zqFny&Aywd+g<_7;IM`wvuF9;GvpTCGQx0Yv)^ITAu$F^t?kl$pZPU_{jwAYYA2sTp zT>eLctKfV#)={6k3@vl2#P4@;se9*(=?@N@IBe#yg@YAaz7QQVGM=ADygzi>v}lrd zQ@Q-Fp|VLJ!*{2X(Rj%gQ%-5hM+NEMXh(d_JGFT@~2TU+`% ztSOhj_iL=vk({k zxDvlN+kgkt^U-w8wYm|M>!mmQ-NOj`RRd(kM4^^k2MAl{;NL!z)JAT$M->9 zO2BXCFU2hnLgnT*70q$h&2zGy;c%A2xzbAXD=5ecM~tTp)YT1@Ep)87>BP|jlbLO$6daDcrGOa{VHl@ZgcSG zaEDed!pPFn{HKV?Gz&YsS0wi#;`~pN{K+%U$5BX*omgz*a30&Ox52IpSKz>9COF!7 zH5wgsM2FjV@p{&446dqeAcU#18sp2#3R4j?XkKAqxt)6SppRiKaP<`ec}DoO$aY z5$k%F&_?FpwQE0^s22yO>oVc=r3#2jBIA?( zVZ?~rWV@nap;0P0xE8^KaI!sxlI`MJCzr6e#^qlhtwA6d3%z=6h9N_|VZwwUnDyH; z*z#u%c-^XoMDn~$?yEpwpR1;)DCm3MLD0Fg5y|Bwj2?Xlrc8~6<>dV5ezFXLq7kym zzkMFruGcIPu?T(otW-8YBce03YBd@9_T2}Xn%Cj`?{$@RXhhKeH$e+DG*-i)L1$si zn1?W9W;~dz$$(Sm%OR5NJMJfhpsG4X*^2&U@f9(OoZmMt1fN7de2s+kuATGE!D^t>f8I$wut^iy + showgrid="false" + showguides="true" + inkscape:guide-bbox="true"> + + + id="linearGradient3963"> + id="stop3965" /> + id="stop3967" /> - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + x1="22.175976" + y1="36.987999" + x2="22.065331" + y2="32.050499" /> + + + + + + + gradientTransform="matrix(1.3570112,-0.6632242,0.3457704,0.7672368,-153.03978,210.25695)" + cx="169.61081" + cy="82.940277" + fx="169.61081" + fy="82.940277" + r="80.413557" /> + style="fill:#c17d11;fill-opacity:1;fill-rule:evenodd;stroke:#555753;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" + d="M 5.4770643,54.673837 C 5.4770643,54.673837 48.949546,36.67813 67.582522,36.020189 C 82.421025,35.484255 94.643061,35.396988 104.05041,42.667362 C 113.09751,49.659328 110.94051,63.543294 132.00715,63.163898 C 153.07379,62.784501 190.59725,50.440535 198.41518,71.664532 C 212.73904,110.55073 203.9459,222.5029 203.9459,222.5029 C 203.9459,222.5029 46.725311,225.25717 32.310225,223.21533 C 23.937405,222.02936 25.406988,217.46762 24.750729,209.04294 C 23.532633,193.40581 5.4770643,54.673837 5.4770643,54.673837 z" + id="rect3951" + sodipodi:nodetypes="csssscssc" /> + + + style="opacity:0.25903614;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" + d="M 79.36195,111.22384 L 247.93195,109.49846 C 247.93195,109.49846 249.03849,105.85916 246.25108,123.54994 C 233.6093,146.97158 190.07148,152.00005 171.48343,152.71212 C 151.59946,153.47383 95.445026,178.18666 61.823822,178.69936 C 65.185886,169.11792 69.070045,160.19164 72.746028,141.34435 C 76.109365,124.10004 79.36195,111.22384 79.36195,111.22384 z" + id="path3959" + sodipodi:nodetypes="cccscsc" /> + style="opacity:0.35542172;fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3.00000024;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" + d="M 9.722439,57.60642 C 9.722439,57.60642 36.20917,45.970164 55.116526,42.483472 C 69.732164,39.788212 91.116979,38.675305 100.52432,45.945679 C 107.03999,51.33162 58.702553,48.827737 51.515837,50.276713 C 44.408377,52.601388 28.024909,59.057232 25.65593,67.767087 C 10.398304,123.86372 32.090537,242.71191 9.722439,57.60642 z" + id="path3971" + sodipodi:nodetypes="csccsc" /> + style="fill:none;fill-opacity:1;fill-rule:evenodd;stroke:#8f5902;stroke-width:8;stroke-linecap:round;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" + d="M 246.52191,110.3656 C 246.52191,110.3656 240.67609,174.38678 224.65632,203.77985 C 216.70576,218.36751 210.49534,222.10926 191.90729,222.82133 C 172.02333,223.58305 147.89967,222.48714 126.19093,222.81817 C 80.657243,223.51253 49.194765,222.01606 41.604845,221.35447" + id="path4017" + sodipodi:nodetypes="csssc" /> diff --git a/dlls/shell32/tests/shlfileop.c b/dlls/shell32/tests/shlfileop.c index df460d78676..e81defb31e8 100644 --- a/dlls/shell32/tests/shlfileop.c +++ b/dlls/shell32/tests/shlfileop.c @@ -559,6 +559,8 @@ static void test_delete(void) /* delete a dir, and then a file inside the dir, same as * deleting a nonexistent file + * + * FIXME: Vista throws up a dialog window to ask if one.txt should be created */ init_shfo_tests(); shfo.pFrom = "testdir2\0testdir2\\one.txt\0"; @@ -710,9 +712,23 @@ static void test_copy(void) set_curr_dir_path(from, "test1.txt\0test2.txt\0test4.txt\0"); set_curr_dir_path(to, "test6.txt\0test7.txt\0test8.txt\0"); - ok(SHFileOperationA(&shfo), "Can't copy many files\n"); - ok(!file_exists("test6.txt"), "The file is not copied - many files are " - "specified as a target\n"); + retval = SHFileOperationA(&shfo); + if (retval == ERROR_SUCCESS) + { + /* Vista and W2K8 (broken or new behavior ?) */ + ok(file_exists("test6.txt\\test1.txt"), "The file is not copied - many files " + "are specified as a target"); + DeleteFileA("test6.txt\\test1.txt"); + DeleteFileA("test6.txt\\test2.txt"); + RemoveDirectoryA("test6.txt\\test4.txt"); + RemoveDirectoryA("test6.txt"); + } + else + { + ok(retval == ERROR_CANCELLED, "Expected ERROR_CANCELLED, got %d\n", retval); + ok(!file_exists("test6.txt"), "The file is copied - many files are " + "specified as a target\n"); + } memcpy(&shfo2, &shfo, sizeof(SHFILEOPSTRUCTA)); shfo2.fFlags |= FOF_MULTIDESTFILES; @@ -720,7 +736,7 @@ static void test_copy(void) set_curr_dir_path(from, "test1.txt\0test2.txt\0test4.txt\0"); set_curr_dir_path(to, "test6.txt\0test7.txt\0test8.txt\0"); ok(!SHFileOperationA(&shfo2), "Can't copy many files\n"); - ok(file_exists("test6.txt"), "The file is copied - many files are " + ok(file_exists("test6.txt"), "The file is not copied - many files are " "specified as a target\n"); DeleteFileA("test6.txt"); DeleteFileA("test7.txt"); @@ -729,9 +745,25 @@ static void test_copy(void) /* number of sources do not correspond to number of targets */ set_curr_dir_path(from, "test1.txt\0test2.txt\0test4.txt\0"); set_curr_dir_path(to, "test6.txt\0test7.txt\0"); - ok(SHFileOperationA(&shfo2), "Can't copy many files\n"); - ok(!file_exists("test6.txt"), "The file is not copied - many files are " - "specified as a target\n"); + retval = SHFileOperationA(&shfo2); + if (retval == ERROR_NO_VOLUME_LABEL) + { + /* Vista and W2K8 (broken or new behavior ?) */ + ok(file_exists("test6.txt\\test1.txt"), "The file is not copied - many files " + "are specified as a target"); + ok(file_exists("test7.txt\\test2.txt"), "The file is not copied - many files " + "are specified as a target"); + DeleteFileA("test6.txt\\test1.txt"); + DeleteFileA("test7.txt\\test2.txt"); + RemoveDirectoryA("test6.txt"); + RemoveDirectoryA("test7.txt"); + } + else + { + ok(retval == ERROR_CANCELLED, "Expected ERROR_CANCELLED, got %d\n", retval); + ok(!file_exists("test6.txt"), "The file is copied - many files are " + "specified as a target\n"); + } set_curr_dir_path(from, "test1.txt\0"); set_curr_dir_path(to, "test4.txt\0"); @@ -774,13 +806,15 @@ static void test_copy(void) ok(!file_exists("testdir2\\test1.txt"), "The file is not copied yet\n"); ok(!file_exists("testdir2\\test2.txt"), "The file is not copied yet\n"); retval = SHFileOperationA(&shfo); - if (!retval) + if (retval == ERROR_SUCCESS) /* Win 95/NT returns success but copies only the files up to the nonexistent source */ ok(file_exists("testdir2\\test1.txt"), "The file is not copied\n"); else { - /* Win 98/ME/2K/XP fail the entire operation with return code 1026 if one source file does not exist */ - ok(retval == 1026, "Files are copied to other directory\n"); + /* Failure if one source file does not exist */ + ok(retval == 1026 || /* Win 98/ME/2K/XP */ + retval == ERROR_FILE_NOT_FOUND, /* Vista and W2K8 */ + "Files are copied to other directory\n"); ok(!file_exists("testdir2\\test1.txt"), "The file is copied\n"); } ok(!file_exists("testdir2\\test2.txt"), "The file is copied\n"); @@ -792,10 +826,10 @@ static void test_copy(void) set_curr_dir_path(from, "test1.txt\0"); set_curr_dir_path(to, "nonexistent\\notreal\\test2.txt\0"); retval= SHFileOperation(&shfo); - ok(!retval, "Error copying into nonexistent directory\n"); - ok(file_exists("nonexistent"), "nonexistent not created\n"); - ok(file_exists("nonexistent\\notreal"), "nonexistent\\notreal not created\n"); - ok(file_exists("nonexistent\\notreal\\test2.txt"), "Directory not created\n"); + ok(!retval, "Error copying into nonexistent directory\n"); + ok(file_exists("nonexistent"), "nonexistent not created\n"); + ok(file_exists("nonexistent\\notreal"), "nonexistent\\notreal not created\n"); + ok(file_exists("nonexistent\\notreal\\test2.txt"), "Directory not created\n"); ok(!file_exists("nonexistent\\notreal\\test1.txt"), "test1.txt should not exist\n"); /* a relative dest directory is OK */ @@ -826,10 +860,10 @@ static void test_copy(void) shfo.fFlags &= ~FOF_NOERRORUI; shfo.fAnyOperationsAborted = FALSE; retval = SHFileOperation(&shfo); - ok(retval == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", retval); - ok(DeleteFile("test3.txt\\test1.txt"), "Expected test3.txt\\test1.txt to exist\n"); - ok(DeleteFile("test3.txt\\test2.txt"), "Expected test3.txt\\test1.txt to exist\n"); - ok(RemoveDirectory(to), "Expected test3.txt to exist\n"); + ok(retval == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", retval); + ok(DeleteFile("test3.txt\\test1.txt"), "Expected test3.txt\\test1.txt to exist\n"); + ok(DeleteFile("test3.txt\\test2.txt"), "Expected test3.txt\\test1.txt to exist\n"); + ok(RemoveDirectory(to), "Expected test3.txt to exist\n"); /* send in FOF_MULTIDESTFILES with too many destination files */ init_shfo_tests(); @@ -837,18 +871,43 @@ static void test_copy(void) shfo.pTo = "testdir2\\a.txt\0testdir2\\b.txt\0testdir2\\c.txt\0testdir2\\d.txt\0"; shfo.fFlags |= FOF_NOERRORUI | FOF_MULTIDESTFILES; retval = SHFileOperation(&shfo); - expect_retval(ERROR_CANCELLED, DE_OPCANCELLED /* Win9x, NT4 */); - ok(shfo.fAnyOperationsAborted, "Expected aborted operations\n"); - ok(!file_exists("testdir2\\a.txt"), "Expected testdir2\\a.txt to not exist\n"); + if (retval == ERROR_SUCCESS) + { + /* Vista and W2K8 (broken or new behavior ?) */ + ok(DeleteFile("testdir2\\a.txt\\test1.txt"), "Expected testdir2\\a.txt\\test1.txt to exist\n"); + RemoveDirectory("testdir2\\a.txt"); + ok(DeleteFile("testdir2\\b.txt\\test2.txt"), "Expected testdir2\\b.txt\\test2.txt to exist\n"); + RemoveDirectory("testdir2\\b.txt"); + ok(DeleteFile("testdir2\\c.txt\\test3.txt"), "Expected testdir2\\c.txt\\test3.txt to exist\n"); + RemoveDirectory("testdir2\\c.txt"); + ok(!file_exists("testdir2\\d.txt"), "Expected testdir2\\d.txt to not exist\n"); + } + else + { + expect_retval(ERROR_CANCELLED, DE_OPCANCELLED /* Win9x, NT4 */); + ok(shfo.fAnyOperationsAborted, "Expected aborted operations\n"); + ok(!file_exists("testdir2\\a.txt"), "Expected testdir2\\a.txt to not exist\n"); + } /* send in FOF_MULTIDESTFILES with too many destination files */ shfo.pFrom = "test1.txt\0test2.txt\0test3.txt\0"; shfo.pTo = "e.txt\0f.txt\0"; shfo.fAnyOperationsAborted = FALSE; retval = SHFileOperation(&shfo); - expect_retval(ERROR_CANCELLED, DE_OPCANCELLED /* Win9x, NT4 */); - ok(shfo.fAnyOperationsAborted, "Expected aborted operations\n"); - ok(!file_exists("e.txt"), "Expected e.txt to not exist\n"); + if (retval == ERROR_NO_MORE_SEARCH_HANDLES) + { + /* Vista and W2K8 (broken or new behavior ?) */ + ok(DeleteFile("e.txt\\test1.txt"), "Expected e.txt\\test1.txt to exist\n"); + RemoveDirectory("e.txt"); + ok(DeleteFile("f.txt\\test2.txt"), "Expected f.txt\\test2.txt to exist\n"); + RemoveDirectory("f.txt"); + } + else + { + expect_retval(ERROR_CANCELLED, DE_OPCANCELLED /* Win9x, NT4 */); + ok(shfo.fAnyOperationsAborted, "Expected aborted operations\n"); + ok(!file_exists("e.txt"), "Expected e.txt to not exist\n"); + } /* use FOF_MULTIDESTFILES with files and a source directory */ shfo.pFrom = "test1.txt\0test2.txt\0test4.txt\0"; @@ -866,16 +925,27 @@ static void test_copy(void) shfo.fAnyOperationsAborted = FALSE; shfo.fFlags &= ~FOF_MULTIDESTFILES; retval = SHFileOperation(&shfo); - expect_retval(ERROR_CANCELLED, DE_OPCANCELLED /* Win9x, NT4 */); - ok(!file_exists("a.txt"), "Expected a.txt to not exist\n"); + if (retval == ERROR_SUCCESS) + { + /* Vista and W2K8 (broken or new behavior ?) */ + ok(DeleteFile("a.txt\\test1.txt"), "Expected a.txt\\test1.txt to exist\n"); + ok(DeleteFile("a.txt\\test2.txt"), "Expected a.txt\\test2.txt to exist\n"); + ok(DeleteFile("a.txt\\test3.txt"), "Expected a.txt\\test3.txt to exist\n"); + RemoveDirectory("a.txt"); + } + else + { + expect_retval(ERROR_CANCELLED, DE_OPCANCELLED /* Win9x, NT4 */); + ok(!file_exists("a.txt"), "Expected a.txt to not exist\n"); + } /* try a glob */ shfo.pFrom = "test?.txt\0"; shfo.pTo = "testdir2\0"; shfo.fFlags &= ~FOF_MULTIDESTFILES; retval = SHFileOperation(&shfo); - ok(retval == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", retval); - ok(file_exists("testdir2\\test1.txt"), "Expected testdir2\\test1.txt to exist\n"); + ok(retval == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", retval); + ok(file_exists("testdir2\\test1.txt"), "Expected testdir2\\test1.txt to exist\n"); /* try a glob with FOF_FILESONLY */ clean_after_shfo_tests(); @@ -883,8 +953,8 @@ static void test_copy(void) shfo.pFrom = "test?.txt\0"; shfo.fFlags |= FOF_FILESONLY; retval = SHFileOperation(&shfo); - ok(retval == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", retval); - ok(file_exists("testdir2\\test1.txt"), "Expected testdir2\\test1.txt to exist\n"); + ok(retval == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", retval); + ok(file_exists("testdir2\\test1.txt"), "Expected testdir2\\test1.txt to exist\n"); ok(!file_exists("testdir2\\test4.txt"), "Expected testdir2\\test4.txt to not exist\n"); /* try a glob with FOF_MULTIDESTFILES and the same number @@ -896,9 +966,21 @@ static void test_copy(void) shfo.fFlags &= ~FOF_FILESONLY; shfo.fFlags |= FOF_MULTIDESTFILES; retval = SHFileOperation(&shfo); - expect_retval(ERROR_CANCELLED, DE_OPCANCELLED /* Win9x, NT4 */); - ok(shfo.fAnyOperationsAborted, "Expected aborted operations\n"); - ok(!file_exists("testdir2\\a.txt"), "Expected testdir2\\test1.txt to not exist\n"); + if (retval == ERROR_SUCCESS) + { + /* Vista and W2K8 (broken or new behavior ?) */ + ok(DeleteFile("testdir2\\a.txt\\test1.txt"), "Expected testdir2\\a.txt\\test1.txt to exist\n"); + ok(DeleteFile("testdir2\\a.txt\\test2.txt"), "Expected testdir2\\a.txt\\test2.txt to exist\n"); + ok(DeleteFile("testdir2\\a.txt\\test3.txt"), "Expected testdir2\\a.txt\\test3.txt to exist\n"); + ok(RemoveDirectory("testdir2\\a.txt\\test4.txt"), "Expected testdir2\\a.txt\\test4.txt to exist\n"); + RemoveDirectory("testdir2\\a.txt"); + } + else + { + expect_retval(ERROR_CANCELLED, DE_OPCANCELLED /* Win9x, NT4 */); + ok(shfo.fAnyOperationsAborted, "Expected aborted operations\n"); + ok(!file_exists("testdir2\\a.txt"), "Expected testdir2\\test1.txt to not exist\n"); + } ok(!RemoveDirectory("b.txt"), "b.txt should not exist\n"); /* copy one file to two others, second is ignored */ @@ -908,27 +990,49 @@ static void test_copy(void) shfo.pTo = "b.txt\0c.txt\0"; shfo.fAnyOperationsAborted = FALSE; retval = SHFileOperation(&shfo); - ok(retval == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", retval); - ok(DeleteFile("b.txt"), "Expected b.txt to exist\n"); + ok(retval == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", retval); + ok(DeleteFile("b.txt"), "Expected b.txt to exist\n"); ok(!DeleteFile("c.txt"), "Expected c.txt to not exist\n"); /* copy two file to three others, all fail */ shfo.pFrom = "test1.txt\0test2.txt\0"; shfo.pTo = "b.txt\0c.txt\0d.txt\0"; retval = SHFileOperation(&shfo); - expect_retval(ERROR_CANCELLED, DE_OPCANCELLED /* Win9x, NT4 */); - ok(shfo.fAnyOperationsAborted, "Expected operations to be aborted\n"); - ok(!DeleteFile("b.txt"), "Expected b.txt to not exist\n"); + if (retval == ERROR_SUCCESS) + { + /* Vista and W2K8 (broken or new behavior ?) */ + ok(DeleteFile("b.txt\\test1.txt"), "Expected b.txt\\test1.txt to exist\n"); + RemoveDirectory("b.txt"); + ok(DeleteFile("c.txt\\test2.txt"), "Expected c.txt\\test2.txt to exist\n"); + RemoveDirectory("c.txt"); + } + else + { + expect_retval(ERROR_CANCELLED, DE_OPCANCELLED /* Win9x, NT4 */); + ok(shfo.fAnyOperationsAborted, "Expected operations to be aborted\n"); + ok(!DeleteFile("b.txt"), "Expected b.txt to not exist\n"); + } /* copy one file and one directory to three others */ shfo.pFrom = "test1.txt\0test4.txt\0"; shfo.pTo = "b.txt\0c.txt\0d.txt\0"; shfo.fAnyOperationsAborted = FALSE; retval = SHFileOperation(&shfo); - expect_retval(ERROR_CANCELLED, DE_OPCANCELLED /* Win9x, NT4 */); - ok(shfo.fAnyOperationsAborted, "Expected operations to be aborted\n"); - ok(!DeleteFile("b.txt"), "Expected b.txt to not exist\n"); - ok(!DeleteFile("c.txt"), "Expected c.txt to not exist\n"); + if (retval == ERROR_SUCCESS) + { + /* Vista and W2K8 (broken or new behavior ?) */ + ok(DeleteFile("b.txt\\test1.txt"), "Expected b.txt\\test1.txt to exist\n"); + RemoveDirectory("b.txt"); + ok(RemoveDirectory("c.txt\\test4.txt"), "Expected c.txt\\test4.txt to exist\n"); + RemoveDirectory("c.txt"); + } + else + { + expect_retval(ERROR_CANCELLED, DE_OPCANCELLED /* Win9x, NT4 */); + ok(shfo.fAnyOperationsAborted, "Expected operations to be aborted\n"); + ok(!DeleteFile("b.txt"), "Expected b.txt to not exist\n"); + ok(!DeleteFile("c.txt"), "Expected c.txt to not exist\n"); + } /* copy a directory with a file beneath it, plus some files */ createTestFile("test4.txt\\a.txt"); @@ -954,9 +1058,20 @@ static void test_copy(void) shfo.pFrom = "test4.txt\\a.txt\0test4.txt\0"; shfo.pTo = "nonexistent\0"; retval = SHFileOperation(&shfo); - expect_retval(ERROR_CANCELLED, DE_OPCANCELLED /* Win9x, NT4 */); - ok(shfo.fAnyOperationsAborted, "Expected operations to be aborted\n"); - ok(!file_exists("nonexistent\\test4.txt"), "Expected nonexistent\\test4.txt to not exist\n"); + if (retval == ERROR_SUCCESS) + { + /* Vista and W2K8 (broken or new behavior ?) */ + ok(DeleteFile("nonexistent\\test4.txt\\a.txt"), "Expected nonexistent\\test4.txt\\a.txt to exist\n"); + RemoveDirectory("nonexistent\\test4.txt"); + ok(DeleteFile("nonexistent\\a.txt"), "Expected nonexistent\\a.txt to exist\n"); + RemoveDirectory("nonexistent"); + } + else + { + expect_retval(ERROR_CANCELLED, DE_OPCANCELLED /* Win9x, NT4 */); + ok(shfo.fAnyOperationsAborted, "Expected operations to be aborted\n"); + ok(!file_exists("nonexistent\\test4.txt"), "Expected nonexistent\\test4.txt to not exist\n"); + } DeleteFile("test4.txt\\a.txt"); /* destination is same as source file */ @@ -965,10 +1080,10 @@ static void test_copy(void) shfo.fAnyOperationsAborted = FALSE; shfo.fFlags = FOF_NOERRORUI | FOF_MULTIDESTFILES; retval = SHFileOperation(&shfo); - ok(retval == ERROR_NO_MORE_SEARCH_HANDLES, - "Expected ERROR_NO_MORE_SEARCH_HANDLES, got %d\n", retval); - ok(!shfo.fAnyOperationsAborted, "Expected no operations to be aborted\n"); - ok(DeleteFile("b.txt"), "Expected b.txt to exist\n"); + ok(retval == ERROR_NO_MORE_SEARCH_HANDLES, + "Expected ERROR_NO_MORE_SEARCH_HANDLES, got %d\n", retval); + ok(!shfo.fAnyOperationsAborted, "Expected no operations to be aborted\n"); + ok(DeleteFile("b.txt"), "Expected b.txt to exist\n"); ok(!file_exists("c.txt"), "Expected c.txt to not exist\n"); /* destination is same as source directory */ @@ -976,8 +1091,10 @@ static void test_copy(void) shfo.pTo = "b.txt\0test4.txt\0c.txt\0"; shfo.fAnyOperationsAborted = FALSE; retval = SHFileOperation(&shfo); - ok(retval == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", retval); - ok(DeleteFile("b.txt"), "Expected b.txt to exist\n"); + ok(retval == ERROR_SUCCESS || + retval == ERROR_NO_VOLUME_LABEL, /* Vista */ + "Expected ERROR_SUCCESS or ERROR_NO_VOLUME_LABEL, got %d\n", retval); + ok(DeleteFile("b.txt"), "Expected b.txt to exist\n"); ok(!file_exists("c.txt"), "Expected c.txt to not exist\n"); /* copy a directory into itself, error displayed in UI */ @@ -986,7 +1103,9 @@ static void test_copy(void) shfo.fFlags &= ~FOF_MULTIDESTFILES; shfo.fAnyOperationsAborted = FALSE; retval = SHFileOperation(&shfo); - ok(retval == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", retval); + ok(retval == ERROR_SUCCESS || + retval == ERROR_INVALID_VERIFY_SWITCH, /* Vista */ + "Expected ERROR_SUCCESS or ERROR_INVALID_VERIFY_SWITCH, got %d\n", retval); ok(!RemoveDirectory("test4.txt\\newdir"), "Expected test4.txt\\newdir to not exist\n"); /* copy a directory to itself, error displayed in UI */ @@ -994,7 +1113,9 @@ static void test_copy(void) shfo.pTo = "test4.txt\0"; shfo.fAnyOperationsAborted = FALSE; retval = SHFileOperation(&shfo); - ok(retval == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", retval); + ok(retval == ERROR_SUCCESS || + retval == ERROR_INVALID_VERIFY_SWITCH, /* Vista */ + "Expected ERROR_SUCCESS or ERROR_INVALID_VERIFY_SWITCH, got %d\n", retval); /* copy a file into a directory, and the directory into itself */ shfo.pFrom = "test1.txt\0test4.txt\0"; @@ -1002,7 +1123,9 @@ static void test_copy(void) shfo.fAnyOperationsAborted = FALSE; shfo.fFlags |= FOF_NOCONFIRMATION; retval = SHFileOperation(&shfo); - ok(retval == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", retval); + ok(retval == ERROR_SUCCESS || + retval == ERROR_INVALID_VERIFY_SWITCH, /* Vista */ + "Expected ERROR_SUCCESS or ERROR_INVALID_VERIFY_SWITCH, got %d\n", retval); ok(DeleteFile("test4.txt\\test1.txt"), "Expected test4.txt\\test1.txt to exist\n"); /* copy a file to a file, and the directory into itself */ @@ -1010,15 +1133,26 @@ static void test_copy(void) shfo.pTo = "test4.txt\\a.txt\0"; shfo.fAnyOperationsAborted = FALSE; retval = SHFileOperation(&shfo); - expect_retval(ERROR_CANCELLED, DE_OPCANCELLED /* Win9x, NT4 */); - ok(!file_exists("test4.txt\\a.txt"), "Expected test4.txt\\a.txt to not exist\n"); + if (retval == ERROR_INVALID_VERIFY_SWITCH) + { + /* Vista and W2K8 (broken or new behavior ?) */ + ok(DeleteFile("test4.txt\\a.txt\\test1.txt"), "Expected test4.txt\\a.txt\\test1.txt to exist\n"); + RemoveDirectory("test4.txt\\a.txt"); + } + else + { + expect_retval(ERROR_CANCELLED, DE_OPCANCELLED /* Win9x, NT4 */); + ok(!file_exists("test4.txt\\a.txt"), "Expected test4.txt\\a.txt to not exist\n"); + } /* copy a nonexistent file to a nonexistent directory */ shfo.pFrom = "e.txt\0"; shfo.pTo = "nonexistent\0"; shfo.fAnyOperationsAborted = FALSE; retval = SHFileOperation(&shfo); - ok(retval == 1026, "Expected 1026, got %d\n", retval); + ok(retval == 1026 || + retval == ERROR_FILE_NOT_FOUND, /* Vista */ + "Expected 1026 or ERROR_FILE_NOT_FOUND, got %d\n", retval); ok(!file_exists("nonexistent\\e.txt"), "Expected nonexistent\\e.txt to not exist\n"); ok(!file_exists("nonexistent"), "Expected nonexistent to not exist\n"); diff --git a/dlls/shell32/trash.c b/dlls/shell32/trash.c index a366f625ca7..d69204683f2 100644 --- a/dlls/shell32/trash.c +++ b/dlls/shell32/trash.c @@ -171,8 +171,7 @@ BOOL TRASH_CanTrashFile(LPCWSTR wszPath) static BOOL try_create_trashinfo_file(const char *info_dir, const char *file_name, const char *original_file_name) { - struct tm curr_time; - time_t curr_time_secs; + SYSTEMTIME curr_time; char datebuf[200]; char *path = SHAlloc(strlen(info_dir)+strlen(file_name)+strlen(trashinfo_suffix)+1); int writer = -1; @@ -186,16 +185,11 @@ static BOOL try_create_trashinfo_file(const char *info_dir, const char *file_nam write(writer, trashinfo_header, strlen(trashinfo_header)); if (!XDG_WriteDesktopStringEntry(writer, "Path", XDG_URLENCODE, original_file_name)) goto error; - - time(&curr_time_secs); - localtime_r(&curr_time_secs, &curr_time); + + GetLocalTime( &curr_time ); wnsprintfA(datebuf, 200, "%04d-%02d-%02dT%02d:%02d:%02d", - curr_time.tm_year+1900, - curr_time.tm_mon+1, - curr_time.tm_mday, - curr_time.tm_hour, - curr_time.tm_min, - curr_time.tm_sec); + curr_time.wYear, curr_time.wMonth, curr_time.wDay, + curr_time.wHour, curr_time.wMinute, curr_time.wSecond); if (!XDG_WriteDesktopStringEntry(writer, "DeletionDate", 0, datebuf)) goto error; close(writer); @@ -221,7 +215,7 @@ static char *create_trashinfo(const char *info_dir, const char *file_path) { const char *base_name; char *filename_buffer; - unsigned int seed = (unsigned int)time(NULL); + ULONG seed = GetTickCount(); int i; errno = ENOMEM; /* out-of-memory is the only case when errno isn't set */ @@ -246,7 +240,7 @@ static char *create_trashinfo(const char *info_dir, const char *file_path) for (i=0; i<1000; i++) { - sprintf(filename_buffer, "%s-%08x", base_name, rand_r(&seed)); + sprintf(filename_buffer, "%s-%08x", base_name, RtlRandom(&seed)); if (try_create_trashinfo_file(info_dir, filename_buffer, file_path)) return filename_buffer; } diff --git a/dlls/sxs/sxs.c b/dlls/sxs/sxs.c index cd64de562f6..06e6672dbf7 100644 --- a/dlls/sxs/sxs.c +++ b/dlls/sxs/sxs.c @@ -22,9 +22,6 @@ #include "windef.h" #include "winbase.h" -#include "wine/debug.h" - -WINE_DEFAULT_DEBUG_CHANNEL(sxs); /*********************************************************************** diff --git a/dlls/user32/driver.c b/dlls/user32/driver.c index 2f20b416528..86d154329b1 100644 --- a/dlls/user32/driver.c +++ b/dlls/user32/driver.c @@ -152,169 +152,169 @@ void USER_unload_driver(void) * These are fallbacks for entry points that are not implemented in the real driver. */ -static HKL nulldrv_ActivateKeyboardLayout( HKL layout, UINT flags ) +static HKL CDECL nulldrv_ActivateKeyboardLayout( HKL layout, UINT flags ) { return 0; } -static void nulldrv_Beep(void) +static void CDECL nulldrv_Beep(void) { } -static SHORT nulldrv_GetAsyncKeyState( INT key ) +static SHORT CDECL nulldrv_GetAsyncKeyState( INT key ) { return 0; } -static INT nulldrv_GetKeyNameText( LONG lparam, LPWSTR buffer, INT size ) +static INT CDECL nulldrv_GetKeyNameText( LONG lparam, LPWSTR buffer, INT size ) { return 0; } -static HKL nulldrv_GetKeyboardLayout( DWORD layout ) +static HKL CDECL nulldrv_GetKeyboardLayout( DWORD layout ) { return 0; } -static BOOL nulldrv_GetKeyboardLayoutName( LPWSTR name ) +static BOOL CDECL nulldrv_GetKeyboardLayoutName( LPWSTR name ) { return FALSE; } -static HKL nulldrv_LoadKeyboardLayout( LPCWSTR name, UINT flags ) +static HKL CDECL nulldrv_LoadKeyboardLayout( LPCWSTR name, UINT flags ) { return 0; } -static UINT nulldrv_MapVirtualKeyEx( UINT code, UINT type, HKL layout ) +static UINT CDECL nulldrv_MapVirtualKeyEx( UINT code, UINT type, HKL layout ) { return 0; } -static UINT nulldrv_SendInput( UINT count, LPINPUT inputs, int size ) +static UINT CDECL nulldrv_SendInput( UINT count, LPINPUT inputs, int size ) { return 0; } -static INT nulldrv_ToUnicodeEx( UINT virt, UINT scan, const BYTE *state, LPWSTR str, - int size, UINT flags, HKL layout ) +static INT CDECL nulldrv_ToUnicodeEx( UINT virt, UINT scan, const BYTE *state, LPWSTR str, + int size, UINT flags, HKL layout ) { return 0; } -static BOOL nulldrv_UnloadKeyboardLayout( HKL layout ) +static BOOL CDECL nulldrv_UnloadKeyboardLayout( HKL layout ) { return 0; } -static SHORT nulldrv_VkKeyScanEx( WCHAR ch, HKL layout ) +static SHORT CDECL nulldrv_VkKeyScanEx( WCHAR ch, HKL layout ) { return -1; } -static void nulldrv_SetCursor( struct tagCURSORICONINFO *info ) +static void CDECL nulldrv_SetCursor( struct tagCURSORICONINFO *info ) { } -static BOOL nulldrv_GetCursorPos( LPPOINT pt ) +static BOOL CDECL nulldrv_GetCursorPos( LPPOINT pt ) { return FALSE; } -static BOOL nulldrv_SetCursorPos( INT x, INT y ) +static BOOL CDECL nulldrv_SetCursorPos( INT x, INT y ) { return FALSE; } -static BOOL nulldrv_ClipCursor( LPCRECT clip ) +static BOOL CDECL nulldrv_ClipCursor( LPCRECT clip ) { return FALSE; } -static BOOL nulldrv_GetScreenSaveActive(void) +static BOOL CDECL nulldrv_GetScreenSaveActive(void) { return FALSE; } -static void nulldrv_SetScreenSaveActive( BOOL on ) +static void CDECL nulldrv_SetScreenSaveActive( BOOL on ) { } -static INT nulldrv_AcquireClipboard( HWND hwnd ) +static INT CDECL nulldrv_AcquireClipboard( HWND hwnd ) { return 0; } -static BOOL nulldrv_CountClipboardFormats(void) +static BOOL CDECL nulldrv_CountClipboardFormats(void) { return 0; } -static void nulldrv_EmptyClipboard( BOOL keepunowned ) +static void CDECL nulldrv_EmptyClipboard( BOOL keepunowned ) { } -static void nulldrv_EndClipboardUpdate(void) +static void CDECL nulldrv_EndClipboardUpdate(void) { } -static UINT nulldrv_EnumClipboardFormats( UINT format ) +static UINT CDECL nulldrv_EnumClipboardFormats( UINT format ) { return 0; } -static BOOL nulldrv_GetClipboardData( UINT format, HANDLE16 *h16, HANDLE *h32 ) +static BOOL CDECL nulldrv_GetClipboardData( UINT format, HANDLE16 *h16, HANDLE *h32 ) { return FALSE; } -static INT nulldrv_GetClipboardFormatName( UINT format, LPWSTR buffer, UINT len ) +static INT CDECL nulldrv_GetClipboardFormatName( UINT format, LPWSTR buffer, UINT len ) { return FALSE; } -static BOOL nulldrv_IsClipboardFormatAvailable( UINT format ) +static BOOL CDECL nulldrv_IsClipboardFormatAvailable( UINT format ) { return FALSE; } -static UINT nulldrv_RegisterClipboardFormat( LPCWSTR name ) +static UINT CDECL nulldrv_RegisterClipboardFormat( LPCWSTR name ) { return 0; } -static BOOL nulldrv_SetClipboardData( UINT format, HANDLE16 h16, HANDLE h32, BOOL owner ) +static BOOL CDECL nulldrv_SetClipboardData( UINT format, HANDLE16 h16, HANDLE h32, BOOL owner ) { return FALSE; } -static LONG nulldrv_ChangeDisplaySettingsEx( LPCWSTR name, LPDEVMODEW mode, HWND hwnd, +static LONG CDECL nulldrv_ChangeDisplaySettingsEx( LPCWSTR name, LPDEVMODEW mode, HWND hwnd, DWORD flags, LPVOID lparam ) { return DISP_CHANGE_FAILED; } -static BOOL nulldrv_EnumDisplayMonitors( HDC hdc, LPRECT rect, MONITORENUMPROC proc, LPARAM lp ) +static BOOL CDECL nulldrv_EnumDisplayMonitors( HDC hdc, LPRECT rect, MONITORENUMPROC proc, LPARAM lp ) { return FALSE; } -static BOOL nulldrv_EnumDisplaySettingsEx( LPCWSTR name, DWORD num, LPDEVMODEW mode, DWORD flags ) +static BOOL CDECL nulldrv_EnumDisplaySettingsEx( LPCWSTR name, DWORD num, LPDEVMODEW mode, DWORD flags ) { return FALSE; } -static BOOL nulldrv_GetMonitorInfo( HMONITOR handle, LPMONITORINFO info ) +static BOOL CDECL nulldrv_GetMonitorInfo( HMONITOR handle, LPMONITORINFO info ) { return FALSE; } -static BOOL nulldrv_CreateDesktopWindow( HWND hwnd ) +static BOOL CDECL nulldrv_CreateDesktopWindow( HWND hwnd ) { return TRUE; } -static BOOL nulldrv_CreateWindow( HWND hwnd ) +static BOOL CDECL nulldrv_CreateWindow( HWND hwnd ) { static int warned; if (warned++) @@ -336,89 +336,89 @@ static BOOL nulldrv_CreateWindow( HWND hwnd ) return FALSE; } -static void nulldrv_DestroyWindow( HWND hwnd ) +static void CDECL nulldrv_DestroyWindow( HWND hwnd ) { } -static void nulldrv_GetDC( HDC hdc, HWND hwnd, HWND top_win, const RECT *win_rect, - const RECT *top_rect, DWORD flags ) +static void CDECL nulldrv_GetDC( HDC hdc, HWND hwnd, HWND top_win, const RECT *win_rect, + const RECT *top_rect, DWORD flags ) { } -static DWORD nulldrv_MsgWaitForMultipleObjectsEx( DWORD count, const HANDLE *handles, DWORD timeout, - DWORD mask, DWORD flags ) +static DWORD CDECL nulldrv_MsgWaitForMultipleObjectsEx( DWORD count, const HANDLE *handles, DWORD timeout, + DWORD mask, DWORD flags ) { return WaitForMultipleObjectsEx( count, handles, flags & MWMO_WAITALL, timeout, flags & MWMO_ALERTABLE ); } -static void nulldrv_ReleaseDC( HWND hwnd, HDC hdc ) +static void CDECL nulldrv_ReleaseDC( HWND hwnd, HDC hdc ) { } -static BOOL nulldrv_ScrollDC( HDC hdc, INT dx, INT dy, const RECT *scroll, const RECT *clip, - HRGN hrgn, LPRECT update ) +static BOOL CDECL nulldrv_ScrollDC( HDC hdc, INT dx, INT dy, const RECT *scroll, const RECT *clip, + HRGN hrgn, LPRECT update ) { return FALSE; } -static void nulldrv_SetCapture( HWND hwnd, UINT flags ) +static void CDECL nulldrv_SetCapture( HWND hwnd, UINT flags ) { } -static void nulldrv_SetFocus( HWND hwnd ) +static void CDECL nulldrv_SetFocus( HWND hwnd ) { } -static void nulldrv_SetLayeredWindowAttributes( HWND hwnd, COLORREF key, BYTE alpha, DWORD flags ) +static void CDECL nulldrv_SetLayeredWindowAttributes( HWND hwnd, COLORREF key, BYTE alpha, DWORD flags ) { } -static void nulldrv_SetParent( HWND hwnd, HWND parent, HWND old_parent ) +static void CDECL nulldrv_SetParent( HWND hwnd, HWND parent, HWND old_parent ) { } -static int nulldrv_SetWindowRgn( HWND hwnd, HRGN hrgn, BOOL redraw ) +static int CDECL nulldrv_SetWindowRgn( HWND hwnd, HRGN hrgn, BOOL redraw ) { return 1; } -static void nulldrv_SetWindowIcon( HWND hwnd, UINT type, HICON icon ) +static void CDECL nulldrv_SetWindowIcon( HWND hwnd, UINT type, HICON icon ) { } -static void nulldrv_SetWindowStyle( HWND hwnd, INT offset, STYLESTRUCT *style ) +static void CDECL nulldrv_SetWindowStyle( HWND hwnd, INT offset, STYLESTRUCT *style ) { } -static void nulldrv_SetWindowText( HWND hwnd, LPCWSTR text ) +static void CDECL nulldrv_SetWindowText( HWND hwnd, LPCWSTR text ) { } -static UINT nulldrv_ShowWindow( HWND hwnd, INT cmd, RECT *rect, UINT swp ) +static UINT CDECL nulldrv_ShowWindow( HWND hwnd, INT cmd, RECT *rect, UINT swp ) { return swp; } -static LRESULT nulldrv_SysCommand( HWND hwnd, WPARAM wparam, LPARAM lparam ) +static LRESULT CDECL nulldrv_SysCommand( HWND hwnd, WPARAM wparam, LPARAM lparam ) { return -1; } -static LRESULT nulldrv_WindowMessage( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ) +static LRESULT CDECL nulldrv_WindowMessage( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ) { return 0; } -static void nulldrv_WindowPosChanging( HWND hwnd, HWND insert_after, UINT swp_flags, - const RECT *window_rect, const RECT *client_rect, - RECT *visible_rect ) +static void CDECL nulldrv_WindowPosChanging( HWND hwnd, HWND insert_after, UINT swp_flags, + const RECT *window_rect, const RECT *client_rect, + RECT *visible_rect ) { } -static void nulldrv_WindowPosChanged( HWND hwnd, HWND insert_after, UINT swp_flags, - const RECT *window_rect, const RECT *client_rect, - const RECT *visible_rect, const RECT *valid_rects ) +static void CDECL nulldrv_WindowPosChanged( HWND hwnd, HWND insert_after, UINT swp_flags, + const RECT *window_rect, const RECT *client_rect, + const RECT *visible_rect, const RECT *valid_rects ) { } @@ -492,272 +492,272 @@ static USER_DRIVER null_driver = * Each entry point simply loads the real driver and chains to it. */ -static HKL loaderdrv_ActivateKeyboardLayout( HKL layout, UINT flags ) +static HKL CDECL loaderdrv_ActivateKeyboardLayout( HKL layout, UINT flags ) { return load_driver()->pActivateKeyboardLayout( layout, flags ); } -static void loaderdrv_Beep(void) +static void CDECL loaderdrv_Beep(void) { load_driver()->pBeep(); } -static SHORT loaderdrv_GetAsyncKeyState( INT key ) +static SHORT CDECL loaderdrv_GetAsyncKeyState( INT key ) { return load_driver()->pGetAsyncKeyState( key ); } -static INT loaderdrv_GetKeyNameText( LONG lparam, LPWSTR buffer, INT size ) +static INT CDECL loaderdrv_GetKeyNameText( LONG lparam, LPWSTR buffer, INT size ) { return load_driver()->pGetKeyNameText( lparam, buffer, size ); } -static HKL loaderdrv_GetKeyboardLayout( DWORD layout ) +static HKL CDECL loaderdrv_GetKeyboardLayout( DWORD layout ) { return load_driver()->pGetKeyboardLayout( layout ); } -static BOOL loaderdrv_GetKeyboardLayoutName( LPWSTR name ) +static BOOL CDECL loaderdrv_GetKeyboardLayoutName( LPWSTR name ) { return load_driver()->pGetKeyboardLayoutName( name ); } -static HKL loaderdrv_LoadKeyboardLayout( LPCWSTR name, UINT flags ) +static HKL CDECL loaderdrv_LoadKeyboardLayout( LPCWSTR name, UINT flags ) { return load_driver()->pLoadKeyboardLayout( name, flags ); } -static UINT loaderdrv_MapVirtualKeyEx( UINT code, UINT type, HKL layout ) +static UINT CDECL loaderdrv_MapVirtualKeyEx( UINT code, UINT type, HKL layout ) { return load_driver()->pMapVirtualKeyEx( code, type, layout ); } -static UINT loaderdrv_SendInput( UINT count, LPINPUT inputs, int size ) +static UINT CDECL loaderdrv_SendInput( UINT count, LPINPUT inputs, int size ) { return load_driver()->pSendInput( count, inputs, size ); } -static INT loaderdrv_ToUnicodeEx( UINT virt, UINT scan, const BYTE *state, LPWSTR str, +static INT CDECL loaderdrv_ToUnicodeEx( UINT virt, UINT scan, const BYTE *state, LPWSTR str, int size, UINT flags, HKL layout ) { return load_driver()->pToUnicodeEx( virt, scan, state, str, size, flags, layout ); } -static BOOL loaderdrv_UnloadKeyboardLayout( HKL layout ) +static BOOL CDECL loaderdrv_UnloadKeyboardLayout( HKL layout ) { return load_driver()->pUnloadKeyboardLayout( layout ); } -static SHORT loaderdrv_VkKeyScanEx( WCHAR ch, HKL layout ) +static SHORT CDECL loaderdrv_VkKeyScanEx( WCHAR ch, HKL layout ) { return load_driver()->pVkKeyScanEx( ch, layout ); } -static void loaderdrv_SetCursor( struct tagCURSORICONINFO *info ) +static void CDECL loaderdrv_SetCursor( struct tagCURSORICONINFO *info ) { load_driver()->pSetCursor( info ); } -static BOOL loaderdrv_GetCursorPos( LPPOINT pt ) +static BOOL CDECL loaderdrv_GetCursorPos( LPPOINT pt ) { return load_driver()->pGetCursorPos( pt ); } -static BOOL loaderdrv_SetCursorPos( INT x, INT y ) +static BOOL CDECL loaderdrv_SetCursorPos( INT x, INT y ) { return load_driver()->pSetCursorPos( x, y ); } -static BOOL loaderdrv_ClipCursor( LPCRECT clip ) +static BOOL CDECL loaderdrv_ClipCursor( LPCRECT clip ) { return load_driver()->pClipCursor( clip ); } -static BOOL loaderdrv_GetScreenSaveActive(void) +static BOOL CDECL loaderdrv_GetScreenSaveActive(void) { return load_driver()->pGetScreenSaveActive(); } -static void loaderdrv_SetScreenSaveActive( BOOL on ) +static void CDECL loaderdrv_SetScreenSaveActive( BOOL on ) { load_driver()->pSetScreenSaveActive( on ); } -static INT loaderdrv_AcquireClipboard( HWND hwnd ) +static INT CDECL loaderdrv_AcquireClipboard( HWND hwnd ) { return load_driver()->pAcquireClipboard( hwnd ); } -static BOOL loaderdrv_CountClipboardFormats(void) +static BOOL CDECL loaderdrv_CountClipboardFormats(void) { return load_driver()->pCountClipboardFormats(); } -static void loaderdrv_EmptyClipboard( BOOL keepunowned ) +static void CDECL loaderdrv_EmptyClipboard( BOOL keepunowned ) { load_driver()->pEmptyClipboard( keepunowned ); } -static void loaderdrv_EndClipboardUpdate(void) +static void CDECL loaderdrv_EndClipboardUpdate(void) { load_driver()->pEndClipboardUpdate(); } -static UINT loaderdrv_EnumClipboardFormats( UINT format ) +static UINT CDECL loaderdrv_EnumClipboardFormats( UINT format ) { return load_driver()->pEnumClipboardFormats( format ); } -static BOOL loaderdrv_GetClipboardData( UINT format, HANDLE16 *h16, HANDLE *h32 ) +static BOOL CDECL loaderdrv_GetClipboardData( UINT format, HANDLE16 *h16, HANDLE *h32 ) { return load_driver()->pGetClipboardData( format, h16, h32 ); } -static INT loaderdrv_GetClipboardFormatName( UINT format, LPWSTR buffer, UINT len ) +static INT CDECL loaderdrv_GetClipboardFormatName( UINT format, LPWSTR buffer, UINT len ) { return load_driver()->pGetClipboardFormatName( format, buffer, len ); } -static BOOL loaderdrv_IsClipboardFormatAvailable( UINT format ) +static BOOL CDECL loaderdrv_IsClipboardFormatAvailable( UINT format ) { return load_driver()->pIsClipboardFormatAvailable( format ); } -static UINT loaderdrv_RegisterClipboardFormat( LPCWSTR name ) +static UINT CDECL loaderdrv_RegisterClipboardFormat( LPCWSTR name ) { return load_driver()->pRegisterClipboardFormat( name ); } -static BOOL loaderdrv_SetClipboardData( UINT format, HANDLE16 h16, HANDLE h32, BOOL owner ) +static BOOL CDECL loaderdrv_SetClipboardData( UINT format, HANDLE16 h16, HANDLE h32, BOOL owner ) { return load_driver()->pSetClipboardData( format, h16, h32, owner ); } -static LONG loaderdrv_ChangeDisplaySettingsEx( LPCWSTR name, LPDEVMODEW mode, HWND hwnd, - DWORD flags, LPVOID lparam ) +static LONG CDECL loaderdrv_ChangeDisplaySettingsEx( LPCWSTR name, LPDEVMODEW mode, HWND hwnd, + DWORD flags, LPVOID lparam ) { return load_driver()->pChangeDisplaySettingsEx( name, mode, hwnd, flags, lparam ); } -static BOOL loaderdrv_EnumDisplayMonitors( HDC hdc, LPRECT rect, MONITORENUMPROC proc, LPARAM lp ) +static BOOL CDECL loaderdrv_EnumDisplayMonitors( HDC hdc, LPRECT rect, MONITORENUMPROC proc, LPARAM lp ) { return load_driver()->pEnumDisplayMonitors( hdc, rect, proc, lp ); } -static BOOL loaderdrv_EnumDisplaySettingsEx( LPCWSTR name, DWORD num, LPDEVMODEW mode, DWORD flags ) +static BOOL CDECL loaderdrv_EnumDisplaySettingsEx( LPCWSTR name, DWORD num, LPDEVMODEW mode, DWORD flags ) { return load_driver()->pEnumDisplaySettingsEx( name, num, mode, flags ); } -static BOOL loaderdrv_GetMonitorInfo( HMONITOR handle, LPMONITORINFO info ) +static BOOL CDECL loaderdrv_GetMonitorInfo( HMONITOR handle, LPMONITORINFO info ) { return load_driver()->pGetMonitorInfo( handle, info ); } -static BOOL loaderdrv_CreateDesktopWindow( HWND hwnd ) +static BOOL CDECL loaderdrv_CreateDesktopWindow( HWND hwnd ) { return load_driver()->pCreateDesktopWindow( hwnd ); } -static BOOL loaderdrv_CreateWindow( HWND hwnd ) +static BOOL CDECL loaderdrv_CreateWindow( HWND hwnd ) { return load_driver()->pCreateWindow( hwnd ); } -static void loaderdrv_DestroyWindow( HWND hwnd ) +static void CDECL loaderdrv_DestroyWindow( HWND hwnd ) { load_driver()->pDestroyWindow( hwnd ); } -static void loaderdrv_GetDC( HDC hdc, HWND hwnd, HWND top_win, const RECT *win_rect, - const RECT *top_rect, DWORD flags ) +static void CDECL loaderdrv_GetDC( HDC hdc, HWND hwnd, HWND top_win, const RECT *win_rect, + const RECT *top_rect, DWORD flags ) { load_driver()->pGetDC( hdc, hwnd, top_win, win_rect, top_rect, flags ); } -static DWORD loaderdrv_MsgWaitForMultipleObjectsEx( DWORD count, const HANDLE *handles, DWORD timeout, - DWORD mask, DWORD flags ) +static DWORD CDECL loaderdrv_MsgWaitForMultipleObjectsEx( DWORD count, const HANDLE *handles, DWORD timeout, + DWORD mask, DWORD flags ) { return load_driver()->pMsgWaitForMultipleObjectsEx( count, handles, timeout, mask, flags ); } -static void loaderdrv_ReleaseDC( HWND hwnd, HDC hdc ) +static void CDECL loaderdrv_ReleaseDC( HWND hwnd, HDC hdc ) { load_driver()->pReleaseDC( hwnd, hdc ); } -static BOOL loaderdrv_ScrollDC( HDC hdc, INT dx, INT dy, const RECT *scroll, const RECT *clip, - HRGN hrgn, LPRECT update ) +static BOOL CDECL loaderdrv_ScrollDC( HDC hdc, INT dx, INT dy, const RECT *scroll, const RECT *clip, + HRGN hrgn, LPRECT update ) { return load_driver()->pScrollDC( hdc, dx, dy, scroll, clip, hrgn, update ); } -static void loaderdrv_SetCapture( HWND hwnd, UINT flags ) +static void CDECL loaderdrv_SetCapture( HWND hwnd, UINT flags ) { load_driver()->pSetCapture( hwnd, flags ); } -static void loaderdrv_SetFocus( HWND hwnd ) +static void CDECL loaderdrv_SetFocus( HWND hwnd ) { load_driver()->pSetFocus( hwnd ); } -static void loaderdrv_SetLayeredWindowAttributes( HWND hwnd, COLORREF key, BYTE alpha, DWORD flags ) +static void CDECL loaderdrv_SetLayeredWindowAttributes( HWND hwnd, COLORREF key, BYTE alpha, DWORD flags ) { load_driver()->pSetLayeredWindowAttributes( hwnd, key, alpha, flags ); } -static void loaderdrv_SetParent( HWND hwnd, HWND parent, HWND old_parent ) +static void CDECL loaderdrv_SetParent( HWND hwnd, HWND parent, HWND old_parent ) { load_driver()->pSetParent( hwnd, parent, old_parent ); } -static int loaderdrv_SetWindowRgn( HWND hwnd, HRGN hrgn, BOOL redraw ) +static int CDECL loaderdrv_SetWindowRgn( HWND hwnd, HRGN hrgn, BOOL redraw ) { return load_driver()->pSetWindowRgn( hwnd, hrgn, redraw ); } -static void loaderdrv_SetWindowIcon( HWND hwnd, UINT type, HICON icon ) +static void CDECL loaderdrv_SetWindowIcon( HWND hwnd, UINT type, HICON icon ) { load_driver()->pSetWindowIcon( hwnd, type, icon ); } -static void loaderdrv_SetWindowStyle( HWND hwnd, INT offset, STYLESTRUCT *style ) +static void CDECL loaderdrv_SetWindowStyle( HWND hwnd, INT offset, STYLESTRUCT *style ) { load_driver()->pSetWindowStyle( hwnd, offset, style ); } -static void loaderdrv_SetWindowText( HWND hwnd, LPCWSTR text ) +static void CDECL loaderdrv_SetWindowText( HWND hwnd, LPCWSTR text ) { load_driver()->pSetWindowText( hwnd, text ); } -static UINT loaderdrv_ShowWindow( HWND hwnd, INT cmd, RECT *rect, UINT swp ) +static UINT CDECL loaderdrv_ShowWindow( HWND hwnd, INT cmd, RECT *rect, UINT swp ) { return load_driver()->pShowWindow( hwnd, cmd, rect, swp ); } -static LRESULT loaderdrv_SysCommand( HWND hwnd, WPARAM wparam, LPARAM lparam ) +static LRESULT CDECL loaderdrv_SysCommand( HWND hwnd, WPARAM wparam, LPARAM lparam ) { return load_driver()->pSysCommand( hwnd, wparam, lparam ); } -static LRESULT loaderdrv_WindowMessage( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ) +static LRESULT CDECL loaderdrv_WindowMessage( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam ) { return load_driver()->pWindowMessage( hwnd, msg, wparam, lparam ); } -static void loaderdrv_WindowPosChanging( HWND hwnd, HWND insert_after, UINT swp_flags, - const RECT *window_rect, const RECT *client_rect, - RECT *visible_rect ) +static void CDECL loaderdrv_WindowPosChanging( HWND hwnd, HWND insert_after, UINT swp_flags, + const RECT *window_rect, const RECT *client_rect, + RECT *visible_rect ) { load_driver()->pWindowPosChanging( hwnd, insert_after, swp_flags, window_rect, client_rect, visible_rect ); } -static void loaderdrv_WindowPosChanged( HWND hwnd, HWND insert_after, UINT swp_flags, - const RECT *window_rect, const RECT *client_rect, - const RECT *visible_rect, const RECT *valid_rects ) +static void CDECL loaderdrv_WindowPosChanged( HWND hwnd, HWND insert_after, UINT swp_flags, + const RECT *window_rect, const RECT *client_rect, + const RECT *visible_rect, const RECT *valid_rects ) { load_driver()->pWindowPosChanged( hwnd, insert_after, swp_flags, window_rect, client_rect, visible_rect, valid_rects ); diff --git a/dlls/user32/sysparams.c b/dlls/user32/sysparams.c index 4e482998f9c..9d72688b768 100644 --- a/dlls/user32/sysparams.c +++ b/dlls/user32/sysparams.c @@ -85,6 +85,7 @@ enum spi_index SPI_MINIMIZEDMETRICS_IDX, SPI_SETFOREGROUNDLOCKTIMEOUT_IDX, SPI_CARETWIDTH_IDX, + SPI_SETMOUSESPEED_IDX, SPI_INDEX_COUNT }; @@ -221,6 +222,8 @@ static const WCHAR SPI_SETFOREGROUNDLOCKTIMEOUT_REGKEY[]= {'C','o','n','t',' static const WCHAR SPI_SETFOREGROUNDLOCKTIMEOUT_VALNAME[]= {'F','o','r','e','g','r','o','u','n','d','L','o','c','k','T','i','m','e','o','u','t',0}; static const WCHAR SPI_CARETWIDTH_REGKEY[]= {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','D','e','s','k','t','o','p',0}; static const WCHAR SPI_CARETWIDTH_VALNAME[]= {'C','a','r','e','t','W','i','d','t','h',0}; +static const WCHAR SPI_SETMOUSESPEED_REGKEY[]= {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','M','o','u','s','e',0}; +static const WCHAR SPI_SETMOUSESPEED_VALNAME[]= {'M','o','u','s','e','S','e','n','s','i','t','i','v','i','t','y',0}; /* FIXME - real values */ static const WCHAR SPI_SETSCREENSAVERRUNNING_REGKEY[]= {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','D','e','s','k','t','o','p',0}; @@ -312,6 +315,7 @@ static BOOL snap_to_default_button = FALSE; static BOOL swap_buttons = FALSE; static UINT foreground_lock_timeout = 0; static UINT caret_width = 1; +static UINT mouse_sensitivity = 10; static BYTE user_prefs[4]; static MINIMIZEDMETRICS minimized_metrics = @@ -2159,20 +2163,20 @@ BOOL WINAPI SystemParametersInfoW( UINT uiAction, UINT uiParam, WINE_SPI_FIXME(SPI_SETSHOWIMEUI); /* 111 _WIN32_WINNT >= 0x400 || _WIN32_WINDOW > 0x400 */ case SPI_GETMOUSESPEED: /* 112 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */ - { - int buf[3]; - ret = SystemParametersInfoW (SPI_GETMOUSE, 0, buf, fWinIni); - *(INT *)pvParam = buf[2]; + ret = get_uint_param( SPI_SETMOUSESPEED_IDX, + SPI_SETMOUSESPEED_REGKEY, + SPI_SETMOUSESPEED_VALNAME, + &mouse_sensitivity, pvParam ); break; - } case SPI_SETMOUSESPEED: /* 113 _WIN32_WINNT >= 0x500 || _WIN32_WINDOW > 0x400 */ - { - ret = save_int_param( SPI_SETMOUSE_REGKEY, SPI_SETMOUSE_VALNAME3, - &mouse_speed, PtrToInt(pvParam), fWinIni); + if (!pvParam) return FALSE; + ret = set_uint_param( SPI_SETMOUSESPEED_IDX, + SPI_SETMOUSESPEED_REGKEY, + SPI_SETMOUSESPEED_VALNAME, + &mouse_sensitivity, *(UINT *) pvParam, fWinIni ); break; - } case SPI_GETSCREENSAVERRUNNING: ret = get_bool_param( SPI_SETSCREENSAVERRUNNING_IDX, diff --git a/dlls/user32/user_private.h b/dlls/user32/user_private.h index f25f258f495..f1a65852eca 100644 --- a/dlls/user32/user_private.h +++ b/dlls/user32/user_private.h @@ -104,63 +104,63 @@ struct tagCURSORICONINFO; typedef struct tagUSER_DRIVER { /* keyboard functions */ - HKL (*pActivateKeyboardLayout)(HKL, UINT); - void (*pBeep)(void); - SHORT (*pGetAsyncKeyState)(INT); - INT (*pGetKeyNameText)(LONG, LPWSTR, INT); - HKL (*pGetKeyboardLayout)(DWORD); - BOOL (*pGetKeyboardLayoutName)(LPWSTR); - HKL (*pLoadKeyboardLayout)(LPCWSTR, UINT); - UINT (*pMapVirtualKeyEx)(UINT, UINT, HKL); - UINT (*pSendInput)(UINT, LPINPUT, int); - INT (*pToUnicodeEx)(UINT, UINT, const BYTE *, LPWSTR, int, UINT, HKL); - BOOL (*pUnloadKeyboardLayout)(HKL); - SHORT (*pVkKeyScanEx)(WCHAR, HKL); + HKL (CDECL *pActivateKeyboardLayout)(HKL, UINT); + void (CDECL *pBeep)(void); + SHORT (CDECL *pGetAsyncKeyState)(INT); + INT (CDECL *pGetKeyNameText)(LONG, LPWSTR, INT); + HKL (CDECL *pGetKeyboardLayout)(DWORD); + BOOL (CDECL *pGetKeyboardLayoutName)(LPWSTR); + HKL (CDECL *pLoadKeyboardLayout)(LPCWSTR, UINT); + UINT (CDECL *pMapVirtualKeyEx)(UINT, UINT, HKL); + UINT (CDECL *pSendInput)(UINT, LPINPUT, int); + INT (CDECL *pToUnicodeEx)(UINT, UINT, const BYTE *, LPWSTR, int, UINT, HKL); + BOOL (CDECL *pUnloadKeyboardLayout)(HKL); + SHORT (CDECL *pVkKeyScanEx)(WCHAR, HKL); /* mouse functions */ - void (*pSetCursor)(struct tagCURSORICONINFO *); - BOOL (*pGetCursorPos)(LPPOINT); - BOOL (*pSetCursorPos)(INT,INT); - BOOL (*pClipCursor)(LPCRECT); + void (CDECL *pSetCursor)(struct tagCURSORICONINFO *); + BOOL (CDECL *pGetCursorPos)(LPPOINT); + BOOL (CDECL *pSetCursorPos)(INT,INT); + BOOL (CDECL *pClipCursor)(LPCRECT); /* screen saver functions */ - BOOL (*pGetScreenSaveActive)(void); - void (*pSetScreenSaveActive)(BOOL); + BOOL (CDECL *pGetScreenSaveActive)(void); + void (CDECL *pSetScreenSaveActive)(BOOL); /* clipboard functions */ - INT (*pAcquireClipboard)(HWND); /* Acquire selection */ - BOOL (*pCountClipboardFormats)(void); /* Count available clipboard formats */ - void (*pEmptyClipboard)(BOOL); /* Empty clipboard data */ - void (*pEndClipboardUpdate)(void); /* End clipboard update */ - UINT (*pEnumClipboardFormats)(UINT); /* Enumerate clipboard formats */ - BOOL (*pGetClipboardData)(UINT, HANDLE16*, HANDLE*); /* Get specified selection data */ - INT (*pGetClipboardFormatName)(UINT, LPWSTR, UINT); /* Get a clipboard format name */ - BOOL (*pIsClipboardFormatAvailable)(UINT); /* Check if specified format is available */ - UINT (*pRegisterClipboardFormat)(LPCWSTR); /* Register a clipboard format */ - BOOL (*pSetClipboardData)(UINT, HANDLE16, HANDLE, BOOL); /* Set specified selection data */ + INT (CDECL *pAcquireClipboard)(HWND); /* Acquire selection */ + BOOL (CDECL *pCountClipboardFormats)(void); /* Count available clipboard formats */ + void (CDECL *pEmptyClipboard)(BOOL); /* Empty clipboard data */ + void (CDECL *pEndClipboardUpdate)(void); /* End clipboard update */ + UINT (CDECL *pEnumClipboardFormats)(UINT); /* Enumerate clipboard formats */ + BOOL (CDECL *pGetClipboardData)(UINT, HANDLE16*, HANDLE*); /* Get specified selection data */ + INT (CDECL *pGetClipboardFormatName)(UINT, LPWSTR, UINT); /* Get a clipboard format name */ + BOOL (CDECL *pIsClipboardFormatAvailable)(UINT); /* Check if specified format is available */ + UINT (CDECL *pRegisterClipboardFormat)(LPCWSTR); /* Register a clipboard format */ + BOOL (CDECL *pSetClipboardData)(UINT, HANDLE16, HANDLE, BOOL); /* Set specified selection data */ /* display modes */ - LONG (*pChangeDisplaySettingsEx)(LPCWSTR,LPDEVMODEW,HWND,DWORD,LPVOID); - BOOL (*pEnumDisplayMonitors)(HDC,LPRECT,MONITORENUMPROC,LPARAM); - BOOL (*pEnumDisplaySettingsEx)(LPCWSTR,DWORD,LPDEVMODEW,DWORD); - BOOL (*pGetMonitorInfo)(HMONITOR,MONITORINFO*); + LONG (CDECL *pChangeDisplaySettingsEx)(LPCWSTR,LPDEVMODEW,HWND,DWORD,LPVOID); + BOOL (CDECL *pEnumDisplayMonitors)(HDC,LPRECT,MONITORENUMPROC,LPARAM); + BOOL (CDECL *pEnumDisplaySettingsEx)(LPCWSTR,DWORD,LPDEVMODEW,DWORD); + BOOL (CDECL *pGetMonitorInfo)(HMONITOR,MONITORINFO*); /* windowing functions */ - BOOL (*pCreateDesktopWindow)(HWND); - BOOL (*pCreateWindow)(HWND); - void (*pDestroyWindow)(HWND); - void (*pGetDC)(HDC,HWND,HWND,const RECT *,const RECT *,DWORD); - DWORD (*pMsgWaitForMultipleObjectsEx)(DWORD,const HANDLE*,DWORD,DWORD,DWORD); - void (*pReleaseDC)(HWND,HDC); - BOOL (*pScrollDC)(HDC, INT, INT, const RECT *, const RECT *, HRGN, LPRECT); - void (*pSetCapture)(HWND,UINT); - void (*pSetFocus)(HWND); - void (*pSetLayeredWindowAttributes)(HWND,COLORREF,BYTE,DWORD); - void (*pSetParent)(HWND,HWND,HWND); - int (*pSetWindowRgn)(HWND,HRGN,BOOL); - void (*pSetWindowIcon)(HWND,UINT,HICON); - void (*pSetWindowStyle)(HWND,INT,STYLESTRUCT*); - void (*pSetWindowText)(HWND,LPCWSTR); - UINT (*pShowWindow)(HWND,INT,RECT*,UINT); - LRESULT (*pSysCommand)(HWND,WPARAM,LPARAM); - LRESULT (*pWindowMessage)(HWND,UINT,WPARAM,LPARAM); - void (*pWindowPosChanging)(HWND,HWND,UINT,const RECT *,const RECT *,RECT *); - void (*pWindowPosChanged)(HWND,HWND,UINT,const RECT *,const RECT *,const RECT *,const RECT *); + BOOL (CDECL *pCreateDesktopWindow)(HWND); + BOOL (CDECL *pCreateWindow)(HWND); + void (CDECL *pDestroyWindow)(HWND); + void (CDECL *pGetDC)(HDC,HWND,HWND,const RECT *,const RECT *,DWORD); + DWORD (CDECL *pMsgWaitForMultipleObjectsEx)(DWORD,const HANDLE*,DWORD,DWORD,DWORD); + void (CDECL *pReleaseDC)(HWND,HDC); + BOOL (CDECL *pScrollDC)(HDC, INT, INT, const RECT *, const RECT *, HRGN, LPRECT); + void (CDECL *pSetCapture)(HWND,UINT); + void (CDECL *pSetFocus)(HWND); + void (CDECL *pSetLayeredWindowAttributes)(HWND,COLORREF,BYTE,DWORD); + void (CDECL *pSetParent)(HWND,HWND,HWND); + int (CDECL *pSetWindowRgn)(HWND,HRGN,BOOL); + void (CDECL *pSetWindowIcon)(HWND,UINT,HICON); + void (CDECL *pSetWindowStyle)(HWND,INT,STYLESTRUCT*); + void (CDECL *pSetWindowText)(HWND,LPCWSTR); + UINT (CDECL *pShowWindow)(HWND,INT,RECT*,UINT); + LRESULT (CDECL *pSysCommand)(HWND,WPARAM,LPARAM); + LRESULT (CDECL *pWindowMessage)(HWND,UINT,WPARAM,LPARAM); + void (CDECL *pWindowPosChanging)(HWND,HWND,UINT,const RECT *,const RECT *,RECT *); + void (CDECL *pWindowPosChanged)(HWND,HWND,UINT,const RECT *,const RECT *,const RECT *,const RECT *); } USER_DRIVER; extern const USER_DRIVER *USER_Driver DECLSPEC_HIDDEN; diff --git a/dlls/winealsa.drv/waveinit.c b/dlls/winealsa.drv/waveinit.c index 4bdaeff3d34..450c2cac794 100644 --- a/dlls/winealsa.drv/waveinit.c +++ b/dlls/winealsa.drv/waveinit.c @@ -25,6 +25,9 @@ */ #include "config.h" + +#ifdef HAVE_ALSA + #include "wine/port.h" #include @@ -65,8 +68,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(wave); -#ifdef HAVE_ALSA - /*---------------------------------------------------------------------------- ** ALSA_TestDeviceForWine ** diff --git a/dlls/winecoreaudio.drv/audiounit.c b/dlls/winecoreaudio.drv/audiounit.c index 08fd5ec91e5..76544540182 100644 --- a/dlls/winecoreaudio.drv/audiounit.c +++ b/dlls/winecoreaudio.drv/audiounit.c @@ -19,14 +19,15 @@ */ #include "config.h" -#include "wine/debug.h" - -WINE_DEFAULT_DEBUG_CHANNEL(wave); #ifdef HAVE_AUDIOUNIT_AUDIOUNIT_H + #include #include +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(wave); WINE_DECLARE_DEBUG_CHANNEL(midi); extern OSStatus CoreAudio_woAudioUnitIOProc(void *inRefCon, diff --git a/dlls/winecoreaudio.drv/coremidi.c b/dlls/winecoreaudio.drv/coremidi.c index abe845431ff..c52093ef56c 100644 --- a/dlls/winecoreaudio.drv/coremidi.c +++ b/dlls/winecoreaudio.drv/coremidi.c @@ -20,16 +20,18 @@ #include "config.h" -#include "wine/debug.h" - -WINE_DEFAULT_DEBUG_CHANNEL(midi); #ifdef HAVE_COREAUDIO_COREAUDIO_H + #include #include #include "coremidi.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(midi); + MIDIClientRef CoreMIDI_CreateClient(CFStringRef name) { MIDIClientRef client = NULL; diff --git a/dlls/winecoreaudio.drv/midi.c b/dlls/winecoreaudio.drv/midi.c index a052e058929..82d5e5e71d4 100644 --- a/dlls/winecoreaudio.drv/midi.c +++ b/dlls/winecoreaudio.drv/midi.c @@ -689,6 +689,10 @@ static DWORD MIDIIn_AddBuffer(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize) } EnterCriticalSection(&midiInLock); + lpMidiHdr->dwFlags &= ~WHDR_DONE; + lpMidiHdr->dwFlags |= MHDR_INQUEUE; + lpMidiHdr->dwBytesRecorded = 0; + lpMidiHdr->lpNext = 0; if (sources[wDevID].lpQueueHdr == 0) { sources[wDevID].lpQueueHdr = lpMidiHdr; } else { diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index d5fd0a5ec10..7c80750d578 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -4174,7 +4174,6 @@ BOOL InitAdapters(void) { ERR("Can't load opengl32.dll!\n"); goto nogl_adapter; } - mod_win32gl = mod_gl; #else #define USE_GL_FUNC(pfn) pfn = (void*)pwglGetProcAddress(#pfn); /* To bypass the opengl32 thunks load wglGetProcAddress from gdi32 (glXGetProcAddress wrapper) instead of opengl32's */ diff --git a/dlls/wined3d/wined3d_gl.h b/dlls/wined3d/wined3d_gl.h index 2d9c18af586..5fccf9a9168 100644 --- a/dlls/wined3d/wined3d_gl.h +++ b/dlls/wined3d/wined3d_gl.h @@ -3614,8 +3614,8 @@ typedef enum _GL_SupportedExt { USE_GL_FUNC(WINED3D_PFNGLUNIFORMMATRIX2FVARBPROC, glUniformMatrix2fvARB, ARB_SHADER_OBJECTS, NULL )\ USE_GL_FUNC(WINED3D_PFNGLUNIFORMMATRIX3FVARBPROC, glUniformMatrix3fvARB, ARB_SHADER_OBJECTS, NULL )\ USE_GL_FUNC(WINED3D_PFNGLUNIFORMMATRIX4FVARBPROC, glUniformMatrix4fvARB, ARB_SHADER_OBJECTS, NULL )\ - USE_GL_FUNC(WINED3D_PFNGLGETUNIFORMFVARBPROC, glGetUniform4fvARB, ARB_SHADER_OBJECTS, NULL )\ - USE_GL_FUNC(WINED3D_PFNGLGETUNIFORMIVARBPROC, glGetUniform4ivARB, ARB_SHADER_OBJECTS, NULL )\ + USE_GL_FUNC(WINED3D_PFNGLGETUNIFORMFVARBPROC, glGetUniformfvARB, ARB_SHADER_OBJECTS, NULL )\ + USE_GL_FUNC(WINED3D_PFNGLGETUNIFORMIVARBPROC, glGetUniformivARB, ARB_SHADER_OBJECTS, NULL )\ USE_GL_FUNC(WINED3D_PFNGLGETINFOLOGARBPROC, glGetInfoLogARB, ARB_SHADER_OBJECTS, NULL )\ USE_GL_FUNC(WINED3D_PFNGLUSEPROGRAMOBJECTARBPROC, glUseProgramObjectARB, ARB_SHADER_OBJECTS, NULL )\ USE_GL_FUNC(WINED3D_PFNGLCREATESHADEROBJECTARBPROC, glCreateShaderObjectARB, ARB_SHADER_OBJECTS, NULL )\ @@ -3713,8 +3713,8 @@ typedef enum _GL_SupportedExt { USE_GL_FUNC(PGLXFNGETVIDEOSYNCSGIPROC, glXGetVideoSyncSGI, SGI_VIDEO_SYNC, NULL )\ USE_GL_FUNC(PGLXFNWAITVIDEOSYNCSGIPROC, glXWaitVideoSyncSGI, SGI_VIDEO_SYNC, NULL )\ /* GL_APPLE_flush_render */ \ - USE_GL_FUNC(PGLFNFLUSHRENDERAPPLEPROC, glFlushRenderApple, APPLE_FLUSH_RENDER, NULL )\ - USE_GL_FUNC(PGLFNFINISHRENDERAPPLEPROC, glFinishRenderApple, APPLE_FLUSH_RENDER, NULL )\ + USE_GL_FUNC(PGLFNFLUSHRENDERAPPLEPROC, glFlushRenderAPPLE, APPLE_FLUSH_RENDER, NULL )\ + USE_GL_FUNC(PGLFNFINISHRENDERAPPLEPROC, glFinishRenderAPPLE, APPLE_FLUSH_RENDER, NULL )\ /* GL_EXT_gpu_program_parameters */ \ USE_GL_FUNC(PGLFNPROGRAMENVPARAMETERS4FVEXTPROC, glProgramEnvParameters4fvEXT, EXT_GPU_PROGRAM_PARAMETERS,NULL )\ USE_GL_FUNC(PGLFNPROGRAMLOCALPARAMETERS4FVEXTPROC, glProgramLocalParameters4fvEXT, EXT_GPU_PROGRAM_PARAMETERS,NULL )\ diff --git a/dlls/wined3d/wined3d_main.c b/dlls/wined3d/wined3d_main.c index ee8f07f42ed..b401f942ff5 100644 --- a/dlls/wined3d/wined3d_main.c +++ b/dlls/wined3d/wined3d_main.c @@ -29,8 +29,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d); int num_lock = 0; -void (*wine_tsx11_lock_ptr)(void) = NULL; -void (*wine_tsx11_unlock_ptr)(void) = NULL; +void (*CDECL wine_tsx11_lock_ptr)(void) = NULL; +void (*CDECL wine_tsx11_unlock_ptr)(void) = NULL; /* When updating default value here, make sure to update winecfg as well, @@ -88,7 +88,7 @@ static inline DWORD get_config_key_dword(HKEY defkey, HKEY appkey, const char* n return ERROR_FILE_NOT_FOUND; } -static void wined3d_do_nothing(void) +static void CDECL wined3d_do_nothing(void) { } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 7e422fb6dc5..60414ee5437 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -483,8 +483,8 @@ extern const shader_backend_t none_shader_backend; /* X11 locking */ -extern void (*wine_tsx11_lock_ptr)(void); -extern void (*wine_tsx11_unlock_ptr)(void); +extern void (* CDECL wine_tsx11_lock_ptr)(void); +extern void (* CDECL wine_tsx11_unlock_ptr)(void); /* As GLX relies on X, this is needed */ extern int num_lock; diff --git a/dlls/wineoss.drv/midi.c b/dlls/wineoss.drv/midi.c index 7d995c25035..5f24f2f67c5 100644 --- a/dlls/wineoss.drv/midi.c +++ b/dlls/wineoss.drv/midi.c @@ -848,7 +848,10 @@ static DWORD midAddBuffer(WORD wDevID, LPMIDIHDR lpMidiHdr, DWORD dwSize) if (!(lpMidiHdr->dwFlags & MHDR_PREPARED)) return MIDIERR_UNPREPARED; EnterCriticalSection(&crit_sect); + lpMidiHdr->dwFlags &= ~WHDR_DONE; lpMidiHdr->dwFlags |= MHDR_INQUEUE; + lpMidiHdr->dwBytesRecorded = 0; + lpMidiHdr->lpNext = 0; if (MidiInDev[wDevID].lpQueueHdr == 0) { MidiInDev[wDevID].lpQueueHdr = lpMidiHdr; } else { diff --git a/dlls/winex11.drv/bitblt.c b/dlls/winex11.drv/bitblt.c index 5b5742cb35a..259c1bb01f5 100644 --- a/dlls/winex11.drv/bitblt.c +++ b/dlls/winex11.drv/bitblt.c @@ -1502,7 +1502,7 @@ static BOOL BITBLT_InternalStretchBlt( X11DRV_PDEVICE *physDevDst, INT xDst, INT /*********************************************************************** * X11DRV_PatBlt */ -BOOL X11DRV_PatBlt( X11DRV_PDEVICE *physDev, INT left, INT top, INT width, INT height, DWORD rop ) +BOOL CDECL X11DRV_PatBlt( X11DRV_PDEVICE *physDev, INT left, INT top, INT width, INT height, DWORD rop ) { BOOL result; @@ -1637,7 +1637,7 @@ static BOOL X11DRV_ClientSideDIBCopy( X11DRV_PDEVICE *physDevSrc, INT xSrc, INT /*********************************************************************** * X11DRV_BitBlt */ -BOOL X11DRV_BitBlt( X11DRV_PDEVICE *physDevDst, INT xDst, INT yDst, +BOOL CDECL X11DRV_BitBlt( X11DRV_PDEVICE *physDevDst, INT xDst, INT yDst, INT width, INT height, X11DRV_PDEVICE *physDevSrc, INT xSrc, INT ySrc, DWORD rop ) { @@ -1736,10 +1736,10 @@ END: /*********************************************************************** * X11DRV_StretchBlt */ -BOOL X11DRV_StretchBlt( X11DRV_PDEVICE *physDevDst, INT xDst, INT yDst, - INT widthDst, INT heightDst, - X11DRV_PDEVICE *physDevSrc, INT xSrc, INT ySrc, - INT widthSrc, INT heightSrc, DWORD rop ) +BOOL CDECL X11DRV_StretchBlt( X11DRV_PDEVICE *physDevDst, INT xDst, INT yDst, + INT widthDst, INT heightDst, + X11DRV_PDEVICE *physDevSrc, INT xSrc, INT ySrc, + INT widthSrc, INT heightSrc, DWORD rop ) { BOOL result; diff --git a/dlls/winex11.drv/bitmap.c b/dlls/winex11.drv/bitmap.c index 32018c84770..facf405b97d 100644 --- a/dlls/winex11.drv/bitmap.c +++ b/dlls/winex11.drv/bitmap.c @@ -69,7 +69,7 @@ void X11DRV_BITMAP_Init(void) /*********************************************************************** * SelectBitmap (X11DRV.@) */ -HBITMAP X11DRV_SelectBitmap( X11DRV_PDEVICE *physDev, HBITMAP hbitmap ) +HBITMAP CDECL X11DRV_SelectBitmap( X11DRV_PDEVICE *physDev, HBITMAP hbitmap ) { X_PHYSBITMAP *physBitmap; BITMAP bitmap; @@ -111,7 +111,7 @@ HBITMAP X11DRV_SelectBitmap( X11DRV_PDEVICE *physDev, HBITMAP hbitmap ) * * Returns TRUE on success else FALSE */ -BOOL X11DRV_CreateBitmap( X11DRV_PDEVICE *physDev, HBITMAP hbitmap, LPVOID bmBits ) +BOOL CDECL X11DRV_CreateBitmap( X11DRV_PDEVICE *physDev, HBITMAP hbitmap, LPVOID bmBits ) { X_PHYSBITMAP *physBitmap; BITMAP bitmap; @@ -175,7 +175,7 @@ BOOL X11DRV_CreateBitmap( X11DRV_PDEVICE *physDev, HBITMAP hbitmap, LPVOID bmBit * Success: Number of bytes copied * Failure: 0 */ -LONG X11DRV_GetBitmapBits( HBITMAP hbitmap, void *buffer, LONG count ) +LONG CDECL X11DRV_GetBitmapBits( HBITMAP hbitmap, void *buffer, LONG count ) { BITMAP bitmap; X_PHYSBITMAP *physBitmap = X11DRV_get_phys_bitmap( hbitmap ); @@ -298,7 +298,7 @@ LONG X11DRV_GetBitmapBits( HBITMAP hbitmap, void *buffer, LONG count ) * Success: Number of bytes used in setting the bitmap bits * Failure: 0 */ -LONG X11DRV_SetBitmapBits( HBITMAP hbitmap, const void *bits, LONG count ) +LONG CDECL X11DRV_SetBitmapBits( HBITMAP hbitmap, const void *bits, LONG count ) { BITMAP bitmap; X_PHYSBITMAP *physBitmap = X11DRV_get_phys_bitmap( hbitmap ); @@ -417,7 +417,7 @@ LONG X11DRV_SetBitmapBits( HBITMAP hbitmap, const void *bits, LONG count ) /*********************************************************************** * DeleteBitmap (X11DRV.@) */ -BOOL X11DRV_DeleteBitmap( HBITMAP hbitmap ) +BOOL CDECL X11DRV_DeleteBitmap( HBITMAP hbitmap ) { X_PHYSBITMAP *physBitmap = X11DRV_get_phys_bitmap( hbitmap ); diff --git a/dlls/winex11.drv/brush.c b/dlls/winex11.drv/brush.c index 5e5187705bd..612968c1636 100644 --- a/dlls/winex11.drv/brush.c +++ b/dlls/winex11.drv/brush.c @@ -251,7 +251,7 @@ static BOOL BRUSH_SelectPatternBrush( X11DRV_PDEVICE *physDev, HBITMAP hbitmap ) /*********************************************************************** * SelectBrush (X11DRV.@) */ -HBRUSH X11DRV_SelectBrush( X11DRV_PDEVICE *physDev, HBRUSH hbrush ) +HBRUSH CDECL X11DRV_SelectBrush( X11DRV_PDEVICE *physDev, HBRUSH hbrush ) { LOGBRUSH logbrush; HBITMAP hBitmap; @@ -321,7 +321,7 @@ HBRUSH X11DRV_SelectBrush( X11DRV_PDEVICE *physDev, HBRUSH hbrush ) /*********************************************************************** * SetDCBrushColor (X11DRV.@) */ -COLORREF X11DRV_SetDCBrushColor( X11DRV_PDEVICE *physDev, COLORREF crColor ) +COLORREF CDECL X11DRV_SetDCBrushColor( X11DRV_PDEVICE *physDev, COLORREF crColor ) { if (GetCurrentObject(physDev->hdc, OBJ_BRUSH) == GetStockObject( DC_BRUSH )) BRUSH_SelectSolidBrush( physDev, crColor ); diff --git a/dlls/winex11.drv/clipboard.c b/dlls/winex11.drv/clipboard.c index 36b26a7dc87..7cea221b29e 100644 --- a/dlls/winex11.drv/clipboard.c +++ b/dlls/winex11.drv/clipboard.c @@ -145,8 +145,8 @@ static int selectionAcquired = 0; /* Contains the current selection static Window selectionWindow = None; /* The top level X window which owns the selection */ static Atom selectionCacheSrc = XA_PRIMARY; /* The selection source from which the clipboard cache was filled */ -void X11DRV_EmptyClipboard(BOOL keepunowned); -void X11DRV_EndClipboardUpdate(void); +void CDECL X11DRV_EmptyClipboard(BOOL keepunowned); +void CDECL X11DRV_EndClipboardUpdate(void); static HANDLE X11DRV_CLIPBOARD_ImportClipboardData(Display *d, Window w, Atom prop); static HANDLE X11DRV_CLIPBOARD_ImportEnhMetaFile(Display *d, Window w, Atom prop); static HANDLE X11DRV_CLIPBOARD_ImportMetaFilePict(Display *d, Window w, Atom prop); @@ -2330,7 +2330,7 @@ static BOOL X11DRV_CLIPBOARD_IsSelectionOwner(void) * Registers a custom X clipboard format * Returns: Format id or 0 on failure */ -UINT X11DRV_RegisterClipboardFormat(LPCWSTR FormatName) +UINT CDECL X11DRV_RegisterClipboardFormat(LPCWSTR FormatName) { LPWINE_CLIPFORMAT lpFormat; @@ -2343,7 +2343,7 @@ UINT X11DRV_RegisterClipboardFormat(LPCWSTR FormatName) /************************************************************************** * X11DRV_GetClipboardFormatName */ -INT X11DRV_GetClipboardFormatName(UINT wFormat, LPWSTR retStr, INT maxlen) +INT CDECL X11DRV_GetClipboardFormatName(UINT wFormat, LPWSTR retStr, INT maxlen) { LPWINE_CLIPFORMAT lpFormat; @@ -2373,7 +2373,7 @@ INT X11DRV_GetClipboardFormatName(UINT wFormat, LPWSTR retStr, INT maxlen) /************************************************************************** * AcquireClipboard (X11DRV.@) */ -int X11DRV_AcquireClipboard(HWND hWndClipWindow) +int CDECL X11DRV_AcquireClipboard(HWND hWndClipWindow) { DWORD procid; Window owner; @@ -2443,7 +2443,7 @@ int X11DRV_AcquireClipboard(HWND hWndClipWindow) * * Empty cached clipboard data. */ -void X11DRV_EmptyClipboard(BOOL keepunowned) +void CDECL X11DRV_EmptyClipboard(BOOL keepunowned) { if (ClipData) { @@ -2482,7 +2482,7 @@ void X11DRV_EmptyClipboard(BOOL keepunowned) /************************************************************************** * X11DRV_SetClipboardData */ -BOOL X11DRV_SetClipboardData(UINT wFormat, HANDLE16 hData16, HANDLE hData32, BOOL owner) +BOOL CDECL X11DRV_SetClipboardData(UINT wFormat, HANDLE16 hData16, HANDLE hData32, BOOL owner) { DWORD flags = 0; BOOL bResult = TRUE; @@ -2513,7 +2513,7 @@ BOOL X11DRV_SetClipboardData(UINT wFormat, HANDLE16 hData16, HANDLE hData32, BOO /************************************************************************** * CountClipboardFormats */ -INT X11DRV_CountClipboardFormats(void) +INT CDECL X11DRV_CountClipboardFormats(void) { CLIPBOARDINFO cbinfo; @@ -2528,7 +2528,7 @@ INT X11DRV_CountClipboardFormats(void) /************************************************************************** * X11DRV_EnumClipboardFormats */ -UINT X11DRV_EnumClipboardFormats(UINT wFormat) +UINT CDECL X11DRV_EnumClipboardFormats(UINT wFormat) { CLIPBOARDINFO cbinfo; UINT wNextFormat = 0; @@ -2557,7 +2557,7 @@ UINT X11DRV_EnumClipboardFormats(UINT wFormat) /************************************************************************** * X11DRV_IsClipboardFormatAvailable */ -BOOL X11DRV_IsClipboardFormatAvailable(UINT wFormat) +BOOL CDECL X11DRV_IsClipboardFormatAvailable(UINT wFormat) { BOOL bRet = FALSE; CLIPBOARDINFO cbinfo; @@ -2578,7 +2578,7 @@ BOOL X11DRV_IsClipboardFormatAvailable(UINT wFormat) /************************************************************************** * GetClipboardData (USER.142) */ -BOOL X11DRV_GetClipboardData(UINT wFormat, HANDLE16* phData16, HANDLE* phData32) +BOOL CDECL X11DRV_GetClipboardData(UINT wFormat, HANDLE16* phData16, HANDLE* phData32) { CLIPBOARDINFO cbinfo; LPWINE_CLIPDATA lpRender; @@ -2773,7 +2773,7 @@ static BOOL X11DRV_CLIPBOARD_SynthesizeData(UINT wFormatID) * TODO: * Add locale if it hasn't already been added */ -void X11DRV_EndClipboardUpdate(void) +void CDECL X11DRV_EndClipboardUpdate(void) { INT count = ClipDataCount; diff --git a/dlls/winex11.drv/dib.c b/dlls/winex11.drv/dib.c index be38d8962e8..6a0b5c1a986 100644 --- a/dlls/winex11.drv/dib.c +++ b/dlls/winex11.drv/dib.c @@ -3791,10 +3791,10 @@ static int X11DRV_DIB_GetImageBits( const X11DRV_DIB_IMAGEBITS_DESCR *descr ) * X11DRV_SetDIBitsToDevice * */ -INT X11DRV_SetDIBitsToDevice( X11DRV_PDEVICE *physDev, INT xDest, INT yDest, DWORD cx, - DWORD cy, INT xSrc, INT ySrc, - UINT startscan, UINT lines, LPCVOID bits, - const BITMAPINFO *info, UINT coloruse ) +INT CDECL X11DRV_SetDIBitsToDevice( X11DRV_PDEVICE *physDev, INT xDest, INT yDest, DWORD cx, + DWORD cy, INT xSrc, INT ySrc, + UINT startscan, UINT lines, LPCVOID bits, + const BITMAPINFO *info, UINT coloruse ) { X11DRV_DIB_IMAGEBITS_DESCR descr; INT result; @@ -3917,8 +3917,8 @@ INT X11DRV_SetDIBitsToDevice( X11DRV_PDEVICE *physDev, INT xDest, INT yDest, DWO /*********************************************************************** * SetDIBits (X11DRV.@) */ -INT X11DRV_SetDIBits( X11DRV_PDEVICE *physDev, HBITMAP hbitmap, UINT startscan, - UINT lines, LPCVOID bits, const BITMAPINFO *info, UINT coloruse ) +INT CDECL X11DRV_SetDIBits( X11DRV_PDEVICE *physDev, HBITMAP hbitmap, UINT startscan, + UINT lines, LPCVOID bits, const BITMAPINFO *info, UINT coloruse ) { X_PHYSBITMAP *physBitmap = X11DRV_get_phys_bitmap( hbitmap ); X11DRV_DIB_IMAGEBITS_DESCR descr; @@ -4030,8 +4030,8 @@ INT X11DRV_SetDIBits( X11DRV_PDEVICE *physDev, HBITMAP hbitmap, UINT startscan, /*********************************************************************** * GetDIBits (X11DRV.@) */ -INT X11DRV_GetDIBits( X11DRV_PDEVICE *physDev, HBITMAP hbitmap, UINT startscan, UINT lines, - LPVOID bits, BITMAPINFO *info, UINT coloruse ) +INT CDECL X11DRV_GetDIBits( X11DRV_PDEVICE *physDev, HBITMAP hbitmap, UINT startscan, UINT lines, + LPVOID bits, BITMAPINFO *info, UINT coloruse ) { X_PHYSBITMAP *physBitmap = X11DRV_get_phys_bitmap( hbitmap ); DIBSECTION dib; @@ -4675,8 +4675,8 @@ static XImage *X11DRV_XShmCreateImage( int width, int height, int bpp, /*********************************************************************** * X11DRV_CreateDIBSection (X11DRV.@) */ -HBITMAP X11DRV_CreateDIBSection( X11DRV_PDEVICE *physDev, HBITMAP hbitmap, - const BITMAPINFO *bmi, UINT usage ) +HBITMAP CDECL X11DRV_CreateDIBSection( X11DRV_PDEVICE *physDev, HBITMAP hbitmap, + const BITMAPINFO *bmi, UINT usage ) { X_PHYSBITMAP *physBitmap; DIBSECTION dib; @@ -4775,7 +4775,7 @@ void X11DRV_DIB_DeleteDIBSection(X_PHYSBITMAP *physBitmap, DIBSECTION *dib) /*********************************************************************** * SetDIBColorTable (X11DRV.@) */ -UINT X11DRV_SetDIBColorTable( X11DRV_PDEVICE *physDev, UINT start, UINT count, const RGBQUAD *colors ) +UINT CDECL X11DRV_SetDIBColorTable( X11DRV_PDEVICE *physDev, UINT start, UINT count, const RGBQUAD *colors ) { DIBSECTION dib; UINT ret = 0; diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index f0aea44ecff..e45b4e7b1ab 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -390,8 +390,8 @@ static int process_events( Display *display, Bool (*filter)(), ULONG_PTR arg ) /*********************************************************************** * MsgWaitForMultipleObjectsEx (X11DRV.@) */ -DWORD X11DRV_MsgWaitForMultipleObjectsEx( DWORD count, const HANDLE *handles, - DWORD timeout, DWORD mask, DWORD flags ) +DWORD CDECL X11DRV_MsgWaitForMultipleObjectsEx( DWORD count, const HANDLE *handles, + DWORD timeout, DWORD mask, DWORD flags ) { DWORD ret; struct x11drv_thread_data *data = TlsGetValue( thread_data_tls_index ); @@ -1361,7 +1361,7 @@ static void X11DRV_ClientMessage( HWND hwnd, XEvent *xev ) /*********************************************************************** * X11DRV_SendInput (X11DRV.@) */ -UINT X11DRV_SendInput( UINT count, LPINPUT inputs, int size ) +UINT CDECL X11DRV_SendInput( UINT count, LPINPUT inputs, int size ) { UINT i; diff --git a/dlls/winex11.drv/graphics.c b/dlls/winex11.drv/graphics.c index 6b6055f3e60..4f87137f91d 100644 --- a/dlls/winex11.drv/graphics.c +++ b/dlls/winex11.drv/graphics.c @@ -155,7 +155,7 @@ RGNDATA *X11DRV_GetRegionData( HRGN hrgn, HDC hdc_lptodp ) /*********************************************************************** * X11DRV_SetDeviceClipping */ -void X11DRV_SetDeviceClipping( X11DRV_PDEVICE *physDev, HRGN vis_rgn, HRGN clip_rgn ) +void CDECL X11DRV_SetDeviceClipping( X11DRV_PDEVICE *physDev, HRGN vis_rgn, HRGN clip_rgn ) { RGNDATA *data; @@ -433,7 +433,7 @@ INT X11DRV_YWStoDS( X11DRV_PDEVICE *physDev, INT height ) /*********************************************************************** * X11DRV_LineTo */ -BOOL +BOOL CDECL X11DRV_LineTo( X11DRV_PDEVICE *physDev, INT x, INT y ) { POINT pt[2]; @@ -629,7 +629,7 @@ X11DRV_DrawArc( X11DRV_PDEVICE *physDev, INT left, INT top, INT right, /*********************************************************************** * X11DRV_Arc */ -BOOL +BOOL CDECL X11DRV_Arc( X11DRV_PDEVICE *physDev, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend ) { @@ -641,7 +641,7 @@ X11DRV_Arc( X11DRV_PDEVICE *physDev, INT left, INT top, INT right, INT bottom, /*********************************************************************** * X11DRV_Pie */ -BOOL +BOOL CDECL X11DRV_Pie( X11DRV_PDEVICE *physDev, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend ) { @@ -652,7 +652,7 @@ X11DRV_Pie( X11DRV_PDEVICE *physDev, INT left, INT top, INT right, INT bottom, /*********************************************************************** * X11DRV_Chord */ -BOOL +BOOL CDECL X11DRV_Chord( X11DRV_PDEVICE *physDev, INT left, INT top, INT right, INT bottom, INT xstart, INT ystart, INT xend, INT yend ) { @@ -664,7 +664,7 @@ X11DRV_Chord( X11DRV_PDEVICE *physDev, INT left, INT top, INT right, INT bottom, /*********************************************************************** * X11DRV_Ellipse */ -BOOL +BOOL CDECL X11DRV_Ellipse( X11DRV_PDEVICE *physDev, INT left, INT top, INT right, INT bottom ) { INT width, oldwidth; @@ -728,7 +728,7 @@ X11DRV_Ellipse( X11DRV_PDEVICE *physDev, INT left, INT top, INT right, INT botto /*********************************************************************** * X11DRV_Rectangle */ -BOOL +BOOL CDECL X11DRV_Rectangle(X11DRV_PDEVICE *physDev, INT left, INT top, INT right, INT bottom) { INT width, oldwidth, oldjoinstyle; @@ -801,7 +801,7 @@ X11DRV_Rectangle(X11DRV_PDEVICE *physDev, INT left, INT top, INT right, INT bott /*********************************************************************** * X11DRV_RoundRect */ -BOOL +BOOL CDECL X11DRV_RoundRect( X11DRV_PDEVICE *physDev, INT left, INT top, INT right, INT bottom, INT ell_width, INT ell_height ) { @@ -1011,7 +1011,7 @@ X11DRV_RoundRect( X11DRV_PDEVICE *physDev, INT left, INT top, INT right, /*********************************************************************** * X11DRV_SetPixel */ -COLORREF +COLORREF CDECL X11DRV_SetPixel( X11DRV_PDEVICE *physDev, INT x, INT y, COLORREF color ) { unsigned long pixel; @@ -1043,7 +1043,7 @@ X11DRV_SetPixel( X11DRV_PDEVICE *physDev, INT x, INT y, COLORREF color ) /*********************************************************************** * X11DRV_GetPixel */ -COLORREF +COLORREF CDECL X11DRV_GetPixel( X11DRV_PDEVICE *physDev, INT x, INT y ) { static Pixmap pixmap = 0; @@ -1090,7 +1090,7 @@ X11DRV_GetPixel( X11DRV_PDEVICE *physDev, INT x, INT y ) /*********************************************************************** * X11DRV_PaintRgn */ -BOOL +BOOL CDECL X11DRV_PaintRgn( X11DRV_PDEVICE *physDev, HRGN hrgn ) { if (X11DRV_SetupGCForBrush( physDev )) @@ -1120,7 +1120,7 @@ X11DRV_PaintRgn( X11DRV_PDEVICE *physDev, HRGN hrgn ) /********************************************************************** * X11DRV_Polyline */ -BOOL +BOOL CDECL X11DRV_Polyline( X11DRV_PDEVICE *physDev, const POINT* pt, INT count ) { int i; @@ -1157,7 +1157,7 @@ X11DRV_Polyline( X11DRV_PDEVICE *physDev, const POINT* pt, INT count ) /********************************************************************** * X11DRV_Polygon */ -BOOL +BOOL CDECL X11DRV_Polygon( X11DRV_PDEVICE *physDev, const POINT* pt, INT count ) { register int i; @@ -1209,7 +1209,7 @@ X11DRV_Polygon( X11DRV_PDEVICE *physDev, const POINT* pt, INT count ) /********************************************************************** * X11DRV_PolyPolygon */ -BOOL +BOOL CDECL X11DRV_PolyPolygon( X11DRV_PDEVICE *physDev, const POINT* pt, const INT* counts, UINT polygons) { HRGN hrgn; @@ -1267,7 +1267,7 @@ X11DRV_PolyPolygon( X11DRV_PDEVICE *physDev, const POINT* pt, const INT* counts, /********************************************************************** * X11DRV_PolyPolyline */ -BOOL +BOOL CDECL X11DRV_PolyPolyline( X11DRV_PDEVICE *physDev, const POINT* pt, const DWORD* counts, DWORD polylines ) { if (X11DRV_SetupGCForPen ( physDev )) @@ -1386,7 +1386,7 @@ static int ExtFloodFillXGetImageErrorHandler( Display *dpy, XErrorEvent *event, /********************************************************************** * X11DRV_ExtFloodFill */ -BOOL +BOOL CDECL X11DRV_ExtFloodFill( X11DRV_PDEVICE *physDev, INT x, INT y, COLORREF color, UINT fillType ) { @@ -1440,7 +1440,7 @@ X11DRV_ExtFloodFill( X11DRV_PDEVICE *physDev, INT x, INT y, COLORREF color, /********************************************************************** * X11DRV_SetBkColor */ -COLORREF +COLORREF CDECL X11DRV_SetBkColor( X11DRV_PDEVICE *physDev, COLORREF color ) { physDev->backgroundPixel = X11DRV_PALETTE_ToPhysical( physDev, color ); @@ -1450,7 +1450,7 @@ X11DRV_SetBkColor( X11DRV_PDEVICE *physDev, COLORREF color ) /********************************************************************** * X11DRV_SetTextColor */ -COLORREF +COLORREF CDECL X11DRV_SetTextColor( X11DRV_PDEVICE *physDev, COLORREF color ) { physDev->textPixel = X11DRV_PALETTE_ToPhysical( physDev, color ); @@ -1460,7 +1460,7 @@ X11DRV_SetTextColor( X11DRV_PDEVICE *physDev, COLORREF color ) /*********************************************************************** * GetDCOrgEx (X11DRV.@) */ -BOOL X11DRV_GetDCOrgEx( X11DRV_PDEVICE *physDev, LPPOINT lpp ) +BOOL CDECL X11DRV_GetDCOrgEx( X11DRV_PDEVICE *physDev, LPPOINT lpp ) { lpp->x = physDev->dc_rect.left + physDev->drawable_rect.left; lpp->y = physDev->dc_rect.top + physDev->drawable_rect.top; @@ -1471,7 +1471,7 @@ BOOL X11DRV_GetDCOrgEx( X11DRV_PDEVICE *physDev, LPPOINT lpp ) /*********************************************************************** * SetDCOrg (X11DRV.@) */ -DWORD X11DRV_SetDCOrg( X11DRV_PDEVICE *physDev, INT x, INT y ) +DWORD CDECL X11DRV_SetDCOrg( X11DRV_PDEVICE *physDev, INT x, INT y ) { DWORD ret = MAKELONG( physDev->dc_rect.left + physDev->drawable_rect.left, physDev->dc_rect.top + physDev->drawable_rect.top ); @@ -1516,7 +1516,7 @@ extern void WINAPI A_SHAFinal( sha_ctx *, unsigned char * ); /*********************************************************************** * GetICMProfile (X11DRV.@) */ -BOOL X11DRV_GetICMProfile( X11DRV_PDEVICE *physDev, LPDWORD size, LPWSTR filename ) +BOOL CDECL X11DRV_GetICMProfile( X11DRV_PDEVICE *physDev, LPDWORD size, LPWSTR filename ) { static const WCHAR path[] = {'\\','s','p','o','o','l','\\','d','r','i','v','e','r','s', diff --git a/dlls/winex11.drv/init.c b/dlls/winex11.drv/init.c index a8c56958537..8b7aca055c1 100644 --- a/dlls/winex11.drv/init.c +++ b/dlls/winex11.drv/init.c @@ -118,8 +118,8 @@ void X11DRV_GDI_Finalize(void) /********************************************************************** * X11DRV_CreateDC */ -BOOL X11DRV_CreateDC( HDC hdc, X11DRV_PDEVICE **pdev, LPCWSTR driver, LPCWSTR device, - LPCWSTR output, const DEVMODEW* initData ) +BOOL CDECL X11DRV_CreateDC( HDC hdc, X11DRV_PDEVICE **pdev, LPCWSTR driver, LPCWSTR device, + LPCWSTR output, const DEVMODEW* initData ) { X11DRV_PDEVICE *physDev; @@ -165,7 +165,7 @@ BOOL X11DRV_CreateDC( HDC hdc, X11DRV_PDEVICE **pdev, LPCWSTR driver, LPCWSTR de /********************************************************************** * X11DRV_DeleteDC */ -BOOL X11DRV_DeleteDC( X11DRV_PDEVICE *physDev ) +BOOL CDECL X11DRV_DeleteDC( X11DRV_PDEVICE *physDev ) { if(physDev->xrender) X11DRV_XRender_DeleteDC( physDev ); @@ -181,7 +181,7 @@ BOOL X11DRV_DeleteDC( X11DRV_PDEVICE *physDev ) /*********************************************************************** * GetDeviceCaps (X11DRV.@) */ -INT X11DRV_GetDeviceCaps( X11DRV_PDEVICE *physDev, INT cap ) +INT CDECL X11DRV_GetDeviceCaps( X11DRV_PDEVICE *physDev, INT cap ) { switch(cap) { @@ -276,8 +276,8 @@ INT X11DRV_GetDeviceCaps( X11DRV_PDEVICE *physDev, INT cap ) /********************************************************************** * ExtEscape (X11DRV.@) */ -INT X11DRV_ExtEscape( X11DRV_PDEVICE *physDev, INT escape, INT in_count, LPCVOID in_data, - INT out_count, LPVOID out_data ) +INT CDECL X11DRV_ExtEscape( X11DRV_PDEVICE *physDev, INT escape, INT in_count, LPCVOID in_data, + INT out_count, LPVOID out_data ) { switch(escape) { diff --git a/dlls/winex11.drv/keyboard.c b/dlls/winex11.drv/keyboard.c index 6312f24d753..ffd572c13a6 100644 --- a/dlls/winex11.drv/keyboard.c +++ b/dlls/winex11.drv/keyboard.c @@ -1892,7 +1892,7 @@ static BOOL match_x11_keyboard_layout(HKL hkl) /********************************************************************** * GetAsyncKeyState (X11DRV.@) */ -SHORT X11DRV_GetAsyncKeyState(INT key) +SHORT CDECL X11DRV_GetAsyncKeyState(INT key) { SHORT retval; @@ -1910,7 +1910,7 @@ SHORT X11DRV_GetAsyncKeyState(INT key) /*********************************************************************** * GetKeyboardLayout (X11DRV.@) */ -HKL X11DRV_GetKeyboardLayout(DWORD dwThreadid) +HKL CDECL X11DRV_GetKeyboardLayout(DWORD dwThreadid) { if (!dwThreadid || dwThreadid == GetCurrentThreadId()) { @@ -1927,7 +1927,7 @@ HKL X11DRV_GetKeyboardLayout(DWORD dwThreadid) /*********************************************************************** * GetKeyboardLayoutName (X11DRV.@) */ -BOOL X11DRV_GetKeyboardLayoutName(LPWSTR name) +BOOL CDECL X11DRV_GetKeyboardLayoutName(LPWSTR name) { static const WCHAR formatW[] = {'%','0','8','l','x',0}; DWORD layout; @@ -1950,7 +1950,7 @@ BOOL X11DRV_GetKeyboardLayoutName(LPWSTR name) /*********************************************************************** * LoadKeyboardLayout (X11DRV.@) */ -HKL X11DRV_LoadKeyboardLayout(LPCWSTR name, UINT flags) +HKL CDECL X11DRV_LoadKeyboardLayout(LPCWSTR name, UINT flags) { FIXME("%s, %04x: stub!\n", debugstr_w(name), flags); SetLastError(ERROR_CALL_NOT_IMPLEMENTED); @@ -1961,7 +1961,7 @@ HKL X11DRV_LoadKeyboardLayout(LPCWSTR name, UINT flags) /*********************************************************************** * UnloadKeyboardLayout (X11DRV.@) */ -BOOL X11DRV_UnloadKeyboardLayout(HKL hkl) +BOOL CDECL X11DRV_UnloadKeyboardLayout(HKL hkl) { FIXME("%p: stub!\n", hkl); SetLastError(ERROR_CALL_NOT_IMPLEMENTED); @@ -1972,7 +1972,7 @@ BOOL X11DRV_UnloadKeyboardLayout(HKL hkl) /*********************************************************************** * ActivateKeyboardLayout (X11DRV.@) */ -HKL X11DRV_ActivateKeyboardLayout(HKL hkl, UINT flags) +HKL CDECL X11DRV_ActivateKeyboardLayout(HKL hkl, UINT flags) { HKL oldHkl = 0; struct x11drv_thread_data *thread_data = x11drv_init_thread_data(); @@ -2035,7 +2035,7 @@ void X11DRV_MappingNotify( HWND dummy, XEvent *event ) * * Note: Windows ignores HKL parameter and uses current active layout instead */ -SHORT X11DRV_VkKeyScanEx(WCHAR wChar, HKL hkl) +SHORT CDECL X11DRV_VkKeyScanEx(WCHAR wChar, HKL hkl) { Display *display = thread_init_display(); KeyCode keycode; @@ -2127,11 +2127,11 @@ SHORT X11DRV_VkKeyScanEx(WCHAR wChar, HKL hkl) /*********************************************************************** * MapVirtualKeyEx (X11DRV.@) */ -UINT X11DRV_MapVirtualKeyEx(UINT wCode, UINT wMapType, HKL hkl) +UINT CDECL X11DRV_MapVirtualKeyEx(UINT wCode, UINT wMapType, HKL hkl) { Display *display = thread_init_display(); -#define returnMVK(value) { TRACE("returning 0x%x.\n",value); return value; } +#define returnMVK(value) do { TRACE("returning 0x%x.\n",value); return value; } while(0) TRACE("wCode=0x%x, wMapType=%d, hkl %p\n", wCode, wMapType, hkl); if (!match_x11_keyboard_layout(hkl)) @@ -2270,7 +2270,7 @@ UINT X11DRV_MapVirtualKeyEx(UINT wCode, UINT wMapType, HKL hkl) /*********************************************************************** * GetKeyNameText (X11DRV.@) */ -INT X11DRV_GetKeyNameText(LONG lParam, LPWSTR lpBuffer, INT nSize) +INT CDECL X11DRV_GetKeyNameText(LONG lParam, LPWSTR lpBuffer, INT nSize) { Display *display = thread_init_display(); int vkey, ansi, scanCode; @@ -2462,8 +2462,8 @@ static char KEYBOARD_MapDeadKeysym(KeySym keysym) * FIXME : should do the above (return 2 for non matching deadchar+char combinations) * */ -INT X11DRV_ToUnicodeEx(UINT virtKey, UINT scanCode, const BYTE *lpKeyState, - LPWSTR bufW, int bufW_size, UINT flags, HKL hkl) +INT CDECL X11DRV_ToUnicodeEx(UINT virtKey, UINT scanCode, const BYTE *lpKeyState, + LPWSTR bufW, int bufW_size, UINT flags, HKL hkl) { Display *display = thread_init_display(); XKeyEvent e; @@ -2733,7 +2733,7 @@ found: /*********************************************************************** * Beep (X11DRV.@) */ -void X11DRV_Beep(void) +void CDECL X11DRV_Beep(void) { wine_tsx11_lock(); XBell(gdi_display, 0); diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c index 89587d8f75d..b79f149aefd 100644 --- a/dlls/winex11.drv/mouse.c +++ b/dlls/winex11.drv/mouse.c @@ -89,7 +89,7 @@ POINT cursor_pos; static DWORD last_time_modified; static RECT cursor_clip; /* Cursor clipping rect */ -BOOL X11DRV_SetCursorPos( INT x, INT y ); +BOOL CDECL X11DRV_SetCursorPos( INT x, INT y ); /*********************************************************************** @@ -933,7 +933,7 @@ static Cursor create_cursor( Display *display, CURSORICONINFO *ptr ) /*********************************************************************** * SetCursor (X11DRV.@) */ -void X11DRV_SetCursor( CURSORICONINFO *lpCursor ) +void CDECL X11DRV_SetCursor( CURSORICONINFO *lpCursor ) { struct x11drv_thread_data *data = x11drv_init_thread_data(); Cursor cursor; @@ -965,7 +965,7 @@ void X11DRV_SetCursor( CURSORICONINFO *lpCursor ) /*********************************************************************** * SetCursorPos (X11DRV.@) */ -BOOL X11DRV_SetCursorPos( INT x, INT y ) +BOOL CDECL X11DRV_SetCursorPos( INT x, INT y ) { Display *display = thread_init_display(); POINT pt; @@ -994,7 +994,7 @@ BOOL X11DRV_SetCursorPos( INT x, INT y ) /*********************************************************************** * GetCursorPos (X11DRV.@) */ -BOOL X11DRV_GetCursorPos(LPPOINT pos) +BOOL CDECL X11DRV_GetCursorPos(LPPOINT pos) { Display *display = thread_init_display(); Window root, child; @@ -1024,7 +1024,7 @@ BOOL X11DRV_GetCursorPos(LPPOINT pos) * * Set the cursor clipping rectangle. */ -BOOL X11DRV_ClipCursor( LPCRECT clip ) +BOOL CDECL X11DRV_ClipCursor( LPCRECT clip ) { if (!IntersectRect( &cursor_clip, &virtual_screen_rect, clip )) cursor_clip = virtual_screen_rect; diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index df5bae09b28..5d34fad6c7d 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -1054,7 +1054,7 @@ static XID create_bitmap_glxpixmap(X11DRV_PDEVICE *physDev, WineGLPixelFormat *f * * Equivalent to glXChooseVisual. */ -int X11DRV_ChoosePixelFormat(X11DRV_PDEVICE *physDev, +int CDECL X11DRV_ChoosePixelFormat(X11DRV_PDEVICE *physDev, const PIXELFORMATDESCRIPTOR *ppfd) { WineGLPixelFormat *list; int onscreen_size; @@ -1295,7 +1295,7 @@ int X11DRV_ChoosePixelFormat(X11DRV_PDEVICE *physDev, * * Get the pixel-format descriptor associated to the given id */ -int X11DRV_DescribePixelFormat(X11DRV_PDEVICE *physDev, +int CDECL X11DRV_DescribePixelFormat(X11DRV_PDEVICE *physDev, int iPixelFormat, UINT nBytes, PIXELFORMATDESCRIPTOR *ppfd) { @@ -1436,7 +1436,7 @@ int X11DRV_DescribePixelFormat(X11DRV_PDEVICE *physDev, * * Get the pixel-format id used by this DC */ -int X11DRV_GetPixelFormat(X11DRV_PDEVICE *physDev) { +int CDECL X11DRV_GetPixelFormat(X11DRV_PDEVICE *physDev) { WineGLPixelFormat *fmt; int tmp; TRACE("(%p)\n", physDev); @@ -1545,7 +1545,7 @@ static BOOL internal_SetPixelFormat(X11DRV_PDEVICE *physDev, * * Set the pixel-format id used by this DC */ -BOOL X11DRV_SetPixelFormat(X11DRV_PDEVICE *physDev, +BOOL CDECL X11DRV_SetPixelFormat(X11DRV_PDEVICE *physDev, int iPixelFormat, const PIXELFORMATDESCRIPTOR *ppfd) { TRACE("(%p,%d,%p)\n", physDev, iPixelFormat, ppfd); @@ -1563,7 +1563,7 @@ BOOL X11DRV_SetPixelFormat(X11DRV_PDEVICE *physDev, * * For OpenGL32 wglCopyContext. */ -BOOL X11DRV_wglCopyContext(HGLRC hglrcSrc, HGLRC hglrcDst, UINT mask) { +BOOL CDECL X11DRV_wglCopyContext(HGLRC hglrcSrc, HGLRC hglrcDst, UINT mask) { Wine_GLContext *src = (Wine_GLContext*)hglrcSrc; Wine_GLContext *dst = (Wine_GLContext*)hglrcDst; @@ -1618,7 +1618,7 @@ BOOL X11DRV_wglCopyContext(HGLRC hglrcSrc, HGLRC hglrcDst, UINT mask) { * * For OpenGL32 wglCreateContext. */ -HGLRC X11DRV_wglCreateContext(X11DRV_PDEVICE *physDev) +HGLRC CDECL X11DRV_wglCreateContext(X11DRV_PDEVICE *physDev) { Wine_GLContext *ret; WineGLPixelFormat *fmt; @@ -1660,7 +1660,7 @@ HGLRC X11DRV_wglCreateContext(X11DRV_PDEVICE *physDev) * * For OpenGL32 wglDeleteContext. */ -BOOL X11DRV_wglDeleteContext(HGLRC hglrc) +BOOL CDECL X11DRV_wglDeleteContext(HGLRC hglrc) { Wine_GLContext *ctx = (Wine_GLContext *) hglrc; BOOL ret = TRUE; @@ -1709,7 +1709,7 @@ static HDC WINAPI X11DRV_wglGetCurrentReadDCARB(void) * * For OpenGL32 wglGetProcAddress. */ -PROC X11DRV_wglGetProcAddress(LPCSTR lpszProc) +PROC CDECL X11DRV_wglGetProcAddress(LPCSTR lpszProc) { int i, j; const WineGLExtension *ext; @@ -1746,7 +1746,7 @@ PROC X11DRV_wglGetProcAddress(LPCSTR lpszProc) * * For OpenGL32 wglMakeCurrent. */ -BOOL X11DRV_wglMakeCurrent(X11DRV_PDEVICE *physDev, HGLRC hglrc) { +BOOL CDECL X11DRV_wglMakeCurrent(X11DRV_PDEVICE *physDev, HGLRC hglrc) { BOOL ret; HDC hdc = physDev->hdc; DWORD type = GetObjectType(hdc); @@ -1809,7 +1809,7 @@ BOOL X11DRV_wglMakeCurrent(X11DRV_PDEVICE *physDev, HGLRC hglrc) { * * For OpenGL32 wglMakeContextCurrentARB */ -BOOL X11DRV_wglMakeContextCurrentARB(X11DRV_PDEVICE* pDrawDev, X11DRV_PDEVICE* pReadDev, HGLRC hglrc) +BOOL CDECL X11DRV_wglMakeContextCurrentARB(X11DRV_PDEVICE* pDrawDev, X11DRV_PDEVICE* pReadDev, HGLRC hglrc) { BOOL ret; int indirect = (GetObjectType(pDrawDev->hdc) == OBJ_MEMDC); @@ -1854,7 +1854,7 @@ BOOL X11DRV_wglMakeContextCurrentARB(X11DRV_PDEVICE* pDrawDev, X11DRV_PDEVICE* p * * For OpenGL32 wglShareLists. */ -BOOL X11DRV_wglShareLists(HGLRC hglrc1, HGLRC hglrc2) { +BOOL CDECL X11DRV_wglShareLists(HGLRC hglrc1, HGLRC hglrc2) { Wine_GLContext *org = (Wine_GLContext *) hglrc1; Wine_GLContext *dest = (Wine_GLContext *) hglrc2; @@ -2000,7 +2000,7 @@ static BOOL internal_wglUseFontBitmaps(HDC hdc, DWORD first, DWORD count, DWORD * * For OpenGL32 wglUseFontBitmapsA. */ -BOOL X11DRV_wglUseFontBitmapsA(X11DRV_PDEVICE *physDev, DWORD first, DWORD count, DWORD listBase) +BOOL CDECL X11DRV_wglUseFontBitmapsA(X11DRV_PDEVICE *physDev, DWORD first, DWORD count, DWORD listBase) { Font fid = physDev->font; @@ -2024,7 +2024,7 @@ BOOL X11DRV_wglUseFontBitmapsA(X11DRV_PDEVICE *physDev, DWORD first, DWORD count * * For OpenGL32 wglUseFontBitmapsW. */ -BOOL X11DRV_wglUseFontBitmapsW(X11DRV_PDEVICE *physDev, DWORD first, DWORD count, DWORD listBase) +BOOL CDECL X11DRV_wglUseFontBitmapsW(X11DRV_PDEVICE *physDev, DWORD first, DWORD count, DWORD listBase) { Font fid = physDev->font; @@ -2395,7 +2395,7 @@ static GLboolean WINAPI X11DRV_wglDestroyPbufferARB(HPBUFFERARB hPbuffer) * Gdi32 implements the part of this function which creates a device context. * This part associates the physDev with the X drawable of the pbuffer. */ -HDC X11DRV_wglGetPbufferDCARB(X11DRV_PDEVICE *physDev, HPBUFFERARB hPbuffer) +HDC CDECL X11DRV_wglGetPbufferDCARB(X11DRV_PDEVICE *physDev, HPBUFFERARB hPbuffer) { Wine_GLPBuffer* object = (Wine_GLPBuffer*) hPbuffer; if (NULL == object) { @@ -3172,7 +3172,7 @@ static void WINAPI X11DRV_wglFreeMemoryNV(GLvoid* pointer) { * WGL_WINE_pixel_format_passthrough: wglSetPixelFormatWINE * This is a WINE-specific wglSetPixelFormat which can set the pixel format multiple times. */ -BOOL X11DRV_wglSetPixelFormatWINE(X11DRV_PDEVICE *physDev, int iPixelFormat, const PIXELFORMATDESCRIPTOR *ppfd) +BOOL CDECL X11DRV_wglSetPixelFormatWINE(X11DRV_PDEVICE *physDev, int iPixelFormat, const PIXELFORMATDESCRIPTOR *ppfd) { TRACE("(%p,%d,%p)\n", physDev, iPixelFormat, ppfd); @@ -3444,7 +3444,7 @@ BOOL destroy_glxpixmap(Display *display, XID glxpixmap) * * Swap the buffers of this DC */ -BOOL X11DRV_SwapBuffers(X11DRV_PDEVICE *physDev) +BOOL CDECL X11DRV_SwapBuffers(X11DRV_PDEVICE *physDev) { GLXDrawable drawable; Wine_GLContext *ctx = NtCurrentTeb()->glContext; @@ -3544,8 +3544,8 @@ Drawable create_glxpixmap(Display *display, XVisualInfo *vis, Pixmap parent) /*********************************************************************** * ChoosePixelFormat (X11DRV.@) */ -int X11DRV_ChoosePixelFormat(X11DRV_PDEVICE *physDev, - const PIXELFORMATDESCRIPTOR *ppfd) { +int CDECL X11DRV_ChoosePixelFormat(X11DRV_PDEVICE *physDev, + const PIXELFORMATDESCRIPTOR *ppfd) { opengl_error(); return 0; } @@ -3553,10 +3553,10 @@ int X11DRV_ChoosePixelFormat(X11DRV_PDEVICE *physDev, /*********************************************************************** * DescribePixelFormat (X11DRV.@) */ -int X11DRV_DescribePixelFormat(X11DRV_PDEVICE *physDev, - int iPixelFormat, - UINT nBytes, - PIXELFORMATDESCRIPTOR *ppfd) { +int CDECL X11DRV_DescribePixelFormat(X11DRV_PDEVICE *physDev, + int iPixelFormat, + UINT nBytes, + PIXELFORMATDESCRIPTOR *ppfd) { opengl_error(); return 0; } @@ -3564,7 +3564,7 @@ int X11DRV_DescribePixelFormat(X11DRV_PDEVICE *physDev, /*********************************************************************** * GetPixelFormat (X11DRV.@) */ -int X11DRV_GetPixelFormat(X11DRV_PDEVICE *physDev) { +int CDECL X11DRV_GetPixelFormat(X11DRV_PDEVICE *physDev) { opengl_error(); return 0; } @@ -3572,9 +3572,9 @@ int X11DRV_GetPixelFormat(X11DRV_PDEVICE *physDev) { /*********************************************************************** * SetPixelFormat (X11DRV.@) */ -BOOL X11DRV_SetPixelFormat(X11DRV_PDEVICE *physDev, - int iPixelFormat, - const PIXELFORMATDESCRIPTOR *ppfd) { +BOOL CDECL X11DRV_SetPixelFormat(X11DRV_PDEVICE *physDev, + int iPixelFormat, + const PIXELFORMATDESCRIPTOR *ppfd) { opengl_error(); return FALSE; } @@ -3582,7 +3582,7 @@ BOOL X11DRV_SetPixelFormat(X11DRV_PDEVICE *physDev, /*********************************************************************** * SwapBuffers (X11DRV.@) */ -BOOL X11DRV_SwapBuffers(X11DRV_PDEVICE *physDev) { +BOOL CDECL X11DRV_SwapBuffers(X11DRV_PDEVICE *physDev) { opengl_error(); return FALSE; } @@ -3592,7 +3592,7 @@ BOOL X11DRV_SwapBuffers(X11DRV_PDEVICE *physDev) { * * For OpenGL32 wglCopyContext. */ -BOOL X11DRV_wglCopyContext(HGLRC hglrcSrc, HGLRC hglrcDst, UINT mask) { +BOOL CDECL X11DRV_wglCopyContext(HGLRC hglrcSrc, HGLRC hglrcDst, UINT mask) { opengl_error(); return FALSE; } @@ -3602,7 +3602,7 @@ BOOL X11DRV_wglCopyContext(HGLRC hglrcSrc, HGLRC hglrcDst, UINT mask) { * * For OpenGL32 wglCreateContext. */ -HGLRC X11DRV_wglCreateContext(X11DRV_PDEVICE *physDev) { +HGLRC CDECL X11DRV_wglCreateContext(X11DRV_PDEVICE *physDev) { opengl_error(); return NULL; } @@ -3612,7 +3612,7 @@ HGLRC X11DRV_wglCreateContext(X11DRV_PDEVICE *physDev) { * * For OpenGL32 wglDeleteContext. */ -BOOL X11DRV_wglDeleteContext(HGLRC hglrc) { +BOOL CDECL X11DRV_wglDeleteContext(HGLRC hglrc) { opengl_error(); return FALSE; } @@ -3622,18 +3622,18 @@ BOOL X11DRV_wglDeleteContext(HGLRC hglrc) { * * For OpenGL32 wglGetProcAddress. */ -PROC X11DRV_wglGetProcAddress(LPCSTR lpszProc) { +PROC CDECL X11DRV_wglGetProcAddress(LPCSTR lpszProc) { opengl_error(); return NULL; } -HDC X11DRV_wglGetPbufferDCARB(X11DRV_PDEVICE *hDevice, void *hPbuffer) +HDC CDECL X11DRV_wglGetPbufferDCARB(X11DRV_PDEVICE *hDevice, void *hPbuffer) { opengl_error(); return NULL; } -BOOL X11DRV_wglMakeContextCurrentARB(X11DRV_PDEVICE* hDrawDev, X11DRV_PDEVICE* hReadDev, HGLRC hglrc) { +BOOL CDECL X11DRV_wglMakeContextCurrentARB(X11DRV_PDEVICE* hDrawDev, X11DRV_PDEVICE* hReadDev, HGLRC hglrc) { opengl_error(); return FALSE; } @@ -3643,7 +3643,7 @@ BOOL X11DRV_wglMakeContextCurrentARB(X11DRV_PDEVICE* hDrawDev, X11DRV_PDEVICE* h * * For OpenGL32 wglMakeCurrent. */ -BOOL X11DRV_wglMakeCurrent(X11DRV_PDEVICE *physDev, HGLRC hglrc) { +BOOL CDECL X11DRV_wglMakeCurrent(X11DRV_PDEVICE *physDev, HGLRC hglrc) { opengl_error(); return FALSE; } @@ -3653,7 +3653,7 @@ BOOL X11DRV_wglMakeCurrent(X11DRV_PDEVICE *physDev, HGLRC hglrc) { * * For OpenGL32 wglShareLists. */ -BOOL X11DRV_wglShareLists(HGLRC hglrc1, HGLRC hglrc2) { +BOOL CDECL X11DRV_wglShareLists(HGLRC hglrc1, HGLRC hglrc2) { opengl_error(); return FALSE; } @@ -3663,7 +3663,7 @@ BOOL X11DRV_wglShareLists(HGLRC hglrc1, HGLRC hglrc2) { * * For OpenGL32 wglUseFontBitmapsA. */ -BOOL X11DRV_wglUseFontBitmapsA(X11DRV_PDEVICE *physDev, DWORD first, DWORD count, DWORD listBase) +BOOL CDECL X11DRV_wglUseFontBitmapsA(X11DRV_PDEVICE *physDev, DWORD first, DWORD count, DWORD listBase) { opengl_error(); return FALSE; @@ -3674,7 +3674,7 @@ BOOL X11DRV_wglUseFontBitmapsA(X11DRV_PDEVICE *physDev, DWORD first, DWORD count * * For OpenGL32 wglUseFontBitmapsW. */ -BOOL X11DRV_wglUseFontBitmapsW(X11DRV_PDEVICE *physDev, DWORD first, DWORD count, DWORD listBase) +BOOL CDECL X11DRV_wglUseFontBitmapsW(X11DRV_PDEVICE *physDev, DWORD first, DWORD count, DWORD listBase) { opengl_error(); return FALSE; @@ -3686,7 +3686,7 @@ BOOL X11DRV_wglUseFontBitmapsW(X11DRV_PDEVICE *physDev, DWORD first, DWORD count * WGL_WINE_pixel_format_passthrough: wglSetPixelFormatWINE * This is a WINE-specific wglSetPixelFormat which can set the pixel format multiple times. */ -BOOL X11DRV_wglSetPixelFormatWINE(X11DRV_PDEVICE *physDev, int iPixelFormat, const PIXELFORMATDESCRIPTOR *ppfd) +BOOL CDECL X11DRV_wglSetPixelFormatWINE(X11DRV_PDEVICE *physDev, int iPixelFormat, const PIXELFORMATDESCRIPTOR *ppfd) { opengl_error(); return FALSE; diff --git a/dlls/winex11.drv/pen.c b/dlls/winex11.drv/pen.c index cd29294968c..49fe74ca076 100644 --- a/dlls/winex11.drv/pen.c +++ b/dlls/winex11.drv/pen.c @@ -28,7 +28,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(x11drv); /*********************************************************************** * SelectPen (X11DRV.@) */ -HPEN X11DRV_SelectPen( X11DRV_PDEVICE *physDev, HPEN hpen ) +HPEN CDECL X11DRV_SelectPen( X11DRV_PDEVICE *physDev, HPEN hpen ) { static const char PEN_dash[] = { 16,8 }; static const char PEN_dot[] = { 4,4 }; @@ -126,7 +126,7 @@ HPEN X11DRV_SelectPen( X11DRV_PDEVICE *physDev, HPEN hpen ) /*********************************************************************** * SetDCPenColor (X11DRV.@) */ -COLORREF X11DRV_SetDCPenColor( X11DRV_PDEVICE *physDev, COLORREF crColor ) +COLORREF CDECL X11DRV_SetDCPenColor( X11DRV_PDEVICE *physDev, COLORREF crColor ) { if (GetCurrentObject(physDev->hdc, OBJ_PEN) == GetStockObject( DC_PEN )) physDev->pen.pixel = X11DRV_PALETTE_ToPhysical( physDev, crColor ); diff --git a/dlls/winex11.drv/scroll.c b/dlls/winex11.drv/scroll.c index 70b2f4006ed..9daad566755 100644 --- a/dlls/winex11.drv/scroll.c +++ b/dlls/winex11.drv/scroll.c @@ -60,8 +60,8 @@ static void dump_region( const char *p, HRGN hrgn) /************************************************************************* * ScrollDC (X11DRV.@) */ -BOOL X11DRV_ScrollDC( HDC hdc, INT dx, INT dy, const RECT *lprcScroll, - const RECT *lprcClip, HRGN hrgnUpdate, LPRECT lprcUpdate ) +BOOL CDECL X11DRV_ScrollDC( HDC hdc, INT dx, INT dy, const RECT *lprcScroll, + const RECT *lprcClip, HRGN hrgnUpdate, LPRECT lprcUpdate ) { RECT rcSrc, rcClip, offset; INT dxdev, dydev, res; diff --git a/dlls/winex11.drv/settings.c b/dlls/winex11.drv/settings.c index 35271344ba3..6bd804ae541 100644 --- a/dlls/winex11.drv/settings.c +++ b/dlls/winex11.drv/settings.c @@ -266,7 +266,7 @@ static BOOL write_registry_settings(const DEVMODEW *dm) * EnumDisplaySettingsEx (X11DRV.@) * */ -BOOL X11DRV_EnumDisplaySettingsEx( LPCWSTR name, DWORD n, LPDEVMODEW devmode, DWORD flags) +BOOL CDECL X11DRV_EnumDisplaySettingsEx( LPCWSTR name, DWORD n, LPDEVMODEW devmode, DWORD flags) { static const WCHAR dev_name[CCHDEVICENAME] = { 'W','i','n','e',' ','X','1','1',' ','d','r','i','v','e','r',0 }; @@ -348,8 +348,8 @@ static const char * _DM_fields(DWORD fields) * ChangeDisplaySettingsEx (X11DRV.@) * */ -LONG X11DRV_ChangeDisplaySettingsEx( LPCWSTR devname, LPDEVMODEW devmode, - HWND hwnd, DWORD flags, LPVOID lpvoid ) +LONG CDECL X11DRV_ChangeDisplaySettingsEx( LPCWSTR devname, LPDEVMODEW devmode, + HWND hwnd, DWORD flags, LPVOID lpvoid ) { DWORD i, dwBpp = 0; DEVMODEW dm; diff --git a/dlls/winex11.drv/text.c b/dlls/winex11.drv/text.c index 92a14f576e0..7773588fd92 100644 --- a/dlls/winex11.drv/text.c +++ b/dlls/winex11.drv/text.c @@ -37,7 +37,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(text); /*********************************************************************** * X11DRV_ExtTextOut */ -BOOL +BOOL CDECL X11DRV_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flags, const RECT *lprect, LPCWSTR wstr, UINT count, const INT *lpDx ) @@ -201,8 +201,8 @@ END: /*********************************************************************** * X11DRV_GetTextExtentExPoint */ -BOOL X11DRV_GetTextExtentExPoint( X11DRV_PDEVICE *physDev, LPCWSTR str, INT count, - INT maxExt, LPINT lpnFit, LPINT alpDx, LPSIZE size ) +BOOL CDECL X11DRV_GetTextExtentExPoint( X11DRV_PDEVICE *physDev, LPCWSTR str, INT count, + INT maxExt, LPINT lpnFit, LPINT alpDx, LPSIZE size ) { fontObject* pfo = XFONT_GetFontObject( physDev->font ); diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 1f456248fe9..3725352e0bd 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1475,7 +1475,7 @@ static void destroy_whole_window( Display *display, struct x11drv_win_data *data /***************************************************************** * SetWindowText (X11DRV.@) */ -void X11DRV_SetWindowText( HWND hwnd, LPCWSTR text ) +void CDECL X11DRV_SetWindowText( HWND hwnd, LPCWSTR text ) { Window win; @@ -1492,7 +1492,7 @@ void X11DRV_SetWindowText( HWND hwnd, LPCWSTR text ) * * Update the X state of a window to reflect a style change */ -void X11DRV_SetWindowStyle( HWND hwnd, INT offset, STYLESTRUCT *style ) +void CDECL X11DRV_SetWindowStyle( HWND hwnd, INT offset, STYLESTRUCT *style ) { struct x11drv_win_data *data; DWORD changed; @@ -1538,7 +1538,7 @@ void X11DRV_SetWindowStyle( HWND hwnd, INT offset, STYLESTRUCT *style ) /*********************************************************************** * DestroyWindow (X11DRV.@) */ -void X11DRV_DestroyWindow( HWND hwnd ) +void CDECL X11DRV_DestroyWindow( HWND hwnd ) { struct x11drv_thread_data *thread_data = x11drv_thread_data(); struct x11drv_win_data *data; @@ -1629,7 +1629,7 @@ static struct x11drv_win_data *create_desktop_win_data( Display *display, HWND h /********************************************************************** * CreateDesktopWindow (X11DRV.@) */ -BOOL X11DRV_CreateDesktopWindow( HWND hwnd ) +BOOL CDECL X11DRV_CreateDesktopWindow( HWND hwnd ) { unsigned int width, height; @@ -1671,7 +1671,7 @@ BOOL X11DRV_CreateDesktopWindow( HWND hwnd ) /********************************************************************** * CreateWindow (X11DRV.@) */ -BOOL X11DRV_CreateWindow( HWND hwnd ) +BOOL CDECL X11DRV_CreateWindow( HWND hwnd ) { if (hwnd == GetDesktopWindow() && root_window != DefaultRootWindow( gdi_display )) { @@ -1797,8 +1797,8 @@ XIC X11DRV_get_ic( HWND hwnd ) /*********************************************************************** * X11DRV_GetDC (X11DRV.@) */ -void X11DRV_GetDC( HDC hdc, HWND hwnd, HWND top, const RECT *win_rect, - const RECT *top_rect, DWORD flags ) +void CDECL X11DRV_GetDC( HDC hdc, HWND hwnd, HWND top, const RECT *win_rect, + const RECT *top_rect, DWORD flags ) { struct x11drv_escape_set_drawable escape; struct x11drv_win_data *data = X11DRV_get_win_data( hwnd ); @@ -1850,7 +1850,7 @@ void X11DRV_GetDC( HDC hdc, HWND hwnd, HWND top, const RECT *win_rect, /*********************************************************************** * X11DRV_ReleaseDC (X11DRV.@) */ -void X11DRV_ReleaseDC( HWND hwnd, HDC hdc ) +void CDECL X11DRV_ReleaseDC( HWND hwnd, HDC hdc ) { struct x11drv_escape_set_drawable escape; @@ -1870,7 +1870,7 @@ void X11DRV_ReleaseDC( HWND hwnd, HDC hdc ) /*********************************************************************** * SetCapture (X11DRV.@) */ -void X11DRV_SetCapture( HWND hwnd, UINT flags ) +void CDECL X11DRV_SetCapture( HWND hwnd, UINT flags ) { struct x11drv_thread_data *thread_data = x11drv_thread_data(); @@ -1904,7 +1904,7 @@ void X11DRV_SetCapture( HWND hwnd, UINT flags ) /***************************************************************** * SetParent (X11DRV.@) */ -void X11DRV_SetParent( HWND hwnd, HWND parent, HWND old_parent ) +void CDECL X11DRV_SetParent( HWND hwnd, HWND parent, HWND old_parent ) { Display *display = thread_display(); struct x11drv_win_data *data = X11DRV_get_win_data( hwnd ); @@ -1939,7 +1939,7 @@ void X11DRV_SetParent( HWND hwnd, HWND parent, HWND old_parent ) * * Set the X focus. */ -void X11DRV_SetFocus( HWND hwnd ) +void CDECL X11DRV_SetFocus( HWND hwnd ) { Display *display = thread_display(); struct x11drv_win_data *data; @@ -1968,8 +1968,8 @@ void X11DRV_SetFocus( HWND hwnd ) /*********************************************************************** * WindowPosChanging (X11DRV.@) */ -void X11DRV_WindowPosChanging( HWND hwnd, HWND insert_after, UINT swp_flags, - const RECT *window_rect, const RECT *client_rect, RECT *visible_rect ) +void CDECL X11DRV_WindowPosChanging( HWND hwnd, HWND insert_after, UINT swp_flags, + const RECT *window_rect, const RECT *client_rect, RECT *visible_rect ) { struct x11drv_win_data *data = X11DRV_get_win_data( hwnd ); DWORD style = GetWindowLongW( hwnd, GWL_STYLE ); @@ -1998,9 +1998,9 @@ void X11DRV_WindowPosChanging( HWND hwnd, HWND insert_after, UINT swp_flags, /*********************************************************************** * WindowPosChanged (X11DRV.@) */ -void X11DRV_WindowPosChanged( HWND hwnd, HWND insert_after, UINT swp_flags, - const RECT *rectWindow, const RECT *rectClient, - const RECT *visible_rect, const RECT *valid_rects ) +void CDECL X11DRV_WindowPosChanged( HWND hwnd, HWND insert_after, UINT swp_flags, + const RECT *rectWindow, const RECT *rectClient, + const RECT *visible_rect, const RECT *valid_rects ) { struct x11drv_thread_data *thread_data; Display *display; @@ -2111,7 +2111,7 @@ void X11DRV_WindowPosChanged( HWND hwnd, HWND insert_after, UINT swp_flags, /*********************************************************************** * ShowWindow (X11DRV.@) */ -UINT X11DRV_ShowWindow( HWND hwnd, INT cmd, RECT *rect, UINT swp ) +UINT CDECL X11DRV_ShowWindow( HWND hwnd, INT cmd, RECT *rect, UINT swp ) { int x, y; unsigned int width, height, border, depth; @@ -2161,7 +2161,7 @@ UINT X11DRV_ShowWindow( HWND hwnd, INT cmd, RECT *rect, UINT swp ) * This is not entirely correct, may need to create * an icon window and set the pixmap as a background */ -void X11DRV_SetWindowIcon( HWND hwnd, UINT type, HICON icon ) +void CDECL X11DRV_SetWindowIcon( HWND hwnd, UINT type, HICON icon ) { Display *display = thread_display(); struct x11drv_win_data *data; @@ -2187,7 +2187,7 @@ void X11DRV_SetWindowIcon( HWND hwnd, UINT type, HICON icon ) * * Assign specified region to window (for non-rectangular windows) */ -int X11DRV_SetWindowRgn( HWND hwnd, HRGN hrgn, BOOL redraw ) +int CDECL X11DRV_SetWindowRgn( HWND hwnd, HRGN hrgn, BOOL redraw ) { struct x11drv_win_data *data; @@ -2208,7 +2208,7 @@ int X11DRV_SetWindowRgn( HWND hwnd, HRGN hrgn, BOOL redraw ) * * Set transparency attributes for a layered window. */ -void X11DRV_SetLayeredWindowAttributes( HWND hwnd, COLORREF key, BYTE alpha, DWORD flags ) +void CDECL X11DRV_SetLayeredWindowAttributes( HWND hwnd, COLORREF key, BYTE alpha, DWORD flags ) { struct x11drv_win_data *data = X11DRV_get_win_data( hwnd ); @@ -2228,7 +2228,7 @@ void X11DRV_SetLayeredWindowAttributes( HWND hwnd, COLORREF key, BYTE alpha, DWO /********************************************************************** * X11DRV_WindowMessage (X11DRV.@) */ -LRESULT X11DRV_WindowMessage( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ) +LRESULT CDECL X11DRV_WindowMessage( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp ) { struct x11drv_win_data *data; @@ -2289,7 +2289,7 @@ static BOOL is_netwm_supported( Display *display, Atom atom ) * * Perform WM_SYSCOMMAND handling. */ -LRESULT X11DRV_SysCommand( HWND hwnd, WPARAM wparam, LPARAM lparam ) +LRESULT CDECL X11DRV_SysCommand( HWND hwnd, WPARAM wparam, LPARAM lparam ) { WPARAM hittest = wparam & 0x0f; DWORD dwPoint; diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 9588a735de7..6b29f2ae3e1 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -66,8 +66,8 @@ typedef int Status; struct tagCURSORICONINFO; -extern void wine_tsx11_lock(void); -extern void wine_tsx11_unlock(void); +extern void CDECL wine_tsx11_lock(void); +extern void CDECL wine_tsx11_unlock(void); /* X physical pen */ typedef struct @@ -152,82 +152,80 @@ extern X_PHYSBITMAP BITMAP_stock_phys_bitmap; /* phys bitmap for the default st /* Wine driver X11 functions */ -extern BOOL X11DRV_AlphaBlend( X11DRV_PDEVICE *physDevDst, INT xDst, INT yDst, - INT widthDst, INT heightDst, - X11DRV_PDEVICE *physDevSrc, INT xSrc, INT ySrc, - INT widthSrc, INT heightSrc, BLENDFUNCTION blendfn ); -extern BOOL X11DRV_BitBlt( X11DRV_PDEVICE *physDevDst, INT xDst, INT yDst, - INT width, INT height, X11DRV_PDEVICE *physDevSrc, - INT xSrc, INT ySrc, DWORD rop ); -extern BOOL X11DRV_EnumDeviceFonts( X11DRV_PDEVICE *physDev, LPLOGFONTW plf, - FONTENUMPROCW dfeproc, LPARAM lp ); -extern LONG X11DRV_GetBitmapBits( HBITMAP hbitmap, void *bits, LONG count ); -extern BOOL X11DRV_GetCharWidth( X11DRV_PDEVICE *physDev, UINT firstChar, - UINT lastChar, LPINT buffer ); -extern BOOL X11DRV_GetDCOrgEx( X11DRV_PDEVICE *physDev, LPPOINT lpp ); -extern BOOL X11DRV_GetTextExtentExPoint( X11DRV_PDEVICE *physDev, LPCWSTR str, INT count, - INT maxExt, LPINT lpnFit, LPINT alpDx, LPSIZE size ); -extern BOOL X11DRV_GetTextMetrics(X11DRV_PDEVICE *physDev, TEXTMETRICW *metrics); -extern BOOL X11DRV_PatBlt( X11DRV_PDEVICE *physDev, INT left, INT top, - INT width, INT height, DWORD rop ); -extern BOOL X11DRV_StretchBlt( X11DRV_PDEVICE *physDevDst, INT xDst, INT yDst, - INT widthDst, INT heightDst, - X11DRV_PDEVICE *physDevSrc, INT xSrc, INT ySrc, - INT widthSrc, INT heightSrc, DWORD rop ); -extern BOOL X11DRV_LineTo( X11DRV_PDEVICE *physDev, INT x, INT y); -extern BOOL X11DRV_Arc( X11DRV_PDEVICE *physDev, INT left, INT top, INT right, - INT bottom, INT xstart, INT ystart, INT xend, - INT yend ); -extern BOOL X11DRV_Pie( X11DRV_PDEVICE *physDev, INT left, INT top, INT right, - INT bottom, INT xstart, INT ystart, INT xend, - INT yend ); -extern BOOL X11DRV_Chord( X11DRV_PDEVICE *physDev, INT left, INT top, - INT right, INT bottom, INT xstart, - INT ystart, INT xend, INT yend ); -extern BOOL X11DRV_Ellipse( X11DRV_PDEVICE *physDev, INT left, INT top, - INT right, INT bottom ); -extern BOOL X11DRV_Rectangle(X11DRV_PDEVICE *physDev, INT left, INT top, - INT right, INT bottom); -extern BOOL X11DRV_RoundRect( X11DRV_PDEVICE *physDev, INT left, INT top, - INT right, INT bottom, INT ell_width, - INT ell_height ); -extern COLORREF X11DRV_SetPixel( X11DRV_PDEVICE *physDev, INT x, INT y, - COLORREF color ); -extern COLORREF X11DRV_GetPixel( X11DRV_PDEVICE *physDev, INT x, INT y); -extern BOOL X11DRV_PaintRgn( X11DRV_PDEVICE *physDev, HRGN hrgn ); -extern BOOL X11DRV_Polyline( X11DRV_PDEVICE *physDev,const POINT* pt,INT count); -extern BOOL X11DRV_Polygon( X11DRV_PDEVICE *physDev, const POINT* pt, INT count ); -extern BOOL X11DRV_PolyPolygon( X11DRV_PDEVICE *physDev, const POINT* pt, - const INT* counts, UINT polygons); -extern BOOL X11DRV_PolyPolyline( X11DRV_PDEVICE *physDev, const POINT* pt, - const DWORD* counts, DWORD polylines); - -extern COLORREF X11DRV_SetBkColor( X11DRV_PDEVICE *physDev, COLORREF color ); -extern COLORREF X11DRV_SetTextColor( X11DRV_PDEVICE *physDev, COLORREF color ); -extern BOOL X11DRV_ExtFloodFill( X11DRV_PDEVICE *physDev, INT x, INT y, - COLORREF color, UINT fillType ); -extern BOOL X11DRV_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, - UINT flags, const RECT *lprect, - LPCWSTR str, UINT count, const INT *lpDx ); -extern LONG X11DRV_SetBitmapBits( HBITMAP hbitmap, const void *bits, LONG count ); -extern void X11DRV_SetDeviceClipping( X11DRV_PDEVICE *physDev, HRGN vis_rgn, HRGN clip_rgn ); -extern INT X11DRV_SetDIBitsToDevice( X11DRV_PDEVICE *physDev, INT xDest, - INT yDest, DWORD cx, DWORD cy, - INT xSrc, INT ySrc, - UINT startscan, UINT lines, - LPCVOID bits, const BITMAPINFO *info, - UINT coloruse ); -extern BOOL X11DRV_GetDeviceGammaRamp( X11DRV_PDEVICE *physDev, LPVOID ramp ); -extern BOOL X11DRV_SetDeviceGammaRamp( X11DRV_PDEVICE *physDev, LPVOID ramp ); +extern BOOL CDECL X11DRV_AlphaBlend( X11DRV_PDEVICE *physDevDst, INT xDst, INT yDst, + INT widthDst, INT heightDst, + X11DRV_PDEVICE *physDevSrc, INT xSrc, INT ySrc, + INT widthSrc, INT heightSrc, BLENDFUNCTION blendfn ); +extern BOOL CDECL X11DRV_BitBlt( X11DRV_PDEVICE *physDevDst, INT xDst, INT yDst, + INT width, INT height, X11DRV_PDEVICE *physDevSrc, + INT xSrc, INT ySrc, DWORD rop ); +extern BOOL CDECL X11DRV_EnumDeviceFonts( X11DRV_PDEVICE *physDev, LPLOGFONTW plf, + FONTENUMPROCW dfeproc, LPARAM lp ); +extern LONG CDECL X11DRV_GetBitmapBits( HBITMAP hbitmap, void *bits, LONG count ); +extern BOOL CDECL X11DRV_GetCharWidth( X11DRV_PDEVICE *physDev, UINT firstChar, + UINT lastChar, LPINT buffer ); +extern BOOL CDECL X11DRV_GetDCOrgEx( X11DRV_PDEVICE *physDev, LPPOINT lpp ); +extern BOOL CDECL X11DRV_GetTextExtentExPoint( X11DRV_PDEVICE *physDev, LPCWSTR str, INT count, + INT maxExt, LPINT lpnFit, LPINT alpDx, LPSIZE size ); +extern BOOL CDECL X11DRV_GetTextMetrics(X11DRV_PDEVICE *physDev, TEXTMETRICW *metrics); +extern BOOL CDECL X11DRV_PatBlt( X11DRV_PDEVICE *physDev, INT left, INT top, + INT width, INT height, DWORD rop ); +extern BOOL CDECL X11DRV_StretchBlt( X11DRV_PDEVICE *physDevDst, INT xDst, INT yDst, + INT widthDst, INT heightDst, + X11DRV_PDEVICE *physDevSrc, INT xSrc, INT ySrc, + INT widthSrc, INT heightSrc, DWORD rop ); +extern BOOL CDECL X11DRV_LineTo( X11DRV_PDEVICE *physDev, INT x, INT y); +extern BOOL CDECL X11DRV_Arc( X11DRV_PDEVICE *physDev, INT left, INT top, INT right, + INT bottom, INT xstart, INT ystart, INT xend, INT yend ); +extern BOOL CDECL X11DRV_Pie( X11DRV_PDEVICE *physDev, INT left, INT top, INT right, + INT bottom, INT xstart, INT ystart, INT xend, + INT yend ); +extern BOOL CDECL X11DRV_Chord( X11DRV_PDEVICE *physDev, INT left, INT top, + INT right, INT bottom, INT xstart, + INT ystart, INT xend, INT yend ); +extern BOOL CDECL X11DRV_Ellipse( X11DRV_PDEVICE *physDev, INT left, INT top, + INT right, INT bottom ); +extern BOOL CDECL X11DRV_Rectangle(X11DRV_PDEVICE *physDev, INT left, INT top, + INT right, INT bottom); +extern BOOL CDECL X11DRV_RoundRect( X11DRV_PDEVICE *physDev, INT left, INT top, + INT right, INT bottom, INT ell_width, + INT ell_height ); +extern COLORREF CDECL X11DRV_SetPixel( X11DRV_PDEVICE *physDev, INT x, INT y, COLORREF color ); +extern COLORREF CDECL X11DRV_GetPixel( X11DRV_PDEVICE *physDev, INT x, INT y); +extern BOOL CDECL X11DRV_PaintRgn( X11DRV_PDEVICE *physDev, HRGN hrgn ); +extern BOOL CDECL X11DRV_Polyline( X11DRV_PDEVICE *physDev,const POINT* pt,INT count); +extern BOOL CDECL X11DRV_Polygon( X11DRV_PDEVICE *physDev, const POINT* pt, INT count ); +extern BOOL CDECL X11DRV_PolyPolygon( X11DRV_PDEVICE *physDev, const POINT* pt, + const INT* counts, UINT polygons); +extern BOOL CDECL X11DRV_PolyPolyline( X11DRV_PDEVICE *physDev, const POINT* pt, + const DWORD* counts, DWORD polylines); + +extern COLORREF CDECL X11DRV_SetBkColor( X11DRV_PDEVICE *physDev, COLORREF color ); +extern COLORREF CDECL X11DRV_SetTextColor( X11DRV_PDEVICE *physDev, COLORREF color ); +extern BOOL CDECL X11DRV_ExtFloodFill( X11DRV_PDEVICE *physDev, INT x, INT y, + COLORREF color, UINT fillType ); +extern BOOL CDECL X11DRV_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, + UINT flags, const RECT *lprect, + LPCWSTR str, UINT count, const INT *lpDx ); +extern LONG CDECL X11DRV_SetBitmapBits( HBITMAP hbitmap, const void *bits, LONG count ); +extern void CDECL X11DRV_SetDeviceClipping( X11DRV_PDEVICE *physDev, HRGN vis_rgn, HRGN clip_rgn ); +extern INT CDECL X11DRV_SetDIBitsToDevice( X11DRV_PDEVICE *physDev, INT xDest, + INT yDest, DWORD cx, DWORD cy, + INT xSrc, INT ySrc, + UINT startscan, UINT lines, + LPCVOID bits, const BITMAPINFO *info, + UINT coloruse ); +extern BOOL CDECL X11DRV_GetDeviceGammaRamp( X11DRV_PDEVICE *physDev, LPVOID ramp ); +extern BOOL CDECL X11DRV_SetDeviceGammaRamp( X11DRV_PDEVICE *physDev, LPVOID ramp ); /* OpenGL / X11 driver functions */ -extern int X11DRV_ChoosePixelFormat(X11DRV_PDEVICE *physDev, +extern int CDECL X11DRV_ChoosePixelFormat(X11DRV_PDEVICE *physDev, const PIXELFORMATDESCRIPTOR *pppfd); -extern int X11DRV_DescribePixelFormat(X11DRV_PDEVICE *physDev, +extern int CDECL X11DRV_DescribePixelFormat(X11DRV_PDEVICE *physDev, int iPixelFormat, UINT nBytes, PIXELFORMATDESCRIPTOR *ppfd); -extern int X11DRV_GetPixelFormat(X11DRV_PDEVICE *physDev); -extern BOOL X11DRV_SwapBuffers(X11DRV_PDEVICE *physDev); +extern int CDECL X11DRV_GetPixelFormat(X11DRV_PDEVICE *physDev); +extern BOOL CDECL X11DRV_SwapBuffers(X11DRV_PDEVICE *physDev); /* X11 driver internal functions */ @@ -735,19 +733,19 @@ extern void make_window_embedded( Display *display, struct x11drv_win_data *data extern XContext winContext; extern void X11DRV_InitClipboard(void); -extern int X11DRV_AcquireClipboard(HWND hWndClipWindow); +extern int CDECL X11DRV_AcquireClipboard(HWND hWndClipWindow); extern void X11DRV_ResetSelectionOwner(void); -extern void X11DRV_SetFocus( HWND hwnd ); +extern void CDECL X11DRV_SetFocus( HWND hwnd ); extern Cursor X11DRV_GetCursor( Display *display, struct tagCURSORICONINFO *ptr ); -extern void X11DRV_SetCursor( struct tagCURSORICONINFO *lpCursor ); -extern BOOL X11DRV_ClipCursor( LPCRECT clip ); +extern void CDECL X11DRV_SetCursor( struct tagCURSORICONINFO *lpCursor ); +extern BOOL CDECL X11DRV_ClipCursor( LPCRECT clip ); extern void X11DRV_InitKeyboard( Display *display ); extern void X11DRV_send_keyboard_input( WORD wVk, WORD wScan, DWORD dwFlags, DWORD time, DWORD dwExtraInfo, UINT injected_flags ); extern void X11DRV_send_mouse_input( HWND hwnd, DWORD flags, DWORD x, DWORD y, DWORD data, DWORD time, DWORD extra_info, UINT injected_flags ); -extern DWORD X11DRV_MsgWaitForMultipleObjectsEx( DWORD count, const HANDLE *handles, DWORD timeout, - DWORD mask, DWORD flags ); +extern DWORD CDECL X11DRV_MsgWaitForMultipleObjectsEx( DWORD count, const HANDLE *handles, DWORD timeout, + DWORD mask, DWORD flags ); typedef int (*x11drv_error_callback)( Display *display, XErrorEvent *event, void *arg ); diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c index 6b0e95c930d..fd8a41503e6 100644 --- a/dlls/winex11.drv/x11drv_main.c +++ b/dlls/winex11.drv/x11drv_main.c @@ -271,7 +271,7 @@ static int error_handler( Display *display, XErrorEvent *error_evt ) /*********************************************************************** * wine_tsx11_lock (X11DRV.@) */ -void wine_tsx11_lock(void) +void CDECL wine_tsx11_lock(void) { EnterCriticalSection( &X11DRV_CritSection ); } @@ -279,7 +279,7 @@ void wine_tsx11_lock(void) /*********************************************************************** * wine_tsx11_unlock (X11DRV.@) */ -void wine_tsx11_unlock(void) +void CDECL wine_tsx11_unlock(void) { LeaveCriticalSection( &X11DRV_CritSection ); } @@ -689,7 +689,7 @@ BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved ) * * Returns the active status of the screen saver */ -BOOL X11DRV_GetScreenSaveActive(void) +BOOL CDECL X11DRV_GetScreenSaveActive(void) { int timeout, temp; wine_tsx11_lock(); @@ -703,7 +703,7 @@ BOOL X11DRV_GetScreenSaveActive(void) * * Activate/Deactivate the screen saver */ -void X11DRV_SetScreenSaveActive(BOOL bActivate) +void CDECL X11DRV_SetScreenSaveActive(BOOL bActivate) { int timeout, interval, prefer_blanking, allow_exposures; static int last_timeout = 15 * 60; diff --git a/dlls/winex11.drv/xfont.c b/dlls/winex11.drv/xfont.c index 9fcb9930858..16d7406191a 100644 --- a/dlls/winex11.drv/xfont.c +++ b/dlls/winex11.drv/xfont.c @@ -3190,7 +3190,7 @@ XFontStruct* XFONT_GetFontStruct( X_PHYSFONT pFont ) /*********************************************************************** * SelectFont (X11DRV.@) */ -HFONT X11DRV_SelectFont( X11DRV_PDEVICE *physDev, HFONT hfont, HANDLE gdiFont ) +HFONT CDECL X11DRV_SelectFont( X11DRV_PDEVICE *physDev, HFONT hfont, HANDLE gdiFont ) { LOGFONTW logfont; LOGFONT16 lf; @@ -3283,8 +3283,8 @@ HFONT X11DRV_SelectFont( X11DRV_PDEVICE *physDev, HFONT hfont, HANDLE gdiFont ) * * X11DRV_EnumDeviceFonts */ -BOOL X11DRV_EnumDeviceFonts( X11DRV_PDEVICE *physDev, LPLOGFONTW plf, - FONTENUMPROCW proc, LPARAM lp ) +BOOL CDECL X11DRV_EnumDeviceFonts( X11DRV_PDEVICE *physDev, LPLOGFONTW plf, + FONTENUMPROCW proc, LPARAM lp ) { ENUMLOGFONTEXW lf; NEWTEXTMETRICEXW tm; @@ -3347,7 +3347,7 @@ BOOL X11DRV_EnumDeviceFonts( X11DRV_PDEVICE *physDev, LPLOGFONTW plf, /*********************************************************************** * X11DRV_GetTextMetrics */ -BOOL X11DRV_GetTextMetrics(X11DRV_PDEVICE *physDev, TEXTMETRICW *metrics) +BOOL CDECL X11DRV_GetTextMetrics(X11DRV_PDEVICE *physDev, TEXTMETRICW *metrics) { if( CHECK_PFONT(physDev->font) ) { @@ -3362,8 +3362,8 @@ BOOL X11DRV_GetTextMetrics(X11DRV_PDEVICE *physDev, TEXTMETRICW *metrics) /*********************************************************************** * X11DRV_GetCharWidth */ -BOOL X11DRV_GetCharWidth( X11DRV_PDEVICE *physDev, UINT firstChar, UINT lastChar, - LPINT buffer ) +BOOL CDECL X11DRV_GetCharWidth( X11DRV_PDEVICE *physDev, UINT firstChar, UINT lastChar, + LPINT buffer ) { fontObject* pfo = XFONT_GetFontObject( physDev->font ); diff --git a/dlls/winex11.drv/xinerama.c b/dlls/winex11.drv/xinerama.c index 08500261cbe..2a66df59bcd 100644 --- a/dlls/winex11.drv/xinerama.c +++ b/dlls/winex11.drv/xinerama.c @@ -204,7 +204,7 @@ void xinerama_init( unsigned int width, unsigned int height ) /*********************************************************************** * X11DRV_GetMonitorInfo (X11DRV.@) */ -BOOL X11DRV_GetMonitorInfo( HMONITOR handle, LPMONITORINFO info ) +BOOL CDECL X11DRV_GetMonitorInfo( HMONITOR handle, LPMONITORINFO info ) { int i = monitor_to_index( handle ); @@ -225,7 +225,7 @@ BOOL X11DRV_GetMonitorInfo( HMONITOR handle, LPMONITORINFO info ) /*********************************************************************** * X11DRV_EnumDisplayMonitors (X11DRV.@) */ -BOOL X11DRV_EnumDisplayMonitors( HDC hdc, LPRECT rect, MONITORENUMPROC proc, LPARAM lp ) +BOOL CDECL X11DRV_EnumDisplayMonitors( HDC hdc, LPRECT rect, MONITORENUMPROC proc, LPARAM lp ) { int i; diff --git a/dlls/winex11.drv/xrender.c b/dlls/winex11.drv/xrender.c index 3bad0a3bc99..01c95604a15 100644 --- a/dlls/winex11.drv/xrender.c +++ b/dlls/winex11.drv/xrender.c @@ -142,8 +142,10 @@ static CRITICAL_SECTION xrender_cs = { &critsect_debug, -1, 0, 0, 0, 0 }; #ifdef WORDS_BIGENDIAN #define get_be_word(x) (x) +#define NATIVE_BYTE_ORDER MSBFirst #else #define get_be_word(x) RtlUshortByteSwap(x) +#define NATIVE_BYTE_ORDER LSBFirst #endif /*********************************************************************** @@ -456,6 +458,7 @@ static int GetCacheEntry(X11DRV_PDEVICE *physDev, LFANDSIZE *plfsz) gsCacheEntry *entry; WORD flags; static int hinter = -1; + static int subpixel = -1; if((ret = LookupEntry(plfsz)) != -1) return ret; @@ -468,13 +471,24 @@ static int GetCacheEntry(X11DRV_PDEVICE *physDev, LFANDSIZE *plfsz) if(antialias && plfsz->lf.lfQuality != NONANTIALIASED_QUALITY) { - if(hinter == -1) + if(hinter == -1 || subpixel == -1) { RASTERIZER_STATUS status; GetRasterizerCaps(&status, sizeof(status)); hinter = status.wFlags & WINE_TT_HINTER_ENABLED; + subpixel = status.wFlags & WINE_TT_SUBPIXEL_RENDERING_ENABLED; } - if(!hinter || !get_gasp_flags(physDev, &flags) || flags & GASP_DOGRAY) + + /* FIXME: Use the following registry information + [HKEY_CURRENT_USER\Control Panel\Desktop] + "FontSmoothing"="2" ; 0=>Off, 2=>On + "FontSmoothingType"=dword:00000002 ; 1=>Standard, 2=>Cleartype + "FontSmoothingOrientation"=dword:00000001 ; 0=>BGR, 1=>RGB + "FontSmoothingGamma"=dword:00000578 + */ + if ( subpixel && X11DRV_XRender_Installed) + entry->aa_default = AA_RGB; + else if(!hinter || !get_gasp_flags(physDev, &flags) || flags & GASP_DOGRAY) entry->aa_default = AA_Grey; else entry->aa_default = AA_None; @@ -610,12 +624,25 @@ static BOOL UploadGlyph(X11DRV_PDEVICE *physDev, int glyph, AA_Type format) gsCacheEntryFormat *formatEntry; UINT ggo_format = GGO_GLYPH_INDEX; XRenderPictFormat pf; + unsigned long pf_mask; static const char zero[4]; switch(format) { case AA_Grey: ggo_format |= WINE_GGO_GRAY16_BITMAP; break; + case AA_RGB: + ggo_format |= WINE_GGO_HRGB_BITMAP; + break; + case AA_BGR: + ggo_format |= WINE_GGO_HBGR_BITMAP; + break; + case AA_VRGB: + ggo_format |= WINE_GGO_VRGB_BITMAP; + break; + case AA_VBGR: + ggo_format |= WINE_GGO_VBGR_BITMAP; + break; default: ERR("aa = %d - not implemented\n", format); @@ -630,8 +657,7 @@ static BOOL UploadGlyph(X11DRV_PDEVICE *physDev, int glyph, AA_Type format) if(format != AA_None) { format = AA_None; entry->aa_default = AA_None; - ggo_format &= ~WINE_GGO_GRAY16_BITMAP; - ggo_format |= GGO_BITMAP; + ggo_format = GGO_GLYPH_INDEX | GGO_BITMAP; buflen = GetGlyphOutlineW(physDev->hdc, glyph, ggo_format, &gm, 0, NULL, NULL); } @@ -689,29 +715,45 @@ static BOOL UploadGlyph(X11DRV_PDEVICE *physDev, int glyph, AA_Type format) if(formatEntry->glyphset == 0 && X11DRV_XRender_Installed) { switch(format) { case AA_Grey: + pf_mask = PictFormatType | PictFormatDepth | PictFormatAlpha | PictFormatAlphaMask, + pf.type = PictTypeDirect; pf.depth = 8; + pf.direct.alpha = 0; pf.direct.alphaMask = 0xff; break; + case AA_RGB: + case AA_BGR: + case AA_VRGB: + case AA_VBGR: + pf_mask = PictFormatType | PictFormatDepth | PictFormatRed | PictFormatRedMask | + PictFormatGreen | PictFormatGreenMask | PictFormatBlue | + PictFormatBlueMask | PictFormatAlpha | PictFormatAlphaMask; + pf.type = PictTypeDirect; + pf.depth = 32; + pf.direct.red = 16; + pf.direct.redMask = 0xff; + pf.direct.green = 8; + pf.direct.greenMask = 0xff; + pf.direct.blue = 0; + pf.direct.blueMask = 0xff; + pf.direct.alpha = 24; + pf.direct.alphaMask = 0xff; + break; + default: ERR("aa = %d - not implemented\n", format); case AA_None: + pf_mask = PictFormatType | PictFormatDepth | PictFormatAlpha | PictFormatAlphaMask, + pf.type = PictTypeDirect; pf.depth = 1; + pf.direct.alpha = 0; pf.direct.alphaMask = 1; break; } - pf.type = PictTypeDirect; - pf.direct.alpha = 0; - wine_tsx11_lock(); - formatEntry->font_format = pXRenderFindFormat(gdi_display, - PictFormatType | - PictFormatDepth | - PictFormatAlpha | - PictFormatAlphaMask, - &pf, 0); - + formatEntry->font_format = pXRenderFindFormat(gdi_display, pf_mask, &pf, 0); formatEntry->glyphset = pXRenderCreateGlyphSet(gdi_display, formatEntry->font_format); wine_tsx11_unlock(); } @@ -783,6 +825,12 @@ static BOOL UploadGlyph(X11DRV_PDEVICE *physDev, int glyph, AA_Type format) *byte++ = c; } } + else if ( format != AA_Grey && + ImageByteOrder (gdi_display) != NATIVE_BYTE_ORDER) + { + unsigned int i, *data = (unsigned int *)buf; + for (i = buflen / sizeof(int); i; i--, data++) *data = RtlUlongByteSwap(*data); + } gid = glyph; /* @@ -1483,9 +1531,9 @@ done_unlock: /****************************************************************************** * AlphaBlend (x11drv.@) */ -BOOL X11DRV_AlphaBlend(X11DRV_PDEVICE *devDst, INT xDst, INT yDst, INT widthDst, INT heightDst, - X11DRV_PDEVICE *devSrc, INT xSrc, INT ySrc, INT widthSrc, INT heightSrc, - BLENDFUNCTION blendfn) +BOOL CDECL X11DRV_AlphaBlend(X11DRV_PDEVICE *devDst, INT xDst, INT yDst, INT widthDst, INT heightDst, + X11DRV_PDEVICE *devSrc, INT xSrc, INT ySrc, INT widthSrc, INT heightSrc, + BLENDFUNCTION blendfn) { XRenderPictureAttributes pa; XRenderPictFormat *src_format; diff --git a/dlls/winex11.drv/xvidmode.c b/dlls/winex11.drv/xvidmode.c index 4ffbdc98e27..19b9909a61e 100644 --- a/dlls/winex11.drv/xvidmode.c +++ b/dlls/winex11.drv/xvidmode.c @@ -432,7 +432,7 @@ static BOOL X11DRV_XF86VM_SetGammaRamp(LPDDGAMMARAMP ramp) * the stuff in graphics/x11drv/ has been moved to dlls/x11drv, so that * they can include xvidmode.h directly */ -BOOL X11DRV_GetDeviceGammaRamp(X11DRV_PDEVICE *physDev, LPVOID ramp) +BOOL CDECL X11DRV_GetDeviceGammaRamp(X11DRV_PDEVICE *physDev, LPVOID ramp) { #ifdef SONAME_LIBXXF86VM return X11DRV_XF86VM_GetGammaRamp(ramp); @@ -448,7 +448,7 @@ BOOL X11DRV_GetDeviceGammaRamp(X11DRV_PDEVICE *physDev, LPVOID ramp) * the stuff in graphics/x11drv/ has been moved to dlls/x11drv, so that * they can include xvidmode.h directly */ -BOOL X11DRV_SetDeviceGammaRamp(X11DRV_PDEVICE *physDev, LPVOID ramp) +BOOL CDECL X11DRV_SetDeviceGammaRamp(X11DRV_PDEVICE *physDev, LPVOID ramp) { #ifdef SONAME_LIBXXF86VM return X11DRV_XF86VM_SetGammaRamp(ramp); diff --git a/dlls/winhttp/Makefile.in b/dlls/winhttp/Makefile.in index 40e8fa971b3..78d3814ad20 100644 --- a/dlls/winhttp/Makefile.in +++ b/dlls/winhttp/Makefile.in @@ -6,6 +6,7 @@ MODULE = winhttp.dll IMPORTLIB = winhttp IMPORTS = shlwapi kernel32 DELAYIMPORTS = crypt32 +EXTRALIBS = @SOCKETLIBS@ C_SRCS = \ cookie.c \ diff --git a/dlls/wininet/ftp.c b/dlls/wininet/ftp.c index 7dcbeb35311..d5bf13b3c59 100644 --- a/dlls/wininet/ftp.c +++ b/dlls/wininet/ftp.c @@ -94,7 +94,7 @@ typedef struct BOOL bIsDirectory; LPWSTR lpszName; DWORD nSize; - struct tm tmLastModified; + SYSTEMTIME tmLastModified; unsigned short permissions; } FILEPROPERTIESW, *LPFILEPROPERTIESW; @@ -3386,9 +3386,7 @@ static BOOL FTP_ConvertFileProp(LPFILEPROPERTIESW lpafp, LPWIN32_FIND_DATAW lpFi if (lpafp) { - /* Convert 'Unix' time to Windows time */ - RtlSecondsSince1970ToTime(mktime(&lpafp->tmLastModified), - (LARGE_INTEGER *) &(lpFindFileData->ftLastAccessTime)); + SystemTimeToFileTime( &lpafp->tmLastModified, &lpFindFileData->ftLastAccessTime ); lpFindFileData->ftLastWriteTime = lpFindFileData->ftLastAccessTime; lpFindFileData->ftCreationTime = lpFindFileData->ftLastAccessTime; @@ -3456,12 +3454,12 @@ static BOOL FTP_ParseNextFile(INT nSocket, LPCWSTR lpszSearchFile, LPFILEPROPERT lpfp->nSize = atol(pszToken); } - lpfp->tmLastModified.tm_sec = 0; - lpfp->tmLastModified.tm_min = 0; - lpfp->tmLastModified.tm_hour = 0; - lpfp->tmLastModified.tm_mday = 0; - lpfp->tmLastModified.tm_mon = 0; - lpfp->tmLastModified.tm_year = 0; + lpfp->tmLastModified.wSecond = 0; + lpfp->tmLastModified.wMinute = 0; + lpfp->tmLastModified.wHour = 0; + lpfp->tmLastModified.wDay = 0; + lpfp->tmLastModified.wMonth = 0; + lpfp->tmLastModified.wYear = 0; /* Determine month */ pszToken = strtok(NULL, szSpace); @@ -3469,34 +3467,31 @@ static BOOL FTP_ParseNextFile(INT nSocket, LPCWSTR lpszSearchFile, LPFILEPROPERT if(strlen(pszToken) >= 3) { pszToken[3] = 0; if((pszTmp = StrStrIA(szMonths, pszToken))) - lpfp->tmLastModified.tm_mon = ((pszTmp - szMonths) / 3)+1; + lpfp->tmLastModified.wMonth = ((pszTmp - szMonths) / 3)+1; } /* Determine day */ pszToken = strtok(NULL, szSpace); if(!pszToken) continue; - lpfp->tmLastModified.tm_mday = atoi(pszToken); + lpfp->tmLastModified.wDay = atoi(pszToken); /* Determine time or year */ pszToken = strtok(NULL, szSpace); if(!pszToken) continue; if((pszTmp = strchr(pszToken, ':'))) { - struct tm* apTM; - time_t aTime; + SYSTEMTIME curr_time; *pszTmp = 0; pszTmp++; - lpfp->tmLastModified.tm_min = atoi(pszTmp); - lpfp->tmLastModified.tm_hour = atoi(pszToken); - time(&aTime); - apTM = localtime(&aTime); - lpfp->tmLastModified.tm_year = apTM->tm_year; + lpfp->tmLastModified.wMinute = atoi(pszTmp); + lpfp->tmLastModified.wHour = atoi(pszToken); + GetLocalTime( &curr_time ); + lpfp->tmLastModified.wYear = curr_time.wYear; } else { - lpfp->tmLastModified.tm_year = atoi(pszToken) - 1900; - lpfp->tmLastModified.tm_hour = 12; + lpfp->tmLastModified.wYear = atoi(pszToken); + lpfp->tmLastModified.wHour = 12; } - TRACE("Mod time: %02d:%02d:%02d %02d/%02d/%02d\n", - lpfp->tmLastModified.tm_hour, lpfp->tmLastModified.tm_min, lpfp->tmLastModified.tm_sec, - (lpfp->tmLastModified.tm_year >= 100) ? lpfp->tmLastModified.tm_year - 100 : lpfp->tmLastModified.tm_year, - lpfp->tmLastModified.tm_mon, lpfp->tmLastModified.tm_mday); + TRACE("Mod time: %02d:%02d:%02d %04d/%02d/%02d\n", + lpfp->tmLastModified.wHour, lpfp->tmLastModified.wMinute, lpfp->tmLastModified.wSecond, + lpfp->tmLastModified.wYear, lpfp->tmLastModified.wMonth, lpfp->tmLastModified.wDay); pszToken = strtok(NULL, szSpace); if(!pszToken) continue; @@ -3509,32 +3504,31 @@ static BOOL FTP_ParseNextFile(INT nSocket, LPCWSTR lpszSearchFile, LPFILEPROPERT 05-09-03 06:02PM 12656686 2003-04-21bgm_cmd_e.rgz */ else if(isdigit(pszToken[0]) && 8 == strlen(pszToken)) { + int mon, mday, year, hour, min; lpfp->permissions = 0xFFFF; /* No idea, put full permission :-) */ - sscanf(pszToken, "%d-%d-%d", - &lpfp->tmLastModified.tm_mon, - &lpfp->tmLastModified.tm_mday, - &lpfp->tmLastModified.tm_year); + sscanf(pszToken, "%d-%d-%d", &mon, &mday, &year); + lpfp->tmLastModified.wDay = mday; + lpfp->tmLastModified.wMonth = mon; + lpfp->tmLastModified.wYear = year; /* Hacky and bad Y2K protection :-) */ - if (lpfp->tmLastModified.tm_year < 70) - lpfp->tmLastModified.tm_year += 100; - + if (lpfp->tmLastModified.wYear < 70) lpfp->tmLastModified.wYear += 2000; + pszToken = strtok(NULL, szSpace); if(!pszToken) continue; - sscanf(pszToken, "%d:%d", - &lpfp->tmLastModified.tm_hour, - &lpfp->tmLastModified.tm_min); + sscanf(pszToken, "%d:%d", &hour, &min); + lpfp->tmLastModified.wHour = hour; + lpfp->tmLastModified.wMinute = min; if((pszToken[5] == 'P') && (pszToken[6] == 'M')) { - lpfp->tmLastModified.tm_hour += 12; + lpfp->tmLastModified.wHour += 12; } - lpfp->tmLastModified.tm_sec = 0; + lpfp->tmLastModified.wSecond = 0; + + TRACE("Mod time: %02d:%02d:%02d %04d/%02d/%02d\n", + lpfp->tmLastModified.wHour, lpfp->tmLastModified.wMinute, lpfp->tmLastModified.wSecond, + lpfp->tmLastModified.wYear, lpfp->tmLastModified.wMonth, lpfp->tmLastModified.wDay); - TRACE("Mod time: %02d:%02d:%02d %02d/%02d/%02d\n", - lpfp->tmLastModified.tm_hour, lpfp->tmLastModified.tm_min, lpfp->tmLastModified.tm_sec, - (lpfp->tmLastModified.tm_year >= 100) ? lpfp->tmLastModified.tm_year - 100 : lpfp->tmLastModified.tm_year, - lpfp->tmLastModified.tm_mon, lpfp->tmLastModified.tm_mday); - pszToken = strtok(NULL, szSpace); if(!pszToken) continue; if(!strcasecmp(pszToken, "")) { diff --git a/dlls/wininet/tests/ftp.c b/dlls/wininet/tests/ftp.c index f7dc9c9f86f..a785fa983f4 100644 --- a/dlls/wininet/tests/ftp.c +++ b/dlls/wininet/tests/ftp.c @@ -25,7 +25,6 @@ * TODO: * Add W-function tests. * Add missing function tests: - * FtpFindFirstFile * FtpGetFileSize * FtpSetCurrentDirectory */ @@ -723,6 +722,89 @@ static void test_command(HINTERNET hFtp, HINTERNET hConnect) } } +static void test_find_first_file(HINTERNET hFtp, HINTERNET hConnect) +{ + WIN32_FIND_DATA findData; + HINTERNET hSearch; + HINTERNET hSearch2; + HINTERNET hOpenFile; + + /* NULL as the search file ought to return the first file in the directory */ + SetLastError(0xdeadbeef); + hSearch = FtpFindFirstFileA(hFtp, NULL, &findData, 0, 0); + ok ( hSearch != NULL, "Expected FtpFindFirstFileA to pass\n" ); + + /* This should fail as the previous handle wasn't closed */ + SetLastError(0xdeadbeef); + hSearch2 = FtpFindFirstFileA(hFtp, "welcome.msg", &findData, 0, 0); + todo_wine ok ( hSearch2 == NULL, "Expected FtpFindFirstFileA to fail\n" ); + todo_wine ok ( GetLastError() == ERROR_FTP_TRANSFER_IN_PROGRESS, + "Expected ERROR_FTP_TRANSFER_IN_PROGRESS, got %d\n", GetLastError() ); + InternetCloseHandle(hSearch2); /* Just in case */ + + InternetCloseHandle(hSearch); + + /* Try a valid filename in a subdirectory search */ + SetLastError(0xdeadbeef); + hSearch = FtpFindFirstFileA(hFtp, "pub/wine", &findData, 0, 0); + todo_wine ok ( hSearch != NULL, "Expected FtpFindFirstFileA to pass\n" ); + InternetCloseHandle(hSearch); + + /* Try a valid filename in a subdirectory wildcard search */ + SetLastError(0xdeadbeef); + hSearch = FtpFindFirstFileA(hFtp, "pub/w*", &findData, 0, 0); + todo_wine ok ( hSearch != NULL, "Expected FtpFindFirstFileA to pass\n" ); + InternetCloseHandle(hSearch); + + /* Try an invalid wildcard search */ + SetLastError(0xdeadbeef); + hSearch = FtpFindFirstFileA(hFtp, "*/w*", &findData, 0, 0); + ok ( hSearch == NULL, "Expected FtpFindFirstFileA to fail\n" ); + InternetCloseHandle(hSearch); /* Just in case */ + + /* Try FindFirstFile between FtpOpenFile and InternetCloseHandle */ + SetLastError(0xdeadbeef); + hOpenFile = FtpOpenFileA(hFtp, "welcome.msg", GENERIC_READ, FTP_TRANSFER_TYPE_ASCII, 0); + ok ( hOpenFile != NULL, "Expected FtpOpenFileA to succeed\n" ); + ok ( GetLastError() == ERROR_SUCCESS || + broken(GetLastError() == ERROR_FILE_NOT_FOUND), /* Win98 */ + "Expected ERROR_SUCCESS, got %u\n", GetLastError() ); + + /* This should fail as the OpenFile handle wasn't closed */ + SetLastError(0xdeadbeef); + hSearch = FtpFindFirstFileA(hFtp, "welcome.msg", &findData, 0, 0); + ok ( hSearch == NULL, "Expected FtpFindFirstFileA to fail\n" ); + ok ( GetLastError() == ERROR_FTP_TRANSFER_IN_PROGRESS, + "Expected ERROR_FTP_TRANSFER_IN_PROGRESS, got %d\n", GetLastError() ); + InternetCloseHandle(hSearch); /* Just in case */ + + InternetCloseHandle(hOpenFile); + + /* Test using a nonexistent filename */ + SetLastError(0xdeadbeef); + hSearch = FtpFindFirstFileA(hFtp, "this_file_should_not_exist", &findData, 0, 0); + ok ( hSearch == NULL, "Expected FtpFindFirstFileA to fail\n" ); + todo_wine ok ( GetLastError() == ERROR_INTERNET_EXTENDED_ERROR, + "Expected ERROR_INTERNET_EXTENDED_ERROR, got %d\n", GetLastError() ); + InternetCloseHandle(hSearch); /* Just in case */ + + /* Test using a nonexistent filename and a wildcard */ + SetLastError(0xdeadbeef); + hSearch = FtpFindFirstFileA(hFtp, "this_file_should_not_exist*", &findData, 0, 0); + ok ( hSearch == NULL, "Expected FtpFindFirstFileA to fail\n" ); + todo_wine ok ( GetLastError() == ERROR_NO_MORE_FILES, + "Expected ERROR_NO_MORE_FILES, got %d\n", GetLastError() ); + InternetCloseHandle(hSearch); /* Just in case */ + + /* Test using an invalid handle type */ + SetLastError(0xdeadbeef); + hSearch = FtpFindFirstFileA(hConnect, "welcome.msg", &findData, 0, 0); + ok ( hSearch == NULL, "Expected FtpFindFirstFileA to fail\n" ); + ok ( GetLastError() == ERROR_INTERNET_INCORRECT_HANDLE_TYPE, + "Expected ERROR_INTERNET_INCORRECT_HANDLE_TYPE, got %d\n", GetLastError() ); + InternetCloseHandle(hSearch); /* Just in case */ +} + static void test_get_current_dir(HINTERNET hFtp, HINTERNET hConnect) { BOOL bRet; @@ -853,6 +935,7 @@ START_TEST(ftp) test_removedir(hFtp, hHttp); test_renamefile(hFtp, hHttp); test_command(hFtp, hHttp); + test_find_first_file(hFtp, hHttp); test_get_current_dir(hFtp, hHttp); InternetCloseHandle(hHttp); diff --git a/dlls/winmm/joystick.c b/dlls/winmm/joystick.c index f3cffdf245d..d5d620b5892 100644 --- a/dlls/winmm/joystick.c +++ b/dlls/winmm/joystick.c @@ -121,6 +121,15 @@ static void CALLBACK JOY_Timer(HWND hWnd, UINT wMsg, UINT_PTR wTimer, DWORD dwTi } /************************************************************************** + * joyConfigChanged [WINMM.@] + */ +MMRESULT WINAPI joyConfigChanged(DWORD flags) +{ + FIXME("(%x) - stub\n", flags); + return JOYERR_NOERROR; +} + +/************************************************************************** * joyGetNumDevs [WINMM.@] */ UINT WINAPI joyGetNumDevs(void) diff --git a/dlls/winmm/tests/mixer.c b/dlls/winmm/tests/mixer.c index a31761a5667..472baa6abdb 100644 --- a/dlls/winmm/tests/mixer.c +++ b/dlls/winmm/tests/mixer.c @@ -174,6 +174,16 @@ static const char * control_flags(DWORD fdwControl) return flags; } +static void test_mixerClose(HMIXER mix) +{ + MMRESULT rc; + + rc = mixerClose(mix); + ok(rc == MMSYSERR_NOERROR || rc == MMSYSERR_INVALHANDLE, + "mixerClose: MMSYSERR_NOERROR or MMSYSERR_INVALHANDLE expected, got %s\n", + mmsys_error(rc)); +} + static void mixer_test_controlA(HMIXER mix, LPMIXERCONTROLA control) { MMRESULT rc; @@ -378,11 +388,6 @@ static void mixer_test_deviceA(int device) ok(rc==MMSYSERR_NOERROR, "mixerOpen: MMSYSERR_NOERROR expected, got %s\n",mmsys_error(rc)); if (rc==MMSYSERR_NOERROR) { - rc=mixerOpen(&mix, device, 0, 0, CALLBACK_FUNCTION); - ok(rc==MMSYSERR_INVALFLAG - || rc==MMSYSERR_NOTSUPPORTED, /* 98/ME */ - "mixerOpen: MMSYSERR_INVALFLAG or MMSYSERR_NOTSUPPORTED expected, got %s\n", mmsys_error(rc)); - for (d=0;dfile, filename); + ci->magic = CATINFO_MAGIC; + return ci; +} + /*********************************************************************** * CryptCATAdminAcquireContext (WINTRUST.@) * @@ -111,6 +140,8 @@ BOOL WINAPI CryptCATAdminAcquireContext(HCATADMIN *catAdmin, CreateDirectoryW(ca->path, NULL); ca->magic = CATADMIN_MAGIC; + ca->find = INVALID_HANDLE_VALUE; + *catAdmin = ca; return TRUE; } @@ -134,19 +165,19 @@ HCATINFO WINAPI CryptCATAdminAddCatalog(HCATADMIN catAdmin, PWSTR catalogFile, { FIXME("NULL basename not handled\n"); SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; + return NULL; } if (!ca || ca->magic != CATADMIN_MAGIC || !catalogFile || flags) { SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; + return NULL; } len = strlenW(ca->path) + strlenW(selectBaseName) + 2; if (!(target = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)))) { SetLastError(ERROR_OUTOFMEMORY); - return FALSE; + return NULL; } strcpyW(target, ca->path); strcatW(target, slashW); @@ -161,10 +192,10 @@ HCATINFO WINAPI CryptCATAdminAddCatalog(HCATADMIN catAdmin, PWSTR catalogFile, { HeapFree(GetProcessHeap(), 0, target); SetLastError(ERROR_OUTOFMEMORY); - return FALSE; + return NULL; } ci->magic = CATINFO_MAGIC; - strcpyW(ci->file, selectBaseName); + strcpyW(ci->file, target); HeapFree(GetProcessHeap(), 0, target); return ci; @@ -234,13 +265,120 @@ BOOL WINAPI CryptCATAdminCalcHashFromFileHandle(HANDLE hFile, DWORD* pcbHash, /*********************************************************************** * CryptCATAdminEnumCatalogFromHash (WINTRUST.@) */ -HCATINFO WINAPI CryptCATAdminEnumCatalogFromHash(HCATADMIN hCatAdmin, - BYTE* pbHash, - DWORD cbHash, - DWORD dwFlags, +HCATINFO WINAPI CryptCATAdminEnumCatalogFromHash(HCATADMIN hCatAdmin, BYTE* pbHash, + DWORD cbHash, DWORD dwFlags, HCATINFO* phPrevCatInfo ) { - FIXME("%p %p %d %d %p\n", hCatAdmin, pbHash, cbHash, dwFlags, phPrevCatInfo); + static const WCHAR slashW[] = {'\\',0}; + static const WCHAR globW[] = {'\\','*','.','c','a','t',0}; + + struct catadmin *ca = hCatAdmin; + WIN32_FIND_DATAW data; + HCATINFO prev = NULL; + HCRYPTPROV prov; + DWORD size; + BOOL ret; + + TRACE("%p %p %d %x %p\n", hCatAdmin, pbHash, cbHash, dwFlags, phPrevCatInfo); + + if (!ca || ca->magic != CATADMIN_MAGIC || !pbHash || cbHash != 20 || dwFlags) + { + SetLastError(ERROR_INVALID_PARAMETER); + return NULL; + } + if (phPrevCatInfo) prev = *phPrevCatInfo; + + ret = CryptAcquireContextW(&prov, NULL, MS_DEF_PROV_W, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT); + if (!ret) return NULL; + + if (!prev) + { + WCHAR *path; + + size = strlenW(ca->path) * sizeof(WCHAR) + sizeof(globW); + if (!(path = HeapAlloc(GetProcessHeap(), 0, size))) + { + CryptReleaseContext(prov, 0); + SetLastError(ERROR_OUTOFMEMORY); + return NULL; + } + strcpyW(path, ca->path); + strcatW(path, globW); + + FindClose(ca->find); + ca->find = FindFirstFileW(path, &data); + + HeapFree(GetProcessHeap(), 0, path); + if (ca->find == INVALID_HANDLE_VALUE) + { + CryptReleaseContext(prov, 0); + return NULL; + } + } + else if (!FindNextFileW(ca->find, &data)) + { + CryptCATAdminReleaseCatalogContext(hCatAdmin, prev, 0); + CryptReleaseContext(prov, 0); + return NULL; + } + + while (1) + { + WCHAR *filename; + CRYPTCATMEMBER *member = NULL; + struct catinfo *ci; + HANDLE hcat; + + size = (strlenW(ca->path) + strlenW(data.cFileName) + 2) * sizeof(WCHAR); + if (!(filename = HeapAlloc(GetProcessHeap(), 0, size))) + { + SetLastError(ERROR_OUTOFMEMORY); + return NULL; + } + strcpyW(filename, ca->path); + strcatW(filename, slashW); + strcatW(filename, data.cFileName); + + hcat = CryptCATOpen(filename, CRYPTCAT_OPEN_EXISTING, prov, 0, 0); + if (hcat == INVALID_HANDLE_VALUE) + { + WARN("couldn't open %s (%u)\n", debugstr_w(filename), GetLastError()); + continue; + } + while ((member = CryptCATEnumerateMember(hcat, member))) + { + if (member->pIndirectData->Digest.cbData != cbHash) + { + WARN("amount of hash bytes differs: %u/%u\n", member->pIndirectData->Digest.cbData, cbHash); + continue; + } + if (!memcmp(member->pIndirectData->Digest.pbData, pbHash, cbHash)) + { + TRACE("file %s matches\n", debugstr_w(data.cFileName)); + + CryptCATClose(hcat); + CryptReleaseContext(prov, 0); + if (!phPrevCatInfo) + { + FindClose(ca->find); + ca->find = INVALID_HANDLE_VALUE; + } + ci = create_catinfo(filename); + HeapFree(GetProcessHeap(), 0, filename); + return ci; + } + } + CryptCATClose(hcat); + HeapFree(GetProcessHeap(), 0, filename); + + if (!FindNextFileW(ca->find, &data)) + { + FindClose(ca->find); + ca->find = INVALID_HANDLE_VALUE; + CryptReleaseContext(prov, 0); + return NULL; + } + } return NULL; } @@ -302,6 +440,7 @@ BOOL WINAPI CryptCATAdminReleaseContext(HCATADMIN hCatAdmin, DWORD dwFlags ) SetLastError(ERROR_INVALID_PARAMETER); return FALSE; } + if (ca->find != INVALID_HANDLE_VALUE) FindClose(ca->find); ca->magic = 0; return HeapFree(GetProcessHeap(), 0, ca); } @@ -336,32 +475,454 @@ BOOL WINAPI CryptCATAdminRemoveCatalog(HCATADMIN hCatAdmin, LPCWSTR pwszCatalogF } /*********************************************************************** + * CryptCATAdminResolveCatalogPath (WINTRUST.@) + */ +BOOL WINAPI CryptCATAdminResolveCatalogPath(HCATADMIN hcatadmin, WCHAR *catalog_file, + CATALOG_INFO *info, DWORD flags) +{ + static const WCHAR slashW[] = {'\\',0}; + struct catadmin *ca = hcatadmin; + + TRACE("%p %s %p %x\n", hcatadmin, debugstr_w(catalog_file), info, flags); + + if (!ca || ca->magic != CATADMIN_MAGIC || !info || info->cbStruct != sizeof(*info) || flags) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + strcpyW(info->wszCatalogFile, ca->path); + strcatW(info->wszCatalogFile, slashW); + strcatW(info->wszCatalogFile, catalog_file); + + return TRUE; +} + +/*********************************************************************** * CryptCATClose (WINTRUST.@) */ BOOL WINAPI CryptCATClose(HANDLE hCatalog) { - FIXME("(%p) stub\n", hCatalog); + struct cryptcat *cc = hCatalog; + + TRACE("(%p)\n", hCatalog); + + if (!hCatalog || hCatalog == INVALID_HANDLE_VALUE || cc->magic != CRYPTCAT_MAGIC) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + HeapFree(GetProcessHeap(), 0, cc->attr); + HeapFree(GetProcessHeap(), 0, cc->inner); + CryptMsgClose(cc->msg); + + cc->magic = 0; + HeapFree(GetProcessHeap(), 0, cc); return TRUE; } /*********************************************************************** + * CryptCATGetAttrInfo (WINTRUST.@) + */ +CRYPTCATATTRIBUTE * WINAPI CryptCATGetAttrInfo(HANDLE hCatalog, CRYPTCATMEMBER *member, LPWSTR tag) +{ + struct cryptcat *cc = hCatalog; + + FIXME("%p, %p, %s\n", hCatalog, member, debugstr_w(tag)); + + if (!hCatalog || hCatalog == INVALID_HANDLE_VALUE || cc->magic != CRYPTCAT_MAGIC) + { + SetLastError(ERROR_INVALID_PARAMETER); + return NULL; + } + SetLastError(CRYPT_E_NOT_FOUND); + return NULL; +} + +/*********************************************************************** + * CryptCATGetCatAttrInfo (WINTRUST.@) + */ +CRYPTCATATTRIBUTE * WINAPI CryptCATGetCatAttrInfo(HANDLE hCatalog, LPWSTR tag) +{ + struct cryptcat *cc = hCatalog; + + FIXME("%p, %s\n", hCatalog, debugstr_w(tag)); + + if (!hCatalog || hCatalog == INVALID_HANDLE_VALUE || cc->magic != CRYPTCAT_MAGIC) + { + SetLastError(ERROR_INVALID_PARAMETER); + return NULL; + } + SetLastError(CRYPT_E_NOT_FOUND); + return NULL; +} + +CRYPTCATMEMBER * WINAPI CryptCATGetMemberInfo(HANDLE hCatalog, LPWSTR tag) +{ + struct cryptcat *cc = hCatalog; + + FIXME("%p, %s\n", hCatalog, debugstr_w(tag)); + + if (!hCatalog || hCatalog == INVALID_HANDLE_VALUE || cc->magic != CRYPTCAT_MAGIC) + { + SetLastError(ERROR_INVALID_PARAMETER); + return NULL; + } + SetLastError(CRYPT_E_NOT_FOUND); + return NULL; +} + +/*********************************************************************** + * CryptCATEnumerateAttr (WINTRUST.@) + */ +CRYPTCATATTRIBUTE * WINAPI CryptCATEnumerateAttr(HANDLE hCatalog, CRYPTCATMEMBER *member, CRYPTCATATTRIBUTE *prev) +{ + struct cryptcat *cc = hCatalog; + + FIXME("%p, %p, %p\n", hCatalog, member, prev); + + if (!hCatalog || hCatalog == INVALID_HANDLE_VALUE || cc->magic != CRYPTCAT_MAGIC) + { + SetLastError(ERROR_INVALID_PARAMETER); + return NULL; + } + SetLastError(CRYPT_E_NOT_FOUND); + return NULL; +} + +/*********************************************************************** + * CryptCATEnumerateCatAttr (WINTRUST.@) + */ +CRYPTCATATTRIBUTE * WINAPI CryptCATEnumerateCatAttr(HANDLE hCatalog, CRYPTCATATTRIBUTE *prev) +{ + struct cryptcat *cc = hCatalog; + + FIXME("%p, %p\n", hCatalog, prev); + + if (!hCatalog || hCatalog == INVALID_HANDLE_VALUE || cc->magic != CRYPTCAT_MAGIC) + { + SetLastError(ERROR_INVALID_PARAMETER); + return NULL; + } + SetLastError(CRYPT_E_NOT_FOUND); + return NULL; +} + +/*********************************************************************** * CryptCATEnumerateMember (WINTRUST.@) */ -CRYPTCATMEMBER *WINAPI CryptCATEnumerateMember(HANDLE hCatalog, CRYPTCATMEMBER* pPrevMember) +CRYPTCATMEMBER * WINAPI CryptCATEnumerateMember(HANDLE hCatalog, CRYPTCATMEMBER *prev) { - FIXME("(%p, %p) stub\n", hCatalog, pPrevMember); + struct cryptcat *cc = hCatalog; + CRYPTCATMEMBER *member = prev; + CTL_ENTRY *entry; + DWORD size, i; + + TRACE("%p, %p\n", hCatalog, prev); + + if (!hCatalog || hCatalog == INVALID_HANDLE_VALUE || cc->magic != CRYPTCAT_MAGIC) + { + SetLastError(ERROR_INVALID_PARAMETER); + return NULL; + } + + /* dumping the contents makes me think that dwReserved is the iteration number */ + if (!member) + { + if (!(member = HeapAlloc(GetProcessHeap(), 0, sizeof(*member)))) + { + SetLastError(ERROR_OUTOFMEMORY); + return NULL; + } + member->cbStruct = sizeof(*member); + member->pwszFileName = member->pwszReferenceTag = NULL; + member->dwReserved = 0; + member->hReserved = NULL; + member->gSubjectType = cc->subject; + member->fdwMemberFlags = 0; + member->pIndirectData = NULL; + member->dwCertVersion = cc->inner->dwVersion; + } + else member->dwReserved++; + + if (member->dwReserved >= cc->inner->cCTLEntry) + { + SetLastError(ERROR_INVALID_PARAMETER); + goto error; + } + + /* list them backwards, like native */ + entry = &cc->inner->rgCTLEntry[cc->inner->cCTLEntry - member->dwReserved - 1]; + + member->sEncodedIndirectData.cbData = member->sEncodedMemberInfo.cbData = 0; + member->sEncodedIndirectData.pbData = member->sEncodedMemberInfo.pbData = NULL; + HeapFree(GetProcessHeap(), 0, member->pIndirectData); + member->pIndirectData = NULL; + + for (i = 0; i < entry->cAttribute; i++) + { + CRYPT_ATTRIBUTE *attr = entry->rgAttribute + i; + + if (attr->cValue != 1) + { + ERR("Can't handle attr->cValue of %u\n", attr->cValue); + continue; + } + if (!strcmp(attr->pszObjId, CAT_MEMBERINFO_OBJID)) + { + CAT_MEMBERINFO *mi; + BOOL ret; + + member->sEncodedMemberInfo.cbData = attr->rgValue->cbData; + member->sEncodedMemberInfo.pbData = attr->rgValue->pbData; + + CryptDecodeObject(cc->encoding, CAT_MEMBERINFO_OBJID, attr->rgValue->pbData, attr->rgValue->cbData, 0, NULL, &size); + + if (!(mi = HeapAlloc(GetProcessHeap(), 0, size))) + { + SetLastError(ERROR_OUTOFMEMORY); + goto error; + } + ret = CryptDecodeObject(cc->encoding, CAT_MEMBERINFO_OBJID, attr->rgValue->pbData, attr->rgValue->cbData, 0, mi, &size); + if (ret) + { + UNICODE_STRING guid; + + member->dwCertVersion = mi->dwCertVersion; + RtlInitUnicodeString(&guid, mi->pwszSubjGuid); + if (RtlGUIDFromString(&guid, &member->gSubjectType)) + { + HeapFree(GetProcessHeap(), 0, mi); + goto error; + } + } + HeapFree(GetProcessHeap(), 0, mi); + if (!ret) goto error; + } + else if (!strcmp(attr->pszObjId, SPC_INDIRECT_DATA_OBJID)) + { + /* SPC_INDIRECT_DATA_CONTENT is equal to SIP_INDIRECT_DATA */ + + member->sEncodedIndirectData.cbData = attr->rgValue->cbData; + member->sEncodedIndirectData.pbData = attr->rgValue->pbData; + + CryptDecodeObject(cc->encoding, SPC_INDIRECT_DATA_OBJID, attr->rgValue->pbData, attr->rgValue->cbData, 0, NULL, &size); + + if (!(member->pIndirectData = HeapAlloc(GetProcessHeap(), 0, size))) + { + SetLastError(ERROR_OUTOFMEMORY); + goto error; + } + CryptDecodeObject(cc->encoding, SPC_INDIRECT_DATA_OBJID, attr->rgValue->pbData, attr->rgValue->cbData, 0, member->pIndirectData, &size); + } + else + /* this object id should probably be handled in CryptCATEnumerateAttr */ + FIXME("unhandled object id \"%s\"\n", attr->pszObjId); + } + + if (!member->sEncodedMemberInfo.cbData || !member->sEncodedIndirectData.cbData) + { + ERR("Corrupted catalog entry?\n"); + SetLastError(CRYPT_E_ATTRIBUTES_MISSING); + goto error; + } + size = (2 * member->pIndirectData->Digest.cbData + 1) * sizeof(WCHAR); + if (member->pwszReferenceTag) + member->pwszReferenceTag = HeapReAlloc(GetProcessHeap(), 0, member->pwszReferenceTag, size); + else + member->pwszReferenceTag = HeapAlloc(GetProcessHeap(), 0, size); + + if (!member->pwszReferenceTag) + { + SetLastError(ERROR_OUTOFMEMORY); + goto error; + } + /* FIXME: reference tag is usually the file hash but doesn't have to be */ + for (i = 0; i < member->pIndirectData->Digest.cbData; i++) + { + DWORD sub; + + sub = member->pIndirectData->Digest.pbData[i] >> 4; + member->pwszReferenceTag[i * 2] = (sub < 10 ? '0' + sub : 'A' + sub - 10); + sub = member->pIndirectData->Digest.pbData[i] & 0xf; + member->pwszReferenceTag[i * 2 + 1] = (sub < 10 ? '0' + sub : 'A' + sub - 10); + } + member->pwszReferenceTag[i * 2] = 0; + return member; + +error: + HeapFree(GetProcessHeap(), 0, member->pIndirectData); + HeapFree(GetProcessHeap(), 0, member->pwszReferenceTag); + HeapFree(GetProcessHeap(), 0, member); return NULL; } +static CTL_INFO *decode_inner_content(HANDLE hmsg, DWORD encoding, DWORD *len) +{ + DWORD size; + LPSTR oid = NULL; + BYTE *buffer = NULL; + CTL_INFO *inner = NULL; + + if (!CryptMsgGetParam(hmsg, CMSG_INNER_CONTENT_TYPE_PARAM, 0, NULL, &size)) return NULL; + if (!(oid = HeapAlloc(GetProcessHeap(), 0, size))) + { + SetLastError(ERROR_OUTOFMEMORY); + return NULL; + } + if (!CryptMsgGetParam(hmsg, CMSG_INNER_CONTENT_TYPE_PARAM, 0, oid, &size)) goto out; + if (!CryptMsgGetParam(hmsg, CMSG_CONTENT_PARAM, 0, NULL, &size)) goto out; + if (!(buffer = HeapAlloc(GetProcessHeap(), 0, size))) + { + SetLastError(ERROR_OUTOFMEMORY); + goto out; + } + if (!CryptMsgGetParam(hmsg, CMSG_CONTENT_PARAM, 0, buffer, &size)) goto out; + if (!CryptDecodeObject(encoding, oid, buffer, size, 0, NULL, &size)) goto out; + if (!(inner = HeapAlloc(GetProcessHeap(), 0, size))) + { + SetLastError(ERROR_OUTOFMEMORY); + goto out; + } + if (!CryptDecodeObject(encoding, oid, buffer, size, 0, inner, &size)) goto out; + *len = size; + +out: + HeapFree(GetProcessHeap(), 0, oid); + HeapFree(GetProcessHeap(), 0, buffer); + return inner; +} + +/*********************************************************************** + * CryptCATCatalogInfoFromContext (WINTRUST.@) + */ +BOOL WINAPI CryptCATCatalogInfoFromContext(HCATINFO hcatinfo, CATALOG_INFO *info, DWORD flags) +{ + struct catinfo *ci = hcatinfo; + + TRACE("%p, %p, %x\n", hcatinfo, info, flags); + + if (!hcatinfo || hcatinfo == INVALID_HANDLE_VALUE || ci->magic != CATINFO_MAGIC || + flags || !info || info->cbStruct != sizeof(*info)) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + strcpyW(info->wszCatalogFile, ci->file); + return TRUE; +} + /*********************************************************************** * CryptCATOpen (WINTRUST.@) */ HANDLE WINAPI CryptCATOpen(LPWSTR pwszFileName, DWORD fdwOpenFlags, HCRYPTPROV hProv, DWORD dwPublicVersion, DWORD dwEncodingType) { - FIXME("(%s, %d, %ld, %d, %d) stub\n", debugstr_w(pwszFileName), fdwOpenFlags, + HANDLE file, hmsg; + BYTE *buffer = NULL; + DWORD size, flags = OPEN_EXISTING; + struct cryptcat *cc; + + TRACE("%s, %x, %lx, %x, %x\n", debugstr_w(pwszFileName), fdwOpenFlags, hProv, dwPublicVersion, dwEncodingType); - return 0; + + if (!pwszFileName) + { + SetLastError(ERROR_INVALID_PARAMETER); + return INVALID_HANDLE_VALUE; + } + + if (!dwPublicVersion) dwPublicVersion = 0x00000100; + if (!dwEncodingType) dwEncodingType = X509_ASN_ENCODING | PKCS_7_ASN_ENCODING; + + if (fdwOpenFlags & CRYPTCAT_OPEN_ALWAYS) flags |= OPEN_ALWAYS; + if (fdwOpenFlags & CRYPTCAT_OPEN_CREATENEW) flags |= CREATE_NEW; + + file = CreateFileW(pwszFileName, GENERIC_READ, FILE_SHARE_READ, NULL, flags, 0, NULL); + if (file == INVALID_HANDLE_VALUE) return INVALID_HANDLE_VALUE; + + size = GetFileSize(file, NULL); + if (!(buffer = HeapAlloc(GetProcessHeap(), 0, size))) + { + CloseHandle(file); + SetLastError(ERROR_OUTOFMEMORY); + return INVALID_HANDLE_VALUE; + } + if (!(hmsg = CryptMsgOpenToDecode(dwEncodingType, 0, 0, hProv, NULL, NULL))) + { + CloseHandle(file); + HeapFree(GetProcessHeap(), 0, buffer); + return INVALID_HANDLE_VALUE; + } + if (!ReadFile(file, buffer, size, &size, NULL) || !CryptMsgUpdate(hmsg, buffer, size, TRUE)) + { + CloseHandle(file); + HeapFree(GetProcessHeap(), 0, buffer); + CryptMsgClose(hmsg); + return INVALID_HANDLE_VALUE; + } + HeapFree(GetProcessHeap(), 0, buffer); + CloseHandle(file); + + size = sizeof(DWORD); + if (!(cc = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*cc)))) + { + CryptMsgClose(hmsg); + SetLastError(ERROR_OUTOFMEMORY); + return INVALID_HANDLE_VALUE; + } + + cc->msg = hmsg; + cc->encoding = dwEncodingType; + if (CryptMsgGetParam(hmsg, CMSG_ATTR_CERT_COUNT_PARAM, 0, &cc->attr_count, &size)) + { + DWORD i, sum = 0; + BYTE *p; + + for (i = 0; i < cc->attr_count; i++) + { + if (!CryptMsgGetParam(hmsg, CMSG_ATTR_CERT_PARAM, i, NULL, &size)) + { + CryptMsgClose(hmsg); + return INVALID_HANDLE_VALUE; + } + sum += size; + } + if (!(cc->attr = HeapAlloc(GetProcessHeap(), 0, sizeof(*cc->attr) * cc->attr_count + sum))) + { + CryptMsgClose(hmsg); + SetLastError(ERROR_OUTOFMEMORY); + return INVALID_HANDLE_VALUE; + } + p = (BYTE *)(cc->attr + cc->attr_count); + for (i = 0; i < cc->attr_count; i++) + { + if (!CryptMsgGetParam(hmsg, CMSG_ATTR_CERT_PARAM, i, NULL, &size)) + { + CryptMsgClose(hmsg); + HeapFree(GetProcessHeap(), 0, cc->attr); + return INVALID_HANDLE_VALUE; + } + if (!CryptMsgGetParam(hmsg, CMSG_ATTR_CERT_PARAM, i, p, &size)) + { + CryptMsgClose(hmsg); + HeapFree(GetProcessHeap(), 0, cc->attr); + return INVALID_HANDLE_VALUE; + } + p += size; + } + cc->inner = decode_inner_content(hmsg, dwEncodingType, &cc->inner_len); + if (!cc->inner || !CryptSIPRetrieveSubjectGuid(pwszFileName, NULL, &cc->subject)) + { + CryptMsgClose(hmsg); + HeapFree(GetProcessHeap(), 0, cc->attr); + HeapFree(GetProcessHeap(), 0, cc->inner); + HeapFree(GetProcessHeap(), 0, cc); + return INVALID_HANDLE_VALUE; + } + cc->magic = CRYPTCAT_MAGIC; + return cc; + } + return INVALID_HANDLE_VALUE; } /*********************************************************************** diff --git a/dlls/wintrust/tests/crypt.c b/dlls/wintrust/tests/crypt.c index 6811fd473e6..f9a57af5d75 100644 --- a/dlls/wintrust/tests/crypt.c +++ b/dlls/wintrust/tests/crypt.c @@ -48,7 +48,7 @@ CATATTR2=0x10010001:attr2:value2 hashme=.\winetest.cdf */ -const BYTE test_catalog[] = { +static const BYTE test_catalog[] = { 0x30, 0x82, 0x01, 0xbc, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x02, 0xa0, 0x82, 0x01, 0xad, 0x30, 0x82, 0x01, 0xa9, 0x02, 0x01, 0x01, 0x31, 0x00, 0x30, 0x82, 0x01, 0x9e, 0x06, 0x09, 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x0a, 0x01, 0xa0, 0x82, 0x01, 0x8f, 0x30, @@ -85,6 +85,11 @@ static BOOL (WINAPI * pCryptCATAdminCalcHashFromFileHandle)(HANDLE hFile, DWORD* static HCATINFO (WINAPI * pCryptCATAdminAddCatalog)(HCATADMIN, PWSTR, PWSTR, DWORD); static BOOL (WINAPI * pCryptCATAdminRemoveCatalog)(HCATADMIN, LPCWSTR, DWORD); static BOOL (WINAPI * pCryptCATAdminReleaseCatalogContext)(HCATADMIN, HCATINFO, DWORD); +static HANDLE (WINAPI * pCryptCATOpen)(LPWSTR, DWORD, HCRYPTPROV, DWORD, DWORD); +static BOOL (WINAPI * pCryptCATCatalogInfoFromContext)(HCATINFO, CATALOG_INFO *, DWORD); +static CRYPTCATMEMBER * (WINAPI * pCryptCATEnumerateMember)(HANDLE, CRYPTCATMEMBER *); +static CRYPTCATATTRIBUTE * (WINAPI * pCryptCATEnumerateAttr)(HANDLE, CRYPTCATMEMBER *, CRYPTCATATTRIBUTE *); +static BOOL (WINAPI * pCryptCATClose)(HANDLE); static void InitFunctionPtrs(void) { @@ -102,6 +107,11 @@ static void InitFunctionPtrs(void) WINTRUST_GET_PROC(CryptCATAdminAddCatalog) WINTRUST_GET_PROC(CryptCATAdminRemoveCatalog) WINTRUST_GET_PROC(CryptCATAdminReleaseCatalogContext) + WINTRUST_GET_PROC(CryptCATOpen) + WINTRUST_GET_PROC(CryptCATCatalogInfoFromContext) + WINTRUST_GET_PROC(CryptCATEnumerateMember) + WINTRUST_GET_PROC(CryptCATEnumerateAttr) + WINTRUST_GET_PROC(CryptCATClose) #undef WINTRUST_GET_PROC } @@ -346,6 +356,7 @@ static void test_CryptCATAdminAddRemoveCatalog(void) static WCHAR basenameW[] = {'w','i','n','e','t','e','s','t','.','c','a','t',0}; HCATADMIN hcatadmin; HCATINFO hcatinfo; + CATALOG_INFO info; WCHAR tmpfileW[MAX_PATH]; char tmpfile[MAX_PATH]; HANDLE file; @@ -414,6 +425,11 @@ static void test_CryptCATAdminAddRemoveCatalog(void) hcatinfo = pCryptCATAdminAddCatalog(hcatadmin, tmpfileW, basenameW, 0); ok(hcatinfo != NULL, "CryptCATAdminAddCatalog failed %u\n", GetLastError()); + info.cbStruct = sizeof(info); + info.wszCatalogFile[0] = 0; + ret = pCryptCATCatalogInfoFromContext(hcatinfo, &info, 0); + ok(ret, "CryptCATCatalogInfoFromContext failed %u\n", GetLastError()); + ret = pCryptCATAdminReleaseCatalogContext(hcatadmin, hcatinfo, 0); ok(ret, "CryptCATAdminReleaseCatalogContext failed %u\n", GetLastError()); @@ -426,6 +442,66 @@ static void test_CryptCATAdminAddRemoveCatalog(void) DeleteFileA(tmpfile); } +static void test_catalog_properties(void) +{ + static const WCHAR hashmeW[] = {'h','a','s','h','m','e',0}; + static const GUID subject = {0xde351a42,0x8e59,0x11d0,{0x8c,0x47,0x00,0xc0,0x4f,0xc2,0x95,0xee}}; + + HANDLE hcat; + CRYPTCATMEMBER *m; + CRYPTCATATTRIBUTE *attr; + char catalog[MAX_PATH]; + WCHAR catalogW[MAX_PATH]; + DWORD written; + HANDLE file; + BOOL ret; + + if (!GetTempFileNameA(CURR_DIR, "cat", 0, catalog)) return; + file = CreateFileA(catalog, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); + ok(file != INVALID_HANDLE_VALUE, "CreateFileA failed %u\n", GetLastError()); + WriteFile(file, test_catalog, sizeof(test_catalog), &written, NULL); + CloseHandle(file); + + hcat = pCryptCATOpen(NULL, 0, 0, 0, 0); + ok(hcat == INVALID_HANDLE_VALUE, "CryptCATOpen succeeded\n"); + + MultiByteToWideChar(CP_ACP, 0, catalog, -1, catalogW, MAX_PATH); + + hcat = pCryptCATOpen(catalogW, 0, 0, 0, 0); + ok(hcat != INVALID_HANDLE_VALUE, "CryptCATOpen failed %u\n", GetLastError()); + + m = pCryptCATEnumerateMember(NULL, NULL); + ok(m == NULL, "CryptCATEnumerateMember succeeded\n"); + + m = pCryptCATEnumerateMember(hcat, NULL); + ok(m != NULL, "CryptCATEnumerateMember failed %u\n", GetLastError()); + + ok(m->cbStruct == sizeof(CRYPTCATMEMBER), "unexpected size %u\n", m->cbStruct); + todo_wine ok(!lstrcmpW(m->pwszReferenceTag, hashmeW), "unexpected tag\n"); + ok(!memcmp(&m->gSubjectType, &subject, sizeof(subject)), "guid differs\n"); + ok(!m->fdwMemberFlags, "got %x expected 0\n", m->fdwMemberFlags); + ok(m->dwCertVersion == 0x200, "got %x expected 0x200\n", m->dwCertVersion); + ok(!m->dwReserved, "got %x expected 0\n", m->dwReserved); + ok(m->hReserved == NULL, "got %p expected NULL\n", m->hReserved); + + attr = pCryptCATEnumerateAttr(NULL, NULL, NULL); + ok(attr == NULL, "CryptCATEnumerateAttr succeeded\n"); + + attr = pCryptCATEnumerateAttr(hcat, NULL, NULL); + ok(attr == NULL, "CryptCATEnumerateAttr succeeded\n"); + + attr = pCryptCATEnumerateAttr(hcat, m, NULL); + ok(attr == NULL, "CryptCATEnumerateAttr succeeded\n"); + + m = pCryptCATEnumerateMember(hcat, m); + ok(m == NULL, "CryptCATEnumerateMember succeeded\n"); + + ret = pCryptCATClose(hcat); + ok(ret, "CryptCATClose failed\n"); + + DeleteFileA(catalog); +} + START_TEST(crypt) { int myARGC; @@ -447,4 +523,5 @@ START_TEST(crypt) test_context(); test_calchash(); test_CryptCATAdminAddRemoveCatalog(); + test_catalog_properties(); } diff --git a/dlls/wintrust/wintrust.spec b/dlls/wintrust/wintrust.spec index 6f8328281d6..bf5ee1f096d 100644 --- a/dlls/wintrust/wintrust.spec +++ b/dlls/wintrust/wintrust.spec @@ -8,7 +8,7 @@ @ stdcall CryptCATAdminReleaseCatalogContext(long long long) @ stdcall CryptCATAdminReleaseContext(long long) @ stdcall CryptCATAdminRemoveCatalog(ptr wstr long) -@ stub CryptCATAdminResolveCatalogPath +@ stdcall CryptCATAdminResolveCatalogPath(ptr wstr ptr long) @ stub CryptCATCDFClose @ stub CryptCATCDFEnumAttributes @ stub CryptCATCDFEnumAttributesWithCDFTag @@ -17,14 +17,14 @@ @ stub CryptCATCDFEnumMembersByCDFTag @ stub CryptCATCDFEnumMembersByCDFTagEx @ stub CryptCATCDFOpen -@ stub CryptCATCatalogInfoFromContext +@ stdcall CryptCATCatalogInfoFromContext(ptr ptr long) @ stdcall CryptCATClose(long) -@ stub CryptCATEnumerateAttr -@ stub CryptCATEnumerateCatAttr +@ stdcall CryptCATEnumerateAttr(ptr ptr ptr) +@ stdcall CryptCATEnumerateCatAttr(ptr ptr) @ stdcall CryptCATEnumerateMember(long ptr) -@ stub CryptCATGetAttrInfo -@ stub CryptCATGetCatAttrInfo -@ stub CryptCATGetMemberInfo +@ stdcall CryptCATGetAttrInfo(ptr ptr wstr) +@ stdcall CryptCATGetCatAttrInfo(ptr wstr ) +@ stdcall CryptCATGetMemberInfo(ptr wstr) @ stub CryptCATHandleFromStore @ stdcall CryptCATOpen(wstr long long long long) @ stub CryptCATPersistStore diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c index 14f357fc1b5..5b748c84bbd 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -4555,6 +4555,30 @@ int WINAPI WSARemoveServiceClass(LPGUID info) } /*********************************************************************** + * inet_ntop (WS2_32.@) + */ +PCSTR WINAPI WS_inet_ntop( INT family, PVOID addr, PSTR buffer, size_t len ) +{ +#ifdef HAVE_INET_NTOP + union generic_unix_sockaddr unix_addr; + + switch (family) + { + case WS_AF_INET: + ws_sockaddr_ws2u( addr, sizeof(struct WS_sockaddr_in), &unix_addr ); + return inet_ntop( AF_INET, &unix_addr, buffer, len ); + case WS_AF_INET6: + ws_sockaddr_ws2u( addr, sizeof(struct WS_sockaddr_in6), &unix_addr ); + return inet_ntop( AF_INET6, &unix_addr, buffer, len ); + } +#else + FIXME( "not supported on this platform\n" ); +#endif + WSASetLastError( WSAEAFNOSUPPORT ); + return NULL; +} + +/*********************************************************************** * WSAStringToAddressA (WS2_32.80) */ INT WINAPI WSAStringToAddressA(LPSTR AddressString, diff --git a/dlls/ws2_32/ws2_32.spec b/dlls/ws2_32/ws2_32.spec index bbcafc0659b..74e71be6385 100644 --- a/dlls/ws2_32/ws2_32.spec +++ b/dlls/ws2_32/ws2_32.spec @@ -117,3 +117,4 @@ @ stdcall freeaddrinfo(ptr) WS_freeaddrinfo @ stdcall getaddrinfo(str str ptr ptr) WS_getaddrinfo @ stdcall getnameinfo(ptr long ptr long ptr long long) WS_getnameinfo +@ stdcall inet_ntop(long ptr ptr long) WS_inet_ntop diff --git a/include/config.h.in b/include/config.h.in index 330564ead7a..7f3b8883584 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -117,6 +117,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_FREETYPE_FTGLYPH_H +/* Define to 1 if you have the header file. */ +#undef HAVE_FREETYPE_FTLCDFIL_H + /* Define to 1 if you have the header file. */ #undef HAVE_FREETYPE_FTMODAPI_H @@ -246,6 +249,9 @@ /* Define to 1 if you have the `inet_network' function. */ #undef HAVE_INET_NETWORK +/* Define to 1 if you have the `inet_ntop' function. */ +#undef HAVE_INET_NTOP + /* Define to 1 if you have the `inet_pton' function. */ #undef HAVE_INET_PTON @@ -507,6 +513,9 @@ /* Define to 1 if the system has the type `off_t'. */ #undef HAVE_OFF_T +/* Define if mkdir takes only one argument */ +#undef HAVE_ONE_ARG_MKDIR + /* Define if OpenGL is present on the system */ #undef HAVE_OPENGL @@ -654,6 +663,9 @@ /* Define to 1 if you have the `snprintf' function. */ #undef HAVE_SNPRINTF +/* Define to 1 if you have the `socketpair' function. */ +#undef HAVE_SOCKETPAIR + /* Define to 1 if you have the header file. */ #undef HAVE_SOUNDCARD_H @@ -762,6 +774,9 @@ /* Define to 1 if `st_mtim' is member of `struct stat'. */ #undef HAVE_STRUCT_STAT_ST_MTIM +/* Define to 1 if you have the `symlink' function. */ +#undef HAVE_SYMLINK + /* Define to 1 if you have the header file. */ #undef HAVE_SYSCALL_H @@ -951,6 +966,9 @@ /* Define to 1 if you have the `waitpid' function. */ #undef HAVE_WAITPID +/* Define to 1 if you have the header file. */ +#undef HAVE_WINSOCK2_H + /* Define to 1 if you have the header file. */ #undef HAVE_X11_EXTENSIONS_SHAPE_H @@ -1002,9 +1020,6 @@ /* Define if Xrender has the XRenderSetPictureTransform function */ #undef HAVE_XRENDERSETPICTURETRANSFORM -/* Define to 1 if you have the `_mkdir' function. */ -#undef HAVE__MKDIR - /* Define to 1 if you have the `_pclose' function. */ #undef HAVE__PCLOSE diff --git a/include/mscat.h b/include/mscat.h index e48120765f8..d037adce858 100644 --- a/include/mscat.h +++ b/include/mscat.h @@ -28,10 +28,30 @@ typedef HANDLE HCATINFO; extern "C" { #endif +#define CRYPTCAT_OPEN_CREATENEW 0x00000001 +#define CRYPTCAT_OPEN_ALWAYS 0x00000002 +#define CRYPTCAT_OPEN_EXISTING 0x00000004 +#define CRYPTCAT_OPEN_EXCLUDE_PAGE_HASHES 0x00010000 +#define CRYPTCAT_OPEN_INCLUDE_PAGE_HASHES 0x00020000 +#define CRYPTCAT_OPEN_VERIFYSIGHASH 0x10000000 +#define CRYPTCAT_OPEN_NO_CONTENT_HCRYPTMSG 0x20000000 +#define CRYPTCAT_OPEN_SORTED 0x40000000 +#define CRYPTCAT_OPEN_FLAGS_MASK 0xffff0000 #include -typedef struct CRYPTCATMEMBER_ { +typedef struct CRYPTCATATTRIBUTE_ +{ + DWORD cbStruct; + LPWSTR pwszReferenceTag; + DWORD dwAttrTypeAndAction; + DWORD cbValue; + BYTE *pbValue; + DWORD dwReserved; +} CRYPTCATATTRIBUTE; + +typedef struct CRYPTCATMEMBER_ +{ DWORD cbStruct; LPWSTR pwszReferenceTag; LPWSTR pwszFileName; @@ -45,6 +65,12 @@ typedef struct CRYPTCATMEMBER_ { CRYPT_ATTR_BLOB sEncodedMemberInfo; } CRYPTCATMEMBER; +typedef struct CATALOG_INFO_ +{ + DWORD cbStruct; + WCHAR wszCatalogFile[MAX_PATH]; +} CATALOG_INFO; + #include @@ -55,8 +81,15 @@ HCATINFO WINAPI CryptCATAdminEnumCatalogFromHash(HCATADMIN,BYTE*,DWORD,DWORD,HC BOOL WINAPI CryptCATAdminReleaseCatalogContext(HCATADMIN,HCATINFO,DWORD); BOOL WINAPI CryptCATAdminReleaseContext(HCATADMIN,DWORD); BOOL WINAPI CryptCATAdminRemoveCatalog(HCATADMIN,LPCWSTR,DWORD); +BOOL WINAPI CryptCATAdminResolveCatalogPath(HCATADMIN, WCHAR *, CATALOG_INFO *, DWORD); +BOOL WINAPI CryptCATCatalogInfoFromContext(HCATINFO, CATALOG_INFO *, DWORD); BOOL WINAPI CryptCATClose(HANDLE); -CRYPTCATMEMBER* WINAPI CryptCATEnumerateMember(HANDLE,CRYPTCATMEMBER*); +CRYPTCATATTRIBUTE * WINAPI CryptCATEnumerateAttr(HANDLE, CRYPTCATMEMBER *, CRYPTCATATTRIBUTE *); +CRYPTCATATTRIBUTE * WINAPI CryptCATEnumerateCatAttr(HANDLE, CRYPTCATATTRIBUTE *); +CRYPTCATMEMBER * WINAPI CryptCATEnumerateMember(HANDLE,CRYPTCATMEMBER *); +CRYPTCATATTRIBUTE * WINAPI CryptCATGetAttrInfo(HANDLE, CRYPTCATMEMBER *, LPWSTR); +CRYPTCATATTRIBUTE * WINAPI CryptCATGetCatAttrInfo(HANDLE, LPWSTR); +CRYPTCATMEMBER * WINAPI CryptCATGetMemberInfo(HANDLE, LPWSTR); HANDLE WINAPI CryptCATOpen(LPWSTR,DWORD,HCRYPTPROV,DWORD,DWORD); #ifdef __cplusplus diff --git a/include/richedit.h b/include/richedit.h index f4f0ab5da00..02ebdc2f93a 100644 --- a/include/richedit.h +++ b/include/richedit.h @@ -516,7 +516,7 @@ DECL_WINELIB_TYPE_AW(TEXTRANGE) typedef struct _editstream { - DWORD dwCookie; + DWORD_PTR dwCookie; DWORD dwError; EDITSTREAMCALLBACK pfnCallback; } EDITSTREAM; diff --git a/include/winbase.h b/include/winbase.h index 909a3e25594..f7bb9bf27ff 100644 --- a/include/winbase.h +++ b/include/winbase.h @@ -2311,8 +2311,8 @@ WINBASEAPI VOID WINAPI _LeaveSysLevel(SYSLEVEL*); /* Wine internal functions */ -extern char *wine_get_unix_file_name( LPCWSTR dos ); -extern WCHAR *wine_get_dos_file_name( LPCSTR str ); +extern char CDECL *wine_get_unix_file_name( LPCWSTR dos ); +extern WCHAR CDECL *wine_get_dos_file_name( LPCSTR str ); /* Interlocked functions */ diff --git a/include/wincrypt.h b/include/wincrypt.h index 2a2a3b3cb80..f574997ba8f 100644 --- a/include/wincrypt.h +++ b/include/wincrypt.h @@ -3882,6 +3882,8 @@ PCCRYPT_OID_INFO WINAPI CryptFindOIDInfo(DWORD dwKeyType, void *pvKey, BOOL WINAPI CryptRegisterOIDInfo(PCCRYPT_OID_INFO pInfo, DWORD dwFlags); BOOL WINAPI CryptUnregisterOIDInfo(PCCRYPT_OID_INFO pInfo); +LPCWSTR WINAPI CryptFindLocalizedName(LPCWSTR pwszCryptName); + LPCSTR WINAPI CertAlgIdToOID(DWORD dwAlgId); DWORD WINAPI CertOIDToAlgId(LPCSTR pszObjId); diff --git a/include/wine/exception.h b/include/wine/exception.h index ccace07aed3..7e0d5bc9908 100644 --- a/include/wine/exception.h +++ b/include/wine/exception.h @@ -233,7 +233,7 @@ extern void __wine_enter_vm86( CONTEXT *context ); #ifndef USE_COMPILER_EXCEPTIONS -extern void WINAPI RtlUnwind(PVOID,PVOID,PEXCEPTION_RECORD,PVOID); +NTSYSAPI void WINAPI RtlUnwind(PVOID,PVOID,PEXCEPTION_RECORD,PVOID); /* wrapper for RtlUnwind since it clobbers registers on Windows */ static inline void __wine_rtl_unwind( EXCEPTION_REGISTRATION_RECORD* frame, EXCEPTION_RECORD *record ) diff --git a/include/wine/port.h b/include/wine/port.h index fd3769868ed..e445c08e3ee 100644 --- a/include/wine/port.h +++ b/include/wine/port.h @@ -114,8 +114,8 @@ struct statvfs #define RTLD_GLOBAL 0x100 #endif -#ifdef HAVE__MKDIR -#define mkdir(path,mode) _mkdir(path) +#ifdef HAVE_ONE_ARG_MKDIR +#define mkdir(path,mode) mkdir(path) #endif #if !defined(HAVE_FTRUNCATE) && defined(HAVE_CHSIZE) @@ -305,6 +305,22 @@ int lstat(const char *file_name, struct stat *buf); void *memmove(void *dest, const void *src, size_t len); #endif /* !defined(HAVE_MEMMOVE) */ +#ifndef HAVE_POLL +struct pollfd +{ + int fd; + short events; + short revents; +}; +#define POLLIN 0x01 +#define POLLPRI 0x02 +#define POLLOUT 0x04 +#define POLLERR 0x08 +#define POLLHUP 0x10 +#define POLLNVAL 0x20 +int poll( struct pollfd *fds, unsigned int count, int timeout ); +#endif /* HAVE_POLL */ + #ifndef HAVE_PREAD ssize_t pread( int fd, void *buf, size_t count, off_t offset ); #endif /* HAVE_PREAD */ @@ -341,6 +357,10 @@ int strcasecmp(const char *str1, const char *str2); # endif #endif /* !defined(HAVE_STRCASECMP) */ +#ifndef HAVE_SYMLINK +int symlink(const char *from, const char *to); +#endif + #ifndef HAVE_USLEEP int usleep (unsigned int useconds); #endif /* !defined(HAVE_USLEEP) */ diff --git a/include/wingdi.h b/include/wingdi.h index ac4ba2bff86..58411034dee 100644 --- a/include/wingdi.h +++ b/include/wingdi.h @@ -1297,7 +1297,11 @@ typedef struct #define GGO_UNHINTED 0x100 #ifdef __WINESRC__ -#define WINE_GGO_GRAY16_BITMAP 0x7f +#define WINE_GGO_GRAY16_BITMAP 0x10 +#define WINE_GGO_HRGB_BITMAP 0x11 +#define WINE_GGO_HBGR_BITMAP 0x12 +#define WINE_GGO_VRGB_BITMAP 0x13 +#define WINE_GGO_VBGR_BITMAP 0x14 #endif typedef struct @@ -1424,6 +1428,7 @@ typedef struct #define TT_ENABLED 0x0002 #ifdef __WINESRC__ +#define WINE_TT_SUBPIXEL_RENDERING_ENABLED 0x4000 #define WINE_TT_HINTER_ENABLED 0x8000 #endif diff --git a/libs/port/Makefile.in b/libs/port/Makefile.in index 68dc8f12702..c4c0127fe5f 100644 --- a/libs/port/Makefile.in +++ b/libs/port/Makefile.in @@ -21,6 +21,7 @@ C_SRCS = \ memcpy_unaligned.c \ memmove.c \ mkstemps.c \ + poll.c \ pread.c \ pwrite.c \ readlink.c \ @@ -29,6 +30,7 @@ C_SRCS = \ strcasecmp.c \ strerror.c \ strncasecmp.c \ + symlink.c \ usleep.c all: $(MODULE) diff --git a/libs/port/poll.c b/libs/port/poll.c new file mode 100644 index 00000000000..b633a0d90ef --- /dev/null +++ b/libs/port/poll.c @@ -0,0 +1,77 @@ +/* + * poll function + * + * Copyright 2008 Alexandre Julliard + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "config.h" +#include "wine/port.h" + +#ifndef HAVE_POLL + +#ifdef HAVE_WINSOCK2_H +#include +#endif +#ifdef HAVE_SYS_TIME_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif + +int poll( struct pollfd *fds, unsigned int count, int timeout ) +{ + fd_set read_set, write_set, except_set; + unsigned int i; + int maxfd = -1, ret; + + FD_ZERO( &read_set ); + FD_ZERO( &write_set ); + FD_ZERO( &except_set ); + + for (i = 0; i < count; i++) + { + if (fds[i].fd == -1) continue; + if (fds[i].events & (POLLIN|POLLPRI)) FD_SET( fds[i].fd, &read_set ); + if (fds[i].events & POLLOUT) FD_SET( fds[i].fd, &write_set ); + FD_SET( fds[i].fd, &except_set ); /* POLLERR etc. are always selected */ + if (fds[i].fd > maxfd) maxfd = fds[i].fd; + } + if (timeout != -1) + { + struct timeval tv; + tv.tv_sec = timeout / 1000; + tv.tv_usec = timeout % 1000; + ret = select( maxfd + 1, &read_set, &write_set, &except_set, &tv ); + } + else ret = select( maxfd + 1, &read_set, &write_set, &except_set, NULL ); + + if (ret >= 0) + { + for (i = 0; i < count; i++) + { + fds[i].revents = 0; + if (fds[i].fd == -1) continue; + if (FD_ISSET( fds[i].fd, &read_set )) fds[i].revents |= POLLIN; + if (FD_ISSET( fds[i].fd, &write_set )) fds[i].revents |= POLLOUT; + if (FD_ISSET( fds[i].fd, &except_set )) fds[i].revents |= POLLERR; + } + } + return ret; +} + +#endif /* HAVE_POLL */ diff --git a/dlls/sxs/sxs.c b/libs/port/symlink.c similarity index 57% copy from dlls/sxs/sxs.c copy to libs/port/symlink.c index cd64de562f6..efb44eca1d9 100644 --- a/dlls/sxs/sxs.c +++ b/libs/port/symlink.c @@ -1,7 +1,7 @@ /* - * sxs main + * symlink function * - * Copyright 2007 EA Durbin + * Copyright 2008 Alexandre Julliard * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -18,28 +18,21 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include +#include "config.h" +#include "wine/port.h" -#include "windef.h" -#include "winbase.h" -#include "wine/debug.h" +#include +#include +#ifdef HAVE_UNISTD_H +# include +#endif -WINE_DEFAULT_DEBUG_CHANNEL(sxs); +#ifndef HAVE_SYMLINK - -/*********************************************************************** - * DllMain (SXS.@) - * - */ -BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) +int symlink( const char *from, const char *to ) { - switch(fdwReason) - { - case DLL_WINE_PREATTACH: - return FALSE; /* prefer native version */ - case DLL_PROCESS_ATTACH: - DisableThreadLibraryCalls( hinstDLL ); - break; - } - return TRUE; + errno = ENOSYS; + return -1; } + +#endif /* HAVE_SYMLINK */ diff --git a/programs/start/start.c b/programs/start/start.c index 2009e78db7d..d98f215da6e 100644 --- a/programs/start/start.c +++ b/programs/start/start.c @@ -258,7 +258,7 @@ int wmain (int argc, WCHAR *argv[]) sei.lpParameters = args; if (unix_mode) { - LPWSTR (*wine_get_dos_file_name_ptr)(LPCSTR); + LPWSTR (*CDECL wine_get_dos_file_name_ptr)(LPCSTR); char* multibyte_unixpath; int multibyte_unixpath_len; diff --git a/programs/winecfg/En.rc b/programs/winecfg/En.rc index 673e6c7aff2..a4c1a7f84cd 100644 --- a/programs/winecfg/En.rc +++ b/programs/winecfg/En.rc @@ -71,7 +71,7 @@ BEGIN CONTROL "Allow DirectX apps to stop the &mouse leaving their window",IDC_DX_MOUSE_GRAB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,20,230,8 CONTROL "Allow the window manager to &decorate the windows",IDC_ENABLE_DECORATED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,32,230,8 CONTROL "Allow the &window manager to control the windows",IDC_ENABLE_MANAGED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,44,230,8 - CONTROL "Emulate a virtual &desktop",IDC_ENABLE_DESKTOP,"Button", + CONTROL "&Emulate a virtual desktop",IDC_ENABLE_DESKTOP,"Button", BS_AUTOCHECKBOX | WS_TABSTOP,15,56,230,8 LTEXT "Desktop &size:",IDC_DESKTOP_SIZE,15,70,44,8,WS_DISABLED LTEXT "X",IDC_DESKTOP_BY,109,70,8,8,WS_DISABLED diff --git a/programs/winedevice/device.c b/programs/winedevice/device.c index 5677e197b89..bd6565465c2 100644 --- a/programs/winedevice/device.c +++ b/programs/winedevice/device.c @@ -64,9 +64,11 @@ static LDR_MODULE *find_ldr_module( HMODULE module ) /* load the driver module file */ static HMODULE load_driver_module( const WCHAR *name ) { - const IMAGE_NT_HEADERS *nt; + IMAGE_NT_HEADERS *nt; + const IMAGE_IMPORT_DESCRIPTOR *imports; size_t page_size = getpagesize(); - int delta; + int i, delta; + ULONG size; HMODULE module = LoadLibraryW( name ); if (!module) return NULL; @@ -80,7 +82,6 @@ static HMODULE load_driver_module( const WCHAR *name ) if (nt->OptionalHeader.SectionAlignment < page_size || !(nt->FileHeader.Characteristics & IMAGE_FILE_DLL)) { - ULONG size; DWORD old; IMAGE_BASE_RELOCATION *rel, *end; @@ -98,8 +99,25 @@ static HMODULE load_driver_module( const WCHAR *name ) if (old != PAGE_EXECUTE_READWRITE) VirtualProtect( page, page_size, old, NULL ); if (!rel) goto error; } + /* make sure we don't try again */ + nt->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_BASERELOC].VirtualAddress = 0; } } + + /* make sure imports are relocated too */ + + if ((imports = RtlImageDirectoryEntryToData( module, TRUE, IMAGE_DIRECTORY_ENTRY_IMPORT, &size ))) + { + for (i = 0; imports[i].Name && imports[i].FirstThunk; i++) + { + char *name = (char *)module + imports[i].Name; + WCHAR buffer[32], *p = buffer; + + while (p < buffer + 32) if (!(*p++ = *name++)) break; + if (p <= buffer + 32) FreeLibrary( load_driver_module( buffer ) ); + } + } + return module; error: diff --git a/programs/winepath/winepath.c b/programs/winepath/winepath.c index f4430d31eb6..2471803c5d9 100644 --- a/programs/winepath/winepath.c +++ b/programs/winepath/winepath.c @@ -142,8 +142,8 @@ static int parse_options(const WCHAR *argv[]) */ int wmain(int argc, const WCHAR *argv[]) { - LPSTR (*wine_get_unix_file_name_ptr)(LPCWSTR) = NULL; - LPWSTR (*wine_get_dos_file_name_ptr)(LPCSTR) = NULL; + LPSTR (*CDECL wine_get_unix_file_name_ptr)(LPCWSTR) = NULL; + LPWSTR (*CDECL wine_get_dos_file_name_ptr)(LPCSTR) = NULL; WCHAR dos_pathW[MAX_PATH]; char path[MAX_PATH]; int outputformats; -- 2.11.4.GIT