From 2efef7da99244f08cd2fd2650e469ae1e7a3179e Mon Sep 17 00:00:00 2001 From: Jan Zerebecki Date: Sat, 22 Nov 2008 10:02:17 +0100 Subject: [PATCH] push 07a2b33f792746135ccf34a3b3e1dfb2a3c1e823 --- .gitignore | 1 + ANNOUNCE | 1132 ++++++++++---------- VERSION | 2 +- configure | 360 +++---- configure.ac | 196 ++-- dlls/Makefile.in | 4 +- dlls/advapi32/tests/registry.c | 146 ++- dlls/atl/registrar.c | 2 +- dlls/cabinet/fci.c | 2 +- dlls/cabinet/fdi.c | 2 +- dlls/comctl32/monthcal.c | 3 +- dlls/comctl32/rebar.c | 2 +- dlls/comctl32/syslink.c | 2 - dlls/comctl32/tests/trackbar.c | 4 + dlls/comctl32/toolbar.c | 5 +- dlls/comctl32/trackbar.c | 2 +- dlls/comdlg32/tests/filedlg.c | 9 +- dlls/crypt32/crypt32.rc | 1 + dlls/crypt32/crypt32_En.rc | 23 +- dlls/crypt32/crypt32_Pt.rc | 220 ++++ dlls/crypt32/crypt32_private.h | 7 + dlls/crypt32/cryptres.h | 19 +- dlls/crypt32/decode.c | 409 ++++++- dlls/crypt32/encode.c | 274 +++++ dlls/crypt32/object.c | 407 ++++++- dlls/crypt32/str.c | 37 +- dlls/crypt32/tests/encode.c | 285 ++++- dlls/cryptdlg/main.c | 28 + dlls/d3d10/tests/device.c | 4 +- dlls/d3d10core/d3d10core_main.c | 5 +- dlls/d3d10core/d3d10core_private.h | 2 +- dlls/d3d10core/device.c | 2 +- dlls/{shdocvw => d3d10core}/tests/Makefile.in | 9 +- dlls/{d3d10 => d3d10core}/tests/device.c | 70 +- dlls/d3d9/tests/visual.c | 72 +- dlls/d3dx9_36/tests/math.c | 192 ++-- dlls/d3dxof/d3dxof.c | 98 +- dlls/d3dxof/d3dxof_private.h | 1 + dlls/dbghelp/dbghelp.c | 1 - dlls/dxgi/Makefile.in | 4 +- dlls/dxgi/adapter.c | 45 +- dlls/dxgi/device.c | 23 +- dlls/dxgi/dxgi_main.c | 108 +- dlls/dxgi/dxgi_private.h | 23 +- .../crypt32.rc => dxgi/dxgi_private_interface.idl} | 36 +- dlls/dxgi/factory.c | 75 +- dlls/{shdocvw => dxgi}/tests/Makefile.in | 9 +- dlls/dxgi/tests/device.c | 127 +++ dlls/gdi32/bidi.c | 2 +- dlls/gdiplus/graphicspath.c | 8 +- dlls/gdiplus/tests/graphicspath.c | 13 + dlls/hhctrl.ocx/Pt.rc | 58 + dlls/hhctrl.ocx/hhctrl.rc | 1 + dlls/imm32/imm.c | 87 +- dlls/inetcomm/pop3transport.c | 13 +- dlls/iphlpapi/icmp.c | 2 +- dlls/kernel32/cpu.c | 28 +- dlls/kernel32/dosmem.c | 84 +- dlls/kernel32/oldconfig.c | 22 +- dlls/kernel32/tests/file.c | 4 +- dlls/kernel32/tests/locale.c | 479 ++++++--- dlls/kernel32/tests/mailslot.c | 93 +- dlls/kernel32/tests/pipe.c | 5 +- dlls/kernel32/tests/process.c | 13 +- dlls/kernel32/tests/sync.c | 17 +- dlls/kernel32/tests/virtual.c | 143 ++- dlls/mlang/mlang.c | 40 +- dlls/mshtml/htmlcurstyle.c | 13 +- dlls/mshtml/htmldoc.c | 29 +- dlls/mshtml/htmlstyle.c | 15 +- dlls/mshtml/tests/dom.c | 61 +- dlls/mshtml/tests/htmldoc.c | 10 +- dlls/mshtml/tests/protocol.c | 4 +- dlls/msi/tests/install.c | 31 +- dlls/msvcrt/math.c | 2 +- dlls/msxml3/Makefile.in | 2 +- dlls/msxml3/main.c | 58 +- dlls/msxml3/msxml_private.h | 19 + dlls/msxml3/node.c | 21 +- dlls/msxml3/saxreader.c | 19 +- dlls/netapi32/nbt.c | 9 +- dlls/netapi32/netbios.c | 2 +- dlls/ntdll/directory.c | 4 +- dlls/ntdll/env.c | 1 - dlls/ntdll/heap.c | 10 +- dlls/ntdll/loader.c | 10 +- dlls/ntdll/ntdll_misc.h | 2 + dlls/ntdll/server.c | 10 +- dlls/ntdll/tests/reg.c | 90 +- dlls/ntdll/virtual.c | 225 ++-- dlls/ntoskrnl.exe/ntoskrnl.c | 30 + dlls/ntoskrnl.exe/ntoskrnl.exe.spec | 2 +- dlls/ole32/tests/compobj.c | 4 +- dlls/oleacc/tests/main.c | 4 +- dlls/oleaut32/varformat.c | 1 - dlls/quartz/filtergraph.c | 45 +- dlls/riched20/editor.c | 97 +- dlls/riched20/editor.h | 3 - dlls/riched20/run.c | 2 - dlls/rpcrt4/rpc_transport.c | 2 - dlls/rpcrt4/tests/rpc.c | 9 +- dlls/sane.ds/ds_image.c | 9 +- dlls/shdocvw/Makefile.in | 2 +- dlls/shdocvw/intshcut.c | 2 +- dlls/shdocvw/oleobject.c | 15 +- dlls/shdocvw/tests/Makefile.in | 2 +- dlls/shdocvw/tests/webbrowser.c | 19 +- dlls/shell32/tests/systray.c | 30 +- dlls/urlmon/tests/url.c | 27 +- dlls/user32/cursoricon.c | 18 +- dlls/user32/focus.c | 3 + dlls/user32/nonclient.c | 3 + dlls/user32/spy.c | 4 +- dlls/user32/tests/broadcast.c | 36 +- dlls/user32/tests/cursoricon.c | 39 +- dlls/user32/tests/edit.c | 38 +- dlls/user32/tests/listbox.c | 39 +- dlls/user32/tests/monitor.c | 20 +- dlls/user32/tests/resource.c | 56 +- dlls/user32/tests/sysparams.c | 36 +- dlls/user32/tests/win.c | 253 ++++- dlls/user32/win.c | 8 +- dlls/usp10/usp10.c | 14 +- dlls/version/info.c | 7 + dlls/version/tests/info.c | 14 + dlls/wined3d/arb_program_shader.c | 233 ++-- dlls/wined3d/ati_fragment_shader.c | 12 +- dlls/wined3d/context.c | 10 +- dlls/wined3d/device.c | 20 +- dlls/wined3d/state.c | 71 +- dlls/wined3d/surface.c | 71 +- dlls/wined3d/utils.c | 22 +- {include/wine => dlls/wined3d}/wined3d_gl.h | 20 +- dlls/wined3d/wined3d_private.h | 33 +- dlls/winhttp/Makefile.in | 2 +- dlls/winhttp/main.c | 2 - dlls/winhttp/tests/url.c | 268 ++++- dlls/winhttp/url.c | 165 ++- dlls/wininet/ftp.c | 4 +- dlls/wininet/tests/ftp.c | 23 + dlls/winspool.drv/Pt.rc | 39 + dlls/winspool.drv/winspool.rc | 1 + dlls/wintrust/wintrust_main.c | 2 +- dlls/wldap32/wldap32.rc | 1 + dlls/wldap32/wldap32_Pt.rc | 123 +++ include/commctrl.rh | 2 +- include/config.h.in | 9 +- include/dxgi.idl | 26 + include/textserv.h | 2 +- include/wincrypt.h | 19 +- include/wine/library.h | 2 - include/wine/wined3d_interface.h | 4 +- include/wine/wined3d_types.h | 77 -- include/winnt.h | 3 - include/winuser.h | 2 + programs/reg/Makefile.in | 3 +- programs/reg/reg.c | 34 +- programs/regedit/regproc.c | 198 ++-- programs/winetest/main.c | 112 +- programs/winetest/winetest.rc | 6 +- programs/wordpad/Da.rc | 2 +- programs/wordpad/De.rc | 2 +- programs/wordpad/Fr.rc | 2 +- programs/wordpad/Hu.rc | 2 +- programs/wordpad/Ko.rc | 2 +- programs/wordpad/Nl.rc | 2 +- programs/wordpad/No.rc | 2 +- programs/wordpad/Pl.rc | 2 +- programs/wordpad/Pt.rc | 2 +- programs/wordpad/Ru.rc | 2 +- programs/wordpad/Si.rc | 2 +- programs/wordpad/Tr.rc | 2 +- programs/wordpad/Zh.rc | 2 +- tools/make_makefiles | 5 +- tools/widl/proxy.c | 2 +- tools/widl/server.c | 2 +- tools/widl/typegen.c | 4 +- 177 files changed, 6088 insertions(+), 2714 deletions(-) rewrite ANNOUNCE (95%) create mode 100644 dlls/crypt32/crypt32_Pt.rc copy dlls/{shdocvw => d3d10core}/tests/Makefile.in (58%) copy dlls/{d3d10 => d3d10core}/tests/device.c (52%) copy dlls/{crypt32/crypt32.rc => dxgi/dxgi_private_interface.idl} (67%) copy dlls/{shdocvw => dxgi}/tests/Makefile.in (58%) create mode 100644 dlls/dxgi/tests/device.c create mode 100644 dlls/hhctrl.ocx/Pt.rc rename {include/wine => dlls/wined3d}/wined3d_gl.h (99%) create mode 100644 dlls/winspool.drv/Pt.rc create mode 100644 dlls/wldap32/wldap32_Pt.rc diff --git a/.gitignore b/.gitignore index afd7219b40d..2315e1fbfb4 100644 --- a/.gitignore +++ b/.gitignore @@ -34,6 +34,7 @@ dlls/ctl3dv2.dll16 dlls/ddeml.dll16 dlls/dispdib.dll16 dlls/display.drv16 +dlls/dxgi/dxgi_private_interface.h dlls/gdi.exe16 dlls/imm.dll16 dlls/jscript/jsglobal.tlb diff --git a/ANNOUNCE b/ANNOUNCE dissimilarity index 95% index 2612474a7ae..4363f0bd190 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,579 +1,553 @@ -The Wine development release 1.1.8 is now available. - -What's new in this release (see below for details): - - Substantial parts of inetcomm implemented (for Outlook). - - Still better crypt32 support. - - Memory management improvements. - - Theming support for buttons. - - Various bug fixes. - -The source is available from the following locations: - - http://ibiblio.org/pub/linux/system/emulators/wine/wine-1.1.8.tar.bz2 - http://prdownloads.sourceforge.net/wine/wine-1.1.8.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.8: - - 3109 Werkkzeug 1 remains black and creates buffer underruns - 3493 Commandos get's very slow (almost locked) while mouse is moving - 3819 Keyboard problem with Alien vs Predator 2 demo - 3910 PortAudio error at Unable to open streams: Illegal error number - 4046 Freezes waiting for short sound-samples that don't happen with sound off. - 4063 Quitting webed causes abort in _CheckNotSysLevel - 4078 memory allocation fails - 4144 Numerous RichText problems - 4558 Some numeric keypad keys don't work in user mode - 4855 ZOC window does not retain size after workspace switch - 4977 Mindstar Script Editor aborts on startup with "Runtime Error 430: Class does not support Automation..." - 5101 Age of Mythology The Titans - Memory Leak - 5224 Grim Fandango patch Gfupd101.exe doesn't start - 5707 Settlers IV is slow in WIne 0.9.16+ - 5784 Dark Age of Camelot not connect update server - 6683 IrfanView's "Save Picture as ..." dialog problems - 6694 Java App Problems with Filechooser - 6700 Magic Workstation Application occupying 100% of cpu - 6709 [Game] Ceasar IV crashes. - 6948 CSpy/Tab: Tab images have wrong offset - 7052 The game Locomotion crashes on startup (after drawing an empty desktop window) due to an unhandled page fault. - 7639 Papyrus loses focus when user clicks on font size pulldown - 8234 Supreme Commander Install fail - Error : 87 - 9460 Sid Meiers Pirates does not load after caps changes - 9577 Serious Sam II demo installer creates blank window - 9714 MapViewOfFile with write permissions should not succeed on a read-only file mapping - 9715 winecfg should allow display resolution beyond 120dpi - 10129 Guitar Rig 3 crashes - 10375 Stranger demo makes Wine segfaults - 10579 mingw32: reimp and other tools can't launch each other - 10727 .Net 2.0 does not install - 10810 Constant crash while using EDXOR - 10859 access violation in mshtml.dll since 0.9.48 / Heredis 9 - 10980 ConvertImage cannot run - 11092 cutscene does not display correctly - jedi knight dark forces II demo - 11199 Unhandled exception: page fault on read access to 0x00000050 when starting Archlord - 11369 CheckPoint SmartDashboard R65 causes wine crash - 11483 MSTSC (remote desktop) needs winscard.dll.SCardAccessStartedEvent - 12046 MinGW32: unhandled page faults and exceptions - 12175 Blank window appears during Sims 2 installation - 12219 The "House of the Dead 3" "start game" options menu doesn't show any text. - 12244 Unhandled page fault in Lotus Wordpro R9.5 - 12282 Oracle Forms 6i runtime crashes while opening a form - 12545 The Ship: Does not launch - 12584 Rendering problems in NWN2 - 12669 Flash 8: crashes when a pixmap in clipboard - 12711 Guitar Pro 5 don't show in the task bar - 12864 Quick 2007 Home & Business fails during startup - 12865 Flash wIndow initially displays off screen - 12940 e-sword app does not install - 12953 DAZStudio 2.1 installer intermittantly hangs on startup - 12974 Crash of Max Payne v1 on radeon DRI - 12986 emachineshop crashes when closing the help window - 13026 winetest may start without a tag - 13103 tomtom home does not install due to no loading sensapi.dll - 13135 Wine crash when starting program hedgewars - 13255 sigabort for most files used with vissim 7.0 - 13285 WriteIniValues does not create c:/windows/DieVölkerGold.ini - 13312 shipsim 2006 crashes - 13329 World of Warcraft (WoW) trial installer crashes with unimplemented function js3250.dll.JS_SetGCParameter - 13421 Lotus Notes 6.5.4 - wrong windows behavior - 13546 Che Guevara demo crashes - 13557 Regression. mdac25 fails to install - 13672 mIRC 6.32 script editor crashes with assertion failure in riched20 - 13737 Word 2003 crashes on opening specific file - 14037 worldwide telescope installer crashes in X11DRV_GetBitmapBits - 14333 WALL-E demo displays upside down. - 14437 Voipcheap installs but does not run - 14477 Installer of sins of solar empire is not copying any files at all - 14499 ImageDirectoryEntryToDataEx: section header param [out, optional], needs to be zeroed before RtlImageRvaToVa - 14560 Australian etax program help feature segfaults - 14658 Font rendering regression - 14731 Crash upon starting a network server in 1000 game - 14751 Max Payne 2: PP effects produce black screen in ARB mode - 14774 Max Payne 2: PP effects flood console with GL errors (ORM=fbo) - 14817 Msi property names passed on the command line need to be interpreted as uppercase (Corel Draw X3 installer) - 14983 CM2000 Graphics slowed down ! - 15142 Diablo - The Hell & Hellfire: DirectX issues - 15607 MyPhotoBooks doesn't run - 15691 Page fault while editing RichText - 15692 Apps crash with FontLink settings since Wine 1.1.6 - 15722 OpenOffice3 apps won't run - 15725 calendar sizing incorrect in Paf5 - 15756 Inline file rename text box does not disappear appropriately in 7-zip 4.60 beta - 15757 Address bar is not updated when navigating through directories in 7-zip 4.60 beta - 15758 Page Maker 6.5 can't find resource file - 15786 FEAR 1.08: GL errors in D3D8 mode - 15807 Problem editing HTML in TestLog - 15829 1000net installer crashes after selecting install button - 15842 winecfg: You don't have a drive C. This is not so great. - 15854 Age of Mythology: Vertex pipeline replacement patches break water transparency. - 15863 Unable to find X development files on Leopard - 15937 [PATCH] Pens of width = 1 scale on Windows, don't on Wine - ----------------------------------------------------------------- - -Changes since 1.1.7: - -Alexandre Julliard (45): - jscript: Avoid a compiler warning. - shdocvw/tests: Avoid sizeof in trace. - ntdll: Make sure the last relocation contains some data. - ntdll: Use the end of the reserved area as address space limit, in case we have more than 3Gb available. - ntdll: Ignore some system directories in NtQueryDirectoryFile to avoid recursion troubles. - user32: Move handling of internal messages into peek_message. - user32: Move thread info setting and WH_GETMESSAGE call into peek_message. - user32: Specify the new queue mask separately from the PeekMessage flags. - user32: Use a local buffer in peek_message to save a server call for small buffer sizes. - user32: Add a bunch of tests for GetQueueStatus and GetMessage combinations. - ntdll: Simplify the RtlIsDosDeviceName_U implementation. - ntdll: Add a few more tests for RtlIsDosDeviceName_U, fix some failures on Windows. - ntdll: Allocate a new virtual region for large blocks, and ensure 16-byte alignment. - ntdll: Store the exit code in the server in RtlExitUserThread. - kernel32: Only try to open a VxD if opening a normal device failed. - kernel32: Use ntdll functions where possible to implement the pthread wrappers. - kernel32: Moved the pthread emulation support to ntdll. - configure: Re-generate with autoconf 2.63. - ntdll: Merge HEAP_InitSubHeap and HEAP_CreateSubHeap. - ntdll: Create a separate heap for allocating memory views instead of using malloc. - kernel32: Allocate global arenas on the Win32 heap. - kernel32: Call build_argv in the parent process so that it can use the Win32 heap. - kernel32: Call build_envp in the parent process so that it can use the Win32 heap. - winecfg: Display an nicer error when the mount manager cannot be accessed. - ntdll: Initialize the large address space before attaching dlls. - ntdll: Return more correct information for SystemBasicInformation and GetSystemInfo. - winemenubuilder: Move the xdg global variables out of the libpng ifdef block. - wrc: Fix the duplicate resource check for user-defined types. - ntdll: Store the per-view flags in the high word of the page protection bits. - ntdll: Add a noexec flag for memory views where we don't want to force exec permission. - kernel32/tests: Fix a couple of failures on Windows. - kernel32/tests: Add a few more tests, fix some failures on Windows. - ntdll: Store the per-page committed status in the server for anonymous file mappings. - ntdll: Don't force anonymous file mappings to always be fully committed. - ntdll/tests: Fix a couple of tests on NT4. - ntdll,server: Fixed access checks for OpenFileMapping and MapViewOfFile. - include: Add extern "C" to the exported Wine headers. - kernel32/tests: Fix a few more errors on Win9x. - ntdll: Keep track of the current working set limit independently of system views that may be allocated beyond it. - ntdll: Do not report non-reserved memory areas as free since we don't know what's in them. - kernel32/tests: Fix one more failing test on Win9x. - ntdll: Store correct values in the various limits on all platforms instead of using 0. - loader: Reserve some space for the virtual heap too. - loader: Use a hidden function instead of an exported global variable to setup pthread functions. - advapi32/tests: Avoid sizeof in traces. - -Alistair Leslie-Hughes (6): - comdlg32: Fix test under win98. - msxml3: Add support to get_nodeTypedValue on Element Nodes. - oleacc: Removed failed test case. - inetcomm: Correct test under w2k8. - mshtml: Supply a default value for get_designMode. - mshtml: Implement IHTMLElement get_document. - -Andrew Fenn (1): - xinput: Added header file that defines a lot of the functionality of the library. - -Andrew Nguyen (1): - winmm: Fix a potential infinite recursion bug. - -Andrew Talbot (7): - odbc32: Sign-compare warnings fix. - oleaut32: Sign-compare warnings fix. - oledlg: Sign-compare warnings fix. - quartz: Sign-compare warnings fix. - quartz: Sign-compare warnings fix. - riched20: Sign-compare warnings fix. - rpcrt4: Sign-compare warnings fix. - -Aric Stewart (7): - ws2_32: Only set the overlapped hEvent if it exists. - crypt32: Static functions CertContext_GetProperty and CertContext_SetProperty do not need to be WINAPI. - ntdll: Fix parsing of proc file. Also correct memory deallocation on the Mac. - gdiplus: Stub implementation of GdipNewInstalledFontCollection. - msimtf: Add a mostly wrapper stub for IActiveIMMApp. - shell32: Do not automatically fail in SHGetFileInfo if the flag SHGFI_USEFILEATTRIBUTES is combined with SHGFI_ATTRIBUTES, SHGFI_EXETYPE, or SHGFI_PIDL. - comctl32: Add implementation of LVS_EX_ONECLICKACTIVATE. - -Austin English (5): - ole32: Implement IEnumFORMATETC_Next_Proxy and IEnumFORMATETC_Next_Stub. - winecfg: Set default windows version to XP. - advapi32/tests: fix a couple failures on Vista. - crypt32: fix a test failure on Free/PC-BSD. - wininet: Change a couple fixme's to warn's. - -Bobby Bingham (1): - gdi32: Add support for the GGO_UNHINTED flag in GetGlyphOutline. - -Clinton Stimpson (1): - comctl32: Fix getting of min size of monthcal when changing font. - -Damjan Jovanovic (1): - winemenubuilder: Generate icons in winemenubuilder instead of wineshelllink. - -David Adam (3): - d3dx8: Implement ID3DXMatrixStack_GetTop(). - d3dx8: Implement ID3DXMatrixStack_LoadIdentity. - d3dx8: Implement ID3DXMatrixStack_LoadMatrix. - -Detlef Riekenberg (3): - user32/tests: Avoid crash on win9x. - shdocvw/tests: Use the correct size for memset. - user32/tests: Fix crash on win9x in the dde test. - -Dmitry Timoshkov (9): - gdi32: Search the child font list first. - winex11.drv: Print the characters returned by ToUnicode. - user32: Make ToAscii(Ex) and ToUnicode(Ex) prototypes match PSDK. - wineconsole: Don't ignore extended keys. - kernel32: Don't ignore extended keys. - gdi32: Move DC mapping APIs to the 'dc' debug channel. - user32: Handle all kinds of values returned by WIN_GetPtr. - gdi32: Try to avoid not necessary glyph transformations. - gdi32: Fix a broken test. - -Dylan Smith (3): - richedit: Added riched32 tests for word wrap. - richedit: Fixed initial word wrap setting when emulating 1.0. - richedit: Handle negative position given to EM_POSFROMCHAR. - -Eric Pouech (1): - winedbg: Add a kill command to kill the current process. - -Francois Gouget (4): - wined3d: Fix the WineDirect3DCreate() export. - cryptui: Fix compilation on systems that don't support nameless unions. - d3dx8/tests: Fix compilation on systems that don't support nameless unions. - shlwapi/tests: AssocQueryStringA/W() are missing on Windows 98. - -Frans Kool (1): - oleacc: Added Dutch translations. - -Hans Leidekker (14): - wsock32: Make EnumProtocols a wrapper around WSAEnumProtocols instead of forwarding directly. - inetcomm: Add a stub implementation of IPOP3Transport. - inetcomm: Add a stub implementation of ISMTPTransport2. - inetcomm: Add an implementation of the pop3 USER and PASS commands. - inetcomm: Add an implementation of IPOP3Transport::CommandLIST. - inetcomm: Add an implementation of IPOP3Transport::CommandQUIT. - inetcomm: Add an implementation of IPOP3Transport::CommandSTAT. - inetcomm: Add an implementation of IPOP3Transport::CommandUIDL. - inetcomm: Implement IPOP3Transport::Disconnect. - inetcomm: Add an implementation of IPOP3Transport::CommandUSER. - inetcomm: Add an implementation of IPOP3Transport::CommandPASS. - inetcomm: Add an implementation of ISMTPTransport2::CommandDATA. - inetcomm: Advertise support for a couple more interfaces. - inetcomm: CreateIMAPTransport, CreatePOP3Transport and CreateSMTPTransport are implemented. - -Henri Verbeet (28): - wined3d: Move depth_blt to surface.c. - wined3d: Pass the texture type to the shader depth blt function. - wined3d: Pass explicit texcoords to depth blt. - wined3d: Support some more texture types for GLSL depth blts. - dxgi: Make some functions static. - d3d10: Make some functions static. - wined3d: Rename CreateAdditionalSwapChain to CreateSwapChain. - wined3d: Fix some indentation. - wined3d: Support some more depth blt texture types for arb programs. - wined3d: Support some more depth blt texture types in surface_depth_blt(). - wined3d: Handle lack of NPOT support for depth blts. - wined3d: Handle projected cube textures. - dxgi: Add some stubs for IDXGIAdapter. - dxgi: Add some stubs for IDXGISwapChain. - d3d10: Add a test to show d3d10 devices implement IDXGIDevice. - d3dx8: Return E_NOTIMPL from ID3DXMatrixStack stubs. - d3dx8: Correct some ID3DXMatrixStack prototypes. - d3dx8: Initialize the matrix stack in D3DXCreateMatrixStack(). - d3dx8: Implement ID3DXMatrixStack_Push() and ID3DXMatrixStack_Pop(). - d3dx8: Make expect_mat a bit more useable. - d3dx8: Add a few tests for ID3DXMatrixStack. - wined3d: Properly break in get_argreg() (LLVM/Clang). - wined3d: Print an error when drawStridedSlowVs() is called with 0 idxSize and non-NULL idxData (LLVM/Clang). - wined3d: Remove a FIXME that doesn't apply anymore. - d3d8: Don't ignore the GetCursorInfo() return value (LLVM/Clang). - d3d9: Don't ignore the GetCursorInfo() return value (LLVM/Clang). - wined3d: vertexshader should never be NULL in generate_param_reorder_function() (LLVM/Clang). - wined3d: Remove another redundant NULL check (LLVM/Clang). - -Hervé Chanal (2): - shell32: A nicer icon for "Open folder". - shell32: A nicer icon for "folder". - -Huw Davies (4): - ole32: Create the '\1Ole' stream. - ole32: Try to load the '\1Ole' stream and create it if it doesn't exist. - ole32: Implement IEnum*_Next marshallers. - ole32: Call the object's GetClassID if it's running. - -Jacek Caban (4): - mshtml: Remove no longer used interfaces. - jscript: Fixed SetScriptSite called before InitNew handling. - jscript: Added SCRIPTSTATE_CONNECTED implementation. - jscript: Added SCRIPTITEM_ISVISIBLE flag implementation. - -James Hawkins (13): - msi: Set the source path tests to "interactive" to avoid timing out on some machines. - msi: Use the long file name in the WriteIniValues action. - msi: Convert command line property names to uppercase. - msi: Skip the leading period of the extension to be registered. - msi: Do not reinstall an assembly that already exists in the global assembly cache. - msi: Allow private properties from the AdminProperties property list. - msi: Factor out the table insertion code. - msi: Factor out the table insertion code. - msi: Factor out the table insertion code. - msi: Factor out the code to open a product key. - msi: Factor out the code to open the features key. - msi: Factor out the code to open the UserData features key. - msi: Remove an unused registry function. - -Jeff Zaroyko (1): - ws2_32: Test WSAAccept optional callback parameter before trying to use it. - -Juan Lang (35): - cryptui: Don't crash if pImportSrc is NULL. - cryptui: Add tests for CryptUIWizImport. - cryptui: Improve parameter checking. - cryptui: Move cert creation to a helper function. - cryptui: Support importing certificate contexts. - cryptui: Test the import destination of a couple more certs. - cryptui: Choose appropriate destination store for a cert. - crypt32: Fix a failing test on Windows. - cryptui: Fix a failing test on Windows. - cryptui: Fix destination store for self-signed certs. - crypt32: Fix failing test. - crypt32: Fix frequency with which chains are checked for cycles. - crypt32: Don't neglect status to ignore on a Windows platform when a test is todo_wine. - crypt32: Fix chain error status when a cert's issuer can't be found. - crypt32: Fix some test failures on Win9x/NT4. - advapi32: Print error if opening /dev/urandom fails, and update comment. - crypt32: Fix test failures on older versions of Windows. - crypt32: Fix typo. - wintrust: Add stub for WVTAsn1SpcFinancialCriteriaInfoEncode. - wintrust: Add tests for WVTAsn1SpcFinancialCriteriaInfoEncode. - wintrust: Implement WVTAsn1SpcFinancialCriteriaInfoEncode. - wintrust: Add stub for WVTAsn1SpcFinancialCriteriaInfoDecode. - wintrust: Add tests for WVTAsn1SpcFinancialCriteriaInfoDecode. - wintrust: Implement WVTAsn1SpcFinancialCriteriaInfoDecode. - crypt32: Add missing ok calls. - crypt32: Separate checking the tag of encoded bits from decoding the bits. - crypt32: Add tests for CryptFormatObject. - crypt32: Add base implementation of CryptFormatObject. - crypt32: Make a global copy of crypt32's HINSTANCE. - crypt32: Implement CryptFormatObject for szOID_AUTHORITY_KEY_IDENTIFIER2. - crypt32: Implement CryptFormatObject for szOID_ENHANCED_KEY_USAGE. - crypt32: Implement CryptFormatObject for szOID_BASIC_CONSTRAINTS2. - crypt32: Implement CryptFormatObject for szOID_AUTHORITY_INFO_ACCESS. - crypt32: Implement CryptFormatObject for szOID_CRL_DIST_POINTS. - crypt32: Implement CryptFormatObject for SPC_FINANCIAL_CRITERIA_OBJID. - -Katayama Hirofumi MZ (1): - notepad: Don't save maximized size. - -Kirill K. Smirnov (1): - gdi32: Fix copy/paste typo. - -Krzysztof Kotlenga (1): - winex11: Make pens of width = 1 scalable. - -Kusanagi Kouichi (1): - winex11: Implement large data transfers. - -Lei Zhang (7): - comctl32: Get rid of DragDetect. - comctl32: Don't notify if listview edit box contents have not changed. - comctl32: Reset nEditLabelItem in LISTVIEW_EndEditLabelT. - comctl32: Only update comboex edit box if the mask has CBEIF_TEXT set. - ntdll: Skip deleted files in read_directory_getdents. - wininet: Remove redundant variables. - wininet: Handle HTTP 303 redirects. - -Marcus Meissner (9): - netapi32: Fixed buffer sizes to GetUserNameW and GetComputerNameW. - programs: Fixed two RegEnumValue name lengths. - oleview: Fixed size passed to LoadStringW. - ntoskrnl.exe: Check irp for NULL consistently. - advapi32: Removed redundant NULL check. - msxml3: Fixed NULL ptr dereference possibilities (Coverity). - msxml3: Fixed if nesting / ptr checking problems in xmlnode_transformNode. - mshtml: Fixed reversed NULl check. - wininet: Removed redundant NULL check (Coverity). - -Michael Karcher (3): - msxml3: IXMLCDATASection is not an element. - msxml3: Clean up initialization. - msxml3: Simplify IXMLDOMNodeMap::removeNamedItem. - -Michael Stefaniuc (54): - advapi32/tests: Use 0 instead of casting NULL to a handle of integer type. - rsaenh: Use 0 instead of casting NULL to a handle of integer type. - comctl32: Just use 0 instead of casting NULL twice to an integer type. - comctl32: HGDIOBJ is interchangeable with other handle types so don't cast. - user32: HGDIOBJ is interchangeable with other handle types; no casts are needed. - gdi32/tests: HGDIOBJ is interchangeable with other handle types; no casts are needed. - taskmgr: HGDIOBJ is interchangeable with other handle types; no casts are needed. - cmdlgtst: HGDIOBJ is interchangeable with other handle types; no casts are needed. - cmdlgtst: Use NULL instead of casting 0 to a pointer. - comctl32: Remove superfluous casts as HANDLE to other handle types. - comctl32: HANDLE/HGLOBAL are basically just void pointers. No casts to other pointers are needed. - comdlg32: Don't cast the return value of GetProp() as it is a HANLE aka void pointer. - gdi32: Don't cast NULL. - winedump: Remove casts of void pointers to other pointer types. - winex11.drv: ImmLockIMCC() returns a void pointer; no need to cast that. - cabinet: Do not cast NULL. - riched20: Do not cast NULL. - riched20: Use MAKELPARAM instead of "(LPARAM) MAKELONG". - winedbg: Use FIELD_OFFSET instead of reimplementing it. - user32: Do not cast NULL. - dmusic: Do not cast NULL. - dnsapi: Transform two for loops into while loops. - d3dx8: Do not cast NULL. - netapi32/tests: Do not cast NULL. - ole32: Do not cast NULL. - oleview: Do not cast NULL. - setupapi: Do not cast NULL. - dmsynth: Do not cast NULL. - winedos: Do not cast NULL. - shell32: Do not cast NULL. - dmloader: Do not cast NULL. - oleaut32: Do not cast NULL. - comctl32: Do not cast NULL. - Remove the remaining casts of NULL. - avifil32: Remove superfluous casts of void pointers. - uxtheme: Remove superflous casts. - comctl32/tests: Use MAKELPARAM instead of "(LPARAM) MAKELONG". - wined3d: Use the integer variant of zero instead of casting "0.0". - kernel32: Do not cast zero. - riched20: Remove superflous casts. - comctl32: Do not cast zero. - user32: Do not cast zero. - crypt32: Remove superfluous casts of void pointers. - iphlpapi: Do not cast zero. - user32: Remove superfluous casts of void pointers. - fusion: Remove superfluous casts of void pointers. - shell32: Use FIELD_OFFSET instead of hand coding its functionality. - make_requests: Do not generate code that casts zero to a pointer. - shell32: Remove superfluous casts; mostly of void pointers. - ole32: Remove some superfluous casts of void pointers and zero. - shlwapi: Remove superfluous casts of/to void pointers. - comdlg32: Remove superfluous casts of void pointers to other pointer types. - comctl32: Remove superfluous casts that crept in as well as some older ones. - crypt32: Fix the aligning up to a DWORD_PTR boundary. - -Nicolas Le Cam (7): - msi/tests: Fix a failing test on all platforms up to and including win2k. - wininet/tests: Fix a failing test on IE6. - shell32/tests: Fix a test on several platforms. - user32: Partially implement SystemParametersInfo(SPI_{GET/SET}FOREGROUNDLOCKTIMEOUT). - advapi32/tests: test_enum_provider_types test cleanup. - advapi32/tests: Run a test on more platforms. - cryptui/tests: Fix test failures on Win2k and below. - -Nikolay Sivov (3): - gdiplus: Add a structure to header for easier navigation (by wrapper class). - gdiplus: Added CachedBitmap calls. - gdiplus: Added TRACE(..) for Pen calls. - -Owen Rudge (1): - appwiz.cpl: Use MS Shell Dlg instead of MS Sans Serif for dialog boxes. - -Paul Bryan Roberts (5): - ntdll: Avoid potential infinite loop. - advapi32/tests: Simple tests of GetFileSecurity()/SetFileSecurity(). - advapi32: Add TRACE to GetFileSecurity(). - server: Refactor server side implementation of GetFileSecurity(). - server: Clone file_get_sd() and file_set_fd() for directories. - -Paul Vriens (12): - shlwapi/tests: Fix some failures on XP and W2K3. - ddraw/tests: Fix a test on W2K3. - shlwapi/tests: Fix a failure on Win9x and NT4. - shell32/tests: Fix a test failure on NT4. - rsaenh/tests: Fix a test failure on NT4 and below. - user32/tests: Fix some test failures on Win9x and WinMe. - winmm/tests: Fix failure on Win9x and WinMe. - gdi32/tests: Don't crash on NT4. - user32/tests: Fix some test failures on Win9x. - user32/tests: Set last error if the menu item cannot be found. - user32/tests: Skip GetMenuItemInfo tests on NT4 and below. - winmm/tests: Fix a test failure on Vista and W2K8. - -Reece Dunn (6): - winecfg: Add ellipsis ('...') to buttons that launch other dialogs. - winecfg: Renamed 'Shell Folder' to 'Folder'. - uxtheme: Fixed the todo blocks in the IsThemed tests when theming is inactive. - comctl32: Support themed push buttons. - comctl32: Support themed check boxes and radio buttons. - comctl32: Don't draw the theme background of the group box over it's content area. - -Rob Shearman (9): - inetcomm: Add an implementation of the HELO/EHLO command. - inetcomm: Add an implementation of ISMTPTransport2::SendMessage. - inetcomm: Add an implementation of ISMTPTransport2::CommandQUIT. - inetcomm: Add an implementation of ISMTPTransport2::CommandMAIL. - inetcomm: Add an implementation of ISMTPTransport2::CommandRCPT. - inetcomm: Add an implementation of ISMTPTransport2::CommandEHLO. - inetcomm: Add an implementation of ISMTPTransport2::CommandHELO. - inetcomm: Add an implementation of ISMTPTransport2::CommandAUTH. - inetcomm: Add an implementation of ISMTPTransport2::CommandRSET. - -Roderick Colenbrander (4): - winex11: Move all delayed GLX context creation code to create_glxcontext in order to prepare for WGL_ARB_create_context. - Opengl32: Add defines for WGL_/GLX_ARB_create_context. - opengl32: Mark some opengl3 tests as wine_todo. - wnaspi32: Fix a buffer size regression. - -Sergey Khodych (5): - winex11: BitBlt returns TRUE when drawing outside of the clipping or visible region. - comctl32: toolbar: Calculate a correct size for empty buttons with the BTNS_AUTOSIZE style. - comctl32: toolbar: Improve text layout in TBSTYLE_LIST toolbars. - comctl32: toolbar: Use a cx field for buttons in TOOLBAR_WrapToolbar. - comctl32/tests: Fix typo in toolbar todo test. - -Stefan Dösinger (8): - wined3d: Restore the fragment replacement prog after depth_blt. - d3d9: Test the effect of lighting on the result alpha. - d3d: Do not restore the display mode in ddraw. - d3d9: Use the correct AddRef and Release macros. - d3d9: WINED3DSURFACE_DESC::MultiSampleType is not a DWORD. - wined3d: Fix the num blend values -> type match. - wined3d: Kill the GL_ATI_envmap_bumpmap code. - d3d9: Add a test for GetTexture with no texture set. - -Tobias Jakobi (1): - wined3d: Fix typo in baseshader.c. - -Tony Wasserka (2): - d3dx9: Implement D3DXCreateSprite. - d3dx9: Implement ID3DXSprite_Draw. - -Vincent Povirk (5): - shell32: Try to guess the working directory in the run dialog. - setupapi/tests: Add test for ProfileItems directive. - setupapi: Implement ProfileItems directive. - setupapi: Add a matching CoUninitialize call. - rundll32: Build with -mwindows. - -Vitaliy Margolen (5): - winmm: Support more joysticks. - dxdiagn: Replace remaining FIXMEs with TRACEs. - dxdiagn: Add pagefile size info. - dxdiagn: Add windows path. - dxdiagn: Add service pack version. - -Vitaly Perov (2): - netapi32: Add stub for NetShareGetInfo. - netapi32: Add stub for NetShareAdd. - --- -Alexandre Julliard -julliard@winehq.org +The Wine development release 1.1.9 is now available. + +What's new in this release (see below for details): + - A large number of regression test fixes. + - Performance improvements in memory management. + - Improved POP3 support in inetcomm. + - Initial implementation of the XInput DLL. + - Various bug fixes. + +The source is available from the following locations: + + http://ibiblio.org/pub/linux/system/emulators/wine/wine-1.1.9.tar.bz2 + http://prdownloads.sourceforge.net/wine/wine-1.1.9.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.9: + + 4355 WMP10 setup fails due to unimplemented functions + 4397 Application doesn't start + 5416 Port royal 2 demo will not start + 5502 Warkanoiddemo hangs with black screen + 6222 updating FFXI PlayOnline produces Unhandled exception after update restart + 6781 "battle for middle earth II" demo fails to install + 6825 imagehlp.ImageDirectoryEntryToData needs to clear out param when entry not found + 6859 renguard does not install + 7206 Scribe3 loops forever on startup adding fonts? + 7652 Transcendence: text and numbers either missing or displayed wrong + 7992 wordweb 5 doesn't download its data + 8047 BOM: DateSerial (VB function) gives 19xx for 2 digit years, but should provide 20xx for years below 30 + 8366 Rainbow Six Vegas fails to start + 8663 Anarchy Online display is completely black when using windowed mode + 8844 ShoreTel Client installer crashes when searching for related applications + 8868 Oblivion crashes outdoors when moving across load boundry + 9064 UBSPay font problem + 9103 X2 The Threat: Bumpmapping broken + 9317 Can't run vbtablet + 9481 LOTRO crash with Alsa at Full Hardware Acceleration + 9529 ETQWBeta2 installer fails to execute vcredist_x86.exe + 9745 Family Archive Viewer 6, Family Tree Maker 8 start off with main window too small + 9912 La Soeur de Barrage: crashes when attempting to start game + 9983 Half-Life 2, Counter Strike Source and other games crash at startup + 10201 Playback progress not working in WMP 9 + 10217 Windows Media Player 10 crashes with builtin urlmon + 10242 RACE - The WTCC Game (Two car DEMO) fails to start + 10314 Switched On Schoolhouse 2000 hangs X on startup + 10395 Programmer's Notepad 2 closes when loading a new file with no existing tabs open + 10592 EVE Online login screen causes some gfx corruptions + 10706 unimplemented ntdll.dll.NtQueryEaFile and ntdll.dll.NtSetEaFile cause CVSNT client included in TortoiseCVS to fail checkout operation + 11663 Guild Wars seems to hang with intel X3100 + 11772 Mathematica 5.1, Help Browser crash everything. + 11777 Guitar Hero 3 fails to start + 12082 Project Nomads: dialog speeches too fast + 12100 lego star wars crashes entering first level + 12550 Farb-Rausch demo 30 "candytron" doesn't render past the loading screen. + 12607 Quake Wars demo crashes on startup + 12774 Caesar 3 crashes on exit + 13035 Bad HAVE_XSLTINIT in msxml3 + 13112 comctl32 trackbar setPos() should not call oncustomdraw if value hasn't changed + 13116 wxDev-C++: Problem building projects + 13150 Guitar Hero 3 crashes without D3DXCreateTextureFromFileInMemoryEx and D3DXCreateTextureFromFileW + 13281 crash during installation of WebEngine V200N by Virtual Mechanics + 13408 ActiveSync 4.5 don't install - error richedit ReadStyleSheet and others + 13426 When installing WebEngine you get the message "http://download.virtualmechanics.com/download/install/webenginev2/200N/WebEngineV200N.msi is not trusted" + 14498 VB6 App problem on MouseIcon property + 14600 Oblivion has wrong thunderbolt spell + 14824 Red Alert 3 Beta requires several functions of WinHttp to be implemented + 14885 [Morrowind] System freeze/reboot required after switching from wine to other apps + 15055 implement undocumented window message 0x0313 (WM_POPUPSYSTEMMENU) + 15233 FamiTracker 0.2.7 does not work + 15289 Warlords Battlecry II and III crash + 15446 Install Aware doesn't work with wine + 15595 Kyodai mahjong crashes + 15690 msvcrt: enumeration value not handled in switch + 15872 Games segfault with wine-1.1.7 and Ubuntu 8.10 intrepid Ibex + 15879 Lotus 6.5.4 - extermelly slow after update to Wine 1.1.6 + 15898 unimplemented function advapi32.dll.LsaSetSecret, aborting + 15916 Winecfg: fails to open drive_c + 15930 ChangeWindowMessageFilter is not implemented + 15944 mountmgr only assign drive letters for up to two removable devices + 15950 wine won't build with bison 2.4 + 15955 Tomb Raider underworld demo crashes at startup + 15972 Clicking close button in Word 2003 closes the window but not the program in 1.1.8 + 15976 MS Exchange 2007 fails to install. + 15992 Sure Thing CD Labeller crashes when you start to try to use it + 15994 DirectX - D3DCAPS errors in WINE 1.1.8 BETA + 16024 typos in include/shlwapi.h + 16044 Cannot accept the Eula. Accept button disabled. + 16061 HEAP_FindSubHeap taking excessive CPU time + 16074 F.E.A.R in wine 1.1.8 regression + 16084 widl crash on vista x86 + +---------------------------------------------------------------- + +Changes since 1.1.8: + +A C Hurst (1): + ntdll: wine_nt_to_unix_file_name() parse string to int instead of cast char, where string may be passed. + +Alexander Morozov (2): + kernel32: NT drivers can handle IOCTL codes with HIWORD == 0. + include: Remove declarations of undefined functions. + +Alexandre Julliard (69): + kernel32/tests: Fix some profile test failures on NT4. + kernel32/tests: Fix some resource test failures on NT4. + kernel32/tests: Fix the thread test on NT4. + kernel32: Explicitly request execute permission in MapViewOfFile. + ntdll/tests: Fix the atom test on NT4. + ntdll: Don't call the dll entry point for native modules. + mountmgr: Return the drive type even when the buffer is too small. + kernel32: Get the drive type from the mount manager instead of the registry. + ntdll/tests: Fix a couple of test failures on Vista. + ntdll: Add support for root directory in NtCreateFile for Win32 file objects. + kernel32: Implemented the Ex variants of CreateEvent/Mutex/Semaphore/WaitableTimer. + ntdll/tests: Fixed more object manager tests on Vista. + user32/tests: Fix window tests on various Windows versions. + user32/tests: Skip the PM_QS_* PeekMessage tests on NT4. + mountmgr: Make the device type more specific than what is possible with the standard Win32 drive types. + user32/tests: Make sure the message test doesn't hang if the window doesn't have focus. + msvcrt/tests: Trace the timezone being used. + user32: Don't process other messages when recursing in peek_message for an internal message. + kernel32: Don't request unneeded access in OpenFileMapping. + kernel32/tests: Fix the thread test to cope with the Win95 InterlockedIncrement behavior. + msvcrt/tests: Run time tests for the current year instead of 1970 and fix wrong DST assumptions. + ole32/tests: Fix a couple of global stream test failures on Win9x. + ole32/tests: Use a CLSID that is more likely to exist on old Windows versions. + ole32/tests: Don't hardcode the Ansi codepage value. + ole32/tests: Fix a couple of test failures on Win9x and NT4. + ntdll: Added stubs for NtGetWriteWatch and NtResetWriteWatch. + kernel32: Added GetWriteWatch and ResetWriteWatch. + kernel32/tests: Added a bunch of tests for write watches. + shell32/tests: Properly cleanup the created favorites shell folder. + include: Added the IInternetProtocolEx interface. + urlmon/tests: Accept IInternetProtocolEx interface id. + kernel32/tests: Fix the file test on various Windows versions. + ntdll: Add private function to manage system virtual views instead of abusing NtAllocateVirtualMemory. + kernel32/tests: Fix the write watch tests on Win98 and Win2000. + user32/tests: Fix the resource tests for various Windows versions. + kernel32/tests: Fix pipe test on w2k3. + user32: Fix FindWindow to not match an empty class name. + ntdll: Don't set noexec protection on builtin dlls, some broken apps clear the execute permission. + wintrust: Fix a buffer overflow. + ntdll: Get rid of the unaligned_mmap wrapper. + kernel32/test: Fix the timer queue tests on Vista. + kernel32/tests: Fix the mailslot tests on Vista. + kernel32/tests: Fix the process tests on NT4. + ntdll: Increase subheap size quadratically to avoid slowdown when allocating tons of heap memory. + kernel32/tests: Allow up to 2 seconds of difference in timestamps. + kernel32: Moved allocation of the DOS memory area to ntdll. + ntdll: Get rid of the Wine-specific MEM_SYSTEM flag. + winetest: Capture the Win32 stderr into the log file too. + winetest: Allow to specify a subset of tests to run on the command line. + winetest: Report an error when a test program completely fails to run. + make_makefiles: Add a target to build only the test directories. + user32/tests: Fix a few more failures in the window test. + kernel32/tests: Add a couple of tests for write watches. + user32/tests: The BSF_SENDNOTIFYMESSAGE flag is not supported on NT4. + user32/tests: Fix the cursor tests on Win9x. + user32/tests: Fix the edit margins tests on Win9x. + user32/tests: Fix wildcard directory lists handling for Win9x. + user32/tests: Fix the monitor tests on NT4. + user32/tests: Fix some of the sysparams tests on Win9x and NT4. + user32/tests: Allow the foreground window to be null in the window tests. + kernel32/tests: Fix test failures on Win9x and NT4. + kernel32/tests: Fix the mailslot tests on Win9x. + mshtml/tests: Avoid crashing on test failure. + rpcrt4/tests: Fix test failures on Win9x. + shell32/tests: Fix the systray tests on Win9x and NT4. + urlmon/tests: Don't expect IHttpNegotiate2 queries if the interface is not supported. + configure: Add a --disable-tests option to avoid building regression tests. + user32/tests: Only test the window caption status if there is a foreground window. + shdocvw: Fix the computation of the default extents. + +Alistair Leslie-Hughes (12): + advapi32: Correct spelling of SE_CHANGE_NOTIFY_PRIVILEGE. + mshtml: Implement IHTMLStyle get/put posLeft. + advapi32: Correct off by one in LookupPrivilegeValueW. + shdocvw: Added Support for the IViewObjectEx interface. + winmm: Increase tolerance range. + mshtml: Add tests for supported interfaces. + shdocvw: Correct tests. + ntoskrnl.exe: Implement MmGetSystemRoutineAddress. + mshtml: Implement IHTMLStyle get/put posTop. + mshtml: Implement IDispatch for IHTMLCurrentStyle. + mshtml: Implement IHTMLDocument2_get_images. + version: VerQueryValueA/W allow blank and NULL strings. + +Andrew Fenn (6): + xinput1_3: Initial implementation. + xinput9_1_0: Initial implementation. + xinput1_1: Initial implementation. + xinput1_2: Initial implementation. + xinput: Added the function XInputGetState with test case. + xinput: Added XInputGetCapabilities function with test case. + +Andrew Nguyen (1): + imagehlp: Rectify and add a forward. + +Andrew Riedi (3): + user32: Initial .ani support (only first frame). + reg: const WCHAR -> static const WCHAR. + user32: Fix the loading of stretched cursors. + +Andrew Talbot (10): + rsaenh: Sign-compare warnings fix. + secur32: Sign-compare warning fix. + setupapi: Sign-compare warnings fix. + shell32: Sign-compare warnings fix. + shlwapi: Sign-compare warnings fix. + urlmon: Sign-compare warnings fix. + msxml3: Void function should not return a value. + widl: Remove superfluous semicolons. + usp10: Sign-compare warnings fix. + wined3d: Sign-compare warnings fix. + +Aric Stewart (2): + winhttp: Correct another difference between InternetCrackurl and WinHttpCrackUrl. + imm32: Implement ImmInstallIME(W/A). + +Austin English (2): + include/shlwapi: Fix some typos. + msvcrt: Fix a compiler warning. + +Christian Costa (12): + d3dxof: Allow template definitions in objects file. + d3dxof: Close source file when releasing EnumObject. + d3dxof: Increase max childs/subobjects and check the limit is not overcome. + d3dxof: Finish strings support. + d3dxof: Fix buffer overflow. + d3dxof: Support also xfile version 3.03. + d3dxof: Increase max objects and check limit. + d3dxof: Add support for DXFILELOAD_FROMMEMORY. + d3dxof: Prepare support for objects binary format. + d3dxof: Allow '-' in names. + d3dxof: Fix data buffer limit check. Increase size of input and data buffers. + d3dxof: Finish support for objects binary format. + +Damjan Jovanovic (4): + winemenubuilder: Generate desktop files instead of wineshelllink. + winemenubuilder: Moved all wineshelllink functionality to winemenubuilder and removed wineshelllink. + shdocvw, winemenubuilder: Generate fd.o entries for .url files. + user32: Handle NULL rectangles in WM_NCCALCSIZE. + +Daniel Zimmermann (1): + widl: Fix check for interface type in get_size_procformatstring. + +David Adam (5): + d3dx8: Simplify D3DXQuaternionInverse. + quartz: Check for NULL condition in FilterGraph2_Disconnect. + d3dx8: Implement D3DXMatrixAffineTransformation2D. + d3dx8: Implement D3DXMatrixTransformation2D. + d3dx8: Change the debug channel of d3dx8 into the generic d3dx. + +Detlef Riekenberg (5): + shlwapi/tests: Add more entries for PathIsURL. + advapi32/tests: Fix tests on win9x (GetFileSecurity not implemented). + advapi32/tests: Fix broken GetLastError tests. + comctl32/tests: Make the header test dpi aware. + shdocvw/tests: Make the webbrowser test dpi aware, make it pass in wine. + +Dmitry Timoshkov (5): + widl: Make the generated string pointers const as well. + appwiz.cpl: Make some data static const. + shell32: Make some data static const. + shdocvw: Fix the COLOR_xxx usage. + user32: Do not change focus if the window is no longer active. + +Dylan Smith (9): + richedit: Created initial tests for windowless richedit controls. + richedit: Initial testing of ITextServices methods. + richedit: Removed comment in header for non-existent wintest.c. + include: Added missing macros for EM_SETIMESTATUS and EM_GETIMESTATUS. + user32: Added message spy string for IME Status messages. + richedit: Update strings and comments regarding IME Status messages. + include: Fixed a typo for ITextHost::TxSetCaretPos declaration. + richedit: Removed unused ME_AutoURLDetect function. + richedit: Removed useless lines in ME_GetDefaultCharFormat. + +Eric Pouech (6): + winedump: Print detailed information about class/struct properties. + dbghelp: Fix all forward declaration cases for UDT. + winedbg: Rewrote the symbol picking mechanism so that it can handle several algorithms. + winedbg: Slightly change the option setting syntax (allows also to get the current state back). + winedbg: Added scoped symbol picker, and options to handle it. + dbghelp: Properly add CPU info to minidump. + +Florian Köberle (2): + user32/tests: Capture tests should not require no active window. + user32/tests: Test size and minmax of WS_THICKFRAME child. + +Francois Gouget (31): + gdiplus: Add a trailing '\n' to a Wine trace. + shell32/tests: Remove spaces before '\n' in ok() calls. + regedit: Remove unneeded variable initializations. + regedit: Check that we were able to allocate line_buf too. + regedit: line_size is supposed to track a string length. + regedit: The xxx_name_len variables track buffer sizes. That is they count the trailing '\0'. Adjust a couple of places that got this wrong and rename them to xxx_name_size. + regedit: Simplify REGPROC_export_string(). + regedit: Tighten a buffer size calculation. + regedit: Simplify / clean up export_hkey(). + regedit: Fix a buffer overflow when exporting binary values in export_hkey(). + regedit: Fix the wrapping of binary values in export_hkey(). + d3dx9_36/tests: Fix compilation on systems that don't support nameless unions. + inetcomm: Fix compilation on systems that don't support nameless unions. + d3d10core: Fix spelling of 'unknown'. + crypt32: Fix Spelling of 'superseded'. + Assorted spelling fixes. + msxml3: Dynamically load libxslt.so and only call xsltInit() if present. + ntdll/tests: Fix typos in test_NtQueryValueKey(). + ntdll/tests: Test how NT(Set, Query)ValueKey() handle non-terminated strings. + kernel32: Fix create_scsi_entry() so it puts properly '\0'-terminated strings in the registry. + kernel32: Simplify and optimize create_(system,env)_registry_keys(). + msxml3: Fix compilation on systems that don't have xsltInit(). + regedit: Fix a buffer allocation in export_registry_key(). + regedit: Pass the string length to REGPROC_export_string(). + regedit: Fix exporting of REG_EXPAND_SZ and other 'weird' strings. + regedit: Avoid wsprintfW() so we can avoid loading user32.dll for 'regedit /E'. + ntdll/tests: Remove a redundant 'if'. + advapi32/tests: Cleanup test_hkey_main_Value_[AW](). + advapi32/tests: Fix the line number reported by test_hkey_main_Value_[AW](). + advapi32/tests: Check how the registry APIs handle non-terminated strings. + reg: Avoid wvsprintfW() so we can avoid loading user32.dll. + +Hans Leidekker (15): + inetcomm: Flesh out the pop3 command parser. + inetcomm: Add an implementation of IPOP3Transport::CommandDELE. + inetcomm: Add an implementation of IPOP3Transport::CommandNOOP. + inetcomm: Add an implementation of IPOP3Transport::CommandRSET. + inetcomm: Add an implementation of IPOP3Transport::CommandRETR. + inetcomm: Add an implementation of IPOP3Transport::CommandTOP. + inetcomm: Support both forms of the UIDL and LIST commands. + inetcomm: Send a notification when disconnecting. + user32: Add a stub implementation of ChangeWindowMessageFilter. + inetcomm: Add an implementation of IVirtualStream. + inetcomm: Get rid of the server info copy. + mlang: Implement IMultiLanguage2::ConvertStringInIStream. + winhttp: Reimplement WinHttpCrackUrl. + winhttp: Add tests for WinHttpCrackUrl. + winhttp: Prefer builtin over native. + +Henri Verbeet (29): + d3d10core: Add a d3d10core dll. + d3d10core: Implement ID3D10Device in d3d10core instead of d3d10. + d3d10core: Allow ID3D10Device to be aggregated. + dxgi: Add a stub for DXGID3D10RegisterLayers. + d3d10core: Implement D3D10CoreRegisterLayers. + dxgi: Implement DXGID3D10RegisterLayers(). + dxgi: Implement DXGID3D10CreateDevice(). + d3d10core: Implement D3D10CoreCreateDevice(). + d3d10: Implement D3D10CreateDevice() on top of D3D10CoreCreateDevice(). + d3d10: Use the factory that created the adapter to create a swapchain. + d3d10core: Add a trace for D3D10CoreCreateDevice(). + dxgi: Add some dxgi return codes. + dxgi: Add a IWineD3D field to dxgi_factory. + dxgi: Add an ordinal field to dxgi_adapter. + dxgi: Add a wined3d device to dxgi_device. + dxgi: Store an array of adapters in dxgi_factory. + dxgi: Implement IDXGIFactory::EnumAdapters(). + dxgi: Add a test for DXGID3D10CreateDevice(). + d3d10core: Add a test for D3D10CoreCreateDevice(). + wininet: Treat an empty username as NULL in FTP_Connect(). + wined3d: Fix the cube map coordinates in surface_blt_to_drawable(). + wined3d: Make it more obvious the pshader path in shader_hw_map2gl() doesn't handle opcodes without parameters. + wined3d: Give mov & mova their own handler. + wined3d: Avoid using a stack buffer in a few places in shader_hw_map2gl(). + wined3d: wined3d_gl.h should be internal to wined3d. + wined3d: Don't use the same GUID for IWineD3D and IWineD3DDevice. + wined3d: Remove some unused code. + dxgi: Implement IDXGIDevice::GetAdapter(). + dxgi: Implement IDXGIAdapter::GetParent(). + +Hirofumi Katayama (2): + wordpad: Accept double-click in date and time dialog. + wordpad: Update resources for date and time dialog. + +Huw Davies (2): + kernel32: Fix a few Welsh translations. + ole32: Don't issue a warning if a flat copy is all that's required. + +Hwang YunSong(황윤성) (2): + winecfg: Updated Korean resource. + oleacc: New Korean resource. + +Jacek Caban (1): + shdocvw: Revert "Added Support for the IViewObjectEx" with tests. + +Juan Lang (28): + crypt32: Don't underreport the size available when formatting szOID_AUTHORITY_KEY_IDENTIFIER2. + crypt32: Fix off-by-one error in formatting szOID_AUTHORITY_KEY_IDENTIFIER2. + crypt32: Implement formatting an alt name entry with type CERT_ALT_NAME_DIRECTORY_NAME. + crypt32: Fix comment typo. + crypt32: Fix indenting for szOID_CRL_DIST_POINTS. + crypt32: Correct heading for a certificate issuer in a CERT_AUTHORITY_KEY_ID2. + crypt32: Use correct string for directory names in a CERT_ALT_NAME_ENTRY. + crypt32: Add a function to format a CERT_NAME_BLOB as an indented string, and implement CertNameToStrW on top of it. + crypt32: Indent directory name when formatting an alt name entry. + crypt32: When formatting a directory name as a multiline string, put a newline between the heading and the value. + crypt32: Implement CryptFormatObject for alternate names. + crypt32: Add tests for encoding/decoding CERT_POLICY_QUALIFIER_USER_NOTICE. + crypt32: Implement encoding CERT_POLICY_QUALIFIER_USER_NOTICE. + crypt32: Implement decoding CERT_POLICY_QUALIFIER_USER_NOTICE. + crypt32: Add tests for encoding/decoding CERT_POLICIES_INFO. + crypt32: Implement encoding CERT_POLICIES_INFO. + crypt32: Implement decoding CERT_POLICIES_INFO. + cryptdlg: Register/unregister the OID functions exported by cryptdlg. + netapi32: Fix dead stores. + include: Fix typos. + include: Add a few missing definitions for Netscape cert extensions. + crypt32: Implement CryptFormatObject for szOID_KEY_USAGE. + crypt32: Implement CryptFormatObject for szOID_NETSCAPE_CERT_TYPE. + crypt32: Fix failing tests on Win9x/NT4. + crypt32: Decoded unicode name value strings should be NULL-terminated. + crypt32: Check registered CryptFormatObject functions before using default hex format. + crypt32: Formatted bits are always in a single line, regardless of dwFormatStrType. + crypt32: Pass next data pointer when decoding a CRL dist point. + +Kai Blin (1): + advapi32: Implement LsaSetSecret stub. + +Ken Thomases (1): + ntdll: Don't poll() on a normal file; it should never block. + +Lei Zhang (2): + comctl32: Check for NULL input in TAB_AdjustRect. + quartz: Reaching a renderer in the filtergraph is not an error. + +Maarten Lankhorst (2): + Revert "quartz: Reaching a renderer in the filtergraph is not an error." + quartz: Fix FilterGraph2_Connect to be thread-safe and not recurse infinitely. + +Marcus Meissner (1): + shdocvw: Fixed buffer size to GetPrivateProfileStringW. + +Nicolas Le Cam (2): + winspool.drv/tests: Fix a test on all platforms. + crypt32/tests: Fix a failing test on win2000. + +Nikolay Sivov (3): + gdiplus: Added GdipGetTextContrast. + gdiplus: Added GdipSetTextContrast. + gdiplus: Return some token value on startup. + +Paul Chitescu (1): + user32: Unimplemented SystemParametersInfoW actions display fixme only once. + +Paul Vriens (25): + ole32/tests: Don't crash on NT4. + advapi32/tests: Fix valgrind warning. + urlmon/tests: Skip some tests on Win9x and WinMe. + urlmon/tests: Fix failures on Win9x and WinMe. + wininet/tests: Fix a test failure on some Win98 boxes. + msi/tests: Fix some test failures on Win9x and WinMe. + winmm/tests: Fix a test failure on Vista and W2K8. + setupapi/tests: Fix some failures on Win9x and WinMe. + ddraw/tests: Fix a typo. + ddraw/tests: Skip tests when DirectDraw4 is not supported. + snmpapi/tests: Fix failures on NT4 and below. + crypt32/tests: Skip some tests if needed. + crypt32/tests: Fix a test failure on Vista and W2K8. + gdi32/tests: Fix a few failures on Win9x and WinMe. + msi/tests: Skip some tests on Win9x and WinMe. + quartz/tests: Fix a few failures on Win95 and NT4. + setupapi/tests: Don't use hardcoded C: for the system drive. + kernel32/tests: Fix timeouts on NT4 and W2K. + msi/tests: Skip tests on win9x by checking functionality instead of registry keys. + user32/tests: Fix a test failure on Win9x, WinMe and NT4. + winetest: Give the 'Running' progress bar the same size as the others. + user32/tests: Don't crash on Win95. + comdlg32/tests 1/2: Fix a test failure on XP and W2K3. + comdlg32/tests 2/2: Fix a test failure on Win9x. + user32/tests: Fix a few test failures on Win9x. + +Peter Dons Tychsen (5): + winedos: Add support for decoding and displaying the 4 bit CGA framebuffer. + winedos: Add support for the Color Control Register (CGA). + winedos: Implement int10 CGA palette control. + winedos: Implement VGA_WritePixel for int10 service in CGA mode. + winedos: Implement mode control register, and the 160x200x4 display mode that it opens. + +Reece Dunn (2): + uxtheme: Add stubs for the double buffer drawing API in Vista. + uxtheme: Draw the correct part of the themed parent background to the DC. + +Ricardo Filipe (27): + appwiz.cpl: Added Portuguese translation. + browseui: Added Portuguese translation. + credui: Added Portuguese translation. + gphoto2.ds: Added Portuguese translation. + localspl: Added Portuguese translation. + localui: Added Portuguese translation. + msvidc32: Added Portuguese translation. + shdoclc: Added Portuguese translation. + wldap32: Added Portuguese translation. + hhctrl.ocx: Added Portuguese translation. + crypt32: Added Portuguese translation. + winspool.drv: Added Portuguese translation. + cabinet: Fix dead stores (llvm/clang). + dbghelp: Fixed dead store (llvm/clang). + gdi32: Fix dead store (llvm/clang). + iphlpapi: Fixed dead store (llvm/clang). + mlang: Fixed dead stores (llvm/clang). + oleaut32: Fixed dead increment (llvm/clang). + ntdll: Fixed dead store (llvm/clang). + rpcrt4: Fixed dead increments (llvm/clang). + msxml3: Check some dead store results (llvm/clang). + sane.ds: Check dead stored status (llvm/clang). + comctl32: Removed dead store (llvm/clang). + comctl32: Removed dead increment (llvm/clang). + comctl32: Removed dead increment (llvm/clang). + comctl32: Remove dead stores (llvm/clang). + atl: Remove dead store (llvm/clang). + +Roderick Colenbrander (1): + wined3d: Add two missing D3D8/D3D9 capabilities. + +Ryan Schmidt (1): + jscript: Fix build with bison 2.4. + +Stefan Dösinger (3): + wined3d: Make sure the arbfp pipeline replacement constants are loaded. + d3d9: Test psize_min vs psize_max vs psize behavior. + wined3d: Rename the fragment ffp desc structures. + +Tony Wasserka (3): + d3dx9: Implement ID3DXSprite_Begin/End. + d3dx9: Implement ID3DXSprite_Flush. + d3dx9: Implement ID3DXSprite_GetDevice. + +Vincent Povirk (4): + msiexec: Build with -mwindows. + comctl32: Do not repaint on TBM_SETPOS if position is unchanged. + gdiplus: Fix GdipFlattenPath for already-flat paths and add a test. + gdiplus: Restore a line I removed by mistake. + +Vitaliy Margolen (1): + user32/tests: Print line numbers of callers in check_wnd_state to help debugging. + +-- +Alexandre Julliard +julliard@winehq.org diff --git a/VERSION b/VERSION index d678b44ee2e..0af4e4629b7 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Wine version 1.1.8 +Wine version 1.1.9 diff --git a/configure b/configure index 7da6be86c9e..7deec909677 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.8. +# Generated by GNU Autoconf 2.61 for Wine 1.1.9. # # 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.8' -PACKAGE_STRING='Wine 1.1.8' +PACKAGE_VERSION='1.1.9' +PACKAGE_STRING='Wine 1.1.9' PACKAGE_BUGREPORT='wine-devel@winehq.org' ac_unique_file="server/atom.c" @@ -740,7 +740,6 @@ CROSSTEST NASLIBS XML2LIBS XML2INCL -XSLTLIBS XSLTINCL HALINCL GNUTLSINCL @@ -1307,7 +1306,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.8 to adapt to many kinds of systems. +\`configure' configures Wine 1.1.9 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1376,7 +1375,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of Wine 1.1.8:";; + short | recursive ) echo "Configuration of Wine 1.1.9:";; esac cat <<\_ACEOF @@ -1386,6 +1385,7 @@ Optional Features: --disable-win16 do not include Win16 support --enable-win64 build a Win64 emulator on AMD64 (won't run Win32 binaries) + --disable-tests do not build the regression tests --enable-maintainer-mode enable maintainer-specific build rules --disable-tests do not build the testsuites @@ -1508,7 +1508,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -Wine configure 1.1.8 +Wine configure 1.1.9 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1522,7 +1522,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.8, which was +It was created by Wine $as_me 1.1.9, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -1921,6 +1921,11 @@ if test "${enable_win64+set}" = set; then enableval=$enable_win64; fi +# Check whether --enable-tests was given. +if test "${enable_tests+set}" = set; then + enableval=$enable_tests; +fi + # Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval=$enable_maintainer_mode; @@ -11810,8 +11815,6 @@ XML2LIBS="" XML2INCL="" -XSLTLIBS="" - XSLTINCL="" if test "x$with_xml" != "xno" @@ -12271,14 +12274,14 @@ done CPPFLAGS="$ac_save_CPPFLAGS" if test "$ac_cv_header_libxslt_transform_h" = "yes" then - { echo "$as_me:$LINENO: checking for xsltCompilePattern in -lxslt" >&5 -echo $ECHO_N "checking for xsltCompilePattern in -lxslt... $ECHO_C" >&6; } -if test "${ac_cv_lib_xslt_xsltCompilePattern+set}" = set; then + { echo "$as_me:$LINENO: checking for -lxslt" >&5 +echo $ECHO_N "checking for -lxslt... $ECHO_C" >&6; } +if test "${ac_cv_lib_soname_xslt+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_check_lib_save_LIBS=$LIBS + ac_check_soname_save_LIBS=$LIBS LIBS="-lxslt $ac_xslt_libs $LIBS" -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -12318,130 +12321,40 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_lib_xslt_xsltCompilePattern=yes + case "$LIBEXT" in + dll) ;; + dylib) ac_cv_lib_soname_xslt=`otool -L conftest$ac_exeext | grep "libxslt\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libxslt\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; + *) ac_cv_lib_soname_xslt=`$ac_cv_path_LDD conftest$ac_exeext | grep "libxslt\\.$LIBEXT" | sed -e "s/^.*\(libxslt\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` ;; + esac else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_xslt_xsltCompilePattern=no + fi rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + LIBS=$ac_check_soname_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_xslt_xsltCompilePattern" >&5 -echo "${ECHO_T}$ac_cv_lib_xslt_xsltCompilePattern" >&6; } -if test $ac_cv_lib_xslt_xsltCompilePattern = yes; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_LIBXSLT 1 -_ACEOF - - XSLTLIBS="$ac_xslt_libs" - XSLTINCL="$ac_xslt_cflags" - ac_save_LIBS="$LIBS" - LIBS="$LIBS $ac_xslt_libs" - -for ac_func in xsltInit -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+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. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif +if test "x$ac_cv_lib_soname_xslt" = "x"; then + { echo "$as_me:$LINENO: result: not found" >&5 +echo "${ECHO_T}not found" >&6; } -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -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_link") 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_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + { echo "$as_me:$LINENO: result: $ac_cv_lib_soname_xslt" >&5 +echo "${ECHO_T}$ac_cv_lib_soname_xslt" >&6; } - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +cat >>confdefs.h <<_ACEOF +#define SONAME_LIBXSLT "$ac_cv_lib_soname_xslt" _ACEOF -fi -done - - LIBS="$ac_save_LIBS" + XSLTINCL="$ac_xslt_cflags" fi fi fi -if test "$ac_cv_lib_xslt_xsltCompilePattern" != "yes"; then +if test "x$ac_cv_lib_soname_xslt" = "x"; then case "x$with_xslt" in x) wine_warnings="$wine_warnings|libxslt ${notice_platform}development files not found, xslt won't be supported." ;; xno) ;; @@ -22719,7 +22632,7 @@ ac_config_files="$ac_config_files dlls/advapi32/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/advapi32/tests/Makefile" -test "x$enable_advapi32_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ advapi32/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/advapi32/tests/Makefile: dlls/advapi32/tests/Makefile.in dlls/Maketest.rules" @@ -22735,7 +22648,7 @@ ac_config_files="$ac_config_files dlls/advpack/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/advpack/tests/Makefile" -test "x$enable_advpack_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ advpack/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/advpack/tests/Makefile: dlls/advpack/tests/Makefile.in dlls/Maketest.rules" @@ -22791,7 +22704,7 @@ ac_config_files="$ac_config_files dlls/browseui/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/browseui/tests/Makefile" -test "x$enable_browseui_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ browseui/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/browseui/tests/Makefile: dlls/browseui/tests/Makefile.in dlls/Maketest.rules" @@ -22807,7 +22720,7 @@ ac_config_files="$ac_config_files dlls/cabinet/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/cabinet/tests/Makefile" -test "x$enable_cabinet_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ cabinet/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/cabinet/tests/Makefile: dlls/cabinet/tests/Makefile.in dlls/Maketest.rules" @@ -22855,7 +22768,7 @@ ac_config_files="$ac_config_files dlls/comcat/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/comcat/tests/Makefile" -test "x$enable_comcat_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ comcat/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/comcat/tests/Makefile: dlls/comcat/tests/Makefile.in dlls/Maketest.rules" @@ -22871,7 +22784,7 @@ ac_config_files="$ac_config_files dlls/comctl32/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/comctl32/tests/Makefile" -test "x$enable_comctl32_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ comctl32/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/comctl32/tests/Makefile: dlls/comctl32/tests/Makefile.in dlls/Maketest.rules" @@ -22887,7 +22800,7 @@ ac_config_files="$ac_config_files dlls/comdlg32/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/comdlg32/tests/Makefile" -test "x$enable_comdlg32_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ comdlg32/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/comdlg32/tests/Makefile: dlls/comdlg32/tests/Makefile.in dlls/Maketest.rules" @@ -22911,7 +22824,7 @@ ac_config_files="$ac_config_files dlls/credui/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/credui/tests/Makefile" -test "x$enable_credui_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ credui/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/credui/tests/Makefile: dlls/credui/tests/Makefile.in dlls/Maketest.rules" @@ -22935,7 +22848,7 @@ ac_config_files="$ac_config_files dlls/crypt32/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/crypt32/tests/Makefile" -test "x$enable_crypt32_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ crypt32/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/crypt32/tests/Makefile: dlls/crypt32/tests/Makefile.in dlls/Maketest.rules" @@ -22967,7 +22880,7 @@ ac_config_files="$ac_config_files dlls/cryptnet/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/cryptnet/tests/Makefile" -test "x$enable_cryptnet_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ cryptnet/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/cryptnet/tests/Makefile: dlls/cryptnet/tests/Makefile.in dlls/Maketest.rules" @@ -22983,7 +22896,7 @@ ac_config_files="$ac_config_files dlls/cryptui/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/cryptui/tests/Makefile" -test "x$enable_cryptui_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ cryptui/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/cryptui/tests/Makefile: dlls/cryptui/tests/Makefile.in dlls/Maketest.rules" @@ -23015,7 +22928,7 @@ ac_config_files="$ac_config_files dlls/d3d10/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/d3d10/tests/Makefile" -test "x$enable_d3d10_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ d3d10/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/d3d10/tests/Makefile: dlls/d3d10/tests/Makefile.in dlls/Maketest.rules" @@ -23030,6 +22943,14 @@ dlls/d3d10core/Makefile: dlls/d3d10core/Makefile.in dlls/Makedll.rules" ac_config_files="$ac_config_files dlls/d3d10core/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ + dlls/d3d10core/tests/Makefile" +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ + d3d10core/tests" +ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS +dlls/d3d10core/tests/Makefile: dlls/d3d10core/tests/Makefile.in dlls/Maketest.rules" +ac_config_files="$ac_config_files dlls/d3d10core/tests/Makefile" + +ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/d3d8/Makefile" test "x$enable_d3d8" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\ d3d8" @@ -23039,7 +22960,7 @@ ac_config_files="$ac_config_files dlls/d3d8/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/d3d8/tests/Makefile" -test "x$enable_d3d8_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ d3d8/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/d3d8/tests/Makefile: dlls/d3d8/tests/Makefile.in dlls/Maketest.rules" @@ -23055,7 +22976,7 @@ ac_config_files="$ac_config_files dlls/d3d9/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/d3d9/tests/Makefile" -test "x$enable_d3d9_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ d3d9/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/d3d9/tests/Makefile: dlls/d3d9/tests/Makefile.in dlls/Maketest.rules" @@ -23079,7 +23000,7 @@ ac_config_files="$ac_config_files dlls/d3drm/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/d3drm/tests/Makefile" -test "x$enable_d3drm_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ d3drm/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/d3drm/tests/Makefile: dlls/d3drm/tests/Makefile.in dlls/Maketest.rules" @@ -23095,7 +23016,7 @@ ac_config_files="$ac_config_files dlls/d3dx8/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/d3dx8/tests/Makefile" -test "x$enable_d3dx8_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ d3dx8/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/d3dx8/tests/Makefile: dlls/d3dx8/tests/Makefile.in dlls/Maketest.rules" @@ -23207,7 +23128,7 @@ ac_config_files="$ac_config_files dlls/d3dx9_36/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/d3dx9_36/tests/Makefile" -test "x$enable_d3dx9_36_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ d3dx9_36/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/d3dx9_36/tests/Makefile: dlls/d3dx9_36/tests/Makefile.in dlls/Maketest.rules" @@ -23231,7 +23152,7 @@ ac_config_files="$ac_config_files dlls/d3dxof/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/d3dxof/tests/Makefile" -test "x$enable_d3dxof_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ d3dxof/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/d3dxof/tests/Makefile: dlls/d3dxof/tests/Makefile.in dlls/Maketest.rules" @@ -23263,7 +23184,7 @@ ac_config_files="$ac_config_files dlls/ddraw/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/ddraw/tests/Makefile" -test "x$enable_ddraw_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ ddraw/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/ddraw/tests/Makefile: dlls/ddraw/tests/Makefile.in dlls/Maketest.rules" @@ -23295,7 +23216,7 @@ ac_config_files="$ac_config_files dlls/dinput/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/dinput/tests/Makefile" -test "x$enable_dinput_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ dinput/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/dinput/tests/Makefile: dlls/dinput/tests/Makefile.in dlls/Maketest.rules" @@ -23391,7 +23312,7 @@ ac_config_files="$ac_config_files dlls/dnsapi/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/dnsapi/tests/Makefile" -test "x$enable_dnsapi_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ dnsapi/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/dnsapi/tests/Makefile: dlls/dnsapi/tests/Makefile.in dlls/Maketest.rules" @@ -23415,7 +23336,7 @@ ac_config_files="$ac_config_files dlls/dplayx/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/dplayx/tests/Makefile" -test "x$enable_dplayx_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ dplayx/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/dplayx/tests/Makefile: dlls/dplayx/tests/Makefile.in dlls/Maketest.rules" @@ -23471,7 +23392,7 @@ ac_config_files="$ac_config_files dlls/dsound/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/dsound/tests/Makefile" -test "x$enable_dsound_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ dsound/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/dsound/tests/Makefile: dlls/dsound/tests/Makefile.in dlls/Maketest.rules" @@ -23534,6 +23455,14 @@ dlls/dxgi/Makefile: dlls/dxgi/Makefile.in dlls/Makedll.rules" ac_config_files="$ac_config_files dlls/dxgi/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ + dlls/dxgi/tests/Makefile" +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ + dxgi/tests" +ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS +dlls/dxgi/tests/Makefile: dlls/dxgi/tests/Makefile.in dlls/Maketest.rules" +ac_config_files="$ac_config_files dlls/dxgi/tests/Makefile" + +ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/dxguid/Makefile" test "x$enable_dxguid" != xno && ALL_IMPLIB_DIRS="$ALL_IMPLIB_DIRS \\ dxguid" @@ -23559,7 +23488,7 @@ ac_config_files="$ac_config_files dlls/fusion/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/fusion/tests/Makefile" -test "x$enable_fusion_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ fusion/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/fusion/tests/Makefile: dlls/fusion/tests/Makefile.in dlls/Maketest.rules" @@ -23575,7 +23504,7 @@ ac_config_files="$ac_config_files dlls/gdi32/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/gdi32/tests/Makefile" -test "x$enable_gdi32_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ gdi32/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/gdi32/tests/Makefile: dlls/gdi32/tests/Makefile.in dlls/Maketest.rules" @@ -23591,7 +23520,7 @@ ac_config_files="$ac_config_files dlls/gdiplus/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/gdiplus/tests/Makefile" -test "x$enable_gdiplus_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ gdiplus/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/gdiplus/tests/Makefile: dlls/gdiplus/tests/Makefile.in dlls/Maketest.rules" @@ -23655,7 +23584,7 @@ ac_config_files="$ac_config_files dlls/hlink/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/hlink/tests/Makefile" -test "x$enable_hlink_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ hlink/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/hlink/tests/Makefile: dlls/hlink/tests/Makefile.in dlls/Maketest.rules" @@ -23719,7 +23648,7 @@ ac_config_files="$ac_config_files dlls/imm32/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/imm32/tests/Makefile" -test "x$enable_imm32_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ imm32/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/imm32/tests/Makefile: dlls/imm32/tests/Makefile.in dlls/Maketest.rules" @@ -23735,7 +23664,7 @@ ac_config_files="$ac_config_files dlls/inetcomm/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/inetcomm/tests/Makefile" -test "x$enable_inetcomm_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ inetcomm/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/inetcomm/tests/Makefile: dlls/inetcomm/tests/Makefile.in dlls/Maketest.rules" @@ -23751,7 +23680,7 @@ ac_config_files="$ac_config_files dlls/inetmib1/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/inetmib1/tests/Makefile" -test "x$enable_inetmib1_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ inetmib1/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/inetmib1/tests/Makefile: dlls/inetmib1/tests/Makefile.in dlls/Maketest.rules" @@ -23767,7 +23696,7 @@ ac_config_files="$ac_config_files dlls/infosoft/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/infosoft/tests/Makefile" -test "x$enable_infosoft_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ infosoft/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/infosoft/tests/Makefile: dlls/infosoft/tests/Makefile.in dlls/Maketest.rules" @@ -23807,7 +23736,7 @@ ac_config_files="$ac_config_files dlls/iphlpapi/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/iphlpapi/tests/Makefile" -test "x$enable_iphlpapi_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ iphlpapi/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/iphlpapi/tests/Makefile: dlls/iphlpapi/tests/Makefile.in dlls/Maketest.rules" @@ -23831,7 +23760,7 @@ ac_config_files="$ac_config_files dlls/itss/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/itss/tests/Makefile" -test "x$enable_itss_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ itss/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/itss/tests/Makefile: dlls/itss/tests/Makefile.in dlls/Maketest.rules" @@ -23847,7 +23776,7 @@ ac_config_files="$ac_config_files dlls/jscript/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/jscript/tests/Makefile" -test "x$enable_jscript_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ jscript/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/jscript/tests/Makefile: dlls/jscript/tests/Makefile.in dlls/Maketest.rules" @@ -23863,7 +23792,7 @@ ac_config_files="$ac_config_files dlls/kernel32/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/kernel32/tests/Makefile" -test "x$enable_kernel32_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ kernel32/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/kernel32/tests/Makefile: dlls/kernel32/tests/Makefile.in dlls/Maketest.rules" @@ -23879,7 +23808,7 @@ ac_config_files="$ac_config_files dlls/localspl/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/localspl/tests/Makefile" -test "x$enable_localspl_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ localspl/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/localspl/tests/Makefile: dlls/localspl/tests/Makefile.in dlls/Maketest.rules" @@ -23895,7 +23824,7 @@ ac_config_files="$ac_config_files dlls/localui/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/localui/tests/Makefile" -test "x$enable_localui_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ localui/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/localui/tests/Makefile: dlls/localui/tests/Makefile.in dlls/Maketest.rules" @@ -23911,7 +23840,7 @@ ac_config_files="$ac_config_files dlls/lz32/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/lz32/tests/Makefile" -test "x$enable_lz32_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ lz32/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/lz32/tests/Makefile: dlls/lz32/tests/Makefile.in dlls/Maketest.rules" @@ -23927,7 +23856,7 @@ ac_config_files="$ac_config_files dlls/mapi32/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/mapi32/tests/Makefile" -test "x$enable_mapi32_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ mapi32/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/mapi32/tests/Makefile: dlls/mapi32/tests/Makefile.in dlls/Maketest.rules" @@ -23983,7 +23912,7 @@ ac_config_files="$ac_config_files dlls/mlang/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/mlang/tests/Makefile" -test "x$enable_mlang_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ mlang/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/mlang/tests/Makefile: dlls/mlang/tests/Makefile.in dlls/Maketest.rules" @@ -24047,7 +23976,7 @@ ac_config_files="$ac_config_files dlls/msacm32/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/msacm32/tests/Makefile" -test "x$enable_msacm32_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ msacm32/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/msacm32/tests/Makefile: dlls/msacm32/tests/Makefile.in dlls/Maketest.rules" @@ -24079,7 +24008,7 @@ ac_config_files="$ac_config_files dlls/mscms/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/mscms/tests/Makefile" -test "x$enable_mscms_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ mscms/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/mscms/tests/Makefile: dlls/mscms/tests/Makefile.in dlls/Maketest.rules" @@ -24135,7 +24064,7 @@ ac_config_files="$ac_config_files dlls/mshtml/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/mshtml/tests/Makefile" -test "x$enable_mshtml_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ mshtml/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/mshtml/tests/Makefile: dlls/mshtml/tests/Makefile.in dlls/Maketest.rules" @@ -24151,7 +24080,7 @@ ac_config_files="$ac_config_files dlls/msi/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/msi/tests/Makefile" -test "x$enable_msi_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ msi/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/msi/tests/Makefile: dlls/msi/tests/Makefile.in dlls/Maketest.rules" @@ -24223,7 +24152,7 @@ ac_config_files="$ac_config_files dlls/mstask/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/mstask/tests/Makefile" -test "x$enable_mstask_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ mstask/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/mstask/tests/Makefile: dlls/mstask/tests/Makefile.in dlls/Maketest.rules" @@ -24255,7 +24184,7 @@ ac_config_files="$ac_config_files dlls/msvcrt/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/msvcrt/tests/Makefile" -test "x$enable_msvcrt_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ msvcrt/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/msvcrt/tests/Makefile: dlls/msvcrt/tests/Makefile.in dlls/Maketest.rules" @@ -24287,7 +24216,7 @@ ac_config_files="$ac_config_files dlls/msvcrtd/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/msvcrtd/tests/Makefile" -test "x$enable_msvcrtd_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ msvcrtd/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/msvcrtd/tests/Makefile: dlls/msvcrtd/tests/Makefile.in dlls/Maketest.rules" @@ -24327,7 +24256,7 @@ ac_config_files="$ac_config_files dlls/msxml3/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/msxml3/tests/Makefile" -test "x$enable_msxml3_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ msxml3/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/msxml3/tests/Makefile: dlls/msxml3/tests/Makefile.in dlls/Maketest.rules" @@ -24351,7 +24280,7 @@ ac_config_files="$ac_config_files dlls/netapi32/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/netapi32/tests/Makefile" -test "x$enable_netapi32_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ netapi32/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/netapi32/tests/Makefile: dlls/netapi32/tests/Makefile.in dlls/Maketest.rules" @@ -24375,7 +24304,7 @@ ac_config_files="$ac_config_files dlls/ntdll/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/ntdll/tests/Makefile" -test "x$enable_ntdll_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ ntdll/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/ntdll/tests/Makefile: dlls/ntdll/tests/Makefile.in dlls/Maketest.rules" @@ -24391,7 +24320,7 @@ ac_config_files="$ac_config_files dlls/ntdsapi/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/ntdsapi/tests/Makefile" -test "x$enable_ntdsapi_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ ntdsapi/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/ntdsapi/tests/Makefile: dlls/ntdsapi/tests/Makefile.in dlls/Maketest.rules" @@ -24415,7 +24344,7 @@ ac_config_files="$ac_config_files dlls/ntprint/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/ntprint/tests/Makefile" -test "x$enable_ntprint_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ ntprint/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/ntprint/tests/Makefile: dlls/ntprint/tests/Makefile.in dlls/Maketest.rules" @@ -24447,7 +24376,7 @@ ac_config_files="$ac_config_files dlls/odbccp32/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/odbccp32/tests/Makefile" -test "x$enable_odbccp32_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ odbccp32/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/odbccp32/tests/Makefile: dlls/odbccp32/tests/Makefile.in dlls/Maketest.rules" @@ -24463,7 +24392,7 @@ ac_config_files="$ac_config_files dlls/ole32/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/ole32/tests/Makefile" -test "x$enable_ole32_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ ole32/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/ole32/tests/Makefile: dlls/ole32/tests/Makefile.in dlls/Maketest.rules" @@ -24479,7 +24408,7 @@ ac_config_files="$ac_config_files dlls/oleacc/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/oleacc/tests/Makefile" -test "x$enable_oleacc_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ oleacc/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/oleacc/tests/Makefile: dlls/oleacc/tests/Makefile.in dlls/Maketest.rules" @@ -24495,7 +24424,7 @@ ac_config_files="$ac_config_files dlls/oleaut32/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/oleaut32/tests/Makefile" -test "x$enable_oleaut32_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ oleaut32/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/oleaut32/tests/Makefile: dlls/oleaut32/tests/Makefile.in dlls/Maketest.rules" @@ -24551,7 +24480,7 @@ ac_config_files="$ac_config_files dlls/opengl32/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/opengl32/tests/Makefile" -test "x$enable_opengl32_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ opengl32/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/opengl32/tests/Makefile: dlls/opengl32/tests/Makefile.in dlls/Maketest.rules" @@ -24567,7 +24496,7 @@ ac_config_files="$ac_config_files dlls/pdh/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/pdh/tests/Makefile" -test "x$enable_pdh_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ pdh/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/pdh/tests/Makefile: dlls/pdh/tests/Makefile.in dlls/Maketest.rules" @@ -24607,7 +24536,7 @@ ac_config_files="$ac_config_files dlls/psapi/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/psapi/tests/Makefile" -test "x$enable_psapi_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ psapi/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/psapi/tests/Makefile: dlls/psapi/tests/Makefile.in dlls/Maketest.rules" @@ -24639,7 +24568,7 @@ ac_config_files="$ac_config_files dlls/qedit/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/qedit/tests/Makefile" -test "x$enable_qedit_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ qedit/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/qedit/tests/Makefile: dlls/qedit/tests/Makefile.in dlls/Maketest.rules" @@ -24655,7 +24584,7 @@ ac_config_files="$ac_config_files dlls/qmgr/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/qmgr/tests/Makefile" -test "x$enable_qmgr_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ qmgr/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/qmgr/tests/Makefile: dlls/qmgr/tests/Makefile.in dlls/Maketest.rules" @@ -24679,7 +24608,7 @@ ac_config_files="$ac_config_files dlls/quartz/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/quartz/tests/Makefile" -test "x$enable_quartz_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ quartz/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/quartz/tests/Makefile: dlls/quartz/tests/Makefile.in dlls/Maketest.rules" @@ -24703,7 +24632,7 @@ ac_config_files="$ac_config_files dlls/rasapi32/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/rasapi32/tests/Makefile" -test "x$enable_rasapi32_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ rasapi32/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/rasapi32/tests/Makefile: dlls/rasapi32/tests/Makefile.in dlls/Maketest.rules" @@ -24727,7 +24656,7 @@ ac_config_files="$ac_config_files dlls/riched20/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/riched20/tests/Makefile" -test "x$enable_riched20_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ riched20/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/riched20/tests/Makefile: dlls/riched20/tests/Makefile.in dlls/Maketest.rules" @@ -24743,7 +24672,7 @@ ac_config_files="$ac_config_files dlls/riched32/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/riched32/tests/Makefile" -test "x$enable_riched32_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ riched32/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/riched32/tests/Makefile: dlls/riched32/tests/Makefile.in dlls/Maketest.rules" @@ -24759,7 +24688,7 @@ ac_config_files="$ac_config_files dlls/rpcrt4/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/rpcrt4/tests/Makefile" -test "x$enable_rpcrt4_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ rpcrt4/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/rpcrt4/tests/Makefile: dlls/rpcrt4/tests/Makefile.in dlls/Maketest.rules" @@ -24783,7 +24712,7 @@ ac_config_files="$ac_config_files dlls/rsaenh/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/rsaenh/tests/Makefile" -test "x$enable_rsaenh_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ rsaenh/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/rsaenh/tests/Makefile: dlls/rsaenh/tests/Makefile.in dlls/Maketest.rules" @@ -24815,7 +24744,7 @@ ac_config_files="$ac_config_files dlls/schannel/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/schannel/tests/Makefile" -test "x$enable_schannel_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ schannel/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/schannel/tests/Makefile: dlls/schannel/tests/Makefile.in dlls/Maketest.rules" @@ -24831,7 +24760,7 @@ ac_config_files="$ac_config_files dlls/secur32/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/secur32/tests/Makefile" -test "x$enable_secur32_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ secur32/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/secur32/tests/Makefile: dlls/secur32/tests/Makefile.in dlls/Maketest.rules" @@ -24863,7 +24792,7 @@ ac_config_files="$ac_config_files dlls/serialui/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/serialui/tests/Makefile" -test "x$enable_serialui_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ serialui/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/serialui/tests/Makefile: dlls/serialui/tests/Makefile.in dlls/Maketest.rules" @@ -24879,7 +24808,7 @@ ac_config_files="$ac_config_files dlls/setupapi/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/setupapi/tests/Makefile" -test "x$enable_setupapi_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ setupapi/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/setupapi/tests/Makefile: dlls/setupapi/tests/Makefile.in dlls/Maketest.rules" @@ -24919,7 +24848,7 @@ ac_config_files="$ac_config_files dlls/shdocvw/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/shdocvw/tests/Makefile" -test "x$enable_shdocvw_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ shdocvw/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/shdocvw/tests/Makefile: dlls/shdocvw/tests/Makefile.in dlls/Maketest.rules" @@ -24935,7 +24864,7 @@ ac_config_files="$ac_config_files dlls/shell32/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/shell32/tests/Makefile" -test "x$enable_shell32_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ shell32/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/shell32/tests/Makefile: dlls/shell32/tests/Makefile.in dlls/Maketest.rules" @@ -24959,7 +24888,7 @@ ac_config_files="$ac_config_files dlls/shlwapi/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/shlwapi/tests/Makefile" -test "x$enable_shlwapi_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ shlwapi/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/shlwapi/tests/Makefile: dlls/shlwapi/tests/Makefile.in dlls/Maketest.rules" @@ -24991,7 +24920,7 @@ ac_config_files="$ac_config_files dlls/snmpapi/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/snmpapi/tests/Makefile" -test "x$enable_snmpapi_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ snmpapi/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/snmpapi/tests/Makefile: dlls/snmpapi/tests/Makefile.in dlls/Maketest.rules" @@ -25015,7 +24944,7 @@ ac_config_files="$ac_config_files dlls/spoolss/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/spoolss/tests/Makefile" -test "x$enable_spoolss_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ spoolss/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/spoolss/tests/Makefile: dlls/spoolss/tests/Makefile.in dlls/Maketest.rules" @@ -25111,7 +25040,7 @@ ac_config_files="$ac_config_files dlls/urlmon/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/urlmon/tests/Makefile" -test "x$enable_urlmon_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ urlmon/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/urlmon/tests/Makefile: dlls/urlmon/tests/Makefile.in dlls/Maketest.rules" @@ -25127,7 +25056,7 @@ ac_config_files="$ac_config_files dlls/user32/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/user32/tests/Makefile" -test "x$enable_user32_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ user32/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/user32/tests/Makefile: dlls/user32/tests/Makefile.in dlls/Maketest.rules" @@ -25143,7 +25072,7 @@ ac_config_files="$ac_config_files dlls/userenv/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/userenv/tests/Makefile" -test "x$enable_userenv_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ userenv/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/userenv/tests/Makefile: dlls/userenv/tests/Makefile.in dlls/Maketest.rules" @@ -25159,7 +25088,7 @@ ac_config_files="$ac_config_files dlls/usp10/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/usp10/tests/Makefile" -test "x$enable_usp10_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ usp10/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/usp10/tests/Makefile: dlls/usp10/tests/Makefile.in dlls/Maketest.rules" @@ -25183,7 +25112,7 @@ ac_config_files="$ac_config_files dlls/uxtheme/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/uxtheme/tests/Makefile" -test "x$enable_uxtheme_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ uxtheme/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/uxtheme/tests/Makefile: dlls/uxtheme/tests/Makefile.in dlls/Maketest.rules" @@ -25215,7 +25144,7 @@ ac_config_files="$ac_config_files dlls/version/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/version/tests/Makefile" -test "x$enable_version_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ version/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/version/tests/Makefile: dlls/version/tests/Makefile.in dlls/Maketest.rules" @@ -25415,7 +25344,7 @@ ac_config_files="$ac_config_files dlls/winhttp/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/winhttp/tests/Makefile" -test "x$enable_winhttp_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ winhttp/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/winhttp/tests/Makefile: dlls/winhttp/tests/Makefile.in dlls/Maketest.rules" @@ -25431,7 +25360,7 @@ ac_config_files="$ac_config_files dlls/wininet/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/wininet/tests/Makefile" -test "x$enable_wininet_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ wininet/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/wininet/tests/Makefile: dlls/wininet/tests/Makefile.in dlls/Maketest.rules" @@ -25447,7 +25376,7 @@ ac_config_files="$ac_config_files dlls/winmm/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/winmm/tests/Makefile" -test "x$enable_winmm_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ winmm/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/winmm/tests/Makefile: dlls/winmm/tests/Makefile.in dlls/Maketest.rules" @@ -25479,7 +25408,7 @@ ac_config_files="$ac_config_files dlls/winspool.drv/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/winspool.drv/tests/Makefile" -test "x$enable_winspool_drv_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ winspool.drv/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/winspool.drv/tests/Makefile: dlls/winspool.drv/tests/Makefile.in dlls/Maketest.rules" @@ -25503,7 +25432,7 @@ ac_config_files="$ac_config_files dlls/wintrust/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/wintrust/tests/Makefile" -test "x$enable_wintrust_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ wintrust/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/wintrust/tests/Makefile: dlls/wintrust/tests/Makefile.in dlls/Maketest.rules" @@ -25519,7 +25448,7 @@ ac_config_files="$ac_config_files dlls/wldap32/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/wldap32/tests/Makefile" -test "x$enable_wldap32_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ wldap32/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/wldap32/tests/Makefile: dlls/wldap32/tests/Makefile.in dlls/Maketest.rules" @@ -25559,7 +25488,7 @@ ac_config_files="$ac_config_files dlls/ws2_32/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/ws2_32/tests/Makefile" -test "x$enable_ws2_32_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ ws2_32/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/ws2_32/tests/Makefile: dlls/ws2_32/tests/Makefile.in dlls/Maketest.rules" @@ -25607,7 +25536,7 @@ ac_config_files="$ac_config_files dlls/xinput1_3/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/xinput1_3/tests/Makefile" -test "x$enable_xinput1_3_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ +test "x$enable_tests" != xno && ALL_TEST_DIRS="$ALL_TEST_DIRS \\ xinput1_3/tests" ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/xinput1_3/tests/Makefile: dlls/xinput1_3/tests/Makefile.in dlls/Maketest.rules" @@ -26581,7 +26510,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.8, which was +This file was extended by Wine $as_me 1.1.9, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -26634,7 +26563,7 @@ Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -Wine config.status 1.1.8 +Wine config.status 1.1.9 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" @@ -26801,6 +26730,7 @@ do "dlls/d3d10/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/d3d10/Makefile" ;; "dlls/d3d10/tests/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/d3d10/tests/Makefile" ;; "dlls/d3d10core/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/d3d10core/Makefile" ;; + "dlls/d3d10core/tests/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/d3d10core/tests/Makefile" ;; "dlls/d3d8/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/d3d8/Makefile" ;; "dlls/d3d8/tests/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/d3d8/tests/Makefile" ;; "dlls/d3d9/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/d3d9/Makefile" ;; @@ -26864,6 +26794,7 @@ do "dlls/dxerr8/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/dxerr8/Makefile" ;; "dlls/dxerr9/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/dxerr9/Makefile" ;; "dlls/dxgi/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/dxgi/Makefile" ;; + "dlls/dxgi/tests/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/dxgi/tests/Makefile" ;; "dlls/dxguid/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/dxguid/Makefile" ;; "dlls/faultrep/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/faultrep/Makefile" ;; "dlls/fusion/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/fusion/Makefile" ;; @@ -27440,7 +27371,6 @@ CROSSTEST!$CROSSTEST$ac_delim NASLIBS!$NASLIBS$ac_delim XML2LIBS!$XML2LIBS$ac_delim XML2INCL!$XML2INCL$ac_delim -XSLTLIBS!$XSLTLIBS$ac_delim XSLTINCL!$XSLTINCL$ac_delim HALINCL!$HALINCL$ac_delim GNUTLSINCL!$GNUTLSINCL$ac_delim @@ -27489,7 +27419,7 @@ LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 90; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 89; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 diff --git a/configure.ac b/configure.ac index 783ef9963e1..a36cde937be 100644 --- a/configure.ac +++ b/configure.ac @@ -15,6 +15,7 @@ dnl **** Command-line arguments **** AC_ARG_ENABLE(win16, AS_HELP_STRING([--disable-win16],[do not include Win16 support])) AC_ARG_ENABLE(win64, AS_HELP_STRING([--enable-win64],[build a Win64 emulator on AMD64 (won't run Win32 binaries)])) +AC_ARG_ENABLE(tests, AS_HELP_STRING([--disable-tests],[do not build the regression tests])) AC_ARG_ENABLE(maintainer-mode, AS_HELP_STRING([--enable-maintainer-mode],[enable maintainer-specific build rules]), ,[AC_SUBST([MAINTAINER_MODE],[\#])]) @@ -843,7 +844,6 @@ dnl **** Check for libxml2 **** AC_SUBST(XML2LIBS,"") AC_SUBST(XML2INCL,"") -AC_SUBST(XSLTLIBS,"") AC_SUBST(XSLTINCL,"") if test "x$with_xml" != "xno" then @@ -891,17 +891,11 @@ then CPPFLAGS="$ac_save_CPPFLAGS" if test "$ac_cv_header_libxslt_transform_h" = "yes" then - AC_CHECK_LIB(xslt, xsltCompilePattern, - [AC_DEFINE(HAVE_LIBXSLT, 1, [Define if you have the libxslt library]) - XSLTLIBS="$ac_xslt_libs" - XSLTINCL="$ac_xslt_cflags" - ac_save_LIBS="$LIBS" - LIBS="$LIBS $ac_xslt_libs" - AC_CHECK_FUNCS(xsltInit) - LIBS="$ac_save_LIBS"],,$ac_xslt_libs) + WINE_CHECK_SONAME(xslt,xsltCompilePattern, + [XSLTINCL="$ac_xslt_cflags"],,[$ac_xslt_libs]) fi fi -WINE_WARNING_WITH(xslt,[test "$ac_cv_lib_xslt_xsltCompilePattern" != "yes"], +WINE_WARNING_WITH(xslt,[test "x$ac_cv_lib_soname_xslt" = "x"], [libxslt ${notice_platform}development files not found, xslt won't be supported.]) dnl **** Check for libhal **** @@ -1771,54 +1765,55 @@ WINE_CONFIG_MAKEFILE([dlls/activeds/Makefile],[dlls/Makedll.rules],[dlls],[ALL_D WINE_CONFIG_MAKEFILE([dlls/actxprxy/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/adsiid/Makefile],[dlls/Makeimplib.rules],[dlls],[ALL_IMPLIB_DIRS]) WINE_CONFIG_MAKEFILE([dlls/advapi32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/advapi32/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/advapi32/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/advpack/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/advpack/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/advpack/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/amstream/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/appwiz.cpl/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/atl/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/avicap32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/avifil32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/browseui/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/browseui/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/browseui/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/cabinet/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/cabinet/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/cabinet/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/capi2032/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/cards/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/cfgmgr32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/clusapi/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/comcat/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/comcat/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/comcat/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/comctl32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/comctl32/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/comctl32/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/comdlg32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/comdlg32/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/comdlg32/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/compstui/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/credui/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/credui/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/credui/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/crtdll/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/crypt32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/crypt32/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/crypt32/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/cryptdlg/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/cryptdll/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/cryptnet/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/cryptnet/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/cryptnet/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/cryptui/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/cryptui/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/cryptui/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/ctapi32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/ctl3d32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/d3d10/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/d3d10/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/d3d10/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/d3d10core/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/d3d10core/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/d3d8/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/d3d8/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/d3d8/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/d3d9/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/d3d9/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/d3d9/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/d3dim/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/d3drm/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/d3drm/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/d3drm/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/d3dx8/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/d3dx8/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/d3dx8/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/d3dx9_24/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/d3dx9_25/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/d3dx9_26/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) @@ -1832,18 +1827,18 @@ WINE_CONFIG_MAKEFILE([dlls/d3dx9_33/Makefile],[dlls/Makedll.rules],[dlls],[ALL_D WINE_CONFIG_MAKEFILE([dlls/d3dx9_34/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/d3dx9_35/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/d3dx9_36/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/d3dx9_36/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/d3dx9_36/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/d3dx9_37/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/d3dxof/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/d3dxof/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/d3dxof/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/dbghelp/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/dciman32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/ddraw/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/ddraw/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/ddraw/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/ddrawex/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/devenum/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/dinput/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/dinput/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/dinput/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/dinput8/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/dmband/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/dmcompos/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) @@ -1855,17 +1850,17 @@ WINE_CONFIG_MAKEFILE([dlls/dmsynth/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DL WINE_CONFIG_MAKEFILE([dlls/dmusic/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/dmusic32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/dnsapi/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/dnsapi/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/dnsapi/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/dplay/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/dplayx/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/dplayx/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/dplayx/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/dpnaddr/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/dpnet/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/dpnhpast/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/dpnlobby/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/dpwsockx/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/dsound/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/dsound/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/dsound/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/dssenh/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/dswave/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/dwmapi/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) @@ -1873,14 +1868,15 @@ WINE_CONFIG_MAKEFILE([dlls/dxdiagn/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DL WINE_CONFIG_MAKEFILE([dlls/dxerr8/Makefile],[dlls/Makeimplib.rules],[dlls],[ALL_IMPLIB_DIRS]) WINE_CONFIG_MAKEFILE([dlls/dxerr9/Makefile],[dlls/Makeimplib.rules],[dlls],[ALL_IMPLIB_DIRS]) WINE_CONFIG_MAKEFILE([dlls/dxgi/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/dxgi/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/dxguid/Makefile],[dlls/Makeimplib.rules],[dlls],[ALL_IMPLIB_DIRS]) WINE_CONFIG_MAKEFILE([dlls/faultrep/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/fusion/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/fusion/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/fusion/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/gdi32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/gdi32/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/gdi32/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/gdiplus/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/gdiplus/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/gdiplus/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/glu32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/gphoto2.ds/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/gpkcsp/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) @@ -1888,7 +1884,7 @@ WINE_CONFIG_MAKEFILE([dlls/hal/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DI WINE_CONFIG_MAKEFILE([dlls/hhctrl.ocx/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/hid/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/hlink/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/hlink/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/hlink/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/hnetcfg/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/iccvid/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/icmp/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) @@ -1896,40 +1892,40 @@ WINE_CONFIG_MAKEFILE([dlls/ifsmgr.vxd/Makefile],[dlls/Makedll.rules],[dlls],[ALL WINE_CONFIG_MAKEFILE([dlls/imaadp32.acm/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/imagehlp/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/imm32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/imm32/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/imm32/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/inetcomm/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/inetcomm/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/inetcomm/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/inetmib1/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/inetmib1/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/inetmib1/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/infosoft/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/infosoft/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/infosoft/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/initpki/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/inkobj/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/inseng/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/iphlpapi/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/iphlpapi/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/iphlpapi/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/itircl/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/itss/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/itss/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/itss/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/jscript/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/jscript/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/jscript/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/kernel32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/kernel32/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/kernel32/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/localspl/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/localspl/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/localspl/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/localui/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/localui/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/localui/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/lz32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/lz32/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/lz32/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/mapi32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/mapi32/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/mapi32/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/mciavi32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/mcicda/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/mciseq/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/mciwave/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/midimap/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/mlang/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/mlang/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/mlang/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/mmdevldr.vxd/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/monodebg.vxd/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/mountmgr.sys/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) @@ -1937,20 +1933,20 @@ WINE_CONFIG_MAKEFILE([dlls/mpr/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DI WINE_CONFIG_MAKEFILE([dlls/mprapi/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/msacm32.drv/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/msacm32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/msacm32/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/msacm32/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/msadp32.acm/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/mscat32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/mscms/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/mscms/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/mscms/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/mscoree/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/msdmo/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/msftedit/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/msg711.acm/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/mshtml.tlb/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/mshtml/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/mshtml/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/mshtml/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/msi/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/msi/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/msi/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/msimg32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/msimtf/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/msisip/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) @@ -1959,106 +1955,106 @@ WINE_CONFIG_MAKEFILE([dlls/msnet32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DL WINE_CONFIG_MAKEFILE([dlls/msrle32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/mssip32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/mstask/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/mstask/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/mstask/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/msvcirt/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/msvcr71/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/msvcrt/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/msvcrt/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/msvcrt/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/msvcrt20/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/msvcrt40/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/msvcrtd/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/msvcrtd/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/msvcrtd/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/msvfw32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/msvidc32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/mswsock/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/msxml3/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/msxml3/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/msxml3/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/nddeapi/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/netapi32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/netapi32/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/netapi32/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/newdev/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/ntdll/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/ntdll/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/ntdll/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/ntdsapi/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/ntdsapi/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/ntdsapi/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/ntoskrnl.exe/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/ntprint/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/ntprint/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/ntprint/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/objsel/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/odbc32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/odbccp32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/odbccp32/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/odbccp32/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/ole32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/ole32/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/ole32/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/oleacc/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/oleacc/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/oleacc/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/oleaut32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/oleaut32/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/oleaut32/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/olecli32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/oledlg/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/olepro32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/olesvr32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/olethk32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/opengl32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/opengl32/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/opengl32/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/pdh/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/pdh/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/pdh/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/powrprof/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/printui/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/propsys/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/psapi/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/psapi/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/psapi/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/pstorec/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/qcap/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/qedit/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/qedit/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/qedit/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/qmgr/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/qmgr/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/qmgr/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/qmgrprxy/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/quartz/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/quartz/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/quartz/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/query/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/rasapi32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/rasapi32/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/rasapi32/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/resutils/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/riched20/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/riched20/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/riched20/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/riched32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/riched32/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/riched32/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/rpcrt4/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/rpcrt4/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/rpcrt4/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/rsabase/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/rsaenh/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/rsaenh/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/rsaenh/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/sane.ds/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/sccbase/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/schannel/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/schannel/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/schannel/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/secur32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/secur32/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/secur32/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/security/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/sensapi/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/serialui/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/serialui/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/serialui/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/setupapi/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/setupapi/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/setupapi/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/sfc/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/sfc_os/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/shdoclc/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/shdocvw/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/shdocvw/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/shdocvw/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/shell32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/shell32/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/shell32/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/shfolder/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/shlwapi/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/shlwapi/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/shlwapi/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/slbcsp/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/slc/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/snmpapi/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/snmpapi/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/snmpapi/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/softpub/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/spoolss/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/spoolss/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/spoolss/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/stdole2.tlb/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/stdole32.tlb/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/sti/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) @@ -2070,20 +2066,20 @@ WINE_CONFIG_MAKEFILE([dlls/twain_32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_D WINE_CONFIG_MAKEFILE([dlls/unicows/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/url/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/urlmon/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/urlmon/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/urlmon/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/user32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/user32/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/user32/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/userenv/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/userenv/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/userenv/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/usp10/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/usp10/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/usp10/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/uuid/Makefile],[dlls/Makeimplib.rules],[dlls],[ALL_IMPLIB_DIRS]) WINE_CONFIG_MAKEFILE([dlls/uxtheme/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/uxtheme/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/uxtheme/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/vdhcp.vxd/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/vdmdbg/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/version/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/version/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/version/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/vmm.vxd/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/vnbt.vxd/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/vnetbios.vxd/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) @@ -2108,31 +2104,31 @@ WINE_CONFIG_MAKEFILE([dlls/winequartz.drv/Makefile],[dlls/Makedll.rules],[dlls], WINE_CONFIG_MAKEFILE([dlls/winex11.drv/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/wing32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/winhttp/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/winhttp/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/winhttp/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/wininet/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/wininet/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/wininet/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/winmm/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/winmm/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/winmm/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/winnls32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/winscard/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/winspool.drv/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/winspool.drv/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/winspool.drv/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/wintab32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/wintrust/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/wintrust/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/wintrust/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/wldap32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/wldap32/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/wldap32/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/wmi/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/wnaspi32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/wow32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/ws2_32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/ws2_32/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/ws2_32/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/wsock32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/wtsapi32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/xinput1_1/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/xinput1_2/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/xinput1_3/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) -WINE_CONFIG_MAKEFILE([dlls/xinput1_3/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/xinput1_3/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/xinput9_1_0/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([documentation/Makefile],[Make.rules],[],[ALL_TOP_DIRS]) WINE_CONFIG_MAKEFILE([fonts/Makefile],[Make.rules],[],[ALL_TOP_DIRS]) diff --git a/dlls/Makefile.in b/dlls/Makefile.in index a5fcd6fce7c..794905ab254 100644 --- a/dlls/Makefile.in +++ b/dlls/Makefile.in @@ -461,7 +461,9 @@ $(TESTSUBDIRS:%=%/__crosstest__): $(CROSS_IMPLIBS) implib: $(IMPORT_LIBS) -.PHONY: implib +testsubdirs: $(TESTSUBDIRS) + +.PHONY: implib testsubdirs activeds/libactiveds.def activeds/libactiveds.a: activeds/activeds.spec $(WINEBUILD) @cd activeds && $(MAKE) `basename $@` diff --git a/dlls/advapi32/tests/registry.c b/dlls/advapi32/tests/registry.c index 95608c6503a..b3331b47268 100644 --- a/dlls/advapi32/tests/registry.c +++ b/dlls/advapi32/tests/registry.c @@ -199,13 +199,14 @@ static void setup_main_key(void) assert (!RegCreateKeyA( HKEY_CURRENT_USER, "Software\\Wine\\Test", &hkey_main )); } -static void test_hkey_main_Value_A(LPCSTR name, LPCSTR string, +#define lok ok_(__FILE__, line) +#define test_hkey_main_Value_A(name, string, full_byte_len) _test_hkey_main_Value_A(__LINE__, name, string, full_byte_len) +static void _test_hkey_main_Value_A(int line, LPCSTR name, LPCSTR string, DWORD full_byte_len) { DWORD ret, type, cbData; DWORD str_byte_len; - LPSTR value; - static const char nA[]={'N', 0}; + BYTE* value; type=0xdeadbeef; cbData=0xdeadbeef; @@ -215,43 +216,44 @@ static void test_hkey_main_Value_A(LPCSTR name, LPCSTR string, SetLastError(0xdeadbeef); ret = RegQueryValueExA(hkey_main, name, NULL, &type, NULL, &cbData); GLE = GetLastError(); - ok(ret == ERROR_SUCCESS, "RegQueryValueExA failed: %d, GLE=%d\n", ret, GLE); + lok(ret == ERROR_SUCCESS, "RegQueryValueExA/1 failed: %d, GLE=%d\n", ret, GLE); /* It is wrong for the Ansi version to not be implemented */ ok(GLE == 0xdeadbeef, "RegQueryValueExA set GLE = %u\n", GLE); if(GLE == ERROR_CALL_NOT_IMPLEMENTED) return; str_byte_len = (string ? lstrlenA(string) : 0) + 1; - ok(type == REG_SZ, "RegQueryValueExA returned type %d\n", type); - ok(cbData == full_byte_len || cbData == str_byte_len /* Win9x */, + lok(type == REG_SZ, "RegQueryValueExA/1 returned type %d\n", type); + lok(cbData == full_byte_len || cbData == str_byte_len /* Win9x */, "cbData=%d instead of %d or %d\n", cbData, full_byte_len, str_byte_len); - value = HeapAlloc(GetProcessHeap(), 0, (cbData+2)*sizeof(*value)); - strcpy(value, nA); + value = HeapAlloc(GetProcessHeap(), 0, cbData+1); + memset(value, 0xbd, cbData+1); type=0xdeadbeef; - ret = RegQueryValueExA(hkey_main, name, NULL, &type, (BYTE*)value, &cbData); + ret = RegQueryValueExA(hkey_main, name, NULL, &type, value, &cbData); GLE = GetLastError(); - ok(ret == ERROR_SUCCESS, "RegQueryValueExA failed: %d, GLE=%d\n", ret, GLE); + lok(ret == ERROR_SUCCESS, "RegQueryValueExA/2 failed: %d, GLE=%d\n", ret, GLE); if (!string) { /* When cbData == 0, RegQueryValueExA() should not modify the buffer */ - ok(strcmp(value, nA) == 0 || (cbData == 1 && *value == '\0') /* Win9x */, - "RegQueryValueExA failed: '%s' != '%s'\n", value, string); + lok(*value == 0xbd || (cbData == 1 && *value == '\0') /* Win9x */, + "RegQueryValueExA overflowed: cbData=%u *value=%02x\n", cbData, *value); } else { - ok(memcmp(value, string, cbData) == 0, "RegQueryValueExA failed: %s/%d != %s/%d\n", - wine_debugstr_an(value, cbData), cbData, + lok(memcmp(value, string, cbData) == 0, "RegQueryValueExA/2 failed: %s/%d != %s/%d\n", + wine_debugstr_an((char*)value, cbData), cbData, wine_debugstr_an(string, full_byte_len), full_byte_len); + lok(*(value+cbData) == 0xbd, "RegQueryValueExA/2 overflowed at offset %u: %02x != bd\n", cbData, *(value+cbData)); } HeapFree(GetProcessHeap(), 0, value); } -static void test_hkey_main_Value_W(LPCWSTR name, LPCWSTR string, +#define test_hkey_main_Value_W(name, string, full_byte_len) _test_hkey_main_Value_W(__LINE__, name, string, full_byte_len) +static void _test_hkey_main_Value_W(int line, LPCWSTR name, LPCWSTR string, DWORD full_byte_len) { DWORD ret, type, cbData; - LPWSTR value; - static const WCHAR nW[]={'N', 0}; + BYTE* value; type=0xdeadbeef; cbData=0xdeadbeef; @@ -261,31 +263,33 @@ static void test_hkey_main_Value_W(LPCWSTR name, LPCWSTR string, SetLastError(0xdeadbeef); ret = RegQueryValueExW(hkey_main, name, NULL, &type, NULL, &cbData); GLE = GetLastError(); - ok(ret == ERROR_SUCCESS, "RegQueryValueExW failed: %d, GLE=%d\n", ret, GLE); + lok(ret == ERROR_SUCCESS, "RegQueryValueExW/1 failed: %d, GLE=%d\n", ret, GLE); if(GLE == ERROR_CALL_NOT_IMPLEMENTED) { win_skip("RegQueryValueExW() is not implemented\n"); return; } - ok(type == REG_SZ, "RegQueryValueExW returned type %d\n", type); - ok(cbData == full_byte_len, + lok(type == REG_SZ, "RegQueryValueExW/1 returned type %d\n", type); + lok(cbData == full_byte_len, "cbData=%d instead of %d\n", cbData, full_byte_len); - value = HeapAlloc(GetProcessHeap(), 0, (cbData+2)*sizeof(*value)); - lstrcpyW(value, nW); + /* Give enough space to overflow by one WCHAR */ + value = HeapAlloc(GetProcessHeap(), 0, cbData+2); + memset(value, 0xbd, cbData+2); type=0xdeadbeef; - ret = RegQueryValueExW(hkey_main, name, NULL, &type, (BYTE*)value, &cbData); + ret = RegQueryValueExW(hkey_main, name, NULL, &type, value, &cbData); GLE = GetLastError(); - ok(ret == ERROR_SUCCESS, "RegQueryValueExW failed: %d, GLE=%d\n", ret, GLE); - if (!string) + lok(ret == ERROR_SUCCESS, "RegQueryValueExW/2 failed: %d, GLE=%d\n", ret, GLE); + if (string) { - /* When cbData == 0, RegQueryValueExW() should not modify the buffer */ - string=nW; + lok(memcmp(value, string, cbData) == 0, "RegQueryValueExW failed: %s/%d != %s/%d\n", + wine_debugstr_wn((WCHAR*)value, cbData / sizeof(WCHAR)), cbData, + wine_debugstr_wn(string, full_byte_len / sizeof(WCHAR)), full_byte_len); } - ok(memcmp(value, string, cbData) == 0, "RegQueryValueExW failed: %s/%d != %s/%d\n", - wine_debugstr_wn(value, cbData / sizeof(WCHAR)), cbData, - wine_debugstr_wn(string, full_byte_len / sizeof(WCHAR)), full_byte_len); + /* This implies that when cbData == 0, RegQueryValueExW() should not modify the buffer */ + lok(*(value+cbData) == 0xbd, "RegQueryValueExW/2 overflowed at %u: %02x != bd\n", cbData, *(value+cbData)); + lok(*(value+cbData+1) == 0xbd, "RegQueryValueExW/2 overflowed at %u+1: %02x != bd\n", cbData, *(value+cbData+1)); HeapFree(GetProcessHeap(), 0, value); } @@ -1308,6 +1312,87 @@ cleanup: RegCloseKey(subkey); } +static void test_string_termination(void) +{ + HKEY subkey; + LSTATUS ret; + static const char string[] = "FullString"; + char name[11]; + BYTE buffer[11]; + DWORD insize, outsize, nsize; + + ret = RegCreateKeyA(hkey_main, "string_termination", &subkey); + ok(ret == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", ret); + + /* Off-by-one RegSetValueExA -> adds a trailing '\0'! */ + insize=sizeof(string)-1; + ret = RegSetValueExA(subkey, "stringtest", 0, REG_SZ, (BYTE*)string, insize); + ok(ret == ERROR_SUCCESS, "RegSetValueExA failed: %d\n", ret); + outsize=insize; + ret = RegQueryValueExA(subkey, "stringtest", NULL, NULL, buffer, &outsize); + ok(ret == ERROR_MORE_DATA, "RegQueryValueExA returned: %d\n", ret); + + /* Off-by-two RegSetValueExA -> no trailing '\0', except on Win9x */ + insize=sizeof(string)-2; + ret = RegSetValueExA(subkey, "stringtest", 0, REG_SZ, (BYTE*)string, insize); + ok(ret == ERROR_SUCCESS, "RegSetValueExA failed: %d\n", ret); + outsize=0; + ret = RegQueryValueExA(subkey, "stringtest", NULL, NULL, NULL, &outsize); + ok(ret == ERROR_SUCCESS, "RegQueryValueExA failed: %d\n", ret); + ok(outsize == insize || broken(outsize == sizeof(string)) /* Win9x */, + "wrong size %u != %u\n", outsize, insize); + + if (outsize == insize) + { + /* RegQueryValueExA may return a string with no trailing '\0' */ + outsize=insize; + memset(buffer, 0xbd, sizeof(buffer)); + ret = RegQueryValueExA(subkey, "stringtest", NULL, NULL, buffer, &outsize); + ok(ret == ERROR_SUCCESS, "RegQueryValueExA failed: %d\n", ret); + ok(outsize == insize, "wrong size: %u != %u\n", outsize, insize); + ok(memcmp(buffer, string, outsize) == 0, "bad string: %s/%u != %s\n", + wine_debugstr_an((char*)buffer, outsize), outsize, string); + ok(buffer[insize] == 0xbd, "buffer overflow at %u %02x\n", insize, buffer[insize]); + + /* RegQueryValueExA adds a trailing '\0' if there is room */ + outsize=insize+1; + memset(buffer, 0xbd, sizeof(buffer)); + ret = RegQueryValueExA(subkey, "stringtest", NULL, NULL, buffer, &outsize); + ok(ret == ERROR_SUCCESS, "RegQueryValueExA failed: %d\n", ret); + ok(outsize == insize, "wrong size: %u != %u\n", outsize, insize); + ok(memcmp(buffer, string, outsize) == 0, "bad string: %s/%u != %s\n", + wine_debugstr_an((char*)buffer, outsize), outsize, string); + ok(buffer[insize] == 0, "buffer overflow at %u %02x\n", insize, buffer[insize]); + + /* RegEnumValueA may return a string with no trailing '\0' */ + outsize=insize; + memset(buffer, 0xbd, sizeof(buffer)); + nsize=sizeof(name); + ret = RegEnumValueA(subkey, 0, name, &nsize, NULL, NULL, buffer, &outsize); + ok(ret == ERROR_SUCCESS, "RegEnumValueA failed: %d\n", ret); + ok(strcmp(name, "stringtest") == 0, "wrong name: %s\n", name); + ok(outsize == insize, "wrong size: %u != %u\n", outsize, insize); + ok(memcmp(buffer, string, outsize) == 0, "bad string: %s/%u != %s\n", + wine_debugstr_an((char*)buffer, outsize), outsize, string); + ok(buffer[insize] == 0xbd, "buffer overflow at %u %02x\n", insize, buffer[insize]); + + /* RegEnumValueA adds a trailing '\0' if there is room */ + outsize=insize+1; + memset(buffer, 0xbd, sizeof(buffer)); + nsize=sizeof(name); + ret = RegEnumValueA(subkey, 0, name, &nsize, NULL, NULL, buffer, &outsize); + ok(ret == ERROR_SUCCESS, "RegEnumValueA failed: %d\n", ret); + ok(strcmp(name, "stringtest") == 0, "wrong name: %s\n", name); + ok(outsize == insize, "wrong size: %u != %u\n", outsize, insize); + ok(memcmp(buffer, string, outsize) == 0, "bad string: %s/%u != %s\n", + wine_debugstr_an((char*)buffer, outsize), outsize, string); + ok(buffer[insize] == 0, "buffer overflow at %u %02x\n", insize, buffer[insize]); + } + + RegDeleteKeyA(subkey, ""); + RegCloseKey(subkey); +} + static void test_reg_delete_tree(void) { CHAR buffer[MAX_PATH]; @@ -1398,6 +1483,7 @@ START_TEST(registry) test_reg_close_key(); test_reg_delete_key(); test_reg_query_value(); + test_string_termination(); /* SaveKey/LoadKey require the SE_BACKUP_NAME privilege to be set */ if (set_privileges(SE_BACKUP_NAME, TRUE) && diff --git a/dlls/atl/registrar.c b/dlls/atl/registrar.c index 2b921c5094d..dd8b7a2f7d5 100644 --- a/dlls/atl/registrar.c +++ b/dlls/atl/registrar.c @@ -242,7 +242,7 @@ static HRESULT do_process_key(LPCOLESTR *pstr, HKEY parent_key, strbuf *buf, BOO strbuf_write(buf->str, &name, -1); }else if(key_type == DO_DELETE) { TRACE("Deleting %s\n", debugstr_w(buf->str)); - lres = RegDeleteTreeW(parent_key, buf->str); + RegDeleteTreeW(parent_key, buf->str); }else { if(key_type == FORCE_REMOVE) RegDeleteTreeW(parent_key, buf->str); diff --git a/dlls/cabinet/fci.c b/dlls/cabinet/fci.c index ea745a63c67..ed413f821e1 100644 --- a/dlls/cabinet/fci.c +++ b/dlls/cabinet/fci.c @@ -462,7 +462,7 @@ static cab_ULONG fci_get_checksum(const void *pv, UINT cb, CHECKSUM seed) case 2: ul |= (((ULONG)(*pb++)) << 8); case 1: - ul |= *pb++; + ul |= *pb; default: break; } diff --git a/dlls/cabinet/fdi.c b/dlls/cabinet/fdi.c index 0825162ffee..09d0fe7bc51 100644 --- a/dlls/cabinet/fdi.c +++ b/dlls/cabinet/fdi.c @@ -2830,7 +2830,7 @@ BOOL __cdecl FDICopy( if (file->offset > CAB(offset)) { /* decode bytes and send them to /dev/null */ - switch ((err = fdi_decomp(file, 0, decomp_state, pszCabPath, pfnfdin, pvUser))) { + switch (fdi_decomp(file, 0, decomp_state, pszCabPath, pfnfdin, pvUser)) { case DECR_OK: break; case DECR_USERABORT: diff --git a/dlls/comctl32/monthcal.c b/dlls/comctl32/monthcal.c index 8cae0db45b4..15acf1f70bc 100644 --- a/dlls/comctl32/monthcal.c +++ b/dlls/comctl32/monthcal.c @@ -1172,7 +1172,6 @@ MONTHCAL_HitTest(const MONTHCAL_INFO *infoPtr, LPARAM lParam) x = lpht->pt.x; y = lpht->pt.y; - retval = MCHT_NOWHERE; ZeroMemory(&lpht->st, sizeof(lpht->st)); @@ -1887,7 +1886,7 @@ static LRESULT theme_changed (const MONTHCAL_INFO* infoPtr) { HTHEME theme = GetWindowTheme (infoPtr->hwndSelf); CloseThemeData (theme); - theme = OpenThemeData (infoPtr->hwndSelf, themeClass); + OpenThemeData (infoPtr->hwndSelf, themeClass); return 0; } diff --git a/dlls/comctl32/rebar.c b/dlls/comctl32/rebar.c index c8c200f4449..89ac420a1e6 100644 --- a/dlls/comctl32/rebar.c +++ b/dlls/comctl32/rebar.c @@ -484,7 +484,7 @@ REBAR_DrawChevron (HDC hdc, INT left, INT top, INT colorRef) MoveToEx (hdc, x, y, NULL); LineTo (hdc, x+3, y++); x++; MoveToEx (hdc, x, y, NULL); - LineTo (hdc, x+1, y++); + LineTo (hdc, x+1, y); SelectObject( hdc, hOldPen ); DeleteObject( hPen ); } diff --git a/dlls/comctl32/syslink.c b/dlls/comctl32/syslink.c index 7f74b36dccc..64cea1171f2 100644 --- a/dlls/comctl32/syslink.c +++ b/dlls/comctl32/syslink.c @@ -286,8 +286,6 @@ CheckParameter: ValidLink = TRUE; taglen++; } - else - tmp++; } } diff --git a/dlls/comctl32/tests/trackbar.c b/dlls/comctl32/tests/trackbar.c index f69e2862383..f54e32e0f38 100644 --- a/dlls/comctl32/tests/trackbar.c +++ b/dlls/comctl32/tests/trackbar.c @@ -141,11 +141,13 @@ static const struct message position_test_seq[] = { { TBM_SETPOS, sent|wparam|lparam, TRUE, 5}, { WM_PAINT, sent|defwinproc}, { TBM_GETPOS, sent}, + { TBM_SETPOS, sent|wparam|lparam, TRUE, 5}, { TBM_SETPOS, sent|wparam|lparam, TRUE, 1000}, { WM_PAINT, sent|defwinproc}, { TBM_GETPOS, sent}, { TBM_SETPOS, sent|wparam|lparam, FALSE, 20}, { TBM_GETPOS, sent}, + { TBM_SETPOS, sent|wparam|lparam, TRUE, 20}, { TBM_GETPOS, sent}, {0} }; @@ -605,12 +607,14 @@ static void test_position(HWND hWndTrackbar){ SendMessage(hWndTrackbar, TBM_SETPOS, TRUE, 5); r = SendMessage(hWndTrackbar, TBM_GETPOS, 0,0); expect(5, r); + SendMessage(hWndTrackbar, TBM_SETPOS, TRUE, 5); SendMessage(hWndTrackbar, TBM_SETPOS, TRUE, 1000); r = SendMessage(hWndTrackbar, TBM_GETPOS, 0,0); expect(100, r); SendMessage(hWndTrackbar, TBM_SETPOS, FALSE, 20); r = SendMessage(hWndTrackbar, TBM_GETPOS, 0,0); expect(20, r); + SendMessage(hWndTrackbar, TBM_SETPOS, TRUE, 20); /* test TBM_GETPOS */ r = SendMessage(hWndTrackbar, TBM_GETPOS, 0,0); diff --git a/dlls/comctl32/toolbar.c b/dlls/comctl32/toolbar.c index 8e30df0bdd2..797260573c3 100644 --- a/dlls/comctl32/toolbar.c +++ b/dlls/comctl32/toolbar.c @@ -542,7 +542,7 @@ TOOLBAR_DrawArrow (HDC hdc, INT left, INT top, COLORREF clr) MoveToEx (hdc, x, y, NULL); LineTo (hdc, x+3, y++); x++; MoveToEx (hdc, x, y, NULL); - LineTo (hdc, x+1, y++); + LineTo (hdc, x+1, y); SelectObject( hdc, hOldPen ); DeleteObject( hPen ); } @@ -1151,7 +1151,7 @@ TOOLBAR_Refresh (HWND hwnd, HDC hdc, const PAINTSTRUCT *ps) tbcd.nmcd.dwDrawStage = CDDS_POSTPAINT; tbcd.nmcd.hdc = hdc; tbcd.nmcd.rc = ps->rcPaint; - ntfret = TOOLBAR_SendNotify(&tbcd.nmcd.hdr, infoPtr, NM_CUSTOMDRAW); + TOOLBAR_SendNotify(&tbcd.nmcd.hdr, infoPtr, NM_CUSTOMDRAW); } } @@ -1426,7 +1426,6 @@ TOOLBAR_WrapToolbar( HWND hwnd, DWORD dwStyle ) TRACE("wrap point 5 btn %d style %02x, x=%d, cx=%d\n", i, btnPtr[i].fsStyle, x, cx); btnPtr[i].fsState |= TBSTATE_WRAP; - bFound = TRUE; x = infoPtr->nIndent; if (btnPtr[i].fsStyle & BTNS_SEP ) bButtonWrap = FALSE; diff --git a/dlls/comctl32/trackbar.c b/dlls/comctl32/trackbar.c index a9959e29a60..c72f29b4867 100644 --- a/dlls/comctl32/trackbar.c +++ b/dlls/comctl32/trackbar.c @@ -1148,7 +1148,7 @@ TRACKBAR_SetPos (TRACKBAR_INFO *infoPtr, BOOL fPosition, LONG lPosition) infoPtr->lPos = infoPtr->lRangeMax; infoPtr->flags |= TB_THUMBPOSCHANGED; - if (fPosition) TRACKBAR_InvalidateThumbMove(infoPtr, oldPos, lPosition); + if (fPosition && oldPos != lPosition) TRACKBAR_InvalidateThumbMove(infoPtr, oldPos, lPosition); return 0; } diff --git a/dlls/comdlg32/tests/filedlg.c b/dlls/comdlg32/tests/filedlg.c index e05f5a93ce0..c3d56eaac95 100644 --- a/dlls/comdlg32/tests/filedlg.c +++ b/dlls/comdlg32/tests/filedlg.c @@ -187,6 +187,11 @@ static UINT CALLBACK create_view_window2_hook(HWND dlg, UINT msg, WPARAM wParam, hr = IShellView2_DestroyViewWindow(shell_view2); ok(SUCCEEDED(hr), "DestroyViewWindow returned %#x\n", hr); + /* XP and W2K3 need this. On Win9x and W2K the call to DestroyWindow() fails and has + * no side effects. NT4 doesn't get here. (FIXME: Vista doesn't get here yet). + */ + DestroyWindow(view_params.hwndView); + view_params.pvid = &VID_Details; hr = IShellView2_CreateViewWindow2(shell_view2, &view_params); ok(SUCCEEDED(hr), "CreateViewWindow2 returned %#x\n", hr); @@ -194,7 +199,9 @@ static UINT CALLBACK create_view_window2_hook(HWND dlg, UINT msg, WPARAM wParam, hr = IShellView2_GetCurrentInfo(shell_view2, &folder_settings); ok(SUCCEEDED(hr), "GetCurrentInfo returned %#x\n", hr); - ok(folder_settings.ViewMode == FVM_DETAILS, "view mode is %d, expected %d\n", folder_settings.ViewMode, FVM_DETAILS); + ok(folder_settings.ViewMode == FVM_DETAILS || + broken(folder_settings.ViewMode == FVM_LIST), /* Win9x */ + "view mode is %d, expected %d\n", folder_settings.ViewMode, FVM_DETAILS); cleanup: if (shell_view2) IShellView2_Release(shell_view2); diff --git a/dlls/crypt32/crypt32.rc b/dlls/crypt32/crypt32.rc index af0d77cfa9b..1afa8a75296 100644 --- a/dlls/crypt32/crypt32.rc +++ b/dlls/crypt32/crypt32.rc @@ -30,4 +30,5 @@ #include "crypt32_Ko.rc" #include "crypt32_Nl.rc" #include "crypt32_No.rc" +#include "crypt32_Pt.rc" #include "crypt32_Sv.rc" diff --git a/dlls/crypt32/crypt32_En.rc b/dlls/crypt32/crypt32_En.rc index 3e084765161..ace77d265bb 100644 --- a/dlls/crypt32/crypt32_En.rc +++ b/dlls/crypt32/crypt32_En.rc @@ -176,12 +176,12 @@ STRINGTABLE DISCARDABLE STRINGTABLE DISCARDABLE { IDS_KEY_ID "KeyID=" - IDS_CERT_ISSUER "Certificate Issuer: " + IDS_CERT_ISSUER "Certificate Issuer" IDS_CERT_SERIAL_NUMBER "Certificate Serial Number=" IDS_ALT_NAME_OTHER_NAME "Other Name=" IDS_ALT_NAME_RFC822_NAME "Email Address=" IDS_ALT_NAME_DNS_NAME "DNS Name=" - IDS_ALT_NAME_DIRECTORY_NAME "Directory Name=" + IDS_ALT_NAME_DIRECTORY_NAME "Directory Address" IDS_ALT_NAME_URL "URL=" IDS_ALT_NAME_IP_ADDRESS "IP Address=" IDS_ALT_NAME_MASK "Mask=" @@ -208,7 +208,7 @@ STRINGTABLE DISCARDABLE IDS_REASON_KEY_COMPROMISE "Key Compromise" IDS_REASON_CA_COMPROMISE "CA Compromise" IDS_REASON_AFFILIATION_CHANGED "Affiliation Changed" - IDS_REASON_SUPERCEDED "Superceded" + IDS_REASON_SUPERSEDED "Superseded" IDS_REASON_CESSATION_OF_OPERATION "Operation Ceased" IDS_REASON_CERTIFICATE_HOLD "Certificate Hold" IDS_FINANCIAL_CRITERIA "Financial Information=" @@ -217,4 +217,21 @@ STRINGTABLE DISCARDABLE IDS_FINANCIAL_CRITERIA_MEETS_CRITERIA "Meets Criteria=" IDS_YES "Yes" IDS_NO "No" + IDS_DIGITAL_SIGNATURE "Digital Signature" + IDS_NON_REPUDIATION "Non-Repudiation" + IDS_KEY_ENCIPHERMENT "Key Encipherment" + IDS_DATA_ENCIPHERMENT "Data Encipherment" + IDS_KEY_AGREEMENT "Key Agreement" + IDS_CERT_SIGN "Certificate Signing" + IDS_OFFLINE_CRL_SIGN "Off-line CRL Signing" + IDS_CRL_SIGN "CRL Signing" + IDS_ENCIPHER_ONLY "Encipher Only" + IDS_DECIPHER_ONLY "Decipher Only" + IDS_NETSCAPE_SSL_CLIENT "SSL Client Authentication" + IDS_NETSCAPE_SSL_SERVER "SSL Server Authentication" + IDS_NETSCAPE_SMIME "S/MIME" + IDS_NETSCAPE_SIGN "Signature" + IDS_NETSCAPE_SSL_CA "SSL CA" + IDS_NETSCAPE_SMIME_CA "S/MIME CA" + IDS_NETSCAPE_SIGN_CA "Signature CA" } diff --git a/dlls/crypt32/crypt32_Pt.rc b/dlls/crypt32/crypt32_Pt.rc new file mode 100644 index 00000000000..424f8ea7aee --- /dev/null +++ b/dlls/crypt32/crypt32_Pt.rc @@ -0,0 +1,220 @@ +/* + * crypt32 dll resources + * + * Copyright (C) 2008 Ricardo Filipe + * + * 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 + */ + +LANGUAGE LANG_PORTUGUESE, SUBLANG_NEUTRAL + +STRINGTABLE DISCARDABLE +{ + IDS_AUTHORITY_KEY_ID "Identificador da Chave de Autoridade" + IDS_KEY_ATTRIBUTES "Atributos da Chave" + IDS_KEY_USAGE_RESTRICTION "Restrições ao uso da Chave" + IDS_SUBJECT_ALT_NAME "Nome Alternativo do Sujeito" + IDS_ISSUER_ALT_NAME "Nome Alternativo do Emissor" + IDS_BASIC_CONSTRAINTS "Restrições Básicas" + IDS_KEY_USAGE "Uso da Chave" + IDS_CERT_POLICIES "Políticas de Certificados" + IDS_SUBJECT_KEY_IDENTIFIER "Identificador da Chave do Sujeito" + IDS_CRL_REASON_CODE "Código de Razão CRL" + IDS_CRL_DIST_POINTS "Pontos de Distribuição CRL" + IDS_ENHANCED_KEY_USAGE "Uso da Chave melhorado" + IDS_AUTHORITY_INFO_ACCESS "Acesso Autorizado a Informação" + IDS_CERT_EXTENSIONS "Extensões de Certificados" + IDS_NEXT_UPDATE_LOCATION "Localização da próxima actualização" + IDS_YES_OR_NO_TRUST "Confiança Sim ou Não" + IDS_EMAIL_ADDRESS "Endereço de Email" + IDS_UNSTRUCTURED_NAME "Nome não estruturado" + IDS_CONTENT_TYPE "Tipo de Conteúdo" + IDS_MESSAGE_DIGEST "Resumo da mensagem" + IDS_SIGNING_TIME "Tempo de assinatura" + IDS_COUNTER_SIGN "Contra assinar" + IDS_CHALLENGE_PASSWORD "Desafiar Password" + IDS_UNSTRUCTURED_ADDRESS "Endereço não estruturado" + IDS_SMIME_CAPABILITIES "Capacidades SMIME" + IDS_PREFER_SIGNED_DATA "Preferir Dados Assinados" + IDS_CPS "CPS" + IDS_USER_NOTICE "Aviso de Utilizador" + IDS_OCSP "Protocolo de Estado de Certificados Online" + IDS_CA_ISSUER "Emissor de Certificados Autorizados" + IDS_CERT_TEMPLATE_NAME "Nome de Certificação por Template" + IDS_CERT_TYPE "Tipo de Certificado" + IDS_CERT_MANIFOLD "Agrupador de Certificados" + IDS_NETSCAPE_CERT_TYPE "Tipo de Certificados Netscape" + IDS_NETSCAPE_BASE_URL "URL Base Netscape" + IDS_NETSCAPE_REVOCATION_URL "URL Revogação Netscape" + IDS_NETSCAPE_CA_REVOCATION_URL "URL Revogação CA Netscape" + IDS_NETSCAPE_CERT_RENEWAL_URL "URL Renovação de Certificados Netscape" + IDS_NETSCAPE_CA_POLICY_URL "URL Política CA Netscape" + IDS_NETSCAPE_SSL_SERVER_NAME "Netscape SSL ServerName" + IDS_NETSCAPE_COMMENT "Comentário Netscape" + IDS_SPC_SP_AGENCY_INFO "SpcSpAgencyInfo" + IDS_SPC_FINANCIAL_CRITERIA "SpcFinancialCriteria" + IDS_SPC_MINIMAL_CRITERIA "SpcMinimalCriteria" + IDS_COUNTRY "País/Região" + IDS_ORGANIZATION "Organização" + IDS_ORGANIZATIONAL_UNIT "Unidade Organizacional" + IDS_COMMON_NAME "Nome Comum" + IDS_LOCALITY "Localidade" + IDS_STATE_OR_PROVINCE "Estado ou Província" + IDS_TITLE "Título" + IDS_GIVEN_NAME "Nome Dado" + IDS_INITIALS "Iniciais" + IDS_SUR_NAME "Apelido" + IDS_DOMAIN_COMPONENT "Componente de Domínio" + IDS_STREET_ADDRESS "Endereço da Rua" + IDS_SERIAL_NUMBER "Número de série" + IDS_CA_VERSION "Versão CA" + IDS_CROSS_CA_VERSION "Versão Cruzada CA" + IDS_SERIALIZED_SIG_SERIAL_NUMBER "Número de Série Assinado Serializado" + IDS_PRINCIPAL_NAME "Nome Principal" + IDS_WINDOWS_PRODUCT_UPDATE "Actualização de Produto Windows" + IDS_ENROLLMENT_NAME_VALUE_PAIR "Par de Inscrição Nome Valor" + IDS_OS_VERSION "Versão do SO" + IDS_ENROLLMENT_CSP "Inscrição CSP" + IDS_CRL_NUMBER "Número CRL" + IDS_DELTA_CRL_INDICATOR "Indicador Delta CRL" + IDS_ISSUING_DIST_POINT "Emissão de Ponto de Distribuição" + IDS_FRESHEST_CRL "CRL Mais Recente" + IDS_NAME_CONSTRAINTS "Restrições de Nome" + IDS_POLICY_MAPPINGS "Mapeamento de Políticas" + IDS_POLICY_CONSTRAINTS "Restrições de Políticas" + IDS_CROSS_CERT_DIST_POINTS "Cross-Certificate Distribution Points" + IDS_APPLICATION_POLICIES "Políticas da Aplicação" + IDS_APPLICATION_POLICY_MAPPINGS "Mapeamento das Políticas da Aplicação" + IDS_APPLICATION_POLICY_CONSTRAINTS "Restrições da Política da Aplicação" + IDS_CMC_DATA "Dados CMC" + IDS_CMC_RESPONSE "Resposta CMC" + IDS_UNSIGNED_CMC_REQUEST "Pedido CMC não assinado" + IDS_CMC_STATUS_INFO "Informação de Estado CMC" + IDS_CMC_EXTENSIONS "Extensões CMC" + IDS_CMC_ATTRIBUTES "Atributos CMC" + IDS_PKCS_7_DATA "Dados PKCS 7" + IDS_PKCS_7_SIGNED "Assinado PKCS 7" + IDS_PKCS_7_ENVELOPED "PKCS 7 Enveloped" + IDS_PKCS_7_SIGNED_ENVELOPED "PKCS 7 Signed Enveloped" + IDS_PKCS_7_DIGESTED "PKCS 7 Resumido" + IDS_PKCS_7_ENCRYPTED "PKCS 7 Cifrado" + IDS_PREVIOUS_CA_CERT_HASH "Hash Certificado CA prévio" + IDS_CRL_VIRTUAL_BASE "Número CRL de Base Virtual" + IDS_CRL_NEXT_PUBLISH "Próxima Publicação CRL" + IDS_CA_EXCHANGE "Certificado de Cifra CA" + IDS_KEY_RECOVERY_AGENT "Agente Recuperador de Chaves" + IDS_CERTIFICATE_TEMPLATE "Informação do Template do Certificado" + IDS_ENTERPRISE_ROOT_OID "Enterprise Root OID" + IDS_RDN_DUMMY_SIGNER "Dummy Signer" + IDS_ARCHIVED_KEY_ATTR "Chave Privada Cifrada" + IDS_CRL_SELF_CDP "Localizações CRL Publicadas" + IDS_REQUIRE_CERT_CHAIN_POLICY "Forçar Política Encadeada de Certificados" + IDS_TRANSACTION_ID "Id da transacção" + IDS_SENDER_NONCE "Sender Nonce" + IDS_RECIPIENT_NONCE "Recipient Nonce" + IDS_REG_INFO "Registo de Informação" + IDS_GET_CERTIFICATE "Obter Certificado" + IDS_GET_CRL "Obter CRL" + IDS_REVOKE_REQUEST "Revogar Pedido" + IDS_QUERY_PENDING "Consulta Pendente" + IDS_SORTED_CTL "Lista Confiável de Certificados" + IDS_ARCHIVED_KEY_CERT_HASH "Hash de Certificados Chave Arquivados" + IDS_PRIVATE_KEY_USAGE_PERIOD "Período de Uso da Chave Privada" + IDS_CLIENT_INFORMATION "Informação do Cliente" + IDS_SERVER_AUTHENTICATION "Autenticação do Servidor" + IDS_CLIENT_AUTHENTICATION "Autenticação do Cliente" + IDS_CODE_SIGNING "Assinatura de Código" + IDS_SECURE_EMAIL "Email seguro" + IDS_TIME_STAMPING "Selo Temporal" + IDS_MICROSOFT_TRUST_LIST_SIGNING "Assinatura da Lista Confiável da Microsoft" + IDS_MICROSOFT_TIME_STAMPING "Selo Temporal da Microsoft" + IDS_IPSEC_END_SYSTEM "Sistema de segurança IP" + IDS_IPSEC_TUNNEL "Terminação do Túnel de Segurança IP" + IDS_IPSEC_USER "Utilizador Seguro IP" + IDS_EFS "Cifrando Sistema de Ficheiros" + IDS_WHQL_CRYPTO "Verificação de Driver de Hardware Windows" + IDS_NT5_CRYPTO "Verificação de Componentes de Sistema Windows" + IDS_OEM_WHQL_CRYPTO "Verificação de Componentes de Sistema OEM Windows" + IDS_EMBEDDED_NT_CRYPTO "Verificação de Componentes de Sistema Windows Embebida" + IDS_KEY_PACK_LICENSES "Licenças de Pacotes de Chaves" + IDS_LICENSE_SERVER "Verificação de Licença de Servidor" + IDS_SMART_CARD_LOGON "Smart Card Logon" + IDS_DIGITAL_RIGHTS "Direitos Digitais" + IDS_QUALIFIED_SUBORDINATION "Subordinação Qualificada" + IDS_KEY_RECOVERY "Recuperação de chaves" + IDS_DOCUMENT_SIGNING "Assinatura de Documento" + IDS_IPSEC_IKE_INTERMEDIATE "Segurança IP Intermédia IKE" + IDS_FILE_RECOVERY "Recuperação de Ficheiros" + IDS_ROOT_LIST_SIGNER "Root List Signer" + IDS_ANY_APPLICATION_POLICIES "Políticas de todas as aplicações" + IDS_DS_EMAIL_REPLICATION "Replicação do Directório de Serviço Email" + IDS_ENROLLMENT_AGENT "Agente de Pedido de Certificados" + IDS_LIFETIME_SIGNING "Assinatura de tempo de vida" + IDS_ANY_CERT_POLICY "Políticas para todas as emissões" +} + +STRINGTABLE DISCARDABLE +{ + IDS_LOCALIZEDNAME_ROOT "Autoridades de Certificação de Raiz Confiáveis" + IDS_LOCALIZEDNAME_MY "Pessoal" + IDS_LOCALIZEDNAME_CA "Autoridades de Certificação Intermédias" + IDS_LOCALIZEDNAME_ADDRESSBOOK "Outras pessoas" +} + +STRINGTABLE DISCARDABLE +{ + IDS_KEY_ID "KeyID=" + IDS_CERT_ISSUER "Emissor do Certificado: " + IDS_CERT_SERIAL_NUMBER "Número de Série do Certificado=" + IDS_ALT_NAME_OTHER_NAME "Outro Nome=" + IDS_ALT_NAME_RFC822_NAME "Endereço Email=" + IDS_ALT_NAME_DNS_NAME "Nome DNS=" + IDS_ALT_NAME_DIRECTORY_NAME "Nome do Directório=" + IDS_ALT_NAME_URL "URL=" + IDS_ALT_NAME_IP_ADDRESS "Endereço IP=" + IDS_ALT_NAME_MASK "Máscara=" + IDS_ALT_NAME_REGISTERED_ID "ID Registado=" + IDS_USAGE_UNKNOWN "Uso de Chave Desconhecido" + IDS_SUBJECT_TYPE "Tipo de Sujeito=" + IDS_SUBJECT_TYPE_CA "CA" + IDS_SUBJECT_TYPE_END_CERT "Fim de Entidade" + IDS_PATH_LENGTH "Restrição de tamanho de caminho=" + IDS_PATH_LENGTH_NONE "Nenhum" + IDS_INFO_NOT_AVAILABLE "Informação não Disponível" + IDS_AIA "Acesso à Informação de Autoridade" + IDS_ACCESS_METHOD "Método de Acesso=" + IDS_ACCESS_METHOD_OCSP "OCSP" + IDS_ACCESS_METHOD_CA_ISSUERS "Emissores CA" + IDS_ACCESS_METHOD_UNKNOWN "Método de Acesso Desconhecido" + IDS_ACCESS_LOCATION "Nome Alternativo" + IDS_CRL_DIST_POINT "Ponto de Distribuição CRL" + IDS_CRL_DIST_POINT_NAME "Nome do Ponto de Distribuição" + IDS_CRL_DIST_POINT_FULL_NAME "Nome Completo" + IDS_CRL_DIST_POINT_RDN_NAME "Nome RDN" + IDS_CRL_DIST_POINT_REASON "Razão CRL=" + IDS_CRL_DIST_POINT_ISSUER "Emissor CRL" + IDS_REASON_KEY_COMPROMISE "Compromisso da Chave" + IDS_REASON_CA_COMPROMISE "Compromisso CA" + IDS_REASON_AFFILIATION_CHANGED "Mudança de afiliação" + IDS_REASON_SUPERSEDED "Supercedente" + IDS_REASON_CESSATION_OF_OPERATION "Operação terminada" + IDS_REASON_CERTIFICATE_HOLD "Certificado em espera" + IDS_FINANCIAL_CRITERIA "Informação Financeira=" + IDS_FINANCIAL_CRITERIA_AVAILABLE "Disponível" + IDS_FINANCIAL_CRITERIA_NOT_AVAILABLE "Não Disponível" + IDS_FINANCIAL_CRITERIA_MEETS_CRITERIA "Conforme os Critérios=" + IDS_YES "Sim" + IDS_NO "Não" +} diff --git a/dlls/crypt32/crypt32_private.h b/dlls/crypt32/crypt32_private.h index 119e30edc05..b0f6101e793 100644 --- a/dlls/crypt32/crypt32_private.h +++ b/dlls/crypt32/crypt32_private.h @@ -287,6 +287,13 @@ BOOL CRYPT_ReadSerializedStoreFromFile(HANDLE file, HCERTSTORE store); void CRYPT_FixKeyProvInfoPointers(PCRYPT_KEY_PROV_INFO info); /** + * String functions + */ + +DWORD cert_name_to_str_with_indent(DWORD dwCertEncodingType, DWORD indent, + PCERT_NAME_BLOB pName, DWORD dwStrType, LPWSTR psz, DWORD csz); + +/** * Context functions */ diff --git a/dlls/crypt32/cryptres.h b/dlls/crypt32/cryptres.h index 894b3bd163d..6d0ac46b420 100644 --- a/dlls/crypt32/cryptres.h +++ b/dlls/crypt32/cryptres.h @@ -198,7 +198,7 @@ #define IDS_REASON_KEY_COMPROMISE 1231 #define IDS_REASON_CA_COMPROMISE 1232 #define IDS_REASON_AFFILIATION_CHANGED 1233 -#define IDS_REASON_SUPERCEDED 1234 +#define IDS_REASON_SUPERSEDED 1234 #define IDS_REASON_CESSATION_OF_OPERATION 1235 #define IDS_REASON_CERTIFICATE_HOLD 1236 #define IDS_FINANCIAL_CRITERIA 1237 @@ -207,5 +207,22 @@ #define IDS_FINANCIAL_CRITERIA_MEETS_CRITERIA 1240 #define IDS_YES 1241 #define IDS_NO 1242 +#define IDS_DIGITAL_SIGNATURE 1243 +#define IDS_NON_REPUDIATION 1244 +#define IDS_KEY_ENCIPHERMENT 1245 +#define IDS_DATA_ENCIPHERMENT 1246 +#define IDS_KEY_AGREEMENT 1247 +#define IDS_CERT_SIGN 1248 +#define IDS_OFFLINE_CRL_SIGN 1249 +#define IDS_CRL_SIGN 1250 +#define IDS_ENCIPHER_ONLY 1251 +#define IDS_DECIPHER_ONLY 1252 +#define IDS_NETSCAPE_SSL_CLIENT 1253 +#define IDS_NETSCAPE_SSL_SERVER 1254 +#define IDS_NETSCAPE_SMIME 1255 +#define IDS_NETSCAPE_SIGN 1256 +#define IDS_NETSCAPE_SSL_CA 1257 +#define IDS_NETSCAPE_SMIME_CA 1258 +#define IDS_NETSCAPE_SIGN_CA 1259 #endif /* ndef __WINE_CRYPTRES_H__ */ diff --git a/dlls/crypt32/decode.c b/dlls/crypt32/decode.c index 6cb504777c1..84b08e71498 100644 --- a/dlls/crypt32/decode.c +++ b/dlls/crypt32/decode.c @@ -1629,48 +1629,59 @@ static BOOL CRYPT_AsnDecodeUnicodeNameValueInternal(const BYTE *pbEncoded, { case ASN_NUMERICSTRING: valueType = CERT_RDN_NUMERIC_STRING; - bytesNeeded += dataLen * 2; + if (dataLen) + bytesNeeded += (dataLen + 1) * 2; break; case ASN_PRINTABLESTRING: valueType = CERT_RDN_PRINTABLE_STRING; - bytesNeeded += dataLen * 2; + if (dataLen) + bytesNeeded += (dataLen + 1) * 2; break; case ASN_IA5STRING: valueType = CERT_RDN_IA5_STRING; - bytesNeeded += dataLen * 2; + if (dataLen) + bytesNeeded += (dataLen + 1) * 2; break; case ASN_T61STRING: valueType = CERT_RDN_T61_STRING; - bytesNeeded += dataLen * 2; + if (dataLen) + bytesNeeded += (dataLen + 1) * 2; break; case ASN_VIDEOTEXSTRING: valueType = CERT_RDN_VIDEOTEX_STRING; - bytesNeeded += dataLen * 2; + if (dataLen) + bytesNeeded += (dataLen + 1) * 2; break; case ASN_GRAPHICSTRING: valueType = CERT_RDN_GRAPHIC_STRING; - bytesNeeded += dataLen * 2; + if (dataLen) + bytesNeeded += (dataLen + 1) * 2; break; case ASN_VISIBLESTRING: valueType = CERT_RDN_VISIBLE_STRING; - bytesNeeded += dataLen * 2; + if (dataLen) + bytesNeeded += (dataLen + 1) * 2; break; case ASN_GENERALSTRING: valueType = CERT_RDN_GENERAL_STRING; - bytesNeeded += dataLen * 2; + if (dataLen) + bytesNeeded += (dataLen + 1) * 2; break; case ASN_UNIVERSALSTRING: valueType = CERT_RDN_UNIVERSAL_STRING; - bytesNeeded += dataLen / 2; + if (dataLen) + bytesNeeded += dataLen / 2 + sizeof(WCHAR); break; case ASN_BMPSTRING: valueType = CERT_RDN_BMP_STRING; - bytesNeeded += dataLen; + if (dataLen) + bytesNeeded += dataLen + sizeof(WCHAR); break; case ASN_UTF8STRING: valueType = CERT_RDN_UTF8_STRING; - bytesNeeded += MultiByteToWideChar(CP_UTF8, 0, - (LPCSTR)pbEncoded + 1 + lenBytes, dataLen, NULL, 0) * 2; + if (dataLen) + bytesNeeded += (MultiByteToWideChar(CP_UTF8, 0, + (LPCSTR)pbEncoded + 1 + lenBytes, dataLen, NULL, 0) + 1) * 2; break; default: SetLastError(CRYPT_E_ASN1_BADTAG); @@ -1710,23 +1721,29 @@ static BOOL CRYPT_AsnDecodeUnicodeNameValueInternal(const BYTE *pbEncoded, value->Value.cbData = dataLen * 2; for (i = 0; i < dataLen; i++) str[i] = pbEncoded[1 + lenBytes + i]; + str[i] = 0; break; case ASN_UNIVERSALSTRING: value->Value.cbData = dataLen / 2; for (i = 0; i < dataLen / 4; i++) str[i] = (pbEncoded[1 + lenBytes + 2 * i + 2] << 8) | pbEncoded[1 + lenBytes + 2 * i + 3]; + str[i] = 0; break; case ASN_BMPSTRING: value->Value.cbData = dataLen; for (i = 0; i < dataLen / 2; i++) str[i] = (pbEncoded[1 + lenBytes + 2 * i] << 8) | pbEncoded[1 + lenBytes + 2 * i + 1]; + str[i] = 0; break; case ASN_UTF8STRING: value->Value.cbData = MultiByteToWideChar(CP_UTF8, 0, (LPCSTR)pbEncoded + 1 + lenBytes, dataLen, str, bytesNeeded - sizeof(CERT_NAME_VALUE)) * 2; + value->Value.pbData[value->Value.cbData / sizeof(WCHAR)] + = 0; + value->Value.cbData += sizeof(WCHAR); break; } } @@ -2241,6 +2258,267 @@ static BOOL WINAPI CRYPT_AsnDecodeSMIMECapabilities(DWORD dwCertEncodingType, return ret; } +static BOOL CRYPT_AsnDecodeIA5String(const BYTE *pbEncoded, + DWORD cbEncoded, DWORD dwFlags, void *pvStructInfo, DWORD *pcbStructInfo, + DWORD *pcbDecoded) +{ + BOOL ret = TRUE; + DWORD dataLen; + LPSTR *pStr = pvStructInfo; + + if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen))) + { + BYTE lenBytes = GET_LEN_BYTES(pbEncoded[1]); + DWORD bytesNeeded = sizeof(LPSTR) + sizeof(char); + + if (pbEncoded[0] != ASN_IA5STRING) + { + SetLastError(CRYPT_E_ASN1_CORRUPT); + ret = FALSE; + } + else + { + bytesNeeded += dataLen; + if (pcbDecoded) + *pcbDecoded = 1 + lenBytes + dataLen; + if (!pvStructInfo) + *pcbStructInfo = bytesNeeded; + else if (*pcbStructInfo < bytesNeeded) + { + *pcbStructInfo = bytesNeeded; + SetLastError(ERROR_MORE_DATA); + ret = FALSE; + } + else + { + *pcbStructInfo = bytesNeeded; + if (dataLen) + { + LPSTR str = *pStr; + + assert(str); + memcpy(str, pbEncoded + 1 + lenBytes, dataLen); + str[dataLen] = 0; + } + else + *pStr = NULL; + } + } + } + return ret; +} + +static BOOL CRYPT_AsnDecodeIntArray(const BYTE *pbEncoded, + DWORD cbEncoded, DWORD dwFlags, void *pvStructInfo, DWORD *pcbStructInfo, + DWORD *pcbDecoded) +{ + struct AsnArrayDescriptor arrayDesc = { ASN_SEQUENCEOF, + CRYPT_AsnDecodeIntInternal, sizeof(int), FALSE, 0 }; + struct GenericArray *array = pvStructInfo; + BOOL ret; + + TRACE("(%p, %d, %08x, %p, %d)\n", pbEncoded, cbEncoded, dwFlags, + pvStructInfo, pvStructInfo ? *pcbDecoded : 0); + + ret = CRYPT_AsnDecodeArray(&arrayDesc, pbEncoded, cbEncoded, dwFlags, + NULL, pvStructInfo, pcbStructInfo, pcbDecoded, + array ? array->rgItems : NULL); + TRACE("returning %d\n", ret); + return ret; +} + +static BOOL CRYPT_AsnDecodeNoticeReference(const BYTE *pbEncoded, + DWORD cbEncoded, DWORD dwFlags, void *pvStructInfo, DWORD *pcbStructInfo, + DWORD *pcbDecoded) +{ + BOOL ret; + struct AsnDecodeSequenceItem items[] = { + { ASN_IA5STRING, offsetof(CERT_POLICY_QUALIFIER_NOTICE_REFERENCE, + pszOrganization), CRYPT_AsnDecodeIA5String, sizeof(LPSTR), FALSE, TRUE, + offsetof(CERT_POLICY_QUALIFIER_NOTICE_REFERENCE, pszOrganization), 0 }, + { ASN_SEQUENCEOF, offsetof(CERT_POLICY_QUALIFIER_NOTICE_REFERENCE, + cNoticeNumbers), CRYPT_AsnDecodeIntArray, sizeof(struct GenericArray), + FALSE, TRUE, offsetof(CERT_POLICY_QUALIFIER_NOTICE_REFERENCE, + rgNoticeNumbers), 0 }, + }; + DWORD bytesNeeded; + + TRACE("%p, %d, %08x, %p, %d\n", pbEncoded, cbEncoded, dwFlags, + pvStructInfo, pvStructInfo ? *pcbStructInfo : 0); + + ret = CRYPT_AsnDecodeSequence(items, sizeof(items) / sizeof(items[0]), + pbEncoded, cbEncoded, dwFlags, NULL, NULL, &bytesNeeded, pcbDecoded, + NULL); + if (ret) + { + /* The caller is expecting a pointer to a + * CERT_POLICY_QUALIFIER_NOTICE_REFERENCE to be decoded, whereas + * CRYPT_AsnDecodeSequence is decoding a + * CERT_POLICY_QUALIFIER_NOTICE_REFERENCE. Increment the bytes + * needed, and decode again if the requisite space is available. + */ + bytesNeeded += sizeof(PCERT_POLICY_QUALIFIER_NOTICE_REFERENCE); + if (!pvStructInfo) + *pcbStructInfo = bytesNeeded; + else if (*pcbStructInfo < bytesNeeded) + { + *pcbStructInfo = bytesNeeded; + SetLastError(ERROR_MORE_DATA); + ret = FALSE; + } + else + { + PCERT_POLICY_QUALIFIER_NOTICE_REFERENCE noticeRef; + + *pcbStructInfo = bytesNeeded; + /* The pointer (pvStructInfo) passed in points to the first dynamic + * pointer, so use it as the pointer to the + * CERT_POLICY_QUALIFIER_NOTICE_REFERENCE, and create the + * appropriate offset for the first dynamic pointer within the + * notice reference by pointing to the first memory location past + * the CERT_POLICY_QUALIFIER_NOTICE_REFERENCE. + */ + noticeRef = + *(PCERT_POLICY_QUALIFIER_NOTICE_REFERENCE *)pvStructInfo; + noticeRef->pszOrganization = (LPSTR)((LPBYTE)noticeRef + + sizeof(CERT_POLICY_QUALIFIER_NOTICE_REFERENCE)); + ret = CRYPT_AsnDecodeSequence(items, + sizeof(items) / sizeof(items[0]), pbEncoded, cbEncoded, dwFlags, + NULL, noticeRef, &bytesNeeded, pcbDecoded, + noticeRef->pszOrganization); + } + } + TRACE("returning %d\n", ret); + return ret; +} + +static BOOL CRYPT_AsnDecodeBMPString(const BYTE *pbEncoded, + DWORD cbEncoded, DWORD dwFlags, void *pvStructInfo, DWORD *pcbStructInfo, + DWORD *pcbDecoded) +{ + BOOL ret = TRUE; + DWORD dataLen; + LPWSTR *pStr = pvStructInfo; + + if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen))) + { + BYTE lenBytes = GET_LEN_BYTES(pbEncoded[1]); + DWORD bytesNeeded = sizeof(LPWSTR) + sizeof(WCHAR); + + if (pbEncoded[0] != ASN_BMPSTRING) + { + SetLastError(CRYPT_E_ASN1_CORRUPT); + ret = FALSE; + } + else + { + bytesNeeded += dataLen; + if (pcbDecoded) + *pcbDecoded = 1 + lenBytes + dataLen; + if (!pvStructInfo) + *pcbStructInfo = bytesNeeded; + else if (*pcbStructInfo < bytesNeeded) + { + *pcbStructInfo = bytesNeeded; + SetLastError(ERROR_MORE_DATA); + ret = FALSE; + } + else + { + *pcbStructInfo = bytesNeeded; + if (dataLen) + { + DWORD i; + LPWSTR str = *pStr; + + assert(str); + for (i = 0; i < dataLen / 2; i++) + str[i] = (pbEncoded[1 + lenBytes + 2 * i] << 8) | + pbEncoded[1 + lenBytes + 2 * i + 1]; + str[i] = 0; + } + else + *pStr = NULL; + } + } + } + return ret; +} + +static BOOL CRYPT_AsnDecodePolicyQualifierUserNoticeInternal( + const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags, void *pvStructInfo, + DWORD *pcbStructInfo, DWORD *pcbDecoded) +{ + BOOL ret; + struct AsnDecodeSequenceItem items[] = { + { ASN_SEQUENCE, offsetof(CERT_POLICY_QUALIFIER_USER_NOTICE, + pNoticeReference), CRYPT_AsnDecodeNoticeReference, + sizeof(PCERT_POLICY_QUALIFIER_NOTICE_REFERENCE), TRUE, TRUE, + offsetof(CERT_POLICY_QUALIFIER_USER_NOTICE, pNoticeReference), 0 }, + { ASN_BMPSTRING, offsetof(CERT_POLICY_QUALIFIER_USER_NOTICE, + pszDisplayText), CRYPT_AsnDecodeBMPString, sizeof(LPWSTR), TRUE, TRUE, + offsetof(CERT_POLICY_QUALIFIER_USER_NOTICE, pszDisplayText), 0 }, + }; + PCERT_POLICY_QUALIFIER_USER_NOTICE notice = pvStructInfo; + + TRACE("%p, %d, %08x, %p, %d\n", pbEncoded, cbEncoded, dwFlags, + pvStructInfo, *pcbStructInfo); + + ret = CRYPT_AsnDecodeSequence(items, sizeof(items) / sizeof(items[0]), + pbEncoded, cbEncoded, dwFlags, NULL, pvStructInfo, pcbStructInfo, + pcbDecoded, notice ? notice->pNoticeReference : NULL); + TRACE("returning %d\n", ret); + return ret; +} + +static BOOL WINAPI CRYPT_AsnDecodePolicyQualifierUserNotice( + DWORD dwCertEncodingType, LPCSTR lpszStructType, const BYTE *pbEncoded, + DWORD cbEncoded, DWORD dwFlags, PCRYPT_DECODE_PARA pDecodePara, + void *pvStructInfo, DWORD *pcbStructInfo) +{ + BOOL ret = FALSE; + + TRACE("%p, %d, %08x, %p, %p, %d\n", pbEncoded, cbEncoded, dwFlags, + pDecodePara, pvStructInfo, *pcbStructInfo); + + __TRY + { + DWORD bytesNeeded; + + ret = CRYPT_AsnDecodePolicyQualifierUserNoticeInternal(pbEncoded, + cbEncoded, dwFlags & ~CRYPT_DECODE_ALLOC_FLAG, NULL, &bytesNeeded, + NULL); + if (ret) + { + if (!pvStructInfo) + *pcbStructInfo = bytesNeeded; + else if ((ret = CRYPT_DecodeEnsureSpace(dwFlags, pDecodePara, + pvStructInfo, pcbStructInfo, bytesNeeded))) + { + PCERT_POLICY_QUALIFIER_USER_NOTICE notice; + + if (dwFlags & CRYPT_DECODE_ALLOC_FLAG) + pvStructInfo = *(BYTE **)pvStructInfo; + notice = pvStructInfo; + notice->pNoticeReference = + (PCERT_POLICY_QUALIFIER_NOTICE_REFERENCE) + ((BYTE *)pvStructInfo + + sizeof(CERT_POLICY_QUALIFIER_USER_NOTICE)); + ret = CRYPT_AsnDecodePolicyQualifierUserNoticeInternal( + pbEncoded, cbEncoded, dwFlags & ~CRYPT_DECODE_ALLOC_FLAG, + pvStructInfo, &bytesNeeded, NULL); + } + } + } + __EXCEPT_PAGE_FAULT + { + SetLastError(STATUS_ACCESS_VIOLATION); + } + __ENDTRY + TRACE("returning %d\n", ret); + return ret; +} + static BOOL CRYPT_AsnDecodePKCSAttributeInternal(const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags, void *pvStructInfo, DWORD *pcbStructInfo, DWORD *pcbDecoded) @@ -3118,6 +3396,100 @@ static BOOL WINAPI CRYPT_AsnDecodeBasicConstraints2(DWORD dwCertEncodingType, return ret; } +static BOOL CRYPT_AsnDecodePolicyQualifier(const BYTE *pbEncoded, + DWORD cbEncoded, DWORD dwFlags, void *pvStructInfo, DWORD *pcbStructInfo, + DWORD *pcbDecoded) +{ + struct AsnDecodeSequenceItem items[] = { + { ASN_OBJECTIDENTIFIER, offsetof(CERT_POLICY_QUALIFIER_INFO, + pszPolicyQualifierId), CRYPT_AsnDecodeOidInternal, sizeof(LPSTR), + FALSE, TRUE, offsetof(CERT_POLICY_QUALIFIER_INFO, pszPolicyQualifierId), + 0 }, + { 0, offsetof(CERT_POLICY_QUALIFIER_INFO, Qualifier), + CRYPT_AsnDecodeDerBlob, sizeof(CRYPT_OBJID_BLOB), TRUE, TRUE, + offsetof(CERT_POLICY_QUALIFIER_INFO, Qualifier.pbData), 0 }, + }; + BOOL ret; + CERT_POLICY_QUALIFIER_INFO *qualifier = pvStructInfo; + + TRACE("%p, %d, %08x, %p, %d\n", pbEncoded, cbEncoded, dwFlags, + pvStructInfo, pvStructInfo ? *pcbStructInfo : 0); + + ret = CRYPT_AsnDecodeSequence(items, sizeof(items) / sizeof(items[0]), + pbEncoded, cbEncoded, dwFlags, NULL, pvStructInfo, pcbStructInfo, + pcbDecoded, qualifier ? qualifier->pszPolicyQualifierId : NULL); + return ret; +} + +static BOOL CRYPT_AsnDecodePolicyQualifiers(const BYTE *pbEncoded, + DWORD cbEncoded, DWORD dwFlags, void *pvStructInfo, DWORD *pcbStructInfo, + DWORD *pcbDecoded) +{ + BOOL ret; + struct AsnArrayDescriptor arrayDesc = { ASN_SEQUENCEOF, + CRYPT_AsnDecodePolicyQualifier, sizeof(CERT_POLICY_QUALIFIER_INFO), TRUE, + offsetof(CERT_POLICY_QUALIFIER_INFO, pszPolicyQualifierId) }; + struct GenericArray *entries = pvStructInfo; + + TRACE("%p, %d, %08x, %p, %d\n", pbEncoded, cbEncoded, dwFlags, + pvStructInfo, pvStructInfo ? *pcbStructInfo : 0); + + ret = CRYPT_AsnDecodeArray(&arrayDesc, pbEncoded, cbEncoded, dwFlags, + NULL, pvStructInfo, pcbStructInfo, pcbDecoded, + entries ? entries->rgItems : NULL); + TRACE("Returning %d (%08x)\n", ret, GetLastError()); + return ret; +} + +static BOOL CRYPT_AsnDecodeCertPolicy(const BYTE *pbEncoded, DWORD cbEncoded, + DWORD dwFlags, void *pvStructInfo, DWORD *pcbStructInfo, DWORD *pcbDecoded) +{ + struct AsnDecodeSequenceItem items[] = { + { ASN_OBJECTIDENTIFIER, offsetof(CERT_POLICY_INFO, pszPolicyIdentifier), + CRYPT_AsnDecodeOidInternal, sizeof(LPSTR), FALSE, TRUE, + offsetof(CERT_POLICY_INFO, pszPolicyIdentifier), 0 }, + { ASN_SEQUENCEOF, offsetof(CERT_POLICY_INFO, cPolicyQualifier), + CRYPT_AsnDecodePolicyQualifiers, sizeof(struct GenericArray), TRUE, + TRUE, offsetof(CERT_POLICY_INFO, rgPolicyQualifier), 0 }, + }; + CERT_POLICY_INFO *info = pvStructInfo; + BOOL ret; + + TRACE("%p, %d, %08x, %p, %d\n", pbEncoded, cbEncoded, dwFlags, + pvStructInfo, pvStructInfo ? *pcbStructInfo : 0); + + ret = CRYPT_AsnDecodeSequence(items, sizeof(items) / sizeof(items[0]), + pbEncoded, cbEncoded, dwFlags, NULL, pvStructInfo, pcbStructInfo, + pcbDecoded, info ? info->pszPolicyIdentifier : NULL); + return ret; +} + +static BOOL WINAPI CRYPT_AsnDecodeCertPolicies(DWORD dwCertEncodingType, + LPCSTR lpszStructType, const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags, + PCRYPT_DECODE_PARA pDecodePara, void *pvStructInfo, DWORD *pcbStructInfo) +{ + BOOL ret = FALSE; + + TRACE("%p, %d, %08x, %p, %p, %d\n", pbEncoded, cbEncoded, dwFlags, + pDecodePara, pvStructInfo, pvStructInfo ? *pcbStructInfo : 0); + + __TRY + { + struct AsnArrayDescriptor arrayDesc = { ASN_SEQUENCEOF, + CRYPT_AsnDecodeCertPolicy, sizeof(CERT_POLICY_INFO), TRUE, + offsetof(CERT_POLICY_INFO, pszPolicyIdentifier) }; + + ret = CRYPT_AsnDecodeArray(&arrayDesc, pbEncoded, cbEncoded, dwFlags, + pDecodePara, pvStructInfo, pcbStructInfo, NULL, NULL); + } + __EXCEPT_PAGE_FAULT + { + SetLastError(STATUS_ACCESS_VIOLATION); + } + __ENDTRY + return ret; +} + #define RSA1_MAGIC 0x31415352 struct DECODED_RSA_PUB_KEY @@ -4248,11 +4620,12 @@ static BOOL CRYPT_AsnDecodeDistPoint(const BYTE *pbEncoded, DWORD cbEncoded, CRYPT_AsnDecodeAltNameInternal, sizeof(CERT_ALT_NAME_INFO), TRUE, TRUE, offsetof(CRL_DIST_POINT, CRLIssuer.rgAltEntry), 0 }, }; + CRL_DIST_POINT *point = (CRL_DIST_POINT *)pvStructInfo; BOOL ret; ret = CRYPT_AsnDecodeSequence(items, sizeof(items) / sizeof(items[0]), pbEncoded, cbEncoded, dwFlags, NULL, pvStructInfo, pcbStructInfo, - pcbDecoded, NULL); + pcbDecoded, point ? point->DistPointName.u.FullName.rgAltEntry : NULL); return ret; } @@ -4811,6 +5184,9 @@ static CryptDecodeObjectExFunc CRYPT_GetBuiltinDecoder(DWORD dwCertEncodingType, case LOWORD(X509_BASIC_CONSTRAINTS2): decodeFunc = CRYPT_AsnDecodeBasicConstraints2; break; + case LOWORD(X509_CERT_POLICIES): + decodeFunc = CRYPT_AsnDecodeCertPolicies; + break; case LOWORD(RSA_CSP_PUBLICKEYBLOB): decodeFunc = CRYPT_AsnDecodeRsaPubKey; break; @@ -4872,6 +5248,9 @@ static CryptDecodeObjectExFunc CRYPT_GetBuiltinDecoder(DWORD dwCertEncodingType, case LOWORD(PKCS_SMIME_CAPABILITIES): decodeFunc = CRYPT_AsnDecodeSMIMECapabilities; break; + case LOWORD(X509_PKIX_POLICY_QUALIFIER_USERNOTICE): + decodeFunc = CRYPT_AsnDecodePolicyQualifierUserNotice; + break; case LOWORD(PKCS_ATTRIBUTES): decodeFunc = CRYPT_AsnDecodePKCSAttributes; break; @@ -4921,6 +5300,8 @@ static CryptDecodeObjectExFunc CRYPT_GetBuiltinDecoder(DWORD dwCertEncodingType, decodeFunc = CRYPT_AsnDecodeAltName; else if (!strcmp(lpszStructType, szOID_CRL_DIST_POINTS)) decodeFunc = CRYPT_AsnDecodeCRLDistPoints; + else if (!strcmp(lpszStructType, szOID_CERT_POLICIES)) + decodeFunc = CRYPT_AsnDecodeCertPolicies; else if (!strcmp(lpszStructType, szOID_ENHANCED_KEY_USAGE)) decodeFunc = CRYPT_AsnDecodeEnhancedKeyUsage; else if (!strcmp(lpszStructType, szOID_ISSUING_DIST_POINT)) @@ -4929,6 +5310,8 @@ static CryptDecodeObjectExFunc CRYPT_GetBuiltinDecoder(DWORD dwCertEncodingType, decodeFunc = CRYPT_AsnDecodeNameConstraints; else if (!strcmp(lpszStructType, szOID_AUTHORITY_INFO_ACCESS)) decodeFunc = CRYPT_AsnDecodeAuthorityInfoAccess; + else if (!strcmp(lpszStructType, szOID_PKIX_POLICY_QUALIFIER_USERNOTICE)) + decodeFunc = CRYPT_AsnDecodePolicyQualifierUserNotice; else if (!strcmp(lpszStructType, szOID_CTL)) decodeFunc = CRYPT_AsnDecodeCTL; return decodeFunc; diff --git a/dlls/crypt32/encode.c b/dlls/crypt32/encode.c index e474ff700ad..9e102987721 100644 --- a/dlls/crypt32/encode.c +++ b/dlls/crypt32/encode.c @@ -1697,6 +1697,114 @@ static BOOL WINAPI CRYPT_AsnEncodeSMIMECapabilities(DWORD dwCertEncodingType, return ret; } +static BOOL WINAPI CRYPT_AsnEncodeNoticeNumbers(DWORD dwCertEncodingType, + LPCSTR lpszStructType, const void *pvStructInfo, DWORD dwFlags, + PCRYPT_ENCODE_PARA pEncodePara, BYTE *pbEncoded, DWORD *pcbEncoded) +{ + const CERT_POLICY_QUALIFIER_NOTICE_REFERENCE *noticeRef = pvStructInfo; + DWORD bytesNeeded, dataLen, lenBytes, i; + BOOL ret = TRUE; + + for (i = 0, dataLen = 0; ret && i < noticeRef->cNoticeNumbers; i++) + { + DWORD size; + + ret = CRYPT_AsnEncodeInt(dwCertEncodingType, X509_INTEGER, + ¬iceRef->rgNoticeNumbers[i], 0, NULL, NULL, &size); + if (ret) + dataLen += size; + } + if (ret) + { + CRYPT_EncodeLen(dataLen, NULL, &lenBytes); + bytesNeeded = 1 + lenBytes + dataLen; + if (!pbEncoded) + *pcbEncoded = bytesNeeded; + else + { + if ((ret = CRYPT_EncodeEnsureSpace(dwFlags, pEncodePara, pbEncoded, + pcbEncoded, bytesNeeded))) + { + if (dwFlags & CRYPT_ENCODE_ALLOC_FLAG) + pbEncoded = *(BYTE **)pbEncoded; + *pbEncoded++ = ASN_SEQUENCE; + CRYPT_EncodeLen(dataLen, pbEncoded, &lenBytes); + pbEncoded += lenBytes; + for (i = 0; i < noticeRef->cNoticeNumbers; i++) + { + DWORD size = dataLen; + + ret = CRYPT_AsnEncodeInt(dwCertEncodingType, X509_INTEGER, + ¬iceRef->rgNoticeNumbers[i], 0, NULL, pbEncoded, &size); + pbEncoded += size; + dataLen -= size; + } + } + } + } + return ret; +} + +static BOOL WINAPI CRYPT_AsnEncodeNoticeReference(DWORD dwCertEncodingType, + LPCSTR lpszStructType, const void *pvStructInfo, DWORD dwFlags, + PCRYPT_ENCODE_PARA pEncodePara, BYTE *pbEncoded, DWORD *pcbEncoded) +{ + const CERT_POLICY_QUALIFIER_NOTICE_REFERENCE *noticeRef = pvStructInfo; + BOOL ret; + CERT_NAME_VALUE orgValue = { CERT_RDN_IA5_STRING, + { 0, (LPBYTE)noticeRef->pszOrganization } }; + struct AsnEncodeSequenceItem items[] = { + { &orgValue, CRYPT_AsnEncodeNameValue, 0 }, + { noticeRef, CRYPT_AsnEncodeNoticeNumbers, 0 }, + }; + + ret = CRYPT_AsnEncodeSequence(dwCertEncodingType, items, + sizeof(items) / sizeof(items[0]), dwFlags, pEncodePara, pbEncoded, + pcbEncoded); + return ret; +} + +static BOOL WINAPI CRYPT_AsnEncodePolicyQualifierUserNotice( + DWORD dwCertEncodingType, LPCSTR lpszStructType, const void *pvStructInfo, + DWORD dwFlags, PCRYPT_ENCODE_PARA pEncodePara, BYTE *pbEncoded, + DWORD *pcbEncoded) +{ + BOOL ret = FALSE; + + __TRY + { + const CERT_POLICY_QUALIFIER_USER_NOTICE *notice = pvStructInfo; + struct AsnEncodeSequenceItem items[2]; + CERT_NAME_VALUE displayTextValue; + DWORD cItem = 0; + + ret = TRUE; + if (notice->pNoticeReference) + { + items[cItem].encodeFunc = CRYPT_AsnEncodeNoticeReference; + items[cItem].pvStructInfo = notice->pNoticeReference; + cItem++; + } + if (notice->pszDisplayText) + { + displayTextValue.dwValueType = CERT_RDN_BMP_STRING; + displayTextValue.Value.cbData = 0; + displayTextValue.Value.pbData = (LPBYTE)notice->pszDisplayText; + items[cItem].encodeFunc = CRYPT_AsnEncodeNameValue; + items[cItem].pvStructInfo = &displayTextValue; + cItem++; + } + ret = CRYPT_AsnEncodeSequence(dwCertEncodingType, items, cItem, + dwFlags, pEncodePara, pbEncoded, pcbEncoded); + } + __EXCEPT_PAGE_FAULT + { + SetLastError(STATUS_ACCESS_VIOLATION); + } + __ENDTRY + return ret; +} + static BOOL WINAPI CRYPT_AsnEncodePKCSAttribute(DWORD dwCertEncodingType, LPCSTR lpszStructType, const void *pvStructInfo, DWORD dwFlags, PCRYPT_ENCODE_PARA pEncodePara, BYTE *pbEncoded, DWORD *pcbEncoded) @@ -2704,6 +2812,162 @@ static BOOL WINAPI CRYPT_AsnEncodeBasicConstraints2(DWORD dwCertEncodingType, return ret; } +static BOOL WINAPI CRYPT_AsnEncodeCertPolicyQualifiers(DWORD dwCertEncodingType, + LPCSTR lpszStructType, const void *pvStructInfo, DWORD dwFlags, + PCRYPT_ENCODE_PARA pEncodePara, BYTE *pbEncoded, DWORD *pcbEncoded) +{ + DWORD cPolicyQualifier = *(DWORD *)pvStructInfo; + const CERT_POLICY_QUALIFIER_INFO *rgPolicyQualifier = + *(const CERT_POLICY_QUALIFIER_INFO **) + ((LPBYTE)pvStructInfo + sizeof(DWORD)); + BOOL ret; + + if (!cPolicyQualifier) + { + *pcbEncoded = 0; + ret = TRUE; + } + else + { + struct AsnEncodeSequenceItem items[2] = { + { NULL, CRYPT_AsnEncodeOid, 0 }, + { NULL, CRYPT_CopyEncodedBlob, 0 }, + }; + DWORD bytesNeeded = 0, lenBytes, size, i; + + ret = TRUE; + for (i = 0; ret && i < cPolicyQualifier; i++) + { + items[0].pvStructInfo = rgPolicyQualifier[i].pszPolicyQualifierId; + items[1].pvStructInfo = &rgPolicyQualifier[i].Qualifier; + ret = CRYPT_AsnEncodeSequence(dwCertEncodingType, items, + sizeof(items) / sizeof(items[0]), + dwFlags & ~CRYPT_ENCODE_ALLOC_FLAG, NULL, NULL, &size); + if (ret) + bytesNeeded += size; + } + CRYPT_EncodeLen(bytesNeeded, NULL, &lenBytes); + bytesNeeded += 1 + lenBytes; + if (ret) + { + if (!pbEncoded) + *pcbEncoded = bytesNeeded; + else + { + if ((ret = CRYPT_EncodeEnsureSpace(dwFlags, pEncodePara, + pbEncoded, pcbEncoded, bytesNeeded))) + { + if (dwFlags & CRYPT_ENCODE_ALLOC_FLAG) + pbEncoded = *(BYTE **)pbEncoded; + *pbEncoded++ = ASN_SEQUENCEOF; + CRYPT_EncodeLen(bytesNeeded - lenBytes - 1, pbEncoded, + &lenBytes); + pbEncoded += lenBytes; + for (i = 0; ret && i < cPolicyQualifier; i++) + { + items[0].pvStructInfo = + rgPolicyQualifier[i].pszPolicyQualifierId; + items[1].pvStructInfo = + &rgPolicyQualifier[i].Qualifier; + size = bytesNeeded; + ret = CRYPT_AsnEncodeSequence(dwCertEncodingType, items, + sizeof(items) / sizeof(items[0]), + dwFlags & ~CRYPT_ENCODE_ALLOC_FLAG, NULL, pbEncoded, + &size); + if (ret) + { + pbEncoded += size; + bytesNeeded -= size; + } + } + } + } + } + } + return ret; +} + +static BOOL CRYPT_AsnEncodeCertPolicy(DWORD dwCertEncodingType, + const CERT_POLICY_INFO *info, DWORD dwFlags, BYTE *pbEncoded, + DWORD *pcbEncoded) +{ + struct AsnEncodeSequenceItem items[2] = { + { info->pszPolicyIdentifier, CRYPT_AsnEncodeOid, 0 }, + { &info->cPolicyQualifier, CRYPT_AsnEncodeCertPolicyQualifiers, 0 }, + }; + BOOL ret; + + if (!info->pszPolicyIdentifier) + { + SetLastError(E_INVALIDARG); + return FALSE; + } + ret = CRYPT_AsnEncodeSequence(dwCertEncodingType, items, + sizeof(items) / sizeof(items[0]), dwFlags, NULL, pbEncoded, pcbEncoded); + return ret; +} + +static BOOL WINAPI CRYPT_AsnEncodeCertPolicies(DWORD dwCertEncodingType, + LPCSTR lpszStructType, const void *pvStructInfo, DWORD dwFlags, + PCRYPT_ENCODE_PARA pEncodePara, BYTE *pbEncoded, DWORD *pcbEncoded) +{ + BOOL ret = FALSE; + + __TRY + { + const CERT_POLICIES_INFO *info = pvStructInfo; + DWORD bytesNeeded = 0, lenBytes, size, i; + + ret = TRUE; + for (i = 0; ret && i < info->cPolicyInfo; i++) + { + ret = CRYPT_AsnEncodeCertPolicy(dwCertEncodingType, + &info->rgPolicyInfo[i], dwFlags & ~CRYPT_ENCODE_ALLOC_FLAG, NULL, + &size); + if (ret) + bytesNeeded += size; + } + CRYPT_EncodeLen(bytesNeeded, NULL, &lenBytes); + bytesNeeded += 1 + lenBytes; + if (ret) + { + if (!pbEncoded) + *pcbEncoded = bytesNeeded; + else + { + if ((ret = CRYPT_EncodeEnsureSpace(dwFlags, pEncodePara, + pbEncoded, pcbEncoded, bytesNeeded))) + { + if (dwFlags & CRYPT_ENCODE_ALLOC_FLAG) + pbEncoded = *(BYTE **)pbEncoded; + *pbEncoded++ = ASN_SEQUENCEOF; + CRYPT_EncodeLen(bytesNeeded - lenBytes - 1, pbEncoded, + &lenBytes); + pbEncoded += lenBytes; + for (i = 0; ret && i < info->cPolicyInfo; i++) + { + size = bytesNeeded; + ret = CRYPT_AsnEncodeCertPolicy(dwCertEncodingType, + &info->rgPolicyInfo[i], + dwFlags & ~CRYPT_ENCODE_ALLOC_FLAG, pbEncoded, &size); + if (ret) + { + pbEncoded += size; + bytesNeeded -= size; + } + } + } + } + } + } + __EXCEPT_PAGE_FAULT + { + SetLastError(STATUS_ACCESS_VIOLATION); + } + __ENDTRY + return ret; +} + static BOOL WINAPI CRYPT_AsnEncodeRsaPubKey(DWORD dwCertEncodingType, LPCSTR lpszStructType, const void *pvStructInfo, DWORD dwFlags, PCRYPT_ENCODE_PARA pEncodePara, BYTE *pbEncoded, DWORD *pcbEncoded) @@ -4002,6 +4266,9 @@ static CryptEncodeObjectExFunc CRYPT_GetBuiltinEncoder(DWORD dwCertEncodingType, case LOWORD(X509_BASIC_CONSTRAINTS2): encodeFunc = CRYPT_AsnEncodeBasicConstraints2; break; + case LOWORD(X509_CERT_POLICIES): + encodeFunc = CRYPT_AsnEncodeCertPolicies; + break; case LOWORD(RSA_CSP_PUBLICKEYBLOB): encodeFunc = CRYPT_AsnEncodeRsaPubKey; break; @@ -4063,6 +4330,9 @@ static CryptEncodeObjectExFunc CRYPT_GetBuiltinEncoder(DWORD dwCertEncodingType, case LOWORD(PKCS_SMIME_CAPABILITIES): encodeFunc = CRYPT_AsnEncodeSMIMECapabilities; break; + case LOWORD(X509_PKIX_POLICY_QUALIFIER_USERNOTICE): + encodeFunc = CRYPT_AsnEncodePolicyQualifierUserNotice; + break; case LOWORD(PKCS_ATTRIBUTES): encodeFunc = CRYPT_AsnEncodePKCSAttributes; break; @@ -4112,6 +4382,8 @@ static CryptEncodeObjectExFunc CRYPT_GetBuiltinEncoder(DWORD dwCertEncodingType, encodeFunc = CRYPT_AsnEncodeAltName; else if (!strcmp(lpszStructType, szOID_CRL_DIST_POINTS)) encodeFunc = CRYPT_AsnEncodeCRLDistPoints; + else if (!strcmp(lpszStructType, szOID_CERT_POLICIES)) + encodeFunc = CRYPT_AsnEncodeCertPolicies; else if (!strcmp(lpszStructType, szOID_ENHANCED_KEY_USAGE)) encodeFunc = CRYPT_AsnEncodeEnhancedKeyUsage; else if (!strcmp(lpszStructType, szOID_ISSUING_DIST_POINT)) @@ -4120,6 +4392,8 @@ static CryptEncodeObjectExFunc CRYPT_GetBuiltinEncoder(DWORD dwCertEncodingType, encodeFunc = CRYPT_AsnEncodeNameConstraints; else if (!strcmp(lpszStructType, szOID_AUTHORITY_INFO_ACCESS)) encodeFunc = CRYPT_AsnEncodeAuthorityInfoAccess; + else if (!strcmp(lpszStructType, szOID_PKIX_POLICY_QUALIFIER_USERNOTICE)) + encodeFunc = CRYPT_AsnEncodePolicyQualifierUserNotice; else if (!strcmp(lpszStructType, szOID_CTL)) encodeFunc = CRYPT_AsnEncodeCTL; return encodeFunc; diff --git a/dlls/crypt32/object.c b/dlls/crypt32/object.c index 6e79038541d..5784cc96f68 100644 --- a/dlls/crypt32/object.c +++ b/dlls/crypt32/object.c @@ -604,9 +604,199 @@ static BOOL WINAPI CRYPT_FormatHexString(DWORD dwCertEncodingType, #define MAX_STRING_RESOURCE_LEN 128 -static const WCHAR crlf[] = { '\r','\n',0 }; static const WCHAR commaSpace[] = { ',',' ',0 }; +struct BitToString +{ + BYTE bit; + int id; + WCHAR str[MAX_STRING_RESOURCE_LEN]; +}; + +static BOOL CRYPT_FormatBits(BYTE bits, const struct BitToString *map, + DWORD mapEntries, void *pbFormat, DWORD *pcbFormat, BOOL *first) +{ + DWORD bytesNeeded = sizeof(WCHAR); + int i; + BOOL ret = TRUE, localFirst = *first; + + for (i = 0; i < mapEntries; i++) + if (bits & map[i].bit) + { + if (!localFirst) + bytesNeeded += strlenW(commaSpace) * sizeof(WCHAR); + localFirst = FALSE; + bytesNeeded += strlenW(map[i].str) * sizeof(WCHAR); + } + if (!pbFormat) + { + *first = localFirst; + *pcbFormat = bytesNeeded; + } + else if (*pcbFormat < bytesNeeded) + { + *first = localFirst; + *pcbFormat = bytesNeeded; + SetLastError(ERROR_MORE_DATA); + ret = FALSE; + } + else + { + LPWSTR str = pbFormat; + + localFirst = *first; + *pcbFormat = bytesNeeded; + for (i = 0; i < mapEntries; i++) + if (bits & map[i].bit) + { + if (!localFirst) + { + strcpyW(str, commaSpace); + str += strlenW(commaSpace); + } + localFirst = FALSE; + strcpyW(str, map[i].str); + str += strlenW(map[i].str); + } + *first = localFirst; + } + return ret; +} + +static struct BitToString keyUsageByte0Map[] = { + { CERT_DIGITAL_SIGNATURE_KEY_USAGE, IDS_DIGITAL_SIGNATURE, { 0 } }, + { CERT_NON_REPUDIATION_KEY_USAGE, IDS_NON_REPUDIATION, { 0 } }, + { CERT_KEY_ENCIPHERMENT_KEY_USAGE, IDS_KEY_ENCIPHERMENT, { 0 } }, + { CERT_DATA_ENCIPHERMENT_KEY_USAGE, IDS_DATA_ENCIPHERMENT, { 0 } }, + { CERT_KEY_AGREEMENT_KEY_USAGE, IDS_KEY_AGREEMENT, { 0 } }, + { CERT_KEY_CERT_SIGN_KEY_USAGE, IDS_CERT_SIGN, { 0 } }, + { CERT_OFFLINE_CRL_SIGN_KEY_USAGE, IDS_OFFLINE_CRL_SIGN, { 0 } }, + { CERT_CRL_SIGN_KEY_USAGE, IDS_CRL_SIGN, { 0 } }, + { CERT_ENCIPHER_ONLY_KEY_USAGE, IDS_ENCIPHER_ONLY, { 0 } }, +}; +static struct BitToString keyUsageByte1Map[] = { + { CERT_DECIPHER_ONLY_KEY_USAGE, IDS_DECIPHER_ONLY, { 0 } }, +}; + +static BOOL WINAPI CRYPT_FormatKeyUsage(DWORD dwCertEncodingType, + DWORD dwFormatType, DWORD dwFormatStrType, void *pFormatStruct, + LPCSTR lpszStructType, const BYTE *pbEncoded, DWORD cbEncoded, void *pbFormat, + DWORD *pcbFormat) +{ + DWORD size; + CRYPT_BIT_BLOB *bits; + BOOL ret; + + if (!cbEncoded) + { + SetLastError(E_INVALIDARG); + return FALSE; + } + if ((ret = CryptDecodeObjectEx(dwCertEncodingType, X509_KEY_USAGE, + pbEncoded, cbEncoded, CRYPT_DECODE_ALLOC_FLAG, NULL, &bits, &size))) + { + WCHAR infoNotAvailable[MAX_STRING_RESOURCE_LEN]; + DWORD bytesNeeded = sizeof(WCHAR); + + LoadStringW(hInstance, IDS_INFO_NOT_AVAILABLE, infoNotAvailable, + sizeof(infoNotAvailable) / sizeof(infoNotAvailable[0])); + if (!bits->cbData || bits->cbData > 2) + { + bytesNeeded += strlenW(infoNotAvailable) * sizeof(WCHAR); + if (!pbFormat) + *pcbFormat = bytesNeeded; + else if (*pcbFormat < bytesNeeded) + { + *pcbFormat = bytesNeeded; + SetLastError(ERROR_MORE_DATA); + ret = FALSE; + } + else + { + LPWSTR str = pbFormat; + + *pcbFormat = bytesNeeded; + strcpyW(str, infoNotAvailable); + } + } + else + { + static BOOL stringsLoaded = FALSE; + int i; + DWORD bitStringLen; + BOOL first = TRUE; + + if (!stringsLoaded) + { + for (i = 0; + i < sizeof(keyUsageByte0Map) / sizeof(keyUsageByte0Map[0]); + i++) + LoadStringW(hInstance, keyUsageByte0Map[i].id, + keyUsageByte0Map[i].str, MAX_STRING_RESOURCE_LEN); + for (i = 0; + i < sizeof(keyUsageByte1Map) / sizeof(keyUsageByte1Map[0]); + i++) + LoadStringW(hInstance, keyUsageByte1Map[i].id, + keyUsageByte1Map[i].str, MAX_STRING_RESOURCE_LEN); + stringsLoaded = TRUE; + } + CRYPT_FormatBits(bits->pbData[0], keyUsageByte0Map, + sizeof(keyUsageByte0Map) / sizeof(keyUsageByte0Map[0]), + NULL, &bitStringLen, &first); + bytesNeeded += bitStringLen; + if (bits->cbData == 2) + { + CRYPT_FormatBits(bits->pbData[1], keyUsageByte1Map, + sizeof(keyUsageByte1Map) / sizeof(keyUsageByte1Map[0]), + NULL, &bitStringLen, &first); + bytesNeeded += bitStringLen; + } + bytesNeeded += 3 * sizeof(WCHAR); /* " (" + ")" */ + CRYPT_FormatHexString(0, 0, 0, NULL, NULL, bits->pbData, + bits->cbData, NULL, &size); + bytesNeeded += size; + if (!pbFormat) + *pcbFormat = bytesNeeded; + else if (*pcbFormat < bytesNeeded) + { + *pcbFormat = bytesNeeded; + SetLastError(ERROR_MORE_DATA); + ret = FALSE; + } + else + { + LPWSTR str = pbFormat; + + bitStringLen = bytesNeeded; + first = TRUE; + CRYPT_FormatBits(bits->pbData[0], keyUsageByte0Map, + sizeof(keyUsageByte0Map) / sizeof(keyUsageByte0Map[0]), + str, &bitStringLen, &first); + str += bitStringLen / sizeof(WCHAR) - 1; + if (bits->cbData == 2) + { + bitStringLen = bytesNeeded; + CRYPT_FormatBits(bits->pbData[1], keyUsageByte1Map, + sizeof(keyUsageByte1Map) / sizeof(keyUsageByte1Map[0]), + str, &bitStringLen, &first); + str += bitStringLen / sizeof(WCHAR) - 1; + } + *str++ = ' '; + *str++ = '('; + CRYPT_FormatHexString(0, 0, 0, NULL, NULL, bits->pbData, + bits->cbData, str, &size); + str += size / sizeof(WCHAR) - 1; + *str++ = ')'; + *str = 0; + } + } + LocalFree(bits); + } + return ret; +} + +static const WCHAR crlf[] = { '\r','\n',0 }; + static WCHAR subjectTypeHeader[MAX_STRING_RESOURCE_LEN]; static WCHAR subjectTypeCA[MAX_STRING_RESOURCE_LEN]; static WCHAR subjectTypeEndCert[MAX_STRING_RESOURCE_LEN]; @@ -751,6 +941,7 @@ static BOOL CRYPT_FormatCertSerialNumber(CRYPT_DATA_BLOB *serialNum, LPWSTR str, } static const WCHAR indent[] = { ' ',' ',' ',' ',' ',0 }; +static const WCHAR colonCrlf[] = { ':','\r','\n',0 }; static BOOL CRYPT_FormatAltNameEntry(DWORD dwFormatStrType, DWORD indentLevel, CERT_ALT_NAME_ENTRY *entry, LPWSTR str, DWORD *pcbStr) @@ -761,6 +952,7 @@ static BOOL CRYPT_FormatAltNameEntry(DWORD dwFormatStrType, DWORD indentLevel, WCHAR ipAddrBuf[32]; WCHAR maskBuf[16]; DWORD bytesNeeded = sizeof(WCHAR); + DWORD strType = CERT_X500_NAME_STR | CERT_NAME_STR_REVERSE_FLAG; if (dwFormatStrType & CRYPT_FORMAT_STR_MULTI_LINE) bytesNeeded += indentLevel * strlenW(indent) * sizeof(WCHAR); @@ -780,14 +972,19 @@ static BOOL CRYPT_FormatAltNameEntry(DWORD dwFormatStrType, DWORD indentLevel, break; case CERT_ALT_NAME_DIRECTORY_NAME: { - DWORD strType = dwFormatStrType & CRYPT_FORMAT_STR_MULTI_LINE - ? CERT_NAME_STR_CRLF_FLAG : 0; - DWORD directoryNameLen = CertNameToStrW(X509_ASN_ENCODING, - &entry->u.DirectoryName, strType, NULL, 0); + DWORD directoryNameLen; - LoadStringW(hInstance, IDS_ALT_NAME_OTHER_NAME, buf, + if (dwFormatStrType & CRYPT_FORMAT_STR_MULTI_LINE) + strType |= CERT_NAME_STR_CRLF_FLAG; + directoryNameLen = cert_name_to_str_with_indent(X509_ASN_ENCODING, + indentLevel + 1, &entry->u.DirectoryName, strType, NULL, 0); + LoadStringW(hInstance, IDS_ALT_NAME_DIRECTORY_NAME, buf, sizeof(buf) / sizeof(buf[0])); bytesNeeded += (directoryNameLen - 1) * sizeof(WCHAR); + if (dwFormatStrType & CRYPT_FORMAT_STR_MULTI_LINE) + bytesNeeded += strlenW(colonCrlf) * sizeof(WCHAR); + else + bytesNeeded += sizeof(WCHAR); /* '=' */ ret = TRUE; break; } @@ -891,14 +1088,17 @@ static BOOL CRYPT_FormatAltNameEntry(DWORD dwFormatStrType, DWORD indentLevel, strcpyW(str, entry->u.pwszURL); break; case CERT_ALT_NAME_DIRECTORY_NAME: - { - DWORD strType = dwFormatStrType & CRYPT_FORMAT_STR_MULTI_LINE - ? CERT_NAME_STR_CRLF_FLAG : 0; - - CertNameToStrW(X509_ASN_ENCODING, &entry->u.DirectoryName, - strType, str, bytesNeeded / sizeof(WCHAR)); + if (dwFormatStrType & CRYPT_FORMAT_STR_MULTI_LINE) + { + strcpyW(str, colonCrlf); + str += strlenW(colonCrlf); + } + else + *str++ = '='; + cert_name_to_str_with_indent(X509_ASN_ENCODING, + indentLevel + 1, &entry->u.DirectoryName, strType, str, + bytesNeeded / sizeof(WCHAR)); break; - } case CERT_ALT_NAME_IP_ADDRESS: if (dwFormatStrType & CRYPT_FORMAT_STR_MULTI_LINE) { @@ -990,17 +1190,49 @@ static BOOL CRYPT_FormatAltNameInfo(DWORD dwFormatStrType, DWORD indentLevel, return ret; } +static const WCHAR colonSep[] = { ':',' ',0 }; + +static BOOL WINAPI CRYPT_FormatAltName(DWORD dwCertEncodingType, + DWORD dwFormatType, DWORD dwFormatStrType, void *pFormatStruct, + LPCSTR lpszStructType, const BYTE *pbEncoded, DWORD cbEncoded, void *pbFormat, + DWORD *pcbFormat) +{ + BOOL ret; + CERT_ALT_NAME_INFO *info; + DWORD size; + + if ((ret = CryptDecodeObjectEx(dwCertEncodingType, X509_ALTERNATE_NAME, + pbEncoded, cbEncoded, CRYPT_DECODE_ALLOC_FLAG, NULL, &info, &size))) + { + ret = CRYPT_FormatAltNameInfo(dwFormatStrType, 0, info, pbFormat, pcbFormat); + LocalFree(info); + } + return ret; +} + static BOOL CRYPT_FormatCertIssuer(DWORD dwFormatStrType, CERT_ALT_NAME_INFO *issuer, LPWSTR str, DWORD *pcbStr) { WCHAR buf[MAX_STRING_RESOURCE_LEN]; - DWORD bytesNeeded; + DWORD bytesNeeded, sepLen; + LPCWSTR sep; BOOL ret; LoadStringW(hInstance, IDS_CERT_ISSUER, buf, sizeof(buf) / sizeof(buf[0])); - ret = CRYPT_FormatAltNameInfo(dwFormatStrType, 0, issuer, NULL, + ret = CRYPT_FormatAltNameInfo(dwFormatStrType, 1, issuer, NULL, &bytesNeeded); bytesNeeded += strlenW(buf) * sizeof(WCHAR); + if (dwFormatStrType & CRYPT_FORMAT_STR_MULTI_LINE) + { + sep = colonCrlf; + sepLen = strlenW(colonCrlf) * sizeof(WCHAR); + } + else + { + sep = colonSep; + sepLen = strlenW(colonSep) * sizeof(WCHAR); + } + bytesNeeded += sepLen; if (ret) { if (!str) @@ -1015,9 +1247,11 @@ static BOOL CRYPT_FormatCertIssuer(DWORD dwFormatStrType, { *pcbStr = bytesNeeded; strcpyW(str, buf); - str += strlenW(str); bytesNeeded -= strlenW(str) * sizeof(WCHAR); - ret = CRYPT_FormatAltNameInfo(dwFormatStrType, 0, issuer, str, + str += strlenW(str); + strcpyW(str, sep); + str += sepLen / sizeof(WCHAR); + ret = CRYPT_FormatAltNameInfo(dwFormatStrType, 1, issuer, str, &bytesNeeded); } } @@ -1157,16 +1391,14 @@ static BOOL WINAPI CRYPT_FormatAuthorityKeyId2(DWORD dwCertEncodingType, return ret; } -static const WCHAR colonCrlf[] = { ':','\r','\n',0 }; - static WCHAR aia[MAX_STRING_RESOURCE_LEN]; static WCHAR accessMethod[MAX_STRING_RESOURCE_LEN]; static WCHAR ocsp[MAX_STRING_RESOURCE_LEN]; static WCHAR caIssuers[MAX_STRING_RESOURCE_LEN]; static WCHAR unknown[MAX_STRING_RESOURCE_LEN]; static WCHAR accessLocation[MAX_STRING_RESOURCE_LEN]; -static BOOL WINAPI CRYPT_FormatAuthorityInfoAccess(DWORD dwCertEncodingType, +static BOOL WINAPI CRYPT_FormatAuthorityInfoAccess(DWORD dwCertEncodingType, DWORD dwFormatType, DWORD dwFormatStrType, void *pFormatStruct, LPCSTR lpszStructType, const BYTE *pbEncoded, DWORD cbEncoded, void *pbFormat, DWORD *pcbFormat) @@ -1209,7 +1441,6 @@ static BOOL WINAPI CRYPT_FormatAuthorityInfoAccess(DWORD dwCertEncodingType, } else { - static const WCHAR colonSep[] = { ':',' ',0 }; static const WCHAR numFmt[] = { '%','d',0 }; static const WCHAR equal[] = { '=',0 }; static BOOL stringsLoaded = FALSE; @@ -1383,7 +1614,7 @@ static BOOL WINAPI CRYPT_FormatAuthorityInfoAccess(DWORD dwCertEncodingType, static WCHAR keyCompromise[MAX_STRING_RESOURCE_LEN]; static WCHAR caCompromise[MAX_STRING_RESOURCE_LEN]; static WCHAR affiliationChanged[MAX_STRING_RESOURCE_LEN]; -static WCHAR superceded[MAX_STRING_RESOURCE_LEN]; +static WCHAR superseded[MAX_STRING_RESOURCE_LEN]; static WCHAR operationCeased[MAX_STRING_RESOURCE_LEN]; static WCHAR certificateHold[MAX_STRING_RESOURCE_LEN]; @@ -1398,7 +1629,7 @@ static struct reason_map_entry reason_map[] = { { CRL_REASON_CA_COMPROMISE_FLAG, caCompromise, IDS_REASON_CA_COMPROMISE }, { CRL_REASON_AFFILIATION_CHANGED_FLAG, affiliationChanged, IDS_REASON_AFFILIATION_CHANGED }, - { CRL_REASON_SUPERSEDED_FLAG, superceded, IDS_REASON_SUPERCEDED }, + { CRL_REASON_SUPERSEDED_FLAG, superseded, IDS_REASON_SUPERSEDED }, { CRL_REASON_CESSATION_OF_OPERATION_FLAG, operationCeased, IDS_REASON_CESSATION_OF_OPERATION }, { CRL_REASON_CERTIFICATE_HOLD_FLAG, certificateHold, @@ -1492,7 +1723,6 @@ static BOOL WINAPI CRYPT_FormatCRLDistPoints(DWORD dwCertEncodingType, pbEncoded, cbEncoded, CRYPT_DECODE_ALLOC_FLAG, NULL, &info, &size))) { static const WCHAR numFmt[] = { '%','d',0 }; - static const WCHAR colonSep[] = { ':',' ',0 }; static const WCHAR commaSep[] = { ',',' ',0 }; static const WCHAR colon[] = { ':',0 }; static BOOL stringsLoaded = FALSE; @@ -1812,6 +2042,112 @@ static BOOL WINAPI CRYPT_FormatEnhancedKeyUsage(DWORD dwCertEncodingType, return ret; } +static struct BitToString netscapeCertTypeMap[] = { + { NETSCAPE_SSL_CLIENT_AUTH_CERT_TYPE, IDS_NETSCAPE_SSL_CLIENT, { 0 } }, + { NETSCAPE_SSL_SERVER_AUTH_CERT_TYPE, IDS_NETSCAPE_SSL_SERVER, { 0 } }, + { NETSCAPE_SMIME_CERT_TYPE, IDS_NETSCAPE_SMIME, { 0 } }, + { NETSCAPE_SIGN_CERT_TYPE, IDS_NETSCAPE_SIGN, { 0 } }, + { NETSCAPE_SSL_CA_CERT_TYPE, IDS_NETSCAPE_SSL_CA, { 0 } }, + { NETSCAPE_SMIME_CA_CERT_TYPE, IDS_NETSCAPE_SMIME_CA, { 0 } }, + { NETSCAPE_SIGN_CA_CERT_TYPE, IDS_NETSCAPE_SIGN_CA, { 0 } }, +}; + +static BOOL WINAPI CRYPT_FormatNetscapeCertType(DWORD dwCertEncodingType, + DWORD dwFormatType, DWORD dwFormatStrType, void *pFormatStruct, + LPCSTR lpszStructType, const BYTE *pbEncoded, DWORD cbEncoded, void *pbFormat, + DWORD *pcbFormat) +{ + DWORD size; + CRYPT_BIT_BLOB *bits; + BOOL ret; + + if (!cbEncoded) + { + SetLastError(E_INVALIDARG); + return FALSE; + } + if ((ret = CryptDecodeObjectEx(dwCertEncodingType, X509_BITS, + pbEncoded, cbEncoded, CRYPT_DECODE_ALLOC_FLAG, NULL, &bits, &size))) + { + WCHAR infoNotAvailable[MAX_STRING_RESOURCE_LEN]; + DWORD bytesNeeded = sizeof(WCHAR); + + LoadStringW(hInstance, IDS_INFO_NOT_AVAILABLE, infoNotAvailable, + sizeof(infoNotAvailable) / sizeof(infoNotAvailable[0])); + if (!bits->cbData || bits->cbData > 1) + { + bytesNeeded += strlenW(infoNotAvailable) * sizeof(WCHAR); + if (!pbFormat) + *pcbFormat = bytesNeeded; + else if (*pcbFormat < bytesNeeded) + { + *pcbFormat = bytesNeeded; + SetLastError(ERROR_MORE_DATA); + ret = FALSE; + } + else + { + LPWSTR str = pbFormat; + + *pcbFormat = bytesNeeded; + strcpyW(str, infoNotAvailable); + } + } + else + { + static BOOL stringsLoaded = FALSE; + int i; + DWORD bitStringLen; + BOOL first = TRUE; + + if (!stringsLoaded) + { + for (i = 0; i < sizeof(netscapeCertTypeMap) / + sizeof(netscapeCertTypeMap[0]); i++) + LoadStringW(hInstance, netscapeCertTypeMap[i].id, + netscapeCertTypeMap[i].str, MAX_STRING_RESOURCE_LEN); + stringsLoaded = TRUE; + } + CRYPT_FormatBits(bits->pbData[0], netscapeCertTypeMap, + sizeof(netscapeCertTypeMap) / sizeof(netscapeCertTypeMap[0]), + NULL, &bitStringLen, &first); + bytesNeeded += bitStringLen; + bytesNeeded += 3 * sizeof(WCHAR); /* " (" + ")" */ + CRYPT_FormatHexString(0, 0, 0, NULL, NULL, bits->pbData, + bits->cbData, NULL, &size); + bytesNeeded += size; + if (!pbFormat) + *pcbFormat = bytesNeeded; + else if (*pcbFormat < bytesNeeded) + { + *pcbFormat = bytesNeeded; + SetLastError(ERROR_MORE_DATA); + ret = FALSE; + } + else + { + LPWSTR str = pbFormat; + + bitStringLen = bytesNeeded; + first = TRUE; + CRYPT_FormatBits(bits->pbData[0], netscapeCertTypeMap, + sizeof(netscapeCertTypeMap) / sizeof(netscapeCertTypeMap[0]), + str, &bitStringLen, &first); + str += bitStringLen / sizeof(WCHAR) - 1; + *str++ = ' '; + *str++ = '('; + CRYPT_FormatHexString(0, 0, 0, NULL, NULL, bits->pbData, + bits->cbData, str, &size); + str += size / sizeof(WCHAR) - 1; + *str++ = ')'; + *str = 0; + } + } + LocalFree(bits); + } + return ret; +} + static WCHAR financialCriteria[MAX_STRING_RESOURCE_LEN]; static WCHAR available[MAX_STRING_RESOURCE_LEN]; static WCHAR notAvailable[MAX_STRING_RESOURCE_LEN]; @@ -1934,6 +2270,12 @@ static CryptFormatObjectFunc CRYPT_GetBuiltinFormatFunction(DWORD encodingType, { switch (LOWORD(lpszStructType)) { + case LOWORD(X509_KEY_USAGE): + format = CRYPT_FormatKeyUsage; + break; + case LOWORD(X509_ALTERNATE_NAME): + format = CRYPT_FormatAltName; + break; case LOWORD(X509_BASIC_CONSTRAINTS2): format = CRYPT_FormatBasicConstraints2; break; @@ -1954,6 +2296,16 @@ static CryptFormatObjectFunc CRYPT_GetBuiltinFormatFunction(DWORD encodingType, break; } } + else if (!strcmp(lpszStructType, szOID_SUBJECT_ALT_NAME)) + format = CRYPT_FormatAltName; + else if (!strcmp(lpszStructType, szOID_ISSUER_ALT_NAME)) + format = CRYPT_FormatAltName; + else if (!strcmp(lpszStructType, szOID_KEY_USAGE)) + format = CRYPT_FormatKeyUsage; + else if (!strcmp(lpszStructType, szOID_SUBJECT_ALT_NAME2)) + format = CRYPT_FormatAltName; + else if (!strcmp(lpszStructType, szOID_ISSUER_ALT_NAME2)) + format = CRYPT_FormatAltName; else if (!strcmp(lpszStructType, szOID_BASIC_CONSTRAINTS2)) format = CRYPT_FormatBasicConstraints2; else if (!strcmp(lpszStructType, szOID_AUTHORITY_INFO_ACCESS)) @@ -1964,10 +2316,10 @@ static CryptFormatObjectFunc CRYPT_GetBuiltinFormatFunction(DWORD encodingType, format = CRYPT_FormatCRLDistPoints; else if (!strcmp(lpszStructType, szOID_ENHANCED_KEY_USAGE)) format = CRYPT_FormatEnhancedKeyUsage; + else if (!strcmp(lpszStructType, szOID_NETSCAPE_CERT_TYPE)) + format = CRYPT_FormatNetscapeCertType; else if (!strcmp(lpszStructType, SPC_FINANCIAL_CRITERIA_OBJID)) format = CRYPT_FormatSpcFinancialCriteria; - if (!format && !(formatStrType & CRYPT_FORMAT_STR_NO_HEX)) - format = CRYPT_FormatHexString; return format; } @@ -1993,6 +2345,9 @@ BOOL WINAPI CryptFormatObject(DWORD dwCertEncodingType, DWORD dwFormatType, CryptGetOIDFunctionAddress(set, dwCertEncodingType, lpszStructType, 0, (void **)&format, &hFunc); } + if (!format && (dwCertEncodingType & CERT_ENCODING_TYPE_MASK) == + X509_ASN_ENCODING && !(dwFormatStrType & CRYPT_FORMAT_STR_NO_HEX)) + format = CRYPT_FormatHexString; if (format) ret = format(dwCertEncodingType, dwFormatType, dwFormatStrType, pFormatStruct, lpszStructType, pbEncoded, cbEncoded, pbFormat, diff --git a/dlls/crypt32/str.c b/dlls/crypt32/str.c index b1ccc91fc7e..d3bca2b7c0a 100644 --- a/dlls/crypt32/str.c +++ b/dlls/crypt32/str.c @@ -338,8 +338,10 @@ static DWORD CRYPT_AddPrefixW(LPCWSTR prefix, LPWSTR psz, DWORD csz) return chars; } -DWORD WINAPI CertNameToStrW(DWORD dwCertEncodingType, PCERT_NAME_BLOB pName, - DWORD dwStrType, LPWSTR psz, DWORD csz) +static const WCHAR indent[] = { ' ',' ',' ',' ',' ',0 }; + +DWORD cert_name_to_str_with_indent(DWORD dwCertEncodingType, DWORD indentLevel, + PCERT_NAME_BLOB pName, DWORD dwStrType, LPWSTR psz, DWORD csz) { static const DWORD unsupportedFlags = CERT_NAME_STR_NO_QUOTING_FLAG | CERT_NAME_STR_ENABLE_T61_UNICODE_FLAG; @@ -352,8 +354,6 @@ DWORD WINAPI CertNameToStrW(DWORD dwCertEncodingType, PCERT_NAME_BLOB pName, BOOL bRet; CERT_NAME_INFO *info; - TRACE("(%d, %p, %08x, %p, %d)\n", dwCertEncodingType, pName, dwStrType, - psz, csz); if (dwStrType & unsupportedFlags) FIXME("unsupported flags: %08x\n", dwStrType & unsupportedFlags); @@ -402,6 +402,22 @@ DWORD WINAPI CertNameToStrW(DWORD dwCertEncodingType, PCERT_NAME_BLOB pName, else prefixA = rdn->rgRDNAttr[j].pszObjId; } + if (dwStrType & CERT_NAME_STR_CRLF_FLAG) + { + DWORD k; + + for (k = 0; k < indentLevel; k++) + { + if (psz) + { + chars = min(strlenW(indent), csz - ret - 1); + memcpy(psz + ret, indent, chars * sizeof(WCHAR)); + } + else + chars = strlenW(indent); + ret += chars; + } + } if (prefixW) { /* - 1 is needed to account for the NULL terminator. */ @@ -448,6 +464,19 @@ DWORD WINAPI CertNameToStrW(DWORD dwCertEncodingType, PCERT_NAME_BLOB pName, } else ret++; + return ret; +} + +DWORD WINAPI CertNameToStrW(DWORD dwCertEncodingType, PCERT_NAME_BLOB pName, + DWORD dwStrType, LPWSTR psz, DWORD csz) +{ + BOOL ret; + + TRACE("(%d, %p, %08x, %p, %d)\n", dwCertEncodingType, pName, dwStrType, + psz, csz); + + ret = cert_name_to_str_with_indent(dwCertEncodingType, 0, pName, dwStrType, + psz, csz); TRACE("Returning %s\n", debugstr_w(psz)); return ret; } diff --git a/dlls/crypt32/tests/encode.c b/dlls/crypt32/tests/encode.c index 9a0eff5667d..60c387c9f26 100644 --- a/dlls/crypt32/tests/encode.c +++ b/dlls/crypt32/tests/encode.c @@ -1318,9 +1318,10 @@ static void test_encodeNameValue(DWORD dwEncoding) ret = pCryptEncodeObjectEx(dwEncoding, X509_NAME_VALUE, &nameValues[i].value, CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); - ok(ret, "Type %d: CryptEncodeObjectEx failed: %08x\n", + ok(ret || broken(GetLastError() == OSS_PDU_MISMATCH) /* NT4/Win9x */, + "Type %d: CryptEncodeObjectEx failed: %08x\n", nameValues[i].value.dwValueType, GetLastError()); - if (buf) + if (ret) { ok(size == nameValues[i].encodedSize, "Expected size %d, got %d\n", nameValues[i].encodedSize, size); @@ -1346,7 +1347,7 @@ static void test_decodeNameValue(DWORD dwEncoding) (BYTE *)&buf, &bufSize); ok(ret, "Value type %d: CryptDecodeObjectEx failed: %08x\n", nameValues[i].value.dwValueType, GetLastError()); - if (buf) + if (ret) { compareNameValues(&nameValues[i].value, (const CERT_NAME_VALUE *)buf); @@ -2367,8 +2368,10 @@ static void test_decodeRsaPublicKey(DWORD dwEncoding) ret = pCryptDecodeObjectEx(dwEncoding, RSA_CSP_PUBLICKEYBLOB, rsaPubKeys[0].encoded, rsaPubKeys[0].encoded[1], CRYPT_DECODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &bufSize); - ok(!ret && GetLastError() == CRYPT_E_ASN1_EOD, - "Expected CRYPT_E_ASN1_EOD, got %08x\n", GetLastError()); + ok(!ret && (GetLastError() == CRYPT_E_ASN1_EOD || + GetLastError() == OSS_MORE_INPUT /* Win9x/NT4 */), + "Expected CRYPT_E_ASN1_EOD or OSS_MORE_INPUT, got %08x\n", + GetLastError()); /* Try with a couple of RSA-related OIDs */ ret = pCryptDecodeObjectEx(dwEncoding, szOID_RSA_RSA, rsaPubKeys[0].encoded, rsaPubKeys[0].encoded[1] + 2, @@ -7037,6 +7040,274 @@ static void test_decodeNameConstraints(DWORD dwEncoding) } } +static WCHAR noticeText[] = { 'T','h','i','s',' ','i','s',' ','a',' ', + 'n','o','t','i','c','e',0 }; +static const BYTE noticeWithDisplayText[] = { + 0x30,0x22,0x1e,0x20,0x00,0x54,0x00,0x68,0x00,0x69,0x00,0x73,0x00,0x20,0x00, + 0x69,0x00,0x73,0x00,0x20,0x00,0x61,0x00,0x20,0x00,0x6e,0x00,0x6f,0x00,0x74, + 0x00,0x69,0x00,0x63,0x00,0x65 +}; +static char org[] = "Wine"; +static int noticeNumbers[] = { 2,3 }; +static BYTE noticeWithReference[] = { + 0x30,0x32,0x30,0x0e,0x16,0x04,0x57,0x69,0x6e,0x65,0x30,0x06,0x02,0x01,0x02, + 0x02,0x01,0x03,0x1e,0x20,0x00,0x54,0x00,0x68,0x00,0x69,0x00,0x73,0x00,0x20, + 0x00,0x69,0x00,0x73,0x00,0x20,0x00,0x61,0x00,0x20,0x00,0x6e,0x00,0x6f,0x00, + 0x74,0x00,0x69,0x00,0x63,0x00,0x65 +}; + +static void test_encodePolicyQualifierUserNotice(DWORD dwEncoding) +{ + BOOL ret; + LPBYTE buf; + DWORD size; + CERT_POLICY_QUALIFIER_USER_NOTICE notice; + CERT_POLICY_QUALIFIER_NOTICE_REFERENCE reference; + + memset(¬ice, 0, sizeof(notice)); + ret = pCryptEncodeObjectEx(dwEncoding, + X509_PKIX_POLICY_QUALIFIER_USERNOTICE, ¬ice, CRYPT_ENCODE_ALLOC_FLAG, + NULL, &buf, &size); + if (!ret && GetLastError() == ERROR_FILE_NOT_FOUND) + { + skip("no X509_PKIX_POLICY_QUALIFIER_USERNOTICE encode support\n"); + return; + } + ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError()); + if (ret) + { + ok(sizeof(emptySequence) == size, "unexpected size %d\n", size); + ok(!memcmp(buf, emptySequence, size), "unexpected value\n"); + LocalFree(buf); + } + notice.pszDisplayText = noticeText; + ret = pCryptEncodeObjectEx(dwEncoding, + X509_PKIX_POLICY_QUALIFIER_USERNOTICE, ¬ice, CRYPT_ENCODE_ALLOC_FLAG, + NULL, &buf, &size); + ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError()); + if (ret) + { + ok(sizeof(noticeWithDisplayText) == size, "unexpected size %d\n", size); + ok(!memcmp(buf, noticeWithDisplayText, size), "unexpected value\n"); + LocalFree(buf); + } + reference.pszOrganization = org; + reference.cNoticeNumbers = 2; + reference.rgNoticeNumbers = noticeNumbers; + notice.pNoticeReference = &reference; + ret = pCryptEncodeObjectEx(dwEncoding, + X509_PKIX_POLICY_QUALIFIER_USERNOTICE, ¬ice, CRYPT_ENCODE_ALLOC_FLAG, + NULL, &buf, &size); + ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError()); + if (ret) + { + ok(sizeof(noticeWithReference) == size, "unexpected size %d\n", size); + ok(!memcmp(buf, noticeWithReference, size), "unexpected value\n"); + LocalFree(buf); + } +} + +static void test_decodePolicyQualifierUserNotice(DWORD dwEncoding) +{ + BOOL ret; + CERT_POLICY_QUALIFIER_USER_NOTICE *notice; + DWORD size; + + ret = pCryptDecodeObjectEx(dwEncoding, + X509_PKIX_POLICY_QUALIFIER_USERNOTICE, + emptySequence, sizeof(emptySequence), CRYPT_DECODE_ALLOC_FLAG, NULL, + ¬ice, &size); + if (!ret && GetLastError() == ERROR_FILE_NOT_FOUND) + { + skip("no X509_PKIX_POLICY_QUALIFIER_USERNOTICE decode support\n"); + return; + } + ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError()); + if (ret) + { + ok(notice->pszDisplayText == NULL, "unexpected display text\n"); + ok(notice->pNoticeReference == NULL, "unexpected notice reference\n"); + LocalFree(notice); + } + ret = pCryptDecodeObjectEx(dwEncoding, + X509_PKIX_POLICY_QUALIFIER_USERNOTICE, + noticeWithDisplayText, sizeof(noticeWithDisplayText), + CRYPT_DECODE_ALLOC_FLAG, NULL, ¬ice, &size); + ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError()); + if (ret) + { + ok(!lstrcmpW(notice->pszDisplayText, noticeText), + "unexpected display text\n"); + ok(notice->pNoticeReference == NULL, "unexpected notice reference\n"); + LocalFree(notice); + } + ret = pCryptDecodeObjectEx(dwEncoding, + X509_PKIX_POLICY_QUALIFIER_USERNOTICE, + noticeWithReference, sizeof(noticeWithReference), + CRYPT_DECODE_ALLOC_FLAG, NULL, ¬ice, &size); + ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError()); + if (ret) + { + ok(!lstrcmpW(notice->pszDisplayText, noticeText), + "unexpected display text\n"); + ok(notice->pNoticeReference != NULL, "expected a notice reference\n"); + if (notice->pNoticeReference) + { + ok(!strcmp(notice->pNoticeReference->pszOrganization, org), + "unexpected organization %s\n", + notice->pNoticeReference->pszOrganization); + ok(notice->pNoticeReference->cNoticeNumbers == 2, + "expected 2 notice numbers, got %d\n", + notice->pNoticeReference->cNoticeNumbers); + ok(notice->pNoticeReference->rgNoticeNumbers[0] == noticeNumbers[0], + "unexpected notice number %d\n", + notice->pNoticeReference->rgNoticeNumbers[0]); + ok(notice->pNoticeReference->rgNoticeNumbers[1] == noticeNumbers[1], + "unexpected notice number %d\n", + notice->pNoticeReference->rgNoticeNumbers[1]); + } + LocalFree(notice); + } +} + +static char oid_any_policy[] = "2.5.29.32.0"; +static const BYTE policiesWithAnyPolicy[] = { + 0x30,0x08,0x30,0x06,0x06,0x04,0x55,0x1d,0x20,0x00 +}; +static char oid1[] = "1.2.3"; +static char oid_user_notice[] = "1.3.6.1.5.5.7.2.2"; +static const BYTE twoPolicies[] = { + 0x30,0x50,0x30,0x06,0x06,0x04,0x55,0x1d,0x20,0x00,0x30,0x46,0x06,0x02,0x2a, + 0x03,0x30,0x40,0x30,0x3e,0x06,0x08,0x2b,0x06,0x01,0x05,0x05,0x07,0x02,0x02, + 0x30,0x32,0x30,0x0e,0x16,0x04,0x57,0x69,0x6e,0x65,0x30,0x06,0x02,0x01,0x02, + 0x02,0x01,0x03,0x1e,0x20,0x00,0x54,0x00,0x68,0x00,0x69,0x00,0x73,0x00,0x20, + 0x00,0x69,0x00,0x73,0x00,0x20,0x00,0x61,0x00,0x20,0x00,0x6e,0x00,0x6f,0x00, + 0x74,0x00,0x69,0x00,0x63,0x00,0x65 +}; + +static void test_encodeCertPolicies(DWORD dwEncoding) +{ + BOOL ret; + CERT_POLICIES_INFO info; + CERT_POLICY_INFO policy[2]; + CERT_POLICY_QUALIFIER_INFO qualifier; + LPBYTE buf; + DWORD size; + + memset(&info, 0, sizeof(info)); + ret = pCryptEncodeObjectEx(dwEncoding, X509_CERT_POLICIES, &info, + CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size); + ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError()); + if (ret) + { + ok(sizeof(emptySequence) == size, "unexpected size %d\n", size); + ok(!memcmp(buf, emptySequence, size), "unexpected value\n"); + LocalFree(buf); + } + memset(policy, 0, sizeof(policy)); + info.cPolicyInfo = 1; + info.rgPolicyInfo = policy; + ret = pCryptEncodeObjectEx(dwEncoding, X509_CERT_POLICIES, &info, + CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size); + ok(!ret && (GetLastError() == E_INVALIDARG || + GetLastError() == OSS_LIMITED /* Win9x/NT4 */), + "expected E_INVALIDARG or OSS_LIMITED, got %08x\n", GetLastError()); + policy[0].pszPolicyIdentifier = oid_any_policy; + ret = pCryptEncodeObjectEx(dwEncoding, X509_CERT_POLICIES, &info, + CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size); + ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError()); + if (ret) + { + ok(sizeof(policiesWithAnyPolicy) == size, "unexpected size %d\n", size); + ok(!memcmp(buf, policiesWithAnyPolicy, size), "unexpected value\n"); + LocalFree(buf); + } + policy[1].pszPolicyIdentifier = oid1; + memset(&qualifier, 0, sizeof(qualifier)); + qualifier.pszPolicyQualifierId = oid_user_notice; + qualifier.Qualifier.cbData = sizeof(noticeWithReference); + qualifier.Qualifier.pbData = noticeWithReference; + policy[1].cPolicyQualifier = 1; + policy[1].rgPolicyQualifier = &qualifier; + info.cPolicyInfo = 2; + ret = pCryptEncodeObjectEx(dwEncoding, X509_CERT_POLICIES, &info, + CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size); + ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError()); + if (ret) + { + ok(sizeof(twoPolicies) == size, "unexpected size %d\n", size); + ok(!memcmp(buf, twoPolicies, size), "unexpected value\n"); + LocalFree(buf); + } +} + +static void test_decodeCertPolicies(DWORD dwEncoding) +{ + BOOL ret; + CERT_POLICIES_INFO *info; + DWORD size; + + ret = pCryptDecodeObjectEx(dwEncoding, X509_CERT_POLICIES, + emptySequence, sizeof(emptySequence), CRYPT_DECODE_ALLOC_FLAG, NULL, + &info, &size); + ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError()); + if (ret) + { + ok(info->cPolicyInfo == 0, "unexpected policy info %d\n", + info->cPolicyInfo); + LocalFree(info); + } + ret = pCryptDecodeObjectEx(dwEncoding, X509_CERT_POLICIES, + policiesWithAnyPolicy, sizeof(policiesWithAnyPolicy), + CRYPT_DECODE_ALLOC_FLAG, NULL, &info, &size); + ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError()); + if (ret) + { + ok(info->cPolicyInfo == 1, "unexpected policy info %d\n", + info->cPolicyInfo); + ok(!strcmp(info->rgPolicyInfo[0].pszPolicyIdentifier, oid_any_policy), + "unexpected policy id %s\n", + info->rgPolicyInfo[0].pszPolicyIdentifier); + ok(info->rgPolicyInfo[0].cPolicyQualifier == 0, + "unexpected policy qualifier count %d\n", + info->rgPolicyInfo[0].cPolicyQualifier); + LocalFree(info); + } + ret = pCryptDecodeObjectEx(dwEncoding, X509_CERT_POLICIES, + twoPolicies, sizeof(twoPolicies), + CRYPT_DECODE_ALLOC_FLAG, NULL, &info, &size); + ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError()); + if (ret) + { + ok(info->cPolicyInfo == 2, "unexpected policy info %d\n", + info->cPolicyInfo); + ok(!strcmp(info->rgPolicyInfo[0].pszPolicyIdentifier, oid_any_policy), + "unexpected policy id %s\n", + info->rgPolicyInfo[0].pszPolicyIdentifier); + ok(info->rgPolicyInfo[0].cPolicyQualifier == 0, + "unexpected policy qualifier count %d\n", + info->rgPolicyInfo[0].cPolicyQualifier); + ok(!strcmp(info->rgPolicyInfo[1].pszPolicyIdentifier, oid1), + "unexpected policy id %s\n", + info->rgPolicyInfo[1].pszPolicyIdentifier); + ok(info->rgPolicyInfo[1].cPolicyQualifier == 1, + "unexpected policy qualifier count %d\n", + info->rgPolicyInfo[1].cPolicyQualifier); + ok(!strcmp( + info->rgPolicyInfo[1].rgPolicyQualifier[0].pszPolicyQualifierId, + oid_user_notice), "unexpected policy qualifier id %s\n", + info->rgPolicyInfo[1].rgPolicyQualifier[0].pszPolicyQualifierId); + ok(info->rgPolicyInfo[1].rgPolicyQualifier[0].Qualifier.cbData == + sizeof(noticeWithReference), "unexpected qualifier size %d\n", + info->rgPolicyInfo[1].rgPolicyQualifier[0].Qualifier.cbData); + ok(!memcmp( + info->rgPolicyInfo[1].rgPolicyQualifier[0].Qualifier.pbData, + noticeWithReference, sizeof(noticeWithReference)), + "unexpected qualifier value\n"); + LocalFree(info); + } +} + /* Free *pInfo with HeapFree */ static void testExportPublicKey(HCRYPTPROV csp, PCERT_PUBLIC_KEY_INFO *pInfo) { @@ -7303,6 +7574,10 @@ START_TEST(encode) test_decodeCMSSignerInfo(encodings[i]); test_encodeNameConstraints(encodings[i]); test_decodeNameConstraints(encodings[i]); + test_encodePolicyQualifierUserNotice(encodings[i]); + test_decodePolicyQualifierUserNotice(encodings[i]); + test_encodeCertPolicies(encodings[i]); + test_decodeCertPolicies(encodings[i]); } testPortPublicKeyInfo(); } diff --git a/dlls/cryptdlg/main.c b/dlls/cryptdlg/main.c index 46fb7ed10bf..e8f2514adb4 100644 --- a/dlls/cryptdlg/main.c +++ b/dlls/cryptdlg/main.c @@ -465,6 +465,8 @@ BOOL WINAPI CertViewPropertiesW(CERT_VIEWPROPERTIES_STRUCT_W *info) return ret; } +#define szOID_MICROSOFT_Encryption_Key_Preference "1.3.6.1.4.1.311.16.4" + /*********************************************************************** * DllRegisterServer (CRYPTDLG.@) */ @@ -484,6 +486,8 @@ HRESULT WINAPI DllRegisterServer(void) 'F','i','n','a','l','P','o','l','i','c','y',0 }; static WCHAR certTrustCleanup[] = { 'C','e','r','t','T','r','u','s','t', 'C','l','e','a','n','u','p',0 }; + static const WCHAR cryptDlg[] = { 'c','r','y','p','t','d','l','g','.', + 'd','l','l',0 }; CRYPT_REGISTER_ACTIONID reg; GUID guid = CERT_CERTIFICATE_ACTION_VERIFY; HRESULT hr = S_OK; @@ -507,6 +511,18 @@ HRESULT WINAPI DllRegisterServer(void) reg.sCleanupProvider.pwszFunctionName = certTrustCleanup; if (!WintrustAddActionID(&guid, WT_ADD_ACTION_ID_RET_RESULT_FLAG, ®)) hr = GetLastError(); + CryptRegisterOIDFunction(X509_ASN_ENCODING, CRYPT_OID_ENCODE_OBJECT_FUNC, + "1.3.6.1.4.1.311.16.1.1", cryptDlg, "EncodeAttrSequence"); + CryptRegisterOIDFunction(X509_ASN_ENCODING, CRYPT_OID_ENCODE_OBJECT_FUNC, + szOID_MICROSOFT_Encryption_Key_Preference, cryptDlg, "EncodeRecipientID"); + CryptRegisterOIDFunction(X509_ASN_ENCODING, CRYPT_OID_DECODE_OBJECT_FUNC, + "1.3.6.1.4.1.311.16.1.1", cryptDlg, "DecodeAttrSequence"); + CryptRegisterOIDFunction(X509_ASN_ENCODING, CRYPT_OID_DECODE_OBJECT_FUNC, + szOID_MICROSOFT_Encryption_Key_Preference, cryptDlg, "DecodeRecipientID"); + CryptRegisterOIDFunction(X509_ASN_ENCODING, CRYPT_OID_FORMAT_OBJECT_FUNC, + szOID_PKIX_KP_EMAIL_PROTECTION, cryptDlg, "FormatPKIXEmailProtection"); + CryptRegisterOIDFunction(X509_ASN_ENCODING, CRYPT_OID_FORMAT_OBJECT_FUNC, + szOID_CERT_POLICIES, cryptDlg, "FormatVerisignExtension"); return hr; } @@ -518,5 +534,17 @@ HRESULT WINAPI DllUnregisterServer(void) GUID guid = CERT_CERTIFICATE_ACTION_VERIFY; WintrustRemoveActionID(&guid); + CryptUnregisterOIDFunction(X509_ASN_ENCODING, CRYPT_OID_ENCODE_OBJECT_FUNC, + "1.3.6.1.4.1.311.16.1.1"); + CryptUnregisterOIDFunction(X509_ASN_ENCODING, CRYPT_OID_ENCODE_OBJECT_FUNC, + szOID_MICROSOFT_Encryption_Key_Preference); + CryptUnregisterOIDFunction(X509_ASN_ENCODING, CRYPT_OID_DECODE_OBJECT_FUNC, + "1.3.6.1.4.1.311.16.1.1"); + CryptUnregisterOIDFunction(X509_ASN_ENCODING, CRYPT_OID_DECODE_OBJECT_FUNC, + szOID_MICROSOFT_Encryption_Key_Preference); + CryptUnregisterOIDFunction(X509_ASN_ENCODING, CRYPT_OID_FORMAT_OBJECT_FUNC, + szOID_PKIX_KP_EMAIL_PROTECTION); + CryptUnregisterOIDFunction(X509_ASN_ENCODING, CRYPT_OID_FORMAT_OBJECT_FUNC, + szOID_CERT_POLICIES); return S_OK; } diff --git a/dlls/d3d10/tests/device.c b/dlls/d3d10/tests/device.c index 3ad91133e3d..8399cdb7bb2 100644 --- a/dlls/d3d10/tests/device.c +++ b/dlls/d3d10/tests/device.c @@ -57,11 +57,11 @@ static void test_device_interfaces(ID3D10Device *device) if (SUCCEEDED(hr = ID3D10Device_QueryInterface(device, &IID_IDXGIObject, (void **)&obj))) IUnknown_Release(obj); - todo_wine ok(SUCCEEDED(hr), "ID3D10Device does not implement IDXGIObject (%#x)\n", hr); + ok(SUCCEEDED(hr), "ID3D10Device does not implement IDXGIObject (%#x)\n", hr); if (SUCCEEDED(hr = ID3D10Device_QueryInterface(device, &IID_IDXGIDevice, (void **)&obj))) IUnknown_Release(obj); - todo_wine ok(SUCCEEDED(hr), "ID3D10Device does not implement IDXGIDevice (%#x)\n", hr); + ok(SUCCEEDED(hr), "ID3D10Device does not implement IDXGIDevice (%#x)\n", hr); } START_TEST(device) diff --git a/dlls/d3d10core/d3d10core_main.c b/dlls/d3d10core/d3d10core_main.c index 6bc14c68ac8..446096d6f1e 100644 --- a/dlls/d3d10core/d3d10core_main.c +++ b/dlls/d3d10core/d3d10core_main.c @@ -82,7 +82,7 @@ static HRESULT WINAPI layer_create(enum dxgi_device_layer_id id, void **layer_ba object = (struct d3d10_device *)*layer_base; object->vtbl = &d3d10_device_vtbl; - object->inner_unknown_vtbl = &d3d10_device_inner_unkown_vtbl; + object->inner_unknown_vtbl = &d3d10_device_inner_unknown_vtbl; object->refcount = 1; object->outer_unknown = device_object; @@ -112,6 +112,9 @@ HRESULT WINAPI D3D10CoreCreateDevice(IDXGIFactory *factory, IDXGIAdapter *adapte HMODULE d3d10core; HRESULT hr; + TRACE("factory %p, adapter %p, flags %#x, unknown0 %#x, device %p\n", + factory, adapter, flags, unknown0, device); + d3d10core = GetModuleHandleA("d3d10core.dll"); hr = DXGID3D10CreateDevice(d3d10core, factory, adapter, flags, unknown0, (void **)&dxgi_device); if (FAILED(hr)) diff --git a/dlls/d3d10core/d3d10core_private.h b/dlls/d3d10core/d3d10core_private.h index b33845c9805..16bb323f4c6 100644 --- a/dlls/d3d10core/d3d10core_private.h +++ b/dlls/d3d10core/d3d10core_private.h @@ -34,7 +34,7 @@ const char *debug_dxgi_format(DXGI_FORMAT format); /* IDirect3D10Device */ extern const struct ID3D10DeviceVtbl d3d10_device_vtbl; -extern const struct IUnknownVtbl d3d10_device_inner_unkown_vtbl; +extern const struct IUnknownVtbl d3d10_device_inner_unknown_vtbl; struct d3d10_device { const struct ID3D10DeviceVtbl *vtbl; diff --git a/dlls/d3d10core/device.c b/dlls/d3d10core/device.c index ab92c47ed7d..567c93af92f 100644 --- a/dlls/d3d10core/device.c +++ b/dlls/d3d10core/device.c @@ -876,7 +876,7 @@ const struct ID3D10DeviceVtbl d3d10_device_vtbl = d3d10_device_GetTextFilterSize, }; -const struct IUnknownVtbl d3d10_device_inner_unkown_vtbl = +const struct IUnknownVtbl d3d10_device_inner_unknown_vtbl = { /* IUnknown methods */ d3d10_device_inner_QueryInterface, diff --git a/dlls/shdocvw/tests/Makefile.in b/dlls/d3d10core/tests/Makefile.in similarity index 58% copy from dlls/shdocvw/tests/Makefile.in copy to dlls/d3d10core/tests/Makefile.in index e20f8edbe1b..7003f7ce534 100644 --- a/dlls/shdocvw/tests/Makefile.in +++ b/dlls/d3d10core/tests/Makefile.in @@ -2,14 +2,11 @@ TOPSRCDIR = @top_srcdir@ TOPOBJDIR = ../../.. SRCDIR = @srcdir@ VPATH = @srcdir@ -TESTDLL = shdocvw.dll -IMPORTS = shell32 ole32 oleaut32 user32 advapi32 kernel32 +TESTDLL = d3d10core.dll +IMPORTS = d3d10core dxgi kernel32 CTESTS = \ - intshcut.c \ - shdocvw.c \ - shortcut.c \ - webbrowser.c + device.c \ @MAKE_TEST_RULES@ diff --git a/dlls/d3d10/tests/device.c b/dlls/d3d10core/tests/device.c similarity index 52% copy from dlls/d3d10/tests/device.c copy to dlls/d3d10core/tests/device.c index 3ad91133e3d..8a012224cff 100644 --- a/dlls/d3d10/tests/device.c +++ b/dlls/d3d10core/tests/device.c @@ -21,47 +21,77 @@ #include "d3d10.h" #include "wine/test.h" +HRESULT WINAPI D3D10CoreCreateDevice(IDXGIFactory *factory, IDXGIAdapter *adapter, + UINT flags, DWORD unknown0, ID3D10Device **device); + static ID3D10Device *create_device(void) { - ID3D10Device *device; + IDXGIFactory *factory = NULL; + IDXGIAdapter *adapter = NULL; + ID3D10Device *device = NULL; + HRESULT hr; - if (SUCCEEDED(D3D10CreateDevice(NULL, D3D10_DRIVER_TYPE_HARDWARE, NULL, 0, D3D10_SDK_VERSION, &device))) - { - trace("Created a HW device\n"); - return device; - } + hr = CreateDXGIFactory(&IID_IDXGIFactory, (void *)&factory); + ok(SUCCEEDED(hr), "CreateDXGIFactory failed, hr %#x\n", hr); + if (FAILED(hr)) goto cleanup; - trace("Failed to create a HW device, trying REF\n"); - if (SUCCEEDED(D3D10CreateDevice(NULL, D3D10_DRIVER_TYPE_REFERENCE, NULL, 0, D3D10_SDK_VERSION, &device))) + hr = IDXGIFactory_EnumAdapters(factory, 0, &adapter); + ok(SUCCEEDED(hr), "EnumAdapters failed, hr %#x\n", hr); + if (FAILED(hr)) goto cleanup; + + hr = D3D10CoreCreateDevice(factory, adapter, 0, 0, &device); + if (FAILED(hr)) { - trace("Created a REF device\n"); - return device; + HMODULE d3d10ref; + + trace("Failed to create a HW device, trying REF\n"); + IDXGIAdapter_Release(adapter); + adapter = NULL; + + d3d10ref = LoadLibraryA("d3d10ref.dll"); + if (!d3d10ref) + { + trace("d3d10ref.dll not available, unable to create a REF device\n"); + goto cleanup; + } + + hr = IDXGIFactory_CreateSoftwareAdapter(factory, d3d10ref, &adapter); + FreeLibrary(d3d10ref); + ok(SUCCEEDED(hr), "CreateSoftwareAdapter failed, hr %#x\n", hr); + if (FAILED(hr)) goto cleanup; + + hr = D3D10CoreCreateDevice(factory, adapter, 0, 0, &device); + ok(SUCCEEDED(hr), "Failed to create a REF device, hr %#x\n", hr); + if (FAILED(hr)) goto cleanup; } - trace("Failed to create a device, returning NULL\n"); - return NULL; +cleanup: + if (adapter) IDXGIAdapter_Release(adapter); + if (factory) IDXGIFactory_Release(factory); + + return device; } static void test_device_interfaces(ID3D10Device *device) { - HRESULT hr; IUnknown *obj; + HRESULT hr; if (SUCCEEDED(hr = ID3D10Device_QueryInterface(device, &IID_IUnknown, (void **)&obj))) IUnknown_Release(obj); - ok(SUCCEEDED(hr), "ID3D10Device does not implement IUnknown (%#x)\n", hr); - - if (SUCCEEDED(hr = ID3D10Device_QueryInterface(device, &IID_ID3D10Device, (void **)&obj))) - IUnknown_Release(obj); - ok(SUCCEEDED(hr), "ID3D10Device does not implement ID3D10Device (%#x)\n", hr); + ok(SUCCEEDED(hr), "ID3D10Device does not implement IUnknown\n"); if (SUCCEEDED(hr = ID3D10Device_QueryInterface(device, &IID_IDXGIObject, (void **)&obj))) IUnknown_Release(obj); - todo_wine ok(SUCCEEDED(hr), "ID3D10Device does not implement IDXGIObject (%#x)\n", hr); + ok(SUCCEEDED(hr), "ID3D10Device does not implement IDXGIObject\n"); if (SUCCEEDED(hr = ID3D10Device_QueryInterface(device, &IID_IDXGIDevice, (void **)&obj))) IUnknown_Release(obj); - todo_wine ok(SUCCEEDED(hr), "ID3D10Device does not implement IDXGIDevice (%#x)\n", hr); + ok(SUCCEEDED(hr), "ID3D10Device does not implement IDXGIDevice\n"); + + if (SUCCEEDED(hr = ID3D10Device_QueryInterface(device, &IID_ID3D10Device, (void **)&obj))) + IUnknown_Release(obj); + ok(SUCCEEDED(hr), "ID3D10Device does not implement ID3D10Device\n"); } START_TEST(device) diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index 3caa08f4f16..32031e4e4c4 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -8324,7 +8324,7 @@ static void pointsize_test(IDirect3DDevice9 *device) D3DCAPS9 caps; D3DMATRIX matrix; D3DMATRIX identity; - float ptsize, ptsize_orig; + float ptsize, ptsize_orig, ptsizemax_orig, ptsizemin_orig; DWORD color; const float vertices[] = { @@ -8333,7 +8333,10 @@ static void pointsize_test(IDirect3DDevice9 *device) 192, 64, 0.1, 256, 64, 0.1, 320, 64, 0.1, - 384, 64, 0.1 + 384, 64, 0.1, + 448, 64, 0.1, + 512, 64, 0.1, + 576, 64, 0.1, }; /* Transforms the coordinate system [-1.0;1.0]x[-1.0;1.0] to [0.0;0.0]x[640.0;480.0]. Z is untouched */ @@ -8405,6 +8408,51 @@ static void pointsize_test(IDirect3DDevice9 *device) hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_POINTLIST, 1, &vertices[12], sizeof(float) * 3); ok(hr == D3D_OK, "IDirect3DDevice9_DrawPrimitiveUP failed, hr=%08x\n", hr); + hr = IDirect3DDevice9_GetRenderState(device, D3DRS_POINTSIZE_MAX, (DWORD *) (&ptsizemax_orig)); + ok(hr == D3D_OK, "IDirect3DDevice9_GetRenderState failed, hr=%08x\n", hr); + hr = IDirect3DDevice9_GetRenderState(device, D3DRS_POINTSIZE_MAX, (DWORD *) (&ptsizemin_orig)); + ok(hr == D3D_OK, "IDirect3DDevice9_GetRenderState failed, hr=%08x\n", hr); + + /* What happens if point scaling is disabled, and POINTSIZE_MAX < POINTSIZE? */ + ptsize = 16.0; + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSIZE, *((DWORD *) (&ptsize))); + ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState failed, hr=%08x\n", hr); + ptsize = 1.0; + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSIZE_MAX, *((DWORD *) (&ptsize))); + ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState failed, hr=%08x\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_POINTLIST, 1, &vertices[18], sizeof(float) * 3); + ok(hr == D3D_OK, "IDirect3DDevice9_DrawPrimitiveUP failed, hr=%08x\n", hr); + + /* What happens if POINTSIZE_MAX < POINTSIZE_MIN? + * ptsize = 4.0, ptsize_max = 1.0, ptsize_min = 16.0 + */ + ptsize = 4.0; + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSIZE, *((DWORD *) (&ptsize))); + ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState failed, hr=%08x\n", hr); + ptsize = 16.0; + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSIZE_MIN, *((DWORD *) (&ptsize))); + ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState failed, hr=%08x\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_POINTLIST, 1, &vertices[21], sizeof(float) * 3); + ok(hr == D3D_OK, "IDirect3DDevice9_DrawPrimitiveUP failed, hr=%08x\n", hr); + + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSIZE_MAX, *((DWORD *) (&ptsizemax_orig))); + ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState failed, hr=%08x\n", hr); + + /* pointsize < pointsize_min < pointsize_max? + * pointsize = 1.0, pointsize_min = 16.0, pointsize_max = default(usually 64.0) + */ + ptsize = 1.0; + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSIZE, *((DWORD *) (&ptsize))); + ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState failed, hr=%08x\n", hr); + ptsize = 16.0; + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSIZE_MIN, *((DWORD *) (&ptsize))); + ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState failed, hr=%08x\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_POINTLIST, 1, &vertices[24], sizeof(float) * 3); + ok(hr == D3D_OK, "IDirect3DDevice9_DrawPrimitiveUP failed, hr=%08x\n", hr); + + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSIZE_MIN, *((DWORD *) (&ptsizemin_orig))); + ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState failed, hr=%08x\n", hr); + hr = IDirect3DDevice9_EndScene(device); ok(hr == D3D_OK, "IDirect3DDevice9_EndScene failed hr=%08x\n", hr); } @@ -8483,6 +8531,26 @@ static void pointsize_test(IDirect3DDevice9 *device) color = getPixelColor(device, 320+1, 64+1); ok(color == 0x000000ff, "pSize: Pixel (320+1),(64+1) has color 0x%08x, expected 0x000000ff\n", color); + /* ptsize = 16, ptsize_max = 1 --> point has size 1 */ + color = getPixelColor(device, 448-4, 64-4); + ok(color == 0x000000ff, "pSize: Pixel (448-4),(64-4) has color 0x%08x, expected 0x00ffffff\n", color); + color = getPixelColor(device, 448+4, 64+4); + ok(color == 0x000000ff, "pSize: Pixel (448+4),(64+4) has color 0x%08x, expected 0x00ffffff\n", color); + + /* ptsize = 4, ptsize_max = 1, ptsize_min = 16 --> point has size 1 */ + color = getPixelColor(device, 512-4, 64-4); + ok(color == 0x000000ff, "pSize: Pixel (448-4),(64-4) has color 0x%08x, expected 0x00ffffff\n", color); + color = getPixelColor(device, 512+4, 64+4); + ok(color == 0x000000ff, "pSize: Pixel (448+4),(64+4) has color 0x%08x, expected 0x00ffffff\n", color); + + /* ptsize = 1, ptsize_max = default(64), ptsize_min = 16 --> point has size 16 + * Don't be overly picky - just show that the point is bigger than 1 pixel + */ + color = getPixelColor(device, 576-4, 64-4); + ok(color == 0x00ffffff, "pSize: Pixel (448-4),(64-4) has color 0x%08x, expected 0x00ffffff\n", color); + color = getPixelColor(device, 576+4, 64+4); + ok(color == 0x00ffffff, "pSize: Pixel (448+4),(64+4) has color 0x%08x, expected 0x00ffffff\n", color); + hr = IDirect3DDevice9_SetRenderState(device, D3DRS_POINTSIZE, *((DWORD *) (&ptsize_orig))); ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState failed hr=%08x\n", hr); hr = IDirect3DDevice9_SetTransform(device, D3DTS_PROJECTION, &identity); diff --git a/dlls/d3dx9_36/tests/math.c b/dlls/d3dx9_36/tests/math.c index cc71b33a53c..f3bb4821915 100644 --- a/dlls/d3dx9_36/tests/math.c +++ b/dlls/d3dx9_36/tests/math.c @@ -137,22 +137,22 @@ static void test_Matrix_AffineTransformation2D(void) scale = 20.0f; - exp_mat.m[0][0] = 10.0f; - exp_mat.m[1][0] = -17.320507f; - exp_mat.m[2][0] = 0.0f; - exp_mat.m[3][0] = -1.035898f; - exp_mat.m[0][1] = 17.320507f; - exp_mat.m[1][1] = 10.0f; - exp_mat.m[2][1] = 0.0f; - exp_mat.m[3][1] = 6.401924f; - exp_mat.m[0][2] = 0.0f; - exp_mat.m[1][2] = 0.0f; - exp_mat.m[2][2] = 20.0f; - exp_mat.m[3][2] = 0.0f; - exp_mat.m[0][3] = 0.0f; - exp_mat.m[1][3] = 0.0f; - exp_mat.m[2][3] = 0.0f; - exp_mat.m[3][3] = 1.0f; + U(exp_mat).m[0][0] = 10.0f; + U(exp_mat).m[1][0] = -17.320507f; + U(exp_mat).m[2][0] = 0.0f; + U(exp_mat).m[3][0] = -1.035898f; + U(exp_mat).m[0][1] = 17.320507f; + U(exp_mat).m[1][1] = 10.0f; + U(exp_mat).m[2][1] = 0.0f; + U(exp_mat).m[3][1] = 6.401924f; + U(exp_mat).m[0][2] = 0.0f; + U(exp_mat).m[1][2] = 0.0f; + U(exp_mat).m[2][2] = 20.0f; + U(exp_mat).m[3][2] = 0.0f; + U(exp_mat).m[0][3] = 0.0f; + U(exp_mat).m[1][3] = 0.0f; + U(exp_mat).m[2][3] = 0.0f; + U(exp_mat).m[3][3] = 1.0f; D3DXMatrixAffineTransformation2D(&got_mat, scale, ¢er, angle, &position); @@ -167,22 +167,22 @@ static void test_Matrix_AffineTransformation2D(void) scale = 20.0f; - exp_mat.m[0][0] = 10.0f; - exp_mat.m[1][0] = -17.320507f; - exp_mat.m[2][0] = 0.0f; - exp_mat.m[3][0] = 4.964102f; - exp_mat.m[0][1] = 17.320507f; - exp_mat.m[1][1] = 10.0f; - exp_mat.m[2][1] = 0.0f; - exp_mat.m[3][1] = -0.598076f; - exp_mat.m[0][2] = 0.0f; - exp_mat.m[1][2] = 0.0f; - exp_mat.m[2][2] = 20.0f; - exp_mat.m[3][2] = 0.0f; - exp_mat.m[0][3] = 0.0f; - exp_mat.m[1][3] = 0.0f; - exp_mat.m[2][3] = 0.0f; - exp_mat.m[3][3] = 1.0f; + U(exp_mat).m[0][0] = 10.0f; + U(exp_mat).m[1][0] = -17.320507f; + U(exp_mat).m[2][0] = 0.0f; + U(exp_mat).m[3][0] = 4.964102f; + U(exp_mat).m[0][1] = 17.320507f; + U(exp_mat).m[1][1] = 10.0f; + U(exp_mat).m[2][1] = 0.0f; + U(exp_mat).m[3][1] = -0.598076f; + U(exp_mat).m[0][2] = 0.0f; + U(exp_mat).m[1][2] = 0.0f; + U(exp_mat).m[2][2] = 20.0f; + U(exp_mat).m[3][2] = 0.0f; + U(exp_mat).m[0][3] = 0.0f; + U(exp_mat).m[1][3] = 0.0f; + U(exp_mat).m[2][3] = 0.0f; + U(exp_mat).m[3][3] = 1.0f; D3DXMatrixAffineTransformation2D(&got_mat, scale, ¢er, angle, NULL); @@ -197,22 +197,22 @@ static void test_Matrix_AffineTransformation2D(void) scale = 20.0f; - exp_mat.m[0][0] = 10.0f; - exp_mat.m[1][0] = -17.320507f; - exp_mat.m[2][0] = 0.0f; - exp_mat.m[3][0] = -6.0f; - exp_mat.m[0][1] = 17.320507f; - exp_mat.m[1][1] = 10.0f; - exp_mat.m[2][1] = 0.0f; - exp_mat.m[3][1] = 7.0f; - exp_mat.m[0][2] = 0.0f; - exp_mat.m[1][2] = 0.0f; - exp_mat.m[2][2] = 20.0f; - exp_mat.m[3][2] = 0.0f; - exp_mat.m[0][3] = 0.0f; - exp_mat.m[1][3] = 0.0f; - exp_mat.m[2][3] = 0.0f; - exp_mat.m[3][3] = 1.0f; + U(exp_mat).m[0][0] = 10.0f; + U(exp_mat).m[1][0] = -17.320507f; + U(exp_mat).m[2][0] = 0.0f; + U(exp_mat).m[3][0] = -6.0f; + U(exp_mat).m[0][1] = 17.320507f; + U(exp_mat).m[1][1] = 10.0f; + U(exp_mat).m[2][1] = 0.0f; + U(exp_mat).m[3][1] = 7.0f; + U(exp_mat).m[0][2] = 0.0f; + U(exp_mat).m[1][2] = 0.0f; + U(exp_mat).m[2][2] = 20.0f; + U(exp_mat).m[3][2] = 0.0f; + U(exp_mat).m[0][3] = 0.0f; + U(exp_mat).m[1][3] = 0.0f; + U(exp_mat).m[2][3] = 0.0f; + U(exp_mat).m[3][3] = 1.0f; D3DXMatrixAffineTransformation2D(&got_mat, scale, NULL, angle, &position); @@ -224,22 +224,22 @@ static void test_Matrix_AffineTransformation2D(void) scale = -20.0f; - exp_mat.m[0][0] = 14.142133f; - exp_mat.m[1][0] = -14.142133f; - exp_mat.m[2][0] = 0.0f; - exp_mat.m[3][0] = 0.0f; - exp_mat.m[0][1] = 14.142133; - exp_mat.m[1][1] = 14.142133f; - exp_mat.m[2][1] = 0.0f; - exp_mat.m[3][1] = 0.0f; - exp_mat.m[0][2] = 0.0f; - exp_mat.m[1][2] = 0.0f; - exp_mat.m[2][2] = -20.0f; - exp_mat.m[3][2] = 0.0f; - exp_mat.m[0][3] = 0.0f; - exp_mat.m[1][3] = 0.0f; - exp_mat.m[2][3] = 0.0f; - exp_mat.m[3][3] = 1.0f; + U(exp_mat).m[0][0] = 14.142133f; + U(exp_mat).m[1][0] = -14.142133f; + U(exp_mat).m[2][0] = 0.0f; + U(exp_mat).m[3][0] = 0.0f; + U(exp_mat).m[0][1] = 14.142133; + U(exp_mat).m[1][1] = 14.142133f; + U(exp_mat).m[2][1] = 0.0f; + U(exp_mat).m[3][1] = 0.0f; + U(exp_mat).m[0][2] = 0.0f; + U(exp_mat).m[1][2] = 0.0f; + U(exp_mat).m[2][2] = -20.0f; + U(exp_mat).m[3][2] = 0.0f; + U(exp_mat).m[0][3] = 0.0f; + U(exp_mat).m[1][3] = 0.0f; + U(exp_mat).m[2][3] = 0.0f; + U(exp_mat).m[3][3] = 1.0f; D3DXMatrixAffineTransformation2D(&got_mat, scale, NULL, angle, NULL); @@ -607,22 +607,22 @@ static void test_Matrix_Transformation2D(void) sca_rot = 5.0f*D3DX_PI/4.0f; - exp_mat.m[0][0] = -4.245192f; - exp_mat.m[1][0] = -0.147116f; - exp_mat.m[2][0] = 0.0f; - exp_mat.m[3][0] = 45.265373f; - exp_mat.m[0][1] = 7.647113f; - exp_mat.m[1][1] = 8.745192f; - exp_mat.m[2][1] = 0.0f; - exp_mat.m[3][1] = -13.401899f; - exp_mat.m[0][2] = 0.0f; - exp_mat.m[1][2] = 0.0f; - exp_mat.m[2][2] = 0.0f; - exp_mat.m[3][2] = 0.0f; - exp_mat.m[0][3] = 0.0f; - exp_mat.m[1][3] = 0.0f; - exp_mat.m[2][3] = 0.0f; - exp_mat.m[3][3] = 1.0f; + U(exp_mat).m[0][0] = -4.245192f; + U(exp_mat).m[1][0] = -0.147116f; + U(exp_mat).m[2][0] = 0.0f; + U(exp_mat).m[3][0] = 45.265373f; + U(exp_mat).m[0][1] = 7.647113f; + U(exp_mat).m[1][1] = 8.745192f; + U(exp_mat).m[2][1] = 0.0f; + U(exp_mat).m[3][1] = -13.401899f; + U(exp_mat).m[0][2] = 0.0f; + U(exp_mat).m[1][2] = 0.0f; + U(exp_mat).m[2][2] = 0.0f; + U(exp_mat).m[3][2] = 0.0f; + U(exp_mat).m[0][3] = 0.0f; + U(exp_mat).m[1][3] = 0.0f; + U(exp_mat).m[2][3] = 0.0f; + U(exp_mat).m[3][3] = 1.0f; D3DXMatrixTransformation2D(&got_mat, &sca_center, sca_rot, &sca, &rot_center, rot, &trans); @@ -640,22 +640,22 @@ static void test_Matrix_Transformation2D(void) sca_rot = 5.0f*D3DX_PI/4.0f; - exp_mat.m[0][0] = 0.0f; - exp_mat.m[1][0] = 0.0f; - exp_mat.m[2][0] = 0.0f; - exp_mat.m[3][0] = 2.830127f; - exp_mat.m[0][1] = 0.0f; - exp_mat.m[1][1] = 0.0f; - exp_mat.m[2][1] = 0.0f; - exp_mat.m[3][1] = 12.294229f; - exp_mat.m[0][2] = 0.0f; - exp_mat.m[1][2] = 0.0f; - exp_mat.m[2][2] = 0.0f; - exp_mat.m[3][2] = 0.0f; - exp_mat.m[0][3] = 0.0f; - exp_mat.m[1][3] = 0.0f; - exp_mat.m[2][3] = 0.0f; - exp_mat.m[3][3] = 1.0f; + U(exp_mat).m[0][0] = 0.0f; + U(exp_mat).m[1][0] = 0.0f; + U(exp_mat).m[2][0] = 0.0f; + U(exp_mat).m[3][0] = 2.830127f; + U(exp_mat).m[0][1] = 0.0f; + U(exp_mat).m[1][1] = 0.0f; + U(exp_mat).m[2][1] = 0.0f; + U(exp_mat).m[3][1] = 12.294229f; + U(exp_mat).m[0][2] = 0.0f; + U(exp_mat).m[1][2] = 0.0f; + U(exp_mat).m[2][2] = 0.0f; + U(exp_mat).m[3][2] = 0.0f; + U(exp_mat).m[0][3] = 0.0f; + U(exp_mat).m[1][3] = 0.0f; + U(exp_mat).m[2][3] = 0.0f; + U(exp_mat).m[3][3] = 1.0f; D3DXMatrixTransformation2D(&got_mat, &sca_center, sca_rot, NULL, NULL, rot, &trans); diff --git a/dlls/d3dxof/d3dxof.c b/dlls/d3dxof/d3dxof.c index 25d4834ea61..7c9777107eb 100644 --- a/dlls/d3dxof/d3dxof.c +++ b/dlls/d3dxof/d3dxof.c @@ -80,8 +80,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3dxof); #define CLSIDFMT "<%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X>" -#define MAX_INPUT_SIZE 1000000 -#define MAX_DATA_SIZE 100000 +#define MAX_INPUT_SIZE 2000000 +#define MAX_DATA_SIZE 200000 static const struct IDirectXFileVtbl IDirectXFile_Vtbl; static const struct IDirectXFileBinaryVtbl IDirectXFileBinary_Vtbl; @@ -239,7 +239,7 @@ static HRESULT WINAPI IDirectXFileImpl_CreateEnumObject(IDirectXFile* iface, LPV { lpdxflm = (LPDXFILELOADMEMORY)pvSource; - FIXME("Source in memory at %p with size %d\n", lpdxflm->lpMemory, lpdxflm->dSize); + TRACE("Source in memory at %p with size %d\n", lpdxflm->lpMemory, lpdxflm->dSize); memcpy(header, (char*)lpdxflm->lpMemory, 16); } @@ -276,13 +276,6 @@ static HRESULT WINAPI IDirectXFileImpl_CreateEnumObject(IDirectXFile* iface, LPV goto error; } - if (header[2] == XOFFILE_FORMAT_BINARY) - { - FIXME("Binary format not supported yet\n"); - hr = DXFILEERR_NOTDONEYET; - goto error; - } - if (header[2] == XOFFILE_FORMAT_COMPRESSED) { FIXME("Compressed formats not supported yet\n"); @@ -606,7 +599,7 @@ static BOOL is_name(parse_buffer* buf) BOOL error = 0; while (!is_separator(c = *(buf->buffer+pos))) { - if (!(((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z')) || ((c >= '0') && (c <= '9')) || (c == '_'))) + if (!(((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z')) || ((c >= '0') && (c <= '9')) || (c == '_') || (c == '-'))) error = 1; tmp[pos++] = c; } @@ -803,10 +796,50 @@ static WORD parse_TOKEN(parse_buffer * buf) } else { - if (!read_bytes(buf, &token, 2)) - return 0; + static int nb_elem; + static int is_float; + + if (!nb_elem) + { + if (!read_bytes(buf, &token, 2)) + return 0; + + /* Convert integer and float list into sereparate elements */ + if (token == TOKEN_INTEGER_LIST) + { + if (!read_bytes(buf, &nb_elem, 4)) + return 0; + token = TOKEN_INTEGER; + is_float = FALSE; + TRACE("Integer list (TOKEN_INTEGER_LIST) of size %d\n", nb_elem); + } + else if (token == TOKEN_FLOAT_LIST) + { + if (!read_bytes(buf, &nb_elem, 4)) + return 0; + token = TOKEN_FLOAT; + is_float = TRUE; + TRACE("Float list (TOKEN_FLOAT_LIST) of size %d\n", nb_elem); + } + } + + if (nb_elem) + { + token = is_float ? TOKEN_FLOAT : TOKEN_INTEGER; + nb_elem--; + { + DWORD integer; + + if (!read_bytes(buf, &integer, 4)) + return 0; + + *(DWORD*)buf->value = integer; + } + dump_TOKEN(token); + return token; + } - switch(token) + switch (token) { case TOKEN_NAME: { @@ -850,8 +883,25 @@ static WORD parse_TOKEN(parse_buffer * buf) } break; case TOKEN_STRING: - case TOKEN_INTEGER_LIST: - case TOKEN_FLOAT_LIST: + { + DWORD count; + WORD tmp_token; + char strname[100]; + if (!read_bytes(buf, &count, 4)) + return 0; + if (!read_bytes(buf, strname, count)) + return 0; + strname[count] = 0; + if (!read_bytes(buf, &tmp_token, 2)) + return 0; + if ((tmp_token != TOKEN_COMMA) && (tmp_token != TOKEN_SEMICOLON)) + ERR("No comma or semicolon (got %d)\n", tmp_token); + /*TRACE("name = %s\n", strname);*/ + + strcpy((char*)buf->value, strname); + token = TOKEN_LPSTR; + } + break; case TOKEN_OBRACE: case TOKEN_CBRACE: case TOKEN_OPAREN: @@ -1858,9 +1908,9 @@ static BOOL parse_object_members_list(parse_buffer * buf) last_dword = *(DWORD*)buf->value; TRACE("%s = %d\n", pt->members[i].name, *(DWORD*)buf->value); /* Assume larger size */ - if ((buf->cur_pdata - buf->pxo->pdata + 4) > MAX_DATA_SIZE) + if ((buf->cur_pdata - buf->pdata + 4) > MAX_DATA_SIZE) { - WARN("Buffer too small\n"); + FIXME("Buffer too small\n"); return FALSE; } if (pt->members[i].type == TOKEN_WORD) @@ -1884,9 +1934,9 @@ static BOOL parse_object_members_list(parse_buffer * buf) get_TOKEN(buf); TRACE("%s = %f\n", pt->members[i].name, *(float*)buf->value); /* Assume larger size */ - if ((buf->cur_pdata - buf->pxo->pdata + 4) > MAX_DATA_SIZE) + if ((buf->cur_pdata - buf->pdata + 4) > MAX_DATA_SIZE) { - WARN("Buffer too small\n"); + FIXME("Buffer too small\n"); return FALSE; } if (pt->members[i].type == TOKEN_FLOAT) @@ -1905,9 +1955,9 @@ static BOOL parse_object_members_list(parse_buffer * buf) get_TOKEN(buf); TRACE("%s = %s\n", pt->members[i].name, (char*)buf->value); /* Assume larger size */ - if ((buf->cur_pdata - buf->pxo->pdata + 4) > MAX_DATA_SIZE) + if ((buf->cur_pdata - buf->pdata + 4) > MAX_DATA_SIZE) { - WARN("Buffer too small\n"); + FIXME("Buffer too small\n"); return FALSE; } if (pt->members[i].type == TOKEN_LPSTR) @@ -1915,7 +1965,7 @@ static BOOL parse_object_members_list(parse_buffer * buf) int len = strlen((char*)buf->value) + 1; if ((buf->cur_pstrings - buf->pstrings + len) > MAX_STRINGS_BUFFER) { - WARN("Buffer too small %p %p %d\n", buf->cur_pstrings, buf->pstrings, len); + FIXME("Buffer too small %p %p %d\n", buf->cur_pstrings, buf->pstrings, len); return FALSE; } strcpy((char*)buf->cur_pstrings, (char*)buf->value); @@ -2124,7 +2174,7 @@ static HRESULT WINAPI IDirectXFileEnumObjectImpl_GetNextDataObject(IDirectXFileE WARN("Out of memory\n"); return DXFILEERR_BADALLOC; } - This->buf.cur_pdata = pdata; + This->buf.cur_pdata = This->buf.pdata = pdata; pstrings = HeapAlloc(GetProcessHeap(), 0, MAX_STRINGS_BUFFER); if (!pstrings) diff --git a/dlls/d3dxof/d3dxof_private.h b/dlls/d3dxof/d3dxof_private.h index 80f67a297c9..1789dc79c68 100644 --- a/dlls/d3dxof/d3dxof_private.h +++ b/dlls/d3dxof/d3dxof_private.h @@ -135,6 +135,7 @@ typedef struct { xobject* pxo; xtemplate* pxt[MAX_SUBOBJECTS]; ULONG level; + LPBYTE pdata; LPBYTE pstrings; } parse_buffer; diff --git a/dlls/dbghelp/dbghelp.c b/dlls/dbghelp/dbghelp.c index fba22d09baf..1bfc338e596 100644 --- a/dlls/dbghelp/dbghelp.c +++ b/dlls/dbghelp/dbghelp.c @@ -314,7 +314,6 @@ BOOL WINAPI SymInitializeW(HANDLE hProcess, PCWSTR UserSearchPath, BOOL fInvadeP pcs->search_path = HeapReAlloc(GetProcessHeap(), 0, pcs->search_path, (size + 1 + len + 1) * sizeof(WCHAR)); pcs->search_path[size] = ';'; GetEnvironmentVariableW(alt_sym_path, pcs->search_path + size + 1, len); - size += 1 + len; } } diff --git a/dlls/dxgi/Makefile.in b/dlls/dxgi/Makefile.in index aeba0b09d6c..292247345ba 100644 --- a/dlls/dxgi/Makefile.in +++ b/dlls/dxgi/Makefile.in @@ -4,7 +4,7 @@ SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = dxgi.dll IMPORTLIB = dxgi -IMPORTS = dxguid uuid kernel32 +IMPORTS = dxguid uuid wined3d kernel32 C_SRCS = \ adapter.c \ @@ -16,6 +16,8 @@ C_SRCS = \ RC_SRCS = version.rc +IDL_H_SRCS = dxgi_private_interface.idl + @MAKE_DLL_RULES@ @DEPENDENCIES@ # everything below this line is overwritten by make depend diff --git a/dlls/dxgi/adapter.c b/dlls/dxgi/adapter.c index 1d6169f0d77..d2c64ad8e09 100644 --- a/dlls/dxgi/adapter.c +++ b/dlls/dxgi/adapter.c @@ -26,13 +26,14 @@ WINE_DEFAULT_DEBUG_CHANNEL(dxgi); /* IUnknown methods */ -static HRESULT STDMETHODCALLTYPE dxgi_adapter_QueryInterface(IDXGIAdapter *iface, REFIID riid, void **object) +static HRESULT STDMETHODCALLTYPE dxgi_adapter_QueryInterface(IWineDXGIAdapter *iface, REFIID riid, void **object) { TRACE("iface %p, riid %s, object %p\n", iface, debugstr_guid(riid), object); if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDXGIObject) - || IsEqualGUID(riid, &IID_IDXGIAdapter)) + || IsEqualGUID(riid, &IID_IDXGIAdapter) + || IsEqualGUID(riid, &IID_IWineDXGIAdapter)) { IUnknown_AddRef(iface); *object = iface; @@ -45,7 +46,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_adapter_QueryInterface(IDXGIAdapter *iface return E_NOINTERFACE; } -static ULONG STDMETHODCALLTYPE dxgi_adapter_AddRef(IDXGIAdapter *iface) +static ULONG STDMETHODCALLTYPE dxgi_adapter_AddRef(IWineDXGIAdapter *iface) { struct dxgi_adapter *This = (struct dxgi_adapter *)iface; ULONG refcount = InterlockedIncrement(&This->refcount); @@ -55,7 +56,7 @@ static ULONG STDMETHODCALLTYPE dxgi_adapter_AddRef(IDXGIAdapter *iface) return refcount; } -static ULONG STDMETHODCALLTYPE dxgi_adapter_Release(IDXGIAdapter *iface) +static ULONG STDMETHODCALLTYPE dxgi_adapter_Release(IWineDXGIAdapter *iface) { struct dxgi_adapter *This = (struct dxgi_adapter *)iface; ULONG refcount = InterlockedDecrement(&This->refcount); @@ -72,7 +73,7 @@ static ULONG STDMETHODCALLTYPE dxgi_adapter_Release(IDXGIAdapter *iface) /* IDXGIObject methods */ -static HRESULT STDMETHODCALLTYPE dxgi_adapter_SetPrivateData(IDXGIAdapter *iface, +static HRESULT STDMETHODCALLTYPE dxgi_adapter_SetPrivateData(IWineDXGIAdapter *iface, REFGUID guid, UINT data_size, const void *data) { FIXME("iface %p, guid %s, data_size %u, data %p stub!\n", iface, debugstr_guid(guid), data_size, data); @@ -80,7 +81,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_adapter_SetPrivateData(IDXGIAdapter *iface return E_NOTIMPL; } -static HRESULT STDMETHODCALLTYPE dxgi_adapter_SetPrivateDataInterface(IDXGIAdapter *iface, +static HRESULT STDMETHODCALLTYPE dxgi_adapter_SetPrivateDataInterface(IWineDXGIAdapter *iface, REFGUID guid, const IUnknown *object) { FIXME("iface %p, guid %s, object %p stub!\n", iface, debugstr_guid(guid), object); @@ -88,7 +89,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_adapter_SetPrivateDataInterface(IDXGIAdapt return E_NOTIMPL; } -static HRESULT STDMETHODCALLTYPE dxgi_adapter_GetPrivateData(IDXGIAdapter *iface, +static HRESULT STDMETHODCALLTYPE dxgi_adapter_GetPrivateData(IWineDXGIAdapter *iface, REFGUID guid, UINT *data_size, void *data) { FIXME("iface %p, guid %s, data_size %p, data %p stub!\n", iface, debugstr_guid(guid), data_size, data); @@ -96,30 +97,33 @@ static HRESULT STDMETHODCALLTYPE dxgi_adapter_GetPrivateData(IDXGIAdapter *iface return E_NOTIMPL; } -static HRESULT STDMETHODCALLTYPE dxgi_adapter_GetParent(IDXGIAdapter *iface, REFIID riid, void **parent) +static HRESULT STDMETHODCALLTYPE dxgi_adapter_GetParent(IWineDXGIAdapter *iface, REFIID riid, void **parent) { - FIXME("iface %p, riid %s, parent %p stub!\n", iface, debugstr_guid(riid), parent); + struct dxgi_adapter *This = (struct dxgi_adapter *)iface; - return E_NOTIMPL; + TRACE("iface %p, riid %s, parent %p\n", iface, debugstr_guid(riid), parent); + + return IDXGIFactory_QueryInterface(This->parent, riid, parent); } /* IDXGIAdapter methods */ -static HRESULT STDMETHODCALLTYPE dxgi_adapter_EnumOutputs(IDXGIAdapter *iface, UINT output_idx, IDXGIOutput **output) +static HRESULT STDMETHODCALLTYPE dxgi_adapter_EnumOutputs(IWineDXGIAdapter *iface, + UINT output_idx, IDXGIOutput **output) { FIXME("iface %p, output_idx %u, output %p stub!\n", iface, output_idx, output); return E_NOTIMPL; } -static HRESULT STDMETHODCALLTYPE dxgi_adapter_GetDesc(IDXGIAdapter *iface, DXGI_ADAPTER_DESC *desc) +static HRESULT STDMETHODCALLTYPE dxgi_adapter_GetDesc(IWineDXGIAdapter *iface, DXGI_ADAPTER_DESC *desc) { FIXME("iface %p, desc %p stub!\n", iface, desc); return E_NOTIMPL; } -static HRESULT STDMETHODCALLTYPE dxgi_adapter_CheckInterfaceSupport(IDXGIAdapter *iface, +static HRESULT STDMETHODCALLTYPE dxgi_adapter_CheckInterfaceSupport(IWineDXGIAdapter *iface, REFGUID guid, LARGE_INTEGER *umd_version) { FIXME("iface %p, guid %s, umd_version %p stub!\n", iface, debugstr_guid(guid), umd_version); @@ -127,7 +131,18 @@ static HRESULT STDMETHODCALLTYPE dxgi_adapter_CheckInterfaceSupport(IDXGIAdapter return E_NOTIMPL; } -const struct IDXGIAdapterVtbl dxgi_adapter_vtbl = +/* IWineDXGIAdapter methods */ + +static UINT STDMETHODCALLTYPE dxgi_adapter_get_ordinal(IWineDXGIAdapter *iface) +{ + struct dxgi_adapter *This = (struct dxgi_adapter *)iface; + + TRACE("iface %p, returning %u\n", iface, This->ordinal); + + return This->ordinal; +} + +const struct IWineDXGIAdapterVtbl dxgi_adapter_vtbl = { /* IUnknown methods */ dxgi_adapter_QueryInterface, @@ -142,4 +157,6 @@ const struct IDXGIAdapterVtbl dxgi_adapter_vtbl = dxgi_adapter_EnumOutputs, dxgi_adapter_GetDesc, dxgi_adapter_CheckInterfaceSupport, + /* IWineDXGIAdapter methods */ + dxgi_adapter_get_ordinal, }; diff --git a/dlls/dxgi/device.c b/dlls/dxgi/device.c index fddc535a5a2..1b82b2ade88 100644 --- a/dlls/dxgi/device.c +++ b/dlls/dxgi/device.c @@ -73,6 +73,10 @@ static ULONG STDMETHODCALLTYPE dxgi_device_Release(IDXGIDevice *iface) if (!refcount) { if (This->child_layer) IUnknown_Release(This->child_layer); + EnterCriticalSection(&dxgi_cs); + IWineD3DDevice_Release(This->wined3d_device); + LeaveCriticalSection(&dxgi_cs); + IWineDXGIFactory_Release(This->factory); HeapFree(GetProcessHeap(), 0, This); } @@ -113,9 +117,24 @@ static HRESULT STDMETHODCALLTYPE dxgi_device_GetParent(IDXGIDevice *iface, REFII static HRESULT STDMETHODCALLTYPE dxgi_device_GetAdapter(IDXGIDevice *iface, IDXGIAdapter **adapter) { - FIXME("iface %p, adapter %p stub!\n", iface, adapter); + struct dxgi_device *This = (struct dxgi_device *)iface; + WINED3DDEVICE_CREATION_PARAMETERS create_parameters; + HRESULT hr; - return E_NOTIMPL; + TRACE("iface %p, adapter %p\n", iface, adapter); + + EnterCriticalSection(&dxgi_cs); + + hr = IWineD3DDevice_GetCreationParameters(This->wined3d_device, &create_parameters); + if (FAILED(hr)) + { + LeaveCriticalSection(&dxgi_cs); + return hr; + } + + LeaveCriticalSection(&dxgi_cs); + + return IWineDXGIFactory_EnumAdapters(This->factory, create_parameters.AdapterOrdinal, adapter); } static HRESULT STDMETHODCALLTYPE dxgi_device_CreateSurface(IDXGIDevice *iface, diff --git a/dlls/dxgi/dxgi_main.c b/dlls/dxgi/dxgi_main.c index d2de584aa66..370fcddb6b9 100644 --- a/dlls/dxgi/dxgi_main.c +++ b/dlls/dxgi/dxgi_main.c @@ -20,11 +20,11 @@ #include "config.h" #include "wine/port.h" +#define DXGI_INIT_GUID #include "dxgi_private.h" WINE_DEFAULT_DEBUG_CHANNEL(dxgi); -static CRITICAL_SECTION dxgi_cs; static CRITICAL_SECTION_DEBUG dxgi_cs_debug = { 0, 0, &dxgi_cs, @@ -32,7 +32,7 @@ static CRITICAL_SECTION_DEBUG dxgi_cs_debug = &dxgi_cs_debug.ProcessLocksList}, 0, 0, {(DWORD_PTR)(__FILE__ ": dxgi_cs")} }; -static CRITICAL_SECTION dxgi_cs = {&dxgi_cs_debug, -1, 0, 0, 0, 0}; +CRITICAL_SECTION dxgi_cs = {&dxgi_cs_debug, -1, 0, 0, 0, 0}; struct dxgi_main { @@ -80,25 +80,75 @@ HRESULT WINAPI CreateDXGIFactory(REFIID riid, void **factory) { struct dxgi_factory *object; HRESULT hr; + UINT i; - FIXME("riid %s, factory %p partial stub!\n", debugstr_guid(riid), factory); + TRACE("riid %s, factory %p\n", debugstr_guid(riid), factory); object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); if (!object) { ERR("Failed to allocate DXGI factory object memory\n"); + *factory = NULL; return E_OUTOFMEMORY; } object->vtbl = &dxgi_factory_vtbl; object->refcount = 1; + EnterCriticalSection(&dxgi_cs); + object->wined3d = WineDirect3DCreate(10, (IUnknown *)object); + + object->adapter_count = IWineD3D_GetAdapterCount(object->wined3d); + LeaveCriticalSection(&dxgi_cs); + object->adapters = HeapAlloc(GetProcessHeap(), 0, object->adapter_count * sizeof(*object->adapters)); + if (!object->adapters) + { + ERR("Failed to allocate DXGI adapter array memory\n"); + hr = E_OUTOFMEMORY; + goto fail; + } + + for (i = 0; i < object->adapter_count; ++i) + { + struct dxgi_adapter *adapter = HeapAlloc(GetProcessHeap(), 0, sizeof(**object->adapters)); + if (!adapter) + { + UINT j; + ERR("Failed to allocate DXGI adapter memory\n"); + for (j = 0; j < i; ++j) + { + HeapFree(GetProcessHeap(), 0, object->adapters[j]); + } + hr = E_OUTOFMEMORY; + goto fail; + } + + adapter->vtbl = &dxgi_adapter_vtbl; + adapter->refcount = 1; + adapter->ordinal = i; + adapter->parent = (IDXGIFactory *)object; + object->adapters[i] = (IDXGIAdapter *)adapter; + } + TRACE("Created IDXGIFactory %p\n", object); hr = IDXGIFactory_QueryInterface((IDXGIFactory *)object, riid, factory); IDXGIFactory_Release((IDXGIFactory *)object); return hr; + +fail: + HeapFree(GetProcessHeap(), 0, object->adapters); + if (object->wined3d) + { + EnterCriticalSection(&dxgi_cs); + IWineD3D_Release(object->wined3d); + LeaveCriticalSection(&dxgi_cs); + } + HeapFree(GetProcessHeap(), 0, object); + *factory = NULL; + return hr; + } static BOOL get_layer(enum dxgi_device_layer_id id, struct dxgi_device_layer *layer) @@ -162,6 +212,9 @@ HRESULT WINAPI DXGID3D10CreateDevice(HMODULE d3d10core, IDXGIFactory *factory, I struct layer_get_size_args get_size_args; struct dxgi_device *dxgi_device; struct dxgi_device_layer d3d10_layer; + IWineDXGIAdapter *wine_adapter; + UINT adapter_ordinal; + IWineD3D *wined3d; void *layer_base; UINT device_size; DWORD count; @@ -213,6 +266,39 @@ HRESULT WINAPI DXGID3D10CreateDevice(HMODULE d3d10core, IDXGIFactory *factory, I dxgi_device->vtbl = &dxgi_device_vtbl; dxgi_device->refcount = 1; + + hr = IDXGIFactory_QueryInterface(factory, &IID_IWineDXGIFactory, (void **)&dxgi_device->factory); + if (FAILED(hr)) + { + WARN("This is not the factory we're looking for, returning %#x\n", hr); + goto fail; + } + wined3d = IWineDXGIFactory_get_wined3d(dxgi_device->factory); + + hr = IDXGIAdapter_QueryInterface(adapter, &IID_IWineDXGIAdapter, (void **)&wine_adapter); + if (FAILED(hr)) + { + WARN("This is not the adapter we're looking for, returning %#x\n", hr); + EnterCriticalSection(&dxgi_cs); + IWineD3D_Release(wined3d); + LeaveCriticalSection(&dxgi_cs); + goto fail; + } + adapter_ordinal = IWineDXGIAdapter_get_ordinal(wine_adapter); + IWineDXGIAdapter_Release(wine_adapter); + + FIXME("Ignoring adapter type\n"); + EnterCriticalSection(&dxgi_cs); + hr = IWineD3D_CreateDevice(wined3d, adapter_ordinal, WINED3DDEVTYPE_HAL, NULL, + 0, &dxgi_device->wined3d_device, (IUnknown *)dxgi_device); + IWineD3D_Release(wined3d); + LeaveCriticalSection(&dxgi_cs); + if (FAILED(hr)) + { + WARN("Failed to create a WineD3D device, returning %#x\n", hr); + goto fail; + } + layer_base = dxgi_device + 1; hr = d3d10_layer.create(d3d10_layer.id, &layer_base, 0, @@ -220,14 +306,24 @@ HRESULT WINAPI DXGID3D10CreateDevice(HMODULE d3d10core, IDXGIFactory *factory, I if (FAILED(hr)) { WARN("Failed to create device, returning %#x\n", hr); - HeapFree(GetProcessHeap(), 0, dxgi_device); - *device = NULL; - return hr; + goto fail; } *device = (IUnknown *)dxgi_device; return hr; + +fail: + if (dxgi_device->wined3d_device) + { + EnterCriticalSection(&dxgi_cs); + IWineD3DDevice_Release(dxgi_device->wined3d_device); + LeaveCriticalSection(&dxgi_cs); + } + if (dxgi_device->factory) IWineDXGIFactory_Release(dxgi_device->factory); + HeapFree(GetProcessHeap(), 0, dxgi_device); + *device = NULL; + return hr; } HRESULT WINAPI DXGID3D10RegisterLayers(const struct dxgi_device_layer *layers, UINT layer_count) diff --git a/dlls/dxgi/dxgi_private.h b/dlls/dxgi/dxgi_private.h index 27d72711952..95cfe583df7 100644 --- a/dlls/dxgi/dxgi_private.h +++ b/dlls/dxgi/dxgi_private.h @@ -23,20 +23,31 @@ #define COBJMACROS #include "winbase.h" +#include "wingdi.h" #include "winuser.h" #include "objbase.h" #include "dxgi.h" +#include "wine/wined3d_interface.h" +#ifdef DXGI_INIT_GUID +#include "initguid.h" +#endif +#include "dxgi_private_interface.h" + +extern CRITICAL_SECTION dxgi_cs; /* TRACE helper functions */ const char *debug_dxgi_format(DXGI_FORMAT format); /* IDXGIFactory */ -extern const struct IDXGIFactoryVtbl dxgi_factory_vtbl; +extern const struct IWineDXGIFactoryVtbl dxgi_factory_vtbl; struct dxgi_factory { - const struct IDXGIFactoryVtbl *vtbl; + const struct IWineDXGIFactoryVtbl *vtbl; LONG refcount; + IWineD3D *wined3d; + UINT adapter_count; + IDXGIAdapter **adapters; }; /* IDXGIDevice */ @@ -46,14 +57,18 @@ struct dxgi_device const struct IDXGIDeviceVtbl *vtbl; IUnknown *child_layer; LONG refcount; + IWineD3DDevice *wined3d_device; + IWineDXGIFactory *factory; }; /* IDXGIAdapter */ -extern const struct IDXGIAdapterVtbl dxgi_adapter_vtbl; +extern const struct IWineDXGIAdapterVtbl dxgi_adapter_vtbl; struct dxgi_adapter { - const struct IDXGIAdapterVtbl *vtbl; + const struct IWineDXGIAdapterVtbl *vtbl; + IDXGIFactory *parent; LONG refcount; + UINT ordinal; }; /* IDXGISwapChain */ diff --git a/dlls/crypt32/crypt32.rc b/dlls/dxgi/dxgi_private_interface.idl similarity index 67% copy from dlls/crypt32/crypt32.rc copy to dlls/dxgi/dxgi_private_interface.idl index af0d77cfa9b..2bb8b43024b 100644 --- a/dlls/crypt32/crypt32.rc +++ b/dlls/dxgi/dxgi_private_interface.idl @@ -1,7 +1,5 @@ /* - * crypt32 dll resources - * - * Copyright (C) 2006 Juan Lang + * Copyright 2008 Henri Verbeet for CodeWeavers * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -17,17 +15,25 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include "windef.h" -#include "winbase.h" -#include "winuser.h" -#include "cryptres.h" -#include "version.rc" +import "dxgi.idl"; + +[ + object, + local, + uuid(a07ad9ab-fb01-4574-8bfb-0a70a7373f04) +] +interface IWineDXGIFactory : IDXGIFactory +{ + struct IWineD3D *get_wined3d(); +} -#include "crypt32_De.rc" -#include "crypt32_En.rc" -#include "crypt32_Fr.rc" -#include "crypt32_Ko.rc" -#include "crypt32_Nl.rc" -#include "crypt32_No.rc" -#include "crypt32_Sv.rc" +[ + object, + local, + uuid(ab1de34c-2963-4ffd-8493-40f580e510e5) +] +interface IWineDXGIAdapter : IDXGIAdapter +{ + UINT get_ordinal(); +} diff --git a/dlls/dxgi/factory.c b/dlls/dxgi/factory.c index bcd63d2adb0..03db0969137 100644 --- a/dlls/dxgi/factory.c +++ b/dlls/dxgi/factory.c @@ -26,13 +26,14 @@ WINE_DEFAULT_DEBUG_CHANNEL(dxgi); /* IUnknown methods */ -static HRESULT STDMETHODCALLTYPE dxgi_factory_QueryInterface(IDXGIFactory *iface, REFIID riid, void **object) +static HRESULT STDMETHODCALLTYPE dxgi_factory_QueryInterface(IWineDXGIFactory *iface, REFIID riid, void **object) { TRACE("iface %p, riid %s, object %p\n", iface, debugstr_guid(riid), object); if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDXGIObject) - || IsEqualGUID(riid, &IID_IDXGIFactory)) + || IsEqualGUID(riid, &IID_IDXGIFactory) + || IsEqualGUID(riid, &IID_IWineDXGIFactory)) { IUnknown_AddRef(iface); *object = iface; @@ -45,7 +46,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_factory_QueryInterface(IDXGIFactory *iface return E_NOINTERFACE; } -static ULONG STDMETHODCALLTYPE dxgi_factory_AddRef(IDXGIFactory *iface) +static ULONG STDMETHODCALLTYPE dxgi_factory_AddRef(IWineDXGIFactory *iface) { struct dxgi_factory *This = (struct dxgi_factory *)iface; ULONG refcount = InterlockedIncrement(&This->refcount); @@ -55,7 +56,7 @@ static ULONG STDMETHODCALLTYPE dxgi_factory_AddRef(IDXGIFactory *iface) return refcount; } -static ULONG STDMETHODCALLTYPE dxgi_factory_Release(IDXGIFactory *iface) +static ULONG STDMETHODCALLTYPE dxgi_factory_Release(IWineDXGIFactory *iface) { struct dxgi_factory *This = (struct dxgi_factory *)iface; ULONG refcount = InterlockedDecrement(&This->refcount); @@ -64,6 +65,16 @@ static ULONG STDMETHODCALLTYPE dxgi_factory_Release(IDXGIFactory *iface) if (!refcount) { + UINT i; + + for (i = 0; i < This->adapter_count; ++i) + { + IDXGIAdapter_Release(This->adapters[i]); + } + + EnterCriticalSection(&dxgi_cs); + IWineD3D_Release(This->wined3d); + LeaveCriticalSection(&dxgi_cs); HeapFree(GetProcessHeap(), 0, This); } @@ -72,7 +83,7 @@ static ULONG STDMETHODCALLTYPE dxgi_factory_Release(IDXGIFactory *iface) /* IDXGIObject methods */ -static HRESULT STDMETHODCALLTYPE dxgi_factory_SetPrivateData(IDXGIFactory *iface, +static HRESULT STDMETHODCALLTYPE dxgi_factory_SetPrivateData(IWineDXGIFactory *iface, REFGUID guid, UINT data_size, const void *data) { FIXME("iface %p, guid %s, data_size %u, data %p stub!\n", iface, debugstr_guid(guid), data_size, data); @@ -80,7 +91,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_factory_SetPrivateData(IDXGIFactory *iface return E_NOTIMPL; } -static HRESULT STDMETHODCALLTYPE dxgi_factory_SetPrivateDataInterface(IDXGIFactory *iface, +static HRESULT STDMETHODCALLTYPE dxgi_factory_SetPrivateDataInterface(IWineDXGIFactory *iface, REFGUID guid, const IUnknown *object) { FIXME("iface %p, guid %s, object %p stub!\n", iface, debugstr_guid(guid), object); @@ -88,7 +99,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_factory_SetPrivateDataInterface(IDXGIFacto return E_NOTIMPL; } -static HRESULT STDMETHODCALLTYPE dxgi_factory_GetPrivateData(IDXGIFactory *iface, +static HRESULT STDMETHODCALLTYPE dxgi_factory_GetPrivateData(IWineDXGIFactory *iface, REFGUID guid, UINT *data_size, void *data) { FIXME("iface %p, guid %s, data_size %p, data %p stub!\n", iface, debugstr_guid(guid), data_size, data); @@ -96,7 +107,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_factory_GetPrivateData(IDXGIFactory *iface return E_NOTIMPL; } -static HRESULT STDMETHODCALLTYPE dxgi_factory_GetParent(IDXGIFactory *iface, REFIID riid, void **parent) +static HRESULT STDMETHODCALLTYPE dxgi_factory_GetParent(IWineDXGIFactory *iface, REFIID riid, void **parent) { FIXME("iface %p, riid %s, parent %p stub!\n", iface, debugstr_guid(riid), parent); @@ -105,28 +116,44 @@ static HRESULT STDMETHODCALLTYPE dxgi_factory_GetParent(IDXGIFactory *iface, REF /* IDXGIFactory methods */ -static HRESULT STDMETHODCALLTYPE dxgi_factory_EnumAdapters(IDXGIFactory *iface, UINT adapter_idx, IDXGIAdapter **adapter) +static HRESULT STDMETHODCALLTYPE dxgi_factory_EnumAdapters(IWineDXGIFactory *iface, + UINT adapter_idx, IDXGIAdapter **adapter) { - FIXME("iface %p, adapter_idx %u, adapter %p stub!\n", iface, adapter_idx, adapter); + struct dxgi_factory *This = (struct dxgi_factory *)iface; - return E_NOTIMPL; + TRACE("iface %p, adapter_idx %u, adapter %p\n", iface, adapter_idx, adapter); + + if (!adapter) return DXGI_ERROR_INVALID_CALL; + + if (adapter_idx >= This->adapter_count) + { + *adapter = NULL; + return DXGI_ERROR_NOT_FOUND; + } + + *adapter = (IDXGIAdapter *)This->adapters[adapter_idx]; + IDXGIAdapter_AddRef(*adapter); + + TRACE("Returning adapter %p\n", *adapter); + + return S_OK; } -static HRESULT STDMETHODCALLTYPE dxgi_factory_MakeWindowAssociation(IDXGIFactory *iface, HWND window, UINT flags) +static HRESULT STDMETHODCALLTYPE dxgi_factory_MakeWindowAssociation(IWineDXGIFactory *iface, HWND window, UINT flags) { FIXME("iface %p, window %p, flags %#x stub!\n\n", iface, window, flags); return E_NOTIMPL; } -static HRESULT STDMETHODCALLTYPE dxgi_factory_GetWindowAssociation(IDXGIFactory *iface, HWND *window) +static HRESULT STDMETHODCALLTYPE dxgi_factory_GetWindowAssociation(IWineDXGIFactory *iface, HWND *window) { FIXME("iface %p, window %p stub!\n", iface, window); return E_NOTIMPL; } -static HRESULT STDMETHODCALLTYPE dxgi_factory_CreateSwapChain(IDXGIFactory *iface, +static HRESULT STDMETHODCALLTYPE dxgi_factory_CreateSwapChain(IWineDXGIFactory *iface, IUnknown *device, DXGI_SWAP_CHAIN_DESC *desc, IDXGISwapChain **swapchain) { struct dxgi_swapchain *object; @@ -149,7 +176,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_factory_CreateSwapChain(IDXGIFactory *ifac return S_OK; } -static HRESULT STDMETHODCALLTYPE dxgi_factory_CreateSoftwareAdapter(IDXGIFactory *iface, +static HRESULT STDMETHODCALLTYPE dxgi_factory_CreateSoftwareAdapter(IWineDXGIFactory *iface, HMODULE swrast, IDXGIAdapter **adapter) { FIXME("iface %p, swrast %p, adapter %p stub!\n", iface, swrast, adapter); @@ -157,7 +184,21 @@ static HRESULT STDMETHODCALLTYPE dxgi_factory_CreateSoftwareAdapter(IDXGIFactory return E_NOTIMPL; } -const struct IDXGIFactoryVtbl dxgi_factory_vtbl = +/* IWineDXGIFactory methods */ + +static IWineD3D * STDMETHODCALLTYPE dxgi_factory_get_wined3d(IWineDXGIFactory *iface) +{ + struct dxgi_factory *This = (struct dxgi_factory *)iface; + + TRACE("iface %p\n", iface); + + EnterCriticalSection(&dxgi_cs); + IWineD3D_AddRef(This->wined3d); + LeaveCriticalSection(&dxgi_cs); + return This->wined3d; +} + +const struct IWineDXGIFactoryVtbl dxgi_factory_vtbl = { /* IUnknown methods */ dxgi_factory_QueryInterface, @@ -174,4 +215,6 @@ const struct IDXGIFactoryVtbl dxgi_factory_vtbl = dxgi_factory_GetWindowAssociation, dxgi_factory_CreateSwapChain, dxgi_factory_CreateSoftwareAdapter, + /* IWineDXGIFactory methods */ + dxgi_factory_get_wined3d, }; diff --git a/dlls/shdocvw/tests/Makefile.in b/dlls/dxgi/tests/Makefile.in similarity index 58% copy from dlls/shdocvw/tests/Makefile.in copy to dlls/dxgi/tests/Makefile.in index e20f8edbe1b..1020225cf09 100644 --- a/dlls/shdocvw/tests/Makefile.in +++ b/dlls/dxgi/tests/Makefile.in @@ -2,14 +2,11 @@ TOPSRCDIR = @top_srcdir@ TOPOBJDIR = ../../.. SRCDIR = @srcdir@ VPATH = @srcdir@ -TESTDLL = shdocvw.dll -IMPORTS = shell32 ole32 oleaut32 user32 advapi32 kernel32 +TESTDLL = dxgi.dll +IMPORTS = dxgi kernel32 CTESTS = \ - intshcut.c \ - shdocvw.c \ - shortcut.c \ - webbrowser.c + device.c \ @MAKE_TEST_RULES@ diff --git a/dlls/dxgi/tests/device.c b/dlls/dxgi/tests/device.c new file mode 100644 index 00000000000..7f22bb4bcd5 --- /dev/null +++ b/dlls/dxgi/tests/device.c @@ -0,0 +1,127 @@ +/* + * Copyright 2008 Henri Verbeet for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define COBJMACROS +#include "initguid.h" +#include "d3d10.h" +#include "wine/test.h" + +HRESULT WINAPI DXGID3D10CreateDevice(HMODULE d3d10core, IDXGIFactory *factory, + IDXGIAdapter *adapter, UINT flags, DWORD arg5, void **device); + +static IDXGIDevice *create_device(HMODULE d3d10core) +{ + IDXGIDevice *dxgi_device = NULL; + IDXGIFactory *factory = NULL; + IDXGIAdapter *adapter = NULL; + IUnknown *device = NULL; + HRESULT hr; + + hr = CreateDXGIFactory(&IID_IDXGIFactory, (void *)&factory); + ok(SUCCEEDED(hr), "CreateDXGIFactory failed, hr %#x\n", hr); + if (FAILED(hr)) goto cleanup; + + hr = IDXGIFactory_EnumAdapters(factory, 0, &adapter); + ok(SUCCEEDED(hr), "EnumAdapters failed, hr %#x\n", hr); + if (FAILED(hr)) goto cleanup; + + hr = DXGID3D10CreateDevice(d3d10core, factory, adapter, 0, 0, (void **)&device); + if (FAILED(hr)) + { + HMODULE d3d10ref; + + trace("Failed to create a HW device, trying REF\n"); + IDXGIAdapter_Release(adapter); + adapter = NULL; + + d3d10ref = LoadLibraryA("d3d10ref.dll"); + if (!d3d10ref) + { + trace("d3d10ref.dll not available, unable to create a REF device\n"); + goto cleanup; + } + + hr = IDXGIFactory_CreateSoftwareAdapter(factory, d3d10ref, &adapter); + FreeLibrary(d3d10ref); + ok(SUCCEEDED(hr), "CreateSoftwareAdapter failed, hr %#x\n", hr); + if (FAILED(hr)) goto cleanup; + + hr = DXGID3D10CreateDevice(d3d10core, factory, adapter, 0, 0, (void **)&device); + ok(SUCCEEDED(hr), "Failed to create a REF device, hr %#x\n", hr); + if (FAILED(hr)) goto cleanup; + } + + hr = IUnknown_QueryInterface(device, &IID_IDXGIDevice, (void **)&dxgi_device); + ok(SUCCEEDED(hr), "Created device does not implement IDXGIDevice\n"); + IUnknown_Release(device); + +cleanup: + if (adapter) IDXGIAdapter_Release(adapter); + if (factory) IDXGIFactory_Release(factory); + + return dxgi_device; +} + +static void test_device_interfaces(IDXGIDevice *device) +{ + IUnknown *obj; + HRESULT hr; + + if (SUCCEEDED(hr = IDXGIDevice_QueryInterface(device, &IID_IUnknown, (void **)&obj))) + IUnknown_Release(obj); + ok(SUCCEEDED(hr), "IDXGIDevice does not implement IUnknown\n"); + + if (SUCCEEDED(hr = IDXGIDevice_QueryInterface(device, &IID_IDXGIObject, (void **)&obj))) + IUnknown_Release(obj); + ok(SUCCEEDED(hr), "IDXGIDevice does not implement IDXGIObject\n"); + + if (SUCCEEDED(hr = IDXGIDevice_QueryInterface(device, &IID_IDXGIDevice, (void **)&obj))) + IUnknown_Release(obj); + ok(SUCCEEDED(hr), "IDXGIDevice does not implement IDXGIDevice\n"); + + if (SUCCEEDED(hr = IDXGIDevice_QueryInterface(device, &IID_ID3D10Device, (void **)&obj))) + IUnknown_Release(obj); + ok(SUCCEEDED(hr), "IDXGIDevice does not implement ID3D10Device\n"); +} + +START_TEST(device) +{ + HMODULE d3d10core = LoadLibraryA("d3d10core.dll"); + IDXGIDevice *device; + ULONG refcount; + + if (!d3d10core) + { + win_skip("d3d10core.dll not available, skipping tests\n"); + return; + } + + device = create_device(d3d10core); + if (!device) + { + skip("Failed to create device, skipping tests\n"); + FreeLibrary(d3d10core); + return; + } + + test_device_interfaces(device); + + refcount = IDXGIDevice_Release(device); + ok(!refcount, "Device has %u references left\n", refcount); + FreeLibrary(d3d10core); +} diff --git a/dlls/gdi32/bidi.c b/dlls/gdi32/bidi.c index f53ac26a11b..9ac5e1d283a 100644 --- a/dlls/gdi32/bidi.c +++ b/dlls/gdi32/bidi.c @@ -1089,7 +1089,7 @@ BOOL BIDI_Reorder( if (WINE_GCPW_FORCE_RTL == (dwWineGCP_Flags&WINE_GCPW_DIR_MASK)) baselevel = 1; - i = done = 0; + done = 0; while (done < uCount) { unsigned j; diff --git a/dlls/gdiplus/graphicspath.c b/dlls/gdiplus/graphicspath.c index 9318e1a94c3..20a3b2cb855 100644 --- a/dlls/gdiplus/graphicspath.c +++ b/dlls/gdiplus/graphicspath.c @@ -984,17 +984,17 @@ GpStatus WINGDIPAPI GdipFlattenPath(GpPath *path, GpMatrix* matrix, REAL flatnes /* always add line points and start points */ if((type == PathPointTypeStart) || (type == PathPointTypeLine)){ - type = (path->pathdata.Types[i] & ~PathPointTypeBezier) | PathPointTypeLine; - if(!add_path_list_node(node, pt.X, pt.Y, type)) + if(!add_path_list_node(node, pt.X, pt.Y, path->pathdata.Types[i])) goto memout; node = node->next; + ++i; continue; } /* Bezier curve always stored as 4 points */ if((path->pathdata.Types[i-1] & PathPointTypePathTypeMask) != PathPointTypeStart){ - type = (path->pathdata.Types[i] & ~PathPointTypeBezier) | PathPointTypeLine; + type = (path->pathdata.Types[i] & ~PathPointTypePathTypeMask) | PathPointTypeLine; if(!add_path_list_node(node, pt.X, pt.Y, type)) goto memout; @@ -1014,7 +1014,7 @@ GpStatus WINGDIPAPI GdipFlattenPath(GpPath *path, GpMatrix* matrix, REAL flatnes start = node; /* add Bezier end point */ - type = (path->pathdata.Types[i] & ~PathPointTypeBezier) | PathPointTypeLine; + type = (path->pathdata.Types[i] & ~PathPointTypePathTypeMask) | PathPointTypeLine; if(!add_path_list_node(node, pt.X, pt.Y, type)) goto memout; node = node->next; diff --git a/dlls/gdiplus/tests/graphicspath.c b/dlls/gdiplus/tests/graphicspath.c index 7a5fbc2b47c..168c4b57ec6 100644 --- a/dlls/gdiplus/tests/graphicspath.c +++ b/dlls/gdiplus/tests/graphicspath.c @@ -914,6 +914,11 @@ static path_test_t flattenellipse_path[] = { {100.0,25.0, PathPointTypeLine | PathPointTypeCloseSubpath, 0, 1} /*24*/ }; +static path_test_t flattenline_path[] = { + {5.0, 10.0,PathPointTypeStart, 0, 0}, /*0*/ + {50.0, 100.0, PathPointTypeLine, 0, 0} /*1*/ + }; + static path_test_t flattenarc_path[] = { {100.0, 25.0,PathPointTypeStart, 0, 0}, /*0*/ {99.0, 30.0, PathPointTypeLine, 0, 0}, /*1*/ @@ -966,6 +971,14 @@ static void test_flatten(void) status = GdipResetPath(path); expect(Ok, status); + status = GdipAddPathLine(path, 5.0, 10.0, 50.0, 100.0); + expect(Ok, status); + status = GdipFlattenPath(path, NULL, 1.0); + expect(Ok, status); + ok_path(path, flattenline_path, sizeof(flattenline_path)/sizeof(path_test_t), FALSE); + + status = GdipResetPath(path); + expect(Ok, status); status = GdipAddPathArc(path, 0.0, 0.0, 100.0, 50.0, 0.0, 90.0); expect(Ok, status); status = GdipFlattenPath(path, NULL, 1.0); diff --git a/dlls/hhctrl.ocx/Pt.rc b/dlls/hhctrl.ocx/Pt.rc new file mode 100644 index 00000000000..d196ff499b9 --- /dev/null +++ b/dlls/hhctrl.ocx/Pt.rc @@ -0,0 +1,58 @@ +/* + * HTML Help resources + * Portuguese Language Support + * + * Copyright 2008 Ricardo Filipe + * + * 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 + */ + +LANGUAGE LANG_PORTUGUESE, SUBLANG_NEUTRAL + +STRINGTABLE +BEGIN + IDS_CONTENTS "&Conteúdos" + IDS_INDEX "&Índice" + IDS_SEARCH "&Pesquisar" + IDS_FAVORITES "&Favoritos" +END + +STRINGTABLE +BEGIN + IDTB_EXPAND "Mostrar" + IDTB_CONTRACT "Esconder" + IDTB_STOP "Parar" + IDTB_REFRESH "Actualizar" + IDTB_BACK "Retroceder" + IDTB_HOME "Início" + IDTB_SYNC "Sincronizar" + IDTB_PRINT "Imprimir" + IDTB_OPTIONS "Opções" + IDTB_FORWARD "Avançar" + IDTB_NOTES "IDTB_NOTES" + IDTB_BROWSE_FWD "IDTB_BROWSE_FWD" + IDTB_BROWSE_BACK "IDT_BROWSE_BACK" + IDTB_CONTENTS "IDTB_CONTENTS" + IDTB_INDEX "IDTB_INDEX" + IDTB_SEARCH "IDTB_SEARCH" + IDTB_HISTORY "IDTB_HISTORY" + IDTB_FAVORITES "IDTB_FAVORITES" + IDTB_JUMP1 "Jump1" + IDTB_JUMP2 "Jump2" + IDTB_CUSTOMIZE "Personalizar" + IDTB_ZOOM "Zoom" + IDTB_TOC_NEXT "IDTB_TOC_NEXT" + IDTB_TOC_PREV "IDTB_TOC_PREV" +END diff --git a/dlls/hhctrl.ocx/hhctrl.rc b/dlls/hhctrl.ocx/hhctrl.rc index 1a5950cef26..e6dc1126418 100644 --- a/dlls/hhctrl.ocx/hhctrl.rc +++ b/dlls/hhctrl.ocx/hhctrl.rc @@ -41,6 +41,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL #include "Nl.rc" #include "No.rc" #include "Pl.rc" +#include "Pt.rc" #include "Ru.rc" #include "Si.rc" #include "Sv.rc" diff --git a/dlls/imm32/imm.c b/dlls/imm32/imm.c index 5e820a28a29..3ed6411ceba 100644 --- a/dlls/imm32/imm.c +++ b/dlls/imm32/imm.c @@ -106,6 +106,11 @@ static UINT WM_MSIME_DOCUMENTFEED; static const WCHAR szwWineIMCProperty[] = {'W','i','n','e','I','m','m','H','I','M','C','P','r','o','p','e','r','t','y',0}; +static const WCHAR szImeFileW[] = {'I','m','e',' ','F','i','l','e',0}; +static const WCHAR szLayoutTextW[] = {'L','a','y','o','u','t',' ','T','e','x','t',0}; +static const WCHAR szImeRegFmt[] = {'S','y','s','t','e','m','\\','C','u','r','r','e','n','t','C','o','n','t','r','o','l','S','e','t','\\','C','o','n','t','r','o','l','\\','K','e','y','b','o','a','r','d',' ','L','a','y','o','u','t','s','\\','%','0','8','x',0}; + + #define is_himc_ime_unicode(p) (p->immKbd->imeInfo.fdwProperty & IME_PROP_UNICODE) #define is_kbd_ime_unicode(p) (p->imeInfo.fdwProperty & IME_PROP_UNICODE) @@ -1523,15 +1528,12 @@ UINT WINAPI ImmGetIMEFileNameA( HKL hKL, LPSTR lpszFileName, UINT uBufLen) */ UINT WINAPI ImmGetIMEFileNameW(HKL hKL, LPWSTR lpszFileName, UINT uBufLen) { - static const WCHAR szImeFileW[] = {'I','m','e',' ','F','i','l','e',0}; - static const WCHAR fmt[] = {'S','y','s','t','e','m','\\','C','u','r','r','e','n','t','C','o','n','t','r','o','l','S','e','t','\\','C','o','n','t','r','o','l','\\','K','e','y','b','o','a','r','d',' ','L','a','y','o','u','t','s','\\','%','0','8','x',0}; - HKEY hkey; DWORD length; DWORD rc; - WCHAR regKey[sizeof(fmt)/sizeof(WCHAR)+8]; + WCHAR regKey[sizeof(szImeRegFmt)/sizeof(WCHAR)+8]; - wsprintfW( regKey, fmt, (unsigned)hKL ); + wsprintfW( regKey, szImeRegFmt, (unsigned)hKL ); rc = RegOpenKeyW( HKEY_LOCAL_MACHINE, regKey, &hkey); if (rc != ERROR_SUCCESS) { @@ -1713,11 +1715,21 @@ UINT WINAPI ImmGetVirtualKey(HWND hWnd) HKL WINAPI ImmInstallIMEA( LPCSTR lpszIMEFileName, LPCSTR lpszLayoutText) { - FIXME("(%s, %s): stub\n", - debugstr_a(lpszIMEFileName), debugstr_a(lpszLayoutText) - ); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return NULL; + LPWSTR lpszwIMEFileName; + LPWSTR lpszwLayoutText; + HKL hkl; + + TRACE ("(%s, %s)\n", debugstr_a(lpszIMEFileName), + debugstr_a(lpszLayoutText)); + + lpszwIMEFileName = strdupAtoW(lpszIMEFileName); + lpszwLayoutText = strdupAtoW(lpszLayoutText); + + hkl = ImmInstallIMEW(lpszwIMEFileName, lpszwLayoutText); + + HeapFree(GetProcessHeap(),0,lpszwIMEFileName); + HeapFree(GetProcessHeap(),0,lpszwLayoutText); + return hkl; } /*********************************************************************** @@ -1726,11 +1738,56 @@ HKL WINAPI ImmInstallIMEA( HKL WINAPI ImmInstallIMEW( LPCWSTR lpszIMEFileName, LPCWSTR lpszLayoutText) { - FIXME("(%s, %s): stub\n", - debugstr_w(lpszIMEFileName), debugstr_w(lpszLayoutText) - ); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return NULL; + INT lcid = GetUserDefaultLCID(); + INT count; + HKL hkl; + DWORD rc; + HKEY hkey; + WCHAR regKey[sizeof(szImeRegFmt)/sizeof(WCHAR)+8]; + + TRACE ("(%s, %s):\n", debugstr_w(lpszIMEFileName), + debugstr_w(lpszLayoutText)); + + /* Start with 2. e001 will be blank and so default to the wine internal IME */ + count = 2; + + while (count < 0xfff) + { + DWORD disposition = 0; + + hkl = (HKL)(((0xe000|count)<<16) | lcid); + wsprintfW( regKey, szImeRegFmt, (unsigned)hkl); + + rc = RegCreateKeyExW(HKEY_LOCAL_MACHINE, regKey, 0, NULL, 0, KEY_WRITE, NULL, &hkey, &disposition); + if (rc == ERROR_SUCCESS && disposition == REG_CREATED_NEW_KEY) + break; + else if (rc == ERROR_SUCCESS) + RegCloseKey(hkey); + + count++; + } + + if (count == 0xfff) + { + WARN("Unable to find slot to install IME\n"); + return 0; + } + + if (rc == ERROR_SUCCESS) + { + rc = RegSetValueExW(hkey, szImeFileW, 0, REG_SZ, (LPBYTE)lpszIMEFileName, + (lstrlenW(lpszIMEFileName) + 1) * sizeof(WCHAR)); + if (rc == ERROR_SUCCESS) + rc = RegSetValueExW(hkey, szLayoutTextW, 0, REG_SZ, (LPBYTE)lpszLayoutText, + (lstrlenW(lpszLayoutText) + 1) * sizeof(WCHAR)); + RegCloseKey(hkey); + return hkl; + } + else + { + WARN("Unable to set IME registry values\n"); + return 0; + } } /*********************************************************************** diff --git a/dlls/inetcomm/pop3transport.c b/dlls/inetcomm/pop3transport.c index 30dd1877694..037716421bf 100644 --- a/dlls/inetcomm/pop3transport.c +++ b/dlls/inetcomm/pop3transport.c @@ -19,6 +19,7 @@ */ #define COBJMACROS +#define NONAMELESSUNION #include #include @@ -350,12 +351,12 @@ static HRESULT POP3Transport_ParseResponse(POP3Transport *This, char *pszRespons { switch (This->command) { - case POP3_UIDL: hr = parse_uidl_response(This, &pResponse->rUidlInfo); break; - case POP3_STAT: hr = parse_stat_response(This, &pResponse->rStatInfo); break; - case POP3_LIST: hr = parse_list_response(This, &pResponse->rListInfo); break; - case POP3_DELE: hr = parse_dele_response(This, &pResponse->dwPopId); break; - case POP3_RETR: hr = parse_retr_response(This, &pResponse->rRetrInfo); break; - case POP3_TOP: hr = parse_top_response(This, &pResponse->rTopInfo); break; + case POP3_UIDL: hr = parse_uidl_response(This, &pResponse->u.rUidlInfo); break; + case POP3_STAT: hr = parse_stat_response(This, &pResponse->u.rStatInfo); break; + case POP3_LIST: hr = parse_list_response(This, &pResponse->u.rListInfo); break; + case POP3_DELE: hr = parse_dele_response(This, &pResponse->u.dwPopId); break; + case POP3_RETR: hr = parse_retr_response(This, &pResponse->u.rRetrInfo); break; + case POP3_TOP: hr = parse_top_response(This, &pResponse->u.rTopInfo); break; default: This->state = STATE_DONE; break; diff --git a/dlls/iphlpapi/icmp.c b/dlls/iphlpapi/icmp.c index 3abdbbaa465..a5858ca7008 100644 --- a/dlls/iphlpapi/icmp.c +++ b/dlls/iphlpapi/icmp.c @@ -339,7 +339,7 @@ DWORD WINAPI IcmpSendEcho( /* Get the reply */ ip_header_len=0; /* because gcc was complaining */ - while ((res=poll(&fdr,1,Timeout))>0) { + while (poll(&fdr,1,Timeout)>0) { recv_time = GetTickCount(); res=recvfrom(icp->sid, (char*)ip_header, maxlen, 0, (struct sockaddr*)&addr,&addrlen); TRACE("received %d bytes from %s\n",res, inet_ntoa(addr.sin_addr)); diff --git a/dlls/kernel32/cpu.c b/dlls/kernel32/cpu.c index 6f500099059..63ca2774e96 100644 --- a/dlls/kernel32/cpu.c +++ b/dlls/kernel32/cpu.c @@ -132,7 +132,7 @@ static void create_system_registry_keys( const SYSTEM_INFO *info ) if (NtCreateKey( &system_key, KEY_ALL_ACCESS, &attr, 0, NULL, 0, NULL )) return; RtlInitUnicodeString( &valueW, IdentifierW ); - NtSetValueKey( system_key, &valueW, 0, REG_SZ, SysidW, (strlenW(SysidW)+1) * sizeof(WCHAR) ); + NtSetValueKey( system_key, &valueW, 0, REG_SZ, SysidW, sizeof(SysidW) ); attr.RootDirectory = system_key; RtlInitUnicodeString( &nameW, fpuW ); @@ -151,6 +151,7 @@ static void create_system_registry_keys( const SYSTEM_INFO *info ) if (!NtCreateKey( &hkey, KEY_ALL_ACCESS, &attr, 0, NULL, 0, NULL )) { WCHAR idW[60]; + DWORD sizeW; DWORD cpuMHz = cpuHz / 1000000; /*TODO: report 64bit processors properly*/ @@ -158,12 +159,12 @@ static void create_system_registry_keys( const SYSTEM_INFO *info ) sprintf( id, "x86 Family %d Model %d Stepping %d", info->wProcessorLevel, HIBYTE(info->wProcessorRevision), LOBYTE(info->wProcessorRevision) ); - RtlMultiByteToUnicodeN( idW, sizeof(idW), NULL, id, strlen(id)+1 ); - NtSetValueKey( hkey, &valueW, 0, REG_SZ, idW, (strlenW(idW)+1)*sizeof(WCHAR) ); + RtlMultiByteToUnicodeN( idW, sizeof(idW), &sizeW, id, strlen(id)+1 ); + NtSetValueKey( hkey, &valueW, 0, REG_SZ, idW, sizeW ); /*TODO; report amd's properly*/ RtlInitUnicodeString( &valueW, VendorIdentifierW ); - NtSetValueKey( hkey, &valueW, 0, REG_SZ, VenidIntelW, (strlenW(VenidIntelW)+1) * sizeof(WCHAR) ); + NtSetValueKey( hkey, &valueW, 0, REG_SZ, VenidIntelW, sizeof(VenidIntelW) ); RtlInitUnicodeString( &valueW, mhzKeyW ); NtSetValueKey( hkey, &valueW, 0, REG_DWORD, &cpuMHz, sizeof(DWORD) ); @@ -194,6 +195,7 @@ static void create_env_registry_keys( const SYSTEM_INFO *info ) HANDLE env_key; OBJECT_ATTRIBUTES attr; UNICODE_STRING nameW, valueW; + DWORD sizeW; char nProc[10],id[60],procLevel[10],rev[10]; WCHAR nProcW[10],idW[60],procLevelW[10],revW[10]; @@ -214,31 +216,31 @@ static void create_env_registry_keys( const SYSTEM_INFO *info ) if (NtCreateKey( &env_key, KEY_ALL_ACCESS, &attr, 0, NULL, 0, NULL )) return; sprintf( nProc, "%d", info->dwNumberOfProcessors ); - RtlMultiByteToUnicodeN( nProcW, sizeof(nProcW), NULL, nProc, strlen(nProc)+1 ); + RtlMultiByteToUnicodeN( nProcW, sizeof(nProcW), &sizeW, nProc, strlen(nProc)+1 ); RtlInitUnicodeString( &valueW, NumProcW ); - NtSetValueKey( env_key, &valueW, 0, REG_SZ, nProcW, (strlenW(nProcW)+1)*sizeof(WCHAR) ); + NtSetValueKey( env_key, &valueW, 0, REG_SZ, nProcW, sizeW ); /* TODO: currently hardcoded x86, add different processors */ RtlInitUnicodeString( &valueW, ProcArchW ); - NtSetValueKey( env_key, &valueW, 0, REG_SZ, x86W, (strlenW(x86W)+1) * sizeof(WCHAR) ); + NtSetValueKey( env_key, &valueW, 0, REG_SZ, x86W, sizeof(x86W) ); /* TODO: currently hardcoded Intel, add different processors */ sprintf( id, "x86 Family %d Model %d Stepping %d, GenuineIntel", info->wProcessorLevel, HIBYTE(info->wProcessorRevision), LOBYTE(info->wProcessorRevision) ); - RtlMultiByteToUnicodeN( idW, sizeof(idW), NULL, id, strlen(id)+1 ); + RtlMultiByteToUnicodeN( idW, sizeof(idW), &sizeW, id, strlen(id)+1 ); RtlInitUnicodeString( &valueW, ProcIdW ); - NtSetValueKey( env_key, &valueW, 0, REG_SZ, idW, (strlenW(idW)+1)*sizeof(WCHAR) ); + NtSetValueKey( env_key, &valueW, 0, REG_SZ, idW, sizeW ); sprintf( procLevel, "%d", info->wProcessorLevel ); - RtlMultiByteToUnicodeN( procLevelW, sizeof(procLevelW), NULL, procLevel, strlen(procLevel)+1 ); + RtlMultiByteToUnicodeN( procLevelW, sizeof(procLevelW), &sizeW, procLevel, strlen(procLevel)+1 ); RtlInitUnicodeString( &valueW, ProcLvlW ); - NtSetValueKey( env_key, &valueW, 0, REG_SZ, procLevelW, (strlenW(procLevelW)+1)*sizeof(WCHAR) ); + NtSetValueKey( env_key, &valueW, 0, REG_SZ, procLevelW, sizeW ); /* Properly report model/stepping */ sprintf( rev, "%04x", info->wProcessorRevision); - RtlMultiByteToUnicodeN( revW, sizeof(revW), NULL, rev, strlen(rev)+1 ); + RtlMultiByteToUnicodeN( revW, sizeof(revW), &sizeW, rev, strlen(rev)+1 ); RtlInitUnicodeString( &valueW, ProcRevW ); - NtSetValueKey( env_key, &valueW, 0, REG_SZ, revW, (strlenW(revW)+1)*sizeof(WCHAR) ); + NtSetValueKey( env_key, &valueW, 0, REG_SZ, revW, sizeW ); NtClose( env_key ); } diff --git a/dlls/kernel32/dosmem.c b/dlls/kernel32/dosmem.c index f3aad4c938b..a1bff4dc68c 100644 --- a/dlls/kernel32/dosmem.c +++ b/dlls/kernel32/dosmem.c @@ -151,77 +151,37 @@ static LONG WINAPI dosmem_handler(EXCEPTION_POINTERS* except) return EXCEPTION_CONTINUE_SEARCH; } -/********************************************************************** - * setup_dos_mem +/*********************************************************************** + * DOSMEM_Init * - * Setup the first megabyte for DOS memory access + * Create the dos memory segments, and store them into the KERNEL + * exported values. */ -static char* setup_dos_mem(void) +BOOL DOSMEM_Init(void) { - size_t size; - int page_size = getpagesize(); - void *addr = NULL; - void * const low_64k = (void *)DOSMEM_64KB; - - /* check without the first 64K */ + char *sysmem; + void *addr = (void *)1; + SIZE_T size = DOSMEM_SIZE - 1; - if (wine_mmap_is_in_reserved_area( low_64k, DOSMEM_SIZE - DOSMEM_64KB ) != 1) + if (NtAllocateVirtualMemory( GetCurrentProcess(), &addr, 0, &size, + MEM_RESERVE | MEM_COMMIT, PAGE_NOACCESS )) { - addr = wine_anon_mmap( low_64k, DOSMEM_SIZE - DOSMEM_64KB, PROT_READ | PROT_WRITE, 0 ); - if (addr != low_64k) - { - if (addr != MAP_FAILED) munmap( addr, DOSMEM_SIZE - DOSMEM_64KB ); - ERR("Cannot use first megabyte for DOS address space, please report\n" ); - /* allocate the DOS area somewhere else */ - if (!(DOSMEM_dosmem = VirtualAlloc( NULL, DOSMEM_SIZE, MEM_RESERVE, PAGE_NOACCESS ))) - { - ERR( "Cannot allocate DOS memory\n" ); - ExitProcess(1); - } - return DOSMEM_dosmem; - } + ERR( "Cannot allocate DOS memory\n" ); + ExitProcess(1); } - /* now try to allocate the low 64K too */ - - if (wine_mmap_is_in_reserved_area( NULL, DOSMEM_64KB ) != 1) + DOSMEM_dosmem = addr; + if (!addr) { - addr = wine_anon_mmap( (void *)page_size, DOSMEM_64KB - page_size, PROT_READ | PROT_WRITE, 0 ); - if (addr == (void *)page_size) - { - addr = NULL; - TRACE( "successfully mapped low 64K range\n" ); - } - else - { - if (addr != MAP_FAILED) munmap( addr, DOSMEM_64KB - page_size ); - addr = low_64k; - TRACE( "failed to map low 64K range\n" ); - } + DOSMEM_protect = DOSMEM_64KB; + sysmem = (char *)0xf0000; /* store sysmem in high addresses for now */ + } + else + { + WARN( "First megabyte not available for DOS address space.\n" ); + DOSMEM_protect = 0; + sysmem = DOSMEM_dosmem; } - else addr = NULL; - - /* now reserve the whole range */ - size = (char *)DOSMEM_SIZE - (char *)addr; - wine_anon_mmap( addr, size, PROT_NONE, MAP_FIXED ); - - /* inform the memory manager that there is a mapping here, but don't commit yet */ - VirtualAlloc( addr, size, MEM_RESERVE | MEM_SYSTEM, PAGE_NOACCESS ); - DOSMEM_protect = DOSMEM_64KB; - DOSMEM_dosmem = NULL; - return (char *)0xf0000; /* store sysmem in high addresses for now */ -} - - -/*********************************************************************** - * DOSMEM_Init - * - * Create the dos memory segments, and store them into the KERNEL - * exported values. - */ -BOOL DOSMEM_Init(void) -{ - char* sysmem = setup_dos_mem(); RtlAddVectoredExceptionHandler(FALSE, dosmem_handler); DOSMEM_0000H = GLOBAL_CreateBlock( GMEM_FIXED, sysmem, diff --git a/dlls/kernel32/oldconfig.c b/dlls/kernel32/oldconfig.c index ee41d813143..20b6eaaeff5 100644 --- a/dlls/kernel32/oldconfig.c +++ b/dlls/kernel32/oldconfig.c @@ -105,7 +105,7 @@ static void create_scsi_entry( PSCSI_ADDRESS scsi_addr, LPCSTR lpDriver, UINT uD OBJECT_ATTRIBUTES attr; UNICODE_STRING nameW; WCHAR dataW[50]; - DWORD lenW; + DWORD sizeW; char buffer[40]; DWORD value; const char *data; @@ -145,8 +145,8 @@ static void create_scsi_entry( PSCSI_ADDRESS scsi_addr, LPCSTR lpDriver, UINT uD RtlFreeUnicodeString( &nameW ); RtlCreateUnicodeStringFromAsciiz( &nameW, "Driver" ); - RtlMultiByteToUnicodeN( dataW, sizeof(dataW), &lenW, lpDriver, strlen(lpDriver)); - NtSetValueKey( portKey, &nameW, 0, REG_SZ, (BYTE*)dataW, lenW ); + RtlMultiByteToUnicodeN( dataW, sizeof(dataW), &sizeW, lpDriver, strlen(lpDriver)+1); + NtSetValueKey( portKey, &nameW, 0, REG_SZ, (BYTE*)dataW, sizeW ); RtlFreeUnicodeString( &nameW ); value = 10; RtlCreateUnicodeStringFromAsciiz( &nameW, "FirstBusTimeScanInMs" ); @@ -233,26 +233,26 @@ static void create_scsi_entry( PSCSI_ADDRESS scsi_addr, LPCSTR lpDriver, UINT uD break; } RtlCreateUnicodeStringFromAsciiz( &nameW, "Type" ); - RtlMultiByteToUnicodeN( dataW, sizeof(dataW), &lenW, data, strlen(data)); - NtSetValueKey( lunKey, &nameW, 0, REG_SZ, (BYTE*)dataW, lenW ); + RtlMultiByteToUnicodeN( dataW, sizeof(dataW), &sizeW, data, strlen(data)+1); + NtSetValueKey( lunKey, &nameW, 0, REG_SZ, (BYTE*)dataW, sizeW ); RtlFreeUnicodeString( &nameW ); RtlCreateUnicodeStringFromAsciiz( &nameW, "Identifier" ); - RtlMultiByteToUnicodeN( dataW, sizeof(dataW), &lenW, lpDriveName, strlen(lpDriveName)); - NtSetValueKey( lunKey, &nameW, 0, REG_SZ, (BYTE*)dataW, lenW ); + RtlMultiByteToUnicodeN( dataW, sizeof(dataW), &sizeW, lpDriveName, strlen(lpDriveName)+1); + NtSetValueKey( lunKey, &nameW, 0, REG_SZ, (BYTE*)dataW, sizeW ); RtlFreeUnicodeString( &nameW ); if (uDriveType == DRIVE_CDROM || uDriveType == DRIVE_REMOVABLE) { RtlCreateUnicodeStringFromAsciiz( &nameW, "DeviceName" ); - RtlMultiByteToUnicodeN( dataW, sizeof(dataW), &lenW, buffer, strlen(buffer)); - NtSetValueKey( lunKey, &nameW, 0, REG_SZ, (BYTE*)dataW, lenW ); + RtlMultiByteToUnicodeN( dataW, sizeof(dataW), &sizeW, buffer, strlen(buffer)+1); + NtSetValueKey( lunKey, &nameW, 0, REG_SZ, (BYTE*)dataW, sizeW ); RtlFreeUnicodeString( &nameW ); } RtlCreateUnicodeStringFromAsciiz( &nameW, "UnixDeviceName" ); - RtlMultiByteToUnicodeN( dataW, sizeof(dataW), &lenW, lpUnixDeviceName, strlen(lpUnixDeviceName)); - NtSetValueKey( lunKey, &nameW, 0, REG_SZ, (BYTE*)dataW, lenW ); + RtlMultiByteToUnicodeN( dataW, sizeof(dataW), &sizeW, lpUnixDeviceName, strlen(lpUnixDeviceName)+1); + NtSetValueKey( lunKey, &nameW, 0, REG_SZ, (BYTE*)dataW, sizeW ); RtlFreeUnicodeString( &nameW ); NtClose( lunKey ); diff --git a/dlls/kernel32/tests/file.c b/dlls/kernel32/tests/file.c index e589f6e60da..72976623a06 100644 --- a/dlls/kernel32/tests/file.c +++ b/dlls/kernel32/tests/file.c @@ -2113,12 +2113,12 @@ static void test_ReplaceFileA(void) /* make sure that the backup has the old "replaced" filetime */ ret = GetFileTime(hBackupFile, NULL, NULL, &ftBackup); ok( ret, "GetFileTime error (backup %d\n", GetLastError()); - ok(check_file_time(&ftBackup, &ftReplaced, 1000000), "backup file has wrong filetime\n"); + ok(check_file_time(&ftBackup, &ftReplaced, 20000000), "backup file has wrong filetime\n"); CloseHandle(hBackupFile); /* make sure that the "replaced" has the old replacement filetime */ ret = GetFileTime(hReplacedFile, NULL, NULL, &ftReplaced); ok( ret, "GetFileTime error (backup %d\n", GetLastError()); - ok(check_file_time(&ftReplaced, &ftReplacement, 1000000), + ok(check_file_time(&ftReplaced, &ftReplacement, 20000000), "replaced file has wrong filetime %x%08x / %x%08x\n", ftReplaced.dwHighDateTime, ftReplaced.dwLowDateTime, ftReplacement.dwHighDateTime, ftReplacement.dwLowDateTime ); diff --git a/dlls/kernel32/tests/locale.c b/dlls/kernel32/tests/locale.c index 0077db2af71..c5f3ddb90eb 100644 --- a/dlls/kernel32/tests/locale.c +++ b/dlls/kernel32/tests/locale.c @@ -102,32 +102,16 @@ static void InitFunctionPointers(void) #define BUFFER_SIZE 128 #define COUNTOF(x) (sizeof(x)/sizeof(x)[0]) -#define EXPECT_LEN(len) ok(ret == (len), "Expected Len %d, got %d\n", (int)(len), ret) -#define EXPECT_INVALID ok(GetLastError() == ERROR_INVALID_PARAMETER, \ - "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()) -#define EXPECT_BUFFER ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, \ - "Expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError()) -#define EXPECT_FLAGS ok(GetLastError() == ERROR_INVALID_FLAGS, \ - "Expected ERROR_INVALID_FLAGS, got %d\n", GetLastError()) -#define EXPECT_INVALIDFLAGS ok(GetLastError() == ERROR_INVALID_FLAGS || \ - GetLastError() == ERROR_INVALID_PARAMETER, \ - "Expected ERROR_INVALID_FLAGS, got %d\n", GetLastError()) -#define EXPECT_LASTERROR_0 ok(GetLastError() == 0, \ - "Expected GetLastError() == 0, got %d\n", GetLastError()) -#define EXPECT_VALID ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()) - -#define STRINGSA(x,y) strcpy(input, x); strcpy(Expected, y); SetLastError(0); buffer[0] = '\0' -#define EXPECT_LENA EXPECT_LEN((int)strlen(Expected)+1) +#define STRINGSA(x,y) strcpy(input, x); strcpy(Expected, y); SetLastError(0xdeadbeef); buffer[0] = '\0' +#define EXPECT_LENA ok(ret == lstrlen(Expected)+1, "Expected Len %d, got %d\n", lstrlen(Expected)+1, ret) #define EXPECT_EQA ok(strncmp(buffer, Expected, strlen(Expected)) == 0, \ "Expected '%s', got '%s'\n", Expected, buffer) #define STRINGSW(x,y) MultiByteToWideChar(CP_ACP,0,x,-1,input,COUNTOF(input)); \ MultiByteToWideChar(CP_ACP,0,y,-1,Expected,COUNTOF(Expected)); \ - SetLastError(0); buffer[0] = '\0' -#define EXPECT_LENW EXPECT_LEN((int)strlenW(Expected)+1) + SetLastError(0xdeadbeef); buffer[0] = '\0' +#define EXPECT_LENW ok(ret == lstrlenW(Expected)+1, "Expected Len %d, got %d\n", lstrlenW(Expected)+1, ret) #define EXPECT_EQW ok(strncmpW(buffer, Expected, strlenW(Expected)) == 0, "Bad conversion\n") -#define EXPECT_FALSE ok(FALSE == ret, "Expected return value FALSE, got TRUE\n") -#define EXPECT_TRUE ok(FALSE != ret, "Expected return value TRUE, got FALSE\n") #define NUO LOCALE_NOUSEROVERRIDE @@ -148,12 +132,13 @@ static void test_GetLocaleInfoA(void) SetLastError(0); memset(buffer, 0, COUNTOF(buffer)); ret = GetLocaleInfoA(lcid, NUO|LOCALE_SDAYNAME1, buffer, 3); - EXPECT_BUFFER; EXPECT_LEN(0); + ok( !ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER, + "Expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError()); ok(!strcmp(buffer, "Mon"), "Expected 'Mon', got '%s'\n", buffer); SetLastError(0); memset(buffer, 0, COUNTOF(buffer)); ret = GetLocaleInfoA(lcid, NUO|LOCALE_SDAYNAME1, buffer, 10); - EXPECT_VALID; EXPECT_LEN(7); + ok(ret == 7, "Expected ret == 7, got %d, error %d\n", ret, GetLastError()); ok(!strcmp(buffer, "Monday"), "Expected 'Monday', got '%s'\n", buffer); } @@ -168,7 +153,8 @@ static void test_GetTimeFormatA(void) STRINGSA("tt HH':'mm'@'ss", ""); /* Invalid time */ SetLastError(0xdeadbeef); ret = GetTimeFormatA(lcid, TIME_FORCE24HOURFORMAT, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_INVALID; EXPECT_LEN(0); EXPECT_EQA; + ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); curtime.wHour = 8; curtime.wMinute = 56; @@ -177,83 +163,104 @@ static void test_GetTimeFormatA(void) STRINGSA("tt HH':'mm'@'ss", "AM 08:56@13"); /* Valid time */ SetLastError(0xdeadbeef); ret = GetTimeFormatA(lcid, TIME_FORCE24HOURFORMAT, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; /* MSDN: LOCALE_NOUSEROVERRIDE can't be specified with a format string */ SetLastError(0xdeadbeef); ret = GetTimeFormatA(lcid, NUO|TIME_FORCE24HOURFORMAT, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_FLAGS; EXPECT_LEN(0); EXPECT_EQA; + ok(!ret && GetLastError() == ERROR_INVALID_FLAGS, + "Expected ERROR_INVALID_FLAGS, got %d\n", GetLastError()); STRINGSA("tt HH':'mm'@'ss", "A"); /* Insufficient buffer */ SetLastError(0xdeadbeef); ret = GetTimeFormatA(lcid, TIME_FORCE24HOURFORMAT, &curtime, input, buffer, 2); - EXPECT_BUFFER; EXPECT_LEN(0); EXPECT_EQA; + ok( !ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER, + "Expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError()); STRINGSA("tt HH':'mm'@'ss", "AM 08:56@13"); /* Calculate length only */ ret = GetTimeFormatA(lcid, TIME_FORCE24HOURFORMAT, &curtime, input, NULL, 0); - EXPECT_VALID; EXPECT_LENA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; STRINGSA("", "8 AM"); /* TIME_NOMINUTESORSECONDS, default format */ ret = GetTimeFormatA(lcid, NUO|TIME_NOMINUTESORSECONDS, &curtime, NULL, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; STRINGSA("m1s2m3s4", ""); /* TIME_NOMINUTESORSECONDS/complex format */ ret = GetTimeFormatA(lcid, TIME_NOMINUTESORSECONDS, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret == strlen(buffer)+1, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + ok( !strcmp( buffer, "" ) || broken( !strcmp( buffer, "4" )), /* win9x */ + "Expected '', got '%s'\n", buffer ); STRINGSA("", "8:56 AM"); /* TIME_NOSECONDS/Default format */ ret = GetTimeFormatA(lcid, NUO|TIME_NOSECONDS, &curtime, NULL, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; STRINGSA("h:m:s tt", "8:56 AM"); /* TIME_NOSECONDS */ strcpy(Expected, "8:56 AM"); ret = GetTimeFormatA(lcid, TIME_NOSECONDS, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; STRINGSA("h.@:m.@:s.@:tt", "8.@:56AM"); /* Multiple delimiters */ ret = GetTimeFormatA(lcid, TIME_NOSECONDS, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + ok( !strcmp( buffer, "8.@:56AM" ) || broken( !strcmp( buffer, "8.@:56.@:AM" )) /* win9x */, + "Expected '8.@:56AM', got '%s'\n", buffer ); STRINGSA("s1s2s3", ""); /* Duplicate tokens */ ret = GetTimeFormatA(lcid, TIME_NOSECONDS, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret == strlen(buffer)+1, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + ok( !strcmp( buffer, "" ) || broken( !strcmp( buffer, "3" )), /* win9x */ + "Expected '', got '%s'\n", buffer ); STRINGSA("t/tt", "A/AM"); /* AM time marker */ ret = GetTimeFormatA(lcid, 0, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; curtime.wHour = 13; STRINGSA("t/tt", "P/PM"); /* PM time marker */ ret = GetTimeFormatA(lcid, 0, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; STRINGSA("h1t2tt3m", "156"); /* TIME_NOTIMEMARKER: removes text around time marker token */ ret = GetTimeFormatA(lcid, TIME_NOTIMEMARKER, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; STRINGSA("h:m:s tt", "13:56:13 PM"); /* TIME_FORCE24HOURFORMAT */ ret = GetTimeFormatA(lcid, TIME_FORCE24HOURFORMAT, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; STRINGSA("h:m:s", "13:56:13"); /* TIME_FORCE24HOURFORMAT doesn't add time marker */ ret = GetTimeFormatA(lcid, TIME_FORCE24HOURFORMAT, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; curtime.wHour = 14; /* change this to 14 or 2pm */ curtime.wMinute = 5; curtime.wSecond = 3; STRINGSA("h hh H HH m mm s ss t tt", "2 02 14 14 5 05 3 03 P PM"); /* 24 hrs, leading 0 */ ret = GetTimeFormatA(lcid, 0, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; curtime.wHour = 0; STRINGSA("h/H/hh/HH", "12/0/12/00"); /* "hh" and "HH" */ ret = GetTimeFormatA(lcid, 0, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; STRINGSA("h:m:s tt", "12:5:3 AM"); /* non-zero flags should fail with format, doesn't */ ret = GetTimeFormatA(lcid, 0, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; /* try to convert formatting strings with more than two letters * "h:hh:hhh:H:HH:HHH:m:mm:mmm:M:MM:MMM:s:ss:sss:S:SS:SSS" @@ -268,55 +275,66 @@ static void test_GetTimeFormatA(void) STRINGSA("h:hh:hhh H:HH:HHH m:mm:mmm M:MM:MMM s:ss:sss S:SS:SSS", "8:08:08 8:08:08 56:56:56 M:MM:MMM 13:13:13 S:SS:SSS"); ret = GetTimeFormatA(lcid, 0, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; STRINGSA("h", "text"); /* Don't write to buffer if len is 0 */ strcpy(buffer, "text"); ret = GetTimeFormatA(lcid, 0, &curtime, input, buffer, 0); - EXPECT_VALID; EXPECT_LEN(2); EXPECT_EQA; + ok(ret == 2, "Expected ret == 2, got %d, error %d\n", ret, GetLastError()); + EXPECT_EQA; STRINGSA("h 'h' H 'H' HH 'HH' m 'm' s 's' t 't' tt 'tt'", "8 h 8 H 08 HH 56 m 13 s A t AM tt"); /* "'" preserves tokens */ ret = GetTimeFormatA(lcid, 0, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; STRINGSA("'''", "'"); /* invalid quoted string */ ret = GetTimeFormatA(lcid, 0, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; /* test that msdn suggested single quotation usage works as expected */ STRINGSA("''''", "'"); /* single quote mark */ ret = GetTimeFormatA(lcid, 0, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; STRINGSA("''HHHHHH", "08"); /* Normal use */ ret = GetTimeFormatA(lcid, 0, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; /* and test for normal use of the single quotation mark */ STRINGSA("'''HHHHHH'", "'HHHHHH"); /* Normal use */ ret = GetTimeFormatA(lcid, 0, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; STRINGSA("'''HHHHHH", "'HHHHHH"); /* Odd use */ ret = GetTimeFormatA(lcid, 0, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; STRINGSA("'123'tt", ""); /* TIME_NOTIMEMARKER drops literals too */ ret = GetTimeFormatA(lcid, TIME_NOTIMEMARKER, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; curtime.wHour = 25; STRINGSA("'123'tt", ""); /* Invalid time */ SetLastError(0xdeadbeef); ret = GetTimeFormatA(lcid, 0, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_INVALID; EXPECT_LEN(0); EXPECT_EQA; + ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); curtime.wHour = 12; curtime.wMonth = 60; /* Invalid */ STRINGSA("h:m:s", "12:56:13"); /* Invalid date */ ret = GetTimeFormatA(lcid, 0, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; } static void test_GetDateFormatA(void) @@ -330,7 +348,8 @@ static void test_GetDateFormatA(void) STRINGSA("ddd',' MMM dd yy",""); SetLastError(0xdeadbeef); ret = GetDateFormatA(lcid, 0, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_INVALID; EXPECT_LEN(0); EXPECT_EQA; + ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); curtime.wYear = 2002; curtime.wMonth = 5; @@ -338,48 +357,58 @@ static void test_GetDateFormatA(void) curtime.wDayOfWeek = 3; STRINGSA("ddd',' MMM dd yy","Sat, May 04 02"); /* Simple case */ ret = GetDateFormatA(lcid, 0, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; /* Same as above but with LOCALE_NOUSEROVERRIDE */ STRINGSA("ddd',' MMM dd yy",""); /* Simple case */ SetLastError(0xdeadbeef); ret = GetDateFormatA(lcid, NUO, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_FLAGS; EXPECT_LEN(0); EXPECT_EQA; + ok(!ret && GetLastError() == ERROR_INVALID_FLAGS, + "Expected ERROR_INVALID_FLAGS, got %d\n", GetLastError()); + EXPECT_EQA; STRINGSA("ddd',' MMM dd yy","Sat, May 04 02"); /* Format containing "'" */ ret = GetDateFormatA(lcid, 0, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; curtime.wHour = 36; /* Invalid */ STRINGSA("ddd',' MMM dd ''''yy","Sat, May 04 '02"); /* Invalid time */ ret = GetDateFormatA(lcid, 0, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; STRINGSA("ddd',' MMM dd ''''yy",""); /* Get size only */ ret = GetDateFormatA(lcid, 0, &curtime, input, NULL, 0); - EXPECT_VALID; EXPECT_LEN(16); EXPECT_EQA; + ok(ret == 16, "Expected ret == 16, got %d, error %d\n", ret, GetLastError()); + EXPECT_EQA; STRINGSA("ddd',' MMM dd ''''yy",""); /* Buffer too small */ SetLastError(0xdeadbeef); ret = GetDateFormatA(lcid, 0, &curtime, input, buffer, 2); - EXPECT_BUFFER; EXPECT_LEN(0); EXPECT_EQA; + ok( !ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER, + "Expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError()); STRINGSA("ddd',' MMM dd ''''yy","5/4/2002"); /* Default to DATE_SHORTDATE */ ret = GetDateFormat(lcid, NUO, &curtime, NULL, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); if (strncmp(buffer, Expected, strlen(Expected)) && strncmp(buffer, "5/4/02", strlen(Expected)) != 0) ok (0, "Expected '%s' or '5/4/02', got '%s'\n", Expected, buffer); STRINGSA("ddd',' MMM dd ''''yy", "Saturday, May 04, 2002"); /* DATE_LONGDATE */ ret = GetDateFormat(lcid, NUO|DATE_LONGDATE, &curtime, NULL, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; /* test for expected DATE_YEARMONTH behavior with null format */ /* NT4 returns ERROR_INVALID_FLAGS for DATE_YEARMONTH */ STRINGSA("ddd',' MMM dd ''''yy", ""); /* DATE_YEARMONTH */ SetLastError(0xdeadbeef); ret = GetDateFormat(lcid, NUO|DATE_YEARMONTH, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_FLAGS; EXPECT_LEN(0); EXPECT_EQA; + ok(!ret && GetLastError() == ERROR_INVALID_FLAGS, + "Expected ERROR_INVALID_FLAGS, got %d\n", GetLastError()); + EXPECT_EQA; /* Test that using invalid DATE_* flags results in the correct error */ /* and return values */ @@ -387,7 +416,9 @@ static void test_GetDateFormatA(void) SetLastError(0xdeadbeef); ret = GetDateFormat(lcid, DATE_YEARMONTH|DATE_SHORTDATE|DATE_LONGDATE, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_FLAGS; EXPECT_LEN(0); EXPECT_EQA; + ok(!ret && GetLastError() == ERROR_INVALID_FLAGS, + "Expected ERROR_INVALID_FLAGS, got %d\n", GetLastError()); + EXPECT_EQA; } static void test_GetDateFormatW(void) @@ -402,16 +433,20 @@ static void test_GetDateFormatW(void) input, buffer, COUNTOF(buffer)); if (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED) return; - EXPECT_FLAGS; EXPECT_LEN(0); EXPECT_EQW; + ok(!ret && GetLastError() == ERROR_INVALID_FLAGS, + "Expected ERROR_INVALID_FLAGS, got %d\n", GetLastError()); + EXPECT_EQW; STRINGSW("",""); /* NULL buffer, len > 0 */ SetLastError(0xdeadbeef); ret = GetDateFormatW (lcid, 0, NULL, input, NULL, COUNTOF(buffer)); - EXPECT_INVALID; EXPECT_LEN(0); EXPECT_EQW; + ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); STRINGSW("",""); /* NULL buffer, len == 0 */ ret = GetDateFormatW (lcid, 0, NULL, input, NULL, 0); - EXPECT_VALID; EXPECT_LENW; EXPECT_EQW; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENW; EXPECT_EQW; curtime.wYear = 2002; curtime.wMonth = 10; @@ -423,7 +458,8 @@ static void test_GetDateFormatW(void) curtime.wMilliseconds = 12345; STRINGSW("dddd d MMMM yyyy","Wednesday 23 October 2002"); /* Incorrect DOW and time */ ret = GetDateFormatW (lcid, 0, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENW; EXPECT_EQW; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENW; EXPECT_EQW; /* Limit tests */ @@ -438,7 +474,8 @@ static void test_GetDateFormatW(void) STRINGSW("dddd d MMMM yyyy","Monday 1 January 1601"); SetLastError(0xdeadbeef); ret = GetDateFormatW (lcid, 0, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENW; EXPECT_EQW; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENW; EXPECT_EQW; curtime.wYear = 1600; curtime.wMonth = 12; @@ -451,7 +488,8 @@ static void test_GetDateFormatW(void) STRINGSW("dddd d MMMM yyyy","Friday 31 December 1600"); SetLastError(0xdeadbeef); ret = GetDateFormatW (lcid, 0, &curtime, input, buffer, COUNTOF(buffer)); - EXPECT_INVALID; + ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); } @@ -475,67 +513,82 @@ static void test_GetCurrencyFormatA(void) STRINGSA("23",""); /* NULL output, length > 0 --> Error */ SetLastError(0xdeadbeef); ret = GetCurrencyFormatA(lcid, 0, input, NULL, NULL, COUNTOF(buffer)); - EXPECT_INVALID; EXPECT_LEN(0); EXPECT_EQA; + ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); STRINGSA("23,53",""); /* Invalid character --> Error */ SetLastError(0xdeadbeef); ret = GetCurrencyFormatA(lcid, 0, input, NULL, buffer, COUNTOF(buffer)); - EXPECT_INVALID; EXPECT_LEN(0); EXPECT_EQA; + ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); STRINGSA("--",""); /* Double '-' --> Error */ SetLastError(0xdeadbeef); ret = GetCurrencyFormatA(lcid, 0, input, NULL, buffer, COUNTOF(buffer)); - EXPECT_INVALID; EXPECT_LEN(0); EXPECT_EQA; + ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); STRINGSA("0-",""); /* Trailing '-' --> Error */ SetLastError(0xdeadbeef); ret = GetCurrencyFormatA(lcid, 0, input, NULL, buffer, COUNTOF(buffer)); - EXPECT_INVALID; EXPECT_LEN(0); EXPECT_EQA; + ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); STRINGSA("0..",""); /* Double '.' --> Error */ SetLastError(0xdeadbeef); ret = GetCurrencyFormatA(lcid, 0, input, NULL, buffer, COUNTOF(buffer)); - EXPECT_INVALID; EXPECT_LEN(0); EXPECT_EQA; + ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); STRINGSA(" 0.1",""); /* Leading space --> Error */ SetLastError(0xdeadbeef); ret = GetCurrencyFormatA(lcid, 0, input, NULL, buffer, COUNTOF(buffer)); - EXPECT_INVALID; EXPECT_LEN(0); EXPECT_EQA; + ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); STRINGSA("1234","$"); /* Length too small --> Write up to length chars */ SetLastError(0xdeadbeef); ret = GetCurrencyFormatA(lcid, NUO, input, NULL, buffer, 2); - EXPECT_BUFFER; EXPECT_LEN(0); EXPECT_EQA; + ok( !ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER, + "Expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError()); STRINGSA("2353",""); /* Format and flags given --> Error */ SetLastError(0xdeadbeef); ret = GetCurrencyFormatA(lcid, NUO, input, &format, buffer, COUNTOF(buffer)); - EXPECT_INVALIDFLAGS; EXPECT_LEN(0); EXPECT_EQA; + ok( !ret, "Expected ret == 0, got %d\n", ret); + ok( GetLastError() == ERROR_INVALID_FLAGS || GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_FLAGS, got %d\n", GetLastError()); STRINGSA("2353",""); /* Invalid format --> Error */ SetLastError(0xdeadbeef); ret = GetCurrencyFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_INVALID; EXPECT_LEN(0); EXPECT_EQA; + ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); STRINGSA("2353","$2,353.00"); /* Valid number */ ret = GetCurrencyFormatA(lcid, NUO, input, NULL, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; STRINGSA("-2353","($2,353.00)"); /* Valid negative number */ ret = GetCurrencyFormatA(lcid, NUO, input, NULL, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; STRINGSA("2353.1","$2,353.10"); /* Valid real number */ ret = GetCurrencyFormatA(lcid, NUO, input, NULL, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; STRINGSA("2353.111","$2,353.11"); /* Too many DP --> Truncated */ ret = GetCurrencyFormatA(lcid, NUO, input, NULL, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; STRINGSA("2353.119","$2,353.12"); /* Too many DP --> Rounded */ ret = GetCurrencyFormatA(lcid, NUO, input, NULL, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.NumDigits = 0; /* No decimal separator */ format.LeadingZero = 0; @@ -548,117 +601,140 @@ static void test_GetCurrencyFormatA(void) STRINGSA("2353","$2353"); /* No decimal or grouping chars expected */ ret = GetCurrencyFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.NumDigits = 1; /* 1 DP --> Expect decimal separator */ STRINGSA("2353","$2353.0"); ret = GetCurrencyFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.Grouping = 2; /* Group by 100's */ STRINGSA("2353","$23,53.0"); ret = GetCurrencyFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.LeadingZero = 1; /* Always provide leading zero */ STRINGSA(".5","$0.5"); ret = GetCurrencyFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.PositiveOrder = CY_POS_RIGHT; STRINGSA("1","1.0$"); ret = GetCurrencyFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.PositiveOrder = CY_POS_LEFT_SPACE; STRINGSA("1","$ 1.0"); ret = GetCurrencyFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.PositiveOrder = CY_POS_RIGHT_SPACE; STRINGSA("1","1.0 $"); ret = GetCurrencyFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.NegativeOrder = 0; STRINGSA("-1","($1.0)"); ret = GetCurrencyFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.NegativeOrder = 1; STRINGSA("-1","-$1.0"); ret = GetCurrencyFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.NegativeOrder = 2; STRINGSA("-1","$-1.0"); ret = GetCurrencyFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.NegativeOrder = 3; STRINGSA("-1","$1.0-"); ret = GetCurrencyFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.NegativeOrder = 4; STRINGSA("-1","(1.0$)"); ret = GetCurrencyFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.NegativeOrder = 5; STRINGSA("-1","-1.0$"); ret = GetCurrencyFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.NegativeOrder = 6; STRINGSA("-1","1.0-$"); ret = GetCurrencyFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.NegativeOrder = 7; STRINGSA("-1","1.0$-"); ret = GetCurrencyFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.NegativeOrder = 8; STRINGSA("-1","-1.0 $"); ret = GetCurrencyFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.NegativeOrder = 9; STRINGSA("-1","-$ 1.0"); ret = GetCurrencyFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.NegativeOrder = 10; STRINGSA("-1","1.0 $-"); ret = GetCurrencyFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.NegativeOrder = 11; STRINGSA("-1","$ 1.0-"); ret = GetCurrencyFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.NegativeOrder = 12; STRINGSA("-1","$ -1.0"); ret = GetCurrencyFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.NegativeOrder = 13; STRINGSA("-1","1.0- $"); ret = GetCurrencyFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.NegativeOrder = 14; STRINGSA("-1","($ 1.0)"); ret = GetCurrencyFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.NegativeOrder = 15; STRINGSA("-1","(1.0 $)"); ret = GetCurrencyFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; } #define NEG_PARENS 0 /* "(1.1)" */ @@ -681,71 +757,87 @@ static void test_GetNumberFormatA(void) STRINGSA("23",""); /* NULL output, length > 0 --> Error */ SetLastError(0xdeadbeef); ret = GetNumberFormatA(lcid, 0, input, NULL, NULL, COUNTOF(buffer)); - EXPECT_INVALID; EXPECT_LEN(0); EXPECT_EQA; + ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); STRINGSA("23,53",""); /* Invalid character --> Error */ SetLastError(0xdeadbeef); ret = GetNumberFormatA(lcid, 0, input, NULL, buffer, COUNTOF(buffer)); - EXPECT_INVALID; EXPECT_LEN(0); EXPECT_EQA; + ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); STRINGSA("--",""); /* Double '-' --> Error */ SetLastError(0xdeadbeef); ret = GetNumberFormatA(lcid, 0, input, NULL, buffer, COUNTOF(buffer)); - EXPECT_INVALID; EXPECT_LEN(0); EXPECT_EQA; + ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); STRINGSA("0-",""); /* Trailing '-' --> Error */ SetLastError(0xdeadbeef); ret = GetNumberFormatA(lcid, 0, input, NULL, buffer, COUNTOF(buffer)); - EXPECT_INVALID; EXPECT_LEN(0); EXPECT_EQA; + ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); STRINGSA("0..",""); /* Double '.' --> Error */ SetLastError(0xdeadbeef); ret = GetNumberFormatA(lcid, 0, input, NULL, buffer, COUNTOF(buffer)); - EXPECT_INVALID; EXPECT_LEN(0); EXPECT_EQA; + ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); STRINGSA(" 0.1",""); /* Leading space --> Error */ SetLastError(0xdeadbeef); ret = GetNumberFormatA(lcid, 0, input, NULL, buffer, COUNTOF(buffer)); - EXPECT_INVALID; EXPECT_LEN(0); EXPECT_EQA; + ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); STRINGSA("1234","1"); /* Length too small --> Write up to length chars */ SetLastError(0xdeadbeef); ret = GetNumberFormatA(lcid, NUO, input, NULL, buffer, 2); - EXPECT_BUFFER; EXPECT_LEN(0); EXPECT_EQA; + ok( !ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER, + "Expected ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError()); STRINGSA("2353",""); /* Format and flags given --> Error */ SetLastError(0xdeadbeef); ret = GetNumberFormatA(lcid, NUO, input, &format, buffer, COUNTOF(buffer)); - EXPECT_INVALIDFLAGS; EXPECT_LEN(0); EXPECT_EQA; + ok( !ret, "Expected ret == 0, got %d\n", ret); + ok( GetLastError() == ERROR_INVALID_FLAGS || GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_FLAGS, got %d\n", GetLastError()); STRINGSA("2353",""); /* Invalid format --> Error */ SetLastError(0xdeadbeef); ret = GetNumberFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_INVALID; EXPECT_LEN(0); EXPECT_EQA; + ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); STRINGSA("2353","2,353.00"); /* Valid number */ ret = GetNumberFormatA(lcid, NUO, input, NULL, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; STRINGSA("-2353","-2,353.00"); /* Valid negative number */ ret = GetNumberFormatA(lcid, NUO, input, NULL, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; STRINGSA("-353","-353.00"); /* test for off by one error in grouping */ ret = GetNumberFormatA(lcid, NUO, input, NULL, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; STRINGSA("2353.1","2,353.10"); /* Valid real number */ ret = GetNumberFormatA(lcid, NUO, input, NULL, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; STRINGSA("2353.111","2,353.11"); /* Too many DP --> Truncated */ ret = GetNumberFormatA(lcid, NUO, input, NULL, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; STRINGSA("2353.119","2,353.12"); /* Too many DP --> Rounded */ ret = GetNumberFormatA(lcid, NUO, input, NULL, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.NumDigits = 0; /* No decimal separator */ format.LeadingZero = 0; @@ -756,47 +848,56 @@ static void test_GetNumberFormatA(void) STRINGSA("2353","2353"); /* No decimal or grouping chars expected */ ret = GetNumberFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.NumDigits = 1; /* 1 DP --> Expect decimal separator */ STRINGSA("2353","2353.0"); ret = GetNumberFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.Grouping = 2; /* Group by 100's */ STRINGSA("2353","23,53.0"); ret = GetNumberFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.LeadingZero = 1; /* Always provide leading zero */ STRINGSA(".5","0.5"); ret = GetNumberFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.NegativeOrder = NEG_PARENS; STRINGSA("-1","(1.0)"); ret = GetNumberFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.NegativeOrder = NEG_LEFT; STRINGSA("-1","-1.0"); ret = GetNumberFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.NegativeOrder = NEG_LEFT_SPACE; STRINGSA("-1","- 1.0"); ret = GetNumberFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.NegativeOrder = NEG_RIGHT; STRINGSA("-1","1.0-"); ret = GetNumberFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; format.NegativeOrder = NEG_RIGHT_SPACE; STRINGSA("-1","1.0 -"); ret = GetNumberFormatA(lcid, 0, input, &format, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; lcid = MAKELCID(MAKELANGID(LANG_FRENCH, SUBLANG_DEFAULT), SORT_DEFAULT); @@ -805,7 +906,8 @@ static void test_GetNumberFormatA(void) STRINGSA("-12345","-12 345,00"); /* Try French formatting */ Expected[3] = 160; /* Non breaking space */ ret = GetNumberFormatA(lcid, NUO, input, NULL, buffer, COUNTOF(buffer)); - EXPECT_VALID; EXPECT_LENA; EXPECT_EQA; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); + EXPECT_LENA; EXPECT_EQA; } } @@ -855,14 +957,14 @@ static void test_CompareStringA(void) ok (ret == 0, "lstrcmpA(\"\", \"\") should return 0, got %d\n", ret); ret = lstrcmpA(NULL, NULL); - ok (ret == 0, "lstrcmpA(NULL, NULL) should return 0, got %d\n", ret); + ok (ret == 0 || broken(ret == -2) /* win9x */, "lstrcmpA(NULL, NULL) should return 0, got %d\n", ret); ret = lstrcmpA("", NULL); - ok (ret == 1, "lstrcmpA(\"\", NULL) should return 1, got %d\n", ret); + ok (ret == 1 || broken(ret == -2) /* win9x */, "lstrcmpA(\"\", NULL) should return 1, got %d\n", ret); ret = lstrcmpA(NULL, ""); - ok (ret == -1, "lstrcmpA(NULL, \"\") should return -1, got %d\n", ret); - + ok (ret == -1 || broken(ret == -2) /* win9x */, "lstrcmpA(NULL, \"\") should return -1, got %d\n", ret); + ret = CompareStringA(LOCALE_SYSTEM_DEFAULT,0,"EndDialog",-1,"_Property",-1); ok( ret == 3, "EndDialog vs _Property ... expected 3, got %d\n", ret); @@ -1523,7 +1625,7 @@ static void test_FoldStringA(void) ret = pFoldStringA(MAP_FOLDDIGITS, digits_src, -1, dst, 256); if (GetLastError()==ERROR_CALL_NOT_IMPLEMENTED) return; - EXPECT_LEN(4); EXPECT_VALID; + ok(ret == 4, "Expected ret == 4, got %d, error %d\n", ret, GetLastError()); ok(strcmp(dst, digits_dst) == 0, "MAP_FOLDDIGITS: Expected '%s', got '%s'\n", digits_dst, dst); for (i = 1; i < 256; i++) @@ -1534,7 +1636,7 @@ static void test_FoldStringA(void) src[1] = '\0'; SetLastError(0); ret = pFoldStringA(MAP_FOLDDIGITS, src, -1, dst, 256); - EXPECT_LEN(2); EXPECT_VALID; + ok(ret == 2, "Expected ret == 2, got %d, error %d\n", ret, GetLastError()); ok(dst[0] == src[0], "MAP_FOLDDIGITS: Expected '%s', got '%s'\n", src, dst); } @@ -1545,7 +1647,7 @@ static void test_FoldStringA(void) ret = pFoldStringA(MAP_EXPAND_LIGATURES, ligatures_src, -1, dst, 256); /* NT 4.0 doesn't support MAP_EXPAND_LIGATURES */ if (!(ret == 0 && GetLastError() == ERROR_INVALID_FLAGS)) { - EXPECT_LEN(sizeof(ligatures_dst)); EXPECT_VALID; + ok(ret == sizeof(ligatures_dst), "Got %d, error %d\n", ret, GetLastError()); ok(strcmp(dst, ligatures_dst) == 0, "MAP_EXPAND_LIGATURES: Expected '%s', got '%s'\n", ligatures_dst, dst); for (i = 1; i < 256; i++) @@ -1556,7 +1658,7 @@ static void test_FoldStringA(void) src[1] = '\0'; SetLastError(0); ret = pFoldStringA(MAP_EXPAND_LIGATURES, src, -1, dst, 256); - EXPECT_LEN(2); EXPECT_VALID; + ok(ret == 2, "Expected ret == 2, got %d, error %d\n", ret, GetLastError()); ok(dst[0] == src[0], "MAP_EXPAND_LIGATURES: Expected '%s', got '%s'\n", src, dst); } @@ -1566,11 +1668,11 @@ static void test_FoldStringA(void) /* MAP_COMPOSITE */ SetLastError(0); ret = pFoldStringA(MAP_COMPOSITE, composite_src, -1, dst, 256); - EXPECT_VALID; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); todo_wine { /* Wine gets close, but doesn't produce quite the same result as native */ - EXPECT_LEN(121); + ok(ret == 121, "Expected 121, got %d\n", ret); ok(strcmp(dst, composite_dst) == 0, "MAP_COMPOSITE: Expected '%s', got '%s'\n", composite_dst, dst); } @@ -1583,7 +1685,7 @@ static void test_FoldStringA(void) src[1] = '\0'; SetLastError(0); ret = pFoldStringA(MAP_COMPOSITE, src, -1, dst, 256); - EXPECT_LEN(2); EXPECT_VALID; + ok(ret == 2, "Expected ret == 2, got %d, error %d\n", ret, GetLastError()); ok(dst[0] == src[0], "0x%02x, 0x%02x,0x%02x,0x%02x,\n", (unsigned char)src[0], (unsigned char)dst[0],(unsigned char)dst[1],(unsigned char)dst[2]); @@ -1597,7 +1699,7 @@ static void test_FoldStringA(void) src[1] = '\0'; SetLastError(0); ret = pFoldStringA(MAP_FOLDCZONE, src, -1, dst, 256); - EXPECT_LEN(2); EXPECT_VALID; + ok(ret == 2, "Expected ret == 2, got %d, error %d\n", ret, GetLastError()); ok(src[0] == dst[0], "MAP_FOLDCZONE: Expected 0x%02x, got 0x%02x\n", (unsigned char)src[0], (unsigned char)dst[0]); @@ -1610,7 +1712,7 @@ static void test_FoldStringA(void) src[1] = '\0'; SetLastError(0); ret = pFoldStringA(MAP_PRECOMPOSED, src, -1, dst, 256); - EXPECT_LEN(2); EXPECT_VALID; + ok(ret == 2, "Expected ret == 2, got %d, error %d\n", ret, GetLastError()); ok(src[0] == dst[0], "MAP_PRECOMPOSED: Expected 0x%02x, got 0x%02x\n", (unsigned char)src[0], (unsigned char)dst[0]); @@ -1814,28 +1916,33 @@ static void test_FoldStringW(void) skip("FoldStringW is not implemented\n"); return; } - EXPECT_LEN(0); EXPECT_FLAGS; + ok(!ret && GetLastError() == ERROR_INVALID_FLAGS, + "Expected ERROR_INVALID_FLAGS, got %d\n", GetLastError()); } /* src & dst cannot be the same */ SetLastError(0); ret = pFoldStringW(MAP_FOLDCZONE, src, -1, src, 256); - EXPECT_LEN(0); EXPECT_INVALID; + ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); /* src can't be NULL */ SetLastError(0); ret = pFoldStringW(MAP_FOLDCZONE, NULL, -1, dst, 256); - EXPECT_LEN(0); EXPECT_INVALID; + ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); /* srclen can't be 0 */ SetLastError(0); ret = pFoldStringW(MAP_FOLDCZONE, src, 0, dst, 256); - EXPECT_LEN(0); EXPECT_INVALID; + ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); /* dstlen can't be < 0 */ SetLastError(0); ret = pFoldStringW(MAP_FOLDCZONE, src, -1, dst, -1); - EXPECT_LEN(0); EXPECT_INVALID; + ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); /* Ret includes terminating NUL which is appended if srclen = -1 */ SetLastError(0); @@ -1843,7 +1950,7 @@ static void test_FoldStringW(void) src[1] = '\0'; dst[0] = '\0'; ret = pFoldStringW(MAP_FOLDCZONE, src, -1, dst, 256); - EXPECT_LEN(2); EXPECT_VALID; + ok(ret == 2, "Expected ret == 2, got %d, error %d\n", ret, GetLastError()); ok(dst[0] == 'A' && dst[1] == '\0', "srclen=-1: Expected ret=2 [%d,%d], got ret=%d [%d,%d], err=%d\n", 'A', '\0', ret, dst[0], dst[1], GetLastError()); @@ -1855,7 +1962,7 @@ static void test_FoldStringW(void) dst[0] = 'X'; dst[1] = 'X'; ret = pFoldStringW(MAP_FOLDCZONE, src, 1, dst, 256); - EXPECT_LEN(1); EXPECT_VALID; + ok(ret == 1, "Expected ret == 1, got %d, error %d\n", ret, GetLastError()); ok(dst[0] == 'A' && dst[1] == 'X', "srclen=1: Expected ret=1, [%d,%d], got ret=%d,[%d,%d], err=%d\n", 'A','X', ret, dst[0], dst[1], GetLastError()); @@ -1870,7 +1977,7 @@ static void test_FoldStringW(void) src[0] = ch; src[1] = dst[0] = '\0'; ret = pFoldStringW(MAP_FOLDDIGITS, src, -1, dst, 256); - EXPECT_LEN(2); EXPECT_VALID; + ok(ret == 2, "Expected ret == 2, got %d, error %d\n", ret, GetLastError()); ok(dst[0] == ch || strchrW(outOfSequenceDigits, ch) || /* Wine (correctly) maps all Unicode 4.0+ digits */ @@ -1896,9 +2003,10 @@ static void test_FoldStringW(void) src[0] = c; src[1] = dst[0] = '\0'; ret = pFoldStringW(MAP_FOLDDIGITS, src, -1, dst, 256); - EXPECT_LEN(2); EXPECT_VALID; + ok(ret == 2, "Expected ret == 2, got %d, error %d\n", ret, GetLastError()); ok((dst[0] == '0' + ch - digitRanges[j] && dst[1] == '\0') || + broken( dst[0] == ch ) || /* old Windows versions don't have all mappings */ strchrW(noDigitAvailable, c), "MAP_FOLDDIGITS: ch %d Expected %d got %d\n", ch, '0' + digitRanges[j] - ch, dst[0]); @@ -1925,8 +2033,9 @@ static void test_FoldStringW(void) src[0] = ch; src[1] = dst[0] = '\0'; ret = pFoldStringW(MAP_FOLDCZONE, src, -1, dst, 256); - EXPECT_LEN(2); EXPECT_VALID; + ok(ret == 2, "Expected ret == 2, got %d, error %d\n", ret, GetLastError()); ok(dst[0] == expected || + broken( dst[0] == ch ) || /* old Windows versions don't have all mappings */ /* Wine (correctly) uses updated mappings for some Unicode 4.0 chars */ /* FIXME: But they should be re-checked */ ch == 0xf92c || ch == 0xf979 || ch == 0xf995 || ch == 0xf9e7 || @@ -1951,7 +2060,8 @@ static void test_FoldStringW(void) ret = pFoldStringW(MAP_EXPAND_LIGATURES, ligatures_src, -1, dst, 256); /* NT 4.0 doesn't support MAP_EXPAND_LIGATURES */ if (!(ret == 0 && GetLastError() == ERROR_INVALID_FLAGS)) { - EXPECT_LEN(sizeof(ligatures_dst)/sizeof(ligatures_dst[0])); EXPECT_VALID; + ok(ret == sizeof(ligatures_dst)/sizeof(ligatures_dst[0]), + "Got %d, error %d\n", ret, GetLastError()); ok(!memcmp(dst, ligatures_dst, sizeof(ligatures_dst)), "MAP_EXPAND_LIGATURES: Expanded incorrectly\n"); for (i = 1, failures = 0; i <= 0xffff; i++) @@ -1962,7 +2072,7 @@ static void test_FoldStringW(void) src[1] = '\0'; SetLastError(0); ret = pFoldStringW(MAP_EXPAND_LIGATURES, src, -1, dst, 256); - EXPECT_LEN(2); EXPECT_VALID; + ok(ret == 2, "Expected ret == 2, got %d, error %d\n", ret, GetLastError()); if (ret == 3) ok(0, "MAP_EXPAND_LIGATURES: %04x : Expected %04x, got %04x %04x\n", i, src[0], dst[0], dst[1]); @@ -2058,17 +2168,18 @@ static void test_EnumSystemLanguageGroupsA(void) win_skip("EnumSystemLanguageGroupsA is not implemented\n"); return; } - EXPECT_INVALID; + ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); /* Invalid flags */ SetLastError(0); pEnumSystemLanguageGroupsA(langgrp_procA, LGRPID_INSTALLED|LGRPID_SUPPORTED, 0); - EXPECT_FLAGS; + ok(GetLastError() == ERROR_INVALID_FLAGS, "Expected ERROR_INVALID_FLAGS, got %d\n", GetLastError()); /* No flags - defaults to LGRPID_INSTALLED */ - SetLastError(0); + SetLastError(0xdeadbeef); pEnumSystemLanguageGroupsA(langgrp_procA, 0, 1); - EXPECT_LASTERROR_0; + ok(GetLastError() == 0xdeadbeef, "got error %d\n", GetLastError()); pEnumSystemLanguageGroupsA(langgrp_procA, LGRPID_INSTALLED, 0); pEnumSystemLanguageGroupsA(langgrp_procA, LGRPID_SUPPORTED, 0); @@ -2109,22 +2220,26 @@ static void test_EnumLanguageGroupLocalesA(void) win_skip("EnumLanguageGroupLocalesA is not implemented\n"); return; } - EXPECT_INVALID; + ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); /* lgrpid too small */ SetLastError(0); - pEnumLanguageGroupLocalesA(lgrplocale_procA, 0, 0, 0); - EXPECT_INVALID; + ret = pEnumLanguageGroupLocalesA(lgrplocale_procA, 0, 0, 0); + ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); /* lgrpid too big */ SetLastError(0); - pEnumLanguageGroupLocalesA(lgrplocale_procA, LGRPID_ARMENIAN + 1, 0, 0); - EXPECT_INVALID; + ret = pEnumLanguageGroupLocalesA(lgrplocale_procA, LGRPID_ARMENIAN + 1, 0, 0); + ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); /* dwFlags is reserved */ SetLastError(0); - pEnumLanguageGroupLocalesA(0, LGRPID_WESTERN_EUROPE, 0x1, 0); - EXPECT_INVALID; + ret = pEnumLanguageGroupLocalesA(0, LGRPID_WESTERN_EUROPE, 0x1, 0); + ok( !ret && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); pEnumLanguageGroupLocalesA(lgrplocale_procA, LGRPID_WESTERN_EUROPE, 0, 0); } @@ -2137,17 +2252,20 @@ static void test_SetLocaleInfoA(void) /* Null data */ SetLastError(0); bRet = SetLocaleInfoA(lcid, LOCALE_SDATE, 0); - EXPECT_INVALID; + ok( !bRet && GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); /* IDATE */ SetLastError(0); bRet = SetLocaleInfoA(lcid, LOCALE_IDATE, (LPSTR)test_SetLocaleInfoA); - EXPECT_FLAGS; + ok(!bRet && GetLastError() == ERROR_INVALID_FLAGS, + "Expected ERROR_INVALID_FLAGS, got %d\n", GetLastError()); /* ILDATE */ SetLastError(0); bRet = SetLocaleInfoA(lcid, LOCALE_ILDATE, (LPSTR)test_SetLocaleInfoA); - EXPECT_FLAGS; + ok(!bRet && GetLastError() == ERROR_INVALID_FLAGS, + "Expected ERROR_INVALID_FLAGS, got %d\n", GetLastError()); } static BOOL CALLBACK luilocale_proc1A(LPSTR value, LONG_PTR lParam) @@ -2184,24 +2302,29 @@ static void test_EnumUILanguageA(void) win_skip("EnumUILanguagesA is not implemented\n"); return; } - EXPECT_TRUE; EXPECT_VALID; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); enumCount = 0; SetLastError(ERROR_SUCCESS); ret = pEnumUILanguagesA(luilocale_proc2A, 0, 0); - EXPECT_TRUE; EXPECT_VALID; + ok(ret, "Expected ret != 0, got %d, error %d\n", ret, GetLastError()); SetLastError(ERROR_SUCCESS); ret = pEnumUILanguagesA(NULL, 0, 0); - EXPECT_FALSE; EXPECT_INVALID; + ok(!ret, "Expected return value FALSE, got %u\n", ret); + ok(GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); SetLastError(ERROR_SUCCESS); ret = pEnumUILanguagesA(luilocale_proc3A, 0x5a5a5a5a, 0); - EXPECT_FALSE; EXPECT_FLAGS; + ok(!ret, "Expected return value FALSE, got %u\n", ret); + ok(GetLastError() == ERROR_INVALID_FLAGS, "Expected ERROR_INVALID_FLAGS, got %d\n", GetLastError()); SetLastError(ERROR_SUCCESS); ret = pEnumUILanguagesA(NULL, 0x5a5a5a5a, 0); - EXPECT_FALSE; EXPECT_INVALID; + ok(!ret, "Expected return value FALSE, got %u\n", ret); + ok(GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); } static char date_fmt_buf[1024]; @@ -2294,7 +2417,8 @@ static void test_EnumDateFormatsA(void) if ((p = strchr(date_fmt_buf, '\n'))) *p = 0; ret = GetLocaleInfoA(lcid, LOCALE_SYEARMONTH, buf, sizeof(buf)); ok(ret, "GetLocaleInfoA(LOCALE_SYEARMONTH) error %d\n", GetLastError()); - ok(!lstrcmpA(date_fmt_buf, buf), "expected \"%s\" got \"%s\"\n", date_fmt_buf, buf); + ok(!lstrcmpA(date_fmt_buf, buf) || broken(!buf[0]) /* win9x */, + "expected \"%s\" got \"%s\"\n", date_fmt_buf, buf); } static void test_EnumTimeFormatsA(void) @@ -2366,7 +2490,8 @@ static void test_GetCPInfo(void) ok(cpinfo.DefaultChar[1] == 0, "expected 0, got 0x%x\n", cpinfo.DefaultChar[1]); ok(cpinfo.LeadByte[0] == 0, "expected 0, got 0x%x\n", cpinfo.LeadByte[0]); ok(cpinfo.LeadByte[1] == 0, "expected 0, got 0x%x\n", cpinfo.LeadByte[1]); - ok(cpinfo.MaxCharSize == 4, "expected 4, got 0x%x\n", cpinfo.MaxCharSize); + ok(cpinfo.MaxCharSize == 4 || broken(cpinfo.MaxCharSize == 3) /* win9x */, + "expected 4, got %u\n", cpinfo.MaxCharSize); } } diff --git a/dlls/kernel32/tests/mailslot.c b/dlls/kernel32/tests/mailslot.c index 995f144b1a9..2cea68a40c9 100644 --- a/dlls/kernel32/tests/mailslot.c +++ b/dlls/kernel32/tests/mailslot.c @@ -34,6 +34,7 @@ static int mailslot_test(void) HANDLE hSlot, hSlot2, hWriter, hWriter2; unsigned char buffer[16]; DWORD count, dwMax, dwNext, dwMsgCount, dwTimeout; + BOOL ret; /* sanity check on GetMailslotInfo */ dwMax = dwNext = dwMsgCount = dwTimeout = 0; @@ -54,10 +55,13 @@ static int mailslot_test(void) /* open a mailslot with a null name */ hSlot = CreateMailslot( NULL, 0, 0, NULL ); - ok( hSlot == INVALID_HANDLE_VALUE, - "Created mailslot with invalid name\n"); - ok( GetLastError() == ERROR_PATH_NOT_FOUND, + ok( hSlot == INVALID_HANDLE_VALUE || broken(hSlot != INVALID_HANDLE_VALUE), /* win9x */ + "Created mailslot with invalid name\n"); + if (hSlot == INVALID_HANDLE_VALUE) + ok( GetLastError() == ERROR_PATH_NOT_FOUND, "error should be ERROR_PATH_NOT_FOUND\n"); + else /* succeeds on win9x */ + CloseHandle( hSlot ); /* valid open, but with wacky parameters ... then check them */ hSlot = CreateMailslot( szmspath, -1, -1, NULL ); @@ -80,32 +84,36 @@ static int mailslot_test(void) /* try and read/write to it */ count = 0; memset(buffer, 0, sizeof buffer); - ok( !ReadFile( hSlot, buffer, sizeof buffer, &count, NULL), - "slot read\n"); - ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %u\n", GetLastError() ); + ret = ReadFile( hSlot, buffer, sizeof buffer, &count, NULL); + ok( !ret || broken(ret), /* win9x */ "slot read\n"); + if (!ret) ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %u\n", GetLastError() ); + else ok( count == 0, "wrong count %u\n", count ); ok( !WriteFile( hSlot, buffer, sizeof buffer, &count, NULL), "slot write\n"); ok( GetLastError() == ERROR_ACCESS_DENIED, "wrong error %u\n", GetLastError() ); - /* now try and openthe client, but with the wrong sharing mode */ - hWriter = CreateFile(szmspath, GENERIC_READ|GENERIC_WRITE, + /* now try and open the client, but with the wrong sharing mode */ + hWriter = CreateFile(szmspath, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); - ok( hWriter == INVALID_HANDLE_VALUE, "bad sharing mode\n"); - ok( GetLastError() == ERROR_SHARING_VIOLATION, - "error should be ERROR_SHARING_VIOLATION\n"); + ok( hWriter != INVALID_HANDLE_VALUE /* vista */ || GetLastError() == ERROR_SHARING_VIOLATION, + "error should be ERROR_SHARING_VIOLATION got %p / %u\n", hWriter, GetLastError()); + if (hWriter != INVALID_HANDLE_VALUE) CloseHandle( hWriter ); /* now open the client with the correct sharing mode */ hWriter = CreateFile(szmspath, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL); - ok( hWriter != INVALID_HANDLE_VALUE, "existing mailslot\n"); + if (hWriter == INVALID_HANDLE_VALUE) /* win9x doesn't like GENERIC_READ */ + hWriter = CreateFile(szmspath, GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL); + ok( hWriter != INVALID_HANDLE_VALUE, "existing mailslot err %u\n", GetLastError()); /* * opening a client should make no difference to * whether we can read or write the mailslot */ - ok( !ReadFile( hSlot, buffer, sizeof buffer/2, &count, NULL), - "slot read\n"); - ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %u\n", GetLastError() ); + ret = ReadFile( hSlot, buffer, sizeof buffer/2, &count, NULL); + ok( !ret || broken(ret), /* win9x */ "slot read\n"); + if (!ret) ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %u\n", GetLastError() ); + else ok( count == 0, "wrong count %u\n", count ); ok( !WriteFile( hSlot, buffer, sizeof buffer/2, &count, NULL), "slot write\n"); ok( GetLastError() == ERROR_ACCESS_DENIED, "wrong error %u\n", GetLastError() ); @@ -116,12 +124,14 @@ static int mailslot_test(void) */ ok( !ReadFile( hWriter, buffer, sizeof buffer/2, &count, NULL), "can read client\n"); - todo_wine ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER || GetLastError() == ERROR_ACCESS_DENIED, + "wrong error %u\n", GetLastError() ); ok( WriteFile( hWriter, buffer, sizeof buffer/2, &count, NULL), "can't write client\n"); ok( !ReadFile( hWriter, buffer, sizeof buffer/2, &count, NULL), "can read client\n"); - todo_wine ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER || GetLastError() == ERROR_ACCESS_DENIED, + "wrong error %u\n", GetLastError() ); /* * seeing as there's something in the slot, @@ -132,24 +142,28 @@ static int mailslot_test(void) ok( count == (sizeof buffer/2), "short read\n" ); /* but not again */ - ok( !ReadFile( hSlot, buffer, sizeof buffer, &count, NULL), - "slot read\n"); - ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %u\n", GetLastError() ); + ret = ReadFile( hSlot, buffer, sizeof buffer, &count, NULL); + ok( !ret || broken(ret), /* win9x */ "slot read\n"); + if (!ret) ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %u\n", GetLastError() ); + else ok( count == 0, "wrong count %u\n", count ); /* now try open another writer... should fail */ hWriter2 = CreateFile(szmspath, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL); - ok( hWriter2 == INVALID_HANDLE_VALUE, "two writers\n"); + /* succeeds on vista, don't test */ + if (hWriter2 != INVALID_HANDLE_VALUE) CloseHandle( hWriter2 ); /* now try open another as a reader ... also fails */ hWriter2 = CreateFile(szmspath, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL); - ok( hWriter2 == INVALID_HANDLE_VALUE, "writer + reader\n"); + /* succeeds on vista, don't test */ + if (hWriter2 != INVALID_HANDLE_VALUE) CloseHandle( hWriter2 ); /* now try open another as a writer ... still fails */ hWriter2 = CreateFile(szmspath, GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL); - ok( hWriter2 == INVALID_HANDLE_VALUE, "writer\n"); + /* succeeds on vista, don't test */ + if (hWriter2 != INVALID_HANDLE_VALUE) CloseHandle( hWriter2 ); /* now open another one */ hSlot2 = CreateMailslot( szmspath, 0, 0, NULL ); @@ -172,7 +186,8 @@ static int mailslot_test(void) */ hWriter2 = CreateFile(szmspath, GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL); - ok( hWriter2 == INVALID_HANDLE_VALUE, "greedy writer succeeded\n"); + /* succeeds on vista, don't test */ + if (hWriter2 != INVALID_HANDLE_VALUE) CloseHandle( hWriter2 ); /* now try open another as a writer ... and share with the first */ hWriter2 = CreateFile(szmspath, GENERIC_WRITE, @@ -189,8 +204,10 @@ static int mailslot_test(void) ok( dwTimeout == 0, "dwTimeout incorrect\n"); /* check there's still no data */ - ok( !ReadFile( hSlot, buffer, sizeof buffer, &count, NULL), "slot read\n"); - ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %u\n", GetLastError() ); + ret = ReadFile( hSlot, buffer, sizeof buffer, &count, NULL); + ok( !ret || broken(ret), /* win9x */ "slot read\n"); + if (!ret) ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %u\n", GetLastError() ); + else ok( count == 0, "wrong count %u\n", count ); /* write two messages */ buffer[0] = 'a'; @@ -224,9 +241,9 @@ static int mailslot_test(void) ok( GetMailslotInfo( hSlot, NULL, &dwNext, &dwMsgCount, NULL ), "getmailslotinfo failed\n"); ok( dwNext == 1, "dwNext incorrect\n"); - todo_wine { - ok( dwMsgCount == 3, "dwMsgCount incorrect\n"); - } + todo_wine + ok( dwMsgCount == 3 || broken(dwMsgCount == 2), /* win9x */ + "dwMsgCount incorrect %u\n", dwMsgCount); buffer[0]=buffer[1]=0; @@ -245,7 +262,8 @@ static int mailslot_test(void) "getmailslotinfo failed\n"); ok( dwNext == 2, "dwNext incorrect\n"); todo_wine { - ok( dwMsgCount == 2, "dwMsgCount incorrect\n"); + ok( dwMsgCount == 2 || broken(dwMsgCount == 1), /* win9x */ + "dwMsgCount incorrect %u\n", dwMsgCount); } /* read the second message */ @@ -258,9 +276,10 @@ static int mailslot_test(void) dwNext = dwMsgCount = 0; ok( GetMailslotInfo( hSlot, NULL, &dwNext, &dwMsgCount, NULL ), "getmailslotinfo failed\n"); - ok( dwNext == 0, "dwNext incorrect\n"); + ok( dwNext == 0 || broken(dwNext == ~0u), /* win9x */ "dwNext incorrect %u\n", dwNext); todo_wine { - ok( dwMsgCount == 1, "dwMsgCount incorrect\n"); + ok( dwMsgCount == 1 || broken(dwMsgCount == 0), /* win9x */ + "dwMsgCount incorrect %u\n", dwMsgCount); } /* read the 3rd (zero length) message */ @@ -281,9 +300,10 @@ static int mailslot_test(void) ok( dwMsgCount == 0, "dwMsgCount incorrect\n"); /* check that reads fail */ - ok( !ReadFile( hSlot, buffer, sizeof buffer, &count, NULL), - "3rd slot read succeeded\n"); - ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %u\n", GetLastError() ); + ret = ReadFile( hSlot, buffer, sizeof buffer, &count, NULL); + ok( !ret || broken(ret), /* win9x */ "3rd slot read succeeded\n"); + if (!ret) ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %u\n", GetLastError() ); + else ok( count == 0, "wrong count %u\n", count ); /* finally close the mailslot and its client */ ok( CloseHandle( hWriter2 ), "closing 2nd client\n"); @@ -297,7 +317,8 @@ static int mailslot_test(void) memset(buffer, 0, sizeof buffer); dwTimeout = GetTickCount(); ok( !ReadFile( hSlot, buffer, sizeof buffer, &count, NULL), "slot read\n"); - ok( GetLastError() == ERROR_SEM_TIMEOUT, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_SEM_TIMEOUT || broken(GetLastError() == ERROR_ACCESS_DENIED), /* win9x */ + "wrong error %u\n", GetLastError() ); dwTimeout = GetTickCount() - dwTimeout; ok( dwTimeout >= 990, "timeout too short %u\n", dwTimeout ); ok( CloseHandle( hSlot ), "closing the mailslot\n"); diff --git a/dlls/kernel32/tests/pipe.c b/dlls/kernel32/tests/pipe.c index e6a57bf0821..a68a8134b68 100644 --- a/dlls/kernel32/tests/pipe.c +++ b/dlls/kernel32/tests/pipe.c @@ -955,10 +955,7 @@ static void test_ImpersonateNamedPipeClient(HANDLE hClientToken, DWORD security_ SetLastError(0xdeadbeef); ret = ImpersonateNamedPipeClient(hPipeServer); error = GetLastError(); - todo_wine - ok(!ret && - (error == ERROR_CANNOT_IMPERSONATE || - error == 0xdeadbeef), /* win2k3 */ + ok(ret /* win2k3 */ || (error == ERROR_CANNOT_IMPERSONATE), "ImpersonateNamedPipeClient should have failed with ERROR_CANNOT_IMPERSONATE instead of %d\n", GetLastError()); ret = ConnectNamedPipe(hPipeServer, NULL); diff --git a/dlls/kernel32/tests/process.c b/dlls/kernel32/tests/process.c index 40b8cafdc7c..a01d91baa6b 100644 --- a/dlls/kernel32/tests/process.c +++ b/dlls/kernel32/tests/process.c @@ -501,7 +501,7 @@ static void test_Startup(void) PROCESS_INFORMATION info; STARTUPINFOA startup,si; static CHAR title[] = "I'm the title string", - desktop[] = "I'm the desktop string", + desktop[] = "winsta0\\default", empty[] = ""; /* let's start simplistic */ @@ -854,9 +854,9 @@ static void test_CommandLine(void) assert ( lpFilePart != 0); *(lpFilePart -1 ) = 0; p = strrchr(fullpath, '\\'); - assert (p); /* Use exename to avoid buffer containing things like 'C:' */ - sprintf(buffer, "..%s/%s tests/process.c %s \"a\\\"b\\\\\" c\\\" d", p, exename, resfile); + if (p) sprintf(buffer, "..%s/%s tests/process.c %s \"a\\\"b\\\\\" c\\\" d", p, exename, resfile); + else sprintf(buffer, "./%s tests/process.c %s \"a\\\"b\\\\\" c\\\" d", exename, resfile); SetLastError(0xdeadbeef); ret = CreateProcessA(NULL, buffer, NULL, NULL, FALSE, 0L, NULL, NULL, &startup, &info); ok(ret, "CreateProcess (%s) failed : %d\n", buffer, GetLastError()); @@ -864,7 +864,8 @@ static void test_CommandLine(void) ok(WaitForSingleObject(info.hProcess, 30000) == WAIT_OBJECT_0, "Child process termination\n"); /* child process has changed result file, so let profile functions know about it */ WritePrivateProfileStringA(NULL, NULL, NULL, resfile); - sprintf(buffer, "..%s/%s", p, exename); + if (p) sprintf(buffer, "..%s/%s", p, exename); + else sprintf(buffer, "./%s", exename); okChildString("Arguments", "argvA0", buffer); release_memory(); assert(DeleteFileA(resfile) != 0); @@ -875,9 +876,9 @@ static void test_CommandLine(void) assert ( lpFilePart != 0); *(lpFilePart -1 ) = 0; p = strrchr(fullpath, '\\'); - assert (p); /* Use exename to avoid buffer containing things like 'C:' */ - sprintf(buffer, "..%s/%s", p, exename); + if (p) sprintf(buffer, "..%s/%s", p, exename); + else sprintf(buffer, "./%s", exename); sprintf(buffer2, "dummy tests/process.c %s \"a\\\"b\\\\\" c\\\" d", resfile); SetLastError(0xdeadbeef); ret = CreateProcessA(buffer, buffer2, NULL, NULL, FALSE, 0L, NULL, NULL, &startup, &info); diff --git a/dlls/kernel32/tests/sync.c b/dlls/kernel32/tests/sync.c index ade9b74d04a..9f811bca9de 100644 --- a/dlls/kernel32/tests/sync.c +++ b/dlls/kernel32/tests/sync.c @@ -658,8 +658,7 @@ static void test_timer_queue(void) SetLastError(0xdeadbeef); ret = pDeleteTimerQueueEx(q, NULL); - ok(!ret, "DeleteTimerQueueEx call was expected to fail\n"); - ok(GetLastError() == ERROR_IO_PENDING, + ok(ret /* vista */ || GetLastError() == ERROR_IO_PENDING, "DeleteTimerQueueEx, GetLastError: expected ERROR_IO_PENDING, got %d\n", GetLastError()); @@ -771,8 +770,7 @@ static void test_timer_queue(void) even if the timer is finished. */ SetLastError(0xdeadbeef); ret = pDeleteTimerQueueTimer(q, t1, NULL); - ok(!ret, "DeleteTimerQueueTimer call was expected to fail\n"); - ok(GetLastError() == ERROR_IO_PENDING, + ok(ret /* vista */ || GetLastError() == ERROR_IO_PENDING, "DeleteTimerQueueTimer, GetLastError: expected ERROR_IO_PENDING, got %d\n", GetLastError()); @@ -803,8 +801,7 @@ static void test_timer_queue(void) SetLastError(0xdeadbeef); ret = pDeleteTimerQueueEx(q, e); - ok(!ret, "DeleteTimerQueueEx call was expected to fail\n"); - ok(GetLastError() == ERROR_IO_PENDING, + ok(ret /* vista */ || GetLastError() == ERROR_IO_PENDING, "DeleteTimerQueueEx, GetLastError: expected ERROR_IO_PENDING, got %d\n", GetLastError()); ok(WaitForSingleObject(e, 250) == WAIT_OBJECT_0, @@ -854,7 +851,7 @@ static void test_timer_queue(void) ok(ret, "CreateTimerQueueTimer\n"); ok(t4 != NULL, "CreateTimerQueueTimer\n"); - Sleep(200); + Sleep(500); ret = pDeleteTimerQueueEx(q, INVALID_HANDLE_VALUE); ok(ret, "DeleteTimerQueueEx\n"); @@ -881,8 +878,7 @@ static void test_timer_queue(void) SetLastError(0xdeadbeef); ret = pDeleteTimerQueueEx(q, NULL); - ok(!ret, "DeleteTimerQueueEx call was expected to fail\n"); - ok(GetLastError() == ERROR_IO_PENDING, + ok(ret /* vista */ || GetLastError() == ERROR_IO_PENDING, "DeleteTimerQueueEx, GetLastError: expected ERROR_IO_PENDING, got %d\n", GetLastError()); ok(d1.num_calls == 1, "DeleteTimerQueueTimer\n"); @@ -941,8 +937,7 @@ static void test_timer_queue(void) SetLastError(0xdeadbeef); ret = pDeleteTimerQueueEx(q, NULL); - ok(!ret, "DeleteTimerQueueEx call was expected to fail\n"); - ok(GetLastError() == ERROR_IO_PENDING, + ok(ret /* vista */ || GetLastError() == ERROR_IO_PENDING, "DeleteTimerQueueEx, GetLastError: expected ERROR_IO_PENDING, got %d\n", GetLastError()); } diff --git a/dlls/kernel32/tests/virtual.c b/dlls/kernel32/tests/virtual.c index b6a545b1eac..33023066f5b 100644 --- a/dlls/kernel32/tests/virtual.c +++ b/dlls/kernel32/tests/virtual.c @@ -754,7 +754,8 @@ static void test_write_watch(void) size = 0x10000; base = VirtualAlloc( 0, size, MEM_RESERVE | MEM_COMMIT | MEM_WRITE_WATCH, PAGE_READWRITE ); - if (!base && GetLastError() == ERROR_INVALID_PARAMETER) + if (!base && + (GetLastError() == ERROR_INVALID_PARAMETER || GetLastError() == ERROR_NOT_SUPPORTED)) { todo_wine win_skip( "MEM_WRITE_WATCH not supported\n" ); return; @@ -770,13 +771,24 @@ static void test_write_watch(void) ok( info.Type == MEM_PRIVATE, "wrong Type 0x%x\n", info.Type ); count = 64; + SetLastError( 0xdeadbeef ); ret = pGetWriteWatch( 0, NULL, size, results, &count, &pagesize ); ok( ret == ~0u, "GetWriteWatch succeeded %u\n", ret ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ok( GetLastError() == ERROR_INVALID_PARAMETER || + broken( GetLastError() == 0xdeadbeef ), /* win98 */ + "wrong error %u\n", GetLastError() ); + SetLastError( 0xdeadbeef ); ret = pGetWriteWatch( 0, GetModuleHandle(0), size, results, &count, &pagesize ); - ok( ret == ~0u, "GetWriteWatch succeeded %u\n", ret ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + if (ret) + { + ok( ret == ~0u, "GetWriteWatch succeeded %u\n", ret ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + } + else /* win98 */ + { + ok( count == 0, "wrong count %lu\n", count ); + } ret = pGetWriteWatch( 0, base, size, results, &count, &pagesize ); ok( !ret, "GetWriteWatch failed %u\n", GetLastError() ); @@ -882,47 +894,97 @@ static void test_write_watch(void) /* some invalid parameter tests */ + SetLastError( 0xdeadbeef ); count = 0; ret = pGetWriteWatch( 0, base, size, results, &count, &pagesize ); - ok( ret == ~0u, "GetWriteWatch failed %u\n", ret ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); - - ret = pGetWriteWatch( 0, base, size, results, NULL, &pagesize ); - ok( ret == ~0u, "GetWriteWatch failed %u\n", ret ); - ok( GetLastError() == ERROR_NOACCESS, "wrong error %u\n", GetLastError() ); - - count = 64; - ret = pGetWriteWatch( 0, base, size, results, &count, NULL ); - ok( ret == ~0u, "GetWriteWatch failed %u\n", ret ); - ok( GetLastError() == ERROR_NOACCESS, "wrong error %u\n", GetLastError() ); - - count = 64; - ret = pGetWriteWatch( 0, base, size, NULL, &count, &pagesize ); - ok( ret == ~0u, "GetWriteWatch failed %u\n", ret ); - ok( GetLastError() == ERROR_NOACCESS, "wrong error %u\n", GetLastError() ); + if (ret) + { + ok( ret == ~0u, "GetWriteWatch succeeded %u\n", ret ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + + SetLastError( 0xdeadbeef ); + ret = pGetWriteWatch( 0, base, size, results, NULL, &pagesize ); + ok( ret == ~0u, "GetWriteWatch succeeded %u\n", ret ); + ok( GetLastError() == ERROR_NOACCESS, "wrong error %u\n", GetLastError() ); + + SetLastError( 0xdeadbeef ); + count = 64; + ret = pGetWriteWatch( 0, base, size, results, &count, NULL ); + ok( ret == ~0u, "GetWriteWatch succeeded %u\n", ret ); + ok( GetLastError() == ERROR_NOACCESS, "wrong error %u\n", GetLastError() ); + + SetLastError( 0xdeadbeef ); + count = 64; + ret = pGetWriteWatch( 0, base, size, NULL, &count, &pagesize ); + ok( ret == ~0u, "GetWriteWatch succeeded %u\n", ret ); + ok( GetLastError() == ERROR_NOACCESS, "wrong error %u\n", GetLastError() ); + + SetLastError( 0xdeadbeef ); + count = 0; + ret = pGetWriteWatch( 0, base, size, NULL, &count, &pagesize ); + ok( ret == ~0u, "GetWriteWatch succeeded %u\n", ret ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + + SetLastError( 0xdeadbeef ); + count = 64; + ret = pGetWriteWatch( 0xdeadbeef, base, size, results, &count, &pagesize ); + ok( ret == ~0u, "GetWriteWatch succeeded %u\n", ret ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + + SetLastError( 0xdeadbeef ); + count = 64; + ret = pGetWriteWatch( 0, base, 0, results, &count, &pagesize ); + ok( ret == ~0u, "GetWriteWatch succeeded %u\n", ret ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + + SetLastError( 0xdeadbeef ); + count = 64; + ret = pGetWriteWatch( 0, base, size * 2, results, &count, &pagesize ); + ok( ret == ~0u, "GetWriteWatch succeeded %u\n", ret ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + + SetLastError( 0xdeadbeef ); + count = 64; + ret = pGetWriteWatch( 0, base + size - pagesize, pagesize + 1, results, &count, &pagesize ); + ok( ret == ~0u, "GetWriteWatch succeeded %u\n", ret ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + + SetLastError( 0xdeadbeef ); + ret = pResetWriteWatch( base, 0 ); + ok( ret == ~0u, "ResetWriteWatch succeeded %u\n", ret ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + + SetLastError( 0xdeadbeef ); + ret = pResetWriteWatch( GetModuleHandle(0), size ); + ok( ret == ~0u, "ResetWriteWatch succeeded %u\n", ret ); + ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + } + else /* win98 is completely different */ + { + SetLastError( 0xdeadbeef ); + count = 64; + ret = pGetWriteWatch( 0, base, size, NULL, &count, &pagesize ); + ok( ret == ERROR_INVALID_PARAMETER, "GetWriteWatch succeeded %u\n", ret ); + ok( GetLastError() == 0xdeadbeef, "wrong error %u\n", GetLastError() ); - count = 0; - ret = pGetWriteWatch( 0, base, size, NULL, &count, &pagesize ); - ok( ret == ~0u, "GetWriteWatch failed %u\n", ret ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + count = 0; + ret = pGetWriteWatch( 0, base, size, NULL, &count, &pagesize ); + ok( !ret, "GetWriteWatch failed %u\n", ret ); - count = 64; - ret = pGetWriteWatch( 0xdeadbeef, base, size, results, &count, &pagesize ); - ok( ret == ~0u, "GetWriteWatch failed %u\n", ret ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + count = 64; + ret = pGetWriteWatch( 0xdeadbeef, base, size, results, &count, &pagesize ); + ok( !ret, "GetWriteWatch failed %u\n", ret ); - count = 64; - ret = pGetWriteWatch( 0, base, 0, results, &count, &pagesize ); - ok( ret == ~0u, "GetWriteWatch failed %u\n", ret ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + count = 64; + ret = pGetWriteWatch( 0, base, 0, results, &count, &pagesize ); + ok( !ret, "GetWriteWatch failed %u\n", ret ); - ret = pResetWriteWatch( base, 0 ); - ok( ret == ~0u, "ResetWriteWatch failed %u\n", ret ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ret = pResetWriteWatch( base, 0 ); + ok( !ret, "ResetWriteWatch failed %u\n", ret ); - ret = pResetWriteWatch( GetModuleHandle(0), size ); - ok( ret == ~0u, "ResetWriteWatch failed %u\n", ret ); - ok( GetLastError() == ERROR_INVALID_PARAMETER, "wrong error %u\n", GetLastError() ); + ret = pResetWriteWatch( GetModuleHandle(0), size ); + ok( !ret, "ResetWriteWatch failed %u\n", ret ); + } VirtualFree( base, 0, MEM_FREE ); @@ -968,8 +1030,9 @@ static void test_write_watch(void) count = 64; ret = pGetWriteWatch( 0, base, size, results, &count, &pagesize ); ok( !ret, "GetWriteWatch failed %u\n", GetLastError() ); - ok( count == 1, "wrong count %lu\n", count ); - ok( results[0] == base + 5*pagesize, "wrong result %p\n", results[0] ); + ok( count == 1 || broken(count == 0), /* win98 */ + "wrong count %lu\n", count ); + if (count) ok( results[0] == base + 5*pagesize, "wrong result %p\n", results[0] ); VirtualFree( base, 0, MEM_FREE ); } diff --git a/dlls/mlang/mlang.c b/dlls/mlang/mlang.c index ae85f6ed711..b92bb7bee07 100644 --- a/dlls/mlang/mlang.c +++ b/dlls/mlang/mlang.c @@ -999,7 +999,6 @@ HRESULT WINAPI ConvertINetUnicodeToMultiByte( if (pDstStr) { - size = min(size, destsz); size = ConvertJapaneseUnicodeToJIS(pSrcStr, *pcSrcSize, pDstStr, destsz); if (!size) @@ -1016,7 +1015,6 @@ HRESULT WINAPI ConvertINetUnicodeToMultiByte( if (pDstStr) { - size = min(size, destsz); size = WideCharToMultiByte(dwEncoding, 0, pSrcStr, *pcSrcSize, pDstStr, destsz, NULL, NULL); if (!size) @@ -2772,8 +2770,42 @@ static HRESULT WINAPI fnIMultiLanguage2_ConvertStringInIStream( IStream* pstmIn, IStream* pstmOut) { - FIXME("\n"); - return E_NOTIMPL; + char *src, *dst = NULL; + INT srclen, dstlen; + STATSTG stat; + HRESULT hr; + + TRACE("%p %0x8 %s %u %u %p %p\n", + pdwMode, dwFlag, debugstr_w(lpFallBack), dwSrcEncoding, dwDstEncoding, pstmIn, pstmOut); + + FIXME("dwFlag and lpFallBack not handled\n"); + + hr = IStream_Stat(pstmIn, &stat, STATFLAG_NONAME); + if (FAILED(hr)) return hr; + + if (stat.cbSize.QuadPart > MAXLONG) return E_INVALIDARG; + if (!(src = HeapAlloc(GetProcessHeap(), 0, stat.cbSize.QuadPart))) return E_OUTOFMEMORY; + + hr = IStream_Read(pstmIn, src, stat.cbSize.QuadPart, (ULONG *)&srclen); + if (FAILED(hr)) goto exit; + + hr = ConvertINetString(pdwMode, dwSrcEncoding, dwDstEncoding, src, &srclen, NULL, &dstlen); + if (FAILED(hr)) goto exit; + + if (!(dst = HeapAlloc(GetProcessHeap(), 0, dstlen))) + { + hr = E_OUTOFMEMORY; + goto exit; + } + hr = ConvertINetString(pdwMode, dwSrcEncoding, dwDstEncoding, src, &srclen, dst, &dstlen); + if (FAILED(hr)) goto exit; + + hr = IStream_Write(pstmOut, dst, dstlen, NULL); + +exit: + HeapFree(GetProcessHeap(), 0, src); + HeapFree(GetProcessHeap(), 0, dst); + return hr; } /* diff --git a/dlls/mshtml/htmlcurstyle.c b/dlls/mshtml/htmlcurstyle.c index 414ac7897de..f6a3a6a197f 100644 --- a/dlls/mshtml/htmlcurstyle.c +++ b/dlls/mshtml/htmlcurstyle.c @@ -99,24 +99,21 @@ static ULONG WINAPI HTMLCurrentStyle_Release(IHTMLCurrentStyle *iface) static HRESULT WINAPI HTMLCurrentStyle_GetTypeInfoCount(IHTMLCurrentStyle *iface, UINT *pctinfo) { HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface); - FIXME("(%p)\n", This); - return E_NOTIMPL; + return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->dispex), pctinfo); } static HRESULT WINAPI HTMLCurrentStyle_GetTypeInfo(IHTMLCurrentStyle *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) { HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface); - FIXME("(%p)\n", This); - return E_NOTIMPL; + return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->dispex), iTInfo, lcid, ppTInfo); } static HRESULT WINAPI HTMLCurrentStyle_GetIDsOfNames(IHTMLCurrentStyle *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId) { HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface); - FIXME("(%p)\n", This); - return E_NOTIMPL; + return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->dispex), riid, rgszNames, cNames, lcid, rgDispId); } static HRESULT WINAPI HTMLCurrentStyle_Invoke(IHTMLCurrentStyle *iface, DISPID dispIdMember, @@ -124,8 +121,8 @@ static HRESULT WINAPI HTMLCurrentStyle_Invoke(IHTMLCurrentStyle *iface, DISPID d VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) { HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface); - FIXME("(%p)\n", This); - return E_NOTIMPL; + return IDispatchEx_Invoke(DISPATCHEX(&This->dispex), dispIdMember, riid, lcid, + wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr); } static HRESULT WINAPI HTMLCurrentStyle_get_position(IHTMLCurrentStyle *iface, BSTR *p) diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 07d2fc60b10..0d9a0a85943 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -338,8 +338,33 @@ static HRESULT WINAPI HTMLDocument_get_activeElement(IHTMLDocument2 *iface, IHTM static HRESULT WINAPI HTMLDocument_get_images(IHTMLDocument2 *iface, IHTMLElementCollection **p) { HTMLDocument *This = HTMLDOC_THIS(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + nsIDOMHTMLCollection *nscoll = NULL; + nsresult nsres; + + TRACE("(%p)->(%p)\n", This, p); + + if(!p) + return E_INVALIDARG; + + *p = NULL; + + if(!This->nsdoc) { + WARN("NULL nsdoc\n"); + return E_UNEXPECTED; + } + + nsres = nsIDOMHTMLDocument_GetImages(This->nsdoc, &nscoll); + if(NS_FAILED(nsres)) { + ERR("GetImages failed: %08x\n", nsres); + return E_FAIL; + } + + if(nscoll) { + *p = create_collection_from_htmlcol(This, (IUnknown*)HTMLDOC(This), nscoll); + nsIDOMElement_Release(nscoll); + } + + return S_OK; } static HRESULT WINAPI HTMLDocument_get_applets(IHTMLDocument2 *iface, IHTMLElementCollection **p) diff --git a/dlls/mshtml/htmlstyle.c b/dlls/mshtml/htmlstyle.c index b11c8c227a6..b88437d6c2a 100644 --- a/dlls/mshtml/htmlstyle.c +++ b/dlls/mshtml/htmlstyle.c @@ -1845,15 +1845,22 @@ static HRESULT WINAPI HTMLStyle_get_pixelHeight(IHTMLStyle *iface, long *p) static HRESULT WINAPI HTMLStyle_put_posTop(IHTMLStyle *iface, float v) { HTMLStyle *This = HTMLSTYLE_THIS(iface); - FIXME("(%p)->()\n", This); - return E_NOTIMPL; + + TRACE("(%p)->(%f)\n", This, v); + + return set_style_pos(This, STYLEID_TOP, v); } static HRESULT WINAPI HTMLStyle_get_posTop(IHTMLStyle *iface, float *p) { HTMLStyle *This = HTMLSTYLE_THIS(iface); - FIXME("(%p)->()\n", This); - return E_NOTIMPL; + + TRACE("(%p)->(%p)\n", This, p); + + if(!p) + return E_POINTER; + + return get_nsstyle_pos(This, STYLEID_TOP, p); } static HRESULT WINAPI HTMLStyle_put_posLeft(IHTMLStyle *iface, float v) diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c index e9d138f2538..36d4f2a8071 100644 --- a/dlls/mshtml/tests/dom.c +++ b/dlls/mshtml/tests/dom.c @@ -1184,6 +1184,7 @@ static void _test_elem3_get_disabled(unsigned line, IUnknown *unk, VARIANT_BOOL VARIANT_BOOL disabled = 100; HRESULT hres; + if (!elem3) return; hres = IHTMLElement3_get_disabled(elem3, &disabled); ok_(__FILE__,line) (hres == S_OK, "get_disabled failed: %08x\n", hres); ok_(__FILE__,line) (disabled == exb, "disabled=%x, expected %x\n", disabled, exb); @@ -1196,6 +1197,7 @@ static void _test_elem3_set_disabled(unsigned line, IUnknown *unk, VARIANT_BOOL IHTMLElement3 *elem3 = _get_elem3_iface(line, unk); HRESULT hres; + if (!elem3) return; hres = IHTMLElement3_put_disabled(elem3, b); ok_(__FILE__,line) (hres == S_OK, "get_disabled failed: %08x\n", hres); @@ -2443,6 +2445,22 @@ static void test_default_style(IHTMLStyle *style) ok(!V_BSTR(&v), "V_BSTR(v) != NULL\n"); VariantClear(&v); + /* Test posTop */ + hres = IHTMLStyle_get_posTop(style, NULL); + ok(hres == E_POINTER, "get_left failed: %08x\n", hres); + + f = 1.0f; + hres = IHTMLStyle_get_posTop(style, &f); + ok(hres == S_OK, "get_left failed: %08x\n", hres); + ok(f == 0.0, "expected 0.0 got %f\n", f); + + hres = IHTMLStyle_put_posTop(style, 4.9f); + ok(hres == S_OK, "get_left failed: %08x\n", hres); + + hres = IHTMLStyle_get_posTop(style, &f); + ok(hres == S_OK, "get_left failed: %08x\n", hres); + ok(f == 4.0, "expected 4.0 got %f\n", f); + V_VT(&v) = VT_BSTR; V_BSTR(&v) = a2bstr("3px"); hres = IHTMLStyle_put_top(style, v); @@ -2456,6 +2474,10 @@ static void test_default_style(IHTMLStyle *style) ok(!strcmp_wa(V_BSTR(&v), "3px"), "V_BSTR(v) = %s\n", dbgstr_w(V_BSTR(&v))); VariantClear(&v); + hres = IHTMLStyle_get_posTop(style, &f); + ok(hres == S_OK, "get_left failed: %08x\n", hres); + ok(f == 3.0, "expected 3.0 got %f\n", f); + V_VT(&v) = VT_NULL; hres = IHTMLStyle_put_top(style, v); ok(hres == S_OK, "put_top failed: %08x\n", hres); @@ -2743,10 +2765,22 @@ static void test_defaults(IHTMLDocument2 *doc) IHTMLStyle *style; long l; HRESULT hres; + IHTMLElementCollection *colimages; hres = IHTMLDocument2_get_body(doc, &elem); ok(hres == S_OK, "get_body failed: %08x\n", hres); + hres = IHTMLDocument2_get_images(doc, NULL); + ok(hres == E_INVALIDARG, "hres %08x\n", hres); + + hres = IHTMLDocument2_get_images(doc, &colimages); + ok(hres == S_OK, "get_images failed: %08x\n", hres); + if(hres == S_OK) + { + test_elem_collection((IUnknown*)colimages, NULL, 0); + IHTMLElementCollection_Release(colimages); + } + hres = IHTMLElement_QueryInterface(elem, &IID_IHTMLBodyElement, (void**)&body); ok(hres == S_OK, "Could not get IHTMBodyElement: %08x\n", hres); test_default_body(body); @@ -2881,6 +2915,7 @@ static void test_iframe_elem(IHTMLElement *elem) hres = IHTMLElement_QueryInterface(elem, &IID_IHTMLFrameBase2, (void**)&base2); ok(hres == S_OK, "Could not get IHTMFrameBase2 iface: %08x\n", hres); + if (!base2) return; content_window = NULL; hres = IHTMLFrameBase2_get_contentWindow(base2, &content_window); @@ -3026,6 +3061,7 @@ static void test_elems(IHTMLDocument2 *doc) IDispatch *disp; long type; HRESULT hres; + IHTMLElementCollection *colimages; static const WCHAR imgidW[] = {'i','m','g','i','d',0}; static const WCHAR inW[] = {'i','n',0}; @@ -3074,6 +3110,16 @@ static void test_elems(IHTMLDocument2 *doc) test_elem_col_item(col, xW, item_types, sizeof(item_types)/sizeof(item_types[0])); IHTMLElementCollection_Release(col); + hres = IHTMLDocument2_get_images(doc, &colimages); + ok(hres == S_OK, "get_images failed: %08x\n", hres); + if(hres == S_OK) + { + static const elem_type_t images_types[] = {ET_IMG}; + test_elem_collection((IUnknown*)colimages, images_types, 1); + + IHTMLElementCollection_Release(colimages); + } + elem = get_doc_elem(doc); ok(hres == S_OK, "get_documentElement failed: %08x\n", hres); hres = IHTMLElement_get_all(elem, &disp); @@ -3112,12 +3158,15 @@ static void test_elems(IHTMLDocument2 *doc) node = test_node_get_parent((IUnknown*)node2); IHTMLDOMNode_Release(node2); ok(node != NULL, "node == NULL\n"); - test_node_name((IUnknown*)node, "#document"); - type = get_node_type((IUnknown*)node); - ok(type == 9, "type=%ld, expected 9\n", type); - node2 = test_node_get_parent((IUnknown*)node); - IHTMLDOMNode_Release(node); - ok(node2 == NULL, "node != NULL\n"); + if (node) + { + test_node_name((IUnknown*)node, "#document"); + type = get_node_type((IUnknown*)node); + ok(type == 9, "type=%ld, expected 9\n", type); + node2 = test_node_get_parent((IUnknown*)node); + IHTMLDOMNode_Release(node); + ok(node2 == NULL, "node != NULL\n"); + } elem2 = test_elem_get_parent((IUnknown*)elem); ok(elem2 != NULL, "elem2 == NULL\n"); diff --git a/dlls/mshtml/tests/htmldoc.c b/dlls/mshtml/tests/htmldoc.c index a8f1e30732c..6b77e5b26c7 100644 --- a/dlls/mshtml/tests/htmldoc.c +++ b/dlls/mshtml/tests/htmldoc.c @@ -3746,27 +3746,27 @@ static void test_QueryInterface(IUnknown *unk) qi = (void*)0xdeadbeef; hres = IUnknown_QueryInterface(unk, &IID_IRunnableObject, (void**)&qi); ok(hres == E_NOINTERFACE, "QueryInterface returned %08x, expected E_NOINTERFACE\n", hres); - ok(qi == NULL, "qirunnable=%p, ezpected NULL\n", qi); + ok(qi == NULL, "qirunnable=%p, expected NULL\n", qi); qi = (void*)0xdeadbeef; hres = IUnknown_QueryInterface(unk, &IID_IHTMLDOMNode, (void**)&qi); ok(hres == E_NOINTERFACE, "QueryInterface returned %08x, expected E_NOINTERFACE\n", hres); - ok(qi == NULL, "qi=%p, ezpected NULL\n", qi); + ok(qi == NULL, "qi=%p, expected NULL\n", qi); qi = (void*)0xdeadbeef; hres = IUnknown_QueryInterface(unk, &IID_IHTMLDOMNode2, (void**)&qi); ok(hres == E_NOINTERFACE, "QueryInterface returned %08x, expected E_NOINTERFACE\n", hres); - ok(qi == NULL, "qi=%p, ezpected NULL\n", qi); + ok(qi == NULL, "qi=%p, expected NULL\n", qi); qi = (void*)0xdeadbeef; hres = IUnknown_QueryInterface(unk, &IID_IPersistPropertyBag, (void**)&qi); ok(hres == E_NOINTERFACE, "QueryInterface returned %08x, expected E_NOINTERFACE\n", hres); - ok(qi == NULL, "qi=%p, ezpected NULL\n", qi); + ok(qi == NULL, "qi=%p, expected NULL\n", qi); qi = (void*)0xdeadbeef; hres = IUnknown_QueryInterface(unk, &IID_UndocumentedScriptIface, (void**)&qi); ok(hres == E_NOINTERFACE, "QueryInterface returned %08x, expected E_NOINTERFACE\n", hres); - ok(qi == NULL, "qi=%p, ezpected NULL\n", qi); + ok(qi == NULL, "qi=%p, expected NULL\n", qi); } static void init_test(enum load_state_t ls) { diff --git a/dlls/mshtml/tests/protocol.c b/dlls/mshtml/tests/protocol.c index c63034d28a5..36355bf36b0 100644 --- a/dlls/mshtml/tests/protocol.c +++ b/dlls/mshtml/tests/protocol.c @@ -368,7 +368,7 @@ static void test_res_protocol(void) sizeof(buf)/sizeof(buf[0]), &size, 0); ok(hres == E_FAIL, "ParseUrl failed: %08x\n", hres); ok(buf[0] == '?', "buf changed\n"); - ok(size == 1, "size=%u, ezpected 1\n", size); + ok(size == 1, "size=%u, expected 1\n", size); buf[0] = '?'; hres = IInternetProtocolInfo_ParseUrl(protocol_info, blank_url, PARSE_DOMAIN, 0, buf, @@ -664,7 +664,7 @@ static void test_about_protocol(void) sizeof(buf)/sizeof(buf[0]), &size, 0); ok(hres == E_FAIL, "ParseUrl failed: %08x\n", hres); ok(buf[0] == '?', "buf changed\n"); - ok(size == 1, "size=%u, ezpected 1\n", size); + ok(size == 1, "size=%u, expected 1\n", size); buf[0] = '?'; hres = IInternetProtocolInfo_ParseUrl(protocol_info, about_blank_url, PARSE_DOMAIN, 0, buf, diff --git a/dlls/msi/tests/install.c b/dlls/msi/tests/install.c index bc98840a043..56d36e1108f 100644 --- a/dlls/msi/tests/install.c +++ b/dlls/msi/tests/install.c @@ -44,6 +44,8 @@ static HMODULE hsrclient = 0; static BOOL (WINAPI *pSRRemoveRestorePoint)(DWORD); static BOOL (WINAPI *pSRSetRestorePointA)(RESTOREPOINTINFOA*, STATEMGRSTATUS*); +static BOOL on_win9x = FALSE; + static const char *msifile = "msitest.msi"; static const char *msifile2 = "winetest2.msi"; static const char *mstfile = "winetest.mst"; @@ -1331,6 +1333,19 @@ static void init_functionpointers(void) #undef GET_PROC } +static BOOL check_win9x(void) +{ + SC_HANDLE scm; + + scm = OpenSCManager(NULL, NULL, GENERIC_ALL); + if (!scm && (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)) + return TRUE; + + CloseServiceHandle(scm); + + return FALSE; +} + static void get_user_sid(LPSTR *usersid) { HANDLE token; @@ -1698,15 +1713,12 @@ static void test_MsiInstallProduct(void) LONG res; HKEY hkey; DWORD num, size, type; - SC_HANDLE scm; - scm = OpenSCManager(NULL, NULL, GENERIC_ALL); - if (!scm && (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)) + if (on_win9x) { - skip("Services are not implemented, we are most likely on win9x\n"); + win_skip("Services are not implemented on Win9x and WinMe\n"); return; } - CloseServiceHandle(scm); create_test_files(); create_database(msifile, tables, sizeof(tables) / sizeof(msi_table)); @@ -5185,16 +5197,11 @@ static void test_MsiConfigureProductEx(void) CHAR keypath[MAX_PATH * 2]; CHAR localpack[MAX_PATH]; - /* skip these tests if we are on Win9x or WinMe */ - lstrcpyA(keypath, "Software\\Microsoft\\Windows\\CurrentVersion\\"); - lstrcatA(keypath, "Installer\\UserData"); - res = RegOpenKeyA(HKEY_LOCAL_MACHINE, keypath, &props); - if (res == ERROR_FILE_NOT_FOUND) + if (on_win9x) { win_skip("Different registry keys on Win9x and WinMe\n"); return; } - RegCloseKey(props); CreateDirectoryA("msitest", NULL); create_file("msitest\\hydrogen", 500); @@ -5613,6 +5620,8 @@ START_TEST(install) init_functionpointers(); + on_win9x = check_win9x(); + GetCurrentDirectoryA(MAX_PATH, prev_path); GetTempPath(MAX_PATH, temp_path); SetCurrentDirectoryA(temp_path); diff --git a/dlls/msvcrt/math.c b/dlls/msvcrt/math.c index 25ac69f9719..30d79562460 100644 --- a/dlls/msvcrt/math.c +++ b/dlls/msvcrt/math.c @@ -420,8 +420,8 @@ int CDECL _fpclass(double num) #ifdef FP_PNORM case FP_PNORM: return MSVCRT__FPCLASS_PN; #endif + default: return MSVCRT__FPCLASS_PN; } - return MSVCRT__FPCLASS_PN; #elif defined (fpclassify) switch (fpclassify( num )) { diff --git a/dlls/msxml3/Makefile.in b/dlls/msxml3/Makefile.in index c4293ddd33e..8997f1bb566 100644 --- a/dlls/msxml3/Makefile.in +++ b/dlls/msxml3/Makefile.in @@ -5,7 +5,7 @@ SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = msxml3.dll IMPORTS = uuid urlmon shlwapi oleaut32 ole32 user32 advapi32 kernel32 -EXTRALIBS = @XML2LIBS@ @XSLTLIBS@ +EXTRALIBS = @XML2LIBS@ EXTRAINCL = @XML2INCL@ @XSLTINCL@ C_SRCS = \ diff --git a/dlls/msxml3/main.c b/dlls/msxml3/main.c index 8dbacbfa6ad..358a5cb3af1 100644 --- a/dlls/msxml3/main.c +++ b/dlls/msxml3/main.c @@ -20,6 +20,7 @@ */ #include "config.h" +#include "wine/port.h" #define COBJMACROS @@ -32,13 +33,10 @@ #include "msxml2.h" #include "wine/debug.h" +#include "wine/library.h" #include "msxml_private.h" -#ifdef HAVE_LIBXSLT -#include -#endif - WINE_DEFAULT_DEBUG_CHANNEL(msxml); HRESULT WINAPI DllCanUnloadNow(void) @@ -47,6 +45,45 @@ HRESULT WINAPI DllCanUnloadNow(void) return S_FALSE; } + +void* libxslt_handle = NULL; +#ifdef SONAME_LIBXSLT +# define DECL_FUNCPTR(f) typeof(f) * p##f = NULL +DECL_FUNCPTR(xsltApplyStylesheet); +DECL_FUNCPTR(xsltCleanupGlobals); +DECL_FUNCPTR(xsltFreeStylesheet); +DECL_FUNCPTR(xsltParseStylesheetDoc); +# undef MAKE_FUNCPTR +#endif + +static void init_libxslt(void) +{ +#ifdef SONAME_LIBXSLT + void (*pxsltInit)(void); /* Missing in libxslt <= 1.1.14 */ + + libxslt_handle = wine_dlopen(SONAME_LIBXSLT, RTLD_NOW, NULL, 0); + if (!libxslt_handle) + return; + +#define LOAD_FUNCPTR(f, needed) if ((p##f = wine_dlsym(libxslt_handle, #f, NULL, 0)) == NULL && needed) { WARN("Can't find symbol %s\n", #f); goto sym_not_found; } + LOAD_FUNCPTR(xsltInit, 0); + LOAD_FUNCPTR(xsltApplyStylesheet, 1); + LOAD_FUNCPTR(xsltCleanupGlobals, 1); + LOAD_FUNCPTR(xsltFreeStylesheet, 1); + LOAD_FUNCPTR(xsltParseStylesheetDoc, 1); +#undef LOAD_FUNCPTR + + if (pxsltInit) + pxsltInit(); + return; + + sym_not_found: + wine_dlclose(libxslt_handle, NULL, 0); + libxslt_handle = NULL; +#endif +} + + BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv) { switch(fdwReason) @@ -60,14 +97,17 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv) xmlTreeIndentString = "\t"; xmlThrDefTreeIndentString("\t"); #endif -#ifdef HAVE_XSLTINIT - xsltInit(); -#endif + init_libxslt(); DisableThreadLibraryCalls(hInstDLL); break; case DLL_PROCESS_DETACH: -#ifdef HAVE_LIBXSLT - xsltCleanupGlobals(); +#ifdef SONAME_LIBXSLT + if (libxslt_handle) + { + pxsltCleanupGlobals(); + wine_dlclose(libxslt_handle, NULL, 0); + libxslt_handle = NULL; + } #endif #ifdef HAVE_LIBXML2 xmlCleanupParser(); diff --git a/dlls/msxml3/msxml_private.h b/dlls/msxml3/msxml_private.h index 45d68cf659f..aa14b9b6a70 100644 --- a/dlls/msxml3/msxml_private.h +++ b/dlls/msxml3/msxml_private.h @@ -92,6 +92,25 @@ extern HRESULT DOMDocument_create_from_xmldoc(xmlDocPtr xmldoc, IXMLDOMDocument2 #endif +void* libxslt_handle; +#ifdef SONAME_LIBXSLT +# ifdef HAVE_LIBXSLT_PATTERN_H +# include +# endif +# ifdef HAVE_LIBXSLT_TRANSFORM_H +# include +# endif +# include +# include + +# define MAKE_FUNCPTR(f) extern typeof(f) * p##f +MAKE_FUNCPTR(xsltApplyStylesheet); +MAKE_FUNCPTR(xsltCleanupGlobals); +MAKE_FUNCPTR(xsltFreeStylesheet); +MAKE_FUNCPTR(xsltParseStylesheetDoc); +# undef MAKE_FUNCPTR +#endif + extern IXMLDOMParseError *create_parseError( LONG code, BSTR url, BSTR reason, BSTR srcText, LONG line, LONG linepos, LONG filepos ); extern HRESULT DOMDocument_create( IUnknown *pUnkOuter, LPVOID *ppObj ); diff --git a/dlls/msxml3/node.c b/dlls/msxml3/node.c index f2c6154cbaf..19cee8f3f86 100644 --- a/dlls/msxml3/node.c +++ b/dlls/msxml3/node.c @@ -33,17 +33,6 @@ #include "msxml_private.h" -#ifdef HAVE_LIBXSLT -# ifdef HAVE_LIBXSLT_PATTERN_H -# include -# endif -# ifdef HAVE_LIBXSLT_TRANSFORM_H -# include -# endif -# include -# include -#endif - #ifdef HAVE_LIBXML2 # include #endif @@ -1278,7 +1267,7 @@ static HRESULT WINAPI xmlnode_transformNode( IXMLDOMNode* styleSheet, BSTR* xmlString) { -#ifdef HAVE_LIBXSLT +#ifdef SONAME_LIBXSLT xmlnode *This = impl_from_IXMLDOMNode( iface ); xmlnode *pStyleSheet = NULL; xsltStylesheetPtr xsltSS = NULL; @@ -1287,6 +1276,8 @@ static HRESULT WINAPI xmlnode_transformNode( TRACE("%p %p %p\n", This, styleSheet, xmlString); + if (!libxslt_handle) + return E_NOTIMPL; if(!styleSheet || !xmlString) return E_INVALIDARG; @@ -1296,10 +1287,10 @@ static HRESULT WINAPI xmlnode_transformNode( { pStyleSheet = impl_from_IXMLDOMNode( ssNew ); - xsltSS = xsltParseStylesheetDoc( pStyleSheet->node->doc); + xsltSS = pxsltParseStylesheetDoc( pStyleSheet->node->doc); if(xsltSS) { - result = xsltApplyStylesheet(xsltSS, This->node->doc, NULL); + result = pxsltApplyStylesheet(xsltSS, This->node->doc, NULL); if(result) { const xmlChar *pContent; @@ -1337,7 +1328,7 @@ static HRESULT WINAPI xmlnode_transformNode( /* libxslt "helpfully" frees the XML document the stylesheet was generated from, too */ xsltSS->doc = NULL; - xsltFreeStylesheet(xsltSS); + pxsltFreeStylesheet(xsltSS); } IXMLDOMNode_Release(ssNew); diff --git a/dlls/msxml3/saxreader.c b/dlls/msxml3/saxreader.c index 5b166630ee0..9fc226ad6d2 100644 --- a/dlls/msxml3/saxreader.c +++ b/dlls/msxml3/saxreader.c @@ -1168,6 +1168,13 @@ static void libxmlEndElementNS( Prefix, SysStringLen(Prefix)); SysFreeString(Prefix); + + if(hr != S_OK) + { + format_error_message_from_id(This, hr); + return; + } + } } @@ -1218,6 +1225,12 @@ static void libxmlCharacters( Chars, SysStringLen(Chars)); SysFreeString(Chars); + if(hr != S_OK) + { + format_error_message_from_id(This, hr); + return; + } + This->column += end-cur+1; if(lastEvent) @@ -1772,7 +1785,7 @@ static HRESULT internal_parseBuffer(saxreader *This, const char *buffer, int siz hr = SAXLocator_create(This, &locator, vbInterface); if(FAILED(hr)) - return E_FAIL; + return hr; locator->pParserCtxt = xmlCreateMemoryParserCtxt(buffer, size); if(!locator->pParserCtxt) @@ -1797,7 +1810,7 @@ static HRESULT internal_parseBuffer(saxreader *This, const char *buffer, int siz } ISAXLocator_Release((ISAXLocator*)&locator->lpSAXLocatorVtbl); - return S_OK; + return hr; } static HRESULT internal_parseStream(saxreader *This, IStream *stream, BOOL vbInterface) @@ -1813,7 +1826,7 @@ static HRESULT internal_parseStream(saxreader *This, IStream *stream, BOOL vbInt hr = SAXLocator_create(This, &locator, vbInterface); if(FAILED(hr)) - return E_FAIL; + return hr; locator->pParserCtxt = xmlCreatePushParserCtxt( &locator->saxreader->sax, locator, diff --git a/dlls/netapi32/nbt.c b/dlls/netapi32/nbt.c index a47229cb0e0..8db87b4b9de 100644 --- a/dlls/netapi32/nbt.c +++ b/dlls/netapi32/nbt.c @@ -415,10 +415,7 @@ static BOOL NetBTFindNameAnswerCallback(void *pVoid, WORD answerCount, if (queryData->cacheEntry) queryData->cacheEntry->numAddresses = 0; else - { - ret = FALSE; queryData->ret = NRC_OSRESNOTAV; - } } if (rLen == 6 && queryData->cacheEntry && queryData->cacheEntry->numAddresses < answerCount) @@ -850,8 +847,8 @@ static UCHAR NetBTAstat(void *adapt, PNCB ncb) astat->max_sess_pkt_size = 0xffff; astat->xmit_success = adapter->xmit_success; astat->recv_success = adapter->recv_success; + ret = NRC_GOODRET; } - ret = NRC_GOODRET; } else ret = NetBTAstatRemote(adapter, ncb); @@ -1183,6 +1180,7 @@ static UCHAR NetBTRecv(void *adapt, void *sess, PNCB ncb) * message header. */ NetBIOSHangupSession(ncb); ret = NRC_SABORT; + goto error; } else if (buffer[0] != NBSS_MSG) { @@ -1190,6 +1188,7 @@ static UCHAR NetBTRecv(void *adapt, void *sess, PNCB ncb) FIXME("Received unexpected session msg type %d\n", buffer[0]); NetBIOSHangupSession(ncb); ret = NRC_SABORT; + goto error; } else { @@ -1199,6 +1198,7 @@ static UCHAR NetBTRecv(void *adapt, void *sess, PNCB ncb) FIXME("Received a message that's too long for my taste\n"); NetBIOSHangupSession(ncb); ret = NRC_SABORT; + goto error; } else { @@ -1226,6 +1226,7 @@ static UCHAR NetBTRecv(void *adapt, void *sess, PNCB ncb) adapter->recv_success++; } } +error: TRACE("returning 0x%02x\n", ret); return ret; } diff --git a/dlls/netapi32/netbios.c b/dlls/netapi32/netbios.c index a55f5563162..8d0de1f039e 100644 --- a/dlls/netapi32/netbios.c +++ b/dlls/netapi32/netbios.c @@ -637,7 +637,7 @@ static UCHAR nbInternalHangup(NetBIOSAdapter *adapter, NetBIOSSession *session) EnterCriticalSection(&adapter->cs); memset(session, 0, sizeof(NetBIOSSession)); LeaveCriticalSection(&adapter->cs); - return NRC_GOODRET; + return ret; } static UCHAR nbHangup(NetBIOSAdapter *adapter, const NCB *ncb) diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c index 5c163f15871..8a29098c1c0 100644 --- a/dlls/ntdll/directory.c +++ b/dlls/ntdll/directory.c @@ -1877,8 +1877,8 @@ static NTSTATUS get_dos_device( const WCHAR *name, UINT name_len, ANSI_STRING *u dev[2] = 0; /* remove last ':' to get the drive mount point symlink */ new_name = get_default_drive_device( unix_name ); } - else if (!strncmp( dev, "com", 3 )) new_name = get_default_com_device( dev[3] - '0' ); - else if (!strncmp( dev, "lpt", 3 )) new_name = get_default_lpt_device( dev[3] - '0' ); + else if (!strncmp( dev, "com", 3 )) new_name = get_default_com_device( atoi(dev + 3 )); + else if (!strncmp( dev, "lpt", 3 )) new_name = get_default_lpt_device( atoi(dev + 3 )); if (!new_name) break; diff --git a/dlls/ntdll/env.c b/dlls/ntdll/env.c index 6110a743644..5ac35435548 100644 --- a/dlls/ntdll/env.c +++ b/dlls/ntdll/env.c @@ -237,7 +237,6 @@ NTSTATUS WINAPI RtlSetEnvironmentVariable(PWSTR* penv, PUNICODE_STRING name, RtlDestroyEnvironment(env); if (!penv) NtCurrentTeb()->Peb->ProcessParameters->Environment = new_env; else *penv = new_env; - env = new_env; } else { diff --git a/dlls/ntdll/heap.c b/dlls/ntdll/heap.c index cdd1f70ea89..396c2757ae6 100644 --- a/dlls/ntdll/heap.c +++ b/dlls/ntdll/heap.c @@ -143,9 +143,10 @@ typedef struct tagHEAP struct list entry; /* Entry in process heap list */ struct list subheap_list; /* Sub-heap list */ struct list large_list; /* Large blocks list */ + SIZE_T grow_size; /* Size of next subheap for growing heap */ DWORD magic; /* Magic number */ RTL_CRITICAL_SECTION critSection; /* Critical section for serialization */ - FREE_LIST_ENTRY freeList[HEAP_NB_FREE_LISTS]; /* Free lists */ + FREE_LIST_ENTRY freeList[HEAP_NB_FREE_LISTS] DECLSPEC_ALIGN(8); /* Free lists */ } HEAP; #define HEAP_MAGIC ((DWORD)('H' | ('E'<<8) | ('A'<<16) | ('P'<<24))) @@ -809,6 +810,7 @@ static SUBHEAP *HEAP_CreateSubHeap( HEAP *heap, LPVOID address, DWORD flags, heap = (HEAP *)address; heap->flags = flags; heap->magic = HEAP_MAGIC; + heap->grow_size = max( HEAP_DEF_SIZE, totalSize ); list_init( &heap->subheap_list ); list_init( &heap->large_list ); @@ -921,11 +923,13 @@ static ARENA_FREE *HEAP_FindFreeBlock( HEAP *heap, SIZE_T size, if (total_size < size) return NULL; /* overflow */ if (!(subheap = HEAP_CreateSubHeap( heap, NULL, heap->flags, total_size, - max( HEAP_DEF_SIZE, total_size ) ))) + max( heap->grow_size, total_size ) ))) return NULL; + if (heap->grow_size < 128 * 1024 * 1024) heap->grow_size *= 2; + TRACE("created new sub-heap %p of %08lx bytes for heap %p\n", - subheap, total_size, heap ); + subheap, subheap->size, heap ); *ppSubHeap = subheap; return (ARENA_FREE *)((char *)subheap->base + subheap->headerSize); diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index eab7516de25..fc7620d9c40 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -1316,12 +1316,10 @@ static WCHAR *get_builtin_fullname( const WCHAR *path, const char *filename ) static void load_builtin_callback( void *module, const char *filename ) { static const WCHAR emptyW[1]; - void *addr; IMAGE_NT_HEADERS *nt; WINE_MODREF *wm; WCHAR *fullname; const WCHAR *load_path; - SIZE_T size; if (!module) { @@ -1334,10 +1332,10 @@ static void load_builtin_callback( void *module, const char *filename ) builtin_load_info->status = STATUS_INVALID_IMAGE_FORMAT; return; } - addr = module; - size = nt->OptionalHeader.SizeOfImage; - NtAllocateVirtualMemory( NtCurrentProcess(), &addr, 0, &size, - MEM_SYSTEM | MEM_IMAGE, PAGE_EXECUTE_WRITECOPY ); + virtual_create_system_view( module, nt->OptionalHeader.SizeOfImage, + VPROT_SYSTEM | VPROT_IMAGE | VPROT_COMMITTED | + VPROT_READ | VPROT_WRITECOPY | VPROT_EXEC ); + /* create the MODREF */ if (!(fullname = get_builtin_fullname( builtin_load_info->filename, filename ))) diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h index beffd771419..a42fd116bbc 100644 --- a/dlls/ntdll/ntdll_misc.h +++ b/dlls/ntdll/ntdll_misc.h @@ -136,6 +136,8 @@ extern unsigned int DIR_get_drives_info( struct drive_info info[MAX_DOS_DRIVES] /* virtual memory */ extern void virtual_get_system_info( SYSTEM_BASIC_INFORMATION *info ); +extern NTSTATUS virtual_create_system_view( void *base, SIZE_T size, DWORD vprot ); +extern SIZE_T virtual_free_system_view( PVOID *addr_ptr ); extern NTSTATUS virtual_alloc_thread_stack( void *base, SIZE_T stack_size ); extern void virtual_clear_thread_stack(void); extern BOOL virtual_handle_stack_fault( void *addr ); diff --git a/dlls/ntdll/server.c b/dlls/ntdll/server.c index 62ccc2c650b..64d9a8ba726 100644 --- a/dlls/ntdll/server.c +++ b/dlls/ntdll/server.c @@ -142,7 +142,6 @@ static void fatal_perror( const char *err, ... ) void server_exit_thread( int status ) { struct wine_pthread_thread_info info; - SIZE_T size; int fds[4]; RtlAcquirePebLock(); @@ -162,13 +161,8 @@ void server_exit_thread( int status ) fds[3] = ntdll_get_thread_data()->request_fd; pthread_functions.sigprocmask( SIG_BLOCK, &server_block_set, NULL ); - size = 0; - NtFreeVirtualMemory( GetCurrentProcess(), &info.stack_base, &size, MEM_RELEASE | MEM_SYSTEM ); - info.stack_size = size; - - size = 0; - NtFreeVirtualMemory( GetCurrentProcess(), &info.teb_base, &size, MEM_RELEASE | MEM_SYSTEM ); - info.teb_size = size; + info.stack_size = virtual_free_system_view( &info.stack_base ); + info.teb_size = virtual_free_system_view( &info.teb_base ); close( fds[0] ); close( fds[1] ); diff --git a/dlls/ntdll/tests/reg.c b/dlls/ntdll/tests/reg.c index 70864b6f250..1525bb1839f 100644 --- a/dlls/ntdll/tests/reg.c +++ b/dlls/ntdll/tests/reg.c @@ -29,6 +29,11 @@ #include "winnls.h" #include "stdlib.h" +/* A test string */ +static const WCHAR stringW[] = {'s', 't', 'r', 'i', 'n', 'g', 'W', 0}; +/* A size, in bytes, short enough to cause truncation of the above */ +#define STR_TRUNC_SIZE (sizeof(stringW)-2*sizeof(*stringW)) + #ifndef __WINE_WINTERNL_H /* RtlQueryRegistryValues structs and defines */ @@ -156,32 +161,29 @@ static BOOL InitFunctionPtrs(void) trace("Could not load ntdll.dll\n"); return FALSE; } - if (hntdll) - { - NTDLL_GET_PROC(RtlCreateUnicodeStringFromAsciiz) - NTDLL_GET_PROC(RtlCreateUnicodeString) - NTDLL_GET_PROC(RtlFreeUnicodeString) - NTDLL_GET_PROC(NtDeleteValueKey) - NTDLL_GET_PROC(RtlQueryRegistryValues) - NTDLL_GET_PROC(RtlCheckRegistryKey) - NTDLL_GET_PROC(RtlOpenCurrentUser) - NTDLL_GET_PROC(NtClose) - NTDLL_GET_PROC(NtDeleteValueKey) - NTDLL_GET_PROC(NtCreateKey) - NTDLL_GET_PROC(NtFlushKey) - NTDLL_GET_PROC(NtDeleteKey) - NTDLL_GET_PROC(NtQueryValueKey) - NTDLL_GET_PROC(NtSetValueKey) - NTDLL_GET_PROC(NtOpenKey) - NTDLL_GET_PROC(RtlFormatCurrentUserKeyPath) - NTDLL_GET_PROC(RtlReAllocateHeap) - NTDLL_GET_PROC(RtlAppendUnicodeToString) - NTDLL_GET_PROC(RtlUnicodeStringToAnsiString) - NTDLL_GET_PROC(RtlFreeHeap) - NTDLL_GET_PROC(RtlAllocateHeap) - NTDLL_GET_PROC(RtlZeroMemory) - NTDLL_GET_PROC(RtlpNtQueryValueKey) - } + NTDLL_GET_PROC(RtlCreateUnicodeStringFromAsciiz) + NTDLL_GET_PROC(RtlCreateUnicodeString) + NTDLL_GET_PROC(RtlFreeUnicodeString) + NTDLL_GET_PROC(NtDeleteValueKey) + NTDLL_GET_PROC(RtlQueryRegistryValues) + NTDLL_GET_PROC(RtlCheckRegistryKey) + NTDLL_GET_PROC(RtlOpenCurrentUser) + NTDLL_GET_PROC(NtClose) + NTDLL_GET_PROC(NtDeleteValueKey) + NTDLL_GET_PROC(NtCreateKey) + NTDLL_GET_PROC(NtFlushKey) + NTDLL_GET_PROC(NtDeleteKey) + NTDLL_GET_PROC(NtQueryValueKey) + NTDLL_GET_PROC(NtSetValueKey) + NTDLL_GET_PROC(NtOpenKey) + NTDLL_GET_PROC(RtlFormatCurrentUserKeyPath) + NTDLL_GET_PROC(RtlReAllocateHeap) + NTDLL_GET_PROC(RtlAppendUnicodeToString) + NTDLL_GET_PROC(RtlUnicodeStringToAnsiString) + NTDLL_GET_PROC(RtlFreeHeap) + NTDLL_GET_PROC(RtlAllocateHeap) + NTDLL_GET_PROC(RtlZeroMemory) + NTDLL_GET_PROC(RtlpNtQueryValueKey) return TRUE; } #undef NTDLL_GET_PROC @@ -413,16 +415,20 @@ static void test_NtSetValueKey(void) UNICODE_STRING ValName; DWORD data = 711; - pRtlCreateUnicodeStringFromAsciiz(&ValName, "deletetest"); - InitializeObjectAttributes(&attr, &winetestpath, 0, 0, 0); status = pNtOpenKey(&key, am, &attr); ok(status == STATUS_SUCCESS, "NtOpenKey Failed: 0x%08x\n", status); + pRtlCreateUnicodeStringFromAsciiz(&ValName, "deletetest"); status = pNtSetValueKey(key, &ValName, 0, REG_DWORD, &data, sizeof(data)); ok(status == STATUS_SUCCESS, "NtSetValueKey Failed: 0x%08x\n", status); + pRtlFreeUnicodeString(&ValName); + pRtlCreateUnicodeStringFromAsciiz(&ValName, "stringtest"); + status = pNtSetValueKey(key, &ValName, 0, REG_SZ, (VOID*)stringW, STR_TRUNC_SIZE); + ok(status == STATUS_SUCCESS, "NtSetValueKey Failed: 0x%08x\n", status); pRtlFreeUnicodeString(&ValName); + pNtClose(key); } @@ -486,7 +492,7 @@ static void test_NtQueryValueKey(void) basic_info = HeapAlloc(GetProcessHeap(), 0, len); status = pNtQueryValueKey(key, &ValName, KeyValueBasicInformation, basic_info, len, &len); ok(status == STATUS_BUFFER_OVERFLOW, "NtQueryValueKey should have returned STATUS_BUFFER_OVERFLOW instead of 0x%08x\n", status); - ok(basic_info->TitleIndex == 0, "NtQueryValueKey returned wrong TitleIndex %d\n", basic_info->Type); + ok(basic_info->TitleIndex == 0, "NtQueryValueKey returned wrong TitleIndex %d\n", basic_info->TitleIndex); ok(basic_info->Type == REG_DWORD, "NtQueryValueKey returned wrong Type %d\n", basic_info->Type); ok(basic_info->NameLength == 20, "NtQueryValueKey returned wrong NameLength %d\n", basic_info->NameLength); ok(len == FIELD_OFFSET(KEY_VALUE_BASIC_INFORMATION, Name[basic_info->NameLength/sizeof(WCHAR)]), "NtQueryValueKey returned wrong len %d\n", len); @@ -494,7 +500,7 @@ static void test_NtQueryValueKey(void) basic_info = HeapReAlloc(GetProcessHeap(), 0, basic_info, len); status = pNtQueryValueKey(key, &ValName, KeyValueBasicInformation, basic_info, len, &len); ok(status == STATUS_SUCCESS, "NtQueryValueKey should have returned STATUS_SUCCESS instead of 0x%08x\n", status); - ok(basic_info->TitleIndex == 0, "NtQueryValueKey returned wrong TitleIndex %d\n", basic_info->Type); + ok(basic_info->TitleIndex == 0, "NtQueryValueKey returned wrong TitleIndex %d\n", basic_info->TitleIndex); ok(basic_info->Type == REG_DWORD, "NtQueryValueKey returned wrong Type %d\n", basic_info->Type); ok(basic_info->NameLength == 20, "NtQueryValueKey returned wrong NameLength %d\n", basic_info->NameLength); ok(len == FIELD_OFFSET(KEY_VALUE_BASIC_INFORMATION, Name[basic_info->NameLength/sizeof(WCHAR)]), "NtQueryValueKey returned wrong len %d\n", len); @@ -505,7 +511,7 @@ static void test_NtQueryValueKey(void) partial_info = HeapAlloc(GetProcessHeap(), 0, len); status = pNtQueryValueKey(key, &ValName, KeyValuePartialInformation, partial_info, len, &len); ok(status == STATUS_BUFFER_OVERFLOW, "NtQueryValueKey should have returned STATUS_BUFFER_OVERFLOW instead of 0x%08x\n", status); - ok(partial_info->TitleIndex == 0, "NtQueryValueKey returned wrong TitleIndex %d\n", partial_info->Type); + ok(partial_info->TitleIndex == 0, "NtQueryValueKey returned wrong TitleIndex %d\n", partial_info->TitleIndex); ok(partial_info->Type == REG_DWORD, "NtQueryValueKey returned wrong Type %d\n", partial_info->Type); ok(partial_info->DataLength == 4, "NtQueryValueKey returned wrong DataLength %d\n", partial_info->DataLength); ok(len == FIELD_OFFSET(KEY_VALUE_PARTIAL_INFORMATION, Data[partial_info->DataLength]), "NtQueryValueKey returned wrong len %d\n", len); @@ -513,7 +519,7 @@ static void test_NtQueryValueKey(void) partial_info = HeapReAlloc(GetProcessHeap(), 0, partial_info, len); status = pNtQueryValueKey(key, &ValName, KeyValuePartialInformation, partial_info, len, &len); ok(status == STATUS_SUCCESS, "NtQueryValueKey should have returned STATUS_SUCCESS instead of 0x%08x\n", status); - ok(partial_info->TitleIndex == 0, "NtQueryValueKey returned wrong TitleIndex %d\n", partial_info->Type); + ok(partial_info->TitleIndex == 0, "NtQueryValueKey returned wrong TitleIndex %d\n", partial_info->TitleIndex); ok(partial_info->Type == REG_DWORD, "NtQueryValueKey returned wrong Type %d\n", partial_info->Type); ok(partial_info->DataLength == 4, "NtQueryValueKey returned wrong DataLength %d\n", partial_info->DataLength); ok(len == FIELD_OFFSET(KEY_VALUE_PARTIAL_INFORMATION, Data[partial_info->DataLength]), "NtQueryValueKey returned wrong len %d\n", len); @@ -524,7 +530,7 @@ static void test_NtQueryValueKey(void) full_info = HeapAlloc(GetProcessHeap(), 0, len); status = pNtQueryValueKey(key, &ValName, KeyValueFullInformation, full_info, len, &len); ok(status == STATUS_BUFFER_OVERFLOW, "NtQueryValueKey should have returned STATUS_BUFFER_OVERFLOW instead of 0x%08x\n", status); - ok(full_info->TitleIndex == 0, "NtQueryValueKey returned wrong TitleIndex %d\n", full_info->Type); + ok(full_info->TitleIndex == 0, "NtQueryValueKey returned wrong TitleIndex %d\n", full_info->TitleIndex); ok(full_info->Type == REG_DWORD, "NtQueryValueKey returned wrong Type %d\n", full_info->Type); ok(full_info->DataLength == 4, "NtQueryValueKey returned wrong DataLength %d\n", full_info->DataLength); ok(full_info->NameLength == 20, "NtQueryValueKey returned wrong NameLength %d\n", full_info->NameLength); @@ -535,7 +541,7 @@ static void test_NtQueryValueKey(void) full_info = HeapReAlloc(GetProcessHeap(), 0, full_info, len); status = pNtQueryValueKey(key, &ValName, KeyValueFullInformation, full_info, len, &len); ok(status == STATUS_SUCCESS, "NtQueryValueKey should have returned STATUS_SUCCESS instead of 0x%08x\n", status); - ok(full_info->TitleIndex == 0, "NtQueryValueKey returned wrong TitleIndex %d\n", full_info->Type); + ok(full_info->TitleIndex == 0, "NtQueryValueKey returned wrong TitleIndex %d\n", full_info->TitleIndex); ok(full_info->Type == REG_DWORD, "NtQueryValueKey returned wrong Type %d\n", full_info->Type); ok(full_info->DataLength == 4, "NtQueryValueKey returned wrong DataLength %d\n", full_info->DataLength); ok(full_info->NameLength == 20, "NtQueryValueKey returned wrong NameLength %d\n", full_info->NameLength); @@ -545,6 +551,22 @@ static void test_NtQueryValueKey(void) HeapFree(GetProcessHeap(), 0, full_info); pRtlFreeUnicodeString(&ValName); + pRtlCreateUnicodeStringFromAsciiz(&ValName, "stringtest"); + + status = pNtQueryValueKey(key, &ValName, KeyValuePartialInformation, NULL, 0, &len); + todo_wine ok(status == STATUS_BUFFER_TOO_SMALL, "NtQueryValueKey should have returned STATUS_BUFFER_TOO_SMALL instead of 0x%08x\n", status); + partial_info = HeapAlloc(GetProcessHeap(), 0, len+1); + memset((BYTE*)partial_info, 0xbd, len+1); + status = pNtQueryValueKey(key, &ValName, KeyValuePartialInformation, partial_info, len, &len); + ok(status == STATUS_SUCCESS, "NtQueryValueKey should have returned STATUS_SUCCESS instead of 0x%08x\n", status); + ok(partial_info->TitleIndex == 0, "NtQueryValueKey returned wrong TitleIndex %d\n", partial_info->TitleIndex); + ok(partial_info->Type == REG_SZ, "NtQueryValueKey returned wrong Type %d\n", partial_info->Type); + ok(partial_info->DataLength == STR_TRUNC_SIZE, "NtQueryValueKey returned wrong DataLength %d\n", partial_info->DataLength); + ok(!memcmp(partial_info->Data, stringW, STR_TRUNC_SIZE), "incorrect Data returned\n"); + ok(*(partial_info->Data+STR_TRUNC_SIZE) == 0xbd, "string overflowed %02x\n", *(partial_info->Data+STR_TRUNC_SIZE)); + HeapFree(GetProcessHeap(), 0, partial_info); + + pRtlFreeUnicodeString(&ValName); pNtClose(key); } diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c index 7a12da2b1b0..f5bed62e17c 100644 --- a/dlls/ntdll/virtual.c +++ b/dlls/ntdll/virtual.c @@ -134,7 +134,7 @@ static void *working_set_limit; ((void *)((UINT_PTR)(addr) & ~(UINT_PTR)(mask))) #define ROUND_SIZE(addr,size) \ - (((UINT)(size) + ((UINT_PTR)(addr) & page_mask) + page_mask) & ~page_mask) + (((SIZE_T)(size) + ((UINT_PTR)(addr) & page_mask) + page_mask) & ~page_mask) #define VIRTUAL_DEBUG_DUMP_VIEW(view) \ do { if (TRACE_ON(virtual)) VIRTUAL_DumpView(view); } while (0) @@ -755,63 +755,6 @@ done: /*********************************************************************** - * unaligned_mmap - * - * Linux kernels before 2.4.x can support non page-aligned offsets, as - * long as the offset is aligned to the filesystem block size. This is - * a big performance gain so we want to take advantage of it. - * - * However, when we use 64-bit file support this doesn't work because - * glibc rejects unaligned offsets. Also glibc 2.1.3 mmap64 is broken - * in that it rounds unaligned offsets down to a page boundary. For - * these reasons we do a direct system call here. - */ -static void *unaligned_mmap( void *addr, size_t length, unsigned int prot, - unsigned int flags, int fd, off_t offset ) -{ -#if defined(linux) && defined(__i386__) && defined(__GNUC__) - if (!(offset >> 32) && (offset & page_mask)) - { - int ret; - - struct - { - void *addr; - unsigned int length; - unsigned int prot; - unsigned int flags; - unsigned int fd; - unsigned int offset; - } args; - - args.addr = addr; - args.length = length; - args.prot = prot; - args.flags = flags; - args.fd = fd; - args.offset = offset; - - __asm__ __volatile__("push %%ebx\n\t" - "movl %2,%%ebx\n\t" - "int $0x80\n\t" - "popl %%ebx" - : "=a" (ret) - : "0" (90), /* SYS_mmap */ - "q" (&args) - : "memory" ); - if (ret < 0 && ret > -4096) - { - errno = -ret; - ret = -1; - } - return (void *)ret; - } -#endif - return mmap( addr, length, prot, flags, fd, offset ); -} - - -/*********************************************************************** * map_file_into_view * * Wrapper for mmap() to map a file into a view, falling back to read if mmap fails. @@ -832,7 +775,7 @@ static NTSTATUS map_file_into_view( struct file_view *view, int fd, size_t start { int flags = MAP_FIXED | (shared_write ? MAP_SHARED : MAP_PRIVATE); - if (unaligned_mmap( (char *)view->base + start, size, prot, flags, fd, offset ) != (void *)-1) + if (mmap( (char *)view->base + start, size, prot, flags, fd, offset ) != (void *)-1) goto done; /* mmap() failed; if this is because the file offset is not */ @@ -918,6 +861,66 @@ static NTSTATUS decommit_pages( struct file_view *view, size_t start, size_t siz /*********************************************************************** + * allocate_dos_memory + * + * Allocate the DOS memory range. + */ +static NTSTATUS allocate_dos_memory( struct file_view **view, unsigned int vprot ) +{ + size_t size; + void *addr = NULL; + void * const low_64k = (void *)0x10000; + const size_t dosmem_size = 0x110000; + int unix_prot = VIRTUAL_GetUnixProt( vprot ); + struct list *ptr; + + /* check for existing view */ + + if ((ptr = list_head( &views_list ))) + { + struct file_view *first_view = LIST_ENTRY( ptr, struct file_view, entry ); + if (first_view->base < (void *)dosmem_size) return STATUS_CONFLICTING_ADDRESSES; + } + + /* check without the first 64K */ + + if (wine_mmap_is_in_reserved_area( low_64k, dosmem_size - 0x10000 ) != 1) + { + addr = wine_anon_mmap( low_64k, dosmem_size - 0x10000, unix_prot, 0 ); + if (addr != low_64k) + { + if (addr != (void *)-1) munmap( addr, dosmem_size - 0x10000 ); + return map_view( view, NULL, dosmem_size, 0xffff, 0, vprot ); + } + } + + /* now try to allocate the low 64K too */ + + if (wine_mmap_is_in_reserved_area( NULL, 0x10000 ) != 1) + { + addr = wine_anon_mmap( (void *)page_size, 0x10000 - page_size, unix_prot, 0 ); + if (addr == (void *)page_size) + { + addr = NULL; + TRACE( "successfully mapped low 64K range\n" ); + } + else + { + if (addr != (void *)-1) munmap( addr, 0x10000 - page_size ); + addr = low_64k; + TRACE( "failed to map low 64K range\n" ); + } + } + + /* now reserve the whole range */ + + size = (char *)dosmem_size - (char *)addr; + wine_anon_mmap( addr, size, unix_prot, MAP_FIXED ); + return create_view( view, addr, size, vprot ); +} + + +/*********************************************************************** * map_image * * Map an executable (PE format) image into memory. @@ -1286,6 +1289,51 @@ void virtual_get_system_info( SYSTEM_BASIC_INFORMATION *info ) /*********************************************************************** + * virtual_create_system_view + */ +NTSTATUS virtual_create_system_view( void *base, SIZE_T size, DWORD vprot ) +{ + FILE_VIEW *view; + NTSTATUS status; + sigset_t sigset; + + size = ROUND_SIZE( base, size ); + base = ROUND_ADDR( base, page_mask ); + server_enter_uninterrupted_section( &csVirtual, &sigset ); + status = create_view( &view, base, size, vprot ); + if (!status) TRACE( "created %p-%p\n", base, (char *)base + size ); + server_leave_uninterrupted_section( &csVirtual, &sigset ); + return status; +} + + +/*********************************************************************** + * virtual_free_system_view + */ +SIZE_T virtual_free_system_view( PVOID *addr_ptr ) +{ + FILE_VIEW *view; + sigset_t sigset; + SIZE_T size = 0; + char *base = ROUND_ADDR( *addr_ptr, page_mask ); + + server_enter_uninterrupted_section( &csVirtual, &sigset ); + if ((view = VIRTUAL_FindView( base ))) + { + TRACE( "freeing %p-%p\n", view->base, (char *)view->base + view->size ); + /* return the values that the caller should use to unmap the area */ + *addr_ptr = view->base; + /* make sure we don't munmap anything from a reserved area */ + if (!wine_mmap_is_in_reserved_area( view->base, view->size )) size = view->size; + view->protect |= VPROT_SYSTEM; + delete_view( view ); + } + server_leave_uninterrupted_section( &csVirtual, &sigset ); + return size; +} + + +/*********************************************************************** * virtual_alloc_thread_stack */ NTSTATUS virtual_alloc_thread_stack( void *base, SIZE_T size ) @@ -1518,6 +1566,9 @@ NTSTATUS WINAPI NtAllocateVirtualMemory( HANDLE process, PVOID *ret, ULONG zero_ if (is_beyond_limit( 0, size, working_set_limit )) return STATUS_WORKING_SET_LIMIT_RANGE; + vprot = VIRTUAL_GetProt( protect ) | VPROT_VALLOC; + if (type & MEM_COMMIT) vprot |= VPROT_COMMITTED; + if (*ret) { if (type & MEM_RESERVE) /* Round down to 64k boundary */ @@ -1526,6 +1577,20 @@ NTSTATUS WINAPI NtAllocateVirtualMemory( HANDLE process, PVOID *ret, ULONG zero_ base = ROUND_ADDR( *ret, page_mask ); size = (((UINT_PTR)*ret + size + page_mask) & ~page_mask) - (UINT_PTR)base; + /* address 1 is magic to mean DOS area */ + if (!base && *ret == (void *)1 && size == 0x110000) + { + server_enter_uninterrupted_section( &csVirtual, &sigset ); + status = allocate_dos_memory( &view, vprot ); + if (status == STATUS_SUCCESS) + { + *ret = view->base; + *size_ptr = view->size; + } + server_leave_uninterrupted_section( &csVirtual, &sigset ); + return status; + } + /* disallow low 64k, wrap-around and kernel space */ if (((char *)base < (char *)0x10000) || ((char *)base + size < (char *)base) || @@ -1540,34 +1605,23 @@ NTSTATUS WINAPI NtAllocateVirtualMemory( HANDLE process, PVOID *ret, ULONG zero_ /* Compute the alloc type flags */ - if (!(type & MEM_SYSTEM)) + if (!(type & (MEM_COMMIT | MEM_RESERVE)) || + (type & ~(MEM_COMMIT | MEM_RESERVE | MEM_TOP_DOWN | MEM_WRITE_WATCH | MEM_RESET))) { - if (!(type & (MEM_COMMIT | MEM_RESERVE)) || - (type & ~(MEM_COMMIT | MEM_RESERVE | MEM_TOP_DOWN | MEM_WRITE_WATCH | MEM_RESET))) - { - WARN("called with wrong alloc type flags (%08x) !\n", type); - return STATUS_INVALID_PARAMETER; - } - if (type & MEM_WRITE_WATCH) - { - FIXME("MEM_WRITE_WATCH type not supported\n"); - return STATUS_INVALID_PARAMETER; - } + WARN("called with wrong alloc type flags (%08x) !\n", type); + return STATUS_INVALID_PARAMETER; + } + if (type & MEM_WRITE_WATCH) + { + FIXME("MEM_WRITE_WATCH type not supported\n"); + return STATUS_INVALID_PARAMETER; } - vprot = VIRTUAL_GetProt( protect ) | VPROT_VALLOC; - if (type & MEM_COMMIT) vprot |= VPROT_COMMITTED; /* Reserve the memory */ if (use_locks) server_enter_uninterrupted_section( &csVirtual, &sigset ); - if (type & MEM_SYSTEM) - { - if (type & MEM_IMAGE) vprot |= VPROT_IMAGE | VPROT_NOEXEC; - status = create_view( &view, base, size, vprot | VPROT_COMMITTED | VPROT_SYSTEM ); - if (status == STATUS_SUCCESS) base = view->base; - } - else if ((type & MEM_RESERVE) || !base) + if ((type & MEM_RESERVE) || !base) { status = map_view( &view, base, size, mask, type & MEM_TOP_DOWN, vprot ); if (status == STATUS_SUCCESS) base = view->base; @@ -1644,7 +1698,7 @@ NTSTATUS WINAPI NtFreeVirtualMemory( HANDLE process, PVOID *addr_ptr, SIZE_T *si base = ROUND_ADDR( addr, page_mask ); /* avoid freeing the DOS area when a broken app passes a NULL pointer */ - if (!base && !(type & MEM_SYSTEM)) return STATUS_INVALID_PARAMETER; + if (!base) return STATUS_INVALID_PARAMETER; server_enter_uninterrupted_section( &csVirtual, &sigset ); @@ -1654,15 +1708,6 @@ NTSTATUS WINAPI NtFreeVirtualMemory( HANDLE process, PVOID *addr_ptr, SIZE_T *si { status = STATUS_INVALID_PARAMETER; } - else if (type & MEM_SYSTEM) - { - /* return the values that the caller should use to unmap the area */ - *addr_ptr = view->base; - if (!wine_mmap_is_in_reserved_area( view->base, view->size )) *size_ptr = view->size; - else *size_ptr = 0; /* make sure we don't munmap anything from a reserved area */ - view->protect |= VPROT_SYSTEM; - delete_view( view ); - } else if (type == MEM_RELEASE) { /* Free the pages */ diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c index e4b0ea56a20..c41d289ab42 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/ntoskrnl.c @@ -1071,6 +1071,36 @@ NTSTATUS WINAPI PsSetCreateProcessNotifyRoutine( PCREATE_PROCESS_NOTIFY_ROUTINE return STATUS_SUCCESS; } +/*********************************************************************** + * MmGetSystemRoutineAddress (NTOSKRNL.EXE.@) + */ +PVOID WINAPI MmGetSystemRoutineAddress(PUNICODE_STRING SystemRoutineName) +{ + HMODULE hMod; + STRING routineNameA; + PVOID pFunc = NULL; + + static const WCHAR ntoskrnlW[] = {'n','t','o','s','k','r','n','l','.','e','x','e',0}; + static const WCHAR halW[] = {'h','a','l','.','d','l','l',0}; + + if (!SystemRoutineName) return NULL; + + if (RtlUnicodeStringToAnsiString( &routineNameA, SystemRoutineName, TRUE ) == STATUS_SUCCESS) + { + /* We only support functions exported from ntoskrnl.exe or hal.dll */ + hMod = GetModuleHandleW( ntoskrnlW ); + pFunc = GetProcAddress( hMod, routineNameA.Buffer ); + if (!pFunc) + { + hMod = GetModuleHandleW( halW ); + if (hMod) pFunc = GetProcAddress( hMod, routineNameA.Buffer ); + } + RtlFreeAnsiString( &routineNameA ); + } + + TRACE( "%s -> %p\n", debugstr_us(SystemRoutineName), pFunc ); + return pFunc; +} /***************************************************** * DllMain diff --git a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec index 7d543d4780b..9303d03b9e6 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.exe.spec +++ b/dlls/ntoskrnl.exe/ntoskrnl.exe.spec @@ -675,7 +675,7 @@ @ stub MmFreePagesFromMdl @ stub MmGetPhysicalAddress @ stub MmGetPhysicalMemoryRanges -@ stub MmGetSystemRoutineAddress +@ stdcall MmGetSystemRoutineAddress(ptr) @ stub MmGetVirtualForPhysical @ stub MmGrowKernelStack @ stub MmHighestUserAddress diff --git a/dlls/ole32/tests/compobj.c b/dlls/ole32/tests/compobj.c index b30e9396a39..714fca8d26b 100644 --- a/dlls/ole32/tests/compobj.c +++ b/dlls/ole32/tests/compobj.c @@ -199,12 +199,12 @@ static void test_StringFromGUID2(void) /* Test corner cases for buffer size */ len = StringFromGUID2(&CLSID_StdFont,str,50); ok(len == 39, "len: %d (expected 39)\n", len); - ok(!lstrcmpiW(str, wszCLSID_StdFont),"string wan't equal for CLSID_StdFont\n"); + ok(!lstrcmpiW(str, wszCLSID_StdFont),"string wasn't equal for CLSID_StdFont\n"); memset(str,0,sizeof str); len = StringFromGUID2(&CLSID_StdFont,str,39); ok(len == 39, "len: %d (expected 39)\n", len); - ok(!lstrcmpiW(str, wszCLSID_StdFont),"string wan't equal for CLSID_StdFont\n"); + ok(!lstrcmpiW(str, wszCLSID_StdFont),"string wasn't equal for CLSID_StdFont\n"); len = StringFromGUID2(&CLSID_StdFont,str,38); ok(len == 0, "len: %d (expected 0)\n", len); diff --git a/dlls/oleacc/tests/main.c b/dlls/oleacc/tests/main.c index bd002944b0c..269c2f919d7 100644 --- a/dlls/oleacc/tests/main.c +++ b/dlls/oleacc/tests/main.c @@ -104,7 +104,7 @@ static void test_getroletext(void) CHAR buff2[100]; WCHAR buff2W[100]; - /* NT4 and W2K don't clear the buffer on a non existing role in the A-call */ + /* NT4 and W2K don't clear the buffer on a nonexistent role in the A-call */ memset(buff2, 0, sizeof(buff2)); ret = GetRoleTextA(role, NULL, 0); @@ -118,7 +118,7 @@ static void test_getroletext(void) ok(ret == lstrlenA(buff2), "GetRoleTextA: returned length doesn't match returned buffer for role %d\n", role); - /* Win98 and WinMe don't clear the buffer on a non existing role in the W-call */ + /* Win98 and WinMe don't clear the buffer on a nonexistent role in the W-call */ memset(buff2W, 0, sizeof(buff2W)); ret = GetRoleTextW(role, NULL, 0); diff --git a/dlls/oleaut32/varformat.c b/dlls/oleaut32/varformat.c index 79c305314bc..d76ceb5e08e 100644 --- a/dlls/oleaut32/varformat.c +++ b/dlls/oleaut32/varformat.c @@ -1532,7 +1532,6 @@ VARIANT_FormatNumber_Bool: } } count = min(count_max, pad); - count_max -= count; pad -= count; TRACE("write %d whole trailing 0's\n", count); while (count--) diff --git a/dlls/quartz/filtergraph.c b/dlls/quartz/filtergraph.c index 8b68d2f1f98..c53771edef5 100644 --- a/dlls/quartz/filtergraph.c +++ b/dlls/quartz/filtergraph.c @@ -204,6 +204,7 @@ typedef struct _IFilterGraphImpl { LONGLONG start_time; LONGLONG position; LONGLONG stop_position; + LONG recursioncount; } IFilterGraphImpl; static HRESULT WINAPI Filtergraph_QueryInterface(IFilterGraphImpl *This, @@ -898,9 +899,18 @@ static HRESULT WINAPI FilterGraph2_Connect(IFilterGraph2 *iface, IPin *ppinOut, IBaseFilter_Release(PinInfo.pFilter); } + EnterCriticalSection(&This->cs); + ++This->recursioncount; + if (This->recursioncount >= 5) + { + WARN("Recursion count has reached %d\n", This->recursioncount); + hr = VFW_E_CANNOT_CONNECT; + goto out; + } + hr = IPin_QueryDirection(ppinOut, &dir); if (FAILED(hr)) - return hr; + goto out; if (dir == PINDIR_INPUT) { @@ -913,42 +923,44 @@ static HRESULT WINAPI FilterGraph2_Connect(IFilterGraph2 *iface, IPin *ppinOut, hr = CheckCircularConnection(This, ppinOut, ppinIn); if (FAILED(hr)) - return hr; + goto out; /* Try direct connection first */ hr = IPin_Connect(ppinOut, ppinIn, NULL); - if (SUCCEEDED(hr)) { - return S_OK; - } + if (SUCCEEDED(hr)) + goto out; + TRACE("Direct connection failed, trying to render using extra filters\n"); hr = IPin_QueryPinInfo(ppinIn, &PinInfo); if (FAILED(hr)) - return hr; + goto out; hr = IBaseFilter_GetClassID(PinInfo.pFilter, &FilterCLSID); IBaseFilter_Release(PinInfo.pFilter); if (FAILED(hr)) - return hr; + goto out; /* Find the appropriate transform filter than can transform the minor media type of output pin of the upstream * filter to the minor mediatype of input pin of the renderer */ hr = IPin_EnumMediaTypes(ppinOut, &penummt); - if (FAILED(hr)) { + if (FAILED(hr)) + { WARN("EnumMediaTypes (%x)\n", hr); - return hr; + goto out; } hr = IEnumMediaTypes_Next(penummt, 1, &mt, &nbmt); if (FAILED(hr)) { WARN("IEnumMediaTypes_Next (%x)\n", hr); - return hr; + goto out; } if (!nbmt) { WARN("No media type found!\n"); - return S_OK; + hr = VFW_E_INVALIDMEDIATYPE; + goto out; } TRACE("MajorType %s\n", debugstr_guid(&mt->majortype)); TRACE("SubType %s\n", debugstr_guid(&mt->subtype)); @@ -959,7 +971,7 @@ static HRESULT WINAPI FilterGraph2_Connect(IFilterGraph2 *iface, IPin *ppinOut, hr = IFilterMapper2_EnumMatchingFilters(This->pFilterMapper2, &pEnumMoniker, 0, FALSE, MERIT_UNLIKELY, TRUE, 1, tab, NULL, NULL, FALSE, FALSE, 0, NULL, NULL, NULL); if (FAILED(hr)) { WARN("Unable to enum filters (%x)\n", hr); - return hr; + goto out; } hr = VFW_E_CANNOT_RENDER; @@ -1030,8 +1042,9 @@ static HRESULT WINAPI FilterGraph2_Connect(IFilterGraph2 *iface, IPin *ppinOut, if (SUCCEEDED(hr)) { unsigned int i; if (nb == 0) { - TRACE("Reached a renderer\n"); - break; + IPin_Disconnect(ppinfilter); + IPin_Disconnect(ppinOut); + goto error; } TRACE("pins to consider: %d\n", nb); for(i = 0; i < nb; i++) @@ -1085,6 +1098,9 @@ error: IEnumMediaTypes_Release(penummt); DeleteMediaType(mt); +out: + --This->recursioncount; + LeaveCriticalSection(&This->cs); TRACE("--> %08x\n", hr); return SUCCEEDED(hr) ? S_OK : hr; } @@ -5431,6 +5447,7 @@ HRESULT FilterGraph_create(IUnknown *pUnkOuter, LPVOID *ppObj) fimpl->start_time = fimpl->position = 0; fimpl->stop_position = -1; fimpl->punkFilterMapper2 = NULL; + fimpl->recursioncount = 0; /* create Filtermapper aggregated. */ hr = CoCreateInstance(&CLSID_FilterMapper2, pUnkOuter ? pUnkOuter : (IUnknown*)&fimpl->IInner_vtbl, CLSCTX_INPROC_SERVER, diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index 2e446638c57..33310a135c4 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -99,6 +99,7 @@ - EM_SETFONTSIZE - EM_SETIMECOLOR 1.0asian - EM_SETIMEOPTIONS 1.0asian + - EM_SETIMESTATUS - EM_SETLANGOPTIONS 2.0 - EM_SETLIMITTEXT - EM_SETMARGINS @@ -2507,7 +2508,9 @@ static const char * const edit_messages[] = { "EM_GETMARGINS", "EM_GETLIMITTEXT", "EM_POSFROMCHAR", - "EM_CHARFROMPOS" + "EM_CHARFROMPOS", + "EM_SETIMESTATUS", + "EM_GETIMESTATUS" }; static const char * const richedit_messages[] = { @@ -2623,7 +2626,8 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, UNSUPPORTED_MSG(EM_GETBIDIOPTIONS) UNSUPPORTED_MSG(EM_GETEDITSTYLE) UNSUPPORTED_MSG(EM_GETIMECOMPMODE) - /* UNSUPPORTED_MSG(EM_GETIMESTATUS) missing in Wine headers */ + UNSUPPORTED_MSG(EM_GETIMESTATUS) + UNSUPPORTED_MSG(EM_SETIMESTATUS) UNSUPPORTED_MSG(EM_GETLANGOPTIONS) /* UNSUPPORTED_MSG(EM_GETOLEINTERFACE) separate stub */ UNSUPPORTED_MSG(EM_GETREDONAME) @@ -4428,95 +4432,6 @@ LRESULT WINAPI REExtendedRegisterClass(void) return result; } -int ME_AutoURLDetect(ME_TextEditor *editor, WCHAR curChar) -{ - struct prefix_s { - const char *text; - int length; - } prefixes[12] = { - {"http:", 5}, - {"file:", 6}, - {"mailto:", 8}, - {"ftp:", 5}, - {"https:", 7}, - {"gopher:", 8}, - {"nntp:", 6}, - {"prospero:", 10}, - {"telnet:", 8}, - {"news:", 6}, - {"wais:", 6}, - {"www.", 5} - }; - CHARRANGE ins_pt; - int curf_ef, link_ef, def_ef; - int cur_prefx, prefx_cnt; - int sel_min, sel_max; - int car_pos = 0; - int text_pos=-1; - int URLmin, URLmax = 0; - FINDTEXTA ft; - CHARFORMAT2W cur_format; - CHARFORMAT2W default_format; - CHARFORMAT2W link; - RichEditANSIWndProc(editor->hWnd, EM_EXGETSEL, (WPARAM) 0, (LPARAM) &ins_pt); - sel_min = ins_pt.cpMin; - sel_max = ins_pt.cpMax; - if (sel_min==sel_max) - car_pos = sel_min; - if (sel_min!=sel_max) - car_pos = ME_GetTextLength(editor)+1; - cur_format.cbSize = sizeof(cur_format); - default_format.cbSize = sizeof(default_format); - RichEditANSIWndProc(editor->hWnd, EM_GETCHARFORMAT, SCF_SELECTION, (LPARAM) &cur_format); - RichEditANSIWndProc(editor->hWnd, EM_GETCHARFORMAT, SCF_DEFAULT, (LPARAM) &default_format); - link.cbSize = sizeof(link); - link.dwMask = CFM_LINK; - link.dwEffects = CFE_LINK; - curf_ef = cur_format.dwEffects & link.dwEffects; - def_ef = default_format.dwEffects & link.dwEffects; - link_ef = link.dwEffects & link.dwEffects; - if (curf_ef == link_ef) - { - if( curChar == '\n' || curChar=='\r' || curChar==' ') - { - ME_SetSelection(editor, car_pos, car_pos); - RichEditANSIWndProc(editor->hWnd, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM) &default_format); - text_pos=-1; - return 0; - } - } - if (curf_ef == def_ef) - { - cur_prefx = 0; - prefx_cnt = (sizeof(prefixes)/sizeof(struct prefix_s))-1; - while (cur_prefx<=prefx_cnt) - { - if (text_pos == -1) - { - ft.lpstrText = prefixes[cur_prefx].text; - URLmin=max(0,(car_pos-prefixes[cur_prefx].length)); - URLmax=max(0, car_pos); - if ((car_pos == 0) && (ME_GetTextLength(editor) != 0)) - { - URLmax = ME_GetTextLength(editor)+1; - } - ft.chrg.cpMin = URLmin; - ft.chrg.cpMax = URLmax; - text_pos=RichEditANSIWndProc(editor->hWnd, EM_FINDTEXT, FR_DOWN, (LPARAM)&ft); - cur_prefx++; - } - if (text_pos != -1) - { - ME_SetCharFormat(editor, text_pos, (URLmax-text_pos), &link); - ME_RewrapRepaint(editor); - break; - } - } - } - return 0; -} - - static BOOL isurlspecial(WCHAR c) { static const WCHAR special_chars[] = {'.','/','%','@','*','|','\\','+','#',0}; diff --git a/dlls/riched20/editor.h b/dlls/riched20/editor.h index 2c683786e78..b3918bf203d 100644 --- a/dlls/riched20/editor.h +++ b/dlls/riched20/editor.h @@ -268,8 +268,6 @@ void ME_GetOLEObjectSize(ME_Context *c, ME_Run *run, SIZE *pSize); void ME_CopyReObject(REOBJECT* dst, const REOBJECT* src); void ME_DeleteReObject(REOBJECT* reo); -/* wintest.c */ - /* editor.c */ ME_TextEditor *ME_MakeEditor(HWND hWnd); void ME_DestroyEditor(ME_TextEditor *editor); @@ -282,7 +280,6 @@ void ME_RTFParAttrHook(struct _RTF_Info *info); void ME_RTFTblAttrHook(struct _RTF_Info *info); void ME_RTFSpecialCharHook(struct _RTF_Info *info); void ME_StreamInFill(ME_InStream *stream); -int ME_AutoURLDetect(ME_TextEditor *editor, WCHAR curChar); extern int me_debug; extern void DoWrap(ME_TextEditor *editor); extern BOOL ME_FindNextURLCandidate(ME_TextEditor *editor, int sel_min, int sel_max, diff --git a/dlls/riched20/run.c b/dlls/riched20/run.c index bb34ad864ed..133219d37b8 100644 --- a/dlls/riched20/run.c +++ b/dlls/riched20/run.c @@ -872,8 +872,6 @@ static void ME_GetRunCharFormat(ME_TextEditor *editor, ME_DisplayItem *run, CHAR */ void ME_GetDefaultCharFormat(ME_TextEditor *editor, CHARFORMAT2W *pFmt) { - int nFrom, nTo; - ME_GetSelection(editor, &nFrom, &nTo); ME_CopyCharFormat(pFmt, &editor->pBuffer->pDefaultStyle->fmt); } diff --git a/dlls/rpcrt4/rpc_transport.c b/dlls/rpcrt4/rpc_transport.c index 3d667407900..815ed64c19e 100644 --- a/dlls/rpcrt4/rpc_transport.c +++ b/dlls/rpcrt4/rpc_transport.c @@ -479,7 +479,6 @@ static size_t rpcrt4_ncacn_np_get_top_of_tower(unsigned char *tower_data, memcpy(tower_data, networkaddr, networkaddr_size); else tower_data[0] = 0; - tower_data += networkaddr_size; return size; } @@ -692,7 +691,6 @@ static size_t rpcrt4_ncalrpc_get_top_of_tower(unsigned char *tower_data, pipe_floor->count_rhs = endpoint_size; memcpy(tower_data, endpoint, endpoint_size); - tower_data += endpoint_size; return size; } diff --git a/dlls/rpcrt4/tests/rpc.c b/dlls/rpcrt4/tests/rpc.c index 61155bda09d..796e40845ea 100644 --- a/dlls/rpcrt4/tests/rpc.c +++ b/dlls/rpcrt4/tests/rpc.c @@ -262,7 +262,8 @@ todo_wine { status = RpcBindingSetAuthInfo(IFoo_IfHandle, NULL, RPC_C_AUTHN_LEVEL_NONE, RPC_C_AUTHN_WINNT, NULL, RPC_C_AUTHZ_NAME); - ok(status == RPC_S_OK, "RpcBindingSetAuthInfo failed (%lu)\n", status); + ok(status == RPC_S_OK || broken(status == RPC_S_UNKNOWN_AUTHN_SERVICE), /* win9x */ + "RpcBindingSetAuthInfo failed (%lu)\n", status); status = RpcMgmtStopServerListening(NULL); ok(status == RPC_S_OK, "RpcMgmtStopServerListening failed (%lu)\n", @@ -689,7 +690,8 @@ static void test_endpoint_mapper(RPC_CSTR protseq, RPC_CSTR address, unsigned char *binding; status = RpcServerUseProtseqEp(protseq, 20, endpoint, NULL); - ok(status == RPC_S_OK, "%s: RpcServerUseProtseqEp failed (%lu)\n", protseq, status); + ok(status == RPC_S_OK || broken(status == RPC_S_PROTSEQ_NOT_SUPPORTED), /* win9x */ + "%s: RpcServerUseProtseqEp failed (%lu)\n", protseq, status); status = RpcServerRegisterIf(IFoo_v0_0_s_ifspec, NULL, NULL); ok(status == RPC_S_OK, "%s: RpcServerRegisterIf failed (%lu)\n", protseq, status); @@ -715,7 +717,8 @@ static void test_endpoint_mapper(RPC_CSTR protseq, RPC_CSTR address, RpcStringFree(&binding); status = RpcEpResolveBinding(handle, IFoo_v0_0_s_ifspec); - ok(status == RPC_S_OK, "%s: RpcEpResolveBinding failed with error %lu\n", protseq, status); + ok(status == RPC_S_OK || broken(status == RPC_S_SERVER_UNAVAILABLE), /* win9x */ + "%s: RpcEpResolveBinding failed with error %lu\n", protseq, status); status = RpcBindingReset(handle); ok(status == RPC_S_OK, "%s: RpcBindingReset failed with error %lu\n", protseq, status); diff --git a/dlls/sane.ds/ds_image.c b/dlls/sane.ds/ds_image.c index c3e70821d03..9a88bb5dcb7 100644 --- a/dlls/sane.ds/ds_image.c +++ b/dlls/sane.ds/ds_image.c @@ -100,8 +100,15 @@ TW_UINT16 SANE_ImageInfoGet (pTW_IDENTITY pOrigin, { /* return general image description information about the image about to be transferred */ status = psane_get_parameters (activeDS.deviceHandle, &activeDS.sane_param); - activeDS.sane_param_valid = TRUE; TRACE("Getting parameters\n"); + if (status != SANE_STATUS_GOOD) + { + WARN("psane_get_parameters: %s\n", psane_strstatus (status)); + psane_cancel (activeDS.deviceHandle); + activeDS.twCC = TWCC_OPERATIONERROR; + return TWRC_FAILURE; + } + activeDS.sane_param_valid = TRUE; } pImageInfo->XResolution.Whole = -1; diff --git a/dlls/shdocvw/Makefile.in b/dlls/shdocvw/Makefile.in index 764b4c6a4a1..0fd59c5851f 100644 --- a/dlls/shdocvw/Makefile.in +++ b/dlls/shdocvw/Makefile.in @@ -5,7 +5,7 @@ SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = shdocvw.dll IMPORTLIB = shdocvw -IMPORTS = uuid shell32 shlwapi user32 advapi32 kernel32 +IMPORTS = uuid shell32 shlwapi user32 gdi32 advapi32 kernel32 DELAYIMPORTS = version urlmon ole32 oleaut32 C_SRCS = \ diff --git a/dlls/shdocvw/intshcut.c b/dlls/shdocvw/intshcut.c index 01da03e89f9..fd5e5bf1c52 100644 --- a/dlls/shdocvw/intshcut.c +++ b/dlls/shdocvw/intshcut.c @@ -329,7 +329,7 @@ static HRESULT WINAPI PersistFile_Load(IPersistFile *pFile, LPCOLESTR pszFileNam { DWORD len = 128; DWORD r; - WCHAR *url = CoTaskMemAlloc(len); + WCHAR *url = CoTaskMemAlloc(len*sizeof(WCHAR)); if (url != NULL) { r = GetPrivateProfileStringW(str_header, str_URL, NULL, url, len, pszFileName); diff --git a/dlls/shdocvw/oleobject.c b/dlls/shdocvw/oleobject.c index 70a163da72b..198ff2a7d0f 100644 --- a/dlls/shdocvw/oleobject.c +++ b/dlls/shdocvw/oleobject.c @@ -890,6 +890,16 @@ static const IOleCommandTargetVtbl OleCommandTargetVtbl = { void WebBrowser_OleObject_Init(WebBrowser *This) { + DWORD dpi_x; + DWORD dpi_y; + HDC hdc; + + /* default aspect ratio is 96dpi / 96dpi */ + hdc = GetDC(0); + dpi_x = GetDeviceCaps(hdc, LOGPIXELSX); + dpi_y = GetDeviceCaps(hdc, LOGPIXELSY); + ReleaseDC(0, hdc); + This->lpOleObjectVtbl = &OleObjectVtbl; This->lpOleInPlaceObjectVtbl = &OleInPlaceObjectVtbl; This->lpOleControlVtbl = &OleControlVtbl; @@ -907,8 +917,9 @@ void WebBrowser_OleObject_Init(WebBrowser *This) memset(&This->clip_rect, 0, sizeof(RECT)); memset(&This->frameinfo, 0, sizeof(OLEINPLACEFRAMEINFO)); - This->extent.cx = 1323; - This->extent.cy = 529; + /* Default size is 50x20 pixels, in himetric units */ + This->extent.cx = MulDiv( 50, 2540, dpi_x ); + This->extent.cy = MulDiv( 20, 2540, dpi_y ); } void WebBrowser_OleObject_Destroy(WebBrowser *This) diff --git a/dlls/shdocvw/tests/Makefile.in b/dlls/shdocvw/tests/Makefile.in index e20f8edbe1b..5ab9b5a12df 100644 --- a/dlls/shdocvw/tests/Makefile.in +++ b/dlls/shdocvw/tests/Makefile.in @@ -3,7 +3,7 @@ TOPOBJDIR = ../../.. SRCDIR = @srcdir@ VPATH = @srcdir@ TESTDLL = shdocvw.dll -IMPORTS = shell32 ole32 oleaut32 user32 advapi32 kernel32 +IMPORTS = shell32 ole32 oleaut32 user32 gdi32 advapi32 kernel32 CTESTS = \ intshcut.c \ diff --git a/dlls/shdocvw/tests/webbrowser.c b/dlls/shdocvw/tests/webbrowser.c index dad9527430b..76dfbf7e785 100644 --- a/dlls/shdocvw/tests/webbrowser.c +++ b/dlls/shdocvw/tests/webbrowser.c @@ -1814,8 +1814,19 @@ static void test_GetControlInfo(IUnknown *unk) static void test_Extent(IUnknown *unk) { IOleObject *oleobj; - SIZE size; + SIZE size, expected; HRESULT hres; + DWORD dpi_x; + DWORD dpi_y; + HDC hdc; + + /* default aspect ratio is 96dpi / 96dpi */ + hdc = GetDC(0); + dpi_x = GetDeviceCaps(hdc, LOGPIXELSX); + dpi_y = GetDeviceCaps(hdc, LOGPIXELSY); + ReleaseDC(0, hdc); + if (dpi_x != 96 || dpi_y != 96) + trace("dpi: %d / %d\n", dpi_y, dpi_y); hres = IUnknown_QueryInterface(unk, &IID_IOleObject, (void**)&oleobj); ok(hres == S_OK, "Could not get IOleObkect: %08x\n", hres); @@ -1825,7 +1836,11 @@ static void test_Extent(IUnknown *unk) size.cx = size.cy = 0xdeadbeef; hres = IOleObject_GetExtent(oleobj, DVASPECT_CONTENT, &size); ok(hres == S_OK, "GetExtent failed: %08x\n", hres); - ok(size.cx == 1323 && size.cy == 529, "size = {%d %d}\n", size.cx, size.cy); + /* Default size is 50x20 pixels, in himetric units */ + expected.cx = MulDiv( 50, 2540, dpi_x ); + expected.cy = MulDiv( 20, 2540, dpi_y ); + ok(size.cx == expected.cx && size.cy == expected.cy, "size = {%d %d} (expected %d %d)\n", + size.cx, size.cy, expected.cx, expected.cy ); size.cx = 800; size.cy = 700; diff --git a/dlls/shell32/tests/systray.c b/dlls/shell32/tests/systray.c index 56758068453..23a6614b55c 100644 --- a/dlls/shell32/tests/systray.c +++ b/dlls/shell32/tests/systray.c @@ -31,6 +31,7 @@ static BOOL (WINAPI *pShell_NotifyIconW)(DWORD,PNOTIFYICONDATAW); void test_cbsize(void) { NOTIFYICONDATAA nidA; + BOOL ret; if (pShell_NotifyIconW) { @@ -43,16 +44,20 @@ void test_cbsize(void) nidW.uFlags = NIF_ICON|NIF_MESSAGE; nidW.hIcon = LoadIcon(NULL, IDI_APPLICATION); nidW.uCallbackMessage = WM_USER+17; - ok(pShell_NotifyIconW(NIM_ADD, &nidW), "NIM_ADD failed!\n"); - - /* using an invalid cbSize does work */ - nidW.cbSize = 3; - nidW.hWnd = hMainWnd; - nidW.uID = 1; - ok(pShell_NotifyIconW(NIM_DELETE, &nidW), "NIM_DELETE failed!\n"); - /* as icon doesn't exist anymore - now there will be an error */ - nidW.cbSize = sizeof(nidW); - ok(!pShell_NotifyIconW(NIM_DELETE, &nidW), "The icon was not deleted\n"); + ret = pShell_NotifyIconW(NIM_ADD, &nidW); + if (ret) + { + /* using an invalid cbSize does work */ + nidW.cbSize = 3; + nidW.hWnd = hMainWnd; + nidW.uID = 1; + ret = pShell_NotifyIconW(NIM_DELETE, &nidW); + ok( ret || broken(!ret), /* nt4 */ "NIM_DELETE failed!\n"); + /* as icon doesn't exist anymore - now there will be an error */ + nidW.cbSize = sizeof(nidW); + ok(!pShell_NotifyIconW(NIM_DELETE, &nidW) != !ret, "The icon was not deleted\n"); + } + else win_skip( "Shell_NotifyIconW not working\n" ); /* win9x */ } /* same for Shell_NotifyIconA */ @@ -69,10 +74,11 @@ void test_cbsize(void) nidA.cbSize = 3; nidA.hWnd = hMainWnd; nidA.uID = 1; - ok(Shell_NotifyIconA(NIM_DELETE, &nidA), "NIM_DELETE failed!\n"); + ret = Shell_NotifyIconA(NIM_DELETE, &nidA); + ok( ret || broken(!ret), /* win9x */ "NIM_DELETE failed!\n"); /* as icon doesn't exist anymore - now there will be an error */ nidA.cbSize = sizeof(nidA); - ok(!Shell_NotifyIconA(NIM_DELETE, &nidA), "The icon was not deleted\n"); + ok(!Shell_NotifyIconA(NIM_DELETE, &nidA) != !ret, "The icon was not deleted\n"); } START_TEST(systray) diff --git a/dlls/urlmon/tests/url.c b/dlls/urlmon/tests/url.c index 48c25137a37..631127b62e2 100644 --- a/dlls/urlmon/tests/url.c +++ b/dlls/urlmon/tests/url.c @@ -161,6 +161,7 @@ static CHAR mime_type[512]; static IInternetProtocolSink *protocol_sink = NULL; static HANDLE complete_event, complete_event2; static HRESULT binding_hres; +static BOOL have_IHttpNegotiate2; static LPCWSTR urls[] = { WINE_ABOUT_URL, @@ -1826,6 +1827,7 @@ static void test_bscholder(IBindStatusCallback *holder) hres = IBindStatusCallback_QueryInterface(holder, &IID_IHttpNegotiate2, (void**)&http_negotiate2); if(SUCCEEDED(hres)) { + have_IHttpNegotiate2 = TRUE; hres = IHttpNegotiate2_GetRootSecurityId(http_negotiate2, (void*)0xdeadbeef, (void*)0xdeadbeef, 0); ok(hres == E_FAIL, "GetRootSecurityId failed: %08x\n", hres); @@ -2115,10 +2117,11 @@ static void test_BindToStorage(int protocol, BOOL emul, DWORD t) CLEAR_CALLED(QueryService_IInternetBindInfo); CHECK_CALLED(QueryInterface_IHttpNegotiate); CHECK_CALLED(BeginningTransaction); - /* QueryInterface_IHttpNegotiate2 and GetRootSecurityId - * called on WinXP but not on Win98 */ - CLEAR_CALLED(QueryInterface_IHttpNegotiate2); - CLEAR_CALLED(GetRootSecurityId); + if (have_IHttpNegotiate2) + { + CHECK_CALLED(QueryInterface_IHttpNegotiate2); + CHECK_CALLED(GetRootSecurityId); + } if(http_is_first) { CHECK_CALLED(OnProgress_FINDINGRESOURCE); CHECK_CALLED(OnProgress_CONNECTING); @@ -2275,10 +2278,11 @@ static void test_BindToObject(int protocol, BOOL emul) if(test_protocol == HTTP_TEST) { CHECK_CALLED(QueryInterface_IHttpNegotiate); CHECK_CALLED(BeginningTransaction); - /* QueryInterface_IHttpNegotiate2 and GetRootSecurityId - * called on WinXP but not on Win98 */ - CLEAR_CALLED(QueryInterface_IHttpNegotiate2); - CLEAR_CALLED(GetRootSecurityId); + if (have_IHttpNegotiate2) + { + CHECK_CALLED(QueryInterface_IHttpNegotiate2); + CHECK_CALLED(GetRootSecurityId); + } if(http_is_first) { CHECK_CALLED(Obj_OnProgress_FINDINGRESOURCE); CHECK_CALLED(Obj_OnProgress_CONNECTING); @@ -2384,8 +2388,11 @@ static void test_URLDownloadToFile(DWORD prot, BOOL emul) if(test_protocol == HTTP_TEST) { CHECK_CALLED(QueryInterface_IHttpNegotiate); CHECK_CALLED(BeginningTransaction); - CHECK_CALLED(QueryInterface_IHttpNegotiate2); - CHECK_CALLED(GetRootSecurityId); + if (have_IHttpNegotiate2) + { + CHECK_CALLED(QueryInterface_IHttpNegotiate2); + CHECK_CALLED(GetRootSecurityId); + } } if(test_protocol == FILE_TEST) CHECK_CALLED(OnProgress_SENDINGREQUEST); diff --git a/dlls/user32/cursoricon.c b/dlls/user32/cursoricon.c index d8543516611..26676de3e66 100644 --- a/dlls/user32/cursoricon.c +++ b/dlls/user32/cursoricon.c @@ -698,6 +698,13 @@ static HICON CURSORICON_CreateIconFromBMI( BITMAPINFO *bmi, DoStretch = (bmi->bmiHeader.biHeight/2 != height) || (bmi->bmiHeader.biWidth != width); + /* Scale the hotspot */ + if (DoStretch && hotspot.x != ICON_HOTSPOT && hotspot.y != ICON_HOTSPOT) + { + hotspot.x = (hotspot.x * width) / bmi->bmiHeader.biWidth; + hotspot.y = (hotspot.y * height) / (bmi->bmiHeader.biHeight / 2); + } + if (!screen_dc) screen_dc = CreateDCW( DISPLAYW, NULL, NULL, NULL ); if (screen_dc) { @@ -723,14 +730,7 @@ static HICON CURSORICON_CreateIconFromBMI( BITMAPINFO *bmi, /* Create the XOR bitmap */ if (DoStretch) { - if(bIcon) - { - hXorBits = CreateCompatibleBitmap(screen_dc, width, height); - } - else - { - hXorBits = CreateBitmap(width, height, 1, 1, NULL); - } + hXorBits = CreateCompatibleBitmap(screen_dc, width, height); if(hXorBits) { HBITMAP hOld; @@ -1005,7 +1005,7 @@ static HCURSOR CURSORICON_CreateIconFromANI( const LPBYTE bits, DWORD bits_size, * cursors and then update user32 and winex11.drv to load all frames. * * Hopefully this will at least make some games (C&C3, etc.) more playable - * in the mean time. + * in the meantime. */ FIXME("Loading all frames for .ani cursors not implemented.\n"); icon_data = fram_chunk.data + (2 * sizeof(DWORD)); diff --git a/dlls/user32/focus.c b/dlls/user32/focus.c index 3253a870d4c..36f44f36971 100644 --- a/dlls/user32/focus.c +++ b/dlls/user32/focus.c @@ -276,6 +276,9 @@ HWND WINAPI SetFocus( HWND hwnd ) { if (!set_active_window( hwndTop, NULL, FALSE, FALSE )) return 0; if (!IsWindow( hwnd )) return 0; /* Abort if window destroyed */ + + /* Do not change focus if the window is no longer active */ + if (hwndTop != GetActiveWindow()) return 0; } } else /* NULL hwnd passed in */ diff --git a/dlls/user32/nonclient.c b/dlls/user32/nonclient.c index 3fa870e63a1..708ed8095a8 100644 --- a/dlls/user32/nonclient.c +++ b/dlls/user32/nonclient.c @@ -417,6 +417,9 @@ LRESULT NC_HandleNCCalcSize( HWND hwnd, RECT *winRect ) LONG style = GetWindowLongW( hwnd, GWL_STYLE ); LONG exStyle = GetWindowLongW( hwnd, GWL_EXSTYLE ); + if (winRect == NULL) + return 0; + if (cls_style & CS_VREDRAW) result |= WVR_VREDRAW; if (cls_style & CS_HREDRAW) result |= WVR_HREDRAW; diff --git a/dlls/user32/spy.c b/dlls/user32/spy.c index 9fbd74b3503..2aed05755e3 100644 --- a/dlls/user32/spy.c +++ b/dlls/user32/spy.c @@ -236,7 +236,9 @@ static const char * const MessageTypeNames[SPY_MAX_MSGNUM + 1] = "EM_GETLIMITTEXT", /* 0x00d5 */ "EM_POSFROMCHAR", /* 0x00d6 */ "EM_CHARFROMPOS", /* 0x00d7 */ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + "EM_SETIMESTATUS", /* 0x00d8 */ + "EM_GETIMESTATUS", /* 0x00d9 */ + NULL, NULL, NULL, NULL, NULL, NULL, /* 0x00E0 - Win32 Scrollbars */ "SBM_SETPOS", /* 0x00e0 */ diff --git a/dlls/user32/tests/broadcast.c b/dlls/user32/tests/broadcast.c index 0b2c2d6fe8f..ae9cd29ee65 100644 --- a/dlls/user32/tests/broadcast.c +++ b/dlls/user32/tests/broadcast.c @@ -150,23 +150,29 @@ static void test_parameters(PBROADCAST broadcast, const char *functionname) ok(WaitForSingleObject(hevent, 0) != WAIT_TIMEOUT, "Asynchronous message sent instead\n"); PulseEvent(hevent); + SetLastError( 0xdeadbeef ); recips = BSM_APPLICATIONS; ret = broadcast( BSF_POSTMESSAGE|BSF_SENDNOTIFYMESSAGE, &recips, WM_NULL, 100, 0 ); - ok(ret==1, "Returned: %d\n", ret); - ok(WaitForSingleObject(hevent, 0) != WAIT_OBJECT_0, "Synchronous message sent instead\n"); - PulseEvent(hevent); - - recips = BSM_APPLICATIONS; - ret = broadcast( BSF_SENDNOTIFYMESSAGE, &recips, WM_NULL, 100, BROADCAST_QUERY_DENY ); - ok(ret==1, "Returned: %d\n", ret); - ok(WaitForSingleObject(hevent, 0) != WAIT_TIMEOUT, "Asynchronous message sent instead\n"); - PulseEvent(hevent); - - recips = BSM_APPLICATIONS; - ret = broadcast( BSF_SENDNOTIFYMESSAGE|BSF_QUERY, &recips, WM_NULL, 100, BROADCAST_QUERY_DENY ); - ok(!ret, "Returned: %d\n", ret); - ok(WaitForSingleObject(hevent, 0) != WAIT_TIMEOUT, "Asynchronous message sent instead\n"); - PulseEvent(hevent); + if (ret) + { + ok(ret==1, "Returned: %d\n", ret); + ok(WaitForSingleObject(hevent, 0) != WAIT_OBJECT_0, "Synchronous message sent instead\n"); + PulseEvent(hevent); + + recips = BSM_APPLICATIONS; + ret = broadcast( BSF_SENDNOTIFYMESSAGE, &recips, WM_NULL, 100, BROADCAST_QUERY_DENY ); + ok(ret==1, "Returned: %d\n", ret); + ok(WaitForSingleObject(hevent, 0) != WAIT_TIMEOUT, "Asynchronous message sent instead\n"); + PulseEvent(hevent); + + recips = BSM_APPLICATIONS; + ret = broadcast( BSF_SENDNOTIFYMESSAGE|BSF_QUERY, &recips, WM_NULL, 100, BROADCAST_QUERY_DENY ); + ok(!ret, "Returned: %d\n", ret); + ok(WaitForSingleObject(hevent, 0) != WAIT_TIMEOUT, "Asynchronous message sent instead\n"); + PulseEvent(hevent); + } + else /* BSF_SENDNOTIFYMESSAGE not supported on NT4 */ + ok( GetLastError() == ERROR_INVALID_PARAMETER, "failed with err %u\n", GetLastError() ); recips = BSM_APPLICATIONS; ret = broadcast( 0, &recips, WM_NULL, 100, 0 ); diff --git a/dlls/user32/tests/cursoricon.c b/dlls/user32/tests/cursoricon.c index 36f5e98d443..5d1cf2bde1e 100644 --- a/dlls/user32/tests/cursoricon.c +++ b/dlls/user32/tests/cursoricon.c @@ -76,7 +76,7 @@ static LRESULT CALLBACK callback_child(HWND hwnd, UINT msg, WPARAM wParam, LPARA SetLastError(0xdeadbeef); ret = DestroyCursor((HCURSOR) lParam); error = GetLastError(); - todo_wine ok(!ret, "DestroyCursor on the active cursor succeeded.\n"); + todo_wine ok(!ret || broken(ret) /* win9x */, "DestroyCursor on the active cursor succeeded.\n"); ok(error == ERROR_DESTROY_OBJECT_OF_OTHER_THREAD || error == 0xdeadbeef, /* vista */ "Last error: %u\n", error); @@ -983,25 +983,26 @@ static void test_DestroyCursor(void) SetLastError(0xdeadbeef); ret = DestroyCursor(cursor); - ok(!ret, "DestroyCursor on the active cursor succeeded\n"); + ok(!ret || broken(ret) /* succeeds on win9x */, "DestroyCursor on the active cursor succeeded\n"); error = GetLastError(); ok(error == 0xdeadbeef, "Last error: %u\n", error); - - cursor2 = GetCursor(); - ok(cursor2 == cursor, "Active was set to %p when trying to destroy it\n", cursor2); - - SetCursor(NULL); - - /* Trying to destroy the cursor properly fails now with - * ERROR_INVALID_CURSOR_HANDLE. This happens because we called - * DestroyCursor() 2+ times after calling SetCursor(). The calls to - * GetCursor() and SetCursor(NULL) in between make no difference. */ - ret = DestroyCursor(cursor); - todo_wine { - ok(!ret, "DestroyCursor succeeded.\n"); - error = GetLastError(); - ok(error == ERROR_INVALID_CURSOR_HANDLE || error == 0xdeadbeef, /* vista */ - "Last error: 0x%08x\n", error); + if (!ret) + { + cursor2 = GetCursor(); + ok(cursor2 == cursor, "Active was set to %p when trying to destroy it\n", cursor2); + SetCursor(NULL); + + /* Trying to destroy the cursor properly fails now with + * ERROR_INVALID_CURSOR_HANDLE. This happens because we called + * DestroyCursor() 2+ times after calling SetCursor(). The calls to + * GetCursor() and SetCursor(NULL) in between make no difference. */ + ret = DestroyCursor(cursor); + todo_wine { + ok(!ret, "DestroyCursor succeeded.\n"); + error = GetLastError(); + ok(error == ERROR_INVALID_CURSOR_HANDLE || error == 0xdeadbeef, /* vista */ + "Last error: 0x%08x\n", error); + } } DeleteObject(cursorInfo.hbmMask); @@ -1012,7 +1013,7 @@ static void test_DestroyCursor(void) SetLastError(0xdeadbeef); ret = DestroyCursor(cursor); - ok(ret, "DestroyCursor on the active cursor failed.\n"); + ok(ret || broken(!ret) /* fails on win9x */, "DestroyCursor on the active cursor failed.\n"); error = GetLastError(); ok(error == 0xdeadbeef, "Last error: 0x%08x\n", error); diff --git a/dlls/user32/tests/edit.c b/dlls/user32/tests/edit.c index b70dae53c31..f6dc918240f 100644 --- a/dlls/user32/tests/edit.c +++ b/dlls/user32/tests/edit.c @@ -1336,30 +1336,41 @@ static void test_margins_font_change(void) SendMessageA(hwEdit, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(0,0)); SendMessageA(hwEdit, WM_SETFONT, (WPARAM)hfont, 0); margins = SendMessage(hwEdit, EM_GETMARGINS, 0, 0); - ok(LOWORD(margins) == 0, "got %d\n", LOWORD(margins)); - ok(HIWORD(margins) == 0, "got %d\n", HIWORD(margins)); - + ok(LOWORD(margins) == 0 || broken(LOWORD(margins) == LOWORD(font_margins)), /* win95 */ + "got %d\n", LOWORD(margins)); + ok(HIWORD(margins) == 0 || broken(HIWORD(margins) == HIWORD(font_margins)), /* win95 */ + "got %d\n", HIWORD(margins)); + SendMessageA(hwEdit, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(1,0)); SendMessageA(hwEdit, WM_SETFONT, (WPARAM)hfont, 0); margins = SendMessage(hwEdit, EM_GETMARGINS, 0, 0); - ok(LOWORD(margins) == 1, "got %d\n", LOWORD(margins)); - ok(HIWORD(margins) == 0, "got %d\n", HIWORD(margins)); + ok(LOWORD(margins) == 1 || broken(LOWORD(margins) == LOWORD(font_margins)), /* win95 */ + "got %d\n", LOWORD(margins)); + ok(HIWORD(margins) == 0 || broken(HIWORD(margins) == HIWORD(font_margins)), /* win95 */ + "got %d\n", HIWORD(margins)); SendMessageA(hwEdit, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(1,1)); SendMessageA(hwEdit, WM_SETFONT, (WPARAM)hfont, 0); margins = SendMessage(hwEdit, EM_GETMARGINS, 0, 0); - ok(LOWORD(margins) == 1, "got %d\n", LOWORD(margins)); - ok(HIWORD(margins) == 1, "got %d\n", HIWORD(margins)); + ok(LOWORD(margins) == 1 || broken(LOWORD(margins) == LOWORD(font_margins)), /* win95 */ + "got %d\n", LOWORD(margins)); + ok(HIWORD(margins) == 1 || broken(HIWORD(margins) == HIWORD(font_margins)), /* win95 */ + "got %d\n", HIWORD(margins)); SendMessageA(hwEdit, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(EC_USEFONTINFO,EC_USEFONTINFO)); margins = SendMessage(hwEdit, EM_GETMARGINS, 0, 0); - ok(LOWORD(margins) == 1, "got %d\n", LOWORD(margins)); - ok(HIWORD(margins) == 1, "got %d\n", HIWORD(margins)); + ok(LOWORD(margins) == 1 || broken(LOWORD(margins) == LOWORD(font_margins)), /* win95 */ + "got %d\n", LOWORD(margins)); + ok(HIWORD(margins) == 1 || broken(HIWORD(margins) == HIWORD(font_margins)), /* win95 */ + "got %d\n", HIWORD(margins)); + SendMessageA(hwEdit, WM_SETFONT, (WPARAM)hfont2, 0); margins = SendMessage(hwEdit, EM_GETMARGINS, 0, 0); - ok(LOWORD(margins) == 1, "got %d\n", LOWORD(margins)); - ok(HIWORD(margins) == 1, "got %d\n", HIWORD(margins)); - + ok(LOWORD(margins) == 1 || broken(LOWORD(margins) != 1 && LOWORD(margins) != LOWORD(font_margins)), /* win95 */ + "got %d\n", LOWORD(margins)); + ok(HIWORD(margins) == 1 || broken(HIWORD(margins) != 1 && HIWORD(margins) != HIWORD(font_margins)), /* win95 */ + "got %d\n", HIWORD(margins)); + /* Above a certain size threshold then the margin is updated */ SetWindowPos(hwEdit, NULL, 10, 10, 1000, 100, SWP_NOZORDER | SWP_NOACTIVATE); SendMessageA(hwEdit, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(1,0)); @@ -1380,7 +1391,8 @@ static void test_margins_font_change(void) ok(HIWORD(margins) == HIWORD(font_margins), "got %d\n", HIWORD(margins)); SendMessageA(hwEdit, WM_SETFONT, (WPARAM)hfont2, 0); margins = SendMessage(hwEdit, EM_GETMARGINS, 0, 0); - ok(LOWORD(margins) != LOWORD(font_margins), "got %d\n", LOWORD(margins)); + ok(LOWORD(margins) != LOWORD(font_margins) || broken(LOWORD(margins) == LOWORD(font_margins)), /* win98 */ + "got %d\n", LOWORD(margins)); ok(HIWORD(margins) != HIWORD(font_margins), "got %d\n", HIWORD(margins)); SendMessageA(hwEdit, WM_SETFONT, 0, 0); diff --git a/dlls/user32/tests/listbox.c b/dlls/user32/tests/listbox.c index 06cb44acf76..c8723576335 100644 --- a/dlls/user32/tests/listbox.c +++ b/dlls/user32/tests/listbox.c @@ -557,7 +557,7 @@ static void test_listbox_item_data(void) DestroyWindow( hList ); } -static void test_listbox_LB_DIR() +static void test_listbox_LB_DIR(void) { HWND hList; int res, itemCount; @@ -650,9 +650,10 @@ static void test_listbox_LB_DIR() strcpy(pathBuffer, "*"); SendMessage(hList, LB_RESETCONTENT, 0, 0); res = SendMessage(hList, LB_DIR, DDL_DIRECTORY, (LPARAM)pathBuffer); - if (res == -1) /* "*" wildcard doesn't work on win9x */ + if (res == -1 || res <= itemCount_allFiles) /* "*" wildcard doesn't work on win9x */ { strcpy(pathBuffer, "*.*"); + SendMessage(hList, LB_RESETCONTENT, 0, 0); res = SendMessage(hList, LB_DIR, DDL_DIRECTORY, (LPARAM)pathBuffer); } ok (res > 0, "SendMessage(LB_DIR, DDL_DIRECTORY, *) failed - 0x%08x\n", GetLastError()); @@ -713,7 +714,7 @@ static void test_listbox_LB_DIR() strcpy(pathBuffer, "*"); SendMessage(hList, LB_RESETCONTENT, 0, 0); res = SendMessage(hList, LB_DIR, DDL_DRIVES|DDL_EXCLUSIVE, (LPARAM)pathBuffer); - ok (res > 0, "SendMessage(LB_DIR, DDL_DRIVES|DDL_EXCLUSIVE, *) failed - 0x%08x\n", GetLastError()); + ok (res >= 0, "SendMessage(LB_DIR, DDL_DRIVES|DDL_EXCLUSIVE, *) failed - 0x%08x\n", GetLastError()); /* There should be some content in the listbox. In particular, there should * be at least one element before, since the string "[-c-]" should @@ -768,10 +769,11 @@ static void test_listbox_LB_DIR() * been added. */ itemCount = SendMessage(hList, LB_GETCOUNT, 0, 0); - ok (itemCount == itemCount_justDrives + itemCount_allFiles, - "SendMessage(LB_DIR, DDL_DRIVES, w*.c) filled with %d entries, expected %d\n", + ok (itemCount == itemCount_justDrives + itemCount_allFiles || + broken(itemCount == itemCount_justDrives), /* "*" wildcard broken on win9x */ + "SendMessage(LB_DIR, DDL_DRIVES, *) filled with %d entries, expected %d\n", itemCount, itemCount_justDrives + itemCount_allFiles); - ok(res + 1 == itemCount, "SendMessage(LB_DIR, DDL_DRIVES, w*.c) returned incorrect index!\n"); + ok(res + 1 == itemCount, "SendMessage(LB_DIR, DDL_DRIVES, *) returned incorrect index!\n"); /* This tests behavior when no files match the wildcard */ strcpy(pathBuffer, BAD_EXTENSION); @@ -829,7 +831,8 @@ static void test_listbox_LB_DIR() * be exactly the number of plain files, plus the number of mapped drives. */ itemCount = SendMessage(hList, LB_GETCOUNT, 0, 0); - ok (itemCount == itemCount_allFiles + itemCount_justDrives + itemCount_allDirs, + ok (itemCount == itemCount_allFiles + itemCount_justDrives + itemCount_allDirs || + broken(itemCount == itemCount_justDrives + itemCount_allDirs), /* "*" wildcard broken on win9x */ "SendMessage(LB_DIR, DDL_DIRECTORY|DDL_DRIVES) filled with %d entries, expected %d\n", itemCount, itemCount_allFiles + itemCount_justDrives + itemCount_allDirs); ok(res + 1 == itemCount, "SendMessage(LB_DIR, DDL_DIRECTORY|DDL_DRIVES, w*.c) returned incorrect index!\n"); @@ -900,16 +903,18 @@ static void test_listbox_LB_DIR() res = SendMessage(hList, LB_DIR, DDL_DIRECTORY|DDL_EXCLUSIVE, (LPARAM)pathBuffer); ok (res != -1, "SendMessage(LB_DIR, DDL_DIRECTORY|DDL_EXCLUSIVE, *) failed err %u\n", GetLastError()); - /* There should be exactly one element: "[..]" */ itemCount = SendMessage(hList, LB_GETCOUNT, 0, 0); ok (itemCount == itemCount_allDirs, "SendMessage(LB_DIR, DDL_DIRECTORY|DDL_EXCLUSIVE) filled with %d entries, expected %d\n", itemCount, itemCount_allDirs); ok(res + 1 == itemCount, "SendMessage(LB_DIR, DDL_DIRECTORY|DDL_EXCLUSIVE, *) returned incorrect index!\n"); - memset(pathBuffer, 0, MAX_PATH); - SendMessage(hList, LB_GETTEXT, 0, (LPARAM)pathBuffer); - ok( !strcmp(pathBuffer, "[..]"), "First (and only) element is not [..]\n"); + if (itemCount && GetCurrentDirectoryA( MAX_PATH, pathBuffer ) > 3) /* there's no [..] in drive root */ + { + memset(pathBuffer, 0, MAX_PATH); + SendMessage(hList, LB_GETTEXT, 0, (LPARAM)pathBuffer); + ok( !strcmp(pathBuffer, "[..]"), "First element is not [..]\n"); + } /* This tests behavior when no files match the wildcard */ strcpy(pathBuffer, BAD_EXTENSION); @@ -974,7 +979,7 @@ static void test_listbox_LB_DIR() strcpy(pathBuffer, "w*.c"); SendMessage(hList, LB_RESETCONTENT, 0, 0); res = SendMessage(hList, LB_DIR, DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE, (LPARAM)pathBuffer); - ok (res > 0, "SendMessage(LB_DIR, DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE, w*.c,) failed - 0x%08x\n", GetLastError()); + ok (res >= 0, "SendMessage(LB_DIR, DDL_DIRECTORY|DDL_DRIVES|DDL_EXCLUSIVE, w*.c,) failed - 0x%08x\n", GetLastError()); /* There should be no plain files on the listbox, and no [..], since it does not fit w*.c */ itemCount = SendMessage(hList, LB_GETCOUNT, 0, 0); @@ -1288,10 +1293,12 @@ static void test_listbox_dlgdir(void) "DlgDirList(DDL_DIRECTORY|DDL_EXCLUSIVE) filled with %d entries, expected %d\n", itemCount, itemCount_allDirs); - memset(pathBuffer, 0, MAX_PATH); - SendMessage(g_listBox, LB_GETTEXT, 0, (LPARAM)pathBuffer); - ok( !strcmp(pathBuffer, "[..]"), "First (and only) element is not [..]\n"); - + if (itemCount && GetCurrentDirectoryA( MAX_PATH, pathBuffer ) > 3) /* there's no [..] in drive root */ + { + memset(pathBuffer, 0, MAX_PATH); + SendMessage(g_listBox, LB_GETTEXT, 0, (LPARAM)pathBuffer); + ok( !strcmp(pathBuffer, "[..]"), "First (and only) element is not [..]\n"); + } /* Test behavior when no files match the wildcard */ strcpy(pathBuffer, BAD_EXTENSION); diff --git a/dlls/user32/tests/monitor.c b/dlls/user32/tests/monitor.c index d858f7279eb..3d0359679eb 100644 --- a/dlls/user32/tests/monitor.c +++ b/dlls/user32/tests/monitor.c @@ -88,7 +88,6 @@ static void test_enumdisplaydevices(void) BOOL ret; HDC dc; ret = pEnumDisplayDevicesA(NULL, num, &dd, 0); - ok(ret || num != 0, "EnumDisplayDevices fails with num == 0\n"); if(!ret) break; if(dd.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE) { @@ -104,11 +103,10 @@ static void test_enumdisplaydevices(void) } num++; } - ok(primary_num != -1, "Didn't get the primary device\n"); - if (!pEnumDisplayMonitors || !pGetMonitorInfoA) + if (primary_num == -1 || !pEnumDisplayMonitors || !pGetMonitorInfoA) { - skip("EnumDisplayMonitors or GetMonitorInfoA are not available\n"); + win_skip("EnumDisplayMonitors or GetMonitorInfoA are not available\n"); return; } @@ -172,7 +170,8 @@ static void test_ChangeDisplaySettingsEx(void) res = ChangeDisplaySettingsA(&dm, CDS_TEST); ok(res == DISP_CHANGE_SUCCESSFUL, "ChangeDisplaySettingsA returned %d, expected DISP_CHANGE_SUCCESSFUL\n", res); - ok(dm.dmDriverExtra == 0, "ChangeDisplaySettingsA didn't reset dmDriverExtra to 0\n"); + ok(dm.dmDriverExtra == 0 || broken(dm.dmDriverExtra == 1) /* win9x */, + "ChangeDisplaySettingsA didn't reset dmDriverExtra to 0\n"); /* crashes under XP SP3 for large dmDriverExtra values */ dm.dmDriverExtra = 1; @@ -213,8 +212,10 @@ static void test_ChangeDisplaySettingsEx(void) dm.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT; dm.dmPelsWidth = width; res = pChangeDisplaySettingsExA(NULL, &dm, NULL, CDS_TEST, NULL); - ok(res == DISP_CHANGE_SUCCESSFUL, - "ChangeDisplaySettingsExA returned %d, expected DISP_CHANGE_SUCCESSFUL\n", res); + ok(res == DISP_CHANGE_SUCCESSFUL || + res == DISP_CHANGE_BADMODE || /* Win98, WinMe */ + res == DISP_CHANGE_FAILED, /* NT4 */ + "ChangeDisplaySettingsExA returned unexpected %d\n", res); memset(&dmW, 0, sizeof(dmW)); dmW.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT; @@ -223,8 +224,9 @@ static void test_ChangeDisplaySettingsEx(void) res = pChangeDisplaySettingsExW(NULL, &dmW, NULL, CDS_TEST, NULL); if (GetLastError() != ERROR_CALL_NOT_IMPLEMENTED) ok(res == DISP_CHANGE_FAILED || + res == DISP_CHANGE_BADPARAM || /* NT4 */ res == DISP_CHANGE_BADMODE /* XP SP3 */, - "ChangeDisplaySettingsExW returned %d, expected DISP_CHANGE_FAILED or DISP_CHANGE_BADMODE\n", res); + "ChangeDisplaySettingsExW returned %d\n", res); memset(&dm, 0, sizeof(dm)); dm.dmSize = sizeof(dm); @@ -247,6 +249,8 @@ static void test_ChangeDisplaySettingsEx(void) RECT r, r1, virt; SetRect(&virt, 0, 0, GetSystemMetrics(SM_CXVIRTUALSCREEN), GetSystemMetrics(SM_CYVIRTUALSCREEN)); + if (IsRectEmpty(&virt)) /* NT4 doesn't have SM_CX/YVIRTUALSCREEN */ + SetRect(&virt, 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN)); OffsetRect(&virt, GetSystemMetrics(SM_XVIRTUALSCREEN), GetSystemMetrics(SM_YVIRTUALSCREEN)); /* Resolution change resets clip rect */ diff --git a/dlls/user32/tests/resource.c b/dlls/user32/tests/resource.c index 30b3e1f027c..b8e04932098 100644 --- a/dlls/user32/tests/resource.c +++ b/dlls/user32/tests/resource.c @@ -180,41 +180,43 @@ static void test_accel1(void) ok( hAccel != NULL, "create accelerator table\n"); r = CopyAcceleratorTable( hAccel, NULL, 0 ); - ok( r == n, "two entries in table\n"); + ok( r == n || broken(r == 2), /* win9x */ + "two entries in table %u/%u\n", r, n); - r = CopyAcceleratorTable( hAccel, &ac[0], r ); - ok( r == n, "still should be two entries in table\n"); + r = CopyAcceleratorTable( hAccel, &ac[0], n ); + ok( r == n || broken(r == 2), /* win9x */ + "still should be two entries in table %u/%u\n", r, n); n=0; ok( ac[n].cmd == 1000, "cmd 0 not preserved\n"); ok( ac[n].key == 'A', "key 0 not preserved\n"); ok( ac[n].fVirt == (FVIRTKEY | FNOINVERT), "fVirt 0 not preserved\n"); - n++; + if (++n == r) goto done; ok( ac[n].cmd == 0xffff, "cmd 1 not preserved\n"); ok( ac[n].key == 0xffff, "key 1 not preserved\n"); ok( ac[n].fVirt == 0x007f, "fVirt 1 not changed\n"); - n++; + if (++n == r) goto done; ok( ac[n].cmd == 0xfff0, "cmd 2 not preserved\n"); ok( ac[n].key == 0x00ff, "key 2 not preserved\n"); ok( ac[n].fVirt == 0x0070, "fVirt 2 not changed\n"); - n++; + if (++n == r) goto done; ok( ac[n].cmd == 0xfff0, "cmd 3 not preserved\n"); ok( ac[n].key == 0x00ff, "key 3 not preserved\n"); ok( ac[n].fVirt == 0x0000, "fVirt 3 not changed\n"); - n++; + if (++n == r) goto done; ok( ac[n].cmd == 0xfff0, "cmd 4 not preserved\n"); ok( ac[n].key == 0xffff, "key 4 not preserved\n"); ok( ac[n].fVirt == 0x0001, "fVirt 4 not changed\n"); - +done: r = DestroyAcceleratorTable( hAccel ); ok( r, "destroy accelerator table\n"); hAccel = CreateAcceleratorTable( &ac[0], 0 ); - ok( !hAccel, "zero elements should fail\n"); + ok( !hAccel || broken(hAccel != NULL), /* nt4 */ "zero elements should fail\n"); /* these will on crash win2k hAccel = CreateAcceleratorTable( NULL, 1 ); @@ -230,6 +232,7 @@ static void test_accel2(void) { ACCEL ac[2], out[2]; HACCEL hac; + int res; ac[0].cmd = 0; ac[0].fVirt = 0; @@ -246,8 +249,8 @@ static void test_accel2(void) /* try a zero count */ hac = CreateAcceleratorTable( &ac[0], 0 ); - ok( !hac , "fail\n"); - ok( !DestroyAcceleratorTable( hac ), "destroy failed\n"); + ok( !hac || broken(hac != NULL), /* nt4 */ "fail\n"); + if (!hac) ok( !DestroyAcceleratorTable( hac ), "destroy failed\n"); /* creating one accelerator should work */ hac = CreateAcceleratorTable( &ac[0], 1 ); @@ -258,9 +261,12 @@ static void test_accel2(void) /* how about two of the same type? */ hac = CreateAcceleratorTable( &ac[0], 2); ok( hac != NULL , "fail\n"); - ok( 2 == CopyAcceleratorTable( hac, NULL, 100 ), "copy null failed\n"); - ok( 2 == CopyAcceleratorTable( hac, NULL, 0 ), "copy null failed\n"); - ok( 2 == CopyAcceleratorTable( hac, NULL, 1 ), "copy null failed\n"); + res = CopyAcceleratorTable( hac, NULL, 100 ); + ok( res == 2 || broken(res == 0), /* win9x */ "copy null failed %d\n", res); + res = CopyAcceleratorTable( hac, NULL, 0 ); + ok( res == 2, "copy null failed %d\n", res); + res = CopyAcceleratorTable( hac, NULL, 1 ); + ok( res == 2 || broken(res == 0), /* win9x */ "copy null failed %d\n", res); ok( 1 == CopyAcceleratorTable( hac, out, 1 ), "copy 1 failed\n"); ok( 2 == CopyAcceleratorTable( hac, out, 2 ), "copy 2 failed\n"); ok( DestroyAcceleratorTable( hac ), "destroy failed\n"); @@ -311,14 +317,18 @@ static void test_accel2(void) memset( ac, 0xff, sizeof ac ); hac = CreateAcceleratorTable( &ac[0], 2); ok( hac != NULL , "fail\n"); - ok( 2 == CopyAcceleratorTable( hac, out, 2 ), "copy 2 failed\n"); + res = CopyAcceleratorTable( hac, out, 2 ); + ok( res == 2 || broken(res == 1), /* win9x */ "copy 2 failed %d\n", res); /* ok( memcmp( ac, out, sizeof ac ), "tables not different\n"); */ ok( out[0].cmd == ac[0].cmd, "cmd modified\n"); ok( out[0].fVirt == (ac[0].fVirt&0x7f), "fVirt not modified\n"); ok( out[0].key == ac[0].key, "key modified\n"); - ok( out[1].cmd == ac[1].cmd, "cmd modified\n"); - ok( out[1].fVirt == (ac[1].fVirt&0x7f), "fVirt not modified\n"); - ok( out[1].key == ac[1].key, "key modified\n"); + if (res == 2) + { + ok( out[1].cmd == ac[1].cmd, "cmd modified\n"); + ok( out[1].fVirt == (ac[1].fVirt&0x7f), "fVirt not modified\n"); + ok( out[1].key == ac[1].key, "key modified\n"); + } ok( DestroyAcceleratorTable( hac ), "destroy failed\n"); } @@ -343,9 +353,13 @@ static void test_PrivateExtractIcons(void) { cIcons = pPrivateExtractIconsA(szShell32Dll, 0, 16, 16, ahIcon, aIconId, 3, 0); ok(cIcons == 3, "Three icons requested got cIcons=%d\n", cIcons); - cIcons = pPrivateExtractIconsA(szShell32Dll, 0, MAKELONG(32,16), MAKELONG(32,16), - ahIcon, aIconId, 3, 0); - ok(cIcons == 4, "Three icons requested, four expected, got cIcons=%d\n", cIcons); + /* count must be a multiple of two when getting two sizes */ + cIcons = pPrivateExtractIconsA(szShell32Dll, 0, MAKELONG(16,32), MAKELONG(16,32), + ahIcon, aIconId, 3, 0); + ok(cIcons == 0 /* vista */ || cIcons == 4, "Three icons requested got cIcons=%d\n", cIcons); + cIcons = pPrivateExtractIconsA(szShell32Dll, 0, MAKELONG(16,32), MAKELONG(16,32), + ahIcon, aIconId, 4, 0); + ok(cIcons == 4, "Four icons requested got cIcons=%d\n", cIcons); } static void test_LoadImage(void) diff --git a/dlls/user32/tests/sysparams.c b/dlls/user32/tests/sysparams.c index 60a07af5b89..0bd7d240564 100644 --- a/dlls/user32/tests/sysparams.c +++ b/dlls/user32/tests/sysparams.c @@ -224,7 +224,7 @@ static BOOL test_error_msg ( int rc, const char *name ) if (rc==0) { - if (last_error==0xdeadbeef || last_error==ERROR_INVALID_SPI_VALUE) + if (last_error==0xdeadbeef || last_error==ERROR_INVALID_SPI_VALUE || last_error==ERROR_INVALID_PARAMETER) { trace("%s not supported on this platform. Skipping test\n", name); } @@ -1778,7 +1778,7 @@ static void test_SPI_SETSHOWSOUNDS( void ) /* 57 */ rc=SystemParametersInfoA( SPI_SETSHOWSOUNDS, vals[i], 0, SPIF_UPDATEINIFILE | SPIF_SENDCHANGE ); ok(rc!=0,"%d: rc=%d err=%d\n",i,rc,GetLastError()); - test_change_message( SPI_SETSHOWSOUNDS, 0 ); + test_change_message( SPI_SETSHOWSOUNDS, 1 ); test_reg_key( SPI_SETSHOWSOUNDS_REGKEY, SPI_SETSHOWSOUNDS_VALNAME, vals[i] ? "1" : "0" ); @@ -1814,7 +1814,7 @@ static void test_SPI_SETKEYBOARDPREF( void ) /* 69 */ rc=SystemParametersInfoA( SPI_SETKEYBOARDPREF, vals[i], 0, SPIF_UPDATEINIFILE | SPIF_SENDCHANGE ); ok(rc!=0,"%d: rc=%d err=%d\n",i,rc,GetLastError()); - test_change_message( SPI_SETKEYBOARDPREF, 0 ); + test_change_message( SPI_SETKEYBOARDPREF, 1 ); test_reg_key_ex2( SPI_SETKEYBOARDPREF_REGKEY, SPI_SETKEYBOARDPREF_REGKEY_LEGACY, SPI_SETKEYBOARDPREF_VALNAME, SPI_SETKEYBOARDPREF_VALNAME_LEGACY, vals[i] ? "1" : "0" ); @@ -1848,7 +1848,7 @@ static void test_SPI_SETSCREENREADER( void ) /* 71 */ rc=SystemParametersInfoA( SPI_SETSCREENREADER, vals[i], 0, SPIF_UPDATEINIFILE | SPIF_SENDCHANGE ); ok(rc!=0,"%d: rc=%d err=%d\n",i,rc,GetLastError()); - test_change_message( SPI_SETSCREENREADER, 0 ); + test_change_message( SPI_SETSCREENREADER, 1 ); test_reg_key_ex2( SPI_SETSCREENREADER_REGKEY, SPI_SETSCREENREADER_REGKEY_LEGACY, SPI_SETSCREENREADER_VALNAME, SPI_SETSCREENREADER_VALNAME_LEGACY, vals[i] ? "1" : "0" ); @@ -1917,7 +1917,7 @@ static void test_SPI_SETLOWPOWERACTIVE( void ) /* 85 */ rc=SystemParametersInfoA( SPI_SETLOWPOWERACTIVE, vals[i], 0, SPIF_UPDATEINIFILE | SPIF_SENDCHANGE ); ok(rc!=0,"%d: rc=%d err=%d\n",i,rc,GetLastError()); - test_change_message( SPI_SETLOWPOWERACTIVE, 0 ); + test_change_message( SPI_SETLOWPOWERACTIVE, 1 ); test_reg_key( SPI_SETLOWPOWERACTIVE_REGKEY, SPI_SETLOWPOWERACTIVE_VALNAME, vals[i] ? "1" : "0" ); @@ -1954,7 +1954,7 @@ static void test_SPI_SETPOWEROFFACTIVE( void ) /* 86 */ rc=SystemParametersInfoA( SPI_SETPOWEROFFACTIVE, vals[i], 0, SPIF_UPDATEINIFILE | SPIF_SENDCHANGE ); ok(rc!=0,"%d: rc=%d err=%d\n",i,rc,GetLastError()); - test_change_message( SPI_SETPOWEROFFACTIVE, 0 ); + test_change_message( SPI_SETPOWEROFFACTIVE, 1 ); test_reg_key( SPI_SETPOWEROFFACTIVE_REGKEY, SPI_SETPOWEROFFACTIVE_VALNAME, vals[i] ? "1" : "0" ); @@ -2206,7 +2206,7 @@ static void test_SPI_SETWHEELSCROLLCHARS( void ) /* 108 */ { BOOL rc; UINT old_chars; - const UINT vals[]={0,32767}; + const UINT vals[]={32767,0}; unsigned int i; trace("testing SPI_{GET,SET}WHEELSCROLLCHARS\n"); @@ -2224,7 +2224,7 @@ static void test_SPI_SETWHEELSCROLLCHARS( void ) /* 108 */ rc=SystemParametersInfoA( SPI_SETWHEELSCROLLCHARS, vals[i], 0, SPIF_UPDATEINIFILE | SPIF_SENDCHANGE ); - ok(rc!=0,"%d: rc=%d err=%d\n",i,rc,GetLastError()); + if (!test_error_msg(rc,"SPI_SETWHEELSCROLLCHARS")) return; test_change_message( SPI_SETWHEELSCROLLCHARS, 0 ); sprintf( buf, "%d", vals[i] ); test_reg_key( SPI_SETMOUSESCROLLCHARS_REGKEY, @@ -2474,6 +2474,8 @@ static void test_GetSystemMetrics( void) INT CaptionWidth; MINIMIZEDMETRICS minim; NONCLIENTMETRICS ncm; + SIZE screen; + minim.cbSize = sizeof( minim); ncm.cbSize = sizeof( ncm); SystemParametersInfo( SPI_GETMINIMIZEDMETRICS, 0, &minim, 0); @@ -2549,8 +2551,9 @@ static void test_GetSystemMetrics( void) /* SM_SECURE */ ok_gsm( SM_CXEDGE, 2); ok_gsm( SM_CYEDGE, 2); - ok_gsm( SM_CXMINSPACING, GetSystemMetrics( SM_CXMINIMIZED) + minim.iHorzGap ); - ok_gsm( SM_CYMINSPACING, GetSystemMetrics( SM_CYMINIMIZED) + minim.iVertGap ); + /* sign-extension for iHorzGap/iVertGap is broken on Win9x */ + ok_gsm( SM_CXMINSPACING, GetSystemMetrics( SM_CXMINIMIZED) + (short)minim.iHorzGap ); + ok_gsm( SM_CYMINSPACING, GetSystemMetrics( SM_CYMINIMIZED) + (short)minim.iVertGap ); /* SM_CXSMICON */ /* SM_CYSMICON */ ok_gsm( SM_CYSMCAPTION, ncm.iSmCaptionHeight + 1); @@ -2566,10 +2569,15 @@ static void test_GetSystemMetrics( void) /* SM_ARRANGE */ ok_gsm( SM_CXMINIMIZED, minim.iWidth + 6); ok_gsm( SM_CYMINIMIZED, GetSystemMetrics( SM_CYCAPTION) + 5); - ok_gsm( SM_CXMAXTRACK, GetSystemMetrics( SM_CXVIRTUALSCREEN) + - 4 + 2 * GetSystemMetrics( SM_CXFRAME)); - ok_gsm( SM_CYMAXTRACK, GetSystemMetrics( SM_CYVIRTUALSCREEN) + - 4 + 2 * GetSystemMetrics( SM_CYFRAME)); + screen.cx = GetSystemMetrics( SM_CXVIRTUALSCREEN ); + screen.cy = GetSystemMetrics( SM_CYVIRTUALSCREEN ); + if (!screen.cx || !screen.cy) /* not supported on NT4 */ + { + screen.cx = GetSystemMetrics( SM_CXSCREEN ); + screen.cy = GetSystemMetrics( SM_CYSCREEN ); + } + ok_gsm( SM_CXMAXTRACK, screen.cx + 4 + 2 * GetSystemMetrics(SM_CXFRAME)); + ok_gsm( SM_CYMAXTRACK, screen.cy + 4 + 2 * GetSystemMetrics(SM_CYFRAME)); /* the next two cannot really be tested as they depend on (application) * toolbars */ /* SM_CXMAXIMIZED */ diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index 827d0e31f30..449067947b6 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -740,8 +740,9 @@ static void verify_window_info(HWND hwnd, const WINDOWINFO *info) ok((info->dwExStyle & ~0xe0000800) == (DWORD)GetWindowLongA(hwnd, GWL_EXSTYLE), "wrong dwExStyle: %08x != %08x\n", info->dwExStyle, GetWindowLongA(hwnd, GWL_EXSTYLE)); status = (GetActiveWindow() == hwnd) ? WS_ACTIVECAPTION : 0; - ok(info->dwWindowStatus == status, "wrong dwWindowStatus: %04x != %04x\n", - info->dwWindowStatus, status); + if (GetForegroundWindow()) + ok(info->dwWindowStatus == status, "wrong dwWindowStatus: %04x != %04x active %p fg %p\n", + info->dwWindowStatus, status, GetActiveWindow(), GetForegroundWindow()); /* win2k and XP return broken border info in GetWindowInfo most of * the time, so there is no point in testing it. @@ -781,6 +782,7 @@ static void test_nonclient_area(HWND hwnd) RECT rc_window, rc_client, rc; BOOL menu; BOOL is_win9x = GetWindowLongPtrW(hwnd, GWLP_WNDPROC) == 0; + LRESULT ret; style = GetWindowLongA(hwnd, GWL_STYLE); exstyle = GetWindowLongA(hwnd, GWL_EXSTYLE); @@ -809,6 +811,10 @@ static void test_nonclient_area(HWND hwnd) trace("calc client: (%d,%d)-(%d,%d)\n", rc.left, rc.top, rc.right, rc.bottom); ok(EqualRect(&rc, &rc_client), "client rect does not match: style:exstyle=0x%08x:0x%08x, menu=%d\n", style, exstyle, menu); + /* NULL rectangle shouldn't crash */ + ret = DefWindowProcA(hwnd, WM_NCCALCSIZE, 0, 0); + ok(ret == 0, "NULL rectangle returned %ld instead of 0\n", ret); + /* Win9x doesn't like WM_NCCALCSIZE with synthetic data and crashes */; if (is_win9x) return; @@ -1872,7 +1878,8 @@ static void test_SetMenu(HWND parent) /* test whether we can destroy a menu assigned to a window */ retok = DestroyMenu(hMenu); ok( retok, "DestroyMenu error %d\n", GetLastError()); - ok(!IsMenu(hMenu), "menu handle should be not valid after DestroyMenu\n"); + retok = IsMenu(hMenu); + ok(!retok || broken(retok) /* nt4 */, "menu handle should be not valid after DestroyMenu\n"); ret = GetMenu(parent); /* This test fails on Win9x */ if (!is_win9x) @@ -2263,7 +2270,7 @@ static void check_wnd_state_(const char *file, int line, HWND active, HWND foreground, HWND focus, HWND capture) { ok_(file, line)(active == GetActiveWindow(), "GetActiveWindow() = %p\n", GetActiveWindow()); - if (foreground) + if (foreground && GetForegroundWindow()) ok_(file, line)(foreground == GetForegroundWindow(), "GetForegroundWindow() = %p\n", GetForegroundWindow()); ok_(file, line)(focus == GetFocus(), "GetFocus() = %p\n", GetFocus()); ok_(file, line)(capture == GetCapture(), "GetCapture() = %p\n", GetCapture()); @@ -2453,7 +2460,10 @@ static LRESULT WINAPI button_hook_proc(HWND button, UINT msg, WPARAM wparam, LPA static void test_capture_1(void) { - HWND button, capture; + HWND button, capture, oldFocus, oldActive; + + oldFocus = GetFocus(); + oldActive = GetActiveWindow(); capture = GetCapture(); ok(capture == 0, "GetCapture() = %p\n", capture); @@ -2471,14 +2481,16 @@ static void test_capture_1(void) check_wnd_state(button, 0, button, button); DestroyWindow(button); - check_wnd_state(0, 0, 0, 0); + check_wnd_state(oldActive, 0, oldFocus, 0); } static void test_capture_2(void) { - HWND button, hwnd, capture; + HWND button, hwnd, capture, oldFocus, oldActive; - check_wnd_state(0, 0, 0, 0); + oldFocus = GetFocus(); + oldActive = GetActiveWindow(); + check_wnd_state(oldActive, 0, oldFocus, 0); button = CreateWindowExA(0, "button", NULL, WS_POPUP | WS_VISIBLE, 0, 0, 10, 10, 0, 0, 0, NULL); assert(button); @@ -2528,7 +2540,7 @@ static void test_capture_2(void) check_wnd_state(button, button, button, 0); DestroyWindow(button); - check_wnd_state(0, 0, 0, 0); + check_wnd_state(oldActive, 0, oldFocus, 0); } static void test_capture_3(HWND hwnd1, HWND hwnd2) @@ -2659,12 +2671,19 @@ static void test_mouse_input(HWND hwnd) flush_events( TRUE ); - /* Check that setting the same position will generate WM_MOUSEMOVE */ + /* Check that setting the same position may generate WM_MOUSEMOVE */ SetCursorPos(x, y); msg.message = 0; - ok(PeekMessageA(&msg, 0, 0, 0, PM_REMOVE), "no message available\n"); - ok(msg.hwnd == popup && msg.message == WM_MOUSEMOVE, "hwnd %p message %04x\n", msg.hwnd, msg.message); - ok(msg.pt.x == x && msg.pt.y == y, "wrong message coords (%d,%d)/(%d,%d)\n", x, y, msg.pt.x, msg.pt.y); + do + ret = PeekMessageA(&msg, 0, 0, 0, PM_REMOVE); + while (ret && msg.message >= 0xc000); /* skip registered messages */ + if (ret) + { + ok(msg.hwnd == popup && msg.message == WM_MOUSEMOVE, "hwnd %p message %04x\n", + msg.hwnd, msg.message); + ok(msg.pt.x == x && msg.pt.y == y, "wrong message coords (%d,%d)/(%d,%d)\n", + x, y, msg.pt.x, msg.pt.y); + } /* force the system to update its internal queue mouse position, * otherwise it won't generate relative mouse movements below. @@ -2674,11 +2693,13 @@ static void test_mouse_input(HWND hwnd) msg.message = 0; mouse_event(MOUSEEVENTF_MOVE, 1, 1, 0, 0); - ok(PeekMessageA(&msg, 0, 0, 0, PM_REMOVE), "no message available\n"); - ok(msg.hwnd == popup && msg.message == WM_MOUSEMOVE, "hwnd %p message %04x\n", msg.hwnd, msg.message); /* FIXME: SetCursorPos in Wine generates additional WM_MOUSEMOVE message */ - if (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) - ok(msg.hwnd == popup && msg.message == WM_MOUSEMOVE, "hwnd %p message %04x\n", msg.hwnd, msg.message); + while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) + { + if (msg.message >= 0xc000) continue; /* skip registered messages */ + ok(msg.hwnd == popup && msg.message == WM_MOUSEMOVE, + "hwnd %p message %04x\n", msg.hwnd, msg.message); + } ret = PeekMessageA(&msg, 0, 0, 0, PM_REMOVE); ok( !ret, "message %04x available\n", msg.message); @@ -3341,9 +3362,17 @@ static void test_params(void) INT rc; /* Just a param check */ - SetLastError(0xdeadbeef); - rc = GetWindowText(hwndMain2, NULL, 1024); - ok( rc==0, "GetWindowText: rc=%d err=%d\n",rc,GetLastError()); + if (pGetMonitorInfoA) + { + SetLastError(0xdeadbeef); + rc = GetWindowText(hwndMain2, NULL, 1024); + ok( rc==0, "GetWindowText: rc=%d err=%d\n",rc,GetLastError()); + } + else + { + /* Skips actually on Win95 and NT4 */ + win_skip("Test would crash on Win95\n"); + } SetLastError(0xdeadbeef); hwnd=CreateWindow("LISTBOX", "TestList", @@ -3983,6 +4012,11 @@ static void test_CreateWindow(void) #define expect_ex_style(window, ex_style)\ ok(GetWindowLong(window, GWL_EXSTYLE) == (ex_style), "expected ex_style %x != %x\n", (LONG)(ex_style), GetWindowLong(window, GWL_EXSTYLE)) +#define expect_gle_broken_9x(gle)\ + ok(GetLastError() == gle ||\ + broken(GetLastError() == 0xdeadbeef),\ + "IsMenu set error %d\n", GetLastError()) + hmenu = CreateMenu(); assert(hmenu != 0); parent = GetDesktopWindow(); @@ -4039,7 +4073,7 @@ static void test_CreateWindow(void) DestroyWindow(hwnd); SetLastError(0xdeadbeef); ok(!IsMenu(hmenu), "IsMenu should fail\n"); - ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %d\n", GetLastError()); + expect_gle_broken_9x(ERROR_INVALID_MENU_HANDLE); hmenu = CreateMenu(); assert(hmenu != 0); @@ -4053,7 +4087,7 @@ static void test_CreateWindow(void) DestroyWindow(hwnd); SetLastError(0xdeadbeef); ok(!IsMenu(hmenu), "IsMenu should fail\n"); - ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %d\n", GetLastError()); + expect_gle_broken_9x(ERROR_INVALID_MENU_HANDLE); hmenu = CreateMenu(); assert(hmenu != 0); @@ -4067,7 +4101,7 @@ static void test_CreateWindow(void) DestroyWindow(hwnd); SetLastError(0xdeadbeef); ok(!IsMenu(hmenu), "IsMenu should fail\n"); - ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %d\n", GetLastError()); + expect_gle_broken_9x(ERROR_INVALID_MENU_HANDLE); hmenu = CreateMenu(); assert(hmenu != 0); @@ -4081,14 +4115,16 @@ static void test_CreateWindow(void) DestroyWindow(hwnd); SetLastError(0xdeadbeef); ok(!IsMenu(hmenu), "IsMenu should fail\n"); - ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %d\n", GetLastError()); + expect_gle_broken_9x(ERROR_INVALID_MENU_HANDLE); /* WS_CHILD | WS_POPUP */ SetLastError(0xdeadbeef); hwnd = CreateWindowEx(WS_EX_APPWINDOW, "static", NULL, WS_CHILD | WS_POPUP, 0, 0, 100, 100, parent, (HMENU)1, 0, NULL); - ok(!hwnd, "CreateWindowEx should fail\n"); - ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %d\n", GetLastError()); + ok(!hwnd || broken(hwnd != 0 /* Win9x */), "CreateWindowEx should fail\n"); + expect_gle_broken_9x(ERROR_INVALID_MENU_HANDLE); + if (hwnd) + DestroyWindow(hwnd); hmenu = CreateMenu(); assert(hmenu != 0); @@ -4102,13 +4138,15 @@ static void test_CreateWindow(void) DestroyWindow(hwnd); SetLastError(0xdeadbeef); ok(!IsMenu(hmenu), "IsMenu should fail\n"); - ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %d\n", GetLastError()); + expect_gle_broken_9x(ERROR_INVALID_MENU_HANDLE); SetLastError(0xdeadbeef); hwnd = CreateWindowEx(WS_EX_APPWINDOW, "static", NULL, WS_CHILD | WS_POPUP | WS_CAPTION, 0, 0, 100, 100, parent, (HMENU)1, 0, NULL); - ok(!hwnd, "CreateWindowEx should fail\n"); - ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %d\n", GetLastError()); + ok(!hwnd || broken(hwnd != 0 /* Win9x */), "CreateWindowEx should fail\n"); + expect_gle_broken_9x(ERROR_INVALID_MENU_HANDLE); + if (hwnd) + DestroyWindow(hwnd); hmenu = CreateMenu(); assert(hmenu != 0); @@ -4122,13 +4160,15 @@ static void test_CreateWindow(void) DestroyWindow(hwnd); SetLastError(0xdeadbeef); ok(!IsMenu(hmenu), "IsMenu should fail\n"); - ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %d\n", GetLastError()); + expect_gle_broken_9x(ERROR_INVALID_MENU_HANDLE); SetLastError(0xdeadbeef); hwnd = CreateWindowEx(0, "static", NULL, WS_CHILD | WS_POPUP, 0, 0, 100, 100, parent, (HMENU)1, 0, NULL); - ok(!hwnd, "CreateWindowEx should fail\n"); - ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %d\n", GetLastError()); + ok(!hwnd || broken(hwnd != 0 /* Win9x */), "CreateWindowEx should fail\n"); + expect_gle_broken_9x(ERROR_INVALID_MENU_HANDLE); + if (hwnd) + DestroyWindow(hwnd); hmenu = CreateMenu(); assert(hmenu != 0); @@ -4142,13 +4182,15 @@ static void test_CreateWindow(void) DestroyWindow(hwnd); SetLastError(0xdeadbeef); ok(!IsMenu(hmenu), "IsMenu should fail\n"); - ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %d\n", GetLastError()); + expect_gle_broken_9x(ERROR_INVALID_MENU_HANDLE); SetLastError(0xdeadbeef); hwnd = CreateWindowEx(0, "static", NULL, WS_CHILD | WS_POPUP | WS_CAPTION, 0, 0, 100, 100, parent, (HMENU)1, 0, NULL); - ok(!hwnd, "CreateWindowEx should fail\n"); - ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %d\n", GetLastError()); + ok(!hwnd || broken(hwnd != 0 /* Win9x */), "CreateWindowEx should fail\n"); + expect_gle_broken_9x(ERROR_INVALID_MENU_HANDLE); + if (hwnd) + DestroyWindow(hwnd); hmenu = CreateMenu(); assert(hmenu != 0); @@ -4162,7 +4204,7 @@ static void test_CreateWindow(void) DestroyWindow(hwnd); SetLastError(0xdeadbeef); ok(!IsMenu(hmenu), "IsMenu should fail\n"); - ok(GetLastError() == ERROR_INVALID_MENU_HANDLE, "IsMenu set error %d\n", GetLastError()); + expect_gle_broken_9x(ERROR_INVALID_MENU_HANDLE); /* test child window sizing */ cls.style = 0; @@ -4236,7 +4278,7 @@ static void test_CreateWindow(void) expected_cx = expected_cy = -10; SetRect( &expected_rect, 0, 0, 0, 0 ); - broken_rect = expected_rect; + SetRect( &broken_rect, 0, 0, -10, -10 ); hwnd = CreateWindowExA(0, "Sizes_WndClass", NULL, WS_CHILD, -20, -20, -10, -10, parent, 0, 0, NULL); ok( hwnd != 0, "creation failed err %u\n", GetLastError()); GetClientRect( hwnd, &rc ); @@ -4246,7 +4288,7 @@ static void test_CreateWindow(void) expected_cx = expected_cy = -200000; SetRect( &expected_rect, 0, 0, 0, 0 ); - broken_rect = expected_rect; + SetRect( &broken_rect, 0, 0, -200000, -200000 ); hwnd = CreateWindowExA(0, "Sizes_WndClass", NULL, WS_CHILD, -300000, -300000, -200000, -200000, parent, 0, 0, NULL); ok( hwnd != 0, "creation failed err %u\n", GetLastError()); GetClientRect( hwnd, &rc ); @@ -4296,6 +4338,7 @@ static void test_CreateWindow(void) UnregisterClass("MinMax_WndClass", GetModuleHandle(0)); UnregisterClass("Sizes_WndClass", GetModuleHandle(0)); +#undef expect_gle_broken_9x #undef expect_menu #undef expect_style #undef expect_ex_style @@ -5111,6 +5154,139 @@ static void test_fullscreen(void) UnregisterClass("fullscreen_class", GetModuleHandle(0)); } +static BOOL test_thick_child_got_minmax; + +static int getExpectedThickChildInc(void) +{ + const int outer = 2; + int resizeBorder = GetSystemMetrics(SM_CXFRAME) - GetSystemMetrics(SM_CXDLGFRAME); + return (outer + resizeBorder); +} + +static LRESULT WINAPI test_thick_child_size_winproc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) +{ + MINMAXINFO* minmax; + int expectedMinTrack; + int actualMinTrackX; + int actualMinTrackY; + int expectedMaxTrackX; + int expectedMaxTrackY; + int actualMaxTrackX; + int actualMaxTrackY; + int expectedMaxSizeX; + int expectedMaxSizeY; + int actualMaxSizeX; + int actualMaxSizeY; + int expectedPosX; + int expectedPosY; + int actualPosX; + int actualPosY; + RECT rect; + switch (msg) + { + case WM_GETMINMAXINFO: + { + minmax = (MINMAXINFO *)lparam; + trace("hwnd %p, WM_GETMINMAXINFO, %08lx, %08lx\n", hwnd, wparam, lparam); + dump_minmax_info( minmax ); + + test_thick_child_got_minmax = TRUE; + + expectedMinTrack = 2* getExpectedThickChildInc(); + actualMinTrackX = minmax->ptMinTrackSize.x; + actualMinTrackY = minmax->ptMinTrackSize.y; + todo_wine + ok(actualMinTrackX == expectedMinTrack && actualMinTrackY == expectedMinTrack, + "expected minTrack %dx%d, actual minTrack %dx%d\n", + expectedMinTrack, expectedMinTrack, actualMinTrackX, actualMinTrackY); + + actualMaxTrackX = minmax->ptMaxTrackSize.x; + actualMaxTrackY = minmax->ptMaxTrackSize.y; + expectedMaxTrackX = GetSystemMetrics(SM_CXMAXTRACK); + expectedMaxTrackY = GetSystemMetrics(SM_CYMAXTRACK); + ok(actualMaxTrackX == expectedMaxTrackX && actualMaxTrackY == expectedMaxTrackY, + "expected maxTrack %dx%d, actual maxTrack %dx%d\n", + expectedMaxTrackX, expectedMaxTrackY, actualMaxTrackX, actualMaxTrackY); + + GetClientRect(GetParent(hwnd), &rect); + AdjustWindowRectEx(&rect, WS_CHILD | WS_VISIBLE | WS_THICKFRAME, FALSE, 0); + expectedMaxSizeX = rect.right - rect.left; + expectedMaxSizeY = rect.bottom - rect.top; + actualMaxSizeX = minmax->ptMaxSize.x; + actualMaxSizeY = minmax->ptMaxSize.y; + ok(actualMaxSizeX == expectedMaxSizeX && actualMaxSizeY == expectedMaxSizeY, + "expected maxTrack %dx%d, actual maxTrack %dx%d\n", + expectedMaxSizeX, expectedMaxSizeY, actualMaxSizeX, actualMaxSizeY); + + expectedPosX = - getExpectedThickChildInc(); + expectedPosY = expectedPosX; + actualPosX = minmax->ptMaxPosition.x; + actualPosY = minmax->ptMaxPosition.y; + todo_wine + ok(actualPosX == expectedPosX && actualPosY == expectedPosY, + "expected maxPosition (%d/%d), actual maxPosition (%d/%d)\n", + expectedPosX, expectedPosY, actualPosX, actualPosY); + break; + } + } + + return DefWindowProcA(hwnd, msg, wparam, lparam); +} + +static void test_thick_child_size(HWND parentWindow) +{ + BOOL success; + RECT childRect; + HWND childWindow; + LONG childWidth; + LONG childHeight; + WNDCLASSA cls; + LPCTSTR className = "THICK_CHILD_CLASS"; + LONG style = WS_CHILD | WS_VISIBLE | WS_THICKFRAME; + LONG exStyle = 0; + int expectedSize = 2*getExpectedThickChildInc(); + + + cls.style = 0; + cls.lpfnWndProc = test_thick_child_size_winproc; + cls.cbClsExtra = 0; + cls.cbWndExtra = 0; + cls.hInstance = GetModuleHandleA(0); + cls.hIcon = 0; + cls.hCursor = LoadCursorA(0, (LPSTR)IDC_ARROW); + cls.hbrBackground = GetStockObject(WHITE_BRUSH); + cls.lpszMenuName = NULL; + cls.lpszClassName = className; + SetLastError(0xdeadbeef); + ok(RegisterClassA(&cls),"RegisterClassA failed, error: %u\n", GetLastError()); + + test_thick_child_got_minmax = FALSE; + + SetLastError(0xdeadbeef); + childWindow = CreateWindowEx( exStyle, className, "", style, 0, 0, 0, 0, parentWindow, 0, GetModuleHandleA(0), NULL ); + ok(childWindow != NULL, "Failed to create child window, error: %u\n", GetLastError()); + + ok(test_thick_child_got_minmax, "Got no WM_GETMINMAXINFO\n"); + + SetLastError(0xdeadbeef); + success = GetWindowRect(childWindow, &childRect); + ok(success,"GetWindowRect call failed, error: %u\n", GetLastError()); + childWidth = childRect.right - childRect.left; + childHeight = childRect.bottom - childRect.top; + + todo_wine + ok( (childWidth == expectedSize) && (childHeight == expectedSize), + "size of window with style WS_CHILD | WS_VISIBLE | WS_THICKFRAME is wrong: expected size %dx%d != actual size %dx%d\n", + expectedSize, expectedSize, childWidth, childHeight); + + + SetLastError(0xdeadbeef); + success = DestroyWindow(childWindow); + ok(success,"DestroyWindow call failed, error: %u\n", GetLastError()); + ok(UnregisterClass(className, GetModuleHandleA(0)),"UnregisterClass call failed\n"); +} + + START_TEST(win) { HMODULE user32 = GetModuleHandleA( "user32.dll" ); @@ -5143,6 +5319,7 @@ START_TEST(win) our_pid = GetWindowThreadProcessId(hwndMain, NULL); /* Add the tests below this line */ + test_thick_child_size(hwndMain); test_fullscreen(); test_hwnd_message(); test_nonclient_area(hwndMain); diff --git a/dlls/user32/win.c b/dlls/user32/win.c index 2fc00c4b7c1..730b2c2d70c 100644 --- a/dlls/user32/win.c +++ b/dlls/user32/win.c @@ -223,6 +223,10 @@ static HWND *list_window_children( HDESK desktop, HWND hwnd, LPCWSTR class, DWOR { HWND *list; int size = 128; + ATOM atom = get_int_atom_value( class ); + + /* empty class is not the same as NULL class */ + if (!atom && class && !class[0]) return NULL; for (;;) { @@ -235,8 +239,8 @@ static HWND *list_window_children( HDESK desktop, HWND hwnd, LPCWSTR class, DWOR req->desktop = desktop; req->parent = hwnd; req->tid = tid; - if (!(req->atom = get_int_atom_value( class )) && class) - wine_server_add_data( req, class, strlenW(class)*sizeof(WCHAR) ); + req->atom = atom; + if (!atom && class) wine_server_add_data( req, class, strlenW(class)*sizeof(WCHAR) ); wine_server_set_reply( req, list, (size-1) * sizeof(HWND) ); if (!wine_server_call( req )) count = reply->count; } diff --git a/dlls/usp10/usp10.c b/dlls/usp10/usp10.c index 2bc06178056..4af14aecc86 100644 --- a/dlls/usp10/usp10.c +++ b/dlls/usp10/usp10.c @@ -1030,7 +1030,7 @@ HRESULT WINAPI ScriptXtoCP(int iX, */ HRESULT WINAPI ScriptBreak(const WCHAR *chars, int count, const SCRIPT_ANALYSIS *sa, SCRIPT_LOGATTR *la) { - unsigned int i; + int i; TRACE("(%s, %d, %p, %p)\n", debugstr_wn(chars, count), count, sa, la); @@ -1220,7 +1220,8 @@ complex_ranges[] = */ HRESULT WINAPI ScriptIsComplex(const WCHAR *chars, int len, DWORD flag) { - unsigned int i, j; + int i; + unsigned int j; TRACE("(%s,%d,0x%x)\n", debugstr_wn(chars, len), len, flag); @@ -1336,7 +1337,7 @@ HRESULT WINAPI ScriptPlace(HDC hdc, SCRIPT_CACHE *psc, const WORD *pwGlyphs, SCRIPT_ANALYSIS *psa, int *piAdvance, GOFFSET *pGoffset, ABC *pABC ) { HRESULT hr; - unsigned int i; + int i; TRACE("(%p, %p, %p, %s, %d, %p, %p, %p)\n", hdc, psc, pwGlyphs, debugstr_wn(pwGlyphs, cGlyphs), cGlyphs, psva, psa, piAdvance); @@ -1400,7 +1401,7 @@ HRESULT WINAPI ScriptGetCMap(HDC hdc, SCRIPT_CACHE *psc, const WCHAR *pwcInChars int cChars, DWORD dwFlags, WORD *pwOutGlyphs) { HRESULT hr; - unsigned int i; + int i; TRACE("(%p,%p,%s,%d,0x%x,%p)\n", hdc, psc, debugstr_wn(pwcInChars, cChars), cChars, dwFlags, pwOutGlyphs); @@ -1642,7 +1643,7 @@ HRESULT WINAPI ScriptStringValidate(SCRIPT_STRING_ANALYSIS ssa) */ const SIZE * WINAPI ScriptString_pSize(SCRIPT_STRING_ANALYSIS ssa) { - unsigned int i, j; + int i, j; StringAnalysis *analysis = ssa; TRACE("(%p)\n", ssa); @@ -1721,7 +1722,8 @@ const int * WINAPI ScriptString_pcOutChars(SCRIPT_STRING_ANALYSIS ssa) */ HRESULT WINAPI ScriptStringGetOrder(SCRIPT_STRING_ANALYSIS ssa, UINT *order) { - unsigned int i, j, k; + int i, j; + unsigned int k; StringAnalysis *analysis = ssa; TRACE("(%p)\n", ssa); diff --git a/dlls/version/info.c b/dlls/version/info.c index 51e25b3e219..cad3251f514 100644 --- a/dlls/version/info.c +++ b/dlls/version/info.c @@ -777,6 +777,9 @@ BOOL WINAPI VerQueryValueA( LPCVOID pBlock, LPCSTR lpSubBlock, if (!pBlock) return FALSE; + if (lpSubBlock == NULL || lpSubBlock[0] == '\0') + lpSubBlock = rootA; + if ( !VersionInfoIs16( info ) ) { BOOL ret; @@ -820,6 +823,7 @@ BOOL WINAPI VerQueryValueA( LPCVOID pBlock, LPCSTR lpSubBlock, BOOL WINAPI VerQueryValueW( LPCVOID pBlock, LPCWSTR lpSubBlock, LPVOID *lplpBuffer, PUINT puLen ) { + static const WCHAR nullW[] = { 0 }; static const WCHAR rootW[] = { '\\', 0 }; static const WCHAR varfileinfoW[] = { '\\','V','a','r','F','i','l','e','I','n','f','o', '\\','T','r','a','n','s','l','a','t','i','o','n', 0 }; @@ -832,6 +836,9 @@ BOOL WINAPI VerQueryValueW( LPCVOID pBlock, LPCWSTR lpSubBlock, if (!pBlock) return FALSE; + if (lpSubBlock == NULL || lpSubBlock[0] == nullW[0]) + lpSubBlock = rootW; + if ( VersionInfoIs16( info ) ) { BOOL ret; diff --git a/dlls/version/tests/info.c b/dlls/version/tests/info.c index a64d911497e..fa120df0293 100644 --- a/dlls/version/tests/info.c +++ b/dlls/version/tests/info.c @@ -248,6 +248,13 @@ static void test_info(void) if (!boolret) goto cleanup; + boolret = VerQueryValueA( pVersionInfo, NULL, (LPVOID *)&pFixedVersionInfo, &uiLength ); + ok (boolret || GetLastError() == NO_ERROR /* Win98 */, + "VerQueryValueA failed: GetLastError = %u\n", GetLastError()); + + boolret = VerQueryValueA( pVersionInfo, "", (LPVOID *)&pFixedVersionInfo, &uiLength ); + ok (boolret, "VerQueryValueA failed: GetLastError = %u\n", GetLastError()); + boolret = VerQueryValueA( pVersionInfo, backslash, (LPVOID *)&pFixedVersionInfo, &uiLength ); ok (boolret, "VerQueryValueA failed: GetLastError = %u\n", GetLastError()); if (!boolret) @@ -286,6 +293,7 @@ static void test_32bit_win(void) WCHAR mypathW[MAX_PATH]; char rootA[] = "\\"; WCHAR rootW[] = { '\\', 0 }; + WCHAR emptyW[] = { 0 }; char varfileinfoA[] = "\\VarFileInfo\\Translation"; WCHAR varfileinfoW[] = { '\\','V','a','r','F','i','l','e','I','n','f','o', '\\','T','r','a','n','s','l','a','t','i','o','n', 0 }; @@ -392,6 +400,12 @@ static void test_32bit_win(void) if (is_unicode_enabled) { + retW = VerQueryValueW( pVersionInfoW, NULL, (LPVOID *)&pBufW, &uiLengthW ); + ok (retW, "VerQueryValueW failed: GetLastError = %u\n", GetLastError()); + + retW = VerQueryValueW( pVersionInfoW, emptyW, (LPVOID *)&pBufW, &uiLengthW ); + ok (retW, "VerQueryValueW failed: GetLastError = %u\n", GetLastError()); + retW = VerQueryValueW( pVersionInfoW, rootW, (LPVOID *)&pBufW, &uiLengthW ); ok (retW, "VerQueryValueW failed: GetLastError = %u\n", GetLastError()); ok ( uiLengthA == sizeof(VS_FIXEDFILEINFO), "Size (%d) doesn't match the size of the VS_FIXEDFILEINFO struct\n", uiLengthA); diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index 493c5d2df9a..12148e6f509 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -1089,18 +1089,26 @@ static void shader_hw_map2gl(SHADER_OPCODE_ARG* arg) SHADER_BUFFER* buffer = arg->buffer; DWORD dst = arg->dst; DWORD* src = arg->src; - - char tmpLine[256]; + char arguments[256]; unsigned int i; if (shader_is_pshader_version(shader->baseShader.hex_version)) { + /* Output token related */ + char output_rname[256]; + char output_wmask[20]; + char operands[4][100]; BOOL saturate = FALSE; BOOL centroid = FALSE; BOOL partialprecision = FALSE; + const char *modifier; DWORD shift; - strcpy(tmpLine, curOpcode->glname); + if (!curOpcode->num_params) + { + ERR("Opcode \"%s\" has no parameters\n", curOpcode->name); + return; + } /* Process modifiers */ if (dst & WINED3DSP_DSTMOD_MASK) @@ -1118,82 +1126,90 @@ static void shader_hw_map2gl(SHADER_OPCODE_ARG* arg) FIXME("Unhandled modifier(%#x)\n", mask >> WINED3DSP_DSTMOD_SHIFT); } shift = (dst & WINED3DSP_DSTSHIFT_MASK) >> WINED3DSP_DSTSHIFT_SHIFT; + modifier = (saturate && !shift) ? "_SAT" : ""; - /* Generate input and output registers */ - if (curOpcode->num_params > 0) - { - /* Output token related */ - char output_rname[256]; - char output_wmask[20]; - char operands[4][100]; + /* Generate input register names (with modifiers) */ + for (i = 1; i < curOpcode->num_params; ++i) + pshader_gen_input_modifier_line(arg->shader, buffer, src[i-1], i-1, operands[i]); - /* Generate input register names (with modifiers) */ - for (i = 1; i < curOpcode->num_params; ++i) - pshader_gen_input_modifier_line(arg->shader, buffer, src[i-1], i-1, operands[i]); - - /* Handle output register */ - pshader_get_register_name(arg->shader, dst, output_rname); - strcpy(operands[0], output_rname); - shader_arb_get_write_mask(arg, dst, output_wmask); - strcat(operands[0], output_wmask); - - if (saturate && (shift == 0)) - strcat(tmpLine, "_SAT"); - strcat(tmpLine, " "); - strcat(tmpLine, operands[0]); - for (i = 1; i < curOpcode->num_params; i++) - { - strcat(tmpLine, ", "); - strcat(tmpLine, operands[i]); - } - strcat(tmpLine,";\n"); - shader_addline(buffer, tmpLine); + /* Handle output register */ + pshader_get_register_name(arg->shader, dst, output_rname); + strcpy(operands[0], output_rname); + shader_arb_get_write_mask(arg, dst, output_wmask); + strcat(operands[0], output_wmask); - /* A shift requires another line. */ - if (shift != 0) - pshader_gen_output_modifier_line(buffer, saturate, output_wmask, shift, output_rname); + arguments[0] = '\0'; + strcat(arguments, operands[0]); + for (i = 1; i < curOpcode->num_params; i++) + { + strcat(arguments, ", "); + strcat(arguments, operands[i]); } + shader_addline(buffer, "%s%s %s;\n", curOpcode->glname, modifier, arguments); + + /* A shift requires another line. */ + if (shift) pshader_gen_output_modifier_line(buffer, saturate, output_wmask, shift, output_rname); } else { - if ((curOpcode->opcode == WINED3DSIO_MOV && shader_get_regtype(dst) == WINED3DSPR_ADDR) - || curOpcode->opcode == WINED3DSIO_MOVA) { - memset(tmpLine, 0, sizeof(tmpLine)); - if (((IWineD3DVertexShaderImpl *)shader)->rel_offset) - { - vshader_program_add_param(arg, src[0], TRUE, tmpLine); - shader_addline(buffer, "ADD TMP.x, %s, helper_const.z;\n", tmpLine); - shader_addline(buffer, "ARL A0.x, TMP.x;\n"); - } else { - /* Apple's ARB_vertex_program implementation does not accept an ARL source argument - * with more than one component. Thus replicate the first source argument over all - * 4 components. For example, .xyzw -> .x (or better: .xxxx), .zwxy -> .z, etc) - */ - DWORD parm = src[0] & ~(WINED3DVS_SWIZZLE_MASK); - if((src[0] & WINED3DVS_X_W) == WINED3DVS_X_W) { - parm |= WINED3DVS_X_W | WINED3DVS_Y_W | WINED3DVS_Z_W | WINED3DVS_W_W; - } else if((src[0] & WINED3DVS_X_Z) == WINED3DVS_X_Z) { - parm |= WINED3DVS_X_Z | WINED3DVS_Y_Z | WINED3DVS_Z_Z | WINED3DVS_W_Z; - } else if((src[0] & WINED3DVS_X_Y) == WINED3DVS_X_Y) { - parm |= WINED3DVS_X_Y | WINED3DVS_Y_Y | WINED3DVS_Z_Y | WINED3DVS_W_Y; - } else if((src[0] & WINED3DVS_X_X) == WINED3DVS_X_X) { - parm |= WINED3DVS_X_X | WINED3DVS_Y_X | WINED3DVS_Z_X | WINED3DVS_W_X; - } - vshader_program_add_param(arg, parm, TRUE, tmpLine); - shader_addline(buffer, "ARL A0.x, %s;\n", tmpLine); - } - return; - } else - strcpy(tmpLine, curOpcode->glname); + /* Note that vshader_program_add_param() adds spaces. */ + arguments[0] = '\0'; if (curOpcode->num_params > 0) { - vshader_program_add_param(arg, dst, FALSE, tmpLine); + vshader_program_add_param(arg, dst, FALSE, arguments); for (i = 1; i < curOpcode->num_params; ++i) { - strcat(tmpLine, ","); - vshader_program_add_param(arg, src[i-1], TRUE, tmpLine); + strcat(arguments, ","); + vshader_program_add_param(arg, src[i-1], TRUE, arguments); } } - shader_addline(buffer, "%s;\n", tmpLine); + shader_addline(buffer, "%s%s;\n", curOpcode->glname, arguments); + } +} + +static void shader_hw_mov(SHADER_OPCODE_ARG *arg) +{ + IWineD3DBaseShaderImpl *shader = (IWineD3DBaseShaderImpl*)arg->shader; + + if ((WINED3DSHADER_VERSION_MAJOR(shader->baseShader.hex_version) == 1 + && !shader_is_pshader_version(shader->baseShader.hex_version) + && shader_get_regtype(arg->dst) == WINED3DSPR_ADDR) + || arg->opcode->opcode == WINED3DSIO_MOVA) + { + SHADER_BUFFER *buffer = arg->buffer; + char src0_param[256]; + + if (arg->opcode->opcode == WINED3DSIO_MOVA) + FIXME("mova should round\n"); + + src0_param[0] = '\0'; + if (((IWineD3DVertexShaderImpl *)shader)->rel_offset) + { + vshader_program_add_param(arg, arg->src[0], TRUE, src0_param); + shader_addline(buffer, "ADD TMP.x, %s, helper_const.z;\n", src0_param); + shader_addline(buffer, "ARL A0.x, TMP.x;\n"); + } + else + { + /* Apple's ARB_vertex_program implementation does not accept an ARL source argument + * with more than one component. Thus replicate the first source argument over all + * 4 components. For example, .xyzw -> .x (or better: .xxxx), .zwxy -> .z, etc) + */ + DWORD parm = arg->src[0] & ~(WINED3DVS_SWIZZLE_MASK); + if((arg->src[0] & WINED3DVS_X_W) == WINED3DVS_X_W) + parm |= WINED3DVS_X_W | WINED3DVS_Y_W | WINED3DVS_Z_W | WINED3DVS_W_W; + else if((arg->src[0] & WINED3DVS_X_Z) == WINED3DVS_X_Z) + parm |= WINED3DVS_X_Z | WINED3DVS_Y_Z | WINED3DVS_Z_Z | WINED3DVS_W_Z; + else if((arg->src[0] & WINED3DVS_X_Y) == WINED3DVS_X_Y) + parm |= WINED3DVS_X_Y | WINED3DVS_Y_Y | WINED3DVS_Z_Y | WINED3DVS_W_Y; + else if((arg->src[0] & WINED3DVS_X_X) == WINED3DVS_X_X) + parm |= WINED3DVS_X_X | WINED3DVS_Y_X | WINED3DVS_Z_X | WINED3DVS_W_X; + vshader_program_add_param(arg, parm, TRUE, src0_param); + shader_addline(buffer, "ARL A0.x, %s;\n", src0_param); + } + } + else + { + shader_hw_map2gl(arg); } } @@ -2288,8 +2304,8 @@ static const SHADER_HANDLER shader_arb_instruction_handler_table[WINED3DSIH_TABL /* WINED3DSIH_MAD */ shader_hw_map2gl, /* WINED3DSIH_MAX */ shader_hw_map2gl, /* WINED3DSIH_MIN */ shader_hw_map2gl, - /* WINED3DSIH_MOV */ shader_hw_map2gl, - /* WINED3DSIH_MOVA */ shader_hw_map2gl, + /* WINED3DSIH_MOV */ shader_hw_mov, + /* WINED3DSIH_MOVA */ shader_hw_mov, /* WINED3DSIH_MUL */ shader_hw_map2gl, /* WINED3DSIH_NOP */ shader_hw_map2gl, /* WINED3DSIH_NRM */ shader_hw_nrm, @@ -2356,7 +2372,7 @@ const shader_backend_t arb_program_shader_backend = { struct arbfp_ffp_desc { - struct ffp_desc parent; + struct ffp_frag_desc parent; GLuint shader; unsigned int num_textures_used; }; @@ -2385,7 +2401,7 @@ static HRESULT arbfp_alloc(IWineD3DDevice *iface) { if(!This->fragment_priv) return E_OUTOFMEMORY; } priv = (struct shader_arb_priv *) This->fragment_priv; - priv->fragment_shaders = hash_table_create(ffp_program_key_hash, ffp_program_key_compare); + priv->fragment_shaders = hash_table_create(ffp_frag_program_key_hash, ffp_frag_program_key_compare); priv->use_arbfp_fixed_func = TRUE; return WINED3D_OK; } @@ -2454,26 +2470,37 @@ static void state_texfactor_arbfp(DWORD state, IWineD3DStateBlockImpl *statebloc float col[4]; IWineD3DDeviceImpl *device = stateblock->wineD3DDevice; - /* Do not overwrite pixel shader constants if a pshader is in use */ - if(use_ps(device)) return; - - D3DCOLORTOGLFLOAT4(stateblock->renderState[WINED3DRS_TEXTUREFACTOR], col); - GL_EXTCALL(glProgramEnvParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, ARB_FFP_CONST_TFACTOR, col)); - checkGLcall("glProgramEnvParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, ARB_FFP_CONST_TFACTOR, col)"); - + /* Don't load the parameter if we're using an arbfp pixel shader, otherwise we'll overwrite + * application provided constants + */ if(device->shader_backend == &arb_program_shader_backend) { + if(use_ps(device)) return; + device = stateblock->wineD3DDevice; device->activeContext->pshader_const_dirty[ARB_FFP_CONST_TFACTOR] = 1; device->highest_dirty_ps_const = max(device->highest_dirty_ps_const, ARB_FFP_CONST_TFACTOR + 1); } + + D3DCOLORTOGLFLOAT4(stateblock->renderState[WINED3DRS_TEXTUREFACTOR], col); + GL_EXTCALL(glProgramEnvParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, ARB_FFP_CONST_TFACTOR, col)); + checkGLcall("glProgramEnvParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, ARB_FFP_CONST_TFACTOR, col)"); + } static void state_arb_specularenable(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) { float col[4]; IWineD3DDeviceImpl *device = stateblock->wineD3DDevice; - /* Do not overwrite pixel shader constants if a pshader is in use */ - if(use_ps(device)) return; + /* Don't load the parameter if we're using an arbfp pixel shader, otherwise we'll overwrite + * application provided constants + */ + if(device->shader_backend == &arb_program_shader_backend) { + if(use_ps(device)) return; + + device = stateblock->wineD3DDevice; + device->activeContext->pshader_const_dirty[ARB_FFP_CONST_SPECULAR_ENABLE] = 1; + device->highest_dirty_ps_const = max(device->highest_dirty_ps_const, ARB_FFP_CONST_SPECULAR_ENABLE + 1); + } if(stateblock->renderState[WINED3DRS_SPECULARENABLE]) { /* The specular color has no alpha */ @@ -2485,12 +2512,6 @@ static void state_arb_specularenable(DWORD state, IWineD3DStateBlockImpl *stateb } GL_EXTCALL(glProgramEnvParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, ARB_FFP_CONST_SPECULAR_ENABLE, col)); checkGLcall("glProgramEnvParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, ARB_FFP_CONST_SPECULAR_ENABLE, col)"); - - if(device->shader_backend == &arb_program_shader_backend) { - device = stateblock->wineD3DDevice; - device->activeContext->pshader_const_dirty[ARB_FFP_CONST_SPECULAR_ENABLE] = 1; - device->highest_dirty_ps_const = max(device->highest_dirty_ps_const, ARB_FFP_CONST_SPECULAR_ENABLE + 1); - } } static void set_bumpmat_arbfp(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) { @@ -2508,8 +2529,14 @@ static void set_bumpmat_arbfp(DWORD state, IWineD3DStateBlockImpl *stateblock, W device->StateTable[STATE_PIXELSHADERCONSTANT].apply(STATE_PIXELSHADERCONSTANT, stateblock, context); } } - /* Exit now, don't set the bumpmat below, otherwise we may overwrite pixel shader constants */ - return; + + if(device->shader_backend == &arb_program_shader_backend) { + /* Exit now, don't set the bumpmat below, otherwise we may overwrite pixel shader constants */ + return; + } + } else if(device->shader_backend == &arb_program_shader_backend) { + device->activeContext->pshader_const_dirty[ARB_FFP_CONST_BUMPMAT(stage)] = 1; + device->highest_dirty_ps_const = max(device->highest_dirty_ps_const, ARB_FFP_CONST_BUMPMAT(stage) + 1); } mat[0][0] = *((float *) &stateblock->textureState[stage][WINED3DTSS_BUMPENVMAT00]); @@ -2519,11 +2546,6 @@ static void set_bumpmat_arbfp(DWORD state, IWineD3DStateBlockImpl *stateblock, W GL_EXTCALL(glProgramEnvParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, ARB_FFP_CONST_BUMPMAT(stage), &mat[0][0])); checkGLcall("glProgramEnvParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, ARB_FFP_CONST_BUMPMAT(stage), &mat[0][0])"); - - if(device->shader_backend == &arb_program_shader_backend) { - device->activeContext->pshader_const_dirty[ARB_FFP_CONST_BUMPMAT(stage)] = 1; - device->highest_dirty_ps_const = max(device->highest_dirty_ps_const, ARB_FFP_CONST_BUMPMAT(stage) + 1); - } } static void tex_bumpenvlum_arbfp(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) { @@ -2541,8 +2563,14 @@ static void tex_bumpenvlum_arbfp(DWORD state, IWineD3DStateBlockImpl *stateblock device->StateTable[STATE_PIXELSHADERCONSTANT].apply(STATE_PIXELSHADERCONSTANT, stateblock, context); } } - /* Exit now, don't set the bumpmat below, otherwise we may overwrite pixel shader constants */ - return; + + if(device->shader_backend == &arb_program_shader_backend) { + /* Exit now, don't set the bumpmat below, otherwise we may overwrite pixel shader constants */ + return; + } + } else if(device->shader_backend == &arb_program_shader_backend) { + device->activeContext->pshader_const_dirty[ARB_FFP_CONST_LUMINANCE(stage)] = 1; + device->highest_dirty_ps_const = max(device->highest_dirty_ps_const, ARB_FFP_CONST_LUMINANCE(stage) + 1); } param[0] = *((float *) &stateblock->textureState[stage][WINED3DTSS_BUMPENVLSCALE]); @@ -2552,11 +2580,6 @@ static void tex_bumpenvlum_arbfp(DWORD state, IWineD3DStateBlockImpl *stateblock GL_EXTCALL(glProgramEnvParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, ARB_FFP_CONST_LUMINANCE(stage), param)); checkGLcall("glProgramEnvParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, ARB_FFP_CONST_LUMINANCE(stage), param)"); - - if(device->shader_backend == &arb_program_shader_backend) { - device->activeContext->pshader_const_dirty[ARB_FFP_CONST_LUMINANCE(stage)] = 1; - device->highest_dirty_ps_const = max(device->highest_dirty_ps_const, ARB_FFP_CONST_LUMINANCE(stage) + 1); - } } static const char *get_argreg(SHADER_BUFFER *buffer, DWORD argnum, unsigned int stage, DWORD arg) { @@ -2769,7 +2792,7 @@ static void gen_ffp_instr(SHADER_BUFFER *buffer, unsigned int stage, BOOL color, } /* The stateblock is passed for GLINFO_LOCATION */ -static GLuint gen_arbfp_ffp_shader(struct ffp_settings *settings, IWineD3DStateBlockImpl *stateblock) { +static GLuint gen_arbfp_ffp_shader(struct ffp_frag_settings *settings, IWineD3DStateBlockImpl *stateblock) { unsigned int stage; SHADER_BUFFER buffer; BOOL tex_read[MAX_TEXTURES] = {FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE}; @@ -3037,7 +3060,7 @@ static void fragment_prog_arbfp(DWORD state, IWineD3DStateBlockImpl *stateblock, struct shader_arb_priv *priv = (struct shader_arb_priv *) device->fragment_priv; BOOL use_pshader = use_ps(device); BOOL use_vshader = use_vs(device); - struct ffp_settings settings; + struct ffp_frag_settings settings; struct arbfp_ffp_desc *desc; unsigned int i; @@ -3059,8 +3082,8 @@ static void fragment_prog_arbfp(DWORD state, IWineD3DStateBlockImpl *stateblock, IWineD3DPixelShader_CompileShader(stateblock->pixelShader); } else { /* Find or create a shader implementing the fixed function pipeline settings, then activate it */ - gen_ffp_op(stateblock, &settings, FALSE); - desc = (struct arbfp_ffp_desc *) find_ffp_shader(priv->fragment_shaders, &settings); + gen_ffp_frag_op(stateblock, &settings, FALSE); + desc = (struct arbfp_ffp_desc *) find_ffp_frag_shader(priv->fragment_shaders, &settings); if(!desc) { desc = HeapAlloc(GetProcessHeap(), 0, sizeof(*desc)); if(!desc) { @@ -3075,7 +3098,7 @@ static void fragment_prog_arbfp(DWORD state, IWineD3DStateBlockImpl *stateblock, memcpy(&desc->parent.settings, &settings, sizeof(settings)); desc->shader = gen_arbfp_ffp_shader(&settings, stateblock); - add_ffp_shader(priv->fragment_shaders, &desc->parent); + add_ffp_frag_shader(priv->fragment_shaders, &desc->parent); TRACE("Allocated fixed function replacement shader descriptor %p\n", desc); } diff --git a/dlls/wined3d/ati_fragment_shader.c b/dlls/wined3d/ati_fragment_shader.c index 10100e2f904..a53108e1659 100644 --- a/dlls/wined3d/ati_fragment_shader.c +++ b/dlls/wined3d/ati_fragment_shader.c @@ -43,7 +43,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d_shader); /* GL_ATI_fragment_shader specific fixed function pipeline description. "Inherits" from the common one */ struct atifs_ffp_desc { - struct ffp_desc parent; + struct ffp_frag_desc parent; GLuint shader; unsigned int num_textures_used; }; @@ -803,13 +803,13 @@ static GLuint gen_ati_shader(struct texture_stage_op op[MAX_TEXTURES], WineD3D_G static void set_tex_op_atifs(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) { IWineD3DDeviceImpl *This = stateblock->wineD3DDevice; struct atifs_ffp_desc *desc; - struct ffp_settings settings; + struct ffp_frag_settings settings; struct atifs_private_data *priv = (struct atifs_private_data *) This->fragment_priv; DWORD mapped_stage; unsigned int i; - gen_ffp_op(stateblock, &settings, TRUE); - desc = (struct atifs_ffp_desc *) find_ffp_shader(priv->fragment_shaders, &settings); + gen_ffp_frag_op(stateblock, &settings, TRUE); + desc = (struct atifs_ffp_desc *) find_ffp_frag_shader(priv->fragment_shaders, &settings); if(!desc) { desc = HeapAlloc(GetProcessHeap(), 0, sizeof(*desc)); if(!desc) { @@ -824,7 +824,7 @@ static void set_tex_op_atifs(DWORD state, IWineD3DStateBlockImpl *stateblock, Wi memcpy(&desc->parent.settings, &settings, sizeof(settings)); desc->shader = gen_ati_shader(settings.op, &GLINFO_LOCATION); - add_ffp_shader(priv->fragment_shaders, &desc->parent); + add_ffp_frag_shader(priv->fragment_shaders, &desc->parent); TRACE("Allocated fixed function replacement shader descriptor %p\n", desc); } @@ -1074,7 +1074,7 @@ static HRESULT atifs_alloc(IWineD3DDevice *iface) { return E_OUTOFMEMORY; } priv = (struct atifs_private_data *) This->fragment_priv; - priv->fragment_shaders = hash_table_create(ffp_program_key_hash, ffp_program_key_compare); + priv->fragment_shaders = hash_table_create(ffp_frag_program_key_hash, ffp_frag_program_key_compare); return WINED3D_OK; } diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index 62a4bf4d7bd..acfe36b7b35 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -191,7 +191,7 @@ static void context_check_fbo_status(IWineD3DDevice *iface) TRACE("FBO complete\n"); } else { IWineD3DSurfaceImpl *attachment; - int i; + unsigned int i; FIXME("FBO status %s (%#x)\n", debug_fbostatus(status), status); /* Dump the FBO attachments */ @@ -446,7 +446,8 @@ static WineD3DContext *AddContextToArray(IWineD3DDeviceImpl *This, HWND win_hand /* This function takes care of WineD3D pixel format selection. */ static int WineD3D_ChoosePixelFormat(IWineD3DDeviceImpl *This, HDC hdc, WINED3DFORMAT ColorFormat, WINED3DFORMAT DepthStencilFormat, BOOL auxBuffers, int numSamples, BOOL pbuffer, BOOL findCompatible) { - int iPixelFormat=0, matchtry; + int iPixelFormat=0; + unsigned int matchtry; short redBits, greenBits, blueBits, alphaBits, colorBits; short depthBits=0, stencilBits=0; @@ -1214,7 +1215,7 @@ static inline void SetupForBlit(IWineD3DDeviceImpl *This, WineD3DContext *contex * *****************************************************************************/ static WineD3DContext *findThreadContextForSwapChain(IWineD3DSwapChain *swapchain, DWORD tid) { - int i; + unsigned int i; for(i = 0; i < ((IWineD3DSwapChainImpl *) swapchain)->num_contexts; i++) { if(((IWineD3DSwapChainImpl *) swapchain)->context[i]->tid == tid) { @@ -1475,8 +1476,7 @@ static void apply_draw_buffer(IWineD3DDeviceImpl *This, IWineD3DSurface *target, *****************************************************************************/ void ActivateContext(IWineD3DDeviceImpl *This, IWineD3DSurface *target, ContextUsage usage) { DWORD tid = GetCurrentThreadId(); - int i; - DWORD dirtyState, idx; + DWORD i, dirtyState, idx; BYTE shift; WineD3DContext *context; const struct StateEntry *StateTable = This->StateTable; diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 83bc436dce9..0cb539b7b47 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1152,8 +1152,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateCubeTexture(IWineD3DDevice *iface if(hr!= WINED3D_OK) { /* clean up */ - int k; - int l; + unsigned int k; + unsigned int l; for (l = 0; l < j; l++) { IWineD3DSurface_Release(object->surfaces[l][i]); } @@ -1573,7 +1573,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateSwapChain(IWineD3DDevice* iface, * Create the back, front and stencil buffers *******************/ if(object->presentParms.BackBufferCount > 0) { - int i; + UINT i; object->backBuffer = HeapAlloc(GetProcessHeap(), 0, sizeof(IWineD3DSurface *) * object->presentParms.BackBufferCount); if(!object->backBuffer) { @@ -1667,7 +1667,7 @@ error: } if (object->backBuffer) { - int i; + UINT i; for(i = 0; i < object->presentParms.BackBufferCount; i++) { if(object->backBuffer[i]) { IWineD3DSurface_GetParent(object->backBuffer[i], &bufferParent); @@ -3623,7 +3623,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetVertexShaderConstantF( UINT count) { IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; - int i; + UINT i; TRACE("(iface %p, srcData %p, start %d, count %d)\n", iface, srcData, start, count); @@ -3663,7 +3663,7 @@ CONST float *srcData, UINT count) { IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; - int i; + UINT i; TRACE("(iface %p, srcData %p, start %d, count %d)\n", iface, srcData, start, count); @@ -4052,7 +4052,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetPixelShaderConstantF( UINT count) { IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; - int i; + UINT i; TRACE("(iface %p, srcData %p, start %d, count %d)\n", iface, srcData, start, count); @@ -4092,7 +4092,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetPixelShaderConstantF_DirtyConst( UINT count) { IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; - int i; + UINT i; TRACE("(iface %p, srcData %p, start %d, count %d)\n", iface, srcData, start, count); @@ -4148,7 +4148,7 @@ process_vertices_strided(IWineD3DDeviceImpl *This, DWORD dwDestIndex, DWORD dwCo WINED3DVIEWPORT vp; WINED3DMATRIX mat, proj_mat, view_mat, world_mat; BOOL doClip; - int numTextures; + DWORD numTextures; if (lpStrideData->u.s.normal.lpData) { WARN(" lighting state not saved yet... Some strange stuff may happen !\n"); @@ -7187,7 +7187,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Reset(IWineD3DDevice* iface, WINED3DPRE pPresentationParameters->BackBufferHeight != swapchain->presentParms.BackBufferHeight)) { WINED3DVIEWPORT vp; - int i; + UINT i; vp.X = 0; vp.Y = 0; diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index 573c23c1743..b9d28d4720c 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -1410,16 +1410,30 @@ static void state_psizemin_w(DWORD state, IWineD3DStateBlockImpl *stateblock, Wi if(tmpvalue.f != 1.0) { FIXME("WINED3DRS_POINTSIZE_MIN not supported on this opengl, value is %f\n", tmpvalue.f); } + tmpvalue.d = stateblock->renderState[WINED3DRS_POINTSIZE_MAX]; + if(tmpvalue.f != 64.0) { + FIXME("WINED3DRS_POINTSIZE_MAX not supported on this opengl, value is %f\n", tmpvalue.f); + } + } static void state_psizemin_ext(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) { union { DWORD d; float f; - } tmpvalue; + } min, max; - tmpvalue.d = stateblock->renderState[WINED3DRS_POINTSIZE_MIN]; - GL_EXTCALL(glPointParameterfEXT)(GL_POINT_SIZE_MIN_EXT, tmpvalue.f); + min.d = stateblock->renderState[WINED3DRS_POINTSIZE_MIN]; + max.d = stateblock->renderState[WINED3DRS_POINTSIZE_MAX]; + + /* Max point size trumps min point size */ + if(min.f > max.f) { + min.f = max.f; + } + + GL_EXTCALL(glPointParameterfEXT)(GL_POINT_SIZE_MIN_EXT, min.f); + checkGLcall("glPointParameterfEXT(...)"); + GL_EXTCALL(glPointParameterfEXT)(GL_POINT_SIZE_MAX_EXT, max.f); checkGLcall("glPointParameterfEXT(...)"); } @@ -1427,45 +1441,20 @@ static void state_psizemin_arb(DWORD state, IWineD3DStateBlockImpl *stateblock, union { DWORD d; float f; - } tmpvalue; + } min, max; - tmpvalue.d = stateblock->renderState[WINED3DRS_POINTSIZE_MIN]; - GL_EXTCALL(glPointParameterfARB)(GL_POINT_SIZE_MIN_ARB, tmpvalue.f); - checkGLcall("glPointParameterfARB(...)"); -} + min.d = stateblock->renderState[WINED3DRS_POINTSIZE_MIN]; + max.d = stateblock->renderState[WINED3DRS_POINTSIZE_MAX]; -static void state_psizemax_arb(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) { - union { - DWORD d; - float f; - } tmpvalue; + /* Max point size trumps min point size */ + if(min.f > max.f) { + min.f = max.f; + } - tmpvalue.d = stateblock->renderState[WINED3DRS_POINTSIZE_MAX]; - GL_EXTCALL(glPointParameterfARB)(GL_POINT_SIZE_MAX_ARB, tmpvalue.f); + GL_EXTCALL(glPointParameterfARB)(GL_POINT_SIZE_MIN_ARB, min.f); + checkGLcall("glPointParameterfARB(...)"); + GL_EXTCALL(glPointParameterfARB)(GL_POINT_SIZE_MAX_ARB, max.f); checkGLcall("glPointParameterfARB(...)"); -} - -static void state_psizemax_ext(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) { - union { - DWORD d; - float f; - } tmpvalue; - - tmpvalue.d = stateblock->renderState[WINED3DRS_POINTSIZE_MAX]; - GL_EXTCALL(glPointParameterfEXT)(GL_POINT_SIZE_MAX_EXT, tmpvalue.f); - checkGLcall("glPointParameterfEXT(...)"); -} - -static void state_psizemax_w(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) { - union { - DWORD d; - float f; - } tmpvalue; - - tmpvalue.d = stateblock->renderState[WINED3DRS_POINTSIZE_MAX]; - if(tmpvalue.f != 64.0) { - FIXME("WINED3DRS_POINTSIZE_MAX not supported on this opengl, value is %f\n", tmpvalue.f); - } } static void state_pscale(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) { @@ -5320,9 +5309,9 @@ const struct StateEntryTemplate ffp_vertexstate_template[] = { { STATE_RENDER(WINED3DRS_POINTSCALE_A), { STATE_RENDER(WINED3DRS_POINTSCALEENABLE), state_pscale }, 0 }, { STATE_RENDER(WINED3DRS_POINTSCALE_B), { STATE_RENDER(WINED3DRS_POINTSCALEENABLE), state_pscale }, 0 }, { STATE_RENDER(WINED3DRS_POINTSCALE_C), { STATE_RENDER(WINED3DRS_POINTSCALEENABLE), state_pscale }, 0 }, - { STATE_RENDER(WINED3DRS_POINTSIZE_MAX), { STATE_RENDER(WINED3DRS_POINTSIZE_MAX), state_psizemax_arb }, ARB_POINT_PARAMETERS }, - { STATE_RENDER(WINED3DRS_POINTSIZE_MAX), { STATE_RENDER(WINED3DRS_POINTSIZE_MAX), state_psizemax_ext }, EXT_POINT_PARAMETERS }, - { STATE_RENDER(WINED3DRS_POINTSIZE_MAX), { STATE_RENDER(WINED3DRS_POINTSIZE_MAX), state_psizemax_w }, 0 }, + { STATE_RENDER(WINED3DRS_POINTSIZE_MAX), { STATE_RENDER(WINED3DRS_POINTSIZE_MIN), state_psizemin_arb }, ARB_POINT_PARAMETERS }, + { STATE_RENDER(WINED3DRS_POINTSIZE_MAX), { STATE_RENDER(WINED3DRS_POINTSIZE_MIN), state_psizemin_ext }, EXT_POINT_PARAMETERS }, + { STATE_RENDER(WINED3DRS_POINTSIZE_MAX), { STATE_RENDER(WINED3DRS_POINTSIZE_MIN), state_psizemin_w }, 0 }, /* pixel shaders need a different fog input */ { STATE_PIXELSHADER, { STATE_PIXELSHADER, apply_pshader_fog }, 0 }, /* Samplers for NP2 texture matrix adjustions. They are not needed if GL_ARB_texture_non_power_of_two is supported, diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 1fb27cc72fd..1849b83740c 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -4265,6 +4265,22 @@ struct coords { GLfloat x, y, z; }; +struct float_rect +{ + float l; + float t; + float r; + float b; +}; + +static inline void cube_coords_float(const RECT *r, UINT w, UINT h, struct float_rect *f) +{ + f->l = ((r->left * 2.0f) / w) - 1.0f; + f->t = ((r->top * 2.0f) / h) - 1.0f; + f->r = ((r->right * 2.0f) / w) - 1.0f; + f->b = ((r->bottom * 2.0f) / h) - 1.0f; +} + static inline void surface_blt_to_drawable(IWineD3DSurfaceImpl *This, const RECT *rect_in) { struct coords coords[4]; RECT rect; @@ -4272,6 +4288,7 @@ static inline void surface_blt_to_drawable(IWineD3DSurfaceImpl *This, const RECT IWineD3DBaseTexture *texture; IWineD3DDeviceImpl *device = This->resource.wineD3DDevice; GLenum bind_target; + struct float_rect f; if(rect_in) { rect = *rect_in; @@ -4314,50 +4331,56 @@ static inline void surface_blt_to_drawable(IWineD3DSurfaceImpl *This, const RECT case GL_TEXTURE_CUBE_MAP_POSITIVE_X: bind_target = GL_TEXTURE_CUBE_MAP_ARB; - coords[0].x = 1; coords[0].y = -1; coords[0].z = 1; - coords[1].x = 1; coords[1].y = 1; coords[1].z = 1; - coords[2].x = 1; coords[2].y = 1; coords[2].z = -1; - coords[3].x = 1; coords[3].y = -1; coords[3].z = -1; + cube_coords_float(&rect, This->pow2Width, This->pow2Height, &f); + coords[0].x = 1; coords[0].y = -f.t; coords[0].z = -f.l; + coords[1].x = 1; coords[1].y = -f.b; coords[1].z = -f.l; + coords[2].x = 1; coords[2].y = -f.b; coords[2].z = -f.r; + coords[3].x = 1; coords[3].y = -f.t; coords[3].z = -f.r; break; case GL_TEXTURE_CUBE_MAP_NEGATIVE_X: bind_target = GL_TEXTURE_CUBE_MAP_ARB; - coords[0].x = -1; coords[0].y = -1; coords[0].z = 1; - coords[1].x = -1; coords[1].y = 1; coords[1].z = 1; - coords[2].x = -1; coords[2].y = 1; coords[2].z = -1; - coords[3].x = -1; coords[3].y = -1; coords[3].z = -1; + cube_coords_float(&rect, This->pow2Width, This->pow2Height, &f); + coords[0].x = -1; coords[0].y = -f.t; coords[0].z = f.l; + coords[1].x = -1; coords[1].y = -f.b; coords[1].z = f.l; + coords[2].x = -1; coords[2].y = -f.b; coords[2].z = f.r; + coords[3].x = -1; coords[3].y = -f.t; coords[3].z = f.r; break; case GL_TEXTURE_CUBE_MAP_POSITIVE_Y: bind_target = GL_TEXTURE_CUBE_MAP_ARB; - coords[0].x = -1; coords[0].y = 1; coords[0].z = 1; - coords[1].x = 1; coords[1].y = 1; coords[1].z = 1; - coords[2].x = 1; coords[2].y = 1; coords[2].z = -1; - coords[3].x = -1; coords[3].y = 1; coords[3].z = -1; + cube_coords_float(&rect, This->pow2Width, This->pow2Height, &f); + coords[0].x = f.l; coords[0].y = 1; coords[0].z = f.t; + coords[1].x = f.l; coords[1].y = 1; coords[1].z = f.b; + coords[2].x = f.r; coords[2].y = 1; coords[2].z = f.b; + coords[3].x = f.r; coords[3].y = 1; coords[3].z = f.t; break; case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: bind_target = GL_TEXTURE_CUBE_MAP_ARB; - coords[0].x = -1; coords[0].y = -1; coords[0].z = 1; - coords[1].x = 1; coords[1].y = -1; coords[1].z = 1; - coords[2].x = 1; coords[2].y = -1; coords[2].z = -1; - coords[3].x = -1; coords[3].y = -1; coords[3].z = -1; + cube_coords_float(&rect, This->pow2Width, This->pow2Height, &f); + coords[0].x = f.l; coords[0].y = -1; coords[0].z = -f.t; + coords[1].x = f.l; coords[1].y = -1; coords[1].z = -f.b; + coords[2].x = f.r; coords[2].y = -1; coords[2].z = -f.b; + coords[3].x = f.r; coords[3].y = -1; coords[3].z = -f.t; break; case GL_TEXTURE_CUBE_MAP_POSITIVE_Z: bind_target = GL_TEXTURE_CUBE_MAP_ARB; - coords[0].x = -1; coords[0].y = -1; coords[0].z = 1; - coords[1].x = 1; coords[1].y = -1; coords[1].z = 1; - coords[2].x = 1; coords[2].y = -1; coords[2].z = 1; - coords[3].x = -1; coords[3].y = -1; coords[3].z = 1; + cube_coords_float(&rect, This->pow2Width, This->pow2Height, &f); + coords[0].x = f.l; coords[0].y = -f.t; coords[0].z = 1; + coords[1].x = f.l; coords[1].y = -f.b; coords[1].z = 1; + coords[2].x = f.r; coords[2].y = -f.b; coords[2].z = 1; + coords[3].x = f.r; coords[3].y = -f.t; coords[3].z = 1; break; case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: bind_target = GL_TEXTURE_CUBE_MAP_ARB; - coords[0].x = -1; coords[0].y = -1; coords[0].z = -1; - coords[1].x = 1; coords[1].y = -1; coords[1].z = -1; - coords[2].x = 1; coords[2].y = -1; coords[2].z = -1; - coords[3].x = -1; coords[3].y = -1; coords[3].z = -1; + cube_coords_float(&rect, This->pow2Width, This->pow2Height, &f); + coords[0].x = -f.l; coords[0].y = -f.t; coords[0].z = -1; + coords[1].x = -f.l; coords[1].y = -f.b; coords[1].z = -1; + coords[2].x = -f.r; coords[2].y = -f.b; coords[2].z = -1; + coords[3].x = -f.r; coords[3].y = -f.t; coords[3].z = -1; break; default: diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index 93cfc41a2f5..b49072fe4a5 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -1793,7 +1793,7 @@ void *hash_table_get(struct hash_table_t *table, void *key) } #define GLINFO_LOCATION stateblock->wineD3DDevice->adapter->gl_info -void gen_ffp_op(IWineD3DStateBlockImpl *stateblock, struct ffp_settings *settings, BOOL ignore_textype) { +void gen_ffp_frag_op(IWineD3DStateBlockImpl *stateblock, struct ffp_frag_settings *settings, BOOL ignore_textype) { #define ARG1 0x01 #define ARG2 0x02 #define ARG0 0x04 @@ -2013,13 +2013,13 @@ void gen_ffp_op(IWineD3DStateBlockImpl *stateblock, struct ffp_settings *setting } #undef GLINFO_LOCATION -struct ffp_desc *find_ffp_shader(struct hash_table_t *fragment_shaders, struct ffp_settings *settings) +struct ffp_frag_desc *find_ffp_frag_shader(struct hash_table_t *fragment_shaders, struct ffp_frag_settings *settings) { - return (struct ffp_desc *)hash_table_get(fragment_shaders, settings);} + return (struct ffp_frag_desc *)hash_table_get(fragment_shaders, settings);} -void add_ffp_shader(struct hash_table_t *shaders, struct ffp_desc *desc) { - struct ffp_settings *key = HeapAlloc(GetProcessHeap(), 0, sizeof(*key)); - /* Note that the key is the implementation independent part of the ffp_desc structure, +void add_ffp_frag_shader(struct hash_table_t *shaders, struct ffp_frag_desc *desc) { + struct ffp_frag_settings *key = HeapAlloc(GetProcessHeap(), 0, sizeof(*key)); + /* Note that the key is the implementation independent part of the ffp_frag_desc structure, * whereas desc points to an extended structure with implementation specific parts. * Make a copy of the key because hash_table_put takes ownership of it */ @@ -2121,8 +2121,8 @@ void sampler_texdim(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DCont } #undef GLINFO_LOCATION -unsigned int ffp_program_key_hash(void *key) { - struct ffp_settings *k = (struct ffp_settings *)key; +unsigned int ffp_frag_program_key_hash(void *key) { + struct ffp_frag_settings *k = (struct ffp_frag_settings *)key; unsigned int hash = 0, i; DWORD *blob; @@ -2147,9 +2147,9 @@ unsigned int ffp_program_key_hash(void *key) { return hash; } -BOOL ffp_program_key_compare(void *keya, void *keyb) { - struct ffp_settings *ka = (struct ffp_settings *)keya; - struct ffp_settings *kb = (struct ffp_settings *)keyb; +BOOL ffp_frag_program_key_compare(void *keya, void *keyb) { + struct ffp_frag_settings *ka = (struct ffp_frag_settings *)keya; + struct ffp_frag_settings *kb = (struct ffp_frag_settings *)keyb; return memcmp(ka, kb, sizeof(*ka)) == 0; } diff --git a/include/wine/wined3d_gl.h b/dlls/wined3d/wined3d_gl.h similarity index 99% rename from include/wine/wined3d_gl.h rename to dlls/wined3d/wined3d_gl.h index 603668880fa..4dba7d2c55b 100644 --- a/include/wine/wined3d_gl.h +++ b/dlls/wined3d/wined3d_gl.h @@ -1965,8 +1965,8 @@ typedef void (WINE_GLAPI * PGLFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint le /* GL_EXT_texture_env_dot3 */ #ifndef GL_EXT_texture_env_dot3 #define GL_EXT_texture_env_dot3 1 -#define GL_DOT3_RGB_EXT 0x8740 -#define GL_DOT3_RGBA_EXT 0x8741 +#define GL_DOT3_RGB_EXT 0x8740 +#define GL_DOT3_RGBA_EXT 0x8741 #endif /* GL_EXT_texture_lod_bias */ #ifndef GL_EXT_texture_lod_bias @@ -2740,7 +2740,7 @@ typedef void (WINE_GLAPI * PGLFNGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage #endif /** - * Point sprites + * Point sprites */ /* GL_ARB_point_sprite */ #ifndef GL_ARB_point_sprite @@ -2749,11 +2749,11 @@ typedef void (WINE_GLAPI * PGLFNGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage #define GL_COORD_REPLACE_ARB 0x8862 #endif /** - * @TODO: GL_NV_point_sprite + * @TODO: GL_NV_point_sprite */ /** - * Occlusion Queries + * Occlusion Queries */ /* GL_ARB_occlusion_query */ #ifndef GL_ARB_occlusion_query @@ -3192,8 +3192,8 @@ typedef void (WINE_GLAPI * PGLFNVERTEXATTRIBPOINTERPROC) (GLuint index, GLint si /**************************************************** - * OpenGL Official Version - * defines + * OpenGL Official Version + * defines ****************************************************/ /* GL_VERSION_1_3 */ #if !defined(GL_DOT3_RGBA) @@ -3396,7 +3396,7 @@ typedef enum _GL_SupportedExt { /**************************************************** - * #Defines + * #Defines ****************************************************/ #define GL_EXT_FUNCS_GEN \ /** ARB Extensions **/ \ @@ -3809,7 +3809,7 @@ typedef BOOL (WINAPI * WINED3D_PFNWGLSETPIXELFORMATWINE) (HDC hdc, int iPixelFor /**************************************************** - * Structures + * Structures ****************************************************/ typedef struct { @@ -3840,7 +3840,7 @@ typedef struct _WineD3D_GL_Info { DWORD driver_version_hipart; CHAR gl_renderer[255]; /** - * CAPS Constants + * CAPS Constants */ UINT max_buffers; UINT max_lights; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 1ca1edd3b10..fb05ec0d7ac 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -40,7 +40,7 @@ #include "wined3d_private_types.h" #include "wine/wined3d_interface.h" #include "wine/wined3d_caps.h" -#include "wine/wined3d_gl.h" +#include "wined3d_gl.h" #include "wine/list.h" /* Hash table functions */ @@ -853,7 +853,7 @@ struct texture_stage_op WINED3DFORMAT color_correction; }; -struct ffp_settings { +struct ffp_frag_settings { struct texture_stage_op op[MAX_TEXTURES]; enum { FOG_OFF, @@ -865,16 +865,16 @@ struct ffp_settings { unsigned int sRGB_write; }; -struct ffp_desc +struct ffp_frag_desc { - struct ffp_settings settings; + struct ffp_frag_settings settings; }; -void gen_ffp_op(IWineD3DStateBlockImpl *stateblock, struct ffp_settings *settings, BOOL ignore_textype); -struct ffp_desc *find_ffp_shader(struct hash_table_t *fragment_shaders, struct ffp_settings *settings); -void add_ffp_shader(struct hash_table_t *shaders, struct ffp_desc *desc); -BOOL ffp_program_key_compare(void *keya, void *keyb); -unsigned int ffp_program_key_hash(void *key); +void gen_ffp_frag_op(IWineD3DStateBlockImpl *stateblock, struct ffp_frag_settings *settings, BOOL ignore_textype); +struct ffp_frag_desc *find_ffp_frag_shader(struct hash_table_t *fragment_shaders, struct ffp_frag_settings *settings); +void add_ffp_frag_shader(struct hash_table_t *shaders, struct ffp_frag_desc *desc); +BOOL ffp_frag_program_key_compare(void *keya, void *keyb); +unsigned int ffp_frag_program_key_hash(void *key); /***************************************************************************** * IWineD3D implementation structure @@ -2308,17 +2308,10 @@ typedef struct IWineD3DVertexShaderImpl { attrib_declaration swizzled_attribs [MAX_ATTRIBS]; UINT num_swizzled_attribs; - /* run time data... */ - VSHADERDATA *data; UINT min_rel_offset, max_rel_offset; UINT rel_offset; UINT recompile_count; -#if 0 /* needs reworking */ - /* run time data */ - VSHADERINPUTDATA input; - VSHADEROUTPUTDATA output; -#endif } IWineD3DVertexShaderImpl; extern const SHADER_OPCODE IWineD3DVertexShaderImpl_shader_ins[]; extern const IWineD3DVertexShaderVtbl IWineD3DVertexShader_Vtbl; @@ -2354,9 +2347,6 @@ typedef struct IWineD3DPixelShaderImpl { BOOL input_reg_used[MAX_REG_INPUT]; int declared_in_count; - /* run time data */ - PSHADERDATA *data; - /* Some information about the shader behavior */ struct stb_const_desc bumpenvmatconst[MAX_TEXTURES]; char numbumpenvmatconsts; @@ -2369,11 +2359,6 @@ typedef struct IWineD3DPixelShaderImpl { BOOL render_offscreen; UINT height; enum vertexprocessing_mode vertexprocessing; - -#if 0 /* needs reworking */ - PSHADERINPUTDATA input; - PSHADEROUTPUTDATA output; -#endif } IWineD3DPixelShaderImpl; extern const SHADER_OPCODE IWineD3DPixelShaderImpl_shader_ins[]; diff --git a/dlls/winhttp/Makefile.in b/dlls/winhttp/Makefile.in index 3d85c4df01b..40e8fa971b3 100644 --- a/dlls/winhttp/Makefile.in +++ b/dlls/winhttp/Makefile.in @@ -4,7 +4,7 @@ SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = winhttp.dll IMPORTLIB = winhttp -IMPORTS = wininet kernel32 +IMPORTS = shlwapi kernel32 DELAYIMPORTS = crypt32 C_SRCS = \ diff --git a/dlls/winhttp/main.c b/dlls/winhttp/main.c index 1a4a1313ac2..c0ac9cbe51b 100644 --- a/dlls/winhttp/main.c +++ b/dlls/winhttp/main.c @@ -38,8 +38,6 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv) { switch(fdwReason) { - case DLL_WINE_PREATTACH: - return FALSE; /* prefer native version */ case DLL_PROCESS_ATTACH: DisableThreadLibraryCalls(hInstDLL); break; diff --git a/dlls/winhttp/tests/url.c b/dlls/winhttp/tests/url.c index 5d88614bed0..ef48b046266 100644 --- a/dlls/winhttp/tests/url.c +++ b/dlls/winhttp/tests/url.c @@ -63,9 +63,24 @@ static const WCHAR url9[] = static const WCHAR url_k1[] = {'h','t','t','p',':','/','/','u','s','e','r','n','a','m','e',':','p','a','s','s','w','o','r','d', '@','w','w','w','.','w','i','n','e','h','q','.','o','r','g','/','s','i','t','e','/','a','b','o','u','t',0}; - static const WCHAR url_k2[] = {'h','t','t','p',':','/','/','w','w','w','.','w','i','n','e','h','q','.','o','r','g',0}; +static const WCHAR url_k3[] = + {'h','t','t','p','s',':','/','/','w','w','w','.','w','i','n','e','h','q','.','o','r','g','/','p','o','s','t','?',0}; +static const WCHAR url_k4[] = + {'H','T','T','P',':','w','w','w','.','w','i','n','e','h','q','.','o','r','g',0}; +static const WCHAR url_k5[] = + {'h','t','t','p',':','/','w','w','w','.','w','i','n','e','h','q','.','o','r','g',0}; +static const WCHAR url_k6[] = + {'w','w','w','.','w','i','n','e','h','q','.','o','r','g',0}; +static const WCHAR url_k7[] = + {'w','w','w',0}; +static const WCHAR url_k8[] = + {'h','t','t','p',0}; +static const WCHAR url_k9[] = + {'h','t','t','p',':','/','/','w','i','n','e','h','q','?',0}; +static const WCHAR url_k10[] = + {'h','t','t','p',':','/','/','w','i','n','e','h','q','/','p','o','s','t',';','a',0}; static void fill_url_components( URL_COMPONENTS *uc ) { @@ -276,73 +291,210 @@ static void WinHttpCreateUrl_test( void ) HeapFree( GetProcessHeap(), 0, url ); } +static void reset_url_components( URL_COMPONENTS *uc ) +{ + memset( uc, 0, sizeof(URL_COMPONENTS) ); + uc->dwStructSize = sizeof(URL_COMPONENTS); + uc->dwSchemeLength = ~0UL; + uc->dwHostNameLength = ~0UL; + uc->dwUserNameLength = ~0UL; + uc->dwPasswordLength = ~0UL; + uc->dwUrlPathLength = ~0UL; + uc->dwExtraInfoLength = ~0UL; +} + static void WinHttpCrackUrl_test( void ) { URL_COMPONENTSW uc; - DWORD Len = 0; + WCHAR scheme[20], user[20], pass[20], host[20], path[40], extra[20]; + DWORD error; BOOL ret; - /* NULL components */ - SetLastError( 0xdeadbeef ); - memset(&uc,0,sizeof(uc)); - uc.dwStructSize = sizeof(URL_COMPONENTSW); - uc.dwSchemeLength = -1; - uc.dwHostNameLength = -1; - uc.dwUserNameLength = -1; - uc.dwPasswordLength = -1; - uc.dwUrlPathLength = -1; - uc.dwExtraInfoLength = -1; + /* buffers of sufficient length */ + scheme[0] = 0; + user[0] = 0; + pass[0] = 0; + host[0] = 0; + path[0] = 0; + extra[0] = 0; - ret = WinHttpCrackUrl( url_k1, 0, 0,&uc); + uc.dwStructSize = sizeof(URL_COMPONENTS); + uc.nScheme = 0; + uc.lpszScheme = scheme; + uc.dwSchemeLength = 20; + uc.lpszUserName = user; + uc.dwUserNameLength = 20; + uc.lpszPassword = pass; + uc.dwPasswordLength = 20; + uc.lpszHostName = host; + uc.dwHostNameLength = 20; + uc.lpszUrlPath = path; + uc.dwUrlPathLength = 40; + uc.lpszExtraInfo = extra; + uc.dwExtraInfoLength = 20; + + ret = WinHttpCrackUrl( url1, 0, 0, &uc ); + ok( ret, "WinHttpCrackUrl failed\n" ); + ok( uc.nScheme == INTERNET_SCHEME_HTTP, "unexpected scheme\n" ); + ok( !memcmp( uc.lpszScheme, http, sizeof(http) ), "unexpected scheme\n" ); + ok( uc.dwSchemeLength == 4, "unexpected scheme length\n" ); + ok( !memcmp( uc.lpszUserName, username, sizeof(username) ), "unexpected username\n" ); + ok( uc.dwUserNameLength == 8, "unexpected username length\n" ); + ok( !memcmp( uc.lpszPassword, password, sizeof(password) ), "unexpected password\n" ); + ok( uc.dwPasswordLength == 8, "unexpected password length\n" ); + ok( !memcmp( uc.lpszHostName, winehq, sizeof(winehq) ), "unexpected hostname\n" ); + ok( uc.dwHostNameLength == 14, "unexpected hostname length\n" ); + ok( !memcmp( uc.lpszUrlPath, about, sizeof(about) ), "unexpected path\n" ); + ok( uc.dwUrlPathLength == 11, "unexpected path length\n" ); + ok( !memcmp( uc.lpszExtraInfo, query, sizeof(query) ), "unexpected extra info\n" ); + ok( uc.dwExtraInfoLength == 6, "unexpected extra info length\n" ); + + /* buffer of insufficient length */ + scheme[0] = 0; + uc.dwSchemeLength = 1; - Len = 0; - ok (ret!=0,"WinHttpCrackUrl failed\n"); - ok (uc.lpszScheme == url_k1,"Failed to get uc.lpszScheme\n"); - ok (uc.dwSchemeLength == 4, "Unexpected dwSchemeLength\n"); - Len += uc.dwSchemeLength + 3; - ok (uc.lpszUserName== &url_k1[Len],"Failed to get uc.lpszUserName\n"); - ok (uc.dwUserNameLength == 8, "Unexpected dwUserNameLength\n"); - Len +=uc.dwUserNameLength + 1; - ok (uc.lpszPassword==&url_k1[Len],"Failed to get uc.lpszPassword\n"); - ok (uc.dwPasswordLength == 8, "Unexpected dwPasswordLength\n"); - Len +=uc.dwPasswordLength + 1; - ok (uc.lpszHostName == &url_k1[Len],"Failed to get uc.lpszHostName\n"); - ok (uc.dwHostNameLength == 14, "Unexpected dwHostNameLength\n"); - Len += uc.dwHostNameLength; - ok (uc.lpszUrlPath == &url_k1[Len],"Failed to get uc.lpszUrlPath\n"); - ok (uc.dwUrlPathLength == 11, "Unexpected dwUrlPathLength\n"); - Len += uc.dwUrlPathLength; - ok (uc.lpszExtraInfo == &url_k1[Len],"Failed to get uc.lpszExtraInfo\n"); - ok (uc.dwExtraInfoLength == 0, "Unexpected dwExtraInfoLength\n"); - - memset(&uc,0,sizeof(uc)); - uc.dwStructSize = sizeof(URL_COMPONENTSW); - uc.dwSchemeLength = -1; - uc.dwHostNameLength = -1; - uc.dwUserNameLength = -1; - uc.dwPasswordLength = -1; - uc.dwUrlPathLength = -1; - uc.dwExtraInfoLength = -1; + SetLastError( 0xdeadbeef ); + ret = WinHttpCrackUrl( url1, 0, 0, &uc ); + error = GetLastError(); + ok( !ret, "WinHttpCrackUrl failed\n" ); + ok( error == ERROR_INSUFFICIENT_BUFFER, "WinHttpCrackUrl failed\n" ); + ok( uc.dwSchemeLength == 5, "unexpected scheme length: %u\n", uc.dwSchemeLength ); + + /* no buffers */ + reset_url_components( &uc ); + ret = WinHttpCrackUrl( url_k1, 0, 0,&uc); + ok( ret, "WinHttpCrackUrl failed\n" ); + ok( uc.nScheme == INTERNET_SCHEME_HTTP, "unexpected scheme\n" ); + ok( uc.lpszScheme == url_k1,"unexpected scheme\n" ); + ok( uc.dwSchemeLength == 4, "unexpected scheme length\n" ); + ok( uc.lpszUserName == url_k1 + 7, "unexpected username\n" ); + ok( uc.dwUserNameLength == 8, "unexpected username length\n" ); + ok( uc.lpszPassword == url_k1 + 16, "unexpected password\n" ); + ok( uc.dwPasswordLength == 8, "unexpected password length\n" ); + ok( uc.lpszHostName == url_k1 + 25, "unexpected hostname\n" ); + ok( uc.dwHostNameLength == 14, "unexpected hostname length\n" ); + ok( uc.lpszUrlPath == url_k1 + 39, "unexpected path\n" ); + ok( uc.dwUrlPathLength == 11, "unexpected path length\n" ); + ok( uc.lpszExtraInfo == url_k1 + 50, "unexpected extra info\n" ); + ok( uc.dwExtraInfoLength == 0, "unexpected extra info length\n" ); + + reset_url_components( &uc ); ret = WinHttpCrackUrl( url_k2, 0, 0,&uc); - Len = 0; - ok (ret!=0,"WinHttpCrackUrl failed\n"); - ok (uc.lpszScheme == url_k2,"Failed to get uc.lpszScheme\n"); - ok (uc.dwSchemeLength == 4, "Unexpected dwSchemeLength\n"); - Len += uc.dwSchemeLength + 3; - ok (uc.lpszUserName == NULL ,"Got uc.lpszUserName\n"); - ok (uc.dwUserNameLength == 0, "Unexpected dwUserNameLength\n"); - ok (uc.lpszPassword == NULL,"Got uc.lpszPassword\n"); - ok (uc.dwPasswordLength == 0, "Unexpected dwPasswordLength\n"); - ok (uc.lpszHostName == &url_k2[Len],"Failed to get uc.lpszHostName\n"); - ok (uc.dwHostNameLength == 14, "Unexpected dwHostNameLength\n"); - Len += uc.dwHostNameLength; - ok (uc.lpszUrlPath == &url_k2[Len],"Failed to get uc.lpszUrlPath\n"); - ok (uc.dwUrlPathLength == 0, "Unexpected dwUrlPathLength\n"); - Len += uc.dwUrlPathLength; - ok (uc.lpszExtraInfo == &url_k2[Len],"Failed to get uc.lpszExtraInfo\n"); - ok (uc.dwExtraInfoLength == 0, "Unexpected dwExtraInfoLength\n"); + ok( ret, "WinHttpCrackUrl failed\n" ); + ok( uc.nScheme == INTERNET_SCHEME_HTTP, "unexpected scheme\n" ); + ok( uc.lpszScheme == url_k2, "unexpected scheme\n" ); + ok( uc.dwSchemeLength == 4, "unexpected scheme length\n" ); + ok( uc.lpszUserName == NULL ,"unexpected username\n" ); + ok( uc.dwUserNameLength == 0, "unexpected username length\n" ); + ok( uc.lpszPassword == NULL, "unexpected password\n" ); + ok( uc.dwPasswordLength == 0, "unexpected password length\n" ); + ok( uc.lpszHostName == url_k2 + 7, "unexpected hostname\n" ); + ok( uc.dwHostNameLength == 14, "unexpected hostname length\n" ); + ok( uc.lpszUrlPath == url_k2 + 21, "unexpected path\n" ); + ok( uc.dwUrlPathLength == 0, "unexpected path length\n" ); + ok( uc.lpszExtraInfo == url_k2 + 21, "unexpected extra info\n" ); + ok( uc.dwExtraInfoLength == 0, "unexpected extra info length\n" ); + + reset_url_components( &uc ); + ret = WinHttpCrackUrl( url_k3, 0, 0, &uc ); + + ok( ret, "WinHttpCrackUrl failed\n" ); + ok( uc.nScheme == INTERNET_SCHEME_HTTPS, "unexpected scheme\n" ); + ok( uc.lpszScheme == url_k3, "unexpected scheme\n" ); + ok( uc.dwSchemeLength == 5, "unexpected scheme length\n" ); + ok( uc.lpszUserName == NULL, "unexpected username\n" ); + ok( uc.dwUserNameLength == 0, "unexpected username length\n" ); + ok( uc.lpszPassword == NULL, "unexpected password\n" ); + ok( uc.dwPasswordLength == 0, "unexpected password length\n" ); + ok( uc.lpszHostName == url_k3 + 8, "unexpected hostname\n" ); + ok( uc.dwHostNameLength == 14, "unexpected hostname length\n" ); + ok( uc.lpszUrlPath == url_k3 + 22, "unexpected path\n" ); + ok( uc.dwUrlPathLength == 5, "unexpected path length\n" ); + ok( uc.lpszExtraInfo == url_k3 + 27, "unexpected extra info\n" ); + ok( uc.dwExtraInfoLength == 1, "unexpected extra info length\n" ); + + /* bad parameters */ + reset_url_components( &uc ); + ret = WinHttpCrackUrl( url_k4, 0, 0, &uc ); + ok( !ret, "WinHttpCrackUrl failed\n" ); + + reset_url_components( &uc ); + ret = WinHttpCrackUrl( url_k5, 0, 0, &uc ); + ok( !ret, "WinHttpCrackUrl failed\n" ); + + reset_url_components( &uc ); + ret = WinHttpCrackUrl( url_k6, 0, 0, &uc ); + ok( !ret, "WinHttpCrackUrl failed\n" ); + + reset_url_components( &uc ); + ret = WinHttpCrackUrl( url_k7, 0, 0, &uc ); + ok( !ret, "WinHttpCrackUrl failed\n" ); + + reset_url_components( &uc ); + ret = WinHttpCrackUrl( url_k8, 0, 0, &uc ); + ok( !ret, "WinHttpCrackUrl failed\n" ); + + reset_url_components( &uc ); + ret = WinHttpCrackUrl( url_k9, 0, 0, &uc ); + ok( ret, "WinHttpCrackUrl failed\n" ); + ok( uc.lpszUrlPath == url_k9 + 14, "unexpected path\n" ); + ok( uc.dwUrlPathLength == 0, "unexpected path length\n" ); + ok( uc.lpszExtraInfo == url_k9 + 14, "unexpected extra info\n" ); + ok( uc.dwExtraInfoLength == 0, "unexpected extra info length\n" ); + + reset_url_components( &uc ); + ret = WinHttpCrackUrl( url_k10, 0, 0, &uc ); + ok( ret, "WinHttpCrackUrl failed\n" ); + ok( uc.lpszUrlPath == url_k10 + 13, "unexpected path\n" ); + ok( uc.dwUrlPathLength == 7, "unexpected path length\n" ); + ok( uc.lpszExtraInfo == url_k10 + 20, "unexpected extra info\n" ); + ok( uc.dwExtraInfoLength == 0, "unexpected extra info length\n" ); + + reset_url_components( &uc ); + ret = WinHttpCrackUrl( url5, 0, 0, &uc ); + ok( !ret, "WinHttpCrackUrl failed\n" ); + + reset_url_components( &uc ); + ret = WinHttpCrackUrl( empty, 0, 0, &uc ); + ok( !ret, "WinHttpCrackUrl failed\n" ); + + ret = WinHttpCrackUrl( url1, 0, 0, NULL ); + ok( !ret, "WinHttpCrackUrl failed\n" ); + + ret = WinHttpCrackUrl( NULL, 0, 0, &uc ); + ok( !ret, "WinHttpCrackUrl failed\n" ); + + /* decoding without buffers */ + reset_url_components( &uc ); + SetLastError(0xdeadbeef); + ret = WinHttpCrackUrl( url8, 0, ICU_DECODE, &uc ); + error = GetLastError(); + ok( !ret, "WinHttpCrackUrl failed\n" ); + ok( error == ERROR_INVALID_PARAMETER, "WinHttpCrackUrl failed\n" ); + + /* decoding with buffers */ + uc.lpszScheme = scheme; + uc.dwSchemeLength = 20; + uc.lpszUserName = user; + uc.dwUserNameLength = 20; + uc.lpszPassword = pass; + uc.dwPasswordLength = 20; + uc.lpszHostName = host; + uc.dwHostNameLength = 20; + uc.lpszUrlPath = path; + uc.dwUrlPathLength = 40; + uc.lpszExtraInfo = extra; + uc.dwExtraInfoLength = 20; + path[0] = 0; + + ret = WinHttpCrackUrl( url8, 0, ICU_DECODE, &uc ); + ok( ret, "WinHttpCrackUrl failed\n" ); + ok( !memcmp( uc.lpszUrlPath + 11, escape, 21 * sizeof(WCHAR) ), "unexpected path\n" ); + ok( uc.dwUrlPathLength == 32, "unexpected path length\n" ); + ok( !memcmp( uc.lpszExtraInfo, escape + 21, 12 * sizeof(WCHAR) ), "unexpected extra info\n" ); + ok( uc.dwExtraInfoLength == 12, "unexpected extra info length\n" ); } START_TEST(url) diff --git a/dlls/winhttp/url.c b/dlls/winhttp/url.c index ac25f2c707e..41a46b7695e 100644 --- a/dlls/winhttp/url.c +++ b/dlls/winhttp/url.c @@ -23,55 +23,166 @@ #include "windef.h" #include "winbase.h" +#include "winreg.h" #include "winhttp.h" +#include "shlwapi.h" #include "winhttp_private.h" WINE_DEFAULT_DEBUG_CHANNEL(winhttp); -#define SCHEME_HTTP 3 -#define SCHEME_HTTPS 4 +static const WCHAR scheme_http[] = {'h','t','t','p',0}; +static const WCHAR scheme_https[] = {'h','t','t','p','s',0}; + +static BOOL set_component( WCHAR **str, DWORD *str_len, WCHAR *value, DWORD len ) +{ + if (!*str) + { + *str = value; + *str_len = len; + } + else + { + if (len > (*str_len) - 1) + { + *str_len = len + 1; + set_last_error( ERROR_INSUFFICIENT_BUFFER ); + return FALSE; + } + memcpy( *str, value, len * sizeof(WCHAR) ); + (*str)[len] = 0; + *str_len = len; + } + return TRUE; +} -BOOL WINAPI InternetCrackUrlW( LPCWSTR, DWORD, DWORD, LPURL_COMPONENTSW ); +static BOOL decode_url( LPCWSTR url, LPWSTR buffer, LPDWORD buflen ) +{ + HRESULT hr = UrlCanonicalizeW( url, buffer, buflen, URL_WININET_COMPATIBILITY | URL_UNESCAPE ); + if (hr == E_POINTER) set_last_error( ERROR_INSUFFICIENT_BUFFER ); + if (hr == E_INVALIDARG) set_last_error( ERROR_INVALID_PARAMETER ); + return (SUCCEEDED(hr)) ? TRUE : FALSE; +} /*********************************************************************** * WinHttpCrackUrl (winhttp.@) */ -BOOL WINAPI WinHttpCrackUrl( LPCWSTR url, DWORD len, DWORD flags, LPURL_COMPONENTSW components ) +BOOL WINAPI WinHttpCrackUrl( LPCWSTR url, DWORD len, DWORD flags, LPURL_COMPONENTSW uc ) { - BOOL ret; - INT upLen; - INT exLen; + BOOL ret = FALSE; + WCHAR *p, *q, *r; + WCHAR *url_decoded = NULL; - TRACE("%s, %d, %x, %p\n", debugstr_w(url), len, flags, components); - upLen = components->dwUrlPathLength; - exLen = components->dwExtraInfoLength; + TRACE("%s, %d, %x, %p\n", debugstr_w(url), len, flags, uc); - if ((ret = InternetCrackUrlW( url, len, flags, components ))) + if (flags & ICU_ESCAPE) FIXME("flag ICU_ESCAPE not supported\n"); + + if (!url || !url[0] || !uc || uc->dwStructSize != sizeof(URL_COMPONENTS)) { - /* fix up an incompatibility between wininet and winhttp */ - if (components->nScheme == SCHEME_HTTP) components->nScheme = INTERNET_SCHEME_HTTP; - else if (components->nScheme == SCHEME_HTTPS) components->nScheme = INTERNET_SCHEME_HTTPS; - else + set_last_error( ERROR_INVALID_PARAMETER ); + return FALSE; + } + if (!len) len = strlenW( url ); + + if (flags & ICU_DECODE) + { + WCHAR *url_tmp; + DWORD url_len = len + 1; + + if (!uc->lpszScheme || !uc->lpszUserName || !uc->lpszPassword || + !uc->lpszHostName || !uc->lpszUrlPath || !uc-> lpszExtraInfo) { - set_last_error( ERROR_WINHTTP_UNRECOGNIZED_SCHEME ); + set_last_error( ERROR_INVALID_PARAMETER ); + return FALSE; + } + if (!(url_tmp = HeapAlloc( GetProcessHeap(), 0, url_len * sizeof(WCHAR) ))) + { + set_last_error( ERROR_OUTOFMEMORY ); return FALSE; } - if (!len) - len = lstrlenW(url); - /* WinHttpCrackUrl actually returns pointers to the end of the string for components, - other than UserName and Password, that are missing */ - if (upLen && components->lpszUrlPath == NULL) - components->lpszUrlPath = (LPWSTR)&url[len]; - if (exLen && components->lpszExtraInfo == NULL) - components->lpszExtraInfo = (LPWSTR)&url[len]; + memcpy( url_tmp, url, len * sizeof(WCHAR) ); + url_tmp[len] = 0; + if (!(url_decoded = HeapAlloc( GetProcessHeap(), 0, url_len * sizeof(WCHAR) ))) + { + HeapFree( GetProcessHeap(), 0, url_tmp ); + set_last_error( ERROR_OUTOFMEMORY ); + return FALSE; + } + if (decode_url( url_tmp, url_decoded, &url_len )) + { + len = url_len; + url = url_decoded; + } + HeapFree( GetProcessHeap(), 0, url_tmp ); + } + if (!(p = strchrW( url, ':' ))) return FALSE; + + if (p - url == 4 && !strncmpiW( url, scheme_http, 4 )) uc->nScheme = INTERNET_SCHEME_HTTP; + else if (p - url == 5 && !strncmpiW( url, scheme_https, 5 )) uc->nScheme = INTERNET_SCHEME_HTTPS; + else goto exit; + + if (!(set_component( &uc->lpszScheme, &uc->dwSchemeLength, (WCHAR *)url, p - url ))) goto exit; + + p++; /* skip ':' */ + if (!p[0] || p[0] != '/' || p[1] != '/') goto exit; + p += 2; + + if (!p[0]) goto exit; + if ((q = memchrW( p, '@', len - (p - url) ))) + { + if ((r = memchrW( p, ':', q - p ))) + { + if (!(set_component( &uc->lpszUserName, &uc->dwUserNameLength, p, r - p ))) goto exit; + r++; + if (!(set_component( &uc->lpszPassword, &uc->dwPasswordLength, r, q - r ))) goto exit; + } + else + { + if (!(set_component( &uc->lpszUserName, &uc->dwUserNameLength, p, q - p ))) goto exit; + if (!(set_component( &uc->lpszPassword, &uc->dwPasswordLength, NULL, 0 ))) goto exit; + } + p = q + 1; + } + else + { + if (!(set_component( &uc->lpszUserName, &uc->dwUserNameLength, NULL, 0 ))) goto exit; + if (!(set_component( &uc->lpszPassword, &uc->dwPasswordLength, NULL, 0 ))) goto exit; + } + if ((q = memchrW( p, '/', len - (p - url) ))) + { + if (!(set_component( &uc->lpszHostName, &uc->dwHostNameLength, p, q - p ))) goto exit; + + if ((r = memchrW( q, '?', len - (q - url) ))) + { + if (!(set_component( &uc->lpszUrlPath, &uc->dwUrlPathLength, q, r - q ))) goto exit; + if (!(set_component( &uc->lpszExtraInfo, &uc->dwExtraInfoLength, r, len - (r - url) ))) goto exit; + } + else + { + if (!(set_component( &uc->lpszUrlPath, &uc->dwUrlPathLength, q, len - (q - url) ))) goto exit; + if (!(set_component( &uc->lpszExtraInfo, &uc->dwExtraInfoLength, (WCHAR *)url + len, 0 ))) goto exit; + } + } + else + { + if (!(set_component( &uc->lpszHostName, &uc->dwHostNameLength, p, len - (p - url) ))) goto exit; + if (!(set_component( &uc->lpszUrlPath, &uc->dwUrlPathLength, (WCHAR *)url + len, 0 ))) goto exit; + if (!(set_component( &uc->lpszExtraInfo, &uc->dwExtraInfoLength, (WCHAR *)url + len, 0 ))) goto exit; } + + ret = TRUE; + + TRACE("scheme(%s) host(%s) path(%s) extra(%s)\n", + debugstr_wn( uc->lpszScheme, uc->dwSchemeLength ), + debugstr_wn( uc->lpszHostName, uc->dwHostNameLength ), + debugstr_wn( uc->lpszUrlPath, uc->dwUrlPathLength ), + debugstr_wn( uc->lpszExtraInfo, uc->dwExtraInfoLength )); + +exit: + HeapFree( GetProcessHeap(), 0, url_decoded ); return ret; } -static const WCHAR scheme_http[] = {'h','t','t','p',0}; -static const WCHAR scheme_https[] = {'h','t','t','p','s',0}; - static INTERNET_SCHEME get_scheme( const WCHAR *scheme, DWORD len ) { if (!strncmpW( scheme, scheme_http, len )) return INTERNET_SCHEME_HTTP; diff --git a/dlls/wininet/ftp.c b/dlls/wininet/ftp.c index cb24782fa4b..9ad34dfa1ef 100644 --- a/dlls/wininet/ftp.c +++ b/dlls/wininet/ftp.c @@ -2256,7 +2256,7 @@ HINTERNET FTP_Connect(LPWININETAPPINFOW hIC, LPCWSTR lpszServerName, assert( hIC->hdr.htype == WH_HINIT ); - if (NULL == lpszUserName && NULL != lpszPassword) + if ((!lpszUserName || !strlenW(lpszUserName)) && lpszPassword) { INTERNET_SetLastError(ERROR_INVALID_PARAMETER); goto lerror; @@ -2302,7 +2302,7 @@ HINTERNET FTP_Connect(LPWININETAPPINFOW hIC, LPCWSTR lpszServerName, if(hIC->lpszProxyBypass) FIXME("Proxy bypass is ignored.\n"); } - if ( !lpszUserName) { + if (!lpszUserName || !strlenW(lpszUserName)) { HKEY key; WCHAR szPassword[MAX_PATH]; DWORD len = sizeof(szPassword); diff --git a/dlls/wininet/tests/ftp.c b/dlls/wininet/tests/ftp.c index 335215e4201..f7dc9c9f86f 100644 --- a/dlls/wininet/tests/ftp.c +++ b/dlls/wininet/tests/ftp.c @@ -66,6 +66,8 @@ static void test_connect(HINTERNET hInternet) * anonymous : NULL * NULL : IEUser@ * NULL : NULL + * "" : IEUser@ + * "" : NULL */ SetLastError(0xdeadbeef); @@ -85,6 +87,13 @@ static void test_connect(HINTERNET hInternet) ok ( GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + SetLastError(0xdeadbeef); + hFtp = InternetConnect(hInternet, "ftp.winehq.org", INTERNET_DEFAULT_FTP_PORT, "", "IEUser@", + INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0); + ok(!hFtp, "Expected InternetConnect to fail\n"); + ok(GetLastError() == ERROR_INVALID_PARAMETER, + "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + /* Using a NULL username and password will be interpreted as anonymous ftp. The username will be 'anonymous' the password * is created via some simple heuristics (see dlls/wininet/ftp.c). * On Wine this registry key is not set by default so (NULL, NULL) will result in anonymous ftp with an (most likely) not @@ -103,6 +112,20 @@ static void test_connect(HINTERNET hInternet) ok ( hFtp != NULL, "InternetConnect failed : %d\n", GetLastError()); ok ( GetLastError() == ERROR_SUCCESS, "ERROR_SUCCESS, got %d\n", GetLastError()); + + SetLastError(0xdeadbeef); + hFtp = InternetConnect(hInternet, "ftp.winehq.org", INTERNET_DEFAULT_FTP_PORT, "", NULL, + INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0); + if (!hFtp) + { + ok(GetLastError() == ERROR_INTERNET_LOGIN_FAILURE, + "Expected ERROR_INTERNET_LOGIN_FAILURE, got %d\n", GetLastError()); + } + else + { + ok(GetLastError() == ERROR_SUCCESS, + "Expected ERROR_SUCCESS, got %d\n", GetLastError()); + } } static void test_createdir(HINTERNET hFtp, HINTERNET hConnect) diff --git a/dlls/winspool.drv/Pt.rc b/dlls/winspool.drv/Pt.rc new file mode 100644 index 00000000000..f00dc0c06b4 --- /dev/null +++ b/dlls/winspool.drv/Pt.rc @@ -0,0 +1,39 @@ +/* + * Portuguese resources for winspool + * + * Copyright 2008 Ricardo Filipe + * + * 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 + */ + +LANGUAGE LANG_PORTUGUESE, SUBLANG_NEUTRAL + +FILENAME_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 6, 18, 245, 47 +STYLE DS_CONTEXTHELP | DS_MODALFRAME | DS_SETFONT | DS_SETFOREGROUND | WS_POPUPWINDOW | WS_VISIBLE | WS_CAPTION +CAPTION "Imprimir para Ficheiro" +FONT 8, "MS Shell Dlg" +BEGIN + LTEXT "&Nome de Ficheiro de Destino:", -1, 7, 13, 194, 13, WS_VISIBLE + EDITTEXT EDITBOX, 6, 28, 174, 12, WS_VISIBLE | ES_AUTOHSCROLL + DEFPUSHBUTTON "OK", IDOK, 199, 10, 40, 14, WS_VISIBLE + PUSHBUTTON "Cancelar", IDCANCEL, 199, 27, 40, 14, WS_VISIBLE +END + +STRINGTABLE DISCARDABLE +{ + IDS_CAPTION "Porta Local" + IDS_FILE_EXISTS "O ficheiro de destino já existe. Clique OK para reescrever." + IDS_CANNOT_OPEN "Impossível criar o ficheiro de destino." +} diff --git a/dlls/winspool.drv/winspool.rc b/dlls/winspool.drv/winspool.rc index 8fd7cb5dcd3..805dab6e255 100644 --- a/dlls/winspool.drv/winspool.rc +++ b/dlls/winspool.drv/winspool.rc @@ -52,6 +52,7 @@ #include "Nl.rc" #include "No.rc" #include "Pl.rc" +#include "Pt.rc" #include "Ru.rc" #include "Si.rc" #include "Sv.rc" diff --git a/dlls/wintrust/wintrust_main.c b/dlls/wintrust/wintrust_main.c index a4bfe75ec98..f9d33293f5d 100644 --- a/dlls/wintrust/wintrust_main.c +++ b/dlls/wintrust/wintrust_main.c @@ -757,7 +757,7 @@ static BOOL WINAPI WINTRUST_enumUsages(PCCRYPT_OID_INFO pInfo, void *pvArg) for (cUsages = 0, ptr = *usages; *ptr; ptr++, cUsages++) ; *usages = WINTRUST_ReAlloc((CRYPT_OID_INFO *)*usages, - (cUsages + 1) * sizeof(PCCRYPT_OID_INFO)); + (cUsages + 2) * sizeof(PCCRYPT_OID_INFO)); } if (*usages) { diff --git a/dlls/wldap32/wldap32.rc b/dlls/wldap32/wldap32.rc index 4d44da7bdde..50f9562ca53 100644 --- a/dlls/wldap32/wldap32.rc +++ b/dlls/wldap32/wldap32.rc @@ -31,6 +31,7 @@ #include "wldap32_Nl.rc" #include "wldap32_No.rc" #include "wldap32_Pl.rc" +#include "wldap32_Pt.rc" #include "wldap32_Ru.rc" #include "wldap32_Sv.rc" #include "wldap32_Tr.rc" diff --git a/dlls/wldap32/wldap32_Pt.rc b/dlls/wldap32/wldap32_Pt.rc new file mode 100644 index 00000000000..172234c8722 --- /dev/null +++ b/dlls/wldap32/wldap32_Pt.rc @@ -0,0 +1,123 @@ +/* + * Portuguese resources for WLDAP32 + * + * Copyright 2008 Ricardo Filipe + * + * 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 + */ + +LANGUAGE LANG_PORTUGUESE, SUBLANG_NEUTRAL + +STRINGTABLE DISCARDABLE +{ + 0 "Sucesso" + 1 "Erro de operações" + 2 "Erro de protocolo" + 3 "Tempo limite excedido" + 4 "Tamanho limite excedido" + 5 "Comparar Falso" + 6 "Comparar Verdadeiro" + 7 "Método de autenticação não suportado" + 8 "Autenticação forte necessária" + 9 "Referência (v2)" + 10 "Referência" + 11 "Limite de administração excedido" + 12 "Extensão Crítica indisponível" + 13 "Confidencialidade necessária" + 14 "" + 15 "" + 16 "Atributo não encontrado" + 17 "Tipo indefinido" + 18 "Atribuição imprópria" + 19 "Violação de restrições" + 20 "Valor ou atributo existente" + 21 "Sintaxe Inválida" + 22 "" + 23 "" + 24 "" + 25 "" + 26 "" + 27 "" + 28 "" + 29 "" + 30 "" + 31 "" + 32 "Objecto não encontrado" + 33 "Problema de abreviatura" + 34 "Sintaxe DN inválida" + 35 "É folha" + 36 "Problema na referência da abreviatura" + 37 "" + 38 "" + 39 "" + 40 "" + 41 "" + 42 "" + 43 "" + 44 "" + 45 "" + 46 "" + 47 "" + 48 "Autenticação imprópria" + 49 "Credenciais Inválidas" + 50 "Direitos insuficientes" + 51 "Ocupado" + 52 "Indisponível" + 53 "Indisposto a realizar" + 54 "Ciclo detectado" + 55 "" + 56 "" + 57 "" + 58 "" + 59 "" + 60 "Falta de controlo de ordenação" + 61 "Erro de limite de índice" + 62 "" + 63 "" + 64 "Violação de Nome" + 65 "Violação da Classe de Objecto" + 66 "Não permitido em não-folha" + 67 "Não permitido em RDN" + 68 "Já existe" + 69 "Sem modificações de Classe de Objecto" + 70 "Resultados muito grandes" + 71 "Afecta múltiplos DSAs" + 72 "" + 73 "" + 74 "" + 75 "" + 76 "" + 77 "" + 78 "" + 79 "" + 80 "Outro" + 81 "Servidor em baixo" + 82 "Erro Local" + 83 "Erro de Codificação" + 84 "Erro de Descodificação" + 85 "Tempo excedido" + 86 "Autenticação desconhecida" + 87 "Erro de filtro" + 88 "Cancelado pelo utilizador" + 89 "Erro de parâmetro" + 90 "Sem memória" + 91 "Não consegue ligar ao servidor LDAP" + 92 "Operação não suportada por esta versão do protocolo LDAP" + 93 "O controlo especificado não foi encontrado na mensagem" + 94 "Nenhum resultado presente na mensagem" + 95 "Mais resultados devolvidos" + 96 "Ciclo enquanto resolve referências" + 97 "Limite de salto de referências excedido" +} diff --git a/include/commctrl.rh b/include/commctrl.rh index 1f41cdbedd4..b958a791a64 100644 --- a/include/commctrl.rh +++ b/include/commctrl.rh @@ -164,7 +164,7 @@ #define ACS_AUTOPLAY 0x0004 #define ACS_TIMER 0x0008 -/* Month Calender Control */ +/* Month Calendar Control */ #define MCS_DAYSTATE 0x0001 #define MCS_MULTISELECT 0x0002 #define MCS_WEEKNUMBERS 0x0004 diff --git a/include/config.h.in b/include/config.h.in index 016ee8ecd1d..8f2c78e6ae6 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -333,9 +333,6 @@ /* Define if you have the X Shape extension */ #undef HAVE_LIBXSHAPE -/* Define if you have the libxslt library */ -#undef HAVE_LIBXSLT - /* Define to 1 if you have the header file. */ #undef HAVE_LIBXSLT_PATTERN_H @@ -1002,9 +999,6 @@ /* Define if Xrender has the XRenderSetPictureTransform function */ #undef HAVE_XRENDERSETPICTURETRANSFORM -/* Define to 1 if you have the `xsltInit' function. */ -#undef HAVE_XSLTINIT - /* Define to 1 if you have the `_pclose' function. */ #undef HAVE__PCLOSE @@ -1128,6 +1122,9 @@ /* Define to the soname of the libXrender library. */ #undef SONAME_LIBXRENDER +/* Define to the soname of the libxslt library. */ +#undef SONAME_LIBXSLT + /* Define to the soname of the libXxf86vm library. */ #undef SONAME_LIBXXF86VM diff --git a/include/dxgi.idl b/include/dxgi.idl index 1f0c25e7a52..b67674e346f 100644 --- a/include/dxgi.idl +++ b/include/dxgi.idl @@ -18,6 +18,32 @@ import "dxgitype.idl"; +const UINT _FACDXGI = 0x87a; + +cpp_quote("#define MAKE_DXGI_STATUS(x) MAKE_HRESULT(0, _FACDXGI, x)") +cpp_quote("#define DXGI_STATUS_OCCLUDED MAKE_DXGI_STATUS(1)") +cpp_quote("#define DXGI_STATUS_CLIPPED MAKE_DXGI_STATUS(2)") +cpp_quote("#define DXGI_STATUS_NO_REDIRECTION MAKE_DXGI_STATUS(4)") +cpp_quote("#define DXGI_STATUS_NO_DESKTOP_ACCESS MAKE_DXGI_STATUS(5)") +cpp_quote("#define DXGI_STATUS_GRAPHICS_VIDPN_SOURCE_IN_USE MAKE_DXGI_STATUS(6)") +cpp_quote("#define DXGI_STATUS_MODE_CHANGED MAKE_DXGI_STATUS(7)") +cpp_quote("#define DXGI_STATUS_MODE_CHANGE_IN_PROGRESS MAKE_DXGI_STATUS(8)") + +cpp_quote("#define MAKE_DXGI_HRESULT(x) MAKE_HRESULT(1, _FACDXGI, x)") +cpp_quote("#define DXGI_ERROR_INVALID_CALL MAKE_DXGI_HRESULT(1)") +cpp_quote("#define DXGI_ERROR_NOT_FOUND MAKE_DXGI_HRESULT(2)") +cpp_quote("#define DXGI_ERROR_MORE_DATA MAKE_DXGI_HRESULT(3)") +cpp_quote("#define DXGI_ERROR_UNSUPPORTED MAKE_DXGI_HRESULT(4)") +cpp_quote("#define DXGI_ERROR_DEVICE_REMOVED MAKE_DXGI_HRESULT(5)") +cpp_quote("#define DXGI_ERROR_DEVICE_HUNG MAKE_DXGI_HRESULT(6)") +cpp_quote("#define DXGI_ERROR_DEVICE_RESET MAKE_DXGI_HRESULT(7)") +cpp_quote("#define DXGI_ERROR_WAS_STILL_DRAWING MAKE_DXGI_HRESULT(10)") +cpp_quote("#define DXGI_ERROR_FRAME_STATISTICS_DISJOINT MAKE_DXGI_HRESULT(11)") +cpp_quote("#define DXGI_ERROR_GRAPHICS_VIDPN_SOURCE_IN_USE MAKE_DXGI_HRESULT(12)") +cpp_quote("#define DXGI_ERROR_DRIVER_INTERNAL_ERROR MAKE_DXGI_HRESULT(32)") +cpp_quote("#define DXGI_ERROR_NONEXCLUSIVE MAKE_DXGI_HRESULT(33)") +cpp_quote("#define DXGI_ERROR_NOT_CURRENTLY_AVAILABLE MAKE_DXGI_HRESULT(34)") + cpp_quote("#if 0") typedef HANDLE HMONITOR; typedef struct _LUID { diff --git a/include/textserv.h b/include/textserv.h index 1c262acbb41..977b7428165 100644 --- a/include/textserv.h +++ b/include/textserv.h @@ -252,7 +252,7 @@ DECLARE_INTERFACE_(ITextHost,IUnknown) STDMETHOD_(BOOL,TxShowCaret)( THIS_ BOOL fShow) PURE; - STDMETHOD_(BOOL,TxSetCarentPos)( THIS_ + STDMETHOD_(BOOL,TxSetCaretPos)( THIS_ INT x, INT y) PURE; diff --git a/include/wincrypt.h b/include/wincrypt.h index e6ce84a71db..2a2a3b3cb80 100644 --- a/include/wincrypt.h +++ b/include/wincrypt.h @@ -290,10 +290,10 @@ typedef struct _CERT_KEY_ATTRIBUTES_INFO { #define CERT_NON_REPUDIATION_KEY_USAGE 0x40 #define CERT_KEY_ENCIPHERMENT_KEY_USAGE 0x20 #define CERT_DATA_ENCIPHERMENT_KEY_USAGE 0x10 -#define CERT_KEY_AGREEMENT_KEY_USAGE 0x80 -#define CERT_KEY_CERT_SIGN_KEY_USAGE 0x40 -#define CERT_OFFLINE_CRL_SIGN_KEY_USAGE 0x20 -#define CERT_CRL_SIGN_KEY_USAGE 0x10 +#define CERT_KEY_AGREEMENT_KEY_USAGE 0x08 +#define CERT_KEY_CERT_SIGN_KEY_USAGE 0x04 +#define CERT_OFFLINE_CRL_SIGN_KEY_USAGE 0x02 +#define CERT_CRL_SIGN_KEY_USAGE 0x02 #define CERT_ENCIPHER_ONLY_KEY_USAGE 0x01 /* byte 1 */ #define CERT_DECIPHER_ONLY_KEY_USAGE 0x80 @@ -3087,6 +3087,17 @@ typedef struct _CTL_FIND_SUBJECT_PARA #define szOID_NETSCAPE_CA_POLICY_URL "2.16.840.1.113730.1.8" #define szOID_NETSCAPE_SSL_SERVER_NAME "2.16.840.1.113730.1.12" #define szOID_NETSCAPE_COMMENT "2.16.840.1.113730.1.13" +#define szOID_NETSCAPE_DATA_TYPE "2.16.840.1.113730.2" +#define szOID_NETSCAPE_CERT_SEQUENCE "2.16.840.1.113730.2.5" + +/* Bits for szOID_NETSCAPE_CERT_TYPE */ +#define NETSCAPE_SSL_CLIENT_AUTH_CERT_TYPE 0x80 +#define NETSCAPE_SSL_SERVER_AUTH_CERT_TYPE 0x40 +#define NETSCAPE_SMIME_CERT_TYPE 0x20 +#define NETSCAPE_SIGN_CERT_TYPE 0x10 +#define NETSCAPE_SSL_CA_CERT_TYPE 0x04 +#define NETSCAPE_SMIME_CA_CERT_TYPE 0x02 +#define NETSCAPE_SIGN_CA_CERT_TYPE 0x01 #define CRYPT_ENCODE_DECODE_NONE 0 #define X509_CERT ((LPCSTR)1) diff --git a/include/wine/library.h b/include/wine/library.h index 5843fe2cc8e..2411ae1bd96 100644 --- a/include/wine/library.h +++ b/include/wine/library.h @@ -73,8 +73,6 @@ extern void wine_init( int argc, char *argv[], char *error, int error_size ); extern void DECLSPEC_NORETURN wine_switch_to_stack( void (*func)(void *), void *arg, void *stack ); extern int wine_call_on_stack( int (*func)(void *), void *arg, void *stack ); -extern void wine_set_pe_load_area( void *base, size_t size ); -extern void wine_free_pe_load_area(void); /* memory mappings */ diff --git a/include/wine/wined3d_interface.h b/include/wine/wined3d_interface.h index 2188176e824..8443767c2d3 100644 --- a/include/wine/wined3d_interface.h +++ b/include/wine/wined3d_interface.h @@ -116,9 +116,9 @@ DEFINE_GUID(IID_IWineD3D, DEFINE_GUID(IID_IWineD3DBase, 0x46799311, 0x8e0e, 0x40ce, 0xb2, 0xec, 0xdd, 0xb9, 0x9f, 0x18, 0xfc, 0xb4); -/* {108F9C44-6F30-11d9-C687-00046142C14F} */ +/* {6d10a2ce-09d0-4a53-a427-11388f9f8ca5} */ DEFINE_GUID(IID_IWineD3DDevice, -0x108f9c44, 0x6f30, 0x11d9, 0xc6, 0x87, 0x0, 0x4, 0x61, 0x42, 0xc1, 0x4f); +0x6d10a2ce, 0x09d0, 0x4a53, 0xa4, 0x27, 0x11, 0x38, 0x8f, 0x9f, 0x8c, 0xa5); /* {f756720c-32b9-4439-b5a3-1d6c97037d9e} */ DEFINE_GUID(IID_IWineD3DPalette, diff --git a/include/wine/wined3d_types.h b/include/wine/wined3d_types.h index 28e5525c5f6..a389ab7572e 100644 --- a/include/wine/wined3d_types.h +++ b/include/wine/wined3d_types.h @@ -123,83 +123,6 @@ typedef struct _WINED3DLINEPATTERN { WORD wLinePattern; } WINED3DLINEPATTERN; -#define WINED3D_VSHADER_MAX_CONSTANTS 96 -#define WINED3D_PSHADER_MAX_CONSTANTS 32 - -typedef struct _WINED3DVECTOR_3 { - float x; - float y; - float z; -} WINED3DVECTOR_3; - -typedef struct _WINED3DVECTOR_4 { - float x; - float y; - float z; - float w; -} WINED3DVECTOR_4; - -typedef struct WINED3DSHADERVECTOR { - float x; - float y; - float z; - float w; -} WINED3DSHADERVECTOR; - -typedef struct WINED3DSHADERSCALAR { - float x; -} WINED3DSHADERSCALAR; - -typedef WINED3DSHADERVECTOR WINEVSHADERCONSTANTS8[WINED3D_VSHADER_MAX_CONSTANTS]; - -typedef struct VSHADERDATA { - /** Run Time Shader Function Constants */ - /*D3DXBUFFER* constants;*/ - WINEVSHADERCONSTANTS8 C; - /** Shader Code as char ... */ - CONST DWORD* code; - UINT codeLength; -} VSHADERDATA; - -/** temporary here waiting for buffer code */ -typedef struct VSHADERINPUTDATA { - WINED3DSHADERVECTOR V[17]; -} WINEVSHADERINPUTDATA; - -/** temporary here waiting for buffer code */ -typedef struct VSHADEROUTPUTDATA { - WINED3DSHADERVECTOR oPos; - WINED3DSHADERVECTOR oD[2]; - WINED3DSHADERVECTOR oT[8]; - WINED3DSHADERVECTOR oFog; - WINED3DSHADERVECTOR oPts; -} WINEVSHADEROUTPUTDATA; - -typedef WINED3DSHADERVECTOR WINEPSHADERCONSTANTS8[WINED3D_PSHADER_MAX_CONSTANTS]; - -typedef struct PSHADERDATA { - /** Run Time Shader Function Constants */ - /*D3DXBUFFER* constants;*/ - WINEPSHADERCONSTANTS8 C; - /** Shader Code as char ... */ - CONST DWORD* code; - UINT codeLength; -} PSHADERDATA; - -/** temporary here waiting for buffer code */ -typedef struct PSHADERINPUTDATA { - WINED3DSHADERVECTOR V[2]; - WINED3DSHADERVECTOR T[8]; - WINED3DSHADERVECTOR S[16]; - /*D3DSHADERVECTOR R[12];*/ -} WINEPSHADERINPUTDATA; - -/** temporary here waiting for buffer code */ -typedef struct PSHADEROUTPUTDATA { - WINED3DSHADERVECTOR oC[4]; - WINED3DSHADERVECTOR oDepth; -} WINEPSHADEROUTPUTDATA; - /***************************************************************************** * WineD3D Structures to be used when d3d8 and d3d9 are incompatible */ diff --git a/include/winnt.h b/include/winnt.h index 6fa89ddb884..a1e9fe02767 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -575,9 +575,6 @@ typedef struct _MEMORY_BASIC_INFORMATION #define MEM_PHYSICAL 0x00400000 #define MEM_LARGE_PAGES 0x20000000 #define MEM_4MB_PAGES 0x80000000 -#ifdef __WINESRC__ -#define MEM_SYSTEM 0x80000000 -#endif #define SEC_FILE 0x00800000 #define SEC_IMAGE 0x01000000 diff --git a/include/winuser.h b/include/winuser.h index 142837f19af..8382a07f22f 100644 --- a/include/winuser.h +++ b/include/winuser.h @@ -965,6 +965,8 @@ WINUSERAPI BOOL WINAPI SetSysColors(INT,const INT*,const COLORREF*); #define EM_GETLIMITTEXT 0x00d5 #define EM_POSFROMCHAR 0x00d6 #define EM_CHARFROMPOS 0x00d7 +#define EM_SETIMESTATUS 0x00d8 +#define EM_GETIMESTATUS 0x00d9 /* a name change since win95 */ #define EM_SETLIMITTEXT EM_LIMITTEXT diff --git a/programs/reg/Makefile.in b/programs/reg/Makefile.in index 17e8f81d164..6fb05f14534 100644 --- a/programs/reg/Makefile.in +++ b/programs/reg/Makefile.in @@ -5,7 +5,8 @@ SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = reg.exe APPMODE = -mconsole -municode -IMPORTS = advapi32 user32 kernel32 +IMPORTS = advapi32 kernel32 +DELAYIMPORTS = user32 C_SRCS = reg.c diff --git a/programs/reg/reg.c b/programs/reg/reg.c index 043872c8d42..34da9f14062 100644 --- a/programs/reg/reg.c +++ b/programs/reg/reg.c @@ -17,6 +17,7 @@ */ #include +#include #include "reg.h" static int reg_printfW(const WCHAR *msg, ...) @@ -27,7 +28,7 @@ static int reg_printfW(const WCHAR *msg, ...) WCHAR msg_buffer[8192]; va_start(va_args, msg); - wvsprintfW(msg_buffer, msg, va_args); + vsprintfW(msg_buffer, msg, va_args); va_end(va_args); wlen = lstrlenW(msg_buffer); @@ -69,7 +70,7 @@ static int reg_message(int msg, ...) static int reg_add(WCHAR *key_name, WCHAR *value_name, BOOL value_empty, WCHAR *type, WCHAR separator, WCHAR *data, BOOL force) { - const WCHAR stubW[] = {'S','T','U','B',' ','A','D','D',' ','-',' ','%','s', + static const WCHAR stubW[] = {'S','T','U','B',' ','A','D','D',' ','-',' ','%','s', ' ','%','s',' ','%','d',' ','%','s',' ','%','s',' ','%','d','\n',0}; reg_printfW(stubW, key_name, value_name, value_empty, type, data, force); @@ -79,8 +80,9 @@ static int reg_add(WCHAR *key_name, WCHAR *value_name, BOOL value_empty, static int reg_delete(WCHAR *key_name, WCHAR *value_name, BOOL value_empty, BOOL value_all, BOOL force) { - const WCHAR stubW[] = {'S','T','U','B',' ','D','E','L','E','T','E',' ','-', - ' ','%','s',' ','%','s',' ','%','d',' ','%','d',' ','%','d','\n',0}; + static const WCHAR stubW[] = {'S','T','U','B',' ','D','E','L','E','T','E', + ' ','-',' ','%','s',' ','%','s',' ','%','d',' ','%','d',' ','%','d','\n' + ,0}; reg_printfW(stubW, key_name, value_name, value_empty, value_all, force); return 1; @@ -89,8 +91,8 @@ static int reg_delete(WCHAR *key_name, WCHAR *value_name, BOOL value_empty, static int reg_query(WCHAR *key_name, WCHAR *value_name, BOOL value_empty, BOOL subkey) { - const WCHAR stubW[] = {'S','T','U','B',' ','Q','U','E','R','Y',' ','-',' ', - '%','s',' ','%','s',' ','%','d',' ','%','d','\n',0}; + static const WCHAR stubW[] = {'S','T','U','B',' ','Q','U','E','R','Y',' ', + '-',' ','%','s',' ','%','s',' ','%','d',' ','%','d','\n',0}; reg_printfW(stubW, key_name, value_name, value_empty, subkey); return 1; @@ -100,16 +102,16 @@ int wmain(int argc, WCHAR *argvW[]) { int i; - const WCHAR addW[] = {'a','d','d',0}; - const WCHAR deleteW[] = {'d','e','l','e','t','e',0}; - const WCHAR queryW[] = {'q','u','e','r','y',0}; - const WCHAR slashDW[] = {'/','d',0}; - const WCHAR slashFW[] = {'/','f',0}; - const WCHAR slashSW[] = {'/','s',0}; - const WCHAR slashTW[] = {'/','t',0}; - const WCHAR slashVW[] = {'/','v',0}; - const WCHAR slashVAW[] = {'/','v','a',0}; - const WCHAR slashVEW[] = {'/','v','e',0}; + static const WCHAR addW[] = {'a','d','d',0}; + static const WCHAR deleteW[] = {'d','e','l','e','t','e',0}; + static const WCHAR queryW[] = {'q','u','e','r','y',0}; + static const WCHAR slashDW[] = {'/','d',0}; + static const WCHAR slashFW[] = {'/','f',0}; + static const WCHAR slashSW[] = {'/','s',0}; + static const WCHAR slashTW[] = {'/','t',0}; + static const WCHAR slashVW[] = {'/','v',0}; + static const WCHAR slashVAW[] = {'/','v','a',0}; + static const WCHAR slashVEW[] = {'/','v','e',0}; if (argc < 2) { diff --git a/programs/regedit/regproc.c b/programs/regedit/regproc.c index 2cfa0923662..56d7a5ae4fa 100644 --- a/programs/regedit/regproc.c +++ b/programs/regedit/regproc.c @@ -67,7 +67,7 @@ if (!(p)) \ } /****************************************************************************** - * Allocates memory and convers input from multibyte to wide chars + * Allocates memory and converts input from multibyte to wide chars * Returned string must be freed by the caller */ WCHAR* GetWideString(const char* strA) @@ -86,7 +86,7 @@ WCHAR* GetWideString(const char* strA) } /****************************************************************************** - * Allocates memory and convers input from multibyte to wide chars + * Allocates memory and converts input from multibyte to wide chars * Returned string must be freed by the caller */ WCHAR* GetWideStringN(const char* strA, int chars, DWORD *len) @@ -106,7 +106,7 @@ WCHAR* GetWideStringN(const char* strA, int chars, DWORD *len) } /****************************************************************************** - * Allocates memory and convers input from wide chars to multibyte + * Allocates memory and converts input from wide chars to multibyte * Returned string must be freed by the caller */ char* GetMultiByteString(const WCHAR* strW) @@ -125,7 +125,7 @@ char* GetMultiByteString(const WCHAR* strW) } /****************************************************************************** - * Allocates memory and convers input from wide chars to multibyte + * Allocates memory and converts input from wide chars to multibyte * Returned string must be freed by the caller */ char* GetMultiByteStringN(const WCHAR* strW, int chars, DWORD* len) @@ -890,22 +890,21 @@ static void REGPROC_resize_char_buffer(WCHAR **buffer, DWORD *len, DWORD require /****************************************************************************** * Prints string str to file */ -static void REGPROC_export_string(WCHAR **line_buf, DWORD *line_buf_size, DWORD *line_len, WCHAR *str) +static void REGPROC_export_string(WCHAR **line_buf, DWORD *line_buf_size, DWORD *line_len, WCHAR *str, DWORD str_len) { - DWORD len = lstrlenW(str); DWORD i, pos; DWORD extra = 0; - REGPROC_resize_char_buffer(line_buf, line_buf_size, *line_len + len + 10); + REGPROC_resize_char_buffer(line_buf, line_buf_size, *line_len + str_len + 10); /* escaping characters */ pos = *line_len; - for (i = 0; i < len; i++) { + for (i = 0; i < str_len; i++) { WCHAR c = str[i]; switch (c) { case '\n': extra++; - REGPROC_resize_char_buffer(line_buf, line_buf_size, *line_len + len + extra); + REGPROC_resize_char_buffer(line_buf, line_buf_size, *line_len + str_len + extra); (*line_buf)[pos++] = '\\'; (*line_buf)[pos++] = 'n'; break; @@ -913,7 +912,7 @@ static void REGPROC_export_string(WCHAR **line_buf, DWORD *line_buf_size, DWORD case '\\': case '"': extra++; - REGPROC_resize_char_buffer(line_buf, line_buf_size, *line_len + len + extra); + REGPROC_resize_char_buffer(line_buf, line_buf_size, *line_len + str_len + extra); (*line_buf)[pos++] = '\\'; /* Fall through */ @@ -926,6 +925,75 @@ static void REGPROC_export_string(WCHAR **line_buf, DWORD *line_buf_size, DWORD *line_len = pos; } +static void REGPROC_export_binary(WCHAR **line_buf, DWORD *line_buf_size, DWORD *line_len, DWORD type, BYTE *value, DWORD value_size, BOOL unicode) +{ + DWORD i, hex_pos, data_pos, column; + const WCHAR *hex_prefix; + const WCHAR hex[] = {'h','e','x',':',0}; + WCHAR hex_buf[17]; + const WCHAR format[] = {'%','0','2','x',0}; + const WCHAR comma[] = {',',0}; + const WCHAR concat[] = {'\\','\n',' ',' ',0}; + DWORD concat_prefix, concat_len; + const WCHAR newline[] = {'\n',0}; + CHAR* value_multibyte = NULL; + + if (type == REG_BINARY) { + hex_prefix = hex; + } else { + const WCHAR hex_format[] = {'h','e','x','(','%','u',')',':',0}; + hex_prefix = hex_buf; + sprintfW(hex_buf, hex_format, type); + if ((type == REG_SZ || type == REG_EXPAND_SZ || type == REG_MULTI_SZ) && !unicode) + { + value_multibyte = GetMultiByteStringN((WCHAR*)value, value_size / sizeof(WCHAR), &value_size); + value = (BYTE*)value_multibyte; + } + } + + concat_len = lstrlenW(concat); + concat_prefix = 2; + + hex_pos = *line_len; + *line_len += lstrlenW(hex_prefix); + data_pos = *line_len; + *line_len += value_size * 3; + /* - The 2 spaces that concat places at the start of the + * line effectively reduce the space available for data. + * - If the value name and hex prefix are very long + * ( > REG_FILE_HEX_LINE_LEN) then we may overestimate + * the needed number of lines by one. But that's ok. + * - The trailing linefeed takes the place of a comma so + * it's accounted for already. + */ + *line_len += *line_len / (REG_FILE_HEX_LINE_LEN - concat_prefix) * concat_len; + REGPROC_resize_char_buffer(line_buf, line_buf_size, *line_len); + lstrcpyW(*line_buf + hex_pos, hex_prefix); + column = data_pos; /* no line wrap yet */ + i = 0; + while (1) + { + sprintfW(*line_buf + data_pos, format, (unsigned int)value[i]); + data_pos += 2; + if (++i == value_size) + break; + + lstrcpyW(*line_buf + data_pos, comma); + data_pos++; + column += 3; + + /* wrap the line */ + if (column >= REG_FILE_HEX_LINE_LEN) { + lstrcpyW(*line_buf + data_pos, concat); + data_pos += concat_len; + column = concat_prefix; + } + } + lstrcpyW(*line_buf + data_pos, newline); + if (value_multibyte) + HeapFree(GetProcessHeap(), 0, value_multibyte); +} + /****************************************************************************** * Writes the given line to a file, in multi-byte or wide characters */ @@ -995,7 +1063,7 @@ static void export_hkey(FILE *file, HKEY key, REGPROC_resize_char_buffer(line_buf, line_buf_size, lstrlenW(*reg_key_name_buf) + 4); /* output data for the current key */ - wsprintfW(*line_buf, key_format, *reg_key_name_buf); + sprintfW(*line_buf, key_format, *reg_key_name_buf); REGPROC_write_line(file, *line_buf, unicode); /* print all the values */ @@ -1021,7 +1089,7 @@ static void export_hkey(FILE *file, HKEY key, line_len = 3 + lstrlenW(*val_name_buf); REGPROC_resize_char_buffer(line_buf, line_buf_size, line_len); - wsprintfW(*line_buf, val_start, *val_name_buf); + sprintfW(*line_buf, val_start, *val_name_buf); } else { const WCHAR std_val[] = {'@','=',0}; line_len = 2; @@ -1031,22 +1099,30 @@ static void export_hkey(FILE *file, HKEY key, switch (value_type) { case REG_SZ: - case REG_EXPAND_SZ: { - const WCHAR start[] = {'"',0}; - const WCHAR end[] = {'"','\n',0}; - DWORD len; + WCHAR* wstr = (WCHAR*)*val_buf; + + if (val_size1 < sizeof(WCHAR) || val_size1 % sizeof(WCHAR) || + wstr[val_size1 / sizeof(WCHAR) - 1]) { + REGPROC_export_binary(line_buf, line_buf_size, &line_len, value_type, *val_buf, val_size1, unicode); + } else { + const WCHAR start[] = {'"',0}; + const WCHAR end[] = {'"','\n',0}; + DWORD len; - len = lstrlenW(start); - REGPROC_resize_char_buffer(line_buf, line_buf_size, line_len + len); - lstrcpyW(*line_buf + line_len, start); - line_len += len; + len = lstrlenW(start); + REGPROC_resize_char_buffer(line_buf, line_buf_size, line_len + len); + lstrcpyW(*line_buf + line_len, start); + line_len += len; - if (val_size1) - REGPROC_export_string(line_buf, line_buf_size, &line_len, (WCHAR*) *val_buf); + /* At this point we know wstr is '\0'-terminated + * so we can substract 1 from the size + */ + REGPROC_export_string(line_buf, line_buf_size, &line_len, wstr, val_size1 / sizeof(WCHAR) - 1); - REGPROC_resize_char_buffer(line_buf, line_buf_size, line_len + lstrlenW(end)); - lstrcpyW(*line_buf + line_len, end); + REGPROC_resize_char_buffer(line_buf, line_buf_size, line_len + lstrlenW(end)); + lstrcpyW(*line_buf + line_len, end); + } break; } @@ -1055,7 +1131,7 @@ static void export_hkey(FILE *file, HKEY key, WCHAR format[] = {'d','w','o','r','d',':','%','0','8','x','\n',0}; REGPROC_resize_char_buffer(line_buf, line_buf_size, line_len + 15); - wsprintfW(*line_buf + line_len, format, *((DWORD *)*val_buf)); + sprintfW(*line_buf + line_len, format, *((DWORD *)*val_buf)); break; } @@ -1072,75 +1148,11 @@ static void export_hkey(FILE *file, HKEY key, HeapFree(GetProcessHeap(), 0, value_nameA); } /* falls through */ + case REG_EXPAND_SZ: case REG_MULTI_SZ: /* falls through */ - case REG_BINARY: { - DWORD i1; - const WCHAR *hex_prefix; - WCHAR buf[20]; - int hex_pos, data_pos, column; - const WCHAR hex[] = {'h','e','x',':',0}; - const WCHAR format[] = {'%','0','2','x',0}; - const WCHAR comma[] = {',',0}; - const WCHAR concat[] = {'\\','\n',' ',' ',0}; - int concat_prefix, concat_len; - const WCHAR newline[] = {'\n',0}; - BYTE* val_buf1 = *val_buf; - DWORD val_buf1_size = val_size1; - - if (value_type == REG_BINARY) { - hex_prefix = hex; - } else { - const WCHAR hex_format[] = {'h','e','x','(','%','d',')',':',0}; - hex_prefix = buf; - wsprintfW(buf, hex_format, value_type); - if(value_type == REG_MULTI_SZ && !unicode) - val_buf1 = (BYTE*)GetMultiByteStringN((WCHAR*)*val_buf, val_size1 / sizeof(WCHAR), &val_buf1_size); - } - - concat_len=lstrlenW(concat); - concat_prefix=2; - - hex_pos = line_len; - line_len += lstrlenW(hex_prefix); - data_pos = line_len; - line_len += val_buf1_size * 3; - /* - The 2 spaces that concat places at the start of the - * line effectively reduce the space available for data. - * - If the value name and hex prefix are very long - * ( > REG_FILE_HEX_LINE_LEN) then we may overestimate - * the needed number of lines by one. But that's ok. - * - The trailing linefeed takes the place of a comma so - * it's accounted for already. - */ - line_len += line_len / (REG_FILE_HEX_LINE_LEN - concat_prefix) * concat_len; - REGPROC_resize_char_buffer(line_buf, line_buf_size, line_len); - lstrcpyW(*line_buf + hex_pos, hex_prefix); - column = data_pos; /* no line wrap yet */ - i1 = 0; - while (1) - { - wsprintfW(*line_buf + data_pos, format, (unsigned int)(val_buf1)[i1]); - data_pos += 2; - if (++i1 == val_buf1_size) - break; - - lstrcpyW(*line_buf + data_pos, comma); - data_pos++; - column += 3; - - /* wrap the line */ - if (column >= REG_FILE_HEX_LINE_LEN) { - lstrcpyW(*line_buf + data_pos, concat); - data_pos += concat_len; - column = concat_prefix; - } - } - lstrcpyW(*line_buf + data_pos, newline); - if(value_type == REG_MULTI_SZ && !unicode) - HeapFree(GetProcessHeap(), 0, val_buf1); - break; - } + case REG_BINARY: + REGPROC_export_binary(line_buf, line_buf_size, &line_len, value_type, *val_buf, val_size1, unicode); } REGPROC_write_line(file, *line_buf, unicode); } @@ -1239,7 +1251,7 @@ BOOL export_registry_key(WCHAR *file_name, WCHAR *reg_key_name, DWORD format) val_name_buf = HeapAlloc(GetProcessHeap(), 0, val_name_size * sizeof(*val_name_buf)); val_buf = HeapAlloc(GetProcessHeap(), 0, val_size); - line_buf = HeapAlloc(GetProcessHeap(), 0, line_buf_size); + line_buf = HeapAlloc(GetProcessHeap(), 0, line_buf_size * sizeof(*line_buf)); CHECK_ENOUGH_MEMORY(reg_key_name_buf && val_name_buf && val_buf && line_buf); if (reg_key_name && reg_key_name[0]) { diff --git a/programs/winetest/main.c b/programs/winetest/main.c index 86035f04379..9623039a36e 100644 --- a/programs/winetest/main.c +++ b/programs/winetest/main.c @@ -51,6 +51,35 @@ static const char whitespace[] = " \t\r\n"; static const char testexe[] = "_test.exe"; static char build_id[64]; +/* filters for running only specific tests */ +static char *filters[64]; +static unsigned int nb_filters = 0; + +/* check if test is being filtered out */ +static BOOL test_filtered_out( LPCSTR module, LPCSTR testname ) +{ + char *p, dllname[MAX_PATH]; + unsigned int i, len; + + strcpy( dllname, module ); + CharLowerA( dllname ); + p = strstr( dllname, testexe ); + if (p) *p = 0; + len = strlen(dllname); + + if (!nb_filters) return FALSE; + for (i = 0; i < nb_filters; i++) + { + if (!strncmp( dllname, filters[i], len )) + { + if (!filters[i][len]) return FALSE; + if (filters[i][len] != ':') continue; + if (!testname || !strcmp( testname, &filters[i][len+1] )) return FALSE; + } + } + return TRUE; +} + static char * get_file_version(char * file_name) { static char version[32]; @@ -271,7 +300,7 @@ run_ex (char *cmd, HANDLE out_file, const char *tempdir, DWORD ms) si.dwFlags = STARTF_USESTDHANDLES; si.hStdInput = GetStdHandle( STD_INPUT_HANDLE ); si.hStdOutput = out_file ? out_file : GetStdHandle( STD_OUTPUT_HANDLE ); - si.hStdError = GetStdHandle( STD_ERROR_HANDLE ); + si.hStdError = out_file ? out_file : GetStdHandle( STD_ERROR_HANDLE ); if (!CreateProcessA (NULL, cmd, NULL, NULL, TRUE, CREATE_DEFAULT_ERROR_MODE, NULL, tempdir, &si, &pi)) { @@ -320,15 +349,15 @@ run_ex (char *cmd, HANDLE out_file, const char *tempdir, DWORD ms) return status; } -static void +static DWORD get_subtests (const char *tempdir, struct wine_test *test, LPTSTR res_name) { char *cmd; HANDLE subfile; - DWORD total; + DWORD err, total; char buffer[8192], *index; static const char header[] = "Valid test names:"; - int allocated; + int status, allocated; char tmpdir[MAX_PATH], subname[MAX_PATH]; SECURITY_ATTRIBUTES sa; @@ -355,6 +384,7 @@ get_subtests (const char *tempdir, struct wine_test *test, LPTSTR res_name) &sa, CREATE_ALWAYS, 0, NULL ); } if (subfile == INVALID_HANDLE_VALUE) { + err = GetLastError(); report (R_ERROR, "Can't open subtests output of %s: %u", test->name, GetLastError()); goto quit; @@ -362,15 +392,23 @@ get_subtests (const char *tempdir, struct wine_test *test, LPTSTR res_name) extract_test (test, tempdir, res_name); cmd = strmake (NULL, "%s --list", test->exename); - run_ex (cmd, subfile, tempdir, 5000); + status = run_ex (cmd, subfile, tempdir, 5000); + err = GetLastError(); free (cmd); + if (status == -2) + { + report (R_ERROR, "Cannot run %s error %u", test->exename, err); + goto quit; + } + SetFilePointer( subfile, 0, NULL, FILE_BEGIN ); ReadFile( subfile, buffer, sizeof(buffer), &total, NULL ); CloseHandle( subfile ); if (sizeof buffer == total) { report (R_ERROR, "Subtest list of %s too big.", test->name, sizeof buffer); + err = ERROR_OUTOFMEMORY; goto quit; } buffer[total] = 0; @@ -379,6 +417,7 @@ get_subtests (const char *tempdir, struct wine_test *test, LPTSTR res_name) if (!index) { report (R_ERROR, "Can't parse subtests output of %s", test->name); + err = ERROR_INTERNAL_ERROR; goto quit; } index += sizeof header; @@ -392,15 +431,18 @@ get_subtests (const char *tempdir, struct wine_test *test, LPTSTR res_name) test->subtests = xrealloc (test->subtests, allocated * sizeof(char*)); } - test->subtests[test->subtest_count++] = strdup (index); + if (!test_filtered_out( test->name, index )) + test->subtests[test->subtest_count++] = xstrdup(index); index = strtok (NULL, whitespace); } test->subtests = xrealloc (test->subtests, test->subtest_count * sizeof(char*)); + err = 0; quit: if (!DeleteFileA (subname)) report (R_WARNING, "Can't delete file '%s': %u", subname, GetLastError()); + return err; } static void @@ -420,7 +462,7 @@ static BOOL CALLBACK EnumTestFileProc (HMODULE hModule, LPCTSTR lpszType, LPTSTR lpszName, LONG_PTR lParam) { - (*(int*)lParam)++; + if (!test_filtered_out( lpszName, NULL )) (*(int*)lParam)++; return TRUE; } @@ -431,6 +473,9 @@ extract_test_proc (HMODULE hModule, LPCTSTR lpszType, const char *tempdir = (const char *)lParam; char dllname[MAX_PATH]; HMODULE dll; + DWORD err; + + if (test_filtered_out( lpszName, NULL )) return TRUE; /* Check if the main dll is present on this system */ CharLowerA(lpszName); @@ -444,11 +489,16 @@ extract_test_proc (HMODULE hModule, LPCTSTR lpszType, } FreeLibrary(dll); - xprintf (" %s=%s\n", dllname, get_file_version(dllname)); - - get_subtests( tempdir, &wine_tests[nr_of_files], lpszName ); - nr_of_tests += wine_tests[nr_of_files].subtest_count; - nr_of_files++; + if (!(err = get_subtests( tempdir, &wine_tests[nr_of_files], lpszName ))) + { + xprintf (" %s=%s\n", dllname, get_file_version(dllname)); + nr_of_tests += wine_tests[nr_of_files].subtest_count; + nr_of_files++; + } + else + { + xprintf (" %s=load error %u\n", dllname, err); + } return TRUE; } @@ -582,7 +632,7 @@ static void usage (void) { fprintf (stderr, -"Usage: winetest [OPTION]...\n\n" +"Usage: winetest [OPTION]... [TESTS]\n\n" " -c console mode, no GUI\n" " -e preserve the environment\n" " -h print this message and exit\n" @@ -607,11 +657,14 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst, cmdLine = strtok (cmdLine, whitespace); while (cmdLine) { if (cmdLine[0] != '-' || cmdLine[2]) { - report (R_ERROR, "Not a single letter option: %s", cmdLine); - usage (); - exit (2); + if (nb_filters == sizeof(filters)/sizeof(filters[0])) + { + report (R_ERROR, "Too many test filters specified"); + exit (2); + } + filters[nb_filters++] = xstrdup( cmdLine ); } - switch (cmdLine[1]) { + else switch (cmdLine[1]) { case 'c': report (R_TEXTMODE); interactive = 0; @@ -672,21 +725,24 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst, SetEnvironmentVariableA( "WINETEST_REPORT_SUCCESS", "0" ); } - while (!tag) { - if (!interactive) - report (R_FATAL, "Please specify a tag (-t option) if " - "running noninteractive!"); - if (guiAskTag () == IDABORT) exit (1); - } - report (R_TAG); + if (!nb_filters) /* don't submit results when filtering */ + { + while (!tag) { + if (!interactive) + report (R_FATAL, "Please specify a tag (-t option) if " + "running noninteractive!"); + if (guiAskTag () == IDABORT) exit (1); + } + report (R_TAG); - if (!build_id[0]) - report( R_WARNING, "You won't be able to submit results without a valid build id.\n" - "To submit results, winetest needs to be built from a git checkout." ); + if (!build_id[0]) + report( R_WARNING, "You won't be able to submit results without a valid build id.\n" + "To submit results, winetest needs to be built from a git checkout." ); + } if (!logname) { logname = run_tests (NULL); - if (build_id[0] && + if (build_id[0] && !nb_filters && report (R_ASK, MB_YESNO, "Do you want to submit the test results?") == IDYES) if (!send_file (logname) && !DeleteFileA(logname)) report (R_WARNING, "Can't remove logfile: %u", GetLastError()); diff --git a/programs/winetest/winetest.rc b/programs/winetest/winetest.rc index a28e0d7099d..4d406f2f409 100644 --- a/programs/winetest/winetest.rc +++ b/programs/winetest/winetest.rc @@ -49,9 +49,9 @@ BEGIN LTEXT "Extracting:", IDC_ST0, 10, 5, 140, 10 CONTROL "PB0", IDC_PB0, PROGRESS_CLASS, 0, 5, 15, 150, 10 LTEXT "Running:", IDC_ST1, 10, 30, 140, 10 - CONTROL "PB1", IDC_PB1, PROGRESS_CLASS, 0, 5, 40, 150, 15 - LTEXT "Network transfer:", IDC_ST2, 10, 60, 140, 10 - CONTROL "PB2", IDC_PB2, PROGRESS_CLASS, 0, 5, 70, 150, 10 + CONTROL "PB1", IDC_PB1, PROGRESS_CLASS, 0, 5, 40, 150, 10 + LTEXT "Network transfer:", IDC_ST2, 10, 55, 140, 10 + CONTROL "PB2", IDC_PB2, PROGRESS_CLASS, 0, 5, 65, 150, 10 LTEXT "Tag:", IDC_STATIC, 10, 89, 100, 10 EDITTEXT IDC_TAG, 25, 88, 125, 10, diff --git a/programs/wordpad/Da.rc b/programs/wordpad/Da.rc index 0ae3e2991c5..c9f132c9e98 100644 --- a/programs/wordpad/Da.rc +++ b/programs/wordpad/Da.rc @@ -110,7 +110,7 @@ CAPTION "Dato og tid" FONT 10, "MS Sans Serif" BEGIN LTEXT "Tilgængelige formater",0,3,2,100,15 - LISTBOX IDC_DATETIME,3,12,80,65,LBS_NOINTEGRALHEIGHT + LISTBOX IDC_DATETIME,3,12,80,65,LBS_NOINTEGRALHEIGHT | LBS_NOTIFY PUSHBUTTON "&OK",IDOK,87,12,40,12 PUSHBUTTON "&Annuller",IDCANCEL,87,26,40,12 END diff --git a/programs/wordpad/De.rc b/programs/wordpad/De.rc index 69244f60462..b2f8e613424 100644 --- a/programs/wordpad/De.rc +++ b/programs/wordpad/De.rc @@ -112,7 +112,7 @@ CAPTION "Datum und Uhrzeit" FONT 10, "MS Sans Serif" BEGIN LTEXT "Verfügbare Formate",0,3,2,100,15 - LISTBOX IDC_DATETIME,3,12,80,65,LBS_NOINTEGRALHEIGHT + LISTBOX IDC_DATETIME,3,12,80,65,LBS_NOINTEGRALHEIGHT | LBS_NOTIFY PUSHBUTTON "&OK",IDOK,87,12,40,12 PUSHBUTTON "A&bbrechen",IDCANCEL,87,26,40,12 END diff --git a/programs/wordpad/Fr.rc b/programs/wordpad/Fr.rc index c423a7f1b4a..1345586e58b 100644 --- a/programs/wordpad/Fr.rc +++ b/programs/wordpad/Fr.rc @@ -110,7 +110,7 @@ CAPTION "Date et heure" FONT 10, "MS Sans Serif" BEGIN LTEXT "Formats disponibles",0,3,2,100,15 - LISTBOX IDC_DATETIME,3,12,80,65,LBS_NOINTEGRALHEIGHT + LISTBOX IDC_DATETIME,3,12,80,65,LBS_NOINTEGRALHEIGHT | LBS_NOTIFY PUSHBUTTON "&OK",IDOK,87,12,40,12 PUSHBUTTON "&Annuler",IDCANCEL,87,26,40,12 END diff --git a/programs/wordpad/Hu.rc b/programs/wordpad/Hu.rc index 78f069b59df..c6d8df934cf 100644 --- a/programs/wordpad/Hu.rc +++ b/programs/wordpad/Hu.rc @@ -110,7 +110,7 @@ CAPTION "Date and time" FONT 10, "MS Sans Serif" BEGIN LTEXT "Available formats",0,3,2,100,15 - LISTBOX IDC_DATETIME,3,12,80,65,LBS_NOINTEGRALHEIGHT + LISTBOX IDC_DATETIME,3,12,80,65,LBS_NOINTEGRALHEIGHT | LBS_NOTIFY PUSHBUTTON "&OK",IDOK,87,12,40,12 PUSHBUTTON "&Cancel",IDCANCEL,87,26,40,12 END diff --git a/programs/wordpad/Ko.rc b/programs/wordpad/Ko.rc index ac246eba81c..c0a9ffbcdfc 100644 --- a/programs/wordpad/Ko.rc +++ b/programs/wordpad/Ko.rc @@ -112,7 +112,7 @@ CAPTION " FONT 10, "MS Shell Dlg" BEGIN LTEXT "°¡´ÉÇÑ Çü½Ä",0,3,2,100,15 - LISTBOX IDC_DATETIME,3,12,80,65,LBS_NOINTEGRALHEIGHT + LISTBOX IDC_DATETIME,3,12,80,65,LBS_NOINTEGRALHEIGHT | LBS_NOTIFY PUSHBUTTON "È®ÀÎ(&O)",IDOK,87,12,40,12 PUSHBUTTON "Ãë¼Ò(&C)",IDCANCEL,87,26,40,12 END diff --git a/programs/wordpad/Nl.rc b/programs/wordpad/Nl.rc index 0a53658eb85..718686183a4 100644 --- a/programs/wordpad/Nl.rc +++ b/programs/wordpad/Nl.rc @@ -111,7 +111,7 @@ CAPTION "Datum en tijd" FONT 10, "MS Sans Serif" BEGIN LTEXT "Beschikbare formaten",0,3,2,100,15 - LISTBOX IDC_DATETIME,3,12,80,65,LBS_NOINTEGRALHEIGHT + LISTBOX IDC_DATETIME,3,12,80,65,LBS_NOINTEGRALHEIGHT | LBS_NOTIFY PUSHBUTTON "&OK",IDOK,87,12,40,12 PUSHBUTTON "&Annuleren",IDCANCEL,87,26,40,12 END diff --git a/programs/wordpad/No.rc b/programs/wordpad/No.rc index b162926c666..66a670195b1 100644 --- a/programs/wordpad/No.rc +++ b/programs/wordpad/No.rc @@ -110,7 +110,7 @@ CAPTION "Dato og klokkeslett" FONT 10, "MS Sans Serif" BEGIN LTEXT "Tilgjengelige formater",0,3,2,100,15 - LISTBOX IDC_DATETIME,3,12,80,65,LBS_NOINTEGRALHEIGHT + LISTBOX IDC_DATETIME,3,12,80,65,LBS_NOINTEGRALHEIGHT | LBS_NOTIFY PUSHBUTTON "&OK",IDOK,87,12,40,12 PUSHBUTTON "&Avbryt",IDCANCEL,87,26,40,12 END diff --git a/programs/wordpad/Pl.rc b/programs/wordpad/Pl.rc index 7c6cdaa341b..3f430c66ec9 100644 --- a/programs/wordpad/Pl.rc +++ b/programs/wordpad/Pl.rc @@ -111,7 +111,7 @@ CAPTION "Data i godzina" FONT 10, "MS Sans Serif" BEGIN LTEXT "Dostêpne formaty",0,3,2,100,15 - LISTBOX IDC_DATETIME,3,12,80,65,LBS_NOINTEGRALHEIGHT + LISTBOX IDC_DATETIME,3,12,80,65,LBS_NOINTEGRALHEIGHT | LBS_NOTIFY PUSHBUTTON "&OK",IDOK,87,12,40,12 PUSHBUTTON "&Anuluj",IDCANCEL,87,26,40,12 END diff --git a/programs/wordpad/Pt.rc b/programs/wordpad/Pt.rc index ce153265bd9..f539a44c6e4 100644 --- a/programs/wordpad/Pt.rc +++ b/programs/wordpad/Pt.rc @@ -112,7 +112,7 @@ CAPTION "Data e hora" FONT 10, "MS Sans Serif" BEGIN LTEXT "Formatos Disponíveis",0,3,2,100,15 - LISTBOX IDC_DATETIME,3,12,80,65,LBS_NOINTEGRALHEIGHT + LISTBOX IDC_DATETIME,3,12,80,65,LBS_NOINTEGRALHEIGHT | LBS_NOTIFY PUSHBUTTON "&OK",IDOK,87,12,40,12 PUSHBUTTON "&Cancelar",IDCANCEL,87,26,40,12 END diff --git a/programs/wordpad/Ru.rc b/programs/wordpad/Ru.rc index 76285548ace..4504ac31b05 100644 --- a/programs/wordpad/Ru.rc +++ b/programs/wordpad/Ru.rc @@ -110,7 +110,7 @@ CAPTION " FONT 10, "MS Sans Serif" BEGIN LTEXT "Äîñòóïíûå ôîðìàòû",0,3,2,100,15 - LISTBOX IDC_DATETIME,3,12,80,65,LBS_NOINTEGRALHEIGHT + LISTBOX IDC_DATETIME,3,12,80,65,LBS_NOINTEGRALHEIGHT | LBS_NOTIFY PUSHBUTTON "&ÎÊ",IDOK,87,12,40,12 PUSHBUTTON "Î&òìåíà",IDCANCEL,87,26,40,12 END diff --git a/programs/wordpad/Si.rc b/programs/wordpad/Si.rc index 448541e25e0..23a7294a7ae 100644 --- a/programs/wordpad/Si.rc +++ b/programs/wordpad/Si.rc @@ -112,7 +112,7 @@ CAPTION "Datum in čas" FONT 10, "MS Sans Serif" BEGIN LTEXT "Razpoložljive oblike",0,3,2,100,15 - LISTBOX IDC_DATETIME,3,12,80,65,LBS_NOINTEGRALHEIGHT + LISTBOX IDC_DATETIME,3,12,80,65,LBS_NOINTEGRALHEIGHT | LBS_NOTIFY PUSHBUTTON "&V redu",IDOK,87,12,40,12 PUSHBUTTON "&Prekliči",IDCANCEL,87,26,40,12 END diff --git a/programs/wordpad/Tr.rc b/programs/wordpad/Tr.rc index f03b68d4afd..d5475e56e1e 100644 --- a/programs/wordpad/Tr.rc +++ b/programs/wordpad/Tr.rc @@ -112,7 +112,7 @@ CAPTION "Date and time" FONT 10, "MS Sans Serif" BEGIN LTEXT "Available formats",0,3,2,100,15 - LISTBOX IDC_DATETIME,3,12,80,65,LBS_NOINTEGRALHEIGHT + LISTBOX IDC_DATETIME,3,12,80,65,LBS_NOINTEGRALHEIGHT | LBS_NOTIFY PUSHBUTTON "&OK",IDOK,87,12,40,12 PUSHBUTTON "&Cancel",IDCANCEL,87,26,40,12 END diff --git a/programs/wordpad/Zh.rc b/programs/wordpad/Zh.rc index 3b873165558..3380447ac83 100644 --- a/programs/wordpad/Zh.rc +++ b/programs/wordpad/Zh.rc @@ -115,7 +115,7 @@ CAPTION "日期和时间" FONT 9, "MS Song" BEGIN LTEXT "可用格式",0,3,2,100,15 - LISTBOX IDC_DATETIME,3,12,80,65,LBS_NOINTEGRALHEIGHT + LISTBOX IDC_DATETIME,3,12,80,65,LBS_NOINTEGRALHEIGHT | LBS_NOTIFY PUSHBUTTON "确定(&O)",IDOK,87,12,40,12 PUSHBUTTON "取消(&C)",IDCANCEL,87,26,40,12 END diff --git a/tools/make_makefiles b/tools/make_makefiles index bd0f2559120..2011cff7ffc 100755 --- a/tools/make_makefiles +++ b/tools/make_makefiles @@ -237,7 +237,7 @@ sub update_makefiles(@) my $args = ""; if ($rules eq $makerules{"MAKE_DLL_RULES"}) { $args = ",[dlls],[ALL_DLL_DIRS]"; } elsif ($rules eq $makerules{"MAKE_IMPLIB_RULES"}) { $args = ",[dlls],[ALL_IMPLIB_DIRS]"; } - elsif ($rules eq $makerules{"MAKE_TEST_RULES"}) { $args = ",[dlls],[ALL_TEST_DIRS]"; } + elsif ($rules eq $makerules{"MAKE_TEST_RULES"}) { $args = ",[dlls],[ALL_TEST_DIRS],[enable_tests]"; } elsif ($rules eq $makerules{"MAKE_PROG_RULES"}) { (my $name = $file) =~ s/^programs\/(.*)\/Makefile/$1/; @@ -413,7 +413,8 @@ sub update_dlls(@) $text .= "\n\n"; $text .= "\$(TESTSUBDIRS:%=%/__crosstest__): \$(CROSS_IMPLIBS)\n\n"; $text .= "implib: \$(IMPORT_LIBS)\n\n"; - $text .= ".PHONY: implib\n\n"; + $text .= "testsubdirs: \$(TESTSUBDIRS)\n\n"; + $text .= ".PHONY: implib testsubdirs\n\n"; foreach my $mod (sort keys %importlibs) { diff --git a/tools/widl/proxy.c b/tools/widl/proxy.c index 6f1d0ee6734..3d0a766d094 100644 --- a/tools/widl/proxy.c +++ b/tools/widl/proxy.c @@ -113,7 +113,7 @@ static void init_proxy(const statement_list_t *stmts) print_proxy( "\n"); print_proxy( "struct __proxy_frame\n"); print_proxy( "{\n"); - print_proxy( " __DECL_EXCEPTION_FRAME;\n"); + print_proxy( " __DECL_EXCEPTION_FRAME\n"); print_proxy( " MIDL_STUB_MESSAGE _StubMsg;\n"); print_proxy( " void *This;\n"); print_proxy( "};\n"); diff --git a/tools/widl/server.c b/tools/widl/server.c index db2d6c28880..04e268b2a29 100644 --- a/tools/widl/server.c +++ b/tools/widl/server.c @@ -383,7 +383,7 @@ static void init_server(void) print_server("\n"); print_server("struct __server_frame\n"); print_server("{\n"); - print_server(" __DECL_EXCEPTION_FRAME;\n"); + print_server(" __DECL_EXCEPTION_FRAME\n"); print_server(" MIDL_STUB_MESSAGE _StubMsg;\n"); print_server("};\n"); print_server("\n"); diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c index 775bef68a55..45467e59d3f 100644 --- a/tools/widl/typegen.c +++ b/tools/widl/typegen.c @@ -3137,7 +3137,7 @@ size_t get_size_procformatstring(const statement_list_t *stmts, type_pred_t pred size += get_size_procformatstring(stmt->u.lib->stmts, pred) - 1; continue; } - else if (stmt->type != STMT_TYPE && stmt->u.type->type != RPC_FC_IP) + else if (stmt->type != STMT_TYPE || stmt->u.type->type != RPC_FC_IP) continue; iface = stmt->u.type; @@ -3405,7 +3405,7 @@ void write_exceptions( FILE *file ) fprintf( file, " unsigned char finally_level;\n"); fprintf( file, "\n"); fprintf( file, "struct __exception_frame\n{\n"); - fprintf( file, " __DECL_EXCEPTION_FRAME;\n"); + fprintf( file, " __DECL_EXCEPTION_FRAME\n"); fprintf( file, "};\n"); fprintf( file, "\n"); fprintf( file, "static DWORD __widl_exception_handler( EXCEPTION_RECORD *record,\n"); -- 2.11.4.GIT