From 47f21c5c19940a001ff006114689c86a52f50285 Mon Sep 17 00:00:00 2001 From: Jan Zerebecki Date: Sat, 25 Oct 2008 13:58:36 +0200 Subject: [PATCH] push 9bfdf186dc6a237cd7f58f0ee2ef677e81617b1d --- ANNOUNCE | 1700 +++++++++----------- VERSION | 2 +- aclocal.m4 | 5 +- configure | 231 ++- configure.ac | 65 +- dlls/Makefile.in | 5 + dlls/advapi32/security.c | 139 +- dlls/advapi32/tests/security.c | 167 +- dlls/advpack/tests/advpack.c | 2 +- dlls/appwiz.cpl/Ko.rc | 79 + dlls/appwiz.cpl/appwiz.rc | 1 + dlls/avifil32/acmstream.c | 2 +- dlls/avifil32/api.c | 2 +- dlls/avifil32/avifile.c | 2 +- dlls/avifil32/avifile_private.h | 2 +- dlls/avifil32/editstream.c | 2 +- dlls/avifil32/extrachunk.c | 2 +- dlls/avifil32/extrachunk.h | 2 +- dlls/avifil32/factory.c | 2 +- dlls/avifil32/getframe.c | 2 +- dlls/avifil32/icmstream.c | 2 +- dlls/avifil32/tmpfile.c | 2 +- dlls/avifil32/wavfile.c | 2 +- dlls/comctl32/animate.c | 2 +- dlls/comctl32/comboex.c | 20 +- dlls/comctl32/commctrl.c | 2 +- dlls/comctl32/datetime.c | 8 +- dlls/comctl32/header.c | 2 +- dlls/comctl32/hotkey.c | 2 +- dlls/comctl32/imagelist.c | 2 +- dlls/comctl32/ipaddress.c | 2 +- dlls/comctl32/listview.c | 52 +- dlls/comctl32/monthcal.c | 2 +- dlls/comctl32/nativefont.c | 2 +- dlls/comctl32/pager.c | 2 +- dlls/comctl32/progress.c | 2 +- dlls/comctl32/propsheet.c | 20 +- dlls/comctl32/rebar.c | 5 +- dlls/comctl32/status.c | 2 +- dlls/comctl32/tab.c | 2 +- dlls/comctl32/tests/dpa.c | 2 +- dlls/comctl32/tests/imagelist.c | 2 +- dlls/comctl32/toolbar.c | 14 +- dlls/comctl32/tooltips.c | 2 +- dlls/comctl32/trackbar.c | 2 +- dlls/comctl32/treeview.c | 10 +- dlls/comctl32/updown.c | 2 +- dlls/comdlg32/filedlg.c | 7 +- dlls/comdlg32/tests/Makefile.in | 2 + dlls/comdlg32/tests/filedlg.c | 42 + .../{d3d10/d3d10_main.c => comdlg32/tests/rsrc.rc} | 35 +- dlls/crypt32/chain.c | 18 +- dlls/crypt32/crypt32.spec | 1 + dlls/crypt32/provstore.c | 6 +- dlls/crypt32/store.c | 15 +- dlls/crypt32/tests/chain.c | 20 +- dlls/cryptui/Makefile.in | 2 +- dlls/cryptui/cryptui.spec | 2 +- dlls/cryptui/main.c | 77 + dlls/d3d10/Makefile.in | 6 +- dlls/d3d10/d3d10.spec | 4 +- dlls/d3d10/d3d10_main.c | 82 +- dlls/d3d10/{d3d10_main.c => d3d10_private.h} | 43 +- dlls/d3d10/device.c | 852 ++++++++++ dlls/d3d10/utils.c | 162 ++ dlls/d3d8/d3d8_main.c | 2 +- dlls/d3d8/tests/visual.c | 2 +- dlls/d3d9/d3d9_main.c | 2 +- dlls/d3d9/tests/d3d9ex.c | 2 +- dlls/d3d9/tests/device.c | 4 +- dlls/d3d9/tests/query.c | 2 +- dlls/d3d9/tests/visual.c | 2 +- dlls/dbghelp/dbghelp_private.h | 3 +- dlls/dbghelp/msc.c | 9 +- dlls/dbghelp/path.c | 5 +- dlls/dbghelp/pe_module.c | 2 +- dlls/dbghelp/stack.c | 2 +- dlls/ddraw/clipper.c | 2 +- dlls/ddraw/ddraw.c | 2 +- dlls/ddraw/ddraw_private.h | 5 +- dlls/ddraw/device.c | 2 +- dlls/ddraw/direct3d.c | 2 +- dlls/ddraw/executebuffer.c | 2 +- dlls/ddraw/gamma.c | 2 +- dlls/ddraw/light.c | 2 +- dlls/ddraw/main.c | 12 +- dlls/ddraw/material.c | 2 +- dlls/ddraw/palette.c | 2 +- dlls/ddraw/parent.c | 2 +- dlls/ddraw/surface.c | 4 +- dlls/ddraw/tests/d3d.c | 2 +- dlls/ddraw/tests/dsurface.c | 2 +- dlls/ddraw/tests/overlay.c | 2 +- dlls/ddraw/tests/visual.c | 2 +- dlls/ddraw/texture.c | 2 +- dlls/ddraw/utils.c | 2 +- dlls/ddraw/vertexbuffer.c | 2 +- dlls/ddraw/viewport.c | 2 +- dlls/dpnet/peer.c | 2 +- dlls/dpnet/threadpool.c | 2 +- dlls/dsound/tests/capture.c | 11 +- dlls/dsound/tests/propset.c | 8 +- dlls/{d3d10 => dxgi}/Makefile.in | 11 +- dlls/dxgi/device.c | 162 ++ dlls/dxgi/dxgi.spec | 1 + dlls/dxgi/dxgi_main.c | 64 + dlls/{d3d10/d3d10_main.c => dxgi/dxgi_private.h} | 49 +- dlls/dxgi/factory.c | 162 ++ dlls/dxgi/utils.c | 128 ++ dlls/{mountmgr.sys/mountmgr.h => dxgi/version.rc} | 17 +- dlls/gdi32/bitmap.c | 8 +- dlls/gdi32/brush.c | 2 +- dlls/gdi32/dib.c | 6 +- dlls/gdi32/dispdib.c | 2 +- dlls/gdi32/enhmetafile.c | 28 +- dlls/gdi32/font.c | 2 +- dlls/gdi32/freetype.c | 4 +- dlls/gdi32/metafile.c | 4 +- dlls/gdi32/palette.c | 10 +- dlls/gdi32/region.c | 30 +- dlls/gdi32/wing.c | 3 +- dlls/gdiplus/brush.c | 33 + dlls/gdiplus/gdiplus.spec | 6 +- dlls/gdiplus/gdiplus_private.h | 1 + dlls/gdiplus/graphics.c | 11 + dlls/gdiplus/image.c | 25 +- dlls/gdiplus/region.c | 3 + dlls/gdiplus/tests/brush.c | 49 + dlls/gdiplus/tests/image.c | 4 + dlls/gdiplus/tests/region.c | 93 ++ dlls/{winedos/dosvm.h => iccvid/iccvid_Pt.rc} | 22 +- dlls/iccvid/rsrc.rc | 1 + dlls/jscript/dispex.c | 2 +- dlls/jscript/engine.c | 31 +- dlls/jscript/engine.h | 24 +- dlls/jscript/jscript.h | 1 + dlls/jscript/math.c | 25 +- dlls/jscript/number.c | 29 +- dlls/jscript/parser.y | 53 +- dlls/jscript/tests/api.js | 30 + dlls/jscript/tests/lang.js | 39 + dlls/kernel32/lcformat.c | 2 +- dlls/kernel32/locale.c | 2 +- dlls/kernel32/nls/eox.nls | 10 +- dlls/kernel32/oldconfig.c | 4 +- dlls/kernel32/pthread.c | 2 +- dlls/kernel32/tests/actctx.c | 47 + dlls/kernel32/tests/file.c | 1 + dlls/kernel32/tests/volume.c | 11 +- dlls/kernel32/volume.c | 56 +- dlls/mountmgr.sys/device.c | 454 +++++- dlls/mountmgr.sys/diskarb.c | 11 +- dlls/mountmgr.sys/hal.c | 10 +- dlls/mountmgr.sys/mountmgr.c | 914 +++++------ dlls/mountmgr.sys/mountmgr.h | 39 +- dlls/mpr/wnet.c | 74 +- dlls/mscms/tests/profile.c | 2 +- dlls/mscms/transform.c | 7 +- dlls/msdmo/dmoreg.c | 2 +- dlls/msdmo/dmort.c | 2 +- dlls/mshtml/Pt.rc | 55 + dlls/mshtml/conpoint.c | 2 +- dlls/mshtml/htmldoc.c | 2 +- dlls/mshtml/main.c | 2 +- dlls/mshtml/nsembed.c | 2 +- dlls/mshtml/nsio.c | 2 +- dlls/mshtml/protocol.c | 2 +- dlls/mshtml/rsrc.rc | 1 + dlls/msi/appsearch.c | 239 ++- dlls/msi/automation.c | 2 +- dlls/msi/database.c | 2 +- dlls/msi/dialog.c | 2 +- dlls/msi/helpers.c | 4 +- dlls/msi/msi.c | 10 +- dlls/msi/msiquery.c | 8 +- dlls/msi/source.c | 8 +- dlls/msi/suminfo.c | 3 +- dlls/msi/tests/db.c | 7 +- dlls/msi/tests/package.c | 594 ++++++- dlls/msi/where.c | 2 +- dlls/msrle32/msrle32.c | 2 +- dlls/msrle32/msrle_private.h | 2 +- dlls/msvcrt/console.c | 2 +- dlls/msvcrt/except.c | 3 +- dlls/msvcrt/file.c | 8 +- dlls/msvcrt/msvcrt.spec | 1 + dlls/msvcrt/undname.c | 2 +- dlls/msvcrt/wcs.c | 18 +- dlls/msvfw32/msvfw32_Pt.rc | 51 + dlls/msvfw32/msvideo_main.c | 2 +- dlls/msvfw32/rsrc.rc | 1 + dlls/mswsock/mswsock.c | 2 +- dlls/msxml3/queryresult.c | 2 +- dlls/netapi32/access.c | 4 +- dlls/netapi32/tests/access.c | 11 +- dlls/ntdll/actctx.c | 12 +- dlls/ntdll/cdrom.c | 2 +- dlls/ntdll/debugbuffer.c | 2 +- dlls/ntdll/directory.c | 4 +- dlls/ntdll/heap.c | 6 +- dlls/ntdll/nt.c | 120 +- dlls/ntdll/reg.c | 12 +- dlls/ntdll/rtlstr.c | 11 +- dlls/ntdll/sec.c | 20 +- dlls/ntdll/server.c | 4 +- dlls/ntdll/signal_i386.c | 2 +- dlls/ntdll/tests/info.c | 29 +- dlls/ntdll/thread.c | 4 +- dlls/ntoskrnl.exe/ntoskrnl.c | 24 +- dlls/ole32/compobj_private.h | 2 +- dlls/ole32/dcom.idl | 2 +- dlls/ole32/defaulthandler.c | 146 +- dlls/ole32/ole2nls.c | 2 +- dlls/ole32/ole2stubs.c | 9 + dlls/ole32/ole32.spec | 2 +- dlls/ole32/oleproxy.c | 2 +- dlls/ole32/rpc.c | 2 +- dlls/oleacc/tests/main.c | 19 +- dlls/opengl32/opengl_ext.c | 32 +- dlls/psapi/tests/psapi_main.c | 2 +- dlls/quartz/acmwrapper.c | 2 +- dlls/quartz/dsoundrender.c | 34 + dlls/riched20/editor.c | 282 ++-- dlls/riched20/editstr.h | 1 - dlls/riched20/paint.c | 27 +- dlls/riched20/string.c | 24 +- dlls/riched20/tests/editor.c | 315 +++- dlls/riched20/wrap.c | 39 +- dlls/riched32/tests/editor.c | 4 - dlls/rpcrt4/cproxy.c | 2 +- dlls/rpcrt4/cpsf.c | 2 +- dlls/rpcrt4/cpsf.h | 2 +- dlls/rpcrt4/cstub.c | 2 +- dlls/rpcrt4/ndr_clientserver.c | 2 +- dlls/rpcrt4/ndr_es.c | 13 +- dlls/rpcrt4/ndr_misc.h | 2 +- dlls/rpcrt4/ndr_ole.c | 2 +- dlls/rpcrt4/ndr_stubless.c | 2 +- dlls/rpcrt4/rpc_binding.c | 2 +- dlls/rpcrt4/rpc_binding.h | 2 +- dlls/rpcrt4/rpc_defs.h | 2 +- dlls/rpcrt4/rpc_epmap.c | 2 +- dlls/rpcrt4/rpc_message.c | 2 +- dlls/rpcrt4/rpc_server.c | 2 +- dlls/rpcrt4/rpc_server.h | 2 +- dlls/rpcrt4/rpc_transport.c | 2 +- dlls/rpcrt4/rpcrt4.spec | 2 +- dlls/sane.ds/rsrc.rc | 1 + dlls/{winedos/dosvm.h => sane.ds/sane_Pt.rc} | 33 +- dlls/secur32/schannel.c | 465 +++++- dlls/setupapi/Makefile.in | 2 +- dlls/setupapi/misc.c | 32 +- dlls/setupapi/tests/misc.c | 5 +- dlls/shdocvw/shdocvw.spec | 2 +- dlls/shdocvw/shdocvw_main.c | 27 + dlls/shdocvw/tests/Makefile.in | 1 + dlls/shdocvw/tests/shdocvw.c | 168 ++ dlls/shell32/autocomplete.c | 2 +- dlls/shell32/shellord.c | 2 +- dlls/shell32/shfldr_unixfs.c | 4 +- dlls/shell32/tests/shelllink.c | 2 +- dlls/shell32/tests/shlfileop.c | 8 +- dlls/shell32/trash.c | 4 +- dlls/shlwapi/assoc.c | 7 +- dlls/shlwapi/ordinal.c | 2 +- dlls/shlwapi/tests/assoc.c | 92 +- dlls/urlmon/urlmon.spec | 4 +- dlls/urlmon/urlmon_main.c | 18 + dlls/user32/comm16.c | 4 +- dlls/user32/menu.c | 2 +- dlls/user32/tests/msg.c | 23 +- dlls/user32/tests/text.c | 6 +- dlls/user32/tests/win.c | 2 +- dlls/userenv/tests/userenv.c | 126 +- dlls/usp10/tests/usp10.c | 2 +- dlls/uxtheme/tests/system.c | 2 +- dlls/version/tests/info.c | 4 +- dlls/winecrt0/drv_entry.c | 2 +- dlls/wined3d/arb_program_shader.c | 13 +- dlls/wined3d/ati_fragment_shader.c | 2 +- dlls/wined3d/baseshader.c | 2 +- dlls/wined3d/basetexture.c | 2 +- dlls/wined3d/clipper.c | 2 +- dlls/wined3d/context.c | 27 +- dlls/wined3d/cubetexture.c | 2 +- dlls/wined3d/device.c | 11 +- dlls/wined3d/directx.c | 3 +- dlls/wined3d/drawprim.c | 2 +- dlls/wined3d/glsl_shader.c | 15 +- dlls/wined3d/indexbuffer.c | 2 +- dlls/wined3d/nvidia_texture_shader.c | 2 +- dlls/wined3d/palette.c | 2 +- dlls/wined3d/pixelshader.c | 2 +- dlls/wined3d/query.c | 2 +- dlls/wined3d/state.c | 6 +- dlls/wined3d/stateblock.c | 2 +- dlls/wined3d/surface.c | 23 +- dlls/wined3d/surface_base.c | 2 +- dlls/wined3d/surface_gdi.c | 2 +- dlls/wined3d/swapchain.c | 2 +- dlls/wined3d/swapchain_base.c | 2 +- dlls/wined3d/swapchain_gdi.c | 2 +- dlls/wined3d/texture.c | 2 +- dlls/wined3d/utils.c | 3 +- dlls/wined3d/vertexbuffer.c | 2 +- dlls/wined3d/vertexshader.c | 2 +- dlls/wined3d/volume.c | 3 + dlls/wined3d/volumetexture.c | 3 +- dlls/wined3d/wined3d_main.c | 4 +- dlls/winedos/devices.c | 2 +- dlls/winedos/dosexe.h | 2 +- dlls/winedos/dosvm.c | 2 +- dlls/winedos/dosvm.h | 2 +- dlls/winedos/int09.c | 2 +- dlls/winedos/int10.c | 180 ++- dlls/winedos/int16.c | 2 +- dlls/winedos/int33.c | 2 +- dlls/winedos/ioports.c | 53 +- dlls/winedos/module.c | 2 +- dlls/winedos/vga.c | 381 ++++- dlls/winedos/vga.h | 2 +- dlls/winedos/xms.c | 2 +- dlls/wineps.drv/mkagl.c | 6 +- dlls/wineps.drv/truetype.c | 4 +- dlls/wineps.drv/type1afm.c | 4 +- dlls/winex11.drv/bitblt.c | 3 +- dlls/winex11.drv/keyboard.c | 4 +- dlls/winex11.drv/mwm.h | 2 +- dlls/winex11.drv/x11drv.h | 1 + dlls/winex11.drv/x11drv_main.c | 1 + dlls/winex11.drv/xim.c | 23 + dlls/wininet/http.c | 37 +- dlls/wininet/internet.c | 10 +- dlls/wininet/tests/http.c | 2 +- dlls/winmm/mmio.c | 7 +- dlls/winscard/winscard.c | 11 + dlls/winscard/winscard.spec | 2 +- dlls/winspool.drv/tests/info.c | 2 +- dlls/winspool.drv/winspool.drv.spec | 2 +- dlls/wintrust/asn.c | 392 +++++ dlls/wintrust/softpub.c | 184 ++- dlls/wintrust/tests/asn.c | 261 +++ dlls/wintrust/wintrust.spec | 8 +- dlls/wldap32/add.c | 10 +- dlls/wldap32/bind.c | 16 +- dlls/wldap32/compare.c | 12 +- dlls/wldap32/control.c | 6 +- dlls/wldap32/delete.c | 8 +- dlls/wldap32/extended.c | 8 +- dlls/wldap32/init.c | 2 +- dlls/wldap32/misc.c | 2 +- dlls/wldap32/modify.c | 10 +- dlls/wldap32/modrdn.c | 4 +- dlls/wldap32/option.c | 10 +- dlls/wldap32/parse.c | 12 +- dlls/wldap32/rename.c | 8 +- dlls/wldap32/search.c | 17 +- dlls/wldap32/tests/parse.c | 12 +- include/Makefile.in | 2 + include/commctrl.rh | 196 +++ include/d3d10.idl | 2 +- include/d3d10misc.h | 46 + include/ddk/mountmgr.h | 17 + include/ddk/ntddcdvd.h | 4 +- include/dxgi.idl | 279 +++- include/dxgitype.idl | 55 + include/gdiplusflat.h | 2 + include/mediaobj.idl | 2 +- include/mlang.idl | 2 +- include/shldisp.idl | 2 +- include/tom.idl | 34 +- include/urlmon.idl | 4 + include/wincrypt.h | 8 +- include/wine/server_protocol.h | 18 +- include/wine/wined3d_gl.h | 14 + include/wine/wined3d_interface.h | 4 +- include/wine/wined3d_types.h | 2 +- include/winresrc.h | 2 +- include/winscard.h | 2 +- libs/wpp/ppl.l | 37 +- loader/kthread.c | 2 +- programs/msiexec/msiexec.c | 8 +- programs/net/Pt.rc | 44 + programs/net/rsrc.rc | 1 + programs/oleview/Pt.rc | 213 +++ programs/oleview/rsrc.rc | 1 + programs/reg/{rsrc.rc => Pt.rc} | 28 +- programs/reg/rsrc.rc | 1 + programs/rpcss/rpcss_main.c | 2 +- programs/taskmgr/Pt.rc | 486 ++++++ programs/taskmgr/taskmgr.rc | 1 + programs/wineboot/wineboot.rc | 1 + .../wineboot/wineboot_Pt.rc | 40 +- programs/winecfg/drive.c | 321 ++-- programs/winecfg/drivedetect.c | 17 +- programs/winecfg/driveui.c | 11 +- programs/winecfg/winecfg.h | 7 +- programs/wineconsole/user.c | 2 +- programs/winedbg/be_alpha.c | 2 +- programs/winedbg/be_x86_64.c | 2 +- programs/winedbg/dbg.y | 2 + programs/winedbg/debugger.h | 11 +- programs/winedbg/gdbproxy.c | 31 +- programs/winedbg/info.c | 3 +- programs/winedbg/memory.c | 22 +- programs/winedbg/stack.c | 5 +- programs/winedbg/tgt_active.c | 48 +- programs/winedbg/tgt_minidump.c | 28 +- programs/winedbg/tgt_module.c | 16 +- programs/winedbg/winedbg.c | 84 +- programs/winefile/winefile.c | 2 +- programs/wordpad/Ko.rc | 13 +- programs/wordpad/Pt.rc | 245 +++ programs/wordpad/rsrc.rc | 1 + programs/wordpad/wordpad.c | 37 +- dlls/winedos/dosvm.h => programs/write/Pt.rc | 21 +- programs/write/rsrc.rc | 1 + programs/xcopy/Pt.rc | 79 + programs/xcopy/rsrc.rc | 1 + server/context_alpha.c | 2 +- server/directory.c | 12 + server/protocol.def | 7 + server/request.h | 2 + server/sock.c | 2 +- server/trace.c | 8 + tools/widl/parser.l | 19 +- tools/wineinstall | 10 +- tools/wineprefixcreate.in | 2 +- tools/wmc/lang.c | 4 +- tools/wrc/parser.l | 23 +- tools/wrc/translation.c | 2 +- 431 files changed, 11202 insertions(+), 3615 deletions(-) rewrite ANNOUNCE (97%) create mode 100644 dlls/appwiz.cpl/Ko.rc copy dlls/{d3d10/d3d10_main.c => comdlg32/tests/rsrc.rc} (59%) copy dlls/d3d10/{d3d10_main.c => d3d10_private.h} (57%) create mode 100644 dlls/d3d10/device.c create mode 100644 dlls/d3d10/utils.c copy dlls/{d3d10 => dxgi}/Makefile.in (63%) create mode 100644 dlls/dxgi/device.c create mode 100644 dlls/dxgi/dxgi.spec create mode 100644 dlls/dxgi/dxgi_main.c copy dlls/{d3d10/d3d10_main.c => dxgi/dxgi_private.h} (57%) create mode 100644 dlls/dxgi/factory.c create mode 100644 dlls/dxgi/utils.c copy dlls/{mountmgr.sys/mountmgr.h => dxgi/version.rc} (68%) copy dlls/{winedos/dosvm.h => iccvid/iccvid_Pt.rc} (74%) rewrite dlls/mountmgr.sys/mountmgr.c (60%) create mode 100644 dlls/mshtml/Pt.rc create mode 100644 dlls/msvfw32/msvfw32_Pt.rc copy dlls/{winedos/dosvm.h => sane.ds/sane_Pt.rc} (61%) create mode 100644 dlls/shdocvw/tests/shdocvw.c create mode 100644 include/commctrl.rh create mode 100644 include/d3d10misc.h create mode 100644 programs/net/Pt.rc create mode 100644 programs/oleview/Pt.rc copy programs/reg/{rsrc.rc => Pt.rc} (59%) create mode 100644 programs/taskmgr/Pt.rc copy dlls/d3d10/d3d10_main.c => programs/wineboot/wineboot_Pt.rc (51%) create mode 100644 programs/wordpad/Pt.rc copy dlls/winedos/dosvm.h => programs/write/Pt.rc (75%) create mode 100644 programs/xcopy/Pt.rc diff --git a/ANNOUNCE b/ANNOUNCE dissimilarity index 97% index 06859bf5f9d..88767ae25cc 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,912 +1,788 @@ -The Wine development release 1.1.6 is now available. - -What's new in this release (see below for details): - - Beginnings of schannel implementation using GnuTLS. - - Many fixes from various code analysis tools. - - Support for X11 desktop work area. - - Fixes for Richedit tables. - - More complete JavaScript support. - - Various bug fixes. - -The source is available from the following locations: - - http://ibiblio.org/pub/linux/system/emulators/wine/wine-1.1.6.tar.bz2 - http://prdownloads.sourceforge.net/wine/wine-1.1.6.tar.bz2 - -Binary packages for various distributions will be available from: - - http://www.winehq.org/site/download - -You will find documentation on http://www.winehq.org/site/documentation - -You can also get the current source directly from the git -repository. Check http://www.winehq.org/site/git for details. - -Wine is available thanks to the work of many people. See the file -AUTHORS in the distribution for the complete list. - ----------------------------------------------------------------- - -Bugs fixed in 1.1.6: - - 2122 wrong window size on startup, busted graphics and invisible text in listboxes. - 3875 ACM format codecs shutdown sound in WINE - 3915 Win32 GTK apps are all black when run in WINE (dogfood) - 5008 Wine 0.9.11 does not run applications on FreeBSD 6.0 - 5145 Microsoft Visual C++ Runtime Library (Etherlords 2 Demo) - 6253 EQ II Patcher Fails - 6382 CaptureWizard fails to install - 7051 EVE Online isn't displaying some elements of the ui - 7186 fonts in applications using cairo ( not only through GTK ) - 7200 Tab control flickers too much - 7257 Documents Manager doesn't find iexplore.exe - 7295 wine.inf's timezone data is inconsistent with Windows - 7368 eISLP -font too small on main list - 7441 GlobalMemoryStatus 2GB limiting results in failure of virtual > physical memory checks - 7452 JScript not functioning - 7488 Screen.ActiveForm run-time error 91 - 7581 Shell Folder AutoComplete List in browseui.dll not implemented - 7645 Wine tests fail under FreeBSD and other problems - 7829 Photoshop CS3 install / Adobe Setup fails at runtime - 7996 serious sam dedicated servers don't work - 9298 Empire at war, best of PC install failes - 9319 Sony Vegas v4.0: Menus dissapear after single view - 9519 Adobe Reader 8.1 (and Acrobat Pro 8): Unable to accept License (window.external object) - 9877 AT1 crashes when system.ini or wini.ini have too many lines - 9929 Internet Explorer 7 installer complains it cannot verify integrity of installation files, quits - 9963 GPSMapEdit: Unimplemented function gdiplus.dll.GdipGetImageDecodersSize - 10544 treeview scrolling on collapsing is broken on windows - 10933 PAF 5 unicode font displays with inconsistent size - 11294 Adobe Imageready 3 and 6 (part of Photoshop 6 and 7) and InDesign 2 tool option window in wrong place - 11735 ClocX: UpdateLayeredWindow needs to be implemented - 11838 Y axis inverted in tablet with OpenCanvas 1.1? - 11938 Valve Hammer Editor unusable: window mostly black - 11943 Wacom Tablet Y-axe gets inverted on click in ArtRage 2.5 - 11948 TF2 and Portal do not render correctly with nvidia-drivers-169.x and above - 12059 Help window cannot be closed - 12133 Desktop directory is invalid - 12144 Endnote demo crashes on launch in gdiplus - 12255 Static sound effects with Syberia 2 - 12309 energyXT gui rendering brings the system down to its knees. - 12421 Digsby beta crashes during login (needs lots of gdiplus functions) - 12447 MSN Messenger 7.0 crash while loading the Contact list - 12861 Gtk+ demo (gtk-demo.exe) doesn't work - 13214 No icons on control buttons with Audacity 1.2.6 - 13520 Facewound crosshair does not render - 13634 dogfood: geany not usable at all - 13728 Crash when running Oblivion installation program - 13745 Installing DirectX breaks "gold" VB6 heavy application - 14188 utorrent - it disconnects fast leaching peers with Error 10022 - 14281 Richedit's EM_SETTEXTEX handler doesn't notice \urtf as valid RTF sequence - 14353 problem with displaying digits in the bookkeeping proram "Mala Ksiegowosc Rzeczpospolitej" - 14422 AutoCAD 2005, Adobe Photoshop CS3 crash on unimplemented function gdiplus.dll.GdipGetFamily - 14642 mIRC 6.33 hang up then IRC channel topic has ISO-8859-2 char - 14674 Wine WordPad fails to correctly open CP1251 RTF documents with russian letter "ya" - 14732 WINE Wordpad crashes horizontally resizing certain RTF documents - 14744 Burning Sea: draw regression under alpha UI elements - 14773 Adobe Photoshop CS3 crashes at startup on unimplemented function gdiplus.dll.GdipGetFontHeight, GdipGetFontStyle - 14800 directx-dinput problem in PES2008 - 14913 Dawn of war, transperent characters become invisable - 14986 Rome Total War v1.5 Gold crashs if buttons that highlight on mouse hover - 15009 Black & White 2 crash on start up since 0.9.44 - 15066 FedExShipManager installer crashes in msi - 15077 Myth II 1.6 fails with Wine 1.1.3 (regression from 1.1.2) - 15096 This user account does not have sufficient rights to install - 15138 Spore crashes after the first stage of life - 15210 MIDI-OX installer crashes - 15215 Microsoft Office 2007: Attempting to update IME dictionary => crash (dogfood) - 15279 Saxo Trader installer crashes into unimplemented msi functoims - 15281 PROFILE_Load and friends doesn't handle ini files with CR-only line endings - 15298 Highway Pursuit crashes with a X Error - 15313 Leela: graphics do not show (win32/GDI?) - 15332 Compiling on PC-BSD with -Werror fails in dlls/mscms/handle.c - 15334 richedit: cursor doesn't change when over a scrollbar - 15335 Regedit: char format, different type arg errors - 15344 reaper sequencer crashes - 15347 Lexware: Installation fails with "Systemprüfung konnte nicht erfolgreich abgeschlossen werden" - 15366 Starcraft cant find CD - 15378 mshtml/tests: dom.c fails in gcc 3.3/CFLAGS="-Werror" - 15387 VB6 Format error in wine 1.1.4 - 15391 "--without-opengl" configure option doesn't compile anymore - 15413 dualcad crashes into msvcrt - 15416 Garena : division by zero in comctl32 - 15488 IFC Trade Terminal crash on unimplemented function dwmapi.dll.DwmExtendFrameIntoClientArea - 15507 winex11.drv regression causes ClocX 1.5 beta 2 installer window to be hidden - ----------------------------------------------------------------- - -Changes since 1.1.5: - -Alexander Morozov (5): - ntoskrnl.exe: Initialize StackSize field of DEVICE_OBJECT structure. - include: Add some definitions. - include: Add usb.h, usb100.h, usb200.h and usbdlib.h. - ntoskrnl.exe: Implement some functions. - ntoskrnl.exe: Fix trace typo. - -Alexander Nicolaysen Sørnes (3): - regedit: Fix char escaping for registry export. - regedit: Fix some fprintf arguments. - netapi32: Improve NetUserGetLocalGroups stub. - -Alexandre Julliard (22): - configure: Always use -fno-builtin if supported, since it's needed for scanf too. - ntdll/tests: Fix a few test failures on NT4. - user32/tests: Fix some more message test failures. - comctl32/tests: Fix a couple of message test failures. - winex11: Fix SetLayeredWindowAttributes when called on a thread that doesn't have any window. - regedit: Fix file exports in ASCII format. - configure: Make sure opengl is not built with --without-opengl is specified. - user32/tests: Fix more message test failures on NT4 and XP. - user32/tests: Fix the winstation tests on NT4. - user32/tests: Fix some input test failures. - user32/tests: Fix the listbox tests on Win9x and NT4. - gdiplus: Fix a string buffer overflow. - advapi32: Always pass a valid argv pointer to a service even if there are no arguments. - oleaut32: Fix a couple of interface registrations to match Windows. - inetcomm: Add missing license header. - ntdll: Preserve the 2K block size returned for CDROMs. - msvcrt: Pass the command interpreter as exe name from _wpopen. - server: Follow symlink even with OBJ_OPENLINK unless it is the last element of the path. - ws2_32: Allow arbitrary-sized iovecs again in WSASendTo and WSARecvFrom. - msi/tests: Clean up the binary.dat file. - widl: Add support for attributes on enum, struct and union definitions. - stdole2: Add some missing attributes and fix some typos. - -Alistair Leslie-Hughes (9): - mshtml: Implement IDispatch for IHTMLDOMNode2. - mshtml: Implement IDispatch for IHTMLDOMNode. - mshtml: Implement IDispatch for IHTMLElementCollection. - mshtml: Implement IDispatch for IHTMLDOMChildrenCollection. - mshtml: Implement IHTMLBodyElement put_background. - msxml3: Correct cast. - gdiplus: Stub GdipRecordMetafileFileName and GdipRecordMetafileFileNameI. - msxml3: Add IXMLHTTPRequest support. - mshtml: Implement IHTMLStyle put/get borderWidth. - -Andrew Nguyen (1): - wine.inf: Add entry for fake wintab32.dll. - -Andrew Talbot (12): - comdlg32: Sign-compare warnings fix. - comctl32: Sign-compare warnings fix. - credui: Sign-compare warnings fix. - crypt32: Sign-compare warnings fix. - crypt32: Sign-compare warnings fix. - dbghelp: Sign-compare warnings fix. - dbghelp: Sign-compare warnings fix. - ddraw: Sign-compare warnings fix. - dinput: Sign-compare warnings fix. - ddraw: Sign-compare warning fix. - dsound: Sign-compare warnings fix. - gdi32: Sign-compare warnings fix. - -Andrey Turkin (7): - ntdll: Add stubbed implementations for NtQueryEaFile and NtSetEaFile. - regedit: Ignore spaces in regedit files. - dwmapi: Add a few stub implementations. - kernel32: Add ExitProcess wrapper to please Shrinker. - wordpad: Fix some unicode bugs. - wordpad: Convert some ANSI calls to Unicode. - wordpad: Fix some compile-time warnings. - -Aric Stewart (19): - imm32: ImmConfigureIME should return 0 when the type is IME_CONFIG_REGISTERWORD and the data is NULL. - mlang/tests: IMultiLanguage2_GetRfc1766FromLcid can return S_FALSE on partial name matching so deal with this properly. - mlang/tests: Some versions of native mlang return E_FAIL when source string is NULL and a source length is supplied. - mlang/tests: GetLastError may not be set if Japanese conversions fail with S_FAIL so do not require that to skip the Japanese tests. - mlang/tests: Skip testing a codepage returning the buggy, legacy unicodeFEFF charset (only appears to exist on windows 2008). - mlang/tests: windows 2008's version of mlang E_FAILs when you pass in a rgelt in IEnumCodePage::Next. - mlang: Correct use of uninitialized rfcstr value (Coverity 796). - user32/tests: GetMenuItemCount returns an INT which can be -1 (Coverity 543). - user32/tests: GetMenuItemCount returns INT so check for -1 (Coverity 542). - ole32: Handle GetMenuItemCount returning -1 by changing UINT to INT (Coverity 228). - version: Check for out of memory in VerInstallFileA/W conversion (Coverity 635). - x11drv: ime: In the update functions if we get a null string with a len report this and fix len to be 0 (Coverity 656 and 655). - winealsa: Don't dereference a potentially NULL value in the WARN statement (Coverity 93). - quartz: Check hr so we are not incrementing a NULL (Coverity 106). - wineoss: Don't dereference a potentially NULL value in the WARN statement (Coverity 93). - d3d8: Initialize IDirect3DDevice8 *device to NULL in case of immediate cleanup (Coverity 795). - oleaut32: In variants check bOverflow to make sure not to accidently overun static buffers in an overflow case (Coverity 313). - browseui: Update AutoComplete Multi to have a stub implemntation of CLSID_ACListISF and IID_IACList2. - mlang/tests: Make sure a given codepage has 'abc' before depending on that conversion to detect if a codepage is convertable. - -Austin English (3): - mscms: Undefine HIWORD to avoid a conflict. - mshtml/tests: Fix gcc warnings. - ntdll: Quiet a noisy fixme. - -Christian Costa (8): - d3dxof: Rewrite check_TOKEN and parse_TOKEN_* to work properly and be more logical. - d3dxof: Implement IDirectXFileDataImpl_GetNextObject. - d3dxof: Do not print an error for interfaces that can be queried to retrieve the type of the object. - d3dxof: Implement IDirectXFileDataReference. - d3dxof: Allow omission of comma which separates array elements. - d3dxof: Enumerate only 2 levels of objects obtained from a reference. - d3dxof: Store number of subojects for all top level objects. - d3dxof: Enable referencing of named subobjects too. - -Damjan Jovanovic (1): - oleaut32: Fix double negative sign regression in VarFormat. - -Detlef Riekenberg (6): - jscript/tests: Fix a typo in ok(). - oleaut32: Remove redundant NULL check before SysFreeString. - msxml3: Remove redundant NULL check before SysFreeString. - msi: Remove redundant NULL check before SysFreeString. - shdocvw: Remove redundant NULL check before SysFreeString. - shdocvw: Set the default homepage. - -Dimitrie O. Paun (1): - user32: Fix a noisy FIXME. - -Dmitry Timoshkov (13): - gdi32: Add a test for PS_NULL pen being equal to NULL_PEN stock object. - gdi32: Make the PS_NULL test pass under Wine. - wine.inf: Correct the Pacific SA Standard Time entry. - gdi32: Do not skip the font metrics update after the DC transform change. - winex11.drv: Add support for _NET_WORKAREA. - user32: Print the expected and received rectangles. - gdi32: Make test_font_metrics require the font being selected into the DC. - gdi32: Add a test for a font being selected into 2 DCs with different transformations. - gdi32: Allow a rounding error in the text justification test. - winex11.drv: Use the monitor work area to decide whether a window should be made managed. - gdi32: Remove the code which bypasses the DC transformation checks. - gdi32: Revert incorrect fix introduced in a5d288f08c08dc19d217093fdf8622605c92a4e0. - winmm: The buffer provided by an application is valid only in the mmioOpen(FOURCC_MEM) case. - -Dylan Smith (21): - richedit: Removed space in front of function signature. - richedit: Fixed test failure that happend on older builds of riched20.dll. - richedit: Fixed test failing on windows version with larger font sizes. - richedit: Make sure border properties are saved for undo/redo. - richedit: Prevent font or colour buffer overflow on stream out. - richedit: Prevent assertion failure when streaming out nested tables. - richedit: Added code to stream out table border properties. - richedit: Fixed a bug preventing streaming out nested table properties. - richedit: Made sure table row gap/offset is copied on append row. - richedit: Print hex string for strcmp test failing on Windows 95, 98 & NT4. - richedit: Swapped the expected and destination buffers in a test. - richedit: Avoided testing for undocumented behaviour causing test to fail. - richedit: Removed invalid assertion. - richedit: Unsigned cast char to avoid EOF equality. - richedit: Use RTF reader for text starting with {\urtf. - richedit: ES_AUTOHSCROLL window style disables word wrapping. - user32: Converted rcScrollBar to screen coordinates. - richedit: Show arrow cursor over scrollbar. - runtest: More helpful error when top of wine directory isn't found. - runtest: Modified the default program so that it might find the test program. - runtest: Let the test program handle the lack of a test name. - -Eric Pouech (21): - dbghelp: Added stubs for add symbol functions. - dbghelp: Added the latest stubs. - dbghelp: Added stub for SymSetScopeFromAddr. - dbghelp,winedump: Added support for symbol 0x113a. - dbghelp,winedump: Added support for symbol 0x1012. - winedump: Added support for dumping long long constants. - winedump: Dump a bit more of information from procedures. - winedump: Add preliminary dumping of 0x1136 and 0x1137 symbols. - dbghelp: Silence symbol 0x1139. - dbghelp,winedump: Added support for 0x113d symbol. - dbghelp,winedump: Added support for symbol 0x113c. - dbghelp,winedump: Added support for symbol symbol. - winedump: Improved a bit the MS Tool V3 description. - dbghelp: Now fully reading the leafs as variant for constants. - dbghelp: Added support for real80 (aka long double) in inner codeview types. - winedump: Now dumping codeview source line information. - winedump: First stab at dumping the "new" line information out of pdb files. - dbghelp: Rewrote the linetab access so that we don't need to allocate intermediate information. - dbghelp: Add support for the newest line number information in pdb files. - msvcrt: Implemented wcsncpy_s. - msvcrt: Implemented splitpath_s. - -Erik Inge Bolsø (1): - kernel32: Fix PROFILE_Load to handle mac line endings. - -Francois Gouget (10): - kernel32/tests: Fix compilation on systems that don't support nameless unions. - jscript: Remove spaces before '\n' in Wine traces. - jscript: Add a trailing '\n' to a Wine trace. - secur32: Fix compilation with GNU TLS 1.0.16. - make_opengl: Avoid the deprecated '$#' construct. - comctl32/tests: FreeMRUList(NULL) crashes on Win98 OSR0. - comctl32/tests: Don't crash if adding the tooltip failed. - mshtml/tests: Add a trailing '\n' to an ok() call. - cryptdlg: Fix compilation on systems that don't support nameless unions. - Assorted spelling fixes. - -Gerald Pfeifer (1): - cryptnet: Include stdarg.h. - -Hans Leidekker (13): - rpcrt4: Add stub implementations for RpcMgmtInqStats and RpcMgmtStatsVectorFree. - winhttp: Implement WinHttpCreateUrl. - winhttp: Add tests for WinHttpCreateUrl. - wininet: Support setting username and password through options. - shlwapi: Fix PathIsValidChar tests that fail on some versions of Windows. - winhttp: Skip notifications that may arrive out of order. - include: Define IRangeList, IIMAPCallback and IIMAPTransport. - inetcomm: Add a stub implementation of IIMAPTransport. - wldap32: Return an error when ldap_parse_sort_control or ldap_parse_vlv_control is called with NULL control array. - wldap32: Add tests for ldap_parse_sort_control and make them pass. - wininet: Option INTERNET_OPTION_CALLBACK is not settable. - wininet: Avoid a crash on certain buffer size queries in HTTP_HttpQueryInfoW. - usp10: Store glyph mappings and widths in the script cache. - -Henri Verbeet (44): - wined3d: Make sure update_minfilter and update_magfilter are initialized. - wined3d: Destroy FBO entries in the context. - wined3d: Fix a memory leak. - wined3d: Don't try to draw with unsupported attribute data types. - wined3d: Get rid of the wantsDepthStencilBuffer in IWineD3DSwapChainImpl. - wined3d: Add/update the D3DPRESENTFLAG constants. - wined3d: Skip copying the depth stencil if it's discarded. - wined3d: Merge pshader_hw_map2gl() and vshader_hw_map2gl(). - wined3d: Use shader_glsl_log() in some more places. - secur32: Skip schannel tests if schannel is unavailable. - secur32: Require gnutls for schannel. - secur32: Basic implementation of schannel AcquireCredentialsHandle/FreeCredentialsHandle. - secur32: Allocate schannel client credentials. - secur32: Allow gnutls debug output to be shown. - wined3d: Move part of the shader instruction table to the backend. - wined3d: atifs_shader_backend doesn't exist anymore. - wined3d: Make some more ARB program functions private to the backend. - wined3d: Make some more GLSL functions private to the backend. - wined3d: Remove the "Wine 1.0 safety path". - wined3d: Split SetGlTextureDesc() up. - wined3d: Set the texture name at surface creation. - wined3d: Properly handle the offset for compressed surfaces in IWineD3DDeviceImpl_UpdateSurface(). - wined3d: If a stage isn't mapped to a texture unit, we can't set default coordinates either. - wined3d: Handle texture coordinates the same way we handle other vertex attributes. - wined3d: Enable lights on the correct swapchain. - secur32: Use ~0UL instead of -1 for invalid schannel handles. - secur32: Improve error handling for gnutls_certificate_allocate_credentials(). - secur32: Forward schannel InitializeSecurityContextA to InitializeSecurityContextW. - d3d9: Use more reasonable texture dimensions. - gdi32: Call AbortProc from StartDoc instead of EndPage. - comdlg32: Add a test for AbortProc handling. - wined3d: Print an error when drawStridedSlow() is called with 0 idxSize and non-NULL idxData (CID 509). - wined3d: Remove a redundant initialization of cfgs in WineD3D_ChoosePixelFormat. - wined3d: Cleanup CreateAdditionalSwapChain error handling a bit (LLVM/Clang). - wined3d: Assign the correct "levels" variable (LLVM/Clang). - wined3d: Remove a redundant initialization of cfgs in CheckDepthStencilCapability (LLVM/Clang). - wined3d: Get rid of some redundant assignments (LLVM/Clang). - wined3d: Set the correct pow2Matrix for cube textures when NPOT textures are supported. - wined3d: Don't do GL calls without a context. - wined3d: Correct some swizzles and write masks in arb_program_shader. - wined3d: Make sure some variables are always initialized. - wined3d: Declare diffuseColor and specularColor inside their respective blocks (LLVM/Clang). - wined3d: Pass the correct RECT to LoadLocation() in LockRect(). - ddraw: Remove a few more redundant inits (LLVM/Clang). - -Huw Davies (9): - inetcomm: Start of IMimeMessage_SetOption. - inetcomm: Start of IMimeBody_SetOption. - inetcomm: Charset name comparison should be case insensitive. - inetcomm: Content-Disposition can have parameters. - inetcomm: Implement IMimeBody_IsType(IBT_EMPTY). - inetcomm: Add wrapper functions MimeOleFindCharset and MimeOleGetDefaultCharset. - include: Add a missing WINAPI. - rpcrt4: Actually set an unmarshalled object ptr to NULL when a NULL pointer id is received. - ole32: Remove an unneeded WINAPI and remove some useless comments. - -Jacek Caban (151): - mshtml: Fixed dynamic properties allocation. - jscript: Added string to number conversion implementation. - jscript: Added Array.push implementation. - jscript: Added Array.join implementation. - jscript: Added Array.toString implementation. - jscript: Added Number constructor implementation. - jscript: Added Number.toString implementation. - jscript: Added Number function implementation. - jscript: Added Array.sort implementation. - jscript: Fixed array literal length calculation. - jscript: Added Array.concat implementation. - jscript: Added Object default value implementation. - jscript: for..in is not error if in expression is not an object. - jscript: Added Array default value implementation. - jscript: Fixed typo in to_integer. - jscript: Added String.substring implementation. - jscript: Added String.toString implementation. - jscript: Added String.valueOf implementation. - jscript: Added String.slice implementation. - jscript: Added String.charCodeAt implementation. - jscript: Added parseInt implementation. - jscript: Remove no longer used jsdisp_set_prototype. - jscript: Added String constructor implementation. - jscript: Added String default value implementation. - jscript: Added String.concat implementation. - jscript: Added String function implementation. - jscript: Added Math.min implementation. - jscript: Added Math.round implementation. - jscript: Added Math.abs implementation. - jscript: Added Math.max implementation. - jscript: Added Math.pow implementation. - jscript: Added Math.ceil implementation. - jscript: Don't call IDispatch as constructor. - jscript: Added Function.toString implementation. - jscript: Added Function default value implementation. - jscript: Added RegExp contruction implementation. - jscript: Fixed a typo. - jscript: Added VT_R8 to string conversion implementation. - jscript: Added Number default value implementation. - jscript: Added object to number conversion implementation. - jscript: Split regexp_match function. - jscript: Added String.replace implementation. - jscript: Added String.match implementation for non-regexp arguments. - jscript: Added String.split implementation. - mshtml: Use ActiveScript for JavaScript in file protocol documents. - mshtml: Fixed tests timeout. - shdocvw: Fixed tests on IE5. - urlmon: Fixed file protocol tests on win9x. - mshtml: Fixed tests on IE7. - urlmon: Fixed potential null dereference. - mshtml.idl: Added IHTMLTableRow declaration. - mshtml.idl: Added DispHTMLTable declaration. - mshtml.idl: Added DispHTMLTableRow declaration. - mshtml: Added IHTMLTableRow stub implementation. - mshtml: Added IDispatchEx support to HTMLTableRow. - mshtml: Added IDispatchEx support to IHTMLTable. - mshtml: Don't use IHTMLControlElement in IDispatchEx implementations. - mshtml: Move IHTMLElementCollection to separated file. - mshtml: Use create_collection_from_nodelist in IHTMLElement::get_children implementation. - mshtml: Use create_all_collection in IHTMLElement::get_all implementation. - mshtml: Store nsIDOMHTMLTableElement in HTMLTable. - mshtml: Added IHTMLTable::get_rows implementation. - mshtml: Added IHTMLTableRow::get_cells implementation. - mshtml: Ignore IDispatchJS in QueryInterface. - jscript: Optimize GetDispID usage. - jscript: Allocate variables when entering execution context. - jscript: Don't clear uninitialized variable. - jscript: Added Date constructor object implementation. - jscript: Added IDispatchEx::GeleteMemberByDispID implementation. - jscript: Added delete expression for EXPRVAL_IDREF implementation. - mshtml.idl: Added IHTMLStyle2 interface declaration. - mshtml: Added IHTMStyle2 stub implementation. - mshtml: Added IHTMLStyle2 to IDispatchEx support. - mshtml: Added IHTMLElement2::get_currentStyle implementation. - jscript: Don't initialize variables without initialiser to undefined in variable_list_eval. - jscript: Fixed conflict in Block statement that caused problems with empty blocks. - jscript: Fixed backslash handling in regular expressions. - jscript: Added possibility to run test scripts from file. - mshtml.idl: Added DispHTMLCurrentStyle dispinterface declaration. - mshtml: Added IDispatchEx support to HTMLCurrentStyle. - mshtml: Moved HTMLStyle to separated header file. - mshtml: Use IDs instead of strings in HTMLStyle implementation. - mshtml: Store nsIDOMCSSStyleDeclaration in HTMLCurrentStyle. - mshtml: Added IHTMLCurrentStyle::get_display implementation. - mshtml: Release nsstyle when destroying HTMLStyle. - mshtml: Added IHTMLStyle::[get|put]_border implementation. - mshtml: Added IHTMLStyle::[get|put]_left implementation. - mshtml: Added IHTMLStyle::[get|put]_cursor implementation. - mshtml: Added IHTMLStyle::[put|get]_top implementation. - mshtml: Added IHTMLStyle::[get|put]_verticalAlign implementation. - mshtml: Added IHTMLStyle::[get|put]_height implementation. - mshtml: Added IHTMLStyle2::[get|put]_position. - mshtml: Added INVOKE_FUNC support to InvokeEx. - mshtml: Fixed handing non-element nodes in IHTMLElementCollection. - mshtml: Added DispHTMLIFrame dispinterface declaration. - msi: Added MsiInstallMissingComponentW stub implementation. - jscript: Added String.indexOf implementation. - jscript: Added a few missing allocation checks (Coverity). - jscript: Fixed compare function check in Array.sort (Coverity). - jscript: Fixed copy&paste bug in disp_propget. - jscript: Fixed list literal length calculation. - jscript: Added Array.pop implementation. - jscript: Fixed numeric escapes unescaping. - jscript: Added encodeURI implementation. - jscript: Added String.split implementation for non-regexp arguments. - mshtml: Added IHTMLElement::get_offsetWidth implementation. - mshtml: Added IHTMLElement3 stub implementation. - mshtml: Added HTMLIFrame stub implementation. - mshtml: Added IDispatchEx support for HTMLIFrame. - mshtml: Added IHTMLStyle::[get|put]_zIndex implementation. - mshtml: Added support for accessing style attributes by CSS syntax. - mshtml: Added IHTMLStyle::[get|put]_textAlign implementation. - mshtml: Added IHTMLStyle::[get|put]_filter implementation. - mshtml: Store nsIDOMHTMLDocument in HTMLDocument. - mshtml: Use stored nsdoc in handle_load. - mshtml: Use stored nsdoc in get_compatMode. - mshtml: Use stored nsdoc in createRange. - mshtml: Use stored nsdoc in get_doc_string. - mshtml: Use stored nsdoc in set_font_size. - mshtml: Use stored nsdoc in exec_hyperlink. - mshtml: Use stored nsdoc in createTextRange. - mshtml: Use stored nsdoc in HTMLCurrentStyle_Create. - mshtml: Use stored nsdoc in IHTMDocument2::get_all. - mshtml: Use stored nsdoc in IHTMLDocument2::get_body. - mshtml: Use stored nsdoc in IHTMLDocument2::put_title. - mshtml: Use stored nsdoc in IHTMLDocument2::get_title. - mshtml: Use stored nsdoc in IHTMLDocument2::write. - mshtml: Use stored nsdoc in IHTMLDocument2::createElement. - mshtml: Use stored nsdoc in IHTMLDocument2::get_styleSheets. - mshtml: Use stored nsdoc in createTextNode. - mshtml: Use stored nselem in get_documentElement. - mshtml: Use stored nsdoc in IHTMLDocument3::getElementById. - mshtml: Use stored nsdoc in prev_node. - mshtml: Use stored nsdoc in IHTMLTxtRange::put_text. - jscript: Added '%' expression implementation. - jscript: Added '%=' expression implementation. - mshtml: Use stored nsdoc in IHTMLTxtRange::expand. - mshtml: Use stored nsdoc in exec_indent. - mshtml: Use stored nsdoc in IHTMLElement::insertAdjacentHTML. - mshtml: Use stored nsdoc in IHTMLElement::insertAdjacentText. - mshtml: Use stored nsdoc in IHTMOptionElement::put_text. - mshtml: Use stored nsdoc in IHTMLOptionElementFactory::create. - mshtml: Get rid of setup_nswindow. - mshtml: Forward IHTMLelement3::[get|put]_disabled to child object if possible. - mshtml: Added IHTMLElement3::[get|put]_implementation. - mshtml: Use IHTMLElement3 in IDispatchEx. - mshtml: Added IHTMLSelectElement::[get|put]_disabled implementation. - mshtml: Don't use IDispatchEx for timer callbacks. - mshtml.idl: Added DispCEventObj declaration. - mshtml: Added IDispatchEx support to HTMLEventObj. - mshtml: Moved events declaration to separated file. - -James Hawkins (31): - comctl32: Fix several failing tests in win95. - comctl32: Fix a failing test in win95. - comctl32: Add a missing newline. - crypt32: Fix several test failures in win98. - ntdll: Fix a couple failing tests in NT4. - oleaut32: Fix a failing test in win95. - secur32: Fix a failing test in win95. - comctl32: Fix a failing test in win9x. - msi: Fix several test failures in win9x. - crypt32: Fix several failing tests in win9x. - comctl32: Fix a test on locales where default first day of week is not the max value. - msi: Add a stub implementation of MsiDatabaseMerge. - msi: Forward MsiDatabaseMergeA to MsiDatabaseMergeW. - msi: Fix a test that fails in win95. - comctl32: Only log system messages. - comctl32: Fix several test failures in win2k. - comctl32: Only log system messages. - msi: Implement the DROP TABLE sql command. - msi: Resolve file source paths dynamically, as the source directory can be changed. - msi: Remove a break that kept other columns from getting the table name. - msi: Remove the columns in reverse order. - msi: Add tests for dropping tables with multiple columns. - msi: Don't update the table columns if there are no more columns. - msi: Remove a part of a debugging statement that was accidentally left in. - msi: Add tests for converting record fields between strings and ints. - msi: Add initial implementation of MsiDatabaseMerge, with tests. - msi: Replace lengthy calls to MSI_DatabaseOpenView with MSI_OpenQuery. - msi: Add a stub implementation of MsiDetermineApplicablePatches. - msi: Add extra constraints on the formatting string of edit path text. - msi: Initialize the count variable to zero. - comctl32: Fix MCM_SETFIRSTDAYOFWEEK when the first day set is greater than max allowed. - -Jan-Peter Nilsson (1): - wininet: Fix HTTP_ProcessCookies only processing one cookie. - -Jeff Zaroyko (2): - hhctrl.ocx: Always set WS_OVERLAPPEDWINDOW. - msvcrt: Avoid a NULL pointer deref in ctime. - -John Klehm (3): - wintab32: Improve tracing of LOGCONTEXT struct. - wintab32: Handle negative output context range for y-axe. - wintab32: Send notification when z-order changes. - -Joris Huizer (1): - version/tests: Corrected memset placement. - -Juan Lang (40): - cryptui: Implement CryptUIDlgViewCertificateA on top of CryptUIDlgViewCertificateW. - cryptui: Build import lib. - wintrust: Search all additional stores when building a chain, not just the first one. - wintrust: Store the error status and confidence for each element in the chain. - wintrust: Always initialize CERT_CHAIN_PARA's RequestedUsage. - wintrust: Use helper function to allocate CRYPT_PROVIDER_DATA. - wintrust: Use helper function to add the trust steps to execute. - wintrust: Only do policy check if pointer is set. - wintrust: Check that the end certificate in the chain isn't disallowed to match native behavior. - wintrust: Support the CERT_CERTIFICATE_ACTION_VERIFY action. - cryptdlg: Implement CertViewPropertiesA on top of CertViewPropertiesW. - cryptdlg: Implement CertViewPropertiesW on top of CryptUIDlgViewCertificateW. - cryptdlg: Implement CertTrustInit. - cryptdlg: Implement CertTrustFinalPolicy. - include: Add definition of CRYPTUI_DISABLE_ISSUERSTATEMENT. - wintrust: Map cert trust error status to a windows error. - wintrust: Use helper function for setting confidence in SoftpubCheckCert. - wintrust: Only set the error on the root element of the chain. - secur32: Fix test failure with neither gnutls nor ntlm_auth available. - inetmib1: Skip tests if a portion of inetmib1 isn't implemented. - wintrust: Add stub for WTHelperGetKnownUsages. - wintrust: Add tests for WTHelperGetKnownUsages. - wintrust: Implement WTHelperGetKnownUsages. - wintrust: Implement OpenPersonalTrustDBDialog. - wininet: Trace the cache file entry's local file name rather than the passed-in cache entry info's local file name, as the caller may have passed a NULL pointer. - wininet: Don't call URL_LocalFileNameToPathA when asked for a unicode string and URL_LocalFileNameToPathW fails. - wininet: Fix trace typo. - cryptnet: Don't access URL cache entry before it's been read. - cryptnet: Set cache expiration time of objects that have an expiration time to the object's expiration time, rather than relying on the HTTP Expires header. - wintrust: Implement CryptSIPGetSignedDataMsg for .cat files. - crypt32: Implement CryptSIPRetrieveSubjectGuid for .cat files. - wintrust: Don't hardcode supported OIDs, let CryptDecodeObject handle it directly. - crypt32: Fix test failures on NT4. - crypt32: Fix some chain failures on Win9x/NT4. - crypt32: Remove an error that no longer fails. - crypt32: Fix error handling for cyclic chains. - wintrust: Fix test failures on Win9x. - inetmib1: Fix some test failures on Win9x/NT4. - inetmib1: Fix remaining failure on Win9x/NT4. - crypt32: Fix some test failures on Win9x. - -Kai Blin (2): - secur32: Make GetComputerObjectName(A|W) tests work on win2k3 domains. - dplayx: Set tests to "interactive" to avoid timing out on all machines. - -Kirill K. Smirnov (1): - oleaut32: Add tests for metafiles, make them pass under Wine. - -Kjell Rune Skaaraas (1): - wined3d: Implement IWineD3DResourceImpl_GetPriority and IWineD3DResourceImpl_SetPriority for resource management. - -Konstantin Kondratyuk (2): - fonts: Add afii61352 into tahoma.sfd. - fonts: Add afii61352 into tahomabd.sfd. - -Lei Zhang (11): - winspool: Check the return results from schedule_* functions. - gdiplus: Allocate enough space for BITMAPINFO in GdipCreateTextureIA. - gdiplus: Free memory on a failure. - gdiplus: Allocate enough space for BITMAPINFO in GdipBitmapLockBits. - gdiplus: Allocate enough space for BITMAPINFO in GdipBitmapUnlockBits. - gdiplus: Allocate enough space for BITMAPINFO in GdipLoadImageFromStream. - comctl32: Avoid a divide by zero in listview. - regedit: Use W version of TreeView_GetItem. - regedit: Check return values, don't request unneeded value which always fails. - regedit: Make branch export behavior work more like native regedit. - regedit: Pass VK_DELETE messages to Listview/Treeview child windows. - -Louis Lenders (2): - shdocvw: Create default App Paths key for iexplore.exe. - msi: Add stub for MsiSetExternalUIRecord. - -Maarten Lankhorst (7): - quartz: Implement IMediaPosition::put_CurrentPosition. - quartz: Add missing calls to EndFlush. - quartz: Don't abort starting for unconnected pin in avi splitter. - quartz: Return VFW_E_WRONG_STATE in file source if flushing. - quartz: Requeue in pullpin if request for data timed out. - dsound: Fix volume and panning for primary buffer. - winealsa.drv: Don't hang on last few bytes not played. - -Marcus Meissner (6): - jscript: Fixed crash in run test. - jscript: Fix number conversion in non-English locales. - msi/tests: Fix explicit C:\\Program Files\\ references. - msi: Fix potential uninitialized use of substg. - gdiplus: Also handle 32bpp bitmaps. - advapi32: Check for NULL ptr. - -Michael Karcher (12): - msxml3/tests: Clean up test_removeChild. - msxml3: removeChild can only delete direct children. - msxml3: Fail a bit earlier on removeChild(...,NULL,...). - msxml3: Simplify IXMLDOMNode::removeChild. - msxml3: Parameter validation for IXMLDOMNode::replaceChild and tests. - msxml3/tests: Valgrind fix. - msxml3: Basic implementation of IXMLDOMNode::replaceChild. - msxml3: replaceNode accepts IXMLDOMElement instead of IXMLDOMNode. - msxml3: Handle all variant types in IXMLDOMDocument::createNode. - msxml3: Revert "Simplify IXMLDOMNode::removeChild". - msxml3: _domtext->element is in fact a IXMLDOMNode. - msxml3: Text node should not aggregate element. - -Michael Stefaniuc (28): - oleaut32/tests: Remove redundant NULL check before SysFreeString (Smatch). - jscript: Remove redundant NULL check before SysFreeString (Smatch). - msxml3/tests: Remove redundant NULL check before SysFreeString (Smatch). - oleaut32: Remove redundant NULL check before SysFreeString (Smatch). - shlwapi/tests: Remove redundant NULL check before SysFreeString (Smatch). - oleaut32/tests: Fix printf format warning. - shell32: Use FAILED instead of !SUCCEEDED. - ole32: Use the right FAILED/SUCCEEDED macro instead of negating the opposite. - qmgr: Use FAILED instead of !SUCCEEDED. - quartz: Use the right FAILED/SUCCEEDED macro instead of negating the opposite. - ddraw/tests: Use FAILED instead of !SUCCEEDED. - urlmon/tests: Use FAILED instead of !SUCCEEDED. - mshtml/tests: Use FAILED instead of !SUCCEEDED. - d3d9/tests: Use FAILED instead of !SUCCEEDED. - shlwapi: Use FAILED instead of !SUCCEEDED. - dplayx: Use SUCCEEDED instead of !FAILED. - qcap: Use the right FAILED/SUCCEEDED macro instead of negating the opposite. - shdocvw: Use FAILED instead of !SUCCEEDED. - comctl32: Use FAILED instead of !SUCCEEDED. - dxdiagn: Use FAILED instead of !SUCCEEDED. - d3dxof: Use FAILED instead of !SUCCEEDED. - winefile: Use FAILED instead of !SUCCEEDED. - msxml3/tests: Use SUCCEEDED instead of !FAILED. - itss/tests: Use FAILED instead of !SUCCEEDED. - winecfg: Use FAILED instead of !SUCCEEDED. - msi: Use the right FAILED/SUCCEEDED macro instead of negating the opposite. - oleaut32: Use FAILED instead of !SUCCEEDED. - shell32/tests: Use FAILED instead of !SUCCEEDED. - -Muneyuki Noguchi (22): - regedit: Use "MS Shell Dlg" 9 in Japanese resources. - wineboot: Use "MS Shell Dlg" 9 in Japanese resources. - winefile: Use "MS Shell Dlg" 9 in Japanese resources. - taskmgr: Use "MS Shell Dlg" 9 in Japanese resources. - winecfg: Use "MS Shell Dlg" 9 in Japanese resources. - wordpad: Use "MS Shell Dlg" 9 in Japanese resources. - winhlp32: Use "MS Shell Dlg" 9 in Japanese resources. - notepad: Use "MS Shell Dlg" 9 in Japanese resources. - avifil32: Use "MS Shell Dlg" 9 in Japanese resources. - setupapi: Use "MS Shell Dlg" 9 in Japanese resources. - shell32: Use "MS Shell Dlg" 9 in Japanese resources. - user32: Use "MS Shell Dlg" 9 in Japanese resources. - wineps.drv: Use "MS Shell Dlg" 9 in Japanese resources. - wininet: Use "MS Shell Dlg" 9 in Japanese resources. - comctl32: Use "MS Shell Dlg" 9 in Japanese resources. - msacm32: Use "MS Shell Dlg" 9 in Japanese resources. - oledlg: Use "MS Shell Dlg" 9 in Japanese resources. - serialui: Use "MS Shell Dlg" 9 in Japanese resources. - shlwapi: Use "MS Shell Dlg" 9 in Japanese resources. - write: Add Japanese resources. - reg: Add Japanese resources. - mshtml: Add Japanese resources. - -Nikolay Sivov (7): - gdiplus: Stub for GdipSetPathGradientBlend. - gdiplus: Implement GdipGetTextureTransform with test. - gdiplus: Implemented GdipSetTextureTransform with tests. - gdiplus: Implemented GdipResetTextureTransform. - gdiplus: Implemented GdipSetClipRect/GdipSetClipRectI. - gdiplus: Implemented GdipSetClipPath. - gdiplus: Stubs for GdipIsVisiblePoint/GdipIsVisiblePointI. - -Paul Vriens (39): - kernel32/tests: Use skip instead of trace. - kernel32/tests: Skip some tests on win9x. - kernel32/tests: Fix tests on NT4. - kernel32/tests: Make sure we can remove a test directory. - kernel32/tests: Add extra tests for SetCurrentDirectory. - ddraw/tests: Fix a test on a Win98 box. - dsound/tests: Fix failure on Win9x and NT4. - userenv/tests: Don't crash on NT4. - ntdll/tests: Use skip and add a FreeLibrary. - ntdll/tests: Show that we are skipping tests. - ntdll/tests: Show that we are skipping tests. - imm32/tests: Skip tests when IME support is not implemented. - kernel32/tests: Add a skip. - kernel32/tests: Add a skip. - comctl32/tests: Don't crash on some win9x boxes. - gdi32/tests: Fix a few failures on win9x. - kernel32/tests: Fix the remaining errors on win95. - kernel32/tests: Fix some failures on win9x. - kernel32/tests: Add some skips to fix failures on WinMe. - kernel32/tests: We need the return value. - kernel32/tests: Fix failures on WinMe. - user32/tests: Run tests on win95 again. - user32/tests: Fix failures on W2K and below. - kernel32/tests: Add a missing newline. - advapi2/tests: Compare instead of assign. - inetmib1/tests: Compare instead of assign. - msxml3/tests: Compare instead of assign. - shell32/tests: Compare instead of assign. - gdi32/tests: Skip some tests on Win9x/WinMe. - shlwapi/tests: Don't crash on NT4. - wininet/tests: Don't crash on W2K and below. - lz32/tests: Change a trace into a skip. - ole32/tests: Fix two failures on NT4. - shell32/tests: Fix a failure on NT4. - wintrust/tests: Vista/W2K8 have some extra struct members. - user32/tests: Don't crash on NT4. - winmm/tests: Fix the failures on Win9x and WinMe. - winmm/tests: Fix some failures on Vista and W2K8. - spoolss/tests: Fix a failure on Vista/W2K8. - -Philip Nilsson (1): - configure: Add i486-mingw to the cross-compiler prefixes. - -Piotr Caban (9): - msxml3: Change order of interface recognition and fix typo. - msxml3: Fix xmlnode_get_xml to work properly with XML_DOCUMENT_NODE. - msxml3/test: Add test for ISAXXMLReader_parse (passing XMLDOMDocument as argument). - msxml: Partial implementation of ISAXXMLReader_putProperty. - msxml: Fix implementation of ISAXContentHandler_characters. - msxml: Rewrite ISAXContentHandler_characters. - msxml: Fix parsing <.../> elements. - msxml: Added ISAXLexicalHandler_comment event. - msxml: Added CDATA related events handling. - -Reece Dunn (1): - kernel32: Be more verbose when reporting the sync test failures. - -Rob Shearman (58): - include: Add DShellFolderViewEvents to shldisp.idl. - rpcrt4: Don't call VirtualFree with MEM_RELEASE and non-zero size. - msvcrt: Fix mutual exclusion over logical or is always a non-zero constant. - msvcrt: Fix testing zero-valued expression with bitwise and in find_best_locale_proc. - msvcmaker: Define USE_COMPILER_EXCEPTIONS and HAVE_SPAWNVP. - msvcmaker: Fix the arguments passed to winebuild to generate the .def file. - msvcmaker: Fix the generated filename for the spec file for modules with extensions other than .dll. - msvcmaker: Fix generated imports for Wine modules and link with delayed imports. - msvcmaker: Factor out some common settings. - msvcmaker: Add HAVE_* defines for some types present in the MSVC build environment. - msvcmaker: Update the HAVE_* defines for headers in the generated config.h file. - msvcmaker: Remove the defining of __ASM_SHORT and __ASM_STRING in the generated config.h file. - msvcmaker: Update the function list for which HAVE_* defines are written into config.h. - msvcmaker: Add support for building wine.lib. - msvcmaker: Fix invocation of winebuild to generate compatible .def files. - msvcmaker: Generate .h files from .idl files specified in IDL_H_SRCS makefile rules. - msvcmaker: Generate include project and make every wine module depend on it. - msvcmaker: Fix detection of static libraries. - msvcmaker: Define _USE_MATH_DEFINES so that M_PI and other constants are defined when including . - urlmon: Fix race in protocol tests. - ole32: Create a dummy window for use in the drag and drop API tests. - ole32: Fix clipboard test failures on some versions of Windows. - winebuild: Declare fatal_error and fatal_perror as non-returning functions. - uxtheme: SetPropW returns a BOOL not an HRESULT. - shlwapi: Use an error code instead of -1 for signalling prefix not being found in URL_GuessScheme. - d3d9: Fix incorrect ordering of brackets in IDirect3DVertexShader9Impl_GetDevice. - avifil32: Fix type of variable used to store the result of ICCompress in AVIFILE_EncodeFrame. - oledlg: Fix the type of ret in UIINSERTOBJECTDLG_PopulateObjectTypes. - avifil32: Fix treating the return values of mmio* functions as HRESULTs instead of MMRESULTs. - d3d8: Fix incorrect ordering of brackets in IDirect3DVertexShader8Impl_GetDevice. - comcat: Fix mixing of HRESULT and LSTATUS types in COMCAT_CLSID_IEnumGUID_Next, COMCAT_IEnumCATEGORYINFO_Next and COMCAT_CATID_IEnumGUID_Next. - advapi32: Output the last error when services tests fail. - cabinet: Check buffer size before copying in NONEfdi_decomp. - include: Define DD_OK to S_OK instead of 0. - include: Wrap uses of u_* types in ws2tcpip.h with WS() macro. - winhttp: Fix compilation with MinGW/MSVC. - urlmon: Compare HRESULT value explicitly against S_OK instead of using an implicit != 0 comparison. - wininet: Compare HRESULT values explicitly against S_OK instead of using an implicit != 0 comparison. - winedos: Compare HRESULT value explicitly against S_OK instead of using an implicit != 0 comparison. - quartz: Don't use strlenW in array size declaration. - quartz: Fix placement of WINAPI attribute in fnFoundSeek typedef. - wininet: Make WININET_AllocHandle 64-bit safe by using the correct type in the sizeof expression. - include: Generate error codes with correct type in urlmon.idl. - oleaut32: Make the code in copy_to_variant and copy_from_variant more portable. - wininet: Add tests for InternetTimeFromSystemTimeW with insufficient buffer. - wininet: Fix behaviour of InternetTimeFromSystemTimeA/W when a buffer that is too small is passed in. - wininet: Move internet time tests from http.c to internet.c. - Add configure check for dirent.h and readdir. - d3d8/9: Use WINED3D_OK instead of D3D_OK in vertexshader.c. - wininet: Return error codes explicitly from URLCache functions instead of returning a BOOL and storing the error code in the last error value. - wininet: Fix GetUrlCacheEntryInfoA/W when a NULL lpCacheEntryInfo parameter is passed in. - wininet: Add tests for passing invalid parameters into InternetTimeFromSystemTimeA/W. - wininet: Fix behaviour of InternetTimeFromSystemTimeA/W when dealing with invalid parameters. - wininet: Validate parameters passed to RetrieveUrlCacheEntryInfoA/W. - wininet: Get rid of rc variable in InternetReadFile_test. - wininet: Fix crash when calling HttpQueryInfoA/W(HTTP_QUERY_RAW_HEADERS) before any response has been received from a server. - msvcmaker: Don't generate project files for DLLs that can't be compiled with MSVC. - msvcmaker: Don't automatically add a define for the DLL name. - -Roderick Colenbrander (7): - wined3d: Re-add a comment which got lost. - wined3d: UpdateSurface should take into account the offset from the source rectangle. - opengl32: Don't run wgl tests on old gl drivers. - opengl32: Add some driver traces to the tests. - opengl32: Remove some tests which cause issues on win9x. - opengl32: Merge recent opengl extensions and prepare for opengl 3.0. - opengl32: Add a test case for WGL_ARB_create_context/opengl3. - -Stefan Dösinger (1): - wined3d: Initialize standalone surface parameters. - -Stefan Leichter (1): - winscard: Add stubs for SCardAddReaderToGroupA/W. - -Ulrich Czekalla (1): - shell32: Revert c1f2824429286dd60fac723611b801e67eb745b1. It caused poor performance. - -Vincent Povirk (2): - shell32/tests: Accept delays in getting ABN_POSCHANGED notifications. - user32: Handle undocumented WM_POPUPSYSTEMMENU message. - -Vitaliy Margolen (3): - user32/tests: Use empty_message_queue with timeouts. - user32/tests: Make it easier to identify failed tests. - user32/tests: Move shell test to the end - killing explorer affects lots of tests. - -Vitaly Lipatov (1): - include/ddk: Fix include path and include guard name. - --- -Alexandre Julliard -julliard@winehq.org +The Wine development release 1.1.7 is now available. + +What's new in this release (see below for details): + - Improved device management for DOS drives. + - Many Richedit fixes. + - Various installer fixes, particularly for IE 7. + - First steps of Direct3D 10 implementation. + - Various bug fixes. + +The source is available from the following locations: + + http://ibiblio.org/pub/linux/system/emulators/wine/wine-1.1.7.tar.bz2 + http://prdownloads.sourceforge.net/wine/wine-1.1.7.tar.bz2 + +Binary packages for various distributions will be available from: + + http://www.winehq.org/site/download + +You will find documentation on http://www.winehq.org/site/documentation + +You can also get the current source directly from the git +repository. Check http://www.winehq.org/site/git for details. + +Wine is available thanks to the work of many people. See the file +AUTHORS in the distribution for the complete list. + +---------------------------------------------------------------- + +Bugs fixed in 1.1.7: + + 2327 Graphics not rendered with VB6 application using graph server component + 2608 Might and Magic VI wont run until "DeShrinker" program is run on mss32.dll + 2922 Unhandled Exception when starting F18.EXE + 3555 ToolBook Assistant 2004 doesn't run + 3972 .NET Framework 2.0 installation fails on installation of assemblies + 4298 Potential metafile NULL-pointer dereference + 4381 Cannot change focus with TAB from edit control + 4386 Font rendering wrong. + 4783 Network Notepad - .wmf files not rendered + 5022 Wine does not define CLSID_NULLRenderer + 5070 Can't install North Carolina RealFast forms + 5296 Kidspiration 1.0a install fails + 5351 Windows Installer 3.1 cannot install because of non-standard drive labeling + 5455 WINSPOOL: Delphi-application crashes on start after working with winspool + 5542 older D3D games slowed down after upgrading wine from 0.9.15 to 0.9.16 + 5930 Graphic glitches in Alien Shooter + 6224 Video hardware detection problems in Titan Quest + 7035 Drive C: shows up twice in the Age of Mythology installer + 7225 Warhammer Mark of Chaos Will not run + 7456 Sigma Photo Pro 2.1 installer crashes at very very end + 7531 GSAK application freezes when Gecko is installed + 7593 Turnpike email client fails to install + 7900 ShellExecuteEx can fail for paths with spaces in them + 8029 Heart of Darkness doesn't run or output any error. + 8179 graphical glitches in Project Eden + 8184 Oblivion Some shader effects cause screen to go vomit green + 8214 Swat 2 blocky screen + 8642 reflective objects in gtasa look weird + 8920 Adobe Dreamweaver 8: help doesn't work + 8921 Adobe Dreamweaver 8: macros don't play back? + 9188 Silkroad online installer crash + 9295 IMediaPosition not implemented + 9478 Adobe Dreamweaver 8 autocompletion + 9511 Wine uses wrong icon on desktop for installed application + 9628 msiexec command line parsing incorrect + 10107 Wine allows you to install Adobe Photoshop CS2 Trial even if you decline the license + 10486 Rayman 3 Demo doesn't shows 'loading' screens (regression?) + 10504 Blogjet crashes on startup + 10630 Madden NFL 08 run crashes with dsound error and page fault + 10874 Jumpstart Mystery Club vol.1 fails to start + 11014 Siemens ProCenter MSI installer fails + 11122 xkbd: non-US layout results in wrong key mapping + 11531 Richard Burns Rally - Trees/buildings/fences disappear after a while + 11590 Graphics regression in Uplink Laughing Man + 11640 Unable to use multiplayer in Sins of a Solar Empire: unknown address family + 11671 Corel Painter X + 11673 WiX cannot validate created .msi, due to lacking MsiDatabaseMerge + 11695 Truespace demo crashes on launch. + 11739 Farm frenzy (shell:SHGetValueW) + 11759 Microsoft Silverlight installer - unimplemented functions + 11795 Oblivion giant tree sprite(s) follow the player + 11867 StackOverflowException from mscorwks running .NET 2 application + 11881 wine iexplore crashes when started + 11990 Script and Field Lists in FileMaker Pro are blank + 12058 No car engine sounds in TrackMania United + 12063 SDL Edit (SDLX) missing icons on toolbar + 12117 Some Milkdrop visualizations cause Direct3D window to be split oddly + 12146 Flatout 1 draws shadows incorrectly + 12188 Complex Shader causes sky in Everquest 2 to turn black + 12301 Anycount 5.0 fails to install + 12307 firefox 3 crash on some web pages [dogfood] + 12404 Lotus Notes doesn't show window contents after minimize then unminimize + 12485 BitBlt does not ignore source clipping + 12522 FEAR combat 1.07 won't start. + 12581 Wine crashes trying to look up word in Gyldendal's røde ordbøger + 12587 multi line widget broken + 12655 RealPlayer 11 Starts, but suffers a runtime error when selecting a menu + 12776 input line truncated in command-line debugging program 'kd' + 13073 Titan Quest Immortal Throne 1.30 graphic bug + 13230 msi: msi.ok fails in Opensolaris + 13232 Warcraft 3 worldedit.exe fails to start. + 13241 ALSA Midi port names + 13338 cygwin installer crashes in /etc/postinstall/00bash.sh + 13413 itunes initial license dialog display richtext in raw form + 13503 Photoshop CS2 - Dialog windows opens behind active image. + 13585 Quicken Premier 2008: Crashes when trying to use a data file. + 13642 dogfood: InterPoker on Linux crashes + 13753 Glitches on icons in wow + 13838 AutoCAD 2005 setup : Missing backslash in registry entry and profile path + 14229 winedbg can't dump stack of functions that take float args? + 14269 Shareaza does not save preferences + 14297 winhelp: Links to a different part of the current page don't work + 14358 fusion: installation .NET assemblies might fail due to incorrect parsing of CLR metadata structures and tables + 14380 Changing Skins in Shareaza causes crash + 14516 Full-Screen Glow Effect in World of Warcraft is shifted (in DirectX) + 14566 comctl32_test header: crash on win9x in test_hdm_filterMessages at DestroyWindow + 14571 ole32.CoGetCallerTID needed for VS.NET 2005 + 14580 mshtml_test htmldoc: timeout / crash on win9x + 14707 winedbg crashes while trying to debug an application with a pdb file + 14753 Keyboard input is ignored in Abe's Exoddus and Oddysee games + 14829 wininet: http.ok hangs in Solaris, but not Linux + 14839 kernel32: pipe.ok fails in OpenSolaris but not Linux + 14840 kernel32: thread.ok fails in OpenSolaris but not Linux + 15243 Google Chrome URL bar edits and text selections always begin at start of bar + 15294 Openoffice.org 3.0 RC1 installs but apps can't be started. + 15318 Google Chrome pasting in the url field pastes it twice + 15352 TSLPatcher: rtf header should be centered, instead half outside window + 15374 The Witcher - Game cannot be registered + 15390 VGA mode 19 color palettes incomplete + 15405 winresrc.h is incomplete + 15551 SafeDisc regression + 15598 Full Screen mode in World of Warcraft (WoW) broken in 1.1.6 with Gnome + 15608 Wine (or program) can't wait for end of execution, while my program run another .exe or .bat program + 15643 wingdi.h does not define R2_LAST macro + 15650 Wine crashes if it is built with -fomit-frame-pointer + 15694 LEGO Star Wars sounds not playing + 15696 Dragon NaturallySpeaking 10 will not install -- says needs IE5 or later + +---------------------------------------------------------------- + +Changes since 1.1.6: + +Alexander Morozov (1): + ntoskrnl.exe: Initialize some IRP fields to prevent using bad pointers by IofCompleteRequest. + +Alexandre Julliard (63): + comcat: Get rid of NULL checks on the This pointer. + comcat: Moved dll registration to ole32. + comcat: Simplify the class factory implementation and make it more similar to the other ones in ole32. + comcat: Get rid of the redundant IUnknown vtable for the manager implementation. + comcat: Moved all the implementation to ole32 where it belongs. + configure: Moved the crosstest checks so that they are done for all platforms. + mountmgr: Specify the drive type as a DWORD instead of a string. + mountmgr: Return the drive unique id in IOCTL_MOUNTMGR_QUERY_POINTS. + make_makefiles: Add support for .rh files. + dsound: Avoid use of stdint types. + winecfg: Store the drive serial number as a number instead of a string. + winecfg: Store the drive label as Unicode. + kernel32: Delete the .windows-label file if the label is empty. + user32/test: Fix a couple of message test failures on Windows. + mountmgr: Enforce a minimal length for the mount point id. + mountmgr: Store mount points as a list instead of an array. + mountmgr: Store the device name in the mount point structure. + winecrt0: Add missing WINAPI on driver entry point. + avifil32: Convert source files to utf-8. + d3d9: Convert source files to utf-8. + ddraw: Convert source files to utf-8. + dpnet: Convert source files to utf-8. + kernel32: Convert source files to utf-8. + msdmo: Convert source files to utf-8. + msrle32: Convert source files to utf-8. + ole32: Convert source files to utf-8. + rpcrt4: Convert source files to utf-8. + shell32: Convert source files to utf-8. + user32: Convert source files to utf-8. + wined3d: Convert source files to utf-8. + winedos: Convert source files to utf-8. + winex11: Convert source files to utf-8. + include: Convert source files to utf-8. + programs: Convert source files to utf-8. + server: Convert source files to utf-8. + tools: Convert source files to utf-8. + Convert remaining source files to utf-8. + configure: Force -m32 option on x86_64 even if CC is already defined. + wldap32/tests: Don't crash if ldap_search_ext_sA fails. + wldap32: Map Unix error codes to Windows ones for all functions. + server: Added a request to unlink an object from its namespace. + ntoskrnl: Implemented IoDeleteSymbolicLink. + mountmgr: Include some system headers in mountmgr.h. + mountmgr: Moved the harddisk device driver to device.c. + mountmgr: Create devices and symlinks for dynamic drives too. + mountmgr: Return the drive pointer from get_dosdevices_path(). + mountmgr: Convert the registry calls to Unicode. + mountmgr: Query the drive type from the registry for the initial creation. + mountmgr: Create a new harddisk device for dynamic harddisk drives. + mountmgr: Create a PhysicalDrive symlink for all harddisk devices. + mountmgr: Reuse create_disk_device to create the initial harddisk0 device. + configure: Explicitly mention that we need 32-bit libraries to try to avoid some invalid bug reports. + winecfg: Update the drives only when they have changed, instead of trying to compare with the current setup. + msiexec: Fix initial state of the argument parsing state machine. + mountmgr: Store the contents of the device symlink in the drive object. + mountmgr: Allow to specify the drive letter explicitly when creating/removing a drive. + mountmgr: Add a Wine-specific ioctl to define a drive for a Unix path. + mountmgr: Add a Wine-specific ioctl to query the Unix information about a drive. + winecfg: Use an ioctl to the mount manager to define drives. + winecfg: Store the Unix device if any in the drive configuration. + winecfg: Load the existing drive config from mountmgr instead of relying on QueryDosDevice. + mpr: Use a mountmgr ioctl to retrieve the UNC name for a drive. + kernel32: Return the Windows symlink in QueryDosDevice instead of the Unix one. + +Andrew Talbot (12): + gdi32: Sign-compare warnings fix. + imm32: Sign-compare warnings fix. + itss: Sign-compare warnings fix. + kernel32: Sign-compare warnings fix. + mcicda: Sign-compare warning fix. + mlang: Sign-compare warnings fix. + mshtml: Sign-compare warnings fix. + msi: Sign-compare warnings fix. + msi: Sign-compare warnings fix. + msvcrt: Sign-compare warnings fix. + msxml3: Sign-compare warning fix. + ntdll: Sign-compare warnings fix. + +Andrey Esin (1): + regedit: Corrections in Russian translation. + +Andrey Turkin (7): + riched20: Add spare area to ITextServicesImpl to work around broken apps. + wordpad: Use inches instead of cm in calculations. + wordpad: Do not leak a handle on error path. + wordpad: Do not try to close uninitialized handles. + mpr: Fix NULL pointer dereference in WNetGetResourceInformationW. + include: Include winuser.rh from winresrc.h. + wordpad: Do not pass resource ids to MessageBox. + +Aric Stewart (14): + shell32: Refine UNIXFS_path_to_pidl to return more detailed failures. + user32: In DrawTextW/A make sure to properly initialize the cbSize of DRAWTEXTPARAMS. + user32: DrawText handling of 0 counts with string, empty strings and -1 counts with empty string and NULL strings. + user32: Make sure our vertical line count is at least 1 even if there is an oversized font in the edit control. + user32: Update DrawText tests to cover behavior differences on win98. + kernel32/tests: Add a test for CreateProcess with an AppName set. + kernel32/tests: Add test for GetCommandLineW. + gdiplus: Avoid dereferencing a potential NULL (Coverity 589). + shell32/tests: Add tests for CommandLineToArgvW. + ntdll: Implement SystemProcessorPerformanceInformation for Linux (/proc filesystems) and Mac OS X. + comdlg32/tests: Add a test for GetOpenFileName with a dialog template. + comdlg32: Some applications expect the filter combo to be filled before the CustomDlg is created. + ntdll: Update behavior of ActivationContextBasicInformation. + ntdll/tests: handle info behavior for vista and 2008 properly. + +Austin English (5): + advapi32: Quiet a noisy fixme. + wininet: Quiet a noisy fixme. + include/wingdi.h: Define R2_LAST. + gdi32: Quiet a noisy fixme. + wineinstall: Remove bashisms, make sh compatible. + +Chris Wilson (1): + winex11: Ignore source clipping in BitBlt. + +Christian Costa (3): + d3dxof: Move template dumping code in a separate function. + d3dxof: Reference the right objects. + d3dxof: Add support for string parsing. + +Detlef Riekenberg (13): + crypt32/tests: Fix a test on win9x. + crypt32/tests: Fix some tests on win9x. + d3d8/tests: Fix test on win9x with broken driver. + d3d9/tests: Fix test on win9x. + d3d9/tests: Fix test for old gfx-card. + gdi32/tests: Fix tests to not depend on 96 dpi. + shlwapi: Implement SHSendMessageBroadcastA/W. + comctl32/tests: Fix tests to not depend on 96 dpi, make it pass in Wine. + shlwapi: Fix pointer and size in AssocQueryStringA. + shlwapi/tests: Replace RegDeleteTreeW to run the tests again. + mscms: Quiet a noisy fixme. + shdocvw: Implement URLSubRegQueryA. + shdocvw/tests: Add tests for URLSubRegQueryA. + +Dmitry Timoshkov (6): + kernel32: Add support for foreign process handles in GetProcessVersion. + user32: Add a test for fullscreen window sizing, make it pass under Wine. + user32: Fix a typo. + winmm: MMIO_ALLOCBUF is ignored if mmioOpen gets a valid buffer. + gdi32: Make EnumEnhMetaFile update the DC state before calling the callback. + gdi32: Add EMR_GDICOMMENT to the list of records producing output. + +Dylan Smith (24): + richedit: Added EM_SETMARGINS to the list of unsupported messages. + richedit: Added DestroyWindow call to clean up the end of a test. + richedit: Moved optional message loop in tests to its own function. + richedit: Added test for word wrapping behaviour. + richedit: Account for selection bar in calculating available width. + richedit: Fixed centering and right align with word wrap disabled. + wordpad: Added option to disable word wrap. + runtest: Fixed regression that prevented using just the -h option. + richedit: Added test for auto scroll behaviour with redraw disabled. + richedit: Tests for notifications while redraw is disabled. + richedit: Test to see if wrapping happens with redraw disabled. + richedit: Test changes in scrollbar's visibility with redraw disabled. + richedit: Scroll cursor into view even with redraw turned off. + richedit: Test for EN_UPDATE notification when window isn't visible. + richedit: Test to see if WM_SETREDRAW removes the windows visibility. + richedit: Prevent EN_UPDATE notifications when window isn't visible. + richedit: Use the DefWindowProc to implement WM_SETREDRAW. + richedit: Added tests for ctrl-key shortcut handling in WM_KEYDOWN. + richedit: Handle ctrl-key shortcuts on WM_KEYDOWN. + richedit: Added tests for EM_POSFROMCHAR for pos around end of text. + richedit: Fixed EM_POSFROMCHAR for pos of text length. + richedit: Fixed pointer syntax in helper functions for tests. + richedit: Added test for correct behaviour for calling EditWordBreakProc. + richedit: Fixed the call to the EditWordBreakProc. + +Eric Pouech (5): + msvcrt: Implemented wcscat_s. + dbghelp: Report in module's info when a module's debug information has been mismatched (dbg and pdb only). + winedbg: Use Unicode strings for all module references. + winedbg: Added a command to allow loading mismatched modules. + msvcrt: Implemented vswprintf_s. + +Francois Gouget (5): + dirent.h is a conditional include now. + riched20/tests: Add a trailing '\n' to an ok() call. + Assorted spelling fixes. + comdlg32/tests: Remove unneeded casts. + secur32: Check that the GnuTLS header is recent enough for schannel. + +Frans Kool (1): + wordpad: Corrected Dutch translations. + +Hans Leidekker (8): + wininet: Don't destroy authentication data when closing the connection. + wininet: Add a test for basic authentication. + wininet: Fix buffer size query for InternetQueryOption(INTERNET_OPTION_PROXY). + cryptui: Add a partial implementation of CryptUIWizImport. + wldap32: Use a test query that is more likely to succeed within 20 seconds. + cryptui: Honour hDestCertStore in CryptUIWizImport, be more verbose about its shortcomings. + wldap32: Skip tests when the server can't be reached. + wininet: Add an exception handler in HttpOpenRequestA to protect against invalid accept type pointers. + +Henri Verbeet (45): + shell32: Add the IShellView2 interface. + shell32: Add IShellView32 stubs. + shell32: Add VIDs. + shell32: Implement IShellView2_CreateViewWindow2. + shell32: Add a FIXME for unimplemented view modes. + comdlg32: Add a basic test for IShellView2_CreateViewWindow2. + wined3d: Don't crash in CreateAdditionalSwapChain() if the context array wasn't allocated yet. + wined3d: Cleanup properly if creating the context array fails in CreateAdditionalSwapChain(). + wined3d: We only need to enable texturing for a target if we're going to draw with it (without a shader). + wined3d: Simplify texture target handling in surface_blt_to_drawable(). + wined3d: Handle offscreen rendering a bit nicer in surface_blt_to_drawable(). + wined3d: The container is always non-NULL if GetContainer() succeeds. + wined3d: Remove a redundant local variable in apply_draw_buffer(). + wined3d: Modifying GL_TEXTURE_MIN_FILTER modifies both the MINFILTER and MIPFILTER sampler states. + d3d10: Create an importlib. + dxguid: Add d3d10 GUIDs. + dxgi: Add the IDXGIObject interface. + dxgi: Add the IDXGIDeviceSubObject interface. + dxgi: Add the IDXGISurface interface. + dxgi: Add the IDXGIOutput interface. + dxgi: Add the IDXGISwapChain interface. + dxgi: Add the IDXGIAdapter interface. + secur32: Don't make the pBuffer parameter to schan_QueryCredentialsAttributes() const. + secur32: Don't leak the credentials handle when pgnutls_certificate_allocate_credentials() fails. + secur32: Improve error handling for gnutls_global_init(). + secur32: Implement schannel InitializeSecurityContextW. + wined3d: Add support for EXT_framebuffer_multisample. + wined3d: Set the sampler only once in shader_glsl_select_depth_blt(). + d3d10: Add a debug function for D3D10_DRIVER_TYPE. + d3d10: Add a debug function for DXGI_FORMAT. + d3d10: Add a debug function for D3D10_PRIMITIVE_TOPOLOGY. + d3d10: Add a stub implementation of ID3D10Device. + d3d10: Add an initial implementation of D3D10CreateDevice(). + dxgi: Add a dxgi dll. + dxgi: Add the IDXGIFactory interface. + dxgi: Implement CreateDXGIFactory(). + dxgi: Fix a typo. + dxgi: Add the IDXGIDevice interface. + dxgi: Add a stub IDXGIDevice implementation. + d3d10: d3d10 doesn't need wined3d. + d3d10: Implement D3D10CreateDeviceAndSwapChain(). + d3d10: It doesn't make sense to prefer native d3d10. + dxgi: Add a debug function for DXGI_FORMAT. + ddraw: Make sure pWineDirect3DCreate and pWineDirect3DCreateClipper match the header. + wined3d: Remove the SDKVersion parameter to WineDirect3DCreate(). + +Huw Davies (13): + widl: Include errno.h. + wrc: Include errno.h. + ole32: Partial implementation of IOleObject_Update(). + ole32: Call the object's own IOleObject_GetUserType() if the object is running. + ole32: Call the object's IOleObject_IsUpToData() if the object is running. + ole32: Call the object's IPersistStorage_Load() if the object is running. + ole32: Call the object's IPersistStorage_InitNew() if the object is running. + ole32: Call the object's IPersistStorage_Save() if the object is running. + ole32: Call the object's IPersistStorage_SaveCompleted() if the object is running. + ole32: Call the object's IPersistStorage_HandsOffStorage() if the object is running. + ole32: Query the object's dirty state if it's running. + winspool.drv: The fourth parameter of DeviceCapabilitiesW should be an output ptr. + ole32: Call the appropriate storage function when we run the object. + +Hwang YunSong(황윤성) (2): + appwiz.cpl: New Korean resource. + wordpad: Updated Korean resource. + +Ivan Sinitsin (1): + winex11: Set copy mode when rendering OpenGL picture. + +Jacek Caban (55): + mshtml: Added IHTMLElement::put_onmouseover implementation. + mshtml: Added IHTMLDocument2::put_onmouseover implementation. + mshtml: Added get_onmouseover implementations. + mshtml: Added event bubbling implementation. + mshtml: Added IHTMLWindow2::get_event implementation. + mshtml: Pass the right 'this' argument to event handlers. + mshtml: Added set_event_handler(VT_NULL) implementation. + mshtml: Added IHTMLEventObj::get_srcElement implementation. + mshtml: Don't crash in UIActivate if hostui is NULL. + mshtml: Don't crash in notif_focus if client is NULL. + mshtml: Move GetContentDOMWindow call from HTMLWindow_Create. + mshtml: Added IHTMLFrameBase2::get_contentWidnow implementation. + mshtml: Added open and close implementation. + mshtml: Added IHTMLInputElement::select implementation. + mshtml: Added element blur, focus, paste and drag event implementation. + mshtml: Added element keydown, mouseup and mousedown event implementation. + mshtml: Added document keydown, keyup, dragstart and selectstart event implementation. + mshtml: Added element mouseout and selectstart event implementation. + mshtml: Test for NULL nscontainer in set_event_handler_disp. + mshtml: Added IHTMLDocument4::focus implementation. + mshtml: Added IHTMLElement::get_innerText implementation. + mshtml: Fixed increasing buffer size logic in text range implementation. + mshtml: Added IHTMLElement::put_innerText implementation. + mshtml: Added IHTMImgElement::get_src implementation. + mshtml: Added IHTMLDOMNode::insertBefore implementation. + mshtml: Don't fail in IHTMLDOMNode::appendChild if AppendChild failed. + mshtml: Added IHTMLStyle::put_top(VT_NULL) implementation. + mshtml: Use set_nsstyle_attr_var in IHTMLStyle::put_left implementation. + mshtml: Added IOmNavigator::get_appVersion implementation. + jscript: Added Date constructor implementation. + jscript: Added Date.getTime() implementation. + libport: Added isnan. + jscript: Added isNaN implementation. + kernel32: Return uppercase drive letter in GetLogicalDriveStrings. + kernel32: Added GetLogicalDriveStrings tests. + mshtml: Added support for conditional comments. + jscript: Added NaN value implementation. + jscript: Added undefined to number conversion implementation. + jscript: Added isFinite implementation. + msxml3: Update orphaned list in put_documentElement. + msxml3: Fixed dynamic properties allocation. + msxml3: Silence invalid FIXME. + jscript: Added Infinity value implementation. + jscript: Added NaN handling to relational operators. + jscript: Added infinity and nan handling to str_to_number. + jscript: Added NaN handling to Math.min and Math.max. + jscript: Added Math.abs with no arg implementation. + jscript: Added NaN comparation tests. + mshtml: Added IHTMLInputElement::[get|put]_defaultChecked implementation. + mshtml: Added IHTMLInputElement::put_checked implementation. + jscript: Added Number.valueOf implementation. + jscript: Treat function expressions with identifier as function declarations. + jscript: Added Math.floor implementation. + jscript: Return NaN in Math.ceil if called without any argument. + urlmon: Added IsLoggingEnabled[AW] stub implementation. + +James Hawkins (28): + msi: Add more tests for the CompLocator part of the AppSearch action. + msi: Add tests for the IniLocator part of the AppSearch action. + msi: Add tests for the RegLocator part of the AppSearch action. + msi: Add tests for the DrLocator part of the AppSearch action. + msi: Append the file signature to the component's directory when searching for the component's key path. + msi: Expand REG_EXPAND_SZ registry values in the RegLocator table. + msi: Fix the returned format of REG_BINARY data. + msi: Append a backslash to the AppSearch directory path. + msi: Append a backslash to the AppSearch registry path. + msi: All files are uncompressed in an administrative image. + msi: Pass the correct view to get_row. + msi: Return the requested ini field. + msi: Add more tests for the AppSearch action. + msi: Check the file version when a version is provided in the signature. + msi: Add more tests for the RegLocator part of the AppSearch action. + msi: Handle searching for a file with no signature. + msi: Handle searching for directories in the IniLocator part of the AppSearch action. + msi: Simplify and clean up ACTION_RecurseSearchDirectory. + msi: Don't get rid of the file signature when searching the DrLocator table. + msi: Only append a backslash to directories. + msi: Append the next directory to search to the current directory when recursing. + msi: Only check the file signature if the candidate file is not a directory. + msi: Strip the file off the parent path if it's not a directory. + msi: Fix a copy and paste error. + msi: Use the quoted part of the registry value when searching for a file or directory. + msi: Only compare the file version if a version was specified. + msi: Fix a failing test in win9x. + msi: Fix several test failures. + +Jeff Zaroyko (3): + winmm: Fix a failing mixer test on 98 and ME. + dsound/tests: Fix failing propset and capture tests on win98. + dsound/tests: Fix a failing capture test on win2k. + +Jeremiah Flerchinger (3): + winedos: Added missing values to VGA Mode 19 (256 color) palette registers. + winedos: Added additional VGA/VESA modes & information missing in mode descriptions. + winedos: Added/stubbed/documented missing VGA registers. + +Jeremy White (2): + gdi32: Expand maximum font count to 4096, warn when we go over that limit. + gdi32/tests: Make the comparison of the enumerated and returned logfont structures actually work. + +Joris Huizer (1): + shlwapi: Fix ASSOC_GetExecutable not to use uninitialised variable. + +Juan Lang (39): + crypt32: Fix more test failures on Win9x. + rpcrt4: Add tests for UuidCreate. + crypt32: Fix remaining Win9x encoding test failures. + crypt32: Fix tests on WinME. + crypt32: Fix a test failure on Win98. + crypt32: Fix a few more test failures. + crypt32: Correct last error when no data are passed to CRYPT_AsnDecodeInt. + crypt32: Don't check for no data to decode in CryptDecodeObject{Ex}, doing so masks some errors. + crypt32: Make some variables const. + crypt32: Include policy being checked in failure message. + crypt32: Use helper function and broken() macro to make expected chain status results a little more clear. + crypt32: Actually compare chain status instead of doing a no-op comparison, and mark as todo the statuses that don't match in Wine. + cryptnet: Fix test failures on Windows Vista/2008. + crypt32: Microsoft fixed a bug with name constraints, so make Wine's behavior match. + crypt32: Correct another chain status discrepancy with Windows. + crypt32: Fix expected/got mixup. + wintrust: Add stub for WVTAsn1CatMemberInfoEncode. + wintrust: Add tests for WVTAsn1CatMemberInfoEncode. + wintrust: Implement WVTAsn1CatMemberInfoEncode. + wintrust: Add stub for WVTAsn1CatMemberInfoDecode. + wintrust: Add tests for WVTAsn1CatMemberInfoDecode. + wintrust: Implement WVTAsn1CatMemberInfoDecode. + wintrust: Add stub for WVTAsn1CatNameValueEncode. + wintrust: Add tests for WVTAsn1CatNameValueEncode. + wintrust: Implement WVTAsn1CatNameValueEncode. + wintrust: Add stub for WVTAsn1CatNameValueDecode. + wintrust: Add tests for WVTAsn1CatNameValueDecode. + wintrust: Implement WVTAsn1CatNameValueDecode. + crypt32: Don't crash if adding to a provider store fails. + crypt32: Pass flags to enumeration callback. + crypt32: Add stub for CertEnumPhysicalStore. + include: Fix typos. + crypt32: Correct trust error status for cyclic chains. + crypt32: Fix a failing test on Windows, and remove TODO_ERROR since Wine's implemenation already matches. + wintrust: Separate loading a message from a WINTRUST_CERT_INFO into a helper function. + wintrust: Separate loading a message from a WINTRUST_FILE_INFO into a helper function. + wintrust: Pass file handle and path to SOFTPUB_GetMessageFromFile. + wintrust: Partially implement SoftpubLoadMessage for catalog files. + crypt32: Change expected behavior of a test to match Windows Vista/2008. + +Kai Blin (2): + winmm: Use skip() instead of trace() when skipping tests. + comdlg32: Avoid possible NULL pointer dereference (Coverity). + +Kirill K. Smirnov (5): + oleaut32: Print error messages as ERR. + oleaut32: Return correct error code. + oleaut32: Remove superfluous return statement. + gdiplus: IPicture_SaveAsFile updates seek pointer, so put it back. + gdiplus: Whole picture object should be cloned in GdipCloneImage(), not just parent class 'image'. + +Lei Zhang (10): + shlwapi: Add some tests for AssocQueryStringW. + shlwapi: Fix AssocQueryStringW parameter checking. + shlwapi: Handle ASSOCSTR_EXECUTABLE in IQueryAssociations_GetString. + shlwapi: Close registry handles when destroying IQueryAssociations. + version: Prevent infinite looping in VersionInfo32_FindChild. + shlwapi: Refactor get executable code in IQueryAssociations_fnGetString. + shlwapi: Refactor data return code in IQueryAssociations_fnGetString. + shlwapi: Handle ASSOCSTR_FRIENDLYAPPNAME in IQueryAssociations_GetString. + shlwapi: Properly handle pszExtra in IQueryAssociations_GetString. + user32: Send messages for edit control context menu operations. + +Maarten Lankhorst (4): + includes: Fix CryptCATAdminAddCatalog definition. + quartz: Fix ACMWrapper to allow mono channels too. + quartz: Implement dynamic format changing in directsound renderer. + setupapi: Implement installing catalog files. + +Marcus Meissner (4): + Fixed RegEnumKey(Ex)W buffer sizes. + oleview: RegEnumKey gets always sizes, not -1. + jscript: Check for This->ctx and This->site earlier (Coverity). + mshtml: Initialize nswindow in create_doc_from_nsdoc. + +Michael Karcher (14): + msxml3: Implementation of IXMLDOMNamedNodeMap::removeNamedItem. + msxml3: Correct handling of listLength == NULL in IXMLDOMNamedNodeMap::get_length. + msxml3: IXMLDOMNode_put_nodeValue: Use variant coercion. + msxml3: Use right COM invocation macro. + msxml3: Remove superflous re-conversion from wide chars to utf8. + msxml3: Fix leaks in callers of xmlChar_from_wchar. + msxml3: Fix leaking the BindStatusCallback if bind_url fails. + msxml3/tests: Fix assorted memory leaks. + msxml3: Fix memory leaks in node.c. + msxml3: Remove unneeded code. + msxml3: Use the _private element of xmlDoc as pointer. + msxml3: Add an orphan node list to xmlDoc. + msxml3: Use orphan node list. + msxml3: Initialize xmldoc->_private in IPersistStream::Load for IXMLDOMDocument. + +Michael Stefaniuc (14): + shlwapi: Remove break after return (Smatch). + shdocvw/tests: Remove duplicated header include. + wininet: Remove duplicated header includes. + mlang/tests: Remove superfluous backslashes at end of lines. + riched32: Remove superfluous backslashes at end of lines. + dinput: Remove superfluous backslashes at end of lines. + advapi32/tests: Remove superfluous casts of void pointers to other pointer types. + riched20: Remove superfluous backslashes at end of lines. + winecfg: Fix compilation on older gcc versions. + gdi32: Don't cast the void pointer returned by GDI_GetObjPtr(). + comctl32: Remove the superfluous casting of the LPVOID returned by Alloc(). + comctl32: DPA_GetPtr() returns a LPVOID so don't cast its return value. + comctl32: LockResource() returns a LPVOID so don't cast its return value. + ntdll: Don't cast void pointers to other pointer types. + +Mounir IDRASSI (1): + winscard: Added SCardAccessStartedEvent implementation. + +Muneyuki Noguchi (35): + clock: Convert Japanese resource to UTF-8. + cmd: Convert Japanese resource to UTF-8. + cmdlgtst: Convert Japanese resource to UTF-8. + notepad: Convert Japanese resource to UTF-8. + oleview: Convert Japanese resource to UTF-8. + reg: Convert Japanese resource to UTF-8. + regedit: Convert Japanese resource to UTF-8. + taskmgr: Convert Japanese resource to UTF-8. + view: Convert Japanese resource to UTF-8. + wineboot: Convert Japanese resource to UTF-8. + winecfg: Convert Japanese resource to UTF-8. + winefile: Convert Japanese resource to UTF-8. + winemine: Convert Japanese resource to UTF-8. + winhlp32: Convert Japanese resource to UTF-8. + wordpad: Convert Japanese resource to UTF-8. + write: Convert Japanese resource to UTF-8. + appwiz.cpl: Convert Japanese resource to UTF-8. + avifil32: Convert Japanese resource to UTF-8. + comctl32: Convert Japanese resource to UTF-8. + comdlg32: Convert Japanese resource to UTF-8. + mpr: Convert Japanese resource to UTF-8. + msacm32: Convert Japanese resource to UTF-8. + mshtml: Convert Japanese resource to UTF-8. + msrle32: Convert Japanese resource to UTF-8. + oledlg: Convert Japanese resource to UTF-8. + serialui: Convert Japanese resource to UTF-8. + setupapi: Convert Japanese resource to UTF-8. + shell32: Convert Japanese resource to UTF-8. + user32: Convert Japanese resource to UTF-8. + wineps.drv: Convert Japanese resource to UTF-8. + wininet: Convert Japanese resource to UTF-8. + winmm: Convert Japanese resource to UTF-8. + shlwapi: Convert Japanese resource to UTF-8. + documentation: Add Japanese translation. + winex11: Prevent XCreateIC from returning NULL when input style isn't "root". + +Nicolas Le Cam (3): + netapi32/tests: Add a test for well known account RIDs. + netapi32: Fix well known account RIDs in NetQueryDisplayInformation Level 1. + netapi32/tests: Fix a failing test on localized Windows. + +Nikolay Sivov (5): + oleacc: Implemented GetRoleText[A/W] with tests. + gdiplus: Add some tests for pathiterator, fix leaks. + gdiplus: Some tests for GdipCreateRegionHrgn added. + gdiplus: Added Gdip[Get/Set]TextureWrapMode. + gdiplus: Added GdipSetClipGraphics. + +Paul Bryan Roberts (11): + advapi32: ConvertStringSecurityDescriptorToSecurityDescriptor - more tests (pass). + ntdll: RtlSetControlSecurityDescriptor() implementation and test. + advapi32: LookupAccountNameW() - add got clause to test. + advapi32: LookupAccountNameW() - passes expected SidTypeUser test. + advapi32: LookupAccountNameW() - return correct domain name length for not-so-well-known SIDs. + advapi32: LookupAccountNameW() - use ACCOUNT_SIDS domain and name_use fields for well known SIDS. + advapi32: LookupAccountNameW() - correct call in SetEntriesInAclW(). + advapi32: LookupAccountNameW() - use CreateWellKnownSid() properly. + advapi32: LookupAccountNameW() - NULL account name handled. + advapi32: LookupAccountSidW() - handle first user account. + advapi32: LookupAccountNameW() - only first user account and well known SIDs accepted. + +Paul Vriens (20): + advpack/tests: Use win_skip instead of trace. + kernel32/tests: Free memory after use. + mscms/tests: Fix a typo. + setupapi/tests: Fix a failure on win98. + psapi/tests: Use win_skip instead of trace. + uxtheme/tests: Use skip instead of trace. + comctl32/tests: Use win_skip instead of trace. + comctl32/tests: Use win_skip instead of trace. + version/tests: Fix a copy-paste mistake. + version/tests: Use win_skip instead of trace. + usp10/tests: Use win_skip instead of trace. + shell32/tests: Use win_skip instead of trace. + shell32/tests: Use win_skip instead of trace. + userenv/tests: Rewrite the test to cope with multiple blocks of tests. + userenv/tests: Skip a few tests on NT4. + kernel32/tests: Fix a few failures on win9x and winme. + kernel32/tests: Skip a test if needed. + oleacc/tests: Fix some failures on Win98 up to W2K. + shlwapi/tests: Fix failures on multiple platforms. + riched20/tests: Skip some tests on Win9x and WinMe. + +Rafał Mużyło (1): + configure: Avoid problem with recent autoconf. + +Reece Dunn (5): + shell32: Print the correct GUIDs in the shellpath tests. + msvcmaker: The Visual Studio project conversion tool requires a configuration type. + include: Fixed the tom constant values. + include: data_size on GetPrivateData should be a pointer type since it is an in/out parameter. + include/mlang: Added a missing out attribute. + +Ricardo Filipe (12): + reg.exe: Added Portuguese translation. + oleview: Added Portuguese translation. + xcopy: Added Portuguese translation. + wordpad: Added Portuguese translation. + write: Added Portuguese translation. + taskmgr: Added Portuguese translation. + net: Added Portuguese translation. + wineboot: Added Portuguese translation. + msvfw32: Added Portuguese translation. + iccvid: Added Portuguese translation. + sane.ds: Added Portuguese translation. + mshtml: Added Portuguese translation. + +Rob Shearman (16): + jscript: Fix shift/reduce conflict caused by ArrayLiteral. + rpcrt4: The type referred to by the wire_marshal attribute in server.idl must be a pointer. + wnaspi32: Protect the inclusion of dirent.h in aspi.c. + shell32: Fix the position where WINAPI is specified in the LPFNOFN typedef. + rsaenh: Make some functions used in only one file static. + write: Close the thread and process handles returned by CreateProcessW. + rsaenh: Add a value to the empty braces in the initialiser for aOIDDescriptor in build_hash_signature. + jscript: Fix shift/reduce conflict in IfStatement rule. + kernel32: Convert NLS resource files using hex-encoded UTF-16 strings into UTF-8. + msvcmaker: Generate rules for IDL_C_SRCS, IDL_S_SRCS, IDL_P_SRCS and IDL_TLB_SRCS. + kernel32: Fix some Esperanto day and month names. + widl: Check for overflow when parsing integer constants. + wrc: Check for overflows when parsing integer constants. + wrc: Don't accept "0" as a valid codepage in "#pragma code_page" directives. + include: Fix the level of indirection for the umd_version parameter of the CheckInterfaceSupport method of IDXGIAdapter. + wpp: Check for overflows when parsing integer constants. + +Roderick Colenbrander (12): + opengl32/tests: Don't call wglGetProcAddress at the start of the test. + wined3d: arbfp_set_shader_blit should handle ENTER_GL/LEAVE_GL instead of the caller. + wined3d: arbfp_blit_unset should call ENTER_GL/LEAVE_GL instead of the caller. + wined3d: Add ENTER_GL/LEAVE_GL to gen_yuv_shader. + wined3d: Prevent a recursive ENTER_GL before calling blitter->free_private. + wined3d: Fix a recursive ENTER_GL in read_from_framebuffer. + wined3d: Fix recursive ENTER_GL in LoadLocation. + wined3d: ActivateContext caused a lot of recursive ENTER_GL calls while it is especially dangerous in here as this function can indirectly trigger GDI calls. + wined3d: Fix recursive ENTER_GL in UpdateSurface. + wined3d: Protect gl calls in Volume_LoadTexture with ENTER_GL/LEAVE_GL. + wined3d: Remove ENTER_GL/LEAVE_GL from VolumeTexture_PreLoad because it doesn't make any GL calls. + opengl32: Add some updates for recent opengl extensions. + +Stefan Leichter (2): + rpcrt4: Add stub for MesEncodeDynBufferHandleCreate. + include: Fix prototype of SCardReleaseStartedEvent. + +Sylvain Petreolle (1): + ole32: Stub implementation for CoGetCallerTID. + +Tobias Jakobi (3): + winex11: Remove acute/apostrophe from German keyboard layout tables. + wined3d: Fix some typos. + wined3d: Add GL_TEXTURE_BINDING_3D to wined3d_gl header. + +Vijay Kiran Kamuju (1): + include: Add commctrl.rh. + +Vitaliy Margolen (1): + wined3d: Add one more FBO error status code. + +-- +Alexandre Julliard +julliard@winehq.org diff --git a/VERSION b/VERSION index 9ba442c9903..c667a066bd8 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Wine version 1.1.6 +Wine version 1.1.7 diff --git a/aclocal.m4 b/aclocal.m4 index 528c4d36d4d..f3a58488f2e 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -215,16 +215,19 @@ Use the --without-$1 option if you really want this.]) ;; esac])]) AC_DEFUN([WINE_PRINT_MESSAGES],[ac_save_IFS="$IFS" -IFS="|" if test "x$wine_notices != "x; then echo >&AS_MESSAGE_FD + IFS="|" for msg in $wine_notices; do + IFS="$ac_save_IFS" if test -n "$msg"; then AC_MSG_NOTICE([$msg]) fi done fi +IFS="|" for msg in $wine_warnings; do + IFS="$ac_save_IFS" if test -n "$msg"; then echo >&2 AC_MSG_WARN([$msg]) diff --git a/configure b/configure index ee2ee9763bf..60b58d924be 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for Wine 1.1.6. +# Generated by GNU Autoconf 2.61 for Wine 1.1.7. # # Report bugs to . # @@ -574,8 +574,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='Wine' PACKAGE_TARNAME='wine' -PACKAGE_VERSION='1.1.6' -PACKAGE_STRING='Wine 1.1.6' +PACKAGE_VERSION='1.1.7' +PACKAGE_STRING='Wine 1.1.7' PACKAGE_BUGREPORT='wine-devel@winehq.org' ac_unique_file="server/atom.c" @@ -1307,7 +1307,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures Wine 1.1.6 to adapt to many kinds of systems. +\`configure' configures Wine 1.1.7 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1376,7 +1376,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of Wine 1.1.6:";; + short | recursive ) echo "Configuration of Wine 1.1.7:";; esac cat <<\_ACEOF @@ -1508,7 +1508,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -Wine configure 1.1.6 +Wine configure 1.1.7 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1522,7 +1522,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by Wine $as_me 1.1.6, which was +It was created by Wine $as_me 1.1.7, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -2240,11 +2240,12 @@ case $host in x86_64*linux*) if test "x$enable_win64" != "xyes" then - test -n "$CC" || CC="gcc -m32" - test -n "$CXX"|| CXX="g++ -m32" - test -n "$LD" || LD="ld -m elf_i386" - test -n "$AS" || AS="as --32" + CC="${CC:-gcc} -m32" + CXX="${CXX:-g++} -m32" + LD="${LD:-ld} -m elf_i386" + AS="${AS:-as} --32" host_cpu="i386" + notice_platform="32-bit " fi ;; esac @@ -10019,11 +10020,11 @@ fi fi if test "x$ac_cv_lib_soname_Xcursor" = "x"; then case "x$with_xcursor" in - x) wine_notices="$wine_notices|libxcursor development files not found, the Xcursor extension won't be supported." ;; + x) wine_notices="$wine_notices|libxcursor ${notice_platform}development files not found, the Xcursor extension won't be supported." ;; xno) ;; - *) { { echo "$as_me:$LINENO: error: libxcursor development files not found, the Xcursor extension won't be supported. + *) { { echo "$as_me:$LINENO: error: libxcursor ${notice_platform}development files not found, the Xcursor extension won't be supported. This is an error since --with-xcursor was requested." >&5 -echo "$as_me: error: libxcursor development files not found, the Xcursor extension won't be supported. +echo "$as_me: error: libxcursor ${notice_platform}development files not found, the Xcursor extension won't be supported. This is an error since --with-xcursor was requested." >&2;} { (exit 1); exit 1; }; } ;; esac @@ -10113,11 +10114,11 @@ fi fi if test "x$ac_cv_lib_soname_Xi" = "x"; then case "x$with_xinput" in - x) wine_notices="$wine_notices|libxi development files not found, the Xinput extension won't be supported." ;; + x) wine_notices="$wine_notices|libxi ${notice_platform}development files not found, the Xinput extension won't be supported." ;; xno) ;; - *) { { echo "$as_me:$LINENO: error: libxi development files not found, the Xinput extension won't be supported. + *) { { echo "$as_me:$LINENO: error: libxi ${notice_platform}development files not found, the Xinput extension won't be supported. This is an error since --with-xinput was requested." >&5 -echo "$as_me: error: libxi development files not found, the Xinput extension won't be supported. +echo "$as_me: error: libxi ${notice_platform}development files not found, the Xinput extension won't be supported. This is an error since --with-xinput was requested." >&2;} { (exit 1); exit 1; }; } ;; esac @@ -10198,11 +10199,11 @@ fi fi if test "$ac_cv_lib_Xext_XShmQueryExtension" != "yes"; then case "x$with_xshm" in - x) wine_notices="$wine_notices|XShm development files not found, X Shared Memory won't be supported." ;; + x) wine_notices="$wine_notices|XShm ${notice_platform}development files not found, X Shared Memory won't be supported." ;; xno) ;; - *) { { echo "$as_me:$LINENO: error: XShm development files not found, X Shared Memory won't be supported. + *) { { echo "$as_me:$LINENO: error: XShm ${notice_platform}development files not found, X Shared Memory won't be supported. This is an error since --with-xshm was requested." >&5 -echo "$as_me: error: XShm development files not found, X Shared Memory won't be supported. +echo "$as_me: error: XShm ${notice_platform}development files not found, X Shared Memory won't be supported. This is an error since --with-xshm was requested." >&2;} { (exit 1); exit 1; }; } ;; esac @@ -10283,11 +10284,11 @@ fi fi if test "$ac_cv_lib_Xext_XShapeQueryExtension" != "yes"; then case "x$with_xshape" in - x) wine_notices="$wine_notices|XShape development files not found, XShape won't be supported." ;; + x) wine_notices="$wine_notices|XShape ${notice_platform}development files not found, XShape won't be supported." ;; xno) ;; - *) { { echo "$as_me:$LINENO: error: XShape development files not found, XShape won't be supported. + *) { { echo "$as_me:$LINENO: error: XShape ${notice_platform}development files not found, XShape won't be supported. This is an error since --with-xshape was requested." >&5 -echo "$as_me: error: XShape development files not found, XShape won't be supported. +echo "$as_me: error: XShape ${notice_platform}development files not found, XShape won't be supported. This is an error since --with-xshape was requested." >&2;} { (exit 1); exit 1; }; } ;; esac @@ -10377,11 +10378,11 @@ fi fi if test "x$ac_cv_lib_soname_Xxf86vm" = "x"; then case "x$with_xxf86vm" in - x) wine_notices="$wine_notices|libXxf86vm development files not found, XFree86 Vidmode won't be supported." ;; + x) wine_notices="$wine_notices|libXxf86vm ${notice_platform}development files not found, XFree86 Vidmode won't be supported." ;; xno) ;; - *) { { echo "$as_me:$LINENO: error: libXxf86vm development files not found, XFree86 Vidmode won't be supported. + *) { { echo "$as_me:$LINENO: error: libXxf86vm ${notice_platform}development files not found, XFree86 Vidmode won't be supported. This is an error since --with-xxf86vm was requested." >&5 -echo "$as_me: error: libXxf86vm development files not found, XFree86 Vidmode won't be supported. +echo "$as_me: error: libXxf86vm ${notice_platform}development files not found, XFree86 Vidmode won't be supported. This is an error since --with-xxf86vm was requested." >&2;} { (exit 1); exit 1; }; } ;; esac @@ -10540,11 +10541,11 @@ fi fi if test "x$ac_cv_lib_soname_Xrender" = "x"; then case "x$with_xrender" in - x) wine_warnings="$wine_warnings|libxrender development files not found, XRender won't be supported." ;; + x) wine_warnings="$wine_warnings|libxrender ${notice_platform}development files not found, XRender won't be supported." ;; xno) ;; - *) { { echo "$as_me:$LINENO: error: libxrender development files not found, XRender won't be supported. + *) { { echo "$as_me:$LINENO: error: libxrender ${notice_platform}development files not found, XRender won't be supported. This is an error since --with-xrender was requested." >&5 -echo "$as_me: error: libxrender development files not found, XRender won't be supported. +echo "$as_me: error: libxrender ${notice_platform}development files not found, XRender won't be supported. This is an error since --with-xrender was requested." >&2;} { (exit 1); exit 1; }; } ;; esac @@ -10675,11 +10676,11 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x$ac_cv_lib_soname_Xrandr" = "x"; then case "x$with_xrandr" in - x) wine_notices="$wine_notices|libxrandr development files not found, XRandr won't be supported." ;; + x) wine_notices="$wine_notices|libxrandr ${notice_platform}development files not found, XRandr won't be supported." ;; xno) ;; - *) { { echo "$as_me:$LINENO: error: libxrandr development files not found, XRandr won't be supported. + *) { { echo "$as_me:$LINENO: error: libxrandr ${notice_platform}development files not found, XRandr won't be supported. This is an error since --with-xrandr was requested." >&5 -echo "$as_me: error: libxrandr development files not found, XRandr won't be supported. +echo "$as_me: error: libxrandr ${notice_platform}development files not found, XRandr won't be supported. This is an error since --with-xrandr was requested." >&2;} { (exit 1); exit 1; }; } ;; esac @@ -10810,11 +10811,11 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x$ac_cv_lib_soname_Xinerama" = "x"; then case "x$with_xinerama" in - x) wine_notices="$wine_notices|libxinerama development files not found, multi-monitor setups won't be supported." ;; + x) wine_notices="$wine_notices|libxinerama ${notice_platform}development files not found, multi-monitor setups won't be supported." ;; xno) ;; - *) { { echo "$as_me:$LINENO: error: libxinerama development files not found, multi-monitor setups won't be supported. + *) { { echo "$as_me:$LINENO: error: libxinerama ${notice_platform}development files not found, multi-monitor setups won't be supported. This is an error since --with-xinerama was requested." >&5 -echo "$as_me: error: libxinerama development files not found, multi-monitor setups won't be supported. +echo "$as_me: error: libxinerama ${notice_platform}development files not found, multi-monitor setups won't be supported. This is an error since --with-xinerama was requested." >&2;} { (exit 1); exit 1; }; } ;; esac @@ -10904,11 +10905,11 @@ fi fi if test "x$ac_cv_lib_soname_Xcomposite" = "x"; then case "x$with_xcomposite" in - x) wine_notices="$wine_notices|libxcomposite development files not found, Xcomposite won't be supported." ;; + x) wine_notices="$wine_notices|libxcomposite ${notice_platform}development files not found, Xcomposite won't be supported." ;; xno) ;; - *) { { echo "$as_me:$LINENO: error: libxcomposite development files not found, Xcomposite won't be supported. + *) { { echo "$as_me:$LINENO: error: libxcomposite ${notice_platform}development files not found, Xcomposite won't be supported. This is an error since --with-xcomposite was requested." >&5 -echo "$as_me: error: libxcomposite development files not found, Xcomposite won't be supported. +echo "$as_me: error: libxcomposite ${notice_platform}development files not found, Xcomposite won't be supported. This is an error since --with-xcomposite was requested." >&2;} { (exit 1); exit 1; }; } ;; esac @@ -11399,11 +11400,11 @@ fi fi if test "x$ac_cv_lib_soname_GLU" = "x"; then case "x$with_glu" in - x) wine_notices="$wine_notices|libGLU development files not found, GLU won't be supported." ;; + x) wine_notices="$wine_notices|libGLU ${notice_platform}development files not found, GLU won't be supported." ;; xno) ;; - *) { { echo "$as_me:$LINENO: error: libGLU development files not found, GLU won't be supported. + *) { { echo "$as_me:$LINENO: error: libGLU ${notice_platform}development files not found, GLU won't be supported. This is an error since --with-glu was requested." >&5 -echo "$as_me: error: libGLU development files not found, GLU won't be supported. +echo "$as_me: error: libGLU ${notice_platform}development files not found, GLU won't be supported. This is an error since --with-glu was requested." >&2;} { (exit 1); exit 1; }; } ;; esac @@ -12183,11 +12184,11 @@ done fi if test "$ac_cv_lib_xml2_xmlParseMemory" != "yes"; then case "x$with_xml" in - x) wine_warnings="$wine_warnings|libxml2 development files not found, XML won't be supported." ;; + x) wine_warnings="$wine_warnings|libxml2 ${notice_platform}development files not found, XML won't be supported." ;; xno) ;; - *) { { echo "$as_me:$LINENO: error: libxml2 development files not found, XML won't be supported. + *) { { echo "$as_me:$LINENO: error: libxml2 ${notice_platform}development files not found, XML won't be supported. This is an error since --with-xml was requested." >&5 -echo "$as_me: error: libxml2 development files not found, XML won't be supported. +echo "$as_me: error: libxml2 ${notice_platform}development files not found, XML won't be supported. This is an error since --with-xml was requested." >&2;} { (exit 1); exit 1; }; } ;; esac @@ -12442,11 +12443,11 @@ fi fi if test "$ac_cv_lib_xslt_xsltCompilePattern" != "yes"; then case "x$with_xslt" in - x) wine_warnings="$wine_warnings|libxslt development files not found, xslt won't be supported." ;; + x) wine_warnings="$wine_warnings|libxslt ${notice_platform}development files not found, xslt won't be supported." ;; xno) ;; - *) { { echo "$as_me:$LINENO: error: libxslt development files not found, xslt won't be supported. + *) { { echo "$as_me:$LINENO: error: libxslt ${notice_platform}development files not found, xslt won't be supported. This is an error since --with-xslt was requested." >&5 -echo "$as_me: error: libxslt development files not found, xslt won't be supported. +echo "$as_me: error: libxslt ${notice_platform}development files not found, xslt won't be supported. This is an error since --with-xslt was requested." >&2;} { (exit 1); exit 1; }; } ;; esac @@ -12756,11 +12757,11 @@ fi fi if test "x$ac_cv_lib_soname_hal" = "x"; then case "x$with_hal" in - x) wine_notices="$wine_notices|libhal development files not found, no dynamic device support." ;; + x) wine_notices="$wine_notices|libhal ${notice_platform}development files not found, no dynamic device support." ;; xno) ;; - *) { { echo "$as_me:$LINENO: error: libhal development files not found, no dynamic device support. + *) { { echo "$as_me:$LINENO: error: libhal ${notice_platform}development files not found, no dynamic device support. This is an error since --with-hal was requested." >&5 -echo "$as_me: error: libhal development files not found, no dynamic device support. +echo "$as_me: error: libhal ${notice_platform}development files not found, no dynamic device support. This is an error since --with-hal was requested." >&2;} { (exit 1); exit 1; }; } ;; esac @@ -12904,6 +12905,38 @@ echo "${ECHO_T}$ac_cv_header_gnutls_gnutls_h" >&6; } fi if test $ac_cv_header_gnutls_gnutls_h = yes; then + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +typeof(gnutls_transport_set_errno) *pfunc; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then { echo "$as_me:$LINENO: checking for -lgnutls" >&5 echo $ECHO_N "checking for -lgnutls... $ECHO_C" >&6; } if test "${ac_cv_lib_soname_gnutls+set}" = set; then @@ -12983,6 +13016,14 @@ _ACEOF fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi @@ -12990,11 +13031,11 @@ fi fi if test "x$ac_cv_lib_soname_gnutls" = "x"; then case "x$with_gnutls" in - x) wine_notices="$wine_notices|libgnutls development files not found, no schannel support." ;; + x) wine_notices="$wine_notices|libgnutls ${notice_platform}development files not found, no schannel support." ;; xno) ;; - *) { { echo "$as_me:$LINENO: error: libgnutls development files not found, no schannel support. + *) { { echo "$as_me:$LINENO: error: libgnutls ${notice_platform}development files not found, no schannel support. This is an error since --with-gnutls was requested." >&5 -echo "$as_me: error: libgnutls development files not found, no schannel support. +echo "$as_me: error: libgnutls ${notice_platform}development files not found, no schannel support. This is an error since --with-gnutls was requested." >&2;} { (exit 1); exit 1; }; } ;; esac @@ -13262,11 +13303,11 @@ done LIBS="$ac_save_LIBS" if test "x$ac_cv_lib_soname_curses$ac_cv_lib_soname_ncurses" = "x"; then case "x$with_curses" in - x) wine_notices="$wine_notices|lib(n)curses development files not found, curses won't be supported." ;; + x) wine_notices="$wine_notices|lib(n)curses ${notice_platform}development files not found, curses won't be supported." ;; xno) ;; - *) { { echo "$as_me:$LINENO: error: lib(n)curses development files not found, curses won't be supported. + *) { { echo "$as_me:$LINENO: error: lib(n)curses ${notice_platform}development files not found, curses won't be supported. This is an error since --with-curses was requested." >&5 -echo "$as_me: error: lib(n)curses development files not found, curses won't be supported. +echo "$as_me: error: lib(n)curses ${notice_platform}development files not found, curses won't be supported. This is an error since --with-curses was requested." >&2;} { (exit 1); exit 1; }; } ;; esac @@ -13534,11 +13575,11 @@ fi fi if test "x$ac_cv_lib_soname_sane" = "x"; then case "x$with_sane" in - x) wine_notices="$wine_notices|libsane development files not found, scanners won't be supported." ;; + x) wine_notices="$wine_notices|libsane ${notice_platform}development files not found, scanners won't be supported." ;; xno) ;; - *) { { echo "$as_me:$LINENO: error: libsane development files not found, scanners won't be supported. + *) { { echo "$as_me:$LINENO: error: libsane ${notice_platform}development files not found, scanners won't be supported. This is an error since --with-sane was requested." >&5 -echo "$as_me: error: libsane development files not found, scanners won't be supported. +echo "$as_me: error: libsane ${notice_platform}development files not found, scanners won't be supported. This is an error since --with-sane was requested." >&2;} { (exit 1); exit 1; }; } ;; esac @@ -13845,11 +13886,11 @@ fi fi if test "$ac_cv_lib_gphoto2_gp_camera_new" != "yes"; then case "x$with_gphoto" in - x) wine_notices="$wine_notices|libgphoto2 development files not found, digital cameras won't be supported." ;; + x) wine_notices="$wine_notices|libgphoto2 ${notice_platform}development files not found, digital cameras won't be supported." ;; xno) ;; - *) { { echo "$as_me:$LINENO: error: libgphoto2 development files not found, digital cameras won't be supported. + *) { { echo "$as_me:$LINENO: error: libgphoto2 ${notice_platform}development files not found, digital cameras won't be supported. This is an error since --with-gphoto was requested." >&5 -echo "$as_me: error: libgphoto2 development files not found, digital cameras won't be supported. +echo "$as_me: error: libgphoto2 ${notice_platform}development files not found, digital cameras won't be supported. This is an error since --with-gphoto was requested." >&2;} { (exit 1); exit 1; }; } ;; esac @@ -14010,11 +14051,11 @@ fi fi if test "$ac_cv_lib_lcms_cmsOpenProfileFromFile" != "yes"; then case "x$with_cms" in - x) wine_notices="$wine_notices|liblcms development files not found, Color Management won't be supported." ;; + x) wine_notices="$wine_notices|liblcms ${notice_platform}development files not found, Color Management won't be supported." ;; xno) ;; - *) { { echo "$as_me:$LINENO: error: liblcms development files not found, Color Management won't be supported. + *) { { echo "$as_me:$LINENO: error: liblcms ${notice_platform}development files not found, Color Management won't be supported. This is an error since --with-cms was requested." >&5 -echo "$as_me: error: liblcms development files not found, Color Management won't be supported. +echo "$as_me: error: liblcms ${notice_platform}development files not found, Color Management won't be supported. This is an error since --with-cms was requested." >&2;} { (exit 1); exit 1; }; } ;; esac @@ -15305,11 +15346,11 @@ fi fi if test "x$ac_cv_lib_soname_capi20" = "x"; then case "x$with_capi" in - x) wine_notices="$wine_notices|libcapi20 development files not found, ISDN won't be supported." ;; + x) wine_notices="$wine_notices|libcapi20 ${notice_platform}development files not found, ISDN won't be supported." ;; xno) ;; - *) { { echo "$as_me:$LINENO: error: libcapi20 development files not found, ISDN won't be supported. + *) { { echo "$as_me:$LINENO: error: libcapi20 ${notice_platform}development files not found, ISDN won't be supported. This is an error since --with-capi was requested." >&5 -echo "$as_me: error: libcapi20 development files not found, ISDN won't be supported. +echo "$as_me: error: libcapi20 ${notice_platform}development files not found, ISDN won't be supported. This is an error since --with-capi was requested." >&2;} { (exit 1); exit 1; }; } ;; esac @@ -15550,11 +15591,11 @@ done fi if test "x$ac_cv_lib_soname_cups" = "x"; then case "x$with_cups" in - x) wine_notices="$wine_notices|libcups development files not found, CUPS won't be supported." ;; + x) wine_notices="$wine_notices|libcups ${notice_platform}development files not found, CUPS won't be supported." ;; xno) ;; - *) { { echo "$as_me:$LINENO: error: libcups development files not found, CUPS won't be supported. + *) { { echo "$as_me:$LINENO: error: libcups ${notice_platform}development files not found, CUPS won't be supported. This is an error since --with-cups was requested." >&5 -echo "$as_me: error: libcups development files not found, CUPS won't be supported. +echo "$as_me: error: libcups ${notice_platform}development files not found, CUPS won't be supported. This is an error since --with-cups was requested." >&2;} { (exit 1); exit 1; }; } ;; esac @@ -15960,11 +16001,11 @@ fi fi if test "x$ac_cv_lib_soname_fontconfig" = "x"; then case "x$with_fontconfig" in - x) wine_notices="$wine_notices|fontconfig development files not found, fontconfig won't be supported." ;; + x) wine_notices="$wine_notices|fontconfig ${notice_platform}development files not found, fontconfig won't be supported." ;; xno) ;; - *) { { echo "$as_me:$LINENO: error: fontconfig development files not found, fontconfig won't be supported. + *) { { echo "$as_me:$LINENO: error: fontconfig ${notice_platform}development files not found, fontconfig won't be supported. This is an error since --with-fontconfig was requested." >&5 -echo "$as_me: error: fontconfig development files not found, fontconfig won't be supported. +echo "$as_me: error: fontconfig ${notice_platform}development files not found, fontconfig won't be supported. This is an error since --with-fontconfig was requested." >&2;} { (exit 1); exit 1; }; } ;; esac @@ -16132,11 +16173,11 @@ fi fi if test "x$ac_cv_lib_soname_ssl" = "x" -o "x$ac_cv_lib_soname_crypto" = "x"; then case "x$with_openssl" in - x) wine_warnings="$wine_warnings|OpenSSL development files not found, SSL won't be supported." ;; + x) wine_warnings="$wine_warnings|OpenSSL ${notice_platform}development files not found, SSL won't be supported." ;; xno) ;; - *) { { echo "$as_me:$LINENO: error: OpenSSL development files not found, SSL won't be supported. + *) { { echo "$as_me:$LINENO: error: OpenSSL ${notice_platform}development files not found, SSL won't be supported. This is an error since --with-openssl was requested." >&5 -echo "$as_me: error: OpenSSL development files not found, SSL won't be supported. +echo "$as_me: error: OpenSSL ${notice_platform}development files not found, SSL won't be supported. This is an error since --with-openssl was requested." >&2;} { (exit 1); exit 1; }; } ;; esac @@ -16226,11 +16267,11 @@ fi fi if test "x$ac_cv_lib_soname_jpeg" = "x"; then case "x$with_jpeg" in - x) wine_warnings="$wine_warnings|libjpeg development files not found, JPEG won't be supported." ;; + x) wine_warnings="$wine_warnings|libjpeg ${notice_platform}development files not found, JPEG won't be supported." ;; xno) ;; - *) { { echo "$as_me:$LINENO: error: libjpeg development files not found, JPEG won't be supported. + *) { { echo "$as_me:$LINENO: error: libjpeg ${notice_platform}development files not found, JPEG won't be supported. This is an error since --with-jpeg was requested." >&5 -echo "$as_me: error: libjpeg development files not found, JPEG won't be supported. +echo "$as_me: error: libjpeg ${notice_platform}development files not found, JPEG won't be supported. This is an error since --with-jpeg was requested." >&2;} { (exit 1); exit 1; }; } ;; esac @@ -16320,11 +16361,11 @@ fi fi if test "x$ac_cv_lib_soname_png" = "x"; then case "x$with_png" in - x) wine_warnings="$wine_warnings|libpng development files not found, PNG won't be supported." ;; + x) wine_warnings="$wine_warnings|libpng ${notice_platform}development files not found, PNG won't be supported." ;; xno) ;; - *) { { echo "$as_me:$LINENO: error: libpng development files not found, PNG won't be supported. + *) { { echo "$as_me:$LINENO: error: libpng ${notice_platform}development files not found, PNG won't be supported. This is an error since --with-png was requested." >&5 -echo "$as_me: error: libpng development files not found, PNG won't be supported. +echo "$as_me: error: libpng ${notice_platform}development files not found, PNG won't be supported. This is an error since --with-png was requested." >&2;} { (exit 1); exit 1; }; } ;; esac @@ -18340,11 +18381,11 @@ LIBS="$ac_wine_check_funcs_save_LIBS" fi if test "x$LDAPLIBS" = "x"; then case "x$with_ldap" in - x) wine_notices="$wine_notices|libldap (OpenLDAP) development files not found, LDAP won't be supported." ;; + x) wine_notices="$wine_notices|libldap (OpenLDAP) ${notice_platform}development files not found, LDAP won't be supported." ;; xno) ;; - *) { { echo "$as_me:$LINENO: error: libldap (OpenLDAP) development files not found, LDAP won't be supported. + *) { { echo "$as_me:$LINENO: error: libldap (OpenLDAP) ${notice_platform}development files not found, LDAP won't be supported. This is an error since --with-ldap was requested." >&5 -echo "$as_me: error: libldap (OpenLDAP) development files not found, LDAP won't be supported. +echo "$as_me: error: libldap (OpenLDAP) ${notice_platform}development files not found, LDAP won't be supported. This is an error since --with-ldap was requested." >&2;} { (exit 1); exit 1; }; } ;; esac @@ -23448,6 +23489,14 @@ dlls/dxerr9/Makefile: dlls/dxerr9/Makefile.in dlls/Makeimplib.rules" ac_config_files="$ac_config_files dlls/dxerr9/Makefile" ALL_MAKEFILES="$ALL_MAKEFILES \\ + dlls/dxgi/Makefile" +test "x$enable_dxgi" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\ + dxgi" +ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS +dlls/dxgi/Makefile: dlls/dxgi/Makefile.in dlls/Makedll.rules" +ac_config_files="$ac_config_files dlls/dxgi/Makefile" + +ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/dxguid/Makefile" test "x$enable_dxguid" != xno && ALL_IMPLIB_DIRS="$ALL_IMPLIB_DIRS \\ dxguid" @@ -26455,7 +26504,7 @@ exec 6>&1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by Wine $as_me 1.1.6, which was +This file was extended by Wine $as_me 1.1.7, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -26508,7 +26557,7 @@ Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -Wine config.status 1.1.6 +Wine config.status 1.1.7 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" @@ -26734,6 +26783,7 @@ do "dlls/dxdiagn/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/dxdiagn/Makefile" ;; "dlls/dxerr8/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/dxerr8/Makefile" ;; "dlls/dxerr9/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/dxerr9/Makefile" ;; + "dlls/dxgi/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/dxgi/Makefile" ;; "dlls/dxguid/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/dxguid/Makefile" ;; "dlls/faultrep/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/faultrep/Makefile" ;; "dlls/fusion/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/fusion/Makefile" ;; @@ -27809,17 +27859,20 @@ then fi ac_save_IFS="$IFS" -IFS="|" if test "x$wine_notices != "x; then echo >&6 + IFS="|" for msg in $wine_notices; do + IFS="$ac_save_IFS" if test -n "$msg"; then { echo "$as_me:$LINENO: $msg" >&5 echo "$as_me: $msg" >&6;} fi done fi +IFS="|" for msg in $wine_warnings; do + IFS="$ac_save_IFS" if test -n "$msg"; then echo >&2 { echo "$as_me:$LINENO: WARNING: $msg" >&5 diff --git a/configure.ac b/configure.ac index 1e3c8fc340d..7a331d2f330 100644 --- a/configure.ac +++ b/configure.ac @@ -86,11 +86,12 @@ case $host in x86_64*linux*) if test "x$enable_win64" != "xyes" then - test -n "$CC" || CC="gcc -m32" - test -n "$CXX"|| CXX="g++ -m32" - test -n "$LD" || LD="ld -m elf_i386" - test -n "$AS" || AS="as --32" + CC="${CC:-gcc} -m32" + CXX="${CXX:-g++} -m32" + LD="${LD:-ld} -m elf_i386" + AS="${AS:-as} --32" host_cpu="i386" + notice_platform="32-bit " fi ;; esac @@ -670,7 +671,7 @@ then WINE_CHECK_SONAME(Xcursor,XcursorImageLoadCursor,,,[$X_LIBS -lXext -lX11 $X_EXTRA_LIBS]) fi WINE_NOTICE_WITH(xcursor,[test "x$ac_cv_lib_soname_Xcursor" = "x"], - [libxcursor development files not found, the Xcursor extension won't be supported.]) + [libxcursor ${notice_platform}development files not found, the Xcursor extension won't be supported.]) dnl *** Check for X input extension if test "$ac_cv_header_X11_extensions_XInput_h" = "yes" @@ -678,7 +679,7 @@ then WINE_CHECK_SONAME(Xi,XOpenDevice,,,[$X_LIBS -lXext -lX11 $X_EXTRA_LIBS]) fi WINE_NOTICE_WITH(xinput,[test "x$ac_cv_lib_soname_Xi" = "x"], - [libxi development files not found, the Xinput extension won't be supported.]) + [libxi ${notice_platform}development files not found, the Xinput extension won't be supported.]) dnl *** Check for X Shm extension if test "$ac_cv_header_X11_extensions_XShm_h" = "yes" @@ -688,7 +689,7 @@ then $X_LIBS -lXext -lX11 $X_EXTRA_LIBS) fi WINE_NOTICE_WITH(xshm,[test "$ac_cv_lib_Xext_XShmQueryExtension" != "yes"], - [XShm development files not found, X Shared Memory won't be supported.]) + [XShm ${notice_platform}development files not found, X Shared Memory won't be supported.]) dnl *** Check for X shape extension if test "$ac_cv_header_X11_extensions_shape_h" = "yes" @@ -698,7 +699,7 @@ then $X_LIBS -lXext -lX11 $X_EXTRA_LIBS) fi WINE_NOTICE_WITH(xshape,[test "$ac_cv_lib_Xext_XShapeQueryExtension" != "yes"], - [XShape development files not found, XShape won't be supported.]) + [XShape ${notice_platform}development files not found, XShape won't be supported.]) dnl *** Check for XFree86 VMODE extension if test "$ac_cv_header_X11_extensions_xf86vmode_h" = "yes" @@ -706,7 +707,7 @@ then WINE_CHECK_SONAME(Xxf86vm,XF86VidModeQueryExtension,,,[$X_LIBS -lXext -lX11 $X_EXTRA_LIBS]) fi WINE_NOTICE_WITH(xxf86vm,[test "x$ac_cv_lib_soname_Xxf86vm" = "x"], - [libXxf86vm development files not found, XFree86 Vidmode won't be supported.]) + [libXxf86vm ${notice_platform}development files not found, XFree86 Vidmode won't be supported.]) dnl *** Check for Transform functions in Xrender if test "$ac_cv_header_X11_extensions_Xrender_h" = "yes" -a "x$ac_cv_lib_soname_X11" != "x" -a "x$ac_cv_lib_soname_Xext" != "x" @@ -719,7 +720,7 @@ then fi WINE_WARNING_WITH(xrender,[test "x$ac_cv_lib_soname_Xrender" = "x"], - [libxrender development files not found, XRender won't be supported.]) + [libxrender ${notice_platform}development files not found, XRender won't be supported.]) dnl *** Check for X RandR extension if test "$ac_cv_header_X11_extensions_Xrandr_h" = "yes" -a "x$ac_cv_lib_soname_Xrender" != "x" @@ -729,7 +730,7 @@ then [WINE_CHECK_SONAME(Xrandr,XRRQueryExtension,,,[$X_LIBS -lXext -lX11 $X_EXTRA_LIBS])]) fi WINE_NOTICE_WITH(xrandr,[test "x$ac_cv_lib_soname_Xrandr" = "x"], - [libxrandr development files not found, XRandr won't be supported.]) + [libxrandr ${notice_platform}development files not found, XRandr won't be supported.]) dnl *** Check for Xinerama extension if test "$ac_cv_header_X11_extensions_Xinerama_h" = "yes" @@ -739,7 +740,7 @@ then [WINE_CHECK_SONAME(Xinerama,XineramaQueryScreens,,,[$X_LIBS -lXext -lX11 $X_EXTRA_LIBS])]) fi WINE_NOTICE_WITH(xinerama,[test "x$ac_cv_lib_soname_Xinerama" = "x"], - [libxinerama development files not found, multi-monitor setups won't be supported.]) + [libxinerama ${notice_platform}development files not found, multi-monitor setups won't be supported.]) dnl *** Check for X Composite extension if test "$ac_cv_header_X11_extensions_Xcomposite_h" = "yes" @@ -747,7 +748,7 @@ then WINE_CHECK_SONAME(Xcomposite,XCompositeRedirectWindow,,,[$X_LIBS -lXext -lX11 $X_EXTRA_LIBS]) fi WINE_NOTICE_WITH(xcomposite,[test "x$ac_cv_lib_soname_Xcomposite" = "x"], - [libxcomposite development files not found, Xcomposite won't be supported.]) + [libxcomposite ${notice_platform}development files not found, Xcomposite won't be supported.]) dnl *** Check for XICCallback struct AC_CHECK_MEMBERS([XICCallback.callback],,, @@ -796,7 +797,7 @@ This probably prevents linking to OpenGL. Try deleting the file and restarting c WINE_CHECK_SONAME(GLU,gluLookAt,,,[$OPENGL_LIBS $X_LIBS $X_PRE_LIBS -lXext -lX11 -lm $X_EXTRA_LIBS]) fi WINE_NOTICE_WITH(glu,[test "x$ac_cv_lib_soname_GLU" = "x"], - [libGLU development files not found, GLU won't be supported.]) + [libGLU ${notice_platform}development files not found, GLU won't be supported.]) else opengl_msg="Old Mesa headers detected. Consider upgrading your Mesa libraries." fi @@ -869,7 +870,7 @@ then CPPFLAGS="$ac_save_CPPFLAGS" fi WINE_WARNING_WITH(xml,[test "$ac_cv_lib_xml2_xmlParseMemory" != "yes"], - [libxml2 development files not found, XML won't be supported.]) + [libxml2 ${notice_platform}development files not found, XML won't be supported.]) if test "x$with_xslt" != "xno" then @@ -901,7 +902,7 @@ then fi fi WINE_WARNING_WITH(xslt,[test "$ac_cv_lib_xslt_xsltCompilePattern" != "yes"], - [libxslt development files not found, xslt won't be supported.]) + [libxslt ${notice_platform}development files not found, xslt won't be supported.]) dnl **** Check for libhal **** AC_SUBST(HALINCL,"") @@ -921,7 +922,7 @@ then CPPFLAGS="$ac_save_CPPFLAGS" fi WINE_NOTICE_WITH(hal,[test "x$ac_cv_lib_soname_hal" = "x"], - [libhal development files not found, no dynamic device support.]) + [libhal ${notice_platform}development files not found, no dynamic device support.]) dnl **** Check for libgnutls **** if test "x$with_gnutls" != "xno" -a "$PKG_CONFIG" != "false" @@ -931,12 +932,13 @@ then ac_gnutls_cflags="`$PKG_CONFIG --cflags gnutls 2>/dev/null`" CPPFLAGS="$CPPFLAGS $ac_gnutls_cflags" AC_CHECK_HEADER(gnutls/gnutls.h, - [WINE_CHECK_SONAME(gnutls,gnutls_global_init, - [AC_SUBST(GNUTLSINCL,"$ac_gnutls_cflags")],,[$ac_gnutls_libs])]) + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[typeof(gnutls_transport_set_errno) *pfunc;]])], + [WINE_CHECK_SONAME(gnutls,gnutls_global_init, + [AC_SUBST(GNUTLSINCL,"$ac_gnutls_cflags")],,[$ac_gnutls_libs])])]) CPPFLAGS="$ac_save_CPPFLAGS" fi WINE_NOTICE_WITH(gnutls,[test "x$ac_cv_lib_soname_gnutls" = "x"], - [libgnutls development files not found, no schannel support.]) + [libgnutls ${notice_platform}development files not found, no schannel support.]) dnl **** Check which curses lib to use *** CURSESLIBS="" @@ -952,7 +954,7 @@ LIBS="$LIBS $CURSESLIBS" AC_CHECK_FUNCS(mousemask) LIBS="$ac_save_LIBS" WINE_NOTICE_WITH(curses,[test "x$ac_cv_lib_soname_curses$ac_cv_lib_soname_ncurses" = "x"], - [lib(n)curses development files not found, curses won't be supported.]) + [lib(n)curses ${notice_platform}development files not found, curses won't be supported.]) dnl **** Check for SANE **** AC_CHECK_PROG(sane_devel,sane-config,sane-config,no) @@ -967,7 +969,7 @@ then CPPFLAGS="$ac_save_CPPFLAGS" fi WINE_NOTICE_WITH(sane,[test "x$ac_cv_lib_soname_sane" = "x"], - [libsane development files not found, scanners won't be supported.]) + [libsane ${notice_platform}development files not found, scanners won't be supported.]) dnl **** Check for libgphoto2 **** AC_CHECK_PROG(gphoto2_devel,gphoto2-config,gphoto2-config,no) @@ -994,7 +996,7 @@ then CPPFLAGS="$ac_save_CPPFLAGS" fi WINE_NOTICE_WITH(gphoto,[test "$ac_cv_lib_gphoto2_gp_camera_new" != "yes"], - [libgphoto2 development files not found, digital cameras won't be supported.]) + [libgphoto2 ${notice_platform}development files not found, digital cameras won't be supported.]) dnl **** Check for resolver library *** @@ -1015,7 +1017,7 @@ then LCMSLIBS="-llcms"]) fi WINE_NOTICE_WITH(cms,[test "$ac_cv_lib_lcms_cmsOpenProfileFromFile" != "yes"], - [liblcms development files not found, Color Management won't be supported.]) + [liblcms ${notice_platform}development files not found, Color Management won't be supported.]) dnl **** Check for FreeType 2 **** AC_CHECK_PROGS(ft_devel,[freetype-config freetype2-config],false) @@ -1175,7 +1177,7 @@ then WINE_CHECK_SONAME(capi20,capi20_register) fi WINE_NOTICE_WITH(capi,[test "x$ac_cv_lib_soname_capi20" = "x"], - [libcapi20 development files not found, ISDN won't be supported.]) + [libcapi20 ${notice_platform}development files not found, ISDN won't be supported.]) dnl **** Check for cups **** AC_SUBST(CUPSINCL,"") @@ -1192,7 +1194,7 @@ then CPPFLAGS="$ac_save_CPPFLAGS" fi WINE_NOTICE_WITH(cups,[test "x$ac_cv_lib_soname_cups" = "x"], - [libcups development files not found, CUPS won't be supported.]) + [libcups ${notice_platform}development files not found, CUPS won't be supported.]) dnl **** Check for jack **** if test "$ac_cv_header_jack_jack_h" = "yes" @@ -1219,7 +1221,7 @@ then fi fi WINE_NOTICE_WITH(fontconfig,[test "x$ac_cv_lib_soname_fontconfig" = "x"], - [fontconfig development files not found, fontconfig won't be supported.]) + [fontconfig ${notice_platform}development files not found, fontconfig won't be supported.]) dnl **** Check for SSL **** if test "$ac_cv_header_openssl_err_h" = "yes" -a "$ac_cv_header_openssl_ssl_h" = "yes" @@ -1228,7 +1230,7 @@ then WINE_CHECK_SONAME(crypto,BIO_new_socket) fi WINE_WARNING_WITH(openssl,[test "x$ac_cv_lib_soname_ssl" = "x" -o "x$ac_cv_lib_soname_crypto" = "x"], - [OpenSSL development files not found, SSL won't be supported.]) + [OpenSSL ${notice_platform}development files not found, SSL won't be supported.]) dnl **** Check for libjpeg **** if test "$ac_cv_header_jpeglib_h" = "yes" @@ -1236,7 +1238,7 @@ then WINE_CHECK_SONAME(jpeg,jpeg_start_decompress) fi WINE_WARNING_WITH(jpeg,[test "x$ac_cv_lib_soname_jpeg" = "x"], - [libjpeg development files not found, JPEG won't be supported.]) + [libjpeg ${notice_platform}development files not found, JPEG won't be supported.]) dnl **** Check for libpng **** if test "$ac_cv_header_png_h" = "yes" @@ -1244,7 +1246,7 @@ then WINE_CHECK_SONAME(png,png_create_read_struct,,,-lm,[[libpng[[0-9]]*]]) fi WINE_WARNING_WITH(png,[test "x$ac_cv_lib_soname_png" = "x"], - [libpng development files not found, PNG won't be supported.]) + [libpng ${notice_platform}development files not found, PNG won't be supported.]) dnl **** Check for libodbc **** WINE_CHECK_SONAME(odbc,SQLConnect,,[AC_DEFINE_UNQUOTED(SONAME_LIBODBC,["libodbc.$LIBEXT"])]) @@ -1520,7 +1522,7 @@ then [$LDAPLIBS $LIBPTHREAD]) fi WINE_NOTICE_WITH(ldap,[test "x$LDAPLIBS" = "x"], - [libldap (OpenLDAP) development files not found, LDAP won't be supported.]) + [libldap (OpenLDAP) ${notice_platform}development files not found, LDAP won't be supported.]) dnl **** Check for types **** @@ -1862,6 +1864,7 @@ WINE_CONFIG_MAKEFILE([dlls/dwmapi/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL WINE_CONFIG_MAKEFILE([dlls/dxdiagn/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/dxerr8/Makefile],[dlls/Makeimplib.rules],[dlls],[ALL_IMPLIB_DIRS]) WINE_CONFIG_MAKEFILE([dlls/dxerr9/Makefile],[dlls/Makeimplib.rules],[dlls],[ALL_IMPLIB_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/dxgi/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/dxguid/Makefile],[dlls/Makeimplib.rules],[dlls],[ALL_IMPLIB_DIRS]) WINE_CONFIG_MAKEFILE([dlls/faultrep/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/fusion/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) diff --git a/dlls/Makefile.in b/dlls/Makefile.in index 12f6584e4a6..69d30b9f367 100644 --- a/dlls/Makefile.in +++ b/dlls/Makefile.in @@ -218,6 +218,7 @@ IMPORT_LIBS = \ dpnet/libdpnet.$(IMPLIBEXT) \ dsound/libdsound.$(IMPLIBEXT) \ dwmapi/libdwmapi.$(IMPLIBEXT) \ + dxgi/libdxgi.$(IMPLIBEXT) \ gdi32/libgdi32.$(IMPLIBEXT) \ gdiplus/libgdiplus.$(IMPLIBEXT) \ glu32/libglu32.$(IMPLIBEXT) \ @@ -355,6 +356,7 @@ CROSS_IMPLIBS = \ dpnet/libdpnet.a \ dsound/libdsound.a \ dwmapi/libdwmapi.a \ + dxgi/libdxgi.a \ gdi32/libgdi32.a \ gdiplus/libgdiplus.a \ glu32/libglu32.a \ @@ -581,6 +583,9 @@ dsound/libdsound.def dsound/libdsound.a: dsound/dsound.spec $(WINEBUILD) dwmapi/libdwmapi.def dwmapi/libdwmapi.a: dwmapi/dwmapi.spec $(WINEBUILD) @cd dwmapi && $(MAKE) `basename $@` +dxgi/libdxgi.def dxgi/libdxgi.a: dxgi/dxgi.spec $(WINEBUILD) + @cd dxgi && $(MAKE) `basename $@` + gdi32/libgdi32.def gdi32/libgdi32.a: gdi32/gdi32.spec $(WINEBUILD) @cd gdi32 && $(MAKE) `basename $@` diff --git a/dlls/advapi32/security.c b/dlls/advapi32/security.c index 3c2665494e1..2093f7ee6cf 100644 --- a/dlls/advapi32/security.c +++ b/dlls/advapi32/security.c @@ -38,6 +38,7 @@ #include "objbase.h" #include "iads.h" #include "advapi32_misc.h" +#include "lmcons.h" #include "wine/debug.h" #include "wine/unicode.h" @@ -1953,12 +1954,6 @@ LookupAccountSidA( DWORD accountSizeW = *accountSize; DWORD domainSizeW = *domainSize; - TRACE("(%s,sid=%s,%p,%p(%u),%p,%p(%u),%p)\n", - debugstr_a(system),debugstr_sid(sid), - account,accountSize,accountSize?*accountSize:0, - domain,domainSize,domainSize?*domainSize:0, - name_use); - if (system) { len = MultiByteToWideChar( CP_ACP, 0, system, -1, NULL, 0 ); systemW = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ); @@ -2022,6 +2017,7 @@ LookupAccountSidW( const WCHAR * dm = NULL; SID_NAME_USE use = 0; LPWSTR computer_name = NULL; + LPWSTR account_name = NULL; TRACE("(%s,sid=%s,%p,%p(%u),%p,%p(%u),%p)\n", debugstr_w(system),debugstr_sid(sid), @@ -2031,7 +2027,7 @@ LookupAccountSidW( if (!ADVAPI_IsLocalComputer(system)) { FIXME("Only local computer supported!\n"); - SetLastError(ERROR_NONE_MAPPED); + SetLastError(RPC_S_SERVER_UNAVAILABLE); return FALSE; } @@ -2108,6 +2104,16 @@ LookupAccountSidW( case DOMAIN_ALIAS_RID_RAS_SERVERS: ac = RAS_and_IAS_Servers; break; + case 1000: /* first user account */ + size = UNLEN + 1; + account_name = HeapAlloc( + GetProcessHeap(), 0, size * sizeof(WCHAR)); + if (GetUserNameW(account_name, &size)) + ac = account_name; + else + dm = NULL; + + break; default: dm = NULL; break; @@ -2145,10 +2151,12 @@ LookupAccountSidW( else *accountSize = ac_len + 1; *name_use = use; + HeapFree(GetProcessHeap(), 0, account_name); HeapFree(GetProcessHeap(), 0, computer_name); return status; } + HeapFree(GetProcessHeap(), 0, account_name); HeapFree(GetProcessHeap(), 0, computer_name); SetLastError(ERROR_NONE_MAPPED); return FALSE; @@ -2502,8 +2510,8 @@ LookupAccountNameA( if (ret && lpReferencedDomainNameW) { - WideCharToMultiByte(CP_ACP, 0, lpReferencedDomainNameW, *cbReferencedDomainName, - ReferencedDomainName, *cbReferencedDomainName, NULL, NULL); + WideCharToMultiByte(CP_ACP, 0, lpReferencedDomainNameW, -1, + ReferencedDomainName, *cbReferencedDomainName+1, NULL, NULL); } RtlFreeUnicodeString(&lpSystemW); @@ -2526,22 +2534,99 @@ BOOL WINAPI LookupAccountNameW( LPCWSTR lpSystemName, LPCWSTR lpAccountName, PSI PSID pSid; static const WCHAR dm[] = {'D','O','M','A','I','N',0}; unsigned int i; + DWORD nameLen; + LPWSTR userName = NULL; + LPCWSTR domainName; FIXME("%s %s %p %p %p %p %p - stub\n", debugstr_w(lpSystemName), debugstr_w(lpAccountName), Sid, cbSid, ReferencedDomainName, cchReferencedDomainName, peUse); + if (!ADVAPI_IsLocalComputer(lpSystemName)) + { + SetLastError(RPC_S_SERVER_UNAVAILABLE); + return FALSE; + } + + if (!lpAccountName || !strcmpW(lpAccountName, Blank)) + { + lpAccountName = BUILTIN; + } + + /* Check well known SIDs first */ + 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); + DWORD sidLen = SECURITY_MAX_SID_SIZE; + + pSid = HeapAlloc(GetProcessHeap(), 0, sidLen); + + ret = CreateWellKnownSid(ACCOUNT_SIDS[i].type, NULL, pSid, &sidLen); + + if (ret) + { + if (*cbSid < sidLen) + { + SetLastError(ERROR_INSUFFICIENT_BUFFER); + ret = FALSE; + } + else if (Sid) + { + CopySid(*cbSid, Sid, pSid); + } + + *cbSid = sidLen; + } + + domainName = ACCOUNT_SIDS[i].domain; + nameLen = strlenW(domainName); + + if (*cchReferencedDomainName <= nameLen || !ret) + { + SetLastError(ERROR_INSUFFICIENT_BUFFER); + nameLen += 1; + ret = FALSE; + } + else if (ReferencedDomainName && domainName) + { + strcpyW(ReferencedDomainName, domainName); + } + + *cchReferencedDomainName = nameLen; + + if (ret) + { + *peUse = ACCOUNT_SIDS[i].name_use; + } + + HeapFree(GetProcessHeap(), 0, pSid); + + return ret; } } + /* Let the current Unix user id masquerade as first Windows user account */ + + nameLen = UNLEN + 1; + + userName = HeapAlloc(GetProcessHeap(), 0, nameLen); + + ret = GetUserNameW(userName, &nameLen); + + if (ret && strcmpW(lpAccountName, userName) != 0) + { + SetLastError(ERROR_NONE_MAPPED); + ret = FALSE; + } + + HeapFree(GetProcessHeap(), 0, userName); + + if (!ret) + { + return ret; + } + ret = AllocateAndInitializeSid(&identifierAuthority, 2, SECURITY_BUILTIN_DOMAIN_RID, @@ -2566,17 +2651,27 @@ BOOL WINAPI LookupAccountNameW( LPCWSTR lpSystemName, LPCWSTR lpAccountName, PSI ret = FALSE; } *cbSid = GetLengthSid(pSid); - - if (ReferencedDomainName != NULL && (*cchReferencedDomainName > strlenW(dm))) - strcpyW(ReferencedDomainName, dm); - if (*cchReferencedDomainName <= strlenW(dm)) + domainName = dm; + nameLen = strlenW(domainName); + + if (*cchReferencedDomainName <= nameLen || !ret) { - SetLastError(ERROR_INSUFFICIENT_BUFFER); - ret = FALSE; + SetLastError(ERROR_INSUFFICIENT_BUFFER); + nameLen += 1; + ret = FALSE; + } + else if (ReferencedDomainName && domainName) + { + strcpyW(ReferencedDomainName, domainName); } - *cchReferencedDomainName = strlenW(dm)+1; + *cchReferencedDomainName = nameLen; + + if (ret) + { + *peUse = SidTypeUser; + } FreeSid(pSid); @@ -3213,7 +3308,7 @@ DWORD WINAPI SetEntriesInAclW( ULONG count, PEXPLICIT_ACCESSW pEntries, case TRUSTEE_IS_NAME: { DWORD sid_size = FIELD_OFFSET(SID, SubAuthority[SID_MAX_SUB_AUTHORITIES]); - DWORD domain_size = 0; + DWORD domain_size = MAX_COMPUTERNAME_LENGTH + 1; SID_NAME_USE use; if (!LookupAccountNameW(NULL, pEntries[i].Trustee.ptstrName, ppsid[i], &sid_size, NULL, &domain_size, &use)) { diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c index f0d7adef544..d4f532d9b89 100644 --- a/dlls/advapi32/tests/security.c +++ b/dlls/advapi32/tests/security.c @@ -1314,6 +1314,14 @@ static void test_LookupAccountSid(void) ret = LookupAccountSidW(NULL, pUsersSid, accountW, &real_acc_sizeW, domainW, &real_dom_sizeW, &use); ok(ret, "LookupAccountSidW() Expected TRUE, got FALSE\n"); + /* try an invalid system name */ + real_acc_sizeA = MAX_PATH; + real_dom_sizeA = MAX_PATH; + ret = LookupAccountSidA("deepthought", pUsersSid, accountA, &real_acc_sizeA, domainA, &real_dom_sizeA, &use); + ok(!ret, "LookupAccountSidA() Expected FALSE got TRUE\n"); + ok(GetLastError() == RPC_S_SERVER_UNAVAILABLE, + "LookupAccountSidA() Expected RPC_S_SERVER_UNAVAILABLE, got %u\n", GetLastError()); + /* native windows crashes if domainW or accountW is NULL */ /* try a small account buffer */ @@ -1554,10 +1562,10 @@ static void test_LookupAccountName(void) { ok(!lstrcmp(account, user_name), "Expected %s, got %s\n", user_name, account); ok(!lstrcmp(domain, sid_dom), "Expected %s, got %s\n", sid_dom, domain); - ok(domain_size == domain_save - 1, "Expected %d, got %d\n", domain_save - 1, domain_size); - ok(lstrlen(domain) == domain_size, "Expected %d\n", lstrlen(domain)); - ok(sid_use == SidTypeUser, "Expected SidTypeUser, got %d\n", sid_use); } + ok(domain_size == domain_save - 1, "Expected %d, got %d\n", domain_save - 1, domain_size); + ok(lstrlen(domain) == domain_size, "Expected %d, got %d\n", lstrlen(domain), domain_size); + ok(sid_use == SidTypeUser, "Expected SidTypeUser (%d), got %d\n", SidTypeUser, sid_use); domain_size = domain_save; sid_size = sid_save; @@ -1572,12 +1580,10 @@ static void test_LookupAccountName(void) 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); + ok(sid_use == SidTypeWellKnownGroup, "Expected SidTypeWellKnownGroup (%d), got %d\n", SidTypeWellKnownGroup, sid_use); domain_size = domain_save; } @@ -1634,14 +1640,11 @@ static void test_LookupAccountName(void) ret = LookupAccountNameA(NULL, NULL, psid, &sid_size, domain, &domain_size, &sid_use); get_sid_info(psid, &account, &sid_dom); ok(ret, "Failed to lookup account name\n"); - todo_wine - { - /* Using a fixed string will not work on different locales */ - ok(!lstrcmp(account, domain), - "Got %s for account and %s for domain, these should be the same\n", - account, domain); - ok(sid_use == SidTypeDomain, "Expected SidTypeDomain, got %d\n", SidTypeDomain); - } + /* Using a fixed string will not work on different locales */ + ok(!lstrcmp(account, domain), + "Got %s for account and %s for domain, these should be the same\n", + account, domain); + ok(sid_use == SidTypeDomain, "Expected SidTypeDomain (%d), got %d\n", SidTypeDomain, sid_use); /* try an invalid account name */ SetLastError(0xdeadbeef); @@ -1649,14 +1652,22 @@ static void test_LookupAccountName(void) domain_size = 0; ret = LookupAccountNameA(NULL, "oogabooga", NULL, &sid_size, NULL, &domain_size, &sid_use); ok(!ret, "Expected 0, got %d\n", ret); - todo_wine - { - ok(GetLastError() == ERROR_NONE_MAPPED || - broken(GetLastError() == ERROR_TRUSTED_RELATIONSHIP_FAILURE), - "Expected ERROR_NONE_MAPPED, got %d\n", GetLastError()); - ok(sid_size == 0, "Expected 0, got %d\n", sid_size); - ok(domain_size == 0, "Expected 0, got %d\n", domain_size); - } + ok(GetLastError() == ERROR_NONE_MAPPED || + broken(GetLastError() == ERROR_TRUSTED_RELATIONSHIP_FAILURE), + "Expected ERROR_NONE_MAPPED, got %d\n", GetLastError()); + ok(sid_size == 0, "Expected 0, got %d\n", sid_size); + ok(domain_size == 0, "Expected 0, got %d\n", domain_size); + + /* try an invalid system name */ + SetLastError(0xdeadbeef); + sid_size = 0; + domain_size = 0; + ret = LookupAccountNameA("deepthought", NULL, NULL, &sid_size, NULL, &domain_size, &sid_use); + ok(!ret, "Expected 0, got %d\n", ret); + ok(GetLastError() == RPC_S_SERVER_UNAVAILABLE, + "Expected RPC_S_SERVER_UNAVAILABLE, got %d\n", GetLastError()); + ok(sid_size == 0, "Expected 0, got %d\n", sid_size); + ok(domain_size == 0, "Expected 0, got %d\n", domain_size); HeapFree(GetProcessHeap(), 0, psid); HeapFree(GetProcessHeap(), 0, domain); @@ -2431,6 +2442,95 @@ static void test_ConvertSecurityDescriptorToString() } } +static void test_SetSecurityDescriptorControl (PSECURITY_DESCRIPTOR sec) +{ + SECURITY_DESCRIPTOR_CONTROL ref; + SECURITY_DESCRIPTOR_CONTROL test; + + SECURITY_DESCRIPTOR_CONTROL const mutable + = SE_DACL_AUTO_INHERIT_REQ | SE_SACL_AUTO_INHERIT_REQ + | SE_DACL_AUTO_INHERITED | SE_SACL_AUTO_INHERITED + | SE_DACL_PROTECTED | SE_SACL_PROTECTED + | 0x00000040 | 0x00000080 /* not defined in winnt.h */ + ; + SECURITY_DESCRIPTOR_CONTROL const immutable + = SE_OWNER_DEFAULTED | SE_GROUP_DEFAULTED + | SE_DACL_PRESENT | SE_DACL_DEFAULTED + | SE_SACL_PRESENT | SE_SACL_DEFAULTED + | SE_RM_CONTROL_VALID | SE_SELF_RELATIVE + ; + + int bit; + DWORD dwRevision; + LPCSTR fmt = "Expected error %s, got %u\n"; + + GetSecurityDescriptorControl (sec, &ref, &dwRevision); + + /* The mutable bits are mutable regardless of the truth of + SE_DACL_PRESENT and/or SE_SACL_PRESENT */ + + /* Check call barfs if any bit-of-interest is immutable */ + for (bit = 0; bit < 16; ++bit) + { + SECURITY_DESCRIPTOR_CONTROL const bitOfInterest = 1 << bit; + SECURITY_DESCRIPTOR_CONTROL setOrClear = ref & bitOfInterest; + + SECURITY_DESCRIPTOR_CONTROL ctrl; + + DWORD dwExpect = (bitOfInterest & immutable) + ? ERROR_INVALID_PARAMETER : 0xbebecaca; + LPCSTR strExpect = (bitOfInterest & immutable) + ? "ERROR_INVALID_PARAMETER" : "0xbebecaca"; + + ctrl = (bitOfInterest & mutable) ? ref + bitOfInterest : ref; + setOrClear ^= bitOfInterest; + SetLastError (0xbebecaca); + pSetSecurityDescriptorControl (sec, bitOfInterest, setOrClear); + ok (GetLastError () == dwExpect, fmt, strExpect, GetLastError ()); + GetSecurityDescriptorControl(sec, &test, &dwRevision); + expect_eq(test, ctrl, int, "%x"); + + ctrl = ref; + setOrClear ^= bitOfInterest; + SetLastError (0xbebecaca); + pSetSecurityDescriptorControl (sec, bitOfInterest, setOrClear); + ok (GetLastError () == dwExpect, fmt, strExpect, GetLastError ()); + GetSecurityDescriptorControl (sec, &test, &dwRevision); + expect_eq(test, ref, int, "%x"); + } + + /* Check call barfs if any bit-to-set is immutable + even when not a bit-of-interest */ + for (bit = 0; bit < 16; ++bit) + { + SECURITY_DESCRIPTOR_CONTROL const bitsOfInterest = mutable; + SECURITY_DESCRIPTOR_CONTROL setOrClear = ref & bitsOfInterest; + + SECURITY_DESCRIPTOR_CONTROL ctrl; + + DWORD dwExpect = ((1 << bit) & immutable) + ? ERROR_INVALID_PARAMETER : 0xbebecaca; + LPCSTR strExpect = ((1 << bit) & immutable) + ? "ERROR_INVALID_PARAMETER" : "0xbebecaca"; + + ctrl = ((1 << bit) & immutable) ? test : ref | mutable; + setOrClear ^= bitsOfInterest; + SetLastError (0xbebecaca); + pSetSecurityDescriptorControl (sec, bitsOfInterest, setOrClear | (1 << bit)); + ok (GetLastError () == dwExpect, fmt, strExpect, GetLastError ()); + GetSecurityDescriptorControl(sec, &test, &dwRevision); + expect_eq(test, ctrl, int, "%x"); + + ctrl = ((1 << bit) & immutable) ? test : ref | (1 << bit); + setOrClear ^= bitsOfInterest; + SetLastError (0xbebecaca); + pSetSecurityDescriptorControl (sec, bitsOfInterest, setOrClear | (1 << bit)); + ok (GetLastError () == dwExpect, fmt, strExpect, GetLastError ()); + GetSecurityDescriptorControl(sec, &test, &dwRevision); + expect_eq(test, ctrl, int, "%x"); + } +} + static void test_PrivateObjectSecurity(void) { SECURITY_INFORMATION sec_info = OWNER_SECURITY_INFORMATION|GROUP_SECURITY_INFORMATION|DACL_SECURITY_INFORMATION|SACL_SECURITY_INFORMATION; @@ -2452,12 +2552,33 @@ static void test_PrivateObjectSecurity(void) ok(pConvertStringSecurityDescriptorToSecurityDescriptorA( "O:SY" "G:S-1-5-21-93476-23408-4576" + "D:(A;NP;GAGXGWGR;;;SU)(A;IOID;CCDC;;;SU)" + "(D;OICI;0xffffffff;;;S-1-5-21-93476-23408-4576)" + "S:(AU;OICINPIOIDSAFA;CCDCLCSWRPRC;;;SU)(AU;NPSA;0x12019f;;;SU)", + SDDL_REVISION_1, &sec, &dwDescSize), "Creating descriptor failed\n"); + + test_SetSecurityDescriptorControl(sec); + + LocalFree(sec); + + ok(pConvertStringSecurityDescriptorToSecurityDescriptorA( + "O:SY" + "G:S-1-5-21-93476-23408-4576", + SDDL_REVISION_1, &sec, &dwDescSize), "Creating descriptor failed\n"); + + test_SetSecurityDescriptorControl(sec); + + LocalFree(sec); + + ok(pConvertStringSecurityDescriptorToSecurityDescriptorA( + "O:SY" + "G:S-1-5-21-93476-23408-4576" "D:(A;NP;GAGXGWGR;;;SU)(A;IOID;CCDC;;;SU)(D;OICI;0xffffffff;;;S-1-5-21-93476-23408-4576)" "S:(AU;OICINPIOIDSAFA;CCDCLCSWRPRC;;;SU)(AU;NPSA;0x12019f;;;SU)", SDDL_REVISION_1, &sec, &dwDescSize), "Creating descriptor failed\n"); buf = HeapAlloc(GetProcessHeap(), 0, dwDescSize); pSetSecurityDescriptorControl(sec, SE_DACL_PROTECTED, SE_DACL_PROTECTED); GetSecurityDescriptorControl(sec, &ctrl, &dwRevision); - todo_wine expect_eq(ctrl, 0x9014, int, "%x"); + expect_eq(ctrl, 0x9014, int, "%x"); ok(GetPrivateObjectSecurity(sec, GROUP_SECURITY_INFORMATION, buf, dwDescSize, &retSize), "GetPrivateObjectSecurity failed (err=%u)\n", GetLastError()); diff --git a/dlls/advpack/tests/advpack.c b/dlls/advpack/tests/advpack.c index 58038f70d40..8615850ab38 100644 --- a/dlls/advpack/tests/advpack.c +++ b/dlls/advpack/tests/advpack.c @@ -264,7 +264,7 @@ static void translateinfstring_test(void) if(hr == HRESULT_FROM_WIN32(ERROR_MOD_NOT_FOUND)) { - trace("WinNT 3.51 detected. Skipping tests for TranslateInfString()\n"); + win_skip("WinNT 3.51 detected. Skipping tests for TranslateInfString()\n"); return; } diff --git a/dlls/appwiz.cpl/Ko.rc b/dlls/appwiz.cpl/Ko.rc new file mode 100644 index 00000000000..1399b1f819e --- /dev/null +++ b/dlls/appwiz.cpl/Ko.rc @@ -0,0 +1,79 @@ +/* +* Add/Remove Programs Korean resources +* +* Copyright 2001-2002, 2008 Owen Rudge +* Copyright 2008 YunSong Hwang +* +* 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_KOREAN, SUBLANG_NEUTRAL + +STRINGTABLE +{ + IDS_CPL_TITLE, "ÇÁ·Î±×·¥ Ãß°¡/»èÁ¦" + IDS_CPL_DESC, "»õ ¼ÒÇÁÆ®¿þ¾î¸¦ ¼³Ä¡Çϰųª,ÀÌ¹Ì ¼³Ä¡µÈ ¼ÒÇÁÆ®¿þ¾î¸¦ ´ç½ÅÀÇ ÄÄÇ»ÅÍ¿¡¼­ »èÁ¦ ÇÒ ¼ö ÀÖ½À´Ï´Ù." + IDS_TAB1_TITLE, "ÇÁ·Î±×·¥" + + IDS_UNINSTALL_FAILED, "¾ðÀνºÅç·¯¸¦ ½ÇÇàÇÒ ¼ö ¾ø½À´Ï´Ù, '%s'. ´ç½ÅÀº ÀÌ ÇÁ·Î±×·¥ÀÇ ¾ðÀνºÅç Á¤º¸¸¦ ·¹Áö½ºÆ®¸®¿¡¼­ Áö¿ì°Ú½À´Ï±î?" + + IDS_COLUMN_NAME, "À̸§" + IDS_COLUMN_PUBLISHER, "Á¦ÀÛ»ç" + IDS_COLUMN_VERSION, "¹öÁ¯" +} + +/* TODO: it's best to use the constant WC_LISTVIEW instead of SysListView32 directly, but the Wine resource compiler doesn't seem to like that... */ + +IDD_MAIN DIALOG 0, 0, 320, 220 +STYLE DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "¼³Ä¡/»èÁ¦" +FONT 8, "MS Sans Serif" +{ + CONTROL "Ç÷ÎÇÇ µð½ºÅ©³ª ½Ãµð·ÒÀ̳ª ,Çϵåµð½ºÅ©¿¡¼­ »õ ÇÁ·Î±×·¥À» ¼³Ä¡ÇÏ·Á¸é [¼³Ä¡]¸¦ Ŭ¸¯ÇϽʽÿÀ.", 1000, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 40, 7, 270, 20 + CONTROL "¼³Ä¡(&I)...", IDC_INSTALL, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 246, 26, 64, 14 + CONTROL "", -1, "STATIC", SS_LEFT | SS_SUNKEN | WS_CHILD | WS_VISIBLE, 7, 46, 303, 1 + CONTROL 2, 1001, "STATIC", SS_ICON | WS_CHILD | WS_VISIBLE, 7, 7, 21, 20 + CONTROL "ÀÌ ¼ÒÇÁÆ®¿þ¾î´Â ÀÚµ¿À¸·Î »èÁ¦µÇ¾úÀ» ¼öµµ ÀÖ½À´Ï´Ù.¼³Ä¡µÈ ±¸¼º¿ä¼Ò¸¦ °íÄ¡°Å³ª ÇÁ·Î±×·¥À» Áö¿ì·Á¸é , Ãß°¡/»èÁ¦ ¸ñ·Ï¿¡¼­ ¼±ÅÃÇϽʽÿÀ..", 1002, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 40, 57, 270, 36 + CONTROL "", IDL_PROGRAMS, "SysListView32", LVS_REPORT | LVS_SINGLESEL | LVS_SORTASCENDING | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 7, 90, 303, 100 + CONTROL "Ãß°¡/»èÁ¦(&R)..", IDC_ADDREMOVE, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 246, 198, 64, 14 + CONTROL "Áö¿ø Á¤º¸(&S)...", IDC_SUPPORT_INFO, "button", BS_PUSHBUTTON | BS_CENTER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 176, 198, 64, 14 + CONTROL 3, 1003, "STATIC", SS_ICON | WS_CHILD | WS_VISIBLE, 7, 57, 21, 20 +} + +IDD_INFO DIALOG 0, 0, 256, 138 +STYLE DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "Áö¿ø Á¤º¸" +FONT 8, "MS Sans Serif" +{ + CONTROL "È®ÀÎ", IDOK, "BUTTON", BS_DEFPUSHBUTTON | BS_CENTER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 103, 116, 50, 14 + CONTROL "ÀÌ Á¤º¸´Â %s: ¿¡¼­ ±â¼ú Áö¿øÀ» ¹Þ±â À§ÇØ »ç¿ëµË´Ï´Ù", IDC_INFO_LABEL, "static", SS_LEFT | WS_CHILD | WS_VISIBLE, 12, 9, 228, 19 + CONTROL "Á¦ÀÛ»ç:", -1, "static", SS_LEFT | WS_CHILD | WS_VISIBLE, 16, 30, 60, 8 + CONTROL "¹öÁ¯:", -1, "static", SS_LEFT | WS_CHILD | WS_VISIBLE, 16, 40, 60, 8 + CONTROL "¿¬¶ôó:", -1, "static", SS_LEFT | WS_CHILD | WS_VISIBLE, 16, 50, 60, 8 + CONTROL "Áö¿ø Á¤º¸:", -1, "static", SS_LEFT | WS_CHILD | WS_VISIBLE, 16, 60, 64, 8 + CONTROL "Áö¿ø ÀüÈ­:", -1, "static", SS_LEFT | WS_CHILD | WS_VISIBLE, 16, 70, 68, 8 + CONTROL "ÁÖÀÇ»çÇ×:", -1, "static", SS_LEFT | WS_CHILD | WS_VISIBLE, 16, 80, 60, 8 + CONTROL "Á¦Ç° ¾÷µ¥ÀÌÆ®:", -1, "static", SS_LEFT | WS_CHILD | WS_VISIBLE, 16, 90, 60, 8 + CONTROL "¼³¸í:", -1, "static", SS_LEFT | WS_CHILD | WS_VISIBLE, 16, 100, 60, 8 + CONTROL "", IDC_INFO_PUBLISHER, "static", SS_LEFT | WS_CHILD | WS_VISIBLE, 104, 30, 136, 8 + CONTROL "", IDC_INFO_VERSION, "static", SS_LEFT | WS_CHILD | WS_VISIBLE, 104, 40, 136, 8 + CONTROL "", IDC_INFO_CONTACT, "static", SS_LEFT | WS_CHILD | WS_VISIBLE, 104, 50, 136, 8 + CONTROL "", IDC_INFO_SUPPORT, "static", SS_LEFT | WS_CHILD | WS_VISIBLE, 104, 60, 136, 8 + CONTROL "", IDC_INFO_PHONE, "static", SS_LEFT | WS_CHILD | WS_VISIBLE, 104, 70, 136, 8 + CONTROL "", IDC_INFO_README, "static", SS_LEFT | WS_CHILD | WS_VISIBLE, 104, 80, 136, 8 + CONTROL "", IDC_INFO_UPDATES, "static", SS_LEFT | WS_CHILD | WS_VISIBLE, 104, 90, 136, 8 + CONTROL "", IDC_INFO_COMMENTS, "static", SS_LEFT | WS_CHILD | WS_VISIBLE, 104, 100, 136, 8 +} diff --git a/dlls/appwiz.cpl/appwiz.rc b/dlls/appwiz.cpl/appwiz.rc index 21ceb4bf8f7..a738cdca4dd 100644 --- a/dlls/appwiz.cpl/appwiz.rc +++ b/dlls/appwiz.cpl/appwiz.rc @@ -28,6 +28,7 @@ #include "En.rc" #include "Fr.rc" #include "Ja.rc" +#include "Ko.rc" #include "Nl.rc" #include "No.rc" #include "Ru.rc" diff --git a/dlls/avifil32/acmstream.c b/dlls/avifil32/acmstream.c index 378ff7f7885..7794f54ab06 100644 --- a/dlls/avifil32/acmstream.c +++ b/dlls/avifil32/acmstream.c @@ -1,5 +1,5 @@ /* - * Copyright 2002 Michael Günnewig + * Copyright 2002 Michael Günnewig * * 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/avifil32/api.c b/dlls/avifil32/api.c index 12eb1b7c21f..27744ee56b0 100644 --- a/dlls/avifil32/api.c +++ b/dlls/avifil32/api.c @@ -1,6 +1,6 @@ /* * Copyright 1999 Marcus Meissner - * Copyright 2002-2003 Michael Günnewig + * Copyright 2002-2003 Michael Günnewig * * 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/avifil32/avifile.c b/dlls/avifil32/avifile.c index 7a7b194479b..9f668c6fc98 100644 --- a/dlls/avifil32/avifile.c +++ b/dlls/avifil32/avifile.c @@ -1,6 +1,6 @@ /* * Copyright 1999 Marcus Meissner - * Copyright 2002-2003 Michael Günnewig + * Copyright 2002-2003 Michael Günnewig * * 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/avifil32/avifile_private.h b/dlls/avifil32/avifile_private.h index e4ee9633f8c..db31bd497cf 100644 --- a/dlls/avifil32/avifile_private.h +++ b/dlls/avifil32/avifile_private.h @@ -1,5 +1,5 @@ /* - * Copyright 2002 Michael Günnewig + * Copyright 2002 Michael Günnewig * * 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/avifil32/editstream.c b/dlls/avifil32/editstream.c index de6f2e97260..f2c6e5dfb85 100644 --- a/dlls/avifil32/editstream.c +++ b/dlls/avifil32/editstream.c @@ -1,5 +1,5 @@ /* - * Copyright 2003 Michael Günnewig + * Copyright 2003 Michael Günnewig * * 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/avifil32/extrachunk.c b/dlls/avifil32/extrachunk.c index 5b8762318ed..f875814d8d8 100644 --- a/dlls/avifil32/extrachunk.c +++ b/dlls/avifil32/extrachunk.c @@ -1,5 +1,5 @@ /* - * Copyright 2002 Michael Günnewig + * Copyright 2002 Michael Günnewig * * 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/avifil32/extrachunk.h b/dlls/avifil32/extrachunk.h index 3e097ba09c4..1eda7ef33c3 100644 --- a/dlls/avifil32/extrachunk.h +++ b/dlls/avifil32/extrachunk.h @@ -1,5 +1,5 @@ /* - * Copyright 2002 Michael Günnewig + * Copyright 2002 Michael Günnewig * * 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/avifil32/factory.c b/dlls/avifil32/factory.c index 6d9afa31a59..d1246e8e99c 100644 --- a/dlls/avifil32/factory.c +++ b/dlls/avifil32/factory.c @@ -1,5 +1,5 @@ /* - * Copyright 2002 Michael Günnewig + * Copyright 2002 Michael Günnewig * * 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/avifil32/getframe.c b/dlls/avifil32/getframe.c index fd3ec561a95..428901e8e34 100644 --- a/dlls/avifil32/getframe.c +++ b/dlls/avifil32/getframe.c @@ -1,5 +1,5 @@ /* - * Copyright 2002-2003 Michael Günnewig + * Copyright 2002-2003 Michael Günnewig * * 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/avifil32/icmstream.c b/dlls/avifil32/icmstream.c index a5b221a495b..cb79fa4738a 100644 --- a/dlls/avifil32/icmstream.c +++ b/dlls/avifil32/icmstream.c @@ -1,5 +1,5 @@ /* - * Copyright 2002 Michael Günnewig + * Copyright 2002 Michael Günnewig * * 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/avifil32/tmpfile.c b/dlls/avifil32/tmpfile.c index 27d9e4f9b25..49b5a0a91bb 100644 --- a/dlls/avifil32/tmpfile.c +++ b/dlls/avifil32/tmpfile.c @@ -1,5 +1,5 @@ /* - * Copyright 2003 Michael Günnewig + * Copyright 2003 Michael Günnewig * * 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/avifil32/wavfile.c b/dlls/avifil32/wavfile.c index b9779e366c8..d67ea7e89f9 100644 --- a/dlls/avifil32/wavfile.c +++ b/dlls/avifil32/wavfile.c @@ -1,5 +1,5 @@ /* - * Copyright 2002 Michael Günnewig + * Copyright 2002 Michael Günnewig * * 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/comctl32/animate.c b/dlls/comctl32/animate.c index 0dd25f8208a..2b9a80f06d4 100644 --- a/dlls/comctl32/animate.c +++ b/dlls/comctl32/animate.c @@ -817,7 +817,7 @@ static BOOL ANIMATE_Create(HWND hWnd, const CREATESTRUCTW *lpcs) } /* allocate memory for info structure */ - infoPtr = (ANIMATE_INFO *)Alloc(sizeof(ANIMATE_INFO)); + infoPtr = Alloc(sizeof(ANIMATE_INFO)); if (!infoPtr) return FALSE; /* store crossref hWnd <-> info structure */ diff --git a/dlls/comctl32/comboex.c b/dlls/comctl32/comboex.c index 32b18ccee89..899760eb899 100644 --- a/dlls/comctl32/comboex.c +++ b/dlls/comctl32/comboex.c @@ -211,7 +211,7 @@ COMBOEX_NotifyItem (COMBOEX_INFO *infoPtr, UINT code, NMCOMBOBOXEXW *hdr) if ((hdr->ceItem.mask & CBEIF_TEXT) && is_textW(wstr)) { len = WideCharToMultiByte (CP_ACP, 0, wstr, -1, 0, 0, NULL, NULL); if (len > 0) { - astr = (LPSTR)Alloc ((len + 1)*sizeof(CHAR)); + astr = Alloc ((len + 1)*sizeof(CHAR)); if (!astr) return 0; WideCharToMultiByte (CP_ACP, 0, wstr, -1, astr, len, 0, 0); hdr->ceItem.pszText = (LPWSTR)astr; @@ -320,7 +320,7 @@ static LPCWSTR COMBOEX_GetText(COMBOEX_INFO *infoPtr, CBE_ITEMDATA *item) if (is_textW(nmce.ceItem.pszText)) { len = MultiByteToWideChar (CP_ACP, 0, (LPSTR)nmce.ceItem.pszText, -1, NULL, 0); - buf = (LPWSTR)Alloc ((len + 1)*sizeof(WCHAR)); + buf = Alloc ((len + 1)*sizeof(WCHAR)); if (buf) MultiByteToWideChar (CP_ACP, 0, (LPSTR)nmce.ceItem.pszText, -1, buf, len); if (nmce.ceItem.mask & CBEIF_DI_SETITEM) { @@ -622,7 +622,7 @@ static INT COMBOEX_InsertItemW (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMW const *ci if (index > infoPtr->nb_items) return -1; /* get zero-filled space and chain it in */ - if(!(item = (CBE_ITEMDATA *)Alloc (sizeof(*item)))) return -1; + if(!(item = Alloc (sizeof(*item)))) return -1; /* locate position to insert new item in */ if (index == infoPtr->nb_items) { @@ -654,7 +654,7 @@ static INT COMBOEX_InsertItemW (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMW const *ci if (is_textW(cit->pszText)) len = strlenW (cit->pszText); if (len > 0) { - item->pszText = (LPWSTR)Alloc ((len + 1)*sizeof(WCHAR)); + item->pszText = Alloc ((len + 1)*sizeof(WCHAR)); if (!item->pszText) { Free(item); return -1; @@ -700,7 +700,7 @@ static INT COMBOEX_InsertItemA (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMA const *ci memcpy(&citW,cit,sizeof(COMBOBOXEXITEMA)); if (cit->mask & CBEIF_TEXT && is_textA(cit->pszText)) { INT len = MultiByteToWideChar (CP_ACP, 0, cit->pszText, -1, NULL, 0); - wstr = (LPWSTR)Alloc ((len + 1)*sizeof(WCHAR)); + wstr = Alloc ((len + 1)*sizeof(WCHAR)); if (!wstr) return -1; MultiByteToWideChar (CP_ACP, 0, cit->pszText, -1, wstr, len); citW.pszText = wstr; @@ -787,7 +787,7 @@ static BOOL COMBOEX_SetItemW (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMW *cit) COMBOEX_FreeText(item); if (is_textW(cit->pszText)) len = strlenW(cit->pszText); if (len > 0) { - item->pszText = (LPWSTR)Alloc ((len + 1)*sizeof(WCHAR)); + item->pszText = Alloc ((len + 1)*sizeof(WCHAR)); if (!item->pszText) return FALSE; strcpyW(item->pszText, cit->pszText); } else if (cit->pszText == LPSTR_TEXTCALLBACKW) @@ -824,7 +824,7 @@ static BOOL COMBOEX_SetItemA (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMA const *cit) memcpy(&citW, cit, sizeof(COMBOBOXEXITEMA)); if ((cit->mask & CBEIF_TEXT) && is_textA(cit->pszText)) { INT len = MultiByteToWideChar (CP_ACP, 0, cit->pszText, -1, NULL, 0); - wstr = (LPWSTR)Alloc ((len + 1)*sizeof(WCHAR)); + wstr = Alloc ((len + 1)*sizeof(WCHAR)); if (!wstr) return FALSE; MultiByteToWideChar (CP_ACP, 0, cit->pszText, -1, wstr, len); citW.pszText = wstr; @@ -976,7 +976,7 @@ static LRESULT COMBOEX_Create (HWND hwnd, CREATESTRUCTA const *cs) INT i; /* allocate memory for info structure */ - infoPtr = (COMBOEX_INFO *)Alloc (sizeof(COMBOEX_INFO)); + infoPtr = Alloc (sizeof(COMBOEX_INFO)); if (!infoPtr) return -1; /* initialize info structure */ @@ -1109,7 +1109,7 @@ static LRESULT COMBOEX_Create (HWND hwnd, CREATESTRUCTA const *cs) * Create an item structure to represent the data in the * EDIT control. It is allocated zero-filled. */ - infoPtr->edit = (CBE_ITEMDATA *)Alloc (sizeof (CBE_ITEMDATA)); + infoPtr->edit = Alloc (sizeof (CBE_ITEMDATA)); if (!infoPtr->edit) { COMBOEX_Destroy(infoPtr); return -1; @@ -1408,7 +1408,7 @@ static LRESULT COMBOEX_DrawItem (COMBOEX_INFO *infoPtr, DRAWITEMSTRUCT const *di item->mask &= ~CBEIF_TEXT; if( (len = GetWindowTextLengthW(infoPtr->hwndEdit)) ) { item->mask |= CBEIF_TEXT; - item->pszText = (LPWSTR)Alloc ((len + 1)*sizeof(WCHAR)); + item->pszText = Alloc ((len + 1)*sizeof(WCHAR)); if (item->pszText) GetWindowTextW(infoPtr->hwndEdit, item->pszText, len+1); diff --git a/dlls/comctl32/commctrl.c b/dlls/comctl32/commctrl.c index 050a018701f..f21aa117e09 100644 --- a/dlls/comctl32/commctrl.c +++ b/dlls/comctl32/commctrl.c @@ -878,7 +878,7 @@ CreateMappedBitmap (HINSTANCE hInstance, INT_PTR idBitmap, UINT wFlags, hglb = LoadResource (hInstance, hRsrc); if (hglb == 0) return 0; - lpBitmap = (LPBITMAPINFOHEADER)LockResource (hglb); + lpBitmap = LockResource (hglb); if (lpBitmap == NULL) return 0; diff --git a/dlls/comctl32/datetime.c b/dlls/comctl32/datetime.c index fddaf21b095..2d44540dbeb 100644 --- a/dlls/comctl32/datetime.c +++ b/dlls/comctl32/datetime.c @@ -1225,7 +1225,7 @@ static LRESULT DATETIME_Create (HWND hwnd, const CREATESTRUCTW *lpcs) { static const WCHAR SysMonthCal32W[] = { 'S', 'y', 's', 'M', 'o', 'n', 't', 'h', 'C', 'a', 'l', '3', '2', 0 }; - DATETIME_INFO *infoPtr = (DATETIME_INFO *)Alloc (sizeof(DATETIME_INFO)); + DATETIME_INFO *infoPtr = Alloc (sizeof(DATETIME_INFO)); STYLESTRUCT ss = { 0, lpcs->style }; if (!infoPtr) return -1; @@ -1234,9 +1234,9 @@ DATETIME_Create (HWND hwnd, const CREATESTRUCTW *lpcs) infoPtr->dwStyle = lpcs->style; infoPtr->nrFieldsAllocated = 32; - infoPtr->fieldspec = (int *) Alloc (infoPtr->nrFieldsAllocated * sizeof(int)); - infoPtr->fieldRect = (RECT *) Alloc (infoPtr->nrFieldsAllocated * sizeof(RECT)); - infoPtr->buflen = (int *) Alloc (infoPtr->nrFieldsAllocated * sizeof(int)); + infoPtr->fieldspec = Alloc (infoPtr->nrFieldsAllocated * sizeof(int)); + infoPtr->fieldRect = Alloc (infoPtr->nrFieldsAllocated * sizeof(RECT)); + infoPtr->buflen = Alloc (infoPtr->nrFieldsAllocated * sizeof(int)); infoPtr->hwndNotify = lpcs->hwndParent; infoPtr->select = -1; /* initially, nothing is selected */ infoPtr->bDropdownEnabled = TRUE; diff --git a/dlls/comctl32/header.c b/dlls/comctl32/header.c index 496df62b0f4..801d339d735 100644 --- a/dlls/comctl32/header.c +++ b/dlls/comctl32/header.c @@ -1454,7 +1454,7 @@ HEADER_Create (HWND hwnd, LPARAM lParam) HFONT hOldFont; HDC hdc; - infoPtr = (HEADER_INFO *)Alloc (sizeof(HEADER_INFO)); + infoPtr = Alloc (sizeof(HEADER_INFO)); SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr); infoPtr->hwndNotify = ((LPCREATESTRUCTA)lParam)->hwndParent; diff --git a/dlls/comctl32/hotkey.c b/dlls/comctl32/hotkey.c index 6e7591a509f..33f39206c7a 100644 --- a/dlls/comctl32/hotkey.c +++ b/dlls/comctl32/hotkey.c @@ -411,7 +411,7 @@ HOTKEY_NCCreate (HWND hwnd, const CREATESTRUCTW *lpcs) dwExStyle | WS_EX_CLIENTEDGE); /* allocate memory for info structure */ - infoPtr = (HOTKEY_INFO *)Alloc (sizeof(HOTKEY_INFO)); + infoPtr = Alloc (sizeof(HOTKEY_INFO)); SetWindowLongPtrW(hwnd, 0, (DWORD_PTR)infoPtr); /* initialize info structure */ diff --git a/dlls/comctl32/imagelist.c b/dlls/comctl32/imagelist.c index ee9d83f3e17..8c2e95f2540 100644 --- a/dlls/comctl32/imagelist.c +++ b/dlls/comctl32/imagelist.c @@ -598,7 +598,7 @@ ImageList_Create (INT cx, INT cy, UINT flags, TRACE("(%d %d 0x%x %d %d)\n", cx, cy, flags, cInitial, cGrow); - himl = (HIMAGELIST)Alloc (sizeof(struct _IMAGELIST)); + himl = Alloc (sizeof(struct _IMAGELIST)); if (!himl) return NULL; diff --git a/dlls/comctl32/ipaddress.c b/dlls/comctl32/ipaddress.c index 0c02daf7090..5d8d9707045 100644 --- a/dlls/comctl32/ipaddress.c +++ b/dlls/comctl32/ipaddress.c @@ -178,7 +178,7 @@ static LRESULT IPADDRESS_Create (HWND hwnd, const CREATESTRUCTA *lpCreate) SetWindowLongW (hwnd, GWL_STYLE, GetWindowLongW(hwnd, GWL_STYLE) & ~WS_BORDER); - infoPtr = (IPADDRESS_INFO *)Alloc (sizeof(IPADDRESS_INFO)); + infoPtr = Alloc (sizeof(IPADDRESS_INFO)); if (!infoPtr) return -1; SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr); diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index 34e6208f9ba..55fb8487738 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -2422,7 +2422,7 @@ static SUBITEM_INFO* LISTVIEW_GetSubItemPtr(HDPA hdpaSubItems, INT nSubItem) /* we should binary search here if need be */ for (i = 1; i < DPA_GetPtrCount(hdpaSubItems); i++) { - lpSubItem = (SUBITEM_INFO *)DPA_GetPtr(hdpaSubItems, i); + lpSubItem = DPA_GetPtr(hdpaSubItems, i); if (lpSubItem->iSubItem == nSubItem) return lpSubItem; } @@ -2607,12 +2607,12 @@ static void ranges_assert(RANGES ranges, LPCSTR desc, const char *func, int line assert (ranges); assert (DPA_GetPtrCount(ranges->hdpa) >= 0); ranges_dump(ranges); - prev = (RANGE *)DPA_GetPtr(ranges->hdpa, 0); + prev = DPA_GetPtr(ranges->hdpa, 0); if (DPA_GetPtrCount(ranges->hdpa) > 0) assert (prev->lower >= 0 && prev->lower < prev->upper); for (i = 1; i < DPA_GetPtrCount(ranges->hdpa); i++) { - curr = (RANGE *)DPA_GetPtr(ranges->hdpa, i); + curr = DPA_GetPtr(ranges->hdpa, i); assert (prev->upper <= curr->lower); assert (curr->lower < curr->upper); prev = curr; @@ -3433,8 +3433,8 @@ static BOOL set_main_item(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem, BOOL } else { - HDPA hdpaSubItems = (HDPA)DPA_GetPtr(infoPtr->hdpaItems, lpLVItem->iItem); - lpItem = (ITEM_INFO *)DPA_GetPtr(hdpaSubItems, 0); + HDPA hdpaSubItems = DPA_GetPtr(infoPtr->hdpaItems, lpLVItem->iItem); + lpItem = DPA_GetPtr(hdpaSubItems, 0); assert (lpItem); } @@ -3574,7 +3574,7 @@ static BOOL set_sub_item(const LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem, if (!(lpLVItem->mask & (LVIF_TEXT | LVIF_IMAGE | LVIF_STATE))) return TRUE; /* get the subitem structure, and create it if not there */ - hdpaSubItems = (HDPA)DPA_GetPtr(infoPtr->hdpaItems, lpLVItem->iItem); + hdpaSubItems = DPA_GetPtr(infoPtr->hdpaItems, lpLVItem->iItem); assert (hdpaSubItems); lpSubItem = LISTVIEW_GetSubItemPtr(hdpaSubItems, lpLVItem->iSubItem); @@ -3588,7 +3588,7 @@ static BOOL set_sub_item(const LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem, /* we could binary search here, if need be...*/ for (i = 1; i < DPA_GetPtrCount(hdpaSubItems); i++) { - tmpSubItem = (SUBITEM_INFO *)DPA_GetPtr(hdpaSubItems, i); + tmpSubItem = DPA_GetPtr(hdpaSubItems, i); if (tmpSubItem->iSubItem > lpLVItem->iSubItem) break; } if (DPA_InsertPtr(hdpaSubItems, i, lpSubItem) == -1) @@ -4506,10 +4506,10 @@ static BOOL LISTVIEW_DeleteAllItems(LISTVIEW_INFO *infoPtr, BOOL destroy) if (!bSuppress) notify_deleteitem(infoPtr, i); if (!(infoPtr->dwStyle & LVS_OWNERDATA)) { - hdpaSubItems = (HDPA)DPA_GetPtr(infoPtr->hdpaItems, i); + hdpaSubItems = DPA_GetPtr(infoPtr->hdpaItems, i); for (j = 0; j < DPA_GetPtrCount(hdpaSubItems); j++) { - hdrItem = (ITEMHDR *)DPA_GetPtr(hdpaSubItems, j); + hdrItem = DPA_GetPtr(hdpaSubItems, j); if (is_textW(hdrItem->pszText)) Free(hdrItem->pszText); Free(hdrItem); } @@ -4627,12 +4627,12 @@ static BOOL LISTVIEW_DeleteColumn(LISTVIEW_INFO *infoPtr, INT nColumn) for (nItem = 0; nItem < infoPtr->nItemCount; nItem++) { - hdpaSubItems = (HDPA)DPA_GetPtr(infoPtr->hdpaItems, nItem); + hdpaSubItems = DPA_GetPtr(infoPtr->hdpaItems, nItem); nSubItem = 0; lpDelItem = 0; for (i = 1; i < DPA_GetPtrCount(hdpaSubItems); i++) { - lpSubItem = (SUBITEM_INFO *)DPA_GetPtr(hdpaSubItems, i); + lpSubItem = DPA_GetPtr(hdpaSubItems, i); if (lpSubItem->iSubItem == nColumn) { nSubItem = i; @@ -4789,7 +4789,7 @@ static BOOL LISTVIEW_DeleteItem(LISTVIEW_INFO *infoPtr, INT nItem) hdpaSubItems = (HDPA)DPA_DeletePtr(infoPtr->hdpaItems, nItem); for (i = 0; i < DPA_GetPtrCount(hdpaSubItems); i++) { - hdrItem = (ITEMHDR *)DPA_GetPtr(hdpaSubItems, i); + hdrItem = DPA_GetPtr(hdpaSubItems, i); if (is_textW(hdrItem->pszText)) Free(hdrItem->pszText); Free(hdrItem); } @@ -4851,8 +4851,8 @@ static BOOL LISTVIEW_EndEditLabelT(LISTVIEW_INFO *infoPtr, LPWSTR pszText, BOOL if (!(infoPtr->dwStyle & LVS_OWNERDATA)) { - HDPA hdpaSubItems = (HDPA)DPA_GetPtr(infoPtr->hdpaItems, infoPtr->nEditLabelItem); - ITEM_INFO* lpItem = (ITEM_INFO *)DPA_GetPtr(hdpaSubItems, 0); + HDPA hdpaSubItems = DPA_GetPtr(infoPtr->hdpaItems, infoPtr->nEditLabelItem); + ITEM_INFO* lpItem = DPA_GetPtr(hdpaSubItems, 0); if (lpItem && lpItem->hdr.pszText == LPSTR_TEXTCALLBACKW) { LISTVIEW_InvalidateItem(infoPtr, infoPtr->nEditLabelItem); @@ -5506,8 +5506,8 @@ static BOOL LISTVIEW_GetItemT(const LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVItem, } /* find the item and subitem structures before we proceed */ - hdpaSubItems = (HDPA)DPA_GetPtr(infoPtr->hdpaItems, lpLVItem->iItem); - lpItem = (ITEM_INFO *)DPA_GetPtr(hdpaSubItems, 0); + hdpaSubItems = DPA_GetPtr(infoPtr->hdpaItems, lpLVItem->iItem); + lpItem = DPA_GetPtr(hdpaSubItems, 0); assert (lpItem); if (isubitem) @@ -6449,8 +6449,8 @@ static INT LISTVIEW_HitTest(const LISTVIEW_INFO *infoPtr, LPLVHITTESTINFO lpht, */ static INT WINAPI LISTVIEW_InsertCompare( LPVOID first, LPVOID second, LPARAM lParam) { - ITEM_INFO* lv_first = (ITEM_INFO*) DPA_GetPtr( (HDPA)first, 0 ); - ITEM_INFO* lv_second = (ITEM_INFO*) DPA_GetPtr( (HDPA)second, 0 ); + ITEM_INFO* lv_first = DPA_GetPtr( (HDPA)first, 0 ); + ITEM_INFO* lv_second = DPA_GetPtr( (HDPA)second, 0 ); INT cmpv = textcmpWT(lv_first->hdr.pszText, lv_second->hdr.pszText, TRUE); /* if we're sorting descending, negate the return value */ @@ -6849,10 +6849,10 @@ static INT LISTVIEW_InsertColumnT(LISTVIEW_INFO *infoPtr, INT nColumn, for (nItem = 0; nItem < infoPtr->nItemCount; nItem++) { - hdpaSubItems = (HDPA)DPA_GetPtr(infoPtr->hdpaItems, nItem); + hdpaSubItems = DPA_GetPtr(infoPtr->hdpaItems, nItem); for (i = 1; i < DPA_GetPtrCount(hdpaSubItems); i++) { - lpSubItem = (SUBITEM_INFO *)DPA_GetPtr(hdpaSubItems, i); + lpSubItem = DPA_GetPtr(hdpaSubItems, i); if (lpSubItem->iSubItem >= nNewColumn) lpSubItem->iSubItem++; } @@ -7731,8 +7731,8 @@ static BOOL LISTVIEW_SetUnicodeFormat( LISTVIEW_INFO *infoPtr, BOOL fUnicode) static INT WINAPI LISTVIEW_CallBackCompare(LPVOID first, LPVOID second, LPARAM lParam) { LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)lParam; - ITEM_INFO* lv_first = (ITEM_INFO*) DPA_GetPtr( (HDPA)first, 0 ); - ITEM_INFO* lv_second = (ITEM_INFO*) DPA_GetPtr( (HDPA)second, 0 ); + ITEM_INFO* lv_first = DPA_GetPtr( (HDPA)first, 0 ); + ITEM_INFO* lv_second = DPA_GetPtr( (HDPA)second, 0 ); /* Forward the call to the client defined callback */ return (infoPtr->pfnCompare)( lv_first->lParam , lv_second->lParam, infoPtr->lParamSort ); @@ -7772,8 +7772,8 @@ static BOOL LISTVIEW_SortItems(LISTVIEW_INFO *infoPtr, PFNLVCOMPARE pfnCompare, if (infoPtr->nFocusedItem >= 0) { - hdpaSubItems = (HDPA)DPA_GetPtr(infoPtr->hdpaItems, infoPtr->nFocusedItem); - lpItem = (ITEM_INFO *)DPA_GetPtr(hdpaSubItems, 0); + hdpaSubItems = DPA_GetPtr(infoPtr->hdpaItems, infoPtr->nFocusedItem); + lpItem = DPA_GetPtr(hdpaSubItems, 0); if (lpItem) lpItem->state |= LVIS_FOCUSED; } /* FIXME: go thorugh selected items and mark them so in lpItem->state */ @@ -7792,8 +7792,8 @@ static BOOL LISTVIEW_SortItems(LISTVIEW_INFO *infoPtr, PFNLVCOMPARE pfnCompare, selectionMarkItem=(infoPtr->nSelectionMark>=0)?DPA_GetPtr(infoPtr->hdpaItems, infoPtr->nSelectionMark):NULL; for (i=0; i < infoPtr->nItemCount; i++) { - hdpaSubItems = (HDPA)DPA_GetPtr(infoPtr->hdpaItems, i); - lpItem = (ITEM_INFO *)DPA_GetPtr(hdpaSubItems, 0); + hdpaSubItems = DPA_GetPtr(infoPtr->hdpaItems, i); + lpItem = DPA_GetPtr(hdpaSubItems, 0); if (lpItem->state & LVIS_SELECTED) { diff --git a/dlls/comctl32/monthcal.c b/dlls/comctl32/monthcal.c index 4125ea17201..6f9da8150fe 100644 --- a/dlls/comctl32/monthcal.c +++ b/dlls/comctl32/monthcal.c @@ -1896,7 +1896,7 @@ MONTHCAL_Create(HWND hwnd, LPARAM lParam) MONTHCAL_INFO *infoPtr; /* allocate memory for info structure */ - infoPtr =(MONTHCAL_INFO*)Alloc(sizeof(MONTHCAL_INFO)); + infoPtr = Alloc(sizeof(MONTHCAL_INFO)); SetWindowLongPtrW(hwnd, 0, (DWORD_PTR)infoPtr); if(infoPtr == NULL) { diff --git a/dlls/comctl32/nativefont.c b/dlls/comctl32/nativefont.c index 22bf2dffb4a..26347a33324 100644 --- a/dlls/comctl32/nativefont.c +++ b/dlls/comctl32/nativefont.c @@ -52,7 +52,7 @@ NATIVEFONT_Create (HWND hwnd, WPARAM wParam, LPARAM lParam) NATIVEFONT_INFO *infoPtr; /* allocate memory for info structure */ - infoPtr = (NATIVEFONT_INFO *)Alloc (sizeof(NATIVEFONT_INFO)); + infoPtr = Alloc (sizeof(NATIVEFONT_INFO)); SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr); /* initialize info structure */ diff --git a/dlls/comctl32/pager.c b/dlls/comctl32/pager.c index 11a78a93d55..079fbfb4801 100644 --- a/dlls/comctl32/pager.c +++ b/dlls/comctl32/pager.c @@ -801,7 +801,7 @@ PAGER_Create (HWND hwnd, const CREATESTRUCTW *lpcs) PAGER_INFO *infoPtr; /* allocate memory for info structure */ - infoPtr = (PAGER_INFO *)Alloc (sizeof(PAGER_INFO)); + infoPtr = Alloc (sizeof(PAGER_INFO)); if (!infoPtr) return -1; SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr); diff --git a/dlls/comctl32/progress.c b/dlls/comctl32/progress.c index d29fec5b18d..776345ffda1 100644 --- a/dlls/comctl32/progress.c +++ b/dlls/comctl32/progress.c @@ -567,7 +567,7 @@ static LRESULT WINAPI ProgressWindowProc(HWND hwnd, UINT message, SWP_FRAMECHANGED | SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE); /* allocate memory for info struct */ - infoPtr = (PROGRESS_INFO *)Alloc (sizeof(PROGRESS_INFO)); + infoPtr = Alloc (sizeof(PROGRESS_INFO)); if (!infoPtr) return -1; SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr); diff --git a/dlls/comctl32/propsheet.c b/dlls/comctl32/propsheet.c index f33bd547d54..b463dfd06b9 100644 --- a/dlls/comctl32/propsheet.c +++ b/dlls/comctl32/propsheet.c @@ -441,7 +441,7 @@ static BOOL PROPSHEET_CollectPageInfo(LPCPROPSHEETPAGEW lppsp, (LPWSTR)RT_DIALOG); HGLOBAL hTemplate = LoadResource(lppsp->hInstance, hResource); - pTemplate = (LPDLGTEMPLATEW)LockResource(hTemplate); + pTemplate = LockResource(hTemplate); } else { @@ -450,7 +450,7 @@ static BOOL PROPSHEET_CollectPageInfo(LPCPROPSHEETPAGEW lppsp, (LPSTR)RT_DIALOG); HGLOBAL hTemplate = LoadResource(lppsp->hInstance, hResource); - pTemplate = (LPDLGTEMPLATEA)LockResource(hTemplate); + pTemplate = LockResource(hTemplate); } /* @@ -1412,7 +1412,7 @@ static BOOL PROPSHEET_CreatePage(HWND hwndParent, if(!hTemplate) return FALSE; - pTemplate = (LPDLGTEMPLATEW)LockResource(hTemplate); + pTemplate = LockResource(hTemplate); /* * Make a copy of the dialog template to make it writable */ @@ -1434,7 +1434,7 @@ static BOOL PROPSHEET_CreatePage(HWND hwndParent, if(!hTemplate) return FALSE; - pTemplate = (LPDLGTEMPLATEA)LockResource(hTemplate); + pTemplate = LockResource(hTemplate); /* * Make a copy of the dialog template to make it writable */ @@ -2277,9 +2277,7 @@ static BOOL PROPSHEET_AddPage(HWND hwndDlg, /* * Allocate and fill in a new PropPageInfo entry. */ - ppi = (PropPageInfo*) ReAlloc(psInfo->proppage, - sizeof(PropPageInfo) * - (psInfo->nPages + 1)); + ppi = ReAlloc(psInfo->proppage, sizeof(PropPageInfo) * (psInfo->nPages + 1)); if (!ppi) return FALSE; @@ -2829,8 +2827,7 @@ INT_PTR WINAPI PropertySheetA(LPCPROPSHEETHEADERA lppsh) PROPSHEET_CollectSheetInfoA(lppsh, psInfo); - psInfo->proppage = (PropPageInfo*) Alloc(sizeof(PropPageInfo) * - lppsh->nPages); + psInfo->proppage = Alloc(sizeof(PropPageInfo) * lppsh->nPages); pByte = (const BYTE*) psInfo->ppshheader.u3.ppsp; for (n = i = 0; i < lppsh->nPages; i++, n++) @@ -2872,8 +2869,7 @@ INT_PTR WINAPI PropertySheetW(LPCPROPSHEETHEADERW lppsh) PROPSHEET_CollectSheetInfoW(lppsh, psInfo); - psInfo->proppage = (PropPageInfo*) Alloc(sizeof(PropPageInfo) * - lppsh->nPages); + psInfo->proppage = Alloc(sizeof(PropPageInfo) * lppsh->nPages); pByte = (const BYTE*) psInfo->ppshheader.u3.ppsp; for (n = i = 0; i < lppsh->nPages; i++, n++) @@ -3414,7 +3410,7 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) case WM_INITDIALOG: { PropSheetInfo* psInfo = (PropSheetInfo*) lParam; - WCHAR* strCaption = (WCHAR*)Alloc(MAX_CAPTION_LENGTH*sizeof(WCHAR)); + WCHAR* strCaption = Alloc(MAX_CAPTION_LENGTH*sizeof(WCHAR)); HWND hwndTabCtrl = GetDlgItem(hwnd, IDC_TABCONTROL); int idx; LOGFONTW logFont; diff --git a/dlls/comctl32/rebar.c b/dlls/comctl32/rebar.c index e2b8c4f44f7..c8c200f4449 100644 --- a/dlls/comctl32/rebar.c +++ b/dlls/comctl32/rebar.c @@ -2595,8 +2595,7 @@ REBAR_MoveBand (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) } /* allocate new space and copy rest of bands into it */ - infoPtr->bands = - (REBAR_BAND *)Alloc ((infoPtr->uNumBands)*sizeof(REBAR_BAND)); + infoPtr->bands = Alloc ((infoPtr->uNumBands)*sizeof(REBAR_BAND)); /* pre insert copy */ if (uTo > 0) { @@ -3185,7 +3184,7 @@ REBAR_NCCreate (HWND hwnd, LPARAM lParam) } /* allocate memory for info structure */ - infoPtr = (REBAR_INFO *)Alloc (sizeof(REBAR_INFO)); + infoPtr = Alloc (sizeof(REBAR_INFO)); SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr); /* initialize info structure - initial values are 0 */ diff --git a/dlls/comctl32/status.c b/dlls/comctl32/status.c index c1214bbea42..d107329922f 100644 --- a/dlls/comctl32/status.c +++ b/dlls/comctl32/status.c @@ -907,7 +907,7 @@ STATUSBAR_WMCreate (HWND hwnd, const CREATESTRUCTA *lpCreate) int len; TRACE("\n"); - infoPtr = (STATUS_INFO*)Alloc (sizeof(STATUS_INFO)); + infoPtr = Alloc (sizeof(STATUS_INFO)); if (!infoPtr) goto create_fail; SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr); diff --git a/dlls/comctl32/tab.c b/dlls/comctl32/tab.c index 35af81cfb52..e1abd16a6ee 100644 --- a/dlls/comctl32/tab.c +++ b/dlls/comctl32/tab.c @@ -2939,7 +2939,7 @@ static LRESULT TAB_Create (HWND hwnd, WPARAM wParam, LPARAM lParam) HFONT hOldFont; DWORD dwStyle; - infoPtr = (TAB_INFO *)Alloc (sizeof(TAB_INFO)); + infoPtr = Alloc (sizeof(TAB_INFO)); SetWindowLongPtrW(hwnd, 0, (DWORD_PTR)infoPtr); diff --git a/dlls/comctl32/tests/dpa.c b/dlls/comctl32/tests/dpa.c index ae7fcb3897f..08a7b02bd0a 100644 --- a/dlls/comctl32/tests/dpa.c +++ b/dlls/comctl32/tests/dpa.c @@ -454,5 +454,5 @@ START_TEST(dpa) if(InitFunctionPtrs(hcomctl32)) test_dpa(); else - trace("skipping tests\n"); + win_skip("Needed functions are not available\n"); } diff --git a/dlls/comctl32/tests/imagelist.c b/dlls/comctl32/tests/imagelist.c index 03aaca180b7..0ed8c78d24f 100644 --- a/dlls/comctl32/tests/imagelist.c +++ b/dlls/comctl32/tests/imagelist.c @@ -433,7 +433,7 @@ static BOOL DoTest3(void) if (!pImageList_DrawIndirect) { - trace("ImageList_DrawIndirect not available, skipping test\n"); + win_skip("ImageList_DrawIndirect not available, skipping test\n"); return TRUE; } diff --git a/dlls/comctl32/toolbar.c b/dlls/comctl32/toolbar.c index 0beb2c6954b..9b21efc77ef 100644 --- a/dlls/comctl32/toolbar.c +++ b/dlls/comctl32/toolbar.c @@ -2085,7 +2085,7 @@ static void TOOLBAR_Cust_AddButton(const CUSTDLG_INFO *custInfo, HWND hwnd, INT PCUSTOMBUTTON btnNew; /* duplicate 'separator' button */ - btnNew = (PCUSTOMBUTTON)Alloc(sizeof(CUSTOMBUTTON)); + btnNew = Alloc(sizeof(CUSTOMBUTTON)); *btnNew = *btnInfo; btnInfo = btnNew; } @@ -2308,7 +2308,7 @@ TOOLBAR_CustomizeDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) /* add items to 'toolbar buttons' list and check if removable */ for (i = 0; i < custInfo->tbInfo->nNumButtons; i++) { - btnInfo = (PCUSTOMBUTTON)Alloc(sizeof(CUSTOMBUTTON)); + btnInfo = Alloc(sizeof(CUSTOMBUTTON)); memset (&btnInfo->btn, 0, sizeof(TBBUTTON)); btnInfo->btn.fsStyle = BTNS_SEP; btnInfo->bVirtual = FALSE; @@ -2324,7 +2324,7 @@ TOOLBAR_CustomizeDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) SendDlgItemMessageW (hwnd, IDC_TOOLBARBTN_LBOX, LB_SETITEMHEIGHT, 0, infoPtr->nBitmapHeight + 8); /* insert separator button into 'available buttons' list */ - btnInfo = (PCUSTOMBUTTON)Alloc(sizeof(CUSTOMBUTTON)); + btnInfo = Alloc(sizeof(CUSTOMBUTTON)); memset (&btnInfo->btn, 0, sizeof(TBBUTTON)); btnInfo->btn.fsStyle = BTNS_SEP; btnInfo->bVirtual = FALSE; @@ -2359,7 +2359,7 @@ TOOLBAR_CustomizeDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) index = TOOLBAR_GetButtonIndex (custInfo->tbInfo, nmtb.tbButton.idCommand, FALSE); if (index == -1) { - btnInfo = (PCUSTOMBUTTON)Alloc(sizeof(CUSTOMBUTTON)); + btnInfo = Alloc(sizeof(CUSTOMBUTTON)); btnInfo->bVirtual = FALSE; btnInfo->bRemovable = TRUE; } @@ -2392,7 +2392,7 @@ TOOLBAR_CustomizeDialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) SendDlgItemMessageW (hwnd, IDC_AVAILBTN_LBOX, LB_SETCURSEL, 0, 0); /* append 'virtual' separator button to the 'toolbar buttons' list */ - btnInfo = (PCUSTOMBUTTON)Alloc(sizeof(CUSTOMBUTTON)); + btnInfo = Alloc(sizeof(CUSTOMBUTTON)); memset (&btnInfo->btn, 0, sizeof(TBBUTTON)); btnInfo->btn.fsStyle = BTNS_SEP; btnInfo->bVirtual = TRUE; @@ -6157,7 +6157,7 @@ TOOLBAR_NCCreate (HWND hwnd, WPARAM wParam, LPARAM lParam) DWORD styleadd = 0; /* allocate memory for info structure */ - infoPtr = (TOOLBAR_INFO *)Alloc (sizeof(TOOLBAR_INFO)); + infoPtr = Alloc (sizeof(TOOLBAR_INFO)); SetWindowLongPtrW (hwnd, 0, (LONG_PTR)infoPtr); /* paranoid!! */ @@ -7103,7 +7103,7 @@ static HIMAGELIST TOOLBAR_InsertImageList(PIMLENTRY **pies, INT *cies, HIMAGELIS { PIMLENTRY *pnies; - c = (PIMLENTRY) Alloc(sizeof(IMLENTRY)); + c = Alloc(sizeof(IMLENTRY)); c->id = id; pnies = Alloc((*cies + 1) * sizeof(PIMLENTRY)); diff --git a/dlls/comctl32/tooltips.c b/dlls/comctl32/tooltips.c index 1149a07d96c..5dd48a286c4 100644 --- a/dlls/comctl32/tooltips.c +++ b/dlls/comctl32/tooltips.c @@ -2351,7 +2351,7 @@ TOOLTIPS_Create (HWND hwnd, const CREATESTRUCTW *lpcs) TOOLTIPS_INFO *infoPtr; /* allocate memory for info structure */ - infoPtr = (TOOLTIPS_INFO *)Alloc (sizeof(TOOLTIPS_INFO)); + infoPtr = Alloc (sizeof(TOOLTIPS_INFO)); SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr); /* initialize info structure */ diff --git a/dlls/comctl32/trackbar.c b/dlls/comctl32/trackbar.c index d540f005669..a9959e29a60 100644 --- a/dlls/comctl32/trackbar.c +++ b/dlls/comctl32/trackbar.c @@ -1397,7 +1397,7 @@ TRACKBAR_Create (HWND hwnd, const CREATESTRUCTW *lpcs) TRACKBAR_INFO *infoPtr; DWORD dwStyle; - infoPtr = (TRACKBAR_INFO *)Alloc (sizeof(TRACKBAR_INFO)); + infoPtr = Alloc (sizeof(TRACKBAR_INFO)); if (!infoPtr) return -1; SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr); diff --git a/dlls/comctl32/treeview.c b/dlls/comctl32/treeview.c index dabe5d92414..25050421924 100644 --- a/dlls/comctl32/treeview.c +++ b/dlls/comctl32/treeview.c @@ -751,7 +751,7 @@ TREEVIEW_UpdateDispInfo(const TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem, (LPSTR)callback.item.pszText, -1, NULL, 0); buflen = max((len)*sizeof(WCHAR), TEXT_CALLBACK_SIZE); - newText = (LPWSTR)ReAlloc(wineItem->pszText, buflen); + newText = ReAlloc(wineItem->pszText, buflen); TRACE("returned str %s, len=%d, buflen=%d\n", debugstr_a((LPSTR)callback.item.pszText), len, buflen); @@ -793,7 +793,7 @@ TREEVIEW_UpdateDispInfo(const TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem, (LPSTR)callback.item.pszText, -1, NULL, 0); buflen = max((len)*sizeof(WCHAR), TEXT_CALLBACK_SIZE); - newText = (LPWSTR)Alloc(buflen); + newText = Alloc(buflen); TRACE("same buffer str %s, len=%d, buflen=%d\n", debugstr_a((LPSTR)callback.item.pszText), len, buflen); @@ -3010,8 +3010,8 @@ TREEVIEW_Sort(TREEVIEW_INFO *infoPtr, HTREEITEM parent, /* The order of DPA entries has been changed, so fixup the * nextSibling and prevSibling pointers. */ - item = (HTREEITEM)DPA_GetPtr(sortList, count++); - while ((nextItem = (HTREEITEM)DPA_GetPtr(sortList, count++)) != NULL) + item = DPA_GetPtr(sortList, count++); + while ((nextItem = DPA_GetPtr(sortList, count++)) != NULL) { /* link the two current item together */ item->nextSibling = nextItem; @@ -4896,7 +4896,7 @@ TREEVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs) TRACE("wnd %p, style %x\n", hwnd, GetWindowLongW(hwnd, GWL_STYLE)); - infoPtr = (TREEVIEW_INFO *)Alloc(sizeof(TREEVIEW_INFO)); + infoPtr = Alloc(sizeof(TREEVIEW_INFO)); if (infoPtr == NULL) { diff --git a/dlls/comctl32/updown.c b/dlls/comctl32/updown.c index 38879dbe40f..fcbc15a716e 100644 --- a/dlls/comctl32/updown.c +++ b/dlls/comctl32/updown.c @@ -828,7 +828,7 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, L switch(message) { case WM_CREATE: - infoPtr = (UPDOWN_INFO*)Alloc (sizeof(UPDOWN_INFO)); + infoPtr = Alloc (sizeof(UPDOWN_INFO)); SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr); /* initialize the info struct */ diff --git a/dlls/comdlg32/filedlg.c b/dlls/comdlg32/filedlg.c index dd4752835e6..65d73d2f307 100644 --- a/dlls/comdlg32/filedlg.c +++ b/dlls/comdlg32/filedlg.c @@ -1388,6 +1388,10 @@ static LRESULT FILEDLG95_InitControls(HWND hwnd) LoadStringW(COMDLG32_hInstance, IDS_SAVE_IN, buf, sizeof(buf)/sizeof(WCHAR)); SetDlgItemTextW(hwnd, IDC_LOOKINSTATIC, buf); } + + /* Initialize the filter combo box */ + FILEDLG95_FILETYPE_Init(hwnd); + return 0; } @@ -1476,9 +1480,6 @@ static LRESULT FILEDLG95_FillControls(HWND hwnd, WPARAM wParam, LPARAM lParam) /* Initialize the Look In combo box */ FILEDLG95_LOOKIN_Init(fodInfos->DlgInfos.hwndLookInCB); - /* Initialize the filter combo box */ - FILEDLG95_FILETYPE_Init(hwnd); - /* Browse to the initial directory */ IShellBrowser_BrowseObject(fodInfos->Shell.FOIShellBrowser,pidlItemId, SBSP_ABSOLUTE); diff --git a/dlls/comdlg32/tests/Makefile.in b/dlls/comdlg32/tests/Makefile.in index fae9717542f..11ee9304dab 100644 --- a/dlls/comdlg32/tests/Makefile.in +++ b/dlls/comdlg32/tests/Makefile.in @@ -9,6 +9,8 @@ CTESTS = \ filedlg.c \ printdlg.c +RC_SRCS = rsrc.rc + @MAKE_TEST_RULES@ @DEPENDENCIES@ # everything below this line is overwritten by make depend diff --git a/dlls/comdlg32/tests/filedlg.c b/dlls/comdlg32/tests/filedlg.c index 86895dcd3bf..09a24285547 100644 --- a/dlls/comdlg32/tests/filedlg.c +++ b/dlls/comdlg32/tests/filedlg.c @@ -205,6 +205,27 @@ cleanup: return 0; } +static LONG_PTR WINAPI template_hook(HWND dlg, UINT msg, WPARAM wParam, LPARAM lParam) +{ + if (msg == WM_INITDIALOG) + { + HWND p,cb; + INT sel; + p = GetParent(dlg); + ok(p!=NULL, "Failed to get parent of template\n"); + cb = GetDlgItem(p,0x470); + ok(cb!=NULL, "Failed to get filter combobox\n"); + sel = SendMessage(cb, CB_GETCURSEL, 0, 0); + ok (sel != -1, "Failed to get selection from filter listbox\n"); + } + if (msg == WM_NOTIFY) + { + if (((LPNMHDR)lParam)->code == CDN_FOLDERCHANGE) + PostMessage(GetParent(dlg), WM_COMMAND, IDCANCEL, 0); + } + return 0; +} + static void test_create_view_window2(void) { OPENFILENAMEA ofn = {0}; @@ -222,8 +243,29 @@ static void test_create_view_window2(void) ok(!ret, "CommDlgExtendedError returned %#x\n", ret); } +static void test_create_view_template(void) +{ + OPENFILENAMEA ofn = {0}; + char filename[1024] = {0}; + DWORD ret; + + ofn.lStructSize = sizeof(ofn); + ofn.lpstrFile = filename; + ofn.nMaxFile = 1042; + ofn.lpfnHook = (LPOFNHOOKPROC)template_hook; + ofn.Flags = OFN_ENABLEHOOK | OFN_EXPLORER| OFN_ENABLETEMPLATE; + ofn.hInstance = GetModuleHandleW(NULL); + ofn.lpTemplateName = "template1"; + ofn.lpstrFilter="text\0*.txt\0All\0*\0\0"; + ret = GetOpenFileNameA(&ofn); + ok(!ret, "GetOpenFileNameA returned %#x\n", ret); + ret = CommDlgExtendedError(); + ok(!ret, "CommDlgExtendedError returned %#x\n", ret); +} + START_TEST(filedlg) { test_DialogCancel(); test_create_view_window2(); + test_create_view_template(); } diff --git a/dlls/d3d10/d3d10_main.c b/dlls/comdlg32/tests/rsrc.rc similarity index 59% copy from dlls/d3d10/d3d10_main.c copy to dlls/comdlg32/tests/rsrc.rc index 8d80c41f619..51415fddb26 100644 --- a/dlls/d3d10/d3d10_main.c +++ b/dlls/comdlg32/tests/rsrc.rc @@ -1,7 +1,6 @@ -/* - * Direct3D 10 +/* Resources for the common dialog unit test suite. * - * Copyright 2007 Andras Kovacs + * Copyright 2008 CodeWeavers, Aric Stewart * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -16,30 +15,20 @@ * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - * */ -#include "config.h" -#include - #include "windef.h" -#include "winbase.h" #include "winuser.h" -#include "wine/debug.h" - -WINE_DEFAULT_DEBUG_CHANNEL(d3d10); -/* At process attach */ -BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv) +TEMPLATE1 DIALOG LOADONCALL MOVEABLE DISCARDABLE 5, 43, 227, 215 +STYLE WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS +FONT 8, "MS Shell Dlg" { - TRACE("fdwReason=%d\n", fdwReason); - switch(fdwReason) - { - case DLL_WINE_PREATTACH: - return FALSE; /* prefer native version */ - case DLL_PROCESS_ATTACH: - DisableThreadLibraryCalls( hInstDLL ); - break; - } - return TRUE; + LTEXT "Path:",-1,28,4,36,8 + LTEXT "Text1",-1,4,16,20,40 + LTEXT "Selected:",-1,32,49,40,8 + EDITTEXT 55,74,47,200,12,ES_AUTOHSCROLL + LTEXT "Text2",-1,232,20,65,8 + LTEXT "",-1,28,16,204,31 + EDITTEXT 56,65,2,200,12,ES_AUTOHSCROLL } diff --git a/dlls/crypt32/chain.c b/dlls/crypt32/chain.c index d086fe6558a..cd70d499b16 100644 --- a/dlls/crypt32/chain.c +++ b/dlls/crypt32/chain.c @@ -560,14 +560,13 @@ static void CRYPT_FindMatchingNameEntry(const CERT_ALT_NAME_ENTRY *constraint, DWORD errorIfFound, DWORD errorIfNotFound) { DWORD i; - BOOL defined = FALSE, match = FALSE; + BOOL match = FALSE; for (i = 0; i < subjectName->cAltEntry; i++) { if (subjectName->rgAltEntry[i].dwAltNameChoice == constraint->dwAltNameChoice) { - defined = TRUE; switch (constraint->dwAltNameChoice) { case CERT_ALT_NAME_RFC822_NAME: @@ -595,16 +594,6 @@ static void CRYPT_FindMatchingNameEntry(const CERT_ALT_NAME_ENTRY *constraint, } } } - /* Microsoft's implementation of name constraint checking appears at odds - * with RFC 3280: - * According to MSDN, CERT_TRUST_HAS_NOT_DEFINED_NAME_CONSTRAINT is set - * when a name constraint is present, but that name form is not defined in - * the end certificate. According to RFC 3280, "if no name of the type is - * in the certificate, the name is acceptable." - * I follow Microsoft here. - */ - if (!defined) - *trustErrorStatus |= CERT_TRUST_HAS_NOT_DEFINED_NAME_CONSTRAINT; *trustErrorStatus |= match ? errorIfFound : errorIfNotFound; } @@ -645,10 +634,6 @@ static void CRYPT_CheckNameConstraints( } else { - /* See above comment on CERT_TRUST_HAS_NOT_DEFINED_NAME_CONSTRAINT. - * I match Microsoft's implementation here as well. - */ - *trustErrorStatus |= CERT_TRUST_HAS_NOT_DEFINED_NAME_CONSTRAINT; if (nameConstraints->cPermittedSubtree) *trustErrorStatus |= CERT_TRUST_HAS_NOT_PERMITTED_NAME_CONSTRAINT; @@ -773,6 +758,7 @@ static void CRYPT_CheckSimpleChain(PCertificateChainEngine engine, */ pathLengthConstraintViolated = TRUE; chain->TrustStatus.dwErrorStatus |= + CERT_TRUST_IS_PARTIAL_CHAIN | CERT_TRUST_INVALID_BASIC_CONSTRAINTS; } /* FIXME: check valid usages */ diff --git a/dlls/crypt32/crypt32.spec b/dlls/crypt32/crypt32.spec index c820612d2a7..5c0c9a02824 100644 --- a/dlls/crypt32/crypt32.spec +++ b/dlls/crypt32/crypt32.spec @@ -35,6 +35,7 @@ @ stdcall CertEnumCTLsInStore(ptr ptr) @ stdcall CertEnumCertificateContextProperties(ptr long) @ stdcall CertEnumCertificatesInStore(long ptr) +@ stdcall CertEnumPhysicalStore(ptr long ptr ptr) @ stdcall CertEnumSystemStore(long ptr ptr ptr) @ stdcall CertFindAttribute(str long ptr) @ stdcall CertFindCRLInStore(long long long long ptr ptr) diff --git a/dlls/crypt32/provstore.c b/dlls/crypt32/provstore.c index fba11ebc23f..70dba644f39 100644 --- a/dlls/crypt32/provstore.c +++ b/dlls/crypt32/provstore.c @@ -78,7 +78,7 @@ static BOOL CRYPT_ProvAddCert(PWINECRYPT_CERTSTORE store, void *cert, /* dirty trick: replace the returned context's hCertStore with * store. */ - if (ppStoreContext) + if (ret && ppStoreContext) (*(PCERT_CONTEXT *)ppStoreContext)->hCertStore = store; return ret; } @@ -145,7 +145,7 @@ static BOOL CRYPT_ProvAddCRL(PWINECRYPT_CERTSTORE store, void *crl, /* dirty trick: replace the returned context's hCertStore with * store. */ - if (ppStoreContext) + if (ret && ppStoreContext) (*(PCRL_CONTEXT *)ppStoreContext)->hCertStore = store; return ret; } @@ -212,7 +212,7 @@ static BOOL CRYPT_ProvAddCTL(PWINECRYPT_CERTSTORE store, void *ctl, /* dirty trick: replace the returned context's hCertStore with * store. */ - if (ppStoreContext) + if (ret && ppStoreContext) (*(PCTL_CONTEXT *)ppStoreContext)->hCertStore = store; return ret; } diff --git a/dlls/crypt32/store.c b/dlls/crypt32/store.c index 6d9177e9931..834cc1d8ce4 100644 --- a/dlls/crypt32/store.c +++ b/dlls/crypt32/store.c @@ -1321,7 +1321,7 @@ BOOL WINAPI CertEnumSystemStore(DWORD dwFlags, void *pvSystemStoreLocationPara, rc = RegEnumKeyExW(key, index++, name, &size, NULL, NULL, NULL, NULL); if (!rc) - ret = pfnEnum(name, 0, &info, NULL, pvArg); + ret = pfnEnum(name, dwFlags, &info, NULL, pvArg); } while (ret && !rc); if (ret && rc != ERROR_NO_MORE_ITEMS) SetLastError(rc); @@ -1330,3 +1330,16 @@ BOOL WINAPI CertEnumSystemStore(DWORD dwFlags, void *pvSystemStoreLocationPara, SetLastError(rc); return ret; } + +BOOL WINAPI CertEnumPhysicalStore(const void *pvSystemStore, DWORD dwFlags, + void *pvArg, PFN_CERT_ENUM_PHYSICAL_STORE pfnEnum) +{ + if (dwFlags & CERT_SYSTEM_STORE_RELOCATE_FLAG) + FIXME("(%p, %08x, %p, %p): stub\n", pvSystemStore, dwFlags, pvArg, + pfnEnum); + else + FIXME("(%s, %08x, %p, %p): stub\n", debugstr_w((LPCWSTR)pvSystemStore), + dwFlags, pvArg, + pfnEnum); + return FALSE; +} diff --git a/dlls/crypt32/tests/chain.c b/dlls/crypt32/tests/chain.c index bfaa80278f2..cafe81453e6 100644 --- a/dlls/crypt32/tests/chain.c +++ b/dlls/crypt32/tests/chain.c @@ -1212,8 +1212,8 @@ static void checkSimpleChainStatus(const CERT_SIMPLE_CHAIN *simpleChain, DWORD i; for (i = 0; i < simpleChain->cElement; i++) - checkElementStatus(&simpleChain->rgpElement[i]->TrustStatus, - &simpleChainStatus->rgElementStatus[i], ignore, todo, testIndex, + checkElementStatus(&simpleChainStatus->rgElementStatus[i], + &simpleChain->rgpElement[i]->TrustStatus, ignore, todo, testIndex, chainIndex, i); } } @@ -1352,8 +1352,7 @@ static CONST_DATA_BLOB chain5[] = { }; static const CERT_TRUST_STATUS elementStatus5[] = { { CERT_TRUST_NO_ERROR, CERT_TRUST_HAS_NAME_MATCH_ISSUER }, - { CERT_TRUST_HAS_NOT_DEFINED_NAME_CONSTRAINT | - CERT_TRUST_HAS_NOT_PERMITTED_NAME_CONSTRAINT | + { CERT_TRUST_HAS_NOT_PERMITTED_NAME_CONSTRAINT | CERT_TRUST_IS_UNTRUSTED_ROOT, CERT_TRUST_HAS_NAME_MATCH_ISSUER | CERT_TRUST_IS_SELF_SIGNED }, }; @@ -1512,8 +1511,7 @@ static ChainCheck chainCheck[] = { 1, simpleStatus4 }, 0 }, { { sizeof(chain5) / sizeof(chain5[0]), chain5 }, { { 0, CERT_TRUST_HAS_PREFERRED_ISSUER }, - { CERT_TRUST_HAS_NOT_DEFINED_NAME_CONSTRAINT | - CERT_TRUST_HAS_NOT_PERMITTED_NAME_CONSTRAINT | + { CERT_TRUST_HAS_NOT_PERMITTED_NAME_CONSTRAINT | CERT_TRUST_IS_UNTRUSTED_ROOT, 0 }, 1, simpleStatus5 }, 0 }, { { sizeof(chain6) / sizeof(chain6[0]), chain6 }, { { 0, CERT_TRUST_HAS_PREFERRED_ISSUER }, @@ -1529,10 +1527,10 @@ static ChainCheck chainCheck[] = { TODO_ERROR }, { { sizeof(chain9) / sizeof(chain9[0]), chain9 }, { { CERT_TRUST_IS_NOT_TIME_NESTED, CERT_TRUST_HAS_PREFERRED_ISSUER }, - { CERT_TRUST_HAS_NOT_SUPPORTED_NAME_CONSTRAINT | + { CERT_TRUST_IS_PARTIAL_CHAIN | CERT_TRUST_INVALID_BASIC_CONSTRAINTS | CERT_TRUST_IS_CYCLIC, 0 }, 1, simpleStatus9 }, - TODO_ERROR | TODO_INFO }, + TODO_INFO }, { { sizeof(chain10) / sizeof(chain10[0]), chain10 }, { { 0, CERT_TRUST_HAS_PREFERRED_ISSUER }, { CERT_TRUST_IS_UNTRUSTED_ROOT, 0 }, 1, simpleStatus10 }, 0 }, @@ -1541,7 +1539,8 @@ static ChainCheck chainCheck[] = { { CERT_TRUST_IS_UNTRUSTED_ROOT, 0 }, 1, simpleStatus10 }, 0 }, { { sizeof(chain12) / sizeof(chain12[0]), chain12 }, { { 0, CERT_TRUST_HAS_PREFERRED_ISSUER }, - { CERT_TRUST_IS_UNTRUSTED_ROOT, 0 }, 1, simpleStatus12 }, TODO_ERROR }, + { CERT_TRUST_IS_UNTRUSTED_ROOT | CERT_TRUST_IS_NOT_SIGNATURE_VALID, 0 }, + 1, simpleStatus12 }, 0 }, { { sizeof(chain13) / sizeof(chain13[0]), chain13 }, { { CERT_TRUST_IS_NOT_TIME_NESTED, CERT_TRUST_HAS_PREFERRED_ISSUER }, { CERT_TRUST_IS_UNTRUSTED_ROOT, 0 }, 1, simpleStatus13 }, @@ -1574,8 +1573,7 @@ static ChainCheck chainCheckNoStore[] = { 0 }, { { sizeof(chain8) / sizeof(chain8[0]), chain8 }, { { 0, CERT_TRUST_HAS_PREFERRED_ISSUER }, - { CERT_TRUST_INVALID_BASIC_CONSTRAINTS | CERT_TRUST_IS_UNTRUSTED_ROOT | - CERT_TRUST_IS_NOT_TIME_VALID, 0 }, + { CERT_TRUST_IS_PARTIAL_CHAIN, 0 }, 1, simpleStatus8NoStore }, TODO_ERROR | TODO_INFO }, }; diff --git a/dlls/cryptui/Makefile.in b/dlls/cryptui/Makefile.in index 996711a3ade..abb0b2737bf 100644 --- a/dlls/cryptui/Makefile.in +++ b/dlls/cryptui/Makefile.in @@ -3,7 +3,7 @@ TOPOBJDIR = ../.. SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = cryptui.dll -IMPORTS = kernel32 +IMPORTS = crypt32 kernel32 IMPORTLIB = cryptui C_SRCS = \ diff --git a/dlls/cryptui/cryptui.spec b/dlls/cryptui/cryptui.spec index 088d08793c9..201282f75fd 100644 --- a/dlls/cryptui/cryptui.spec +++ b/dlls/cryptui/cryptui.spec @@ -34,7 +34,7 @@ 34 stub CryptUIWizExport 35 stub CryptUIWizFreeCertRequestNoDS 36 stub CryptUIWizFreeDigitalSignContext -37 stub CryptUIWizImport +37 stdcall CryptUIWizImport(long ptr wstr ptr ptr) 38 stub CryptUIWizQueryCertRequestNoDS 39 stub CryptUIWizSubmitCertRequestNoDS 40 stub DllRegisterServer diff --git a/dlls/cryptui/main.c b/dlls/cryptui/main.c index 00e86831464..482bd1422c1 100644 --- a/dlls/cryptui/main.c +++ b/dlls/cryptui/main.c @@ -98,3 +98,80 @@ BOOL WINAPI CryptUIDlgViewCertificateW(PCCRYPTUI_VIEWCERTIFICATE_STRUCTW pCertVi if (pfPropertiesChanged) *pfPropertiesChanged = FALSE; return TRUE; } + +BOOL WINAPI CryptUIWizImport(DWORD dwFlags, HWND hwndParent, LPCWSTR pwszWizardTitle, + PCCRYPTUI_WIZ_IMPORT_SRC_INFO pImportSrc, HCERTSTORE hDestCertStore) +{ + static const WCHAR Root[] = {'R','o','o','t',0}; + BOOL ret; + HANDLE file; + HCERTSTORE store; + BYTE *buffer; + DWORD size, encoding = X509_ASN_ENCODING | PKCS_7_ASN_ENCODING; + const CERT_CONTEXT *cert; + + TRACE("(0x%08x, %p, %s, %p, %p)\n", dwFlags, hwndParent, debugstr_w(pwszWizardTitle), + pImportSrc, hDestCertStore); + + FIXME("only certificate files are supported\n"); + + if (!(dwFlags & CRYPTUI_WIZ_NO_UI)) FIXME("UI not implemented\n"); + + if (pImportSrc->dwSubjectChoice != CRYPTUI_WIZ_IMPORT_SUBJECT_FILE) + { + FIXME("source type not implemented: %u\n", pImportSrc->dwSubjectChoice); + return FALSE; + } + file = CreateFileW(pImportSrc->pwszFileName, GENERIC_READ, FILE_SHARE_READ, NULL, + OPEN_EXISTING, 0, NULL); + if (file == INVALID_HANDLE_VALUE) + { + WARN("can't open certificate file %s\n", debugstr_w(pImportSrc->pwszFileName)); + return FALSE; + } + if ((size = GetFileSize(file, NULL))) + { + if ((buffer = HeapAlloc(GetProcessHeap(), 0, size))) + { + DWORD read; + if (!ReadFile(file, buffer, size, &read, NULL) || read != size) + { + WARN("can't read certificate file %s\n", debugstr_w(pImportSrc->pwszFileName)); + HeapFree(GetProcessHeap(), 0, buffer); + CloseHandle(file); + return FALSE; + } + } + } + else + { + WARN("empty file %s\n", debugstr_w(pImportSrc->pwszFileName)); + CloseHandle(file); + return FALSE; + } + CloseHandle(file); + if (!(cert = CertCreateCertificateContext(encoding, buffer, size))) + { + WARN("unable to create certificate context\n"); + HeapFree(GetProcessHeap(), 0, buffer); + return FALSE; + } + if (hDestCertStore) store = hDestCertStore; + else + { + FIXME("certificate store should be determined dynamically, picking Root store\n"); + if (!(store = CertOpenStore(CERT_STORE_PROV_SYSTEM_W, 0, 0, CERT_SYSTEM_STORE_CURRENT_USER, Root))) + { + WARN("unable to open certificate store\n"); + CertFreeCertificateContext(cert); + HeapFree(GetProcessHeap(), 0, buffer); + return FALSE; + } + } + ret = CertAddCertificateContextToStore(store, cert, CERT_STORE_ADD_REPLACE_EXISTING, NULL); + + if (!hDestCertStore) CertCloseStore(store, 0); + CertFreeCertificateContext(cert); + HeapFree(GetProcessHeap(), 0, buffer); + return ret; +} diff --git a/dlls/d3d10/Makefile.in b/dlls/d3d10/Makefile.in index d9bb511d786..eeaa542626f 100644 --- a/dlls/d3d10/Makefile.in +++ b/dlls/d3d10/Makefile.in @@ -4,10 +4,12 @@ SRCDIR = @srcdir@ VPATH = @srcdir@ MODULE = d3d10.dll IMPORTLIB = d3d10 -IMPORTS = dxguid uuid wined3d kernel32 +IMPORTS = dxguid uuid dxgi kernel32 C_SRCS = \ - d3d10_main.c + d3d10_main.c \ + device.c \ + utils.c RC_SRCS = version.rc diff --git a/dlls/d3d10/d3d10.spec b/dlls/d3d10/d3d10.spec index f15453a5160..2613e38966d 100644 --- a/dlls/d3d10/d3d10.spec +++ b/dlls/d3d10/d3d10.spec @@ -1,8 +1,8 @@ @ stub D3D10CompileEffectFromMemory @ stub D3D10CompileShader @ stub D3D10CreateBlob -@ stub D3D10CreateDevice -@ stub D3D10CreateDeviceAndSwapChain +@ stdcall D3D10CreateDevice(ptr long ptr long long ptr) +@ stdcall D3D10CreateDeviceAndSwapChain(ptr long ptr long long ptr ptr ptr) @ stub D3D10CreateEffectFromMemory @ stub D3D10CreateEffectPoolFromMemory @ stub D3D10CreateStateBlock diff --git a/dlls/d3d10/d3d10_main.c b/dlls/d3d10/d3d10_main.c index 8d80c41f619..57280355fa3 100644 --- a/dlls/d3d10/d3d10_main.c +++ b/dlls/d3d10/d3d10_main.c @@ -20,12 +20,9 @@ */ #include "config.h" -#include +#include "wine/port.h" -#include "windef.h" -#include "winbase.h" -#include "winuser.h" -#include "wine/debug.h" +#include "d3d10_private.h" WINE_DEFAULT_DEBUG_CHANNEL(d3d10); @@ -35,11 +32,82 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv) TRACE("fdwReason=%d\n", fdwReason); switch(fdwReason) { - case DLL_WINE_PREATTACH: - return FALSE; /* prefer native version */ case DLL_PROCESS_ATTACH: DisableThreadLibraryCalls( hInstDLL ); break; } return TRUE; } + +HRESULT WINAPI D3D10CreateDevice(IDXGIAdapter *adapter, D3D10_DRIVER_TYPE driver_type, + HMODULE swrast, UINT flags, UINT sdk_version, ID3D10Device **device) +{ + struct d3d10_device *object; + + FIXME("adapter %p, driver_type %s, swrast %p, flags %#x, sdk_version %d, device %p partial stub!\n", + adapter, debug_d3d10_driver_type(driver_type), swrast, flags, sdk_version, device); + + object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); + if (!object) + { + ERR("Failed to allocate D3D device object memory\n"); + return E_OUTOFMEMORY; + } + + object->vtbl = &d3d10_device_vtbl; + object->refcount = 1; + *device = (ID3D10Device *)object; + + TRACE("Created ID3D10Device %p\n", object); + + return S_OK; +} + +HRESULT WINAPI D3D10CreateDeviceAndSwapChain(IDXGIAdapter *adapter, D3D10_DRIVER_TYPE driver_type, + HMODULE swrast, UINT flags, UINT sdk_version, DXGI_SWAP_CHAIN_DESC *swapchain_desc, + IDXGISwapChain **swapchain, ID3D10Device **device) +{ + IDXGIFactory *factory; + HRESULT hr; + + TRACE("adapter %p, driver_type %s, swrast %p, flags %#x, sdk_version %d,\n" + "\tswapchain_desc %p, swapchain %p, device %p\n", + adapter, debug_d3d10_driver_type(driver_type), swrast, flags, sdk_version, + swapchain_desc, swapchain, device); + + hr = D3D10CreateDevice(adapter, driver_type, swrast, flags, sdk_version, device); + if (FAILED(hr)) + { + WARN("Failed to create a device, returning %#x\n", hr); + return hr; + } + + TRACE("Created ID3D10Device %p\n", *device); + + hr = CreateDXGIFactory(&IID_IDXGIFactory, (void **)&factory); + if (FAILED(hr)) + { + ID3D10Device_Release(*device); + *device = NULL; + + WARN("Failed to create a DXGI factory, returning %#x\n", hr); + return hr; + } + + TRACE("Created IDXGIFactory %p\n", factory); + + hr = IDXGIFactory_CreateSwapChain(factory, (IUnknown *)*device, swapchain_desc, swapchain); + IDXGIFactory_Release(factory); + if (FAILED(hr)) + { + ID3D10Device_Release(*device); + *device = NULL; + + WARN("Failed to create a swapchain, returning %#x\n", hr); + return hr; + } + + TRACE("Created IDXGISwapChain %p\n", *swapchain); + + return S_OK; +} diff --git a/dlls/d3d10/d3d10_main.c b/dlls/d3d10/d3d10_private.h similarity index 57% copy from dlls/d3d10/d3d10_main.c copy to dlls/d3d10/d3d10_private.h index 8d80c41f619..f76bda6b0b6 100644 --- a/dlls/d3d10/d3d10_main.c +++ b/dlls/d3d10/d3d10_private.h @@ -1,7 +1,5 @@ /* - * Direct3D 10 - * - * Copyright 2007 Andras Kovacs + * Copyright 2008 Henri Verbeet for CodeWeavers * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -16,30 +14,31 @@ * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - * */ -#include "config.h" -#include +#ifndef __WINE_D3D10_PRIVATE_H +#define __WINE_D3D10_PRIVATE_H + +#include "wine/debug.h" -#include "windef.h" +#define COBJMACROS #include "winbase.h" #include "winuser.h" -#include "wine/debug.h" +#include "objbase.h" + +#include "d3d10.h" -WINE_DEFAULT_DEBUG_CHANNEL(d3d10); +/* TRACE helper functions */ +const char *debug_d3d10_driver_type(D3D10_DRIVER_TYPE driver_type); +const char *debug_d3d10_primitive_topology(D3D10_PRIMITIVE_TOPOLOGY topology); +const char *debug_dxgi_format(DXGI_FORMAT format); -/* At process attach */ -BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv) +/* IDirect3D10Device */ +extern const struct ID3D10DeviceVtbl d3d10_device_vtbl; +struct d3d10_device { - TRACE("fdwReason=%d\n", fdwReason); - switch(fdwReason) - { - case DLL_WINE_PREATTACH: - return FALSE; /* prefer native version */ - case DLL_PROCESS_ATTACH: - DisableThreadLibraryCalls( hInstDLL ); - break; - } - return TRUE; -} + const struct ID3D10DeviceVtbl *vtbl; + LONG refcount; +}; + +#endif /* __WINE_D3D10_PRIVATE_H */ diff --git a/dlls/d3d10/device.c b/dlls/d3d10/device.c new file mode 100644 index 00000000000..eea9a75269e --- /dev/null +++ b/dlls/d3d10/device.c @@ -0,0 +1,852 @@ +/* + * Copyright 2008 Henri Verbeet for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + * + */ + +#include "config.h" +#include "wine/port.h" + +#include "d3d10_private.h" + +WINE_DEFAULT_DEBUG_CHANNEL(d3d10); + +/* IUnknown methods */ + +HRESULT STDMETHODCALLTYPE d3d10_device_QueryInterface(ID3D10Device* iface, REFIID riid, void **object) +{ + TRACE("iface %p, riid %s, object %p\n", iface, debugstr_guid(riid), object); + + if (IsEqualGUID(riid, &IID_IUnknown) + || IsEqualGUID(riid, &IID_ID3D10Device)) + { + IUnknown_AddRef(iface); + *object = iface; + return S_OK; + } + + WARN("%s not implemented, returning E_NOINTERFACE\n", debugstr_guid(riid)); + + *object = NULL; + return E_NOINTERFACE; +} + +ULONG STDMETHODCALLTYPE d3d10_device_AddRef(ID3D10Device* iface) +{ + struct d3d10_device *This = (struct d3d10_device *)iface; + ULONG refcount = InterlockedIncrement(&This->refcount); + + TRACE("%p increasing refcount to %u\n", This, refcount); + + return refcount; +} + +ULONG STDMETHODCALLTYPE d3d10_device_Release(ID3D10Device* iface) +{ + struct d3d10_device *This = (struct d3d10_device *)iface; + ULONG refcount = InterlockedDecrement(&This->refcount); + + TRACE("%p decreasing refcount to %u\n", This, refcount); + + if (!refcount) + { + HeapFree(GetProcessHeap(), 0, This); + } + + return refcount; +} + +/* ID3D10Device methods */ + +void STDMETHODCALLTYPE d3d10_device_VSSetConstantBuffers(ID3D10Device* iface, + UINT start_slot, UINT buffer_count, ID3D10Buffer *const *buffers) +{ + FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p stub!\n", + iface, start_slot, buffer_count, buffers); +} + +void STDMETHODCALLTYPE d3d10_device_PSSetShaderResources(ID3D10Device* iface, + UINT start_slot, UINT view_count, ID3D10ShaderResourceView *const *views) +{ + FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n", + iface, start_slot, view_count, views); +} + +void STDMETHODCALLTYPE d3d10_device_PSSetShader(ID3D10Device* iface, ID3D10PixelShader *shader) +{ + FIXME("iface %p, shader %p stub!\n", iface, shader); +} + +void STDMETHODCALLTYPE d3d10_device_PSSetSamplers(ID3D10Device* iface, + UINT start_slot, UINT sampler_count, ID3D10SamplerState *const *samplers) +{ + FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n", + iface, start_slot, sampler_count, samplers); +} + +void STDMETHODCALLTYPE d3d10_device_VSSetShader(ID3D10Device* iface, ID3D10VertexShader *shader) +{ + FIXME("iface %p, shader %p stub!\n", iface, shader); +} + +void STDMETHODCALLTYPE d3d10_device_DrawIndexed(ID3D10Device* iface, + UINT index_count, UINT start_index_location, INT base_vertex_location) +{ + FIXME("iface %p, index_count %u, start_index_location %u, base_vertex_location %d stub!\n", + iface, index_count, start_index_location, base_vertex_location); +} + +void STDMETHODCALLTYPE d3d10_device_Draw(ID3D10Device* iface, + UINT vertex_count, UINT start_vertex_location) +{ + FIXME("iface %p, vertex_count %u, start_vertex_location %u stub!\n", + iface, vertex_count, start_vertex_location); +} + +void STDMETHODCALLTYPE d3d10_device_PSSetConstantBuffers(ID3D10Device* iface, + UINT start_slot, UINT buffer_count, ID3D10Buffer *const *buffers) +{ + FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p stub!\n", + iface, start_slot, buffer_count, buffers); +} + +void STDMETHODCALLTYPE d3d10_device_IASetInputLayout(ID3D10Device* iface, ID3D10InputLayout *input_layout) +{ + FIXME("iface %p, input_layout %p stub!\n", iface, input_layout); +} + +void STDMETHODCALLTYPE d3d10_device_IASetVertexBuffers(ID3D10Device* iface, + UINT start_slot, UINT buffer_count, ID3D10Buffer *const *buffers, + const UINT *strides, const UINT *offsets) +{ + FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p, strides %p, offsets %p stub!\n", + iface, start_slot, buffer_count, buffers, strides, offsets); +} + +void STDMETHODCALLTYPE d3d10_device_IASetIndexBuffer(ID3D10Device* iface, + ID3D10Buffer *buffer, DXGI_FORMAT format, UINT offset) +{ + FIXME("iface %p, buffer %p, format %s, offset %u stub!\n", + iface, buffer, debug_dxgi_format(format), offset); +} + +void STDMETHODCALLTYPE d3d10_device_DrawIndexedInstanced(ID3D10Device* iface, + UINT instance_index_count, UINT instance_count, UINT start_index_location, + INT base_vertex_location, UINT start_instance_location) +{ + FIXME("iface %p, instance_index_count %u, instance_count %u, start_index_location %u,\n" + "\tbase_vertex_location %d, start_instance_location %u stub!\n", + iface, instance_index_count, instance_count, start_index_location, + base_vertex_location, start_instance_location); +} + +void STDMETHODCALLTYPE d3d10_device_DrawInstanced(ID3D10Device* iface, + UINT instance_vertex_count, UINT instance_count, + UINT start_vertex_location, UINT start_instance_location) +{ + FIXME("iface %p, instance_vertex_count %u, instance_count %u, start_vertex_location %u,\n" + "\tstart_instance_location %u stub!\n", iface, instance_vertex_count, instance_count, + start_vertex_location, start_instance_location); +} + +void STDMETHODCALLTYPE d3d10_device_GSSetConstantBuffers(ID3D10Device* iface, + UINT start_slot, UINT buffer_count, ID3D10Buffer *const *buffers) +{ + FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p stub!\n", + iface, start_slot, buffer_count, buffers); +} + +void STDMETHODCALLTYPE d3d10_device_GSSetShader(ID3D10Device* iface, ID3D10GeometryShader *shader) +{ + FIXME("iface %p, shader %p stub!\n", iface, shader); +} + +void STDMETHODCALLTYPE d3d10_device_IASetPrimitiveTopology(ID3D10Device* iface, D3D10_PRIMITIVE_TOPOLOGY topology) +{ + FIXME("iface %p, topology %s stub!\n", iface, debug_d3d10_primitive_topology(topology)); +} + +void STDMETHODCALLTYPE d3d10_device_VSSetShaderResources(ID3D10Device* iface, + UINT start_slot, UINT view_count, ID3D10ShaderResourceView *const *views) +{ + FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n", + iface, start_slot, view_count, views); +} + +void STDMETHODCALLTYPE d3d10_device_VSSetSamplers(ID3D10Device* iface, + UINT start_slot, UINT sampler_count, ID3D10SamplerState *const *samplers) +{ + FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n", + iface, start_slot, sampler_count, samplers); +} + +void STDMETHODCALLTYPE d3d10_device_SetPredication(ID3D10Device* iface, ID3D10Predicate *predicate, BOOL value) +{ + FIXME("iface %p, predicate %p, value %d stub!\n", iface, predicate, value); +} + +void STDMETHODCALLTYPE d3d10_device_GSSetShaderResources(ID3D10Device* iface, + UINT start_slot, UINT view_count, ID3D10ShaderResourceView *const *views) +{ + FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n", + iface, start_slot, view_count, views); +} + +void STDMETHODCALLTYPE d3d10_device_GSSetSamplers(ID3D10Device* iface, + UINT start_slot, UINT sampler_count, ID3D10SamplerState *const *samplers) +{ + FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n", + iface, start_slot, sampler_count, samplers); +} + +void STDMETHODCALLTYPE d3d10_device_OMSetRenderTargets(ID3D10Device* iface, + UINT render_target_view_count, ID3D10RenderTargetView *const *render_target_views, + ID3D10DepthStencilView *depth_stencil_view) +{ + FIXME("iface %p, render_target_view_count %u, render_target_views %p, depth_stencil_view %p\n", + iface, render_target_view_count, render_target_views, depth_stencil_view); +} + +void STDMETHODCALLTYPE d3d10_device_OMSetBlendState(ID3D10Device* iface, + ID3D10BlendState *blend_state, const FLOAT blend_factor[4], UINT sample_mask) +{ + FIXME("iface %p, blend_state %p, blend_factor [%f %f %f %f], sample_mask 0x%08x stub!\n", + iface, blend_state, blend_factor[0], blend_factor[1], blend_factor[2], blend_factor[3], sample_mask); +} + +void STDMETHODCALLTYPE d3d10_device_OMSetDepthStencilState(ID3D10Device* iface, + ID3D10DepthStencilState *depth_stencil_state, UINT stencil_ref) +{ + FIXME("iface %p, depth_stencil_state %p, stencil_ref %u stub!\n", + iface, depth_stencil_state, stencil_ref); +} + +void STDMETHODCALLTYPE d3d10_device_SOSetTargets(ID3D10Device* iface, + UINT target_count, ID3D10Buffer *const *targets, const UINT *offsets) +{ + FIXME("iface %p, target_count %u, targets %p, offsets %p stub!\n", iface, target_count, targets, offsets); +} + +void STDMETHODCALLTYPE d3d10_device_DrawAuto(ID3D10Device* iface) +{ + FIXME("iface %p stub!\n", iface); +} + +void STDMETHODCALLTYPE d3d10_device_RSSetState(ID3D10Device* iface, ID3D10RasterizerState *rasterizer_state) +{ + FIXME("iface %p, rasterizer_state %p stub!\n", iface, rasterizer_state); +} + +void STDMETHODCALLTYPE d3d10_device_RSSetViewports(ID3D10Device* iface, + UINT viewport_count, const D3D10_VIEWPORT *viewports) +{ + FIXME("iface %p, viewport_count %u, viewports %p stub!\n", iface, viewport_count, viewports); +} + +void STDMETHODCALLTYPE d3d10_device_RSSetScissorRects(ID3D10Device* iface, + UINT rect_count, const D3D10_RECT *rects) +{ + FIXME("iface %p, rect_count %u, rects %p\n", iface, rect_count, rects); +} + +void STDMETHODCALLTYPE d3d10_device_CopySubresourceRegion(ID3D10Device* iface, + ID3D10Resource *dst_resource, UINT dst_subresource_idx, UINT dst_x, UINT dst_y, UINT dst_z, + ID3D10Resource *src_resource, UINT src_subresource_idx, const D3D10_BOX *src_box) +{ + FIXME("iface %p, dst_resource %p, dst_subresource_idx %u, dst_x %u, dst_y %u, dst_z %u,\n" + "\tsrc_resource %p, src_subresource_idx %u, src_box %p stub!\n", + iface, dst_resource, dst_subresource_idx, dst_x, dst_y, dst_z, + src_resource, src_subresource_idx, src_box); +} + +void STDMETHODCALLTYPE d3d10_device_CopyResource(ID3D10Device* iface, + ID3D10Resource *dst_resource, ID3D10Resource *src_resource) +{ + FIXME("iface %p, dst_resource %p, src_resource %p stub!\n", iface, dst_resource, src_resource); +} + +void STDMETHODCALLTYPE d3d10_device_UpdateSubresource(ID3D10Device* iface, + ID3D10Resource *resource, UINT subresource_idx, const D3D10_BOX *box, + const void *data, UINT row_pitch, UINT depth_pitch) +{ + FIXME("iface %p, resource %p, subresource_idx %u, box %p, data %p, row_pitch %u, depth_pitch %u stub!\n", + iface, resource, subresource_idx, box, data, row_pitch, depth_pitch); +} + +void STDMETHODCALLTYPE d3d10_device_ClearRenderTargetView(ID3D10Device* iface, + ID3D10RenderTargetView *render_target_view, const FLOAT color_rgba[4]) +{ + FIXME("iface %p, render_target_view %p, color_rgba [%f %f %f %f] stub!\n", + iface, render_target_view, color_rgba[0], color_rgba[1], color_rgba[2], color_rgba[3]); +} + +void STDMETHODCALLTYPE d3d10_device_ClearDepthStencilView(ID3D10Device* iface, + ID3D10DepthStencilView *depth_stencil_view, UINT flags, FLOAT depth, UINT8 stencil) +{ + FIXME("iface %p, depth_stencil_view %p, flags %#x, depth %f, stencil %u stub!\n", + iface, depth_stencil_view, flags, depth, stencil); +} + +void STDMETHODCALLTYPE d3d10_device_GenerateMips(ID3D10Device* iface, ID3D10ShaderResourceView *shader_resource_view) +{ + FIXME("iface %p, shader_resource_view %p stub!\n", iface, shader_resource_view); +} + +void STDMETHODCALLTYPE d3d10_device_ResolveSubresource(ID3D10Device* iface, + ID3D10Resource *dst_resource, UINT dst_subresource_idx, + ID3D10Resource *src_resource, UINT src_subresource_idx, DXGI_FORMAT format) +{ + FIXME("iface %p, dst_resource %p, dst_subresource_idx %u,\n" + "\tsrc_resource %p, src_subresource_idx %u, format %s stub!\n", + iface, dst_resource, dst_subresource_idx, + src_resource, src_subresource_idx, debug_dxgi_format(format)); +} + +void STDMETHODCALLTYPE d3d10_device_VSGetConstantBuffers(ID3D10Device* iface, + UINT start_slot, UINT buffer_count, ID3D10Buffer **buffers) +{ + FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p stub!\n", + iface, start_slot, buffer_count, buffers); +} + +void STDMETHODCALLTYPE d3d10_device_PSGetShaderResources(ID3D10Device* iface, + UINT start_slot, UINT view_count, ID3D10ShaderResourceView **views) +{ + FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n", + iface, start_slot, view_count, views); +} + +void STDMETHODCALLTYPE d3d10_device_PSGetShader(ID3D10Device* iface, ID3D10PixelShader **shader) +{ + FIXME("iface %p, shader %p stub!\n", iface, shader); +} + +void STDMETHODCALLTYPE d3d10_device_PSGetSamplers(ID3D10Device* iface, + UINT start_slot, UINT sampler_count, ID3D10SamplerState **samplers) +{ + FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n", + iface, start_slot, sampler_count, samplers); +} + +void STDMETHODCALLTYPE d3d10_device_VSGetShader(ID3D10Device* iface, ID3D10VertexShader **shader) +{ + FIXME("iface %p, shader %p stub!\n", iface, shader); +} + +void STDMETHODCALLTYPE d3d10_device_PSGetConstantBuffers(ID3D10Device* iface, + UINT start_slot, UINT buffer_count, ID3D10Buffer **buffers) +{ + FIXME("iface %p, start_slot %u, buffer_count %u, buffer %p stub!\n", + iface, start_slot, buffer_count, buffers); +} + +void STDMETHODCALLTYPE d3d10_device_IAGetInputLayout(ID3D10Device* iface, ID3D10InputLayout **input_layout) +{ + FIXME("iface %p, input_layout %p stub!\n", iface, input_layout); +} + +void STDMETHODCALLTYPE d3d10_device_IAGetVertexBuffers(ID3D10Device* iface, + UINT start_slot, UINT buffer_count, ID3D10Buffer **buffers, UINT *strides, UINT *offsets) +{ + FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p, strides %p, offsets %p stub!\n", + iface, start_slot, buffer_count, buffers, strides, offsets); +} + +void STDMETHODCALLTYPE d3d10_device_IAGetIndexBuffer(ID3D10Device* iface, + ID3D10Buffer **buffer, DXGI_FORMAT *format, UINT *offset) +{ + FIXME("iface %p, buffer %p, format %p, offset %p stub!\n", iface, buffer, format, offset); +} + +void STDMETHODCALLTYPE d3d10_device_GSGetConstantBuffers(ID3D10Device* iface, + UINT start_slot, UINT buffer_count, ID3D10Buffer **buffers) +{ + FIXME("iface %p, start_slot %u, buffer_count %u, buffers %p stub!\n", + iface, start_slot, buffer_count, buffers); +} + +void STDMETHODCALLTYPE d3d10_device_GSGetShader(ID3D10Device* iface, ID3D10GeometryShader **shader) +{ + FIXME("iface %p, shader %p stub!\n", iface, shader); +} + +void STDMETHODCALLTYPE d3d10_device_IAGetPrimitiveTopology(ID3D10Device* iface, D3D10_PRIMITIVE_TOPOLOGY *topology) +{ + FIXME("iface %p, topology %p stub!\n", iface, topology); +} + +void STDMETHODCALLTYPE d3d10_device_VSGetShaderResources(ID3D10Device* iface, + UINT start_slot, UINT view_count, ID3D10ShaderResourceView **views) +{ + FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n", + iface, start_slot, view_count, views); +} + +void STDMETHODCALLTYPE d3d10_device_VSGetSamplers(ID3D10Device* iface, + UINT start_slot, UINT sampler_count, ID3D10SamplerState **samplers) +{ + FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n", + iface, start_slot, sampler_count, samplers); +} + +void STDMETHODCALLTYPE d3d10_device_GetPredication(ID3D10Device* iface, + ID3D10Predicate **predicate, BOOL *value) +{ + FIXME("iface %p, predicate %p, value %p stub!\n", iface, predicate, value); +} + +void STDMETHODCALLTYPE d3d10_device_GSGetShaderResources(ID3D10Device* iface, + UINT start_slot, UINT view_count, ID3D10ShaderResourceView **views) +{ + FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n", + iface, start_slot, view_count, views); +} + +void STDMETHODCALLTYPE d3d10_device_GSGetSamplers(ID3D10Device* iface, + UINT start_slot, UINT sampler_count, ID3D10SamplerState **samplers) +{ + FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n", + iface, start_slot, sampler_count, samplers); +} + +void STDMETHODCALLTYPE d3d10_device_OMGetRenderTargets(ID3D10Device* iface, + UINT view_count, ID3D10RenderTargetView **render_target_views, ID3D10DepthStencilView **depth_stencil_view) +{ + FIXME("iface %p, view_count %u, render_target_views %p, depth_stencil_view %p stub!\n", + iface, view_count, render_target_views, depth_stencil_view); +} + +void STDMETHODCALLTYPE d3d10_device_OMGetBlendState(ID3D10Device* iface, + ID3D10BlendState **blend_state, FLOAT blend_factor[4], UINT *sample_mask) +{ + FIXME("iface %p, blend_state %p, blend_factor %p, sample_mask %p stub!\n", + iface, blend_state, blend_factor, sample_mask); +} + +void STDMETHODCALLTYPE d3d10_device_OMGetDepthStencilState(ID3D10Device* iface, + ID3D10DepthStencilState **depth_stencil_state, UINT *stencil_ref) +{ + FIXME("iface %p, depth_stencil_state %p, stencil_ref %p stub!\n", + iface, depth_stencil_state, stencil_ref); +} + +void STDMETHODCALLTYPE d3d10_device_SOGetTargets(ID3D10Device* iface, + UINT buffer_count, ID3D10Buffer **buffers, UINT *offsets) +{ + FIXME("iface %p, buffer_count %u, buffers %p, offsets %p stub!\n", + iface, buffer_count, buffers, offsets); +} + +void STDMETHODCALLTYPE d3d10_device_RSGetState(ID3D10Device* iface, ID3D10RasterizerState **rasterizer_state) +{ + FIXME("iface %p, rasterizer_state %p stub!\n", iface, rasterizer_state); +} + +void STDMETHODCALLTYPE d3d10_device_RSGetViewports(ID3D10Device* iface, + UINT *viewport_count, D3D10_VIEWPORT *viewports) +{ + FIXME("iface %p, viewport_count %p, viewports %p stub!\n", iface, viewport_count, viewports); +} + +void STDMETHODCALLTYPE d3d10_device_RSGetScissorRects(ID3D10Device* iface, UINT *rect_count, D3D10_RECT *rects) +{ + FIXME("iface %p, rect_count %p, rects %p stub!\n", iface, rect_count, rects); +} + +HRESULT STDMETHODCALLTYPE d3d10_device_GetDeviceRemovedReason(ID3D10Device* iface) +{ + FIXME("iface %p stub!\n", iface); + + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE d3d10_device_SetExceptionMode(ID3D10Device* iface, UINT flags) +{ + FIXME("iface %p, flags %#x stub!\n", iface, flags); + + return E_NOTIMPL; +} + +UINT STDMETHODCALLTYPE d3d10_device_GetExceptionMode(ID3D10Device* iface) +{ + FIXME("iface %p stub!\n", iface); + + return 0; +} + +HRESULT STDMETHODCALLTYPE d3d10_device_GetPrivateData(ID3D10Device* iface, + REFGUID guid, UINT *data_size, void *data) +{ + FIXME("iface %p, guid %s, data_size %p, data %p stub!\n", + iface, debugstr_guid(guid), data_size, data); + + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE d3d10_device_SetPrivateData(ID3D10Device* iface, + REFGUID guid, UINT data_size, const void *data) +{ + FIXME("iface %p, guid %s, data_size %u, data %p stub!\n", + iface, debugstr_guid(guid), data_size, data); + + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE d3d10_device_SetPrivateDataInterface(ID3D10Device* iface, + REFGUID guid, const IUnknown *data) +{ + FIXME("iface %p, guid %s, data %p stub!\n", iface, debugstr_guid(guid), data); + + return E_NOTIMPL; +} + +void STDMETHODCALLTYPE d3d10_device_ClearState(ID3D10Device* iface) +{ + FIXME("iface %p stub!\n", iface); +} + +void STDMETHODCALLTYPE d3d10_device_Flush(ID3D10Device* iface) +{ + FIXME("iface %p stub!\n", iface); +} + +HRESULT STDMETHODCALLTYPE d3d10_device_CreateBuffer(ID3D10Device* iface, + const D3D10_BUFFER_DESC *desc, const D3D10_SUBRESOURCE_DATA *data, ID3D10Buffer **buffer) +{ + FIXME("iface %p, desc %p, data %p, buffer %p stub!\n", iface, desc, data, buffer); + + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE d3d10_device_CreateTexture1D(ID3D10Device* iface, + const D3D10_TEXTURE1D_DESC *desc, const D3D10_SUBRESOURCE_DATA *data, ID3D10Texture1D **texture) +{ + FIXME("iface %p, desc %p, data %p, texture %p stub!\n", iface, desc, data, texture); + + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE d3d10_device_CreateTexture2D(ID3D10Device* iface, + const D3D10_TEXTURE2D_DESC *desc, const D3D10_SUBRESOURCE_DATA *data, ID3D10Texture2D **texture) +{ + FIXME("iface %p, desc %p, data %p, texture %p stub!\n", iface, desc, data, texture); + + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE d3d10_device_CreateTexture3D(ID3D10Device* iface, + const D3D10_TEXTURE3D_DESC *desc, const D3D10_SUBRESOURCE_DATA *data, ID3D10Texture3D **texture) +{ + FIXME("iface %p, desc %p, data %p, texture %p stub!\n", iface, desc, data, texture); + + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE d3d10_device_CreateShaderResourceView(ID3D10Device* iface, + ID3D10Resource *resource, const D3D10_SHADER_RESOURCE_VIEW_DESC *desc, ID3D10ShaderResourceView **view) +{ + FIXME("iface %p, resource %p, desc %p, view %p stub!\n", iface, resource, desc, view); + + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE d3d10_device_CreateRenderTargetView(ID3D10Device* iface, + ID3D10Resource *resource, const D3D10_RENDER_TARGET_VIEW_DESC *desc, ID3D10RenderTargetView **view) +{ + FIXME("iface %p, resource %p, desc %p, view %p stub!\n", iface, resource, desc, view); + + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE d3d10_device_CreateDepthStencilView(ID3D10Device* iface, + ID3D10Resource *resource, const D3D10_DEPTH_STENCIL_VIEW_DESC *desc, ID3D10DepthStencilView **view) +{ + FIXME("iface %p, resource %p, desc %p, view %p stub!\n", iface, resource, desc, view); + + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE d3d10_device_CreateInputLayout(ID3D10Device* iface, + const D3D10_INPUT_ELEMENT_DESC *element_descs, UINT element_count, const void *shader_byte_code, + SIZE_T shader_byte_code_length, ID3D10InputLayout **input_layout) +{ + FIXME("iface %p, element_descs %p, element_count %u, shader_byte_code %p," + "\tshader_byte_code_length %lu, input_layout %p stub!\n", + iface, element_descs, element_count, shader_byte_code, + shader_byte_code_length, input_layout); + + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE d3d10_device_CreateVertexShader(ID3D10Device* iface, + const void *byte_code, SIZE_T byte_code_length, ID3D10VertexShader **shader) +{ + FIXME("iface %p, byte_code %p, byte_code_length %lu, shader %p stub!\n", + iface, byte_code, byte_code_length, shader); + + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE d3d10_device_CreateGeometryShader(ID3D10Device* iface, + const void *byte_code, SIZE_T byte_code_length, ID3D10GeometryShader **shader) +{ + FIXME("iface %p, byte_code %p, byte_code_length %lu, shader %p stub!\n", + iface, byte_code, byte_code_length, shader); + + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE d3d10_device_CreateGeometryShaderWithStreamOutput(ID3D10Device* iface, + const void *byte_code, SIZE_T byte_code_length, const D3D10_SO_DECLARATION_ENTRY *output_stream_decls, + UINT output_stream_decl_count, UINT output_stream_stride, ID3D10GeometryShader **shader) +{ + FIXME("iface %p, byte_code %p, byte_code_length %lu, output_stream_decls %p,\n" + "\toutput_stream_decl_count %u, output_stream_stride %u, shader %p stub!\n", + iface, byte_code, byte_code_length, output_stream_decls, + output_stream_decl_count, output_stream_stride, shader); + + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE d3d10_device_CreatePixelShader(ID3D10Device* iface, + const void *byte_code, SIZE_T byte_code_length, ID3D10PixelShader **shader) +{ + FIXME("iface %p, byte_code %p, byte_code_length %lu, shader %p stub!\n", + iface, byte_code, byte_code_length, shader); + + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE d3d10_device_CreateBlendState(ID3D10Device* iface, + const D3D10_BLEND_DESC *desc, ID3D10BlendState **blend_state) +{ + FIXME("iface %p, desc %p, blend_state %p stub!\n", iface, desc, blend_state); + + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE d3d10_device_CreateDepthStencilState(ID3D10Device* iface, + const D3D10_DEPTH_STENCIL_DESC *desc, ID3D10DepthStencilState **depth_stencil_state) +{ + FIXME("iface %p, desc %p, depth_stencil_state %p stub!\n", iface, desc, depth_stencil_state); + + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE d3d10_device_CreateRasterizerState(ID3D10Device* iface, + const D3D10_RASTERIZER_DESC *desc, ID3D10RasterizerState **rasterizer_state) +{ + FIXME("iface %p, desc %p, rasterizer_state %p stub!\n", iface, desc, rasterizer_state); + + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE d3d10_device_CreateSamplerState(ID3D10Device* iface, + const D3D10_SAMPLER_DESC *desc, ID3D10SamplerState **sampler_state) +{ + FIXME("iface %p, desc %p, sampler_state %p stub!\n", iface, desc, sampler_state); + + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE d3d10_device_CreateQuery(ID3D10Device* iface, + const D3D10_QUERY_DESC *desc, ID3D10Query **query) +{ + FIXME("iface %p, desc %p, query %p stub!\n", iface, desc, query); + + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE d3d10_device_CreatePredicate(ID3D10Device* iface, + const D3D10_QUERY_DESC *desc, ID3D10Predicate **predicate) +{ + FIXME("iface %p, desc %p, predicate %p stub!\n", iface, desc, predicate); + + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE d3d10_device_CreateCounter(ID3D10Device* iface, + const D3D10_COUNTER_DESC *desc, ID3D10Counter **counter) +{ + FIXME("iface %p, desc %p, counter %p stub!\n", iface, desc, counter); + + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE d3d10_device_CheckFormatSupport(ID3D10Device* iface, + DXGI_FORMAT format, UINT *format_support) +{ + FIXME("iface %p, format %s, format_support %p stub!\n", + iface, debug_dxgi_format(format), format_support); + + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE d3d10_device_CheckMultisampleQualityLevels(ID3D10Device* iface, + DXGI_FORMAT format, UINT sample_count, UINT *quality_level_count) +{ + FIXME("iface %p, format %s, sample_count %u, quality_level_count %p stub!\n", + iface, debug_dxgi_format(format), sample_count, quality_level_count); + + return E_NOTIMPL; +} + +void STDMETHODCALLTYPE d3d10_device_CheckCounterInfo(ID3D10Device* iface, D3D10_COUNTER_INFO *counter_info) +{ + FIXME("iface %p, counter_info %p stub!\n", iface, counter_info); +} + +HRESULT STDMETHODCALLTYPE d3d10_device_CheckCounter(ID3D10Device* iface, + const D3D10_COUNTER_DESC *desc, D3D10_COUNTER_TYPE *type, UINT *active_counters, LPSTR name, + UINT *name_length, LPSTR units, UINT *units_length, LPSTR description, UINT *description_length) +{ + FIXME("iface %p, desc %p, type %p, active_counters %p, name %p, name_length %p,\n" + "\tunits %p, units_length %p, description %p, description_length %p stub!\n", + iface, desc, type, active_counters, name, name_length, + units, units_length, description, description_length); + + return E_NOTIMPL; +} + +UINT STDMETHODCALLTYPE d3d10_device_GetCreationFlags(ID3D10Device* iface) +{ + FIXME("iface %p stub!\n", iface); + + return 0; +} + +HRESULT STDMETHODCALLTYPE d3d10_device_OpenSharedResource(ID3D10Device* iface, + HANDLE resource_handle, REFIID guid, void **resource) +{ + FIXME("iface %p, resource_handle %p, guid %s, resource %p stub!\n", + iface, resource_handle, debugstr_guid(guid), resource); + + return E_NOTIMPL; +} + +void STDMETHODCALLTYPE d3d10_device_SetTextFilterSize(ID3D10Device* iface, UINT width, UINT height) +{ + FIXME("iface %p, width %u, height %u stub!\n", iface, width, height); +} + +void STDMETHODCALLTYPE d3d10_device_GetTextFilterSize(ID3D10Device* iface, UINT *width, UINT *height) +{ + FIXME("iface %p, width %p, height %p stub!\n", iface, width, height); +} + +const struct ID3D10DeviceVtbl d3d10_device_vtbl = +{ + /* IUnknown methods */ + d3d10_device_QueryInterface, + d3d10_device_AddRef, + d3d10_device_Release, + /* ID3D10Device methods */ + d3d10_device_VSSetConstantBuffers, + d3d10_device_PSSetShaderResources, + d3d10_device_PSSetShader, + d3d10_device_PSSetSamplers, + d3d10_device_VSSetShader, + d3d10_device_DrawIndexed, + d3d10_device_Draw, + d3d10_device_PSSetConstantBuffers, + d3d10_device_IASetInputLayout, + d3d10_device_IASetVertexBuffers, + d3d10_device_IASetIndexBuffer, + d3d10_device_DrawIndexedInstanced, + d3d10_device_DrawInstanced, + d3d10_device_GSSetConstantBuffers, + d3d10_device_GSSetShader, + d3d10_device_IASetPrimitiveTopology, + d3d10_device_VSSetShaderResources, + d3d10_device_VSSetSamplers, + d3d10_device_SetPredication, + d3d10_device_GSSetShaderResources, + d3d10_device_GSSetSamplers, + d3d10_device_OMSetRenderTargets, + d3d10_device_OMSetBlendState, + d3d10_device_OMSetDepthStencilState, + d3d10_device_SOSetTargets, + d3d10_device_DrawAuto, + d3d10_device_RSSetState, + d3d10_device_RSSetViewports, + d3d10_device_RSSetScissorRects, + d3d10_device_CopySubresourceRegion, + d3d10_device_CopyResource, + d3d10_device_UpdateSubresource, + d3d10_device_ClearRenderTargetView, + d3d10_device_ClearDepthStencilView, + d3d10_device_GenerateMips, + d3d10_device_ResolveSubresource, + d3d10_device_VSGetConstantBuffers, + d3d10_device_PSGetShaderResources, + d3d10_device_PSGetShader, + d3d10_device_PSGetSamplers, + d3d10_device_VSGetShader, + d3d10_device_PSGetConstantBuffers, + d3d10_device_IAGetInputLayout, + d3d10_device_IAGetVertexBuffers, + d3d10_device_IAGetIndexBuffer, + d3d10_device_GSGetConstantBuffers, + d3d10_device_GSGetShader, + d3d10_device_IAGetPrimitiveTopology, + d3d10_device_VSGetShaderResources, + d3d10_device_VSGetSamplers, + d3d10_device_GetPredication, + d3d10_device_GSGetShaderResources, + d3d10_device_GSGetSamplers, + d3d10_device_OMGetRenderTargets, + d3d10_device_OMGetBlendState, + d3d10_device_OMGetDepthStencilState, + d3d10_device_SOGetTargets, + d3d10_device_RSGetState, + d3d10_device_RSGetViewports, + d3d10_device_RSGetScissorRects, + d3d10_device_GetDeviceRemovedReason, + d3d10_device_SetExceptionMode, + d3d10_device_GetExceptionMode, + d3d10_device_GetPrivateData, + d3d10_device_SetPrivateData, + d3d10_device_SetPrivateDataInterface, + d3d10_device_ClearState, + d3d10_device_Flush, + d3d10_device_CreateBuffer, + d3d10_device_CreateTexture1D, + d3d10_device_CreateTexture2D, + d3d10_device_CreateTexture3D, + d3d10_device_CreateShaderResourceView, + d3d10_device_CreateRenderTargetView, + d3d10_device_CreateDepthStencilView, + d3d10_device_CreateInputLayout, + d3d10_device_CreateVertexShader, + d3d10_device_CreateGeometryShader, + d3d10_device_CreateGeometryShaderWithStreamOutput, + d3d10_device_CreatePixelShader, + d3d10_device_CreateBlendState, + d3d10_device_CreateDepthStencilState, + d3d10_device_CreateRasterizerState, + d3d10_device_CreateSamplerState, + d3d10_device_CreateQuery, + d3d10_device_CreatePredicate, + d3d10_device_CreateCounter, + d3d10_device_CheckFormatSupport, + d3d10_device_CheckMultisampleQualityLevels, + d3d10_device_CheckCounterInfo, + d3d10_device_CheckCounter, + d3d10_device_GetCreationFlags, + d3d10_device_OpenSharedResource, + d3d10_device_SetTextFilterSize, + d3d10_device_GetTextFilterSize, +}; diff --git a/dlls/d3d10/utils.c b/dlls/d3d10/utils.c new file mode 100644 index 00000000000..c1113afd8c9 --- /dev/null +++ b/dlls/d3d10/utils.c @@ -0,0 +1,162 @@ +/* + * Copyright 2008 Henri Verbeet for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + * + */ + +#include "config.h" +#include "wine/port.h" + +#include "d3d10_private.h" + +WINE_DEFAULT_DEBUG_CHANNEL(d3d10); + +#define WINE_D3D10_TO_STR(x) case x: return #x + +const char *debug_d3d10_driver_type(D3D10_DRIVER_TYPE driver_type) +{ + switch(driver_type) + { + WINE_D3D10_TO_STR(D3D10_DRIVER_TYPE_HARDWARE); + WINE_D3D10_TO_STR(D3D10_DRIVER_TYPE_REFERENCE); + WINE_D3D10_TO_STR(D3D10_DRIVER_TYPE_NULL); + WINE_D3D10_TO_STR(D3D10_DRIVER_TYPE_SOFTWARE); + default: + FIXME("Unrecognized D3D10_DRIVER_TYPE %#x\n", driver_type); + return "unrecognized"; + } +} + +const char *debug_d3d10_primitive_topology(D3D10_PRIMITIVE_TOPOLOGY topology) +{ + switch (topology) + { + WINE_D3D10_TO_STR(D3D10_PRIMITIVE_TOPOLOGY_UNDEFINED); + WINE_D3D10_TO_STR(D3D10_PRIMITIVE_TOPOLOGY_POINTLIST); + WINE_D3D10_TO_STR(D3D10_PRIMITIVE_TOPOLOGY_LINELIST); + WINE_D3D10_TO_STR(D3D10_PRIMITIVE_TOPOLOGY_LINESTRIP); + WINE_D3D10_TO_STR(D3D10_PRIMITIVE_TOPOLOGY_TRIANGLELIST); + WINE_D3D10_TO_STR(D3D10_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP); + WINE_D3D10_TO_STR(D3D10_PRIMITIVE_TOPOLOGY_LINELIST_ADJ); + WINE_D3D10_TO_STR(D3D10_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ); + WINE_D3D10_TO_STR(D3D10_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ); + WINE_D3D10_TO_STR(D3D10_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP_ADJ); + default: + FIXME("Unrecognized D3D10_PRIMITIVE_TOPOLOGY %#x\n", topology); + return "unrecognized"; + } +} + +const char *debug_dxgi_format(DXGI_FORMAT format) +{ + switch(format) + { + WINE_D3D10_TO_STR(DXGI_FORMAT_UNKNOWN); + WINE_D3D10_TO_STR(DXGI_FORMAT_R32G32B32A32_TYPELESS); + WINE_D3D10_TO_STR(DXGI_FORMAT_R32G32B32A32_FLOAT); + WINE_D3D10_TO_STR(DXGI_FORMAT_R32G32B32A32_UINT); + WINE_D3D10_TO_STR(DXGI_FORMAT_R32G32B32A32_SINT); + WINE_D3D10_TO_STR(DXGI_FORMAT_R32G32B32_TYPELESS); + WINE_D3D10_TO_STR(DXGI_FORMAT_R32G32B32_FLOAT); + WINE_D3D10_TO_STR(DXGI_FORMAT_R32G32B32_UINT); + WINE_D3D10_TO_STR(DXGI_FORMAT_R32G32B32_SINT); + WINE_D3D10_TO_STR(DXGI_FORMAT_R16G16B16A16_TYPELESS); + WINE_D3D10_TO_STR(DXGI_FORMAT_R16G16B16A16_FLOAT); + WINE_D3D10_TO_STR(DXGI_FORMAT_R16G16B16A16_UNORM); + WINE_D3D10_TO_STR(DXGI_FORMAT_R16G16B16A16_UINT); + WINE_D3D10_TO_STR(DXGI_FORMAT_R16G16B16A16_SNORM); + WINE_D3D10_TO_STR(DXGI_FORMAT_R16G16B16A16_SINT); + WINE_D3D10_TO_STR(DXGI_FORMAT_R32G32_TYPELESS); + WINE_D3D10_TO_STR(DXGI_FORMAT_R32G32_FLOAT); + WINE_D3D10_TO_STR(DXGI_FORMAT_R32G32_UINT); + WINE_D3D10_TO_STR(DXGI_FORMAT_R32G32_SINT); + WINE_D3D10_TO_STR(DXGI_FORMAT_R32G8X24_TYPELESS); + WINE_D3D10_TO_STR(DXGI_FORMAT_D32_FLOAT_S8X24_UINT); + WINE_D3D10_TO_STR(DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS); + WINE_D3D10_TO_STR(DXGI_FORMAT_X32_TYPELESS_G8X24_UINT); + WINE_D3D10_TO_STR(DXGI_FORMAT_R10G10B10A2_TYPELESS); + WINE_D3D10_TO_STR(DXGI_FORMAT_R10G10B10A2_UNORM); + WINE_D3D10_TO_STR(DXGI_FORMAT_R10G10B10A2_UINT); + WINE_D3D10_TO_STR(DXGI_FORMAT_R11G11B10_FLOAT); + WINE_D3D10_TO_STR(DXGI_FORMAT_R8G8B8A8_TYPELESS); + WINE_D3D10_TO_STR(DXGI_FORMAT_R8G8B8A8_UNORM); + WINE_D3D10_TO_STR(DXGI_FORMAT_R8G8B8A8_UNORM_SRGB); + WINE_D3D10_TO_STR(DXGI_FORMAT_R8G8B8A8_UINT); + WINE_D3D10_TO_STR(DXGI_FORMAT_R8G8B8A8_SNORM); + WINE_D3D10_TO_STR(DXGI_FORMAT_R8G8B8A8_SINT); + WINE_D3D10_TO_STR(DXGI_FORMAT_R16G16_TYPELESS); + WINE_D3D10_TO_STR(DXGI_FORMAT_R16G16_FLOAT); + WINE_D3D10_TO_STR(DXGI_FORMAT_R16G16_UNORM); + WINE_D3D10_TO_STR(DXGI_FORMAT_R16G16_UINT); + WINE_D3D10_TO_STR(DXGI_FORMAT_R16G16_SNORM); + WINE_D3D10_TO_STR(DXGI_FORMAT_R16G16_SINT); + WINE_D3D10_TO_STR(DXGI_FORMAT_R32_TYPELESS); + WINE_D3D10_TO_STR(DXGI_FORMAT_D32_FLOAT); + WINE_D3D10_TO_STR(DXGI_FORMAT_R32_FLOAT); + WINE_D3D10_TO_STR(DXGI_FORMAT_R32_UINT); + WINE_D3D10_TO_STR(DXGI_FORMAT_R32_SINT); + WINE_D3D10_TO_STR(DXGI_FORMAT_R24G8_TYPELESS); + WINE_D3D10_TO_STR(DXGI_FORMAT_D24_UNORM_S8_UINT); + WINE_D3D10_TO_STR(DXGI_FORMAT_R24_UNORM_X8_TYPELESS); + WINE_D3D10_TO_STR(DXGI_FORMAT_X24_TYPELESS_G8_UINT); + WINE_D3D10_TO_STR(DXGI_FORMAT_R8G8_TYPELESS); + WINE_D3D10_TO_STR(DXGI_FORMAT_R8G8_UNORM); + WINE_D3D10_TO_STR(DXGI_FORMAT_R8G8_UINT); + WINE_D3D10_TO_STR(DXGI_FORMAT_R8G8_SNORM); + WINE_D3D10_TO_STR(DXGI_FORMAT_R8G8_SINT); + WINE_D3D10_TO_STR(DXGI_FORMAT_R16_TYPELESS); + WINE_D3D10_TO_STR(DXGI_FORMAT_R16_FLOAT); + WINE_D3D10_TO_STR(DXGI_FORMAT_D16_UNORM); + WINE_D3D10_TO_STR(DXGI_FORMAT_R16_UNORM); + WINE_D3D10_TO_STR(DXGI_FORMAT_R16_UINT); + WINE_D3D10_TO_STR(DXGI_FORMAT_R16_SNORM); + WINE_D3D10_TO_STR(DXGI_FORMAT_R16_SINT); + WINE_D3D10_TO_STR(DXGI_FORMAT_R8_TYPELESS); + WINE_D3D10_TO_STR(DXGI_FORMAT_R8_UNORM); + WINE_D3D10_TO_STR(DXGI_FORMAT_R8_UINT); + WINE_D3D10_TO_STR(DXGI_FORMAT_R8_SNORM); + WINE_D3D10_TO_STR(DXGI_FORMAT_R8_SINT); + WINE_D3D10_TO_STR(DXGI_FORMAT_A8_UNORM); + WINE_D3D10_TO_STR(DXGI_FORMAT_R1_UNORM); + WINE_D3D10_TO_STR(DXGI_FORMAT_R9G9B9E5_SHAREDEXP); + WINE_D3D10_TO_STR(DXGI_FORMAT_R8G8_B8G8_UNORM); + WINE_D3D10_TO_STR(DXGI_FORMAT_G8R8_G8B8_UNORM); + WINE_D3D10_TO_STR(DXGI_FORMAT_BC1_TYPELESS); + WINE_D3D10_TO_STR(DXGI_FORMAT_BC1_UNORM); + WINE_D3D10_TO_STR(DXGI_FORMAT_BC1_UNORM_SRGB); + WINE_D3D10_TO_STR(DXGI_FORMAT_BC2_TYPELESS); + WINE_D3D10_TO_STR(DXGI_FORMAT_BC2_UNORM); + WINE_D3D10_TO_STR(DXGI_FORMAT_BC2_UNORM_SRGB); + WINE_D3D10_TO_STR(DXGI_FORMAT_BC3_TYPELESS); + WINE_D3D10_TO_STR(DXGI_FORMAT_BC3_UNORM); + WINE_D3D10_TO_STR(DXGI_FORMAT_BC3_UNORM_SRGB); + WINE_D3D10_TO_STR(DXGI_FORMAT_BC4_TYPELESS); + WINE_D3D10_TO_STR(DXGI_FORMAT_BC4_UNORM); + WINE_D3D10_TO_STR(DXGI_FORMAT_BC4_SNORM); + WINE_D3D10_TO_STR(DXGI_FORMAT_BC5_TYPELESS); + WINE_D3D10_TO_STR(DXGI_FORMAT_BC5_UNORM); + WINE_D3D10_TO_STR(DXGI_FORMAT_BC5_SNORM); + WINE_D3D10_TO_STR(DXGI_FORMAT_B5G6R5_UNORM); + WINE_D3D10_TO_STR(DXGI_FORMAT_B5G5R5A1_UNORM); + WINE_D3D10_TO_STR(DXGI_FORMAT_B8G8R8A8_UNORM); + WINE_D3D10_TO_STR(DXGI_FORMAT_B8G8R8X8_UNORM); + default: + FIXME("Unrecognized DXGI_FORMAT %#x\n", format); + return "unrecognized"; + } +} + +#undef WINE_D3D10_TO_STR diff --git a/dlls/d3d8/d3d8_main.c b/dlls/d3d8/d3d8_main.c index 56de60daba7..8e32dc3f9ad 100644 --- a/dlls/d3d8/d3d8_main.c +++ b/dlls/d3d8/d3d8_main.c @@ -53,7 +53,7 @@ IDirect3D8* WINAPI Direct3DCreate8(UINT SDKVersion) { object->lpVtbl = &Direct3D8_Vtbl; object->ref = 1; - object->WineD3D = WineDirect3DCreate(SDKVersion, 8, (IUnknown *)object); + object->WineD3D = WineDirect3DCreate(8, (IUnknown *)object); TRACE("Created Direct3D object @ %p, WineObj @ %p\n", object, object->WineD3D); LeaveCriticalSection(&d3d8_cs); diff --git a/dlls/d3d8/tests/visual.c b/dlls/d3d8/tests/visual.c index 33d6176c226..efead14d6db 100644 --- a/dlls/d3d8/tests/visual.c +++ b/dlls/d3d8/tests/visual.c @@ -1,6 +1,6 @@ /* * Copyright (C) 2005 Henri Verbeet - * Copyright (C) 2007 Stefan Dösinger(for CodeWeavers) + * Copyright (C) 2007 Stefan Dösinger(for CodeWeavers) * * 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/d3d9/d3d9_main.c b/dlls/d3d9/d3d9_main.c index 03c75a473f3..40d73a54e7a 100644 --- a/dlls/d3d9/d3d9_main.c +++ b/dlls/d3d9/d3d9_main.c @@ -48,7 +48,7 @@ IDirect3D9* WINAPI Direct3DCreate9(UINT SDKVersion) { object->lpVtbl = &Direct3D9_Vtbl; object->ref = 1; EnterCriticalSection(&d3d9_cs); - object->WineD3D = WineDirect3DCreate(SDKVersion, 9, (IUnknown *)object); + object->WineD3D = WineDirect3DCreate(9, (IUnknown *)object); LeaveCriticalSection(&d3d9_cs); TRACE("SDKVersion = %x, Created Direct3D object @ %p, WineObj @ %p\n", SDKVersion, object, object->WineD3D); diff --git a/dlls/d3d9/tests/d3d9ex.c b/dlls/d3d9/tests/d3d9ex.c index 3917a571bc8..9b2fd069915 100644 --- a/dlls/d3d9/tests/d3d9ex.c +++ b/dlls/d3d9/tests/d3d9ex.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008 Stefan Dösinger(for CodeWeavers) + * Copyright (C) 2008 Stefan Dösinger(for CodeWeavers) * * 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/d3d9/tests/device.c b/dlls/d3d9/tests/device.c index 3cafce28ad3..88394cfb38d 100644 --- a/dlls/d3d9/tests/device.c +++ b/dlls/d3d9/tests/device.c @@ -1,9 +1,9 @@ /* * Copyright (C) 2006 Vitaliy Margolen * Copyright (C) 2006 Chris Robinson - * Copyright (C) 2006-2007 Stefan Dösinger(For CodeWeavers) + * Copyright (C) 2006-2007 Stefan Dösinger(For CodeWeavers) * Copyright 2007 Henri Verbeet - * Copyright (C) 2008 Rico Schüller + * Copyright (C) 2008 Rico Schüller * * 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/d3d9/tests/query.c b/dlls/d3d9/tests/query.c index 6e8b4c9369c..c4e7874d1b7 100644 --- a/dlls/d3d9/tests/query.c +++ b/dlls/d3d9/tests/query.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2006-2007 Stefan Dösinger(For CodeWeavers) + * Copyright (C) 2006-2007 Stefan Dösinger(For CodeWeavers) * * 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/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index c49d5b6792e..a622d56dd9c 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -1,6 +1,6 @@ /* * Copyright 2005, 2007-2008 Henri Verbeet - * Copyright (C) 2007-2008 Stefan Dösinger(for CodeWeavers) + * Copyright (C) 2007-2008 Stefan Dösinger(for CodeWeavers) * Copyright (C) 2008 Jason Green(for TransGaming) * * This library is free software; you can redistribute it and/or diff --git a/dlls/dbghelp/dbghelp_private.h b/dlls/dbghelp/dbghelp_private.h index 26c3a3dd403..3eb420e75c2 100644 --- a/dlls/dbghelp/dbghelp_private.h +++ b/dlls/dbghelp/dbghelp_private.h @@ -476,7 +476,8 @@ extern BOOL pdb_fetch_file_info(struct pdb_lookup* pdb_lookup); /* path.c */ extern BOOL path_find_symbol_file(const struct process* pcs, PCSTR full_path, - const GUID* guid, DWORD dw1, DWORD dw2, PSTR buffer); + const GUID* guid, DWORD dw1, DWORD dw2, PSTR buffer, + BOOL* is_unmatched); /* pe_module.c */ extern BOOL pe_load_nt_header(HANDLE hProc, DWORD base, IMAGE_NT_HEADERS* nth); diff --git a/dlls/dbghelp/msc.c b/dlls/dbghelp/msc.c index 1f5058a1cfa..2f62fec596d 100644 --- a/dlls/dbghelp/msc.c +++ b/dlls/dbghelp/msc.c @@ -2134,7 +2134,8 @@ static void pdb_convert_symbol_file(const PDB_SYMBOLS* symbols, } static HANDLE open_pdb_file(const struct process* pcs, - const struct pdb_lookup* lookup) + const struct pdb_lookup* lookup, + struct module* module) { HANDLE h; char dbg_file_path[MAX_PATH]; @@ -2144,11 +2145,11 @@ static HANDLE open_pdb_file(const struct process* pcs, { case PDB_JG: ret = path_find_symbol_file(pcs, lookup->filename, NULL, lookup->u.jg.timestamp, - lookup->age, dbg_file_path); + lookup->age, dbg_file_path, &module->module.PdbUnmatched); break; case PDB_DS: ret = path_find_symbol_file(pcs, lookup->filename, &lookup->u.ds.guid, 0, - lookup->age, dbg_file_path); + lookup->age, dbg_file_path, &module->module.PdbUnmatched); break; } if (!ret) @@ -2403,7 +2404,7 @@ static BOOL pdb_process_internal(const struct process* pcs, TRACE("Processing PDB file %s\n", pdb_lookup->filename); /* Open and map() .PDB file */ - if ((hFile = open_pdb_file(pcs, pdb_lookup)) == NULL || + if ((hFile = open_pdb_file(pcs, pdb_lookup, msc_dbg->module)) == NULL || ((hMap = CreateFileMappingW(hFile, NULL, PAGE_READONLY, 0, 0, NULL)) == NULL) || ((image = MapViewOfFile(hMap, FILE_MAP_READ, 0, 0, 0)) == NULL)) { diff --git a/dlls/dbghelp/path.c b/dlls/dbghelp/path.c index 3ae492139f4..e0cfc97a082 100644 --- a/dlls/dbghelp/path.c +++ b/dlls/dbghelp/path.c @@ -612,7 +612,8 @@ static BOOL CALLBACK module_find_cb(PCWSTR buffer, PVOID user) } BOOL path_find_symbol_file(const struct process* pcs, PCSTR full_path, - const GUID* guid, DWORD dw1, DWORD dw2, PSTR buffer) + const GUID* guid, DWORD dw1, DWORD dw2, PSTR buffer, + BOOL* is_unmatched) { struct module_find mf; WCHAR full_pathW[MAX_PATH]; @@ -632,6 +633,7 @@ BOOL path_find_symbol_file(const struct process* pcs, PCSTR full_path, MultiByteToWideChar(CP_ACP, 0, full_path, -1, full_pathW, MAX_PATH); filename = file_nameW(full_pathW); mf.kind = module_get_type_by_name(filename); + *is_unmatched = FALSE; /* first check full path to file */ if (module_find_cb(full_pathW, &mf)) @@ -665,6 +667,7 @@ BOOL path_find_symbol_file(const struct process* pcs, PCSTR full_path, if ((dbghelp_options & SYMOPT_LOAD_ANYTHING) && mf.matched) { WideCharToMultiByte(CP_ACP, 0, mf.filename, -1, buffer, MAX_PATH, NULL, NULL); + *is_unmatched = TRUE; return TRUE; } return FALSE; diff --git a/dlls/dbghelp/pe_module.c b/dlls/dbghelp/pe_module.c index 7b62529a211..a79396f5191 100644 --- a/dlls/dbghelp/pe_module.c +++ b/dlls/dbghelp/pe_module.c @@ -94,7 +94,7 @@ static BOOL pe_load_dbg_file(const struct process* pcs, struct module* module, TRACE("Processing DBG file %s\n", debugstr_a(dbg_name)); - if (path_find_symbol_file(pcs, dbg_name, NULL, timestamp, 0, tmp) && + if (path_find_symbol_file(pcs, dbg_name, NULL, timestamp, 0, tmp, &module->module.DbgUnmatched) && (hFile = CreateFileA(tmp, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL)) != INVALID_HANDLE_VALUE && ((hMap = CreateFileMappingW(hFile, NULL, PAGE_READONLY, 0, 0, NULL)) != 0) && diff --git a/dlls/dbghelp/stack.c b/dlls/dbghelp/stack.c index 04f36fb7c15..3c66fcbc04c 100644 --- a/dlls/dbghelp/stack.c +++ b/dlls/dbghelp/stack.c @@ -3,7 +3,7 @@ * * Copyright 1995 Alexandre Julliard * Copyright 1996 Eric Youngdale - * Copyright 1999 Ove Kåven + * Copyright 1999 Ove Kåven * Copyright 2004 Eric Pouech * * This library is free software; you can redistribute it and/or diff --git a/dlls/ddraw/clipper.c b/dlls/ddraw/clipper.c index 517bc7c49bc..e3bbfb9afe7 100644 --- a/dlls/ddraw/clipper.c +++ b/dlls/ddraw/clipper.c @@ -2,7 +2,7 @@ * * Copyright 2000 (c) Marcus Meissner * Copyright 2000 (c) TransGaming Technologies Inc. - * Copyright 2006 (c) Stefan Dösinger + * Copyright 2006 (c) Stefan Dösinger * * 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/ddraw/ddraw.c b/dlls/ddraw/ddraw.c index 3af4da47c49..3f608f744eb 100644 --- a/dlls/ddraw/ddraw.c +++ b/dlls/ddraw/ddraw.c @@ -2,7 +2,7 @@ * Copyright 1997-2000 Marcus Meissner * Copyright 1998-2000 Lionel Ulmer * Copyright 2000-2001 TransGaming Technologies Inc. - * Copyright 2006 Stefan Dösinger + * Copyright 2006 Stefan Dösinger * Copyright 2008 Denver Gingerich * * This library is free software; you can redistribute it and/or diff --git a/dlls/ddraw/ddraw_private.h b/dlls/ddraw/ddraw_private.h index a92f7f4e3ef..cd1ce1581f1 100644 --- a/dlls/ddraw/ddraw_private.h +++ b/dlls/ddraw/ddraw_private.h @@ -1,5 +1,5 @@ /* - * Copyright 2006 Stefan Dösinger + * Copyright 2006 Stefan Dösinger * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -414,8 +414,7 @@ struct IDirectDrawClipperImpl const IDirectDrawClipperVtbl IDirectDrawClipper_Vtbl; -typedef IWineD3DClipper* (WINAPI *fnWineDirect3DCreateClipper)(IUnknown *); -fnWineDirect3DCreateClipper pWineDirect3DCreateClipper; +typeof(WineDirect3DCreateClipper) *pWineDirect3DCreateClipper; /***************************************************************************** * IDirectDrawPalette implementation structure diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c index 2eb2ae2e5a9..7efc66f5261 100644 --- a/dlls/ddraw/device.c +++ b/dlls/ddraw/device.c @@ -1,7 +1,7 @@ /* * Copyright (c) 1998-2004 Lionel Ulmer * Copyright (c) 2002-2005 Christian Costa - * Copyright (c) 2006 Stefan Dösinger + * Copyright (c) 2006 Stefan Dösinger * Copyright (c) 2008 Alexander Dorofeyev * * This library is free software; you can redistribute it and/or diff --git a/dlls/ddraw/direct3d.c b/dlls/ddraw/direct3d.c index 5e21e5befa1..60591d69a4a 100644 --- a/dlls/ddraw/direct3d.c +++ b/dlls/ddraw/direct3d.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006 Stefan Dösinger + * Copyright (c) 2006 Stefan Dösinger * * 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/ddraw/executebuffer.c b/dlls/ddraw/executebuffer.c index 799390b5fea..f862d5327f8 100644 --- a/dlls/ddraw/executebuffer.c +++ b/dlls/ddraw/executebuffer.c @@ -1,7 +1,7 @@ /* Direct3D ExecuteBuffer * Copyright (c) 1998-2004 Lionel ULMER * Copyright (c) 2002-2004 Christian Costa - * Copyright (c) 2006 Stefan Dösinger + * Copyright (c) 2006 Stefan Dösinger * * This file contains the implementation of IDirect3DExecuteBuffer. * diff --git a/dlls/ddraw/gamma.c b/dlls/ddraw/gamma.c index 949d6732330..71182f44cc9 100644 --- a/dlls/ddraw/gamma.c +++ b/dlls/ddraw/gamma.c @@ -1,7 +1,7 @@ /* DirectDrawGammaControl implementation * * Copyright 2001 TransGaming Technologies Inc. - * Copyright 2006 Stefan Dösinger + * Copyright 2006 Stefan Dösinger * * 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/ddraw/light.c b/dlls/ddraw/light.c index eec147e13e7..e09c7b6b7a5 100644 --- a/dlls/ddraw/light.c +++ b/dlls/ddraw/light.c @@ -1,6 +1,6 @@ /* Direct3D Light * Copyright (c) 1998 / 2002 Lionel ULMER - * Copyright (c) 2006 Stefan DÖSINGER + * Copyright (c) 2006 Stefan DÖSINGER * * This file contains the implementation of Direct3DLight. * diff --git a/dlls/ddraw/main.c b/dlls/ddraw/main.c index 5f04feadb2e..21cd272d921 100644 --- a/dlls/ddraw/main.c +++ b/dlls/ddraw/main.c @@ -3,7 +3,7 @@ * Copyright 1997-1999 Marcus Meissner * Copyright 1998 Lionel Ulmer * Copyright 2000-2001 TransGaming Technologies Inc. - * Copyright 2006 Stefan Dösinger + * Copyright 2006 Stefan Dösinger * Copyright 2008 Denver Gingerich * * This file contains the (internal) driver registration functions, @@ -47,9 +47,7 @@ #include "ddraw_private.h" -typedef IWineD3D* (WINAPI *fnWineDirect3DCreate)(UINT, UINT, IUnknown *); - -static fnWineDirect3DCreate pWineDirect3DCreate; +static typeof(WineDirect3DCreate) *pWineDirect3DCreate; WINE_DEFAULT_DEBUG_CHANNEL(ddraw); @@ -88,8 +86,8 @@ BOOL LoadWineD3D(void) hWineD3D = LoadLibraryA("wined3d"); if (hWineD3D) { - pWineDirect3DCreate = (fnWineDirect3DCreate) GetProcAddress(hWineD3D, "WineDirect3DCreate"); - pWineDirect3DCreateClipper = (fnWineDirect3DCreateClipper) GetProcAddress(hWineD3D, "WineDirect3DCreateClipper"); + pWineDirect3DCreate = (typeof(WineDirect3DCreate) *)GetProcAddress(hWineD3D, "WineDirect3DCreate"); + pWineDirect3DCreateClipper = (typeof(WineDirect3DCreateClipper) *) GetProcAddress(hWineD3D, "WineDirect3DCreateClipper"); return TRUE; } } @@ -208,7 +206,7 @@ DDRAW_Create(const GUID *guid, * but DirectDraw specific management, like DDSURFACEDESC and DDPIXELFORMAT * structure handling is handled in this lib. */ - wineD3D = pWineDirect3DCreate(0 /* SDKVersion */, 7 /* DXVersion */, (IUnknown *) This /* Parent */); + wineD3D = pWineDirect3DCreate(7 /* DXVersion */, (IUnknown *) This /* Parent */); if(!wineD3D) { ERR("Failed to initialise WineD3D\n"); diff --git a/dlls/ddraw/material.c b/dlls/ddraw/material.c index d6b9a7c165e..a1185f5b0ba 100644 --- a/dlls/ddraw/material.c +++ b/dlls/ddraw/material.c @@ -1,6 +1,6 @@ /* Direct3D Material * Copyright (c) 2002 Lionel ULMER - * Copyright (c) 2006 Stefan DÖSINGER + * Copyright (c) 2006 Stefan DÖSINGER * * This file contains the implementation of Direct3DMaterial. * diff --git a/dlls/ddraw/palette.c b/dlls/ddraw/palette.c index 5ac2ae86c0f..7e9776e4fc6 100644 --- a/dlls/ddraw/palette.c +++ b/dlls/ddraw/palette.c @@ -1,6 +1,6 @@ /* DirectDraw - IDirectPalette base interface * - * Copyright 2006 Stefan Dösinger + * Copyright 2006 Stefan Dösinger * * 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/ddraw/parent.c b/dlls/ddraw/parent.c index 163bc4da00f..0846826dc62 100644 --- a/dlls/ddraw/parent.c +++ b/dlls/ddraw/parent.c @@ -1,7 +1,7 @@ /* * IParent implementation * - * Copyright (c) 2006 Stefan Dösinger + * Copyright (c) 2006 Stefan Dösinger * * 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/ddraw/surface.c b/dlls/ddraw/surface.c index 727bcce7913..d263f67852a 100644 --- a/dlls/ddraw/surface.c +++ b/dlls/ddraw/surface.c @@ -3,7 +3,7 @@ * Copyright (c) 1997-2000 Marcus Meissner * Copyright (c) 1998-2000 Lionel Ulmer * Copyright (c) 2000-2001 TransGaming Technologies Inc. - * Copyright (c) 2006 Stefan Dösinger + * Copyright (c) 2006 Stefan Dösinger * * This file contains the (internal) driver registration functions, * driver enumeration APIs and DirectDraw creation functions. @@ -1036,7 +1036,7 @@ IDirectDrawSurfaceImpl_AddOverlayDirtyRect(IDirectDrawSurface7 *iface, /* MSDN says it's not implemented. I could forward it to WineD3D, * then we'd implement it, but I don't think that's a good idea - * (Stefan Dösinger) + * (Stefan Dösinger) */ #if 0 return IWineD3DSurface_AddOverlayDirtyRect(This->WineD3DSurface, pRect); diff --git a/dlls/ddraw/tests/d3d.c b/dlls/ddraw/tests/d3d.c index 9bb55524d05..94a0dfecc5c 100644 --- a/dlls/ddraw/tests/d3d.c +++ b/dlls/ddraw/tests/d3d.c @@ -2,7 +2,7 @@ * Some unit tests for d3d functions * * Copyright (C) 2005 Antoine Chavasse - * Copyright (C) 2006 Stefan Dösinger for CodeWeavers + * Copyright (C) 2006 Stefan Dösinger for CodeWeavers * Copyright (C) 2008 Alexander Dorofeyev * * This library is free software; you can redistribute it and/or diff --git a/dlls/ddraw/tests/dsurface.c b/dlls/ddraw/tests/dsurface.c index fc7bb883516..ccd75e0263a 100644 --- a/dlls/ddraw/tests/dsurface.c +++ b/dlls/ddraw/tests/dsurface.c @@ -4,7 +4,7 @@ * Copyright (C) 2005 Antoine Chavasse (a.chavasse@gmail.com) * Copyright (C) 2005 Christian Costa * Copyright 2005 Ivan Leo Puoti - * Copyright (C) 2007 Stefan Dösinger + * Copyright (C) 2007 Stefan Dösinger * Copyright (C) 2008 Alexander Dorofeyev * * This library is free software; you can redistribute it and/or diff --git a/dlls/ddraw/tests/overlay.c b/dlls/ddraw/tests/overlay.c index b5fcdc70fbc..8dd8805999f 100644 --- a/dlls/ddraw/tests/overlay.c +++ b/dlls/ddraw/tests/overlay.c @@ -1,7 +1,7 @@ /* * Unit tests for DirectDraw overlay functions * - * Copyright (C) 2008 Stefan Dösinger for CodeWeavers + * Copyright (C) 2008 Stefan Dösinger for CodeWeavers * * 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/ddraw/tests/visual.c b/dlls/ddraw/tests/visual.c index ede24eb15b9..12f11c9e50a 100644 --- a/dlls/ddraw/tests/visual.c +++ b/dlls/ddraw/tests/visual.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007 Stefan Dösinger(for CodeWeavers) + * Copyright (C) 2007 Stefan Dösinger(for CodeWeavers) * Copyright (C) 2008 Alexander Dorofeyev * * This library is free software; you can redistribute it and/or diff --git a/dlls/ddraw/texture.c b/dlls/ddraw/texture.c index 046a51e3958..2097a018c69 100644 --- a/dlls/ddraw/texture.c +++ b/dlls/ddraw/texture.c @@ -1,6 +1,6 @@ /* Direct3D Texture * Copyright (c) 1998 Lionel ULMER - * Copyright (c) 2006 Stefan DÖSINGER + * Copyright (c) 2006 Stefan DÖSINGER * * This file contains the implementation of interface Direct3DTexture2. * diff --git a/dlls/ddraw/utils.c b/dlls/ddraw/utils.c index 02d74c739b5..b07ebd880f5 100644 --- a/dlls/ddraw/utils.c +++ b/dlls/ddraw/utils.c @@ -4,7 +4,7 @@ * Copyright (c) 1997-2000 Marcus Meissner * Copyright (c) 1998 Lionel Ulmer * Copyright (c) 2000 TransGaming Technologies Inc. - * Copyright (c) 2006 Stefan Dösinger + * Copyright (c) 2006 Stefan Dösinger * * 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/ddraw/vertexbuffer.c b/dlls/ddraw/vertexbuffer.c index 2469644c2b1..caac15f71be 100644 --- a/dlls/ddraw/vertexbuffer.c +++ b/dlls/ddraw/vertexbuffer.c @@ -1,6 +1,6 @@ /* Direct3D Vertex Buffer * Copyright (c) 2002 Lionel ULMER - * Copyright (c) 2006 Stefan DÖSINGER + * Copyright (c) 2006 Stefan DÖSINGER * * This file contains the implementation of Direct3DVertexBuffer COM object * diff --git a/dlls/ddraw/viewport.c b/dlls/ddraw/viewport.c index bb71955e420..4da988dc280 100644 --- a/dlls/ddraw/viewport.c +++ b/dlls/ddraw/viewport.c @@ -1,6 +1,6 @@ /* Direct3D Viewport * Copyright (c) 1998 Lionel ULMER - * Copyright (c) 2006-2007 Stefan DÖSINGER + * Copyright (c) 2006-2007 Stefan DÖSINGER * * This file contains the implementation of Direct3DViewport2. * diff --git a/dlls/dpnet/peer.c b/dlls/dpnet/peer.c index dbb8890100a..1bc3b47bbea 100644 --- a/dlls/dpnet/peer.c +++ b/dlls/dpnet/peer.c @@ -2,7 +2,7 @@ * DirectPlay8 Peer * * Copyright 2004 Raphael Junqueira - * Copyright 2008 Alexander N. Sørnes + * Copyright 2008 Alexander N. Sørnes * * 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/dpnet/threadpool.c b/dlls/dpnet/threadpool.c index 1ab045de962..f94a3fa194e 100644 --- a/dlls/dpnet/threadpool.c +++ b/dlls/dpnet/threadpool.c @@ -2,7 +2,7 @@ * DirectPlay8 ThreadPool * * Copyright 2004 Raphael Junqueira - * Copyright 2008 Alexander N. Sørnes + * Copyright 2008 Alexander N. Sørnes * * 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/dsound/tests/capture.c b/dlls/dsound/tests/capture.c index 2da7fcc2c8b..b2a377ac154 100644 --- a/dlls/dsound/tests/capture.c +++ b/dlls/dsound/tests/capture.c @@ -567,8 +567,9 @@ static BOOL WINAPI dscenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription, if (winetest_interactive) trace(" Testing the capture buffer at %s\n", format_string(&wfx)); rc=IDirectSoundCapture_CreateCaptureBuffer(dsco,&bufdesc,&dscbo,NULL); - ok(((rc==DS_OK)&&(dscbo!=NULL))||(rc==DSERR_BADFORMAT)|| - ((rc==DSERR_NODRIVER))||(rc==DSERR_ALLOCATED)||(rc==E_INVALIDARG)||(rc==E_FAIL), + ok(((rc==DS_OK)&&(dscbo!=NULL)) + || rc==DSERR_BADFORMAT || rc==DSERR_INVALIDCALL || rc==DSERR_NODRIVER + || rc==DSERR_ALLOCATED || rc==E_INVALIDARG || rc==E_FAIL, "IDirectSoundCapture_CreateCaptureBuffer() failed to create a " "%s capture buffer: %08x\n",format_string(&wfx),rc); if (rc==DS_OK) { @@ -596,9 +597,13 @@ static BOOL WINAPI dscenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription, bufdesc1.lpwfxFormat=&wfx; rc=IDirectSoundCapture_CreateCaptureBuffer(dsco, (DSCBUFFERDESC*)&bufdesc1,&dscbo,NULL); - ok(rc==DS_OK || broken(rc==E_INVALIDARG), + ok(rc==DS_OK || broken(rc==DSERR_INVALIDPARAM), "IDirectSoundCapture_CreateCaptureBuffer() failed to create a " "%s capture buffer: %08x\n",format_string(&wfx), rc); + if (rc==DSERR_INVALIDPARAM) { + skip("broken driver\n"); + goto EXIT; + } if (rc==DS_OK) { test_capture_buffer(dsco, dscbo, winetest_interactive); ref=IDirectSoundCaptureBuffer_Release(dscbo); diff --git a/dlls/dsound/tests/propset.c b/dlls/dsound/tests/propset.c index 5d87e891aee..88ea3dc648c 100644 --- a/dlls/dsound/tests/propset.c +++ b/dlls/dsound/tests/propset.c @@ -591,8 +591,14 @@ static BOOL WINAPI dsenum_callback(LPGUID lpGuid, LPCSTR lpcstrDescription, bufdesc.dwSize=sizeof(bufdesc); bufdesc.dwFlags=DSBCAPS_PRIMARYBUFFER|DSBCAPS_LOCHARDWARE|DSBCAPS_CTRL3D; rc=IDirectSound_CreateSoundBuffer(dso,&bufdesc,&primary,NULL); - ok(rc==DS_OK&&primary!=NULL,"IDirectSound_CreateSoundBuffer() failed to " + ok((rc==DS_OK&&primary!=NULL) + || broken(rc==DSERR_INVALIDPARAM), + "IDirectSound_CreateSoundBuffer() failed to " "create a hardware 3D primary buffer: %08x\n",rc); + if(rc==DSERR_INVALIDPARAM) { + skip("broken driver\n"); + goto EXIT; + } if (rc==DS_OK&&primary!=NULL) { ZeroMemory(&wfx, sizeof(wfx)); wfx.wFormatTag=WAVE_FORMAT_PCM; diff --git a/dlls/d3d10/Makefile.in b/dlls/dxgi/Makefile.in similarity index 63% copy from dlls/d3d10/Makefile.in copy to dlls/dxgi/Makefile.in index d9bb511d786..3a489947728 100644 --- a/dlls/d3d10/Makefile.in +++ b/dlls/dxgi/Makefile.in @@ -2,12 +2,15 @@ TOPSRCDIR = @top_srcdir@ TOPOBJDIR = ../.. SRCDIR = @srcdir@ VPATH = @srcdir@ -MODULE = d3d10.dll -IMPORTLIB = d3d10 -IMPORTS = dxguid uuid wined3d kernel32 +MODULE = dxgi.dll +IMPORTLIB = dxgi +IMPORTS = dxguid uuid kernel32 C_SRCS = \ - d3d10_main.c + device.c \ + dxgi_main.c \ + factory.c \ + utils.c RC_SRCS = version.rc diff --git a/dlls/dxgi/device.c b/dlls/dxgi/device.c new file mode 100644 index 00000000000..9c7f252e613 --- /dev/null +++ b/dlls/dxgi/device.c @@ -0,0 +1,162 @@ +/* + * Copyright 2008 Henri Verbeet for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + * + */ + +#include "config.h" +#include "wine/port.h" + +#include "dxgi_private.h" + +WINE_DEFAULT_DEBUG_CHANNEL(dxgi); + +/* IUnknown methods */ + +HRESULT STDMETHODCALLTYPE dxgi_device_QueryInterface(IDXGIDevice* iface, REFIID riid, void **object) +{ + TRACE("iface %p, riid %s, object %p\n", iface, debugstr_guid(riid), object); + + if (IsEqualGUID(riid, &IID_IUnknown) + || IsEqualGUID(riid, &IID_IDXGIObject) + || IsEqualGUID(riid, &IID_IDXGIDevice)) + { + IUnknown_AddRef(iface); + *object = iface; + return S_OK; + } + + WARN("%s not implemented, returning E_NOINTERFACE\n", debugstr_guid(riid)); + + *object = NULL; + return E_NOINTERFACE; +} + +ULONG STDMETHODCALLTYPE dxgi_device_AddRef(IDXGIDevice* iface) +{ + struct dxgi_device *This = (struct dxgi_device *)iface; + ULONG refcount = InterlockedIncrement(&This->refcount); + + TRACE("%p increasing refcount to %u\n", This, refcount); + + return refcount; +} + +ULONG STDMETHODCALLTYPE dxgi_device_Release(IDXGIDevice* iface) +{ + struct dxgi_device *This = (struct dxgi_device *)iface; + ULONG refcount = InterlockedDecrement(&This->refcount); + + TRACE("%p decreasing refcount to %u\n", This, refcount); + + if (!refcount) + { + HeapFree(GetProcessHeap(), 0, This); + } + + return refcount; +} + +/* IDXGIObject methods */ + +HRESULT STDMETHODCALLTYPE dxgi_device_SetPrivateData(IDXGIDevice* iface, REFGUID guid, UINT data_size, const void *data) +{ + FIXME("iface %p, guid %s, data_size %u, data %p stub!\n", iface, debugstr_guid(guid), data_size, data); + + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE dxgi_device_SetPrivateDataInterface(IDXGIDevice* iface, REFGUID guid, const IUnknown *object) +{ + FIXME("iface %p, guid %s, object %p stub!\n", iface, debugstr_guid(guid), object); + + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE dxgi_device_GetPrivateData(IDXGIDevice* iface, REFGUID guid, UINT *data_size, void *data) +{ + FIXME("iface %p, guid %s, data_size %p, data %p stub!\n", iface, debugstr_guid(guid), data_size, data); + + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE dxgi_device_GetParent(IDXGIDevice* iface, REFIID riid, void **parent) +{ + FIXME("iface %p, riid %s, parent %p stub!\n", iface, debugstr_guid(riid), parent); + + return E_NOTIMPL; +} + +/* IDXGIDevice methods */ + +HRESULT STDMETHODCALLTYPE dxgi_device_GetAdapter(IDXGIDevice* iface, IDXGIAdapter **adapter) +{ + FIXME("iface %p, adapter %p stub!\n", iface, adapter); + + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE dxgi_device_CreateSurface(IDXGIDevice* iface, + const DXGI_SURFACE_DESC *desc, UINT surface_count, DXGI_USAGE usage, + const DXGI_SHARED_RESOURCE *shared_resource, IDXGISurface **surface) +{ + FIXME("iface %p, desc %p, surface_count %u, usage %#x, shared_resource %p, surface %p stub!\n", + iface, desc, surface_count, usage, shared_resource, surface); + + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE dxgi_device_QueryResourceResidency(IDXGIDevice* iface, + IUnknown *const *resources, DXGI_RESIDENCY *residency, UINT resource_count) +{ + FIXME("iface %p, resources %p, residency %p, resource_count %u stub!\n", + iface, resources, residency, resource_count); + + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE dxgi_device_SetGPUThreadPriority(IDXGIDevice* iface, INT priority) +{ + FIXME("iface %p, priority %d stub!\n", iface, priority); + + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE dxgi_device_GetGPUThreadPriority(IDXGIDevice* iface, INT *priority) +{ + FIXME("iface %p, priority %p stub!\n", iface, priority); + + return E_NOTIMPL; +} + +const struct IDXGIDeviceVtbl dxgi_device_vtbl = +{ + /* IUnknown methods */ + dxgi_device_QueryInterface, + dxgi_device_AddRef, + dxgi_device_Release, + /* IDXGIObject methods */ + dxgi_device_SetPrivateData, + dxgi_device_SetPrivateDataInterface, + dxgi_device_GetPrivateData, + dxgi_device_GetParent, + /* IDXGIDevice methods */ + dxgi_device_GetAdapter, + dxgi_device_CreateSurface, + dxgi_device_QueryResourceResidency, + dxgi_device_SetGPUThreadPriority, + dxgi_device_GetGPUThreadPriority, +}; diff --git a/dlls/dxgi/dxgi.spec b/dlls/dxgi/dxgi.spec new file mode 100644 index 00000000000..1c5069d5ddc --- /dev/null +++ b/dlls/dxgi/dxgi.spec @@ -0,0 +1 @@ +@ stdcall CreateDXGIFactory(ptr ptr) diff --git a/dlls/dxgi/dxgi_main.c b/dlls/dxgi/dxgi_main.c new file mode 100644 index 00000000000..44b4eeec36a --- /dev/null +++ b/dlls/dxgi/dxgi_main.c @@ -0,0 +1,64 @@ +/* + * Copyright 2008 Henri Verbeet for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + * + */ + +#include "config.h" +#include "wine/port.h" + +#include "dxgi_private.h" + +WINE_DEFAULT_DEBUG_CHANNEL(dxgi); + +BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv) +{ + TRACE("fdwReason %u\n", fdwReason); + + switch(fdwReason) + { + case DLL_PROCESS_ATTACH: + DisableThreadLibraryCalls(hInstDLL); + break; + } + + return TRUE; +} + +HRESULT WINAPI CreateDXGIFactory(REFIID riid, void **factory) +{ + struct dxgi_factory *object; + HRESULT hr; + + FIXME("riid %s, factory %p partial stub!\n", debugstr_guid(riid), factory); + + object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); + if (!object) + { + ERR("Failed to allocate DXGI factory object memory\n"); + return E_OUTOFMEMORY; + } + + object->vtbl = &dxgi_factory_vtbl; + object->refcount = 1; + + TRACE("Created IDXGIFactory %p\n", object); + + hr = IDXGIFactory_QueryInterface((IDXGIFactory *)object, riid, factory); + IDXGIFactory_Release((IDXGIFactory *)object); + + return hr; +} diff --git a/dlls/d3d10/d3d10_main.c b/dlls/dxgi/dxgi_private.h similarity index 57% copy from dlls/d3d10/d3d10_main.c copy to dlls/dxgi/dxgi_private.h index 8d80c41f619..110c9c08005 100644 --- a/dlls/d3d10/d3d10_main.c +++ b/dlls/dxgi/dxgi_private.h @@ -1,7 +1,5 @@ /* - * Direct3D 10 - * - * Copyright 2007 Andras Kovacs + * Copyright 2008 Henri Verbeet for CodeWeavers * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -16,30 +14,37 @@ * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - * */ -#include "config.h" -#include +#ifndef __WINE_DXGI_PRIVATE_H +#define __WINE_DXGI_PRIVATE_H -#include "windef.h" +#include "wine/debug.h" + +#define COBJMACROS #include "winbase.h" #include "winuser.h" -#include "wine/debug.h" +#include "objbase.h" -WINE_DEFAULT_DEBUG_CHANNEL(d3d10); +#include "dxgi.h" -/* At process attach */ -BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv) +/* TRACE helper functions */ +const char *debug_dxgi_format(DXGI_FORMAT format); + +/* IDXGIFactory */ +extern const struct IDXGIFactoryVtbl dxgi_factory_vtbl; +struct dxgi_factory +{ + const struct IDXGIFactoryVtbl *vtbl; + LONG refcount; +}; + +/* IDXGIDevice */ +extern const struct IDXGIDeviceVtbl dxgi_device_vtbl; +struct dxgi_device { - TRACE("fdwReason=%d\n", fdwReason); - switch(fdwReason) - { - case DLL_WINE_PREATTACH: - return FALSE; /* prefer native version */ - case DLL_PROCESS_ATTACH: - DisableThreadLibraryCalls( hInstDLL ); - break; - } - return TRUE; -} + const struct IDXGIDeviceVtbl *vtbl; + LONG refcount; +}; + +#endif /* __WINE_DXGI_PRIVATE_H */ diff --git a/dlls/dxgi/factory.c b/dlls/dxgi/factory.c new file mode 100644 index 00000000000..d9593e3b63b --- /dev/null +++ b/dlls/dxgi/factory.c @@ -0,0 +1,162 @@ +/* + * Copyright 2008 Henri Verbeet for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + * + */ + +#include "config.h" +#include "wine/port.h" + +#include "dxgi_private.h" + +WINE_DEFAULT_DEBUG_CHANNEL(dxgi); + +/* IUnknown methods */ + +HRESULT STDMETHODCALLTYPE dxgi_factory_QueryInterface(IDXGIFactory* iface, REFIID riid, void **object) +{ + TRACE("iface %p, riid %s, object %p\n", iface, debugstr_guid(riid), object); + + if (IsEqualGUID(riid, &IID_IUnknown) + || IsEqualGUID(riid, &IID_IDXGIObject) + || IsEqualGUID(riid, &IID_IDXGIFactory)) + { + IUnknown_AddRef(iface); + *object = iface; + return S_OK; + } + + WARN("%s not implemented, returning E_NOINTERFACE\n", debugstr_guid(riid)); + + *object = NULL; + return E_NOINTERFACE; +} + +ULONG STDMETHODCALLTYPE dxgi_factory_AddRef(IDXGIFactory* iface) +{ + struct dxgi_factory *This = (struct dxgi_factory *)iface; + ULONG refcount = InterlockedIncrement(&This->refcount); + + TRACE("%p increasing refcount to %u\n", This, refcount); + + return refcount; +} + +ULONG STDMETHODCALLTYPE dxgi_factory_Release(IDXGIFactory* iface) +{ + struct dxgi_factory *This = (struct dxgi_factory *)iface; + ULONG refcount = InterlockedDecrement(&This->refcount); + + TRACE("%p decreasing refcount to %u\n", This, refcount); + + if (!refcount) + { + HeapFree(GetProcessHeap(), 0, This); + } + + return refcount; +} + +/* IDXGIObject methods */ + +HRESULT STDMETHODCALLTYPE dxgi_factory_SetPrivateData(IDXGIFactory* iface, + REFGUID guid, UINT data_size, const void *data) +{ + FIXME("iface %p, guid %s, data_size %u, data %p stub!\n", iface, debugstr_guid(guid), data_size, data); + + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE dxgi_factory_SetPrivateDataInterface(IDXGIFactory* iface, + REFGUID guid, const IUnknown *object) +{ + FIXME("iface %p, guid %s, object %p stub!\n", iface, debugstr_guid(guid), object); + + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE dxgi_factory_GetPrivateData(IDXGIFactory* iface, + REFGUID guid, UINT *data_size, void *data) +{ + FIXME("iface %p, guid %s, data_size %p, data %p stub!\n", iface, debugstr_guid(guid), data_size, data); + + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE dxgi_factory_GetParent(IDXGIFactory* iface, REFIID riid, void **parent) +{ + FIXME("iface %p, riid %s, parent %p stub!\n", iface, debugstr_guid(riid), parent); + + return E_NOTIMPL; +} + +/* IDXGIFactory methods */ + +HRESULT STDMETHODCALLTYPE dxgi_factory_EnumAdapters(IDXGIFactory* iface, UINT adapter_idx, IDXGIAdapter **adapter) +{ + FIXME("iface %p, adapter_idx %u, adapter %p stub!\n", iface, adapter_idx, adapter); + + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE dxgi_factory_MakeWindowAssociation(IDXGIFactory* iface, HWND window, UINT flags) +{ + FIXME("iface %p, window %p, flags %#x stub!\n\n", iface, window, flags); + + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE dxgi_factory_GetWindowAssociation(IDXGIFactory* iface, HWND *window) +{ + FIXME("iface %p, window %p stub!\n", iface, window); + + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE dxgi_factory_CreateSwapChain(IDXGIFactory* iface, + IUnknown *device, DXGI_SWAP_CHAIN_DESC *desc, IDXGISwapChain **swapchain) +{ + FIXME("iface %p, device %p, desc %p, swapchain %p stub!\n", iface, device, desc, swapchain); + + return E_NOTIMPL; +} + +HRESULT STDMETHODCALLTYPE dxgi_factory_CreateSoftwareAdapter(IDXGIFactory* iface, + HMODULE swrast, IDXGIAdapter **adapter) +{ + FIXME("iface %p, swrast %p, adapter %p stub!\n", iface, swrast, adapter); + + return E_NOTIMPL; +} + +const struct IDXGIFactoryVtbl dxgi_factory_vtbl = +{ + /* IUnknown methods */ + dxgi_factory_QueryInterface, + dxgi_factory_AddRef, + dxgi_factory_Release, + /* IDXGIObject methods */ + dxgi_factory_SetPrivateData, + dxgi_factory_SetPrivateDataInterface, + dxgi_factory_GetPrivateData, + dxgi_factory_GetParent, + /* IDXGIFactory methods */ + dxgi_factory_EnumAdapters, + dxgi_factory_MakeWindowAssociation, + dxgi_factory_GetWindowAssociation, + dxgi_factory_CreateSwapChain, + dxgi_factory_CreateSoftwareAdapter, +}; diff --git a/dlls/dxgi/utils.c b/dlls/dxgi/utils.c new file mode 100644 index 00000000000..be3949f8fdd --- /dev/null +++ b/dlls/dxgi/utils.c @@ -0,0 +1,128 @@ +/* + * Copyright 2008 Henri Verbeet for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + * + */ + +#include "config.h" +#include "wine/port.h" + +#include "dxgi_private.h" + +WINE_DEFAULT_DEBUG_CHANNEL(dxgi); + +#define WINE_DXGI_TO_STR(x) case x: return #x + +const char *debug_dxgi_format(DXGI_FORMAT format) +{ + switch(format) + { + WINE_DXGI_TO_STR(DXGI_FORMAT_UNKNOWN); + WINE_DXGI_TO_STR(DXGI_FORMAT_R32G32B32A32_TYPELESS); + WINE_DXGI_TO_STR(DXGI_FORMAT_R32G32B32A32_FLOAT); + WINE_DXGI_TO_STR(DXGI_FORMAT_R32G32B32A32_UINT); + WINE_DXGI_TO_STR(DXGI_FORMAT_R32G32B32A32_SINT); + WINE_DXGI_TO_STR(DXGI_FORMAT_R32G32B32_TYPELESS); + WINE_DXGI_TO_STR(DXGI_FORMAT_R32G32B32_FLOAT); + WINE_DXGI_TO_STR(DXGI_FORMAT_R32G32B32_UINT); + WINE_DXGI_TO_STR(DXGI_FORMAT_R32G32B32_SINT); + WINE_DXGI_TO_STR(DXGI_FORMAT_R16G16B16A16_TYPELESS); + WINE_DXGI_TO_STR(DXGI_FORMAT_R16G16B16A16_FLOAT); + WINE_DXGI_TO_STR(DXGI_FORMAT_R16G16B16A16_UNORM); + WINE_DXGI_TO_STR(DXGI_FORMAT_R16G16B16A16_UINT); + WINE_DXGI_TO_STR(DXGI_FORMAT_R16G16B16A16_SNORM); + WINE_DXGI_TO_STR(DXGI_FORMAT_R16G16B16A16_SINT); + WINE_DXGI_TO_STR(DXGI_FORMAT_R32G32_TYPELESS); + WINE_DXGI_TO_STR(DXGI_FORMAT_R32G32_FLOAT); + WINE_DXGI_TO_STR(DXGI_FORMAT_R32G32_UINT); + WINE_DXGI_TO_STR(DXGI_FORMAT_R32G32_SINT); + WINE_DXGI_TO_STR(DXGI_FORMAT_R32G8X24_TYPELESS); + WINE_DXGI_TO_STR(DXGI_FORMAT_D32_FLOAT_S8X24_UINT); + WINE_DXGI_TO_STR(DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS); + WINE_DXGI_TO_STR(DXGI_FORMAT_X32_TYPELESS_G8X24_UINT); + WINE_DXGI_TO_STR(DXGI_FORMAT_R10G10B10A2_TYPELESS); + WINE_DXGI_TO_STR(DXGI_FORMAT_R10G10B10A2_UNORM); + WINE_DXGI_TO_STR(DXGI_FORMAT_R10G10B10A2_UINT); + WINE_DXGI_TO_STR(DXGI_FORMAT_R11G11B10_FLOAT); + WINE_DXGI_TO_STR(DXGI_FORMAT_R8G8B8A8_TYPELESS); + WINE_DXGI_TO_STR(DXGI_FORMAT_R8G8B8A8_UNORM); + WINE_DXGI_TO_STR(DXGI_FORMAT_R8G8B8A8_UNORM_SRGB); + WINE_DXGI_TO_STR(DXGI_FORMAT_R8G8B8A8_UINT); + WINE_DXGI_TO_STR(DXGI_FORMAT_R8G8B8A8_SNORM); + WINE_DXGI_TO_STR(DXGI_FORMAT_R8G8B8A8_SINT); + WINE_DXGI_TO_STR(DXGI_FORMAT_R16G16_TYPELESS); + WINE_DXGI_TO_STR(DXGI_FORMAT_R16G16_FLOAT); + WINE_DXGI_TO_STR(DXGI_FORMAT_R16G16_UNORM); + WINE_DXGI_TO_STR(DXGI_FORMAT_R16G16_UINT); + WINE_DXGI_TO_STR(DXGI_FORMAT_R16G16_SNORM); + WINE_DXGI_TO_STR(DXGI_FORMAT_R16G16_SINT); + WINE_DXGI_TO_STR(DXGI_FORMAT_R32_TYPELESS); + WINE_DXGI_TO_STR(DXGI_FORMAT_D32_FLOAT); + WINE_DXGI_TO_STR(DXGI_FORMAT_R32_FLOAT); + WINE_DXGI_TO_STR(DXGI_FORMAT_R32_UINT); + WINE_DXGI_TO_STR(DXGI_FORMAT_R32_SINT); + WINE_DXGI_TO_STR(DXGI_FORMAT_R24G8_TYPELESS); + WINE_DXGI_TO_STR(DXGI_FORMAT_D24_UNORM_S8_UINT); + WINE_DXGI_TO_STR(DXGI_FORMAT_R24_UNORM_X8_TYPELESS); + WINE_DXGI_TO_STR(DXGI_FORMAT_X24_TYPELESS_G8_UINT); + WINE_DXGI_TO_STR(DXGI_FORMAT_R8G8_TYPELESS); + WINE_DXGI_TO_STR(DXGI_FORMAT_R8G8_UNORM); + WINE_DXGI_TO_STR(DXGI_FORMAT_R8G8_UINT); + WINE_DXGI_TO_STR(DXGI_FORMAT_R8G8_SNORM); + WINE_DXGI_TO_STR(DXGI_FORMAT_R8G8_SINT); + WINE_DXGI_TO_STR(DXGI_FORMAT_R16_TYPELESS); + WINE_DXGI_TO_STR(DXGI_FORMAT_R16_FLOAT); + WINE_DXGI_TO_STR(DXGI_FORMAT_D16_UNORM); + WINE_DXGI_TO_STR(DXGI_FORMAT_R16_UNORM); + WINE_DXGI_TO_STR(DXGI_FORMAT_R16_UINT); + WINE_DXGI_TO_STR(DXGI_FORMAT_R16_SNORM); + WINE_DXGI_TO_STR(DXGI_FORMAT_R16_SINT); + WINE_DXGI_TO_STR(DXGI_FORMAT_R8_TYPELESS); + WINE_DXGI_TO_STR(DXGI_FORMAT_R8_UNORM); + WINE_DXGI_TO_STR(DXGI_FORMAT_R8_UINT); + WINE_DXGI_TO_STR(DXGI_FORMAT_R8_SNORM); + WINE_DXGI_TO_STR(DXGI_FORMAT_R8_SINT); + WINE_DXGI_TO_STR(DXGI_FORMAT_A8_UNORM); + WINE_DXGI_TO_STR(DXGI_FORMAT_R1_UNORM); + WINE_DXGI_TO_STR(DXGI_FORMAT_R9G9B9E5_SHAREDEXP); + WINE_DXGI_TO_STR(DXGI_FORMAT_R8G8_B8G8_UNORM); + WINE_DXGI_TO_STR(DXGI_FORMAT_G8R8_G8B8_UNORM); + WINE_DXGI_TO_STR(DXGI_FORMAT_BC1_TYPELESS); + WINE_DXGI_TO_STR(DXGI_FORMAT_BC1_UNORM); + WINE_DXGI_TO_STR(DXGI_FORMAT_BC1_UNORM_SRGB); + WINE_DXGI_TO_STR(DXGI_FORMAT_BC2_TYPELESS); + WINE_DXGI_TO_STR(DXGI_FORMAT_BC2_UNORM); + WINE_DXGI_TO_STR(DXGI_FORMAT_BC2_UNORM_SRGB); + WINE_DXGI_TO_STR(DXGI_FORMAT_BC3_TYPELESS); + WINE_DXGI_TO_STR(DXGI_FORMAT_BC3_UNORM); + WINE_DXGI_TO_STR(DXGI_FORMAT_BC3_UNORM_SRGB); + WINE_DXGI_TO_STR(DXGI_FORMAT_BC4_TYPELESS); + WINE_DXGI_TO_STR(DXGI_FORMAT_BC4_UNORM); + WINE_DXGI_TO_STR(DXGI_FORMAT_BC4_SNORM); + WINE_DXGI_TO_STR(DXGI_FORMAT_BC5_TYPELESS); + WINE_DXGI_TO_STR(DXGI_FORMAT_BC5_UNORM); + WINE_DXGI_TO_STR(DXGI_FORMAT_BC5_SNORM); + WINE_DXGI_TO_STR(DXGI_FORMAT_B5G6R5_UNORM); + WINE_DXGI_TO_STR(DXGI_FORMAT_B5G5R5A1_UNORM); + WINE_DXGI_TO_STR(DXGI_FORMAT_B8G8R8A8_UNORM); + WINE_DXGI_TO_STR(DXGI_FORMAT_B8G8R8X8_UNORM); + default: + FIXME("Unrecognized DXGI_FORMAT %#x\n", format); + return "unrecognized"; + } +} + +#undef WINE_DXGI_TO_STR diff --git a/dlls/mountmgr.sys/mountmgr.h b/dlls/dxgi/version.rc similarity index 68% copy from dlls/mountmgr.sys/mountmgr.h copy to dlls/dxgi/version.rc index 2d34624b839..bd51eb8c55b 100644 --- a/dlls/mountmgr.sys/mountmgr.h +++ b/dlls/dxgi/version.rc @@ -1,7 +1,5 @@ /* - * Mountmanager private header - * - * Copyright 2008 Maarten Lankhorst + * Copyright 2008 Henri Verbeet for CodeWeavers * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -18,8 +16,11 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -extern void initialize_hal(void); -extern void initialize_diskarbitration(void); -extern BOOL add_dos_device( const char *udi, const char *device, - const char *mount_point, DWORD type ); -extern BOOL remove_dos_device( const char *udi ); +#define WINE_FILEDESCRIPTION_STR "Wine DXGI" +#define WINE_FILENAME_STR "dxgi.dll" +#define WINE_FILEVERSION 6,0,6000,16386 +#define WINE_FILEVERSION_STR "6.0.6000.16386" +#define WINE_PRODUCTVERSION 6,0,6000,16386 +#define WINE_PRODUCTVERSION_STR "6.0.6000.16386" + +#include "wine/wine_common_ver.rc" diff --git a/dlls/gdi32/bitmap.c b/dlls/gdi32/bitmap.c index a38fdd933fa..e7370a24650 100644 --- a/dlls/gdi32/bitmap.c +++ b/dlls/gdi32/bitmap.c @@ -325,7 +325,7 @@ LONG WINAPI GetBitmapBits( LONG count, /* [in] Number of bytes to copy */ LPVOID bits) /* [out] Pointer to buffer to receive bits */ { - BITMAPOBJ *bmp = (BITMAPOBJ *) GDI_GetObjPtr( hbitmap, BITMAP_MAGIC ); + BITMAPOBJ *bmp = GDI_GetObjPtr( hbitmap, BITMAP_MAGIC ); LONG height, ret; if (!bmp) return 0; @@ -436,7 +436,7 @@ LONG WINAPI SetBitmapBits( LONG count, /* [in] Number of bytes in bitmap array */ LPCVOID bits) /* [in] Address of array with bitmap bits */ { - BITMAPOBJ *bmp = (BITMAPOBJ *) GDI_GetObjPtr( hbitmap, BITMAP_MAGIC ); + BITMAPOBJ *bmp = GDI_GetObjPtr( hbitmap, BITMAP_MAGIC ); LONG height, ret; if ((!bmp) || (!bits)) @@ -729,7 +729,7 @@ BOOL WINAPI GetBitmapDimensionEx( HBITMAP hbitmap, /* [in] Handle to bitmap */ LPSIZE size) /* [out] Address of struct receiving dimensions */ { - BITMAPOBJ * bmp = (BITMAPOBJ *) GDI_GetObjPtr( hbitmap, BITMAP_MAGIC ); + BITMAPOBJ * bmp = GDI_GetObjPtr( hbitmap, BITMAP_MAGIC ); if (!bmp) return FALSE; *size = bmp->size; GDI_ReleaseObj( hbitmap ); @@ -754,7 +754,7 @@ BOOL WINAPI SetBitmapDimensionEx( INT y, /* [in] Bitmap height */ LPSIZE prevSize) /* [out] Address of structure for orig dims */ { - BITMAPOBJ * bmp = (BITMAPOBJ *) GDI_GetObjPtr( hbitmap, BITMAP_MAGIC ); + BITMAPOBJ * bmp = GDI_GetObjPtr( hbitmap, BITMAP_MAGIC ); if (!bmp) return FALSE; if (prevSize) *prevSize = bmp->size; bmp->size.cx = x; diff --git a/dlls/gdi32/brush.c b/dlls/gdi32/brush.c index 908670e00b5..1f81c0038b9 100644 --- a/dlls/gdi32/brush.c +++ b/dlls/gdi32/brush.c @@ -461,7 +461,7 @@ BOOL16 WINAPI SetSolidBrush16(HBRUSH16 hBrush, COLORREF newColor ) BOOL16 res = FALSE; TRACE("(hBrush %04x, newColor %08x)\n", hBrush, newColor); - if (!(brushPtr = (BRUSHOBJ *) GDI_GetObjPtr( HBRUSH_32(hBrush), BRUSH_MAGIC ))) + if (!(brushPtr = GDI_GetObjPtr( HBRUSH_32(hBrush), BRUSH_MAGIC ))) return FALSE; if (brushPtr->logbrush.lbStyle == BS_SOLID) diff --git a/dlls/gdi32/dib.c b/dlls/gdi32/dib.c index 299e27a9840..7782c51a0b9 100644 --- a/dlls/gdi32/dib.c +++ b/dlls/gdi32/dib.c @@ -235,7 +235,7 @@ INT WINAPI StretchDIBits(HDC hdc, INT xDst, INT yDst, INT widthDst, dwRop == SRCCOPY) { BITMAPOBJ *bmp; - if ((bmp = (BITMAPOBJ *)GDI_GetObjPtr( hBitmap, BITMAP_MAGIC ))) + if ((bmp = GDI_GetObjPtr( hBitmap, BITMAP_MAGIC ))) { if (bmp->bitmap.bmBitsPixel == bpp && bmp->bitmap.bmWidth == widthSrc && @@ -609,7 +609,7 @@ INT WINAPI GetDIBits( return 0; } update_dc( dc ); - if (!(bmp = (BITMAPOBJ *)GDI_GetObjPtr( hbitmap, BITMAP_MAGIC ))) + if (!(bmp = GDI_GetObjPtr( hbitmap, BITMAP_MAGIC ))) { release_dc_ptr( dc ); return 0; @@ -1153,7 +1153,7 @@ HBITMAP16 WINAPI CreateDIBSection16 (HDC16 hdc, const BITMAPINFO *bmi, UINT16 us hbitmap = CreateDIBSection( HDC_32(hdc), bmi, usage, &bits32, section, offset ); if (hbitmap) { - BITMAPOBJ *bmp = (BITMAPOBJ *) GDI_GetObjPtr(hbitmap, BITMAP_MAGIC); + BITMAPOBJ *bmp = GDI_GetObjPtr(hbitmap, BITMAP_MAGIC); if (bmp && bmp->dib && bits32) { const BITMAPINFOHEADER *bi = &bmi->bmiHeader; diff --git a/dlls/gdi32/dispdib.c b/dlls/gdi32/dispdib.c index 6e5219eb92b..0d46f65bfb7 100644 --- a/dlls/gdi32/dispdib.c +++ b/dlls/gdi32/dispdib.c @@ -1,7 +1,7 @@ /* * DISPDIB.dll * - * Copyright 1998 Ove Kåven (with some help from Marcus Meissner) + * Copyright 1998 Ove Kåven (with some help from Marcus Meissner) * * 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/gdi32/enhmetafile.c b/dlls/gdi32/enhmetafile.c index ef539104aeb..c329338b916 100644 --- a/dlls/gdi32/enhmetafile.c +++ b/dlls/gdi32/enhmetafile.c @@ -278,8 +278,8 @@ HENHMETAFILE EMF_Create_HENHMETAFILE(ENHMETAHEADER *emh, BOOL on_disk ) */ static BOOL EMF_Delete_HENHMETAFILE( HENHMETAFILE hmf ) { - ENHMETAFILEOBJ *metaObj = (ENHMETAFILEOBJ *)GDI_GetObjPtr( hmf, - ENHMETAFILE_MAGIC ); + ENHMETAFILEOBJ *metaObj = GDI_GetObjPtr( hmf, ENHMETAFILE_MAGIC ); + if(!metaObj) return FALSE; if(metaObj->on_disk) @@ -297,7 +297,7 @@ static BOOL EMF_Delete_HENHMETAFILE( HENHMETAFILE hmf ) static ENHMETAHEADER *EMF_GetEnhMetaHeader( HENHMETAFILE hmf ) { ENHMETAHEADER *ret = NULL; - ENHMETAFILEOBJ *metaObj = (ENHMETAFILEOBJ *)GDI_GetObjPtr( hmf, ENHMETAFILE_MAGIC ); + ENHMETAFILEOBJ *metaObj = GDI_GetObjPtr( hmf, ENHMETAFILE_MAGIC ); TRACE("hmf %p -> enhmetaObj %p\n", hmf, metaObj); if (metaObj) { @@ -692,6 +692,7 @@ static BOOL emr_produces_output(int type) case EMR_LINETO: case EMR_ARCTO: case EMR_POLYDRAW: + case EMR_GDICOMMENT: case EMR_FILLRGN: case EMR_FRAMERGN: case EMR_INVERTRGN: @@ -756,10 +757,6 @@ BOOL WINAPI PlayEnhMetaFileRecord( type = mr->iType; - /* In Win9x mode we update the xform if the record will produce output */ - if ( IS_WIN9X() && emr_produces_output(type) ) - EMF_Update_MF_Xform(hdc, info); - TRACE("record %s\n", get_emr_name(type)); switch(type) { @@ -2193,13 +2190,6 @@ BOOL WINAPI PlayEnhMetaFileRecord( TRACE("L:0,0 - 1000,1000 -> D:%d,%d - %d,%d\n", tmprc.left, tmprc.top, tmprc.right, tmprc.bottom); - if ( !IS_WIN9X() ) - { - /* WinNT - update the transform (win9x updates when the next graphics output - record is played). */ - EMF_Update_MF_Xform(hdc, info); - } - return TRUE; } @@ -2405,9 +2395,19 @@ BOOL WINAPI EnumEnhMetaFile( while(ret && offset < emh->nBytes) { emr = (ENHMETARECORD *)((char *)emh + offset); + + /* In Win9x mode we update the xform if the record will produce output */ + if (hdc && IS_WIN9X() && emr_produces_output(emr->iType)) + EMF_Update_MF_Xform(hdc, info); + TRACE("Calling EnumFunc with record %s, size %d\n", get_emr_name(emr->iType), emr->nSize); ret = (*callback)(hdc, ht, emr, emh->nHandles, (LPARAM)data); offset += emr->nSize; + + /* WinNT - update the transform (win9x updates when the next graphics + output record is played). */ + if (hdc && !IS_WIN9X()) + EMF_Update_MF_Xform(hdc, info); } if (hdc) diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index 7b8d97de04f..7862565ea5b 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -828,7 +828,7 @@ INT WINAPI GetTextFaceW( HDC hdc, INT count, LPWSTR name ) if(dc->gdiFont) ret = WineEngGetTextFace(dc->gdiFont, count, name); - else if ((font = (FONTOBJ *) GDI_GetObjPtr( dc->hFont, FONT_MAGIC ))) + else if ((font = GDI_GetObjPtr( dc->hFont, FONT_MAGIC ))) { INT n = strlenW(font->logfont.lfFaceName) + 1; if (name) diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index 8b0d672e97d..96924506cf2 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -33,7 +33,9 @@ # include #endif #include -#include +#ifdef HAVE_DIRENT_H +# include +#endif #include #include diff --git a/dlls/gdi32/metafile.c b/dlls/gdi32/metafile.c index 68ec2039a5d..6a71aa04df7 100644 --- a/dlls/gdi32/metafile.c +++ b/dlls/gdi32/metafile.c @@ -126,7 +126,7 @@ HMETAFILE MF_Create_HMETAFILE(METAHEADER *mh) static METAHEADER *MF_GetMetaHeader( HMETAFILE hmf ) { METAHEADER *ret = NULL; - METAFILEOBJ * metaObj = (METAFILEOBJ *)GDI_GetObjPtr( hmf, METAFILE_MAGIC ); + METAFILEOBJ * metaObj = GDI_GetObjPtr( hmf, METAFILE_MAGIC ); if (metaObj) { ret = metaObj->mh; @@ -164,7 +164,7 @@ static POINT *convert_points( UINT count, POINT16 *pt16 ) BOOL WINAPI DeleteMetaFile( HMETAFILE hmf ) { - METAFILEOBJ * metaObj = (METAFILEOBJ *)GDI_GetObjPtr( hmf, METAFILE_MAGIC ); + METAFILEOBJ * metaObj = GDI_GetObjPtr( hmf, METAFILE_MAGIC ); if (!metaObj) return FALSE; HeapFree( GetProcessHeap(), 0, metaObj->mh ); GDI_FreeObject( hmf, metaObj ); diff --git a/dlls/gdi32/palette.c b/dlls/gdi32/palette.c index 1b6a966c971..c910100427a 100644 --- a/dlls/gdi32/palette.c +++ b/dlls/gdi32/palette.c @@ -278,7 +278,7 @@ UINT WINAPI GetPaletteEntries( TRACE("hpal = %p, count=%i\n", hpalette, count ); - palPtr = (PALETTEOBJ *) GDI_GetObjPtr( hpalette, PALETTE_MAGIC ); + palPtr = GDI_GetObjPtr( hpalette, PALETTE_MAGIC ); if (!palPtr) return 0; /* NOTE: not documented but test show this to be the case */ @@ -328,7 +328,7 @@ UINT WINAPI SetPaletteEntries( TRACE("hpal=%p,start=%i,count=%i\n",hpalette,start,count ); if (hpalette == GetStockObject(DEFAULT_PALETTE)) return 0; - palPtr = (PALETTEOBJ *) GDI_GetObjPtr( hpalette, PALETTE_MAGIC ); + palPtr = GDI_GetObjPtr( hpalette, PALETTE_MAGIC ); if (!palPtr) return 0; numEntries = palPtr->logpalette.palNumEntries; @@ -359,7 +359,7 @@ BOOL WINAPI ResizePalette( HPALETTE hPal, /* [in] Handle of logical palette */ UINT cEntries) /* [in] Number of entries in logical palette */ { - PALETTEOBJ * palPtr = (PALETTEOBJ *) GDI_GetObjPtr( hPal, PALETTE_MAGIC ); + PALETTEOBJ * palPtr = GDI_GetObjPtr( hPal, PALETTE_MAGIC ); UINT cPrevEnt, prevVer; int prevsize, size = sizeof(LOGPALETTE) + (cEntries - 1) * sizeof(PALETTEENTRY); @@ -410,7 +410,7 @@ BOOL WINAPI AnimatePalette( UINT pal_entries; const PALETTEENTRY *pptr = PaletteColors; - palPtr = (PALETTEOBJ *) GDI_GetObjPtr( hPal, PALETTE_MAGIC ); + palPtr = GDI_GetObjPtr( hPal, PALETTE_MAGIC ); if (!palPtr) return 0; pal_entries = palPtr->logpalette.palNumEntries; @@ -537,7 +537,7 @@ UINT WINAPI GetNearestPaletteIndex( HPALETTE hpalette, /* [in] Handle of logical color palette */ COLORREF color) /* [in] Color to be matched */ { - PALETTEOBJ* palObj = (PALETTEOBJ*)GDI_GetObjPtr( hpalette, PALETTE_MAGIC ); + PALETTEOBJ* palObj = GDI_GetObjPtr( hpalette, PALETTE_MAGIC ); UINT index = 0; if( palObj ) diff --git a/dlls/gdi32/region.c b/dlls/gdi32/region.c index e70f65b206d..bdb6efabce0 100644 --- a/dlls/gdi32/region.c +++ b/dlls/gdi32/region.c @@ -603,7 +603,7 @@ static void REGION_OffsetRegion( WINEREGION *rgn, WINEREGION *srcrgn, */ INT WINAPI OffsetRgn( HRGN hrgn, INT x, INT y ) { - RGNOBJ * obj = (RGNOBJ *) GDI_GetObjPtr( hrgn, REGION_MAGIC ); + RGNOBJ * obj = GDI_GetObjPtr( hrgn, REGION_MAGIC ); INT ret; TRACE("%p %d,%d\n", hrgn, x, y); @@ -638,7 +638,7 @@ INT WINAPI OffsetRgn( HRGN hrgn, INT x, INT y ) */ INT WINAPI GetRgnBox( HRGN hrgn, LPRECT rect ) { - RGNOBJ * obj = (RGNOBJ *) GDI_GetObjPtr( hrgn, REGION_MAGIC ); + RGNOBJ * obj = GDI_GetObjPtr( hrgn, REGION_MAGIC ); if (obj) { INT ret; @@ -729,7 +729,7 @@ BOOL WINAPI SetRectRgn( HRGN hrgn, INT left, INT top, TRACE("%p %d,%d-%d,%d\n", hrgn, left, top, right, bottom ); - if (!(obj = (RGNOBJ *) GDI_GetObjPtr( hrgn, REGION_MAGIC ))) return FALSE; + if (!(obj = GDI_GetObjPtr( hrgn, REGION_MAGIC ))) return FALSE; if (left > right) { INT tmp = left; left = right; right = tmp; } if (top > bottom) { INT tmp = top; top = bottom; bottom = tmp; } @@ -953,7 +953,7 @@ HRGN WINAPI CreateEllipticRgnIndirect( const RECT *rect ) DWORD WINAPI GetRegionData(HRGN hrgn, DWORD count, LPRGNDATA rgndata) { DWORD size; - RGNOBJ *obj = (RGNOBJ *) GDI_GetObjPtr( hrgn, REGION_MAGIC ); + RGNOBJ *obj = GDI_GetObjPtr( hrgn, REGION_MAGIC ); TRACE(" %p count = %d, rgndata = %p\n", hrgn, count, rgndata); @@ -1067,7 +1067,7 @@ HRGN WINAPI ExtCreateRegion( const XFORM* lpXform, DWORD dwCount, const RGNDATA* if( (hrgn = REGION_CreateRegion( rgndata->rdh.nCount )) ) { RECT *pCurRect, *pEndRect; - RGNOBJ *obj = (RGNOBJ *) GDI_GetObjPtr( hrgn, REGION_MAGIC ); + RGNOBJ *obj = GDI_GetObjPtr( hrgn, REGION_MAGIC ); if (obj) { pEndRect = (RECT *)rgndata->Buffer + rgndata->rdh.nCount; @@ -1106,7 +1106,7 @@ BOOL WINAPI PtInRegion( HRGN hrgn, INT x, INT y ) RGNOBJ * obj; BOOL ret = FALSE; - if ((obj = (RGNOBJ *) GDI_GetObjPtr( hrgn, REGION_MAGIC ))) + if ((obj = GDI_GetObjPtr( hrgn, REGION_MAGIC ))) { int i; @@ -1141,7 +1141,7 @@ BOOL WINAPI RectInRegion( HRGN hrgn, const RECT *rect ) RGNOBJ * obj; BOOL ret = FALSE; - if ((obj = (RGNOBJ *) GDI_GetObjPtr( hrgn, REGION_MAGIC ))) + if ((obj = GDI_GetObjPtr( hrgn, REGION_MAGIC ))) { RECT *pCurRect, *pRectEnd; @@ -1191,9 +1191,9 @@ BOOL WINAPI EqualRgn( HRGN hrgn1, HRGN hrgn2 ) RGNOBJ *obj1, *obj2; BOOL ret = FALSE; - if ((obj1 = (RGNOBJ *) GDI_GetObjPtr( hrgn1, REGION_MAGIC ))) + if ((obj1 = GDI_GetObjPtr( hrgn1, REGION_MAGIC ))) { - if ((obj2 = (RGNOBJ *) GDI_GetObjPtr( hrgn2, REGION_MAGIC ))) + if ((obj2 = GDI_GetObjPtr( hrgn2, REGION_MAGIC ))) { int i; @@ -1251,12 +1251,12 @@ static void REGION_UnionRectWithRegion(const RECT *rect, WINEREGION *rgn) BOOL REGION_FrameRgn( HRGN hDest, HRGN hSrc, INT x, INT y ) { BOOL bRet; - RGNOBJ *srcObj = (RGNOBJ*) GDI_GetObjPtr( hSrc, REGION_MAGIC ); + RGNOBJ *srcObj = GDI_GetObjPtr( hSrc, REGION_MAGIC ); if (!srcObj) return FALSE; if (srcObj->rgn->numRects != 0) { - RGNOBJ* destObj = (RGNOBJ*) GDI_GetObjPtr( hDest, REGION_MAGIC ); + RGNOBJ* destObj = GDI_GetObjPtr( hDest, REGION_MAGIC ); WINEREGION *tmprgn = REGION_AllocWineRegion( srcObj->rgn->numRects); REGION_OffsetRegion( destObj->rgn, srcObj->rgn, -x, 0); @@ -1309,13 +1309,13 @@ BOOL REGION_FrameRgn( HRGN hDest, HRGN hSrc, INT x, INT y ) */ INT WINAPI CombineRgn(HRGN hDest, HRGN hSrc1, HRGN hSrc2, INT mode) { - RGNOBJ *destObj = (RGNOBJ *) GDI_GetObjPtr( hDest, REGION_MAGIC); + RGNOBJ *destObj = GDI_GetObjPtr( hDest, REGION_MAGIC); INT result = ERROR; TRACE(" %p,%p -> %p mode=%x\n", hSrc1, hSrc2, hDest, mode ); if (destObj) { - RGNOBJ *src1Obj = (RGNOBJ *) GDI_GetObjPtr( hSrc1, REGION_MAGIC); + RGNOBJ *src1Obj = GDI_GetObjPtr( hSrc1, REGION_MAGIC); if (src1Obj) { @@ -1329,7 +1329,7 @@ INT WINAPI CombineRgn(HRGN hDest, HRGN hSrc1, HRGN hSrc2, INT mode) } else { - RGNOBJ *src2Obj = (RGNOBJ *) GDI_GetObjPtr( hSrc2, REGION_MAGIC); + RGNOBJ *src2Obj = GDI_GetObjPtr( hSrc2, REGION_MAGIC); if (src2Obj) { @@ -2790,7 +2790,7 @@ HRGN WINAPI CreatePolyPolygonRgn(const POINT *Pts, const INT *Count, if(!(hrgn = REGION_CreateRegion(nbpolygons))) return 0; - obj = (RGNOBJ *) GDI_GetObjPtr( hrgn, REGION_MAGIC ); + obj = GDI_GetObjPtr( hrgn, REGION_MAGIC ); region = obj->rgn; /* special case a rectangle */ diff --git a/dlls/gdi32/wing.c b/dlls/gdi32/wing.c index b821ad37cbe..319ef2ecac9 100644 --- a/dlls/gdi32/wing.c +++ b/dlls/gdi32/wing.c @@ -144,8 +144,7 @@ HBITMAP16 WINAPI WinGCreateBitmap16(HDC16 hdc, BITMAPINFO *bmpi, */ SEGPTR WINAPI WinGGetDIBPointer16(HBITMAP16 hWinGBitmap, BITMAPINFO* bmpi) { - BITMAPOBJ* bmp = (BITMAPOBJ *) GDI_GetObjPtr( HBITMAP_32(hWinGBitmap), - BITMAP_MAGIC ); + BITMAPOBJ* bmp = GDI_GetObjPtr( HBITMAP_32(hWinGBitmap), BITMAP_MAGIC ); SEGPTR res = 0; TRACE("(%d,%p)\n", hWinGBitmap, bmpi); diff --git a/dlls/gdiplus/brush.c b/dlls/gdiplus/brush.c index 8bf09efb257..edccb10afac 100644 --- a/dlls/gdiplus/brush.c +++ b/dlls/gdiplus/brush.c @@ -605,6 +605,7 @@ GpStatus WINGDIPAPI GdipCreateTextureIA(GpImage *image, (*texture)->brush.gdibrush = CreateBrushIndirect(&(*texture)->brush.lb); (*texture)->brush.bt = BrushTypeTextureFill; + (*texture)->wrap = imageattr->wrap; GdipFree(dibits); GdipFree(buff); @@ -913,6 +914,21 @@ GpStatus WINGDIPAPI GdipGetTextureTransform(GpTexture *brush, GpMatrix *matrix) } /****************************************************************************** + * GdipGetTextureWrapMode [GDIPLUS.@] + */ +GpStatus WINGDIPAPI GdipGetTextureWrapMode(GpTexture *brush, GpWrapMode *wrapmode) +{ + TRACE("(%p, %p)\n", brush, wrapmode); + + if(!brush || !wrapmode) + return InvalidParameter; + + *wrapmode = brush->wrap; + + return Ok; +} + +/****************************************************************************** * GdipResetTextureTransform [GDIPLUS.@] */ GpStatus WINGDIPAPI GdipResetTextureTransform(GpTexture* brush) @@ -1138,6 +1154,23 @@ GpStatus WINGDIPAPI GdipSetTextureTransform(GpTexture *texture, return Ok; } +/****************************************************************************** + * GdipSetTextureWrapMode [GDIPLUS.@] + * + * WrapMode not used, only stored + */ +GpStatus WINGDIPAPI GdipSetTextureWrapMode(GpTexture *brush, GpWrapMode wrapmode) +{ + TRACE("(%p, %d)\n", brush, wrapmode); + + if(!brush) + return InvalidParameter; + + brush->wrap = wrapmode; + + return Ok; +} + GpStatus WINGDIPAPI GdipSetLineColors(GpLineGradient *brush, ARGB color1, ARGB color2) { diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index 3ef4271e514..fea80a44f55 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -399,7 +399,7 @@ @ stdcall GdipGetTextRenderingHint(ptr ptr) @ stub GdipGetTextureImage @ stdcall GdipGetTextureTransform(ptr ptr) -@ stub GdipGetTextureWrapMode +@ stdcall GdipGetTextureWrapMode(ptr ptr) @ stub GdipGetVisibleClipBounds @ stub GdipGetVisibleClipBoundsI @ stdcall GdipGetWorldTransform(ptr ptr) @@ -506,7 +506,7 @@ @ stdcall GdipSetAdjustableArrowCapHeight(ptr long) @ stdcall GdipSetAdjustableArrowCapMiddleInset(ptr long) @ stdcall GdipSetAdjustableArrowCapWidth(ptr long) -@ stub GdipSetClipGraphics +@ stdcall GdipSetClipGraphics(ptr ptr long) @ stub GdipSetClipHrgn @ stdcall GdipSetClipPath(ptr ptr long) @ stdcall GdipSetClipRect(ptr long long long long long) @@ -596,7 +596,7 @@ @ stub GdipSetTextContrast @ stdcall GdipSetTextRenderingHint(ptr long) @ stdcall GdipSetTextureTransform(ptr ptr) -@ stub GdipSetTextureWrapMode +@ stdcall GdipSetTextureWrapMode(ptr long) @ stdcall GdipSetWorldTransform(ptr ptr) @ stdcall GdipShearMatrix(ptr long long long) @ stdcall GdipStartPathFigure(ptr) diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h index 0ca2714f69f..05549b4b18f 100644 --- a/dlls/gdiplus/gdiplus_private.h +++ b/dlls/gdiplus/gdiplus_private.h @@ -139,6 +139,7 @@ struct GpLineGradient{ struct GpTexture{ GpBrush brush; GpMatrix *transform; + WrapMode wrap; /* not used yet */ }; struct GpPath{ diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 03b0994e959..3273494a612 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -2818,6 +2818,17 @@ GpStatus WINGDIPAPI GdipScaleWorldTransform(GpGraphics *graphics, REAL sx, return GdipScaleMatrix(graphics->worldtrans, sx, sy, order); } +GpStatus WINGDIPAPI GdipSetClipGraphics(GpGraphics *graphics, GpGraphics *srcgraphics, + CombineMode mode) +{ + TRACE("(%p, %p, %d)\n", graphics, srcgraphics, mode); + + if(!graphics || !srcgraphics) + return InvalidParameter; + + return GdipCombineRegionRegion(graphics->clip, srcgraphics->clip, mode); +} + GpStatus WINGDIPAPI GdipSetCompositingMode(GpGraphics *graphics, CompositingMode mode) { diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index 0cb5ded5aca..9dbefc026c0 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -254,6 +254,7 @@ GpStatus WINGDIPAPI GdipCloneImage(GpImage *image, GpImage **cloneImage) HRESULT hr; INT size; LARGE_INTEGER move; + GpStatus stat = GenericError; TRACE("%p, %p\n", image, cloneImage); @@ -264,15 +265,6 @@ GpStatus WINGDIPAPI GdipCloneImage(GpImage *image, GpImage **cloneImage) if (FAILED(hr)) return GenericError; - *cloneImage = GdipAlloc(sizeof(GpImage)); - if (!*cloneImage) - { - IStream_Release(stream); - return OutOfMemory; - } - (*cloneImage)->type = image->type; - (*cloneImage)->flags = image->flags; - hr = IPicture_SaveAsFile(image->picture, stream, FALSE, &size); if(FAILED(hr)) { @@ -286,21 +278,12 @@ GpStatus WINGDIPAPI GdipCloneImage(GpImage *image, GpImage **cloneImage) if (FAILED(hr)) goto out; - hr = OleLoadPicture(stream, size, FALSE, &IID_IPicture, - (LPVOID*) &(*cloneImage)->picture); - if (FAILED(hr)) - { - WARN("Failed to load image from stream\n"); - goto out; - } + stat = GdipLoadImageFromStream(stream, cloneImage); + if (stat != Ok) WARN("Failed to load image from stream\n"); - IStream_Release(stream); - return Ok; out: IStream_Release(stream); - GdipFree(*cloneImage); - *cloneImage = NULL; - return GenericError; + return stat; } GpStatus WINGDIPAPI GdipCreateBitmapFromFile(GDIPCONST WCHAR* filename, diff --git a/dlls/gdiplus/region.c b/dlls/gdiplus/region.c index 90aaf9e26af..1cda0b7d152 100644 --- a/dlls/gdiplus/region.c +++ b/dlls/gdiplus/region.c @@ -573,6 +573,9 @@ GpStatus WINGDIPAPI GdipCreateRegionHrgn(HRGN hrgn, GpRegion **region) { FIXME("(%p, %p): stub\n", hrgn, region); + if(!hrgn || !region) + return InvalidParameter; + *region = NULL; return NotImplemented; } diff --git a/dlls/gdiplus/tests/brush.c b/dlls/gdiplus/tests/brush.c index 9dd343b70b3..ae831847835 100644 --- a/dlls/gdiplus/tests/brush.c +++ b/dlls/gdiplus/tests/brush.c @@ -235,6 +235,54 @@ static void test_transform(void) ReleaseDC(0, hdc); } +static void test_texturewrap(void) +{ + GpStatus status; + GpTexture *texture; + GpGraphics *graphics = NULL; + GpBitmap *bitmap; + HDC hdc = GetDC(0); + GpWrapMode wrap; + + status = GdipCreateFromHDC(hdc, &graphics); + expect(Ok, status); + status = GdipCreateBitmapFromGraphics(1, 1, graphics, &bitmap); + expect(Ok, status); + + status = GdipCreateTexture((GpImage*)bitmap, WrapModeTile, &texture); + expect(Ok, status); + + /* NULL */ + status = GdipGetTextureWrapMode(NULL, NULL); + expect(InvalidParameter, status); + status = GdipGetTextureWrapMode(texture, NULL); + expect(InvalidParameter, status); + status = GdipGetTextureWrapMode(NULL, &wrap); + expect(InvalidParameter, status); + + /* get */ + wrap = WrapModeClamp; + status = GdipGetTextureWrapMode(texture, &wrap); + expect(Ok, status); + expect(WrapModeTile, wrap); + /* set, then get */ + wrap = WrapModeClamp; + status = GdipSetTextureWrapMode(texture, wrap); + expect(Ok, status); + wrap = WrapModeTile; + status = GdipGetTextureWrapMode(texture, &wrap); + expect(Ok, status); + expect(WrapModeClamp, wrap); + + status = GdipDeleteBrush((GpBrush*)texture); + expect(Ok, status); + status = GdipDisposeImage((GpImage*)bitmap); + expect(Ok, status); + status = GdipDeleteGraphics(graphics); + expect(Ok, status); + ReleaseDC(0, hdc); +} + START_TEST(brush) { struct GdiplusStartupInput gdiplusStartupInput; @@ -254,6 +302,7 @@ START_TEST(brush) test_getbounds(); test_getgamma(); test_transform(); + test_texturewrap(); GdiplusShutdown(gdiplusToken); } diff --git a/dlls/gdiplus/tests/image.c b/dlls/gdiplus/tests/image.c index 5d8c535a4d3..4d93da40265 100644 --- a/dlls/gdiplus/tests/image.c +++ b/dlls/gdiplus/tests/image.c @@ -514,6 +514,10 @@ static void test_GdipCloneImage(void) stat = GdipGetImageBounds(image_dest, &rectF, &unit); expect(Ok, stat); + /* Treat FP values carefully */ + ok(fabsf(rectF.Width-WIDTH)<1e-5, "Expected: %d, got %.05f\n", WIDTH, rectF.Width); + ok(fabsf(rectF.Height-HEIGHT)<1e-5, "Expected: %d, got %.05f\n", HEIGHT, rectF.Height); + stat = GdipDisposeImage(image_dest); expect(Ok, stat); } diff --git a/dlls/gdiplus/tests/region.c b/dlls/gdiplus/tests/region.c index 63d00868c76..d2477ced311 100644 --- a/dlls/gdiplus/tests/region.c +++ b/dlls/gdiplus/tests/region.c @@ -651,6 +651,98 @@ static void test_combinereplace(void) GdipDeleteRegion(region); } +static void test_fromhrgn(void) +{ + GpStatus status; + GpRegion *region; + HRGN hrgn; + UINT needed; + DWORD buf[220]; + RegionDataPoint *point; + + /* NULL */ + status = GdipCreateRegionHrgn(NULL, NULL); + expect(InvalidParameter, status); + status = GdipCreateRegionHrgn(NULL, ®ion); + expect(InvalidParameter, status); + status = GdipCreateRegionHrgn((HRGN)0xdeadbeef, ®ion); + todo_wine expect(InvalidParameter, status); + + /* rectangle */ + hrgn = CreateRectRgn(0, 0, 100, 10); + status = GdipCreateRegionHrgn(hrgn, ®ion); + todo_wine expect(Ok, status); + + status = GdipGetRegionDataSize(region, &needed); +todo_wine{ + expect(Ok, status); + expect(56, needed); +} + + status = GdipGetRegionData(region, (BYTE*)buf, sizeof(buf), &needed); + todo_wine expect(Ok, status); + + if(status == Ok){ +todo_wine{ + expect(56, needed); + expect_dword(buf, 48); + expect_magic((DWORD*)(buf + 2)); + expect_dword(buf + 3, 0); + expect_dword(buf + 4, RGNDATA_PATH); + expect_dword(buf + 5, 0x00000020); + expect_magic((DWORD*)(buf + 6)); + expect_dword(buf + 7, 0x00000004); + expect_dword(buf + 8, 0x00006000); /* ?? */ +} + point = (RegionDataPoint*)buf + 9; + + expect(0, point[0].X); + expect(0, point[0].Y); + +todo_wine{ + expect(100,point[1].X); /* buf + 10 */ + expect(0, point[1].Y); + expect(100,point[2].X); /* buf + 11 */ + expect(10, point[2].Y); +} + expect(0, point[3].X); /* buf + 12 */ + +todo_wine{ + expect(10, point[3].Y); + expect_dword(buf + 13, 0x81010100); /* closed */ +} + } + + GdipDeleteRegion(region); + DeleteObject((HGDIOBJ)hrgn); + + /* ellipse */ + hrgn = CreateEllipticRgn(0, 0, 100, 10); + status = GdipCreateRegionHrgn(hrgn, ®ion); + todo_wine expect(Ok, status); + + status = GdipGetRegionDataSize(region, &needed); +todo_wine{ + expect(Ok, status); + expect(216, needed); +} + status = GdipGetRegionData(region, (BYTE*)buf, sizeof(buf), &needed); +todo_wine{ + expect(Ok, status); + expect(216, needed); + expect_dword(buf, 208); + expect_magic((DWORD*)(buf + 2)); + expect_dword(buf + 3, 0); + expect_dword(buf + 4, RGNDATA_PATH); + expect_dword(buf + 5, 0x000000C0); + expect_magic((DWORD*)(buf + 6)); + expect_dword(buf + 7, 0x00000024); + expect_dword(buf + 8, 0x00006000); /* ?? */ +} + GdipDeleteRegion(region); + DeleteObject((HGDIOBJ)hrgn); +} + START_TEST(region) { struct GdiplusStartupInput gdiplusStartupInput; @@ -667,6 +759,7 @@ START_TEST(region) test_isinfinite(); test_isempty(); test_combinereplace(); + test_fromhrgn(); GdiplusShutdown(gdiplusToken); diff --git a/dlls/winedos/dosvm.h b/dlls/iccvid/iccvid_Pt.rc similarity index 74% copy from dlls/winedos/dosvm.h copy to dlls/iccvid/iccvid_Pt.rc index 36168283f34..5e4ad5cabd3 100644 --- a/dlls/winedos/dosvm.h +++ b/dlls/iccvid/iccvid_Pt.rc @@ -1,7 +1,5 @@ /* - * DOS virtual machine - * - * Copyright 2000 Ove Kåven + * Copyright 2008 Ricardo Filipe * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -18,16 +16,10 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#ifndef __WINE_DOSVM_H -#define __WINE_DOSVM_H - -#include /* pid_t */ - -typedef struct { - PAPCFUNC proc; - ULONG_PTR arg; -} DOS_SPC; - -extern pid_t dosvm_pid; +LANGUAGE LANG_PORTUGUESE, SUBLANG_NEUTRAL -#endif /* __WINE_DOSVM_H */ +STRINGTABLE DISCARDABLE +{ + IDS_NAME "Codec Video Cinepak" + IDS_DESCRIPTION "Codec Video Cinepak" +} diff --git a/dlls/iccvid/rsrc.rc b/dlls/iccvid/rsrc.rc index c45fb829849..e7512207c82 100644 --- a/dlls/iccvid/rsrc.rc +++ b/dlls/iccvid/rsrc.rc @@ -28,6 +28,7 @@ #include "iccvid_Nl.rc" #include "iccvid_No.rc" #include "iccvid_Pl.rc" +#include "iccvid_Pt.rc" #include "iccvid_Ro.rc" #include "iccvid_Ru.rc" #include "iccvid_Si.rc" diff --git a/dlls/jscript/dispex.c b/dlls/jscript/dispex.c index 9717bfe26c0..31f47965ce2 100644 --- a/dlls/jscript/dispex.c +++ b/dlls/jscript/dispex.c @@ -941,7 +941,7 @@ HRESULT disp_propput(IDispatch *disp, DISPID id, LCID lcid, VARIANT *val, jsexce return hres; } -static HRESULT jsdisp_propget_name(DispatchEx *obj, const WCHAR *name, LCID lcid, VARIANT *var, +HRESULT jsdisp_propget_name(DispatchEx *obj, const WCHAR *name, LCID lcid, VARIANT *var, jsexcept_t *ei, IServiceProvider *caller) { DISPPARAMS dp = {NULL, NULL, 0, 0}; diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index 815d5fd6667..bf82dfab66c 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -367,14 +367,14 @@ HRESULT exec_source(exec_ctx_t *ctx, parser_ctx_t *parser, source_elements_t *so DispatchEx *func_obj; VARIANT var; - hres = create_source_function(parser, func->parameter_list, func->source_elements, - ctx->scope_chain, func->src_str, func->src_len, &func_obj); + hres = create_source_function(parser, func->expr->parameter_list, func->expr->source_elements, + ctx->scope_chain, func->expr->src_str, func->expr->src_len, &func_obj); if(FAILED(hres)) return hres; V_VT(&var) = VT_DISPATCH; V_DISPATCH(&var) = (IDispatch*)_IDispatchEx_(func_obj); - hres = jsdisp_propput_name(ctx->var_disp, func->identifier, script->lcid, &var, ei, NULL); + hres = jsdisp_propput_name(ctx->var_disp, func->expr->identifier, script->lcid, &var, ei, NULL); jsdisp_release(func_obj); if(FAILED(hres)) return hres; @@ -1244,26 +1244,25 @@ static HRESULT assign_oper_eval(exec_ctx_t *ctx, expression_t *lexpr, expression HRESULT function_expression_eval(exec_ctx_t *ctx, expression_t *_expr, DWORD flags, jsexcept_t *ei, exprval_t *ret) { function_expression_t *expr = (function_expression_t*)_expr; - DispatchEx *dispex; VARIANT var; HRESULT hres; TRACE("\n"); - hres = create_source_function(ctx->parser, expr->parameter_list, expr->source_elements, ctx->scope_chain, - expr->src_str, expr->src_len, &dispex); - if(FAILED(hres)) - return hres; - - V_VT(&var) = VT_DISPATCH; - V_DISPATCH(&var) = (IDispatch*)_IDispatchEx_(dispex); - if(expr->identifier) { - hres = jsdisp_propput_name(ctx->var_disp, expr->identifier, ctx->parser->script->lcid, &var, ei, NULL/*FIXME*/); - if(FAILED(hres)) { - jsdisp_release(dispex); + hres = jsdisp_propget_name(ctx->var_disp, expr->identifier, ctx->parser->script->lcid, &var, ei, NULL/*FIXME*/); + if(FAILED(hres)) return hres; - } + }else { + DispatchEx *dispex; + + hres = create_source_function(ctx->parser, expr->parameter_list, expr->source_elements, ctx->scope_chain, + expr->src_str, expr->src_len, &dispex); + if(FAILED(hres)) + return hres; + + V_VT(&var) = VT_DISPATCH; + V_DISPATCH(&var) = (IDispatch*)_IDispatchEx_(dispex); } ret->type = EXPRVAL_VARIANT; diff --git a/dlls/jscript/engine.h b/dlls/jscript/engine.h index 3746b5b6f2c..e02b717e744 100644 --- a/dlls/jscript/engine.h +++ b/dlls/jscript/engine.h @@ -17,12 +17,19 @@ */ typedef struct _source_elements_t source_elements_t; +typedef struct _function_expression_t function_expression_t; typedef struct _obj_literal_t { DispatchEx *obj; struct _obj_literal_t *next; } obj_literal_t; +typedef struct _function_declaration_t { + function_expression_t *expr; + + struct _function_declaration_t *next; +} function_declaration_t; + typedef struct _var_list_t { const WCHAR *identifier; @@ -30,6 +37,8 @@ typedef struct _var_list_t { } var_list_t; typedef struct _func_stack { + function_declaration_t *func_head; + function_declaration_t *func_tail; var_list_t *var_head; var_list_t *var_tail; @@ -288,32 +297,21 @@ struct _parameter_t { struct _parameter_t *next; }; -typedef struct _function_declaration_t { - const WCHAR *identifier; - parameter_t *parameter_list; - source_elements_t *source_elements; - const WCHAR *src_str; - DWORD src_len; - - struct _function_declaration_t *next; -} function_declaration_t; - struct _source_elements_t { statement_t *statement; statement_t *statement_tail; function_declaration_t *functions; - function_declaration_t *functions_tail; var_list_t *variables; }; -typedef struct { +struct _function_expression_t { expression_t expr; const WCHAR *identifier; parameter_t *parameter_list; source_elements_t *source_elements; const WCHAR *src_str; DWORD src_len; -} function_expression_t; +}; typedef struct { expression_t expr; diff --git a/dlls/jscript/jscript.h b/dlls/jscript/jscript.h index 59e23535374..b416f6ed1c8 100644 --- a/dlls/jscript/jscript.h +++ b/dlls/jscript/jscript.h @@ -128,6 +128,7 @@ HRESULT disp_propput(IDispatch*,DISPID,LCID,VARIANT*,jsexcept_t*,IServiceProvide HRESULT jsdisp_propget(DispatchEx*,DISPID,LCID,VARIANT*,jsexcept_t*,IServiceProvider*); HRESULT jsdisp_propput_name(DispatchEx*,const WCHAR*,LCID,VARIANT*,jsexcept_t*,IServiceProvider*); HRESULT jsdisp_propput_idx(DispatchEx*,DWORD,LCID,VARIANT*,jsexcept_t*,IServiceProvider*); +HRESULT jsdisp_propget_name(DispatchEx*,LPCWSTR,LCID,VARIANT*,jsexcept_t*,IServiceProvider*); HRESULT jsdisp_propget_idx(DispatchEx*,DWORD,LCID,VARIANT*,jsexcept_t*,IServiceProvider*); HRESULT jsdisp_get_id(DispatchEx*,const WCHAR*,DWORD,DISPID*); diff --git a/dlls/jscript/math.c b/dlls/jscript/math.c index 1d37de5a531..e6b7202e1a2 100644 --- a/dlls/jscript/math.c +++ b/dlls/jscript/math.c @@ -174,8 +174,9 @@ static HRESULT Math_ceil(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS * TRACE("\n"); if(!arg_cnt(dp)) { - FIXME("arg_cnt = 0\n"); - return E_NOTIMPL; + if(retv) + num_set_nan(retv); + return S_OK; } hres = to_number(dispex->ctx, get_arg(dp, 0), ei, &v); @@ -204,8 +205,24 @@ static HRESULT Math_exp(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *d static HRESULT Math_floor(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { - FIXME("\n"); - return E_NOTIMPL; + VARIANT v; + HRESULT hres; + + TRACE("\n"); + + if(!arg_cnt(dp)) { + if(retv) + num_set_nan(retv); + return S_OK; + } + + hres = to_number(dispex->ctx, get_arg(dp, 0), ei, &v); + if(FAILED(hres)) + return hres; + + if(retv) + num_set_val(retv, floor(num_val(&v))); + return S_OK; } static HRESULT Math_log(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, diff --git a/dlls/jscript/number.c b/dlls/jscript/number.c index 598de42093e..d909cdb851a 100644 --- a/dlls/jscript/number.c +++ b/dlls/jscript/number.c @@ -105,8 +105,18 @@ static HRESULT Number_toPrecision(DispatchEx *dispex, LCID lcid, WORD flags, DIS static HRESULT Number_valueOf(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, VARIANT *retv, jsexcept_t *ei, IServiceProvider *sp) { - FIXME("\n"); - return E_NOTIMPL; + TRACE("\n"); + + if(!is_class(dispex, JSCLASS_NUMBER)) { + FIXME("throw TypeError\n"); + return E_FAIL; + } + + if(retv) { + NumberInstance *number = (NumberInstance*)dispex; + *retv = number->num; + } + return S_OK; } static HRESULT Number_hasOwnProperty(DispatchEx *dispex, LCID lcid, WORD flags, DISPPARAMS *dp, @@ -198,19 +208,13 @@ static HRESULT NumberConstr_value(DispatchEx *dispex, LCID lcid, WORD flags, DIS case DISPATCH_CONSTRUCT: { DispatchEx *obj; - switch(arg_cnt(dp)) { - case 0: - V_VT(&num) = VT_I4; - V_I4(&num) = 0; - break; - case 1: + if(arg_cnt(dp)) { hres = to_number(dispex->ctx, get_arg(dp, 0), ei, &num); if(FAILED(hres)) return hres; - break; - default: - FIXME("unimplemented args\n"); - return E_NOTIMPL; + }else { + V_VT(&num) = VT_I4; + V_I4(&num) = 0; } hres = create_number(dispex->ctx, &num, &obj); @@ -258,6 +262,7 @@ HRESULT create_number_constr(script_ctx_t *ctx, DispatchEx **ret) if(FAILED(hres)) return hres; + V_VT(&number->num) = VT_I4; hres = create_builtin_function(ctx, NumberConstr_value, PROPF_CONSTR, &number->dispex, ret); jsdisp_release(&number->dispex); diff --git a/dlls/jscript/parser.y b/dlls/jscript/parser.y index af3d35de5e0..7a74e467e06 100644 --- a/dlls/jscript/parser.y +++ b/dlls/jscript/parser.y @@ -142,11 +142,8 @@ static expression_t *new_literal_expression(parser_ctx_t*,literal_t*); static expression_t *new_array_literal_expression(parser_ctx_t*,element_list_t*,int); static expression_t *new_prop_and_value_expression(parser_ctx_t*,property_list_t*); -static function_declaration_t *new_function_declaration(parser_ctx_t*,const WCHAR*,parameter_list_t*, - source_elements_t*,const WCHAR*,DWORD); static source_elements_t *new_source_elements(parser_ctx_t*); static source_elements_t *source_elements_add_statement(source_elements_t*,statement_t*); -static source_elements_t *source_elements_add_function(source_elements_t*,function_declaration_t*); %} @@ -165,7 +162,6 @@ static source_elements_t *source_elements_add_function(source_elements_t*,functi struct _element_list_t *element_list; expression_t *expr; const WCHAR *identifier; - function_declaration_t *function_declaration; struct _parameter_list_t *parameter_list; struct _property_list_t *property_list; source_elements_t *source_elements; @@ -207,7 +203,6 @@ static source_elements_t *source_elements_add_function(source_elements_t*,functi %type TryStatement %type Finally %type StatementList StatementList_opt -%type FunctionDeclaration %type FormalParameterList FormalParameterList_opt %type Expression Expression_opt %type ExpressionNoIn ExpressionNoIn_opt @@ -267,13 +262,6 @@ SourceElements : /* empty */ { $$ = new_source_elements(ctx); } | SourceElements Statement { $$ = source_elements_add_statement($1, $2); } - | SourceElements FunctionDeclaration - { $$ = source_elements_add_function($1, $2); } - -/* ECMA-262 3rd Edition 13 */ -FunctionDeclaration - : KFunction tIdentifier '(' FormalParameterList_opt ')' '{' FunctionBody '}' - { $$ = new_function_declaration(ctx, $2, $4, $7, $1, $8-$1+1); } /* ECMA-262 3rd Edition 13 */ FunctionExpression @@ -1287,6 +1275,18 @@ static expression_t *new_function_expression(parser_ctx_t *ctx, const WCHAR *ide ret->src_str = src_str; ret->src_len = src_len; + if(ret->identifier) { + function_declaration_t *decl = parser_alloc(ctx, sizeof(function_declaration_t)); + + decl->expr = ret; + decl->next = NULL; + + if(ctx->func_stack->func_tail) + ctx->func_stack->func_tail = ctx->func_stack->func_tail->next = decl; + else + ctx->func_stack->func_head = ctx->func_stack->func_tail = decl; + } + return &ret->expr; } @@ -1474,21 +1474,6 @@ static expression_t *new_literal_expression(parser_ctx_t *ctx, literal_t *litera return &ret->expr; } -static function_declaration_t *new_function_declaration(parser_ctx_t *ctx, const WCHAR *identifier, - parameter_list_t *parameter_list, source_elements_t *source_elements, const WCHAR *src_str, DWORD src_len) -{ - function_declaration_t *ret = parser_alloc(ctx, sizeof(function_declaration_t)); - - ret->identifier = identifier; - ret->parameter_list = parameter_list ? parameter_list->head : NULL; - ret->source_elements = source_elements; - ret->src_str = src_str; - ret->src_len = src_len; - ret->next = NULL; - - return ret; -} - static source_elements_t *new_source_elements(parser_ctx_t *ctx) { source_elements_t *ret = parser_alloc(ctx, sizeof(source_elements_t)); @@ -1508,17 +1493,6 @@ static source_elements_t *source_elements_add_statement(source_elements_t *sourc return source_elements; } -static source_elements_t *source_elements_add_function(source_elements_t *source_elements, - function_declaration_t *function_declaration) -{ - if(source_elements->functions_tail) - source_elements->functions_tail = source_elements->functions_tail->next = function_declaration; - else - source_elements->functions = source_elements->functions_tail = function_declaration; - - return source_elements; -} - statement_list_t *new_statement_list(parser_ctx_t *ctx, statement_t *statement) { statement_list_t *ret = parser_alloc_tmp(ctx, sizeof(statement_list_t)); @@ -1539,6 +1513,7 @@ static void push_func(parser_ctx_t *ctx) { func_stack_t *new_func = parser_alloc_tmp(ctx, sizeof(func_stack_t)); + new_func->func_head = new_func->func_tail = NULL; new_func->var_head = new_func->var_tail = NULL; new_func->next = ctx->func_stack; @@ -1547,6 +1522,7 @@ static void push_func(parser_ctx_t *ctx) static source_elements_t *function_body_parsed(parser_ctx_t *ctx, source_elements_t *source) { + source->functions = ctx->func_stack->func_head; source->variables = ctx->func_stack->var_head; pop_func(ctx); @@ -1555,6 +1531,7 @@ static source_elements_t *function_body_parsed(parser_ctx_t *ctx, source_element static void program_parsed(parser_ctx_t *ctx, source_elements_t *source) { + source->functions = ctx->func_stack->func_head; source->variables = ctx->func_stack->var_head; pop_func(ctx); diff --git a/dlls/jscript/tests/api.js b/dlls/jscript/tests/api.js index 3bb3ddf5410..6378bdd86ec 100644 --- a/dlls/jscript/tests/api.js +++ b/dlls/jscript/tests/api.js @@ -362,6 +362,15 @@ ok(Number() === 0, "Number() = " + Number()); ok(Number(false) === 0, "Number(false) = " + Number(false)); ok(Number("43") === 43, "Number('43') = " + Number("43")); +tmp = (new Number(1)).valueOf(); +ok(tmp === 1, "(new Number(1)).valueOf = " + tmp); +tmp = (new Number(1,2)).valueOf(); +ok(tmp === 1, "(new Number(1,2)).valueOf = " + tmp); +tmp = (new Number()).valueOf(); +ok(tmp === 0, "(new Number()).valueOf = " + tmp); +tmp = Number.prototype.valueOf(); +ok(tmp === 0, "Number.prototype.valueOf = " + tmp); + tmp = Math.min(1); ok(tmp === 1, "Math.min(1) = " + tmp); @@ -422,6 +431,27 @@ ok(tmp === 1, "Math.ceil(true) = " + tmp); tmp = Math.ceil(1.1, 3, 4); ok(tmp === 2, "Math.ceil(1.1, 3, 4) = " + tmp); +tmp = Math.ceil(); +ok(isNaN(tmp), "ceil() is not NaN"); + +tmp = Math.floor(0.5); +ok(tmp === 0, "Math.floor(0.5) = " + tmp); + +tmp = Math.floor(-0.5); +ok(tmp === -1, "Math.floor(-0.5) = " + tmp); + +tmp = Math.floor(1.1); +ok(tmp === 1, "Math.floor(1.1) = " + tmp); + +tmp = Math.floor(true); +ok(tmp === 1, "Math.floor(true) = " + tmp); + +tmp = Math.floor(1.1, 3, 4); +ok(tmp === 1, "Math.floor(1.1, 3, 4) = " + tmp); + +tmp = Math.floor(); +ok(isNaN(tmp), "floor is not NaN"); + tmp = Math.abs(3); ok(tmp === 3, "Math.abs(3) = " + tmp); diff --git a/dlls/jscript/tests/lang.js b/dlls/jscript/tests/lang.js index 71dd2aae3d3..0d68f377724 100644 --- a/dlls/jscript/tests/lang.js +++ b/dlls/jscript/tests/lang.js @@ -832,4 +832,43 @@ ok((Infinity != NaN) === true, "(Infinity != NaN) !== true"); ok((Infinity != NaN) === true, "(Infinity != NaN) !== true"); ok((0 == NaN) === false, "(0 === NaN) != false"); + +ok(typeof(testFunc2) === "function", "typeof(testFunc2) = " + typeof(testFunc2)); +tmp = testFunc2(1); +ok(tmp === 2, "testFunc2(1) = " + tmp); +function testFunc2(x) { return x+1; } + +ok(typeof(testFunc3) === "function", "typeof(testFunc3) = " + typeof(testFunc3)); +tmp = testFunc3(1); +ok(tmp === 3, "testFunc3(1) = " + tmp); +tmp = function testFunc3(x) { return x+2; }; + +tmp = testFunc4(1); +ok(tmp === 5, "testFunc4(1) = " + tmp); +tmp = function testFunc4(x) { return x+3; }; +tmp = testFunc4(1); +testFunc4 = 1; +ok(testFunc4 === 1, "testFunc4 = " + testFunc4); +ok(tmp === 5, "testFunc4(1) = " + tmp); +tmp = function testFunc4(x) { return x+4; }; +ok(testFunc4 === 1, "testFunc4 = " + testFunc4); + +function testEmbededFunctions() { + ok(typeof(testFunc5) === "function", "typeof(testFunc5) = " + typeof(testFunc5)); + tmp = testFunc5(1); + ok(tmp === 3, "testFunc5(1) = " + tmp); + tmp = function testFunc5(x) { return x+2; }; + + tmp = testFunc6(1); + ok(tmp === 5, "testFunc6(1) = " + tmp); + tmp = function testFunc6(x) { return x+3; }; + tmp = testFunc6(1); + ok(tmp === 5, "testFunc6(1) = " + tmp); + tmp = function testFunc6(x) { return x+4; }; + testFunc6 = 1; + ok(testFunc6 === 1, "testFunc4 = " + testFunc6); +} + +testEmbededFunctions(); + reportSuccess(); diff --git a/dlls/kernel32/lcformat.c b/dlls/kernel32/lcformat.c index 0445a9bf151..1b1dfcc2edb 100644 --- a/dlls/kernel32/lcformat.c +++ b/dlls/kernel32/lcformat.c @@ -3,7 +3,7 @@ * * Copyright 1995 Martin von Loewis * Copyright 1998 David Lee Lambert - * Copyright 2000 Julio César Gázquez + * Copyright 2000 Julio César Gázquez * Copyright 2003 Jon Griffiths * Copyright 2005 Dmitry Timoshkov * diff --git a/dlls/kernel32/locale.c b/dlls/kernel32/locale.c index 8aedacbda58..9874a24e15c 100644 --- a/dlls/kernel32/locale.c +++ b/dlls/kernel32/locale.c @@ -3,7 +3,7 @@ * * Copyright 1995 Martin von Loewis * Copyright 1998 David Lee Lambert - * Copyright 2000 Julio César Gázquez + * Copyright 2000 Julio César Gázquez * Copyright 2002 Alexandre Julliard for CodeWeavers * * This library is free software; you can redistribute it and/or diff --git a/dlls/kernel32/nls/eox.nls b/dlls/kernel32/nls/eox.nls index 6a6b87f3f4a..0f5e7225a1e 100644 --- a/dlls/kernel32/nls/eox.nls +++ b/dlls/kernel32/nls/eox.nls @@ -82,7 +82,7 @@ STRINGTABLE LANGUAGE LANG_ESPERANTO, SUBLANG_DEFAULT LOCALE_SABBREVDAYNAME1 "lu" LOCALE_SABBREVDAYNAME2 "ma" LOCALE_SABBREVDAYNAME3 "me" - LOCALE_SABBREVDAYNAME4 "¼a" + LOCALE_SABBREVDAYNAME4 "ĵa" LOCALE_SABBREVDAYNAME5 "ve" LOCALE_SABBREVDAYNAME6 "sa" LOCALE_SABBREVDAYNAME7 "di" @@ -94,7 +94,7 @@ STRINGTABLE LANGUAGE LANG_ESPERANTO, SUBLANG_DEFAULT LOCALE_SABBREVMONTHNAME5 "maj" LOCALE_SABBREVMONTHNAME6 "jun" LOCALE_SABBREVMONTHNAME7 "jul" - LOCALE_SABBREVMONTHNAME8 "aýg" + LOCALE_SABBREVMONTHNAME8 "aŭg" LOCALE_SABBREVMONTHNAME9 "sep" LOCALE_SABBREVMONTHNAME10 "okt" LOCALE_SABBREVMONTHNAME11 "nov" @@ -106,10 +106,10 @@ STRINGTABLE LANGUAGE LANG_ESPERANTO, SUBLANG_DEFAULT LOCALE_SDAYNAME1 "lundo" LOCALE_SDAYNAME2 "mardo" LOCALE_SDAYNAME3 "merkredo" - LOCALE_SDAYNAME4 "¼aýdo" + LOCALE_SDAYNAME4 "ĵaŭdo" LOCALE_SDAYNAME5 "vendredo" LOCALE_SDAYNAME6 "sabato" - LOCALE_SDAYNAME7 "dimanæo" + LOCALE_SDAYNAME7 "dimanĉo" LOCALE_SDECIMAL "," LOCALE_SENGCOUNTRY "" LOCALE_SENGCURRNAME "Euro" @@ -130,7 +130,7 @@ STRINGTABLE LANGUAGE LANG_ESPERANTO, SUBLANG_DEFAULT LOCALE_SMONTHNAME5 "majo" LOCALE_SMONTHNAME6 "junio" LOCALE_SMONTHNAME7 "julio" - LOCALE_SMONTHNAME8 "aýgusto" + LOCALE_SMONTHNAME8 "aŭgusto" LOCALE_SMONTHNAME9 "septembro" LOCALE_SMONTHNAME10 "oktobro" LOCALE_SMONTHNAME11 "novembro" diff --git a/dlls/kernel32/oldconfig.c b/dlls/kernel32/oldconfig.c index 09e407b59d5..ee41d813143 100644 --- a/dlls/kernel32/oldconfig.c +++ b/dlls/kernel32/oldconfig.c @@ -32,7 +32,9 @@ # include #endif #include -#include +#ifdef HAVE_DIRENT_H +# include +#endif #ifdef HAVE_SYS_IOCTL_H #include #endif diff --git a/dlls/kernel32/pthread.c b/dlls/kernel32/pthread.c index 9e7dd2e8a94..e8b549d9d65 100644 --- a/dlls/kernel32/pthread.c +++ b/dlls/kernel32/pthread.c @@ -1,7 +1,7 @@ /* * pthread emulation for re-entrant libcs * - * Copyright 1999 Ove Kåven + * Copyright 1999 Ove Kåven * Copyright 2003 Alexandre Julliard * * This library is free software; you can redistribute it and/or diff --git a/dlls/kernel32/tests/actctx.c b/dlls/kernel32/tests/actctx.c index 60d1f70cd3a..1215ef587a0 100644 --- a/dlls/kernel32/tests/actctx.c +++ b/dlls/kernel32/tests/actctx.c @@ -851,6 +851,42 @@ static void test_find_string_fail(void) ok(GetLastError() == ERROR_INVALID_PARAMETER, "GetLastError()=%u\n", GetLastError()); } + +static void test_basic_info(HANDLE handle) +{ + ACTIVATION_CONTEXT_BASIC_INFORMATION basic; + SIZE_T size; + BOOL b; + + b = pQueryActCtxW(0, handle, NULL, + ActivationContextBasicInformation, &basic, + sizeof(basic), &size); + + ok (b,"ActivationContextBasicInformation failed\n"); + ok (size == sizeof(ACTIVATION_CONTEXT_BASIC_INFORMATION),"size mismatch\n"); + ok (basic.dwFlags == 0, "unexpected flags %x\n",basic.dwFlags); + ok (basic.hActCtx == handle, "unexpected handle\n"); + + b = pQueryActCtxW(QUERY_ACTCTX_FLAG_USE_ACTIVE_ACTCTX, handle, NULL, + ActivationContextBasicInformation, &basic, + sizeof(basic), &size); + if (handle) + { + ok (!b,"ActivationContextBasicInformation succeeded\n"); + ok (size == 0,"size mismatch\n"); + ok (GetLastError() == ERROR_INVALID_PARAMETER, "Wrong last error\n"); + ok (basic.dwFlags == 0, "unexpected flags %x\n",basic.dwFlags); + ok (basic.hActCtx == handle, "unexpected handle\n"); + } + else + { + ok (b,"ActivationContextBasicInformation failed\n"); + ok (size == sizeof(ACTIVATION_CONTEXT_BASIC_INFORMATION),"size mismatch\n"); + ok (basic.dwFlags == 0, "unexpected flags %x\n",basic.dwFlags); + ok (basic.hActCtx == handle, "unexpected handle\n"); + } +} + static void test_actctx(void) { ULONG_PTR cookie; @@ -865,6 +901,7 @@ static void test_actctx(void) ok(handle == NULL, "handle = %p, expected NULL\n", handle); ok(b, "GetCurrentActCtx failed: %u\n", GetLastError()); if(b) { + test_basic_info(handle); test_detailed_info(handle, &detailed_info0); pReleaseActCtx(handle); } @@ -879,6 +916,7 @@ static void test_actctx(void) handle = test_create("test1.manifest", manifest1); DeleteFileA("test1.manifest"); if(handle != INVALID_HANDLE_VALUE) { + test_basic_info(handle); test_detailed_info(handle, &detailed_info1); test_info_in_assembly(handle, 1, &manifest1_info); @@ -904,6 +942,7 @@ static void test_actctx(void) DeleteFileA("test2.manifest"); DeleteFileA("testdep.manifest"); if(handle != INVALID_HANDLE_VALUE) { + test_basic_info(handle); test_detailed_info(handle, &detailed_info2); test_info_in_assembly(handle, 1, &manifest2_info); test_info_in_assembly(handle, 2, &depmanifest1_info); @@ -921,6 +960,7 @@ static void test_actctx(void) DeleteFileA("test3.manifest"); DeleteFileA("testdep.manifest"); if(handle != INVALID_HANDLE_VALUE) { + test_basic_info(handle); test_detailed_info(handle, &detailed_info2); test_info_in_assembly(handle, 1, &manifest2_info); test_info_in_assembly(handle, 2, &depmanifest2_info); @@ -948,6 +988,7 @@ static void test_actctx(void) DeleteFileA("test2-3.manifest"); DeleteFileA("testdep.manifest"); if(handle != INVALID_HANDLE_VALUE) { + test_basic_info(handle); test_detailed_info(handle, &detailed_info2); test_info_in_assembly(handle, 1, &manifest2_info); test_info_in_assembly(handle, 2, &depmanifest3_info); @@ -976,6 +1017,7 @@ static void test_actctx(void) handle = test_create("test3.manifest", manifest3); DeleteFileA("test3.manifest"); if(handle != INVALID_HANDLE_VALUE) { + test_basic_info(handle); test_detailed_info(handle, &detailed_info1); test_info_in_assembly(handle, 1, &manifest3_info); test_file_info(handle, 0, 0, testlib_dll); @@ -1002,6 +1044,7 @@ static void test_actctx(void) DeleteFileA("test4.manifest"); DeleteFileA("testdep.manifest"); if(handle != INVALID_HANDLE_VALUE) { + test_basic_info(handle); test_detailed_info(handle, &detailed_info2); test_info_in_assembly(handle, 1, &manifest4_info); test_info_in_assembly(handle, 2, &manifest_comctrl_info); @@ -1020,6 +1063,7 @@ static void test_actctx(void) handle = test_create("..\\test1.manifest", manifest1); DeleteFileA("..\\test1.manifest"); if(handle != INVALID_HANDLE_VALUE) { + test_basic_info(handle); test_detailed_info(handle, &detailed_info1); test_info_in_assembly(handle, 1, &manifest1_info); pReleaseActCtx(handle); @@ -1039,6 +1083,7 @@ static void test_actctx(void) handle = test_create("test1.manifest", manifest1); DeleteFileA("test1.manifest"); if (handle != INVALID_HANDLE_VALUE) { + test_basic_info(handle); test_detailed_info(handle, &detailed_info1); test_info_in_assembly(handle, 1, &manifest1_info); pReleaseActCtx(handle); @@ -1053,6 +1098,7 @@ static void test_actctx(void) handle = test_create("test1.manifest", manifest1); DeleteFileA("test1.manifest"); if (handle != INVALID_HANDLE_VALUE) { + test_basic_info(handle); test_detailed_info(handle, &detailed_info1); test_info_in_assembly(handle, 1, &manifest1_info); pReleaseActCtx(handle); @@ -1071,6 +1117,7 @@ static void test_app_manifest(void) ok(handle == NULL, "handle != NULL\n"); ok(b, "GetCurrentActCtx failed: %u\n", GetLastError()); if(b) { + test_basic_info(handle); test_detailed_info(handle, &detailed_info1_child); test_info_in_assembly(handle, 1, &manifest1_child_info); pReleaseActCtx(handle); diff --git a/dlls/kernel32/tests/file.c b/dlls/kernel32/tests/file.c index 76665a8c4dc..3a7635dff38 100644 --- a/dlls/kernel32/tests/file.c +++ b/dlls/kernel32/tests/file.c @@ -1644,6 +1644,7 @@ static void test_async_file_errors(void) } ok(completion_count == 0, "completion routine should only be called when ReadFileEx succeeds (this rule was violated %d times)\n", completion_count); /*printf("Error = %ld\n", GetLastError());*/ + HeapFree(GetProcessHeap(), 0, lpBuffer); } static void test_read_write(void) diff --git a/dlls/kernel32/tests/volume.c b/dlls/kernel32/tests/volume.c index 14fcadeccbe..97e3559c000 100644 --- a/dlls/kernel32/tests/volume.c +++ b/dlls/kernel32/tests/volume.c @@ -51,7 +51,7 @@ static void test_query_dos_deviceA(void) if (strstr(buffer, "HARDDISK") || strstr(buffer, "RAMDISK")) found = TRUE; } } - todo_wine ok(found, "expected at least one devicename to contain HARDDISK or RAMDISK\n"); + ok(found, "expected at least one devicename to contain HARDDISK or RAMDISK\n"); } static void test_FindFirstVolume(void) @@ -165,7 +165,9 @@ static void test_GetLogicalDriveStringsA(void) ok(size2 == size-1, "size2 = %d\n", size2); for(ptr = buf; ptr < buf+size2; ptr += 4) { - ok('A' <= *ptr && *ptr <= 'Z', "device name '%c' is not uppercase\n", *ptr); + ok(('A' <= *ptr && *ptr <= 'Z') || + (broken('a' <= *ptr && *ptr <= 'z')), /* Win9x and WinMe */ + "device name '%c' is not uppercase\n", *ptr); ok(ptr[1] == ':', "ptr[1] = %c, expected ':'\n", ptr[1]); ok(ptr[2] == '\\', "ptr[2] = %c expected '\\'\n", ptr[2]); ok(!ptr[3], "ptr[3] = %c expected nullbyte\n", ptr[3]); @@ -185,7 +187,12 @@ static void test_GetLogicalDriveStringsW(void) return; } + SetLastError(0xdeadbeef); size = pGetLogicalDriveStringsW(0, NULL); + if (size == 0 && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED) { + win_skip("GetLogicalDriveStringsW not implemented\n"); + return; + } ok(size%4 == 1, "size = %d\n", size); buf = HeapAlloc(GetProcessHeap(), 0, size*sizeof(WCHAR)); diff --git a/dlls/kernel32/volume.c b/dlls/kernel32/volume.c index 823d163008e..7dc046f6efc 100644 --- a/dlls/kernel32/volume.c +++ b/dlls/kernel32/volume.c @@ -46,6 +46,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(volume); #define SUPERBLOCK_SIZE 2048 +#define SYMBOLIC_LINK_QUERY 0x0001 #define CDFRAMES_PERSEC 75 #define CDFRAMES_PERMIN (CDFRAMES_PERSEC * 60) @@ -128,6 +129,33 @@ static char *get_dos_device_path( LPCWSTR name ) return buffer; } +/* read the contents of an NT symlink object */ +static NTSTATUS read_nt_symlink( const WCHAR *name, WCHAR *target, DWORD size ) +{ + NTSTATUS status; + OBJECT_ATTRIBUTES attr; + UNICODE_STRING nameW; + HANDLE handle; + + attr.Length = sizeof(attr); + attr.RootDirectory = 0; + attr.Attributes = OBJ_CASE_INSENSITIVE; + attr.ObjectName = &nameW; + attr.SecurityDescriptor = NULL; + attr.SecurityQualityOfService = NULL; + RtlInitUnicodeString( &nameW, name ); + + if (!(status = NtOpenSymbolicLinkObject( &handle, SYMBOLIC_LINK_QUERY, &attr ))) + { + UNICODE_STRING targetW; + targetW.Buffer = target; + targetW.MaximumLength = (size - 1) * sizeof(WCHAR); + status = NtQuerySymbolicLinkObject( handle, &targetW, NULL ); + if (!status) target[targetW.Length / sizeof(WCHAR)] = 0; + NtClose( handle ); + } + return status; +} /* open a handle to a device root */ static BOOL open_device_root( LPCWSTR root, HANDLE *handle ) @@ -916,6 +944,7 @@ DWORD WINAPI QueryDosDeviceW( LPCWSTR devname, LPWSTR target, DWORD bufsize ) static const WCHAR com0W[] = {'\\','?','?','\\','C','O','M','0',0}; static const WCHAR com1W[] = {'\\','D','o','s','D','e','v','i','c','e','s','\\','C','O','M','1',0,0}; static const WCHAR lpt1W[] = {'\\','D','o','s','D','e','v','i','c','e','s','\\','L','P','T','1',0,0}; + static const WCHAR driveW[] = {'\\','D','o','s','D','e','v','i','c','e','s','\\','A',':',0}; UNICODE_STRING nt_name; ANSI_STRING unix_name; @@ -941,7 +970,19 @@ DWORD WINAPI QueryDosDeviceW( LPCWSTR devname, LPWSTR target, DWORD bufsize ) } else if (devname[0] && devname[1] == ':' && !devname[2]) { - memcpy( name, devname, 3 * sizeof(WCHAR) ); + /* FIXME: should do this for all devices, not just drives */ + NTSTATUS status; + WCHAR buffer[sizeof(driveW)/sizeof(WCHAR)]; + + memcpy( buffer, driveW, sizeof(driveW) ); + buffer[12] = devname[0]; + if ((status = read_nt_symlink( buffer, target, bufsize ))) + { + SetLastError( RtlNtStatusToDosError(status) ); + return 0; + } + ret = strlenW( target ) + 1; + goto done; } else { @@ -995,7 +1036,7 @@ DWORD WINAPI QueryDosDeviceW( LPCWSTR devname, LPWSTR target, DWORD bufsize ) RtlFreeAnsiString( &unix_name ); } } - + done: if (ret) { if (ret < bufsize) target[ret++] = 0; /* add an extra null */ @@ -1064,12 +1105,17 @@ DWORD WINAPI QueryDosDeviceW( LPCWSTR devname, LPWSTR target, DWORD bufsize ) strcpyW( nt_buffer + 4, rootW ); RtlInitUnicodeString( &nt_name, nt_buffer ); + /* FIXME: should simply enumerate the DosDevices directory instead */ for (i = 0; i < 26; i++) { - nt_buffer[4] = 'a' + i; - if (!wine_nt_to_unix_file_name( &nt_name, &unix_name, FILE_OPEN, TRUE )) + WCHAR buffer[sizeof(driveW)/sizeof(WCHAR)], dummy[8]; + NTSTATUS status; + + memcpy( buffer, driveW, sizeof(driveW) ); + buffer[12] = 'A' + i; + status = read_nt_symlink( buffer, dummy, sizeof(dummy)/sizeof(WCHAR) ); + if (status == STATUS_SUCCESS || status == STATUS_BUFFER_TOO_SMALL) { - RtlFreeAnsiString( &unix_name ); if (p + 3 >= target + bufsize) { SetLastError( ERROR_INSUFFICIENT_BUFFER ); diff --git a/dlls/mountmgr.sys/device.c b/dlls/mountmgr.sys/device.c index 0260b5ffd4f..00b59ed617c 100644 --- a/dlls/mountmgr.sys/device.c +++ b/dlls/mountmgr.sys/device.c @@ -27,8 +27,7 @@ #include #include -#include "windef.h" -#include "winbase.h" +#include "mountmgr.h" #include "winreg.h" #include "winuser.h" #include "dbt.h" @@ -40,6 +39,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(mountmgr); +#define MAX_DOS_DRIVES 26 + static const WCHAR drive_types[][8] = { { 0 }, /* DRIVE_UNKNOWN */ @@ -51,16 +52,30 @@ static const WCHAR drive_types[][8] = {'r','a','m','d','i','s','k',0} /* DRIVE_RAMDISK */ }; +static const WCHAR drives_keyW[] = {'S','o','f','t','w','a','r','e','\\', + 'W','i','n','e','\\','D','r','i','v','e','s',0}; + struct dos_drive { - struct list entry; - char *udi; - int drive; + struct list entry; /* entry in drives list */ + char *udi; /* unique identifier for dynamic drives */ + int drive; /* drive letter (0 = A: etc.) */ + DWORD type; /* drive type */ + DEVICE_OBJECT *device; /* disk device allocated for this drive */ + UNICODE_STRING name; /* device name */ + UNICODE_STRING symlink; /* device symlink if any */ + STORAGE_DEVICE_NUMBER devnum; /* device number info */ + struct mount_point *dosdev; /* DosDevices mount point */ + struct mount_point *volume; /* Volume{xxx} mount point */ + char *unix_device; /* unix device path */ + char *unix_mount; /* unix mount point path */ }; static struct list drives_list = LIST_INIT(drives_list); -static char *get_dosdevices_path(void) +static DRIVER_OBJECT *harddisk_driver; + +static char *get_dosdevices_path( char **drive ) { const char *config_dir = wine_get_config_dir(); size_t len = strlen(config_dir) + sizeof("/dosdevices/a::"); @@ -69,10 +84,49 @@ static char *get_dosdevices_path(void) { strcpy( path, config_dir ); strcat( path, "/dosdevices/a::" ); + *drive = path + len - 4; } return path; } +static char *strdupA( const char *str ) +{ + char *ret; + + if (!str) return NULL; + if ((ret = RtlAllocateHeap( GetProcessHeap(), 0, strlen(str) + 1 ))) strcpy( ret, str ); + return ret; +} + +/* read a Unix symlink; returned buffer must be freed by caller */ +static char *read_symlink( const char *path ) +{ + char *buffer; + int ret, size = 128; + + for (;;) + { + if (!(buffer = RtlAllocateHeap( GetProcessHeap(), 0, size ))) + { + SetLastError( ERROR_NOT_ENOUGH_MEMORY ); + return 0; + } + ret = readlink( path, buffer, size ); + if (ret == -1) + { + RtlFreeHeap( GetProcessHeap(), 0, buffer ); + return 0; + } + if (ret != size) + { + buffer[ret] = 0; + return buffer; + } + RtlFreeHeap( GetProcessHeap(), 0, buffer ); + size *= 2; + } +} + /* send notification about a change to a given drive */ static void send_notify( int drive, int code ) { @@ -88,6 +142,160 @@ static void send_notify( int drive, int code ) WM_DEVICECHANGE, code, (LPARAM)&info ); } +/* create the disk device for a given drive */ +static NTSTATUS create_disk_device( const char *udi, DWORD type, struct dos_drive **drive_ret ) +{ + static const WCHAR harddiskvolW[] = {'\\','D','e','v','i','c','e', + '\\','H','a','r','d','d','i','s','k','V','o','l','u','m','e','%','u',0}; + static const WCHAR harddiskW[] = {'\\','D','e','v','i','c','e','\\','H','a','r','d','d','i','s','k','%','u',0}; + static const WCHAR cdromW[] = {'\\','D','e','v','i','c','e','\\','C','d','R','o','m','%','u',0}; + static const WCHAR floppyW[] = {'\\','D','e','v','i','c','e','\\','F','l','o','p','p','y','%','u',0}; + static const WCHAR physdriveW[] = {'\\','?','?','\\','P','h','y','s','i','c','a','l','D','r','i','v','e','%','u',0}; + + UINT i, first = 0; + NTSTATUS status = 0; + const WCHAR *format; + UNICODE_STRING name; + DEVICE_OBJECT *dev_obj; + struct dos_drive *drive; + + switch(type) + { + case DRIVE_REMOVABLE: + format = floppyW; + break; + case DRIVE_CDROM: + format = cdromW; + break; + case DRIVE_FIXED: + default: /* FIXME */ + if (udi) format = harddiskW; + else + { + format = harddiskvolW; + first = 1; /* harddisk volumes start counting from 1 */ + } + break; + } + + name.MaximumLength = (strlenW(format) + 10) * sizeof(WCHAR); + name.Buffer = RtlAllocateHeap( GetProcessHeap(), 0, name.MaximumLength ); + for (i = first; i < 32; i++) + { + sprintfW( name.Buffer, format, i ); + name.Length = strlenW(name.Buffer) * sizeof(WCHAR); + status = IoCreateDevice( harddisk_driver, sizeof(*drive), &name, 0, 0, FALSE, &dev_obj ); + if (status != STATUS_OBJECT_NAME_COLLISION) break; + } + if (!status) + { + drive = dev_obj->DeviceExtension; + drive->drive = -1; + drive->device = dev_obj; + drive->name = name; + drive->type = type; + drive->dosdev = NULL; + drive->volume = NULL; + drive->unix_device = NULL; + drive->unix_mount = NULL; + drive->symlink.Buffer = NULL; + if (udi) + { + if (!(drive->udi = HeapAlloc( GetProcessHeap(), 0, strlen(udi)+1 ))) + { + RtlFreeUnicodeString( &name ); + IoDeleteDevice( drive->device ); + return STATUS_NO_MEMORY; + } + strcpy( drive->udi, udi ); + } + switch (type) + { + case DRIVE_REMOVABLE: + drive->devnum.DeviceType = FILE_DEVICE_DISK; + drive->devnum.DeviceNumber = i; + drive->devnum.PartitionNumber = ~0u; + break; + case DRIVE_CDROM: + drive->devnum.DeviceType = FILE_DEVICE_CD_ROM; + drive->devnum.DeviceNumber = i; + drive->devnum.PartitionNumber = ~0u; + break; + case DRIVE_FIXED: + default: /* FIXME */ + drive->devnum.DeviceType = FILE_DEVICE_DISK; + if (udi) + { + UNICODE_STRING symlink; + + symlink.MaximumLength = sizeof(physdriveW) + 10 * sizeof(WCHAR); + if ((symlink.Buffer = RtlAllocateHeap( GetProcessHeap(), 0, symlink.MaximumLength))) + { + sprintfW( symlink.Buffer, physdriveW, i ); + symlink.Length = strlenW(symlink.Buffer) * sizeof(WCHAR); + if (!IoCreateSymbolicLink( &symlink, &name )) drive->symlink = symlink; + } + drive->devnum.DeviceNumber = i; + drive->devnum.PartitionNumber = 0; + } + else + { + drive->devnum.DeviceNumber = 0; + drive->devnum.PartitionNumber = i; + } + break; + } + list_add_tail( &drives_list, &drive->entry ); + *drive_ret = drive; + TRACE( "created device %s\n", debugstr_w(name.Buffer) ); + } + else + { + FIXME( "IoCreateDevice %s got %x\n", debugstr_w(name.Buffer), status ); + RtlFreeUnicodeString( &name ); + } + return status; +} + +/* delete the disk device for a given drive */ +static void delete_disk_device( struct dos_drive *drive ) +{ + TRACE( "deleting device %s\n", debugstr_w(drive->name.Buffer) ); + list_remove( &drive->entry ); + if (drive->dosdev) delete_mount_point( drive->dosdev ); + if (drive->volume) delete_mount_point( drive->volume ); + if (drive->symlink.Buffer) + { + IoDeleteSymbolicLink( &drive->symlink ); + RtlFreeUnicodeString( &drive->symlink ); + } + RtlFreeHeap( GetProcessHeap(), 0, drive->unix_device ); + RtlFreeHeap( GetProcessHeap(), 0, drive->unix_mount ); + RtlFreeHeap( GetProcessHeap(), 0, drive->udi ); + RtlFreeUnicodeString( &drive->name ); + IoDeleteDevice( drive->device ); +} + +/* set or change the drive letter for an existing drive */ +static void set_drive_letter( struct dos_drive *drive, int letter ) +{ + void *id = NULL; + unsigned int id_len = 0; + + if (drive->drive == letter) return; + if (drive->dosdev) delete_mount_point( drive->dosdev ); + if (drive->volume) delete_mount_point( drive->volume ); + drive->drive = letter; + if (letter == -1) return; + if (drive->unix_mount) + { + id = drive->unix_mount; + id_len = strlen( drive->unix_mount ) + 1; + } + drive->dosdev = add_dosdev_mount_point( drive->device, &drive->name, letter, id, id_len ); + drive->volume = add_volume_mount_point( drive->device, &drive->name, letter, id, id_len ); +} + static inline int is_valid_device( struct stat *st ) { #if defined(linux) || defined(__sun__) @@ -108,8 +316,7 @@ static int add_drive( const char *device, DWORD type ) if (stat( device, &dev_st ) == -1 || !is_valid_device( &dev_st )) return -1; - if (!(path = get_dosdevices_path())) return -1; - p = path + strlen(path) - 3; + if (!(path = get_dosdevices_path( &p ))) return -1; memset( in_use, 0, sizeof(in_use) ); @@ -165,72 +372,148 @@ done: return drive; } -static BOOL set_mount_point( struct dos_drive *drive, const char *mount_point ) +static BOOL set_unix_mount_point( struct dos_drive *drive, const char *mount_point ) { char *path, *p; - struct stat path_st, mnt_st; BOOL modified = FALSE; - if (drive->drive == -1) return FALSE; - if (!(path = get_dosdevices_path())) return FALSE; - p = path + strlen(path) - 3; - *p = 'a' + drive->drive; + if (!(path = get_dosdevices_path( &p ))) return FALSE; + p[0] = 'a' + drive->drive; p[2] = 0; - if (mount_point[0]) + if (mount_point && mount_point[0]) { /* try to avoid unlinking if already set correctly */ - if (stat( path, &path_st ) == -1 || stat( mount_point, &mnt_st ) == -1 || - path_st.st_dev != mnt_st.st_dev || path_st.st_ino != mnt_st.st_ino) + if (!drive->unix_mount || strcmp( drive->unix_mount, mount_point )) { unlink( path ); symlink( mount_point, path ); modified = TRUE; } + RtlFreeHeap( GetProcessHeap(), 0, drive->unix_mount ); + drive->unix_mount = strdupA( mount_point ); + if (drive->dosdev) set_mount_point_id( drive->dosdev, mount_point, strlen(mount_point) + 1 ); + if (drive->volume) set_mount_point_id( drive->volume, mount_point, strlen(mount_point) + 1 ); } else { if (unlink( path ) != -1) modified = TRUE; + RtlFreeHeap( GetProcessHeap(), 0, drive->unix_mount ); + drive->unix_mount = NULL; + if (drive->dosdev) set_mount_point_id( drive->dosdev, NULL, 0 ); + if (drive->volume) set_mount_point_id( drive->volume, NULL, 0 ); } HeapFree( GetProcessHeap(), 0, path ); return modified; } -BOOL add_dos_device( const char *udi, const char *device, - const char *mount_point, DWORD type ) +/* create devices for mapped drives */ +static void create_drive_devices(void) { + char *path, *p, *link, *device; struct dos_drive *drive; + unsigned int i; + HKEY drives_key; + DWORD drive_type; + WCHAR driveW[] = {'a',':',0}; - /* first check if it already exists */ - LIST_FOR_EACH_ENTRY( drive, &drives_list, struct dos_drive, entry ) + if (!(path = get_dosdevices_path( &p ))) return; + if (RegOpenKeyW( HKEY_LOCAL_MACHINE, drives_keyW, &drives_key )) drives_key = 0; + + for (i = 0; i < MAX_DOS_DRIVES; i++) { - if (!strcmp( udi, drive->udi )) goto found; + p[0] = 'a' + i; + p[2] = 0; + if (!(link = read_symlink( path ))) continue; + p[2] = ':'; + device = read_symlink( path ); + + drive_type = i < 2 ? DRIVE_REMOVABLE : DRIVE_FIXED; + if (drives_key) + { + WCHAR buffer[32]; + DWORD j, type, size = sizeof(buffer); + + driveW[0] = 'a' + i; + if (!RegQueryValueExW( drives_key, driveW, NULL, &type, (BYTE *)buffer, &size ) && + type == REG_SZ) + { + for (j = 0; j < sizeof(drive_types)/sizeof(drive_types[0]); j++) + if (drive_types[j][0] && !strcmpiW( buffer, drive_types[j] )) + { + drive_type = j; + break; + } + } + } + + if (!create_disk_device( NULL, drive_type, &drive )) + { + drive->unix_mount = link; + drive->unix_device = device; + set_drive_letter( drive, i ); + } + else + { + RtlFreeHeap( GetProcessHeap(), 0, link ); + RtlFreeHeap( GetProcessHeap(), 0, device ); + } } + RegCloseKey( drives_key ); + RtlFreeHeap( GetProcessHeap(), 0, path ); +} + +/* create a new dos drive */ +NTSTATUS add_dos_device( int letter, const char *udi, const char *device, + const char *mount_point, DWORD type ) +{ + struct dos_drive *drive, *next; + + if (letter == -1) /* auto-assign a letter */ + { + letter = add_drive( device, type ); + if (letter == -1) return STATUS_OBJECT_NAME_COLLISION; + } + else /* simply reset the device symlink */ + { + char *path, *p; - if (!(drive = HeapAlloc( GetProcessHeap(), 0, sizeof(*drive) ))) return FALSE; - if (!(drive->udi = HeapAlloc( GetProcessHeap(), 0, strlen(udi)+1 ))) + if (!(path = get_dosdevices_path( &p ))) return STATUS_NO_MEMORY; + *p = 'a' + letter; + unlink( path ); + if (device) symlink( device, path ); + } + + LIST_FOR_EACH_ENTRY_SAFE( drive, next, &drives_list, struct dos_drive, entry ) { - HeapFree( GetProcessHeap(), 0, drive ); - return FALSE; + if (udi && drive->udi && !strcmp( udi, drive->udi )) + { + if (type == drive->type) goto found; + delete_disk_device( drive ); + continue; + } + if (drive->drive == letter) delete_disk_device( drive ); } - strcpy( drive->udi, udi ); - list_add_tail( &drives_list, &drive->entry ); + + if (create_disk_device( udi, type, &drive )) return STATUS_NO_MEMORY; found: - drive->drive = add_drive( device, type ); + RtlFreeHeap( GetProcessHeap(), 0, drive->unix_device ); + drive->unix_device = strdupA( device ); + set_drive_letter( drive, letter ); + set_unix_mount_point( drive, mount_point ); + if (drive->drive != -1) { HKEY hkey; - set_mount_point( drive, mount_point ); - TRACE( "added device %c: udi %s for %s on %s type %u\n", 'a' + drive->drive, wine_dbgstr_a(udi), wine_dbgstr_a(device), wine_dbgstr_a(mount_point), type ); /* hack: force the drive type in the registry */ - if (!RegCreateKeyA( HKEY_LOCAL_MACHINE, "Software\\Wine\\Drives", &hkey )) + if (!RegCreateKeyW( HKEY_LOCAL_MACHINE, drives_keyW, &hkey )) { const WCHAR *type_name = drive_types[type]; WCHAR name[3] = {'a',':',0}; @@ -244,26 +527,32 @@ found: RegCloseKey( hkey ); } - send_notify( drive->drive, DBT_DEVICEARRIVAL ); + if (udi) send_notify( drive->drive, DBT_DEVICEARRIVAL ); } - return TRUE; + return STATUS_SUCCESS; } -BOOL remove_dos_device( const char *udi ) +/* remove an existing dos drive, by letter or udi */ +NTSTATUS remove_dos_device( int letter, const char *udi ) { HKEY hkey; struct dos_drive *drive; LIST_FOR_EACH_ENTRY( drive, &drives_list, struct dos_drive, entry ) { - if (strcmp( udi, drive->udi )) continue; + if (letter != -1 && drive->drive != letter) continue; + if (udi) + { + if (!drive->udi) continue; + if (strcmp( udi, drive->udi )) continue; + } if (drive->drive != -1) { - BOOL modified = set_mount_point( drive, "" ); + BOOL modified = set_unix_mount_point( drive, NULL ); /* clear the registry key too */ - if (!RegOpenKeyA( HKEY_LOCAL_MACHINE, "Software\\Wine\\Drives", &hkey )) + if (!RegOpenKeyW( HKEY_LOCAL_MACHINE, drives_keyW, &hkey )) { WCHAR name[3] = {'a',':',0}; name[0] += drive->drive; @@ -271,13 +560,90 @@ BOOL remove_dos_device( const char *udi ) RegCloseKey( hkey ); } - if (modified) send_notify( drive->drive, DBT_DEVICEREMOVECOMPLETE ); + if (modified && udi) send_notify( drive->drive, DBT_DEVICEREMOVECOMPLETE ); } + delete_disk_device( drive ); + return STATUS_SUCCESS; + } + return STATUS_NO_SUCH_DEVICE; +} - list_remove( &drive->entry ); - HeapFree( GetProcessHeap(), 0, drive->udi ); - HeapFree( GetProcessHeap(), 0, drive ); - return TRUE; +/* query information about an existing dos drive, by letter or udi */ +NTSTATUS query_dos_device( int letter, DWORD *type, const char **device, const char **mount_point ) +{ + struct dos_drive *drive; + + LIST_FOR_EACH_ENTRY( drive, &drives_list, struct dos_drive, entry ) + { + if (drive->drive != letter) continue; + if (type) *type = drive->type; + if (device) *device = drive->unix_device; + if (mount_point) *mount_point = drive->unix_mount; + return STATUS_SUCCESS; } - return FALSE; + return STATUS_NO_SUCH_DEVICE; +} + +/* handler for ioctls on the harddisk device */ +static NTSTATUS WINAPI harddisk_ioctl( DEVICE_OBJECT *device, IRP *irp ) +{ + IO_STACK_LOCATION *irpsp = irp->Tail.Overlay.s.u.CurrentStackLocation; + struct dos_drive *drive = device->DeviceExtension; + + TRACE( "ioctl %x insize %u outsize %u\n", + irpsp->Parameters.DeviceIoControl.IoControlCode, + irpsp->Parameters.DeviceIoControl.InputBufferLength, + irpsp->Parameters.DeviceIoControl.OutputBufferLength ); + + switch(irpsp->Parameters.DeviceIoControl.IoControlCode) + { + case IOCTL_DISK_GET_DRIVE_GEOMETRY: + { + DISK_GEOMETRY info; + DWORD len = min( sizeof(info), irpsp->Parameters.DeviceIoControl.OutputBufferLength ); + + info.Cylinders.QuadPart = 10000; + info.MediaType = (drive->devnum.DeviceType == FILE_DEVICE_DISK) ? FixedMedia : RemovableMedia; + info.TracksPerCylinder = 255; + info.SectorsPerTrack = 63; + info.BytesPerSector = 512; + memcpy( irp->MdlAddress->StartVa, &info, len ); + irp->IoStatus.Information = len; + irp->IoStatus.u.Status = STATUS_SUCCESS; + break; + } + case IOCTL_STORAGE_GET_DEVICE_NUMBER: + { + DWORD len = min( sizeof(drive->devnum), irpsp->Parameters.DeviceIoControl.OutputBufferLength ); + + memcpy( irp->MdlAddress->StartVa, &drive->devnum, len ); + irp->IoStatus.Information = len; + irp->IoStatus.u.Status = STATUS_SUCCESS; + break; + } + case IOCTL_CDROM_READ_TOC: + irp->IoStatus.u.Status = STATUS_INVALID_DEVICE_REQUEST; + break; + default: + FIXME( "unsupported ioctl %x\n", irpsp->Parameters.DeviceIoControl.IoControlCode ); + irp->IoStatus.u.Status = STATUS_NOT_SUPPORTED; + break; + } + return irp->IoStatus.u.Status; +} + +/* driver entry point for the harddisk driver */ +NTSTATUS WINAPI harddisk_driver_entry( DRIVER_OBJECT *driver, UNICODE_STRING *path ) +{ + struct dos_drive *drive; + + harddisk_driver = driver; + driver->MajorFunction[IRP_MJ_DEVICE_CONTROL] = harddisk_ioctl; + + /* create a harddisk0 device that isn't assigned to any drive */ + create_disk_device( "harddisk0 placeholder", DRIVE_FIXED, &drive ); + + create_drive_devices(); + + return STATUS_SUCCESS; } diff --git a/dlls/mountmgr.sys/diskarb.c b/dlls/mountmgr.sys/diskarb.c index 4f18d522f4e..a469ee67ff2 100644 --- a/dlls/mountmgr.sys/diskarb.c +++ b/dlls/mountmgr.sys/diskarb.c @@ -27,13 +27,8 @@ #include #include -#include "windef.h" -#include "winbase.h" -#include "winreg.h" -#include "winuser.h" - -#include "wine/debug.h" #include "mountmgr.h" +#include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(mountmgr); @@ -74,7 +69,7 @@ static void appeared_callback( DADiskRef disk, void *context ) TRACE( "got mount notification for '%s' on '%s'\n", device, mount_point ); - add_dos_device( device, device, mount_point, type ); + add_dos_device( -1, device, device, mount_point, type ); done: CFRelease( dict ); } @@ -103,7 +98,7 @@ static void disappeared_callback( DADiskRef disk, void *context ) TRACE( "got unmount notification for '%s'\n", device ); - remove_dos_device( device ); + remove_dos_device( -1, device ); done: CFRelease( dict ); } diff --git a/dlls/mountmgr.sys/hal.c b/dlls/mountmgr.sys/hal.c index c1d6e708794..e1d3da124f2 100644 --- a/dlls/mountmgr.sys/hal.c +++ b/dlls/mountmgr.sys/hal.c @@ -27,16 +27,12 @@ #include #include -#include "windef.h" -#include "winbase.h" -#include "winreg.h" -#include "winuser.h" +#include "mountmgr.h" #include "excpt.h" #include "wine/library.h" #include "wine/exception.h" #include "wine/debug.h" -#include "mountmgr.h" WINE_DEFAULT_DEBUG_CHANNEL(mountmgr); @@ -139,7 +135,7 @@ static void new_device( LibHalContext *ctx, const char *udi ) if (type && !strcmp( type, "cdrom" )) drive_type = DRIVE_CDROM; else drive_type = DRIVE_REMOVABLE; /* FIXME: default to removable */ - add_dos_device( udi, device, mount_point, drive_type ); + add_dos_device( -1, udi, device, mount_point, drive_type ); /* add property watch for mount point */ p_libhal_device_add_property_watch( ctx, udi, &error ); @@ -159,7 +155,7 @@ static void removed_device( LibHalContext *ctx, const char *udi ) TRACE( "removed %s\n", wine_dbgstr_a(udi) ); - if (remove_dos_device( udi )) + if (!remove_dos_device( -1, udi )) { p_dbus_error_init( &error ); p_libhal_device_remove_property_watch( ctx, udi, &error ); diff --git a/dlls/mountmgr.sys/mountmgr.c b/dlls/mountmgr.sys/mountmgr.c dissimilarity index 60% index e24394a175b..3c1aa88668b 100644 --- a/dlls/mountmgr.sys/mountmgr.c +++ b/dlls/mountmgr.sys/mountmgr.c @@ -1,510 +1,404 @@ -/* - * Mount manager service implementation - * - * Copyright 2008 Alexandre Julliard - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#include -#include - -#define NONAMELESSUNION -#define NONAMELESSSTRUCT - -#include "ntstatus.h" -#define WIN32_NO_STATUS -#include "windef.h" -#include "winbase.h" -#include "winternl.h" -#include "winioctl.h" -#include "winreg.h" -#include "ntddstor.h" -#include "ntddcdrm.h" -#include "ddk/wdm.h" -#include "ddk/mountmgr.h" -#include "wine/library.h" -#include "wine/unicode.h" -#include "wine/debug.h" -#include "mountmgr.h" - -WINE_DEFAULT_DEBUG_CHANNEL(mountmgr); - -#define MAX_DOS_DRIVES 26 -#define MAX_MOUNT_POINTS (2 * MAX_DOS_DRIVES) - -/* extra info for disk devices, stored in DeviceExtension */ -struct disk_device_info -{ - UNICODE_STRING name; /* device name */ - STORAGE_DEVICE_NUMBER devnum; /* device number info */ -}; - -struct mount_point -{ - DEVICE_OBJECT *device; - UNICODE_STRING link; /* DOS device symlink */ - void *id; /* device unique id */ - unsigned int id_len; -}; - -static struct mount_point mount_points[MAX_MOUNT_POINTS]; -static HKEY mount_key; - -static inline UNICODE_STRING *get_device_name( DEVICE_OBJECT *dev ) -{ - return &((struct disk_device_info *)dev->DeviceExtension)->name; -} - -/* read a Unix symlink; returned buffer must be freed by caller */ -static char *read_symlink( const char *path ) -{ - char *buffer; - int ret, size = 128; - - for (;;) - { - if (!(buffer = RtlAllocateHeap( GetProcessHeap(), 0, size ))) - { - SetLastError( ERROR_NOT_ENOUGH_MEMORY ); - return 0; - } - ret = readlink( path, buffer, size ); - if (ret == -1) - { - RtlFreeHeap( GetProcessHeap(), 0, buffer ); - return 0; - } - if (ret != size) - { - buffer[ret] = 0; - return buffer; - } - RtlFreeHeap( GetProcessHeap(), 0, buffer ); - size *= 2; - } -} - -static NTSTATUS create_disk_device( DRIVER_OBJECT *driver, DWORD type, DEVICE_OBJECT **dev_obj ) -{ - static const WCHAR harddiskW[] = {'\\','D','e','v','i','c','e', - '\\','H','a','r','d','d','i','s','k','V','o','l','u','m','e','%','u',0}; - static const WCHAR cdromW[] = {'\\','D','e','v','i','c','e','\\','C','d','R','o','m','%','u',0}; - static const WCHAR floppyW[] = {'\\','D','e','v','i','c','e','\\','F','l','o','p','p','y','%','u',0}; - - UINT i, first = 0; - NTSTATUS status = 0; - const WCHAR *format; - UNICODE_STRING name; - struct disk_device_info *info; - - switch(type) - { - case DRIVE_REMOVABLE: - format = floppyW; - break; - case DRIVE_CDROM: - format = cdromW; - break; - case DRIVE_FIXED: - default: /* FIXME */ - format = harddiskW; - first = 1; /* harddisk volumes start counting from 1 */ - break; - } - - name.MaximumLength = (strlenW(format) + 10) * sizeof(WCHAR); - name.Buffer = RtlAllocateHeap( GetProcessHeap(), 0, name.MaximumLength ); - for (i = first; i < 32; i++) - { - sprintfW( name.Buffer, format, i ); - name.Length = strlenW(name.Buffer) * sizeof(WCHAR); - status = IoCreateDevice( driver, sizeof(*info), &name, 0, 0, FALSE, dev_obj ); - if (status != STATUS_OBJECT_NAME_COLLISION) break; - } - if (!status) - { - info = (*dev_obj)->DeviceExtension; - info->name = name; - switch(type) - { - case DRIVE_REMOVABLE: - info->devnum.DeviceType = FILE_DEVICE_DISK; - info->devnum.DeviceNumber = i; - info->devnum.PartitionNumber = ~0u; - break; - case DRIVE_CDROM: - info->devnum.DeviceType = FILE_DEVICE_CD_ROM; - info->devnum.DeviceNumber = i; - info->devnum.PartitionNumber = ~0u; - break; - case DRIVE_FIXED: - default: /* FIXME */ - info->devnum.DeviceType = FILE_DEVICE_DISK; - info->devnum.DeviceNumber = 0; - info->devnum.PartitionNumber = i; - break; - } - } - else - { - FIXME( "IoCreateDevice %s got %x\n", debugstr_w(name.Buffer), status ); - RtlFreeUnicodeString( &name ); - } - return status; -} - - -static NTSTATUS add_mount_point( DRIVER_OBJECT *driver, DWORD type, int drive, - const void *id, unsigned int id_len ) -{ - static const WCHAR driveW[] = {'\\','D','o','s','D','e','v','i','c','e','s','\\','%','c',':',0}; - static const WCHAR volumeW[] = {'\\','?','?','\\','V','o','l','u','m','e','{', - '%','0','8','x','-','%','0','4','x','-','%','0','4','x','-', - '%','0','2','x','%','0','2','x','-','%','0','2','x','%','0','2','x', - '%','0','2','x','%','0','2','x','%','0','2','x','%','0','2','x','}',0}; - WCHAR *drive_link, *volume_link; - NTSTATUS status; - GUID guid; - UINT i; - struct mount_point *mount_drive = NULL, *mount_volume = NULL; - - /* find two free mount points */ - - for (i = 0; i < MAX_MOUNT_POINTS; i++) - { - if (mount_points[i].device) continue; - if (!mount_drive) - { - mount_drive = &mount_points[i]; - continue; - } - mount_volume = &mount_points[i]; - break; - } - if (!mount_volume) return STATUS_NO_MEMORY; - - /* create the volume */ - - memset( &guid, 0, sizeof(guid) ); /* FIXME */ - guid.Data4[7] = 'A' + drive; - - drive_link = RtlAllocateHeap( GetProcessHeap(), 0, sizeof(driveW) ); - volume_link = RtlAllocateHeap( GetProcessHeap(), 0, sizeof(volumeW) ); - sprintfW( drive_link, driveW, 'A' + drive ); - sprintfW( volume_link, volumeW, guid.Data1, guid.Data2, guid.Data3, - guid.Data4[0], guid.Data4[1], guid.Data4[2], guid.Data4[3], - guid.Data4[4], guid.Data4[5], guid.Data4[6], guid.Data4[7]); - - RtlInitUnicodeString( &mount_drive->link, drive_link ); - RtlInitUnicodeString( &mount_volume->link, volume_link ); - status = create_disk_device( driver, type, &mount_drive->device ); - if (status) - { - RtlFreeUnicodeString( &mount_drive->link ); - RtlFreeUnicodeString( &mount_volume->link ); - return status; - } - - mount_volume->device = mount_drive->device; /* FIXME: incr ref count */ - mount_drive->id = RtlAllocateHeap( GetProcessHeap(), 0, id_len ); - mount_drive->id_len = id_len; - memcpy( mount_drive->id, id, id_len ); - mount_volume->id = RtlAllocateHeap( GetProcessHeap(), 0, id_len ); - mount_volume->id_len = id_len; - memcpy( mount_volume->id, id, id_len ); - - IoCreateSymbolicLink( &mount_drive->link, get_device_name(mount_drive->device) ); - IoCreateSymbolicLink( &mount_volume->link, get_device_name(mount_volume->device) ); - - TRACE( "created device %s symlinks %s %s\n", debugstr_w(get_device_name(mount_drive->device)->Buffer), - debugstr_w(mount_drive->link.Buffer), debugstr_w(mount_volume->link.Buffer) ); - - RegSetValueExW( mount_key, mount_drive->link.Buffer, 0, REG_BINARY, - mount_drive->id, mount_drive->id_len ); - RegSetValueExW( mount_key, mount_volume->link.Buffer, 0, REG_BINARY, - mount_volume->id, mount_volume->id_len ); - - return STATUS_SUCCESS; -} - -/* check if a given mount point matches the requested specs */ -static BOOL matching_mount_point( const struct mount_point *mount, const MOUNTMGR_MOUNT_POINT *spec ) -{ - if (spec->SymbolicLinkNameOffset) - { - const WCHAR *name = (const WCHAR *)((const char *)spec + spec->SymbolicLinkNameOffset); - if (spec->SymbolicLinkNameLength != mount->link.Length) return FALSE; - if (memicmpW( name, mount->link.Buffer, mount->link.Length/sizeof(WCHAR))) - return FALSE; - } - if (spec->DeviceNameOffset) - { - const WCHAR *name = (const WCHAR *)((const char *)spec + spec->DeviceNameOffset); - const UNICODE_STRING *dev_name = get_device_name( mount->device ); - if (spec->DeviceNameLength != dev_name->Length) return FALSE; - if (memicmpW( name, dev_name->Buffer, dev_name->Length/sizeof(WCHAR))) - return FALSE; - } - if (spec->UniqueIdOffset) - { - const void *id = ((const char *)spec + spec->UniqueIdOffset); - if (spec->UniqueIdLength != mount->id_len) return FALSE; - if (memcmp( id, mount->id, mount->id_len )) return FALSE; - } - return TRUE; -} - -/* implementation of IOCTL_MOUNTMGR_QUERY_POINTS */ -static NTSTATUS query_mount_points( const void *in_buff, SIZE_T insize, - void *out_buff, SIZE_T outsize, IO_STATUS_BLOCK *iosb ) -{ - UINT i, j, pos, size; - const MOUNTMGR_MOUNT_POINT *input = in_buff; - MOUNTMGR_MOUNT_POINTS *info = out_buff; - UNICODE_STRING *dev_name; - - /* sanity checks */ - if (input->SymbolicLinkNameOffset + input->SymbolicLinkNameLength > insize || - input->UniqueIdOffset + input->UniqueIdLength > insize || - input->DeviceNameOffset + input->DeviceNameLength > insize || - input->SymbolicLinkNameOffset + input->SymbolicLinkNameLength < input->SymbolicLinkNameOffset || - input->UniqueIdOffset + input->UniqueIdLength < input->UniqueIdOffset || - input->DeviceNameOffset + input->DeviceNameLength < input->DeviceNameOffset) - return STATUS_INVALID_PARAMETER; - - for (i = j = size = 0; i < MAX_MOUNT_POINTS; i++) - { - if (!mount_points[i].device) continue; - if (!matching_mount_point( &mount_points[i], input )) continue; - size += get_device_name(mount_points[i].device)->Length; - size += mount_points[i].link.Length; - size += strlen(mount_points[i].id) + 1; - size = (size + sizeof(WCHAR) - 1) & ~(sizeof(WCHAR) - 1); - j++; - } - pos = FIELD_OFFSET( MOUNTMGR_MOUNT_POINTS, MountPoints[j] ); - size += pos; - - if (size > outsize) - { - if (size >= sizeof(info->Size)) info->Size = size; - iosb->Information = sizeof(info->Size); - return STATUS_MORE_ENTRIES; - } - - info->NumberOfMountPoints = j; - for (i = j = 0; i < MAX_MOUNT_POINTS; i++) - { - if (!mount_points[i].device) continue; - if (!matching_mount_point( &mount_points[i], input )) continue; - - dev_name = get_device_name( mount_points[i].device ); - info->MountPoints[j].DeviceNameOffset = pos; - info->MountPoints[j].DeviceNameLength = dev_name->Length; - memcpy( (char *)out_buff + pos, dev_name->Buffer, dev_name->Length ); - pos += dev_name->Length; - - info->MountPoints[j].SymbolicLinkNameOffset = pos; - info->MountPoints[j].SymbolicLinkNameLength = mount_points[i].link.Length; - memcpy( (char *)out_buff + pos, mount_points[i].link.Buffer, mount_points[i].link.Length ); - pos += mount_points[i].link.Length; - - info->MountPoints[j].UniqueIdOffset = pos; - info->MountPoints[j].UniqueIdLength = strlen(mount_points[i].id) + 1; - memcpy( (char *)out_buff + pos, mount_points[i].id, strlen(mount_points[i].id) + 1 ); - pos += strlen(mount_points[i].id) + 1; - pos = (pos + sizeof(WCHAR) - 1) & ~(sizeof(WCHAR) - 1); - j++; - } - info->Size = pos; - iosb->Information = pos; - return STATUS_SUCCESS; -} - -/* handler for ioctls on the mount manager device */ -static NTSTATUS WINAPI mountmgr_ioctl( DEVICE_OBJECT *device, IRP *irp ) -{ - IO_STACK_LOCATION *irpsp = irp->Tail.Overlay.s.u.CurrentStackLocation; - - TRACE( "ioctl %x insize %u outsize %u\n", - irpsp->Parameters.DeviceIoControl.IoControlCode, - irpsp->Parameters.DeviceIoControl.InputBufferLength, - irpsp->Parameters.DeviceIoControl.OutputBufferLength ); - - switch(irpsp->Parameters.DeviceIoControl.IoControlCode) - { - case IOCTL_MOUNTMGR_QUERY_POINTS: - if (irpsp->Parameters.DeviceIoControl.InputBufferLength < sizeof(MOUNTMGR_MOUNT_POINT)) - return STATUS_INVALID_PARAMETER; - irp->IoStatus.u.Status = query_mount_points( irpsp->Parameters.DeviceIoControl.Type3InputBuffer, - irpsp->Parameters.DeviceIoControl.InputBufferLength, - irp->MdlAddress->StartVa, - irpsp->Parameters.DeviceIoControl.OutputBufferLength, - &irp->IoStatus ); - break; - default: - FIXME( "ioctl %x not supported\n", irpsp->Parameters.DeviceIoControl.IoControlCode ); - irp->IoStatus.u.Status = STATUS_NOT_SUPPORTED; - break; - } - return irp->IoStatus.u.Status; -} - -/* handler for ioctls on the harddisk device */ -static NTSTATUS WINAPI harddisk_ioctl( DEVICE_OBJECT *device, IRP *irp ) -{ - IO_STACK_LOCATION *irpsp = irp->Tail.Overlay.s.u.CurrentStackLocation; - struct disk_device_info *disk_info = device->DeviceExtension; - - TRACE( "ioctl %x insize %u outsize %u\n", - irpsp->Parameters.DeviceIoControl.IoControlCode, - irpsp->Parameters.DeviceIoControl.InputBufferLength, - irpsp->Parameters.DeviceIoControl.OutputBufferLength ); - - switch(irpsp->Parameters.DeviceIoControl.IoControlCode) - { - case IOCTL_DISK_GET_DRIVE_GEOMETRY: - { - DISK_GEOMETRY info; - DWORD len = min( sizeof(info), irpsp->Parameters.DeviceIoControl.OutputBufferLength ); - - info.Cylinders.QuadPart = 10000; - info.MediaType = (disk_info->devnum.DeviceType == FILE_DEVICE_DISK) ? FixedMedia : RemovableMedia; - info.TracksPerCylinder = 255; - info.SectorsPerTrack = 63; - info.BytesPerSector = 512; - memcpy( irp->MdlAddress->StartVa, &info, len ); - irp->IoStatus.Information = len; - irp->IoStatus.u.Status = STATUS_SUCCESS; - break; - } - case IOCTL_STORAGE_GET_DEVICE_NUMBER: - { - DWORD len = min( sizeof(disk_info->devnum), irpsp->Parameters.DeviceIoControl.OutputBufferLength ); - - memcpy( irp->MdlAddress->StartVa, &disk_info->devnum, len ); - irp->IoStatus.Information = len; - irp->IoStatus.u.Status = STATUS_SUCCESS; - break; - } - case IOCTL_CDROM_READ_TOC: - irp->IoStatus.u.Status = STATUS_INVALID_DEVICE_REQUEST; - break; - default: - FIXME( "unsupported ioctl %x\n", irpsp->Parameters.DeviceIoControl.IoControlCode ); - irp->IoStatus.u.Status = STATUS_NOT_SUPPORTED; - break; - } - return irp->IoStatus.u.Status; -} - -/* create mount points for mapped drives */ -static void create_drive_mount_points( DRIVER_OBJECT *driver ) -{ - const char *config_dir = wine_get_config_dir(); - char *buffer, *p, *link; - unsigned int i; - - if ((buffer = RtlAllocateHeap( GetProcessHeap(), 0, - strlen(config_dir) + sizeof("/dosdevices/a:") ))) - { - strcpy( buffer, config_dir ); - strcat( buffer, "/dosdevices/a:" ); - p = buffer + strlen(buffer) - 2; - - for (i = 0; i < MAX_DOS_DRIVES; i++) - { - *p = 'a' + i; - if (!(link = read_symlink( buffer ))) continue; - add_mount_point( driver, DRIVE_FIXED, i, link, strlen(link) + 1 ); - RtlFreeHeap( GetProcessHeap(), 0, link ); - } - RtlFreeHeap( GetProcessHeap(), 0, buffer ); - } -} - -/* driver entry point for the harddisk driver */ -static NTSTATUS WINAPI harddisk_driver_entry( DRIVER_OBJECT *driver, UNICODE_STRING *path ) -{ - static const WCHAR mounted_devicesW[] = {'S','y','s','t','e','m','\\', - 'M','o','u','n','t','e','d','D','e','v','i','c','e','s',0}; - static const WCHAR harddisk0W[] = {'\\','D','e','v','i','c','e', - '\\','H','a','r','d','d','i','s','k','0',0}; - static const WCHAR physdrive0W[] = {'\\','?','?','\\','P','h','y','s','i','c','a','l','D','r','i','v','e','0',0}; - - UNICODE_STRING nameW, linkW; - DEVICE_OBJECT *device; - NTSTATUS status; - struct disk_device_info *info; - - driver->MajorFunction[IRP_MJ_DEVICE_CONTROL] = harddisk_ioctl; - - RegCreateKeyExW( HKEY_LOCAL_MACHINE, mounted_devicesW, 0, NULL, - REG_OPTION_VOLATILE, KEY_ALL_ACCESS, NULL, &mount_key, NULL ); - - RtlInitUnicodeString( &nameW, harddisk0W ); - RtlInitUnicodeString( &linkW, physdrive0W ); - if (!(status = IoCreateDevice( driver, sizeof(*info), &nameW, 0, 0, FALSE, &device ))) - status = IoCreateSymbolicLink( &linkW, &nameW ); - if (status) - { - FIXME( "failed to create device error %x\n", status ); - return status; - } - info = device->DeviceExtension; - info->name = nameW; - info->devnum.DeviceType = FILE_DEVICE_DISK; - info->devnum.DeviceNumber = 0; - info->devnum.PartitionNumber = 0; - - create_drive_mount_points( driver ); - - return status; -} - -/* main entry point for the mount point manager driver */ -NTSTATUS WINAPI DriverEntry( DRIVER_OBJECT *driver, UNICODE_STRING *path ) -{ - static const WCHAR device_mountmgrW[] = {'\\','D','e','v','i','c','e','\\','M','o','u','n','t','P','o','i','n','t','M','a','n','a','g','e','r',0}; - static const WCHAR link_mountmgrW[] = {'\\','?','?','\\','M','o','u','n','t','P','o','i','n','t','M','a','n','a','g','e','r',0}; - static const WCHAR harddiskW[] = {'\\','D','r','i','v','e','r','\\','H','a','r','d','d','i','s','k',0}; - - UNICODE_STRING nameW, linkW; - DEVICE_OBJECT *device; - NTSTATUS status; - - TRACE( "%s\n", debugstr_w(path->Buffer) ); - - driver->MajorFunction[IRP_MJ_DEVICE_CONTROL] = mountmgr_ioctl; - - RtlInitUnicodeString( &nameW, device_mountmgrW ); - RtlInitUnicodeString( &linkW, link_mountmgrW ); - if (!(status = IoCreateDevice( driver, 0, &nameW, 0, 0, FALSE, &device ))) - status = IoCreateSymbolicLink( &linkW, &nameW ); - if (status) - { - FIXME( "failed to create device error %x\n", status ); - return status; - } - - initialize_hal(); - initialize_diskarbitration(); - - RtlInitUnicodeString( &nameW, harddiskW ); - status = IoCreateDriver( &nameW, harddisk_driver_entry ); - - return status; -} +/* + * Mount manager service implementation + * + * Copyright 2008 Alexandre Julliard + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include +#include + +#define NONAMELESSUNION +#define NONAMELESSSTRUCT + +#include "mountmgr.h" +#include "winreg.h" +#include "wine/library.h" +#include "wine/list.h" +#include "wine/unicode.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(mountmgr); + +#define MIN_ID_LEN 4 + +struct mount_point +{ + struct list entry; /* entry in mount points list */ + DEVICE_OBJECT *device; /* disk device */ + UNICODE_STRING name; /* device name */ + UNICODE_STRING link; /* DOS device symlink */ + void *id; /* device unique id */ + unsigned int id_len; +}; + +static struct list mount_points_list = LIST_INIT(mount_points_list); +static HKEY mount_key; + +void set_mount_point_id( struct mount_point *mount, const void *id, unsigned int id_len ) +{ + RtlFreeHeap( GetProcessHeap(), 0, mount->id ); + mount->id_len = max( MIN_ID_LEN, id_len ); + if ((mount->id = RtlAllocateHeap( GetProcessHeap(), HEAP_ZERO_MEMORY, mount->id_len ))) + { + memcpy( mount->id, id, id_len ); + RegSetValueExW( mount_key, mount->link.Buffer, 0, REG_BINARY, mount->id, mount->id_len ); + } + else mount->id_len = 0; +} + +static struct mount_point *add_mount_point( DEVICE_OBJECT *device, UNICODE_STRING *device_name, + const WCHAR *link, const void *id, unsigned int id_len ) +{ + struct mount_point *mount; + WCHAR *str; + UINT len = (strlenW(link) + 1) * sizeof(WCHAR) + device_name->Length + sizeof(WCHAR); + + if (!(mount = RtlAllocateHeap( GetProcessHeap(), 0, sizeof(*mount) + len ))) return NULL; + + str = (WCHAR *)(mount + 1); + strcpyW( str, link ); + RtlInitUnicodeString( &mount->link, str ); + str += strlenW(str) + 1; + memcpy( str, device_name->Buffer, device_name->Length ); + str[device_name->Length / sizeof(WCHAR)] = 0; + mount->name.Buffer = str; + mount->name.Length = device_name->Length; + mount->name.MaximumLength = device_name->Length + sizeof(WCHAR); + mount->device = device; + mount->id = NULL; + list_add_tail( &mount_points_list, &mount->entry ); + + IoCreateSymbolicLink( &mount->link, device_name ); + set_mount_point_id( mount, id, id_len ); + + TRACE( "created %s id %s for %s\n", debugstr_w(mount->link.Buffer), + debugstr_a(mount->id), debugstr_w(mount->name.Buffer) ); + return mount; +} + +/* create the DosDevices mount point symlink for a new device */ +struct mount_point *add_dosdev_mount_point( DEVICE_OBJECT *device, UNICODE_STRING *device_name, + int drive, const void *id, unsigned int id_len ) +{ + static const WCHAR driveW[] = {'\\','D','o','s','D','e','v','i','c','e','s','\\','%','c',':',0}; + WCHAR link[sizeof(driveW)]; + + sprintfW( link, driveW, 'A' + drive ); + return add_mount_point( device, device_name, link, id, id_len ); +} + +/* create the Volume mount point symlink for a new device */ +struct mount_point *add_volume_mount_point( DEVICE_OBJECT *device, UNICODE_STRING *device_name, + int drive, const void *id, unsigned int id_len ) +{ + static const WCHAR volumeW[] = {'\\','?','?','\\','V','o','l','u','m','e','{', + '%','0','8','x','-','%','0','4','x','-','%','0','4','x','-', + '%','0','2','x','%','0','2','x','-','%','0','2','x','%','0','2','x', + '%','0','2','x','%','0','2','x','%','0','2','x','%','0','2','x','}',0}; + WCHAR link[sizeof(volumeW)]; + GUID guid; + + memset( &guid, 0, sizeof(guid) ); /* FIXME */ + guid.Data4[7] = 'A' + drive; + sprintfW( link, volumeW, guid.Data1, guid.Data2, guid.Data3, + guid.Data4[0], guid.Data4[1], guid.Data4[2], guid.Data4[3], + guid.Data4[4], guid.Data4[5], guid.Data4[6], guid.Data4[7]); + return add_mount_point( device, device_name, link, id, id_len ); +} + +/* delete the mount point symlinks when a device goes away */ +void delete_mount_point( struct mount_point *mount ) +{ + TRACE( "deleting %s\n", debugstr_w(mount->link.Buffer) ); + list_remove( &mount->entry ); + RegDeleteValueW( mount_key, mount->link.Buffer ); + IoDeleteSymbolicLink( &mount->link ); + RtlFreeHeap( GetProcessHeap(), 0, mount->id ); + RtlFreeHeap( GetProcessHeap(), 0, mount ); +} + +/* check if a given mount point matches the requested specs */ +static BOOL matching_mount_point( const struct mount_point *mount, const MOUNTMGR_MOUNT_POINT *spec ) +{ + if (spec->SymbolicLinkNameOffset) + { + const WCHAR *name = (const WCHAR *)((const char *)spec + spec->SymbolicLinkNameOffset); + if (spec->SymbolicLinkNameLength != mount->link.Length) return FALSE; + if (memicmpW( name, mount->link.Buffer, mount->link.Length/sizeof(WCHAR))) + return FALSE; + } + if (spec->DeviceNameOffset) + { + const WCHAR *name = (const WCHAR *)((const char *)spec + spec->DeviceNameOffset); + if (spec->DeviceNameLength != mount->name.Length) return FALSE; + if (memicmpW( name, mount->name.Buffer, mount->name.Length/sizeof(WCHAR))) + return FALSE; + } + if (spec->UniqueIdOffset) + { + const void *id = ((const char *)spec + spec->UniqueIdOffset); + if (spec->UniqueIdLength != mount->id_len) return FALSE; + if (memcmp( id, mount->id, mount->id_len )) return FALSE; + } + return TRUE; +} + +/* implementation of IOCTL_MOUNTMGR_QUERY_POINTS */ +static NTSTATUS query_mount_points( const void *in_buff, SIZE_T insize, + void *out_buff, SIZE_T outsize, IO_STATUS_BLOCK *iosb ) +{ + UINT count, pos, size; + const MOUNTMGR_MOUNT_POINT *input = in_buff; + MOUNTMGR_MOUNT_POINTS *info = out_buff; + struct mount_point *mount; + + /* sanity checks */ + if (input->SymbolicLinkNameOffset + input->SymbolicLinkNameLength > insize || + input->UniqueIdOffset + input->UniqueIdLength > insize || + input->DeviceNameOffset + input->DeviceNameLength > insize || + input->SymbolicLinkNameOffset + input->SymbolicLinkNameLength < input->SymbolicLinkNameOffset || + input->UniqueIdOffset + input->UniqueIdLength < input->UniqueIdOffset || + input->DeviceNameOffset + input->DeviceNameLength < input->DeviceNameOffset) + return STATUS_INVALID_PARAMETER; + + count = size = 0; + LIST_FOR_EACH_ENTRY( mount, &mount_points_list, struct mount_point, entry ) + { + if (!matching_mount_point( mount, input )) continue; + size += mount->name.Length; + size += mount->link.Length; + size += mount->id_len; + size = (size + sizeof(WCHAR) - 1) & ~(sizeof(WCHAR) - 1); + count++; + } + pos = FIELD_OFFSET( MOUNTMGR_MOUNT_POINTS, MountPoints[count] ); + size += pos; + + if (size > outsize) + { + if (size >= sizeof(info->Size)) info->Size = size; + iosb->Information = sizeof(info->Size); + return STATUS_MORE_ENTRIES; + } + + info->NumberOfMountPoints = count; + count = 0; + LIST_FOR_EACH_ENTRY( mount, &mount_points_list, struct mount_point, entry ) + { + if (!matching_mount_point( mount, input )) continue; + + info->MountPoints[count].DeviceNameOffset = pos; + info->MountPoints[count].DeviceNameLength = mount->name.Length; + memcpy( (char *)out_buff + pos, mount->name.Buffer, mount->name.Length ); + pos += mount->name.Length; + + info->MountPoints[count].SymbolicLinkNameOffset = pos; + info->MountPoints[count].SymbolicLinkNameLength = mount->link.Length; + memcpy( (char *)out_buff + pos, mount->link.Buffer, mount->link.Length ); + pos += mount->link.Length; + + info->MountPoints[count].UniqueIdOffset = pos; + info->MountPoints[count].UniqueIdLength = mount->id_len; + memcpy( (char *)out_buff + pos, mount->id, mount->id_len ); + pos += mount->id_len; + pos = (pos + sizeof(WCHAR) - 1) & ~(sizeof(WCHAR) - 1); + count++; + } + info->Size = pos; + iosb->Information = pos; + return STATUS_SUCCESS; +} + +/* implementation of IOCTL_MOUNTMGR_DEFINE_UNIX_DRIVE */ +static NTSTATUS define_unix_drive( const void *in_buff, SIZE_T insize ) +{ + const struct mountmgr_unix_drive *input = in_buff; + const char *mount_point = NULL, *device = NULL; + unsigned int i; + WCHAR letter = tolowerW( input->letter ); + + if (letter < 'a' || letter > 'z') return STATUS_INVALID_PARAMETER; + if (input->type > DRIVE_RAMDISK) return STATUS_INVALID_PARAMETER; + if (input->mount_point_offset > insize || input->device_offset > insize) + return STATUS_INVALID_PARAMETER; + + /* make sure string are null-terminated */ + if (input->mount_point_offset) + { + mount_point = (const char *)in_buff + input->mount_point_offset; + for (i = input->mount_point_offset; i < insize; i++) + if (!*((const char *)in_buff + i)) break; + if (i >= insize) return STATUS_INVALID_PARAMETER; + } + if (input->device_offset) + { + device = (const char *)in_buff + input->device_offset; + for (i = input->device_offset; i < insize; i++) + if (!*((const char *)in_buff + i)) break; + if (i >= insize) return STATUS_INVALID_PARAMETER; + } + + if (input->type != DRIVE_NO_ROOT_DIR) + { + TRACE( "defining %c: dev %s mount %s type %u\n", + letter, debugstr_a(device), debugstr_a(mount_point), input->type ); + return add_dos_device( letter - 'a', NULL, device, mount_point, input->type ); + } + else + { + TRACE( "removing %c:\n", letter ); + return remove_dos_device( letter - 'a', NULL ); + } +} + +/* implementation of IOCTL_MOUNTMGR_QUERY_UNIX_DRIVE */ +static NTSTATUS query_unix_drive( const void *in_buff, SIZE_T insize, + void *out_buff, SIZE_T outsize, IO_STATUS_BLOCK *iosb ) +{ + const struct mountmgr_unix_drive *input = in_buff; + struct mountmgr_unix_drive *output = out_buff; + const char *device, *mount_point; + int letter = tolowerW( input->letter ); + NTSTATUS status; + DWORD size, type; + char *ptr; + + if (letter < 'a' || letter > 'z') return STATUS_INVALID_PARAMETER; + + if ((status = query_dos_device( letter - 'a', &type, &device, &mount_point ))) return status; + + size = sizeof(*output); + if (device) size += strlen(device) + 1; + if (mount_point) size += strlen(mount_point) + 1; + + if (size > outsize) + { + if (size >= FIELD_OFFSET( struct mountmgr_unix_drive, size ) + sizeof(output->size)) + output->size = size; + iosb->Information = FIELD_OFFSET( struct mountmgr_unix_drive, size ) + sizeof(output->size); + return STATUS_MORE_ENTRIES; + } + output->size = size; + output->letter = letter; + output->type = type; + ptr = (char *)(output + 1); + + if (mount_point) + { + output->mount_point_offset = ptr - (char *)output; + strcpy( ptr, mount_point ); + ptr += strlen(ptr) + 1; + } + else output->mount_point_offset = 0; + + if (device) + { + output->device_offset = ptr - (char *)output; + strcpy( ptr, device ); + ptr += strlen(ptr) + 1; + } + else output->device_offset = 0; + + TRACE( "returning %c: dev %s mount %s type %u\n", + letter, debugstr_a(device), debugstr_a(mount_point), type ); + + iosb->Information = ptr - (char *)output; + return STATUS_SUCCESS; +} + +/* handler for ioctls on the mount manager device */ +static NTSTATUS WINAPI mountmgr_ioctl( DEVICE_OBJECT *device, IRP *irp ) +{ + IO_STACK_LOCATION *irpsp = irp->Tail.Overlay.s.u.CurrentStackLocation; + + TRACE( "ioctl %x insize %u outsize %u\n", + irpsp->Parameters.DeviceIoControl.IoControlCode, + irpsp->Parameters.DeviceIoControl.InputBufferLength, + irpsp->Parameters.DeviceIoControl.OutputBufferLength ); + + switch(irpsp->Parameters.DeviceIoControl.IoControlCode) + { + case IOCTL_MOUNTMGR_QUERY_POINTS: + if (irpsp->Parameters.DeviceIoControl.InputBufferLength < sizeof(MOUNTMGR_MOUNT_POINT)) + return STATUS_INVALID_PARAMETER; + irp->IoStatus.u.Status = query_mount_points( irpsp->Parameters.DeviceIoControl.Type3InputBuffer, + irpsp->Parameters.DeviceIoControl.InputBufferLength, + irp->MdlAddress->StartVa, + irpsp->Parameters.DeviceIoControl.OutputBufferLength, + &irp->IoStatus ); + break; + case IOCTL_MOUNTMGR_DEFINE_UNIX_DRIVE: + if (irpsp->Parameters.DeviceIoControl.InputBufferLength < sizeof(struct mountmgr_unix_drive)) + return STATUS_INVALID_PARAMETER; + irp->IoStatus.Information = 0; + irp->IoStatus.u.Status = define_unix_drive( irpsp->Parameters.DeviceIoControl.Type3InputBuffer, + irpsp->Parameters.DeviceIoControl.InputBufferLength ); + break; + case IOCTL_MOUNTMGR_QUERY_UNIX_DRIVE: + if (irpsp->Parameters.DeviceIoControl.InputBufferLength < sizeof(struct mountmgr_unix_drive)) + return STATUS_INVALID_PARAMETER; + irp->IoStatus.u.Status = query_unix_drive( irpsp->Parameters.DeviceIoControl.Type3InputBuffer, + irpsp->Parameters.DeviceIoControl.InputBufferLength, + irp->MdlAddress->StartVa, + irpsp->Parameters.DeviceIoControl.OutputBufferLength, + &irp->IoStatus ); + break; + default: + FIXME( "ioctl %x not supported\n", irpsp->Parameters.DeviceIoControl.IoControlCode ); + irp->IoStatus.u.Status = STATUS_NOT_SUPPORTED; + break; + } + return irp->IoStatus.u.Status; +} + +/* main entry point for the mount point manager driver */ +NTSTATUS WINAPI DriverEntry( DRIVER_OBJECT *driver, UNICODE_STRING *path ) +{ + static const WCHAR mounted_devicesW[] = {'S','y','s','t','e','m','\\','M','o','u','n','t','e','d','D','e','v','i','c','e','s',0}; + static const WCHAR device_mountmgrW[] = {'\\','D','e','v','i','c','e','\\','M','o','u','n','t','P','o','i','n','t','M','a','n','a','g','e','r',0}; + static const WCHAR link_mountmgrW[] = {'\\','?','?','\\','M','o','u','n','t','P','o','i','n','t','M','a','n','a','g','e','r',0}; + static const WCHAR harddiskW[] = {'\\','D','r','i','v','e','r','\\','H','a','r','d','d','i','s','k',0}; + + UNICODE_STRING nameW, linkW; + DEVICE_OBJECT *device; + NTSTATUS status; + + TRACE( "%s\n", debugstr_w(path->Buffer) ); + + driver->MajorFunction[IRP_MJ_DEVICE_CONTROL] = mountmgr_ioctl; + + RtlInitUnicodeString( &nameW, device_mountmgrW ); + RtlInitUnicodeString( &linkW, link_mountmgrW ); + if (!(status = IoCreateDevice( driver, 0, &nameW, 0, 0, FALSE, &device ))) + status = IoCreateSymbolicLink( &linkW, &nameW ); + if (status) + { + FIXME( "failed to create device error %x\n", status ); + return status; + } + + RegCreateKeyExW( HKEY_LOCAL_MACHINE, mounted_devicesW, 0, NULL, + REG_OPTION_VOLATILE, KEY_ALL_ACCESS, NULL, &mount_key, NULL ); + + RtlInitUnicodeString( &nameW, harddiskW ); + status = IoCreateDriver( &nameW, harddisk_driver_entry ); + + initialize_hal(); + initialize_diskarbitration(); + + return status; +} diff --git a/dlls/mountmgr.sys/mountmgr.h b/dlls/mountmgr.sys/mountmgr.h index 2d34624b839..63e9b75da10 100644 --- a/dlls/mountmgr.sys/mountmgr.h +++ b/dlls/mountmgr.sys/mountmgr.h @@ -18,8 +18,41 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include + +#define NONAMELESSUNION +#define NONAMELESSSTRUCT + +#include "ntstatus.h" +#define WIN32_NO_STATUS +#include "windef.h" +#include "winbase.h" +#include "winternl.h" +#include "winioctl.h" +#include "ntddstor.h" +#include "ntddcdrm.h" +#include "ddk/wdm.h" +#define WINE_MOUNTMGR_EXTENSIONS +#include "ddk/mountmgr.h" + extern void initialize_hal(void); extern void initialize_diskarbitration(void); -extern BOOL add_dos_device( const char *udi, const char *device, - const char *mount_point, DWORD type ); -extern BOOL remove_dos_device( const char *udi ); + +/* device functions */ + +extern NTSTATUS add_dos_device( int letter, const char *udi, const char *device, + const char *mount_point, DWORD type ); +extern NTSTATUS remove_dos_device( int letter, const char *udi ); +extern NTSTATUS query_dos_device( int letter, DWORD *type, const char **device, const char **mount_point ); +extern NTSTATUS WINAPI harddisk_driver_entry( DRIVER_OBJECT *driver, UNICODE_STRING *path ); + +/* mount point functions */ + +struct mount_point; + +extern struct mount_point *add_dosdev_mount_point( DEVICE_OBJECT *device, UNICODE_STRING *device_name, + int drive, const void *id, unsigned int id_len ); +extern struct mount_point *add_volume_mount_point( DEVICE_OBJECT *device, UNICODE_STRING *device_name, + int drive, const void *id, unsigned int id_len ); +extern void delete_mount_point( struct mount_point *mount ); +extern void set_mount_point_id( struct mount_point *mount, const void *id, unsigned int id_len ); diff --git a/dlls/mpr/wnet.c b/dlls/mpr/wnet.c index 959efb3b4c1..3b05edecab2 100644 --- a/dlls/mpr/wnet.c +++ b/dlls/mpr/wnet.c @@ -24,10 +24,13 @@ #include "windef.h" #include "winbase.h" #include "winnls.h" +#include "winioctl.h" #include "winnetwk.h" #include "npapi.h" #include "winreg.h" #include "winuser.h" +#define WINE_MOUNTMGR_EXTENSIONS +#include "ddk/mountmgr.h" #include "wine/debug.h" #include "wine/unicode.h" #include "mprres.h" @@ -1750,6 +1753,52 @@ DWORD WINAPI WNetGetConnectionA( LPCSTR lpLocalName, return ret; } +/* find the network connection for a given drive; helper for WNetGetConnection */ +static DWORD get_drive_connection( WCHAR letter, LPWSTR remote, LPDWORD size ) +{ + char buffer[1024]; + struct mountmgr_unix_drive *data = (struct mountmgr_unix_drive *)buffer; + HANDLE mgr; + DWORD ret = WN_NOT_CONNECTED; + + if ((mgr = CreateFileW( MOUNTMGR_DOS_DEVICE_NAME, GENERIC_READ|GENERIC_WRITE, + FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, + 0, 0 )) == INVALID_HANDLE_VALUE) + { + ERR( "failed to open mount manager err %u\n", GetLastError() ); + return ret; + } + memset( data, 0, sizeof(*data) ); + data->letter = letter; + if (DeviceIoControl( mgr, IOCTL_MOUNTMGR_QUERY_UNIX_DRIVE, data, sizeof(*data), + data, sizeof(buffer), NULL, NULL )) + { + char *p, *mount_point = buffer + data->mount_point_offset; + DWORD len; + + if (data->mount_point_offset && !strncmp( mount_point, "unc/", 4 )) + { + mount_point += 2; + mount_point[0] = '\\'; + for (p = mount_point; *p; p++) if (*p == '/') *p = '\\'; + + len = MultiByteToWideChar( CP_UNIXCP, 0, mount_point, -1, NULL, 0 ); + if (len > *size) + { + *size = len; + ret = WN_MORE_DATA; + } + else + { + *size = MultiByteToWideChar( CP_UNIXCP, 0, mount_point, -1, remote, *size); + ret = WN_SUCCESS; + } + } + } + CloseHandle( mgr ); + return ret; +} + /************************************************************************** * WNetGetConnectionW [MPR.@] * @@ -1778,31 +1827,8 @@ DWORD WINAPI WNetGetConnectionW( LPCWSTR lpLocalName, switch(GetDriveTypeW(lpLocalName)) { case DRIVE_REMOTE: - { - static const WCHAR unc[] = { 'u','n','c','\\' }; - WCHAR rremote[MAX_PATH], *remote = rremote; - if (!QueryDosDeviceW( lpLocalName, remote, MAX_PATH )) remote[0] = 0; - else if (!strncmpW(remote, unc, 4)) - { - remote += 2; - remote[0] = '\\'; - } - else if (remote[0] != '\\' || remote[1] != '\\') - FIXME("Don't know how to convert %s to an unc\n", debugstr_w(remote)); - - if (strlenW(remote) + 1 > *lpBufferSize) - { - *lpBufferSize = strlenW(remote) + 1; - ret = WN_MORE_DATA; - } - else - { - strcpyW( lpRemoteName, remote ); - *lpBufferSize = strlenW(lpRemoteName) + 1; - ret = WN_SUCCESS; - } + ret = get_drive_connection( lpLocalName[0], lpRemoteName, lpBufferSize ); break; - } case DRIVE_REMOVABLE: case DRIVE_FIXED: case DRIVE_CDROM: diff --git a/dlls/mscms/tests/profile.c b/dlls/mscms/tests/profile.c index 7d77baaa5c6..56d77326563 100644 --- a/dlls/mscms/tests/profile.c +++ b/dlls/mscms/tests/profile.c @@ -1423,7 +1423,7 @@ static void test_AssociateColorProfileWithDeviceA(void) ok( ret, "DisassociateColorProfileFromDeviceA() failed (%u)\n", GetLastError() ); ret = pUninstallColorProfileA( NULL, profile, TRUE ); - ok( ret, "UninstallColorProfileW() failed (%d)\n", GetLastError() ); + ok( ret, "UninstallColorProfileA() failed (%d)\n", GetLastError() ); } } diff --git a/dlls/mscms/transform.c b/dlls/mscms/transform.c index 2ed65d13d7a..a795386d35f 100644 --- a/dlls/mscms/transform.c +++ b/dlls/mscms/transform.c @@ -58,6 +58,7 @@ static DWORD from_profile( HPROFILE profile ) static DWORD from_bmformat( BMFORMAT format ) { + static int quietfixme = 0; TRACE( "bitmap format: 0x%08x\n", format ); switch (format) @@ -66,7 +67,11 @@ static DWORD from_bmformat( BMFORMAT format ) case BM_BGRTRIPLETS: return TYPE_BGR_8; case BM_GRAY: return TYPE_GRAY_8; default: - FIXME("unhandled bitmap format\n"); + if (quietfixme == 0) + { + FIXME("unhandled bitmap format 0x%x\n", format); + quietfixme = 1; + } return TYPE_RGB_8; } } diff --git a/dlls/msdmo/dmoreg.c b/dlls/msdmo/dmoreg.c index 743f0bbba2f..97388c9fc1c 100644 --- a/dlls/msdmo/dmoreg.c +++ b/dlls/msdmo/dmoreg.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003 Michael Günnewig + * Copyright (C) 2003 Michael Günnewig * Copyright (C) 2003 CodeWeavers Inc. (Ulrich Czekalla) * * This library is free software; you can redistribute it and/or diff --git a/dlls/msdmo/dmort.c b/dlls/msdmo/dmort.c index fe19100a061..b586cac6116 100644 --- a/dlls/msdmo/dmort.c +++ b/dlls/msdmo/dmort.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003 Michael Günnewig + * Copyright (C) 2003 Michael Günnewig * * 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/mshtml/Pt.rc b/dlls/mshtml/Pt.rc new file mode 100644 index 00000000000..fae6d183c12 --- /dev/null +++ b/dlls/mshtml/Pt.rc @@ -0,0 +1,55 @@ +/* + * Copyright 2008 Ricardo Filipe + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + + +LANGUAGE LANG_PORTUGUESE, SUBLANG_NEUTRAL + +STRINGTABLE DISCARDABLE +{ + IDS_HTMLDISABLED "A interpretação de HTML está desactivada." + IDS_HTMLDOCUMENT "Documento HTML" + IDS_DOWNLOADING "Descarregando..." + IDS_INSTALLING "Instalando..." +} + +ID_DWL_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 260, 85 +STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "Instalador Wine Gecko" +FONT 8, "MS Shell Dlg" +{ + LTEXT "Esta aplicação está a tentar mostrar uma página HTML. O Wine precisa que o Gecko " \ + "(Motor HTML Mozilla) seja instalado para mostrar a página. Clique em Instalar se deseja que o Wine " \ + "descarregue e instale o Gecko automaticamente.", ID_DWL_STATUS, 10, 10, 240, 30, SS_LEFT + CONTROL "Progresso", ID_DWL_PROGRESS, PROGRESS_CLASSA, WS_BORDER|PBS_SMOOTH, 10, 40, 240, 12 + DEFPUSHBUTTON "&Instalar", ID_DWL_INSTALL, 200, 60, 50, 15, WS_GROUP | WS_TABSTOP + PUSHBUTTON "&Cancelar", IDCANCEL, 140, 60, 50, 15, WS_GROUP | WS_TABSTOP +} + +IDD_HYPERLINK DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 250, 65 +STYLE DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "Hiperligação" +FONT 8, "MS Shell Dlg" +{ + GROUPBOX "Informação da Hiperligação", IDC_STATIC, 5, 5, 190, 55 + LTEXT "&Tipo:", IDC_STATIC, 10, 22, 20, 10 + COMBOBOX IDC_TYPE, 35, 20, 45, 100, WS_TABSTOP | WS_GROUP | WS_VSCROLL | CBS_DROPDOWNLIST | CBS_HASSTRINGS + LTEXT "&URL:", IDC_STATIC, 10, 42, 20, 10 + EDITTEXT IDC_URL, 35, 40, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_GROUP | WS_TABSTOP + PUSHBUTTON "OK", IDOK, 200, 10, 45, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP + PUSHBUTTON "Cancelar", IDCANCEL, 200, 28, 45, 14, WS_GROUP | WS_TABSTOP +} diff --git a/dlls/mshtml/conpoint.c b/dlls/mshtml/conpoint.c index 0c77e9ced9e..10d8e291bf4 100644 --- a/dlls/mshtml/conpoint.c +++ b/dlls/mshtml/conpoint.c @@ -213,7 +213,7 @@ void ConnectionPoint_Init(ConnectionPoint *cp, ConnectionPointContainer *contain static void ConnectionPoint_Destroy(ConnectionPoint *This) { - int i; + DWORD i; for(i=0; isinks_size; i++) { if(This->sinks[i].unk) diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 7fc6f30ea69..01d52a21dd2 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -763,7 +763,7 @@ static HRESULT WINAPI HTMLDocument_write(IHTMLDocument2 *iface, SAFEARRAY *psarr HTMLDocument *This = HTMLDOC_THIS(iface); nsAString nsstr; VARIANT *var; - int i; + ULONG i; nsresult nsres; HRESULT hres; diff --git a/dlls/mshtml/main.c b/dlls/mshtml/main.c index 1315e8a4697..8b441f0b50e 100644 --- a/dlls/mshtml/main.c +++ b/dlls/mshtml/main.c @@ -318,7 +318,7 @@ static HRESULT register_server(BOOL do_register) STRTABLEA strtable; STRENTRYA pse[35]; static CLSID const *clsids[35]; - int i = 0; + unsigned int i = 0; static const WCHAR wszAdvpack[] = {'a','d','v','p','a','c','k','.','d','l','l',0}; diff --git a/dlls/mshtml/nsembed.c b/dlls/mshtml/nsembed.c index 45386beaee3..17345417c95 100644 --- a/dlls/mshtml/nsembed.c +++ b/dlls/mshtml/nsembed.c @@ -497,7 +497,7 @@ BOOL load_gecko(BOOL silent) PRUnichar gre_path[MAX_PATH]; BOOL ret = FALSE; - static LONG loading_thread; + static DWORD loading_thread; TRACE("()\n"); diff --git a/dlls/mshtml/nsio.c b/dlls/mshtml/nsio.c index 82f7c0defaa..184354270e1 100644 --- a/dlls/mshtml/nsio.c +++ b/dlls/mshtml/nsio.c @@ -1583,7 +1583,7 @@ static nsresult NSAPI nsURI_SchemeIs(nsIWineURI *iface, const char *scheme, PRBo WCHAR buf[INTERNET_MAX_SCHEME_LENGTH]; int len = MultiByteToWideChar(CP_ACP, 0, scheme, -1, buf, sizeof(buf)/sizeof(WCHAR))-1; - *_retval = strlenW(This->wine_url) > len + *_retval = lstrlenW(This->wine_url) > len && This->wine_url[len] == ':' && !memcmp(buf, This->wine_url, len*sizeof(WCHAR)); return NS_OK; diff --git a/dlls/mshtml/protocol.c b/dlls/mshtml/protocol.c index ff319ac45df..4cdac9fd33d 100644 --- a/dlls/mshtml/protocol.c +++ b/dlls/mshtml/protocol.c @@ -424,7 +424,7 @@ static HRESULT WINAPI AboutProtocolInfo_ParseUrl(IInternetProtocolInfo *iface, L dwParseFlags, pwzResult, cchResult, pcchResult, dwReserved); if(ParseAction == PARSE_SECURITY_URL) { - int len = lstrlenW(pwzUrl); + unsigned int len = strlenW(pwzUrl); if(len >= cchResult) return S_FALSE; diff --git a/dlls/mshtml/rsrc.rc b/dlls/mshtml/rsrc.rc index b932fb9da64..17c0233d477 100644 --- a/dlls/mshtml/rsrc.rc +++ b/dlls/mshtml/rsrc.rc @@ -46,6 +46,7 @@ #include "Nl.rc" #include "No.rc" #include "Pl.rc" +#include "Pt.rc" #include "Ru.rc" #include "Si.rc" #include "Sv.rc" diff --git a/dlls/msi/appsearch.c b/dlls/msi/appsearch.c index b33594658f9..dc885bc6174 100644 --- a/dlls/msi/appsearch.c +++ b/dlls/msi/appsearch.c @@ -155,6 +155,73 @@ static void ACTION_FreeSignature(MSISIGNATURE *sig) msi_free(sig->Languages); } +static LPWSTR app_search_file(LPWSTR path, MSISIGNATURE *sig) +{ + VS_FIXEDFILEINFO *info; + DWORD attr, handle, size; + LPWSTR val = NULL; + LPBYTE buffer; + + static const WCHAR root[] = {'\\',0}; + + if (!sig->File) + { + PathRemoveFileSpecW(path); + PathAddBackslashW(path); + + attr = GetFileAttributesW(path); + if (attr != INVALID_FILE_ATTRIBUTES && + (attr & FILE_ATTRIBUTE_DIRECTORY)) + return strdupW(path); + + return NULL; + } + + attr = GetFileAttributesW(path); + if (attr == INVALID_FILE_ATTRIBUTES || attr == FILE_ATTRIBUTE_DIRECTORY) + return NULL; + + size = GetFileVersionInfoSizeW(path, &handle); + if (!size) + return strdupW(path); + + buffer = msi_alloc(size); + if (!buffer) + return NULL; + + if (!GetFileVersionInfoW(path, 0, size, buffer)) + goto done; + + if (!VerQueryValueW(buffer, root, (LPVOID)&info, &size) || !info) + goto done; + + if (sig->MinVersionLS || sig->MinVersionMS) + { + if (info->dwFileVersionMS < sig->MinVersionMS) + goto done; + + if (info->dwFileVersionMS == sig->MinVersionMS && + info->dwFileVersionLS < sig->MinVersionLS) + goto done; + } + + if (sig->MaxVersionLS || sig->MaxVersionMS) + { + if (info->dwFileVersionMS > sig->MaxVersionMS) + goto done; + + if (info->dwFileVersionMS == sig->MaxVersionMS && + info->dwFileVersionLS > sig->MaxVersionLS) + goto done; + } + + val = strdupW(path); + +done: + msi_free(buffer); + return val; +} + static UINT ACTION_AppSearchComponents(MSIPACKAGE *package, LPWSTR *appValue, MSISIGNATURE *sig) { static const WCHAR query[] = { @@ -211,7 +278,7 @@ static UINT ACTION_AppSearchComponents(MSIPACKAGE *package, LPWSTR *appValue, MS if (type != msidbLocatorTypeDirectory && sigpresent && !isdir) { - *appValue = strdupW(path); + *appValue = app_search_file(path, sig); } else if (!sigpresent && (type != msidbLocatorTypeDirectory || isdir)) { @@ -305,6 +372,7 @@ static UINT ACTION_AppSearchReg(MSIPACKAGE *package, LPWSTR *appValue, MSISIGNAT 'S','i','g','n','a','t','u','r','e','_',' ','=',' ', '\'','%','s','\'',0}; LPWSTR keyPath = NULL, valueName = NULL; LPWSTR deformatted = NULL; + LPWSTR ptr = NULL, end; int root, type; HKEY rootKey, key = NULL; DWORD sz = 0, regType; @@ -377,13 +445,18 @@ static UINT ACTION_AppSearchReg(MSIPACKAGE *package, LPWSTR *appValue, MSISIGNAT if (sz == 0) goto end; + if ((ptr = strchrW((LPWSTR)value, '"')) && (end = strchrW(++ptr, '"'))) + *end = '\0'; + else + ptr = (LPWSTR)value; + switch (type & 0x0f) { case msidbLocatorTypeDirectory: - rc = ACTION_SearchDirectory(package, sig, (LPWSTR)value, 0, appValue); + rc = ACTION_SearchDirectory(package, sig, ptr, 0, appValue); break; case msidbLocatorTypeFileName: - *appValue = strdupW((LPWSTR)value); + *appValue = app_search_file(ptr, sig); break; case msidbLocatorTypeRawValue: ACTION_ConvertRegValue(regType, value, sz, appValue); @@ -405,6 +478,32 @@ end: return ERROR_SUCCESS; } +static LPWSTR get_ini_field(LPWSTR buf, int field) +{ + LPWSTR beg, end; + int i = 1; + + if (field == 0) + return strdupW(buf); + + beg = buf; + while ((end = strchrW(beg, ',')) && i < field) + { + beg = end + 1; + while (*beg && *beg == ' ') + beg++; + + i++; + } + + end = strchrW(beg, ','); + if (!end) + end = beg + lstrlenW(beg); + + *end = '\0'; + return strdupW(beg); +} + static UINT ACTION_AppSearchIni(MSIPACKAGE *package, LPWSTR *appValue, MSISIGNATURE *sig) { @@ -446,13 +545,13 @@ static UINT ACTION_AppSearchIni(MSIPACKAGE *package, LPWSTR *appValue, switch (type & 0x0f) { case msidbLocatorTypeDirectory: - FIXME("unimplemented for Directory (%s)\n", debugstr_w(buf)); + ACTION_SearchDirectory(package, sig, buf, 0, appValue); break; case msidbLocatorTypeFileName: - FIXME("unimplemented for File (%s)\n", debugstr_w(buf)); + *appValue = app_search_file(buf, sig); break; case msidbLocatorTypeRawValue: - *appValue = strdupW(buf); + *appValue = get_ini_field(buf, field); break; } } @@ -495,7 +594,7 @@ static void ACTION_ExpandAnyPath(MSIPACKAGE *package, WCHAR *src, WCHAR *dst, ptr = src; deformat_string(package, ptr, &deformatted); - if (!deformatted || lstrlenW(deformatted) > len - 1) + if (!deformatted || strlenW(deformatted) > len - 1) { msi_free(deformatted); return; @@ -558,11 +657,12 @@ static UINT ACTION_FileVersionMatches(const MSISIGNATURE *sig, LPCWSTR filePath, HIWORD(sig->MinVersionLS), LOWORD(sig->MinVersionLS)); } - else if (info->dwFileVersionMS < sig->MinVersionMS - || (info->dwFileVersionMS == sig->MinVersionMS && - info->dwFileVersionLS < sig->MinVersionLS)) + else if ((sig->MaxVersionMS || sig->MaxVersionLS) && + (info->dwFileVersionMS > sig->MaxVersionMS || + (info->dwFileVersionMS == sig->MaxVersionMS && + info->dwFileVersionLS > sig->MaxVersionLS))) { - TRACE("Greater than minimum version %d.%d.%d.%d\n", + TRACE("Greater than maximum version %d.%d.%d.%d\n", HIWORD(sig->MaxVersionMS), LOWORD(sig->MaxVersionMS), HIWORD(sig->MaxVersionLS), @@ -634,79 +734,92 @@ static UINT ACTION_FileMatchesSig(const MSISIGNATURE *sig, static UINT ACTION_RecurseSearchDirectory(MSIPACKAGE *package, LPWSTR *appValue, MSISIGNATURE *sig, LPCWSTR dir, int depth) { - static const WCHAR starDotStarW[] = { '*','.','*',0 }; + HANDLE hFind; + WIN32_FIND_DATAW findData; UINT rc = ERROR_SUCCESS; size_t dirLen = lstrlenW(dir), fileLen = lstrlenW(sig->File); + WCHAR subpath[MAX_PATH]; WCHAR *buf; + static const WCHAR dot[] = {'.',0}; + static const WCHAR dotdot[] = {'.','.',0}; + static const WCHAR starDotStarW[] = { '*','.','*',0 }; + TRACE("Searching directory %s for file %s, depth %d\n", debugstr_w(dir), - debugstr_w(sig->File), depth); + debugstr_w(sig->File), depth); if (depth < 0) - return ERROR_INVALID_PARAMETER; + return ERROR_SUCCESS; *appValue = NULL; /* We need the buffer in both paths below, so go ahead and allocate it * here. Add two because we might need to add a backslash if the dir name * isn't backslash-terminated. */ - buf = msi_alloc( (dirLen + max(fileLen, lstrlenW(starDotStarW)) + 2) * sizeof(WCHAR)); - if (buf) - { - /* a depth of 0 implies we should search dir, so go ahead and search */ - HANDLE hFind; - WIN32_FIND_DATAW findData; + buf = msi_alloc( (dirLen + max(fileLen, strlenW(starDotStarW)) + 2) * sizeof(WCHAR)); + if (!buf) + return ERROR_OUTOFMEMORY; - memcpy(buf, dir, dirLen * sizeof(WCHAR)); - if (buf[dirLen - 1] != '\\') - buf[dirLen++ - 1] = '\\'; - memcpy(buf + dirLen, sig->File, (fileLen + 1) * sizeof(WCHAR)); - hFind = FindFirstFileW(buf, &findData); - if (hFind != INVALID_HANDLE_VALUE) + lstrcpyW(buf, dir); + PathAddBackslashW(buf); + lstrcatW(buf, sig->File); + + hFind = FindFirstFileW(buf, &findData); + if (hFind != INVALID_HANDLE_VALUE) + { + if (!(findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) { BOOL matches; - /* assuming Signature can't contain wildcards for the file name, - * so don't bother with FindNextFileW here. - */ - if (!(rc = ACTION_FileMatchesSig(sig, &findData, buf, &matches)) - && matches) + rc = ACTION_FileMatchesSig(sig, &findData, buf, &matches); + if (rc == ERROR_SUCCESS && matches) { TRACE("found file, returning %s\n", debugstr_w(buf)); *appValue = buf; } - FindClose(hFind); } - if (rc == ERROR_SUCCESS && !*appValue && depth > 0) + FindClose(hFind); + } + + if (rc == ERROR_SUCCESS && !*appValue) + { + lstrcpyW(buf, dir); + PathAddBackslashW(buf); + lstrcatW(buf, starDotStarW); + + hFind = FindFirstFileW(buf, &findData); + if (hFind != INVALID_HANDLE_VALUE) { - HANDLE hFind; - WIN32_FIND_DATAW findData; - - memcpy(buf, dir, dirLen * sizeof(WCHAR)); - if (buf[dirLen - 1] != '\\') - buf[dirLen++ - 1] = '\\'; - lstrcpyW(buf + dirLen, starDotStarW); - hFind = FindFirstFileW(buf, &findData); - if (hFind != INVALID_HANDLE_VALUE) + if (findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY && + lstrcmpW(findData.cFileName, dot) && + lstrcmpW(findData.cFileName, dotdot)) + { + lstrcpyW(subpath, dir); + PathAppendW(subpath, findData.cFileName); + rc = ACTION_RecurseSearchDirectory(package, appValue, sig, + subpath, depth - 1); + } + + while (rc == ERROR_SUCCESS && !*appValue && + FindNextFileW(hFind, &findData) != 0) { + if (!lstrcmpW(findData.cFileName, dot) || + !lstrcmpW(findData.cFileName, dotdot)) + continue; + + lstrcpyW(subpath, dir); + PathAppendW(subpath, findData.cFileName); if (findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) - rc = ACTION_RecurseSearchDirectory(package, appValue, sig, - findData.cFileName, depth - 1); - while (rc == ERROR_SUCCESS && !*appValue && - FindNextFileW(hFind, &findData) != 0) - { - if (findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) - rc = ACTION_RecurseSearchDirectory(package, appValue, - sig, findData.cFileName, depth - 1); - } - FindClose(hFind); + rc = ACTION_RecurseSearchDirectory(package, appValue, + sig, subpath, depth - 1); } + + FindClose(hFind); } - if (!*appValue) - msi_free(buf); } - else - rc = ERROR_OUTOFMEMORY; + + if (!*appValue) + msi_free(buf); return rc; } @@ -743,6 +856,7 @@ static UINT ACTION_SearchDirectory(MSIPACKAGE *package, MSISIGNATURE *sig, LPCWSTR path, int depth, LPWSTR *appValue) { UINT rc; + DWORD attr; LPWSTR val = NULL; TRACE("%p, %p, %s, %d, %p\n", package, sig, debugstr_w(path), depth, @@ -787,7 +901,9 @@ static UINT ACTION_SearchDirectory(MSIPACKAGE *package, MSISIGNATURE *sig, } } - if (val && val[lstrlenW(val) - 1] != '\\') + attr = GetFileAttributesW(val); + if ((attr & FILE_ATTRIBUTE_DIRECTORY) && + val && val[lstrlenW(val) - 1] != '\\') { val = msi_realloc(val, (lstrlenW(val) + 2) * sizeof(WCHAR)); if (!val) @@ -823,9 +939,6 @@ static UINT ACTION_AppSearchDr(MSIPACKAGE *package, LPWSTR *appValue, MSISIGNATU TRACE("%s\n", debugstr_w(sig->Name)); - msi_free(sig->File); - sig->File = NULL; - *appValue = NULL; row = MSI_QueryGetRecord( package->db, query, sig->Name ); @@ -858,6 +971,12 @@ static UINT ACTION_AppSearchDr(MSIPACKAGE *package, LPWSTR *appValue, MSISIGNATU if (parent) { + if (!(GetFileAttributesW(parent) & FILE_ATTRIBUTE_DIRECTORY)) + { + PathRemoveFileSpecW(parent); + PathAddBackslashW(parent); + } + strcpyW(path, parent); strcatW(path, expanded); } diff --git a/dlls/msi/automation.c b/dlls/msi/automation.c index 60224b64df9..11f0a091ea7 100644 --- a/dlls/msi/automation.c +++ b/dlls/msi/automation.c @@ -336,7 +336,7 @@ static HRESULT WINAPI AutomationObject_GetIDsOfNames( hr = ITypeInfo_GetIDsOfNames(This->iTypeInfo, rgszNames, cNames, rgDispId); if (hr == DISP_E_UNKNOWNNAME) { - int idx; + UINT idx; for (idx=0; idxnum_groups; i++ ) { - if( info->group[i].len < lstrlenW( p ) ) + if( info->group[i].len < strlenW( p ) ) { LPWSTR chunk = strdupW( p ); chunk[ info->group[i].len ] = 0; diff --git a/dlls/msi/helpers.c b/dlls/msi/helpers.c index 9693719e68a..d15d79a2e5f 100644 --- a/dlls/msi/helpers.c +++ b/dlls/msi/helpers.c @@ -436,7 +436,7 @@ UINT schedule_action(MSIPACKAGE *package, UINT script, LPCWSTR action) void msi_free_action_script(MSIPACKAGE *package, UINT script) { - int i; + UINT i; for (i = 0; i < package->script->ActionCount[script]; i++) msi_free(package->script->Actions[script][i]); @@ -1009,7 +1009,7 @@ UINT register_unique_action(MSIPACKAGE *package, LPCWSTR action) BOOL check_unique_action(const MSIPACKAGE *package, LPCWSTR action) { - INT i; + UINT i; if (!package->script) return FALSE; diff --git a/dlls/msi/msi.c b/dlls/msi/msi.c index c23341155ba..79407387f90 100644 --- a/dlls/msi/msi.c +++ b/dlls/msi/msi.c @@ -827,7 +827,7 @@ static UINT WINAPI MSI_GetProductInfo(LPCWSTR szProduct, LPCWSTR szAttribute, { save = *pcchValueBuf; - if (lstrlenW(val) < *pcchValueBuf) + if (strlenW(val) < *pcchValueBuf) r = msi_strcpy_to_awstring(val, szValue, pcchValueBuf); else if (szValue->str.a || szValue->str.w) r = ERROR_MORE_DATA; @@ -973,7 +973,7 @@ static UINT msi_copy_outval(LPWSTR val, LPWSTR out, LPDWORD size) if (out) { - if (lstrlenW(val) >= *size) + if (strlenW(val) >= *size) { r = ERROR_MORE_DATA; if (*size > 0) @@ -1591,7 +1591,7 @@ LANGID WINAPI MsiLoadStringA( MSIHANDLE handle, UINT id, LPSTR lpBuffer, { LPWSTR bufW; LANGID r; - DWORD len; + INT len; bufW = msi_alloc(nBufferMax*sizeof(WCHAR)); r = MsiLoadStringW(handle, id, bufW, nBufferMax, lang); @@ -2135,7 +2135,7 @@ UINT WINAPI MsiGetFileVersionW(LPCWSTR szFilePath, LPWSTR lpVersionBuf, HIWORD(ffi->dwFileVersionLS), LOWORD(ffi->dwFileVersionLS)); if (lpVersionBuf) lstrcpynW(lpVersionBuf, tmp, *pcchVersionBuf); - if (lstrlenW(tmp) >= *pcchVersionBuf) + if (strlenW(tmp) >= *pcchVersionBuf) ret = ERROR_MORE_DATA; *pcchVersionBuf = lstrlenW(tmp); @@ -2155,7 +2155,7 @@ UINT WINAPI MsiGetFileVersionW(LPCWSTR szFilePath, LPWSTR lpVersionBuf, wsprintfW(tmp, szLangFormat, *lang); if (lpLangBuf) lstrcpynW(lpLangBuf, tmp, *pcchLangBuf); - if (lstrlenW(tmp) >= *pcchLangBuf) + if (strlenW(tmp) >= *pcchLangBuf) ret = ERROR_MORE_DATA; *pcchLangBuf = lstrlenW(tmp); diff --git a/dlls/msi/msiquery.c b/dlls/msi/msiquery.c index 4435cd929f8..3e7a8778de3 100644 --- a/dlls/msi/msiquery.c +++ b/dlls/msi/msiquery.c @@ -633,7 +633,7 @@ MSIDBERROR WINAPI MsiViewGetErrorW( MSIHANDLE handle, LPWSTR szColumnNameBuffer, MSIQUERY *query = NULL; static const WCHAR szError[] = { 0 }; MSIDBERROR r = MSIDBERROR_NOERROR; - int len; + DWORD len; FIXME("%ld %p %p - returns empty error string\n", handle, szColumnNameBuffer, pcchBuf ); @@ -645,7 +645,7 @@ MSIDBERROR WINAPI MsiViewGetErrorW( MSIHANDLE handle, LPWSTR szColumnNameBuffer, if( !query ) return MSIDBERROR_INVALIDARG; - len = lstrlenW( szError ); + len = strlenW( szError ); if( szColumnNameBuffer ) { if( *pcchBuf > len ) @@ -665,7 +665,7 @@ MSIDBERROR WINAPI MsiViewGetErrorA( MSIHANDLE handle, LPSTR szColumnNameBuffer, static const CHAR szError[] = { 0 }; MSIQUERY *query = NULL; MSIDBERROR r = MSIDBERROR_NOERROR; - int len; + DWORD len; FIXME("%ld %p %p - returns empty error string\n", handle, szColumnNameBuffer, pcchBuf ); @@ -677,7 +677,7 @@ MSIDBERROR WINAPI MsiViewGetErrorA( MSIHANDLE handle, LPSTR szColumnNameBuffer, if( !query ) return MSIDBERROR_INVALIDARG; - len = lstrlenA( szError ); + len = strlen( szError ); if( szColumnNameBuffer ) { if( *pcchBuf > len ) diff --git a/dlls/msi/source.c b/dlls/msi/source.c index 5a714b12714..b07402241b8 100644 --- a/dlls/msi/source.c +++ b/dlls/msi/source.c @@ -218,7 +218,7 @@ UINT WINAPI MsiSourceListEnumMediaDisksW(LPCWSTR szProductCodeOrPatchCode, DWORD numvals, size; LONG res; UINT r; - static int index = 0; + static DWORD index = 0; static const WCHAR fmt[] = {'#','%','d',0}; @@ -360,7 +360,7 @@ UINT WINAPI MsiSourceListEnumSourcesA(LPCSTR szProductCodeOrPatch, LPCSTR szUser LPWSTR source = NULL; DWORD len = 0; UINT r = ERROR_INVALID_PARAMETER; - static int index = 0; + static DWORD index = 0; TRACE("(%s, %s, %d, %d, %d, %p, %p)\n", debugstr_a(szProductCodeOrPatch), debugstr_a(szUserSid), dwContext, dwOptions, dwIndex, szSource, pcchSource); @@ -433,7 +433,7 @@ UINT WINAPI MsiSourceListEnumSourcesW(LPCWSTR szProductCodeOrPatch, LPCWSTR szUs HKEY subkey = NULL; LONG res; UINT r = ERROR_INVALID_PARAMETER; - static int index = 0; + static DWORD index = 0; static const WCHAR format[] = {'%','d',0}; @@ -654,7 +654,7 @@ UINT WINAPI MsiSourceListGetInfoW( LPCWSTR szProduct, LPCWSTR szUserSid, if (szValue) { - if (lstrlenW(ptr) < *pcchValue) + if (strlenW(ptr) < *pcchValue) lstrcpyW(szValue, ptr); else rc = ERROR_MORE_DATA; diff --git a/dlls/msi/suminfo.c b/dlls/msi/suminfo.c index 5d73c57a55c..148ba8ae807 100644 --- a/dlls/msi/suminfo.c +++ b/dlls/msi/suminfo.c @@ -169,8 +169,7 @@ static UINT propvar_changetype(PROPVARIANT *changed, PROPVARIANT *property, VART static void read_properties_from_data( PROPVARIANT *prop, LPBYTE data, DWORD sz ) { UINT type; - DWORD i; - int size; + DWORD i, size; PROPERTY_DATA *propdata; PROPVARIANT property, *ptr; PROPVARIANT changed; diff --git a/dlls/msi/tests/db.c b/dlls/msi/tests/db.c index afee0332700..961aa5a5d3c 100644 --- a/dlls/msi/tests/db.c +++ b/dlls/msi/tests/db.c @@ -6864,7 +6864,12 @@ static void test_dbmerge(void) GetCurrentDirectoryA(MAX_PATH, buf); r = MsiDatabaseImportA(hdb, buf, "codepage.idt"); - todo_wine ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + todo_wine + { + ok(r == ERROR_SUCCESS || + broken(r == ERROR_FUNCTION_FAILED), /* win9x */ + "Expected ERROR_SUCCESS, got %d\n", r); + } query = "DROP TABLE `One`"; r = run_query(hdb, 0, query); diff --git a/dlls/msi/tests/package.c b/dlls/msi/tests/package.c index b6b3a789508..2081a8bfa4f 100644 --- a/dlls/msi/tests/package.c +++ b/dlls/msi/tests/package.c @@ -839,6 +839,68 @@ static void create_test_file(const CHAR *name) CloseHandle(file); } +typedef struct _tagVS_VERSIONINFO +{ + WORD wLength; + WORD wValueLength; + WORD wType; + WCHAR szKey[1]; + WORD wPadding1[1]; + VS_FIXEDFILEINFO Value; + WORD wPadding2[1]; + WORD wChildren[1]; +} VS_VERSIONINFO; + +#define roundoffs(a, b, r) (((BYTE *)(b) - (BYTE *)(a) + ((r) - 1)) & ~((r) - 1)) +#define roundpos(a, b, r) (((BYTE *)(a)) + roundoffs(a, b, r)) + +static BOOL create_file_with_version(const CHAR *name, LONG ms, LONG ls) +{ + VS_VERSIONINFO *pVerInfo; + VS_FIXEDFILEINFO *pFixedInfo; + LPBYTE buffer, ofs; + CHAR path[MAX_PATH]; + DWORD handle, size; + HANDLE resource; + BOOL ret = FALSE; + + GetSystemDirectory(path, MAX_PATH); + lstrcatA(path, "\\kernel32.dll"); + + CopyFileA(path, name, FALSE); + + size = GetFileVersionInfoSize(path, &handle); + buffer = HeapAlloc(GetProcessHeap(), 0, size); + + GetFileVersionInfoA(path, 0, size, buffer); + + pVerInfo = (VS_VERSIONINFO *)buffer; + ofs = (BYTE *)&pVerInfo->szKey[lstrlenW(pVerInfo->szKey) + 1]; + pFixedInfo = (VS_FIXEDFILEINFO *)roundpos(pVerInfo, ofs, 4); + + pFixedInfo->dwFileVersionMS = ms; + pFixedInfo->dwFileVersionLS = ls; + pFixedInfo->dwProductVersionMS = ms; + pFixedInfo->dwProductVersionLS = ls; + + resource = BeginUpdateResource(name, FALSE); + if (!resource) + goto done; + + if (!UpdateResource(resource, RT_VERSION, MAKEINTRESOURCE(VS_VERSION_INFO), + MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), buffer, size)) + goto done; + + if (!EndUpdateResource(resource, FALSE)) + goto done; + + ret = TRUE; + +done: + HeapFree(GetProcessHeap(), 0, buffer); + return ret; +} + static void test_createpackage(void) { MSIHANDLE hPackage = 0; @@ -5785,7 +5847,10 @@ static void test_appsearch(void) r = MsiGetPropertyA( hpkg, "WEBBROWSERPROG", prop, &size ); ok( r == ERROR_SUCCESS, "get property failed: %d\n", r); - ok( lstrlenA(prop) != 0, "Expected non-zero length\n"); + todo_wine + { + ok( lstrlenA(prop) != 0, "Expected non-zero length\n"); + } MsiCloseHandle( hpkg ); DeleteFileA(msifile); @@ -5836,6 +5901,18 @@ static void test_appsearch_complocator(void) set_component_path("IDontExist\\", MSIINSTALLCONTEXT_MACHINE, "{91B7359B-07F2-4221-AA8D-DE102BB87A5F}", NULL, FALSE); + create_file_with_version("FileName8.dll", MAKELONG(2, 1), MAKELONG(4, 3)); + set_component_path("FileName8.dll", MSIINSTALLCONTEXT_MACHINE, + "{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}", NULL, FALSE); + + create_file_with_version("FileName9.dll", MAKELONG(1, 2), MAKELONG(3, 4)); + set_component_path("FileName9.dll", MSIINSTALLCONTEXT_MACHINE, + "{A204DF48-7346-4635-BA2E-66247DBAC9DF}", NULL, FALSE); + + create_file_with_version("FileName10.dll", MAKELONG(2, 1), MAKELONG(4, 3)); + set_component_path("FileName10.dll", MSIINSTALLCONTEXT_MACHINE, + "{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}", NULL, FALSE); + hdb = create_package_db(); ok(hdb, "Expected a valid database handle\n"); @@ -5869,6 +5946,15 @@ static void test_appsearch_complocator(void) r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'"); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'"); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'"); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + r = add_appsearch_entry(hdb, "'SIGPROP12', 'NewSignature12'"); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + r = create_complocator_table(hdb); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); @@ -5908,6 +5994,18 @@ static void test_appsearch_complocator(void) r = add_complocator_entry(hdb, "'NewSignature9', '{91B7359B-07F2-4221-AA8D-DE102BB87A5F}', 0"); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + /* published component, signature w/ ver, misdbLocatorTypeFile */ + r = add_complocator_entry(hdb, "'NewSignature10', '{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}', 1"); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + /* published component, signature w/ ver, ver > max, misdbLocatorTypeFile */ + r = add_complocator_entry(hdb, "'NewSignature11', '{A204DF48-7346-4635-BA2E-66247DBAC9DF}', 1"); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + /* published component, signature w/ ver, sig->name ignored, misdbLocatorTypeFile */ + r = add_complocator_entry(hdb, "'NewSignature12', '{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}', 1"); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + r = create_signature_table(hdb); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); @@ -5926,6 +6024,15 @@ static void test_appsearch_complocator(void) r = add_signature_entry(hdb, "'NewSignature5', 'FileName5', '', '', '', '', '', '', ''"); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + r = add_signature_entry(hdb, "'NewSignature10', 'FileName8.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''"); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + r = add_signature_entry(hdb, "'NewSignature11', 'FileName9.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''"); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + r = add_signature_entry(hdb, "'NewSignature12', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''"); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + hpkg = package_from_db(hdb); ok(hpkg, "Expected a valid package handle\n"); @@ -5977,14 +6084,33 @@ static void test_appsearch_complocator(void) ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop); + size = MAX_PATH; r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); ok(!lstrcmpA(prop, "october"), "Expected \"october\", got \"%s\"\n", prop); + size = MAX_PATH; r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop); + size = MAX_PATH; + sprintf(path, "%s\\FileName8.dll", CURR_DIR); + r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop); + + size = MAX_PATH; + r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop); + + size = MAX_PATH; + sprintf(path, "%s\\FileName10.dll", CURR_DIR); + r = MsiGetPropertyA(hpkg, "SIGPROP12", prop, &size); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop); + delete_component_path("{A8AE6692-96BA-4198-8399-145D7D1D0D0E}", MSIINSTALLCONTEXT_MACHINE, NULL); delete_component_path("{1D2CE6F3-E81C-4949-AB81-78D7DAD2AF2E}", @@ -5999,6 +6125,12 @@ static void test_appsearch_complocator(void) MSIINSTALLCONTEXT_MACHINE, NULL); delete_component_path("{91B7359B-07F2-4221-AA8D-DE102BB87A5F}", MSIINSTALLCONTEXT_MACHINE, NULL); + delete_component_path("{4A2E1B5B-4034-4177-833B-8CC35F1B3EF1}", + MSIINSTALLCONTEXT_MACHINE, NULL); + delete_component_path("{A204DF48-7346-4635-BA2E-66247DBAC9DF}", + MSIINSTALLCONTEXT_MACHINE, NULL); + delete_component_path("{EC30CE73-4CF9-4908-BABD-1ED82E1515FD}", + MSIINSTALLCONTEXT_MACHINE, NULL); DeleteFileA("FileName1"); DeleteFileA("FileName2"); @@ -6007,6 +6139,9 @@ static void test_appsearch_complocator(void) DeleteFileA("FileName5"); DeleteFileA("FileName6"); DeleteFileA("FileName7"); + DeleteFileA("FileName8.dll"); + DeleteFileA("FileName9.dll"); + DeleteFileA("FileName10.dll"); MsiCloseHandle(hpkg); DeleteFileA(msifile); } @@ -6018,12 +6153,20 @@ static void test_appsearch_reglocator(void) CHAR prop[MAX_PATH]; DWORD binary[2]; DWORD size, val; + BOOL space, version; HKEY hklm, classes; HKEY hkcu, users; LPCSTR str; + LPSTR ptr; LONG res; UINT r; + version = TRUE; + if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3))) + version = FALSE; + + DeleteFileA("test.dll"); + res = RegCreateKeyA(HKEY_CLASSES_ROOT, "Software\\Wine", &classes); ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); @@ -6038,12 +6181,18 @@ static void test_appsearch_reglocator(void) (const BYTE *)"regszdata", 10); ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); + users = 0; res = RegCreateKeyA(HKEY_USERS, "S-1-5-18\\Software\\Wine", &users); - ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); + ok(res == ERROR_SUCCESS || + broken(res == ERROR_INVALID_PARAMETER), + "Expected ERROR_SUCCESS, got %d\n", res); - res = RegSetValueExA(users, "Value1", 0, REG_SZ, - (const BYTE *)"regszdata", 10); - ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); + if (res == ERROR_SUCCESS) + { + res = RegSetValueExA(users, "Value1", 0, REG_SZ, + (const BYTE *)"regszdata", 10); + ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); + } res = RegCreateKeyA(HKEY_LOCAL_MACHINE, "Software\\Wine", &hklm); ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); @@ -6107,6 +6256,33 @@ static void test_appsearch_reglocator(void) (const BYTE *)"", 1); ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); + create_file_with_version("FileName3.dll", MAKELONG(2, 1), MAKELONG(4, 3)); + sprintf(path, "%s\\FileName3.dll", CURR_DIR); + res = RegSetValueExA(hklm, "Value13", 0, REG_SZ, + (const BYTE *)path, lstrlenA(path) + 1); + ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); + + create_file_with_version("FileName4.dll", MAKELONG(1, 2), MAKELONG(3, 4)); + sprintf(path, "%s\\FileName4.dll", CURR_DIR); + res = RegSetValueExA(hklm, "Value14", 0, REG_SZ, + (const BYTE *)path, lstrlenA(path) + 1); + ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); + + create_file_with_version("FileName5.dll", MAKELONG(2, 1), MAKELONG(4, 3)); + sprintf(path, "%s\\FileName5.dll", CURR_DIR); + res = RegSetValueExA(hklm, "Value15", 0, REG_SZ, + (const BYTE *)path, lstrlenA(path) + 1); + ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", res); + + sprintf(path, "\"%s\\FileName1\" -option", CURR_DIR); + res = RegSetValueExA(hklm, "value16", 0, REG_SZ, + (const BYTE *)path, lstrlenA(path) + 1); + + space = (strchr(CURR_DIR, ' ')) ? TRUE : FALSE; + sprintf(path, "%s\\FileName1 -option", CURR_DIR); + res = RegSetValueExA(hklm, "value17", 0, REG_SZ, + (const BYTE *)path, lstrlenA(path) + 1); + hdb = create_package_db(); ok(hdb, "Expected a valid database handle\n"); @@ -6170,7 +6346,37 @@ static void test_appsearch_reglocator(void) r = add_appsearch_entry(hdb, "'SIGPROP19', 'NewSignature19'"); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - r = add_appsearch_entry(hdb, "'SIGPROP20', 'NewSignatur20'"); + r = add_appsearch_entry(hdb, "'SIGPROP20', 'NewSignature20'"); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + r = add_appsearch_entry(hdb, "'SIGPROP21', 'NewSignature21'"); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + r = add_appsearch_entry(hdb, "'SIGPROP22', 'NewSignature22'"); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + r = add_appsearch_entry(hdb, "'SIGPROP23', 'NewSignature23'"); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + r = add_appsearch_entry(hdb, "'SIGPROP24', 'NewSignature24'"); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + r = add_appsearch_entry(hdb, "'SIGPROP25', 'NewSignature25'"); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + r = add_appsearch_entry(hdb, "'SIGPROP26', 'NewSignature26'"); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + r = add_appsearch_entry(hdb, "'SIGPROP27', 'NewSignature27'"); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + r = add_appsearch_entry(hdb, "'SIGPROP28', 'NewSignature28'"); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + r = add_appsearch_entry(hdb, "'SIGPROP29', 'NewSignature29'"); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + r = add_appsearch_entry(hdb, "'SIGPROP30', 'NewSignature30'"); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); r = create_reglocator_table(hdb); @@ -6216,12 +6422,12 @@ static void test_appsearch_reglocator(void) r = add_reglocator_entry(hdb, str); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - /* HKLM, msidbLocatorTypeFileName, file exists */ + /* HKLM, msidbLocatorTypeFileName, signature, file exists */ str = "'NewSignature9', 2, 'Software\\Wine', 'Value9', 1"; r = add_reglocator_entry(hdb, str); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - /* HKLM, msidbLocatorTypeFileName, file does not exist */ + /* HKLM, msidbLocatorTypeFileName, signature, file does not exist */ str = "'NewSignature10', 2, 'Software\\Wine', 'Value10', 1"; r = add_reglocator_entry(hdb, str); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); @@ -6231,17 +6437,17 @@ static void test_appsearch_reglocator(void) r = add_reglocator_entry(hdb, str); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - /* HKLM, msidbLocatorTypeDirectory, file exists */ + /* HKLM, msidbLocatorTypeDirectory, no signature, file exists */ str = "'NewSignature12', 2, 'Software\\Wine', 'Value9', 0"; r = add_reglocator_entry(hdb, str); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - /* HKLM, msidbLocatorTypeDirectory, directory */ + /* HKLM, msidbLocatorTypeDirectory, no signature, directory exists */ str = "'NewSignature13', 2, 'Software\\Wine', 'Value11', 0"; r = add_reglocator_entry(hdb, str); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - /* HKLM, msidbLocatorTypeDirectory, file exists, with signature */ + /* HKLM, msidbLocatorTypeDirectory, signature, file exists */ str = "'NewSignature14', 2, 'Software\\Wine', 'Value9', 0"; r = add_reglocator_entry(hdb, str); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); @@ -6276,6 +6482,56 @@ static void test_appsearch_reglocator(void) r = add_reglocator_entry(hdb, str); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + /* HKLM, msidbLocatorTypeFileName, signature, file exists w/ version */ + str = "'NewSignature21', 2, 'Software\\Wine', 'Value13', 1"; + r = add_reglocator_entry(hdb, str); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + /* HKLM, msidbLocatorTypeFileName, file exists w/ version, version > max */ + str = "'NewSignature22', 2, 'Software\\Wine', 'Value14', 1"; + r = add_reglocator_entry(hdb, str); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + /* HKLM, msidbLocatorTypeFileName, file exists w/ version, sig->name ignored */ + str = "'NewSignature23', 2, 'Software\\Wine', 'Value15', 1"; + r = add_reglocator_entry(hdb, str); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + /* HKLM, msidbLocatorTypeFileName, no signature, directory exists */ + str = "'NewSignature24', 2, 'Software\\Wine', 'Value11', 1"; + r = add_reglocator_entry(hdb, str); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + /* HKLM, msidbLocatorTypeFileName, no signature, file does not exist */ + str = "'NewSignature25', 2, 'Software\\Wine', 'Value10', 1"; + r = add_reglocator_entry(hdb, str); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + /* HKLM, msidbLocatorTypeDirectory, signature, directory exists */ + str = "'NewSignature26', 2, 'Software\\Wine', 'Value11', 0"; + r = add_reglocator_entry(hdb, str); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + /* HKLM, msidbLocatorTypeDirectory, signature, file does not exist */ + str = "'NewSignature27', 2, 'Software\\Wine', 'Value10', 0"; + r = add_reglocator_entry(hdb, str); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + /* HKLM, msidbLocatorTypeDirectory, no signature, file does not exist */ + str = "'NewSignature28', 2, 'Software\\Wine', 'Value10', 0"; + r = add_reglocator_entry(hdb, str); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + /* HKLM, msidbLocatorTypeFile, file exists, in quotes */ + str = "'NewSignature29', 2, 'Software\\Wine', 'Value16', 1"; + r = add_reglocator_entry(hdb, str); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + /* HKLM, msidbLocatorTypeFile, file exists, no quotes */ + str = "'NewSignature30', 2, 'Software\\Wine', 'Value17', 1"; + r = add_reglocator_entry(hdb, str); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + r = create_signature_table(hdb); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); @@ -6291,6 +6547,35 @@ static void test_appsearch_reglocator(void) r = add_signature_entry(hdb, str); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + str = "'NewSignature21', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''"; + r = add_signature_entry(hdb, str); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + str = "'NewSignature22', 'FileName4.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''"; + r = add_signature_entry(hdb, str); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + str = "'NewSignature23', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''"; + r = add_signature_entry(hdb, str); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + ptr = strrchr(CURR_DIR, '\\') + 1; + sprintf(path, "'NewSignature26', '%s', '', '', '', '', '', '', ''", ptr); + r = add_signature_entry(hdb, path); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + str = "'NewSignature27', 'FileName2', '', '', '', '', '', '', ''"; + r = add_signature_entry(hdb, str); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + str = "'NewSignature29', 'FileName1', '', '', '', '', '', '', ''"; + r = add_signature_entry(hdb, str); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + str = "'NewSignature30', 'FileName1', '', '', '', '', '', '', ''"; + r = add_signature_entry(hdb, str); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + hpkg = package_from_db(hdb); ok(hpkg, "Expected a valid package handle\n"); @@ -6356,19 +6641,13 @@ static void test_appsearch_reglocator(void) size = MAX_PATH; r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - todo_wine - { - ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop); - } + ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop); size = MAX_PATH; sprintf(path, "%s\\", CURR_DIR); r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - todo_wine - { - ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop); - } + ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop); size = MAX_PATH; r = MsiGetPropertyA(hpkg, "SIGPROP12", prop, &size); @@ -6398,11 +6677,14 @@ static void test_appsearch_reglocator(void) ok(!lstrcmpA(prop, "regszdata"), "Expected \"regszdata\", got \"%s\"\n", prop); - size = MAX_PATH; - r = MsiGetPropertyA(hpkg, "SIGPROP17", prop, &size); - ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - ok(!lstrcmpA(prop, "regszdata"), - "Expected \"regszdata\", got \"%s\"\n", prop); + if (users) + { + size = MAX_PATH; + r = MsiGetPropertyA(hpkg, "SIGPROP17", prop, &size); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok(!lstrcmpA(prop, "regszdata"), + "Expected \"regszdata\", got \"%s\"\n", prop); + } size = MAX_PATH; r = MsiGetPropertyA(hpkg, "SIGPROP18", prop, &size); @@ -6420,6 +6702,70 @@ static void test_appsearch_reglocator(void) ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop); + if (version) + { + size = MAX_PATH; + sprintf(path, "%s\\FileName3.dll", CURR_DIR); + r = MsiGetPropertyA(hpkg, "SIGPROP21", prop, &size); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop); + + size = MAX_PATH; + r = MsiGetPropertyA(hpkg, "SIGPROP22", prop, &size); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop); + + size = MAX_PATH; + sprintf(path, "%s\\FileName5.dll", CURR_DIR); + r = MsiGetPropertyA(hpkg, "SIGPROP23", prop, &size); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop); + } + + size = MAX_PATH; + lstrcpyA(path, CURR_DIR); + ptr = strrchr(path, '\\') + 1; + *ptr = '\0'; + r = MsiGetPropertyA(hpkg, "SIGPROP24", prop, &size); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop); + + size = MAX_PATH; + sprintf(path, "%s\\", CURR_DIR); + r = MsiGetPropertyA(hpkg, "SIGPROP25", prop, &size); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop); + + size = MAX_PATH; + r = MsiGetPropertyA(hpkg, "SIGPROP26", prop, &size); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop); + + size = MAX_PATH; + r = MsiGetPropertyA(hpkg, "SIGPROP27", prop, &size); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop); + + size = MAX_PATH; + r = MsiGetPropertyA(hpkg, "SIGPROP28", prop, &size); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop); + + size = MAX_PATH; + sprintf(path, "%s\\FileName1", CURR_DIR); + r = MsiGetPropertyA(hpkg, "SIGPROP29", prop, &size); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop); + + size = MAX_PATH; + sprintf(path, "%s\\FileName1", CURR_DIR); + r = MsiGetPropertyA(hpkg, "SIGPROP30", prop, &size); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + if (space) + ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop); + else + todo_wine ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop); + RegSetValueA(hklm, NULL, REG_SZ, "", 0); RegDeleteValueA(hklm, "Value1"); RegDeleteValueA(hklm, "Value2"); @@ -6433,6 +6779,11 @@ static void test_appsearch_reglocator(void) RegDeleteValueA(hklm, "Value10"); RegDeleteValueA(hklm, "Value11"); RegDeleteValueA(hklm, "Value12"); + RegDeleteValueA(hklm, "Value13"); + RegDeleteValueA(hklm, "Value14"); + RegDeleteValueA(hklm, "Value15"); + RegDeleteValueA(hklm, "Value16"); + RegDeleteValueA(hklm, "Value17"); RegDeleteKeyA(hklm, ""); RegCloseKey(hklm); @@ -6449,6 +6800,9 @@ static void test_appsearch_reglocator(void) RegCloseKey(users); DeleteFileA("FileName1"); + DeleteFileA("FileName3.dll"); + DeleteFileA("FileName4.dll"); + DeleteFileA("FileName5.dll"); MsiCloseHandle(hpkg); DeleteFileA(msifile); } @@ -6469,11 +6823,18 @@ static void test_appsearch_inilocator(void) MSIHANDLE hpkg, hdb; CHAR path[MAX_PATH]; CHAR prop[MAX_PATH]; + BOOL version; LPCSTR str; LPSTR ptr; DWORD size; UINT r; + version = TRUE; + if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3))) + version = FALSE; + + DeleteFileA("test.dll"); + WritePrivateProfileStringA("Section", "Key", "keydata,field2", "IniFile.ini"); create_test_file("FileName1"); @@ -6485,6 +6846,18 @@ static void test_appsearch_inilocator(void) sprintf(path, "%s\\IDontExist", CURR_DIR); WritePrivateProfileStringA("Section", "Key4", path, "IniFile.ini"); + create_file_with_version("FileName2.dll", MAKELONG(2, 1), MAKELONG(4, 3)); + sprintf(path, "%s\\FileName2.dll", CURR_DIR); + WritePrivateProfileStringA("Section", "Key5", path, "IniFile.ini"); + + create_file_with_version("FileName3.dll", MAKELONG(1, 2), MAKELONG(3, 4)); + sprintf(path, "%s\\FileName3.dll", CURR_DIR); + WritePrivateProfileStringA("Section", "Key6", path, "IniFile.ini"); + + create_file_with_version("FileName4.dll", MAKELONG(2, 1), MAKELONG(4, 3)); + sprintf(path, "%s\\FileName4.dll", CURR_DIR); + WritePrivateProfileStringA("Section", "Key7", path, "IniFile.ini"); + hdb = create_package_db(); ok(hdb, "Expected a valid database handle\n"); @@ -6518,6 +6891,15 @@ static void test_appsearch_inilocator(void) r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'"); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'"); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + r = add_appsearch_entry(hdb, "'SIGPROP11', 'NewSignature11'"); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + r = add_appsearch_entry(hdb, "'SIGPROP12', 'NewSignature12'"); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + r = create_inilocator_table(hdb); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); @@ -6566,6 +6948,21 @@ static void test_appsearch_inilocator(void) r = add_inilocator_entry(hdb, str); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + /* msidbLocatorTypeFile, signature with version */ + str = "'NewSignature10', 'IniFile.ini', 'Section', 'Key5', 1, 1"; + r = add_inilocator_entry(hdb, str); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + /* msidbLocatorTypeFile, signature with version, ver > max */ + str = "'NewSignature11', 'IniFile.ini', 'Section', 'Key6', 1, 1"; + r = add_inilocator_entry(hdb, str); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + /* msidbLocatorTypeFile, signature with version, sig->name ignored */ + str = "'NewSignature12', 'IniFile.ini', 'Section', 'Key7', 1, 1"; + r = add_inilocator_entry(hdb, str); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + r = create_signature_table(hdb); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); @@ -6575,6 +6972,15 @@ static void test_appsearch_inilocator(void) r = add_signature_entry(hdb, "'NewSignature9', 'IDontExist', '', '', '', '', '', '', ''"); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + r = add_signature_entry(hdb, "'NewSignature10', 'FileName2.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''"); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + r = add_signature_entry(hdb, "'NewSignature11', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''"); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + r = add_signature_entry(hdb, "'NewSignature12', 'ignored', '1.1.1.1', '2.1.1.1', '', '', '', '', ''"); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + hpkg = package_from_db(hdb); ok(hpkg, "Expected a valid package handle\n"); @@ -6584,18 +6990,12 @@ static void test_appsearch_inilocator(void) size = MAX_PATH; r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - todo_wine - { - ok(!lstrcmpA(prop, "keydata"), "Expected \"keydata\", got \"%s\"\n", prop); - } + ok(!lstrcmpA(prop, "keydata"), "Expected \"keydata\", got \"%s\"\n", prop); size = MAX_PATH; r = MsiGetPropertyA(hpkg, "SIGPROP2", prop, &size); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - todo_wine - { - ok(!lstrcmpA(prop, "field2"), "Expected \"field2\", got \"%s\"\n", prop); - } + ok(!lstrcmpA(prop, "field2"), "Expected \"field2\", got \"%s\"\n", prop); size = MAX_PATH; r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size); @@ -6607,10 +7007,7 @@ static void test_appsearch_inilocator(void) sprintf(path, "%s\\FileName1", CURR_DIR); r = MsiGetPropertyA(hpkg, "SIGPROP4", prop, &size); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - todo_wine - { - ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop); - } + ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop); size = MAX_PATH; r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size); @@ -6621,19 +7018,13 @@ static void test_appsearch_inilocator(void) sprintf(path, "%s\\", CURR_DIR); r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - todo_wine - { - ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop); - } + ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop); size = MAX_PATH; sprintf(path, "%s\\", CURR_DIR); r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - todo_wine - { - ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop); - } + ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop); size = MAX_PATH; lstrcpyA(path, CURR_DIR); @@ -6641,18 +7032,38 @@ static void test_appsearch_inilocator(void) *(ptr + 1) = '\0'; r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - todo_wine - { - ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop); - } + ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop); size = MAX_PATH; r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop); + if (version) + { + size = MAX_PATH; + sprintf(path, "%s\\FileName2.dll", CURR_DIR); + r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop); + + size = MAX_PATH; + r = MsiGetPropertyA(hpkg, "SIGPROP11", prop, &size); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop); + + size = MAX_PATH; + sprintf(path, "%s\\FileName4.dll", CURR_DIR); + r = MsiGetPropertyA(hpkg, "SIGPROP12", prop, &size); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop); + } + delete_win_ini("IniFile.ini"); DeleteFileA("FileName1"); + DeleteFileA("FileName2.dll"); + DeleteFileA("FileName3.dll"); + DeleteFileA("FileName4.dll"); MsiCloseHandle(hpkg); DeleteFileA(msifile); } @@ -6662,16 +7073,26 @@ static void test_appsearch_drlocator(void) MSIHANDLE hpkg, hdb; CHAR path[MAX_PATH]; CHAR prop[MAX_PATH]; + BOOL version; LPCSTR str; DWORD size; UINT r; + version = TRUE; + if (!create_file_with_version("test.dll", MAKELONG(2, 1), MAKELONG(4, 3))) + version = FALSE; + + DeleteFileA("test.dll"); + create_test_file("FileName1"); CreateDirectoryA("one", NULL); CreateDirectoryA("one\\two", NULL); CreateDirectoryA("one\\two\\three", NULL); create_test_file("one\\two\\three\\FileName2"); CreateDirectoryA("another", NULL); + create_file_with_version("FileName3.dll", MAKELONG(2, 1), MAKELONG(4, 3)); + create_file_with_version("FileName4.dll", MAKELONG(1, 2), MAKELONG(3, 4)); + create_file_with_version("FileName5.dll", MAKELONG(2, 1), MAKELONG(4, 3)); hdb = create_package_db(); ok(hdb, "Expected a valid database handle\n"); @@ -6700,6 +7121,15 @@ static void test_appsearch_drlocator(void) r = add_appsearch_entry(hdb, "'SIGPROP7', 'NewSignature7'"); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + r = add_appsearch_entry(hdb, "'SIGPROP8', 'NewSignature8'"); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + r = add_appsearch_entry(hdb, "'SIGPROP9', 'NewSignature9'"); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + r = add_appsearch_entry(hdb, "'SIGPROP10', 'NewSignature10'"); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + r = create_drlocator_table(hdb); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); @@ -6738,6 +7168,21 @@ static void test_appsearch_drlocator(void) r = add_drlocator_entry(hdb, path); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + /* no parent, full path, depth 0, signature w/ version */ + sprintf(path, "'NewSignature8', '', '%s', 0", CURR_DIR); + r = add_drlocator_entry(hdb, path); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + /* no parent, full path, depth 0, signature w/ version, ver > max */ + sprintf(path, "'NewSignature9', '', '%s', 0", CURR_DIR); + r = add_drlocator_entry(hdb, path); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + /* no parent, full path, depth 0, signature w/ version, sig->name not ignored */ + sprintf(path, "'NewSignature10', '', '%s', 0", CURR_DIR); + r = add_drlocator_entry(hdb, path); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + r = create_signature_table(hdb); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); @@ -6761,6 +7206,18 @@ static void test_appsearch_drlocator(void) r = add_signature_entry(hdb, str); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + str = "'NewSignature8', 'FileName3.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''"; + r = add_signature_entry(hdb, str); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + str = "'NewSignature9', 'FileName4.dll', '1.1.1.1', '2.1.1.1', '', '', '', '', ''"; + r = add_signature_entry(hdb, str); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + + str = "'NewSignature10', 'necessary', '1.1.1.1', '2.1.1.1', '', '', '', '', ''"; + r = add_signature_entry(hdb, str); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + hpkg = package_from_db(hdb); ok(hpkg, "Expected a valid package handle\n"); @@ -6771,10 +7228,7 @@ static void test_appsearch_drlocator(void) sprintf(path, "%s\\FileName1", CURR_DIR); r = MsiGetPropertyA(hpkg, "SIGPROP1", prop, &size); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - todo_wine - { - ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop); - } + ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop); size = MAX_PATH; sprintf(path, "%s\\", CURR_DIR); @@ -6791,38 +7245,48 @@ static void test_appsearch_drlocator(void) size = MAX_PATH; r = MsiGetPropertyA(hpkg, "SIGPROP4", prop, &size); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - todo_wine - { - ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop); - } + ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop); size = MAX_PATH; sprintf(path, "%s\\one\\two\\three\\FileName2", CURR_DIR); r = MsiGetPropertyA(hpkg, "SIGPROP5", prop, &size); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - todo_wine - { - ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop); - } + ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop); size = MAX_PATH; r = MsiGetPropertyA(hpkg, "SIGPROP6", prop, &size); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - todo_wine - { - ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop); - } + ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop); size = MAX_PATH; sprintf(path, "%s\\one\\two\\three\\FileName2", CURR_DIR); r = MsiGetPropertyA(hpkg, "SIGPROP7", prop, &size); ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); - todo_wine + ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop); + + if (version) { + size = MAX_PATH; + sprintf(path, "%s\\FileName3.dll", CURR_DIR); + r = MsiGetPropertyA(hpkg, "SIGPROP8", prop, &size); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop); + + size = MAX_PATH; + r = MsiGetPropertyA(hpkg, "SIGPROP9", prop, &size); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop); + + size = MAX_PATH; + r = MsiGetPropertyA(hpkg, "SIGPROP10", prop, &size); + ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r); + ok(!lstrcmpA(prop, ""), "Expected \"\", got \"%s\"\n", prop); } DeleteFileA("FileName1"); + DeleteFileA("FileName3.dll"); + DeleteFileA("FileName4.dll"); + DeleteFileA("FileName5.dll"); DeleteFileA("one\\two\\three\\FileName2"); RemoveDirectoryA("one\\two\\three"); RemoveDirectoryA("one\\two"); diff --git a/dlls/msi/where.c b/dlls/msi/where.c index 28f115e0fff..65f1be979f6 100644 --- a/dlls/msi/where.c +++ b/dlls/msi/where.c @@ -180,7 +180,7 @@ static UINT WHERE_get_row( struct tagMSIVIEW *view, UINT row, MSIRECORD **rec ) if (r != ERROR_SUCCESS) return r; - return wv->table->ops->get_row(view, row, rec); + return wv->table->ops->get_row(wv->table, row, rec); } static UINT WHERE_set_row( struct tagMSIVIEW *view, UINT row, MSIRECORD *rec, UINT mask ) diff --git a/dlls/msrle32/msrle32.c b/dlls/msrle32/msrle32.c index e5d2d5be603..41ad22eb732 100644 --- a/dlls/msrle32/msrle32.c +++ b/dlls/msrle32/msrle32.c @@ -1,5 +1,5 @@ /* - * Copyright 2002-2003 Michael Günnewig + * Copyright 2002-2003 Michael Günnewig * * 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/msrle32/msrle_private.h b/dlls/msrle32/msrle_private.h index c055b5cb6fa..bf2aed03213 100644 --- a/dlls/msrle32/msrle_private.h +++ b/dlls/msrle32/msrle_private.h @@ -1,5 +1,5 @@ /* - * Copyright 2002 Michael Günnewig + * Copyright 2002 Michael Günnewig * * 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/msvcrt/console.c b/dlls/msvcrt/console.c index 21bcf1683b0..267e0e1f748 100644 --- a/dlls/msvcrt/console.c +++ b/dlls/msvcrt/console.c @@ -121,7 +121,7 @@ int CDECL _getch(void) do { if (ReadConsoleInputA(MSVCRT_console_in, &ir, 1, &count)) { - int i; + unsigned int i; /* Only interested in ASCII chars */ if (ir.EventType == KEY_EVENT && ir.Event.KeyEvent.bKeyDown) diff --git a/dlls/msvcrt/except.c b/dlls/msvcrt/except.c index 296c6560213..adcd18c0bed 100644 --- a/dlls/msvcrt/except.c +++ b/dlls/msvcrt/except.c @@ -478,7 +478,8 @@ static LONG WINAPI msvcrt_exception_filter(struct _EXCEPTION_POINTERS *except) { if (handler != MSVCRT_SIG_IGN) { - int i, float_signal = _FPE_INVALID; + unsigned int i; + int float_signal = _FPE_INVALID; sighandlers[MSVCRT_SIGFPE] = MSVCRT_SIG_DFL; for (i = 0; i < sizeof(float_exception_map) / diff --git a/dlls/msvcrt/file.c b/dlls/msvcrt/file.c index c78e46c5c70..7c0f74d35d7 100644 --- a/dlls/msvcrt/file.c +++ b/dlls/msvcrt/file.c @@ -1686,7 +1686,7 @@ static int read_i(int fd, void *buf, unsigned int count) { if (MSVCRT_fdesc[fd].wxflag & WX_TEXT) { - int i; + DWORD i; /* in text mode, a ctrl-z signals EOF */ for (i=0; i_file].wxflag & WX_TEXT)) { MSVCRT_wchar_t wc; - int i,j; + unsigned int i; + int j; char *chp, *wcp; wcp = (char *)&wc; for(i=0; iusri1_comment[0] = 0; usr->usri1_flags = UF_SCRIPT | UF_NORMAL_ACCOUNT | UF_DONT_EXPIRE_PASSWD; usr->usri1_full_name[0] = 0; - usr->usri1_user_id = 500; + usr->usri1_user_id = DOMAIN_USER_RID_ADMIN; usr->usri1_next_index = 0; } @@ -554,7 +554,7 @@ static void ACCESS_QueryGuestDisplayInformation(PNET_DISPLAY_USER *buf, PDWORD p usr->usri1_flags = UF_ACCOUNTDISABLE | UF_SCRIPT | UF_NORMAL_ACCOUNT | UF_DONT_EXPIRE_PASSWD; usr->usri1_full_name[0] = 0; - usr->usri1_user_id = 500; + usr->usri1_user_id = DOMAIN_USER_RID_GUEST; usr->usri1_next_index = 0; } diff --git a/dlls/netapi32/tests/access.c b/dlls/netapi32/tests/access.c index 3999bdd33ef..1cc71b9a8f4 100644 --- a/dlls/netapi32/tests/access.c +++ b/dlls/netapi32/tests/access.c @@ -170,9 +170,7 @@ static void run_usergetinfo_tests(void) trace("Deleting the test user failed. You might have to manually delete it.\n"); } -/* checks Level 1 of NetQueryDisplayInformation - * FIXME: Needs to be rewritten to not depend on the spelling of the users, - * ideally based on the admin and guest user SIDs/RIDs.*/ +/* Checks Level 1 of NetQueryDisplayInformation */ static void run_querydisplayinformation1_tests(void) { PNET_DISPLAY_USER Buffer, rec; @@ -180,9 +178,6 @@ static void run_querydisplayinformation1_tests(void) DWORD i = 0; BOOL hasAdmin = FALSE; BOOL hasGuest = FALSE; - static const WCHAR sAdminUserName[] = {'A','d','m','i','n','i','s','t','r','a', - 't','o','r',0}; - static const WCHAR sGuestUserName[] = {'G','u','e','s','t',0}; do { @@ -195,14 +190,14 @@ static void run_querydisplayinformation1_tests(void) rec = Buffer; for(; EntryCount > 0; EntryCount--) { - if (!lstrcmpW(rec->usri1_name, sAdminUserName)) + if (rec->usri1_user_id == DOMAIN_USER_RID_ADMIN) { ok(!hasAdmin, "One admin user\n"); ok(rec->usri1_flags & UF_SCRIPT, "UF_SCRIPT flag is set\n"); ok(rec->usri1_flags & UF_NORMAL_ACCOUNT, "UF_NORMAL_ACCOUNT flag is set\n"); hasAdmin = TRUE; } - else if (!lstrcmpW(rec->usri1_name, sGuestUserName)) + else if (rec->usri1_user_id == DOMAIN_USER_RID_GUEST) { ok(!hasGuest, "One guest record\n"); ok(rec->usri1_flags & UF_SCRIPT, "UF_SCRIPT flag is set\n"); diff --git a/dlls/ntdll/actctx.c b/dlls/ntdll/actctx.c index 80e9e03098c..f1f9ad773c2 100644 --- a/dlls/ntdll/actctx.c +++ b/dlls/ntdll/actctx.c @@ -2028,12 +2028,14 @@ static NTSTATUS parse_depend_manifests(struct actctx_loader* acl) } /* find the appropriate activation context for RtlQueryInformationActivationContext */ -static NTSTATUS find_query_actctx( HANDLE *handle, DWORD flags ) +static NTSTATUS find_query_actctx( HANDLE *handle, DWORD flags, ULONG class ) { NTSTATUS status = STATUS_SUCCESS; if (flags & QUERY_ACTCTX_FLAG_USE_ACTIVE_ACTCTX) { + if (*handle) return STATUS_INVALID_PARAMETER; + if (NtCurrentTeb()->ActivationContextStack.ActiveFrame) *handle = NtCurrentTeb()->ActivationContextStack.ActiveFrame->ActivationContext; } @@ -2042,6 +2044,8 @@ static NTSTATUS find_query_actctx( HANDLE *handle, DWORD flags ) ULONG magic; LDR_MODULE *pldr; + if (!*handle) return STATUS_INVALID_PARAMETER; + LdrLockLoaderLock( 0, NULL, &magic ); if (!LdrFindEntryForAddress( *handle, &pldr )) { @@ -2053,7 +2057,8 @@ static NTSTATUS find_query_actctx( HANDLE *handle, DWORD flags ) else status = STATUS_DLL_NOT_FOUND; LdrUnlockLoaderLock( 0, magic ); } - else if (!*handle) *handle = process_actctx; + else if (!*handle && (class != ActivationContextBasicInformation)) + *handle = process_actctx; return status; } @@ -2430,7 +2435,8 @@ NTSTATUS WINAPI RtlQueryInformationActivationContext( ULONG flags, HANDLE handle TRACE("%08x %p %p %u %p %ld %p\n", flags, handle, subinst, class, buffer, bufsize, retlen); - if ((status = find_query_actctx( &handle, flags ))) return status; + if (retlen) *retlen = 0; + if ((status = find_query_actctx( &handle, flags, class ))) return status; switch (class) { diff --git a/dlls/ntdll/cdrom.c b/dlls/ntdll/cdrom.c index f6fed814eb3..998b2dca5b9 100644 --- a/dlls/ntdll/cdrom.c +++ b/dlls/ntdll/cdrom.c @@ -1370,7 +1370,7 @@ static NTSTATUS CDROM_RawRead(int fd, const RAW_READ_INFO* raw, void* buffer, DW DWORD lba = raw->DiskOffset.QuadPart >> 11; struct cdrom_msf* msf; PBYTE *bp; /* current buffer pointer */ - int i; + DWORD i; if ((lba + raw->SectorCount) > ((1 << 8*sizeof(msf->cdmsf_min0)) * CD_SECS * CD_FRAMES diff --git a/dlls/ntdll/debugbuffer.c b/dlls/ntdll/debugbuffer.c index be1ddffc1da..0ad8882c267 100644 --- a/dlls/ntdll/debugbuffer.c +++ b/dlls/ntdll/debugbuffer.c @@ -96,7 +96,7 @@ PDEBUG_BUFFER WINAPI RtlCreateQueryDebugBuffer(IN ULONG iSize, IN BOOLEAN iEvent if (iSize < sizeof(DEBUG_BUFFER)) { iSize = sizeof(DEBUG_BUFFER); } - oBuf = (PDEBUG_BUFFER) RtlAllocateHeap(GetProcessHeap(), 0, iSize); + oBuf = RtlAllocateHeap(GetProcessHeap(), 0, iSize); memset(oBuf, 0, iSize); FIXME("(%d, %d): returning %p\n", iSize, iEventPair, oBuf); return oBuf; diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c index 0e99c4f6661..dee0ce6ea5b 100644 --- a/dlls/ntdll/directory.c +++ b/dlls/ntdll/directory.c @@ -24,7 +24,9 @@ #include "wine/port.h" #include -#include +#ifdef HAVE_DIRENT_H +# include +#endif #include #include #include diff --git a/dlls/ntdll/heap.c b/dlls/ntdll/heap.c index 039a3cfb078..d18489cc2a1 100644 --- a/dlls/ntdll/heap.c +++ b/dlls/ntdll/heap.c @@ -257,7 +257,7 @@ static RTL_CRITICAL_SECTION_DEBUG process_heap_critsect_debug = */ static void HEAP_Dump( HEAP *heap ) { - int i; + unsigned int i; SUBHEAP *subheap; char *ptr; @@ -621,7 +621,7 @@ static SUBHEAP *HEAP_InitSubHeap( HEAP *heap, LPVOID address, DWORD flags, { SUBHEAP *subheap; FREE_LIST_ENTRY *pEntry; - int i; + unsigned int i; /* Commit memory */ @@ -822,7 +822,7 @@ static ARENA_FREE *HEAP_FindFreeBlock( HEAP *heap, SIZE_T size, */ static BOOL HEAP_IsValidArenaPtr( const HEAP *heap, const ARENA_FREE *ptr ) { - int i; + unsigned int i; const SUBHEAP *subheap = HEAP_FindSubHeap( heap, ptr ); if (!subheap) return FALSE; if ((const char *)ptr >= (const char *)subheap->base + subheap->headerSize) return TRUE; diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c index 3ca17555dbf..a8365dc9c95 100644 --- a/dlls/ntdll/nt.c +++ b/dlls/ntdll/nt.c @@ -37,6 +37,12 @@ #include "ntdll_misc.h" #include "wine/server.h" +#ifdef __APPLE__ +#include +#include +#include +#endif + WINE_DEFAULT_DEBUG_CHANNEL(ntdll); /* @@ -900,18 +906,122 @@ NTSTATUS WINAPI NtQuerySystemInformation( break; case SystemProcessorPerformanceInformation: { - SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION sppi; + SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION *sppi = NULL; + unsigned int cpus = 0; + int out_cpus = Length / sizeof(SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION); + + if (out_cpus == 0) + { + len = 0; + ret = STATUS_INFO_LENGTH_MISMATCH; + break; + } + else +#ifdef __APPLE__ + { + processor_cpu_load_info_data_t *pinfo; + mach_msg_type_number_t info_count; + + if (host_processor_info (mach_host_self (), + PROCESSOR_CPU_LOAD_INFO, + &cpus, + (processor_info_array_t*)&pinfo, + &info_count) == 0) + { + int i; + cpus = min(cpus,out_cpus); + len = sizeof(SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION) * cpus; + sppi = RtlAllocateHeap(GetProcessHeap(), 0,len); + for (i = 0; i < cpus; i++) + { + sppi[i].liIdleTime.QuadPart = pinfo[i].cpu_ticks[CPU_STATE_IDLE]; + sppi[i].liKernelTime.QuadPart = pinfo[i].cpu_ticks[CPU_STATE_SYSTEM]; + sppi[i].liUserTime.QuadPart = pinfo[i].cpu_ticks[CPU_STATE_USER]; + } + vm_deallocate (mach_task_self (), (vm_address_t) pinfo, info_count); + } + } +#else + { + FILE *cpuinfo = fopen("/proc/stat","r"); + if (cpuinfo) + { + unsigned usr,nice,sys; + unsigned long idle; + int count; + char name[10]; + + /* first line is combined usage */ + count = fscanf(cpuinfo,"%s %u %u %u %lu",name, &usr, &nice, + &sys, &idle); + /* we set this up in the for older non-smp enabled kernels */ + if (count == 5 && strcmp(name,"cpu")==0) + { + sppi = RtlAllocateHeap(GetProcessHeap(), 0, + sizeof(SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION)); + sppi->liIdleTime.QuadPart = idle; + sppi->liKernelTime.QuadPart = sys; + sppi->liUserTime.QuadPart = usr; + cpus = 1; + len = sizeof(SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION); + } + + do + { + count = fscanf(cpuinfo,"%s %u %u %u %lu",name, &usr, + &nice, &sys, &idle); + if (count == 5 && strncmp(name,"cpu",3)==0) + { + out_cpus --; + if (name[3]=='0') /* first cpu */ + { + sppi->liIdleTime.QuadPart = idle; + sppi->liKernelTime.QuadPart = sys; + sppi->liUserTime.QuadPart = usr; + } + else /* new cpu */ + { + len = sizeof(SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION) * (cpus+1); + sppi = RtlReAllocateHeap(GetProcessHeap(), 0, sppi, len); + sppi[cpus].liIdleTime.QuadPart = idle; + sppi[cpus].liKernelTime.QuadPart = sys; + sppi[cpus].liUserTime.QuadPart = usr; + cpus++; + } + } + else + break; + } while (out_cpus > 0); + fclose(cpuinfo); + } + } +#endif + + if (cpus == 0) + { + static int i = 1; + + sppi = RtlAllocateHeap(GetProcessHeap(),0,sizeof(SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION)); - memset(&sppi, 0 , sizeof(sppi)); /* FIXME */ - len = sizeof(sppi); + memset(sppi, 0 , sizeof(SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION)); + FIXME("stub info_class SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION\n"); + + /* many programs expect these values to change so fake change */ + len = sizeof(SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION); + sppi->liKernelTime.QuadPart = 1 * i; + sppi->liUserTime.QuadPart = 2 * i; + sppi->liIdleTime.QuadPart = 3 * i; + i++; + } if (Length >= len) { if (!SystemInformation) ret = STATUS_ACCESS_VIOLATION; - else memcpy( SystemInformation, &sppi, len); + else memcpy( SystemInformation, sppi, len); } else ret = STATUS_INFO_LENGTH_MISMATCH; - FIXME("info_class SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION\n"); + + RtlFreeHeap(GetProcessHeap(),0,sppi); } break; case SystemModuleInformation: diff --git a/dlls/ntdll/reg.c b/dlls/ntdll/reg.c index 425ddf84890..8aba3aea9cc 100644 --- a/dlls/ntdll/reg.c +++ b/dlls/ntdll/reg.c @@ -325,7 +325,7 @@ NTSTATUS WINAPI RtlpNtEnumerateSubKey( HANDLE handle, UNICODE_STRING *out, ULONG if (out->Length) { dwLen = out->Length + sizeof(KEY_BASIC_INFORMATION); - info = (KEY_BASIC_INFORMATION*)RtlAllocateHeap( GetProcessHeap(), 0, dwLen ); + info = RtlAllocateHeap( GetProcessHeap(), 0, dwLen ); if (!info) return STATUS_NO_MEMORY; } @@ -543,7 +543,7 @@ NTSTATUS WINAPI RtlpNtQueryValueKey( HANDLE handle, ULONG *result_type, PBYTE de DWORD dwResultLen; DWORD dwLen = sizeof (KEY_VALUE_PARTIAL_INFORMATION) + (result_len ? *result_len : 0); - info = (KEY_VALUE_PARTIAL_INFORMATION*)RtlAllocateHeap( GetProcessHeap(), 0, dwLen ); + info = RtlAllocateHeap( GetProcessHeap(), 0, dwLen ); if (!info) return STATUS_NO_MEMORY; @@ -899,7 +899,7 @@ static NTSTATUS RTL_ReportRegistryValue(PKEY_VALUE_FULL_INFORMATION pInfo, NTSTATUS status = STATUS_SUCCESS; ULONG len; LPWSTR String; - INT count = 0; + ULONG count = 0; if (pInfo == NULL) { @@ -1220,8 +1220,7 @@ NTSTATUS WINAPI RtlQueryRegistryValues(IN ULONG RelativeTo, IN PCWSTR Path, { buflen = len; RtlFreeHeap(GetProcessHeap(), 0, pInfo); - pInfo = (KEY_VALUE_FULL_INFORMATION*)RtlAllocateHeap( - GetProcessHeap(), 0, buflen); + pInfo = RtlAllocateHeap(GetProcessHeap(), 0, buflen); NtEnumerateValueKey(handle, i, KeyValueFullInformation, pInfo, buflen, &len); } @@ -1255,8 +1254,7 @@ NTSTATUS WINAPI RtlQueryRegistryValues(IN ULONG RelativeTo, IN PCWSTR Path, { buflen = len; RtlFreeHeap(GetProcessHeap(), 0, pInfo); - pInfo = (KEY_VALUE_FULL_INFORMATION*)RtlAllocateHeap( - GetProcessHeap(), 0, buflen); + pInfo = RtlAllocateHeap(GetProcessHeap(), 0, buflen); status = NtQueryValueKey(handle, &Value, KeyValueFullInformation, pInfo, buflen, &len); } diff --git a/dlls/ntdll/rtlstr.c b/dlls/ntdll/rtlstr.c index 0e985883307..de208a236f0 100644 --- a/dlls/ntdll/rtlstr.c +++ b/dlls/ntdll/rtlstr.c @@ -1511,8 +1511,7 @@ NTSTATUS WINAPI RtlFindCharInUnicodeString( const UNICODE_STRING *search_chars, /* [I] Unicode string which contains the characters to search for */ USHORT *pos) /* [O] Position of the first character found + 2 */ { - int main_idx; - unsigned int search_idx; + unsigned int main_idx, search_idx; switch (flags) { case 0: @@ -1527,7 +1526,8 @@ NTSTATUS WINAPI RtlFindCharInUnicodeString( *pos = 0; return STATUS_NOT_FOUND; case 1: - for (main_idx = main_str->Length / sizeof(WCHAR) - 1; main_idx >= 0; main_idx--) { + main_idx = main_str->Length / sizeof(WCHAR); + while (main_idx-- > 0) { for (search_idx = 0; search_idx < search_chars->Length / sizeof(WCHAR); search_idx++) { if (main_str->Buffer[main_idx] == search_chars->Buffer[search_idx]) { *pos = main_idx * sizeof(WCHAR); @@ -1552,7 +1552,8 @@ NTSTATUS WINAPI RtlFindCharInUnicodeString( *pos = 0; return STATUS_NOT_FOUND; case 3: - for (main_idx = main_str->Length / sizeof(WCHAR) - 1; main_idx >= 0; main_idx--) { + main_idx = main_str->Length / sizeof(WCHAR); + while (main_idx-- > 0) { search_idx = 0; while (search_idx < search_chars->Length / sizeof(WCHAR) && main_str->Buffer[main_idx] != search_chars->Buffer[search_idx]) { @@ -2125,7 +2126,7 @@ NTSTATUS WINAPI RtlStringFromGUID(const GUID* guid, UNICODE_STRING *str) str->Length = GUID_STRING_LENGTH * sizeof(WCHAR); str->MaximumLength = str->Length + sizeof(WCHAR); - str->Buffer = (WCHAR*)RtlAllocateHeap(GetProcessHeap(), 0, str->MaximumLength); + str->Buffer = RtlAllocateHeap(GetProcessHeap(), 0, str->MaximumLength); if (!str->Buffer) { str->Length = str->MaximumLength = 0; diff --git a/dlls/ntdll/sec.c b/dlls/ntdll/sec.c index af3a1380b94..97595a16c09 100644 --- a/dlls/ntdll/sec.c +++ b/dlls/ntdll/sec.c @@ -1052,8 +1052,24 @@ NTSTATUS WINAPI RtlSetControlSecurityDescriptor( SECURITY_DESCRIPTOR_CONTROL ControlBitsOfInterest, SECURITY_DESCRIPTOR_CONTROL ControlBitsToSet) { - FIXME("(%p 0x%08x 0x%08x): stub\n", SecurityDescriptor, ControlBitsOfInterest, - ControlBitsToSet); + SECURITY_DESCRIPTOR_CONTROL const immutable + = SE_OWNER_DEFAULTED | SE_GROUP_DEFAULTED + | SE_DACL_PRESENT | SE_DACL_DEFAULTED + | SE_SACL_PRESENT | SE_SACL_DEFAULTED + | SE_RM_CONTROL_VALID | SE_SELF_RELATIVE + ; + + SECURITY_DESCRIPTOR *lpsd = SecurityDescriptor; + + TRACE("(%p 0x%04x 0x%04x)\n", SecurityDescriptor, + ControlBitsOfInterest, ControlBitsToSet); + + if ((ControlBitsOfInterest | ControlBitsToSet) & immutable) + return STATUS_INVALID_PARAMETER; + + lpsd->Control |= (ControlBitsOfInterest & ControlBitsToSet); + lpsd->Control &= ~(ControlBitsOfInterest & ~ControlBitsToSet); + return STATUS_SUCCESS; } diff --git a/dlls/ntdll/server.c b/dlls/ntdll/server.c index 6e41eb5d87d..62ccc2c650b 100644 --- a/dlls/ntdll/server.c +++ b/dlls/ntdll/server.c @@ -23,7 +23,9 @@ #include #include -#include +#ifdef HAVE_DIRENT_H +# include +#endif #include #include #include diff --git a/dlls/ntdll/signal_i386.c b/dlls/ntdll/signal_i386.c index fb2c0fdd160..a9482e97b68 100644 --- a/dlls/ntdll/signal_i386.c +++ b/dlls/ntdll/signal_i386.c @@ -599,7 +599,7 @@ static void wine_sigacthandler( int signal, siginfo_t *siginfo, void *sigcontext __asm__ __volatile__("mov %ss,%ax; mov %ax,%ds; mov %ax,%es"); - thread_data = (struct ntdll_thread_data *)get_current_teb()->SystemReserved2; + thread_data = get_current_teb()->SystemReserved2; wine_set_fs( thread_data->fs ); wine_set_gs( thread_data->gs ); diff --git a/dlls/ntdll/tests/info.c b/dlls/ntdll/tests/info.c index 74f180e29d8..f61196eed74 100644 --- a/dlls/ntdll/tests/info.c +++ b/dlls/ntdll/tests/info.c @@ -344,23 +344,50 @@ static void test_query_procperf(void) ok( status == STATUS_INFO_LENGTH_MISMATCH, "Expected STATUS_INFO_LENGTH_MISMATCH, got %08x\n", status); /* Try it for 1 processor */ + sppi->KernelTime.QuadPart = 0xdeaddead; + sppi->UserTime.QuadPart = 0xdeaddead; + sppi->IdleTime.QuadPart = 0xdeaddead; status = pNtQuerySystemInformation(SystemProcessorPerformanceInformation, sppi, sizeof(SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION), &ReturnLength); ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status); ok( sizeof(SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION) == ReturnLength, "Inconsistent length %d\n", ReturnLength); - + ok (sppi->KernelTime.QuadPart != 0xdeaddead, "KernelTime unchanged\n"); + ok (sppi->UserTime.QuadPart != 0xdeaddead, "UserTime unchanged\n"); + ok (sppi->IdleTime.QuadPart != 0xdeaddead, "IdleTime unchanged\n"); + /* Try it for all processors */ + sppi->KernelTime.QuadPart = 0xdeaddead; + sppi->UserTime.QuadPart = 0xdeaddead; + sppi->IdleTime.QuadPart = 0xdeaddead; status = pNtQuerySystemInformation(SystemProcessorPerformanceInformation, sppi, NeededLength, &ReturnLength); ok( status == STATUS_SUCCESS, "Expected STATUS_SUCCESS, got %08x\n", status); ok( NeededLength == ReturnLength, "Inconsistent length (%d) <-> (%d)\n", NeededLength, ReturnLength); + ok (sppi->KernelTime.QuadPart != 0xdeaddead, "KernelTime unchanged\n"); + ok (sppi->UserTime.QuadPart != 0xdeaddead, "UserTime unchanged\n"); + ok (sppi->IdleTime.QuadPart != 0xdeaddead, "IdleTime unchanged\n"); /* A too large given buffer size */ sppi = HeapReAlloc(GetProcessHeap(), 0, sppi , NeededLength + 2); + sppi->KernelTime.QuadPart = 0xdeaddead; + sppi->UserTime.QuadPart = 0xdeaddead; + sppi->IdleTime.QuadPart = 0xdeaddead; status = pNtQuerySystemInformation(SystemProcessorPerformanceInformation, sppi, NeededLength + 2, &ReturnLength); ok( status == STATUS_SUCCESS || status == STATUS_INFO_LENGTH_MISMATCH /* vista */, "Expected STATUS_SUCCESS or STATUS_INFO_LENGTH_MISMATCH, got %08x\n", status); ok( NeededLength == ReturnLength, "Inconsistent length (%d) <-> (%d)\n", NeededLength, ReturnLength); + if (status == STATUS_SUCCESS) + { + ok (sppi->KernelTime.QuadPart != 0xdeaddead, "KernelTime unchanged\n"); + ok (sppi->UserTime.QuadPart != 0xdeaddead, "UserTime unchanged\n"); + ok (sppi->IdleTime.QuadPart != 0xdeaddead, "IdleTime unchanged\n"); + } + else /* vista and 2008 */ + { + ok (sppi->KernelTime.QuadPart == 0xdeaddead, "KernelTime changed\n"); + ok (sppi->UserTime.QuadPart == 0xdeaddead, "UserTime changed\n"); + ok (sppi->IdleTime.QuadPart == 0xdeaddead, "IdleTime changed\n"); + } HeapFree( GetProcessHeap(), 0, sppi); } diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c index 9411db10878..47e01960f81 100644 --- a/dlls/ntdll/thread.c +++ b/dlls/ntdll/thread.c @@ -274,8 +274,8 @@ HANDLE thread_init(void) /* allocate and initialize the initial TEB */ sigstack_total_size = get_signal_stack_total_size(); - while (1 << sigstack_zero_bits < sigstack_total_size) sigstack_zero_bits++; - assert( 1 << sigstack_zero_bits == sigstack_total_size ); /* must be a power of 2 */ + while (1U << sigstack_zero_bits < sigstack_total_size) sigstack_zero_bits++; + assert( 1U << sigstack_zero_bits == sigstack_total_size ); /* must be a power of 2 */ assert( sigstack_total_size >= sizeof(TEB) + sizeof(struct startup_info) ); thread_info.teb_size = sigstack_total_size; diff --git a/dlls/ntoskrnl.exe/ntoskrnl.c b/dlls/ntoskrnl.exe/ntoskrnl.c index 4a20d5e6be4..c37b1f886c1 100644 --- a/dlls/ntoskrnl.exe/ntoskrnl.c +++ b/dlls/ntoskrnl.exe/ntoskrnl.c @@ -543,8 +543,28 @@ NTSTATUS WINAPI IoCreateSymbolicLink( UNICODE_STRING *name, UNICODE_STRING *targ */ NTSTATUS WINAPI IoDeleteSymbolicLink( UNICODE_STRING *name ) { - FIXME( "%s\n", debugstr_us(name) ); - return STATUS_SUCCESS; + HANDLE handle; + OBJECT_ATTRIBUTES attr; + NTSTATUS status; + + attr.Length = sizeof(attr); + attr.RootDirectory = 0; + attr.ObjectName = name; + attr.Attributes = OBJ_CASE_INSENSITIVE; + attr.SecurityDescriptor = NULL; + attr.SecurityQualityOfService = NULL; + + if (!(status = NtOpenSymbolicLinkObject( &handle, 0, &attr ))) + { + SERVER_START_REQ( unlink_object ) + { + req->handle = handle; + status = wine_server_call( req ); + } + SERVER_END_REQ; + NtClose( handle ); + } + return status; } diff --git a/dlls/ole32/compobj_private.h b/dlls/ole32/compobj_private.h index fbfe37c2b9c..81d591ea3fb 100644 --- a/dlls/ole32/compobj_private.h +++ b/dlls/ole32/compobj_private.h @@ -4,7 +4,7 @@ * Copyright 1999 Francis Beaudet * Copyright 1999 Sylvain St-Germain * Copyright 2002 Marcus Meissner - * Copyright 2003 Ove Kåven, TransGaming Technologies + * Copyright 2003 Ove Kåven, TransGaming Technologies * Copyright 2004 Mike Hearn, Rob Shearman, CodeWeavers Inc * * This library is free software; you can redistribute it and/or diff --git a/dlls/ole32/dcom.idl b/dlls/ole32/dcom.idl index d4abf43e721..a1c0dcd5689 100644 --- a/dlls/ole32/dcom.idl +++ b/dlls/ole32/dcom.idl @@ -1,5 +1,5 @@ /* - * Copyright 2003 Ove Kåven, TransGaming Technologies + * Copyright 2003 Ove Kåven, TransGaming Technologies * * 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/ole32/defaulthandler.c b/dlls/ole32/defaulthandler.c index fcff4764cfe..49bb7338d66 100644 --- a/dlls/ole32/defaulthandler.c +++ b/dlls/ole32/defaulthandler.c @@ -64,6 +64,13 @@ WINE_DEFAULT_DEBUG_CHANNEL(ole); +enum storage_state +{ + storage_state_uninitialised, + storage_state_initialised, + storage_state_loaded +}; + /**************************************************************************** * DefaultHandler * @@ -119,6 +126,10 @@ struct DefaultHandler /* connection cookie for the advise on the delegate OLE object */ DWORD dwAdvConn; + + /* storage passed to Load or InitNew */ + IStorage *storage; + enum storage_state storage_state; }; typedef struct DefaultHandler DefaultHandler; @@ -621,8 +632,15 @@ static HRESULT WINAPI DefaultHandler_EnumVerbs( static HRESULT WINAPI DefaultHandler_Update( IOleObject* iface) { - FIXME(": Stub\n"); - return E_NOTIMPL; + DefaultHandler *This = impl_from_IOleObject(iface); + TRACE("(%p)\n", iface); + + if (!object_is_running(This)) + { + FIXME("Should run object\n"); + return E_NOTIMPL; + } + return IOleObject_Update(This->pOleDelegate); } /************************************************************************ @@ -635,9 +653,13 @@ static HRESULT WINAPI DefaultHandler_Update( static HRESULT WINAPI DefaultHandler_IsUpToDate( IOleObject* iface) { - TRACE("(%p)\n", iface); + DefaultHandler *This = impl_from_IOleObject(iface); + TRACE("(%p)\n", iface); - return OLE_E_NOTRUNNING; + if (object_is_running(This)) + return IOleObject_IsUpToDate(This->pOleDelegate); + + return OLE_E_NOTRUNNING; } /************************************************************************ @@ -682,6 +704,8 @@ static HRESULT WINAPI DefaultHandler_GetUserType( DefaultHandler *This = impl_from_IOleObject(iface); TRACE("(%p, %d, %p)\n", iface, dwFormOfType, pszUserType); + if (object_is_running(This)) + return IOleObject_GetUserType(This->pOleDelegate, dwFormOfType, pszUserType); return OleRegGetUserType(&This->clsid, dwFormOfType, pszUserType); } @@ -1289,7 +1313,12 @@ static HRESULT WINAPI DefaultHandler_Run( IOleObject_QueryInterface(This->pOleDelegate, &IID_IPersistStorage, (void **)&This->pPSDelegate); if (This->pPSDelegate) - hr = IPersistStorage_InitNew(This->pPSDelegate, NULL); + { + if(This->storage_state == storage_state_initialised) + hr = IPersistStorage_InitNew(This->pPSDelegate, This->storage); + else if(This->storage_state == storage_state_loaded) + hr = IPersistStorage_Load(This->pPSDelegate, This->storage); + } } if (SUCCEEDED(hr) && This->containerApp) @@ -1503,9 +1532,18 @@ static HRESULT WINAPI DefaultHandler_IPersistStorage_GetClassID( static HRESULT WINAPI DefaultHandler_IPersistStorage_IsDirty( IPersistStorage* iface) { - DefaultHandler *This = impl_from_IPersistStorage(iface); + DefaultHandler *This = impl_from_IPersistStorage(iface); + HRESULT hr; + + TRACE("(%p)\n", iface); + + hr = IPersistStorage_IsDirty(This->dataCache_PersistStg); + if(hr != S_FALSE) return hr; - return IPersistStorage_IsDirty(This->dataCache_PersistStg); + if(object_is_running(This)) + hr = IPersistStorage_IsDirty(This->pPSDelegate); + + return hr; } /************************************************************************ @@ -1516,9 +1554,24 @@ static HRESULT WINAPI DefaultHandler_IPersistStorage_InitNew( IPersistStorage* iface, IStorage* pStg) { - DefaultHandler *This = impl_from_IPersistStorage(iface); + DefaultHandler *This = impl_from_IPersistStorage(iface); + HRESULT hr; - return IPersistStorage_InitNew(This->dataCache_PersistStg, pStg); + TRACE("(%p)->(%p)\n", iface, pStg); + + hr = IPersistStorage_InitNew(This->dataCache_PersistStg, pStg); + + if(SUCCEEDED(hr) && object_is_running(This)) + hr = IPersistStorage_InitNew(This->pPSDelegate, pStg); + + if(SUCCEEDED(hr)) + { + IStorage_AddRef(pStg); + This->storage = pStg; + This->storage_state = storage_state_initialised; + } + + return hr; } @@ -1530,9 +1583,23 @@ static HRESULT WINAPI DefaultHandler_IPersistStorage_Load( IPersistStorage* iface, IStorage* pStg) { - DefaultHandler *This = impl_from_IPersistStorage(iface); + DefaultHandler *This = impl_from_IPersistStorage(iface); + HRESULT hr; + + TRACE("(%p)->(%p)\n", iface, pStg); + + hr = IPersistStorage_Load(This->dataCache_PersistStg, pStg); + + if(SUCCEEDED(hr) && object_is_running(This)) + hr = IPersistStorage_Load(This->pPSDelegate, pStg); - return IPersistStorage_Load(This->dataCache_PersistStg, pStg); + if(SUCCEEDED(hr)) + { + IStorage_AddRef(pStg); + This->storage = pStg; + This->storage_state = storage_state_loaded; + } + return hr; } @@ -1543,11 +1610,18 @@ static HRESULT WINAPI DefaultHandler_IPersistStorage_Load( static HRESULT WINAPI DefaultHandler_IPersistStorage_Save( IPersistStorage* iface, IStorage* pStgSave, - BOOL fSaveAsLoad) + BOOL fSameAsLoad) { - DefaultHandler *This = impl_from_IPersistStorage(iface); + DefaultHandler *This = impl_from_IPersistStorage(iface); + HRESULT hr; + + TRACE("(%p)->(%p, %d)\n", iface, pStgSave, fSameAsLoad); - return IPersistStorage_Save(This->dataCache_PersistStg, pStgSave, fSaveAsLoad); + hr = IPersistStorage_Save(This->dataCache_PersistStg, pStgSave, fSameAsLoad); + if(SUCCEEDED(hr) && object_is_running(This)) + hr = IPersistStorage_Save(This->pPSDelegate, pStgSave, fSameAsLoad); + + return hr; } @@ -1559,9 +1633,25 @@ static HRESULT WINAPI DefaultHandler_IPersistStorage_SaveCompleted( IPersistStorage* iface, IStorage* pStgNew) { - DefaultHandler *This = impl_from_IPersistStorage(iface); + DefaultHandler *This = impl_from_IPersistStorage(iface); + HRESULT hr; + + TRACE("(%p)->(%p)\n", iface, pStgNew); + + hr = IPersistStorage_SaveCompleted(This->dataCache_PersistStg, pStgNew); - return IPersistStorage_SaveCompleted(This->dataCache_PersistStg, pStgNew); + if(SUCCEEDED(hr) && object_is_running(This)) + hr = IPersistStorage_SaveCompleted(This->pPSDelegate, pStgNew); + + if(pStgNew) + { + IStorage_AddRef(pStgNew); + if(This->storage) IStorage_Release(This->storage); + This->storage = pStgNew; + This->storage_state = storage_state_loaded; + } + + return hr; } @@ -1572,9 +1662,21 @@ static HRESULT WINAPI DefaultHandler_IPersistStorage_SaveCompleted( static HRESULT WINAPI DefaultHandler_IPersistStorage_HandsOffStorage( IPersistStorage* iface) { - DefaultHandler *This = impl_from_IPersistStorage(iface); + DefaultHandler *This = impl_from_IPersistStorage(iface); + HRESULT hr; + + TRACE("(%p)\n", iface); - return IPersistStorage_HandsOffStorage(This->dataCache_PersistStg); + hr = IPersistStorage_HandsOffStorage(This->dataCache_PersistStg); + + if(SUCCEEDED(hr) && object_is_running(This)) + hr = IPersistStorage_HandsOffStorage(This->pPSDelegate); + + if(This->storage) IStorage_Release(This->storage); + This->storage = NULL; + This->storage_state = storage_state_uninitialised; + + return hr; } @@ -1734,6 +1836,8 @@ static DefaultHandler* DefaultHandler_Construct( This->pDataDelegate = NULL; This->dwAdvConn = 0; + This->storage = NULL; + This->storage_state = storage_state_uninitialised; return This; } @@ -1775,6 +1879,12 @@ static void DefaultHandler_Destroy( This->dataAdviseHolder = NULL; } + if (This->storage) + { + IStorage_Release(This->storage); + This->storage = NULL; + } + HeapFree(GetProcessHeap(), 0, This); } diff --git a/dlls/ole32/ole2nls.c b/dlls/ole32/ole2nls.c index f42ddf9b92c..b21601b5390 100644 --- a/dlls/ole32/ole2nls.c +++ b/dlls/ole32/ole2nls.c @@ -3,7 +3,7 @@ * * Copyright 1995 Martin von Loewis * Copyright 1998 David Lee Lambert - * Copyright 2000 Julio César Gázquez + * Copyright 2000 Julio César Gázquez * * 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/ole32/ole2stubs.c b/dlls/ole32/ole2stubs.c index e3396516564..7c457047e57 100644 --- a/dlls/ole32/ole2stubs.c +++ b/dlls/ole32/ole2stubs.c @@ -119,3 +119,12 @@ HRESULT WINAPI OleRegEnumFormatEtc ( return E_NOTIMPL; } + +/*********************************************************************** + * CoGetCallerTID [OLE32.@] + */ +HRESULT WINAPI CoGetCallerTID(LPDWORD lpdwTID) +{ + FIXME("stub!\n"); + return E_NOTIMPL; +} diff --git a/dlls/ole32/ole32.spec b/dlls/ole32/ole32.spec index 7561156884c..e5e90b3e15c 100644 --- a/dlls/ole32/ole32.spec +++ b/dlls/ole32/ole32.spec @@ -22,7 +22,7 @@ @ stdcall CoFreeUnusedLibraries() @ stdcall CoFreeUnusedLibrariesEx(long long) @ stdcall CoGetCallContext(ptr ptr) -@ stub CoGetCallerTID +@ stdcall CoGetCallerTID(ptr) @ stdcall CoGetClassObject(ptr long ptr ptr ptr) @ stdcall CoGetContextToken(ptr) @ stub CoGetCurrentLogicalThreadId diff --git a/dlls/ole32/oleproxy.c b/dlls/ole32/oleproxy.c index b32edece17b..99a86f009e3 100644 --- a/dlls/ole32/oleproxy.c +++ b/dlls/ole32/oleproxy.c @@ -2,7 +2,7 @@ * OLE32 proxy/stub handler * * Copyright 2002 Marcus Meissner - * Copyright 2001 Ove Kåven, TransGaming Technologies + * Copyright 2001 Ove Kåven, TransGaming Technologies * * 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/ole32/rpc.c b/dlls/ole32/rpc.c index b805dba656b..74d7968f3b4 100644 --- a/dlls/ole32/rpc.c +++ b/dlls/ole32/rpc.c @@ -1,7 +1,7 @@ /* * RPC Manager * - * Copyright 2001 Ove Kåven, TransGaming Technologies + * Copyright 2001 Ove Kåven, TransGaming Technologies * Copyright 2002 Marcus Meissner * Copyright 2005 Mike Hearn, Rob Shearman for CodeWeavers * diff --git a/dlls/oleacc/tests/main.c b/dlls/oleacc/tests/main.c index 66b25af1737..b977a7b00e6 100644 --- a/dlls/oleacc/tests/main.c +++ b/dlls/oleacc/tests/main.c @@ -24,8 +24,8 @@ static void test_getroletext(void) { INT ret, role; - CHAR buf[2], *buff, buff2[100]; - WCHAR bufW[2], *buffW, buff2W[100]; + CHAR buf[2], *buff; + WCHAR bufW[2], *buffW; /* wrong role number */ ret = GetRoleTextA(-1, NULL, 0); @@ -103,11 +103,26 @@ static void test_getroletext(void) /* check returned length for all roles */ for(role = 0; role <= ROLE_SYSTEM_OUTLINEBUTTON; role++){ + CHAR buff2[100]; + WCHAR buff2W[100]; + + /* NT4 and W2K don't clear the buffer on a non existing role in the A-call */ + memset(buff2, 0, sizeof(buff2)); + ret = GetRoleTextA(role, NULL, 0); + /* Win98 up to W2K miss some of the roles */ + if (role >= ROLE_SYSTEM_SPLITBUTTON) + ok(ret > 0 || broken(ret == 0), "Expected the role %d to be present\n", role); + else + ok(ret > 0, "Expected the role to be present\n"); + GetRoleTextA(role, buff2, sizeof(buff2)); ok(ret == lstrlenA(buff2), "GetRoleTextA: returned length doesn't match returned buffer for role %d\n", role); + /* Win98 and WinMe don't clear the buffer on a non existing role in the W-call */ + memset(buff2W, 0, sizeof(buff2W)); + ret = GetRoleTextW(role, NULL, 0); GetRoleTextW(role, buff2W, sizeof(buff2W)/sizeof(WCHAR)); ok(ret == lstrlenW(buff2W), diff --git a/dlls/opengl32/opengl_ext.c b/dlls/opengl32/opengl_ext.c index 26c81b00ead..d904b83add5 100644 --- a/dlls/opengl32/opengl_ext.c +++ b/dlls/opengl32/opengl_ext.c @@ -729,35 +729,35 @@ static void WINAPI wine_glClampColorARB( GLenum target, GLenum clamp ) { LEAVE_GL(); } -static void WINAPI wine_glClearBufferfi( GLenum buffer, GLfloat depth, GLint stencil ) { - void (*func_glClearBufferfi)( GLenum, GLfloat, GLint ) = extension_funcs[87]; - TRACE("(%d, %f, %d)\n", buffer, depth, stencil ); +static void WINAPI wine_glClearBufferfi( GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil ) { + void (*func_glClearBufferfi)( GLenum, GLint, GLfloat, GLint ) = extension_funcs[87]; + TRACE("(%d, %d, %f, %d)\n", buffer, drawbuffer, depth, stencil ); ENTER_GL(); - func_glClearBufferfi( buffer, depth, stencil ); + func_glClearBufferfi( buffer, drawbuffer, depth, stencil ); LEAVE_GL(); } -static void WINAPI wine_glClearBufferfv( GLenum buffer, GLfloat* value ) { - void (*func_glClearBufferfv)( GLenum, GLfloat* ) = extension_funcs[88]; - TRACE("(%d, %p)\n", buffer, value ); +static void WINAPI wine_glClearBufferfv( GLenum buffer, GLint drawbuffer, GLfloat* value ) { + void (*func_glClearBufferfv)( GLenum, GLint, GLfloat* ) = extension_funcs[88]; + TRACE("(%d, %d, %p)\n", buffer, drawbuffer, value ); ENTER_GL(); - func_glClearBufferfv( buffer, value ); + func_glClearBufferfv( buffer, drawbuffer, value ); LEAVE_GL(); } -static void WINAPI wine_glClearBufferiv( GLenum buffer, GLint* value ) { - void (*func_glClearBufferiv)( GLenum, GLint* ) = extension_funcs[89]; - TRACE("(%d, %p)\n", buffer, value ); +static void WINAPI wine_glClearBufferiv( GLenum buffer, GLint drawbuffer, GLint* value ) { + void (*func_glClearBufferiv)( GLenum, GLint, GLint* ) = extension_funcs[89]; + TRACE("(%d, %d, %p)\n", buffer, drawbuffer, value ); ENTER_GL(); - func_glClearBufferiv( buffer, value ); + func_glClearBufferiv( buffer, drawbuffer, value ); LEAVE_GL(); } -static void WINAPI wine_glClearBufferuiv( GLenum buffer, GLuint* value ) { - void (*func_glClearBufferuiv)( GLenum, GLuint* ) = extension_funcs[90]; - TRACE("(%d, %p)\n", buffer, value ); +static void WINAPI wine_glClearBufferuiv( GLenum buffer, GLint drawbuffer, GLuint* value ) { + void (*func_glClearBufferuiv)( GLenum, GLint, GLuint* ) = extension_funcs[90]; + TRACE("(%d, %d, %p)\n", buffer, drawbuffer, value ); ENTER_GL(); - func_glClearBufferuiv( buffer, value ); + func_glClearBufferuiv( buffer, drawbuffer, value ); LEAVE_GL(); } diff --git a/dlls/psapi/tests/psapi_main.c b/dlls/psapi/tests/psapi_main.c index 1978fd4d787..4cee7c62405 100644 --- a/dlls/psapi/tests/psapi_main.c +++ b/dlls/psapi/tests/psapi_main.c @@ -176,7 +176,7 @@ static void test_GetProcessImageFileName(void) if(!pGetProcessImageFileNameA(hpQI, szImgPath, sizeof(szImgPath))) { if(GetLastError() == ERROR_INVALID_FUNCTION) - trace("GetProcessImageFileName not implemented\n"); + win_skip("GetProcessImageFileName not implemented\n"); else if(GetLastError() == 0xdeadbeef) ok(0, "failed without error code\n"); else diff --git a/dlls/quartz/acmwrapper.c b/dlls/quartz/acmwrapper.c index f395f823626..3c6c28ee6ba 100644 --- a/dlls/quartz/acmwrapper.c +++ b/dlls/quartz/acmwrapper.c @@ -262,7 +262,7 @@ static HRESULT ACMWrapper_ConnectInput(InputPin *pin, const AM_MEDIA_TYPE * pmt) This->pWfOut = (WAVEFORMATEX*)outpmt->pbFormat; This->pWfOut->wFormatTag = WAVE_FORMAT_PCM; This->pWfOut->wBitsPerSample = 16; - This->pWfOut->nBlockAlign = 4; + This->pWfOut->nBlockAlign = This->pWfOut->wBitsPerSample * This->pWfOut->nChannels / 8; This->pWfOut->cbSize = 0; This->pWfOut->nAvgBytesPerSec = This->pWfOut->nChannels * This->pWfOut->nSamplesPerSec * (This->pWfOut->wBitsPerSample/8); diff --git a/dlls/quartz/dsoundrender.c b/dlls/quartz/dsoundrender.c index aae7e68fa85..a92e866ef47 100644 --- a/dlls/quartz/dsoundrender.c +++ b/dlls/quartz/dsoundrender.c @@ -238,6 +238,7 @@ static HRESULT DSoundRender_Sample(LPVOID iface, IMediaSample * pSample) long cbSrcStream = 0; REFERENCE_TIME tStart, tStop; HRESULT hr; + AM_MEDIA_TYPE *amt; TRACE("%p %p\n", iface, pSample); @@ -259,6 +260,39 @@ static HRESULT DSoundRender_Sample(LPVOID iface, IMediaSample * pSample) return VFW_E_WRONG_STATE; } + if (IMediaSample_GetMediaType(pSample, &amt) == S_OK) + { + AM_MEDIA_TYPE *orig = &This->pInputPin->pin.mtCurrent; + WAVEFORMATEX *origfmt = (WAVEFORMATEX *)orig->pbFormat; + WAVEFORMATEX *newfmt = (WAVEFORMATEX *)amt->pbFormat; + + if (origfmt->wFormatTag == newfmt->wFormatTag && + origfmt->nChannels == newfmt->nChannels && + origfmt->nBlockAlign == newfmt->nBlockAlign && + origfmt->wBitsPerSample == newfmt->wBitsPerSample && + origfmt->cbSize == newfmt->cbSize) + { + if (origfmt->nSamplesPerSec != newfmt->nSamplesPerSec) + { + hr = IDirectSoundBuffer_SetFrequency(This->dsbuffer, + newfmt->nSamplesPerSec); + if (FAILED(hr)) + { + LeaveCriticalSection(&This->csFilter); + return VFW_E_TYPE_NOT_ACCEPTED; + } + FreeMediaType(orig); + CopyMediaType(orig, amt); + IMediaSample_SetMediaType(pSample, NULL); + } + } + else + { + LeaveCriticalSection(&This->csFilter); + return VFW_E_TYPE_NOT_ACCEPTED; + } + } + SetEvent(This->state_change); hr = IMediaSample_GetPointer(pSample, &pbSrcStream); diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c index 8caa1f8b0bd..d92397e5258 100644 --- a/dlls/riched20/editor.c +++ b/dlls/riched20/editor.c @@ -1938,6 +1938,93 @@ ME_FindText(ME_TextEditor *editor, DWORD flags, const CHARRANGE *chrg, const WCH return -1; } +typedef struct tagME_GlobalDestStruct +{ + HGLOBAL hData; + int nLength; +} ME_GlobalDestStruct; + +static DWORD CALLBACK ME_ReadFromHGLOBALUnicode(DWORD_PTR dwCookie, LPBYTE lpBuff, LONG cb, LONG *pcb) +{ + ME_GlobalDestStruct *pData = (ME_GlobalDestStruct *)dwCookie; + int i; + WORD *pSrc, *pDest; + + cb = cb >> 1; + pDest = (WORD *)lpBuff; + pSrc = (WORD *)GlobalLock(pData->hData); + for (i = 0; inLength+i]; i++) { + pDest[i] = pSrc[pData->nLength+i]; + } + pData->nLength += i; + *pcb = 2*i; + GlobalUnlock(pData->hData); + return 0; +} + +static DWORD CALLBACK ME_ReadFromHGLOBALRTF(DWORD_PTR dwCookie, LPBYTE lpBuff, LONG cb, LONG *pcb) +{ + ME_GlobalDestStruct *pData = (ME_GlobalDestStruct *)dwCookie; + int i; + BYTE *pSrc, *pDest; + + pDest = lpBuff; + pSrc = (BYTE *)GlobalLock(pData->hData); + for (i = 0; inLength+i]; i++) { + pDest[i] = pSrc[pData->nLength+i]; + } + pData->nLength += i; + *pcb = i; + GlobalUnlock(pData->hData); + return 0; +} + +static BOOL ME_Paste(ME_TextEditor *editor) +{ + DWORD dwFormat = 0; + EDITSTREAM es; + ME_GlobalDestStruct gds; + UINT nRTFFormat = RegisterClipboardFormatA("Rich Text Format"); + UINT cf = 0; + + if (IsClipboardFormatAvailable(nRTFFormat)) + cf = nRTFFormat, dwFormat = SF_RTF; + else if (IsClipboardFormatAvailable(CF_UNICODETEXT)) + cf = CF_UNICODETEXT, dwFormat = SF_TEXT|SF_UNICODE; + else + return FALSE; + + if (!OpenClipboard(editor->hWnd)) + return FALSE; + gds.hData = GetClipboardData(cf); + gds.nLength = 0; + es.dwCookie = (DWORD)&gds; + es.pfnCallback = dwFormat == SF_RTF ? ME_ReadFromHGLOBALRTF : ME_ReadFromHGLOBALUnicode; + ME_StreamIn(editor, dwFormat|SFF_SELECTION, &es, FALSE); + + CloseClipboard(); + return TRUE; +} + +static BOOL ME_Copy(ME_TextEditor *editor, CHARRANGE *range) +{ + LPDATAOBJECT dataObj = NULL; + HRESULT hr = S_OK; + + if (editor->cPasswordMask) + return FALSE; /* Copying or Cutting masked text isn't allowed */ + + if(editor->lpOleCallback) + hr = IRichEditOleCallback_GetClipboardData(editor->lpOleCallback, range, RECO_COPY, &dataObj); + if(FAILED(hr) || !dataObj) + hr = ME_GetDataObject(editor, range, &dataObj); + if(SUCCEEDED(hr)) { + hr = OleSetClipboard(dataObj); + IDataObject_Release(dataObj); + } + return SUCCEEDED(hr) != 0; +} + /* helper to send a msg filter notification */ static BOOL ME_FilterEvent(ME_TextEditor *editor, UINT msg, WPARAM* wParam, LPARAM* lParam) @@ -2023,6 +2110,49 @@ ME_KeyDown(ME_TextEditor *editor, WORD nKey) ME_UpdateRepaint(editor); ME_SendRequestResize(editor, FALSE); return TRUE; + case 'A': + if (ctrl_is_down) + { + ME_SetSelection(editor, 0, -1); + return TRUE; + } + break; + case 'V': + if (ctrl_is_down) + return ME_Paste(editor); + break; + case 'C': + case 'X': + if (ctrl_is_down) + { + CHARRANGE range; + BOOL result; + + ME_GetSelection(editor, &range.cpMin, &range.cpMax); + result = ME_Copy(editor, &range); + if (result && nKey == 'X') + { + ME_InternalDeleteText(editor, range.cpMin, range.cpMax-range.cpMin, FALSE); + ME_CommitUndo(editor); + ME_UpdateRepaint(editor); + } + return result; + } + break; + case 'Z': + if (ctrl_is_down) + { + ME_Undo(editor); + return TRUE; + } + break; + case 'Y': + if (ctrl_is_down) + { + ME_Redo(editor); + return TRUE; + } + break; default: if (nKey != VK_SHIFT && nKey != VK_CONTROL && nKey && nKey != VK_MENU) @@ -2229,7 +2359,6 @@ ME_TextEditor *ME_MakeEditor(HWND hWnd) { ed->nParagraphs = 1; ed->nLastSelStart = ed->nLastSelEnd = 0; ed->pLastSelStartPara = ed->pLastSelEndPara = ME_FindItemFwd(ed->pBuffer->pFirst, diParagraph); - ed->bRedraw = TRUE; ed->bWordWrap = (GetWindowLongW(hWnd, GWL_STYLE) & (WS_HSCROLL|ES_AUTOHSCROLL)) ? FALSE : TRUE; ed->bHideSelection = FALSE; ed->nInvalidOfs = -1; @@ -2271,48 +2400,6 @@ ME_TextEditor *ME_MakeEditor(HWND hWnd) { return ed; } -typedef struct tagME_GlobalDestStruct -{ - HGLOBAL hData; - int nLength; -} ME_GlobalDestStruct; - -static DWORD CALLBACK ME_ReadFromHGLOBALUnicode(DWORD_PTR dwCookie, LPBYTE lpBuff, LONG cb, LONG *pcb) -{ - ME_GlobalDestStruct *pData = (ME_GlobalDestStruct *)dwCookie; - int i; - WORD *pSrc, *pDest; - - cb = cb >> 1; - pDest = (WORD *)lpBuff; - pSrc = (WORD *)GlobalLock(pData->hData); - for (i = 0; inLength+i]; i++) { - pDest[i] = pSrc[pData->nLength+i]; - } - pData->nLength += i; - *pcb = 2*i; - GlobalUnlock(pData->hData); - return 0; -} - -static DWORD CALLBACK ME_ReadFromHGLOBALRTF(DWORD_PTR dwCookie, LPBYTE lpBuff, LONG cb, LONG *pcb) -{ - ME_GlobalDestStruct *pData = (ME_GlobalDestStruct *)dwCookie; - int i; - BYTE *pSrc, *pDest; - - pDest = lpBuff; - pSrc = (BYTE *)GlobalLock(pData->hData); - for (i = 0; inLength+i]; i++) { - pDest[i] = pSrc[pData->nLength+i]; - } - pData->nLength += i; - *pcb = i; - GlobalUnlock(pData->hData); - return 0; -} - - void ME_DestroyEditor(ME_TextEditor *editor) { ME_DisplayItem *pFirst = editor->pBuffer->pFirst; @@ -2808,11 +2895,8 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, editor->rgbBackColor = lParam; editor->hbrBackground = CreateSolidBrush(editor->rgbBackColor); } - if (editor->bRedraw) - { - InvalidateRect(hWnd, NULL, TRUE); - UpdateWindow(hWnd); - } + InvalidateRect(hWnd, NULL, TRUE); + UpdateWindow(hWnd); return lColor; } case EM_GETMODIFY: @@ -3070,51 +3154,15 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, return FALSE; } case WM_PASTE: - { - DWORD dwFormat = 0; - EDITSTREAM es; - ME_GlobalDestStruct gds; - UINT nRTFFormat = RegisterClipboardFormatA("Rich Text Format"); - UINT cf = 0; - - if (IsClipboardFormatAvailable(nRTFFormat)) - cf = nRTFFormat, dwFormat = SF_RTF; - else if (IsClipboardFormatAvailable(CF_UNICODETEXT)) - cf = CF_UNICODETEXT, dwFormat = SF_TEXT|SF_UNICODE; - else - return 0; - - if (!OpenClipboard(hWnd)) - return 0; - gds.hData = GetClipboardData(cf); - gds.nLength = 0; - es.dwCookie = (DWORD)&gds; - es.pfnCallback = dwFormat == SF_RTF ? ME_ReadFromHGLOBALRTF : ME_ReadFromHGLOBALUnicode; - ME_StreamIn(editor, dwFormat|SFF_SELECTION, &es, FALSE); - - CloseClipboard(); + ME_Paste(editor); return 0; - } case WM_CUT: case WM_COPY: { - LPDATAOBJECT dataObj = NULL; CHARRANGE range; - HRESULT hr = S_OK; - - if (editor->cPasswordMask) - return 0; /* Copying or Cutting masked text isn't allowed */ - ME_GetSelection(editor, &range.cpMin, &range.cpMax); - if(editor->lpOleCallback) - hr = IRichEditOleCallback_GetClipboardData(editor->lpOleCallback, &range, RECO_COPY, &dataObj); - if(FAILED(hr) || !dataObj) - hr = ME_GetDataObject(editor, &range, &dataObj); - if(SUCCEEDED(hr)) { - hr = OleSetClipboard(dataObj); - IDataObject_Release(dataObj); - } - if (SUCCEEDED(hr) && msg == WM_CUT) + + if (ME_Copy(editor, &range) && msg == WM_CUT) { ME_InternalDeleteText(editor, range.cpMin, range.cpMax-range.cpMin, FALSE); ME_CommitUndo(editor); @@ -3495,18 +3543,15 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, if (wParam >= 0x40000) nCharOfs = lParam; nLength = ME_GetTextLength(editor); - - if (nCharOfs < nLength) { - ME_RunOfsFromCharOfs(editor, nCharOfs, &pRun, &nOffset); - assert(pRun->type == diRun); - pt.y = pRun->member.run.pt.y; - pt.x = pRun->member.run.pt.x + ME_PointFromChar(editor, &pRun->member.run, nOffset); - pt.y += ME_GetParagraph(pRun)->member.para.pt.y; - } else { - pt.x = 0; - pt.y = editor->pBuffer->pLast->member.para.pt.y; - } + nCharOfs = min(nCharOfs, nLength); + + ME_RunOfsFromCharOfs(editor, nCharOfs, &pRun, &nOffset); + assert(pRun->type == diRun); + pt.y = pRun->member.run.pt.y; + pt.x = pRun->member.run.pt.x + ME_PointFromChar(editor, &pRun->member.run, nOffset); + pt.y += ME_GetParagraph(pRun)->member.para.pt.y; pt.x += editor->selofs; + pt.x++; /* for some reason native offsets x by one */ si.cbSize = sizeof(si); si.fMask = SIF_POS; @@ -3604,7 +3649,6 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, goto do_default; break; case WM_PAINT: - if (editor->bRedraw) { HDC hDC; PAINTSTRUCT ps; @@ -3627,14 +3671,11 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, return 0; case WM_ERASEBKGND: { - if (editor->bRedraw) + HDC hDC = (HDC)wParam; + RECT rc; + if (GetUpdateRect(hWnd,&rc,TRUE)) { - HDC hDC = (HDC)wParam; - RECT rc; - if (GetUpdateRect(hWnd,&rc,TRUE)) - { - FillRect(hDC, &rc, editor->hbrBackground); - } + FillRect(hDC, &rc, editor->hbrBackground); } return 1; } @@ -3665,36 +3706,11 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, MultiByteToWideChar(CP_ACP, 0, &charA, 1, &wstr, 1); } - switch (wstr) - { - case 1: /* Ctrl-A */ - ME_SetSelection(editor, 0, -1); - return 0; - case 3: /* Ctrl-C */ - SendMessageW(editor->hWnd, WM_COPY, 0, 0); - return 0; - } - if (GetWindowLongW(editor->hWnd, GWL_STYLE) & ES_READONLY) { MessageBeep(MB_ICONERROR); return 0; /* FIXME really 0 ? */ } - switch (wstr) - { - case 22: /* Ctrl-V */ - SendMessageW(editor->hWnd, WM_PASTE, 0, 0); - return 0; - case 24: /* Ctrl-X */ - SendMessageW(editor->hWnd, WM_CUT, 0, 0); - return 0; - case 25: /* Ctrl-Y */ - SendMessageW(editor->hWnd, EM_REDO, 0, 0); - return 0; - case 26: /* Ctrl-Z */ - SendMessageW(editor->hWnd, EM_UNDO, 0, 0); - return 0; - } if (((unsigned)wstr)>=' ' || (wstr=='\r' && (GetWindowLongW(hWnd, GWL_STYLE) & ES_MULTILINE)) || wstr=='\t') { @@ -3953,9 +3969,7 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam, ME_SendRequestResize(editor, TRUE); return 0; case WM_SETREDRAW: - if ((editor->bRedraw = wParam)) - ME_RewrapRepaint(editor); - return 0; + return DefWindowProcW(hWnd, msg, wParam, lParam); case WM_SIZE: { GetClientRect(hWnd, &editor->rcFormat); diff --git a/dlls/riched20/editstr.h b/dlls/riched20/editstr.h index 7299ab32c57..248cc02be29 100644 --- a/dlls/riched20/editstr.h +++ b/dlls/riched20/editstr.h @@ -351,7 +351,6 @@ typedef struct tagME_TextEditor ME_FontCacheItem pFontCache[HFONT_CACHE_SIZE]; int nZoomNumerator, nZoomDenominator; RECT rcFormat; - BOOL bRedraw; BOOL bWordWrap; int nInvalidOfs; int nTextLimit; diff --git a/dlls/riched20/paint.c b/dlls/riched20/paint.c index 2955594a009..40761db64b0 100644 --- a/dlls/riched20/paint.c +++ b/dlls/riched20/paint.c @@ -147,6 +147,8 @@ void ME_Repaint(ME_TextEditor *editor) ME_UpdateScrollBar(editor); FIXME("ME_Repaint had to call ME_WrapMarkedParagraphs\n"); } + if (!IsWindowVisible(editor->hWnd)) + return; if (!editor->bEmulateVersion10 || (editor->nEventMask & ENM_UPDATE)) ME_SendOldNotify(editor, EN_UPDATE); UpdateWindow(editor->hWnd); @@ -159,7 +161,6 @@ void ME_UpdateRepaint(ME_TextEditor *editor) BOOL wrappedParagraphs; wrappedParagraphs = ME_WrapMarkedParagraphs(editor); - if (!editor->bRedraw) return; if (wrappedParagraphs) ME_UpdateScrollBar(editor); @@ -185,12 +186,9 @@ ME_RewrapRepaint(ME_TextEditor *editor) * looks, but not content. Like resizing. */ ME_MarkAllForWrapping(editor); - if (editor->bRedraw) - { - ME_WrapMarkedParagraphs(editor); - ME_UpdateScrollBar(editor); - ME_Repaint(editor); - } + ME_WrapMarkedParagraphs(editor); + ME_UpdateScrollBar(editor); + ME_Repaint(editor); } int ME_twips2pointsX(ME_Context *c, int x) @@ -1074,17 +1072,14 @@ void ME_Scroll(ME_TextEditor *editor, int value, int type) si.nPos = 0; } - nNewPos = SetScrollInfo(editor->hWnd, SB_VERT, &si, editor->bRedraw); + nNewPos = SetScrollInfo(editor->hWnd, SB_VERT, &si, TRUE); editor->vert_si.nPos = nNewPos; nActualScroll = nOrigPos - nNewPos; - if (editor->bRedraw) - { - if (abs(nActualScroll) > editor->sizeWindow.cy) - InvalidateRect(editor->hWnd, NULL, TRUE); - else - ScrollWindowEx(editor->hWnd, 0, nActualScroll, NULL, NULL, NULL, NULL, SW_INVALIDATE); - ME_Repaint(editor); - } + if (abs(nActualScroll) > editor->sizeWindow.cy) + InvalidateRect(editor->hWnd, NULL, TRUE); + else + ScrollWindowEx(editor->hWnd, 0, nActualScroll, NULL, NULL, NULL, NULL, SW_INVALIDATE); + ME_Repaint(editor); hWnd = editor->hWnd; winStyle = GetWindowLongW(hWnd, GWL_STYLE); diff --git a/dlls/riched20/string.c b/dlls/riched20/string.c index 97b5a676684..7da521cdf4c 100644 --- a/dlls/riched20/string.c +++ b/dlls/riched20/string.c @@ -304,6 +304,8 @@ ME_WordBreakProc(LPWSTR s, INT start, INT len, INT code) /* FIXME: Native also knows about punctuation */ TRACE("s==%s, start==%d, len==%d, code==%d\n", debugstr_wn(s, len), start, len, code); + /* convert number of bytes to number of characters. */ + len /= sizeof(WCHAR); switch (code) { case WB_ISDELIMITER: @@ -330,11 +332,23 @@ ME_WordBreakProc(LPWSTR s, INT start, INT len, INT code) int ME_CallWordBreakProc(ME_TextEditor *editor, ME_String *str, INT start, INT code) { - /* FIXME: ANSIfy the string when bEmulateVersion10 is TRUE */ - if (!editor->pfnWordBreak) - return ME_WordBreakProc(str->szData, start, str->nLen, code); - else - return editor->pfnWordBreak(str->szData, start, str->nLen, code); + if (!editor->pfnWordBreak) { + return ME_WordBreakProc(str->szData, start, str->nLen*sizeof(WCHAR), code); + } else if (!editor->bEmulateVersion10) { + /* MSDN lied about the third parameter for EditWordBreakProc being the number + * of characters, it is actually the number of bytes of the string. */ + return editor->pfnWordBreak(str->szData, start, str->nLen*sizeof(WCHAR), code); + } else { + int result; + int buffer_size = WideCharToMultiByte(CP_ACP, 0, str->szData, str->nLen, + NULL, 0, NULL, NULL); + char *buffer = (char*)heap_alloc(buffer_size); + WideCharToMultiByte(CP_ACP, 0, str->szData, str->nLen, + buffer, buffer_size, NULL, NULL); + result = editor->pfnWordBreak(str->szData, start, str->nLen, code); + heap_free(buffer); + return result; + } } LPWSTR ME_ToUnicode(BOOL unicode, LPVOID psz) diff --git a/dlls/riched20/tests/editor.c b/dlls/riched20/tests/editor.c index 08b913bacf8..2c803aee6ec 100644 --- a/dlls/riched20/tests/editor.c +++ b/dlls/riched20/tests/editor.c @@ -111,6 +111,34 @@ static void simulate_typing_characters(HWND hwnd, const char* szChars) } } +static BOOL hold_key(int vk) +{ + BYTE key_state[256]; + BOOL result; + + result = GetKeyboardState(key_state); + ok(result, "GetKeyboardState failed.\n"); + if (!result) return FALSE; + key_state[vk] |= 0x80; + result = SetKeyboardState(key_state); + ok(result, "SetKeyboardState failed.\n"); + return result != 0; +} + +static BOOL release_key(int vk) +{ + BYTE key_state[256]; + BOOL result; + + result = GetKeyboardState(key_state); + ok(result, "GetKeyboardState failed.\n"); + if (!result) return FALSE; + key_state[vk] &= ~0x80; + result = SetKeyboardState(key_state); + ok(result, "SetKeyboardState failed.\n"); + return result != 0; +} + static const char haystack[] = "WINEWine wineWine wine WineWine"; /* ^0 ^10 ^20 ^30 */ @@ -501,6 +529,7 @@ static void test_EM_POSFROMCHAR(void) LRESULT result; unsigned int height = 0; int xpos = 0; + POINTL pt; static const char text[] = "aa\n" "this is a long line of text that should be longer than the " "control's width\n" @@ -538,9 +567,7 @@ static void test_EM_POSFROMCHAR(void) if (i == 0) { ok(HIWORD(result) == 0, "EM_POSFROMCHAR reports y=%d, expected 0\n", HIWORD(result)); - todo_wine { ok(LOWORD(result) == 1, "EM_POSFROMCHAR reports x=%d, expected 1\n", LOWORD(result)); - } xpos = LOWORD(result); } else if (i == 1) @@ -594,9 +621,7 @@ static void test_EM_POSFROMCHAR(void) result = SendMessage(hwndRichEdit, EM_POSFROMCHAR, 0, 0); ok(HIWORD(result) == 0, "EM_POSFROMCHAR reports y=%d, expected 0\n", HIWORD(result)); - todo_wine { ok(LOWORD(result) == 1, "EM_POSFROMCHAR reports x=%d, expected 1\n", LOWORD(result)); - } xpos = LOWORD(result); SendMessage(hwndRichEdit, WM_HSCROLL, SB_LINERIGHT, 0); @@ -608,6 +633,22 @@ static void test_EM_POSFROMCHAR(void) "EM_POSFROMCHAR reports x=%hd, expected value less than %d\n", (signed short)(LOWORD(result)), xpos); } + SendMessage(hwndRichEdit, WM_HSCROLL, SB_LINELEFT, 0); + + /* Test around end of text that doesn't end in a newline. */ + SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM) "12345678901234"); + SendMessage(hwndRichEdit, EM_POSFROMCHAR, (WPARAM)&pt, + SendMessage(hwndRichEdit, WM_GETTEXTLENGTH, 0, 0)-1); + ok(pt.x > 1, "pt.x = %d\n", pt.x); + xpos = pt.x; + SendMessage(hwndRichEdit, EM_POSFROMCHAR, (WPARAM)&pt, + SendMessage(hwndRichEdit, WM_GETTEXTLENGTH, 0, 0)); + ok(pt.x > xpos, "pt.x = %d\n", pt.x); + xpos = pt.x; + SendMessage(hwndRichEdit, EM_POSFROMCHAR, (WPARAM)&pt, + SendMessage(hwndRichEdit, WM_GETTEXTLENGTH, 0, 0)+1); + ok(pt.x == xpos, "pt.x = %d\n", pt.x); + DestroyWindow(hwndRichEdit); } @@ -4397,11 +4438,15 @@ static void test_WM_PASTE(void) const char* text3 = "testing paste\r\npaste\r\ntesting paste"; HWND hwndRichEdit = new_richedit(NULL); - /* Native riched20 won't obey WM_CHAR messages or WM_KEYDOWN/WM_KEYUP - messages, probably because it inspects the keyboard state itself. - Therefore, native requires this in order to obey Ctrl- keystrokes. + /* Native riched20 inspects the keyboard state (e.g. GetKeyState) + * to test the state of the modifiers (Ctrl/Alt/Shift). + * + * Therefore Ctrl- keystrokes need to be simulated with + * keybd_event or by using SetKeyboardState to set the modifiers + * and SendMessage to simulate the keystrokes. */ + /* Sent keystrokes with keybd_event */ #define SEND_CTRL_C(hwnd) pressKeyWithModifier(hwnd, VK_CONTROL, 'C') #define SEND_CTRL_X(hwnd) pressKeyWithModifier(hwnd, VK_CONTROL, 'X') #define SEND_CTRL_V(hwnd) pressKeyWithModifier(hwnd, VK_CONTROL, 'V') @@ -4418,13 +4463,14 @@ static void test_WM_PASTE(void) /* Pasted text should be visible at this step */ result = strcmp(text1_step1, buffer); ok(result == 0, - "test paste: strcmp = %i\n", result); + "test paste: strcmp = %i, text='%s'\n", result, buffer); + SEND_CTRL_Z(hwndRichEdit); /* Undo */ SendMessage(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM) buffer); /* Text should be the same as before (except for \r -> \r\n conversion) */ result = strcmp(text1_after, buffer); ok(result == 0, - "test paste: strcmp = %i\n", result); + "test paste: strcmp = %i, text='%s'\n", result, buffer); SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM) text2); SendMessage(hwndRichEdit, EM_SETSEL, 8, 13); @@ -4449,6 +4495,87 @@ static void test_WM_PASTE(void) ok(result == 0, "test paste: strcmp = %i\n", result); +#undef SEND_CTRL_C +#undef SEND_CTRL_X +#undef SEND_CTRL_V +#undef SEND_CTRL_Z +#undef SEND_CTRL_Y + + SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM) NULL); + /* Send WM_CHAR to simulates Ctrl-V */ + SendMessage(hwndRichEdit, WM_CHAR, 22, + (MapVirtualKey('V', MAPVK_VK_TO_VSC) << 16) & 1); + SendMessage(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM) buffer); + /* Shouldn't paste because pasting is handled by WM_KEYDOWN */ + result = strcmp(buffer,""); + ok(result == 0, + "test paste: strcmp = %i, actual = '%s'\n", result, buffer); + + /* Send keystrokes with WM_KEYDOWN after setting the modifiers + * with SetKeyboard state. */ + + SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM) NULL); + /* Simulates paste (Ctrl-V) */ + hold_key(VK_CONTROL); + SendMessage(hwndRichEdit, WM_KEYDOWN, 'V', + (MapVirtualKey('V', MAPVK_VK_TO_VSC) << 16) & 1); + release_key(VK_CONTROL); + SendMessage(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM) buffer); + result = strcmp(buffer,"paste"); + ok(result == 0, + "test paste: strcmp = %i, actual = '%s'\n", result, buffer); + + SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM) text1); + SendMessage(hwndRichEdit, EM_SETSEL, 0, 7); + /* Simulates copy (Ctrl-C) */ + hold_key(VK_CONTROL); + SendMessage(hwndRichEdit, WM_KEYDOWN, 'C', + (MapVirtualKey('C', MAPVK_VK_TO_VSC) << 16) & 1); + release_key(VK_CONTROL); + SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM) NULL); + SendMessage(hwndRichEdit, WM_PASTE, 0, 0); + SendMessage(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM) buffer); + result = strcmp(buffer,"testing"); + ok(result == 0, + "test paste: strcmp = %i, actual = '%s'\n", result, buffer); + + /* Cut with WM_KEYDOWN to simulate Ctrl-X */ + SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM) "cut"); + /* Simulates select all (Ctrl-A) */ + hold_key(VK_CONTROL); + SendMessage(hwndRichEdit, WM_KEYDOWN, 'A', + (MapVirtualKey('A', MAPVK_VK_TO_VSC) << 16) & 1); + /* Simulates select cut (Ctrl-X) */ + SendMessage(hwndRichEdit, WM_KEYDOWN, 'X', + (MapVirtualKey('X', MAPVK_VK_TO_VSC) << 16) & 1); + release_key(VK_CONTROL); + SendMessage(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM) buffer); + result = strcmp(buffer,""); + ok(result == 0, + "test paste: strcmp = %i, actual = '%s'\n", result, buffer); + SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM) NULL); + SendMessage(hwndRichEdit, WM_PASTE, 0, 0); + SendMessage(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM) buffer); + result = strcmp(buffer,"cut\r\n"); + todo_wine ok(result == 0, + "test paste: strcmp = %i, actual = '%s'\n", result, buffer); + /* Simulates undo (Ctrl-Z) */ + hold_key(VK_CONTROL); + SendMessage(hwndRichEdit, WM_KEYDOWN, 'Z', + (MapVirtualKey('Z', MAPVK_VK_TO_VSC) << 16) & 1); + SendMessage(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM) buffer); + result = strcmp(buffer,""); + ok(result == 0, + "test paste: strcmp = %i, actual = '%s'\n", result, buffer); + /* Simulates redo (Ctrl-Y) */ + SendMessage(hwndRichEdit, WM_KEYDOWN, 'Y', + (MapVirtualKey('Y', MAPVK_VK_TO_VSC) << 16) & 1); + SendMessage(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM) buffer); + result = strcmp(buffer,"cut\r\n"); + todo_wine ok(result == 0, + "test paste: strcmp = %i, actual = '%s'\n", result, buffer); + release_key(VK_CONTROL); + DestroyWindow(hwndRichEdit); } @@ -5143,7 +5270,7 @@ static LRESULT WINAPI ParentMsgCheckProcA(HWND hwnd, UINT message, WPARAM wParam static void test_eventMask(void) { HWND parent; - int ret; + int ret, style; WNDCLASSA cls; const char text[] = "foo bar\n"; int eventMask; @@ -5184,6 +5311,37 @@ static void test_eventMask(void) ok(queriedEventMask == (eventMask & ~ENM_CHANGE), "wrong event mask (0x%x) during WM_COMMAND\n", queriedEventMask); + /* check to see if EN_CHANGE is sent when redraw is turned off */ + SendMessage(eventMaskEditHwnd, WM_CLEAR, 0, 0); + ok(IsWindowVisible(eventMaskEditHwnd), "Window should be visible.\n"); + SendMessage(eventMaskEditHwnd, WM_SETREDRAW, FALSE, 0); + /* redraw is disabled by making the window invisible. */ + ok(!IsWindowVisible(eventMaskEditHwnd), "Window shouldn't be visible.\n"); + queriedEventMask = 0; /* initialize to something other than we expect */ + SendMessage(eventMaskEditHwnd, EM_REPLACESEL, 0, (LPARAM) text); + ok(queriedEventMask == (eventMask & ~ENM_CHANGE), + "wrong event mask (0x%x) during WM_COMMAND\n", queriedEventMask); + SendMessage(eventMaskEditHwnd, WM_SETREDRAW, TRUE, 0); + ok(IsWindowVisible(eventMaskEditHwnd), "Window should be visible.\n"); + + /* check to see if EN_UPDATE is sent when the editor isn't visible */ + SendMessage(eventMaskEditHwnd, WM_CLEAR, 0, 0); + style = GetWindowLong(eventMaskEditHwnd, GWL_STYLE); + SetWindowLong(eventMaskEditHwnd, GWL_STYLE, style & ~WS_VISIBLE); + ok(!IsWindowVisible(eventMaskEditHwnd), "Window shouldn't be visible.\n"); + watchForEventMask = EN_UPDATE; + queriedEventMask = 0; /* initialize to something other than we expect */ + SendMessage(eventMaskEditHwnd, EM_REPLACESEL, 0, (LPARAM) text); + ok(queriedEventMask == 0, + "wrong event mask (0x%x) during WM_COMMAND\n", queriedEventMask); + SetWindowLong(eventMaskEditHwnd, GWL_STYLE, style); + ok(IsWindowVisible(eventMaskEditHwnd), "Window should be visible.\n"); + queriedEventMask = 0; /* initialize to something other than we expect */ + SendMessage(eventMaskEditHwnd, EM_REPLACESEL, 0, (LPARAM) text); + ok(queriedEventMask == eventMask, + "wrong event mask (0x%x) during WM_COMMAND\n", queriedEventMask); + + DestroyWindow(parent); } @@ -5260,6 +5418,14 @@ static void test_WM_NOTIFY(void) ok(received_WM_NOTIFY == 1, "Expected WM_NOTIFY was NOT sent!\n"); ok(modify_at_WM_NOTIFY == 0, "WM_NOTIFY callback saw text flagged as modified!\n"); + /* Test for WM_NOTIFY messages with redraw disabled. */ + SendMessage(hwndRichedit_WM_NOTIFY, EM_SETSEL, 0, 0); + SendMessage(hwndRichedit_WM_NOTIFY, WM_SETREDRAW, FALSE, 0); + received_WM_NOTIFY = 0; + SendMessage(hwndRichedit_WM_NOTIFY, EM_REPLACESEL, FALSE, (LPARAM)"inserted"); + ok(received_WM_NOTIFY == 1, "Expected WM_NOTIFY was NOT sent!\n"); + SendMessage(hwndRichedit_WM_NOTIFY, WM_SETREDRAW, TRUE, 0); + DestroyWindow(hwndRichedit_WM_NOTIFY); DestroyWindow(parent); } @@ -5382,6 +5548,43 @@ static void test_undo_coalescing(void) DestroyWindow(hwnd); } +LONG CALLBACK customWordBreakProc(WCHAR *text, int pos, int bytes, int code) +{ + int length; + + /* MSDN lied, length is actually the number of bytes. */ + length = bytes / sizeof(WCHAR); + switch(code) + { + case WB_ISDELIMITER: + return text[pos] == 'X'; + case WB_LEFT: + case WB_MOVEWORDLEFT: + if (customWordBreakProc(text, pos, bytes, WB_ISDELIMITER)) + return pos-1; + return min(customWordBreakProc(text, pos, bytes, WB_LEFTBREAK)-1, 0); + case WB_LEFTBREAK: + pos--; + while (pos > 0 && !customWordBreakProc(text, pos, bytes, WB_ISDELIMITER)) + pos--; + return pos; + case WB_RIGHT: + case WB_MOVEWORDRIGHT: + if (customWordBreakProc(text, pos, bytes, WB_ISDELIMITER)) + return pos+1; + return min(customWordBreakProc(text, pos, bytes, WB_RIGHTBREAK)+1, length); + case WB_RIGHTBREAK: + pos++; + while (pos < length && !customWordBreakProc(text, pos, bytes, WB_ISDELIMITER)) + pos++; + return pos; + default: + ok(FALSE, "Unexpected code %d\n", code); + break; + } + return 0; +} + #define SEND_CTRL_LEFT(hwnd) pressKeyWithModifier(hwnd, VK_CONTROL, VK_LEFT) #define SEND_CTRL_RIGHT(hwnd) pressKeyWithModifier(hwnd, VK_CONTROL, VK_RIGHT) @@ -5390,6 +5593,7 @@ static void test_word_movement(void) HWND hwnd; int result; int sel_start, sel_end; + const WCHAR textW[] = {'o','n','e',' ','t','w','o','X','t','h','r','e','e',0}; /* multi-line control inserts CR normally */ hwnd = new_richedit(NULL); @@ -5439,6 +5643,42 @@ static void test_word_movement(void) ok(sel_start == sel_end, "Selection should be empty\n"); ok(sel_start == 9, "Cursor is at %d instead of %d\n", sel_start, 9); + /* Test with a custom word break procedure that uses X as the delimiter. */ + result = SendMessageA(hwnd, WM_SETTEXT, 0, (LPARAM)"one twoXthree"); + ok (result == TRUE, "Failed to clear the text.\n"); + SendMessage(hwnd, EM_SETWORDBREAKPROC, 0, (LPARAM)customWordBreakProc); + /* |one twoXthree */ + SEND_CTRL_RIGHT(hwnd); + /* one twoX|three */ + SendMessage(hwnd, EM_GETSEL, (WPARAM)&sel_start, (LPARAM)&sel_end); + ok(sel_start == sel_end, "Selection should be empty\n"); + ok(sel_start == 8, "Cursor is at %d instead of %d\n", sel_start, 8); + + DestroyWindow(hwnd); + + /* Make sure the behaviour is the same with a unicode richedit window, + * and using unicode functions. */ + SetLastError(0xdeadbeef); + hwnd = CreateWindowW(RICHEDIT_CLASS20W, NULL, + ES_MULTILINE|WS_POPUP|WS_HSCROLL|WS_VSCROLL|WS_VISIBLE, + 0, 0, 200, 60, NULL, NULL, hmoduleRichEdit, NULL); + if (!hwnd && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED) + { + win_skip("Needed unicode functions are not implemented\n"); + return; + } + + /* Test with a custom word break procedure that uses X as the delimiter. */ + result = SendMessageW(hwnd, WM_SETTEXT, 0, (LPARAM)textW); + ok (result == TRUE, "Failed to clear the text.\n"); + SendMessageW(hwnd, EM_SETWORDBREAKPROC, 0, (LPARAM)customWordBreakProc); + /* |one twoXthree */ + SEND_CTRL_RIGHT(hwnd); + /* one twoX|three */ + SendMessageW(hwnd, EM_GETSEL, (WPARAM)&sel_start, (LPARAM)&sel_end); + ok(sel_start == sel_end, "Selection should be empty\n"); + ok(sel_start == 8, "Cursor is at %d instead of %d\n", sel_start, 8); + DestroyWindow(hwnd); } @@ -5467,7 +5707,7 @@ static void test_word_wrap(void) POINTL point = {0, 60}; /* This point must be below the first line */ const char *text = "Must be long enough to test line wrapping"; DWORD dwCommonStyle = WS_VISIBLE|WS_POPUP|WS_VSCROLL|ES_MULTILINE; - int res, pos; + int res, pos, lines; /* Test the effect of WS_HSCROLL and ES_AUTOHSCROLL styles on wrapping * when specified on window creation and set later. */ @@ -5478,6 +5718,8 @@ static void test_word_wrap(void) ok(res, "WM_SETTEXT failed.\n"); pos = SendMessage(hwnd, EM_CHARFROMPOS, 0, (LPARAM) &point); ok(pos, "pos=%d indicating no word wrap when it is expected.\n", pos); + lines = SendMessage(hwnd, EM_GETLINECOUNT, 0, 0); + ok(lines > 1, "Line was expected to wrap (lines=%d).\n", lines); SetWindowLongW(hwnd, GWL_STYLE, dwCommonStyle|WS_HSCROLL|ES_AUTOHSCROLL); pos = SendMessage(hwnd, EM_CHARFROMPOS, 0, (LPARAM) &point); @@ -5492,6 +5734,8 @@ static void test_word_wrap(void) ok(res, "WM_SETTEXT failed.\n"); pos = SendMessage(hwnd, EM_CHARFROMPOS, 0, (LPARAM) &point); ok(!pos, "pos=%d indicating word wrap when none is expected.\n", pos); + lines = SendMessage(hwnd, EM_GETLINECOUNT, 0, 0); + ok(lines == 1, "Line wasn't expected to wrap (lines=%d).\n", lines); SetWindowLongW(hwnd, GWL_STYLE, dwCommonStyle); pos = SendMessage(hwnd, EM_CHARFROMPOS, 0, (LPARAM) &point); @@ -5535,6 +5779,54 @@ static void test_word_wrap(void) pos = SendMessage(hwnd, EM_CHARFROMPOS, 0, (LPARAM) &point); ok(pos, "pos=%d indicating no word wrap when it is expected.\n", pos); DestroyWindow(hwnd); + + /* Test to see if wrapping happens with redraw disabled. */ + hwnd = CreateWindow(RICHEDIT_CLASS, NULL, dwCommonStyle, + 0, 0, 400, 80, NULL, NULL, hmoduleRichEdit, NULL); + ok(hwnd != NULL, "error: %d\n", (int) GetLastError()); + SendMessage(hwnd, WM_SETREDRAW, FALSE, 0); + res = SendMessage(hwnd, EM_REPLACESEL, FALSE, (LPARAM) text); + ok(res, "EM_REPLACESEL failed.\n"); + lines = SendMessage(hwnd, EM_GETLINECOUNT, 0, 0); + ok(lines == 1, "Line wasn't expected to wrap (lines=%d).\n", lines); + MoveWindow(hwnd, 0, 0, 200, 80, FALSE); + lines = SendMessage(hwnd, EM_GETLINECOUNT, 0, 0); + ok(lines > 1, "Line was expected to wrap (lines=%d).\n", lines); + + SendMessage(hwnd, WM_SETREDRAW, TRUE, 0); + DestroyWindow(hwnd); +} + +static void test_auto_yscroll(void) +{ + HWND hwnd = new_richedit(NULL); + int lines, ret, redraw; + POINT pt; + + for (redraw = 0; redraw <= 1; redraw++) { + trace("testing with WM_SETREDRAW=%d\n", redraw); + SendMessage(hwnd, WM_SETREDRAW, redraw, 0); + SendMessage(hwnd, EM_REPLACESEL, 0, (LPARAM)"1\n2\n3\n4\n5\n6\n7\n8"); + lines = SendMessage(hwnd, EM_GETLINECOUNT, 0, 0); + ok(lines == 8, "%d lines instead of 8\n", lines); + ret = SendMessage(hwnd, EM_GETSCROLLPOS, 0, (LPARAM)&pt); + ok(ret == 1, "EM_GETSCROLLPOS returned %d instead of 1\n", ret); + ok(pt.y != 0, "Didn't scroll down after replacing text.\n"); + ret = GetWindowLong(hwnd, GWL_STYLE); + ok(ret & WS_VSCROLL, "Scrollbar was not shown yet (style=%x).\n", (UINT)ret); + + SendMessage(hwnd, WM_SETTEXT, 0, (LPARAM)NULL); + lines = SendMessage(hwnd, EM_GETLINECOUNT, 0, 0); + ok(lines == 1, "%d lines instead of 1\n", lines); + ret = SendMessage(hwnd, EM_GETSCROLLPOS, 0, (LPARAM)&pt); + ok(ret == 1, "EM_GETSCROLLPOS returned %d instead of 1\n", ret); + ok(pt.y == 0, "y scroll position is %d after clearing text.\n", pt.y); + ret = GetWindowLong(hwnd, GWL_STYLE); + ok(!(ret & WS_VSCROLL), "Scrollbar is still shown (style=%x).\n", (UINT)ret); + } + + SendMessage(hwnd, WM_SETREDRAW, TRUE, 0); + DestroyWindow(hwnd); } START_TEST( editor ) @@ -5585,6 +5877,7 @@ START_TEST( editor ) test_EM_CHARFROMPOS(); test_SETPARAFORMAT(); test_word_wrap(); + test_auto_yscroll(); /* Set the environment variable WINETEST_RICHED20 to keep windows * responsive and open for 30 seconds. This is useful for debugging. diff --git a/dlls/riched20/wrap.c b/dlls/riched20/wrap.c index 53f0bfbdbbd..3ffe09adea9 100644 --- a/dlls/riched20/wrap.c +++ b/dlls/riched20/wrap.c @@ -735,30 +735,31 @@ BOOL ME_WrapMarkedParagraphs(ME_TextEditor *editor) { return bModified; } -void ME_InvalidateMarkedParagraphs(ME_TextEditor *editor) { +void ME_InvalidateMarkedParagraphs(ME_TextEditor *editor) +{ ME_Context c; + RECT rc; + int ofs; + ME_DisplayItem *item; ME_InitContext(&c, editor, GetDC(editor->hWnd)); - if (editor->bRedraw) - { - RECT rc = c.rcView; - int ofs = ME_GetYScrollPos(editor); - - ME_DisplayItem *item = editor->pBuffer->pFirst; - while(item != editor->pBuffer->pLast) { - if (item->member.para.nFlags & MEPF_REPAINT) { - rc.top = item->member.para.pt.y - ofs; - rc.bottom = item->member.para.pt.y + item->member.para.nHeight - ofs; - InvalidateRect(editor->hWnd, &rc, TRUE); - } - item = item->member.para.next_para; - } - if (editor->nTotalLength < editor->nLastTotalLength) - { - rc.top = editor->nTotalLength - ofs; - rc.bottom = editor->nLastTotalLength - ofs; + rc = c.rcView; + ofs = ME_GetYScrollPos(editor); + + item = editor->pBuffer->pFirst; + while(item != editor->pBuffer->pLast) { + if (item->member.para.nFlags & MEPF_REPAINT) { + rc.top = item->member.para.pt.y - ofs; + rc.bottom = item->member.para.pt.y + item->member.para.nHeight - ofs; InvalidateRect(editor->hWnd, &rc, TRUE); } + item = item->member.para.next_para; + } + if (editor->nTotalLength < editor->nLastTotalLength) + { + rc.top = editor->nTotalLength - ofs; + rc.bottom = editor->nLastTotalLength - ofs; + InvalidateRect(editor->hWnd, &rc, TRUE); } ME_DestroyContext(&c, editor->hWnd); } diff --git a/dlls/riched32/tests/editor.c b/dlls/riched32/tests/editor.c index 1d07b8d81da..2bf44f91640 100644 --- a/dlls/riched32/tests/editor.c +++ b/dlls/riched32/tests/editor.c @@ -742,9 +742,7 @@ static void test_EM_POSFROMCHAR(void) if (i == 0) { ok(pl.y == 0, "EM_POSFROMCHAR reports y=%d, expected 0\n", pl.y); - todo_wine { ok(pl.x == 1, "EM_POSFROMCHAR reports x=%d, expected 1\n", pl.x); - } xpos = pl.x; } else if (i == 1) @@ -805,9 +803,7 @@ static void test_EM_POSFROMCHAR(void) result = SendMessage(hwndRichEdit, EM_POSFROMCHAR, (WPARAM)&pl, 0); ok(result == 0, "EM_POSFROMCHAR returned %ld, expected 0\n", result); ok(pl.y == 0, "EM_POSFROMCHAR reports y=%d, expected 0\n", pl.y); - todo_wine { ok(pl.x == 1, "EM_POSFROMCHAR reports x=%d, expected 1\n", pl.x); - } xpos = pl.x; SendMessage(hwndRichEdit, WM_HSCROLL, SB_LINERIGHT, 0); diff --git a/dlls/rpcrt4/cproxy.c b/dlls/rpcrt4/cproxy.c index 82726792b2f..7979c0ecb31 100644 --- a/dlls/rpcrt4/cproxy.c +++ b/dlls/rpcrt4/cproxy.c @@ -1,7 +1,7 @@ /* * COM proxy implementation * - * Copyright 2001 Ove Kåven, TransGaming Technologies + * Copyright 2001 Ove Kåven, TransGaming Technologies * * 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/rpcrt4/cpsf.c b/dlls/rpcrt4/cpsf.c index 80b4186a6b0..94496956333 100644 --- a/dlls/rpcrt4/cpsf.c +++ b/dlls/rpcrt4/cpsf.c @@ -1,7 +1,7 @@ /* * COM proxy/stub factory (CStdPSFactory) implementation * - * Copyright 2001 Ove Kåven, TransGaming Technologies + * Copyright 2001 Ove Kåven, TransGaming Technologies * * 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/rpcrt4/cpsf.h b/dlls/rpcrt4/cpsf.h index 5ce8fe6575e..d8867d40e60 100644 --- a/dlls/rpcrt4/cpsf.h +++ b/dlls/rpcrt4/cpsf.h @@ -1,7 +1,7 @@ /* * COM proxy definitions * - * Copyright 2001 Ove Kåven, TransGaming Technologies + * Copyright 2001 Ove Kåven, TransGaming Technologies * * 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/rpcrt4/cstub.c b/dlls/rpcrt4/cstub.c index 869265fcdc2..85411cd81e9 100644 --- a/dlls/rpcrt4/cstub.c +++ b/dlls/rpcrt4/cstub.c @@ -1,7 +1,7 @@ /* * COM stub (CStdStubBuffer) implementation * - * Copyright 2001 Ove Kåven, TransGaming Technologies + * Copyright 2001 Ove Kåven, TransGaming Technologies * * 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/rpcrt4/ndr_clientserver.c b/dlls/rpcrt4/ndr_clientserver.c index 968ea61134f..a051489dab2 100644 --- a/dlls/rpcrt4/ndr_clientserver.c +++ b/dlls/rpcrt4/ndr_clientserver.c @@ -1,7 +1,7 @@ /* * MIDL proxy/stub stuff * - * Copyright 2002 Ove Kåven, TransGaming Technologies + * Copyright 2002 Ove Kåven, TransGaming Technologies * * 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/rpcrt4/ndr_es.c b/dlls/rpcrt4/ndr_es.c index 3423d396cb8..b0bb7cc5f40 100644 --- a/dlls/rpcrt4/ndr_es.c +++ b/dlls/rpcrt4/ndr_es.c @@ -156,7 +156,18 @@ RPC_STATUS RPC_ENTRY MesEncodeFixedBufferHandleCreate( *pHandle = (handle_t)pEsMsg; - return RPC_S_OK;} + return RPC_S_OK; +} + +/*********************************************************************** + * MesEncodeDynBufferHandleCreate [RPCRT4.@] + */ +RPC_STATUS RPC_ENTRY MesEncodeDynBufferHandleCreate(char **ppBuffer, + ULONG *pEncodedSize, handle_t *pHandle) +{ + FIXME("%p %p %p stub\n", ppBuffer, pEncodedSize, pHandle); + return RPC_S_OK; +} /*********************************************************************** * MesDecodeBufferHandleCreate [RPCRT4.@] diff --git a/dlls/rpcrt4/ndr_misc.h b/dlls/rpcrt4/ndr_misc.h index b6dfaffe768..c3beff4d725 100644 --- a/dlls/rpcrt4/ndr_misc.h +++ b/dlls/rpcrt4/ndr_misc.h @@ -1,7 +1,7 @@ /* * NDR definitions * - * Copyright 2001 Ove Kåven, TransGaming Technologies + * Copyright 2001 Ove Kåven, TransGaming Technologies * * 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/rpcrt4/ndr_ole.c b/dlls/rpcrt4/ndr_ole.c index 9bfab956d0e..729ab0b9f1e 100644 --- a/dlls/rpcrt4/ndr_ole.c +++ b/dlls/rpcrt4/ndr_ole.c @@ -1,7 +1,7 @@ /* * OLE32 callouts, COM interface marshalling * - * Copyright 2001 Ove Kåven, TransGaming Technologies + * Copyright 2001 Ove Kåven, TransGaming Technologies * * 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/rpcrt4/ndr_stubless.c b/dlls/rpcrt4/ndr_stubless.c index 275502a7e6d..0daf22e9364 100644 --- a/dlls/rpcrt4/ndr_stubless.c +++ b/dlls/rpcrt4/ndr_stubless.c @@ -1,7 +1,7 @@ /* * NDR -Oi,-Oif,-Oicf Interpreter * - * Copyright 2001 Ove Kåven, TransGaming Technologies + * Copyright 2001 Ove Kåven, TransGaming Technologies * Copyright 2003-5 Robert Shearman (for CodeWeavers) * * This library is free software; you can redistribute it and/or diff --git a/dlls/rpcrt4/rpc_binding.c b/dlls/rpcrt4/rpc_binding.c index db46b8c4539..71d3c395ebc 100644 --- a/dlls/rpcrt4/rpc_binding.c +++ b/dlls/rpcrt4/rpc_binding.c @@ -1,7 +1,7 @@ /* * RPC binding API * - * Copyright 2001 Ove Kåven, TransGaming Technologies + * Copyright 2001 Ove Kåven, TransGaming Technologies * Copyright 2003 Mike Hearn * Copyright 2004 Filip Navara * Copyright 2006 CodeWeavers diff --git a/dlls/rpcrt4/rpc_binding.h b/dlls/rpcrt4/rpc_binding.h index 7f446e65302..25a21083ceb 100644 --- a/dlls/rpcrt4/rpc_binding.h +++ b/dlls/rpcrt4/rpc_binding.h @@ -1,7 +1,7 @@ /* * RPC binding API * - * Copyright 2001 Ove Kåven, TransGaming Technologies + * Copyright 2001 Ove Kåven, TransGaming Technologies * * 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/rpcrt4/rpc_defs.h b/dlls/rpcrt4/rpc_defs.h index f552490ade7..cae77c4f356 100644 --- a/dlls/rpcrt4/rpc_defs.h +++ b/dlls/rpcrt4/rpc_defs.h @@ -1,7 +1,7 @@ /* * RPC definitions * - * Copyright 2001-2002 Ove Kåven, TransGaming Technologies + * Copyright 2001-2002 Ove Kåven, TransGaming Technologies * Copyright 2004 Filip Navara * * This library is free software; you can redistribute it and/or diff --git a/dlls/rpcrt4/rpc_epmap.c b/dlls/rpcrt4/rpc_epmap.c index 5776d22673d..de200f42a65 100644 --- a/dlls/rpcrt4/rpc_epmap.c +++ b/dlls/rpcrt4/rpc_epmap.c @@ -2,7 +2,7 @@ * RPC endpoint mapper * * Copyright 2002 Greg Turner - * Copyright 2001 Ove Kåven, TransGaming Technologies + * Copyright 2001 Ove Kåven, TransGaming Technologies * Copyright 2008 Robert Shearman (for CodeWeavers) * * This library is free software; you can redistribute it and/or diff --git a/dlls/rpcrt4/rpc_message.c b/dlls/rpcrt4/rpc_message.c index a82f4be0ce9..e59fc81d809 100644 --- a/dlls/rpcrt4/rpc_message.c +++ b/dlls/rpcrt4/rpc_message.c @@ -1,7 +1,7 @@ /* * RPC messages * - * Copyright 2001-2002 Ove Kåven, TransGaming Technologies + * Copyright 2001-2002 Ove Kåven, TransGaming Technologies * Copyright 2004 Filip Navara * Copyright 2006 CodeWeavers * diff --git a/dlls/rpcrt4/rpc_server.c b/dlls/rpcrt4/rpc_server.c index dea1f1b9f71..5fa96321792 100644 --- a/dlls/rpcrt4/rpc_server.c +++ b/dlls/rpcrt4/rpc_server.c @@ -1,7 +1,7 @@ /* * RPC server API * - * Copyright 2001 Ove Kåven, TransGaming Technologies + * Copyright 2001 Ove Kåven, TransGaming Technologies * Copyright 2004 Filip Navara * Copyright 2006-2008 Robert Shearman (for CodeWeavers) * diff --git a/dlls/rpcrt4/rpc_server.h b/dlls/rpcrt4/rpc_server.h index f1804d307e7..ffd5b016e4b 100644 --- a/dlls/rpcrt4/rpc_server.h +++ b/dlls/rpcrt4/rpc_server.h @@ -1,7 +1,7 @@ /* * RPC server API * - * Copyright 2001 Ove Kåven, TransGaming Technologies + * Copyright 2001 Ove Kåven, TransGaming Technologies * * 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/rpcrt4/rpc_transport.c b/dlls/rpcrt4/rpc_transport.c index adba3c897a4..13181b7c1dc 100644 --- a/dlls/rpcrt4/rpc_transport.c +++ b/dlls/rpcrt4/rpc_transport.c @@ -1,7 +1,7 @@ /* * RPC transport layer * - * Copyright 2001 Ove Kåven, TransGaming Technologies + * Copyright 2001 Ove Kåven, TransGaming Technologies * Copyright 2003 Mike Hearn * Copyright 2004 Filip Navara * Copyright 2006 Mike McCormack diff --git a/dlls/rpcrt4/rpcrt4.spec b/dlls/rpcrt4/rpcrt4.spec index 1a56c08a8ec..2c86e68032f 100644 --- a/dlls/rpcrt4/rpcrt4.spec +++ b/dlls/rpcrt4/rpcrt4.spec @@ -99,7 +99,7 @@ @ stub MesBufferHandleReset @ stdcall MesDecodeBufferHandleCreate(ptr long ptr) @ stdcall MesDecodeIncrementalHandleCreate(ptr ptr ptr) -@ stub MesEncodeDynBufferHandleCreate +@ stdcall MesEncodeDynBufferHandleCreate(ptr ptr ptr) @ stdcall MesEncodeFixedBufferHandleCreate(ptr long ptr ptr) @ stdcall MesEncodeIncrementalHandleCreate(ptr ptr ptr ptr) @ stdcall MesHandleFree(ptr) diff --git a/dlls/sane.ds/rsrc.rc b/dlls/sane.ds/rsrc.rc index 8b8483d3a0d..53d099f8d32 100644 --- a/dlls/sane.ds/rsrc.rc +++ b/dlls/sane.ds/rsrc.rc @@ -35,6 +35,7 @@ #include "sane_Nl.rc" #include "sane_No.rc" #include "sane_Pl.rc" +#include "sane_Pt.rc" #include "sane_Ro.rc" #include "sane_Ru.rc" #include "sane_Si.rc" diff --git a/dlls/winedos/dosvm.h b/dlls/sane.ds/sane_Pt.rc similarity index 61% copy from dlls/winedos/dosvm.h copy to dlls/sane.ds/sane_Pt.rc index 36168283f34..4f4ffea51aa 100644 --- a/dlls/winedos/dosvm.h +++ b/dlls/sane.ds/sane_Pt.rc @@ -1,7 +1,7 @@ /* - * DOS virtual machine + * Portuguese resources for Twain * - * Copyright 2000 Ove Kåven + * Copyright 2008 Ricardo Filipe * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -18,16 +18,23 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#ifndef __WINE_DOSVM_H -#define __WINE_DOSVM_H +LANGUAGE LANG_PORTUGUESE, SUBLANG_NEUTRAL -#include /* pid_t */ +IDD_DIALOG1 DIALOG DISCARDABLE 0, 0, 186, 46 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE | DS_CENTER | DS_SETFOREGROUND +CAPTION "A pesquisar" +FONT 8, "MS Sans Serif" +BEGIN + LTEXT "A PESQUISAR... Por Favor Espere",IDC_STATIC,5,19,176,8, SS_CENTER +END -typedef struct { - PAPCFUNC proc; - ULONG_PTR arg; -} DOS_SPC; - -extern pid_t dosvm_pid; - -#endif /* __WINE_DOSVM_H */ +STRINGTABLE DISCARDABLE +{ + 0 "" + 1 "px" + 2 "b" + 3 "mm" + 4 "dpi" + 5 "%" + 6 "ns" +} diff --git a/dlls/secur32/schannel.c b/dlls/secur32/schannel.c index 402383f7379..5ba4dfc1245 100644 --- a/dlls/secur32/schannel.c +++ b/dlls/secur32/schannel.c @@ -1,4 +1,5 @@ /* Copyright (C) 2005 Juan Lang + * Copyright 2008 Henri Verbeet * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -22,6 +23,8 @@ #include "wine/port.h" #include +#include +#include #ifdef SONAME_LIBGNUTLS #include #endif @@ -41,13 +44,24 @@ WINE_DEFAULT_DEBUG_CHANNEL(secur32); static void *libgnutls_handle; #define MAKE_FUNCPTR(f) static typeof(f) * p##f +MAKE_FUNCPTR(gnutls_alert_get); +MAKE_FUNCPTR(gnutls_alert_get_name); MAKE_FUNCPTR(gnutls_certificate_allocate_credentials); MAKE_FUNCPTR(gnutls_certificate_free_credentials); +MAKE_FUNCPTR(gnutls_credentials_set); +MAKE_FUNCPTR(gnutls_deinit); MAKE_FUNCPTR(gnutls_global_deinit); MAKE_FUNCPTR(gnutls_global_init); MAKE_FUNCPTR(gnutls_global_set_log_function); MAKE_FUNCPTR(gnutls_global_set_log_level); +MAKE_FUNCPTR(gnutls_handshake); +MAKE_FUNCPTR(gnutls_init); MAKE_FUNCPTR(gnutls_perror); +MAKE_FUNCPTR(gnutls_set_default_priority); +MAKE_FUNCPTR(gnutls_transport_set_errno); +MAKE_FUNCPTR(gnutls_transport_set_ptr); +MAKE_FUNCPTR(gnutls_transport_set_pull_function); +MAKE_FUNCPTR(gnutls_transport_set_push_function); #undef MAKE_FUNCPTR #define SCHAN_INVALID_HANDLE ~0UL @@ -55,6 +69,7 @@ MAKE_FUNCPTR(gnutls_perror); enum schan_handle_type { SCHAN_HANDLE_CRED, + SCHAN_HANDLE_CTX, SCHAN_HANDLE_FREE }; @@ -70,6 +85,30 @@ struct schan_credentials gnutls_certificate_credentials credentials; }; +struct schan_context +{ + gnutls_session_t session; + ULONG req_ctx_attr; +}; + +struct schan_transport; + +struct schan_buffers +{ + SIZE_T offset; + const SecBufferDesc *desc; + int current_buffer_idx; + BOOL allow_buffer_resize; + int (*get_next_buffer)(const struct schan_transport *, struct schan_buffers *); +}; + +struct schan_transport +{ + struct schan_context *ctx; + struct schan_buffers in; + struct schan_buffers out; +}; + static struct schan_handle *schan_handle_table; static struct schan_handle *schan_free_handles; static SIZE_T schan_handle_table_size; @@ -136,8 +175,23 @@ static void *schan_free_handle(ULONG_PTR handle_idx, enum schan_handle_type type return object; } +static void *schan_get_object(ULONG_PTR handle_idx, enum schan_handle_type type) +{ + struct schan_handle *handle; + + if (handle_idx == SCHAN_INVALID_HANDLE) return NULL; + handle = &schan_handle_table[handle_idx]; + if (handle->type != type) + { + ERR("Handle %ld(%p) is not of type %#x\n", handle_idx, handle, type); + return NULL; + } + + return handle->object; +} + static SECURITY_STATUS schan_QueryCredentialsAttributes( - PCredHandle phCredential, ULONG ulAttribute, const VOID *pBuffer) + PCredHandle phCredential, ULONG ulAttribute, VOID *pBuffer) { SECURITY_STATUS ret; @@ -295,6 +349,7 @@ static SECURITY_STATUS schan_AcquireClientCredentials(const SCHANNEL_CRED *schan if (ret != GNUTLS_E_SUCCESS) { pgnutls_perror(ret); + schan_free_handle(handle, SCHAN_HANDLE_CRED); goto fail; } @@ -406,6 +461,161 @@ static SECURITY_STATUS SEC_ENTRY schan_FreeCredentialsHandle( return SEC_E_OK; } +static void init_schan_buffers(struct schan_buffers *s, const PSecBufferDesc desc, + int (*get_next_buffer)(const struct schan_transport *, struct schan_buffers *)) +{ + s->offset = 0; + s->desc = desc; + s->current_buffer_idx = -1; + s->allow_buffer_resize = FALSE; + s->get_next_buffer = get_next_buffer; +} + +static int schan_find_sec_buffer_idx(const SecBufferDesc *desc, unsigned int start_idx, ULONG buffer_type) +{ + unsigned int i; + PSecBuffer buffer; + + for (i = start_idx; i < desc->cBuffers; ++i) + { + buffer = &desc->pBuffers[i]; + if (buffer->BufferType == buffer_type) return i; + } + + return -1; +} + +static void schan_resize_current_buffer(const struct schan_buffers *s, SIZE_T min_size) +{ + SecBuffer *b = &s->desc->pBuffers[s->current_buffer_idx]; + SIZE_T new_size = b->cbBuffer ? b->cbBuffer * 2 : 128; + void *new_data; + + if (b->cbBuffer >= min_size || !s->allow_buffer_resize || min_size > UINT_MAX / 2) return; + + while (new_size < min_size) new_size *= 2; + + if (b->pvBuffer) + new_data = HeapReAlloc(GetProcessHeap(), 0, b->pvBuffer, new_size); + else + new_data = HeapAlloc(GetProcessHeap(), 0, new_size); + + if (!new_data) + { + TRACE("Failed to resize %p from %ld to %ld\n", b->pvBuffer, b->cbBuffer, new_size); + return; + } + + b->cbBuffer = new_size; + b->pvBuffer = new_data; +} + +static char *schan_get_buffer(const struct schan_transport *t, struct schan_buffers *s, size_t *count) +{ + SIZE_T max_count; + PSecBuffer buffer; + + if (!s->desc) + { + TRACE("No desc\n"); + return NULL; + } + + if (s->current_buffer_idx == -1) + { + /* Initial buffer */ + int buffer_idx = s->get_next_buffer(t, s); + if (buffer_idx == -1) + { + TRACE("No next buffer\n"); + return NULL; + } + s->current_buffer_idx = buffer_idx; + } + + buffer = &s->desc->pBuffers[s->current_buffer_idx]; + TRACE("Using buffer %d: cbBuffer %ld, BufferType %#lx, pvBuffer %p\n", s->current_buffer_idx, buffer->cbBuffer, buffer->BufferType, buffer->pvBuffer); + + schan_resize_current_buffer(s, s->offset + *count); + max_count = buffer->cbBuffer - s->offset; + if (!max_count) + { + int buffer_idx; + + s->allow_buffer_resize = FALSE; + buffer_idx = s->get_next_buffer(t, s); + if (buffer_idx == -1) + { + TRACE("No next buffer\n"); + return NULL; + } + s->current_buffer_idx = buffer_idx; + s->offset = 0; + return schan_get_buffer(t, s, count); + } + + if (*count > max_count) *count = max_count; + return (char *)buffer->pvBuffer + s->offset; +} + +static ssize_t schan_pull(gnutls_transport_ptr_t transport, void *buff, size_t buff_len) +{ + struct schan_transport *t = (struct schan_transport *)transport; + char *b; + + TRACE("Pull %zu bytes\n", buff_len); + + b = schan_get_buffer(t, &t->in, &buff_len); + if (!b) + { + pgnutls_transport_set_errno(t->ctx->session, EAGAIN); + return -1; + } + + memcpy(buff, b, buff_len); + t->in.offset += buff_len; + + TRACE("Read %zu bytes\n", buff_len); + + return buff_len; +} + +static ssize_t schan_push(gnutls_transport_ptr_t transport, const void *buff, size_t buff_len) +{ + struct schan_transport *t = (struct schan_transport *)transport; + char *b; + + TRACE("Push %zu bytes\n", buff_len); + + b = schan_get_buffer(t, &t->out, &buff_len); + if (!b) + { + pgnutls_transport_set_errno(t->ctx->session, EAGAIN); + return -1; + } + + memcpy(b, buff, buff_len); + t->out.offset += buff_len; + + TRACE("Wrote %zu bytes\n", buff_len); + + return buff_len; +} + +static int schan_init_sec_ctx_get_next_buffer(const struct schan_transport *t, struct schan_buffers *s) +{ + if (s->current_buffer_idx == -1) + { + int idx = schan_find_sec_buffer_idx(s->desc, 0, SECBUFFER_TOKEN); + if (idx != -1 && !s->desc->pBuffers[idx].pvBuffer + && (t->ctx->req_ctx_attr & ISC_REQ_ALLOCATE_MEMORY)) + s->allow_buffer_resize = TRUE; + return idx; + } + + return -1; +} + /*********************************************************************** * InitializeSecurityContextW */ @@ -415,21 +625,125 @@ static SECURITY_STATUS SEC_ENTRY schan_InitializeSecurityContextW( PSecBufferDesc pInput, ULONG Reserved2, PCtxtHandle phNewContext, PSecBufferDesc pOutput, ULONG *pfContextAttr, PTimeStamp ptsExpiry) { - SECURITY_STATUS ret; + struct schan_context *ctx; + struct schan_buffers *out_buffers; + struct schan_credentials *cred; + struct schan_transport transport; + int err; TRACE("%p %p %s %d %d %d %p %d %p %p %p %p\n", phCredential, phContext, debugstr_w(pszTargetName), fContextReq, Reserved1, TargetDataRep, pInput, Reserved1, phNewContext, pOutput, pfContextAttr, ptsExpiry); - if (phCredential) + + if (!phContext) { - FIXME("stub\n"); - ret = SEC_E_UNSUPPORTED_FUNCTION; + ULONG_PTR handle; + + if (!phCredential) return SEC_E_INVALID_HANDLE; + + cred = schan_get_object(phCredential->dwLower, SCHAN_HANDLE_CRED); + if (!cred) return SEC_E_INVALID_HANDLE; + + if (!(cred->credential_use & SECPKG_CRED_OUTBOUND)) + { + WARN("Invalid credential use %#x\n", cred->credential_use); + return SEC_E_INVALID_HANDLE; + } + + ctx = HeapAlloc(GetProcessHeap(), 0, sizeof(*ctx)); + if (!ctx) return SEC_E_INSUFFICIENT_MEMORY; + + handle = schan_alloc_handle(ctx, SCHAN_HANDLE_CTX); + if (handle == SCHAN_INVALID_HANDLE) + { + HeapFree(GetProcessHeap(), 0, ctx); + return SEC_E_INTERNAL_ERROR; + } + + err = pgnutls_init(&ctx->session, GNUTLS_CLIENT); + if (err != GNUTLS_E_SUCCESS) + { + pgnutls_perror(err); + schan_free_handle(handle, SCHAN_HANDLE_CTX); + HeapFree(GetProcessHeap(), 0, ctx); + return SEC_E_INTERNAL_ERROR; + } + + /* FIXME: We should be using the information from the credentials here. */ + FIXME("Using hardcoded \"NORMAL\" priority\n"); + err = pgnutls_set_default_priority(ctx->session); + if (err != GNUTLS_E_SUCCESS) + { + pgnutls_perror(err); + pgnutls_deinit(ctx->session); + schan_free_handle(handle, SCHAN_HANDLE_CTX); + HeapFree(GetProcessHeap(), 0, ctx); + } + + err = pgnutls_credentials_set(ctx->session, GNUTLS_CRD_CERTIFICATE, cred->credentials); + if (err != GNUTLS_E_SUCCESS) + { + pgnutls_perror(err); + pgnutls_deinit(ctx->session); + schan_free_handle(handle, SCHAN_HANDLE_CTX); + HeapFree(GetProcessHeap(), 0, ctx); + } + + pgnutls_transport_set_pull_function(ctx->session, schan_pull); + pgnutls_transport_set_push_function(ctx->session, schan_push); + + phNewContext->dwLower = handle; + phNewContext->dwUpper = 0; } else { - ret = SEC_E_INVALID_HANDLE; + ctx = schan_get_object(phContext->dwLower, SCHAN_HANDLE_CTX); + } + + ctx->req_ctx_attr = fContextReq; + + transport.ctx = ctx; + init_schan_buffers(&transport.in, pInput, schan_init_sec_ctx_get_next_buffer); + init_schan_buffers(&transport.out, pOutput, schan_init_sec_ctx_get_next_buffer); + pgnutls_transport_set_ptr(ctx->session, &transport); + + /* Perform the TLS handshake */ + err = pgnutls_handshake(ctx->session); + + out_buffers = &transport.out; + if (out_buffers->current_buffer_idx != -1) + { + SecBuffer *buffer = &out_buffers->desc->pBuffers[out_buffers->current_buffer_idx]; + buffer->cbBuffer = out_buffers->offset; + } + + *pfContextAttr = 0; + if (ctx->req_ctx_attr & ISC_REQ_ALLOCATE_MEMORY) + *pfContextAttr |= ISC_RET_ALLOCATED_MEMORY; + + switch(err) + { + case GNUTLS_E_SUCCESS: + TRACE("Handshake completed\n"); + return SEC_E_OK; + + case GNUTLS_E_AGAIN: + TRACE("Continue...\n"); + return SEC_I_CONTINUE_NEEDED; + + case GNUTLS_E_WARNING_ALERT_RECEIVED: + case GNUTLS_E_FATAL_ALERT_RECEIVED: + { + gnutls_alert_description_t alert = pgnutls_alert_get(ctx->session); + const char *alert_name = pgnutls_alert_get_name(alert); + WARN("ALERT: %d %s\n", alert, alert_name); + return SEC_E_INTERNAL_ERROR; + } + + default: + pgnutls_perror(err); + return SEC_E_INTERNAL_ERROR; } - return ret; } /*********************************************************************** @@ -464,6 +778,23 @@ static SECURITY_STATUS SEC_ENTRY schan_InitializeSecurityContextA( return ret; } +static SECURITY_STATUS SEC_ENTRY schan_DeleteSecurityContext(PCtxtHandle context_handle) +{ + struct schan_context *ctx; + + TRACE("context_handle %p\n", context_handle); + + if (!context_handle) return SEC_E_INVALID_HANDLE; + + ctx = schan_free_handle(context_handle->dwLower, SCHAN_HANDLE_CTX); + if (!ctx) return SEC_E_INVALID_HANDLE; + + pgnutls_deinit(ctx->session); + HeapFree(GetProcessHeap(), 0, ctx); + + return SEC_E_OK; +} + static void schan_gnutls_log(int level, const char *msg) { TRACE("<%d> %s", level, msg); @@ -479,7 +810,7 @@ static const SecurityFunctionTableA schanTableA = { schan_InitializeSecurityContextA, NULL, /* AcceptSecurityContext */ NULL, /* CompleteAuthToken */ - NULL, /* DeleteSecurityContext */ + schan_DeleteSecurityContext, NULL, /* ApplyControlToken */ NULL, /* QueryContextAttributesA */ NULL, /* ImpersonateSecurityContext */ @@ -510,7 +841,7 @@ static const SecurityFunctionTableW schanTableW = { schan_InitializeSecurityContextW, NULL, /* AcceptSecurityContext */ NULL, /* CompleteAuthToken */ - NULL, /* DeleteSecurityContext */ + schan_DeleteSecurityContext, NULL, /* ApplyControlToken */ NULL, /* QueryContextAttributesW */ NULL, /* ImpersonateSecurityContext */ @@ -537,8 +868,30 @@ static const WCHAR schannelDllName[] = { 's','c','h','a','n','n','e','l','.','d' void SECUR32_initSchannelSP(void) { + /* This is what Windows reports. This shouldn't break any applications + * even though the functions are missing, because the wrapper will + * return SEC_E_UNSUPPORTED_FUNCTION if our function is NULL. + */ + static const long caps = + SECPKG_FLAG_INTEGRITY | + SECPKG_FLAG_PRIVACY | + SECPKG_FLAG_CONNECTION | + SECPKG_FLAG_MULTI_REQUIRED | + SECPKG_FLAG_EXTENDED_ERROR | + SECPKG_FLAG_IMPERSONATION | + SECPKG_FLAG_ACCEPT_WIN32_NAME | + SECPKG_FLAG_STREAM; + static const short version = 1; + static const long maxToken = 16384; + SEC_WCHAR *uniSPName = (SEC_WCHAR *)UNISP_NAME_W, + *schannel = (SEC_WCHAR *)SCHANNEL_NAME_W; + const SecPkgInfoW info[] = { + { caps, version, UNISP_RPC_ID, maxToken, uniSPName, uniSPName }, + { caps, version, UNISP_RPC_ID, maxToken, schannel, + (SEC_WCHAR *)schannelComment }, + }; SecureProvider *provider; - + int ret; libgnutls_handle = wine_dlopen(SONAME_LIBGNUTLS, RTLD_NOW, NULL, 0); if (!libgnutls_handle) @@ -551,67 +904,75 @@ void SECUR32_initSchannelSP(void) if (!(p##f = wine_dlsym(libgnutls_handle, #f, NULL, 0))) \ { \ ERR("Failed to load %s\n", #f); \ - wine_dlclose(libgnutls_handle, NULL, 0); \ - libgnutls_handle = NULL; \ - return; \ + goto fail; \ } + LOAD_FUNCPTR(gnutls_alert_get) + LOAD_FUNCPTR(gnutls_alert_get_name) LOAD_FUNCPTR(gnutls_certificate_allocate_credentials) LOAD_FUNCPTR(gnutls_certificate_free_credentials) + LOAD_FUNCPTR(gnutls_credentials_set) + LOAD_FUNCPTR(gnutls_deinit) LOAD_FUNCPTR(gnutls_global_deinit) LOAD_FUNCPTR(gnutls_global_init) LOAD_FUNCPTR(gnutls_global_set_log_function) LOAD_FUNCPTR(gnutls_global_set_log_level) + LOAD_FUNCPTR(gnutls_handshake) + LOAD_FUNCPTR(gnutls_init) LOAD_FUNCPTR(gnutls_perror) + LOAD_FUNCPTR(gnutls_set_default_priority) + LOAD_FUNCPTR(gnutls_transport_set_errno) + LOAD_FUNCPTR(gnutls_transport_set_ptr) + LOAD_FUNCPTR(gnutls_transport_set_pull_function) + LOAD_FUNCPTR(gnutls_transport_set_push_function) #undef LOAD_FUNCPTR - provider = SECUR32_addProvider(&schanTableA, &schanTableW, schannelDllName); + ret = pgnutls_global_init(); + if (ret != GNUTLS_E_SUCCESS) + { + pgnutls_perror(ret); + goto fail; + } - if (provider) + if (TRACE_ON(secur32)) { - /* This is what Windows reports. This shouldn't break any applications - * even though the functions are missing, because the wrapper will - * return SEC_E_UNSUPPORTED_FUNCTION if our function is NULL. - */ - static const long caps = - SECPKG_FLAG_INTEGRITY | - SECPKG_FLAG_PRIVACY | - SECPKG_FLAG_CONNECTION | - SECPKG_FLAG_MULTI_REQUIRED | - SECPKG_FLAG_EXTENDED_ERROR | - SECPKG_FLAG_IMPERSONATION | - SECPKG_FLAG_ACCEPT_WIN32_NAME | - SECPKG_FLAG_STREAM; - static const short version = 1; - static const long maxToken = 16384; - SEC_WCHAR *uniSPName = (SEC_WCHAR *)UNISP_NAME_W, - *schannel = (SEC_WCHAR *)SCHANNEL_NAME_W; - - const SecPkgInfoW info[] = { - { caps, version, UNISP_RPC_ID, maxToken, uniSPName, uniSPName }, - { caps, version, UNISP_RPC_ID, maxToken, schannel, - (SEC_WCHAR *)schannelComment }, - }; - - SECUR32_addPackages(provider, sizeof(info) / sizeof(info[0]), NULL, - info); - - schan_handle_table = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 64 * sizeof(*schan_handle_table)); - schan_handle_table_size = 64; - - pgnutls_global_init(); - if (TRACE_ON(secur32)) - { - pgnutls_global_set_log_level(4); - pgnutls_global_set_log_function(schan_gnutls_log); - } + pgnutls_global_set_log_level(4); + pgnutls_global_set_log_function(schan_gnutls_log); + } + + schan_handle_table = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 64 * sizeof(*schan_handle_table)); + if (!schan_handle_table) + { + ERR("Failed to allocate schannel handle table.\n"); + goto fail; + } + schan_handle_table_size = 64; + + provider = SECUR32_addProvider(&schanTableA, &schanTableW, schannelDllName); + if (!provider) + { + ERR("Failed to add schannel provider.\n"); + goto fail; } + + SECUR32_addPackages(provider, sizeof(info) / sizeof(info[0]), NULL, info); + + return; + +fail: + HeapFree(GetProcessHeap(), 0, schan_handle_table); + schan_handle_table = NULL; + wine_dlclose(libgnutls_handle, NULL, 0); + libgnutls_handle = NULL; + return; } void SECUR32_deinitSchannelSP(void) { + if (!libgnutls_handle) return; + pgnutls_global_deinit(); - if (libgnutls_handle) wine_dlclose(libgnutls_handle, NULL, 0); + wine_dlclose(libgnutls_handle, NULL, 0); } #else /* SONAME_LIBGNUTLS */ diff --git a/dlls/setupapi/Makefile.in b/dlls/setupapi/Makefile.in index 314500350e5..1f633a48091 100644 --- a/dlls/setupapi/Makefile.in +++ b/dlls/setupapi/Makefile.in @@ -6,7 +6,7 @@ VPATH = @srcdir@ MODULE = setupapi.dll IMPORTLIB = setupapi IMPORTS = uuid user32 version advapi32 rpcrt4 kernel32 ntdll -DELAYIMPORTS = shell32 +DELAYIMPORTS = shell32 wintrust C_SRCS = \ devinst.c \ diff --git a/dlls/setupapi/misc.c b/dlls/setupapi/misc.c index 62abc85759d..7109be9e731 100644 --- a/dlls/setupapi/misc.c +++ b/dlls/setupapi/misc.c @@ -28,13 +28,14 @@ #include "winreg.h" #include "setupapi.h" #include "lzexpand.h" +#include "softpub.h" +#include "mscat.h" #include "wine/unicode.h" #include "wine/debug.h" #include "setupapi_private.h" - WINE_DEFAULT_DEBUG_CHANNEL(setupapi); /* arbitrary limit not related to what native actually uses */ @@ -1052,17 +1053,38 @@ BOOL WINAPI SetupCopyOEMInfW( PCWSTR source, PCWSTR location, sizeof(catalog_file)/sizeof(catalog_file[0]), NULL )) { WCHAR source_cat[MAX_PATH]; - strcpyW( source_cat, source ); + HCATADMIN handle; + HCATINFO cat; + GUID msguid = DRIVER_ACTION_VERIFY; + SetupCloseInfFile( hinf ); + + strcpyW( source_cat, source ); p = strrchrW( source_cat, '\\' ); if (p) p++; else p = source_cat; - strcpyW( p, catalog_file ); - FIXME("install catalog file %s\n", debugstr_w( source_cat )); + TRACE("installing catalog file %s\n", debugstr_w( source_cat )); + + if (!CryptCATAdminAcquireContext(&handle, &msguid, 0)) + { + ERR("Could not acquire security context\n"); + return FALSE; + } + + if (!(cat = CryptCATAdminAddCatalog(handle, source_cat, catalog_file, 0))) + { + ERR("Could not add catalog\n"); + CryptCATAdminReleaseContext(handle, 0); + return FALSE; + } + + CryptCATAdminReleaseCatalogContext(handle, cat, 0); + CryptCATAdminReleaseContext(handle, 0); } - SetupCloseInfFile( hinf ); + else + SetupCloseInfFile( hinf ); if (!(ret = CopyFileW( source, target, (style & SP_COPY_NOOVERWRITE) != 0 ))) return ret; diff --git a/dlls/setupapi/tests/misc.c b/dlls/setupapi/tests/misc.c index bd3f1ce83ef..7164e7dfbf4 100644 --- a/dlls/setupapi/tests/misc.c +++ b/dlls/setupapi/tests/misc.c @@ -203,8 +203,9 @@ static void test_SetupCopyOEMInf(void) SetLastError(0xdeadbeef); res = pSetupCopyOEMInfA(tmpfile, NULL, 0, SP_COPY_NOOVERWRITE, NULL, 0, NULL, NULL); ok(res == FALSE, "Expected FALSE, got %d\n", res); - ok(GetLastError() == ERROR_FILE_NOT_FOUND, - "Expected ERROR_FILE_NOT_FOUND, got %d\n", GetLastError()); + ok(GetLastError() == ERROR_FILE_NOT_FOUND || + GetLastError() == ERROR_FILE_EXISTS, /* Win98 */ + "Expected ERROR_FILE_NOT_FOUND or ERROR_FILE_EXISTS, got %d\n", GetLastError()); ok(file_exists(tmpfile), "Expected tmpfile to exist\n"); /* try SP_COPY_REPLACEONLY, dest does not exist */ diff --git a/dlls/shdocvw/shdocvw.spec b/dlls/shdocvw/shdocvw.spec index 209abd7a85f..1cf297d7640 100644 --- a/dlls/shdocvw/shdocvw.spec +++ b/dlls/shdocvw/shdocvw.spec @@ -37,7 +37,7 @@ 148 stub -noname IEGetDisplayName 149 stub -noname IEBindToObjectEx 150 stub -noname _GetStdLocation -151 stub -noname URLSubRegQueryA +151 stdcall -noname URLSubRegQueryA(str str long ptr long long) 152 stub -noname CShellUIHelper_CreateInstance2 153 stub -noname IsURLChild 158 stub -noname SHRestricted2A diff --git a/dlls/shdocvw/shdocvw_main.c b/dlls/shdocvw/shdocvw_main.c index 99af73b9e53..c9deff19cda 100644 --- a/dlls/shdocvw/shdocvw_main.c +++ b/dlls/shdocvw/shdocvw_main.c @@ -3,6 +3,7 @@ * * Copyright 2001 John R. Sheets (for CodeWeavers) * Copyright 2004 Mike McCormack (for CodeWeavers) + * Copyright 2008 Detlef Riekenberg * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -31,6 +32,7 @@ #include "winreg.h" #include "shlwapi.h" +#include "wininet.h" #include "initguid.h" @@ -268,3 +270,28 @@ DWORD WINAPI StopWatchAFORWARD(DWORD dwClass, LPCSTR lpszStr, DWORD dwUnknown, return p(dwClass, lpszStr, dwUnknown, dwMode, dwTimeStamp); return ERROR_CALL_NOT_IMPLEMENTED; } + +/****************************************************************** + * URLSubRegQueryA (SHDOCVW.151) + */ +HRESULT WINAPI URLSubRegQueryA(LPCSTR regpath, LPCSTR name, DWORD type, + LPSTR out, DWORD outlen, DWORD unknown) +{ + CHAR buffer[INTERNET_MAX_URL_LENGTH]; + DWORD len; + LONG res; + + TRACE("(%s, %s, %d, %p, %d, %d)\n", debugstr_a(regpath), debugstr_a(name), + type, out, outlen, unknown); + + if (!out) return S_OK; + + len = sizeof(buffer); + res = SHRegGetUSValueA(regpath, name, NULL, buffer, &len, FALSE, NULL, 0); + if (!res) { + lstrcpynA(out, buffer, outlen); + return S_OK; + } + + return E_FAIL; +} diff --git a/dlls/shdocvw/tests/Makefile.in b/dlls/shdocvw/tests/Makefile.in index 635d5532605..e20f8edbe1b 100644 --- a/dlls/shdocvw/tests/Makefile.in +++ b/dlls/shdocvw/tests/Makefile.in @@ -7,6 +7,7 @@ IMPORTS = shell32 ole32 oleaut32 user32 advapi32 kernel32 CTESTS = \ intshcut.c \ + shdocvw.c \ shortcut.c \ webbrowser.c diff --git a/dlls/shdocvw/tests/shdocvw.c b/dlls/shdocvw/tests/shdocvw.c new file mode 100644 index 00000000000..f80a1112eb4 --- /dev/null +++ b/dlls/shdocvw/tests/shdocvw.c @@ -0,0 +1,168 @@ +/* + * Unit tests for misc shdocvw functions + * + * Copyright 2008 Detlef Riekenberg + * + * 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 "winreg.h" +#include "wininet.h" + +#include "wine/test.h" + +/* ################ */ + +static HMODULE hshdocvw; +static HRESULT (WINAPI *pURLSubRegQueryA)(LPCSTR, LPCSTR, DWORD, LPVOID, DWORD, DWORD); + +static CHAR appdata[] = "AppData"; +static CHAR common_appdata[] = "Common AppData"; +static CHAR default_page_url[] = "Default_Page_URL"; +static CHAR does_not_exist[] = "does_not_exist"; +static CHAR regpath_iemain[] = "Software\\Microsoft\\Internet Explorer\\Main"; +static CHAR regpath_shellfolders[] = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders"; +static CHAR start_page[] = "Start Page"; + +/* ################ */ + +static void init_functions(void) +{ + hshdocvw = LoadLibraryA("shdocvw.dll"); + pURLSubRegQueryA = (void *) GetProcAddress(hshdocvw, (LPSTR) 151); +} + +/* ################ */ + +static void test_URLSubRegQueryA(void) +{ + CHAR buffer[INTERNET_MAX_URL_LENGTH]; + HRESULT hr; + DWORD used; + DWORD len; + + if (!pURLSubRegQueryA) { + skip("URLSubRegQueryA not found\n"); + return; + } + + memset(buffer, '#', sizeof(buffer)-2); + buffer[sizeof(buffer)-1] = '\0'; + /* called by inetcpl.cpl */ + hr = pURLSubRegQueryA(regpath_iemain, default_page_url, REG_SZ, buffer, INTERNET_MAX_URL_LENGTH, -1); + ok(hr == E_FAIL || hr == S_OK, "got 0x%x (expected E_FAIL or S_OK)\n", hr); + + memset(buffer, '#', sizeof(buffer)-2); + buffer[sizeof(buffer)-1] = '\0'; + /* called by inetcpl.cpl */ + hr = pURLSubRegQueryA(regpath_iemain, start_page, REG_SZ, buffer, INTERNET_MAX_URL_LENGTH, -1); + len = lstrlenA(buffer); + /* respect privacy: do not dump the url */ + ok(hr == S_OK, "got 0x%x and %d (expected S_OK)\n", hr, len); + + /* test buffer length: just large enough */ + memset(buffer, '#', sizeof(buffer)-2); + buffer[sizeof(buffer)-1] = '\0'; + hr = pURLSubRegQueryA(regpath_iemain, start_page, REG_SZ, buffer, len+1, -1); + used = lstrlenA(buffer); + /* respect privacy: do not dump the url */ + ok((hr == S_OK) && (used == len), + "got 0x%x and %d (expected S_OK and %d)\n", hr, used, len); + + /* no space for terminating 0: result is truncated */ + memset(buffer, '#', sizeof(buffer)-2); + buffer[sizeof(buffer)-1] = '\0'; + hr = pURLSubRegQueryA(regpath_iemain, start_page, REG_SZ, buffer, len, -1); + used = lstrlenA(buffer); + ok((hr == S_OK) && (used == len - 1), + "got 0x%x and %d (expected S_OK and %d)\n", hr, used, len - 1); + + /* no space for the complete result: truncate another char */ + if (len > 1) { + memset(buffer, '#', sizeof(buffer)-2); + buffer[sizeof(buffer)-1] = '\0'; + hr = pURLSubRegQueryA(regpath_iemain, start_page, REG_SZ, buffer, len-1, -1); + used = lstrlenA(buffer); + ok((hr == S_OK) && (used == (len - 2)), + "got 0x%x and %d (expected S_OK and %d)\n", hr, used, len - 2); + } + + /* only space for the terminating 0: function still succeded */ + memset(buffer, '#', sizeof(buffer)-2); + buffer[sizeof(buffer)-1] = '\0'; + hr = pURLSubRegQueryA(regpath_iemain, start_page, REG_SZ, buffer, 1, -1); + used = lstrlenA(buffer); + ok((hr == S_OK) && !used, + "got 0x%x and %d (expected S_OK and 0)\n", hr, used); + + /* size of buffer is 0, but the function still succeed */ + memset(buffer, '#', sizeof(buffer)-2); + buffer[sizeof(buffer)-1] = '\0'; + hr = pURLSubRegQueryA(regpath_iemain, start_page, REG_SZ, buffer, 0, -1); + used = lstrlenA(buffer); + ok((hr == S_OK) && (used == INTERNET_MAX_URL_LENGTH - 1), + "got 0x%x and %d (expected S_OK and %d)\n", hr, used, INTERNET_MAX_URL_LENGTH-1); + + /* still succeed without a buffer for the result */ + hr = pURLSubRegQueryA(regpath_iemain, start_page, REG_SZ, NULL, 0, -1); + ok(hr == S_OK, "got 0x%x (expected S_OK)\n", hr); + + /* still succeed, when a length is given without a buffer */ + hr = pURLSubRegQueryA(regpath_iemain, start_page, REG_SZ, NULL, INTERNET_MAX_URL_LENGTH, -1); + ok(hr == S_OK, "got 0x%x (expected S_OK)\n", hr); + + /* this value does not exist */ + memset(buffer, '#', sizeof(buffer)-2); + buffer[sizeof(buffer)-1] = '\0'; + hr = pURLSubRegQueryA(regpath_iemain, does_not_exist, REG_SZ, buffer, INTERNET_MAX_URL_LENGTH, -1); + /* random bytes are copied to the buffer */ + ok((hr == E_FAIL), "got 0x%x (expected E_FAIL)\n", hr); + + /* the third parameter is ignored. Is it really a type? (data is REG_SZ) */ + memset(buffer, '#', sizeof(buffer)-2); + buffer[sizeof(buffer)-1] = '\0'; + hr = pURLSubRegQueryA(regpath_iemain, start_page, REG_DWORD, buffer, INTERNET_MAX_URL_LENGTH, -1); + used = lstrlenA(buffer); + ok((hr == S_OK) && (used == len), + "got 0x%x and %d (expected S_OK and %d)\n", hr, used, len); + + /* the function works for HKCU and HKLM */ + memset(buffer, '#', sizeof(buffer)-2); + buffer[sizeof(buffer)-1] = '\0'; + hr = pURLSubRegQueryA(regpath_shellfolders, appdata, REG_SZ, buffer, INTERNET_MAX_URL_LENGTH, -1); + used = lstrlenA(buffer); + ok(hr == S_OK, "got 0x%x and %d (expected S_OK)\n", hr, used); + + memset(buffer, '#', sizeof(buffer)-2); + buffer[sizeof(buffer)-1] = '\0'; + hr = pURLSubRegQueryA(regpath_shellfolders, common_appdata, REG_SZ, buffer, INTERNET_MAX_URL_LENGTH, -1); + used = lstrlenA(buffer); + ok(hr == S_OK, "got 0x%x and %d (expected S_OK)\n", hr, used); + + /* todo: what does the last parameter mean? */ +} + +/* ################ */ + +START_TEST(shdocvw) +{ + init_functions(); + test_URLSubRegQueryA(); +} diff --git a/dlls/shell32/autocomplete.c b/dlls/shell32/autocomplete.c index c20dec3d4aa..5892b6d1a71 100644 --- a/dlls/shell32/autocomplete.c +++ b/dlls/shell32/autocomplete.c @@ -1,7 +1,7 @@ /* * AutoComplete interfaces implementation. * - * Copyright 2004 Maxime Bellengé + * Copyright 2004 Maxime Bellengé * * 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/shell32/shellord.c b/dlls/shell32/shellord.c index 0905bf9ba1e..56eb3ba4bb6 100644 --- a/dlls/shell32/shellord.c +++ b/dlls/shell32/shellord.c @@ -3,7 +3,7 @@ * (NT uses Unicode strings, 95 uses ASCII strings) * * Copyright 1997 Marcus Meissner - * 1998 Jürgen Schmied + * 1998 Jürgen Schmied * * 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/shell32/shfldr_unixfs.c b/dlls/shell32/shfldr_unixfs.c index 332dd45a3b9..b612ef78b72 100644 --- a/dlls/shell32/shfldr_unixfs.c +++ b/dlls/shell32/shfldr_unixfs.c @@ -128,7 +128,9 @@ #include #include #include -#include +#ifdef HAVE_DIRENT_H +# include +#endif #include #ifdef HAVE_UNISTD_H # include diff --git a/dlls/shell32/tests/shelllink.c b/dlls/shell32/tests/shelllink.c index 76bc3d26d09..7657fe01d64 100644 --- a/dlls/shell32/tests/shelllink.c +++ b/dlls/shell32/tests/shelllink.c @@ -70,7 +70,7 @@ static LPITEMIDLIST path_to_pidl(const char* path) HMODULE hdll=GetModuleHandleA("shell32.dll"); pSHSimpleIDListFromPathAW=(void*)GetProcAddress(hdll, (char*)162); if (!pSHSimpleIDListFromPathAW) - trace("SHSimpleIDListFromPathAW not found in shell32.dll\n"); + win_skip("SHSimpleIDListFromPathAW not found in shell32.dll\n"); } pidl=NULL; diff --git a/dlls/shell32/tests/shlfileop.c b/dlls/shell32/tests/shlfileop.c index 11cc61206e4..6293b9308b2 100644 --- a/dlls/shell32/tests/shlfileop.c +++ b/dlls/shell32/tests/shlfileop.c @@ -1327,8 +1327,8 @@ static void test_sh_create_dir(void) if(!pSHCreateDirectoryExA) { - trace("skipping SHCreateDirectoryExA tests\n"); - return; + win_skip("skipping SHCreateDirectoryExA tests\n"); + return; } set_curr_dir_path(path, "testdir2\\test4.txt\0"); @@ -1351,8 +1351,8 @@ static void test_sh_path_prepare(void) if(!pSHPathPrepareForWriteA) { - trace("skipping SHPathPrepareForWriteA tests\n"); - return; + win_skip("skipping SHPathPrepareForWriteA tests\n"); + return; } /* directory exists, SHPPFW_NONE */ diff --git a/dlls/shell32/trash.c b/dlls/shell32/trash.c index 2762f047aaa..a366f625ca7 100644 --- a/dlls/shell32/trash.c +++ b/dlls/shell32/trash.c @@ -30,7 +30,9 @@ #ifdef HAVE_UNISTD_H # include #endif -#include +#ifdef HAVE_DIRENT_H +# include +#endif #include "windef.h" #include "winbase.h" diff --git a/dlls/shlwapi/assoc.c b/dlls/shlwapi/assoc.c index 31a842068b7..0ca8678a6ad 100644 --- a/dlls/shlwapi/assoc.c +++ b/dlls/shlwapi/assoc.c @@ -303,6 +303,8 @@ HRESULT WINAPI AssocQueryStringA(ASSOCF cfFlags, ASSOCSTR str, LPCSTR pszAssoc, if (dwLenOut >= MAX_PATH) lpszReturnW = HeapAlloc(GetProcessHeap(), 0, (dwLenOut + 1) * sizeof(WCHAR)); + else + dwLenOut = sizeof(szReturnW) / sizeof(szReturnW[0]); if (!lpszReturnW) hRet = E_OUTOFMEMORY; @@ -312,9 +314,10 @@ HRESULT WINAPI AssocQueryStringA(ASSOCF cfFlags, ASSOCSTR str, LPCSTR pszAssoc, lpszReturnW, &dwLenOut); if (SUCCEEDED(hRet)) - WideCharToMultiByte(CP_ACP,0,szReturnW,-1,pszOut,dwLenOut,0,0); - *pcchOut = dwLenOut; + dwLenOut = WideCharToMultiByte(CP_ACP, 0, lpszReturnW, -1, + pszOut, *pcchOut, NULL, NULL); + *pcchOut = dwLenOut; if (lpszReturnW != szReturnW) HeapFree(GetProcessHeap(), 0, lpszReturnW); } diff --git a/dlls/shlwapi/ordinal.c b/dlls/shlwapi/ordinal.c index 7b6ae226d2a..be6b0da8c80 100644 --- a/dlls/shlwapi/ordinal.c +++ b/dlls/shlwapi/ordinal.c @@ -2,7 +2,7 @@ * SHLWAPI ordinal functions * * Copyright 1997 Marcus Meissner - * 1998 Jürgen Schmied + * 1998 Jürgen Schmied * 2001-2003 Jon Griffiths * * This library is free software; you can redistribute it and/or diff --git a/dlls/shlwapi/tests/assoc.c b/dlls/shlwapi/tests/assoc.c index 2e383bb959e..872575e6548 100644 --- a/dlls/shlwapi/tests/assoc.c +++ b/dlls/shlwapi/tests/assoc.c @@ -32,19 +32,6 @@ static const WCHAR dotBad[] = { '.','b','a','d',0 }; static const WCHAR open[] = { 'o','p','e','n',0 }; static const WCHAR invalid[] = { 'i','n','v','a','l','i','d',0 }; -/* copied from libs/wine/string.c */ -WCHAR *strstrW(const WCHAR *str, const WCHAR *sub) -{ - while (*str) - { - const WCHAR *p1 = str, *p2 = sub; - while (*p1 && *p2 && *p1 == *p2) { p1++; p2++; } - if (!*p2) return (WCHAR *)str; - str++; - } - return NULL; -} - static void test_getstring_bad(void) { HRESULT hr; @@ -53,29 +40,46 @@ static void test_getstring_bad(void) hr = AssocQueryStringW(0, ASSOCSTR_EXECUTABLE, NULL, open, NULL, &len); expect_hr(E_INVALIDARG, hr); hr = AssocQueryStringW(0, ASSOCSTR_EXECUTABLE, badBad, open, NULL, &len); - expect_hr(E_FAIL, hr); + ok(hr == E_FAIL || + hr == HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION), /* Win9x/WinMe/NT4/W2K/Vista/W2K8 */ + "Unexpected result : %08x\n", hr); hr = AssocQueryStringW(0, ASSOCSTR_EXECUTABLE, dotBad, open, NULL, &len); - expect_hr(E_FAIL, hr); + ok(hr == E_FAIL || + hr == HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION), /* Win9x/WinMe/NT4/W2K/Vista/W2K8 */ + "Unexpected result : %08x\n", hr); hr = AssocQueryStringW(0, ASSOCSTR_EXECUTABLE, dotHtml, invalid, NULL, &len); - expect_hr(0x80070002, hr); /* NOT FOUND */ + ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) || + hr == HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION), /* Win9x/WinMe/NT4/W2K/Vista/W2K8 */ + "Unexpected result : %08x\n", hr); hr = AssocQueryStringW(0, ASSOCSTR_EXECUTABLE, dotHtml, open, NULL, NULL); - expect_hr(E_UNEXPECTED, hr); + ok(hr == E_UNEXPECTED || + hr == E_INVALIDARG, /* Win9x/WinMe/NT4/W2K/Vista/W2K8 */ + "Unexpected result : %08x\n", hr); hr = AssocQueryStringW(0, ASSOCSTR_FRIENDLYAPPNAME, NULL, open, NULL, &len); expect_hr(E_INVALIDARG, hr); hr = AssocQueryStringW(0, ASSOCSTR_FRIENDLYAPPNAME, badBad, open, NULL, &len); - expect_hr(E_FAIL, hr); + ok(hr == E_FAIL || + hr == HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION), /* Win9x/WinMe/NT4/W2K/Vista/W2K8 */ + "Unexpected result : %08x\n", hr); hr = AssocQueryStringW(0, ASSOCSTR_FRIENDLYAPPNAME, dotBad, open, NULL, &len); - expect_hr(E_FAIL, hr); + ok(hr == E_FAIL || + hr == HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION), /* Win9x/WinMe/NT4/W2K/Vista/W2K8 */ + "Unexpected result : %08x\n", hr); hr = AssocQueryStringW(0, ASSOCSTR_FRIENDLYAPPNAME, dotHtml, invalid, NULL, &len); - expect_hr(0x80070002, hr); /* NOT FOUND */ + ok(hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) || + hr == HRESULT_FROM_WIN32(ERROR_NO_ASSOCIATION) || /* W2K/Vista/W2K8 */ + hr == E_FAIL, /* Win9x/WinMe/NT4 */ + "Unexpected result : %08x\n", hr); hr = AssocQueryStringW(0, ASSOCSTR_FRIENDLYAPPNAME, dotHtml, open, NULL, NULL); - expect_hr(E_UNEXPECTED, hr); + ok(hr == E_UNEXPECTED || + hr == E_INVALIDARG, /* Win9x/WinMe/NT4/W2K/Vista/W2K8 */ + "Unexpected result : %08x\n", hr); } static void test_getstring_basic(void) @@ -145,57 +149,63 @@ static void test_getstring_no_extra(void) LONG ret; HKEY hkey; HRESULT hr; - static const WCHAR dotWinetest[] = { + static const CHAR dotWinetest[] = { '.','w','i','n','e','t','e','s','t',0 }; - static const WCHAR winetestfile[] = { + static const CHAR winetestfile[] = { 'w','i','n','e','t','e','s','t', 'f','i','l','e',0 }; - static const WCHAR winetestfileAction[] = { + static const CHAR winetestfileAction[] = { 'w','i','n','e','t','e','s','t','f','i','l','e', '\\','s','h','e','l','l', '\\','f','o','o', '\\','c','o','m','m','a','n','d',0 }; - static const WCHAR action[] = { + static const CHAR action[] = { 'n','o','t','e','p','a','d','.','e','x','e',0 }; - WCHAR buf[MAX_PATH]; + CHAR buf[MAX_PATH]; DWORD len = MAX_PATH; - ret = RegCreateKeyW(HKEY_CLASSES_ROOT, dotWinetest, &hkey); - if (ret != ERROR_SUCCESS) + buf[0] = '\0'; + ret = RegCreateKeyA(HKEY_CLASSES_ROOT, dotWinetest, &hkey); + if (ret != ERROR_SUCCESS) { skip("failed to create dotWinetest key\n"); - ret = RegSetValueW(hkey, NULL, REG_SZ, winetestfile, - lstrlenW(winetestfile)); + return; + } + + ret = RegSetValueA(hkey, NULL, REG_SZ, winetestfile, lstrlenA(winetestfile)); RegCloseKey(hkey); if (ret != ERROR_SUCCESS) { - RegDeleteTreeW(HKEY_CLASSES_ROOT, dotWinetest); skip("failed to set dotWinetest key\n"); + goto cleanup; } - ret = RegCreateKeyW(HKEY_CLASSES_ROOT, winetestfileAction, &hkey); + ret = RegCreateKeyA(HKEY_CLASSES_ROOT, winetestfileAction, &hkey); if (ret != ERROR_SUCCESS) { - RegDeleteTreeW(HKEY_CLASSES_ROOT, dotWinetest); skip("failed to create winetestfileAction key\n"); + goto cleanup; } - ret = RegSetValueW(hkey, NULL, REG_SZ, action, lstrlenW(action)); + + ret = RegSetValueA(hkey, NULL, REG_SZ, action, lstrlenA(action)); RegCloseKey(hkey); if (ret != ERROR_SUCCESS) { - RegDeleteTreeW(HKEY_CLASSES_ROOT, dotWinetest); - RegDeleteTreeW(HKEY_CLASSES_ROOT, winetestfile); skip("failed to set winetestfileAction key\n"); + goto cleanup; } - hr = AssocQueryStringW(0, ASSOCSTR_EXECUTABLE, dotWinetest, NULL, - buf, &len); + hr = AssocQueryStringA(0, ASSOCSTR_EXECUTABLE, dotWinetest, NULL, buf, &len); expect_hr(S_OK, hr); - ok(strstrW(buf, action) != NULL, "exe path does not contain notepad\n"); - RegDeleteTreeW(HKEY_CLASSES_ROOT, dotWinetest); - RegDeleteTreeW(HKEY_CLASSES_ROOT, winetestfile); + ok(strstr(buf, action) != NULL, + "got '%s' (Expected result to include 'notepad.exe')\n", buf); + +cleanup: + SHDeleteKeyA(HKEY_CLASSES_ROOT, dotWinetest); + SHDeleteKeyA(HKEY_CLASSES_ROOT, winetestfile); + } START_TEST(assoc) diff --git a/dlls/urlmon/urlmon.spec b/dlls/urlmon/urlmon.spec index 0f3c9c250c3..2001f0b3bc1 100644 --- a/dlls/urlmon/urlmon.spec +++ b/dlls/urlmon/urlmon.spec @@ -51,8 +51,8 @@ @ stub HlinkSimpleNavigateToMoniker @ stdcall HlinkSimpleNavigateToString(wstr wstr wstr ptr ptr ptr long long) @ stdcall IsAsyncMoniker(ptr) -@ stub IsLoggingEnabledA -@ stub IsLoggingEnabledW +@ stdcall IsLoggingEnabledA(str) +@ stdcall IsLoggingEnabledW(wstr) @ stdcall IsValidURL(ptr wstr long) @ stdcall MkParseDisplayNameEx(ptr wstr ptr ptr) @ stdcall ObtainUserAgentString(long str ptr) diff --git a/dlls/urlmon/urlmon_main.c b/dlls/urlmon/urlmon_main.c index bc3de934b35..15944b6d8f8 100644 --- a/dlls/urlmon/urlmon_main.c +++ b/dlls/urlmon/urlmon_main.c @@ -767,3 +767,21 @@ HRESULT WINAPI Extract(void *dest, LPCSTR szCabName) return pExtract(dest, szCabName); } + +/*********************************************************************** + * IsLoggingEnabledA (URLMON.@) + */ +BOOL WINAPI IsLoggingEnabledA(LPCSTR url) +{ + FIXME("(%s)\n", debugstr_a(url)); + return FALSE; +} + +/*********************************************************************** + * IsLoggingEnabledW (URLMON.@) + */ +BOOL WINAPI IsLoggingEnabledW(LPCWSTR url) +{ + FIXME("(%s)\n", debugstr_w(url)); + return FALSE; +} diff --git a/dlls/user32/comm16.c b/dlls/user32/comm16.c index 8bd4a447f6f..c7f3ab217e7 100644 --- a/dlls/user32/comm16.c +++ b/dlls/user32/comm16.c @@ -21,13 +21,13 @@ * * History: * - * Mar 31, 1999. Ove Kåven + * Mar 31, 1999. Ove Kåven * - Implemented buffers and EnableCommNotification. * * Apr 3, 1999. Lawson Whitney * - Fixed the modem control part of EscapeCommFunction16. * - * Mar 3, 1999. Ove Kåven + * Mar 3, 1999. Ove Kåven * - Use port indices instead of unixfds for win16 * - Moved things around (separated win16 and win32 routines) * - Added some hints on how to implement buffers and EnableCommNotification. diff --git a/dlls/user32/menu.c b/dlls/user32/menu.c index b7cfe1c2cda..928a9eb47d5 100644 --- a/dlls/user32/menu.c +++ b/dlls/user32/menu.c @@ -4,7 +4,7 @@ * Copyright 1993 Martin Ayotte * Copyright 1994 Alexandre Julliard * Copyright 1997 Morten Welinder - * Copyright 2005 Maxime Bellengé + * Copyright 2005 Maxime Bellengé * Copyright 2006 Phil Krylov * * This library is free software; you can redistribute it and/or diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index c78401aeadf..1580b14291b 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -626,6 +626,9 @@ static const struct message WmCreateMaxPopupSeq[] = { { EVENT_SYSTEM_FOREGROUND, winevent_hook|wparam|lparam, 0, 0 }, { WM_QUERYNEWPALETTE, sent|wparam|lparam|optional, 0, 0 }, { WM_WINDOWPOSCHANGING, sent|wparam|optional, SWP_NOSIZE|SWP_NOMOVE }, + { WM_NCPAINT, sent|wparam|optional, 1 }, + { WM_ERASEBKGND, sent|optional }, + { WM_WINDOWPOSCHANGED, sent|wparam|optional, SWP_NOCLIENTMOVE|SWP_NOCLIENTSIZE|SWP_NOMOVE|SWP_NOSIZE }, { WM_ACTIVATEAPP, sent|wparam, 1 }, { WM_NCACTIVATE, sent|wparam, 1 }, { WM_ACTIVATE, sent|wparam, 1 }, @@ -5620,7 +5623,9 @@ static void test_paint_messages(void) trace("testing ValidateRgn(0, NULL)\n"); SetLastError(0xdeadbeef); ok(!ValidateRgn(0, NULL), "ValidateRgn(0, NULL) should fail\n"); - ok(GetLastError() == ERROR_INVALID_WINDOW_HANDLE, "wrong error code %d\n", GetLastError()); + ok(GetLastError() == ERROR_INVALID_WINDOW_HANDLE || + broken( GetLastError() == 0xdeadbeef ) /* win9x */, + "wrong error code %d\n", GetLastError()); check_update_rgn( hwnd, 0 ); flush_events(); ok_sequence( WmEmptySeq, "WmEmptySeq", FALSE ); @@ -8907,10 +8912,12 @@ static void test_PeekMessage(void) /* pass invalid QS_xxxx flags */ SetLastError(0xdeadbeef); qstatus = GetQueueStatus(0xffffffff); - ok(qstatus == 0, "GetQueueStatus should fail: %08x\n", qstatus); - ok(GetLastError() == ERROR_INVALID_FLAGS, "wrong error %d\n", GetLastError()); - - qstatus = GetQueueStatus(qs_all_input); + ok(qstatus == 0 || broken(qstatus) /* win9x */, "GetQueueStatus should fail: %08x\n", qstatus); + if (!qstatus) + { + ok(GetLastError() == ERROR_INVALID_FLAGS, "wrong error %d\n", GetLastError()); + qstatus = GetQueueStatus(qs_all_input); + } ok(qstatus == MAKELONG(QS_SENDMESSAGE, QS_SENDMESSAGE), "wrong qstatus %08x\n", qstatus); @@ -8950,6 +8957,11 @@ static void test_PeekMessage(void) msg.message = 0; ret = PeekMessageA(&msg, 0, 0, 0, PM_REMOVE | (qs_input << 16)); + if (ret && msg.message == WM_CHAR) + { + win_skip( "PM_QS_* flags not supported in PeekMessage\n" ); + goto done; + } ok(!ret, "PeekMessageA should have returned FALSE instead of msg %04x\n", msg.message); @@ -9200,6 +9212,7 @@ todo_wine { ok(qstatus == 0, "wrong qstatus %08x\n", qstatus); +done: trace("signalling to exit\n"); SetEvent(info.hevent[EV_STOP]); diff --git a/dlls/user32/tests/text.c b/dlls/user32/tests/text.c index f3849cc972c..fc554ae3632 100644 --- a/dlls/user32/tests/text.c +++ b/dlls/user32/tests/text.c @@ -117,7 +117,7 @@ static void test_DrawTextCalcRect(void) "rectangle should NOT be empty got %d,%d-%d,%d\n", rect.left, rect.top, rect.right, rect.bottom ); if (textheight != 0) /* Windows 98 */ { - win_skip("XP conformity failed, skipping XP tests. Probibly win9x\n"); + win_skip("XP conformity failed, skipping XP tests. Probably win9x\n"); conform_xp = FALSE; } else @@ -155,7 +155,7 @@ static void test_DrawTextCalcRect(void) if (!textheight) /* Windows NT 4 */ { if (conform_xp) - win_skip("XP conformity failed, skipping XP tests. Probibly winNT\n"); + win_skip("XP conformity failed, skipping XP tests. Probably winNT\n"); conform_xp = FALSE; } else @@ -357,7 +357,7 @@ static void test_DrawTextCalcRect(void) if (textheight) /* windows 2000 */ { if (conform_xp) - win_skip("XP conformity failed, skipping XP tests. probibly win 2000\n"); + win_skip("XP conformity failed, skipping XP tests. Probably win 2000\n"); conform_xp = FALSE; } else diff --git a/dlls/user32/tests/win.c b/dlls/user32/tests/win.c index 1b9d7291f03..76ca103974d 100644 --- a/dlls/user32/tests/win.c +++ b/dlls/user32/tests/win.c @@ -5091,7 +5091,7 @@ static void test_fullscreen(void) } } - UnregisterClass("MinMax_WndClass", GetModuleHandle(0)); + UnregisterClass("fullscreen_class", GetModuleHandle(0)); } START_TEST(win) diff --git a/dlls/userenv/tests/userenv.c b/dlls/userenv/tests/userenv.c index df2774b6b6a..49491f7efdd 100644 --- a/dlls/userenv/tests/userenv.c +++ b/dlls/userenv/tests/userenv.c @@ -157,13 +157,11 @@ static void test_create_env(void) { BOOL r; HANDLE htok; - WCHAR * env1, * env2, * env3, * env4; + WCHAR * env[4]; char * st; int i, j; static const struct profile_item common_vars[] = { - { "ALLUSERSPROFILE", { 1, 1, 0, 0 } }, - { "CommonProgramFiles", { 1, 1, 1, 1 } }, { "ComSpec", { 1, 1, 0, 0 } }, { "COMPUTERNAME", { 1, 1, 1, 1 } }, { "NUMBER_OF_PROCESSORS", { 1, 1, 0, 0 } }, @@ -174,16 +172,18 @@ static void test_create_env(void) { "PROCESSOR_REVISION", { 1, 1, 0, 0 } }, { "SystemDrive", { 1, 1, 0, 0 } }, { "SystemRoot", { 1, 1, 0, 0 } }, - { "windir", { 1, 1, 0, 0 } }, - { "ProgramFiles", { 1, 1, 0, 0 } }, - { 0, { 0, 0, 0, 0 } } + { "windir", { 1, 1, 0, 0 } } + }; + static const struct profile_item common_post_nt4_vars[] = { + { "ALLUSERSPROFILE", { 1, 1, 0, 0 } }, + { "CommonProgramFiles", { 1, 1, 1, 1 } }, + { "ProgramFiles", { 1, 1, 0, 0 } } }; static const struct profile_item htok_vars[] = { { "PATH", { 1, 1, 0, 0 } }, { "TEMP", { 1, 1, 0, 0 } }, { "TMP", { 1, 1, 0, 0 } }, - { "USERPROFILE", { 1, 1, 0, 0 } }, - { 0, { 0, 0, 0, 0 } } + { "USERPROFILE", { 1, 1, 0, 0 } } }; r = SetEnvironmentVariableA("WINE_XYZZY", "ZZYZX"); @@ -206,87 +206,71 @@ static void test_create_env(void) expect(FALSE, r); } - r = CreateEnvironmentBlock((LPVOID) &env1, NULL, FALSE); + r = CreateEnvironmentBlock((LPVOID) &env[0], NULL, FALSE); expect(TRUE, r); - r = CreateEnvironmentBlock((LPVOID) &env2, htok, FALSE); + r = CreateEnvironmentBlock((LPVOID) &env[1], htok, FALSE); expect(TRUE, r); - r = CreateEnvironmentBlock((LPVOID) &env3, NULL, TRUE); + r = CreateEnvironmentBlock((LPVOID) &env[2], NULL, TRUE); expect(TRUE, r); - r = CreateEnvironmentBlock((LPVOID) &env4, htok, TRUE); + r = CreateEnvironmentBlock((LPVOID) &env[3], htok, TRUE); expect(TRUE, r); - /* Test for common environment variables */ - i = 0; - while (common_vars[i].name) + /* Test for common environment variables (NT4 and higher) */ + for (i = 0; i < sizeof(common_vars)/sizeof(common_vars[0]); i++) + { + for (j = 0; j < 4; j++) + { + r = get_env(env[j], common_vars[i].name, &st); + if (common_vars[i].todo[j]) + todo_wine expect_env(TRUE, r, common_vars[i].name); + else + expect_env(TRUE, r, common_vars[i].name); + } + } + + /* Test for common environment variables (post NT4) */ + if (!GetEnvironmentVariableA("ALLUSERSPROFILE", NULL, 0)) + { + win_skip("Some environment variables are not present on NT4\n"); + } + else { - j = 0; - r = get_env(env1, common_vars[i].name, &st); - if (common_vars[i].todo[j]) - todo_wine expect_env(TRUE, r, common_vars[i].name); - else - expect_env(TRUE, r, common_vars[i].name); - j++; - r = get_env(env2, common_vars[i].name, &st); - if (common_vars[i].todo[j]) - todo_wine expect_env(TRUE, r, common_vars[i].name); - else - expect_env(TRUE, r, common_vars[i].name); - j++; - r = get_env(env3, common_vars[i].name, &st); - if (common_vars[i].todo[j]) - todo_wine expect_env(TRUE, r, common_vars[i].name); - else - expect_env(TRUE, r, common_vars[i].name); - j++; - r = get_env(env4, common_vars[i].name, &st); - if (common_vars[i].todo[j]) - todo_wine expect_env(TRUE, r, common_vars[i].name); - else - expect_env(TRUE, r, common_vars[i].name); - i++; + for (i = 0; i < sizeof(common_post_nt4_vars)/sizeof(common_post_nt4_vars[0]); i++) + { + for (j = 0; j < 4; j++) + { + r = get_env(env[j], common_post_nt4_vars[i].name, &st); + if (common_post_nt4_vars[i].todo[j]) + todo_wine expect_env(TRUE, r, common_post_nt4_vars[i].name); + else + expect_env(TRUE, r, common_post_nt4_vars[i].name); + } + } } /* Test for environment variables with values that depends on htok */ - i = 0; - while (htok_vars[i].name) + for (i = 0; i < sizeof(htok_vars)/sizeof(htok_vars[0]); i++) { - j = 0; - r = get_env(env1, htok_vars[i].name, &st); - if (htok_vars[i].todo[j]) - todo_wine expect_env(TRUE, r, htok_vars[i].name); - else - expect_env(TRUE, r, htok_vars[i].name); - j++; - r = get_env(env2, htok_vars[i].name, &st); - if (htok_vars[i].todo[j]) - todo_wine expect_env(TRUE, r, htok_vars[i].name); - else - expect_env(TRUE, r, htok_vars[i].name); - j++; - r = get_env(env3, htok_vars[i].name, &st); - if (htok_vars[i].todo[j]) - todo_wine expect_env(TRUE, r, htok_vars[i].name); - else - expect_env(TRUE, r, htok_vars[i].name); - j++; - r = get_env(env4, htok_vars[i].name, &st); - if (htok_vars[i].todo[j]) - todo_wine expect_env(TRUE, r, htok_vars[i].name); - else - expect_env(TRUE, r, htok_vars[i].name); - i++; + for (j = 0; j < 4; j++) + { + r = get_env(env[j], htok_vars[i].name, &st); + if (htok_vars[i].todo[j]) + todo_wine expect_env(TRUE, r, htok_vars[i].name); + else + expect_env(TRUE, r, htok_vars[i].name); + } } - r = get_env(env1, "WINE_XYZZY", &st); + r = get_env(env[0], "WINE_XYZZY", &st); expect(FALSE, r); - r = get_env(env2, "WINE_XYZZY", &st); + r = get_env(env[1], "WINE_XYZZY", &st); expect(FALSE, r); - r = get_env(env3, "WINE_XYZZY", &st); + r = get_env(env[2], "WINE_XYZZY", &st); expect(TRUE, r); - r = get_env(env4, "WINE_XYZZY", &st); + r = get_env(env[3], "WINE_XYZZY", &st); expect(TRUE, r); } diff --git a/dlls/usp10/tests/usp10.c b/dlls/usp10/tests/usp10.c index a791214072f..c63c6c8a70c 100644 --- a/dlls/usp10/tests/usp10.c +++ b/dlls/usp10/tests/usp10.c @@ -1352,7 +1352,7 @@ static void test_digit_substitution(void) if (!pEnumLanguageGroupLocalesA) { - trace("EnumLanguageGroupLocalesA not available on this platform\n"); + win_skip("EnumLanguageGroupLocalesA not available on this platform\n"); return; } diff --git a/dlls/uxtheme/tests/system.c b/dlls/uxtheme/tests/system.c index cf66c94b174..b82472b33ca 100644 --- a/dlls/uxtheme/tests/system.c +++ b/dlls/uxtheme/tests/system.c @@ -260,7 +260,7 @@ static void test_OpenThemeData(void) ok( GetLastError() == E_PROP_ID_UNSUPPORTED, "Expected GLE() to be E_PROP_ID_UNSUPPORTED, got 0x%08x\n", GetLastError()); - trace("No active theme, skipping rest of OpenThemeData tests\n"); + skip("No active theme, skipping rest of OpenThemeData tests\n"); return; } diff --git a/dlls/version/tests/info.c b/dlls/version/tests/info.c index 9a6bcf4c932..a64d911497e 100644 --- a/dlls/version/tests/info.c +++ b/dlls/version/tests/info.c @@ -167,7 +167,7 @@ static void test_info_size(void) } } else - trace("skipping GetModuleFileNameA(NULL,..) failed\n"); + trace("skipping GetSystemDirectoryA(mypath,..) failed\n"); create_file("test.txt"); @@ -324,7 +324,7 @@ static void test_32bit_win(void) GetModuleFileNameW(NULL, mypathW, MAX_PATH); if (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED) { - trace("GetModuleFileNameW not existing on this platform, skipping comparison between A- and W-calls\n"); + win_skip("GetModuleFileNameW not existing on this platform, skipping comparison between A- and W-calls\n"); is_unicode_enabled = FALSE; } diff --git a/dlls/winecrt0/drv_entry.c b/dlls/winecrt0/drv_entry.c index 946a414baa6..a55f81db22a 100644 --- a/dlls/winecrt0/drv_entry.c +++ b/dlls/winecrt0/drv_entry.c @@ -27,7 +27,7 @@ struct _DRIVER_OBJECT; extern NTSTATUS WINAPI DriverEntry( struct _DRIVER_OBJECT *obj, UNICODE_STRING *path ); -NTSTATUS DECLSPEC_HIDDEN __wine_spec_drv_entry( struct _DRIVER_OBJECT *obj, UNICODE_STRING *path ) +NTSTATUS DECLSPEC_HIDDEN WINAPI __wine_spec_drv_entry( struct _DRIVER_OBJECT *obj, UNICODE_STRING *path ) { BOOL needs_init = (__wine_spec_init_state != CONSTRUCTORS_DONE); diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index 3258e3ec925..2494ced4e23 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -9,7 +9,7 @@ * Copyright 2006 Ivan Gyurdiev * Copyright 2006 Jason Green * Copyright 2006 Henri Verbeet - * Copyright 2007-2008 Stefan Dösinger for CodeWeavers + * Copyright 2007-2008 Stefan Dösinger for CodeWeavers * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -3539,10 +3539,12 @@ static GLuint gen_yuv_shader(IWineD3DDeviceImpl *device, WINED3DFORMAT fmt, GLen buffer.newline = TRUE; buffer.buffer = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, SHADER_PGMSIZE); + ENTER_GL(); GL_EXTCALL(glGenProgramsARB(1, &shader)); checkGLcall("GL_EXTCALL(glGenProgramsARB(1, &shader))"); GL_EXTCALL(glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, shader)); checkGLcall("glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, shader)"); + LEAVE_GL(); if(!shader) { HeapFree(GetProcessHeap(), 0, buffer.buffer); return 0; @@ -3617,6 +3619,7 @@ static GLuint gen_yuv_shader(IWineD3DDeviceImpl *device, WINED3DFORMAT fmt, GLen shader_addline(&buffer, "MAD result.color.b, chroma.g, yuv_coef.w, luminance.%c;\n", luminance_component); shader_addline(&buffer, "END\n"); + ENTER_GL(); GL_EXTCALL(glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, strlen(buffer.buffer), buffer.buffer)); if (glGetError() == GL_INVALID_OPERATION) { @@ -3626,6 +3629,7 @@ static GLuint gen_yuv_shader(IWineD3DDeviceImpl *device, WINED3DFORMAT fmt, GLen debugstr_a((const char *)glGetString(GL_PROGRAM_ERROR_STRING_ARB))); } HeapFree(GetProcessHeap(), 0, buffer.buffer); + LEAVE_GL(); if(fmt == WINED3DFMT_YUY2) { if(textype == GL_TEXTURE_RECTANGLE_ARB) { @@ -3662,8 +3666,10 @@ static HRESULT arbfp_blit_set(IWineD3DDevice *iface, WINED3DFORMAT fmt, GLenum t glDesc->conversion_group != WINED3DFMT_YV12) { TRACE("Format: %s\n", debug_d3dformat(glDesc->conversion_group)); /* Don't bother setting up a shader for unconverted formats */ + ENTER_GL(); glEnable(textype); checkGLcall("glEnable(textype)"); + LEAVE_GL(); return WINED3D_OK; } @@ -3691,18 +3697,22 @@ static HRESULT arbfp_blit_set(IWineD3DDevice *iface, WINED3DFORMAT fmt, GLenum t shader = gen_yuv_shader(device, glDesc->conversion_group, textype); } + ENTER_GL(); glEnable(GL_FRAGMENT_PROGRAM_ARB); checkGLcall("glEnable(GL_FRAGMENT_PROGRAM_ARB)"); GL_EXTCALL(glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, shader)); checkGLcall("glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, shader)"); GL_EXTCALL(glProgramLocalParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, 0, size)); checkGLcall("glProgramLocalParameter4fvARB"); + LEAVE_GL(); return WINED3D_OK; } static void arbfp_blit_unset(IWineD3DDevice *iface) { IWineD3DDeviceImpl *device = (IWineD3DDeviceImpl *) iface; + + ENTER_GL(); glDisable(GL_FRAGMENT_PROGRAM_ARB); checkGLcall("glDisable(GL_FRAGMENT_PROGRAM_ARB)"); glDisable(GL_TEXTURE_2D); @@ -3715,6 +3725,7 @@ static void arbfp_blit_unset(IWineD3DDevice *iface) { glDisable(GL_TEXTURE_RECTANGLE_ARB); checkGLcall("glDisable(GL_TEXTURE_RECTANGLE_ARB)"); } + LEAVE_GL(); } static BOOL arbfp_blit_conv_supported(WINED3DFORMAT fmt) { diff --git a/dlls/wined3d/ati_fragment_shader.c b/dlls/wined3d/ati_fragment_shader.c index 7e3225b51e5..10100e2f904 100644 --- a/dlls/wined3d/ati_fragment_shader.c +++ b/dlls/wined3d/ati_fragment_shader.c @@ -1,7 +1,7 @@ /* * Fixed function pipeline replacement using GL_ATI_fragment_shader * - * Copyright 2008 Stefan Dösinger(for CodeWeavers) + * Copyright 2008 Stefan Dösinger(for CodeWeavers) * * 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/wined3d/baseshader.c b/dlls/wined3d/baseshader.c index 4c98f5a1b95..877b0ee494d 100644 --- a/dlls/wined3d/baseshader.c +++ b/dlls/wined3d/baseshader.c @@ -6,7 +6,7 @@ * Copyright 2004 Christian Costa * Copyright 2005 Oliver Stieber * Copyright 2006 Ivan Gyurdiev - * Copyright 2007-2008 Stefan Dösinger for CodeWeavers + * Copyright 2007-2008 Stefan Dösinger for CodeWeavers * * 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/wined3d/basetexture.c b/dlls/wined3d/basetexture.c index ffc01e8fa7a..69574b278a0 100644 --- a/dlls/wined3d/basetexture.c +++ b/dlls/wined3d/basetexture.c @@ -4,7 +4,7 @@ * Copyright 2002-2004 Jason Edmeades * Copyright 2002-2004 Raphael Junqueira * Copyright 2005 Oliver Stieber - * Copyright 2007-2008 Stefan Dösinger for CodeWeavers + * Copyright 2007-2008 Stefan Dösinger for CodeWeavers * * 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/wined3d/clipper.c b/dlls/wined3d/clipper.c index 75bbbd00d96..feb6e235e48 100644 --- a/dlls/wined3d/clipper.c +++ b/dlls/wined3d/clipper.c @@ -2,7 +2,7 @@ * * Copyright 2000 (c) Marcus Meissner * Copyright 2000 (c) TransGaming Technologies Inc. - * Copyright 2006 (c) Stefan Dösinger + * Copyright 2006 (c) Stefan Dösinger * * 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/wined3d/context.c b/dlls/wined3d/context.c index d8ac3eaec8a..62a4bf4d7bd 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -1,7 +1,7 @@ /* * Context and render target management in wined3d * - * Copyright 2007-2008 Stefan Dösinger for CodeWeavers + * Copyright 2007-2008 Stefan Dösinger for CodeWeavers * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -1056,6 +1056,13 @@ static inline void SetupForBlit(IWineD3DDeviceImpl *This, WineD3DContext *contex Context_MarkStateDirty(context, STATE_VSHADER, StateTable); Context_MarkStateDirty(context, STATE_PIXELSHADER, StateTable); + /* Call ENTER_GL() once for all gl calls below. In theory we should not call + * helper functions in between gl calls. This function is full of Context_MarkStateDirty + * which can safely be called from here, we only lock once instead locking/unlocking + * after each GL call. + */ + ENTER_GL(); + /* Disable all textures. The caller can then bind a texture it wants to blit * from */ @@ -1188,6 +1195,7 @@ static inline void SetupForBlit(IWineD3DDeviceImpl *This, WineD3DContext *contex glDisable(GL_CLIP_PLANE4); checkGLcall("glDisable(clip plane 4)"); glDisable(GL_CLIP_PLANE5); checkGLcall("glDisable(clip plane 5)"); Context_MarkStateDirty(context, STATE_RENDER(WINED3DRS_CLIPPING), StateTable); + LEAVE_GL(); set_blit_dimension(width, height); context->blit_w = width; context->blit_h = height; @@ -1416,11 +1424,14 @@ static void apply_draw_buffer(IWineD3DDeviceImpl *This, IWineD3DSurface *target, if (SUCCEEDED(IWineD3DSurface_GetContainer(target, &IID_IWineD3DSwapChain, (void **)&swapchain))) { IWineD3DSwapChain_Release((IUnknown *)swapchain); + ENTER_GL(); glDrawBuffer(surface_get_gl_buffer(target, swapchain)); checkGLcall("glDrawBuffers()"); + LEAVE_GL(); } else { + ENTER_GL(); if (wined3d_settings.offscreen_rendering_mode == ORM_FBO) { if (!blit) @@ -1445,6 +1456,7 @@ static void apply_draw_buffer(IWineD3DDeviceImpl *This, IWineD3DSurface *target, glDrawBuffer(This->offscreenBuffer); checkGLcall("glDrawBuffer()"); } + LEAVE_GL(); } } @@ -1512,9 +1524,6 @@ void ActivateContext(IWineD3DDeviceImpl *This, IWineD3DSurface *target, ContextU last_device = This; } - /* We only need ENTER_GL for the gl calls made below and for the helper functions which make GL calls */ - ENTER_GL(); - switch (usage) { case CTXUSAGE_CLEAR: case CTXUSAGE_DRAWPRIM: @@ -1533,11 +1542,16 @@ void ActivateContext(IWineD3DDeviceImpl *This, IWineD3DSurface *target, ContextU FIXME("Activating for CTXUSAGE_BLIT for an offscreen target with ORM_FBO. This should be avoided.\n"); context_bind_fbo((IWineD3DDevice *)This, GL_FRAMEBUFFER_EXT, &context->dst_fbo); context_attach_surface_fbo(This, GL_FRAMEBUFFER_EXT, 0, target); + + ENTER_GL(); GL_EXTCALL(glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, 0)); checkGLcall("glFramebufferRenderbufferEXT"); + LEAVE_GL(); } else { + ENTER_GL(); GL_EXTCALL(glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0)); checkGLcall("glFramebufferRenderbufferEXT"); + LEAVE_GL(); } context->draw_buffer_dirty = TRUE; } @@ -1566,11 +1580,15 @@ void ActivateContext(IWineD3DDeviceImpl *This, IWineD3DSurface *target, ContextU /* Blending and clearing should be orthogonal, but tests on the nvidia driver show that disabling * blending when clearing improves the clearing performance incredibly. */ + ENTER_GL(); glDisable(GL_BLEND); + LEAVE_GL(); Context_MarkStateDirty(context, STATE_RENDER(WINED3DRS_ALPHABLENDENABLE), StateTable); + ENTER_GL(); glEnable(GL_SCISSOR_TEST); checkGLcall("glEnable GL_SCISSOR_TEST"); + LEAVE_GL(); context->last_was_blit = FALSE; Context_MarkStateDirty(context, STATE_RENDER(WINED3DRS_SCISSORTESTENABLE), StateTable); Context_MarkStateDirty(context, STATE_SCISSORRECT, StateTable); @@ -1604,5 +1622,4 @@ void ActivateContext(IWineD3DDeviceImpl *This, IWineD3DSurface *target, ContextU default: FIXME("Unexpected context usage requested\n"); } - LEAVE_GL(); } diff --git a/dlls/wined3d/cubetexture.c b/dlls/wined3d/cubetexture.c index 786a40c4834..9ccb2d19992 100644 --- a/dlls/wined3d/cubetexture.c +++ b/dlls/wined3d/cubetexture.c @@ -4,7 +4,7 @@ * Copyright 2002-2005 Jason Edmeades * Copyright 2002-2005 Raphael Junqueira * Copyright 2005 Oliver Stieber - * Copyright 2007-2008 Stefan Dösinger for CodeWeavers + * Copyright 2007-2008 Stefan Dösinger for CodeWeavers * * 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/wined3d/device.c b/dlls/wined3d/device.c index 1a0d3f405b8..9a35d1866df 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -6,7 +6,7 @@ * Copyright 2003-2004 Raphael Junqueira * Copyright 2004 Christian Costa * Copyright 2005 Oliver Stieber - * Copyright 2006-2008 Stefan Dösinger for CodeWeavers + * Copyright 2006-2008 Stefan Dösinger for CodeWeavers * Copyright 2006-2008 Henri Verbeet * Copyright 2007 Andrew Riedi * @@ -5880,11 +5880,11 @@ static HRESULT WINAPI IWineD3DDeviceImpl_UpdateSurface(IWineD3DDevice *iface, ActivateContext(This, This->lastActiveRenderTarget, CTXUSAGE_RESOURCELOAD); - ENTER_GL(); - if (GL_SUPPORT(ARB_MULTITEXTURE)) { + ENTER_GL(); GL_EXTCALL(glActiveTextureARB(GL_TEXTURE0_ARB)); checkGLcall("glActiveTextureARB"); + LEAVE_GL(); } /* Make sure the surface is loaded and up to date */ @@ -5924,6 +5924,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_UpdateSurface(IWineD3DDevice *iface, FIXME("Surfaces has no allocated memory, but should be an in memory only surface\n"); } + ENTER_GL(); + /* TODO: Cube and volume support */ if(rowoffset != 0){ /* not a whole row so we have to do it a line at a time */ @@ -7015,10 +7017,13 @@ void delete_opengl_contexts(IWineD3DDevice *iface, IWineD3DSwapChain *swapchain_ This->depth_blt_rb_w = 0; This->depth_blt_rb_h = 0; } + LEAVE_GL(); + This->blitter->free_private(iface); This->frag_pipe->free_private(iface); This->shader_backend->shader_free_private(iface); + ENTER_GL(); for (i = 0; i < GL_LIMITS(textures); i++) { /* Textures are recreated below */ glDeleteTextures(1, &This->dummyTextureName[i]); diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index 5fa091e4e2b..9cdc957334a 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -5,7 +5,7 @@ * Copyright 2003-2004 Raphael Junqueira * Copyright 2004 Christian Costa * Copyright 2005 Oliver Stieber - * Copyright 2007-2008 Stefan Dösinger for CodeWeavers + * Copyright 2007-2008 Stefan Dösinger for CodeWeavers * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -96,6 +96,7 @@ static const struct { {"GL_EXT_blend_func_separate", EXT_BLEND_FUNC_SEPARATE, 0 }, {"GL_EXT_fog_coord", EXT_FOG_COORD, 0 }, {"GL_EXT_framebuffer_blit", EXT_FRAMEBUFFER_BLIT, 0 }, + {"GL_EXT_framebuffer_multisample", EXT_FRAMEBUFFER_MULTISAMPLE, 0 }, {"GL_EXT_framebuffer_object", EXT_FRAMEBUFFER_OBJECT, 0 }, {"GL_EXT_paletted_texture", EXT_PALETTED_TEXTURE, 0 }, {"GL_EXT_point_parameters", EXT_POINT_PARAMETERS, 0 }, diff --git a/dlls/wined3d/drawprim.c b/dlls/wined3d/drawprim.c index c212f1410ec..267bdf85209 100644 --- a/dlls/wined3d/drawprim.c +++ b/dlls/wined3d/drawprim.c @@ -6,7 +6,7 @@ * Copyright 2004 Christian Costa * Copyright 2005 Oliver Stieber * Copyright 2006, 2008 Henri Verbeet - * Copyright 2007-2008 Stefan Dösinger for CodeWeavers + * Copyright 2007-2008 Stefan Dösinger for CodeWeavers * * 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/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index b73d894918c..61a38c5573a 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -3,7 +3,7 @@ * * Copyright 2006 Jason Green * Copyright 2006-2007 Henri Verbeet - * Copyright 2007-2008 Stefan Dösinger for CodeWeavers + * Copyright 2007-2008 Stefan Dösinger for CodeWeavers * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -2564,7 +2564,7 @@ static void pshader_glsl_texm3x3(SHADER_OPCODE_ARG* arg) { } /** Process the WINED3DSIO_TEXM3X3SPEC instruction in GLSL - * Peform the final texture lookup based on the previous 2 3x3 matrix multiplies */ + * Perform the final texture lookup based on the previous 2 3x3 matrix multiplies */ static void pshader_glsl_texm3x3spec(SHADER_OPCODE_ARG* arg) { IWineD3DPixelShaderImpl* shader = (IWineD3DPixelShaderImpl*) arg->shader; @@ -2598,7 +2598,7 @@ static void pshader_glsl_texm3x3spec(SHADER_OPCODE_ARG* arg) { } /** Process the WINED3DSIO_TEXM3X3VSPEC instruction in GLSL - * Peform the final texture lookup based on the previous 2 3x3 matrix multiplies */ + * Perform the final texture lookup based on the previous 2 3x3 matrix multiplies */ static void pshader_glsl_texm3x3vspec(SHADER_OPCODE_ARG* arg) { IWineD3DPixelShaderImpl* shader = (IWineD3DPixelShaderImpl*) arg->shader; @@ -3458,15 +3458,16 @@ static void shader_glsl_select_depth_blt(IWineD3DDevice *iface) { IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; WineD3D_GL_Info *gl_info = &This->adapter->gl_info; struct shader_glsl_priv *priv = (struct shader_glsl_priv *) This->shader_priv; - static GLhandleARB loc = -1; if (!priv->depth_blt_glsl_program_id) { + GLhandleARB loc; priv->depth_blt_glsl_program_id = create_glsl_blt_shader(gl_info); loc = GL_EXTCALL(glGetUniformLocationARB(priv->depth_blt_glsl_program_id, "sampler")); + GL_EXTCALL(glUseProgramObjectARB(priv->depth_blt_glsl_program_id)); + GL_EXTCALL(glUniform1iARB(loc, 0)); + } else { + GL_EXTCALL(glUseProgramObjectARB(priv->depth_blt_glsl_program_id)); } - - GL_EXTCALL(glUseProgramObjectARB(priv->depth_blt_glsl_program_id)); - GL_EXTCALL(glUniform1iARB(loc, 0)); } static void shader_glsl_deselect_depth_blt(IWineD3DDevice *iface) { diff --git a/dlls/wined3d/indexbuffer.c b/dlls/wined3d/indexbuffer.c index a93f8fe2ed7..79423a197e0 100644 --- a/dlls/wined3d/indexbuffer.c +++ b/dlls/wined3d/indexbuffer.c @@ -5,7 +5,7 @@ * Copyright 2003-2004 Raphael Junqueira * Copyright 2004 Christian Costa * Copyright 2005 Oliver Stieber - * Copyright 2007 Stefan Dösinger for CodeWeavers + * Copyright 2007 Stefan Dösinger for CodeWeavers * * 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/wined3d/nvidia_texture_shader.c b/dlls/wined3d/nvidia_texture_shader.c index 9ebb17b1d05..29c4e98d26f 100644 --- a/dlls/wined3d/nvidia_texture_shader.c +++ b/dlls/wined3d/nvidia_texture_shader.c @@ -3,7 +3,7 @@ * and GL_NV_texture_shader * * Copyright 2006 Henri Verbeet - * Copyright 2008 Stefan Dösinger(for CodeWeavers) + * Copyright 2008 Stefan Dösinger(for CodeWeavers) * * 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/wined3d/palette.c b/dlls/wined3d/palette.c index 95b8da9e7fc..ff98333d86a 100644 --- a/dlls/wined3d/palette.c +++ b/dlls/wined3d/palette.c @@ -2,7 +2,7 @@ * * Copyright 1997-2000 Marcus Meissner * Copyright 2000-2001 TransGaming Technologies Inc. - * Copyright 2006 Stefan Dösinger for CodeWeavers + * Copyright 2006 Stefan Dösinger for CodeWeavers * * 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/wined3d/pixelshader.c b/dlls/wined3d/pixelshader.c index 8182939962d..246b58addf0 100644 --- a/dlls/wined3d/pixelshader.c +++ b/dlls/wined3d/pixelshader.c @@ -6,7 +6,7 @@ * Copyright 2004 Christian Costa * Copyright 2005 Oliver Stieber * Copyright 2006 Ivan Gyurdiev - * Copyright 2007-2008 Stefan Dösinger for CodeWeavers + * Copyright 2007-2008 Stefan Dösinger for CodeWeavers * * 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/wined3d/query.c b/dlls/wined3d/query.c index 45e35b73b0a..7826325a374 100644 --- a/dlls/wined3d/query.c +++ b/dlls/wined3d/query.c @@ -2,7 +2,7 @@ * IWineD3DQuery implementation * * Copyright 2005 Oliver Stieber - * Copyright 2007-2008 Stefan Dösinger for CodeWeavers + * Copyright 2007-2008 Stefan Dösinger for CodeWeavers * * 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/wined3d/state.c b/dlls/wined3d/state.c index 77b7a86e868..1a99d4003fd 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -8,7 +8,7 @@ * Copyright 2004 Christian Costa * Copyright 2005 Oliver Stieber * Copyright 2006 Henri Verbeet - * Copyright 2006-2008 Stefan Dösinger for CodeWeavers + * Copyright 2006-2008 Stefan Dösinger for CodeWeavers * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -3434,7 +3434,7 @@ static void sampler_texmatrix(DWORD state, IWineD3DStateBlockImpl *stateblock, W * IWineD3DBaseTexture::ApplyStateChanges multiplies the set matrix with a fixup matrix. Before the * scaling is reapplied or removed, the texture matrix has to be reapplied * - * The mapped stage is alrady active because the sampler() function below, which is part of the + * The mapped stage is already active because the sampler() function below, which is part of the * misc pipeline */ if(sampler < MAX_TEXTURES) { @@ -3681,7 +3681,7 @@ static void transform_worldex(DWORD state, IWineD3DStateBlockImpl *stateblock, W } /* GL_MODELVIEW0_ARB: 0x1700 - * GL_MODELVIEW1_ARB: 0x0x850a + * GL_MODELVIEW1_ARB: 0x850a * GL_MODELVIEW2_ARB: 0x8722 * GL_MODELVIEW3_ARB: 0x8723 * etc diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index 78268d8616b..7d7d45bedd0 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -4,7 +4,7 @@ * Copyright 2002 Raphael Junqueira * Copyright 2004 Jason Edmeades * Copyright 2005 Oliver Stieber - * Copyright 2007 Stefan Dösinger for CodeWeavers + * Copyright 2007 Stefan Dösinger for CodeWeavers * * 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/wined3d/surface.c b/dlls/wined3d/surface.c index 94fecbc8b9f..953985b68c7 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -7,7 +7,7 @@ * Copyright 2002-2003 Raphael Junqueira * Copyright 2004 Christian Costa * Copyright 2005 Oliver Stieber - * Copyright 2006-2008 Stefan Dösinger for CodeWeavers + * Copyright 2006-2008 Stefan Dösinger for CodeWeavers * Copyright 2007-2008 Henri Verbeet * Copyright 2006-2008 Roderick Colenbrander * @@ -916,9 +916,10 @@ static void read_from_framebuffer_texture(IWineD3DSurfaceImpl *This) */ ActivateContext(device, (IWineD3DSurface *) This, CTXUSAGE_RESOURCELOAD); surface_bind_and_dirtify(This); - ENTER_GL(); + ENTER_GL(); glGetIntegerv(GL_READ_BUFFER, &prevRead); + LEAVE_GL(); /* Select the correct read buffer, and give some debug output. * There is no need to keep track of the current read buffer or reset it, every part of the code @@ -928,8 +929,11 @@ static void read_from_framebuffer_texture(IWineD3DSurfaceImpl *This) { GLenum buffer = surface_get_gl_buffer((IWineD3DSurface *) This, (IWineD3DSwapChain *)swapchain); TRACE("Locking %#x buffer\n", buffer); + + ENTER_GL(); glReadBuffer(buffer); checkGLcall("glReadBuffer"); + LEAVE_GL(); IWineD3DSwapChain_Release((IWineD3DSwapChain *) swapchain); } else { @@ -937,7 +941,9 @@ static void read_from_framebuffer_texture(IWineD3DSurfaceImpl *This) * Read from the back buffer */ TRACE("Locking offscreen render target\n"); + ENTER_GL(); glReadBuffer(device->offscreenBuffer); + LEAVE_GL(); } if(!(This->Flags & SFLAG_ALLOCATED)) { @@ -947,6 +953,7 @@ static void read_from_framebuffer_texture(IWineD3DSurfaceImpl *This) clear_unused_channels(This); + ENTER_GL(); /* If !SrcIsUpsideDown we should flip the surface. * This can be done using glCopyTexSubImage2D but this * is VERY slow, so don't do that. We should prevent @@ -3485,10 +3492,11 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, RECT * rect.y1 += This->currentDesc.Height - h; rect.y2 += This->currentDesc.Height - h; } - ENTER_GL(); myDevice->blitter->set_shader((IWineD3DDevice *) myDevice, Src->resource.format, Src->glDescription.target, Src->pow2Width, Src->pow2Height); + ENTER_GL(); + /* Bind the texture */ glBindTexture(Src->glDescription.target, Src->glDescription.textureName); checkGLcall("glBindTexture"); @@ -3555,8 +3563,6 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, RECT * glBindTexture(Src->glDescription.target, 0); checkGLcall("glBindTexture(Src->glDescription.target, 0)"); - /* Leave the opengl state valid for blitting */ - myDevice->blitter->unset_shader((IWineD3DDevice *) myDevice); /* Restore the color key parameters */ Src->CKeyFlags = oldCKeyFlags; @@ -3568,6 +3574,9 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, RECT * LEAVE_GL(); + /* Leave the opengl state valid for blitting */ + myDevice->blitter->unset_shader((IWineD3DDevice *) myDevice); + /* Flush in case the drawable is used by multiple GL contexts */ if(dstSwapchain && (This == (IWineD3DSurfaceImpl *) dstSwapchain->frontBuffer || dstSwapchain->num_contexts >= 2)) glFlush(); @@ -4411,7 +4420,6 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_LoadLocation(IWineD3DSurface *iface, D if(!device->isInDraw) ActivateContext(device, device->lastActiveRenderTarget, CTXUSAGE_RESOURCELOAD); surface_bind_and_dirtify(This); - ENTER_GL(); /* The only place where LoadTexture() might get called when isInDraw=1 * is ActivateContext where lastActiveRenderTarget is preloaded. @@ -4463,7 +4471,9 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_LoadLocation(IWineD3DSurface *iface, D } /* Make sure the correct pitch is used */ + ENTER_GL(); glPixelStorei(GL_UNPACK_ROW_LENGTH, width); + LEAVE_GL(); if ((This->Flags & SFLAG_NONPOW2) && !(This->Flags & SFLAG_OVERSIZE)) { TRACE("non power of two support\n"); @@ -4486,6 +4496,7 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_LoadLocation(IWineD3DSurface *iface, D } /* Restore the default pitch */ + ENTER_GL(); glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); LEAVE_GL(); diff --git a/dlls/wined3d/surface_base.c b/dlls/wined3d/surface_base.c index bace47616e9..1c8de429499 100644 --- a/dlls/wined3d/surface_base.c +++ b/dlls/wined3d/surface_base.c @@ -7,7 +7,7 @@ * Copyright 2002-2003 Raphael Junqueira * Copyright 2004 Christian Costa * Copyright 2005 Oliver Stieber - * Copyright 2006-2008 Stefan Dösinger for CodeWeavers + * Copyright 2006-2008 Stefan Dösinger for CodeWeavers * Copyright 2007 Henri Verbeet * Copyright 2006-2007 Roderick Colenbrander * diff --git a/dlls/wined3d/surface_gdi.c b/dlls/wined3d/surface_gdi.c index 910db0cdd13..a17c007aba7 100644 --- a/dlls/wined3d/surface_gdi.c +++ b/dlls/wined3d/surface_gdi.c @@ -8,7 +8,7 @@ * Copyright 2002-2003 Raphael Junqueira * Copyright 2004 Christian Costa * Copyright 2005 Oliver Stieber - * Copyright 2006-2008 Stefan Dösinger + * Copyright 2006-2008 Stefan Dösinger * * 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/wined3d/swapchain.c b/dlls/wined3d/swapchain.c index a9a5787610d..74e1cf6341f 100644 --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c @@ -4,7 +4,7 @@ *Copyright 2002-2003 Jason Edmeades *Copyright 2002-2003 Raphael Junqueira *Copyright 2005 Oliver Stieber - *Copyright 2007-2008 Stefan Dösinger for CodeWeavers + *Copyright 2007-2008 Stefan Dösinger for CodeWeavers * *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/wined3d/swapchain_base.c b/dlls/wined3d/swapchain_base.c index 40881908488..363331c9d7b 100644 --- a/dlls/wined3d/swapchain_base.c +++ b/dlls/wined3d/swapchain_base.c @@ -4,7 +4,7 @@ *Copyright 2002-2003 Jason Edmeades *Copyright 2002-2003 Raphael Junqueira *Copyright 2005 Oliver Stieber - *Copyright 2007-2008 Stefan Dösinger for CodeWeavers + *Copyright 2007-2008 Stefan Dösinger for CodeWeavers * *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/wined3d/swapchain_gdi.c b/dlls/wined3d/swapchain_gdi.c index d76b9b5e3fa..f0ec4f2fad0 100644 --- a/dlls/wined3d/swapchain_gdi.c +++ b/dlls/wined3d/swapchain_gdi.c @@ -4,7 +4,7 @@ *Copyright 2002-2003 Jason Edmeades *Copyright 2002-2003 Raphael Junqueira *Copyright 2005 Oliver Stieber - *Copyright 2007-2008 Stefan Dösinger for CodeWeavers + *Copyright 2007-2008 Stefan Dösinger for CodeWeavers * *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/wined3d/texture.c b/dlls/wined3d/texture.c index 2c3f5d51a3e..98aea922dff 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -4,7 +4,7 @@ * Copyright 2002-2005 Jason Edmeades * Copyright 2002-2005 Raphael Junqueira * Copyright 2005 Oliver Stieber - * Copyright 2007-2008 Stefan Dösinger for CodeWeavers + * Copyright 2007-2008 Stefan Dösinger for CodeWeavers * * 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/wined3d/utils.c b/dlls/wined3d/utils.c index 57e2b37778a..94d862551ea 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -6,7 +6,7 @@ * Copyright 2004 Christian Costa * Copyright 2005 Oliver Stieber * Copyright 2006-2008 Henri Verbeet - * Copyright 2007-2008 Stefan Dösinger for CodeWeavers + * Copyright 2007-2008 Stefan Dösinger for CodeWeavers * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -1083,6 +1083,7 @@ const char *debug_fbostatus(GLenum status) { FBOSTATUS_TO_STR(GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT); FBOSTATUS_TO_STR(GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT); FBOSTATUS_TO_STR(GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT); + FBOSTATUS_TO_STR(GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT); FBOSTATUS_TO_STR(GL_FRAMEBUFFER_UNSUPPORTED_EXT); #undef FBOSTATUS_TO_STR default: diff --git a/dlls/wined3d/vertexbuffer.c b/dlls/wined3d/vertexbuffer.c index f458732c9f2..5f687ff0bfc 100644 --- a/dlls/wined3d/vertexbuffer.c +++ b/dlls/wined3d/vertexbuffer.c @@ -4,7 +4,7 @@ * Copyright 2002-2005 Jason Edmeades * Raphael Junqueira * Copyright 2004 Christian Costa - * Copyright 2007 Stefan Dösinger for CodeWeavers + * Copyright 2007 Stefan Dösinger for CodeWeavers * * 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/wined3d/vertexshader.c b/dlls/wined3d/vertexshader.c index 80bfda00b25..05c6d6dec77 100644 --- a/dlls/wined3d/vertexshader.c +++ b/dlls/wined3d/vertexshader.c @@ -6,7 +6,7 @@ * Copyright 2004 Christian Costa * Copyright 2005 Oliver Stieber * Copyright 2006 Ivan Gyurdiev - * Copyright 2007-2008 Stefan Dösinger for CodeWeavers + * Copyright 2007-2008 Stefan Dösinger for CodeWeavers * * 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/wined3d/volume.c b/dlls/wined3d/volume.c index 36f0495e47e..8faef0ca8fb 100644 --- a/dlls/wined3d/volume.c +++ b/dlls/wined3d/volume.c @@ -328,6 +328,8 @@ static HRESULT WINAPI IWineD3DVolumeImpl_LoadTexture(IWineD3DVolume *iface, int glDesc->glFormat, glDesc->glType, This->resource.allocatedMemory); + + ENTER_GL(); GL_EXTCALL(glTexImage3DEXT(GL_TEXTURE_3D, gl_level, glDesc->glInternal, @@ -339,6 +341,7 @@ static HRESULT WINAPI IWineD3DVolumeImpl_LoadTexture(IWineD3DVolume *iface, int glDesc->glType, This->resource.allocatedMemory)); checkGLcall("glTexImage3D"); + LEAVE_GL(); /* When adding code releasing This->resource.allocatedMemory to save data keep in mind that * GL_UNPACK_CLIENT_STORAGE_APPLE is enabled by default if supported(GL_APPLE_client_storage). diff --git a/dlls/wined3d/volumetexture.c b/dlls/wined3d/volumetexture.c index 035cf905f21..53275e17ca7 100644 --- a/dlls/wined3d/volumetexture.c +++ b/dlls/wined3d/volumetexture.c @@ -107,7 +107,7 @@ static void WINAPI IWineD3DVolumeTextureImpl_PreLoad(IWineD3DVolumeTexture *ifac srgb_was_toggled = This->baseTexture.is_srgb != srgb_mode; This->baseTexture.is_srgb = srgb_mode; } - ENTER_GL(); + /* If the texture is marked dirty or the srgb sampler setting has changed since the last load then reload the surfaces */ if (This->baseTexture.dirty) { for (i = 0; i < This->baseTexture.levels; i++) @@ -125,7 +125,6 @@ static void WINAPI IWineD3DVolumeTextureImpl_PreLoad(IWineD3DVolumeTexture *ifac } else { TRACE("(%p) Texture not dirty, nothing to do\n" , iface); } - LEAVE_GL(); /* No longer dirty */ This->baseTexture.dirty = FALSE; diff --git a/dlls/wined3d/wined3d_main.c b/dlls/wined3d/wined3d_main.c index 6ae0e809f3c..fa1d0284f61 100644 --- a/dlls/wined3d/wined3d_main.c +++ b/dlls/wined3d/wined3d_main.c @@ -4,7 +4,7 @@ * Copyright 2002-2003 The wine-d3d team * Copyright 2002-2003 Raphael Junqueira * Copyright 2004 Jason Edmeades - * Copyright 2007-2008 Stefan Dösinger for CodeWeavers + * Copyright 2007-2008 Stefan Dösinger for CodeWeavers * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -48,7 +48,7 @@ wined3d_settings_t wined3d_settings = FALSE /* Disable multisampling for now due to Nvidia driver bugs which happens for some users */ }; -IWineD3D* WINAPI WineDirect3DCreate(UINT SDKVersion, UINT dxVersion, IUnknown *parent) { +IWineD3D* WINAPI WineDirect3DCreate(UINT dxVersion, IUnknown *parent) { IWineD3DImpl* object; if (!InitAdapters()) { diff --git a/dlls/winedos/devices.c b/dlls/winedos/devices.c index 49d84d38997..6246cf9ba06 100644 --- a/dlls/winedos/devices.c +++ b/dlls/winedos/devices.c @@ -1,7 +1,7 @@ /* * DOS devices * - * Copyright 1999 Ove Kåven + * Copyright 1999 Ove Kåven * * 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/winedos/dosexe.h b/dlls/winedos/dosexe.h index a6418493174..2a20de754e4 100644 --- a/dlls/winedos/dosexe.h +++ b/dlls/winedos/dosexe.h @@ -1,7 +1,7 @@ /* * DOS EXE loader * - * Copyright 1998 Ove Kåven + * Copyright 1998 Ove Kåven * * 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/winedos/dosvm.c b/dlls/winedos/dosvm.c index 4a86855368b..c139023b650 100644 --- a/dlls/winedos/dosvm.c +++ b/dlls/winedos/dosvm.c @@ -1,7 +1,7 @@ /* * DOS Virtual Machine * - * Copyright 1998 Ove Kåven + * Copyright 1998 Ove Kåven * * 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/winedos/dosvm.h b/dlls/winedos/dosvm.h index 36168283f34..098dacc1241 100644 --- a/dlls/winedos/dosvm.h +++ b/dlls/winedos/dosvm.h @@ -1,7 +1,7 @@ /* * DOS virtual machine * - * Copyright 2000 Ove Kåven + * Copyright 2000 Ove Kåven * * 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/winedos/int09.c b/dlls/winedos/int09.c index f9a543685fb..f45baa462eb 100644 --- a/dlls/winedos/int09.c +++ b/dlls/winedos/int09.c @@ -1,7 +1,7 @@ /* * DOS interrupt 09h handler (IRQ1 - KEYBOARD) * - * Copyright 1999 Ove Kåven + * Copyright 1999 Ove Kåven * * 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/winedos/int10.c b/dlls/winedos/int10.c index 94ea6ff2e4a..952212f1501 100644 --- a/dlls/winedos/int10.c +++ b/dlls/winedos/int10.c @@ -1,7 +1,7 @@ /* * BIOS interrupt 10h handler * - * Copyright 1998 Ove Kåven + * Copyright 1998 Ove Kåven * Copyright 1998 Joseph Pranevich * * This library is free software; you can redistribute it and/or @@ -133,64 +133,88 @@ struct _ModeInfoBlock { #include "poppack.h" +/* VGA VESA definitions */ +enum modetype {TEXT=0, GRAPHIC=1}; /* * Wine internal information about video modes. - * If depth is zero, the mode is considered to - * be a text mode. */ typedef struct { WORD Mode; - WORD Width; - WORD Height; - WORD Depth; + BOOL ModeType; + WORD TextCols; /* columns of text in display */ + WORD TextRows; /* rows of text in display */ + WORD CharWidth; + WORD CharHeight; + WORD Width; /* width of display in pixels */ + WORD Height; /* height of display in pixels */ + WORD Depth; /* bits per pixel */ + WORD Colors; /* total available colors */ + WORD ScreenPages; + BOOL Supported; } INT10_MODE; /* * List of supported video modes. + * + * should be expanded to contain most or all information + * as required for SVGA VESA mode info block for VESA BIOS subsystem 1 (see _ModeInfoBlock) + * this will allow proper support for FIXME items in VGA/VESA mode configuration + * + * FIXME - verify and define support for VESA modes + * FIXME - add # bit planes, # video memory banks, & memory model */ static const INT10_MODE INT10_modelist[] = { - {0x0000, 40, 25, 0}, - {0x0001, 40, 25, 0}, - {0x0002, 80, 25, 0}, - {0x0003, 80, 25, 0}, - {0x0007, 80, 25, 0}, - {0x000d, 320, 200, 4}, - {0x000e, 640, 200, 4}, - {0x0010, 640, 350, 4}, - {0x0012, 640, 480, 4}, - {0x0013, 320, 200, 8}, - {0x006a, 800, 600, 4}, /* VESA mode, same as 0x102 */ - {0x0100, 640, 400, 8}, - {0x0101, 640, 480, 8}, - {0x0102, 800, 600, 4}, - {0x0103, 800, 600, 8}, - {0x0104, 1024, 768, 4}, - {0x0105, 1024, 768, 8}, - {0x0106, 1280, 1024, 4}, - {0x0107, 1280, 1024, 8}, - {0x0108, 80, 60, 0}, - {0x0109, 132, 25, 0}, - {0x010a, 132, 43, 0}, - {0x010b, 132, 50, 0}, - {0x010c, 132, 60, 0}, - {0x010d, 320, 200, 15}, - {0x010e, 320, 200, 16}, - {0x010f, 320, 200, 24}, - {0x0110, 640, 480, 15}, - {0x0111, 640, 480, 16}, - {0x0112, 640, 480, 24}, - {0x0113, 800, 600, 15}, - {0x0114, 800, 600, 16}, - {0x0115, 800, 600, 24}, - {0x0116, 1024, 768, 15}, - {0x0117, 1024, 768, 16}, - {0x0118, 1024, 768, 24}, - {0x0119, 1280, 1024, 15}, - {0x011a, 1280, 1024, 16}, - {0x011b, 1280, 1024, 24}, - {0xffff, 0, 0, 0} + /* VGA modes */ + {0x0000, TEXT, 40, 25, 9, 16, 360, 400, 0, 16, 8, TRUE}, /* VGA text mode 0 */ + {0x0001, TEXT, 40, 25, 9, 16, 360, 400, 0, 16, 8, TRUE}, /* VGA text mode 1 */ + {0x0002, TEXT, 80, 25, 9, 16, 360, 400, 0, 16, 8, TRUE}, /* VGA text mode 2 */ + {0x0003, TEXT, 80, 25, 9, 16, 360, 400, 0, 16, 8, TRUE}, /* VGA text mode 3 */ + {0x0004, GRAPHIC, 40, 25, 8, 8, 320, 200, 2, 4, 1, FALSE}, /* VGA graphics mode 4 */ + {0x0005, GRAPHIC, 40, 25, 8, 8, 320, 200, 2, 4, 1, FALSE}, /* VGA graphics mode 5 */ + {0x0006, GRAPHIC, 80, 25, 8, 8, 640, 200, 1, 2, 1, FALSE}, /* VGA graphics mode 6 */ + {0x0007, TEXT, 80, 25, 9, 16, 720, 400, 0, 0, 8, FALSE}, /* VGA text mode 7 - FIXME bad default address */ + {0x000d, GRAPHIC, 40, 25, 8, 8, 320, 200, 4, 16, 8, FALSE}, /* VGA graphics mode 13 */ + {0x000e, GRAPHIC, 80, 25, 8, 8, 640, 200, 4, 16, 4, FALSE}, /* VGA graphics mode 14 */ + {0x000f, GRAPHIC, 80, 25, 8, 14, 640, 350, 0, 0, 2, FALSE}, /* VGA graphics mode 15 */ + {0x0010, GRAPHIC, 80, 25, 8, 14, 640, 350, 4, 16, 2, FALSE}, /* VGA graphics mode 16 */ + {0x0012, GRAPHIC, 80, 30, 8, 16, 640, 480, 1, 2, 1, FALSE}, /* VGA graphics mode 17 */ + {0x0012, GRAPHIC, 80, 30, 8, 16, 640, 480, 4, 16, 1, FALSE}, /* VGA graphics mode 18 */ + {0x0013, GRAPHIC, 40, 25, 8, 8, 320, 200, 8, 256, 1, TRUE}, /* VGA graphics mode 19 */ + /* VESA 7-bit modes */ + {0x006a, GRAPHIC, 0, 0, 0, 0, 800, 600, 4, 16, 1, TRUE}, /* VESA graphics mode, same as 0x102 */ + /* VESA 15-bit modes */ + {0x0100, GRAPHIC, 0, 0, 0, 0, 640, 400, 8, 256, 1, TRUE}, /* VESA graphics mode */ + {0x0101, GRAPHIC, 0, 0, 0, 0, 640, 480, 8, 256, 1, TRUE}, /* VESA graphics mode */ + {0x0102, GRAPHIC, 0, 0, 0, 0, 800, 600, 4, 16, 1, TRUE}, /* VESA graphics mode */ + {0x0103, GRAPHIC, 0, 0, 0, 0, 800, 600, 8, 256, 1, TRUE}, /* VESA graphics mode */ + {0x0104, GRAPHIC, 0, 0, 0, 0, 1024, 768, 4, 16, 1, TRUE}, /* VESA graphics mode */ + {0x0105, GRAPHIC, 0, 0, 0, 0, 1024, 768, 8, 256, 1, TRUE}, /* VESA graphics mode */ + {0x0106, GRAPHIC, 0, 0, 0, 0, 1280, 1024, 4, 16, 1, TRUE}, /* VESA graphics mode */ + {0x0107, GRAPHIC, 0, 0, 0, 0, 1280, 1024, 8, 256, 1, TRUE}, /* VESA graphics mode */ + {0x0108, TEXT, 0, 0, 0, 0, 80, 60, 0, 0, 1, TRUE}, /* VESA text mode */ + {0x0109, TEXT, 0, 0, 0, 0, 132, 25, 0, 0, 1, TRUE}, /* VESA text mode */ + {0x010a, TEXT, 0, 0, 0, 0, 132, 43, 0, 0, 1, TRUE}, /* VESA text mode */ + {0x010b, TEXT, 0, 0, 0, 0, 132, 50, 0, 0, 1, TRUE}, /* VESA text mode */ + {0x010c, TEXT, 0, 0, 0, 0, 132, 60, 0, 0, 1, TRUE}, /* VESA text mode */ + /* VESA 1.2 modes */ + {0x010d, GRAPHIC, 0, 0, 0, 0, 320, 200, 15, 0, 1, TRUE}, /* VESA graphics mode, 32K colors */ + {0x010e, GRAPHIC, 0, 0, 0, 0, 320, 200, 16, 0, 1, TRUE}, /* VESA graphics mode, 64K colors */ + {0x010f, GRAPHIC, 0, 0, 0, 0, 320, 200, 24, 0, 1, TRUE}, /* VESA graphics mode, 16.8 Million colors */ + {0x0110, GRAPHIC, 0, 0, 0, 0, 640, 480, 15, 0, 1, TRUE}, /* VESA graphics mode, 32K colors */ + {0x0111, GRAPHIC, 0, 0, 0, 0, 640, 480, 16, 0, 1, TRUE}, /* VESA graphics mode, 64K colors */ + {0x0112, GRAPHIC, 0, 0, 0, 0, 640, 480, 24, 0, 1, TRUE}, /* VESA graphics mode, 16.8 Million colors */ + {0x0113, GRAPHIC, 0, 0, 0, 0, 800, 600, 15, 0, 1, TRUE}, /* VESA graphics mode, 32K colors */ + {0x0114, GRAPHIC, 0, 0, 0, 0, 800, 600, 16, 0, 1, TRUE}, /* VESA graphics mode, 64K colors */ + {0x0115, GRAPHIC, 0, 0, 0, 0, 800, 600, 24, 0, 1, TRUE}, /* VESA graphics mode, 16.8 Million colors */ + {0x0116, GRAPHIC, 0, 0, 0, 0, 1024, 768, 15, 0, 1, TRUE}, /* VESA graphics mode, 32K colors */ + {0x0117, GRAPHIC, 0, 0, 0, 0, 1024, 768, 16, 0, 1, TRUE}, /* VESA graphics mode, 64K colors */ + {0x0118, GRAPHIC, 0, 0, 0, 0, 1024, 768, 24, 0, 1, TRUE}, /* VESA graphics mode, 16.8 Million colors */ + {0x0119, GRAPHIC, 0, 0, 0, 0, 1280, 1024, 15, 0, 1, TRUE}, /* VESA graphics mode, 32K colors */ + {0x011a, GRAPHIC, 0, 0, 0, 0, 1280, 1024, 16, 0, 1, TRUE}, /* VESA graphics mode, 64K colors */ + {0x011b, GRAPHIC, 0, 0, 0, 0, 1280, 1024, 24, 0, 1, TRUE}, /* VESA graphics mode, 16.8 Million colors */ + {0xffff, TEXT, 0, 0, 0, 0, 0, 0, 0, 0, 1, FALSE} }; /* True if video mode is a vesa mode, false otherwise. @@ -343,22 +367,32 @@ static BOOL INT10_FillModeInformation( struct _ModeInfoBlock *mib, WORD mode ) * 13-15 - Reserved. */ { - WORD attr = 0x000a; /* color mode, optional info */ + WORD attr = 0x0002; /* set optional info available */ + /* Enable color mode - if both Colors & Depth are 0, then assume monochrome*/ + if (ptr->Colors || ptr->Depth) + { + attr |= 0x0008; + } /* * FIXME: Attribute handling is incomplete. */ - /* Mode supported? FIXME: correct value */ - attr |= 0x0001; + /* Mode supported? */ + if (ptr->Supported) + { + attr |= 0x0001; /* set display mode supported */ + } /* Graphical mode? */ - if (ptr->Depth) - attr |= 0x0010; + if (ptr->ModeType != TEXT) + { + attr |= 0x0010; /* set graphics mode on (text mode off) */ + } /* Not VGA-compatible? */ if (IS_VESA_MODE(mode)) - attr |= 0x0020; + attr |= 0x0020; /* disable VGA ports */ mib->ModeAttributes = attr; } @@ -392,16 +426,30 @@ static BOOL INT10_FillModeInformation( struct _ModeInfoBlock *mib, WORD mode ) mib->BytesPerScanLine = ptr->Width * (ptr->Depth ? (ptr->Depth + 7) / 8 : 1); /* 18 - WORD: width in pixels (graphics) or characters (text) */ - mib->XResolution = ptr->Width; + if (ptr->ModeType == TEXT) + { + mib->XResolution = ptr->TextCols; + } + else + { + mib->XResolution = ptr->Width; + } /* 20 - WORD: height in pixels (graphics) or characters (text) */ - mib->YResolution = ptr->Height; + if (ptr->ModeType == TEXT) + { + mib->YResolution = ptr->TextRows; + } + else + { + mib->YResolution = ptr->Height; + } /* 22 - BYTE: width of character cell in pixels */ - mib->XCharSize = 0; /* FIXME */ + mib->XCharSize = ptr->CharWidth; /* 23 - BYTE: height of character cell in pixels */ - mib->YCharSize = 0; /* FIXME */ + mib->YCharSize = ptr->CharHeight; /* 24 - BYTE: number of memory planes */ mib->NumberOfPlanes = 1; /* FIXME */ @@ -426,7 +474,7 @@ static BOOL INT10_FillModeInformation( struct _ModeInfoBlock *mib, WORD mode ) * 08-0F - Reserved for VESA. * 10-FF - OEM memory models. */ - if (!ptr->Depth) + if (ptr->ModeType == TEXT) mib->MemoryModel = 0; /* text mode */ else mib->MemoryModel = 3; /* FIXME */ @@ -435,7 +483,7 @@ static BOOL INT10_FillModeInformation( struct _ModeInfoBlock *mib, WORD mode ) mib->BankSize = 0; /* FIXME */ /* 29 - BYTE: number of image pages (less one) in video RAM */ - mib->NumberOfImagePages = 0; /* FIXME */ + mib->NumberOfImagePages = (ptr->ScreenPages)-1; /* 30 - BYTE: reserved (0x00 for VBE 1.0-2.0, 0x01 for VBE 3.0) */ mib->Reserved1 = 0x01; @@ -714,7 +762,7 @@ INT10_HEAP *INT10_GetHeap( void ) strcpy( heap_pointer->VesaOEMName, "WINE SVGA BOARD" ); strcpy( heap_pointer->VesaVendorName, "WINE" ); strcpy( heap_pointer->VesaProductName, "WINE SVGA" ); - strcpy( heap_pointer->VesaProductRev, "2003" ); + strcpy( heap_pointer->VesaProductRev, "2008" ); heap_pointer->VesaCurrentMode = 0; /* Initialized later. */ heap_pointer->WineHeapSegment = segment; @@ -758,6 +806,8 @@ static BOOL INT10_SetVideoMode( BIOSDATA *data, WORD mode ) /* * Linear framebuffer is not supported. + * FIXME - not sure this is valid since mode 19 is 256 color & linear + * of course only 1 window is addressable. */ if (mode & 0x4000) return FALSE; @@ -777,25 +827,25 @@ static BOOL INT10_SetVideoMode( BIOSDATA *data, WORD mode ) else data->VideoMode = 0; - if (ptr->Depth == 0) + if (ptr->ModeType == TEXT) { /* Text mode. */ TRACE( "Setting %s %dx%d text mode (screen %s)\n", IS_VESA_MODE(mode) ? "VESA" : "VGA", - ptr->Width, ptr->Height, + ptr->TextCols, ptr->TextRows, clearScreen ? "cleared" : "preserved" ); /* * FIXME: We should check here if alpha mode could be set. */ - VGA_SetAlphaMode( ptr->Width, ptr->Height ); + VGA_SetAlphaMode( ptr->TextCols, ptr->TextRows ); - data->VideoColumns = ptr->Width; - data->RowsOnScreenMinus1 = ptr->Height - 1; + data->VideoColumns = ptr->TextCols; + data->RowsOnScreenMinus1 = ptr->TextRows - 1; if (clearScreen) { - VGA_ClearText( 0, 0, ptr->Height-1, ptr->Width-1, 0x07 ); + VGA_ClearText( 0, 0, ptr->TextCols-1, ptr->TextRows-1, 0x07 ); INT10_SetCursorPos( data, 0, 0, 0 ); VGA_SetCursorPos( 0, 0 ); } diff --git a/dlls/winedos/int16.c b/dlls/winedos/int16.c index 272abc26283..12e1c46b31d 100644 --- a/dlls/winedos/int16.c +++ b/dlls/winedos/int16.c @@ -2,7 +2,7 @@ * DOS interrupt 16h handler * * Copyright 1998 Joseph Pranevich - * Copyright 1999 Ove Kåven + * Copyright 1999 Ove Kåven * * 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/winedos/int33.c b/dlls/winedos/int33.c index a898fe91ce8..7172740f101 100644 --- a/dlls/winedos/int33.c +++ b/dlls/winedos/int33.c @@ -1,7 +1,7 @@ /* * DOS interrupt 33h handler * - * Copyright 1999 Ove Kåven + * Copyright 1999 Ove Kåven * * 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/winedos/ioports.c b/dlls/winedos/ioports.c index e9f4f7f148b..bd73af4da77 100644 --- a/dlls/winedos/ioports.c +++ b/dlls/winedos/ioports.c @@ -414,29 +414,32 @@ DWORD WINAPI DOSVM_inport( int port, int size ) case 0x22e: res = (DWORD)SB_ioport_in( port ); break; - case 0x3ba: - case 0x3c0: - case 0x3c1: - case 0x3c2: - case 0x3c3: - case 0x3c4: - case 0x3c5: + /* VGA read registers */ + case 0x3b4: /* CRT Controller Register - Index (MDA) */ + case 0x3b5: /* CRT Controller Register - Other (MDA) */ + case 0x3ba: /* General Register - Input status 1 (MDA) */ + case 0x3c0: /* Attribute Controller - Address */ + case 0x3c1: /* Attribute Controller - Other */ + case 0x3c2: /* General Register - Input status 0 */ + case 0x3c3: /* General Register - Video subsystem enable */ + case 0x3c4: /* Sequencer Register - Address */ + case 0x3c5: /* Sequencer Register - Other */ case 0x3c6: - case 0x3c7: + case 0x3c7: /* General Register - DAC State */ case 0x3c8: case 0x3c9: - case 0x3ca: + case 0x3ca: /* General Register - Feature control */ case 0x3cb: - case 0x3cc: + case 0x3cc: /* General Register - Misc output */ case 0x3cd: - case 0x3ce: - case 0x3cf: + case 0x3ce: /* Graphics Controller Register - Address */ + case 0x3cf: /* Graphics Controller Register - Other */ case 0x3d0: case 0x3d1: case 0x3d2: case 0x3d3: - case 0x3d4: - case 0x3d5: + case 0x3d4: /* CRT Controller Register - Index (CGA) */ + case 0x3d5: /* CRT Controller Register - Other (CGA) */ case 0x3d6: case 0x3d7: case 0x3d8: @@ -624,12 +627,16 @@ void WINAPI DOSVM_outport( int port, int size, DWORD value ) case 0x22c: SB_ioport_out( port, (BYTE)value ); break; - case 0x3c0: + /* VGA Write registers */ + case 0x3b4: /* CRT Controller Register - Index (MDA) */ + case 0x3b5: /* CRT Controller Register - Other (MDA) */ + case 0x3ba: /* General Register - Feature Control */ + case 0x3c0: /* Attribute Controller - Address/Other */ case 0x3c1: - case 0x3c2: - case 0x3c3: - case 0x3c4: - case 0x3c5: + case 0x3c2: /* General Register - Misc output */ + case 0x3c3: /* General Register - Video subsystem enable */ + case 0x3c4: /* Sequencer Register - Address */ + case 0x3c5: /* Sequencer Register - Other */ case 0x3c6: case 0x3c7: case 0x3c8: @@ -638,14 +645,14 @@ void WINAPI DOSVM_outport( int port, int size, DWORD value ) case 0x3cb: case 0x3cc: case 0x3cd: - case 0x3ce: - case 0x3cf: + case 0x3ce: /* Graphics Controller Register - Address */ + case 0x3cf: /* Graphics Controller Register - Other */ case 0x3d0: case 0x3d1: case 0x3d2: case 0x3d3: - case 0x3d4: - case 0x3d5: + case 0x3d4: /* CRT Controller Register - Index (CGA) */ + case 0x3d5: /* CRT Controller Register - Other (CGA) */ case 0x3d6: case 0x3d7: case 0x3d8: diff --git a/dlls/winedos/module.c b/dlls/winedos/module.c index ac35e8545b4..0aa389f3934 100644 --- a/dlls/winedos/module.c +++ b/dlls/winedos/module.c @@ -1,7 +1,7 @@ /* * DOS (MZ) loader * - * Copyright 1998 Ove Kåven + * Copyright 1998 Ove Kåven * * 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/winedos/vga.c b/dlls/winedos/vga.c index 96cadb9bb9a..a5298e03ed0 100644 --- a/dlls/winedos/vga.c +++ b/dlls/winedos/vga.c @@ -1,7 +1,7 @@ /* * VGA hardware emulation * - * Copyright 1998 Ove Kåven (with some help from Marcus Meissner) + * Copyright 1998 Ove Kåven (with some help from Marcus Meissner) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -159,10 +159,12 @@ static void CALLBACK VGA_Poll( LPVOID arg, DWORD low, DWORD high ); static HWND vga_hwnd = NULL; /* - * For simplicity, I'm creating a second palette. - * 16 color accesses will use these pointers and insert - * entries from the 64-color palette into the default - * palette. --Robert 'Admiral' Coeyman + * VGA Palette Registers, in actual 18 bit color + * port 3C0H - 6 bit rgbRGB format + * + * 16 color accesses will use these pointers and insert + * entries from the 64-color palette (mode 18) into the default + * palette. --Robert 'Admiral' Coeyman */ static char vga_16_palette[17]={ @@ -173,7 +175,7 @@ static char vga_16_palette[17]={ 0x04, /* 4 - Red */ 0x05, /* 5 - Magenta */ 0x14, /* 6 - Brown */ - 0x07, /* 7 - Light gray */ + 0x07, /* 7 - White (Light gray) */ 0x38, /* 8 - Dark gray */ 0x39, /* 9 - Light blue */ 0x3a, /* A - Light green */ @@ -181,35 +183,286 @@ static char vga_16_palette[17]={ 0x3c, /* C - Light red */ 0x3d, /* D - Light magenta */ 0x3e, /* E - Yellow */ - 0x3f, /* F - White */ + 0x3f, /* F - Bright White (White) */ 0x00 /* Border Color */ }; +/* + * Mode 19 Default Color Register Setting + * DAC palette registers, converted from actual 18 bit color to 24. + */ static PALETTEENTRY vga_def_palette[256]={ /* red green blue */ - {0x00, 0x00, 0x00}, /* 0 - Black */ - {0x00, 0x00, 0x80}, /* 1 - Blue */ - {0x00, 0x80, 0x00}, /* 2 - Green */ - {0x00, 0x80, 0x80}, /* 3 - Cyan */ - {0x80, 0x00, 0x00}, /* 4 - Red */ - {0x80, 0x00, 0x80}, /* 5 - Magenta */ - {0x80, 0x80, 0x00}, /* 6 - Brown */ - {0xC0, 0xC0, 0xC0}, /* 7 - Light gray */ - {0x80, 0x80, 0x80}, /* 8 - Dark gray */ - {0x00, 0x00, 0xFF}, /* 9 - Light blue */ - {0x00, 0xFF, 0x00}, /* A - Light green */ - {0x00, 0xFF, 0xFF}, /* B - Light cyan */ - {0xFF, 0x00, 0x00}, /* C - Light red */ - {0xFF, 0x00, 0xFF}, /* D - Light magenta */ - {0xFF, 0xFF, 0x00}, /* E - Yellow */ - {0xFF, 0xFF, 0xFF}, /* F - White */ - {0,0,0} /* FIXME: a series of continuous rainbow hues should follow */ + /* 16 colors in IRGB values */ + {0x00, 0x00, 0x00}, /* 0 (0) - Black */ + {0x00, 0x00, 0xAA}, /* 1 (1) - Blue */ + {0x00, 0xAA, 0x00}, /* 2 (2) - Green */ + {0x00, 0xAA, 0xAA}, /* 3 (3) - Cyan */ + {0xAA, 0x00, 0x00}, /* 4 (4) - Red */ + {0xAA, 0x00, 0xAA}, /* 5 (5) - Magenta */ + {0xAA, 0x55, 0x00}, /* 6 (6) - Brown */ + {0xAA, 0xAA, 0xAA}, /* 7 (7) - White (Light gray) */ + {0x55, 0x55, 0x55}, /* 8 (8) - Dark gray */ + {0x55, 0x55, 0xFF}, /* 9 (9) - Light blue */ + {0x55, 0xFF, 0x55}, /* 10 (A) - Light green */ + {0x55, 0xFF, 0xFF}, /* 11 (B) - Light cyan */ + {0xFF, 0x55, 0x55}, /* 12 (C) - Light red */ + {0xFF, 0x55, 0xFF}, /* 13 (D) - Light magenta */ + {0xFF, 0xFF, 0x55}, /* 14 (E) - Yellow */ + {0xFF, 0xFF, 0xFF}, /* 15 (F) - Bright White (White) */ + /* 16 shades of gray */ + {0x00, 0x00, 0x00}, /* 16 (10) */ + {0x10, 0x10, 0x10}, /* 17 (11) */ + {0x20, 0x20, 0x20}, /* 18 (12) */ + {0x35, 0x35, 0x35}, /* 19 (13) */ + {0x45, 0x45, 0x45}, /* 20 (14) */ + {0x55, 0x55, 0x55}, /* 21 (15) */ + {0x65, 0x65, 0x65}, /* 22 (16) */ + {0x75, 0x75, 0x75}, /* 23 (17) */ + {0x8A, 0x8A, 0x8A}, /* 24 (18) */ + {0x9A, 0x9A, 0x9A}, /* 25 (19) */ + {0xAA, 0xAA, 0xAA}, /* 26 (1A) */ + {0xBA, 0xBA, 0xBA}, /* 27 (1B) */ + {0xCA, 0xCA, 0xCA}, /* 28 (1C) */ + {0xDF, 0xDF, 0xDF}, /* 29 (1D) */ + {0xEF, 0xEF, 0xEF}, /* 30 (1E) */ + {0xFF, 0xFF, 0xFF}, /* 31 (1F) */ + /* High Intensity group - 72 colors in 1/3 saturation groups (20H-37H high) */ + {0x00, 0x00, 0xFF}, /* 32 (20) */ + {0x41, 0x00, 0xFF}, /* 33 (21) */ + {0x82, 0x00, 0xFF}, /* 34 (22) */ + {0xBE, 0x00, 0xFF}, /* 35 (23) */ + {0xFF, 0x00, 0xFF}, /* 36 (24) */ + {0xFF, 0x00, 0xBE}, /* 37 (25) */ + {0xFF, 0x00, 0x82}, /* 38 (26) */ + {0xFF, 0x00, 0x41}, /* 39 (27) */ + {0xFF, 0x00, 0x00}, /* 40 (28) */ + {0xFF, 0x41, 0x00}, /* 41 (29) */ + {0xFF, 0x82, 0x00}, /* 42 (2A) */ + {0xFF, 0xBE, 0x00}, /* 43 (2B) */ + {0xFF, 0xFF, 0x00}, /* 44 (2C) */ + {0xBE, 0xFF, 0x00}, /* 45 (2D) */ + {0x82, 0xFF, 0x00}, /* 46 (2E) */ + {0x41, 0xFF, 0x00}, /* 47 (2F) */ + {0x00, 0xFF, 0x00}, /* 48 (30) */ + {0x00, 0xFF, 0x41}, /* 49 (31) */ + {0x00, 0xFF, 0x82}, /* 50 (32) */ + {0x00, 0xFF, 0xBE}, /* 51 (33) */ + {0x00, 0xFF, 0xFF}, /* 52 (34) */ + {0x00, 0xBE, 0xFF}, /* 53 (35) */ + {0x00, 0x82, 0xFF}, /* 54 (36) */ + {0x00, 0x41, 0xFF}, /* 55 (37) */ + /* High Intensity group - 72 colors in 2/3 saturation groups (38H-4FH moderate) */ + {0x82, 0x82, 0xFF}, /* 56 (38) */ + {0x9E, 0x82, 0xFF}, /* 57 (39) */ + {0xBE, 0x82, 0xFF}, /* 58 (3A) */ + {0xDF, 0x82, 0xFF}, /* 59 (3B) */ + {0xFF, 0x82, 0xFF}, /* 60 (3C) */ + {0xFF, 0x82, 0xDF}, /* 61 (3D) */ + {0xFF, 0x82, 0xBE}, /* 62 (3E) */ + {0xFF, 0x82, 0x9E}, /* 63 (3F) */ + {0xFF, 0x82, 0x82}, /* 64 (40) */ + {0xFF, 0x9E, 0x82}, /* 65 (41) */ + {0xFF, 0xBE, 0x82}, /* 66 (42) */ + {0xFF, 0xDF, 0x82}, /* 67 (43) */ + {0xFF, 0xFF, 0x82}, /* 68 (44) */ + {0xDF, 0xFF, 0x82}, /* 69 (45) */ + {0xBE, 0xFF, 0x82}, /* 70 (46) */ + {0x9E, 0xFF, 0x82}, /* 71 (47) */ + {0x82, 0xFF, 0x82}, /* 72 (48) */ + {0x82, 0xFF, 0x9E}, /* 73 (49) */ + {0x82, 0xFF, 0xBE}, /* 74 (4A) */ + {0x82, 0xFF, 0xDF}, /* 75 (4B) */ + {0x82, 0xFF, 0xFF}, /* 76 (4C) */ + {0x82, 0xDF, 0xFF}, /* 77 (4D) */ + {0x82, 0xBE, 0xFF}, /* 78 (4E) */ + {0x82, 0x9E, 0xFF}, /* 79 (4F) */ + /* High Intensity group - 72 colors in 3/3 saturation groups (50H-67H low) */ + {0xBA, 0xBA, 0xFF}, /* 80 (50) */ + {0xCA, 0xBA, 0xFF}, /* 81 (51) */ + {0xDF, 0xBA, 0xFF}, /* 82 (52) */ + {0xEF, 0xBA, 0xFF}, /* 83 (53) */ + {0xFF, 0xBA, 0xFF}, /* 84 (54) */ + {0xFF, 0xBA, 0xEF}, /* 85 (55) */ + {0xFF, 0xBA, 0xDF}, /* 86 (56) */ + {0xFF, 0xBA, 0xCA}, /* 87 (57) */ + {0xFF, 0xBA, 0xBA}, /* 88 (58) */ + {0xFF, 0xCA, 0xBA}, /* 89 (59) */ + {0xFF, 0xDF, 0xBA}, /* 90 (5A) */ + {0xFF, 0xEF, 0xBA}, /* 91 (5B) */ + {0xFF, 0xFF, 0xBA}, /* 92 (5C) */ + {0xEF, 0xFF, 0xBA}, /* 93 (5D) */ + {0xDF, 0xFF, 0xBA}, /* 94 (5E) */ + {0xCA, 0xFF, 0xBA}, /* 95 (5F) */ + {0xBA, 0xFF, 0xBA}, /* 96 (60) */ + {0xBA, 0xFF, 0xCA}, /* 97 (61) */ + {0xBA, 0xFF, 0xDF}, /* 98 (62) */ + {0xBA, 0xFF, 0xEF}, /* 99 (63) */ + {0xBA, 0xFF, 0xFF}, /* 100 (64) */ + {0xBA, 0xEF, 0xFF}, /* 101 (65) */ + {0xBA, 0xDF, 0xFF}, /* 102 (66) */ + {0xBA, 0xCA, 0xFF}, /* 103 (67) */ + /* Medium Intensity group - 72 colors in 1/3 saturation groups (68H-7FH high) */ + {0x00, 0x00, 0x71}, /* 104 (68) */ + {0x1C, 0x00, 0x71}, /* 105 (69) */ + {0x39, 0x00, 0x71}, /* 106 (6A) */ + {0x55, 0x00, 0x71}, /* 107 (6B) */ + {0x71, 0x00, 0x71}, /* 108 (6C) */ + {0x71, 0x00, 0x55}, /* 109 (6D) */ + {0x71, 0x00, 0x39}, /* 110 (6E) */ + {0x71, 0x00, 0x1C}, /* 111 (6F) */ + {0x71, 0x00, 0x00}, /* 112 (70) */ + {0x71, 0x1C, 0x00}, /* 113 (71) */ + {0x71, 0x39, 0x00}, /* 114 (72) */ + {0x71, 0x55, 0x00}, /* 115 (73) */ + {0x71, 0x71, 0x00}, /* 116 (74) */ + {0x55, 0x71, 0x00}, /* 117 (75) */ + {0x39, 0x71, 0x00}, /* 118 (76) */ + {0x1C, 0x71, 0x00}, /* 119 (77) */ + {0x00, 0x71, 0x00}, /* 120 (78) */ + {0x00, 0x71, 0x1C}, /* 121 (79) */ + {0x00, 0x71, 0x39}, /* 122 (7A) */ + {0x00, 0x71, 0x55}, /* 123 (7B) */ + {0x00, 0x71, 0x71}, /* 124 (7C) */ + {0x00, 0x55, 0x71}, /* 125 (7D) */ + {0x00, 0x39, 0x71}, /* 126 (7E) */ + {0x00, 0x1C, 0x71}, /* 127 (7F) */ + /* Medium Intensity group - 72 colors in 2/3 saturation groups (80H-97H moderate) */ + {0x39, 0x39, 0x71}, /* 128 (80) */ + {0x45, 0x39, 0x71}, /* 129 (81) */ + {0x55, 0x39, 0x71}, /* 130 (82) */ + {0x61, 0x39, 0x71}, /* 131 (83) */ + {0x71, 0x39, 0x71}, /* 132 (84) */ + {0x71, 0x39, 0x61}, /* 133 (85) */ + {0x71, 0x39, 0x55}, /* 134 (86) */ + {0x71, 0x39, 0x45}, /* 135 (87) */ + {0x71, 0x39, 0x39}, /* 136 (88) */ + {0x71, 0x45, 0x39}, /* 137 (89) */ + {0x71, 0x55, 0x39}, /* 138 (8A) */ + {0x71, 0x61, 0x39}, /* 139 (8B) */ + {0x71, 0x71, 0x39}, /* 140 (8C) */ + {0x61, 0x71, 0x39}, /* 141 (8D) */ + {0x55, 0x71, 0x39}, /* 142 (8E) */ + {0x45, 0x71, 0x39}, /* 143 (8F) */ + {0x39, 0x71, 0x39}, /* 144 (90) */ + {0x39, 0x71, 0x45}, /* 145 (91) */ + {0x39, 0x71, 0x55}, /* 146 (92) */ + {0x39, 0x71, 0x61}, /* 147 (93) */ + {0x39, 0x71, 0x71}, /* 148 (94) */ + {0x39, 0x61, 0x71}, /* 149 (95) */ + {0x39, 0x55, 0x71}, /* 150 (96) */ + {0x39, 0x45, 0x71}, /* 151 (97) */ + /* Medium Intensity group - 72 colors in 3/3 saturation groups (98H-AFH low) */ + {0x51, 0x51, 0x71}, /* 152 (98) */ + {0x59, 0x51, 0x71}, /* 153 (99) */ + {0x61, 0x51, 0x71}, /* 154 (9A) */ + {0x69, 0x51, 0x71}, /* 155 (9B) */ + {0x71, 0x51, 0x71}, /* 156 (9C) */ + {0x71, 0x51, 0x69}, /* 157 (9D) */ + {0x71, 0x51, 0x61}, /* 158 (9E) */ + {0x71, 0x51, 0x59}, /* 159 (9F) */ + {0x71, 0x51, 0x51}, /* 160 (A0) */ + {0x71, 0x59, 0x51}, /* 161 (A1) */ + {0x71, 0x61, 0x51}, /* 162 (A2) */ + {0x71, 0x69, 0x51}, /* 163 (A3) */ + {0x71, 0x71, 0x51}, /* 164 (A4) */ + {0x69, 0x71, 0x51}, /* 165 (A5) */ + {0x61, 0x71, 0x51}, /* 166 (A6) */ + {0x59, 0x71, 0x51}, /* 167 (A7) */ + {0x51, 0x71, 0x51}, /* 168 (A8) */ + {0x51, 0x71, 0x59}, /* 169 (A9) */ + {0x51, 0x71, 0x61}, /* 170 (AA) */ + {0x51, 0x71, 0x69}, /* 171 (AB) */ + {0x51, 0x71, 0x71}, /* 172 (AC) */ + {0x51, 0x69, 0x71}, /* 173 (AD) */ + {0x51, 0x61, 0x71}, /* 174 (AE) */ + {0x51, 0x59, 0x71}, /* 175 (AF) */ + /* Low Intensity group - 72 colors in 1/3 saturation groups (B0H-C7H high) */ + {0x00, 0x00, 0x41}, /* 176 (B0) */ + {0x10, 0x00, 0x41}, /* 177 (B1) */ + {0x20, 0x00, 0x41}, /* 178 (B2) */ + {0x31, 0x00, 0x41}, /* 179 (B3) */ + {0x41, 0x00, 0x41}, /* 180 (B4) */ + {0x41, 0x00, 0x31}, /* 181 (B5) */ + {0x41, 0x00, 0x20}, /* 182 (B6) */ + {0x41, 0x00, 0x10}, /* 183 (B7) */ + {0x41, 0x00, 0x00}, /* 184 (B8) */ + {0x41, 0x10, 0x00}, /* 185 (B9) */ + {0x41, 0x20, 0x00}, /* 186 (BA) */ + {0x41, 0x31, 0x00}, /* 187 (BB) */ + {0x41, 0x41, 0x00}, /* 188 (BC) */ + {0x31, 0x41, 0x00}, /* 189 (BD) */ + {0x20, 0x41, 0x00}, /* 190 (BE) */ + {0x10, 0x41, 0x00}, /* 191 (BF) */ + {0x00, 0x41, 0x00}, /* 192 (C0) */ + {0x00, 0x41, 0x10}, /* 193 (C1) */ + {0x00, 0x41, 0x20}, /* 194 (C2) */ + {0x00, 0x41, 0x31}, /* 195 (C3) */ + {0x00, 0x41, 0x41}, /* 196 (C4) */ + {0x00, 0x31, 0x41}, /* 197 (C5) */ + {0x00, 0x20, 0x41}, /* 198 (C6) */ + {0x00, 0x10, 0x41}, /* 199 (C7) */ + /* Low Intensity group - 72 colors in 2/3 saturation groups (C8H-DFH moderate) */ + {0x20, 0x20, 0x41}, /* 200 (C8) */ + {0x28, 0x20, 0x41}, /* 201 (C9) */ + {0x31, 0x20, 0x41}, /* 202 (CA) */ + {0x39, 0x20, 0x41}, /* 203 (CB) */ + {0x41, 0x20, 0x41}, /* 204 (CC) */ + {0x41, 0x20, 0x39}, /* 205 (CD) */ + {0x41, 0x20, 0x31}, /* 206 (CE) */ + {0x41, 0x20, 0x28}, /* 207 (CF) */ + {0x41, 0x20, 0x20}, /* 208 (D0) */ + {0x41, 0x28, 0x20}, /* 209 (D1) */ + {0x41, 0x31, 0x20}, /* 210 (D2) */ + {0x41, 0x39, 0x20}, /* 211 (D3) */ + {0x41, 0x41, 0x20}, /* 212 (D4) */ + {0x39, 0x41, 0x20}, /* 213 (D5) */ + {0x31, 0x41, 0x20}, /* 214 (D6) */ + {0x28, 0x41, 0x20}, /* 215 (D7) */ + {0x20, 0x41, 0x20}, /* 216 (D8) */ + {0x20, 0x41, 0x28}, /* 217 (D9) */ + {0x20, 0x41, 0x31}, /* 218 (DA) */ + {0x20, 0x41, 0x39}, /* 219 (DB) */ + {0x20, 0x41, 0x41}, /* 220 (DC) */ + {0x20, 0x39, 0x41}, /* 221 (DD) */ + {0x20, 0x31, 0x41}, /* 222 (DE) */ + {0x20, 0x28, 0x41}, /* 223 (DF) */ + /* Low Intensity group - 72 colors in 3/3 saturation groups (E0H-F7H low) */ + {0x2D, 0x2D, 0x41}, /* 223 (E0) */ + {0x31, 0x2D, 0x41}, /* 224 (E1) */ + {0x35, 0x2D, 0x41}, /* 225 (E2) */ + {0x3D, 0x2D, 0x41}, /* 226 (E3) */ + {0x41, 0x2D, 0x41}, /* 227 (E4) */ + {0x41, 0x2D, 0x3D}, /* 228 (E5) */ + {0x41, 0x2D, 0x35}, /* 229 (E6) */ + {0x41, 0x2D, 0x31}, /* 230 (E7) */ + {0x41, 0x2D, 0x2D}, /* 231 (E8) */ + {0x41, 0x31, 0x2D}, /* 232 (E9) */ + {0x41, 0x35, 0x2D}, /* 233 (EA) */ + {0x41, 0x3D, 0x2D}, /* 234 (EB) */ + {0x41, 0x41, 0x2D}, /* 235 (EC) */ + {0x3D, 0x41, 0x2D}, /* 236 (ED) */ + {0x35, 0x41, 0x2D}, /* 237 (EE) */ + {0x31, 0x41, 0x2D}, /* 238 (EF) */ + {0x2D, 0x41, 0x2D}, /* 239 (F0) */ + {0x2D, 0x41, 0x31}, /* 240 (F1) */ + {0x2D, 0x41, 0x35}, /* 241 (F2) */ + {0x2D, 0x41, 0x3D}, /* 242 (F3) */ + {0x2D, 0x41, 0x41}, /* 243 (F4) */ + {0x2D, 0x3D, 0x41}, /* 244 (F5) */ + {0x2D, 0x35, 0x41}, /* 245 (F6) */ + {0x2D, 0x31, 0x41}, /* 246 (F7) */ + /* Fill up remainder of palettes with black */ + {0,0,0} }; /* - * This palette is the dos default, converted from 18 bit color to 24. - * It contains only 64 entries of colors--all others are zeros. - * --Robert 'Admiral' Coeyman + * Mode 18 Default Color Register Setting + * DAC palette registers, converted from actual 18 bit color to 24. + * + * This palette is the dos default, converted from 18 bit color to 24. + * It contains only 64 entries of colors--all others are zeros. + * --Robert 'Admiral' Coeyman */ static PALETTEENTRY vga_def64_palette[256]={ /* red green blue */ @@ -220,7 +473,7 @@ static PALETTEENTRY vga_def64_palette[256]={ {0xaa, 0x00, 0x00}, /* 0x04 Red */ {0xaa, 0x00, 0xaa}, /* 0x05 Magenta */ {0xaa, 0xaa, 0x00}, /* 0x06 */ - {0xaa, 0xaa, 0xaa}, /* 0x07 Light Gray */ + {0xaa, 0xaa, 0xaa}, /* 0x07 White (Light Gray) */ {0x00, 0x00, 0x55}, /* 0x08 */ {0x00, 0x00, 0xff}, /* 0x09 */ {0x00, 0xaa, 0x55}, /* 0x0a */ @@ -1085,17 +1338,32 @@ static PALETTEENTRY paldat; void VGA_ioport_out( WORD port, BYTE val ) { switch (port) { + /* General Register - Feature Control */ + case 0x3ba: + FIXME("Unsupported VGA register: general register - feature control 0x%04x (value 0x%02x)\n", port, val); + break; + /* Attribute Controller - Address/Other */ case 0x3c0: if (vga_address_3c0) vga_index_3c0 = val; else - FIXME("Unsupported index, register 0x3c0: 0x%02x (value 0x%02x)\n", + FIXME("Unsupported index, VGA attribute controller register 0x3c0: 0x%02x (value 0x%02x)\n", vga_index_3c0, val); vga_address_3c0 = !vga_address_3c0; break; + /* General Register - Misc output */ + case 0x3c2: + FIXME("Unsupported VGA register: general register - misc output 0x%04x (value 0x%02x)\n", port, val); + break; + /* General Register - Video subsystem enable */ + case 0x3c3: + FIXME("Unsupported VGA register: general register - video subsystem enable 0x%04x (value 0x%02x)\n", port, val); + break; + /* Sequencer Register - Address */ case 0x3c4: vga_index_3c4 = val; break; + /* Sequencer Register - Other */ case 0x3c5: switch(vga_index_3c4) { case 0x04: /* Sequencer: Memory Mode Register */ @@ -1103,9 +1371,9 @@ void VGA_ioport_out( WORD port, BYTE val ) VGA_SetWindowStart((val & 8) ? 0 : -1); else FIXME("Memory Mode Register not supported in this mode.\n"); - break; + break; default: - FIXME("Unsupported index, register 0x3c4: 0x%02x (value 0x%02x)\n", + FIXME("Unsupported index, VGA sequencer register 0x3c4: 0x%02x (value 0x%02x)\n", vga_index_3c4, val); } break; @@ -1118,18 +1386,26 @@ void VGA_ioport_out( WORD port, BYTE val ) palcnt=0; } break; + /* Graphics Controller Register - Address */ case 0x3ce: vga_index_3ce = val; break; + /* Graphics Controller Register - Other */ case 0x3cf: - FIXME("Unsupported index, register 0x3ce: 0x%02x (value 0x%02x)\n", + FIXME("Unsupported index, VGA graphics controller register - other 0x3ce: 0x%02x (value 0x%02x)\n", vga_index_3ce, val); break; + /* CRT Controller Register - Index (MDA) */ + case 0x3b4: + /* CRT Controller Register - Index (CGA) */ case 0x3d4: vga_index_3d4 = val; break; + /* CRT Controller Register - Other (MDA) */ + case 0x3b5: + /* CRT Controller Register - Other (CGA) */ case 0x3d5: - FIXME("Unsupported index, register 0x3d4: 0x%02x (value 0x%02x)\n", + FIXME("Unsupported index, VGA crt controller register 0x3b4/0x3d4: 0x%02x (value 0x%02x)\n", vga_index_3d4, val); break; default: @@ -1142,10 +1418,22 @@ BYTE VGA_ioport_in( WORD port ) BYTE ret; switch (port) { + /* Attribute Controller - Other */ case 0x3c1: - FIXME("Unsupported index, register 0x3c0: 0x%02x\n", + FIXME("Unsupported index, VGA attribute controller register 0x3c0: 0x%02x\n", vga_index_3c0); return 0xff; + /* General Register - Input status 0 */ + case 0x3c2: + ret=0xff; + FIXME("Unsupported VGA register: general register - input status 0 0x%04x\n", port); + break; + /* General Register - Video subsystem enable */ + case 0x3c3: + ret=0xff; + FIXME("Unsupported VGA register: general register - video subsystem enable 0x%04x\n", port); + break; + /* Sequencer Register - Other */ case 0x3c5: switch(vga_index_3c4) { case 0x04: /* Sequencer: Memory Mode Register */ @@ -1155,15 +1443,36 @@ BYTE VGA_ioport_in( WORD port ) vga_index_3c4); return 0xff; } + /* General Register - DAC State */ + case 0x3c7: + ret=0xff; + FIXME("Unsupported VGA register: general register - DAC State 0x%04x\n", port); + break; + /* General Register - Feature control */ + case 0x3ca: + ret=0xff; + FIXME("Unsupported VGA register: general register - Feature control 0x%04x\n", port); + break; + /* General Register - Misc output */ + case 0x3cc: + ret=0xff; + FIXME("Unsupported VGA register: general register - Feature control 0x%04x\n", port); + break; + /* Graphics Controller Register - Other */ case 0x3cf: FIXME("Unsupported index, register 0x3ce: 0x%02x\n", vga_index_3ce); return 0xff; + /* CRT Controller Register - Other (MDA) */ + case 0x3b5: + /* CRT Controller Register - Other (CGA) */ case 0x3d5: - FIXME("Unsupported index, register 0x3d4: 0x%02x\n", + FIXME("Unsupported index, VGA crt controller register 0x3b4/0x3d4: 0x%02x\n", vga_index_3d4); return 0xff; - + /* General Register - Input status 1 (MDA) */ + case 0x3ba: + /* General Register - Input status 1 (CGA) */ case 0x3da: /* * Read from this register resets register 0x3c0 address flip-flop. diff --git a/dlls/winedos/vga.h b/dlls/winedos/vga.h index 36646a126ff..e417388d0d5 100644 --- a/dlls/winedos/vga.h +++ b/dlls/winedos/vga.h @@ -1,7 +1,7 @@ /* * VGA emulation * - * Copyright 1998 Ove KÅven + * Copyright 1998 Ove Kåven * * 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/winedos/xms.c b/dlls/winedos/xms.c index 89ab3d0db66..a19ea26d3b5 100644 --- a/dlls/winedos/xms.c +++ b/dlls/winedos/xms.c @@ -1,7 +1,7 @@ /* * XMS v2+ emulation * - * Copyright 1998 Ove Kåven + * Copyright 1998 Ove Kåven * * 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/mkagl.c b/dlls/wineps.drv/mkagl.c index 3606fe675a1..db789f1b37b 100644 --- a/dlls/wineps.drv/mkagl.c +++ b/dlls/wineps.drv/mkagl.c @@ -16,8 +16,12 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#include "config.h" + #include -#include +#ifdef HAVE_DIRENT_H +# include +#endif #include #include #include diff --git a/dlls/wineps.drv/truetype.c b/dlls/wineps.drv/truetype.c index 0254a75f482..b5269590da1 100644 --- a/dlls/wineps.drv/truetype.c +++ b/dlls/wineps.drv/truetype.c @@ -59,7 +59,9 @@ #endif #include -#include +#ifdef HAVE_DIRENT_H +# include +#endif #include #include #include diff --git a/dlls/wineps.drv/type1afm.c b/dlls/wineps.drv/type1afm.c index dd7e0ce3176..85aca4262be 100644 --- a/dlls/wineps.drv/type1afm.c +++ b/dlls/wineps.drv/type1afm.c @@ -32,7 +32,9 @@ #include #include #include -#include +#ifdef HAVE_DIRENT_H +# include +#endif #include #include #include /* INT_MIN */ diff --git a/dlls/winex11.drv/bitblt.c b/dlls/winex11.drv/bitblt.c index dcde11bae45..c740b1091eb 100644 --- a/dlls/winex11.drv/bitblt.c +++ b/dlls/winex11.drv/bitblt.c @@ -1541,8 +1541,7 @@ static BOOL X11DRV_ClientSideDIBCopy( X11DRV_PDEVICE *physDevSrc, INT xSrc, INT if (ySrc + height > srcDib.dsBm.bmHeight) height = srcDib.dsBm.bmHeight - ySrc; - if (GetRgnBox(physDevSrc->region, &unusedRect) == COMPLEXREGION || - GetRgnBox(physDevDst->region, &unusedRect) == COMPLEXREGION) + if (GetRgnBox(physDevDst->region, &unusedRect) == COMPLEXREGION) { /* for simple regions, the clipping was already done by BITBLT_GetVisRectangles */ FIXME("potential optimization: client-side complex region clipping\n"); diff --git a/dlls/winex11.drv/keyboard.c b/dlls/winex11.drv/keyboard.c index ea8a6a3d961..50475ceb4aa 100644 --- a/dlls/winex11.drv/keyboard.c +++ b/dlls/winex11.drv/keyboard.c @@ -6,7 +6,7 @@ * Copyright 1997 David Faure * Copyright 1998 Morten Welinder * Copyright 1998 Ulrich Weigand - * Copyright 1999 Ove Kåven + * Copyright 1999 Ove Kåven * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -1554,7 +1554,7 @@ X11DRV_KEYBOARD_DetectLayout( Display *display ) /* search for a match in layout table */ /* right now, we just find an absolute match for defined positions */ /* (undefined positions are ignored, so if it's defined as "3#" in */ - /* the table, it's okay that the X server has "3#£", for example) */ + /* the table, it's okay that the X server has "3#£", for example) */ /* however, the score will be higher for longer matches */ for (key = 0; key < MAIN_LEN; key++) { for (ok = 0, i = 0; (ok >= 0) && (i < syms); i++) { diff --git a/dlls/winex11.drv/mwm.h b/dlls/winex11.drv/mwm.h index cb17a4a7c77..b57155ad6a3 100644 --- a/dlls/winex11.drv/mwm.h +++ b/dlls/winex11.drv/mwm.h @@ -1,7 +1,7 @@ /* * Motif Window Manager definitions * - * Copyright 2001 Ove Kåven, TransGaming Technologies Inc. + * Copyright 2001 Ove Kåven, TransGaming Technologies Inc. * (these definitions were found in GTK+ 1.2, gdk/MwmUtil.h) * * This library is free software; you can redistribute it and/or diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index e5a40aafbf5..90ec95ad3bb 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -515,6 +515,7 @@ struct x11drv_thread_data Window grab_window; /* window that currently grabs the mouse */ HWND last_focus; /* last window that had focus */ XIM xim; /* input method */ + XFontSet font_set; /* international text drawing font set */ Window selection_wnd; /* window used for selection interactions */ }; diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c index fc9996af5c7..15694816876 100644 --- a/dlls/winex11.drv/x11drv_main.c +++ b/dlls/winex11.drv/x11drv_main.c @@ -562,6 +562,7 @@ static void thread_detach(void) X11DRV_ResetSelectionOwner(); wine_tsx11_lock(); if (data->xim) XCloseIM( data->xim ); + if (data->font_set) XFreeFontSet( data->display, data->font_set ); XCloseDisplay( data->display ); wine_tsx11_unlock(); HeapFree( GetProcessHeap(), 0, data ); diff --git a/dlls/winex11.drv/xim.c b/dlls/winex11.drv/xim.c index 5e413f0c2d0..7c3c9d17a7c 100644 --- a/dlls/winex11.drv/xim.c +++ b/dlls/winex11.drv/xim.c @@ -477,6 +477,26 @@ static BOOL open_xim( Display *display ) thread_data->xim = xim; + if ((ximStyle & (XIMPreeditNothing | XIMPreeditNone)) == 0 || + (ximStyle & (XIMStatusNothing | XIMStatusNone)) == 0) + { + char **list; + int count; + thread_data->font_set = XCreateFontSet(display, "fixed", + &list, &count, NULL); + TRACE("ximFontSet = %p\n", thread_data->font_set); + TRACE("list = %p, count = %d\n", list, count); + if (list != NULL) + { + int i; + for (i = 0; i < count; ++i) + TRACE("list[%d] = %s\n", i, list[i]); + XFreeStringList(list); + } + } + else + thread_data->font_set = NULL; + wine_tsx11_unlock(); IME_UpdateAssociation(NULL); wine_tsx11_lock(); @@ -518,6 +538,7 @@ XIC X11DRV_CreateIC(XIM xim, struct x11drv_win_data *data) XICCallback P_StartCB, P_DoneCB, P_DrawCB, P_CaretCB; LANGID langid = PRIMARYLANGID(LANGIDFROMLCID(GetThreadLocale())); Window win = data->whole_window; + XFontSet fontSet = x11drv_thread_data()->font_set; TRACE("xim = %p\n", xim); @@ -552,6 +573,7 @@ XIC X11DRV_CreateIC(XIM xim, struct x11drv_win_data *data) if ((ximStyle & (XIMPreeditNothing | XIMPreeditNone)) == 0) { preedit = XVaCreateNestedList(0, + XNFontSet, fontSet, XNSpotLocation, &spot, XNPreeditStartCallback, &P_StartCB, XNPreeditDoneCallback, &P_DoneCB, @@ -575,6 +597,7 @@ XIC X11DRV_CreateIC(XIM xim, struct x11drv_win_data *data) if ((ximStyle & (XIMStatusNothing | XIMStatusNone)) == 0) { status = XVaCreateNestedList(0, + XNFontSet, fontSet, NULL); TRACE("status = %p\n", status); } diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c index 8729df3835c..a3d04d9dbfc 100644 --- a/dlls/wininet/http.c +++ b/dlls/wininet/http.c @@ -59,6 +59,7 @@ #include "internet.h" #include "wine/debug.h" +#include "wine/exception.h" #include "wine/unicode.h" WINE_DEFAULT_DEBUG_CHANNEL(wininet); @@ -1020,12 +1021,20 @@ HINTERNET WINAPI HttpOpenRequestA(HINTERNET hHttpSession, types = lpszAcceptTypes; while (*types) { - /* find out how many there are */ - if (((ULONG_PTR)*types >> 16) && **types) + __TRY { - TRACE("accept type: %s\n", debugstr_a(*types)); - acceptTypesCount++; + /* find out how many there are */ + if (*types && **types) + { + TRACE("accept type: %s\n", debugstr_a(*types)); + acceptTypesCount++; + } + } + __EXCEPT_PAGE_FAULT + { + WARN("invalid accept type pointer\n"); } + __ENDTRY; types++; } szAcceptTypes = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR *) * (acceptTypesCount+1)); @@ -1035,20 +1044,26 @@ HINTERNET WINAPI HttpOpenRequestA(HINTERNET hHttpSession, types = lpszAcceptTypes; while (*types) { - if (((ULONG_PTR)*types >> 16) && **types) + __TRY { - len = MultiByteToWideChar(CP_ACP, 0, *types, -1, NULL, 0 ); - szAcceptTypes[acceptTypesCount] = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); - if (!szAcceptTypes[acceptTypesCount]) goto end; + if (*types && **types) + { + len = MultiByteToWideChar(CP_ACP, 0, *types, -1, NULL, 0 ); + szAcceptTypes[acceptTypesCount] = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); - MultiByteToWideChar(CP_ACP, 0, *types, -1, szAcceptTypes[acceptTypesCount], len); - acceptTypesCount++; + MultiByteToWideChar(CP_ACP, 0, *types, -1, szAcceptTypes[acceptTypesCount], len); + acceptTypesCount++; + } + } + __EXCEPT_PAGE_FAULT + { + /* ignore invalid pointer */ } + __ENDTRY; types++; } szAcceptTypes[acceptTypesCount] = NULL; } - else szAcceptTypes = 0; rc = HttpOpenRequestW(hHttpSession, szVerb, szObjectName, szVersion, szReferrer, diff --git a/dlls/wininet/internet.c b/dlls/wininet/internet.c index 277ea23422e..353b1566127 100644 --- a/dlls/wininet/internet.c +++ b/dlls/wininet/internet.c @@ -546,8 +546,10 @@ static DWORD APPINFO_QueryOption(WININETHANDLEHEADER *hdr, DWORD option, void *b if (ai->lpszProxyBypass) proxyBypassBytesRequired = (lstrlenW(ai->lpszProxyBypass) + 1) * sizeof(WCHAR); if (*size < sizeof(INTERNET_PROXY_INFOW) + proxyBytesRequired + proxyBypassBytesRequired) - return ERROR_INSUFFICIENT_BUFFER; - + { + *size = sizeof(INTERNET_PROXY_INFOW) + proxyBytesRequired + proxyBypassBytesRequired; + return ERROR_INSUFFICIENT_BUFFER; + } proxy = (LPWSTR)((LPBYTE)buffer + sizeof(INTERNET_PROXY_INFOW)); proxy_bypass = (LPWSTR)((LPBYTE)buffer + sizeof(INTERNET_PROXY_INFOW) + proxyBytesRequired); @@ -577,8 +579,10 @@ static DWORD APPINFO_QueryOption(WININETHANDLEHEADER *hdr, DWORD option, void *b proxyBypassBytesRequired = WideCharToMultiByte(CP_ACP, 0, ai->lpszProxyBypass, -1, NULL, 0, NULL, NULL); if (*size < sizeof(INTERNET_PROXY_INFOA) + proxyBytesRequired + proxyBypassBytesRequired) + { + *size = sizeof(INTERNET_PROXY_INFOA) + proxyBytesRequired + proxyBypassBytesRequired; return ERROR_INSUFFICIENT_BUFFER; - + } proxy = (LPSTR)((LPBYTE)buffer + sizeof(INTERNET_PROXY_INFOA)); proxy_bypass = (LPSTR)((LPBYTE)buffer + sizeof(INTERNET_PROXY_INFOA) + proxyBytesRequired); diff --git a/dlls/wininet/tests/http.c b/dlls/wininet/tests/http.c index e01ef20baac..1c686c891b9 100644 --- a/dlls/wininet/tests/http.c +++ b/dlls/wininet/tests/http.c @@ -1964,7 +1964,7 @@ static void test_user_agent_header(void) static void test_bogus_accept_types_array(void) { HINTERNET ses, con, req; - static const char *types[] = { (const char *)6240, "*/*", "%p", "", "*/*", NULL }; + static const char *types[] = { (const char *)6240, "*/*", "%p", "", (const char *)0xffffffff, "*/*", NULL }; DWORD size; char buffer[32]; BOOL ret; diff --git a/dlls/winmm/mmio.c b/dlls/winmm/mmio.c index 4bad745452e..a750bf263e6 100644 --- a/dlls/winmm/mmio.c +++ b/dlls/winmm/mmio.c @@ -2,7 +2,7 @@ * MMIO functions * * Copyright 1998 Andrew Taylor - * Copyright 1998 Ove Kåven + * Copyright 1998 Ove Kåven * Copyright 2000,2002 Eric Pouech * * This library is free software; you can redistribute it and/or @@ -667,10 +667,11 @@ HMMIO MMIO_Open(LPSTR szFileName, MMIOINFO* refmminfo, DWORD dwOpenFlags, refmminfo->wErrorRet = MMIO_SetBuffer(wm, refmminfo->pchBuffer, refmminfo->cchBuffer, 0); if (refmminfo->wErrorRet != MMSYSERR_NOERROR) goto error1; - if (wm->info.fccIOProc == FOURCC_MEM) - wm->bBufferLoaded = TRUE; } + if (wm->info.fccIOProc == FOURCC_MEM && !(wm->info.dwFlags & MMIO_ALLOCBUF)) + wm->bBufferLoaded = TRUE; + /* see mmioDosIOProc for that one */ wm->info.adwInfo[0] = refmminfo->adwInfo[0]; diff --git a/dlls/winscard/winscard.c b/dlls/winscard/winscard.c index 51d0adf917d..f390b7016ef 100644 --- a/dlls/winscard/winscard.c +++ b/dlls/winscard/winscard.c @@ -27,6 +27,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(winscard); static HMODULE WINSCARD_hModule; +static HANDLE g_startedEvent = NULL; const SCARD_IO_REQUEST g_rgSCardT0Pci = { SCARD_PROTOCOL_T0, 8 }; const SCARD_IO_REQUEST g_rgSCardT1Pci = { SCARD_PROTOCOL_T1, 8 }; @@ -43,15 +44,25 @@ BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { DisableThreadLibraryCalls(hinstDLL); WINSCARD_hModule = hinstDLL; + /* FIXME: for now, we act as if the pcsc daemon is always started */ + g_startedEvent = CreateEventA(NULL,TRUE,TRUE,NULL); break; } case DLL_PROCESS_DETACH: + { + CloseHandle(g_startedEvent); break; + } } return TRUE; } +HANDLE WINAPI SCardAccessStartedEvent(void) +{ + return g_startedEvent; +} + LONG WINAPI SCardAddReaderToGroupA(SCARDCONTEXT context, LPCSTR reader, LPCSTR group) { LONG retval; diff --git a/dlls/winscard/winscard.spec b/dlls/winscard/winscard.spec index 1610de4a99f..44d43abc99e 100644 --- a/dlls/winscard/winscard.spec +++ b/dlls/winscard/winscard.spec @@ -2,7 +2,7 @@ @ stub SCardAccessNewReaderEvent @ stub SCardReleaseAllEvents @ stub SCardReleaseNewReaderEvent -@ stub SCardAccessStartedEvent +@ stdcall SCardAccessStartedEvent() @ stdcall SCardAddReaderToGroupA(long str str) @ stdcall SCardAddReaderToGroupW(long wstr wstr) @ stub SCardBeginTransaction diff --git a/dlls/winspool.drv/tests/info.c b/dlls/winspool.drv/tests/info.c index e2fd9413e7b..d1f4dea60b8 100644 --- a/dlls/winspool.drv/tests/info.c +++ b/dlls/winspool.drv/tests/info.c @@ -342,7 +342,7 @@ static void test_AddMonitor(void) { /* The Test is deactivated, because when mi2a.pName is NULL, the subkey HKLM\System\CurrentControlSet\Control\Print\Monitors\C:\WINDOWS\SYSTEM - or HKLM\System\CurrentControlSet\Control\Print\Monitors\ì + or HKLM\System\CurrentControlSet\Control\Print\Monitors\ì is created on win9x and we do not want to hit this bug here. */ mi2a.pEnvironment = entry->env; diff --git a/dlls/winspool.drv/winspool.drv.spec b/dlls/winspool.drv/winspool.drv.spec index f5994b8dc1c..ce29a72d2dc 100644 --- a/dlls/winspool.drv/winspool.drv.spec +++ b/dlls/winspool.drv/winspool.drv.spec @@ -96,7 +96,7 @@ @ stub DevQueryPrint @ stdcall DeviceCapabilities(str str long ptr ptr) DeviceCapabilitiesA @ stdcall DeviceCapabilitiesA(str str long ptr ptr) -@ stdcall DeviceCapabilitiesW(wstr wstr long wstr ptr) +@ stdcall DeviceCapabilitiesW(wstr wstr long ptr ptr) @ stub DeviceMode @ stub DocumentEvent @ stdcall DocumentPropertiesA(long long ptr ptr ptr long) diff --git a/dlls/wintrust/asn.c b/dlls/wintrust/asn.c index 09285bc0161..cc877dc58be 100644 --- a/dlls/wintrust/asn.c +++ b/dlls/wintrust/asn.c @@ -50,6 +50,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(cryptasn); #endif #define ASN_BITSTRING (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x03) +#define ASN_BMPSTRING (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x1e) static BOOL CRYPT_EncodeLen(DWORD len, BYTE *pbEncoded, DWORD *pcbEncoded) { @@ -738,6 +739,203 @@ BOOL WINAPI WVTAsn1SpcIndirectDataContentEncode(DWORD dwCertEncodingType, return ret; } +static BOOL WINAPI CRYPT_AsnEncodeBMPString(DWORD dwCertEncodingType, + LPCSTR lpszStructType, const void *pvStructInfo, BYTE *pbEncoded, + DWORD *pcbEncoded) +{ + BOOL ret = TRUE; + LPCWSTR str = (LPCWSTR)pvStructInfo; + DWORD bytesNeeded, lenBytes, strLen; + + if (str) + strLen = lstrlenW(str); + else + strLen = 0; + CRYPT_EncodeLen(strLen * 2, NULL, &lenBytes); + bytesNeeded = 1 + lenBytes + strLen * 2; + if (!pbEncoded) + *pcbEncoded = bytesNeeded; + else if (*pcbEncoded < bytesNeeded) + { + *pcbEncoded = bytesNeeded; + SetLastError(ERROR_MORE_DATA); + ret = FALSE; + } + else + { + DWORD i; + + *pcbEncoded = bytesNeeded; + *pbEncoded++ = ASN_BMPSTRING; + CRYPT_EncodeLen(strLen * 2, pbEncoded, &lenBytes); + pbEncoded += lenBytes; + for (i = 0; i < strLen; i++) + { + *pbEncoded++ = (str[i] & 0xff00) >> 8; + *pbEncoded++ = str[i] & 0x00ff; + } + } + return ret; +} + +static BOOL WINAPI CRYPT_AsnEncodeInteger(DWORD dwCertEncodingType, + LPCSTR lpszStructType, const void *pvStructInfo, BYTE *pbEncoded, + DWORD *pcbEncoded) +{ + BOOL ret; + + __TRY + { + DWORD significantBytes, lenBytes, bytesNeeded; + BYTE padByte = 0; + BOOL pad = FALSE; + const CRYPT_INTEGER_BLOB *blob = + (const CRYPT_INTEGER_BLOB *)pvStructInfo; + + significantBytes = blob->cbData; + if (significantBytes) + { + if (blob->pbData[significantBytes - 1] & 0x80) + { + /* negative, lop off leading (little-endian) 0xffs */ + for (; significantBytes > 0 && + blob->pbData[significantBytes - 1] == 0xff; significantBytes--) + ; + if (blob->pbData[significantBytes - 1] < 0x80) + { + padByte = 0xff; + pad = TRUE; + } + } + else + { + /* positive, lop off leading (little-endian) zeroes */ + for (; significantBytes > 0 && + !blob->pbData[significantBytes - 1]; significantBytes--) + ; + if (significantBytes == 0) + significantBytes = 1; + if (blob->pbData[significantBytes - 1] > 0x7f) + { + padByte = 0; + pad = TRUE; + } + } + } + if (pad) + CRYPT_EncodeLen(significantBytes + 1, NULL, &lenBytes); + else + CRYPT_EncodeLen(significantBytes, NULL, &lenBytes); + bytesNeeded = 1 + lenBytes + significantBytes; + if (pad) + bytesNeeded++; + if (!pbEncoded) + { + *pcbEncoded = bytesNeeded; + ret = TRUE; + } + else if (*pcbEncoded < bytesNeeded) + { + *pcbEncoded = bytesNeeded; + SetLastError(ERROR_MORE_DATA); + ret = FALSE; + } + else + { + *pcbEncoded = bytesNeeded; + *pbEncoded++ = ASN_INTEGER; + if (pad) + { + CRYPT_EncodeLen(significantBytes + 1, pbEncoded, &lenBytes); + pbEncoded += lenBytes; + *pbEncoded++ = padByte; + } + else + { + CRYPT_EncodeLen(significantBytes, pbEncoded, &lenBytes); + pbEncoded += lenBytes; + } + for (; significantBytes > 0; significantBytes--) + *(pbEncoded++) = blob->pbData[significantBytes - 1]; + ret = TRUE; + } + } + __EXCEPT_PAGE_FAULT + { + SetLastError(STATUS_ACCESS_VIOLATION); + ret = FALSE; + } + __ENDTRY + return ret; +} + +BOOL WINAPI CRYPT_AsnEncodeInt(DWORD dwCertEncodingType, + LPCSTR lpszStructType, const void *pvStructInfo, BYTE *pbEncoded, + DWORD *pcbEncoded) +{ + CRYPT_INTEGER_BLOB blob = { sizeof(INT), (BYTE *)pvStructInfo }; + + return CRYPT_AsnEncodeInteger(dwCertEncodingType, X509_MULTI_BYTE_INTEGER, + &blob, pbEncoded, pcbEncoded); +} + +BOOL WINAPI WVTAsn1CatMemberInfoEncode(DWORD dwCertEncodingType, + LPCSTR lpszStructType, const void *pvStructInfo, BYTE *pbEncoded, + DWORD *pcbEncoded) +{ + BOOL ret = FALSE; + + TRACE("(0x%08x, %s, %p, %p, %p)\n", dwCertEncodingType, + debugstr_a(lpszStructType), pvStructInfo, pbEncoded, pcbEncoded); + + __TRY + { + const CAT_MEMBERINFO *info = (const CAT_MEMBERINFO *)pvStructInfo; + struct AsnEncodeSequenceItem items[] = { + { info->pwszSubjGuid, CRYPT_AsnEncodeBMPString, 0 }, + { &info->dwCertVersion, CRYPT_AsnEncodeInt, 0 }, + }; + + ret = CRYPT_AsnEncodeSequence(X509_ASN_ENCODING, + items, sizeof(items) / sizeof(items[0]), pbEncoded, pcbEncoded); + } + __EXCEPT_PAGE_FAULT + { + SetLastError(STATUS_ACCESS_VIOLATION); + } + __ENDTRY + return ret; +} + +BOOL WINAPI WVTAsn1CatNameValueEncode(DWORD dwCertEncodingType, + LPCSTR lpszStructType, const void *pvStructInfo, BYTE *pbEncoded, + DWORD *pcbEncoded) +{ + BOOL ret = FALSE; + + TRACE("(0x%08x, %s, %p, %p, %p)\n", dwCertEncodingType, + debugstr_a(lpszStructType), pvStructInfo, pbEncoded, pcbEncoded); + + __TRY + { + const CAT_NAMEVALUE *value = (const CAT_NAMEVALUE *)pvStructInfo; + struct AsnEncodeSequenceItem items[] = { + { value->pwszTag, CRYPT_AsnEncodeBMPString, 0 }, + { &value->fdwFlags, CRYPT_AsnEncodeInt, 0 }, + { &value->Value, CRYPT_AsnEncodeOctets, 0 }, + }; + + ret = CRYPT_AsnEncodeSequence(X509_ASN_ENCODING, + items, sizeof(items) / sizeof(items[0]), pbEncoded, pcbEncoded); + } + __EXCEPT_PAGE_FAULT + { + SetLastError(STATUS_ACCESS_VIOLATION); + } + __ENDTRY + return ret; +} + /* Gets the number of length bytes from the given (leading) length byte */ #define GET_LEN_BYTES(b) ((b) <= 0x7f ? 1 : 1 + ((b) & 0x7f)) @@ -1733,3 +1931,197 @@ BOOL WINAPI WVTAsn1SpcSpOpusInfoDecode(DWORD dwCertEncodingType, pvStructInfo, *pcbStructInfo); return FALSE; } + +static BOOL WINAPI CRYPT_AsnDecodeBMPString(DWORD dwCertEncodingType, + LPCSTR lpszStructType, const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags, + void *pvStructInfo, DWORD *pcbStructInfo) +{ + BOOL ret; + DWORD bytesNeeded, dataLen; + + if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen))) + { + BYTE lenBytes = GET_LEN_BYTES(pbEncoded[1]); + + bytesNeeded = dataLen + 2 + sizeof(LPWSTR); + if (!pvStructInfo) + *pcbStructInfo = bytesNeeded; + else if (*pcbStructInfo < bytesNeeded) + { + *pcbStructInfo = bytesNeeded; + SetLastError(ERROR_MORE_DATA); + ret = FALSE; + } + else + { + LPWSTR str; + DWORD i; + + *pcbStructInfo = bytesNeeded; + assert(pvStructInfo); + str = *(LPWSTR *)pvStructInfo; + for (i = 0; i < dataLen / 2; i++) + str[i] = (pbEncoded[1 + lenBytes + 2 * i] << 8) | + pbEncoded[1 + lenBytes + 2 * i + 1]; + /* Decoded string is always NULL-terminated */ + str[i] = '\0'; + } + } + return ret; +} + +static BOOL CRYPT_AsnDecodeInteger(const BYTE *pbEncoded, + DWORD cbEncoded, DWORD dwFlags, void *pvStructInfo, DWORD *pcbStructInfo) +{ + BOOL ret; + DWORD bytesNeeded, dataLen; + + if ((ret = CRYPT_GetLen(pbEncoded, cbEncoded, &dataLen))) + { + BYTE lenBytes = GET_LEN_BYTES(pbEncoded[1]); + + bytesNeeded = dataLen + sizeof(CRYPT_INTEGER_BLOB); + if (!pvStructInfo) + *pcbStructInfo = bytesNeeded; + else if (*pcbStructInfo < bytesNeeded) + { + *pcbStructInfo = bytesNeeded; + SetLastError(ERROR_MORE_DATA); + ret = FALSE; + } + else + { + CRYPT_INTEGER_BLOB *blob = (CRYPT_INTEGER_BLOB *)pvStructInfo; + + *pcbStructInfo = bytesNeeded; + blob->cbData = dataLen; + assert(blob->pbData); + if (blob->cbData) + { + DWORD i; + + for (i = 0; i < blob->cbData; i++) + { + blob->pbData[i] = *(pbEncoded + 1 + lenBytes + + dataLen - i - 1); + } + } + } + } + return ret; +} + +/* Ignores tag. Only allows integers 4 bytes or smaller in size. */ +static BOOL WINAPI CRYPT_AsnDecodeInt(DWORD dwCertEncodingType, + LPCSTR lpszStructType, const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags, + void *pvStructInfo, DWORD *pcbStructInfo) +{ + BOOL ret; + BYTE buf[sizeof(CRYPT_INTEGER_BLOB) + sizeof(int)]; + CRYPT_INTEGER_BLOB *blob = (CRYPT_INTEGER_BLOB *)buf; + DWORD size = sizeof(buf); + + blob->pbData = buf + sizeof(CRYPT_INTEGER_BLOB); + ret = CRYPT_AsnDecodeInteger(pbEncoded, cbEncoded, 0, buf, &size); + if (ret) + { + if (!pvStructInfo) + *pcbStructInfo = sizeof(int); + else if (*pcbStructInfo < sizeof(int)) + { + *pcbStructInfo = sizeof(int); + SetLastError(ERROR_MORE_DATA); + ret = FALSE; + } + else + { + int val, i; + + *pcbStructInfo = sizeof(int); + if (blob->pbData[blob->cbData - 1] & 0x80) + { + /* initialize to a negative value to sign-extend */ + val = -1; + } + else + val = 0; + for (i = 0; i < blob->cbData; i++) + { + val <<= 8; + val |= blob->pbData[blob->cbData - i - 1]; + } + memcpy(pvStructInfo, &val, sizeof(int)); + } + } + else if (GetLastError() == ERROR_MORE_DATA) + SetLastError(CRYPT_E_ASN1_LARGE); + return ret; +} + +BOOL WINAPI WVTAsn1CatMemberInfoDecode(DWORD dwCertEncodingType, + LPCSTR lpszStructType, const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags, + void *pvStructInfo, DWORD *pcbStructInfo) +{ + BOOL ret = FALSE; + + TRACE("%p, %d, %08x, %p, %d\n", pbEncoded, cbEncoded, dwFlags, + pvStructInfo, *pcbStructInfo); + + __TRY + { + struct AsnDecodeSequenceItem items[] = { + { ASN_BMPSTRING, offsetof(CAT_MEMBERINFO, pwszSubjGuid), + CRYPT_AsnDecodeBMPString, sizeof(LPWSTR), FALSE, TRUE, + offsetof(CAT_MEMBERINFO, pwszSubjGuid), 0 }, + { ASN_INTEGER, offsetof(CAT_MEMBERINFO, dwCertVersion), + CRYPT_AsnDecodeInt, sizeof(DWORD), + FALSE, FALSE, 0, 0 }, + }; + + ret = CRYPT_AsnDecodeSequence(dwCertEncodingType, items, + sizeof(items) / sizeof(items[0]), pbEncoded, cbEncoded, dwFlags, + pvStructInfo, pcbStructInfo, NULL); + } + __EXCEPT_PAGE_FAULT + { + SetLastError(STATUS_ACCESS_VIOLATION); + } + __ENDTRY + TRACE("returning %d\n", ret); + return ret; +} + +BOOL WINAPI WVTAsn1CatNameValueDecode(DWORD dwCertEncodingType, + LPCSTR lpszStructType, const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags, + void *pvStructInfo, DWORD *pcbStructInfo) +{ + BOOL ret = FALSE; + + TRACE("%p, %d, %08x, %p, %d\n", pbEncoded, cbEncoded, dwFlags, + pvStructInfo, *pcbStructInfo); + + __TRY + { + struct AsnDecodeSequenceItem items[] = { + { ASN_BMPSTRING, offsetof(CAT_NAMEVALUE, pwszTag), + CRYPT_AsnDecodeBMPString, sizeof(LPWSTR), FALSE, TRUE, + offsetof(CAT_NAMEVALUE, pwszTag), 0 }, + { ASN_INTEGER, offsetof(CAT_NAMEVALUE, fdwFlags), + CRYPT_AsnDecodeInt, sizeof(DWORD), FALSE, FALSE, 0, 0 }, + { ASN_OCTETSTRING, offsetof(CAT_NAMEVALUE, Value), + CRYPT_AsnDecodeOctets, sizeof(CRYPT_DER_BLOB), FALSE, TRUE, + offsetof(CAT_NAMEVALUE, Value.pbData), 0 }, + }; + + ret = CRYPT_AsnDecodeSequence(dwCertEncodingType, items, + sizeof(items) / sizeof(items[0]), pbEncoded, cbEncoded, dwFlags, + pvStructInfo, pcbStructInfo, NULL); + } + __EXCEPT_PAGE_FAULT + { + SetLastError(STATUS_ACCESS_VIOLATION); + } + __ENDTRY + TRACE("returning %d\n", ret); + return ret; +} diff --git a/dlls/wintrust/softpub.c b/dlls/wintrust/softpub.c index 6faaa1f1169..e0acf0340c7 100644 --- a/dlls/wintrust/softpub.c +++ b/dlls/wintrust/softpub.c @@ -128,7 +128,8 @@ static BOOL SOFTPUB_GetSIP(CRYPT_PROVIDER_DATA *data) /* Assumes data->u.pPDSip has been loaded, and data->u.pPDSip->pSip allocated. * Calls data->u.pPDSip->pSip->pfGet to construct data->hMsg. */ -static BOOL SOFTPUB_GetMessageFromFile(CRYPT_PROVIDER_DATA *data) +static BOOL SOFTPUB_GetMessageFromFile(CRYPT_PROVIDER_DATA *data, HANDLE file, + LPCWSTR filePath) { BOOL ret; LPBYTE buf = NULL; @@ -144,9 +145,8 @@ static BOOL SOFTPUB_GetMessageFromFile(CRYPT_PROVIDER_DATA *data) data->u.pPDSip->psSipSubjectInfo->cbSize = sizeof(SIP_SUBJECTINFO); data->u.pPDSip->psSipSubjectInfo->pgSubjectType = &data->u.pPDSip->gSubject; - data->u.pPDSip->psSipSubjectInfo->hFile = data->pWintrustData->u.pFile->hFile; - data->u.pPDSip->psSipSubjectInfo->pwsFileName = - data->pWintrustData->u.pFile->pcwszFilePath; + data->u.pPDSip->psSipSubjectInfo->hFile = file; + data->u.pPDSip->psSipSubjectInfo->pwsFileName = filePath; data->u.pPDSip->psSipSubjectInfo->hProv = data->hProv; ret = data->u.pPDSip->pSip->pfGet(data->u.pPDSip->psSipSubjectInfo, &data->dwEncoding, 0, &size, 0); @@ -249,85 +249,142 @@ error: return ret; } -HRESULT WINAPI SoftpubLoadMessage(CRYPT_PROVIDER_DATA *data) +static BOOL SOFTPUB_LoadCertMessage(CRYPT_PROVIDER_DATA *data) { BOOL ret; - TRACE("(%p)\n", data); - - if (!data->padwTrustStepErrors) - return S_FALSE; - - switch (data->pWintrustData->dwUnionChoice) + if (data->pWintrustData->u.pCert && + data->pWintrustData->u.pCert->cbStruct == sizeof(WINTRUST_CERT_INFO)) { - case WTD_CHOICE_CERT: - if (data->pWintrustData->u.pCert && - data->pWintrustData->u.pCert->cbStruct == sizeof(WINTRUST_CERT_INFO)) + if (data->psPfns) { - if (data->psPfns) + CRYPT_PROVIDER_SGNR signer = { sizeof(signer), { 0 } }; + DWORD i; + + /* Add a signer with nothing but the time to verify, so we can + * add a cert to it + */ + if (data->pWintrustData->u.pCert->psftVerifyAsOf) + data->sftSystemTime = signer.sftVerifyAsOf; + else { - CRYPT_PROVIDER_SGNR signer = { sizeof(signer), { 0 } }; - DWORD i; - - /* Add a signer with nothing but the time to verify, so we can - * add a cert to it - */ - if (data->pWintrustData->u.pCert->psftVerifyAsOf) - data->sftSystemTime = signer.sftVerifyAsOf; - else - { - SYSTEMTIME sysTime; + SYSTEMTIME sysTime; - GetSystemTime(&sysTime); - SystemTimeToFileTime(&sysTime, &signer.sftVerifyAsOf); - } - ret = data->psPfns->pfnAddSgnr2Chain(data, FALSE, 0, &signer); - if (!ret) - goto error; + GetSystemTime(&sysTime); + SystemTimeToFileTime(&sysTime, &signer.sftVerifyAsOf); + } + ret = data->psPfns->pfnAddSgnr2Chain(data, FALSE, 0, &signer); + if (ret) + { ret = data->psPfns->pfnAddCert2Chain(data, 0, FALSE, 0, data->pWintrustData->u.pCert->psCertContext); - if (!ret) - goto error; for (i = 0; ret && i < data->pWintrustData->u.pCert->chStores; i++) ret = data->psPfns->pfnAddStore2Chain(data, data->pWintrustData->u.pCert->pahStores[i]); } - else - { - /* Do nothing!? See the tests */ - ret = TRUE; - } } else { - SetLastError(ERROR_INVALID_PARAMETER); - ret = FALSE; + /* Do nothing!? See the tests */ + ret = TRUE; } + } + else + { + SetLastError(ERROR_INVALID_PARAMETER); + ret = FALSE; + } + return ret; +} + +static BOOL SOFTPUB_LoadFileMessage(CRYPT_PROVIDER_DATA *data) +{ + BOOL ret; + + if (!data->pWintrustData->u.pFile) + { + SetLastError(ERROR_INVALID_PARAMETER); + ret = FALSE; + goto error; + } + ret = SOFTPUB_OpenFile(data); + if (!ret) + goto error; + ret = SOFTPUB_GetFileSubject(data); + if (!ret) + goto error; + ret = SOFTPUB_GetSIP(data); + if (!ret) + goto error; + ret = SOFTPUB_GetMessageFromFile(data, data->pWintrustData->u.pFile->hFile, + data->pWintrustData->u.pFile->pcwszFilePath); + if (!ret) + goto error; + ret = SOFTPUB_CreateStoreFromMessage(data); + if (!ret) + goto error; + ret = SOFTPUB_DecodeInnerContent(data); +error: + return ret; +} + +static BOOL SOFTPUB_LoadCatalogMessage(CRYPT_PROVIDER_DATA *data) +{ + BOOL ret; + HANDLE catalog = INVALID_HANDLE_VALUE; + + if (!data->pWintrustData->u.pCatalog) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + catalog = CreateFileW(data->pWintrustData->u.pCatalog->pcwszCatalogFilePath, + GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, + NULL); + if (catalog == INVALID_HANDLE_VALUE) + return FALSE; + ret = CryptSIPRetrieveSubjectGuid( + data->pWintrustData->u.pCatalog->pcwszCatalogFilePath, catalog, + &data->u.pPDSip->gSubject); + if (!ret) + goto error; + ret = SOFTPUB_GetSIP(data); + if (!ret) + goto error; + ret = SOFTPUB_GetMessageFromFile(data, catalog, + data->pWintrustData->u.pCatalog->pcwszCatalogFilePath); + if (!ret) + goto error; + ret = SOFTPUB_CreateStoreFromMessage(data); + if (!ret) + goto error; + ret = SOFTPUB_DecodeInnerContent(data); + /* FIXME: this loads the catalog file, but doesn't validate the member. */ +error: + CloseHandle(catalog); + return ret; +} + +HRESULT WINAPI SoftpubLoadMessage(CRYPT_PROVIDER_DATA *data) +{ + BOOL ret; + + TRACE("(%p)\n", data); + + if (!data->padwTrustStepErrors) + return S_FALSE; + + switch (data->pWintrustData->dwUnionChoice) + { + case WTD_CHOICE_CERT: + ret = SOFTPUB_LoadCertMessage(data); break; case WTD_CHOICE_FILE: - if (!data->pWintrustData->u.pFile) - { - SetLastError(ERROR_INVALID_PARAMETER); - ret = FALSE; - goto error; - } - ret = SOFTPUB_OpenFile(data); - if (!ret) - goto error; - ret = SOFTPUB_GetFileSubject(data); - if (!ret) - goto error; - ret = SOFTPUB_GetSIP(data); - if (!ret) - goto error; - ret = SOFTPUB_GetMessageFromFile(data); - if (!ret) - goto error; - ret = SOFTPUB_CreateStoreFromMessage(data); - if (!ret) - goto error; - ret = SOFTPUB_DecodeInnerContent(data); + ret = SOFTPUB_LoadFileMessage(data); + break; + case WTD_CHOICE_CATALOG: + ret = SOFTPUB_LoadCatalogMessage(data); break; default: FIXME("unimplemented for %d\n", data->pWintrustData->dwUnionChoice); @@ -335,7 +392,6 @@ HRESULT WINAPI SoftpubLoadMessage(CRYPT_PROVIDER_DATA *data) ret = FALSE; } -error: if (!ret) data->padwTrustStepErrors[TRUSTERROR_STEP_FINAL_OBJPROV] = GetLastError(); diff --git a/dlls/wintrust/tests/asn.c b/dlls/wintrust/tests/asn.c index a3557e7c362..0f18c6de8a7 100644 --- a/dlls/wintrust/tests/asn.c +++ b/dlls/wintrust/tests/asn.c @@ -464,6 +464,263 @@ static void test_decodeSPCPEImage(void) } } +static WCHAR foo[] = { 'f','o','o',0 }; +static WCHAR guidStr[] = { '{','8','b','c','9','6','b','0','0','-', + '8','d','a','1','-','1','1','c','f','-','8','7','3','6','-','0','0', + 'a','a','0','0','a','4','8','5','e','b','}',0 }; + +static const BYTE emptyCatMemberInfo[] = { 0x30,0x05,0x1e,0x00,0x02,0x01,0x00 }; +static const BYTE catMemberInfoWithSillyGuid[] = { +0x30,0x0b,0x1e,0x06,0x00,0x66,0x00,0x6f,0x00,0x6f,0x02,0x01,0x00 }; +static const BYTE catMemberInfoWithGuid[] = { +0x30,0x51,0x1e,0x4c,0x00,0x7b,0x00,0x38,0x00,0x62,0x00,0x63,0x00,0x39,0x00,0x36, +0x00,0x62,0x00,0x30,0x00,0x30,0x00,0x2d,0x00,0x38,0x00,0x64,0x00,0x61,0x00,0x31, +0x00,0x2d,0x00,0x31,0x00,0x31,0x00,0x63,0x00,0x66,0x00,0x2d,0x00,0x38,0x00,0x37, +0x00,0x33,0x00,0x36,0x00,0x2d,0x00,0x30,0x00,0x30,0x00,0x61,0x00,0x61,0x00,0x30, +0x00,0x30,0x00,0x61,0x00,0x34,0x00,0x38,0x00,0x35,0x00,0x65,0x00,0x62,0x00,0x7d, +0x02,0x01,0x00 }; + +static void test_encodeCatMemberInfo(void) +{ + CAT_MEMBERINFO info; + BOOL ret; + DWORD size = 0; + LPBYTE buf; + + memset(&info, 0, sizeof(info)); + + if (!pCryptEncodeObjectEx) + { + skip("CryptEncodeObjectEx() is not available. Skipping the encodeCatMemberInfo tests\n"); + return; + } + + ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, CAT_MEMBERINFO_STRUCT, + &info, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size); + ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError()); + if (ret) + { + ok(size == sizeof(emptyCatMemberInfo), "Unexpected size %d\n", size); + ok(!memcmp(buf, emptyCatMemberInfo, sizeof(emptyCatMemberInfo)), + "Unexpected value\n"); + LocalFree(buf); + } + info.pwszSubjGuid = foo; + ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, CAT_MEMBERINFO_STRUCT, + (LPBYTE)&info, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size); + ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError()); + if (ret) + { + ok(size == sizeof(catMemberInfoWithSillyGuid), "Unexpected size %d\n", + size); + ok(!memcmp(buf, catMemberInfoWithSillyGuid, + sizeof(catMemberInfoWithSillyGuid)), "Unexpected value\n"); + LocalFree(buf); + } + info.pwszSubjGuid = guidStr; + ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, CAT_MEMBERINFO_STRUCT, + (LPBYTE)&info, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size); + ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError()); + if (ret) + { + ok(size == sizeof(catMemberInfoWithGuid), "Unexpected size %d\n", + size); + ok(!memcmp(buf, catMemberInfoWithGuid, sizeof(catMemberInfoWithGuid)), + "Unexpected value\n"); + LocalFree(buf); + } +} + +static void test_decodeCatMemberInfo(void) +{ + BOOL ret; + LPBYTE buf; + DWORD size; + CAT_MEMBERINFO *info; + + if (!pCryptDecodeObjectEx) + { + skip("CryptDecodeObjectEx() is not available. Skipping the decodeCatMemberInfo tests\n"); + return; + } + + ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, CAT_MEMBERINFO_STRUCT, + emptyCatMemberInfo, sizeof(emptyCatMemberInfo), + CRYPT_DECODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); + ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError()); + if (ret) + { + info = (CAT_MEMBERINFO *)buf; + ok(!info->pwszSubjGuid || !info->pwszSubjGuid[0], + "expected empty pwszSubjGuid\n"); + ok(info->dwCertVersion == 0, "expected dwCertVersion == 0, got %d\n", + info->dwCertVersion); + LocalFree(buf); + } + ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, CAT_MEMBERINFO_STRUCT, + catMemberInfoWithSillyGuid, sizeof(catMemberInfoWithSillyGuid), + CRYPT_DECODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); + ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError()); + if (ret) + { + info = (CAT_MEMBERINFO *)buf; + ok(info->pwszSubjGuid && !lstrcmpW(info->pwszSubjGuid, foo), + "unexpected pwszSubjGuid\n"); + ok(info->dwCertVersion == 0, "expected dwCertVersion == 0, got %d\n", + info->dwCertVersion); + LocalFree(buf); + } + ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, CAT_MEMBERINFO_STRUCT, + catMemberInfoWithGuid, sizeof(catMemberInfoWithGuid), + CRYPT_DECODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); + ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError()); + if (ret) + { + info = (CAT_MEMBERINFO *)buf; + ok(info->pwszSubjGuid && !lstrcmpW(info->pwszSubjGuid, guidStr), + "unexpected pwszSubjGuid\n"); + ok(info->dwCertVersion == 0, "expected dwCertVersion == 0, got %d\n", + info->dwCertVersion); + LocalFree(buf); + } +} + +static const BYTE emptyCatNameValue[] = { +0x30,0x07,0x1e,0x00,0x02,0x01,0x00,0x04,0x00 }; +static const BYTE catNameValueWithTag[] = { +0x30,0x0d,0x1e,0x06,0x00,0x66,0x00,0x6f,0x00,0x6f,0x02,0x01,0x00,0x04,0x00 }; +static const BYTE catNameValueWithFlags[] = { +0x30,0x0a,0x1e,0x00,0x02,0x04,0xf0,0x0d,0xd0,0x0d,0x04,0x00 }; +static const BYTE catNameValueWithValue[] = { +0x30,0x0b,0x1e,0x00,0x02,0x01,0x00,0x04,0x04,0x01,0x02,0x03,0x04 }; + +static BYTE aVal[] = { 1,2,3,4 }; + +static void test_encodeCatNameValue(void) +{ + static WCHAR foo[] = { 'f','o','o',0 }; + BOOL ret; + LPBYTE buf; + DWORD size; + CAT_NAMEVALUE value; + + memset(&value, 0, sizeof(value)); + ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, CAT_NAMEVALUE_STRUCT, + (LPBYTE)&value, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size); + ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError()); + if (ret) + { + ok(size == sizeof(emptyCatNameValue), "Unexpected size %d\n", size); + ok(!memcmp(buf, emptyCatNameValue, sizeof(emptyCatNameValue)), + "Unexpected value\n"); + LocalFree(buf); + } + value.pwszTag = foo; + ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, CAT_NAMEVALUE_STRUCT, + (LPBYTE)&value, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size); + ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError()); + if (ret) + { + ok(size == sizeof(catNameValueWithTag), "Unexpected size %d\n", size); + ok(!memcmp(buf, catNameValueWithTag, sizeof(catNameValueWithTag)), + "Unexpected value\n"); + LocalFree(buf); + } + value.pwszTag = NULL; + value.fdwFlags = 0xf00dd00d; + ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, CAT_NAMEVALUE_STRUCT, + (LPBYTE)&value, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size); + ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError()); + if (ret) + { + ok(size == sizeof(catNameValueWithFlags), "Unexpected size %d\n", size); + ok(!memcmp(buf, catNameValueWithFlags, sizeof(catNameValueWithFlags)), + "Unexpected value\n"); + LocalFree(buf); + } + value.fdwFlags = 0; + value.Value.cbData = sizeof(aVal); + value.Value.pbData = aVal; + ret = pCryptEncodeObjectEx(X509_ASN_ENCODING, CAT_NAMEVALUE_STRUCT, + (LPBYTE)&value, CRYPT_ENCODE_ALLOC_FLAG, NULL, &buf, &size); + ok(ret, "CryptEncodeObjectEx failed: %08x\n", GetLastError()); + if (ret) + { + ok(size == sizeof(catNameValueWithValue), "Unexpected size %d\n", size); + ok(!memcmp(buf, catNameValueWithValue, sizeof(catNameValueWithValue)), + "Unexpected value\n"); + LocalFree(buf); + } +} + +static void test_decodeCatNameValue(void) +{ + BOOL ret; + LPBYTE buf; + DWORD size; + CAT_NAMEVALUE *value; + + ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, CAT_NAMEVALUE_STRUCT, + emptyCatNameValue, sizeof(emptyCatNameValue), + CRYPT_DECODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); + ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError()); + if (ret) + { + value = (CAT_NAMEVALUE *)buf; + ok(!value->pwszTag || !value->pwszTag[0], "expected empty pwszTag\n"); + ok(value->fdwFlags == 0, "expected fdwFlags == 0, got %08x\n", + value->fdwFlags); + ok(value->Value.cbData == 0, "expected 0-length value, got %d\n", + value->Value.cbData); + LocalFree(buf); + } + ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, CAT_NAMEVALUE_STRUCT, + catNameValueWithTag, sizeof(catNameValueWithTag), + CRYPT_DECODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); + ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError()); + if (ret) + { + value = (CAT_NAMEVALUE *)buf; + ok(value->pwszTag && !lstrcmpW(value->pwszTag, foo), + "unexpected pwszTag\n"); + ok(value->fdwFlags == 0, "expected fdwFlags == 0, got %08x\n", + value->fdwFlags); + ok(value->Value.cbData == 0, "expected 0-length value, got %d\n", + value->Value.cbData); + LocalFree(buf); + } + ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, CAT_NAMEVALUE_STRUCT, + catNameValueWithFlags, sizeof(catNameValueWithFlags), + CRYPT_DECODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); + ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError()); + if (ret) + { + value = (CAT_NAMEVALUE *)buf; + ok(!value->pwszTag || !value->pwszTag[0], "expected empty pwszTag\n"); + ok(value->fdwFlags == 0xf00dd00d, + "expected fdwFlags == 0xf00dd00d, got %08x\n", value->fdwFlags); + ok(value->Value.cbData == 0, "expected 0-length value, got %d\n", + value->Value.cbData); + LocalFree(buf); + } + ret = pCryptDecodeObjectEx(X509_ASN_ENCODING, CAT_NAMEVALUE_STRUCT, + catNameValueWithValue, sizeof(catNameValueWithValue), + CRYPT_DECODE_ALLOC_FLAG, NULL, (BYTE *)&buf, &size); + ok(ret, "CryptDecodeObjectEx failed: %08x\n", GetLastError()); + if (ret) + { + value = (CAT_NAMEVALUE *)buf; + ok(!value->pwszTag || !value->pwszTag[0], "expected empty pwszTag\n"); + ok(value->fdwFlags == 0, "expected fdwFlags == 0, got %08x\n", + value->fdwFlags); + ok(value->Value.cbData == sizeof(aVal), "unexpected size %d\n", + value->Value.cbData); + ok(!memcmp(value->Value.pbData, aVal, value->Value.cbData), + "unexpected value\n"); + LocalFree(buf); + } +} + START_TEST(asn) { HMODULE hCrypt32 = LoadLibraryA("crypt32.dll"); @@ -474,6 +731,10 @@ START_TEST(asn) test_decodeSPCLink(); test_encodeSPCPEImage(); test_decodeSPCPEImage(); + test_encodeCatMemberInfo(); + test_decodeCatMemberInfo(); + test_encodeCatNameValue(); + test_decodeCatNameValue(); FreeLibrary(hCrypt32); } diff --git a/dlls/wintrust/wintrust.spec b/dlls/wintrust/wintrust.spec index a9d0857ea92..83d41db09ca 100644 --- a/dlls/wintrust/wintrust.spec +++ b/dlls/wintrust/wintrust.spec @@ -86,10 +86,10 @@ @ stub WTHelperIsInRootStore @ stub WTHelperOpenKnownStores @ stdcall WTHelperProvDataFromStateData(ptr) -@ stub WVTAsn1CatMemberInfoDecode -@ stub WVTAsn1CatMemberInfoEncode -@ stub WVTAsn1CatNameValueDecode -@ stub WVTAsn1CatNameValueEncode +@ stdcall WVTAsn1CatMemberInfoDecode(long str ptr long long ptr ptr) +@ stdcall WVTAsn1CatMemberInfoEncode(long str ptr ptr ptr) +@ stdcall WVTAsn1CatNameValueDecode(long str ptr long long ptr ptr) +@ stdcall WVTAsn1CatNameValueEncode(long str ptr ptr ptr) @ stub WVTAsn1SpcFinancialCriteriaInfoDecode @ stub WVTAsn1SpcFinancialCriteriaInfoEncode @ stdcall WVTAsn1SpcIndirectDataContentDecode(long str ptr long long ptr ptr) diff --git a/dlls/wldap32/add.c b/dlls/wldap32/add.c index 617fd8ce928..472ee21e8e4 100644 --- a/dlls/wldap32/add.c +++ b/dlls/wldap32/add.c @@ -244,8 +244,8 @@ ULONG CDECL ldap_add_extW( WLDAP32_LDAP *ld, PWCHAR dn, LDAPModW *attrs[], if (!clientctrlsU) goto exit; } - ret = ldap_add_ext( ld, dn ? dnU : "", attrs ? attrsU : nullattrs, serverctrlsU, - clientctrlsU, message ? (int *)message : &dummy ); + ret = map_error( ldap_add_ext( ld, dn ? dnU : "", attrs ? attrsU : nullattrs, serverctrlsU, + clientctrlsU, message ? (int *)message : &dummy )); exit: strfreeU( dnU ); @@ -361,8 +361,8 @@ ULONG CDECL ldap_add_ext_sW( WLDAP32_LDAP *ld, PWCHAR dn, LDAPModW *attrs[], if (!clientctrlsU) goto exit; } - ret = ldap_add_ext_s( ld, dn ? dnU : "", attrs ? attrsU : nullattrs, - serverctrlsU, clientctrlsU ); + ret = map_error( ldap_add_ext_s( ld, dn ? dnU : "", attrs ? attrsU : nullattrs, + serverctrlsU, clientctrlsU )); exit: strfreeU( dnU ); @@ -448,7 +448,7 @@ ULONG CDECL ldap_add_sW( WLDAP32_LDAP *ld, PWCHAR dn, LDAPModW *attrs[] ) if (!attrsU) goto exit; } - ret = ldap_add_ext_s( ld, dn ? dnU : "", attrs ? attrsU : nullattrs, NULL, NULL ); + ret = map_error( ldap_add_ext_s( ld, dn ? dnU : "", attrs ? attrsU : nullattrs, NULL, NULL )); exit: strfreeU( dnU ); diff --git a/dlls/wldap32/bind.c b/dlls/wldap32/bind.c index 790aafca3fb..dff649b5ecd 100644 --- a/dlls/wldap32/bind.c +++ b/dlls/wldap32/bind.c @@ -211,7 +211,7 @@ ULONG CDECL ldap_bind_sW( WLDAP32_LDAP *ld, PWCHAR dn, PWCHAR cred, ULONG method pwd.bv_val = credU; } - ret = ldap_sasl_bind_s( ld, dnU, LDAP_SASL_SIMPLE, &pwd, NULL, NULL, NULL ); + ret = map_error( ldap_sasl_bind_s( ld, dnU, LDAP_SASL_SIMPLE, &pwd, NULL, NULL, NULL )); exit: strfreeU( dnU ); @@ -328,8 +328,8 @@ ULONG CDECL ldap_sasl_bindW( WLDAP32_LDAP *ld, const PWCHAR dn, credU.bv_len = cred->bv_len; credU.bv_val = cred->bv_val; - ret = ldap_sasl_bind( ld, dnU, mechanismU, &credU, - serverctrlsU, clientctrlsU, message ); + ret = map_error( ldap_sasl_bind( ld, dnU, mechanismU, &credU, + serverctrlsU, clientctrlsU, message )); exit: strfreeU( dnU ); @@ -448,8 +448,8 @@ ULONG CDECL ldap_sasl_bind_sW( WLDAP32_LDAP *ld, const PWCHAR dn, credU.bv_len = cred->bv_len; credU.bv_val = cred->bv_val; - ret = ldap_sasl_bind_s( ld, dnU, mechanismU, &credU, - serverctrlsU, clientctrlsU, (struct berval **)serverdata ); + ret = map_error( ldap_sasl_bind_s( ld, dnU, mechanismU, &credU, + serverctrlsU, clientctrlsU, (struct berval **)serverdata )); exit: strfreeU( dnU ); @@ -633,7 +633,7 @@ ULONG CDECL ldap_simple_bind_sW( WLDAP32_LDAP *ld, PWCHAR dn, PWCHAR passwd ) pwd.bv_val = passwdU; } - ret = ldap_sasl_bind_s( ld, dnU, LDAP_SASL_SIMPLE, &pwd, NULL, NULL, NULL ); + ret = map_error( ldap_sasl_bind_s( ld, dnU, LDAP_SASL_SIMPLE, &pwd, NULL, NULL, NULL )); exit: strfreeU( dnU ); @@ -663,7 +663,7 @@ ULONG CDECL WLDAP32_ldap_unbind( WLDAP32_LDAP *ld ) TRACE( "(%p)\n", ld ); if (ld) - ret = ldap_unbind_ext( ld, NULL, NULL ); + ret = map_error( ldap_unbind_ext( ld, NULL, NULL )); else ret = WLDAP32_LDAP_PARAM_ERROR; @@ -691,7 +691,7 @@ ULONG CDECL WLDAP32_ldap_unbind_s( WLDAP32_LDAP *ld ) TRACE( "(%p)\n", ld ); if (ld) - ret = ldap_unbind_ext_s( ld, NULL, NULL ); + ret = map_error( ldap_unbind_ext_s( ld, NULL, NULL )); else ret = WLDAP32_LDAP_PARAM_ERROR; diff --git a/dlls/wldap32/compare.c b/dlls/wldap32/compare.c index bcd726a24b6..000b075ba91 100644 --- a/dlls/wldap32/compare.c +++ b/dlls/wldap32/compare.c @@ -268,8 +268,8 @@ ULONG CDECL ldap_compare_extW( WLDAP32_LDAP *ld, PWCHAR dn, PWCHAR attr, PWCHAR if (!clientctrlsU) goto exit; } - ret = ldap_compare_ext( ld, dn ? dnU : "", attrU, data ? (struct berval *)data : &val, - serverctrlsU, clientctrlsU, (int *)message ); + ret = map_error( ldap_compare_ext( ld, dn ? dnU : "", attrU, data ? (struct berval *)data : &val, + serverctrlsU, clientctrlsU, (int *)message )); exit: strfreeU( dnU ); @@ -404,9 +404,9 @@ ULONG CDECL ldap_compare_ext_sW( WLDAP32_LDAP *ld, PWCHAR dn, PWCHAR attr, PWCHA if (!clientctrlsU) goto exit; } - ret = ldap_compare_ext_s( ld, dn ? dnU : "", attr ? attrU : "", - data ? (struct berval *)data : &val, - serverctrlsU, clientctrlsU ); + ret = map_error( ldap_compare_ext_s( ld, dn ? dnU : "", attr ? attrU : "", + data ? (struct berval *)data : &val, + serverctrlsU, clientctrlsU )); exit: strfreeU( dnU ); @@ -506,7 +506,7 @@ ULONG CDECL ldap_compare_sW( WLDAP32_LDAP *ld, PWCHAR dn, PWCHAR attr, PWCHAR va val.bv_val = valueU; } - ret = ldap_compare_ext_s( ld, dn ? dnU : "", attr ? attrU : "", &val, NULL, NULL ); + ret = map_error( ldap_compare_ext_s( ld, dn ? dnU : "", attr ? attrU : "", &val, NULL, NULL )); exit: strfreeU( dnU ); diff --git a/dlls/wldap32/control.c b/dlls/wldap32/control.c index b9caf7c0634..b9d93555a61 100644 --- a/dlls/wldap32/control.c +++ b/dlls/wldap32/control.c @@ -189,7 +189,7 @@ ULONG CDECL ldap_create_sort_controlW( WLDAP32_LDAP *ld, PLDAPSortKeyW *sortkey, sortkeyU = sortkeyarrayWtoU( sortkey ); if (!sortkeyU) return WLDAP32_LDAP_NO_MEMORY; - ret = ldap_create_sort_control( ld, sortkeyU, critical, &controlU ); + ret = map_error( ldap_create_sort_control( ld, sortkeyU, critical, &controlU )); *control = controlUtoW( controlU ); if (!*control) ret = WLDAP32_LDAP_NO_MEMORY; @@ -263,9 +263,9 @@ INT CDECL ldap_create_vlv_controlW( WLDAP32_LDAP *ld, WLDAP32_LDAPVLVInfo *info, if (!ld || !control) return ~0UL; - ret = ldap_create_vlv_control( ld, (LDAPVLVInfo *)info, &controlU ); + ret = map_error( ldap_create_vlv_control( ld, (LDAPVLVInfo *)info, &controlU )); - if (ret == LDAP_SUCCESS) + if (ret == WLDAP32_LDAP_SUCCESS) { *control = controlUtoW( controlU ); if (!*control) ret = WLDAP32_LDAP_NO_MEMORY; diff --git a/dlls/wldap32/delete.c b/dlls/wldap32/delete.c index 043771e045c..af0484c5684 100644 --- a/dlls/wldap32/delete.c +++ b/dlls/wldap32/delete.c @@ -206,8 +206,8 @@ ULONG CDECL ldap_delete_extW( WLDAP32_LDAP *ld, PWCHAR dn, PLDAPControlW *server if (!clientctrlsU) goto exit; } - ret = ldap_delete_ext( ld, dn ? dnU : "", serverctrlsU, clientctrlsU, - message ? (int *)message : &dummy ); + ret = map_error( ldap_delete_ext( ld, dn ? dnU : "", serverctrlsU, clientctrlsU, + message ? (int *)message : &dummy )); exit: strfreeU( dnU ); @@ -305,7 +305,7 @@ ULONG CDECL ldap_delete_ext_sW( WLDAP32_LDAP *ld, PWCHAR dn, PLDAPControlW *serv if (!clientctrlsU) goto exit; } - ret = ldap_delete_ext_s( ld, dn ? dnU : "", serverctrlsU, clientctrlsU ); + ret = map_error( ldap_delete_ext_s( ld, dn ? dnU : "", serverctrlsU, clientctrlsU )); exit: strfreeU( dnU ); @@ -371,7 +371,7 @@ ULONG CDECL ldap_delete_sW( WLDAP32_LDAP *ld, PWCHAR dn ) if (!dnU) return WLDAP32_LDAP_NO_MEMORY; } - ret = ldap_delete_ext_s( ld, dn ? dnU : "", NULL, NULL ); + ret = map_error( ldap_delete_ext_s( ld, dn ? dnU : "", NULL, NULL )); strfreeU( dnU ); #endif diff --git a/dlls/wldap32/extended.c b/dlls/wldap32/extended.c index a3072130c59..821449f45eb 100644 --- a/dlls/wldap32/extended.c +++ b/dlls/wldap32/extended.c @@ -160,8 +160,8 @@ ULONG CDECL ldap_extended_operationW( WLDAP32_LDAP *ld, PWCHAR oid, struct WLDAP if (!clientctrlsU) goto exit; } - ret = ldap_extended_operation( ld, oid ? oidU : "", (struct berval *)data, - serverctrlsU, clientctrlsU, (int *)message ); + ret = map_error( ldap_extended_operation( ld, oid ? oidU : "", (struct berval *)data, + serverctrlsU, clientctrlsU, (int *)message )); exit: strfreeU( oidU ); @@ -277,8 +277,8 @@ ULONG CDECL ldap_extended_operation_sW( WLDAP32_LDAP *ld, PWCHAR oid, struct WLD if (!clientctrlsU) goto exit; } - ret = ldap_extended_operation_s( ld, oid ? oidU : "", (struct berval *)data, serverctrlsU, - clientctrlsU, &retoidU, (struct berval **)retdata ); + ret = map_error( ldap_extended_operation_s( ld, oid ? oidU : "", (struct berval *)data, serverctrlsU, + clientctrlsU, &retoidU, (struct berval **)retdata )); if (retoid && retoidU) { *retoid = strUtoW( retoidU ); diff --git a/dlls/wldap32/init.c b/dlls/wldap32/init.c index 5de7f6e8863..c7b11dea5fb 100644 --- a/dlls/wldap32/init.c +++ b/dlls/wldap32/init.c @@ -646,7 +646,7 @@ ULONG CDECL ldap_start_tls_sW( WLDAP32_LDAP *ld, PULONG retval, WLDAP32_LDAPMess if (!clientctrlsU) goto exit; } - ret = ldap_start_tls_s( ld, serverctrlsU, clientctrlsU ); + ret = map_error( ldap_start_tls_s( ld, serverctrlsU, clientctrlsU )); exit: controlarrayfreeU( serverctrlsU ); diff --git a/dlls/wldap32/misc.c b/dlls/wldap32/misc.c index 12f05d8eb7a..09e7995b0ef 100644 --- a/dlls/wldap32/misc.c +++ b/dlls/wldap32/misc.c @@ -60,7 +60,7 @@ ULONG CDECL WLDAP32_ldap_abandon( WLDAP32_LDAP *ld, ULONG msgid ) TRACE( "(%p, 0x%08x)\n", ld, msgid ); if (!ld) return ~0UL; - ret = ldap_abandon_ext( ld, msgid, NULL, NULL ); + ret = map_error( ldap_abandon_ext( ld, msgid, NULL, NULL )); #endif return ret; diff --git a/dlls/wldap32/modify.c b/dlls/wldap32/modify.c index 44dc1176c16..43c5c2e57ce 100644 --- a/dlls/wldap32/modify.c +++ b/dlls/wldap32/modify.c @@ -245,8 +245,8 @@ ULONG CDECL ldap_modify_extW( WLDAP32_LDAP *ld, PWCHAR dn, LDAPModW *mods[], if (!clientctrlsU) goto exit; } - ret = ldap_modify_ext( ld, dn ? dnU : "", mods ? modsU : nullmods, serverctrlsU, - clientctrlsU, message ? (int *)message : &dummy ); + ret = map_error( ldap_modify_ext( ld, dn ? dnU : "", mods ? modsU : nullmods, serverctrlsU, + clientctrlsU, message ? (int *)message : &dummy )); exit: strfreeU( dnU ); @@ -362,8 +362,8 @@ ULONG CDECL ldap_modify_ext_sW( WLDAP32_LDAP *ld, PWCHAR dn, LDAPModW *mods[], if (!clientctrlsU) goto exit; } - ret = ldap_modify_ext_s( ld, dn ? dnU : "", mods ? modsU : nullmods, - serverctrlsU, clientctrlsU ); + ret = map_error( ldap_modify_ext_s( ld, dn ? dnU : "", mods ? modsU : nullmods, + serverctrlsU, clientctrlsU )); exit: strfreeU( dnU ); @@ -449,7 +449,7 @@ ULONG CDECL ldap_modify_sW( WLDAP32_LDAP *ld, PWCHAR dn, LDAPModW *mods[] ) if (!modsU) goto exit; } - ret = ldap_modify_ext_s( ld, dn ? dnU : "", mods ? modsU : nullmods, NULL, NULL ); + ret = map_error( ldap_modify_ext_s( ld, dn ? dnU : "", mods ? modsU : nullmods, NULL, NULL )); exit: strfreeU( dnU ); diff --git a/dlls/wldap32/modrdn.c b/dlls/wldap32/modrdn.c index 7648be332fc..b64e8762b65 100644 --- a/dlls/wldap32/modrdn.c +++ b/dlls/wldap32/modrdn.c @@ -289,7 +289,7 @@ ULONG CDECL ldap_modrdn2_sW( WLDAP32_LDAP *ld, PWCHAR dn, PWCHAR newdn, INT dele newdnU = strWtoU( newdn ); if (!newdnU) goto exit; - ret = ldap_rename_s( ld, dn ? dnU : "", newdnU, NULL, delete, NULL, NULL ); + ret = map_error( ldap_rename_s( ld, dn ? dnU : "", newdnU, NULL, delete, NULL, NULL )); exit: strfreeU( dnU ); @@ -368,7 +368,7 @@ ULONG CDECL ldap_modrdn_sW( WLDAP32_LDAP *ld, PWCHAR dn, PWCHAR newdn ) newdnU = strWtoU( newdn ); if (!newdnU) goto exit; - ret = ldap_rename_s( ld, dn ? dnU : "", newdnU, NULL, 1, NULL, NULL ); + ret = map_error( ldap_rename_s( ld, dn ? dnU : "", newdnU, NULL, 1, NULL, NULL )); exit: strfreeU( dnU ); diff --git a/dlls/wldap32/option.c b/dlls/wldap32/option.c index dc0a9450992..713b3cace8b 100644 --- a/dlls/wldap32/option.c +++ b/dlls/wldap32/option.c @@ -206,7 +206,7 @@ ULONG CDECL ldap_get_optionW( WLDAP32_LDAP *ld, int option, void *value ) if (!featureU.ldapaif_name) return WLDAP32_LDAP_NO_MEMORY; - ret = ldap_get_option( ld, option, &featureU ); + ret = map_error( ldap_get_option( ld, option, &featureU )); featureW->ldapaif_version = featureU.ldapaif_version; strfreeU( featureU.ldapaif_name ); @@ -220,7 +220,7 @@ ULONG CDECL ldap_get_optionW( WLDAP32_LDAP *ld, int option, void *value ) memset( &infoU, 0, sizeof(LDAPAPIInfo) ); infoU.ldapai_info_version = infoW->ldapai_info_version; - ret = ldap_get_option( ld, option, &infoU ); + ret = map_error( ldap_get_option( ld, option, &infoU )); infoW->ldapai_api_version = infoU.ldapai_api_version; infoW->ldapai_protocol_version = infoU.ldapai_protocol_version; @@ -253,7 +253,7 @@ ULONG CDECL ldap_get_optionW( WLDAP32_LDAP *ld, int option, void *value ) case WLDAP32_LDAP_OPT_REFERRALS: case WLDAP32_LDAP_OPT_SIZELIMIT: case WLDAP32_LDAP_OPT_TIMELIMIT: - return ldap_get_option( ld, option, value ); + return map_error( ldap_get_option( ld, option, value )); case WLDAP32_LDAP_OPT_CACHE_ENABLE: case WLDAP32_LDAP_OPT_CACHE_FN_PTRS: @@ -433,7 +433,7 @@ ULONG CDECL ldap_set_optionW( WLDAP32_LDAP *ld, int option, void *value ) ctrlsU = controlarrayWtoU( (LDAPControlW **)value ); if (!ctrlsU) return WLDAP32_LDAP_NO_MEMORY; - ret = ldap_set_option( ld, option, ctrlsU ); + ret = map_error( ldap_set_option( ld, option, ctrlsU )); controlarrayfreeU( ctrlsU ); return ret; } @@ -444,7 +444,7 @@ ULONG CDECL ldap_set_optionW( WLDAP32_LDAP *ld, int option, void *value ) case WLDAP32_LDAP_OPT_REFERRALS: case WLDAP32_LDAP_OPT_SIZELIMIT: case WLDAP32_LDAP_OPT_TIMELIMIT: - return ldap_set_option( ld, option, value ); + return map_error( ldap_set_option( ld, option, value )); case WLDAP32_LDAP_OPT_CACHE_ENABLE: case WLDAP32_LDAP_OPT_CACHE_FN_PTRS: diff --git a/dlls/wldap32/parse.c b/dlls/wldap32/parse.c index c7aa32e3560..7d3826ac604 100644 --- a/dlls/wldap32/parse.c +++ b/dlls/wldap32/parse.c @@ -99,7 +99,7 @@ ULONG CDECL ldap_parse_extended_resultW( WLDAP32_LDAP *ld, WLDAP32_LDAPMessage * if (!ld) return WLDAP32_LDAP_PARAM_ERROR; if (!result) return WLDAP32_LDAP_NO_RESULTS_RETURNED; - ret = ldap_parse_extended_result( ld, result, &oidU, (struct berval **)data, free ); + ret = map_error( ldap_parse_extended_result( ld, result, &oidU, (struct berval **)data, free ) ); if (oid) { *oid = strUtoW( oidU ); @@ -164,7 +164,7 @@ ULONG CDECL ldap_parse_referenceW( WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *messag if (!ld) return ~0UL; - ret = ldap_parse_reference( ld, message, &referralsU, NULL, 0 ); + ret = map_error( ldap_parse_reference( ld, message, &referralsU, NULL, 0 )); *referrals = strarrayUtoW( referralsU ); ldap_memfree( referralsU ); @@ -249,8 +249,8 @@ ULONG CDECL ldap_parse_resultW( WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *result, if (!ld) return WLDAP32_LDAP_PARAM_ERROR; - ret = ldap_parse_result( ld, result, (int *)retcode, &matchedU, &errorU, - &referralsU, &serverctrlsU, free ); + ret = map_error( ldap_parse_result( ld, result, (int *)retcode, &matchedU, &errorU, + &referralsU, &serverctrlsU, free )); if (matched) *matched = strUtoW( matchedU ); if (error) *error = strUtoW( errorU ); @@ -264,7 +264,7 @@ ULONG CDECL ldap_parse_resultW( WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *result, ldap_controls_free( serverctrlsU ); #endif - return map_error( ret ); + return ret; } /*********************************************************************** @@ -470,5 +470,5 @@ INT CDECL ldap_parse_vlv_controlW( WLDAP32_LDAP *ld, PLDAPControlW *control, controlarrayfreeU( controlU ); #endif - return ret; + return map_error( ret ); } diff --git a/dlls/wldap32/rename.c b/dlls/wldap32/rename.c index 4fc9defe9b0..864a6af31ae 100644 --- a/dlls/wldap32/rename.c +++ b/dlls/wldap32/rename.c @@ -157,8 +157,8 @@ ULONG CDECL ldap_rename_extW( WLDAP32_LDAP *ld, PWCHAR dn, PWCHAR newrdn, if (!clientctrlsU) goto exit; } - ret = ldap_rename( ld, dn ? dnU : "", newrdn ? newrdnU : "", newparentU, - delete, serverctrlsU, clientctrlsU, (int *)message ); + ret = map_error( ldap_rename( ld, dn ? dnU : "", newrdn ? newrdnU : "", newparentU, + delete, serverctrlsU, clientctrlsU, (int *)message )); exit: strfreeU( dnU ); @@ -283,8 +283,8 @@ ULONG CDECL ldap_rename_ext_sW( WLDAP32_LDAP *ld, PWCHAR dn, PWCHAR newrdn, if (!clientctrlsU) goto exit; } - ret = ldap_rename_s( ld, dn ? dnU : "", newrdn ? newrdnU : "", newparentU, - delete, serverctrlsU, clientctrlsU ); + ret = map_error( ldap_rename_s( ld, dn ? dnU : "", newrdn ? newrdnU : "", newparentU, + delete, serverctrlsU, clientctrlsU )); exit: strfreeU( dnU ); diff --git a/dlls/wldap32/search.c b/dlls/wldap32/search.c index 9a59f3cadaa..5b296eb9952 100644 --- a/dlls/wldap32/search.c +++ b/dlls/wldap32/search.c @@ -277,8 +277,8 @@ ULONG CDECL ldap_search_extW( WLDAP32_LDAP *ld, PWCHAR base, ULONG scope, tv.tv_sec = timelimit; tv.tv_usec = 0; - ret = ldap_search_ext( ld, baseU, scope, filterU, attrsU, attrsonly, - serverctrlsU, clientctrlsU, &tv, sizelimit, (int *)message ); + ret = map_error( ldap_search_ext( ld, baseU, scope, filterU, attrsU, attrsonly, + serverctrlsU, clientctrlsU, &tv, sizelimit, (int *)message )); exit: strfreeU( baseU ); @@ -412,8 +412,9 @@ ULONG CDECL ldap_search_ext_sW( WLDAP32_LDAP *ld, PWCHAR base, ULONG scope, if (!clientctrlsU) goto exit; } - ret = ldap_search_ext_s( ld, baseU, scope, filterU, attrsU, attrsonly, - serverctrlsU, clientctrlsU, (struct timeval *)timeout, sizelimit, res ); + ret = map_error( ldap_search_ext_s( ld, baseU, scope, filterU, attrsU, attrsonly, + serverctrlsU, clientctrlsU, (struct timeval *)timeout, + sizelimit, res )); exit: strfreeU( baseU ); @@ -518,8 +519,8 @@ ULONG CDECL ldap_search_sW( WLDAP32_LDAP *ld, PWCHAR base, ULONG scope, PWCHAR f if (!attrsU) goto exit; } - ret = ldap_search_ext_s( ld, baseU, scope, filterU, attrsU, attrsonly, - NULL, NULL, NULL, 0, res ); + ret = map_error( ldap_search_ext_s( ld, baseU, scope, filterU, attrsU, attrsonly, + NULL, NULL, NULL, 0, res )); exit: strfreeU( baseU ); @@ -628,8 +629,8 @@ ULONG CDECL ldap_search_stW( WLDAP32_LDAP *ld, const PWCHAR base, ULONG scope, if (!attrsU) goto exit; } - ret = ldap_search_ext_s( ld, baseU, scope, filterU, attrsU, attrsonly, - NULL, NULL, (struct timeval *)timeout, 0, res ); + ret = map_error( ldap_search_ext_s( ld, baseU, scope, filterU, attrsU, attrsonly, + NULL, NULL, (struct timeval *)timeout, 0, res )); exit: strfreeU( baseU ); diff --git a/dlls/wldap32/tests/parse.c b/dlls/wldap32/tests/parse.c index bb55f401020..22390a55984 100644 --- a/dlls/wldap32/tests/parse.c +++ b/dlls/wldap32/tests/parse.c @@ -34,7 +34,7 @@ static void test_ldap_parse_sort_control( LDAP *ld ) LDAPMessage *res = NULL; struct l_timeval timeout; - key.sk_attrtype = (char *)"cn"; + key.sk_attrtype = (char *)"ou"; key.sk_matchruleoid = NULL; key.sk_reverseorder = FALSE; @@ -47,7 +47,13 @@ static void test_ldap_parse_sort_control( LDAP *ld ) ctrls[1] = NULL; timeout.tv_sec = 20; timeout.tv_usec = 0; - ret = ldap_search_ext_sA( ld, (char *)"", LDAP_SCOPE_SUBTREE, (char *)"(cn=Verisign*)", NULL, 0, ctrls, NULL, &timeout, 10, &res ); + ret = ldap_search_ext_sA( ld, (char *)"", LDAP_SCOPE_ONELEVEL, (char *)"(ou=*)", NULL, 0, ctrls, NULL, &timeout, 10, &res ); + if (ret == LDAP_SERVER_DOWN) + { + skip("test server can't be reached\n"); + ldap_control_free( sort ); + return; + } ok( !ret, "ldap_search_ext_sA failed 0x%x\n", ret ); ok( res != NULL, "expected res != NULL\n" ); @@ -79,7 +85,7 @@ START_TEST (parse) { LDAP *ld; - ld = ldap_initA((char *)"directory.verisign.com", 389 ); + ld = ldap_initA((char *)"ldap.itd.umich.edu", 389 ); ok( ld != NULL, "ldap_init failed\n" ); test_ldap_parse_sort_control( ld ); diff --git a/include/Makefile.in b/include/Makefile.in index 453d5286118..c70e6db0444 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -100,6 +100,7 @@ SRCDIR_INCLUDES = \ cierror.h \ clusapi.h \ commctrl.h \ + commctrl.rh \ commdlg.h \ compobj.h \ cor.h \ @@ -111,6 +112,7 @@ SRCDIR_INCLUDES = \ custcntl.h \ cvconst.h \ d3d.h \ + d3d10misc.h \ d3d8.h \ d3d8caps.h \ d3d8types.h \ diff --git a/include/commctrl.rh b/include/commctrl.rh new file mode 100644 index 00000000000..1f41cdbedd4 --- /dev/null +++ b/include/commctrl.rh @@ -0,0 +1,196 @@ +/* + * Copyright (C) 2008 Vijay Kiran Kamuju + * + * 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 + */ + +/* Header Control */ +#define HDS_HORZ 0x0000 +#define HDS_BUTTONS 0x0002 +#define HDS_HOTTRACK 0x0004 +#define HDS_HIDDEN 0x0008 +#define HDS_DRAGDROP 0x0040 +#define HDS_FULLDRAG 0x0080 +#define HDS_FILTERBAR 0x0100 +#define HDS_FLAT 0x0200 + +/* Rebar Control */ +#define RBS_TOOLTIPS 0x0100 +#define RBS_VARHEIGHT 0x0200 +#define RBS_BANDBORDERS 0x0400 +#define RBS_FIXEDORDER 0x0800 +#define RBS_REGISTERDROP 0x1000 +#define RBS_AUTOSIZE 0x2000 +#define RBS_VERTICALGRIPPER 0x4000 +#define RBS_DBLCLKTOGGLE 0x8000 + +/*Tool tips */ +#define TTS_ALWAYSTIP 0x01 +#define TTS_NOPREFIX 0x02 +#define TTS_NOANIMATE 0x10 +#define TTS_NOFADE 0x20 +#define TTS_BALLOON 0x40 +#define TTS_CLOSE 0x80 + +/* Statusbar Control */ +#define SBARS_SIZEGRIP 0x0100 +#define SBARS_TOOLTIPS 0x0800 +#define SBT_TOOLTIPS 0x0800 + +/* Toolbar Control */ +#define TBS_BOTTOM 0x0000 +#define TBS_HORZ 0x0000 +#define TBS_RIGHT 0x0000 +#define TBS_AUTOTICKS 0x0001 +#define TBS_VERT 0x0002 +#define TBS_LEFT 0x0004 +#define TBS_TOP 0x0004 +#define TBS_BOTH 0x0008 +#define TBS_NOTICKS 0x0010 +#define TBS_ENABLESELRANGE 0x0020 +#define TBS_FIXEDLENGTH 0x0040 +#define TBS_NOTHUMB 0x0080 +#define TBS_TOOLTIPS 0x0100 +#define TBS_REVERSED 0x0200 +#define TBS_DOWNISLEFT 0x0400 + +/* UpDown Control */ +#define UDS_WRAP 0x0001 +#define UDS_SETBUDDYINT 0x0002 +#define UDS_ALIGNRIGHT 0x0004 +#define UDS_ALIGNLEFT 0x0008 +#define UDS_AUTOBUDDY 0x0010 +#define UDS_ARROWKEYS 0x0020 +#define UDS_HORZ 0x0040 +#define UDS_NOTHOUSANDS 0x0080 +#define UDS_HOTTRACK 0x0100 + +/* Progressbar Control */ +#define PBS_SMOOTH 0x01 +#define PBS_VERTICAL 0x04 + +/* Common Control Styles */ +#define CCS_TOP 0x00000001L +#define CCS_NOMOVE 0x00000002L +#define CCS_BOTTOM 0x00000003L +#define CCS_NORESIZE 0x00000004L +#define CCS_NOPARENTALIGN 0x00000008L +#define CCS_ADJUSTABLE 0x00000020L +#define CCS_NODIVIDER 0x00000040L +#define CCS_VERT 0x00000080L +#define CCS_LEFT (CCS_VERT | CCS_TOP) +#define CCS_RIGHT (CCS_VERT | CCS_BOTTOM) +#define CCS_NOMOVEX (CCS_VERT | CCS_NOMOVEY) + +/* Listview Control */ +#define LVS_ALIGNTOP 0x0000 +#define LVS_ICON 0x0000 +#define LVS_REPORT 0x0001 +#define LVS_SMALLICON 0x0002 +#define LVS_LIST 0x0003 +#define LVS_TYPEMASK 0x0003 +#define LVS_SINGLESEL 0x0004 +#define LVS_SHOWSELALWAYS 0x0008 +#define LVS_SORTASCENDING 0x0010 +#define LVS_SORTDESCENDING 0x0020 +#define LVS_SHAREIMAGELISTS 0x0040 +#define LVS_NOLABELWRAP 0x0080 +#define LVS_AUTOARRANGE 0x0100 +#define LVS_EDITLABELS 0x0200 +#define LVS_OWNERDRAWFIXED 0x0400 +#define LVS_ALIGNLEFT 0x0800 +#define LVS_ALIGNMASK 0x0c00 +#define LVS_OWNERDATA 0x1000 +#define LVS_NOSCROLL 0x2000 +#define LVS_NOCOLUMNHEADER 0x4000 +#define LVS_NOSORTHEADER 0x8000 +#define LVS_TYPESTYLEMASK 0xfc00 + +/* Treeview Control */ +#define TVS_HASBUTTONS 0x0001 +#define TVS_HASLINES 0x0002 +#define TVS_LINESATROOT 0x0004 +#define TVS_EDITLABELS 0x0008 +#define TVS_DISABLEDRAGDROP 0x0010 +#define TVS_SHOWSELALWAYS 0x0020 +#define TVS_RTLREADING 0x0040 +#define TVS_NOTOOLTIPS 0x0080 +#define TVS_CHECKBOXES 0x0100 +#define TVS_TRACKSELECT 0x0200 +#define TVS_SINGLEEXPAND 0x0400 +#define TVS_INFOTIP 0x0800 +#define TVS_FULLROWSELECT 0x1000 +#define TVS_NOSCROLL 0x2000 +#define TVS_NONEVENHEIGHT 0x4000 +#define TVS_NOHSCROLL 0x8000 + +/* Tab Control */ +#define TCS_RIGHTJUSTIFY 0x0000 +#define TCS_SINGLELINE 0x0000 +#define TCS_TABS 0x0000 +#define TCS_SCROLLOPPOSITE 0x0001 +#define TCS_BOTTOM 0x0002 +#define TCS_RIGHT 0x0002 +#define TCS_MULTISELECT 0x0004 +#define TCS_FLATBUTTONS 0x0008 +#define TCS_FORCEICONLEFT 0x0010 +#define TCS_FORCELABELLEFT 0x0020 +#define TCS_HOTTRACK 0x0040 +#define TCS_VERTICAL 0x0080 +#define TCS_BUTTONS 0x0100 +#define TCS_MULTILINE 0x0200 +#define TCS_FIXEDWIDTH 0x0400 +#define TCS_RAGGEDRIGHT 0x0800 +#define TCS_FOCUSONBUTTONDOWN 0x1000 +#define TCS_OWNERDRAWFIXED 0x2000 +#define TCS_TOOLTIPS 0x4000 +#define TCS_FOCUSNEVER 0x8000 + +/* Animate Control */ +#define ACS_CENTER 0x0001 +#define ACS_TRANSPARENT 0x0002 +#define ACS_AUTOPLAY 0x0004 +#define ACS_TIMER 0x0008 + +/* Month Calender Control */ +#define MCS_DAYSTATE 0x0001 +#define MCS_MULTISELECT 0x0002 +#define MCS_WEEKNUMBERS 0x0004 +#define MCS_NOTODAYCIRCLE 0x0008 +#define MCS_NOTODAY 0x0010 + +/* Datetime Control */ +#define DTS_SHORTDATEFORMAT 0x0000 +#define DTS_UPDOWN 0x0001 +#define DTS_SHOWNONE 0x0002 +#define DTS_LONGDATEFORMAT 0x0004 +#define DTS_TIMEFORMAT 0x0009 +#define DTS_SHORTDATECENTURYFORMAT 0x000C +#define DTS_APPCANPARSE 0x0010 +#define DTS_RIGHTALIGN 0x0020 + +/* Pager Control */ +#define PGS_VERT 0x00000000 +#define PGS_HORZ 0x00000001 +#define PGS_AUTOSCROLL 0x00000002 +#define PGS_DRAGNDROP 0x00000004 + +/* Native Font Control */ +#define NFS_EDIT 0x0001 +#define NFS_STATIC 0x0002 +#define NFS_LISTCOMBO 0x0004 +#define NFS_BUTTON 0x0008 +#define NFS_ALL 0x0010 +#define NFS_USEFONTASSOC 0x0020 diff --git a/include/d3d10.idl b/include/d3d10.idl index 032063ffe8d..ad90edeb727 100644 --- a/include/d3d10.idl +++ b/include/d3d10.idl @@ -1533,7 +1533,7 @@ interface ID3D10Multithread : IUnknown BOOL GetMultithreadProtected(); } -/* TODO: Include "d310misc.h" as soon as it exists */ +cpp_quote("#include ") /* TODO: Include "d310effect.h" as soon as it exists */ /* TODO: Include "d310shader.h" as soon as it exists */ /* TODO: Include "d310sdklayers.h" as soon as it exists */ diff --git a/include/d3d10misc.h b/include/d3d10misc.h new file mode 100644 index 00000000000..58a6d26d434 --- /dev/null +++ b/include/d3d10misc.h @@ -0,0 +1,46 @@ +/* + * Copyright 2008 Henri Verbeet for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef __D3D10MISC_H__ +#define __D3D10MISC_H__ + +#include "d3d10.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum D3D10_DRIVER_TYPE { + D3D10_DRIVER_TYPE_HARDWARE = 0, + D3D10_DRIVER_TYPE_REFERENCE = 1, + D3D10_DRIVER_TYPE_NULL = 2, + D3D10_DRIVER_TYPE_SOFTWARE = 3, +} D3D10_DRIVER_TYPE; + +HRESULT WINAPI D3D10CreateDevice(IDXGIAdapter *adapter, D3D10_DRIVER_TYPE driver_type, + HMODULE swrast, UINT flags, UINT sdk_version, ID3D10Device **device); + +HRESULT WINAPI D3D10CreateDeviceAndSwapChain(IDXGIAdapter *adapter, D3D10_DRIVER_TYPE driver_type, + HMODULE swrast, UINT flags, UINT sdk_version, DXGI_SWAP_CHAIN_DESC *swapchain_desc, + IDXGISwapChain **swapchain, ID3D10Device **device); + +#ifdef __cplusplus +} +#endif + +#endif /* __D3D10MISC_H__ */ diff --git a/include/ddk/mountmgr.h b/include/ddk/mountmgr.h index db0f21c7126..f0e836f6e11 100644 --- a/include/ddk/mountmgr.h +++ b/include/ddk/mountmgr.h @@ -49,6 +49,23 @@ static const WCHAR MOUNTMGR_DOS_DEVICE_NAME[] = {'\\','\\','.','\\','M','o','u', #define IOCTL_MOUNTMGR_CHECK_UNPROCESSED_VOLUMES CTL_CODE(MOUNTMGRCONTROLTYPE, 10, METHOD_BUFFERED, FILE_READ_ACCESS) #define IOCTL_MOUNTMGR_VOLUME_ARRIVAL_NOTIFICATION CTL_CODE(MOUNTMGRCONTROLTYPE, 11, METHOD_BUFFERED, FILE_READ_ACCESS) +/* Wine extensions */ +#ifdef WINE_MOUNTMGR_EXTENSIONS + +#define IOCTL_MOUNTMGR_DEFINE_UNIX_DRIVE CTL_CODE(MOUNTMGRCONTROLTYPE, 32, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) +#define IOCTL_MOUNTMGR_QUERY_UNIX_DRIVE CTL_CODE(MOUNTMGRCONTROLTYPE, 33, METHOD_BUFFERED, FILE_READ_ACCESS) + +struct mountmgr_unix_drive +{ + ULONG size; + ULONG type; + WCHAR letter; + USHORT mount_point_offset; + USHORT device_offset; +}; + +#endif + typedef struct _MOUNTMGR_CREATE_POINT_INPUT { USHORT SymbolicLinkNameOffset; diff --git a/include/ddk/ntddcdvd.h b/include/ddk/ntddcdvd.h index c1fae47b668..53e164ff95a 100644 --- a/include/ddk/ntddcdvd.h +++ b/include/ddk/ntddcdvd.h @@ -136,10 +136,10 @@ typedef struct _DVD_LAYER_DESCRIPTOR UCHAR Reserved1 : 1; - /* 0:0.74 µm/track, 1:0.80 µm/track, 2:0.615 µm/track */ + /* 0:0.74 µm/track, 1:0.80 µm/track, 2:0.615 µm/track */ UCHAR TrackDensity : 4; - /* 0:0.267 µm/bit, 1:0.293 µm/bit, 2:0.409 to 0.435 µm/bit, 4:0.280 to 0.291 µm/bit, 8:0.353 µm/bit */ + /* 0:0.267 µm/bit, 1:0.293 µm/bit, 2:0.409 to 0.435 µm/bit, 4:0.280 to 0.291 µm/bit, 8:0.353 µm/bit */ UCHAR LinearDensity : 4; /* Must be either 0x30000:DVD-ROM or DVD-R/-RW or 0x31000:DVD-RAM or DVD+RW */ diff --git a/include/dxgi.idl b/include/dxgi.idl index e82c5be555f..1f0c25e7a52 100644 --- a/include/dxgi.idl +++ b/include/dxgi.idl @@ -18,6 +18,87 @@ import "dxgitype.idl"; +cpp_quote("#if 0") +typedef HANDLE HMONITOR; +typedef struct _LUID { + DWORD LowPart; + LONG HighPart; +} LUID, *PLUID; +cpp_quote("#endif") + +typedef UINT DXGI_USAGE; +const DXGI_USAGE DXGI_USAGE_SHADER_INPUT = 0x10L; +const DXGI_USAGE DXGI_USAGE_RENDER_TARGET_OUTPUT = 0x20L; +const DXGI_USAGE DXGI_USAGE_BACK_BUFFER = 0x40L; +const DXGI_USAGE DXGI_USAGE_SHARED = 0x80L; +const DXGI_USAGE DXGI_USAGE_READ_ONLY = 0x100L; + +typedef enum DXGI_SWAP_EFFECT { + DXGI_SWAP_EFFECT_DISCARD = 0, + DXGI_SWAP_EFFECT_SEQUENTIAL = 1, +} DXGI_SWAP_EFFECT; + +typedef enum DXGI_RESIDENCY { + DXGI_RESIDENCY_FULLY_RESIDENT = 1, + DXGI_RESIDENCY_RESIDENT_IN_SHARED_MEMORY = 2, + DXGI_RESIDENCY_EVICTED_TO_DISK = 3, +} DXGI_RESIDENCY; + +typedef struct DXGI_SURFACE_DESC { + UINT Width; + UINT Height; + DXGI_FORMAT Format; + DXGI_SAMPLE_DESC SampleDesc; +} DXGI_SURFACE_DESC; + +typedef struct DXGI_MAPPED_RECT { + INT Pitch; + BYTE *pBits; +} DXGI_MAPPED_RECT; + +typedef struct DXGI_OUTPUT_DESC { + WCHAR DeviceName[32]; + RECT DesktopCoordinates; + BOOL AttachedToDesktop; + DXGI_MODE_ROTATION Rotation; + HMONITOR Monitor; +} DXGI_OUTPUT_DESC; + +typedef struct DXGI_FRAME_STATISTICS { + UINT PresentCount; + UINT PresentRefreshCount; + UINT SyncRefreshCount; + LARGE_INTEGER SyncQPCTime; + LARGE_INTEGER SyncGPUTime; +} DXGI_FRAME_STATISTICS; + +typedef struct DXGI_ADAPTER_DESC { + WCHAR Description[128]; + UINT VendorId; + UINT DeviceId; + UINT SubSysId; + UINT Revision; + SIZE_T DedicatedVideoMemory; + SIZE_T DedicatedSystemMemory; + SIZE_T SharedSystemMemory; + LUID AdapterLuid; +} DXGI_ADAPTER_DESC; + +typedef struct DXGI_SWAP_CHAIN_DESC { + DXGI_MODE_DESC BufferDesc; + DXGI_SAMPLE_DESC SampleDesc; + DXGI_USAGE BufferUsage; + UINT BufferCount; + HWND OutputWindow; + BOOL Windowed; + DXGI_SWAP_EFFECT SwapEffect; + UINT Flags; +} DXGI_SWAP_CHAIN_DESC; + +typedef struct DXGI_SHARED_RESOURCE { + HANDLE Handle; +} DXGI_SHARED_RESOURCE; + [ object, local, @@ -36,7 +117,7 @@ interface IDXGIObject : IUnknown ); HRESULT GetPrivateData( [in] REFGUID guid, - [in, out] UINT data_size, + [in, out] UINT *data_size, [out] void *data ); HRESULT GetParent( @@ -57,3 +138,199 @@ interface IDXGIDeviceSubObject : IDXGIObject [out] void **device ); } + +[ + object, + local, + uuid(cafcb56c-6ac3-4889-bf47-9e23bbd260ec) +] +interface IDXGISurface : IDXGIDeviceSubObject +{ + HRESULT GetDesc( + [out] DXGI_SURFACE_DESC *desc + ); + HRESULT Map( + [out] DXGI_MAPPED_RECT *mapped_rect, + [in] UINT flags + ); + HRESULT Unmap( + ); +} + +[ + object, + local, + uuid(ae02eedb-c735-4690-8d52-5a8dc20213aa) +] +interface IDXGIOutput : IDXGIObject +{ + HRESULT GetDesc( + [out] DXGI_OUTPUT_DESC *desc + ); + HRESULT GetDisplayModeList( + [in] DXGI_FORMAT format, + [in] UINT flags, + [in, out] UINT *mode_count, + [out] DXGI_MODE_DESC *desc + ); + HRESULT FindClosestMatchingMode( + [in] const DXGI_MODE_DESC *mode, + [out] DXGI_MODE_DESC *closest_match, + [in] IUnknown *device + ); + HRESULT WaitForVBlank( + ); + HRESULT TakeOwnership( + [in] IUnknown *device, + [in] BOOL exclusive + ); + void ReleaseOwnership( + ); + HRESULT GetGammaControlCapabilities( + [out] DXGI_GAMMA_CONTROL_CAPABILITIES *gamma_caps + ); + HRESULT SetGammaControl( + [in] const DXGI_GAMMA_CONTROL *gamma_control + ); + HRESULT GetGammaControl( + [out] DXGI_GAMMA_CONTROL *gamma_control + ); + HRESULT SetDisplaySurface( + [in] IDXGISurface *surface + ); + HRESULT GetDisplaySurfaceData( + [in] IDXGISurface *surface + ); + HRESULT GetFrameStatistics( + [out] DXGI_FRAME_STATISTICS *stats + ); +} + +[ + object, + local, + uuid(2411e7e1-12ac-4ccf-bd14-9798e8534dc0) +] +interface IDXGIAdapter : IDXGIObject +{ + HRESULT EnumOutputs( + [in] UINT output_idx, + [in, out] IDXGIOutput **output + ); + HRESULT GetDesc( + [out] DXGI_ADAPTER_DESC *desc + ); + HRESULT CheckInterfaceSupport( + [in] REFGUID guid, + [out] LARGE_INTEGER *umd_version + ); +} + +[ + object, + local, + uuid(310d36a0-d2e7-4c0a-aa04-6a9d23b8886a) +] +interface IDXGISwapChain : IDXGIDeviceSubObject +{ + HRESULT Present( + [in] UINT sync_interval, + [in] UINT flags + ); + HRESULT GetBuffer( + [in] UINT buffer_idx, + [in] REFIID riid, + [in, out] void **surface + ); + HRESULT SetFullscreenState( + [in] BOOL fullscreen, + [in] IDXGIOutput *target + ); + HRESULT GetFullscreenState( + [out] BOOL *fullscreen, + [out] IDXGIOutput **target + ); + HRESULT GetDesc( + [out] DXGI_SWAP_CHAIN_DESC *desc + ); + HRESULT ResizeBuffers( + [in] UINT buffer_count, + [in] UINT width, + [in] UINT height, + [in] DXGI_FORMAT format, + [in] UINT flags + ); + HRESULT ResizeTarget( + [in] const DXGI_MODE_DESC *target_mode_desc + ); + HRESULT GetContainingOutput( + [out] IDXGIOutput **output + ); + HRESULT GetFrameStatistics( + [out] DXGI_FRAME_STATISTICS *stats + ); + HRESULT GetLastPresentCount( + [out] UINT *last_present_count + ); +} + +[ + object, + local, + uuid(7b7166ec-21c7-44ae-b21a-c9ae321ae369) +] +interface IDXGIFactory : IDXGIObject +{ + HRESULT EnumAdapters( + [in] UINT adapter_idx, + [out] IDXGIAdapter **adapter + ); + HRESULT MakeWindowAssociation( + [in] HWND window, + [in] UINT flags + ); + HRESULT GetWindowAssociation( + [in] HWND *window + ); + HRESULT CreateSwapChain( + [in] IUnknown *device, + [in] DXGI_SWAP_CHAIN_DESC *desc, + [out] IDXGISwapChain **swapchain + ); + HRESULT CreateSoftwareAdapter( + [in] HMODULE swrast, + [out] IDXGIAdapter **adapter + ); +} + +[local] HRESULT CreateDXGIFactory(REFIID riid, void **factory); + +[ + object, + local, + uuid(54ec77fa-1377-44e6-8c32-88fd5f44c84c) +] +interface IDXGIDevice : IDXGIObject +{ + HRESULT GetAdapter( + [out] IDXGIAdapter **adapter + ); + HRESULT CreateSurface( + [in] const DXGI_SURFACE_DESC *desc, + [in] UINT surface_count, + [in] DXGI_USAGE usage, + [in] const DXGI_SHARED_RESOURCE *shared_resource, + [out] IDXGISurface **surface + ); + HRESULT QueryResourceResidency( + [in] IUnknown *const *resources, + [out] DXGI_RESIDENCY *residency, + [in] UINT resource_count + ); + HRESULT SetGPUThreadPriority( + [in] INT priority + ); + HRESULT GetGPUThreadPriority( + [out] INT *priority + ); +} diff --git a/include/dxgitype.idl b/include/dxgitype.idl index 37bdfaa36d2..2bd961d69c7 100644 --- a/include/dxgitype.idl +++ b/include/dxgitype.idl @@ -115,3 +115,58 @@ typedef enum DXGI_FORMAT { DXGI_FORMAT_B8G8R8X8_UNORM = 88, DXGI_FORMAT_FORCE_UINT = 0xffffffff } DXGI_FORMAT; + +typedef enum DXGI_MODE_ROTATION { + DXGI_MODE_ROTATION_UNSPECIFIED = 0, + DXGI_MODE_ROTATION_IDENTITY = 1, + DXGI_MODE_ROTATION_ROTATE90 = 2, + DXGI_MODE_ROTATION_ROTATE180 = 3, + DXGI_MODE_ROTATION_ROTATE270 = 4, +} DXGI_MODE_ROTATION; + +typedef enum DXGI_MODE_SCANLINE_ORDER { + DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED = 0, + DXGI_MODE_SCANLINE_ORDER_PROGRESSIVE = 1, + DXGI_MODE_SCANLINE_ORDER_UPPER_FIELD_FIRST = 2, + DXGI_MODE_SCANLINE_ORDER_LOWER_FIELD_FIRST = 3, +} DXGI_MODE_SCANLINE_ORDER; + +typedef enum DXGI_MODE_SCALING { + DXGI_MODE_SCALING_UNSPECIFIED = 0, + DXGI_MODE_SCALING_CENTERED = 1, + DXGI_MODE_SCALING_STRETCHED = 2, +} DXGI_MODE_SCALING; + +typedef struct DXGI_RATIONAL { + UINT Numerator; + UINT Denominator; +} DXGI_RATIONAL; + +typedef struct DXGI_MODE_DESC { + UINT Width; + UINT Height; + DXGI_RATIONAL RefreshRate; + DXGI_FORMAT Format; + DXGI_MODE_SCANLINE_ORDER ScanlineOrdering; + DXGI_MODE_SCALING Scaling; +} DXGI_MODE_DESC; + +typedef struct DXGI_GAMMA_CONTROL_CAPABILITIES { + BOOL ScaleAndOffsetSupported; + float MaxConvertedValue; + float MinConvertedValue; + UINT NumGammaControlPoints; + float ControlPointPositions[1025]; +} DXGI_GAMMA_CONTROL_CAPABILITIES; + +typedef struct DXGI_RGB { + float Red; + float Green; + float Blue; +} DXGI_RGB; + +typedef struct DXGI_GAMMA_CONTROL { + DXGI_RGB Scale; + DXGI_RGB Offset; + DXGI_RGB GammaCurve[1025]; +} DXGI_GAMMA_CONTROL; diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index 8df65f4a5f9..4968792ec6e 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -208,6 +208,8 @@ GpStatus WINGDIPAPI GdipCreateTextureIA(GpImage*,GDIPCONST GpImageAttributes*, REAL,REAL,REAL,REAL,GpTexture**); GpStatus WINGDIPAPI GdipCreateTextureIAI(GpImage*,GDIPCONST GpImageAttributes*, INT,INT,INT,INT,GpTexture**); +GpStatus WINGDIPAPI GdipGetTextureWrapMode(GpTexture*, GpWrapMode*); +GpStatus WINGDIPAPI GdipSetTextureWrapMode(GpTexture*, GpWrapMode); GpStatus WINGDIPAPI GdipDeleteBrush(GpBrush*); GpStatus WINGDIPAPI GdipGetBrushType(GpBrush*,GpBrushType*); GpStatus WINGDIPAPI GdipGetLineGammaCorrection(GpLineGradient*,BOOL*); diff --git a/include/mediaobj.idl b/include/mediaobj.idl index a8700dbae91..401f3fccc07 100644 --- a/include/mediaobj.idl +++ b/include/mediaobj.idl @@ -1,6 +1,6 @@ /* * Copyright (C) 2002 Alexandre Julliard - * Copyright (C) 2004 Vincent Béron + * Copyright (C) 2004 Vincent Béron * * 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/include/mlang.idl b/include/mlang.idl index 2b236c75e66..6f00734f29c 100644 --- a/include/mlang.idl +++ b/include/mlang.idl @@ -36,7 +36,7 @@ interface IMLangCodePages : IUnknown { HRESULT GetCharCodePages( [in] WCHAR chSrc, - DWORD *pdwCodePages); + [out] DWORD *pdwCodePages); HRESULT GetStrCodePages( [in, size_is(cchSrc)] const WCHAR *pszSrc, [in] long cchSrc, diff --git a/include/shldisp.idl b/include/shldisp.idl index 28c2357bdd7..4e2d2fead3d 100644 --- a/include/shldisp.idl +++ b/include/shldisp.idl @@ -1,7 +1,7 @@ /* * COM interfaces for shell objects * - * Copyright (C) 2004 Maxime Bellengé + * Copyright (C) 2004 Maxime Bellengé * * 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/include/tom.idl b/include/tom.idl index 28a71a7cab4..669fbcf9e0c 100644 --- a/include/tom.idl +++ b/include/tom.idl @@ -32,8 +32,8 @@ typedef enum tagTomConstants tomApplyLater = 1, tomTrackParms = 2, tomCacheParms = 3, - tomBackward = 0xc00000001, - tomForward = 0x3ffffffff, + tomBackward = 0xc0000001, + tomForward = 0x3fffffff, tomMove = 0, tomExtend = 1, tomNoSelection = 0, @@ -161,21 +161,21 @@ typedef enum tagTomConstants tomText = 0x2, tomHTML = 0x3, tomWordDocument = 0x4, - tomBold = 0x800000001, - tomItalic = 0x800000002, - tomUnderline = 0x800000004, - tomStrikeout = 0x800000008, - tomProtected = 0x800000010, - tomLink = 0x800000020, - tomSmallCaps = 0x800000040, - tomAllCaps = 0x800000080, - tomHidden = 0x800000100, - tomOutline = 0x800000200, - tomShadow = 0x800000400, - tomEmboss = 0x800000800, - tomImprint = 0x800001000, - tomDisabled = 0x800002000, - tomRevised = 0x800004000, + tomBold = 0x80000001, + tomItalic = 0x80000002, + tomUnderline = 0x80000004, + tomStrikeout = 0x80000008, + tomProtected = 0x80000010, + tomLink = 0x80000020, + tomSmallCaps = 0x80000040, + tomAllCaps = 0x80000080, + tomHidden = 0x80000100, + tomOutline = 0x80000200, + tomShadow = 0x80000400, + tomEmboss = 0x80000800, + tomImprint = 0x80001000, + tomDisabled = 0x80002000, + tomRevised = 0x80004000, tomNormalCaret = 0, tomKoreanBlockCaret = 0x1, tomIncludeInset = 0x1, diff --git a/include/urlmon.idl b/include/urlmon.idl index 5ac78f27b7b..866f9a8a65d 100644 --- a/include/urlmon.idl +++ b/include/urlmon.idl @@ -1461,6 +1461,10 @@ cpp_quote("#define OInetCombineUrl CoInternetCombineUrl") cpp_quote("#define OInetCompareUrl CoInternetCompareUrl") cpp_quote("#define OInetGetSession CoInternetGetSession") +cpp_quote("BOOL WINAPI IsLoggingEnabledA(LPCSTR);") +cpp_quote("BOOL WINAPI IsLoggingEnabledW(LPCWSTR);") +cpp_quote("#define IsLoggingEnabled WINELIB_NAME_AW(IsLoggingEnabled)") + cpp_quote("#define MKSYS_URLMONIKER 6") cpp_quote("#define URL_MK_LEGACY 0") cpp_quote("#define URL_MK_UNIFORM 1") diff --git a/include/wincrypt.h b/include/wincrypt.h index fa40266b3c3..e6ce84a71db 100644 --- a/include/wincrypt.h +++ b/include/wincrypt.h @@ -860,10 +860,10 @@ typedef struct _CERT_TRUST_LIST_INFO { #define CERT_TRUST_IS_OFFLINE_REVOCATION 0x01000000 #define CERT_TRUST_NO_ISSUANCE_CHAIN_POLICY 0x02000000 -#define CERT_TRUST_IS_PARTIAL_CHAIN 0x00001000 -#define CERT_TRUST_CTL_IS_NOT_TIME_VALID 0x00002000 -#define CERT_TRUST_CTL_IS_NOT_SIGNATURE_VALID 0x00004000 -#define CERT_TRUST_CTL_IS_NOT_VALID_FOR_USAGE 0x00008000 +#define CERT_TRUST_IS_PARTIAL_CHAIN 0x00010000 +#define CERT_TRUST_CTL_IS_NOT_TIME_VALID 0x00020000 +#define CERT_TRUST_CTL_IS_NOT_SIGNATURE_VALID 0x00040000 +#define CERT_TRUST_CTL_IS_NOT_VALID_FOR_USAGE 0x00080000 #define CERT_TRUST_HAS_EXACT_MATCH_ISSUER 0x00000001 #define CERT_TRUST_HAS_KEY_MATCH_ISSUER 0x00000002 diff --git a/include/wine/server_protocol.h b/include/wine/server_protocol.h index 5ae51f652bc..7175ae7fd29 100644 --- a/include/wine/server_protocol.h +++ b/include/wine/server_protocol.h @@ -4042,6 +4042,19 @@ struct get_object_info_reply }; + +struct unlink_object_request +{ + struct request_header __header; + obj_handle_t handle; +}; +struct unlink_object_reply +{ + struct reply_header __header; +}; + + + struct get_token_impersonation_level_request { struct request_header __header; @@ -4516,6 +4529,7 @@ enum request REQ_open_symlink, REQ_query_symlink, REQ_get_object_info, + REQ_unlink_object, REQ_get_token_impersonation_level, REQ_allocate_locally_unique_id, REQ_create_device_manager, @@ -4757,6 +4771,7 @@ union generic_request struct open_symlink_request open_symlink_request; struct query_symlink_request query_symlink_request; struct get_object_info_request get_object_info_request; + struct unlink_object_request unlink_object_request; struct get_token_impersonation_level_request get_token_impersonation_level_request; struct allocate_locally_unique_id_request allocate_locally_unique_id_request; struct create_device_manager_request create_device_manager_request; @@ -4996,6 +5011,7 @@ union generic_reply struct open_symlink_reply open_symlink_reply; struct query_symlink_reply query_symlink_reply; struct get_object_info_reply get_object_info_reply; + struct unlink_object_reply unlink_object_reply; struct get_token_impersonation_level_reply get_token_impersonation_level_reply; struct allocate_locally_unique_id_reply allocate_locally_unique_id_reply; struct create_device_manager_reply create_device_manager_reply; @@ -5015,6 +5031,6 @@ union generic_reply struct set_window_layered_info_reply set_window_layered_info_reply; }; -#define SERVER_PROTOCOL_VERSION 342 +#define SERVER_PROTOCOL_VERSION 343 #endif /* __WINE_WINE_SERVER_PROTOCOL_H */ diff --git a/include/wine/wined3d_gl.h b/include/wine/wined3d_gl.h index 5e55a0d018f..25159b19be6 100644 --- a/include/wine/wined3d_gl.h +++ b/include/wine/wined3d_gl.h @@ -690,6 +690,7 @@ typedef void GLvoid; #define GL_UNSIGNED_INT_10_10_10_2 0x8036 #define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 #define GL_RESCALE_NORMAL 0x803A +#define GL_TEXTURE_BINDING_3D 0x806A #define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 #define GL_SINGLE_COLOR 0x81F9 #define GL_SEPARATE_SPECULAR_COLOR 0x81FA @@ -1853,6 +1854,16 @@ typedef void (WINE_GLAPI * PGLFNGLGENERATEMIPMAPEXTPROC)(GLenum target); #define GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA #endif typedef void (WINE_GLAPI * PGLFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); + +/* GL_EXT_framebuffer_multisample */ +#ifndef GL_EXT_framebuffer_multisample +#define GL_EXT_framebuffer_multisample 1 +#define GL_RENDERBUFFER_SAMPLES_EXT 0x8cab +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8d56 +#define GL_MAX_SAMPLES_EXT 0x8d57 +#endif +typedef void (WINE_GLAPI * PGLFNRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); + /* GL_EXT_secondary_color */ #ifndef GL_EXT_secondary_color #define GL_EXT_secondary_color 1 @@ -3335,6 +3346,7 @@ typedef enum _GL_SupportedExt { EXT_FOG_COORD, EXT_FRAMEBUFFER_OBJECT, EXT_FRAMEBUFFER_BLIT, + EXT_FRAMEBUFFER_MULTISAMPLE, EXT_PALETTED_TEXTURE, EXT_PIXEL_BUFFER_OBJECT, EXT_POINT_PARAMETERS, @@ -3498,6 +3510,8 @@ typedef enum _GL_SupportedExt { USE_GL_FUNC(PGLFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC, glGetFramebufferAttachmentParameterivEXT, EXT_FRAMEBUFFER_OBJECT, NULL )\ /* GL_EXT_framebuffer_blit */ \ USE_GL_FUNC(PGLFNGLBLITFRAMEBUFFEREXTPROC, glBlitFramebufferEXT, EXT_FRAMEBUFFER_BLIT, NULL )\ + /* GL_EXT_framebuffer_multisample */ \ + USE_GL_FUNC(PGLFNRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC, glRenderbufferStorageMultisampleEXT, EXT_FRAMEBUFFER_MULTISAMPLE, NULL )\ /* GL_EXT_paletted_texture */ \ USE_GL_FUNC(PGLFNGLCOLORTABLEEXTPROC, glColorTableEXT, EXT_PALETTED_TEXTURE, NULL )\ /* GL_EXT_point_parameters */ \ diff --git a/include/wine/wined3d_interface.h b/include/wine/wined3d_interface.h index 9a2912903d8..79c94bcfb01 100644 --- a/include/wine/wined3d_interface.h +++ b/include/wine/wined3d_interface.h @@ -4,7 +4,7 @@ * Copyright 2002-2003 The wine-d3d team * Copyright 2002-2003 Raphael Junqueira * Copyright 2005 Oliver Stieber - * Copyright 2006 Stefan Dösinger for CodeWeavers + * Copyright 2006 Stefan Dösinger for CodeWeavers * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -343,7 +343,7 @@ DECLARE_INTERFACE_(IWineD3D, IWineD3DBase) #endif /* Define the main WineD3D entrypoint */ -IWineD3D* WINAPI WineDirect3DCreate(UINT SDKVersion, UINT dxVersion, IUnknown *parent); +IWineD3D* WINAPI WineDirect3DCreate(UINT dxVersion, IUnknown *parent); /***************************************************************************** * IWineD3DDevice interface diff --git a/include/wine/wined3d_types.h b/include/wine/wined3d_types.h index 2e7d5d7f339..4ccbcabce6e 100644 --- a/include/wine/wined3d_types.h +++ b/include/wine/wined3d_types.h @@ -5,7 +5,7 @@ * Copyright 2002-2003 Jason Edmeades * Raphael Junqueira * Copyright 2005 Oliver Stieber - * Copyright 2006 Stefan Dösinger + * Copyright 2006 Stefan Dösinger * * 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/include/winresrc.h b/include/winresrc.h index 380525c7edb..688b922549f 100644 --- a/include/winresrc.h +++ b/include/winresrc.h @@ -36,7 +36,7 @@ #endif #include -/* FIXME: #include */ +#include /* FIXME: #include */ /* FIXME: #include */ #include diff --git a/include/winscard.h b/include/winscard.h index 8da8e7fdb30..825e26df447 100644 --- a/include/winscard.h +++ b/include/winscard.h @@ -129,7 +129,7 @@ LONG WINAPI SCardLocateCardsByATRW(SCARDCONTEXT,LPSCARD_ATRMASK,DWORD,LPS #define SCardLocateCardsByATR WINELIB_NAME_AW(SCardLocateCardsByATR) LONG WINAPI SCardReconnect(SCARDHANDLE,DWORD,DWORD,DWORD,LPDWORD); LONG WINAPI SCardReleaseContext(SCARDCONTEXT); -void WINAPI SCardReleaseStartedEvent(void); +void WINAPI SCardReleaseStartedEvent(HANDLE); LONG WINAPI SCardRemoveReaderFromGroupA(SCARDCONTEXT,LPCSTR,LPCSTR); LONG WINAPI SCardRemoveReaderFromGroupW(SCARDCONTEXT,LPCWSTR,LPCWSTR); #define SCardRemoveReaderFromGroup WINELIB_NAME_AW(SCardRemoveReaderFromGroup) diff --git a/libs/wpp/ppl.l b/libs/wpp/ppl.l index 3e84a2e405a..e71bf6ecf20 100644 --- a/libs/wpp/ppl.l +++ b/libs/wpp/ppl.l @@ -163,6 +163,16 @@ ul [uUlL]|[uUlL][lL]|[lL][uU]|[lL][lL][uU]|[uU][lL][lL]|[lL][uU][lL] #include #include #include +#include +#include + +#ifndef LLONG_MAX +# define LLONG_MAX ((long long)0x7fffffff << 32 | 0xffffffff) +# define LLONG_MIN (-LLONG_MAX - 1) +#endif +#ifndef ULLONG_MAX +# define ULLONG_MAX ((long long)0xffffffff << 32 | 0xffffffff) +#endif #ifndef HAVE_UNISTD_H #define YY_NO_UNISTD_H @@ -790,6 +800,7 @@ static int make_number(int radix, YYSTYPE *val, const char *str, int len) int is_ll = 0; int is_u = 0; char ext[4]; + long l; ext[3] = '\0'; ext[2] = toupper(str[len-1]); @@ -827,12 +838,18 @@ static int make_number(int radix, YYSTYPE *val, const char *str, int len) #ifdef HAVE_LONG_LONG if (is_u) { + errno = 0; val->ull = strtoull(str, NULL, radix); + if (val->ull == ULLONG_MAX && errno == ERANGE) + ppy_error("integer constant %s is too large\n", str); return tULONGLONG; } else { + errno = 0; val->sll = strtoll(str, NULL, radix); + if ((val->sll == LLONG_MIN || val->sll == LLONG_MAX) && errno == ERANGE) + ppy_error("integer constant %s is too large\n", str); return tSLONGLONG; } #else @@ -841,22 +858,38 @@ static int make_number(int radix, YYSTYPE *val, const char *str, int len) } else if(is_u && is_l) { + errno = 0; val->ulong = strtoul(str, NULL, radix); + if (val->ulong == ULONG_MAX && errno == ERANGE) + ppy_error("integer constant %s is too large\n", str); return tULONG; } else if(!is_u && is_l) { + errno = 0; val->slong = strtol(str, NULL, radix); + if ((val->slong == LONG_MIN || val->slong == LONG_MAX) && errno == ERANGE) + ppy_error("integer constant %s is too large\n", str); return tSLONG; } else if(is_u && !is_l) { - val->uint = (unsigned int)strtoul(str, NULL, radix); + unsigned long ul; + errno = 0; + ul = strtoul(str, NULL, radix); + if ((ul == ULONG_MAX && errno == ERANGE) || (ul > UINT_MAX)) + ppy_error("integer constant %s is too large\n", str); + val->uint = (unsigned int)ul; return tUINT; } /* Else it must be an int... */ - val->sint = (int)strtol(str, NULL, radix); + errno = 0; + l = strtol(str, NULL, radix); + if (((l == LONG_MIN || l == LONG_MAX) && errno == ERANGE) || + (l > INT_MAX) || (l < INT_MIN)) + ppy_error("integer constant %s is too large\n", str); + val->sint = (int)l; return tSINT; } diff --git a/loader/kthread.c b/loader/kthread.c index cc51cc06038..acfa10fe4a7 100644 --- a/loader/kthread.c +++ b/loader/kthread.c @@ -4,7 +4,7 @@ * We can't use pthreads directly, so why not let libcs * that want pthreads use Wine's own threading instead... * - * Copyright 1999 Ove Kåven + * Copyright 1999 Ove Kåven * Copyright 2003 Alexandre Julliard * * This library is free software; you can redistribute it and/or diff --git a/programs/msiexec/msiexec.c b/programs/msiexec/msiexec.c index 9f20b5b1634..7b00eb7776b 100644 --- a/programs/msiexec/msiexec.c +++ b/programs/msiexec/msiexec.c @@ -1,7 +1,7 @@ /* * msiexec.exe implementation * - * Copyright 2004 Vincent Béron + * Copyright 2004 Vincent Béron * Copyright 2005 Mike McCormack * * This library is free software; you can redistribute it and/or @@ -69,7 +69,7 @@ static const char UsageStr[] = " msiexec {/h|/?}\n" "NOTE: Product code on commandline unimplemented as of yet\n" "\n" -"Copyright 2004 Vincent Béron\n"; +"Copyright 2004 Vincent Béron\n"; static const WCHAR ActionAdmin[] = { 'A','C','T','I','O','N','=','A','D','M','I','N',0 }; @@ -388,9 +388,9 @@ enum chomp_state static int chomp( WCHAR *str ) { - enum chomp_state state = cs_whitespace; + enum chomp_state state = cs_token; WCHAR *p, *out; - int count = 0, ignore; + int count = 1, ignore; for( p = str, out = str; *p; p++ ) { diff --git a/programs/net/Pt.rc b/programs/net/Pt.rc new file mode 100644 index 00000000000..0efa8c2727b --- /dev/null +++ b/programs/net/Pt.rc @@ -0,0 +1,44 @@ +/* + * NET.EXE - Wine-compatible net program + * Portuguese language support + * + * Copyright (C) 2008 Ricardo Filipe + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +LANGUAGE LANG_PORTUGUESE, SUBLANG_NEUTRAL + +STRINGTABLE +{ + STRING_USAGE, "A sintaxe deste comando é:\n\nNET [ HELP | START | STOP | USE ]\n" + STRING_START_USAGE, "Especifique o nome do serviço para iniciar.\n" + STRING_STOP_USAGE, "Especifique o nome do serviço para parar.\n" + STRING_STOP_DEP, "A parar o serviço dependente: %s\n" + STRING_CANT_STOP, "Não foi possível parar o serviço %s\n" + STRING_NO_SCM, "Não foi possível entregar o handle ao controlador de serviços.\n" + STRING_NO_SVCHANDLE, "Não foi possível entregar o handle ao serviço.\n" + STRING_START_SVC, "O serviço %s está a iniciar.\n" + STRING_START_SVC_SUCCESS, "O serviço %s foi iniciado com sucesso.\n" + STRING_START_SVC_FAIL, "O serviço %s falhou ao iniciar.\n" + STRING_STOP_SVC, "O serviço %s está a parar.\n" + STRING_STOP_SVC_SUCCESS, "O serviço %s foi parado com sucesso.\n" + STRING_STOP_SVC_FAIL, "O serviço %s falhou a parar.\n" + STRING_HELP_USAGE, "A sintaxe deste comando é:\n\nNET HELP command\n -or-\nNET command /HELP\n\n"\ + " Os comandos disponíveis são:\n NET HELP NET START NET STOP NET USE\n" + STRING_NO_ENTRIES, "Não há entradas na lista.\n" + STRING_USE_HEADER, "\nEstado Local Remoto\n---------------------------------------------------------------\n" + STRING_USE_ENTRY, "%s %S %S Recursos disponíveis: %lu\n" +} diff --git a/programs/net/rsrc.rc b/programs/net/rsrc.rc index b6a62378731..231d7d90c22 100644 --- a/programs/net/rsrc.rc +++ b/programs/net/rsrc.rc @@ -30,5 +30,6 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL #include "Nl.rc" #include "No.rc" #include "Pl.rc" +#include "Pt.rc" #include "Ru.rc" #include "Si.rc" diff --git a/programs/oleview/Pt.rc b/programs/oleview/Pt.rc new file mode 100644 index 00000000000..9b3af4a0096 --- /dev/null +++ b/programs/oleview/Pt.rc @@ -0,0 +1,213 @@ +/* + * OleView (Pt.rc) + * Portuguese Language Support + * + * Copyright 2008 Ricardo Filipe + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +LANGUAGE LANG_PORTUGUESE, SUBLANG_NEUTRAL + +IDM_MENU MENU +{ + POPUP "&Ficheiro" + { + MENUITEM "&Juntar a ficheiro...", IDM_BIND + MENUITEM "&Ver TypeLib...", IDM_TYPELIB + MENUITEM SEPARATOR + MENUITEM "&Configuração do sistema...", IDM_SYSCONF + MENUITEM "&Iniciar Editor de Registo", IDM_REGEDIT + MENUITEM SEPARATOR + MENUITEM "&Sair", IDM_EXIT + } + POPUP "&Objecto" + { + POPUP "&CoCreateInstance Flag" + { + MENUITEM "CLSCTX_&INPROC_SERVER", IDM_FLAG_INSERV,CHECKED + MENUITEM "CLSCTX_INPROC_&HANDLER", IDM_FLAG_INHANDL + MENUITEM "CLSCTX_&LOCAL_SERVER", IDM_FLAG_LOCSERV,CHECKED + MENUITEM "CLSCTX_&REMOTE_SERVER", IDM_FLAG_REMSERV + } + MENUITEM SEPARATOR + MENUITEM "Ver &Informação de tipo", IDM_TYPEINFO, GRAYED + MENUITEM SEPARATOR + MENUITEM "Criar I&nstância", IDM_CREATEINST, GRAYED + MENUITEM "Criar In&stância Em...", IDM_CREATEINSTON, GRAYED + MENUITEM "Li&bertar Instância", IDM_RELEASEINST, GRAYED + MENUITEM SEPARATOR + MENUITEM "Copiar C&LSID para a Área de Transferência", IDM_COPYCLSID, GRAYED + MENUITEM "Copiar tag &HTML para a Área de Transferência", IDM_HTMLTAG, GRAYED + MENUITEM SEPARATOR + MENUITEM "&Ver...", IDM_VIEW, GRAYED + } + POPUP "&Ver" + { + MENUITEM "&Modo Experiente", IDM_EXPERT,CHECKED + MENUITEM SEPARATOR + MENUITEM "&Categorias de Componentes Escondidas", IDM_HIDDEN, GRAYED + MENUITEM SEPARATOR + MENUITEM "&Barra de Tarefas", IDM_TOOLBAR,CHECKED + MENUITEM "Barra de &Estado", IDM_STATUSBAR,CHECKED + MENUITEM SEPARATOR + MENUITEM "&Actualizar\tF5", IDM_REFRESH + } + POPUP "A&juda" + { + MENUITEM "&Sobre OleView", IDM_ABOUT + } +} + +IDM_TYPELIB MENU +{ + POPUP "&Ficheiro" + { + MENUITEM "&Guardar como...", IDM_SAVEAS + MENUITEM "&Fechar", IDM_CLOSE + } + POPUP "&Ver" + { + MENUITEM "&Agrupar por tipo", IDM_GROUP + MENUITEM SEPARATOR + MENUITEM "&Barra de Tarefas", IDM_TOOLBAR + MENUITEM "&Barra de &Estado", IDM_STATUSBAR,CHECKED + } +} + +STRINGTABLE +{ + IDS_APPNAME "OleView" + IDS_APPTITLE "OleView" + IDS_READY "Pronto" + IDS_ABOUT "OleView - Visualizador de Objectos OLE/COM" + IDS_ABOUTVER "versão 1.0" + IDS_TYPELIBTITLE "Visualizador ITypeLib" + IDS_OPEN "Abrir" + IDS_OPEN_TYPELIB_FILTER "Ficheiros TypeLib (*.tlb;*.olb;*.dll;*.ocx;*.exe)\0*.tlb;*.olb;*.dll;*.ocx;*.exe\0Todos os Ficheiros (*.*)\0*.*\0\0" + + IDM_BIND, "Juntar a ficheiro através de um File Moniker" + IDM_TYPELIB, "Abrir um ficheiro TypeLib e ver os conteúdos" + IDM_SYSCONF, "Alterar configurações de COM Distribuídos" + IDM_REGEDIT, "Iniciar o Editor de Registo do Wine" + IDM_EXIT, "Sair da aplicação. Pede para guardar alterações." + IDM_CREATEINST, "Cria uma instância do objecto seleccionado" + IDM_CREATEINSTON, "Cria uma instância do objecto seleccionado na máquina especificada" + IDM_RELEASEINST, "Libertar a instância de objecto seleccionada" + IDM_COPYCLSID, "Copiar a GUID do objecto seleccionado para a àrea de transferência" + IDM_VIEW, "Mostrar o visualizador para o item seleccionado" + IDM_FLAG_INSERV, "Usar CLSCTX_INPROC_SERVER quando chamar CoGetClassObject" + IDM_FLAG_INHANDL, "Usar CLSCTX_INPROC_HANDLER quando chamar CoGetClassObject" + IDM_FLAG_LOCSERV, "Usar CLSCTX_LOCAL_SERVER quando chamar CoGetClassObject" + IDM_FLAG_REMSERV, "Usar CLSCTX_REMOTE_SERVER quando chamar CoGetClassObject" + IDM_EXPERT, "Alternar o modo de visionamento entre Novato e Experiente" + IDM_HIDDEN, "Activar o visionamento de categorias de componentes que não é suposto serem visiveis" + IDM_TOOLBAR, "Mostrar ou esconder a Barra de Ferramentas" + IDM_STATUSBAR, "Mostrar ou esconder a barra de estados" + IDM_REFRESH, "Actualizar todas as listas" + IDM_ABOUT, "Mostrar informação do programa, versão e direitos de autor" + + IDM_SAVEAS, "Guardar ficheiro como .IDL ou .H" + IDM_CLOSE, "Fechar janela" + IDM_GROUP, "Agrupar por tipos de informação" + + IDS_TREE_OC, "ObjectClasses" + IDS_TREE_GBCC, "Agrupado por categoria de componente" + IDS_TREE_O1O, "Objectos OLE 1.0" + IDS_TREE_CLO, "Biblioteca de Objectos COM" + IDS_TREE_AO, "Todos os objectos" + IDS_TREE_AID, "IDs da aplicação" + IDS_TREE_TL, "Bibliotecas de tipos" + IDS_TL_VER, "ver." + IDS_TREE_I, "Interfaces" + + IDS_TAB_REG, "Registo" + IDS_TAB_IMPL, "Implementação" + IDS_TAB_ACTIV, "Activação" + + IDS_CGCOFAIL, "CoGetClassObject falhou." + IDS_ERROR_UNKN, "Erro desconhecido" + IDS_TRUE, "Verdade" + IDS_FALSE, "Falso" + IDS_BYTES, "bytes" + + IDS_ERROR_LOADTYPELIB, "LoadTypeLib( %s ) falhou ($%x)" + IDS_INHERITINTERFACES, "Interfaces Herdadas" +} + +DLG_CREATEINSTON DIALOG DISCARDABLE 0, 0, 250, 41 +STYLE DS_MODALFRAME | DS_NOIDLEMSG | WS_CAPTION | WS_SYSMENU +CAPTION "Ligar a outra máquina" +FONT 8, "MS Shell Dlg" +{ + LTEXT "&Nome da máquina:", IDIGNORE, 5, 6, 190, 8 + EDITTEXT IDC_MACHINE, 5, 16, 190, 12, WS_BORDER | WS_TABSTOP | ES_AUTOHSCROLL + DEFPUSHBUTTON "&OK", IDOK, 200, 5, 45, 14 + PUSHBUTTON "&Cancelar", IDCANCEL, 200, 22, 45, 14 +} + +DLG_SYSCONF DIALOG DISCARDABLE 0, 0, 170, 100 +STYLE DS_MODALFRAME | DS_NOIDLEMSG | WS_CAPTION | WS_SYSMENU +CAPTION "Configuração do Sistema" +FONT 8, "MS Shell Dlg" +{ + LTEXT "Configurações do Sistema", IDIGNORE, 5, 6, 160, 8 + CHECKBOX "&Activar COM Distribuídos", IDC_ENABLEDCOM, 5, 20, 160, 10, WS_TABSTOP | WS_GROUP | BS_AUTOCHECKBOX + CHECKBOX "Activar ligações &remotas (Win95 apenas)", IDC_ENABLEREMOTE, 5, 35, 160, 10, WS_TABSTOP | WS_GROUP | BS_AUTOCHECKBOX + LTEXT "Estas configurações alteram apenas valores de registo.\nNão tem consequências no desempenho do Wine.", IDIGNORE, 5, 50, 160, 40 + DEFPUSHBUTTON "&OK", IDOK, 70, 80, 45, 14 + PUSHBUTTON "&Cancelar", IDCANCEL, 120, 80, 45, 14 +} + +DLG_DEFAULT_IV DIALOG DISCARDABLE 0, 0, 280, 50 +STYLE DS_MODALFRAME | DS_NOIDLEMSG | WS_CAPTION | WS_SYSMENU +CAPTION "Visualizador de Interface por defeito" +FONT 8, "MS Shell Dlg" +{ + LTEXT "Interface", IDIGNORE, 5, 6, 50, 8 + LTEXT "", IDC_LABEL, 60, 6, 145, 8 + LTEXT "IID:", IDIGNORE, 5, 16, 50, 8 + LTEXT "", IDC_IDENTIFIER, 60, 16, 165, 8 + DEFPUSHBUTTON "&Fechar", IDCANCEL, 230, 6, 45, 14 + PUSHBUTTON "&Ver informação do tipo", IDC_VIEWTYPEINFO, 6, 31, 70, 14, WS_DISABLED +} + +DLG_IPERSIST_IV DIALOG DISCARDABLE 0, 0, 280, 29 +STYLE DS_MODALFRAME | DS_NOIDLEMSG | WS_CAPTION | WS_SYSMENU +CAPTION "Visualizador de Interface IPersist" +FONT 8, "MS Shell Dlg" +{ + LTEXT "Nome da classe:", IDIGNORE, 5, 6, 50, 8 + LTEXT "", IDC_LABEL, 60, 6, 145, 8 + LTEXT "CLSID:", IDIGNORE, 5, 16, 50, 8 + LTEXT "", IDC_IDENTIFIER, 60, 16, 165, 8 + DEFPUSHBUTTON "&Fechar", IDCANCEL, 230, 6, 45, 14 +} + +DLG_IPERSISTSTREAM_IV DIALOG DISCARDABLE 0, 0, 280, 68 +STYLE DS_MODALFRAME | DS_NOIDLEMSG | WS_CAPTION | WS_SYSMENU +CAPTION "Visualizador de Interface IPersistStream" +FONT 8, "MS Shell Dlg" +{ + LTEXT "Nome da classe:", IDIGNORE, 5, 6, 50, 8 + LTEXT "", IDC_LABEL, 60, 6, 145, 8 + LTEXT "CLSID:", IDIGNORE, 5, 16, 50, 8 + LTEXT "", IDC_IDENTIFIER, 60, 16, 165, 8 + DEFPUSHBUTTON "&Fechar", IDCANCEL, 230, 6, 45, 14 + PUSHBUTTON "&IsDirty", IDC_ISDIRTY_BUTTON, 6, 31, 50, 14 + LTEXT "???", IDC_ISDIRTY, 60, 34, 145, 8 + PUSHBUTTON "&GetSizeMax", IDC_GETSIZEMAX_BUTTON, 6, 49, 50, 14 + LTEXT "???", IDC_GETSIZEMAX, 60, 52, 145, 8 +} diff --git a/programs/oleview/rsrc.rc b/programs/oleview/rsrc.rc index 02d460f2b09..881a1a02413 100644 --- a/programs/oleview/rsrc.rc +++ b/programs/oleview/rsrc.rc @@ -32,6 +32,7 @@ #include "Nl.rc" #include "No.rc" #include "Pl.rc" +#include "Pt.rc" #include "Ru.rc" #include "Zh.rc" diff --git a/programs/reg/rsrc.rc b/programs/reg/Pt.rc similarity index 59% copy from programs/reg/rsrc.rc copy to programs/reg/Pt.rc index 0c69c1b3c06..2918883eb40 100644 --- a/programs/reg/rsrc.rc +++ b/programs/reg/Pt.rc @@ -1,5 +1,9 @@ /* + * REG.EXE - Wine-compatible reg program. + * Portuguese language support + * * Copyright 2008 Andrew Riedi + * Copyright 2008 Ricardo Filipe * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -16,20 +20,12 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#include - -#include "reg.h" - -LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL +LANGUAGE LANG_PORTUGUESE, SUBLANG_NEUTRAL -#include "Da.rc" -#include "De.rc" -#include "En.rc" -#include "Fr.rc" -#include "Ja.rc" -#include "Ko.rc" -#include "Nl.rc" -#include "No.rc" -#include "Pl.rc" -#include "Ru.rc" -#include "Si.rc" +STRINGTABLE +{ + STRING_USAGE, "A sintaxe deste comando é:\n\nREG [ ADD | DELETE | QUERY ]\nREG comando /?\n" + STRING_ADD_USAGE, "REG ADD nome_chave [/v nome_valor | /ve] [/t tipo] [/s separador] [/d dados] [/f]\n" + STRING_DELETE_USAGE, "REG DELETE nome_chave [/v nome_valor | /ve | /va] [/f]\n" + STRING_QUERY_USAGE, "REG QUERY nome_chave [/v nome_valor | /ve] [/s]\n" +} diff --git a/programs/reg/rsrc.rc b/programs/reg/rsrc.rc index 0c69c1b3c06..743c324dd86 100644 --- a/programs/reg/rsrc.rc +++ b/programs/reg/rsrc.rc @@ -31,5 +31,6 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL #include "Nl.rc" #include "No.rc" #include "Pl.rc" +#include "Pt.rc" #include "Ru.rc" #include "Si.rc" diff --git a/programs/rpcss/rpcss_main.c b/programs/rpcss/rpcss_main.c index c75138e51ed..ad5dd58cc34 100644 --- a/programs/rpcss/rpcss_main.c +++ b/programs/rpcss/rpcss_main.c @@ -1,5 +1,5 @@ /* - * Copyright 2001, Ove Kåven, TransGaming Technologies Inc. + * Copyright 2001, Ove Kåven, TransGaming Technologies Inc. * Copyright 2002 Greg Turner * * This library is free software; you can redistribute it and/or diff --git a/programs/taskmgr/Pt.rc b/programs/taskmgr/Pt.rc new file mode 100644 index 00000000000..42ece363052 --- /dev/null +++ b/programs/taskmgr/Pt.rc @@ -0,0 +1,486 @@ +/* + * Task Manager + * + * Portuguese Language support + * + * Copyright 2008 Ricardo Filipe + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +LANGUAGE LANG_PORTUGUESE, SUBLANG_NEUTRAL + +/* + Menu +*/ + +IDR_TASKMANAGER MENU DISCARDABLE +BEGIN + POPUP "&Ficheiro" + BEGIN + MENUITEM "&Nova Tarefa (Executar...)", ID_FILE_NEW + MENUITEM SEPARATOR + MENUITEM "&Sair", ID_FILE_EXIT + END + POPUP "&Opções" + BEGIN + MENUITEM "&Sempre Visível", ID_OPTIONS_ALWAYSONTOP + , CHECKED + MENUITEM "&Executar minimizado", ID_OPTIONS_MINIMIZEONUSE + , CHECKED + MENUITEM "&Ocultar quando minimizado", ID_OPTIONS_HIDEWHENMINIMIZED + , CHECKED + MENUITEM "&Mostrar tarefas de 16-bits", ID_OPTIONS_SHOW16BITTASKS + , CHECKED + END + POPUP "&Ver" + BEGIN + MENUITEM "&Actualizar agora", ID_VIEW_REFRESH + POPUP "&Frequência de actualização" + BEGIN + MENUITEM "&Alta", ID_VIEW_UPDATESPEED_HIGH + MENUITEM "&Normal", ID_VIEW_UPDATESPEED_NORMAL + , CHECKED + MENUITEM "&Baixa", ID_VIEW_UPDATESPEED_LOW + MENUITEM "&Pausa", ID_VIEW_UPDATESPEED_PAUSED + + END + MENUITEM SEPARATOR + MENUITEM "&Icones grandes", ID_VIEW_LARGE + MENUITEM "Icones &pequenos", ID_VIEW_SMALL + MENUITEM "&Detalhes", ID_VIEW_DETAILS, CHECKED + MENUITEM "&Seleccionar colunas...", ID_VIEW_SELECTCOLUMNS + POPUP "&Histórico do CPU" + BEGIN + MENUITEM "&Um gráfico, todos os CPUs", ID_VIEW_CPUHISTORY_ONEGRAPHALL + + MENUITEM "Um &gráfico por CPU", ID_VIEW_CPUHISTORY_ONEGRAPHPERCPU + , CHECKED + END + MENUITEM "&Mostrar tempos do kernel", ID_VIEW_SHOWKERNELTIMES + END + POPUP "&Janelas" + BEGIN + MENUITEM "Em mosaico na &Horizontal", ID_WINDOWS_TILEHORIZONTALLY + MENUITEM "Em mosaico na &Vertical", ID_WINDOWS_TILEVERTICALLY + MENUITEM "&Minimizar", ID_WINDOWS_MINIMIZE + MENUITEM "Ma&ximizar", ID_WINDOWS_MAXIMIZE + MENUITEM "&Em cascata", ID_WINDOWS_CASCADE + MENUITEM "&Trazer para a frente", ID_WINDOWS_BRINGTOFRONT + END + POPUP "&Ajuda" + BEGIN + MENUITEM "&Tópicos de ajuda do Gestor de Tarefas", ID_HELP_TOPICS + MENUITEM SEPARATOR + MENUITEM "&Sobre o Gestor de Tarefas", ID_HELP_ABOUT + END +END + +IDR_WINDOWSMENU MENU DISCARDABLE +BEGIN + MENUITEM "Em mosaico na &Horizontal", ID_WINDOWS_TILEHORIZONTALLY + MENUITEM "Em mosaico na &Vertical", ID_WINDOWS_TILEVERTICALLY + MENUITEM "&Minimizar", ID_WINDOWS_MINIMIZE + MENUITEM "Ma&ximizar", ID_WINDOWS_MAXIMIZE + MENUITEM "&Em cascata", ID_WINDOWS_CASCADE + MENUITEM "&Trazer para a frente", ID_WINDOWS_BRINGTOFRONT +END + +IDR_APPLICATION_PAGE_CONTEXT1 MENU DISCARDABLE +BEGIN + POPUP "DUMMY" + BEGIN + MENUITEM "&Nova Tarefa (Executar...)", ID_FILE_NEW + MENUITEM SEPARATOR + MENUITEM "&Icones Grandes", ID_VIEW_LARGE + MENUITEM "Icones &Pequenos", ID_VIEW_SMALL + MENUITEM "&Detalhes", ID_VIEW_DETAILS, CHECKED + END +END + +IDR_APPLICATION_PAGE_CONTEXT2 MENU DISCARDABLE +BEGIN + POPUP "DUMMY" + BEGIN + MENUITEM "&Mudar para", ID_APPLICATION_PAGE_SWITCHTO + MENUITEM "&Trazer para a frente", ID_WINDOWS_BRINGTOFRONT + MENUITEM SEPARATOR + MENUITEM "Em mosaico na &Horizontal", ID_WINDOWS_TILEHORIZONTALLY + MENUITEM "Em mosaico na &Vertical", ID_WINDOWS_TILEVERTICALLY + MENUITEM "&Minimizar", ID_WINDOWS_MINIMIZE + MENUITEM "Ma&ximizar", ID_WINDOWS_MAXIMIZE + MENUITEM "&Em cascata", ID_WINDOWS_CASCADE + MENUITEM SEPARATOR + MENUITEM "&Terminar Tarefa", ID_APPLICATION_PAGE_ENDTASK + MENUITEM "&Ir para Processo", ID_APPLICATION_PAGE_GOTOPROCESS + END +END + +IDR_TRAY_POPUP MENU DISCARDABLE +BEGIN + POPUP "DUMMY" + BEGIN + MENUITEM "&Restaurar", ID_RESTORE + MENUITEM "&Fechar", ID_FILE_EXIT + MENUITEM SEPARATOR + MENUITEM "&Sempre Visível", ID_OPTIONS_ALWAYSONTOP + END +END + +IDR_PROCESS_PAGE_CONTEXT MENU DISCARDABLE +BEGIN + POPUP "DUMMY" + BEGIN + MENUITEM "&Terminar Processo", ID_PROCESS_PAGE_ENDPROCESS + MENUITEM "Terminar Árvore de &Processo", ID_PROCESS_PAGE_ENDPROCESSTREE + + MENUITEM "&Depurar", ID_PROCESS_PAGE_DEBUG + MENUITEM SEPARATOR + POPUP "D&efinir Prioridade" + BEGIN + MENUITEM "&Tempo Real", ID_PROCESS_PAGE_SETPRIORITY_REALTIME + + MENUITEM "&Alta", ID_PROCESS_PAGE_SETPRIORITY_HIGH + + MENUITEM "A&cima do Normal", ID_PROCESS_PAGE_SETPRIORITY_ABOVENORMAL + + MENUITEM "&Normal", ID_PROCESS_PAGE_SETPRIORITY_NORMAL + + MENUITEM "Aba&ixo do Normal", ID_PROCESS_PAGE_SETPRIORITY_BELOWNORMAL + + MENUITEM "&Baixa", ID_PROCESS_PAGE_SETPRIORITY_LOW + + END + MENUITEM "Definir &Afinidade...", ID_PROCESS_PAGE_SETAFFINITY + MENUITEM "Edi&tar canais de depuração...", ID_PROCESS_PAGE_DEBUGCHANNELS + END +END + +/* + Dialog +*/ + +IDD_TASKMGR_DIALOG DIALOG DISCARDABLE 0, 0, 264, 246 +STYLE DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | + WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU | + WS_THICKFRAME +CAPTION "Gestor de Tarefas" +MENU IDR_TASKMANAGER +FONT 8, "MS Shell Dlg" +BEGIN + CONTROL "Tab1",IDC_TAB,"SysTabControl32",WS_TABSTOP,3,3,257,228 +END + +IDD_APPLICATION_PAGE DIALOG DISCARDABLE 0, 0, 247, 210 +STYLE DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN +FONT 8, "MS Shell Dlg" +BEGIN + CONTROL "List2",IDC_APPLIST,"SysListView32",LVS_REPORT | + LVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP,7,7,233,177 + PUSHBUTTON "&Nova Tarefa...",IDC_NEWTASK,187,189,53,14 + PUSHBUTTON "&Mudar Para",IDC_SWITCHTO,131,189,53,14,WS_DISABLED + PUSHBUTTON "&Terminar Tarefa",IDC_ENDTASK,75,189,53,14,WS_DISABLED +END + +IDD_PROCESS_PAGE DIALOG DISCARDABLE 0, 0, 247, 210 +STYLE DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN +FONT 8, "MS Shell Dlg" +BEGIN + CONTROL "List2",IDC_PROCESSLIST,"SysListView32",LVS_REPORT | + LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_OWNERDATA | + WS_BORDER | WS_TABSTOP,7,7,233,177 + PUSHBUTTON "&Terminar Processo",IDC_ENDPROCESS,171,189,69,14 + CONTROL "&Mostrar Processos de todos os utilizadores",IDC_SHOWALLPROCESSES, + "Botão",BS_AUTOCHECKBOX | WS_TABSTOP,7,191,111,10 +END + +/*IDD_PERFORMANCE_PAGE DIALOGEX 0, 0, 247, 210*/ +IDD_PERFORMANCE_PAGE DIALOGEX DISCARDABLE 0, 0, 247, 210 +STYLE DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN +FONT 8, "MS Shell Dlg" +BEGIN + GROUPBOX "Utilização CPU",IDC_CPU_USAGE_FRAME,5,5,60,54,WS_TABSTOP, WS_EX_TRANSPARENT + GROUPBOX "Memória",IDC_MEM_USAGE_FRAME,5,63,60,54,BS_LEFTTEXT, WS_EX_TRANSPARENT + GROUPBOX "Totais",IDC_TOTALS_FRAME,5,122,111,39,0,WS_EX_TRANSPARENT + GROUPBOX "Commit Charge (K)",IDC_COMMIT_CHARGE_FRAME,5,166,111,39,0,WS_EX_TRANSPARENT + GROUPBOX "Memória Física (K)",IDC_PHYSICAL_MEMORY_FRAME,131,122,111,39,0,WS_EX_TRANSPARENT + GROUPBOX "Memória kernel (K)",IDC_KERNEL_MEMORY_FRAME,131,166,111,39,0,WS_EX_TRANSPARENT + LTEXT "Identificadores",IDS_TOTALS_HANDLE_COUNT,12,131,40,8 + LTEXT "Threads",IDS_TOTALS_THREAD_COUNT,12,140,27,8 + LTEXT "Processos",IDS_TOTALS_PROCESS_COUNT,12,149,34,8 + EDITTEXT IDC_TOTALS_HANDLE_COUNT,65,131,45,8,ES_RIGHT | + ES_READONLY | ES_NUMBER | NOT WS_BORDER + EDITTEXT IDC_TOTALS_THREAD_COUNT,65,140,45,8,ES_RIGHT | + ES_READONLY | ES_NUMBER | NOT WS_BORDER + EDITTEXT IDC_TOTALS_PROCESS_COUNT,65,149,45,8,ES_RIGHT | + ES_READONLY | ES_NUMBER | NOT WS_BORDER + LTEXT "Total",IDS_COMMIT_CHARGE_TOTAL,12,175,27,8 + LTEXT "Limit",IDS_COMMIT_CHARGE_LIMIT,12,184,15,8 + LTEXT "Peak",IDS_COMMIT_CHARGE_PEAK,12,193,34,8 + EDITTEXT IDC_COMMIT_CHARGE_TOTAL,65,174,45,8,ES_RIGHT | + ES_READONLY | ES_NUMBER | NOT WS_BORDER + EDITTEXT IDC_COMMIT_CHARGE_LIMIT,65,184,45,8,ES_RIGHT | + ES_READONLY | ES_NUMBER | NOT WS_BORDER + EDITTEXT IDC_COMMIT_CHARGE_PEAK,65,193,45,8,ES_RIGHT | + ES_READONLY | ES_NUMBER | NOT WS_BORDER + LTEXT "Total",IDS_PHYSICAL_MEMORY_TOTAL,137,131,27,8 + LTEXT "Livre",IDS_PHYSICAL_MEMORY_AVAILABLE,137,140,30,8 + LTEXT "Em Cache",IDS_PHYSICAL_MEMORY_SYSTEM_CACHE,137,149,46,8 + EDITTEXT IDC_PHYSICAL_MEMORY_TOTAL,185,131,48,8,ES_RIGHT | + ES_READONLY | ES_NUMBER | NOT WS_BORDER + EDITTEXT IDC_PHYSICAL_MEMORY_AVAILABLE,185,140,48,8,ES_RIGHT | + ES_READONLY | ES_NUMBER | NOT WS_BORDER + EDITTEXT IDC_PHYSICAL_MEMORY_SYSTEM_CACHE,185,149,48,8,ES_RIGHT | + ES_READONLY | ES_NUMBER | NOT WS_BORDER + LTEXT "Total",IDS_KERNEL_MEMORY_TOTAL,137,174,27,8 + LTEXT "Paginada",IDS_KERNEL_MEMORY_PAGED,137,184,21,8 + LTEXT "Não paginada",IDS_KERNEL_MEMORY_NONPAGED,137,193,34,8 + EDITTEXT IDC_KERNEL_MEMORY_TOTAL,185,174,48,8,ES_RIGHT | + ES_READONLY | ES_NUMBER | NOT WS_BORDER + EDITTEXT IDC_KERNEL_MEMORY_PAGED,185,184,48,8,ES_RIGHT | + ES_READONLY | ES_NUMBER | NOT WS_BORDER + EDITTEXT IDC_KERNEL_MEMORY_NONPAGED,185,193,48,8,ES_RIGHT | + ES_READONLY | ES_NUMBER | NOT WS_BORDER + GROUPBOX "Histórico da utilização do CPU", IDC_CPU_USAGE_HISTORY_FRAME, 74,5,168,54,0, WS_EX_TRANSPARENT + GROUPBOX "Histórico da Utilização de Memória Física", IDC_MEMORY_USAGE_HISTORY_FRAME,74,63,168,54,0,WS_EX_TRANSPARENT + PUSHBUTTON "CPU Usage Display",IDC_CPU_USAGE_GRAPH,12,17,47,37,0, + WS_EX_CLIENTEDGE + PUSHBUTTON "MEM Usage Display",IDC_MEM_USAGE_GRAPH,12,75,47,37,0, + WS_EX_CLIENTEDGE + PUSHBUTTON "CPU Usage History",IDC_CPU_USAGE_HISTORY_GRAPH,81,17, + 153,37,0,WS_EX_CLIENTEDGE + PUSHBUTTON "MEM Usage History",IDC_MEM_USAGE_HISTORY_GRAPH,81,75, + 153,37,0,WS_EX_CLIENTEDGE +END + +IDD_DEBUG_CHANNELS_DIALOG DIALOG DISCARDABLE 0, 0, 247, 210 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Canais de depuração" +FONT 8, "MS Shell Dlg" +BEGIN + CONTROL "List2",IDC_DEBUG_CHANNELS_LIST,"SysListView32",LVS_REPORT | + LVS_SINGLESEL | LVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP | + LVS_SORTASCENDING,7,7,233,177 + PUSHBUTTON "Fechar",IDOK,171,189,69,14 +END + +IDD_AFFINITY_DIALOG DIALOG DISCARDABLE 0, 0, 231, 154 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Afinidade do processador" +FONT 8, "MS Shell Dlg" +BEGIN + DEFPUSHBUTTON "OK",IDOK,120,133,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,174,133,50,14 + LTEXT "A Afinidade do Processador controla em que CPUs o processo é permitido de executar.", + IDC_STATIC,5,5,220,16 + CONTROL "CPU 0",IDC_CPU0,"Button",BS_AUTOCHECKBOX | WS_TABSTOP, + 11,28,37,10 + CONTROL "CPU 1",IDC_CPU1,"Button",BS_AUTOCHECKBOX | WS_DISABLED | + WS_TABSTOP,11,41,37,10 + CONTROL "CPU 2",IDC_CPU2,"Button",BS_AUTOCHECKBOX | WS_DISABLED | + WS_TABSTOP,11,54,37,10 + CONTROL "CPU 3",IDC_CPU3,"Button",BS_AUTOCHECKBOX | WS_DISABLED | + WS_TABSTOP,11,67,37,10 + CONTROL "CPU 4",IDC_CPU4,"Button",BS_AUTOCHECKBOX | WS_DISABLED | + WS_TABSTOP,11,80,37,10 + CONTROL "CPU 5",IDC_CPU5,"Button",BS_AUTOCHECKBOX | WS_DISABLED | + WS_TABSTOP,11,93,37,10 + CONTROL "CPU 6",IDC_CPU6,"Button",BS_AUTOCHECKBOX | WS_DISABLED | + WS_TABSTOP,11,106,37,10 + CONTROL "CPU 7",IDC_CPU7,"Button",BS_AUTOCHECKBOX | WS_DISABLED | + WS_TABSTOP,11,119,37,10 + CONTROL "CPU 8",IDC_CPU8,"Button",BS_AUTOCHECKBOX | WS_DISABLED | + WS_TABSTOP,61,28,37,10 + CONTROL "CPU 9",IDC_CPU9,"Button",BS_AUTOCHECKBOX | WS_DISABLED | + WS_TABSTOP,61,41,37,10 + CONTROL "CPU 10",IDC_CPU10,"Button",BS_AUTOCHECKBOX | + WS_DISABLED | WS_TABSTOP,61,54,41,10 + CONTROL "CPU 11",IDC_CPU11,"Button",BS_AUTOCHECKBOX | + WS_DISABLED | WS_TABSTOP,61,67,41,10 + CONTROL "CPU 12",IDC_CPU12,"Button",BS_AUTOCHECKBOX | + WS_DISABLED | WS_TABSTOP,61,80,41,10 + CONTROL "CPU 13",IDC_CPU13,"Button",BS_AUTOCHECKBOX | + WS_DISABLED | WS_TABSTOP,61,93,41,10 + CONTROL "CPU 14",IDC_CPU14,"Button",BS_AUTOCHECKBOX | + WS_DISABLED | WS_TABSTOP,61,106,41,10 + CONTROL "CPU 15",IDC_CPU15,"Button",BS_AUTOCHECKBOX | + WS_DISABLED | WS_TABSTOP,61,119,41,10 + CONTROL "CPU 16",IDC_CPU16,"Button",BS_AUTOCHECKBOX | + WS_DISABLED | WS_TABSTOP,116,28,41,10 + CONTROL "CPU 17",IDC_CPU17,"Button",BS_AUTOCHECKBOX | + WS_DISABLED | WS_TABSTOP,116,41,41,10 + CONTROL "CPU 18",IDC_CPU18,"Button",BS_AUTOCHECKBOX | + WS_DISABLED | WS_TABSTOP,116,54,41,10 + CONTROL "CPU 19",IDC_CPU19,"Button",BS_AUTOCHECKBOX | + WS_DISABLED | WS_TABSTOP,116,67,41,10 + CONTROL "CPU 20",IDC_CPU20,"Button",BS_AUTOCHECKBOX | + WS_DISABLED | WS_TABSTOP,116,80,41,10 + CONTROL "CPU 21",IDC_CPU21,"Button",BS_AUTOCHECKBOX | + WS_DISABLED | WS_TABSTOP,116,93,41,10 + CONTROL "CPU 22",IDC_CPU22,"Button",BS_AUTOCHECKBOX | + WS_DISABLED | WS_TABSTOP,116,106,41,10 + CONTROL "CPU 23",IDC_CPU23,"Button",BS_AUTOCHECKBOX | + WS_DISABLED | WS_TABSTOP,116,119,41,10 + CONTROL "CPU 24",IDC_CPU24,"Button",BS_AUTOCHECKBOX | + WS_DISABLED | WS_TABSTOP,175,28,41,10 + CONTROL "CPU 25",IDC_CPU25,"Button",BS_AUTOCHECKBOX | + WS_DISABLED | WS_TABSTOP,175,41,41,10 + CONTROL "CPU 26",IDC_CPU26,"Button",BS_AUTOCHECKBOX | + WS_DISABLED | WS_TABSTOP,175,54,41,10 + CONTROL "CPU 27",IDC_CPU27,"Button",BS_AUTOCHECKBOX | + WS_DISABLED | WS_TABSTOP,175,67,41,10 + CONTROL "CPU 28",IDC_CPU28,"Button",BS_AUTOCHECKBOX | + WS_DISABLED | WS_TABSTOP,175,80,41,10 + CONTROL "CPU 29",IDC_CPU29,"Button",BS_AUTOCHECKBOX | + WS_DISABLED | WS_TABSTOP,175,93,41,10 + CONTROL "CPU 30",IDC_CPU30,"Button",BS_AUTOCHECKBOX | + WS_DISABLED | WS_TABSTOP,175,106,41,10 + CONTROL "CPU 31",IDC_CPU31,"Button",BS_AUTOCHECKBOX | + WS_DISABLED | WS_TABSTOP,175,119,41,10 +END + +IDD_COLUMNS_DIALOG DIALOG DISCARDABLE 0, 0, 195, 199 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Seleccionar Colunas" +FONT 8, "MS Shell Dlg" +BEGIN + DEFPUSHBUTTON "OK",IDOK,84,178,50,14 + PUSHBUTTON "Cancelar",IDCANCEL,138,178,50,14 + LTEXT "Seleccione as colunas que vão aparecer na página de Processos do Gestor de Tarefas.", + IDC_STATIC,7,7,181,17 + CONTROL "&Nome da Imagem",IDC_IMAGENAME,"Button",BS_AUTOCHECKBOX | + WS_DISABLED | WS_TABSTOP,7,28,56,10 + CONTROL "&PID (Identificador do Processo)",IDC_PID,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,7,39,88,10 + CONTROL "&Utilização do CPU",IDC_CPUUSAGE,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,7,50,53,10 + CONTROL "&Tempo de CPU",IDC_CPUTIME,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,7,61,48,10 + CONTROL "U&so de Memória",IDC_MEMORYUSAGE,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,7,72,63,10 + CONTROL "&Delta do uso de Memória",IDC_MEMORYUSAGEDELTA,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,7,83,82,10 + CONTROL "P&ico do uso de Memória",IDC_PEAKMEMORYUSAGE,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,7,94,82,10 + CONTROL "&Falhas de paginação",IDC_PAGEFAULTS,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,7,105,53,10 + CONTROL "&Objectos de UTILIZADOR",IDC_USEROBJECTS,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,7,116,62,10 + CONTROL "&Leituras de E/S",IDC_IOREADS,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,7,127,49,10 + CONTROL "&Bytes de Leitura de E/S",IDC_IOREADBYTES,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,7,138,65,10 + CONTROL "&ID da sessão",IDC_SESSIONID,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,7,149,50,10 + CONTROL "&Nome de utilizador",IDC_USERNAME,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,7,160,51,10 + CONTROL "D&elta de Falhas de Paginação",IDC_PAGEFAULTSDELTA,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,107,28,72,10 + CONTROL "&Tamanho de Memória Virtual",IDC_VIRTUALMEMORYSIZE,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,107,39,77,10 + CONTROL "&Conjunto Paginado",IDC_PAGEDPOOL,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,107,50,53,10 + CONTROL "Conjunto Não Paginado",IDC_NONPAGEDPOOL,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,107,61,67,10 + CONTROL "Prioridade &Base",IDC_BASEPRIORITY,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,107,72,55,10 + CONTROL "&Handle Count",IDC_HANDLECOUNT,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,107,83,59,10 + CONTROL "&Thread Count",IDC_THREADCOUNT,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,107,94,59,10 + CONTROL "Objectos GDI",IDC_GDIOBJECTS,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,107,105,55,10 + CONTROL "Escritas de E/S",IDC_IOWRITES,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,107,116,49,10 + CONTROL "Bytes de escrita de E/S",IDC_IOWRITEBYTES,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,107,127,65,10 + CONTROL "Outros E/S",IDC_IOOTHER,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,107,138,46,10 + CONTROL "Bytes de outros E/S",IDC_IOOTHERBYTES,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,107,149,65,10 +END + +/* + String Table +*/ + +STRINGTABLE DISCARDABLE +BEGIN + IDS_APP_TITLE "Gestor de Tarefas" + IDC_TASKMGR "Gestor de Tarefas" + IDS_RUNDLG_CAPTION "Criar Nova Tarefa" +END + +STRINGTABLE DISCARDABLE +BEGIN + ID_FILE_NEW "Executa um novo programa" + ID_OPTIONS_ALWAYSONTOP "O Gestor de Tarefas permanece à frente de todas as outras janelas a não ser que esteja minimizado" + ID_OPTIONS_MINIMIZEONUSE + "O Gestor de Tarefas é minimizado quando se efectua uma operação de Mudar Para" + ID_OPTIONS_HIDEWHENMINIMIZED "Esconder o Gestor de Tarefas quando está minimizado" + ID_VIEW_REFRESH "Forçar o Gestor de Tarefas a actualizar agora, independentemente da velocidade de actualização definida." + ID_VIEW_LARGE "Mostra as tarefas usando icones grandes" + ID_VIEW_SMALL "Mostra as tarefas usando icones pequenos" + ID_VIEW_DETAILS "Mostra informação sobre cada tarefa" + ID_VIEW_UPDATESPEED_HIGH "Actualiza o display duas vezes por segundo" + ID_VIEW_UPDATESPEED_NORMAL "Actualiza o display a cada dois segundos" + ID_VIEW_UPDATESPEED_LOW "Actualiza o display a cada quatro segundos" +END + +STRINGTABLE DISCARDABLE +BEGIN + ID_VIEW_UPDATESPEED_PAUSED "Não actualiza automaticamente" + ID_WINDOWS_TILEHORIZONTALLY + "Dispõe as janelas em mosaico horizontal pelo desktop" + ID_WINDOWS_TILEVERTICALLY "Dispõe as janelas em mosaico vertical pelo desktop" + ID_WINDOWS_MINIMIZE "Minimiza as janelas" + ID_WINDOWS_MAXIMIZE "Maximiza as janelas" + ID_WINDOWS_CASCADE "Dispõe as janelas em cascata diagonal pelo desktop" + ID_WINDOWS_BRINGTOFRONT "Traz a janela para a frente, mas sem mudar para ela" + ID_HELP_TOPICS "Mostra os tópicos de ajuda do Gestor de Tarefas" + ID_HELP_ABOUT "Mostra informação sobre o programa, versão e direitos de autor" + ID_FILE_EXIT "Sai do Gestor de Tarefas" + ID_OPTIONS_SHOW16BITTASKS + "Mostra as tarefas de 16-bits no ntvdm.exe associado" + ID_VIEW_SELECTCOLUMNS "Selecciona as colunas que serão visíveis na página de processos" + ID_VIEW_SHOWKERNELTIMES "Mostra o tempo do kernel nos gráficos de performance" + ID_VIEW_CPUHISTORY_ONEGRAPHALL + "Um único gráfico de histórico mostra o uso total do CPU" + ID_VIEW_CPUHISTORY_ONEGRAPHPERCPU "Cada CPU tem o seu gráfico de histórico" + ID_APPLICATION_PAGE_SWITCHTO + "Coloca a tarefa no fundo e muda o foco para ela" +END + +STRINGTABLE DISCARDABLE +BEGIN + ID_ENDTASK "Diz às tarefas seleccionadas para fechar" + ID_GOTOPROCESS "Muda o foco para o processo da tarefa seleccionada" + ID_RESTORE "Restaura o Gestor de Tarefas do seu estado oculto" + ID_PROCESS_PAGE_ENDPROCESS "Remove o processo do sistema" + ID_PROCESS_PAGE_ENDPROCESSTREE + "Remove o processo e os seus descendentes do sistema" + ID_PROCESS_PAGE_DEBUG "Junta o depurador a este processo" + ID_PROCESS_PAGE_SETAFFINITY + "Controla em que processadores o processo ficará autorizado a correr" + ID_PROCESS_PAGE_SETPRIORITY_REALTIME "Coloca o processo na classe de prioridade em Tempo Real" + ID_PROCESS_PAGE_SETPRIORITY_HIGH "Coloca o processo na classe de prioridade Alta" + ID_PROCESS_PAGE_SETPRIORITY_ABOVENORMAL + "Coloca o processo na classe de prioridade Acima do Normal" + ID_PROCESS_PAGE_SETPRIORITY_NORMAL + "Coloca o processo na classe de prioridade Normal" + ID_PROCESS_PAGE_SETPRIORITY_BELOWNORMAL + "Coloca o processo na classe de prioridade Abaixo do Normal" + ID_PROCESS_PAGE_SETPRIORITY_LOW "Coloca o processo na classe de prioridade Baixa" +END diff --git a/programs/taskmgr/taskmgr.rc b/programs/taskmgr/taskmgr.rc index 213755952e3..842cc2e0824 100644 --- a/programs/taskmgr/taskmgr.rc +++ b/programs/taskmgr/taskmgr.rc @@ -36,6 +36,7 @@ #include "Nl.rc" #include "No.rc" #include "Pl.rc" +#include "Pt.rc" #include "Ru.rc" #include "Si.rc" #include "Tr.rc" diff --git a/programs/wineboot/wineboot.rc b/programs/wineboot/wineboot.rc index e52e6c40cd8..bc403a0c4cb 100644 --- a/programs/wineboot/wineboot.rc +++ b/programs/wineboot/wineboot.rc @@ -37,6 +37,7 @@ #include "wineboot_Nl.rc" #include "wineboot_No.rc" #include "wineboot_Pl.rc" +#include "wineboot_Pt.rc" #include "wineboot_Ro.rc" #include "wineboot_Ru.rc" #include "wineboot_Si.rc" diff --git a/dlls/d3d10/d3d10_main.c b/programs/wineboot/wineboot_Pt.rc similarity index 51% copy from dlls/d3d10/d3d10_main.c copy to programs/wineboot/wineboot_Pt.rc index 8d80c41f619..ae5561d8c74 100644 --- a/dlls/d3d10/d3d10_main.c +++ b/programs/wineboot/wineboot_Pt.rc @@ -1,7 +1,7 @@ /* - * Direct3D 10 + * WineBoot Portuguese Language resources * - * Copyright 2007 Andras Kovacs + * Copyright (C) 2008 Ricardo Filipe * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -19,27 +19,17 @@ * */ -#include "config.h" -#include +LANGUAGE LANG_PORTUGUESE, SUBLANG_NEUTRAL -#include "windef.h" -#include "winbase.h" -#include "winuser.h" -#include "wine/debug.h" - -WINE_DEFAULT_DEBUG_CHANNEL(d3d10); - -/* At process attach */ -BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv) -{ - TRACE("fdwReason=%d\n", fdwReason); - switch(fdwReason) - { - case DLL_WINE_PREATTACH: - return FALSE; /* prefer native version */ - case DLL_PROCESS_ATTACH: - DisableThreadLibraryCalls( hInstDLL ); - break; - } - return TRUE; -} +IDD_ENDTASK DIALOG DISCARDABLE 0, 0, 186, 71 +STYLE DS_MODALFRAME | DS_NOIDLEMSG | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "À espera do programa" +FONT 8, "MS Shell Dlg" +BEGIN + DEFPUSHBUTTON "Cancelar",IDCANCEL,129,49,50,15 + PUSHBUTTON "Terminar Processo",IDOK,51,49,71,15 + LTEXT "Um encerramento ou término de sessão simulado está em curso, mas este programa não está a responder.", + IDC_STATIC,7,7,172,19 + LTEXT "Se terminar o processo pode perder todos os dados não guardados.", + IDC_STATIC,7,28,172,15 +END diff --git a/programs/winecfg/drive.c b/programs/winecfg/drive.c index 15164269b6a..1a3671ce893 100644 --- a/programs/winecfg/drive.c +++ b/programs/winecfg/drive.c @@ -29,8 +29,12 @@ #include #include +#include +#define WIN32_NO_STATUS #include #include +#include +#include #include #include #include @@ -38,6 +42,8 @@ #include #include #include +#define WINE_MOUNTMGR_EXTENSIONS +#include #include #include "winecfg.h" @@ -87,22 +93,26 @@ long drive_available_mask(char letter) return result; } -BOOL add_drive(char letter, const char *targetpath, const WCHAR *label, DWORD serial, DWORD type) +BOOL add_drive(char letter, const char *targetpath, const char *device, const WCHAR *label, + DWORD serial, DWORD type) { int driveIndex = letter_to_index(letter); if(drives[driveIndex].in_use) return FALSE; - WINE_TRACE("letter == '%c', unixpath == '%s', label == %s, serial == %08x, type == %d\n", - letter, targetpath, wine_dbgstr_w(label), serial, type); + WINE_TRACE("letter == '%c', unixpath == %s, device == %s, label == %s, serial == %08x, type == %d\n", + letter, wine_dbgstr_a(targetpath), wine_dbgstr_a(device), + wine_dbgstr_w(label), serial, type); drives[driveIndex].letter = toupper(letter); drives[driveIndex].unixpath = strdupA(targetpath); - drives[driveIndex].label = strdupW(label); + drives[driveIndex].device = device ? strdupA(device) : NULL; + drives[driveIndex].label = label ? strdupW(label) : NULL; drives[driveIndex].serial = serial; drives[driveIndex].type = type; drives[driveIndex].in_use = TRUE; + drives[driveIndex].modified = TRUE; return TRUE; } @@ -112,40 +122,13 @@ void delete_drive(struct drive *d) { HeapFree(GetProcessHeap(), 0, d->unixpath); d->unixpath = NULL; + HeapFree(GetProcessHeap(), 0, d->device); + d->device = NULL; HeapFree(GetProcessHeap(), 0, d->label); d->label = NULL; d->serial = 0; d->in_use = FALSE; -} - -static void set_drive_type( char letter, DWORD type ) -{ - HKEY hKey; - char driveValue[4]; - const char *typeText = NULL; - - sprintf(driveValue, "%c:", letter); - - /* Set the drive type in the registry */ - if (type == DRIVE_FIXED) - typeText = "hd"; - else if (type == DRIVE_REMOTE) - typeText = "network"; - else if (type == DRIVE_REMOVABLE) - typeText = "floppy"; - else if (type == DRIVE_CDROM) - typeText = "cdrom"; - - if (RegCreateKey(HKEY_LOCAL_MACHINE, "Software\\Wine\\Drives", &hKey) != ERROR_SUCCESS) - WINE_TRACE(" Unable to open '%s'\n", "Software\\Wine\\Drives"); - else - { - if (typeText) - RegSetValueEx( hKey, driveValue, 0, REG_SZ, (const BYTE *)typeText, strlen(typeText) + 1 ); - else - RegDeleteValue( hKey, driveValue ); - RegCloseKey(hKey); - } + d->modified = TRUE; } static DWORD get_drive_type( char letter ) @@ -261,119 +244,69 @@ BOOL moveDrive(struct drive *pSrc, struct drive *pDst) #endif -/* Load currently defined drives into the drives array */ -void load_drives(void) +static HANDLE open_mountmgr(void) { - WCHAR *devices, *dev; - int len; - int drivecount = 0, i; - int retval; - static const int arraysize = 512; - const char *config_dir = wine_get_config_dir(); - char *path; + HANDLE ret; - WINE_TRACE("\n"); - - /* setup the drives array */ - dev = devices = HeapAlloc(GetProcessHeap(), 0, arraysize * sizeof(WCHAR)); - len = GetLogicalDriveStringsW(arraysize, devices); - - /* make all devices unused */ - for (i = 0; i < 26; i++) - { - drives[i].letter = 'A' + i; - drives[i].in_use = FALSE; - drives[i].serial = 0; + if ((ret = CreateFileW( MOUNTMGR_DOS_DEVICE_NAME, GENERIC_READ|GENERIC_WRITE, + FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, + 0, 0 )) == INVALID_HANDLE_VALUE) + WINE_ERR( "failed to open mount manager err %u\n", GetLastError() ); + return ret; +} - HeapFree(GetProcessHeap(), 0, drives[i].unixpath); - drives[i].unixpath = NULL; +/* Load currently defined drives into the drives array */ +BOOL load_drives(void) +{ + DWORD i, size = 1024; + HANDLE mgr; + WCHAR root[] = {'A',':',0}; - HeapFree(GetProcessHeap(), 0, drives[i].label); - drives[i].label = NULL; - } + if ((mgr = open_mountmgr()) == INVALID_HANDLE_VALUE) return FALSE; - /* work backwards through the result of GetLogicalDriveStrings */ - while (len) + while (root[0] <= 'Z') { - WCHAR volname[512]; /* volume name */ - DWORD serial; - char simplepath[3]; - char targetpath[256]; - char *c; + struct mountmgr_unix_drive input; + struct mountmgr_unix_drive *data; - WINE_TRACE("devices == %s\n", wine_dbgstr_w(devices)); + if (!(data = HeapAlloc( GetProcessHeap(), 0, size ))) break; - volname[0] = 0; + memset( &input, 0, sizeof(input) ); + input.letter = root[0]; - retval = GetVolumeInformationW(devices, volname, sizeof(volname)/sizeof(WCHAR), - &serial, NULL, NULL, NULL, 0); - if(!retval) + if (DeviceIoControl( mgr, IOCTL_MOUNTMGR_QUERY_UNIX_DRIVE, &input, sizeof(input), + data, size, NULL, NULL )) { - WINE_ERR("GetVolumeInformation() for %s failed, setting serial to 0\n", - wine_dbgstr_w(devices)); - PRINTERROR(); - serial = 0; - } - - WINE_TRACE("serial: '0x%X'\n", serial); - - /* QueryDosDevice() requires no trailing backslash */ - simplepath[0] = devices[0]; - simplepath[1] = ':'; - simplepath[2] = 0; - QueryDosDevice(simplepath, targetpath, sizeof(targetpath)); - - /* targetpath may have forward slashes rather than backslashes, so correct */ - c = targetpath; - do if (*c == '\\') *c = '/'; while (*c++); + char *unixpath = NULL, *device = NULL; + WCHAR volname[MAX_PATH]; + DWORD serial; - add_drive(*devices, targetpath, volname, serial, get_drive_type(devices[0]) ); + if (data->mount_point_offset) unixpath = (char *)data + data->mount_point_offset; + if (data->device_offset) device = (char *)data + data->device_offset; - len -= lstrlenW(devices); - devices += lstrlenW(devices); - - /* skip over any nulls */ - while ((*devices == 0) && (len)) + if (!GetVolumeInformationW( root, volname, sizeof(volname)/sizeof(WCHAR), + &serial, NULL, NULL, NULL, 0 )) + { + volname[0] = 0; + serial = 0; + } + if (unixpath) /* FIXME: handle unmounted drives too */ + add_drive( root[0], unixpath, device, volname, serial, get_drive_type(root[0]) ); + root[0]++; + } + else { - len--; - devices++; + if (GetLastError() == ERROR_MORE_DATA) size = data->size; + else root[0]++; /* skip this drive */ } - - drivecount++; + HeapFree( GetProcessHeap(), 0, data ); } - /* Find all the broken symlinks we might have and add them as well. */ - - len = strlen(config_dir) + sizeof("/dosdevices/a:"); - if (!(path = HeapAlloc(GetProcessHeap(), 0, len))) - return; + /* reset modified flags */ + for (i = 0; i < 26; i++) drives[i].modified = FALSE; - strcpy(path, config_dir); - strcat(path, "/dosdevices/a:"); - - for (i = 0; i < 26; i++) - { - char buff[MAX_PATH]; - struct stat st; - int cnt; - - if (drives[i].in_use) continue; - path[len - 3] = 'a' + i; - - if (lstat(path, &st) == -1 || !S_ISLNK(st.st_mode)) continue; - if ((cnt = readlink(path, buff, sizeof(buff))) == -1) continue; - buff[cnt] = '\0'; - - WINE_TRACE("found broken symlink %s -> %s\n", path, buff); - add_drive('A' + i, buff, NULL, 0, DRIVE_UNKNOWN); - - drivecount++; - } - - WINE_TRACE("found %d drives\n", drivecount); - - HeapFree(GetProcessHeap(), 0, path); - HeapFree(GetProcessHeap(), 0, dev); + CloseHandle( mgr ); + return TRUE; } /* some of this code appears to be broken by bugs in Wine: the label @@ -381,115 +314,59 @@ void load_drives(void) void apply_drive_changes(void) { int i; - CHAR devicename[4]; - CHAR targetpath[256]; - BOOL foundDrive; - WCHAR volumeNameBuffer[512]; - DWORD serialNumber; - int retval; - BOOL defineDevice; + HANDLE mgr; + DWORD len; + struct mountmgr_unix_drive *ioctl; WINE_TRACE("\n"); + if ((mgr = open_mountmgr()) == INVALID_HANDLE_VALUE) return; + /* add each drive and remove as we go */ for(i = 0; i < 26; i++) { - defineDevice = FALSE; - foundDrive = FALSE; - volumeNameBuffer[0] = 0; - serialNumber = 0; - snprintf(devicename, sizeof(devicename), "%c:", 'A' + i); - - /* get a drive */ - if(QueryDosDevice(devicename, targetpath, sizeof(targetpath))) - { - char *cursor; - - /* correct the slashes in the path to be UNIX style */ - while ((cursor = strchr(targetpath, '\\'))) *cursor = '/'; - - foundDrive = TRUE; - } + if (!drives[i].modified) continue; + drives[i].modified = FALSE; - /* if we found a drive and have a drive then compare things */ - if(foundDrive && drives[i].in_use) + len = sizeof(*ioctl); + if (drives[i].in_use) { - WCHAR deviceW[4] = {'a',':','\\',0}; - WINE_TRACE("drives[i].letter: '%c'\n", drives[i].letter); - - deviceW[0] = 'A' + i; - retval = GetVolumeInformationW(deviceW, volumeNameBuffer, sizeof(volumeNameBuffer)/sizeof(WCHAR), - &serialNumber, NULL, NULL, NULL, 0 ); - if(!retval) - { - WINE_TRACE(" GetVolumeInformation() for '%s' failed\n", devicename); - PRINTERROR(); - volumeNameBuffer[0] = '\0'; - } - - WINE_TRACE(" current path: '%s', new path: '%s'\n", - targetpath, drives[i].unixpath); - - /* compare to what we have */ - /* do we have the same targetpath? */ - if(strcmp(drives[i].unixpath, targetpath)) - { - defineDevice = TRUE; - WINE_TRACE(" making changes to drive '%s'\n", devicename); - } - else - { - WINE_TRACE(" no changes to drive '%s'\n", devicename); - } + len += strlen(drives[i].unixpath) + 1; + if (drives[i].device) len += strlen(drives[i].device) + 1; } - else if(foundDrive && !drives[i].in_use) + if (!(ioctl = HeapAlloc( GetProcessHeap(), 0, len ))) continue; + ioctl->size = len; + ioctl->letter = 'a' + i; + ioctl->device_offset = 0; + if (drives[i].in_use) { - /* remove this drive */ - if(!DefineDosDevice(DDD_REMOVE_DEFINITION, devicename, drives[i].unixpath)) - { - WINE_ERR("unable to remove devicename of '%s', targetpath of '%s'\n", - devicename, drives[i].unixpath); - PRINTERROR(); - } - else + char *ptr = (char *)(ioctl + 1); + + ioctl->type = drives[i].type; + strcpy( ptr, drives[i].unixpath ); + ioctl->mount_point_offset = ptr - (char *)ioctl; + if (drives[i].device) { - WINE_TRACE("removed devicename of '%s', targetpath of '%s'\n", - devicename, drives[i].unixpath); + ptr += strlen(ptr) + 1; + strcpy( ptr, drives[i].device ); + ioctl->device_offset = ptr - (char *)ioctl; } - - set_drive_type( drives[i].letter, DRIVE_UNKNOWN ); - continue; } - else if(drives[i].in_use) /* foundDrive must be false from the above check */ + else { - defineDevice = TRUE; + ioctl->type = DRIVE_NO_ROOT_DIR; + ioctl->mount_point_offset = 0; } - /* adding and modifying are the same steps */ - if(defineDevice) + if (DeviceIoControl( mgr, IOCTL_MOUNTMGR_DEFINE_UNIX_DRIVE, ioctl, len, NULL, 0, NULL, NULL )) { - /* define this drive */ - /* DefineDosDevice() requires that NO trailing slash be present */ - snprintf(devicename, sizeof(devicename), "%c:", 'A' + i); - if(!DefineDosDevice(DDD_RAW_TARGET_PATH, devicename, drives[i].unixpath)) - { - WINE_ERR(" unable to define devicename of '%s', targetpath of '%s'\n", - devicename, drives[i].unixpath); - PRINTERROR(); - } - else - { - WINE_TRACE(" added devicename of '%s', targetpath of '%s'\n", - devicename, drives[i].unixpath); - } - } - - if (!drives[i].label || lstrcmpW(drives[i].label, volumeNameBuffer)) set_drive_label( drives[i].letter, drives[i].label ); - - if (drives[i].serial != serialNumber) - set_drive_serial( drives[i].letter, drives[i].serial ); - - set_drive_type( drives[i].letter, drives[i].type ); + if (drives[i].in_use) set_drive_serial( drives[i].letter, drives[i].serial ); + WINE_TRACE( "set drive %c: to %s type %u\n", 'a' + i, + wine_dbgstr_a(drives[i].unixpath), drives[i].type ); + } + else WINE_WARN( "failed to set drive %c: to %s type %u err %u\n", 'a' + i, + wine_dbgstr_a(drives[i].unixpath), drives[i].type, GetLastError() ); } + CloseHandle( mgr ); } diff --git a/programs/winecfg/drivedetect.c b/programs/winecfg/drivedetect.c index 8b9911a3c85..1c03b6f9626 100644 --- a/programs/winecfg/drivedetect.c +++ b/programs/winecfg/drivedetect.c @@ -22,6 +22,7 @@ #include "config.h" #include "wine/port.h" +#include #include #ifdef HAVE_MNTENT_H #include @@ -234,7 +235,7 @@ static void ensure_root_is_mapped(void) { if (!drives[letter - 'A'].in_use) { - add_drive(letter, "/", NULL, 0, DRIVE_FIXED); + add_drive(letter, "/", NULL, NULL, 0, DRIVE_FIXED); WINE_TRACE("allocated drive %c as the root drive\n", letter); break; } @@ -263,7 +264,7 @@ static void ensure_home_is_mapped(void) { if (!drives[letter - 'A'].in_use) { - add_drive(letter, home, NULL, 0, DRIVE_FIXED); + add_drive(letter, home, NULL, NULL, 0, DRIVE_FIXED); WINE_TRACE("allocated drive %c as the user's home directory\n", letter); break; } @@ -291,7 +292,7 @@ static void ensure_drive_c_is_mapped(void) WCHAR label[64]; LoadStringW (GetModuleHandle (NULL), IDS_SYSTEM_DRIVE_LABEL, label, sizeof(label)/sizeof(label[0])); - add_drive('C', "../drive_c", label, 0, DRIVE_FIXED); + add_drive('C', "../drive_c", NULL, label, 0, DRIVE_FIXED); } else { @@ -329,7 +330,8 @@ int autodetect_drives(void) { char letter; int type; - + char *device = NULL; + WINE_TRACE("ent->mnt_dir=%s\n", ent->mnt_dir); if (should_ignore_fstype(ent->mnt_type)) continue; @@ -354,8 +356,11 @@ int autodetect_drives(void) return FALSE; } - WINE_TRACE("adding drive %c for %s, type %s\n", letter, ent->mnt_dir, ent->mnt_type); - add_drive(letter, ent->mnt_dir, NULL, 0, type); + if (type == DRIVE_CDROM) device = ent->mnt_fsname; + + WINE_TRACE("adding drive %c for %s, device %s, type %s\n", + letter, ent->mnt_dir, device, ent->mnt_type); + add_drive(letter, ent->mnt_dir, device, NULL, 0, type); /* working_mask is a map of the drive letters still available. */ working_mask &= ~DRIVE_MASK_BIT(letter); diff --git a/programs/winecfg/driveui.c b/programs/winecfg/driveui.c index 61fba5f6fb0..a15d59982ff 100644 --- a/programs/winecfg/driveui.c +++ b/programs/winecfg/driveui.c @@ -315,9 +315,9 @@ static void on_add_click(HWND dialog) WCHAR label[64]; LoadStringW (GetModuleHandle (NULL), IDS_SYSTEM_DRIVE_LABEL, label, sizeof(label)/sizeof(label[0])); - add_drive(new, "../drive_c", label, 0, DRIVE_FIXED); + add_drive(new, "../drive_c", NULL, label, 0, DRIVE_FIXED); } - else add_drive(new, "/", NULL, 0, DRIVE_UNKNOWN); + else add_drive(new, "/", NULL, NULL, 0, DRIVE_UNKNOWN); fill_drives_list(dialog); @@ -334,6 +334,7 @@ static void on_add_click(HWND dialog) SetFocus(GetDlgItem(dialog, IDC_LIST_DRIVES)); update_controls(dialog); + SendMessage(GetParent(dialog), PSM_CHANGED, (WPARAM) dialog, 0); } static void on_remove_click(HWND dialog) @@ -372,6 +373,7 @@ static void on_remove_click(HWND dialog) SetFocus(GetDlgItem(dialog, IDC_LIST_DRIVES)); update_controls(dialog); + SendMessage(GetParent(dialog), PSM_CHANGED, (WPARAM) dialog, 0); } static void update_controls(HWND dialog) @@ -485,6 +487,7 @@ static void on_edit_changed(HWND dialog, WORD id) WCHAR *label = get_textW(dialog, id); HeapFree(GetProcessHeap(), 0, current_drive->label); current_drive->label = label; + current_drive->modified = TRUE; WINE_TRACE("set label to %s\n", wine_dbgstr_w(current_drive->label)); @@ -500,6 +503,7 @@ static void on_edit_changed(HWND dialog, WORD id) path = get_text(dialog, id); HeapFree(GetProcessHeap(), 0, current_drive->unixpath); current_drive->unixpath = path ? path : strdupA("drive_c"); + current_drive->modified = TRUE; WINE_TRACE("set path to %s\n", current_drive->unixpath); @@ -517,6 +521,7 @@ static void on_edit_changed(HWND dialog, WORD id) serial = get_text(dialog, id); current_drive->serial = strtoul( serial, NULL, 16 ); + current_drive->modified = TRUE; WINE_TRACE("set serial to %08x\n", current_drive->serial); @@ -756,6 +761,7 @@ DriveDlgProc (HWND dialog, UINT msg, WPARAM wParam, LPARAM lParam) str = get_textW(dialog, IDC_EDIT_SERIAL); current_drive->serial = strtoulW( str, NULL, 16 ); + current_drive->modified = TRUE; /* TODO: we don't have a device at this point */ @@ -787,6 +793,7 @@ DriveDlgProc (HWND dialog, UINT msg, WPARAM wParam, LPARAM lParam) enable_labelserial_box(dialog, mode); current_drive->type = type_pairs[selection].sCode; + current_drive->modified = TRUE; break; } diff --git a/programs/winecfg/winecfg.h b/programs/winecfg/winecfg.h index 91cb7b31e77..43fb27842f8 100644 --- a/programs/winecfg/winecfg.h +++ b/programs/winecfg/winecfg.h @@ -90,24 +90,27 @@ INT_PTR CALLBACK AudioDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPara INT_PTR CALLBACK ThemeDlgProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); /* Drive management */ -void load_drives(void); +BOOL load_drives(void); int autodetect_drives(void); struct drive { char letter; char *unixpath; + char *device; WCHAR *label; DWORD serial; DWORD type; /* one of the DRIVE_ constants from winbase.h */ BOOL in_use; + BOOL modified; }; #define DRIVE_MASK_BIT(B) (1 << (toupper(B) - 'A')) long drive_available_mask(char letter); -BOOL add_drive(char letter, const char *targetpath, const WCHAR *label, DWORD serial, DWORD type); +BOOL add_drive(char letter, const char *targetpath, const char *device, + const WCHAR *label, DWORD serial, DWORD type); void delete_drive(struct drive *pDrive); void apply_drive_changes(void); BOOL browse_for_unix_folder(HWND dialog, WCHAR *pszPath); diff --git a/programs/wineconsole/user.c b/programs/wineconsole/user.c index 03157aa12e4..01950a3af86 100644 --- a/programs/wineconsole/user.c +++ b/programs/wineconsole/user.c @@ -447,7 +447,7 @@ HFONT WCUSER_CopyFont(struct config_data* config, HWND hWnd, const LOGFONT* lf, * - the width of all characters in the font * This isn't true in Wine. As a temporary workaround, we get as the width of the * cell, the width of the first character in the font, after checking that all - * characters in the font have the same width (I hear paranoïa coming) + * characters in the font have the same width (I hear paranoïa coming) * when this gets fixed, the code should be using tm.tmAveCharWidth * or tm.tmMaxCharWidth as the cell width. */ diff --git a/programs/winedbg/be_alpha.c b/programs/winedbg/be_alpha.c index e3072ae24c8..aeeb79a84e4 100644 --- a/programs/winedbg/be_alpha.c +++ b/programs/winedbg/be_alpha.c @@ -1,7 +1,7 @@ /* * Debugger Alpha specific functions * - * Copyright 2004 Vincent Béron + * Copyright 2004 Vincent Béron * * 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/programs/winedbg/be_x86_64.c b/programs/winedbg/be_x86_64.c index 75dc933fc31..f2dcc1a85df 100644 --- a/programs/winedbg/be_x86_64.c +++ b/programs/winedbg/be_x86_64.c @@ -1,7 +1,7 @@ /* * Debugger x86_64 specific functions * - * Copyright 2004 Vincent Béron + * Copyright 2004 Vincent Béron * * 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/programs/winedbg/dbg.y b/programs/winedbg/dbg.y index 1d0eba3dd9a..190c1063633 100644 --- a/programs/winedbg/dbg.y +++ b/programs/winedbg/dbg.y @@ -209,6 +209,8 @@ set_command: | tSET '-' tIDENTIFIER { info_wine_dbg_channel(FALSE, NULL, $3); } | tSET tIDENTIFIER '+' tIDENTIFIER { info_wine_dbg_channel(TRUE, $2, $4); } | tSET tIDENTIFIER '-' tIDENTIFIER { info_wine_dbg_channel(FALSE, $2, $4); } + | tSET '!' tIDENTIFIER '+' { dbg_set_option($3, TRUE); } + | tSET '!' tIDENTIFIER '-' { dbg_set_option($3, FALSE); } ; x_command: diff --git a/programs/winedbg/debugger.h b/programs/winedbg/debugger.h index a8a3fc3288d..d7ea3c968a0 100644 --- a/programs/winedbg/debugger.h +++ b/programs/winedbg/debugger.h @@ -216,7 +216,7 @@ struct dbg_process DWORD pid; const struct be_process_io* process_io; void* pio_data; - const char* imageName; + const WCHAR* imageName; struct dbg_thread* threads; unsigned continue_on_first_exception : 1, active_debuggee : 1; @@ -359,7 +359,7 @@ extern BOOL memory_get_current_pc(ADDRESS64* address); extern BOOL memory_get_current_stack(ADDRESS64* address); extern BOOL memory_get_current_frame(ADDRESS64* address); extern BOOL memory_get_string(struct dbg_process* pcs, void* addr, BOOL in_debuggee, BOOL unicode, char* buffer, int size); -extern BOOL memory_get_string_indirect(struct dbg_process* pcs, void* addr, BOOL unicode, char* buffer, int size); +extern BOOL memory_get_string_indirect(struct dbg_process* pcs, void* addr, BOOL unicode, WCHAR* buffer, int size); extern BOOL memory_get_register(DWORD regno, DWORD** value, char* buffer, int len); extern void memory_disassemble(const struct dbg_lvalue*, const struct dbg_lvalue*, int instruction_count); extern BOOL memory_disasm_one_insn(ADDRESS64* addr); @@ -430,6 +430,7 @@ extern struct dbg_type types_find_type(unsigned long linear, const char* name, /* winedbg.c */ extern void dbg_outputA(const char* buffer, int len); extern void dbg_outputW(const WCHAR* buffer, int len); +extern const char* dbg_W2A(const WCHAR* buffer, unsigned len); #ifdef __GNUC__ extern int dbg_printf(const char* format, ...) __attribute__((format (printf,1,2))); #else @@ -439,15 +440,17 @@ extern const struct dbg_internal_var* dbg_get_internal_var(const char*); extern BOOL dbg_interrupt_debuggee(void); extern unsigned dbg_num_processes(void); extern struct dbg_process* dbg_add_process(const struct be_process_io* pio, DWORD pid, HANDLE h); -extern void dbg_set_process_name(struct dbg_process* p, const char* name); +extern void dbg_set_process_name(struct dbg_process* p, const WCHAR* name); extern struct dbg_process* dbg_get_process(DWORD pid); extern struct dbg_process* dbg_get_process_h(HANDLE handle); extern void dbg_del_process(struct dbg_process* p); struct dbg_thread* dbg_add_thread(struct dbg_process* p, DWORD tid, HANDLE h, void* teb); extern struct dbg_thread* dbg_get_thread(struct dbg_process* p, DWORD tid); extern void dbg_del_thread(struct dbg_thread* t); -extern BOOL dbg_init(HANDLE hProc, const char* in, BOOL invade); +extern BOOL dbg_init(HANDLE hProc, const WCHAR* in, BOOL invade); +extern BOOL dbg_load_module(HANDLE hProc, HANDLE hFile, const WCHAR* name, DWORD base, DWORD size); extern BOOL dbg_get_debuggee_info(HANDLE hProcess, IMAGEHLP_MODULE* imh_mod); +extern void dbg_set_option(const char*, BOOL); /* gdbproxy.c */ extern int gdb_main(int argc, char* argv[]); diff --git a/programs/winedbg/gdbproxy.c b/programs/winedbg/gdbproxy.c index dc80a842036..9026b372693 100644 --- a/programs/winedbg/gdbproxy.c +++ b/programs/winedbg/gdbproxy.c @@ -480,7 +480,10 @@ static BOOL handle_exception(struct gdb_context* gdbctx, EXCEPTION_DEBUG_INFO* e static void handle_debug_event(struct gdb_context* gdbctx, DEBUG_EVENT* de) { - char buffer[256]; + union { + char bufferA[256]; + WCHAR buffer[256]; + } u; dbg_curr_thread = dbg_get_thread(gdbctx->process, de->dwThreadId); @@ -493,19 +496,20 @@ static void handle_debug_event(struct gdb_context* gdbctx, DEBUG_EVENT* de) memory_get_string_indirect(gdbctx->process, de->u.CreateProcessInfo.lpImageName, de->u.CreateProcessInfo.fUnicode, - buffer, sizeof(buffer)); - dbg_set_process_name(gdbctx->process, buffer); + u.buffer, sizeof(u.buffer) / sizeof(WCHAR)); + dbg_set_process_name(gdbctx->process, u.buffer); if (gdbctx->trace & GDBPXY_TRC_WIN32_EVENT) fprintf(stderr, "%04x:%04x: create process '%s'/%p @%p (%u<%u>)\n", de->dwProcessId, de->dwThreadId, - buffer, de->u.CreateProcessInfo.lpImageName, + dbg_W2A(u.buffer, -1), + de->u.CreateProcessInfo.lpImageName, de->u.CreateProcessInfo.lpStartAddress, de->u.CreateProcessInfo.dwDebugInfoFileOffset, de->u.CreateProcessInfo.nDebugInfoSize); /* de->u.CreateProcessInfo.lpStartAddress; */ - if (!dbg_init(gdbctx->process->handle, buffer, TRUE)) + if (!dbg_init(gdbctx->process->handle, u.buffer, TRUE)) fprintf(stderr, "Couldn't initiate DbgHelp\n"); if (gdbctx->trace & GDBPXY_TRC_WIN32_EVENT) @@ -524,23 +528,24 @@ static void handle_debug_event(struct gdb_context* gdbctx, DEBUG_EVENT* de) memory_get_string_indirect(gdbctx->process, de->u.LoadDll.lpImageName, de->u.LoadDll.fUnicode, - buffer, sizeof(buffer)); + u.buffer, sizeof(u.buffer) / sizeof(WCHAR)); if (gdbctx->trace & GDBPXY_TRC_WIN32_EVENT) fprintf(stderr, "%04x:%04x: loads DLL %s @%p (%u<%u>)\n", de->dwProcessId, de->dwThreadId, - buffer, de->u.LoadDll.lpBaseOfDll, + dbg_W2A(u.buffer, -1), + de->u.LoadDll.lpBaseOfDll, de->u.LoadDll.dwDebugInfoFileOffset, de->u.LoadDll.nDebugInfoSize); - SymLoadModule(gdbctx->process->handle, de->u.LoadDll.hFile, buffer, NULL, - (unsigned long)de->u.LoadDll.lpBaseOfDll, 0); + dbg_load_module(gdbctx->process->handle, de->u.LoadDll.hFile, u.buffer, + (DWORD_PTR)de->u.LoadDll.lpBaseOfDll, 0); break; case UNLOAD_DLL_DEBUG_EVENT: if (gdbctx->trace & GDBPXY_TRC_WIN32_EVENT) fprintf(stderr, "%08x:%08x: unload DLL @%p\n", de->dwProcessId, de->dwThreadId, de->u.UnloadDll.lpBaseOfDll); - SymUnloadModule(gdbctx->process->handle, - (unsigned long)de->u.UnloadDll.lpBaseOfDll); + SymUnloadModule(gdbctx->process->handle, + (DWORD_PTR)de->u.UnloadDll.lpBaseOfDll); break; case EXCEPTION_DEBUG_EVENT: @@ -594,10 +599,10 @@ static void handle_debug_event(struct gdb_context* gdbctx, DEBUG_EVENT* de) assert(dbg_curr_thread); memory_get_string(gdbctx->process, de->u.DebugString.lpDebugStringData, TRUE, - de->u.DebugString.fUnicode, buffer, sizeof(buffer)); + de->u.DebugString.fUnicode, u.bufferA, sizeof(u.bufferA)); if (gdbctx->trace & GDBPXY_TRC_WIN32_EVENT) fprintf(stderr, "%08x:%08x: output debug string (%s)\n", - de->dwProcessId, de->dwThreadId, buffer); + de->dwProcessId, de->dwThreadId, u.bufferA); break; case RIP_EVENT: diff --git a/programs/winedbg/info.c b/programs/winedbg/info.c index fe0292d00ef..fd160d77a30 100644 --- a/programs/winedbg/info.c +++ b/programs/winedbg/info.c @@ -501,7 +501,8 @@ void info_win32_threads(void) struct dbg_process* p = dbg_get_process(entry.th32OwnerProcessID); dbg_printf("%08x%s %s\n", - entry.th32OwnerProcessID, p ? " (D)" : "", p ? p->imageName : ""); + entry.th32OwnerProcessID, p ? " (D)" : "", + p ? dbg_W2A(p->imageName, -1) : ""); lastProcessId = entry.th32OwnerProcessID; } dbg_printf("\t%08x %4d%s\n", diff --git a/programs/winedbg/memory.c b/programs/winedbg/memory.c index f605421e660..c6174fe9e35 100644 --- a/programs/winedbg/memory.c +++ b/programs/winedbg/memory.c @@ -259,16 +259,32 @@ BOOL memory_get_string(struct dbg_process* pcs, void* addr, BOOL in_debuggee, return TRUE; } -BOOL memory_get_string_indirect(struct dbg_process* pcs, void* addr, BOOL unicode, char* buffer, int size) +BOOL memory_get_string_indirect(struct dbg_process* pcs, void* addr, BOOL unicode, WCHAR* buffer, int size) { void* ad; SIZE_T sz; buffer[0] = 0; - if (addr && + if (addr && pcs->process_io->read(pcs->handle, addr, &ad, sizeof(ad), &sz) && sz == sizeof(ad) && ad) { - return memory_get_string(pcs, ad, TRUE, unicode, buffer, size); + LPSTR buff; + BOOL ret; + + if (unicode) + ret = pcs->process_io->read(pcs->handle, ad, buffer, size * sizeof(WCHAR), &sz) && sz != 0; + else + { + if ((buff = HeapAlloc(GetProcessHeap(), 0, size))) + { + ret = pcs->process_io->read(pcs->handle, ad, buff, size, &sz) && sz != 0; + MultiByteToWideChar(CP_ACP, 0, buff, sz, buffer, size); + HeapFree(GetProcessHeap(), 0, buff); + } + else ret = FALSE; + } + if (size) buffer[size-1] = 0; + return ret; } return FALSE; } diff --git a/programs/winedbg/stack.c b/programs/winedbg/stack.c index 63103c13b3f..2f863896626 100644 --- a/programs/winedbg/stack.c +++ b/programs/winedbg/stack.c @@ -3,7 +3,7 @@ * * Copyright 1995 Alexandre Julliard * Copyright 1996 Eric Youngdale - * Copyright 1999 Ove Kåven + * Copyright 1999 Ove Kåven * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -391,7 +391,8 @@ static void backtrace_all(void) } dbg_printf("\nBacktracing for thread %04x in process %04x (%s):\n", - entry.th32ThreadID, dbg_curr_pid, dbg_curr_process->imageName); + entry.th32ThreadID, dbg_curr_pid, + dbg_W2A(dbg_curr_process->imageName, -1)); backtrace_tid(dbg_curr_process, entry.th32ThreadID); } while (Thread32Next(snapshot, &entry)); diff --git a/programs/winedbg/tgt_active.c b/programs/winedbg/tgt_active.c index 75f22ade897..9cb0a56b915 100644 --- a/programs/winedbg/tgt_active.c +++ b/programs/winedbg/tgt_active.c @@ -30,6 +30,7 @@ #include "winternl.h" #include "wine/debug.h" #include "wine/exception.h" +#include "wine/unicode.h" WINE_DEFAULT_DEBUG_CHANNEL(winedbg); @@ -418,16 +419,19 @@ static DWORD dbg_handle_exception(const EXCEPTION_RECORD* rec, BOOL first_chance static BOOL tgt_process_active_close_process(struct dbg_process* pcs, BOOL kill); static void fetch_module_name(void* name_addr, BOOL unicode, void* mod_addr, - char* buffer, size_t bufsz, BOOL is_pcs) + WCHAR* buffer, size_t bufsz, BOOL is_pcs) { + static WCHAR pcspid[] = {'P','r','o','c','e','s','s','_','%','0','8','x',0}; + static WCHAR dlladdr[] = {'D','L','L','_','%','0','8','l','x',0}; + memory_get_string_indirect(dbg_curr_process, name_addr, unicode, buffer, bufsz); if (!buffer[0] && - !GetModuleFileNameExA(dbg_curr_process->handle, mod_addr, buffer, bufsz)) + !GetModuleFileNameExW(dbg_curr_process->handle, mod_addr, buffer, bufsz)) { if (is_pcs) { HMODULE h; - WORD (WINAPI *gpif)(HANDLE, LPSTR, DWORD); + WORD (WINAPI *gpif)(HANDLE, LPWSTR, DWORD); /* On Windows, when we get the process creation debug event for a process * created by winedbg, the modules' list is not initialized yet. Hence, @@ -436,18 +440,21 @@ static void fetch_module_name(void* name_addr, BOOL unicode, void* mod_addr, * give us the expected result */ if (!(h = GetModuleHandleA("psapi")) || - !(gpif = (void*)GetProcAddress(h, "GetProcessImageFileName")) || + !(gpif = (void*)GetProcAddress(h, "GetProcessImageFileNameW")) || !(gpif)(dbg_curr_process->handle, buffer, bufsz)) - snprintf(buffer, bufsz, "Process_%08x", dbg_curr_pid); + snprintfW(buffer, bufsz, pcspid, dbg_curr_pid); } else - snprintf(buffer, bufsz, "DLL_%p", mod_addr); + snprintfW(buffer, bufsz, dlladdr, (unsigned long)mod_addr); } } static unsigned dbg_handle_debug_event(DEBUG_EVENT* de) { - char buffer[256]; + union { + char bufferA[256]; + WCHAR buffer[256]; + } u; DWORD cont = DBG_CONTINUE; dbg_curr_pid = de->dwProcessId; @@ -499,20 +506,21 @@ static unsigned dbg_handle_debug_event(DEBUG_EVENT* de) fetch_module_name(de->u.CreateProcessInfo.lpImageName, de->u.CreateProcessInfo.fUnicode, de->u.CreateProcessInfo.lpBaseOfImage, - buffer, sizeof(buffer), TRUE); + u.buffer, sizeof(u.buffer) / sizeof(WCHAR), TRUE); WINE_TRACE("%04x:%04x: create process '%s'/%p @%p (%u<%u>)\n", de->dwProcessId, de->dwThreadId, - buffer, de->u.CreateProcessInfo.lpImageName, + wine_dbgstr_w(u.buffer), + de->u.CreateProcessInfo.lpImageName, de->u.CreateProcessInfo.lpStartAddress, de->u.CreateProcessInfo.dwDebugInfoFileOffset, de->u.CreateProcessInfo.nDebugInfoSize); - dbg_set_process_name(dbg_curr_process, buffer); + dbg_set_process_name(dbg_curr_process, u.buffer); - if (!dbg_init(dbg_curr_process->handle, buffer, FALSE)) + if (!dbg_init(dbg_curr_process->handle, u.buffer, FALSE)) dbg_printf("Couldn't initiate DbgHelp\n"); - if (!SymLoadModule(dbg_curr_process->handle, de->u.CreateProcessInfo.hFile, buffer, NULL, - (unsigned long)de->u.CreateProcessInfo.lpBaseOfImage, 0)) + if (!dbg_load_module(dbg_curr_process->handle, de->u.CreateProcessInfo.hFile, u.buffer, + (DWORD_PTR)de->u.CreateProcessInfo.lpBaseOfImage, 0)) dbg_printf("couldn't load main module (%u)\n", GetLastError()); WINE_TRACE("%04x:%04x: create thread I @%p\n", @@ -593,22 +601,22 @@ static unsigned dbg_handle_debug_event(DEBUG_EVENT* de) fetch_module_name(de->u.LoadDll.lpImageName, de->u.LoadDll.fUnicode, de->u.LoadDll.lpBaseOfDll, - buffer, sizeof(buffer), FALSE); + u.buffer, sizeof(u.buffer) / sizeof(WCHAR), FALSE); WINE_TRACE("%04x:%04x: loads DLL %s @%p (%u<%u>)\n", de->dwProcessId, de->dwThreadId, - buffer, de->u.LoadDll.lpBaseOfDll, + wine_dbgstr_w(u.buffer), de->u.LoadDll.lpBaseOfDll, de->u.LoadDll.dwDebugInfoFileOffset, de->u.LoadDll.nDebugInfoSize); - SymLoadModule(dbg_curr_process->handle, de->u.LoadDll.hFile, buffer, NULL, - (unsigned long)de->u.LoadDll.lpBaseOfDll, 0); + dbg_load_module(dbg_curr_process->handle, de->u.LoadDll.hFile, u.buffer, + (DWORD_PTR)de->u.LoadDll.lpBaseOfDll, 0); break_set_xpoints(FALSE); break_check_delayed_bp(); break_set_xpoints(TRUE); if (DBG_IVAR(BreakOnDllLoad)) { dbg_printf("Stopping on DLL %s loading at 0x%08lx\n", - buffer, (unsigned long)de->u.LoadDll.lpBaseOfDll); + dbg_W2A(u.buffer, -1), (unsigned long)de->u.LoadDll.lpBaseOfDll); if (dbg_fetch_context()) cont = 0; } break; @@ -631,9 +639,9 @@ static unsigned dbg_handle_debug_event(DEBUG_EVENT* de) memory_get_string(dbg_curr_process, de->u.DebugString.lpDebugStringData, TRUE, - de->u.DebugString.fUnicode, buffer, sizeof(buffer)); + de->u.DebugString.fUnicode, u.bufferA, sizeof(u.bufferA)); WINE_TRACE("%04x:%04x: output debug string (%s)\n", - de->dwProcessId, de->dwThreadId, buffer); + de->dwProcessId, de->dwThreadId, u.bufferA); break; case RIP_EVENT: diff --git a/programs/winedbg/tgt_minidump.c b/programs/winedbg/tgt_minidump.c index 8d623dcb9e0..a9f92dbbff7 100644 --- a/programs/winedbg/tgt_minidump.c +++ b/programs/winedbg/tgt_minidump.c @@ -172,9 +172,10 @@ static enum dbg_start minidump_do_reload(struct tgt_process_minidump_data* data) MINIDUMP_MODULE_LIST* mml; MINIDUMP_MODULE* mm; MINIDUMP_STRING* mds; - char exec_name[1024]; + WCHAR exec_name[1024]; WCHAR nameW[1024]; unsigned len; + static WCHAR default_exec_name[] = {'<','m','i','n','i','d','u','m','p','-','e','x','e','c','>',0}; /* fetch PID */ if (MiniDumpReadDumpStream(data->mapping, MiscInfoStream, &dir, &stream, &size)) @@ -185,25 +186,24 @@ static enum dbg_start minidump_do_reload(struct tgt_process_minidump_data* data) } /* fetch executable name (it's normally the first one in module list) */ - strcpy(exec_name, ""); /* default */ + lstrcpyW(exec_name, default_exec_name); if (MiniDumpReadDumpStream(data->mapping, ModuleListStream, &dir, &stream, &size)) { mml = (MINIDUMP_MODULE_LIST*)stream; if (mml->NumberOfModules) { - char* ptr; + WCHAR* ptr; mm = &mml->Modules[0]; mds = (MINIDUMP_STRING*)((char*)data->mapping + mm->ModuleNameRva); - len = WideCharToMultiByte(CP_ACP, 0, mds->Buffer, - mds->Length / sizeof(WCHAR), - exec_name, sizeof(exec_name) - 1, NULL, NULL); + len = mds->Length / 2; + memcpy(exec_name, mds->Buffer, mds->Length); exec_name[len] = 0; for (ptr = exec_name + len - 1; ptr >= exec_name; ptr--) { if (*ptr == '/' || *ptr == '\\') { - memmove(exec_name, ptr + 1, strlen(ptr + 1) + 1); + memmove(exec_name, ptr + 1, (lstrlenW(ptr + 1) + 1) * sizeof(WCHAR)); break; } } @@ -264,7 +264,7 @@ static enum dbg_start minidump_do_reload(struct tgt_process_minidump_data* data) break; } dbg_printf(" %s was running on #%d %s CPU%s", - exec_name, msi->u.s.NumberOfProcessors, str, + dbg_W2A(exec_name, -1), msi->u.s.NumberOfProcessors, str, msi->u.s.NumberOfProcessors < 2 ? "" : "s"); switch (msi->MajorVersion) { @@ -331,8 +331,8 @@ static enum dbg_start minidump_do_reload(struct tgt_process_minidump_data* data) nameW[mds->Length / sizeof(WCHAR)] = 0; if (SymFindFileInPathW(hProc, NULL, nameW, (void*)(DWORD_PTR)mm->CheckSum, 0, 0, SSRVOPT_DWORD, buffer, validate_file, NULL)) - SymLoadModuleExW(hProc, NULL, buffer, NULL, get_addr64(mm->BaseOfImage), - mm->SizeOfImage, NULL, 0); + dbg_load_module(hProc, NULL, buffer, get_addr64(mm->BaseOfImage), + mm->SizeOfImage); else SymLoadModuleExW(hProc, NULL, nameW, NULL, get_addr64(mm->BaseOfImage), mm->SizeOfImage, NULL, SLMFLAG_VIRTUAL); @@ -350,11 +350,11 @@ static enum dbg_start minidump_do_reload(struct tgt_process_minidump_data* data) nameW[mds->Length / sizeof(WCHAR)] = 0; if (SymFindFileInPathW(hProc, NULL, nameW, (void*)(DWORD_PTR)mm->TimeDateStamp, mm->SizeOfImage, 0, SSRVOPT_DWORD, buffer, validate_file, NULL)) - SymLoadModuleExW(hProc, NULL, buffer, NULL, get_addr64(mm->BaseOfImage), - mm->SizeOfImage, NULL, 0); + dbg_load_module(hProc, NULL, buffer, get_addr64(mm->BaseOfImage), + mm->SizeOfImage); else if (is_pe_module_embedded(data, mm)) - SymLoadModuleExW(hProc, NULL, nameW, NULL, get_addr64(mm->BaseOfImage), - mm->SizeOfImage, NULL, 0); + dbg_load_module(hProc, NULL, nameW, get_addr64(mm->BaseOfImage), + mm->SizeOfImage); else SymLoadModuleExW(hProc, NULL, nameW, NULL, get_addr64(mm->BaseOfImage), mm->SizeOfImage, NULL, SLMFLAG_VIRTUAL); diff --git a/programs/winedbg/tgt_module.c b/programs/winedbg/tgt_module.c index 044e312097d..5341726d5e5 100644 --- a/programs/winedbg/tgt_module.c +++ b/programs/winedbg/tgt_module.c @@ -52,16 +52,30 @@ enum dbg_start tgt_module_load(const char* name, BOOL keep) DWORD opts = SymGetOptions(); HANDLE hDummy = (HANDLE)0x87654321; enum dbg_start ret = start_ok; + WCHAR* nameW; + unsigned len; SymSetOptions((opts & ~(SYMOPT_UNDNAME|SYMOPT_DEFERRED_LOADS)) | SYMOPT_LOAD_LINES | SYMOPT_AUTO_PUBLICS | 0x40000000); if (!dbg_init(hDummy, NULL, FALSE)) return start_error_init; - if (!SymLoadModule(hDummy, NULL, name, NULL, 0, 0)) + len = MultiByteToWideChar(CP_ACP, 0, name, -1, NULL, 0); + nameW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); + if (!nameW) { ret = start_error_init; keep = FALSE; } + else + { + len = MultiByteToWideChar(CP_ACP, 0, name, -1, nameW, len); + if (!dbg_load_module(hDummy, NULL, nameW, 0, 0)) + { + ret = start_error_init; + keep = FALSE; + } + HeapFree(GetProcessHeap(), 0, nameW); + } if (keep) { diff --git a/programs/winedbg/winedbg.c b/programs/winedbg/winedbg.c index 5cbc68faf8f..ab661489779 100644 --- a/programs/winedbg/winedbg.c +++ b/programs/winedbg/winedbg.c @@ -125,22 +125,33 @@ void dbg_outputA(const char* buffer, int len) } } -void dbg_outputW(const WCHAR* buffer, int len) +const char* dbg_W2A(const WCHAR* buffer, unsigned len) { - char* ansi = NULL; - int newlen; - - /* do a serious Unicode to ANSI conversion - * FIXME: should CP_ACP be GetConsoleCP()? - */ + static unsigned ansilen; + static char* ansi; + unsigned newlen; + newlen = WideCharToMultiByte(CP_ACP, 0, buffer, len, NULL, 0, NULL, NULL); - if (newlen) + if (newlen > ansilen) { - if (!(ansi = HeapAlloc(GetProcessHeap(), 0, newlen))) return; - WideCharToMultiByte(CP_ACP, 0, buffer, len, ansi, newlen, NULL, NULL); - dbg_outputA(ansi, newlen); - HeapFree(GetProcessHeap(), 0, ansi); + static char* newansi; + if (ansi) + newansi = HeapReAlloc(GetProcessHeap(), 0, ansi, newlen); + else + newansi = HeapAlloc(GetProcessHeap(), 0, newlen); + if (!newansi) return NULL; + ansilen = newlen; + ansi = newansi; } + WideCharToMultiByte(CP_ACP, 0, buffer, len, ansi, newlen, NULL, NULL); + return ansi; +} + +void dbg_outputW(const WCHAR* buffer, int len) +{ + const char* ansi = dbg_W2A(buffer, len); + if (ansi) dbg_outputA(ansi, strlen(ansi)); + /* FIXME: should CP_ACP be GetConsoleCP()? */ } int dbg_printf(const char* format, ...) @@ -315,13 +326,13 @@ struct dbg_process* dbg_add_process(const struct be_process_io* pio, DWORD pid, return p; } -void dbg_set_process_name(struct dbg_process* p, const char* imageName) +void dbg_set_process_name(struct dbg_process* p, const WCHAR* imageName) { assert(p->imageName == NULL); if (imageName) { - char* tmp = HeapAlloc(GetProcessHeap(), 0, strlen(imageName) + 1); - if (tmp) p->imageName = strcpy(tmp, imageName); + WCHAR* tmp = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(imageName) + 1) * sizeof(WCHAR)); + if (tmp) p->imageName = lstrcpyW(tmp, imageName); } } @@ -352,29 +363,29 @@ void dbg_del_process(struct dbg_process* p) * Initializes the dbghelp library, and also sets the application directory * as a place holder for symbol searches. */ -BOOL dbg_init(HANDLE hProc, const char* in, BOOL invade) +BOOL dbg_init(HANDLE hProc, const WCHAR* in, BOOL invade) { BOOL ret; ret = SymInitialize(hProc, NULL, invade); if (ret && in) { - const char* last; + const WCHAR* last; - for (last = in + strlen(in) - 1; last >= in; last--) + for (last = in + lstrlenW(in) - 1; last >= in; last--) { if (*last == '/' || *last == '\\') { - char* tmp; - tmp = HeapAlloc(GetProcessHeap(), 0, 1024 + 1 + (last - in) + 1); - if (tmp && SymGetSearchPath(hProc, tmp, 1024)) + WCHAR* tmp; + tmp = HeapAlloc(GetProcessHeap(), 0, (1024 + 1 + (last - in) + 1) * sizeof(WCHAR)); + if (tmp && SymGetSearchPathW(hProc, tmp, 1024)) { - char* x = tmp + strlen(tmp); + WCHAR* x = tmp + lstrlenW(tmp); *x++ = ';'; - memcpy(x, in, last - in); + memcpy(x, in, (last - in) * sizeof(WCHAR)); x[last - in] = '\0'; - ret = SymSetSearchPath(hProc, tmp); + ret = SymSetSearchPathW(hProc, tmp); } else ret = FALSE; HeapFree(GetProcessHeap(), 0, tmp); @@ -424,6 +435,19 @@ BOOL dbg_get_debuggee_info(HANDLE hProcess, IMAGEHLP_MODULE* imh_mod) return imh_mod->BaseOfImage != 0; } +BOOL dbg_load_module(HANDLE hProc, HANDLE hFile, const WCHAR* name, DWORD base, DWORD size) +{ + BOOL ret = SymLoadModuleExW(hProc, NULL, name, NULL, base, size, NULL, 0); + if (ret) + { + IMAGEHLP_MODULEW64 ihm; + ihm.SizeOfStruct = sizeof(ihm); + if (SymGetModuleInfoW64(hProc, base, &ihm) && (ihm.PdbUnmatched || ihm.DbgUnmatched)) + dbg_printf("Loaded unmatched debug information for %s\n", wine_dbgstr_w(name)); + } + return ret; +} + struct dbg_thread* dbg_get_thread(struct dbg_process* p, DWORD tid) { struct dbg_thread* t; @@ -477,6 +501,18 @@ void dbg_del_thread(struct dbg_thread* t) HeapFree(GetProcessHeap(), 0, t); } +void dbg_set_option(const char* option, BOOL enable) +{ + if (!strcmp(option, "module")) + { + DWORD opt = SymGetOptions(); + if (enable) opt |= SYMOPT_LOAD_ANYTHING; + else opt &= ~SYMOPT_LOAD_ANYTHING; + SymSetOptions(opt); + } + else dbg_printf("Unknown option '%s'\n", option); +} + BOOL dbg_interrupt_debuggee(void) { if (!dbg_process_list) return FALSE; diff --git a/programs/winefile/winefile.c b/programs/winefile/winefile.c index 1ae314e00bb..a49c2ab1929 100644 --- a/programs/winefile/winefile.c +++ b/programs/winefile/winefile.c @@ -1088,7 +1088,7 @@ static void read_directory_shell(Entry* dir, HWND hwnd) memset(&entry->data, 0, sizeof(WIN32_FIND_DATA)); entry->bhfi_valid = FALSE; - attribs = ~SFGAO_FILESYSTEM; /*SFGAO_HASSUBFOLDER|SFGAO_FOLDER; SFGAO_FILESYSTEM sorgt dafür, daß "My Documents" anstatt von "Martin's Documents" angezeigt wird */ + attribs = ~SFGAO_FILESYSTEM; /*SFGAO_HASSUBFOLDER|SFGAO_FOLDER; SFGAO_FILESYSTEM sorgt dafür, daß "My Documents" anstatt von "Martin's Documents" angezeigt wird */ hr = IShellFolder_GetAttributesOf(folder, 1, (LPCITEMIDLIST*)&pidls[n], &attribs); diff --git a/programs/wordpad/Ko.rc b/programs/wordpad/Ko.rc index 9fcb72512ea..ac246eba81c 100644 --- a/programs/wordpad/Ko.rc +++ b/programs/wordpad/Ko.rc @@ -59,19 +59,19 @@ BEGIN MENUITEM "¹®ÀÚ Çü½Ä(&F)", ID_EDIT_CHARFORMAT MENUITEM "Á¤ÀÇµÈ ¹®ÀÚ¿­ Çü½Ä(&D)", ID_EDIT_DEFCHARFORMAT MENUITEM "´Ü¶ô Çü½Ä(&H)", ID_EDIT_PARAFORMAT - MENUITEM "ÅؽºÆ® ¾ò±â(&G)", ID_EDIT_GETTEXT + MENUITEM "¹®ÀÚ¿­ ¾ò±â(&G)", ID_EDIT_GETTEXT END END POPUP "º¸±â(&V)" BEGIN MENUITEM "µµ±¸¹Ù(&T)", ID_TOGGLE_TOOLBAR MENUITEM "Çü½Ä¹Ù(&F)", ID_TOGGLE_FORMATBAR - MENUITEM "&Ruler", ID_TOGGLE_RULER + MENUITEM "´«±Ý¹Ù(&R)", ID_TOGGLE_RULER MENUITEM "»óŹÙ(&S)", ID_TOGGLE_STATUSBAR MENUITEM SEPARATOR MENUITEM " ¿É¼Ç(&O)...", ID_VIEWPROPERTIES END - POPUP "Áý¾î³Ö±â(&I)" + POPUP "»ðÀÔ(&I)" BEGIN MENUITEM "³¯Â¥¿Í ½Ã°£(&D)...", ID_DATETIME END @@ -89,7 +89,7 @@ BEGIN END POPUP "µµ¿ò¸»(&H)" BEGIN - MENUITEM "¿öµåÆеå Á¤º¸(&A)" ID_ABOUT + MENUITEM "Wine ¿öµåÆеå Á¤º¸(&A)" ID_ABOUT END END @@ -237,4 +237,9 @@ BEGIN "´ç½ÅÀº Á¤¸»·Î ÀúÀåÇϱ⸦ ¿øÇմϱî?" STRING_INVALID_NUMBER, "¿Ã¹Ù¸£Áö ¾ÊÀº ¼ö Çü½Ä" STRING_OLE_STORAGE_NOT_SUPPORTED, "OLE ÀúÀå ¹®¼­´Â Áö¿øµÇÁö ¾Ê½À´Ï´Ù" + STRING_WRITE_FAILED, "ÆÄÀÏÀ» ÀúÀåÇÒ ¼ö ¾ø½À´Ï´Ù." + STRING_WRITE_ACCESS_DENIED, "ÆÄÀÏÀ» ÀúÀåÇÒ ±ÇÇÑÀÌ ¾ø½À´Ï´Ù." + STRING_OPEN_FAILED, "ÆÄÀÏÀ» ¿­ ¼ö ¾ø½À´Ï´Ù." + STRING_OPEN_ACCESS_DENIED, "ÆÄÀÏÀ» ¿­ ±ÇÇÑÀÌ ¾ø½À´Ï´Ù." + STRING_PRINTING_NOT_IMPLEMENTED, "Àμâ´Â Áö¿øµÇÁö ¾Ê½À´Ï´Ù" END diff --git a/programs/wordpad/Pt.rc b/programs/wordpad/Pt.rc new file mode 100644 index 00000000000..ce153265bd9 --- /dev/null +++ b/programs/wordpad/Pt.rc @@ -0,0 +1,245 @@ +/* + * Portuguese Language File + * + * Copyright 2008 Ricardo Filipe + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +LANGUAGE LANG_PORTUGUESE, SUBLANG_NEUTRAL + +IDM_MAINMENU MENU DISCARDABLE +BEGIN + POPUP "&Ficheiro" + BEGIN + MENUITEM "&Novo...\tCtrl+N", ID_FILE_NEW + MENUITEM "&Abrir...\tCtrl+O", ID_FILE_OPEN + MENUITEM "&Guardar\tCtrl+S", ID_FILE_SAVE + MENUITEM "Guardar &como...", ID_FILE_SAVEAS + MENUITEM SEPARATOR + MENUITEM "&Imprimir...\tCtrl+P", ID_PRINT + MENUITEM "&Pré visualizar...", ID_PREVIEW + MENUITEM "C&onfigurar página...", ID_PRINTSETUP + MENUITEM SEPARATOR + MENUITEM "&Sair", ID_FILE_EXIT + END + POPUP "&Editar" + BEGIN + MENUITEM "&Anular\tCtrl+Z", ID_EDIT_UNDO + MENUITEM "&Refazer\tCtrl+Y", ID_EDIT_REDO + MENUITEM SEPARATOR + MENUITEM "&Cortar\tCtrl+X", ID_EDIT_CUT + MENUITEM "C&opiar\tCtrl+C", ID_EDIT_COPY + MENUITEM "Col&ar\tCtrl+V", ID_EDIT_PASTE + MENUITEM "&Limpar\tDEL", ID_EDIT_CLEAR + MENUITEM "&Seleccionar tudo\tCtrl+A", ID_EDIT_SELECTALL + MENUITEM SEPARATOR + MENUITEM "Local&izar...\tCrtl+F", ID_FIND + MENUITEM "&Encontrar Seguinte\tF3", ID_FIND_NEXT + MENUITEM "&Substituir...\tCtrl+H", ID_REPLACE + MENUITEM SEPARATOR + MENUITEM "Some&nte leitura", ID_EDIT_READONLY + MENUITEM "&Modificado", ID_EDIT_MODIFIED + MENUITEM SEPARATOR + POPUP "E&xtras" + BEGIN + MENUITEM "&Informação da selecção", ID_EDIT_SELECTIONINFO + MENUITEM "&Formato dos caracteres", ID_EDIT_CHARFORMAT + MENUITEM "&Definir formato dos caracteres", ID_EDIT_DEFCHARFORMAT + MENUITEM "F&ormato dos parágrafos", ID_EDIT_PARAFORMAT + MENUITEM "&Buscar texto", ID_EDIT_GETTEXT + END + END + POPUP "&Ver" + BEGIN + MENUITEM "&Barra de Ferramentas", ID_TOGGLE_TOOLBAR + MENUITEM "Barra de &Formatação", ID_TOGGLE_FORMATBAR + MENUITEM "&Régua", ID_TOGGLE_RULER + MENUITEM "Barra de &Estado", ID_TOGGLE_STATUSBAR + MENUITEM SEPARATOR + MENUITEM "&Opções...", ID_VIEWPROPERTIES + END + POPUP "&Inserir" + BEGIN + MENUITEM "&Data e hora...", ID_DATETIME + END + POPUP "F&ormato" + BEGIN + MENUITEM "&Tipo de Letra...", ID_FONTSETTINGS + MENUITEM "&Lista de marcas" ID_BULLET + MENUITEM "&Parágrafo..." ID_PARAFORMAT + MENUITEM "T&abulações..." ID_TABSTOPS + POPUP "&Fundo" + BEGIN + MENUITEM "&Sistema\tCtrl+1", ID_BACK_1 + MENUITEM "&PostThat amarelo\tCtrl+2", ID_BACK_2 + END + END + POPUP "&Ajuda" + BEGIN + MENUITEM "&Sobre Wine Wordpad" ID_ABOUT + END +END + +IDM_POPUP MENU DISCARDABLE +BEGIN + POPUP "" + BEGIN + MENUITEM "&Cortar", ID_EDIT_CUT + MENUITEM "C&opiar", ID_EDIT_COPY + MENUITEM "Co&lar", ID_EDIT_PASTE + MENUITEM SEPARATOR + MENUITEM "&Lista de marcas" ID_BULLET + MENUITEM "&Parágrafo..." ID_PARAFORMAT + END +END + +IDD_DATETIME DIALOG DISCARDABLE 30, 20, 130, 80 +STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU +CAPTION "Data e hora" +FONT 10, "MS Sans Serif" +BEGIN + LTEXT "Formatos Disponíveis",0,3,2,100,15 + LISTBOX IDC_DATETIME,3,12,80,65,LBS_NOINTEGRALHEIGHT + PUSHBUTTON "&OK",IDOK,87,12,40,12 + PUSHBUTTON "&Cancelar",IDCANCEL,87,26,40,12 +END + +IDD_NEWFILE DIALOG DISCARDABLE 30, 20, 140, 80 +STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU +CAPTION "Novo" +FONT 10, "MS Sans Serif" +BEGIN + LTEXT "Novo tipo de documento",0,3,2,100,15 + LISTBOX IDC_NEWFILE,3,12,90,65,LBS_NOINTEGRALHEIGHT + PUSHBUTTON "&OK",IDOK,97,12,40,12 + PUSHBUTTON "&Cancelar",IDCANCEL,97,26,40,12 +END + +IDD_PARAFORMAT DIALOG DISCARDABLE 30, 20, 200, 110 +STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU +Caption "Parágrafo" +FONT 8, "MS Shell Dlg" +BEGIN + GROUPBOX "Identação", 0, 10, 10, 120, 68 + LTEXT "Esquerda", 0, 15, 22, 40, 13 + EDITTEXT IDC_PARA_LEFT, 55, 20, 60, 13 + LTEXT "Direita", 0, 15, 40, 40, 13 + EDITTEXT IDC_PARA_RIGHT, 55, 38, 60, 13 + LTEXT "Primeira Linha", 0, 15, 58, 40, 13 + EDITTEXT IDC_PARA_FIRST, 55, 56, 60, 13 + LTEXT "Alinhamento", 0, 15, 87, 40, 13 + COMBOBOX IDC_PARA_ALIGN, 55, 85, 60, 60, CBS_DROPDOWNLIST + PUSHBUTTON "&OK", IDOK, 137, 15, 50, 15 + PUSHBUTTON "&Cancelar", IDCANCEL, 137, 33, 50, 15 +END + +IDD_TABSTOPS DIALOG DISCARDABLE 30, 20, 200, 110 +STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU +Caption "Tabulações" +FONT 8, "MS SHell DLg" +BEGIN + GROUPBOX "Marca de tabulação", 0, 10, 10, 120, 90 + COMBOBOX IDC_TABSTOPS, 20, 20, 100, 60, CBS_SIMPLE | CBS_SORT + DEFPUSHBUTTON "&Adicionar", ID_TAB_ADD, 20, 80, 45, 15 + PUSHBUTTON "&Remover", ID_TAB_DEL, 72, 80, 45, 15 + PUSHBUTTON "&OK", IDOK, 135, 15, 55, 15 + PUSHBUTTON "&Cancelar", IDCANCEL, 135, 33, 55, 15 + PUSHBUTTON "Remover &todos", ID_TAB_EMPTY, 135, 51, 55, 15 +END + +IDD_FORMATOPTS DIALOG DISCARDABLE 0, 0, 280, 110 +STYLE DS_SYSMODAL +Caption "" +FONT 8, "MS Shell Dlg" +BEGIN + GROUPBOX "Moldar o texto", 0, 10, 10, 130, 85 + RADIOBUTTON "&Sem moldagem", IDC_PAGEFMT_WN, 18, 25, 117, 15 + RADIOBUTTON "&Moldar à janela", IDC_PAGEFMT_WW, 18, 45, 117, 15 + RADIOBUTTON "Moldar pela &régua", IDC_PAGEFMT_WM, 18, 65, 117, 15 + GROUPBOX "Barras de Ferramentas", 0, 150, 10, 120, 85 + CHECKBOX "&Barra de Ferramentas", IDC_PAGEFMT_TB, 160, 20, 90, 15 + CHECKBOX "Barra de &Formatação", IDC_PAGEFMT_FB, 160, 38, 90, 15 + CHECKBOX "&Régua", IDC_PAGEFMT_RU, 160, 56, 90, 15 + CHECKBOX "Barra de &Estado", IDC_PAGEFMT_SB, 160, 74, 90, 15 + LTEXT "", IDC_PAGEFMT_ID, 0,0,0,0 +END + +STRINGTABLE DISCARDABLE +BEGIN + STRING_RICHTEXT_FILES_RTF, "Rich text format (*.rtf)" + STRING_TEXT_FILES_TXT, "Documentos de texto (*.txt)" + STRING_TEXT_FILES_UNICODE_TXT, "Documentos de texto Unicode (*.txt)" + STRING_ALL_FILES, "Todos os documentos (*.*)" +END + +STRINGTABLE DISCARDABLE +BEGIN + STRING_ALIGN_LEFT, "Esquerda" + STRING_ALIGN_RIGHT, "Direita" + STRING_ALIGN_CENTER, "Centro" +END + +STRINGTABLE DISCARDABLE +BEGIN + STRING_NEWFILE_RICHTEXT, "Rich text document" + STRING_NEWFILE_TXT, "Documento de texto" + STRING_NEWFILE_TXT_UNICODE, "Documento de texto Unicode" +END + +STRINGTABLE DISCARDABLE +BEGIN + STRING_PRINTER_FILES_PRN, "Ficheiros de impressora (*.PRN)" +END + +STRINGTABLE DISCARDABLE +BEGIN + STRING_VIEWPROPS_TITLE, "Opções" + STRING_VIEWPROPS_TEXT, "Texto" + STRING_VIEWPROPS_RICHTEXT, "Rich text" +END + +STRINGTABLE DISCARDABLE +BEGIN + STRING_PREVIEW_PRINT, "Imprimir" + STRING_PREVIEW_NEXTPAGE, "Próxima página" + STRING_PREVIEW_PREVPAGE, "Página anterior" + STRING_PREVIEW_TWOPAGES, "Duas páginas" + STRING_PREVIEW_ONEPAGE, "Uma página" + STRING_PREVIEW_CLOSE, "Fechar" +END + +STRINGTABLE DISCARDABLE +BEGIN + STRING_UNITS_CM, "cm" +END + +STRINGTABLE DISCARDABLE +BEGIN + STRING_DEFAULT_FILENAME, "Documento" + STRING_PROMPT_SAVE_CHANGES, "Guardar alterações a '%s'?" + STRING_SEARCH_FINISHED, "Acabou a pesquisa do documento." + STRING_LOAD_RICHED_FAILED, "Falhou o carregamento da biblioteca RichEdit." + STRING_SAVE_LOSEFORMATTING, "Escolheu guardar em formato de texto simples, " \ + "o que vai anular todas as formatações. " \ + "Tem a certeza que quer fazer isto?" + STRING_INVALID_NUMBER, "Formato de número inválido" + STRING_OLE_STORAGE_NOT_SUPPORTED, "Documentos OLE não são suportados" + STRING_WRITE_FAILED, "Não foi possível guardar o ficheiro." + STRING_WRITE_ACCESS_DENIED, "Não tem permissões para guardar o ficheiro." + STRING_OPEN_FAILED, "Não foi possível abrir o ficheiro." + STRING_OPEN_ACCESS_DENIED, "Não tem permissões para abrir o ficheiro." + STRING_PRINTING_NOT_IMPLEMENTED, "Impressão não implementada" +END diff --git a/programs/wordpad/rsrc.rc b/programs/wordpad/rsrc.rc index 49482adf13d..4839e2b1788 100644 --- a/programs/wordpad/rsrc.rc +++ b/programs/wordpad/rsrc.rc @@ -74,6 +74,7 @@ IDI_TXT ICON "txt.ico" #include "Nl.rc" #include "No.rc" #include "Pl.rc" +#include "Pt.rc" #include "Ru.rc" #include "Si.rc" #include "Tr.rc" diff --git a/programs/wordpad/wordpad.c b/programs/wordpad/wordpad.c index 754ae50a9cd..d06b2d993f7 100644 --- a/programs/wordpad/wordpad.c +++ b/programs/wordpad/wordpad.c @@ -116,6 +116,25 @@ static void DoLoadStrings(void) LoadStringW(hInstance, STRING_UNITS_CM, units_cmW, MAX_STRING_LEN); } +/* Show a message box with resource strings */ +static int MessageBoxWithResStringW(HWND hWnd, LPCWSTR lpText, LPCWSTR lpCaption, UINT uType) +{ + MSGBOXPARAMSW params; + + params.cbSize = sizeof(params); + params.hwndOwner = hWnd; + params.hInstance = GetModuleHandleW(0); + params.lpszText = lpText; + params.lpszCaption = lpCaption; + params.dwStyle = uType; + params.lpszIcon = NULL; + params.dwContextHelpId = 0; + params.lpfnMsgBoxCallback = NULL; + params.dwLanguageId = 0; + return MessageBoxIndirectW(¶ms); +} + + static void AddButton(HWND hwndToolBar, int nImage, int nCommand) { TBBUTTON button; @@ -289,7 +308,7 @@ static void on_sizelist_modified(HWND hwndSizeList, LPWSTR wszNewFontSize) } else { SetWindowTextW(hwndSizeList, sizeBuffer); - MessageBoxW(hMainWnd, MAKEINTRESOURCEW(STRING_INVALID_NUMBER), + MessageBoxWithResStringW(hMainWnd, MAKEINTRESOURCEW(STRING_INVALID_NUMBER), wszAppTitle, MB_OK | MB_ICONINFORMATION); } } @@ -747,8 +766,8 @@ static void DoOpenFile(LPCWSTR szOpenFileName) else if (!memcmp(STG_magic, fileStart, sizeof(STG_magic))) { CloseHandle(hFile); - MessageBoxW(hMainWnd, MAKEINTRESOURCEW(STRING_OLE_STORAGE_NOT_SUPPORTED), wszAppTitle, - MB_OK | MB_ICONEXCLAMATION); + MessageBoxWithResStringW(hMainWnd, MAKEINTRESOURCEW(STRING_OLE_STORAGE_NOT_SUPPORTED), + wszAppTitle, MB_OK | MB_ICONEXCLAMATION); return; } } @@ -863,7 +882,7 @@ static void DialogSaveFile(void) { if(fileformat_flags(sfn.nFilterIndex-1) != SF_RTF) { - if(MessageBoxW(hMainWnd, MAKEINTRESOURCEW(STRING_SAVE_LOSEFORMATTING), + if(MessageBoxWithResStringW(hMainWnd, MAKEINTRESOURCEW(STRING_SAVE_LOSEFORMATTING), wszAppTitle, MB_YESNO | MB_ICONEXCLAMATION) != IDYES) { continue; @@ -1161,7 +1180,7 @@ static void HandleCommandLine(LPWSTR cmdline) } if (opt_print) - MessageBoxW(hMainWnd, MAKEINTRESOURCEW(STRING_PRINTING_NOT_IMPLEMENTED), wszAppTitle, MB_OK); + MessageBoxWithResStringW(hMainWnd, MAKEINTRESOURCEW(STRING_PRINTING_NOT_IMPLEMENTED), wszAppTitle, MB_OK); } static LRESULT handle_findmsg(LPFINDREPLACEW pFr) @@ -1239,7 +1258,7 @@ static LRESULT handle_findmsg(LPFINDREPLACEW pFr) if(ret == -1) { pFr->lCustData = -1; - MessageBoxW(hMainWnd, MAKEINTRESOURCEW(STRING_SEARCH_FINISHED), wszAppTitle, + MessageBoxWithResStringW(hMainWnd, MAKEINTRESOURCEW(STRING_SEARCH_FINISHED), wszAppTitle, MB_OK | MB_ICONASTERISK); } else { @@ -1503,7 +1522,7 @@ static INT_PTR CALLBACK paraformat_proc(HWND hWnd, UINT message, WPARAM wParam, if(ret != 3) { - MessageBoxW(hMainWnd, MAKEINTRESOURCEW(STRING_INVALID_NUMBER), + MessageBoxWithResStringW(hMainWnd, MAKEINTRESOURCEW(STRING_INVALID_NUMBER), wszAppTitle, MB_OK | MB_ICONASTERISK); return FALSE; } else @@ -1615,7 +1634,7 @@ static INT_PTR CALLBACK tabstops_proc(HWND hWnd, UINT message, WPARAM wParam, LP if(!number_from_string(buffer, &number, TRUE)) { - MessageBoxW(hWnd, MAKEINTRESOURCEW(STRING_INVALID_NUMBER), + MessageBoxWithResStringW(hWnd, MAKEINTRESOURCEW(STRING_INVALID_NUMBER), wszAppTitle, MB_OK | MB_ICONINFORMATION); } else { @@ -1817,7 +1836,7 @@ static LRESULT OnCreate( HWND hWnd ) hDLL = LoadLibraryW(wszRichEditDll); if(!hDLL) { - MessageBoxW(hWnd, MAKEINTRESOURCEW(STRING_LOAD_RICHED_FAILED), wszAppTitle, + MessageBoxWithResStringW(hWnd, MAKEINTRESOURCEW(STRING_LOAD_RICHED_FAILED), wszAppTitle, MB_OK | MB_ICONEXCLAMATION); PostQuitMessage(1); } diff --git a/dlls/winedos/dosvm.h b/programs/write/Pt.rc similarity index 75% copy from dlls/winedos/dosvm.h copy to programs/write/Pt.rc index 36168283f34..e2ba2eb978d 100644 --- a/dlls/winedos/dosvm.h +++ b/programs/write/Pt.rc @@ -1,7 +1,7 @@ /* - * DOS virtual machine + * Portuguese language support * - * Copyright 2000 Ove Kåven + * Copyright (C) 2008 Ricardo Filipe * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -18,16 +18,9 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ -#ifndef __WINE_DOSVM_H -#define __WINE_DOSVM_H +LANGUAGE LANG_PORTUGUESE, SUBLANG_NEUTRAL -#include /* pid_t */ - -typedef struct { - PAPCFUNC proc; - ULONG_PTR arg; -} DOS_SPC; - -extern pid_t dosvm_pid; - -#endif /* __WINE_DOSVM_H */ +STRINGTABLE +{ + IDS_FAILED, "Falhou ao iniciar o Wordpad" +} diff --git a/programs/write/rsrc.rc b/programs/write/rsrc.rc index fa825840fdd..7ec9e31af00 100644 --- a/programs/write/rsrc.rc +++ b/programs/write/rsrc.rc @@ -30,6 +30,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL #include "Nl.rc" #include "No.rc" #include "Pl.rc" +#include "Pt.rc" #include "Ro.rc" #include "Ru.rc" #include "Si.rc" diff --git a/programs/xcopy/Pt.rc b/programs/xcopy/Pt.rc new file mode 100644 index 00000000000..47e9609bd7f --- /dev/null +++ b/programs/xcopy/Pt.rc @@ -0,0 +1,79 @@ +/* + * XCOPY - Wine-compatible xcopy program + * Portuguese language support + * + * Copyright (C) 2008 Ricardo Filipe + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + + +LANGUAGE LANG_PORTUGUESE, SUBLANG_NEUTRAL + +STRINGTABLE +{ + STRING_INVPARMS, "Número de parâmetros inválido - Use xcopy /? para ajuda\n" + STRING_INVPARM, "Parâmetro inválido '%s' - Use xcopy /? para ajuda\n" + STRING_PAUSE, "Carregue para iniciar cópia\n" + STRING_SIMCOPY, "%d ficheiro(s) seriam copiados\n" + STRING_COPY, "%d ficheiro(s) copiados\n" + STRING_QISDIR, "'%s' é um ficheiro ou directório\n" \ + "no alvo?\n" \ + "(F - Ficheiro, D - Directório)\n" + STRING_SRCPROMPT,"%s? (Yes|No)\n" + STRING_OVERWRITE,"Reescrever %s? (Yes|No|All)\n" + STRING_COPYFAIL, "Cópia de '%s' para '%s' falhou com r/c %d\n" + STRING_OPENFAIL, "Falhou ao abrir '%s'\n" + STRING_READFAIL, "Falhou a ler '%s'\n" + STRING_YES_CHAR, "Y" + STRING_NO_CHAR, "N" + STRING_ALL_CHAR, "A" + STRING_FILE_CHAR,"F" + STRING_DIR_CHAR, "D" + + STRING_HELP, +"XCOPY - Copia ficheiros ou directórios para um destino\n\ +\n\ +Sintaxe:\n\ +XCOPY source [dest] [/I] [/S] [/Q] [/F] [/L] [/W] [/T] [/N] [/U]\n\ +\t [/R] [/H] [/C] [/P] [/A] [/M] [/E] [/D] [/Y] [/-Y]\n\ +\n\ +Onde:\n\ +\n\ +[/I] Assume directório se o destino não existe e está a copiar 2 ou\n\ +\tmais ficheiros\n\ +[/S] Copiar directórios e subdirectórios\n\ +[/E] Copiar directórios e subdirectórios, incluindo os vazios\n\ +[/Q] Não mostrar nomes durante a cópia, ie quiet.\n\ +[/F] Mostrar por completo os nomes de fonte e destino durante a cópia\n\ +[/L] Simular a operação, mostrando os nomes que seriam copiados\n\ +[/W] Alerta antes de iniciar a operação de cópia\n\ +[/T] Cria a estrutura de directórios mas não copia ficheiros\n\ +[/Y] Suprimir alertas quando reescreve ficheiros\n\ +[/-Y] Alertar quando reescreve ficheiros\n\ +[/P] Alertar antes de cada ficheiros ser copiado\n\ +[/N] Copiar usando nomes pequenos\n\ +[/U] Copiar apenas ficheiros que já existem no destino\n\ +[/R] Reescrever quaisquer ficheiros apenas de leitura\n\ +[/H] Incluir ficheiros ocultos e de sistema na cópia\n\ +[/C] Continuar mesmo que ocorra um erro durante a cópia\n\ +[/A] Copiar apenas ficheiros com atributo de arquivo\n\ +[/M] Copiar apenas ficheiros com atributo de arquivo, removendo\n\ +\to atributo de arquivo\n\ +[/D | /D:m-d-y] Copiar novos ficheiros ou os alterados após a data fornecida\n\ +\t\tSe nenhuma data for fornecida, apenas copiar se o destino for mais antigo\n\ +\t\tque a fonte\n\n" + +} diff --git a/programs/xcopy/rsrc.rc b/programs/xcopy/rsrc.rc index 9547668fcf0..dcbc81152d1 100644 --- a/programs/xcopy/rsrc.rc +++ b/programs/xcopy/rsrc.rc @@ -30,5 +30,6 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL #include "Nl.rc" #include "No.rc" #include "Pl.rc" +#include "Pt.rc" #include "Ru.rc" #include "Si.rc" diff --git a/server/context_alpha.c b/server/context_alpha.c index dd24c6db295..29bd73e3850 100644 --- a/server/context_alpha.c +++ b/server/context_alpha.c @@ -1,7 +1,7 @@ /* * Alpha register context support * - * Copyright (C) 2004 Vincent Béron + * Copyright (C) 2004 Vincent Béron * * 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/server/directory.c b/server/directory.c index d1d323cccc6..f2545eadb5b 100644 --- a/server/directory.c +++ b/server/directory.c @@ -508,3 +508,15 @@ DECL_HANDLER(get_directory_entry) release_object( dir ); } } + +/* unlink a named object */ +DECL_HANDLER(unlink_object) +{ + struct object *obj = get_handle_obj( current->process, req->handle, 0, NULL ); + + if (obj) + { + unlink_named_object( obj ); + release_object( obj ); + } +} diff --git a/server/protocol.def b/server/protocol.def index d9fd48cb28a..b1258b2f78a 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -2913,6 +2913,13 @@ enum message_type unsigned int ref_count; /* object ref count */ @END + +/* Unlink a named object */ +@REQ(unlink_object) + obj_handle_t handle; /* handle to the object */ +@END + + /* Query the impersonation level of an impersonation token */ @REQ(get_token_impersonation_level) obj_handle_t handle; /* handle to the object */ diff --git a/server/request.h b/server/request.h index 308b6205b4e..5fc5236004a 100644 --- a/server/request.h +++ b/server/request.h @@ -328,6 +328,7 @@ DECL_HANDLER(create_symlink); DECL_HANDLER(open_symlink); DECL_HANDLER(query_symlink); DECL_HANDLER(get_object_info); +DECL_HANDLER(unlink_object); DECL_HANDLER(get_token_impersonation_level); DECL_HANDLER(allocate_locally_unique_id); DECL_HANDLER(create_device_manager); @@ -568,6 +569,7 @@ static const req_handler req_handlers[REQ_NB_REQUESTS] = (req_handler)req_open_symlink, (req_handler)req_query_symlink, (req_handler)req_get_object_info, + (req_handler)req_unlink_object, (req_handler)req_get_token_impersonation_level, (req_handler)req_allocate_locally_unique_id, (req_handler)req_create_device_manager, diff --git a/server/sock.c b/server/sock.c index f4fe25e9177..38f9d659362 100644 --- a/server/sock.c +++ b/server/sock.c @@ -1,7 +1,7 @@ /* * Server-side socket management * - * Copyright (C) 1999 Marcus Meissner, Ove Kåven + * Copyright (C) 1999 Marcus Meissner, Ove Kåven * * 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/server/trace.c b/server/trace.c index 8cdc0214c4c..8e1737eb8c6 100644 --- a/server/trace.c +++ b/server/trace.c @@ -3595,6 +3595,11 @@ static void dump_get_object_info_reply( const struct get_object_info_reply *req fprintf( stderr, " ref_count=%08x", req->ref_count ); } +static void dump_unlink_object_request( const struct unlink_object_request *req ) +{ + fprintf( stderr, " handle=%p", req->handle ); +} + static void dump_get_token_impersonation_level_request( const struct get_token_impersonation_level_request *req ) { fprintf( stderr, " handle=%p", req->handle ); @@ -4011,6 +4016,7 @@ static const dump_func req_dumpers[REQ_NB_REQUESTS] = { (dump_func)dump_open_symlink_request, (dump_func)dump_query_symlink_request, (dump_func)dump_get_object_info_request, + (dump_func)dump_unlink_object_request, (dump_func)dump_get_token_impersonation_level_request, (dump_func)dump_allocate_locally_unique_id_request, (dump_func)dump_create_device_manager_request, @@ -4248,6 +4254,7 @@ static const dump_func reply_dumpers[REQ_NB_REQUESTS] = { (dump_func)dump_open_symlink_reply, (dump_func)dump_query_symlink_reply, (dump_func)dump_get_object_info_reply, + (dump_func)0, (dump_func)dump_get_token_impersonation_level_reply, (dump_func)dump_allocate_locally_unique_id_reply, (dump_func)dump_create_device_manager_reply, @@ -4485,6 +4492,7 @@ static const char * const req_names[REQ_NB_REQUESTS] = { "open_symlink", "query_symlink", "get_object_info", + "unlink_object", "get_token_impersonation_level", "allocate_locally_unique_id", "create_device_manager", diff --git a/tools/widl/parser.l b/tools/widl/parser.l index 6a02f509cc7..dba27ea7387 100644 --- a/tools/widl/parser.l +++ b/tools/widl/parser.l @@ -47,6 +47,8 @@ double [0-9]+\.[0-9]+([eE][+-]?[0-9]+)* #include #include #include +#include +#include #ifdef HAVE_UNISTD_H #include @@ -82,6 +84,19 @@ struct { } import_stack[MAX_IMPORT_DEPTH]; int import_stack_ptr = 0; +/* converts an integer in string form to an unsigned long and prints an error + * on overflow */ +static unsigned long xstrtoul(const char *nptr, char **endptr, int base) +{ + unsigned long l; + + errno = 0; + l = strtoul(nptr, endptr, base); + if (l == ULONG_MAX && errno == ERANGE) + error_loc("integer constant %s is too large\n", nptr); + return l; +} + UUID *parse_uuid(const char *u) { UUID* uuid = xmalloc(sizeof(UUID)); @@ -154,11 +169,11 @@ UUID *parse_uuid(const char *u) return aUUID; } {hex} { - parser_lval.num = strtoul(yytext, NULL, 0); + parser_lval.num = xstrtoul(yytext, NULL, 0); return aHEXNUM; } {int} { - parser_lval.num = strtoul(yytext, NULL, 0); + parser_lval.num = xstrtoul(yytext, NULL, 0); return aNUM; } {double} { diff --git a/tools/wineinstall b/tools/wineinstall index 636be558091..fe48505c03b 100755 --- a/tools/wineinstall +++ b/tools/wineinstall @@ -1,8 +1,8 @@ -#!/bin/bash +#!/bin/sh # WINE Installation script # Can do almost everything from compiling to configuring... # -# Copyright 1999 Ove Kåven +# Copyright 1999 Ove Kåven # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -22,13 +22,11 @@ #--- defaults (change these if you are a packager) CONFARGS="" # configure args, e.g. --prefix=/usr -# functions - -function std_sleep { +std_sleep() { sleep 1 } -function conf_yesno_answer { +conf_yesno_answer() { unset ANSWER while [ "$ANSWER" != 'yes' ] && [ "$ANSWER" != 'no' ] do { diff --git a/tools/wineprefixcreate.in b/tools/wineprefixcreate.in index afdfc84e780..5612dfdb78d 100644 --- a/tools/wineprefixcreate.in +++ b/tools/wineprefixcreate.in @@ -2,7 +2,7 @@ # # Script to create the initial WINEPREFIX directory # -# Copyright 1999 Ove Kåven +# Copyright 1999 Ove Kåven # Copyright 2004 Chris Morgan # Copyright 2004 Alexandre Julliard # diff --git a/tools/wmc/lang.c b/tools/wmc/lang.c index e33a655be8d..b045612bb65 100644 --- a/tools/wmc/lang.c +++ b/tools/wmc/lang.c @@ -50,7 +50,7 @@ static const language_t languages[] = { {0x0011, 932, 932, "Japanese", NULL}, {0x0012, 949, 949, "Korean", NULL}, {0x0013, 850, 1252, "Dutch", NULL}, - {0x0014, 850, 1252, "Norwegian (Bokmål)", NULL}, + {0x0014, 850, 1252, "Norwegian (Bokmål)", NULL}, {0x0015, 852, 1250, "Polish", NULL}, {0x0016, 850, 1252, "Portuguese", NULL}, {0x0018, 852, 1250, "Romanian", NULL}, @@ -90,7 +90,7 @@ static const language_t languages[] = { {0x0411, 932, 932, "Japanese", "Japan"}, {0x0412, 949, 949, "Korean", "Korea (south)"}, {0x0413, 850, 1252, "Dutch", "Netherlands"}, - {0x0414, 850, 1252, "Norwegian (Bokmål)", "Norway"}, + {0x0414, 850, 1252, "Norwegian (Bokmål)", "Norway"}, {0x0415, 852, 1250, "Polish", "Poland"}, {0x0416, 850, 1252, "Portuguese", "Brazil"}, {0x0418, 852, 1250, "Romanian", "Romania"}, diff --git a/tools/wrc/parser.l b/tools/wrc/parser.l index 0ef1b0a1964..2ed5f4b29ef 100644 --- a/tools/wrc/parser.l +++ b/tools/wrc/parser.l @@ -103,6 +103,8 @@ cident [a-zA-Z_][0-9a-zA-Z_]* #include #include #include +#include +#include #ifndef HAVE_UNISTD_H #define YY_NO_UNISTD_H @@ -295,6 +297,19 @@ static struct keyword *iskeyword(char *kw) return kwp; } +/* converts an integer in string form to an unsigned long and prints an error + * on overflow */ +static unsigned long xstrtoul(const char *nptr, char **endptr, int base) +{ + unsigned long l; + + errno = 0; + l = strtoul(nptr, endptr, base); + if (l == ULONG_MAX && errno == ERANGE) + parser_error("integer constant %s is too large\n", nptr); + return l; +} + %} /* @@ -359,7 +374,7 @@ static struct keyword *iskeyword(char *kw) yy_pop_state(); while (*p < '0' || *p > '9') p++; current_codepage = strtol( p, NULL, 10 ); - if (current_codepage && current_codepage != CP_UTF8 && !wine_cp_get_table( current_codepage )) + if (current_codepage != CP_UTF8 && !wine_cp_get_table( current_codepage )) { parser_error("Codepage %d not supported", current_codepage); current_codepage = 0; @@ -378,9 +393,9 @@ static struct keyword *iskeyword(char *kw) \{ return tBEGIN; \} return tEND; -[0-9]+[lL]? { parser_lval.num = strtoul(yytext, 0, 10); return toupper(yytext[yyleng-1]) == 'L' ? tLNUMBER : tNUMBER; } -0[xX][0-9A-Fa-f]+[lL]? { parser_lval.num = strtoul(yytext, 0, 16); return toupper(yytext[yyleng-1]) == 'L' ? tLNUMBER : tNUMBER; } -0[oO][0-7]+[lL]? { parser_lval.num = strtoul(yytext+2, 0, 8); return toupper(yytext[yyleng-1]) == 'L' ? tLNUMBER : tNUMBER; } +[0-9]+[lL]? { parser_lval.num = xstrtoul(yytext, 0, 10); return toupper(yytext[yyleng-1]) == 'L' ? tLNUMBER : tNUMBER; } +0[xX][0-9A-Fa-f]+[lL]? { parser_lval.num = xstrtoul(yytext, 0, 16); return toupper(yytext[yyleng-1]) == 'L' ? tLNUMBER : tNUMBER; } +0[oO][0-7]+[lL]? { parser_lval.num = xstrtoul(yytext+2, 0, 8); return toupper(yytext[yyleng-1]) == 'L' ? tLNUMBER : tNUMBER; } /* * The next two rules scan identifiers and filenames. diff --git a/tools/wrc/translation.c b/tools/wrc/translation.c index 96b30abaa12..7262a658476 100644 --- a/tools/wrc/translation.c +++ b/tools/wrc/translation.c @@ -1,5 +1,5 @@ /* - * Copyright 2003 Vincent Béron + * Copyright 2003 Vincent Béron * Copyright 2007, 2008 Mikolaj Zalewski * * This library is free software; you can redistribute it and/or -- 2.11.4.GIT