From a94c27fa16d24b765ff57aa876f977176420f6ca Mon Sep 17 00:00:00 2001 From: Jan Zerebecki Date: Fri, 25 Jan 2008 21:53:24 +0100 Subject: [PATCH] push 37d76373165707dfd5c864bc2126a42ed39183b4 --- .gitignore | 6 + ANNOUNCE | 949 ++++++------- ChangeLog | 1473 ++++++++++++++++++++ Makefile.in | 4 + VERSION | 2 +- configure | 26 +- configure.ac | 3 + dlls/Makefile.in | 6 + dlls/advapi32/security.c | 260 +++- dlls/advapi32/tests/cred.c | 25 +- dlls/advapi32/tests/security.c | 98 +- dlls/advapi32/tests/service.c | 183 +++ dlls/browseui/rsrc.rc | 1 + dlls/browseui/rsrc_Ru.rc | 38 + dlls/cabinet/fci.c | 2 +- dlls/comctl32/animate.c | 2 +- dlls/comctl32/comctl32undoc.c | 2 +- dlls/comctl32/commctrl.c | 8 +- dlls/comctl32/imagelist.h | 2 +- dlls/comctl32/listview.c | 46 +- dlls/comctl32/monthcal.c | 4 +- dlls/comctl32/propsheet.c | 2 +- dlls/comctl32/rebar.c | 10 +- dlls/comctl32/status.c | 2 +- dlls/comctl32/tab.c | 2 +- dlls/comctl32/tests/dpa.c | 2 +- dlls/comctl32/tests/header.c | 2 +- dlls/comctl32/toolbar.c | 6 +- dlls/comctl32/tooltips.c | 2 +- dlls/comctl32/trackbar.c | 2 +- dlls/comctl32/treeview.c | 10 +- dlls/comctl32/updown.c | 4 +- dlls/credui/credui.rc | 1 + dlls/credui/credui_Ru.rc | 50 + dlls/credui/credui_main.c | 5 +- dlls/crypt32/tests/encode.c | 2 +- dlls/d3d9/tests/device.c | 12 +- dlls/d3d9/tests/visual.c | 8 +- dlls/ddraw/device.c | 273 +++- dlls/ddraw/executebuffer.c | 2 +- dlls/ddraw/regsvr.c | 6 + dlls/ddraw/tests/d3d.c | 2 +- dlls/ddraw/tests/visual.c | 781 +++++++++++ dlls/ddraw/viewport.c | 2 +- dlls/gdi32/font.c | 5 +- dlls/gdi32/freetype.c | 67 +- dlls/gdi32/gdi32.spec | 6 +- dlls/gdi32/icm.c | 143 +- dlls/gdi32/palette.c | 142 -- dlls/gdi32/printdrv.c | 2 +- dlls/gdi32/tests/Makefile.in | 1 + dlls/gdi32/tests/font.c | 29 +- dlls/gdi32/tests/icm.c | 148 ++ dlls/kernel32/process.c | 4 + dlls/kernel32/tests/drive.c | 2 +- dlls/kernel32/tests/environ.c | 16 +- dlls/kernel32/tests/resource.c | 12 +- dlls/kernel32/tests/thread.c | 12 +- dlls/mscms/profile.c | 7 +- dlls/mscoree/mscoree.spec | 4 +- dlls/mscoree/mscoree_main.c | 22 + dlls/msi/registry.c | 24 +- dlls/msi/tests/format.c | 72 + dlls/msi/tests/msi.c | 53 +- dlls/msi/tests/source.c | 22 +- dlls/{ntdsapi => msvcr71}/Makefile.in | 8 +- dlls/{credui/credui.rc => msvcr71/msvcr71.c} | 35 +- .../{msvcrtd/msvcrtd.spec => msvcr71/msvcr71.spec} | 301 ++-- dlls/msvcrt/msvcrt.spec | 20 +- dlls/msvcrt/tests/cpp.c | 4 + dlls/msvcrt/undname.c | 234 +++- dlls/msvcrt20/msvcrt20.spec | 10 +- dlls/msvcrt40/msvcrt40.spec | 10 +- dlls/msvcrtd/msvcrtd.spec | 8 +- dlls/msxml3/Makefile.in | 4 + dlls/msxml3/attribute.c | 4 +- dlls/msxml3/cdata.c | 4 +- dlls/msxml3/comment.c | 4 +- dlls/msxml3/docfrag.c | 511 +++++++ dlls/msxml3/domdoc.c | 51 +- dlls/msxml3/domimpl.c | 2 +- dlls/msxml3/element.c | 4 +- dlls/msxml3/entityref.c | 511 +++++++ .../write/rsrc.rc => dlls/msxml3/msxml3_v1.idl | 13 +- dlls/msxml3/msxml_private.h | 2 + dlls/msxml3/node.c | 1 + dlls/msxml3/pi.c | 4 +- dlls/msxml3/tests/domdoc.c | 108 ++ dlls/msxml3/text.c | 4 +- dlls/msxml3/version.rc | 2 + dlls/ntdll/sec.c | 2 +- dlls/ntdll/serial.c | 21 +- dlls/ntdll/signal_i386.c | 2 +- dlls/ntdsapi/Makefile.in | 2 +- dlls/ntdsapi/ntdsapi.c | 80 +- dlls/ntdsapi/{ => tests}/Makefile.in | 11 +- dlls/ntdsapi/tests/ntdsapi.c | 97 ++ dlls/ole32/rpc.c | 6 +- dlls/oleaut32/typelib2.c | 2 +- dlls/qmgr/Makefile.in | 1 + dlls/qmgr/factory.c | 96 ++ dlls/qmgr/qmgr.h | 7 + dlls/riched20/editor.c | 16 +- dlls/riched20/style.c | 1 - dlls/rpcrt4/Makefile.in | 2 +- dlls/rpcrt4/ndr_stubless.c | 4 +- dlls/rpcrt4/rpc_binding.c | 52 +- dlls/rpcrt4/rpc_binding.h | 3 + dlls/rpcrt4/rpc_message.c | 268 +++- dlls/rpcrt4/rpc_transport.c | 36 + dlls/rpcrt4/rpcrt4.spec | 38 - dlls/sane.ds/capability.c | 10 +- dlls/secur32/ntlm.c | 4 +- dlls/setupapi/devinst.c | 44 +- dlls/setupapi/infparse.c | 2 +- dlls/setupapi/misc.c | 4 +- dlls/setupapi/parser.c | 16 +- dlls/setupapi/queue.c | 2 +- dlls/shdocvw/dochost.c | 33 +- dlls/shdocvw/iexplore.c | 2 + dlls/shdocvw/navigate.c | 132 +- dlls/shdocvw/oleobject.c | 2 + dlls/shdocvw/shdocvw.h | 37 +- dlls/shell32/autocomplete.c | 3 +- dlls/shell32/brsfolder.c | 2 +- dlls/shell32/changenotify.c | 4 +- dlls/shell32/cpanelfolder.c | 8 +- dlls/shell32/dde.c | 2 +- dlls/shell32/dialogs.c | 2 +- dlls/shell32/recyclebin.c | 12 +- dlls/shell32/shell.c | 2 +- dlls/shell32/shell32.spec | 1 + dlls/shell32/shell32_main.c | 6 +- dlls/shell32/shelllink.c | 4 +- dlls/shell32/shfldr_fs.c | 2 +- dlls/shell32/shfldr_mycomp.c | 2 +- dlls/shell32/shfldr_unixfs.c | 6 +- dlls/shell32/shlfolder.c | 2 +- dlls/shell32/shv_item_cmenu.c | 2 +- dlls/twain_32/README | 2 +- dlls/urlmon/umstream.c | 2 +- dlls/user32/button.c | 2 +- dlls/user32/class.c | 8 +- dlls/user32/combo.c | 2 +- dlls/user32/cursoricon.c | 4 +- dlls/user32/dde_client.c | 2 +- dlls/user32/dde_server.c | 4 +- dlls/user32/ddeml16.c | 2 +- dlls/user32/dialog16.c | 2 +- dlls/user32/driver.c | 20 +- dlls/user32/edit.c | 3 +- dlls/user32/exticon.c | 10 +- dlls/user32/input.c | 13 +- dlls/user32/menu.c | 2 +- dlls/user32/msgbox.c | 2 +- dlls/user32/sysparams.c | 2 +- dlls/user32/tests/class.c | 3 +- dlls/user32/tests/clipboard.c | 10 +- dlls/user32/tests/edit.c | 6 +- dlls/user32/tests/msg.c | 6 + dlls/user32/tests/win.c | 79 ++ dlls/user32/user_private.h | 4 +- dlls/user32/win.c | 99 +- dlls/user32/winpos.c | 57 +- dlls/user32/wnd16.c | 2 +- dlls/uxtheme/msstyles.c | 8 +- dlls/vmm.vxd/vmm.c | 28 +- dlls/winealsa.drv/midi.c | 2 +- dlls/winecoreaudio.drv/midi.c | 2 +- dlls/wined3d/basetexture.c | 6 +- dlls/wined3d/context.c | 2 +- dlls/wined3d/device.c | 54 +- dlls/wined3d/directx.c | 2 +- dlls/wined3d/drawprim.c | 2 +- dlls/wined3d/indexbuffer.c | 2 +- dlls/wined3d/palette.c | 4 +- dlls/wined3d/resource.c | 2 +- dlls/wined3d/state.c | 69 +- dlls/wined3d/surface.c | 40 +- dlls/wined3d/surface_base.c | 10 +- dlls/wined3d/surface_gdi.c | 8 +- dlls/wined3d/texture.c | 2 +- dlls/wined3d/vertexbuffer.c | 10 +- dlls/wined3d/volumetexture.c | 12 +- dlls/winedos/devices.c | 4 +- dlls/winedos/dosmem.c | 2 +- dlls/winedos/int21.c | 6 +- dlls/winedos/int2f.c | 8 +- dlls/winedos/ioports.c | 2 +- dlls/winedos/vga.c | 2 +- dlls/winedos/vxd.c | 2 +- dlls/wineoss.drv/midi.c | 2 +- dlls/wineps.drv/builtin.c | 2 +- dlls/winex11.drv/clipboard.c | 4 +- dlls/winex11.drv/desktop.c | 1 + dlls/winex11.drv/dib.c | 8 +- dlls/winex11.drv/keyboard.c | 24 +- dlls/winex11.drv/window.c | 517 +++---- dlls/winex11.drv/winex11.drv.spec | 7 +- dlls/winex11.drv/winpos.c | 410 +++--- dlls/winex11.drv/x11drv.h | 13 +- dlls/winex11.drv/x11drv_main.c | 10 +- dlls/winex11.drv/xinerama.c | 1 + dlls/wininet/http.c | 3 +- dlls/wininet/tests/http.c | 2 +- dlls/wininet/wininet_Ru.rc | 2 +- include/config.h.in | 3 + include/msxml2.idl | 12 + include/win.h | 3 + include/wine/server_protocol.h | 20 +- include/winuser.h | 3 - libs/wine/utf8.c | 6 + programs/cmd/wcmdmain.c | 1 + programs/explorer/desktop.c | 11 +- programs/explorer/systray.c | 8 +- programs/regedit/regproc.c | 9 + programs/uninstaller/No.rc | 2 +- programs/uninstaller/main.c | 8 + programs/winecfg/No.rc | 2 +- programs/winemenubuilder/winemenubuilder.c | 16 +- programs/winetest/Makefile.in | 3 + programs/winetest/winetest.rc | 1 + programs/write/{rsrc.rc => Ru.rc} | 18 +- programs/write/rsrc.rc | 1 + server/protocol.def | 9 + server/request.h | 2 + server/trace.c | 15 +- server/window.c | 132 +- tools/widl/typegen.c | 2 + tools/widl/typelib_struct.h | 2 +- tools/winebuild/spec16.c | 4 +- tools/wrc/parser.y | 2 +- 232 files changed, 7765 insertions(+), 2250 deletions(-) rewrite ANNOUNCE (95%) create mode 100644 dlls/browseui/rsrc_Ru.rc create mode 100644 dlls/credui/credui_Ru.rc create mode 100644 dlls/gdi32/tests/icm.c copy dlls/{ntdsapi => msvcr71}/Makefile.in (65%) copy dlls/{credui/credui.rc => msvcr71/msvcr71.c} (62%) copy dlls/{msvcrtd/msvcrtd.spec => msvcr71/msvcr71.spec} (83%) create mode 100644 dlls/msxml3/docfrag.c create mode 100644 dlls/msxml3/entityref.c copy programs/write/rsrc.rc => dlls/msxml3/msxml3_v1.idl (79%) copy dlls/ntdsapi/{ => tests}/Makefile.in (55%) create mode 100644 dlls/ntdsapi/tests/ntdsapi.c create mode 100644 dlls/qmgr/factory.c copy programs/write/{rsrc.rc => Ru.rc} (80%) diff --git a/.gitignore b/.gitignore index be7150d8712..b28cdb65a8e 100644 --- a/.gitignore +++ b/.gitignore @@ -287,6 +287,7 @@ dlls/msi/tests/testlist.c dlls/msimg32/libmsimg32.def dlls/msimtf/rsrc.res dlls/msrle32/rsrc.res +dlls/msvcr71/libmsvcr71.def dlls/msvcrt/libmsvcrt.def dlls/msvcrt/rsrc.res dlls/msvcrt/tests/*.ok @@ -304,6 +305,7 @@ dlls/msvidc32/rsrc.res dlls/msvideo.dll16 dlls/mswsock/libmswsock.def dlls/mswsock/version.res +dlls/msxml3/msxml3_v1.tlb dlls/msxml3/tests/*.ok dlls/msxml3/tests/msxml3_crosstest.exe dlls/msxml3/tests/testlist.c @@ -320,6 +322,9 @@ dlls/ntdll/tests/ntdll_crosstest.exe dlls/ntdll/tests/testlist.c dlls/ntdll/version.res dlls/ntdsapi/libntdsapi.def +dlls/ntdsapi/tests/*.ok +dlls/ntdsapi/tests/ntdsapi_crosstest.exe +dlls/ntdsapi/tests/testlist.c dlls/ntoskrnl.exe/libntoskrnl.exe.def dlls/ntprint/ntprint.res dlls/ntprint/tests/*.ok @@ -761,6 +766,7 @@ programs/winetest/msvcrtd_test.exe programs/winetest/msxml3_test.exe programs/winetest/netapi32_test.exe programs/winetest/ntdll_test.exe +programs/winetest/ntdsapi_test.exe programs/winetest/ntprint_test.exe programs/winetest/odbccp32_test.exe programs/winetest/ole32_test.exe diff --git a/ANNOUNCE b/ANNOUNCE dissimilarity index 95% index 796dd7dd45f..cb0e5760f67 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,518 +1,431 @@ -This is release 0.9.53 of Wine, a free implementation of Windows on Unix. - -What's new in this release: - - RunOnce and Run entries now executed on startup. - - Beginnings of support for emulated disk devices. - - Many Richedit improvements. - - Nicer looking color dialog. - - Lots of bug fixes. - -Because of lags created by using mirrors, this message may reach you -before the release is available at the public sites. The sources will -be available from the following locations: - - http://ibiblio.org/pub/linux/system/emulators/wine/wine-0.9.53.tar.bz2 - http://prdownloads.sourceforge.net/wine/wine-0.9.53.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 or CVS -repositories. Check respectively http://www.winehq.org/site/git or -http://www.winehq.org/site/cvs for details. - -If you fix something, please submit a patch; instructions on how to do -this can be found at http://www.winehq.org/site/sending_patches - -Wine is available thanks to the work of many people. See the file -AUTHORS in the distribution for the complete list. - ----------------------------------------------------------------- - -Changes since 0.9.52: - -Alexander Dorofeyev (6): - wined3d: Free palette handle when destroying IWineD3DPaletteImpl. - ddraw: Release palette interfaces. - ddraw: Remove redundant iface<->impl casts in IDirect3DTextureImpl_Load. - wined3d: Fix regression of colorfill and texture to swapchain codepaths in BltOverride. - include/d3d.h: Fix method calling macros for IDirect3DTexture. - ddraw/tests: Add test for rendering vertices with zero rhw. - -Alexander Nicolaysen Sørnes (5): - comdlg32: PageSetupDlgW: Set orientation in printer dialog. - comdlg32: PageSetupDlgW: Set paper size in printer dialog. - wordpad: Draw margin lines in print preview. - crypt32: Implement CryptFindLocalizedName. - cmd: Seed the random number generator. - -Alexandre Julliard (33): - winedos: Don't emulate in 32-bit mode interrupts that don't have a specific handler. - shell32: Fix messed up indentation. - crypt32: Avoid casting away const from the context pointer. - server: Use exponential backoff when waiting for wineserver -k to complete. - server: Redesign the server shutdown processing. - ntdll: Print an error for unsupported shared writable mappings. - advapi32: Don't wait for 20 seconds if a service fails to start. - kernel32: Launch wineboot on first startup of a wine process. - mountmgr.sys: Added initial stub for the mount point manager device. - mountmgr.sys: Create a hard disk device for PhysicalDrive0. - mountmgr.sys: Create disk devices for all configured drives. - mountmgr.sys: Add devices to the MountedDevices registry key. - mountmgr.sys: Implemented the IOCTL_MOUNTMGR_QUERY_POINTS request. - kernel32: Implemented FindFirstVolume/FindNextVolume using the mount point manager. - kernel32/tests: Added tests for FindFirstVolume/FindNextVolume. - ntdll: Return a proper Information field also when opening a server file object. - advapi32: Fix the length written to the pipe for the start message. - wineboot: Don't print errors for non-fatal problems. - configure: Add --without options for all optional dependencies. - configure: Added a check for the soname of libodbc. - wined3d: Use unsigned int instead of size_t for element counts. - wined3d: Use unsigned int instead of size_t for the glsl mask size. - advapi32/tests: Print the correct size in an error message. - gdi32/tests: Avoid using size_t in traces. - kernel32/tests: Avoid using size_t in traces. - server: Wait for the expiration of all the process SIGKILL timers before exiting the server. - regedit: Fixed parsing of hex sequences. - server: Accept utf-8 data as input in registry files. - server: Make the registry parser more tolerant about malformed hex values. - server: Output incorrectly-terminated strings in hex format. - kernel32: Fail more gracefully in GetVolumeInformation for fake drive devices. - mountmgr.sys: Implemented IOCTL_DISK_GET_DRIVE_GEOMETRY and IOCTL_STORAGE_GET_DEVICE_NUMBER. - Spelling fixes in French man pages. - -Alistair Leslie-Hughes (17): - msxml3: Return E_INVALIDARG when value is NULL. - msxml3: Implement setNamedItem. - msxml3: Implement createComment. - msxml3: Implement createAttribute. - msxml3: Add missing values for get_nodeName. - msxml3: Cannot add an attribute with appendChild. - msxml3: Implement get_xml. - msxml3: Tests for get_xml, createAttribute, CreateComment, setNamedItem. - msxml3: nextSibling not supported for Attribute, Document and Document Fragment Nodes. - msxml3: lastChild not supported for CDATASection, Comment, PI and Text Nodes. - msxml3: createProcessingInstruction: Check arguments are valid. - msxml3: previousSibling not supported for Attribute, Document and Document Fragment Nodes. - msxml3: get_attributes not supported for Attribute, CData, Comment, Doc, Doc Frag, Entity and Text Nodes. - msxml3: Suppress IID_IRunnableObject FIXME since its not supported. - mscoree: Add stubs for DllCanUnloadNow and DllGetClassObject. - user32: Add SetProcessDPIAware stub. - msxml3: Fix memory leak in test. - -Andre Wisplinghoff (1): - regedit: Refresh tree view on import. - -Andrew Talbot (26): - msvfw32: Remove unneeded casts. - ntdll: Remove unneeded casts. - advapi32: Remove unneeded casts. - comctl32: Remove unneeded casts. - cabinet: Remove unneeded cast. - avifil32: Remove unneeded casts. - user32: Fix a spelling typo. - cryptnet: Remove unneeded cast. - crypt32: Remove unneeded casts. - dbghelp: Remove unneeded casts. - ddraw: Remove unneeded casts. - dplayx: Remove unneeded casts. - dsound: Remove unneeded casts. - comctl32: Remove unneeded casts. - d3d8: Remove unneeded casts. - comdlg32: Remove unneeded cast. - imm32: Remove unneeded cast. - iccvid: Remove unneeded casts. - gphoto2.ds: Remove unneeded casts. - gdi32: Remove unneeded casts. - dxdiagn: Remove unneeded casts. - gdiplus: Remove unneeded casts. - itss: Remove unneeded casts. - kernel32: Remove unneeded casts. - mapi32: Remove unneeded cast. - mscms: Remove unneeded casts. - -Andrey Esin (2): - wordpad: Russian translation. - shell32: Fixed typo. - -Andrey Turkin (2): - wineboot: Fix installation of SFP protected files. - dbghelp: Implement ImageDirectoryEntryToDataEx. - -Aric Stewart (3): - imm32: When updating a NULL HIMCC with NULL just return NULL. Handle the NULL HIMCC for the compstr when doing a ImmNotifyIME for a reset. - imm32: ImmNotifyIMM with CPS_CANCEL fully clears the composition string. Also enable respective tests. - fonts: Add Japanese small font. - -Austin English (7): - dplayx: Fix a typo. - msi: Fix several typos. - Spelling fixes. - More spelling fixes. - Spelling fixes. - Spelling fixes. - loader: Add disabling dlls to wine man page. - -Chris Wulff (1): - shdocvw: Hide and show the frame window instead of the inner one. - -Dan Kegel (1): - winemenubuilder: Expand short paths, else menu items aren't created for CSLU Toolkit. - -Detlef Riekenberg (1): - spoolss: Add stubs for SpoolerHasInitialized and SpoolerInit. - -Divan Burger (6): - comdlg32: Fix bug where the colour graph's cross is not painted. - comdlg32: Clamp hue and saturation when clicking in colour graph in colour dialog. - comdlg32: Modernize the look of the luminance bar in the colour dialog. - comdlg32: Modernize the look of the colour graph's cross in the colour dialog. - comdlg32: Modernize the look of the selected colour box in the colour dialog. - comdlg32: Modernize the look of the colour boxes in the colour dialog. - -Dmitry Timoshkov (9): - winecfg: Don't mix the strings in unix and windows locales. - gdi32: Remove redundant indentation levels in CreateFontIndirectA and CreateFontIndirectW. - msvcrt: Rename _environ to avoid a conflict on Solaris. - gdi32: Add more tests for bitmap font metrics scaling. - comdlg32: If lpstrFile points to a valid string use it as a default value for edit control. - gdi32: Add support for scaling font metrics. - gdi32: Fix the regression caused by the scaling font metrics patch. - gdi32: Fix a GdiFont leak. - gdi32: Simplify GetEnumStructs. - -Eric Pouech (29): - richedit: Added support for some message (key, mouse) filtering events. - richedit: Fixed a couple of charformatXXm structure conversions because of alignment issues. - richedit: Correctly set the CFM_WEIGHT in charformat2. - richedit: Fully initialize the first style. - richedit: Correctly copy the pitch and family field. - richedit: Don't allow recursive EN_REQUESTRESIZE notifications. - richedit: Extend the usage of underlinetype from charformat2 in richedit. - richedit: Now painting the newly supported underline types. - richedit: Simplified handling of background brush while painting. - richedit: Correctly initialize the paraformat structure. - richedit: Now dumping all fields from the paraformat2 structure. - richedit: Properly copying the paraformat2 structure for paragraphs. - richedit: Enforce usage of paraformat2 fields instead of homegrown ones for paragraphs. - richedit: Fix the para computation when zoom is used. - richedit: Now drawing the paragraph borders (if any) from paraformat2. - richedit: Added support for spaces above & below paragraphs. - richedit: Added support for intra-paragraph line space. - richedit: Rewrote FindPixelPos so that it always return something. - richedit: Small optimisation in ME_GetSelectionInsertStyle. - richedit: Move init code after some sanity checks to avoid unneeded computations. - richedit: Don't recreate the DC all the time, but use uniformely a ME_Context structure where needed. - richedit: Optimizations for the style selection. - richedit: Don't force repaint while the redraw flag is off. - richedit: Simplify first para style handling by creating a context. - richedit: Only copy the charset when it's defined. - richedit: Initialize all the cursors at editor creation. - richedit: Check return of GetScrollInfo before accessing the returned structure. - richedit: Uniformly handle the bPitchAndFamily field out of CHARFORMAT. - gdi32: Break loop in MF_PlayMetaFile when META_EOF is found. - -Francois Gouget (9): - msxml3/tests: Add the trailing '\n' to an ok() call. - wintab32: Add a trailing '\n' to a Wine trace. - advapi32: RegGetValue() should not return an error when expanding a string and given a NULL buffer and a zero size. - advapi32: RegGetValueW() must return the required buffer size in bytes, not WCHARs. - kernel32/tests: Add more ExpandEnvironmentStringsA() tests. - kernel32/tests: Despite the MSDN claims, GetComputerName() does not return the required buffer size... except on Vista. So update the tests accordingly. - msi/tests: Tweaked so it does not look like things are misspelled. - shell32: A lot of lnk files have extra data blocks at the end, although they don't seem to matter much. So drop the corresponding ERR() to a WARN(). - winemenubuilder: EnumResourceNamesW() returns false when we find the icon. So fix the corresponding misfiring trace. - -Gerald Pfeifer (24): - msi: Add missing initializer for delete_ops. - wined3d: Remove noop check in IWineD3DBaseTextureImpl_Appl(). - user32: Fix type of loop variable. - winhelp: Remove a dead condition. - taskmgr: Remove redundant out-of-domain checking which is already handled by PerfDataGetProcessorUsage() and PerfDataGetProcessorSystemUsage(). - kernel32/tests: Remove extraneous check. - winex11.drv: Simplify condition in create_xcursor_cursor() based on the unsignedness of types. - msi: Simplify condition in TABLE_fetch_stream(). - d3d9/tests: Simplify condition in test_vshader_input(). - wined3d: Remove four noop checks. - winspool: Adjust the typo of a loop variable in test_EnumForms(). - ole32: Remove one noop check in CoWaitForMultipleHandles(). - wined3d: Simplify three checks based on the unsignedness of variables. - qcap: Complete initializers for g_cTemplates[]. - msi: Remove an extraneous safety check and simplify deformat_string(). - wined3d: Removed dead FIXME checks. - ws2_32: Remove two noop checks. - msi: Remove an extraneous safety check and simplify generate_error_string(). - d3d8: Fix type of loop variable. - d3d9: Fix type of loop variable. - msi: Adjust the types of loop variables. - user32: Factor in EDIT_WM_EraseBkGnd(). - gdi32: Tighten range checking in PlayEnhMetaFileRecord() and remove four useless checks. - msi: Complete initializers. - -H. Verbeet (6): - wined3d: Call ActivateContext regardless of WINED3DCREATE_MULTITHREADED. - wined3d: Call SetGlTextureDesc() from BindTexture() rather than from PreLoad(). - wined3d: Move binding the texture and dirtifying the sampler to its own function from surface_download_data(). - wined3d: Bind the surface texture in LoadLocation(). - wined3d: SFLAG_INTEXTURE is the same as SFLAG_INDRAWABLE for offscreen render targets when ORM_FBO is used. - wined3d: Properly handle the surface location in stretch_rect_fbo(). - -Hans Leidekker (15): - gdi32: Add a stub implementation for RemoveFontMemResourceEx. - msvcrt: Fix spec file entries for the execv functions. - wininet: Fix handling of host and referrer headers in HttpOpenRequest. - kernel32: Fix two test failures on Win98 due to missing GetTempPathW. - kernel32: Add Surinam Dutch and Belgian Dutch translations of language group names. - tools/wine.desktop: Add Dutch translation. - msvcrt: Implement _wsystem and forward system to it. Respect COMSPEC environment variable. - msvcrt: Implement _wpopen and forward _popen to it. - msvcrt: Rewrite _execl/_spawnl functions as wrappers around wide character implementations. - msvcrt: Implement _execl{e, pe}. - msvcrt: Rewrite _spawnve as a wrapper. - msvcrt: Implement _wexecl{, e, p, pe}. - msvcrt: Implement _wspawnl{, e, p, pe}. - msvcrt: Implement _wexecv{, e, p, pe}. - msvcrt: Correct search strategy for the exec/spawn functions. - -Jacek Caban (42): - urlmon: Move setting protocol_sink to separated function. - urlmon: More ReportProgress implementation. - urlmon: Release protocol sink in Terminate. - urlmon: Added more binding tests. - urlmon: Use BindProtocol in Binding object. - urlmon.idl: Added missing MONIKERPROPERTY variables. - urlmon: Added ibind argument handling in CreateAsyncBindCtx. - urlmon: Make start_binding more generic. - urlmon: Better implementation of bind stopping. - urlmon: Better error handling. - urlmon: Binding_Create clean up. - urlmon: Added "CBinding Context" bind option support. - urlmon: Call AddRef in EnumFORMATETC::QueryInterface. - urlmon: Added BindToObject implementation. - urlmon: Added more tests. - ole32: Fixed parameter checking and improved debug traces in IBindCtx::QueryInterface. - mshtml: Added PutProperty implementation. - shdocvw: Added missing OnObjectAvailable function. - shdocvw: Store DocHost in BindStatusCallback. - shdocvw: Return S_OK in OnStartBinding. - shdocvw: Return correct variables in GetBindInfo. - shdocvw: Always create BindStatusCallback object. - shdocvw: Added OnObjectAvailable implementation. - shdocvw: Use OnObjectAvailable in http_load_hack. - shdocvw: Added OnProgress implementation. - shdocvw: Added OnStopBinding implementation and use it in http_load_hack. - shdocvw.5: Move on_before_navigate2 call to navigate_mon. - shdocvw: Use BindToObject to load document (except for http, https and ftp protocols). - shdocvw: Call try_application_url after BindToObject failure. - mshtml: Added Invoke(DISPID_READYSTATE) implementation. - mshtml: Fixed Read implementations. - mshtml: Don't assume that end_pos.node is text node in range_to_string. - shdocvw: Fixed ref count leak. - shdocvw: Set IE's IVer and Build registries. - mshtml: Don't crash in before_async_open if there is no client site. - mshtml: Handle fClearDirty flag in IPersistStreamInit::Save. - mshtml: Move nsChannel's content type initialization to async_open_doc_uri. - mshtml: Update focus information in WM_RESETFOCUS_HACK. - mshtml: Fixed hr element handling in range object. - mshtml: Added more range tests. - mshtml: Use QueryService to get IHttpNegotiate in get_post_data_stream. - mshtml: Disable some default Gecko warnings. - -James Hawkins (16): - msi: Only read an internal package if the file to install is compressed. - msi: WriteEnvironmentStrings should also write to REG_EXPAND_SZ strings. - msi: If the package is a URL, the OriginalDatabase property should be the URL and the DATABASE property should be the path to the local temporary package. - msi: Factor out msi_set_sourcedir_props. - msi: OriginalDatabase is the fully-expanded path to the original package if the package is local and installed from the command line. - msi: SourceDir is formed from the path of OriginalDatabase. - msi: OriginalDatabase can be a URL so check for a forward slash too. - msi: Directly download mi->source now that SourceDir points to the URL. - msi: Check the local package for existence when resolving the package source. - msi: Copy the temporary package when storing the installer. - msi: Remove an erroneous table. - msi: Pad the month and day to two digits. - msi: Create parent directories when duplicating files if they don't exist, with tests. - msi: Handle markers in the WHERE section of an UPDATE query, with tests. - msi: Test committing a table with a removed row. - msi: Actually delete the row data instead of blanking it out. - -Jeremy White (4): - wintab32: Add modest trace information for tablets. - wintab32: Remove the unused and clearly broken FindOpenContext function. - wintab32: Add logic to detect specific tablet cursor types, use it to discard non tablet X devices. - wintab32: If we could not find a stylus sort of device, we haven't found a tablet. - -Jonathan Ernst (4): - server: New French man page for wineserver. - crypt32: Updated French translation. - server: Updated French man page. - loader: New French man page for wine. - -Kirill K. Smirnov (2): - kernel32: Convert newborn wineserver handle to kernel32 console handle. - winhelp: Fix index to handle offset value = 0 correclty. - -Lance Jackson (1): - cmd: Fix some unclosed file and registry handles. - -Lei Zhang (10): - gdiplus: Initialize a variable in a test. - gdiplus: Add GdipCreatePen2 and test cases. - msxml: Fix compilation on machines without libxml2. - ntoskrnl.exe: Additional stub implementations. - mapi32: Initialize several string buffers. - shlwapi: Additional UrlEscapeA tests. - shlwapi: Check an argument to UrlEscapeA. - shlwapi: Check more arguments to UrlEscapeA. - shlwapi: Fix a return value in UrlEscapeA. - mapi32: Fix UrlEscapeA usage in MAPISendMail. - -Lionel Debroux (2): - msi: Correctly handle return value of msi_realloc. - dinput: Improve TRACEs and WARNs. - -Louis Lenders (2): - user32: Add stub for GetLayeredWindowAttributes. - shdocvw: Change return value for PersistMemory_Load. - -Marcus Meissner (5): - wininet: Check return value of InternetCrackUrl when checking referrer host. - winex11: Set last error on enumerating display settings. - msvcrt: Remove strange condition which might lead to crash. - server: Remove superflous check (value->data is dereferenced before check). - msxml3: Move potential NULL ptr derefs into their if () case. - -Michael Jung (1): - imm32: Added some unit test cases. - -Michael Stefaniuc (5): - wininet: Fix typo in comparison with NULL. Found by Smatch. - user32: Remove unneeded casts. - janitorial: Remove superfluous backslashes at end of lines. - netapi32: Remove two unused global variables. - kernel32: Add missing HeapFree(). Found by Smatch. - -Paul Chitescu (1): - advapi32: Accept a NULL lpServiceStatus in ControlService. - -Paul Romanyszyn (1): - comdlg32: Filter change should not update filename. - -Paul Vriens (4): - advapi32/tests: Don't crash on win98. - kernel32/tests: Skip not implemented functions. - kernel32/tests: Skip not implemented functions. - kernel32/tests: Skip not implemented functions. - -Peter Dons Tychsen (4): - oleaut32: Add missing types to serialize/deserialize. - ddraw: Add missing pitch in callback from EnumDisplayModes(). - dinput: Silence incorrect warning and move it to a valid place. - devenum: Fix the implementation of IEnumMoniker::Skip(), to match the MSDN specs. - -Peter Oberndorfer (2): - user32: Remove unused lpGrayMask array. - dwmapi: Add stub implementation for DwmSetWindowAttribute and DwmUnregisterThumbnail. - -Reece H. Dunn (1): - gdiplus: Added the ProfileNotFound status code. - -Rico Schüller (3): - cabinet: Fix memory leak (found by Smatch). - mshtml: Fix memory leak (found by Smatch). - msi: Fix memory leaks (found by Smatch). - -Rob Shearman (70): - rpcss: Initialise some out-only parameters that aren't initialised by the generated RPC code. - rpcrt4: Implement non-conformant string functions. - rpcrt4: Add some tests for non-conformant strings. - rpcrt4: Implement NdrConformantStringMemorySize. - widl: Check that the buffer has enough space before unmarshalling base types in generated code. - include: Add defines for more message flags in rpcdcep.h. - rpcrt4: Keep a track of server context handles allocated during processing of a request. - rpcrt4: Fix a case of destroying a context handle without first releasing the lock. - rpcrt4: Fix the MIDL_STUB_MESSAGE fields set by NdrServerInitializeNew. - rpcrt4: Add tests for NdrServerInitializeNew. - rpcrt4: Make some variables in the tests static. - rpcrt4: Fix NdrGetBuffer to set the correct fields in the MIDL_STUB_MESSAGE structure. - ntdll: Add some tests for NtQueryValueKey. - ntdll: Set the DataLength field of the information field in NtQueryValueKey to how much data should be returned, not what was actually returned. - user32: Add a stub implementation of RegisterServicesProcess. - ntdll: Implement RtlRegisterWait, RtlDeregisterWait and RtlDeregisterWaitEx. - kernel32: Implement RegisterWaitForSingleObject and UnregisterWait. - kernel32: Add tests for RegisterWaitForSingleObject and UnregisterWait. - include: ws2tcpip.h should include winsock2.h. - rpcrt4: Update todos. - widl: Make the offset of conformant string types point to the start of the conformant string format chars, not the pointer type. - ole32: Determine the destination for the COM call and initialise the necessary parameters in ClientRpcChannelBuffer_GetBuffer instead of ClientRpcChannelBuffer_SendReceive. - svchost: Add a FIXME for an undocumented function (SvchostPushServiceGlobals) that some native services expect to be called by native svchost. - kernel32: Implement RegisterWaitForSingleObjectEx. - ole32: Clear the RPC_MESSAGE structure before using it. - rpcrt4: Add some tests for NdrGetBuffer and NdrFreeBuffer. - rpcrt4: Don't set Buffer to NULL in I_RpcFreeBuffer. - ole32: get_moniker_for_progid_display_name should fallback to using IClassFactory to get IParseDisplayName if getting it directly fails. - ole32: Fix a typo in the class moniker tests. - include: Add defines for context handle flags to rpcfc.h. - widl: Output calls for the new versions of the marshalling and unmarshalling routines for server context handles. - rpcrt4: Pass the interface identifier to the lower-level context handle routines for context handles with the strict flag set. - widl: Add support for strict context handles. - rpcrt4: Print fixme's if the serialize or no-serialize flags are set on a context handle being marshalled or unmarshalled. - include: Add the strict_context_handle flag to the Irot interface. - widl: Fix the conditions under which array freeing code is output. - include: I_RpcBindingInqTransportType and I_RpcMapWin32Status should be always defined. - rpcrt4: Implement I_RpcMapWin32Status. - ntdll: Add tests for the data and name returned by NtQueryValueKey. - ntdll: Fix the Data and Name returned by NtQueryValueKey for KeyValueFullInformation. - ntdll: Fix NtQueryValueKey for KeyValueBasicInformation. - widl: Fix context handle "cannot be null" detection. - widl: Use symbolic names for some of the context handle attributes. - ole32: Clear the RPC_FLAGS_VALID_BIT flag from the RPC_MESSAGE ProcNum when shortcutting the RPC runtime. - ole32: Shortcut the RPC runtime for allocation of the message when processing the COM call by just sending a message to a window in the process. - ole32: Fix a memory leak. - ole32: Fix memory leaks caused by not calling the channel hook function when extension_size is zero. - rpcrt4: Add tests for the RPC_MESSAGE members set by NdrClientInitializeNew. - rpcrt4: Set the ProcNum of RPC_MESSAGE in NdrClientInitializeNew to include RPC_VALID_FLAGS_BIT. - rpcrt4: ndr_stubless.h should include ndrtypes.h as it depends on types it defines. - rpcrt4: Add stubs for NdrCorrelationInitialize, NdrCorrelationPass and NdrCorrelationFree. - rpcrt4: Call NdrCorrelationInitialize and NdrCorrelationFree from NdrClientCall2 if new correlation descriptors have been specified. - rpcrt4: Add stubs for I_RpcAsyncSetHandle and I_RpcAsyncAbortCall. - rpcrt4: Add stubs for asynchronous functions. - rpcrt4: Add tests for some async RPC functions. - rpcrt4: Implement RpcAsyncInitializeHandle. - rpcrt4: Set ReservedForRuntime to NULL in NdrClientInitializeNew. - include: Add prototype for I_RpcNegotiateTransferSyntax. - rpcrt4: Set the fBufferValid flag in NdrProxyGetBuffer. - rpcrt4: Remove some unused includes. - rpcrt4: Bind to the server interface in I_RpcGetBuffer, not I_RpcSendReceive. - rpcrt4: Improve error handling in RPCRT4_io_thread and remove commented-out code. - rpcrt4: Use send on a socket instead of write as it's more portable. - rpcrt4: Implement NdrMapCommAndFaultStatus. - rpcrt4: Fix a leak of msg in RPCRT4_io_thread on the error paths. - ole32: Fix some uses of SEEK_SET when STREAM_SEEK_SET should have been used instead. - rpcrt4: Fix memory leak in NdrFullPointerXlatFree. - rpcrt4: Fix memory leaks in the ndr_marshall tests. - rpcrt4: Fix a memory leak in the cstub tests. - rpcrt4: Split RPCRT4_process_packet out into separate functions. - -Roderick Colenbrander (2): - wined3d: Use software palette conversion for non-texturing operations. - wined3d: Unify color conversion code. - -Stefan Dösinger (2): - wined3d: Detect geforce 7300 cards. - wined3d: Fix a pixelshader recompilation check. - -Tony Wasserka (1): - include: Add d3dx9core.h. - -Zach Goldberg (1): - Fix some typos. - --- -Alexandre Julliard -julliard@winehq.org +This is release 0.9.54 of Wine, a free implementation of Windows on Unix. + +What's new in this release: + - Photoshop CS/CS2 should now work, please help us testing it. + See http://wiki.winehq.org/AdobePhotoshop for details. + - A number of RPC fixes. + - Various improvements to the debugger support. + - Lots of bug fixes. + +Because of lags created by using mirrors, this message may reach you +before the release is available at the public sites. The sources will +be available from the following locations: + + http://ibiblio.org/pub/linux/system/emulators/wine/wine-0.9.54.tar.bz2 + http://prdownloads.sourceforge.net/wine/wine-0.9.54.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 or CVS +repositories. Check respectively http://www.winehq.org/site/git or +http://www.winehq.org/site/cvs for details. + +If you fix something, please submit a patch; instructions on how to do +this can be found at http://www.winehq.org/site/sending_patches + +Wine is available thanks to the work of many people. See the file +AUTHORS in the distribution for the complete list. + +---------------------------------------------------------------- + +Changes since 0.9.53: + +Alexander Dorofeyev (4): + wined3d: Change colorkey fixup for stage 0 alphaop / alphaarg. + ddraw: Fix handling of alpha with D3DTBLEND_MODULATE. + ddraw/tests: Add test for D3DTBLEND_MODULATE. + wined3d: Fix not released swapchain in some codepaths. + +Alexander Nicolaysen Sørnes (7): + wordpad: Fix width when text break = margins. + wordpad: Add basic ruler. + riched20: Include selection bar size in POSFROMCHAR. + riched20: Don't clear CFM_UNDERLINE flag when applying styles where it is set. + uninstaller: Disable Uninstall button when no items selected. + uninstaller: Fix Norwegian Bokmål resource. + winecfg: Update Norwegian Bokmål resource. + +Alexandre Julliard (55): + kernel32: Close the stdio handles when creating a detached process. + kernel32: Don't inherit stdin/stdout handles in wineboot. + user32: Don't inherit stdin/stdout handles in explorer. + server: Take into account the extended registers part of the i386 context. + kernel32/tests: Avoid size_t in traces. + ntdll: Copy extended registers too in copy_context(). + ntdll: Linux support for saving and restoring the extended FPU context on exceptions. + ntdll: Mac OS support for saving and restoring the extended FPU context on exceptions. + ntdll: Restore typecast that is really needed. + ntdll: Fall back to a server device ioctl for files with no associated fd. + mountmgr.sys: Fix values returned for IOCTL_STORAGE_GET_DEVICE_NUMBER on emulated disks. + winebuild: Reserve the space for the PE header in the .init section. + winmm: Load only one sound driver at a time. + wineboot: Add a --init option used when launched automatically at startup. + wineboot: Delay import the dlls that are not needed for the default initialisation. + winebuild: Don't try to use the .init section on Mac OS. + kernel32: Fix the system affinity returned by GetProcessAffinityMask. + server: Don't force the process affinity to 1, leave it up to the client. + winex11.drv: Don't fetch the atom for a null device type. + winex11.drv: Don't create a win_data structure for the desktop window, except in the process that owns it. + winex11.drv: Moved initialization of screen_width/height to xinerama_init to do it inside the x11 lock. + ntdll: Don't try to restore extended fpu context if not supported. + widl: Use the real argument names in the C method macros. + winex11.drv: Set the initial icon hints in set_initial_wm_hints(). + libwine: Properly increment source pointer for surrogates in wine_utf8_wcstombs. + user32,server: Set the initial window rectangles to 0,0-0,0. + winex11.drv: Fix handling of strange window sizes in CreateWindow, with tests. + winex11.drv: Only allocate wm hints if we have an X11 window. + ntdll: Don't fetch extended FPU context if there's no FPU context at all. + server: Add a separate request to set the window visible rect. + server: Invalidate the correct region when custom valid rects are specified. + winex11: Abstract the server part of SetWindowPos into a separate function. + winex11: Make the client rect relative to the parent window for consistency with the server side. + winex11: Properly invalidate moved child windows instead of forcing SWP_NOCOPYBITS. + winex11: Move the window bits according to the valid rects instead of invalidating. + winex11: Move resetting of the cursor clip rectangle into xinerama_init(). + winex11: Leave it up to explorer to specify the correct size and position for the desktop. + winex11: Update the win data rectangles before doing anything else in SetWindowPos. + winex11: Move code around in X11DRV_SetWindowPos to reduce indentation levels. + winex11: Add a mapped flag to the window data instead of relying on WS_VISIBLE. + winex11: Apply the existing window region (if any) when creating the whole window. + winex11: Set hints for the existing window text when creating the whole window. + winex11: Set icon hints on non-managed windows too, since they may become managed later on. + winex11: Get the icon from the window in case it was changed before the whole window was created. + winex11: Remove obsolete code to set Z-order for child windows. + winex11: Export a function to dock a window into the system tray, and get rid of the WS_EX_TRAYWINDOW style. + comctl32: Tooltips should be top-most windows. + user32: Menus should be top-most windows. + winex11: Don't create a win_data structure for the root window in non-desktop mode. + winex11: Create the window data structure lazily, once the window is made visible. + winex11: Check for need to make window managed when WS_VISIBLE is set outside of SetWindowPos. + winex11: Catch DIB memory accesses that touch the last page beyond the DIB bits end. + user32: Moved the bulk of CreateWindow and SetWindowPos from the driver back into user32. + Avoid sizeof in traces. + winex11: Check for managed mode in create_whole_window again now that it is called lazily. + +Alistair Leslie-Hughes (15): + msxml3: Implement get_dataType. + msxml3: Correct get_attributes for CDATA Section. + msxml3: Implemented IXMLDOMCDATASection COM Object. + msxml3: Implement GetClassID for XMLDocument IPersistStream interface. + msxml3: Corrected getAttribute to return current value and assign output var. + mscoree: Fix memory leak. + msxml3: Implement put_text. + msxml3: Implement get_nodeTypeString. + msxml3: Attribute nodes are not typed. + msxml3: Implement IXMLDOMImplementation Interface. + msxml3: Implement IXMLDOMDocumentFragment Interface. + msxml3: Entity Reference nodes do not support attributes property. + msxml3: Implement IXMLDOMEntityReference interface. + msxml3: Return correct IDispatch Interface. + gmsxml3: Added typelib support. + +Allan Tong (1): + wined3d: Set swapchain container before flagging front buffer with SFLAG_INDRAWABLE. + +Andrej Sinicyn (1): + wordpad: Update German strings and correct shortcuts to match XP wordpad. + +Andrew Talbot (30): + netapi32: Remove unneeded cast. + msvcrt: Remove unneeded casts. + ntdll: Remove unneeded casts. + msxml3: Remove unneeded cast. + msvfw32: Remove unneeded casts. + setupapi: Fix dead code (Coverity). + ole32: Remove unneeded casts. + oleaut32: Remove unneeded casts. + qcap: Remove unneeded casts. + psapi: Remove unneeded cast. + rpcrt4: Remove unneeded casts. + quartz: Remove unneeded casts. + riched20: Remove unneeded casts. + rsaenh: Remove unneeded casts. + sane.ds: Remove unneeded casts. + secur32: Remove unneeded casts. + setupapi: Remove unneeded casts. + shell32: Remove unneeded casts. + shell32: Remove unneeded casts. + shell32: Remove unneeded casts. + urlmon: Remove unneeded cast. + user32: Remove unneeded casts. + user32: Remove unneeded casts. + uxtheme: Remove unneeded casts. + vmm.vxd: Remove unneeded casts. + wined3d: Remove unneeded casts. + wined3d: Remove unneeded casts. + wined3d: Remove unneeded casts. + wined3d: Remove unneeded casts. + winedos: Remove unneeded casts. + +Andrey Esin (9): + wineboot: Russian translation. + shell32: Update Russian translation. + wordpad: Adding to Russian translation. + wordpad: Corrections in Russian translation. + regedit: Update Russian translation. + write: Russian translation. + browseui: Russian translation. + wininet: One addition to Russian translation. + credui: Added Russian translation. + +Aric Stewart (1): + wineps.drv: Properly handle NULL LPLOGFONT in PSDRV_EnumDeviceFonts. + +Austin English (4): + Misc spelling fixes. + tools: Spelling fixes. + wined3d: Spelling fixes. + comctl32: Spelling fixes. + +Christoph von Wittich (1): + msi: Fix process token leak. + +Christopher Berner (1): + user32: Fixed off by one scroll bar pixels. + +Dan Hipschman (1): + oleaut32: Use the symbolic name for TYPEFLAG_FDISPATCHABLE. + +Dan Kegel (5): + gdiplus/tests: Don't free if alloc failed. + hlink/tests: Skip tests if hlink couldn't be created. + urlmon: Fix unlikely free of uninitialized pointer. + winealsa.drv: Don't return garbage if can't find active channel. + gdi32: Fix AddFontResource behavior with relative paths. + +Dmitry Timoshkov (11): + gdi32: Use public FS_xxxxxx defines. + gdi32: Initialize more fields in GetEnumStructs. + gdi32: Add a test for undocumented EnumFontFamiliesEx(NULL), make it pass under Wine. + gdi32: Do not allow to create too large device dependent bitmaps like Windows does. + gdi32: Allocate cache for face enumeration data only when necessary. + ntdll: Do not perform base relocation if an image is not a DLL. + gdi32: Actually perform the fractional scaling test, make it pass under Wine. + winebuild: Add a couple of missing indentations in the generated asm files. + user32: Make MapVirtualKeyEx(MAPVK_VK_TO_CHAR) behave more like in Windows. + shell32: Add a LogoffWindowsDialog stub. + winex11.drv: Remove an incorrect FIXME. + +Eric Pouech (17): + dbghelp: Silence superfluous message (spotted by Robert Reif). + dbghelp: In Minidump, change a couple of internal names for consistency. + winedbg: Fixed bt all so that current process/thread isn't lost. + winedbg: Workaround broken minidumps with invalid 32->64 address conversion. + winedbg: Added a way to support differently selector information depending on current target. + ole32: Fixed datacache object so that we can retrieve meaningful information. + msvcrt: symbol undecoration: Now correctly parsing the template forms. + msvcrt: symbol undecoration: Handling of void in template parameters' list. + msvcrt: symbol undecoration: Added support for cointerface. + msvcrt: symbol undecoration: Added support for a couple of more calling conventions. + msvcrt: symbol undecoration: Corrected handling of non static member function modifiers. + msvcrt: symbol undecoration: Added support for thunks. + msvcrt: symbol undecoration: Added support for RTTI types. + msvcrt: symbol undecoration: Really check that we get a template string before making use of it. + ntdll: Fixed getting the RTS status from line, and now using sane default values for all (compilation/system) cases. + msvcrt: Corrected the .spec definition for the printf functions family. + regedit: Warn about newest unicode export from native regedit. + +Eric van Beurden (6): + dbghelp: Update some mscvpdb.h definitions and descriptions. + dbghelp: Return TRUE in SymInitializeW if process is already initialized and add an ERR to SymCleanup. + dbghelp: Wrap TRACE strings using the debugstr functions and update some type casting. + dbghelp: Some minidump corrections so that windbg can read our minidump files. + dbghelp: Fix file searching to search only listed directories instead of the whole HD. + dbghelp: Prevent huge minidumps by ensuring the memory range is clamped. + +Francois Gouget (11): + gdi32: Small wording tweaks in comments. + ddraw/tests: Fix compilation on systems that don't support nameless unions. + Fix spelling error in the generated conformance test files. + include: Document some Microsoft spelling mistakes so we know they are not to be fixed. + kernel32/tests: Small spelling fix in a parameter name. + Assorted spelling fixes. + advapi32/tests: Actually test strings that expand to something bigger than their original size. + advapi32/tests: Add the trailing '\n' to an ok() call. + kernel32/tests: Test the expansion of indirect environment variable references. + winemenubuilder: Expand environment variable references in the shortcut's WorkDir, Description and IconPath fields. + Assorted spelling fixes. + +Gerald Pfeifer (3): + wininet: Fix type of a loop variable in HTTP_BuildHeaderRequestStr(). + kernel32: Fix type of a loop variable in SNOOP16_Entry(). + kernel32: Use setproctitle where applicable to set the process name. + +Gregor Münch (1): + msxml3: Fix typo. + +Hans Leidekker (9): + license: Update copyright info for the new year. + msvcrt: Fix _execv spec entries for the forwarding variants too. + msvcrt: _ftol returns a 64-bit value. + msvcr71: Add an implementation that forwards to msvcrt. + gdi32: Last parameter of GetICMProfile is an output parameter. + gdi32: Make GetICMProfile behave more like native. Rewrite ansi version as a wrapper and move color management functions to their own file. + gdi32: Add tests for GetICMProfile and SetICMMode. + mscms: Use NT directory for storing color profiles. + mscms: Open .icm files only when enumerating color profiles. + +Jacek Caban (9): + shdocvw: Added DWebBrowserEvents2 test. + shdocvw: Call OnFullScreen in put_FullScreen. + shdocvw: Call WindowSetResizable in put_Resizable. + shdocvw: Call StatusTextChange in set_status_text. + shdocvw: Store URL in BindStatusCallback. + shdocvw: Use more flexible mechanism instead of WB_WM_NAVIGATE2. + shdocvw: Delay creating URL moniker to bind_to_object call. + shdocvw: Do navigation in message handler. + shdocvw: Store headers as BSTR. + +James Hawkins (3): + msi: dest_path refers to the directory prefix, not the entire file path. + propsys: Add a stub implementation of propsys.dll. + msi: Add more MsiFormatRecord tests. + +Jason Green (1): + d3d9 tests: Correct some typos. + +Jonathan Ernst (1): + loader: Updated French man page. + +Juan Lang (4): + wintrust: Don't expect ImageGetCertificateData to succeed when Certificate is NULL. + crypt32: Don't release default crypto provider on process shutdown. + crypt32: Fix race condition in loading default provider. + hhctrl.ocx: Don't return uninitialized stream. + +Kai Blin (1): + gdi32: Fix spec file to export the right symbols for GetGlyphOutline. + +Ken Thomases (1): + winex11.drv: Accomodate XGetWindowProperty returning an actual format of something other than 32 for the TARGETS property. + +Lei Zhang (1): + ddraw: Register the DirectDraw 7 Object. + +Marcus Meissner (13): + server: Enumerate process in reverse. + mshtml: Check for This->frame. + wined3d: Check for overflows. + urlmon: Skip pstgmed related tests if NULL. + wmi: Initial version of wmi.dll. + gdi32: Fix possible NULL ptr in TRACE. + msi: Replaced msi_free() by LocalAlloc() since ConvertSidToStringSidW uses LocalAlloc(). + wined3d: Removed deadcode. + cmd: Include for time(). + wined3d: Initialize swapchain. + rpcrt4: Initialize CurrentHeader. + d3d9/tests: Initialize decl. + wininet: Check if buffer has overflowed potentially. + +Michael Stefaniuc (3): + winedump: Do not create a header file when not generating skeleton code. + winedump: Use the DEFINE_THISCALL_WRAPPER macro instead of the GET_THIS macro for functions with __thiscall calling convention. + winedump: Use a switch in the generated DllMain(). + +Pablo Spallanzani (1): + wined3d: Fix texture coordinate calculation in surface_blt_to_drawable. + +Paul Chitescu (1): + mscoree: Semi-stub for LoadStringRCEx and LoadStringRC. + +Paul Vriens (6): + kernel32/tests: FindFirstVolumeA is not available on win98. + advapi32/tests: Make tests run on win9x/NT4 again. + user32/tests: Run full test again on win95 and NT4. + msi/tests: Only use functions if they are implemented. + msi/tests: Only use functions if they are implemented. + kernel32/tests: Win9x returns a different last error. + +Reece H. Dunn (5): + user32: Make the clipboard tests pass on Vista. + user32: Make the class tests pass on Vista. + user32: Make the edit tests pass on Vista. + gdi32: Vista returns UNICODE_NOCHAR if a character does not exist. + advapi32: Fix some cred test failures on Vista and prevent it crashing. + +Rob Shearman (41): + include: Flesh out winhttp.h with more function declarations, typedefs and defines. + rpcrt4: Allocate a context handle if a NULL GUID is being unmarshalled. + rpcrt4: Add support for calculating the memory size of complex types with embedded non-conformant strings. + rpcrt4: Don't print fixmes for NDR types without a freeing function. + rpcrt4: Add traces to the start of TowerConstruct and TowerExplode. + winhttp: Add a stub for WinHttpOpen. + rpcrt4: Fix the calculation of element sizes for complex arrays by using a new function ComplexStructSize that doesn't touch the buffer to calculate the size. + rpcrt4: Handle complex arrays in calc_arg_size. + rpcrt4: The initialisation of [out] variables in the stubless code must be after the unmarshaling of [in] and [in, out] variables has been completed. + mlang: Implement Rfc1766ToLcidW. + rpcrt4: Allow NULL networkaddr and endpoint in rpcrt4_np_get_top_of_tower. + ole32: Partially implement ServerRpcChannelBuffer_GetDestCtx. + rpcrt4: Move the setting of retval_ptr outside of any particular stub phase in stub_do_args and stub_do_old_args. + rpcrt4: Add tests for RPC_FC_P_DEREF|RPC_FC_P_ONSTACK pointers. + comctl32: Keep on displaying the last frame of the animation after the animation has stopped. + comctl32: Support seeking to a particular frame. + rpcrt4: Add an exception handler for stubless object proxies. + rpcrt4: Only initialise the context handle to NULL in NdrContextHandleUnmarshall if it is an out-only or return one. + iphlpapi: Implement GetBestInterfaceEx. + kernel32: Initialise the top 16-bit stack frame to zero. + widl: Write out code for initialising out-only client context handles. + riched20: The wParam parameter to WM_GETTEXT contains the number of characters, not the number of bytes. + riched20: Always treat the nCount variable in the EM_GETTEXTEX handler as a character count. + rpcrt4: Implement asynchronous RPC support. + rpcrt4: Move the receiving of an individual fragment to a separate function. + rpcrt4: Remove some unimplemented win9x-only spec entries. + rpcrt4: Don't set BufferStart and BufferEnd in NdrStubCall2. + ole32: Don't get the HRESULT from the buffer if we get an RPC_S_CALL_FAILED status back from the runtime. + advapi32: Add more tests for SetEntriesInAcl. + ntdll: Fix the index check in RtlGetAce. + advapi32: Implement SetEntriesInAclW. + advapi32: Add a test for LookupAccountNameA on a well-known group. + advapi32: Implement LookupAccountNameW for well-known groups. + rpcrt4: Fix the error handling in RpcBindingSetAuthInfoA/W when RpcAuthInfo_Create fails. + rpcrt4: Pass the SPN input to RpcBindingSetAuthInfoA/W into InitializeSecurityContextW instead of AcquireCredentialsHandleA/W. + rpcrt4: Check the return value of RPCRT4_ClientAuthorize in RPCRT4_Send. + credui: The list should be the first parameter to the list_add_tail function. + credui: Return the state of the dialog's save checkbox to CredUIPromptForCredentials. + ntdsapi: Add tests for DsMakeSpnW. + ntdsapi: Implement DsMakeSpnW. + wininet: Pass the server name into InitializeSecurityContextW. + +Roderick Colenbrander (2): + wined3d: Fix glBlendColorEXT for use on RivaTNT. + wined3d: Don't use texture_rectangle for paletted textures. + +Roy Shea (1): + qmgr: Implement IClassFactory methods. + +Sin-ta Hsiea (2): + gdi32: Fix Traditional Chinese font mapping to "PMingLiU", "MingLiU". + winecfg: Add Traditional Chinese translation. + +Stefan Dösinger (15): + wined3d: Add a new IWineD3DResource::UnLoad method. + wined3d: Implement IWineD3DSurface::UnLoad. + wined3d: Implement IWineD3DVertexBuffer::UnLoad. + wined3d: Implement IWineD3DIndexBuffer::UnLoad. + wined3d: Implement IWineD3DVolume::UnLoad. + wined3d: Implement IWineD3DTexture::UnLoad. + wined3d: Implement IWineD3DCubeTexture::UnLoad. + wined3d: Implement VolumeTexture::UnLoad. + d3d9: Reject IDirect3DDevice9::Reset with active default pool resources. + wined3d: Unload all resources on Reset. + wined3d: Keep track of shaders. + wined3d: Reset the shader state on shader_*_destroy. + wined3d: Destroy arb shaders on shader destroy. + wined3d: Destroy opengl shaders on reset. + wined3d: Clear the constant list before finding constants. + +Stefan Leichter (1): + advapi32: Added some tests for QueryServiceConfig2A/W. + +Tony Wasserka (1): + d3dx9: Start implementation of d3dx9_36. + +-- +Alexandre Julliard +julliard@winehq.org diff --git a/ChangeLog b/ChangeLog index 1aab49e7a3d..71832880d9e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,1476 @@ +2008-01-25 Dmitry Timoshkov + + * dlls/winex11.drv/x11drv_main.c: + winex11.drv: Remove an incorrect FIXME. + +2008-01-25 Ken Thomases + + * dlls/winex11.drv/clipboard.c: + winex11.drv: Accomodate XGetWindowProperty returning an actual format of + something other than 32 for the TARGETS property. + We shouldn't care what format the property was set with, as long as we + trust that the property is an atom type. + +2008-01-25 Reece H. Dunn + + * dlls/advapi32/tests/cred.c: + advapi32: Fix some cred test failures on Vista and prevent it crashing. + +2008-01-24 Reece H. Dunn + + * dlls/gdi32/tests/font.c: + gdi32: Vista returns UNICODE_NOCHAR if a character does not exist. + + * dlls/user32/tests/edit.c: + user32: Make the edit tests pass on Vista. + +2008-01-24 Rob Shearman + + * dlls/wininet/http.c: + wininet: Pass the server name into InitializeSecurityContextW. + + * dlls/ntdsapi/Makefile.in, dlls/ntdsapi/ntdsapi.c, + dlls/ntdsapi/tests/ntdsapi.c: + ntdsapi: Implement DsMakeSpnW. + + * .gitignore, Makefile.in, configure, configure.ac, dlls/Makefile.in, + dlls/ntdsapi/tests/Makefile.in, dlls/ntdsapi/tests/ntdsapi.c, + programs/winetest/Makefile.in, programs/winetest/winetest.rc: + ntdsapi: Add tests for DsMakeSpnW. + +2008-01-25 Dmitry Timoshkov + + * dlls/shell32/shell32.spec: + shell32: Add a LogoffWindowsDialog stub. + +2008-01-24 Andrew Talbot + + * dlls/winedos/devices.c, dlls/winedos/dosmem.c, dlls/winedos/int21.c, + dlls/winedos/int2f.c, dlls/winedos/ioports.c, dlls/winedos/vga.c, + dlls/winedos/vxd.c: + winedos: Remove unneeded casts. + +2008-01-24 Hans Leidekker + + * dlls/mscms/profile.c: + mscms: Open .icm files only when enumerating color profiles. + + * dlls/mscms/profile.c: + mscms: Use NT directory for storing color profiles. + +2008-01-24 Alexander Nicolaysen Sørnes + + * programs/winecfg/No.rc: + winecfg: Update Norwegian Bokmål resource. + +2008-01-24 Andrey Esin + + * dlls/credui/credui.rc, dlls/credui/credui_Ru.rc: + credui: Added Russian translation. + +2008-01-23 Reece H. Dunn + + * dlls/user32/tests/class.c: + user32: Make the class tests pass on Vista. + + * dlls/user32/tests/clipboard.c: + user32: Make the clipboard tests pass on Vista. + +2008-01-25 Alexandre Julliard + + * dlls/winex11.drv/window.c, dlls/winex11.drv/winpos.c: + winex11: Check for managed mode in create_whole_window again now that it is + called lazily. + +2008-01-24 Paul Vriens + + * dlls/kernel32/tests/thread.c: + kernel32/tests: Win9x returns a different last error. + +2008-01-24 Alexandre Julliard + + * dlls/advapi32/tests/service.c, dlls/kernel32/tests/environ.c, + dlls/wined3d/device.c: + Avoid sizeof in traces. + +2008-01-24 Alistair Leslie-Hughes + + * .gitignore, dlls/msxml3/Makefile.in, dlls/msxml3/msxml3_v1.idl, + dlls/msxml3/version.rc, include/msxml2.idl: + gmsxml3: Added typelib support. + +2008-01-24 Paul Vriens + + * dlls/msi/tests/source.c: + msi/tests: Only use functions if they are implemented. + + * dlls/msi/tests/msi.c: + msi/tests: Only use functions if they are implemented. + +2008-01-23 Austin English + + * dlls/comctl32/animate.c, dlls/comctl32/comctl32undoc.c, + dlls/comctl32/commctrl.c, dlls/comctl32/imagelist.h, + dlls/comctl32/listview.c, dlls/comctl32/monthcal.c, + dlls/comctl32/propsheet.c, dlls/comctl32/rebar.c, + dlls/comctl32/status.c, dlls/comctl32/tab.c, + dlls/comctl32/tests/dpa.c, dlls/comctl32/tests/header.c, + dlls/comctl32/toolbar.c, dlls/comctl32/trackbar.c, + dlls/comctl32/treeview.c, dlls/comctl32/updown.c: + comctl32: Spelling fixes. + +2008-01-23 Dan Hipschman + + * dlls/oleaut32/typelib2.c: + oleaut32: Use the symbolic name for TYPEFLAG_FDISPATCHABLE. + +2008-01-24 Alexander Nicolaysen Sørnes + + * programs/uninstaller/No.rc: + uninstaller: Fix Norwegian Bokmål resource. + + * programs/uninstaller/main.c: + uninstaller: Disable Uninstall button when no items selected. + +2008-01-23 Andrew Talbot + + * dlls/wined3d/texture.c, dlls/wined3d/vertexbuffer.c, + dlls/wined3d/volumetexture.c: + wined3d: Remove unneeded casts. + + * dlls/wined3d/surface.c, dlls/wined3d/surface_base.c, + dlls/wined3d/surface_gdi.c: + wined3d: Remove unneeded casts. + + * dlls/wined3d/drawprim.c, dlls/wined3d/indexbuffer.c, + dlls/wined3d/palette.c, dlls/wined3d/state.c: + wined3d: Remove unneeded casts. + + * dlls/wined3d/device.c: + wined3d: Remove unneeded casts. + +2008-01-23 Marcus Meissner + + * dlls/wininet/tests/http.c: + wininet: Check if buffer has overflowed potentially. + +2008-01-24 Alexandre Julliard + + * dlls/user32/driver.c, dlls/user32/user_private.h, dlls/user32/win.c, + dlls/user32/winpos.c, dlls/winex11.drv/window.c, + dlls/winex11.drv/winex11.drv.spec, dlls/winex11.drv/winpos.c, + dlls/winex11.drv/x11drv.h, include/win.h: + user32: Moved the bulk of CreateWindow and SetWindowPos from the driver back + into user32. + + * dlls/winex11.drv/dib.c: + winex11: Catch DIB memory accesses that touch the last page beyond the DIB + bits end. + + * dlls/winex11.drv/desktop.c, dlls/winex11.drv/window.c, + dlls/winex11.drv/winpos.c: + winex11: Check for need to make window managed when WS_VISIBLE is set outside + of SetWindowPos. + + * dlls/winex11.drv/window.c, dlls/winex11.drv/winpos.c, + dlls/winex11.drv/x11drv.h: + winex11: Create the window data structure lazily, once the window is made + visible. + + * dlls/winex11.drv/window.c, dlls/winex11.drv/winpos.c: + winex11: Don't create a win_data structure for the root window in non-desktop + mode. + +2008-01-23 Alexandre Julliard + + * dlls/user32/menu.c: + user32: Menus should be top-most windows. + + * dlls/comctl32/tooltips.c: + comctl32: Tooltips should be top-most windows. + + * dlls/winex11.drv/window.c, dlls/winex11.drv/winex11.drv.spec, + include/winuser.h, programs/explorer/systray.c: + winex11: Export a function to dock a window into the system tray, and get rid + of the WS_EX_TRAYWINDOW style. + + * dlls/winex11.drv/window.c: + winex11: Remove obsolete code to set Z-order for child windows. + +2008-01-23 Francois Gouget + + * dlls/cabinet/fci.c, dlls/crypt32/tests/encode.c, dlls/ddraw/tests/d3d.c, + dlls/ddraw/viewport.c, dlls/gdi32/printdrv.c, + dlls/kernel32/tests/drive.c, dlls/kernel32/tests/resource.c, + dlls/msxml3/domimpl.c, dlls/twain_32/README, + dlls/winealsa.drv/midi.c, dlls/winecoreaudio.drv/midi.c, + dlls/wined3d/basetexture.c, dlls/wined3d/context.c, + dlls/wined3d/device.c, dlls/wined3d/directx.c, + dlls/wined3d/resource.c, dlls/wined3d/state.c, + dlls/wined3d/vertexbuffer.c, dlls/wineoss.drv/midi.c, + tools/widl/typelib_struct.h, tools/wrc/parser.y: + Assorted spelling fixes. + +2008-01-23 Rob Shearman + + * dlls/credui/credui_main.c: + credui: Return the state of the dialog's save checkbox to + CredUIPromptForCredentials. + + * dlls/credui/credui_main.c: + credui: The list should be the first parameter to the list_add_tail function. + + * dlls/rpcrt4/rpc_message.c: + rpcrt4: Check the return value of RPCRT4_ClientAuthorize in RPCRT4_Send. + + * dlls/rpcrt4/rpc_binding.c, dlls/rpcrt4/rpc_binding.h, + dlls/rpcrt4/rpc_message.c: + rpcrt4: Pass the SPN input to RpcBindingSetAuthInfoA/W into + InitializeSecurityContextW instead of AcquireCredentialsHandleA/W. + + * dlls/rpcrt4/rpc_binding.c: + rpcrt4: Fix the error handling in RpcBindingSetAuthInfoA/W when + RpcAuthInfo_Create fails. + Don't release the old auth info until we successfully have a new auth + info and return failure to the caller if RpcAuthInfo_Create fails. + +2008-01-23 Francois Gouget + + * programs/winemenubuilder/winemenubuilder.c: + winemenubuilder: Expand environment variable references in the shortcut's + WorkDir, Description and IconPath fields. + + * dlls/kernel32/tests/environ.c: + kernel32/tests: Test the expansion of indirect environment variable references. + +2008-01-23 Francois Gouget + + * dlls/advapi32/tests/service.c: + advapi32/tests: Add the trailing '\n' to an ok() call. + +2008-01-23 Dmitry Timoshkov + + * dlls/user32/input.c, dlls/winex11.drv/keyboard.c: + user32: Make MapVirtualKeyEx(MAPVK_VK_TO_CHAR) behave more like in Windows. + +2008-01-23 Alexandre Julliard + + * dlls/winex11.drv/window.c: + winex11: Get the icon from the window in case it was changed before the whole + window was created. + + * dlls/winex11.drv/window.c: + winex11: Set icon hints on non-managed windows too, since they may become + managed later on. + + * dlls/winex11.drv/window.c: + winex11: Set hints for the existing window text when creating the whole window. + + * dlls/winex11.drv/window.c, dlls/winex11.drv/winpos.c: + winex11: Apply the existing window region (if any) when creating the whole + window. + Move X11DRV_SetWindowRgn to window.c. + + * dlls/winex11.drv/window.c, dlls/winex11.drv/winpos.c, + dlls/winex11.drv/x11drv.h: + winex11: Add a mapped flag to the window data instead of relying on WS_VISIBLE. + + * dlls/winex11.drv/window.c, dlls/winex11.drv/winpos.c: + winex11: Move code around in X11DRV_SetWindowPos to reduce indentation levels. + + * dlls/winex11.drv/window.c, dlls/winex11.drv/winpos.c, + dlls/winex11.drv/x11drv.h: + winex11: Update the win data rectangles before doing anything else in + SetWindowPos. + +2008-01-22 Roy Shea + + * dlls/qmgr/Makefile.in, dlls/qmgr/factory.c, dlls/qmgr/qmgr.h: + qmgr: Implement IClassFactory methods. + +2008-01-23 Kai Blin + + * dlls/gdi32/gdi32.spec: + gdi32: Fix spec file to export the right symbols for GetGlyphOutline. + +2008-01-23 Paul Vriens + + * dlls/user32/tests/msg.c: + user32/tests: Run full test again on win95 and NT4. + + * dlls/advapi32/tests/service.c: + advapi32/tests: Make tests run on win9x/NT4 again. + +2008-01-23 Marcus Meissner + + * dlls/d3d9/tests/device.c: + d3d9/tests: Initialize decl. + + * dlls/rpcrt4/rpc_message.c: + rpcrt4: Initialize CurrentHeader. + +2008-01-22 Eric Pouech + + * programs/regedit/regproc.c: + regedit: Warn about newest unicode export from native regedit. + + * dlls/msvcrt/msvcrt.spec: + msvcrt: Corrected the .spec definition for the printf functions family. + +2008-01-23 Dmitry Timoshkov + + * tools/winebuild/spec16.c: + winebuild: Add a couple of missing indentations in the generated asm files. + +2008-01-22 Lei Zhang + + * dlls/ddraw/regsvr.c: + ddraw: Register the DirectDraw 7 Object. + +2008-01-21 Roderick Colenbrander + + * dlls/wined3d/device.c, dlls/wined3d/surface.c: + wined3d: Don't use texture_rectangle for paletted textures. + +2008-01-22 Andrew Talbot + + * dlls/vmm.vxd/vmm.c: + vmm.vxd: Remove unneeded casts. + + * dlls/uxtheme/msstyles.c: + uxtheme: Remove unneeded casts. + +2008-01-22 Andrey Esin + + * dlls/wininet/wininet_Ru.rc: + wininet: One addition to Russian translation. + + * dlls/browseui/rsrc.rc, dlls/browseui/rsrc_Ru.rc: + browseui: Russian translation. + +2008-01-22 Rob Shearman + + * dlls/advapi32/security.c, dlls/advapi32/tests/security.c: + advapi32: Implement LookupAccountNameW for well-known groups. + + * dlls/advapi32/tests/security.c: + advapi32: Add a test for LookupAccountNameA on a well-known group. + + * dlls/advapi32/security.c, dlls/advapi32/tests/security.c: + advapi32: Implement SetEntriesInAclW. + + * dlls/ntdll/sec.c: + ntdll: Fix the index check in RtlGetAce. + The index is zero based so we should obviously be returning + STATUS_INVALID_PARAMETER if the index is equal to the ACE count. + + * dlls/advapi32/tests/security.c: + advapi32: Add more tests for SetEntriesInAcl. + +2008-01-23 Alexandre Julliard + + * dlls/winex11.drv/window.c, programs/explorer/desktop.c: + winex11: Leave it up to explorer to specify the correct size and position for + the desktop. + + * dlls/winex11.drv/winpos.c, dlls/winex11.drv/x11drv_main.c, + dlls/winex11.drv/xinerama.c: + winex11: Move resetting of the cursor clip rectangle into xinerama_init(). + +2008-01-22 Alexandre Julliard + + * dlls/winex11.drv/winpos.c: + winex11: Move the window bits according to the valid rects instead of + invalidating. + + * dlls/winex11.drv/winpos.c: + winex11: Properly invalidate moved child windows instead of forcing + SWP_NOCOPYBITS. + Add a move_window_bits() function where the missing functionality of + moving the window contents should go. + + * dlls/winex11.drv/window.c, dlls/winex11.drv/winpos.c, + dlls/winex11.drv/x11drv.h: + winex11: Make the client rect relative to the parent window for consistency + with the server side. + + * dlls/winex11.drv/winpos.c: + winex11: Abstract the server part of SetWindowPos into a separate function. + + * server/window.c: + server: Invalidate the correct region when custom valid rects are specified. + + * dlls/winex11.drv/winpos.c, include/wine/server_protocol.h, + server/protocol.def, server/request.h, server/trace.c, + server/window.c: + server: Add a separate request to set the window visible rect. + +2008-01-22 Marcus Meissner + + * dlls/wined3d/device.c: + wined3d: Initialize swapchain. + +2008-01-21 Eric Pouech + + * dlls/ntdll/serial.c: + ntdll: Fixed getting the RTS status from line, and now using sane default + values for all (compilation/system) cases. + + * dlls/msvcrt/tests/cpp.c, dlls/msvcrt/undname.c: + msvcrt: symbol undecoration: Really check that we get a template string before + making use of it. + + * dlls/msvcrt/undname.c: + msvcrt: symbol undecoration: Added support for RTTI types. + + * dlls/msvcrt/undname.c: + msvcrt: symbol undecoration: Added support for thunks. + + * dlls/msvcrt/undname.c: + msvcrt: symbol undecoration: Corrected handling of non static member function + modifiers. + + * dlls/msvcrt/undname.c: + msvcrt: symbol undecoration: Added support for a couple of more calling + conventions. + + * dlls/msvcrt/undname.c: + msvcrt: symbol undecoration: Added support for cointerface. + + * dlls/msvcrt/undname.c: + msvcrt: symbol undecoration: Handling of void in template parameters' list. + + * dlls/msvcrt/tests/cpp.c, dlls/msvcrt/undname.c: + msvcrt: symbol undecoration: Now correctly parsing the template forms. + +2008-01-21 Paul Chitescu + + * dlls/mscoree/mscoree.spec, dlls/mscoree/mscoree_main.c: + mscoree: Semi-stub for LoadStringRCEx and LoadStringRC. + +2008-01-21 Hans Leidekker + + * dlls/gdi32/tests/Makefile.in, dlls/gdi32/tests/icm.c: + gdi32: Add tests for GetICMProfile and SetICMMode. + + * dlls/gdi32/icm.c, dlls/gdi32/palette.c: + gdi32: Make GetICMProfile behave more like native. Rewrite ansi version as a + wrapper and move color management functions to their own file. + + * dlls/gdi32/gdi32.spec: + gdi32: Last parameter of GetICMProfile is an output parameter. + +2008-01-21 Rob Shearman + + * dlls/ole32/rpc.c: + ole32: Don't get the HRESULT from the buffer if we get an RPC_S_CALL_FAILED + status back from the runtime. + The buffer might not contain any data and nowhere in our ole32 code + passes HRESULTs in the buffer. + +2008-01-21 Marcus Meissner + + * programs/cmd/wcmdmain.c: + cmd: Include for time(). + +2008-01-22 Alistair Leslie-Hughes + + * dlls/msxml3/attribute.c, dlls/msxml3/cdata.c, dlls/msxml3/comment.c, + dlls/msxml3/docfrag.c, dlls/msxml3/domdoc.c, dlls/msxml3/element.c, + dlls/msxml3/entityref.c, dlls/msxml3/pi.c, dlls/msxml3/text.c: + msxml3: Return correct IDispatch Interface. + + * dlls/msxml3/Makefile.in, dlls/msxml3/domdoc.c, dlls/msxml3/entityref.c, + dlls/msxml3/msxml_private.h, dlls/msxml3/tests/domdoc.c: + msxml3: Implement IXMLDOMEntityReference interface. + +2008-01-21 Andrew Talbot + + * dlls/user32/dialog16.c, dlls/user32/edit.c, dlls/user32/exticon.c, + dlls/user32/msgbox.c, dlls/user32/sysparams.c, dlls/user32/win.c, + dlls/user32/wnd16.c: + user32: Remove unneeded casts. + + * dlls/user32/button.c, dlls/user32/class.c, dlls/user32/combo.c, + dlls/user32/cursoricon.c, dlls/user32/dde_client.c, + dlls/user32/dde_server.c, dlls/user32/ddeml16.c: + user32: Remove unneeded casts. + + * dlls/urlmon/umstream.c: + urlmon: Remove unneeded cast. + +2008-01-21 Aric Stewart + + * dlls/wineps.drv/builtin.c: + wineps.drv: Properly handle NULL LPLOGFONT in PSDRV_EnumDeviceFonts. + +2008-01-21 Jason Green + + * dlls/d3d9/tests/visual.c: + d3d9 tests: Correct some typos. + +2008-01-20 Alexander Dorofeyev + + * dlls/wined3d/surface.c: + wined3d: Fix not released swapchain in some codepaths. + + * dlls/ddraw/tests/visual.c: + ddraw/tests: Add test for D3DTBLEND_MODULATE. + + * dlls/ddraw/device.c, dlls/ddraw/executebuffer.c: + ddraw: Fix handling of alpha with D3DTBLEND_MODULATE. + + * dlls/wined3d/state.c: + wined3d: Change colorkey fixup for stage 0 alphaop / alphaarg. + +2008-01-21 Rob Shearman + + * dlls/rpcrt4/ndr_stubless.c: + rpcrt4: Don't set BufferStart and BufferEnd in NdrStubCall2. + The operations peformed by the stubless code should roughly match what + operations MIDL outputs in code, and it doesn't do this. + +2008-01-20 Stefan Leichter + + * dlls/advapi32/tests/service.c: + advapi32: Added some tests for QueryServiceConfig2A/W. + +2008-01-22 Alexandre Julliard + + * dlls/ntdll/signal_i386.c: + ntdll: Don't fetch extended FPU context if there's no FPU context at all. + + * dlls/winex11.drv/window.c: + winex11.drv: Only allocate wm hints if we have an X11 window. + + * dlls/user32/tests/win.c, dlls/winex11.drv/window.c: + winex11.drv: Fix handling of strange window sizes in CreateWindow, with tests. + + * dlls/user32/win.c, dlls/winex11.drv/window.c, server/window.c: + user32,server: Set the initial window rectangles to 0,0-0,0. + +2008-01-21 Rob Shearman + + * dlls/rpcrt4/rpcrt4.spec: + rpcrt4: Remove some unimplemented win9x-only spec entries. + We're never going to implement the undocumented ones and we're moving + more and more towards the architecture of the more recent versions of + native rpcrt4. + + * dlls/rpcrt4/rpc_message.c: + rpcrt4: Move the receiving of an individual fragment to a separate function. + + * dlls/rpcrt4/Makefile.in, dlls/rpcrt4/rpc_binding.h, + dlls/rpcrt4/rpc_message.c, dlls/rpcrt4/rpc_transport.c: + rpcrt4: Implement asynchronous RPC support. + +2008-01-20 Marcus Meissner + + * dlls/wined3d/surface.c: + wined3d: Removed deadcode. + +2008-01-21 Alexandre Julliard + + * libs/wine/utf8.c: + libwine: Properly increment source pointer for surrogates in wine_utf8_wcstombs. + Spotted by Ken Thomases. + +2008-01-20 Alistair Leslie-Hughes + + * dlls/msxml3/node.c: + msxml3: Entity Reference nodes do not support attributes property. + +2008-01-19 Alistair Leslie-Hughes + + * dlls/msxml3/Makefile.in, dlls/msxml3/docfrag.c, dlls/msxml3/domdoc.c, + dlls/msxml3/msxml_private.h, dlls/msxml3/tests/domdoc.c: + msxml3: Implement IXMLDOMDocumentFragment Interface. + +2008-01-18 Andrey Esin + + * programs/write/Ru.rc, programs/write/rsrc.rc: + write: Russian translation. + +2008-01-18 Rob Shearman + + * dlls/riched20/editor.c: + riched20: Always treat the nCount variable in the EM_GETTEXTEX handler as a + character count. + Convert ex->cb into a character count before assigning it to nCount. + Remove some dubious minus ones that would result in different character + counts for the Unicode and ANSI paths. + + * dlls/riched20/editor.c: + riched20: The wParam parameter to WM_GETTEXT contains the number of characters, + not the number of bytes. + Fix up some places in the WM_GETTEXT handler where it was assumed that + it was a byte count. + +2008-01-20 Gerald Pfeifer + + * configure, configure.ac, dlls/kernel32/process.c, include/config.h.in: + kernel32: Use setproctitle where applicable to set the process name. + Based on a patch by Kris Moore. + +2008-01-21 James Hawkins + + * dlls/msi/tests/format.c: + msi: Add more MsiFormatRecord tests. + +2008-01-20 Alexander Nicolaysen Sørnes + + * dlls/riched20/style.c: + riched20: Don't clear CFM_UNDERLINE flag when applying styles where it is set. + +2008-01-20 Marcus Meissner + + * dlls/msi/registry.c: + msi: Replaced msi_free() by LocalAlloc() since ConvertSidToStringSidW uses + LocalAlloc(). + Spotted by Christoph von Wittich . + + * dlls/gdi32/font.c: + gdi32: Fix possible NULL ptr in TRACE. + +2008-01-20 Hans Leidekker + + * .gitignore, Makefile.in, configure, configure.ac, dlls/Makefile.in, + dlls/msvcr71/Makefile.in, dlls/msvcr71/msvcr71.c, + dlls/msvcr71/msvcr71.spec: + msvcr71: Add an implementation that forwards to msvcrt. + + * dlls/msvcrt20/msvcrt20.spec, dlls/msvcrt40/msvcrt40.spec: + msvcrt: _ftol returns a 64-bit value. + + * dlls/msvcrt20/msvcrt20.spec, dlls/msvcrt40/msvcrt40.spec, + dlls/msvcrtd/msvcrtd.spec: + msvcrt: Fix _execv spec entries for the forwarding variants too. + +2008-01-20 Christoph von Wittich + + * dlls/msi/registry.c: + msi: Fix process token leak. + +2008-01-20 Dmitry Timoshkov + + * dlls/gdi32/freetype.c, dlls/gdi32/tests/font.c: + gdi32: Actually perform the fractional scaling test, make it pass under Wine. + +2008-01-20 Rob Shearman + + * tools/widl/typegen.c: + widl: Write out code for initialising out-only client context handles. + +2008-01-19 Andrew Talbot + + * dlls/shell32/shlfolder.c, dlls/shell32/shv_item_cmenu.c: + shell32: Remove unneeded casts. + + * dlls/shell32/recyclebin.c, dlls/shell32/shell.c, + dlls/shell32/shell32_main.c, dlls/shell32/shelllink.c, + dlls/shell32/shfldr_fs.c, dlls/shell32/shfldr_mycomp.c, + dlls/shell32/shfldr_unixfs.c: + shell32: Remove unneeded casts. + + * dlls/shell32/autocomplete.c, dlls/shell32/brsfolder.c, + dlls/shell32/changenotify.c, dlls/shell32/cpanelfolder.c, + dlls/shell32/dde.c, dlls/shell32/dialogs.c: + shell32: Remove unneeded casts. + + * dlls/setupapi/devinst.c, dlls/setupapi/infparse.c, dlls/setupapi/misc.c, + dlls/setupapi/parser.c, dlls/setupapi/queue.c: + setupapi: Remove unneeded casts. + +2008-01-18 Andrew Talbot + + * dlls/secur32/ntlm.c: + secur32: Remove unneeded casts. + + * dlls/sane.ds/capability.c: + sane.ds: Remove unneeded casts. + +2008-01-18 Jacek Caban + + * dlls/shdocvw/navigate.c: + shdocvw: Store headers as BSTR. + + * dlls/shdocvw/navigate.c: + shdocvw: Do navigation in message handler. + + * dlls/shdocvw/navigate.c: + shdocvw: Delay creating URL moniker to bind_to_object call. + + * dlls/shdocvw/dochost.c, dlls/shdocvw/iexplore.c, + dlls/shdocvw/navigate.c, dlls/shdocvw/oleobject.c, + dlls/shdocvw/shdocvw.h: + shdocvw: Use more flexible mechanism instead of WB_WM_NAVIGATE2. + + * dlls/shdocvw/navigate.c, dlls/shdocvw/shdocvw.h: + shdocvw: Store URL in BindStatusCallback. + +2008-01-18 Alexandre Julliard + + * dlls/winex11.drv/window.c: + winex11.drv: Set the initial icon hints in set_initial_wm_hints(). + +2008-01-09 Austin English + + * dlls/wined3d/arb_program_shader.c, dlls/wined3d/baseshader.c, + dlls/wined3d/basetexture.c, dlls/wined3d/context.c, + dlls/wined3d/device.c, dlls/wined3d/directx.c, + dlls/wined3d/drawprim.c, dlls/wined3d/pixelshader.c, + dlls/wined3d/query.c, dlls/wined3d/resource.c, dlls/wined3d/state.c, + dlls/wined3d/utils.c, dlls/wined3d/vertexbuffer.c, + dlls/wined3d/vertexshader.c, dlls/wined3d/wined3d_private.h: + wined3d: Spelling fixes. + +2008-01-15 Austin English + + * tools/widl/typegen.c, tools/widl/typelib_struct.h, + tools/winebuild/relay.c, tools/winedump/debug.c, + tools/winedump/msmangle.c, tools/winedump/symbol.c, + tools/winegcc/winegcc.c, tools/wmc/mcl.c, tools/wrc/genres.c, + tools/wrc/newstruc.c, tools/wrc/parser.h, tools/wrc/wrc.c, + tools/wrc/writeres.c: + tools: Spelling fixes. + +2008-01-16 Austin English + + * dlls/advapi32/tests/registry.c, dlls/advpack/files.c, + dlls/advpack/reg.c, dlls/avifil32/avifile.c, + dlls/avifil32/editstream.c, dlls/avifil32/icmstream.c, + dlls/avifil32/wavfile.c, dlls/browseui/progressdlg.c, + dlls/cabinet/fci.c, dlls/cabinet/tests/extract.c: + Misc spelling fixes. + +2008-01-17 Andrew Talbot + + * dlls/rsaenh/handle.c, dlls/rsaenh/mpi.c, dlls/rsaenh/rsaenh.c: + rsaenh: Remove unneeded casts. + +2008-01-17 Eric van Beurden + + * dlls/dbghelp/minidump.c: + dbghelp: Prevent huge minidumps by ensuring the memory range is clamped. + + * dlls/dbghelp/path.c: + dbghelp: Fix file searching to search only listed directories instead of the + whole HD. + + * dlls/dbghelp/minidump.c: + dbghelp: Some minidump corrections so that windbg can read our minidump files. + + * dlls/dbghelp/pe_module.c: + dbghelp: Wrap TRACE strings using the debugstr functions and update some + type casting. + + * dlls/dbghelp/dbghelp.c: + dbghelp: Return TRUE in SymInitializeW if process is already initialized and + add an ERR to SymCleanup. + + * include/wine/mscvpdb.h: + dbghelp: Update some mscvpdb.h definitions and descriptions. + +2008-01-18 Alexandre Julliard + + * tools/widl/header.c: + widl: Use the real argument names in the C method macros. + + * dlls/ntdll/signal_i386.c: + ntdll: Don't try to restore extended fpu context if not supported. + Remove an extra fpu context save left over from testing. + +2008-01-18 Alistair Leslie-Hughes + + * dlls/msxml3/Makefile.in, dlls/msxml3/domdoc.c, dlls/msxml3/domimpl.c, + dlls/msxml3/msxml_private.h, dlls/msxml3/tests/domdoc.c: + msxml3: Implement IXMLDOMImplementation Interface. + + * dlls/msxml3/node.c: + msxml3: Attribute nodes are not typed. + +2008-01-17 Rob Shearman + + * dlls/kernel32/kernel_main.c: + kernel32: Initialise the top 16-bit stack frame to zero. + +2008-01-17 Francois Gouget + + * dlls/advapi32/tests/registry.c: + advapi32/tests: Actually test strings that expand to something bigger than + their original size. + +2008-01-17 Alexandre Julliard + + * dlls/winex11.drv/desktop.c, dlls/winex11.drv/winpos.c, + dlls/winex11.drv/x11drv.h, dlls/winex11.drv/x11drv_main.c, + dlls/winex11.drv/xinerama.c: + winex11.drv: Moved initialization of screen_width/height to xinerama_init to + do it inside the x11 lock. + + * dlls/winex11.drv/desktop.c, dlls/winex11.drv/event.c, + dlls/winex11.drv/window.c, dlls/winex11.drv/winpos.c, + dlls/winex11.drv/x11drv.h, dlls/winex11.drv/xrandr.c, + dlls/winex11.drv/xvidmode.c: + winex11.drv: Don't create a win_data structure for the desktop window, except + in the process that owns it. + Handle desktop size changes by sending a message to the desktop owner. + +2008-01-17 Rob Shearman + + * dlls/iphlpapi/iphlpapi.spec, dlls/iphlpapi/iphlpapi_main.c, + include/iphlpapi.h: + iphlpapi: Implement GetBestInterfaceEx. + + * dlls/rpcrt4/ndr_marshall.c: + rpcrt4: Only initialise the context handle to NULL in NdrContextHandleUnmarshall + if it is an out-only or return one. + Fix the indentation and add tracing of the context handle flags. + + * dlls/rpcrt4/ndr_stubless.c: + rpcrt4: Add an exception handler for stubless object proxies. + +2008-01-17 Alexandre Julliard + + * dlls/winex11.drv/wintab.c: + winex11.drv: Don't fetch the atom for a null device type. + +2008-01-17 Dmitry Timoshkov + + * dlls/ntdll/virtual.c: + ntdll: Do not perform base relocation if an image is not a DLL. + +2008-01-16 Andrew Talbot + + * dlls/riched20/editor.c, dlls/riched20/richole.c, dlls/riched20/style.c: + riched20: Remove unneeded casts. + + * dlls/quartz/systemclock.c: + quartz: Remove unneeded casts. + + * dlls/rpcrt4/ndr_marshall.c, dlls/rpcrt4/ndr_ole.c, + dlls/rpcrt4/ndr_stubless.c, dlls/rpcrt4/rpc_message.c: + rpcrt4: Remove unneeded casts. + +2008-01-16 Marcus Meissner + + * Makefile.in, configure, configure.ac, dlls/Makefile.in, + dlls/wmi/Makefile.in, dlls/wmi/wmi.spec: + wmi: Initial version of wmi.dll. + + * dlls/urlmon/tests/url.c: + urlmon: Skip pstgmed related tests if NULL. + +2008-01-16 Alexandre Julliard + + * dlls/ntdll/process.c, dlls/ntdll/thread.c, + include/wine/server_protocol.h, server/process.c, server/process.h, + server/protocol.def, server/thread.c, server/thread.h, + server/trace.c: + server: Don't force the process affinity to 1, leave it up to the client. + + * dlls/kernel32/process.c: + kernel32: Fix the system affinity returned by GetProcessAffinityMask. + + * tools/winebuild/spec32.c: + winebuild: Don't try to use the .init section on Mac OS. + +2008-01-11 Sin-ta Hsiea + + * programs/winecfg/Zh.rc, programs/winecfg/winecfg.rc: + winecfg: Add Traditional Chinese translation. + + * dlls/gdi32/freetype.c: + gdi32: Fix Traditional Chinese font mapping to "PMingLiU", "MingLiU". + +2008-01-16 Alexandre Julliard + + * programs/wineboot/Makefile.in: + wineboot: Delay import the dlls that are not needed for the default + initialisation. + + * dlls/kernel32/process.c, programs/wineboot/wineboot.c: + wineboot: Add a --init option used when launched automatically at startup. + Don't execute Run entries in that case. + + * dlls/winmm/lolvldrv.c: + winmm: Load only one sound driver at a time. + +2008-01-15 Marcus Meissner + + * dlls/wined3d/device.c: + wined3d: Check for overflows. + +2008-01-14 Christopher Berner + + * dlls/user32/scroll.c: + user32: Fixed off by one scroll bar pixels. + +2008-01-16 Alexandre Julliard + + * tools/winebuild/spec32.c: + winebuild: Reserve the space for the PE header in the .init section. + +2008-01-16 Rob Shearman + + * dlls/comctl32/animate.c: + comctl32: Support seeking to a particular frame. + In this case just draw the frame without starting the timer thread of + setting a timer and without sending any notifications. + + * dlls/comctl32/animate.c: + comctl32: Keep on displaying the last frame of the animation after the animation + has stopped. + + * dlls/rpcrt4/tests/ndr_marshall.c: + rpcrt4: Add tests for RPC_FC_P_DEREF|RPC_FC_P_ONSTACK pointers. + +2008-01-16 Alexandre Julliard + + * dlls/mountmgr.sys/mountmgr.c: + mountmgr.sys: Fix values returned for IOCTL_STORAGE_GET_DEVICE_NUMBER on + emulated disks. + + * dlls/ntdll/cdrom.c, dlls/ntdll/file.c: + ntdll: Fall back to a server device ioctl for files with no associated fd. + +2008-01-16 Francois Gouget + + * dlls/cabinet/fci.c, dlls/comctl32/listview.c, + dlls/comctl32/tests/datetime.c, dlls/comctl32/treeview.c, + dlls/d3d9/tests/visual.c, dlls/dbghelp/stabs.c, dlls/ddraw/device.c, + dlls/ddraw/direct3d.c, dlls/dmstyle/style.c, + dlls/dplayx/dplayx_messages.c, dlls/dplayx/dplayx_queue.h, + dlls/gdi32/bidi.c, dlls/gdi32/dib.c, dlls/gdi32/metafile.c, + dlls/kernel32/cpu.c, dlls/kernel32/locale.c, dlls/mshtml/nsio.c, + dlls/mshtml/nsservice.c, dlls/msi/tests/db.c, + dlls/msxml3/attribute.c, dlls/msxml3/cdata.c, dlls/msxml3/comment.c, + dlls/msxml3/pi.c, dlls/ntdll/serial.c, dlls/odbc32/proxyodbc.c, + dlls/oleaut32/tests/vartype.c, dlls/oleaut32/typelib.h, + dlls/oleaut32/variant.c, dlls/qcap/dllsetup.c, dlls/qcap/dllsetup.h, + dlls/setupapi/stringtable.c, dlls/shell32/autocomplete.c, + dlls/shell32/brsfolder.c, dlls/shell32/dataobject.c, + dlls/shell32/iconcache.c, dlls/shell32/pidl.c, dlls/shell32/pidl.h, + dlls/shell32/shfldr_fs.c, dlls/shell32/shfldr_netplaces.c, + dlls/shell32/shfldr_unixfs.c, dlls/shell32/shlexec.c, + dlls/shell32/shlfolder.c, dlls/shell32/shlview.c, + dlls/shell32/trash.c, dlls/shlwapi/url.c, dlls/user32/comm16.c, + dlls/user32/dde_client.c, dlls/user32/dde_misc.c, + dlls/user32/defdlg.c, dlls/user32/mdi.c, dlls/user32/tests/dialog.c, + dlls/uxtheme/msstyles.c, dlls/uxtheme/tests/system.c, + dlls/winealsa.drv/alsa.c, dlls/wineesd.drv/audio.c, + dlls/wineoss.drv/audio.h, dlls/wineoss.drv/midi.c, + dlls/winex11.drv/wintab.c, dlls/wininet/tests/url.c, + dlls/ws2_32/socket.c, include/mmsystem.h, + include/wine/rpcss_shared.h, include/wine/wingdi16.h, + include/winternl.h, libs/wpp/wpp.c, libs/wpp/wpp_private.h, + programs/cmd/batch.c, programs/cmd/wcmdmain.c, + programs/taskmgr/graphctl.c, programs/winhelp/hlpfile.c: + Assorted spelling fixes. + + * dlls/kernel32/tests/sync.c: + kernel32/tests: Small spelling fix in a parameter name. + + * include/setupapi.h, include/windns.h: + include: Document some Microsoft spelling mistakes so we know they are not to + be fixed. + + * dlls/gdi32/tests/generated.c, dlls/kernel32/tests/generated.c, + dlls/ntdll/tests/generated.c, dlls/rpcrt4/tests/generated.c, + dlls/shell32/tests/generated.c, dlls/shlwapi/tests/generated.c, + dlls/urlmon/tests/generated.c, dlls/user32/tests/generated.c, + tools/winapi/winapi_test: + Fix spelling error in the generated conformance test files. + + * dlls/ddraw/tests/ddrawmodes.c: + ddraw/tests: Fix compilation on systems that don't support nameless unions. + + * dlls/gdi32/painting.c: + gdi32: Small wording tweaks in comments. + +2008-01-13 Tony Wasserka + + * Makefile.in, configure, configure.ac, dlls/Makefile.in, + dlls/d3dx9_36/Makefile.in, dlls/d3dx9_36/d3dx9_36.spec, + dlls/d3dx9_36/d3dx9_36_main.c: + d3dx9: Start implementation of d3dx9_36. + +2008-01-16 James Hawkins + + * Makefile.in, configure, configure.ac, dlls/Makefile.in, + dlls/propsys/Makefile.in, dlls/propsys/propsys.spec, + dlls/propsys/propsys_main.c: + propsys: Add a stub implementation of propsys.dll. + +2008-01-13 Marcus Meissner + + * dlls/mshtml/olecmd.c: + mshtml: Check for This->frame. + +2008-01-16 Dmitry Timoshkov + + * dlls/gdi32/freetype.c: + gdi32: Allocate cache for face enumeration data only when necessary. + +2008-01-15 James Hawkins + + * dlls/msi/files.c: + msi: dest_path refers to the directory prefix, not the entire file path. + +2008-01-16 Alistair Leslie-Hughes + + * dlls/msxml3/node.c, dlls/msxml3/tests/domdoc.c: + msxml3: Implement get_nodeTypeString. + + * dlls/msxml3/node.c, dlls/msxml3/tests/domdoc.c: + msxml3: Implement put_text. + +2008-01-15 Andrey Esin + + * programs/regedit/Ru.rc: + regedit: Update Russian translation. + + * programs/wordpad/Ru.rc: + wordpad: Corrections in Russian translation. + +2008-01-15 Andrew Talbot + + * dlls/psapi/psapi_main.c: + psapi: Remove unneeded cast. + + * dlls/qcap/capturegraph.c, dlls/qcap/v4l.c: + qcap: Remove unneeded casts. + + * dlls/oleaut32/oleaut.c, dlls/oleaut32/olepicture.c, + dlls/oleaut32/safearray.c, dlls/oleaut32/typelib.c, + dlls/oleaut32/typelib16.c: + oleaut32: Remove unneeded casts. + +2008-01-16 Alistair Leslie-Hughes + + * dlls/mscoree/mscoree_main.c: + mscoree: Fix memory leak. + +2008-01-15 Rob Shearman + + * dlls/rpcrt4/ndr_stubless.c: + rpcrt4: Move the setting of retval_ptr outside of any particular stub phase + in stub_do_args and stub_do_old_args. + After the change in order of phases it was no longer being set in the + last phase and so caused all stubless functions to appear to have no + return value. + +2008-01-15 Juan Lang + + * dlls/hhctrl.ocx/chm.c: + hhctrl.ocx: Don't return uninitialized stream. + +2008-01-15 Alexandre Julliard + + * dlls/ntdll/serial.c: + ntdll: Restore typecast that is really needed. + + * dlls/ntdll/signal_i386.c: + ntdll: Mac OS support for saving and restoring the extended FPU context on + exceptions. + + * dlls/ntdll/signal_i386.c: + ntdll: Linux support for saving and restoring the extended FPU context on + exceptions. + + * dlls/ntdll/thread.c: + ntdll: Copy extended registers too in copy_context(). + + * dlls/kernel32/tests/environ.c: + kernel32/tests: Avoid size_t in traces. + +2008-01-15 Rob Shearman + + * dlls/ole32/rpc.c: + ole32: Partially implement ServerRpcChannelBuffer_GetDestCtx. + +2008-01-14 Andrej Sinicyn + + * programs/wordpad/De.rc: + wordpad: Update German strings and correct shortcuts to match XP wordpad. + +2008-01-14 Andrey Esin + + * programs/wordpad/Ru.rc: + wordpad: Adding to Russian translation. + +2008-01-15 Rob Shearman + + * dlls/rpcrt4/rpc_transport.c, dlls/rpcrt4/tests/rpc.c: + rpcrt4: Allow NULL networkaddr and endpoint in rpcrt4_np_get_top_of_tower. + Add tests for this. + +2008-01-14 Allan Tong + + * dlls/wined3d/device.c: + wined3d: Set swapchain container before flagging front buffer with + SFLAG_INDRAWABLE. + +2008-01-11 Dan Kegel + + * dlls/gdi32/freetype.c: + gdi32: Fix AddFontResource behavior with relative paths. + +2008-01-11 Jonathan Ernst + + * loader/wine.fr.man.in: + loader: Updated French man page. + +2008-01-15 Dmitry Timoshkov + + * dlls/gdi32/bitmap.c, dlls/gdi32/tests/bitmap.c: + gdi32: Do not allow to create too large device dependent bitmaps like Windows + does. + +2008-01-15 Paul Vriens + + * dlls/kernel32/tests/volume.c: + kernel32/tests: FindFirstVolumeA is not available on win98. + +2008-01-15 Alexandre Julliard + + * server/context_i386.c, server/trace.c: + server: Take into account the extended registers part of the i386 context. + +2008-01-15 Dmitry Timoshkov + + * dlls/gdi32/font.c, dlls/gdi32/freetype.c, dlls/gdi32/tests/font.c, + dlls/winex11.drv/xfont.c: + gdi32: Add a test for undocumented EnumFontFamiliesEx(NULL), make it pass + under Wine. + +2008-01-14 Andrew Talbot + + * dlls/ole32/clipboard.c, dlls/ole32/git.c, dlls/ole32/ole16.c, + dlls/ole32/ole2.c, dlls/ole32/stg_prop.c, dlls/ole32/storage32.c: + ole32: Remove unneeded casts. + +2008-01-14 Juan Lang + + * dlls/crypt32/main.c: + crypt32: Fix race condition in loading default provider. + + * dlls/crypt32/main.c: + crypt32: Don't release default crypto provider on process shutdown. + +2008-01-08 Juan Lang + + * dlls/wintrust/crypt.c: + wintrust: Don't expect ImageGetCertificateData to succeed when Certificate + is NULL. + +2008-01-14 Jacek Caban + + * dlls/shdocvw/navigate.c, dlls/shdocvw/tests/webbrowser.c: + shdocvw: Call StatusTextChange in set_status_text. + + * dlls/shdocvw/tests/webbrowser.c, dlls/shdocvw/webbrowser.c: + shdocvw: Call WindowSetResizable in put_Resizable. + + * dlls/shdocvw/tests/webbrowser.c, dlls/shdocvw/webbrowser.c: + shdocvw: Call OnFullScreen in put_FullScreen. + + * dlls/shdocvw/tests/webbrowser.c: + shdocvw: Added DWebBrowserEvents2 test. + +2008-01-14 Alexander Nicolaysen Sørnes + + * dlls/riched20/editor.c: + riched20: Include selection bar size in POSFROMCHAR. + +2008-01-14 Andrey Esin + + * dlls/shell32/shell32_Ru.rc: + shell32: Update Russian translation. + +2008-01-13 Andrey Esin + + * programs/wineboot/wineboot.rc, programs/wineboot/wineboot_Ru.rc: + wineboot: Russian translation. + +2008-01-12 Pablo Spallanzani + + * dlls/wined3d/surface.c: + wined3d: Fix texture coordinate calculation in surface_blt_to_drawable. + +2008-01-13 Marcus Meissner + + * dlls/kernel32/tests/toolhelp.c, server/process.c: + server: Enumerate process in reverse. + +2008-01-14 Alistair Leslie-Hughes + + * dlls/msxml3/element.c, dlls/msxml3/tests/domdoc.c: + msxml3: Corrected getAttribute to return current value and assign output var. + + * dlls/msxml3/domdoc.c: + msxml3: Implement GetClassID for XMLDocument IPersistStream interface. + + * dlls/msxml3/Makefile.in, dlls/msxml3/cdata.c, dlls/msxml3/domdoc.c, + dlls/msxml3/msxml_private.h, dlls/msxml3/tests/domdoc.c: + msxml3: Implemented IXMLDOMCDATASection COM Object. + + * dlls/msxml3/node.c: + msxml3: Correct get_attributes for CDATA Section. + + * dlls/msxml3/node.c, dlls/msxml3/tests/domdoc.c: + msxml3: Implement get_dataType. + +2008-01-13 Michael Stefaniuc + + * tools/winedump/output.c: + winedump: Use a switch in the generated DllMain(). + + * tools/winedump/output.c: + winedump: Use the DEFINE_THISCALL_WRAPPER macro instead of the GET_THIS macro + for functions with __thiscall calling convention. + Wine doesn't use GET_THIS but DEFINE_THISCALL_WRAPPER. + + * tools/winedump/output.c: + winedump: Do not create a header file when not generating skeleton code. + The header file generated with "winedump spec" without the "-c" option + just includes other headers. + +2008-01-14 Alexandre Julliard + + * dlls/user32/win.c: + user32: Don't inherit stdin/stdout handles in explorer. + + * dlls/kernel32/process.c: + kernel32: Don't inherit stdin/stdout handles in wineboot. + + * dlls/kernel32/process.c: + kernel32: Close the stdio handles when creating a detached process. + +2008-01-14 Alexander Nicolaysen Sørnes + + * programs/wordpad/De.rc, programs/wordpad/En.rc, programs/wordpad/Fr.rc, + programs/wordpad/Hu.rc, programs/wordpad/Ko.rc, + programs/wordpad/Nl.rc, programs/wordpad/No.rc, + programs/wordpad/Pl.rc, programs/wordpad/Ru.rc, + programs/wordpad/Tr.rc, programs/wordpad/print.c, + programs/wordpad/wordpad.c, programs/wordpad/wordpad.h: + wordpad: Add basic ruler. + +2008-01-13 Alexander Nicolaysen Sørnes + + * programs/wordpad/print.c: + wordpad: Fix width when text break = margins. + +2008-01-14 Rob Shearman + + * dlls/mlang/mlang.c, dlls/mlang/mlang.spec: + mlang: Implement Rfc1766ToLcidW. + + * dlls/rpcrt4/ndr_stubless.c: + rpcrt4: The initialisation of [out] variables in the stubless code must be + after the unmarshaling of [in] and [in, out] variables has been completed. + This is because the size of an [out] variable could depend on a + conformance value stored in an unmarshalled [in] or [in,out] variable. + + * dlls/rpcrt4/ndr_marshall.c, dlls/rpcrt4/ndr_misc.h, + dlls/rpcrt4/ndr_stubless.c: + rpcrt4: Handle complex arrays in calc_arg_size. + + * dlls/rpcrt4/ndr_marshall.c: + rpcrt4: Fix the calculation of element sizes for complex arrays by using a new + function ComplexStructSize that doesn't touch the buffer to calculate the size. + Otherwise, this would fail on arrays with a conformance or variance of zero. + + * dlls/winhttp/main.c, dlls/winhttp/winhttp.spec: + winhttp: Add a stub for WinHttpOpen. + +2008-01-12 Gerald Pfeifer + + * dlls/kernel32/snoop16.c: + kernel32: Fix type of a loop variable in SNOOP16_Entry(). + + * dlls/wininet/http.c: + wininet: Fix type of a loop variable in HTTP_BuildHeaderRequestStr(). + +2008-01-08 Stefan Dösinger + + * dlls/wined3d/baseshader.c: + wined3d: Clear the constant list before finding constants. + shader_get_registers_used is delayed until compile time for some 1.x + shaders, mostly to wait for the right vertex declaration to be + set. This means that on a recompile it will be run again, adding + another instance of each local constant, which in turn causes compile + errors because of constant redeclaration. Just purging the lists + before finding the constants is a simple and reliable solution. + + * dlls/wined3d/device.c: + wined3d: Destroy opengl shaders on reset. + + * dlls/wined3d/arb_program_shader.c: + wined3d: Destroy arb shaders on shader destroy. + + * dlls/wined3d/arb_program_shader.c, dlls/wined3d/glsl_shader.c: + wined3d: Reset the shader state on shader_*_destroy. + + * dlls/wined3d/baseshader.c, dlls/wined3d/device.c, + dlls/wined3d/directx.c, dlls/wined3d/wined3d_private.h: + wined3d: Keep track of shaders. + + * dlls/wined3d/device.c: + wined3d: Unload all resources on Reset. + +2008-01-11 Stefan Dösinger + + * dlls/d3d9/device.c, dlls/d3d9/tests/device.c, dlls/wined3d/device.c, + include/wine/wined3d_interface.h: + d3d9: Reject IDirect3DDevice9::Reset with active default pool resources. + +2008-01-08 Stefan Dösinger + + * dlls/wined3d/volumetexture.c: + wined3d: Implement VolumeTexture::UnLoad. + + * dlls/wined3d/cubetexture.c: + wined3d: Implement IWineD3DCubeTexture::UnLoad. + + * dlls/wined3d/texture.c: + wined3d: Implement IWineD3DTexture::UnLoad. + + * dlls/wined3d/volume.c: + wined3d: Implement IWineD3DVolume::UnLoad. + +2008-01-12 Stefan Dösinger + + * dlls/wined3d/indexbuffer.c: + wined3d: Implement IWineD3DIndexBuffer::UnLoad. + +2008-01-08 Stefan Dösinger + + * dlls/wined3d/vertexbuffer.c: + wined3d: Implement IWineD3DVertexBuffer::UnLoad. + +2008-01-12 Stefan Dösinger + + * dlls/wined3d/surface.c: + wined3d: Implement IWineD3DSurface::UnLoad. + + * dlls/wined3d/basetexture.c, dlls/wined3d/cubetexture.c, + dlls/wined3d/indexbuffer.c, dlls/wined3d/resource.c, + dlls/wined3d/surface.c, dlls/wined3d/surface_gdi.c, + dlls/wined3d/texture.c, dlls/wined3d/vertexbuffer.c, + dlls/wined3d/volume.c, dlls/wined3d/volumetexture.c, + dlls/wined3d/wined3d_private.h, include/wine/wined3d_interface.h: + wined3d: Add a new IWineD3DResource::UnLoad method. + +2008-01-13 Rob Shearman + + * dlls/rpcrt4/rpc_epmap.c: + rpcrt4: Add traces to the start of TowerConstruct and TowerExplode. + + * dlls/rpcrt4/ndr_marshall.c: + rpcrt4: Don't print fixmes for NDR types without a freeing function. + Not all types have a freeing function. + + * dlls/rpcrt4/ndr_marshall.c: + rpcrt4: Add support for calculating the memory size of complex types with + embedded non-conformant strings. + + * dlls/rpcrt4/ndr_contexthandle.c: + rpcrt4: Allocate a context handle if a NULL GUID is being unmarshalled. + +2008-01-13 Eric Pouech + + * dlls/ole32/datacache.c: + ole32: Fixed datacache object so that we can retrieve meaningful information. + + * programs/winedbg/be_i386.c, programs/winedbg/debugger.h, + programs/winedbg/info.c, programs/winedbg/tgt_active.c, + programs/winedbg/tgt_minidump.c, programs/winedbg/tgt_module.c: + winedbg: Added a way to support differently selector information depending on + current target. + + * programs/winedbg/tgt_minidump.c: + winedbg: Workaround broken minidumps with invalid 32->64 address conversion. + + * programs/winedbg/stack.c: + winedbg: Fixed bt all so that current process/thread isn't lost. + + * dlls/dbghelp/minidump.c: + dbghelp: In Minidump, change a couple of internal names for consistency. + + * dlls/dbghelp/dwarf.c: + dbghelp: Silence superfluous message (spotted by Robert Reif). + +2008-01-14 Dmitry Timoshkov + + * dlls/gdi32/freetype.c: + gdi32: Initialize more fields in GetEnumStructs. + + * dlls/gdi32/font.c, dlls/gdi32/freetype.c, dlls/gdi32/tests/font.c: + gdi32: Use public FS_xxxxxx defines. + +2008-01-13 Dan Kegel + + * dlls/winealsa.drv/mixer.c: + winealsa.drv: Don't return garbage if can't find active channel. + + * dlls/urlmon/http.c: + urlmon: Fix unlikely free of uninitialized pointer. + + * dlls/hlink/tests/hlink.c: + hlink/tests: Skip tests if hlink couldn't be created. + + * dlls/gdiplus/tests/image.c: + gdiplus/tests: Don't free if alloc failed. + +2008-01-13 Hans Leidekker + + * LICENSE, include/wine/wine_common_ver.rc: + license: Update copyright info for the new year. + +2008-01-12 Roderick Colenbrander + + * dlls/wined3d/directx.c, dlls/wined3d/state.c, include/wine/wined3d_gl.h: + wined3d: Fix glBlendColorEXT for use on RivaTNT. + +2008-01-12 Gregor Münch + + * dlls/msxml3/text.c: + msxml3: Fix typo. + +2008-01-12 Andrew Talbot + + * dlls/setupapi/devinst.c: + setupapi: Fix dead code (Coverity). + + * dlls/msvfw32/drawdib.c, dlls/msvfw32/msvideo_main.c: + msvfw32: Remove unneeded casts. + + * dlls/msxml3/nodemap.c: + msxml3: Remove unneeded cast. + + * dlls/ntdll/critsection.c, dlls/ntdll/serial.c, dlls/ntdll/threadpool.c: + ntdll: Remove unneeded casts. + + * dlls/msvcrt/dir.c, dlls/msvcrt/thread.c: + msvcrt: Remove unneeded casts. + + * dlls/netapi32/access.c: + netapi32: Remove unneeded cast. + +2008-01-11 Rob Shearman + + * include/winhttp.h: + include: Flesh out winhttp.h with more function declarations, typedefs and + defines. + +2008-01-11 Alexandre Julliard + + * ANNOUNCE, ChangeLog, VERSION, configure: + Release 0.9.53. + +---------------------------------------------------------------- 2008-01-11 Andrey Turkin * dlls/dbghelp/dbghelp.spec, dlls/dbghelp/pe_module.c: diff --git a/Makefile.in b/Makefile.in index d561c2a9992..5558f399b4d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -314,6 +314,7 @@ ALL_MAKEFILES = \ dlls/msnet32/Makefile \ dlls/msrle32/Makefile \ dlls/msvcirt/Makefile \ + dlls/msvcr71/Makefile \ dlls/msvcrt/Makefile \ dlls/msvcrt/tests/Makefile \ dlls/msvcrt20/Makefile \ @@ -332,6 +333,7 @@ ALL_MAKEFILES = \ dlls/ntdll/Makefile \ dlls/ntdll/tests/Makefile \ dlls/ntdsapi/Makefile \ + dlls/ntdsapi/tests/Makefile \ dlls/ntoskrnl.exe/Makefile \ dlls/ntprint/Makefile \ dlls/ntprint/tests/Makefile \ @@ -702,6 +704,7 @@ dlls/msisys.ocx/Makefile: dlls/msisys.ocx/Makefile.in dlls/Makedll.rules dlls/msnet32/Makefile: dlls/msnet32/Makefile.in dlls/Makedll.rules dlls/msrle32/Makefile: dlls/msrle32/Makefile.in dlls/Makedll.rules dlls/msvcirt/Makefile: dlls/msvcirt/Makefile.in dlls/Makedll.rules +dlls/msvcr71/Makefile: dlls/msvcr71/Makefile.in dlls/Makedll.rules dlls/msvcrt/Makefile: dlls/msvcrt/Makefile.in dlls/Makedll.rules dlls/msvcrt/tests/Makefile: dlls/msvcrt/tests/Makefile.in dlls/Maketest.rules dlls/msvcrt20/Makefile: dlls/msvcrt20/Makefile.in dlls/Makedll.rules @@ -720,6 +723,7 @@ dlls/newdev/Makefile: dlls/newdev/Makefile.in dlls/Makedll.rules dlls/ntdll/Makefile: dlls/ntdll/Makefile.in dlls/Makedll.rules dlls/ntdll/tests/Makefile: dlls/ntdll/tests/Makefile.in dlls/Maketest.rules dlls/ntdsapi/Makefile: dlls/ntdsapi/Makefile.in dlls/Makedll.rules +dlls/ntdsapi/tests/Makefile: dlls/ntdsapi/tests/Makefile.in dlls/Maketest.rules dlls/ntoskrnl.exe/Makefile: dlls/ntoskrnl.exe/Makefile.in dlls/Makedll.rules dlls/ntprint/Makefile: dlls/ntprint/Makefile.in dlls/Makedll.rules dlls/ntprint/tests/Makefile: dlls/ntprint/tests/Makefile.in dlls/Maketest.rules diff --git a/VERSION b/VERSION index d6b10dd1ed0..30c5606f5ec 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Wine version 0.9.53 +Wine version 0.9.54 diff --git a/configure b/configure index 4d83e6ca46c..443b48ab5cb 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 0.9.53. +# Generated by GNU Autoconf 2.61 for Wine 0.9.54. # # Report bugs to . # @@ -574,8 +574,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='Wine' PACKAGE_TARNAME='wine' -PACKAGE_VERSION='0.9.53' -PACKAGE_STRING='Wine 0.9.53' +PACKAGE_VERSION='0.9.54' +PACKAGE_STRING='Wine 0.9.54' PACKAGE_BUGREPORT='wine-devel@winehq.org' ac_unique_file="server/atom.c" @@ -1291,7 +1291,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 0.9.53 to adapt to many kinds of systems. +\`configure' configures Wine 0.9.54 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1360,7 +1360,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of Wine 0.9.53:";; + short | recursive ) echo "Configuration of Wine 0.9.54:";; esac cat <<\_ACEOF @@ -1486,7 +1486,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -Wine configure 0.9.53 +Wine configure 0.9.54 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1500,7 +1500,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 0.9.53, which was +It was created by Wine $as_me 0.9.54, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -16557,6 +16557,7 @@ esac + for ac_func in \ _pclose \ _popen \ @@ -16602,6 +16603,7 @@ for ac_func in \ rfork \ sched_yield \ select \ + setproctitle \ setrlimit \ settimeofday \ sigaltstack \ @@ -21440,6 +21442,8 @@ ac_config_files="$ac_config_files dlls/msrle32/Makefile" ac_config_files="$ac_config_files dlls/msvcirt/Makefile" +ac_config_files="$ac_config_files dlls/msvcr71/Makefile" + ac_config_files="$ac_config_files dlls/msvcrt/Makefile" ac_config_files="$ac_config_files dlls/msvcrt/tests/Makefile" @@ -21476,6 +21480,8 @@ ac_config_files="$ac_config_files dlls/ntdll/tests/Makefile" ac_config_files="$ac_config_files dlls/ntdsapi/Makefile" +ac_config_files="$ac_config_files dlls/ntdsapi/tests/Makefile" + ac_config_files="$ac_config_files dlls/ntoskrnl.exe/Makefile" ac_config_files="$ac_config_files dlls/ntprint/Makefile" @@ -22263,7 +22269,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 0.9.53, which was +This file was extended by Wine $as_me 0.9.54, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -22316,7 +22322,7 @@ Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -Wine config.status 0.9.53 +Wine config.status 0.9.54 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" @@ -22596,6 +22602,7 @@ do "dlls/msnet32/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/msnet32/Makefile" ;; "dlls/msrle32/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/msrle32/Makefile" ;; "dlls/msvcirt/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/msvcirt/Makefile" ;; + "dlls/msvcr71/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/msvcr71/Makefile" ;; "dlls/msvcrt/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/msvcrt/Makefile" ;; "dlls/msvcrt/tests/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/msvcrt/tests/Makefile" ;; "dlls/msvcrt20/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/msvcrt20/Makefile" ;; @@ -22614,6 +22621,7 @@ do "dlls/ntdll/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/ntdll/Makefile" ;; "dlls/ntdll/tests/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/ntdll/tests/Makefile" ;; "dlls/ntdsapi/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/ntdsapi/Makefile" ;; + "dlls/ntdsapi/tests/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/ntdsapi/tests/Makefile" ;; "dlls/ntoskrnl.exe/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/ntoskrnl.exe/Makefile" ;; "dlls/ntprint/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/ntprint/Makefile" ;; "dlls/ntprint/tests/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/ntprint/tests/Makefile" ;; diff --git a/configure.ac b/configure.ac index 55c671db3a4..33852d79420 100644 --- a/configure.ac +++ b/configure.ac @@ -1375,6 +1375,7 @@ AC_CHECK_FUNCS(\ rfork \ sched_yield \ select \ + setproctitle \ setrlimit \ settimeofday \ sigaltstack \ @@ -1822,6 +1823,7 @@ AC_CONFIG_FILES([dlls/msisys.ocx/Makefile]) AC_CONFIG_FILES([dlls/msnet32/Makefile]) AC_CONFIG_FILES([dlls/msrle32/Makefile]) AC_CONFIG_FILES([dlls/msvcirt/Makefile]) +AC_CONFIG_FILES([dlls/msvcr71/Makefile]) AC_CONFIG_FILES([dlls/msvcrt/Makefile]) AC_CONFIG_FILES([dlls/msvcrt/tests/Makefile]) AC_CONFIG_FILES([dlls/msvcrt20/Makefile]) @@ -1840,6 +1842,7 @@ AC_CONFIG_FILES([dlls/newdev/Makefile]) AC_CONFIG_FILES([dlls/ntdll/Makefile]) AC_CONFIG_FILES([dlls/ntdll/tests/Makefile]) AC_CONFIG_FILES([dlls/ntdsapi/Makefile]) +AC_CONFIG_FILES([dlls/ntdsapi/tests/Makefile]) AC_CONFIG_FILES([dlls/ntoskrnl.exe/Makefile]) AC_CONFIG_FILES([dlls/ntprint/Makefile]) AC_CONFIG_FILES([dlls/ntprint/tests/Makefile]) diff --git a/dlls/Makefile.in b/dlls/Makefile.in index 29510de6de5..5e0f6dc7b60 100644 --- a/dlls/Makefile.in +++ b/dlls/Makefile.in @@ -132,6 +132,7 @@ BASEDIRS = \ msnet32 \ msrle32 \ msvcirt \ + msvcr71 \ msvcrt \ msvcrt20 \ msvcrt40 \ @@ -295,6 +296,7 @@ TESTSUBDIRS = \ msxml3/tests \ netapi32/tests \ ntdll/tests \ + ntdsapi/tests \ ntprint/tests \ odbccp32/tests \ ole32/tests \ @@ -559,6 +561,7 @@ IMPORT_LIBS = \ mshtml/libmshtml.$(IMPLIBEXT) \ msi/libmsi.$(IMPLIBEXT) \ msimg32/libmsimg32.$(IMPLIBEXT) \ + msvcr71/libmsvcr71.$(IMPLIBEXT) \ msvcrt/libmsvcrt.$(IMPLIBEXT) \ msvcrt20/libmsvcrt20.$(IMPLIBEXT) \ msvcrt40/libmsvcrt40.$(IMPLIBEXT) \ @@ -815,6 +818,9 @@ msi/libmsi.$(IMPLIBEXT): msi/msi.spec $(WINEBUILD) msimg32/libmsimg32.$(IMPLIBEXT): msimg32/msimg32.spec $(WINEBUILD) @cd msimg32 && $(MAKE) libmsimg32.$(IMPLIBEXT) +msvcr71/libmsvcr71.$(IMPLIBEXT): msvcr71/msvcr71.spec $(WINEBUILD) + @cd msvcr71 && $(MAKE) libmsvcr71.$(IMPLIBEXT) + msvcrt/libmsvcrt.$(IMPLIBEXT): msvcrt/msvcrt.spec $(WINEBUILD) @cd msvcrt && $(MAKE) libmsvcrt.$(IMPLIBEXT) diff --git a/dlls/advapi32/security.c b/dlls/advapi32/security.c index 3462608af0e..b8c0a31cdaa 100644 --- a/dlls/advapi32/security.c +++ b/dlls/advapi32/security.c @@ -2478,10 +2478,23 @@ BOOL WINAPI LookupAccountNameW( LPCWSTR lpSystemName, LPCWSTR lpAccountName, PSI BOOL ret; PSID pSid; static const WCHAR dm[] = {'D','O','M','A','I','N',0}; + unsigned int i; FIXME("%s %s %p %p %p %p %p - stub\n", debugstr_w(lpSystemName), debugstr_w(lpAccountName), Sid, cbSid, ReferencedDomainName, cchReferencedDomainName, peUse); + for (i = 0; i < (sizeof(ACCOUNT_SIDS) / sizeof(ACCOUNT_SIDS[0])); i++) + { + if (!strcmpW(lpAccountName, ACCOUNT_SIDS[i].account)) + { + if (*cchReferencedDomainName) + *ReferencedDomainName = '\0'; + *cchReferencedDomainName = 0; + *peUse = SidTypeWellKnownGroup; + return CreateWellKnownSid(ACCOUNT_SIDS[i].type, NULL, Sid, cbSid); + } + } + ret = AllocateAndInitializeSid(&identifierAuthority, 2, SECURITY_BUILTIN_DOMAIN_RID, @@ -3043,9 +3056,252 @@ DWORD WINAPI SetEntriesInAclA( ULONG count, PEXPLICIT_ACCESSA pEntries, DWORD WINAPI SetEntriesInAclW( ULONG count, PEXPLICIT_ACCESSW pEntries, PACL OldAcl, PACL* NewAcl ) { - FIXME("%d %p %p %p\n",count,pEntries,OldAcl,NewAcl); + ULONG i; + PSID *ppsid; + DWORD ret = ERROR_SUCCESS; + DWORD acl_size = sizeof(ACL); + NTSTATUS status; + + TRACE("%d %p %p %p\n", count, pEntries, OldAcl, NewAcl); + *NewAcl = NULL; - return ERROR_SUCCESS; + + if (!count && !OldAcl) + return ERROR_SUCCESS; + + /* allocate array of maximum sized sids allowed */ + ppsid = HeapAlloc(GetProcessHeap(), 0, count * (sizeof(SID *) + FIELD_OFFSET(SID, SubAuthority[SID_MAX_SUB_AUTHORITIES]))); + if (!ppsid) + return ERROR_OUTOFMEMORY; + + for (i = 0; i < count; i++) + { + ppsid[i] = (char *)&ppsid[count] + i * FIELD_OFFSET(SID, SubAuthority[SID_MAX_SUB_AUTHORITIES]); + + TRACE("[%d]:\n\tgrfAccessPermissions = 0x%x\n\tgrfAccessMode = %d\n\tgrfInheritance = 0x%x\n\t" + "Trustee.pMultipleTrustee = %p\n\tMultipleTrusteeOperation = %d\n\tTrusteeForm = %d\n\t" + "Trustee.TrusteeType = %d\n\tptstrName = %p\n", i, + pEntries[i].grfAccessPermissions, pEntries[i].grfAccessMode, pEntries[i].grfInheritance, + pEntries[i].Trustee.pMultipleTrustee, pEntries[i].Trustee.MultipleTrusteeOperation, + pEntries[i].Trustee.TrusteeForm, pEntries[i].Trustee.TrusteeType, + pEntries[i].Trustee.ptstrName); + + if (pEntries[i].Trustee.MultipleTrusteeOperation != NO_MULTIPLE_TRUSTEE) + { + WARN("bad multiple trustee operation %d for trustee %d\n", pEntries[i].Trustee.MultipleTrusteeOperation, i); + ret = ERROR_INVALID_PARAMETER; + goto exit; + } + + switch (pEntries[i].Trustee.TrusteeForm) + { + case TRUSTEE_IS_SID: + if (!CopySid(FIELD_OFFSET(SID, SubAuthority[SID_MAX_SUB_AUTHORITIES]), + ppsid[i], pEntries[i].Trustee.ptstrName)) + { + WARN("bad sid %p for trustee %d\n", pEntries[i].Trustee.ptstrName, i); + ret = ERROR_INVALID_PARAMETER; + goto exit; + } + break; + case TRUSTEE_IS_NAME: + { + DWORD sid_size = FIELD_OFFSET(SID, SubAuthority[SID_MAX_SUB_AUTHORITIES]); + DWORD domain_size = 0; + SID_NAME_USE use; + if (!LookupAccountNameW(NULL, pEntries[i].Trustee.ptstrName, ppsid[i], &sid_size, NULL, &domain_size, &use)) + { + WARN("bad user name %s for trustee %d\n", debugstr_w(pEntries[i].Trustee.ptstrName), i); + ret = ERROR_INVALID_PARAMETER; + goto exit; + } + break; + } + case TRUSTEE_IS_OBJECTS_AND_SID: + FIXME("TRUSTEE_IS_OBJECTS_AND_SID unimplemented\n"); + break; + case TRUSTEE_IS_OBJECTS_AND_NAME: + FIXME("TRUSTEE_IS_OBJECTS_AND_NAME unimplemented\n"); + break; + default: + WARN("bad trustee form %d for trustee %d\n", pEntries[i].Trustee.TrusteeForm, i); + ret = ERROR_INVALID_PARAMETER; + goto exit; + } + + /* Note: we overestimate the ACL size here as a tradeoff between + * instructions (simplicity) and memory */ + switch (pEntries[i].grfAccessMode) + { + case GRANT_ACCESS: + case SET_ACCESS: + acl_size += FIELD_OFFSET(ACCESS_ALLOWED_ACE, SidStart) + GetLengthSid(ppsid[i]); + break; + case DENY_ACCESS: + acl_size += FIELD_OFFSET(ACCESS_DENIED_ACE, SidStart) + GetLengthSid(ppsid[i]); + break; + case SET_AUDIT_SUCCESS: + case SET_AUDIT_FAILURE: + acl_size += FIELD_OFFSET(SYSTEM_AUDIT_ACE, SidStart) + GetLengthSid(ppsid[i]); + break; + case REVOKE_ACCESS: + break; + default: + WARN("bad access mode %d for trustee %d\n", pEntries[i].grfAccessMode, i); + ret = ERROR_INVALID_PARAMETER; + goto exit; + } + } + + if (OldAcl) + { + ACL_SIZE_INFORMATION size_info; + + status = RtlQueryInformationAcl(OldAcl, &size_info, sizeof(size_info), AclSizeInformation); + if (status != STATUS_SUCCESS) + { + ret = RtlNtStatusToDosError(status); + goto exit; + } + acl_size += size_info.AclBytesInUse - sizeof(ACL); + } + + *NewAcl = LocalAlloc(0, acl_size); + if (!*NewAcl) + { + ret = ERROR_OUTOFMEMORY; + goto exit; + } + + status = RtlCreateAcl( *NewAcl, acl_size, ACL_REVISION ); + if (status != STATUS_SUCCESS) + { + ret = RtlNtStatusToDosError(status); + goto exit; + } + + for (i = 0; i < count; i++) + { + switch (pEntries[i].grfAccessMode) + { + case GRANT_ACCESS: + status = RtlAddAccessAllowedAceEx(*NewAcl, ACL_REVISION, + pEntries[i].grfInheritance, + pEntries[i].grfAccessPermissions, + ppsid[i]); + break; + case SET_ACCESS: + { + ULONG j; + BOOL add = TRUE; + if (OldAcl) + { + for (j = 0; ; j++) + { + const ACE_HEADER *existing_ace_header; + status = RtlGetAce(OldAcl, j, (LPVOID *)&existing_ace_header); + if (status != STATUS_SUCCESS) + break; + if (pEntries[i].grfAccessMode == SET_ACCESS && + existing_ace_header->AceType == ACCESS_ALLOWED_ACE_TYPE && + EqualSid(ppsid[i], &((ACCESS_ALLOWED_ACE *)existing_ace_header)->SidStart)) + { + add = FALSE; + break; + } + } + } + if (add) + status = RtlAddAccessAllowedAceEx(*NewAcl, ACL_REVISION, + pEntries[i].grfInheritance, + pEntries[i].grfAccessPermissions, + ppsid[i]); + break; + } + case DENY_ACCESS: + status = RtlAddAccessDeniedAceEx(*NewAcl, ACL_REVISION, + pEntries[i].grfInheritance, + pEntries[i].grfAccessPermissions, + ppsid[i]); + break; + case SET_AUDIT_SUCCESS: + status = RtlAddAuditAccessAceEx(*NewAcl, ACL_REVISION, + pEntries[i].grfInheritance, + pEntries[i].grfAccessPermissions, + ppsid[i], TRUE, FALSE); + break; + case SET_AUDIT_FAILURE: + status = RtlAddAuditAccessAceEx(*NewAcl, ACL_REVISION, + pEntries[i].grfInheritance, + pEntries[i].grfAccessPermissions, + ppsid[i], FALSE, TRUE); + break; + default: + FIXME("unhandled access mode %d\n", pEntries[i].grfAccessMode); + } + } + + if (OldAcl) + { + for (i = 0; ; i++) + { + BOOL add = TRUE; + ULONG j; + const ACE_HEADER *old_ace_header; + status = RtlGetAce(OldAcl, i, (LPVOID *)&old_ace_header); + if (status != STATUS_SUCCESS) break; + for (j = 0; j < count; j++) + { + if (pEntries[j].grfAccessMode == SET_ACCESS && + old_ace_header->AceType == ACCESS_ALLOWED_ACE_TYPE && + EqualSid(ppsid[j], &((ACCESS_ALLOWED_ACE *)old_ace_header)->SidStart)) + { + status = RtlAddAccessAllowedAceEx(*NewAcl, ACL_REVISION, pEntries[j].grfInheritance, pEntries[j].grfAccessPermissions, ppsid[j]); + add = FALSE; + break; + } + else if (pEntries[j].grfAccessMode == REVOKE_ACCESS) + { + switch (old_ace_header->AceType) + { + case ACCESS_ALLOWED_ACE_TYPE: + if (EqualSid(ppsid[j], &((ACCESS_ALLOWED_ACE *)old_ace_header)->SidStart)) + add = FALSE; + break; + case ACCESS_DENIED_ACE_TYPE: + if (EqualSid(ppsid[j], &((ACCESS_DENIED_ACE *)old_ace_header)->SidStart)) + add = FALSE; + break; + case SYSTEM_AUDIT_ACE_TYPE: + if (EqualSid(ppsid[j], &((SYSTEM_AUDIT_ACE *)old_ace_header)->SidStart)) + add = FALSE; + break; + case SYSTEM_ALARM_ACE_TYPE: + if (EqualSid(ppsid[j], &((SYSTEM_ALARM_ACE *)old_ace_header)->SidStart)) + add = FALSE; + break; + default: + FIXME("unhandled ace type %d\n", old_ace_header->AceType); + } + + if (!add) + break; + } + } + if (add) + status = RtlAddAce(*NewAcl, ACL_REVISION, 1, (PACE_HEADER)old_ace_header, old_ace_header->AceSize); + if (status != STATUS_SUCCESS) + { + WARN("RtlAddAce failed with error 0x%08x\n", status); + ret = RtlNtStatusToDosError(status); + break; + } + } + } + +exit: + HeapFree(GetProcessHeap(), 0, ppsid); + return ret; } /****************************************************************************** diff --git a/dlls/advapi32/tests/cred.c b/dlls/advapi32/tests/cred.c index 24db0154294..2fbd1c7e9d0 100644 --- a/dlls/advapi32/tests/cred.c +++ b/dlls/advapi32/tests/cred.c @@ -50,8 +50,8 @@ static void test_CredReadA(void) SetLastError(0xdeadbeef); ret = pCredReadA(TEST_TARGET_NAME, CRED_TYPE_GENERIC, 0xdeadbeef, &cred); - ok(!ret && GetLastError() == ERROR_INVALID_FLAGS, - "CredReadA should have failed with ERROR_INVALID_FLAGS instead of %d\n", + ok(!ret && ( GetLastError() == ERROR_INVALID_FLAGS || GetLastError() == ERROR_INVALID_PARAMETER ), + "CredReadA should have failed with ERROR_INVALID_FLAGS or ERROR_INVALID_PARAMETER instead of %d\n", GetLastError()); SetLastError(0xdeadbeef); @@ -95,8 +95,8 @@ static void test_CredWriteA(void) SetLastError(0xdeadbeef); ret = pCredWriteA(&new_cred, 0); - ok(!ret && GetLastError() == ERROR_BAD_USERNAME, - "CredWrite with username without domain should return ERROR_BAD_USERNAME not %d\n", GetLastError()); + ok(!ret && ( GetLastError() == ERROR_BAD_USERNAME || GetLastError() == ERROR_NO_SUCH_LOGON_SESSION /* Vista */ ), + "CredWrite with username without domain should return ERROR_BAD_USERNAME or ERROR_NO_SUCH_LOGON_SESSION not %d\n", GetLastError()); new_cred.UserName = NULL; SetLastError(0xdeadbeef); @@ -118,8 +118,8 @@ static void test_CredDeleteA(void) SetLastError(0xdeadbeef); ret = pCredDeleteA(TEST_TARGET_NAME, CRED_TYPE_GENERIC, 0xdeadbeef); - ok(!ret && GetLastError() == ERROR_INVALID_FLAGS, - "CredDeleteA should have failed with ERROR_INVALID_FLAGS instead of %d\n", + ok(!ret && ( GetLastError() == ERROR_INVALID_FLAGS || GetLastError() == ERROR_INVALID_PARAMETER /* Vista */ ), + "CredDeleteA should have failed with ERROR_INVALID_FLAGS or ERROR_INVALID_PARAMETER instead of %d\n", GetLastError()); } @@ -226,11 +226,14 @@ static void test_domain_password(void) ret = pCredReadA(TEST_TARGET_NAME, CRED_TYPE_DOMAIN_PASSWORD, 0, &cred); ok(ret, "CredReadA failed with error %d\n", GetLastError()); - todo_wine - ok(cred->CredentialBlobSize == 0, "expected CredentialBlobSize of 0 but got %d\n", cred->CredentialBlobSize); - todo_wine - ok(!cred->CredentialBlob, "expected NULL credentials but got %p\n", cred->CredentialBlob); - pCredFree(cred); + if (ret) /* don't check the values of cred, if CredReadA failed. */ + { + todo_wine + ok(cred->CredentialBlobSize == 0, "expected CredentialBlobSize of 0 but got %d\n", cred->CredentialBlobSize); + todo_wine + ok(!cred->CredentialBlob, "expected NULL credentials but got %p\n", cred->CredentialBlob); + pCredFree(cred); + } ret = pCredDeleteA(TEST_TARGET_NAME, CRED_TYPE_DOMAIN_PASSWORD, 0); ok(ret, "CredDeleteA failed with error %d\n", GetLastError()); diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c index 217d89c79dc..6b43cb347db 100644 --- a/dlls/advapi32/tests/security.c +++ b/dlls/advapi32/tests/security.c @@ -1541,6 +1541,20 @@ static void test_LookupAccountName(void) ok(sid_use == SidTypeUser, "Expected SidTypeUser, got %d\n", sid_use); } domain_size = domain_save; + sid_size = sid_save; + + ret = LookupAccountNameA(NULL, "Everyone", psid, &sid_size, domain, &domain_size, &sid_use); + get_sid_info(psid, &account, &sid_dom); + ok(ret, "Failed to lookup account name\n"); + ok(sid_size != 0, "sid_size was zero\n"); + ok(!lstrcmp(account, "Everyone"), "Expected Everyone, got %s\n", account); + todo_wine + ok(!lstrcmp(domain, sid_dom), "Expected %s, got %s\n", sid_dom, domain); + ok(domain_size == 0, "Expected 0, got %d\n", domain_size); + todo_wine + ok(lstrlen(domain) == domain_size, "Expected %d, got %d\n", lstrlen(domain), domain_size); + ok(sid_use == SidTypeWellKnownGroup, "Expected SidTypeUser, got %d\n", sid_use); + domain_size = domain_save; /* NULL Sid with zero sid size */ SetLastError(0xdeadbeef); @@ -1973,8 +1987,13 @@ static void test_impersonation_level(void) static void test_SetEntriesInAcl(void) { - ACL *acl = (ACL*)0xdeadbeef; DWORD res; + PSID EveryoneSid = NULL, UsersSid = NULL; + PACL OldAcl = NULL, NewAcl; + SID_IDENTIFIER_AUTHORITY SIDAuthWorld = { SECURITY_WORLD_SID_AUTHORITY }; + SID_IDENTIFIER_AUTHORITY SIDAuthNT = { SECURITY_NT_AUTHORITY }; + EXPLICIT_ACCESSW ExplicitAccess; + static const WCHAR wszEveryone[] = {'E','v','e','r','y','o','n','e',0}; if (!pSetEntriesInAclW) { @@ -1982,14 +2001,87 @@ static void test_SetEntriesInAcl(void) return; } - res = pSetEntriesInAclW(0, NULL, NULL, &acl); + NewAcl = (PACL)0xdeadbeef; + res = pSetEntriesInAclW(0, NULL, NULL, &NewAcl); if(res == ERROR_CALL_NOT_IMPLEMENTED) { skip("SetEntriesInAclW is not implemented\n"); return; } ok(res == ERROR_SUCCESS, "SetEntriesInAclW failed: %u\n", res); - ok(acl == NULL, "acl=%p, expected NULL\n", acl); + ok(NewAcl == NULL, "NewAcl=%p, expected NULL\n", NewAcl); + + OldAcl = HeapAlloc(GetProcessHeap(), 0, 256); + res = InitializeAcl(OldAcl, 256, ACL_REVISION); + if(!res && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED) + { + skip("ACLs not implemented - skipping tests\n"); + HeapFree(GetProcessHeap(), 0, OldAcl); + return; + } + ok(res, "InitializeAcl failed with error %d\n", GetLastError()); + + res = AllocateAndInitializeSid( &SIDAuthWorld, 1, SECURITY_WORLD_RID, 0, 0, 0, 0, 0, 0, 0, &EveryoneSid); + ok(res, "AllocateAndInitializeSid failed with error %d\n", GetLastError()); + + res = AllocateAndInitializeSid( &SIDAuthNT, 2, SECURITY_BUILTIN_DOMAIN_RID, + DOMAIN_ALIAS_RID_USERS, 0, 0, 0, 0, 0, 0, &UsersSid); + ok(res, "AllocateAndInitializeSid failed with error %d\n", GetLastError()); + + res = AddAccessAllowedAce(OldAcl, ACL_REVISION, KEY_READ, UsersSid); + ok(res, "AddAccessAllowedAce failed with error %d\n", GetLastError()); + + ExplicitAccess.grfAccessPermissions = KEY_WRITE; + ExplicitAccess.grfAccessMode = GRANT_ACCESS; + ExplicitAccess.grfInheritance = NO_INHERITANCE; + ExplicitAccess.Trustee.pMultipleTrustee = NULL; + ExplicitAccess.Trustee.MultipleTrusteeOperation = NO_MULTIPLE_TRUSTEE; + ExplicitAccess.Trustee.TrusteeForm = TRUSTEE_IS_SID; + ExplicitAccess.Trustee.TrusteeType = TRUSTEE_IS_UNKNOWN; + ExplicitAccess.Trustee.ptstrName = (LPWSTR)EveryoneSid; + res = pSetEntriesInAclW(1, &ExplicitAccess, OldAcl, &NewAcl); + ok(res == ERROR_SUCCESS, "SetEntriesInAclW failed: %u\n", res); + ok(NewAcl != NULL, "returned acl was NULL\n"); + LocalFree(NewAcl); + + ExplicitAccess.Trustee.TrusteeForm = TRUSTEE_IS_USER; + ExplicitAccess.Trustee.ptstrName = (LPWSTR)wszEveryone; + res = pSetEntriesInAclW(1, &ExplicitAccess, OldAcl, &NewAcl); + ok(res == ERROR_SUCCESS, "SetEntriesInAclW failed: %u\n", res); + ok(NewAcl != NULL, "returned acl was NULL\n"); + LocalFree(NewAcl); + + ExplicitAccess.Trustee.TrusteeForm = TRUSTEE_BAD_FORM; + res = pSetEntriesInAclW(1, &ExplicitAccess, OldAcl, &NewAcl); + ok(res == ERROR_INVALID_PARAMETER, "SetEntriesInAclW failed: %u\n", res); + ok(NewAcl == NULL, "returned acl wasn't NULL: %p\n", NewAcl); + LocalFree(NewAcl); + + ExplicitAccess.Trustee.TrusteeForm = TRUSTEE_IS_USER; + ExplicitAccess.Trustee.MultipleTrusteeOperation = TRUSTEE_IS_IMPERSONATE; + res = pSetEntriesInAclW(1, &ExplicitAccess, OldAcl, &NewAcl); + ok(res == ERROR_INVALID_PARAMETER, "SetEntriesInAclW failed: %u\n", res); + ok(NewAcl == NULL, "returned acl wasn't NULL: %p\n", NewAcl); + LocalFree(NewAcl); + + ExplicitAccess.Trustee.MultipleTrusteeOperation = NO_MULTIPLE_TRUSTEE; + ExplicitAccess.grfAccessMode = SET_ACCESS; + res = pSetEntriesInAclW(1, &ExplicitAccess, OldAcl, &NewAcl); + ok(res == ERROR_SUCCESS, "SetEntriesInAclW failed: %u\n", res); + ok(NewAcl != NULL, "returned acl was NULL\n"); + LocalFree(NewAcl); + + ExplicitAccess.grfAccessMode = REVOKE_ACCESS; + ExplicitAccess.Trustee.TrusteeForm = TRUSTEE_IS_SID; + ExplicitAccess.Trustee.ptstrName = (LPWSTR)UsersSid; + res = pSetEntriesInAclW(1, &ExplicitAccess, OldAcl, &NewAcl); + ok(res == ERROR_SUCCESS, "SetEntriesInAclW failed: %u\n", res); + ok(NewAcl != NULL, "returned acl was NULL\n"); + LocalFree(NewAcl); + + LocalFree(UsersSid); + LocalFree(EveryoneSid); + HeapFree(GetProcessHeap(), 0, OldAcl); } static void test_GetNamedSecurityInfoA(void) diff --git a/dlls/advapi32/tests/service.c b/dlls/advapi32/tests/service.c index 4b7bd317150..cf5b809d4ea 100644 --- a/dlls/advapi32/tests/service.c +++ b/dlls/advapi32/tests/service.c @@ -843,6 +843,188 @@ static void test_sequence(void) HeapFree(GetProcessHeap(), 0, config); } +static void test_queryconfig2(void) +{ + SC_HANDLE scm_handle, svc_handle; + BOOL ret; + DWORD expected, needed; + BYTE buffer[MAX_PATH]; + LPSERVICE_DESCRIPTIONA pConfig = (LPSERVICE_DESCRIPTIONA)buffer; + static const CHAR servicename [] = "Winetest"; + static const CHAR displayname [] = "Winetest dummy service"; + static const CHAR pathname [] = "we_dont_care.exe"; + static const CHAR dependencies[] = "Master1\0Master2\0+MasterGroup1\0"; + static const CHAR password [] = ""; + static const CHAR description [] = "Description"; + HMODULE dllhandle = GetModuleHandleA("advapi32.dll"); + BOOL (WINAPI *pChangeServiceConfig2A)(SC_HANDLE,DWORD,LPVOID) + = (void*)GetProcAddress(dllhandle, "ChangeServiceConfig2A"); + BOOL (WINAPI *pQueryServiceConfig2A)(SC_HANDLE,DWORD,LPBYTE,DWORD,LPDWORD) + = (void*)GetProcAddress(dllhandle, "QueryServiceConfig2A"); + BOOL (WINAPI *pQueryServiceConfig2W)(SC_HANDLE,DWORD,LPBYTE,DWORD,LPDWORD) + = (void*)GetProcAddress(dllhandle, "QueryServiceConfig2W"); + if(!pQueryServiceConfig2A) + { + skip("function QueryServiceConfig2A not present\n"); + return; + } + + SetLastError(0xdeadbeef); + scm_handle = OpenSCManagerA(NULL, NULL, GENERIC_ALL); + + if (!scm_handle) + { + if(GetLastError() == ERROR_ACCESS_DENIED) + skip("Not enough rights to get a handle to the manager\n"); + else + ok(FALSE, "Could not get a handle to the manager: %d\n", GetLastError()); + return; + } + + /* Create a dummy service */ + SetLastError(0xdeadbeef); + svc_handle = CreateServiceA(scm_handle, servicename, displayname, GENERIC_ALL, + SERVICE_INTERACTIVE_PROCESS | SERVICE_WIN32_OWN_PROCESS, SERVICE_DISABLED, SERVICE_ERROR_IGNORE, + pathname, NULL, NULL, dependencies, NULL, password); + + if (!svc_handle) + { + if(GetLastError() == ERROR_SERVICE_EXISTS) + { + /* We try and open the service and do the rest of the tests. Some could + * fail if the tests were changed between these runs. + */ + trace("Deletion probably didn't work last time\n"); + SetLastError(0xdeadbeef); + svc_handle = OpenServiceA(scm_handle, servicename, GENERIC_ALL); + if (!svc_handle) + { + if(GetLastError() == ERROR_ACCESS_DENIED) + skip("Not enough rights to open the service\n"); + else + ok(FALSE, "Could not open the service : %d\n", GetLastError()); + CloseServiceHandle(scm_handle); + return; + } + } + if (GetLastError() == ERROR_ACCESS_DENIED) + { + skip("Not enough rights to create the service\n"); + CloseServiceHandle(scm_handle); + return; + } + ok(svc_handle != NULL, "Could not create the service : %d\n", GetLastError()); + if (!svc_handle) + { + CloseServiceHandle(scm_handle); + return; + } + } + SetLastError(0xdeadbeef); + ret = pQueryServiceConfig2A(svc_handle,0xfff0,buffer,sizeof(SERVICE_DESCRIPTIONA),&needed); + ok(!ret, "expected QueryServiceConfig2A to fail\n"); + ok(ERROR_INVALID_LEVEL == GetLastError(), "expected error ERROR_INVALID_LEVEL, got %d\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = pQueryServiceConfig2A(svc_handle,0xfff0,buffer,sizeof(SERVICE_DESCRIPTIONA),NULL); + ok(!ret, "expected QueryServiceConfig2A to fail\n"); + ok(ERROR_INVALID_LEVEL == GetLastError(), "expected error ERROR_INVALID_LEVEL, got %d\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = pQueryServiceConfig2A(svc_handle, SERVICE_CONFIG_DESCRIPTION,buffer,sizeof(SERVICE_DESCRIPTIONA),NULL); + ok(!ret, "expected QueryServiceConfig2A to fail\n"); + ok(ERROR_INVALID_ADDRESS == GetLastError(), "expected error ERROR_INVALID_ADDRESS, got %d\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = pQueryServiceConfig2A(svc_handle, SERVICE_CONFIG_DESCRIPTION,NULL,sizeof(SERVICE_DESCRIPTIONA),&needed); + ok(!ret, "expected QueryServiceConfig2A to fail\n"); + ok(ERROR_INVALID_ADDRESS == GetLastError(), "expected error ERROR_INVALID_ADDRESS, got %d\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = pQueryServiceConfig2A(svc_handle, SERVICE_CONFIG_DESCRIPTION,NULL,sizeof(SERVICE_DESCRIPTIONA),NULL); + ok(!ret, "expected QueryServiceConfig2A to fail\n"); + ok(ERROR_INVALID_ADDRESS == GetLastError(), "expected error ERROR_INVALID_ADDRESS, got %d\n", GetLastError()); + + needed = 0; + pConfig->lpDescription = (LPSTR)0xdeadbeef; + ret = pQueryServiceConfig2A(svc_handle, SERVICE_CONFIG_DESCRIPTION,buffer,sizeof(SERVICE_DESCRIPTIONA),&needed); + ok(ret, "expected QueryServiceConfig2A to succeed\n"); + ok(needed == sizeof(SERVICE_DESCRIPTIONA), "got %d\n", needed); + ok(!pConfig->lpDescription, "expected lpDescription to be NULL, got %p\n", pConfig->lpDescription); + + SetLastError(0xdeadbeef); + needed = 0; + ret = pQueryServiceConfig2A(svc_handle, SERVICE_CONFIG_DESCRIPTION,NULL,0,&needed); + ok(!ret, "expected QueryServiceConfig2A to fail\n"); + ok(ERROR_INSUFFICIENT_BUFFER == GetLastError(), "expected error ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError()); + ok(needed == sizeof(SERVICE_DESCRIPTIONA), "got %d\n", needed); + + if(!pChangeServiceConfig2A) + { + skip("function ChangeServiceConfig2A not present\n"); + goto cleanup; + } + + pConfig->lpDescription = (LPSTR) description; + ret = pChangeServiceConfig2A(svc_handle, SERVICE_CONFIG_DESCRIPTION,buffer); + ok(ret, "ChangeServiceConfig2A failed\n"); + if (!ret) { + goto cleanup; + } + + SetLastError(0xdeadbeef); + needed = 0; + expected = sizeof(SERVICE_DESCRIPTIONA) + sizeof(description) * sizeof(WCHAR); /* !! */ + ret = pQueryServiceConfig2A(svc_handle, SERVICE_CONFIG_DESCRIPTION,buffer,sizeof(SERVICE_DESCRIPTIONA),&needed); + ok(!ret, "expected QueryServiceConfig2A to fail\n"); + ok(ERROR_INSUFFICIENT_BUFFER == GetLastError(), "expected error ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError()); + ok(needed == expected, "expected needed to be %d, got %d\n", expected, needed); + + SetLastError(0xdeadbeef); + ret = pQueryServiceConfig2A(svc_handle, SERVICE_CONFIG_DESCRIPTION,buffer,needed-1,&needed); + ok(!ret, "expected QueryServiceConfig2A to fail\n"); + ok(ERROR_INSUFFICIENT_BUFFER == GetLastError(), "expected error ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError()); + + SetLastError(0xdeadbeef); + ret = pQueryServiceConfig2A(svc_handle, SERVICE_CONFIG_DESCRIPTION,buffer,needed,&needed); + ok(ret, "expected QueryServiceConfig2A to succeed\n"); + ok(pConfig->lpDescription && !strcmp(description,pConfig->lpDescription), + "expected lpDescription to be %s, got %s\n",description ,pConfig->lpDescription); + + SetLastError(0xdeadbeef); + ret = pQueryServiceConfig2A(svc_handle, SERVICE_CONFIG_DESCRIPTION,buffer, needed + 1,&needed); + ok(ret, "expected QueryServiceConfig2A to succeed\n"); + ok(pConfig->lpDescription && !strcmp(description,pConfig->lpDescription), + "expected lpDescription to be %s, got %s\n",description ,pConfig->lpDescription); + + if(!pQueryServiceConfig2W) + { + skip("function QueryServiceConfig2W not present\n"); + goto cleanup; + } + SetLastError(0xdeadbeef); + needed = 0; + expected = sizeof(SERVICE_DESCRIPTIONW) + sizeof(WCHAR) * sizeof(description); + ret = pQueryServiceConfig2W(svc_handle, SERVICE_CONFIG_DESCRIPTION,NULL,0,&needed); + ok(!ret, "expected QueryServiceConfig2W to fail\n"); + ok(ERROR_INSUFFICIENT_BUFFER == GetLastError(), "expected error ERROR_INSUFFICIENT_BUFFER, got %d\n", GetLastError()); + ok(needed == expected, "expected needed to be %d, got %d\n", expected, needed); + + SetLastError(0xdeadbeef); + ret = pQueryServiceConfig2W(svc_handle, SERVICE_CONFIG_DESCRIPTION,buffer, needed,&needed); + ok(ret, "expected QueryServiceConfig2W to succeed\n"); + +cleanup: + DeleteService(svc_handle); + + CloseServiceHandle(svc_handle); + + /* Wait a while. The following test does a CreateService again */ + Sleep(1000); + + CloseServiceHandle(scm_handle); +} + static void test_refcount(void) { SC_HANDLE scm_handle, svc_handle1, svc_handle2, svc_handle3, svc_handle4, svc_handle5; @@ -967,6 +1149,7 @@ START_TEST(service) test_close(); /* Test the creation, querying and deletion of a service */ test_sequence(); + test_queryconfig2(); /* The main reason for this test is to check if any refcounting is used * and what the rules are */ diff --git a/dlls/browseui/rsrc.rc b/dlls/browseui/rsrc.rc index 96f39f7b5aa..5a4a8a98abf 100644 --- a/dlls/browseui/rsrc.rc +++ b/dlls/browseui/rsrc.rc @@ -29,3 +29,4 @@ #include "rsrc_Fr.rc" #include "rsrc_Ko.rc" #include "rsrc_No.rc" +#include "rsrc_Ru.rc" diff --git a/dlls/browseui/rsrc_Ru.rc b/dlls/browseui/rsrc_Ru.rc new file mode 100644 index 00000000000..bab8e449287 --- /dev/null +++ b/dlls/browseui/rsrc_Ru.rc @@ -0,0 +1,38 @@ +/* + * Copyright 2008 Andrey Esin + * + * 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_RUSSIAN, SUBLANG_DEFAULT + +STRINGTABLE +{ + IDS_CANCELLING "Îòìåíà..." +} + +IDD_PROGRESS_DLG DIALOG 0, 0, 260, 85 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU +CAPTION "" +FONT 8, "MS Shell Dlg" +{ + CONTROL "", IDC_ANIMATION, ANIMATE_CLASSA, 0, 12, 10, 236, 25 /* TODO: style */ + LTEXT "", IDC_TEXT_LINE, 7, 45, 250, 10, SS_LEFT|SS_NOPREFIX + LTEXT "", IDC_TEXT_LINE + 1, 7, 55, 250, 10, SS_LEFT|SS_NOPREFIX + CONTROL "", IDC_PROGRESS_BAR, PROGRESS_CLASSA, WS_BORDER, 7, 65, 190, 8 + PUSHBUTTON "&Îòìåíà", IDCANCEL, 205, 65, 40, 15, WS_GROUP | WS_TABSTOP | WS_VISIBLE + LTEXT "", IDC_TEXT_LINE + 2, 7, 75, 190, 10, SS_LEFT|SS_NOPREFIX +} diff --git a/dlls/cabinet/fci.c b/dlls/cabinet/fci.c index da06cb7bd28..a33f2e3933c 100644 --- a/dlls/cabinet/fci.c +++ b/dlls/cabinet/fci.c @@ -379,7 +379,7 @@ static BOOL fci_flush_data_block (HFCI hfci, int* err, /* add optional reserved area */ /* This allocation and freeing at each CFData block is a bit */ - /* inefficent, but it's harder to forget about freeing the buffer :-). */ + /* inefficient, but it's harder to forget about freeing the buffer :-). */ /* Reserved areas are used seldom besides that... */ if (cbReserveCFData!=0) { if(!(reserved = (char*)PFCI_ALLOC(hfci, cbReserveCFData))) { diff --git a/dlls/comctl32/animate.c b/dlls/comctl32/animate.c index 931f27921b6..d6c84daaadf 100644 --- a/dlls/comctl32/animate.c +++ b/dlls/comctl32/animate.c @@ -85,7 +85,7 @@ typedef struct int nToFrame; int nLoop; int currFrame; - /* tranparency info*/ + /* transparency info*/ COLORREF transparentColor; HBRUSH hbrushBG; HBITMAP hbmPrevFrame; diff --git a/dlls/comctl32/comctl32undoc.c b/dlls/comctl32/comctl32undoc.c index 8ada7825bb7..418e87cac79 100644 --- a/dlls/comctl32/comctl32undoc.c +++ b/dlls/comctl32/comctl32undoc.c @@ -812,7 +812,7 @@ HANDLE WINAPI CreateMRUListA (const CREATEMRULISTA *lpcml) /************************************************************************** * EnumMRUListW [COMCTL32.403] * - * Enumerate item in a most-recenty-used list + * Enumerate item in a most-recently-used list * * PARAMS * hList [I] list handle diff --git a/dlls/comctl32/commctrl.c b/dlls/comctl32/commctrl.c index 2c2cd1ac85f..0e901977dfd 100644 --- a/dlls/comctl32/commctrl.c +++ b/dlls/comctl32/commctrl.c @@ -714,7 +714,7 @@ InitCommonControls (void) * Failure: FALSE * * NOTES - * Probaly all versions of comctl32 initializes the Win95 controls in DllMain + * Probably all versions of comctl32 initializes the Win95 controls in DllMain * during DLL initialization. Starting from comctl32 v5.82 all the controls * are initialized there. We follow this behaviour and this function is just * a dummy. @@ -1091,7 +1091,7 @@ VOID WINAPI InitMUILanguage (LANGID uiLang) * BUGS * If an application manually subclasses a window after subclassing it with * this API and then with this API again, then none of the previous - * subclasses get called or the origional window procedure. + * subclasses get called or the original window procedure. */ BOOL WINAPI SetWindowSubclass (HWND hWnd, SUBCLASSPROC pfnSubclass, @@ -1257,7 +1257,7 @@ BOOL WINAPI RemoveWindowSubclass(HWND hWnd, SUBCLASSPROC pfnSubclass, UINT_PTR u if (!stack->SubclassProcs && !stack->running) { TRACE("Last Subclass removed, cleaning up\n"); - /* clean up our heap and reset the origional window procedure */ + /* clean up our heap and reset the original window procedure */ if (IsWindowUnicode (hWnd)) SetWindowLongPtrW (hWnd, GWLP_WNDPROC, (DWORD_PTR)stack->origproc); else @@ -1299,7 +1299,7 @@ LRESULT WINAPI COMCTL32_SubclassProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARA if (!stack->SubclassProcs && !stack->running) { TRACE("Last Subclass removed, cleaning up\n"); - /* clean up our heap and reset the origional window procedure */ + /* clean up our heap and reset the original window procedure */ if (IsWindowUnicode (hWnd)) SetWindowLongPtrW (hWnd, GWLP_WNDPROC, (DWORD_PTR)stack->origproc); else diff --git a/dlls/comctl32/imagelist.h b/dlls/comctl32/imagelist.h index cd72f3846f3..73ccd8a376c 100644 --- a/dlls/comctl32/imagelist.h +++ b/dlls/comctl32/imagelist.h @@ -39,7 +39,7 @@ struct _IMAGELIST DWORD x4; UINT flags; /* 1c: flags */ COLORREF clrFg; /* 20: foreground color */ - COLORREF clrBk; /* 24: backgournd color */ + COLORREF clrBk; /* 24: background color */ HBITMAP hbmImage; /* 30: images Bitmap */ diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index 0c27885df41..3c74033326c 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -371,7 +371,7 @@ typedef struct tagLISTVIEW_INFO /* Size of "line" scroll for V & H scrolls */ #define LISTVIEW_SCROLL_ICON_LINE_SIZE 37 -/* Padding betwen image and label */ +/* Padding between image and label */ #define IMAGE_PADDING 2 /* Padding behind the label */ @@ -950,7 +950,7 @@ static void prepaint_setup (const LISTVIEW_INFO *infoPtr, HDC hdc, NMLVCUSTOMDRA if (lpnmlvcd->clrText == CLR_DEFAULT) lpnmlvcd->clrText = comctl32_color.clrWindowText; - /* apprently, for selected items, we have to override the returned values */ + /* apparently, for selected items, we have to override the returned values */ if (!SubItem) { if (lpnmlvcd->nmcd.uItemState & CDIS_SELECTED) @@ -1010,7 +1010,7 @@ static inline BOOL ranges_delitem(RANGES ranges, INT nItem) * ITERATOR DOCUMENTATION * * The iterator functions allow for easy, and convenient iteration - * over items of iterest in the list. Typically, you create a + * over items of interest in the list. Typically, you create a * iterator, use it, and destroy it, as such: * ITERATOR i; * @@ -1496,7 +1496,7 @@ static inline INT LISTVIEW_GetCountPerColumn(const LISTVIEW_INFO *infoPtr) * BUGS * * - The current implementation has a list of characters it will - * accept and it ignores averything else. In particular it will + * accept and it ignores everything else. In particular it will * ignore accentuated characters which seems to match what * Windows does. But I'm not sure it makes sense to follow * Windows there. @@ -1826,9 +1826,9 @@ static void LISTVIEW_InvalidateSelectedItems(const LISTVIEW_INFO *infoPtr) * Computes an item's (left,top) corner, relative to rcView. * That is, the position has NOT been made relative to the Origin. * This is deliberate, to avoid computing the Origin over, and - * over again, when this function is call in a loop. Instead, - * one ca factor the computation of the Origin before the loop, - * and offset the value retured by this function, on every iteration. + * over again, when this function is called in a loop. Instead, + * one can factor the computation of the Origin before the loop, + * and offset the value returned by this function, on every iteration. * * PARAMETER(S): * [I] infoPtr : valid pointer to the listview structure @@ -1866,15 +1866,15 @@ static void LISTVIEW_GetItemOrigin(const LISTVIEW_INFO *infoPtr, INT nItem, LPPO * DESCRIPTION: [INTERNAL] * Compute the rectangles of an item. This is to localize all * the computations in one place. If you are not interested in some - * of these values, simply pass in a NULL -- the fucntion is smart + * of these values, simply pass in a NULL -- the function is smart * enough to compute only what's necessary. The function computes * the standard rectangles (BOUNDS, ICON, LABEL) plus a non-standard * one, the BOX rectangle. This rectangle is very cheap to compute, * and is guaranteed to contain all the other rectangles. Computing - * the ICON rect is also cheap, but all the others are potentaily + * the ICON rect is also cheap, but all the others are potentially * expensive. This gives an easy and effective optimization when * searching (like point inclusion, or rectangle intersection): - * first test against the BOX, and if TRUE, test agains the desired + * first test against the BOX, and if TRUE, test against the desired * rectangle. * If the function does not have all the necessary information * to computed the requested rectangles, will crash with a @@ -1884,7 +1884,7 @@ static void LISTVIEW_GetItemOrigin(const LISTVIEW_INFO *infoPtr, INT nItem, LPPO * We have the following 'special' meanings for a few fields: * * If LVIS_FOCUSED is set, we assume the item has the focus * This is important in ICON mode, where it might get a larger - * then usual rectange + * then usual rectangle * * Please note that subitem support works only in REPORT mode. * @@ -2009,7 +2009,7 @@ static void LISTVIEW_GetItemMetrics(const LISTVIEW_INFO *infoPtr, const LVITEMW /************************************************************/ if (doLabel) { - /* calculate how far to the right can the label strech */ + /* calculate how far to the right can the label stretch */ Label.right = Box.right; if (uView == LVS_REPORT) { @@ -2760,7 +2760,7 @@ static BOOL ranges_add(RANGES ranges, RANGE range) TRACE("New range %s @%d\n", debugrange(chkrgn), index); - /* merge now common anges */ + /* merge now common ranges */ fromindex = 0; srchrgn.lower = chkrgn->lower - 1; srchrgn.upper = chkrgn->upper + 1; @@ -3349,7 +3349,7 @@ static LRESULT LISTVIEW_MouseMove(LISTVIEW_INFO *infoPtr, WORD fwKeys, INT x, IN /*** - * Tests wheather the item is assignable to a list with style lStyle + * Tests whether the item is assignable to a list with style lStyle */ static inline BOOL is_assignable_item(const LVITEMW *lpLVItem, LONG lStyle) { @@ -3367,7 +3367,7 @@ static inline BOOL is_assignable_item(const LVITEMW *lpLVItem, LONG lStyle) * * PARAMETER(S): * [I] infoPtr : valid pointer to the listview structure - * [I] lpLVItem : valid pointer to new item atttributes + * [I] lpLVItem : valid pointer to new item attributes * [I] isNew : the item being set is being inserted * [I] isW : TRUE if lpLVItem is Unicode, FALSE if it's ANSI * [O] bChanged : will be set to TRUE if the item really changed @@ -3392,7 +3392,7 @@ static BOOL set_main_item(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem, BOOL if (infoPtr->dwStyle & LVS_OWNERDATA) { - /* a virtual listview we stores only selection and focus */ + /* a virtual listview only stores selection and focus */ if (lpLVItem->mask & ~LVIF_STATE) return FALSE; lpItem = NULL; @@ -3442,7 +3442,7 @@ static BOOL set_main_item(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem, BOOL nmlv.lParam = item.lParam; /* send LVN_ITEMCHANGING notification, if the item is not being inserted */ - /* and we are _NOT_ virtual (LVS_OWERNDATA), and change notifications */ + /* and we are _NOT_ virtual (LVS_OWNERDATA), and change notifications */ /* are enabled */ if(lpItem && !isNew && infoPtr->bDoChangeNotify) { @@ -3512,7 +3512,7 @@ static BOOL set_main_item(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem, BOOL * * PARAMETER(S): * [I] infoPtr : valid pointer to the listview structure - * [I] lpLVItem : valid pointer to new subitem atttributes + * [I] lpLVItem : valid pointer to new subitem attributes * [I] isW : TRUE if lpLVItem is Unicode, FALSE if it's ANSI * [O] bChanged : will be set to TRUE if the item really changed * @@ -3590,7 +3590,7 @@ static BOOL set_sub_item(const LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem, * * PARAMETER(S): * [I] infoPtr : valid pointer to the listview structure - * [I] lpLVItem : new item atttributes + * [I] lpLVItem : new item attributes * [I] isW : TRUE if lpLVItem is Unicode, FALSE if it's ANSI * * RETURN: @@ -4425,7 +4425,7 @@ static void LISTVIEW_ScrollColumns(LISTVIEW_INFO *infoPtr, INT nColumn, INT dx) if (nColumn >= DPA_GetPtrCount(infoPtr->hdpaColumns)) rcCol.left = rcCol.right; - /* ajust the other columns */ + /* adjust the other columns */ for (nCol = nColumn; nCol < DPA_GetPtrCount(infoPtr->hdpaColumns); nCol++) { lpColumnInfo = LISTVIEW_GetColumnInfo(infoPtr, nCol); @@ -4436,7 +4436,7 @@ static void LISTVIEW_ScrollColumns(LISTVIEW_INFO *infoPtr, INT nColumn, INT dx) /* do not update screen if not in report mode */ if (!is_redrawing(infoPtr) || (infoPtr->dwStyle & LVS_TYPEMASK) != LVS_REPORT) return; - /* if we have a focus, must first erase the focus rect */ + /* if we have a focus, we must first erase the focus rect */ if (infoPtr->bFocus) LISTVIEW_ShowFocusRect(infoPtr, FALSE); /* Need to reset the item width when inserting a new column */ @@ -6497,7 +6497,7 @@ static BOOL LISTVIEW_RedrawItems(const LISTVIEW_INFO *infoPtr, INT nFirst, INT n * is 16 and an 8 is passed, the list will be scrolled by 16. If a 7 * is passed, then the scroll will be 0. (per MSDN 7/2002) * - * For: (per experimentaion with native control and CSpy ListView) + * For: (per experimentation with native control and CSpy ListView) * LVS_ICON dy=1 = 1 pixel (vertical only) * dx ignored * LVS_SMALLICON dy=1 = 1 pixel (vertical only) @@ -10116,7 +10116,7 @@ static LRESULT CALLBACK EditLblWndProcA(HWND hwnd, UINT uMsg, WPARAM wParam, LPA /*** * DESCRIPTION: - * Creates a subclassed edit cotrol + * Creates a subclassed edit control * * PARAMETER(S): * [I] infoPtr : valid pointer to the listview structure diff --git a/dlls/comctl32/monthcal.c b/dlls/comctl32/monthcal.c index ccc1abe536a..1249f0f63cd 100644 --- a/dlls/comctl32/monthcal.c +++ b/dlls/comctl32/monthcal.c @@ -333,7 +333,7 @@ static void MONTHCAL_DrawDay(const MONTHCAL_INFO *infoPtr, HDC hdc, int day, int wsprintfW(buf, fmtW, day); /* No need to check styles: when selection is not valid, it is set to zero. - * 1days.left + 3, title->bottom + textHeight + 1, NULL); LineTo(hdc, infoPtr->days.right - 3, title->bottom + textHeight + 1); diff --git a/dlls/comctl32/propsheet.c b/dlls/comctl32/propsheet.c index f6837085a2d..f7e2cba6cc8 100644 --- a/dlls/comctl32/propsheet.c +++ b/dlls/comctl32/propsheet.c @@ -1218,7 +1218,7 @@ static BOOL PROPSHEET_CreateTabControl(HWND hwndParent, /****************************************************************************** * PROPSHEET_WizardSubclassProc * - * Subclassing window procedure for wizard extrior pages to prevent drawing + * Subclassing window procedure for wizard exterior pages to prevent drawing * background and so drawing above the watermark. */ static LRESULT CALLBACK diff --git a/dlls/comctl32/rebar.c b/dlls/comctl32/rebar.c index 31d83dee0cb..94e36f893c4 100644 --- a/dlls/comctl32/rebar.c +++ b/dlls/comctl32/rebar.c @@ -74,7 +74,7 @@ /* * 3. REBAR_MoveChildWindows should have a loop because more than - * one pass is made (together with the RBN_CHILDSIZEs) is made on + * one pass (together with the RBN_CHILDSIZEs) is made on * at least RB_INSERTBAND */ @@ -167,7 +167,7 @@ typedef struct DWORD orgStyle; /* original style (dwStyle may change) */ SIZE calcSize; /* calculated rebar size - coordinates swapped for CCS_VERT */ BOOL bUnicode; /* TRUE if parent wants notify in W format */ - BOOL DoRedraw; /* TRUE to acutally draw bands */ + BOOL DoRedraw; /* TRUE to actually draw bands */ UINT fStatus; /* Status flags (see below) */ HCURSOR hcurArrow; /* handle to the arrow cursor */ HCURSOR hcurHorz; /* handle to the EW cursor */ @@ -233,7 +233,7 @@ typedef struct /* height of a rebar without a child */ #define REBAR_NO_CHILD_HEIGHT 4 -/* minimium vertical height of a normal bar */ +/* minimum vertical height of a normal bar */ /* or minimum width of a CCS_VERT bar - from experiment on Win2k */ #define REBAR_MINSIZE 23 @@ -1005,7 +1005,7 @@ REBAR_MoveChildWindows (const REBAR_INFO *infoPtr, UINT start, UINT endplus) if (lpBand->hwndChild) { TRACE("hwndChild = %p\n", lpBand->hwndChild); - /* Always geterate the RBN_CHILDSIZE even it child + /* Always generate the RBN_CHILDSIZE even if child did not change */ rbcz.uBand = i; rbcz.wID = lpBand->wID; @@ -2142,7 +2142,7 @@ REBAR_GetRect (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) return FALSE; lpBand = &infoPtr->bands[iBand]; - /* For CCS_VERT the coordintes will be swapped - like on Windows */ + /* For CCS_VERT the coordinates will be swapped - like on Windows */ CopyRect (lprc, &lpBand->rcBand); TRACE("band %d, (%d,%d)-(%d,%d)\n", iBand, diff --git a/dlls/comctl32/status.c b/dlls/comctl32/status.c index 1b9e786ea1e..7ee11cbe759 100644 --- a/dlls/comctl32/status.c +++ b/dlls/comctl32/status.c @@ -31,7 +31,7 @@ * TODO: * -- CCS_BOTTOM (default) * -- CCS_LEFT - * -- CCS_NODEVIDER + * -- CCS_NODIVIDER * -- CCS_NOMOVEX * -- CCS_NOMOVEY * -- CCS_NOPARENTALIGN diff --git a/dlls/comctl32/tab.c b/dlls/comctl32/tab.c index 35973d01e39..92c92685cdd 100644 --- a/dlls/comctl32/tab.c +++ b/dlls/comctl32/tab.c @@ -2044,7 +2044,7 @@ static void TAB_DrawItem(const TAB_INFO *infoPtr, HDC hdc, INT iItem) { /* These are for adjusting the drawing of a Selected tab */ /* The initial values are for the normal case of non-Selected */ - int ZZ = 1; /* Do not strech if selected */ + int ZZ = 1; /* Do not stretch if selected */ if (iItem == infoPtr->iSelected) { ZZ = 0; diff --git a/dlls/comctl32/tests/dpa.c b/dlls/comctl32/tests/dpa.c index 3d7d2a71941..c718789a266 100644 --- a/dlls/comctl32/tests/dpa.c +++ b/dlls/comctl32/tests/dpa.c @@ -218,7 +218,7 @@ static void test_dpa(void) /* Set item with out of bound index */ ok(pDPA_SetPtr(dpa, 1, (PVOID)6), "\n"); - /* Fill the greated gap */ + /* Fill the created gap */ ok(pDPA_SetPtr(dpa, 0, (PVOID)5), "\n"); rc=CheckDPA(dpa, 0x56, &dw); ok(rc, "dw=0x%x\n", dw); diff --git a/dlls/comctl32/tests/header.c b/dlls/comctl32/tests/header.c index fa75d49046f..884d4d527ce 100644 --- a/dlls/comctl32/tests/header.c +++ b/dlls/comctl32/tests/header.c @@ -1156,7 +1156,7 @@ static void test_hdm_index_messages(HWND hParent) ok_sequence(sequences, HEADER_SEQ_INDEX, orderArray_seq, "set_get_orderArray sequence testing", FALSE); - /* check if the array order is set correctly and the size of the array is corret. */ + /* check if the array order is set correctly and the size of the array is correct. */ expect(2, iSize); expect(lpiarray[0], lpiarrayReceived[0]); expect(lpiarray[1], lpiarrayReceived[1]); diff --git a/dlls/comctl32/toolbar.c b/dlls/comctl32/toolbar.c index 21817b2f6bb..6ab6f3fd45d 100644 --- a/dlls/comctl32/toolbar.c +++ b/dlls/comctl32/toolbar.c @@ -880,7 +880,7 @@ TOOLBAR_DrawButton (HWND hwnd, TBUTTON_INFO *btnPtr, HDC hdc, DWORD dwBaseCustDr } /* copy text & bitmap rects after adjusting for drop-down arrow - * so that text & bitmap is centred in the rectangle not containing + * so that text & bitmap is centered in the rectangle not containing * the arrow */ CopyRect(&rcText, &rc); CopyRect(&rcBitmap, &rc); @@ -1769,7 +1769,7 @@ TOOLBAR_LayoutToolbar(HWND hwnd) else y += cy; - /* nSepRows is used to calculate the extra height follwoing */ + /* nSepRows is used to calculate the extra height following */ /* the last row. */ nSepRows++; } @@ -4967,7 +4967,7 @@ TOOLBAR_SetRows (HWND hwnd, WPARAM wParam, LPARAM lParam) rows (if CCS_NORESIZE is set), or will take up the whole window (if no CCS_NORESIZE). - Basic algorithum - If N buttons, and y rows requested, each row + Basic algorithm - If N buttons, and y rows requested, each row contains N/y buttons. FIXME: Handling of separators not obvious from testing results diff --git a/dlls/comctl32/tooltips.c b/dlls/comctl32/tooltips.c index f976ce900f0..7661ffab44f 100644 --- a/dlls/comctl32/tooltips.c +++ b/dlls/comctl32/tooltips.c @@ -752,7 +752,7 @@ TOOLTIPS_Show (HWND hwnd, TOOLTIPS_INFO *infoPtr, BOOL track_activate) * it is no longer needed */ } - SetWindowPos (hwnd, HWND_TOP, rect.left, rect.top, + SetWindowPos (hwnd, HWND_TOPMOST, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, SWP_SHOWWINDOW | SWP_NOACTIVATE); diff --git a/dlls/comctl32/trackbar.c b/dlls/comctl32/trackbar.c index 076313f67c4..bbb48c923fd 100644 --- a/dlls/comctl32/trackbar.c +++ b/dlls/comctl32/trackbar.c @@ -865,7 +865,7 @@ TRACKBAR_Refresh (TRACKBAR_INFO *infoPtr, HDC hdcDst) gcdrf = notify_customdraw(infoPtr, &nmcd, CDDS_PREPAINT); if (gcdrf & CDRF_SKIPDEFAULT) goto cleanup; - /* Erase backbround */ + /* Erase background */ if (gcdrf == CDRF_DODEFAULT || notify_customdraw(infoPtr, &nmcd, CDDS_PREERASE) != CDRF_SKIPDEFAULT) { if ((theme = GetWindowTheme (infoPtr->hwndSelf))) { diff --git a/dlls/comctl32/treeview.c b/dlls/comctl32/treeview.c index 280196980ea..6a8e0c244ef 100644 --- a/dlls/comctl32/treeview.c +++ b/dlls/comctl32/treeview.c @@ -2042,7 +2042,7 @@ TREEVIEW_GetItemRect(const TREEVIEW_INFO *infoPtr, BOOL fTextRect, LPRECT lpRect static inline LRESULT TREEVIEW_GetVisibleCount(const TREEVIEW_INFO *infoPtr) { - /* Suprise! This does not take integral height into account. */ + /* Surprise! This does not take integral height into account. */ return infoPtr->clientHeight / infoPtr->uItemHeight; } @@ -2138,7 +2138,7 @@ TREEVIEW_SetItemT(TREEVIEW_INFO *infoPtr, const TVITEMEXW *tvItem, BOOL isW) if (!TREEVIEW_ValidItem(infoPtr, wineItem)) return FALSE; - /* store the orignal item values */ + /* store the original item values */ originalItem = *wineItem; if (!TREEVIEW_DoSetItemT(infoPtr, wineItem, tvItem, isW)) @@ -3017,7 +3017,7 @@ TREEVIEW_Sort(TREEVIEW_INFO *infoPtr, BOOL fRecurse, HTREEITEM parent, item = (HTREEITEM)DPA_GetPtr(sortList, count++); while ((nextItem = (HTREEITEM)DPA_GetPtr(sortList, count++)) != NULL) { - /* link the two current item toghether */ + /* link the two current item together */ item->nextSibling = nextItem; nextItem->prevSibling = item; @@ -4367,7 +4367,7 @@ TREEVIEW_SelectItem(TREEVIEW_INFO *infoPtr, INT wParam, HTREEITEM item) * BUGS * * - The current implementation has a list of characters it will - * accept and it ignores averything else. In particular it will + * accept and it ignores everything else. In particular it will * ignore accentuated characters which seems to match what * Windows does. But I'm not sure it makes sense to follow * Windows there. @@ -4517,7 +4517,7 @@ TREEVIEW_EnsureVisible(TREEVIEW_INFO *infoPtr, HTREEITEM item, BOOL bHScroll) /* Expand parents as necessary. */ HTREEITEM parent; - /* see if we are trying to ensure that root is vislble */ + /* see if we are trying to ensure that root is visible */ if((item != infoPtr->root) && TREEVIEW_ValidItem(infoPtr, item)) parent = item->parent; else diff --git a/dlls/comctl32/updown.c b/dlls/comctl32/updown.c index c99507e241d..74a96f652dd 100644 --- a/dlls/comctl32/updown.c +++ b/dlls/comctl32/updown.c @@ -137,7 +137,7 @@ static BOOL UPDOWN_InBounds(const UPDOWN_INFO *infoPtr, int val) /*********************************************************************** * UPDOWN_OffsetVal * Change the current value by delta. - * It returns TRUE is the value was changed successfuly, or FALSE + * It returns TRUE is the value was changed successfully, or FALSE * if the value was not changed, as it would go out of bounds. */ static BOOL UPDOWN_OffsetVal(UPDOWN_INFO *infoPtr, int delta) @@ -174,7 +174,7 @@ static BOOL UPDOWN_HasBuddyBorder(const UPDOWN_INFO *infoPtr) * rect - will hold the rectangle * arrow - FLAG_INCR to get the "increment" rect (up or right) * FLAG_DECR to get the "decrement" rect (down or left) - * If both flags are pressent, the envelope is returned. + * If both flags are present, the envelope is returned. */ static void UPDOWN_GetArrowRect (const UPDOWN_INFO* infoPtr, RECT *rect, int arrow) { diff --git a/dlls/credui/credui.rc b/dlls/credui/credui.rc index 181e3b3e4ea..53f54a4f3e9 100644 --- a/dlls/credui/credui.rc +++ b/dlls/credui/credui.rc @@ -34,4 +34,5 @@ IDB_BANNER BITMAP LOADONCALL DISCARDABLE banner.bmp #include "credui_Ko.rc" #include "credui_No.rc" #include "credui_Pl.rc" +#include "credui_Ru.rc" #include "credui_Sv.rc" diff --git a/dlls/credui/credui_Ru.rc b/dlls/credui/credui_Ru.rc new file mode 100644 index 00000000000..341b5b6bf76 --- /dev/null +++ b/dlls/credui/credui_Ru.rc @@ -0,0 +1,50 @@ +/* + * Russian language resource file for Credentials UI + * + * Copyright 2008 Andrey Esin + * + * 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_RUSSIAN, SUBLANG_DEFAULT + +IDD_CREDDIALOG DIALOG DISCARDABLE 0, 0, 213, 149 +STYLE DS_MODALFRAME | DS_NOIDLEMSG | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "IDS_TITLEFORMAT" +FONT 8, "MS Shell Dlg" +BEGIN + CONTROL IDB_BANNER,IDC_STATIC,"Static",SS_BITMAP | SS_CENTERIMAGE,0, + 0,213,37 + LTEXT "IDS_MESSAGEFORMAT",IDC_MESSAGE,8,48,199,8,NOT WS_GROUP + LTEXT "Ïî&ëüçîâàòåëü:",IDC_STATIC,8,62,72,12,SS_CENTERIMAGE + CONTROL "",IDC_USERNAME,"ComboBoxEx32",CBS_DROPDOWN | + CBS_NOINTEGRALHEIGHT | WS_TABSTOP,80,62,126,87 + LTEXT "&Ïàðîëü:",IDC_STATIC,8,80,72,12,SS_CENTERIMAGE + EDITTEXT IDC_PASSWORD,80,80,126,12,ES_PASSWORD | ES_AUTOHSCROLL + CONTROL "Ñî&õðàíèòü ïàðîëü",IDC_SAVE,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,80,98,126,12 + DEFPUSHBUTTON "ÎÊ",IDOK,97,128,50,14 + PUSHBUTTON "Îòìåíà",IDCANCEL,156,128,50,14 +END + +STRINGTABLE DISCARDABLE +{ + IDS_TITLEFORMAT "Ïîäêëþ÷åíèå ê %s" + IDS_MESSAGEFORMAT "Ïîäêëþ÷åíèå ê %s" + IDS_INCORRECTPASSWORDTITLE "Âõîä íå áûë ïðîèçâåä¸í" + IDS_INCORRECTPASSWORD "Óáåäèòåñü, ÷òî èìÿ ïîëüçîâàòåëÿ\nè ïàðîëü âåðíû." + IDS_CAPSLOCKONTITLE "Caps Lock âêëþ÷åí" + IDS_CAPSLOCKON "Ïàðîëü ìîæåò áûòü ââåä¸í íåïðàâèëüíî èç-çà íàæàòîé êëàâèøè Caps Lock.\n\nÎòêëþ÷èòå Caps Lock ïåðåä òåì, êàê ââîäèòü ïàðîëü." +} diff --git a/dlls/credui/credui_main.c b/dlls/credui/credui_main.c index 43ab2d644e1..42316d6100a 100644 --- a/dlls/credui/credui_main.c +++ b/dlls/credui/credui_main.c @@ -462,6 +462,8 @@ static void CredDialogCommandOk(HWND hwndDlg, struct cred_dialog_params *params) GetDlgItemTextW(hwndDlg, IDC_PASSWORD, params->pszPassword, params->ulPasswordMaxChars); + params->fSave = IsDlgButtonChecked(hwndDlg, IDC_SAVE) == BST_CHECKED; + EndDialog(hwndDlg, IDOK); } @@ -631,11 +633,10 @@ DWORD WINAPI CredUIPromptForCredentialsW(PCREDUI_INFOW pUIInfo, if (!found) { entry = HeapAlloc(GetProcessHeap(), 0, sizeof(*entry)); - list_init(&entry->entry); len = strlenW(pszTargetName); entry->pszTargetName = HeapAlloc(GetProcessHeap(), 0, (len + 1)*sizeof(WCHAR)); memcpy(entry->pszTargetName, pszTargetName, (len + 1)*sizeof(WCHAR)); - list_add_tail(&entry->entry, &pending_credentials_list); + list_add_tail(&pending_credentials_list, &entry->entry); } len = strlenW(params.pszUsername); diff --git a/dlls/crypt32/tests/encode.c b/dlls/crypt32/tests/encode.c index 7616ec5e644..74595fc4e73 100644 --- a/dlls/crypt32/tests/encode.c +++ b/dlls/crypt32/tests/encode.c @@ -2389,7 +2389,7 @@ static void test_encodeSequenceOfAny(DWORD dwEncoding) BYTE *buf = NULL; DWORD bufSize = 0; - /* Encode a homogenous sequence */ + /* Encode a homogeneous sequence */ for (i = 0; i < sizeof(ints) / sizeof(ints[0]); i++) { blobs[i].cbData = ints[i].encoded[1] + 2; diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c index ef62f83834f..8ad5d63bf55 100644 --- a/dlls/d3d9/tests/device.c +++ b/dlls/d3d9/tests/device.c @@ -1504,7 +1504,7 @@ static void test_null_stream(void) HWND hwnd; HRESULT hr; IDirect3DVertexShader9 *shader = NULL; - IDirect3DVertexDeclaration9 *decl; + IDirect3DVertexDeclaration9 *decl = NULL; DWORD shader_code[] = { 0xfffe0101, /* vs_1_1 */ 0x0000001f, 0x80000000, 0x900f0000, /* dcl_position v0 */ @@ -1544,8 +1544,16 @@ static void test_null_stream(void) } hr = IDirect3DDevice9_CreateVertexDeclaration(device, decl_elements, &decl); ok(SUCCEEDED(hr), "IDirect3DDevice9_CreateVertexDeclaration failed (0x%08x)\n", hr); + if (!SUCCEEDED(hr)) { + skip("Vertex declaration handling not possible.\n"); + goto cleanup; + } hr = IDirect3DDevice9_CreateVertexBuffer(device, 12 * sizeof(float), 0, 0, D3DPOOL_MANAGED, &buffer, NULL); ok(SUCCEEDED(hr), "IDirect3DDevice9_CreateVertexBuffer failed (0x%08x)\n", hr); + if (!SUCCEEDED(hr)) { + skip("Vertex buffer handling not possible.\n"); + goto cleanup; + } hr = IDirect3DDevice9_SetStreamSource(device, 0, buffer, 0, sizeof(float) * 3); ok(SUCCEEDED(hr), "IDirect3DDevice9_SetStreamSource failed (0x%08x)\n", hr); @@ -1570,7 +1578,7 @@ static void test_null_stream(void) IDirect3DDevice9_SetVertexShader(device, NULL); IDirect3DDevice9_SetVertexDeclaration(device, NULL); - cleanup: +cleanup: if(decl) IDirect3DVertexDeclaration9_Release(decl); if(shader) IDirect3DVertexShader9_Release(shader); if(device) IDirect3DDevice9_Release(device); diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index 4cc07c8a881..d20d3372f60 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -260,10 +260,10 @@ static void lighting_test(IDirect3DDevice9 *device) ok(color == 0x00ff0000, "Unlit quad without normals has color %08x\n", color); color = getPixelColor(device, 160, 120); /* upper left quad - lit without normals */ ok(color == 0x00000000, "Lit quad without normals has color %08x\n", color); - color = getPixelColor(device, 480, 360); /* lower left quad - unlit width normals */ - ok(color == 0x000000ff, "Unlit quad width normals has color %08x\n", color); - color = getPixelColor(device, 480, 120); /* upper left quad - lit width normals */ - ok(color == 0x00000000, "Lit quad width normals has color %08x\n", color); + color = getPixelColor(device, 480, 360); /* lower left quad - unlit with normals */ + ok(color == 0x000000ff, "Unlit quad with normals has color %08x\n", color); + color = getPixelColor(device, 480, 120); /* upper left quad - lit with normals */ + ok(color == 0x00000000, "Lit quad with normals has color %08x\n", color); hr = IDirect3DDevice9_SetRenderState(device, D3DRS_LIGHTING, FALSE); ok(hr == D3D_OK, "IDirect3DDevice9_SetRenderState returned %s\n", DXGetErrorString9(hr)); diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c index a22d6113900..b60b6f3cc51 100644 --- a/dlls/ddraw/device.c +++ b/dlls/ddraw/device.c @@ -28,7 +28,6 @@ #include "config.h" #include "wine/port.h" -#include "wine/debug.h" #include #include @@ -36,6 +35,7 @@ #include #define COBJMACROS +#define NONAMELESSUNION #include "windef.h" #include "winbase.h" @@ -47,6 +47,7 @@ #include "d3d.h" #include "ddraw_private.h" +#include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(d3d7); WINE_DECLARE_DEBUG_CHANNEL(ddraw_thunk); @@ -2369,15 +2370,93 @@ Thunk_IDirect3DDeviceImpl_3_GetRenderState(IDirect3DDevice3 *iface, } static HRESULT WINAPI -Thunk_IDirect3DDeviceImpl_2_GetRenderState(IDirect3DDevice2 *iface, +IDirect3DDeviceImpl_2_GetRenderState(IDirect3DDevice2 *iface, D3DRENDERSTATETYPE dwRenderStateType, DWORD *lpdwRenderState) { ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice2, iface); - TRACE_(ddraw_thunk)("(%p)->(%08x,%p) thunking to IDirect3DDevice7 interface.\n", This, dwRenderStateType, lpdwRenderState); - return IDirect3DDevice7_GetRenderState(ICOM_INTERFACE(This, IDirect3DDevice7), + TRACE("(%p)->(%08x,%p): Relay\n", This, dwRenderStateType, lpdwRenderState); + + /* D3DRENDERSTATE_TEXTUREMAPBLEND is mapped to texture state stages in SetRenderState; reverse + the mapping to get the value; other states relayed to IDirect3DDevice7::GetRenderState */ + switch(dwRenderStateType) + { + case D3DRENDERSTATE_TEXTUREMAPBLEND: + { + DWORD colorop, colorarg1, colorarg2; + DWORD alphaop, alphaarg1, alphaarg2; + + EnterCriticalSection(&ddraw_cs); + + IWineD3DDevice_GetTextureStageState(This->wineD3DDevice, 0, WINED3DTSS_COLOROP, &colorop); + IWineD3DDevice_GetTextureStageState(This->wineD3DDevice, 0, WINED3DTSS_COLORARG1, &colorarg1); + IWineD3DDevice_GetTextureStageState(This->wineD3DDevice, 0, WINED3DTSS_COLORARG2, &colorarg2); + IWineD3DDevice_GetTextureStageState(This->wineD3DDevice, 0, WINED3DTSS_ALPHAOP, &alphaop); + IWineD3DDevice_GetTextureStageState(This->wineD3DDevice, 0, WINED3DTSS_ALPHAARG1, &alphaarg1); + IWineD3DDevice_GetTextureStageState(This->wineD3DDevice, 0, WINED3DTSS_ALPHAARG2, &alphaarg2); + + if (colorop == WINED3DTOP_SELECTARG1 && colorarg1 == WINED3DTA_TEXTURE && + alphaop == WINED3DTOP_SELECTARG1 && alphaarg1 == WINED3DTA_TEXTURE) + { + *lpdwRenderState = D3DTBLEND_DECAL; + } + else if (colorop == WINED3DTOP_SELECTARG1 && colorarg1 == WINED3DTA_TEXTURE && + alphaop == WINED3DTOP_MODULATE && alphaarg1 == WINED3DTA_TEXTURE && alphaarg2 == WINED3DTA_CURRENT) + { + *lpdwRenderState = D3DTBLEND_DECALALPHA; + } + else if (colorop == WINED3DTOP_MODULATE && colorarg1 == WINED3DTA_TEXTURE && colorarg2 == WINED3DTA_CURRENT && + alphaop == WINED3DTOP_MODULATE && alphaarg1 == WINED3DTA_TEXTURE && alphaarg2 == WINED3DTA_CURRENT) + { + *lpdwRenderState = D3DTBLEND_MODULATEALPHA; + } + else + { + HRESULT hr; + BOOL tex_alpha = FALSE; + IWineD3DBaseTexture *tex = NULL; + WINED3DSURFACE_DESC desc; + WINED3DFORMAT fmt; + DDPIXELFORMAT ddfmt; + + hr = IWineD3DDevice_GetTexture(This->wineD3DDevice, + 0, + &tex); + + if(hr == WINED3D_OK && tex) + { + memset(&desc, 0, sizeof(desc)); + desc.Format = &fmt; + hr = IWineD3DTexture_GetLevelDesc((IWineD3DTexture*) tex, 0, &desc); + if (SUCCEEDED(hr)) + { + ddfmt.dwSize = sizeof(ddfmt); + PixelFormat_WineD3DtoDD(&ddfmt, fmt); + if (ddfmt.u5.dwRGBAlphaBitMask) tex_alpha = TRUE; + } + + IWineD3DBaseTexture_Release(tex); + } + + if (!(colorop == WINED3DTOP_MODULATE && colorarg1 == WINED3DTA_TEXTURE && colorarg2 == WINED3DTA_CURRENT && + alphaop == WINED3DTOP_SELECTARG1 && alphaarg1 == (tex_alpha ? WINED3DTA_TEXTURE : WINED3DTA_CURRENT))) + { + ERR("Unexpected texture stage state setup, returning D3DTBLEND_MODULATE - likely erroneous\n"); + } + + *lpdwRenderState = D3DTBLEND_MODULATE; + } + + LeaveCriticalSection(&ddraw_cs); + + return D3D_OK; + } + + default: + return IDirect3DDevice7_GetRenderState(ICOM_INTERFACE(This, IDirect3DDevice7), dwRenderStateType, lpdwRenderState); + } } /***************************************************************************** @@ -2525,20 +2604,101 @@ IDirect3DDeviceImpl_7_SetRenderState(IDirect3DDevice7 *iface, Value); break; + default: + + /* FIXME: Unhandled: D3DRENDERSTATE_STIPPLEPATTERN00 - 31 */ + + hr = IWineD3DDevice_SetRenderState(This->wineD3DDevice, + RenderStateType, + Value); + break; + } + LeaveCriticalSection(&ddraw_cs); + return hr; +} + +static HRESULT WINAPI +Thunk_IDirect3DDeviceImpl_3_SetRenderState(IDirect3DDevice3 *iface, + D3DRENDERSTATETYPE RenderStateType, + DWORD Value) +{ + ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice3, iface); + TRACE_(ddraw_thunk)("(%p)->(%08x,%08x) thunking to IDirect3DDevice7 interface.\n", This, RenderStateType, Value); + return IDirect3DDevice7_SetRenderState(ICOM_INTERFACE(This, IDirect3DDevice7), + RenderStateType, + Value); +} + +static HRESULT WINAPI +IDirect3DDeviceImpl_2_SetRenderState(IDirect3DDevice2 *iface, + D3DRENDERSTATETYPE RenderStateType, + DWORD Value) +{ + /* Note about D3DRENDERSTATE_TEXTUREMAPBLEND implementation: most of values + for this state can be directly mapped to texture stage colorop and alphaop, but + D3DTBLEND_MODULATE is tricky: it uses alpha from texture when available and alpha + from diffuse otherwise. So changing the texture is monitored here to modify + alphaarg when needed. + + Other states are relayed to IDirect3DDevice7 + + Aliens vs Predator 1 depends on accurate D3DTBLEND_MODULATE emulation */ + + HRESULT hr; + ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice2, iface); + TRACE("(%p)->(%08x,%d): Relay\n", This, RenderStateType, Value); + + switch(RenderStateType) + { case D3DRENDERSTATE_TEXTUREMAPBLEND: { - /* Old texture combine setup style, superseded by texture stage states - * in D3D7. It is safe for us to wrap it to texture stage states. - */ + EnterCriticalSection(&ddraw_cs); + switch ( (D3DTEXTUREBLEND) Value) { case D3DTBLEND_MODULATE: + { + BOOL tex_alpha = FALSE; + IWineD3DBaseTexture *tex = NULL; + WINED3DSURFACE_DESC desc; + WINED3DFORMAT fmt; + DDPIXELFORMAT ddfmt; + + hr = IWineD3DDevice_GetTexture(This->wineD3DDevice, + 0, + &tex); + + if(hr == WINED3D_OK && tex) + { + memset(&desc, 0, sizeof(desc)); + desc.Format = &fmt; + hr = IWineD3DTexture_GetLevelDesc((IWineD3DTexture*) tex, 0, &desc); + if (SUCCEEDED(hr)) + { + ddfmt.dwSize = sizeof(ddfmt); + PixelFormat_WineD3DtoDD(&ddfmt, fmt); + if (ddfmt.u5.dwRGBAlphaBitMask) tex_alpha = TRUE; + } + + IWineD3DBaseTexture_Release(tex); + } + + IWineD3DDevice_SetTextureStageState(This->wineD3DDevice, 0, WINED3DTSS_ALPHAOP, WINED3DTOP_SELECTARG1); + if (tex_alpha) + { + IWineD3DDevice_SetTextureStageState(This->wineD3DDevice, 0, WINED3DTSS_ALPHAARG1, WINED3DTA_TEXTURE); + } + else + { + IWineD3DDevice_SetTextureStageState(This->wineD3DDevice, 0, WINED3DTSS_ALPHAARG1, WINED3DTA_CURRENT); + } + IWineD3DDevice_SetTextureStageState(This->wineD3DDevice, 0, WINED3DTSS_COLORARG1, WINED3DTA_TEXTURE); - IWineD3DDevice_SetTextureStageState(This->wineD3DDevice, 0, WINED3DTSS_ALPHAARG1, WINED3DTA_TEXTURE); IWineD3DDevice_SetTextureStageState(This->wineD3DDevice, 0, WINED3DTSS_COLORARG2, WINED3DTA_CURRENT); IWineD3DDevice_SetTextureStageState(This->wineD3DDevice, 0, WINED3DTSS_COLOROP, WINED3DTOP_MODULATE); - IWineD3DDevice_SetTextureStageState(This->wineD3DDevice, 0, WINED3DTSS_ALPHAOP, WINED3DTOP_SELECTARG1); + break; + } case D3DTBLEND_MODULATEALPHA: IWineD3DDevice_SetTextureStageState(This->wineD3DDevice, 0, WINED3DTSS_COLORARG1, WINED3DTA_TEXTURE); @@ -2566,46 +2726,77 @@ IDirect3DDeviceImpl_7_SetRenderState(IDirect3DDevice7 *iface, default: ERR("Unhandled texture environment %d !\n",Value); - } - hr = D3D_OK; + } + + LeaveCriticalSection(&ddraw_cs); + + hr = D3D_OK; break; } - default: + case D3DRENDERSTATE_TEXTUREHANDLE: + { + DWORD texmapblend; - /* FIXME: Unhandled: D3DRENDERSTATE_STIPPLEPATTERN00 - 31 */ + IDirect3DDevice2_GetRenderState(iface, D3DRENDERSTATE_TEXTUREMAPBLEND, &texmapblend); + + hr = IDirect3DDevice7_SetRenderState(ICOM_INTERFACE(This, IDirect3DDevice7), + D3DRENDERSTATE_TEXTUREHANDLE, + Value); + + if (texmapblend == D3DTBLEND_MODULATE) + { + BOOL tex_alpha = FALSE; + IWineD3DBaseTexture *tex = NULL; + WINED3DSURFACE_DESC desc; + WINED3DFORMAT fmt; + DDPIXELFORMAT ddfmt; + + EnterCriticalSection(&ddraw_cs); + + hr = IWineD3DDevice_GetTexture(This->wineD3DDevice, + 0, + &tex); + + if(hr == WINED3D_OK && tex) + { + memset(&desc, 0, sizeof(desc)); + desc.Format = &fmt; + hr = IWineD3DTexture_GetLevelDesc((IWineD3DTexture*) tex, 0, &desc); + if (SUCCEEDED(hr)) + { + ddfmt.dwSize = sizeof(ddfmt); + PixelFormat_WineD3DtoDD(&ddfmt, fmt); + if (ddfmt.u5.dwRGBAlphaBitMask) tex_alpha = TRUE; + } + + IWineD3DBaseTexture_Release(tex); + } + + /* alphaop is WINED3DTOP_SELECTARG1 if it's D3DTBLEND_MODULATE, so only modify alphaarg1 */ + if (tex_alpha) + { + IWineD3DDevice_SetTextureStageState(This->wineD3DDevice, 0, WINED3DTSS_ALPHAARG1, WINED3DTA_TEXTURE); + } + else + { + IWineD3DDevice_SetTextureStageState(This->wineD3DDevice, 0, WINED3DTSS_ALPHAARG1, WINED3DTA_CURRENT); + } + + LeaveCriticalSection(&ddraw_cs); + } - hr = IWineD3DDevice_SetRenderState(This->wineD3DDevice, - RenderStateType, - Value); break; - } - LeaveCriticalSection(&ddraw_cs); - return hr; -} + } -static HRESULT WINAPI -Thunk_IDirect3DDeviceImpl_3_SetRenderState(IDirect3DDevice3 *iface, - D3DRENDERSTATETYPE RenderStateType, - DWORD Value) -{ - ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice3, iface); - TRACE_(ddraw_thunk)("(%p)->(%08x,%08x) thunking to IDirect3DDevice7 interface.\n", This, RenderStateType, Value); - return IDirect3DDevice7_SetRenderState(ICOM_INTERFACE(This, IDirect3DDevice7), + default: + hr = IDirect3DDevice7_SetRenderState(ICOM_INTERFACE(This, IDirect3DDevice7), RenderStateType, Value); -} + break; + } -static HRESULT WINAPI -Thunk_IDirect3DDeviceImpl_2_SetRenderState(IDirect3DDevice2 *iface, - D3DRENDERSTATETYPE RenderStateType, - DWORD Value) -{ - ICOM_THIS_FROM(IDirect3DDeviceImpl, IDirect3DDevice2, iface); - TRACE_(ddraw_thunk)("(%p)->(%08x,%08x) thunking to IDirect3DDevice7 interface.\n", This, RenderStateType, Value); - return IDirect3DDevice7_SetRenderState(ICOM_INTERFACE(This, IDirect3DDevice7), - RenderStateType, - Value); + return hr; } /***************************************************************************** @@ -5441,8 +5632,8 @@ const IDirect3DDevice2Vtbl IDirect3DDevice2_Vtbl = Thunk_IDirect3DDeviceImpl_2_Vertex, Thunk_IDirect3DDeviceImpl_2_Index, Thunk_IDirect3DDeviceImpl_2_End, - Thunk_IDirect3DDeviceImpl_2_GetRenderState, - Thunk_IDirect3DDeviceImpl_2_SetRenderState, + IDirect3DDeviceImpl_2_GetRenderState, + IDirect3DDeviceImpl_2_SetRenderState, Thunk_IDirect3DDeviceImpl_2_GetLightState, Thunk_IDirect3DDeviceImpl_2_SetLightState, Thunk_IDirect3DDeviceImpl_2_SetTransform, diff --git a/dlls/ddraw/executebuffer.c b/dlls/ddraw/executebuffer.c index e74bdb164ca..49b6d6c12e4 100644 --- a/dlls/ddraw/executebuffer.c +++ b/dlls/ddraw/executebuffer.c @@ -317,7 +317,7 @@ IDirect3DExecuteBufferImpl_Execute(IDirect3DExecuteBufferImpl *This, for (i = 0; i < count; i++) { LPD3DSTATE ci = (LPD3DSTATE) instr; - IDirect3DDevice7_SetRenderState(ICOM_INTERFACE(lpDevice, IDirect3DDevice7), + IDirect3DDevice2_SetRenderState(ICOM_INTERFACE(lpDevice, IDirect3DDevice2), ci->u1.drstRenderStateType, ci->u2.dwArg[0]); instr += size; diff --git a/dlls/ddraw/regsvr.c b/dlls/ddraw/regsvr.c index 0a1f7a76a6a..eea2985038f 100644 --- a/dlls/ddraw/regsvr.c +++ b/dlls/ddraw/regsvr.c @@ -386,6 +386,12 @@ static struct regsvr_coclass const coclass_list[] = { "ddraw.dll", "Both" }, + { &CLSID_DirectDraw7, + "DirectDraw 7 Object", + NULL, + "ddraw.dll", + "Both" + }, { &CLSID_DirectDrawClipper, "DirectDraw Clipper Object", NULL, diff --git a/dlls/ddraw/tests/d3d.c b/dlls/ddraw/tests/d3d.c index 2699ba90128..d92f36be92d 100644 --- a/dlls/ddraw/tests/d3d.c +++ b/dlls/ddraw/tests/d3d.c @@ -1055,7 +1055,7 @@ static void Direct3D1Test(void) } for(i = 0; i < sizeof(outH); i++) { if(((unsigned char *) outH)[i] != 0xaa) { - ok(FALSE, "Homogenous output was generated despite UNCLIPPED flag\n"); + ok(FALSE, "Homogeneous output was generated despite UNCLIPPED flag\n"); break; } } diff --git a/dlls/ddraw/tests/visual.c b/dlls/ddraw/tests/visual.c index ce6ce9b04e1..eed9bdfa228 100644 --- a/dlls/ddraw/tests/visual.c +++ b/dlls/ddraw/tests/visual.c @@ -29,6 +29,13 @@ IDirectDrawSurface7 *Surface; IDirect3D7 *Direct3D = NULL; IDirect3DDevice7 *Direct3DDevice = NULL; +IDirectDraw *DirectDraw1 = NULL; +IDirectDrawSurface *Surface1 = NULL; +IDirect3D *Direct3D1 = NULL; +IDirect3DDevice *Direct3DDevice1 = NULL; +IDirect3DExecuteBuffer *ExecuteBuffer = NULL; +IDirect3DViewport *Viewport = NULL; + static HRESULT (WINAPI *pDirectDrawCreateEx)(LPGUID,LPVOID*,REFIID,LPUNKNOWN); static BOOL createObjects(void) @@ -801,6 +808,769 @@ static void rhw_zero_test(IDirect3DDevice7 *device) ok(color == 0, "Got color %08x, expected 00000000\n", color); } +static BOOL D3D1_createObjects(void) +{ + WNDCLASS wc = {0}; + HRESULT hr; + DDSURFACEDESC ddsd; + D3DEXECUTEBUFFERDESC exdesc; + D3DVIEWPORT vp_data; + + /* An IDirect3DDevice cannot be queryInterfaced from an IDirect3DDevice7 on windows */ + hr = DirectDrawCreate(NULL, &DirectDraw1, NULL); + + ok(hr==DD_OK || hr==DDERR_NODIRECTDRAWSUPPORT, "DirectDrawCreate returned: %x\n", hr); + if (FAILED(hr)) { + return FALSE; + } + + wc.lpfnWndProc = &DefWindowProc; + wc.lpszClassName = "texturemapblend_test_wc"; + RegisterClass(&wc); + window = CreateWindow("texturemapblend_test_wc", "texturemapblend_test", WS_MAXIMIZE | WS_VISIBLE | WS_CAPTION , 0, 0, 640, 480, 0, 0, 0, 0); + + hr = IDirectDraw_SetCooperativeLevel(DirectDraw1, window, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); + ok(hr==DD_OK, "SetCooperativeLevel returned: %x\n", hr); + if(FAILED(hr)) { + return FALSE; + } + + hr = IDirectDraw_SetDisplayMode(DirectDraw1, 640, 480, 32); + if(FAILED(hr)) { + /* 24 bit is fine too */ + hr = IDirectDraw_SetDisplayMode(DirectDraw1, 640, 480, 24); + } + ok(hr==DD_OK || hr == DDERR_UNSUPPORTED, "SetDisplayMode returned: %x\n", hr); + if (FAILED(hr)) { + return FALSE; + } + + hr = IDirectDraw_QueryInterface(DirectDraw1, &IID_IDirect3D, (void**) &Direct3D1); + ok(hr==DD_OK, "QueryInterface returned: %x\n", hr); + if (FAILED(hr)) { + return FALSE; + } + + memset(&ddsd, 0, sizeof(ddsd)); + ddsd.dwSize = sizeof(ddsd); + ddsd.dwFlags = DDSD_CAPS; + ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_3DDEVICE; + hr = IDirectDraw_CreateSurface(DirectDraw1, &ddsd, &Surface1, NULL); + ok(hr==DD_OK, "CreateSurface returned: %x\n", hr); + if (FAILED(hr)) { + return FALSE; + } + + hr = IDirectDrawSurface_QueryInterface(Surface1, &IID_IDirect3DHALDevice, (void **) &Direct3DDevice1); + if(FAILED(hr)) { + trace("Creating a HAL device failed, trying Ref\n"); + hr = IDirectDrawSurface_QueryInterface(Surface1, &IID_IDirect3DRefDevice, (void **) &Direct3DDevice1); + } + ok(hr==D3D_OK, "Creating 3D device returned: %x\n", hr); + if(FAILED(hr)) { + return FALSE; + } + + hr = IDirect3D_CreateViewport(Direct3D1, &Viewport, NULL); + ok(hr == D3D_OK, "IDirect3D_CreateViewport failed: %08x\n", hr); + if (FAILED(hr)) { + return FALSE; + } + + hr = IDirect3DViewport_Initialize(Viewport, Direct3D1); + ok(hr == D3D_OK || hr == DDERR_ALREADYINITIALIZED, "IDirect3DViewport_Initialize returned %08x\n", hr); + hr = IDirect3DDevice_AddViewport(Direct3DDevice1, Viewport); + ok(hr == D3D_OK, "IDirect3DDevice_AddViewport returned %08x\n", hr); + vp_data.dwSize = sizeof(vp_data); + vp_data.dwX = 0; + vp_data.dwY = 0; + vp_data.dwWidth = 640; + vp_data.dwHeight = 480; + vp_data.dvScaleX = 1; + vp_data.dvScaleY = 1; + vp_data.dvMaxX = 640; + vp_data.dvMaxY = 480; + vp_data.dvMinZ = 0; + vp_data.dvMaxZ = 1; + hr = IDirect3DViewport_SetViewport(Viewport, &vp_data); + ok(hr == D3D_OK, "IDirect3DViewport_SetViewport returned %08x\n", hr); + + memset(&exdesc, 0, sizeof(D3DEXECUTEBUFFERDESC)); + exdesc.dwSize = sizeof(D3DEXECUTEBUFFERDESC); + exdesc.dwFlags = D3DDEB_BUFSIZE | D3DDEB_CAPS; + exdesc.dwBufferSize = 512; + exdesc.dwCaps = D3DDEBCAPS_SYSTEMMEMORY; + hr = IDirect3DDevice_CreateExecuteBuffer(Direct3DDevice1, &exdesc, &ExecuteBuffer, NULL); + ok(hr == D3D_OK, "IDirect3DDevice_CreateExecuteBuffer failed with %08x\n", hr); + if (FAILED(hr)) { + return FALSE; + } + + return TRUE; +} + +static void D3D1_releaseObjects(void) +{ + if(ExecuteBuffer) IDirect3DExecuteBuffer_Release(ExecuteBuffer); + if(Surface1) IDirectDrawSurface_Release(Surface1); + if(Viewport) IDirect3DViewport_Release(Viewport); + if(Direct3DDevice1) IDirect3DDevice_Release(Direct3DDevice1); + if(Direct3D1) IDirect3D_Release(Direct3D1); + if(DirectDraw1) IDirectDraw_Release(DirectDraw1); + if(window) DestroyWindow(window); +} + +static DWORD D3D1_getPixelColor(IDirectDraw *DirectDraw1, IDirectDrawSurface *Surface, UINT x, UINT y) +{ + DWORD ret; + HRESULT hr; + DDSURFACEDESC ddsd; + RECT rectToLock = {x, y, x+1, y+1}; + IDirectDrawSurface *surf = NULL; + + /* Some implementations seem to dislike direct locking on the front buffer. Thus copy the front buffer + * to an offscreen surface and lock it instead of the front buffer + */ + memset(&ddsd, 0, sizeof(ddsd)); + ddsd.dwSize = sizeof(ddsd); + ddsd.ddpfPixelFormat.dwSize = sizeof(ddsd.ddpfPixelFormat); + ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS; + ddsd.dwWidth = 640; + ddsd.dwHeight = 480; + ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY; + hr = IDirectDraw_CreateSurface(DirectDraw1, &ddsd, &surf, NULL); + ok(hr == DD_OK, "IDirectDraw_CreateSurface failed with %08x\n", hr); + if(!surf) + { + trace("cannot create helper surface\n"); + return 0xdeadbeef; + } + + memset(&ddsd, 0, sizeof(ddsd)); + ddsd.dwSize = sizeof(ddsd); + ddsd.ddpfPixelFormat.dwSize = sizeof(ddsd.ddpfPixelFormat); + + hr = IDirectDrawSurface_BltFast(surf, 0, 0, Surface, NULL, 0); + ok(hr == DD_OK, "IDirectDrawSurface_BltFast returned %08x\n", hr); + if(FAILED(hr)) + { + trace("Cannot blit\n"); + ret = 0xdeadbee; + goto out; + } + + hr = IDirectDrawSurface_Lock(surf, &rectToLock, &ddsd, DDLOCK_READONLY | DDLOCK_WAIT, NULL); + if(FAILED(hr)) + { + trace("Can't lock the offscreen surface, hr=%08x\n", hr); + ret = 0xdeadbeec; + goto out; + } + + /* Remove the X channel for now. DirectX and OpenGL have different ideas how to treat it apparently, and it isn't + * really important for these tests + */ + ret = ((DWORD *) ddsd.lpSurface)[0] & 0x00ffffff; + hr = IDirectDrawSurface_Unlock(surf, &rectToLock); + if(FAILED(hr)) + { + trace("Can't unlock the offscreen surface, hr=%08x\n", hr); + } + +out: + IDirectDrawSurface_Release(surf); + return ret; +} + +#define EXEBUF_START_RENDER_STATES(count, ptr) do {\ + ((D3DINSTRUCTION*)(ptr))->bOpcode = D3DOP_STATERENDER;\ + ((D3DINSTRUCTION*)(ptr))->bSize = sizeof(D3DSTATE);\ + ((D3DINSTRUCTION*)(ptr))->wCount = count;\ + ptr = ((D3DINSTRUCTION*)(ptr))+1; } while (0) + +#define EXEBUF_PUT_RENDER_STATE(state, value, ptr) do {\ + ((D3DSTATE*)(ptr))->drstRenderStateType = state;\ + ((D3DSTATE*)(ptr))->dwArg[0] = value;\ + ptr = ((D3DSTATE*)(ptr))+1; } while (0) + +#define EXEBUF_PUT_PROCESSVERTICES(nvertices, ptr) do {\ + ((D3DINSTRUCTION*)(ptr))->bOpcode = D3DOP_PROCESSVERTICES;\ + ((D3DINSTRUCTION*)(ptr))->bSize = sizeof(D3DPROCESSVERTICES);\ + ((D3DINSTRUCTION*)(ptr))->wCount = 1;\ + ptr = ((D3DINSTRUCTION*)(ptr))+1;\ + ((D3DPROCESSVERTICES*)(ptr))->dwFlags = D3DPROCESSVERTICES_COPY;\ + ((D3DPROCESSVERTICES*)(ptr))->wStart = 0;\ + ((D3DPROCESSVERTICES*)(ptr))->wDest = 0;\ + ((D3DPROCESSVERTICES*)(ptr))->dwCount = nvertices;\ + ((D3DPROCESSVERTICES*)(ptr))->dwReserved = 0;\ + ptr = ((D3DPROCESSVERTICES*)(ptr))+1; } while (0) + +#define EXEBUF_END(ptr) do {\ + ((D3DINSTRUCTION*)(ptr))->bOpcode = D3DOP_EXIT;\ + ((D3DINSTRUCTION*)(ptr))->bSize = 0;\ + ((D3DINSTRUCTION*)(ptr))->wCount = 0;\ + ptr = ((D3DINSTRUCTION*)(ptr))+1; } while (0) + +#define EXEBUF_PUT_QUAD(base_idx, ptr) do {\ + ((D3DINSTRUCTION*)(ptr))->bOpcode = D3DOP_TRIANGLE;\ + ((D3DINSTRUCTION*)(ptr))->bSize = sizeof(D3DTRIANGLE);\ + ((D3DINSTRUCTION*)(ptr))->wCount = 2;\ + ptr = ((D3DINSTRUCTION*)(ptr))+1;\ + ((D3DTRIANGLE*)(ptr))->v1 = base_idx;\ + ((D3DTRIANGLE*)(ptr))->v2 = (base_idx) + 1;\ + ((D3DTRIANGLE*)(ptr))->v3 = (base_idx) + 3;\ + ((D3DTRIANGLE*)(ptr))->wFlags = 0;\ + ptr = ((D3DTRIANGLE*)ptr)+1;\ + ((D3DTRIANGLE*)(ptr))->v1 = (base_idx) + 1;\ + ((D3DTRIANGLE*)(ptr))->v2 = (base_idx) + 2;\ + ((D3DTRIANGLE*)(ptr))->v3 = (base_idx) + 3;\ + ((D3DTRIANGLE*)(ptr))->wFlags = 0;\ + ptr = ((D3DTRIANGLE*)(ptr))+1;\ + } while (0) + +static void D3D1_TextureMapBlendTest(void) +{ + HRESULT hr; + DDSURFACEDESC ddsd; + D3DEXECUTEBUFFERDESC exdesc; + D3DEXECUTEDATA exdata; + DDBLTFX ddbltfx; + RECT rect = { 0, 0, 64, 128 }; + DWORD color, red, blue, green; + void *exe_buffer_ptr; + DWORD exe_length; + D3DTEXTUREHANDLE htex; + DDCOLORKEY clrKey; + IDirectDrawSurface *TexSurface = NULL; + IDirect3DTexture *Texture = NULL; + + struct { + float x, y, z; + float rhw; + DWORD diffuse; + DWORD specular; + float tu, tv; + } test1_quads[] = + { + {0.0f, 0.0f, 0.0f, 1.0f, 0xffffffff, 0, 0.0f, 0.0f}, + {640.0f, 0.0f, 0.0f, 1.0f, 0xffffffff, 0, 1.0f, 0.0f}, + {640.0f, 240.0f, 0.0f, 1.0f, 0xffffffff, 0, 1.0f, 1.0f}, + {0.0f, 240.0f, 0.0f, 1.0f, 0xffffffff, 0, 0.0f, 1.0f}, + {0.0f, 240.0f, 0.0f, 1.0f, 0x80ffffff, 0, 0.0f, 0.0f}, + {640.0f, 240.0f, 0.0f, 1.0f, 0x80ffffff, 0, 1.0f, 0.0f}, + {640.0f, 480.0f, 0.0f, 1.0f, 0x80ffffff, 0, 1.0f, 1.0f}, + {0.0f, 480.0f, 0.0f, 1.0f, 0x80ffffff, 0, 0.0f, 1.0f} + }, test2_quads[] = + { + {0.0f, 0.0f, 0.0f, 1.0f, 0x00ff0080, 0, 0.0f, 0.0f}, + {640.0f, 0.0f, 0.0f, 1.0f, 0x00ff0080, 0, 1.0f, 0.0f}, + {640.0f, 240.0f, 0.0f, 1.0f, 0x00ff0080, 0, 1.0f, 1.0f}, + {0.0f, 240.0f, 0.0f, 1.0f, 0x00ff0080, 0, 0.0f, 1.0f}, + {0.0f, 240.0f, 0.0f, 1.0f, 0x008000ff, 0, 0.0f, 0.0f}, + {640.0f, 240.0f, 0.0f, 1.0f, 0x008000ff, 0, 1.0f, 0.0f}, + {640.0f, 480.0f, 0.0f, 1.0f, 0x008000ff, 0, 1.0f, 1.0f}, + {0.0f, 480.0f, 0.0f, 1.0f, 0x008000ff, 0, 0.0f, 1.0f} + }; + + /* 1) Test alpha with DDPF_ALPHAPIXELS texture - should be be taken from texture alpha channel*/ + memset (&ddsd, 0, sizeof (ddsd)); + ddsd.dwSize = sizeof (ddsd); + ddsd.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_PIXELFORMAT; + ddsd.dwHeight = 128; + ddsd.dwWidth = 128; + ddsd.ddsCaps.dwCaps = DDSCAPS_TEXTURE; + ddsd.ddpfPixelFormat.dwSize = sizeof(ddsd.ddpfPixelFormat); + ddsd.ddpfPixelFormat.dwFlags = DDPF_RGB | DDPF_ALPHAPIXELS; + U1(ddsd.ddpfPixelFormat).dwRGBBitCount = 32; + U2(ddsd.ddpfPixelFormat).dwRBitMask = 0x00ff0000; + U3(ddsd.ddpfPixelFormat).dwGBitMask = 0x0000ff00; + U4(ddsd.ddpfPixelFormat).dwBBitMask = 0x000000ff; + U5(ddsd.ddpfPixelFormat).dwRGBAlphaBitMask = 0xff000000; + hr = IDirectDraw_CreateSurface(DirectDraw1, &ddsd, &TexSurface, NULL); + ok(hr==D3D_OK, "CreateSurface returned: %x\n", hr); + if (FAILED(hr)) { + skip("IDirectDraw_CreateSurface failed; skipping further tests\n"); + goto out; + } + + hr = IDirectDrawSurface_QueryInterface(TexSurface, &IID_IDirect3DTexture, + (void *)&Texture); + ok(hr==D3D_OK, "IDirectDrawSurface_QueryInterface returned: %x\n", hr); + if (FAILED(hr)) { + skip("Can't get IDirect3DTexture interface; skipping further tests\n"); + goto out; + } + + memset(&ddbltfx, 0, sizeof(ddbltfx)); + ddbltfx.dwSize = sizeof(ddbltfx); + ddbltfx.dwFillColor = 0; + hr = IDirectDrawSurface_Blt(Surface1, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &ddbltfx); + ok(hr == D3D_OK, "IDirectDrawSurface_Blt failed with %08x\n", hr); + + ddbltfx.dwFillColor = 0xff0000ff; + hr = IDirectDrawSurface_Blt(TexSurface, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &ddbltfx); + ok(hr == D3D_OK, "IDirectDrawSurface_Blt failed with %08x\n", hr); + ddbltfx.dwFillColor = 0x800000ff; + hr = IDirectDrawSurface_Blt(TexSurface, &rect, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &ddbltfx); + ok(hr == D3D_OK, "IDirectDrawSurface_Blt failed with %08x\n", hr); + + memset(&exdesc, 0, sizeof(D3DEXECUTEBUFFERDESC)); + exdesc.dwSize = sizeof(D3DEXECUTEBUFFERDESC); + hr = IDirect3DExecuteBuffer_Lock(ExecuteBuffer, &exdesc); + ok(hr == D3D_OK, "IDirect3DExecuteBuffer_Lock failed with %08x\n", hr); + if (FAILED(hr)) { + skip("IDirect3DExecuteBuffer_Lock failed; skipping further tests\n"); + goto out; + } + + memcpy(exdesc.lpData, test1_quads, sizeof(test1_quads)); + + exe_buffer_ptr = 256 + (char*)exdesc.lpData; + + EXEBUF_PUT_PROCESSVERTICES(8, exe_buffer_ptr); + + EXEBUF_START_RENDER_STATES(12, exe_buffer_ptr); + EXEBUF_PUT_RENDER_STATE(D3DRENDERSTATE_CULLMODE, D3DCULL_NONE, exe_buffer_ptr); + EXEBUF_PUT_RENDER_STATE(D3DRENDERSTATE_ZENABLE, FALSE, exe_buffer_ptr); + EXEBUF_PUT_RENDER_STATE(D3DRENDERSTATE_FOGENABLE, FALSE, exe_buffer_ptr); + EXEBUF_PUT_RENDER_STATE(D3DRENDERSTATE_SPECULARENABLE, FALSE, exe_buffer_ptr); + EXEBUF_PUT_RENDER_STATE(D3DRENDERSTATE_TEXTUREMAG, D3DFILTER_NEAREST, exe_buffer_ptr); + EXEBUF_PUT_RENDER_STATE(D3DRENDERSTATE_TEXTUREMIN, D3DFILTER_NEAREST, exe_buffer_ptr); + EXEBUF_PUT_RENDER_STATE(D3DRENDERSTATE_FILLMODE , D3DFILL_SOLID, exe_buffer_ptr); + EXEBUF_PUT_RENDER_STATE(D3DRENDERSTATE_SRCBLEND, D3DBLEND_SRCALPHA, exe_buffer_ptr); + EXEBUF_PUT_RENDER_STATE(D3DRENDERSTATE_DESTBLEND, D3DBLEND_INVSRCALPHA, exe_buffer_ptr); + EXEBUF_PUT_RENDER_STATE(D3DRENDERSTATE_ALPHABLENDENABLE, TRUE, exe_buffer_ptr); + EXEBUF_PUT_RENDER_STATE(D3DRENDERSTATE_TEXTUREMAPBLEND, D3DTBLEND_MODULATE, exe_buffer_ptr); + hr = IDirect3DTexture_GetHandle(Texture, Direct3DDevice1, &htex); + ok(hr == D3D_OK, "IDirect3DTexture_GetHandle failed with %08x\n", hr); + EXEBUF_PUT_RENDER_STATE(D3DRENDERSTATE_TEXTUREHANDLE, htex, exe_buffer_ptr); + + EXEBUF_PUT_QUAD(0, exe_buffer_ptr); + EXEBUF_PUT_QUAD(4, exe_buffer_ptr); + + EXEBUF_END(exe_buffer_ptr); + + exe_length = ((char*)exe_buffer_ptr - (char*)exdesc.lpData) - 256; + + hr = IDirect3DExecuteBuffer_Unlock(ExecuteBuffer); + if (FAILED(hr)) { + trace("IDirect3DExecuteBuffer_Unlock failed with %08x\n", hr); + } + + memset(&exdata, 0, sizeof(D3DEXECUTEDATA)); + exdata.dwSize = sizeof(D3DEXECUTEDATA); + exdata.dwVertexCount = 8; + exdata.dwInstructionOffset = 256; + exdata.dwInstructionLength = exe_length; + hr = IDirect3DExecuteBuffer_SetExecuteData(ExecuteBuffer, &exdata); + ok(hr == D3D_OK, "IDirect3DExecuteBuffer_SetExecuteData failed with %08x\n", hr); + + hr = IDirect3DDevice_BeginScene(Direct3DDevice1); + ok(hr == D3D_OK, "IDirect3DDevice3_BeginScene failed with %08x\n", hr); + + if (SUCCEEDED(hr)) { + hr = IDirect3DDevice_Execute(Direct3DDevice1, ExecuteBuffer, Viewport, D3DEXECUTE_UNCLIPPED); + ok(hr == D3D_OK, "IDirect3DDevice_Execute failed, hr = %08x\n", hr); + hr = IDirect3DDevice_EndScene(Direct3DDevice1); + ok(hr == D3D_OK, "IDirect3DDevice3_EndScene failed, hr = %08x\n", hr); + } + + color = D3D1_getPixelColor(DirectDraw1, Surface1, 5, 5); + red = (color & 0x00ff0000) >> 16; + green = (color & 0x0000ff00) >> 8; + blue = (color & 0x000000ff); + ok(red == 0 && green == 0 && blue >= 0x7e && blue <= 0x82, "Got color %08x, expected 00000080 or near\n", color); + + color = D3D1_getPixelColor(DirectDraw1, Surface1, 400, 5); + red = (color & 0x00ff0000) >> 16; + green = (color & 0x0000ff00) >> 8; + blue = (color & 0x000000ff); + ok(red == 0 && green == 0 && blue == 0xff, "Got color %08x, expected 000000ff or near\n", color); + + color = D3D1_getPixelColor(DirectDraw1, Surface1, 5, 245); + red = (color & 0x00ff0000) >> 16; + green = (color & 0x0000ff00) >> 8; + blue = (color & 0x000000ff); + ok(red == 0 && green == 0 && blue >= 0x7e && blue <= 0x82, "Got color %08x, expected 00000080 or near\n", color); + + color = D3D1_getPixelColor(DirectDraw1, Surface1, 400, 245); + red = (color & 0x00ff0000) >> 16; + green = (color & 0x0000ff00) >> 8; + blue = (color & 0x000000ff); + ok(red == 0 && green == 0 && blue == 0xff, "Got color %08x, expected 000000ff or near\n", color); + + /* 2) Test alpha with texture that has no alpha channel - alpha should be be taken from diffuse color */ + if(Texture) IDirect3DTexture_Release(Texture); + Texture = NULL; + if(TexSurface) IDirectDrawSurface_Release(TexSurface); + TexSurface = NULL; + + memset (&ddsd, 0, sizeof (ddsd)); + ddsd.dwSize = sizeof (ddsd); + ddsd.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_PIXELFORMAT; + ddsd.dwHeight = 128; + ddsd.dwWidth = 128; + ddsd.ddsCaps.dwCaps = DDSCAPS_TEXTURE; + ddsd.ddpfPixelFormat.dwSize = sizeof(ddsd.ddpfPixelFormat); + ddsd.ddpfPixelFormat.dwFlags = DDPF_RGB; + U1(ddsd.ddpfPixelFormat).dwRGBBitCount = 32; + U2(ddsd.ddpfPixelFormat).dwRBitMask = 0x00ff0000; + U3(ddsd.ddpfPixelFormat).dwGBitMask = 0x0000ff00; + U4(ddsd.ddpfPixelFormat).dwBBitMask = 0x000000ff; + + hr = IDirectDraw_CreateSurface(DirectDraw1, &ddsd, &TexSurface, NULL); + ok(hr==D3D_OK, "CreateSurface returned: %x\n", hr); + if (FAILED(hr)) { + skip("IDirectDraw_CreateSurface failed; skipping further tests\n"); + goto out; + } + + hr = IDirectDrawSurface_QueryInterface(TexSurface, &IID_IDirect3DTexture, + (void *)&Texture); + ok(hr==D3D_OK, "IDirectDrawSurface_QueryInterface returned: %x\n", hr); + if (FAILED(hr)) { + skip("Can't get IDirect3DTexture interface; skipping further tests\n"); + goto out; + } + + memset(&ddbltfx, 0, sizeof(ddbltfx)); + ddbltfx.dwSize = sizeof(ddbltfx); + ddbltfx.dwFillColor = 0; + hr = IDirectDrawSurface_Blt(Surface1, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &ddbltfx); + ok(hr == D3D_OK, "IDirectDrawSurface_Blt failed with %08x\n", hr); + + ddbltfx.dwFillColor = 0xff0000ff; + hr = IDirectDrawSurface_Blt(TexSurface, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &ddbltfx); + ok(hr == D3D_OK, "IDirectDrawSurface_Blt failed with %08x\n", hr); + ddbltfx.dwFillColor = 0x800000ff; + hr = IDirectDrawSurface_Blt(TexSurface, &rect, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &ddbltfx); + ok(hr == D3D_OK, "IDirectDrawSurface_Blt failed with %08x\n", hr); + + memset(&exdesc, 0, sizeof(D3DEXECUTEBUFFERDESC)); + exdesc.dwSize = sizeof(D3DEXECUTEBUFFERDESC); + hr = IDirect3DExecuteBuffer_Lock(ExecuteBuffer, &exdesc); + ok(hr == D3D_OK, "IDirect3DExecuteBuffer_Lock failed with %08x\n", hr); + if (FAILED(hr)) { + skip("IDirect3DExecuteBuffer_Lock failed; skipping further tests\n"); + goto out; + } + + memcpy(exdesc.lpData, test1_quads, sizeof(test1_quads)); + + exe_buffer_ptr = 256 + (char*)exdesc.lpData; + + EXEBUF_PUT_PROCESSVERTICES(8, exe_buffer_ptr); + + EXEBUF_START_RENDER_STATES(1, exe_buffer_ptr); + hr = IDirect3DTexture_GetHandle(Texture, Direct3DDevice1, &htex); + ok(hr == D3D_OK, "IDirect3DTexture_GetHandle failed with %08x\n", hr); + EXEBUF_PUT_RENDER_STATE(D3DRENDERSTATE_TEXTUREHANDLE, htex, exe_buffer_ptr); + + EXEBUF_PUT_QUAD(0, exe_buffer_ptr); + EXEBUF_PUT_QUAD(4, exe_buffer_ptr); + + EXEBUF_END(exe_buffer_ptr); + + exe_length = ((char*)exe_buffer_ptr - (char*)exdesc.lpData) - 256; + + hr = IDirect3DExecuteBuffer_Unlock(ExecuteBuffer); + if (FAILED(hr)) { + trace("IDirect3DExecuteBuffer_Unlock failed with %08x\n", hr); + } + + memset(&exdata, 0, sizeof(D3DEXECUTEDATA)); + exdata.dwSize = sizeof(D3DEXECUTEDATA); + exdata.dwVertexCount = 8; + exdata.dwInstructionOffset = 256; + exdata.dwInstructionLength = exe_length; + hr = IDirect3DExecuteBuffer_SetExecuteData(ExecuteBuffer, &exdata); + ok(hr == D3D_OK, "IDirect3DExecuteBuffer_SetExecuteData failed with %08x\n", hr); + + hr = IDirect3DDevice_BeginScene(Direct3DDevice1); + ok(hr == D3D_OK, "IDirect3DDevice3_BeginScene failed with %08x\n", hr); + + if (SUCCEEDED(hr)) { + hr = IDirect3DDevice_Execute(Direct3DDevice1, ExecuteBuffer, Viewport, D3DEXECUTE_UNCLIPPED); + ok(hr == D3D_OK, "IDirect3DDevice_Execute failed, hr = %08x\n", hr); + hr = IDirect3DDevice_EndScene(Direct3DDevice1); + ok(hr == D3D_OK, "IDirect3DDevice3_EndScene failed, hr = %08x\n", hr); + } + + color = D3D1_getPixelColor(DirectDraw1, Surface1, 5, 5); + red = (color & 0x00ff0000) >> 16; + green = (color & 0x0000ff00) >> 8; + blue = (color & 0x000000ff); + ok(red == 0 && green == 0 && blue == 0xff, "Got color %08x, expected 000000ff or near\n", color); + + color = D3D1_getPixelColor(DirectDraw1, Surface1, 400, 5); + red = (color & 0x00ff0000) >> 16; + green = (color & 0x0000ff00) >> 8; + blue = (color & 0x000000ff); + ok(red == 0 && green == 0 && blue == 0xff, "Got color %08x, expected 000000ff or near\n", color); + + color = D3D1_getPixelColor(DirectDraw1, Surface1, 5, 245); + red = (color & 0x00ff0000) >> 16; + green = (color & 0x0000ff00) >> 8; + blue = (color & 0x000000ff); + ok(red == 0 && green == 0 && blue >= 0x7e && blue <= 0x82, "Got color %08x, expected 00000080 or near\n", color); + + color = D3D1_getPixelColor(DirectDraw1, Surface1, 400, 245); + red = (color & 0x00ff0000) >> 16; + green = (color & 0x0000ff00) >> 8; + blue = (color & 0x000000ff); + ok(red == 0 && green == 0 && blue >= 0x7e && blue <= 0x82, "Got color %08x, expected 00000080 or near\n", color); + + /* 3) Test RGB - should multiply color components from diffuse color and texture */ + if(Texture) IDirect3DTexture_Release(Texture); + Texture = NULL; + if(TexSurface) IDirectDrawSurface_Release(TexSurface); + TexSurface = NULL; + + memset (&ddsd, 0, sizeof (ddsd)); + ddsd.dwSize = sizeof (ddsd); + ddsd.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_PIXELFORMAT; + ddsd.dwHeight = 128; + ddsd.dwWidth = 128; + ddsd.ddsCaps.dwCaps = DDSCAPS_TEXTURE; + ddsd.ddpfPixelFormat.dwSize = sizeof(ddsd.ddpfPixelFormat); + ddsd.ddpfPixelFormat.dwFlags = DDPF_RGB | DDPF_ALPHAPIXELS; + U1(ddsd.ddpfPixelFormat).dwRGBBitCount = 32; + U2(ddsd.ddpfPixelFormat).dwRBitMask = 0x00ff0000; + U3(ddsd.ddpfPixelFormat).dwGBitMask = 0x0000ff00; + U4(ddsd.ddpfPixelFormat).dwBBitMask = 0x000000ff; + U5(ddsd.ddpfPixelFormat).dwRGBAlphaBitMask = 0xff000000; + hr = IDirectDraw_CreateSurface(DirectDraw1, &ddsd, &TexSurface, NULL); + ok(hr==D3D_OK, "CreateSurface returned: %x\n", hr); + if (FAILED(hr)) { + skip("IDirectDraw_CreateSurface failed; skipping further tests\n"); + goto out; + } + + hr = IDirectDrawSurface_QueryInterface(TexSurface, &IID_IDirect3DTexture, + (void *)&Texture); + ok(hr==D3D_OK, "IDirectDrawSurface_QueryInterface returned: %x\n", hr); + if (FAILED(hr)) { + skip("Can't get IDirect3DTexture interface; skipping further tests\n"); + goto out; + } + + memset(&ddbltfx, 0, sizeof(ddbltfx)); + ddbltfx.dwSize = sizeof(ddbltfx); + ddbltfx.dwFillColor = 0; + hr = IDirectDrawSurface_Blt(Surface1, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &ddbltfx); + ok(hr == D3D_OK, "IDirectDrawSurface_Blt failed with %08x\n", hr); + + ddbltfx.dwFillColor = 0x00ffffff; + hr = IDirectDrawSurface_Blt(TexSurface, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &ddbltfx); + ok(hr == D3D_OK, "IDirectDrawSurface_Blt failed with %08x\n", hr); + ddbltfx.dwFillColor = 0x00ffff80; + hr = IDirectDrawSurface_Blt(TexSurface, &rect, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &ddbltfx); + ok(hr == D3D_OK, "IDirectDrawSurface_Blt failed with %08x\n", hr); + + memset(&exdesc, 0, sizeof(D3DEXECUTEBUFFERDESC)); + exdesc.dwSize = sizeof(D3DEXECUTEBUFFERDESC); + hr = IDirect3DExecuteBuffer_Lock(ExecuteBuffer, &exdesc); + ok(hr == D3D_OK, "IDirect3DExecuteBuffer_Lock failed with %08x\n", hr); + if (FAILED(hr)) { + skip("IDirect3DExecuteBuffer_Lock failed; skipping further tests\n"); + goto out; + } + + memcpy(exdesc.lpData, test2_quads, sizeof(test2_quads)); + + exe_buffer_ptr = 256 + (char*)exdesc.lpData; + + EXEBUF_PUT_PROCESSVERTICES(8, exe_buffer_ptr); + + EXEBUF_START_RENDER_STATES(2, exe_buffer_ptr); + EXEBUF_PUT_RENDER_STATE(D3DRENDERSTATE_ALPHABLENDENABLE, FALSE, exe_buffer_ptr); + hr = IDirect3DTexture_GetHandle(Texture, Direct3DDevice1, &htex); + ok(hr == D3D_OK, "IDirect3DTexture_GetHandle failed with %08x\n", hr); + EXEBUF_PUT_RENDER_STATE(D3DRENDERSTATE_TEXTUREHANDLE, htex, exe_buffer_ptr); + + EXEBUF_PUT_QUAD(0, exe_buffer_ptr); + EXEBUF_PUT_QUAD(4, exe_buffer_ptr); + + EXEBUF_END(exe_buffer_ptr); + + exe_length = ((char*)exe_buffer_ptr - (char*)exdesc.lpData) - 256; + + hr = IDirect3DExecuteBuffer_Unlock(ExecuteBuffer); + if (FAILED(hr)) { + trace("IDirect3DExecuteBuffer_Unlock failed with %08x\n", hr); + } + + memset(&exdata, 0, sizeof(D3DEXECUTEDATA)); + exdata.dwSize = sizeof(D3DEXECUTEDATA); + exdata.dwVertexCount = 8; + exdata.dwInstructionOffset = 256; + exdata.dwInstructionLength = exe_length; + hr = IDirect3DExecuteBuffer_SetExecuteData(ExecuteBuffer, &exdata); + ok(hr == D3D_OK, "IDirect3DExecuteBuffer_SetExecuteData failed with %08x\n", hr); + + hr = IDirect3DDevice_BeginScene(Direct3DDevice1); + ok(hr == D3D_OK, "IDirect3DDevice3_BeginScene failed with %08x\n", hr); + + if (SUCCEEDED(hr)) { + hr = IDirect3DDevice_Execute(Direct3DDevice1, ExecuteBuffer, Viewport, D3DEXECUTE_UNCLIPPED); + ok(hr == D3D_OK, "IDirect3DDevice_Execute failed, hr = %08x\n", hr); + hr = IDirect3DDevice_EndScene(Direct3DDevice1); + ok(hr == D3D_OK, "IDirect3DDevice3_EndScene failed, hr = %08x\n", hr); + } + + color = D3D1_getPixelColor(DirectDraw1, Surface1, 5, 5); + red = (color & 0x00ff0000) >> 16; + green = (color & 0x0000ff00) >> 8; + blue = (color & 0x000000ff); + ok(red == 0xff && green == 0 && blue >= 0x3e && blue <= 0x42, "Got color %08x, expected 00ff0040 or near\n", color); + + color = D3D1_getPixelColor(DirectDraw1, Surface1, 400, 5); + red = (color & 0x00ff0000) >> 16; + green = (color & 0x0000ff00) >> 8; + blue = (color & 0x000000ff); + ok(red == 0xff && green == 0 && blue == 0x80, "Got color %08x, expected 00ff0080 or near\n", color); + + color = D3D1_getPixelColor(DirectDraw1, Surface1, 5, 245); + red = (color & 0x00ff0000) >> 16; + green = (color & 0x0000ff00) >> 8; + blue = (color & 0x000000ff); + ok(red >= 0x7e && red <= 0x82 && green == 0 && blue == 0x80, "Got color %08x, expected 00800080 or near\n", color); + + color = D3D1_getPixelColor(DirectDraw1, Surface1, 400, 245); + red = (color & 0x00ff0000) >> 16; + green = (color & 0x0000ff00) >> 8; + blue = (color & 0x000000ff); + ok(red >= 0x7e && red <= 0x82 && green == 0 && blue == 0xff, "Got color %08x, expected 008000ff or near\n", color); + + /* 4) Test alpha again, now with color keyed texture (colorkey emulation in wine can interfere) */ + if(Texture) IDirect3DTexture_Release(Texture); + Texture = NULL; + if(TexSurface) IDirectDrawSurface_Release(TexSurface); + TexSurface = NULL; + + memset (&ddsd, 0, sizeof (ddsd)); + ddsd.dwSize = sizeof (ddsd); + ddsd.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_PIXELFORMAT; + ddsd.dwHeight = 128; + ddsd.dwWidth = 128; + ddsd.ddsCaps.dwCaps = DDSCAPS_TEXTURE; + ddsd.ddpfPixelFormat.dwSize = sizeof(ddsd.ddpfPixelFormat); + ddsd.ddpfPixelFormat.dwFlags = DDPF_RGB; + U1(ddsd.ddpfPixelFormat).dwRGBBitCount = 16; + U2(ddsd.ddpfPixelFormat).dwRBitMask = 0xf800; + U3(ddsd.ddpfPixelFormat).dwGBitMask = 0x07e0; + U4(ddsd.ddpfPixelFormat).dwBBitMask = 0x001f; + + hr = IDirectDraw_CreateSurface(DirectDraw1, &ddsd, &TexSurface, NULL); + ok(hr==D3D_OK, "CreateSurface returned: %x\n", hr); + if (FAILED(hr)) { + skip("IDirectDraw_CreateSurface failed; skipping further tests\n"); + goto out; + } + + hr = IDirectDrawSurface_QueryInterface(TexSurface, &IID_IDirect3DTexture, + (void *)&Texture); + ok(hr==D3D_OK, "IDirectDrawSurface_QueryInterface returned: %x\n", hr); + if (FAILED(hr)) { + skip("Can't get IDirect3DTexture interface; skipping further tests\n"); + goto out; + } + + memset(&ddbltfx, 0, sizeof(ddbltfx)); + ddbltfx.dwSize = sizeof(ddbltfx); + ddbltfx.dwFillColor = 0; + hr = IDirectDrawSurface_Blt(Surface1, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &ddbltfx); + ok(hr == D3D_OK, "IDirectDrawSurface_Blt failed with %08x\n", hr); + ddbltfx.dwFillColor = 0xf800; + hr = IDirectDrawSurface_Blt(TexSurface, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &ddbltfx); + ok(hr == D3D_OK, "IDirectDrawSurface_Blt failed with %08x\n", hr); + ddbltfx.dwFillColor = 0x001f; + hr = IDirectDrawSurface_Blt(TexSurface, &rect, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &ddbltfx); + ok(hr == D3D_OK, "IDirectDrawSurface_Blt failed with %08x\n", hr); + + clrKey.dwColorSpaceLowValue = 0x001f; + clrKey.dwColorSpaceHighValue = 0x001f; + hr = IDirectDrawSurface_SetColorKey(TexSurface, DDCKEY_SRCBLT, &clrKey); + ok(hr==D3D_OK, "IDirectDrawSurfac_SetColorKey returned: %x\n", hr); + + memset(&exdesc, 0, sizeof(D3DEXECUTEBUFFERDESC)); + exdesc.dwSize = sizeof(D3DEXECUTEBUFFERDESC); + hr = IDirect3DExecuteBuffer_Lock(ExecuteBuffer, &exdesc); + ok(hr == D3D_OK, "IDirect3DExecuteBuffer_Lock failed with %08x\n", hr); + if (FAILED(hr)) { + skip("IDirect3DExecuteBuffer_Lock failed; skipping further tests\n"); + goto out; + } + + memcpy(exdesc.lpData, test1_quads, sizeof(test1_quads)); + + exe_buffer_ptr = 256 + (char*)exdesc.lpData; + + EXEBUF_PUT_PROCESSVERTICES(8, exe_buffer_ptr); + + EXEBUF_START_RENDER_STATES(2, exe_buffer_ptr); + EXEBUF_PUT_RENDER_STATE(D3DRENDERSTATE_ALPHABLENDENABLE, TRUE, exe_buffer_ptr); + hr = IDirect3DTexture_GetHandle(Texture, Direct3DDevice1, &htex); + ok(hr == D3D_OK, "IDirect3DTexture_GetHandle failed with %08x\n", hr); + EXEBUF_PUT_RENDER_STATE(D3DRENDERSTATE_TEXTUREHANDLE, htex, exe_buffer_ptr); + + EXEBUF_PUT_QUAD(0, exe_buffer_ptr); + EXEBUF_PUT_QUAD(4, exe_buffer_ptr); + + EXEBUF_END(exe_buffer_ptr); + + exe_length = ((char*)exe_buffer_ptr - (char*)exdesc.lpData) - 256; + + hr = IDirect3DExecuteBuffer_Unlock(ExecuteBuffer); + if (FAILED(hr)) { + trace("IDirect3DExecuteBuffer_Unlock failed with %08x\n", hr); + } + + memset(&exdata, 0, sizeof(D3DEXECUTEDATA)); + exdata.dwSize = sizeof(D3DEXECUTEDATA); + exdata.dwVertexCount = 8; + exdata.dwInstructionOffset = 256; + exdata.dwInstructionLength = exe_length; + hr = IDirect3DExecuteBuffer_SetExecuteData(ExecuteBuffer, &exdata); + ok(hr == D3D_OK, "IDirect3DExecuteBuffer_SetExecuteData failed with %08x\n", hr); + + hr = IDirect3DDevice_BeginScene(Direct3DDevice1); + ok(hr == D3D_OK, "IDirect3DDevice3_BeginScene failed with %08x\n", hr); + + if (SUCCEEDED(hr)) { + hr = IDirect3DDevice_Execute(Direct3DDevice1, ExecuteBuffer, Viewport, D3DEXECUTE_UNCLIPPED); + ok(hr == D3D_OK, "IDirect3DDevice_Execute failed, hr = %08x\n", hr); + hr = IDirect3DDevice_EndScene(Direct3DDevice1); + ok(hr == D3D_OK, "IDirect3DDevice3_EndScene failed, hr = %08x\n", hr); + } + + color = D3D1_getPixelColor(DirectDraw1, Surface1, 5, 5); + ok(color == 0, "Got color %08x, expected 00000000\n", color); + + color = D3D1_getPixelColor(DirectDraw1, Surface1, 400, 5); + red = (color & 0x00ff0000) >> 16; + green = (color & 0x0000ff00) >> 8; + blue = (color & 0x000000ff); + ok(red == 0xff && green == 0 && blue == 0, "Got color %08x, expected 00ff0000 or near\n", color); + + color = D3D1_getPixelColor(DirectDraw1, Surface1, 5, 245); + red = (color & 0x00ff0000) >> 16; + green = (color & 0x0000ff00) >> 8; + blue = (color & 0x000000ff); + ok(color == 0, "Got color %08x, expected 00000000\n", color); + + color = D3D1_getPixelColor(DirectDraw1, Surface1, 400, 245); + red = (color & 0x00ff0000) >> 16; + green = (color & 0x0000ff00) >> 8; + blue = (color & 0x000000ff); + ok(red >= 0x7e && red <= 0x82 && green == 0 && blue == 0, "Got color %08x, expected 00800000 or near\n", color); + + out: + + if (TexSurface) IDirectDrawSurface_Release(TexSurface); + if (Texture) IDirect3DTexture_Release(Texture); +} + START_TEST(visual) { HRESULT hr; @@ -848,6 +1618,17 @@ START_TEST(visual) alpha_test(Direct3DDevice); rhw_zero_test(Direct3DDevice); + releaseObjects(); /* release DX7 interfaces to test D3D1 */ + + if(!D3D1_createObjects()) { + skip("Cannot initialize D3D1, skipping\n"); + } + else { + D3D1_TextureMapBlendTest(); + } + D3D1_releaseObjects(); + return ; + cleanup: releaseObjects(); } diff --git a/dlls/ddraw/viewport.c b/dlls/ddraw/viewport.c index 302555d742b..deb4146d929 100644 --- a/dlls/ddraw/viewport.c +++ b/dlls/ddraw/viewport.c @@ -328,7 +328,7 @@ IDirect3DViewportImpl_SetViewport(IDirect3DViewport3 *iface, * This function is pretty similar to IDirect3DVertexBuffer7::ProcessVertices, * so it's tempting to forward it to there. However, there are some * tiny differences. First, the lpOffscreen flag that is reported back, - * then there is the homogenous vertex that is generated. Also there's a lack + * then there is the homogeneous vertex that is generated. Also there's a lack * of FVFs, but still a custom stride. Last, the d3d1 - d3d3 viewport has some * settings (scale) that d3d7 and wined3d do not have. All in all wrapping to * ProcessVertices doesn't pay of in terms of wrapper code needed and code diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index 2789df52c49..5cec471011b 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -848,8 +848,9 @@ static INT FONT_EnumFontFamiliesEx( HDC hDC, LPLOGFONTW plf, if (!dc) return 0; - TRACE("lfFaceName = %s lfCharset = %d\n", debugstr_w(plf->lfFaceName), - plf->lfCharSet); + if (plf) + TRACE("lfFaceName = %s lfCharset = %d\n", debugstr_w(plf->lfFaceName), + plf->lfCharSet); fe32.lpLogFontParam = plf; fe32.lpEnumFunc = efproc; fe32.lpData = lParam; diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index 3e21a45b4b0..4b54699fbce 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -324,7 +324,7 @@ struct tagGdiFont { struct list hfontlist; FONT_DESC font_desc; LONG aveWidth, ppem; - float scale_x, scale_y; + float scale_y; SHORT yMax; SHORT yMin; OUTLINETEXTMETRICW *potm; @@ -2471,6 +2471,7 @@ static FT_Face OpenFontFace(GdiFont *font, Face *face, LONG width, LONG height) if((err = pFT_Set_Pixel_Sizes(ft_face, 0, font->ppem)) != 0) WARN("FT_Set_Pixel_Sizes %d, %d rets %x\n", 0, font->ppem, err); } else { + font->ppem = height; if((err = pFT_Set_Pixel_Sizes(ft_face, width, height)) != 0) WARN("FT_Set_Pixel_Sizes %d, %d rets %x\n", width, height, err); } @@ -3157,18 +3158,29 @@ found: TRACE("Chosen: %s %s (%s/%p:%ld)\n", debugstr_w(family->FamilyName), debugstr_w(face->StyleName), face->file, face->font_data_ptr, face->face_index); - ret->scale_x = 0.0; - ret->scale_y = 0.0; - ret->aveWidth = abs(lf.lfWidth); if(!face->scalable) { - ret->ppem = face->size.height; - if (height != 0) ret->ppem += diff; + /* Windows uses integer scaling factors for bitmap fonts */ + INT scale, scaled_height; + + if (height != 0) height = diff; + else height = 0; + height += face->size.height; + + scale = (height + face->size.height - 1) / face->size.height; + scaled_height = scale * face->size.height; + /* XP allows not more than 10% deviation */ + if (scale > 1 && scaled_height - height > scaled_height / 10) scale--; + ret->scale_y = scale; width = face->size.x_ppem >> 6; height = face->size.y_ppem >> 6; } + else + ret->scale_y = 1.0; + TRACE("font scale y: %f\n", ret->scale_y); + ret->ft_face = OpenFontFace(ret, face, width, height); if (!ret->ft_face) @@ -3312,6 +3324,7 @@ static void GetEnumStructs(Face *face, LPENUMLOGFONTEXW pelf, height = face->size.y_ppem >> 6; width = face->size.x_ppem >> 6; } + font->scale_y = 1.0; if (!(font->ft_face = OpenFontFace(font, face, width, height))) { @@ -3620,7 +3633,7 @@ DWORD WineEngGetGlyphOutline(GdiFont *incoming_font, UINT glyph, UINT format, INT left, right, top = 0, bottom = 0, adv, lsb, bbx; FT_Angle angle = 0; FT_Int load_flags = FT_LOAD_DEFAULT | FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH; - float widthRatio = 1.0, heightRatio = 1.0; + float widthRatio = 1.0; FT_Matrix transMat = identityMat; BOOL needsTransform = FALSE; @@ -3661,11 +3674,13 @@ DWORD WineEngGetGlyphOutline(GdiFont *incoming_font, UINT glyph, UINT format, } /* Scaling factor */ - if (font->scale_x != 0.0) + if (font->aveWidth && font->potm) { - widthRatio = font->scale_x; - heightRatio = font->scale_y; + widthRatio = (float)font->aveWidth * font->font_desc.matrix.eM11; + widthRatio /= (float)font->potm->otmTextMetrics.tmAveCharWidth; } + else + widthRatio = font->scale_y; left = (INT)(ft_face->glyph->metrics.horiBearingX * widthRatio) & -64; right = (INT)((ft_face->glyph->metrics.horiBearingX + ft_face->glyph->metrics.width) * widthRatio + 63) & -64; @@ -3680,7 +3695,7 @@ DWORD WineEngGetGlyphOutline(GdiFont *incoming_font, UINT glyph, UINT format, scaleMat.xx = FT_FixedFromFloat(widthRatio); scaleMat.xy = 0; scaleMat.yx = 0; - scaleMat.yy = FT_FixedFromFloat(heightRatio); + scaleMat.yy = FT_FixedFromFloat(font->scale_y); pFT_Matrix_Multiply(&scaleMat, &transMat); needsTransform = TRUE; @@ -4161,34 +4176,24 @@ static BOOL get_bitmap_text_metrics(GdiFont *font) static void scale_font_metrics(GdiFont *font, LPTEXTMETRICW ptm) { - if (font->scale_x == 0.0) - { - if (FT_IS_SCALABLE(font->ft_face) || !font->ppem) - font->scale_y = 1.0; - else - { - font->scale_y = (float)font->ppem * font->font_desc.matrix.eM22; - font->scale_y /= (float)font->potm->otmTextMetrics.tmHeight; - } - - if (font->aveWidth) - { - font->scale_x = (float)font->aveWidth * font->font_desc.matrix.eM11; - font->scale_x /= (float)font->potm->otmTextMetrics.tmAveCharWidth; - } - else - font->scale_x = font->scale_y; + float scale_x; - TRACE("font scale x: %f y: %f\n", font->scale_x, font->scale_y); + if (font->aveWidth) + { + scale_x = (float)font->aveWidth * font->font_desc.matrix.eM11; + scale_x /= (float)font->potm->otmTextMetrics.tmAveCharWidth; } + else + scale_x = font->scale_y; + ptm->tmHeight = (float)ptm->tmHeight * font->scale_y; ptm->tmAscent = (float)ptm->tmAscent * font->scale_y; ptm->tmDescent = (float)ptm->tmDescent * font->scale_y; ptm->tmInternalLeading = (float)ptm->tmInternalLeading * font->scale_y; ptm->tmExternalLeading = (float)ptm->tmExternalLeading * font->scale_y; - ptm->tmAveCharWidth = (float)ptm->tmAveCharWidth * font->scale_x; - ptm->tmMaxCharWidth = (float)ptm->tmMaxCharWidth * font->scale_x; + ptm->tmAveCharWidth = (float)ptm->tmAveCharWidth * scale_x; + ptm->tmMaxCharWidth = (float)ptm->tmMaxCharWidth * scale_x; } /************************************************************* diff --git a/dlls/gdi32/gdi32.spec b/dlls/gdi32/gdi32.spec index 4b1b6a41675..2e79346d634 100644 --- a/dlls/gdi32/gdi32.spec +++ b/dlls/gdi32/gdi32.spec @@ -282,14 +282,14 @@ @ stdcall GetFontUnicodeRanges(ptr ptr) @ stdcall GetGlyphIndicesA(long ptr long ptr long) @ stdcall GetGlyphIndicesW(long ptr long ptr long) -@ stub GetGlyphOutline +@ stdcall GetGlyphOutline(long long long ptr long ptr ptr) GetGlyphOutlineA @ stdcall GetGlyphOutlineA(long long long ptr long ptr ptr) @ stdcall GetGlyphOutlineW(long long long ptr long ptr ptr) @ stub GetGlyphOutlineWow @ stdcall GetGraphicsMode(long) # @ stub GetHFONT -@ stdcall GetICMProfileA(long ptr str) -@ stdcall GetICMProfileW(long ptr wstr) +@ stdcall GetICMProfileA(long ptr ptr) +@ stdcall GetICMProfileW(long ptr ptr) @ stdcall GetKerningPairs(long long ptr) GetKerningPairsA @ stdcall GetKerningPairsA(long long ptr) @ stdcall GetKerningPairsW(long long ptr) diff --git a/dlls/gdi32/icm.c b/dlls/gdi32/icm.c index 40491c19d47..860a6f25443 100644 --- a/dlls/gdi32/icm.c +++ b/dlls/gdi32/icm.c @@ -2,6 +2,7 @@ * Image Color Management * * Copyright 2004 Marcus Meissner + * Copyright 2008 Hans Leidekker * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -22,11 +23,14 @@ #include #include + #include "windef.h" #include "winbase.h" #include "wingdi.h" +#include "winnls.h" #include "wine/debug.h" +#include "wine/unicode.h" WINE_DEFAULT_DEBUG_CHANNEL(icm); @@ -34,15 +38,146 @@ WINE_DEFAULT_DEBUG_CHANNEL(icm); /*********************************************************************** * EnumICMProfilesA (GDI32.@) */ -INT WINAPI EnumICMProfilesA(HDC hdc,ICMENUMPROCA func,LPARAM lParam) { - FIXME("(%p, %p, 0x%08lx), stub.\n",hdc,func,lParam); +INT WINAPI EnumICMProfilesA(HDC hdc, ICMENUMPROCA func, LPARAM lparam) +{ + FIXME("%p, %p, 0x%08lx stub\n", hdc, func, lparam); return -1; } /*********************************************************************** * EnumICMProfilesW (GDI32.@) */ -INT WINAPI EnumICMProfilesW(HDC hdc,ICMENUMPROCW func,LPARAM lParam) { - FIXME("(%p, %p, 0x%08lx), stub.\n",hdc,func,lParam); +INT WINAPI EnumICMProfilesW(HDC hdc, ICMENUMPROCW func, LPARAM lparam) +{ + FIXME("%p, %p, 0x%08lx stub\n", hdc, func, lparam); return -1; } + +/********************************************************************** + * GetICMProfileA (GDI32.@) + * + * Returns the filename of the specified device context's color + * management profile, even if color management is not enabled + * for that DC. + * + * RETURNS + * TRUE if filename is copied successfully. + * FALSE if the buffer length pointed to by size is too small. + * + * FIXME + * How does Windows assign these? Some registry key? + */ +BOOL WINAPI GetICMProfileA(HDC hdc, LPDWORD size, LPSTR filename) +{ + WCHAR filenameW[MAX_PATH]; + DWORD buflen = MAX_PATH; + BOOL ret = FALSE; + + TRACE("%p, %p, %p\n", hdc, size, filename); + + if (!hdc || !size || !filename) return FALSE; + + if (GetICMProfileW(hdc, &buflen, filenameW)) + { + int len = WideCharToMultiByte(CP_ACP, 0, filenameW, -1, NULL, 0, NULL, NULL); + if (*size >= len) + { + WideCharToMultiByte(CP_ACP, 0, filenameW, -1, filename, *size, NULL, NULL); + ret = TRUE; + } + else SetLastError(ERROR_INSUFFICIENT_BUFFER); + *size = len; + } + return ret; +} + +/********************************************************************** + * GetICMProfileW (GDI32.@) + */ +BOOL WINAPI GetICMProfileW(HDC hdc, LPDWORD size, LPWSTR filename) +{ + DWORD required; + WCHAR systemdir[MAX_PATH]; + static const WCHAR profile[] = + {'\\','s','p','o','o','l','\\','d','r','i','v','e','r','s', + '\\','c','o','l','o','r','\\','s','R','G','B',' ','C','o','l','o','r',' ', + 'S','p','a','c','e',' ','P','r','o','f','i','l','e','.','i','c','m',0}; + + TRACE("%p, %p, %p\n", hdc, size, filename); + + if (!hdc || !size) return FALSE; + + required = GetSystemDirectoryW(systemdir, MAX_PATH); + required += sizeof(profile) / sizeof(WCHAR); + + if (*size < required) + { + *size = required; + SetLastError(ERROR_INSUFFICIENT_BUFFER); + return FALSE; + } + if (filename) + { + strcpyW(filename, systemdir); + strcatW(filename, profile); + + if (GetFileAttributesW(filename) == INVALID_FILE_ATTRIBUTES) + WARN("color profile not found\n"); + } + *size = required; + return TRUE; +} + +/********************************************************************** + * GetLogColorSpaceA (GDI32.@) + */ +BOOL WINAPI GetLogColorSpaceA(HCOLORSPACE colorspace, LPLOGCOLORSPACEA buffer, DWORD size) +{ + FIXME("%p %p 0x%08x stub\n", colorspace, buffer, size); + return FALSE; +} + +/********************************************************************** + * GetLogColorSpaceW (GDI32.@) + */ +BOOL WINAPI GetLogColorSpaceW(HCOLORSPACE colorspace, LPLOGCOLORSPACEW buffer, DWORD size) +{ + FIXME("%p %p 0x%08x stub\n", colorspace, buffer, size); + return FALSE; +} + +/********************************************************************** + * SetICMProfileA (GDI32.@) + */ +BOOL WINAPI SetICMProfileA(HDC hdc, LPSTR filename) +{ + FIXME("%p %s stub\n", hdc, debugstr_a(filename)); + return TRUE; +} + +/********************************************************************** + * SetICMProfileW (GDI32.@) + */ +BOOL WINAPI SetICMProfileW(HDC hdc, LPWSTR filename) +{ + FIXME("%p %s stub\n", hdc, debugstr_w(filename)); + return TRUE; +} + +/********************************************************************** + * UpdateICMRegKeyA (GDI32.@) + */ +BOOL WINAPI UpdateICMRegKeyA(DWORD reserved, LPSTR cmid, LPSTR filename, UINT command) +{ + FIXME("0x%08x, %s, %s, 0x%08x stub\n", reserved, debugstr_a(cmid), debugstr_a(filename), command); + return TRUE; +} + +/********************************************************************** + * UpdateICMRegKeyW (GDI32.@) + */ +BOOL WINAPI UpdateICMRegKeyW(DWORD reserved, LPWSTR cmid, LPWSTR filename, UINT command) +{ + FIXME("0x%08x, %s, %s, 0x%08x stub\n", reserved, debugstr_w(cmid), debugstr_w(filename), command); + return TRUE; +} diff --git a/dlls/gdi32/palette.c b/dlls/gdi32/palette.c index 169d6f66d31..54d2d067d04 100644 --- a/dlls/gdi32/palette.c +++ b/dlls/gdi32/palette.c @@ -876,145 +876,3 @@ BOOL WINAPI SetMagicColors(HDC hdc, ULONG u1, ULONG u2) FIXME("(%p 0x%08x 0x%08x): stub\n", hdc, u1, u2); return TRUE; } - -/********************************************************************** - * GetICMProfileA [GDI32.@] - * - * Returns the filename of the specified device context's color - * management profile, even if color management is not enabled - * for that DC. - * - * RETURNS - * TRUE if name copied successfully OR lpszFilename is NULL - * FALSE if the buffer length pointed to by lpcbName is too small - * - * NOTE - * The buffer length pointed to by lpcbName is ALWAYS updated to - * the length required regardless of other actions this function - * may take. - * - * FIXME - * How does Windows assign these? Some registry key? - */ - - -/*********************************************************************/ - -BOOL WINAPI GetICMProfileA(HDC hDC, LPDWORD lpcbName, LPSTR lpszFilename) -{ - DWORD callerLen; - static const char icm[] = "winefake.icm"; - - FIXME("(%p, %p, %p): partial stub\n", hDC, lpcbName, lpszFilename); - - callerLen = *lpcbName; - - /* all 3 behaviors require the required buffer size to be set */ - *lpcbName = sizeof(icm); - - /* behavior 1: if lpszFilename is NULL, return size of string and no error */ - if (!lpszFilename) return TRUE; - - /* behavior 2: if buffer size too small, return size of string and error */ - if (callerLen < sizeof(icm)) - { - SetLastError(ERROR_INSUFFICIENT_BUFFER); - return FALSE; - } - - /* behavior 3: if buffer size OK and pointer not NULL, copy and return size */ - memcpy(lpszFilename, icm, sizeof(icm)); - return TRUE; -} - -/********************************************************************** - * GetICMProfileW [GDI32.@] - **/ -BOOL WINAPI GetICMProfileW(HDC hDC, LPDWORD lpcbName, LPWSTR lpszFilename) -{ - DWORD callerLen; - static const WCHAR icm[] = { 'w','i','n','e','f','a','k','e','.','i','c','m', 0 }; - - FIXME("(%p, %p, %p): partial stub\n", hDC, lpcbName, lpszFilename); - - callerLen = *lpcbName; - - /* all 3 behaviors require the required buffer size to be set */ - *lpcbName = sizeof(icm) / sizeof(WCHAR); - - /* behavior 1: if lpszFilename is NULL, return size of string and no error */ - if (!lpszFilename) return TRUE; - - /* behavior 2: if buffer size too small, return size of string and error */ - if (callerLen < sizeof(icm)/sizeof(WCHAR)) - { - SetLastError(ERROR_INSUFFICIENT_BUFFER); - return FALSE; - } - - /* behavior 3: if buffer size OK and pointer not NULL, copy and return size */ - memcpy(lpszFilename, icm, sizeof(icm)); - return TRUE; -} - -/********************************************************************** - * GetLogColorSpaceA [GDI32.@] - * - */ -BOOL WINAPI GetLogColorSpaceA(HCOLORSPACE hColorSpace, LPLOGCOLORSPACEA lpBuffer, DWORD nSize) -{ - FIXME("%p %p 0x%08x: stub!\n", hColorSpace, lpBuffer, nSize); - return FALSE; -} - -/********************************************************************** - * GetLogColorSpaceW [GDI32.@] - * - */ -BOOL WINAPI GetLogColorSpaceW(HCOLORSPACE hColorSpace, LPLOGCOLORSPACEW lpBuffer, DWORD nSize) -{ - FIXME("%p %p 0x%08x: stub!\n", hColorSpace, lpBuffer, nSize); - return FALSE; -} - -/********************************************************************** - * SetICMProfileA [GDI32.@] - * - */ -BOOL WINAPI SetICMProfileA(HDC hDC, LPSTR lpszFilename) -{ - FIXME("hDC %p filename %s: stub!\n", hDC, debugstr_a(lpszFilename)); - return TRUE; /* success */ -} - -/********************************************************************** - * SetICMProfileA [GDI32.@] - * - */ -BOOL WINAPI SetICMProfileW(HDC hDC, LPWSTR lpszFilename) -{ - FIXME("hDC %p filename %s: stub!\n", hDC, debugstr_w(lpszFilename)); - return TRUE; /* success */ -} - -/********************************************************************** - * UpdateICMRegKeyA [GDI32.@] - * - */ -BOOL WINAPI UpdateICMRegKeyA(DWORD dwReserved, LPSTR lpszCMID, LPSTR lpszFileName, UINT nCommand) -{ - FIXME("(0x%08x, %s, %s, 0x%08x): stub!\n", dwReserved, debugstr_a(lpszCMID), - debugstr_a(lpszFileName), nCommand); - return TRUE; /* success */ -} - -/********************************************************************** - * UpdateICMRegKeyW [GDI32.@] - * - */ -BOOL WINAPI UpdateICMRegKeyW(DWORD dwReserved, LPWSTR lpszCMID, LPWSTR lpszFileName, UINT nCommand) -{ - FIXME("(0x%08x, %s, %s, 0x%08x): stub!\n", dwReserved, debugstr_w(lpszCMID), - debugstr_w(lpszFileName), nCommand); - return TRUE; /* success */ -} diff --git a/dlls/gdi32/printdrv.c b/dlls/gdi32/printdrv.c index 36359ae2502..5bfabb9dc7b 100644 --- a/dlls/gdi32/printdrv.c +++ b/dlls/gdi32/printdrv.c @@ -693,7 +693,7 @@ INT16 WINAPI DeleteJob16(HPJOB16 hJob, INT16 nNotUsed) /* * The following two function would allow a page to be sent to the printer - * when it has been processed. For simplicity they havn't been implemented. + * when it has been processed. For simplicity they haven't been implemented. * This means a whole job has to be processed before it is sent to the printer. */ diff --git a/dlls/gdi32/tests/Makefile.in b/dlls/gdi32/tests/Makefile.in index 31cc771a7a0..866615c48d2 100644 --- a/dlls/gdi32/tests/Makefile.in +++ b/dlls/gdi32/tests/Makefile.in @@ -13,6 +13,7 @@ CTESTS = \ font.c \ gdiobj.c \ generated.c \ + icm.c \ mapping.c \ metafile.c \ palette.c \ diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c index ee577c67a2e..7e560d28a9c 100644 --- a/dlls/gdi32/tests/font.c +++ b/dlls/gdi32/tests/font.c @@ -156,7 +156,7 @@ static INT CALLBACK font_enum_proc(const LOGFONT *elf, const TEXTMETRIC *ntm, DW return 1; /* continue enumeration */ } -static void test_font_metrics(HDC hdc, HFONT hfont, const char *test_str, +static void test_font_metrics(HDC hdc, HFONT hfont, LONG lfHeight, const char *test_str, INT test_str_len, const TEXTMETRICA *tm_orig, const SIZE *size_orig, INT width_of_A_orig, INT scale_x, INT scale_y) @@ -165,7 +165,7 @@ static void test_font_metrics(HDC hdc, HFONT hfont, const char *test_str, LOGFONTA lf; TEXTMETRICA tm; SIZE size; - INT width_of_A; + INT width_of_A, cx, cy; if (!hfont) return; @@ -176,13 +176,17 @@ static void test_font_metrics(HDC hdc, HFONT hfont, const char *test_str, GetTextMetricsA(hdc, &tm); + cx = tm.tmAveCharWidth / tm_orig->tmAveCharWidth; + cy = tm.tmHeight / tm_orig->tmHeight; + ok(cx == scale_x && cy == scale_y, "expected scale_x %d, scale_y %d, got cx %d, cy %d\n", + scale_x, scale_y, cx, cy); ok(tm.tmHeight == tm_orig->tmHeight * scale_y, "%d != %d\n", tm.tmHeight, tm_orig->tmHeight * scale_y); ok(tm.tmAscent == tm_orig->tmAscent * scale_y, "%d != %d\n", tm.tmAscent, tm_orig->tmAscent * scale_y); ok(tm.tmDescent == tm_orig->tmDescent * scale_y, "%d != %d\n", tm.tmDescent, tm_orig->tmDescent * scale_y); ok(tm.tmAveCharWidth == tm_orig->tmAveCharWidth * scale_x, "%d != %d\n", tm.tmAveCharWidth, tm_orig->tmAveCharWidth * scale_x); ok(tm.tmMaxCharWidth == tm_orig->tmMaxCharWidth * scale_x, "%d != %d\n", tm.tmAveCharWidth, tm_orig->tmMaxCharWidth * scale_x); - ok(lf.lfHeight == tm.tmHeight, "lf %d != tm %d\n", lf.lfHeight, tm.tmHeight); + ok(lf.lfHeight == lfHeight, "lf %d != %d\n", lf.lfHeight, lfHeight); if (lf.lfWidth) ok(lf.lfWidth == tm.tmAveCharWidth, "lf %d != tm %d\n", lf.lfWidth, tm.tmAveCharWidth); @@ -207,7 +211,7 @@ static void test_bitmap_font(void) HFONT hfont, old_hfont; TEXTMETRICA tm_orig; SIZE size_orig; - INT ret, i, width_orig, height_orig; + INT ret, i, width_orig, height_orig, scale; hdc = GetDC(0); @@ -233,10 +237,17 @@ static void test_bitmap_font(void) DeleteObject(hfont); /* test fractional scaling */ - for (i = 1; i < height_orig; i++) + for (i = 1; i <= height_orig * 3; i++) { + INT nearest_height; + + bitmap_lf.lfHeight = i; hfont = create_font("fractional", &bitmap_lf); - test_font_metrics(hdc, hfont, test_str, sizeof(test_str), &tm_orig, &size_orig, width_orig, 1, 1); + scale = (i + height_orig - 1) / height_orig; + nearest_height = scale * height_orig; + /* XP allows not more than 10% deviation */ + if (scale > 1 && nearest_height - i > nearest_height / 10) scale--; + test_font_metrics(hdc, hfont, bitmap_lf.lfHeight, test_str, sizeof(test_str), &tm_orig, &size_orig, width_orig, 1, scale); DeleteObject(hfont); } @@ -244,14 +255,14 @@ static void test_bitmap_font(void) bitmap_lf.lfHeight = height_orig * 2; bitmap_lf.lfWidth *= 3; hfont = create_font("3x2", &bitmap_lf); - test_font_metrics(hdc, hfont, test_str, sizeof(test_str), &tm_orig, &size_orig, width_orig, 3, 2); + test_font_metrics(hdc, hfont, bitmap_lf.lfHeight, test_str, sizeof(test_str), &tm_orig, &size_orig, width_orig, 3, 2); DeleteObject(hfont); /* test integer scaling 3x3 */ bitmap_lf.lfHeight = height_orig * 3; bitmap_lf.lfWidth = 0; hfont = create_font("3x3", &bitmap_lf); - test_font_metrics(hdc, hfont, test_str, sizeof(test_str), &tm_orig, &size_orig, width_orig, 3, 3); + test_font_metrics(hdc, hfont, bitmap_lf.lfHeight, test_str, sizeof(test_str), &tm_orig, &size_orig, width_orig, 3, 3); DeleteObject(hfont); ReleaseDC(0, hdc); @@ -593,7 +604,7 @@ static void test_GetGlyphIndices(void) flags |= GGI_MARK_NONEXISTING_GLYPHS; charcount = pGetGlyphIndicesW(hdc, testtext, (sizeof(testtext)/2)-1, glyphs, flags); ok(charcount == 5, "GetGlyphIndices count of glyphs should = 5 not %d\n", charcount); - ok(glyphs[4] == 0x001f, "GetGlyphIndices should have returned a nonexistent char not %04x\n", glyphs[4]); + ok((glyphs[4] == 0x001f || glyphs[4] == UNICODE_NOCHAR /* Vista */), "GetGlyphIndices should have returned a nonexistent char not %04x\n", glyphs[4]); flags = 0; charcount = pGetGlyphIndicesW(hdc, testtext, (sizeof(testtext)/2)-1, glyphs, flags); ok(charcount == 5, "GetGlyphIndices count of glyphs should = 5 not %d\n", charcount); diff --git a/dlls/gdi32/tests/icm.c b/dlls/gdi32/tests/icm.c new file mode 100644 index 00000000000..bbd55741221 --- /dev/null +++ b/dlls/gdi32/tests/icm.c @@ -0,0 +1,148 @@ +/* + * Tests for ICM functions + * + * Copyright (C) 2005, 2008 Hans Leidekker + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include + +#include "windef.h" +#include "winbase.h" +#include "winuser.h" +#include "wingdi.h" + +#include "wine/test.h" + +static const WCHAR displayW[] = {'D','I','S','P','L','A','Y',0}; + +static void test_GetICMProfileA( HDC dc ) +{ + BOOL ret; + DWORD size, error; + char filename[MAX_PATH]; + + ret = GetICMProfileA( NULL, NULL, NULL ); + ok( !ret, "GetICMProfileA succeeded\n" ); + + ret = GetICMProfileA( dc, NULL, NULL ); + ok( !ret, "GetICMProfileA succeeded\n" ); + + size = MAX_PATH; + ret = GetICMProfileA( dc, &size, NULL ); + ok( !ret, "GetICMProfileA succeeded\n" ); + + ret = GetICMProfileA( dc, NULL, filename ); + ok( !ret, "GetICMProfileA succeeded\n" ); + + size = MAX_PATH; + ret = GetICMProfileA( NULL, &size, filename ); + ok( !ret, "GetICMProfileA succeeded\n" ); + + size = 0; + SetLastError(0xdeadbeef); + ret = GetICMProfileA( dc, &size, filename ); + error = GetLastError(); + ok( !ret, "GetICMProfileA succeeded\n" ); + ok( size, "expected size > 0\n" ); + ok( error == ERROR_INSUFFICIENT_BUFFER, "got %d, expected ERROR_INSUFFICIENT_BUFFER\n", error ); + + size = MAX_PATH; + ret = GetICMProfileA( dc, &size, filename ); + ok( ret, "GetICMProfileA failed %d\n", GetLastError() ); + + trace( "%s\n", filename ); +} + +static void test_GetICMProfileW( HDC dc ) +{ + BOOL ret; + DWORD size, error; + WCHAR filename[MAX_PATH]; + + ret = GetICMProfileW( NULL, NULL, NULL ); + ok( !ret, "GetICMProfileW succeeded\n" ); + + ret = GetICMProfileW( dc, NULL, NULL ); + ok( !ret, "GetICMProfileW succeeded\n" ); + + size = MAX_PATH; + ret = GetICMProfileW( dc, &size, NULL ); + ok( ret, "GetICMProfileW failed %d\n", GetLastError() ); + + ret = GetICMProfileW( dc, NULL, filename ); + ok( !ret, "GetICMProfileW succeeded\n" ); + + size = MAX_PATH; + ret = GetICMProfileW( NULL, &size, filename ); + ok( !ret, "GetICMProfileW succeeded\n" ); + + size = 0; + SetLastError(0xdeadbeef); + ret = GetICMProfileW( dc, &size, filename ); + error = GetLastError(); + ok( !ret, "GetICMProfileW succeeded\n" ); + ok( size, "expected size > 0\n" ); + ok( error == ERROR_INSUFFICIENT_BUFFER, "got %d, expected ERROR_INSUFFICIENT_BUFFER\n", error ); + + size = MAX_PATH; + ret = GetICMProfileW( dc, &size, filename ); + ok( ret, "GetICMProfileW failed %d\n", GetLastError() ); +} + +static void test_SetICMMode( HDC dc ) +{ + INT ret, knob, save; + + ret = SetICMMode( NULL, 0 ); + ok( !ret, "SetICMMode succeeded (%d)\n", GetLastError() ); + + ret = SetICMMode( dc, -1 ); + ok( !ret, "SetICMMode succeeded (%d)\n", GetLastError() ); + + save = SetICMMode( dc, ICM_QUERY ); + ok( save == ICM_ON || save == ICM_OFF, "SetICMMode failed (%d)\n", GetLastError() ); + + if (save == ICM_ON) knob = ICM_OFF; else knob = ICM_ON; + + ret = SetICMMode( dc, knob ); + todo_wine ok( ret, "SetICMMode failed (%d)\n", GetLastError() ); + + ret = SetICMMode( dc, ICM_QUERY ); + todo_wine ok( ret == knob, "SetICMMode failed (%d)\n", GetLastError() ); + + ret = SetICMMode( dc, save ); + ok( ret, "SetICMMode failed (%d)\n", GetLastError() ); + + dc = CreateDCW( displayW, NULL, NULL, NULL ); + ok( dc != NULL, "CreateDCW failed (%d)\n", GetLastError() ); + + ret = SetICMMode( dc, ICM_QUERY ); + ok( ret == ICM_OFF, "SetICMMode failed (%d)\n", GetLastError() ); + + DeleteDC( dc ); +} + +START_TEST(icm) +{ + HDC dc = GetDC( NULL ); + + test_GetICMProfileA( dc ); + test_GetICMProfileW( dc ); + test_SetICMMode( dc ); + + ReleaseDC( NULL, dc ); +} diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c index 4b4d3cd110d..6156203d408 100644 --- a/dlls/kernel32/process.c +++ b/dlls/kernel32/process.c @@ -897,6 +897,10 @@ static void start_process( void *arg ) */ static void set_process_name( int argc, char *argv[] ) { +#ifdef HAVE_SETPROCTITLE + setproctitle("-%s", argv[1]); +#endif + #ifdef HAVE_PRCTL int i, offset; char *p, *prctl_name = argv[1]; diff --git a/dlls/kernel32/tests/drive.c b/dlls/kernel32/tests/drive.c index a8cc165bd59..a94cbdfea6e 100644 --- a/dlls/kernel32/tests/drive.c +++ b/dlls/kernel32/tests/drive.c @@ -126,7 +126,7 @@ static void test_GetDiskFreeSpaceA(void) ok( total_clusters <= 65535, "total clusters is %d > 65535\n", total_clusters); else if (pGetDiskFreeSpaceExA) { - /* NT, 2k, XP : GetDiskFreeSpace shoud be accurate */ + /* NT, 2k, XP : GetDiskFreeSpace should be accurate */ ULARGE_INTEGER totEx, tot, d; tot.QuadPart = sectors_per_cluster; diff --git a/dlls/kernel32/tests/environ.c b/dlls/kernel32/tests/environ.c index 5f85f5da38b..3088e929141 100644 --- a/dlls/kernel32/tests/environ.c +++ b/dlls/kernel32/tests/environ.c @@ -274,9 +274,19 @@ static void test_ExpandEnvironmentStringsA(void) ret_size1 = GetWindowsDirectoryA(buf1,256); ok ((ret_size1 >0) && (ret_size1<256), "GetWindowsDirectory Failed\n"); ret_size = ExpandEnvironmentStringsA("%SystemRoot%",buf,sizeof(buf)); - if (ERROR_ENVVAR_NOT_FOUND == GetLastError()) - return; - ok(!strcmp(buf, buf1), "ExpandEnvironmentStrings failed %s vs %s. ret_size = %d\n", buf, buf1, ret_size); + if (ERROR_ENVVAR_NOT_FOUND != GetLastError()) + { + ok(!strcmp(buf, buf1), "ExpandEnvironmentStrings failed %s vs %s. ret_size = %d\n", buf, buf1, ret_size); + } + + /* Try with a variable that references another */ + SetEnvironmentVariableA("IndirectVar", "Foo%EnvVar%Bar"); + strcpy(buf, "Indirect-%IndirectVar%-Indirect"); + strcpy(buf2, "Indirect-Foo%EnvVar%Bar-Indirect"); + ret_size = ExpandEnvironmentStringsA(buf, buf1, sizeof(buf1)); + ok(ret_size == strlen(buf2)+1, "ExpandEnvironmentStrings returned %d instead of %d\n", ret_size, lstrlen(buf2)+1); + ok(!strcmp(buf1, buf2), "ExpandEnvironmentStrings returned [%s]\n", buf1); + SetEnvironmentVariableA("IndirectVar", NULL); SetEnvironmentVariableA("EnvVar", NULL); } diff --git a/dlls/kernel32/tests/resource.c b/dlls/kernel32/tests/resource.c index f0c2e3e8bf7..3e152e662d5 100644 --- a/dlls/kernel32/tests/resource.c +++ b/dlls/kernel32/tests/resource.c @@ -134,7 +134,7 @@ static void update_empty_exe( void ) CloseHandle( test ); r = EndUpdateResource( res, FALSE ); - ok( r == FALSE, "EndUpdateResouce failed\n"); + ok( r == FALSE, "EndUpdateResource failed\n"); res = BeginUpdateResource( filename, FALSE ); ok( res == NULL, "BeginUpdateResource failed\n"); @@ -149,7 +149,7 @@ static void update_resources_none( void ) ok( res != NULL, "BeginUpdateResource failed\n"); r = EndUpdateResource( res, FALSE ); - ok( r, "EndUpdateResouce failed\n"); + ok( r, "EndUpdateResource failed\n"); } static void update_resources_delete( void ) @@ -161,7 +161,7 @@ static void update_resources_delete( void ) ok( res != NULL, "BeginUpdateResource failed\n"); r = EndUpdateResource( res, FALSE ); - ok( r, "EndUpdateResouce failed\n"); + ok( r, "EndUpdateResource failed\n"); } static void update_resources_version(void) @@ -178,17 +178,17 @@ static void update_resources_version(void) MAKEINTRESOURCE(0x4567), 0xabcd, NULL, 0 ); - ok( r == FALSE, "UpdateResouce failed\n"); + ok( r == FALSE, "UpdateResource failed\n"); r = UpdateResource( res, MAKEINTRESOURCE(0x1230), MAKEINTRESOURCE(0x4567), 0xabcd, foo, sizeof foo ); - ok( r == TRUE, "UpdateResouce failed\n"); + ok( r == TRUE, "UpdateResource failed\n"); r = EndUpdateResource( res, FALSE ); - ok( r, "EndUpdateResouce failed\n"); + ok( r, "EndUpdateResource failed\n"); } diff --git a/dlls/kernel32/tests/thread.c b/dlls/kernel32/tests/thread.c index 5989ccc9679..6812f16e6d9 100644 --- a/dlls/kernel32/tests/thread.c +++ b/dlls/kernel32/tests/thread.c @@ -601,8 +601,10 @@ static VOID test_thread_priority(void) rc = SetThreadPriority(curthread,min_priority-1); ok(rc == FALSE, "SetThreadPriority passed with a bad argument\n"); - ok(GetLastError() == ERROR_INVALID_PARAMETER, - "SetThreadPriority error %d, expected ERROR_INVALID_PARAMETER (87)\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER || + GetLastError() == ERROR_INVALID_PRIORITY /* Win9x */, + "SetThreadPriority error %d, expected ERROR_INVALID_PARAMETER or ERROR_INVALID_PRIORITY\n", + GetLastError()); ok(GetThreadPriority(curthread)==min_priority, "GetThreadPriority didn't return min_priority\n"); @@ -611,8 +613,10 @@ static VOID test_thread_priority(void) rc = SetThreadPriority(curthread,max_priority+1); ok(rc == FALSE, "SetThreadPriority passed with a bad argument\n"); - ok(GetLastError() == ERROR_INVALID_PARAMETER, - "SetThreadPriority error %d, expected ERROR_INVALID_PARAMETER (87)\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_PARAMETER || + GetLastError() == ERROR_INVALID_PRIORITY /* Win9x */, + "SetThreadPriority error %d, expected ERROR_INVALID_PARAMETER or ERROR_INVALID_PRIORITY\n", + GetLastError()); ok(GetThreadPriority(curthread)==max_priority, "GetThreadPriority didn't return max_priority\n"); diff --git a/dlls/mscms/profile.c b/dlls/mscms/profile.c index 4ecb361a0a3..3f0a50d44ac 100644 --- a/dlls/mscms/profile.c +++ b/dlls/mscms/profile.c @@ -119,7 +119,8 @@ BOOL WINAPI GetColorDirectoryA( PCSTR machine, PSTR buffer, PDWORD size ) BOOL WINAPI GetColorDirectoryW( PCWSTR machine, PWSTR buffer, PDWORD size ) { WCHAR colordir[MAX_PATH]; - static const WCHAR colorsubdir[] = { '\\','c','o','l','o','r',0 }; + static const WCHAR colorsubdir[] = + {'\\','s','p','o','o','l','\\','d','r','i','v','e','r','s','\\','c','o','l','o','r',0}; DWORD len; TRACE( "( %p, %p )\n", buffer, size ); @@ -610,7 +611,7 @@ BOOL WINAPI EnumColorProfilesA( PCSTR machine, PENUMTYPEA record, PBYTE buffer, PDWORD size, PDWORD number ) { BOOL match, ret = FALSE; - char spec[] = "\\*"; + char spec[] = "\\*.icm"; char colordir[MAX_PATH], glob[MAX_PATH], **profiles = NULL; DWORD i, len = sizeof(colordir), count = 0, totalsize = 0; PROFILEHEADER header; @@ -759,7 +760,7 @@ BOOL WINAPI EnumColorProfilesW( PCWSTR machine, PENUMTYPEW record, PBYTE buffer, PDWORD size, PDWORD number ) { BOOL match, ret = FALSE; - WCHAR spec[] = {'\\','*',0}; + WCHAR spec[] = {'\\','*','i','c','m',0}; WCHAR colordir[MAX_PATH], glob[MAX_PATH], **profiles = NULL; DWORD i, len = sizeof(colordir), count = 0, totalsize = 0; PROFILEHEADER header; diff --git a/dlls/mscoree/mscoree.spec b/dlls/mscoree/mscoree.spec index 92efe943432..1d110a80863 100644 --- a/dlls/mscoree/mscoree.spec +++ b/dlls/mscoree/mscoree.spec @@ -2,7 +2,7 @@ 18 stub PostError 19 stub InitSSAutoEnterThread 20 stub UpdateError -22 stub LoadStringRC +22 stdcall LoadStringRC(long ptr long long) 23 stub ReOpenMetaDataWithMemory @ stub CallFunctionShim @@ -69,7 +69,7 @@ @ stub GetXMLObject @ stdcall LoadLibraryShim(ptr ptr ptr ptr) @ stub LoadLibraryWithPolicyShim -@ stub LoadStringRCEx +@ stdcall LoadStringRCEx(long long ptr long long ptr) @ stub LockClrVersion @ stub MetaDataGetDispenser @ stub OpenCtrs diff --git a/dlls/mscoree/mscoree_main.c b/dlls/mscoree/mscoree_main.c index 35564ac9fad..b60d4d31ac8 100644 --- a/dlls/mscoree/mscoree_main.c +++ b/dlls/mscoree/mscoree_main.c @@ -273,6 +273,28 @@ HRESULT WINAPI GetVersionFromProcess(HANDLE hProcess, LPWSTR pVersion, DWORD cch return E_NOTIMPL; } +HRESULT WINAPI LoadStringRCEx(LCID culture, UINT resId, LPWSTR pBuffer, int iBufLen, int bQuiet, int* pBufLen) +{ + HRESULT res = S_OK; + if ((iBufLen <= 0) || !pBuffer) + return E_INVALIDARG; + pBuffer[0] = 0; + if (resId) { + FIXME("(%d, %x, %p, %d, %d, %p): semi-stub\n", culture, resId, pBuffer, iBufLen, bQuiet, pBufLen); + res = E_NOTIMPL; + } + else + res = E_FAIL; + if (pBufLen) + *pBufLen = lstrlenW(pBuffer); + return res; +} + +HRESULT WINAPI LoadStringRC(UINT resId, LPWSTR pBuffer, int iBufLen, int bQuiet) +{ + return LoadStringRCEx(-1, resId, pBuffer, iBufLen, bQuiet, NULL); +} + HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv) { FIXME("(%p, %p, %p): stub\n", rclsid, riid, ppv); diff --git a/dlls/msi/registry.c b/dlls/msi/registry.c index 12d2c9abe2f..ac89186eb3b 100644 --- a/dlls/msi/registry.c +++ b/dlls/msi/registry.c @@ -478,13 +478,17 @@ static UINT get_user_sid(LPWSTR *usersid) return ERROR_FUNCTION_FAILED; size = sizeof(buf); - if (!GetTokenInformation(token, TokenUser, (void *)buf, size, &size)) + if (!GetTokenInformation(token, TokenUser, (void *)buf, size, &size)) { + CloseHandle(token); return ERROR_FUNCTION_FAILED; + } user = (PTOKEN_USER)buf; - if (!ConvertSidToStringSidW(user->User.Sid, usersid)) + if (!ConvertSidToStringSidW(user->User.Sid, usersid)) { + CloseHandle(token); return ERROR_FUNCTION_FAILED; - + } + CloseHandle(token); return ERROR_SUCCESS; } @@ -658,7 +662,7 @@ UINT MSIREG_OpenUserDataFeaturesKey(LPCWSTR szProduct, HKEY *key, BOOL create) else rc = RegOpenKeyW(HKEY_LOCAL_MACHINE, keypath, key); - msi_free(usersid); + LocalFree(usersid); return rc; } @@ -735,7 +739,7 @@ UINT MSIREG_OpenUserDataComponentKey(LPCWSTR szComponent, HKEY *key, BOOL create else rc = RegOpenKeyW(HKEY_LOCAL_MACHINE, keypath, key); - msi_free(usersid); + LocalFree(usersid); return rc; } @@ -760,7 +764,7 @@ UINT MSIREG_DeleteUserDataComponentKey(LPCWSTR szComponent) sprintfW(keypath, szUserDataComp_fmt, usersid, comp); - msi_free(usersid); + LocalFree(usersid); return RegDeleteTreeW(HKEY_LOCAL_MACHINE, keypath); } @@ -790,7 +794,7 @@ UINT MSIREG_OpenUserDataProductKey(LPCWSTR szProduct, HKEY *key, BOOL create) else rc = RegOpenKeyW(HKEY_LOCAL_MACHINE, keypath, key); - msi_free(usersid); + LocalFree(usersid); return rc; } @@ -820,7 +824,7 @@ UINT MSIREG_OpenInstallPropertiesKey(LPCWSTR szProduct, HKEY *key, BOOL create) else rc = RegOpenKeyW(HKEY_LOCAL_MACHINE, keypath, key); - msi_free(usersid); + LocalFree(usersid); return rc; } @@ -845,7 +849,7 @@ UINT MSIREG_DeleteUserDataProductKey(LPCWSTR szProduct) sprintfW(keypath, szUserDataProd_fmt, usersid, squished_pc); - msi_free(usersid); + LocalFree(usersid); return RegDeleteTreeW(HKEY_LOCAL_MACHINE, keypath); } @@ -1035,7 +1039,7 @@ UINT MSIREG_OpenLocalManagedProductKey(LPCWSTR szProductCode, HKEY *key, BOOL cr } sprintfW(keypath, szInstaller_LocalManagedProd_fmt, usersid, squished_pc); - msi_free(usersid); + LocalFree(usersid); if (create) return RegCreateKeyW(HKEY_LOCAL_MACHINE, keypath, key); diff --git a/dlls/msi/tests/format.c b/dlls/msi/tests/format.c index acaa2db1a44..2c9861e96e7 100644 --- a/dlls/msi/tests/format.c +++ b/dlls/msi/tests/format.c @@ -1646,6 +1646,42 @@ static void test_formatrecord(void) ok( sz == 8, "size wrong(%i)\n",sz); ok( 0 == strcmp(buffer,"100 -100"), "wrong output (%s)\n",buffer); + sz = sizeof(buffer); + MsiRecordSetString(hrec, 0, "[1] {[noprop] [twoprop]} {abcdef}"); + MsiRecordSetString(hrec, 1, "one"); + r = MsiFormatRecord(0, hrec, buffer, &sz); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok(sz == 33, "Expected 33, got %d\n",sz); + todo_wine + { + ok(!lstrcmpA(buffer, "one {[noprop] [twoprop]} {abcdef}"), + "Expected \"one {[noprop] [twoprop]} {abcdef}\", got \"%s\"\n", buffer); + } + + sz = sizeof(buffer); + MsiRecordSetString(hrec, 0, "[1] {[noprop] [one]} {abcdef}"); + MsiRecordSetString(hrec, 1, "one"); + r = MsiFormatRecord(0, hrec, buffer, &sz); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok(sz == 29, "Expected 29, got %d\n",sz); + todo_wine + { + ok(!lstrcmpA(buffer, "one {[noprop] [one]} {abcdef}"), + "Expected \"one {[noprop] [one]} {abcdef}\", got \"%s\"\n", buffer); + } + + sz = sizeof(buffer); + MsiRecordSetString(hrec, 0, "[1] {[one]} {abcdef}"); + MsiRecordSetString(hrec, 1, "one"); + r = MsiFormatRecord(0, hrec, buffer, &sz); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok(sz == 20, "Expected 20, got %d\n",sz); + todo_wine + { + ok(!lstrcmpA(buffer, "one {[one]} {abcdef}"), + "Expected \"one {[one]} {abcdef}\", got \"%s\"\n", buffer); + } + MsiCloseHandle( hrec ); } @@ -2003,6 +2039,42 @@ static void test_formatrecord_package(void) ok( 0 == strcmp(buffer,""), "wrong output (%s)\n",buffer); } + sz = sizeof(buffer); + MsiRecordSetString(hrec, 0, "[1] {[noprop] [twoprop]} {abcdef}"); + MsiRecordSetString(hrec, 1, "one"); + r = MsiFormatRecord(package, hrec, buffer, &sz); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok(sz == 13, "Expected 13, got %d\n",sz); + todo_wine + { + ok(!lstrcmpA(buffer, "one {abcdef}"), + "Expected \"one {abcdef}\", got \"%s\"\n", buffer); + } + + sz = sizeof(buffer); + MsiRecordSetString(hrec, 0, "[1] {[noprop] [one]} {abcdef}"); + MsiRecordSetString(hrec, 1, "one"); + r = MsiFormatRecord(package, hrec, buffer, &sz); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok(sz == 13, "Expected 13, got %d\n",sz); + todo_wine + { + ok(!lstrcmpA(buffer, "one {abcdef}"), + "Expected \"one {abcdef}\", got \"%s\"\n", buffer); + } + + sz = sizeof(buffer); + MsiRecordSetString(hrec, 0, "[1] {[one]} {abcdef}"); + MsiRecordSetString(hrec, 1, "one"); + r = MsiFormatRecord(package, hrec, buffer, &sz); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok(sz == 20, "Expected 20, got %d\n",sz); + todo_wine + { + ok(!lstrcmpA(buffer, "one mercury {abcdef}"), + "Expected \"one mercury {abcdef}\", got \"%s\"\n", buffer); + } + MsiCloseHandle(hrec); r = MsiCloseHandle(package); diff --git a/dlls/msi/tests/msi.c b/dlls/msi/tests/msi.c index d4003603fe7..a2149c8ef7a 100644 --- a/dlls/msi/tests/msi.c +++ b/dlls/msi/tests/msi.c @@ -48,14 +48,21 @@ static void init_functionpointers(void) HMODULE hmsi = GetModuleHandleA("msi.dll"); HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll"); - pMsiGetComponentPathA = (void*)GetProcAddress(hmsi, "MsiGetComponentPathA"); - pMsiGetFileHashA = (void*)GetProcAddress(hmsi, "MsiGetFileHashA"); - pMsiOpenPackageExA = (void*)GetProcAddress(hmsi, "MsiOpenPackageExA"); - pMsiOpenPackageExW = (void*)GetProcAddress(hmsi, "MsiOpenPackageExW"); - pMsiQueryComponentStateA = (void*)GetProcAddress(hmsi, "MsiQueryComponentStateA"); - pMsiUseFeatureExA = (void*)GetProcAddress(hmsi, "MsiUseFeatureExA"); - - pConvertSidToStringSidA = (void*)GetProcAddress(hadvapi32, "ConvertSidToStringSidA"); +#define GET_PROC(dll, func) \ + p ## func = (void *)GetProcAddress(dll, #func); \ + if(!p ## func) \ + trace("GetProcAddress(%s) failed\n", #func); + + GET_PROC(hmsi, MsiGetComponentPathA) + GET_PROC(hmsi, MsiGetFileHashA) + GET_PROC(hmsi, MsiOpenPackageExA) + GET_PROC(hmsi, MsiOpenPackageExW) + GET_PROC(hmsi, MsiQueryComponentStateA) + GET_PROC(hmsi, MsiUseFeatureExA) + + GET_PROC(hadvapi32, ConvertSidToStringSidA) + +#undef GET_PROC } static void test_usefeature(void) @@ -63,7 +70,10 @@ static void test_usefeature(void) INSTALLSTATE r; if (!pMsiUseFeatureExA) + { + skip("MsiUseFeatureExA not implemented\n"); return; + } r = MsiQueryFeatureState(NULL,NULL); ok( r == INSTALLSTATE_INVALIDARG, "wrong return val\n"); @@ -279,7 +289,7 @@ static void test_MsiGetFileHash(void) if (!pMsiGetFileHashA) { - skip("MsiGetFileHash not implemented."); + skip("MsiGetFileHash not implemented\n"); return; } @@ -724,6 +734,12 @@ static void test_MsiQueryComponentState(void) static const INSTALLSTATE MAGIC_ERROR = 0xdeadbeef; + if (!pMsiQueryComponentStateA) + { + skip("MsiQueryComponentStateA not implemented\n"); + return; + } + create_test_guid(prodcode, prod_squashed); compose_base85_guid(component, comp_base85, comp_squashed); get_user_sid(&usersid); @@ -1782,10 +1798,17 @@ START_TEST(msi) test_null(); test_getcomponentpath(); test_MsiGetFileHash(); - test_MsiQueryProductState(); - test_MsiQueryFeatureState(); - test_MsiQueryComponentState(); - test_MsiGetComponentPath(); - test_MsiGetProductCode(); - test_MsiEnumClients(); + + if (!pConvertSidToStringSidA) + skip("ConvertSidToStringSidA not implemented\n"); + else + { + /* These tests rely on get_user_sid that needs ConvertSidToStringSidA */ + test_MsiQueryProductState(); + test_MsiQueryFeatureState(); + test_MsiQueryComponentState(); + test_MsiGetComponentPath(); + test_MsiGetProductCode(); + test_MsiEnumClients(); + } } diff --git a/dlls/msi/tests/source.c b/dlls/msi/tests/source.c index 07e6742cb99..7407f5b8748 100644 --- a/dlls/msi/tests/source.c +++ b/dlls/msi/tests/source.c @@ -41,9 +41,17 @@ static void init_functionpointers(void) HMODULE hmsi = GetModuleHandleA("msi.dll"); HMODULE hadvapi32 = GetModuleHandleA("advapi32.dll"); - pMsiSourceListGetInfoA = (void*)GetProcAddress(hmsi, "MsiSourceListGetInfoA"); - pMsiSourceListAddSourceExA = (void*)GetProcAddress(hmsi, "MsiSourceListAddSourceExA"); - pConvertSidToStringSidA = (void*)GetProcAddress(hadvapi32, "ConvertSidToStringSidA"); +#define GET_PROC(dll, func) \ + p ## func = (void *)GetProcAddress(dll, #func); \ + if(!p ## func) \ + trace("GetProcAddress(%s) failed\n", #func); + + GET_PROC(hmsi, MsiSourceListAddSourceExA) + GET_PROC(hmsi, MsiSourceListGetInfoA) + + GET_PROC(hadvapi32, ConvertSidToStringSidA) + +#undef GET_PROC } /* copied from dlls/msi/registry.c */ @@ -125,6 +133,12 @@ static void test_MsiSourceListGetInfo(void) HKEY userkey, hkey; DWORD size; + if (!pMsiSourceListGetInfoA) + { + skip("Skipping MsiSourceListGetInfoA tests\n"); + return; + } + create_test_guid(prodcode, prod_squashed); get_user_sid(&usersid); @@ -348,7 +362,7 @@ static void test_MsiSourceListAddSourceEx(void) if (!pMsiSourceListAddSourceExA) { - skip("Skipping MsiSourceListAddSourceEx tests\n"); + skip("Skipping MsiSourceListAddSourceExA tests\n"); return; } diff --git a/dlls/ntdsapi/Makefile.in b/dlls/msvcr71/Makefile.in similarity index 65% copy from dlls/ntdsapi/Makefile.in copy to dlls/msvcr71/Makefile.in index 0d9e95567b1..0654a30816f 100644 --- a/dlls/ntdsapi/Makefile.in +++ b/dlls/msvcr71/Makefile.in @@ -2,12 +2,12 @@ TOPSRCDIR = @top_srcdir@ TOPOBJDIR = ../.. SRCDIR = @srcdir@ VPATH = @srcdir@ -MODULE = ntdsapi.dll -IMPORTLIB = libntdsapi.$(IMPLIBEXT) -IMPORTS = kernel32 +MODULE = msvcr71.dll +IMPORTLIB = libmsvcr71.$(IMPLIBEXT) +IMPORTS = msvcrt kernel32 C_SRCS = \ - ntdsapi.c + msvcr71.c @MAKE_DLL_RULES@ diff --git a/dlls/credui/credui.rc b/dlls/msvcr71/msvcr71.c similarity index 62% copy from dlls/credui/credui.rc copy to dlls/msvcr71/msvcr71.c index 181e3b3e4ea..3ada089ed44 100644 --- a/dlls/credui/credui.rc +++ b/dlls/msvcr71/msvcr71.c @@ -1,7 +1,7 @@ /* - * Top level resource file for Credentials UI + * msvcr71 main file * - * Copyright 2007 Robert Shearman (for CodeWeavers) + * Copyright (C) 2008 Hans Leidekker * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -18,20 +18,25 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include + #include "windef.h" #include "winbase.h" -#include "winuser.h" -#include "winnls.h" -#include "credui_resources.h" +#include "wine/debug.h" -/* @makedep: banner.bmp */ -IDB_BANNER BITMAP LOADONCALL DISCARDABLE banner.bmp +WINE_DEFAULT_DEBUG_CHANNEL(msvcr71); -#include "credui_De.rc" -#include "credui_En.rc" -#include "credui_Es.rc" -#include "credui_Fr.rc" -#include "credui_Ko.rc" -#include "credui_No.rc" -#include "credui_Pl.rc" -#include "credui_Sv.rc" +BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved ) +{ + switch (reason) + { + case DLL_WINE_PREATTACH: + return FALSE; /* prefer native version */ + case DLL_PROCESS_ATTACH: + DisableThreadLibraryCalls( inst ); + break; + case DLL_PROCESS_DETACH: + break; + } + return TRUE; +} diff --git a/dlls/msvcrtd/msvcrtd.spec b/dlls/msvcr71/msvcr71.spec similarity index 83% copy from dlls/msvcrtd/msvcrtd.spec copy to dlls/msvcr71/msvcr71.spec index 9e94364cff7..28ec8a31ba6 100644 --- a/dlls/msvcrtd/msvcrtd.spec +++ b/dlls/msvcr71/msvcr71.spec @@ -1,10 +1,9 @@ -# msvcrtd.dll - MS VC++ Run Time Library - -@ cdecl $I10_OUTPUT() msvcrt.$I10_OUTPUT @ cdecl -i386 ??0__non_rtti_object@@QAE@ABV0@@Z(ptr) msvcrt.??0__non_rtti_object@@QAE@ABV0@@Z @ cdecl -i386 ??0__non_rtti_object@@QAE@PBD@Z(ptr) msvcrt.??0__non_rtti_object@@QAE@PBD@Z +@ stub ??0bad_cast@@AAE@PBQBD@Z @ cdecl -i386 ??0bad_cast@@QAE@ABQBD@Z(ptr) msvcrt.??0bad_cast@@QAE@ABQBD@Z @ cdecl -i386 ??0bad_cast@@QAE@ABV0@@Z(ptr) msvcrt.??0bad_cast@@QAE@ABV0@@Z +@ stub ??0bad_cast@@QAE@PBD@Z @ cdecl -i386 ??0bad_typeid@@QAE@ABV0@@Z(ptr) msvcrt.??0bad_typeid@@QAE@ABV0@@Z @ cdecl -i386 ??0bad_typeid@@QAE@PBD@Z(ptr) msvcrt.??0bad_typeid@@QAE@PBD@Z @ cdecl -i386 ??0exception@@QAE@ABQBD@Z(ptr) msvcrt.??0exception@@QAE@ABQBD@Z @@ -16,7 +15,6 @@ @ cdecl -i386 ??1exception@@UAE@XZ() msvcrt.??1exception@@UAE@XZ @ cdecl -i386 ??1type_info@@UAE@XZ() msvcrt.??1type_info@@UAE@XZ @ cdecl ??2@YAPAXI@Z(long) msvcrt.??2@YAPAXI@Z -@ cdecl ??2@YAPAXIHPBDH@Z(long long str long) MSVCRTD_operator_new_dbg @ cdecl ??3@YAXPAX@Z(ptr) msvcrt.??3@YAXPAX@Z @ cdecl -i386 ??4__non_rtti_object@@QAEAAV0@ABV0@@Z(ptr) msvcrt.??4__non_rtti_object@@QAEAAV0@ABV0@@Z @ cdecl -i386 ??4bad_cast@@QAEAAV0@ABV0@@Z(ptr) msvcrt.??4bad_cast@@QAEAAV0@ABV0@@Z @@ -28,14 +26,11 @@ @ extern -i386 ??_7bad_cast@@6B@ msvcrt.??_7bad_cast@@6B@ @ extern -i386 ??_7bad_typeid@@6B@ msvcrt.??_7bad_typeid@@6B@ @ extern -i386 ??_7exception@@6B@ msvcrt.??_7exception@@6B@ -@ cdecl -i386 ??_E__non_rtti_object@@UAEPAXI@Z(long) msvcrt.??_E__non_rtti_object@@UAEPAXI@Z -@ cdecl -i386 ??_Ebad_cast@@UAEPAXI@Z(long) msvcrt.??_Ebad_cast@@UAEPAXI@Z -@ cdecl -i386 ??_Ebad_typeid@@UAEPAXI@Z(long) msvcrt.??_Ebad_typeid@@UAEPAXI@Z -@ cdecl -i386 ??_Eexception@@UAEPAXI@Z(long) msvcrt.??_Eexception@@UAEPAXI@Z -@ cdecl -i386 ??_G__non_rtti_object@@UAEPAXI@Z(long) msvcrt.??_G__non_rtti_object@@UAEPAXI@Z -@ cdecl -i386 ??_Gbad_cast@@UAEPAXI@Z(long) msvcrt.??_Gbad_cast@@UAEPAXI@Z -@ cdecl -i386 ??_Gbad_typeid@@UAEPAXI@Z(long) msvcrt.??_Gbad_typeid@@UAEPAXI@Z -@ cdecl -i386 ??_Gexception@@UAEPAXI@Z(long) msvcrt.??_Gexception@@UAEPAXI@Z +@ stub ??_Fbad_cast@@QAEXXZ +@ stub ??_Fbad_typeid@@QAEXXZ +@ cdecl ??_U@YAPAXI@Z(long) msvcrt.??_U@YAPAXI@Z +@ cdecl ??_V@YAXPAX@Z(ptr) msvcrt.??_V@YAXPAX@Z +@ stub __uncaught_exception @ cdecl ?_query_new_handler@@YAP6AHI@ZXZ() msvcrt.?_query_new_handler@@YAP6AHI@ZXZ @ cdecl ?_query_new_mode@@YAHXZ() msvcrt.?_query_new_mode@@YAHXZ @ cdecl ?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z(ptr) msvcrt.?_set_new_handler@@YAP6AHI@ZP6AHI@Z@Z @@ -47,9 +42,14 @@ @ cdecl ?set_new_handler@@YAP6AXXZP6AXXZ@Z(ptr) msvcrt.?set_new_handler@@YAP6AXXZP6AXXZ@Z @ cdecl ?set_terminate@@YAP6AXXZP6AXXZ@Z(ptr) msvcrt.?set_terminate@@YAP6AXXZP6AXXZ@Z @ cdecl ?set_unexpected@@YAP6AXXZP6AXXZ@Z(ptr) msvcrt.?set_unexpected@@YAP6AXXZP6AXXZ@Z +@ stub ?swprintf@@YAHPAGIPBGZZ +@ stub ?swprintf@@YAHPA_WIPB_WZZ @ cdecl ?terminate@@YAXXZ() msvcrt.?terminate@@YAXXZ @ cdecl ?unexpected@@YAXXZ() msvcrt.?unexpected@@YAXXZ +@ stub ?vswprintf@@YAHPAGIPBGPAD@Z +@ stub ?vswprintf@@YAHPA_WIPB_WPAD@Z @ cdecl -i386 ?what@exception@@UBEPBDXZ() msvcrt.?what@exception@@UBEPBDXZ +@ cdecl $I10_OUTPUT() msvcrt.$I10_OUTPUT @ cdecl _CIacos() msvcrt._CIacos @ cdecl _CIasin() msvcrt._CIasin @ cdecl _CIatan() msvcrt._CIatan @@ -66,54 +66,56 @@ @ cdecl _CIsqrt() msvcrt._CIsqrt @ cdecl _CItan() msvcrt._CItan @ cdecl _CItanh() msvcrt._CItanh -@ cdecl _CrtCheckMemory() -@ stub _CrtDbgBreak -@ varargs _CrtDbgReport(long ptr long ptr ptr) -@ stub _CrtDoForAllClientObjects -@ cdecl _CrtDumpMemoryLeaks() -@ stub _CrtIsMemoryBlock -@ stub _CrtIsValidHeapPointer -@ stub _CrtIsValidPointer -@ stub _CrtMemCheckpoint -@ stub _CrtMemDifference -@ stub _CrtMemDumpAllObjectsSince -@ stub _CrtMemDumpStatistics -@ stub _CrtSetAllocHook -@ cdecl _CrtSetBreakAlloc(long) -@ stub _CrtSetDbgBlockType -@ cdecl _CrtSetDbgFlag(long) -@ cdecl _CrtSetDumpClient(ptr) -@ stub _CrtSetReportFile -@ cdecl _CrtSetReportHook(ptr) -@ cdecl _CrtSetReportMode(long long) +@ stub _CRT_RTC_INIT @ cdecl _CxxThrowException(long long) msvcrt._CxxThrowException -@ cdecl -i386 -norelay _EH_prolog() msvcrt._EH_prolog +@ cdecl -i386 _EH_prolog() msvcrt._EH_prolog @ cdecl _Getdays() msvcrt._Getdays @ cdecl _Getmonths() msvcrt._Getmonths @ cdecl _Gettnames() msvcrt._Gettnames @ extern _HUGE msvcrt._HUGE @ cdecl _Strftime(str long str ptr ptr) msvcrt._Strftime @ cdecl _XcptFilter(long ptr) msvcrt._XcptFilter +@ stub __CppXcptFilter +@ stub __CxxCallUnwindDtor +@ stub __CxxCallUnwindVecDtor +@ stub __CxxDetectRethrow +@ stub __CxxExceptionFilter @ cdecl -i386 __CxxFrameHandler(ptr ptr ptr ptr) msvcrt.__CxxFrameHandler -@ stdcall -i386 __CxxLongjmpUnwind(ptr) msvcrt.__CxxLongjmpUnwind +@ stdcall __CxxLongjmpUnwind(ptr) msvcrt.__CxxLongjmpUnwind +@ stub __CxxQueryExceptionSize +@ stub __CxxRegisterExceptionObject +@ stub __CxxUnregisterExceptionObject +@ stub __DestructExceptionObject @ cdecl __RTCastToVoid(ptr) msvcrt.__RTCastToVoid @ cdecl __RTDynamicCast(ptr long ptr ptr long) msvcrt.__RTDynamicCast @ cdecl __RTtypeid(ptr) msvcrt.__RTtypeid @ cdecl __STRINGTOLD(ptr ptr str long) msvcrt.__STRINGTOLD +@ stub ___lc_codepage_func +@ stub ___lc_collate_cp_func +@ stub ___lc_handle_func +@ stub ___mb_cur_max_func +@ stub ___setlc_active_func +@ stub ___unguarded_readlc_active_add_func @ extern __argc msvcrt.__argc @ extern __argv msvcrt.__argv @ extern __badioinfo msvcrt.__badioinfo +@ stub __buffer_overrun @ cdecl __crtCompareStringA(long long str long str long) msvcrt.__crtCompareStringA -@ cdecl __crtGetLocaleInfoW(long long ptr long) msvcrt.__crtGetLocaleInfoW +@ cdecl __crtCompareStringW(long long wstr long wstr long) msvcrt.__crtCompareStringW +@ cdecl __crtGetLocaleInfoW(long long ptr long) +@ stub __crtGetStringTypeW @ cdecl __crtLCMapStringA(long long str long ptr long long long) msvcrt.__crtLCMapStringA +@ stub __crtLCMapStringW @ cdecl __dllonexit(ptr ptr ptr) msvcrt.__dllonexit @ cdecl __doserrno() msvcrt.__doserrno @ cdecl __fpecode() msvcrt.__fpecode @ cdecl __getmainargs(ptr ptr ptr long ptr) msvcrt.__getmainargs @ extern __initenv msvcrt.__initenv +@ stub __iob_func @ cdecl __isascii(long) msvcrt.__isascii @ cdecl __iscsym(long) msvcrt.__iscsym @ cdecl __iscsymf(long) msvcrt.__iscsymf +@ stub __lc_clike @ extern __lc_codepage msvcrt.__lc_codepage @ extern __lc_collate_cp msvcrt.__lc_collate_cp @ extern __lc_handle msvcrt.__lc_handle @@ -128,9 +130,6 @@ @ cdecl __p__acmdln() msvcrt.__p__acmdln @ cdecl __p__amblksiz() msvcrt.__p__amblksiz @ cdecl __p__commode() msvcrt.__p__commode -@ cdecl __p__crtAssertBusy() -@ cdecl __p__crtBreakAlloc() -@ cdecl __p__crtDbgFlag() @ cdecl __p__daylight() msvcrt.__p__daylight @ cdecl __p__dstbias() msvcrt.__p__dstbias @ cdecl __p__environ() msvcrt.__p__environ @@ -151,18 +150,23 @@ @ cdecl __p__winminor() msvcrt.__p__winminor @ cdecl __p__winver() msvcrt.__p__winver @ cdecl __p__wpgmptr() msvcrt.__p__wpgmptr +@ stub __pctype_func @ extern __pioinfo msvcrt.__pioinfo +@ stub __pwctype_func @ cdecl __pxcptinfoptrs() msvcrt.__pxcptinfoptrs +@ stub __security_error_handler @ cdecl __set_app_type(long) msvcrt.__set_app_type +@ stub __set_buffer_overrun_handler @ extern __setlc_active msvcrt.__setlc_active @ cdecl __setusermatherr(ptr) msvcrt.__setusermatherr -@ cdecl __threadhandle() kernel32.GetCurrentThread -@ cdecl __threadid() kernel32.GetCurrentThreadId +@ cdecl __threadhandle() msvcrt.__threadhandle +@ cdecl __threadid() msvcrt.__threadid @ cdecl __toascii(long) msvcrt.__toascii @ cdecl __unDName(long str ptr ptr long) msvcrt.__unDName -@ cdecl __unDNameEx() msvcrt.__unDNameEx +@ cdecl __unDNameEx(ptr str long ptr ptr ptr long) msvcrt.__unDNameEx @ extern __unguarded_readlc_active msvcrt.__unguarded_readlc_active @ extern __wargv msvcrt.__wargv +@ stub __wcserror @ cdecl __wgetmainargs(ptr ptr ptr long ptr) msvcrt.__wgetmainargs @ extern __winitenv msvcrt.__winitenv @ cdecl _abnormal_termination() msvcrt._abnormal_termination @@ -181,28 +185,33 @@ @ cdecl _adj_fprem() msvcrt._adj_fprem @ cdecl _adj_fprem1() msvcrt._adj_fprem1 @ cdecl _adj_fptan() msvcrt._adj_fptan -@ cdecl _adjust_fdiv() msvcrt._adjust_fdiv -@ extern _aexit_rtn msvcrt._aexit_rtn +@ extern _adjust_fdiv msvcrt._adjust_fdiv +@ stub _aexit_rtn +@ cdecl _aligned_free(ptr) +@ cdecl _aligned_malloc(long long) +@ cdecl _aligned_offset_malloc(long long long) +@ cdecl _aligned_offset_realloc(ptr long long long) +@ cdecl _aligned_realloc(ptr long long) @ cdecl _amsg_exit(long) msvcrt._amsg_exit @ cdecl _assert(str str long) msvcrt._assert @ cdecl _atodbl(ptr str) msvcrt._atodbl -@ cdecl -ret64 _atoi64(str) ntdll._atoi64 +@ cdecl -ret64 _atoi64(str) msvcrt._atoi64 @ cdecl _atoldbl(ptr str) msvcrt._atoldbl @ cdecl _beep(long long) msvcrt._beep -@ cdecl _beginthread (ptr long ptr) msvcrt._beginthread -@ cdecl _beginthreadex (ptr long ptr ptr long ptr) msvcrt._beginthreadex +@ cdecl _beginthread(ptr long ptr) msvcrt._beginthread +@ cdecl _beginthreadex(ptr long ptr ptr long ptr) msvcrt._beginthreadex @ cdecl _c_exit() msvcrt._c_exit @ cdecl _cabs(long) msvcrt._cabs @ cdecl _callnewh(long) msvcrt._callnewh -@ cdecl _calloc_dbg(long long) msvcrt.calloc @ cdecl _cexit() msvcrt._cexit @ cdecl _cgets(str) msvcrt._cgets +@ stub _cgetws @ cdecl _chdir(str) msvcrt._chdir @ cdecl _chdrive(long) msvcrt._chdrive @ cdecl _chgsign( double ) msvcrt._chgsign @ cdecl -i386 _chkesp() msvcrt._chkesp @ cdecl _chmod(str long) msvcrt._chmod -@ cdecl _chsize (long long) msvcrt._chsize +@ cdecl _chsize(long long) msvcrt._chsize @ cdecl _clearfp() msvcrt._clearfp @ cdecl _close(long) msvcrt._close @ cdecl _commit(long) msvcrt._commit @@ -212,19 +221,19 @@ @ cdecl _copysign( double double ) msvcrt._copysign @ varargs _cprintf(str) msvcrt._cprintf @ cdecl _cputs(str) msvcrt._cputs +@ stub _cputws @ cdecl _creat(str long) msvcrt._creat -@ extern _crtAssertBusy -@ extern _crtBreakAlloc -@ extern _crtDbgFlag @ varargs _cscanf(str) msvcrt._cscanf -@ extern _ctype msvcrt._ctype +@ stub _ctime64 @ cdecl _cwait(ptr long long) msvcrt._cwait +@ stub _cwprintf +@ stub _cwscanf @ extern _daylight msvcrt._daylight @ extern _dstbias msvcrt._dstbias -@ cdecl _dup (long) msvcrt._dup -@ cdecl _dup2 (long long) msvcrt._dup2 -@ cdecl _ecvt( double long ptr ptr) msvcrt._ecvt -@ cdecl _endthread () msvcrt._endthread +@ cdecl _dup(long) msvcrt._dup +@ cdecl _dup2(long long) msvcrt._dup2 +@ cdecl _ecvt(double long ptr ptr) msvcrt._ecvt +@ cdecl _endthread() msvcrt._endthread @ cdecl _endthreadex(long) msvcrt._endthreadex @ extern _environ msvcrt._environ @ cdecl _eof(long) msvcrt._eof @@ -235,15 +244,14 @@ @ varargs _execle(str str) msvcrt._execle @ varargs _execlp(str str) msvcrt._execlp @ varargs _execlpe(str str) msvcrt._execlpe -@ cdecl _execv(str str) msvcrt._execv -@ cdecl _execve(str str str) msvcrt._execve -@ cdecl _execvp(str str) msvcrt._execvp -@ cdecl _execvpe(str str str) msvcrt._execvpe +@ cdecl _execv(str ptr) msvcrt._execv +@ cdecl _execve(str ptr ptr) msvcrt._execve +@ cdecl _execvp(str ptr) msvcrt._execvp +@ cdecl _execvpe(str ptr ptr) msvcrt._execvpe @ cdecl _exit(long) msvcrt._exit @ cdecl _expand(ptr long) msvcrt._expand -@ cdecl _expand_dbg(ptr long) msvcrt._expand @ cdecl _fcloseall() msvcrt._fcloseall -@ cdecl _fcvt( double long ptr ptr) msvcrt._fcvt +@ cdecl _fcvt(double long ptr ptr) msvcrt._fcvt @ cdecl _fdopen(long str) msvcrt._fdopen @ cdecl _fgetchar() msvcrt._fgetchar @ cdecl _fgetwchar() msvcrt._fgetwchar @@ -254,8 +262,10 @@ @ cdecl _fileno(ptr) msvcrt._fileno @ cdecl _findclose(long) msvcrt._findclose @ cdecl _findfirst(str ptr) msvcrt._findfirst +@ stub _findfirst64 @ cdecl _findfirsti64(str ptr) msvcrt._findfirsti64 @ cdecl _findnext(long ptr) msvcrt._findnext +@ stub _findnext64 @ cdecl _findnexti64(long ptr) msvcrt._findnexti64 @ cdecl _finite( double ) msvcrt._finite @ cdecl _flsbuf(long ptr) msvcrt._flsbuf @@ -266,15 +276,18 @@ @ cdecl _fpreset() msvcrt._fpreset @ cdecl _fputchar(long) msvcrt._fputchar @ cdecl _fputwchar(long) msvcrt._fputwchar -@ cdecl _free_dbg(ptr) msvcrt.free @ cdecl _fsopen(str str long) msvcrt._fsopen @ cdecl _fstat(long ptr) msvcrt._fstat +@ cdecl _fstat64(long ptr) msvcrt._fstat64 @ cdecl _fstati64(long ptr) msvcrt._fstati64 @ cdecl _ftime(ptr) msvcrt._ftime -@ cdecl -ret64 _ftol() ntdll._ftol +@ stub _ftime64 +@ cdecl -ret64 _ftol() msvcrt._ftol @ cdecl _fullpath(ptr str long) msvcrt._fullpath @ cdecl _futime(long ptr) msvcrt._futime -@ cdecl _gcvt( double long str) msvcrt._gcvt +@ stub _futime64 +@ cdecl _gcvt(double long str) msvcrt._gcvt +@ stub _get_heap_handle @ cdecl _get_osfhandle(long) msvcrt._get_osfhandle @ cdecl _get_sbh_threshold() msvcrt._get_sbh_threshold @ cdecl _getch() msvcrt._getch @@ -284,23 +297,26 @@ @ cdecl _getdiskfree(long ptr) msvcrt._getdiskfree @ cdecl _getdllprocaddr(long str long) msvcrt._getdllprocaddr @ cdecl _getdrive() msvcrt._getdrive -@ cdecl _getdrives() kernel32.GetLogicalDrives +@ cdecl _getdrives() msvcrt._getdrives @ cdecl _getmaxstdio() msvcrt._getmaxstdio @ cdecl _getmbcp() msvcrt._getmbcp -@ cdecl _getpid() kernel32.GetCurrentProcessId +@ cdecl _getpid() msvcrt._getpid @ cdecl _getsystime(ptr) msvcrt._getsystime @ cdecl _getw(ptr) msvcrt._getw +@ stub _getwch +@ stub _getwche @ cdecl _getws(ptr) msvcrt._getws @ cdecl _global_unwind2(ptr) msvcrt._global_unwind2 -@ cdecl _heapadd (ptr long) msvcrt._heapadd +@ stub _gmtime64 +@ cdecl _heapadd(ptr long) msvcrt._heapadd @ cdecl _heapchk() msvcrt._heapchk @ cdecl _heapmin() msvcrt._heapmin @ cdecl _heapset(long) msvcrt._heapset @ cdecl _heapused(ptr ptr) msvcrt._heapused @ cdecl _heapwalk(ptr) msvcrt._heapwalk @ cdecl _hypot(double double) msvcrt._hypot -@ cdecl _i64toa(long long ptr long) ntdll._i64toa -@ cdecl _i64tow(long long ptr long) ntdll._i64tow +@ cdecl _i64toa(long long ptr long) msvcrt._i64toa +@ cdecl _i64tow(long long ptr long) msvcrt._i64tow @ cdecl _initterm(ptr ptr) msvcrt._initterm @ cdecl -i386 _inp(long) msvcrt._inp @ cdecl -i386 _inpd(long) msvcrt._inpd @@ -338,8 +354,8 @@ @ cdecl _ismbslead(ptr ptr) msvcrt._ismbslead @ cdecl _ismbstrail(ptr ptr) msvcrt._ismbstrail @ cdecl _isnan( double ) msvcrt._isnan -@ cdecl _itoa(long ptr long) ntdll._itoa -@ cdecl _itow(long ptr long) ntdll._itow +@ cdecl _itoa(long ptr long) msvcrt._itoa +@ cdecl _itow(long ptr long) msvcrt._itow @ cdecl _j0(double) msvcrt._j0 @ cdecl _j1(double) msvcrt._j1 @ cdecl _jn(long double) msvcrt._jn @@ -347,23 +363,23 @@ @ cdecl _lfind(ptr ptr ptr long ptr) msvcrt._lfind @ cdecl _loaddll(str) msvcrt._loaddll @ cdecl _local_unwind2(ptr long) msvcrt._local_unwind2 +@ stub _localtime64 @ cdecl _lock(long) msvcrt._lock @ cdecl _locking(long long long) msvcrt._locking -@ cdecl _logb( double ) msvcrt._logb -@ cdecl -i386 _longjmpex(ptr long) msvcrt._longjmpex +@ cdecl _logb(double) msvcrt._logb +@ cdecl _longjmpex(ptr long) msvcrt._longjmpex @ cdecl _lrotl(long long) msvcrt._lrotl @ cdecl _lrotr(long long) msvcrt._lrotr @ cdecl _lsearch(ptr ptr long long ptr) msvcrt._lsearch @ cdecl _lseek(long long long) msvcrt._lseek @ cdecl -ret64 _lseeki64(long long long long) msvcrt._lseeki64 -@ cdecl _ltoa(long ptr long) ntdll._ltoa -@ cdecl _ltow(long ptr long) ntdll._ltow +@ cdecl _ltoa(long ptr long) msvcrt._ltoa +@ cdecl _ltow(long ptr long) msvcrt._ltow @ cdecl _makepath(str str str str str) msvcrt._makepath -@ cdecl _malloc_dbg(long) msvcrt.malloc @ cdecl _mbbtombc(long) msvcrt._mbbtombc @ cdecl _mbbtype(long long) msvcrt._mbbtype -@ extern _mbcasemap msvcrt._mbcasemap -@ cdecl _mbccpy (str str) msvcrt._mbccpy +@ stub _mbcasemap +@ cdecl _mbccpy(str str) msvcrt._mbccpy @ cdecl _mbcjistojms(long) msvcrt._mbcjistojms @ cdecl _mbcjmstojis(long) msvcrt._mbcjmstojis @ cdecl _mbclen(ptr) msvcrt._mbclen @@ -379,15 +395,15 @@ @ cdecl _mbscmp(str str) msvcrt._mbscmp @ cdecl _mbscoll(str str) msvcrt._mbscoll @ cdecl _mbscpy(ptr str) msvcrt._mbscpy -@ cdecl _mbscspn (str str) msvcrt._mbscspn +@ cdecl _mbscspn(str str) msvcrt._mbscspn @ cdecl _mbsdec(ptr ptr) msvcrt._mbsdec -@ cdecl _mbsdup(str) msvcrt._strdup +@ cdecl _mbsdup(str) msvcrt._mbsdup @ cdecl _mbsicmp(str str) msvcrt._mbsicmp @ cdecl _mbsicoll(str str) msvcrt._mbsicoll @ cdecl _mbsinc(str) msvcrt._mbsinc @ cdecl _mbslen(str) msvcrt._mbslen @ cdecl _mbslwr(str) msvcrt._mbslwr -@ cdecl _mbsnbcat (str str long) msvcrt._mbsnbcat +@ cdecl _mbsnbcat(str str long) msvcrt._mbsnbcat @ cdecl _mbsnbcmp(str str long) msvcrt._mbsnbcmp @ cdecl _mbsnbcnt(ptr long) msvcrt._mbsnbcnt @ cdecl _mbsnbcoll(str str long) msvcrt._mbsnbcoll @@ -416,15 +432,16 @@ @ cdecl _mbstrlen(str) msvcrt._mbstrlen @ cdecl _mbsupr(str) msvcrt._mbsupr @ cdecl _memccpy(ptr ptr long long) msvcrt._memccpy -@ cdecl _memicmp(str str long) ntdll._memicmp +@ cdecl _memicmp(str str long) msvcrt._memicmp @ cdecl _mkdir(str) msvcrt._mkdir @ cdecl _mktemp(str) msvcrt._mktemp +@ stub _mktime64 @ cdecl _msize(ptr) msvcrt._msize -@ cdecl _msize_dbg(ptr) msvcrt._msize @ cdecl _nextafter(double double) msvcrt._nextafter @ cdecl _onexit(ptr) msvcrt._onexit @ varargs _open(str long) msvcrt._open @ cdecl _open_osfhandle(long long) msvcrt._open_osfhandle +@ stub _osplatform @ extern _osver msvcrt._osver @ cdecl -i386 _outp(long long) msvcrt._outp @ cdecl -i386 _outpd(long long) msvcrt._outpd @@ -438,10 +455,11 @@ @ cdecl _putch(long) msvcrt._putch @ cdecl _putenv(str) msvcrt._putenv @ cdecl _putw(long ptr) msvcrt._putw +@ stub _putwch @ cdecl _putws(wstr) msvcrt._putws @ extern _pwctype msvcrt._pwctype @ cdecl _read(long ptr long) msvcrt._read -@ cdecl _realloc_dbg(ptr long) msvcrt.realloc +@ stub _resetstkoflw @ cdecl _rmdir(str) msvcrt._rmdir @ cdecl _rmtmp() msvcrt._rmtmp @ cdecl _rotl(long long) msvcrt._rotl @@ -451,10 +469,15 @@ @ cdecl _safe_fprem() msvcrt._safe_fprem @ cdecl _safe_fprem1() msvcrt._safe_fprem1 @ cdecl _scalb( double long) msvcrt._scalb +@ stub _scprintf +@ stub _scwprintf @ cdecl _searchenv(str str ptr) msvcrt._searchenv @ stdcall -i386 _seh_longjmp_unwind(ptr) msvcrt._seh_longjmp_unwind +@ stub _set_SSE2_enable @ cdecl _set_error_mode(long) msvcrt._set_error_mode +@ stub _set_purecall_handler @ cdecl _set_sbh_threshold(long) msvcrt._set_sbh_threshold +@ stub _set_security_error_handler @ cdecl _seterrormode(long) msvcrt._seterrormode @ cdecl -i386 _setjmp(ptr) msvcrt._setjmp @ cdecl -i386 _setjmp3(ptr long) msvcrt._setjmp3 @@ -464,7 +487,9 @@ @ cdecl _setsystime(ptr long) msvcrt._setsystime @ cdecl _sleep(long) msvcrt._sleep @ varargs _snprintf(str long str) msvcrt._snprintf -@ varargs _snwprintf(wstr long wstr) ntdll._snwprintf +@ stub _snscanf +@ varargs _snwprintf(wstr long wstr) msvcrt._snwprintf +@ stub _snwscanf @ varargs _sopen(str long long) msvcrt._sopen @ varargs _spawnl(long str str) msvcrt._spawnl @ varargs _spawnle(long str str) msvcrt._spawnle @@ -474,8 +499,9 @@ @ cdecl _spawnve(long str ptr ptr) msvcrt._spawnve @ cdecl _spawnvp(long str ptr) msvcrt._spawnvp @ cdecl _spawnvpe(long str ptr ptr) msvcrt._spawnvpe -@ cdecl _splitpath(str ptr ptr ptr ptr) ntdll._splitpath +@ cdecl _splitpath(str ptr ptr ptr ptr) msvcrt._splitpath @ cdecl _stat(str ptr) msvcrt._stat +@ cdecl _stat64(str ptr) msvcrt._stat64 @ cdecl _stati64(str ptr) msvcrt._stati64 @ cdecl _statusfp() msvcrt._statusfp @ cdecl _strcmpi(str str) msvcrt._strcmpi @@ -484,7 +510,7 @@ @ cdecl _strerror(long) msvcrt._strerror @ cdecl _stricmp(str str) msvcrt._stricmp @ cdecl _stricoll(str str) msvcrt._stricoll -@ cdecl _strlwr(str) ntdll._strlwr +@ cdecl _strlwr(str) msvcrt._strlwr @ cdecl _strncoll(str str long) msvcrt._strncoll @ cdecl _strnicmp(str str long) msvcrt._strnicmp @ cdecl _strnicoll(str str long) msvcrt._strnicoll @@ -492,28 +518,35 @@ @ cdecl _strrev(str) msvcrt._strrev @ cdecl _strset(str long) msvcrt._strset @ cdecl _strtime(ptr) msvcrt._strtime -@ cdecl _strupr(str) ntdll._strupr +@ stub _strtoi64 +@ stub _strtoui64 +@ cdecl _strupr(str) msvcrt._strupr @ cdecl _swab(str str long) msvcrt._swab @ extern _sys_errlist msvcrt._sys_errlist @ extern _sys_nerr msvcrt._sys_nerr @ cdecl _tell(long) msvcrt._tell @ cdecl -ret64 _telli64(long) msvcrt._telli64 @ cdecl _tempnam(str str) msvcrt._tempnam +@ stub _time64 @ extern _timezone msvcrt._timezone @ cdecl _tolower(long) msvcrt._tolower @ cdecl _toupper(long) msvcrt._toupper @ extern _tzname msvcrt._tzname @ cdecl _tzset() msvcrt._tzset -@ cdecl _ui64toa(long long ptr long) ntdll._ui64toa -@ cdecl _ui64tow(long long ptr long) ntdll._ui64tow -@ cdecl _ultoa(long ptr long) ntdll._ultoa -@ cdecl _ultow(long ptr long) ntdll._ultow +@ cdecl _ui64toa(long long ptr long) msvcrt._ui64toa +@ cdecl _ui64tow(long long ptr long) msvcrt._ui64tow +@ cdecl _ultoa(long ptr long) msvcrt._ultoa +@ cdecl _ultow(long ptr long) msvcrt._ultow @ cdecl _umask(long) msvcrt._umask @ cdecl _ungetch(long) msvcrt._ungetch +@ stub _ungetwch @ cdecl _unlink(str) msvcrt._unlink @ cdecl _unloaddll(long) msvcrt._unloaddll @ cdecl _unlock(long) msvcrt._unlock @ cdecl _utime(str ptr) msvcrt._utime +@ stub _utime64 +@ stub _vscprintf +@ stub _vscwprintf @ cdecl _vsnprintf(ptr long ptr ptr) msvcrt._vsnprintf @ cdecl _vsnwprintf(ptr long wstr long) msvcrt._vsnwprintf @ cdecl _waccess(wstr long) msvcrt._waccess @@ -523,30 +556,37 @@ @ extern _wcmdln msvcrt._wcmdln @ cdecl _wcreat(wstr long) msvcrt._wcreat @ cdecl _wcsdup(wstr) msvcrt._wcsdup -@ cdecl _wcsicmp(wstr wstr) ntdll._wcsicmp +@ stub _wcserror +@ cdecl _wcsicmp(wstr wstr) msvcrt._wcsicmp @ cdecl _wcsicoll(wstr wstr) msvcrt._wcsicoll -@ cdecl _wcslwr(wstr) ntdll._wcslwr +@ cdecl _wcslwr(wstr) msvcrt._wcslwr @ cdecl _wcsncoll(wstr wstr long) msvcrt._wcsncoll -@ cdecl _wcsnicmp(wstr wstr long) ntdll._wcsnicmp +@ cdecl _wcsnicmp(wstr wstr long) msvcrt._wcsnicmp @ cdecl _wcsnicoll(wstr wstr long) msvcrt._wcsnicoll @ cdecl _wcsnset(wstr long long) msvcrt._wcsnset @ cdecl _wcsrev(wstr) msvcrt._wcsrev @ cdecl _wcsset(wstr long) msvcrt._wcsset -@ cdecl _wcsupr(wstr) ntdll._wcsupr +@ stub _wcstoi64 +@ stub _wcstoui64 +@ cdecl _wcsupr(wstr) msvcrt._wcsupr @ cdecl _wctime(ptr) msvcrt._wctime +@ stub _wctime64 +@ stub _wctype @ extern _wenviron msvcrt._wenviron @ varargs _wexecl(wstr wstr) msvcrt._wexecl @ varargs _wexecle(wstr wstr) msvcrt._wexecle @ varargs _wexeclp(wstr wstr) msvcrt._wexeclp @ varargs _wexeclpe(wstr wstr) msvcrt._wexeclpe -@ cdecl _wexecv(wstr ptr) msvcrt._wexecv -@ cdecl _wexecve(wstr ptr ptr) msvcrt._wexecve -@ cdecl _wexecvp(wstr ptr) msvcrt._wexecvp -@ cdecl _wexecvpe(wstr ptr ptr) msvcrt._wexecvpe +@ varargs _wexecv(wstr ptr) msvcrt._wexecv +@ varargs _wexecve(wstr ptr ptr) msvcrt._wexecve +@ varargs _wexecvp(wstr ptr) msvcrt._wexecvp +@ varargs _wexecvpe(wstr ptr ptr) msvcrt._wexecvpe @ cdecl _wfdopen(long wstr) msvcrt._wfdopen @ cdecl _wfindfirst(wstr ptr) msvcrt._wfindfirst +@ stub _wfindfirst64 @ cdecl _wfindfirsti64(wstr ptr) msvcrt._wfindfirsti64 @ cdecl _wfindnext(long ptr) msvcrt._wfindnext +@ stub _wfindnext64 @ cdecl _wfindnexti64(long ptr) msvcrt._wfindnexti64 @ cdecl _wfopen(wstr wstr) msvcrt._wfopen @ cdecl _wfreopen(wstr wstr ptr) msvcrt._wfreopen @@ -572,7 +612,7 @@ @ cdecl _wrmdir(wstr) msvcrt._wrmdir @ cdecl _wsearchenv(wstr wstr ptr) msvcrt._wsearchenv @ cdecl _wsetlocale(long wstr) msvcrt._wsetlocale -@ varargs _wsopen (wstr long long) msvcrt._wsopen +@ varargs _wsopen(wstr long long) msvcrt._wsopen @ varargs _wspawnl(long wstr wstr) msvcrt._wspawnl @ varargs _wspawnle(long wstr wstr) msvcrt._wspawnle @ varargs _wspawnlp(long wstr wstr) msvcrt._wspawnlp @@ -583,17 +623,20 @@ @ cdecl _wspawnvpe(long wstr ptr ptr) msvcrt._wspawnvpe @ cdecl _wsplitpath(wstr wstr wstr wstr wstr) msvcrt._wsplitpath @ cdecl _wstat(wstr ptr) msvcrt._wstat +@ cdecl _wstat64(wstr ptr) msvcrt._wstat64 @ cdecl _wstati64(wstr ptr) msvcrt._wstati64 @ cdecl _wstrdate(ptr) msvcrt._wstrdate @ cdecl _wstrtime(ptr) msvcrt._wstrtime @ cdecl _wsystem(wstr) msvcrt._wsystem @ cdecl _wtempnam(wstr wstr) msvcrt._wtempnam @ cdecl _wtmpnam(ptr) msvcrt._wtmpnam -@ cdecl _wtoi(wstr) ntdll._wtoi -@ cdecl _wtoi64(wstr) ntdll._wtoi64 -@ cdecl _wtol(wstr) ntdll._wtol +@ stub _wtof +@ cdecl _wtoi(wstr) msvcrt._wtoi +@ cdecl _wtoi64(wstr) msvcrt._wtoi64 +@ cdecl _wtol(wstr) msvcrt._wtol @ cdecl _wunlink(wstr) msvcrt._wunlink @ cdecl _wutime(wstr ptr) msvcrt._wutime +@ stub _wutime64 @ cdecl _y0(double) msvcrt._y0 @ cdecl _y1(double) msvcrt._y1 @ cdecl _yn(long double ) msvcrt._yn @@ -656,7 +699,7 @@ @ cdecl getwc(ptr) msvcrt.getwc @ cdecl getwchar() msvcrt.getwchar @ cdecl gmtime(ptr) msvcrt.gmtime -@ cdecl is_wctype(long long) ntdll.iswctype +@ cdecl is_wctype(long long) msvcrt.is_wctype @ cdecl isalnum(long) msvcrt.isalnum @ cdecl isalpha(long) msvcrt.isalpha @ cdecl iscntrl(long) msvcrt.iscntrl @@ -669,10 +712,10 @@ @ cdecl isspace(long) msvcrt.isspace @ cdecl isupper(long) msvcrt.isupper @ cdecl iswalnum(long) msvcrt.iswalnum -@ cdecl iswalpha(long) ntdll.iswalpha +@ cdecl iswalpha(long) msvcrt.iswalpha @ cdecl iswascii(long) msvcrt.iswascii @ cdecl iswcntrl(long) msvcrt.iswcntrl -@ cdecl iswctype(long long) ntdll.iswctype +@ cdecl iswctype(long long) msvcrt.iswctype @ cdecl iswdigit(long) msvcrt.iswdigit @ cdecl iswgraph(long) msvcrt.iswgraph @ cdecl iswlower(long) msvcrt.iswlower @@ -692,7 +735,7 @@ @ cdecl -i386 longjmp(ptr long) msvcrt.longjmp @ cdecl malloc(long) msvcrt.malloc @ cdecl mblen(ptr long) msvcrt.mblen -@ cdecl mbstowcs(ptr str long) ntdll.mbstowcs +@ cdecl mbstowcs(ptr str long) msvcrt.mbstowcs @ cdecl mbtowc(wstr str long) msvcrt.mbtowc @ cdecl memchr(ptr long long) msvcrt.memchr @ cdecl memcmp(ptr ptr long) msvcrt.memcmp @@ -708,7 +751,7 @@ @ cdecl putchar(long) msvcrt.putchar @ cdecl puts(str) msvcrt.puts @ cdecl putwc(long ptr) msvcrt.putwc -@ cdecl putwchar(long) msvcrt._fputwchar +@ cdecl putwchar(long) msvcrt.putwchar @ cdecl qsort(ptr long long ptr) msvcrt.qsort @ cdecl raise(long) msvcrt.raise @ cdecl rand() msvcrt.rand @@ -748,7 +791,7 @@ @ cdecl strtol(str ptr long) msvcrt.strtol @ cdecl strtoul(str ptr long) msvcrt.strtoul @ cdecl strxfrm(ptr str long) msvcrt.strxfrm -@ varargs swprintf(wstr wstr) ntdll.swprintf +@ varargs swprintf(wstr wstr) msvcrt.swprintf @ varargs swscanf(wstr wstr) msvcrt.swscanf @ cdecl system(str) msvcrt.system @ cdecl tan(double) msvcrt.tan @@ -758,8 +801,8 @@ @ cdecl tmpnam(ptr) msvcrt.tmpnam @ cdecl tolower(long) msvcrt.tolower @ cdecl toupper(long) msvcrt.toupper -@ cdecl towlower(long) ntdll.towlower -@ cdecl towupper(long) ntdll.towupper +@ cdecl towlower(long) msvcrt.towlower +@ cdecl towupper(long) msvcrt.towupper @ cdecl ungetc(long ptr) msvcrt.ungetc @ cdecl ungetwc(long ptr) msvcrt.ungetwc @ cdecl vfprintf(ptr str long) msvcrt.vfprintf @@ -768,26 +811,26 @@ @ cdecl vsprintf(ptr str ptr) msvcrt.vsprintf @ cdecl vswprintf(ptr wstr long) msvcrt.vswprintf @ cdecl vwprintf(wstr long) msvcrt.vwprintf -@ cdecl wcscat(wstr wstr) ntdll.wcscat -@ cdecl wcschr(wstr long) ntdll.wcschr -@ cdecl wcscmp(wstr wstr) ntdll.wcscmp +@ cdecl wcscat(wstr wstr) msvcrt.wcscat +@ cdecl wcschr(wstr long) msvcrt.wcschr +@ cdecl wcscmp(wstr wstr) msvcrt.wcscmp @ cdecl wcscoll(wstr wstr) msvcrt.wcscoll -@ cdecl wcscpy(ptr wstr) ntdll.wcscpy -@ cdecl wcscspn(wstr wstr) ntdll.wcscspn +@ cdecl wcscpy(ptr wstr) msvcrt.wcscpy +@ cdecl wcscspn(wstr wstr) msvcrt.wcscspn @ cdecl wcsftime(ptr long wstr ptr) msvcrt.wcsftime -@ cdecl wcslen(wstr) ntdll.wcslen -@ cdecl wcsncat(wstr wstr long) ntdll.wcsncat -@ cdecl wcsncmp(wstr wstr long) ntdll.wcsncmp -@ cdecl wcsncpy(ptr wstr long) ntdll.wcsncpy +@ cdecl wcslen(wstr) msvcrt.wcslen +@ cdecl wcsncat(wstr wstr long) msvcrt.wcsncat +@ cdecl wcsncmp(wstr wstr long) msvcrt.wcsncmp +@ cdecl wcsncpy(ptr wstr long) msvcrt.wcsncpy @ cdecl wcspbrk(wstr wstr) msvcrt.wcspbrk -@ cdecl wcsrchr(wstr long) ntdll.wcsrchr -@ cdecl wcsspn(wstr wstr) ntdll.wcsspn -@ cdecl wcsstr(wstr wstr) ntdll.wcsstr +@ cdecl wcsrchr(wstr long) msvcrt.wcsrchr +@ cdecl wcsspn(wstr wstr) msvcrt.wcsspn +@ cdecl wcsstr(wstr wstr) msvcrt.wcsstr @ cdecl wcstod(wstr ptr) msvcrt.wcstod -@ cdecl wcstok(wstr wstr) ntdll.wcstok -@ cdecl wcstol(wstr ptr long) ntdll.wcstol -@ cdecl wcstombs(ptr ptr long) ntdll.wcstombs -@ cdecl wcstoul(wstr ptr long) ntdll.wcstoul +@ cdecl wcstok(wstr wstr) msvcrt.wcstok +@ cdecl wcstol(wstr ptr long) msvcrt.wcstol +@ cdecl wcstombs(ptr ptr long) msvcrt.wcstombs +@ cdecl wcstoul(wstr ptr long) msvcrt.wcstoul @ cdecl wcsxfrm(ptr wstr long) msvcrt.wcsxfrm @ cdecl wctomb(ptr long) msvcrt.wctomb @ varargs wprintf(wstr) msvcrt.wprintf diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec index 0877366a520..ce36fd5a9cd 100644 --- a/dlls/msvcrt/msvcrt.spec +++ b/dlls/msvcrt/msvcrt.spec @@ -445,8 +445,8 @@ @ cdecl _setmode(long long) @ stub _setsystime #(ptr long) @ cdecl _sleep(long) MSVCRT__sleep -@ varargs _snprintf(str long str) MSVCRT__snprintf -@ varargs _snwprintf(wstr long wstr) MSVCRT__snwprintf +@ varargs _snprintf(ptr long str) MSVCRT__snprintf +@ varargs _snwprintf(ptr long wstr) MSVCRT__snwprintf @ varargs _sopen(str long long) MSVCRT__sopen @ varargs _spawnl(long str str) @ varargs _spawnle(long str str) @@ -497,8 +497,8 @@ @ cdecl _unloaddll(long) @ cdecl _unlock(long) @ cdecl _utime(str ptr) -@ cdecl _vsnprintf(ptr long ptr ptr) MSVCRT_vsnprintf -@ cdecl _vsnwprintf(ptr long wstr long) MSVCRT_vsnwprintf +@ cdecl _vsnprintf(ptr long str ptr) MSVCRT_vsnprintf +@ cdecl _vsnwprintf(ptr long wstr ptr) MSVCRT_vsnwprintf @ cdecl _waccess(wstr long) @ cdecl _wasctime(ptr) MSVCRT__wasctime @ cdecl _wchdir(wstr) @@ -734,7 +734,7 @@ @ cdecl strtol(str ptr long) ntdll.strtol @ cdecl strtoul(str ptr long) ntdll.strtoul @ cdecl strxfrm(ptr str long) MSVCRT_strxfrm -@ varargs swprintf(wstr wstr) MSVCRT_swprintf +@ varargs swprintf(ptr wstr) MSVCRT_swprintf @ varargs swscanf(wstr wstr) MSVCRT_swscanf @ cdecl system(str) MSVCRT_system @ cdecl tan(double) MSVCRT_tan @@ -748,12 +748,12 @@ @ cdecl towupper(long) ntdll.towupper @ cdecl ungetc(long ptr) MSVCRT_ungetc @ cdecl ungetwc(long ptr) MSVCRT_ungetwc -@ cdecl vfprintf(ptr str long) MSVCRT_vfprintf -@ cdecl vfwprintf(ptr wstr long) MSVCRT_vfwprintf -@ cdecl vprintf(str long) MSVCRT_vprintf +@ cdecl vfprintf(ptr str ptr) MSVCRT_vfprintf +@ cdecl vfwprintf(ptr wstr ptr) MSVCRT_vfwprintf +@ cdecl vprintf(str ptr) MSVCRT_vprintf @ cdecl vsprintf(ptr str ptr) MSVCRT_vsprintf -@ cdecl vswprintf(ptr wstr long) MSVCRT_vswprintf -@ cdecl vwprintf(wstr long) MSVCRT_vwprintf +@ cdecl vswprintf(ptr wstr ptr) MSVCRT_vswprintf +@ cdecl vwprintf(wstr ptr) MSVCRT_vwprintf @ cdecl wcscat(wstr wstr) ntdll.wcscat @ cdecl wcschr(wstr long) ntdll.wcschr @ cdecl wcscmp(wstr wstr) ntdll.wcscmp diff --git a/dlls/msvcrt/tests/cpp.c b/dlls/msvcrt/tests/cpp.c index fea98853dda..2788a5672b9 100644 --- a/dlls/msvcrt/tests/cpp.c +++ b/dlls/msvcrt/tests/cpp.c @@ -981,6 +981,10 @@ static void test_demangle(void) { "??0?$Foo@P6GHPAX0@Z@@QAE@PAD@Z", "__thiscall Foo::Foo(char *)", 0x880}, { "?Qux@Bar@@0PAP6AHPAV1@AAH1PAH@ZA", "private: static int (__cdecl** Bar::Qux)(class Bar *,int &,int &,int *)" }, { "?Qux@Bar@@0PAP6AHPAV1@AAH1PAH@ZA", "Bar::Qux", 0x1800}, +{"?$AAA@$DBAB@", "AAA<`template-parameter257'>"}, +{"?$AAA@$D?4@", "AAA<`template-parameter-5'>"}, +{"?$AAA@PAUBBB@@", "AAA"}, +{"??$ccccc@PAVaaa@@@bar@bb@foo@@DGPAV0@PAV0@PAVee@@IPAPAVaaa@@1@Z", "private: static class bar * __stdcall foo::bb::bar::ccccc(class bar *,class ee *,unsigned int,class aaa **,class ee *)"}, }; int i, num_test = (sizeof(test)/sizeof(test[0])); char* name; diff --git a/dlls/msvcrt/undname.c b/dlls/msvcrt/undname.c index 2816bfb9722..dfc2241409c 100644 --- a/dlls/msvcrt/undname.c +++ b/dlls/msvcrt/undname.c @@ -289,6 +289,52 @@ static char* str_printf(struct parsed_symbol* sym, const char* format, ...) static BOOL demangle_datatype(struct parsed_symbol* sym, struct datatype_t* ct, struct array* pmt, BOOL in_args); +static const char* get_number(struct parsed_symbol* sym) +{ + char* ptr; + BOOL sgn = FALSE; + + if (*sym->current == '?') + { + sgn = TRUE; + sym->current++; + } + if (*sym->current >= '0' && *sym->current <= '8') + { + ptr = und_alloc(sym, 3); + if (sgn) ptr[0] = '-'; + ptr[sgn ? 1 : 0] = *sym->current + 1; + ptr[sgn ? 2 : 1] = '\0'; + sym->current++; + } + else if (*sym->current == '9') + { + ptr = und_alloc(sym, 4); + if (sgn) ptr[0] = '-'; + ptr[sgn ? 1 : 0] = '1'; + ptr[sgn ? 2 : 1] = '0'; + ptr[sgn ? 3 : 2] = '\0'; + sym->current++; + } + else if (*sym->current >= 'A' && *sym->current <= 'P') + { + long ret = 0; + + while (*sym->current >= 'A' && *sym->current <= 'P') + { + ret *= 16; + ret += *sym->current++ - 'A'; + } + if (*sym->current != '@') return NULL; + + ptr = und_alloc(sym, 17); + sprintf(ptr, "%s%ld", sgn ? "-" : "", ret); + sym->current++; + } + else return NULL; + return ptr; +} + /****************************************************************** * get_args * Parses a list of function/method arguments, creates a string corresponding @@ -316,12 +362,8 @@ static char* get_args(struct parsed_symbol* sym, struct array* pmt_ref, BOOL z_t } if (!demangle_datatype(sym, &ct, pmt_ref, TRUE)) return NULL; - /* 'void' terminates an argument list */ - if (!strcmp(ct.left, "void")) - { - if (!z_term && *sym->current == '@') sym->current++; - break; - } + /* 'void' terminates an argument list in a function */ + if (z_term && !strcmp(ct.left, "void")) break; str_array_push(sym, str_printf(sym, "%s%s", ct.left, ct.right), -1, &arg_collect); if (!strcmp(ct.left, "...")) break; @@ -496,8 +538,8 @@ static BOOL get_class(struct parsed_symbol* sym) if (*++sym->current == '$') { sym->current++; - name = get_template_name(sym); - str_array_push(sym, name, -1, &sym->names); + if ((name = get_template_name(sym))) + str_array_push(sym, name, -1, &sym->names); } break; default: @@ -582,7 +624,8 @@ static BOOL get_calling_convention(char ch, const char** call_conv, case 'E': case 'F': *call_conv = "thiscall"; break; case 'G': case 'H': *call_conv = "stdcall"; break; case 'I': case 'J': *call_conv = "fastcall"; break; - case 'K': break; + case 'K': case 'L': break; + case 'M': *call_conv = "clrcall"; break; default: ERR("Unknown calling convention %c\n", ch); return FALSE; } } @@ -596,7 +639,8 @@ static BOOL get_calling_convention(char ch, const char** call_conv, case 'E': case 'F': *call_conv = "__thiscall"; break; case 'G': case 'H': *call_conv = "__stdcall"; break; case 'I': case 'J': *call_conv = "__fastcall"; break; - case 'K': break; + case 'K': case 'L': break; + case 'M': *call_conv = "__clrcall"; break; default: ERR("Unknown calling convention %c\n", ch); return FALSE; } } @@ -672,7 +716,6 @@ static BOOL demangle_datatype(struct parsed_symbol* sym, struct datatype_t* ct, { char dt; BOOL add_pmt = TRUE; - int num_args=0; assert(ct); ct->left = ct->right = NULL; @@ -693,7 +736,8 @@ static BOOL demangle_datatype(struct parsed_symbol* sym, struct datatype_t* ct, case 'T': /* union */ case 'U': /* struct */ case 'V': /* class */ - /* Class/struct/union */ + case 'Y': /* cointerface */ + /* Class/struct/union/cointerface */ { const char* struct_name = NULL; const char* type_name = NULL; @@ -707,6 +751,7 @@ static BOOL demangle_datatype(struct parsed_symbol* sym, struct datatype_t* ct, case 'T': type_name = "union "; break; case 'U': type_name = "struct "; break; case 'V': type_name = "class "; break; + case 'Y': type_name = "cointerface "; break; } } ct->left = str_printf(sym, "%s%s", type_name, struct_name); @@ -779,34 +824,46 @@ static BOOL demangle_datatype(struct parsed_symbol* sym, struct datatype_t* ct, add_pmt = FALSE; break; case '$': - if (sym->current[0] != '0') goto done; - if (sym->current[1] >= '0' && sym->current[1] <= '9') - { - char* ptr; - ptr = und_alloc(sym, 2); - ptr[0] = sym->current[1] + 1; - ptr[1] = 0; - ct->left = ptr; - sym->current += 2; - } - else if (sym->current[1] >= 'A' && sym->current[1] <= 'P') + switch (*sym->current++) { - while (sym->current[1] >= 'A' && sym->current[1] <= 'P') + case '0': + if (!(ct->left = get_number(sym))) goto done; + break; + case 'D': + { + const char* ptr; + if (!(ptr = get_number(sym))) goto done; + ct->left = str_printf(sym, "`template-parameter%s'", ptr); + } + break; + case 'F': + { + const char* p1; + const char* p2; + if (!(p1 = get_number(sym))) goto done; + if (!(p2 = get_number(sym))) goto done; + ct->left = str_printf(sym, "{%s,%s}", p1, p2); + } + break; + case 'G': { - num_args *= 16; - num_args += sym->current[1] - 'A'; - sym->current += 1; + const char* p1; + const char* p2; + const char* p3; + if (!(p1 = get_number(sym))) goto done; + if (!(p2 = get_number(sym))) goto done; + if (!(p3 = get_number(sym))) goto done; + ct->left = str_printf(sym, "{%s,%s,%s}", p1, p2, p3); } - if(sym->current[1] == '@') + break; + case 'Q': { - char *ptr; - ptr = und_alloc(sym, 17); - sprintf(ptr,"%d",num_args); - ct->left = ptr; - sym->current += 1; + const char* ptr; + if (!(ptr = get_number(sym))) goto done; + ct->left = str_printf(sym, "`non-type-template-parameter%s'", ptr); } + break; } - else goto done; break; default : ERR("Unknown type %c\n", dt); @@ -895,9 +952,14 @@ static BOOL handle_data(struct parsed_symbol* sym) ct.right = str_printf(sym, "{for `%s'}", cls); } break; + case '8': + case '9': + modifier = ct.left = ct.right = NULL; + break; default: goto done; } if (sym->flags & UNDNAME_NAME_ONLY) ct.left = ct.right = modifier = NULL; + sym->result = str_printf(sym, "%s%s%s%s%s%s%s%s", access, member_type, ct.left, modifier && ct.left ? " " : NULL, modifier, @@ -914,6 +976,7 @@ done: */ static BOOL handle_method(struct parsed_symbol* sym, BOOL cast_op) { + char accmem; const char* access = NULL; const char* member_type = NULL; struct datatype_t ct_ret; @@ -954,10 +1017,12 @@ static BOOL handle_method(struct parsed_symbol* sym, BOOL cast_op) * 'Y' * 'Z' */ + accmem = *sym->current++; + if (accmem < 'A' || accmem > 'Z') goto done; if (!(sym->flags & UNDNAME_NO_ACCESS_SPECIFIERS)) { - switch ((*sym->current - 'A') / 8) + switch ((accmem - 'A') / 8) { case 0: access = "private: "; break; case 1: access = "protected: "; break; @@ -966,31 +1031,36 @@ static BOOL handle_method(struct parsed_symbol* sym, BOOL cast_op) } if (!(sym->flags & UNDNAME_NO_MEMBER_TYPE)) { - if (*sym->current >= 'A' && *sym->current <= 'X') + if (accmem <= 'X') { - switch ((*sym->current - 'A') % 8) + switch ((accmem - 'A') % 8) { case 2: case 3: member_type = "static "; break; case 4: case 5: member_type = "virtual "; break; - case 6: case 7: member_type = "thunk "; break; + case 6: case 7: + access = str_printf(sym, "[thunk]:%s", access); + member_type = "virtual "; + break; } } } - if (*sym->current >= 'A' && *sym->current <= 'X') + name = get_class_string(sym, 0); + + if ((accmem - 'A') % 8 == 6 || (accmem - '8') % 8 == 7) /* a thunk */ + name = str_printf(sym, "%s`adjustor{%s}' ", name, get_number(sym)); + + if (accmem <= 'X') { - if (!((*sym->current - 'A') & 2)) + if (((accmem - 'A') % 8) != 2 && ((accmem - 'A') % 8) != 3) { /* Implicit 'this' pointer */ /* If there is an implicit this pointer, const modifier follows */ - if (!get_modifier(*++sym->current, &modifier)) goto done; + if (!get_modifier(*sym->current, &modifier)) goto done; + sym->current++; } } - else if (*sym->current < 'A' || *sym->current > 'Z') goto done; - sym->current++; - name = get_class_string(sym, 0); - if (!get_calling_convention(*sym->current++, &call_conv, &exported, sym->flags)) goto done; @@ -1036,6 +1106,22 @@ done: return ret; } +/****************************************************************** + * handle_template + * Does the final parsing and handling for a name with templates + */ +static BOOL handle_template(struct parsed_symbol* sym) +{ + const char* name; + const char* args; + + assert(*sym->current++ == '$'); + if (!(name = get_literal_string(sym))) return FALSE; + if (!(args = get_args(sym, NULL, FALSE, '<', '>'))) return FALSE; + sym->result = str_printf(sym, "%s%s", name, args); + return TRUE; +} + /******************************************************************* * symbol_demangle * Demangle a C++ linker symbol @@ -1137,6 +1223,44 @@ static BOOL symbol_demangle(struct parsed_symbol* sym) case 'M': function_name = "`eh vector destructor iterator'"; break; case 'N': function_name = "`eh vector vbase constructor iterator'"; break; case 'O': function_name = "`copy constructor closure'"; break; + case 'R': + sym->flags |= UNDNAME_NO_FUNCTION_RETURNS; + switch (*++sym->current) + { + case '0': + { + struct datatype_t ct; + struct array pmt; + + sym->current++; + str_array_init(&pmt); + demangle_datatype(sym, &ct, &pmt, FALSE); + function_name = str_printf(sym, "%s%s `RTTI Type Descriptor'", + ct.left, ct.right); + sym->current--; + } + break; + case '1': + { + const char* n1, *n2, *n3, *n4; + sym->current++; + n1 = get_number(sym); + n2 = get_number(sym); + n3 = get_number(sym); + n4 = get_number(sym); + sym->current--; + function_name = str_printf(sym, "`RTTI Base Class Descriptor at (%s,%s,%s,%s)'", + n1, n2, n3, n4); + } + break; + case '2': function_name = "`RTTI Base Class Array'"; break; + case '3': function_name = "`RTTI Class Hierarchy Descriptor'"; break; + case '4': function_name = "`RTTI Complete Object Locator'"; break; + default: + ERR("Unknown RTTI operator: _R%c\n", *sym->current); + break; + } + break; case 'S': function_name = "`local vftable'"; break; case 'T': function_name = "`local vftable constructor closure'"; break; case 'U': function_name = "operator new[]"; break; @@ -1168,25 +1292,28 @@ static BOOL symbol_demangle(struct parsed_symbol* sym) str_array_push(sym, function_name, -1, &sym->stack); break; } - sym->stack.start = 1; } else if (*sym->current == '$') { /* Strange construct, it's a name with a template argument list and that's all. */ sym->current++; - sym->result = get_template_name(sym); - ret = TRUE; + ret = (sym->result = get_template_name(sym)) != NULL; goto done; } + else if (*sym->current == '?' && sym->current[1] == '$') + do_after = 5; /* Either a class name, or '@' if the symbol is not a class member */ - if (*sym->current != '@') + switch (*sym->current) { + case '@': sym->current++; break; + case '$': break; + default: /* Class the function is associated with, terminated by '@@' */ if (!get_class(sym)) goto done; + break; } - else sym->current++; switch (do_after) { @@ -1204,13 +1331,18 @@ static BOOL symbol_demangle(struct parsed_symbol* sym) case 3: sym->flags &= ~UNDNAME_NO_FUNCTION_RETURNS; break; + case 5: + sym->names.start = 1; + break; } /* Function/Data type and access level */ - if (*sym->current >= '0' && *sym->current <= '7') + if (*sym->current >= '0' && *sym->current <= '9') ret = handle_data(sym); else if (*sym->current >= 'A' && *sym->current <= 'Z') ret = handle_method(sym, do_after == 3); + else if (*sym->current == '$') + ret = handle_template(sym); else ret = FALSE; done: if (ret) assert(sym->result); diff --git a/dlls/msvcrt20/msvcrt20.spec b/dlls/msvcrt20/msvcrt20.spec index 8282130fde5..339cb1c063f 100644 --- a/dlls/msvcrt20/msvcrt20.spec +++ b/dlls/msvcrt20/msvcrt20.spec @@ -566,10 +566,10 @@ @ varargs _execle(str str) msvcrt._execle @ varargs _execlp(str str) msvcrt._execlp @ varargs _execlpe(str str) msvcrt._execlpe -@ cdecl _execv(str str) msvcrt._execv -@ cdecl _execve(str str str) msvcrt._execve -@ cdecl _execvp(str str) msvcrt._execvp -@ cdecl _execvpe(str str str) msvcrt._execvpe +@ cdecl _execv(str ptr) msvcrt._execv +@ cdecl _execve(str ptr ptr) msvcrt._execve +@ cdecl _execvp(str ptr) msvcrt._execvp +@ cdecl _execvpe(str ptr ptr) msvcrt._execvpe @ cdecl _exit(long) msvcrt._exit @ cdecl _expand(ptr long) msvcrt._expand @ cdecl _fcloseall() msvcrt._fcloseall @@ -596,7 +596,7 @@ @ cdecl _fsopen(str str long) msvcrt._fsopen @ cdecl _fstat(long ptr) msvcrt._fstat @ cdecl _ftime(ptr) msvcrt._ftime -@ cdecl _ftol() msvcrt._ftol +@ cdecl -ret64 _ftol() msvcrt._ftol @ cdecl _fullpath(ptr str long) msvcrt._fullpath @ cdecl _futime(long ptr) msvcrt._futime @ cdecl _gcvt( double long str) msvcrt._gcvt diff --git a/dlls/msvcrt40/msvcrt40.spec b/dlls/msvcrt40/msvcrt40.spec index 4657ccf2c27..e46b157d544 100644 --- a/dlls/msvcrt40/msvcrt40.spec +++ b/dlls/msvcrt40/msvcrt40.spec @@ -619,10 +619,10 @@ @ varargs _execle(str str) msvcrt._execle @ varargs _execlp(str str) msvcrt._execlp @ varargs _execlpe(str str) msvcrt._execlpe -@ cdecl _execv(str str) msvcrt._execv -@ cdecl _execve(str str str) msvcrt._execve -@ cdecl _execvp(str str) msvcrt._execvp -@ cdecl _execvpe(str str str) msvcrt._execvpe +@ cdecl _execv(str ptr) msvcrt._execv +@ cdecl _execve(str ptr ptr) msvcrt._execve +@ cdecl _execvp(str ptr) msvcrt._execvp +@ cdecl _execvpe(str ptr ptr) msvcrt._execvpe @ cdecl _exit(long) msvcrt._exit @ cdecl _expand(ptr long) msvcrt._expand @ cdecl _fcloseall() msvcrt._fcloseall @@ -653,7 +653,7 @@ @ cdecl _fstat(long ptr) msvcrt._fstat @ cdecl _fstati64(long ptr) msvcrt._fstati64 @ cdecl _ftime(ptr) msvcrt._ftime -@ cdecl _ftol() msvcrt._ftol +@ cdecl -ret64 _ftol() msvcrt._ftol @ cdecl _fullpath(ptr str long) msvcrt._fullpath @ cdecl _futime(long ptr) msvcrt._futime @ cdecl _gcvt( double long str) msvcrt._gcvt diff --git a/dlls/msvcrtd/msvcrtd.spec b/dlls/msvcrtd/msvcrtd.spec index 9e94364cff7..ec1a4b79e81 100644 --- a/dlls/msvcrtd/msvcrtd.spec +++ b/dlls/msvcrtd/msvcrtd.spec @@ -235,10 +235,10 @@ @ varargs _execle(str str) msvcrt._execle @ varargs _execlp(str str) msvcrt._execlp @ varargs _execlpe(str str) msvcrt._execlpe -@ cdecl _execv(str str) msvcrt._execv -@ cdecl _execve(str str str) msvcrt._execve -@ cdecl _execvp(str str) msvcrt._execvp -@ cdecl _execvpe(str str str) msvcrt._execvpe +@ cdecl _execv(str ptr) msvcrt._execv +@ cdecl _execve(str ptr ptr) msvcrt._execve +@ cdecl _execvp(str ptr) msvcrt._execvp +@ cdecl _execvpe(str ptr ptr) msvcrt._execvpe @ cdecl _exit(long) msvcrt._exit @ cdecl _expand(ptr long) msvcrt._expand @ cdecl _expand_dbg(ptr long) msvcrt._expand diff --git a/dlls/msxml3/Makefile.in b/dlls/msxml3/Makefile.in index 1075e9676a0..a75cd014d06 100644 --- a/dlls/msxml3/Makefile.in +++ b/dlls/msxml3/Makefile.in @@ -12,9 +12,11 @@ C_SRCS = \ attribute.c \ cdata.c \ comment.c \ + docfrag.c \ domdoc.c \ domimpl.c \ element.c \ + entityref.c \ factory.c \ main.c \ node.c \ @@ -32,6 +34,8 @@ C_SRCS = \ RC_SRCS = version.rc +IDL_TLB_SRCS = msxml3_v1.idl + @MAKE_DLL_RULES@ @DEPENDENCIES@ # everything below this line is overwritten by make depend diff --git a/dlls/msxml3/attribute.c b/dlls/msxml3/attribute.c index 2409aa6b740..805bafec477 100644 --- a/dlls/msxml3/attribute.c +++ b/dlls/msxml3/attribute.c @@ -59,12 +59,12 @@ static HRESULT WINAPI domattr_QueryInterface( TRACE("%p %s %p\n", This, debugstr_guid(riid), ppvObject); if ( IsEqualGUID( riid, &IID_IXMLDOMAttribute ) || + IsEqualGUID( riid, &IID_IDispatch ) || IsEqualGUID( riid, &IID_IUnknown ) ) { *ppvObject = iface; } - else if ( IsEqualGUID( riid, &IID_IDispatch ) || - IsEqualGUID( riid, &IID_IXMLDOMNode ) ) + else if ( IsEqualGUID( riid, &IID_IXMLDOMNode ) ) { return IUnknown_QueryInterface(This->node_unk, riid, ppvObject); } diff --git a/dlls/msxml3/cdata.c b/dlls/msxml3/cdata.c index 458989690cb..186b9e48ed1 100644 --- a/dlls/msxml3/cdata.c +++ b/dlls/msxml3/cdata.c @@ -59,12 +59,12 @@ static HRESULT WINAPI domcdata_QueryInterface( TRACE("%p %s %p\n", This, debugstr_guid(riid), ppvObject); if ( IsEqualGUID( riid, &IID_IXMLDOMCDATASection ) || + IsEqualGUID( riid, &IID_IDispatch ) || IsEqualGUID( riid, &IID_IUnknown ) ) { *ppvObject = iface; } - else if ( IsEqualGUID( riid, &IID_IDispatch ) || - IsEqualGUID( riid, &IID_IXMLDOMNode ) || + else if ( IsEqualGUID( riid, &IID_IXMLDOMNode ) || IsEqualGUID( riid, &IID_IXMLDOMElement ) ) { return IUnknown_QueryInterface(This->element_unk, riid, ppvObject); diff --git a/dlls/msxml3/comment.c b/dlls/msxml3/comment.c index 635988504f7..702a339f52a 100644 --- a/dlls/msxml3/comment.c +++ b/dlls/msxml3/comment.c @@ -59,12 +59,12 @@ static HRESULT WINAPI domcomment_QueryInterface( TRACE("%p %s %p\n", This, debugstr_guid(riid), ppvObject); if ( IsEqualGUID( riid, &IID_IXMLDOMComment ) || + IsEqualGUID( riid, &IID_IDispatch ) || IsEqualGUID( riid, &IID_IUnknown ) ) { *ppvObject = iface; } - else if ( IsEqualGUID( riid, &IID_IDispatch ) || - IsEqualGUID( riid, &IID_IXMLDOMNode ) ) + else if ( IsEqualGUID( riid, &IID_IXMLDOMNode ) ) { return IUnknown_QueryInterface(This->node_unk, riid, ppvObject); } diff --git a/dlls/msxml3/docfrag.c b/dlls/msxml3/docfrag.c new file mode 100644 index 00000000000..c741f24d1af --- /dev/null +++ b/dlls/msxml3/docfrag.c @@ -0,0 +1,511 @@ +/* + * DOM Document Fragment implementation + * + * Copyright 2007 Alistair Leslie-Hughes + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define COBJMACROS + +#include "config.h" + +#include +#include "windef.h" +#include "winbase.h" +#include "winuser.h" +#include "ole2.h" +#include "msxml2.h" + +#include "msxml_private.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(msxml); + +#ifdef HAVE_LIBXML2 + +typedef struct _domfrag +{ + const struct IXMLDOMDocumentFragmentVtbl *lpVtbl; + LONG ref; + IUnknown *node_unk; + IXMLDOMNode *node; +} domfrag; + +static inline domfrag *impl_from_IXMLDOMDocumentFragment( IXMLDOMDocumentFragment *iface ) +{ + return (domfrag *)((char*)iface - FIELD_OFFSET(domfrag, lpVtbl)); +} + +static HRESULT WINAPI domfrag_QueryInterface( + IXMLDOMDocumentFragment *iface, + REFIID riid, + void** ppvObject ) +{ + domfrag *This = impl_from_IXMLDOMDocumentFragment( iface ); + TRACE("%p %s %p\n", This, debugstr_guid(riid), ppvObject); + + if ( IsEqualGUID( riid, &IID_IXMLDOMDocumentFragment ) || + IsEqualGUID( riid, &IID_IDispatch ) || + IsEqualGUID( riid, &IID_IUnknown ) ) + { + *ppvObject = iface; + } + else if ( IsEqualGUID( riid, &IID_IXMLDOMNode ) ) + { + return IUnknown_QueryInterface(This->node_unk, riid, ppvObject); + } + else + { + FIXME("Unsupported inteferace %s\n", debugstr_guid(riid)); + return E_NOINTERFACE; + } + + IXMLDOMDocumentFragment_AddRef( iface ); + + return S_OK; +} + +static ULONG WINAPI domfrag_AddRef( + IXMLDOMDocumentFragment *iface ) +{ + domfrag *This = impl_from_IXMLDOMDocumentFragment( iface ); + return InterlockedIncrement( &This->ref ); +} + +static ULONG WINAPI domfrag_Release( + IXMLDOMDocumentFragment *iface ) +{ + domfrag *This = impl_from_IXMLDOMDocumentFragment( iface ); + ULONG ref; + + ref = InterlockedDecrement( &This->ref ); + if ( ref == 0 ) + { + IUnknown_Release( This->node_unk ); + HeapFree( GetProcessHeap(), 0, This ); + } + + return ref; +} + +static HRESULT WINAPI domfrag_GetTypeInfoCount( + IXMLDOMDocumentFragment *iface, + UINT* pctinfo ) +{ + FIXME("\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI domfrag_GetTypeInfo( + IXMLDOMDocumentFragment *iface, + UINT iTInfo, LCID lcid, + ITypeInfo** ppTInfo ) +{ + FIXME("\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI domfrag_GetIDsOfNames( + IXMLDOMDocumentFragment *iface, + REFIID riid, LPOLESTR* rgszNames, + UINT cNames, LCID lcid, DISPID* rgDispId ) +{ + FIXME("\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI domfrag_Invoke( + IXMLDOMDocumentFragment *iface, + DISPID dispIdMember, REFIID riid, LCID lcid, + WORD wFlags, DISPPARAMS* pDispParams, VARIANT* pVarResult, + EXCEPINFO* pExcepInfo, UINT* puArgErr ) +{ + FIXME("\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI domfrag_get_nodeName( + IXMLDOMDocumentFragment *iface, + BSTR* p ) +{ + domfrag *This = impl_from_IXMLDOMDocumentFragment( iface ); + return IXMLDOMNode_get_nodeName( This->node, p ); +} + +static HRESULT WINAPI domfrag_get_nodeValue( + IXMLDOMDocumentFragment *iface, + VARIANT* var1 ) +{ + domfrag *This = impl_from_IXMLDOMDocumentFragment( iface ); + return IXMLDOMNode_get_nodeValue( This->node, var1 ); +} + +static HRESULT WINAPI domfrag_put_nodeValue( + IXMLDOMDocumentFragment *iface, + VARIANT var1 ) +{ + domfrag *This = impl_from_IXMLDOMDocumentFragment( iface ); + return IXMLDOMNode_put_nodeValue( This->node, var1 ); +} + +static HRESULT WINAPI domfrag_get_nodeType( + IXMLDOMDocumentFragment *iface, + DOMNodeType* domNodeType ) +{ + domfrag *This = impl_from_IXMLDOMDocumentFragment( iface ); + return IXMLDOMNode_get_nodeType( This->node, domNodeType ); +} + +static HRESULT WINAPI domfrag_get_parentNode( + IXMLDOMDocumentFragment *iface, + IXMLDOMNode** parent ) +{ + domfrag *This = impl_from_IXMLDOMDocumentFragment( iface ); + return IXMLDOMNode_get_parentNode( This->node, parent ); +} + +static HRESULT WINAPI domfrag_get_childNodes( + IXMLDOMDocumentFragment *iface, + IXMLDOMNodeList** outList) +{ + domfrag *This = impl_from_IXMLDOMDocumentFragment( iface ); + return IXMLDOMNode_get_childNodes( This->node, outList ); +} + +static HRESULT WINAPI domfrag_get_firstChild( + IXMLDOMDocumentFragment *iface, + IXMLDOMNode** domNode) +{ + domfrag *This = impl_from_IXMLDOMDocumentFragment( iface ); + return IXMLDOMNode_get_firstChild( This->node, domNode ); +} + +static HRESULT WINAPI domfrag_get_lastChild( + IXMLDOMDocumentFragment *iface, + IXMLDOMNode** domNode) +{ + domfrag *This = impl_from_IXMLDOMDocumentFragment( iface ); + return IXMLDOMNode_get_lastChild( This->node, domNode ); +} + +static HRESULT WINAPI domfrag_get_previousSibling( + IXMLDOMDocumentFragment *iface, + IXMLDOMNode** domNode) +{ + domfrag *This = impl_from_IXMLDOMDocumentFragment( iface ); + return IXMLDOMNode_get_previousSibling( This->node, domNode ); +} + +static HRESULT WINAPI domfrag_get_nextSibling( + IXMLDOMDocumentFragment *iface, + IXMLDOMNode** domNode) +{ + domfrag *This = impl_from_IXMLDOMDocumentFragment( iface ); + return IXMLDOMNode_get_nextSibling( This->node, domNode ); +} + +static HRESULT WINAPI domfrag_get_attributes( + IXMLDOMDocumentFragment *iface, + IXMLDOMNamedNodeMap** attributeMap) +{ + domfrag *This = impl_from_IXMLDOMDocumentFragment( iface ); + return IXMLDOMNode_get_attributes( This->node, attributeMap ); +} + +static HRESULT WINAPI domfrag_insertBefore( + IXMLDOMDocumentFragment *iface, + IXMLDOMNode* newNode, VARIANT var1, + IXMLDOMNode** outOldNode) +{ + domfrag *This = impl_from_IXMLDOMDocumentFragment( iface ); + return IXMLDOMNode_insertBefore( This->node, newNode, var1, outOldNode ); +} + +static HRESULT WINAPI domfrag_replaceChild( + IXMLDOMDocumentFragment *iface, + IXMLDOMNode* newNode, + IXMLDOMNode* oldNode, + IXMLDOMNode** outOldNode) +{ + domfrag *This = impl_from_IXMLDOMDocumentFragment( iface ); + return IXMLDOMNode_replaceChild( This->node, newNode, oldNode, outOldNode ); +} + +static HRESULT WINAPI domfrag_removeChild( + IXMLDOMDocumentFragment *iface, + IXMLDOMNode* domNode, IXMLDOMNode** oldNode) +{ + domfrag *This = impl_from_IXMLDOMDocumentFragment( iface ); + return IXMLDOMNode_removeChild( This->node, domNode, oldNode ); +} + +static HRESULT WINAPI domfrag_appendChild( + IXMLDOMDocumentFragment *iface, + IXMLDOMNode* newNode, IXMLDOMNode** outNewNode) +{ + domfrag *This = impl_from_IXMLDOMDocumentFragment( iface ); + return IXMLDOMNode_appendChild( This->node, newNode, outNewNode ); +} + +static HRESULT WINAPI domfrag_hasChildNodes( + IXMLDOMDocumentFragment *iface, + VARIANT_BOOL* pbool) +{ + domfrag *This = impl_from_IXMLDOMDocumentFragment( iface ); + return IXMLDOMNode_hasChildNodes( This->node, pbool ); +} + +static HRESULT WINAPI domfrag_get_ownerDocument( + IXMLDOMDocumentFragment *iface, + IXMLDOMDocument** domDocument) +{ + domfrag *This = impl_from_IXMLDOMDocumentFragment( iface ); + return IXMLDOMNode_get_ownerDocument( This->node, domDocument ); +} + +static HRESULT WINAPI domfrag_cloneNode( + IXMLDOMDocumentFragment *iface, + VARIANT_BOOL pbool, IXMLDOMNode** outNode) +{ + domfrag *This = impl_from_IXMLDOMDocumentFragment( iface ); + return IXMLDOMNode_cloneNode( This->node, pbool, outNode ); +} + +static HRESULT WINAPI domfrag_get_nodeTypeString( + IXMLDOMDocumentFragment *iface, + BSTR* p) +{ + domfrag *This = impl_from_IXMLDOMDocumentFragment( iface ); + return IXMLDOMNode_get_nodeTypeString( This->node, p ); +} + +static HRESULT WINAPI domfrag_get_text( + IXMLDOMDocumentFragment *iface, + BSTR* p) +{ + domfrag *This = impl_from_IXMLDOMDocumentFragment( iface ); + return IXMLDOMNode_get_text( This->node, p ); +} + +static HRESULT WINAPI domfrag_put_text( + IXMLDOMDocumentFragment *iface, + BSTR p) +{ + domfrag *This = impl_from_IXMLDOMDocumentFragment( iface ); + return IXMLDOMNode_put_text( This->node, p ); +} + +static HRESULT WINAPI domfrag_get_specified( + IXMLDOMDocumentFragment *iface, + VARIANT_BOOL* pbool) +{ + domfrag *This = impl_from_IXMLDOMDocumentFragment( iface ); + return IXMLDOMNode_get_specified( This->node, pbool ); +} + +static HRESULT WINAPI domfrag_get_definition( + IXMLDOMDocumentFragment *iface, + IXMLDOMNode** domNode) +{ + domfrag *This = impl_from_IXMLDOMDocumentFragment( iface ); + return IXMLDOMNode_get_definition( This->node, domNode ); +} + +static HRESULT WINAPI domfrag_get_nodeTypedValue( + IXMLDOMDocumentFragment *iface, + VARIANT* var1) +{ + domfrag *This = impl_from_IXMLDOMDocumentFragment( iface ); + return IXMLDOMNode_get_nodeTypedValue( This->node, var1 ); +} + +static HRESULT WINAPI domfrag_put_nodeTypedValue( + IXMLDOMDocumentFragment *iface, + VARIANT var1) +{ + domfrag *This = impl_from_IXMLDOMDocumentFragment( iface ); + return IXMLDOMNode_put_nodeTypedValue( This->node, var1 ); +} + +static HRESULT WINAPI domfrag_get_dataType( + IXMLDOMDocumentFragment *iface, + VARIANT* var1) +{ + domfrag *This = impl_from_IXMLDOMDocumentFragment( iface ); + return IXMLDOMNode_get_dataType( This->node, var1 ); +} + +static HRESULT WINAPI domfrag_put_dataType( + IXMLDOMDocumentFragment *iface, + BSTR p) +{ + domfrag *This = impl_from_IXMLDOMDocumentFragment( iface ); + return IXMLDOMNode_put_dataType( This->node, p ); +} + +static HRESULT WINAPI domfrag_get_xml( + IXMLDOMDocumentFragment *iface, + BSTR* p) +{ + domfrag *This = impl_from_IXMLDOMDocumentFragment( iface ); + return IXMLDOMNode_get_xml( This->node, p ); +} + +static HRESULT WINAPI domfrag_transformNode( + IXMLDOMDocumentFragment *iface, + IXMLDOMNode* domNode, BSTR* p) +{ + domfrag *This = impl_from_IXMLDOMDocumentFragment( iface ); + return IXMLDOMNode_transformNode( This->node, domNode, p ); +} + +static HRESULT WINAPI domfrag_selectNodes( + IXMLDOMDocumentFragment *iface, + BSTR p, IXMLDOMNodeList** outList) +{ + domfrag *This = impl_from_IXMLDOMDocumentFragment( iface ); + return IXMLDOMNode_selectNodes( This->node, p, outList ); +} + +static HRESULT WINAPI domfrag_selectSingleNode( + IXMLDOMDocumentFragment *iface, + BSTR p, IXMLDOMNode** outNode) +{ + domfrag *This = impl_from_IXMLDOMDocumentFragment( iface ); + return IXMLDOMNode_selectSingleNode( This->node, p, outNode ); +} + +static HRESULT WINAPI domfrag_get_parsed( + IXMLDOMDocumentFragment *iface, + VARIANT_BOOL* pbool) +{ + domfrag *This = impl_from_IXMLDOMDocumentFragment( iface ); + return IXMLDOMNode_get_parsed( This->node, pbool ); +} + +static HRESULT WINAPI domfrag_get_namespaceURI( + IXMLDOMDocumentFragment *iface, + BSTR* p) +{ + domfrag *This = impl_from_IXMLDOMDocumentFragment( iface ); + return IXMLDOMNode_get_namespaceURI( This->node, p ); +} + +static HRESULT WINAPI domfrag_get_prefix( + IXMLDOMDocumentFragment *iface, + BSTR* p) +{ + domfrag *This = impl_from_IXMLDOMDocumentFragment( iface ); + return IXMLDOMNode_get_prefix( This->node, p ); +} + +static HRESULT WINAPI domfrag_get_baseName( + IXMLDOMDocumentFragment *iface, + BSTR* p) +{ + domfrag *This = impl_from_IXMLDOMDocumentFragment( iface ); + return IXMLDOMNode_get_baseName( This->node, p ); +} + +static HRESULT WINAPI domfrag_transformNodeToObject( + IXMLDOMDocumentFragment *iface, + IXMLDOMNode* domNode, VARIANT var1) +{ + domfrag *This = impl_from_IXMLDOMDocumentFragment( iface ); + return IXMLDOMNode_transformNodeToObject( This->node, domNode, var1 ); +} + +static const struct IXMLDOMDocumentFragmentVtbl domfrag_vtbl = +{ + domfrag_QueryInterface, + domfrag_AddRef, + domfrag_Release, + domfrag_GetTypeInfoCount, + domfrag_GetTypeInfo, + domfrag_GetIDsOfNames, + domfrag_Invoke, + domfrag_get_nodeName, + domfrag_get_nodeValue, + domfrag_put_nodeValue, + domfrag_get_nodeType, + domfrag_get_parentNode, + domfrag_get_childNodes, + domfrag_get_firstChild, + domfrag_get_lastChild, + domfrag_get_previousSibling, + domfrag_get_nextSibling, + domfrag_get_attributes, + domfrag_insertBefore, + domfrag_replaceChild, + domfrag_removeChild, + domfrag_appendChild, + domfrag_hasChildNodes, + domfrag_get_ownerDocument, + domfrag_cloneNode, + domfrag_get_nodeTypeString, + domfrag_get_text, + domfrag_put_text, + domfrag_get_specified, + domfrag_get_definition, + domfrag_get_nodeTypedValue, + domfrag_put_nodeTypedValue, + domfrag_get_dataType, + domfrag_put_dataType, + domfrag_get_xml, + domfrag_transformNode, + domfrag_selectNodes, + domfrag_selectSingleNode, + domfrag_get_parsed, + domfrag_get_namespaceURI, + domfrag_get_prefix, + domfrag_get_baseName, + domfrag_transformNodeToObject +}; + +IUnknown* create_doc_fragment( xmlNodePtr fragment ) +{ + domfrag *This; + HRESULT hr; + + This = HeapAlloc( GetProcessHeap(), 0, sizeof *This ); + if ( !This ) + return NULL; + + This->lpVtbl = &domfrag_vtbl; + This->ref = 1; + + This->node_unk = create_basic_node( fragment, (IUnknown*)&This->lpVtbl ); + if(!This->node_unk) + { + HeapFree(GetProcessHeap(), 0, This); + return NULL; + } + + hr = IUnknown_QueryInterface(This->node_unk, &IID_IXMLDOMNode, (LPVOID*)&This->node); + if(FAILED(hr)) + { + IUnknown_Release(This->node_unk); + HeapFree( GetProcessHeap(), 0, This ); + return NULL; + } + /* The ref on This->node is actually looped back into this object, so release it */ + IXMLDOMNode_Release(This->node); + + return (IUnknown*) &This->lpVtbl; +} + +#endif diff --git a/dlls/msxml3/domdoc.c b/dlls/msxml3/domdoc.c index 6a5b7a45c0c..cb639227268 100644 --- a/dlls/msxml3/domdoc.c +++ b/dlls/msxml3/domdoc.c @@ -354,13 +354,13 @@ static HRESULT WINAPI domdoc_QueryInterface( IXMLDOMDocument2 *iface, REFIID rii *ppvObject = NULL; if ( IsEqualGUID( riid, &IID_IUnknown ) || + IsEqualGUID( riid, &IID_IDispatch ) || IsEqualGUID( riid, &IID_IXMLDOMDocument ) || IsEqualGUID( riid, &IID_IXMLDOMDocument2 ) ) { *ppvObject = iface; } - else if ( IsEqualGUID( riid, &IID_IXMLDOMNode ) || - IsEqualGUID( riid, &IID_IDispatch ) ) + else if ( IsEqualGUID( riid, &IID_IXMLDOMNode ) ) { return IUnknown_QueryInterface(This->node_unk, riid, ppvObject); } @@ -885,8 +885,26 @@ static HRESULT WINAPI domdoc_createDocumentFragment( IXMLDOMDocument2 *iface, IXMLDOMDocumentFragment** docFrag ) { - FIXME("\n"); - return E_NOTIMPL; + domdoc *This = impl_from_IXMLDOMDocument2( iface ); + xmlNodePtr xmlnode; + + TRACE("%p\n", iface); + + if(!docFrag) + return E_INVALIDARG; + + *docFrag = NULL; + + xmlnode = xmlNewDocFragment(get_doc( This ) ); + + if(!xmlnode) + return E_FAIL; + + xmlnode->doc = get_doc( This ); + + *docFrag = (IXMLDOMDocumentFragment*)create_doc_fragment(xmlnode); + + return S_OK; } @@ -1056,8 +1074,29 @@ static HRESULT WINAPI domdoc_createEntityReference( BSTR name, IXMLDOMEntityReference** entityRef ) { - FIXME("\n"); - return E_NOTIMPL; + domdoc *This = impl_from_IXMLDOMDocument2( iface ); + xmlNodePtr xmlnode; + xmlChar *xml_name; + + TRACE("%p\n", iface); + + if(!entityRef) + return E_INVALIDARG; + + *entityRef = NULL; + + xml_name = xmlChar_from_wchar((WCHAR*)name); + xmlnode = xmlNewReference(get_doc( This ), xml_name ); + HeapFree(GetProcessHeap(), 0, xml_name); + + if(!xmlnode) + return E_FAIL; + + xmlnode->doc = get_doc( This ); + + *entityRef = (IXMLDOMEntityReference*)create_doc_entity_ref(xmlnode); + + return S_OK; } diff --git a/dlls/msxml3/domimpl.c b/dlls/msxml3/domimpl.c index 83f949bfc75..c8afd6d08f0 100644 --- a/dlls/msxml3/domimpl.c +++ b/dlls/msxml3/domimpl.c @@ -64,7 +64,7 @@ static HRESULT WINAPI dimimpl_QueryInterface( } else { - FIXME("Unsupported inteferace %s\n", debugstr_guid(riid)); + FIXME("Unsupported interface %s\n", debugstr_guid(riid)); return E_NOINTERFACE; } diff --git a/dlls/msxml3/element.c b/dlls/msxml3/element.c index 814a9875eb1..ba012473d76 100644 --- a/dlls/msxml3/element.c +++ b/dlls/msxml3/element.c @@ -652,12 +652,12 @@ static HRESULT WINAPI Internal_QueryInterface( TRACE("%p %s %p\n", This, debugstr_guid(riid), ppvObject); if ( IsEqualGUID( riid, &IID_IXMLDOMElement ) || + IsEqualGUID( riid, &IID_IDispatch ) || IsEqualGUID( riid, &IID_IUnknown ) ) { *ppvObject = &This->lpVtbl; } - else if ( IsEqualGUID( riid, &IID_IDispatch ) || - IsEqualGUID( riid, &IID_IXMLDOMNode ) ) + else if ( IsEqualGUID( riid, &IID_IXMLDOMNode ) ) { return IUnknown_QueryInterface(This->node_unk, riid, ppvObject); } diff --git a/dlls/msxml3/entityref.c b/dlls/msxml3/entityref.c new file mode 100644 index 00000000000..8902152bb15 --- /dev/null +++ b/dlls/msxml3/entityref.c @@ -0,0 +1,511 @@ +/* + * DOM Entity Reference implementation + * + * Copyright 2007 Alistair Leslie-Hughes + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define COBJMACROS + +#include "config.h" + +#include +#include "windef.h" +#include "winbase.h" +#include "winuser.h" +#include "ole2.h" +#include "msxml2.h" + +#include "msxml_private.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(msxml); + +#ifdef HAVE_LIBXML2 + +typedef struct _entityref +{ + const struct IXMLDOMEntityReferenceVtbl *lpVtbl; + LONG ref; + IUnknown *node_unk; + IXMLDOMNode *node; +} entityref; + +static inline entityref *impl_from_IXMLDOMEntityReference( IXMLDOMEntityReference *iface ) +{ + return (entityref *)((char*)iface - FIELD_OFFSET(entityref, lpVtbl)); +} + +static HRESULT WINAPI entityref_QueryInterface( + IXMLDOMEntityReference *iface, + REFIID riid, + void** ppvObject ) +{ + entityref *This = impl_from_IXMLDOMEntityReference( iface ); + TRACE("%p %s %p\n", This, debugstr_guid(riid), ppvObject); + + if ( IsEqualGUID( riid, &IID_IXMLDOMEntityReference ) || + IsEqualGUID( riid, &IID_IDispatch ) || + IsEqualGUID( riid, &IID_IUnknown ) ) + { + *ppvObject = iface; + } + else if ( IsEqualGUID( riid, &IID_IXMLDOMNode ) ) + { + return IUnknown_QueryInterface(This->node_unk, riid, ppvObject); + } + else + { + FIXME("Unsupported inteferace %s\n", debugstr_guid(riid)); + return E_NOINTERFACE; + } + + IXMLDOMEntityReference_AddRef( iface ); + + return S_OK; +} + +static ULONG WINAPI entityref_AddRef( + IXMLDOMEntityReference *iface ) +{ + entityref *This = impl_from_IXMLDOMEntityReference( iface ); + return InterlockedIncrement( &This->ref ); +} + +static ULONG WINAPI entityref_Release( + IXMLDOMEntityReference *iface ) +{ + entityref *This = impl_from_IXMLDOMEntityReference( iface ); + ULONG ref; + + ref = InterlockedDecrement( &This->ref ); + if ( ref == 0 ) + { + IUnknown_Release( This->node_unk ); + HeapFree( GetProcessHeap(), 0, This ); + } + + return ref; +} + +static HRESULT WINAPI entityref_GetTypeInfoCount( + IXMLDOMEntityReference *iface, + UINT* pctinfo ) +{ + FIXME("\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI entityref_GetTypeInfo( + IXMLDOMEntityReference *iface, + UINT iTInfo, LCID lcid, + ITypeInfo** ppTInfo ) +{ + FIXME("\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI entityref_GetIDsOfNames( + IXMLDOMEntityReference *iface, + REFIID riid, LPOLESTR* rgszNames, + UINT cNames, LCID lcid, DISPID* rgDispId ) +{ + FIXME("\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI entityref_Invoke( + IXMLDOMEntityReference *iface, + DISPID dispIdMember, REFIID riid, LCID lcid, + WORD wFlags, DISPPARAMS* pDispParams, VARIANT* pVarResult, + EXCEPINFO* pExcepInfo, UINT* puArgErr ) +{ + FIXME("\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI entityref_get_nodeName( + IXMLDOMEntityReference *iface, + BSTR* p ) +{ + entityref *This = impl_from_IXMLDOMEntityReference( iface ); + return IXMLDOMNode_get_nodeName( This->node, p ); +} + +static HRESULT WINAPI entityref_get_nodeValue( + IXMLDOMEntityReference *iface, + VARIANT* var1 ) +{ + entityref *This = impl_from_IXMLDOMEntityReference( iface ); + return IXMLDOMNode_get_nodeValue( This->node, var1 ); +} + +static HRESULT WINAPI entityref_put_nodeValue( + IXMLDOMEntityReference *iface, + VARIANT var1 ) +{ + entityref *This = impl_from_IXMLDOMEntityReference( iface ); + return IXMLDOMNode_put_nodeValue( This->node, var1 ); +} + +static HRESULT WINAPI entityref_get_nodeType( + IXMLDOMEntityReference *iface, + DOMNodeType* domNodeType ) +{ + entityref *This = impl_from_IXMLDOMEntityReference( iface ); + return IXMLDOMNode_get_nodeType( This->node, domNodeType ); +} + +static HRESULT WINAPI entityref_get_parentNode( + IXMLDOMEntityReference *iface, + IXMLDOMNode** parent ) +{ + entityref *This = impl_from_IXMLDOMEntityReference( iface ); + return IXMLDOMNode_get_parentNode( This->node, parent ); +} + +static HRESULT WINAPI entityref_get_childNodes( + IXMLDOMEntityReference *iface, + IXMLDOMNodeList** outList) +{ + entityref *This = impl_from_IXMLDOMEntityReference( iface ); + return IXMLDOMNode_get_childNodes( This->node, outList ); +} + +static HRESULT WINAPI entityref_get_firstChild( + IXMLDOMEntityReference *iface, + IXMLDOMNode** domNode) +{ + entityref *This = impl_from_IXMLDOMEntityReference( iface ); + return IXMLDOMNode_get_firstChild( This->node, domNode ); +} + +static HRESULT WINAPI entityref_get_lastChild( + IXMLDOMEntityReference *iface, + IXMLDOMNode** domNode) +{ + entityref *This = impl_from_IXMLDOMEntityReference( iface ); + return IXMLDOMNode_get_lastChild( This->node, domNode ); +} + +static HRESULT WINAPI entityref_get_previousSibling( + IXMLDOMEntityReference *iface, + IXMLDOMNode** domNode) +{ + entityref *This = impl_from_IXMLDOMEntityReference( iface ); + return IXMLDOMNode_get_previousSibling( This->node, domNode ); +} + +static HRESULT WINAPI entityref_get_nextSibling( + IXMLDOMEntityReference *iface, + IXMLDOMNode** domNode) +{ + entityref *This = impl_from_IXMLDOMEntityReference( iface ); + return IXMLDOMNode_get_nextSibling( This->node, domNode ); +} + +static HRESULT WINAPI entityref_get_attributes( + IXMLDOMEntityReference *iface, + IXMLDOMNamedNodeMap** attributeMap) +{ + entityref *This = impl_from_IXMLDOMEntityReference( iface ); + return IXMLDOMNode_get_attributes( This->node, attributeMap ); +} + +static HRESULT WINAPI entityref_insertBefore( + IXMLDOMEntityReference *iface, + IXMLDOMNode* newNode, VARIANT var1, + IXMLDOMNode** outOldNode) +{ + entityref *This = impl_from_IXMLDOMEntityReference( iface ); + return IXMLDOMNode_insertBefore( This->node, newNode, var1, outOldNode ); +} + +static HRESULT WINAPI entityref_replaceChild( + IXMLDOMEntityReference *iface, + IXMLDOMNode* newNode, + IXMLDOMNode* oldNode, + IXMLDOMNode** outOldNode) +{ + entityref *This = impl_from_IXMLDOMEntityReference( iface ); + return IXMLDOMNode_replaceChild( This->node, newNode, oldNode, outOldNode ); +} + +static HRESULT WINAPI entityref_removeChild( + IXMLDOMEntityReference *iface, + IXMLDOMNode* domNode, IXMLDOMNode** oldNode) +{ + entityref *This = impl_from_IXMLDOMEntityReference( iface ); + return IXMLDOMNode_removeChild( This->node, domNode, oldNode ); +} + +static HRESULT WINAPI entityref_appendChild( + IXMLDOMEntityReference *iface, + IXMLDOMNode* newNode, IXMLDOMNode** outNewNode) +{ + entityref *This = impl_from_IXMLDOMEntityReference( iface ); + return IXMLDOMNode_appendChild( This->node, newNode, outNewNode ); +} + +static HRESULT WINAPI entityref_hasChildNodes( + IXMLDOMEntityReference *iface, + VARIANT_BOOL* pbool) +{ + entityref *This = impl_from_IXMLDOMEntityReference( iface ); + return IXMLDOMNode_hasChildNodes( This->node, pbool ); +} + +static HRESULT WINAPI entityref_get_ownerDocument( + IXMLDOMEntityReference *iface, + IXMLDOMDocument** domDocument) +{ + entityref *This = impl_from_IXMLDOMEntityReference( iface ); + return IXMLDOMNode_get_ownerDocument( This->node, domDocument ); +} + +static HRESULT WINAPI entityref_cloneNode( + IXMLDOMEntityReference *iface, + VARIANT_BOOL pbool, IXMLDOMNode** outNode) +{ + entityref *This = impl_from_IXMLDOMEntityReference( iface ); + return IXMLDOMNode_cloneNode( This->node, pbool, outNode ); +} + +static HRESULT WINAPI entityref_get_nodeTypeString( + IXMLDOMEntityReference *iface, + BSTR* p) +{ + entityref *This = impl_from_IXMLDOMEntityReference( iface ); + return IXMLDOMNode_get_nodeTypeString( This->node, p ); +} + +static HRESULT WINAPI entityref_get_text( + IXMLDOMEntityReference *iface, + BSTR* p) +{ + entityref *This = impl_from_IXMLDOMEntityReference( iface ); + return IXMLDOMNode_get_text( This->node, p ); +} + +static HRESULT WINAPI entityref_put_text( + IXMLDOMEntityReference *iface, + BSTR p) +{ + entityref *This = impl_from_IXMLDOMEntityReference( iface ); + return IXMLDOMNode_put_text( This->node, p ); +} + +static HRESULT WINAPI entityref_get_specified( + IXMLDOMEntityReference *iface, + VARIANT_BOOL* pbool) +{ + entityref *This = impl_from_IXMLDOMEntityReference( iface ); + return IXMLDOMNode_get_specified( This->node, pbool ); +} + +static HRESULT WINAPI entityref_get_definition( + IXMLDOMEntityReference *iface, + IXMLDOMNode** domNode) +{ + entityref *This = impl_from_IXMLDOMEntityReference( iface ); + return IXMLDOMNode_get_definition( This->node, domNode ); +} + +static HRESULT WINAPI entityref_get_nodeTypedValue( + IXMLDOMEntityReference *iface, + VARIANT* var1) +{ + entityref *This = impl_from_IXMLDOMEntityReference( iface ); + return IXMLDOMNode_get_nodeTypedValue( This->node, var1 ); +} + +static HRESULT WINAPI entityref_put_nodeTypedValue( + IXMLDOMEntityReference *iface, + VARIANT var1) +{ + entityref *This = impl_from_IXMLDOMEntityReference( iface ); + return IXMLDOMNode_put_nodeTypedValue( This->node, var1 ); +} + +static HRESULT WINAPI entityref_get_dataType( + IXMLDOMEntityReference *iface, + VARIANT* var1) +{ + entityref *This = impl_from_IXMLDOMEntityReference( iface ); + return IXMLDOMNode_get_dataType( This->node, var1 ); +} + +static HRESULT WINAPI entityref_put_dataType( + IXMLDOMEntityReference *iface, + BSTR p) +{ + entityref *This = impl_from_IXMLDOMEntityReference( iface ); + return IXMLDOMNode_put_dataType( This->node, p ); +} + +static HRESULT WINAPI entityref_get_xml( + IXMLDOMEntityReference *iface, + BSTR* p) +{ + entityref *This = impl_from_IXMLDOMEntityReference( iface ); + return IXMLDOMNode_get_xml( This->node, p ); +} + +static HRESULT WINAPI entityref_transformNode( + IXMLDOMEntityReference *iface, + IXMLDOMNode* domNode, BSTR* p) +{ + entityref *This = impl_from_IXMLDOMEntityReference( iface ); + return IXMLDOMNode_transformNode( This->node, domNode, p ); +} + +static HRESULT WINAPI entityref_selectNodes( + IXMLDOMEntityReference *iface, + BSTR p, IXMLDOMNodeList** outList) +{ + entityref *This = impl_from_IXMLDOMEntityReference( iface ); + return IXMLDOMNode_selectNodes( This->node, p, outList ); +} + +static HRESULT WINAPI entityref_selectSingleNode( + IXMLDOMEntityReference *iface, + BSTR p, IXMLDOMNode** outNode) +{ + entityref *This = impl_from_IXMLDOMEntityReference( iface ); + return IXMLDOMNode_selectSingleNode( This->node, p, outNode ); +} + +static HRESULT WINAPI entityref_get_parsed( + IXMLDOMEntityReference *iface, + VARIANT_BOOL* pbool) +{ + entityref *This = impl_from_IXMLDOMEntityReference( iface ); + return IXMLDOMNode_get_parsed( This->node, pbool ); +} + +static HRESULT WINAPI entityref_get_namespaceURI( + IXMLDOMEntityReference *iface, + BSTR* p) +{ + entityref *This = impl_from_IXMLDOMEntityReference( iface ); + return IXMLDOMNode_get_namespaceURI( This->node, p ); +} + +static HRESULT WINAPI entityref_get_prefix( + IXMLDOMEntityReference *iface, + BSTR* p) +{ + entityref *This = impl_from_IXMLDOMEntityReference( iface ); + return IXMLDOMNode_get_prefix( This->node, p ); +} + +static HRESULT WINAPI entityref_get_baseName( + IXMLDOMEntityReference *iface, + BSTR* p) +{ + entityref *This = impl_from_IXMLDOMEntityReference( iface ); + return IXMLDOMNode_get_baseName( This->node, p ); +} + +static HRESULT WINAPI entityref_transformNodeToObject( + IXMLDOMEntityReference *iface, + IXMLDOMNode* domNode, VARIANT var1) +{ + entityref *This = impl_from_IXMLDOMEntityReference( iface ); + return IXMLDOMNode_transformNodeToObject( This->node, domNode, var1 ); +} + +static const struct IXMLDOMEntityReferenceVtbl entityref_vtbl = +{ + entityref_QueryInterface, + entityref_AddRef, + entityref_Release, + entityref_GetTypeInfoCount, + entityref_GetTypeInfo, + entityref_GetIDsOfNames, + entityref_Invoke, + entityref_get_nodeName, + entityref_get_nodeValue, + entityref_put_nodeValue, + entityref_get_nodeType, + entityref_get_parentNode, + entityref_get_childNodes, + entityref_get_firstChild, + entityref_get_lastChild, + entityref_get_previousSibling, + entityref_get_nextSibling, + entityref_get_attributes, + entityref_insertBefore, + entityref_replaceChild, + entityref_removeChild, + entityref_appendChild, + entityref_hasChildNodes, + entityref_get_ownerDocument, + entityref_cloneNode, + entityref_get_nodeTypeString, + entityref_get_text, + entityref_put_text, + entityref_get_specified, + entityref_get_definition, + entityref_get_nodeTypedValue, + entityref_put_nodeTypedValue, + entityref_get_dataType, + entityref_put_dataType, + entityref_get_xml, + entityref_transformNode, + entityref_selectNodes, + entityref_selectSingleNode, + entityref_get_parsed, + entityref_get_namespaceURI, + entityref_get_prefix, + entityref_get_baseName, + entityref_transformNodeToObject, +}; + +IUnknown* create_doc_entity_ref( xmlNodePtr entity ) +{ + entityref *This; + HRESULT hr; + + This = HeapAlloc( GetProcessHeap(), 0, sizeof *This ); + if ( !This ) + return NULL; + + This->lpVtbl = &entityref_vtbl; + This->ref = 1; + + This->node_unk = create_basic_node( entity, (IUnknown*)&This->lpVtbl ); + if(!This->node_unk) + { + HeapFree(GetProcessHeap(), 0, This); + return NULL; + } + + hr = IUnknown_QueryInterface(This->node_unk, &IID_IXMLDOMNode, (LPVOID*)&This->node); + if(FAILED(hr)) + { + IUnknown_Release(This->node_unk); + HeapFree( GetProcessHeap(), 0, This ); + return NULL; + } + /* The ref on This->node is actually looped back into this object, so release it */ + IXMLDOMNode_Release(This->node); + + return (IUnknown*) &This->lpVtbl; +} + +#endif diff --git a/programs/write/rsrc.rc b/dlls/msxml3/msxml3_v1.idl similarity index 79% copy from programs/write/rsrc.rc copy to dlls/msxml3/msxml3_v1.idl index a854b1a52ca..d80833fafb6 100644 --- a/programs/write/rsrc.rc +++ b/dlls/msxml3/msxml3_v1.idl @@ -1,5 +1,5 @@ /* - * Copyright 2007 Mikolaj Zalewski + * Copyright 2007 Alistair Leslie-Hughes * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -16,13 +16,4 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include - -#include "resources.h" - -LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL - -#include "En.rc" -#include "Fr.rc" -#include "Ko.rc" -#include "No.rc" +#include "msxml2.idl" diff --git a/dlls/msxml3/msxml_private.h b/dlls/msxml3/msxml_private.h index 620fba83b24..33b2c9efe9c 100644 --- a/dlls/msxml3/msxml_private.h +++ b/dlls/msxml3/msxml_private.h @@ -45,6 +45,8 @@ extern IUnknown *create_cdata( xmlNodePtr text ); extern IXMLDOMNodeList *create_children_nodelist( xmlNodePtr ); extern IXMLDOMNamedNodeMap *create_nodemap( IXMLDOMNode *node ); extern IUnknown *create_doc_Implementation(); +extern IUnknown *create_doc_fragment( xmlNodePtr fragment ); +extern IUnknown *create_doc_entity_ref( xmlNodePtr entity ); extern HRESULT queryresult_create( xmlNodePtr, LPWSTR, IXMLDOMNodeList ** ); diff --git a/dlls/msxml3/node.c b/dlls/msxml3/node.c index dc530786188..9d43c093157 100644 --- a/dlls/msxml3/node.c +++ b/dlls/msxml3/node.c @@ -422,6 +422,7 @@ static HRESULT WINAPI xmlnode_get_attributes( case XML_DOCUMENT_NODE: case XML_DOCUMENT_FRAG_NODE: case XML_ENTITY_NODE: + case XML_ENTITY_REF_NODE: case XML_TEXT_NODE: *attributeMap = NULL; return S_FALSE; diff --git a/dlls/msxml3/pi.c b/dlls/msxml3/pi.c index ec707464263..054d7f852b5 100644 --- a/dlls/msxml3/pi.c +++ b/dlls/msxml3/pi.c @@ -59,12 +59,12 @@ static HRESULT WINAPI dom_pi_QueryInterface( TRACE("%p %s %p\n", This, debugstr_guid(riid), ppvObject); if ( IsEqualGUID( riid, &IID_IXMLDOMProcessingInstruction ) || + IsEqualGUID( riid, &IID_IDispatch ) || IsEqualGUID( riid, &IID_IUnknown ) ) { *ppvObject = iface; } - else if ( IsEqualGUID( riid, &IID_IDispatch ) || - IsEqualGUID( riid, &IID_IXMLDOMNode ) ) + else if ( IsEqualGUID( riid, &IID_IXMLDOMNode ) ) { return IUnknown_QueryInterface(This->node_unk, riid, ppvObject); } diff --git a/dlls/msxml3/tests/domdoc.c b/dlls/msxml3/tests/domdoc.c index 7f5f527d035..4507d08710b 100644 --- a/dlls/msxml3/tests/domdoc.c +++ b/dlls/msxml3/tests/domdoc.c @@ -154,6 +154,10 @@ static WCHAR szCDataXML[] = {'<','!','[','C','D','A','T','A','[','[','1',']','*' 'g','e','e',' ','t','h','a','t','s',' ','n','o','t',' ','r','i','g','h','t', '!',']',']','>',0}; static WCHAR szCDataNodeText[] = {'#','c','d','a','t','a','-','s','e','c','t','i','o','n',0 }; +static WCHAR szDocFragmentText[] = {'#','d','o','c','u','m','e','n','t','-','f','r','a','g','m','e','n','t',0 }; + +static WCHAR szEntityRef[] = {'E','n','t','i','t','y','r','e','f',0 }; +static WCHAR szEntityRefXML[] = {'&','e','n','t','i','t','y','r','e','f',';',0 }; #define expect_bstr_eq_and_free(bstr, expect) { \ BSTR bstrExp = alloc_str_from_narrow(expect); \ @@ -1873,6 +1877,8 @@ static void test_xmlTypes(void) IXMLDOMNamedNodeMap *pAttribs; IXMLDOMCDATASection *pCDataSec; IXMLDOMImplementation *pIXMLDOMImplementation = NULL; + IXMLDOMDocumentFragment *pDocFrag = NULL; + IXMLDOMEntityReference *pEntityRef = NULL; BSTR str; IXMLDOMNode *pNextChild = (IXMLDOMNode *)0x1; /* Used for testing Siblings */ VARIANT v; @@ -2194,7 +2200,109 @@ static void test_xmlTypes(void) IXMLDOMCDATASection_Release(pCDataSec); } + /* Document Fragments */ + hr = IXMLDOMDocument_createDocumentFragment(doc, NULL); + ok(hr == E_INVALIDARG, "ret %08x\n", hr ); + + hr = IXMLDOMDocument_createDocumentFragment(doc, &pDocFrag); + ok(hr == S_OK, "ret %08x\n", hr ); + if(hr == S_OK) + { + IXMLDOMNode *pNextChild = (IXMLDOMNode *)0x1; + + hr = IXMLDOMElement_appendChild(pRoot, (IXMLDOMNode*)pDocFrag, NULL); + ok(hr == S_OK, "ret %08x\n", hr ); + + /* get Attribute Tests */ + hr = IXMLDOMDocumentFragment_get_attributes(pDocFrag, NULL); + ok(hr == E_INVALIDARG, "ret %08x\n", hr ); + + pAttribs = (IXMLDOMNamedNodeMap*)0x1; + hr = IXMLDOMDocumentFragment_get_attributes(pDocFrag, &pAttribs); + ok(hr == S_FALSE, "ret %08x\n", hr ); + ok(pAttribs == NULL, "pAttribs != NULL\n"); + + hr = IXMLDOMDocumentFragment_get_nodeName(pDocFrag, &str); + ok(hr == S_OK, "ret %08x\n", hr ); + ok( !lstrcmpW( str, szDocFragmentText ), "incorrect docfragment node Name\n"); + SysFreeString(str); + + /* test next Sibling*/ + hr = IXMLDOMDocumentFragment_get_nextSibling(pDocFrag, NULL); + ok(hr == E_INVALIDARG, "ret %08x\n", hr ); + + pNextChild = (IXMLDOMNode *)0x1; + hr = IXMLDOMDocumentFragment_get_nextSibling(pDocFrag, &pNextChild); + ok(hr == S_FALSE, "ret %08x\n", hr ); + ok(pNextChild == NULL, "pNextChild not NULL\n"); + + /* test Previous Sibling*/ + hr = IXMLDOMDocumentFragment_get_previousSibling(pDocFrag, NULL); + ok(hr == E_INVALIDARG, "ret %08x\n", hr ); + + pNextChild = (IXMLDOMNode *)0x1; + hr = IXMLDOMDocumentFragment_get_previousSibling(pDocFrag, &pNextChild); + ok(hr == S_FALSE, "ret %08x\n", hr ); + ok(pNextChild == NULL, "pNextChild not NULL\n"); + + /* test get_dataType */ + hr = IXMLDOMDocumentFragment_get_dataType(pDocFrag, NULL); + ok(hr == E_INVALIDARG, "ret %08x\n", hr ); + + hr = IXMLDOMDocumentFragment_get_dataType(pDocFrag, &v); + ok(hr == S_FALSE, "ret %08x\n", hr ); + ok( V_VT(&v) == VT_NULL, "incorrect dataType type\n"); + VariantClear(&v); + + /* test nodeTypeString */ + hr = IXMLDOMDocumentFragment_get_nodeTypeString(pDocFrag, &str); + ok(hr == S_OK, "ret %08x\n", hr ); + ok( !lstrcmpW( str, _bstr_("documentfragment") ), "incorrect nodeTypeString string\n"); + SysFreeString(str); + + IXMLDOMDocumentFragment_Release(pCDataSec); + } + + /* Entity References */ + hr = IXMLDOMDocument_createEntityReference(doc, szEntityRef, NULL); + ok(hr == E_INVALIDARG, "ret %08x\n", hr ); + + hr = IXMLDOMDocument_createEntityReference(doc, szEntityRef, &pEntityRef); + ok(hr == S_OK, "ret %08x\n", hr ); + if(hr == S_OK) + { + hr = IXMLDOMElement_appendChild(pRoot, (IXMLDOMNode*)pEntityRef, NULL); + ok(hr == S_OK, "ret %08x\n", hr ); + + /* get Attribute Tests */ + hr = IXMLDOMEntityReference_get_attributes(pEntityRef, NULL); + ok(hr == E_INVALIDARG, "ret %08x\n", hr ); + + pAttribs = (IXMLDOMNamedNodeMap*)0x1; + hr = IXMLDOMEntityReference_get_attributes(pEntityRef, &pAttribs); + ok(hr == S_FALSE, "ret %08x\n", hr ); + ok(pAttribs == NULL, "pAttribs != NULL\n"); + + /* test dataType */ + hr = IXMLDOMEntityReference_get_dataType(pEntityRef, &v); + ok(hr == S_FALSE, "ret %08x\n", hr ); + ok( V_VT(&v) == VT_NULL, "incorrect dataType type\n"); + VariantClear(&v); + /* test nodeTypeString */ + hr = IXMLDOMEntityReference_get_nodeTypeString(pEntityRef, &str); + ok(hr == S_OK, "ret %08x\n", hr ); + ok( !lstrcmpW( str, _bstr_("entityreference") ), "incorrect nodeTypeString string\n"); + SysFreeString(str); + + /* test get_xml*/ + hr = IXMLDOMEntityReference_get_xml(pEntityRef, &str); + ok(hr == S_OK, "ret %08x\n", hr ); + todo_wine ok( !lstrcmpW( str, szEntityRefXML ), "incorrect xml string\n"); + SysFreeString(str); + + IXMLDOMEntityReference_Release(pEntityRef); + } IXMLDOMElement_Release( pRoot ); } diff --git a/dlls/msxml3/text.c b/dlls/msxml3/text.c index 7c0f42e0324..0d402a44ab6 100644 --- a/dlls/msxml3/text.c +++ b/dlls/msxml3/text.c @@ -59,12 +59,12 @@ static HRESULT WINAPI domtext_QueryInterface( TRACE("%p %s %p\n", This, debugstr_guid(riid), ppvObject); if ( IsEqualGUID( riid, &IID_IXMLDOMText ) || + IsEqualGUID( riid, &IID_IDispatch ) || IsEqualGUID( riid, &IID_IUnknown ) ) { *ppvObject = iface; } - else if ( IsEqualGUID( riid, &IID_IDispatch ) || - IsEqualGUID( riid, &IID_IXMLDOMNode ) || + else if ( IsEqualGUID( riid, &IID_IXMLDOMNode ) || IsEqualGUID( riid, &IID_IXMLDOMElement ) ) { return IUnknown_QueryInterface(This->element_unk, riid, ppvObject); diff --git a/dlls/msxml3/version.rc b/dlls/msxml3/version.rc index a035174b48a..0d82c311d1e 100644 --- a/dlls/msxml3/version.rc +++ b/dlls/msxml3/version.rc @@ -14,6 +14,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +1 TYPELIB LOADONCALL DISCARDABLE msxml3_v1.tlb + #define WINE_OLESELFREGISTER #define WINE_FILEDESCRIPTION_STR "Wine MSXML 3.0" #define WINE_FILENAME_STR "msxml3.dll" diff --git a/dlls/ntdll/sec.c b/dlls/ntdll/sec.c index 5a1fe89a384..ea24414882a 100644 --- a/dlls/ntdll/sec.c +++ b/dlls/ntdll/sec.c @@ -1341,7 +1341,7 @@ NTSTATUS WINAPI RtlGetAce(PACL pAcl,DWORD dwAceIndex,LPVOID *pAce ) TRACE("(%p,%d,%p)\n",pAcl,dwAceIndex,pAce); - if (dwAceIndex > pAcl->AceCount) + if (dwAceIndex >= pAcl->AceCount) return STATUS_INVALID_PARAMETER; ace = (PACE_HEADER)(pAcl + 1); diff --git a/dlls/ntdll/serial.c b/dlls/ntdll/serial.c index 6866b952dac..c54d70696e6 100644 --- a/dlls/ntdll/serial.c +++ b/dlls/ntdll/serial.c @@ -188,24 +188,29 @@ static NTSTATUS get_baud_rate(int fd, SERIAL_BAUD_RATE* sbr) static NTSTATUS get_hand_flow(int fd, SERIAL_HANDFLOW* shf) { - int stat; + int stat = 0; struct termios port; - + if (tcgetattr(fd, &port) == -1) { ERR("tcgetattr error '%s'\n", strerror(errno)); return FILE_GetNtStatus(); } + /* termios does not support DTR/DSR flow control */ + shf->ControlHandShake = 0; + shf->FlowReplace = 0; #ifdef TIOCMGET if (ioctl(fd, TIOCMGET, &stat) == -1) { WARN("ioctl error '%s'\n", strerror(errno)); - stat = DTR_CONTROL_ENABLE | RTS_CONTROL_ENABLE; + shf->ControlHandShake |= SERIAL_DTR_CONTROL; + shf->FlowReplace |= SERIAL_RTS_CONTROL; } +#else + WARN("Setting DTR/RTS to enabled by default\n"); + shf->ControlHandShake |= SERIAL_DTR_CONTROL; + shf->FlowReplace |= SERIAL_RTS_CONTROL; #endif - /* termios does not support DTR/DSR flow control */ - shf->ControlHandShake = 0; - shf->FlowReplace = 0; #ifdef TIOCM_DTR if (stat & TIOCM_DTR) #endif @@ -213,7 +218,7 @@ static NTSTATUS get_hand_flow(int fd, SERIAL_HANDFLOW* shf) #ifdef CRTSCTS if (port.c_cflag & CRTSCTS) { - shf->ControlHandShake |= SERIAL_DTR_CONTROL | SERIAL_DTR_HANDSHAKE; + shf->FlowReplace |= SERIAL_RTS_CONTROL; shf->ControlHandShake |= SERIAL_CTS_HANDSHAKE; } else @@ -222,7 +227,7 @@ static NTSTATUS get_hand_flow(int fd, SERIAL_HANDFLOW* shf) #ifdef TIOCM_RTS if (stat & TIOCM_RTS) #endif - shf->ControlHandShake |= SERIAL_RTS_CONTROL; + shf->FlowReplace |= SERIAL_RTS_CONTROL; } if (port.c_iflag & IXOFF) shf->FlowReplace |= SERIAL_AUTO_RECEIVE; diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c index 172d362a747..a6ca6fd1104 100644 --- a/dlls/ntdll/signal_i386.c +++ b/dlls/ntdll/signal_i386.c @@ -125,7 +125,7 @@ typedef ucontext_t SIGCONTEXT; #define ERROR_sig(context) ((context)->uc_mcontext.gregs[REG_ERR]) #define FPU_sig(context) ((FLOATING_SAVE_AREA*)((context)->uc_mcontext.fpregs)) -#define FPUX_sig(context) ((context)->uc_mcontext.fpregs->status >> 16 ? NULL : (XMM_SAVE_AREA32 *)(FPU_sig(context) + 1)) +#define FPUX_sig(context) (FPU_sig(context) && !((context)->uc_mcontext.fpregs->status >> 16) ? (XMM_SAVE_AREA32 *)(FPU_sig(context) + 1) : NULL) #define VM86_EAX 0 /* the %eax value while vm86_enter is executing */ diff --git a/dlls/ntdsapi/Makefile.in b/dlls/ntdsapi/Makefile.in index 0d9e95567b1..2649a36a9c7 100644 --- a/dlls/ntdsapi/Makefile.in +++ b/dlls/ntdsapi/Makefile.in @@ -4,7 +4,7 @@ SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = ntdsapi.dll IMPORTLIB = libntdsapi.$(IMPLIBEXT) -IMPORTS = kernel32 +IMPORTS = user32 kernel32 C_SRCS = \ ntdsapi.c diff --git a/dlls/ntdsapi/ntdsapi.c b/dlls/ntdsapi/ntdsapi.c index f8fd98c026e..bad284cf249 100644 --- a/dlls/ntdsapi/ntdsapi.c +++ b/dlls/ntdsapi/ntdsapi.c @@ -21,8 +21,10 @@ #include "windef.h" #include "winbase.h" #include "winerror.h" +#include "winuser.h" #include "ntdsapi.h" #include "wine/debug.h" +#include "wine/unicode.h" WINE_DEFAULT_DEBUG_CHANNEL(ntdsapi); @@ -52,11 +54,85 @@ DWORD WINAPI DsMakeSpnW(LPCWSTR svc_class, LPCWSTR svc_name, LPCWSTR inst_name, USHORT inst_port, LPCWSTR ref, DWORD *spn_length, LPWSTR spn) { - FIXME("(%s,%s,%s,%d,%s,%p,%p): stub!\n", debugstr_w(svc_class), + DWORD new_spn_length; + INT len; + LPWSTR p; + + TRACE("(%s,%s,%s,%d,%s,%p,%p)\n", debugstr_w(svc_class), debugstr_w(svc_name), debugstr_w(inst_name), inst_port, debugstr_w(ref), spn_length, spn); - return ERROR_CALL_NOT_IMPLEMENTED; + if (!svc_class || !svc_name) + return ERROR_INVALID_PARAMETER; + + new_spn_length = strlenW(svc_class) + 1 /* for '/' */ + 1 /* for terminating '\0' */; + if (inst_name) + new_spn_length += strlenW(inst_name); + else + new_spn_length += strlenW(svc_name); + if (inst_port) + { + USHORT n = inst_port; + new_spn_length += 1 /* for ':' */; + do + { + n /= 10; + new_spn_length++; + } while (n != 0); + } + if (inst_name) + new_spn_length += 1 /* for '/' */ + strlenW(svc_name); + + if (*spn_length < new_spn_length) + { + *spn_length = new_spn_length; + return ERROR_BUFFER_OVERFLOW; + } + *spn_length = new_spn_length; + + p = spn; + len = strlenW(svc_class); + memcpy(p, svc_class, len * sizeof(WCHAR)); + p += len; + *p = '/'; + p++; + if (inst_name) + { + len = strlenW(inst_name); + memcpy(p, inst_name, len * sizeof(WCHAR)); + p += len; + *p = '\0'; + } + else + { + len = strlenW(svc_name); + memcpy(p, svc_name, len * sizeof(WCHAR)); + p += len; + *p = '\0'; + } + + if (inst_port) + { + static const WCHAR percentU[] = {'%','u',0}; + *p = ':'; + p++; + wsprintfW(p, percentU, inst_port); + p += strlenW(p); + } + + if (inst_name) + { + *p = '/'; + p++; + len = strlenW(svc_name); + memcpy(p, svc_name, len * sizeof(WCHAR)); + p += len; + *p = '\0'; + } + + TRACE("spn = %s\n", debugstr_w(spn)); + + return ERROR_SUCCESS; } DWORD WINAPI DsMakeSpnA(LPCSTR svc_class, LPCSTR svc_name, diff --git a/dlls/ntdsapi/Makefile.in b/dlls/ntdsapi/tests/Makefile.in similarity index 55% copy from dlls/ntdsapi/Makefile.in copy to dlls/ntdsapi/tests/Makefile.in index 0d9e95567b1..05a7d2f8072 100644 --- a/dlls/ntdsapi/Makefile.in +++ b/dlls/ntdsapi/tests/Makefile.in @@ -1,14 +1,13 @@ TOPSRCDIR = @top_srcdir@ -TOPOBJDIR = ../.. +TOPOBJDIR = ../../.. SRCDIR = @srcdir@ VPATH = @srcdir@ -MODULE = ntdsapi.dll -IMPORTLIB = libntdsapi.$(IMPLIBEXT) -IMPORTS = kernel32 +TESTDLL = ntdsapi.dll +IMPORTS = ntdsapi kernel32 -C_SRCS = \ +CTESTS = \ ntdsapi.c -@MAKE_DLL_RULES@ +@MAKE_TEST_RULES@ @DEPENDENCIES@ # everything below this line is overwritten by make depend diff --git a/dlls/ntdsapi/tests/ntdsapi.c b/dlls/ntdsapi/tests/ntdsapi.c new file mode 100644 index 00000000000..ac5dd197bad --- /dev/null +++ b/dlls/ntdsapi/tests/ntdsapi.c @@ -0,0 +1,97 @@ +/* + * Copyright (C) 2008 Robert Shearman (for CodeWeavers) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include + +#include "windef.h" +#include "winbase.h" +#include "winerror.h" +#include "winnls.h" +#include "ntdsapi.h" + +#include "wine/test.h" + +static const char *wine_dbgstr_w(LPCWSTR str) +{ + static char buf[512]; + if (!str) + return "(null)"; + WideCharToMultiByte(CP_ACP, 0, str, -1, buf, sizeof(buf), NULL, NULL); + return buf; +} + +static void test_DsMakeSpn(void) +{ + DWORD ret; + WCHAR spn[256]; + DWORD spn_length; + static const WCHAR wszServiceClass[] = {'c','l','a','s','s',0}; + static const WCHAR wszServiceHost[] = {'h','o','s','t',0}; + static const WCHAR wszInstanceName[] = {'i','n','s','t','a','n','c','e',0}; + static const WCHAR wszReferrer[] = {'r','e','f','e','r','r','e','r',0}; + static const WCHAR wszSpn1[] = {'c','l','a','s','s','/','h','o','s','t',0}; + static const WCHAR wszSpn2[] = {'c','l','a','s','s','/','i','n','s','t','a','n','c','e','/','h','o','s','t',0}; + static const WCHAR wszSpn3[] = {'c','l','a','s','s','/','i','n','s','t','a','n','c','e',':','5','5','5','/','h','o','s','t',0}; + static const WCHAR wszSpn4[] = {'c','l','a','s','s','/','i','n','s','t','a','n','c','e',':','5','5','5','/','h','o','s','t',0}; + static const WCHAR wszSpn5[] = {'c','l','a','s','s','/','h','o','s','t',':','5','5','5',0}; + + spn[0] = '\0'; + + spn_length = sizeof(spn)/sizeof(spn[0]); + ret = DsMakeSpnW(NULL, NULL, NULL, 0, NULL, &spn_length, spn); + ok(ret == ERROR_INVALID_PARAMETER, "DsMakeSpnW should have failed with ERROR_INVALID_PARAMETER instead of %d\n", ret); + + spn_length = sizeof(spn)/sizeof(spn[0]); + ret = DsMakeSpnW(NULL, wszServiceHost, NULL, 0, NULL, &spn_length, spn); + ok(ret == ERROR_INVALID_PARAMETER, "DsMakeSpnW should have failed with ERROR_INVALID_PARAMETER instead of %d\n", ret); + + spn_length = sizeof(spn)/sizeof(spn[0]); + ret = DsMakeSpnW(wszServiceClass, wszServiceHost, NULL, 0, NULL, &spn_length, spn); + ok(ret == ERROR_SUCCESS, "DsMakeSpnW should have succeeded instead of failing with %d\n", ret); + ok(!lstrcmpW(spn, wszSpn1), "DsMakeSpnW returned unexpected SPN %s\n", wine_dbgstr_w(spn)); + ok(spn_length == lstrlenW(wszSpn1) + 1, "DsMakeSpnW should have returned spn_length of %d instead of %d\n", lstrlenW(wszSpn1) + 1, spn_length); + + spn_length = sizeof(spn)/sizeof(spn[0]); + ret = DsMakeSpnW(wszServiceClass, wszServiceHost, wszInstanceName, 0, NULL, &spn_length, spn); + ok(ret == ERROR_SUCCESS, "DsMakeSpnW should have succeeded instead of failing with %d\n", ret); + ok(!lstrcmpW(spn, wszSpn2), "DsMakeSpnW returned unexpected SPN %s\n", wine_dbgstr_w(spn)); + ok(spn_length == lstrlenW(wszSpn2) + 1, "DsMakeSpnW should have returned spn_length of %d instead of %d\n", lstrlenW(wszSpn2) + 1, spn_length); + + spn_length = sizeof(spn)/sizeof(spn[0]); + ret = DsMakeSpnW(wszServiceClass, wszServiceHost, wszInstanceName, 555, NULL, &spn_length, spn); + ok(ret == ERROR_SUCCESS, "DsMakeSpnW should have succeeded instead of failing with %d\n", ret); + ok(!lstrcmpW(spn, wszSpn3), "DsMakeSpnW returned unexpected SPN %s\n", wine_dbgstr_w(spn)); + ok(spn_length == lstrlenW(wszSpn3) + 1, "DsMakeSpnW should have returned spn_length of %d instead of %d\n", lstrlenW(wszSpn3) + 1, spn_length); + + spn_length = sizeof(spn)/sizeof(spn[0]); + ret = DsMakeSpnW(wszServiceClass, wszServiceHost, wszInstanceName, 555, wszReferrer, &spn_length, spn); + ok(ret == ERROR_SUCCESS, "DsMakeSpnW should have succeeded instead of failing with %d\n", ret); + ok(!lstrcmpW(spn, wszSpn4), "DsMakeSpnW returned unexpected SPN %s\n", wine_dbgstr_w(spn)); + ok(spn_length == lstrlenW(wszSpn4) + 1, "DsMakeSpnW should have returned spn_length of %d instead of %d\n", lstrlenW(wszSpn4) + 1, spn_length); + + spn_length = sizeof(spn)/sizeof(spn[0]); + ret = DsMakeSpnW(wszServiceClass, wszServiceHost, NULL, 555, wszReferrer, &spn_length, spn); + ok(ret == ERROR_SUCCESS, "DsMakeSpnW should have succeeded instead of failing with %d\n", ret); + ok(!lstrcmpW(spn, wszSpn5), "DsMakeSpnW returned unexpected SPN %s\n", wine_dbgstr_w(spn)); + ok(spn_length == lstrlenW(wszSpn5) + 1, "DsMakeSpnW should have returned spn_length of %d instead of %d\n", lstrlenW(wszSpn5) + 1, spn_length); +} + +START_TEST( ntdsapi ) +{ + test_DsMakeSpn(); +} diff --git a/dlls/ole32/rpc.c b/dlls/ole32/rpc.c index e2f56fc6d00..256ec0426a5 100644 --- a/dlls/ole32/rpc.c +++ b/dlls/ole32/rpc.c @@ -893,12 +893,8 @@ static HRESULT WINAPI ClientRpcChannelBuffer_SendReceive(LPRPCCHANNELBUFFER ifac orpcthat.flags = ORPCF_NULL; orpcthat.extensions = NULL; - /* for normal RPC calls, faults are returned in first 4 bytes of the - * buffer */ TRACE("RPC call status: 0x%lx\n", status); - if (status == RPC_S_CALL_FAILED) - hrFault = *(HRESULT *)olemsg->Buffer; - else if (status != RPC_S_OK) + if (status != RPC_S_OK) hr = HRESULT_FROM_WIN32(status); TRACE("hrFault = 0x%08x\n", hrFault); diff --git a/dlls/oleaut32/typelib2.c b/dlls/oleaut32/typelib2.c index 7464b0c9eac..00c79cecc1c 100644 --- a/dlls/oleaut32/typelib2.c +++ b/dlls/oleaut32/typelib2.c @@ -1225,7 +1225,7 @@ static HRESULT WINAPI ICreateTypeInfo2_fnSetTypeFlags(ICreateTypeInfo2 *iface, U This->typeinfo->flags = uTypeFlags; - if (uTypeFlags & 0x1000) { + if (uTypeFlags & TYPEFLAG_FDISPATCHABLE) { MSFT_GuidEntry foo; int guidoffset; int fileoffset; diff --git a/dlls/qmgr/Makefile.in b/dlls/qmgr/Makefile.in index 3a32cbea1d7..a19eea6937c 100644 --- a/dlls/qmgr/Makefile.in +++ b/dlls/qmgr/Makefile.in @@ -7,6 +7,7 @@ IMPORTS = kernel32 EXTRALIBS = -luuid C_SRCS = \ + factory.c \ qmgr.c \ qmgr_main.c diff --git a/dlls/qmgr/factory.c b/dlls/qmgr/factory.c new file mode 100644 index 00000000000..34c5ac0c1c2 --- /dev/null +++ b/dlls/qmgr/factory.c @@ -0,0 +1,96 @@ +/* + * Class factory interface for Queue Manager (BITS) + * + * Copyright (C) 2007 Google (Roy Shea) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#define COBJMACROS + +#include "qmgr.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(qmgr); + +static ULONG WINAPI +BITS_IClassFactory_AddRef(LPCLASSFACTORY iface) +{ + return 2; +} + +static HRESULT WINAPI +BITS_IClassFactory_QueryInterface(LPCLASSFACTORY iface, REFIID riid, + LPVOID *ppvObj) +{ + ClassFactoryImpl *This = (ClassFactoryImpl *) iface; + + if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IClassFactory)) + { + *ppvObj = &This->lpVtbl; + return S_OK; + } + + *ppvObj = NULL; + return E_NOINTERFACE; +} + +static ULONG WINAPI +BITS_IClassFactory_Release(LPCLASSFACTORY iface) +{ + return 1; +} + +static HRESULT WINAPI +BITS_IClassFactory_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pUnkOuter, + REFIID riid, LPVOID *ppvObj) +{ + HRESULT res; + IUnknown *punk = NULL; + + TRACE("IID: %s\n", debugstr_guid(riid)); + + if (pUnkOuter) + return CLASS_E_NOAGGREGATION; + + res = BackgroundCopyManagerConstructor(pUnkOuter, (LPVOID*) &punk); + if (FAILED(res)) + return res; + + res = IUnknown_QueryInterface(punk, riid, ppvObj); + IUnknown_Release(punk); + return res; +} + +static HRESULT WINAPI +BITS_IClassFactory_LockServer(LPCLASSFACTORY iface, BOOL fLock) +{ + FIXME("Not implemented\n"); + return E_NOTIMPL; +} + +static const IClassFactoryVtbl BITS_IClassFactory_Vtbl = +{ + BITS_IClassFactory_QueryInterface, + BITS_IClassFactory_AddRef, + BITS_IClassFactory_Release, + BITS_IClassFactory_CreateInstance, + BITS_IClassFactory_LockServer +}; + +ClassFactoryImpl BITS_ClassFactory = +{ + &BITS_IClassFactory_Vtbl +}; diff --git a/dlls/qmgr/qmgr.h b/dlls/qmgr/qmgr.h index 0b821cb3a19..9b708c8a35e 100644 --- a/dlls/qmgr/qmgr.h +++ b/dlls/qmgr/qmgr.h @@ -34,6 +34,13 @@ typedef struct LONG ref; } BackgroundCopyManagerImpl; +typedef struct +{ + const IClassFactoryVtbl *lpVtbl; +} ClassFactoryImpl; + +extern ClassFactoryImpl BITS_ClassFactory; + HRESULT BackgroundCopyManagerConstructor(IUnknown *pUnkOuter, LPVOID *ppObj); #endif /* __QMGR_H__ */ diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index 4e7c8206c95..705c5a1c220 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -2077,7 +2077,7 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, else bufferA = heap_alloc(wParam + 2); - ex.cb = wParam + (unicode ? 2*sizeof(WCHAR) : 2); + ex.cb = (wParam + 2) * (unicode ? sizeof(WCHAR) : sizeof(CHAR)); ex.flags = GT_USECRLF; ex.codepage = unicode ? 1200 : CP_ACP; ex.lpDefaultChar = NULL; @@ -2086,8 +2086,8 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, if (unicode) { - memcpy((LPWSTR)lParam, bufferW, wParam); - if (lstrlenW(bufferW) >= wParam / sizeof(WCHAR)) rc = 0; + memcpy((LPWSTR)lParam, bufferW, wParam * sizeof(WCHAR)); + if (lstrlenW(bufferW) >= wParam) rc = 0; } else { @@ -2101,7 +2101,7 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, case EM_GETTEXTEX: { GETTEXTEX *ex = (GETTEXTEX*)wParam; - int nStart, nCount; + int nStart, nCount; /* in chars */ if (ex->flags & ~(GT_SELECTION | GT_USECRLF)) FIXME("GETTEXTEX flags 0x%08x not supported\n", ex->flags & ~(GT_SELECTION | GT_USECRLF)); @@ -2110,12 +2110,11 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, { ME_GetSelection(editor, &nStart, &nCount); nCount -= nStart; - nCount = min(nCount, ex->cb - 1); } else { nStart = 0; - nCount = ex->cb - 1; + nCount = 0x7fffffff; } if (ex->codepage == 1200) { @@ -2127,11 +2126,14 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, /* potentially each char may be a CR, why calculate the exact value with O(N) when we can just take a bigger buffer? :) */ int crlfmul = (ex->flags & GT_USECRLF) ? 2 : 1; - LPWSTR buffer = heap_alloc((crlfmul*nCount + 1) * sizeof(WCHAR)); + LPWSTR buffer; DWORD buflen = ex->cb; LRESULT rc; DWORD flags = 0; + nCount = min(nCount, ex->cb - 1); + buffer = heap_alloc((crlfmul*nCount + 1) * sizeof(WCHAR)); + buflen = ME_GetTextW(editor, buffer, nStart, nCount, ex->flags & GT_USECRLF); rc = WideCharToMultiByte(ex->codepage, flags, buffer, -1, (LPSTR)lParam, ex->cb, ex->lpDefaultChar, ex->lpUsedDefaultChar); if (rc) rc--; /* do not count 0 terminator */ diff --git a/dlls/riched20/style.c b/dlls/riched20/style.c index 06d76cfae80..8d67de33b03 100644 --- a/dlls/riched20/style.c +++ b/dlls/riched20/style.c @@ -218,7 +218,6 @@ ME_Style *ME_ApplyStyle(ME_Style *sSrc, CHARFORMAT2W *style) if (style->dwMask & CFM_UNDERLINE) { s->fmt.dwMask |= CFM_UNDERLINETYPE; - s->fmt.dwMask &= ~CFM_UNDERLINE; s->fmt.bUnderlineType = (style->dwEffects & CFM_UNDERLINE) ? CFU_CF1UNDERLINE : CFU_UNDERLINENONE; } diff --git a/dlls/rpcrt4/Makefile.in b/dlls/rpcrt4/Makefile.in index 5cb090b50f8..9fe0026dc10 100644 --- a/dlls/rpcrt4/Makefile.in +++ b/dlls/rpcrt4/Makefile.in @@ -6,7 +6,7 @@ VPATH = @srcdir@ MODULE = rpcrt4.dll IMPORTLIB = librpcrt4.$(IMPLIBEXT) IMPORTS = iphlpapi advapi32 kernel32 ntdll -DELAYIMPORTS = secur32 +DELAYIMPORTS = secur32 user32 EXTRALIBS = -luuid C_SRCS = \ diff --git a/dlls/rpcrt4/ndr_stubless.c b/dlls/rpcrt4/ndr_stubless.c index af06fb8c302..1f6cd57a8b1 100644 --- a/dlls/rpcrt4/ndr_stubless.c +++ b/dlls/rpcrt4/ndr_stubless.c @@ -1464,9 +1464,7 @@ LONG WINAPI NdrStubCall2( Status = I_RpcGetBuffer(pRpcMsg); if (Status) RpcRaiseException(Status); - stubMsg.BufferStart = pRpcMsg->Buffer; - stubMsg.BufferEnd = stubMsg.BufferStart + stubMsg.BufferLength; - stubMsg.Buffer = stubMsg.BufferStart; + stubMsg.Buffer = pRpcMsg->Buffer; } break; case STUBLESS_UNMARSHAL: diff --git a/dlls/rpcrt4/rpc_binding.c b/dlls/rpcrt4/rpc_binding.c index 24769e2ce60..3a8afded6ca 100644 --- a/dlls/rpcrt4/rpc_binding.c +++ b/dlls/rpcrt4/rpc_binding.c @@ -937,6 +937,7 @@ static RPC_STATUS RpcAuthInfo_Create(ULONG AuthnLevel, ULONG AuthnSvc, AuthInfo->exp = exp; AuthInfo->cbMaxToken = cbMaxToken; AuthInfo->identity = identity; + AuthInfo->server_principal_name = NULL; /* duplicate the SEC_WINNT_AUTH_IDENTITY structure, if applicable, to * enable better matching in RpcAuthInfo_IsEqual */ @@ -1004,6 +1005,7 @@ ULONG RpcAuthInfo_Release(RpcAuthInfo *AuthInfo) HeapFree(GetProcessHeap(), 0, AuthInfo->nt_identity->Password); HeapFree(GetProcessHeap(), 0, AuthInfo->nt_identity); } + HeapFree(GetProcessHeap(), 0, AuthInfo->server_principal_name); HeapFree(GetProcessHeap(), 0, AuthInfo); } @@ -1415,19 +1417,32 @@ RpcBindingSetAuthInfoExA( RPC_BINDING_HANDLE Binding, RPC_CSTR ServerPrincName, } TRACE("found package %s for service %u\n", packages[i].Name, AuthnSvc); - r = AcquireCredentialsHandleA((SEC_CHAR *)ServerPrincName, packages[i].Name, SECPKG_CRED_OUTBOUND, NULL, + r = AcquireCredentialsHandleA(NULL, packages[i].Name, SECPKG_CRED_OUTBOUND, NULL, AuthIdentity, NULL, NULL, &cred, &exp); cbMaxToken = packages[i].cbMaxToken; FreeContextBuffer(packages); if (r == ERROR_SUCCESS) { - if (bind->AuthInfo) RpcAuthInfo_Release(bind->AuthInfo); - bind->AuthInfo = NULL; + RpcAuthInfo *new_auth_info; r = RpcAuthInfo_Create(AuthnLevel, AuthnSvc, cred, exp, cbMaxToken, - AuthIdentity, &bind->AuthInfo); - if (r != RPC_S_OK) + AuthIdentity, &new_auth_info); + if (r == RPC_S_OK) + { + new_auth_info->server_principal_name = RPCRT4_strdupAtoW((char *)ServerPrincName); + if (new_auth_info->server_principal_name) + { + if (bind->AuthInfo) RpcAuthInfo_Release(bind->AuthInfo); + bind->AuthInfo = new_auth_info; + } + else + { + RpcAuthInfo_Release(new_auth_info); + r = ERROR_OUTOFMEMORY; + } + } + else FreeCredentialsHandle(&cred); - return RPC_S_OK; + return r; } else { @@ -1531,19 +1546,32 @@ RpcBindingSetAuthInfoExW( RPC_BINDING_HANDLE Binding, RPC_WSTR ServerPrincName, } TRACE("found package %s for service %u\n", debugstr_w(packages[i].Name), AuthnSvc); - r = AcquireCredentialsHandleW((SEC_WCHAR *)ServerPrincName, packages[i].Name, SECPKG_CRED_OUTBOUND, NULL, + r = AcquireCredentialsHandleW(NULL, packages[i].Name, SECPKG_CRED_OUTBOUND, NULL, AuthIdentity, NULL, NULL, &cred, &exp); cbMaxToken = packages[i].cbMaxToken; FreeContextBuffer(packages); if (r == ERROR_SUCCESS) { - if (bind->AuthInfo) RpcAuthInfo_Release(bind->AuthInfo); - bind->AuthInfo = NULL; + RpcAuthInfo *new_auth_info; r = RpcAuthInfo_Create(AuthnLevel, AuthnSvc, cred, exp, cbMaxToken, - AuthIdentity, &bind->AuthInfo); - if (r != RPC_S_OK) + AuthIdentity, &new_auth_info); + if (r == RPC_S_OK) + { + new_auth_info->server_principal_name = RPCRT4_strdupW(ServerPrincName); + if (new_auth_info->server_principal_name) + { + if (bind->AuthInfo) RpcAuthInfo_Release(bind->AuthInfo); + bind->AuthInfo = new_auth_info; + } + else + { + RpcAuthInfo_Release(new_auth_info); + r = ERROR_OUTOFMEMORY; + } + } + else FreeCredentialsHandle(&cred); - return RPC_S_OK; + return r; } else { diff --git a/dlls/rpcrt4/rpc_binding.h b/dlls/rpcrt4/rpc_binding.h index ed8d4ea062d..e169a650e6e 100644 --- a/dlls/rpcrt4/rpc_binding.h +++ b/dlls/rpcrt4/rpc_binding.h @@ -41,6 +41,7 @@ typedef struct _RpcAuthInfo /* our copy of NT auth identity structure, if the authentication service * takes an NT auth identity */ SEC_WINNT_AUTH_IDENTITY_W *nt_identity; + LPWSTR server_principal_name; } RpcAuthInfo; typedef struct _RpcQualityOfService @@ -73,6 +74,7 @@ typedef struct _RpcConnection /* client-only */ struct list conn_pool_entry; ULONG assoc_group_id; /* association group returned during binding */ + RPC_ASYNC_STATE *async_state; /* server-only */ /* The active interface bound to server. */ @@ -92,6 +94,7 @@ struct connection_ops { int (*write)(RpcConnection *conn, const void *buffer, unsigned int len); int (*close)(RpcConnection *conn); void (*cancel_call)(RpcConnection *conn); + int (*wait_for_incoming_data)(RpcConnection *conn); size_t (*get_top_of_tower)(unsigned char *tower_data, const char *networkaddr, const char *endpoint); RPC_STATUS (*parse_top_of_tower)(const unsigned char *tower_data, size_t tower_size, char **networkaddr, char **endpoint); }; diff --git a/dlls/rpcrt4/rpc_message.c b/dlls/rpcrt4/rpc_message.c index 07af1fc4cec..de6f97dc6b3 100644 --- a/dlls/rpcrt4/rpc_message.c +++ b/dlls/rpcrt4/rpc_message.c @@ -27,6 +27,7 @@ #include "windef.h" #include "winbase.h" #include "winerror.h" +#include "winuser.h" #include "rpc.h" #include "rpcndr.h" @@ -580,10 +581,10 @@ static RPC_STATUS RPCRT4_ClientAuthorize(RpcConnection *conn, SecBuffer *in, inp_desc.pBuffers = in; inp_desc.ulVersion = 0; - r = InitializeSecurityContextA(&conn->AuthInfo->cred, in ? &conn->ctx : NULL, - NULL, context_req, 0, SECURITY_NETWORK_DREP, - in ? &inp_desc : NULL, 0, &conn->ctx, &out_desc, &conn->attr, - &conn->exp); + r = InitializeSecurityContextW(&conn->AuthInfo->cred, in ? &conn->ctx : NULL, + in ? NULL : conn->AuthInfo->server_principal_name, context_req, 0, + SECURITY_NETWORK_DREP, in ? &inp_desc : NULL, 0, &conn->ctx, + &out_desc, &conn->attr, &conn->exp); if (FAILED(r)) { WARN("InitializeSecurityContext failed with error 0x%08x\n", r); @@ -675,36 +676,61 @@ RPC_STATUS RPCRT4_Send(RpcConnection *Connection, RpcPktHdr *Header, } /* tack on a negotiate packet */ - RPCRT4_ClientAuthorize(Connection, NULL, &out); - r = RPCRT4_SendAuth(Connection, Header, Buffer, BufferLength, out.pvBuffer, out.cbBuffer); - HeapFree(GetProcessHeap(), 0, out.pvBuffer); + r = RPCRT4_ClientAuthorize(Connection, NULL, &out); + if (r == RPC_S_OK) + { + r = RPCRT4_SendAuth(Connection, Header, Buffer, BufferLength, out.pvBuffer, out.cbBuffer); + HeapFree(GetProcessHeap(), 0, out.pvBuffer); + } return r; } +/* validates version and frag_len fields */ +RPC_STATUS RPCRT4_ValidateCommonHeader(const RpcPktCommonHdr *hdr) +{ + DWORD hdr_length; + + /* verify if the header really makes sense */ + if (hdr->rpc_ver != RPC_VER_MAJOR || + hdr->rpc_ver_minor != RPC_VER_MINOR) + { + WARN("unhandled packet version\n"); + return RPC_S_PROTOCOL_ERROR; + } + + hdr_length = RPCRT4_GetHeaderSize((const RpcPktHdr*)hdr); + if (hdr_length == 0) + { + WARN("header length == 0\n"); + return RPC_S_PROTOCOL_ERROR; + } + + if (hdr->frag_len < hdr_length) + { + WARN("bad frag length %d\n", hdr->frag_len); + return RPC_S_PROTOCOL_ERROR; + } + + return RPC_S_OK; +} + /*********************************************************************** - * RPCRT4_Receive (internal) + * RPCRT4_receive_fragment (internal) * - * Receive a packet from connection and merge the fragments. + * Receive a fragment from a connection. */ -RPC_STATUS RPCRT4_Receive(RpcConnection *Connection, RpcPktHdr **Header, - PRPC_MESSAGE pMsg) +RPC_STATUS RPCRT4_receive_fragment(RpcConnection *Connection, RpcPktHdr **Header, void **Payload) { RPC_STATUS status; DWORD hdr_length; LONG dwRead; - unsigned short first_flag; - unsigned long data_length; - unsigned long buffer_length; - unsigned long auth_length; - unsigned char *auth_data = NULL; RpcPktCommonHdr common_hdr; *Header = NULL; + *Payload = NULL; - TRACE("(%p, %p, %p)\n", Connection, Header, pMsg); - - RPCRT4_SetThreadCurrentConnection(Connection); + TRACE("(%p, %p, %p)\n", Connection, Header, Payload); /* read packet common header */ dwRead = rpcrt4_conn_read(Connection, &common_hdr, sizeof(common_hdr)); @@ -714,13 +740,8 @@ RPC_STATUS RPCRT4_Receive(RpcConnection *Connection, RpcPktHdr **Header, goto fail; } - /* verify if the header really makes sense */ - if (common_hdr.rpc_ver != RPC_VER_MAJOR || - common_hdr.rpc_ver_minor != RPC_VER_MINOR) { - WARN("unhandled packet version\n"); - status = RPC_S_PROTOCOL_ERROR; - goto fail; - } + status = RPCRT4_ValidateCommonHeader(&common_hdr); + if (status != RPC_S_OK) goto fail; hdr_length = RPCRT4_GetHeaderSize((RpcPktHdr*)&common_hdr); if (hdr_length == 0) { @@ -740,8 +761,70 @@ RPC_STATUS RPCRT4_Receive(RpcConnection *Connection, RpcPktHdr **Header, goto fail; } + if (common_hdr.frag_len - hdr_length) + { + *Payload = HeapAlloc(GetProcessHeap(), 0, common_hdr.frag_len - hdr_length); + if (!*Payload) + { + status = RPC_S_OUT_OF_RESOURCES; + goto fail; + } + + dwRead = rpcrt4_conn_read(Connection, *Payload, common_hdr.frag_len - hdr_length); + if (dwRead != common_hdr.frag_len - hdr_length) + { + WARN("bad data length, %d/%d\n", dwRead, common_hdr.frag_len - hdr_length); + status = RPC_S_CALL_FAILED; + goto fail; + } + } + else + *Payload = NULL; + + /* success */ + status = RPC_S_OK; + +fail: + if (status != RPC_S_OK) { + RPCRT4_FreeHeader(*Header); + *Header = NULL; + HeapFree(GetProcessHeap(), 0, *Payload); + *Payload = NULL; + } + return status; +} + +/*********************************************************************** + * RPCRT4_Receive (internal) + * + * Receive a packet from connection and merge the fragments. + */ +RPC_STATUS RPCRT4_Receive(RpcConnection *Connection, RpcPktHdr **Header, + PRPC_MESSAGE pMsg) +{ + RPC_STATUS status; + DWORD hdr_length; + unsigned short first_flag; + unsigned long data_length; + unsigned long buffer_length; + unsigned long auth_length; + unsigned char *auth_data = NULL; + RpcPktHdr *CurrentHeader = NULL; + void *payload = NULL; + + *Header = NULL; + + TRACE("(%p, %p, %p)\n", Connection, Header, pMsg); + + RPCRT4_SetThreadCurrentConnection(Connection); + + status = RPCRT4_receive_fragment(Connection, Header, &payload); + if (status != RPC_S_OK) goto fail; + + hdr_length = RPCRT4_GetHeaderSize(*Header); + /* read packet body */ - switch (common_hdr.ptype) { + switch ((*Header)->common.ptype) { case PKT_RESPONSE: pMsg->BufferLength = (*Header)->response.alloc_hint; break; @@ -749,7 +832,7 @@ RPC_STATUS RPCRT4_Receive(RpcConnection *Connection, RpcPktHdr **Header, pMsg->BufferLength = (*Header)->request.alloc_hint; break; default: - pMsg->BufferLength = common_hdr.frag_len - hdr_length - RPC_AUTH_VERIFIER_LEN(&common_hdr); + pMsg->BufferLength = (*Header)->common.frag_len - hdr_length - RPC_AUTH_VERIFIER_LEN(&(*Header)->common); } TRACE("buffer length = %u\n", pMsg->BufferLength); @@ -762,30 +845,31 @@ RPC_STATUS RPCRT4_Receive(RpcConnection *Connection, RpcPktHdr **Header, } first_flag = RPC_FLG_FIRST; - auth_length = common_hdr.auth_len; + auth_length = (*Header)->common.auth_len; if (auth_length) { - auth_data = HeapAlloc(GetProcessHeap(), 0, RPC_AUTH_VERIFIER_LEN(&common_hdr)); + auth_data = HeapAlloc(GetProcessHeap(), 0, RPC_AUTH_VERIFIER_LEN(&(*Header)->common)); if (!auth_data) { status = RPC_S_OUT_OF_RESOURCES; goto fail; } } + CurrentHeader = *Header; buffer_length = 0; while (TRUE) { - unsigned int header_auth_len = RPC_AUTH_VERIFIER_LEN(&(*Header)->common); + unsigned int header_auth_len = RPC_AUTH_VERIFIER_LEN(&CurrentHeader->common); /* verify header fields */ - if (((*Header)->common.frag_len < hdr_length) || - ((*Header)->common.frag_len - hdr_length < header_auth_len)) { + if ((CurrentHeader->common.frag_len < hdr_length) || + (CurrentHeader->common.frag_len - hdr_length < header_auth_len)) { WARN("frag_len %d too small for hdr_length %d and auth_len %d\n", - (*Header)->common.frag_len, hdr_length, header_auth_len); + CurrentHeader->common.frag_len, hdr_length, CurrentHeader->common.auth_len); status = RPC_S_PROTOCOL_ERROR; goto fail; } - if ((*Header)->common.auth_len != auth_length) { + if ((CurrentHeader->common.flags & RPC_FLG_FIRST) != first_flag) { WARN("auth_len header field changed from %ld to %d\n", auth_length, (*Header)->common.auth_len); status = RPC_S_PROTOCOL_ERROR; @@ -798,7 +882,7 @@ RPC_STATUS RPCRT4_Receive(RpcConnection *Connection, RpcPktHdr **Header, goto fail; } - data_length = (*Header)->common.frag_len - hdr_length - header_auth_len; + data_length = CurrentHeader->common.frag_len - hdr_length - header_auth_len; if (data_length + buffer_length > pMsg->BufferLength) { TRACE("allocation hint exceeded, new buffer length = %ld\n", data_length + buffer_length); @@ -807,17 +891,11 @@ RPC_STATUS RPCRT4_Receive(RpcConnection *Connection, RpcPktHdr **Header, if (status != RPC_S_OK) goto fail; } - if (data_length == 0) dwRead = 0; else - dwRead = rpcrt4_conn_read(Connection, - (unsigned char *)pMsg->Buffer + buffer_length, data_length); - if (dwRead != data_length) { - WARN("bad data length, %d/%ld\n", dwRead, data_length); - status = RPC_S_CALL_FAILED; - goto fail; - } + memcpy((unsigned char *)pMsg->Buffer + buffer_length, payload, data_length); if (header_auth_len) { - if (header_auth_len < sizeof(RpcAuthVerifier)) { + if (header_auth_len < sizeof(RpcAuthVerifier) || + header_auth_len > RPC_AUTH_VERIFIER_LEN(&(*Header)->common)) { WARN("bad auth verifier length %d\n", header_auth_len); status = RPC_S_PROTOCOL_ERROR; goto fail; @@ -828,22 +906,16 @@ RPC_STATUS RPCRT4_Receive(RpcConnection *Connection, RpcPktHdr **Header, * however, the details of how this is done is very sketchy in the * DCE/RPC spec. for all other packet types that have authentication * verifier data then it is just duplicated in all the fragments */ - dwRead = rpcrt4_conn_read(Connection, auth_data, header_auth_len); - if (dwRead != header_auth_len) { - WARN("bad authentication data length, %d/%d\n", dwRead, - header_auth_len); - status = RPC_S_CALL_FAILED; - goto fail; - } + memcpy(auth_data, (unsigned char *)payload + data_length, header_auth_len); /* these packets are handled specially, not by the generic SecurePacket * function */ - if ((common_hdr.ptype != PKT_BIND) && - (common_hdr.ptype != PKT_BIND_ACK) && - (common_hdr.ptype != PKT_AUTH3)) + if (((*Header)->common.ptype != PKT_BIND) && + ((*Header)->common.ptype != PKT_BIND_ACK) && + ((*Header)->common.ptype != PKT_AUTH3)) { status = RPCRT4_SecurePacket(Connection, SECURE_PACKET_RECEIVE, - *Header, hdr_length, + CurrentHeader, hdr_length, (unsigned char *)pMsg->Buffer + buffer_length, data_length, (RpcAuthVerifier *)auth_data, auth_data + sizeof(RpcAuthVerifier), @@ -853,16 +925,19 @@ RPC_STATUS RPCRT4_Receive(RpcConnection *Connection, RpcPktHdr **Header, } buffer_length += data_length; - if (!((*Header)->common.flags & RPC_FLG_LAST)) { + if (!(CurrentHeader->common.flags & RPC_FLG_LAST)) { TRACE("next header\n"); - /* read the header of next packet */ - dwRead = rpcrt4_conn_read(Connection, *Header, hdr_length); - if (dwRead != hdr_length) { - WARN("invalid packet header size (%d)\n", dwRead); - status = RPC_S_CALL_FAILED; - goto fail; + if (*Header != CurrentHeader) + { + RPCRT4_FreeHeader(CurrentHeader); + CurrentHeader = NULL; } + HeapFree(GetProcessHeap(), 0, payload); + payload = NULL; + + status = RPCRT4_receive_fragment(Connection, &CurrentHeader, &payload); + if (status != RPC_S_OK) goto fail; first_flag = 0; } else { @@ -872,7 +947,7 @@ RPC_STATUS RPCRT4_Receive(RpcConnection *Connection, RpcPktHdr **Header, pMsg->BufferLength = buffer_length; /* respond to authorization request */ - if (common_hdr.ptype == PKT_BIND_ACK && auth_length > sizeof(RpcAuthVerifier)) + if ((*Header)->common.ptype == PKT_BIND_ACK && auth_length > sizeof(RpcAuthVerifier)) { status = RPCRT_AuthorizeConnection(Connection, auth_data + sizeof(RpcAuthVerifier), @@ -886,11 +961,14 @@ RPC_STATUS RPCRT4_Receive(RpcConnection *Connection, RpcPktHdr **Header, fail: RPCRT4_SetThreadCurrentConnection(NULL); + if (CurrentHeader != *Header) + RPCRT4_FreeHeader(CurrentHeader); if (status != RPC_S_OK) { RPCRT4_FreeHeader(*Header); *Header = NULL; } HeapFree(GetProcessHeap(), 0, auth_data); + HeapFree(GetProcessHeap(), 0, payload); return status; } @@ -1039,6 +1117,49 @@ RPC_STATUS WINAPI I_RpcFreeBuffer(PRPC_MESSAGE pMsg) return RPC_S_OK; } +static void CALLBACK async_apc_notifier_proc(ULONG_PTR ulParam) +{ + RPC_ASYNC_STATE *state = (RPC_ASYNC_STATE *)ulParam; + state->u.APC.NotificationRoutine(state, NULL, state->Event); +} + +static DWORD WINAPI async_notifier_proc(LPVOID p) +{ + RpcConnection *conn = p; + RPC_ASYNC_STATE *state = conn->async_state; + + if (state && !conn->ops->wait_for_incoming_data(conn)) + { + state->Event = RpcCallComplete; + switch (state->NotificationType) + { + case RpcNotificationTypeEvent: + SetEvent(state->u.hEvent); + break; + case RpcNotificationTypeApc: + QueueUserAPC(async_apc_notifier_proc, state->u.APC.hThread, (ULONG_PTR)state); + break; + case RpcNotificationTypeIoc: + PostQueuedCompletionStatus(state->u.IOC.hIOPort, + state->u.IOC.dwNumberOfBytesTransferred, + state->u.IOC.dwCompletionKey, + state->u.IOC.lpOverlapped); + break; + case RpcNotificationTypeHwnd: + PostMessageW(state->u.HWND.hWnd, state->u.HWND.Msg, 0, 0); + break; + case RpcNotificationTypeCallback: + state->u.NotificationRoutine(state, NULL, state->Event); + break; + case RpcNotificationTypeNone: + default: + break; + } + } + + return 0; +} + /*********************************************************************** * I_RpcSend [RPCRT4.@] * @@ -1080,6 +1201,12 @@ RPC_STATUS WINAPI I_RpcSend(PRPC_MESSAGE pMsg) RPCRT4_FreeHeader(hdr); + if (status == RPC_S_OK && pMsg->RpcFlags & RPC_BUFFER_ASYNC) + { + if (!QueueUserWorkItem(async_notifier_proc, conn, WT_EXECUTEDEFAULT | WT_EXECUTELONGFUNCTION)) + status = RPC_S_OUT_OF_RESOURCES; + } + return status; } @@ -1198,8 +1325,17 @@ RPC_STATUS WINAPI I_RpcSendReceive(PRPC_MESSAGE pMsg) */ RPC_STATUS WINAPI I_RpcAsyncSetHandle(PRPC_MESSAGE pMsg, PRPC_ASYNC_STATE pAsync) { - FIXME("(%p, %p): stub\n", pMsg, pAsync); - return RPC_S_INVALID_BINDING; + RpcBinding* bind = (RpcBinding*)pMsg->Handle; + RpcConnection *conn; + + TRACE("(%p, %p)\n", pMsg, pAsync); + + if (!bind || bind->server || !pMsg->ReservedForRuntime) return RPC_S_INVALID_BINDING; + + conn = pMsg->ReservedForRuntime; + conn->async_state = pAsync; + + return RPC_S_OK; } /*********************************************************************** diff --git a/dlls/rpcrt4/rpc_transport.c b/dlls/rpcrt4/rpc_transport.c index eb6bd8d5ace..e3fd8c122d9 100644 --- a/dlls/rpcrt4/rpc_transport.c +++ b/dlls/rpcrt4/rpc_transport.c @@ -410,6 +410,12 @@ static void rpcrt4_conn_np_cancel_call(RpcConnection *Connection) /* FIXME: implement when named pipe writes use overlapped I/O */ } +static int rpcrt4_conn_np_wait_for_incoming_data(RpcConnection *Connection) +{ + /* FIXME: implement when named pipe writes use overlapped I/O */ + return -1; +} + static size_t rpcrt4_ncacn_np_get_top_of_tower(unsigned char *tower_data, const char *networkaddr, const char *endpoint) @@ -1047,6 +1053,32 @@ static void rpcrt4_conn_tcp_cancel_call(RpcConnection *Connection) write(tcpc->cancel_fds[1], &dummy, 1); } +static int rpcrt4_conn_tcp_wait_for_incoming_data(RpcConnection *Connection) +{ + RpcConnection_tcp *tcpc = (RpcConnection_tcp *) Connection; + struct pollfd pfds[2]; + + TRACE("%p\n", Connection); + + pfds[0].fd = tcpc->sock; + pfds[0].events = POLLIN; + pfds[1].fd = tcpc->cancel_fds[0]; + pfds[1].events = POLLIN; + if (poll(pfds, 2, -1 /* infinite */) == -1 && errno != EINTR) + { + ERR("poll() failed: %s\n", strerror(errno)); + return -1; + } + if (pfds[1].revents & POLLIN) /* canceled */ + { + char dummy; + read(pfds[1].fd, &dummy, sizeof(dummy)); + return -1; + } + + return 0; +} + static size_t rpcrt4_ncacn_ip_tcp_get_top_of_tower(unsigned char *tower_data, const char *networkaddr, const char *endpoint) @@ -1330,6 +1362,7 @@ static const struct connection_ops conn_protseq_list[] = { rpcrt4_conn_np_write, rpcrt4_conn_np_close, rpcrt4_conn_np_cancel_call, + rpcrt4_conn_np_wait_for_incoming_data, rpcrt4_ncacn_np_get_top_of_tower, rpcrt4_ncacn_np_parse_top_of_tower, }, @@ -1342,6 +1375,7 @@ static const struct connection_ops conn_protseq_list[] = { rpcrt4_conn_np_write, rpcrt4_conn_np_close, rpcrt4_conn_np_cancel_call, + rpcrt4_conn_np_wait_for_incoming_data, rpcrt4_ncalrpc_get_top_of_tower, rpcrt4_ncalrpc_parse_top_of_tower, }, @@ -1354,6 +1388,7 @@ static const struct connection_ops conn_protseq_list[] = { rpcrt4_conn_tcp_write, rpcrt4_conn_tcp_close, rpcrt4_conn_tcp_cancel_call, + rpcrt4_conn_tcp_wait_for_incoming_data, rpcrt4_ncacn_ip_tcp_get_top_of_tower, rpcrt4_ncacn_ip_tcp_parse_top_of_tower, } @@ -1470,6 +1505,7 @@ RPC_STATUS RPCRT4_CreateConnection(RpcConnection** Connection, BOOL server, NewConnection->QOS = QOS; list_init(&NewConnection->conn_pool_entry); + NewConnection->async_state = NULL; TRACE("connection: %p\n", NewConnection); *Connection = NewConnection; diff --git a/dlls/rpcrt4/rpcrt4.spec b/dlls/rpcrt4/rpcrt4.spec index 3dc9edc4d63..a235302ecb5 100644 --- a/dlls/rpcrt4/rpcrt4.spec +++ b/dlls/rpcrt4/rpcrt4.spec @@ -21,7 +21,6 @@ @ stdcall I_RpcAbortAsyncCall(ptr long) I_RpcAsyncAbortCall @ stdcall I_RpcAllocate(long) @ stdcall I_RpcAsyncAbortCall(ptr long) -@ stub I_RpcAsyncSendReceive # NT4 @ stdcall I_RpcAsyncSetHandle(ptr ptr) @ stub I_RpcBCacheAllocate @ stub I_RpcBCacheFree @@ -39,7 +38,6 @@ @ stdcall I_RpcBindingSetAsync(ptr ptr) @ stub I_RpcBindingToStaticStringBindingW @ stub I_RpcClearMutex -@ stub I_RpcConnectionInqSockBuffSize2 @ stub I_RpcConnectionInqSockBuffSize @ stub I_RpcConnectionSetSockBuffSize @ stub I_RpcDeleteMutex @@ -48,19 +46,13 @@ @ stdcall I_RpcFree(ptr) @ stdcall I_RpcFreeBuffer(ptr) @ stub I_RpcFreePipeBuffer -@ stub I_RpcGetAssociationContext @ stdcall I_RpcGetBuffer(ptr) @ stub I_RpcGetBufferWithObject @ stdcall I_RpcGetCurrentCallHandle() @ stub I_RpcGetExtendedError -@ stub I_RpcGetServerContextList -@ stub I_RpcGetThreadEvent # win9x -@ stub I_RpcGetThreadWindowHandle # win9x @ stub I_RpcIfInqTransferSyntaxes -@ stub I_RpcLaunchDatagramReceiveThread # win9x @ stub I_RpcLogEvent @ stdcall I_RpcMapWin32Status(long) -@ stub I_RpcMonitorAssociation @ stub I_RpcNegotiateTransferSyntax # wxp @ stub I_RpcNsBindingSetEntryName @ stub I_RpcNsBindingSetEntryNameA @@ -83,46 +75,24 @@ @ stub I_RpcServerSetAddressChangeFn @ stdcall I_RpcServerStartListening(ptr) # win9x @ stdcall I_RpcServerStopListening() # win9x -@ stub I_RpcServerUnregisterEndpointA # win9x -@ stub I_RpcServerUnregisterEndpointW # win9x @ stub I_RpcServerUseProtseq2A @ stub I_RpcServerUseProtseq2W @ stub I_RpcServerUseProtseqEp2A @ stub I_RpcServerUseProtseqEp2W -@ stub I_RpcSetAssociationContext # win9x @ stub I_RpcSetAsyncHandle -@ stub I_RpcSetServerContextList -@ stub I_RpcSetThreadParams # win9x -@ stub I_RpcSetWMsgEndpoint # NT4 @ stub I_RpcSsDontSerializeContext -@ stub I_RpcStopMonitorAssociation @ stub I_RpcSystemFunction001 # wxp (oh, brother!) -@ stub I_RpcTransCancelMigration # win9x -@ stub I_RpcTransClientMaxFrag # win9x -@ stub I_RpcTransClientReallocBuffer # win9x @ stub I_RpcTransConnectionAllocatePacket @ stub I_RpcTransConnectionFreePacket @ stub I_RpcTransConnectionReallocPacket @ stub I_RpcTransDatagramAllocate2 @ stub I_RpcTransDatagramAllocate @ stub I_RpcTransDatagramFree -@ stub I_RpcTransGetAddressList @ stub I_RpcTransGetThreadEvent @ stub I_RpcTransIoCancelled -@ stub I_RpcTransMaybeMakeReceiveAny # win9x -@ stub I_RpcTransMaybeMakeReceiveDirect # win9x -@ stub I_RpcTransPingServer # win9x -@ stub I_RpcTransServerFindConnection # win9x -@ stub I_RpcTransServerFreeBuffer # win9x -@ stub I_RpcTransServerMaxFrag # win9x @ stub I_RpcTransServerNewConnection -@ stub I_RpcTransServerProtectThread # win9x -@ stub I_RpcTransServerReallocBuffer # win9x -@ stub I_RpcTransServerReceiveDirectReady # win9x -@ stub I_RpcTransServerUnprotectThread # win9x @ stub I_RpcTurnOnEEInfoPropagation # wxp @ stdcall I_RpcWindowProc(ptr long long long) # win9x -@ stub I_RpcltDebugSetPDUFilter @ stub I_UuidCreate @ stub MIDL_wchar_strcpy @ stub MIDL_wchar_strlen @@ -135,8 +105,6 @@ @ stub MesHandleFree @ stub MesIncrementalHandleReset @ stub MesInqProcEncodingId -@ stub MqGetContext # win9x -@ stub MqRegisterQueue # win9x @ stdcall NDRCContextBinding(ptr) @ stdcall NDRCContextMarshall(ptr ptr) @ stdcall NDRCContextUnmarshall(ptr ptr ptr long) @@ -361,7 +329,6 @@ @ stub NdrpReleaseTypeGenCookie # wxp @ stub NdrpSetRpcSsDefaults @ stub NdrpVarVtOfTypeDesc # wxp -@ stub PerformRpcInitialization @ stdcall RpcAbortAsyncCall(ptr long) RpcAsyncAbortCall @ stdcall RpcAsyncAbortCall(ptr long) @ stdcall RpcAsyncCancelCall(ptr long) @@ -421,8 +388,6 @@ @ stub RpcIfInqId @ stdcall RpcImpersonateClient(ptr) @ stdcall RpcInitializeAsyncHandle(ptr long) RpcAsyncInitializeHandle -@ stub RpcMgmtBindingInqParameter # win9x -@ stub RpcMgmtBindingSetParameter # win9x @ stdcall RpcMgmtEnableIdleCleanup() @ stdcall RpcMgmtEpEltInqBegin(ptr long ptr long ptr ptr) @ stub RpcMgmtEpEltInqDone @@ -432,7 +397,6 @@ @ stub RpcMgmtInqComTimeout @ stub RpcMgmtInqDefaultProtectLevel @ stdcall RpcMgmtInqIfIds(ptr ptr) -@ stub RpcMgmtInqParameter # win9x @ stub RpcMgmtInqServerPrincNameA @ stub RpcMgmtInqServerPrincNameW @ stub RpcMgmtInqStats @@ -440,7 +404,6 @@ @ stub RpcMgmtSetAuthorizationFn @ stdcall RpcMgmtSetCancelTimeout(long) @ stdcall RpcMgmtSetComTimeout(ptr long) -@ stub RpcMgmtSetParameter # win9x @ stdcall RpcMgmtSetServerStackSize(long) @ stub RpcMgmtStatsVectorFree @ stdcall RpcMgmtStopServerListening(ptr) @@ -526,7 +489,6 @@ @ stub SimpleTypeAlignment # wxp @ stub SimpleTypeBufferSize # wxp @ stub SimpleTypeMemorySize # wxp -@ stub StartServiceIfNecessary # win9x @ stdcall TowerConstruct(ptr ptr ptr ptr ptr ptr) @ stdcall TowerExplode(ptr ptr ptr ptr ptr ptr) @ stdcall UuidCompare(ptr ptr ptr) diff --git a/dlls/sane.ds/capability.c b/dlls/sane.ds/capability.c index 6d237db83dd..ad6a166a8b6 100644 --- a/dlls/sane.ds/capability.c +++ b/dlls/sane.ds/capability.c @@ -176,14 +176,14 @@ TW_UINT16 SANE_SaneCapability (pTW_CAPABILITY pCapability, TW_UINT16 action) static TW_BOOL TWAIN_OneValueSet (pTW_CAPABILITY pCapability, TW_UINT32 value) { - pCapability->hContainer = (TW_HANDLE)GlobalAlloc (0, sizeof(TW_ONEVALUE)); + pCapability->hContainer = GlobalAlloc (0, sizeof(TW_ONEVALUE)); if (pCapability->hContainer) { - pTW_ONEVALUE pVal = GlobalLock ((HGLOBAL) pCapability->hContainer); + pTW_ONEVALUE pVal = GlobalLock (pCapability->hContainer); pVal->ItemType = TWTY_UINT32; pVal->Item = value; - GlobalUnlock ((HGLOBAL) pCapability->hContainer); + GlobalUnlock (pCapability->hContainer); return TRUE; } else @@ -192,12 +192,12 @@ static TW_BOOL TWAIN_OneValueSet (pTW_CAPABILITY pCapability, TW_UINT32 value) static TW_BOOL TWAIN_OneValueGet (pTW_CAPABILITY pCapability, TW_UINT32 *pValue) { - pTW_ONEVALUE pVal = GlobalLock ((HGLOBAL) pCapability->hContainer); + pTW_ONEVALUE pVal = GlobalLock (pCapability->hContainer); if (pVal) { *pValue = pVal->Item; - GlobalUnlock ((HGLOBAL) pCapability->hContainer); + GlobalUnlock (pCapability->hContainer); return TRUE; } else diff --git a/dlls/secur32/ntlm.c b/dlls/secur32/ntlm.c index f50b4c67114..3dbdd830af0 100644 --- a/dlls/secur32/ntlm.c +++ b/dlls/secur32/ntlm.c @@ -832,9 +832,9 @@ static SECURITY_STATUS SEC_ENTRY ntlm_InitializeSecurityContextW( helper->crypt.ntlm2.send_a4i = SECUR32_arc4Alloc(); helper->crypt.ntlm2.recv_a4i = SECUR32_arc4Alloc(); SECUR32_arc4Init(helper->crypt.ntlm2.send_a4i, - (BYTE *)helper->crypt.ntlm2.send_seal_key, 16); + helper->crypt.ntlm2.send_seal_key, 16); SECUR32_arc4Init(helper->crypt.ntlm2.recv_a4i, - (BYTE *)helper->crypt.ntlm2.recv_seal_key, 16); + helper->crypt.ntlm2.recv_seal_key, 16); helper->crypt.ntlm2.send_seq_no = 0l; helper->crypt.ntlm2.recv_seq_no = 0l; } diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c index c24236cc16c..5d4b79ebe54 100644 --- a/dlls/setupapi/devinst.c +++ b/dlls/setupapi/devinst.c @@ -1116,7 +1116,7 @@ SetupDiCreateDeviceInfoListExA(const GUID *ClassGuid, { MachineNameW = MultiByteToUnicode(MachineName, CP_ACP); if (MachineNameW == NULL) - return (HDEVINFO)INVALID_HANDLE_VALUE; + return INVALID_HANDLE_VALUE; } hDevInfo = SetupDiCreateDeviceInfoListExW(ClassGuid, hwndParent, @@ -1160,20 +1160,20 @@ SetupDiCreateDeviceInfoListExW(const GUID *ClassGuid, { FIXME("remote support is not implemented\n"); SetLastError(ERROR_INVALID_MACHINENAME); - return (HDEVINFO)INVALID_HANDLE_VALUE; + return INVALID_HANDLE_VALUE; } if (Reserved != NULL) { SetLastError(ERROR_INVALID_PARAMETER); - return (HDEVINFO)INVALID_HANDLE_VALUE; + return INVALID_HANDLE_VALUE; } list = HeapAlloc(GetProcessHeap(), 0, size); if (!list) { SetLastError(ERROR_NOT_ENOUGH_MEMORY); - return (HDEVINFO)INVALID_HANDLE_VALUE; + return INVALID_HANDLE_VALUE; } list->magic = SETUP_DEVICE_INFO_SET_MAGIC; @@ -1243,7 +1243,7 @@ HKEY WINAPI SetupDiCreateDevRegKeyW( TRACE("%p %p %d %d %d %p %s\n", DeviceInfoSet, DeviceInfoData, Scope, HwProfile, KeyType, InfHandle, debugstr_w(InfSectionName)); - if (!DeviceInfoSet || DeviceInfoSet == (HDEVINFO)INVALID_HANDLE_VALUE) + if (!DeviceInfoSet || DeviceInfoSet == INVALID_HANDLE_VALUE) { SetLastError(ERROR_INVALID_HANDLE); return INVALID_HANDLE_VALUE; @@ -1387,7 +1387,7 @@ BOOL WINAPI SetupDiCreateDeviceInfoW( SetLastError(ERROR_INVALID_DEVINST_NAME); return FALSE; } - if (!DeviceInfoSet || DeviceInfoSet == (HDEVINFO)INVALID_HANDLE_VALUE) + if (!DeviceInfoSet || DeviceInfoSet == INVALID_HANDLE_VALUE) { SetLastError(ERROR_INVALID_HANDLE); return FALSE; @@ -1520,7 +1520,7 @@ BOOL WINAPI SetupDiRegisterDeviceInfo( TRACE("%p %p %08x %p %p %p\n", DeviceInfoSet, DeviceInfoData, Flags, CompareProc, CompareContext, DupDeviceInfoData); - if (!DeviceInfoSet || DeviceInfoSet == (HDEVINFO)INVALID_HANDLE_VALUE) + if (!DeviceInfoSet || DeviceInfoSet == INVALID_HANDLE_VALUE) { SetLastError(ERROR_INVALID_HANDLE); return FALSE; @@ -1567,7 +1567,7 @@ BOOL WINAPI SetupDiEnumDeviceInfo( SetLastError(ERROR_INVALID_PARAMETER); return FALSE; } - if (devinfo && devinfo != (HDEVINFO)INVALID_HANDLE_VALUE) + if (devinfo && devinfo != INVALID_HANDLE_VALUE) { struct DeviceInfoSet *list = (struct DeviceInfoSet *)devinfo; if (list->magic == SETUP_DEVICE_INFO_SET_MAGIC) @@ -1907,7 +1907,7 @@ HDEVINFO WINAPI SetupDiGetClassDevsA( enumstrW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); if (!enumstrW) { - ret = (HDEVINFO)INVALID_HANDLE_VALUE; + ret = INVALID_HANDLE_VALUE; goto end; } MultiByteToWideChar(CP_ACP, 0, enumstr, -1, enumstrW, len); @@ -1941,7 +1941,7 @@ HDEVINFO WINAPI SetupDiGetClassDevsExA( enumstrW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); if (!enumstrW) { - ret = (HDEVINFO)INVALID_HANDLE_VALUE; + ret = INVALID_HANDLE_VALUE; goto end; } MultiByteToWideChar(CP_ACP, 0, enumstr, -1, enumstrW, len); @@ -1953,7 +1953,7 @@ HDEVINFO WINAPI SetupDiGetClassDevsExA( if (!machineW) { HeapFree(GetProcessHeap(), 0, enumstrW); - ret = (HDEVINFO)INVALID_HANDLE_VALUE; + ret = INVALID_HANDLE_VALUE; goto end; } MultiByteToWideChar(CP_ACP, 0, machine, -1, machineW, len); @@ -2362,7 +2362,7 @@ BOOL WINAPI SetupDiGetDeviceInfoListDetailA( TRACE("%p %p\n", DeviceInfoSet, DevInfoData); - if (!DeviceInfoSet || DeviceInfoSet == (HDEVINFO)INVALID_HANDLE_VALUE) + if (!DeviceInfoSet || DeviceInfoSet == INVALID_HANDLE_VALUE) { SetLastError(ERROR_INVALID_HANDLE); return FALSE; @@ -2395,7 +2395,7 @@ BOOL WINAPI SetupDiGetDeviceInfoListDetailW( TRACE("%p %p\n", DeviceInfoSet, DevInfoData); - if (!DeviceInfoSet || DeviceInfoSet == (HDEVINFO)INVALID_HANDLE_VALUE) + if (!DeviceInfoSet || DeviceInfoSet == INVALID_HANDLE_VALUE) { SetLastError(ERROR_INVALID_HANDLE); return FALSE; @@ -2470,7 +2470,7 @@ BOOL WINAPI SetupDiCreateDeviceInterfaceW( debugstr_guid(InterfaceClassGuid), debugstr_w(ReferenceString), CreationFlags, DeviceInterfaceData); - if (!DeviceInfoSet || DeviceInfoSet == (HDEVINFO)INVALID_HANDLE_VALUE) + if (!DeviceInfoSet || DeviceInfoSet == INVALID_HANDLE_VALUE) { SetLastError(ERROR_INVALID_HANDLE); return FALSE; @@ -2593,7 +2593,7 @@ HKEY WINAPI SetupDiCreateDeviceInterfaceRegKeyW( TRACE("%p %p %d %08x %p %p\n", DeviceInfoSet, DeviceInterfaceData, Reserved, samDesired, InfHandle, InfSectionName); - if (!DeviceInfoSet || DeviceInfoSet == (HDEVINFO)INVALID_HANDLE_VALUE || + if (!DeviceInfoSet || DeviceInfoSet == INVALID_HANDLE_VALUE || set->magic != SETUP_DEVICE_INFO_SET_MAGIC) { SetLastError(ERROR_INVALID_HANDLE); @@ -2666,7 +2666,7 @@ BOOL WINAPI SetupDiDeleteDeviceInterfaceRegKey( TRACE("%p %p %d\n", DeviceInfoSet, DeviceInterfaceData, Reserved); - if (!DeviceInfoSet || DeviceInfoSet == (HDEVINFO)INVALID_HANDLE_VALUE || + if (!DeviceInfoSet || DeviceInfoSet == INVALID_HANDLE_VALUE || set->magic != SETUP_DEVICE_INFO_SET_MAGIC) { SetLastError(ERROR_INVALID_HANDLE); @@ -2738,7 +2738,7 @@ BOOL WINAPI SetupDiEnumDeviceInterfaces( TRACE("%p, %p, %s, %d, %p\n", DeviceInfoSet, DeviceInfoData, debugstr_guid(InterfaceClassGuid), MemberIndex, DeviceInterfaceData); - if (!DeviceInfoSet || DeviceInfoSet == (HDEVINFO)INVALID_HANDLE_VALUE || + if (!DeviceInfoSet || DeviceInfoSet == INVALID_HANDLE_VALUE || set->magic != SETUP_DEVICE_INFO_SET_MAGIC) { SetLastError(ERROR_INVALID_HANDLE); @@ -2828,7 +2828,7 @@ BOOL WINAPI SetupDiDestroyDeviceInfoList(HDEVINFO devinfo) BOOL ret = FALSE; TRACE("%p\n", devinfo); - if (devinfo && devinfo != (HDEVINFO)INVALID_HANDLE_VALUE) + if (devinfo && devinfo != INVALID_HANDLE_VALUE) { struct DeviceInfoSet *list = (struct DeviceInfoSet *)devinfo; @@ -2872,7 +2872,7 @@ BOOL WINAPI SetupDiGetDeviceInterfaceDetailA( DeviceInterfaceData, DeviceInterfaceDetailData, DeviceInterfaceDetailDataSize, RequiredSize, DeviceInfoData); - if (!DeviceInfoSet || DeviceInfoSet == (HDEVINFO)INVALID_HANDLE_VALUE || + if (!DeviceInfoSet || DeviceInfoSet == INVALID_HANDLE_VALUE || set->magic != SETUP_DEVICE_INFO_SET_MAGIC) { SetLastError(ERROR_INVALID_HANDLE); @@ -2945,7 +2945,7 @@ BOOL WINAPI SetupDiGetDeviceInterfaceDetailW( DeviceInterfaceData, DeviceInterfaceDetailData, DeviceInterfaceDetailDataSize, RequiredSize, DeviceInfoData); - if (!DeviceInfoSet || DeviceInfoSet == (HDEVINFO)INVALID_HANDLE_VALUE || + if (!DeviceInfoSet || DeviceInfoSet == INVALID_HANDLE_VALUE || set->magic != SETUP_DEVICE_INFO_SET_MAGIC) { SetLastError(ERROR_INVALID_HANDLE); @@ -3676,7 +3676,7 @@ HKEY WINAPI SetupDiOpenDevRegKey( TRACE("%p %p %d %d %d %x\n", DeviceInfoSet, DeviceInfoData, Scope, HwProfile, KeyType, samDesired); - if (!DeviceInfoSet || DeviceInfoSet == (HDEVINFO)INVALID_HANDLE_VALUE) + if (!DeviceInfoSet || DeviceInfoSet == INVALID_HANDLE_VALUE) { SetLastError(ERROR_INVALID_HANDLE); return INVALID_HANDLE_VALUE; @@ -3792,7 +3792,7 @@ BOOL WINAPI SetupDiDeleteDevRegKey( TRACE("%p %p %d %d %d\n", DeviceInfoSet, DeviceInfoData, Scope, HwProfile, KeyType); - if (!DeviceInfoSet || DeviceInfoSet == (HDEVINFO)INVALID_HANDLE_VALUE) + if (!DeviceInfoSet || DeviceInfoSet == INVALID_HANDLE_VALUE) { SetLastError(ERROR_INVALID_HANDLE); return FALSE; diff --git a/dlls/setupapi/infparse.c b/dlls/setupapi/infparse.c index 7b440cc916e..d56e45bae4a 100644 --- a/dlls/setupapi/infparse.c +++ b/dlls/setupapi/infparse.c @@ -104,7 +104,7 @@ static RETERR16 get_last_error(void) RETERR16 WINAPI IpOpen16( LPCSTR filename, HINF16 *hinf16 ) { HINF hinf = SetupOpenInfFileA( filename, NULL, INF_STYLE_WIN4, NULL ); - if (hinf == (HINF)INVALID_HANDLE_VALUE) return get_last_error(); + if (hinf == INVALID_HANDLE_VALUE) return get_last_error(); return alloc_hinf16( hinf, hinf16 ); } diff --git a/dlls/setupapi/misc.c b/dlls/setupapi/misc.c index 1e88485348e..a915875c85c 100644 --- a/dlls/setupapi/misc.c +++ b/dlls/setupapi/misc.c @@ -789,7 +789,7 @@ DWORD WINAPI RetreiveFileSecurity(LPCWSTR lpFileName, DWORD dwSize = 0x100; DWORD dwError; - SecDesc = (PSECURITY_DESCRIPTOR)MyMalloc(dwSize); + SecDesc = MyMalloc(dwSize); if (SecDesc == NULL) return ERROR_NOT_ENOUGH_MEMORY; @@ -808,7 +808,7 @@ DWORD WINAPI RetreiveFileSecurity(LPCWSTR lpFileName, return dwError; } - SecDesc = (PSECURITY_DESCRIPTOR)MyRealloc(SecDesc, dwSize); + SecDesc = MyRealloc(SecDesc, dwSize); if (SecDesc == NULL) return ERROR_NOT_ENOUGH_MEMORY; diff --git a/dlls/setupapi/parser.c b/dlls/setupapi/parser.c index f7a9bd4308f..fe2011ef40a 100644 --- a/dlls/setupapi/parser.c +++ b/dlls/setupapi/parser.c @@ -1082,7 +1082,7 @@ WCHAR *PARSER_get_dest_dir( INFCONTEXT *context ) HINF WINAPI SetupOpenInfFileA( PCSTR name, PCSTR class, DWORD style, UINT *error ) { UNICODE_STRING nameW, classW; - HINF ret = (HINF)INVALID_HANDLE_VALUE; + HINF ret = INVALID_HANDLE_VALUE; classW.Buffer = NULL; if (class && !RtlCreateUnicodeStringFromAsciiz( &classW, class )) @@ -1112,11 +1112,11 @@ HINF WINAPI SetupOpenInfFileW( PCWSTR name, PCWSTR class, DWORD style, UINT *err if (strchrW( name, '\\' ) || strchrW( name, '/' )) { - if (!(len = GetFullPathNameW( name, 0, NULL, NULL ))) return (HINF)INVALID_HANDLE_VALUE; + if (!(len = GetFullPathNameW( name, 0, NULL, NULL ))) return INVALID_HANDLE_VALUE; if (!(path = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ))) { SetLastError( ERROR_NOT_ENOUGH_MEMORY ); - return (HINF)INVALID_HANDLE_VALUE; + return INVALID_HANDLE_VALUE; } GetFullPathNameW( name, len, path, NULL ); handle = CreateFileW( path, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0 ); @@ -1130,7 +1130,7 @@ HINF WINAPI SetupOpenInfFileW( PCWSTR name, PCWSTR class, DWORD style, UINT *err if (!(path = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ))) { SetLastError( ERROR_NOT_ENOUGH_MEMORY ); - return (HINF)INVALID_HANDLE_VALUE; + return INVALID_HANDLE_VALUE; } GetWindowsDirectoryW( path, len ); p = path + strlenW(path); @@ -1153,7 +1153,7 @@ HINF WINAPI SetupOpenInfFileW( PCWSTR name, PCWSTR class, DWORD style, UINT *err if (!file) { HeapFree( GetProcessHeap(), 0, path ); - return (HINF)INVALID_HANDLE_VALUE; + return INVALID_HANDLE_VALUE; } TRACE( "%s -> %p\n", debugstr_w(path), file ); file->filename = path; @@ -1171,7 +1171,7 @@ BOOL WINAPI SetupOpenAppendInfFileA( PCSTR name, HINF parent_hinf, UINT *error ) if (!name) return SetupOpenAppendInfFileW( NULL, parent_hinf, error ); child_hinf = SetupOpenInfFileA( name, NULL, INF_STYLE_WIN4, error ); - if (child_hinf == (HINF)INVALID_HANDLE_VALUE) return FALSE; + if (child_hinf == INVALID_HANDLE_VALUE) return FALSE; append_inf_file( parent_hinf, child_hinf ); TRACE( "%p: appended %s (%p)\n", parent_hinf, debugstr_a(name), child_hinf ); return TRUE; @@ -1196,14 +1196,14 @@ BOOL WINAPI SetupOpenAppendInfFileW( PCWSTR name, HINF parent_hinf, UINT *error sizeof(filename)/sizeof(WCHAR), NULL )) { child_hinf = SetupOpenInfFileW( filename, NULL, INF_STYLE_WIN4, error ); - if (child_hinf == (HINF)INVALID_HANDLE_VALUE) return FALSE; + if (child_hinf == INVALID_HANDLE_VALUE) return FALSE; append_inf_file( parent_hinf, child_hinf ); TRACE( "%p: appended %s (%p)\n", parent_hinf, debugstr_w(filename), child_hinf ); } return TRUE; } child_hinf = SetupOpenInfFileW( name, NULL, INF_STYLE_WIN4, error ); - if (child_hinf == (HINF)INVALID_HANDLE_VALUE) return FALSE; + if (child_hinf == INVALID_HANDLE_VALUE) return FALSE; append_inf_file( parent_hinf, child_hinf ); TRACE( "%p: appended %s (%p)\n", parent_hinf, debugstr_w(name), child_hinf ); return TRUE; diff --git a/dlls/setupapi/queue.c b/dlls/setupapi/queue.c index fa212fbd8e8..e63639afdf6 100644 --- a/dlls/setupapi/queue.c +++ b/dlls/setupapi/queue.c @@ -426,7 +426,7 @@ HSPFILEQ WINAPI SetupOpenFileQueue(void) struct file_queue *queue; if (!(queue = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*queue)))) - return (HSPFILEQ)INVALID_HANDLE_VALUE; + return INVALID_HANDLE_VALUE; return queue; } diff --git a/dlls/shdocvw/dochost.c b/dlls/shdocvw/dochost.c index f64ae090e29..c3a22f461df 100644 --- a/dlls/shdocvw/dochost.c +++ b/dlls/shdocvw/dochost.c @@ -25,6 +25,27 @@ WINE_DEFAULT_DEBUG_CHANNEL(shdocvw); static ATOM doc_view_atom = 0; +void push_dochost_task(DocHost *This, task_header_t *task, task_proc_t proc, BOOL send) +{ + task->proc = proc; + + /* FIXME: Don't use lParam */ + if(send) + SendMessageW(This->frame_hwnd, WM_DOCHOSTTASK, 0, (LPARAM)task); + else + PostMessageW(This->frame_hwnd, WM_DOCHOSTTASK, 0, (LPARAM)task); +} + +LRESULT process_dochost_task(DocHost *This, LPARAM lparam) +{ + task_header_t *task = (task_header_t*)lparam; + + task->proc(This, task); + + heap_free(task); + return 0; +} + static void navigate_complete(DocHost *This) { IDispatch *disp = NULL; @@ -59,7 +80,7 @@ static void navigate_complete(DocHost *This) IDispatch_Release(disp); } -static LRESULT navigate2(DocHost *This) +void object_available(DocHost *This) { IHlinkTarget *hlink; HRESULT hres; @@ -68,25 +89,25 @@ static LRESULT navigate2(DocHost *This) if(!This->document) { WARN("document == NULL\n"); - return 0; + return; } hres = IUnknown_QueryInterface(This->document, &IID_IHlinkTarget, (void**)&hlink); if(FAILED(hres)) { FIXME("Could not get IHlinkTarget interface\n"); - return 0; + return; } hres = IHlinkTarget_Navigate(hlink, 0, NULL); IHlinkTarget_Release(hlink); if(FAILED(hres)) { FIXME("Navigate failed\n"); - return 0; + return; } navigate_complete(This); - return 0; + return; } static LRESULT resize_document(DocHost *This, LONG width, LONG height) @@ -117,8 +138,6 @@ static LRESULT WINAPI doc_view_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l switch(msg) { case WM_SIZE: return resize_document(This, LOWORD(lParam), HIWORD(lParam)); - case WB_WM_NAVIGATE2: - return navigate2(This); } return DefWindowProcW(hwnd, msg, wParam, lParam); diff --git a/dlls/shdocvw/iexplore.c b/dlls/shdocvw/iexplore.c index e6387d50937..ca2c868d13d 100644 --- a/dlls/shdocvw/iexplore.c +++ b/dlls/shdocvw/iexplore.c @@ -77,6 +77,8 @@ ie_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) return iewnd_OnDestroy(This); case WM_SIZE: return iewnd_OnSize(This, LOWORD(lparam), HIWORD(lparam)); + case WM_DOCHOSTTASK: + return process_dochost_task(&This->doc_host, lparam); } return DefWindowProcW(hwnd, msg, wparam, lparam); } diff --git a/dlls/shdocvw/navigate.c b/dlls/shdocvw/navigate.c index ad9fc0b21fd..2d46abe2e9f 100644 --- a/dlls/shdocvw/navigate.c +++ b/dlls/shdocvw/navigate.c @@ -20,7 +20,6 @@ #define NONAMELESSSTRUCT #include "wine/debug.h" -#include "wine/unicode.h" #include "shdocvw.h" #include "mshtml.h" @@ -40,8 +39,9 @@ typedef struct { DocHost *doc_host; + LPWSTR url; HGLOBAL post_data; - LPWSTR headers; + BSTR headers; ULONG post_data_len; } BindStatusCallback; @@ -160,7 +160,9 @@ static ULONG WINAPI BindStatusCallback_Release(IBindStatusCallback *iface) IOleClientSite_Release(CLIENTSITE(This->doc_host)); if(This->post_data) GlobalFree(This->post_data); - heap_free(This->headers); + if(This->headers) + SysFreeString(This->headers); + heap_free(This->url); heap_free(This); } @@ -267,10 +269,16 @@ static HRESULT WINAPI BindStatusCallback_OnDataAvailable(IBindStatusCallback *if return E_NOTIMPL; } +static void object_available_proc(DocHost *This, task_header_t *task) +{ + object_available(This); +} + static HRESULT WINAPI BindStatusCallback_OnObjectAvailable(IBindStatusCallback *iface, REFIID riid, IUnknown *punk) { BindStatusCallback *This = BINDSC_THIS(iface); + task_header_t *task; IOleObject *oleobj; HRESULT hres; @@ -300,7 +308,8 @@ static HRESULT WINAPI BindStatusCallback_OnObjectAvailable(IBindStatusCallback * /* FIXME: Call SetAdvise */ /* FIXME: Call Invoke(DISPID_READYSTATE) */ - PostMessageW(This->doc_host->hwnd, WB_WM_NAVIGATE2, 0, 0); + task = heap_alloc(sizeof(*task)); + push_dochost_task(This->doc_host, task, object_available_proc, FALSE); return S_OK; } @@ -379,8 +388,8 @@ static const IHttpNegotiateVtbl HttpNegotiateVtbl = { HttpNegotiate_OnResponse }; -static IBindStatusCallback *create_callback(DocHost *doc_host, PBYTE post_data, - ULONG post_data_len, LPWSTR headers) +static BindStatusCallback *create_callback(DocHost *doc_host, LPCWSTR url, PBYTE post_data, + ULONG post_data_len, LPCWSTR headers) { BindStatusCallback *ret = heap_alloc(sizeof(BindStatusCallback)); @@ -388,9 +397,10 @@ static IBindStatusCallback *create_callback(DocHost *doc_host, PBYTE post_data, ret->lpHttpNegotiateVtbl = &HttpNegotiateVtbl; ret->ref = 1; + ret->url = heap_strdupW(url); ret->post_data = NULL; ret->post_data_len = post_data_len; - ret->headers = NULL; + ret->headers = headers ? SysAllocString(headers) : NULL; ret->doc_host = doc_host; IOleClientSite_AddRef(CLIENTSITE(doc_host)); @@ -400,13 +410,7 @@ static IBindStatusCallback *create_callback(DocHost *doc_host, PBYTE post_data, memcpy(ret->post_data, post_data, post_data_len); } - if(headers) { - int size = (strlenW(headers)+1)*sizeof(WCHAR); - ret->headers = heap_alloc(size); - memcpy(ret->headers, headers, size); - } - - return BINDSC(ret); + return ret; } static void on_before_navigate2(DocHost *This, LPCWSTR url, const BYTE *post_data, @@ -557,12 +561,24 @@ static HRESULT bind_to_object(DocHost *This, IMoniker *mon, LPCWSTR url, IBindCt static const WCHAR httpsW[] = {'h','t','t','p','s',0}; static const WCHAR ftpW[]= {'f','t','p',0}; + if(mon) { + IMoniker_AddRef(mon); + }else { + hres = CreateURLMoniker(NULL, url, &mon); + if(FAILED(hres)) { + WARN("CreateURLMoniker failed: %08x\n", hres); + return hres; + } + } + + CoTaskMemFree(This->url); + hres = IMoniker_GetDisplayName(mon, 0, NULL, &This->url); + if(FAILED(hres)) + FIXME("GetDisplayName failed: %08x\n", hres); + IBindCtx_RegisterObjectParam(bindctx, (LPOLESTR)SZ_HTML_CLIENTSITE_OBJECTPARAM, (IUnknown*)CLIENTSITE(This)); - if(This->frame) - IOleInPlaceFrame_EnableModeless(This->frame, FALSE); - hres = CoInternetParseUrl(url, PARSE_SCHEMA, 0, schema, sizeof(schema)/sizeof(schema[0]), &schema_len, 0); if(SUCCEEDED(hres) && @@ -576,71 +592,75 @@ static HRESULT bind_to_object(DocHost *This, IMoniker *mon, LPCWSTR url, IBindCt hres = S_OK; if(unk) IUnknown_Release(unk); - }else if(try_application_url(This->url)) { + }else if(try_application_url(url)) { hres = S_OK; }else { FIXME("BindToObject failed: %08x\n", hres); } } - if(This->frame) - IOleInPlaceFrame_EnableModeless(This->frame, TRUE); - + IMoniker_Release(mon); return S_OK; } -static HRESULT navigate_mon(DocHost *This, IMoniker *mon, PBYTE post_data, ULONG post_data_len, - LPWSTR headers) +static HRESULT navigate_bsc(DocHost *This, BindStatusCallback *bsc, IMoniker *mon) { - IBindStatusCallback *callback; IBindCtx *bindctx; VARIANT_BOOL cancel = VARIANT_FALSE; - LPWSTR url; HRESULT hres; - IMoniker_GetDisplayName(mon, NULL, NULL, &url); - TRACE("navigating to %s\n", debugstr_w(url)); - - on_before_navigate2(This, url, post_data, post_data_len, headers, &cancel); + on_before_navigate2(This, bsc->url, bsc->post_data, bsc->post_data_len, bsc->headers, &cancel); if(cancel) { FIXME("Navigation canceled\n"); - CoTaskMemFree(url); return S_OK; } if(This->document) deactivate_document(This); - CoTaskMemFree(This->url); - This->url = url; - callback = create_callback(This, post_data, post_data_len, (LPWSTR)headers); - CreateAsyncBindCtx(0, callback, 0, &bindctx); + CreateAsyncBindCtx(0, BINDSC(bsc), 0, &bindctx); - hres = bind_to_object(This, mon, This->url, bindctx, callback); + if(This->frame) + IOleInPlaceFrame_EnableModeless(This->frame, FALSE); + + hres = bind_to_object(This, mon, bsc->url, bindctx, BINDSC(bsc)); + + if(This->frame) + IOleInPlaceFrame_EnableModeless(This->frame, TRUE); - IBindStatusCallback_Release(callback); IBindCtx_Release(bindctx); return hres; } +typedef struct { + task_header_t header; + BindStatusCallback *bsc; +} task_navigate_bsc_t; + +static void navigate_bsc_proc(DocHost *This, task_header_t *t) +{ + task_navigate_bsc_t *task = (task_navigate_bsc_t*)t; + + if(!This->hwnd) + create_doc_view_hwnd(This); + + navigate_bsc(This, task->bsc, NULL); + + IBindStatusCallback_Release(BINDSC(task->bsc)); +} + + HRESULT navigate_url(DocHost *This, LPCWSTR url, const VARIANT *Flags, const VARIANT *TargetFrameName, VARIANT *PostData, VARIANT *Headers) { - IMoniker *mon; + task_navigate_bsc_t *task; PBYTE post_data = NULL; ULONG post_data_len = 0; LPWSTR headers = NULL; - HRESULT hres; TRACE("navigating to %s\n", debugstr_w(url)); - hres = CreateURLMoniker(NULL, url, &mon); - if(FAILED(hres)) { - WARN("CreateURLMoniker failed: %08x\n", hres); - return hres; - } - if((Flags && V_VT(Flags) != VT_EMPTY) || (TargetFrameName && V_VT(TargetFrameName) != VT_EMPTY)) FIXME("Unsupported args (Flags %p:%d; TargetFrameName %p:%d)\n", @@ -664,25 +684,25 @@ HRESULT navigate_url(DocHost *This, LPCWSTR url, const VARIANT *Flags, TRACE("Headers: %s\n", debugstr_w(headers)); } - if(!This->hwnd) - create_doc_view_hwnd(This); - - hres = navigate_mon(This, mon, post_data, post_data_len, headers); + task = heap_alloc(sizeof(*task)); + task->bsc = create_callback(This, url, post_data, post_data_len, headers); - IMoniker_Release(mon); if(post_data) SafeArrayUnaccessData(V_ARRAY(PostData)); - return hres; + push_dochost_task(This, &task->header, navigate_bsc_proc, This->url == NULL); + + return S_OK; } static HRESULT navigate_hlink(DocHost *This, IMoniker *mon, IBindCtx *bindctx, IBindStatusCallback *callback) { IHttpNegotiate *http_negotiate; + BindStatusCallback *bsc; PBYTE post_data = NULL; ULONG post_data_len = 0; - LPWSTR headers = NULL; + LPWSTR headers = NULL, url; BINDINFO bindinfo; DWORD bindf = 0; HRESULT hres; @@ -708,8 +728,16 @@ static HRESULT navigate_hlink(DocHost *This, IMoniker *mon, IBindCtx *bindctx, post_data = bindinfo.stgmedData.u.hGlobal; } - hres = navigate_mon(This, mon, post_data, post_data_len, headers); + hres = IMoniker_GetDisplayName(mon, 0, NULL, &url); + if(FAILED(hres)) + FIXME("GetDisplayName failed: %08x\n", hres); + + bsc = create_callback(This, url, post_data, post_data_len, headers); + CoTaskMemFree(url); + + hres = navigate_bsc(This, bsc, mon); + IBindStatusCallback_Release(BINDSC(bsc)); CoTaskMemFree(headers); ReleaseBindInfo(&bindinfo); diff --git a/dlls/shdocvw/oleobject.c b/dlls/shdocvw/oleobject.c index f07460fee07..8d05b775257 100644 --- a/dlls/shdocvw/oleobject.c +++ b/dlls/shdocvw/oleobject.c @@ -61,6 +61,8 @@ static LRESULT WINAPI shell_embedding_proc(HWND hwnd, UINT msg, WPARAM wParam, L switch(msg) { case WM_SIZE: return resize_window(This, LOWORD(lParam), HIWORD(lParam)); + case WM_DOCHOSTTASK: + return process_dochost_task(&This->doc_host, lParam); } return DefWindowProcW(hwnd, msg, wParam, lParam); diff --git a/dlls/shdocvw/shdocvw.h b/dlls/shdocvw/shdocvw.h index 494bae9cbdc..bc4c2a1708a 100644 --- a/dlls/shdocvw/shdocvw.h +++ b/dlls/shdocvw/shdocvw.h @@ -38,6 +38,8 @@ #include "mshtmhst.h" #include "hlink.h" +#include "wine/unicode.h" + /********************************************************************** * Shell Instance Objects */ @@ -49,6 +51,7 @@ extern HRESULT SHDOCVW_GetShellInstanceObjectClassObject(REFCLSID rclsid, */ typedef struct ConnectionPoint ConnectionPoint; +typedef struct DocHost DocHost; typedef struct { const IConnectionPointContainerVtbl *lpConnectionPointContainerVtbl; @@ -60,7 +63,15 @@ typedef struct { IUnknown *impl; } ConnectionPointContainer; -typedef struct { +struct _task_header_t; + +typedef void (*task_proc_t)(DocHost*, struct _task_header_t*); + +typedef struct _task_header_t { + task_proc_t proc; +} task_header_t; + +struct DocHost { const IOleClientSiteVtbl *lpOleClientSiteVtbl; const IOleInPlaceSiteVtbl *lpOleInPlaceSiteVtbl; const IDocHostUIHandler2Vtbl *lpDocHostUIHandlerVtbl; @@ -90,7 +101,7 @@ typedef struct { VARIANT_BOOL offline; ConnectionPointContainer cps; -} DocHost; +}; struct WebBrowser { /* Interfaces available via WebBrowser object */ @@ -196,17 +207,20 @@ HRESULT WebBrowserV2_Create(IUnknown*,REFIID,void**); void create_doc_view_hwnd(DocHost*); void deactivate_document(DocHost*); +void object_available(DocHost*); void call_sink(ConnectionPoint*,DISPID,DISPPARAMS*); HRESULT navigate_url(DocHost*,LPCWSTR,const VARIANT*,const VARIANT*,VARIANT*,VARIANT*); HRESULT go_home(DocHost*); +#define WM_DOCHOSTTASK (WM_USER+0x300) +void push_dochost_task(DocHost*,task_header_t*,task_proc_t,BOOL); +LRESULT process_dochost_task(DocHost*,LPARAM); + HRESULT InternetExplorer_Create(IUnknown*,REFIID,void**); void InternetExplorer_WebBrowser_Init(InternetExplorer*); HRESULT CUrlHistory_Create(IUnknown*,REFIID,void**); -#define WB_WM_NAVIGATE2 (WM_USER+100) - #define DEFINE_THIS(cls,ifc,iface) ((cls*)((BYTE*)(iface)-offsetof(cls,lp ## ifc ## Vtbl))) /********************************************************************** @@ -241,4 +255,19 @@ static inline BOOL heap_free(void *mem) return HeapFree(GetProcessHeap(), 0, mem); } +static inline LPWSTR heap_strdupW(LPCWSTR str) +{ + LPWSTR ret = NULL; + + if(str) { + DWORD size; + + size = (strlenW(str)+1)*sizeof(WCHAR); + ret = heap_alloc(size); + memcpy(ret, str, size); + } + + return ret; +} + #endif /* __WINE_SHDOCVW_H */ diff --git a/dlls/shell32/autocomplete.c b/dlls/shell32/autocomplete.c index ebe68268c35..4c32b3f9000 100644 --- a/dlls/shell32/autocomplete.c +++ b/dlls/shell32/autocomplete.c @@ -578,8 +578,7 @@ static LRESULT APIENTRY ACEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, if (hr != S_OK) break; - if ((LPWSTR)strstrW(strs, hwndText) == strs) { - + if (strstrW(strs, hwndText) == strs) { if (This->options & ACO_AUTOAPPEND) { SetWindowTextW(hwnd, strs); SendMessageW(hwnd, EM_SETSEL, lstrlenW(hwndText), lstrlenW(strs)); diff --git a/dlls/shell32/brsfolder.c b/dlls/shell32/brsfolder.c index 6eeab5ea525..45e751917e4 100644 --- a/dlls/shell32/brsfolder.c +++ b/dlls/shell32/brsfolder.c @@ -290,7 +290,7 @@ static HTREEITEM InsertTreeViewItem( browse_info *info, IShellFolder * lpsf, tvins.hInsertAfter = NULL; tvins.hParent = hParent; - return (HTREEITEM)TreeView_InsertItemW( info->hwndTreeView, &tvins ); + return TreeView_InsertItemW( info->hwndTreeView, &tvins ); } /****************************************************************************** diff --git a/dlls/shell32/changenotify.c b/dlls/shell32/changenotify.c index 4cd17e9a406..6c1882baa7f 100644 --- a/dlls/shell32/changenotify.c +++ b/dlls/shell32/changenotify.c @@ -423,7 +423,7 @@ DWORD WINAPI NTSHChangeNotifyRegister( FIXME("(%p,0x%08x,0x%08x,0x%08x,0x%08x,%p):semi stub.\n", hwnd,events1,events2,msg,count,idlist); - return (DWORD) SHChangeNotifyRegister(hwnd, events1, events2, msg, count, idlist); + return SHChangeNotifyRegister(hwnd, events1, events2, msg, count, idlist); } /************************************************************************* @@ -448,7 +448,7 @@ HANDLE WINAPI SHChangeNotification_Lock( { idlist = SHAlloc( sizeof(LPCITEMIDLIST *) * node->cidl ); for(i=0; icidl; i++) - idlist[i] = (LPCITEMIDLIST)node->pidlSignaled; + idlist[i] = node->pidlSignaled; *lpwEventId = node->wSignalledEvent; *lppidls = (LPITEMIDLIST*)idlist; node->wSignalledEvent = 0; diff --git a/dlls/shell32/cpanelfolder.c b/dlls/shell32/cpanelfolder.c index aa09edf62c2..fb6672d909e 100644 --- a/dlls/shell32/cpanelfolder.c +++ b/dlls/shell32/cpanelfolder.c @@ -288,7 +288,7 @@ static PIDLCPanelStruct* _ILGetCPanelPointer(LPCITEMIDLIST pidl) LPPIDLDATA pdata = _ILGetDataPointer(pidl); if (pdata && pdata->type==PT_CPLAPPLET) - return (PIDLCPanelStruct*)&(pdata->u.cpanel); + return &pdata->u.cpanel; return NULL; } @@ -436,14 +436,14 @@ static BOOL CreateCPanelEnumList( if (!(wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) { strcpy(p, wfd.cFileName); - SHELL_RegisterCPanelApp((IEnumIDList*)iface, szPath); + SHELL_RegisterCPanelApp(iface, szPath); } } while(FindNextFileA(hFile, &wfd)); FindClose(hFile); } - SHELL_RegisterRegistryCPanelApps((IEnumIDList*)iface, HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Control Panel\\Cpls"); - SHELL_RegisterRegistryCPanelApps((IEnumIDList*)iface, HKEY_CURRENT_USER, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Control Panel\\Cpls"); + SHELL_RegisterRegistryCPanelApps(iface, HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Control Panel\\Cpls"); + SHELL_RegisterRegistryCPanelApps(iface, HKEY_CURRENT_USER, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Control Panel\\Cpls"); } return TRUE; } diff --git a/dlls/shell32/dde.c b/dlls/shell32/dde.c index ea794ad7f09..129f753935f 100644 --- a/dlls/shell32/dde.c +++ b/dlls/shell32/dde.c @@ -111,7 +111,7 @@ static HDDEDATA CALLBACK DdeCallback( case XTYP_WILDCONNECT: return (HDDEDATA)(DWORD_PTR)Dde_OnWildConnect(hsz1, hsz2); case XTYP_REQUEST: - return (HDDEDATA)Dde_OnRequest(uFmt, hconv, hsz1, hsz2); + return Dde_OnRequest(uFmt, hconv, hsz1, hsz2); case XTYP_EXECUTE: return (HDDEDATA)(DWORD_PTR)Dde_OnExecute(hconv, hsz1, hdata); case XTYP_DISCONNECT: diff --git a/dlls/shell32/dialogs.c b/dlls/shell32/dialogs.c index f972cfced49..6c5db441c71 100644 --- a/dlls/shell32/dialogs.c +++ b/dlls/shell32/dialogs.c @@ -103,7 +103,7 @@ void WINAPI RunFileDlg( MessageBoxA (hwndOwner, "Couldn't find dialog.", "Nix", MB_OK) ; return; } - if(!(template = (LPVOID)LoadResource(shell32_hInstance, hRes))) + if(!(template = LoadResource(shell32_hInstance, hRes))) { MessageBoxA (hwndOwner, "Couldn't load dialog.", "Nix", MB_OK) ; return; diff --git a/dlls/shell32/recyclebin.c b/dlls/shell32/recyclebin.c index ddf2fc35e8b..6c26e3d0749 100644 --- a/dlls/shell32/recyclebin.c +++ b/dlls/shell32/recyclebin.c @@ -206,9 +206,9 @@ static HRESULT WINAPI RecycleBin_EnumObjects(IShellFolder2 *iface, HWND hwnd, SH HRESULT ret; int pidls_count; int i=0; - - TRACE("(%p, %p, %x, %p)\n", This, hwnd, (unsigned int)grfFlags, ppenumIDList); - + + TRACE("(%p, %p, %x, %p)\n", This, hwnd, grfFlags, ppenumIDList); + if (grfFlags & SHCONTF_NONFOLDERS) { *ppenumIDList = NULL; @@ -293,7 +293,7 @@ static HRESULT WINAPI RecycleBin_CreateViewObject(IShellFolder2 *iface, HWND hwn static HRESULT WINAPI RecycleBin_GetAttributesOf(IShellFolder2 *This, UINT cidl, LPCITEMIDLIST *apidl, SFGAOF *rgfInOut) { - TRACE("(%p, %d, {%p, ...}, {%x})\n", This, cidl, apidl[0], (unsigned int)*rgfInOut); + TRACE("(%p, %d, {%p, ...}, {%x})\n", This, cidl, apidl[0], *rgfInOut); *rgfInOut &= SFGAO_CANMOVE|SFGAO_CANDELETE|SFGAO_HASPROPSHEET|SFGAO_FILESYSTEM; return S_OK; } @@ -310,7 +310,7 @@ static HRESULT WINAPI RecycleBin_GetDisplayNameOf(IShellFolder2 *This, LPCITEMID { WIN32_FIND_DATAW data; - TRACE("(%p, %p, %x, %p)\n", This, pidl, (unsigned int)uFlags, pName); + TRACE("(%p, %p, %x, %p)\n", This, pidl, uFlags, pName); TRASH_UnpackItemID(&pidl->mkid, NULL, &data); pName->uType = STRRET_WSTR; pName->u.pOleStr = StrDupW(PathFindFileNameW(data.cFileName)); @@ -371,7 +371,7 @@ static HRESULT WINAPI RecycleBin_EnumSearches(IShellFolder2 *iface, IEnumExtraSe static HRESULT WINAPI RecycleBin_GetDefaultColumn(IShellFolder2 *iface, DWORD dwReserved, ULONG *pSort, ULONG *pDisplay) { RecycleBin *This = (RecycleBin *)iface; - TRACE("(%p, %x, %p, %p)\n", This, (unsigned int)dwReserved, pSort, pDisplay); + TRACE("(%p, %x, %p, %p)\n", This, dwReserved, pSort, pDisplay); *pSort = 0; *pDisplay = 0; return S_OK; diff --git a/dlls/shell32/shell.c b/dlls/shell32/shell.c index 0078f572585..981e28c8d24 100644 --- a/dlls/shell32/shell.c +++ b/dlls/shell32/shell.c @@ -133,7 +133,7 @@ end: void WINAPI DragFinish16(HDROP16 h) { TRACE("\n"); - GlobalFree16((HGLOBAL16)h); + GlobalFree16(h); } diff --git a/dlls/shell32/shell32.spec b/dlls/shell32/shell32.spec index 044f4430f1f..6c0d7d8f591 100644 --- a/dlls/shell32/shell32.spec +++ b/dlls/shell32/shell32.spec @@ -49,6 +49,7 @@ 51 stdcall PathResolve(str long long) PathResolveAW 52 stdcall -noname PathGetArgs(str) PathGetArgsAW 53 stdcall DoEnvironmentSubst(long long) DoEnvironmentSubstAW + 54 stub LogoffWindowsDialog 55 stdcall -noname PathQuoteSpaces(ptr) PathQuoteSpacesAW 56 stdcall -noname PathUnquoteSpaces(str) PathUnquoteSpacesAW 57 stdcall -noname PathGetDriveNumber(str) PathGetDriveNumberAW diff --git a/dlls/shell32/shell32_main.c b/dlls/shell32/shell32_main.c index 0b7a8f325bb..37694ba6c4e 100644 --- a/dlls/shell32/shell32_main.c +++ b/dlls/shell32/shell32_main.c @@ -526,7 +526,7 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes, static const WCHAR p1W[] = {'%','1',0}; WCHAR sTemp [MAX_PATH]; - szExt = (LPWSTR) PathFindExtensionW(szFullPath); + szExt = PathFindExtensionW(szFullPath); TRACE("szExt=%s\n", debugstr_w(szExt)); if ( szExt && HCR_MapTypeToValueW(szExt, sTemp, MAX_PATH, TRUE) && @@ -584,7 +584,7 @@ DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path,DWORD dwFileAttributes, static const WCHAR p1W[] = {'%','1',0}; psfi->iIcon = 0; - szExt = (LPWSTR) PathFindExtensionW(sTemp); + szExt = PathFindExtensionW(sTemp); if ( szExt && HCR_MapTypeToValueW(szExt, sTemp, MAX_PATH, TRUE) && HCR_GetDefaultIconW(sTemp, sTemp, MAX_PATH, &icon_idx)) @@ -1090,7 +1090,7 @@ BOOL WINAPI ShellAboutW( HWND hWnd, LPCWSTR szApp, LPCWSTR szOtherStuff, if(!(hRes = FindResourceW(shell32_hInstance, wszSHELL_ABOUT_MSGBOX, (LPWSTR)RT_DIALOG))) return FALSE; - if(!(template = (LPVOID)LoadResource(shell32_hInstance, hRes))) + if(!(template = LoadResource(shell32_hInstance, hRes))) return FALSE; info.szApp = szApp; info.szOtherStuff = szOtherStuff; diff --git a/dlls/shell32/shelllink.c b/dlls/shell32/shelllink.c index c42242cc2ac..6e9ac708cc0 100644 --- a/dlls/shell32/shelllink.c +++ b/dlls/shell32/shelllink.c @@ -1539,7 +1539,7 @@ static HRESULT SHELL_PidlGeticonLocationA(IShellFolder* psf, LPCITEMIDLIST pidl, if (SUCCEEDED(hr)) { IExtractIconA* pei; - hr = IShellFolder_GetUIObjectOf(psf, 0, 1, (LPCITEMIDLIST*)&pidlLast, &IID_IExtractIconA, NULL, (LPVOID*)&pei); + hr = IShellFolder_GetUIObjectOf(psf, 0, 1, &pidlLast, &IID_IExtractIconA, NULL, (LPVOID*)&pei); if (SUCCEEDED(hr)) { hr = IExtractIconA_GetIconLocation(pei, 0, pszIconPath, MAX_PATH, piIcon, NULL); @@ -1918,7 +1918,7 @@ static HRESULT SHELL_PidlGeticonLocationW(IShellFolder* psf, LPCITEMIDLIST pidl, if (SUCCEEDED(hr)) { IExtractIconW* pei; - hr = IShellFolder_GetUIObjectOf(psf, 0, 1, (LPCITEMIDLIST*)&pidlLast, &IID_IExtractIconW, NULL, (LPVOID*)&pei); + hr = IShellFolder_GetUIObjectOf(psf, 0, 1, &pidlLast, &IID_IExtractIconW, NULL, (LPVOID*)&pei); if (SUCCEEDED(hr)) { hr = IExtractIconW_GetIconLocation(pei, 0, pszIconPath, MAX_PATH, piIcon, NULL); diff --git a/dlls/shell32/shfldr_fs.c b/dlls/shell32/shfldr_fs.c index 2b0e407c795..830013bba09 100644 --- a/dlls/shell32/shfldr_fs.c +++ b/dlls/shell32/shfldr_fs.c @@ -588,7 +588,7 @@ IShellFolder_fnGetAttributesOf (IShellFolder2 * iface, UINT cidl, IShellFolder *psfParent = NULL; LPCITEMIDLIST rpidl = NULL; - hr = SHBindToParent(This->pidlRoot, &IID_IShellFolder, (LPVOID*)&psfParent, (LPCITEMIDLIST*)&rpidl); + hr = SHBindToParent(This->pidlRoot, &IID_IShellFolder, (LPVOID*)&psfParent, &rpidl); if(SUCCEEDED(hr)) { SHELL32_GetItemAttributes (psfParent, rpidl, rgfInOut); IShellFolder_Release(psfParent); diff --git a/dlls/shell32/shfldr_mycomp.c b/dlls/shell32/shfldr_mycomp.c index 87530a58163..af9958e82e4 100644 --- a/dlls/shell32/shfldr_mycomp.c +++ b/dlls/shell32/shfldr_mycomp.c @@ -447,7 +447,7 @@ static HRESULT WINAPI ISF_MyComputer_fnGetAttributesOf (IShellFolder2 * iface, IShellFolder *psfParent = NULL; LPCITEMIDLIST rpidl = NULL; - hr = SHBindToParent(This->pidlRoot, &IID_IShellFolder, (LPVOID*)&psfParent, (LPCITEMIDLIST*)&rpidl); + hr = SHBindToParent(This->pidlRoot, &IID_IShellFolder, (LPVOID*)&psfParent, &rpidl); if(SUCCEEDED(hr)) { SHELL32_GetItemAttributes (psfParent, rpidl, rgfInOut); IShellFolder_Release(psfParent); diff --git a/dlls/shell32/shfldr_unixfs.c b/dlls/shell32/shfldr_unixfs.c index 6ec8d11d863..ab1f78a6aa6 100644 --- a/dlls/shell32/shfldr_unixfs.c +++ b/dlls/shell32/shfldr_unixfs.c @@ -947,11 +947,11 @@ static HRESULT WINAPI UnixFolder_IShellFolder2_BindToObject(IShellFolder2* iface } else { clsidChild = This->m_pCLSID; } - + hr = CreateUnixFolder(NULL, &IID_IPersistFolder3, (void**)&persistFolder, clsidChild); if (!SUCCEEDED(hr)) return hr; - hr = IPersistFolder_QueryInterface(persistFolder, riid, (void**)ppvOut); - + hr = IPersistFolder_QueryInterface(persistFolder, riid, ppvOut); + if (SUCCEEDED(hr)) { UnixFolder *subfolder = ADJUST_THIS(UnixFolder, IPersistFolder3, persistFolder); subfolder->m_pidlLocation = ILCombine(This->m_pidlLocation, pidl); diff --git a/dlls/shell32/shlfolder.c b/dlls/shell32/shlfolder.c index 11aeab5b8a7..cff924f8354 100644 --- a/dlls/shell32/shlfolder.c +++ b/dlls/shell32/shlfolder.c @@ -135,7 +135,7 @@ LPCWSTR GetNextElementW (LPCWSTR pszNext, LPWSTR pszOut, DWORD dwOut) while (*pszTail && (*pszTail != (WCHAR) '\\')) pszTail++; - dwCopy = (const WCHAR *) pszTail - (const WCHAR *) pszNext + 1; + dwCopy = pszTail - pszNext + 1; lstrcpynW (pszOut, pszNext, (dwOut < dwCopy) ? dwOut : dwCopy); if (*pszTail) diff --git a/dlls/shell32/shv_item_cmenu.c b/dlls/shell32/shv_item_cmenu.c index b0ec250ed3d..6beb08f0bdf 100644 --- a/dlls/shell32/shv_item_cmenu.c +++ b/dlls/shell32/shv_item_cmenu.c @@ -472,7 +472,7 @@ static HRESULT WINAPI ISvItemCm_fnGetCommandString( switch(idCommand) { case FCIDM_SHVIEW_RENAME: - strcpy((LPSTR)lpszName, "rename"); + strcpy(lpszName, "rename"); hr = NOERROR; break; } diff --git a/dlls/twain_32/README b/dlls/twain_32/README index a1b1940b60d..0b75a3635e2 100644 --- a/dlls/twain_32/README +++ b/dlls/twain_32/README @@ -6,7 +6,7 @@ This library (twain_32.dll) is an implementation of TWAIN API for providing imag 2. WHAT'S IMPLEMENTED -- Functions that dispatch operations specified by the operation triplets to the coresponding function. +- Functions that dispatch operations specified by the operation triplets to the corresponding function. - All the operation triplets related to the Data Source Manager are implemented. Appplication is able to enumerate data sources and open them. diff --git a/dlls/urlmon/umstream.c b/dlls/urlmon/umstream.c index 54037354ea5..7523781d77e 100644 --- a/dlls/urlmon/umstream.c +++ b/dlls/urlmon/umstream.c @@ -221,7 +221,7 @@ static HRESULT WINAPI IStream_fnRead (IStream * iface, if ( !pcbRead) pcbRead = &dwBytesRead; - if ( ! ReadFile( This->handle, pv, cb, (LPDWORD)pcbRead, NULL ) ) + if ( ! ReadFile( This->handle, pv, cb, pcbRead, NULL ) ) return S_FALSE; if (!*pcbRead) diff --git a/dlls/user32/button.c b/dlls/user32/button.c index 74720a0f668..27f10b73598 100644 --- a/dlls/user32/button.c +++ b/dlls/user32/button.c @@ -672,7 +672,7 @@ static UINT BUTTON_CalcLabelRect(HWND hwnd, HDC hdc, RECT *rc) empty_rect: rc->right = r.left; rc->bottom = r.top; - return (UINT)(LONG)-1; + return (UINT)-1; } /* Position label inside bounding rectangle according to diff --git a/dlls/user32/class.c b/dlls/user32/class.c index 733dfa1c338..eee9c1de5fd 100644 --- a/dlls/user32/class.c +++ b/dlls/user32/class.c @@ -1116,10 +1116,10 @@ BOOL WINAPI GetClassInfoExA( HINSTANCE hInstance, LPCSTR name, WNDCLASSEXA *wc ) wc->cbClsExtra = classPtr->cbClsExtra; wc->cbWndExtra = classPtr->cbWndExtra; wc->hInstance = (hInstance == user32_module) ? 0 : hInstance; - wc->hIcon = (HICON)classPtr->hIcon; - wc->hIconSm = (HICON)classPtr->hIconSm; - wc->hCursor = (HCURSOR)classPtr->hCursor; - wc->hbrBackground = (HBRUSH)classPtr->hbrBackground; + wc->hIcon = classPtr->hIcon; + wc->hIconSm = classPtr->hIconSm; + wc->hCursor = classPtr->hCursor; + wc->hbrBackground = classPtr->hbrBackground; wc->lpszMenuName = CLASS_GetMenuNameA( classPtr ); wc->lpszClassName = name; atom = classPtr->atomName; diff --git a/dlls/user32/combo.c b/dlls/user32/combo.c index 6f0fd84cf2d..c39d08ba329 100644 --- a/dlls/user32/combo.c +++ b/dlls/user32/combo.c @@ -1155,7 +1155,7 @@ static void CBRollUp( LPHEADCOMBO lphc, BOOL ok, BOOL bButton ) HWND hWnd = lphc->self; TRACE("[%p]: sel ok? [%i] dropped? [%i]\n", - lphc->self, (INT)ok, (INT)(lphc->wState & CBF_DROPPED)); + lphc->self, ok, (INT)(lphc->wState & CBF_DROPPED)); CB_NOTIFY( lphc, (ok) ? CBN_SELENDOK : CBN_SELENDCANCEL ); diff --git a/dlls/user32/cursoricon.c b/dlls/user32/cursoricon.c index 236b6d59636..6a8282fda28 100644 --- a/dlls/user32/cursoricon.c +++ b/dlls/user32/cursoricon.c @@ -1019,7 +1019,7 @@ static BOOL load_cursor_frame( LPBYTE bits, UINT cbSize, POINT16 hotspot, DWORD INT size; TRACE_(cursor)("%p (%u bytes), ver %08x, %ix%i %s\n", - bits, cbSize, (unsigned)dwVersion, width, height, + bits, cbSize, dwVersion, width, height, (cFlag & LR_MONOCHROME) ? "mono" : "" ); if (dwVersion == 0x00020000) { @@ -1756,7 +1756,7 @@ static HICON CURSORICON_ExtCopy(HICON hIcon, UINT nType, } else { - pDirEntry = (CURSORICONDIRENTRY *)CURSORICON_FindBestCursorRes( + pDirEntry = CURSORICON_FindBestCursorRes( pDir, iDesiredCX, iDesiredCY, 1); } diff --git a/dlls/user32/dde_client.c b/dlls/user32/dde_client.c index 56e42fed261..adec24960c9 100644 --- a/dlls/user32/dde_client.c +++ b/dlls/user32/dde_client.c @@ -717,7 +717,7 @@ static WDML_XACT* WDML_ClientQueuePoke(WDML_CONV* pConv, LPVOID pData, DWORD cbD if (cbData == (DWORD)-1) { - hglobal = (HGLOBAL)pData; + hglobal = pData; dh = (DDE_DATAHANDLE_HEAD *)GlobalLock(hglobal); cbData = GlobalSize(hglobal) - sizeof(DDE_DATAHANDLE_HEAD); pData = (LPVOID)(dh + 1); diff --git a/dlls/user32/dde_server.c b/dlls/user32/dde_server.c index cd32e4a1f2f..a1c2425dce1 100644 --- a/dlls/user32/dde_server.c +++ b/dlls/user32/dde_server.c @@ -98,7 +98,7 @@ BOOL WINAPI DdePostAdvise(DWORD idInst, HSZ hszTopic, HSZ hszItem) hDdeData = WDML_InvokeCallback(pInstance, XTYP_ADVREQ, pLink->uFmt, pLink->hConv, hszTopic, hszItem, 0, --count, 0); - if (hDdeData == (HDDEDATA)CBR_BLOCK) + if (hDdeData == CBR_BLOCK) { /* MS doc is not consistent here */ FIXME("CBR_BLOCK returned for ADVREQ\n"); @@ -463,7 +463,7 @@ static LRESULT CALLBACK WDML_ServerNameProc(HWND hwndServer, UINT iMsg, WPARAM w hDdeData = WDML_InvokeCallback(pInstance, XTYP_WILDCONNECT, 0, 0, hszTop, hszApp, 0, (ULONG_PTR)pcc, self); - if (hDdeData == (HDDEDATA)CBR_BLOCK) + if (hDdeData == CBR_BLOCK) { /* MS doc is not consistent here */ FIXME("CBR_BLOCK returned for WILDCONNECT\n"); diff --git a/dlls/user32/ddeml16.c b/dlls/user32/ddeml16.c index 82648f200d8..4d14e03ea00 100644 --- a/dlls/user32/ddeml16.c +++ b/dlls/user32/ddeml16.c @@ -281,7 +281,7 @@ BOOL16 WINAPI DdeFreeDataHandle16(HDDEDATA hData) */ BOOL16 WINAPI DdeKeepStringHandle16(DWORD idInst, HSZ hsz) { - return (BOOL)DdeKeepStringHandle(idInst, hsz); + return DdeKeepStringHandle(idInst, hsz); } /***************************************************************** diff --git a/dlls/user32/dialog16.c b/dlls/user32/dialog16.c index 72bec00b3a9..6850d35b0d0 100644 --- a/dlls/user32/dialog16.c +++ b/dlls/user32/dialog16.c @@ -548,7 +548,7 @@ INT16 WINAPI GetDlgItemText16( HWND16 hwnd, INT16 id, SEGPTR str, UINT16 len ) void WINAPI SetDlgItemInt16( HWND16 hwnd, INT16 id, UINT16 value, BOOL16 fSigned ) { SetDlgItemInt( WIN_Handle32(hwnd), (UINT)(UINT16)id, - (UINT)(fSigned ? (INT16) value : (UINT16) value), fSigned ); + (UINT)(fSigned ? (INT16) value : value), fSigned ); } diff --git a/dlls/user32/driver.c b/dlls/user32/driver.c index 9e97306ec9e..22b8eaeb8ab 100644 --- a/dlls/user32/driver.c +++ b/dlls/user32/driver.c @@ -318,7 +318,7 @@ static BOOL nulldrv_CreateDesktopWindow( HWND hwnd ) return TRUE; } -static BOOL nulldrv_CreateWindow( HWND hwnd, CREATESTRUCTA *cs, BOOL unicode ) +static BOOL nulldrv_CreateWindow( HWND hwnd ) { static int warned; if (warned++) @@ -375,10 +375,10 @@ static void nulldrv_SetParent( HWND hwnd, HWND parent, HWND old_parent ) { } -static BOOL nulldrv_SetWindowPos( HWND hwnd, HWND insert_after, const RECT *rectWindow, - const RECT *rectClient, UINT swp_flags, const RECT *valid_rects ) +static void nulldrv_SetWindowPos( HWND hwnd, HWND insert_after, UINT swp_flags, + const RECT *window_rect, const RECT *client_rect, + const RECT *visible_rect, const RECT *valid_rects ) { - return FALSE; } static int nulldrv_SetWindowRgn( HWND hwnd, HRGN hrgn, BOOL redraw ) @@ -658,9 +658,9 @@ static BOOL loaderdrv_CreateDesktopWindow( HWND hwnd ) return load_driver()->pCreateDesktopWindow( hwnd ); } -static BOOL loaderdrv_CreateWindow( HWND hwnd, CREATESTRUCTA *cs, BOOL unicode ) +static BOOL loaderdrv_CreateWindow( HWND hwnd ) { - return load_driver()->pCreateWindow( hwnd, cs, unicode ); + return load_driver()->pCreateWindow( hwnd ); } static void loaderdrv_DestroyWindow( HWND hwnd ) @@ -700,10 +700,12 @@ static void loaderdrv_SetParent( HWND hwnd, HWND parent, HWND old_parent ) load_driver()->pSetParent( hwnd, parent, old_parent ); } -static BOOL loaderdrv_SetWindowPos( HWND hwnd, HWND insert_after, const RECT *rectWindow, - const RECT *rectClient, UINT swp_flags, const RECT *valid_rects ) +static void loaderdrv_SetWindowPos( HWND hwnd, HWND insert_after, UINT swp_flags, + const RECT *window_rect, const RECT *client_rect, + const RECT *visible_rect, const RECT *valid_rects ) { - return load_driver()->pSetWindowPos( hwnd, insert_after, rectWindow, rectClient, swp_flags, valid_rects ); + return load_driver()->pSetWindowPos( hwnd, insert_after, swp_flags, window_rect, + client_rect, visible_rect, valid_rects ); } static int loaderdrv_SetWindowRgn( HWND hwnd, HRGN hrgn, BOOL redraw ) diff --git a/dlls/user32/edit.c b/dlls/user32/edit.c index 7f9f24ea055..a3eb1d833bf 100644 --- a/dlls/user32/edit.c +++ b/dlls/user32/edit.c @@ -2165,8 +2165,7 @@ static void EDIT_MoveWordBackward(EDITSTATE *es, BOOL extend) e = li + EDIT_EM_LineLength(es, li); } } else { - e = li + (INT)EDIT_CallWordBreakProc(es, - li, e - li, ll, WB_LEFT); + e = li + EDIT_CallWordBreakProc(es, li, e - li, ll, WB_LEFT); } if (!extend) s = e; diff --git a/dlls/user32/exticon.c b/dlls/user32/exticon.c index 2b54df4dbfe..8e9f9387d8f 100644 --- a/dlls/user32/exticon.c +++ b/dlls/user32/exticon.c @@ -486,10 +486,10 @@ static UINT ICO_ExtractIconExW( if (pCIDir) { - RetPtr[icon] = (HICON)CreateIconFromResourceEx(pCIDir, uSize, TRUE, 0x00030000, + RetPtr[icon] = CreateIconFromResourceEx(pCIDir, uSize, TRUE, 0x00030000, cx1, cy1, flags); if (cx2 && cy2) - RetPtr[++icon] = (HICON)CreateIconFromResourceEx(pCIDir, uSize, TRUE, 0x00030000, + RetPtr[++icon] = CreateIconFromResourceEx(pCIDir, uSize, TRUE, 0x00030000, cx2, cy2, flags); } else @@ -674,11 +674,9 @@ static UINT ICO_ExtractIconExW( RetPtr[i]=0; continue; } - RetPtr[i] = (HICON) CreateIconFromResourceEx(idata,idataent->Size,TRUE,0x00030000, - cx1, cy1, flags); + RetPtr[i] = CreateIconFromResourceEx(idata, idataent->Size, TRUE, 0x00030000, cx1, cy1, flags); if (cx2 && cy2) - RetPtr[++i] = (HICON) CreateIconFromResourceEx(idata,idataent->Size,TRUE,0x00030000, - cx2, cy2, flags); + RetPtr[++i] = CreateIconFromResourceEx(idata, idataent->Size, TRUE, 0x00030000, cx2, cy2, flags); } ret = i; /* return number of retrieved icons */ } /* if(sig == IMAGE_NT_SIGNATURE) */ diff --git a/dlls/user32/input.c b/dlls/user32/input.c index 7796e966938..354272b96af 100644 --- a/dlls/user32/input.c +++ b/dlls/user32/input.c @@ -622,7 +622,18 @@ UINT WINAPI MapVirtualKeyW(UINT code, UINT maptype) */ UINT WINAPI MapVirtualKeyExA(UINT code, UINT maptype, HKL hkl) { - return MapVirtualKeyExW(code, maptype, hkl); + UINT ret; + + ret = MapVirtualKeyExW( code, maptype, hkl ); + if (maptype == MAPVK_VK_TO_CHAR) + { + BYTE ch = 0; + WCHAR wch = ret; + + WideCharToMultiByte( CP_ACP, 0, &wch, 1, (LPSTR)&ch, 1, NULL, NULL ); + ret = ch; + } + return ret; } /****************************************************************************** diff --git a/dlls/user32/menu.c b/dlls/user32/menu.c index cb60ffcf80f..99c4933e9c6 100644 --- a/dlls/user32/menu.c +++ b/dlls/user32/menu.c @@ -1834,7 +1834,7 @@ static BOOL MENU_ShowPopup( HWND hwndOwner, HMENU hmenu, UINT id, /* Display the window */ - SetWindowPos( menu->hWnd, HWND_TOP, 0, 0, 0, 0, + SetWindowPos( menu->hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_SHOWWINDOW | SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE ); UpdateWindow( menu->hWnd ); return TRUE; diff --git a/dlls/user32/msgbox.c b/dlls/user32/msgbox.c index 3331ef5e83a..6aa9a95998f 100644 --- a/dlls/user32/msgbox.c +++ b/dlls/user32/msgbox.c @@ -474,7 +474,7 @@ INT WINAPI MessageBoxIndirectW( LPMSGBOXPARAMSW msgbox ) if (!(hRes = FindResourceExW(user32_module, (LPWSTR)RT_DIALOG, msg_box_res_nameW, msgbox->dwLanguageId))) return 0; - if (!(tmplate = (LPVOID)LoadResource(user32_module, hRes))) + if (!(tmplate = LoadResource(user32_module, hRes))) return 0; if ((msgbox->dwStyle & MB_TASKMODAL) && (msgbox->hwndOwner==NULL)) diff --git a/dlls/user32/sysparams.c b/dlls/user32/sysparams.c index 3b2785e14f5..b323a9be29f 100644 --- a/dlls/user32/sysparams.c +++ b/dlls/user32/sysparams.c @@ -609,7 +609,7 @@ static BOOL SYSPARAMS_LoadRaw( LPCWSTR lpRegKey, LPCWSTR lpValName, LPBYTE lpBuf if ((RegOpenKeyW( get_volatile_regkey(), lpRegKey, &hKey ) == ERROR_SUCCESS) || (RegOpenKeyW( HKEY_CURRENT_USER, lpRegKey, &hKey ) == ERROR_SUCCESS)) { - ret = !RegQueryValueExW( hKey, lpValName, NULL, &type, (LPBYTE)lpBuf, &count); + ret = !RegQueryValueExW( hKey, lpValName, NULL, &type, lpBuf, &count); RegCloseKey( hKey ); } return ret; diff --git a/dlls/user32/tests/class.c b/dlls/user32/tests/class.c index 577a7b858a6..aa2c60a22fe 100644 --- a/dlls/user32/tests/class.c +++ b/dlls/user32/tests/class.c @@ -555,7 +555,8 @@ static void test_instances(void) ok( GetLastError() == ERROR_CLASS_DOES_NOT_EXIST, "Wrong error code %d\n", GetLastError() ); ok( !GetClassInfo( 0, "BUTTON", &wc ), "Button still exists\n" ); ok( GetLastError() == ERROR_CLASS_DOES_NOT_EXIST || - GetLastError() == ERROR_INVALID_PARAMETER /* W2K3 */, + GetLastError() == ERROR_INVALID_PARAMETER || /* W2K3 */ + GetLastError() == ERROR_SUCCESS /* Vista */, "Wrong error code %d\n", GetLastError() ); /* we can change the instance of a system class */ diff --git a/dlls/user32/tests/clipboard.c b/dlls/user32/tests/clipboard.c index 5624408e257..30b170759a2 100644 --- a/dlls/user32/tests/clipboard.c +++ b/dlls/user32/tests/clipboard.c @@ -66,8 +66,9 @@ static void test_ClipboardOwner(void) ok(OpenClipboard(hWnd1), "OpenClipboard failed\n"); SetLastError(0xdeadbeef); - ok(!OpenClipboard(hWnd2) && GetLastError() == 0xdeadbeef, - "OpenClipboard should fail without setting last error value\n"); + ok(!OpenClipboard(hWnd2) && + (GetLastError() == 0xdeadbeef || GetLastError() == ERROR_ACCESS_DENIED), + "OpenClipboard should fail without setting last error value, or with ERROR_ACCESS_DENIED, got error %d\n", GetLastError()); SetLastError(0xdeadbeef); ok(!GetClipboardOwner() && GetLastError() == 0xdeadbeef, "clipboard should still be not owned\n"); @@ -76,8 +77,9 @@ static void test_ClipboardOwner(void) ok(GetClipboardOwner() == hWnd1, "clipboard should be owned by %p, not by %p\n", hWnd1, GetClipboardOwner()); SetLastError(0xdeadbeef); - ok(!OpenClipboard(hWnd2) && GetLastError() == 0xdeadbeef, - "OpenClipboard should fail without setting last error value\n"); + ok(!OpenClipboard(hWnd2) && + (GetLastError() == 0xdeadbeef || GetLastError() == ERROR_ACCESS_DENIED), + "OpenClipboard should fail without setting last error valuei, or with ERROR_ACCESS_DENIED, got error %d\n", GetLastError()); ret = CloseClipboard(); ok( ret, "CloseClipboard error %d\n", GetLastError()); diff --git a/dlls/user32/tests/edit.c b/dlls/user32/tests/edit.c index cd498cc61da..fae1bd121b5 100644 --- a/dlls/user32/tests/edit.c +++ b/dlls/user32/tests/edit.c @@ -625,7 +625,7 @@ static void test_edit_control_4(void) for (i = lo; i < mid; i++) { ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, (LPARAM) i)); - ok(0 == ret, "expected 0 got %d\n", ret); + ok((0 == ret || 1 == ret /* Vista */), "expected 0 or 1 got %d\n", ret); } for (i = mid; i <= hi; i++) { ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, (LPARAM) i)); @@ -643,7 +643,7 @@ static void test_edit_control_4(void) for (i = lo; i < mid; i++) { ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, (LPARAM) i)); - ok(0 == ret, "expected 0 got %d\n", ret); + ok((0 == ret || 1 == ret /* Vista */), "expected 0 or 1 got %d\n", ret); } for (i = mid; i <= hi; i++) { ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, (LPARAM) i)); @@ -661,7 +661,7 @@ static void test_edit_control_4(void) for (i = lo; i < mid; i++) { ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, (LPARAM) i)); - ok(0 == ret, "expected 0 got %d\n", ret); + ok((0 == ret || 1 == ret /* Vista */), "expected 0 or 1 got %d\n", ret); } for (i = mid; i <= hi; i++) { ret = LOWORD(SendMessage(hwEdit, EM_CHARFROMPOS, 0, (LPARAM) i)); diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index ea466af3f6a..280b972a7a8 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -9584,6 +9584,12 @@ static void test_dbcs_wm_char(void) UINT i, j, k; struct message wmCharSeq[2]; + if (!pGetCPInfoExA) + { + skip("GetCPInfoExA is not available\n"); + return; + } + pGetCPInfoExA( CP_ACP, 0, &cpinfo ); if (cpinfo.MaxCharSize != 2) { diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index 49fe7666db6..d0a9673f428 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -3733,6 +3733,43 @@ static LRESULT CALLBACK minmax_wnd_proc(HWND hwnd, UINT msg, WPARAM wp, LPARAM l return 1; } +static int expected_cx, expected_cy; +static RECT expected_rect; + +static LRESULT CALLBACK winsizes_wnd_proc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp) +{ + switch(msg) + { + case WM_GETMINMAXINFO: + { + RECT rect; + GetWindowRect( hwnd, &rect ); + ok( !rect.left && !rect.top && !rect.right && !rect.bottom, + "wrong rect %d,%d-%d,%d\n", rect.left, rect.top, rect.right, rect.bottom ); + return DefWindowProc(hwnd, msg, wp, lp); + } + case WM_NCCREATE: + case WM_CREATE: + { + CREATESTRUCTA *cs = (CREATESTRUCTA *)lp; + RECT rect; + GetWindowRect( hwnd, &rect ); + trace( "hwnd %p msg %x size %dx%d rect %d,%d-%d,%d\n", + hwnd, msg, cs->cx, cs->cy, rect.left, rect.top, rect.right, rect.bottom ); + ok( cs->cx == expected_cx, "wrong x size %d/%d\n", cs->cx, expected_cx ); + ok( cs->cy == expected_cy, "wrong y size %d/%d\n", cs->cy, expected_cy ); + ok( rect.right - rect.left == expected_rect.right - expected_rect.left && + rect.bottom - rect.top == expected_rect.bottom - expected_rect.top, + "wrong rect %d,%d-%d,%d / %d,%d-%d,%d\n", + rect.left, rect.top, rect.right, rect.bottom, + expected_rect.left, expected_rect.top, expected_rect.right, expected_rect.bottom ); + return DefWindowProc(hwnd, msg, wp, lp); + } + default: + return DefWindowProc(hwnd, msg, wp, lp); + } +} + static void test_CreateWindow(void) { WNDCLASS cls; @@ -3986,11 +4023,53 @@ static void test_CreateWindow(void) ok(EqualRect(&rc, &rc_minmax), "rects don't match: (%d,%d-%d,%d) and (%d,%d-%d,%d)\n", rc.left, rc.top, rc.right, rc.bottom, rc_minmax.left, rc_minmax.top, rc_minmax.right, rc_minmax.bottom); + DestroyWindow(hwnd); + + cls.lpfnWndProc = winsizes_wnd_proc; + cls.lpszClassName = "Sizes_WndClass"; + RegisterClass(&cls); + + expected_cx = expected_cy = 200000; + SetRect( &expected_rect, 0, 0, 200000, 200000 ); + hwnd = CreateWindowExA(0, "Sizes_WndClass", NULL, WS_CHILD, 300000, 300000, 200000, 200000, parent, 0, 0, NULL); + ok( hwnd != 0, "creation failed err %u\n", GetLastError()); + GetClientRect( hwnd, &rc ); + ok( rc.right == 200000, "invalid rect right %u\n", rc.right ); + ok( rc.bottom == 200000, "invalid rect bottom %u\n", rc.bottom ); + DestroyWindow(hwnd); + + expected_cx = expected_cy = -10; + SetRect( &expected_rect, 0, 0, 0, 0 ); + hwnd = CreateWindowExA(0, "Sizes_WndClass", NULL, WS_CHILD, -20, -20, -10, -10, parent, 0, 0, NULL); + ok( hwnd != 0, "creation failed err %u\n", GetLastError()); + GetClientRect( hwnd, &rc ); + ok( rc.right == 0, "invalid rect right %u\n", rc.right ); + ok( rc.bottom == 0, "invalid rect bottom %u\n", rc.bottom ); + DestroyWindow(hwnd); + expected_cx = expected_cy = -200000; + SetRect( &expected_rect, 0, 0, 0, 0 ); + hwnd = CreateWindowExA(0, "Sizes_WndClass", NULL, WS_CHILD, -300000, -300000, -200000, -200000, parent, 0, 0, NULL); + ok( hwnd != 0, "creation failed err %u\n", GetLastError()); + GetClientRect( hwnd, &rc ); + ok( rc.right == 0, "invalid rect right %u\n", rc.right ); + ok( rc.bottom == 0, "invalid rect bottom %u\n", rc.bottom ); DestroyWindow(hwnd); + + /* top level window */ + expected_cx = expected_cy = 200000; + SetRect( &expected_rect, 0, 0, GetSystemMetrics(SM_CXMAXTRACK), GetSystemMetrics(SM_CYMAXTRACK) ); + hwnd = CreateWindowExA(0, "Sizes_WndClass", NULL, WS_OVERLAPPEDWINDOW, 300000, 300000, 200000, 200000, 0, 0, 0, NULL); + ok( hwnd != 0, "creation failed err %u\n", GetLastError()); + GetClientRect( hwnd, &rc ); + ok( rc.right <= expected_cx, "invalid rect right %u\n", rc.right ); + ok( rc.bottom <= expected_cy, "invalid rect bottom %u\n", rc.bottom ); + DestroyWindow(hwnd); + DestroyWindow(parent); UnregisterClass("MinMax_WndClass", GetModuleHandle(0)); + UnregisterClass("Sizes_WndClass", GetModuleHandle(0)); #undef expect_menu #undef expect_style diff --git a/dlls/user32/user_private.h b/dlls/user32/user_private.h index 50e86fe2121..fee0f5ef607 100644 --- a/dlls/user32/user_private.h +++ b/dlls/user32/user_private.h @@ -142,7 +142,7 @@ typedef struct tagUSER_DRIVER { BOOL (*pGetMonitorInfo)(HMONITOR,MONITORINFO*); /* windowing functions */ BOOL (*pCreateDesktopWindow)(HWND); - BOOL (*pCreateWindow)(HWND,CREATESTRUCTA*,BOOL); + BOOL (*pCreateWindow)(HWND); void (*pDestroyWindow)(HWND); HDC (*pGetDCEx)(HWND,HRGN,DWORD); DWORD (*pMsgWaitForMultipleObjectsEx)(DWORD,const HANDLE*,DWORD,DWORD,DWORD); @@ -150,7 +150,7 @@ typedef struct tagUSER_DRIVER { BOOL (*pScrollDC)(HDC, INT, INT, const RECT *, const RECT *, HRGN, LPRECT); void (*pSetFocus)(HWND); void (*pSetParent)(HWND,HWND,HWND); - BOOL (*pSetWindowPos)(HWND,HWND,const RECT *,const RECT *,UINT,const RECT *); + void (*pSetWindowPos)(HWND,HWND,UINT,const RECT *,const RECT *,const RECT *,const RECT *); int (*pSetWindowRgn)(HWND,HRGN,BOOL); void (*pSetWindowIcon)(HWND,UINT,HICON); void (*pSetWindowStyle)(HWND,DWORD); diff --git a/dlls/user32/win.c b/dlls/user32/win.c index b1dec05aff1..8e02a5dcd2c 100644 --- a/dlls/user32/win.c +++ b/dlls/user32/win.c @@ -166,6 +166,8 @@ static WND *create_window_handle( HWND parent, HWND owner, LPCWSTR name, win->dwMagic = WND_MAGIC; win->flags = 0; win->cbWndExtra = extra_bytes; + SetRectEmpty( &win->rectWindow ); + SetRectEmpty( &win->rectClient ); memset( win->wExtra, 0, extra_bytes ); CLASS_AddWindow( class, win, unicode ); return win; @@ -861,11 +863,15 @@ static void dump_window_styles( DWORD style, DWORD exstyle ) */ static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, LPCWSTR className, UINT flags ) { - INT sw = SW_SHOW; + INT cx, cy, sw = SW_SHOW; + LRESULT result; + RECT rect; WND *wndPtr; HWND hwnd, parent, owner, top_child = 0; BOOL unicode = (flags & WIN_ISUNICODE) != 0; MDICREATESTRUCTA mdi_cs; + CBT_CREATEWNDA cbtc; + CREATESTRUCTA cbcs; TRACE("%s %s ex=%08x style=%08x %d,%d %dx%d parent=%p menu=%p inst=%p params=%p\n", unicode ? debugstr_w((LPCWSTR)cs->lpszName) : debugstr_a(cs->lpszName), @@ -1076,13 +1082,90 @@ static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, LPCWSTR className, UINT flags } } else SetWindowLongPtrW( hwnd, GWLP_ID, (ULONG_PTR)cs->hMenu ); + + /* call the WH_CBT hook */ + + /* the window style passed to the hook must be the real window style, + * rather than just the window style that the caller to CreateWindowEx + * passed in, so we have to copy the original CREATESTRUCT and get the + * the real style. */ + cbcs = *cs; + cbcs.style = wndPtr->dwStyle; + cbtc.lpcs = &cbcs; + cbtc.hwndInsertAfter = HWND_TOP; WIN_ReleasePtr( wndPtr ); + if (HOOK_CallHooks( WH_CBT, HCBT_CREATEWND, (WPARAM)hwnd, (LPARAM)&cbtc, unicode )) goto failed; + + /* send the WM_GETMINMAXINFO message and fix the size if needed */ - if (!USER_Driver->pCreateWindow( hwnd, cs, unicode)) + cx = cs->cx; + cy = cs->cy; + if ((cs->style & WS_THICKFRAME) || !(cs->style & (WS_POPUP | WS_CHILD))) { - WIN_DestroyWindow( hwnd ); - return 0; + POINT maxSize, maxPos, minTrack, maxTrack; + WINPOS_GetMinMaxInfo( hwnd, &maxSize, &maxPos, &minTrack, &maxTrack); + if (maxTrack.x < cx) cx = maxTrack.x; + if (maxTrack.y < cy) cy = maxTrack.y; + } + + if (cx < 0) cx = 0; + if (cy < 0) cy = 0; + SetRect( &rect, cs->x, cs->y, cs->x + cx, cs->y + cy ); + if (!set_window_pos( hwnd, 0, SWP_NOZORDER | SWP_NOACTIVATE, &rect, &rect, NULL )) goto failed; + + /* send WM_NCCREATE */ + + TRACE( "hwnd %p cs %d,%d %dx%d\n", hwnd, cs->x, cs->y, cx, cy ); + if (unicode) + result = SendMessageW( hwnd, WM_NCCREATE, 0, (LPARAM)cs ); + else + result = SendMessageA( hwnd, WM_NCCREATE, 0, (LPARAM)cs ); + if (!result) + { + WARN( "%p: aborted by WM_NCCREATE\n", hwnd ); + goto failed; + } + + /* send WM_NCCALCSIZE */ + + if ((wndPtr = WIN_GetPtr(hwnd))) + { + /* yes, even if the CBT hook was called with HWND_TOP */ + HWND insert_after = (wndPtr->dwStyle & WS_CHILD) ? HWND_BOTTOM : HWND_TOP; + RECT window_rect = wndPtr->rectWindow; + RECT client_rect = window_rect; + WIN_ReleasePtr( wndPtr ); + SendMessageW( hwnd, WM_NCCALCSIZE, FALSE, (LPARAM)&client_rect ); + set_window_pos( hwnd, insert_after, SWP_NOACTIVATE, &window_rect, &client_rect, NULL ); } + else return 0; + + /* send WM_CREATE */ + + if (unicode) + result = SendMessageW( hwnd, WM_CREATE, 0, (LPARAM)cs ); + else + result = SendMessageA( hwnd, WM_CREATE, 0, (LPARAM)cs ); + if (result == -1) goto failed; + + NotifyWinEvent(EVENT_OBJECT_CREATE, hwnd, OBJID_WINDOW, 0); + + /* send the size messages */ + + if (!(wndPtr = WIN_GetPtr(hwnd))) return 0; + if (!(wndPtr->flags & WIN_NEED_SIZE)) + { + rect = wndPtr->rectClient; + WIN_ReleasePtr( wndPtr ); + SendMessageW( hwnd, WM_SIZE, SIZE_RESTORED, + MAKELONG(rect.right-rect.left, rect.bottom-rect.top)); + SendMessageW( hwnd, WM_MOVE, 0, MAKELONG( rect.left, rect.top ) ); + } + else WIN_ReleasePtr( wndPtr ); + + /* call the driver */ + + if (!USER_Driver->pCreateWindow( hwnd )) goto failed; /* Notify the parent window only */ @@ -1112,6 +1195,10 @@ static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, LPCWSTR className, UINT flags TRACE("created window %p\n", hwnd); return hwnd; + +failed: + WIN_DestroyWindow( hwnd ); + return 0; } @@ -1721,7 +1808,7 @@ static LONG_PTR WIN_GetWindowLong( HWND hwnd, INT offset, UINT size, BOOL unicod case GWLP_USERDATA: retvalue = wndPtr->userdata; break; case GWL_STYLE: retvalue = wndPtr->dwStyle; break; case GWL_EXSTYLE: retvalue = wndPtr->dwExStyle; break; - case GWLP_ID: retvalue = (ULONG_PTR)wndPtr->wIDmenu; break; + case GWLP_ID: retvalue = wndPtr->wIDmenu; break; case GWLP_HINSTANCE: retvalue = (ULONG_PTR)wndPtr->hInstance; break; case GWLP_WNDPROC: /* This looks like a hack only for the edit control (see tests). This makes these controls @@ -2070,7 +2157,7 @@ LONG WINAPI SetWindowLong16( HWND16 hwnd, INT16 offset, LONG newval ) { WNDPROC new_proc = WINPROC_AllocProc16( (WNDPROC16)newval ); WNDPROC old_proc = (WNDPROC)SetWindowLongPtrA( WIN_Handle32(hwnd), offset, (LONG_PTR)new_proc ); - return (LONG)WINPROC_GetProc16( (WNDPROC)old_proc, FALSE ); + return (LONG)WINPROC_GetProc16( old_proc, FALSE ); } else return SetWindowLongA( WIN_Handle32(hwnd), offset, newval ); } diff --git a/dlls/user32/winpos.c b/dlls/user32/winpos.c index 94a95d27017..1eb15d65730 100644 --- a/dlls/user32/winpos.c +++ b/dlls/user32/winpos.c @@ -1563,6 +1563,59 @@ static BOOL fixup_flags( WINDOWPOS *winpos ) return ret; } + +/*********************************************************************** + * set_window_pos + * + * Backend implementation of SetWindowPos. + */ +BOOL set_window_pos( HWND hwnd, HWND insert_after, UINT swp_flags, + const RECT *window_rect, const RECT *client_rect, const RECT *valid_rects ) +{ + WND *win; + BOOL ret; + RECT visible_rect; + + if (!(win = WIN_GetPtr( hwnd ))) return FALSE; + if (win == WND_DESKTOP || win == WND_OTHER_PROCESS) return FALSE; + + SERVER_START_REQ( set_window_pos ) + { + req->handle = hwnd; + req->previous = insert_after; + req->flags = swp_flags; + req->window.left = window_rect->left; + req->window.top = window_rect->top; + req->window.right = window_rect->right; + req->window.bottom = window_rect->bottom; + req->client.left = client_rect->left; + req->client.top = client_rect->top; + req->client.right = client_rect->right; + req->client.bottom = client_rect->bottom; + if (!IsRectEmpty( &valid_rects[0] )) + wine_server_add_data( req, valid_rects, 2 * sizeof(*valid_rects) ); + if ((ret = !wine_server_call( req ))) + { + win->dwStyle = reply->new_style; + win->dwExStyle = reply->new_ex_style; + win->rectWindow = *window_rect; + win->rectClient = *client_rect; + visible_rect.left = reply->visible.left; + visible_rect.top = reply->visible.top; + visible_rect.right = reply->visible.right; + visible_rect.bottom = reply->visible.bottom; + } + } + SERVER_END_REQ; + WIN_ReleasePtr( win ); + + if (ret) + USER_Driver->pSetWindowPos( hwnd, insert_after, swp_flags, window_rect, + client_rect, &visible_rect, valid_rects ); + return ret; +} + + /*********************************************************************** * USER_SetWindowPos * @@ -1606,8 +1659,8 @@ BOOL USER_SetWindowPos( WINDOWPOS * winpos ) SWP_DoNCCalcSize( winpos, &newWindowRect, &newClientRect, valid_rects ); - if(!USER_Driver->pSetWindowPos( winpos->hwnd, winpos->hwndInsertAfter, - &newWindowRect, &newClientRect, orig_flags, valid_rects )) + if (!set_window_pos( winpos->hwnd, winpos->hwndInsertAfter, orig_flags, + &newWindowRect, &newClientRect, valid_rects )) return FALSE; /* erase parent when hiding or resizing child */ diff --git a/dlls/user32/wnd16.c b/dlls/user32/wnd16.c index 99ca2916753..f35840fae9d 100644 --- a/dlls/user32/wnd16.c +++ b/dlls/user32/wnd16.c @@ -716,7 +716,7 @@ LONG WINAPI SetClassLong16( HWND16 hwnd16, INT16 offset, LONG newval ) { WNDPROC new_proc = WINPROC_AllocProc16( (WNDPROC16)newval ); WNDPROC old_proc = (WNDPROC)SetClassLongA( WIN_Handle32(hwnd16), offset, (LONG_PTR)new_proc ); - return (LONG)WINPROC_GetProc16( (WNDPROC)old_proc, FALSE ); + return (LONG)WINPROC_GetProc16( old_proc, FALSE ); } case GCLP_MENUNAME: newval = (LONG)MapSL( newval ); diff --git a/dlls/uxtheme/msstyles.c b/dlls/uxtheme/msstyles.c index 96921e650b9..47f3c94f5f2 100644 --- a/dlls/uxtheme/msstyles.c +++ b/dlls/uxtheme/msstyles.c @@ -1347,10 +1347,10 @@ HRESULT MSSTYLES_GetPropertyRect(PTHEME_PROPERTY tp, RECT *pRect) LPCWSTR lpCur = tp->lpValue; LPCWSTR lpEnd = tp->lpValue + tp->dwValueLen; - MSSTYLES_GetNextInteger(lpCur, lpEnd, &lpCur, (int*)&pRect->left); - MSSTYLES_GetNextInteger(lpCur, lpEnd, &lpCur, (int*)&pRect->top); - MSSTYLES_GetNextInteger(lpCur, lpEnd, &lpCur, (int*)&pRect->right); - if(!MSSTYLES_GetNextInteger(lpCur, lpEnd, &lpCur, (int*)&pRect->bottom)) { + MSSTYLES_GetNextInteger(lpCur, lpEnd, &lpCur, &pRect->left); + MSSTYLES_GetNextInteger(lpCur, lpEnd, &lpCur, &pRect->top); + MSSTYLES_GetNextInteger(lpCur, lpEnd, &lpCur, &pRect->right); + if(!MSSTYLES_GetNextInteger(lpCur, lpEnd, &lpCur, &pRect->bottom)) { TRACE("Could not parse rect property\n"); return E_PROP_ID_UNSUPPORTED; } diff --git a/dlls/vmm.vxd/vmm.c b/dlls/vmm.vxd/vmm.c index f7a54787585..2887a2d81be 100644 --- a/dlls/vmm.vxd/vmm.c +++ b/dlls/vmm.vxd/vmm.c @@ -142,9 +142,9 @@ DWORD WINAPI VMM_VxDCall( DWORD service, CONTEXT86 *context ) LPVOID address; LPVOID ret; DWORD psize = getpagesize(); - ULONG page = (ULONG) stack32_pop( context ); - ULONG npages = (ULONG) stack32_pop( context ); - ULONG flags = (ULONG) stack32_pop( context ); + ULONG page = stack32_pop( context ); + ULONG npages = stack32_pop( context ); + ULONG flags = stack32_pop( context ); TRACE("PageReserve: page: %08x, npages: %08x, flags: %08x partial stub!\n", page, npages, flags ); @@ -172,11 +172,11 @@ DWORD WINAPI VMM_VxDCall( DWORD service, CONTEXT86 *context ) LPVOID ret; DWORD virt_perm; DWORD psize = getpagesize(); - ULONG page = (ULONG) stack32_pop( context ); - ULONG npages = (ULONG) stack32_pop( context ); - ULONG hpd = (ULONG) stack32_pop( context ); - ULONG pagerdata = (ULONG) stack32_pop( context ); - ULONG flags = (ULONG) stack32_pop( context ); + ULONG page = stack32_pop( context ); + ULONG npages = stack32_pop( context ); + ULONG hpd = stack32_pop( context ); + ULONG pagerdata = stack32_pop( context ); + ULONG flags = stack32_pop( context ); TRACE("PageCommit: page: %08x, npages: %08x, hpd: %08x pagerdata: " "%08x, flags: %08x partial stub\n", @@ -202,9 +202,9 @@ DWORD WINAPI VMM_VxDCall( DWORD service, CONTEXT86 *context ) LPVOID address; BOOL ret; DWORD psize = getpagesize(); - ULONG page = (ULONG) stack32_pop( context ); - ULONG npages = (ULONG) stack32_pop( context ); - ULONG flags = (ULONG) stack32_pop( context ); + ULONG page = stack32_pop( context ); + ULONG npages = stack32_pop( context ); + ULONG flags = stack32_pop( context ); TRACE("PageDecommit: page: %08x, npages: %08x, flags: %08x partial stub\n", page, npages, flags ); @@ -277,7 +277,7 @@ DWORD WINAPI VMM_VxDCall( DWORD service, CONTEXT86 *context ) { BOOL ret; LPVOID hmem = (LPVOID) stack32_pop( context ); - DWORD flags = (DWORD ) stack32_pop( context ); + DWORD flags = stack32_pop( context ); TRACE("PageFree: hmem: %p, flags: %08x partial stub\n", hmem, flags ); @@ -407,8 +407,8 @@ DWORD WINAPI VMM_VxDCall( DWORD service, CONTEXT86 *context ) case 0x001e: /* GetDemandPageInfo */ { - DWORD dinfo = (DWORD)stack32_pop( context ); - DWORD flags = (DWORD)stack32_pop( context ); + DWORD dinfo = stack32_pop( context ); + DWORD flags = stack32_pop( context ); /* GetDemandPageInfo is supposed to fill out the struct at * "dinfo" with various low-level memory management information. diff --git a/dlls/winealsa.drv/midi.c b/dlls/winealsa.drv/midi.c index 02657f54ae0..966773622c2 100644 --- a/dlls/winealsa.drv/midi.c +++ b/dlls/winealsa.drv/midi.c @@ -9,7 +9,7 @@ * 98/7 changes for making this MIDI driver work on OSS * current support is limited to MIDI ports of OSS systems * 98/9 rewriting MCI code for MIDI - * 98/11 splitted in midi.c and mcimidi.c + * 98/11 split in midi.c and mcimidi.c * Copyright 2003 Christian Costa : * ALSA port * diff --git a/dlls/winecoreaudio.drv/midi.c b/dlls/winecoreaudio.drv/midi.c index 91984605f15..01eb4538833 100644 --- a/dlls/winecoreaudio.drv/midi.c +++ b/dlls/winecoreaudio.drv/midi.c @@ -7,7 +7,7 @@ * 98/7 changes for making this MIDI driver work on OSS * current support is limited to MIDI ports of OSS systems * 98/9 rewriting MCI code for MIDI - * 98/11 splitted in midi.c and mcimidi.c + * 98/11 split in midi.c and mcimidi.c * Copyright 2006 Emmanuel Maillard * * This library is free software; you can redistribute it and/or diff --git a/dlls/wined3d/basetexture.c b/dlls/wined3d/basetexture.c index 3b8323470e5..a4ad82065f1 100644 --- a/dlls/wined3d/basetexture.c +++ b/dlls/wined3d/basetexture.c @@ -127,7 +127,7 @@ HRESULT WINAPI IWineD3DBaseTextureImpl_GetParent(IWineD3DBaseTexture *iface, IUn IWineD3DBaseTexture IWineD3DBaseTexture parts follow ****************************************************** */ -/* There is no OpenGL equivalent of setLOD, getLOD, all they do it prioritize texture loading +/* There is no OpenGL equivalent of setLOD, getLOD. All they do anyway is prioritize texture loading * so just pretend that they work unless something really needs a failure. */ DWORD WINAPI IWineD3DBaseTextureImpl_SetLOD(IWineD3DBaseTexture *iface, DWORD LODNew) { IWineD3DBaseTextureImpl *This = (IWineD3DBaseTextureImpl *)iface; @@ -362,7 +362,7 @@ static inline void apply_wrap(const GLint textureDimensions, const DWORD state, FIXME("Unrecognized or unsupported WINED3DTADDRESS_U value %d\n", state); } else { if(textureDimensions==GL_TEXTURE_CUBE_MAP_ARB) { - /* Cubemaps are always set to clamp, regardeless of the sampler state. */ + /* Cubemaps are always set to clamp, regardless of the sampler state. */ wrapParm = GL_CLAMP_TO_EDGE; } else { wrapParm = stateLookup[WINELOOKUP_WARPPARAM][state - minLookup[WINELOOKUP_WARPPARAM]]; @@ -420,7 +420,7 @@ void WINAPI IWineD3DBaseTextureImpl_ApplyStateChanges(IWineD3DBaseTexture *iface glValue = stateLookup[WINELOOKUP_MAGFILTER][state - minLookup[WINELOOKUP_MAGFILTER]]; TRACE("ValueMAG=%d setting MAGFILTER to %x\n", state, glValue); glTexParameteri(textureDimensions, GL_TEXTURE_MAG_FILTER, glValue); - /* We need to reset the Aniotropic filtering state when we change the mag filter to WINED3DTEXF_ANISOTROPIC (this seems a bit weird, check the documentation to see how it should be switched off. */ + /* We need to reset the Anisotropic filtering state when we change the mag filter to WINED3DTEXF_ANISOTROPIC (this seems a bit weird, check the documentation to see how it should be switched off. */ if (GL_SUPPORT(EXT_TEXTURE_FILTER_ANISOTROPIC) && WINED3DTEXF_ANISOTROPIC == state && textureDimensions != GL_TEXTURE_RECTANGLE_ARB) { glTexParameteri(textureDimensions, GL_TEXTURE_MAX_ANISOTROPY_EXT, samplerStates[WINED3DSAMP_MAXANISOTROPY]); diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index 9b02cc72b0f..19d2f30d372 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -789,7 +789,7 @@ static inline WineD3DContext *FindContext(IWineD3DDeviceImpl *This, IWineD3DSurf if(This->activeContext && tid == This->lastThread) { context = This->activeContext; } else { - /* This may happen if the app jumps streight into offscreen rendering + /* This may happen if the app jumps straight into offscreen rendering * Start using the context of the primary swapchain. tid == 0 is no problem * for findThreadContextForSwapChain. * diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index abc95da1cd7..1ec8ea8825b 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -894,9 +894,15 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateTexture(IWineD3DDevice *iface, U } /** FIXME: add support for real non-power-two if it's provided by the video card **/ - /* Precalculated scaling for 'faked' non power of two texture coords */ + /* Precalculated scaling for 'faked' non power of two texture coords. + Second also don't use ARB_TEXTURE_RECTANGLE in case the surface format is P8 and EXT_PALETTED_TEXTURE + is used in combination with texture uploads (RTL_READTEX/RTL_TEXTEX). The reason is that EXT_PALETTED_TEXTURE + doesn't work in combination with ARB_TEXTURE_RECTANGLE. + */ if(GL_SUPPORT(ARB_TEXTURE_RECTANGLE) && - (Width != pow2Width || Height != pow2Height)) { + (Width != pow2Width || Height != pow2Height) && + !((Format == WINED3DFMT_P8) && GL_SUPPORT(EXT_PALETTED_TEXTURE) && (wined3d_settings.rendertargetlock_mode == RTL_READTEX || wined3d_settings.rendertargetlock_mode == RTL_TEXTEX))) + { object->baseTexture.pow2Matrix[0] = (float)Width; object->baseTexture.pow2Matrix[5] = (float)Height; object->baseTexture.pow2Matrix[10] = 1.0; @@ -1044,7 +1050,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVolumeTexture(IWineD3DDevice *ifa HRESULT hr; /* Create the volume */ hr = D3DCB_CreateVolume(This->parent, parent, tmpW, tmpH, tmpD, Format, Pool, Usage, - (IWineD3DVolume **)&object->volumes[i], pSharedHandle); + &object->volumes[i], pSharedHandle); if(FAILED(hr)) { ERR("Creating a volume for the volume texture failed(%08x)\n", hr); @@ -1409,7 +1415,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateAdditionalSwapChain(IWineD3DDevic WINED3DDISPLAYMODE Mode; const StaticPixelFormatDesc *formatDesc; - TRACE("(%p) : Created Aditional Swap Chain\n", This); + TRACE("(%p) : Created Additional Swap Chain\n", This); /** FIXME: Test under windows to find out what the life cycle of a swap chain is, * does a device hold a reference to a swap chain giving them a lifetime of the device @@ -1484,7 +1490,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateAdditionalSwapChain(IWineD3DDevic object->presentParms = *pPresentationParameters; TRACE("calling rendertarget CB\n"); - hr = D3DCB_CreateRenderTarget((IUnknown *) This->parent, + hr = D3DCB_CreateRenderTarget(This->parent, parent, object->presentParms.BackBufferWidth, object->presentParms.BackBufferHeight, @@ -1566,7 +1572,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateAdditionalSwapChain(IWineD3DDevic for(i = 0; i < object->presentParms.BackBufferCount; i++) { TRACE("calling rendertarget CB\n"); - hr = D3DCB_CreateRenderTarget((IUnknown *) This->parent, + hr = D3DCB_CreateRenderTarget(This->parent, parent, object->presentParms.BackBufferWidth, object->presentParms.BackBufferHeight, @@ -1601,7 +1607,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateAdditionalSwapChain(IWineD3DDevic if (pPresentationParameters->EnableAutoDepthStencil && hr == WINED3D_OK) { TRACE("Creating depth stencil buffer\n"); if (This->auto_depth_stencil_buffer == NULL ) { - hr = D3DCB_CreateDepthStencil((IUnknown *) This->parent, + hr = D3DCB_CreateDepthStencil(This->parent, parent, object->presentParms.BackBufferWidth, object->presentParms.BackBufferHeight, @@ -2003,7 +2009,7 @@ static void IWineD3DDeviceImpl_LoadLogo(IWineD3DDeviceImpl *This, const char *fi static HRESULT WINAPI IWineD3DDeviceImpl_Init3D(IWineD3DDevice *iface, WINED3DPRESENT_PARAMETERS* pPresentationParameters, D3DCB_CREATEADDITIONALSWAPCHAIN D3DCB_CreateAdditionalSwapChain) { IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *) iface; - IWineD3DSwapChainImpl *swapchain; + IWineD3DSwapChainImpl *swapchain = NULL; HRESULT hr; DWORD state; @@ -2048,7 +2054,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Init3D(IWineD3DDevice *iface, WINED3DPR /* Setup the implicit swapchain */ TRACE("Creating implicit swapchain\n"); - hr=D3DCB_CreateAdditionalSwapChain((IUnknown *) This->parent, pPresentationParameters, (IWineD3DSwapChain **)&swapchain); + hr=D3DCB_CreateAdditionalSwapChain(This->parent, pPresentationParameters, (IWineD3DSwapChain **)&swapchain); if (FAILED(hr) || !swapchain) { WARN("Failed to create implicit swapchain\n"); goto err_out; @@ -2141,7 +2147,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Init3D(IWineD3DDevice *iface, WINED3DPR } return WINED3D_OK; - err_out: +err_out: HeapFree(GetProcessHeap(), 0, This->render_targets); HeapFree(GetProcessHeap(), 0, This->fbo_color_attachments); HeapFree(GetProcessHeap(), 0, This->draw_buffers); @@ -2607,7 +2613,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_MultiplyTransform(IWineD3DDevice *iface FIXME("Unhandled transform state!!\n"); } - multiply_matrix(&temp, mat, (const WINED3DMATRIX *) pMatrix); + multiply_matrix(&temp, mat, pMatrix); /* Apply change via set transform - will reapply to eg. lights this way */ return IWineD3DDeviceImpl_SetTransform(iface, State, &temp); @@ -3179,9 +3185,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetSamplerState(IWineD3DDevice *iface, } if (Sampler >= sizeof(This->stateBlock->samplerState)/sizeof(This->stateBlock->samplerState[0])) { - ERR("Current Sampler overflows sampleState0 array (sampler %d vs size %d)\n", Sampler, - sizeof(This->stateBlock->samplerState)/sizeof(This->stateBlock->samplerState[0]) - ); + ERR("Current Sampler overflows sampleState0 array (sampler %d)\n", Sampler); return WINED3D_OK; /* Windows accepts overflowing this array ... we do not. */ } /** @@ -3230,9 +3234,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_GetSamplerState(IWineD3DDevice *iface, } if (Sampler >= sizeof(This->stateBlock->samplerState)/sizeof(This->stateBlock->samplerState[0])) { - ERR("Current Sampler overflows sampleState0 array (sampler %d vs size %d)\n", Sampler, - sizeof(This->stateBlock->samplerState)/sizeof(This->stateBlock->samplerState[0]) - ); + ERR("Current Sampler overflows sampleState0 array (sampler %d)\n", Sampler); return WINED3D_OK; /* Windows accepts overflowing this array ... we do not. */ } *Value = This->stateBlock->samplerState[Sampler][Type]; @@ -4411,9 +4413,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetTexture(IWineD3DDevice *iface, DWORD } if (Stage >= sizeof(This->stateBlock->textures)/sizeof(This->stateBlock->textures[0])) { - ERR("Current stage overflows textures array (stage %d vs size %d)\n", Stage, - sizeof(This->stateBlock->textures)/sizeof(This->stateBlock->textures[0]) - ); + ERR("Current stage overflows textures array (stage %d)\n", Stage); return WINED3D_OK; /* Windows accepts overflowing this array ... we do not. */ } @@ -4510,9 +4510,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_GetTexture(IWineD3DDevice *iface, DWORD } if (Stage >= sizeof(This->stateBlock->textures)/sizeof(This->stateBlock->textures[0])) { - ERR("Current stage overflows textures array (stage %d vs size %d)\n", Stage, - sizeof(This->stateBlock->textures)/sizeof(This->stateBlock->textures[0]) - ); + ERR("Current stage overflows textures array (stage %d)\n", Stage); return WINED3D_OK; /* Windows accepts overflowing this array ... we do not. */ } @@ -4558,7 +4556,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_GetDisplayMode(IWineD3DDevice *iface, U HRESULT hr; if(iSwapChain > 0) { - hr = IWineD3DDeviceImpl_GetSwapChain(iface, iSwapChain, (IWineD3DSwapChain **)&swapChain); + hr = IWineD3DDeviceImpl_GetSwapChain(iface, iSwapChain, &swapChain); if (hr == WINED3D_OK) { hr = IWineD3DSwapChain_GetDisplayMode(swapChain, pMode); IWineD3DSwapChain_Release(swapChain); @@ -4783,7 +4781,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Present(IWineD3DDevice *iface, for(i = 0 ; i < swapchains ; i ++) { - IWineD3DDeviceImpl_GetSwapChain(iface, i , (IWineD3DSwapChain **)&swapChain); + IWineD3DDeviceImpl_GetSwapChain(iface, i, &swapChain); TRACE("presentinng chain %d, %p\n", i, swapChain); IWineD3DSwapChain_Present(swapChain, pSourceRect, pDestRect, hDestWindowOverride, pDirtyRegion, 0); IWineD3DSwapChain_Release(swapChain); @@ -5238,7 +5236,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_UpdateTexture (IWineD3DDevice *iface, I /* check that both textures have the identical numbers of levels */ if (IWineD3DBaseTexture_GetLevelCount(pDestinationTexture) != IWineD3DBaseTexture_GetLevelCount(pSourceTexture)) { - WARN("(%p) : source (%p) and destination (%p) textures must have identicle numbers of levels, returning WINED3DERR_INVALIDCALL\n", This, pSourceTexture, pDestinationTexture); + WARN("(%p) : source (%p) and destination (%p) textures must have identical numbers of levels, returning WINED3DERR_INVALIDCALL\n", This, pSourceTexture, pDestinationTexture); hr = WINED3DERR_INVALIDCALL; } @@ -5333,7 +5331,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_UpdateTexture (IWineD3DDevice *iface, I static HRESULT WINAPI IWineD3DDeviceImpl_GetFrontBufferData(IWineD3DDevice *iface,UINT iSwapChain, IWineD3DSurface *pDestSurface) { IWineD3DSwapChain *swapChain; HRESULT hr; - hr = IWineD3DDeviceImpl_GetSwapChain(iface, iSwapChain, (IWineD3DSwapChain **)&swapChain); + hr = IWineD3DDeviceImpl_GetSwapChain(iface, iSwapChain, &swapChain); if(hr == WINED3D_OK) { hr = IWineD3DSwapChain_GetFrontBufferData(swapChain, pDestSurface); IWineD3DSwapChain_Release(swapChain); @@ -5442,7 +5440,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_GetRasterStatus(IWineD3DDevice *iface TRACE("(%p) : SwapChain %d returning %p\n", This, iSwapChain, pRasterStatus); - hr = IWineD3DDeviceImpl_GetSwapChain(iface, iSwapChain, (IWineD3DSwapChain **)&swapChain); + hr = IWineD3DDeviceImpl_GetSwapChain(iface, iSwapChain, &swapChain); if(hr == WINED3D_OK){ hr = IWineD3DSwapChain_GetRasterStatus(swapChain, pRasterStatus); IWineD3DSwapChain_Release(swapChain); diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index 679dcbbab99..afd012ae499 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -814,7 +814,7 @@ BOOL IWineD3DImpl_FillGLCaps(WineD3D_GL_Info *gl_info) { * a fixed function pipeline anymore. * * So this is just a check to check that our assumption holds true. If not, write a warning - * and reduce the number of vertex samplers or propably disable vertex texture fetch. + * and reduce the number of vertex samplers or probably disable vertex texture fetch. */ if(gl_info->max_vertex_samplers && MAX_TEXTURES + gl_info->max_vertex_samplers > gl_info->max_combined_samplers) { diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c index 234c23a9d86..5d4d536d814 100644 --- a/dlls/wined3d/drawprim.c +++ b/dlls/wined3d/drawprim.c @@ -669,7 +669,7 @@ static void drawStridedSlowVs(IWineD3DDevice *iface, WineDirect3DVertexStridedDa const DWORD *pIdxBufL = NULL; LONG vx_index; int i; - IWineD3DStateBlockImpl *stateblock = (IWineD3DStateBlockImpl *) This->stateBlock; + IWineD3DStateBlockImpl *stateblock = This->stateBlock; BYTE *ptr; if (idxSize != 0) { diff --git a/dlls/wined3d/indexbuffer.c b/dlls/wined3d/indexbuffer.c index 372b83420b5..4486a9edb03 100644 --- a/dlls/wined3d/indexbuffer.c +++ b/dlls/wined3d/indexbuffer.c @@ -147,7 +147,7 @@ static HRESULT WINAPI IWineD3DIndexBufferImpl_Lock(IWineD3DIndexBuffer *iface, U TRACE("(%p) : offset %d, size %d, Flags=%x\n", This, OffsetToLock, SizeToLock, Flags); InterlockedIncrement(&This->lockcount); - *ppbData = (BYTE *)This->resource.allocatedMemory + OffsetToLock; + *ppbData = This->resource.allocatedMemory + OffsetToLock; if(Flags & (WINED3DLOCK_READONLY | WINED3DLOCK_NO_DIRTY_UPDATE) || This->vbo == 0) { return WINED3D_OK; diff --git a/dlls/wined3d/palette.c b/dlls/wined3d/palette.c index d97799ccda7..6548c97402e 100644 --- a/dlls/wined3d/palette.c +++ b/dlls/wined3d/palette.c @@ -169,8 +169,8 @@ static HRESULT WINAPI IWineD3DPaletteImpl_GetParent(IWineD3DPalette *iface, IUn IWineD3DPaletteImpl *This = (IWineD3DPaletteImpl *)iface; TRACE("(%p)->(%p)\n", This, Parent); - *Parent = (IUnknown *) This->parent; - IUnknown_AddRef( (IUnknown *) This->parent); + *Parent = This->parent; + IUnknown_AddRef(This->parent); return WINED3D_OK; } diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c index 6f0446a357a..17e540bb208 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c @@ -88,7 +88,7 @@ void IWineD3DResourceImpl_CleanUp(IWineD3DResource *iface){ if (This->resource.wineD3DDevice != NULL) { IWineD3DDevice_ResourceReleased((IWineD3DDevice *)This->resource.wineD3DDevice, iface); - }/* NOTE: this is not really an error for systemmem resources */ + }/* NOTE: this is not really an error for system memory resources */ return; } diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index 5e6be54613f..bcb1559ebec 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -351,6 +351,12 @@ static void state_blend(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3D TRACE("glBlendFunc src=%x, dst=%x\n", srcBlend, dstBlend); glBlendFunc(srcBlend, dstBlend); checkGLcall("glBlendFunc"); + + /* colorkey fixup for stage 0 alphaop depends on WINED3DRS_ALPHABLENDENABLE state, + so it may need updating */ + if (stateblock->renderState[WINED3DRS_COLORKEYENABLE]) { + StateTable[STATE_TEXTURESTAGE(0, WINED3DTSS_ALPHAOP)].apply(STATE_TEXTURESTAGE(0, WINED3DTSS_ALPHAOP), stateblock, context); + } } static void state_blendfactor(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) { @@ -1099,7 +1105,7 @@ static void state_fogdensity(DWORD state, IWineD3DStateBlockImpl *stateblock, Wi /* TODO: Merge with primitive type + init_materials()!! */ static void state_colormat(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) { - IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *)stateblock->wineD3DDevice; + IWineD3DDeviceImpl *device = stateblock->wineD3DDevice; GLenum Parm = 0; WineDirect3DStridedData *diffuse = &device->strided_streams.u.s.diffuse; BOOL isDiffuseSupplied; @@ -1950,13 +1956,38 @@ static void tex_alphaop(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3D * cannot remove the texture's alpha channel entirely. * * The fixup is required for Prince of Persia 3D(prison bars), while Moto racer 2 requires D3DTOP_MODULATE to work - * on color keyed surfaces. + * on color keyed surfaces. Aliens vs Predator 1 uses color keyed textures and alpha component of diffuse color to + * draw things like translucent text and perform other blending effects. * + * Aliens vs Predator 1 relies on diffuse alpha having an effect, so it cannot be ignored. To provide the + * behavior expected by the game, while emulating the colorkey, diffuse alpha must be modulated with texture alpha. + * OTOH, Moto racer 2 at some points sets alphaop/alphaarg to SELECTARG/CURRENT, yet puts garbage in diffuse alpha + * (zeroes). This works on native, because the game disables alpha test and alpha blending. Alpha test is overwritten by + * wine's for purposes of color-keying though, so this will lead to missing geometry if texture alpha is modulated + * (pixels fail alpha test). To get around this, ALPHABLENDENABLE state is checked: if the app enables alpha blending, + * it can be expected to provide meaningful values in diffuse alpha, so it should be modulated with texture alpha; + * otherwise, selecting diffuse alpha is ignored in favour of texture alpha. + * What to do with multitexturing? So far no app has been found that uses color keying with multitexturing */ - if(op == WINED3DTOP_DISABLE) op = WINED3DTOP_SELECTARG1; - if(op == WINED3DTOP_SELECTARG1) arg1 = WINED3DTA_TEXTURE; - else if(op == WINED3DTOP_SELECTARG2) arg2 = WINED3DTA_TEXTURE; + if(op == WINED3DTOP_DISABLE) { + arg1 = WINED3DTA_TEXTURE; + op = WINED3DTOP_SELECTARG1; + } + else if(op == WINED3DTOP_SELECTARG1 && arg1 != WINED3DTA_TEXTURE) { + if (stateblock->renderState[WINED3DRS_ALPHABLENDENABLE]) { + arg2 = WINED3DTA_TEXTURE; + op = WINED3DTOP_MODULATE; + } + else arg1 = WINED3DTA_TEXTURE; + } + else if(op == WINED3DTOP_SELECTARG2 && arg2 != WINED3DTA_TEXTURE) { + if (stateblock->renderState[WINED3DRS_ALPHABLENDENABLE]) { + arg1 = WINED3DTA_TEXTURE; + op = WINED3DTOP_MODULATE; + } + else arg2 = WINED3DTA_TEXTURE; + } } } @@ -1998,7 +2029,7 @@ static void transform_texture(DWORD state, IWineD3DStateBlockImpl *stateblock, W } generated = (stateblock->textureState[texUnit][WINED3DTSS_TEXCOORDINDEX] & 0xFFFF0000) != WINED3DTSS_TCI_PASSTHRU; - set_texture_matrix((float *)&stateblock->transforms[WINED3DTS_TEXTURE0 + texUnit].u.m[0][0], + set_texture_matrix(&stateblock->transforms[WINED3DTS_TEXTURE0 + texUnit].u.m[0][0], stateblock->textureState[texUnit][WINED3DTSS_TEXTURETRANSFORMFLAGS], generated, context->last_was_rhw, @@ -2386,7 +2417,7 @@ static void sampler(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DCont } } - IWineD3DBaseTexture_PreLoad((IWineD3DBaseTexture *) stateblock->textures[sampler]); + IWineD3DBaseTexture_PreLoad(stateblock->textures[sampler]); IWineD3DBaseTexture_ApplyStateChanges(stateblock->textures[sampler], stateblock->textureState[sampler], stateblock->samplerState[sampler]); if (GL_SUPPORT(EXT_TEXTURE_LOD_BIAS)) { @@ -2555,12 +2586,12 @@ static void transform_world(DWORD state, IWineD3DStateBlockImpl *stateblock, Win } else { /* In the general case, the view matrix is the identity matrix */ if (stateblock->wineD3DDevice->view_ident) { - glLoadMatrixf((float *) &stateblock->transforms[WINED3DTS_WORLDMATRIX(0)].u.m[0][0]); + glLoadMatrixf(&stateblock->transforms[WINED3DTS_WORLDMATRIX(0)].u.m[0][0]); checkGLcall("glLoadMatrixf"); } else { - glLoadMatrixf((float *) &stateblock->transforms[WINED3DTS_VIEW].u.m[0][0]); + glLoadMatrixf(&stateblock->transforms[WINED3DTS_VIEW].u.m[0][0]); checkGLcall("glLoadMatrixf"); - glMultMatrixf((float *) &stateblock->transforms[WINED3DTS_WORLDMATRIX(0)].u.m[0][0]); + glMultMatrixf(&stateblock->transforms[WINED3DTS_WORLDMATRIX(0)].u.m[0][0]); checkGLcall("glMultMatrixf"); } } @@ -2576,7 +2607,7 @@ static void clipplane(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DCo /* Clip Plane settings are affected by the model view in OpenGL, the View transform in direct3d */ glMatrixMode(GL_MODELVIEW); glPushMatrix(); - glLoadMatrixf((float *) &stateblock->transforms[WINED3DTS_VIEW].u.m[0][0]); + glLoadMatrixf(&stateblock->transforms[WINED3DTS_VIEW].u.m[0][0]); TRACE("Clipplane [%f,%f,%f,%f]\n", stateblock->clipplane[index][0], @@ -2696,7 +2727,7 @@ static void transform_view(DWORD state, IWineD3DStateBlockImpl *stateblock, Wine glMatrixMode(GL_MODELVIEW); checkGLcall("glMatrixMode(GL_MODELVIEW)"); - glLoadMatrixf((float *)(float *) &stateblock->transforms[WINED3DTS_VIEW].u.m[0][0]); + glLoadMatrixf(&stateblock->transforms[WINED3DTS_VIEW].u.m[0][0]); checkGLcall("glLoadMatrixf(...)"); /* Reset lights. TODO: Call light apply func */ @@ -2840,7 +2871,7 @@ static void transform_projection(DWORD state, IWineD3DStateBlockImpl *stateblock } checkGLcall("glScalef"); - glMultMatrixf((float *) &stateblock->transforms[WINED3DTS_PROJECTION].u.m[0][0]); + glMultMatrixf(&stateblock->transforms[WINED3DTS_PROJECTION].u.m[0][0]); checkGLcall("glLoadMatrixf"); } } @@ -3198,9 +3229,9 @@ static void loadVertexData(IWineD3DStateBlockImpl *stateblock, WineDirect3DVerte /* min(WINED3D_ATR_SIZE(position),3) to Disable RHW mode as 'w' coord handling for rhw mode should not impact screen position whereas in GL it does. - This may result in very slightly distorted textures in rhw mode, but - a very minimal different. There's always the other option of - fixing the view matrix to prevent w from having any effect + This may result in very slightly distorted textures in rhw mode. + There's always the other option of fixing the view matrix to + prevent w from having any effect. This only applies to user pointer sources, in VBOs the vertices are fixed up */ @@ -3247,9 +3278,9 @@ static void loadVertexData(IWineD3DStateBlockImpl *stateblock, WineDirect3DVerte /* WARNING: Data here MUST be in RGBA format, so cannot */ /* go directly into fast mode from app pgm, because */ /* directx requires data in BGRA format. */ - /* currently fixupVertices swizzles the format, but this isn't */ + /* currently fixupVertices swizzles the format, but this isn't*/ /* very practical when using VBOS */ - /* NOTE: Unless we write a vertex shader to swizzle the colour */ + /* NOTE: Unless we write a vertex shader to swizzle the colour*/ /* , or the user doesn't care and wants the speed advantage */ if (sd->u.s.diffuse.lpData || sd->u.s.diffuse.VBO) { @@ -3638,7 +3669,7 @@ static void light(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContex /* Light settings are affected by the model view in OpenGL, the View transform in direct3d*/ glMatrixMode(GL_MODELVIEW); glPushMatrix(); - glLoadMatrixf((float *)&stateblock->transforms[WINED3DTS_VIEW].u.m[0][0]); + glLoadMatrixf(&stateblock->transforms[WINED3DTS_VIEW].u.m[0][0]); /* Diffuse: */ colRGBA[0] = lightInfo->OriginalParms.Diffuse.r; diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index a6a040bb57f..cfb47cad81b 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -386,7 +386,7 @@ ULONG WINAPI IWineD3DSurfaceImpl_Release(IWineD3DSurface *iface) { ULONG ref = InterlockedDecrement(&This->resource.ref); TRACE("(%p) : Releasing from %d\n", This, ref + 1); if (ref == 0) { - IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *) This->resource.wineD3DDevice; + IWineD3DDeviceImpl *device = This->resource.wineD3DDevice; renderbuffer_entry_t *entry, *entry2; TRACE("(%p) : cleaning up\n", This); @@ -724,7 +724,7 @@ static void read_from_framebuffer(IWineD3DSurfaceImpl *This, CONST RECT *rect, v } top = mem + pitch * local_rect.top; - bottom = ((BYTE *) mem) + pitch * ( local_rect.bottom - local_rect.top - 1); + bottom = mem + pitch * ( local_rect.bottom - local_rect.top - 1); for(i = 0; i < (local_rect.bottom - local_rect.top) / 2; i++) { memcpy(row, top + off, len); memcpy(top + off, bottom + off, len); @@ -759,7 +759,7 @@ static void read_from_framebuffer(IWineD3DSurfaceImpl *This, CONST RECT *rect, v for(y = local_rect.top; y < local_rect.bottom; y++) { for(x = local_rect.left; x < local_rect.right; x++) { /* start lines pixels */ - BYTE *blue = (BYTE *) ((BYTE *) mem) + y * pitch + x * (sizeof(BYTE) * 3); + BYTE *blue = mem + y * pitch + x * (sizeof(BYTE) * 3); BYTE *green = blue + 1; BYTE *red = green + 1; @@ -993,9 +993,8 @@ static void flush_to_framebuffer_drawpixels(IWineD3DSurfaceImpl *This, GLenum fm GLint prev_store; GLint prev_rasterpos[4]; GLint skipBytes = 0; - BOOL storechanged = FALSE; UINT pitch = IWineD3DSurface_GetPitch((IWineD3DSurface *) This); /* target is argb, 4 byte */ - IWineD3DDeviceImpl *myDevice = (IWineD3DDeviceImpl *) This->resource.wineD3DDevice; + IWineD3DDeviceImpl *myDevice = This->resource.wineD3DDevice; IWineD3DSwapChainImpl *swapchain; /* Activate the correct context for the render target */ @@ -1074,10 +1073,6 @@ static void flush_to_framebuffer_drawpixels(IWineD3DSurfaceImpl *This, GLenum fm /* Reset to previous pack row length */ glPixelStorei(GL_UNPACK_ROW_LENGTH, skipBytes); vcheckGLcall("glPixelStorei GL_UNPACK_ROW_LENGTH"); - if(storechanged) { - glPixelStorei(GL_PACK_SWAP_BYTES, prev_store); - vcheckGLcall("glPixelStorei GL_PACK_SWAP_BYTES"); - } if(!swapchain) { glDrawBuffer(myDevice->offscreenBuffer); @@ -1126,13 +1121,14 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_UnlockRect(IWineD3DSurface *iface) { IWineD3DSurface_GetContainer(iface, &IID_IWineD3DSwapChain, (void **)&swapchain); if(swapchain || (myDevice->render_targets && iface == myDevice->render_targets[0])) { + if(swapchain) IWineD3DSwapChain_Release((IWineD3DSwapChain *) swapchain); + if(wined3d_settings.rendertargetlock_mode == RTL_DISABLE) { static BOOL warned = FALSE; if(!warned) { ERR("The application tries to write to the render target, but render target locking is disabled\n"); warned = TRUE; } - if(swapchain) IWineD3DSwapChain_Release((IWineD3DSwapChain *) swapchain); goto unlock_end; } @@ -1659,7 +1655,7 @@ HRESULT d3dfmt_convert_surface(BYTE *src, BYTE *dst, UINT pitch, UINT width, UIN unsigned char *Dest; for(y = 0; y < height; y++) { Source = (short *) (src + y * pitch); - Dest = (unsigned char *) (dst + y * outpitch); + Dest = dst + y * outpitch; for (x = 0; x < width; x++ ) { long color = (*Source++); /* B */ Dest[0] = 0xff; @@ -1697,7 +1693,7 @@ HRESULT d3dfmt_convert_surface(BYTE *src, BYTE *dst, UINT pitch, UINT width, UIN unsigned char *Dest; for(y = 0; y < height; y++) { Source = (DWORD *) (src + y * pitch); - Dest = (unsigned char *) (dst + y * outpitch); + Dest = dst + y * outpitch; for (x = 0; x < width; x++ ) { long color = (*Source++); /* B */ Dest[0] = ((color >> 16) & 0xff) + 128; /* W */ @@ -1723,7 +1719,7 @@ HRESULT d3dfmt_convert_surface(BYTE *src, BYTE *dst, UINT pitch, UINT width, UIN */ for(y = 0; y < height; y++) { Source = (WORD *) (src + y * pitch); - Dest = (unsigned char *) (dst + y * outpitch); + Dest = dst + y * outpitch; for (x = 0; x < width; x++ ) { short color = (*Source++); unsigned char l = ((color >> 10) & 0xfc); @@ -1776,7 +1772,7 @@ HRESULT d3dfmt_convert_surface(BYTE *src, BYTE *dst, UINT pitch, UINT width, UIN */ for(y = 0; y < height; y++) { Source = (DWORD *) (src + y * pitch); - Dest = (unsigned char *) (dst + y * outpitch); + Dest = dst + y * outpitch; for (x = 0; x < width; x++ ) { long color = (*Source++); /* L */ Dest[2] = ((color >> 16) & 0xff); /* L */ @@ -1793,7 +1789,7 @@ HRESULT d3dfmt_convert_surface(BYTE *src, BYTE *dst, UINT pitch, UINT width, UIN */ for(y = 0; y < height; y++) { Source = (DWORD *) (src + y * pitch); - Dest = (unsigned char *) (dst + y * outpitch); + Dest = dst + y * outpitch; for (x = 0; x < width; x++ ) { long color = (*Source++); /* B */ Dest[0] = ((color >> 16) & 0xff); /* L */ @@ -1812,8 +1808,8 @@ HRESULT d3dfmt_convert_surface(BYTE *src, BYTE *dst, UINT pitch, UINT width, UIN unsigned char *Source; unsigned char *Dest; for(y = 0; y < height; y++) { - Source = (unsigned char *) (src + y * pitch); - Dest = (unsigned char *) (dst + y * outpitch); + Source = src + y * pitch; + Dest = dst + y * outpitch; for (x = 0; x < width; x++ ) { unsigned char color = (*Source++); /* A */ Dest[1] = (color & 0xf0) << 0; @@ -3467,8 +3463,14 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_PrivateSetup(IWineD3DSurface *iface) { This->glRect.right = 0; This->glRect.bottom = 0; } else { - /* Check this after the oversize check - do not make an oversized surface a texture_rectangle one */ - if(This->Flags & SFLAG_NONPOW2 && GL_SUPPORT(ARB_TEXTURE_RECTANGLE)) { + /* Check this after the oversize check - do not make an oversized surface a texture_rectangle one. + Second also don't use ARB_TEXTURE_RECTANGLE in case the surface format is P8 and EXT_PALETTED_TEXTURE + is used in combination with texture uploads (RTL_READTEX/RTL_TEXTEX). The reason is that EXT_PALETTED_TEXTURE + doesn't work in combination with ARB_TEXTURE_RECTANGLE. + */ + if(This->Flags & SFLAG_NONPOW2 && GL_SUPPORT(ARB_TEXTURE_RECTANGLE) && + !((This->resource.format == WINED3DFMT_P8) && GL_SUPPORT(EXT_PALETTED_TEXTURE) && (wined3d_settings.rendertargetlock_mode == RTL_READTEX || wined3d_settings.rendertargetlock_mode == RTL_TEXTEX))) + { This->glDescription.target = GL_TEXTURE_RECTANGLE_ARB; This->pow2Width = This->currentDesc.Width; This->pow2Height = This->currentDesc.Height; diff --git a/dlls/wined3d/surface_base.c b/dlls/wined3d/surface_base.c index f57b9f49ee3..8a6f5469de7 100644 --- a/dlls/wined3d/surface_base.c +++ b/dlls/wined3d/surface_base.c @@ -651,7 +651,7 @@ static HRESULT case 2: COLORFILL_ROW(WORD) case 3: { - BYTE *d = (BYTE *) buf; + BYTE *d = buf; for (x = 0; x < width; x++,d+=3) { d[0] = (color ) & 0xFF; @@ -1427,8 +1427,8 @@ IWineD3DBaseSurfaceImpl_BltFast(IWineD3DSurface *iface, /* Since slock was originally copied from this surface's description, we can just reuse it */ assert(This->resource.allocatedMemory != NULL); - sbuf = (BYTE *)This->resource.allocatedMemory + lock_src.top * pitch + lock_src.left * bpp; - dbuf = (BYTE *)This->resource.allocatedMemory + lock_dst.top * pitch + lock_dst.left * bpp; + sbuf = This->resource.allocatedMemory + lock_src.top * pitch + lock_src.left * bpp; + dbuf = This->resource.allocatedMemory + lock_dst.top * pitch + lock_dst.left * bpp; sEntry = getFormatDescEntry(Src->resource.format, NULL, NULL); dEntry = sEntry; } @@ -1514,8 +1514,8 @@ IWineD3DBaseSurfaceImpl_BltFast(IWineD3DSurface *iface, { BYTE *d, *s; DWORD tmp; - s = (BYTE *) sbuf; - d = (BYTE *) dbuf; + s = sbuf; + d = dbuf; for (y = 0; y < h; y++) { for (x = 0; x < w * 3; x += 3) diff --git a/dlls/wined3d/surface_gdi.c b/dlls/wined3d/surface_gdi.c index 92adcc6743c..30c922a7bc3 100644 --- a/dlls/wined3d/surface_gdi.c +++ b/dlls/wined3d/surface_gdi.c @@ -140,7 +140,7 @@ ULONG WINAPI IWineGDISurfaceImpl_Release(IWineD3DSurface *iface) { ULONG ref = InterlockedDecrement(&This->resource.ref); TRACE("(%p) : Releasing from %d\n", This, ref + 1); if (ref == 0) { - IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *) This->resource.wineD3DDevice; + IWineD3DDeviceImpl *device = This->resource.wineD3DDevice; TRACE("(%p) : cleaning up\n", This); if(This->Flags & SFLAG_DIBSECTION) { @@ -254,7 +254,7 @@ static HRESULT WINAPI IWineGDISurfaceImpl_UnlockRect(IWineD3DSurface *iface) { IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface; - IWineD3DDeviceImpl *dev = (IWineD3DDeviceImpl *) This->resource.wineD3DDevice; + IWineD3DDeviceImpl *dev = This->resource.wineD3DDevice; TRACE("(%p)\n", This); if (!(This->Flags & SFLAG_LOCKED)) @@ -492,7 +492,7 @@ const char* filename) table[i][2] = This->palette->palents[i].peBlue; } for (y = 0; y < This->pow2Height; y++) { - unsigned char *src = (unsigned char *) This->resource.allocatedMemory + (y * 1 * IWineD3DSurface_GetPitch(iface)); + unsigned char *src = This->resource.allocatedMemory + (y * 1 * IWineD3DSurface_GetPitch(iface)); for (x = 0; x < This->pow2Width; x++) { unsigned char color = *src; src += 1; @@ -514,7 +514,7 @@ const char* filename) alpha_shift = get_shift(formatEntry->alphaMask); for (y = 0; y < This->pow2Height; y++) { - unsigned char *src = (unsigned char *) This->resource.allocatedMemory + (y * 1 * IWineD3DSurface_GetPitch(iface)); + unsigned char *src = This->resource.allocatedMemory + (y * 1 * IWineD3DSurface_GetPitch(iface)); for (x = 0; x < This->pow2Width; x++) { unsigned int color; unsigned int comp; diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index eb16700324d..fe37e554953 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -287,7 +287,7 @@ static HRESULT WINAPI IWineD3DTextureImpl_GetSurfaceLevel(IWineD3DTexture *iface if (Level < This->baseTexture.levels) { *ppSurfaceLevel = This->surfaces[Level]; - IWineD3DSurface_AddRef((IWineD3DSurface*) This->surfaces[Level]); + IWineD3DSurface_AddRef(This->surfaces[Level]); hr = WINED3D_OK; TRACE("(%p) : returning %p for level %d\n", This, *ppSurfaceLevel, Level); } diff --git a/dlls/wined3d/vertexbuffer.c b/dlls/wined3d/vertexbuffer.c index 0c4b2c2115d..1093addaa5b 100644 --- a/dlls/wined3d/vertexbuffer.c +++ b/dlls/wined3d/vertexbuffer.c @@ -228,11 +228,11 @@ static inline BOOL process_converted_attribute(IWineD3DVertexBufferImpl *This, data = (((DWORD_PTR) attrib->lpData) + offset) % This->stride; attrib_size = WINED3D_ATR_SIZE(type) * WINED3D_ATR_TYPESIZE(type); for(i = 0; i < attrib_size; i++) { - if(This->conv_map[(DWORD_PTR) data + i] != conv_type) { - TRACE("Byte %ld in vertex changed\n", i + (DWORD_PTR) data); - TRACE("It was type %d, is %d now\n", This->conv_map[(DWORD_PTR) data + i], conv_type); + if(This->conv_map[data + i] != conv_type) { + TRACE("Byte %ld in vertex changed\n", i + data); + TRACE("It was type %d, is %d now\n", This->conv_map[data + i], conv_type); ret = TRUE; - This->conv_map[(DWORD_PTR) data + i] = conv_type; + This->conv_map[data + i] = conv_type; } } return ret; @@ -245,7 +245,7 @@ static inline BOOL check_attribute(IWineD3DVertexBufferImpl *This, const WineDir DWORD type; /* Ignore attributes that do not have our vbo. After that check we can be sure that the attribute is - * there, on nonexistant attribs the vbo is 0. + * there, on nonexistent attribs the vbo is 0. */ if(attrib->VBO != This->vbo) return FALSE; diff --git a/dlls/wined3d/volumetexture.c b/dlls/wined3d/volumetexture.c index 61c26266d8f..9cddb4f1a4b 100644 --- a/dlls/wined3d/volumetexture.c +++ b/dlls/wined3d/volumetexture.c @@ -251,7 +251,7 @@ static HRESULT WINAPI IWineD3DVolumeTextureImpl_GetLevelDesc(IWineD3DVolumeTextu IWineD3DVolumeTextureImpl *This = (IWineD3DVolumeTextureImpl *)iface; if (Level < This->baseTexture.levels) { TRACE("(%p) Level (%d)\n", This, Level); - return IWineD3DVolume_GetDesc((IWineD3DVolume *) This->volumes[Level], pDesc); + return IWineD3DVolume_GetDesc(This->volumes[Level], pDesc); } else { FIXME("(%p) Level (%d)\n", This, Level); } @@ -260,8 +260,8 @@ static HRESULT WINAPI IWineD3DVolumeTextureImpl_GetLevelDesc(IWineD3DVolumeTextu static HRESULT WINAPI IWineD3DVolumeTextureImpl_GetVolumeLevel(IWineD3DVolumeTexture *iface, UINT Level, IWineD3DVolume** ppVolumeLevel) { IWineD3DVolumeTextureImpl *This = (IWineD3DVolumeTextureImpl *)iface; if (Level < This->baseTexture.levels) { - *ppVolumeLevel = (IWineD3DVolume *)This->volumes[Level]; - IWineD3DVolume_AddRef((IWineD3DVolume *) *ppVolumeLevel); + *ppVolumeLevel = This->volumes[Level]; + IWineD3DVolume_AddRef(*ppVolumeLevel); TRACE("(%p) -> level(%d) returning volume@%p\n", This, Level, *ppVolumeLevel); } else { FIXME("(%p) Level(%d) overflow Levels(%d)\n", This, Level, This->baseTexture.levels); @@ -275,7 +275,7 @@ static HRESULT WINAPI IWineD3DVolumeTextureImpl_LockBox(IWineD3DVolumeTexture *i IWineD3DVolumeTextureImpl *This = (IWineD3DVolumeTextureImpl *)iface; if (Level < This->baseTexture.levels) { - hr = IWineD3DVolume_LockBox((IWineD3DVolume *)This->volumes[Level], pLockedVolume, pBox, Flags); + hr = IWineD3DVolume_LockBox(This->volumes[Level], pLockedVolume, pBox, Flags); TRACE("(%p) Level (%d) success(%u)\n", This, Level, hr); } else { @@ -290,7 +290,7 @@ static HRESULT WINAPI IWineD3DVolumeTextureImpl_UnlockBox(IWineD3DVolumeTexture IWineD3DVolumeTextureImpl *This = (IWineD3DVolumeTextureImpl *)iface; if (Level < This->baseTexture.levels) { - hr = IWineD3DVolume_UnlockBox((IWineD3DVolume*) This->volumes[Level]); + hr = IWineD3DVolume_UnlockBox(This->volumes[Level]); TRACE("(%p) -> level(%d) success(%u)\n", This, Level, hr); } else { @@ -304,7 +304,7 @@ static HRESULT WINAPI IWineD3DVolumeTextureImpl_AddDirtyBox(IWineD3DVolumeTextur IWineD3DVolumeTextureImpl *This = (IWineD3DVolumeTextureImpl *)iface; This->baseTexture.dirty = TRUE; TRACE("(%p) : dirtyfication of volume Level (0)\n", This); - return IWineD3DVolume_AddDirtyBox((IWineD3DVolume *) This->volumes[0], pDirtyBox); + return IWineD3DVolume_AddDirtyBox(This->volumes[0], pDirtyBox); } const IWineD3DVolumeTextureVtbl IWineD3DVolumeTexture_Vtbl = diff --git a/dlls/winedos/devices.c b/dlls/winedos/devices.c index 368f8e5afa7..49d84d38997 100644 --- a/dlls/winedos/devices.c +++ b/dlls/winedos/devices.c @@ -145,8 +145,8 @@ static REQUEST_HEADER * get_hdr(int id, void**extra) { void **hdr_ptr = strategy_data[id]; if (extra) - *extra = hdr_ptr ? (void*)(hdr_ptr+1) : (void *)NULL; - return hdr_ptr ? *hdr_ptr : (void *)NULL; + *extra = hdr_ptr ? (void*)(hdr_ptr+1) : NULL; + return hdr_ptr ? *hdr_ptr : NULL; } static void WINAPI nul_strategy(CONTEXT86*ctx) diff --git a/dlls/winedos/dosmem.c b/dlls/winedos/dosmem.c index 3f635c7a8a8..9829f1a5b88 100644 --- a/dlls/winedos/dosmem.c +++ b/dlls/winedos/dosmem.c @@ -300,7 +300,7 @@ LPVOID DOSMEM_AllocBlock(UINT size, UINT16* pseg) } /* curr is the found block */ curr->psp = psp; - if( pseg ) *pseg = (((char*)curr) + 16 - (char*)DOSMEM_dosmem) >> 4; + if( pseg ) *pseg = (((char*)curr) + 16 - DOSMEM_dosmem) >> 4; return (LPVOID) ((char*)curr + 16); } } diff --git a/dlls/winedos/int21.c b/dlls/winedos/int21.c index 75aeb1cc4ff..ac9971431e2 100644 --- a/dlls/winedos/int21.c +++ b/dlls/winedos/int21.c @@ -1720,7 +1720,7 @@ static void INT21_RandomBlockReadFromFCB( CONTEXT86 *context ) } else { disk_transfer_area = INT21_GetCurrentDTA(context); records_requested = CX_reg(context); - bytes_requested = (UINT) records_requested * fcb->logical_record_size; + bytes_requested = records_requested * fcb->logical_record_size; bytes_read = _lread((HFILE) handle, disk_transfer_area, bytes_requested); if (bytes_read != bytes_requested) { TRACE("_lread(%d, %p, %d) failed with %d\n", @@ -1811,7 +1811,7 @@ static void INT21_RandomBlockWriteToFCB( CONTEXT86 *context ) } else { disk_transfer_area = INT21_GetCurrentDTA(context); records_requested = CX_reg(context); - bytes_requested = (UINT) records_requested * fcb->logical_record_size; + bytes_requested = records_requested * fcb->logical_record_size; bytes_written = _lwrite((HFILE) handle, (LPCSTR)disk_transfer_area, bytes_requested); if (bytes_written != bytes_requested) { TRACE("_lwrite(%d, %p, %d) failed with %d\n", @@ -5006,7 +5006,7 @@ void WINAPI DOSVM_Int21Handler( CONTEXT86 *context ) } else { - LPVOID address = (void*)((DWORD)context->SegEs << 4); + LPVOID address = (void*)(context->SegEs << 4); UINT blocksize = DOSMEM_ResizeBlock( address, newsize, FALSE ); RESET_CFLAG(context); diff --git a/dlls/winedos/int2f.c b/dlls/winedos/int2f.c index 7bbf5e47b2d..c5b620f4344 100644 --- a/dlls/winedos/int2f.c +++ b/dlls/winedos/int2f.c @@ -556,7 +556,7 @@ static void MSCDEX_Request(BYTE *driver_request, BOOL dorealmode) * the following tests are wrong because lots of functions don't require the * tray to be closed with a CD inside */ - TRACE("CDROM device driver -> command <%d>\n", (unsigned char)driver_request[2]); + TRACE("CDROM device driver -> command <%d>\n", driver_request[2]); MSCDEX_Dump("Beg", driver_request, dorealmode); @@ -846,8 +846,7 @@ static void MSCDEX_Request(BYTE *driver_request, BOOL dorealmode) at = PTR_AT(driver_request, 20, DWORD); - TRACE(" --> SEEK AUDIO mode :<0x%02X>, [%d]\n", - (BYTE)driver_request[13], at); + TRACE(" --> SEEK AUDIO mode :<0x%02X>, [%d]\n", driver_request[13], at); switch (driver_request[13]) { case 1: /* Red book addressing mode = 0:m:s:f */ @@ -881,8 +880,7 @@ static void MSCDEX_Request(BYTE *driver_request, BOOL dorealmode) beg = end = PTR_AT(driver_request, 14, DWORD); end += PTR_AT(driver_request, 18, DWORD); - TRACE(" --> PLAY AUDIO mode :<0x%02X>, [%d-%d]\n", - (BYTE)driver_request[13], beg, end); + TRACE(" --> PLAY AUDIO mode :<0x%02X>, [%d-%d]\n", driver_request[13], beg, end); switch (driver_request[13]) { case 1: diff --git a/dlls/winedos/ioports.c b/dlls/winedos/ioports.c index 13079a77b29..e9f4f7f148b 100644 --- a/dlls/winedos/ioports.c +++ b/dlls/winedos/ioports.c @@ -608,7 +608,7 @@ void WINAPI DOSVM_outport( int port, int size, DWORD value ) break; case 0x61: parport_8255[1] = (BYTE)value; - if ((((BYTE)parport_8255[1] & 3) == 3) && (tmr_8253[2].countmax != 1)) + if (((parport_8255[1] & 3) == 3) && (tmr_8253[2].countmax != 1)) { TRACE("Beep (freq: %d) !\n", 1193180 / tmr_8253[2].countmax); Beep(1193180 / tmr_8253[2].countmax, 20); diff --git a/dlls/winedos/vga.c b/dlls/winedos/vga.c index 2a07f219e47..d236591e1cb 100644 --- a/dlls/winedos/vga.c +++ b/dlls/winedos/vga.c @@ -553,7 +553,7 @@ char VGA_GetColor16(int reg) { if (!lpddraw) return 0; - return (char)vga_16_palette[reg]; + return vga_16_palette[reg]; } /* set all 17 [char wide] colors at once in 16 color mode. */ diff --git a/dlls/winedos/vxd.c b/dlls/winedos/vxd.c index 4a1eabf5bfc..0b3602a6332 100644 --- a/dlls/winedos/vxd.c +++ b/dlls/winedos/vxd.c @@ -875,7 +875,7 @@ void WINAPI VXD_Win32s( CONTEXT86 *context ) * Output: EAX: 1 if OK */ - TRACE("UnMapModule: %x\n", (DWORD)W32S_APP2WINE(context->Edx)); + TRACE("UnMapModule: %x\n", W32S_APP2WINE(context->Edx)); /* As we didn't map anything, there's nothing to unmap ... */ diff --git a/dlls/wineoss.drv/midi.c b/dlls/wineoss.drv/midi.c index 10e026f60d2..4245ad0cf91 100644 --- a/dlls/wineoss.drv/midi.c +++ b/dlls/wineoss.drv/midi.c @@ -9,7 +9,7 @@ * 98/7 changes for making this MIDI driver work on OSS * current support is limited to MIDI ports of OSS systems * 98/9 rewriting MCI code for MIDI - * 98/11 splitted in midi.c and mcimidi.c + * 98/11 split in midi.c and mcimidi.c * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/dlls/wineps.drv/builtin.c b/dlls/wineps.drv/builtin.c index 01547db17a0..c075049914c 100644 --- a/dlls/wineps.drv/builtin.c +++ b/dlls/wineps.drv/builtin.c @@ -413,7 +413,7 @@ BOOL PSDRV_EnumDeviceFonts( PSDRV_PDEVICE *physDev, LPLOGFONTW plf, FONTFAMILY *family; char FaceName[LF_FACESIZE]; - if( plf->lfFaceName[0] ) { + if( plf && plf->lfFaceName[0] ) { WideCharToMultiByte(CP_ACP, 0, plf->lfFaceName, -1, FaceName, sizeof(FaceName), NULL, NULL); TRACE("lfFaceName = '%s'\n", FaceName); diff --git a/dlls/winex11.drv/clipboard.c b/dlls/winex11.drv/clipboard.c index 7731ae0fbaa..453746f3a25 100644 --- a/dlls/winex11.drv/clipboard.c +++ b/dlls/winex11.drv/clipboard.c @@ -1903,8 +1903,8 @@ static int X11DRV_CLIPBOARD_QueryAvailableData(LPCLIPBOARDINFO lpcbinfo) * The TARGETS property should have returned us a list of atoms * corresponding to each selection target format supported. */ - if ((atype == XA_ATOM || atype == x11drv_atom(TARGETS)) && aformat == 32) - X11DRV_CLIPBOARD_InsertSelectionProperties(display, targetList, cSelectionTargets); + if (atype == XA_ATOM || atype == x11drv_atom(TARGETS)) + X11DRV_CLIPBOARD_InsertSelectionProperties(display, targetList, (cSelectionTargets * aformat / (8 * sizeof(Atom)))); /* Free the list of targets */ wine_tsx11_lock(); diff --git a/dlls/winex11.drv/desktop.c b/dlls/winex11.drv/desktop.c index 23c92886ec7..e66d38345dc 100644 --- a/dlls/winex11.drv/desktop.c +++ b/dlls/winex11.drv/desktop.c @@ -121,6 +121,7 @@ void X11DRV_init_desktop( Window win, unsigned int width, unsigned int height ) int refresh_count = 0; char *elem, *bufferp = buffer_copy; root_window = win; + managed_mode = 0; /* no managed windows in desktop mode */ max_width = screen_width; max_height = screen_height; xinerama_init( width, height ); diff --git a/dlls/winex11.drv/dib.c b/dlls/winex11.drv/dib.c index fc71c244621..a95783e5128 100644 --- a/dlls/winex11.drv/dib.c +++ b/dlls/winex11.drv/dib.c @@ -19,6 +19,7 @@ */ #include "config.h" +#include "wine/port.h" #include #ifdef HAVE_LIBXXSHM @@ -4302,6 +4303,7 @@ static LONG CALLBACK X11DRV_DIB_FaultHandler( PEXCEPTION_POINTERS ep ) BOOL found = FALSE; BYTE *addr; struct list *ptr; + const size_t pagemask = getpagesize() - 1; if (ep->ExceptionRecord->ExceptionCode != EXCEPTION_ACCESS_VIOLATION) return EXCEPTION_CONTINUE_SEARCH; @@ -4312,7 +4314,8 @@ static LONG CALLBACK X11DRV_DIB_FaultHandler( PEXCEPTION_POINTERS ep ) LIST_FOR_EACH( ptr, &dibs_list ) { physBitmap = LIST_ENTRY( ptr, X_PHYSBITMAP, entry ); - if ((physBitmap->base <= addr) && (addr < physBitmap->base + physBitmap->size)) + if ((physBitmap->base <= addr) && + (addr < physBitmap->base + ((physBitmap->size + pagemask) & ~pagemask))) { found = TRUE; break; @@ -4322,6 +4325,9 @@ static LONG CALLBACK X11DRV_DIB_FaultHandler( PEXCEPTION_POINTERS ep ) if (!found) return EXCEPTION_CONTINUE_SEARCH; + if (addr >= physBitmap->base + physBitmap->size) + WARN( "%p: access to %p beyond the end of the DIB\n", physBitmap->hbitmap, addr ); + X11DRV_DIB_Lock( physBitmap, DIB_Status_None ); if (ep->ExceptionRecord->ExceptionInformation[0] == EXCEPTION_WRITE_FAULT) { /* the app tried to write the DIB bits */ diff --git a/dlls/winex11.drv/keyboard.c b/dlls/winex11.drv/keyboard.c index 9edcec0c09c..c0d098adb59 100644 --- a/dlls/winex11.drv/keyboard.c +++ b/dlls/winex11.drv/keyboard.c @@ -2127,17 +2127,15 @@ UINT X11DRV_MapVirtualKeyEx(UINT wCode, UINT wMapType, HKL hkl) /* let's do vkey -> keycode -> (XLookupString) ansi char */ XKeyEvent e; KeySym keysym; - int keyc; - char s[2]; - e.display = display; + int keyc, len; + char s[10]; - e.state = LockMask; - /* LockMask should behave exactly like caps lock - upercase - * the letter keys and that's about it. */ + e.display = display; + e.state = 0; + e.keycode = 0; wine_tsx11_lock(); - e.keycode = 0; /* We exit on the first keycode found, to speed up the thing. */ for (keyc=min_keycode; (keyc<=max_keycode) && (!e.keycode) ; keyc++) { /* Find a keycode that could have generated this virtual key */ @@ -2165,14 +2163,16 @@ UINT X11DRV_MapVirtualKeyEx(UINT wCode, UINT wMapType, HKL hkl) } TRACE("Found keycode %d (0x%2X)\n",e.keycode,e.keycode); - if (XLookupString(&e, s, 2, &keysym, NULL)) + len = XLookupString(&e, s, sizeof(s), &keysym, NULL); + wine_tsx11_unlock(); + + if (len) { - wine_tsx11_unlock(); - returnMVK (*s); + WCHAR wch; + if (MultiByteToWideChar(CP_UNIXCP, 0, s, len, &wch, 1)) + returnMVK(toupperW(wch)); } - TRACE("returning no ANSI.\n"); - wine_tsx11_unlock(); return 0; } default: /* reserved */ diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index a0f29304fcb..000e0d72c57 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -32,6 +32,9 @@ #include #include #include +#ifdef HAVE_LIBXSHAPE +#include +#endif /* HAVE_LIBXSHAPE */ #include "windef.h" #include "winbase.h" @@ -76,9 +79,8 @@ BOOL is_window_managed( HWND hwnd, UINT swp_flags, const RECT *window_rect ) { DWORD style, ex_style; - /* tray window is always managed */ - ex_style = GetWindowLongW( hwnd, GWL_EXSTYLE ); - if (ex_style & WS_EX_TRAYWINDOW) return TRUE; + if (!managed_mode) return FALSE; + /* child windows are not managed */ style = GetWindowLongW( hwnd, GWL_STYLE ); if ((style & (WS_CHILD|WS_POPUP)) == WS_CHILD) return FALSE; @@ -93,6 +95,7 @@ BOOL is_window_managed( HWND hwnd, UINT swp_flags, const RECT *window_rect ) /* windows with caption are managed */ if ((style & WS_CAPTION) == WS_CAPTION) return TRUE; /* tool windows are not managed */ + ex_style = GetWindowLongW( hwnd, GWL_EXSTYLE ); if (ex_style & WS_EX_TOOLWINDOW) return FALSE; /* windows with thick frame are managed */ if (style & WS_THICKFRAME) return TRUE; @@ -238,6 +241,84 @@ void X11DRV_sync_window_style( Display *display, struct x11drv_win_data *data ) /*********************************************************************** + * sync_window_region + * + * Update the X11 window region. + */ +static void sync_window_region( Display *display, struct x11drv_win_data *data, HRGN hrgn ) +{ +#ifdef HAVE_LIBXSHAPE + if (!data->whole_window) return; + + if (!hrgn) + { + wine_tsx11_lock(); + XShapeCombineMask( display, data->whole_window, ShapeBounding, 0, 0, None, ShapeSet ); + wine_tsx11_unlock(); + } + else + { + RGNDATA *pRegionData = X11DRV_GetRegionData( hrgn, 0 ); + if (pRegionData) + { + wine_tsx11_lock(); + XShapeCombineRectangles( display, data->whole_window, ShapeBounding, + data->window_rect.left - data->whole_rect.left, + data->window_rect.top - data->whole_rect.top, + (XRectangle *)pRegionData->Buffer, + pRegionData->rdh.nCount, ShapeSet, YXBanded ); + wine_tsx11_unlock(); + HeapFree(GetProcessHeap(), 0, pRegionData); + } + } +#endif /* HAVE_LIBXSHAPE */ +} + + +/*********************************************************************** + * sync_window_text + */ +static void sync_window_text( Display *display, Window win, const WCHAR *text ) +{ + UINT count; + char *buffer, *utf8_buffer; + XTextProperty prop; + + /* allocate new buffer for window text */ + count = WideCharToMultiByte(CP_UNIXCP, 0, text, -1, NULL, 0, NULL, NULL); + if (!(buffer = HeapAlloc( GetProcessHeap(), 0, count ))) return; + WideCharToMultiByte(CP_UNIXCP, 0, text, -1, buffer, count, NULL, NULL); + + count = WideCharToMultiByte(CP_UTF8, 0, text, strlenW(text), NULL, 0, NULL, NULL); + if (!(utf8_buffer = HeapAlloc( GetProcessHeap(), 0, count ))) + { + HeapFree( GetProcessHeap(), 0, buffer ); + return; + } + WideCharToMultiByte(CP_UTF8, 0, text, strlenW(text), utf8_buffer, count, NULL, NULL); + + wine_tsx11_lock(); + if (XmbTextListToTextProperty( display, &buffer, 1, XStdICCTextStyle, &prop ) == Success) + { + XSetWMName( display, win, &prop ); + XSetWMIconName( display, win, &prop ); + XFree( prop.value ); + } + /* + Implements a NET_WM UTF-8 title. It should be without a trailing \0, + according to the standard + ( http://www.pps.jussieu.fr/~jch/software/UTF8_STRING/UTF8_STRING.text ). + */ + XChangeProperty( display, win, x11drv_atom(_NET_WM_NAME), x11drv_atom(UTF8_STRING), + 8, PropModeReplace, (unsigned char *) utf8_buffer, count); + wine_tsx11_unlock(); + + HeapFree( GetProcessHeap(), 0, utf8_buffer ); + HeapFree( GetProcessHeap(), 0, buffer ); +} + + +/*********************************************************************** * X11DRV_set_win_format */ BOOL X11DRV_set_win_format( HWND hwnd, XID fbconfig_id ) @@ -249,7 +330,8 @@ BOOL X11DRV_set_win_format( HWND hwnd, XID fbconfig_id ) HWND next_hwnd; int w, h; - if (!(data = X11DRV_get_win_data(hwnd))) return FALSE; + if (!(data = X11DRV_get_win_data(hwnd)) && + !(data = X11DRV_create_win_data(hwnd))) return FALSE; wine_tsx11_lock(); @@ -359,7 +441,10 @@ done: return TRUE; } -static void update_gl_drawable(Display *display, struct x11drv_win_data *data, const RECT *old_client_rect) +/*********************************************************************** + * X11DRV_sync_gl_drawable + */ +void X11DRV_sync_gl_drawable(Display *display, struct x11drv_win_data *data) { int w = data->client_rect.right - data->client_rect.left; int h = data->client_rect.bottom - data->client_rect.top; @@ -369,14 +454,6 @@ static void update_gl_drawable(Display *display, struct x11drv_win_data *data, c Drawable glxp; Pixmap pix; - if((w == old_client_rect->right - old_client_rect->left && - h == old_client_rect->bottom - old_client_rect->top) || - w <= 0 || h <= 0) - { - TRACE("No resize needed\n"); - return; - } - TRACE("Resizing GL drawable 0x%lx to %dx%d\n", data->gl_drawable, w, h); #ifdef SONAME_LIBXCOMPOSITE if(usexcomposite) @@ -542,12 +619,7 @@ static void set_icon_hints( Display *display, struct x11drv_win_data *data, HICO data->hWMIconBitmap = 0; data->hWMIconMask = 0; - if (!data->managed) - { - destroy_icon_window( display, data ); - hints->flags &= ~(IconPixmapHint | IconMaskHint | IconWindowHint); - } - else if (!hIcon) + if (!hIcon) { if (!data->icon_window) create_icon_window( display, data ); hints->icon_window = data->icon_window; @@ -587,15 +659,20 @@ static void set_icon_hints( Display *display, struct x11drv_win_data *data, HICO } /*********************************************************************** - * systray_dock_window + * wine_make_systray_window (X11DRV.@) * * Docks the given X window with the NETWM system tray. */ -static void systray_dock_window( Display *display, struct x11drv_win_data *data ) +void X11DRV_make_systray_window( HWND hwnd ) { static Atom systray_atom; + Display *display = thread_display(); + struct x11drv_win_data *data; Window systray_window; + if (!(data = X11DRV_get_win_data( hwnd )) && + !(data = X11DRV_create_win_data( hwnd ))) return; + wine_tsx11_lock(); if (!systray_atom) { @@ -789,7 +866,16 @@ static void set_initial_wm_hints( Display *display, struct x11drv_win_data *data XChangeProperty( display, data->whole_window, x11drv_atom(XdndAware), XA_ATOM, 32, PropModeReplace, (unsigned char*)&dndVersion, 1 ); + data->wm_hints = XAllocWMHints(); wine_tsx11_unlock(); + + if (data->wm_hints) + { + HICON icon = (HICON)SendMessageW( data->hwnd, WM_GETICON, ICON_BIG, 0 ); + if (!icon) icon = (HICON)GetClassLongPtrW( data->hwnd, GCLP_HICON ); + data->wm_hints->flags = 0; + set_icon_hints( display, data, icon ); + } } @@ -809,7 +895,6 @@ void X11DRV_set_wm_hints( Display *display, struct x11drv_win_data *data ) if (data->hwnd == GetDesktopWindow()) { - if (data->whole_window == DefaultRootWindow(display)) return; /* force some styles for the desktop to get the correct decorations */ style |= WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX; owner = 0; @@ -853,21 +938,17 @@ void X11DRV_set_wm_hints( Display *display, struct x11drv_win_data *data ) x11drv_atom(_MOTIF_WM_HINTS), 32, PropModeReplace, (unsigned char*)&mwm_hints, sizeof(mwm_hints)/sizeof(long) ); - wine_tsx11_unlock(); - /* wm hints */ if (data->wm_hints) { - data->wm_hints->flags = InputHint | StateHint | WindowGroupHint; + data->wm_hints->flags |= InputHint | StateHint | WindowGroupHint; data->wm_hints->input = !(style & WS_DISABLED); data->wm_hints->initial_state = (style & WS_MINIMIZE) ? IconicState : NormalState; data->wm_hints->window_group = group_leader; - set_icon_hints( display, data, (HICON)GetClassLongPtrW( data->hwnd, GCLP_HICON ) ); - - wine_tsx11_lock(); XSetWMHints( display, data->whole_window, data->wm_hints ); - wine_tsx11_unlock(); } + + wine_tsx11_unlock(); } @@ -885,7 +966,7 @@ void X11DRV_set_iconic_state( HWND hwnd ) BOOL iconic = (style & WS_MINIMIZE) != 0; if (!(data = X11DRV_get_win_data( hwnd ))) return; - if (!data->whole_window || data->whole_window == DefaultRootWindow(display)) return; + if (!data->whole_window) return; GetWindowRect( hwnd, &rect ); @@ -900,7 +981,7 @@ void X11DRV_set_iconic_state( HWND hwnd ) XSetWMHints( display, data->whole_window, data->wm_hints ); } - if (style & WS_VISIBLE) + if (data->mapped) { if (iconic) XIconifyWindow( display, data->whole_window, DefaultScreen(display) ); @@ -965,27 +1046,11 @@ void X11DRV_X_to_window_rect( struct x11drv_win_data *data, RECT *rect ) * Synchronize the X window position with the Windows one */ void X11DRV_sync_window_position( Display *display, struct x11drv_win_data *data, - UINT swp_flags, const RECT *new_client_rect, - const RECT *new_whole_rect ) + UINT swp_flags, const RECT *old_client_rect, + const RECT *old_whole_rect ) { XWindowChanges changes; - int mask; - RECT old_whole_rect; - RECT old_client_rect; - - old_whole_rect = data->whole_rect; - data->whole_rect = *new_whole_rect; - - old_client_rect = data->client_rect; - data->client_rect = *new_client_rect; - OffsetRect( &data->client_rect, -data->whole_rect.left, -data->whole_rect.top ); - - if (data->gl_drawable) - update_gl_drawable(display, data, &old_client_rect); - - if (!data->whole_window || data->lock_changes) return; - - mask = get_window_changes( &changes, &old_whole_rect, &data->whole_rect ); + int mask = get_window_changes( &changes, old_whole_rect, &data->whole_rect ); if (!(swp_flags & SWP_NOZORDER)) { @@ -1042,15 +1107,24 @@ void X11DRV_sync_window_position( Display *display, struct x11drv_win_data *data * * Create the whole X window for a given window */ -static Window create_whole_window( Display *display, struct x11drv_win_data *data, DWORD style ) +static Window create_whole_window( Display *display, struct x11drv_win_data *data ) { int cx, cy, mask; XSetWindowAttributes attr; XIM xim; + WCHAR text[1024]; + HRGN hrgn; if (!(cx = data->window_rect.right - data->window_rect.left)) cx = 1; if (!(cy = data->window_rect.bottom - data->window_rect.top)) cy = 1; + if (!data->managed && is_window_managed( data->hwnd, SWP_NOACTIVATE, &data->window_rect )) + { + TRACE( "making win %p/%lx managed\n", data->hwnd, data->whole_window ); + data->managed = TRUE; + SetPropA( data->hwnd, managed_prop, (HANDLE)1 ); + } + mask = get_window_attributes( display, data, &attr ); wine_tsx11_lock(); @@ -1068,14 +1142,6 @@ static Window create_whole_window( Display *display, struct x11drv_win_data *dat return 0; } XSaveContext( display, data->whole_window, winContext, (char *)data->hwnd ); - - /* non-maximized child must be at bottom of Z order */ - if ((style & (WS_CHILD|WS_MAXIMIZE)) == WS_CHILD) - { - XWindowChanges changes; - changes.stack_mode = Below; - XConfigureWindow( display, data->whole_window, CWStackMode, &changes ); - } wine_tsx11_unlock(); xim = x11drv_thread_data()->xim; @@ -1085,6 +1151,17 @@ static Window create_whole_window( Display *display, struct x11drv_win_data *dat X11DRV_set_wm_hints( display, data ); SetPropA( data->hwnd, whole_window_prop, (HANDLE)data->whole_window ); + + /* set the window text */ + if (!InternalGetWindowText( data->hwnd, text, sizeof(text)/sizeof(WCHAR) )) text[0] = 0; + sync_window_text( display, data->whole_window, text ); + + /* set the window region */ + if ((hrgn = CreateRectRgn( 0, 0, 0, 0 ))) + { + if (GetWindowRgn( data->hwnd, hrgn ) != ERROR) sync_window_region( display, data, hrgn ); + DeleteObject( hrgn ); + } return data->whole_window; } @@ -1104,8 +1181,7 @@ static void destroy_whole_window( Display *display, struct x11drv_win_data *data if (thread_data->cursor_window == data->whole_window) thread_data->cursor_window = None; wine_tsx11_lock(); XDeleteContext( display, data->whole_window, winContext ); - if (data->whole_window != DefaultRootWindow(display)) - XDestroyWindow( display, data->whole_window ); + XDestroyWindow( display, data->whole_window ); data->whole_window = 0; if (data->xic) { @@ -1114,6 +1190,8 @@ static void destroy_whole_window( Display *display, struct x11drv_win_data *data } /* Outlook stops processing messages after destroying a dialog, so we need an explicit flush */ XFlush( display ); + XFree( data->wm_hints ); + data->wm_hints = NULL; wine_tsx11_unlock(); RemovePropA( data->hwnd, whole_window_prop ); } @@ -1125,51 +1203,10 @@ static void destroy_whole_window( Display *display, struct x11drv_win_data *data void X11DRV_SetWindowText( HWND hwnd, LPCWSTR text ) { Display *display = thread_display(); - UINT count; - char *buffer; - char *utf8_buffer; Window win; - XTextProperty prop; if ((win = X11DRV_get_whole_window( hwnd )) && win != DefaultRootWindow(display)) - { - /* allocate new buffer for window text */ - count = WideCharToMultiByte(CP_UNIXCP, 0, text, -1, NULL, 0, NULL, NULL); - if (!(buffer = HeapAlloc( GetProcessHeap(), 0, count ))) - { - ERR("Not enough memory for window text\n"); - return; - } - WideCharToMultiByte(CP_UNIXCP, 0, text, -1, buffer, count, NULL, NULL); - - count = WideCharToMultiByte(CP_UTF8, 0, text, strlenW(text), NULL, 0, NULL, NULL); - if (!(utf8_buffer = HeapAlloc( GetProcessHeap(), 0, count ))) - { - ERR("Not enough memory for window text in UTF-8\n"); - HeapFree( GetProcessHeap(), 0, buffer ); - return; - } - WideCharToMultiByte(CP_UTF8, 0, text, strlenW(text), utf8_buffer, count, NULL, NULL); - - wine_tsx11_lock(); - if (XmbTextListToTextProperty( display, &buffer, 1, XStdICCTextStyle, &prop ) == Success) - { - XSetWMName( display, win, &prop ); - XSetWMIconName( display, win, &prop ); - XFree( prop.value ); - } - /* - Implements a NET_WM UTF-8 title. It should be without a trailing \0, - according to the standard - ( http://www.pps.jussieu.fr/~jch/software/UTF8_STRING/UTF8_STRING.text ). - */ - XChangeProperty( display, win, x11drv_atom(_NET_WM_NAME), x11drv_atom(UTF8_STRING), - 8, PropModeReplace, (unsigned char *) utf8_buffer, count); - wine_tsx11_unlock(); - - HeapFree( GetProcessHeap(), 0, utf8_buffer ); - HeapFree( GetProcessHeap(), 0, buffer ); - } + sync_window_text( display, win, text ); } @@ -1207,7 +1244,6 @@ void X11DRV_DestroyWindow( HWND hwnd ) if (data->hWMIconMask) DeleteObject( data->hWMIconMask); wine_tsx11_lock(); XDeleteContext( display, (XID)hwnd, win_data_context ); - XFree( data->wm_hints ); wine_tsx11_unlock(); HeapFree( GetProcessHeap(), 0, data ); } @@ -1217,27 +1253,13 @@ static struct x11drv_win_data *alloc_win_data( Display *display, HWND hwnd ) { struct x11drv_win_data *data; - if ((data = HeapAlloc(GetProcessHeap(), 0, sizeof(*data)))) + if ((data = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*data)))) { - data->hwnd = hwnd; - data->whole_window = 0; - data->icon_window = 0; - data->fbconfig_id = 0; - data->gl_drawable = 0; - data->pixmap = 0; - data->xic = 0; - data->managed = FALSE; - data->wm_state = 0; - data->dce = NULL; - data->lock_changes = 0; - data->hWMIconBitmap = 0; - data->hWMIconMask = 0; - + data->hwnd = hwnd; wine_tsx11_lock(); if (!winContext) winContext = XUniqueContext(); if (!win_data_context) win_data_context = XUniqueContext(); XSaveContext( display, (XID)hwnd, win_data_context, (char *)data ); - data->wm_hints = XAllocWMHints(); wine_tsx11_unlock(); } return data; @@ -1245,26 +1267,22 @@ static struct x11drv_win_data *alloc_win_data( Display *display, HWND hwnd ) /* initialize the desktop window id in the desktop manager process */ -static void get_desktop_xwin( Display *display, struct x11drv_win_data *data ) +static struct x11drv_win_data *create_desktop_win_data( Display *display, HWND hwnd ) { - data->whole_window = root_window; - if (root_window != DefaultRootWindow( display )) - { - VisualID visualid; + struct x11drv_win_data *data; + VisualID visualid; - wine_tsx11_lock(); - visualid = XVisualIDFromVisual(visual); - wine_tsx11_unlock(); - data->managed = TRUE; - SetPropA( data->hwnd, managed_prop, (HANDLE)1 ); - SetPropA( data->hwnd, whole_window_prop, (HANDLE)root_window ); - SetPropA( data->hwnd, visual_id_prop, (HANDLE)visualid ); - set_initial_wm_hints( display, data ); - } - SetWindowPos( data->hwnd, 0, virtual_screen_rect.left, virtual_screen_rect.top, - virtual_screen_rect.right - virtual_screen_rect.left, - virtual_screen_rect.bottom - virtual_screen_rect.top, - SWP_NOZORDER | SWP_NOACTIVATE ); + if (!(data = alloc_win_data( display, hwnd ))) return NULL; + wine_tsx11_lock(); + visualid = XVisualIDFromVisual(visual); + wine_tsx11_unlock(); + data->whole_window = root_window; + data->managed = TRUE; + SetPropA( data->hwnd, managed_prop, (HANDLE)1 ); + SetPropA( data->hwnd, whole_window_prop, (HANDLE)root_window ); + SetPropA( data->hwnd, visual_id_prop, (HANDLE)visualid ); + set_initial_wm_hints( display, data ); + return data; } /********************************************************************** @@ -1312,156 +1330,16 @@ BOOL X11DRV_CreateDesktopWindow( HWND hwnd ) /********************************************************************** * CreateWindow (X11DRV.@) */ -BOOL X11DRV_CreateWindow( HWND hwnd, CREATESTRUCTA *cs, BOOL unicode ) +BOOL X11DRV_CreateWindow( HWND hwnd ) { Display *display = thread_display(); - WND *wndPtr; - struct x11drv_win_data *data; - HWND insert_after; - RECT rect; DWORD style; - CBT_CREATEWNDA cbtc; - CREATESTRUCTA cbcs; - BOOL ret = FALSE; - - if (!(data = alloc_win_data( display, hwnd ))) return FALSE; - - if (cs->cx > 65535) - { - ERR( "invalid window width %d\n", cs->cx ); - cs->cx = 65535; - } - if (cs->cy > 65535) - { - ERR( "invalid window height %d\n", cs->cy ); - cs->cy = 65535; - } - if (cs->cx < 0) - { - ERR( "invalid window width %d\n", cs->cx ); - cs->cx = 0; - } - if (cs->cy < 0) - { - ERR( "invalid window height %d\n", cs->cy ); - cs->cy = 0; - } - - if (hwnd == GetDesktopWindow()) get_desktop_xwin( display, data ); - else - { - /* initialize the dimensions before sending WM_GETMINMAXINFO */ - SetRect( &rect, cs->x, cs->y, cs->x + cs->cx, cs->y + cs->cy ); - X11DRV_SetWindowPos( hwnd, 0, &rect, &rect, SWP_NOZORDER | SWP_NOACTIVATE, NULL ); - - /* create an X window if it's a top level window */ - if (GetAncestor( hwnd, GA_PARENT ) == GetDesktopWindow()) - { - if (!create_whole_window( display, data, cs->style )) goto failed; - } - } - - /* get class or window DC if needed */ - alloc_window_dce( data ); - - /* Call the WH_CBT hook */ - - /* the window style passed to the hook must be the real window style, - * rather than just the window style that the caller to CreateWindowEx - * passed in, so we have to copy the original CREATESTRUCT and get the - * the real style. */ - cbcs = *cs; - cbcs.style = GetWindowLongW(hwnd, GWL_STYLE); - - cbtc.lpcs = &cbcs; - cbtc.hwndInsertAfter = HWND_TOP; - if (HOOK_CallHooks( WH_CBT, HCBT_CREATEWND, (WPARAM)hwnd, (LPARAM)&cbtc, unicode )) - { - TRACE("CBT-hook returned !0\n"); - goto failed; - } - - /* Send the WM_GETMINMAXINFO message and fix the size if needed */ - if ((cs->style & WS_THICKFRAME) || !(cs->style & (WS_POPUP | WS_CHILD))) - { - POINT maxSize, maxPos, minTrack, maxTrack; - - WINPOS_GetMinMaxInfo( hwnd, &maxSize, &maxPos, &minTrack, &maxTrack); - if (maxTrack.x < cs->cx) cs->cx = maxTrack.x; - if (maxTrack.y < cs->cy) cs->cy = maxTrack.y; - if (cs->cx < 0) cs->cx = 0; - if (cs->cy < 0) cs->cy = 0; - - SetRect( &rect, cs->x, cs->y, cs->x + cs->cx, cs->y + cs->cy ); - if (!X11DRV_SetWindowPos( hwnd, 0, &rect, &rect, SWP_NOZORDER | SWP_NOACTIVATE, NULL )) - return FALSE; - } - - /* send WM_NCCREATE */ - TRACE( "hwnd %p cs %d,%d %dx%d\n", hwnd, cs->x, cs->y, cs->cx, cs->cy ); - if (unicode) - ret = SendMessageW( hwnd, WM_NCCREATE, 0, (LPARAM)cs ); - else - ret = SendMessageA( hwnd, WM_NCCREATE, 0, (LPARAM)cs ); - if (!ret) - { - WARN("aborted by WM_xxCREATE!\n"); - return FALSE; - } - - /* make sure the window is still valid */ - if (!(data = X11DRV_get_win_data( hwnd ))) return FALSE; - if (data->whole_window) X11DRV_sync_window_style( display, data ); - /* send WM_NCCALCSIZE */ - rect = data->window_rect; - SendMessageW( hwnd, WM_NCCALCSIZE, FALSE, (LPARAM)&rect ); - - if (!(wndPtr = WIN_GetPtr(hwnd))) return FALSE; - - /* yes, even if the CBT hook was called with HWND_TOP */ - insert_after = (wndPtr->dwStyle & WS_CHILD) ? HWND_BOTTOM : HWND_TOP; - - X11DRV_SetWindowPos( hwnd, insert_after, &wndPtr->rectWindow, &rect, SWP_NOACTIVATE, NULL ); - - TRACE( "win %p window %d,%d,%d,%d client %d,%d,%d,%d whole %d,%d,%d,%d X client %d,%d,%d,%d xwin %x\n", - hwnd, wndPtr->rectWindow.left, wndPtr->rectWindow.top, - wndPtr->rectWindow.right, wndPtr->rectWindow.bottom, - wndPtr->rectClient.left, wndPtr->rectClient.top, - wndPtr->rectClient.right, wndPtr->rectClient.bottom, - data->whole_rect.left, data->whole_rect.top, - data->whole_rect.right, data->whole_rect.bottom, - data->client_rect.left, data->client_rect.top, - data->client_rect.right, data->client_rect.bottom, - (unsigned int)data->whole_window ); - - WIN_ReleasePtr( wndPtr ); - - if (unicode) - ret = (SendMessageW( hwnd, WM_CREATE, 0, (LPARAM)cs ) != -1); - else - ret = (SendMessageA( hwnd, WM_CREATE, 0, (LPARAM)cs ) != -1); - - if (!ret) return FALSE; - - NotifyWinEvent(EVENT_OBJECT_CREATE, hwnd, OBJID_WINDOW, 0); - - /* Send the size messages */ - - if (!(wndPtr = WIN_GetPtr(hwnd)) || wndPtr == WND_OTHER_PROCESS) return FALSE; - if (!(wndPtr->flags & WIN_NEED_SIZE)) + if (hwnd == GetDesktopWindow() && root_window != DefaultRootWindow( display )) { - RECT rect = wndPtr->rectClient; - WIN_ReleasePtr( wndPtr ); - /* send it anyway */ - if (((rect.right-rect.left) <0) ||((rect.bottom-rect.top)<0)) - WARN("sending bogus WM_SIZE message 0x%08x\n", - MAKELONG(rect.right-rect.left, rect.bottom-rect.top)); - SendMessageW( hwnd, WM_SIZE, SIZE_RESTORED, - MAKELONG(rect.right-rect.left, rect.bottom-rect.top)); - SendMessageW( hwnd, WM_MOVE, 0, MAKELONG( rect.left, rect.top ) ); + /* the desktop win data can't be created lazily */ + if (!create_desktop_win_data( display, hwnd )) return FALSE; } - else WIN_ReleasePtr( wndPtr ); /* Show the window, maximizing or minimizing if needed */ @@ -1482,17 +1360,7 @@ BOOL X11DRV_CreateWindow( HWND hwnd, CREATESTRUCTA *cs, BOOL unicode ) newPos.right, newPos.bottom, swFlag ); } - /* Dock system tray windows. */ - /* Dock after the window is created so we don't have problems calling - * SetWindowPos. */ - if (GetWindowLongW( hwnd, GWL_EXSTYLE ) & WS_EX_TRAYWINDOW) - systray_dock_window( display, data ); - return TRUE; - - failed: - X11DRV_DestroyWindow( hwnd ); - return FALSE; } @@ -1511,6 +1379,44 @@ struct x11drv_win_data *X11DRV_get_win_data( HWND hwnd ) /*********************************************************************** + * X11DRV_create_win_data + * + * Create an X11 data window structure for an existing window. + */ +struct x11drv_win_data *X11DRV_create_win_data( HWND hwnd ) +{ + Display *display = thread_display(); + struct x11drv_win_data *data; + HWND parent; + + if (!(parent = GetAncestor( hwnd, GA_PARENT ))) return NULL; /* desktop */ + if (!(data = alloc_win_data( display, hwnd ))) return NULL; + + GetWindowRect( hwnd, &data->window_rect ); + MapWindowPoints( 0, parent, (POINT *)&data->window_rect, 2 ); + data->whole_rect = data->window_rect; + GetClientRect( hwnd, &data->client_rect ); + MapWindowPoints( hwnd, parent, (POINT *)&data->client_rect, 2 ); + + if (parent == GetDesktopWindow()) + { + if (!create_whole_window( display, data )) + { + HeapFree( GetProcessHeap(), 0, data ); + return NULL; + } + TRACE( "win %p/%lx window %s whole %s client %s\n", + hwnd, data->whole_window, wine_dbgstr_rect( &data->window_rect ), + wine_dbgstr_rect( &data->whole_rect ), wine_dbgstr_rect( &data->client_rect )); + } + + /* get class or window DC if needed */ + alloc_window_dce( data ); + return data; +} + + +/*********************************************************************** * X11DRV_get_whole_window * * Return the X window associated with the full area of a window @@ -1611,7 +1517,7 @@ void X11DRV_SetParent( HWND hwnd, HWND parent, HWND old_parent ) else /* new top level window */ { /* FIXME: we ignore errors since we can't really recover anyway */ - create_whole_window( display, data, GetWindowLongW( hwnd, GWL_STYLE ) ); + create_whole_window( display, data ); } } @@ -1694,3 +1600,28 @@ void X11DRV_SetWindowIcon( HWND hwnd, UINT type, HICON icon ) wine_tsx11_unlock(); } } + + +/*********************************************************************** + * SetWindowRgn (X11DRV.@) + * + * Assign specified region to window (for non-rectangular windows) + */ +int X11DRV_SetWindowRgn( HWND hwnd, HRGN hrgn, BOOL redraw ) +{ + struct x11drv_win_data *data; + + if ((data = X11DRV_get_win_data( hwnd ))) + { + sync_window_region( thread_display(), data, hrgn ); + invalidate_dce( hwnd, &data->window_rect ); + } + else if (GetWindowThreadProcessId( hwnd, NULL ) != GetCurrentThreadId()) + { + FIXME( "not supported on other thread window %p\n", hwnd ); + SetLastError( ERROR_INVALID_WINDOW_HANDLE ); + return FALSE; + } + + return TRUE; +} diff --git a/dlls/winex11.drv/winex11.drv.spec b/dlls/winex11.drv/winex11.drv.spec index 87db8412d16..36b83d7bbbf 100644 --- a/dlls/winex11.drv/winex11.drv.spec +++ b/dlls/winex11.drv/winex11.drv.spec @@ -89,7 +89,7 @@ @ cdecl AcquireClipboard(long) X11DRV_AcquireClipboard @ cdecl CountClipboardFormats() X11DRV_CountClipboardFormats @ cdecl CreateDesktopWindow(long) X11DRV_CreateDesktopWindow -@ cdecl CreateWindow(long ptr long) X11DRV_CreateWindow +@ cdecl CreateWindow(long) X11DRV_CreateWindow @ cdecl DestroyWindow(long) X11DRV_DestroyWindow @ cdecl EmptyClipboard(long) X11DRV_EmptyClipboard @ cdecl EndClipboardUpdate() X11DRV_EndClipboardUpdate @@ -106,7 +106,7 @@ @ cdecl SetFocus(long) X11DRV_SetFocus @ cdecl SetParent(long long long) X11DRV_SetParent @ cdecl SetWindowIcon(long long long) X11DRV_SetWindowIcon -@ cdecl SetWindowPos(long long ptr ptr long ptr) X11DRV_SetWindowPos +@ cdecl SetWindowPos(long long long ptr ptr ptr ptr) X11DRV_SetWindowPos @ cdecl SetWindowRgn(long long long) X11DRV_SetWindowRgn @ cdecl SetWindowStyle(ptr long) X11DRV_SetWindowStyle @ cdecl SetWindowText(long wstr) X11DRV_SetWindowText @@ -128,6 +128,9 @@ # Desktop @ cdecl wine_create_desktop(long long) X11DRV_create_desktop +# System tray +@ cdecl wine_make_systray_window(long) X11DRV_make_systray_window + # XIM @ cdecl ForceXIMReset(long) X11DRV_ForceXIMReset diff --git a/dlls/winex11.drv/winpos.c b/dlls/winex11.drv/winpos.c index ba91e8bc45c..1a3cde584a5 100644 --- a/dlls/winex11.drv/winpos.c +++ b/dlls/winex11.drv/winpos.c @@ -23,9 +23,6 @@ #include #include -#ifdef HAVE_LIBXSHAPE -#include -#endif /* HAVE_LIBXSHAPE */ #include #include "windef.h" @@ -96,8 +93,8 @@ void X11DRV_Expose( HWND hwnd, XEvent *xev ) if (!(data = X11DRV_get_win_data( hwnd ))) return; - rect.left = event->x; - rect.top = event->y; + rect.left = data->whole_rect.left + event->x; + rect.top = data->whole_rect.top + event->y; rect.right = rect.left + event->width; rect.bottom = rect.top + event->height; @@ -112,15 +109,15 @@ void X11DRV_Expose( HWND hwnd, XEvent *xev ) SERVER_START_REQ( update_window_zorder ) { req->window = hwnd; - req->rect.left = rect.left + data->whole_rect.left; - req->rect.top = rect.top + data->whole_rect.top; - req->rect.right = rect.right + data->whole_rect.left; - req->rect.bottom = rect.bottom + data->whole_rect.top; + req->rect.left = rect.left; + req->rect.top = rect.top; + req->rect.right = rect.right; + req->rect.bottom = rect.bottom; wine_server_call( req ); } SERVER_END_REQ; - /* make position relative to client area instead of window */ + /* make position relative to client area instead of parent */ OffsetRect( &rect, -data->client_rect.left, -data->client_rect.top ); RedrawWindow( hwnd, &rect, 0, flags ); } @@ -137,32 +134,38 @@ void X11DRV_SetWindowStyle( HWND hwnd, DWORD old_style ) DWORD new_style, changed; if (hwnd == GetDesktopWindow()) return; - if (!(data = X11DRV_get_win_data( hwnd ))) return; - new_style = GetWindowLongW( hwnd, GWL_STYLE ); changed = new_style ^ old_style; if (changed & WS_VISIBLE) { + data = X11DRV_get_win_data( hwnd ); + if (data) invalidate_dce( hwnd, &data->window_rect ); + + /* we don't unmap windows, that causes trouble with the window manager */ + if (!(new_style & WS_VISIBLE)) return; + + if (!data && !(data = X11DRV_create_win_data( hwnd ))) return; + if (data->whole_window && X11DRV_is_window_rect_mapped( &data->window_rect )) { - if (new_style & WS_VISIBLE) + X11DRV_set_wm_hints( display, data ); + if (!data->mapped) { TRACE( "mapping win %p\n", hwnd ); X11DRV_sync_window_style( display, data ); - X11DRV_set_wm_hints( display, data ); wine_tsx11_lock(); XMapWindow( display, data->whole_window ); wine_tsx11_unlock(); + data->mapped = TRUE; } - /* we don't unmap windows, that causes trouble with the window manager */ } - invalidate_dce( hwnd, &data->window_rect ); } if (changed & WS_DISABLED) { - if (data->whole_window && data->wm_hints) + data = X11DRV_get_win_data( hwnd ); + if (data && data->wm_hints) { wine_tsx11_lock(); data->wm_hints->input = !(new_style & WS_DISABLED); @@ -190,9 +193,10 @@ static void update_wm_states( Display *display, struct x11drv_win_data *data, BO XEvent xev; if (!data->managed) return; + if (!data->mapped) return; - if (data->client_rect.left <= 0 && data->client_rect.right >= screen_width && - data->client_rect.top <= 0 && data->client_rect.bottom >= screen_height) + if (data->whole_rect.left <= 0 && data->whole_rect.right >= screen_width && + data->whole_rect.top <= 0 && data->whole_rect.bottom >= screen_height) new_state |= (1 << WM_STATE_FULLSCREEN); ex_style = GetWindowLongW( data->hwnd, GWL_EXSTYLE ); @@ -234,199 +238,196 @@ static void update_wm_states( Display *display, struct x11drv_win_data *data, BO /*********************************************************************** - * SetWindowPos (X11DRV.@) + * move_window_bits + * + * Move the window bits when a window is moved. */ -BOOL X11DRV_SetWindowPos( HWND hwnd, HWND insert_after, const RECT *rectWindow, - const RECT *rectClient, UINT swp_flags, const RECT *valid_rects ) +static void move_window_bits( struct x11drv_win_data *data, const RECT *old_rect, const RECT *new_rect, + const RECT *old_whole_rect ) { - Display *display = thread_display(); - struct x11drv_win_data *data; - RECT new_whole_rect, old_client_rect; - WND *win; - DWORD old_style, new_style, new_ex_style; - BOOL ret, make_managed = FALSE; - - if (!(data = X11DRV_get_win_data( hwnd ))) return FALSE; - - /* check if we need to switch the window to managed */ - if (!data->managed && data->whole_window && managed_mode && - root_window == DefaultRootWindow( display ) && - data->whole_window != root_window) + RECT src_rect = *old_rect; + RECT dst_rect = *new_rect; + HDC hdc_src, hdc_dst; + INT code; + HRGN rgn = 0; + HWND parent = 0; + + if (!data->whole_window) { - if (is_window_managed( hwnd, swp_flags, rectWindow )) - { - TRACE( "making win %p/%lx managed\n", hwnd, data->whole_window ); - make_managed = TRUE; - data->managed = TRUE; - SetPropA( hwnd, managed_prop, (HANDLE)1 ); - } + OffsetRect( &dst_rect, -data->window_rect.left, -data->window_rect.top ); + parent = GetAncestor( data->hwnd, GA_PARENT ); + hdc_src = GetDCEx( parent, 0, DCX_CACHE ); + hdc_dst = GetDCEx( data->hwnd, 0, DCX_CACHE | DCX_WINDOW ); + } + else + { + OffsetRect( &dst_rect, -data->whole_rect.left, -data->whole_rect.top ); + /* make src rect relative to the old position of the window */ + OffsetRect( &src_rect, -old_whole_rect->left, -old_whole_rect->top ); + if (dst_rect.left == src_rect.left && dst_rect.top == src_rect.top) return; + /* now make them relative to window rect for DCX_WINDOW */ + OffsetRect( &dst_rect, data->whole_rect.left - data->window_rect.left, + data->whole_rect.top - data->window_rect.top ); + OffsetRect( &src_rect, data->whole_rect.left - data->window_rect.left, + data->whole_rect.top - data->window_rect.top ); + hdc_src = hdc_dst = GetDCEx( data->hwnd, 0, DCX_CACHE | DCX_WINDOW ); } - new_whole_rect = *rectWindow; - X11DRV_window_to_X_rect( data, &new_whole_rect ); + code = X11DRV_START_EXPOSURES; + ExtEscape( hdc_dst, X11DRV_ESCAPE, sizeof(code), (LPSTR)&code, 0, NULL ); - old_client_rect = data->client_rect; + TRACE( "copying bits for win %p/%lx %s -> %s\n", + data->hwnd, data->whole_window, wine_dbgstr_rect(&src_rect), wine_dbgstr_rect(&dst_rect) ); + BitBlt( hdc_dst, dst_rect.left, dst_rect.top, + dst_rect.right - dst_rect.left, dst_rect.bottom - dst_rect.top, + hdc_src, src_rect.left, src_rect.top, SRCCOPY ); + + code = X11DRV_END_EXPOSURES; + ExtEscape( hdc_dst, X11DRV_ESCAPE, sizeof(code), (LPSTR)&code, sizeof(rgn), (LPSTR)&rgn ); - if (!data->whole_window) swp_flags |= SWP_NOCOPYBITS; /* we can't rely on X11 to move the bits */ + ReleaseDC( data->hwnd, hdc_dst ); + if (hdc_src != hdc_dst) ReleaseDC( parent, hdc_src ); - if (!(win = WIN_GetPtr( hwnd ))) return FALSE; - if (win == WND_OTHER_PROCESS) + if (rgn) { - if (IsWindow( hwnd )) ERR( "cannot set rectangles of other process window %p\n", hwnd ); - return FALSE; + OffsetRgn( rgn, data->window_rect.left - data->client_rect.left, + data->window_rect.top - data->client_rect.top ); + RedrawWindow( data->hwnd, NULL, rgn, RDW_INVALIDATE | RDW_FRAME | RDW_ERASE | RDW_ALLCHILDREN ); + DeleteObject( rgn ); } - SERVER_START_REQ( set_window_pos ) +} + +/*********************************************************************** + * SetWindowPos (X11DRV.@) + */ +void X11DRV_SetWindowPos( HWND hwnd, HWND insert_after, UINT swp_flags, + const RECT *rectWindow, const RECT *rectClient, + const RECT *visible_rect, const RECT *valid_rects ) +{ + Display *display = thread_display(); + struct x11drv_win_data *data = X11DRV_get_win_data( hwnd ); + DWORD new_style = GetWindowLongW( hwnd, GWL_STYLE ); + RECT old_window_rect, old_whole_rect, old_client_rect; + + if (!data) { - req->handle = hwnd; - req->previous = insert_after; - req->flags = swp_flags; - req->window.left = rectWindow->left; - req->window.top = rectWindow->top; - req->window.right = rectWindow->right; - req->window.bottom = rectWindow->bottom; - req->client.left = rectClient->left; - req->client.top = rectClient->top; - req->client.right = rectClient->right; - req->client.bottom = rectClient->bottom; - if (memcmp( rectWindow, &new_whole_rect, sizeof(RECT) ) || !IsRectEmpty( &valid_rects[0] )) - { - wine_server_add_data( req, &new_whole_rect, sizeof(new_whole_rect) ); - if (!IsRectEmpty( &valid_rects[0] )) - wine_server_add_data( req, valid_rects, 2 * sizeof(*valid_rects) ); - } - ret = !wine_server_call( req ); - new_style = reply->new_style; - new_ex_style = reply->new_ex_style; + /* create the win data if the window is being made visible */ + if (!(new_style & WS_VISIBLE)) return; + if (!(data = X11DRV_create_win_data( hwnd ))) return; } - SERVER_END_REQ; - if (win == WND_DESKTOP || data->whole_window == DefaultRootWindow(gdi_display)) + /* check if we need to switch the window to managed */ + if (!data->managed && data->whole_window && is_window_managed( hwnd, swp_flags, rectWindow )) { - data->whole_rect = data->client_rect = data->window_rect = *rectWindow; - if (win != WND_DESKTOP) + TRACE( "making win %p/%lx managed\n", hwnd, data->whole_window ); + data->managed = TRUE; + SetPropA( hwnd, managed_prop, (HANDLE)1 ); + if (data->mapped) { - win->rectWindow = *rectWindow; - win->rectClient = *rectClient; - win->dwStyle = new_style; - win->dwExStyle = new_ex_style; - WIN_ReleasePtr( win ); + wine_tsx11_lock(); + XUnmapWindow( display, data->whole_window ); + wine_tsx11_unlock(); + data->mapped = FALSE; } - return ret; } - if (ret) + old_window_rect = data->window_rect; + old_whole_rect = data->whole_rect; + old_client_rect = data->client_rect; + data->window_rect = *rectWindow; + data->whole_rect = *rectWindow; + data->client_rect = *rectClient; + X11DRV_window_to_X_rect( data, &data->whole_rect ); + if (memcmp( &visible_rect, &data->whole_rect, sizeof(RECT) )) { - /* invalidate DCEs */ - - if ((((swp_flags & SWP_AGG_NOPOSCHANGE) != SWP_AGG_NOPOSCHANGE) && (new_style & WS_VISIBLE)) || - (swp_flags & (SWP_HIDEWINDOW | SWP_SHOWWINDOW))) + TRACE( "%p: need to update visible rect %s -> %s\n", hwnd, + wine_dbgstr_rect(visible_rect), wine_dbgstr_rect(&data->whole_rect) ); + SERVER_START_REQ( set_window_visible_rect ) { - RECT rect; - UnionRect( &rect, rectWindow, &win->rectWindow ); - invalidate_dce( hwnd, &rect ); + req->handle = hwnd; + req->flags = swp_flags; + req->visible.left = data->whole_rect.left; + req->visible.top = data->whole_rect.top; + req->visible.right = data->whole_rect.right; + req->visible.bottom = data->whole_rect.bottom; + wine_server_call( req ); } + SERVER_END_REQ; + } - win->rectWindow = *rectWindow; - win->rectClient = *rectClient; - old_style = win->dwStyle; - win->dwStyle = new_style; - win->dwExStyle = new_ex_style; - data->window_rect = *rectWindow; + /* invalidate DCEs */ + if ((((swp_flags & SWP_AGG_NOPOSCHANGE) != SWP_AGG_NOPOSCHANGE) && (new_style & WS_VISIBLE)) || + (swp_flags & (SWP_HIDEWINDOW | SWP_SHOWWINDOW))) + { + RECT rect; + UnionRect( &rect, rectWindow, &old_window_rect ); + invalidate_dce( hwnd, &rect ); + } - TRACE( "win %p window %s client %s style %08x\n", - hwnd, wine_dbgstr_rect(rectWindow), wine_dbgstr_rect(rectClient), new_style ); + TRACE( "win %p window %s client %s style %08x\n", + hwnd, wine_dbgstr_rect(rectWindow), wine_dbgstr_rect(rectClient), new_style ); - if (make_managed && (old_style & WS_VISIBLE)) + if (!IsRectEmpty( &valid_rects[0] )) + { + int x_offset = old_whole_rect.left - data->whole_rect.left; + int y_offset = old_whole_rect.top - data->whole_rect.top; + + /* if all that happened is that the whole window moved, copy everything */ + if (!(swp_flags & SWP_FRAMECHANGED) && + old_whole_rect.right - data->whole_rect.right == x_offset && + old_whole_rect.bottom - data->whole_rect.bottom == y_offset && + old_client_rect.left - data->client_rect.left == x_offset && + old_client_rect.right - data->client_rect.right == x_offset && + old_client_rect.top - data->client_rect.top == y_offset && + old_client_rect.bottom - data->client_rect.bottom == y_offset && + !memcmp( &valid_rects[0], &data->client_rect, sizeof(RECT) )) { - wine_tsx11_lock(); - XUnmapWindow( display, data->whole_window ); - wine_tsx11_unlock(); - old_style &= ~WS_VISIBLE; /* force it to be mapped again below */ + /* if we have an X window the bits will be moved by the X server */ + if (!data->whole_window) + move_window_bits( data, &old_whole_rect, &data->whole_rect, &old_whole_rect ); } + else + move_window_bits( data, &valid_rects[1], &valid_rects[0], &old_whole_rect ); + } - if (!IsRectEmpty( &valid_rects[0] )) - { - int x_offset = 0, y_offset = 0; - - if (data->whole_window) - { - /* the X server will move the bits for us */ - x_offset = data->whole_rect.left - new_whole_rect.left; - y_offset = data->whole_rect.top - new_whole_rect.top; - } + if (data->gl_drawable && + data->client_rect.right-data->client_rect.left == old_client_rect.right-old_client_rect.left && + data->client_rect.bottom-data->client_rect.top == old_client_rect.bottom-old_client_rect.top) + X11DRV_sync_gl_drawable( display, data ); - if (x_offset != valid_rects[1].left - valid_rects[0].left || - y_offset != valid_rects[1].top - valid_rects[0].top) - { - /* FIXME: should copy the window bits here */ - RECT invalid_rect = valid_rects[0]; + if (!data->whole_window || data->lock_changes) return; /* nothing more to do */ - /* invalid_rects are relative to the client area */ - OffsetRect( &invalid_rect, -rectClient->left, -rectClient->top ); - RedrawWindow( hwnd, &invalid_rect, NULL, RDW_INVALIDATE | RDW_ERASE | RDW_ALLCHILDREN ); - } - } + if (data->mapped && (!(new_style & WS_VISIBLE) || !X11DRV_is_window_rect_mapped( rectWindow ))) + { + TRACE( "unmapping win %p\n", hwnd ); + wine_tsx11_lock(); + XUnmapWindow( display, data->whole_window ); + wine_tsx11_unlock(); + data->mapped = FALSE; + } + X11DRV_sync_window_position( display, data, swp_flags, &old_client_rect, &old_whole_rect ); - if (data->whole_window && !data->lock_changes) - { - if ((old_style & WS_VISIBLE) && !(new_style & WS_VISIBLE)) - { - /* window got hidden, unmap it */ - TRACE( "unmapping win %p\n", hwnd ); - wine_tsx11_lock(); - XUnmapWindow( display, data->whole_window ); - wine_tsx11_unlock(); - } - else if ((new_style & WS_VISIBLE) && !X11DRV_is_window_rect_mapped( rectWindow )) - { - /* resizing to zero size or off screen -> unmap */ - TRACE( "unmapping zero size or off-screen win %p\n", hwnd ); - wine_tsx11_lock(); - XUnmapWindow( display, data->whole_window ); - wine_tsx11_unlock(); - } - } + if ((new_style & WS_VISIBLE) && !(new_style & WS_MINIMIZE) && + X11DRV_is_window_rect_mapped( rectWindow )) + { + BOOL was_mapped = data->mapped; - X11DRV_sync_window_position( display, data, swp_flags, rectClient, &new_whole_rect ); + if (!data->mapped || (swp_flags & SWP_FRAMECHANGED)) + X11DRV_set_wm_hints( display, data ); - if (data->whole_window && !data->lock_changes) + if (!data->mapped) { - BOOL mapped = FALSE; - - if ((new_style & WS_VISIBLE) && !(new_style & WS_MINIMIZE) && - X11DRV_is_window_rect_mapped( rectWindow )) - { - if (!(old_style & WS_VISIBLE)) - { - /* window got shown, map it */ - TRACE( "mapping win %p\n", hwnd ); - mapped = TRUE; - } - else if ((swp_flags & (SWP_NOSIZE | SWP_NOMOVE)) != (SWP_NOSIZE | SWP_NOMOVE)) - { - /* resizing from zero size to non-zero -> map */ - TRACE( "mapping non zero size or off-screen win %p\n", hwnd ); - mapped = TRUE; - } - - if (mapped || (swp_flags & SWP_FRAMECHANGED)) - X11DRV_set_wm_hints( display, data ); - - if (mapped) - { - X11DRV_sync_window_style( display, data ); - wine_tsx11_lock(); - XMapWindow( display, data->whole_window ); - XFlush( display ); - wine_tsx11_unlock(); - } - update_wm_states( display, data, mapped ); - } + TRACE( "mapping win %p\n", hwnd ); + X11DRV_sync_window_style( display, data ); + wine_tsx11_lock(); + XMapWindow( display, data->whole_window ); + XFlush( display ); + wine_tsx11_unlock(); + data->mapped = TRUE; } + update_wm_states( display, data, !was_mapped ); } - WIN_ReleasePtr( win ); - return ret; } @@ -878,16 +879,14 @@ static BOOL CALLBACK update_windows_on_desktop_resize( HWND hwnd, LPARAM lparam void X11DRV_resize_desktop( unsigned int width, unsigned int height ) { HWND hwnd = GetDesktopWindow(); - struct x11drv_win_data *data; struct desktop_resize_data resize_data; SetRect( &resize_data.old_screen_rect, 0, 0, screen_width, screen_height ); resize_data.old_virtual_rect = virtual_screen_rect; xinerama_init( width, height ); - ClipCursor(NULL); - if (!(data = X11DRV_get_win_data( hwnd ))) + if (GetWindowThreadProcessId( hwnd, NULL ) != GetCurrentThreadId()) { SendMessageW( hwnd, WM_X11DRV_RESIZE_DESKTOP, 0, MAKELPARAM( width, height ) ); } @@ -972,59 +971,6 @@ void X11DRV_ConfigureNotify( HWND hwnd, XEvent *xev ) /*********************************************************************** - * SetWindowRgn (X11DRV.@) - * - * Assign specified region to window (for non-rectangular windows) - */ -int X11DRV_SetWindowRgn( HWND hwnd, HRGN hrgn, BOOL redraw ) -{ - struct x11drv_win_data *data; - - if (!(data = X11DRV_get_win_data( hwnd ))) - { - if (IsWindow( hwnd )) - FIXME( "not supported on other thread window %p\n", hwnd ); - SetLastError( ERROR_INVALID_WINDOW_HANDLE ); - return FALSE; - } - -#ifdef HAVE_LIBXSHAPE - if (data->whole_window) - { - Display *display = thread_display(); - - if (!hrgn) - { - wine_tsx11_lock(); - XShapeCombineMask( display, data->whole_window, - ShapeBounding, 0, 0, None, ShapeSet ); - wine_tsx11_unlock(); - } - else - { - RGNDATA *pRegionData = X11DRV_GetRegionData( hrgn, 0 ); - if (pRegionData) - { - wine_tsx11_lock(); - XShapeCombineRectangles( display, data->whole_window, ShapeBounding, - data->window_rect.left - data->whole_rect.left, - data->window_rect.top - data->whole_rect.top, - (XRectangle *)pRegionData->Buffer, - pRegionData->rdh.nCount, - ShapeSet, YXBanded ); - wine_tsx11_unlock(); - HeapFree(GetProcessHeap(), 0, pRegionData); - } - } - } -#endif /* HAVE_LIBXSHAPE */ - - invalidate_dce( hwnd, &data->window_rect ); - return TRUE; -} - - -/*********************************************************************** * draw_moving_frame * * Draw the frame used when moving or resizing window. diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index d74dd59f04f..ffd04699ba6 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -669,10 +669,11 @@ struct x11drv_win_data Pixmap pixmap; /* Base pixmap for if gl_drawable is a GLXPixmap */ RECT window_rect; /* USER window rectangle relative to parent */ RECT whole_rect; /* X window rectangle for the whole window relative to parent */ - RECT client_rect; /* client area relative to whole window */ + RECT client_rect; /* client area relative to parent */ XIC xic; /* X input context */ XWMHints *wm_hints; /* window manager hints */ - BOOL managed; /* is window managed? */ + BOOL managed : 1; /* is window managed? */ + BOOL mapped : 1; /* is window mapped? (in either normal or iconic state) */ DWORD wm_state; /* bit mask of active x11drv_wm_state values */ struct dce *dce; /* DCE for CS_OWNDC or CS_CLASSDC windows */ unsigned int lock_changes; /* lock count for X11 change requests */ @@ -681,6 +682,7 @@ struct x11drv_win_data }; extern struct x11drv_win_data *X11DRV_get_win_data( HWND hwnd ); +extern struct x11drv_win_data *X11DRV_create_win_data( HWND hwnd ); extern Window X11DRV_get_whole_window( HWND hwnd ); extern XID X11DRV_get_fbconfig_id( HWND hwnd ); extern Drawable X11DRV_get_gl_drawable( HWND hwnd ); @@ -724,12 +726,11 @@ extern BOOL is_window_managed( HWND hwnd, UINT swp_flags, const RECT *window_rec extern void X11DRV_set_iconic_state( HWND hwnd ); extern void X11DRV_window_to_X_rect( struct x11drv_win_data *data, RECT *rect ); extern void X11DRV_X_to_window_rect( struct x11drv_win_data *data, RECT *rect ); +extern void X11DRV_sync_gl_drawable( Display *display, struct x11drv_win_data *data ); extern void X11DRV_sync_window_style( Display *display, struct x11drv_win_data *data ); extern void X11DRV_sync_window_position( Display *display, struct x11drv_win_data *data, - UINT swp_flags, const RECT *new_client_rect, - const RECT *new_whole_rect ); -extern BOOL X11DRV_SetWindowPos( HWND hwnd, HWND insert_after, const RECT *rectWindow, - const RECT *rectClient, UINT swp_flags, const RECT *validRects ); + UINT swp_flags, const RECT *old_client_rect, + const RECT *old_whole_rect ); extern void X11DRV_set_wm_hints( Display *display, struct x11drv_win_data *data ); extern void xinerama_init( unsigned int width, unsigned int height ); diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c index a84c65bfef1..8d822ef9dd5 100644 --- a/dlls/winex11.drv/x11drv_main.c +++ b/dlls/winex11.drv/x11drv_main.c @@ -498,13 +498,10 @@ static BOOL process_attach(void) break; case 15: - /* Out tests suggest that windows does not support 15 bpp color depth. - * X11 does, what should we do with these situations? + /* In GetDeviceCaps MSDN description explicitly states that + * in 15 bpp mode 16 is returned. */ - FIXME("The X server is running at 15 bpp color depth\n"); - screen_bpp = 15; - break; - + /* fall through */ case 16: screen_bpp = 16; break; @@ -543,7 +540,6 @@ static BOOL process_attach(void) X11DRV_XComposite_Init(); #endif - X11DRV_ClipCursor( NULL ); X11DRV_InitKeyboard(); X11DRV_InitClipboard(); diff --git a/dlls/winex11.drv/xinerama.c b/dlls/winex11.drv/xinerama.c index 86021512cb4..782c779be27 100644 --- a/dlls/winex11.drv/xinerama.c +++ b/dlls/winex11.drv/xinerama.c @@ -169,6 +169,7 @@ void xinerama_init( unsigned int width, unsigned int height ) wine_dbgstr_rect(&virtual_screen_rect), screen_width, screen_height ); wine_tsx11_unlock(); + ClipCursor( NULL ); /* reset the cursor clip rectangle */ } diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c index 50d61dac305..16e1ec71c30 100644 --- a/dlls/wininet/http.c +++ b/dlls/wininet/http.c @@ -561,7 +561,8 @@ static BOOL HTTP_DoAuthorization( LPWININETHTTPREQW lpwhr, LPCWSTR pszAuthValue, out_desc.pBuffers = &out; sec_status = InitializeSecurityContextW(first ? &pAuthInfo->cred : NULL, - first ? NULL : &pAuthInfo->ctx, NULL, + first ? NULL : &pAuthInfo->ctx, + first ? lpwhr->lpHttpSession->lpszServerName : NULL, context_req, 0, SECURITY_NETWORK_DREP, in.pvBuffer ? &in_desc : NULL, 0, &pAuthInfo->ctx, &out_desc, diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c index ec2df72d988..457a65ffd97 100644 --- a/dlls/wininet/tests/http.c +++ b/dlls/wininet/tests/http.c @@ -999,7 +999,7 @@ static void HttpHeaders_test(void) ok(index == 1, "Index was not incremented\n"); ok(strcmp(buffer,"test1")==0, "incorrect string was returned(%s)\n",buffer); ok(len == 5, "Invalid length (exp. 5, got %d)\n", len); - ok(buffer[len] == 0, "Buffer not NULL-terminated\n"); /* len show only 5 characters but the buffer is NULL-terminated*/ + ok((len < sizeof(buffer)) && (buffer[len] == 0), "Buffer not NULL-terminated\n"); /* len show only 5 characters but the buffer is NULL-terminated*/ len = sizeof(buffer); strcpy(buffer,"Warning"); ok(HttpQueryInfo(hRequest,HTTP_QUERY_CUSTOM|HTTP_QUERY_FLAG_REQUEST_HEADERS, diff --git a/dlls/wininet/wininet_Ru.rc b/dlls/wininet/wininet_Ru.rc index 05d706ba12d..59506a2e30a 100644 --- a/dlls/wininet/wininet_Ru.rc +++ b/dlls/wininet/wininet_Ru.rc @@ -27,7 +27,7 @@ FONT 8, "MS Shell Dlg" { LTEXT "Ââåäèòå èìÿ ïîëüçîâàòåëÿ è ïàðîëü:", -1, 40, 6, 150, 15 LTEXT "Ïðîêñè", -1, 40, 26, 50, 10 - LTEXT "Realm", -1, 40, 46, 50, 10 + LTEXT "Äîìåí", -1, 40, 46, 50, 10 LTEXT "Ïîëüçîâàòåëü", -1, 40, 66, 50, 10 LTEXT "Ïàðîëü", -1, 40, 86, 50, 10 LTEXT "" IDC_PROXY, 80, 26, 150, 14, 0 diff --git a/include/config.h.in b/include/config.h.in index 14a26489601..1b2c828cb19 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -588,6 +588,9 @@ /* Define to 1 if you have the `sendmsg' function. */ #undef HAVE_SENDMSG +/* Define to 1 if you have the `setproctitle' function. */ +#undef HAVE_SETPROCTITLE + /* Define to 1 if you have the `setrlimit' function. */ #undef HAVE_SETRLIMIT diff --git a/include/msxml2.idl b/include/msxml2.idl index fb32a79cff9..9aa56458cf3 100644 --- a/include/msxml2.idl +++ b/include/msxml2.idl @@ -23,6 +23,16 @@ import "unknwn.idl"; import "objidl.idl"; import "oaidl.idl"; +[ + uuid(f5078f18-c551-11d3-89b9-0000f81fe221), + version(3.0), + helpstring("Microsoft XML, v3.0") +] +library MSXML2 +{ + +importlib("stdole2.tlb"); + interface IXMLDOMImplementation; interface IXMLDOMNode; interface IXMLDOMDocumentFragment; @@ -1052,3 +1062,5 @@ coclass XSLTemplate30 { [default] interface IXSLTemplate; } + +} /* Library MSXML */ diff --git a/include/win.h b/include/win.h index 7847ae83827..ac6b753b719 100644 --- a/include/win.h +++ b/include/win.h @@ -116,4 +116,7 @@ extern HWND WINPOS_WindowFromPoint( HWND hwndScope, POINT pt, INT *hittest ) DEC extern void WINPOS_CheckInternalPos( HWND hwnd ) DECLSPEC_HIDDEN; extern void WINPOS_ActivateOtherWindow( HWND hwnd ) DECLSPEC_HIDDEN; +extern BOOL set_window_pos( HWND hwnd, HWND insert_after, UINT swp_flags, + const RECT *window_rect, const RECT *client_rect, const RECT *valid_rects ); + #endif /* __WINE_WIN_H */ diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h index 1903a21898f..83abd81cf07 100644 --- a/include/wine/server_protocol.h +++ b/include/wine/server_protocol.h @@ -3049,6 +3049,21 @@ struct set_window_pos_reply struct reply_header __header; unsigned int new_style; unsigned int new_ex_style; + rectangle_t visible; +}; + + + +struct set_window_visible_rect_request +{ + struct request_header __header; + unsigned int flags; + user_handle_t handle; + rectangle_t visible; +}; +struct set_window_visible_rect_reply +{ + struct reply_header __header; }; @@ -4505,6 +4520,7 @@ enum request REQ_get_window_children_from_point, REQ_get_window_tree, REQ_set_window_pos, + REQ_set_window_visible_rect, REQ_get_window_rectangles, REQ_get_window_text, REQ_set_window_text, @@ -4749,6 +4765,7 @@ union generic_request struct get_window_children_from_point_request get_window_children_from_point_request; struct get_window_tree_request get_window_tree_request; struct set_window_pos_request set_window_pos_request; + struct set_window_visible_rect_request set_window_visible_rect_request; struct get_window_rectangles_request get_window_rectangles_request; struct get_window_text_request get_window_text_request; struct set_window_text_request set_window_text_request; @@ -4991,6 +5008,7 @@ union generic_reply struct get_window_children_from_point_reply get_window_children_from_point_reply; struct get_window_tree_reply get_window_tree_reply; struct set_window_pos_reply set_window_pos_reply; + struct set_window_visible_rect_reply set_window_visible_rect_reply; struct get_window_rectangles_reply get_window_rectangles_reply; struct get_window_text_reply get_window_text_reply; struct set_window_text_reply set_window_text_reply; @@ -5075,6 +5093,6 @@ union generic_reply struct add_fd_completion_reply add_fd_completion_reply; }; -#define SERVER_PROTOCOL_VERSION 336 +#define SERVER_PROTOCOL_VERSION 337 #endif /* __WINE_WINE_SERVER_PROTOCOL_H */ diff --git a/include/winuser.h b/include/winuser.h index 3a6a42c2797..aec4a8399a4 100644 --- a/include/winuser.h +++ b/include/winuser.h @@ -3217,9 +3217,6 @@ typedef struct tagMINIMIZEDMETRICS { #define WS_EX_OVERLAPPEDWINDOW (WS_EX_WINDOWEDGE|WS_EX_CLIENTEDGE) #define WS_EX_PALETTEWINDOW (WS_EX_WINDOWEDGE|WS_EX_TOOLWINDOW|WS_EX_TOPMOST) -/* WINE internal... */ -#define WS_EX_TRAYWINDOW 0x80000000L - #endif /* NOWINSTYLES */ /* Window scrolling */ diff --git a/libs/wine/utf8.c b/libs/wine/utf8.c index 14cdb9d35de..fcbbeb056d8 100644 --- a/libs/wine/utf8.c +++ b/libs/wine/utf8.c @@ -82,7 +82,11 @@ static inline int get_length_wcs_utf8( int flags, const WCHAR *src, unsigned int if (val < 0x10000) /* 0x800-0xffff: 3 bytes */ len += 3; else /* 0x10000-0x10ffff: 4 bytes */ + { len += 4; + src++; + srclen--; + } } return len; } @@ -144,6 +148,8 @@ int wine_utf8_wcstombs( int flags, const WCHAR *src, int srclen, char *dst, int val >>= 6; dst[0] = 0xf0 | val; dst += 4; + src++; + srclen--; } } return dstlen - len; diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c index 24efebfad06..2966bcc8776 100644 --- a/programs/cmd/wcmdmain.c +++ b/programs/cmd/wcmdmain.c @@ -26,6 +26,7 @@ */ #include "config.h" +#include #include "wcmd.h" #include "wine/debug.h" diff --git a/programs/explorer/desktop.c b/programs/explorer/desktop.c index 8d030943c43..224f0de0cfd 100644 --- a/programs/explorer/desktop.c +++ b/programs/explorer/desktop.c @@ -181,17 +181,14 @@ void manage_desktop( char *arg ) xwin = create_desktop( "Default", width, height ); } - if (!xwin) /* using the root window */ - { - using_root = TRUE; - width = GetSystemMetrics(SM_CXSCREEN); - height = GetSystemMetrics(SM_CYSCREEN); - } + if (!xwin) using_root = TRUE; /* using the root window */ /* create the desktop window */ hwnd = CreateWindowExW( 0, DESKTOP_CLASS_ATOM, NULL, WS_POPUP | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, - 0, 0, width, height, 0, 0, 0, NULL ); + GetSystemMetrics(SM_XVIRTUALSCREEN), GetSystemMetrics(SM_YVIRTUALSCREEN), + GetSystemMetrics(SM_CXVIRTUALSCREEN), GetSystemMetrics(SM_CYVIRTUALSCREEN), + 0, 0, 0, NULL ); if (hwnd == GetDesktopWindow()) { SetWindowLongPtrW( hwnd, GWLP_WNDPROC, (LONG_PTR)desktop_wnd_proc ); diff --git a/programs/explorer/systray.c b/programs/explorer/systray.c index a5535ff38c8..06347d4a503 100644 --- a/programs/explorer/systray.c +++ b/programs/explorer/systray.c @@ -220,6 +220,7 @@ static void modify_icon(NOTIFYICONDATAW *nid, BOOL modify_tooltip) static void add_icon(NOTIFYICONDATAW *nid) { + HMODULE x11drv = GetModuleHandleA( "winex11.drv" ); RECT rect; struct icon *icon; static const WCHAR adaptor_windowname[] = /* Wine System Tray Adaptor */ {'W','i','n','e',' ','S','y','s','t','e','m',' ','T','r','a','y',' ','A','d','a','p','t','o','r',0}; @@ -250,13 +251,18 @@ static void add_icon(NOTIFYICONDATAW *nid) AdjustWindowRect(&rect, WS_CLIPSIBLINGS | WS_CAPTION, FALSE); /* create the adaptor window */ - icon->window = CreateWindowEx(WS_EX_TRAYWINDOW, adaptor_classname, + icon->window = CreateWindowEx(0, adaptor_classname, adaptor_windowname, WS_CLIPSIBLINGS | WS_CAPTION, CW_USEDEFAULT, CW_USEDEFAULT, rect.right - rect.left, rect.bottom - rect.top, NULL, NULL, NULL, icon); + if (x11drv) + { + void (*make_systray_window)(HWND) = (void *)GetProcAddress( x11drv, "wine_make_systray_window" ); + if (make_systray_window) make_systray_window( icon->window ); + } if (!hide_systray) ShowWindow(icon->window, SW_SHOWNA); diff --git a/programs/regedit/regproc.c b/programs/regedit/regproc.c index 705faf675e4..8b1507dc057 100644 --- a/programs/regedit/regproc.c +++ b/programs/regedit/regproc.c @@ -483,10 +483,19 @@ void processRegLines(FILE *in) { LPSTR line = NULL; /* line read from input stream */ ULONG lineSize = REG_VAL_BUF_SIZE; + BYTE uni[2]; line = HeapAlloc(GetProcessHeap(), 0, lineSize); CHECK_ENOUGH_MEMORY(line); + if (fread(uni, 2, 1, in) == 1) { + if (uni[0] == 0xff && uni[1] == 0xfe) { + printf("Trying to import from a unicode file: this isn't supported yet.\n" + "Please use export as Win 9x/NT4 files from native regedit\n"); + return; + } + fseek(in, -2, SEEK_CUR); + } while (!feof(in)) { LPSTR s; /* The pointer into line for where the current fgets should read */ s = line; diff --git a/programs/uninstaller/No.rc b/programs/uninstaller/No.rc index cc48098aad5..a88196fdf4f 100644 --- a/programs/uninstaller/No.rc +++ b/programs/uninstaller/No.rc @@ -31,7 +31,7 @@ BEGIN LBS_EXTENDEDSEL | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "A&vinstaller",IDC_UNINSTALL,270,48,50,14 PUSHBUTTON "&Om",IDC_ABOUT,270,65,50,14 - PUSHBUTTON "R&ediger",IDC_EXIT,270,81,50,14 + PUSHBUTTON "&Lukk",IDC_EXIT,270,81,50,14 END diff --git a/programs/uninstaller/main.c b/programs/uninstaller/main.c index 72d62f074dd..d731de46f55 100644 --- a/programs/uninstaller/main.c +++ b/programs/uninstaller/main.c @@ -286,6 +286,10 @@ static void UninstallProgram(void) list_need_update = 1; } +static void UpdateButtons(HWND hDlg, HWND hList) +{ + EnableWindow(GetDlgItem(hDlg, IDC_UNINSTALL), SendMessageW(hList, LB_GETSELCOUNT, 0, 0) > 0); +} static INT_PTR CALLBACK DlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) { @@ -299,6 +303,7 @@ static INT_PTR CALLBACK DlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l GetTextMetricsW(hdc, &tm); UpdateList(hList); ReleaseDC(hwnd, hdc); + UpdateButtons(hwnd, hList); break; case WM_COMMAND: switch(LOWORD(wParam)) @@ -316,6 +321,7 @@ static INT_PTR CALLBACK DlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l } else sFilter = NULL; UpdateList(hList); + UpdateButtons(hwnd, hList); } break; } @@ -326,6 +332,7 @@ static INT_PTR CALLBACK DlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l { UninstallProgram(); UpdateList(hList); + UpdateButtons(hwnd, hList); } break; } @@ -344,6 +351,7 @@ static INT_PTR CALLBACK DlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l wine_dbgstr_w(entries[sel].descr)); oldsel = sel; } + UpdateButtons(hwnd, hList); break; case IDC_ABOUT: MessageBoxW(0, sAbout, sAboutTitle, MB_OK); diff --git a/programs/winecfg/No.rc b/programs/winecfg/No.rc index d6e7cf763d2..2f3bd09a37b 100644 --- a/programs/winecfg/No.rc +++ b/programs/winecfg/No.rc @@ -219,7 +219,7 @@ BEGIN IDS_TAB_AUDIO "Lyd" IDS_TAB_ABOUT "Om" IDS_WINECFG_TITLE "Oppsett av Wine" - IDS_WINECFG_TITLE_APP "Wine configuration for %s" + IDS_WINECFG_TITLE_APP "Oppsett av Wine for «%s»" IDS_THEMEFILE "Temafiler" IDS_THEMEFILE_SELECT "Velg en temafil" IDS_AUDIO_MISSING "Ingen lyddriver er oppgitt i registeret.\n\nEn anbefalt driver er valgt for deg;\nbruk den eller velg en annen,\n\nog trykk «Bruk» for at endringene skal tre i kraft." diff --git a/programs/winemenubuilder/winemenubuilder.c b/programs/winemenubuilder/winemenubuilder.c index 92660bbad49..06ffd451c6f 100644 --- a/programs/winemenubuilder/winemenubuilder.c +++ b/programs/winemenubuilder/winemenubuilder.c @@ -866,6 +866,7 @@ static BOOL InvokeShellLinker( IShellLinkW *sl, LPCWSTR link, BOOL bWait ) '\\','s','t','a','r','t','.','e','x','e',0}; char *link_name = NULL, *icon_name = NULL, *work_dir = NULL; char *escaped_path = NULL, *escaped_args = NULL, *escaped_description = NULL; + WCHAR szTmp[INFOTIPSIZE]; WCHAR szDescription[INFOTIPSIZE], szPath[MAX_PATH], szWorkDir[MAX_PATH]; WCHAR szArgs[INFOTIPSIZE], szIconPath[MAX_PATH]; int iIconId = 0, r = -1; @@ -890,20 +891,23 @@ static BOOL InvokeShellLinker( IShellLinkW *sl, LPCWSTR link, BOOL bWait ) } WINE_TRACE("Link : %s\n", wine_dbgstr_a(link_name)); - szWorkDir[0] = 0; - IShellLinkW_GetWorkingDirectory( sl, szWorkDir, MAX_PATH ); + szTmp[0] = 0; + IShellLinkW_GetWorkingDirectory( sl, szTmp, MAX_PATH ); + ExpandEnvironmentStringsW(szTmp, szWorkDir, MAX_PATH); WINE_TRACE("workdir : %s\n", wine_dbgstr_w(szWorkDir)); - szDescription[0] = 0; - IShellLinkW_GetDescription( sl, szDescription, INFOTIPSIZE ); + szTmp[0] = 0; + IShellLinkW_GetDescription( sl, szTmp, INFOTIPSIZE ); + ExpandEnvironmentStringsW(szTmp, szDescription, INFOTIPSIZE); WINE_TRACE("description: %s\n", wine_dbgstr_w(szDescription)); get_cmdline( sl, szPath, MAX_PATH, szArgs, INFOTIPSIZE); WINE_TRACE("path : %s\n", wine_dbgstr_w(szPath)); WINE_TRACE("args : %s\n", wine_dbgstr_w(szArgs)); - szIconPath[0] = 0; - IShellLinkW_GetIconLocation( sl, szIconPath, MAX_PATH, &iIconId ); + szTmp[0] = 0; + IShellLinkW_GetIconLocation( sl, szTmp, MAX_PATH, &iIconId ); + ExpandEnvironmentStringsW(szTmp, szIconPath, MAX_PATH); WINE_TRACE("icon file : %s\n", wine_dbgstr_w(szIconPath) ); if( !szPath[0] ) diff --git a/programs/winetest/Makefile.in b/programs/winetest/Makefile.in index d3681a3e1fe..02448ab8adf 100644 --- a/programs/winetest/Makefile.in +++ b/programs/winetest/Makefile.in @@ -62,6 +62,7 @@ TESTBINS = \ msxml3_test.exe \ netapi32_test.exe \ ntdll_test.exe \ + ntdsapi_test.exe \ ntprint_test.exe \ odbccp32_test.exe \ ole32_test.exe \ @@ -179,6 +180,8 @@ netapi32_test.exe: $(DLLDIR)/netapi32/tests/netapi32_test.exe$(DLLEXT) cp $(DLLDIR)/netapi32/tests/netapi32_test.exe$(DLLEXT) $@ && $(STRIP) $@ ntdll_test.exe: $(DLLDIR)/ntdll/tests/ntdll_test.exe$(DLLEXT) cp $(DLLDIR)/ntdll/tests/ntdll_test.exe$(DLLEXT) $@ && $(STRIP) $@ +ntdsapi_test.exe: $(DLLDIR)/ntdsapi/tests/ntdsapi_test.exe$(DLLEXT) + cp $(DLLDIR)/ntdsapi/tests/ntdsapi_test.exe$(DLLEXT) $@ && $(STRIP) $@ ntprint_test.exe: $(DLLDIR)/ntprint/tests/ntprint_test.exe$(DLLEXT) cp $(DLLDIR)/ntprint/tests/ntprint_test.exe$(DLLEXT) $@ && $(STRIP) $@ odbccp32_test.exe: $(DLLDIR)/odbccp32/tests/odbccp32_test.exe$(DLLEXT) diff --git a/programs/winetest/winetest.rc b/programs/winetest/winetest.rc index 4b67bd2ca74..7f155d804ee 100644 --- a/programs/winetest/winetest.rc +++ b/programs/winetest/winetest.rc @@ -120,6 +120,7 @@ msvcrtd_test.exe TESTRES "msvcrtd_test.exe" msxml3_test.exe TESTRES "msxml3_test.exe" netapi32_test.exe TESTRES "netapi32_test.exe" ntdll_test.exe TESTRES "ntdll_test.exe" +ntdsapi_test.exe TESTRES "ntdsapi_test.exe" ntprint_test.exe TESTRES "ntprint_test.exe" odbccp32_test.exe TESTRES "odbccp32_test.exe" ole32_test.exe TESTRES "ole32_test.exe" diff --git a/programs/write/rsrc.rc b/programs/write/Ru.rc similarity index 80% copy from programs/write/rsrc.rc copy to programs/write/Ru.rc index a854b1a52ca..653d426b2cc 100644 --- a/programs/write/rsrc.rc +++ b/programs/write/Ru.rc @@ -1,5 +1,7 @@ /* - * Copyright 2007 Mikolaj Zalewski + * Russian language support + * + * Copyright 2008 Andrey Esin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -16,13 +18,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include - -#include "resources.h" - -LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL +LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT -#include "En.rc" -#include "Fr.rc" -#include "Ko.rc" -#include "No.rc" +STRINGTABLE +{ + IDS_FAILED, "Íå óäàëîñü çàïóñòèòü Wordpad" +} diff --git a/programs/write/rsrc.rc b/programs/write/rsrc.rc index a854b1a52ca..540b8eac9b7 100644 --- a/programs/write/rsrc.rc +++ b/programs/write/rsrc.rc @@ -26,3 +26,4 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL #include "Fr.rc" #include "Ko.rc" #include "No.rc" +#include "Ru.rc" diff --git a/server/protocol.def b/server/protocol.def index 4f84bb7a15a..5e8b8e789f1 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -2242,6 +2242,15 @@ enum message_type @REPLY unsigned int new_style; /* new window style */ unsigned int new_ex_style; /* new window extended style */ + rectangle_t visible; /* new visible rectangle */ +@END + + +/* Set the visible rectangle of a window */ +@REQ(set_window_visible_rect) + unsigned int flags; /* SWP_* flags */ + user_handle_t handle; /* handle to the window */ + rectangle_t visible; /* visible rectangle */ @END diff --git a/server/request.h b/server/request.h index d039bdec860..f84f1e56d92 100644 --- a/server/request.h +++ b/server/request.h @@ -265,6 +265,7 @@ DECL_HANDLER(get_window_children); DECL_HANDLER(get_window_children_from_point); DECL_HANDLER(get_window_tree); DECL_HANDLER(set_window_pos); +DECL_HANDLER(set_window_visible_rect); DECL_HANDLER(get_window_rectangles); DECL_HANDLER(get_window_text); DECL_HANDLER(set_window_text); @@ -508,6 +509,7 @@ static const req_handler req_handlers[REQ_NB_REQUESTS] = (req_handler)req_get_window_children_from_point, (req_handler)req_get_window_tree, (req_handler)req_set_window_pos, + (req_handler)req_set_window_visible_rect, (req_handler)req_get_window_rectangles, (req_handler)req_get_window_text, (req_handler)req_set_window_text, diff --git a/server/trace.c b/server/trace.c index cc20c84cc8d..39f95ffb7c9 100644 --- a/server/trace.c +++ b/server/trace.c @@ -2782,7 +2782,17 @@ static void dump_set_window_pos_request( const struct set_window_pos_request *re static void dump_set_window_pos_reply( const struct set_window_pos_reply *req ) { fprintf( stderr, " new_style=%08x,", req->new_style ); - fprintf( stderr, " new_ex_style=%08x", req->new_ex_style ); + fprintf( stderr, " new_ex_style=%08x,", req->new_ex_style ); + fprintf( stderr, " visible=" ); + dump_rectangle( &req->visible ); +} + +static void dump_set_window_visible_rect_request( const struct set_window_visible_rect_request *req ) +{ + fprintf( stderr, " flags=%08x,", req->flags ); + fprintf( stderr, " handle=%p,", req->handle ); + fprintf( stderr, " visible=" ); + dump_rectangle( &req->visible ); } static void dump_get_window_rectangles_request( const struct get_window_rectangles_request *req ) @@ -3989,6 +3999,7 @@ static const dump_func req_dumpers[REQ_NB_REQUESTS] = { (dump_func)dump_get_window_children_from_point_request, (dump_func)dump_get_window_tree_request, (dump_func)dump_set_window_pos_request, + (dump_func)dump_set_window_visible_rect_request, (dump_func)dump_get_window_rectangles_request, (dump_func)dump_get_window_text_request, (dump_func)dump_set_window_text_request, @@ -4229,6 +4240,7 @@ static const dump_func reply_dumpers[REQ_NB_REQUESTS] = { (dump_func)dump_get_window_children_from_point_reply, (dump_func)dump_get_window_tree_reply, (dump_func)dump_set_window_pos_reply, + (dump_func)0, (dump_func)dump_get_window_rectangles_reply, (dump_func)dump_get_window_text_reply, (dump_func)0, @@ -4469,6 +4481,7 @@ static const char * const req_names[REQ_NB_REQUESTS] = { "get_window_children_from_point", "get_window_tree", "set_window_pos", + "set_window_visible_rect", "get_window_rectangles", "get_window_text", "set_window_text", diff --git a/server/window.c b/server/window.c index 8cf8001eb5a..3c067b603d8 100644 --- a/server/window.c +++ b/server/window.c @@ -424,6 +424,7 @@ void close_desktop_window( struct desktop *desktop ) static struct window *create_window( struct window *parent, struct window *owner, atom_t atom, void *instance ) { + static const rectangle_t empty_rect; int extra_bytes; struct window *win; struct desktop *desktop; @@ -462,6 +463,7 @@ static struct window *create_window( struct window *parent, struct window *owner win->prop_alloc = 0; win->properties = NULL; win->nb_extra_bytes = extra_bytes; + win->window_rect = win->visible_rect = win->client_rect = empty_rect; memset( win->extra_bytes, 0, extra_bytes ); list_init( &win->children ); list_init( &win->unlinked ); @@ -1407,12 +1409,10 @@ static struct region *expose_window( struct window *win, const rectangle_t *old_ /* set the window and client rectangles, updating the update region if necessary */ static void set_window_pos( struct window *win, struct window *previous, unsigned int swp_flags, const rectangle_t *window_rect, - const rectangle_t *client_rect, const rectangle_t *visible_rect, - const rectangle_t *valid_rects ) + const rectangle_t *client_rect, const rectangle_t *valid_rects ) { struct region *old_vis_rgn = NULL, *exposed_rgn = NULL; const rectangle_t old_window_rect = win->window_rect; - const rectangle_t old_visible_rect = win->visible_rect; const rectangle_t old_client_rect = win->client_rect; int client_changed, frame_changed; int visible = (win->style & WS_VISIBLE) || (swp_flags & SWP_SHOWWINDOW); @@ -1424,12 +1424,26 @@ static void set_window_pos( struct window *win, struct window *previous, /* set the new window info before invalidating anything */ win->window_rect = *window_rect; - win->visible_rect = *visible_rect; win->client_rect = *client_rect; if (!(swp_flags & SWP_NOZORDER) && win->parent) link_window( win, previous ); if (swp_flags & SWP_SHOWWINDOW) win->style |= WS_VISIBLE; else if (swp_flags & SWP_HIDEWINDOW) win->style &= ~WS_VISIBLE; + /* assume the visible rect stays at the same offset from the window rect */ + win->visible_rect.left += window_rect->left - old_window_rect.left; + win->visible_rect.top += window_rect->top - old_window_rect.top; + win->visible_rect.right += window_rect->right - old_window_rect.right; + win->visible_rect.bottom += window_rect->bottom - old_window_rect.bottom; + /* but don't make it smaller than the client rect */ + if (win->visible_rect.left > client_rect->left) + win->visible_rect.left = max( window_rect->left, client_rect->left ); + if (win->visible_rect.top > client_rect->top) + win->visible_rect.top = max( window_rect->top, client_rect->top ); + if (win->visible_rect.right < client_rect->right) + win->visible_rect.right = min( window_rect->right, client_rect->right ); + if (win->visible_rect.bottom < client_rect->bottom) + win->visible_rect.bottom = min( window_rect->bottom, client_rect->bottom ); + /* if the window is not visible, everything is easy */ if (!visible) return; @@ -1472,8 +1486,7 @@ static void set_window_pos( struct window *win, struct window *previous, if (swp_flags & SWP_NOCOPYBITS) { frame_changed = ((swp_flags & SWP_FRAMECHANGED) || - memcmp( window_rect, &old_window_rect, sizeof(old_window_rect) ) || - memcmp( visible_rect, &old_visible_rect, sizeof(old_visible_rect) )); + memcmp( window_rect, &old_window_rect, sizeof(old_window_rect) )); client_changed = memcmp( client_rect, &old_client_rect, sizeof(old_client_rect) ); } else @@ -1483,54 +1496,93 @@ static void set_window_pos( struct window *win, struct window *previous, int y_offset = window_rect->top - old_window_rect.top; frame_changed = ((swp_flags & SWP_FRAMECHANGED) || window_rect->right - old_window_rect.right != x_offset || - window_rect->bottom - old_window_rect.bottom != y_offset || - visible_rect->left - old_visible_rect.left != x_offset || - visible_rect->right - old_visible_rect.right != x_offset || - visible_rect->top - old_visible_rect.top != y_offset || - visible_rect->bottom - old_visible_rect.bottom != y_offset); + window_rect->bottom - old_window_rect.bottom != y_offset); client_changed = (client_rect->left - old_client_rect.left != x_offset || client_rect->right - old_client_rect.right != x_offset || client_rect->top - old_client_rect.top != y_offset || - client_rect->bottom - old_client_rect.bottom != y_offset); + client_rect->bottom - old_client_rect.bottom != y_offset || + !valid_rects || + memcmp( &valid_rects[0], client_rect, sizeof(*client_rect) )); } if (frame_changed || client_changed) { - struct region *tmp = create_empty_region(); + struct region *win_rgn = old_vis_rgn; /* reuse previous region */ - if (tmp) + set_region_rect( win_rgn, window_rect ); + if (valid_rects) { /* subtract the valid portion of client rect from the total region */ - if (!client_changed) - set_region_rect( tmp, client_rect ); - else if (valid_rects) - set_region_rect( tmp, &valid_rects[0] ); - - set_region_rect( old_vis_rgn, window_rect ); - if (!subtract_region( tmp, old_vis_rgn, tmp )) free_region( tmp ); - else + struct region *tmp = create_empty_region(); + if (tmp) { - if (!is_desktop_window(win)) - offset_region( tmp, -client_rect->left, -client_rect->top ); - if (exposed_rgn) - { - union_region( exposed_rgn, exposed_rgn, tmp ); - free_region( tmp ); - } - else exposed_rgn = tmp; + set_region_rect( tmp, &valid_rects[0] ); + if (subtract_region( tmp, win_rgn, tmp )) win_rgn = tmp; + else free_region( tmp ); } } + if (!is_desktop_window(win)) + offset_region( win_rgn, -client_rect->left, -client_rect->top ); + if (exposed_rgn) + { + union_region( exposed_rgn, exposed_rgn, win_rgn ); + if (win_rgn != old_vis_rgn) free_region( win_rgn ); + } + else + { + exposed_rgn = win_rgn; + if (win_rgn == old_vis_rgn) old_vis_rgn = NULL; + } } if (exposed_rgn) redraw_window( win, exposed_rgn, 1, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_ALLCHILDREN ); done: - free_region( old_vis_rgn ); + if (old_vis_rgn) free_region( old_vis_rgn ); if (exposed_rgn) free_region( exposed_rgn ); clear_error(); /* we ignore out of memory errors once the new rects have been set */ } +/* set the window visible rect */ +static void set_window_visible_rect( struct window *win, const rectangle_t *visible_rect, + unsigned int swp_flags ) +{ + struct region *old_vis_rgn = NULL, *exposed_rgn = NULL; + const rectangle_t old_visible_rect = win->visible_rect; + + if (!memcmp( visible_rect, &old_visible_rect, sizeof(old_visible_rect) )) return; + + /* if the window is not visible, everything is easy */ + if (!is_visible( win ) || (swp_flags & SWP_NOREDRAW)) + { + win->visible_rect = *visible_rect; + return; + } + + if (!(old_vis_rgn = get_visible_region( win, DCX_WINDOW ))) return; + win->visible_rect = *visible_rect; + + /* expose anything revealed by the change */ + + exposed_rgn = expose_window( win, &win->window_rect, old_vis_rgn ); + if (exposed_rgn) + { + /* subtract the client rect from the total window rect */ + set_region_rect( exposed_rgn, &win->window_rect ); + set_region_rect( old_vis_rgn, &win->client_rect ); + if (subtract_region( exposed_rgn, exposed_rgn, old_vis_rgn )) + { + if (!is_desktop_window(win)) + offset_region( exposed_rgn, -win->client_rect.left, -win->client_rect.top ); + redraw_window( win, exposed_rgn, 1, RDW_INVALIDATE | RDW_FRAME | RDW_NOCHILDREN ); + } + free_region( exposed_rgn ); + } + free_region( old_vis_rgn ); + clear_error(); /* we ignore out of memory errors once the new rect has been set */ +} + /* set the window region, updating the update region if necessary */ static void set_window_region( struct window *win, struct region *region, int redraw ) @@ -1848,7 +1900,7 @@ DECL_HANDLER(get_window_tree) /* set the position and Z order of a window */ DECL_HANDLER(set_window_pos) { - const rectangle_t *visible_rect = NULL, *valid_rects = NULL; + const rectangle_t *valid_rects = NULL; struct window *previous = NULL; struct window *win = get_window( req->handle ); unsigned int flags = req->flags; @@ -1892,13 +1944,19 @@ DECL_HANDLER(set_window_pos) return; } - if (get_req_data_size() >= sizeof(rectangle_t)) visible_rect = get_req_data(); - if (get_req_data_size() >= 3 * sizeof(rectangle_t)) valid_rects = visible_rect + 1; - - if (!visible_rect) visible_rect = &req->window; - set_window_pos( win, previous, flags, &req->window, &req->client, visible_rect, valid_rects ); + if (get_req_data_size() >= 2 * sizeof(rectangle_t)) valid_rects = get_req_data(); + set_window_pos( win, previous, flags, &req->window, &req->client, valid_rects ); reply->new_style = win->style; reply->new_ex_style = win->ex_style; + reply->visible = win->visible_rect; +} + + +/* set the visible rectangle of a window */ +DECL_HANDLER(set_window_visible_rect) +{ + struct window *win = get_window( req->handle ); + if (win) set_window_visible_rect( win, &req->visible, req->flags ); } diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c index 4fdc84fd16d..0e8a09681b8 100644 --- a/tools/widl/typegen.c +++ b/tools/widl/typegen.c @@ -2724,6 +2724,8 @@ static void write_remoting_arg(FILE *file, int indent, const func_t *func, { if (pass == PASS_OUT) { + if (!in_attr) + print_file(file, indent, "*%s = 0;\n", var->name); print_file(file, indent, "NdrClientContextUnmarshall(\n"); print_file(file, indent + 1, "&_StubMsg,\n"); print_file(file, indent + 1, "(NDR_CCONTEXT *)%s,\n", var->name); diff --git a/tools/widl/typelib_struct.h b/tools/widl/typelib_struct.h index 89bbfd852f9..79b86b91216 100644 --- a/tools/widl/typelib_struct.h +++ b/tools/widl/typelib_struct.h @@ -97,7 +97,7 @@ typedef struct tagMSFT_SegDir { /*2*/MSFT_pSeg pImpInfo; /* table with info for imported types */ /*3*/MSFT_pSeg pImpFiles; /* import libraries */ /*4*/MSFT_pSeg pRefTab; /* References table */ -/*5*/MSFT_pSeg pLibtab; /* always exists, alway same size (0x80) */ +/*5*/MSFT_pSeg pLibtab; /* always exists, always same size (0x80) */ /* hash table w offsets to guid????? */ /*6*/MSFT_pSeg pGuidTab; /* all guids are stored here together with */ /* offset in some table???? */ diff --git a/tools/winebuild/spec16.c b/tools/winebuild/spec16.c index dc86b1b40ae..f5be830f9d5 100644 --- a/tools/winebuild/spec16.c +++ b/tools/winebuild/spec16.c @@ -461,7 +461,7 @@ static void output_init_code( const DLLSPEC *spec, const char *header_name ) output( "\t.align 4\n" ); output( "\t%s\n", func_declaration(name) ); output( "%s:\n", name ); - output( "subl $4,%%esp\n" ); + output( "\tsubl $4,%%esp\n" ); if (UsePIC) { output( "\tcall %s\n", asm_name("__wine_spec_get_pc_thunk_eax") ); @@ -485,7 +485,7 @@ static void output_init_code( const DLLSPEC *spec, const char *header_name ) output( "\t.align 4\n" ); output( "\t%s\n", func_declaration(name) ); output( "%s:\n", name ); - output( "subl $8,%%esp\n" ); + output( "\tsubl $8,%%esp\n" ); if (UsePIC) { output( "\tcall %s\n", asm_name("__wine_spec_get_pc_thunk_eax") ); diff --git a/tools/wrc/parser.y b/tools/wrc/parser.y index 0af5330c586..94ce44c872f 100644 --- a/tools/wrc/parser.y +++ b/tools/wrc/parser.y @@ -442,7 +442,7 @@ resources } /* * The following newline rule will never get reduced because we never - * get the tNL token, unless we explicitely set the 'want_nl' + * get the tNL token, unless we explicitly set the 'want_nl' * flag, which we don't. * The *ONLY* reason for this to be here is because Berkeley * yacc (byacc), at least version 1.9, has a bug. -- 2.11.4.GIT