From f0fd0089904de9cbbd8c45e529849af3d8314de6 Mon Sep 17 00:00:00 2001 From: Jan Zerebecki Date: Sat, 20 Sep 2008 02:56:25 +0200 Subject: [PATCH] push a2e7360632735b5a2be8f61a9725e4e6969c5533 --- ANNOUNCE | 1614 +++++++++++++++++++------------------- VERSION | 2 +- configure | 18 +- dlls/advapi32/registry.c | 3 - dlls/comctl32/tests/treeview.c | 40 + dlls/comctl32/treeview.c | 39 +- dlls/crypt32/cert.c | 1 + dlls/crypt32/tests/encode.c | 156 ++-- dlls/crypt32/tests/msg.c | 1 + dlls/d3dxof/d3dxof.c | 5 +- dlls/dsound/tests/dsound.c | 5 +- dlls/gdi32/freetype.c | 67 +- dlls/gdi32/tests/font.c | 6 + dlls/hhctrl.ocx/hhctrl.h | 8 +- dlls/inetcomm/inetcomm_main.c | 2 +- dlls/jscript/dispex.c | 2 + dlls/jscript/engine.c | 987 ++++++++++++++++++++--- dlls/jscript/engine.h | 6 +- dlls/jscript/function.c | 46 +- dlls/jscript/global.c | 52 +- dlls/jscript/jscript.h | 16 + dlls/jscript/jsutils.c | 119 ++- dlls/jscript/parser.y | 28 +- dlls/jscript/string.c | 64 +- dlls/jscript/tests/api.js | 24 + dlls/jscript/tests/lang.js | 300 +++++++ dlls/jscript/tests/run.c | 77 +- dlls/kernel32/file.c | 10 +- dlls/kernel32/tests/file.c | 6 +- dlls/kernel32/tests/module.c | 3 +- dlls/kernel32/tests/thread.c | 29 +- dlls/kernel32/tests/version.c | 3 +- dlls/kernel32/tests/virtual.c | 14 +- dlls/localspl/localspl_main.c | 321 +++++++- dlls/localspl/localspl_private.h | 7 +- dlls/mshtml/htmlbody.c | 39 +- dlls/mshtml/mshtml_private.h | 6 +- dlls/mshtml/tests/dom.c | 37 + dlls/mstask/tests/task.c | 19 +- dlls/msvcrt/tests/file.c | 2 +- dlls/msxml3/queryresult.c | 27 +- dlls/ntdll/tests/om.c | 71 +- dlls/ntdll/tests/reg.c | 2 +- dlls/riched20/editor.h | 4 +- dlls/riched20/paint.c | 30 +- dlls/shell32/autocomplete.c | 164 +++- dlls/shell32/control.c | 16 + dlls/shlwapi/tests/clsid.c | 14 +- dlls/user32/tests/cursoricon.c | 12 +- dlls/user32/tests/monitor.c | 19 +- dlls/user32/tests/msg.c | 10 +- dlls/user32/user32.spec | 2 +- dlls/user32/user_main.c | 10 + dlls/wined3d/basetexture.c | 2 +- dlls/wined3d/context.c | 329 +++++++- dlls/wined3d/cubetexture.c | 3 +- dlls/wined3d/device.c | 251 +----- dlls/wined3d/directx.c | 2 +- dlls/wined3d/state.c | 3 + dlls/wined3d/surface.c | 18 +- dlls/wined3d/texture.c | 2 - dlls/wined3d/volume.c | 42 +- dlls/wined3d/volumetexture.c | 4 +- dlls/wined3d/wined3d_main.c | 2 +- dlls/wined3d/wined3d_private.h | 22 +- dlls/winex11.drv/event.c | 34 +- dlls/winex11.drv/window.c | 7 +- dlls/winspool.drv/info.c | 78 +- dlls/wintrust/wintrust_main.c | 18 +- include/amvideo.idl | 2 +- include/cryptdlg.h | 2 +- include/cryptuiapi.h | 20 + include/d3d10.idl | 6 +- include/imnxport.idl | 4 +- include/mimeole.idl | 19 +- include/objidl.idl | 2 +- include/propidl.idl | 4 +- include/shobjidl.idl | 19 + include/wintrust.h | 4 + programs/explorer/desktop.c | 27 +- programs/oleview/Ja.rc | 213 +++++ programs/oleview/rsrc.rc | 1 + programs/wineboot/wineboot.c | 6 +- tools/widl/header.c | 22 +- tools/wine.inf.in | 1 + 85 files changed, 4125 insertions(+), 1609 deletions(-) rewrite ANNOUNCE (96%) create mode 100644 programs/oleview/Ja.rc diff --git a/ANNOUNCE b/ANNOUNCE dissimilarity index 96% index 7a2c6111333..982ac735f37 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,804 +1,810 @@ -The Wine development release 1.1.4 is now available. - -What's new in this release (see below for details): - - Substantial chunks of WinHTTP are implemented. - - More JavaScript support. - - Beginnings of shell AppBar implementation. - - Several fixes for Google Chrome support. - - Chinese translations. - - Various bug fixes. - -The source is available from the following locations: - - http://ibiblio.org/pub/linux/system/emulators/wine/wine-1.1.4.tar.bz2 - http://prdownloads.sourceforge.net/wine/wine-1.1.4.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.4: - - 1411 Crimson Skies trial won't run - 2424 Genotyper crashes when the registration dialog should appear - 3326 Subtitle Workshop & weird errors - 4065 picasa2: Korean fonts render with boxes - 5031 First Encounter Assault Recon (FEAR) SP Demo Crashes on Start - 5807 Mercora IMRadio crashes while attempting to run - 6299 steam pop-ups appear as small blue boxes without anything in them - 6486 Terragen water levels - 6609 Unable to install K-Lite Codec Pack - 7273 Several graphical corruptions in Railroad Tycoon 3 - 7755 Mafia (v1.2): Game runs but there is a choppy sound. - 8210 Atlantis Quest 1.0 demo crashes at startup - 8512 Saving in Google SketchUp6 doesn't work - 9119 VAZ Modular 3.03 Live Input module doesn't work. - 9537 Running JSmooth triggers Unhandled page fault - 10023 Vaz Modular 3.03 OSS driver output broken. - 10229 Serious Sam TSE 1.07 - network connection fails - 10414 Minimap in Warhammer 40k: Dark Crusade is offset - 10661 regedit imports wrong binary data from .reg files (affects FAR Manager) fix proposed - 10902 Steam and PulseAudio - 11119 XML Notepad 2007 won't start - 11301 documentElement.ownerDocument.createElement fails - 11357 Reflections in Tomb Raider - Anniversary Demo are buggy - 11688 Lego Star Wars II: In-game sound does not work - 11885 Supreme Commander is black It doesn't render anything. - 11962 regedit highlights the wrong item when searching - 12041 STALKER 1.0004-Trainer.exe crashes in dsound - 12285 BabasChess icons/buttons don't show after upgrading from wine 0.9.57 - 12573 Notation Composer: font glitch - boxes scattered around on initial screen - 12817 Music in Solfege still loopback repeatedly - 13118 Rome Total War Gold v1.5 stops responding in main menu after a while - 13229 Lunar Magic's level and overworld rendering area don't appear properly - 13321 WoW EULA fails to activate "Agree" button during installation (gecko wrapper) - 13327 StarryNight Pro: Window is painted black - 13523 distorted sound in Suboceanic 64k demo - 13526 Ableton Live window rendering bug (Worked in 0.9.13) - 13646 d3d9 device tests crash on XP - 13698 HyperChem 8.0.3: Error at beginning of InstallShield wizard - 13701 MBAC Ver. B Trial crash - 13899 Touhou games STILL don't show backgrounds at startup - 14104 Chessbase Fritz 10 does not start - 14241 FedExShipManager installer fails with "fixme:msxml:domdoc_createNode unhandled node type 2" - 14265 AxCrypt 1.6.4.4 can not be installed - 14291 winhelp: font sizes are smaller than with Windows WINHLP32.EXE - 14301 winhelp: Selecting a topic does not aways go to the correct page - 14576 DrawIconEx isn't up to date. - 14734 PowerPoint Viewer 2007 fails to start - 14760 Morrowind does not run and crashes - 14779 Painkiller doesn't start anymore - 14781 Kontakt, Kore Player: crash on start - 14842 Graphics glitch in DAZ Studio - 14946 Aliens vs Predator exits while starting game engine - 14958 Supreme Commander: Background grid gets Moiré pattern - 14977 Text in AVI-Mux GUI shows as garbage - 14992 Diablo 2 crash introduced in 1.1.3 - 15006 Problem rendering sky on Rose Online - 15020 assertion failed in GPSS World - 15035 Gothic 2, Aplication error - access violation - 15074 System Shock 2: randomly disappearing sound (esp. when loading level) - 15116 Google Chrome URL bar does not render properly - ----------------------------------------------------------------- - -Changes since 1.1.3: - -Adam Petaccia (16): - gdiplus: Stub GdipGetFamily. - gdiplus: Stub GdipGetFontStyle. - gdiplus: Test for GdipGetFamily. - gdiplus: Test for GdipGetFontStyle. - gdiplus: Implement GdipGetFamily. - gdiplus: Implement GdipGetFontStyle. - gdiplus: Implement GdipGetFontHeight. - gdiplus: Don't create a font if there is no facename. - gdiplus: GdipGetFontHeightGivenDPI: Return a valid value for UnitPixel. - gdiplus: Stub GdipTranslateLineTransform. - gdiplus: Stub GdipCreateTexture. - gdiplus: Stub GdipCreateTexture2. - gdiplus: Stub GdipCreateTexture2I. - gdiplus: Implement GdipCreateTexture. - gdiplus: Implement GdipCreateTexture2. - gdiplus: Implement GdipCreateTexture2I. - -Alexander Dorofeyev (6): - wined3d: Add glFlush when clearing the front buffer in ClearSurface. - wined3d: Remove glFlush in RealizePalette. - wined3d: Make the condition to enter p8 conversion shader path more strict. - wined3d: Remove glDrawBuffer calls in BltOverride. - wined3d: Get rid of gl buffer variable in BltOverride. - wined3d: Remove obsolete code & ModifyLocation TODO. - -Alexander Nicolaysen Sørnes (32): - regedit: Remove unneeded character conversions. - regedit: Fix possible memory leaks. - regedit: Convert favourites handling to unicode. - regedit: Fix memory leaks in favourites handling. - regedit: Convert searching to Unicode. - regedit: Convert treeview init to Unicode. - regedit: Use only SendMessageW in treeview.c. - regedit: Convert menu & statusbar handling to unicode. - regedit: Fix leak in GetItemFullPathW. - regedit: Add listview entries as unicode. - regedit: Ignore case when sorting values. - regedit: Fix concat handling for ANSI files. - regedit: Avoid conversion to ANSI when importing hex values. - regedit: Use Unicode strings when updating listview. - regedit: Convert value creation to unicode. - regedit: Convert value editing to unicode. - regedit: Remove old fixme. - regedit: Don't try to convert NULL pointers. - regedit: Convert value renaming to unicode. - regedit: Convert key renaming to unicode. - regedit: Remove some ANSI functions. - regedit: Fix a memory leak. - regedit: Convert listview init to unicode. - regedit: Set the unicode flag for the listview. - regedit: Remove an ANSI function. - regedit: Set the unicode flag for the treeview. - include: Define some Get/SetUnicodeFormat macros. - regedit: Fix some references to TCHARs. - regedit: Remove some unused code. - regedit: Some minor unicode conversions. - regedit: Convert open/save dialogues to unicode. - regedit: Fix a memory leak in export handling. - -Alexandre Julliard (46): - configure: Generate the dlls directory lists in configure instead of make_makefiles. - configure: Add possibility to exclude some directories from the generated lists. - configure: Use the generic directory enabling mechanism to turn off dlls that depend on external libraries. - configure: Allow multiple variables in makefile output, and generate the programs directory lists. - d3dxof: Don't make local variables static. - makefiles: Recurse into all directories for install-lib and install-dev too. - configure: Generate the list of top-level directories to install. - gdi32: Add missing WineEngRealizationInfo function for the non-freetype case. - winhttp: Fix WinHttpSetDefaultProxyConfiguration spec entry. - winhttp: Add support for building on Windows. - dnsapi: Fix compile without the resolv library. - wininet/tests: Add support for optional notifications. Fix the test to pass again on Windows and Wine. - shell32/tests: Fix an unsigned comparison warning. - ntdll/tests: Allow alternate results in the env test to make it pass on Vista. - ntdll/tests: Allow alternate results in the info test to make it pass on Vista. - ntdll/tests: Allow alternate results in the string tests to make them pass on Vista. - msvcrt/tests: Add support for some broken demangle results on older Windows versions. - wininet: Avoid testing errno when it isn't set. Simplify NETCON_getNextLine a bit. - wininet/tests: Add a couple more optional notifications. - Include sys/filio.h to get the FIONREAD definition on Solaris. - ntdll/tests: Handle a couple of failures on NT4. - user32: Apply the SendMessage recursion counter to DispatchMessage too. - ntdll/tests: Fix a few more failures in the info test. - configure: Build the winetest dependencies in configure instead of make_makefiles. - winetest: Build the test list from the makefile instead of make_makefiles. - winex11: Allocate image data from the process heap where possible. - winex11: Always set the z-order when a window is being made visible. - shell32: Merge Chinese resources into a single file. - comdlg32: Merge Chinese resources into a single file. - comctl32: Rename the Chinese resources to comctl_Zh.rc. - widl: Replace write_name() by get_name() to make the code more readable. - widl: Add support for finally function in proxy methods. - programs: Build the programs that support it with -DWINE_NO_UNICODE_MACROS. - libwine: Reserve some malloc space on Solaris before we start mapping other things. - msvcrt/tests: Fix the %n format test for Vista. - configure: Disable by default some modules that cannot work on Windows. - reg.exe: Get rid of remaining uses of Unicode macros. - xcopy.exe: Get rid of remaining uses of Unicode macros. - libwine: Add support for relocating MS-style imports that use OriginalFirstThunk. - winebuild: Generate MS-style imports using the OriginalFirstThunk field. - ntdll: Implemented NtOpenProcessTokenEx and NtOpenThreadTokenEx. - ntdll: Add stubs for all the job object functions. - kernel32: Implemented the wrapper functions for job objects. - shlwapi/tests: Avoid sizeof in traces. - jscript: Avoid an uninitialized variable warning on older gcc. - crypt32: Avoid some uninitialized variable warnings on older gcc. - -Alistair Leslie-Hughes (11): - msxml3: Correct unsupported functions in IDispatchEx. - mshtml: Implement IDispatch for IHTMLBodyElement. - mshtml: Add missing defines. - mshtml: Add missing IDispatchEx tids. - mshtml: Add missing interfaces. - mshtml: Add dispinterface DispHTMLBody. - mshtml: Make IHTMLBodyElement use correct IDispatchEx interface. - mshtml: Add IHTMLElementBody test. - msxml3: Correct FIXME. - msxml3: Add IDispatchEx support to IXMLDOMDocument2. - msxml3: Add IDispatchEx test. - -Andrew Talbot (6): - dxdiagn: Sign-compare warning fix. - iphlpapi: Sign-compare warning fix. - jscript: Sign-compare warnings fix. - msimtf: Sign-compare warning fix. - mstask: Sign-compare warnings fix. - msvfw32: Sign-compare warning fix. - -Aric Stewart (3): - user32: Add test demonstrating the WM_PAINT loop. - systray: Keep systray hidden when requested by moving it off screen. - comctl32: monthcal: Set the stStart parameter when sending the MCN_GETDAYSTATE notification. - -Chris Robinson (2): - wined3d: Use 8 bits-per-component for the PBO test internal format. - wined3d: Use the proper internal type for some formats. - -Christian Costa (6): - d3dxof: Implement storage of parsed information. - d3dxof: Fix guid syntax. - d3dxof: Some fixes for template parsing in text mode. - d3dxof: Fix IDirectXFileDataReference macros. - d3dxof: Start implementing IDirectXFile_CreateEnumObject. - d3dxof: Handle comments in templates text format. - -Damjan Jovanovic (2): - oleaut32: Fix negative number handling in VarFormat. - oleaut32: Thousands separator support for VarFormat. - -Dan Hipschman (5): - ole32: Add widl-generated proxies for unknwn.idl and dcom.idl. - ole32: Add a widl-generated proxy file for objidl.idl. - ole32: Add a widl-generated proxy file for oleidl.idl. - widl: Output NULL for inherited methods in the vtbl. - oleaut32: Add a widl-generated proxy file for ocidl.idl. - -David Adam (1): - d3dx8: Remove useless variables. - -Detlef Riekenberg (5): - include: Declare TranslateURL and needed flags. - shlwapi: Fix parameters for RegQueryValueExW to read the default value. - shlwapi: Fix results for UrlApplyScheme. - shlwapi/tests: Add tests for UrlApplyScheme. - oleaut32: Add entry for 16-bit LHashValOfNameSys. - -Dmitry Timoshkov (3): - user32: Add a test for monitor work area, fix some failures. - user32: Partially revert 499c26ce66ec6cbbb3569c69ca95c9dfac01d39f. - ntdll: Add support for NtSetInformationProcess(ProcessExecuteFlags). - -Dylan Smith (6): - richedit: Pressing tab with selection back to start of table. - richedit: Fixed a bug in protecting table cell boundaries. - richedit: Copy cell border properties when appending a row to the table. - richedit: Prevent streaming in rich text at end of table row. - richedit: Prevent typing text at end of table row. - richedit: Prevent integer overflow in wrapping code with no wrap. - -Eric Pouech (6): - dbghelp: Added the definitions for Dwarf3 specifications. - winedump, dbghelp: Correctly name the age field in PDB headers. - dbghelp: Improve the symbol loader. - dbghelp: Improve the symbol loader for .DBG files. - dbghelp: SymFindFileInPath doesn't check for the parameters passed when looking in a directory, whatever the dbghelp's options. - winedbg: Search default debuggee dir for symbol information. - -Francois Gouget (19): - Assorted spelling fixes. - gdiplus: Add some documentation stubs to make winapicheck happy. - msxml3: Add a '\n' to a Wine trace. - winhttp/tests: Add a trailing '\n' to an ok() call. - user32/tests: Add a trailing '\n' to an ok() call. - dplayx/tests: Fix compilation on systems that don't support nameless unions. - appwiz.cpl: Remove spaces before '...' in the Norwegian resources. - notepad: Remove spaces before '\n' in the Chinese resources. - winhlp32: Remove spaces before '...' in the Chinese resources. - wined3d: Add a '\n' to Wine traces. - gdiplus/tests: Remove unneeded casts. - d3dxof: Remove spaces before '\n', add '\n' in Wine traces. - crypt32: Fix compilation on systems that don't support nameless unions. - oleaut32: Improve the LHashValOfNameSys() documentation a bit. - crypt32/tests: Add a trailing '\n' to an ok() call. - wined3d: Remove spaces before '\n' in Wine traces. - gdiplus: Add/fix the trailing '\n' in Wine traces. - kernel32/tests: Add a trailing '\n' to an ok() call. - d3dxof: Add a '\n' to a Wine trace. - -Gerald Pfeifer (3): - winhttp: Include . - quartz: Add return statement to PullPin_Thread_Main(). - winenas: Add return statement to wodPlayer(). - -Hans Leidekker (26): - winhttp: Add support for querying most of the standard header attributes. - winhttp: Add networking infrastructure. - winhttp: Implement WinHttpSendRequest. - winhttp: Implement WinHttpReceiveResponse. - winhttp: Implement WinHttpQueryDataAvailable. - winhttp: Implement WinHttpReadData. - winhttp: Implement WinHttpWriteData. - winhttp: Remove some unneeded includes. - winhttp: Implement WinHttpQueryAuthSchemes. - winhttp: Implement WinHttpSetCredentials. - winhttp: Add support for secure connections. - winhttp: Test secure connections. Fix a crash when no response is returned. - winhttp: Use default values when empty strings are passed for verb, object and version parameters. - winhttp: Avoid testing errno when it isn't set. - winhttp: Allow reusing a secure connection. - winhttp: WinHttpCrackUrl and InternetCrackUrlW use different scheme constants. - winhttp: Move handling of default request parameters into build_request_string(). - winhttp: Handle redirects. - winhttp: Add an initial implementation of WinHttpQueryOption and WinHttpSetOption. - winhttp: Add status notification tests. Make them pass. - winhttp: Add zero value content length header to POST requests without additional data. - winhttp: A non-standard port must be included in the host header. - winhttp: Implement some more options. - winhttp: Implement WinHttpQueryOption(WINHTTP_OPTION_SECURITY_FLAGS). - winhttp: Implement WinHttpQueryHeaders(WINHTTP_QUERY_RAW_HEADERS). - winhttp: The last parameter of WinHttpQueryDataAvailable and WinHttpReadData is optional. - -Henri Verbeet (12): - wined3d: glDeleteFramebuffersEXT() needs a context. - wined3d: Move a TRACE up a few lines. - d3dx9: Improve a few TRACEs. - wined3d: Remove useless hash_table_t typedef. - msvcrt: Don't depend on the system's implementation of acos() & asin(). - wined3d: Be more careful when deleting FBOs. - wined3d: Depth stencil tracking depends on the value of This->render_offscreen. - wined3d: Use the correct representative for texture transform states. - wined3d: Fix a variable name inside a VTRACE. - wined3d: Correct a TRACE and remove an incorrect comment. - wined3d: IWineD3DSurface_PreLoad() doesn't do an implicit glBindTexture() anymore. - wined3d: Set the viewport to the texture size in depth_blt(). - -Hongbo Ni (60): - notepad: Convert simplified Chinese resource to utf8. - winhlp32: Convert simplified Chinese resource to utf8. - winefile: Convert simplified Chinese resource to utf8. - comctl32: Convert simplified Chinese resource to utf8. - shell32: Convert simplified Chinese resource to utf8. - wineconsole: Convert simplified Chinese resource to utf8. - progman: Convert simplified Chinese resource to utf8. - comdlg32: Convert traditional Chinese resource to utf8. - comdlg32: Convert simplified Chinese resource to utf8. - clock: Convert simplified Chinese resource to utf8. - user32: Convert Chinese resource to utf8. - winecfg: Convert traditional Chinese resource to utf8. - shell32: Convert traditional Chinese resource to utf8. - clock: Add traditional Chinese resource. - progman: Add traditional Chinese resource. - winhlp32: Add traditional Chinese resource. - winefile: Add traditional Chinese resource. - wineconsole: Add traditional Chinese resource. - winecfg: Update traditional Chinese resource. - winecfg: Add simplified Chinese resource. - notepad: Add traditional Chinese resource. - user32: Update traditional Chinese resource. - shell32: Update traditional Chinese resource. - shell32: Update simplified Chinese resource. - comdlg32: Update traditional Chinese resource. - comdlg32: Update simplified Chinese resource. - comctl32: Add traditional Chinese resources. - comdlg32: Update simplified Chinese resource. - notepad: Update Chinese resources - dialog font. - wordpad: Add simplified and traditional Chinese resources. - winemine: Add simplified and traditional Chinese resources. - wineboot: Add simplified and traditional Chinese resources. - view: Add simplified and traditional Chinese resources. - uninstaller: Add simplified and traditional Chinese resources. - taskmgr: Add simplified and traditional Chinese resources. - appwiz: Add simplified and traditional Chinese resources. - avifil32: Add simplified and traditional Chinese resources. - browseui: Add simplified and traditional Chinese resou. - credui: Add simplified and traditional Chinese resources. - gphoto2: Add simplified and traditional Chinese resources. - htctrl: Add simplified and traditional Chinese resources. - localspl: Add simplified and traditional Chinese resources. - localui: Add simplified and traditional Chinese resources. - mpr: Add simplified and traditional Chinese resources. - msacm32: Add simplified and traditional Chinese resources. - mshtml: Add simplified and traditional Chinese resources. - msi: Add simplified and traditional Chinese resources. - msvfw32: Add simplified and traditional Chinese resources. - oleaut32: Add simplified and traditional Chinese resources. - oledlg: Add simplified and traditional Chinese resources. - sane.ds: Add simplified and traditional Chinese resources. - serialui: Add simplified and traditional Chinese resources. - setupapi: Add simplified and traditional Chinese resources. - shdoclc: Add simplified and traditional Chinese resources. - shlwapi: Add simplified and traditional Chinese resources. - wineps: Add simplified and traditional Chinese resources. - wininet: Add simplified and traditional Chinese resources. - winspool: Add simplified and traditional Chinese resources. - oleview: Add simplified and traditional Chinese resources. - regedit: Add simplified and traditional Chinese resources. - -Huw Davies (5): - cryptdlg: Add stubs for CertViewProperties. - crypt32: Add support for CERT_NAME_STR_REVERSE_FLAG. - crypt32/tests: Add a test for streamed, detached updates. - crypt32: Fix streamed, detached updates. - include: Add a few more things to mimeole.idl. - -Jacek Caban (19): - mshtml: Added IHTMLDocument::get_Script implementation. - mshtml: Added IHTMLElement::get_parentElement implementation. - jscript: Added JSGlobal typelib. - shdocvw: Pass the right IDispatch to NavigateComplete2 and DocumentComplete. - jscript: Added IActiveScriptParse::InitNew implementation. - jscript: Added IActiveScript::SetScriptSite. - jscript: Added IActiveScript::Close implementation. - jscript: Added script site tests. - jscript: Added IActiveScript::GetScriptDispatch implementation. - jscript: Added IDispatchEx::GetIDsOfNames implementation. - jscript: Added IDispatchEx::Invoke implementation. - jscript: Added IActiveScript::GetScriptState implementation. - jscript: Added parser. - jscript: Added lexer. - jscript: Added parser memory managment. - jscript: Added IActiveScript::ParseScriptText implementation. - jscript: Added SCRIPTSTATE_STARTED implementation. - jscript: Added ParseScriptText test. - jscript: Added empty statement implementation. - -James Hawkins (64): - msi: Handle features installed as source in MsiQueryFeatureState. - msi: Fix the logic to determine the appropriate action of the feature. - msi: Only set the action to source if the component has a local feature. - msi: Don't install a feature that is disabled. - msi: Skip the feature action detection logic if there is no product code. - msi: Skip the component action detection logic if there is no product code. - msi: Store the _Columns and _Tables tables in the database structure. - advapi32: Fix a few failing tests in Vista. - advapi32: Fix another set of failures on some Vista systems. - comctl32: Fix a few failing tests in win2000. - comctl32: Fix a failing test in XP. - advapi32: Print the actual result of several failing tests. - advapi32: Fix several failing tests in Vista. - crypt32: Fix a failing test in XP. - crypt32: Fix a failing test in Vista. - gdi32: Fix a failing test in win98. - kernel32: Fix a failing test in win95. - kernel32: Trace the modified buffer on error. - kernel32: Fix two failing tests in win95. - kernel32: Trace the last error on failure. - lz32: Fix several failing tests in win95. - crypt32: Fix a failing test in Vista. - rpcrt4: Fix several test failures in Vista. - comctl32: Fix several test failures in win98. - comctl32: Fix a test failure in win98. - comctl32: Trace the message sequences. - comctl32: Fix a failing test in win2000. - crypt32: Split the test for ret and last error up. - msi: Handle converting a value of REG_DWORD in MsiSourceListEnumMediaDisks. - msi: Add tests for opening an empty package. - kernel32: Add tests for LoadLibraryEx. - advapi32: Fix a few test failures in Vista. - advapi32: Fix the process access rights value for Vista. - crypt32: Fix a test that fails in Vista. - crypt32: Remove a test with a binary result that behaves differently across platforms. - crypt32: Fix a failing test in Vista. - kernel32: Fix a failing test in Vista. - kernel32: Fix two tests that fail in win2k3 and modify LoadLibraryEx to match this behavior. - kernel32: Fix a test that fails in win2k3. - mlang: Remove a test that fails on all systems. - mshtml: Fix a test that fails in Vista. - msi: Fix a failing test in Vista. - msvcrt: Trace the results of two failing tests. - ntdll: Fix a few failing tests in Vista. - ole32: Fix a failing test in Vista. - riched20: Trace the result of a failing test. - rpcrt4: Remove a test that was replaced by a better test. - shlwapi: Fix a few failing tests in Vista. - rpcrt4: Fix a failing test in Vista. - schannel: Fix a failing test in Vista. - comctl32: Fix a failing test in win98. - comctl32: Fix a failing test in win9x. - crypt32: Fix several failing tests in win9x. - crypt32: Fix several test failures in win9x. - crypt32: Fix several failing tests in win9x. - crypt32: Fix a few test failures in win9x. - gdi32: Fix a failing test in win9x. - iphlapi: Fix a failing test in win95. - kernel32: Fix a failing test in win95. - netapi32: Fix two failing tests in NT4. - ntdll: Fix a failing test in NT4. - rasapi32: Fix several failing tests in win98. - ole32: Fix two failing tests in win9x. - msi: Source for new patch files can only be compressed. - -Jan de Mooij (2): - comdlg32/printdlg: If ToPages field is left empty set it to FromPages value. - comdlg32/printdlg: Leave FromPages/ToPages empty if it contains max. WORD value. - -Jeff Latimer (6): - user32/tests: Deregister the class created by create_dde_window. - user32: Make some DDE traces more meaningful. - user32/tests: Test infrastructure for testing ddeml end to end. - user32: DdeConnect causes 2 XTYP_CONNECT_CONFIRM messages to flow. Delete one. - user32/tests: Tests for a W interface connection adding some todo_wine tests. - user32/tests: Add more A and W test combinations for dde. - -Jeff Zaroyko (5): - msvcrt: Add a test for unlinking non-empty directories. - kernel32: Add some tests for DeleteFile. - ntdll: Add some tests for NtDeleteFile. - winetest: Check that user enters a tag. - dsound: Check for invalid parameter when unlocking secondary buffers. - -Jim Cameron (9): - user32: Fixed bug in loading .cur files. - user32/tests: Add a regression test for CreateIconFromResource. - dinput: Add IID_IUnknown to DICF_CreateInstance(), DirectInputCreateEx(). - ntoskrnl.exe: Add stub for IoGetDeviceObjectPointer(). - ntoskrnl.exe: Add stub for IoGetRelatedDeviceObject(). - ntoskrnl.exe: Add stub for IoRegisterDriverReinitialization(). - ntoskrnl.exe: Add stub for IoRegisterShutdownNotification(). - ntoskrnl.exe: Add stub for ObReferenceObjectByHandle(). - ntoskrnl.exe: Add stub for ObfDereferenceObject(). - -Juan Lang (36): - crypt32: Add tests for verifying the hash of a detached hash message. - crypt32: Separate decoding data from finalizing (hashing or signing) it. - crypt32: Fix verifying the hash of a detached hash message. - crypt32: Add stub for CryptVerifyDetachedMessageHash. - crypt32: Add tests for CryptVerifyDetachedHashMessage. - crypt32: Implement CryptVerifyDetachedMessageHash. - cryptuiapi.h: Add missing definitions. - crypt32: Test encoding/decoding the authority info access extension. - crypt32: Implement authority info access encoding. - crypt32: Implement authority info access decoding. - crypt32: Don't ignore errors when encoding items in an array. - crypt32: Add tests for encoding/decoding CTLs. - crypt32: Implement encoding CTLs. - crypt32: Implement CTL decoding. - wincrypt.h: Fix typos. - wincrypt.h: Add missing definitions. - crypt32: Fix typo. - crypt32: Fix typo. - crypt32: Add tests showing signed CTLs aren't decoded by CryptDecodeObject. - cryptuiapi: Add a stub for CryptUIDlgCertMgr. - crypt32: Add tests for CertCreateCTLContext. - crypt32: Implement CertCreateCTLContext and CertFreeCTLContext. - crypt32: Add tests for CertGetCTLContextProperty. - crypt32: Add support for CTL properties. - crypt32: Implement CertDuplicateCTLContext. - crypt32: Implement CertAddEncodedCTLToStore. - crypt32: Add CTLs to the memory store. - crypt32: Add CTLs to the collection store. - crypt32: Add CTLs to the provider store. - crypt32: Add CTLs to the file store. - crypt32: Add CTLs to the registry store. - crypt32: Implement CertEnumCTLsInStore. - crypt32: Implement CertDeleteCTLFromStore. - crypt32: Implement CertFindCTLInStore. - crypt32: Add tests for CertAddEncodedCTLToStore. - crypt32: Implement CertAddCTLContextToStore. - -Katayama Hirofumi MZ (1): - wordpad: Added Japanese resource. - -Lei Zhang (3): - regedit: Fix typo in commit c6d01ac847edc2ad02ef02c7a0ead7a833539c3c. - wininet: Work around NULL headers when handling HTTP_QUERY_RAW_HEADERS_CRLF. - wininet: Remove redundant CrLf variables. - -Louis Lenders (4): - shlwapi: Add test showing UrlUnEscape should convert the url in place when URL_UNESCAPE_INPLACE is set. - shlwapi: Fix UrlUnEscape to expand URLs in-place even if the output buffer is NULL. - shobjidl.idl: Add Taskbarlist interface definitions. - wine.inf: Add default Directx registry key for InstalledVersion. - -Luis C. Busquets Pérez (2): - d3dx8: D3DXQuaternionRotationMatrix correct compare value for the trace. - d3dx9: Add types to d3dx9shader.h. - -Maarten Lankhorst (1): - winealsa.drv/dsound: Handle underruns better. - -Marcus Meissner (2): - msxml3: Fixed incorrect MultiByteToWideChar. - Annotate with allocation size attribute. - -Markus Hitter (1): - user32: Better reflect the current state of DrawIconEx. - -Martin Profittlich (1): - user32: Make RegisterDeviceNotificationW behave likeRegisterDeviceNotificationA. - -Michael Stefaniuc (2): - winhttp: Move the wine includes after the system includes. - jscript: Move 'inline' right after the storage specifier in a declaration. - -Muneyuki Noguchi (13): - comdlg32: Update Japanese translation. - shell32: Update Japanese translation. - user32: Update Japanese translation. - clock: Add Japanese resources. - winhlp32: Add Japanese resources. - winecfg: Update Japanese translation. - winefile: Add a Japanese resource file. - comdlg32: Update Japanese translation. - winemine: Add Japanese translation. - clock: Update Japanese translation. - winecfg: Update Japanese translation. - taskmgr: Update Japanese translation. - regedit: Update Japanese translation. - -Nicolas Le Cam (1): - comctl32: Implement LVM_GETUNICODEFORMAT. - -Nikolay Sivov (38): - gdiplus: Free memory after some Graphics tests. - gdiplus: Use GdipFree instead of HeapFree in GdipDeleteGraphics. - gdiplus: Free memory after some GraphicsPath tests. - gdiplus: Added a test for GdipGetDC/GdipReleaseDC behaviour + fixes to be able to run it. - gdiplus: Basic GdipGetDC/GdipReleaseDC implementation. - gdiplus: Made Graphics calls check for busy state. - gdiplus: GdipDeleteGraphics affected by busy state too. Test added. - gdiplus: Basic parameter check in GdipTransformPoints with tests. - gdiplus: Test for default Graphics clipping region. - gdiplus: Implemented GdipIsInfiniteRegion with tests. - gdiplus: GdipPathIterNextPathType stub added with test. - gdiplus: Add gdiplus debug channel to matrix.c. - gdiplus: Fix for GpRegion clone helper. - gdiplus: Implemented GdipGetClip. - gdiplus: Added TRACE/FIXME to all PathIterator calls. - gdiplus: Move some TRACE() higher in region.c. - gdiplus: Implemented GdipIsEmptyRegion with tests. - gdiplus: Implemented GdipSetClipRegion with basic tests. - gdiplus: Added test shows that CombineModeReplace actually replaces data. - gdiplus: Fix for CombineModeReplace with some tests. - gdiplus: Implemented GdipResetClip with tests. - gdiplus: Implemented GdipIsEmptyClip with tests. - gdiplus: Add TRACE(..) to graphicspath.c. - gdiplus: Stub for GdipFlattenPath with tests. - gdiplus: Add some TRACE(..) to Graphics. - gdiplus: Fix API documentation name. - gdiplus: Add TRACE(..) to CustomLineCap. - gdiplus: Add TRACE(..) for brush calls. - gdiplus: GdipGetLineGammaCorrection should check result pointer. Test added. - gdiplus: Add TRACE(..) for font calls. - gdiplus: Add few TRACE(..) for ImageAttributes. - gdiplus: Add few TRACE(..) for Matrix. - gdiplus: Initial GdipFlattenPath implementation. - gdiplus: Fix curve closing in GdipDrawClosedCurve2. - gdiplus: Stubs for AdjustableArrowCap calls. - gdiplus: Implemented GdipGraphicsClear. - gdiplus: Implemented GdipCloneImage. - gdiplus: Fix for GdipGraphicsClear. - -Paul Vriens (39): - advapi32/tests: Remove duplicate test. - advapi32/tests: Fix a crash. - advapi32/tests: SC_MANAGER_ENUMERATE_SERVICE is enough. - advapi32/tests: Don't test unimplemented functions. - kernel32/tests: Fix two failures on win9x. - kernel32/tests: Use a file that is available on all platforms. - kernel32/tests: Use skip instead of trace. - d3dxof/tests: Run tests again on win9x. - shell32/tests: Run tests again on win95. - crypt32/tests: Use CryptAcquireContextA instead of CryptAcquireContextW. - shlwapi/tests: Fix a test on Vista. - comctl32/tests: Don't assert on not implemented function. - mstask/tests: Skip tests for security services if they are not implemented. - advapi32/tests: Remove tests for calculation with drivers. - netapi32/tests: Fix the error text. - msi/tests: Remove service tests. - oleaut32/tests: Skip some tests on win9x. - rpcrt4/tests: Skip ok check for win9x. - quartz/tests: Use CreateFileA instead of CreateFileW to please win9x. - msi/tests: Add a missing CoUninitialize. - include: Add a system restore header. - msi/tests: Create a system restore point when needed. - shell32/tests: Don't test unimplemented functions. - shlwapi/tests: Don't test unimplemented functions. - msxml3/tests: Add a missing CoUninitialize. - msxml3/tests: Add a missing CoUninitialize. - dplayx/tests: Remove a stray CoInitialize. - ddraw/tests: Let tests run again on win9x. - dplayx/tests: Add a few missing HeapFree's. - msxml3/tests: Use CreateFileA to please win98. - msxml3/tests: Fix a test on win98. - ws2_32/tests: Use CreateEventA for win9x. - kernel32/tests: Split the test for ret and last error. - crypt32/tests: Don't crash on Vista. - urlmon/tests: Fix test on win98. - dsound/tests: Fix typos in tests. - quartz/tests: Add a missing CoUninitialize. - wintrust/tests: Add a missing FreeLibrary. - winspool.drv/tests: Fix a test on Vista/W2K8. - -Piotr Caban (1): - msxml3: Added custom queryresult DISPIDs implementation. - -Rico Schüller (1): - wined3d/d3d9: Set the initial scissorrect to the dimesions of the backbuffer from the first swapchain of the device. - -Rob Shearman (4): - widl: Raise RPC_X_SS_IN_NULL_CONTEXT exception for NULL in-only context handles instead of RPC_X_NULL_REF_PTR. - rpcrt4: Add tests for RpcBindingReset. - winealsa.drv: Use CP_UNIXCP instead of CP_ACP for strings obtained from native OS functions. - msxml3: Use CP_UNIXCP instead of CP_ACP in libxmlFatalError as the input string is one generated by a native OS function. - -Roy Shea (3): - mstask: Implemented PersistFile_Save stub. - mstask: Implemented CreateTrigger. - mstask: Implemented (Set|Get)Trigger. - -Shunichi Fuji (1): - gdi32: Adjust FT_MulFix function to Freetype cvs head. - -Stefan Dösinger (50): - wined3d: Override the default filter of conditional np2 textures. - wined3d: Make sure the pixel shader is compiled. - wined3d: Remove a few texture initializations. - wined3d: Get a GL context before creating a PBO. - wined3d: Add fixed function sRGB write correction. - wined3d: Disable D3DFMT_A4L4. - wined3d: Disable D3DFMT_A2W10V10U10. - wined3d: Fix the drawStridedSlow callback function calling convention. - wined3d: Don't retry less strict formats if a match was found. - ddraw: Don't destroy the application's window. - wined3d: Fix the texcoord size mask. - wined3d: Implement D3DTOP_BUMPENVMAPLUMINANCE. - wined3d: Implement D3DTA_ALPHAREPLICATE in arbfp and atifs. - wined3d: Fix projected bump mapping. - wined3d: Use the correct texture limit. - wined3d: Declare the texture factor when D3DTOP_BLENDFACTORALPHA is used. - wined3d: The final luminance factor is clamped. - wined3d: Make the alphaop == colorop matching a bit smarter. - winex11: Add a run-total fps counter to the fps debug channel. - wined3d: Disable D3DFMT_R3G3B2. - wined3d: Advertise a few line caps. - wined3d: D3DTOP_DOTPRODUCT3 colorop overrides the alphaop. - wined3d: Clean up the texbeml parameter forward. - wined3d: Handle texture transforms in the TEXTURETRANSFORMFLAGS state. - wined3d: Update the arbfp shader on a texturetransformflags change. - wined3d: Remove some junk. - wined3d: Remove dead code. - wined3d: Remove unneeded code. - wined3d: Make the texture stage mapping nvrc independent. - wined3d: Replace an #if 0 with if(0). - wined3d: Remove BaseTexture::UnBindTexture. - wined3d: Remove some more junk code. - wined3d: Replace a #if 0 with if(0). - wined3d: Handle projected+bump mapped textures in atifs. - wined3d: Silence some format spam. - wined3d: Handle projected textures properly in arbfp and atifs. - wined3d: Implement YV12 support for emulated overlays. - wined3d: BLENDTEXTUREALPHAPM reads the texture. - wined3d: Report incorrect filtering settings in ValidateDevice. - wined3d: Implement secondary color in the arbfp ffp pipeline. - ddraw: Beware of the surface type when checking for format support. - ddraw: Catch attempts to opengl-render to the desktop window. - ddraw: Pass proper parameters to CheckDeviceFormat. - wined3d: Optimize the projected bump map handling. - ddraw: Add some overlay tests. - wined3d: Compressed surface sizes are multiples of 4. - wined3d: Pack the ffp_desc structure better. - wined3d: Fix the pixelformat selection logic. - wined3d: Close a pshader on-off switching loophole. - wined3d: Fix uploading higher transform matrices. - -Stefan Leichter (1): - rasapi32: Fix tests on platforms winme and some win98. - -Vijay Kiran Kamuju (2): - advapi32: Add stub for ConvertToAutoInheritPrivateObjectSecurity. - d3drm: Include d3drmobj.h in d3drm.h. - -Vincent Povirk (6): - user32/tests: Don't check menu items when testing MNS_CHECKORBMP. - shell32: Move SHAppBarMessage implementation from shell32 to explorer. - shell32: Add tests for SHAppBarMessage. - explorer: Implement ABM_ADD and ABM_REMOVE. - explorer: Track appbar positions and send ABN_POSCHANGED notifications. - explorer: Modify rects passed to SHAppBarMessage to not interfere with existing appbars. - -Vladimir Pankratov (2): - shell32: Update Russian translation. - appwiz.cpl: Add Russian translation. - --- -Alexandre Julliard -julliard@winehq.org +The Wine development release 1.1.5 is now available. + +What's new in this release (see below for details): + - Substantial JavaScript implementation. + - Partial support for layered windows. + - Support for Unicode file export in Regedit. + - Proper exception handling in widl-generated code. + - Asynchronous requests and cookies support in WinHTTP. + - Various bug fixes. + +The source is available from the following locations: + + http://ibiblio.org/pub/linux/system/emulators/wine/wine-1.1.5.tar.bz2 + http://prdownloads.sourceforge.net/wine/wine-1.1.5.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.5: + + 3888 print page range defaults to 1 to 65535 pages on graphical applications + 4581 failure of CreateScalableFontResourceA and Unhandled page fault in MathWorkshop + 4875 Deliplayer doesn't fully open saying it can't open DeliUI + 4987 Close combat 3 crashes with backtrace + 5243 Hyperlobby: runtime error 430 + 5423 AOL AIM won't install: complains about minimum requirements + 6496 Defcon crashes in ws2_32 + 7026 Formula objects in Word 97 always trigger unhandled page fault + 7598 Regedit cannot import/export version 5 registry files + 7600 Regedit Metabug: get regedit working perfectly + 7670 No battle sounds in Guild Wars + 7851 Warrock installer crash + 8674 Safari crashes on startup + 8763 Evernote crashes + 9014 MS Office 2007 Home and Student edition installer crashes + 9364 Call from 0x7b840a80 to unimplemented function gdiplus.dll.GdipSetLinePresetBlend + 9558 FIFA2002 demo crashes, dsound/alsa + 9659 Guild Wars: Rendering of 3D models broken + 9777 Silencer doesn't fully connect to lobby server. + 9838 Input Method's output overruns the buffer of wine keyboard input + 9915 cookies not set within steam + 9961 SEH stack overflow exception in Kuma Games + 9973 Bioshock demo: crashes on loading screen + 10092 Problems with ole on Interfax-Direct + 10117 Mpeg2Schnitt doesn't display video since wine v. 0.9.16 + 10167 sacred: Sacred crashes randomly after several actions in game + 10628 Portal must be launched twice to run properly + 10725 excel page faults and exits + 11194 FileZilla 3.0.5.2 crashes if changing local working directory + 11337 Cannot select a format option for numeric values in Excel 2003 + 11445 Medieval 2: Total War: water covers the land + 11494 Speed Commander 12 does not install + 12049 Regression running "Splinter Cell:Pandora Tomorrow" + 12241 D3D9: Visual test fails + 12314 Photoshop CS2 tab doesn't really really hide windows + 12432 MotoGP 3: Crashes when attempting to configure controllers + 12534 Cepstral voice configuration tools are not displayed in the control panel + 12576 BYOND: Clicking url doesn't launch native browser + 12577 BYOND: Crashing on login + 12647 Cepstral voices garble the first part of the sentence they are reading + 12679 Trackmania nations forever does not install Openal + 12778 Progecad smart! crashes on save/save us + 12830 Xenocode Virtual Appliance Runtime Error + 12843 A-ray crashes on startup + 12879 Cluster size not supported for large NFS mounts? + 12992 Excel 2007 Crashes immediately on start up. + 12998 FtpVC applicaton does not run + 13058 BYOND Suite: Browser windows do not function / crash DreamSeeker. + 13220 warcraft 3 sound stops after a while + 13441 Sopcast generate a crash while using, native wmvcore.dll + 13643 ddraw tests fail on XP SP2 with Radeon Mobility 9000 card + 13723 Sound buffer freed by both winealsa.drv and dsound + 13742 installation of WISO 2007 failed + 13990 Spore Creature Creature: Failed to connect to license server + 14131 No sound in Morrowind using software mixing + 14250 richedit: Deleting text at end of edit control is improperly handled + 14374 Diablo2:LOD Digital Distribution: "Agree" button never enables + 14381 Google Lively installer aborts because of missing directx registry entry + 14403 VFP8-SP1-Runtime crashes on a certain function + 14410 orb installer aborts, unimplemented function gdiplus.dll.GdipGetPropertyItem + 14567 Shell32 IAutoCompleteDropDown needed for VS.NET 2005 and other tools which use MS DevEnv UI engine + 14595 UnrealTournament: General Protection fault! + 14639 ngen.exe from .NET 2.0 show exception E_INVALIDARG when trying to compile an assembly + 14670 Installer doesn't allow for the Accept button to be clicked on the license agreement + 14787 widl fails to honour typedef ptr attributes + 14846 Raising exception for SC_RPC_HANDLE being NULL + 14959 No ingame sound in Diablo 2 anymore since update + 14994 Haskell's removeDirectoryRecursive fails on Wine + 15033 intermittant crashes while playing bf1942 + 15093 Rome Total War: water is not rendered on the campaign map + 15107 Google Chrome fails to load web pages. + 15119 Google Chrome on Wine 1.1.3 does not load pages over HTTPS + 15125 Flashplayer crashes when used with an IMC + 15130 Wine notepad: Extension behaviour differ from Windows + 15141 In Google Chrome, embedded flash window does not scroll with main window + 15179 Parallel install in multiple jobs as in "make -j99 install" fails + 15197 Several fonts don't appear in Adobe Photoshop CS + 15201 Google Chrome crashes when downloading an exe file + 15209 winedbg has an infinite loop at wine/programs/winedbg/memory.c:426 + 15227 orb installer crashes when showing eula + 15252 moving/resizing undecorated windows broken in dual-screen setups + 15260 objects in spore leave trails + 15266 jscript: engine.c - unitialized variable + +---------------------------------------------------------------- + +Changes since 1.1.4: + +Alexander Dorofeyev (1): + quartz/tests: Fix potential NULL dereference (Coverity). + +Alexander Nicolaysen Sørnes (5): + notepad: Only append .txt to missing files without a dot in them. + regedit: Convert parts of export handling to unicode. + regedit: Fix importing REG_MULTI_SZ values for ANSI files. + regedit: Gather a full string before exporting it. + regedit: Add support for exporting unicode files. + +Alexandre Julliard (56): + makefile: Fix dependency for programs install. + winex11: Moved the X11DRV_WindowMessage function to window.c. + winex11: Support setting the window region on windows belonging to other threads. + user32: Fix DeferWindowPos to work on windows belonging to other processes. + configure: Fixed the check for sigset_t on mingw. + mstask/tests: Use case-insensitive compare for file names. + kernel32: Added implementation for UnregisterWaitEx. + jscript: Add necessary dependencies for the bison file. + kernel32/tests: Fix the async I/O test to handle errors properly. + kernel32/tests: Fix the BindIoCompletionCallback test on Vista. + kernel32/tests: Fix the ResumeThread on win9x. + ntdll/tests: Fix the async I/O test on Vista. + rpcrt4/tests: Fix a couple of test failures on Windows. + winex11: Remove debug hack that slipped into commit a4a5a2ec121eeb2a7cd4ffbb5ba7b298f2a050b1. + winex11: Fixed mapping of the move/resize starting point to X11 root coordinates. + user32: Notify the user driver about window extended style changes too. + server: Implemented the server side of Get/SetLayeredWindowAttributes. + user32/tests: Added some tests for Get/SetLayeredWindowAttributes. + user32: Add a SetLayeredWindowAttributes driver entry point. + winex11: Driver-side implementation of SetLayeredWindowAttributes. + inetcomm: Avoid a compiler warning. + user32/tests: Ignore some more messages. + user32/tests: Fix a test that fails on all Windows versions. + include: Added definition for RPC_BAD_STUB_DATA_EXCEPTION_FILTER. + widl: Create an explicit structure for the function frame of all generated functions. + widl: Make the exception handling macros more general and use the same code everywhere. + widl: Infrastructure for adding a prefix to local variable references. + widl: Separate declaration and initialisation for indirect arguments. + widl: Implemented __finally support in stub functions. + widl: Implemented __finally support in server functions. + widl: Implemented __finally support in client functions. + widl: Implemented RpcAbnormalTermination in the generic exception handling code. + widl: Remove unnecessary casts in the generated code. + ntdll: Hardcode the filesystem cluster size to avoid trouble on NFS. + user32/tests: Fix a number of message test failures on various Windows versions. + user32: Don't reinitialize the window placement even if the window rect is empty. + user32: Implemented UpdateLayeredWindow and UpdateLayeredWindowIndirect. + ntdll/tests: Clear the direction flag in the handler since Windows may not do it. + kernel32/tests: Fix a test on win9x. + kernel32/tests: Support alternate results in the loader test on Vista. + kernel32/tests: Comment out an UpdateResource call that causes failures. + user32/tests: Fix some test failures on XP. + mstask/tests: Fix test failures on XP. + shlwapi/tests: SHLWAPI.23 apparently returns an HRESULT on Vista. + user32/tests: Cope with last error behavior on Vista. + user32/tests: Fix some test failures on win9x. + kernel32/tests: Handle the win2k3 version check behavior. + winex11: Force the X11 size of zero-sized window to always be 1x1. + winex11: Don't try to retrieve the X11 size on ShowWindow for zero-sized windows. + winex11: Ignore the initial WM_STATE transition out of withdrawn state. + winex11: Compare the window position against the cached position in ConfigureNotify. + user32/tests: Fix a few more message test failures. + gdi32/tests: Skip test that depends on Tahoma if it isn't installed. + kernel32/tests: Fix race condition in the thread test. + kernel32/tests: Fix a couple of tests failing on NT4. + ntdll/tests: Fix a couple of tests failing on NT4. + +Alistair Leslie-Hughes (25): + mshtml: Implement IHTMLBodyElement get/put bgColor. + mshtml: Add IHTMLBodyElement bgColor tests. + mshtml: Implement IDispatch for IHTMLDocument3. + mshtml: Implement IDispatch for IHTMLDocument4. + mshtml: Implement IDispatch for IHTMLDOMTextNode. + mshtml: Implement IDispatch for IHTMLImgElement. + mshtml: Implement IDispatch for IHTMLTextContainer. + mshtml: Implement IDispatch for IHTMLScriptElement. + mshtml: Implement IDispatch for IHTMLGenericElement. + mshtml: Implement IDispatch for IHTMLOptionElement. + mshtml: Implement IDispatch for IHTMLTextAreaElement. + mshtml: Implement IDispatch for IHTMLInputElement. + mshtml: Implement IDispatch for IHTMLDocument5. + mshtml: Implement IDispatch for IHTMLTable. + mshtml: Implement HTMLElement2 get_scrollLeft. + mshtml: Implement IHTMLTextContainer get_scrollLeft. + mshtml: Add tests for get_scrollLeft. + hlink: Mark Get/Set AdditionalParams as Unimplemented. + mshtml: Implement get/put margin. + mshtml: Add IHTMLStyle margin tests. + msxml3: Add IXMLDOMCharacterData to IXMLDOMCDATASection. + msxml3: Add IXMLDOMCharacterData to IXMLDOMComment. + msxml3: Correct test. + msxml3: Correct IDispatchEx Invoke to return the correct object. + mshtml: Implement IHTMLBody get/put_Text. + +Allan Tong (1): + wined3d: Fix Geforce9 detection. + +Andrew Talbot (5): + qcap: Sign-compare warning fix. + qmgr: Sign-compare warnings fix. + shdocvw: Sign-compare warnings fix. + msi: Uninitialized variable fix (Coverity). + comctl32: Sign-compare warnings fix. + +Aric Stewart (6): + mlang: Expand stub of fnIMLangFontLink2_GetStrCodePages. + imm32: Implement helper functions for copying CompositionString data out of the IME. Standardize ImmGetCompositionStringA/W to use a common T function. + imm32: Correct CopyCompAttrIMEtoClient to handle A->W and W->A conversions. + imm32: Update CopyCompClauseIMEtoClient to handle A->W and W->A conversions. + imm32: Update CopyCompOffsetIMEtoClient to handle A->W and W->A conversions. + imm32: Include a basic ImmGetCompositionString test checking ATTR lengths. + +Austin English (1): + widl: Remove unreached code (Smatch). + +Christian Costa (3): + d3dxof: Simplify parsing. + d3dxof: Implement object parsing in text mode. + d3dxof: Fix IDirectXFileDataImpl_GetType. + +Damjan Jovanovic (1): + ws2_32: Only enable FD_WRITE on short sends. + +David Adam (1): + appwiz: Fix some typos in the French resource. + +Detlef Riekenberg (8): + include: Update RASCONN and error codes. + rasapi32/tests: Trace the correct variable. + oleaut32: Dump parameter and SYSKIND for LHashValOfNameSysA. + shlwapi: Add a stub for SHSetDefaultDialogFont. + advapi32: Remove outdated comment. + localspl: Implement AddMonitor. + winspool: Use the backend for AddMonitor. + dlls: Do not use __WINE_ALLOC_SIZE between void and *. + +Dmitry Timoshkov (11): + gdi32: Don't use pOS2->usWeightClass, some fonts don't set it correctly. + winex11.drv: Fix the scan codes keypad keys section to match the vkeys one. + kernel32: Use a kernel error code. + winedevice: Wine PE loader is able to resolve forwards to not yet loaded modules. + user32: Make GetMonitorInfoW print the monitor properties. + user32: Implement SystemParametersInfo(SPI_GETWORKAREA) properly. + user32: Fix the work area test to pass on Windows when the taskbar is on top. + winhttp: Add some tests for set/query option, make them pass under Wine. + jscript: Fix the uninitialized variable warning. + kernel32: Fix the target buffer size. + winhttp: Move common code to the upper level, avoid accessing the buffer before the buffer size check, make the code conform to existing rules. + +Dylan Smith (10): + richedit: Avoid acting on control words in skipped RTF groups. + richedit: Don't put cursor in the table row start paragraph. + richedit: Enter at the end of a table row appends a new row. + richedit: Enter inserts newline before table at start of document. + richedit: Make sure the nested tables' RTF properties are not skipped. + richedit: Fixed bugs in handling unterminated nested tables in RTF. + richedit: Prevent buffer overrun for tab stops buffer. + richedit: Handle deletion at the end of text properly. + richedit: Avoid unconditionally rewrapping text on scroll. + richedit: Removed a redundant condition. + +Eric Pouech (6): + dbghelp: Fixed offset computation for bitfields inside structures in Codeview debug information. + dbghelp: Correctly setup the Unix regular expression for matching file names in SymEnumLines. + winedbg: Also handle 1 byte signed int as they were char (PDB files are done like this... sigh). + dbghelp: Use the correct size for global variable when searching for a symbol. + dbghelp: Silence 0x112c symbol type. + dbghelp: While loading MSC debug info, don't handle public symbol at once, but delay their handling after all other symbols are loaded. + +Erik Inge Bolsø (2): + winealsa.drv: fix typo in IDsCaptureDriverImpl_Open. + wineesd.drv: Allow all errors to interrupt recording. + +Florian Köberle (1): + winedbg: Fixed an infinite loop. + +Francois Gouget (7): + ddraw/tests: Fix compilation on systems that don't support nameless unions. + jscript: Fix compilation with older bison. + crypt32/tests: Win98 is missing Crypt{Encode,Decode}ObjectEx(). + ws2_32/tests: Fix a race in sock.c:test_write_events(). + mshtml/tests: Add a trailing '\n' to an ok() call. + d3dx9_36: Fix compilation on systems that don't support nameless unions. + gdiplus: Add some documentation stubs to make winapicheck happy. + +Gerald Pfeifer (2): + wordpad: Shed off unused parameters from on_fontlist_modified, OnCreate, OnUser, OnNotify, and OnInitPopupMenu. + comctl32: Remove unused paramters from MONTHCAL_GetRange, MONTHCAL_MouseMove, and MONTHCAL_Create. + +Hans Leidekker (22): + winhttp: Start sending async completion notifications. Add corresponding tests. + winhttp: Implement WINHTTP_OPTION_SERVER_CERT_CONTEXT. + winhttp: The last parameter of WinHttpWriteData is optional. + winhttp: Use a process global SSL context instead of per connection. + winhttp: Add the remaining completion notifications. + winhttp: Support asynchronous requests. + winhttp: Option WINHTTP_OPTION_SERVER_CERT_CONTEXT must return a pointer. + winhttp: WinHttpQueryDataAvailable should do a blocking read if more data is expected. + winhttp: Make sure not to read more data than expected on a redirect. + winhttp: Don't loop on response codes other than 301 and 302. + winhttp: Increase sleep between two tests that connect to the same host. + winhttp: Better diagnostics in the notification test. + cryptui: Add a stub implementation of CryptUIDlgViewCertificateW. + winhttp: Handle relative redirects. + winhttp: Redirects are always GET requests. + winhttp: Preserve cookies on redirects. + winhttp: Strip content-type/length headers from request on a redirect. + winhttp: Reset content length when all data has been read. + winhttp: Move handling of default request parameters back to WinHttpOpenRequest. + winhttp: Manage a session global cookie cache. + winhttp: Fix logic inversion bug in setting disable flags. + winhttp: Close the network connection if necessary. + +Henri Verbeet (28): + sspi: SECBUFFER_HEADER should be called SECBUFFER_STREAM_HEADER. + wined3d: Translate one pixel down after flipping for offscreen rendering. + wined3d: Fix the half pixel offset. + wined3d: Correct a comment. + d3d9: GetDepthStencilSurface returns D3DERR_NOTFOUND when no depth stencil is present. + d3d8: GetDepthStencilSurface returns D3DERR_NOTFOUND when no depth stencil is present. + d3d8: Fix IDirect3DDevice8::SetRenderTarget(). + wined3d: Reset the auto depth stencil. + d3d9: Only run the reset test once. + d3d9: Add a test for auto depth stencil reset. + d3d8: Add a test for auto depth stencil reset. + wined3d: Make some GLSL structs and functions private to the backend. + Make some ARB program structs and functions private to the backend. + wined3d: Improve a TRACE. + wined3d: IWineD3DCubeTextureImpl implements IID_IWineD3DCubeTexture, not IID_IWineD3DTexture. + wined3d: Use the internal format for renderbuffer storage. + wined3d: Clarify a comment. + wined3d: Remove some assumptions that PreLoad() will always bind the texture. + wined3d: Don't assume the texture is bound in IWineD3DVolumeImpl_LoadTexture(). + wined3d: Don't needlessly bind the texture in PreLoad(). + wined3d: Make the debug channels more consistent. + wined3d: Add a checkGLcall() at the end of loadTexCoords(). + wined3d: Move FBO handling functions to context.c. + wined3d: Split off a function for applying an attachment's filter states. + wined3d: Handle drawbuffers in context_apply_fbo_state() instead of context_set_render_target_fbo(). + wined3d: Get rid of context_set_render_target_fbo(). + wined3d: Get rid of context_set_depth_stencil_fbo(). + wined3d: Create a FBO for each combination of render targets and depth stencil. + +Hirofumi Katayama (1): + notepad: Cancel closing window by cancelling "Save As" dialog box. + +Huw Davies (28): + winex11.drv: Fix SetDIBits optimization to work with top-down dib sections. + include: Add some more mimeole errors. + inetcomm: Add a stub MimeInternational object. + inetcomm/tests: Start of IMimeInternational tests. + mlang: Forward IMultiLanguage_GetCharsetInfo to IMultiLanguage3_GetCharsetInfo. + inetcomm: Implement IMimeInternational_FindCharset. + inetcomm/tests: Tests for IMimeInternational_FindCharset. + inetcomm: Implement IMimeInternational_GetCharsetInfo. + inetcomm/tests: Add tests for IMimeInternational_GetCharsetInfo. + inetcomm: Implement IMimeInternational_GetCodePageCharset. + inetcomm/tests: Add tests for IMimeInternational_GetCodePageCharset. + inetcomm: Implement IMimeInternational_GetDefaultCharset. + inetcomm/tests: Add test for IMimeInternational_GetDefaultCharset. + inetcomm: Implement IMimeInternational_SetDefaultCharset. + inetcomm/tests: Add a test for IMimeInternational_SetDefaultCharset. + inetcomm: Add a missing function and fix some idl. + inetcomm: Implement IMimeInternational_CanConvertCodePages. + inetcomm: Fix some more idl. + inetcomm: Implement IMimeInternational_ConvertBuffer. + inetcomm/tests: Tests for IMimeInternational_ConvertBuffer. + oleaut32: Add support for VT_INT and VT_UINT constants. + oleaut32: Use V_INT instead of V_UNION. + inetcomm: Implement IMimeInternational_ConvertString. + inetcomm/tests: Add tests for IMimeInternational_ConvertString. + inetcomm: Implement MimeOleGetCharsetInfo. + include: Fill in IMimeEnumProperties. + inetcomm: Make variable static to fix crash on process detach. + gdi32: Factor out the name table lookup into a separate function. + +Ismael Barros (1): + dplayx: Fix static overrun of pDP array in test (Coverity). + +Jacek Caban (123): + jscript: Store more data in DispatchEx object. + jscript: Added GetDispID implementation. + jscript: Added InvokeEx implementation. + jscript: Added GetNextDispID implementation. + jscript: Added DeleteMemberByName implementation. + jscript: Added GetMemberName implementation. + jscript: Added expression statement implementation. + jscript: Added identifier expression implementation. + jscript: Added AddNamedItem implementation. + jscript: Added global object implementation. + jscript: Added assign expression implementation. + jscript: Added literal expression implementation. + jscript: Added assignment test. + jscript: Added scope chain implementation. + jscript: Added variable object handling. + jscript: Added call expression implementation. + jscript: Added infrastructure for test scripts. + jscript: Added logical negation implementation. + jscript: Added var statement implementation. + jscript: Added '===' expression implementation. + jscript: Added '!==' expression implementation. + jscript: Added function object stub implementation. + jscript: Added member expression implementation. + jscript: Added Function.length implementation. + jscript: Add static functions to variable objects. + jscript: Added Object constructor object implementation. + jscript: Added String constructor object. + jscript: Added Array constructor object implementation. + jscript: Added Boolean constructor object. + jscript: Added Number constructor object implementation. + jscript: Added RegExp constructor object implementation. + jscript: Added Math object stub implementation. + jscript: Added typeof expression implementation. + jscript: Added this expression implementation. + jscript: Added return statement implementation. + jscript: Added Function.[[call]] implementation. + jscript: Set parameters on function call. + jscript: Set arguments object on function call. + jscript: Added array expression implementation. + jscript: Added 'new' expression implementation. + jscript: Added Object constructor implementation. + jscript: Added constructor invokation from Function object support. + jscript: Added function expression implementation. + jscript: Added initial prototype of functions. + jscript: Release named items in IActiveScript::Close. + jscript: Added IActiveScriptParseProcedure2::ParseProcedureText implementation. + jscript: Added if statement implementation. + jscript: Added object initialiser expression implementation. + jscript: Added block statement implementation. + jscript: Added conditional expression implementation. + jscript: Added script types tests. + jscript: Added add expression implementation. + jscript: Added '+=' expression implementation. + jscript: Added '||' expression implementation. + jscript: Added '&&' expression implementation. + jscript: Added '<' expression implementation. + jscript: Added '<=' implementation. + jscript: Added '>' expression implementation. + jscript: Added '>=' expression implementation. + jscript: Added prefix increment expression. + jscript: Added prefix decrement expression implementation. + jscript: Added postfix increment expression implementation. + jscript: Added postfix decrement expression implementation. + mshtml: Added body dispatch id test. + jscript: Added missing RegExp properties. + jscript: Added Array constructor implementation. + jscript: Added Array.length implementation. + jscript: Added ArrayInstance::on_put implementation. + jscript: Added parser support for regular expressions. + jscript: Reuse temporary heap. + jscript: Added regular expression compiler based on Mozilla regexp implementation. + jscript: Added string to object conversion implementation. + jscript: Added String.match implementation. + jscript: Added RegExp tests. + jscript: Added try statement implementation. + jscript: Added throw statement implementation. + jscript: Added to_object(VT_BOOL) implementation. + jscript: Added to_object(number) implementation. + jscript: Added '-' expression implementation. + jscript: Added '-=' expression implementation. + jscript: Added '*' expression implementation. + jscript: Added '*=' expression implementation. + jscript: Added '/' expression implementation. + jscript: Added '/=' expression implementation. + jscript: Added minus expression implementation. + jscript: Fixed allocation of script buffer. + mshtml: Fixed tests on IE7. + jscript: Added '==' expression implementation. + jscript: Added '!=' expression implementation. + jscript: Added 'new' expression implementation. + jscript: Added switch statement implementation. + jscript: Added break statement implementation. + jscript: Added '|' expression implementation. + jscript: Added '|=' expression implementation. + jscript: Added '&' expression implementation. + jscript: Added '&=' expression implementation. + jscript: Added '^' expression implementation. + jscript: Added '^=' expression implementation. + jscript: Added ',' expression implementation. + jscript: Added '~' expression implementation. + jscript: Added plus expression implementation. + jscript: Added bool and null to number conversion implementation. + jscript: Added eval implementation. + jscript: Added array literal implementation. + jscript: Added to_string(VT_I4) implementation. + jscript: Added String.length implementation. + jscript: Added while and do..while statement implementation. + jscript: Added continue statement implementation. + jscript: Added for statement implementation. + jscript: Added void expression implementation. + jscript: Added String.charAt implementation. + jscript: Added for..in statement implementation. + jscript: Added delete expression implementation. + jscript: Added with statement implementation. + jscript: Added '<<' expression implementation. + jscript: Added '>>' expression implementation. + jscript: Added '>>>' expression implementation. + jscript: Added '<<=' expression implementation. + jscript: Added '>>=' expression implementation. + jscript: Added '>>>=' expression implementation. + jscript: Minor fixes. + jscript: Added more to_string implementation. + jscript: Added function constructor object. + +James Hawkins (32): + advapi32: ERROR_IO_PENDING is returned in Vista only on success. + crypt32: Trace the returned value on failure. + msi: Actions should be run even if the installed state is the same as the requested state. + msi: Make sure read-only source files are set writable after being copied. + riched20: Fix several failing test across several platforms. + comctl32: Fix two failing tests in win98. + comctl32: Fix several failing tests in win98. + comctl32: Allow a little slop in the status bar metric tests. + comctl32: Fix a couple failing tests in win98. + comctl32: Fix a failing test in win98. + comctl32: Fix several test failures in win98. + comctl32: Fix a typo. + comctl32: Fix a failing test for some platforms. + comctl32: Trace the first day of the week. + comctl32: Fix two test failures in win2000. + riched20: Fix two typos that cause a failing test. + msi: Fix a few file access discrepancies between platforms. + urlmon: Fix a failing test with IE7. + urlmon: Fix several failing tests with IE7. + ole32: Fix a few file access discrepancies between platforms. + comctl32: Store the previous timeout value to test with. + secur32: Fix two failing tests in win2k. + shell32: Fix two failing tests in win2k. + mstask: Fix a few failing tests in win2k. + crypt32: Fix a failing test in win9x. + crypt32: Fix a failing test in Vista. + crypt32: Fix a failing test in Vista. + setupapi: Fix a failing test in Vista. + setupapi: Remove a test of an undocumented function that is inconsistent across platforms. + shell32: Remove calls to unicode functions that aren't implemented in win9x. + comctl32: Fix several failing tests in win95. + comctl32: Fix the remaining broken tests in win95. + +Jan de Mooij (1): + comctl32/treeview: Fix pszText NULL pointer dereference. + +Jeff Zaroyko (5): + wined3d: Add missing HeapFree. + ws2_32: ioctlsocket should try to check if argp is valid. + dsound: Fix a few failing tests and a crash on 2008 (revised). + kernel32: Modify DeleteFileW to fail on directories. + dsound: Fix a failing test on XP. + +John Klehm (4): + wintab32: Support overlap statuses in WTOverlap. + wintab32: Support overlap statuses in WTOpen. + wintab32: Support overlap statuses in WTEnable. + gdiplus: Stub implementation of GdipGetImageDecoders and GdipGetImageDecodersSize. + +Juan Lang (31): + crypt32: Check length of sequence before checking tag. + crypt32: Don't store redundant copy of detached hash message data. + crypt32: Add stub for CryptVerifyMessageHash. + crypt32: Add tests for CryptVerifyMessageHash. + crypt32: Implement CryptVerifyMessageHash. + crypt32: Don't crash when asked to verify a signature before the content has been finalized. + crypt32: Test verifying the signature of a detached signed message. + crypt32: Add stub for CryptVerifyDetachedMessageSignature. + crypt32: Add tests for CryptVerifyDetachedMessageSignature. + crypt32: Implement CryptVerifyDetachedMessageSignature. + crypt32: Simplify CryptVerifyMessageSignature. + cabinet: Use helper function to remove duplicate code. + cabinet: Use helper function to remove duplicate code. + crypt32: Assert condition that can occur only in case of a bug. + crypt32: Fix typo. Fixes Coverity item 605. + crypt32: Return FALSE rather than crash if memory allocation fails. Fixes Coverity id 135. + crypt32: Get rid of a magic number and a redundant assignment. + winhttp: Don't reference past the attribute array. Fixes Coverity item 710. + crypt32: Don't set salt's cbData unless allocation succeeds. Fixes Coverity id 133. + user32: Return error if memory allocation fails. Fixes Coverity id 115. + riched20: Use helper function rather than goto to return found position. + devenum: Fix order of operations bug (Coverity id 709). + user32: Don't crash if passed a non-scrollbar HWND. Fixes Coverity id 265. + winex11: Make button_state as large as the maximum number of cursors. Fixes Coverity id 728. + wintrust: Add a few missing defines. + wintrust: Don't assume dwStateAction is set in WINTRUST_DATA. + crypt32: Add support for the CERT_EXTENDED_ERROR_INFO_PROP_ID. + wintrust: Add traces to a few more functions. + include: Fix typo. + include: Add missing defines. + tools/wine.inf: Register cryptdlg. + +Kai Blin (7): + ws2_32: Fix the SO_REUSEADDR tests to work on Win2k3 and newer. + dplayx: Fix static overrun of pDP array in test. (Coverity). + dplayx: Fix possible NULL pointer dereference (Coverity). + dplayx: Fix possible NULL pointer deference in error path (Coverity). + dpnet: Fix initialisation of This pointer (Coverity). + ws2_32: Win NT4 does not zero the sockaddr_in structure on getsockname. + ws2_32: Win98 closesocket() does not wake up select. + +Lei Zhang (4): + sane.ds: Replace wsprintfW with sprintfW. + comctl32: listview: Prevent DragDetect from removing WM_LBUTTONUP messages. + comctl32: Handle listview dragging better. + qcap: Make sure input to AMStreamConfig_SetFormat is not NULL. + +Luis C. Busquets Pérez (2): + d3dx9: Implement D3DXMatrixDecompose. + d3dx9: Add tests for D3DXMatrixDecompose. + +Marcus Meissner (10): + include: Mark up with alloc_size attribute. + shell32: Fixed size passed to MultiByteToWideChar. + winecfg: Fixed buffersize to GetPrivateProfileStringW. + include: Allocation size markup. + dnsapi: Fixed incorrect buffer size to GetComputerNameExW. + secur32: Fixed size passed to GetComputerNameExW. + msi/tests: Reduce buffer to size of string written. + kernel32/tests: Pass correct size to MultiBytetoWideChar. + oleview: Fixed LoadString buffer sizes. + winefile: Fixed sizes to LoadString. + +Michael Karcher (2): + ole32/compobj: Fix function name in comment. + kernel32: Clean up PROFILE_isspaceW. + +Michael Stefaniuc (6): + user32/tests: Remove unreachable break after return (Smatch). + shell32: Fix the Ca, Hu, Ro, Sk, Sv and Wa translations by removing an untranslated string. + wordpad: Fix the Hungarian translation by removing an untranslated and incomplete STRINGTABLE. + wordpad: Change the encoding of the German resource file to utf-8. + worpad: Fix the German translation. + regedit: Fix the Bg, Cs, Da, Es, Hu, It, Ko, Pl, Pt, Ru, Si and Tr translations. + +Mikołaj Zalewski (10): + appwiz.cpl: French should use SUBLANG_NEUTRAL. + oleaut32: Make _argsize and _xsize receive the full TYPEDESC and parent ITypeInfo, use a different function in IDispatch code. + oleaut32: Add some missing simple types to _argsize and _xsize. + oleaut32: VT_USERDEFINED records are passed by value. + include: Add IAutoCompleteDropDown declaration. + shell32: autocomplete: Add stub IAutoCompleteDropDown interface. + shell32: autocomplete: Fix a logical AND to a bitwise AND. + shell32: autocomplete: Make SetOptions handle setting the ACO_AUTOSUGGEST after Init, fix ACO_AUTOSUGGEST|ACO_AUTOAPPEND case. + shell32: autocomplete: Implement GetDropDownStatus. + shell32: autocomplete: Remove some obsolete FIXMEs, update some comments. + +Muneyuki Noguchi (9): + notepad: Update Japanese translation. + appwiz.cpl: Add Japanese resources. + wininet: Update Japanese translation. + view: Add Japanese resources. + cmdlgtst: Add Japanese resources. + comdlg32: Update Japanese translation. + winex11: Fix a buffer overflow bug in X11DRV_KeyEvent() and X11DRV_ToUnicodeEx(). + winex11.drv: Make X11DRV_XIMLookupChars handle a long string properly. + oleview: Add Japanese resources. + +Nicolas Le Cam (2): + comctl32: Fix a failing test for some platforms. + comctl32/tests: Fix a failing test for some platforms. + +Nikolay Sivov (4): + gdiplus: Partially implemented GdipTestControl. + gdiplus: Some defines for Image metadata API. + gdiplus: Added missed stubs for Image metadata access. + gdiplus: Some TRACE(..) for Image calls. + +Owen Rudge (1): + shell32: Check CPL_NEWINQUIRE message in control panel applets if we can't retrieve valid strings/icon. + +Paul Chitescu (2): + user32: Stub for LockWorkStation. + explorer: WM_SYSCOMMAND SC_SCREENSAVE to desktop triggers screen saver. + +Paul Vriens (22): + kernel32/tests: Fix a few tests on win9x. + kernel32/tests: Fix 2 tests on win9x. + urlmon/tests: Fix timeouts for win9x tests. + kernel32/tests: Fix a few failures on win98. + user32/tests: Win9x needs a threadid for CreateThread. + crypt32/tests: Fix a test on Vista. + winmm/tests: Fix a test on win9x. + quartz/tests: Fix the tests on several platforms. + ws2_32/tests: Remove redundant NULL check before HeapFree. + msi/tests: Create only one log file and delete it afterwards. + rpcrt4/tests: Fix some failures on XP-SP3. + gdi32/tests: Prevent a crash on win95. + gdi32/tests: Skip some failing tests on NT4. + setupapi/tests: Fix two failures on win98. + jscript/tests: Fix crash and failures on win9x. + setupapi/tests: Fix a failure on Windows 2000. + kernel32/tests: Skip tests on Win95. + oleaut32/tests: Don't crash on Win95. + msi/tests: Prevent a crash on NT4. + crypt32/tests: Don't crash on NT4. + crypt32/tests: Don't crash on win9x. + crypt32/tests: Add a missing CryptMsgUpdate. + +Peter Dons Tychsen (3): + ntoskrnl: Implement partial stub for IoGetConfigurationInformation(). + services: Fixed problem with services where DependOnServices key is REG_SZ and not REG_MULTI_SZ. + winedevice: Fix problems with driver entries without the "ImagePath" entry in registry. + +Piotr Caban (1): + msxml3: Change SAX IStream parser implementation. + +Reece Dunn (7): + shdocvw: Fixed building on msvc. + richedit20: Fixed building the tests on msvc. + browseui: Fixed building the tests with the Windows SDK. + secur32: Fixed the schannel tests on Vista. + secur32: Fixed the logic on some of the schannel tests. + hlink: Fix the tests for IE7. + shlwapi: Fixed the url tests on Vista. + +Rob Shearman (43): + wine_common_ver.rc: Allow the file version number and string to be automatically constructed from major, minor, build and platform ID numbers. + shell32: Remove defines for WINE_FILEVERSION and WINE_FILEVERSION_STR. + rpcrt4: Only start the RpcSs process for handles to the local server. + rpcrt4: Fix typo in unescape_string_binding_componentW. + rpcrt4: Change type of len parameter of NdrAllocate from size_t to SIZE_T. + include: Define sigset_t in pthread.h if HAVE_SIGSET_T isn't defined. + include: Remove incorrect [optional] attributes from parameters in ddstream.idl. + include: Uncomment declaration of IDirectShowStream in amstream.idl. + include: Fix level of indirection of parameters in GetNotifyCmdLine function of IBackgroundCopyJob2 interface in bits1_5.idl. + include: Fix signature of NearestPoint function of IInkDisp interface in msinkaut.idl. + include: The INewShortcutHookA, INewShortcutHookW and IRunnableTask interface in shobjidl.idl should be local. + include: Add XMLDOMDocumentEvents dispinterface to xmldom.idl. + include: Use placeholder structures with at least one field in vmr9.idl. + include: Fix function names in IVBSAXXMLReader interface in msxml2.idl. + widl: Fix the writing typedefs to dispinterfaces and pointers to interfaces. + msi: Reduce destination file name used in the MoveFiles action to the long file name. + winhttp: Add version resource. + widl: Remove redundant code. + rpcrt4: Free the memory for a registered interface that is in use and when WaitForCallsToComplete is 0. + rpcrt4: Print error messages from RPC message functions when they are called in an invalid way. + rpcrt4: Don't crash in NdrDllGetClassObject when a NULL pclsid is passed in. + rpcrt4: Fix memory leaks of hdr in error paths in RPCRT4_io_thread. + rpcrt4: Fix memory leak of 0-byte buffer allocated during processing of bind packets. + avifil32: Add explicit "!= S_OK" to expressions that use HRESULTs as booleans. + oleaut32: Add explicit "!= S_OK" to expressions that use HRESULTs as booleans. + urlmon: Add explicit "!= S_OK" to expressions that use HRESULTs as booleans. + usp10: Add explicit "!= S_OK" to expressions that use HRESULTs as booleans. + winedos: Fix the type of res in VGA_DoSetMode. + dsound: Add explicit "!= S_OK" to expressions that use HRESULTs as booleans. + wintrust: Add explicit "!= NO_ERROR" to expressions that use variables containing error codes as booleans. + advpack: Add explicit "!= S_OK" to expressions that use HRESULTs as booleans. + d3d9: Fix type used to store return value in IDirect3DDevice9Impl_GetNPatchMode. + ole32: Update comments in compobj.c. + kernel32: Fix character count passed to GlobalGetAtomNameW in test_get_atom_name. + msvcrt: Fix character count passed into fgetws in test_fileops. + cryptnet: Define CERT_REVOCATION_PARA_HAS_EXTRA_FIELDS before including any PSDK headers. + include: Make dmusici.h compile when it is included after winspool.h. + include: Make exdisp.h compile when included after commdlg.h. + include: Add DUMMYUNIONNAME to the anonymous union in the uSTGMEDIUM structure in objidl.idl. + include: Add DUMMYUNIONNAME to unions in the _wireVARIANT, TYPEDESC and VARDESC structures in oaidl.idl. + oleaut32: Fix a typo in VarTokenizeFormatString. + include: Add explicit DUMMYUNIONNAME and DUMMYSTRUCTNAME names to anonymous unions in IDL files. + widl: Don't automatically add DUMMYUNIONNAME and DUMMYSTRUCTNAME names to anonymous unions and structs. + +Roderick Colenbrander (1): + wined3d: Degrade an ERR to a TRACE. + +Roy Shea (2): + shell32: Use default system icons if PrivateExtractIconsW in SHGetFileInfoW fails. + kernel32/test: Test import entries of a core windows DLL. + +Stefan Dösinger (3): + wined3d: Don't disable arbfp if the pipeline replacement is in. + wined3d: Some ARB code fixes. + wined3d: Add a test for zenable=false, zwriteenable=false. + +Steven Edwards (1): + widl: Open files in binary mode to avoid corruption from text mode on Windows. + +Tobias Jakobi (2): + wined3d: Fix SHOW_FRAME_MAKEUP debug dump code. + wined3d: Fix long int warnings. + +Vincent Povirk (1): + user32: Use the correct bitmap location for MNS_CHECKORBMP. + +Vitaliy Margolen (4): + kernel32: Use FileStandardInformation to get file size. + dinput: Replace strdup with HeapAlloc. + dinput: Implement DIPROP_KEYNAME property for keyboard device. + kernel32: Use NULL attributes if name and SA are not not specified. + +Vitaly Lipatov (1): + wineboot: Do registry update with wineboot --update in any case. + +-- +Alexandre Julliard +julliard@winehq.org diff --git a/VERSION b/VERSION index cd289fc7fdb..41c2c19075c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Wine version 1.1.4 +Wine version 1.1.5 diff --git a/configure b/configure index 2b60181c21d..a19cea165b4 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.4. +# Generated by GNU Autoconf 2.61 for Wine 1.1.5. # # 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.4' -PACKAGE_STRING='Wine 1.1.4' +PACKAGE_VERSION='1.1.5' +PACKAGE_STRING='Wine 1.1.5' PACKAGE_BUGREPORT='wine-devel@winehq.org' ac_unique_file="server/atom.c" @@ -1305,7 +1305,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures Wine 1.1.4 to adapt to many kinds of systems. +\`configure' configures Wine 1.1.5 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1374,7 +1374,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of Wine 1.1.4:";; + short | recursive ) echo "Configuration of Wine 1.1.5:";; esac cat <<\_ACEOF @@ -1504,7 +1504,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -Wine configure 1.1.4 +Wine configure 1.1.5 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1518,7 +1518,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.4, which was +It was created by Wine $as_me 1.1.5, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -26089,7 +26089,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.4, which was +This file was extended by Wine $as_me 1.1.5, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -26142,7 +26142,7 @@ Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -Wine config.status 1.1.4 +Wine config.status 1.1.5 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" diff --git a/dlls/advapi32/registry.c b/dlls/advapi32/registry.c index 4c97ed1338c..ff574b28ffd 100644 --- a/dlls/advapi32/registry.c +++ b/dlls/advapi32/registry.c @@ -8,9 +8,6 @@ * Copyright (C) 1998 Matthew Becker * Copyright (C) 1999 Sylvain St-Germain * - * This file is concerned about handle management and interaction with the Wine server. - * Registry file I/O is in misc/registry.c. - * * 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 diff --git a/dlls/comctl32/tests/treeview.c b/dlls/comctl32/tests/treeview.c index c1ba7f309be..a873e3c829a 100644 --- a/dlls/comctl32/tests/treeview.c +++ b/dlls/comctl32/tests/treeview.c @@ -64,6 +64,13 @@ static const struct message DoTest2Seq[] = { { 0 } }; +static const struct message DoTest3Seq[] = { + { TVM_INSERTITEM, sent }, + { TVM_GETITEM, sent }, + { TVM_DELETEITEM, sent }, + { 0 } +}; + static const struct message DoFocusTestSeq[] = { { TVM_INSERTITEM, sent }, { TVM_INSERTITEM, sent }, @@ -295,6 +302,35 @@ static void DoTest2(void) ok(!strcmp(sequence, "1(nR)nR23(RC)RC45(CR)CR."), "root-child select test\n"); } +static void DoTest3(void) +{ + TVINSERTSTRUCTA ins; + HTREEITEM hChild; + TVITEM tvi; + + int nBufferSize = 80; + CHAR szBuffer[80] = "Blah"; + + /* add an item without TVIF_TEXT mask and pszText == NULL */ + ins.hParent = hRoot; + ins.hInsertAfter = TVI_ROOT; + U(ins).item.mask = 0; + U(ins).item.pszText = NULL; + U(ins).item.cchTextMax = 0; + hChild = TreeView_InsertItem(hTree, &ins); + assert(hChild); + + /* retrieve it with TVIF_TEXT mask */ + tvi.hItem = hChild; + tvi.mask = TVIF_TEXT; + tvi.cchTextMax = nBufferSize; + tvi.pszText = szBuffer; + + SendMessageA( hTree, TVM_GETITEM, 0, (LPARAM)&tvi ); + ok(!strcmp(szBuffer, ""), "szBuffer=\"%s\", expected \"\"\n", szBuffer); + ok(SendMessageA(hTree, TVM_DELETEITEM, 0, (LPARAM)hChild), "DeleteItem failed\n"); +} + static void DoFocusTest(void) { TVINSERTSTRUCTA ins; @@ -700,6 +736,10 @@ START_TEST(treeview) ok_sequence(MsgSequences, LISTVIEW_SEQ_INDEX, DoTest2Seq, "DoTest2", FALSE); flush_sequences(MsgSequences, NUM_MSG_SEQUENCES); + DoTest3(); + ok_sequence(MsgSequences, LISTVIEW_SEQ_INDEX, DoTest3Seq, "DoTest3", FALSE); + + flush_sequences(MsgSequences, NUM_MSG_SEQUENCES); DoFocusTest(); ok_sequence(MsgSequences, LISTVIEW_SEQ_INDEX, DoFocusTestSeq, "DoFocusTest", TRUE); diff --git a/dlls/comctl32/treeview.c b/dlls/comctl32/treeview.c index a77792dd5e6..dabe5d92414 100644 --- a/dlls/comctl32/treeview.c +++ b/dlls/comctl32/treeview.c @@ -23,8 +23,7 @@ * * Note that TREEVIEW_INFO * and HTREEITEM are the same thing. * - * Note2: All items always! have valid (allocated) pszText field. - * If item's text == LPSTR_TEXTCALLBACKA we allocate buffer + * Note2: If item's text == LPSTR_TEXTCALLBACKA we allocate buffer * of size TEXT_CALLBACK_SIZE in DoSetItem. * We use callbackMask to keep track of fields to be updated. * @@ -2083,7 +2082,12 @@ TREEVIEW_GetItemT(const TREEVIEW_INFO *infoPtr, LPTVITEMEXW tvItem, BOOL isW) if (tvItem->mask & TVIF_TEXT) { - if (isW) + if (wineItem->pszText == NULL) + { + if (tvItem->cchTextMax > 0) + tvItem->pszText[0] = '\0'; + } + else if (isW) { if (wineItem->pszText == LPSTR_TEXTCALLBACKW) { @@ -3662,8 +3666,11 @@ TREEVIEW_EditLabel(TREEVIEW_INFO *infoPtr, HTREEITEM hItem) } /* Get string length in pixels */ - GetTextExtentPoint32W(hdc, editItem->pszText, strlenW(editItem->pszText), - &sz); + if (editItem->pszText) + GetTextExtentPoint32W(hdc, editItem->pszText, strlenW(editItem->pszText), + &sz); + else + GetTextExtentPoint32A(hdc, "", 0, &sz); /* Add Extra spacing for the next character */ GetTextMetricsW(hdc, &textMetric); @@ -3712,7 +3719,10 @@ TREEVIEW_EditLabel(TREEVIEW_INFO *infoPtr, HTREEITEM hItem) } infoPtr->selectedItem = hItem; - SetWindowTextW(hwndEdit, editItem->pszText); + + if (editItem->pszText) + SetWindowTextW(hwndEdit, editItem->pszText); + SetFocus(hwndEdit); SendMessageW(hwndEdit, EM_SETSEL, 0, -1); ShowWindow(hwndEdit, SW_SHOW); @@ -4186,10 +4196,14 @@ TREEVIEW_CreateDragImage(TREEVIEW_INFO *infoPtr, LPARAM lParam) hdc = CreateCompatibleDC(htopdc); hOldFont = SelectObject(hdc, infoPtr->hFont); - GetTextExtentPoint32W(hdc, dragItem->pszText, strlenW(dragItem->pszText), + + if (dragItem->pszText) + GetTextExtentPoint32W(hdc, dragItem->pszText, strlenW(dragItem->pszText), &size); - TRACE("%d %d %s %d\n", size.cx, size.cy, debugstr_w(dragItem->pszText), - strlenW(dragItem->pszText)); + else + GetTextExtentPoint32A(hdc, "", 0, &size); + + TRACE("%d %d %s\n", size.cx, size.cy, debugstr_w(dragItem->pszText)); hbmp = CreateCompatibleBitmap(htopdc, size.cx, size.cy); hOldbmp = SelectObject(hdc, hbmp); @@ -4210,8 +4224,11 @@ TREEVIEW_CreateDragImage(TREEVIEW_INFO *infoPtr, LPARAM lParam) /* draw item text */ SetRect(&rc, cx, 0, size.cx, size.cy); - DrawTextW(hdc, dragItem->pszText, strlenW(dragItem->pszText), &rc, - DT_LEFT); + + if (dragItem->pszText) + DrawTextW(hdc, dragItem->pszText, strlenW(dragItem->pszText), &rc, + DT_LEFT); + SelectObject(hdc, hOldFont); SelectObject(hdc, hOldbmp); diff --git a/dlls/crypt32/cert.c b/dlls/crypt32/cert.c index 8de96c8c764..e2949977114 100644 --- a/dlls/crypt32/cert.c +++ b/dlls/crypt32/cert.c @@ -468,6 +468,7 @@ static BOOL WINAPI CertContext_SetProperty(void *context, DWORD dwPropId, case CERT_SIGNATURE_HASH_PROP_ID: case CERT_ISSUER_PUBLIC_KEY_MD5_HASH_PROP_ID: case CERT_SUBJECT_NAME_MD5_HASH_PROP_ID: + case CERT_EXTENDED_ERROR_INFO_PROP_ID: case CERT_SUBJECT_PUBLIC_KEY_MD5_HASH_PROP_ID: case CERT_ENROLLMENT_PROP_ID: case CERT_CROSS_CERT_DIST_POINTS_PROP_ID: diff --git a/dlls/crypt32/tests/encode.c b/dlls/crypt32/tests/encode.c index 918f0f069e4..0b164882688 100644 --- a/dlls/crypt32/tests/encode.c +++ b/dlls/crypt32/tests/encode.c @@ -102,13 +102,16 @@ static void test_encodeInt(DWORD dwEncoding) &bufSize); ok(!ret && GetLastError() == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %d\n", GetLastError()); - /* check with NULL integer buffer. Windows XP incorrectly returns an - * NTSTATUS. - */ - ret = pCryptEncodeObjectEx(dwEncoding, X509_INTEGER, NULL, 0, NULL, NULL, - &bufSize); - ok(!ret && GetLastError() == STATUS_ACCESS_VIOLATION, - "Expected STATUS_ACCESS_VIOLATION, got %08x\n", GetLastError()); + if (0) + { + /* check with NULL integer buffer. Windows XP incorrectly returns an + * NTSTATUS (crashes on win9x). + */ + ret = pCryptEncodeObjectEx(dwEncoding, X509_INTEGER, NULL, 0, NULL, NULL, + &bufSize); + ok(!ret && GetLastError() == STATUS_ACCESS_VIOLATION, + "Expected STATUS_ACCESS_VIOLATION, got %08x\n", GetLastError()); + } for (i = 0; i < sizeof(ints) / sizeof(ints[0]); i++) { /* encode as normal integer */ @@ -729,11 +732,14 @@ static void test_encodeName(DWORD dwEncoding) DWORD size = 0; BOOL ret; - /* Test with NULL pvStructInfo */ - ret = pCryptEncodeObjectEx(dwEncoding, X509_NAME, NULL, - CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); - ok(!ret && GetLastError() == STATUS_ACCESS_VIOLATION, - "Expected STATUS_ACCESS_VIOLATION, got %08x\n", GetLastError()); + if (0) + { + /* Test with NULL pvStructInfo (crashes on win9x) */ + ret = pCryptEncodeObjectEx(dwEncoding, X509_NAME, NULL, + CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); + ok(!ret && GetLastError() == STATUS_ACCESS_VIOLATION, + "Expected STATUS_ACCESS_VIOLATION, got %08x\n", GetLastError()); + } /* Test with empty CERT_NAME_INFO */ info.cRDN = 0; info.rgRDN = NULL; @@ -746,12 +752,15 @@ static void test_encodeName(DWORD dwEncoding) "Got unexpected encoding for empty name\n"); LocalFree(buf); } - /* Test with bogus CERT_RDN */ - info.cRDN = 1; - ret = pCryptEncodeObjectEx(dwEncoding, X509_NAME, &info, - CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); - ok(!ret && GetLastError() == STATUS_ACCESS_VIOLATION, - "Expected STATUS_ACCESS_VIOLATION, got %08x\n", GetLastError()); + if (0) + { + /* Test with bogus CERT_RDN (crashes on win9x) */ + info.cRDN = 1; + ret = pCryptEncodeObjectEx(dwEncoding, X509_NAME, &info, + CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); + ok(!ret && GetLastError() == STATUS_ACCESS_VIOLATION, + "Expected STATUS_ACCESS_VIOLATION, got %08x\n", GetLastError()); + } /* Test with empty CERT_RDN */ rdn.cRDNAttr = 0; rdn.rgRDNAttr = NULL; @@ -766,13 +775,16 @@ static void test_encodeName(DWORD dwEncoding) "Got unexpected encoding for empty RDN array\n"); LocalFree(buf); } - /* Test with bogus attr array */ - rdn.cRDNAttr = 1; - rdn.rgRDNAttr = NULL; - ret = pCryptEncodeObjectEx(dwEncoding, X509_NAME, &info, - CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); - ok(!ret && GetLastError() == STATUS_ACCESS_VIOLATION, - "Expected STATUS_ACCESS_VIOLATION, got %08x\n", GetLastError()); + if (0) + { + /* Test with bogus attr array (crashes on win9x) */ + rdn.cRDNAttr = 1; + rdn.rgRDNAttr = NULL; + ret = pCryptEncodeObjectEx(dwEncoding, X509_NAME, &info, + CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); + ok(!ret && GetLastError() == STATUS_ACCESS_VIOLATION, + "Expected STATUS_ACCESS_VIOLATION, got %08x\n", GetLastError()); + } /* oddly, a bogus OID is accepted by Windows XP; not testing. attrs[0].pszObjId = "bogus"; attrs[0].dwValueType = CERT_RDN_PRINTABLE_STRING; @@ -870,11 +882,14 @@ static void test_encodeUnicodeName(DWORD dwEncoding) DWORD size = 0; BOOL ret; - /* Test with NULL pvStructInfo */ - ret = pCryptEncodeObjectEx(dwEncoding, X509_UNICODE_NAME, NULL, - CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); - ok(!ret && GetLastError() == STATUS_ACCESS_VIOLATION, - "Expected STATUS_ACCESS_VIOLATION, got %08x\n", GetLastError()); + if (0) + { + /* Test with NULL pvStructInfo (crashes on win9x) */ + ret = pCryptEncodeObjectEx(dwEncoding, X509_UNICODE_NAME, NULL, + CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); + ok(!ret && GetLastError() == STATUS_ACCESS_VIOLATION, + "Expected STATUS_ACCESS_VIOLATION, got %08x\n", GetLastError()); + } /* Test with empty CERT_NAME_INFO */ info.cRDN = 0; info.rgRDN = NULL; @@ -1681,10 +1696,14 @@ static void test_encodeUnicodeNameValue(DWORD dwEncoding) BOOL ret; CERT_NAME_VALUE value; - ret = pCryptEncodeObjectEx(dwEncoding, X509_UNICODE_NAME_VALUE, NULL, - CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); - ok(!ret && GetLastError() == STATUS_ACCESS_VIOLATION, - "Expected STATUS_ACCESS_VIOLATION, got %08x\n", GetLastError()); + if (0) + { + /* Crashes on win9x */ + ret = pCryptEncodeObjectEx(dwEncoding, X509_UNICODE_NAME_VALUE, NULL, + CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); + ok(!ret && GetLastError() == STATUS_ACCESS_VIOLATION, + "Expected STATUS_ACCESS_VIOLATION, got %08x\n", GetLastError()); + } /* Have to have a string of some sort */ value.dwValueType = 0; /* aka CERT_RDN_ANY_TYPE */ value.Value.pbData = NULL; @@ -2804,11 +2823,14 @@ static void test_encodeCertToBeSigned(DWORD dwEncoding) static char oid_subject_key_identifier[] = szOID_SUBJECT_KEY_IDENTIFIER; CERT_EXTENSION ext; - /* Test with NULL pvStructInfo */ - ret = pCryptEncodeObjectEx(dwEncoding, X509_CERT_TO_BE_SIGNED, NULL, - CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); - ok(!ret && GetLastError() == STATUS_ACCESS_VIOLATION, - "Expected STATUS_ACCESS_VIOLATION, got %08x\n", GetLastError()); + if (0) + { + /* Test with NULL pvStructInfo (crashes on win9x) */ + ret = pCryptEncodeObjectEx(dwEncoding, X509_CERT_TO_BE_SIGNED, NULL, + CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); + ok(!ret && GetLastError() == STATUS_ACCESS_VIOLATION, + "Expected STATUS_ACCESS_VIOLATION, got %08x\n", GetLastError()); + } /* Test with a V1 cert */ ret = pCryptEncodeObjectEx(dwEncoding, X509_CERT_TO_BE_SIGNED, &info, CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); @@ -2931,10 +2953,14 @@ static void test_decodeCertToBeSigned(DWORD dwEncoding) CRYPT_DECODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); ok(!ret && GetLastError() == CRYPT_E_ASN1_EOD, "Expected CRYPT_E_ASN1_EOD, got %08x\n", GetLastError()); - ret = pCryptDecodeObjectEx(dwEncoding, X509_CERT_TO_BE_SIGNED, NULL, 1, - CRYPT_DECODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); - ok(!ret && GetLastError() == STATUS_ACCESS_VIOLATION, - "Expected STATUS_ACCESS_VIOLATION, got %08x\n", GetLastError()); + if (0) + { + /* Crashes on win9x */ + ret = pCryptDecodeObjectEx(dwEncoding, X509_CERT_TO_BE_SIGNED, NULL, 1, + CRYPT_DECODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); + ok(!ret && GetLastError() == STATUS_ACCESS_VIOLATION, + "Expected STATUS_ACCESS_VIOLATION, got %08x\n", GetLastError()); + } /* The following certs all fail with CRYPT_E_ASN1_CORRUPT, because at a * minimum a cert must have a non-zero serial number, an issuer, and a * subject. @@ -3606,13 +3632,17 @@ static void test_encodeCRLToBeSigned(DWORD dwEncoding) ok(!memcmp(buf, v1CRLWithIssuer, size), "Got unexpected value\n"); LocalFree(buf); } - /* v1 CRL with a name and a NULL entry pointer */ - info.cCRLEntry = 1; - ret = pCryptEncodeObjectEx(dwEncoding, X509_CERT_CRL_TO_BE_SIGNED, &info, - CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); - ok(!ret && GetLastError() == STATUS_ACCESS_VIOLATION, - "Expected STATUS_ACCESS_VIOLATION, got %08x\n", GetLastError()); + if (0) + { + /* v1 CRL with a name and a NULL entry pointer (crashes on win9x) */ + info.cCRLEntry = 1; + ret = pCryptEncodeObjectEx(dwEncoding, X509_CERT_CRL_TO_BE_SIGNED, &info, + CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); + ok(!ret && GetLastError() == STATUS_ACCESS_VIOLATION, + "Expected STATUS_ACCESS_VIOLATION, got %08x\n", GetLastError()); + } /* now set an empty entry */ + info.cCRLEntry = 1; info.rgCRLEntry = &entry; ret = pCryptEncodeObjectEx(dwEncoding, X509_CERT_CRL_TO_BE_SIGNED, &info, CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); @@ -5519,11 +5549,15 @@ static void test_encodePKCSContentInfo(DWORD dwEncoding) CRYPT_CONTENT_INFO info = { 0 }; char oid1[] = "1.2.3"; - SetLastError(0xdeadbeef); - ret = pCryptEncodeObjectEx(dwEncoding, PKCS_CONTENT_INFO, NULL, - CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); - ok(!ret && GetLastError() == STATUS_ACCESS_VIOLATION, - "Expected STATUS_ACCESS_VIOLATION, got %x\n", GetLastError()); + if (0) + { + /* Crashes on win9x */ + SetLastError(0xdeadbeef); + ret = pCryptEncodeObjectEx(dwEncoding, PKCS_CONTENT_INFO, NULL, + CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); + ok(!ret && GetLastError() == STATUS_ACCESS_VIOLATION, + "Expected STATUS_ACCESS_VIOLATION, got %x\n", GetLastError()); + } SetLastError(0xdeadbeef); ret = pCryptEncodeObjectEx(dwEncoding, PKCS_CONTENT_INFO, &info, CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); @@ -5676,11 +5710,15 @@ static void test_encodePKCSAttribute(DWORD dwEncoding) CRYPT_ATTR_BLOB blob; char oid[] = "1.2.3"; - SetLastError(0xdeadbeef); - ret = pCryptEncodeObjectEx(dwEncoding, PKCS_ATTRIBUTE, NULL, - CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); - ok(!ret && GetLastError() == STATUS_ACCESS_VIOLATION, - "Expected STATUS_ACCESS_VIOLATION, got %x\n", GetLastError()); + if (0) + { + /* Crashes on win9x */ + SetLastError(0xdeadbeef); + ret = pCryptEncodeObjectEx(dwEncoding, PKCS_ATTRIBUTE, NULL, + CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); + ok(!ret && GetLastError() == STATUS_ACCESS_VIOLATION, + "Expected STATUS_ACCESS_VIOLATION, got %x\n", GetLastError()); + } SetLastError(0xdeadbeef); ret = pCryptEncodeObjectEx(dwEncoding, PKCS_ATTRIBUTE, &attr, CRYPT_ENCODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); diff --git a/dlls/crypt32/tests/msg.c b/dlls/crypt32/tests/msg.c index 78d49d86920..e4a384937b3 100644 --- a/dlls/crypt32/tests/msg.c +++ b/dlls/crypt32/tests/msg.c @@ -2574,6 +2574,7 @@ static void test_msg_control(void) ok(!ret && GetLastError() == E_INVALIDARG, "Expected E_INVALIDARG, got %08x\n", GetLastError()); } + ret = CryptMsgUpdate(msg, NULL, 0, TRUE); /* or after an update. */ for (i = 1; have_nt && (i <= CMSG_CTRL_ADD_CMS_SIGNER_INFO); i++) { diff --git a/dlls/d3dxof/d3dxof.c b/dlls/d3dxof/d3dxof.c index 08d2885edb0..23e4847a140 100644 --- a/dlls/d3dxof/d3dxof.c +++ b/dlls/d3dxof/d3dxof.c @@ -1390,8 +1390,7 @@ static HRESULT WINAPI IDirectXFileDataImpl_GetType(IDirectXFileData* iface, cons if (!pguid) return DXFILEERR_BADVALUE; - /* Native dll returns object guid instead of object template one */ - memcpy(&guid, &This->pobj->class_id, 16); + memcpy(&guid, &This->pobj->type, 16); *pguid = &guid; return DXFILE_OK; @@ -1803,6 +1802,7 @@ static BOOL parse_object(parse_buffer * buf) if (!strcmp((char*)buf->value, buf->pdxf->xtemplates[i].name)) { buf->pxt[buf->level] = &buf->pdxf->xtemplates[i]; + memcpy(&buf->pxo->type, &buf->pdxf->xtemplates[i].class_id, 16); break; } } @@ -1811,6 +1811,7 @@ static BOOL parse_object(parse_buffer * buf) FIXME("Unknown template %s\n", (char*)buf->value); return FALSE; } + if (check_TOKEN(buf) == TOKEN_NAME) { parse_TOKEN(buf); diff --git a/dlls/dsound/tests/dsound.c b/dlls/dsound/tests/dsound.c index 9dc8f21c3e5..256f086859c 100644 --- a/dlls/dsound/tests/dsound.c +++ b/dlls/dsound/tests/dsound.c @@ -763,8 +763,9 @@ static HRESULT test_secondary(LPGUID lpGuid) wfxe.Format.cbSize = sizeof(wfxe) - sizeof(wfx) + 1; rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&secondary,NULL); - ok(((rc==DSERR_CONTROLUNAVAIL || rc==DSERR_INVALIDCALL) && !secondary) - || rc==DS_OK, /* 2003 / 2008 */ + ok(((rc==DSERR_CONTROLUNAVAIL || rc==DSERR_INVALIDCALL || rc==DSERR_INVALIDPARAM) + && !secondary) + || rc==DS_OK, /* 2003 / 2008 */ "IDirectSound_CreateSoundBuffer() returned: %08x %p\n", rc, secondary); if (secondary) diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index dcd60e36aba..145be9be633 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -1026,11 +1026,19 @@ static void LoadSubstList(void) } } -static WCHAR *get_familyname(FT_Face ft_face) + +/***************************************************************** + * get_name_table_entry + * + * Supply the platform, encoding, language and name ids in req + * and if the name exists the function will fill in the string + * and string_len members. The string is owned by FreeType so + * don't free it. Returns TRUE if the name is found else FALSE. + */ +static BOOL get_name_table_entry(FT_Face ft_face, FT_SfntName *req) { - WCHAR *family = NULL; FT_SfntName name; - FT_UInt num_names, name_index, i; + FT_UInt num_names, name_index; if(FT_IS_SFNT(ft_face)) { @@ -1040,28 +1048,49 @@ static WCHAR *get_familyname(FT_Face ft_face) { if(!pFT_Get_Sfnt_Name(ft_face, name_index, &name)) { - if((name.name_id == TT_NAME_ID_FONT_FAMILY) && - (name.language_id == GetUserDefaultLCID()) && - (name.platform_id == TT_PLATFORM_MICROSOFT) && - (name.encoding_id == TT_MS_ID_UNICODE_CS)) + if((name.platform_id == req->platform_id) && + (name.encoding_id == req->encoding_id) && + (name.language_id == req->language_id) && + (name.name_id == req->name_id)) { - /* String is not nul terminated and string_len is a byte length. */ - family = HeapAlloc(GetProcessHeap(), 0, name.string_len + 2); - for(i = 0; i < name.string_len / 2; i++) - { - WORD *tmp = (WORD *)&name.string[i * 2]; - family[i] = GET_BE_WORD(*tmp); - } - family[i] = 0; - - TRACE("Got localised name %s\n", debugstr_w(family)); - return family; + req->string = name.string; + req->string_len = name.string_len; + return TRUE; } } } } + req->string = NULL; + req->string_len = 0; + return FALSE; +} - return NULL; +static WCHAR *get_familyname(FT_Face ft_face) +{ + WCHAR *family = NULL; + FT_SfntName name; + + name.platform_id = TT_PLATFORM_MICROSOFT; + name.encoding_id = TT_MS_ID_UNICODE_CS; + name.language_id = GetUserDefaultLCID(); + name.name_id = TT_NAME_ID_FONT_FAMILY; + + if(get_name_table_entry(ft_face, &name)) + { + int i; + + /* String is not nul terminated and string_len is a byte length. */ + family = HeapAlloc(GetProcessHeap(), 0, name.string_len + 2); + for(i = 0; i < name.string_len / 2; i++) + { + WORD *tmp = (WORD *)&name.string[i * 2]; + family[i] = GET_BE_WORD(*tmp); + } + family[i] = 0; + TRACE("Got localised name %s\n", debugstr_w(family)); + } + + return family; } diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c index 7d2c036b361..b92aa748d32 100644 --- a/dlls/gdi32/tests/font.c +++ b/dlls/gdi32/tests/font.c @@ -2328,6 +2328,12 @@ static void test_GetTextFace(void) HDC dc; int n; + if(!is_font_installed("Tahoma")) + { + skip("Tahoma is not installed so skipping this test\n"); + return; + } + /* 'A' case. */ memcpy(fA.lfFaceName, faceA, sizeof faceA); f = CreateFontIndirectA(&fA); diff --git a/dlls/hhctrl.ocx/hhctrl.h b/dlls/hhctrl.ocx/hhctrl.h index f529a595172..795bea4d13e 100644 --- a/dlls/hhctrl.ocx/hhctrl.h +++ b/dlls/hhctrl.ocx/hhctrl.h @@ -141,22 +141,22 @@ BOOL NavigateToChm(HHInfo*,LPCWSTR,LPCWSTR); /* memory allocation functions */ -static inline void __WINE_ALLOC_SIZE(1) *heap_alloc(size_t len) +static inline void * __WINE_ALLOC_SIZE(1) heap_alloc(size_t len) { return HeapAlloc(GetProcessHeap(), 0, len); } -static inline void __WINE_ALLOC_SIZE(1) *heap_alloc_zero(size_t len) +static inline void * __WINE_ALLOC_SIZE(1) heap_alloc_zero(size_t len) { return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len); } -static inline void __WINE_ALLOC_SIZE(2) *heap_realloc(void *mem, size_t len) +static inline void * __WINE_ALLOC_SIZE(2) heap_realloc(void *mem, size_t len) { return HeapReAlloc(GetProcessHeap(), 0, mem, len); } -static inline void __WINE_ALLOC_SIZE(2) *heap_realloc_zero(void *mem, size_t len) +static inline void * __WINE_ALLOC_SIZE(2) heap_realloc_zero(void *mem, size_t len) { return HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, mem, len); } diff --git a/dlls/inetcomm/inetcomm_main.c b/dlls/inetcomm/inetcomm_main.c index 579b05f65c0..1b346bfb941 100644 --- a/dlls/inetcomm/inetcomm_main.c +++ b/dlls/inetcomm/inetcomm_main.c @@ -37,7 +37,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(inetcomm); BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { - IMimeInternational *international; + static IMimeInternational *international; TRACE("(%p, %d, %p)\n", hinstDLL, fdwReason, lpvReserved); diff --git a/dlls/jscript/dispex.c b/dlls/jscript/dispex.c index 193a5b5d71f..1c643f69c9a 100644 --- a/dlls/jscript/dispex.c +++ b/dlls/jscript/dispex.c @@ -381,6 +381,8 @@ static HRESULT fill_protrefs(DispatchEx *This) fill_protrefs(This->prototype); for(iter = This->prototype->props; iter < This->prototype->props+This->prototype->prop_cnt; iter++) { + if(!iter->name) + continue; hres = find_prop_name(This, iter->name, &prop); if(FAILED(hres)) return hres; diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index 2b663d3d2f5..f0f5062e4e1 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -41,7 +41,8 @@ static void exprval_release(exprval_t *val) { switch(val->type) { case EXPRVAL_VARIANT: - VariantClear(&val->u.var); + if(V_VT(&val->u.var) != VT_EMPTY) + VariantClear(&val->u.var); return; case EXPRVAL_IDREF: if(val->u.idref.disp) @@ -287,17 +288,6 @@ static inline DOUBLE num_val(const VARIANT *v) return V_VT(v) == VT_I4 ? V_I4(v) : V_R8(v); } -static inline void num_set_val(VARIANT *v, DOUBLE d) -{ - if(d == (DOUBLE)(INT)d) { - V_VT(v) = VT_I4; - V_I4(v) = d; - }else { - V_VT(v) = VT_R8; - V_R8(v) = d; - } -} - /* ECMA-262 3rd Edition 11.9.6 */ HRESULT equal2_values(VARIANT *lval, VARIANT *rval, BOOL *ret) { @@ -640,40 +630,270 @@ HRESULT if_statement_eval(exec_ctx_t *ctx, statement_t *_stat, return_type_t *rt return hres; } -HRESULT dowhile_statement_eval(exec_ctx_t *ctx, statement_t *stat, return_type_t *rt, VARIANT *ret) +/* ECMA-262 3rd Edition 12.6.2 */ +HRESULT while_statement_eval(exec_ctx_t *ctx, statement_t *_stat, return_type_t *rt, VARIANT *ret) { - FIXME("\n"); - return E_NOTIMPL; -} + while_statement_t *stat = (while_statement_t*)_stat; + exprval_t exprval; + VARIANT val, tmp; + VARIANT_BOOL b; + BOOL test_expr; + HRESULT hres; -HRESULT while_statement_eval(exec_ctx_t *ctx, statement_t *stat, return_type_t *rt, VARIANT *ret) -{ - FIXME("\n"); - return E_NOTIMPL; + TRACE("\n"); + + V_VT(&val) = VT_EMPTY; + test_expr = !stat->do_while; + + while(1) { + if(test_expr) { + hres = expr_eval(ctx, stat->expr, 0, &rt->ei, &exprval); + if(FAILED(hres)) + break; + + hres = exprval_to_boolean(ctx->parser->script, &exprval, &rt->ei, &b); + exprval_release(&exprval); + if(FAILED(hres) || !b) + break; + }else { + test_expr = TRUE; + } + + hres = stat_eval(ctx, stat->statement, rt, &tmp); + if(FAILED(hres)) + break; + + VariantClear(&val); + val = tmp; + + if(rt->type == RT_CONTINUE) + rt->type = RT_NORMAL; + if(rt->type != RT_NORMAL) + break; + } + + if(FAILED(hres)) { + VariantClear(&val); + return hres; + } + + if(rt->type == RT_BREAK) + rt->type = RT_NORMAL; + + *ret = val; + return S_OK; } -HRESULT for_statement_eval(exec_ctx_t *ctx, statement_t *stat, return_type_t *rt, VARIANT *ret) +/* ECMA-262 3rd Edition 12.6.3 */ +HRESULT for_statement_eval(exec_ctx_t *ctx, statement_t *_stat, return_type_t *rt, VARIANT *ret) { - FIXME("\n"); - return E_NOTIMPL; + for_statement_t *stat = (for_statement_t*)_stat; + VARIANT val, tmp, retv; + exprval_t exprval; + VARIANT_BOOL b; + HRESULT hres; + + TRACE("\n"); + + if(stat->variable_list) { + hres = variable_list_eval(ctx, stat->variable_list, &rt->ei); + if(FAILED(hres)) + return hres; + }else if(stat->begin_expr) { + hres = expr_eval(ctx, stat->begin_expr, EXPR_NEWREF, &rt->ei, &exprval); + if(FAILED(hres)) + return hres; + + hres = exprval_to_value(ctx->parser->script, &exprval, &rt->ei, &val); + exprval_release(&exprval); + if(FAILED(hres)) + return hres; + + VariantClear(&val); + } + + V_VT(&retv) = VT_EMPTY; + + while(1) { + if(stat->expr) { + hres = expr_eval(ctx, stat->expr, 0, &rt->ei, &exprval); + if(FAILED(hres)) + break; + + hres = exprval_to_boolean(ctx->parser->script, &exprval, &rt->ei, &b); + exprval_release(&exprval); + if(FAILED(hres) || !b) + break; + } + + hres = stat_eval(ctx, stat->statement, rt, &tmp); + if(FAILED(hres)) + break; + + VariantClear(&retv); + retv = tmp; + + if(rt->type == RT_CONTINUE) + rt->type = RT_NORMAL; + else if(rt->type != RT_NORMAL) + break; + + if(stat->end_expr) { + hres = expr_eval(ctx, stat->end_expr, 0, &rt->ei, &exprval); + if(FAILED(hres)) + break; + + hres = exprval_to_value(ctx->parser->script, &exprval, &rt->ei, &val); + exprval_release(&exprval); + if(FAILED(hres)) + break; + + VariantClear(&val); + } + } + + if(FAILED(hres)) { + VariantClear(&retv); + return hres; + } + + if(rt->type == RT_BREAK) + rt->type = RT_NORMAL; + + *ret = retv; + return S_OK; } -HRESULT forin_statement_eval(exec_ctx_t *ctx, statement_t *stat, return_type_t *rt, VARIANT *ret) +/* ECMA-262 3rd Edition 12.6.4 */ +HRESULT forin_statement_eval(exec_ctx_t *ctx, statement_t *_stat, return_type_t *rt, VARIANT *ret) { - FIXME("\n"); - return E_NOTIMPL; + forin_statement_t *stat = (forin_statement_t*)_stat; + VARIANT val, name, retv, tmp; + DISPID id = DISPID_STARTENUM; + BSTR str, identifier = NULL; + IDispatchEx *in_obj; + exprval_t exprval; + HRESULT hres; + + TRACE("\n"); + + if(stat->variable) { + hres = variable_list_eval(ctx, stat->variable, &rt->ei); + if(FAILED(hres)) + return hres; + } + + hres = expr_eval(ctx, stat->in_expr, EXPR_NEWREF, &rt->ei, &exprval); + if(FAILED(hres)) + return hres; + + hres = exprval_to_value(ctx->parser->script, &exprval, &rt->ei, &val); + exprval_release(&exprval); + if(FAILED(hres)) + return hres; + + if(V_VT(&val) != VT_DISPATCH) { + FIXME("in vt %d\n", V_VT(&val)); + VariantClear(&val); + return E_NOTIMPL; + } + + hres = IDispatch_QueryInterface(V_DISPATCH(&val), &IID_IDispatchEx, (void**)&in_obj); + IDispatch_Release(V_DISPATCH(&val)); + if(FAILED(hres)) { + FIXME("Object doesn't support IDispatchEx\n"); + return E_NOTIMPL; + } + + V_VT(&retv) = VT_EMPTY; + + if(stat->variable) + identifier = SysAllocString(stat->variable->identifier); + + while(1) { + hres = IDispatchEx_GetNextDispID(in_obj, fdexEnumDefault, id, &id); + if(FAILED(hres) || hres == S_FALSE) + break; + + hres = IDispatchEx_GetMemberName(in_obj, id, &str); + if(FAILED(hres)) + break; + + TRACE("iter %s\n", debugstr_w(str)); + + if(stat->variable) + hres = identifier_eval(ctx, identifier, 0, &exprval); + else + hres = expr_eval(ctx, stat->expr, EXPR_NEWREF, &rt->ei, &exprval); + if(SUCCEEDED(hres)) { + V_VT(&name) = VT_BSTR; + V_BSTR(&name) = str; + hres = put_value(ctx->parser->script, &exprval, &name, &rt->ei); + exprval_release(&exprval); + } + SysFreeString(str); + if(FAILED(hres)) + break; + + hres = stat_eval(ctx, stat->statement, rt, &tmp); + if(FAILED(hres)) + break; + + VariantClear(&retv); + retv = tmp; + + if(rt->type == RT_CONTINUE) + rt->type = RT_NORMAL; + else if(rt->type != RT_NORMAL) + break; + } + + SysFreeString(identifier); + IDispatchEx_Release(in_obj); + if(FAILED(hres)) { + VariantClear(&retv); + return hres; + } + + if(rt->type == RT_BREAK) + rt->type = RT_NORMAL; + + *ret = retv; + return S_OK; } -HRESULT continue_statement_eval(exec_ctx_t *ctx, statement_t *stat, return_type_t *rt, VARIANT *ret) +/* ECMA-262 3rd Edition 12.7 */ +HRESULT continue_statement_eval(exec_ctx_t *ctx, statement_t *_stat, return_type_t *rt, VARIANT *ret) { - FIXME("\n"); - return E_NOTIMPL; + branch_statement_t *stat = (branch_statement_t*)_stat; + + TRACE("\n"); + + if(stat->identifier) { + FIXME("indentifier not implemented\n"); + return E_NOTIMPL; + } + + rt->type = RT_CONTINUE; + V_VT(ret) = VT_EMPTY; + return S_OK; } -HRESULT break_statement_eval(exec_ctx_t *ctx, statement_t *stat, return_type_t *rt, VARIANT *ret) +/* ECMA-262 3rd Edition 12.8 */ +HRESULT break_statement_eval(exec_ctx_t *ctx, statement_t *_stat, return_type_t *rt, VARIANT *ret) { - FIXME("\n"); - return E_NOTIMPL; + branch_statement_t *stat = (branch_statement_t*)_stat; + + TRACE("\n"); + + if(stat->identifier) { + FIXME("indentifier not implemented\n"); + return E_NOTIMPL; + } + + rt->type = RT_BREAK; + V_VT(ret) = VT_EMPTY; + return S_OK; } /* ECMA-262 3rd Edition 12.9 */ @@ -704,22 +924,133 @@ HRESULT return_statement_eval(exec_ctx_t *ctx, statement_t *_stat, return_type_t return S_OK; } -HRESULT with_statement_eval(exec_ctx_t *ctx, statement_t *stat, return_type_t *rt, VARIANT *ret) +/* ECMA-262 3rd Edition 12.10 */ +HRESULT with_statement_eval(exec_ctx_t *ctx, statement_t *_stat, return_type_t *rt, VARIANT *ret) { - FIXME("\n"); - return E_NOTIMPL; + with_statement_t *stat = (with_statement_t*)_stat; + exprval_t exprval; + IDispatch *disp; + DispatchEx *obj; + VARIANT val; + HRESULT hres; + + TRACE("\n"); + + hres = expr_eval(ctx, stat->expr, 0, &rt->ei, &exprval); + if(FAILED(hres)) + return hres; + + hres = exprval_to_value(ctx->parser->script, &exprval, &rt->ei, &val); + exprval_release(&exprval); + if(FAILED(hres)) + return hres; + + hres = to_object(ctx, &val, &disp); + VariantClear(&val); + if(FAILED(hres)) + return hres; + + obj = iface_to_jsdisp((IUnknown*)disp); + IDispatch_Release(disp); + if(!obj) { + FIXME("disp id not jsdisp\n"); + return E_NOTIMPL; + } + + hres = scope_push(ctx->scope_chain, obj, &ctx->scope_chain); + jsdisp_release(obj); + if(FAILED(hres)); + + hres = stat_eval(ctx, stat->statement, rt, ret); + + scope_pop(&ctx->scope_chain); + return hres; } +/* ECMA-262 3rd Edition 12.12 */ HRESULT labelled_statement_eval(exec_ctx_t *ctx, statement_t *stat, return_type_t *rt, VARIANT *ret) { FIXME("\n"); return E_NOTIMPL; } -HRESULT switch_statement_eval(exec_ctx_t *ctx, statement_t *stat, return_type_t *rt, VARIANT *ret) +/* ECMA-262 3rd Edition 12.13 */ +HRESULT switch_statement_eval(exec_ctx_t *ctx, statement_t *_stat, return_type_t *rt, VARIANT *ret) { - FIXME("\n"); - return E_NOTIMPL; + switch_statement_t *stat = (switch_statement_t*)_stat; + case_clausule_t *iter, *default_clausule = NULL; + statement_t *stat_iter; + VARIANT val, cval; + exprval_t exprval; + BOOL b; + HRESULT hres; + + TRACE("\n"); + + hres = expr_eval(ctx, stat->expr, 0, &rt->ei, &exprval); + if(FAILED(hres)) + return hres; + + hres = exprval_to_value(ctx->parser->script, &exprval, &rt->ei, &val); + exprval_release(&exprval); + if(FAILED(hres)) + return hres; + + for(iter = stat->case_list; iter; iter = iter->next) { + if(!iter->expr) { + default_clausule = iter; + continue; + } + + hres = expr_eval(ctx, iter->expr, 0, &rt->ei, &exprval); + if(FAILED(hres)) + break; + + hres = exprval_to_value(ctx->parser->script, &exprval, &rt->ei, &cval); + exprval_release(&exprval); + if(FAILED(hres)) + break; + + hres = equal2_values(&val, &cval, &b); + VariantClear(&cval); + if(FAILED(hres) || b) + break; + } + + VariantClear(&val); + if(FAILED(hres)) + return hres; + + if(!iter) + iter = default_clausule; + + V_VT(&val) = VT_EMPTY; + if(iter) { + VARIANT tmp; + + for(stat_iter = iter->stat; stat_iter; stat_iter = stat_iter->next) { + hres = stat_eval(ctx, stat_iter, rt, &tmp); + if(FAILED(hres)) + break; + + VariantClear(&val); + val = tmp; + + if(rt->type != RT_NORMAL) + break; + } + } + + if(FAILED(hres)) { + VariantClear(&val); + return hres; + } + + if(rt->type == RT_BREAK) + rt->type = RT_NORMAL; + + *ret = val; + return S_OK; } /* ECMA-262 3rd Edition 12.13 */ @@ -1054,7 +1385,7 @@ HRESULT member_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWORD flags return S_OK; } - hres = disp_get_id(obj, str, flags & EXPR_NEW ? fdexNameEnsure : 0, &id); + hres = disp_get_id(obj, str, flags & EXPR_NEWREF ? fdexNameEnsure : 0, &id); SysFreeString(str); if(SUCCEEDED(hres)) { exprval_set_idref(ret, obj, id); @@ -1085,11 +1416,11 @@ static HRESULT args_to_param(exec_ctx_t *ctx, argument_t *args, jsexcept_t *ei, HRESULT hres = S_OK; memset(dp, 0, sizeof(*dp)); + if(!args) + return S_OK; for(iter = args; iter; iter = iter->next) cnt++; - if(!cnt) - return S_OK; vargs = heap_alloc_zero(cnt * sizeof(*vargs)); if(!vargs) @@ -1117,7 +1448,7 @@ static HRESULT args_to_param(exec_ctx_t *ctx, argument_t *args, jsexcept_t *ei, } /* ECMA-262 3rd Edition 11.2.2 */ -HRESULT member_new_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) +HRESULT new_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) { call_expression_t *expr = (call_expression_t*)_expr; exprval_t exprval; @@ -1155,6 +1486,7 @@ HRESULT member_new_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWORD f return S_OK; } +/* ECMA-262 3rd Edition 11.2.3 */ HRESULT call_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) { call_expression_t *expr = (call_expression_t*)_expr; @@ -1196,6 +1528,7 @@ HRESULT call_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWORD flags, return S_OK; } +/* ECMA-262 3rd Edition 11.1.1 */ HRESULT this_expression_eval(exec_ctx_t *ctx, expression_t *expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) { TRACE("\n"); @@ -1244,10 +1577,56 @@ HRESULT literal_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWORD flag return S_OK; } -HRESULT array_literal_expression_eval(exec_ctx_t *ctx, expression_t *expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) +/* ECMA-262 3rd Edition 11.1.4 */ +HRESULT array_literal_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) { - FIXME("\n"); - return E_NOTIMPL; + array_literal_expression_t *expr = (array_literal_expression_t*)_expr; + DWORD length = 0, i = 0; + array_element_t *elem; + DispatchEx *array; + exprval_t exprval; + VARIANT val; + HRESULT hres; + + TRACE("\n"); + + for(elem = expr->element_list; elem; elem = elem->next) + length += elem->elision+1; + length += expr->length; + + hres = create_array(ctx->parser->script, length, &array); + if(FAILED(hres)) + return hres; + + for(elem = expr->element_list; elem; elem = elem->next) { + i += elem->elision; + + hres = expr_eval(ctx, elem->expr, 0, ei, &exprval); + if(FAILED(hres)) + break; + + hres = exprval_to_value(ctx->parser->script, &exprval, ei, &val); + exprval_release(&exprval); + if(FAILED(hres)) + break; + + hres = jsdisp_propput_idx(array, i, ctx->parser->script->lcid, &val, ei, NULL/*FIXME*/); + VariantClear(&val); + if(FAILED(hres)) + break; + + i++; + } + + if(FAILED(hres)) { + jsdisp_release(array); + return hres; + } + + ret->type = EXPRVAL_VARIANT; + V_VT(&ret->u.var) = VT_DISPATCH; + V_DISPATCH(&ret->u.var) = (IDispatch*)_IDispatchEx_(array); + return S_OK; } /* ECMA-262 3rd Edition 11.1.5 */ @@ -1303,10 +1682,24 @@ HRESULT property_value_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWO return S_OK; } -HRESULT comma_expression_eval(exec_ctx_t *ctx, expression_t *expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) +/* ECMA-262 3rd Edition 11.14 */ +HRESULT comma_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) { - FIXME("\n"); - return E_NOTIMPL; + binary_expression_t *expr = (binary_expression_t*)_expr; + VARIANT lval, rval; + HRESULT hres; + + TRACE("\n"); + + hres = get_binary_expr_values(ctx, expr, ei, &lval, &rval); + if(FAILED(hres)) + return hres; + + VariantClear(&lval); + + ret->type = EXPRVAL_VARIANT; + ret->u.var = rval; + return S_OK; } /* ECMA-262 3rd Edition 11.11 */ @@ -1399,30 +1792,101 @@ HRESULT logical_and_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWORD return S_OK; } -HRESULT binary_or_expression_eval(exec_ctx_t *ctx, expression_t *expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) +/* ECMA-262 3rd Edition 11.10 */ +static HRESULT bitor_eval(exec_ctx_t *ctx, VARIANT *lval, VARIANT *rval, jsexcept_t *ei, VARIANT *retv) { - FIXME("\n"); - return E_NOTIMPL; + INT li, ri; + HRESULT hres; + + hres = to_int32(ctx->parser->script, lval, ei, &li); + if(FAILED(hres)) + return hres; + + hres = to_int32(ctx->parser->script, rval, ei, &ri); + if(FAILED(hres)) + return hres; + + V_VT(retv) = VT_I4; + V_I4(retv) = li|ri; + return S_OK; } -HRESULT binary_xor_expression_eval(exec_ctx_t *ctx, expression_t *expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) +/* ECMA-262 3rd Edition 11.10 */ +HRESULT binary_or_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) { - FIXME("\n"); - return E_NOTIMPL; + binary_expression_t *expr = (binary_expression_t*)_expr; + + TRACE("\n"); + + return binary_expr_eval(ctx, expr, bitor_eval, ei, ret); } -HRESULT binary_and_expression_eval(exec_ctx_t *ctx, expression_t *expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) +/* ECMA-262 3rd Edition 11.10 */ +static HRESULT xor_eval(exec_ctx_t *ctx, VARIANT *lval, VARIANT *rval, jsexcept_t *ei, VARIANT *retv) { - FIXME("\n"); - return E_NOTIMPL; + INT li, ri; + HRESULT hres; + + hres = to_int32(ctx->parser->script, lval, ei, &li); + if(FAILED(hres)) + return hres; + + hres = to_int32(ctx->parser->script, rval, ei, &ri); + if(FAILED(hres)) + return hres; + + V_VT(retv) = VT_I4; + V_I4(retv) = li^ri; + return S_OK; +} + +/* ECMA-262 3rd Edition 11.10 */ +HRESULT binary_xor_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) +{ + binary_expression_t *expr = (binary_expression_t*)_expr; + + TRACE("\n"); + + return binary_expr_eval(ctx, expr, xor_eval, ei, ret); +} + +/* ECMA-262 3rd Edition 11.10 */ +static HRESULT bitand_eval(exec_ctx_t *ctx, VARIANT *lval, VARIANT *rval, jsexcept_t *ei, VARIANT *retv) +{ + INT li, ri; + HRESULT hres; + + hres = to_int32(ctx->parser->script, lval, ei, &li); + if(FAILED(hres)) + return hres; + + hres = to_int32(ctx->parser->script, rval, ei, &ri); + if(FAILED(hres)) + return hres; + + V_VT(retv) = VT_I4; + V_I4(retv) = li&ri; + return S_OK; } +/* ECMA-262 3rd Edition 11.10 */ +HRESULT binary_and_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) +{ + binary_expression_t *expr = (binary_expression_t*)_expr; + + TRACE("\n"); + + return binary_expr_eval(ctx, expr, bitand_eval, ei, ret); +} + +/* ECMA-262 3rd Edition 11.8.6 */ HRESULT instanceof_expression_eval(exec_ctx_t *ctx, expression_t *expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) { FIXME("\n"); return E_NOTIMPL; } +/* ECMA-262 3rd Edition 11.8.7 */ HRESULT in_expression_eval(exec_ctx_t *ctx, expression_t *expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) { FIXME("\n"); @@ -1586,24 +2050,78 @@ HRESULT div_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWORD flags, j return binary_expr_eval(ctx, expr, div_eval, ei, ret); } +/* ECMA-262 3rd Edition 11.5.3 */ HRESULT mod_expression_eval(exec_ctx_t *ctx, expression_t *expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) { FIXME("\n"); return E_NOTIMPL; } -HRESULT delete_expression_eval(exec_ctx_t *ctx, expression_t *expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) +/* ECMA-262 3rd Edition 11.4.2 */ +HRESULT delete_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) { - FIXME("\n"); - return E_NOTIMPL; + unary_expression_t *expr = (unary_expression_t*)_expr; + VARIANT_BOOL b = VARIANT_FALSE; + exprval_t exprval; + HRESULT hres; + + TRACE("\n"); + + hres = expr_eval(ctx, expr->expression, EXPR_STRREF, ei, &exprval); + if(FAILED(hres)) + return hres; + + switch(exprval.type) { + case EXPRVAL_NAMEREF: { + IDispatchEx *dispex; + + hres = IDispatch_QueryInterface(exprval.u.nameref.disp, &IID_IDispatchEx, (void**)&dispex); + if(SUCCEEDED(hres)) { + hres = IDispatchEx_DeleteMemberByName(dispex, exprval.u.nameref.name, fdexNameCaseSensitive); + b = VARIANT_TRUE; + IDispatchEx_Release(dispex); + } + break; + } + default: + FIXME("unsupported type %d\n", exprval.type); + hres = E_NOTIMPL; + } + + exprval_release(&exprval); + if(FAILED(hres)) + return hres; + + return return_bool(ret, b); } -HRESULT void_expression_eval(exec_ctx_t *ctx, expression_t *expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) +/* ECMA-262 3rd Edition 11.4.2 */ +HRESULT void_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) { - FIXME("\n"); - return E_NOTIMPL; + unary_expression_t *expr = (unary_expression_t*)_expr; + exprval_t exprval; + VARIANT tmp; + HRESULT hres; + + TRACE("\n"); + + hres = expr_eval(ctx, expr->expression, 0, ei, &exprval); + if(FAILED(hres)) + return hres; + + hres = exprval_to_value(ctx->parser->script, &exprval, ei, &tmp); + exprval_release(&exprval); + if(FAILED(hres)) + return hres; + + VariantClear(&tmp); + + ret->type = EXPRVAL_VARIANT; + V_VT(&ret->u.var) = VT_EMPTY; + return S_OK; } +/* ECMA-262 3rd Edition 11.4.3 */ HRESULT typeof_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) { unary_expression_t *expr = (unary_expression_t*)_expr; @@ -1703,10 +2221,32 @@ HRESULT minus_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWORD flags, return S_OK; } -HRESULT plus_expression_eval(exec_ctx_t *ctx, expression_t *expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) +/* ECMA-262 3rd Edition 11.4.6 */ +HRESULT plus_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) { - FIXME("\n"); - return E_NOTIMPL; + unary_expression_t *expr = (unary_expression_t*)_expr; + exprval_t exprval; + VARIANT val, num; + HRESULT hres; + + TRACE("\n"); + + hres = expr_eval(ctx, expr->expression, EXPR_NEWREF, ei, &exprval); + if(FAILED(hres)) + return hres; + + hres = exprval_to_value(ctx->parser->script, &exprval, ei, &val); + exprval_release(&exprval); + if(FAILED(hres)) + return hres; + + hres = to_number(ctx->parser->script, &val, ei, &num); + if(FAILED(hres)) + return hres; + + ret->type = EXPRVAL_VARIANT; + ret->u.var = num; + return S_OK; } /* ECMA-262 3rd Edition 11.3.1 */ @@ -1847,16 +2387,123 @@ HRESULT pre_decrement_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWOR return S_OK; } -HRESULT new_expression_eval(exec_ctx_t *ctx, expression_t *expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) +/* ECMA-262 3rd Edition 11.9.3 */ +static HRESULT equal_values(exec_ctx_t *ctx, VARIANT *lval, VARIANT *rval, jsexcept_t *ei, BOOL *ret) { - FIXME("\n"); - return E_NOTIMPL; + if(V_VT(lval) == V_VT(rval) || (is_num_vt(V_VT(lval)) && is_num_vt(V_VT(rval)))) + return equal2_values(lval, rval, ret); + + /* FIXME: NULL disps should be handled in more general way */ + if(V_VT(lval) == VT_DISPATCH && !V_DISPATCH(lval)) { + VARIANT v; + V_VT(&v) = VT_NULL; + return equal_values(ctx, &v, rval, ei, ret); + } + + if(V_VT(rval) == VT_DISPATCH && !V_DISPATCH(rval)) { + VARIANT v; + V_VT(&v) = VT_NULL; + return equal_values(ctx, lval, &v, ei, ret); + } + + if((V_VT(lval) == VT_NULL && V_VT(rval) == VT_EMPTY) || + (V_VT(lval) == VT_EMPTY && V_VT(rval) == VT_NULL)) { + *ret = TRUE; + return S_OK; + } + + if(V_VT(lval) == VT_BSTR && is_num_vt(V_VT(rval))) { + VARIANT v; + HRESULT hres; + + hres = to_number(ctx->parser->script, lval, ei, &v); + if(FAILED(hres)) + return hres; + + return equal_values(ctx, &v, rval, ei, ret); + } + + if(V_VT(rval) == VT_BSTR && is_num_vt(V_VT(lval))) { + VARIANT v; + HRESULT hres; + + hres = to_number(ctx->parser->script, rval, ei, &v); + if(FAILED(hres)) + return hres; + + return equal_values(ctx, lval, &v, ei, ret); + } + + if(V_VT(rval) == VT_BOOL) { + VARIANT v; + + V_VT(&v) = VT_I4; + V_I4(&v) = V_BOOL(rval) ? 1 : 0; + return equal_values(ctx, lval, &v, ei, ret); + } + + if(V_VT(lval) == VT_BOOL) { + VARIANT v; + + V_VT(&v) = VT_I4; + V_I4(&v) = V_BOOL(lval) ? 1 : 0; + return equal_values(ctx, &v, rval, ei, ret); + } + + + if(V_VT(rval) == VT_DISPATCH && (V_VT(lval) == VT_BSTR || is_num_vt(V_VT(lval)))) { + VARIANT v; + HRESULT hres; + + hres = to_primitive(ctx->parser->script, rval, ei, &v); + if(FAILED(hres)) + return hres; + + hres = equal_values(ctx, lval, &v, ei, ret); + + VariantClear(&v); + return hres; + } + + + if(V_VT(lval) == VT_DISPATCH && (V_VT(rval) == VT_BSTR || is_num_vt(V_VT(rval)))) { + VARIANT v; + HRESULT hres; + + hres = to_primitive(ctx->parser->script, lval, ei, &v); + if(FAILED(hres)) + return hres; + + hres = equal_values(ctx, &v, rval, ei, ret); + + VariantClear(&v); + return hres; + } + + + *ret = FALSE; + return S_OK; } -HRESULT equal_expression_eval(exec_ctx_t *ctx, expression_t *expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) +/* ECMA-262 3rd Edition 11.9.1 */ +HRESULT equal_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) { - FIXME("\n"); - return E_NOTIMPL; + binary_expression_t *expr = (binary_expression_t*)_expr; + VARIANT rval, lval; + BOOL b; + HRESULT hres; + + TRACE("\n"); + + hres = get_binary_expr_values(ctx, expr, ei, &rval, &lval); + if(FAILED(hres)) + return hres; + + hres = equal_values(ctx, &rval, &lval, ei, &b); + if(FAILED(hres)) + return hres; + + return return_bool(ret, b); } /* ECMA-262 3rd Edition 11.9.4 */ @@ -1880,11 +2527,25 @@ HRESULT equal2_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWORD flags return return_bool(ret, b); } +/* ECMA-262 3rd Edition 11.9.2 */ HRESULT not_equal_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) { + binary_expression_t *expr = (binary_expression_t*)_expr; + VARIANT rval, lval; + BOOL b; + HRESULT hres; - FIXME("\n"); - return E_NOTIMPL; + TRACE("\n"); + + hres = get_binary_expr_values(ctx, expr, ei, &lval, &rval); + if(FAILED(hres)) + return hres; + + hres = equal_values(ctx, &lval, &rval, ei, &b); + if(FAILED(hres)) + return hres; + + return return_bool(ret, !b); } /* ECMA-262 3rd Edition 11.9.5 */ @@ -1897,11 +2558,11 @@ HRESULT not_equal2_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWORD f TRACE("\n"); - hres = get_binary_expr_values(ctx, expr, ei, &rval, &lval); + hres = get_binary_expr_values(ctx, expr, ei, &lval, &rval); if(FAILED(hres)) return hres; - hres = equal2_values(&rval, &lval, &b); + hres = equal2_values(&lval, &rval, &b); if(FAILED(hres)) return hres; @@ -2039,10 +2700,34 @@ HRESULT greatereq_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWORD fl return return_bool(ret, !b); } -HRESULT binary_negation_expression_eval(exec_ctx_t *ctx, expression_t *expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) +/* ECMA-262 3rd Edition 11.4.8 */ +HRESULT binary_negation_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) { - FIXME("\n"); - return E_NOTIMPL; + unary_expression_t *expr = (unary_expression_t*)_expr; + exprval_t exprval; + VARIANT val; + INT i; + HRESULT hres; + + TRACE("\n"); + + hres = expr_eval(ctx, expr->expression, EXPR_NEWREF, ei, &exprval); + if(FAILED(hres)) + return hres; + + hres = exprval_to_value(ctx->parser->script, &exprval, ei, &val); + exprval_release(&exprval); + if(FAILED(hres)) + return hres; + + hres = to_int32(ctx->parser->script, &val, ei, &i); + if(FAILED(hres)) + return hres; + + ret->type = EXPRVAL_VARIANT; + V_VT(&ret->u.var) = VT_I4; + V_I4(&ret->u.var) = ~i; + return S_OK; } /* ECMA-262 3rd Edition 11.4.9 */ @@ -2067,22 +2752,93 @@ HRESULT logical_negation_expression_eval(exec_ctx_t *ctx, expression_t *_expr, D return return_bool(ret, !b); } +/* ECMA-262 3rd Edition 11.7.1 */ +static HRESULT lshift_eval(exec_ctx_t *ctx, VARIANT *lval, VARIANT *rval, jsexcept_t *ei, VARIANT *retv) +{ + DWORD ri; + INT li; + HRESULT hres; + + hres = to_int32(ctx->parser->script, lval, ei, &li); + if(FAILED(hres)) + return hres; + + hres = to_uint32(ctx->parser->script, rval, ei, &ri); + if(FAILED(hres)) + return hres; + + V_VT(retv) = VT_I4; + V_I4(retv) = li << (ri&0x1f); + return S_OK; +} + +/* ECMA-262 3rd Edition 11.7.1 */ HRESULT left_shift_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) { - FIXME("\n"); - return E_NOTIMPL; + binary_expression_t *expr = (binary_expression_t*)_expr; + + TRACE("\n"); + + return binary_expr_eval(ctx, expr, lshift_eval, ei, ret); +} + +/* ECMA-262 3rd Edition 11.7.2 */ +static HRESULT rshift_eval(exec_ctx_t *ctx, VARIANT *lval, VARIANT *rval, jsexcept_t *ei, VARIANT *retv) +{ + DWORD ri; + INT li; + HRESULT hres; + + hres = to_int32(ctx->parser->script, lval, ei, &li); + if(FAILED(hres)) + return hres; + + hres = to_uint32(ctx->parser->script, rval, ei, &ri); + if(FAILED(hres)) + return hres; + + V_VT(retv) = VT_I4; + V_I4(retv) = li >> (ri&0x1f); + return S_OK; } +/* ECMA-262 3rd Edition 11.7.2 */ HRESULT right_shift_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) { - FIXME("\n"); - return E_NOTIMPL; + binary_expression_t *expr = (binary_expression_t*)_expr; + + TRACE("\n"); + + return binary_expr_eval(ctx, expr, rshift_eval, ei, ret); +} + +/* ECMA-262 3rd Edition 11.7.3 */ +static HRESULT rshift2_eval(exec_ctx_t *ctx, VARIANT *lval, VARIANT *rval, jsexcept_t *ei, VARIANT *retv) +{ + DWORD li, ri; + HRESULT hres; + + hres = to_uint32(ctx->parser->script, lval, ei, &li); + if(FAILED(hres)) + return hres; + + hres = to_uint32(ctx->parser->script, rval, ei, &ri); + if(FAILED(hres)) + return hres; + + V_VT(retv) = VT_I4; + V_I4(retv) = li >> (ri&0x1f); + return S_OK; } +/* ECMA-262 3rd Edition 11.7.3 */ HRESULT right2_shift_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) { - FIXME("\n"); - return E_NOTIMPL; + binary_expression_t *expr = (binary_expression_t*)_expr; + + TRACE("\n"); + + return binary_expr_eval(ctx, expr, rshift2_eval, ei, ret); } /* ECMA-262 3rd Edition 11.13.1 */ @@ -2119,22 +2875,34 @@ HRESULT assign_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWORD flags return S_OK; } -HRESULT assign_lshift_expression_eval(exec_ctx_t *ctx, expression_t *expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) +/* ECMA-262 3rd Edition 11.13.2 */ +HRESULT assign_lshift_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) { - FIXME("\n"); - return E_NOTIMPL; + binary_expression_t *expr = (binary_expression_t*)_expr; + + TRACE("\n"); + + return assign_oper_eval(ctx, expr->expression1, expr->expression2, lshift_eval, ei, ret); } -HRESULT assign_rshift_expression_eval(exec_ctx_t *ctx, expression_t *expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) +/* ECMA-262 3rd Edition 11.13.2 */ +HRESULT assign_rshift_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) { - FIXME("\n"); - return E_NOTIMPL; + binary_expression_t *expr = (binary_expression_t*)_expr; + + TRACE("\n"); + + return assign_oper_eval(ctx, expr->expression1, expr->expression2, rshift_eval, ei, ret); } -HRESULT assign_rrshift_expression_eval(exec_ctx_t *ctx, expression_t *expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) +/* ECMA-262 3rd Edition 11.13.2 */ +HRESULT assign_rrshift_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) { - FIXME("\n"); - return E_NOTIMPL; + binary_expression_t *expr = (binary_expression_t*)_expr; + + TRACE("\n"); + + return assign_oper_eval(ctx, expr->expression1, expr->expression2, rshift2_eval, ei, ret); } /* ECMA-262 3rd Edition 11.13.2 */ @@ -2177,26 +2945,39 @@ HRESULT assign_div_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWORD f return assign_oper_eval(ctx, expr->expression1, expr->expression2, div_eval, ei, ret); } +/* ECMA-262 3rd Edition 11.13.2 */ HRESULT assign_mod_expression_eval(exec_ctx_t *ctx, expression_t *expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) { FIXME("\n"); return E_NOTIMPL; } -HRESULT assign_and_expression_eval(exec_ctx_t *ctx, expression_t *expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) +/* ECMA-262 3rd Edition 11.13.2 */ +HRESULT assign_and_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) { - FIXME("\n"); - return E_NOTIMPL; + binary_expression_t *expr = (binary_expression_t*)_expr; + + TRACE("\n"); + + return assign_oper_eval(ctx, expr->expression1, expr->expression2, bitand_eval, ei, ret); } -HRESULT assign_or_expression_eval(exec_ctx_t *ctx, expression_t *expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) +/* ECMA-262 3rd Edition 11.13.2 */ +HRESULT assign_or_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) { - FIXME("\n"); - return E_NOTIMPL; + binary_expression_t *expr = (binary_expression_t*)_expr; + + TRACE("\n"); + + return assign_oper_eval(ctx, expr->expression1, expr->expression2, bitor_eval, ei, ret); } -HRESULT assign_xor_expression_eval(exec_ctx_t *ctx, expression_t *expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) +/* ECMA-262 3rd Edition 11.13.2 */ +HRESULT assign_xor_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) { - FIXME("\n"); - return E_NOTIMPL; + binary_expression_t *expr = (binary_expression_t*)_expr; + + TRACE("\n"); + + return assign_oper_eval(ctx, expr->expression1, expr->expression2, xor_eval, ei, ret); } diff --git a/dlls/jscript/engine.h b/dlls/jscript/engine.h index c37bc243443..3f7fda86c9a 100644 --- a/dlls/jscript/engine.h +++ b/dlls/jscript/engine.h @@ -161,6 +161,7 @@ typedef struct { typedef struct { statement_t stat; + BOOL do_while; expression_t *expr; statement_t *statement; } while_statement_t; @@ -229,7 +230,6 @@ HRESULT var_statement_eval(exec_ctx_t*,statement_t*,return_type_t*,VARIANT*); HRESULT empty_statement_eval(exec_ctx_t*,statement_t*,return_type_t*,VARIANT*); HRESULT expression_statement_eval(exec_ctx_t*,statement_t*,return_type_t*,VARIANT*); HRESULT if_statement_eval(exec_ctx_t*,statement_t*,return_type_t*,VARIANT*); -HRESULT dowhile_statement_eval(exec_ctx_t*,statement_t*,return_type_t*,VARIANT*); HRESULT while_statement_eval(exec_ctx_t*,statement_t*,return_type_t*,VARIANT*); HRESULT for_statement_eval(exec_ctx_t*,statement_t*,return_type_t*,VARIANT*); HRESULT forin_statement_eval(exec_ctx_t*,statement_t*,return_type_t*,VARIANT*); @@ -395,7 +395,6 @@ typedef enum { EXPR_POSTDEC, EXPR_PREINC, EXPR_PREDEC, - EXPR_NEW, EXPR_EQ, EXPR_EQEQ, EXPR_NOTEQ, @@ -427,7 +426,7 @@ HRESULT function_expression_eval(exec_ctx_t*,expression_t*,DWORD,jsexcept_t*,exp HRESULT conditional_expression_eval(exec_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*); HRESULT array_expression_eval(exec_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*); HRESULT member_expression_eval(exec_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*); -HRESULT member_new_expression_eval(exec_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*); +HRESULT new_expression_eval(exec_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*); HRESULT call_expression_eval(exec_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*); HRESULT this_expression_eval(exec_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*); HRESULT identifier_expression_eval(exec_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*); @@ -457,7 +456,6 @@ HRESULT post_increment_expression_eval(exec_ctx_t*,expression_t*,DWORD,jsexcept_ HRESULT post_decrement_expression_eval(exec_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*); HRESULT pre_increment_expression_eval(exec_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*); HRESULT pre_decrement_expression_eval(exec_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*); -HRESULT new_expression_eval(exec_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*); HRESULT equal_expression_eval(exec_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*); HRESULT equal2_expression_eval(exec_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*); HRESULT not_equal_expression_eval(exec_ctx_t*,expression_t*,DWORD,jsexcept_t*,exprval_t*); diff --git a/dlls/jscript/function.c b/dlls/jscript/function.c index 4c07cb3e587..7d39ad05893 100644 --- a/dlls/jscript/function.c +++ b/dlls/jscript/function.c @@ -369,7 +369,21 @@ static const builtin_info_t Function_info = { NULL }; -static HRESULT create_function(script_ctx_t *ctx, DWORD flags, DispatchEx *prototype, FunctionInstance **ret) +static HRESULT FunctionConstr_value(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, + VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) +{ + FIXME("\n"); + return E_NOTIMPL; +} + +static HRESULT FunctionProt_value(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, + VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) +{ + FIXME("\n"); + return E_NOTIMPL; +} + +static HRESULT create_function(script_ctx_t *ctx, DWORD flags, BOOL funcprot, DispatchEx *prototype, FunctionInstance **ret) { FunctionInstance *function; HRESULT hres; @@ -378,7 +392,10 @@ static HRESULT create_function(script_ctx_t *ctx, DWORD flags, DispatchEx *proto if(!function) return E_OUTOFMEMORY; - hres = init_dispex(&function->dispex, ctx, &Function_info, NULL); + if(funcprot) + hres = init_dispex(&function->dispex, ctx, &Function_info, prototype); + else + hres = init_dispex_from_constr(&function->dispex, ctx, &Function_info, ctx->function_constr); if(FAILED(hres)) return hres; @@ -410,7 +427,7 @@ HRESULT create_builtin_function(script_ctx_t *ctx, builtin_invoke_t value_proc, FunctionInstance *function; HRESULT hres; - hres = create_function(ctx, flags, prototype, &function); + hres = create_function(ctx, flags, FALSE, prototype, &function); if(FAILED(hres)) return hres; @@ -433,7 +450,7 @@ HRESULT create_source_function(parser_ctx_t *ctx, parameter_t *parameters, sourc if(FAILED(hres)) return hres; - hres = create_function(ctx->script, PROPF_CONSTR, prototype, &function); + hres = create_function(ctx->script, PROPF_CONSTR, FALSE, prototype, &function); jsdisp_release(prototype); if(FAILED(hres)) return hres; @@ -456,3 +473,24 @@ HRESULT create_source_function(parser_ctx_t *ctx, parameter_t *parameters, sourc *ret = &function->dispex; return S_OK; } + +HRESULT init_function_constr(script_ctx_t *ctx) +{ + FunctionInstance *prot, *constr; + HRESULT hres; + + hres = create_function(ctx, PROPF_CONSTR, TRUE, NULL, &prot); + if(FAILED(hres)) + return hres; + + prot->value_proc = FunctionProt_value; + + hres = create_function(ctx, PROPF_CONSTR, TRUE, &prot->dispex, &constr); + jsdisp_release(&prot->dispex); + if(FAILED(hres)) + return hres; + + constr->value_proc = FunctionConstr_value; + ctx->function_constr = &constr->dispex; + return hres; +} diff --git a/dlls/jscript/global.c b/dlls/jscript/global.c index a347101bfb0..4404bffe8c3 100644 --- a/dlls/jscript/global.c +++ b/dlls/jscript/global.c @@ -17,6 +17,7 @@ */ #include "jscript.h" +#include "engine.h" #include "wine/debug.h" @@ -105,8 +106,9 @@ static HRESULT JSGlobal_Date(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARA static HRESULT JSGlobal_Function(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { - FIXME("\n"); - return E_NOTIMPL; + TRACE("\n"); + + return constructor_call(dispex->ctx->function_constr, lcid, flags, dp, retv, ei, sp); } static HRESULT JSGlobal_Number(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, @@ -169,11 +171,47 @@ static HRESULT JSGlobal_escape(DispatchEx *dispex, LCID lcid, WORD flags, DISPPA return E_NOTIMPL; } +/* ECMA-262 3rd Edition 15.1.2.1 */ static HRESULT JSGlobal_eval(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { - FIXME("\n"); - return E_NOTIMPL; + parser_ctx_t *parser_ctx; + VARIANT *arg; + HRESULT hres; + + TRACE("\n"); + + if(!arg_cnt(dp)) { + if(retv) + V_VT(retv) = VT_EMPTY; + return S_OK; + } + + arg = get_arg(dp, 0); + if(V_VT(arg) != VT_BSTR) { + if(retv) { + V_VT(retv) = VT_EMPTY; + return VariantCopy(retv, arg); + } + return S_OK; + } + + if(!dispex->ctx->exec_ctx) { + FIXME("No active exec_ctx\n"); + return E_UNEXPECTED; + } + + TRACE("parsing %s\n", debugstr_w(V_BSTR(arg))); + hres = script_parse(dispex->ctx, V_BSTR(arg), &parser_ctx); + if(FAILED(hres)) { + FIXME("parse failed: %08x\n", hres); + return hres; + } + + hres = exec_source(dispex->ctx->exec_ctx, parser_ctx, parser_ctx->source, ei, retv); + parser_release(parser_ctx); + + return hres; } static HRESULT JSGlobal_isNaN(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, @@ -274,7 +312,7 @@ static const builtin_prop_t JSGlobal_props[] = { {StringW, JSGlobal_String, PROPF_CONSTR}, {VBArrayW, JSGlobal_VBArray, PROPF_METHOD}, {escapeW, JSGlobal_escape, PROPF_METHOD}, - {evalW, JSGlobal_eval, PROPF_METHOD}, + {evalW, JSGlobal_eval, PROPF_METHOD|1}, {isFiniteW, JSGlobal_isFinite, PROPF_METHOD}, {isNaNW, JSGlobal_isNaN, PROPF_METHOD}, {parseFloatW, JSGlobal_parseFloat, PROPF_METHOD}, @@ -295,6 +333,10 @@ static HRESULT init_constructors(script_ctx_t *ctx) { HRESULT hres; + hres = init_function_constr(ctx); + if(FAILED(hres)) + return hres; + hres = create_array_constr(ctx, &ctx->array_constr); if(FAILED(hres)) return hres; diff --git a/dlls/jscript/jscript.h b/dlls/jscript/jscript.h index 4b384c73db7..6c4e2723b80 100644 --- a/dlls/jscript/jscript.h +++ b/dlls/jscript/jscript.h @@ -140,6 +140,9 @@ HRESULT create_number(script_ctx_t*,VARIANT*,DispatchEx**); HRESULT to_primitive(script_ctx_t*,VARIANT*,jsexcept_t*,VARIANT*); HRESULT to_boolean(VARIANT*,VARIANT_BOOL*); HRESULT to_number(script_ctx_t*,VARIANT*,jsexcept_t*,VARIANT*); +HRESULT to_integer(script_ctx_t*,VARIANT*,jsexcept_t*,VARIANT*); +HRESULT to_int32(script_ctx_t*,VARIANT*,jsexcept_t*,INT*); +HRESULT to_uint32(script_ctx_t*,VARIANT*,jsexcept_t*,DWORD*); HRESULT to_string(script_ctx_t*,VARIANT*,jsexcept_t*,BSTR*); HRESULT to_object(exec_ctx_t*,VARIANT*,IDispatch**); @@ -162,6 +165,7 @@ struct _script_ctx_t { DispatchEx *script_disp; DispatchEx *global; + DispatchEx *function_constr; DispatchEx *array_constr; DispatchEx *bool_constr; DispatchEx *number_constr; @@ -178,6 +182,7 @@ static inline void script_addref(script_ctx_t *ctx) } HRESULT init_global(script_ctx_t*); +HRESULT init_function_constr(script_ctx_t*); HRESULT create_array_constr(script_ctx_t*,DispatchEx**); HRESULT create_bool_constr(script_ctx_t*,DispatchEx**); @@ -203,6 +208,17 @@ static inline DWORD arg_cnt(const DISPPARAMS *dp) return dp->cArgs - dp->cNamedArgs; } +static inline void num_set_val(VARIANT *v, DOUBLE d) +{ + if(d == (DOUBLE)(INT)d) { + V_VT(v) = VT_I4; + V_I4(v) = d; + }else { + V_VT(v) = VT_R8; + V_R8(v) = d; + } +} + const char *debugstr_variant(const VARIANT*); HRESULT WINAPI JScriptFactory_CreateInstance(IClassFactory*,IUnknown*,REFIID,void**); diff --git a/dlls/jscript/jsutils.c b/dlls/jscript/jsutils.c index 616369e6f54..f368c3efcaa 100644 --- a/dlls/jscript/jsutils.c +++ b/dlls/jscript/jsutils.c @@ -16,6 +16,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include + #include "jscript.h" #include "engine.h" @@ -219,10 +221,18 @@ HRESULT to_boolean(VARIANT *v, VARIANT_BOOL *b) HRESULT to_number(script_ctx_t *ctx, VARIANT *v, jsexcept_t *ei, VARIANT *ret) { switch(V_VT(v)) { + case VT_NULL: + V_VT(ret) = VT_I4; + V_I4(ret) = 0; + break; case VT_I4: case VT_R8: *ret = *v; break; + case VT_BOOL: + V_VT(ret) = VT_I4; + V_I4(ret) = V_BOOL(v) ? 1 : 0; + break; default: FIXME("unimplemented for vt %d\n", V_VT(v)); return E_NOTIMPL; @@ -231,19 +241,124 @@ HRESULT to_number(script_ctx_t *ctx, VARIANT *v, jsexcept_t *ei, VARIANT *ret) return S_OK; } +/* ECMA-262 3rd Edition 9.4 */ +HRESULT to_integer(script_ctx_t *ctx, VARIANT *v, jsexcept_t *ei, VARIANT *ret) +{ + VARIANT num; + HRESULT hres; + + hres = to_number(ctx, v, ei, &num); + if(FAILED(hres)) + return hres; + + if(V_VT(&num) == VT_I4) + *ret = *v; + else + num_set_val(ret, V_R8(&num) >= 0.0 ? floor(V_R8(&num)) : -floor(-V_R8(&num))); + + return S_OK; +} + +/* ECMA-262 3rd Edition 9.5 */ +HRESULT to_int32(script_ctx_t *ctx, VARIANT *v, jsexcept_t *ei, INT *ret) +{ + VARIANT num; + HRESULT hres; + + hres = to_number(ctx, v, ei, &num); + if(FAILED(hres)) + return hres; + + *ret = V_VT(&num) == VT_I4 ? V_I4(&num) : (INT)V_R8(&num); + return S_OK; +} + +/* ECMA-262 3rd Edition 9.6 */ +HRESULT to_uint32(script_ctx_t *ctx, VARIANT *v, jsexcept_t *ei, DWORD *ret) +{ + VARIANT num; + HRESULT hres; + + hres = to_number(ctx, v, ei, &num); + if(FAILED(hres)) + return hres; + + *ret = V_VT(&num) == VT_I4 ? V_I4(&num) : (DWORD)V_R8(&num); + return S_OK; +} + +static BSTR int_to_bstr(INT i) +{ + WCHAR buf[12], *p; + BOOL neg = FALSE; + + if(!i) { + static const WCHAR zeroW[] = {'0',0}; + return SysAllocString(zeroW); + } + + if(i < 0) { + neg = TRUE; + i = -i; + } + + p = buf + sizeof(buf)/sizeof(*buf)-1; + *p-- = 0; + while(i) { + *p-- = i%10 + '0'; + i /= 10; + } + + if(neg) + *p = '-'; + else + p++; + + return SysAllocString(p); +} + /* ECMA-262 3rd Edition 9.8 */ HRESULT to_string(script_ctx_t *ctx, VARIANT *v, jsexcept_t *ei, BSTR *str) { + const WCHAR undefinedW[] = {'u','n','d','e','f','i','n','e','d',0}; + const WCHAR nullW[] = {'n','u','l','l',0}; + const WCHAR trueW[] = {'t','r','u','e',0}; + const WCHAR falseW[] = {'f','a','l','s','e',0}; + switch(V_VT(v)) { + case VT_EMPTY: + *str = SysAllocString(undefinedW); + break; + case VT_NULL: + *str = SysAllocString(nullW); + break; + case VT_I4: + *str = int_to_bstr(V_I4(v)); + break; case VT_BSTR: *str = SysAllocString(V_BSTR(v)); - return S_OK; + break; + case VT_DISPATCH: { + VARIANT prim; + HRESULT hres; + hres = to_primitive(ctx, v, ei, &prim); + if(FAILED(hres)) + return hres; + + hres = to_string(ctx, &prim, ei, str); + VariantClear(&prim); + return hres; + } + case VT_BOOL: + *str = SysAllocString(V_BOOL(v) ? trueW : falseW); + break; default: FIXME("unsupported vt %d\n", V_VT(v)); + return E_NOTIMPL; } - return E_NOTIMPL; + return *str ? S_OK : E_OUTOFMEMORY; } /* ECMA-262 3rd Edition 9.9 */ diff --git a/dlls/jscript/parser.y b/dlls/jscript/parser.y index f721a8ed4f9..a6cb5ebf32c 100644 --- a/dlls/jscript/parser.y +++ b/dlls/jscript/parser.y @@ -126,7 +126,7 @@ static expression_t *new_unary_expression(parser_ctx_t*,expression_type_t,expres static expression_t *new_conditional_expression(parser_ctx_t*,expression_t*,expression_t*,expression_t*); static expression_t *new_array_expression(parser_ctx_t*,expression_t*,expression_t*); static expression_t *new_member_expression(parser_ctx_t*,expression_t*,const WCHAR*); -static expression_t *new_member_new_expression(parser_ctx_t*,expression_t*,argument_list_t*); +static expression_t *new_new_expression(parser_ctx_t*,expression_t*,argument_list_t*); static expression_t *new_call_expression(parser_ctx_t*,expression_t*,argument_list_t*); static expression_t *new_this_expression(parser_ctx_t*); static expression_t *new_identifier_expression(parser_ctx_t*,const WCHAR*); @@ -566,27 +566,27 @@ BitwiseORExpressionNoIn BitwiseXORExpression : BitwiseANDExpression { $$ = $1; } | BitwiseXORExpression '^' BitwiseANDExpression - { new_binary_expression(ctx, EXPR_BXOR, $1, $3); } + { $$ = new_binary_expression(ctx, EXPR_BXOR, $1, $3); } /* ECMA-262 3rd Edition 11.10 */ BitwiseXORExpressionNoIn : BitwiseANDExpressionNoIn { $$ = $1; } | BitwiseXORExpressionNoIn '^' BitwiseANDExpressionNoIn - { new_binary_expression(ctx, EXPR_BXOR, $1, $3); } + { $$ = new_binary_expression(ctx, EXPR_BXOR, $1, $3); } /* ECMA-262 3rd Edition 11.10 */ BitwiseANDExpression : EqualityExpression { $$ = $1; } | BitwiseANDExpression '&' EqualityExpression - { new_binary_expression(ctx, EXPR_BAND, $1, $3); } + { $$ = new_binary_expression(ctx, EXPR_BAND, $1, $3); } /* ECMA-262 3rd Edition 11.10 */ BitwiseANDExpressionNoIn : EqualityExpressionNoIn { $$ = $1; } | BitwiseANDExpressionNoIn '&' EqualityExpressionNoIn - { new_binary_expression(ctx, EXPR_BAND, $1, $3); } + { $$ = new_binary_expression(ctx, EXPR_BAND, $1, $3); } /* ECMA-262 3rd Edition 11.9 */ EqualityExpression @@ -676,7 +676,7 @@ LeftHandSideExpression /* ECMA-262 3rd Edition 11.2 */ NewExpression : MemberExpression { $$ = $1; } - | kNEW NewExpression { $$ = new_unary_expression(ctx, EXPR_NEW, $2); } + | kNEW NewExpression { $$ = new_new_expression(ctx, $2, NULL); } /* ECMA-262 3rd Edition 11.2 */ MemberExpression @@ -687,7 +687,7 @@ MemberExpression | MemberExpression '.' tIdentifier { $$ = new_member_expression(ctx, $1, $3); } | kNEW MemberExpression Arguments - { $$ = new_member_new_expression(ctx, $2, $3); } + { $$ = new_new_expression(ctx, $2, $3); } /* ECMA-262 3rd Edition 11.2 */ CallExpression @@ -977,14 +977,14 @@ static case_clausule_t *new_case_block(parser_ctx_t *ctx, case_list_t *case_list if(!ret) return NULL; - for(iter = ret->next; iter->next; iter = iter->next) { - for(iter2 = iter; iter2 && !iter2->expr; iter2 = iter2->next); + for(iter = ret; iter; iter = iter->next) { + for(iter2 = iter; iter2 && !iter2->stat; iter2 = iter2->next); if(!iter2) break; while(iter != iter2) { iter->stat = iter2->stat; - iter2 = iter2->next; + iter = iter->next; } if(stat) { @@ -1086,8 +1086,9 @@ static statement_t *new_while_statement(parser_ctx_t *ctx, BOOL dowhile, express { while_statement_t *ret = parser_alloc(ctx, sizeof(while_statement_t)); - ret->stat.eval = dowhile ? dowhile_statement_eval : while_statement_eval; + ret->stat.eval = while_statement_eval; ret->stat.next = NULL; + ret->do_while = dowhile; ret->expr = expr; ret->statement = stat; @@ -1281,7 +1282,6 @@ static const expression_eval_t expression_eval_table[] = { post_decrement_expression_eval, pre_increment_expression_eval, pre_decrement_expression_eval, - new_expression_eval, equal_expression_eval, equal2_expression_eval, not_equal_expression_eval, @@ -1366,11 +1366,11 @@ static expression_t *new_member_expression(parser_ctx_t *ctx, expression_t *expr return &ret->expr; } -static expression_t *new_member_new_expression(parser_ctx_t *ctx, expression_t *expression, argument_list_t *argument_list) +static expression_t *new_new_expression(parser_ctx_t *ctx, expression_t *expression, argument_list_t *argument_list) { call_expression_t *ret = parser_alloc(ctx, sizeof(call_expression_t)); - ret->expr.eval = member_new_expression_eval; + ret->expr.eval = new_expression_eval; ret->expression = expression; ret->argument_list = argument_list ? argument_list->head : NULL; diff --git a/dlls/jscript/string.c b/dlls/jscript/string.c index b310cabec32..12140d58603 100644 --- a/dlls/jscript/string.c +++ b/dlls/jscript/string.c @@ -70,8 +70,22 @@ static const WCHAR isPrototypeOfW[] = {'i','s','P','r','o','t','o','t','y','p',' static HRESULT String_length(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { - FIXME("\n"); - return E_NOTIMPL; + TRACE("%p\n", dispex); + + switch(flags) { + case DISPATCH_PROPERTYGET: { + StringInstance *jsthis = (StringInstance*)dispex; + + V_VT(retv) = VT_I4; + V_I4(retv) = jsthis->length; + break; + } + default: + FIXME("unimplemented flags %x\n", flags); + return E_NOTIMPL; + } + + return S_OK; } static HRESULT String_toString(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, @@ -116,11 +130,52 @@ static HRESULT String_bold(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS return E_NOTIMPL; } +/* ECMA-262 3rd Edition 15.5.4.5 */ static HRESULT String_charAt(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { - FIXME("\n"); - return E_NOTIMPL; + StringInstance *strobj; + BSTR str; + INT pos = 0; + HRESULT hres; + + TRACE("\n"); + + if(dispex->builtin_info->class != JSCLASS_STRING) { + FIXME("not string this not supported\n"); + return E_NOTIMPL; + } + + strobj = (StringInstance*)dispex; + + if(arg_cnt(dp)) { + VARIANT num; + + hres = to_integer(dispex->ctx, get_arg(dp, 0), ei, &num); + if(FAILED(hres)) + return hres; + + if(V_VT(&num) == VT_I4) { + pos = V_I4(&num); + }else { + WARN("pos = %lf\n", V_R8(&num)); + pos = -1; + } + } + + if(!retv) + return S_OK; + + if(0 <= pos && pos < strobj->length) + str = SysAllocStringLen(strobj->str+pos, 1); + else + str = SysAllocStringLen(NULL, 0); + if(!str) + return E_OUTOFMEMORY; + + V_VT(retv) = VT_BSTR; + V_BSTR(retv) = str; + return S_OK; } static HRESULT String_charCodeAt(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, @@ -186,6 +241,7 @@ static HRESULT String_link(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS return E_NOTIMPL; } +/* ECMA-262 3rd Edition 15.5.4.10 */ static HRESULT String_match(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { diff --git a/dlls/jscript/tests/api.js b/dlls/jscript/tests/api.js index eed48dc2056..45765edf44b 100644 --- a/dlls/jscript/tests/api.js +++ b/dlls/jscript/tests/api.js @@ -16,6 +16,30 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +var tmp; + +ok("".length === 0, "\"\".length = " + "".length); +ok(getVT("".length) == "VT_I4", "\"\".length = " + "".length); +ok("abc".length === 3, "\"abc\".length = " + "abc".length); +ok(String.prototype.length === 0, "String.prototype.length = " + String.prototype.length); + +tmp = "abc".charAt(0); +ok(tmp === "a", "'abc',charAt(0) = " + tmp); +tmp = "abc".charAt(1); +ok(tmp === "b", "'abc',charAt(1) = " + tmp); +tmp = "abc".charAt(2); +ok(tmp === "c", "'abc',charAt(2) = " + tmp); +tmp = "abc".charAt(3); +ok(tmp === "", "'abc',charAt(3) = " + tmp); +tmp = "abc".charAt(4); +ok(tmp === "", "'abc',charAt(4) = " + tmp); +tmp = "abc".charAt(); +ok(tmp === "a", "'abc',charAt() = " + tmp); +tmp = "abc".charAt(-1); +ok(tmp === "", "'abc',charAt(-1) = " + tmp); +tmp = "abc".charAt(0,2); +ok(tmp === "a", "'abc',charAt(0.2) = " + tmp); + var arr = new Array(); ok(typeof(arr) === "object", "arr () is not object"); ok((arr.length === 0), "arr.length is not 0"); diff --git a/dlls/jscript/tests/lang.js b/dlls/jscript/tests/lang.js index bd2cfc935ff..83732a2721b 100644 --- a/dlls/jscript/tests/lang.js +++ b/dlls/jscript/tests/lang.js @@ -37,6 +37,21 @@ ok(!(undefined === null), "!(undefined === null) is false"); ok(1 !== 2, "1 !== 2 is false"); ok(null !== undefined, "null !== undefined is false"); +ok(1 == 1, "1 == 1 is false"); +ok(!(1 == 2), "!(1 == 2) is false"); +ok(1.0 == 1, "1.0 == 1 is false"); +ok("abc" == "abc", "\"abc\" == \"abc\" is false"); +ok(true == true, "true == true is false"); +ok(null == null, "null == null is false"); +ok(undefined == undefined, "undefined == undefined is false"); +ok(undefined == null, "undefined == null is false"); +ok(true == 1, "true == 1 is false"); +ok(!(true == 2), "true == 2"); +ok(0 == false, "0 == false is false"); + +ok(1 != 2, "1 != 2 is false"); +ok(false != 1, "false != 1 is false"); + var trueVar = true; ok(trueVar, "trueVar is not true"); @@ -64,6 +79,12 @@ ok(Number.prototype !== undefined, "Number.prototype is undefined"); ok(RegExp.prototype !== undefined, "RegExp.prototype is undefined"); ok(Math !== undefined, "Math is undefined"); ok(Math.prototype === undefined, "Math.prototype is not undefined"); +ok(Function.prototype !== undefined, "Function.prototype is undefined"); +ok(Function.prototype.prototype === undefined, "Function.prototype is not undefined"); + +Function.prototype.test = true; +ok(testFunc1.test === true, "testFunc1.test !== true"); +ok(Function.test === true, "Function.test !== true"); ok(typeof(0) === "number", "typeof(0) is not number"); ok(typeof(1.5) === "number", "typeof(1.5) is not number"); @@ -118,6 +139,9 @@ obj2.pvar = 3; testConstr1.prototype.pvar = 1; ok(obj2.pvar === 3, "obj2.pvar is not 3"); +var obj3 = new Object; +ok(typeof(obj3) === "object", "typeof(obj3) is not object"); + tmp = 0; if(true) tmp = 1; @@ -228,6 +252,15 @@ tmp = 5; ok((tmp /= 2) === 2.5, "tmp /= 2 !== 2.5"); ok(tmp === 2.5, "tmp !=== 2.5"); +tmp = 8; +ok((tmp <<= 1) === 16, "tmp <<= 1 !== 16"); + +tmp = 8; +ok((tmp >>= 1) === 4, "tmp >>= 1 !== 4"); + +tmp = 8; +ok((tmp >>>= 1) === 4, "tmp >>>= 1 !== 4"); + tmp = 3 || ok(false, "second or expression called"); ok(tmp === 3, "3 || (...) is not 3"); @@ -243,6 +276,83 @@ ok(tmp === "test", "true && \"test\" is not \"test\""); tmp = true && 0; ok(tmp === 0, "true && 0 is not 0"); +tmp = 3 | 4; +ok(tmp === 7, "3 | 4 !== 7"); +ok(getVT(tmp) === "VT_I4", "getVT(3|4) = " + getVT(tmp)); + +tmp = 3.5 | 0; +ok(tmp === 3, "3.5 | 0 !== 3"); +ok(getVT(tmp) === "VT_I4", "getVT(3.5|0) = " + getVT(tmp)); + +tmp = -3.5 | 0; +ok(tmp === -3, "-3.5 | 0 !== -3"); +ok(getVT(tmp) === "VT_I4", "getVT(3.5|0) = " + getVT(tmp)); + +tmp = 10; +ok((tmp |= 0x10) === 26, "tmp(10) |= 0x10 !== 26"); +ok(getVT(tmp) === "VT_I4", "getVT(tmp |= 10) = " + getVT(tmp)); + +tmp = 3 & 5; +ok(tmp === 1, "3 & 5 !== 1"); +ok(getVT(tmp) === "VT_I4", "getVT(3|5) = " + getVT(tmp)); + +tmp = 3.5 & 0xffff; +ok(tmp === 3, "3.5 & 0xffff !== 3 "); +ok(getVT(tmp) === "VT_I4", "getVT(3.5&0xffff) = " + getVT(tmp)); + +tmp = (-3.5) & 0xffffffff; +ok(tmp === -3, "-3.5 & 0xffff !== -3"); +ok(getVT(tmp) === "VT_I4", "getVT(3.5&0xffff) = " + getVT(tmp)); + +tmp = 2 << 3; +ok(tmp === 16, "2 << 3 = " + tmp); + +tmp = 2 << 35; +ok(tmp === 16, "2 << 35 = " + tmp); + +tmp = 8 >> 2; +ok(tmp === 2, "8 >> 2 = " + tmp); + +tmp = -64 >> 4; +ok(tmp === -4, "-64 >> 4 = " + tmp); + +tmp = 8 >>> 2; +ok(tmp === 2, "8 >> 2 = " + tmp); + +tmp = -64 >>> 4; +ok(tmp === 0x0ffffffc, "-64 >>> 4 = " + tmp); + +tmp = 10; +ok((tmp &= 8) === 8, "tmp(10) &= 8 !== 8"); +ok(getVT(tmp) === "VT_I4", "getVT(tmp &= 8) = " + getVT(tmp)); + +tmp = 0xf0f0^0xff00; +ok(tmp === 0x0ff0, "0xf0f0^0xff00 !== 0x0ff0"); +ok(getVT(tmp) === "VT_I4", "getVT(0xf0f0^0xff00) = " + getVT(tmp)); + +tmp = 5; +ok((tmp ^= 3) === 6, "tmp(5) ^= 3 !== 6"); +ok(getVT(tmp) === "VT_I4", "getVT(tmp ^= 3) = " + getVT(tmp)); + +tmp = ~1; +ok(tmp === -2, "~1 !== -2"); +ok(getVT(tmp) === "VT_I4", "getVT(~1) = " + getVT(tmp)); + +ok((3,4) === 4, "(3,4) !== 4"); + +ok(+3 === 3, "+3 !== 3"); +ok(+true === 1, "+true !== 1"); +ok(+false === 0, "+false !== 0"); +ok(+null === 0, "+null !== 0"); + +ok("" + 0 === "0", "\"\" + 0 !== \"0\""); +ok("" + 123 === "123", "\"\" + 123 !== \"123\""); +ok("" + (-5) === "-5", "\"\" + (-5) !== \"-5\""); +ok("" + null === "null", "\"\" + null !== \"null\""); +ok("" + undefined === "undefined", "\"\" + undefined !== \"undefined\""); +ok("" + true === "true", "\"\" + true !== \"true\""); +ok("" + false === "false", "\"\" + false !== \"false\""); + ok(1 < 3.4, "1 < 3.4 failed"); ok(!(3.4 < 1), "3.4 < 1"); ok("abc" < "abcd", "abc < abcd failed"); @@ -398,4 +508,194 @@ try { } ok(state === "finally", "state = " + state + " expected finally"); +state = ""; +switch(1) { +case "1": + ok(false, "unexpected case \"1\""); +case 1: + ok(state === "", "case 1: state = " + state); + state = "1"; +default: + ok(state === "1", "default: state = " + state); + state = "default"; +case false: + ok(state === "default", "case false: state = " + state); + state = "false"; +} +ok(state === "false", "state = " + state); + +state = ""; +switch("") { +case "1": +case 1: + ok(false, "unexpected case 1"); +default: + ok(state === "", "default: state = " + state); + state = "default"; +case false: + ok(state === "default", "case false: state = " + state); + state = "false"; +} +ok(state === "false", "state = " + state); + +state = ""; +switch(1) { +case "1": + ok(false, "unexpected case \"1\""); +case 1: + ok(state === "", "case 1: state = " + state); + state = "1"; +default: + ok(state === "1", "default: state = " + state); + state = "default"; + break; +case false: + ok(false, "unexpected case false"); +} +ok(state === "default", "state = " + state); + +tmp = eval("1"); +ok(tmp === 1, "eval(\"1\") !== 1"); +eval("{ ok(tmp === 1, 'eval: tmp !== 1'); } tmp = 2;"); +ok(tmp === 2, "tmp !== 2"); + +ok(eval(false) === false, "eval(false) !== false"); +ok(eval() === undefined, "eval() !== undefined"); + +tmp = eval("1", "2"); +ok(tmp === 1, "eval(\"1\", \"2\") !== 1"); + +var state = ""; +try { + ok(state === "", "try: state = " + state); + state = "try"; + eval("throwFunc(true);"); +}catch(ex) { + ok(state === "try", "catch: state = " + state); + ok(ex === true, "ex is not true"); + state = "catch"; +}finally { + ok(state === "catch", "funally: state = " + state); + state = "finally"; +} +ok(state === "finally", "state = " + state + " expected finally"); + +tmp = [,,1,2,,,true]; +ok(tmp.length === 7, "tmp.length !== 7"); +ok(tmp["0"] === undefined, "tmp[0] is not undefined"); +ok(tmp["3"] === 2, "tmp[3] !== 2"); +ok(tmp["6"] === true, "tmp[6] !== true"); +ok(tmp[2] === 1, "tmp[2] !== 1"); + +tmp = 0; +while(tmp < 4) { + ok(tmp < 4, "tmp >= 4"); + tmp++; +} +ok(tmp === 4, "tmp !== 4"); + +tmp = 0; +while(true) { + ok(tmp < 4, "tmp >= 4"); + tmp++; + if(tmp === 4) { + break; + ok(false, "break did not break"); + } +} +ok(tmp === 4, "tmp !== 4"); + +tmp = 0; +do { + ok(tmp < 4, "tmp >= 4"); + tmp++; +} while(tmp < 4); +ok(tmp === 4, "tmp !== 4"); + +tmp = 0; +do { + ok(tmp === 0, "tmp !=== 0"); + tmp++; +} while(false); +ok(tmp === 1, "tmp !== 4"); + +tmp = 0; +while(tmp < 4) { + tmp++; + if(tmp === 2) { + continue; + ok(false, "break did not break"); + } + ok(tmp <= 4 && tmp != 2, "tmp = " + tmp); +} +ok(tmp === 4, "tmp !== 4"); + +for(tmp=0; tmp < 4; tmp++) + ok(tmp < 4, "tmp = " + tmp); +ok(tmp === 4, "tmp !== 4"); + +for(tmp=0; tmp < 4; tmp++) { + if(tmp === 2) + break; + ok(tmp < 2, "tmp = " + tmp); +} +ok(tmp === 2, "tmp !== 2"); + +for(tmp=0; tmp < 4; tmp++) { + if(tmp === 2) + continue; + ok(tmp < 4 && tmp != 2, "tmp = " + tmp); +} +ok(tmp === 4, "tmp !== 4"); + +for(var fi=0; fi < 4; fi++) + ok(fi < 4, "fi = " + fi); +ok(fi === 4, "fi !== 4"); + +ok((void 1) === undefined, "(void 1) !== undefined"); + +var inobj = new Object(); + +for(var iter in inobj) + ok(false, "unexpected iter = " + iter); + +inobj.test = true; +tmp = 0; +for(iter in inobj) { + ok(iter == "test", "unexpected iter = " + iter); + tmp++; +} +ok(tmp === 1, "for..in tmp = " + tmp); + +function forinTestObj() {} + +forinTestObj.prototype.test3 = true; + +var arr = new Array(); +inobj = new forinTestObj(); +inobj.test1 = true; +inobj.test2 = true; + +tmp = 0; +for(iter in inobj) { + arr[iter] = true; + tmp++; +} + +ok(tmp === 3, "for..in tmp = " + tmp); +ok(arr["test1"] === true, "arr[test1] !== true"); +ok(arr["test2"] === true, "arr[test2] !== true"); +ok(arr["test3"] === true, "arr[test3] !== true"); + +tmp = new Object(); +tmp.test = false; +ok((delete tmp.test) === true, "delete returned false"); +ok(typeof(tmp.test) === "undefined", "tmp.test type = " + typeof(tmp.test)); +for(iter in tmp) + ok(false, "tmp has prop " + iter); + +tmp.testWith = true; +with(tmp) + ok(testWith === true, "testWith !== true"); + reportSuccess(); diff --git a/dlls/jscript/tests/run.c b/dlls/jscript/tests/run.c index 1b40237cc23..c40653a9b29 100644 --- a/dlls/jscript/tests/run.c +++ b/dlls/jscript/tests/run.c @@ -63,6 +63,7 @@ DEFINE_EXPECT(global_propput_d); DEFINE_EXPECT(global_propput_i); DEFINE_EXPECT(global_success_d); DEFINE_EXPECT(global_success_i); +DEFINE_EXPECT(testobj_delete); #define DISPID_GLOBAL_TESTPROPGET 0x1000 #define DISPID_GLOBAL_TESTPROPPUT 0x1001 @@ -70,6 +71,7 @@ DEFINE_EXPECT(global_success_i); #define DISPID_GLOBAL_TRACE 0x1003 #define DISPID_GLOBAL_OK 0x1004 #define DISPID_GLOBAL_GETVT 0x1005 +#define DISPID_GLOBAL_TESTOBJ 0x1006 static const WCHAR testW[] = {'t','e','s','t',0}; @@ -195,6 +197,48 @@ static HRESULT WINAPI DispatchEx_GetNameSpaceParent(IDispatchEx *iface, IUnknown return E_NOTIMPL; } +static HRESULT WINAPI DispatchEx_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp, + VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI testObj_DeleteMemberByName(IDispatchEx *iface, BSTR bstrName, DWORD grfdex) +{ + CHECK_EXPECT(testobj_delete); + + ok(!strcmp_wa(bstrName, "deleteTest"), "unexpected name %s\n", debugstr_w(bstrName)); + ok(grfdex == fdexNameCaseSensitive, "grfdex = %x\n", grfdex); + return S_OK; +} + +static IDispatchExVtbl testObjVtbl = { + DispatchEx_QueryInterface, + DispatchEx_AddRef, + DispatchEx_Release, + DispatchEx_GetTypeInfoCount, + DispatchEx_GetTypeInfo, + DispatchEx_GetIDsOfNames, + DispatchEx_Invoke, + DispatchEx_GetDispID, + DispatchEx_InvokeEx, + testObj_DeleteMemberByName, + DispatchEx_DeleteMemberByDispID, + DispatchEx_GetMemberProperties, + DispatchEx_GetMemberName, + DispatchEx_GetNextDispID, + DispatchEx_GetNameSpaceParent +}; + +static IDispatchEx testObj = { &testObjVtbl }; + static HRESULT WINAPI Global_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid) { if(!strcmp_wa(bstrName, "ok")) { @@ -230,6 +274,11 @@ static HRESULT WINAPI Global_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD *pid = DISPID_GLOBAL_GETVT; return S_OK; } + if(!strcmp_wa(bstrName, "testObj")) { + ok(grfdex == fdexNameCaseSensitive, "grfdex = %x\n", grfdex); + *pid = DISPID_GLOBAL_TESTOBJ; + return S_OK; + } if(strict_dispid_check) ok(0, "unexpected call %s\n", debugstr_w(bstrName)); @@ -241,13 +290,16 @@ static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, { switch(id) { case DISPID_GLOBAL_OK: - ok(wFlags == INVOKE_FUNC, "wFlags = %x\n", wFlags); + ok(wFlags == INVOKE_FUNC || wFlags == (INVOKE_FUNC|INVOKE_PROPERTYGET), "wFlags = %x\n", wFlags); ok(pdp != NULL, "pdp == NULL\n"); ok(pdp->rgvarg != NULL, "rgvarg == NULL\n"); ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n"); ok(pdp->cArgs == 2, "cArgs = %d\n", pdp->cArgs); ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs); - ok(!pvarRes, "pvarRes != NULL\n"); + if(wFlags & INVOKE_PROPERTYGET) + ok(pvarRes != NULL, "pvarRes == NULL\n"); + else + ok(!pvarRes, "pvarRes != NULL\n"); ok(pei != NULL, "pei == NULL\n"); ok(V_VT(pdp->rgvarg) == VT_BSTR, "V_VT(psp->rgvargs) = %d\n", V_VT(pdp->rgvarg)); @@ -358,7 +410,22 @@ static HRESULT WINAPI Global_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, } return S_OK; - } + + case DISPID_GLOBAL_TESTOBJ: + ok(wFlags == INVOKE_PROPERTYGET, "wFlags = %x\n", wFlags); + ok(pdp != NULL, "pdp == NULL\n"); + ok(!pdp->rgvarg, "rgvarg != NULL\n"); + ok(!pdp->rgdispidNamedArgs, "rgdispidNamedArgs != NULL\n"); + ok(!pdp->cArgs, "cArgs = %d\n", pdp->cArgs); + ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs); + ok(pvarRes != NULL, "pvarRes == NULL\n"); + ok(V_VT(pvarRes) == VT_EMPTY, "V_VT(pvarRes) = %d\n", V_VT(pvarRes)); + ok(pei != NULL, "pei == NULL\n"); + + V_VT(pvarRes) = VT_DISPATCH; + V_DISPATCH(pvarRes) = (IDispatch*)&testObj; + return S_OK; + } ok(0, "unexpected call %x\n", id); return DISP_E_MEMBERNOTFOUND; @@ -581,6 +648,10 @@ static void run_tests(void) CHECK_CALLED(global_success_d); CHECK_CALLED(global_success_i); + SET_EXPECT(testobj_delete); + parse_script_a("delete testObj.deleteTest;"); + CHECK_CALLED(testobj_delete); + run_from_res("lang.js"); run_from_res("api.js"); run_from_res("regexp.js"); diff --git a/dlls/kernel32/file.c b/dlls/kernel32/file.c index a8b6d308ce1..adbc69d1984 100644 --- a/dlls/kernel32/file.c +++ b/dlls/kernel32/file.c @@ -3,6 +3,7 @@ * * Copyright 1993 John Burton * Copyright 1996, 2004 Alexandre Julliard + * Copyright 2008 Jeff Zaroyko * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -1528,6 +1529,8 @@ BOOL WINAPI DeleteFileW( LPCWSTR path ) UNICODE_STRING nameW; OBJECT_ATTRIBUTES attr; NTSTATUS status; + HANDLE hFile; + IO_STATUS_BLOCK io; TRACE("%s\n", debugstr_w(path) ); @@ -1544,7 +1547,12 @@ BOOL WINAPI DeleteFileW( LPCWSTR path ) attr.SecurityDescriptor = NULL; attr.SecurityQualityOfService = NULL; - status = NtDeleteFile(&attr); + status = NtCreateFile(&hFile, GENERIC_READ | GENERIC_WRITE | DELETE, + &attr, &io, NULL, 0, + FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, + FILE_OPEN, FILE_DELETE_ON_CLOSE | FILE_NON_DIRECTORY_FILE, NULL, 0); + if (status == STATUS_SUCCESS) status = NtClose(hFile); + RtlFreeUnicodeString( &nameW ); if (status) { diff --git a/dlls/kernel32/tests/file.c b/dlls/kernel32/tests/file.c index 06f4caa221e..1686a4a82c9 100644 --- a/dlls/kernel32/tests/file.c +++ b/dlls/kernel32/tests/file.c @@ -871,9 +871,9 @@ static void test_DeleteFileW( void ) ret = CreateDirectoryW(pathW, NULL); ok(ret == TRUE, "couldn't create directory deletefile\n"); ret = DeleteFileW(pathW); - todo_wine ok(ret == FALSE, "DeleteFile should fail for empty directories\n"); + ok(ret == FALSE, "DeleteFile should fail for empty directories\n"); ret = RemoveDirectoryW(pathW); - todo_wine ok(ret == TRUE, "expected to remove directory deletefile\n"); + ok(ret == TRUE, "expected to remove directory deletefile\n"); /* test DeleteFile on non-empty directory */ ret = CreateDirectoryW(pathW, NULL); @@ -881,7 +881,7 @@ static void test_DeleteFileW( void ) ret = CreateDirectoryW(pathsubW, NULL); ok(ret == TRUE, "couldn't create directory deletefile\\sub\n"); ret = DeleteFileW(pathW); - todo_wine ok(ret == FALSE, "DeleteFile should fail for non-empty directories\n"); + ok(ret == FALSE, "DeleteFile should fail for non-empty directories\n"); ret = RemoveDirectoryW(pathsubW); ok(ret == TRUE, "expected to remove directory deletefile\\sub\n"); ret = RemoveDirectoryW(pathW); diff --git a/dlls/kernel32/tests/module.c b/dlls/kernel32/tests/module.c index 1fce13c5fe3..b076a6702a1 100644 --- a/dlls/kernel32/tests/module.c +++ b/dlls/kernel32/tests/module.c @@ -328,7 +328,8 @@ static void testLoadLibraryEx(void) { ok(hmodule == 0, "Expected 0, got %p\n", hmodule); } - ok(GetLastError() == ERROR_FILE_NOT_FOUND, + ok(GetLastError() == ERROR_FILE_NOT_FOUND || + broken(GetLastError() == ERROR_INVALID_HANDLE), /* nt4 */ "Expected ERROR_FILE_NOT_FOUND, got %d\n", GetLastError()); } diff --git a/dlls/kernel32/tests/thread.c b/dlls/kernel32/tests/thread.c index ff9dad28100..649c49c09d0 100644 --- a/dlls/kernel32/tests/thread.c +++ b/dlls/kernel32/tests/thread.c @@ -104,13 +104,15 @@ CreateThread certain chunks of code at a time, and we know which one is executing it. It basically makes multithreaded execution linear, which defeats the purpose of multiple threads, but makes testing easy. */ -static HANDLE all_synced; +static HANDLE start_event, stop_event; static LONG num_syncing_threads, num_synced; static void init_thread_sync_helpers(LONG num_threads) { - all_synced = CreateEvent(NULL, FALSE, FALSE, NULL); - ok(all_synced != NULL, "CreateEvent failed\n"); + start_event = CreateEvent(NULL, TRUE, FALSE, NULL); + ok(start_event != NULL, "CreateEvent failed\n"); + stop_event = CreateEvent(NULL, TRUE, FALSE, NULL); + ok(stop_event != NULL, "CreateEvent failed\n"); num_syncing_threads = num_threads; num_synced = 0; } @@ -120,13 +122,13 @@ static BOOL sync_threads_and_run_one(DWORD sync_id, DWORD my_id) LONG num = InterlockedIncrement(&num_synced); assert(0 < num && num <= num_syncing_threads); if (num == num_syncing_threads) - /* FIXME: MSDN claims PulseEvent is unreliable. For a test this isn't - so important, but we could use condition variables with more effort. - The given approach is clearer, though. */ - PulseEvent(all_synced); + { + ResetEvent( stop_event ); + SetEvent( start_event ); + } else { - DWORD ret = WaitForSingleObject(all_synced, 60000); + DWORD ret = WaitForSingleObject(start_event, 10000); ok(ret == WAIT_OBJECT_0, "WaitForSingleObject failed\n"); } return sync_id == my_id; @@ -137,18 +139,21 @@ static void resync_after_run(void) LONG num = InterlockedDecrement(&num_synced); assert(0 <= num && num < num_syncing_threads); if (num == 0) - PulseEvent(all_synced); + { + ResetEvent( start_event ); + SetEvent( stop_event ); + } else { - DWORD ret = WaitForSingleObject(all_synced, 60000); + DWORD ret = WaitForSingleObject(stop_event, 10000); ok(ret == WAIT_OBJECT_0, "WaitForSingleObject failed\n"); } } static void cleanup_thread_sync_helpers(void) { - CloseHandle(all_synced); - all_synced = NULL; + CloseHandle(start_event); + CloseHandle(stop_event); } DWORD tlsIndex; diff --git a/dlls/kernel32/tests/version.c b/dlls/kernel32/tests/version.c index 1a9a40c0c14..d051b5d875b 100644 --- a/dlls/kernel32/tests/version.c +++ b/dlls/kernel32/tests/version.c @@ -165,7 +165,8 @@ static void test_VerifyVersionInfo(void) VER_MAJORVERSION, VER_GREATER_EQUAL)); if (servicepack == 0) { - ok(!ret, "VerifyVersionInfoA should have failed\n"); + ok(!ret || broken(ret), /* win2k3 */ + "VerifyVersionInfoA should have failed\n"); ok(GetLastError() == ERROR_OLD_WIN_VERSION, "Expected ERROR_OLD_WIN_VERSION instead of %d\n", GetLastError()); } diff --git a/dlls/kernel32/tests/virtual.c b/dlls/kernel32/tests/virtual.c index 3da3bce15d8..76d74f744d2 100644 --- a/dlls/kernel32/tests/virtual.c +++ b/dlls/kernel32/tests/virtual.c @@ -270,6 +270,7 @@ static void test_VirtualAlloc(void) static void test_MapViewOfFile(void) { static const char testfile[] = "testfile.xxx"; + const char *name; HANDLE file, mapping; void *ptr, *ptr2; MEMORY_BASIC_INFORMATION info; @@ -450,11 +451,18 @@ static void test_MapViewOfFile(void) DeleteFileA( testfile ); SetLastError(0xdeadbeef); - file = CreateFileMapping( INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, 4096, "Local\\Foo"); + name = "Local\\Foo"; + file = CreateFileMapping( INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, 4096, name ); + /* nt4 doesn't have Local\\ */ + if (!file && GetLastError() == ERROR_PATH_NOT_FOUND) + { + name = "Foo"; + file = CreateFileMapping( INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, 4096, name ); + } ok( file != 0, "CreateFileMapping PAGE_READWRITE error %u\n", GetLastError() ); SetLastError(0xdeadbeef); - mapping = OpenFileMapping( FILE_MAP_READ, FALSE, "Local\\Foo" ); + mapping = OpenFileMapping( FILE_MAP_READ, FALSE, name ); ok( mapping != 0, "OpenFileMapping FILE_MAP_READ error %u\n", GetLastError() ); SetLastError(0xdeadbeef); ptr = MapViewOfFile( mapping, FILE_MAP_WRITE, 0, 0, 0 ); @@ -476,7 +484,7 @@ todo_wine ok( info.Protect == PAGE_READONLY, "%x != PAGE_READONLY\n", info.Prote CloseHandle( mapping ); SetLastError(0xdeadbeef); - mapping = OpenFileMapping( FILE_MAP_WRITE, FALSE, "Local\\Foo" ); + mapping = OpenFileMapping( FILE_MAP_WRITE, FALSE, name ); ok( mapping != 0, "OpenFileMapping FILE_MAP_WRITE error %u\n", GetLastError() ); SetLastError(0xdeadbeef); ptr = MapViewOfFile( mapping, FILE_MAP_READ, 0, 0, 0 ); diff --git a/dlls/localspl/localspl_main.c b/dlls/localspl/localspl_main.c index a6a798055c9..80e84243cc6 100644 --- a/dlls/localspl/localspl_main.c +++ b/dlls/localspl/localspl_main.c @@ -40,6 +40,17 @@ WINE_DEFAULT_DEBUG_CHANNEL(localspl); /* ############################### */ +static CRITICAL_SECTION monitor_handles_cs; +static CRITICAL_SECTION_DEBUG monitor_handles_cs_debug = +{ + 0, 0, &monitor_handles_cs, + { &monitor_handles_cs_debug.ProcessLocksList, &monitor_handles_cs_debug.ProcessLocksList }, + 0, 0, { (DWORD_PTR)(__FILE__ ": monitor_handles_cs") } +}; +static CRITICAL_SECTION monitor_handles_cs = { &monitor_handles_cs_debug, -1, 0, 0, 0, 0 }; + +/* ############################### */ + typedef struct { WCHAR src[MAX_PATH+MAX_PATH]; WCHAR dst[MAX_PATH+MAX_PATH]; @@ -71,6 +82,9 @@ typedef struct { /* ############################### */ +static struct list monitor_handles = LIST_INIT( monitor_handles ); +static monitor_t * pm_localport; + HINSTANCE LOCALSPL_hInstance = NULL; static const PRINTPROVIDOR * pp = NULL; @@ -91,6 +105,7 @@ static const WCHAR fmt_driversW[] = { 'S','y','s','t','e','m','\\', '%','s','\\','D','r','i','v','e','r','s','%','s',0 }; static const WCHAR hardwareidW[] = {'H','a','r','d','w','a','r','e','I','D',0}; static const WCHAR help_fileW[] = {'H','e','l','p',' ','F','i','l','e',0}; +static const WCHAR localportW[] = {'L','o','c','a','l',' ','P','o','r','t',0}; static const WCHAR locationW[] = {'L','o','c','a','t','i','o','n',0}; static const WCHAR manufacturerW[] = {'M','a','n','u','f','a','c','t','u','r','e','r',0}; static const WCHAR monitorW[] = {'M','o','n','i','t','o','r',0}; @@ -135,6 +150,25 @@ static const DWORD di_sizeof[] = {0, sizeof(DRIVER_INFO_1W), sizeof(DRIVER_INFO_ /****************************************************************** + * strdupW [internal] + * + * create a copy of a unicode-string + * + */ + +static LPWSTR strdupW(LPCWSTR p) +{ + LPWSTR ret; + DWORD len; + + if(!p) return NULL; + len = (lstrlenW(p) + 1) * sizeof(WCHAR); + ret = heap_alloc(len); + memcpy(ret, p, len); + return ret; +} + +/****************************************************************** * apd_copyfile [internal] * * Copy a file from the driverdirectory to the versioned directory @@ -237,6 +271,190 @@ static LONG copy_servername_from_name(LPCWSTR name, LPWSTR target) } /****************************************************************** + * monitor_unload [internal] + * + * release a printmonitor and unload it from memory, when needed + * + */ +static void monitor_unload(monitor_t * pm) +{ + if (pm == NULL) return; + TRACE("%p (refcount: %d) %s\n", pm, pm->refcount, debugstr_w(pm->name)); + + EnterCriticalSection(&monitor_handles_cs); + + if (pm->refcount) pm->refcount--; + + if (pm->refcount == 0) { + list_remove(&pm->entry); + FreeLibrary(pm->hdll); + heap_free(pm->name); + heap_free(pm->dllname); + heap_free(pm); + } + LeaveCriticalSection(&monitor_handles_cs); +} + +/****************************************************************** + * monitor_load [internal] + * + * load a printmonitor, get the dllname from the registry, when needed + * initialize the monitor and dump found function-pointers + * + * On failure, SetLastError() is called and NULL is returned + */ + +static monitor_t * monitor_load(LPCWSTR name, LPWSTR dllname) +{ + LPMONITOR2 (WINAPI *pInitializePrintMonitor2) (PMONITORINIT, LPHANDLE); + PMONITORUI (WINAPI *pInitializePrintMonitorUI)(VOID); + LPMONITOREX (WINAPI *pInitializePrintMonitor) (LPWSTR); + DWORD (WINAPI *pInitializeMonitorEx)(LPWSTR, LPMONITOR); + DWORD (WINAPI *pInitializeMonitor) (LPWSTR); + + monitor_t * pm = NULL; + monitor_t * cursor; + LPWSTR regroot = NULL; + LPWSTR driver = dllname; + + TRACE("(%s, %s)\n", debugstr_w(name), debugstr_w(dllname)); + /* Is the Monitor already loaded? */ + EnterCriticalSection(&monitor_handles_cs); + + if (name) { + LIST_FOR_EACH_ENTRY(cursor, &monitor_handles, monitor_t, entry) + { + if (cursor->name && (lstrcmpW(name, cursor->name) == 0)) { + pm = cursor; + break; + } + } + } + + if (pm == NULL) { + pm = heap_alloc_zero(sizeof(monitor_t)); + if (pm == NULL) goto cleanup; + list_add_tail(&monitor_handles, &pm->entry); + } + pm->refcount++; + + if (pm->name == NULL) { + /* Load the monitor */ + LPMONITOREX pmonitorEx; + DWORD len; + + if (name) { + len = lstrlenW(monitorsW) + lstrlenW(name) + 2; + regroot = heap_alloc(len * sizeof(WCHAR)); + } + + if (regroot) { + lstrcpyW(regroot, monitorsW); + lstrcatW(regroot, name); + /* Get the Driver from the Registry */ + if (driver == NULL) { + HKEY hroot; + DWORD namesize; + if (RegOpenKeyW(HKEY_LOCAL_MACHINE, regroot, &hroot) == ERROR_SUCCESS) { + if (RegQueryValueExW(hroot, driverW, NULL, NULL, NULL, + &namesize) == ERROR_SUCCESS) { + driver = heap_alloc(namesize); + RegQueryValueExW(hroot, driverW, NULL, NULL, (LPBYTE) driver, &namesize) ; + } + RegCloseKey(hroot); + } + } + } + + pm->name = strdupW(name); + pm->dllname = strdupW(driver); + + if ((name && (!regroot || !pm->name)) || !pm->dllname) { + monitor_unload(pm); + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + pm = NULL; + goto cleanup; + } + + pm->hdll = LoadLibraryW(driver); + TRACE("%p: LoadLibrary(%s) => %d\n", pm->hdll, debugstr_w(driver), GetLastError()); + + if (pm->hdll == NULL) { + monitor_unload(pm); + SetLastError(ERROR_MOD_NOT_FOUND); + pm = NULL; + goto cleanup; + } + + pInitializePrintMonitor2 = (void *)GetProcAddress(pm->hdll, "InitializePrintMonitor2"); + pInitializePrintMonitorUI = (void *)GetProcAddress(pm->hdll, "InitializePrintMonitorUI"); + pInitializePrintMonitor = (void *)GetProcAddress(pm->hdll, "InitializePrintMonitor"); + pInitializeMonitorEx = (void *)GetProcAddress(pm->hdll, "InitializeMonitorEx"); + pInitializeMonitor = (void *)GetProcAddress(pm->hdll, "InitializeMonitor"); + + + TRACE("%p: %s,pInitializePrintMonitor2\n", pInitializePrintMonitor2, debugstr_w(driver)); + TRACE("%p: %s,pInitializePrintMonitorUI\n", pInitializePrintMonitorUI, debugstr_w(driver)); + TRACE("%p: %s,pInitializePrintMonitor\n", pInitializePrintMonitor, debugstr_w(driver)); + TRACE("%p: %s,pInitializeMonitorEx\n", pInitializeMonitorEx, debugstr_w(driver)); + TRACE("%p: %s,pInitializeMonitor\n", pInitializeMonitor, debugstr_w(driver)); + + if (pInitializePrintMonitorUI != NULL) { + pm->monitorUI = pInitializePrintMonitorUI(); + TRACE("%p: MONITORUI from %s,InitializePrintMonitorUI()\n", pm->monitorUI, debugstr_w(driver)); + if (pm->monitorUI) { + TRACE("0x%08x: dwMonitorSize (%d)\n", + pm->monitorUI->dwMonitorUISize, pm->monitorUI->dwMonitorUISize); + + } + } + + if (pInitializePrintMonitor && regroot) { + pmonitorEx = pInitializePrintMonitor(regroot); + TRACE("%p: LPMONITOREX from %s,InitializePrintMonitor(%s)\n", + pmonitorEx, debugstr_w(driver), debugstr_w(regroot)); + + if (pmonitorEx) { + pm->dwMonitorSize = pmonitorEx->dwMonitorSize; + pm->monitor = &(pmonitorEx->Monitor); + } + } + + if (pm->monitor) { + TRACE("0x%08x: dwMonitorSize (%d)\n", pm->dwMonitorSize, pm->dwMonitorSize); + + } + + if (!pm->monitor && regroot) { + if (pInitializePrintMonitor2 != NULL) { + FIXME("%s,InitializePrintMonitor2 not implemented\n", debugstr_w(driver)); + } + if (pInitializeMonitorEx != NULL) { + FIXME("%s,InitializeMonitorEx not implemented\n", debugstr_w(driver)); + } + if (pInitializeMonitor != NULL) { + FIXME("%s,InitializeMonitor not implemented\n", debugstr_w(driver)); + } + } + if (!pm->monitor && !pm->monitorUI) { + monitor_unload(pm); + SetLastError(ERROR_PROC_NOT_FOUND); + pm = NULL; + } + } +cleanup: + if ((pm_localport == NULL) && (pm != NULL) && (lstrcmpW(pm->name, localportW) == 0)) { + pm->refcount++; + pm_localport = pm; + } + LeaveCriticalSection(&monitor_handles_cs); + if (driver != dllname) heap_free(driver); + heap_free(regroot); + TRACE("=> %p\n", pm); + return pm; +} + +/****************************************************************** * Return the number of bytes for an multi_sz string. * The result includes all \0s * (specifically the extra \0, that is needed as multi_sz terminator). @@ -663,6 +881,107 @@ static BOOL WINAPI myAddPrinterDriverEx(DWORD level, LPBYTE pDriverInfo, DWORD d } /****************************************************************************** + * fpAddMonitor [exported through PRINTPROVIDOR] + * + * Install a Printmonitor + * + * PARAMS + * pName [I] Servername or NULL (local Computer) + * Level [I] Structure-Level (Must be 2) + * pMonitors [I] PTR to MONITOR_INFO_2 + * + * RETURNS + * Success: TRUE + * Failure: FALSE + * + * NOTES + * All Files for the Monitor must already be copied to %winsysdir% ("%SystemRoot%\system32") + * + */ +BOOL WINAPI fpAddMonitor(LPWSTR pName, DWORD Level, LPBYTE pMonitors) +{ + monitor_t * pm = NULL; + LPMONITOR_INFO_2W mi2w; + HKEY hroot = NULL; + HKEY hentry = NULL; + DWORD disposition; + BOOL res = FALSE; + + mi2w = (LPMONITOR_INFO_2W) pMonitors; + TRACE("(%s, %d, %p): %s %s %s\n", debugstr_w(pName), Level, pMonitors, + debugstr_w(mi2w ? mi2w->pName : NULL), + debugstr_w(mi2w ? mi2w->pEnvironment : NULL), + debugstr_w(mi2w ? mi2w->pDLLName : NULL)); + + if (copy_servername_from_name(pName, NULL)) { + FIXME("server %s not supported\n", debugstr_w(pName)); + SetLastError(ERROR_ACCESS_DENIED); + return FALSE; + } + + if (!mi2w->pName || (! mi2w->pName[0])) { + WARN("pName not valid : %s\n", debugstr_w(mi2w->pName)); + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + if (!mi2w->pEnvironment || lstrcmpW(mi2w->pEnvironment, x86_envnameW)) { + WARN("Environment %s requested (we support only %s)\n", + debugstr_w(mi2w->pEnvironment), debugstr_w(x86_envnameW)); + SetLastError(ERROR_INVALID_ENVIRONMENT); + return FALSE; + } + + if (!mi2w->pDLLName || (! mi2w->pDLLName[0])) { + WARN("pDLLName not valid : %s\n", debugstr_w(mi2w->pDLLName)); + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + + /* Load and initialize the monitor. SetLastError() is called on failure */ + if ((pm = monitor_load(mi2w->pName, mi2w->pDLLName)) == NULL) { + return FALSE; + } + monitor_unload(pm); + + if (RegCreateKeyW(HKEY_LOCAL_MACHINE, monitorsW, &hroot) != ERROR_SUCCESS) { + ERR("unable to create key %s\n", debugstr_w(monitorsW)); + return FALSE; + } + + if (RegCreateKeyExW(hroot, mi2w->pName, 0, NULL, REG_OPTION_NON_VOLATILE, + KEY_WRITE | KEY_QUERY_VALUE, NULL, &hentry, + &disposition) == ERROR_SUCCESS) { + + /* Some installers set options for the port before calling AddMonitor. + We query the "Driver" entry to verify that the monitor is installed, + before we return an error. + When a user installs two print monitors at the same time with the + same name, a race condition is possible but silently ignored. */ + + DWORD namesize = 0; + + if ((disposition == REG_OPENED_EXISTING_KEY) && + (RegQueryValueExW(hentry, driverW, NULL, NULL, NULL, + &namesize) == ERROR_SUCCESS)) { + TRACE("monitor %s already exists\n", debugstr_w(mi2w->pName)); + /* 9x use ERROR_ALREADY_EXISTS */ + SetLastError(ERROR_PRINT_MONITOR_ALREADY_INSTALLED); + } + else + { + INT len; + len = (lstrlenW(mi2w->pDLLName) +1) * sizeof(WCHAR); + res = (RegSetValueExW(hentry, driverW, 0, REG_SZ, + (LPBYTE) mi2w->pDLLName, len) == ERROR_SUCCESS); + } + RegCloseKey(hentry); + } + + RegCloseKey(hroot); + return (res); +} + +/****************************************************************************** * fpAddPrinterDriverEx [exported through PRINTPROVIDOR] * * Install a Printer Driver with the Option to upgrade / downgrade the Files @@ -879,7 +1198,7 @@ static const PRINTPROVIDOR * get_backend(void) NULL, /* fpAddPrinterConnection */ NULL, /* fpDeletePrinterConnection */ NULL, /* fpPrinterMessageBox */ - NULL, /* fpAddMonitor */ + fpAddMonitor, fpDeleteMonitor, NULL, /* fpResetPrinter */ NULL, /* fpGetPrinterDriverEx */ diff --git a/dlls/localspl/localspl_private.h b/dlls/localspl/localspl_private.h index 614e10824eb..8e67ed3dd5b 100644 --- a/dlls/localspl/localspl_private.h +++ b/dlls/localspl/localspl_private.h @@ -51,11 +51,16 @@ extern HINSTANCE LOCALSPL_hInstance; /* ## Memory allocation functions ## */ -static inline void __WINE_ALLOC_SIZE(1) *heap_alloc( size_t len ) +static inline void * __WINE_ALLOC_SIZE(1) heap_alloc( size_t len ) { return HeapAlloc( GetProcessHeap(), 0, len ); } +static inline void * __WINE_ALLOC_SIZE(1) heap_alloc_zero( size_t len ) +{ + return HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, len ); +} + static inline BOOL heap_free( void *mem ) { return HeapFree( GetProcessHeap(), 0, mem ); diff --git a/dlls/mshtml/htmlbody.c b/dlls/mshtml/htmlbody.c index 140a0a57e3e..9fad1874ca7 100644 --- a/dlls/mshtml/htmlbody.c +++ b/dlls/mshtml/htmlbody.c @@ -300,15 +300,46 @@ static HRESULT WINAPI HTMLBodyElement_get_bgColor(IHTMLBodyElement *iface, VARIA static HRESULT WINAPI HTMLBodyElement_put_text(IHTMLBodyElement *iface, VARIANT v) { HTMLBodyElement *This = HTMLBODY_THIS(iface); - FIXME("(%p)->()\n", This); - return E_NOTIMPL; + nsAString text; + nsresult nsres; + + TRACE("(%p)->(v%d)\n", This, V_VT(&v)); + + if(!variant_to_nscolor(&v, &text)) + return S_OK; + + nsres = nsIDOMHTMLBodyElement_SetText(This->nsbody, &text); + nsAString_Finish(&text); + + return S_OK; } static HRESULT WINAPI HTMLBodyElement_get_text(IHTMLBodyElement *iface, VARIANT *p) { HTMLBodyElement *This = HTMLBODY_THIS(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + nsAString text; + nsresult nsres; + + TRACE("(%p)->(%p)\n", This, p); + + nsAString_Init(&text, NULL); + + V_VT(p) = VT_BSTR; + V_BSTR(p) = NULL; + + nsres = nsIDOMHTMLBodyElement_GetText(This->nsbody, &text); + if(NS_SUCCEEDED(nsres)) + { + const PRUnichar *sText; + nsAString_GetData(&text, &sText); + + V_VT(p) = VT_BSTR; + V_BSTR(p) = SysAllocString(sText); + } + + nsAString_Finish(&text); + + return S_OK; } static HRESULT WINAPI HTMLBodyElement_put_link(IHTMLBodyElement *iface, VARIANT v) diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 4b4675b9854..5a9f5331d9e 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -654,17 +654,17 @@ extern LONG module_ref; /* memory allocation functions */ -static inline void __WINE_ALLOC_SIZE(1) *heap_alloc(size_t len) +static inline void * __WINE_ALLOC_SIZE(1) heap_alloc(size_t len) { return HeapAlloc(GetProcessHeap(), 0, len); } -static inline void __WINE_ALLOC_SIZE(1) *heap_alloc_zero(size_t len) +static inline void * __WINE_ALLOC_SIZE(1) heap_alloc_zero(size_t len) { return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len); } -static inline void __WINE_ALLOC_SIZE(2) *heap_realloc(void *mem, size_t len) +static inline void * __WINE_ALLOC_SIZE(2) heap_realloc(void *mem, size_t len) { return HeapReAlloc(GetProcessHeap(), 0, mem, len); } diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c index 35cd2911014..56c5057e77d 100644 --- a/dlls/mshtml/tests/dom.c +++ b/dlls/mshtml/tests/dom.c @@ -2064,6 +2064,10 @@ static void test_default_body(IHTMLBodyElement *body) long l; BSTR bstr; HRESULT hres; + VARIANT v; + WCHAR sBodyText[] = {'#','F','F','0','0','0','0',0}; + WCHAR sTextInvalid[] = {'I','n','v','a','l','i','d',0}; + WCHAR sResInvalid[] = {'#','0','0','a','0','d','0',0}; bstr = (void*)0xdeadbeef; hres = IHTMLBodyElement_get_background(body, &bstr); @@ -2077,6 +2081,39 @@ static void test_default_body(IHTMLBodyElement *body) l = elem_get_scroll_top((IUnknown*)body); ok(!l, "scrollTop = %ld\n", l); elem_get_scroll_left((IUnknown*)body); + + /* get_text tests */ + hres = IHTMLBodyElement_get_text(body, &v); + ok(hres == S_OK, "expect S_OK got 0x%08d\n", hres); + ok(V_VT(&v) == VT_BSTR, "Expected VT_BSTR got %d\n", V_VT(&v)); + ok(bstr == NULL, "bstr != NULL\n"); + + + /* get_text - Invalid Text */ + V_VT(&v) = VT_BSTR; + V_BSTR(&v) = SysAllocString(sTextInvalid); + hres = IHTMLBodyElement_put_text(body, v); + ok(hres == S_OK, "expect S_OK got 0x%08d\n", hres); + + V_VT(&v) = VT_NULL; + hres = IHTMLBodyElement_get_text(body, &v); + ok(hres == S_OK, "expect S_OK got 0x%08d\n", hres); + ok(V_VT(&v) == VT_BSTR, "Expected VT_BSTR got %d\n", V_VT(&v)); + ok(!lstrcmpW(sResInvalid, V_BSTR(&v)), "bstr != sResInvalid\n"); + VariantClear(&v); + + /* get_text - Valid Text */ + V_VT(&v) = VT_BSTR; + V_BSTR(&v) = SysAllocString(sBodyText); + hres = IHTMLBodyElement_put_text(body, v); + ok(hres == S_OK, "expect S_OK got 0x%08d\n", hres); + + V_VT(&v) = VT_NULL; + hres = IHTMLBodyElement_get_text(body, &v); + ok(hres == S_OK, "expect S_OK got 0x%08d\n", hres); + ok(V_VT(&v) == VT_BSTR, "Expected VT_BSTR got %d\n", V_VT(&v)); + ok(lstrcmpW(bstr, V_BSTR(&v)), "bstr != V_BSTR(&v)\n"); + VariantClear(&v); } static void test_body_funs(IHTMLBodyElement *body) diff --git a/dlls/mstask/tests/task.c b/dlls/mstask/tests/task.c index 88a4fdf77de..328dd76958a 100644 --- a/dlls/mstask/tests/task.c +++ b/dlls/mstask/tests/task.c @@ -164,9 +164,13 @@ static void test_SetApplicationName_GetApplicationName(void) ok(hres == S_OK, "GetApplicationName failed: %08x\n", hres); if (hres == S_OK) { - full_name = path_resolve_name(notepad); - ok(!lstrcmpiW(stored_name, full_name), "Got %s, expected %s\n", - dbgstr_w(stored_name), dbgstr_w(full_name)); + full_name = path_resolve_name(notepad_exe); /* XP SP1 appends .exe */ + if (lstrcmpiW(stored_name, full_name) != 0) + { + full_name = path_resolve_name(notepad); + ok(!lstrcmpiW(stored_name, full_name), "Got %s, expected %s\n", + dbgstr_w(stored_name), dbgstr_w(full_name)); + } CoTaskMemFree(stored_name); } @@ -467,7 +471,8 @@ static void test_SetAccountInformation_GetAccountInformation(void) "Failed setting dummy account with no password: %08x\n", hres); hres = ITask_GetAccountInformation(test_task, &account_name); ok(hres == S_OK || - broken(hres == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)), + broken(hres == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) || + hres == SCHED_E_CANNOT_OPEN_TASK), "GetAccountInformation failed: %08x\n", hres); if (hres == S_OK) { @@ -485,7 +490,8 @@ static void test_SetAccountInformation_GetAccountInformation(void) "Failed setting dummy account with password: %08x\n", hres); hres = ITask_GetAccountInformation(test_task, &account_name); ok(hres == S_OK || - broken(hres == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)), + broken(hres == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) || + hres == SCHED_E_CANNOT_OPEN_TASK), "GetAccountInformation failed: %08x\n", hres); if (hres == S_OK) { @@ -500,7 +506,8 @@ static void test_SetAccountInformation_GetAccountInformation(void) ok(hres == S_OK, "Failed setting system account: %08x\n", hres); hres = ITask_GetAccountInformation(test_task, &account_name); ok(hres == S_OK || - broken(hres == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND)), + broken(hres == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) || + hres == SCHED_E_CANNOT_OPEN_TASK), "GetAccountInformation failed: %08x\n", hres); if (hres == S_OK) { diff --git a/dlls/msvcrt/tests/file.c b/dlls/msvcrt/tests/file.c index 97f9646ffda..36fcc8001b8 100644 --- a/dlls/msvcrt/tests/file.c +++ b/dlls/msvcrt/tests/file.c @@ -1093,7 +1093,7 @@ static void test_unlink(void) ok(file != NULL, "unable to create test file\n"); if(file) fclose(file); - todo_wine ok(_unlink("test_unlink") != 0, "unlinking a non-empty directory must fail\n"); + ok(_unlink("test_unlink") != 0, "unlinking a non-empty directory must fail\n"); unlink("test_unlink\\empty"); rmdir("test_unlink"); } diff --git a/dlls/msxml3/queryresult.c b/dlls/msxml3/queryresult.c index f30172da3d2..56c1a537674 100644 --- a/dlls/msxml3/queryresult.c +++ b/dlls/msxml3/queryresult.c @@ -65,6 +65,8 @@ static inline queryresult *impl_from_IXMLDOMNodeList( IXMLDOMNodeList *iface ) return (queryresult *)((char*)iface - FIELD_OFFSET(queryresult, lpVtbl)); } +#define XMLQUERYRES(x) ((IXMLDOMNodeList*)&(x)->lpVtbl) + static HRESULT WINAPI queryresult_QueryInterface( IXMLDOMNodeList *iface, REFIID riid, @@ -326,13 +328,28 @@ static HRESULT queryresult_invoke(IUnknown *iface, DISPID id, LCID lcid, WORD fl { queryresult *This = impl_from_IXMLDOMNodeList( (IXMLDOMNodeList*)iface ); - if(flags != DISPATCH_PROPERTYGET) { - FIXME("flags %x\n", flags); - return E_NOTIMPL; - } + TRACE("(%p)->(%x %x %x %p %p %p)\n", This, id, lcid, flags, params, res, ei); V_VT(res) = VT_DISPATCH; - V_DISPATCH(res) = (IDispatch*)create_node(This->result->nodesetval->nodeTab[This->resultPos]); + V_DISPATCH(res) = NULL; + + switch(flags) + { + case INVOKE_PROPERTYGET: + { + IXMLDOMNode *disp = NULL; + + queryresult_get_item(XMLQUERYRES(This), id - MSXML_DISPID_CUSTOM_MIN, &disp); + V_DISPATCH(res) = (IDispatch*)&disp; + break; + } + default: + { + FIXME("unimplemented flags %x\n", flags); + break; + } + } + return S_OK; } diff --git a/dlls/ntdll/tests/om.c b/dlls/ntdll/tests/om.c index d211ea00432..1999da6bb61 100644 --- a/dlls/ntdll/tests/om.c +++ b/dlls/ntdll/tests/om.c @@ -285,6 +285,7 @@ static void test_directory(void) UNICODE_STRING str; OBJECT_ATTRIBUTES attr; HANDLE dir, dir1, h; + BOOL is_nt4; /* No name and/or no attributes */ status = pNtCreateDirectoryObject(NULL, DIRECTORY_QUERY, &attr); @@ -335,14 +336,18 @@ static void test_directory(void) pRtlCreateUnicodeStringFromAsciiz(&str, "\\BaseNamedObjects\\Local"); InitializeObjectAttributes(&attr, &str, 0, 0, NULL); status = pNtOpenSymbolicLinkObject(&dir, SYMBOLIC_LINK_QUERY, &attr); - ok(status == STATUS_SUCCESS, "Failed to open SymbolicLink(%08x)\n", status); - pRtlFreeUnicodeString(&str); - InitializeObjectAttributes(&attr, &str, 0, dir, NULL); - pRtlCreateUnicodeStringFromAsciiz(&str, "one more level"); - DIR_TEST_CREATE_FAILURE(&h, STATUS_OBJECT_TYPE_MISMATCH) - pRtlFreeUnicodeString(&str); - pNtClose(h); - pNtClose(dir); + is_nt4 = (status == STATUS_OBJECT_NAME_NOT_FOUND); /* nt4 doesn't have Local\\ symlink */ + if (!is_nt4) + { + ok(status == STATUS_SUCCESS, "Failed to open SymbolicLink(%08x)\n", status); + pRtlFreeUnicodeString(&str); + InitializeObjectAttributes(&attr, &str, 0, dir, NULL); + pRtlCreateUnicodeStringFromAsciiz(&str, "one more level"); + DIR_TEST_CREATE_FAILURE(&h, STATUS_OBJECT_TYPE_MISMATCH) + pRtlFreeUnicodeString(&str); + pNtClose(h); + pNtClose(dir); + } pRtlCreateUnicodeStringFromAsciiz(&str, "\\BaseNamedObjects"); InitializeObjectAttributes(&attr, &str, 0, 0, NULL); @@ -393,22 +398,23 @@ static void test_directory(void) pNtClose(dir); - InitializeObjectAttributes(&attr, &str, 0, 0, NULL); - pRtlCreateUnicodeStringFromAsciiz(&str, "\\BaseNamedObjects\\Global\\om.c-test"); - DIR_TEST_CREATE_SUCCESS(&dir) - pRtlFreeUnicodeString(&str); - pRtlCreateUnicodeStringFromAsciiz(&str, "\\BaseNamedObjects\\Local\\om.c-test\\one more level"); - DIR_TEST_CREATE_SUCCESS(&h) - pRtlFreeUnicodeString(&str); - pNtClose(h); - InitializeObjectAttributes(&attr, &str, 0, dir, NULL); - pRtlCreateUnicodeStringFromAsciiz(&str, "one more level"); - DIR_TEST_CREATE_SUCCESS(&dir) - pRtlFreeUnicodeString(&str); - pNtClose(h); - - pNtClose(dir); - + if (!is_nt4) + { + InitializeObjectAttributes(&attr, &str, 0, 0, NULL); + pRtlCreateUnicodeStringFromAsciiz(&str, "\\BaseNamedObjects\\Global\\om.c-test"); + DIR_TEST_CREATE_SUCCESS(&dir) + pRtlFreeUnicodeString(&str); + pRtlCreateUnicodeStringFromAsciiz(&str, "\\BaseNamedObjects\\Local\\om.c-test\\one more level"); + DIR_TEST_CREATE_SUCCESS(&h) + pRtlFreeUnicodeString(&str); + pNtClose(h); + InitializeObjectAttributes(&attr, &str, 0, dir, NULL); + pRtlCreateUnicodeStringFromAsciiz(&str, "one more level"); + DIR_TEST_CREATE_SUCCESS(&dir) + pRtlFreeUnicodeString(&str); + pNtClose(h); + pNtClose(dir); + } /* Create other objects using RootDirectory */ @@ -462,9 +468,6 @@ static void test_directory(void) #define SYMLNK_TEST_CREATE_SUCCESS(h) \ status = pNtCreateSymbolicLinkObject(h, SYMBOLIC_LINK_QUERY, &attr, &target); \ ok(status == STATUS_SUCCESS, "Failed to create SymbolicLink(%08x)\n", status); -#define SYMLNK_TEST_OPEN_SUCCESS(h) \ - status = pNtOpenSymbolicLinkObject(h, SYMBOLIC_LINK_QUERY, &attr); \ - ok(status == STATUS_SUCCESS, "Failed to open SymbolicLink(%08x)\n", status); static void test_symboliclink(void) { @@ -518,18 +521,24 @@ static void test_symboliclink(void) /* Compaund test */ - pRtlCreateUnicodeStringFromAsciiz(&str, "\\BaseNamedObjects"); - DIR_TEST_OPEN_SUCCESS(&dir) + pRtlCreateUnicodeStringFromAsciiz(&str, "\\BaseNamedObjects\\Local"); + status = pNtOpenDirectoryObject(&dir, DIRECTORY_QUERY, &attr); + if (status == STATUS_OBJECT_NAME_NOT_FOUND) /* nt4 doesn't have Local\\ */ + { + pRtlCreateUnicodeStringFromAsciiz(&str, "\\BaseNamedObjects"); + status = pNtOpenDirectoryObject(&dir, DIRECTORY_QUERY, &attr); + } + ok(status == STATUS_SUCCESS, "Failed to open Directory(%08x)\n", status); pRtlFreeUnicodeString(&str); InitializeObjectAttributes(&attr, &str, 0, dir, NULL); - pRtlCreateUnicodeStringFromAsciiz(&str, "Local\\test-link"); + pRtlCreateUnicodeStringFromAsciiz(&str, "test-link"); pRtlCreateUnicodeStringFromAsciiz(&target, "\\DosDevices"); SYMLNK_TEST_CREATE_SUCCESS(&link) pRtlFreeUnicodeString(&str); pRtlFreeUnicodeString(&target); - pRtlCreateUnicodeStringFromAsciiz(&str, "Local\\test-link\\PIPE"); + pRtlCreateUnicodeStringFromAsciiz(&str, "test-link\\PIPE"); status = pNtOpenFile(&h, GENERIC_READ, &attr, &iosb, FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_OPEN); todo_wine ok(status == STATUS_SUCCESS, "Failed to open NamedPipe(%08x)\n", status); pRtlFreeUnicodeString(&str); diff --git a/dlls/ntdll/tests/reg.c b/dlls/ntdll/tests/reg.c index 94f2a0b6630..70864b6f250 100644 --- a/dlls/ntdll/tests/reg.c +++ b/dlls/ntdll/tests/reg.c @@ -575,7 +575,7 @@ static void test_RtlpNtQueryValueKey(void) START_TEST(reg) { - static const WCHAR winetest[] = {'\\','W','i','n','e','T','e','s','t','\\',0}; + static const WCHAR winetest[] = {'\\','W','i','n','e','T','e','s','t',0}; if(!InitFunctionPtrs()) return; pRtlFormatCurrentUserKeyPath(&winetestpath); diff --git a/dlls/riched20/editor.h b/dlls/riched20/editor.h index cbebdba7864..2c683786e78 100644 --- a/dlls/riched20/editor.h +++ b/dlls/riched20/editor.h @@ -25,7 +25,7 @@ struct _RTF_Info; extern HANDLE me_heap; -static inline void __WINE_ALLOC_SIZE(1) *heap_alloc( size_t len ) +static inline void * __WINE_ALLOC_SIZE(1) heap_alloc( size_t len ) { return HeapAlloc( me_heap, 0, len ); } @@ -35,7 +35,7 @@ static inline BOOL heap_free( void *ptr ) return HeapFree( me_heap, 0, ptr ); } -static inline void __WINE_ALLOC_SIZE(2) *heap_realloc( void *ptr, size_t len ) +static inline void * __WINE_ALLOC_SIZE(2) heap_realloc( void *ptr, size_t len ) { return HeapReAlloc( me_heap, 0, ptr, len ); } diff --git a/dlls/riched20/paint.c b/dlls/riched20/paint.c index 9cfc21ef640..eba37efa757 100644 --- a/dlls/riched20/paint.c +++ b/dlls/riched20/paint.c @@ -1046,6 +1046,9 @@ void ME_Scroll(ME_TextEditor *editor, int value, int type) { SCROLLINFO si; int nOrigPos, nNewPos, nActualScroll; + HWND hWnd; + LONG winStyle; + BOOL bScrollBarIsVisible, bScrollBarWillBeVisible; nOrigPos = ME_GetYScrollPos(editor); @@ -1072,6 +1075,7 @@ void ME_Scroll(ME_TextEditor *editor, int value, int type) } nNewPos = SetScrollInfo(editor->hWnd, SB_VERT, &si, editor->bRedraw); + editor->vert_si.nPos = nNewPos; nActualScroll = nOrigPos - nNewPos; if (editor->bRedraw) { @@ -1082,7 +1086,15 @@ void ME_Scroll(ME_TextEditor *editor, int value, int type) ME_Repaint(editor); } - editor->vert_si.nMax = 0; + hWnd = editor->hWnd; + winStyle = GetWindowLongW(hWnd, GWL_STYLE); + bScrollBarIsVisible = (winStyle & WS_VSCROLL) != 0; + bScrollBarWillBeVisible = (editor->nHeight > editor->sizeWindow.cy) + || (winStyle & ES_DISABLENOSCROLL); + if (bScrollBarIsVisible != bScrollBarWillBeVisible) + { + ShowScrollBar(hWnd, SB_VERT, bScrollBarWillBeVisible); + } ME_UpdateScrollBar(editor); } @@ -1105,11 +1117,10 @@ void ME_Scroll(ME_TextEditor *editor, int value, int type) bScrollBarWasVisible = ME_GetYScrollVisible(editor); bScrollBarWillBeVisible = editor->nHeight > editor->sizeWindow.cy; - si.fMask = SIF_PAGE | SIF_RANGE; + si.fMask = SIF_PAGE | SIF_RANGE | SIF_POS; if (GetWindowLongW(hWnd, GWL_STYLE) & ES_DISABLENOSCROLL) - si.fMask |= SIF_DISABLENOSCROLL; - if ((si.fMask & SIF_DISABLENOSCROLL)) { + si.fMask |= SIF_DISABLENOSCROLL; bScrollBarWillBeVisible = TRUE; } @@ -1122,7 +1133,7 @@ void ME_Scroll(ME_TextEditor *editor, int value, int type) si.nMin = 0; si.nMax = editor->nTotalLength; - + si.nPos = editor->vert_si.nPos; si.nPage = editor->sizeWindow.cy; if (!(si.nMin == editor->vert_si.nMin && si.nMax == editor->vert_si.nMax && si.nPage == editor->vert_si.nPage)) @@ -1138,17 +1149,18 @@ void ME_Scroll(ME_TextEditor *editor, int value, int type) else { if (bScrollBarWasVisible && !(si.fMask & SIF_DISABLENOSCROLL)) + { + SetScrollInfo(hWnd, SB_VERT, &si, TRUE); ShowScrollBar(hWnd, SB_VERT, FALSE); + ME_ScrollAbs(editor, 0); + } } } } int ME_GetYScrollPos(ME_TextEditor *editor) { - SCROLLINFO si; - si.cbSize = sizeof(si); - si.fMask = SIF_POS; - return GetScrollInfo(editor->hWnd, SB_VERT, &si) ? si.nPos : 0; + return editor->vert_si.nPos; } BOOL ME_GetYScrollVisible(ME_TextEditor *editor) diff --git a/dlls/shell32/autocomplete.c b/dlls/shell32/autocomplete.c index a026e8babe0..f64dbec3262 100644 --- a/dlls/shell32/autocomplete.c +++ b/dlls/shell32/autocomplete.c @@ -31,6 +31,8 @@ - implement ACO_FILTERPREFIXES style - implement ACO_USETAB style - implement ACO_RTLREADING style + - implement ResetEnumerator + - string compares should be case-insensitive, the content of the list should be sorted */ #include "config.h" @@ -62,6 +64,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell); typedef struct { const IAutoComplete2Vtbl *lpVtbl; + const IAutoCompleteDropDownVtbl *lpDropDownVtbl; LONG ref; BOOL enabled; HWND hwndEdit; @@ -75,17 +78,43 @@ typedef struct } IAutoCompleteImpl; static const IAutoComplete2Vtbl acvt; +static const IAutoCompleteDropDownVtbl acdropdownvt; /* converts This to an interface pointer */ #define _IUnknown_(This) (IUnknown*)&(This->lpVtbl) -#define _IAutoComplete2_(This) (IAutoComplete2*)&(This->lpvtbl) +#define _IAutoComplete2_(This) (IAutoComplete2*)&(This->lpVtbl) +#define _IAutoCompleteDropDown_(This) (IAutoCompleteDropDown*)&(This->lpDropDownVtbl) + +static inline IAutoCompleteImpl *impl_from_IAutoCompleteDropDown(IAutoCompleteDropDown *iface) +{ + return (IAutoCompleteImpl *)((char *)iface - FIELD_OFFSET(IAutoCompleteImpl, lpDropDownVtbl)); +} static LRESULT APIENTRY ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam); static LRESULT APIENTRY ACLBoxSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam); +static void create_listbox(IAutoCompleteImpl *This) +{ + HWND hwndParent; + + hwndParent = GetParent(This->hwndEdit); + + /* FIXME : The listbox should be resizable with the mouse. WS_THICKFRAME looks ugly */ + This->hwndListBox = CreateWindowExW(0, WC_LISTBOXW, NULL, + WS_BORDER | WS_CHILD | WS_VSCROLL | LBS_HASSTRINGS | LBS_NOTIFY | LBS_NOINTEGRALHEIGHT, + CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, + hwndParent, NULL, + (HINSTANCE)GetWindowLongPtrW( hwndParent, GWLP_HINSTANCE ), NULL); + + if (This->hwndListBox) { + This->wpOrigLBoxProc = (WNDPROC) SetWindowLongPtrW( This->hwndListBox, GWLP_WNDPROC, (LONG_PTR) ACLBoxSubclassProc); + SetWindowLongPtrW( This->hwndListBox, GWLP_USERDATA, (LONG_PTR)This); + } +} + /************************************************************************** * IAutoComplete_Constructor */ @@ -102,6 +131,7 @@ HRESULT WINAPI IAutoComplete_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVO lpac->ref = 1; lpac->lpVtbl = &acvt; + lpac->lpDropDownVtbl = &acdropdownvt; lpac->enabled = TRUE; lpac->enumstr = NULL; lpac->options = ACO_AUTOAPPEND; @@ -139,6 +169,10 @@ static HRESULT WINAPI IAutoComplete2_fnQueryInterface( { *ppvObj = (IAutoComplete2*)This; } + else if (IsEqualIID(riid, &IID_IAutoCompleteDropDown)) + { + *ppvObj = _IAutoCompleteDropDown_(This); + } if (*ppvObj) { @@ -146,7 +180,7 @@ static HRESULT WINAPI IAutoComplete2_fnQueryInterface( TRACE("-- Interface: (%p)->(%p)\n", ppvObj, *ppvObj); return S_OK; } - TRACE("-- Interface: E_NOINTERFACE\n"); + WARN("unsupported interface: %s\n", debugstr_guid(riid)); return E_NOINTERFACE; } @@ -217,17 +251,13 @@ static HRESULT WINAPI IAutoComplete2_fnInit( LPCOLESTR pwszQuickComplete) { IAutoCompleteImpl *This = (IAutoCompleteImpl *)iface; - static const WCHAR lbName[] = {'L','i','s','t','B','o','x',0}; TRACE("(%p)->(0x%08lx, %p, %s, %s)\n", This, (long)hwndEdit, punkACL, debugstr_w(pwzsRegKeyPath), debugstr_w(pwszQuickComplete)); - if (This->options & ACO_AUTOSUGGEST) TRACE(" ACO_AUTOSUGGEST\n"); - if (This->options & ACO_AUTOAPPEND) TRACE(" ACO_AUTOAPPEND\n"); if (This->options & ACO_SEARCH) FIXME(" ACO_SEARCH not supported\n"); if (This->options & ACO_FILTERPREFIXES) FIXME(" ACO_FILTERPREFIXES not supported\n"); if (This->options & ACO_USETAB) FIXME(" ACO_USETAB not supported\n"); - if (This->options & ACO_UPDOWNKEYDROPSLIST) TRACE(" ACO_UPDOWNKEYDROPSLIST\n"); if (This->options & ACO_RTLREADING) FIXME(" ACO_RTLREADING not supported\n"); This->hwndEdit = hwndEdit; @@ -240,23 +270,8 @@ static HRESULT WINAPI IAutoComplete2_fnInit( This->wpOrigEditProc = (WNDPROC) SetWindowLongPtrW( hwndEdit, GWLP_WNDPROC, (LONG_PTR) ACEditSubclassProc); SetWindowLongPtrW( hwndEdit, GWLP_USERDATA, (LONG_PTR)This); - if (This->options & ACO_AUTOSUGGEST) { - HWND hwndParent; - - hwndParent = GetParent(This->hwndEdit); - - /* FIXME : The listbox should be resizable with the mouse. WS_THICKFRAME looks ugly */ - This->hwndListBox = CreateWindowExW(0, lbName, NULL, - WS_BORDER | WS_CHILD | WS_VSCROLL | LBS_HASSTRINGS | LBS_NOTIFY | LBS_NOINTEGRALHEIGHT, - CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, - hwndParent, NULL, - (HINSTANCE)GetWindowLongPtrW( hwndParent, GWLP_HINSTANCE ), NULL); - - if (This->hwndListBox) { - This->wpOrigLBoxProc = (WNDPROC) SetWindowLongPtrW( This->hwndListBox, GWLP_WNDPROC, (LONG_PTR) ACLBoxSubclassProc); - SetWindowLongPtrW( This->hwndListBox, GWLP_USERDATA, (LONG_PTR)This); - } - } + if (This->options & ACO_AUTOSUGGEST) + create_listbox(This); if (pwzsRegKeyPath) { WCHAR *key; @@ -330,11 +345,70 @@ static HRESULT WINAPI IAutoComplete2_fnSetOptions( This->options = dwFlag; + if ((This->options & ACO_AUTOSUGGEST) && This->hwndEdit && !This->hwndListBox) + create_listbox(This); + return hr; } /************************************************************************** - * IAutoComplete2_fnVTable + * IAutoCompleteDropDown_fnGetDropDownStatus + */ +static HRESULT WINAPI IAutoCompleteDropDown_fnGetDropDownStatus( + IAutoCompleteDropDown *iface, + DWORD *pdwFlags, + LPWSTR *ppwszString) +{ + IAutoCompleteImpl *This = impl_from_IAutoCompleteDropDown(iface); + BOOL dropped; + + TRACE("(%p) -> (%p, %p)\n", This, pdwFlags, ppwszString); + + dropped = IsWindowVisible(This->hwndListBox); + + if (pdwFlags) + *pdwFlags = (dropped ? ACDD_VISIBLE : 0); + + if (ppwszString) { + if (dropped) { + int sel; + + sel = SendMessageW(This->hwndListBox, LB_GETCURSEL, 0, 0); + if (sel >= 0) + { + DWORD len; + + len = SendMessageW(This->hwndListBox, LB_GETTEXTLEN, sel, 0); + *ppwszString = CoTaskMemAlloc((len+1)*sizeof(WCHAR)); + SendMessageW(This->hwndListBox, LB_GETTEXT, sel, (LPARAM)*ppwszString); + } + else + *ppwszString = NULL; + } + else + *ppwszString = NULL; + } + + return S_OK; +} + +/************************************************************************** + * IAutoCompleteDropDown_fnResetEnumarator + */ +static HRESULT WINAPI IAutoCompleteDropDown_fnResetEnumerator( + IAutoCompleteDropDown *iface) +{ + IAutoCompleteImpl *This = impl_from_IAutoCompleteDropDown(iface); + + FIXME("(%p): stub\n", This); + + return E_NOTIMPL; +} + + + +/************************************************************************** + * IAutoComplete2 VTable */ static const IAutoComplete2Vtbl acvt = { @@ -348,6 +422,38 @@ static const IAutoComplete2Vtbl acvt = IAutoComplete2_fnGetOptions, }; + +static HRESULT WINAPI IAutoCompleteDropDown_fnQueryInterface(IAutoCompleteDropDown *iface, + REFIID riid, LPVOID *ppvObj) +{ + IAutoCompleteImpl *This = impl_from_IAutoCompleteDropDown(iface); + return IAutoComplete2_fnQueryInterface(_IAutoComplete2_(This), riid, ppvObj); +} + +static ULONG WINAPI IAutoCompleteDropDown_fnAddRef(IAutoCompleteDropDown *iface) +{ + IAutoCompleteImpl *This = impl_from_IAutoCompleteDropDown(iface); + return IAutoComplete2_fnAddRef(_IAutoComplete2_(This)); +} + +static ULONG WINAPI IAutoCompleteDropDown_fnRelease(IAutoCompleteDropDown *iface) +{ + IAutoCompleteImpl *This = impl_from_IAutoCompleteDropDown(iface); + return IAutoComplete2_fnRelease(_IAutoComplete2_(This)); +} + +/************************************************************************** + * IAutoCompleteDropDown VTable + */ +static const IAutoCompleteDropDownVtbl acdropdownvt = +{ + IAutoCompleteDropDown_fnQueryInterface, + IAutoCompleteDropDown_fnAddRef, + IAutoCompleteDropDown_fnRelease, + IAutoCompleteDropDown_fnGetDropDownStatus, + IAutoCompleteDropDown_fnResetEnumerator, +}; + /* Window procedure for autocompletion */ @@ -370,7 +476,7 @@ static LRESULT APIENTRY ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, ShowWindow(This->hwndListBox, SW_HIDE); break; case WM_KILLFOCUS: - if ((This->options && ACO_AUTOSUGGEST) && + if ((This->options & ACO_AUTOSUGGEST) && ((HWND)wParam != This->hwndListBox)) { ShowWindow(This->hwndListBox, SW_HIDE); @@ -482,17 +588,19 @@ static LRESULT APIENTRY ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, break; if (strstrW(strs, hwndText) == strs) { - if (This->options & ACO_AUTOAPPEND) { + if (!filled && (This->options & ACO_AUTOAPPEND)) { SetWindowTextW(hwnd, strs); SendMessageW(hwnd, EM_SETSEL, lstrlenW(hwndText), lstrlenW(strs)); - break; + if (!(This->options & ACO_AUTOSUGGEST)) + break; } if (This->options & ACO_AUTOSUGGEST) { SendMessageW(This->hwndListBox, LB_ADDSTRING, 0, (LPARAM)strs); - filled = TRUE; cpt++; } + + filled = TRUE; } } diff --git a/dlls/shell32/control.c b/dlls/shell32/control.c index aa5abfe5b9c..83b44189b2a 100644 --- a/dlls/shell32/control.c +++ b/dlls/shell32/control.c @@ -119,6 +119,22 @@ CPlApplet* Control_LoadApplet(HWND hWnd, LPCWSTR cmd, CPanel* panel) LoadStringW(applet->hModule, info.idInfo, applet->info[i].szInfo, sizeof(applet->info[i].szInfo) / sizeof(WCHAR)); + /* some broken control panels seem to return incorrect values in CPL_INQUIRE, + but proper data in CPL_NEWINQUIRE. if we get an empty string or a null + icon, see what we can get from CPL_NEWINQUIRE */ + + if ((applet->info[i].szName == 0) || (lstrlenW(applet->info[i].szName) == 0)) + info.idName = CPL_DYNAMIC_RES; + + /* zero-length szInfo may not be a buggy applet, but it doesn't hurt for us + to check anyway */ + + if ((applet->info[i].szInfo == 0) || (lstrlenW(applet->info[i].szInfo) == 0)) + info.idInfo = CPL_DYNAMIC_RES; + + if (applet->info[i].hIcon == NULL) + info.idIcon = CPL_DYNAMIC_RES; + if ((info.idIcon == CPL_DYNAMIC_RES) || (info.idName == CPL_DYNAMIC_RES) || (info.idInfo == CPL_DYNAMIC_RES)) { applet->proc(hWnd, CPL_NEWINQUIRE, i, (LPARAM)&newinfo); diff --git a/dlls/shlwapi/tests/clsid.c b/dlls/shlwapi/tests/clsid.c index 917df226153..98a8c6d4c01 100644 --- a/dlls/shlwapi/tests/clsid.c +++ b/dlls/shlwapi/tests/clsid.c @@ -107,6 +107,7 @@ static void test_ClassIDs(void) DWORD dwLen; BOOL bRet; int i = 0; + int is_vista = 0; if (!pSHLWAPI_269 || !pSHLWAPI_23) return; @@ -114,7 +115,8 @@ static void test_ClassIDs(void) while (*guids) { dwLen = pSHLWAPI_23(*guids, szBuff, 256); - ok(dwLen == 39, "wrong size for id %d\n", i); + if (!i && dwLen == S_OK) is_vista = 1; /* seems to return an HRESULT on vista */ + ok(dwLen == (is_vista ? S_OK : 39), "wrong size %u for id %d\n", dwLen, i); bRet = pSHLWAPI_269(szBuff, &guid); ok(bRet != FALSE, "created invalid string '%s'\n", szBuff); @@ -128,7 +130,7 @@ static void test_ClassIDs(void) /* Test endianess */ dwLen = pSHLWAPI_23(&IID_Endianess, szBuff, 256); - ok(dwLen == 39, "wrong size for IID_Endianess\n"); + ok(dwLen == (is_vista ? S_OK : 39), "wrong size %u for IID_Endianess\n", dwLen); ok(!strcmp(szBuff, "{01020304-0506-0708-090A-0B0C0D0E0F0A}"), "Endianess Broken, got '%s'\n", szBuff); @@ -136,17 +138,17 @@ static void test_ClassIDs(void) /* test lengths */ szBuff[0] = ':'; dwLen = pSHLWAPI_23(&IID_Endianess, szBuff, 0); - ok(dwLen == 0, "accepted bad length\n"); + ok(dwLen == (is_vista ? E_FAIL : 0), "accepted bad length\n"); ok(szBuff[0] == ':', "wrote to buffer with no length\n"); szBuff[0] = ':'; dwLen = pSHLWAPI_23(&IID_Endianess, szBuff, 38); - ok(dwLen == 0, "accepted bad length\n"); + ok(dwLen == (is_vista ? E_FAIL : 0), "accepted bad length\n"); ok(szBuff[0] == ':', "wrote to buffer with no length\n"); szBuff[0] = ':'; dwLen = pSHLWAPI_23(&IID_Endianess, szBuff, 39); - ok(dwLen == 39, "rejected ok length\n"); + ok(dwLen == (is_vista ? S_OK : 39), "rejected ok length\n"); ok(szBuff[0] == '{', "Didn't write to buffer with ok length\n"); /* Test string */ @@ -155,7 +157,7 @@ static void test_ClassIDs(void) ok(bRet == FALSE, "accepted invalid string\n"); dwLen = pSHLWAPI_23(&IID_Endianess, szBuff, 39); - ok(dwLen == 39, "rejected ok length\n"); + ok(dwLen == (is_vista ? S_OK : 39), "rejected ok length\n"); ok(szBuff[0] == '{', "Didn't write to buffer with ok length\n"); } diff --git a/dlls/user32/tests/cursoricon.c b/dlls/user32/tests/cursoricon.c index 0c611a34024..710b67cf340 100644 --- a/dlls/user32/tests/cursoricon.c +++ b/dlls/user32/tests/cursoricon.c @@ -76,11 +76,10 @@ 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"); - ok(error == ERROR_DESTROY_OBJECT_OF_OTHER_THREAD, + todo_wine ok(!ret, "DestroyCursor on the active cursor succeeded.\n"); + ok(error == ERROR_DESTROY_OBJECT_OF_OTHER_THREAD || + error == 0xdeadbeef, /* vista */ "Last error: %u\n", error); - } return TRUE; case WM_DESTROY: PostQuitMessage(0); @@ -132,7 +131,7 @@ static void do_child(void) PostMessage(parent, PROC_INIT, (WPARAM) child, 0); /* Receive messages. */ - while ((ret = GetMessage(&msg, child, 0, 0))) + while ((ret = GetMessage(&msg, 0, 0, 0))) { ok(ret != -1, "GetMessage failed. Error: %u\n", GetLastError()); TranslateMessage(&msg); @@ -990,7 +989,8 @@ static void test_DestroyCursor(void) todo_wine { ok(!ret, "DestroyCursor succeeded.\n"); error = GetLastError(); - ok(error == ERROR_INVALID_CURSOR_HANDLE, "Last error: 0x%08x\n", error); + ok(error == ERROR_INVALID_CURSOR_HANDLE || error == 0xdeadbeef, /* vista */ + "Last error: 0x%08x\n", error); } DeleteObject(cursorInfo.hbmMask); diff --git a/dlls/user32/tests/monitor.c b/dlls/user32/tests/monitor.c index a66868f52c8..d858f7279eb 100644 --- a/dlls/user32/tests/monitor.c +++ b/dlls/user32/tests/monitor.c @@ -123,7 +123,7 @@ static void test_enumdisplaydevices(void) struct vid_mode { DWORD w, h, bpp, freq, fields; - LONG success; + BOOL must_succeed; }; static const struct vid_mode vid_modes_test[] = { @@ -131,11 +131,11 @@ static const struct vid_mode vid_modes_test[] = { {640, 480, 0, 0, DM_PELSWIDTH | DM_PELSHEIGHT | DM_DISPLAYFREQUENCY, 1}, {640, 480, 0, 0, DM_PELSWIDTH | DM_PELSHEIGHT | DM_BITSPERPEL , 1}, {640, 480, 0, 0, DM_PELSWIDTH | DM_PELSHEIGHT , 1}, - {640, 480, 0, 0, DM_BITSPERPEL , 1}, - {640, 480, 0, 0, DM_DISPLAYFREQUENCY, 1}, + {640, 480, 0, 0, DM_BITSPERPEL , 0}, + {640, 480, 0, 0, DM_DISPLAYFREQUENCY, 0}, - {0, 0, 0, 0, DM_PELSWIDTH, 1}, - {0, 0, 0, 0, DM_PELSHEIGHT, 1}, + {0, 0, 0, 0, DM_PELSWIDTH, 0}, + {0, 0, 0, 0, DM_PELSHEIGHT, 0}, {640, 480, 0, 0, DM_PELSWIDTH, 0}, {640, 480, 0, 0, DM_PELSHEIGHT, 0}, @@ -237,9 +237,9 @@ static void test_ChangeDisplaySettingsEx(void) dm.dmDisplayFrequency = vid_modes_test[i].freq; dm.dmFields = vid_modes_test[i].fields; res = pChangeDisplaySettingsExA(NULL, &dm, NULL, CDS_TEST, NULL); - ok(vid_modes_test[i].success ? + ok(vid_modes_test[i].must_succeed ? (res == DISP_CHANGE_SUCCESSFUL) : - (res == DISP_CHANGE_BADMODE || res == DISP_CHANGE_BADPARAM), + (res == DISP_CHANGE_SUCCESSFUL || res == DISP_CHANGE_BADMODE || res == DISP_CHANGE_BADPARAM), "Unexpected ChangeDisplaySettingsEx() return code for resolution[%d]: %d\n", i, res); if (res == DISP_CHANGE_SUCCESSFUL) @@ -266,7 +266,10 @@ static void test_ChangeDisplaySettingsEx(void) SetRect(&r1, virt.left - 10, virt.top - 10, virt.right + 20, virt.bottom + 20); ok(ClipCursor(&r1), "ClipCursor() failed\n"); ok(GetClipCursor(&r), "GetClipCursor() failed\n"); - ok(EqualRect(&r, &virt), "Invalid clip rect: (%d %d) x (%d %d)\n", r.left, r.top, r.right, r.bottom); + ok(EqualRect(&r, &virt) || + broken(EqualRect(&r, &r1)) /* win9x */, + "Invalid clip rect: (%d %d) x (%d %d)\n", r.left, r.top, r.right, r.bottom); + ClipCursor(&virt); } } res = pChangeDisplaySettingsExA(NULL, NULL, NULL, CDS_RESET, NULL); diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index 01944338295..3d2fd1e9226 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -919,6 +919,7 @@ static const struct message WmShowChildInvisibleParentSeq_1[] = { { WM_WINDOWPOSCHANGING, sent|wparam, SWP_SHOWWINDOW|SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOCOPYBITS|SWP_STATECHANGED }, { WM_NCCALCSIZE, sent|wparam, 1 }, { EVENT_OBJECT_SHOW, winevent_hook|wparam|lparam, 0, 0 }, + { WM_CHILDACTIVATE, sent|optional }, { WM_WINDOWPOSCHANGED, sent|wparam, SWP_SHOWWINDOW|SWP_FRAMECHANGED|SWP_NOACTIVATE|SWP_NOREDRAW|SWP_NOCOPYBITS|SWP_STATECHANGED }, { WM_MOVE, sent|defwinproc }, { WM_SIZE, sent|defwinproc|wparam, SIZE_MINIMIZED }, @@ -1674,7 +1675,7 @@ static void flush_events(void) if (MsgWaitForMultipleObjects( 0, NULL, FALSE, min_timeout, QS_ALLINPUT ) == WAIT_TIMEOUT) break; while (PeekMessage( &msg, 0, 0, 0, PM_REMOVE )) DispatchMessage( &msg ); diff = time - GetTickCount(); - min_timeout = 10; + min_timeout = 20; } } @@ -2690,7 +2691,7 @@ static const struct message WmMaximizeMDIchildInvisibleSeq2[] = { { WM_WINDOWPOSCHANGING, sent|wparam|defwinproc|optional, SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE }, { WM_NCACTIVATE, sent|wparam|defwinproc|optional, 1 }, - { HCBT_SETFOCUS, hook }, + { HCBT_SETFOCUS, hook|optional }, { WM_IME_SETCONTEXT, sent|wparam|optional, 1 }, /* in MDI client */ { EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 }, { WM_SETFOCUS, sent|optional }, /* in MDI client */ @@ -8435,6 +8436,7 @@ struct sendmsg_info static DWORD CALLBACK send_msg_thread( LPVOID arg ) { struct sendmsg_info *info = arg; + SetLastError( 0xdeadbeef ); info->ret = SendMessageTimeoutA( info->hwnd, WM_USER, 0, 0, 0, info->timeout, NULL ); if (!info->ret) ok( GetLastError() == ERROR_TIMEOUT, "unexpected error %d\n", GetLastError()); return 0; @@ -9341,8 +9343,8 @@ static void pump_msg_loop_timeout(DWORD timeout, BOOL inject_mouse_move) DWORD start_ticks, end_ticks; start_ticks = GetTickCount(); - /* add some deviation (5%) to cover not expected delays */ - start_ticks += timeout / 20; + /* add some deviation (50%) to cover not expected delays */ + start_ticks += timeout / 2; do { diff --git a/dlls/user32/user32.spec b/dlls/user32/user32.spec index c9da8ae3165..f19178d5c33 100644 --- a/dlls/user32/user32.spec +++ b/dlls/user32/user32.spec @@ -475,7 +475,7 @@ @ stdcall LockSetForegroundWindow (long) @ stub LockWindowStation @ stdcall LockWindowUpdate(long) -@ stub LockWorkStation +@ stdcall LockWorkStation() @ stdcall LookupIconIdFromDirectory(ptr long) @ stdcall LookupIconIdFromDirectoryEx(ptr long long long long) @ stub MBToWCSEx diff --git a/dlls/user32/user_main.c b/dlls/user32/user_main.c index 1d9e1933291..7b7b8850af2 100644 --- a/dlls/user32/user_main.c +++ b/dlls/user32/user_main.c @@ -391,6 +391,16 @@ BOOL WINAPI ExitWindowsEx( UINT flags, DWORD reason ) } /*********************************************************************** + * LockWorkStation (USER32.@) + */ +BOOL WINAPI LockWorkStation(void) +{ + TRACE(": stub\n"); + SetLastError( ERROR_CALL_NOT_IMPLEMENTED ); + return FALSE; +} + +/*********************************************************************** * RegisterServicesProcess (USER32.@) */ int WINAPI RegisterServicesProcess(DWORD ServicesProcessId) diff --git a/dlls/wined3d/basetexture.c b/dlls/wined3d/basetexture.c index 26940f4340b..ffc01e8fa7a 100644 --- a/dlls/wined3d/basetexture.c +++ b/dlls/wined3d/basetexture.c @@ -389,7 +389,7 @@ void WINAPI IWineD3DBaseTextureImpl_ApplyStateChanges(IWineD3DBaseTexture *iface GLint textureDimensions = IWineD3DBaseTexture_GetTextureDimensions(iface); BOOL cond_np2 = IWineD3DBaseTexture_IsCondNP2(iface); - IWineD3DBaseTexture_PreLoad(iface); + /* ApplyStateChanges relies on the correct texture being bound and loaded. */ if(samplerStates[WINED3DSAMP_ADDRESSU] != This->baseTexture.states[WINED3DTEXSTA_ADDRESSU]) { state = samplerStates[WINED3DSAMP_ADDRESSU]; diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index 088142ede4e..76d449ad7ea 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -36,6 +36,289 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d); */ static IWineD3DDeviceImpl *last_device; +/* FBO helper functions */ + +void context_bind_fbo(IWineD3DDevice *iface, GLenum target, GLuint *fbo) +{ + const IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; + + if (!*fbo) + { + GL_EXTCALL(glGenFramebuffersEXT(1, fbo)); + checkGLcall("glGenFramebuffersEXT()"); + TRACE("Created FBO %d\n", *fbo); + } + + GL_EXTCALL(glBindFramebufferEXT(target, *fbo)); + checkGLcall("glBindFramebuffer()"); +} + +static void context_destroy_fbo(IWineD3DDeviceImpl *This, const GLuint *fbo) +{ + int i = 0; + + GL_EXTCALL(glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, *fbo)); + checkGLcall("glBindFramebuffer()"); + for (i = 0; i < GL_LIMITS(buffers); ++i) + { + GL_EXTCALL(glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT + i, GL_TEXTURE_2D, 0, 0)); + checkGLcall("glFramebufferTexture2D()"); + } + GL_EXTCALL(glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_TEXTURE_2D, 0, 0)); + checkGLcall("glFramebufferTexture2D()"); + GL_EXTCALL(glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0)); + checkGLcall("glBindFramebuffer()"); + GL_EXTCALL(glDeleteFramebuffersEXT(1, fbo)); + checkGLcall("glDeleteFramebuffers()"); +} + +static void context_apply_attachment_filter_states(IWineD3DDevice *iface, IWineD3DSurface *surface, BOOL force_preload) +{ + IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; + const IWineD3DSurfaceImpl *surface_impl = (IWineD3DSurfaceImpl *)surface; + IWineD3DBaseTextureImpl *texture_impl; + BOOL update_minfilter, update_magfilter; + + /* Update base texture states array */ + if (SUCCEEDED(IWineD3DSurface_GetContainer(surface, &IID_IWineD3DBaseTexture, (void **)&texture_impl))) + { + if (texture_impl->baseTexture.states[WINED3DTEXSTA_MINFILTER] != WINED3DTEXF_POINT) + { + texture_impl->baseTexture.states[WINED3DTEXSTA_MINFILTER] = WINED3DTEXF_POINT; + update_minfilter = TRUE; + } + + if (texture_impl->baseTexture.states[WINED3DTEXSTA_MAGFILTER] != WINED3DTEXF_POINT) + { + texture_impl->baseTexture.states[WINED3DTEXSTA_MAGFILTER] = WINED3DTEXF_POINT; + update_magfilter = TRUE; + } + + if (texture_impl->baseTexture.bindCount) + { + WARN("Render targets should not be bound to a sampler\n"); + IWineD3DDeviceImpl_MarkStateDirty(This, STATE_SAMPLER(texture_impl->baseTexture.sampler)); + } + + IWineD3DBaseTexture_Release((IWineD3DBaseTexture *)texture_impl); + } + + if (update_minfilter || update_magfilter || force_preload) + { + GLenum target, bind_target; + GLint old_binding; + + target = surface_impl->glDescription.target; + if (target == GL_TEXTURE_2D) + { + bind_target = GL_TEXTURE_2D; + glGetIntegerv(GL_TEXTURE_BINDING_2D, &old_binding); + } else if (target == GL_TEXTURE_RECTANGLE_ARB) { + bind_target = GL_TEXTURE_RECTANGLE_ARB; + glGetIntegerv(GL_TEXTURE_BINDING_RECTANGLE_ARB, &old_binding); + } else { + bind_target = GL_TEXTURE_CUBE_MAP_ARB; + glGetIntegerv(GL_TEXTURE_BINDING_CUBE_MAP_ARB, &old_binding); + } + + IWineD3DSurface_PreLoad(surface); + + glBindTexture(bind_target, surface_impl->glDescription.textureName); + if (update_minfilter) glTexParameteri(bind_target, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + if (update_magfilter) glTexParameteri(bind_target, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glBindTexture(bind_target, old_binding); + } + + checkGLcall("apply_attachment_filter_states()"); +} + +/* TODO: Handle stencil attachments */ +void context_attach_depth_stencil_fbo(IWineD3DDeviceImpl *This, GLenum fbo_target, IWineD3DSurface *depth_stencil, BOOL use_render_buffer) +{ + IWineD3DSurfaceImpl *depth_stencil_impl = (IWineD3DSurfaceImpl *)depth_stencil; + + TRACE("Attach depth stencil %p\n", depth_stencil); + + if (depth_stencil) + { + if (use_render_buffer && depth_stencil_impl->current_renderbuffer) + { + GL_EXTCALL(glFramebufferRenderbufferEXT(fbo_target, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, depth_stencil_impl->current_renderbuffer->id)); + checkGLcall("glFramebufferRenderbufferEXT()"); + } else { + context_apply_attachment_filter_states((IWineD3DDevice *)This, depth_stencil, TRUE); + + GL_EXTCALL(glFramebufferTexture2DEXT(fbo_target, GL_DEPTH_ATTACHMENT_EXT, depth_stencil_impl->glDescription.target, + depth_stencil_impl->glDescription.textureName, depth_stencil_impl->glDescription.level)); + checkGLcall("glFramebufferTexture2DEXT()"); + } + } else { + GL_EXTCALL(glFramebufferTexture2DEXT(fbo_target, GL_DEPTH_ATTACHMENT_EXT, GL_TEXTURE_2D, 0, 0)); + checkGLcall("glFramebufferTexture2DEXT()"); + } +} + +void context_attach_surface_fbo(IWineD3DDeviceImpl *This, GLenum fbo_target, DWORD idx, IWineD3DSurface *surface) +{ + const IWineD3DSurfaceImpl *surface_impl = (IWineD3DSurfaceImpl *)surface; + + TRACE("Attach surface %p to %u\n", surface, idx); + + if (surface) + { + context_apply_attachment_filter_states((IWineD3DDevice *)This, surface, TRUE); + + GL_EXTCALL(glFramebufferTexture2DEXT(fbo_target, GL_COLOR_ATTACHMENT0_EXT + idx, surface_impl->glDescription.target, + surface_impl->glDescription.textureName, surface_impl->glDescription.level)); + checkGLcall("glFramebufferTexture2DEXT()"); + } else { + GL_EXTCALL(glFramebufferTexture2DEXT(fbo_target, GL_COLOR_ATTACHMENT0_EXT + idx, GL_TEXTURE_2D, 0, 0)); + checkGLcall("glFramebufferTexture2DEXT()"); + } +} + +static void context_check_fbo_status(IWineD3DDevice *iface) +{ + IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; + GLenum status; + + status = GL_EXTCALL(glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT)); + if (status == GL_FRAMEBUFFER_COMPLETE_EXT) + { + TRACE("FBO complete\n"); + } else { + IWineD3DSurfaceImpl *attachment; + int i; + FIXME("FBO status %s (%#x)\n", debug_fbostatus(status), status); + + /* Dump the FBO attachments */ + for (i = 0; i < GL_LIMITS(buffers); ++i) + { + attachment = (IWineD3DSurfaceImpl *)This->activeContext->current_fbo->render_targets[i]; + if (attachment) + { + FIXME("\tColor attachment %d: (%p) %s %ux%u\n", i, attachment, debug_d3dformat(attachment->resource.format), + attachment->pow2Width, attachment->pow2Height); + } + } + attachment = (IWineD3DSurfaceImpl *)This->activeContext->current_fbo->depth_stencil; + if (attachment) + { + FIXME("\tDepth attachment: (%p) %s %ux%u\n", attachment, debug_d3dformat(attachment->resource.format), + attachment->pow2Width, attachment->pow2Height); + } + } +} + +static struct fbo_entry *context_create_fbo_entry(IWineD3DDevice *iface) +{ + IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; + struct fbo_entry *entry; + + entry = HeapAlloc(GetProcessHeap(), 0, sizeof(*entry)); + entry->render_targets = HeapAlloc(GetProcessHeap(), 0, GL_LIMITS(buffers) * sizeof(*entry->render_targets)); + memcpy(entry->render_targets, This->render_targets, GL_LIMITS(buffers) * sizeof(*entry->render_targets)); + entry->depth_stencil = This->stencilBufferTarget; + entry->attached = FALSE; + entry->id = 0; + + return entry; +} + +void context_destroy_fbo_entry(IWineD3DDeviceImpl *This, struct fbo_entry *entry) +{ + if (entry->id) + { + TRACE("Destroy FBO %d\n", entry->id); + context_destroy_fbo(This, &entry->id); + } + list_remove(&entry->entry); + HeapFree(GetProcessHeap(), 0, entry->render_targets); + HeapFree(GetProcessHeap(), 0, entry); +} + + +static struct fbo_entry *context_find_fbo_entry(IWineD3DDevice *iface, WineD3DContext *context) +{ + IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; + struct fbo_entry *entry; + + LIST_FOR_EACH_ENTRY(entry, &context->fbo_list, struct fbo_entry, entry) + { + if (!memcmp(entry->render_targets, This->render_targets, GL_LIMITS(buffers) * sizeof(*entry->render_targets)) + && entry->depth_stencil == This->stencilBufferTarget) + { + return entry; + } + } + + entry = context_create_fbo_entry(iface); + list_add_head(&context->fbo_list, &entry->entry); + return entry; +} + +static void context_apply_fbo_entry(IWineD3DDevice *iface, struct fbo_entry *entry) +{ + IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; + unsigned int i; + + context_bind_fbo(iface, GL_FRAMEBUFFER_EXT, &entry->id); + + if (!entry->attached) + { + /* Apply render targets */ + for (i = 0; i < GL_LIMITS(buffers); ++i) + { + IWineD3DSurface *render_target = This->render_targets[i]; + context_attach_surface_fbo(This, GL_FRAMEBUFFER_EXT, i, render_target); + } + + /* Apply depth targets */ + if (This->stencilBufferTarget) { + unsigned int w = ((IWineD3DSurfaceImpl *)This->render_targets[0])->pow2Width; + unsigned int h = ((IWineD3DSurfaceImpl *)This->render_targets[0])->pow2Height; + + surface_set_compatible_renderbuffer(This->stencilBufferTarget, w, h); + } + context_attach_depth_stencil_fbo(This, GL_FRAMEBUFFER_EXT, This->stencilBufferTarget, TRUE); + + entry->attached = TRUE; + } else { + for (i = 0; i < GL_LIMITS(buffers); ++i) + { + if (This->render_targets[i]) + context_apply_attachment_filter_states(iface, This->render_targets[i], FALSE); + } + if (This->stencilBufferTarget) + context_apply_attachment_filter_states(iface, This->stencilBufferTarget, FALSE); + } + + for (i = 0; i < GL_LIMITS(buffers); ++i) + { + if (This->render_targets[i]) + This->draw_buffers[i] = GL_COLOR_ATTACHMENT0_EXT + i; + else + This->draw_buffers[i] = GL_NONE; + } +} + +static void context_apply_fbo_state(IWineD3DDevice *iface) +{ + IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; + WineD3DContext *context = This->activeContext; + + if (This->render_offscreen) + { + context->current_fbo = context_find_fbo_entry(iface, context); + context_apply_fbo_entry(iface, context->current_fbo); + } else { + context->current_fbo = NULL; + GL_EXTCALL(glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0)); + } + + context_check_fbo_status(iface); +} + /***************************************************************************** * Context_MarkStateDirty * @@ -485,12 +768,7 @@ WineD3DContext *CreateContext(IWineD3DDeviceImpl *This, IWineD3DSurfaceImpl *tar TRACE("Successfully created new context %p\n", ret); - ret->fbo_color_attachments = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IWineD3DSurface *) * GL_LIMITS(buffers)); - if (!ret->fbo_color_attachments) - { - ERR("Out of memory!\n"); - goto out; - } + list_init(&ret->fbo_list); /* Set up the context defaults */ oldCtx = pwglGetCurrentContext(); @@ -586,7 +864,6 @@ WineD3DContext *CreateContext(IWineD3DDeviceImpl *This, IWineD3DSurfaceImpl *tar return ret; out: - HeapFree(GetProcessHeap(), 0, ret->fbo_color_attachments); return NULL; } @@ -632,25 +909,6 @@ static void RemoveContextFromArray(IWineD3DDeviceImpl *This, WineD3DContext *con HeapFree(GetProcessHeap(), 0, oldArray); } -static void destroy_fbo(IWineD3DDeviceImpl *This, const GLuint *fbo) -{ - int i = 0; - - GL_EXTCALL(glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, *fbo)); - checkGLcall("glBindFramebuffer()"); - for (i = 0; i < GL_LIMITS(buffers); ++i) - { - GL_EXTCALL(glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT + i, GL_TEXTURE_2D, 0, 0)); - checkGLcall("glFramebufferTexture2D()"); - } - GL_EXTCALL(glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_TEXTURE_2D, 0, 0)); - checkGLcall("glFramebufferTexture2D()"); - GL_EXTCALL(glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0)); - checkGLcall("glBindFramebuffer()"); - GL_EXTCALL(glDeleteFramebuffersEXT(1, fbo)); - checkGLcall("glDeleteFramebuffers()"); -} - /***************************************************************************** * DestroyContext * @@ -662,6 +920,7 @@ static void destroy_fbo(IWineD3DDeviceImpl *This, const GLuint *fbo) * *****************************************************************************/ void DestroyContext(IWineD3DDeviceImpl *This, WineD3DContext *context) { + struct fbo_entry *entry, *entry2; TRACE("Destroying ctx %p\n", context); @@ -673,24 +932,20 @@ void DestroyContext(IWineD3DDeviceImpl *This, WineD3DContext *context) { ENTER_GL(); - if (context->fbo) { - TRACE("Destroy FBO %d\n", context->fbo); - destroy_fbo(This, &context->fbo); + LIST_FOR_EACH_ENTRY_SAFE(entry, entry2, &context->fbo_list, struct fbo_entry, entry) { + context_destroy_fbo_entry(This, entry); } if (context->src_fbo) { TRACE("Destroy src FBO %d\n", context->src_fbo); - destroy_fbo(This, &context->src_fbo); + context_destroy_fbo(This, &context->src_fbo); } if (context->dst_fbo) { TRACE("Destroy dst FBO %d\n", context->dst_fbo); - destroy_fbo(This, &context->dst_fbo); + context_destroy_fbo(This, &context->dst_fbo); } LEAVE_GL(); - HeapFree(GetProcessHeap(), 0, context->fbo_color_attachments); - context->fbo_color_attachments = NULL; - /* Cleanup the GL context */ pwglMakeCurrent(NULL, NULL); if(context->isPBuffer) { @@ -1225,7 +1480,7 @@ void ActivateContext(IWineD3DDeviceImpl *This, IWineD3DSurface *target, ContextU case CTXUSAGE_CLEAR: case CTXUSAGE_DRAWPRIM: if (wined3d_settings.offscreen_rendering_mode == ORM_FBO) { - apply_fbo_state((IWineD3DDevice *)This); + context_apply_fbo_state((IWineD3DDevice *)This); } if (context->draw_buffer_dirty) { apply_draw_buffer(This, target, FALSE); @@ -1237,8 +1492,8 @@ void ActivateContext(IWineD3DDeviceImpl *This, IWineD3DSurface *target, ContextU if (wined3d_settings.offscreen_rendering_mode == ORM_FBO) { if (This->render_offscreen) { FIXME("Activating for CTXUSAGE_BLIT for an offscreen target with ORM_FBO. This should be avoided.\n"); - bind_fbo((IWineD3DDevice *)This, GL_FRAMEBUFFER_EXT, &context->dst_fbo); - attach_surface_fbo(This, GL_FRAMEBUFFER_EXT, 0, target); + context_bind_fbo((IWineD3DDevice *)This, GL_FRAMEBUFFER_EXT, &context->dst_fbo); + context_attach_surface_fbo(This, GL_FRAMEBUFFER_EXT, 0, target); GL_EXTCALL(glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, 0)); checkGLcall("glFramebufferRenderbufferEXT"); } else { diff --git a/dlls/wined3d/cubetexture.c b/dlls/wined3d/cubetexture.c index b823022e8ec..d84dcbcdfb1 100644 --- a/dlls/wined3d/cubetexture.c +++ b/dlls/wined3d/cubetexture.c @@ -24,7 +24,7 @@ #include "config.h" #include "wined3d_private.h" -WINE_DEFAULT_DEBUG_CHANNEL(d3d); +WINE_DEFAULT_DEBUG_CHANNEL(d3d_texture); #define GLINFO_LOCATION This->resource.wineD3DDevice->adapter->gl_info static const GLenum cube_targets[6] = { @@ -123,7 +123,6 @@ static void WINAPI IWineD3DCubeTextureImpl_PreLoad(IWineD3DCubeTexture *iface) { srgb_was_toggled = (This->baseTexture.is_srgb != srgb_mode); This->baseTexture.is_srgb = srgb_mode; } - IWineD3DCubeTexture_BindTexture(iface); if (This->resource.format == WINED3DFMT_P8 || This->resource.format == WINED3DFMT_A8P8) { for (i = 0; i < This->baseTexture.levels; i++) { diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 9e0cf4f70ca..4ca96e655fa 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -5875,6 +5875,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_UpdateSurface(IWineD3DDevice *iface, /* Make sure the surface is loaded and up to date */ IWineD3DSurface_PreLoad(pDestinationSurface); + IWineD3DSurface_BindTexture(pDestinationSurface); IWineD3DSurface_GetGlDesc(pDestinationSurface, &glDescription); @@ -6121,109 +6122,6 @@ static IWineD3DSwapChain *get_swapchain(IWineD3DSurface *target) { return NULL; } -void bind_fbo(IWineD3DDevice *iface, GLenum target, GLuint *fbo) { - IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; - - if (!*fbo) { - GL_EXTCALL(glGenFramebuffersEXT(1, fbo)); - checkGLcall("glGenFramebuffersEXT()"); - TRACE("Created FBO %d\n", *fbo); - } - GL_EXTCALL(glBindFramebufferEXT(target, *fbo)); - checkGLcall("glBindFramebuffer()"); -} - -/* TODO: Handle stencil attachments */ -void attach_depth_stencil_fbo(IWineD3DDeviceImpl *This, GLenum fbo_target, IWineD3DSurface *depth_stencil, BOOL use_render_buffer) { - IWineD3DSurfaceImpl *depth_stencil_impl = (IWineD3DSurfaceImpl *)depth_stencil; - - if (use_render_buffer && depth_stencil_impl->current_renderbuffer) { - GL_EXTCALL(glFramebufferRenderbufferEXT(fbo_target, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, depth_stencil_impl->current_renderbuffer->id)); - checkGLcall("glFramebufferRenderbufferEXT()"); - } else { - IWineD3DBaseTextureImpl *texture_impl; - GLenum texttarget, target; - GLint old_binding = 0; - - texttarget = depth_stencil_impl->glDescription.target; - if(texttarget == GL_TEXTURE_2D) { - target = GL_TEXTURE_2D; - glGetIntegerv(GL_TEXTURE_BINDING_2D, &old_binding); - } else if(texttarget == GL_TEXTURE_RECTANGLE_ARB) { - target = GL_TEXTURE_RECTANGLE_ARB; - glGetIntegerv(GL_TEXTURE_BINDING_RECTANGLE_ARB, &old_binding); - } else { - target = GL_TEXTURE_CUBE_MAP_ARB; - glGetIntegerv(GL_TEXTURE_BINDING_CUBE_MAP_ARB, &old_binding); - } - - IWineD3DSurface_PreLoad(depth_stencil); - - glBindTexture(target, depth_stencil_impl->glDescription.textureName); - glTexParameteri(target, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(target, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - glTexParameteri(target, GL_DEPTH_TEXTURE_MODE_ARB, GL_LUMINANCE); - glBindTexture(target, old_binding); - - /* Update base texture states array */ - if (SUCCEEDED(IWineD3DSurface_GetContainer(depth_stencil, &IID_IWineD3DBaseTexture, (void **)&texture_impl))) { - texture_impl->baseTexture.states[WINED3DTEXSTA_MINFILTER] = WINED3DTEXF_POINT; - texture_impl->baseTexture.states[WINED3DTEXSTA_MAGFILTER] = WINED3DTEXF_POINT; - if (texture_impl->baseTexture.bindCount) { - IWineD3DDeviceImpl_MarkStateDirty(This, STATE_SAMPLER(texture_impl->baseTexture.sampler)); - } - - IWineD3DBaseTexture_Release((IWineD3DBaseTexture *)texture_impl); - } - - GL_EXTCALL(glFramebufferTexture2DEXT(fbo_target, GL_DEPTH_ATTACHMENT_EXT, texttarget, - depth_stencil_impl->glDescription.textureName, depth_stencil_impl->glDescription.level)); - checkGLcall("glFramebufferTexture2DEXT()"); - } -} - -void attach_surface_fbo(IWineD3DDeviceImpl *This, GLenum fbo_target, DWORD idx, IWineD3DSurface *surface) { - const IWineD3DSurfaceImpl *surface_impl = (IWineD3DSurfaceImpl *)surface; - IWineD3DBaseTextureImpl *texture_impl; - GLenum texttarget, target; - GLint old_binding; - - texttarget = surface_impl->glDescription.target; - if(texttarget == GL_TEXTURE_2D) { - target = GL_TEXTURE_2D; - glGetIntegerv(GL_TEXTURE_BINDING_2D, &old_binding); - } else if(texttarget == GL_TEXTURE_RECTANGLE_ARB) { - target = GL_TEXTURE_RECTANGLE_ARB; - glGetIntegerv(GL_TEXTURE_BINDING_RECTANGLE_ARB, &old_binding); - } else { - target = GL_TEXTURE_CUBE_MAP_ARB; - glGetIntegerv(GL_TEXTURE_BINDING_CUBE_MAP_ARB, &old_binding); - } - - IWineD3DSurface_PreLoad(surface); - - glBindTexture(target, surface_impl->glDescription.textureName); - glTexParameteri(target, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(target, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - glBindTexture(target, old_binding); - - /* Update base texture states array */ - if (SUCCEEDED(IWineD3DSurface_GetContainer(surface, &IID_IWineD3DBaseTexture, (void **)&texture_impl))) { - texture_impl->baseTexture.states[WINED3DTEXSTA_MINFILTER] = WINED3DTEXF_POINT; - texture_impl->baseTexture.states[WINED3DTEXSTA_MAGFILTER] = WINED3DTEXF_POINT; - if (texture_impl->baseTexture.bindCount) { - IWineD3DDeviceImpl_MarkStateDirty(This, STATE_SAMPLER(texture_impl->baseTexture.sampler)); - } - - IWineD3DBaseTexture_Release((IWineD3DBaseTexture *)texture_impl); - } - - GL_EXTCALL(glFramebufferTexture2DEXT(fbo_target, GL_COLOR_ATTACHMENT0_EXT + idx, texttarget, - surface_impl->glDescription.textureName, surface_impl->glDescription.level)); - - checkGLcall("attach_surface_fbo"); -} - static void color_fill_fbo(IWineD3DDevice *iface, IWineD3DSurface *surface, CONST WINED3DRECT *rect, WINED3DCOLOR color) { IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *) iface; IWineD3DSwapChain *swapchain; @@ -6245,8 +6143,8 @@ static void color_fill_fbo(IWineD3DDevice *iface, IWineD3DSurface *surface, CONS ActivateContext(This, This->lastActiveRenderTarget, CTXUSAGE_RESOURCELOAD); ENTER_GL(); - bind_fbo(iface, GL_FRAMEBUFFER_EXT, &This->activeContext->dst_fbo); - attach_surface_fbo(This, GL_FRAMEBUFFER_EXT, 0, surface); + context_bind_fbo(iface, GL_FRAMEBUFFER_EXT, &This->activeContext->dst_fbo); + context_attach_surface_fbo(This, GL_FRAMEBUFFER_EXT, 0, surface); GL_EXTCALL(glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, 0)); checkGLcall("glFramebufferRenderbufferEXT"); } @@ -6276,8 +6174,8 @@ static void color_fill_fbo(IWineD3DDevice *iface, IWineD3DSurface *surface, CONS glClear(GL_COLOR_BUFFER_BIT); checkGLcall("glClear"); - if (This->render_offscreen) { - bind_fbo(iface, GL_FRAMEBUFFER_EXT, &This->activeContext->fbo); + if (This->activeContext->current_fbo) { + context_bind_fbo(iface, GL_FRAMEBUFFER_EXT, &This->activeContext->current_fbo->id); } else { GL_EXTCALL(glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0)); checkGLcall("glBindFramebuffer()"); @@ -6541,115 +6439,6 @@ static HRESULT WINAPI IWineD3DDeviceImpl_GetDepthStencilSurface(IWineD3DDevice } } -/* TODO: Handle stencil attachments */ -static void set_depth_stencil_fbo(IWineD3DDevice *iface, IWineD3DSurface *depth_stencil) { - IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; - - TRACE("Set depth stencil to %p\n", depth_stencil); - - if (depth_stencil) { - attach_depth_stencil_fbo(This, GL_FRAMEBUFFER_EXT, depth_stencil, TRUE); - } else { - GL_EXTCALL(glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_TEXTURE_2D, 0, 0)); - checkGLcall("glFramebufferTexture2DEXT()"); - } -} - -static void set_render_target_fbo(IWineD3DDevice *iface, DWORD idx, IWineD3DSurface *render_target) { - IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; - - TRACE("Set render target %u to %p\n", idx, render_target); - - if (render_target) { - attach_surface_fbo(This, GL_FRAMEBUFFER_EXT, idx, render_target); - This->draw_buffers[idx] = GL_COLOR_ATTACHMENT0_EXT + idx; - } else { - GL_EXTCALL(glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT + idx, GL_TEXTURE_2D, 0, 0)); - checkGLcall("glFramebufferTexture2DEXT()"); - - This->draw_buffers[idx] = GL_NONE; - } -} - -static void check_fbo_status(IWineD3DDevice *iface) { - IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; - GLenum status; - - status = GL_EXTCALL(glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT)); - if (status == GL_FRAMEBUFFER_COMPLETE_EXT) { - TRACE("FBO complete\n"); - } else { - IWineD3DSurfaceImpl *attachment; - int i; - FIXME("FBO status %s (%#x)\n", debug_fbostatus(status), status); - - /* Dump the FBO attachments */ - for (i = 0; i < GL_LIMITS(buffers); ++i) { - attachment = (IWineD3DSurfaceImpl *)This->activeContext->fbo_color_attachments[i]; - if (attachment) { - FIXME("\tColor attachment %d: (%p) %s %ux%u\n", i, attachment, debug_d3dformat(attachment->resource.format), - attachment->pow2Width, attachment->pow2Height); - } - } - attachment = (IWineD3DSurfaceImpl *)This->activeContext->fbo_depth_attachment; - if (attachment) { - FIXME("\tDepth attachment: (%p) %s %ux%u\n", attachment, debug_d3dformat(attachment->resource.format), - attachment->pow2Width, attachment->pow2Height); - } - } -} - -static BOOL depth_mismatch_fbo(IWineD3DDevice *iface) { - IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; - IWineD3DSurfaceImpl *rt_impl = (IWineD3DSurfaceImpl *)This->render_targets[0]; - IWineD3DSurfaceImpl *ds_impl = (IWineD3DSurfaceImpl *)This->stencilBufferTarget; - - if (!ds_impl) return FALSE; - - if (ds_impl->current_renderbuffer) { - return (rt_impl->pow2Width != ds_impl->current_renderbuffer->width || - rt_impl->pow2Height != ds_impl->current_renderbuffer->height); - } - - return (rt_impl->pow2Width != ds_impl->pow2Width || - rt_impl->pow2Height != ds_impl->pow2Height); -} - -void apply_fbo_state(IWineD3DDevice *iface) { - IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; - WineD3DContext *context = This->activeContext; - unsigned int i; - - if (This->render_offscreen) { - bind_fbo(iface, GL_FRAMEBUFFER_EXT, &context->fbo); - - /* Apply render targets */ - for (i = 0; i < GL_LIMITS(buffers); ++i) { - IWineD3DSurface *render_target = This->render_targets[i]; - if (context->fbo_color_attachments[i] != render_target) { - set_render_target_fbo(iface, i, render_target); - context->fbo_color_attachments[i] = render_target; - } - } - - /* Apply depth targets */ - if (context->fbo_depth_attachment != This->stencilBufferTarget || depth_mismatch_fbo(iface)) { - unsigned int w = ((IWineD3DSurfaceImpl *)This->render_targets[0])->pow2Width; - unsigned int h = ((IWineD3DSurfaceImpl *)This->render_targets[0])->pow2Height; - - if (This->stencilBufferTarget) { - surface_set_compatible_renderbuffer(This->stencilBufferTarget, w, h); - } - set_depth_stencil_fbo(iface, This->stencilBufferTarget); - context->fbo_depth_attachment = This->stencilBufferTarget; - } - } else { - GL_EXTCALL(glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0)); - } - - check_fbo_status(iface); -} - void stretch_rect_fbo(IWineD3DDevice *iface, IWineD3DSurface *src_surface, WINED3DRECT *src_rect, IWineD3DSurface *dst_surface, WINED3DRECT *dst_rect, const WINED3DTEXTUREFILTERTYPE filter, BOOL flip) { IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; @@ -6708,8 +6497,8 @@ void stretch_rect_fbo(IWineD3DDevice *iface, IWineD3DSurface *src_surface, WINED } else { TRACE("Source surface %p is offscreen\n", src_surface); ENTER_GL(); - bind_fbo(iface, GL_READ_FRAMEBUFFER_EXT, &This->activeContext->src_fbo); - attach_surface_fbo(This, GL_READ_FRAMEBUFFER_EXT, 0, src_surface); + context_bind_fbo(iface, GL_READ_FRAMEBUFFER_EXT, &This->activeContext->src_fbo); + context_attach_surface_fbo(This, GL_READ_FRAMEBUFFER_EXT, 0, src_surface); glReadBuffer(GL_COLOR_ATTACHMENT0_EXT); checkGLcall("glReadBuffer()"); GL_EXTCALL(glFramebufferRenderbufferEXT(GL_READ_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, 0)); @@ -6756,8 +6545,8 @@ void stretch_rect_fbo(IWineD3DDevice *iface, IWineD3DSurface *src_surface, WINED } ENTER_GL(); - bind_fbo(iface, GL_DRAW_FRAMEBUFFER_EXT, &This->activeContext->dst_fbo); - attach_surface_fbo(This, GL_DRAW_FRAMEBUFFER_EXT, 0, dst_surface); + context_bind_fbo(iface, GL_DRAW_FRAMEBUFFER_EXT, &This->activeContext->dst_fbo); + context_attach_surface_fbo(This, GL_DRAW_FRAMEBUFFER_EXT, 0, dst_surface); glDrawBuffer(GL_COLOR_ATTACHMENT0_EXT); checkGLcall("glDrawBuffer()"); GL_EXTCALL(glFramebufferRenderbufferEXT(GL_DRAW_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, 0)); @@ -6778,8 +6567,8 @@ void stretch_rect_fbo(IWineD3DDevice *iface, IWineD3DSurface *src_surface, WINED IWineD3DSurface_ModifyLocation(dst_surface, SFLAG_INDRAWABLE, TRUE); - if (This->render_offscreen) { - bind_fbo(iface, GL_FRAMEBUFFER_EXT, &This->activeContext->fbo); + if (This->activeContext->current_fbo) { + context_bind_fbo(iface, GL_FRAMEBUFFER_EXT, &This->activeContext->current_fbo->id); } else { GL_EXTCALL(glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0)); checkGLcall("glBindFramebuffer()"); @@ -7587,14 +7376,20 @@ static void WINAPI IWineD3DDeviceImpl_ResourceReleased(IWineD3DDevice *iface, IW } for (i = 0; i < This->numContexts; ++i) { + struct fbo_entry *entry, *entry2; int j; - for (j = 0; j < GL_LIMITS(buffers); ++j) { - if (This->contexts[i]->fbo_color_attachments[j] == (IWineD3DSurface *)resource) { - This->contexts[i]->fbo_color_attachments[j] = NULL; + + LIST_FOR_EACH_ENTRY_SAFE(entry, entry2, &This->contexts[i]->fbo_list, struct fbo_entry, entry) { + BOOL destroyed = FALSE; + for (j = 0; !destroyed && j < GL_LIMITS(buffers); ++j) { + if (entry->render_targets[j] == (IWineD3DSurface *)resource) { + context_destroy_fbo_entry(This, entry); + destroyed = TRUE; + } + } + if (!destroyed && entry->depth_stencil == (IWineD3DSurface *)resource) { + context_destroy_fbo_entry(This, entry); } - } - if (This->contexts[i]->fbo_depth_attachment == (IWineD3DSurface *)resource) { - This->contexts[i]->fbo_depth_attachment = NULL; } } } diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index 9f48da93b12..5d805e39aa1 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -1088,7 +1088,7 @@ BOOL IWineD3DImpl_FillGLCaps(WineD3D_GL_Info *gl_info) { vidmem = 384; /* The 9600GSO has 384MB, the 9600GT has 512-1024MB */ } /* Geforce8 - highend */ - if (strstr(gl_info->gl_renderer, "8800")) { + else if (strstr(gl_info->gl_renderer, "8800")) { gl_info->gl_card = CARD_NVIDIA_GEFORCE_8800GTS; vidmem = 320; /* The 8800GTS uses 320MB, a 8800GTX can have 768MB */ } diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index 358ad141d8b..77b7a86e868 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -3210,6 +3210,8 @@ static void loadTexCoords(IWineD3DStateBlockImpl *stateblock, WineDirect3DVertex GL_EXTCALL(glMultiTexCoord4fARB(GL_TEXTURE0_ARB + textureNo, 0, 0, 0, 1)); } } + + checkGLcall("loadTexCoords"); } static void tex_coordindex(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) { @@ -3487,6 +3489,7 @@ static void sampler(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DCont if(stateblock->textures[sampler]) { IWineD3DBaseTexture_PreLoad(stateblock->textures[sampler]); + IWineD3DBaseTexture_BindTexture(stateblock->textures[sampler]); IWineD3DBaseTexture_ApplyStateChanges(stateblock->textures[sampler], stateblock->textureState[sampler], stateblock->samplerState[sampler]); if (GL_SUPPORT(EXT_TEXTURE_LOD_BIAS)) { diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 5f4aef3444e..be6ffb33c85 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -46,6 +46,11 @@ static void surface_bind_and_dirtify(IWineD3DSurfaceImpl *This) { * Read the unit back instead of switching to 0, this avoids messing around with the state manager's * gl states. The current texture unit should always be a valid one. * + * To be more specific, this is tricky because we can implicitly be called + * from sampler() in state.c. This means we can't touch anything other than + * whatever happens to be the currently active texture, or we would risk + * marking already applied sampler states dirty again. + * * TODO: Track the current active texture per GL context instead of using glGet */ if (GL_SUPPORT(ARB_MULTITEXTURE)) { @@ -2447,6 +2452,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_SaveSnapshot(IWineD3DSurface *iface, const ch } else { /* bind the real texture, and make sure it up to date */ IWineD3DSurface_PreLoad(iface); + surface_bind_and_dirtify(This); } allocatedMemory = HeapAlloc(GetProcessHeap(), 0, width * height * 4); ENTER_GL(); @@ -3989,17 +3995,17 @@ void surface_load_ds_location(IWineD3DSurface *iface, DWORD location) { device->depth_blt_rb_h = This->currentDesc.Height; } - bind_fbo((IWineD3DDevice *)device, GL_FRAMEBUFFER_EXT, &device->activeContext->dst_fbo); + context_bind_fbo((IWineD3DDevice *)device, GL_FRAMEBUFFER_EXT, &device->activeContext->dst_fbo); GL_EXTCALL(glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_RENDERBUFFER_EXT, device->depth_blt_rb)); checkGLcall("glFramebufferRenderbufferEXT"); - attach_depth_stencil_fbo(device, GL_FRAMEBUFFER_EXT, iface, FALSE); + context_attach_depth_stencil_fbo(device, GL_FRAMEBUFFER_EXT, iface, FALSE); /* Do the actual blit */ depth_blt((IWineD3DDevice *)device, device->depth_blt_texture, This->currentDesc.Width, This->currentDesc.Height); checkGLcall("depth_blt"); - if (device->render_offscreen) { - bind_fbo((IWineD3DDevice *)device, GL_FRAMEBUFFER_EXT, &device->activeContext->fbo); + if (device->activeContext->current_fbo) { + context_bind_fbo((IWineD3DDevice *)device, GL_FRAMEBUFFER_EXT, &device->activeContext->current_fbo->id); } else { GL_EXTCALL(glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0)); checkGLcall("glBindFramebuffer()"); @@ -4020,8 +4026,8 @@ void surface_load_ds_location(IWineD3DSurface *iface, DWORD location) { depth_blt((IWineD3DDevice *)device, This->glDescription.textureName, This->currentDesc.Width, This->currentDesc.Height); checkGLcall("depth_blt"); - if (device->render_offscreen) { - GL_EXTCALL(glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, device->activeContext->fbo)); + if (device->activeContext->current_fbo) { + GL_EXTCALL(glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, device->activeContext->current_fbo->id)); checkGLcall("glBindFramebuffer()"); } diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index 4a4893ec8e6..f1384373fa2 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -114,8 +114,6 @@ static void WINAPI IWineD3DTextureImpl_PreLoad(IWineD3DTexture *iface) { This->baseTexture.is_srgb = srgb_mode; } - IWineD3DTexture_BindTexture(iface); - if (This->resource.format == WINED3DFMT_P8 || This->resource.format == WINED3DFMT_A8P8) { for (i = 0; i < This->baseTexture.levels; i++) { if(palette9_changed((IWineD3DSurfaceImpl *)This->surfaces[i])) { diff --git a/dlls/wined3d/volume.c b/dlls/wined3d/volume.c index 2b8b246fd9e..36f0495e47e 100644 --- a/dlls/wined3d/volume.c +++ b/dlls/wined3d/volume.c @@ -23,9 +23,47 @@ #include "config.h" #include "wined3d_private.h" -WINE_DEFAULT_DEBUG_CHANNEL(d3d); +WINE_DEFAULT_DEBUG_CHANNEL(d3d_surface); #define GLINFO_LOCATION This->resource.wineD3DDevice->adapter->gl_info +static void volume_bind_and_dirtify(IWineD3DVolume *iface) { + IWineD3DVolumeImpl *This = (IWineD3DVolumeImpl *)iface; + IWineD3DVolumeTexture *texture; + int active_sampler; + + /* We don't need a specific texture unit, but after binding the texture the current unit is dirty. + * Read the unit back instead of switching to 0, this avoids messing around with the state manager's + * gl states. The current texture unit should always be a valid one. + * + * To be more specific, this is tricky because we can implicitly be called + * from sampler() in state.c. This means we can't touch anything other than + * whatever happens to be the currently active texture, or we would risk + * marking already applied sampler states dirty again. + * + * TODO: Track the current active texture per GL context instead of using glGet + */ + if (GL_SUPPORT(ARB_MULTITEXTURE)) { + GLint active_texture; + ENTER_GL(); + glGetIntegerv(GL_ACTIVE_TEXTURE, &active_texture); + LEAVE_GL(); + active_sampler = This->resource.wineD3DDevice->rev_tex_unit_map[active_texture - GL_TEXTURE0_ARB]; + } else { + active_sampler = 0; + } + + if (active_sampler != -1) { + IWineD3DDeviceImpl_MarkStateDirty(This->resource.wineD3DDevice, STATE_SAMPLER(active_sampler)); + } + + if (SUCCEEDED(IWineD3DSurface_GetContainer(iface, &IID_IWineD3DVolumeTexture, (void **)&texture))) { + IWineD3DVolumeTexture_BindTexture(texture); + IWineD3DVolumeTexture_Release(texture); + } else { + ERR("Volume should be part of a volume texture\n"); + } +} + /* ******************************************* IWineD3DVolume IUnknown parts follow ******************************************* */ @@ -277,6 +315,8 @@ static HRESULT WINAPI IWineD3DVolumeImpl_LoadTexture(IWineD3DVolume *iface, int TRACE("(%p) : level %u, format %s (0x%08x)\n", This, gl_level, debug_d3dformat(format), format); + volume_bind_and_dirtify(iface); + TRACE("Calling glTexImage3D %x level=%d, intfmt=%x, w=%d, h=%d,d=%d, 0=%d, glFmt=%x, glType=%x, Mem=%p\n", GL_TEXTURE_3D, gl_level, diff --git a/dlls/wined3d/volumetexture.c b/dlls/wined3d/volumetexture.c index 2a0356d2e82..035cf905f21 100644 --- a/dlls/wined3d/volumetexture.c +++ b/dlls/wined3d/volumetexture.c @@ -23,7 +23,7 @@ #include "config.h" #include "wined3d_private.h" -WINE_DEFAULT_DEBUG_CHANNEL(d3d); +WINE_DEFAULT_DEBUG_CHANNEL(d3d_texture); #define GLINFO_LOCATION This->resource.wineD3DDevice->adapter->gl_info /* ******************************************* @@ -100,8 +100,6 @@ static void WINAPI IWineD3DVolumeTextureImpl_PreLoad(IWineD3DVolumeTexture *ifac TRACE("(%p) : About to load texture\n", This); - IWineD3DVolumeTexture_BindTexture(iface); - if(!device->isInDraw) { ActivateContext(device, device->lastActiveRenderTarget, CTXUSAGE_RESOURCELOAD); } else if (GL_SUPPORT(EXT_TEXTURE_SRGB) && This->baseTexture.bindCount > 0) { diff --git a/dlls/wined3d/wined3d_main.c b/dlls/wined3d/wined3d_main.c index b75fdf3e612..6ae0e809f3c 100644 --- a/dlls/wined3d/wined3d_main.c +++ b/dlls/wined3d/wined3d_main.c @@ -26,7 +26,7 @@ #include "initguid.h" #include "wined3d_private.h" -WINE_DEFAULT_DEBUG_CHANNEL(wine_d3d); +WINE_DEFAULT_DEBUG_CHANNEL(d3d); int num_lock = 0; void (*wine_tsx11_lock_ptr)(void) = NULL; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 529d4bf0f43..d3478071209 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -613,9 +613,8 @@ struct WineD3DContext { GLint aux_buffers; /* FBOs */ - IWineD3DSurface **fbo_color_attachments; - IWineD3DSurface *fbo_depth_attachment; - GLuint fbo; + struct list fbo_list; + struct fbo_entry *current_fbo; GLuint src_fbo; GLuint dst_fbo; }; @@ -630,7 +629,9 @@ typedef enum ContextUsage { void ActivateContext(IWineD3DDeviceImpl *device, IWineD3DSurface *target, ContextUsage usage); WineD3DContext *CreateContext(IWineD3DDeviceImpl *This, IWineD3DSurfaceImpl *target, HWND win, BOOL create_pbuffer, const WINED3DPRESENT_PARAMETERS *pPresentParms); void DestroyContext(IWineD3DDeviceImpl *This, WineD3DContext *context); -void apply_fbo_state(IWineD3DDevice *iface); +void context_bind_fbo(IWineD3DDevice *iface, GLenum target, GLuint *fbo); +void context_attach_depth_stencil_fbo(IWineD3DDeviceImpl *This, GLenum fbo_target, IWineD3DSurface *depth_stencil, BOOL use_render_buffer); +void context_attach_surface_fbo(IWineD3DDeviceImpl *This, GLenum fbo_target, DWORD idx, IWineD3DSurface *surface); void delete_opengl_contexts(IWineD3DDevice *iface, IWineD3DSwapChain *swapchain); HRESULT create_primary_opengl_context(IWineD3DDevice *iface, IWineD3DSwapChain *swapchain); @@ -1258,6 +1259,15 @@ typedef struct { UINT height; } renderbuffer_entry_t; +struct fbo_entry +{ + struct list entry; + IWineD3DSurface **render_targets; + IWineD3DSurface *depth_stencil; + BOOL attached; + GLuint id; +}; + /***************************************************************************** * IWineD3DClipp implementation structure */ @@ -2431,9 +2441,7 @@ static inline BOOL use_ps(IWineD3DDeviceImpl *device) { void stretch_rect_fbo(IWineD3DDevice *iface, IWineD3DSurface *src_surface, WINED3DRECT *src_rect, IWineD3DSurface *dst_surface, WINED3DRECT *dst_rect, const WINED3DTEXTUREFILTERTYPE filter, BOOL flip); -void bind_fbo(IWineD3DDevice *iface, GLenum target, GLuint *fbo); -void attach_depth_stencil_fbo(IWineD3DDeviceImpl *This, GLenum fbo_target, IWineD3DSurface *depth_stencil, BOOL use_render_buffer); -void attach_surface_fbo(IWineD3DDeviceImpl *This, GLenum fbo_target, DWORD idx, IWineD3DSurface *surface); void depth_blt(IWineD3DDevice *iface, GLuint texture, GLsizei w, GLsizei h); +void context_destroy_fbo_entry(IWineD3DDeviceImpl *This, struct fbo_entry *entry); #endif diff --git a/dlls/winex11.drv/event.c b/dlls/winex11.drv/event.c index b45cecf7e13..a965b9f190c 100644 --- a/dlls/winex11.drv/event.c +++ b/dlls/winex11.drv/event.c @@ -825,12 +825,6 @@ void X11DRV_ConfigureNotify( HWND hwnd, XEvent *xev ) event->x, event->y, event->width, event->height ); X11DRV_X_to_window_rect( data, &rect ); - x = rect.left; - y = rect.top; - cx = rect.right - rect.left; - cy = rect.bottom - rect.top; - flags = SWP_NOACTIVATE | SWP_NOZORDER; - if (is_net_wm_state_maximized( event->display, data )) { if (!IsZoomed( data->hwnd )) @@ -852,21 +846,28 @@ void X11DRV_ConfigureNotify( HWND hwnd, XEvent *xev ) /* Compare what has changed */ - GetWindowRect( hwnd, &rect ); - if (rect.left == x && rect.top == y) flags |= SWP_NOMOVE; + x = rect.left; + y = rect.top; + cx = rect.right - rect.left; + cy = rect.bottom - rect.top; + flags = SWP_NOACTIVATE | SWP_NOZORDER; + + if (data->window_rect.left == x && data->window_rect.top == y) flags |= SWP_NOMOVE; else TRACE( "%p moving from (%d,%d) to (%d,%d)\n", - hwnd, rect.left, rect.top, x, y ); + hwnd, data->window_rect.left, data->window_rect.top, x, y ); - if ((rect.right - rect.left == cx && rect.bottom - rect.top == cy) || - (IsRectEmpty( &rect ) && event->width == 1 && event->height == 1)) + if ((data->window_rect.right - data->window_rect.left == cx && + data->window_rect.bottom - data->window_rect.top == cy) || + (IsRectEmpty( &data->window_rect ) && event->width == 1 && event->height == 1)) { if (flags & SWP_NOMOVE) return; /* if nothing changed, don't do anything */ flags |= SWP_NOSIZE; } else TRACE( "%p resizing from (%dx%d) to (%dx%d)\n", - hwnd, rect.right - rect.left, rect.bottom - rect.top, cx, cy ); + hwnd, data->window_rect.right - data->window_rect.left, + data->window_rect.bottom - data->window_rect.top, cx, cy ); SetWindowPos( hwnd, 0, x, y, cx, cy, flags ); } @@ -911,16 +912,21 @@ static void handle_wm_state_notify( struct x11drv_win_data *data, XPropertyEvent switch(event->state) { case PropertyDelete: + TRACE( "%p/%lx: WM_STATE deleted from %d\n", data->hwnd, data->whole_window, data->wm_state ); data->wm_state = WithdrawnState; - TRACE( "%p/%lx: WM_STATE deleted\n", data->hwnd, data->whole_window ); break; case PropertyNewValue: { + int old_state = data->wm_state; int new_state = get_window_wm_state( event->display, data ); if (new_state != -1 && new_state != data->wm_state) { - TRACE( "%p/%lx: new WM_STATE %d\n", data->hwnd, data->whole_window, new_state ); + TRACE( "%p/%lx: new WM_STATE %d from %d\n", + data->hwnd, data->whole_window, new_state, old_state ); data->wm_state = new_state; + /* ignore the initial state transition out of withdrawn state */ + /* metacity does Withdrawn->NormalState->IconicState when mapping an iconic window */ + if (!old_state) return; } } break; diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index 68d09c91773..aae8f4b2cdf 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -1232,8 +1232,10 @@ static void sync_window_position( Display *display, struct x11drv_win_data *data /* resizing a managed maximized window is not allowed */ if (!(style & WS_MAXIMIZE) || !data->managed) { - if ((changes.width = data->whole_rect.right - data->whole_rect.left) <= 0) changes.width = 1; - if ((changes.height = data->whole_rect.bottom - data->whole_rect.top) <= 0) changes.height = 1; + changes.width = data->whole_rect.right - data->whole_rect.left; + changes.height = data->whole_rect.bottom - data->whole_rect.top; + /* if window rect is empty force size to 1x1 */ + if (changes.width <= 0 || changes.height <= 0) changes.width = changes.height = 1; mask |= CWWidth | CWHeight; } @@ -2130,6 +2132,7 @@ UINT X11DRV_ShowWindow( HWND hwnd, INT cmd, RECT *rect, UINT swp ) if (!data || !data->whole_window || !data->managed || !data->mapped || data->iconic) return swp; if (style & WS_MINIMIZE) return swp; + if (IsRectEmpty( rect )) return swp; /* only fetch the new rectangle if the ShowWindow was a result of a window manager event */ diff --git a/dlls/winspool.drv/info.c b/dlls/winspool.drv/info.c index 81d6b61af61..4737e986393 100644 --- a/dlls/winspool.drv/info.c +++ b/dlls/winspool.drv/info.c @@ -2271,12 +2271,7 @@ BOOL WINAPI AddMonitorA(LPSTR pName, DWORD Level, LPBYTE pMonitors) */ BOOL WINAPI AddMonitorW(LPWSTR pName, DWORD Level, LPBYTE pMonitors) { - monitor_t * pm = NULL; LPMONITOR_INFO_2W mi2w; - HKEY hroot = NULL; - HKEY hentry = NULL; - DWORD disposition; - BOOL res = FALSE; mi2w = (LPMONITOR_INFO_2W) pMonitors; TRACE("(%s, %d, %p) : %s %s %s\n", debugstr_w(pName), Level, pMonitors, @@ -2284,6 +2279,8 @@ BOOL WINAPI AddMonitorW(LPWSTR pName, DWORD Level, LPBYTE pMonitors) debugstr_w(mi2w ? mi2w->pEnvironment : NULL), debugstr_w(mi2w ? mi2w->pDLLName : NULL)); + if ((backend == NULL) && !load_backend()) return FALSE; + if (Level != 2) { SetLastError(ERROR_INVALID_LEVEL); return FALSE; @@ -2294,76 +2291,7 @@ BOOL WINAPI AddMonitorW(LPWSTR pName, DWORD Level, LPBYTE pMonitors) return FALSE; } - if (pName && (pName[0])) { - FIXME("for server %s not implemented\n", debugstr_w(pName)); - SetLastError(ERROR_ACCESS_DENIED); - return FALSE; - } - - - if (!mi2w->pName || (! mi2w->pName[0])) { - WARN("pName not valid : %s\n", debugstr_w(mi2w->pName)); - SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; - } - if (!mi2w->pEnvironment || lstrcmpW(mi2w->pEnvironment, envname_x86W)) { - WARN("Environment %s requested (we support only %s)\n", - debugstr_w(mi2w->pEnvironment), debugstr_w(envname_x86W)); - SetLastError(ERROR_INVALID_ENVIRONMENT); - return FALSE; - } - - if (!mi2w->pDLLName || (! mi2w->pDLLName[0])) { - WARN("pDLLName not valid : %s\n", debugstr_w(mi2w->pDLLName)); - SetLastError(ERROR_INVALID_PARAMETER); - return FALSE; - } - - /* Load and initialize the monitor. SetLastError() is called on failure */ - if ((pm = monitor_load(mi2w->pName, mi2w->pDLLName)) == NULL) { - return FALSE; - } - monitor_unload(pm); - - if(RegCreateKeyW(HKEY_LOCAL_MACHINE, MonitorsW, &hroot) != ERROR_SUCCESS) { - ERR("unable to create key %s\n", debugstr_w(MonitorsW)); - return FALSE; - } - - if(RegCreateKeyExW( hroot, mi2w->pName, 0, NULL, REG_OPTION_NON_VOLATILE, - KEY_WRITE | KEY_QUERY_VALUE, NULL, &hentry, - &disposition) == ERROR_SUCCESS) { - - /* Some installers set options for the port before calling AddMonitor. - We query the "Driver" entry to verify that the monitor is installed, - before we return an error. - When a user installs two print monitors at the same time with the - same name but with a different driver DLL and a task switch comes - between RegQueryValueExW and RegSetValueExW, a race condition - is possible but silently ignored. */ - - DWORD namesize = 0; - - if ((disposition == REG_OPENED_EXISTING_KEY) && - (RegQueryValueExW(hentry, DriverW, NULL, NULL, NULL, - &namesize) == ERROR_SUCCESS)) { - TRACE("monitor %s already exists\n", debugstr_w(mi2w->pName)); - /* NT: ERROR_PRINT_MONITOR_ALREADY_INSTALLED (3006) - 9x: ERROR_ALREADY_EXISTS (183) */ - SetLastError(ERROR_PRINT_MONITOR_ALREADY_INSTALLED); - } - else - { - INT len; - len = (lstrlenW(mi2w->pDLLName) +1) * sizeof(WCHAR); - res = (RegSetValueExW(hentry, DriverW, 0, - REG_SZ, (LPBYTE) mi2w->pDLLName, len) == ERROR_SUCCESS); - } - RegCloseKey(hentry); - } - - RegCloseKey(hroot); - return (res); + return backend->fpAddMonitor(pName, Level, pMonitors); } /****************************************************************** diff --git a/dlls/wintrust/wintrust_main.c b/dlls/wintrust/wintrust_main.c index ed6a8ed9af3..84bd2aa2c95 100644 --- a/dlls/wintrust/wintrust_main.c +++ b/dlls/wintrust/wintrust_main.c @@ -381,6 +381,8 @@ LONG WINAPI WinVerifyTrust( HWND hwnd, GUID *ActionID, LPVOID ActionData ) err = WINTRUST_PublishedSoftware(hwnd, ActionID, ActionData); else { + DWORD stateAction; + /* Check known actions to warn of possible problems */ if (!IsEqualGUID(ActionID, &unknown) && !IsEqualGUID(ActionID, &generic_verify_v2) && @@ -388,7 +390,14 @@ LONG WINAPI WinVerifyTrust( HWND hwnd, GUID *ActionID, LPVOID ActionData ) !IsEqualGUID(ActionID, &generic_chain_verify)) WARN("unknown action %s, default behavior may not be right\n", debugstr_guid(ActionID)); - switch (actionData->dwStateAction) + if (WVT_ISINSTRUCT(WINTRUST_DATA, actionData->cbStruct, dwStateAction)) + stateAction = actionData->dwStateAction; + else + { + TRACE("no dwStateAction, assuming WTD_STATEACTION_IGNORE\n"); + stateAction = WTD_STATEACTION_IGNORE; + } + switch (stateAction) { case WTD_STATEACTION_IGNORE: err = WINTRUST_DefaultVerifyAndClose(hwnd, ActionID, ActionData); @@ -598,6 +607,8 @@ BOOL WINAPI WINTRUST_AddStore(CRYPT_PROVIDER_DATA *data, HCERTSTORE store) { BOOL ret = FALSE; + TRACE("(%p, %p)\n", data, store); + if (data->chStores) data->pahStores = WINTRUST_ReAlloc(data->pahStores, (data->chStores + 1) * sizeof(HCERTSTORE)); @@ -621,6 +632,8 @@ BOOL WINAPI WINTRUST_AddSgnr(CRYPT_PROVIDER_DATA *data, { BOOL ret = FALSE; + TRACE("(%p, %d, %d, %p)\n", data, fCounterSigner, idxSigner, sgnr); + if (sgnr->cbStruct > sizeof(CRYPT_PROVIDER_SGNR)) { SetLastError(ERROR_INVALID_PARAMETER); @@ -672,6 +685,9 @@ BOOL WINAPI WINTRUST_AddCert(CRYPT_PROVIDER_DATA *data, DWORD idxSigner, { BOOL ret = FALSE; + TRACE("(%p, %d, %d, %d, %p)\n", data, idxSigner, fCounterSigner, + idxSigner, pCert2Add); + if (fCounterSigner) { FIXME("unimplemented for counter signers\n"); diff --git a/include/amvideo.idl b/include/amvideo.idl index 37d06ff0841..ea486d5e887 100644 --- a/include/amvideo.idl +++ b/include/amvideo.idl @@ -204,7 +204,7 @@ typedef struct tagVIDEOINFO RGBQUAD bmiColors[iPALETTE_COLORS]; DWORD dwBitMasks[iMASK_COLORS]; TRUECOLORINFO TrueColorInfo; - }; + } DUMMYUNIONNAME; } VIDEOINFO; typedef struct tagMPEG1VIDEOINFO diff --git a/include/cryptdlg.h b/include/cryptdlg.h index 6a012c78a76..47bd9843d59 100644 --- a/include/cryptdlg.h +++ b/include/cryptdlg.h @@ -278,7 +278,7 @@ typedef struct _CERT_VERIFY_CERTIFICATE_TRUST LPSTR pszUsageOid; HCRYPTPROV hprov; DWORD cRootStores; - HCERTSTORE rghstoreRoots; + HCERTSTORE *rghstoreRoots; DWORD cStores; HCERTSTORE *rghstoreCAs; DWORD cTrustStores; diff --git a/include/cryptuiapi.h b/include/cryptuiapi.h index 3d027f5444e..f2efe8fdf61 100644 --- a/include/cryptuiapi.h +++ b/include/cryptuiapi.h @@ -69,6 +69,26 @@ typedef struct tagCRYPTUI_INITDIALOG_STRUCT PCCERT_CONTEXT pCertContext; } CRYPTUI_INITDIALOG_STRUCT, *PCRYPTUI_INITDIALOG_STRUCT; +/* Values for CRYPTUI_VIEWCERTIFICATE_STRUCT's dwFlags */ +#define CRYPTUI_HIDE_HIERARCHYPAGE 0x00000001 +#define CRYPTUI_HIDE_DETAILPAGE 0x00000002 +#define CRYPTUI_DISABLE_EDITPROPERTIES 0x00000004 +#define CRYPTUI_ENABLE_EDITPROPERTIES 0x00000008 +#define CRYPTUI_DISABLE_ADDTOSTORE 0x00000010 +#define CRYPTUI_ENABLE_ADDTOSTORE 0x00000020 +#define CRYPTUI_ACCEPT_DECLINE_STYLE 0x00000040 +#define CRYPTUI_IGNORE_UNTRUSTED_ROOT 0x00000080 +#define CRYPTUI_DONT_OPEN_STORES 0x00000100 +#define CRYPTUI_ONLY_OPEN_ROOT_STORE 0x00000200 +#define CRYPTUI_WARN_UNTRUSTED_ROOT 0x00000400 +#define CRYPTUI_ENABLE_REVOCATION_CHECKING 0x00000800 +#define CRYPTUI_WARN_REMOTE_TRUST 0x00001000 +#define CRYPTUI_DISABLE_EXPORT 0x00002000 +#define CRYPTUI_ENABLE_REVOCATION_CHECK_END_CERT 0x00004000 +#define CRYPTUI_ENABLE_REVOCATION_CHECK_CHAIN 0x00008000 +#define CRYPTUI_ENABLE_REVOCATION_CHECK_CHAIN_EXCLUDE_ROOT CRYPTUI_ENABLE_REVOCATION_CHECKING +#define CRYPTUI_DISABLE_HTMLLINK 0x00010000 + typedef struct tagCRYPTUI_VIEWCERTIFICATE_STRUCTA { DWORD dwSize; diff --git a/include/d3d10.idl b/include/d3d10.idl index 120f8845a91..032063ffe8d 100644 --- a/include/d3d10.idl +++ b/include/d3d10.idl @@ -560,7 +560,7 @@ typedef struct D3D10_DEPTH_STENCIL_VIEW_DESC { D3D10_TEX2D_ARRAY_DSV Texture2DArray; D3D10_TEX2DMS_DSV Texture2DMS; D3D10_TEX2DMS_ARRAY_DSV Texture2DMSArray; - }; + } DUMMYUNIONNAME; } D3D10_DEPTH_STENCIL_VIEW_DESC; typedef enum D3D10_RTV_DIMENSION { @@ -627,7 +627,7 @@ typedef struct D3D10_RENDER_TARGET_VIEW_DESC { D3D10_TEX2DMS_RTV Texture2DMS; D3D10_TEX2DMS_ARRAY_RTV Texture2DMSArray; D3D10_TEX3D_RTV Texture3D; - }; + } DUMMYUNIONNAME; } D3D10_RENDER_TARGET_VIEW_DESC; typedef enum D3D10_SRV_DIMENSION { @@ -704,7 +704,7 @@ typedef struct D3D10_SHADER_RESOURCE_VIEW_DESC { D3D10_TEX2DMS_ARRAY_SRV Texture2DMSArray; D3D10_TEX3D_SRV Texture3D; D3D10_TEXCUBE_SRV TextureCube; - }; + } DUMMYUNIONNAME; } D3D10_SHADER_RESOURCE_VIEW_DESC; typedef struct D3D10_BOX { diff --git a/include/imnxport.idl b/include/imnxport.idl index 50f3e4e08ce..baf29d31a95 100644 --- a/include/imnxport.idl +++ b/include/imnxport.idl @@ -433,7 +433,7 @@ interface ISMTPCallback : ITransportCallback { [case(SMTP_SEND_STREAM)] SMTPSTREAM rStreamInfo; [default]; - }; + } DUMMYUNIONNAME; } SMTPRESPONSE, *LPSMTPRESPONSE; HRESULT OnResponse( @@ -604,7 +604,7 @@ interface IPOP3Callback : ITransportCallback [case(POP3_RETR)] POP3RETR rRetrInfo; [case(POP3_TOP)] POP3TOP rTopInfo; [default]; - }; + } DUMMYUNIONNAME; } POP3RESPONSE, *LPPOP3RESPONSE; HRESULT OnResponse( diff --git a/include/mimeole.idl b/include/mimeole.idl index b94163dba86..487b9fc80a6 100644 --- a/include/mimeole.idl +++ b/include/mimeole.idl @@ -1074,6 +1074,8 @@ cpp_quote("#endif") ] interface IMimeEnumProperties : IUnknown { + typedef [unique] IMimeEnumProperties *LPMIMEENUMPROPERTIES; + typedef struct tagENUMPROPERTY { LPSTR pszName; @@ -1081,7 +1083,22 @@ cpp_quote("#endif") DWORD dwPropId; } ENUMPROPERTY, *LPENUMPROPERTY; - /* FIXME: fill this in */ + HRESULT Next( + [in] ULONG cFetch, + [in, out] LPENUMPROPERTY prgProp, + [out] ULONG *pcFetched); + + HRESULT Skip( + [in] ULONG cItems); + + HRESULT Reset(void); + + HRESULT Clone( + [out] IMimeEnumProperties **ppEnum); + + HRESULT Count( + [out] ULONG *pcItems); + } [ diff --git a/include/objidl.idl b/include/objidl.idl index e0d83fa63b7..b3dcf654979 100644 --- a/include/objidl.idl +++ b/include/objidl.idl @@ -1424,7 +1424,7 @@ interface IAdviseSink : IUnknown case TYMED_FILE: LPOLESTR lpszFileName; case TYMED_ISTREAM: BYTE_BLOB *pstm; case TYMED_ISTORAGE: BYTE_BLOB *pstg; - }; + } DUMMYUNIONNAME; IUnknown *pUnkForRelease; } userSTGMEDIUM; diff --git a/include/propidl.idl b/include/propidl.idl index 6720988d854..be673943d9a 100644 --- a/include/propidl.idl +++ b/include/propidl.idl @@ -201,7 +201,7 @@ interface IPropertyStorage : IUnknown [case(VT_BYREF|VT_DISPATCH)] IDispatch **ppdispVal; [case(VT_BYREF|VT_ARRAY)] LPSAFEARRAY *pparray; [case(VT_BYREF|VT_VARIANT)] PROPVARIANT *pvarVal; - }; + } DUMMYUNIONNAME; }; typedef struct tagPROPVARIANT *LPPROPVARIANT; @@ -255,7 +255,7 @@ interface IPropertyStorage : IUnknown [case(PRSPEC_PROPID)] PROPID propid; [case(PRSPEC_LPWSTR)] LPOLESTR lpwstr; [default] ; - }; + } DUMMYUNIONNAME; } PROPSPEC; typedef struct tagSTATPROPSTG { diff --git a/include/shobjidl.idl b/include/shobjidl.idl index 7a4bd88e187..95e532cdecc 100644 --- a/include/shobjidl.idl +++ b/include/shobjidl.idl @@ -1377,3 +1377,22 @@ interface ITaskbarList : IUnknown HRESULT SetActiveAlt( [in] HWND hwnd); } + +/***************************************************************************** + * IAutoCompleteDropDown interface + */ +[ + object, + uuid(3CD141F4-3C6A-11d2-BCAA-00C04FD929DB), + pointer_default(unique) +] +interface IAutoCompleteDropDown : IUnknown +{ +cpp_quote("#define ACDD_VISIBLE 0x0001") + + HRESULT GetDropDownStatus( + [out] DWORD *pdwFlags, + [out, string] LPWSTR *ppwszString); + + HRESULT ResetEnumerator(); +} diff --git a/include/wintrust.h b/include/wintrust.h index 2e4006b2b8a..228d868d8c4 100644 --- a/include/wintrust.h +++ b/include/wintrust.h @@ -385,6 +385,10 @@ typedef struct _CRYPT_PROVUI_FUNCS { #include +#define WVT_OFFSETOF(t,f) ((ULONG)((ULONG_PTR)(&((t*)0)->f))) +#define WVT_ISINSTRUCT(t,s,f) (WVT_OFFSETOF(t,f) + sizeof(((t*)0)->f) <= (s)) +#define WVT_IS_CBSTRUCT_GT_MEMBEROFFSET(t,s,f) WVT_ISINSTRUCT(t,s,f) + #define WTPF_TRUSTTEST 0x00000020 #define WTPF_TESTCANBEVALID 0x00000080 #define WTPF_IGNOREEXPIRATION 0x00000100 diff --git a/programs/explorer/desktop.c b/programs/explorer/desktop.c index 8c6259d9fdd..a74c621bfcb 100644 --- a/programs/explorer/desktop.c +++ b/programs/explorer/desktop.c @@ -18,6 +18,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include "config.h" +#include "wine/port.h" #include #include "wine/unicode.h" @@ -34,6 +36,22 @@ WINE_DEFAULT_DEBUG_CHANNEL(explorer); static BOOL using_root; +/* screen saver handler */ +static BOOL start_screensaver( void ) +{ + if (using_root) + { + const char *argv[3] = { "xdg-screensaver", "activate", NULL }; + int pid = spawnvp( _P_NOWAIT, argv[0], argv ); + if (pid > 0) + { + WINE_TRACE( "started process %d\n", pid ); + return TRUE; + } + } + return FALSE; +} + /* window procedure for the desktop window */ static LRESULT WINAPI desktop_wnd_proc( HWND hwnd, UINT message, WPARAM wp, LPARAM lp ) { @@ -42,7 +60,14 @@ static LRESULT WINAPI desktop_wnd_proc( HWND hwnd, UINT message, WPARAM wp, LPAR switch(message) { case WM_SYSCOMMAND: - if ((wp & 0xfff0) == SC_CLOSE) ExitWindows( 0, 0 ); + switch(wp & 0xfff0) + { + case SC_CLOSE: + ExitWindows( 0, 0 ); + break; + case SC_SCREENSAVE: + return start_screensaver(); + } return 0; case WM_CLOSE: diff --git a/programs/oleview/Ja.rc b/programs/oleview/Ja.rc new file mode 100644 index 00000000000..9402dd73204 --- /dev/null +++ b/programs/oleview/Ja.rc @@ -0,0 +1,213 @@ +/* + * OleView (Ja.rc) + * Japanese Language Support + * + * Copyright 2006 Piotr Caban + * + * 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_JAPANESE, SUBLANG_DEFAULT + +IDM_MENU MENU +{ + POPUP "ƒtƒ@ƒCƒ‹(&F)" + { + MENUITEM "ƒtƒ@ƒCƒ‹‚ɃoƒCƒ“ƒh(&B)...", IDM_BIND + MENUITEM "TypeLib ‚Ì•\\Ž¦(&V)...", IDM_TYPELIB + MENUITEM SEPARATOR + MENUITEM "ƒVƒXƒeƒ€�Ý’è(&S)...", IDM_SYSCONF + MENUITEM "ƒŒƒWƒXƒgƒŠ ƒGƒfƒBƒ^‚ÌŽÀ�s(&R)", IDM_REGEDIT + MENUITEM SEPARATOR + MENUITEM "�I—¹(&X)", IDM_EXIT + } + POPUP "ƒIƒuƒWƒFƒNƒg(&O)" + { + POPUP "&CoCreateInstance ƒtƒ‰ƒO" + { + MENUITEM "CLSCTX_&INPROC_SERVER", IDM_FLAG_INSERV,CHECKED + MENUITEM "CLSCTX_INPROC_&HANDLER", IDM_FLAG_INHANDL + MENUITEM "CLSCTX_&LOCAL_SERVER", IDM_FLAG_LOCSERV,CHECKED + MENUITEM "CLSCTX_&REMOTE_SERVER", IDM_FLAG_REMSERV + } + MENUITEM SEPARATOR + MENUITEM "ƒ^ƒCƒv�î•ñ‚Ì•\\Ž¦(&T)", IDM_TYPEINFO, GRAYED + MENUITEM SEPARATOR + MENUITEM "ƒCƒ“ƒXƒ^ƒ“ƒX‚Ì�ì�¬(&I)", IDM_CREATEINST, GRAYED + MENUITEM "Create Instance &On...", IDM_CREATEINSTON, GRAYED + MENUITEM "ƒCƒ“ƒXƒ^ƒ“ƒX‚ÌŠJ•ú(&R)", IDM_RELEASEINST, GRAYED + MENUITEM SEPARATOR + MENUITEM "C&LSID ‚ðƒNƒŠƒbƒvƒ{�[ƒh‚ɃRƒs�[", IDM_COPYCLSID, GRAYED + MENUITEM "&HTML ƒIƒuƒWƒFƒNƒg ƒ^ƒO‚ðƒNƒŠƒbƒvƒ{�[ƒh‚ɃRƒs�[", IDM_HTMLTAG, GRAYED + MENUITEM SEPARATOR + MENUITEM "•\\Ž¦(&V)...", IDM_VIEW, GRAYED + } + POPUP "•\\Ž¦(&V)" + { + MENUITEM "�㋉ƒ‚�[ƒh(&E)", IDM_EXPERT,CHECKED + MENUITEM SEPARATOR + MENUITEM "‰B‚³‚ꂽƒRƒ“ƒ|�[ƒlƒ“ƒg‚̃JƒeƒSƒŠ(&H)", IDM_HIDDEN, GRAYED + MENUITEM SEPARATOR + MENUITEM "ƒc�[ƒ‹ ƒo�[(&T)", IDM_TOOLBAR,CHECKED + MENUITEM "ƒXƒe�[ƒ^ƒX ƒo�[(&S)", IDM_STATUSBAR,CHECKED + MENUITEM SEPARATOR + MENUITEM "�X�V(&R)\tF5", IDM_REFRESH + } + POPUP "ƒwƒ‹ƒv(&H)" + { + MENUITEM "OleView ‚ɂ‚¢‚Ä(&A)", IDM_ABOUT + } +} + +IDM_TYPELIB MENU +{ + POPUP "ƒtƒ@ƒCƒ‹(&F)" + { + MENUITEM "–¼‘O‚ð•t‚¯‚Ä•Û‘¶(&S)...", IDM_SAVEAS + MENUITEM "•Â‚¶‚é(&C)", IDM_CLOSE + } + POPUP "•\\Ž¦(&V)" + { + MENUITEM "ƒ^ƒCƒv‚ÌŽí—Þ‚Å•ª—Þ(&G)", IDM_GROUP + MENUITEM SEPARATOR + MENUITEM "ƒc�[ƒ‹ ƒo�[(&T)", IDM_TOOLBAR + MENUITEM "ƒXƒe�[ƒ^ƒX ƒo�[(&S)", IDM_STATUSBAR,CHECKED + } +} + +STRINGTABLE +{ + IDS_APPNAME "OleView" + IDS_APPTITLE "OleView" + IDS_READY "‘Ò‹@’†" + IDS_ABOUT "OleView - OLE/COM ƒIƒuƒWƒFƒNƒg ƒrƒ…ƒA�[" + IDS_ABOUTVER "ƒo�[ƒWƒ‡ƒ“ 1.0" + IDS_TYPELIBTITLE "ITypeLib ƒrƒ…ƒA�[" + IDS_OPEN "ŠJ‚­" + IDS_OPEN_TYPELIB_FILTER "TypeLib ƒtƒ@ƒCƒ‹ (*.tlb;*.olb;*.dll;*.ocx;*.exe)\0*.tlb;*.olb;*.dll;*.ocx;*.exe\0‚·‚ׂẴtƒ@ƒCƒ‹ (*.*)\0*.*\0\0" + + IDM_BIND, "File Moniker ‚ð’Ê‚¶‚ătƒ@ƒCƒ‹‚ɃoƒCƒ“ƒh‚µ‚Ü‚·" + IDM_TYPELIB, "TypeLib ƒtƒ@ƒCƒ‹‚ðŠJ‚¢‚Ä’†�g‚ð•\\Ž¦‚µ‚Ü‚·" + IDM_SYSCONF, "ƒ}ƒVƒ“‘S‘Ì‚Ì•ªŽU COM ‚Ì�Ý’è‚ð•Ï�X‚µ‚Ü‚·" + IDM_REGEDIT, "Wine ƒŒƒWƒXƒgƒŠ ƒGƒfƒBƒ^‚ðŽÀ�s‚µ‚Ü‚·" + IDM_EXIT, "ƒAƒvƒŠƒP�[ƒVƒ‡ƒ“‚ð�I—¹‚µ‚Ü‚·�B•Ï�X‚ð•Û‘¶‚·‚é‚悤‚É‘£‚µ‚Ü‚·" + IDM_CREATEINST, "‘I‘ð‚³‚ê‚½ƒIƒuƒWƒFƒNƒg‚̃Cƒ“ƒXƒ^ƒ“ƒX‚ð�ì�¬‚µ‚Ü‚·" + IDM_CREATEINSTON, "“Á’è‚̃}ƒVƒ“�ã‚Ì‘I‘ð‚³‚ê‚½ƒIƒuƒWƒFƒNƒg‚̃Cƒ“ƒXƒ^ƒ“ƒX‚ð�ì�¬‚µ‚Ü‚·" + IDM_RELEASEINST, "Œ»�Ý‘I‘ð‚³‚ê‚½ƒIƒuƒWƒFƒNƒg‚̃Cƒ“ƒXƒ^ƒ“ƒX‚ðŠJ•ú‚µ‚Ü‚·" + IDM_COPYCLSID, "Œ»�Ý‘I‘ð‚³‚ê‚½�€–Ú‚Ì GUID ‚ðƒNƒŠƒbƒvƒ{�[ƒh‚ɃRƒs�[‚µ‚Ü‚·" + IDM_VIEW, "‘I‘ð‚³‚ê‚½�€–ڂ̃rƒ…ƒA�[‚ð•\\Ž¦‚µ‚Ü‚·" + IDM_FLAG_INSERV, "CoGetClassObject ‚ðŒÄ‚Ô‚Æ‚«‚É CLSCTX_INPROC_SERVER ‚ðŽg‚¢‚Ü‚·" + IDM_FLAG_INHANDL, "CoGetClassObject ‚ðŒÄ‚Ô‚Æ‚«‚É CLSCTX_INPROC_HANDLER ‚ðŽg‚¢‚Ü‚·" + IDM_FLAG_LOCSERV, "CoGetClassObject ‚ðŒÄ‚Ô‚Æ‚«‚É CLSCTX_LOCAL_SERVER ‚ðŽg‚¢‚Ü‚·" + IDM_FLAG_REMSERV, "CoGetClassObject ‚ðŒÄ‚Ô‚Æ‚«‚É CLSCTX_REMOTE_SERVER ‚ðŽg‚¢‚Ü‚·" + IDM_EXPERT, "�㋉‚Æ�‰‹‰•\\Ž¦ƒ‚�[ƒh‚ð�Ø‚è‘Ö‚¦‚Ü‚·" + IDM_HIDDEN, "•\Ž¦‚·‚é‚悤‚É‚È‚Á‚Ä‚¢‚È‚¢ƒRƒ“ƒ|�[ƒlƒ“ƒg‚̃JƒeƒSƒŠ‚Ì•\Ž¦‚ð�Ø‚è‘Ö‚¦‚Ü‚·" + IDM_TOOLBAR, "ƒc�[ƒ‹ ƒo�[‚Ì•\\Ž¦/”ñ•\\Ž¦‚ð�Ø‚è‘Ö‚¦‚Ü‚·" + IDM_STATUSBAR, "ƒXƒe�[ƒ^ƒX ƒo�[‚Ì•\\Ž¦/”ñ•\\Ž¦‚ð�Ø‚è‘Ö‚¦‚Ü‚·" + IDM_REFRESH, "‚·‚ׂẴŠƒXƒg‚ð�X�V‚µ‚Ü‚·" + IDM_ABOUT, "ƒvƒ�ƒOƒ‰ƒ€�î•ñ�Aƒo�[ƒWƒ‡ƒ“”Ô�†‚Æ’˜�쌠‚ð•\\Ž¦‚µ‚Ü‚·" + + IDM_SAVEAS, ".IDL ‚Ü‚½‚Í .H ƒtƒ@ƒCƒ‹‚Æ‚µ‚Ä•Û‘¶‚µ‚Ü‚·" + IDM_CLOSE, "ƒEƒBƒ“ƒhƒE‚ð•Â‚¶‚Ü‚·" + IDM_GROUP, "Ží—ނŃ^ƒCƒv�î•ñ‚𕪗ނµ‚Ü‚·" + + IDS_TREE_OC, "ObjectClasses" + IDS_TREE_GBCC, "ƒRƒ“ƒ|�[ƒlƒ“ƒg‚̃JƒeƒSƒŠ‚Å•ª—Þ" + IDS_TREE_O1O, "OLE 1.0 ƒIƒuƒWƒFƒNƒg" + IDS_TREE_CLO, "COM ƒ‰ƒCƒuƒ‰ƒŠ ƒIƒuƒWƒFƒNƒg" + IDS_TREE_AO, "‚·‚ׂẴIƒuƒWƒFƒNƒg" + IDS_TREE_AID, "ƒAƒvƒŠƒP�[ƒVƒ‡ƒ“ ID" + IDS_TREE_TL, "ƒ^ƒCƒv ƒ‰ƒCƒuƒ‰ƒŠ" + IDS_TL_VER, "ƒo�[ƒWƒ‡ƒ“" + IDS_TREE_I, "ƒCƒ“ƒ^�[ƒtƒFƒCƒX" + + IDS_TAB_REG, "Registry" + IDS_TAB_IMPL, "Implementation" + IDS_TAB_ACTIV, "Activation" + + IDS_CGCOFAIL, "CoGetClassObject ‚ªŽ¸”s‚µ‚Ü‚µ‚½�B" + IDS_ERROR_UNKN, "•s–¾‚ȃGƒ‰�[" + IDS_TRUE, "True" + IDS_FALSE, "False" + IDS_BYTES, "ƒoƒCƒg" + + IDS_ERROR_LOADTYPELIB, "LoadTypeLib( %s ) ‚ªŽ¸”s‚µ‚Ü‚µ‚½ ($%x)" + IDS_INHERITINTERFACES, "Œp�³‚³‚ꂽƒCƒ“ƒ^�[ƒtƒFƒCƒX" +} + +DLG_CREATEINSTON DIALOG DISCARDABLE 0, 0, 250, 41 +STYLE DS_MODALFRAME | DS_NOIDLEMSG | WS_CAPTION | WS_SYSMENU +CAPTION "‘¼‚̃}ƒVƒ“‚É�Ú‘±" +FONT 9, "MS Shell Dlg" +{ + LTEXT "ƒ}ƒVƒ“–¼(&M):", IDIGNORE, 5, 6, 190, 8 + EDITTEXT IDC_MACHINE, 5, 16, 190, 12, WS_BORDER | WS_TABSTOP | ES_AUTOHSCROLL + DEFPUSHBUTTON "&OK", IDOK, 200, 5, 45, 14 + PUSHBUTTON "ƒLƒƒƒ“ƒZƒ‹(&C)", IDCANCEL, 200, 22, 45, 14 +} + +DLG_SYSCONF DIALOG DISCARDABLE 0, 0, 170, 100 +STYLE DS_MODALFRAME | DS_NOIDLEMSG | WS_CAPTION | WS_SYSMENU +CAPTION "ƒVƒXƒeƒ€�Ý’è" +FONT 9, "MS Shell Dlg" +{ + LTEXT "ƒVƒXƒeƒ€�Ý’è", IDIGNORE, 5, 6, 160, 8 + CHECKBOX "•ªŽU COM ‚ð—LŒø‚É‚·‚é(&E)", IDC_ENABLEDCOM, 5, 20, 160, 10, WS_TABSTOP | WS_GROUP | BS_AUTOCHECKBOX + CHECKBOX "ƒŠƒ‚�[ƒg�Ú‘±‚ð—LŒø‚É‚·‚é(Win95 ‚Ì‚Ý)(&R)", IDC_ENABLEREMOTE, 5, 35, 160, 10, WS_TABSTOP | WS_GROUP | BS_AUTOCHECKBOX + LTEXT "‚±‚ê‚ç‚Ì�Ý’è‚̓ŒƒWƒXƒ^�[‚Ì’l‚Ì‚Ý‚ð•Ï‚¦‚Ü‚·�B\nWine ‚̃pƒtƒH�[ƒ}ƒ“ƒX‚ɂ͉e‹¿‚µ‚Ü‚¹‚ñ�B", IDIGNORE, 5, 50, 160, 40 + DEFPUSHBUTTON "&OK", IDOK, 70, 80, 45, 14 + PUSHBUTTON "ƒLƒƒƒ“ƒZƒ‹(&C)", IDCANCEL, 120, 80, 45, 14 +} + +DLG_DEFAULT_IV DIALOG DISCARDABLE 0, 0, 280, 50 +STYLE DS_MODALFRAME | DS_NOIDLEMSG | WS_CAPTION | WS_SYSMENU +CAPTION "Šù’è‚̃Cƒ“ƒ^�[ƒtƒFƒCƒX ƒrƒ…ƒA�[" +FONT 9, "MS Shell Dlg" +{ + LTEXT "ƒCƒ“ƒ^�[ƒtƒFƒCƒX", IDIGNORE, 5, 6, 50, 8 + LTEXT "", IDC_LABEL, 60, 6, 145, 8 + LTEXT "IID:", IDIGNORE, 5, 16, 50, 8 + LTEXT "", IDC_IDENTIFIER, 60, 16, 165, 8 + DEFPUSHBUTTON "•Â‚¶‚é(&C)", IDCANCEL, 230, 6, 45, 14 + PUSHBUTTON "ƒ^ƒCƒv�î•ñ‚ð•\\Ž¦(&V)", IDC_VIEWTYPEINFO, 6, 31, 70, 14, WS_DISABLED +} + +DLG_IPERSIST_IV DIALOG DISCARDABLE 0, 0, 280, 29 +STYLE DS_MODALFRAME | DS_NOIDLEMSG | WS_CAPTION | WS_SYSMENU +CAPTION "IPersist ƒCƒ“ƒ^�[ƒtƒFƒCƒX ƒrƒ…ƒA�[" +FONT 9, "MS Shell Dlg" +{ + LTEXT "ƒNƒ‰ƒX–¼:", IDIGNORE, 5, 6, 50, 8 + LTEXT "", IDC_LABEL, 60, 6, 145, 8 + LTEXT "CLSID:", IDIGNORE, 5, 16, 50, 8 + LTEXT "", IDC_IDENTIFIER, 60, 16, 165, 8 + DEFPUSHBUTTON "•Â‚¶‚é(&C)", IDCANCEL, 230, 6, 45, 14 +} + +DLG_IPERSISTSTREAM_IV DIALOG DISCARDABLE 0, 0, 280, 68 +STYLE DS_MODALFRAME | DS_NOIDLEMSG | WS_CAPTION | WS_SYSMENU +CAPTION "IPersistStream ƒCƒ“ƒ^�[ƒtƒFƒCƒX ƒrƒ…ƒA�[" +FONT 9, "MS Shell Dlg" +{ + LTEXT "ƒNƒ‰ƒX–¼:", IDIGNORE, 5, 6, 50, 8 + LTEXT "", IDC_LABEL, 60, 6, 145, 8 + LTEXT "CLSID:", IDIGNORE, 5, 16, 50, 8 + LTEXT "", IDC_IDENTIFIER, 60, 16, 165, 8 + DEFPUSHBUTTON "•Â‚¶‚é(&C)", IDCANCEL, 230, 6, 45, 14 + PUSHBUTTON "&IsDirty", IDC_ISDIRTY_BUTTON, 6, 31, 50, 14 + LTEXT "???", IDC_ISDIRTY, 60, 34, 145, 8 + PUSHBUTTON "&GetSizeMax", IDC_GETSIZEMAX_BUTTON, 6, 49, 50, 14 + LTEXT "???", IDC_GETSIZEMAX, 60, 52, 145, 8 +} diff --git a/programs/oleview/rsrc.rc b/programs/oleview/rsrc.rc index 4edf2fd8c59..02d460f2b09 100644 --- a/programs/oleview/rsrc.rc +++ b/programs/oleview/rsrc.rc @@ -27,6 +27,7 @@ #include "De.rc" #include "En.rc" #include "Fr.rc" +#include "Ja.rc" #include "Ko.rc" #include "Nl.rc" #include "No.rc" diff --git a/programs/wineboot/wineboot.c b/programs/wineboot/wineboot.c index 717a175ad87..2201ed56dc5 100644 --- a/programs/wineboot/wineboot.c +++ b/programs/wineboot/wineboot.c @@ -115,7 +115,7 @@ static char *get_wine_inf_path(void) } /* update the timestamp if different from the reference time */ -static BOOL update_timestamp( const char *config_dir, unsigned long timestamp, int force ) +static BOOL update_timestamp( const char *config_dir, unsigned long timestamp ) { BOOL ret = FALSE; int fd, count; @@ -132,7 +132,7 @@ static BOOL update_timestamp( const char *config_dir, unsigned long timestamp, i { buffer[count] = 0; if (!strncmp( buffer, "disable", sizeof("disable")-1 )) goto done; - if (!force && timestamp == strtoul( buffer, NULL, 10 )) goto done; + if (timestamp == strtoul( buffer, NULL, 10 )) goto done; } lseek( fd, 0, SEEK_SET ); ftruncate( fd, 0 ); @@ -681,7 +681,7 @@ static void update_wineprefix( int force ) goto done; } - if (update_timestamp( config_dir, st.st_mtime, force )) + if (update_timestamp( config_dir, st.st_mtime ) || force) { WCHAR *buffer; DWORD len = MultiByteToWideChar( CP_UNIXCP, 0, inf_path, -1, NULL, 0 ); diff --git a/tools/widl/header.c b/tools/widl/header.c index 0d9832d30e1..83fef7fcbdc 100644 --- a/tools/widl/header.c +++ b/tools/widl/header.c @@ -150,28 +150,8 @@ static void write_field(FILE *h, var_t *v) { if (!v) return; if (v->type) { - const char *name = v->name; - if (name == NULL) { - switch (v->type->type) { - case RPC_FC_STRUCT: - case RPC_FC_CVSTRUCT: - case RPC_FC_CPSTRUCT: - case RPC_FC_CSTRUCT: - case RPC_FC_PSTRUCT: - case RPC_FC_BOGUS_STRUCT: - case RPC_FC_ENCAPSULATED_UNION: - name = "DUMMYSTRUCTNAME"; - break; - case RPC_FC_NON_ENCAPSULATED_UNION: - name = "DUMMYUNIONNAME"; - break; - default: - /* ? */ - break; - } - } indent(h, 0); - write_type_def_or_decl(h, v->type, TRUE, "%s", name); + write_type_def_or_decl(h, v->type, TRUE, "%s", v->name); fprintf(h, ";\n"); } } diff --git a/tools/wine.inf.in b/tools/wine.inf.in index cc5916d70a4..ffa27c7a7cc 100644 --- a/tools/wine.inf.in +++ b/tools/wine.inf.in @@ -2181,6 +2181,7 @@ HKLM,%CurrentVersion%\Telephony\Country List\998,"SameAreaRule",,"G" 11,,browseui.dll,1 11,,comcat.dll,1 11,,comctl32.dll,2 +11,,cryptdlg.dll,1 11,,cryptnet.dll,1 11,,d3dxof.dll,1 11,,ddraw.dll,1 -- 2.11.4.GIT